@fluxdown/vue-lynx-plugins 0.0.0-stage → 0.2.1
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/CHANGELOG.md +41 -0
- package/LICENSE +21 -0
- package/README.md +4 -2
- package/dist/esm/base/components/animated-text/animation.d.ts +6 -0
- package/dist/esm/base/components/animated-text/animation.js +67 -0
- package/dist/esm/base/components/animated-text/index.d.ts +16 -0
- package/dist/esm/base/components/animated-text/index.js +86 -0
- package/dist/esm/base/components/index.d.ts +1 -0
- package/dist/esm/base/components/index.js +3 -0
- package/dist/esm/base/consts/defaults.d.ts +1 -0
- package/dist/esm/base/consts/defaults.js +3 -0
- package/dist/esm/base/consts/index.d.ts +1 -0
- package/dist/esm/base/consts/index.js +3 -0
- package/dist/esm/base/context/index.d.ts +2 -0
- package/dist/esm/base/context/index.js +5 -0
- package/dist/esm/base/context/text-animation/index.d.ts +14 -0
- package/dist/esm/base/context/text-animation/index.js +22 -0
- package/dist/esm/base/context/text-animation/type.d.ts +4 -0
- package/dist/esm/base/context/text-animation/type.js +2 -0
- package/dist/esm/base/context/text-layout-width/index.d.ts +11 -0
- package/dist/esm/base/context/text-layout-width/index.js +20 -0
- package/dist/esm/base/index.d.ts +6 -0
- package/dist/esm/base/index.js +13 -0
- package/dist/esm/base/render/index.d.ts +2 -0
- package/dist/esm/base/render/index.js +5 -0
- package/dist/esm/base/render/layout.d.ts +9 -0
- package/dist/esm/base/render/layout.js +111 -0
- package/dist/esm/base/render/props.d.ts +3 -0
- package/dist/esm/base/render/props.js +43 -0
- package/dist/esm/base/slot/base.d.ts +5 -0
- package/dist/esm/base/slot/base.js +8 -0
- package/dist/esm/base/slot/index.d.ts +3 -0
- package/dist/esm/base/slot/index.js +7 -0
- package/dist/esm/base/slot/type.d.ts +92 -0
- package/dist/esm/base/slot/type.js +2 -0
- package/dist/esm/base/slot/utils/create.d.ts +3 -0
- package/dist/esm/base/slot/utils/create.js +7 -0
- package/dist/esm/base/slot/utils/index.d.ts +3 -0
- package/dist/esm/base/slot/utils/index.js +7 -0
- package/dist/esm/base/slot/utils/style.d.ts +1 -0
- package/dist/esm/base/slot/utils/style.js +3 -0
- package/dist/esm/base/slot/utils/url.d.ts +4 -0
- package/dist/esm/base/slot/utils/url.js +21 -0
- package/dist/esm/base/theme/index.d.ts +25 -0
- package/dist/esm/base/theme/index.js +78 -0
- package/dist/esm/base/theme/presets/base.d.ts +2 -0
- package/dist/esm/base/theme/presets/base.js +117 -0
- package/dist/esm/base/theme/presets/dark.d.ts +2 -0
- package/dist/esm/base/theme/presets/dark.js +33 -0
- package/dist/esm/base/theme/presets/index.d.ts +4 -0
- package/dist/esm/base/theme/presets/index.js +13 -0
- package/dist/esm/base/theme/presets/light.d.ts +2 -0
- package/dist/esm/base/theme/presets/light.js +33 -0
- package/dist/esm/base/theme/type.d.ts +141 -0
- package/dist/esm/base/theme/type.js +2 -0
- package/dist/esm/base/theme/utils.d.ts +4 -0
- package/dist/esm/base/theme/utils.js +38 -0
- package/dist/esm/env.d.ts +1 -0
- package/dist/esm/jsx-runtime.d.ts +27 -0
- package/dist/esm/jsx-runtime.js +6 -0
- package/dist/esm/plugins/blockquote/index.d.ts +2 -0
- package/dist/esm/plugins/blockquote/index.js +19 -0
- package/dist/esm/plugins/blockquote/slot/blockquote/index.d.ts +13 -0
- package/dist/esm/plugins/blockquote/slot/blockquote/index.js +14 -0
- package/dist/esm/plugins/blockquote/slot/blockquote/renderer/index.d.ts +5 -0
- package/dist/esm/plugins/blockquote/slot/blockquote/renderer/index.js +38 -0
- package/dist/esm/plugins/blockquote/slot/index.d.ts +1 -0
- package/dist/esm/plugins/blockquote/slot/index.js +3 -0
- package/dist/esm/plugins/break-line/index.d.ts +2 -0
- package/dist/esm/plugins/break-line/index.js +19 -0
- package/dist/esm/plugins/break-line/slot/break-line/index.d.ts +13 -0
- package/dist/esm/plugins/break-line/slot/break-line/index.js +14 -0
- package/dist/esm/plugins/break-line/slot/break-line/renderer/index.d.ts +5 -0
- package/dist/esm/plugins/break-line/slot/break-line/renderer/index.js +18 -0
- package/dist/esm/plugins/break-line/slot/index.d.ts +1 -0
- package/dist/esm/plugins/break-line/slot/index.js +3 -0
- package/dist/esm/plugins/code/index.d.ts +4 -0
- package/dist/esm/plugins/code/index.js +23 -0
- package/dist/esm/plugins/code/render/code/index.d.ts +13 -0
- package/dist/esm/plugins/code/render/code/index.js +45 -0
- package/dist/esm/plugins/code/render/code/utils.d.ts +7 -0
- package/dist/esm/plugins/code/render/code/utils.js +61 -0
- package/dist/esm/plugins/code/render/index.d.ts +1 -0
- package/dist/esm/plugins/code/render/index.js +3 -0
- package/dist/esm/plugins/code/slot/code-block/index.d.ts +13 -0
- package/dist/esm/plugins/code/slot/code-block/index.js +14 -0
- package/dist/esm/plugins/code/slot/code-block/renderer/index.d.ts +5 -0
- package/dist/esm/plugins/code/slot/code-block/renderer/index.js +43 -0
- package/dist/esm/plugins/code/slot/code-header/index.d.ts +24 -0
- package/dist/esm/plugins/code/slot/code-header/index.js +14 -0
- package/dist/esm/plugins/code/slot/code-header/renderer/index.d.ts +13 -0
- package/dist/esm/plugins/code/slot/code-header/renderer/index.js +122 -0
- package/dist/esm/plugins/code/slot/code-highlighter/index.d.ts +14 -0
- package/dist/esm/plugins/code/slot/code-highlighter/index.js +16 -0
- package/dist/esm/plugins/code/slot/code-highlighter/renderer/index.d.ts +9 -0
- package/dist/esm/plugins/code/slot/code-highlighter/renderer/index.js +61 -0
- package/dist/esm/plugins/code/slot/code-highlighter/renderer/style.css +4 -0
- package/dist/esm/plugins/code/slot/index.d.ts +3 -0
- package/dist/esm/plugins/code/slot/index.js +7 -0
- package/dist/esm/plugins/code-prism/index.d.ts +3 -0
- package/dist/esm/plugins/code-prism/index.js +19 -0
- package/dist/esm/plugins/code-prism/slot/code-prism/index.d.ts +16 -0
- package/dist/esm/plugins/code-prism/slot/code-prism/index.js +14 -0
- package/dist/esm/plugins/code-prism/slot/code-prism/renderer/hooks.d.ts +5 -0
- package/dist/esm/plugins/code-prism/slot/code-prism/renderer/hooks.js +36 -0
- package/dist/esm/plugins/code-prism/slot/code-prism/renderer/index.d.ts +5 -0
- package/dist/esm/plugins/code-prism/slot/code-prism/renderer/index.js +64 -0
- package/dist/esm/plugins/code-prism/slot/code-prism/renderer/languages.d.ts +298 -0
- package/dist/esm/plugins/code-prism/slot/code-prism/renderer/languages.js +899 -0
- package/dist/esm/plugins/code-prism/slot/code-prism/renderer/runtime.d.ts +2 -0
- package/dist/esm/plugins/code-prism/slot/code-prism/renderer/runtime.js +11 -0
- package/dist/esm/plugins/code-prism/slot/code-prism/renderer/utils.d.ts +9 -0
- package/dist/esm/plugins/code-prism/slot/code-prism/renderer/utils.js +98 -0
- package/dist/esm/plugins/code-prism/slot/index.d.ts +1 -0
- package/dist/esm/plugins/code-prism/slot/index.js +3 -0
- package/dist/esm/plugins/code-shiki/index.d.ts +3 -0
- package/dist/esm/plugins/code-shiki/index.js +19 -0
- package/dist/esm/plugins/code-shiki/slot/code-shiki/index.d.ts +16 -0
- package/dist/esm/plugins/code-shiki/slot/code-shiki/index.js +14 -0
- package/dist/esm/plugins/code-shiki/slot/code-shiki/renderer/hooks.d.ts +2 -0
- package/dist/esm/plugins/code-shiki/slot/code-shiki/renderer/hooks.js +22 -0
- package/dist/esm/plugins/code-shiki/slot/code-shiki/renderer/index.d.ts +5 -0
- package/dist/esm/plugins/code-shiki/slot/code-shiki/renderer/index.js +80 -0
- package/dist/esm/plugins/code-shiki/slot/code-shiki/renderer/utils.d.ts +5 -0
- package/dist/esm/plugins/code-shiki/slot/code-shiki/renderer/utils.js +142 -0
- package/dist/esm/plugins/code-shiki/slot/index.d.ts +1 -0
- package/dist/esm/plugins/code-shiki/slot/index.js +3 -0
- package/dist/esm/plugins/effect-chunk/index.d.ts +2 -0
- package/dist/esm/plugins/effect-chunk/index.js +19 -0
- package/dist/esm/plugins/effect-chunk/slot/effect-chunk/index.d.ts +17 -0
- package/dist/esm/plugins/effect-chunk/slot/effect-chunk/index.js +16 -0
- package/dist/esm/plugins/effect-chunk/slot/effect-chunk/renderer/index.d.ts +10 -0
- package/dist/esm/plugins/effect-chunk/slot/effect-chunk/renderer/index.js +54 -0
- package/dist/esm/plugins/effect-chunk/slot/effect-chunk/renderer/style.css +6 -0
- package/dist/esm/plugins/effect-chunk/slot/index.d.ts +1 -0
- package/dist/esm/plugins/effect-chunk/slot/index.js +3 -0
- package/dist/esm/plugins/effect-scale/index.d.ts +4 -0
- package/dist/esm/plugins/effect-scale/index.js +22 -0
- package/dist/esm/plugins/effect-scale/render/effect-scale/index.d.ts +13 -0
- package/dist/esm/plugins/effect-scale/render/effect-scale/index.js +48 -0
- package/dist/esm/plugins/effect-scale/render/effect-scale/utils.d.ts +8 -0
- package/dist/esm/plugins/effect-scale/render/effect-scale/utils.js +27 -0
- package/dist/esm/plugins/effect-scale/render/index.d.ts +1 -0
- package/dist/esm/plugins/effect-scale/render/index.js +3 -0
- package/dist/esm/plugins/effect-scale/slot/effect-scale/index.d.ts +17 -0
- package/dist/esm/plugins/effect-scale/slot/effect-scale/index.js +16 -0
- package/dist/esm/plugins/effect-scale/slot/effect-scale/renderer/animation.d.ts +12 -0
- package/dist/esm/plugins/effect-scale/slot/effect-scale/renderer/animation.js +123 -0
- package/dist/esm/plugins/effect-scale/slot/effect-scale/renderer/index.d.ts +10 -0
- package/dist/esm/plugins/effect-scale/slot/effect-scale/renderer/index.js +82 -0
- package/dist/esm/plugins/effect-scale/slot/effect-scale/renderer/style.css +16 -0
- package/dist/esm/plugins/effect-scale/slot/effect-scale-word/index.d.ts +14 -0
- package/dist/esm/plugins/effect-scale/slot/effect-scale-word/index.js +16 -0
- package/dist/esm/plugins/effect-scale/slot/effect-scale-word/renderer/index.d.ts +8 -0
- package/dist/esm/plugins/effect-scale/slot/effect-scale-word/renderer/index.js +35 -0
- package/dist/esm/plugins/effect-scale/slot/index.d.ts +2 -0
- package/dist/esm/plugins/effect-scale/slot/index.js +5 -0
- package/dist/esm/plugins/effect-shad/index.d.ts +4 -0
- package/dist/esm/plugins/effect-shad/index.js +21 -0
- package/dist/esm/plugins/effect-shad/render/effect-shad/index.d.ts +13 -0
- package/dist/esm/plugins/effect-shad/render/effect-shad/index.js +36 -0
- package/dist/esm/plugins/effect-shad/render/effect-shad/utils.d.ts +5 -0
- package/dist/esm/plugins/effect-shad/render/effect-shad/utils.js +21 -0
- package/dist/esm/plugins/effect-shad/render/index.d.ts +1 -0
- package/dist/esm/plugins/effect-shad/render/index.js +3 -0
- package/dist/esm/plugins/effect-shad/slot/effect-shad/index.d.ts +17 -0
- package/dist/esm/plugins/effect-shad/slot/effect-shad/index.js +16 -0
- package/dist/esm/plugins/effect-shad/slot/effect-shad/renderer/index.d.ts +10 -0
- package/dist/esm/plugins/effect-shad/slot/effect-shad/renderer/index.js +193 -0
- package/dist/esm/plugins/effect-shad/slot/effect-shad/renderer/style.css +19 -0
- package/dist/esm/plugins/effect-shad/slot/effect-shad/renderer/utils.d.ts +23 -0
- package/dist/esm/plugins/effect-shad/slot/effect-shad/renderer/utils.js +137 -0
- package/dist/esm/plugins/effect-shad/slot/index.d.ts +1 -0
- package/dist/esm/plugins/effect-shad/slot/index.js +3 -0
- package/dist/esm/plugins/effect-suffix/index.d.ts +2 -0
- package/dist/esm/plugins/effect-suffix/index.js +19 -0
- package/dist/esm/plugins/effect-suffix/slot/effect-suffix/index.d.ts +14 -0
- package/dist/esm/plugins/effect-suffix/slot/effect-suffix/index.js +16 -0
- package/dist/esm/plugins/effect-suffix/slot/effect-suffix/renderer/index.d.ts +9 -0
- package/dist/esm/plugins/effect-suffix/slot/effect-suffix/renderer/index.js +62 -0
- package/dist/esm/plugins/effect-suffix/slot/effect-suffix/renderer/style.css +63 -0
- package/dist/esm/plugins/effect-suffix/slot/effect-suffix/renderer/utils.d.ts +17 -0
- package/dist/esm/plugins/effect-suffix/slot/effect-suffix/renderer/utils.js +36 -0
- package/dist/esm/plugins/effect-suffix/slot/index.d.ts +1 -0
- package/dist/esm/plugins/effect-suffix/slot/index.js +3 -0
- package/dist/esm/plugins/emphasis/index.d.ts +2 -0
- package/dist/esm/plugins/emphasis/index.js +19 -0
- package/dist/esm/plugins/emphasis/slot/emphasis/index.d.ts +13 -0
- package/dist/esm/plugins/emphasis/slot/emphasis/index.js +14 -0
- package/dist/esm/plugins/emphasis/slot/emphasis/renderer/index.d.ts +5 -0
- package/dist/esm/plugins/emphasis/slot/emphasis/renderer/index.js +33 -0
- package/dist/esm/plugins/emphasis/slot/index.d.ts +1 -0
- package/dist/esm/plugins/emphasis/slot/index.js +3 -0
- package/dist/esm/plugins/fallback/index.d.ts +4 -0
- package/dist/esm/plugins/fallback/index.js +21 -0
- package/dist/esm/plugins/fallback/render/fallback/index.d.ts +18 -0
- package/dist/esm/plugins/fallback/render/fallback/index.js +61 -0
- package/dist/esm/plugins/fallback/render/index.d.ts +1 -0
- package/dist/esm/plugins/fallback/render/index.js +3 -0
- package/dist/esm/plugins/fallback/slot/element/index.d.ts +13 -0
- package/dist/esm/plugins/fallback/slot/element/index.js +14 -0
- package/dist/esm/plugins/fallback/slot/element/renderer/index.d.ts +5 -0
- package/dist/esm/plugins/fallback/slot/element/renderer/index.js +305 -0
- package/dist/esm/plugins/fallback/slot/index.d.ts +1 -0
- package/dist/esm/plugins/fallback/slot/index.js +3 -0
- package/dist/esm/plugins/heading/index.d.ts +2 -0
- package/dist/esm/plugins/heading/index.js +19 -0
- package/dist/esm/plugins/heading/slot/heading/index.d.ts +13 -0
- package/dist/esm/plugins/heading/slot/heading/index.js +14 -0
- package/dist/esm/plugins/heading/slot/heading/renderer/index.d.ts +5 -0
- package/dist/esm/plugins/heading/slot/heading/renderer/index.js +44 -0
- package/dist/esm/plugins/heading/slot/index.d.ts +1 -0
- package/dist/esm/plugins/heading/slot/index.js +3 -0
- package/dist/esm/plugins/image/index.d.ts +2 -0
- package/dist/esm/plugins/image/index.js +19 -0
- package/dist/esm/plugins/image/slot/image/index.d.ts +13 -0
- package/dist/esm/plugins/image/slot/image/index.js +14 -0
- package/dist/esm/plugins/image/slot/image/renderer/index.d.ts +5 -0
- package/dist/esm/plugins/image/slot/image/renderer/index.js +48 -0
- package/dist/esm/plugins/image/slot/index.d.ts +1 -0
- package/dist/esm/plugins/image/slot/index.js +3 -0
- package/dist/esm/plugins/link/index.d.ts +2 -0
- package/dist/esm/plugins/link/index.js +19 -0
- package/dist/esm/plugins/link/slot/index.d.ts +1 -0
- package/dist/esm/plugins/link/slot/index.js +3 -0
- package/dist/esm/plugins/link/slot/link/index.d.ts +13 -0
- package/dist/esm/plugins/link/slot/link/index.js +14 -0
- package/dist/esm/plugins/link/slot/link/renderer/index.d.ts +5 -0
- package/dist/esm/plugins/link/slot/link/renderer/index.js +43 -0
- package/dist/esm/plugins/list/index.d.ts +2 -0
- package/dist/esm/plugins/list/index.js +19 -0
- package/dist/esm/plugins/list/slot/index.d.ts +1 -0
- package/dist/esm/plugins/list/slot/index.js +3 -0
- package/dist/esm/plugins/list/slot/list/index.d.ts +13 -0
- package/dist/esm/plugins/list/slot/list/index.js +14 -0
- package/dist/esm/plugins/list/slot/list/renderer/index.d.ts +5 -0
- package/dist/esm/plugins/list/slot/list/renderer/index.js +26 -0
- package/dist/esm/plugins/paragraph/index.d.ts +2 -0
- package/dist/esm/plugins/paragraph/index.js +19 -0
- package/dist/esm/plugins/paragraph/slot/index.d.ts +1 -0
- package/dist/esm/plugins/paragraph/slot/index.js +3 -0
- package/dist/esm/plugins/paragraph/slot/paragraph/index.d.ts +13 -0
- package/dist/esm/plugins/paragraph/slot/paragraph/index.js +14 -0
- package/dist/esm/plugins/paragraph/slot/paragraph/renderer/index.d.ts +5 -0
- package/dist/esm/plugins/paragraph/slot/paragraph/renderer/index.js +29 -0
- package/dist/esm/plugins/strong/index.d.ts +2 -0
- package/dist/esm/plugins/strong/index.js +19 -0
- package/dist/esm/plugins/strong/slot/index.d.ts +1 -0
- package/dist/esm/plugins/strong/slot/index.js +3 -0
- package/dist/esm/plugins/strong/slot/strong/index.d.ts +13 -0
- package/dist/esm/plugins/strong/slot/strong/index.js +14 -0
- package/dist/esm/plugins/strong/slot/strong/renderer/index.d.ts +5 -0
- package/dist/esm/plugins/strong/slot/strong/renderer/index.js +34 -0
- package/dist/esm/plugins/table/index.d.ts +4 -0
- package/dist/esm/plugins/table/index.js +23 -0
- package/dist/esm/plugins/table/render/index.d.ts +2 -0
- package/dist/esm/plugins/table/render/index.js +5 -0
- package/dist/esm/plugins/table/render/table/index.d.ts +13 -0
- package/dist/esm/plugins/table/render/table/index.js +64 -0
- package/dist/esm/plugins/table/render/table-cell/index.d.ts +13 -0
- package/dist/esm/plugins/table/render/table-cell/index.js +45 -0
- package/dist/esm/plugins/table/slot/index.d.ts +2 -0
- package/dist/esm/plugins/table/slot/index.js +5 -0
- package/dist/esm/plugins/table/slot/table/index.d.ts +13 -0
- package/dist/esm/plugins/table/slot/table/index.js +14 -0
- package/dist/esm/plugins/table/slot/table/renderer/index.d.ts +6 -0
- package/dist/esm/plugins/table/slot/table/renderer/index.js +38 -0
- package/dist/esm/plugins/table/slot/table/renderer/style.css +11 -0
- package/dist/esm/plugins/table/slot/table-cell/index.d.ts +13 -0
- package/dist/esm/plugins/table/slot/table-cell/index.js +14 -0
- package/dist/esm/plugins/table/slot/table-cell/renderer/index.d.ts +5 -0
- package/dist/esm/plugins/table/slot/table-cell/renderer/index.js +52 -0
- package/dist/esm/plugins/tex/index.d.ts +2 -0
- package/dist/esm/plugins/tex/index.js +19 -0
- package/dist/esm/plugins/tex/slot/index.d.ts +1 -0
- package/dist/esm/plugins/tex/slot/index.js +3 -0
- package/dist/esm/plugins/tex/slot/tex/index.d.ts +14 -0
- package/dist/esm/plugins/tex/slot/tex/index.js +16 -0
- package/dist/esm/plugins/tex/slot/tex/renderer/index.d.ts +5 -0
- package/dist/esm/plugins/tex/slot/tex/renderer/index.js +36 -0
- package/dist/esm/plugins/tex-mathjax/index.d.ts +3 -0
- package/dist/esm/plugins/tex-mathjax/index.js +19 -0
- package/dist/esm/plugins/tex-mathjax/slot/index.d.ts +1 -0
- package/dist/esm/plugins/tex-mathjax/slot/index.js +3 -0
- package/dist/esm/plugins/tex-mathjax/slot/tex-mathjax/index.d.ts +14 -0
- package/dist/esm/plugins/tex-mathjax/slot/tex-mathjax/index.js +16 -0
- package/dist/esm/plugins/tex-mathjax/slot/tex-mathjax/renderer/index.d.ts +5 -0
- package/dist/esm/plugins/tex-mathjax/slot/tex-mathjax/renderer/index.js +55 -0
- package/dist/esm/plugins/tex-mathjax/slot/tex-mathjax/renderer/utils.d.ts +35 -0
- package/dist/esm/plugins/tex-mathjax/slot/tex-mathjax/renderer/utils.js +197 -0
- package/dist/esm/presets/full/index.d.ts +2 -0
- package/dist/esm/presets/full/index.js +85 -0
- package/dist/esm/presets/lite/index.d.ts +2 -0
- package/dist/esm/presets/lite/index.js +77 -0
- package/dist/esm/typings/index.d.ts +2 -0
- package/dist/esm/typings/index.js +7 -0
- package/dist/esm/typings/plugins/index.d.ts +1 -0
- package/dist/esm/typings/plugins/index.js +5 -0
- package/dist/esm/typings/plugins/plugins.d.ts +20 -0
- package/package.json +88 -3
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { createVNode, isVNode } from "vue";
|
|
2
|
+
import { SCALE_DATA_ATTR, SCALE_WORD_VALUE } from "@fluxdown/core-plugins/plugins/mapper/scale";
|
|
3
|
+
import { assert } from "@fluxdown/utils";
|
|
4
|
+
import { BaseVueRenderPlugin } from "@fluxdown/vue-base-plugins/base";
|
|
5
|
+
import { createTypeOfSlot } from "../../../../base/index.js";
|
|
6
|
+
import { getScaleConfig, isScaleNode } from "./utils.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
function _isSlot(s) {
|
|
21
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
22
|
+
}
|
|
23
|
+
const Scale = /*#__PURE__*/ createTypeOfSlot('Scale');
|
|
24
|
+
const ScaleWord = /*#__PURE__*/ createTypeOfSlot('ScaleWord');
|
|
25
|
+
class EffectScaleRenderPlugin extends BaseVueRenderPlugin {
|
|
26
|
+
static key = 'render-scale';
|
|
27
|
+
match({ node }) {
|
|
28
|
+
return isScaleNode(node);
|
|
29
|
+
}
|
|
30
|
+
render({ node, renderChildren }) {
|
|
31
|
+
assert(isScaleNode(node));
|
|
32
|
+
const children = renderChildren(node);
|
|
33
|
+
if (node.properties[SCALE_DATA_ATTR] === SCALE_WORD_VALUE) {
|
|
34
|
+
return createVNode(ScaleWord, null, _isSlot(children) ? children : {
|
|
35
|
+
default: ()=>[
|
|
36
|
+
children
|
|
37
|
+
]
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return createVNode(Scale, getScaleConfig(node), _isSlot(children) ? children : {
|
|
41
|
+
default: ()=>[
|
|
42
|
+
children
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { EffectScaleRenderPlugin };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Element, ElementContent } from 'hast';
|
|
2
|
+
export declare const isScaleNode: (node: ElementContent) => node is Element;
|
|
3
|
+
export declare const getScaleConfig: ({ properties }: Element) => {
|
|
4
|
+
start: number;
|
|
5
|
+
duration: number;
|
|
6
|
+
from: number;
|
|
7
|
+
blur: number;
|
|
8
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SCALE_CHAR_VALUE, SCALE_DATA_ATTR, SCALE_TAG_NAME, SCALE_WORD_VALUE } from "@fluxdown/core-plugins/plugins/mapper/scale";
|
|
2
|
+
import { isElementWithTag } from "@fluxdown/vue-base-plugins/base";
|
|
3
|
+
import { toNumber } from "lodash-es";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const isScaleNode = (node)=>{
|
|
12
|
+
return isElementWithTag(node, SCALE_TAG_NAME) && (node.properties[SCALE_DATA_ATTR] === SCALE_CHAR_VALUE || node.properties[SCALE_DATA_ATTR] === SCALE_WORD_VALUE);
|
|
13
|
+
};
|
|
14
|
+
const getNumber = (value, fallback)=>{
|
|
15
|
+
const number = toNumber(value);
|
|
16
|
+
return Number.isFinite(number) ? number : fallback;
|
|
17
|
+
};
|
|
18
|
+
const getScaleConfig = ({ properties })=>{
|
|
19
|
+
return {
|
|
20
|
+
start: Math.max(-1, getNumber(properties.dataScaleStart, -1)),
|
|
21
|
+
duration: Math.max(0, getNumber(properties.dataScaleDuration, 200)),
|
|
22
|
+
from: Math.max(0, Math.min(1, getNumber(properties.dataScaleFrom, 0))),
|
|
23
|
+
blur: Math.max(0, getNumber(properties.dataScaleBlur, 0.08))
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { getScaleConfig, isScaleNode };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './effect-scale/index.js';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IPluggableConfig } from '@fluxdown/types';
|
|
2
|
+
import { BaseSlotPlugin } from '../../../../base/index.js';
|
|
3
|
+
export * from './renderer/index.js';
|
|
4
|
+
declare global {
|
|
5
|
+
interface VueSlotConfigs {
|
|
6
|
+
'slot-scale': IPluggableConfig<void>;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export declare class EffectScaleSlotPlugin extends BaseSlotPlugin<'Scale'> {
|
|
10
|
+
static readonly key = "slot-scale";
|
|
11
|
+
readonly Component: import("vue").DefineSetupFnComponent<import("./renderer/index.js").ScaleRendererProps, {}, {}, Omit<Omit<import("@fluxdown/vue-base-plugins/base").ScaleProps, "Raw" | keyof import("../../../../base/index.js").SlotBaseAttributes> & import("../../../../base/index.js").SlotBaseAttributes & {
|
|
12
|
+
Raw: import("@fluxdown/vue-base-plugins/base").SlotPositionType<Omit<import("@fluxdown/vue-base-plugins/base").ScaleProps, "Raw" | keyof import("../../../../base/index.js").SlotBaseAttributes> & import("../../../../base/index.js").SlotBaseAttributes>;
|
|
13
|
+
}, "Raw"> & {
|
|
14
|
+
Raw?: import("../../../../base/index.js").ScaleProps['Raw'];
|
|
15
|
+
} & {}, import("vue").PublicProps>;
|
|
16
|
+
readonly type = "Scale";
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseSlotPlugin } from "../../../../base/index.js";
|
|
2
|
+
import { ScaleRenderer } from "./renderer/index.js";
|
|
3
|
+
|
|
4
|
+
export * from "./renderer/index.js";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class EffectScaleSlotPlugin extends BaseSlotPlugin {
|
|
11
|
+
static key = 'slot-scale';
|
|
12
|
+
Component = ScaleRenderer;
|
|
13
|
+
type = 'Scale';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { EffectScaleSlotPlugin };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MainThread } from '@lynx-js/types';
|
|
2
|
+
export declare const getAppearKeyframes: (blur: number, fontSize?: string | number) => {
|
|
3
|
+
offset: number;
|
|
4
|
+
opacity: 0 | 0.073441 | 0.238144 | 0.431649 | 0.614656 | 0.765625 | 0.876096 | 0.946729 | 0.984064 | 0.998001 | 1;
|
|
5
|
+
filter: string;
|
|
6
|
+
}[];
|
|
7
|
+
export declare const useScaleAnimation: (source: () => {
|
|
8
|
+
keyframes: Record<string, number | string>[];
|
|
9
|
+
start: number;
|
|
10
|
+
duration: number;
|
|
11
|
+
easing: string;
|
|
12
|
+
}) => import("vue-lynx").MainThreadRef<MainThread.Element | null>;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { getTime } from "@fluxdown/utils";
|
|
2
|
+
import { computed, onScopeDispose, watch } from "vue";
|
|
3
|
+
import { nextTick, runOnMainThread, useMainThreadRef } from "vue-lynx";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const APPEAR_STEPS = [
|
|
12
|
+
[
|
|
13
|
+
0,
|
|
14
|
+
1
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
0.073441,
|
|
18
|
+
0.987688
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
0.238144,
|
|
22
|
+
0.951057
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
0.431649,
|
|
26
|
+
0.891007
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
0.614656,
|
|
30
|
+
0.809017
|
|
31
|
+
],
|
|
32
|
+
[
|
|
33
|
+
0.765625,
|
|
34
|
+
0.707107
|
|
35
|
+
],
|
|
36
|
+
[
|
|
37
|
+
0.876096,
|
|
38
|
+
0.587785
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
0.946729,
|
|
42
|
+
0.45399
|
|
43
|
+
],
|
|
44
|
+
[
|
|
45
|
+
0.984064,
|
|
46
|
+
0.309017
|
|
47
|
+
],
|
|
48
|
+
[
|
|
49
|
+
0.998001,
|
|
50
|
+
0.156434
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
1,
|
|
54
|
+
0
|
|
55
|
+
]
|
|
56
|
+
];
|
|
57
|
+
const getAppearKeyframes = (blur, fontSize = '16px')=>{
|
|
58
|
+
const size = String(fontSize);
|
|
59
|
+
const pixels = /^\d+(?:\.\d+)?(?:px)?$/.test(size);
|
|
60
|
+
const radius = pixels ? blur * parseFloat(size) : blur;
|
|
61
|
+
const unit = pixels ? 'px' : 'em';
|
|
62
|
+
return APPEAR_STEPS.map(([opacity, factor], index)=>({
|
|
63
|
+
offset: index / 10,
|
|
64
|
+
opacity,
|
|
65
|
+
filter: `blur(${Number((radius * factor).toFixed(6))}${unit})`
|
|
66
|
+
}));
|
|
67
|
+
};
|
|
68
|
+
const useScaleAnimation = (source)=>{
|
|
69
|
+
const element = useMainThreadRef(null);
|
|
70
|
+
const animation = useMainThreadRef(null);
|
|
71
|
+
const config = computed(source);
|
|
72
|
+
const start = computed(()=>config.value.start); // Both runtimes share wall time; performance.now() can have a different origin.
|
|
73
|
+
const arrival = computed(()=>start.value < 0 ? -1 : Date.now() + start.value - getTime());
|
|
74
|
+
let disposed = false;
|
|
75
|
+
let active = false;
|
|
76
|
+
onScopeDispose(()=>{
|
|
77
|
+
disposed = true;
|
|
78
|
+
if (!active) return;
|
|
79
|
+
void runOnMainThread(()=>{
|
|
80
|
+
'main thread';
|
|
81
|
+
if (!animation) return;
|
|
82
|
+
animation.current?.cancel();
|
|
83
|
+
animation.current = null;
|
|
84
|
+
})();
|
|
85
|
+
});
|
|
86
|
+
watch(config, async ({ keyframes, duration, easing }, _, onCleanup)=>{
|
|
87
|
+
if (!active && (start.value < 0 || duration <= 0)) return;
|
|
88
|
+
let stale = false;
|
|
89
|
+
onCleanup(()=>{
|
|
90
|
+
stale = true;
|
|
91
|
+
});
|
|
92
|
+
const timestamp = arrival.value;
|
|
93
|
+
await nextTick();
|
|
94
|
+
if (disposed || stale) return;
|
|
95
|
+
active = true;
|
|
96
|
+
void runOnMainThread(()=>{
|
|
97
|
+
'main thread';
|
|
98
|
+
if (!animation) return;
|
|
99
|
+
animation.current?.cancel();
|
|
100
|
+
animation.current = null;
|
|
101
|
+
const target = element?.current;
|
|
102
|
+
if (!target || timestamp < 0 || duration <= 0) return;
|
|
103
|
+
try {
|
|
104
|
+
const styled = target;
|
|
105
|
+
if (styled.getComputedStyleProperty?.('animation-play-state') === 'paused') return;
|
|
106
|
+
} catch {}
|
|
107
|
+
const delay = Math.min(0, timestamp - Date.now());
|
|
108
|
+
if (delay <= -duration) return;
|
|
109
|
+
animation.current = target.animate(keyframes, {
|
|
110
|
+
duration,
|
|
111
|
+
delay,
|
|
112
|
+
easing,
|
|
113
|
+
fill: 'both'
|
|
114
|
+
});
|
|
115
|
+
})();
|
|
116
|
+
}, {
|
|
117
|
+
immediate: true,
|
|
118
|
+
flush: 'post'
|
|
119
|
+
});
|
|
120
|
+
return element;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export { getAppearKeyframes, useScaleAnimation };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ScaleProps } from '../../../../../base/index.js';
|
|
2
|
+
import './style.scss';
|
|
3
|
+
export type ScaleRendererProps = Omit<ScaleProps, 'Raw'> & {
|
|
4
|
+
Raw?: ScaleProps['Raw'];
|
|
5
|
+
};
|
|
6
|
+
export declare const ScaleRenderer: import("vue").DefineSetupFnComponent<ScaleRendererProps, {}, {}, Omit<Omit<import("@fluxdown/vue-base-plugins/base").ScaleProps, "Raw" | keyof import("../../../../../base/index.js").SlotBaseAttributes> & import("../../../../../base/index.js").SlotBaseAttributes & {
|
|
7
|
+
Raw: import("@fluxdown/vue-base-plugins/base").SlotPositionType<Omit<import("@fluxdown/vue-base-plugins/base").ScaleProps, "Raw" | keyof import("../../../../../base/index.js").SlotBaseAttributes> & import("../../../../../base/index.js").SlotBaseAttributes>;
|
|
8
|
+
}, "Raw"> & {
|
|
9
|
+
Raw?: ScaleProps['Raw'];
|
|
10
|
+
} & {}, import("vue").PublicProps>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Fragment, Text, computed, createVNode, defineComponent, isVNode, mergeProps } from "vue";
|
|
2
|
+
import { AnimatedText, joinClassNames, useTextStyleSource } from "../../../../../base/index.js";
|
|
3
|
+
import { getAppearKeyframes, useScaleAnimation } from "./animation.js";
|
|
4
|
+
import "./style.css";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
function _isSlot(s) {
|
|
15
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
16
|
+
}
|
|
17
|
+
const isTextOnly = (children)=>Array.isArray(children) ? children.every(isTextOnly) : isVNode(children) ? (children.type === Text || children.type === Fragment) && isTextOnly(children.children) : children === null || children === undefined || typeof children === 'string' || typeof children === 'number' || typeof children === 'boolean';
|
|
18
|
+
const ScaleRenderer = /*#__PURE__*/ defineComponent((props, { attrs, slots })=>{
|
|
19
|
+
const textStyle = useTextStyleSource(()=>props.style);
|
|
20
|
+
const fontSize = computed(()=>textStyle.value.fontSize);
|
|
21
|
+
const appear = computed(()=>getAppearKeyframes(props.blur, fontSize.value));
|
|
22
|
+
const grow = computed(()=>[
|
|
23
|
+
{
|
|
24
|
+
transform: `scale(${props.from})`
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
transform: 'scale(1)'
|
|
28
|
+
}
|
|
29
|
+
]);
|
|
30
|
+
const appearRef = useScaleAnimation(()=>({
|
|
31
|
+
keyframes: appear.value,
|
|
32
|
+
start: props.start,
|
|
33
|
+
duration: props.duration,
|
|
34
|
+
easing: 'linear'
|
|
35
|
+
}));
|
|
36
|
+
const growRef = useScaleAnimation(()=>({
|
|
37
|
+
keyframes: grow.value,
|
|
38
|
+
start: props.start,
|
|
39
|
+
duration: props.duration,
|
|
40
|
+
easing: 'cubic-bezier(0.333333, 1, 0.666667, 1)'
|
|
41
|
+
}));
|
|
42
|
+
return ()=>{
|
|
43
|
+
const { Raw: _Raw, children, start, duration: _duration, from: _from, blur: _blur, class: className, style: _style, ...elementProps } = props;
|
|
44
|
+
const content = slots.default?.() ?? children;
|
|
45
|
+
return createVNode("view", mergeProps(attrs, elementProps, {
|
|
46
|
+
"class": joinClassNames('fluxdown-scale', className),
|
|
47
|
+
"key": start,
|
|
48
|
+
"main-thread-ref": appearRef,
|
|
49
|
+
"style": textStyle.value
|
|
50
|
+
}), [
|
|
51
|
+
createVNode("view", {
|
|
52
|
+
"class": "fluxdown-scale-glyph",
|
|
53
|
+
"main-thread-ref": growRef,
|
|
54
|
+
"style": textStyle.value
|
|
55
|
+
}, [
|
|
56
|
+
createVNode(AnimatedText, {
|
|
57
|
+
"measureLayout": !isTextOnly(content),
|
|
58
|
+
"style": textStyle.value
|
|
59
|
+
}, _isSlot(content) ? content : {
|
|
60
|
+
default: ()=>[
|
|
61
|
+
content
|
|
62
|
+
]
|
|
63
|
+
})
|
|
64
|
+
])
|
|
65
|
+
]);
|
|
66
|
+
};
|
|
67
|
+
}, {
|
|
68
|
+
name: 'FluxdownScaleRenderer',
|
|
69
|
+
props: [
|
|
70
|
+
'Raw',
|
|
71
|
+
'children',
|
|
72
|
+
'start',
|
|
73
|
+
'duration',
|
|
74
|
+
'from',
|
|
75
|
+
'blur',
|
|
76
|
+
'class',
|
|
77
|
+
'style'
|
|
78
|
+
],
|
|
79
|
+
inheritAttrs: false
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
export { ScaleRenderer };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.fluxdown-scale, .fluxdown-scale-glyph {
|
|
2
|
+
vertical-align: baseline;
|
|
3
|
+
animation-play-state: running;
|
|
4
|
+
overflow: visible;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.fluxdown-scale-glyph {
|
|
8
|
+
transform-origin: bottom;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@media (prefers-reduced-motion: reduce) {
|
|
12
|
+
.fluxdown-scale, .fluxdown-scale-glyph {
|
|
13
|
+
animation-play-state: paused;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IPluggableConfig } from '@fluxdown/types';
|
|
2
|
+
import { BaseSlotPlugin } from '../../../../base/index.js';
|
|
3
|
+
import { ScaleWordRenderer } from './renderer/index.js';
|
|
4
|
+
export * from './renderer/index.js';
|
|
5
|
+
declare global {
|
|
6
|
+
interface VueSlotConfigs {
|
|
7
|
+
'slot-scale-word': IPluggableConfig<void>;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class EffectScaleWordSlotPlugin extends BaseSlotPlugin<'ScaleWord'> {
|
|
11
|
+
static readonly key = "slot-scale-word";
|
|
12
|
+
readonly Component: typeof ScaleWordRenderer;
|
|
13
|
+
readonly type = "ScaleWord";
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseSlotPlugin } from "../../../../base/index.js";
|
|
2
|
+
import { ScaleWordRenderer } from "./renderer/index.js";
|
|
3
|
+
|
|
4
|
+
export * from "./renderer/index.js";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class EffectScaleWordSlotPlugin extends BaseSlotPlugin {
|
|
11
|
+
static key = 'slot-scale-word';
|
|
12
|
+
Component = ScaleWordRenderer;
|
|
13
|
+
type = 'ScaleWord';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { EffectScaleWordSlotPlugin };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ScaleWordProps } from '../../../../../base/index.js';
|
|
2
|
+
export type ScaleWordRendererProps = Omit<ScaleWordProps, 'Raw'> & {
|
|
3
|
+
Raw?: ScaleWordProps['Raw'];
|
|
4
|
+
};
|
|
5
|
+
export declare function ScaleWordRenderer({ Raw: _Raw, children, class: className, style, ...elementProps }: ScaleWordRendererProps): import("../../../../../jsx-runtime.js").JSX.Element;
|
|
6
|
+
export declare namespace ScaleWordRenderer {
|
|
7
|
+
var inheritAttrs: boolean;
|
|
8
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createVNode, isVNode, mergeProps } from "vue";
|
|
2
|
+
import { AnimatedText, joinClassNames, useTextStyle } from "../../../../../base/index.js";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
function _isSlot(s) {
|
|
9
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
10
|
+
}
|
|
11
|
+
const ScaleWordRenderer = ({ Raw: _Raw, children, class: className, style, ...elementProps })=>{
|
|
12
|
+
const textStyle = useTextStyle(style);
|
|
13
|
+
return createVNode("view", mergeProps(elementProps, {
|
|
14
|
+
"class": joinClassNames('fluxdown-scale-word', className),
|
|
15
|
+
"style": {
|
|
16
|
+
...textStyle,
|
|
17
|
+
verticalAlign: 'baseline',
|
|
18
|
+
overflow: 'visible'
|
|
19
|
+
}
|
|
20
|
+
}), [
|
|
21
|
+
createVNode(AnimatedText, {
|
|
22
|
+
"style": {
|
|
23
|
+
...textStyle,
|
|
24
|
+
whiteSpace: 'nowrap'
|
|
25
|
+
}
|
|
26
|
+
}, _isSlot(children) ? children : {
|
|
27
|
+
default: ()=>[
|
|
28
|
+
children
|
|
29
|
+
]
|
|
30
|
+
})
|
|
31
|
+
]);
|
|
32
|
+
};
|
|
33
|
+
ScaleWordRenderer.inheritAttrs = false;
|
|
34
|
+
|
|
35
|
+
export { ScaleWordRenderer };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EffectShadRenderPlugin } from "./render/index.js";
|
|
2
|
+
import { EffectShadSlotPlugin } from "./slot/index.js";
|
|
3
|
+
|
|
4
|
+
export * from "./render/index.js";
|
|
5
|
+
export * from "./slot/index.js";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
const EffectShadPlugin = {
|
|
13
|
+
renders: [
|
|
14
|
+
EffectShadRenderPlugin
|
|
15
|
+
],
|
|
16
|
+
slots: [
|
|
17
|
+
EffectShadSlotPlugin
|
|
18
|
+
]
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { EffectShadPlugin };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IPluggableConfig } from '@fluxdown/types';
|
|
2
|
+
import type { VueRenderMatchParams, VueRenderParams } from '@fluxdown/vue-base-plugins/base';
|
|
3
|
+
import { BaseVueRenderPlugin } from '@fluxdown/vue-base-plugins/base';
|
|
4
|
+
declare global {
|
|
5
|
+
interface VueRenderConfigs {
|
|
6
|
+
'render-shad': IPluggableConfig<void>;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export declare class EffectShadRenderPlugin extends BaseVueRenderPlugin {
|
|
10
|
+
static readonly key = "render-shad";
|
|
11
|
+
match({ node }: VueRenderMatchParams): boolean;
|
|
12
|
+
render({ node, renderChildren }: VueRenderParams): import("../../../../jsx-runtime.js").JSX.Element;
|
|
13
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createVNode, mergeProps } from "vue";
|
|
2
|
+
import { assert } from "@fluxdown/utils";
|
|
3
|
+
import { BaseVueRenderPlugin, getTextContent, isElementWithTag } from "@fluxdown/vue-base-plugins/base";
|
|
4
|
+
import { createTypeOfSlot } from "../../../../base/index.js";
|
|
5
|
+
import { getShadConfig, isShadNode } from "./utils.js";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
const Shad = /*#__PURE__*/ createTypeOfSlot('Shad');
|
|
18
|
+
class EffectShadRenderPlugin extends BaseVueRenderPlugin {
|
|
19
|
+
static key = 'render-shad';
|
|
20
|
+
match({ node }) {
|
|
21
|
+
return isShadNode(node);
|
|
22
|
+
}
|
|
23
|
+
render({ node, renderChildren }) {
|
|
24
|
+
assert(isShadNode(node));
|
|
25
|
+
const [leading, active] = node.children;
|
|
26
|
+
assert(leading && isElementWithTag(leading, 'span'));
|
|
27
|
+
assert(active && isElementWithTag(active, 'span'));
|
|
28
|
+
return createVNode(Shad, mergeProps(getShadConfig(node), {
|
|
29
|
+
"active": renderChildren(active),
|
|
30
|
+
"isActive": getTextContent(active).length > 0,
|
|
31
|
+
"leading": renderChildren(leading)
|
|
32
|
+
}), null);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { EffectShadRenderPlugin };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SHAD_DATA_ATTR, SHAD_HOST_VALUE, SHAD_TAG_NAME } from "@fluxdown/core-plugins/plugins/mapper/shad";
|
|
2
|
+
import { isElementWithTag } from "@fluxdown/vue-base-plugins/base";
|
|
3
|
+
import { toNumber } from "lodash-es";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const isShadNode = (node)=>{
|
|
12
|
+
return isElementWithTag(node, SHAD_TAG_NAME) && node.properties[SHAD_DATA_ATTR] === SHAD_HOST_VALUE;
|
|
13
|
+
};
|
|
14
|
+
const getShadConfig = ({ properties })=>{
|
|
15
|
+
const maskWidth = toNumber(properties.dataShadMaskWidth);
|
|
16
|
+
return {
|
|
17
|
+
maskWidth: Number.isFinite(maskWidth) ? Math.max(0, maskWidth) : 15
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { getShadConfig, isShadNode };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './effect-shad/index.js';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IPluggableConfig } from '@fluxdown/types';
|
|
2
|
+
import { BaseSlotPlugin } from '../../../../base/index.js';
|
|
3
|
+
export * from './renderer/index.js';
|
|
4
|
+
declare global {
|
|
5
|
+
interface VueSlotConfigs {
|
|
6
|
+
'slot-shad': IPluggableConfig<void>;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export declare class EffectShadSlotPlugin extends BaseSlotPlugin<'Shad'> {
|
|
10
|
+
static readonly key = "slot-shad";
|
|
11
|
+
readonly Component: import("vue").DefineSetupFnComponent<import("./renderer/index.js").ShadRendererProps, {}, {}, Omit<Omit<import("@fluxdown/vue-base-plugins/base").ShadProps, "Raw" | keyof import("../../../../base/index.js").SlotBaseAttributes> & import("../../../../base/index.js").SlotBaseAttributes & {
|
|
12
|
+
Raw: import("@fluxdown/vue-base-plugins/base").SlotPositionType<Omit<import("@fluxdown/vue-base-plugins/base").ShadProps, "Raw" | keyof import("../../../../base/index.js").SlotBaseAttributes> & import("../../../../base/index.js").SlotBaseAttributes>;
|
|
13
|
+
}, "Raw"> & {
|
|
14
|
+
Raw?: import("../../../../base/index.js").ShadProps['Raw'];
|
|
15
|
+
} & {}, import("vue").PublicProps>;
|
|
16
|
+
readonly type = "Shad";
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseSlotPlugin } from "../../../../base/index.js";
|
|
2
|
+
import { ShadRenderer } from "./renderer/index.js";
|
|
3
|
+
|
|
4
|
+
export * from "./renderer/index.js";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class EffectShadSlotPlugin extends BaseSlotPlugin {
|
|
11
|
+
static key = 'slot-shad';
|
|
12
|
+
Component = ShadRenderer;
|
|
13
|
+
type = 'Shad';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { EffectShadSlotPlugin };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ShadProps } from '../../../../../base/index.js';
|
|
2
|
+
import './style.scss';
|
|
3
|
+
export type ShadRendererProps = Omit<ShadProps, 'Raw'> & {
|
|
4
|
+
Raw?: ShadProps['Raw'];
|
|
5
|
+
};
|
|
6
|
+
export declare const ShadRenderer: import("vue").DefineSetupFnComponent<ShadRendererProps, {}, {}, Omit<Omit<import("@fluxdown/vue-base-plugins/base").ShadProps, "Raw" | keyof import("../../../../../base/index.js").SlotBaseAttributes> & import("../../../../../base/index.js").SlotBaseAttributes & {
|
|
7
|
+
Raw: import("@fluxdown/vue-base-plugins/base").SlotPositionType<Omit<import("@fluxdown/vue-base-plugins/base").ShadProps, "Raw" | keyof import("../../../../../base/index.js").SlotBaseAttributes> & import("../../../../../base/index.js").SlotBaseAttributes>;
|
|
8
|
+
}, "Raw"> & {
|
|
9
|
+
Raw?: ShadProps['Raw'];
|
|
10
|
+
} & {}, import("vue").PublicProps>;
|