mirror of
https://github.com/logseq/logseq.git
synced 2026-04-25 06:35:02 +00:00
enhance(ui): WIP optimization for the shui popup related fundamental components
This commit is contained in:
4
.gitmodules
vendored
Normal file
4
.gitmodules
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
[submodule "packages/ui/primitives"]
|
||||||
|
path = packages/ui/primitives
|
||||||
|
url = https://github.com/xyhp915/primitives.git
|
||||||
|
shallow = true
|
||||||
11
deps/shui/src/logseq/shui/popup/core.cljs
vendored
11
deps/shui/src/logseq/shui/popup/core.cljs
vendored
@@ -164,6 +164,7 @@
|
|||||||
:top y
|
:top y
|
||||||
:left x}} ""))
|
:left x}} ""))
|
||||||
(let [content-props (cond-> (merge {:onEscapeKeyDown #(hide! id)
|
(let [content-props (cond-> (merge {:onEscapeKeyDown #(hide! id)
|
||||||
|
:disableOutsideScroll false
|
||||||
:onPointerDownOutside #(hide! id)}
|
:onPointerDownOutside #(hide! id)}
|
||||||
content-props)
|
content-props)
|
||||||
(and (not force-popover?)
|
(and (not force-popover?)
|
||||||
@@ -184,16 +185,6 @@
|
|||||||
< rum/static
|
< rum/static
|
||||||
[]
|
[]
|
||||||
(let [[popups _set-popups!] (use-atom *popups)]
|
(let [[popups _set-popups!] (use-atom *popups)]
|
||||||
|
|
||||||
(rum/use-effect!
|
|
||||||
(fn []
|
|
||||||
(let [^js cls (.-classList js/document.documentElement)
|
|
||||||
s "has-x-popups"]
|
|
||||||
(if (and (counted? popups) (> (count popups) 0))
|
|
||||||
(.add cls s) (.remove cls s))
|
|
||||||
#(.remove cls s)))
|
|
||||||
[popups])
|
|
||||||
|
|
||||||
[:<>
|
[:<>
|
||||||
(for [config popups
|
(for [config popups
|
||||||
:when (and (map? config) (:id config) (not (:all? config)))]
|
:when (and (map? config) (:id config) (not (:all? config)))]
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
"android:dev": "cross-env PLATFORM=android gulp cap",
|
"android:dev": "cross-env PLATFORM=android gulp cap",
|
||||||
"tldraw:build": "yarn --cwd packages/tldraw install",
|
"tldraw:build": "yarn --cwd packages/tldraw install",
|
||||||
"amplify:build": "yarn --cwd packages/amplify install",
|
"amplify:build": "yarn --cwd packages/amplify install",
|
||||||
"ui:build": "yarn --cwd packages/ui install",
|
"ui:build": "git submodule update --quiet --init --depth=1 && yarn --cwd packages/ui install",
|
||||||
"postinstall": "yarn tldraw:build && yarn amplify:build && yarn ui:build"
|
"postinstall": "yarn tldraw:build && yarn amplify:build && yarn ui:build"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
1
packages/ui/.gitignore
vendored
1
packages/ui/.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
.parcel-cache
|
.parcel-cache
|
||||||
.storybook/cljs
|
.storybook/cljs
|
||||||
|
primitives/
|
||||||
dist
|
dist
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
"build:ui:only": "parcel build --target ui",
|
"build:ui:only": "parcel build --target ui",
|
||||||
"build:ui": "rm -rf .parcel-cache && yarn build:ui:only",
|
"build:ui": "rm -rf .parcel-cache && yarn build:ui:only",
|
||||||
"watch:storybook": "storybook dev -p 6006",
|
"watch:storybook": "storybook dev -p 6006",
|
||||||
|
"preinstall": "cd primitives/ && yarn install && yarn build",
|
||||||
"postinstall": "yarn build:ui"
|
"postinstall": "yarn build:ui"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -85,7 +86,8 @@
|
|||||||
},
|
},
|
||||||
"react/jsx-dev-runtime": "./node_modules/react/jsx-dev-runtime.js",
|
"react/jsx-dev-runtime": "./node_modules/react/jsx-dev-runtime.js",
|
||||||
"react/jsx-runtime": "./node_modules/react/jsx-runtime.js",
|
"react/jsx-runtime": "./node_modules/react/jsx-runtime.js",
|
||||||
"@/*": "./@/$1"
|
"@/*": "./@/$1",
|
||||||
|
"@radix-ui/react-*": "./primitives/packages/react/$1"
|
||||||
},
|
},
|
||||||
"targets": {
|
"targets": {
|
||||||
"main": false,
|
"main": false,
|
||||||
|
|||||||
Reference in New Issue
Block a user