@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
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# @fluxdown/vue-lynx-plugins
|
|
2
|
+
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fba214a: Resolve plugin enablement and constructor configuration through optional static `enabled` and `prepareConfig` hooks across all plugin types. Keep context outside instances and refresh active pluggables when reactive inputs change.
|
|
8
|
+
|
|
9
|
+
Include `TexRepairPlugin` in the default core repair preset. Core plugins depend on KaTeX to select a valid streaming prefix when no custom `render` is supplied; renderer plugins use this preset without separate repair registration.
|
|
10
|
+
|
|
11
|
+
Keep repair output intact across all renderer adapters, including trailing TeX whitespace and empty pending formulas. Validate streaming TeX in the repair layer and preserve lazy loading in renderer components, with an empty loading placeholder instead of raw-source flashes. Default compiler presets now include KaTeX; MathJax-only syntax is deferred until the formula closes unless a custom validator is configured.
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [fba214a]
|
|
14
|
+
- Updated dependencies [fba214a]
|
|
15
|
+
- Updated dependencies [fba214a]
|
|
16
|
+
- @fluxdown/core-plugins@0.14.0
|
|
17
|
+
- @fluxdown/types@0.11.0
|
|
18
|
+
- @fluxdown/vue-base-plugins@0.2.1
|
|
19
|
+
|
|
20
|
+
## 0.2.0
|
|
21
|
+
|
|
22
|
+
### Minor Changes
|
|
23
|
+
|
|
24
|
+
- cedcaa2: Add Vue Lynx rendering and native plugins with the same themes, Markdown elements, and streaming effects as React Lynx. Rename the existing Lynx packages to React Lynx, and expose both frameworks in the website, documentation, and release consumer checks.
|
|
25
|
+
|
|
26
|
+
Use Shiki's Oniguruma WebAssembly engine for both Lynx renderers so code highlighting also works on Android QuickJS, and keep syntax colors current when themes change during initialization.
|
|
27
|
+
|
|
28
|
+
Preserve measured Shad token widths when the parent reports its initial layout width, keeping the gradient consistent across both frameworks and native hosts.
|
|
29
|
+
|
|
30
|
+
Expand Vue Lynx suffix keyframes for its native encoder while preserving React Lynx animation timing and opacity.
|
|
31
|
+
|
|
32
|
+
Share the Vue renderer lifecycle, reconciliation, and host-independent render plugins through `@fluxdown/vue-base` and `@fluxdown/vue-base-plugins`, keeping DOM and Lynx attributes, styles, and animations in their platform packages.
|
|
33
|
+
|
|
34
|
+
Align Lynx plugin exports and base directories with the other plugin packages. Keep code blocks readable without highlighting when Shiki initialization or tokenization fails.
|
|
35
|
+
|
|
36
|
+
Import shared Vue plugins and contracts directly from `@fluxdown/vue-base-plugins`. Use `TexMathJaxPlugin` for Lynx Full formulas, match the Vue MathJax extension set, and provide optional native Prism highlighting.
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- Updated dependencies [cedcaa2]
|
|
41
|
+
- @fluxdown/vue-base-plugins@0.2.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Fluxdown contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @fluxdown/vue-lynx-plugins
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Vue Lynx render slots and plugin presets for Fluxdown.
|
|
4
|
+
|
|
5
|
+
[Documentation](../../website/docs/en/guide/vue-lynx/plugins.md)
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { computed, onScopeDispose, watch } from "vue";
|
|
2
|
+
import { nextTick, runOnMainThread, useMainThreadRef } from "vue-lynx";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
const useTextAnimationRef = (source)=>{
|
|
9
|
+
const element = useMainThreadRef(null);
|
|
10
|
+
const handle = useMainThreadRef(null);
|
|
11
|
+
const config = computed(source);
|
|
12
|
+
let disposed = false;
|
|
13
|
+
let active = false;
|
|
14
|
+
onScopeDispose(()=>{
|
|
15
|
+
disposed = true;
|
|
16
|
+
if (!active) return;
|
|
17
|
+
void runOnMainThread(()=>{
|
|
18
|
+
'main thread';
|
|
19
|
+
if (!handle) return;
|
|
20
|
+
handle.current?.cancel();
|
|
21
|
+
handle.current = null;
|
|
22
|
+
})();
|
|
23
|
+
});
|
|
24
|
+
watch(config, async ({ arrival, duration, color }, _, onCleanup)=>{
|
|
25
|
+
if (!active && (arrival < 0 || duration <= 0 || !color)) return;
|
|
26
|
+
let stale = false;
|
|
27
|
+
onCleanup(()=>{
|
|
28
|
+
stale = true;
|
|
29
|
+
});
|
|
30
|
+
await nextTick();
|
|
31
|
+
if (disposed || stale) return;
|
|
32
|
+
active = true;
|
|
33
|
+
void runOnMainThread(()=>{
|
|
34
|
+
'main thread';
|
|
35
|
+
if (!handle) return;
|
|
36
|
+
handle.current?.cancel();
|
|
37
|
+
handle.current = null;
|
|
38
|
+
const target = element?.current;
|
|
39
|
+
if (!target || arrival < 0 || duration <= 0 || !color) return;
|
|
40
|
+
try {
|
|
41
|
+
const styled = target;
|
|
42
|
+
if (styled.getComputedStyleProperty?.('animation-play-state') === 'paused') return;
|
|
43
|
+
} catch {}
|
|
44
|
+
const delay = Math.min(0, arrival - Date.now());
|
|
45
|
+
if (delay <= -duration) return;
|
|
46
|
+
handle.current = target.animate([
|
|
47
|
+
{
|
|
48
|
+
color: 'transparent'
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
color: String(color)
|
|
52
|
+
}
|
|
53
|
+
], {
|
|
54
|
+
duration,
|
|
55
|
+
delay,
|
|
56
|
+
easing: 'cubic-bezier(0, 0, 0.58, 1)',
|
|
57
|
+
fill: 'both'
|
|
58
|
+
});
|
|
59
|
+
})();
|
|
60
|
+
}, {
|
|
61
|
+
immediate: true,
|
|
62
|
+
flush: 'post'
|
|
63
|
+
});
|
|
64
|
+
return element;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export { useTextAnimationRef };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CSSProperties, TextProps } from '@lynx-js/types';
|
|
2
|
+
import type { VNodeChild } from 'vue';
|
|
3
|
+
type AnimatedTextProps = Omit<TextProps, 'children' | 'style' | 'class'> & {
|
|
4
|
+
children?: VNodeChild;
|
|
5
|
+
style?: CSSProperties;
|
|
6
|
+
/** Leaf glyphs can inherit the surrounding text width without reporting their own layout. */
|
|
7
|
+
measureLayout?: boolean;
|
|
8
|
+
};
|
|
9
|
+
/** Native inline text cannot animate opacity; animate each resolved foreground instead. */
|
|
10
|
+
export declare const AnimatedText: import("vue").DefineSetupFnComponent<AnimatedTextProps, {}, {}, Omit<TextProps, "children" | "class" | "style"> & {
|
|
11
|
+
children?: VNodeChild;
|
|
12
|
+
style?: CSSProperties;
|
|
13
|
+
/** Leaf glyphs can inherit the surrounding text width without reporting their own layout. */
|
|
14
|
+
measureLayout?: boolean;
|
|
15
|
+
} & {}, import("vue").PublicProps>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Fragment, Text, computed, createVNode, defineComponent, isVNode, mergeProps, normalizeClass, shallowRef } from "vue";
|
|
2
|
+
import { TextLayoutWidthProvider, useTextAnimationSource, useTextLayoutWidthSource } from "../../context/index.js";
|
|
3
|
+
import { useTextStyleSource } from "../../theme/index.js";
|
|
4
|
+
import { useTextAnimationRef } from "./animation.js";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
const renderText = (children)=>{
|
|
15
|
+
if (Array.isArray(children)) {
|
|
16
|
+
return children.map(renderText);
|
|
17
|
+
}
|
|
18
|
+
if (isVNode(children) && children.type === Text) {
|
|
19
|
+
return createVNode('raw-text', {
|
|
20
|
+
key: children.key ?? undefined,
|
|
21
|
+
text: String(children.children ?? '')
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
if (isVNode(children) && children.type === Fragment) {
|
|
25
|
+
return createVNode(Fragment, {
|
|
26
|
+
key: children.key ?? undefined
|
|
27
|
+
}, renderText(children.children));
|
|
28
|
+
}
|
|
29
|
+
if (typeof children === 'string' || typeof children === 'number') {
|
|
30
|
+
return createVNode('raw-text', {
|
|
31
|
+
text: children
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return children;
|
|
35
|
+
}; /** Native inline text cannot animate opacity; animate each resolved foreground instead. */
|
|
36
|
+
const AnimatedText = /*#__PURE__*/ defineComponent((props, { attrs, slots })=>{
|
|
37
|
+
const animation = useTextAnimationSource();
|
|
38
|
+
const parentWidth = useTextLayoutWidthSource();
|
|
39
|
+
const layoutWidth = shallowRef();
|
|
40
|
+
const inherited = useTextStyleSource();
|
|
41
|
+
const color = computed(()=>props.style?.color ?? inherited.value.color);
|
|
42
|
+
const native = computed(()=>{
|
|
43
|
+
const value = animation?.value;
|
|
44
|
+
return value && 'arrival' in value ? value : null;
|
|
45
|
+
});
|
|
46
|
+
const element = useTextAnimationRef(()=>({
|
|
47
|
+
arrival: native.value?.arrival ?? -1,
|
|
48
|
+
duration: native.value?.duration ?? 0,
|
|
49
|
+
color: color.value
|
|
50
|
+
}));
|
|
51
|
+
const onLayoutChange = (event)=>{
|
|
52
|
+
const width = event.detail.width;
|
|
53
|
+
layoutWidth.value = typeof width === 'number' && Number.isFinite(width) && width > 0 ? width : undefined;
|
|
54
|
+
props.bindlayoutchange?.(event);
|
|
55
|
+
};
|
|
56
|
+
return ()=>{
|
|
57
|
+
const { children, style, bindlayoutchange, measureLayout = true, ...elementProps } = props;
|
|
58
|
+
return createVNode(TextLayoutWidthProvider, {
|
|
59
|
+
"value": measureLayout ? layoutWidth.value ?? parentWidth?.value : parentWidth?.value
|
|
60
|
+
}, {
|
|
61
|
+
default: ()=>[
|
|
62
|
+
createVNode("text", mergeProps({
|
|
63
|
+
"text-fake-bold": true
|
|
64
|
+
}, attrs, elementProps, {
|
|
65
|
+
"class": normalizeClass(attrs.class),
|
|
66
|
+
"bindlayoutchange": measureLayout ? onLayoutChange : bindlayoutchange,
|
|
67
|
+
"main-thread-ref": native.value ? element : undefined,
|
|
68
|
+
"style": style
|
|
69
|
+
}), [
|
|
70
|
+
renderText(slots.default?.() ?? children)
|
|
71
|
+
])
|
|
72
|
+
]
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
}, {
|
|
76
|
+
name: 'FluxdownAnimatedText',
|
|
77
|
+
props: [
|
|
78
|
+
'children',
|
|
79
|
+
'style',
|
|
80
|
+
'bindlayoutchange',
|
|
81
|
+
'measureLayout'
|
|
82
|
+
],
|
|
83
|
+
inheritAttrs: false
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
export { AnimatedText };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './animated-text/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PREFIX = "fluxdown";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './defaults.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CSSProperties } from '@lynx-js/types';
|
|
2
|
+
import type { Ref, VNodeChild } from 'vue';
|
|
3
|
+
import type { TextColorAnimation } from './type.js';
|
|
4
|
+
export * from './type.js';
|
|
5
|
+
type TextAnimation = CSSProperties | TextColorAnimation | null;
|
|
6
|
+
export declare const TextAnimationProvider: import("vue").DefineSetupFnComponent<{
|
|
7
|
+
value: TextAnimation;
|
|
8
|
+
children?: VNodeChild;
|
|
9
|
+
}, {}, {}, {
|
|
10
|
+
value: TextAnimation;
|
|
11
|
+
children?: VNodeChild;
|
|
12
|
+
} & {}, import("vue").PublicProps>;
|
|
13
|
+
export declare const useTextAnimation: () => TextAnimation;
|
|
14
|
+
export declare const useTextAnimationSource: () => Ref<TextAnimation, TextAnimation> | null;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { computed, defineComponent, inject, provide } from "vue";
|
|
2
|
+
|
|
3
|
+
export * from "./type.js";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
const TextAnimationContext = /*#__PURE__*/ Symbol('FluxdownTextAnimation');
|
|
8
|
+
const TextAnimationProvider = /*#__PURE__*/ defineComponent((props, { slots })=>{
|
|
9
|
+
provide(TextAnimationContext, computed(()=>props.value));
|
|
10
|
+
return ()=>slots.default?.() ?? props.children;
|
|
11
|
+
}, {
|
|
12
|
+
name: 'FluxdownTextAnimationProvider',
|
|
13
|
+
props: [
|
|
14
|
+
'value',
|
|
15
|
+
'children'
|
|
16
|
+
],
|
|
17
|
+
inheritAttrs: false
|
|
18
|
+
});
|
|
19
|
+
const useTextAnimation = ()=>inject(TextAnimationContext, null)?.value ?? null;
|
|
20
|
+
const useTextAnimationSource = ()=>inject(TextAnimationContext, null);
|
|
21
|
+
|
|
22
|
+
export { TextAnimationProvider, useTextAnimation, useTextAnimationSource };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Ref, VNodeChild } from 'vue';
|
|
2
|
+
export declare const TextLayoutWidthProvider: import("vue").DefineSetupFnComponent<{
|
|
3
|
+
value?: number;
|
|
4
|
+
children?: VNodeChild;
|
|
5
|
+
}, {}, {}, {
|
|
6
|
+
value?: number;
|
|
7
|
+
children?: VNodeChild;
|
|
8
|
+
} & {}, import("vue").PublicProps>;
|
|
9
|
+
/** Width of the nearest native root text; inline text does not emit layout events. */
|
|
10
|
+
export declare const useTextLayoutWidth: () => number | undefined;
|
|
11
|
+
export declare const useTextLayoutWidthSource: () => Ref<number | undefined, number | undefined> | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { computed, defineComponent, inject, provide } from "vue";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
const TextLayoutWidthContext = /*#__PURE__*/ Symbol('FluxdownTextLayoutWidth');
|
|
6
|
+
const TextLayoutWidthProvider = /*#__PURE__*/ defineComponent((props, { slots })=>{
|
|
7
|
+
provide(TextLayoutWidthContext, computed(()=>props.value));
|
|
8
|
+
return ()=>slots.default?.() ?? props.children;
|
|
9
|
+
}, {
|
|
10
|
+
name: 'FluxdownTextLayoutWidthProvider',
|
|
11
|
+
props: [
|
|
12
|
+
'value',
|
|
13
|
+
'children'
|
|
14
|
+
],
|
|
15
|
+
inheritAttrs: false
|
|
16
|
+
}); /** Width of the nearest native root text; inline text does not emit layout events. */
|
|
17
|
+
const useTextLayoutWidth = ()=>inject(TextLayoutWidthContext, null)?.value;
|
|
18
|
+
const useTextLayoutWidthSource = ()=>inject(TextLayoutWidthContext, null);
|
|
19
|
+
|
|
20
|
+
export { TextLayoutWidthProvider, useTextLayoutWidth, useTextLayoutWidthSource };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BlockLayout } from '@fluxdown/vue-base-plugins/base';
|
|
2
|
+
import type { CSSProperties } from '@lynx-js/types';
|
|
3
|
+
import type { ElementContent, Parent } from 'hast';
|
|
4
|
+
import type { ThemeTokens } from '../theme/type.js';
|
|
5
|
+
export declare const isBlockElement: (node: ElementContent) => boolean;
|
|
6
|
+
export declare const getBlockSpacing: (node: ElementContent, tokens: ThemeTokens, parent?: Parent) => [string, string];
|
|
7
|
+
/** Flex/linear layouts do not collapse block margins, so account for the preceding block. */
|
|
8
|
+
export declare const getBlockStyle: (current: ElementContent, parents: Parent[], tokens: ThemeTokens, layout?: BlockLayout) => CSSProperties;
|
|
9
|
+
export declare const useBlockStyle: (current: ElementContent, parents: Parent[]) => CSSProperties;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { isElementWithTag, isHastElement, useBlockLayout } from "@fluxdown/vue-base-plugins/base";
|
|
2
|
+
import { findLast } from "lodash-es";
|
|
3
|
+
import { useTheme } from "../theme/index.js";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const isBlockElement = (node)=>isElementWithTag(node, 'p', 'pre', 'blockquote', 'ul', 'ol', 'table', 'hr', 'div', 'section', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6') || node.type === 'element' && node.properties.dataType === 'block-math';
|
|
12
|
+
const toPixels = (value, tokens)=>{
|
|
13
|
+
const spacing = /^var\(--fluxdown-spacing-(xs|sm|md|lg|xl)\)$/.exec(value)?.[1];
|
|
14
|
+
const resolved = spacing ? tokens.spacing[spacing] : value;
|
|
15
|
+
const number = parseFloat(resolved);
|
|
16
|
+
return resolved.endsWith('rem') ? number * 16 : number;
|
|
17
|
+
};
|
|
18
|
+
const getBlockSpacing = (node, tokens, parent)=>{
|
|
19
|
+
if (node.type !== 'element') {
|
|
20
|
+
return [
|
|
21
|
+
'0',
|
|
22
|
+
'0'
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
if (node.tagName in tokens.heading) {
|
|
26
|
+
const heading = tokens.heading[node.tagName];
|
|
27
|
+
return [
|
|
28
|
+
heading.marginTop,
|
|
29
|
+
heading.marginBottom
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
if (node.tagName === 'p') {
|
|
33
|
+
if (parent && isHastElement(parent) && parent.tagName === 'li') {
|
|
34
|
+
return [
|
|
35
|
+
tokens.spacing.sm,
|
|
36
|
+
tokens.spacing.sm
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
return [
|
|
40
|
+
tokens.paragraph.marginTop,
|
|
41
|
+
tokens.paragraph.marginBottom
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
if (node.tagName === 'ul' || node.tagName === 'ol') {
|
|
45
|
+
if (parent && isHastElement(parent) && parent.tagName === 'li') {
|
|
46
|
+
return [
|
|
47
|
+
tokens.spacing.xs,
|
|
48
|
+
tokens.spacing.xs
|
|
49
|
+
];
|
|
50
|
+
}
|
|
51
|
+
return [
|
|
52
|
+
tokens.spacing.md,
|
|
53
|
+
tokens.spacing.md
|
|
54
|
+
];
|
|
55
|
+
}
|
|
56
|
+
if (node.tagName === 'li') {
|
|
57
|
+
return [
|
|
58
|
+
tokens.spacing.xs,
|
|
59
|
+
tokens.spacing.xs
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
if (node.tagName === 'hr') {
|
|
63
|
+
return [
|
|
64
|
+
tokens.divider.marginBlock,
|
|
65
|
+
tokens.divider.marginBlock
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
if (node.properties.dataFootnotes) {
|
|
69
|
+
return [
|
|
70
|
+
tokens.footnotes.marginTop,
|
|
71
|
+
'0'
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
return [
|
|
75
|
+
tokens.spacing.lg,
|
|
76
|
+
tokens.spacing.lg
|
|
77
|
+
];
|
|
78
|
+
}; /** Flex/linear layouts do not collapse block margins, so account for the preceding block. */
|
|
79
|
+
const getBlockStyle = (current, parents, tokens, layout)=>{
|
|
80
|
+
const parent = parents.at(-1);
|
|
81
|
+
const siblings = parent?.children.filter((child)=>child.type === 'element' || child.type === 'text' && Boolean(child.value.trim())) ?? [
|
|
82
|
+
current
|
|
83
|
+
];
|
|
84
|
+
const index = siblings.indexOf(current);
|
|
85
|
+
const [top, bottom] = getBlockSpacing(current, tokens, parent);
|
|
86
|
+
const previousRoot = parent?.type === 'root' && index === 0 ? layout?.previous : undefined;
|
|
87
|
+
const previous = siblings[index - 1] ?? findLast(previousRoot?.children, (child)=>child.type === 'element');
|
|
88
|
+
const previousBottom = previous && isBlockElement(previous) ? getBlockSpacing(previous, tokens, parent)[1] : '0';
|
|
89
|
+
if (isElementWithTag(current, 'li')) {
|
|
90
|
+
return {
|
|
91
|
+
marginTop: index <= 0 ? '0px' : top
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
if (parent?.type === 'root') {
|
|
95
|
+
return {
|
|
96
|
+
marginTop: index === 0 && layout?.first ? '0px' : previous ? `${Math.max(0, toPixels(top, tokens) - toPixels(previousBottom, tokens))}px` : top,
|
|
97
|
+
marginBottom: index === siblings.length - 1 && layout?.last ? '0px' : bottom
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
marginTop: index <= 0 ? '0px' : `${Math.max(0, toPixels(top, tokens) - toPixels(previousBottom, tokens))}px`,
|
|
102
|
+
marginBottom: index === siblings.length - 1 ? parent && isHastElement(parent) && parent.tagName === 'blockquote' && isElementWithTag(current, 'ul', 'ol') ? tokens.spacing.xs : '0px' : bottom
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
const useBlockStyle = (current, parents)=>{
|
|
106
|
+
const layout = useBlockLayout().value;
|
|
107
|
+
const { tokens } = useTheme();
|
|
108
|
+
return getBlockStyle(current, parents, tokens, layout);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export { getBlockSpacing, getBlockStyle, isBlockElement, useBlockStyle };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** Only presentation data crosses the HAST/native-element boundary. */ const getVueLynxProps = (node)=>{
|
|
2
|
+
const properties = node?.properties;
|
|
3
|
+
if (!properties) {
|
|
4
|
+
return {};
|
|
5
|
+
}
|
|
6
|
+
const props = {};
|
|
7
|
+
if (typeof properties.id === 'string') {
|
|
8
|
+
props.id = properties.id;
|
|
9
|
+
}
|
|
10
|
+
const className = properties.className;
|
|
11
|
+
if (Array.isArray(className)) {
|
|
12
|
+
props.class = className.join(' ');
|
|
13
|
+
} else if (typeof className === 'string') {
|
|
14
|
+
props.class = className;
|
|
15
|
+
}
|
|
16
|
+
for (const key of [
|
|
17
|
+
'width',
|
|
18
|
+
'height',
|
|
19
|
+
'start'
|
|
20
|
+
]){
|
|
21
|
+
const value = properties[key];
|
|
22
|
+
if (typeof value === 'number' || typeof value === 'string') {
|
|
23
|
+
props[key] = value;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (typeof properties.checked === 'boolean') {
|
|
27
|
+
props.checked = properties.checked;
|
|
28
|
+
}
|
|
29
|
+
for (const [key, value] of Object.entries(properties)){
|
|
30
|
+
if (!/^data(?:[A-Z]|-)/.test(key) || ![
|
|
31
|
+
'string',
|
|
32
|
+
'number',
|
|
33
|
+
'boolean'
|
|
34
|
+
].includes(typeof value)) {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
const name = key.replace(/[A-Z]/g, (letter)=>`-${letter.toLowerCase()}`);
|
|
38
|
+
props[name] = value;
|
|
39
|
+
}
|
|
40
|
+
return props;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { getVueLynxProps };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SlotType } from '@fluxdown/vue-base-plugins/base';
|
|
2
|
+
import { BaseSlotPlugin as SharedBaseSlotPlugin } from '@fluxdown/vue-base-plugins/base';
|
|
3
|
+
import type { SlotProps } from './type.js';
|
|
4
|
+
export declare abstract class BaseSlotPlugin<T extends SlotType> extends SharedBaseSlotPlugin<T, SlotProps[T]> {
|
|
5
|
+
}
|