origam 2.2.1 → 2.3.0
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 +224 -0
- package/README.md +22 -0
- package/dist/src/assets/css/tokens/dark.css +318 -0
- package/dist/src/assets/css/tokens/light.css +159 -0
- package/dist/src/assets/locales/index.js +2 -2
- package/dist/src/assets/scss/tokens/_dark.scss +159 -0
- package/dist/src/assets/scss/tokens/_light.scss +159 -0
- package/dist/src/components/Bracket/OrigamBracket.vue +530 -0
- package/dist/src/components/Bracket/OrigamBracketCompetitor.vue +210 -0
- package/dist/src/components/Bracket/OrigamBracketMatch.vue +288 -0
- package/dist/src/components/Bracket/OrigamBracketRound.vue +150 -0
- package/dist/src/components/Bracket/index.cjs +34 -0
- package/dist/src/components/Bracket/index.d.ts +4 -0
- package/dist/src/components/Bracket/index.js +4 -0
- package/dist/src/components/ClientOnly/OrigamClientOnly.vue +28 -0
- package/dist/src/components/ClientOnly/index.cjs +13 -0
- package/dist/src/components/ClientOnly/index.d.ts +1 -0
- package/dist/src/components/ClientOnly/index.js +1 -0
- package/dist/src/components/Code/OrigamCode.vue +449 -0
- package/dist/src/components/Code/index.cjs +13 -0
- package/dist/src/components/Code/index.d.ts +1 -0
- package/dist/src/components/Code/index.js +1 -0
- package/dist/src/components/ColorPickerField/OrigamColorPickerField.vue +1 -0
- package/dist/src/components/CommandPalette/OrigamCommandPalette.vue +614 -0
- package/dist/src/components/CommandPalette/index.cjs +13 -0
- package/dist/src/components/CommandPalette/index.d.ts +1 -0
- package/dist/src/components/CommandPalette/index.js +1 -0
- package/dist/src/components/DatePickerField/OrigamDatePickerField.vue +1 -0
- package/dist/src/components/Parallax/OrigamParallax.vue +65 -34
- package/dist/src/components/Parallax/OrigamParallaxLayer.vue +119 -0
- package/dist/src/components/Parallax/index.cjs +7 -0
- package/dist/src/components/Parallax/index.d.ts +1 -0
- package/dist/src/components/Parallax/index.js +1 -0
- package/dist/src/components/PasswordField/OrigamPasswordField.vue +1 -0
- package/dist/src/components/Select/OrigamSelect.vue +1 -0
- package/dist/src/components/SnackbarStack/OrigamSnackbarStack.vue +457 -0
- package/dist/src/components/SnackbarStack/index.cjs +13 -0
- package/dist/src/components/SnackbarStack/index.d.ts +1 -0
- package/dist/src/components/SnackbarStack/index.js +1 -0
- package/dist/src/components/Tabs/OrigamTab.vue +263 -0
- package/dist/src/components/Tabs/OrigamTabPanel.vue +112 -0
- package/dist/src/components/Tabs/OrigamTabPanels.vue +139 -0
- package/dist/src/components/Tabs/OrigamTabs.vue +242 -0
- package/dist/src/components/Tabs/index.cjs +34 -0
- package/dist/src/components/Tabs/index.d.ts +4 -0
- package/dist/src/components/Tabs/index.js +4 -0
- package/dist/src/components/TextField/OrigamTextField.vue +75 -5
- package/dist/src/components/TextareaField/OrigamRichToolbar.vue +284 -0
- package/dist/src/components/TextareaField/OrigamTextareaField.vue +192 -5
- package/dist/src/components/TextareaField/index.cjs +7 -0
- package/dist/src/components/TextareaField/index.d.ts +1 -0
- package/dist/src/components/TextareaField/index.js +1 -0
- package/dist/src/components/index.cjs +66 -0
- package/dist/src/components/index.d.ts +6 -0
- package/dist/src/components/index.js +6 -0
- package/dist/src/composables/Code/code.composable.cjs +98 -0
- package/dist/src/composables/Code/code.composable.d.ts +10 -0
- package/dist/src/composables/Code/code.composable.js +82 -0
- package/dist/src/composables/CommandPalette/command.composable.cjs +53 -0
- package/dist/src/composables/CommandPalette/command.composable.d.ts +37 -0
- package/dist/src/composables/CommandPalette/command.composable.js +46 -0
- package/dist/src/composables/Commons/virtual.composable.cjs +1 -0
- package/dist/src/composables/Commons/virtual.composable.js +1 -0
- package/dist/src/composables/CssSupport/cssSupport.composable.cjs +12 -0
- package/dist/src/composables/CssSupport/cssSupport.composable.d.ts +25 -0
- package/dist/src/composables/CssSupport/cssSupport.composable.js +10 -1
- package/dist/src/composables/DataTable/headers.composable.d.ts +36 -36
- package/dist/src/composables/Mask/index.cjs +16 -0
- package/dist/src/composables/Mask/index.d.ts +1 -0
- package/dist/src/composables/Mask/index.js +1 -0
- package/dist/src/composables/Mask/mask.composable.cjs +57 -0
- package/dist/src/composables/Mask/mask.composable.d.ts +39 -0
- package/dist/src/composables/Mask/mask.composable.js +51 -0
- package/dist/src/composables/Parallax/parallax.composable.cjs +232 -0
- package/dist/src/composables/Parallax/parallax.composable.d.ts +60 -0
- package/dist/src/composables/Parallax/parallax.composable.js +219 -0
- package/dist/src/composables/Responsive/aspect.composable.cjs +6 -1
- package/dist/src/composables/Responsive/aspect.composable.d.ts +10 -0
- package/dist/src/composables/Responsive/aspect.composable.js +6 -1
- package/dist/src/composables/SnackbarStack/snackbar-stack.composable.cjs +102 -0
- package/dist/src/composables/SnackbarStack/snackbar-stack.composable.d.ts +58 -0
- package/dist/src/composables/SnackbarStack/snackbar-stack.composable.js +92 -0
- package/dist/src/composables/Textarea/textarea-rich.composable.cjs +263 -0
- package/dist/src/composables/Textarea/textarea-rich.composable.d.ts +41 -0
- package/dist/src/composables/Textarea/textarea-rich.composable.js +257 -0
- package/dist/src/composables/index.cjs +66 -0
- package/dist/src/composables/index.d.ts +6 -0
- package/dist/src/composables/index.js +6 -0
- package/dist/src/consts/Bracket/bracket.const.cjs +12 -0
- package/dist/src/consts/Bracket/bracket.const.d.ts +34 -0
- package/dist/src/consts/Bracket/bracket.const.js +15 -0
- package/dist/src/consts/Code/code.const.cjs +26 -0
- package/dist/src/consts/Code/code.const.d.ts +40 -0
- package/dist/src/consts/Code/code.const.js +35 -0
- package/dist/src/consts/CommandPalette/command-palette.const.cjs +10 -0
- package/dist/src/consts/CommandPalette/command-palette.const.d.ts +16 -0
- package/dist/src/consts/CommandPalette/command-palette.const.js +7 -0
- package/dist/src/consts/Mask/built-in-patterns.const.cjs +66 -0
- package/dist/src/consts/Mask/built-in-patterns.const.d.ts +20 -0
- package/dist/src/consts/Mask/built-in-patterns.const.js +60 -0
- package/dist/src/consts/Parallax/parallax-layer.const.cjs +7 -0
- package/dist/src/consts/Parallax/parallax-layer.const.d.ts +3 -0
- package/dist/src/consts/Parallax/parallax-layer.const.js +1 -0
- package/dist/src/consts/SnackbarStack/snackbar-stack.const.cjs +12 -0
- package/dist/src/consts/SnackbarStack/snackbar-stack.const.d.ts +33 -0
- package/dist/src/consts/SnackbarStack/snackbar-stack.const.js +18 -0
- package/dist/src/consts/Tabs/tabs.const.cjs +9 -0
- package/dist/src/consts/Tabs/tabs.const.d.ts +23 -0
- package/dist/src/consts/Tabs/tabs.const.js +3 -0
- package/dist/src/consts/Textarea/textarea.const.cjs +28 -0
- package/dist/src/consts/Textarea/textarea.const.d.ts +38 -0
- package/dist/src/consts/Textarea/textarea.const.js +65 -0
- package/dist/src/consts/Theme/theme.const.cjs +15 -0
- package/dist/src/consts/Theme/theme.const.d.ts +9 -0
- package/dist/src/consts/Theme/theme.const.js +9 -0
- package/dist/src/consts/index.cjs +99 -0
- package/dist/src/consts/index.d.ts +9 -0
- package/dist/src/consts/index.js +9 -0
- package/dist/src/enums/Bracket/bracket-match-status.enum.cjs +13 -0
- package/dist/src/enums/Bracket/bracket-match-status.enum.d.ts +6 -0
- package/dist/src/enums/Bracket/bracket-match-status.enum.js +7 -0
- package/dist/src/enums/Bracket/bracket-variant.enum.cjs +12 -0
- package/dist/src/enums/Bracket/bracket-variant.enum.d.ts +5 -0
- package/dist/src/enums/Bracket/bracket-variant.enum.js +6 -0
- package/dist/src/enums/Code/code-lang.enum.cjs +23 -0
- package/dist/src/enums/Code/code-lang.enum.d.ts +25 -0
- package/dist/src/enums/Code/code-lang.enum.js +17 -0
- package/dist/src/enums/Code/code-theme.enum.cjs +12 -0
- package/dist/src/enums/Code/code-theme.enum.d.ts +12 -0
- package/dist/src/enums/Code/code-theme.enum.js +6 -0
- package/dist/src/enums/Mask/mask.enum.cjs +28 -0
- package/dist/src/enums/Mask/mask.enum.d.ts +36 -0
- package/dist/src/enums/Mask/mask.enum.js +22 -0
- package/dist/src/enums/Parallax/parallax-direction.enum.cjs +12 -0
- package/dist/src/enums/Parallax/parallax-direction.enum.d.ts +5 -0
- package/dist/src/enums/Parallax/parallax-direction.enum.js +6 -0
- package/dist/src/enums/Parallax/parallax-easing.enum.cjs +12 -0
- package/dist/src/enums/Parallax/parallax-easing.enum.d.ts +5 -0
- package/dist/src/enums/Parallax/parallax-easing.enum.js +6 -0
- package/dist/src/enums/Tabs/tab-variant.enum.cjs +12 -0
- package/dist/src/enums/Tabs/tab-variant.enum.d.ts +5 -0
- package/dist/src/enums/Tabs/tab-variant.enum.js +6 -0
- package/dist/src/enums/Textarea/textarea-mode.enum.cjs +11 -0
- package/dist/src/enums/Textarea/textarea-mode.enum.d.ts +13 -0
- package/dist/src/enums/Textarea/textarea-mode.enum.js +5 -0
- package/dist/src/enums/Textarea/textarea-output.enum.cjs +11 -0
- package/dist/src/enums/Textarea/textarea-output.enum.d.ts +14 -0
- package/dist/src/enums/Textarea/textarea-output.enum.js +5 -0
- package/dist/src/enums/Textarea/textarea-toolbar-command.enum.cjs +21 -0
- package/dist/src/enums/Textarea/textarea-toolbar-command.enum.d.ts +20 -0
- package/dist/src/enums/Textarea/textarea-toolbar-command.enum.js +15 -0
- package/dist/src/enums/Textarea/textarea-toolbar-position.enum.cjs +12 -0
- package/dist/src/enums/Textarea/textarea-toolbar-position.enum.d.ts +10 -0
- package/dist/src/enums/Textarea/textarea-toolbar-position.enum.js +6 -0
- package/dist/src/enums/index.cjs +132 -0
- package/dist/src/enums/index.d.ts +12 -0
- package/dist/src/enums/index.js +12 -0
- package/dist/src/interfaces/Bracket/bracket-competitor-component.interface.cjs +1 -0
- package/dist/src/interfaces/Bracket/bracket-competitor-component.interface.d.ts +53 -0
- package/dist/src/interfaces/Bracket/bracket-competitor-component.interface.js +0 -0
- package/dist/src/interfaces/Bracket/bracket-competitor.interface.cjs +1 -0
- package/dist/src/interfaces/Bracket/bracket-competitor.interface.d.ts +25 -0
- package/dist/src/interfaces/Bracket/bracket-competitor.interface.js +0 -0
- package/dist/src/interfaces/Bracket/bracket-match-component.interface.cjs +1 -0
- package/dist/src/interfaces/Bracket/bracket-match-component.interface.d.ts +45 -0
- package/dist/src/interfaces/Bracket/bracket-match-component.interface.js +0 -0
- package/dist/src/interfaces/Bracket/bracket-match.interface.cjs +1 -0
- package/dist/src/interfaces/Bracket/bracket-match.interface.d.ts +51 -0
- package/dist/src/interfaces/Bracket/bracket-match.interface.js +0 -0
- package/dist/src/interfaces/Bracket/bracket-round-component.interface.cjs +1 -0
- package/dist/src/interfaces/Bracket/bracket-round-component.interface.d.ts +26 -0
- package/dist/src/interfaces/Bracket/bracket-round-component.interface.js +0 -0
- package/dist/src/interfaces/Bracket/bracket-round.interface.cjs +1 -0
- package/dist/src/interfaces/Bracket/bracket-round.interface.d.ts +27 -0
- package/dist/src/interfaces/Bracket/bracket-round.interface.js +0 -0
- package/dist/src/interfaces/Bracket/bracket.interface.cjs +1 -0
- package/dist/src/interfaces/Bracket/bracket.interface.d.ts +71 -0
- package/dist/src/interfaces/Bracket/bracket.interface.js +0 -0
- package/dist/src/interfaces/Code/code.interface.cjs +1 -0
- package/dist/src/interfaces/Code/code.interface.d.ts +99 -0
- package/dist/src/interfaces/Code/code.interface.js +0 -0
- package/dist/src/interfaces/CommandPalette/command-palette.interface.cjs +1 -0
- package/dist/src/interfaces/CommandPalette/command-palette.interface.d.ts +57 -0
- package/dist/src/interfaces/CommandPalette/command-palette.interface.js +0 -0
- package/dist/src/interfaces/CommandPalette/command.interface.cjs +1 -0
- package/dist/src/interfaces/CommandPalette/command.interface.d.ts +51 -0
- package/dist/src/interfaces/CommandPalette/command.interface.js +0 -0
- package/dist/src/interfaces/Mask/mask-options.interface.cjs +1 -0
- package/dist/src/interfaces/Mask/mask-options.interface.d.ts +48 -0
- package/dist/src/interfaces/Mask/mask-options.interface.js +0 -0
- package/dist/src/interfaces/Nuxt/nuxt-module.interface.cjs +1 -0
- package/dist/src/interfaces/Nuxt/nuxt-module.interface.d.ts +73 -0
- package/dist/src/interfaces/Nuxt/nuxt-module.interface.js +0 -0
- package/dist/src/interfaces/Parallax/parallax-layer.interface.cjs +1 -0
- package/dist/src/interfaces/Parallax/parallax-layer.interface.d.ts +39 -0
- package/dist/src/interfaces/Parallax/parallax-layer.interface.js +0 -0
- package/dist/src/interfaces/Parallax/parallax.interface.d.ts +83 -3
- package/dist/src/interfaces/SnackbarStack/snackbar-stack-item.interface.cjs +1 -0
- package/dist/src/interfaces/SnackbarStack/snackbar-stack-item.interface.d.ts +60 -0
- package/dist/src/interfaces/SnackbarStack/snackbar-stack-item.interface.js +0 -0
- package/dist/src/interfaces/SnackbarStack/snackbar-stack.interface.cjs +1 -0
- package/dist/src/interfaces/SnackbarStack/snackbar-stack.interface.d.ts +60 -0
- package/dist/src/interfaces/SnackbarStack/snackbar-stack.interface.js +0 -0
- package/dist/src/interfaces/Tabs/tab-panel.interface.cjs +1 -0
- package/dist/src/interfaces/Tabs/tab-panel.interface.d.ts +12 -0
- package/dist/src/interfaces/Tabs/tab-panel.interface.js +0 -0
- package/dist/src/interfaces/Tabs/tab-panels.interface.cjs +1 -0
- package/dist/src/interfaces/Tabs/tab-panels.interface.d.ts +28 -0
- package/dist/src/interfaces/Tabs/tab-panels.interface.js +0 -0
- package/dist/src/interfaces/Tabs/tab.interface.cjs +1 -0
- package/dist/src/interfaces/Tabs/tab.interface.d.ts +18 -0
- package/dist/src/interfaces/Tabs/tab.interface.js +0 -0
- package/dist/src/interfaces/Tabs/tabs.interface.cjs +1 -0
- package/dist/src/interfaces/Tabs/tabs.interface.d.ts +26 -0
- package/dist/src/interfaces/Tabs/tabs.interface.js +0 -0
- package/dist/src/interfaces/TextField/text-field.interface.d.ts +21 -1
- package/dist/src/interfaces/Textarea/textarea-rich.interface.cjs +1 -0
- package/dist/src/interfaces/Textarea/textarea-rich.interface.d.ts +41 -0
- package/dist/src/interfaces/Textarea/textarea-rich.interface.js +0 -0
- package/dist/src/interfaces/Textarea/textarea-toolbar.interface.cjs +1 -0
- package/dist/src/interfaces/Textarea/textarea-toolbar.interface.d.ts +31 -0
- package/dist/src/interfaces/Textarea/textarea-toolbar.interface.js +0 -0
- package/dist/src/interfaces/TextareaField/textarea-field.interface.d.ts +38 -1
- package/dist/src/interfaces/index.cjs +231 -0
- package/dist/src/interfaces/index.d.ts +21 -0
- package/dist/src/interfaces/index.js +21 -0
- package/dist/src/nuxt/index.cjs +13 -0
- package/dist/src/nuxt/index.d.ts +2 -0
- package/dist/src/nuxt/index.js +1 -0
- package/dist/src/nuxt/module.cjs +74 -0
- package/dist/src/nuxt/module.d.ts +31 -0
- package/dist/src/nuxt/module.js +68 -0
- package/dist/src/nuxt/plugin.client.cjs +44 -0
- package/dist/src/nuxt/plugin.client.d.ts +2 -0
- package/dist/src/nuxt/plugin.client.js +36 -0
- package/dist/src/nuxt/plugin.server.cjs +51 -0
- package/dist/src/nuxt/plugin.server.d.ts +2 -0
- package/dist/src/nuxt/plugin.server.js +45 -0
- package/dist/src/types/Bracket/bracket-direction.type.cjs +1 -0
- package/dist/src/types/Bracket/bracket-direction.type.d.ts +13 -0
- package/dist/src/types/Bracket/bracket-direction.type.js +0 -0
- package/dist/src/types/Bracket/bracket-match-status.type.cjs +1 -0
- package/dist/src/types/Bracket/bracket-match-status.type.d.ts +2 -0
- package/dist/src/types/Bracket/bracket-match-status.type.js +0 -0
- package/dist/src/types/Bracket/bracket-round-side.type.cjs +1 -0
- package/dist/src/types/Bracket/bracket-round-side.type.d.ts +12 -0
- package/dist/src/types/Bracket/bracket-round-side.type.js +0 -0
- package/dist/src/types/Bracket/bracket-variant.type.cjs +1 -0
- package/dist/src/types/Bracket/bracket-variant.type.d.ts +2 -0
- package/dist/src/types/Bracket/bracket-variant.type.js +0 -0
- package/dist/src/types/Code/code-lang.type.cjs +1 -0
- package/dist/src/types/Code/code-lang.type.d.ts +2 -0
- package/dist/src/types/Code/code-lang.type.js +0 -0
- package/dist/src/types/Code/code-theme.type.cjs +1 -0
- package/dist/src/types/Code/code-theme.type.d.ts +2 -0
- package/dist/src/types/Code/code-theme.type.js +0 -0
- package/dist/src/types/CommandPalette/command-palette-hotkey.type.cjs +1 -0
- package/dist/src/types/CommandPalette/command-palette-hotkey.type.d.ts +5 -0
- package/dist/src/types/CommandPalette/command-palette-hotkey.type.js +0 -0
- package/dist/src/types/Mask/built-in-pattern.type.cjs +1 -0
- package/dist/src/types/Mask/built-in-pattern.type.d.ts +7 -0
- package/dist/src/types/Mask/built-in-pattern.type.js +0 -0
- package/dist/src/types/Mask/mask.type.cjs +1 -0
- package/dist/src/types/Mask/mask.type.d.ts +19 -0
- package/dist/src/types/Mask/mask.type.js +0 -0
- package/dist/src/types/Mask/pattern-validator.type.cjs +1 -0
- package/dist/src/types/Mask/pattern-validator.type.d.ts +16 -0
- package/dist/src/types/Mask/pattern-validator.type.js +0 -0
- package/dist/src/types/Parallax/parallax-direction.type.cjs +1 -0
- package/dist/src/types/Parallax/parallax-direction.type.d.ts +2 -0
- package/dist/src/types/Parallax/parallax-direction.type.js +0 -0
- package/dist/src/types/Parallax/parallax-easing.type.cjs +1 -0
- package/dist/src/types/Parallax/parallax-easing.type.d.ts +2 -0
- package/dist/src/types/Parallax/parallax-easing.type.js +0 -0
- package/dist/src/types/SnackbarStack/snackbar-stack-direction.type.cjs +1 -0
- package/dist/src/types/SnackbarStack/snackbar-stack-direction.type.d.ts +11 -0
- package/dist/src/types/SnackbarStack/snackbar-stack-direction.type.js +0 -0
- package/dist/src/types/SnackbarStack/snackbar-stack-location.type.cjs +1 -0
- package/dist/src/types/SnackbarStack/snackbar-stack-location.type.d.ts +9 -0
- package/dist/src/types/SnackbarStack/snackbar-stack-location.type.js +0 -0
- package/dist/src/types/SnackbarStack/snackbar-stack.type.cjs +1 -0
- package/dist/src/types/SnackbarStack/snackbar-stack.type.d.ts +2 -0
- package/dist/src/types/SnackbarStack/snackbar-stack.type.js +0 -0
- package/dist/src/types/Tabs/tab-panel.type.cjs +1 -0
- package/dist/src/types/Tabs/tab-panel.type.d.ts +2 -0
- package/dist/src/types/Tabs/tab-panel.type.js +0 -0
- package/dist/src/types/Tabs/tab-panels.type.cjs +1 -0
- package/dist/src/types/Tabs/tab-panels.type.d.ts +2 -0
- package/dist/src/types/Tabs/tab-panels.type.js +0 -0
- package/dist/src/types/Tabs/tab-variant.type.cjs +1 -0
- package/dist/src/types/Tabs/tab-variant.type.d.ts +2 -0
- package/dist/src/types/Tabs/tab-variant.type.js +0 -0
- package/dist/src/types/Tabs/tab.type.cjs +1 -0
- package/dist/src/types/Tabs/tab.type.d.ts +2 -0
- package/dist/src/types/Tabs/tab.type.js +0 -0
- package/dist/src/types/Tabs/tabs.type.cjs +1 -0
- package/dist/src/types/Tabs/tabs.type.d.ts +2 -0
- package/dist/src/types/Tabs/tabs.type.js +0 -0
- package/dist/src/types/Textarea/textarea-mode.type.cjs +1 -0
- package/dist/src/types/Textarea/textarea-mode.type.d.ts +2 -0
- package/dist/src/types/Textarea/textarea-mode.type.js +0 -0
- package/dist/src/types/Textarea/textarea-output.type.cjs +1 -0
- package/dist/src/types/Textarea/textarea-output.type.d.ts +2 -0
- package/dist/src/types/Textarea/textarea-output.type.js +0 -0
- package/dist/src/types/Textarea/textarea-toolbar-command.type.cjs +1 -0
- package/dist/src/types/Textarea/textarea-toolbar-command.type.d.ts +2 -0
- package/dist/src/types/Textarea/textarea-toolbar-command.type.js +0 -0
- package/dist/src/types/Textarea/textarea-toolbar-position.type.cjs +1 -0
- package/dist/src/types/Textarea/textarea-toolbar-position.type.d.ts +2 -0
- package/dist/src/types/Textarea/textarea-toolbar-position.type.js +0 -0
- package/dist/src/types/index.cjs +264 -0
- package/dist/src/types/index.d.ts +24 -0
- package/dist/src/types/index.js +24 -0
- package/dist/src/types/tokens.type.d.ts +1 -1
- package/dist/src/utils/Code/parse-highlight-lines.util.cjs +34 -0
- package/dist/src/utils/Code/parse-highlight-lines.util.d.ts +24 -0
- package/dist/src/utils/Code/parse-highlight-lines.util.js +28 -0
- package/dist/src/utils/CommandPalette/fuzzy-match.util.cjs +84 -0
- package/dist/src/utils/CommandPalette/fuzzy-match.util.d.ts +51 -0
- package/dist/src/utils/CommandPalette/fuzzy-match.util.js +62 -0
- package/dist/src/utils/Mask/apply-mask.util.cjs +120 -0
- package/dist/src/utils/Mask/apply-mask.util.d.ts +13 -0
- package/dist/src/utils/Mask/apply-mask.util.js +91 -0
- package/dist/src/utils/Mask/index.cjs +38 -0
- package/dist/src/utils/Mask/index.d.ts +3 -0
- package/dist/src/utils/Mask/index.js +3 -0
- package/dist/src/utils/Mask/resolve-mask-config.util.cjs +31 -0
- package/dist/src/utils/Mask/resolve-mask-config.util.d.ts +15 -0
- package/dist/src/utils/Mask/resolve-mask-config.util.js +21 -0
- package/dist/src/utils/Mask/validate-pattern.util.cjs +92 -0
- package/dist/src/utils/Mask/validate-pattern.util.d.ts +41 -0
- package/dist/src/utils/Mask/validate-pattern.util.js +81 -0
- package/dist/src/utils/Textarea/html-to-markdown.util.cjs +85 -0
- package/dist/src/utils/Textarea/html-to-markdown.util.d.ts +21 -0
- package/dist/src/utils/Textarea/html-to-markdown.util.js +78 -0
- package/dist/src/utils/Textarea/sanitize-html.util.cjs +82 -0
- package/dist/src/utils/Textarea/sanitize-html.util.d.ts +17 -0
- package/dist/src/utils/Textarea/sanitize-html.util.js +83 -0
- package/dist/src/utils/index.cjs +77 -0
- package/dist/src/utils/index.d.ts +7 -0
- package/dist/src/utils/index.js +7 -0
- package/package.json +13 -3
- package/dist/src/globals.d.ts +0 -172
- package/dist/src/shims.d.ts +0 -36
- package/dist/src/vite-env.d.ts +0 -1
|
@@ -4,6 +4,7 @@ export * from './App';
|
|
|
4
4
|
export * from './Avatar';
|
|
5
5
|
export * from './Badge';
|
|
6
6
|
export * from './BottomNav';
|
|
7
|
+
export * from './Bracket';
|
|
7
8
|
export * from './Breadcrumb';
|
|
8
9
|
export * from './Btn';
|
|
9
10
|
export * from './ItemGroup';
|
|
@@ -11,8 +12,11 @@ export * from './Card';
|
|
|
11
12
|
export * from './Carousel';
|
|
12
13
|
export * from './Checkbox';
|
|
13
14
|
export * from './Chip';
|
|
15
|
+
export * from './ClientOnly';
|
|
16
|
+
export * from './Code';
|
|
14
17
|
export * from './ColorPicker';
|
|
15
18
|
export * from './ColorPickerField';
|
|
19
|
+
export * from './CommandPalette';
|
|
16
20
|
export * from './ConfirmWrapper';
|
|
17
21
|
export * from './ContextualMenu';
|
|
18
22
|
export * from './Counter';
|
|
@@ -59,9 +63,11 @@ export * from './Sheet';
|
|
|
59
63
|
export * from './Slide';
|
|
60
64
|
export * from './SliderField';
|
|
61
65
|
export * from './Snackbar';
|
|
66
|
+
export * from './SnackbarStack';
|
|
62
67
|
export * from './Switch';
|
|
63
68
|
export * from './SystemBar';
|
|
64
69
|
export * from './Table';
|
|
70
|
+
export * from './Tabs';
|
|
65
71
|
export * from './TextareaField';
|
|
66
72
|
export * from './TextField';
|
|
67
73
|
export * from './ThemeProvider';
|
|
@@ -4,6 +4,7 @@ export * from "./App/index.js";
|
|
|
4
4
|
export * from "./Avatar/index.js";
|
|
5
5
|
export * from "./Badge/index.js";
|
|
6
6
|
export * from "./BottomNav/index.js";
|
|
7
|
+
export * from "./Bracket/index.js";
|
|
7
8
|
export * from "./Breadcrumb/index.js";
|
|
8
9
|
export * from "./Btn/index.js";
|
|
9
10
|
export * from "./ItemGroup/index.js";
|
|
@@ -11,8 +12,11 @@ export * from "./Card/index.js";
|
|
|
11
12
|
export * from "./Carousel/index.js";
|
|
12
13
|
export * from "./Checkbox/index.js";
|
|
13
14
|
export * from "./Chip/index.js";
|
|
15
|
+
export * from "./ClientOnly/index.js";
|
|
16
|
+
export * from "./Code/index.js";
|
|
14
17
|
export * from "./ColorPicker/index.js";
|
|
15
18
|
export * from "./ColorPickerField/index.js";
|
|
19
|
+
export * from "./CommandPalette/index.js";
|
|
16
20
|
export * from "./ConfirmWrapper/index.js";
|
|
17
21
|
export * from "./ContextualMenu/index.js";
|
|
18
22
|
export * from "./Counter/index.js";
|
|
@@ -59,9 +63,11 @@ export * from "./Sheet/index.js";
|
|
|
59
63
|
export * from "./Slide/index.js";
|
|
60
64
|
export * from "./SliderField/index.js";
|
|
61
65
|
export * from "./Snackbar/index.js";
|
|
66
|
+
export * from "./SnackbarStack/index.js";
|
|
62
67
|
export * from "./Switch/index.js";
|
|
63
68
|
export * from "./SystemBar/index.js";
|
|
64
69
|
export * from "./Table/index.js";
|
|
70
|
+
export * from "./Tabs/index.js";
|
|
65
71
|
export * from "./TextareaField/index.js";
|
|
66
72
|
export * from "./TextField/index.js";
|
|
67
73
|
export * from "./ThemeProvider/index.js";
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.resetCodeHighlighterForTesting = resetCodeHighlighterForTesting;
|
|
7
|
+
exports.useCode = useCode;
|
|
8
|
+
var _consts = require("../../consts/index.cjs");
|
|
9
|
+
var _enums = require("../../enums/index.cjs");
|
|
10
|
+
let _highlighterPromise = null;
|
|
11
|
+
let _highlighterReady = false;
|
|
12
|
+
const _cache = /* @__PURE__ */new Map();
|
|
13
|
+
let _unsupportedLangWarned = /* @__PURE__ */new Set();
|
|
14
|
+
function makeCacheKey(code, lang, theme) {
|
|
15
|
+
return `${theme}::${lang}::${code}`;
|
|
16
|
+
}
|
|
17
|
+
function lruGet(key) {
|
|
18
|
+
const hit = _cache.get(key);
|
|
19
|
+
if (hit === void 0) return void 0;
|
|
20
|
+
_cache.delete(key);
|
|
21
|
+
_cache.set(key, hit);
|
|
22
|
+
return hit;
|
|
23
|
+
}
|
|
24
|
+
function lruSet(key, value) {
|
|
25
|
+
if (_cache.size >= _consts.CODE_CACHE_MAX_ENTRIES) {
|
|
26
|
+
const oldest = _cache.keys().next().value;
|
|
27
|
+
if (oldest !== void 0) _cache.delete(oldest);
|
|
28
|
+
}
|
|
29
|
+
_cache.set(key, value);
|
|
30
|
+
}
|
|
31
|
+
async function loadHighlighter() {
|
|
32
|
+
if (_highlighterPromise) return _highlighterPromise;
|
|
33
|
+
_highlighterPromise = (async () => {
|
|
34
|
+
const shiki = await Promise.resolve().then(() => require("shiki"));
|
|
35
|
+
const highlighter = await shiki.createHighlighter({
|
|
36
|
+
themes: [_consts.CODE_SHIKI_THEMES.light, _consts.CODE_SHIKI_THEMES.dark],
|
|
37
|
+
langs: [..._consts.SUPPORTED_LANGS]
|
|
38
|
+
});
|
|
39
|
+
_highlighterReady = true;
|
|
40
|
+
return highlighter;
|
|
41
|
+
})();
|
|
42
|
+
return _highlighterPromise;
|
|
43
|
+
}
|
|
44
|
+
function resolveLang(lang) {
|
|
45
|
+
if (_consts.SUPPORTED_LANGS.includes(lang)) return lang;
|
|
46
|
+
if (!_unsupportedLangWarned.has(lang)) {
|
|
47
|
+
_unsupportedLangWarned.add(lang);
|
|
48
|
+
console.warn(`[origam] OrigamCode: lang="${lang}" is not in the bundled grammar set. Falling back to "${_enums.CODE_LANG.PLAINTEXT}". Supported: ${_consts.SUPPORTED_LANGS.join(", ")}.`);
|
|
49
|
+
}
|
|
50
|
+
return _enums.CODE_LANG.PLAINTEXT;
|
|
51
|
+
}
|
|
52
|
+
function useCode() {
|
|
53
|
+
async function highlight(code, lang, themeName) {
|
|
54
|
+
const resolvedLang = resolveLang(lang);
|
|
55
|
+
const shikiTheme = themeName === "dark" ? _consts.CODE_SHIKI_THEMES.dark : _consts.CODE_SHIKI_THEMES.light;
|
|
56
|
+
const key = makeCacheKey(code, resolvedLang, shikiTheme);
|
|
57
|
+
const cached = lruGet(key);
|
|
58
|
+
if (cached !== void 0) return cached;
|
|
59
|
+
const highlighter = await loadHighlighter();
|
|
60
|
+
let html;
|
|
61
|
+
try {
|
|
62
|
+
html = highlighter.codeToHtml(code, {
|
|
63
|
+
lang: resolvedLang,
|
|
64
|
+
theme: shikiTheme
|
|
65
|
+
});
|
|
66
|
+
} catch (err) {
|
|
67
|
+
console.warn("[origam] OrigamCode: shiki failed to tokenise, falling back to plaintext.", err);
|
|
68
|
+
html = highlighter.codeToHtml(code, {
|
|
69
|
+
lang: _enums.CODE_LANG.PLAINTEXT,
|
|
70
|
+
theme: shikiTheme
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
lruSet(key, html);
|
|
74
|
+
return html;
|
|
75
|
+
}
|
|
76
|
+
async function prime() {
|
|
77
|
+
await loadHighlighter();
|
|
78
|
+
}
|
|
79
|
+
function isReady() {
|
|
80
|
+
return _highlighterReady;
|
|
81
|
+
}
|
|
82
|
+
function resetCacheForTesting() {
|
|
83
|
+
_cache.clear();
|
|
84
|
+
_unsupportedLangWarned = /* @__PURE__ */new Set();
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
highlight,
|
|
88
|
+
prime,
|
|
89
|
+
isReady,
|
|
90
|
+
resetCacheForTesting
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function resetCodeHighlighterForTesting() {
|
|
94
|
+
_highlighterPromise = null;
|
|
95
|
+
_highlighterReady = false;
|
|
96
|
+
_cache.clear();
|
|
97
|
+
_unsupportedLangWarned = /* @__PURE__ */new Set();
|
|
98
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IUseCodeReturn } from '../../interfaces';
|
|
2
|
+
/**
|
|
3
|
+
* Public hook — see `IUseCodeReturn` for the surface contract.
|
|
4
|
+
*/
|
|
5
|
+
export declare function useCode(): IUseCodeReturn;
|
|
6
|
+
/**
|
|
7
|
+
* Test-only: drop the singleton so a fresh dynamic import runs next call.
|
|
8
|
+
* Production code should never need this.
|
|
9
|
+
*/
|
|
10
|
+
export declare function resetCodeHighlighterForTesting(): void;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { CODE_CACHE_MAX_ENTRIES, CODE_SHIKI_THEMES, SUPPORTED_LANGS } from "../../consts/index.js";
|
|
2
|
+
import { CODE_LANG } from "../../enums/index.js";
|
|
3
|
+
let _highlighterPromise = null;
|
|
4
|
+
let _highlighterReady = false;
|
|
5
|
+
const _cache = /* @__PURE__ */ new Map();
|
|
6
|
+
let _unsupportedLangWarned = /* @__PURE__ */ new Set();
|
|
7
|
+
function makeCacheKey(code, lang, theme) {
|
|
8
|
+
return `${theme}::${lang}::${code}`;
|
|
9
|
+
}
|
|
10
|
+
function lruGet(key) {
|
|
11
|
+
const hit = _cache.get(key);
|
|
12
|
+
if (hit === void 0) return void 0;
|
|
13
|
+
_cache.delete(key);
|
|
14
|
+
_cache.set(key, hit);
|
|
15
|
+
return hit;
|
|
16
|
+
}
|
|
17
|
+
function lruSet(key, value) {
|
|
18
|
+
if (_cache.size >= CODE_CACHE_MAX_ENTRIES) {
|
|
19
|
+
const oldest = _cache.keys().next().value;
|
|
20
|
+
if (oldest !== void 0) _cache.delete(oldest);
|
|
21
|
+
}
|
|
22
|
+
_cache.set(key, value);
|
|
23
|
+
}
|
|
24
|
+
async function loadHighlighter() {
|
|
25
|
+
if (_highlighterPromise) return _highlighterPromise;
|
|
26
|
+
_highlighterPromise = (async () => {
|
|
27
|
+
const shiki = await import("shiki");
|
|
28
|
+
const highlighter = await shiki.createHighlighter({
|
|
29
|
+
themes: [CODE_SHIKI_THEMES.light, CODE_SHIKI_THEMES.dark],
|
|
30
|
+
langs: [...SUPPORTED_LANGS]
|
|
31
|
+
});
|
|
32
|
+
_highlighterReady = true;
|
|
33
|
+
return highlighter;
|
|
34
|
+
})();
|
|
35
|
+
return _highlighterPromise;
|
|
36
|
+
}
|
|
37
|
+
function resolveLang(lang) {
|
|
38
|
+
if (SUPPORTED_LANGS.includes(lang)) return lang;
|
|
39
|
+
if (!_unsupportedLangWarned.has(lang)) {
|
|
40
|
+
_unsupportedLangWarned.add(lang);
|
|
41
|
+
console.warn(
|
|
42
|
+
`[origam] OrigamCode: lang="${lang}" is not in the bundled grammar set. Falling back to "${CODE_LANG.PLAINTEXT}". Supported: ${SUPPORTED_LANGS.join(", ")}.`
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
return CODE_LANG.PLAINTEXT;
|
|
46
|
+
}
|
|
47
|
+
export function useCode() {
|
|
48
|
+
async function highlight(code, lang, themeName) {
|
|
49
|
+
const resolvedLang = resolveLang(lang);
|
|
50
|
+
const shikiTheme = themeName === "dark" ? CODE_SHIKI_THEMES.dark : CODE_SHIKI_THEMES.light;
|
|
51
|
+
const key = makeCacheKey(code, resolvedLang, shikiTheme);
|
|
52
|
+
const cached = lruGet(key);
|
|
53
|
+
if (cached !== void 0) return cached;
|
|
54
|
+
const highlighter = await loadHighlighter();
|
|
55
|
+
let html;
|
|
56
|
+
try {
|
|
57
|
+
html = highlighter.codeToHtml(code, { lang: resolvedLang, theme: shikiTheme });
|
|
58
|
+
} catch (err) {
|
|
59
|
+
console.warn("[origam] OrigamCode: shiki failed to tokenise, falling back to plaintext.", err);
|
|
60
|
+
html = highlighter.codeToHtml(code, { lang: CODE_LANG.PLAINTEXT, theme: shikiTheme });
|
|
61
|
+
}
|
|
62
|
+
lruSet(key, html);
|
|
63
|
+
return html;
|
|
64
|
+
}
|
|
65
|
+
async function prime() {
|
|
66
|
+
await loadHighlighter();
|
|
67
|
+
}
|
|
68
|
+
function isReady() {
|
|
69
|
+
return _highlighterReady;
|
|
70
|
+
}
|
|
71
|
+
function resetCacheForTesting() {
|
|
72
|
+
_cache.clear();
|
|
73
|
+
_unsupportedLangWarned = /* @__PURE__ */ new Set();
|
|
74
|
+
}
|
|
75
|
+
return { highlight, prime, isReady, resetCacheForTesting };
|
|
76
|
+
}
|
|
77
|
+
export function resetCodeHighlighterForTesting() {
|
|
78
|
+
_highlighterPromise = null;
|
|
79
|
+
_highlighterReady = false;
|
|
80
|
+
_cache.clear();
|
|
81
|
+
_unsupportedLangWarned = /* @__PURE__ */ new Set();
|
|
82
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.resetCommandRegistryForTesting = resetCommandRegistryForTesting;
|
|
7
|
+
exports.useCommand = useCommand;
|
|
8
|
+
var _vue = require("vue");
|
|
9
|
+
var _utils = require("../../utils/index.cjs");
|
|
10
|
+
const REGISTRY = {
|
|
11
|
+
items: (0, _vue.ref)([]),
|
|
12
|
+
isOpen: (0, _vue.ref)(false)
|
|
13
|
+
};
|
|
14
|
+
const upsert = cmd => {
|
|
15
|
+
const idx = REGISTRY.items.value.findIndex(item => item.id === cmd.id);
|
|
16
|
+
if (idx === -1) {
|
|
17
|
+
REGISTRY.items.value.push(cmd);
|
|
18
|
+
} else {
|
|
19
|
+
REGISTRY.items.value.splice(idx, 1, cmd);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const removeById = id => {
|
|
23
|
+
const idx = REGISTRY.items.value.findIndex(item => item.id === id);
|
|
24
|
+
if (idx !== -1) REGISTRY.items.value.splice(idx, 1);
|
|
25
|
+
};
|
|
26
|
+
function useCommand() {
|
|
27
|
+
const register = cmd => {
|
|
28
|
+
upsert(cmd);
|
|
29
|
+
const dispose = () => removeById(cmd.id);
|
|
30
|
+
(0, _utils.tryOnScopeDispose)(dispose);
|
|
31
|
+
return dispose;
|
|
32
|
+
};
|
|
33
|
+
const unregister = id => removeById(id);
|
|
34
|
+
const commands = (0, _vue.computed)(() => REGISTRY.items.value);
|
|
35
|
+
const open = () => {
|
|
36
|
+
REGISTRY.isOpen.value = true;
|
|
37
|
+
};
|
|
38
|
+
const close = () => {
|
|
39
|
+
REGISTRY.isOpen.value = false;
|
|
40
|
+
};
|
|
41
|
+
return {
|
|
42
|
+
register,
|
|
43
|
+
unregister,
|
|
44
|
+
commands,
|
|
45
|
+
open,
|
|
46
|
+
close,
|
|
47
|
+
isOpen: REGISTRY.isOpen
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function resetCommandRegistryForTesting() {
|
|
51
|
+
REGISTRY.items.value = [];
|
|
52
|
+
REGISTRY.isOpen.value = false;
|
|
53
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ComputedRef, type Ref } from 'vue';
|
|
2
|
+
import type { ICommand } from '../../interfaces';
|
|
3
|
+
/*********************************************************
|
|
4
|
+
* useCommand
|
|
5
|
+
********************************************************/
|
|
6
|
+
export interface IUseCommandReturn {
|
|
7
|
+
/**
|
|
8
|
+
* Register a command. Returns an `unregister()` closure so callers
|
|
9
|
+
* can drop the entry imperatively. When called from inside a Vue
|
|
10
|
+
* effect scope, the entry is auto-unregistered on scope dispose
|
|
11
|
+
* (component unmount, route leave, …) via `tryOnScopeDispose`.
|
|
12
|
+
*/
|
|
13
|
+
register: (cmd: ICommand) => () => void;
|
|
14
|
+
/** Drop the entry with the matching `id`. No-op if unknown. */
|
|
15
|
+
unregister: (id: string) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Reactive read-only view of every registered command, deduplicated
|
|
18
|
+
* by id.
|
|
19
|
+
*/
|
|
20
|
+
commands: ComputedRef<ReadonlyArray<ICommand>>;
|
|
21
|
+
/** Open the global palette singleton. */
|
|
22
|
+
open: () => void;
|
|
23
|
+
/** Close the global palette singleton. */
|
|
24
|
+
close: () => void;
|
|
25
|
+
/** Reactive open/close state of the global palette singleton. */
|
|
26
|
+
isOpen: Ref<boolean>;
|
|
27
|
+
}
|
|
28
|
+
export declare function useCommand(): IUseCommandReturn;
|
|
29
|
+
/*********************************************************
|
|
30
|
+
* Test helper
|
|
31
|
+
*
|
|
32
|
+
* @description
|
|
33
|
+
* Vitest needs to wipe the singleton between specs so the registry
|
|
34
|
+
* does not leak between cases. Not part of the public surface — do
|
|
35
|
+
* not import in product code.
|
|
36
|
+
********************************************************/
|
|
37
|
+
export declare function resetCommandRegistryForTesting(): void;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { computed, ref } from "vue";
|
|
2
|
+
import { tryOnScopeDispose } from "../../utils/index.js";
|
|
3
|
+
const REGISTRY = {
|
|
4
|
+
items: ref([]),
|
|
5
|
+
isOpen: ref(false)
|
|
6
|
+
};
|
|
7
|
+
const upsert = (cmd) => {
|
|
8
|
+
const idx = REGISTRY.items.value.findIndex((item) => item.id === cmd.id);
|
|
9
|
+
if (idx === -1) {
|
|
10
|
+
REGISTRY.items.value.push(cmd);
|
|
11
|
+
} else {
|
|
12
|
+
REGISTRY.items.value.splice(idx, 1, cmd);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const removeById = (id) => {
|
|
16
|
+
const idx = REGISTRY.items.value.findIndex((item) => item.id === id);
|
|
17
|
+
if (idx !== -1) REGISTRY.items.value.splice(idx, 1);
|
|
18
|
+
};
|
|
19
|
+
export function useCommand() {
|
|
20
|
+
const register = (cmd) => {
|
|
21
|
+
upsert(cmd);
|
|
22
|
+
const dispose = () => removeById(cmd.id);
|
|
23
|
+
tryOnScopeDispose(dispose);
|
|
24
|
+
return dispose;
|
|
25
|
+
};
|
|
26
|
+
const unregister = (id) => removeById(id);
|
|
27
|
+
const commands = computed(() => REGISTRY.items.value);
|
|
28
|
+
const open = () => {
|
|
29
|
+
REGISTRY.isOpen.value = true;
|
|
30
|
+
};
|
|
31
|
+
const close = () => {
|
|
32
|
+
REGISTRY.isOpen.value = false;
|
|
33
|
+
};
|
|
34
|
+
return {
|
|
35
|
+
register,
|
|
36
|
+
unregister,
|
|
37
|
+
commands,
|
|
38
|
+
open,
|
|
39
|
+
close,
|
|
40
|
+
isOpen: REGISTRY.isOpen
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export function resetCommandRegistryForTesting() {
|
|
44
|
+
REGISTRY.items.value = [];
|
|
45
|
+
REGISTRY.isOpen.value = false;
|
|
46
|
+
}
|
|
@@ -30,6 +30,7 @@ function useVirtual(props, items) {
|
|
|
30
30
|
resizeRef.value = containerRef.value;
|
|
31
31
|
});
|
|
32
32
|
const viewportHeight = (0, _vue.computed)(() => {
|
|
33
|
+
if (!_consts.IN_BROWSER) return (0, _utils.int)(props.height) || 0;
|
|
33
34
|
return containerRef.value === document.documentElement ? display.height.value : contentRect.value?.height || (0, _utils.int)(props.height) || 0;
|
|
34
35
|
});
|
|
35
36
|
const hasInitialRender = (0, _vue.computed)(() => {
|
|
@@ -21,6 +21,7 @@ export function useVirtual(props, items) {
|
|
|
21
21
|
resizeRef.value = containerRef.value;
|
|
22
22
|
});
|
|
23
23
|
const viewportHeight = computed(() => {
|
|
24
|
+
if (!IN_BROWSER) return int(props.height) || 0;
|
|
24
25
|
return containerRef.value === document.documentElement ? display.height.value : contentRect.value?.height || int(props.height) || 0;
|
|
25
26
|
});
|
|
26
27
|
const hasInitialRender = computed(() => {
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports._resetCssSupportCache = _resetCssSupportCache;
|
|
7
7
|
exports.useCssSupport = useCssSupport;
|
|
8
|
+
exports.useCssSupportClient = useCssSupportClient;
|
|
8
9
|
var _vue = require("vue");
|
|
9
10
|
const _cache = /* @__PURE__ */new Map();
|
|
10
11
|
let _initialized = false;
|
|
@@ -97,4 +98,15 @@ function _resetCssSupportCache() {
|
|
|
97
98
|
_cache.clear();
|
|
98
99
|
_initialized = false;
|
|
99
100
|
_flags.value = emptyMap();
|
|
101
|
+
}
|
|
102
|
+
function useCssSupportClient(feature, options = {}) {
|
|
103
|
+
const {
|
|
104
|
+
defaultValue = false
|
|
105
|
+
} = options;
|
|
106
|
+
const flag = (0, _vue.ref)(defaultValue);
|
|
107
|
+
(0, _vue.onMounted)(() => {
|
|
108
|
+
const query = FEATURE_QUERIES[feature] ?? feature;
|
|
109
|
+
flag.value = rawSupports(query);
|
|
110
|
+
});
|
|
111
|
+
return flag;
|
|
100
112
|
}
|
|
@@ -67,4 +67,29 @@ export declare function useCssSupport(): IUseCssSupport;
|
|
|
67
67
|
* _resetCssSupportCache
|
|
68
68
|
********************************************************/
|
|
69
69
|
export declare function _resetCssSupportCache(): void;
|
|
70
|
+
export interface IUseCssSupportClientOptions {
|
|
71
|
+
/**
|
|
72
|
+
* Value returned during SSR and on the first client render (before
|
|
73
|
+
* `onMounted` fires). Pick the side of the branch that produces the
|
|
74
|
+
* smaller / safer markup — typically `false` (= JS fallback) so the
|
|
75
|
+
* server output stays universally compatible.
|
|
76
|
+
*/
|
|
77
|
+
defaultValue?: boolean;
|
|
78
|
+
}
|
|
79
|
+
/*********************************************************
|
|
80
|
+
* useCssSupportClient
|
|
81
|
+
*
|
|
82
|
+
* @description
|
|
83
|
+
* Hydration-safe single-feature gate. Returns a `Ref<boolean>` that
|
|
84
|
+
* starts at `defaultValue` and flips to the real support result on
|
|
85
|
+
* `onMounted`. Use to gate **markup**, not styles — for style-only
|
|
86
|
+
* branches prefer `useCssSupport().css.value.X` directly.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* const supportsContainer = useCssSupportClient('containerQueries')
|
|
90
|
+
* // template:
|
|
91
|
+
* // <div v-if="supportsContainer">…CSS path…</div>
|
|
92
|
+
* // <div v-else>…JS fallback path…</div>
|
|
93
|
+
********************************************************/
|
|
94
|
+
export declare function useCssSupportClient(feature: TCssFeatureName | string, options?: IUseCssSupportClientOptions): Ref<boolean>;
|
|
70
95
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, readonly, ref } from "vue";
|
|
1
|
+
import { computed, onMounted, readonly, ref } from "vue";
|
|
2
2
|
const _cache = /* @__PURE__ */ new Map();
|
|
3
3
|
let _initialized = false;
|
|
4
4
|
const FEATURE_QUERIES = {
|
|
@@ -91,3 +91,12 @@ export function _resetCssSupportCache() {
|
|
|
91
91
|
_initialized = false;
|
|
92
92
|
_flags.value = emptyMap();
|
|
93
93
|
}
|
|
94
|
+
export function useCssSupportClient(feature, options = {}) {
|
|
95
|
+
const { defaultValue = false } = options;
|
|
96
|
+
const flag = ref(defaultValue);
|
|
97
|
+
onMounted(() => {
|
|
98
|
+
const query = FEATURE_QUERIES[feature] ?? feature;
|
|
99
|
+
flag.value = rawSupports(query);
|
|
100
|
+
});
|
|
101
|
+
return flag;
|
|
102
|
+
}
|