@fullstackunicorn/create-root 1.0.23 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/root.fullstackunicorn.dev/assets/index.def.js +32 -4
- package/assets/root.fullstackunicorn.dev/assets/modules/sync.js +164 -302
- package/assets/root.fullstackunicorn.dev/assets/modules/sync.tools.js +39 -6
- package/assets/root.fullstackunicorn.dev/assets/package.md +9 -2
- package/assets/root.fullstackunicorn.dev/assets/webapp.runner.js +42 -1
- package/assets/root.fullstackunicorn.dev/frontend/base/account/AccountCard.js +1 -1
- package/assets/root.fullstackunicorn.dev/frontend/base/cookies/@use.js +5 -93
- package/assets/root.fullstackunicorn.dev/frontend/base/cookies/CookiesCard.js +1 -1
- package/assets/root.fullstackunicorn.dev/frontend/base/language/@use.js +4 -69
- package/assets/root.fullstackunicorn.dev/frontend/base/language/LanguageCard.js +1 -1
- package/assets/root.fullstackunicorn.dev/frontend/base/layout/Layout.pod.js +2 -2
- package/assets/root.fullstackunicorn.dev/frontend/base/legals/LegalCard.js +1 -1
- package/assets/root.fullstackunicorn.dev/frontend/base/legals/LegalsCard.js +1 -1
- package/assets/root.fullstackunicorn.dev/frontend/base/resources/@use.js +15 -0
- package/assets/root.fullstackunicorn.dev/frontend/base/router/@use.js +2 -1
- package/assets/root.fullstackunicorn.dev/frontend/base/theme/ThemeCard.js +1 -1
- package/assets/root.fullstackunicorn.dev/frontend/config.style.js +21 -9
- package/assets/root.fullstackunicorn.dev/frontend/features/legal/Legal.js +1 -1
- package/assets/root.fullstackunicorn.dev/frontend/imports/animated/Root.js +4 -8
- package/assets/root.fullstackunicorn.dev/frontend/imports/core/Scrollable.js +7 -2
- package/assets/root.fullstackunicorn.dev/frontend/imports/core/Viewport.js +29 -0
- package/assets/root.fullstackunicorn.dev/frontend/imports/head/Head.js +16 -26
- package/assets/root.fullstackunicorn.dev/frontend/modals/cookies/cookies.api.js +25 -0
- package/assets/root.fullstackunicorn.dev/frontend/modals/cookies/cookies.js +88 -0
- package/assets/root.fullstackunicorn.dev/frontend/modals/countries/countries.api.js +22 -0
- package/assets/root.fullstackunicorn.dev/frontend/modals/countries/countries.js +58 -37
- package/assets/root.fullstackunicorn.dev/frontend/modals/languages/languages.api.js +23 -0
- package/assets/root.fullstackunicorn.dev/frontend/modals/languages/languages.js +81 -0
- package/assets/root.fullstackunicorn.dev/frontend/modules/base/Bottom.js +10 -0
- package/assets/root.fullstackunicorn.dev/frontend/{panels/layout → modules/base}/Bottom.pod.js +1 -4
- package/assets/root.fullstackunicorn.dev/frontend/modules/base/ComingSoon.js +7 -0
- package/assets/root.fullstackunicorn.dev/frontend/modules/base/ComingSoon.pod.js +17 -0
- package/assets/root.fullstackunicorn.dev/frontend/{panels/error → modules/base}/ErrorPage.js +4 -4
- package/assets/root.fullstackunicorn.dev/frontend/{panels/error → modules/base}/ErrorPage.pod.js +7 -7
- package/assets/root.fullstackunicorn.dev/frontend/{panels/layout → modules/base}/PageTitle.js +1 -1
- package/assets/root.fullstackunicorn.dev/frontend/{panels/layout → modules/base}/PageTitle.pod.js +4 -6
- package/assets/root.fullstackunicorn.dev/frontend/{panels → modules}/cards/Account.js +9 -8
- package/assets/root.fullstackunicorn.dev/frontend/{panels → modules}/cards/Account.pod.js +28 -18
- package/assets/root.fullstackunicorn.dev/frontend/{panels → modules}/cards/Launcher.js +4 -4
- package/assets/root.fullstackunicorn.dev/frontend/{panels → modules}/cards/Launcher.pod.js +10 -11
- package/assets/root.fullstackunicorn.dev/frontend/{panels → modules}/cards/Linker.js +4 -4
- package/assets/root.fullstackunicorn.dev/frontend/{panels → modules}/cards/Linker.pod.js +11 -12
- package/assets/root.fullstackunicorn.dev/frontend/{panels → modules}/cards/Slider.js +8 -7
- package/assets/root.fullstackunicorn.dev/frontend/{panels → modules}/cards/Slider.pod.js +14 -14
- package/assets/root.fullstackunicorn.dev/frontend/{panels/wrapper/fixed → modules/layout}/Wrapper.js +2 -2
- package/assets/root.fullstackunicorn.dev/frontend/{panels/wrapper/fixed → modules/layout}/Wrapper.pod.js +1 -1
- package/assets/root.fullstackunicorn.dev/frontend/{panels/selectors/actions → modules/modals/select}/Actions.js +1 -1
- package/assets/root.fullstackunicorn.dev/frontend/{panels/selectors → modules/modals}/select/SelectPage.js +2 -2
- package/assets/root.fullstackunicorn.dev/frontend/{panels/sliders → modules/modals}/slider/SliderPage.js +2 -2
- package/assets/root.fullstackunicorn.dev/frontend/{panels → modules}/page/PageScrollable.js +1 -1
- package/assets/root.fullstackunicorn.dev/frontend/modules/page/PageScrollable.pod.js +23 -0
- package/assets/root.fullstackunicorn.dev/frontend/modules/prose/@runs.js +52 -0
- package/assets/root.fullstackunicorn.dev/frontend/modules/prose/Prose.js +56 -0
- package/assets/root.fullstackunicorn.dev/frontend/{panels → modules}/prose/Prose.pod.js +2 -14
- package/assets/root.fullstackunicorn.dev/frontend/pages/@use.js +26 -11
- package/assets/root.fullstackunicorn.dev/frontend/pages/root/Callout.api.js +9 -25
- package/assets/root.fullstackunicorn.dev/frontend/pages/root/Callout.js +1 -1
- package/assets/root.fullstackunicorn.dev/frontend/pages/root/Legal.api.js +16 -24
- package/assets/root.fullstackunicorn.dev/frontend/pages/root/Legal.js +2 -2
- package/assets/root.fullstackunicorn.dev/frontend/pages/root/Legals.api.js +14 -8
- package/assets/root.fullstackunicorn.dev/frontend/pages/root/Legals.js +5 -5
- package/assets/root.fullstackunicorn.dev/frontend/pages/root/User.api.js +8 -11
- package/assets/root.fullstackunicorn.dev/frontend/pages/root/User.js +1 -1
- package/assets/root.fullstackunicorn.dev/frontend/pages/{app → scope}/Checkout.js +1 -1
- package/assets/root.fullstackunicorn.dev/frontend/pages/scope/Home.abs.js +18 -0
- package/assets/root.fullstackunicorn.dev/frontend/pages/scope/Home.api.js +15 -0
- package/assets/root.fullstackunicorn.dev/frontend/pages/scope/Home.js +24 -0
- package/assets/root.fullstackunicorn.dev/frontend/panels/{slider/Slider.js → slideshows/Slideshow.js} +34 -20
- package/assets/root.fullstackunicorn.dev/frontend/panels/slideshows/Slideshow.map.js +27 -0
- package/assets/root.fullstackunicorn.dev/frontend/panels/slideshows/Slideshow.md +90 -0
- package/assets/root.fullstackunicorn.dev/frontend/panels/{slider/Slider.pod.js → slideshows/Slideshow.pod.js} +14 -28
- package/assets/root.fullstackunicorn.dev/frontend/preloader/@use.js +4 -5
- package/assets/root.fullstackunicorn.dev/frontend/root/errors.root.js +1 -1
- package/assets/root.fullstackunicorn.dev/frontend/root/modals.root.js +8 -8
- package/assets/root.fullstackunicorn.dev/frontend/root/pages.scope.js +2 -2
- package/assets/root.fullstackunicorn.dev/frontend/root/preload.scope.js +1 -1
- package/assets/root.fullstackunicorn.dev/package.json +1 -1
- package/assets/root.fullstackunicorn.dev/workspace/config/tabulars_data_content/config/import.json +4 -26
- package/assets/root.fullstackunicorn.dev/workspace/config/tabulars_data_content/objs/A01.metadata.meta.json +72 -79
- package/assets/root.fullstackunicorn.dev/workspace/config/tabulars_data_content/objs/C01.home.data.json +25 -5
- package/assets/root.fullstackunicorn.dev/workspace/volume/data/lookups/cookies/en-US.json +3 -19
- package/assets/root.fullstackunicorn.dev/workspace/volume/data/lookups/cookies/it-IT.json +6 -22
- package/assets/root.fullstackunicorn.dev/workspace/volume/data/root/user/en-US.json +4 -6
- package/assets/root.fullstackunicorn.dev/workspace/volume/data/root/user/it-IT.json +5 -19
- package/package.json +1 -1
- package/assets/root.fullstackunicorn.dev/frontend/pages/app/Home.abs.js +0 -11
- package/assets/root.fullstackunicorn.dev/frontend/pages/app/Home.api.js +0 -18
- package/assets/root.fullstackunicorn.dev/frontend/pages/app/Home.js +0 -23
- package/assets/root.fullstackunicorn.dev/frontend/panels/card/book/BookCard.js +0 -58
- package/assets/root.fullstackunicorn.dev/frontend/panels/card/book/BookCard.pod.js +0 -37
- package/assets/root.fullstackunicorn.dev/frontend/panels/card/book/BookProse.js +0 -22
- package/assets/root.fullstackunicorn.dev/frontend/panels/grid/book/Grid.js +0 -115
- package/assets/root.fullstackunicorn.dev/frontend/panels/grid/book/Grid.pod.js +0 -65
- package/assets/root.fullstackunicorn.dev/frontend/panels/grid/book/Item.js +0 -3
- package/assets/root.fullstackunicorn.dev/frontend/panels/grid/book/Item.pod.js +0 -50
- package/assets/root.fullstackunicorn.dev/frontend/panels/layout/Bottom.js +0 -12
- package/assets/root.fullstackunicorn.dev/frontend/panels/page/PageScrollable.pod.js +0 -85
- package/assets/root.fullstackunicorn.dev/frontend/panels/prose/@use.js +0 -21
- package/assets/root.fullstackunicorn.dev/frontend/panels/prose/Prose.js +0 -84
- package/assets/root.fullstackunicorn.dev/frontend/panels/selectors/popup/PopupModal.js +0 -54
- package/assets/root.fullstackunicorn.dev/frontend/panels/selectors/select/SelectModal.js +0 -52
- package/assets/root.fullstackunicorn.dev/frontend/panels/shopper/bookstore/Buy.js +0 -19
- package/assets/root.fullstackunicorn.dev/frontend/panels/shopper/bookstore/Buy.pod.js +0 -17
- package/assets/root.fullstackunicorn.dev/frontend/panels/shopper/bookstore/Shopper.js +0 -39
- package/assets/root.fullstackunicorn.dev/frontend/panels/shopper/bookstore/Shopper.pod.js +0 -187
- package/assets/root.fullstackunicorn.dev/frontend/panels/sliders/slider/SliderModal.js +0 -39
- /package/assets/root.fullstackunicorn.dev/frontend/{panels/selectors/actions → modules/modals/select}/Actions.pod.js +0 -0
- /package/assets/root.fullstackunicorn.dev/frontend/{panels/selectors → modules/modals}/select/SelectItem.js +0 -0
- /package/assets/root.fullstackunicorn.dev/frontend/{panels/selectors → modules/modals}/select/SelectItem.pod.js +0 -0
- /package/assets/root.fullstackunicorn.dev/frontend/{panels/selectors → modules/modals}/select/SelectPage.pod.js +0 -0
- /package/assets/root.fullstackunicorn.dev/frontend/{panels/selectors/actions → modules/modals/select}/SelectPicked.js +0 -0
- /package/assets/root.fullstackunicorn.dev/frontend/{panels/selectors/actions → modules/modals/select}/SelectPicked.pod.js +0 -0
- /package/assets/root.fullstackunicorn.dev/frontend/{panels/sliders/actions → modules/modals/slider}/Actions.js +0 -0
- /package/assets/root.fullstackunicorn.dev/frontend/{panels/sliders/actions → modules/modals/slider}/Actions.pod.js +0 -0
- /package/assets/root.fullstackunicorn.dev/frontend/{panels/sliders → modules/modals}/slider/SliderItem.js +0 -0
- /package/assets/root.fullstackunicorn.dev/frontend/{panels/sliders → modules/modals}/slider/SliderItem.pod.js +0 -0
- /package/assets/root.fullstackunicorn.dev/frontend/{panels/sliders → modules/modals}/slider/SliderPage.pod.js +0 -0
- /package/assets/root.fullstackunicorn.dev/frontend/{panels → modules}/prose/@formatter.js +0 -0
- /package/assets/root.fullstackunicorn.dev/frontend/{panels → modules}/prose/Basic.js +0 -0
- /package/assets/root.fullstackunicorn.dev/frontend/{panels → modules}/prose/Basic.pod.js +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { useStyle } from '#@/style/@use'
|
|
2
|
-
import { Link } from '#@/modules/core/Link'
|
|
3
|
-
import { View } from '#@/imports/core/View'
|
|
4
|
-
import { Icon } from '#@/modules/core/Icon'
|
|
5
|
-
import { Textline } from '#@/imports/core/Text'
|
|
6
|
-
import { Text } from '#@/imports/core/Text'
|
|
1
|
+
import { useStyle } from '#@/style/@use.js'
|
|
2
|
+
import { Link } from '#@/modules/core/Link.js'
|
|
3
|
+
import { View } from '#@/imports/core/View.js'
|
|
4
|
+
import { Icon } from '#@/modules/core/Icon.js'
|
|
5
|
+
import { Textline, Text } from '#@/imports/core/Text.js'
|
|
7
6
|
|
|
8
|
-
export const LinkerPod = ({
|
|
9
|
-
svg, title, description, label,
|
|
10
|
-
isHover,
|
|
7
|
+
export const LinkerPod = ({
|
|
8
|
+
svg, title, description, label,
|
|
9
|
+
isHover, onPress, linkTo,
|
|
10
|
+
}) => {
|
|
11
11
|
|
|
12
12
|
const { s, c, f, t, F, B, S, I, H } = useStyle()
|
|
13
13
|
|
|
@@ -20,7 +20,6 @@ export const LinkerPod = ({
|
|
|
20
20
|
S.pressable = [...t.root.cards.pressable, B.hover]
|
|
21
21
|
S.icon = t.root.cards.icon
|
|
22
22
|
S.label = t.root.cards.label
|
|
23
|
-
S.slider = t.root.cards.slider
|
|
24
23
|
|
|
25
24
|
return (
|
|
26
25
|
<View classes={S.box}>
|
|
@@ -28,11 +27,11 @@ export const LinkerPod = ({
|
|
|
28
27
|
<Textline classes={S.title} font={f.f1} text={title} />
|
|
29
28
|
<Text classes={S.description} font={f.f1} text={description} />
|
|
30
29
|
</View>
|
|
31
|
-
<Link classes={S.pressable} linkTo={linkTo} onPress={onPress}
|
|
30
|
+
<Link classes={S.pressable} linkTo={linkTo} onPress={onPress}>
|
|
32
31
|
<Icon classes={S.icon} svg={svg.logo} />
|
|
33
32
|
<Textline classes={S.label} font={f.f1} text={label} />
|
|
34
33
|
<Icon classes={S.icon} svg={svg.action} />
|
|
35
34
|
</Link>
|
|
36
35
|
</View>
|
|
37
36
|
)
|
|
38
|
-
}
|
|
37
|
+
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { useState } from 'react'
|
|
2
|
-
import { SliderPod } from '
|
|
2
|
+
import { SliderPod } from '#@/modules/cards/Slider.pod.js'
|
|
3
3
|
|
|
4
|
-
export const Slider = ({
|
|
5
|
-
svg, title, description, label,
|
|
6
|
-
isTrue, setIsTrue
|
|
4
|
+
export const Slider = ({
|
|
5
|
+
svg, title, description, label,
|
|
6
|
+
isTrue, setIsTrue,
|
|
7
|
+
}) => {
|
|
7
8
|
|
|
8
|
-
const [isHover, setIsHover
|
|
9
|
+
const [isHover, setIsHover] = useState(false)
|
|
9
10
|
|
|
10
11
|
return (
|
|
11
|
-
<SliderPod
|
|
12
|
+
<SliderPod
|
|
12
13
|
isTrue={isTrue}
|
|
13
14
|
setIsTrue={setIsTrue}
|
|
14
15
|
svg={svg}
|
|
@@ -19,4 +20,4 @@ export const Slider = ({
|
|
|
19
20
|
setIsHover={setIsHover}
|
|
20
21
|
/>
|
|
21
22
|
)
|
|
22
|
-
}
|
|
23
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { useStyle } from '#@/style/@use'
|
|
2
|
-
import { Slider } from '#@/modules/core/Slider'
|
|
3
|
-
import { Icon } from '#@/modules/core/Icon'
|
|
4
|
-
import { View } from '#@/imports/core/View'
|
|
5
|
-
import { Text } from '#@/imports/core/Text'
|
|
6
|
-
import {
|
|
7
|
-
import { Pressable } from '#@/imports/core/Pressable'
|
|
1
|
+
import { useStyle } from '#@/style/@use.js'
|
|
2
|
+
import { Slider } from '#@/modules/core/Slider.js'
|
|
3
|
+
import { Icon } from '#@/modules/core/Icon.js'
|
|
4
|
+
import { View } from '#@/imports/core/View.js'
|
|
5
|
+
import { Text, Textline } from '#@/imports/core/Text.js'
|
|
6
|
+
import { Pressable } from '#@/imports/core/Pressable.js'
|
|
8
7
|
|
|
9
|
-
export const SliderPod = ({
|
|
10
|
-
svg, title, description, label,
|
|
11
|
-
isHover, setIsHover, isTrue, setIsTrue
|
|
8
|
+
export const SliderPod = ({
|
|
9
|
+
svg, title, description, label,
|
|
10
|
+
isHover, setIsHover, isTrue, setIsTrue,
|
|
11
|
+
}) => {
|
|
12
12
|
|
|
13
13
|
const { s, c, f, t, F, B, S, I, H } = useStyle()
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
B.hover = isHover ? [c.base_C1_W600] : [c.base_NN_W650]
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
S.box = t.root.cards.box
|
|
18
18
|
S.top = t.root.cards.top
|
|
19
19
|
S.title = t.root.cards.title
|
|
@@ -22,7 +22,7 @@ export const SliderPod = ({
|
|
|
22
22
|
S.icon = t.root.cards.icon
|
|
23
23
|
S.label = t.root.cards.label
|
|
24
24
|
S.slider = t.root.cards.slider
|
|
25
|
-
|
|
25
|
+
|
|
26
26
|
return (
|
|
27
27
|
<View classes={S.box}>
|
|
28
28
|
<View classes={S.top}>
|
|
@@ -36,4 +36,4 @@ export const SliderPod = ({
|
|
|
36
36
|
</Pressable>
|
|
37
37
|
</View>
|
|
38
38
|
)
|
|
39
|
-
}
|
|
39
|
+
}
|
package/assets/root.fullstackunicorn.dev/frontend/{panels/wrapper/fixed → modules/layout}/Wrapper.js
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useGetWidth } from '#@/base/layout/@use.js'
|
|
2
|
-
import { WrapperPod } from '#@/
|
|
2
|
+
import { WrapperPod } from '#@/modules/layout/Wrapper.pod.js'
|
|
3
3
|
|
|
4
4
|
export const Wrapper = ({ settings, children }) => {
|
|
5
5
|
|
|
@@ -22,4 +22,4 @@ export const Wrapper = ({ settings, children }) => {
|
|
|
22
22
|
{children}
|
|
23
23
|
</WrapperPod>
|
|
24
24
|
)
|
|
25
|
-
}
|
|
25
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useGetStatics } from '#@/base/statics/@use.js'
|
|
2
2
|
import { TextButton } from '#@/modules/buttons/TextButton.js'
|
|
3
|
-
import { SelectPicked } from '#@/
|
|
3
|
+
import { SelectPicked } from '#@/modules/modals/select/SelectPicked.js'
|
|
4
4
|
import { ActionsPod } from './Actions.pod.js'
|
|
5
5
|
|
|
6
6
|
export const Actions = ({ selected, onSave, onRestore, isDisabled, compact = false }) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SelectItem } from '#@/
|
|
1
|
+
import { SelectItem } from '#@/modules/modals/select/SelectItem.js'
|
|
2
2
|
import { SelectPagePod } from './SelectPage.pod.js'
|
|
3
3
|
|
|
4
4
|
export const SelectPage = ({ itemLogic, itemVerbal, itemVisual, selected, setValue }) => {
|
|
@@ -30,4 +30,4 @@ export const SelectPage = ({ itemLogic, itemVerbal, itemVisual, selected, setVal
|
|
|
30
30
|
{/* <InputText value={value}/> */}
|
|
31
31
|
</SelectPagePod>
|
|
32
32
|
)
|
|
33
|
-
}
|
|
33
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SliderItem } from '#@/
|
|
1
|
+
import { SliderItem } from '#@/modules/modals/slider/SliderItem.js'
|
|
2
2
|
import { SliderPagePod } from './SliderPage.pod.js'
|
|
3
3
|
|
|
4
4
|
export const SliderPage = ({ formResult, sliderLogic, sliderVerbal, sliderVisual, description }) => {
|
|
@@ -34,4 +34,4 @@ export const SliderPage = ({ formResult, sliderLogic, sliderVerbal, sliderVisual
|
|
|
34
34
|
mapper={mapper}
|
|
35
35
|
/>
|
|
36
36
|
)
|
|
37
|
-
}
|
|
37
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { usePersistentScroll } from '#@/imports/scroll/@use.js'
|
|
2
|
-
import { PageScrollablePod } from '
|
|
2
|
+
import { PageScrollablePod } from '#@/modules/page/PageScrollable.pod.js'
|
|
3
3
|
|
|
4
4
|
export const PageScrollable = ({ type = 'fixed', children }) => {
|
|
5
5
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useStyle } from '#@/style/@use.js'
|
|
2
|
+
import { Scrollable } from '#@/imports/core/Scrollable.js'
|
|
3
|
+
import { Fader } from '#@/imports/animated/Fader.js'
|
|
4
|
+
|
|
5
|
+
export const PageScrollablePod = ({ children, type, scrollRef, onScroll }) => {
|
|
6
|
+
|
|
7
|
+
const { s, c, f, t, F, B, S, I, H } = useStyle()
|
|
8
|
+
|
|
9
|
+
S.scrollable = [s.col_cX, s.XYc]
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<Scrollable
|
|
13
|
+
classes={S.scrollable}
|
|
14
|
+
isPage
|
|
15
|
+
scrollRef={scrollRef}
|
|
16
|
+
onScroll={onScroll}
|
|
17
|
+
>
|
|
18
|
+
<Fader classes={t.page[type]}>
|
|
19
|
+
{children}
|
|
20
|
+
</Fader>
|
|
21
|
+
</Scrollable>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { formatter } from '#@/modules/prose/@formatter.js'
|
|
2
|
+
|
|
3
|
+
class Runs {
|
|
4
|
+
|
|
5
|
+
build = ({ tokens = [], spans = [], lookup = {} }) => {
|
|
6
|
+
return spans.map(span => {
|
|
7
|
+
const sliced = tokens.slice(span.start, span.end + 1)
|
|
8
|
+
return {
|
|
9
|
+
style: F3.obj.safe(span.style),
|
|
10
|
+
runs: this.merge(sliced, lookup)
|
|
11
|
+
}
|
|
12
|
+
})
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
merge = (tokens = [], lookup = {}) => {
|
|
16
|
+
const result = []
|
|
17
|
+
let text = ''
|
|
18
|
+
|
|
19
|
+
const flushText = () => {
|
|
20
|
+
if (!text) return
|
|
21
|
+
result.push({ render: 'text', text })
|
|
22
|
+
text = ''
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
for (const token of tokens) {
|
|
26
|
+
const value = token?.[0] || ''
|
|
27
|
+
const rendered = formatter.render(value, lookup)
|
|
28
|
+
|
|
29
|
+
if (F3.str.isGood(rendered)) {
|
|
30
|
+
text += rendered
|
|
31
|
+
continue
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const data = F3.obj.safe(rendered)
|
|
35
|
+
const render = data.render || 'text'
|
|
36
|
+
|
|
37
|
+
if (render === 'text' || render === 'phrase') {
|
|
38
|
+
text += data.text || ''
|
|
39
|
+
continue
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
flushText()
|
|
43
|
+
result.push(data)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
flushText()
|
|
47
|
+
|
|
48
|
+
return result
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const runs = new Runs()
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { useGetStatics } from '#@/base/statics/@use.js'
|
|
2
|
+
import { formatter } from '#@/modules/prose/@formatter.js'
|
|
3
|
+
import { runs } from '#@/modules/prose/@runs.js'
|
|
4
|
+
import { Url, Link } from '#@/modules/prose/Basic.js'
|
|
5
|
+
import { ProsePod, StylePod, TokenCodePod } from './Prose.pod.js'
|
|
6
|
+
|
|
7
|
+
export const Style = ({ block = 'p', style = {}, runs = [] }) => {
|
|
8
|
+
const content = runs.map((run, index) => {
|
|
9
|
+
if (run.render === 'url') return <Url key={index} {...run} />
|
|
10
|
+
if (run.render === 'link') return <Link key={index} {...run} />
|
|
11
|
+
if (run.render === 'code') return <TokenCodePod key={index} text={run.code} />
|
|
12
|
+
return run.text || ''
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<StylePod
|
|
17
|
+
block={block}
|
|
18
|
+
style={style}
|
|
19
|
+
tokens={content}
|
|
20
|
+
/>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const Styles = ({ block = 'p', styles = [] }) => {
|
|
25
|
+
return styles.map((item, index) => {
|
|
26
|
+
return (
|
|
27
|
+
<Style
|
|
28
|
+
key={index}
|
|
29
|
+
block={block}
|
|
30
|
+
style={item.style}
|
|
31
|
+
runs={item.runs}
|
|
32
|
+
/>
|
|
33
|
+
)
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const Prose = ({ lang = {} }) => {
|
|
38
|
+
|
|
39
|
+
const statics = useGetStatics()
|
|
40
|
+
const lookup = { logic: statics.logic.lookup, verbal: statics.verbal.lookup }
|
|
41
|
+
|
|
42
|
+
const attributes = F3.obj.safe(lang.attributes)
|
|
43
|
+
const style = F3.obj.safe(lang.style || attributes.style)
|
|
44
|
+
const spansRaw = F3.arr.safe(lang.spans || attributes.spans)
|
|
45
|
+
|
|
46
|
+
const tokens = formatter.tokenize(lang.value)
|
|
47
|
+
const spans = formatter.spans(tokens, spansRaw)
|
|
48
|
+
const styles = runs.build({ tokens, spans, lookup })
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<ProsePod
|
|
52
|
+
style={style}
|
|
53
|
+
styles={<Styles block={style.block} styles={styles} />}
|
|
54
|
+
/>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
@@ -1,21 +1,9 @@
|
|
|
1
1
|
import { useStyle } from '#@/style/@use'
|
|
2
|
-
import { formatter } from '#@/
|
|
3
|
-
import { TextFont, TextSpan
|
|
2
|
+
import { formatter } from '#@/modules/prose/@formatter.js'
|
|
3
|
+
import { TextFont, TextSpan } from '#@/imports/core/Text'
|
|
4
4
|
import { View } from '#@/imports/core/View'
|
|
5
5
|
import { Bulleted } from '#@/modules/core/Bulleted.js'
|
|
6
6
|
|
|
7
|
-
export const SpanPod = ({ text }) => {
|
|
8
|
-
|
|
9
|
-
const { s, c, f, t, F, B, S, I, H } = useStyle()
|
|
10
|
-
|
|
11
|
-
return <TextSpan text={text} font={f.f1} />
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const TokenPod = ({ onPress, children }) => {
|
|
15
|
-
if (!onPress) return children
|
|
16
|
-
return <TextClick onPress={onPress}>{children}</TextClick>
|
|
17
|
-
}
|
|
18
|
-
|
|
19
7
|
export const TokenCodePod = ({ text }) => {
|
|
20
8
|
|
|
21
9
|
const { s, c, f, t, F, B, S, I, H } = useStyle()
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react'
|
|
2
2
|
import { atom, useAtom, useSetAtom, useGetAtom } from '#@/imports/npm'
|
|
3
3
|
import { useUrl } from '#@/base/router/@use.js'
|
|
4
|
+
import { abs } from '#@/abstracts/abs.js'
|
|
5
|
+
import { useGetResource, useSetResource } from '#@/base/resources/@use.js'
|
|
4
6
|
// import { service } from '#@/imports/service.js'
|
|
5
7
|
|
|
6
8
|
export const meta = atom({})
|
|
@@ -9,25 +11,38 @@ export const useMeta = () => useAtom(meta)
|
|
|
9
11
|
export const useSetMeta = () => useSetAtom(meta)
|
|
10
12
|
export const useGetMeta = () => useGetAtom(meta)
|
|
11
13
|
|
|
12
|
-
export const useApi = (
|
|
14
|
+
export const useApi = (fetch, parse, uriTemplate, ctx) => {
|
|
13
15
|
const { lang, path } = useUrl()
|
|
14
|
-
const
|
|
16
|
+
const key = abs.makeKey(F3.fabUrl(uriTemplate, { lang, path }), 'get')
|
|
17
|
+
const cached = useGetResource(key)
|
|
18
|
+
const setResource = useSetResource()
|
|
15
19
|
const setMeta = useSetMeta()
|
|
20
|
+
|
|
16
21
|
useEffect(() => {
|
|
22
|
+
if (cached.data) {
|
|
23
|
+
const preloaded = parse(cached.data)
|
|
24
|
+
if (preloaded?.meta) setMeta(preloaded.meta)
|
|
25
|
+
}
|
|
17
26
|
const load = async () => {
|
|
18
27
|
try {
|
|
19
|
-
const
|
|
20
|
-
if (
|
|
21
|
-
|
|
28
|
+
const raw = await fetch({ lang, path }, ctx)
|
|
29
|
+
if (!raw) return
|
|
30
|
+
setResource({ key, data: raw })
|
|
31
|
+
const result = parse(raw)
|
|
32
|
+
if (result?.meta) setMeta(result.meta)
|
|
22
33
|
} catch (error) {
|
|
23
|
-
console.error('api-
|
|
24
|
-
setResult({isError:true})
|
|
34
|
+
console.error('api-resource-failed', { lang, path, error })
|
|
25
35
|
}
|
|
26
36
|
}
|
|
27
37
|
load()
|
|
28
|
-
return () => setResult(undefined)
|
|
29
38
|
}, [lang, path])
|
|
30
|
-
|
|
39
|
+
|
|
40
|
+
const parsed = cached.data ? parse(cached.data) : undefined
|
|
41
|
+
if (!parsed) return undefined
|
|
42
|
+
return {
|
|
43
|
+
data: parsed.data,
|
|
44
|
+
heading: parsed.heading
|
|
45
|
+
}
|
|
31
46
|
}
|
|
32
47
|
|
|
33
48
|
export const useLoad = (func, lang, path, ctx) => {
|
|
@@ -40,8 +55,8 @@ export const useLoad = (func, lang, path, ctx) => {
|
|
|
40
55
|
if (response?.meta) setMeta(response.meta)
|
|
41
56
|
setResult(response?.data)
|
|
42
57
|
} catch (error) {
|
|
43
|
-
console.error('load-request-failed', {lang,path,ctx,error})
|
|
44
|
-
setResult({isError:true})
|
|
58
|
+
console.error('load-request-failed', { lang, path, ctx, error })
|
|
59
|
+
setResult({ isError: true })
|
|
45
60
|
}
|
|
46
61
|
}
|
|
47
62
|
load()
|
|
@@ -1,31 +1,15 @@
|
|
|
1
1
|
import { uri } from '#@/App.uri.js'
|
|
2
2
|
import { api } from '#@/client/@api.js'
|
|
3
|
-
import {
|
|
4
|
-
import { useLoad } from '#@/pages/@use.js'
|
|
3
|
+
import { useApi } from '#@/pages/@use.js'
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
const routeId = 'callout'
|
|
5
|
+
const fetch = async params => await api.statics.get(uri.data.content.verbal, params)
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const meta =
|
|
13
|
-
const
|
|
14
|
-
return { data,
|
|
7
|
+
const parse = raw => {
|
|
8
|
+
if (!raw) return undefined
|
|
9
|
+
const data = raw['@data']
|
|
10
|
+
const meta = raw['@meta']
|
|
11
|
+
const heading = raw['@head'].heading
|
|
12
|
+
return { meta, data, heading }
|
|
15
13
|
}
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
export const usePreloadCallout = () => {
|
|
19
|
-
const { lang } = useUrl()
|
|
20
|
-
const path = routeId
|
|
21
|
-
const result = F3.fabUrl(uri.data.content.verbal, {lang, path})
|
|
22
|
-
return result
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// #4 define useApi hook
|
|
26
|
-
export const useApiCallout = () => {
|
|
27
|
-
const { lang } = useUrl()
|
|
28
|
-
const path = 'callout'
|
|
29
|
-
const result = useLoad(dataFetch, lang, path)
|
|
30
|
-
return result
|
|
31
|
-
}
|
|
15
|
+
export const useApiCallout = () => useApi(fetch, parse, uri.data.content.verbal)
|
|
@@ -1,35 +1,27 @@
|
|
|
1
1
|
import { uri } from '#@/App.uri.js'
|
|
2
2
|
import { api } from '#@/client/@api.js'
|
|
3
|
-
import {
|
|
4
|
-
import { useLoad } from '#@/pages/@use.js'
|
|
3
|
+
import { useApi } from '#@/pages/@use.js'
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
const routeId = 'legals'
|
|
8
|
-
|
|
9
|
-
// #2 define fetch for preload and api
|
|
10
|
-
const dataFetch = async params => {
|
|
5
|
+
const fetch = async params => {
|
|
11
6
|
const logic = await api.statics.get(uri.data.legals.logic, params)
|
|
12
7
|
const verbal = await api.statics.get(uri.data.legals.verbal, params)
|
|
13
|
-
|
|
8
|
+
return { verbal, logic }
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const parse = raw => {
|
|
12
|
+
if (!raw) return undefined
|
|
13
|
+
const verbal = raw?.verbal
|
|
14
|
+
const logic = raw?.logic
|
|
15
|
+
if (!F3.obj.isGood(verbal)) return undefined
|
|
16
|
+
if (!F3.obj.isGood(logic)) return undefined
|
|
14
17
|
const data = {}
|
|
15
18
|
data.arr = verbal['@data'].arr
|
|
16
19
|
data.obj = verbal['@data'].obj
|
|
17
20
|
data.langs = logic['@langs']
|
|
18
|
-
data.versions = logic.versions
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
// #3 define usePreload hook //@NOTE: as key uri pick one of the 2 paths
|
|
23
|
-
export const usePreloadLegal = list => {
|
|
24
|
-
const { lang } = useUrl()
|
|
25
|
-
const path = routeId
|
|
26
|
-
const result = F3.fabUrl(uri.data.legals.verbal, {lang, path})
|
|
27
|
-
return result
|
|
21
|
+
data.versions = logic.versions
|
|
22
|
+
const meta = verbal['@meta']
|
|
23
|
+
const heading = verbal['@head'].heading
|
|
24
|
+
return { meta, data, heading }
|
|
28
25
|
}
|
|
29
26
|
|
|
30
|
-
|
|
31
|
-
export const useApiLegal = () => {
|
|
32
|
-
const { lang, path } = useUrl()
|
|
33
|
-
const result = useLoad(dataFetch, lang, path)
|
|
34
|
-
return result
|
|
35
|
-
}
|
|
27
|
+
export const useApiLegal = () => useApi(fetch, parse, uri.data.legals.verbal)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PageScrollable } from '#@/
|
|
1
|
+
import { PageScrollable } from '#@/modules/page/PageScrollable.js'
|
|
2
2
|
import { Legal as LegalFeature } from '#@/features/legal/Legal.js'
|
|
3
3
|
import { useApiLegal } from '#@/pages/root/Legal.api.js'
|
|
4
4
|
|
|
@@ -9,7 +9,7 @@ export const Legal = () => {
|
|
|
9
9
|
if (!api) return null
|
|
10
10
|
return (
|
|
11
11
|
<PageScrollable type='docs' isScroll>
|
|
12
|
-
<LegalFeature api={api}/>
|
|
12
|
+
<LegalFeature api={api.data}/>
|
|
13
13
|
</PageScrollable>
|
|
14
14
|
)
|
|
15
15
|
}
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
import { uri } from '#@/App.uri.js'
|
|
2
2
|
import { api } from '#@/client/@api.js'
|
|
3
3
|
import { useApi } from '#@/pages/@use.js'
|
|
4
|
-
|
|
5
|
-
const dataFetch = async params => {
|
|
6
4
|
|
|
5
|
+
const fetch = async params => {
|
|
7
6
|
const verbal = await api.statics.get(uri.data.legals.verbal, params)
|
|
8
7
|
const logic = await api.statics.get(uri.data.legals.logic, params)
|
|
8
|
+
return { verbal, logic }
|
|
9
|
+
}
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
const parse = raw => {
|
|
12
|
+
if (!raw) return undefined
|
|
13
|
+
const verbal = raw?.verbal
|
|
14
|
+
const logic = raw?.logic
|
|
15
|
+
if (!F3.obj.isGood(verbal)) return undefined
|
|
16
|
+
if (!F3.obj.isGood(logic)) return undefined
|
|
11
17
|
const data = {}
|
|
12
|
-
data.heading = verbal['@head'].heading
|
|
13
18
|
data.list = logic['@data'].list
|
|
14
|
-
data.
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
data.items = verbal['@data'].items
|
|
20
|
+
const meta = verbal['@meta']
|
|
21
|
+
const heading = verbal['@head'].heading
|
|
22
|
+
return { meta, data, heading }
|
|
17
23
|
}
|
|
18
24
|
|
|
19
|
-
export const useApiLegals = () => useApi(
|
|
25
|
+
export const useApiLegals = () => useApi(fetch, parse, uri.data.legals.verbal)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { routes } from '#@/root/routes.js'
|
|
2
|
-
import { PageScrollable } from '#@/
|
|
2
|
+
import { PageScrollable } from '#@/modules/page/PageScrollable.js'
|
|
3
3
|
import { useUrl } from '#@/base/router/@use.js'
|
|
4
4
|
import { LegalCard } from '#@/base/legals/LegalCard.js'
|
|
5
5
|
import { useApiLegals } from '#@/pages/root/Legals.api.js'
|
|
@@ -12,14 +12,14 @@ export const Legals = () => {
|
|
|
12
12
|
if (!api) return null
|
|
13
13
|
return (
|
|
14
14
|
<PageScrollable type='fixed'>
|
|
15
|
-
{api.list.map((link, index) => {
|
|
15
|
+
{api.data.list.map((link, index) => {
|
|
16
16
|
const slug = link.split('/')[1]
|
|
17
17
|
return (
|
|
18
18
|
<LegalCard
|
|
19
19
|
key = {index}
|
|
20
|
-
title={api.data[slug].title}
|
|
21
|
-
description={api.data[slug].description}
|
|
22
|
-
label={api.data[slug].label}
|
|
20
|
+
title={api.data.items[slug].title}
|
|
21
|
+
description={api.data.items[slug].description}
|
|
22
|
+
label={api.data.items[slug].label}
|
|
23
23
|
linkTo={F3.fabUrl(routes.public.legal.path, { slug, lang })}
|
|
24
24
|
/>
|
|
25
25
|
)
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { uri } from '#@/App.uri.js'
|
|
2
2
|
import { api } from '#@/client/@api.js'
|
|
3
3
|
import { useApi } from '#@/pages/@use.js'
|
|
4
|
-
|
|
5
|
-
const dataFetch = async params => {
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
// const logic = await api.statics.get(uri.data.content.logic, params)
|
|
5
|
+
const fetch = async params => await api.statics.get(uri.data.root.verbal, params)
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
data
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return { data,
|
|
7
|
+
const parse = raw => {
|
|
8
|
+
if (!raw) return undefined
|
|
9
|
+
const data = raw['@data']
|
|
10
|
+
const meta = raw['@meta']
|
|
11
|
+
const heading = raw['@head'].heading
|
|
12
|
+
return { meta, data, heading }
|
|
16
13
|
}
|
|
17
14
|
|
|
18
|
-
export const useApiUser = () => useApi(
|
|
15
|
+
export const useApiUser = () => useApi(fetch, parse, uri.data.root.verbal)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { constants } from '#@/root/constants.js'
|
|
2
|
-
import { PageScrollable } from '#@/
|
|
2
|
+
import { PageScrollable } from '#@/modules/page/PageScrollable.js'
|
|
3
3
|
import { AccountCard } from '#@/base/account/AccountCard.js'
|
|
4
4
|
import { LanguageCard } from '#@/base/language/LanguageCard.js'
|
|
5
5
|
import { ThemeCard } from '#@/base/theme/ThemeCard.js'
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
class Abs {
|
|
2
|
+
|
|
3
|
+
constructor() {
|
|
4
|
+
this.settings = {}
|
|
5
|
+
this.keys = {}
|
|
6
|
+
this.settings.slideshow = {}
|
|
7
|
+
this.settings.slideshow.aspectRatio = 1920/815
|
|
8
|
+
this.keys.slideshow = {}
|
|
9
|
+
this.keys.slideshow.picture = 'picture'
|
|
10
|
+
this.keys.slideshow.subhead = 'subhead'
|
|
11
|
+
this.keys.slideshow.title = 'title'
|
|
12
|
+
this.keys.slideshow.description = 'description'
|
|
13
|
+
this.keys.slideshow.href = 'href'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const abs = new Abs()
|