@snowui-design-system/components 0.3.0-alpha.0 → 0.3.0-alpha.11
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/AGENTS.md +39 -0
- package/LICENSE +152 -91
- package/README.md +52 -11
- package/THIRD_PARTY_NOTICES.md +41 -0
- package/component-catalog.json +532 -106
- package/dist/client/blocks/Sidebar.js +185 -143
- package/dist/client/blocks/SidebarItem.js +29 -15
- package/dist/client/blocks/SidebarSection.js +13 -5
- package/dist/client/blocks/index.js +2 -0
- package/dist/client/compat.d.ts +1 -1
- package/dist/client/compat.js +3 -1
- package/dist/client/components/Accordion.d.ts +2 -0
- package/dist/client/components/Accordion.js +37 -16
- package/dist/client/components/AccordionItem.js +1 -1
- package/dist/client/components/BarChart.js +10 -3
- package/dist/client/components/BlurText.js +2 -2
- package/dist/client/components/Breadcrumb.d.ts +1 -0
- package/dist/client/components/Breadcrumb.js +44 -18
- package/dist/client/components/Button.d.ts +2 -0
- package/dist/client/components/Button.js +6 -1
- package/dist/client/components/ChartGroup.js +23 -10
- package/dist/client/components/Checkbox.d.ts +2 -0
- package/dist/client/components/Checkbox.js +19 -4
- package/dist/client/components/Chip.js +2 -2
- package/dist/client/components/CircularChart.js +10 -3
- package/dist/client/components/CodeBlock.js +283 -226
- package/dist/client/components/CopyButton.js +5 -2
- package/dist/client/components/CopyLink.js +1 -1
- package/dist/client/components/DataTable.d.ts +8 -2
- package/dist/client/components/DataTable.js +11 -5
- package/dist/client/components/Dialog.js +1 -1
- package/dist/client/components/ExpandButton.js +10 -3
- package/dist/client/components/Field.js +3 -2
- package/dist/client/components/FlowText.js +2 -2
- package/dist/client/components/Frame.d.ts +9 -0
- package/dist/client/components/Frame.js +106 -40
- package/dist/client/components/GaugeChart.js +10 -3
- package/dist/client/components/GradientMotion.d.ts +1 -1
- package/dist/client/components/GradientMotion.js +2 -2
- package/dist/client/components/Icon.js +6 -3
- package/dist/client/components/Image.d.ts +2 -0
- package/dist/client/components/Image.js +14 -2
- package/dist/client/components/ImageViewer.js +51 -27
- package/dist/client/components/Indicator.js +5 -3
- package/dist/client/components/Input.d.ts +1 -0
- package/dist/client/components/Input.js +51 -24
- package/dist/client/components/LineChart.js +10 -3
- package/dist/client/components/Link.d.ts +1 -1
- package/dist/client/components/Link.js +58 -30
- package/dist/client/components/Listbox.d.ts +2 -0
- package/dist/client/components/Listbox.js +98 -43
- package/dist/client/components/MenuItem.d.ts +2 -0
- package/dist/client/components/MenuItem.js +15 -2
- package/dist/client/components/NumberFlow.js +4 -4
- package/dist/client/components/NumericText.js +2 -2
- package/dist/client/components/OTPInput.d.ts +32 -0
- package/dist/client/components/OTPInput.js +556 -0
- package/dist/client/components/OverflowAction.d.ts +2 -0
- package/dist/client/components/OverflowAction.js +146 -65
- package/dist/client/components/OverflowActions.d.ts +7 -1
- package/dist/client/components/OverflowActions.js +102 -26
- package/dist/client/components/Pagination.js +117 -68
- package/dist/client/components/Radio.d.ts +2 -0
- package/dist/client/components/Radio.js +20 -5
- package/dist/client/components/ScrambleText.js +6 -3
- package/dist/client/components/ScrollArea.js +11 -5
- package/dist/client/components/SearchBox.d.ts +1 -0
- package/dist/client/components/SearchBox.js +32 -7
- package/dist/client/components/SearchInput.js +43 -3
- package/dist/client/components/Select.d.ts +1 -0
- package/dist/client/components/Select.js +65 -27
- package/dist/client/components/SidePanel.js +84 -57
- package/dist/client/components/Slider.d.ts +1 -1
- package/dist/client/components/Slider.js +36 -13
- package/dist/client/components/SlotText.js +2 -2
- package/dist/client/components/SnowUILogo.js +1 -1
- package/dist/client/components/Spinner.js +9 -2
- package/dist/client/components/Switch.d.ts +2 -0
- package/dist/client/components/Switch.js +18 -3
- package/dist/client/components/Tab.js +90 -81
- package/dist/client/components/Table.js +30 -16
- package/dist/client/components/TableBody.js +10 -4
- package/dist/client/components/TableCell.d.ts +1 -0
- package/dist/client/components/TableCell.js +100 -50
- package/dist/client/components/TableHead.js +72 -39
- package/dist/client/components/TableToolbar.js +217 -141
- package/dist/client/components/Tag.js +21 -3
- package/dist/client/components/Text.js +163 -83
- package/dist/client/components/Textarea.js +8 -2
- package/dist/client/components/Toast.js +9 -2
- package/dist/client/components/Toaster.d.ts +2 -0
- package/dist/client/components/Toaster.js +52 -38
- package/dist/client/components/Tooltip.js +229 -201
- package/dist/client/context.js +2 -0
- package/dist/client/dev.js +2 -0
- package/dist/client/i18n/messages.d.ts +2 -2
- package/dist/client/i18n/messages.js +177 -1
- package/dist/client/index.d.ts +4 -2
- package/dist/client/index.js +8 -6
- package/dist/client/internal/code-block/prettier-svelte.d.ts +2 -0
- package/dist/client/internal/component-icon/index.js +2 -0
- package/dist/client/internal/snow-ui-logo/Wordmark.js +22 -10
- package/dist/client/internal/snow-ui-logo/emoji-metrics.js +2 -0
- package/dist/client/keys.d.ts +1 -0
- package/dist/client/keys.js +3 -0
- package/dist/client/lib/adaptive-contrast-renderer.js +2 -0
- package/dist/client/lib/chart/ChartHoverPanel.js +1 -1
- package/dist/client/lib/chart/appearance-timeline.js +2 -0
- package/dist/client/lib/chart/arc-path.js +2 -0
- package/dist/client/lib/chart/colors.js +2 -0
- package/dist/client/lib/chart/size.js +2 -0
- package/dist/client/lib/clipboard.js +2 -0
- package/dist/client/lib/color.js +2 -0
- package/dist/client/lib/date-format.js +2 -0
- package/dist/client/lib/edge-fade.js +3 -1
- package/dist/client/lib/media-loading.d.ts +7 -0
- package/dist/client/lib/media-loading.js +12 -0
- package/dist/client/lib/number-format.js +8 -0
- package/dist/client/lib/overflow-actions-motion.js +2 -0
- package/dist/client/lib/overlay-scrollbar.d.ts +1 -0
- package/dist/client/lib/overlay-scrollbar.js +9 -0
- package/dist/client/lib/overlay-trigger-timing.js +2 -0
- package/dist/client/lib/progressive-blur.d.ts +13 -0
- package/dist/client/lib/progressive-blur.js +54 -0
- package/dist/client/lib/resizable.d.ts +1 -1
- package/dist/client/lib/responsive-exit.js +2 -0
- package/dist/client/lib/search-filter.js +2 -0
- package/dist/client/lib/side-panel.js +2 -0
- package/dist/client/lib/split-pane.js +2 -0
- package/dist/client/lib/table-column-motion.js +2 -0
- package/dist/client/lib/table-context.d.ts +5 -0
- package/dist/client/lib/table-context.js +4 -1
- package/dist/client/lib/table-responsive.d.ts +1 -1
- package/dist/client/lib/table-responsive.js +41 -7
- package/dist/client/lib/table-selection-fade.js +2 -0
- package/dist/client/lib/table-truncation.js +2 -0
- package/dist/client/lib/text-motion/animation.js +2 -0
- package/dist/client/lib/text-motion/character.js +2 -0
- package/dist/client/lib/text-motion/color.js +2 -0
- package/dist/client/lib/text-motion/layout.js +2 -0
- package/dist/client/lib/text-motion/preference.js +2 -0
- package/dist/client/lib/text-motion/sequence.js +2 -0
- package/dist/client/lib/text-motion/typography.js +2 -0
- package/dist/client/lib/tooltip-delay.js +2 -0
- package/dist/client/lib/tooltip-motion-dismiss.js +2 -0
- package/dist/client/lib/tooltip-pointer-speed.js +2 -0
- package/dist/client/lib/truncate.js +2 -0
- package/dist/client/logic/ComponentPartsBoundary.d.ts +7 -0
- package/dist/client/logic/ComponentPartsBoundary.js +15 -0
- package/dist/client/logic/content-line.d.ts +5 -0
- package/dist/client/logic/content-line.js +13 -0
- package/dist/client/logic/frame-dom-runtime.d.ts +3 -1
- package/dist/client/logic/frame-dom-runtime.js +5 -3
- package/dist/client/logic/frame-field-control.js +2 -0
- package/dist/client/logic/frame-inline-style.js +2 -3
- package/dist/client/logic/frame-layout.js +3 -0
- package/dist/client/logic/frame-motion-defaults.js +2 -0
- package/dist/client/logic/frame-motion.d.ts +15 -23
- package/dist/client/logic/frame-motion.js +196 -30
- package/dist/client/logic/frame-prop-filter.d.ts +1 -1
- package/dist/client/logic/frame-prop-filter.js +3 -0
- package/dist/client/logic/frame-responsive.js +22 -6
- package/dist/client/logic/frame-state.d.ts +2 -14
- package/dist/client/logic/frame-state.js +60 -9
- package/dist/client/logic/frame-types.d.ts +2 -0
- package/dist/client/logic/geometry-cache.js +2 -0
- package/dist/client/logic/layout-flip.js +2 -0
- package/dist/client/logic/morph.js +2 -0
- package/dist/client/logic/motion-engine.js +2 -0
- package/dist/client/logic/motion-orchestration.js +2 -0
- package/dist/client/logic/motion-types.js +2 -0
- package/dist/client/logic/overflow-actions.d.ts +11 -2
- package/dist/client/logic/overflow-actions.js +5 -0
- package/dist/client/logic/toast.js +7 -4
- package/dist/client/logic/wc-adapter.js +2 -0
- package/dist/client/motion/bridge.js +2 -0
- package/dist/client/motion/content-crossfade.js +2 -0
- package/dist/client/motion/expand.js +2 -0
- package/dist/client/motion/fade-in.js +2 -0
- package/dist/client/motion/fade-out.js +2 -0
- package/dist/client/motion/morph.js +2 -0
- package/dist/client/motion/move.js +2 -0
- package/dist/client/motion/number.d.ts +3 -3
- package/dist/client/motion/number.js +5 -3
- package/dist/client/motion/replace.js +2 -0
- package/dist/client/motion/rotate.css +2 -0
- package/dist/client/motion/rotate.js +2 -0
- package/dist/client/motion/scale-in.js +2 -0
- package/dist/client/motion/tokens.js +2 -0
- package/dist/client/motion/while-2xl.js +2 -0
- package/dist/client/motion/while-active.js +2 -0
- package/dist/client/motion/while-appear.js +2 -0
- package/dist/client/motion/while-click.js +2 -0
- package/dist/client/motion/while-collapsed.js +2 -0
- package/dist/client/motion/while-disabled.js +2 -0
- package/dist/client/motion/while-disappear.js +2 -0
- package/dist/client/motion/while-drag.js +2 -0
- package/dist/client/motion/while-editing.js +2 -0
- package/dist/client/motion/while-expanded.js +2 -0
- package/dist/client/motion/while-focus.js +2 -0
- package/dist/client/motion/while-hover.js +2 -0
- package/dist/client/motion/while-idle.js +2 -0
- package/dist/client/motion/while-key.js +2 -0
- package/dist/client/motion/while-lg.js +2 -0
- package/dist/client/motion/while-load.js +2 -0
- package/dist/client/motion/while-md.js +2 -0
- package/dist/client/motion/while-reload.js +2 -0
- package/dist/client/motion/while-scroll.js +2 -0
- package/dist/client/motion/while-sm.js +2 -0
- package/dist/client/motion/while-uploading.js +2 -0
- package/dist/client/motion/while-validating.js +2 -0
- package/dist/client/motion/while-xl.js +2 -0
- package/dist/client/motion/while-xs.js +2 -0
- package/dist/client/styles/auto-layout.css +23 -1
- package/dist/client/styles/backdrop.css +2 -0
- package/dist/client/styles/components.css +28 -20
- package/dist/client/styles/index.css +2 -0
- package/dist/client/styles/layout.css +33 -7
- package/dist/client/styles/scale.css +2 -0
- package/dist/client/styles/scrollbar.css +16 -1
- package/dist/client/styles/themes.css +7 -4
- package/dist/client/styles/tokens.css +2 -0
- package/dist/client/vite-env.d.ts +2 -0
- package/dist/server/blocks/Sidebar.js +47 -27
- package/dist/server/blocks/SidebarItem.js +7 -5
- package/dist/server/blocks/SidebarSection.js +13 -5
- package/dist/server/blocks/index.js +2 -0
- package/dist/server/compat.d.ts +1 -1
- package/dist/server/compat.js +3 -1
- package/dist/server/components/Accordion.d.ts +2 -0
- package/dist/server/components/Accordion.js +12 -1
- package/dist/server/components/AccordionItem.js +1 -1
- package/dist/server/components/BarChart.js +6 -3
- package/dist/server/components/BlurText.js +2 -2
- package/dist/server/components/Breadcrumb.d.ts +1 -0
- package/dist/server/components/Breadcrumb.js +26 -5
- package/dist/server/components/Button.d.ts +2 -0
- package/dist/server/components/Button.js +6 -1
- package/dist/server/components/ChartGroup.js +6 -3
- package/dist/server/components/Checkbox.d.ts +2 -0
- package/dist/server/components/Checkbox.js +16 -3
- package/dist/server/components/Chip.js +2 -2
- package/dist/server/components/CircularChart.js +6 -3
- package/dist/server/components/CodeBlock.js +27 -14
- package/dist/server/components/CopyButton.js +6 -2
- package/dist/server/components/CopyLink.js +1 -1
- package/dist/server/components/DataTable.d.ts +8 -2
- package/dist/server/components/DataTable.js +11 -5
- package/dist/server/components/Dialog.js +1 -1
- package/dist/server/components/ExpandButton.js +7 -3
- package/dist/server/components/Field.js +3 -2
- package/dist/server/components/FlowText.js +2 -2
- package/dist/server/components/Frame.d.ts +9 -0
- package/dist/server/components/Frame.js +71 -34
- package/dist/server/components/GaugeChart.js +6 -3
- package/dist/server/components/GradientMotion.d.ts +1 -1
- package/dist/server/components/GradientMotion.js +2 -2
- package/dist/server/components/Icon.js +5 -4
- package/dist/server/components/Image.d.ts +2 -0
- package/dist/server/components/Image.js +11 -4
- package/dist/server/components/ImageViewer.js +6 -3
- package/dist/server/components/Indicator.js +5 -3
- package/dist/server/components/Input.d.ts +1 -0
- package/dist/server/components/Input.js +32 -22
- package/dist/server/components/LineChart.js +6 -3
- package/dist/server/components/Link.d.ts +1 -1
- package/dist/server/components/Link.js +22 -3
- package/dist/server/components/Listbox.d.ts +2 -0
- package/dist/server/components/Listbox.js +81 -22
- package/dist/server/components/MenuItem.d.ts +2 -0
- package/dist/server/components/MenuItem.js +9 -2
- package/dist/server/components/NumberFlow.js +4 -4
- package/dist/server/components/NumericText.js +2 -2
- package/dist/server/components/OTPInput.d.ts +32 -0
- package/dist/server/components/OTPInput.js +401 -0
- package/dist/server/components/OverflowAction.d.ts +2 -0
- package/dist/server/components/OverflowAction.js +70 -26
- package/dist/server/components/OverflowActions.d.ts +7 -1
- package/dist/server/components/OverflowActions.js +88 -30
- package/dist/server/components/Pagination.js +42 -22
- package/dist/server/components/Radio.d.ts +2 -0
- package/dist/server/components/Radio.js +15 -5
- package/dist/server/components/ScrambleText.js +6 -3
- package/dist/server/components/ScrollArea.js +5 -2
- package/dist/server/components/SearchBox.d.ts +1 -0
- package/dist/server/components/SearchBox.js +25 -5
- package/dist/server/components/SearchInput.js +12 -3
- package/dist/server/components/Select.d.ts +1 -0
- package/dist/server/components/Select.js +55 -20
- package/dist/server/components/SidePanel.js +36 -15
- package/dist/server/components/Slider.d.ts +1 -1
- package/dist/server/components/Slider.js +34 -11
- package/dist/server/components/SlotText.js +2 -2
- package/dist/server/components/SnowUILogo.js +1 -1
- package/dist/server/components/Spinner.js +4 -2
- package/dist/server/components/Switch.d.ts +2 -0
- package/dist/server/components/Switch.js +14 -3
- package/dist/server/components/Tab.js +62 -52
- package/dist/server/components/Table.js +16 -6
- package/dist/server/components/TableBody.js +9 -2
- package/dist/server/components/TableCell.d.ts +1 -0
- package/dist/server/components/TableCell.js +68 -25
- package/dist/server/components/TableHead.js +35 -8
- package/dist/server/components/TableToolbar.js +104 -55
- package/dist/server/components/Tag.js +17 -3
- package/dist/server/components/Text.js +64 -15
- package/dist/server/components/Textarea.js +5 -2
- package/dist/server/components/Toast.js +5 -2
- package/dist/server/components/Toaster.d.ts +2 -0
- package/dist/server/components/Toaster.js +18 -3
- package/dist/server/components/Tooltip.js +39 -16
- package/dist/server/context.js +2 -0
- package/dist/server/dev.js +2 -0
- package/dist/server/i18n/messages.d.ts +2 -2
- package/dist/server/i18n/messages.js +177 -1
- package/dist/server/index.d.ts +4 -2
- package/dist/server/index.js +8 -6
- package/dist/server/internal/code-block/prettier-svelte.d.ts +2 -0
- package/dist/server/internal/component-icon/index.js +2 -0
- package/dist/server/internal/snow-ui-logo/Wordmark.js +16 -8
- package/dist/server/internal/snow-ui-logo/emoji-metrics.js +2 -0
- package/dist/server/keys.d.ts +1 -0
- package/dist/server/keys.js +3 -0
- package/dist/server/lib/adaptive-contrast-renderer.js +2 -0
- package/dist/server/lib/chart/ChartHoverPanel.js +1 -1
- package/dist/server/lib/chart/appearance-timeline.js +2 -0
- package/dist/server/lib/chart/arc-path.js +2 -0
- package/dist/server/lib/chart/colors.js +2 -0
- package/dist/server/lib/chart/size.js +2 -0
- package/dist/server/lib/clipboard.js +2 -0
- package/dist/server/lib/color.js +2 -0
- package/dist/server/lib/date-format.js +2 -0
- package/dist/server/lib/edge-fade.js +3 -1
- package/dist/server/lib/media-loading.d.ts +7 -0
- package/dist/server/lib/media-loading.js +12 -0
- package/dist/server/lib/number-format.js +8 -0
- package/dist/server/lib/overflow-actions-motion.js +2 -0
- package/dist/server/lib/overlay-scrollbar.d.ts +1 -0
- package/dist/server/lib/overlay-scrollbar.js +9 -0
- package/dist/server/lib/overlay-trigger-timing.js +2 -0
- package/dist/server/lib/progressive-blur.d.ts +13 -0
- package/dist/server/lib/progressive-blur.js +54 -0
- package/dist/server/lib/resizable.d.ts +1 -1
- package/dist/server/lib/responsive-exit.js +2 -0
- package/dist/server/lib/search-filter.js +2 -0
- package/dist/server/lib/side-panel.js +2 -0
- package/dist/server/lib/split-pane.js +2 -0
- package/dist/server/lib/table-column-motion.js +2 -0
- package/dist/server/lib/table-context.d.ts +5 -0
- package/dist/server/lib/table-context.js +4 -1
- package/dist/server/lib/table-responsive.d.ts +1 -1
- package/dist/server/lib/table-responsive.js +41 -7
- package/dist/server/lib/table-selection-fade.js +2 -0
- package/dist/server/lib/table-truncation.js +2 -0
- package/dist/server/lib/text-motion/animation.js +2 -0
- package/dist/server/lib/text-motion/character.js +2 -0
- package/dist/server/lib/text-motion/color.js +2 -0
- package/dist/server/lib/text-motion/layout.js +2 -0
- package/dist/server/lib/text-motion/preference.js +2 -0
- package/dist/server/lib/text-motion/sequence.js +2 -0
- package/dist/server/lib/text-motion/typography.js +2 -0
- package/dist/server/lib/tooltip-delay.js +2 -0
- package/dist/server/lib/tooltip-motion-dismiss.js +2 -0
- package/dist/server/lib/tooltip-pointer-speed.js +2 -0
- package/dist/server/lib/truncate.js +2 -0
- package/dist/server/logic/ComponentPartsBoundary.d.ts +7 -0
- package/dist/server/logic/ComponentPartsBoundary.js +12 -0
- package/dist/server/logic/content-line.d.ts +5 -0
- package/dist/server/logic/content-line.js +13 -0
- package/dist/server/logic/frame-dom-runtime.d.ts +3 -1
- package/dist/server/logic/frame-dom-runtime.js +5 -3
- package/dist/server/logic/frame-field-control.js +2 -0
- package/dist/server/logic/frame-inline-style.js +2 -3
- package/dist/server/logic/frame-layout.js +3 -0
- package/dist/server/logic/frame-motion-defaults.js +2 -0
- package/dist/server/logic/frame-motion.d.ts +15 -23
- package/dist/server/logic/frame-motion.js +75 -29
- package/dist/server/logic/frame-prop-filter.d.ts +1 -1
- package/dist/server/logic/frame-prop-filter.js +3 -0
- package/dist/server/logic/frame-responsive.js +22 -6
- package/dist/server/logic/frame-state.d.ts +2 -14
- package/dist/server/logic/frame-state.js +60 -9
- package/dist/server/logic/frame-types.d.ts +2 -0
- package/dist/server/logic/geometry-cache.js +2 -0
- package/dist/server/logic/layout-flip.js +2 -0
- package/dist/server/logic/morph.js +2 -0
- package/dist/server/logic/motion-engine.js +2 -0
- package/dist/server/logic/motion-orchestration.js +2 -0
- package/dist/server/logic/motion-types.js +2 -0
- package/dist/server/logic/overflow-actions.d.ts +11 -2
- package/dist/server/logic/overflow-actions.js +5 -0
- package/dist/server/logic/toast.js +7 -4
- package/dist/server/logic/wc-adapter.js +2 -0
- package/dist/server/motion/bridge.js +2 -0
- package/dist/server/motion/content-crossfade.js +2 -0
- package/dist/server/motion/expand.js +2 -0
- package/dist/server/motion/fade-in.js +2 -0
- package/dist/server/motion/fade-out.js +2 -0
- package/dist/server/motion/morph.js +2 -0
- package/dist/server/motion/move.js +2 -0
- package/dist/server/motion/number.d.ts +3 -3
- package/dist/server/motion/number.js +5 -3
- package/dist/server/motion/replace.js +2 -0
- package/dist/server/motion/rotate.css +2 -0
- package/dist/server/motion/rotate.js +2 -0
- package/dist/server/motion/scale-in.js +2 -0
- package/dist/server/motion/tokens.js +2 -0
- package/dist/server/motion/while-2xl.js +2 -0
- package/dist/server/motion/while-active.js +2 -0
- package/dist/server/motion/while-appear.js +2 -0
- package/dist/server/motion/while-click.js +2 -0
- package/dist/server/motion/while-collapsed.js +2 -0
- package/dist/server/motion/while-disabled.js +2 -0
- package/dist/server/motion/while-disappear.js +2 -0
- package/dist/server/motion/while-drag.js +2 -0
- package/dist/server/motion/while-editing.js +2 -0
- package/dist/server/motion/while-expanded.js +2 -0
- package/dist/server/motion/while-focus.js +2 -0
- package/dist/server/motion/while-hover.js +2 -0
- package/dist/server/motion/while-idle.js +2 -0
- package/dist/server/motion/while-key.js +2 -0
- package/dist/server/motion/while-lg.js +2 -0
- package/dist/server/motion/while-load.js +2 -0
- package/dist/server/motion/while-md.js +2 -0
- package/dist/server/motion/while-reload.js +2 -0
- package/dist/server/motion/while-scroll.js +2 -0
- package/dist/server/motion/while-sm.js +2 -0
- package/dist/server/motion/while-uploading.js +2 -0
- package/dist/server/motion/while-validating.js +2 -0
- package/dist/server/motion/while-xl.js +2 -0
- package/dist/server/motion/while-xs.js +2 -0
- package/dist/server/styles/auto-layout.css +23 -1
- package/dist/server/styles/backdrop.css +2 -0
- package/dist/server/styles/components.css +28 -20
- package/dist/server/styles/index.css +2 -0
- package/dist/server/styles/layout.css +33 -7
- package/dist/server/styles/scale.css +2 -0
- package/dist/server/styles/scrollbar.css +16 -1
- package/dist/server/styles/themes.css +7 -4
- package/dist/server/styles/tokens.css +2 -0
- package/dist/server/vite-env.d.ts +2 -0
- package/llms.txt +8 -0
- package/package.json +16 -7
- package/dist/client/components/FramePro.d.ts +0 -23
- package/dist/client/components/FramePro.js +0 -412
- package/dist/client/logic/frame-pro-motion.d.ts +0 -26
- package/dist/client/logic/frame-pro-motion.js +0 -310
- package/dist/client/logic/frame-pro-state.d.ts +0 -39
- package/dist/client/logic/frame-pro-state.js +0 -538
- package/dist/server/components/FramePro.d.ts +0 -23
- package/dist/server/components/FramePro.js +0 -301
- package/dist/server/logic/frame-pro-motion.d.ts +0 -26
- package/dist/server/logic/frame-pro-motion.js +0 -176
- package/dist/server/logic/frame-pro-state.d.ts +0 -39
- package/dist/server/logic/frame-pro-state.js +0 -445
|
@@ -4,8 +4,10 @@ import { formatCodeBlock } from "../internal/code-block/format.js";
|
|
|
4
4
|
import Frame from "./Frame.js";
|
|
5
5
|
import Indicator from "./Indicator.js";
|
|
6
6
|
import CopyButton from "./CopyButton.js";
|
|
7
|
+
import { useLocale } from "../i18n/locale.js";
|
|
7
8
|
import { resizeManager } from "../logic/observer.js";
|
|
8
9
|
import { useOverlayScrollbar } from "../lib/overlay-scrollbar.js";
|
|
10
|
+
import ComponentPartsBoundary from "../logic/ComponentPartsBoundary.js";
|
|
9
11
|
import { captureFlipRect, beginFlipEnter, applyFlipExit } from "../logic/layout-flip.js";
|
|
10
12
|
import ExpandButton from "./ExpandButton.js";
|
|
11
13
|
import { ComponentIcon } from "../internal/component-icon/index.js";
|
|
@@ -44,20 +46,20 @@ var root_4 = $.from_html(`<span class="snowui-code-block-single-line-leading" da
|
|
|
44
46
|
var root_5 = $.from_html(`<span> </span>`);
|
|
45
47
|
var root_6 = $.from_html(`<span class="snowui-code-block-trailing-custom" data-as="trailing"></span>`);
|
|
46
48
|
var root_7 = $.from_html(`<div class="snowui-code-block-actions snowui-code-block-single-line-trailing" data-as="trailing"><!></div>`);
|
|
47
|
-
var root_8 = $.from_html(`<!> <div class="snowui-code-block-single-line-content snowui-overlay-scrollbar-viewport" data-scroll-axis="horizontal"><pre class="snowui-code-block-pre"><code class="snowui-code-block-code"></code></pre></div> <!>`, 1);
|
|
49
|
+
var root_8 = $.from_html(`<!> <div class="snowui-code-block-single-line-content snowui-overlay-scrollbar-viewport" data-as="content" data-scroll-axis="horizontal"><pre class="snowui-code-block-pre"><code class="snowui-code-block-code"></code></pre></div> <!>`, 1);
|
|
48
50
|
var root_9 = $.from_html(`<span class="snowui-code-block-lang"> </span>`);
|
|
49
51
|
var root_10 = $.from_html(`<!> <!>`, 1);
|
|
50
52
|
var root_11 = $.from_html(`<span class="snowui-code-block-line-number"></span>`);
|
|
51
53
|
var root_12 = $.from_html(`<div class="snowui-code-block-gutter" aria-hidden="true"></div>`);
|
|
52
54
|
var root_13 = $.from_html(`<span class="snowui-code-block-line"></span>`);
|
|
53
|
-
var root_14 = $.from_html(`<div class="snowui-code-block-toolbar snowui-code-block-default-pin-top-right" data-as="pin-top-right" style="--pin-offset: var(--padding-
|
|
55
|
+
var root_14 = $.from_html(`<div class="snowui-code-block-toolbar snowui-code-block-default-pin-top-right" data-as="pin-top-right" style="--pin-offset-y: var(--padding-2); --pin-offset-x: var(--padding-1);"><!> <div class="snowui-code-block-actions"><!></div></div> <div class="snowui-code-block-scroll-shell"><div class="snowui-code-block-body snowui-overlay-scrollbar-viewport snowui-scroll-mask" data-scroll-axis="both"><!> <div class="snowui-code-block-pre-wrap"><pre class="snowui-code-block-pre"><code class="snowui-code-block-code"></code></pre></div></div></div> <div class="snowui-code-block-scrollbar snowui-overlay-scrollbar" data-axis="vertical" aria-hidden="true"><div class="snowui-overlay-scrollbar-thumb"></div></div> <!>`, 1);
|
|
54
56
|
var root_15 = $.from_html(`<div class="snowui-code-block-accessories" aria-hidden="true"><!></div>`);
|
|
55
57
|
var root_16 = $.from_html(`<!> <div class="snowui-code-block-scrollbar snowui-overlay-scrollbar" data-axis="horizontal" aria-hidden="true"><div class="snowui-overlay-scrollbar-thumb"></div></div> <!>`, 1);
|
|
56
|
-
var root_17 = $.from_html(`<div class="snowui-code-block-toolbar snowui-code-block-toolbar-fullscreen" data-as="pin-top-right" style="--pin-offset: var(--padding-
|
|
58
|
+
var root_17 = $.from_html(`<div class="snowui-code-block-toolbar snowui-code-block-toolbar-fullscreen" data-as="pin-top-right" style="--pin-offset-y: var(--padding-2); --pin-offset-x: var(--padding-1);"><!> <div class="snowui-code-block-actions"><!> <!></div></div> <div class="snowui-code-block-scroll-shell snowui-code-block-scroll-shell-fullscreen"><div class="snowui-code-block-body snowui-code-block-body-fullscreen snowui-overlay-scrollbar-viewport snowui-scroll-mask" data-scroll-axis="both"><!> <div class="snowui-code-block-pre-wrap"><pre class="snowui-code-block-pre"><code class="snowui-code-block-code"></code></pre></div></div></div> <div class="snowui-code-block-scrollbar snowui-overlay-scrollbar" data-axis="vertical" aria-hidden="true"><div class="snowui-overlay-scrollbar-thumb"></div></div> <div class="snowui-code-block-scrollbar snowui-overlay-scrollbar" data-axis="horizontal" aria-hidden="true"><div class="snowui-overlay-scrollbar-thumb"></div></div>`, 1);
|
|
57
59
|
|
|
58
60
|
const $$css = {
|
|
59
61
|
hash: 'svelte-ipr7k2',
|
|
60
|
-
code: '\n /* ─── Level 2:组件基类(降权 0,0,0) ─── */:where(.snowui-code-block) {--snowui-code-block-bg: var(--background-2, #f9f9fa);--snowui-code-block-fg: var(--black-100, #000000ff);--snowui-code-block-muted-fg: var(--black-40, #00000066);--snowui-code-block-gutter-fg: var(--black-20, #00000033);--snowui-code-block-btn-fg: var(--black-100, #000000ff);--snowui-code-block-keyword-fg: #ff32c6;--snowui-code-block-function-fg: #ffac60;--snowui-code-block-property-fg: #1ac69c;--snowui-code-block-string-fg: #3fa4ff;--snowui-code-block-variable-fg: #c478ff;--snowui-code-block-radius: var(--radius-4);--snowui-code-block-padding-x: var(--padding-5);--snowui-code-block-padding-y: var(--padding-5);--snowui-code-block-gap: var(--gap-2);--snowui-code-block-code-gap: var(--gap-3);--snowui-code-block-footer-height: var(--padding-3);--snowui-code-block-font-size: var(--text-12);--snowui-code-block-line-height: var(--leading-12);--snowui-code-block-font-family: inherit;--snowui-code-block-visible-lines: 5;--snowui-code-block-content-height: calc(\n var(--snowui-code-block-visible-lines) * 1lh\n );background-color:var(\n --snowui-code-block-bg-override,\n var(--snowui-code-block-bg)\n );color:var(\n --snowui-code-block-fg-override,\n var(--snowui-code-block-fg)\n );border-radius:var(\n --snowui-code-block-radius-override,\n var(--snowui-code-block-radius)\n );padding:var(\n --snowui-code-block-padding-override,\n var(\n --snowui-code-block-padding-y-override,\n var(--snowui-code-block-padding-y)\n )\n var(\n --snowui-code-block-padding-x-override,\n var(--snowui-code-block-padding-x)\n )\n );font-size:var(--snowui-code-block-font-size);line-height:var(--snowui-code-block-line-height);font-family:var(--snowui-code-block-font-family);overflow:hidden;position:relative;width:100%;}:where(.snowui-code-block[data-variant="default"]) {display:flex;flex-direction:column;gap:var(--gap-2);}\n\n /* singleLine:沿用 Input 的 Leading / Content / Trailing 三槽结构。 */:where(.snowui-code-block[data-variant="singleLine"]) {--snowui-code-block-padding-x: var(--padding-4);--snowui-code-block-padding-y: var(--padding-3);gap:var(\n --snowui-code-block-gap-override,\n var(--snowui-code-block-gap)\n );box-sizing:border-box;height:auto;}:where(.snowui-code-block-single-line-content) {grid-row:1;min-width:0;overflow-x:auto;overflow-y:hidden;white-space:nowrap;scrollbar-width:none;}:where(.snowui-code-block-single-line-content::-webkit-scrollbar) {display:none;}\n :where(\n .snowui-code-block[data-variant="singleLine"]\n > [data-as="leading"],\n .snowui-code-block[data-variant="singleLine"]\n > [data-as="trailing"]\n )\n {display:inline-flex;align-items:center;justify-content:center;min-width:0;white-space:nowrap;line-height:inherit;}:where(.snowui-code-block-fullscreen) {--snowui-code-block-bg: var(--background-2, #f9f9fa);--snowui-code-block-fg: var(--black-100, #000000ff);--snowui-code-block-muted-fg: var(--black-40, #00000066);--snowui-code-block-gutter-fg: var(--black-20, #00000033);--snowui-code-block-btn-fg: var(--black-100, #000000ff);--snowui-code-block-radius: var(--radius-4);--snowui-code-block-padding-x: var(--padding-5);--snowui-code-block-padding-y: var(--padding-5);--snowui-code-block-gap: var(--gap-2);--snowui-code-block-code-gap: var(--gap-3);--snowui-code-block-footer-height: var(--padding-3);--snowui-code-block-font-size: var(--text-12);--snowui-code-block-line-height: var(--leading-12);--snowui-code-block-font-family: inherit;--snowui-code-block-content-height: 5lh;}\n\n /* ─── 工具栏 ─── */:where(.snowui-code-block-toolbar) {display:flex;align-items:center;justify-content:space-between;gap:var(--gap-2);z-index:3;}:where(.snowui-code-block-lang) {color:var(--snowui-code-block-muted-fg);user-select:none;}:where(.snowui-code-block-actions) {display:flex;align-items:center;gap:var(\n --snowui-code-block-gap-override,\n var(--snowui-code-block-gap)\n );}\n\n /* ─── 图标按钮:统一使用 CopyButton / ExpandButton 的 bare 默认尺寸 ─── */:where(button).snowui-code-block-btn {--snowui-field-focus-ring-width: 0;color:var(--snowui-code-block-btn-fg);transition:color var(--snowui-frame-color-motion-duration, 0.15s)\n var(--snowui-frame-color-motion-easing, ease-out);}\n :where(button).snowui-code-block-btn:focus,\n :where(button).snowui-code-block-btn:focus-visible\n {outline:none;box-shadow:none;}:where(button).snowui-code-block-btn:hover:not(:disabled) {background-image:none;box-shadow:none;}\n\n /* ─── 代码主体区域 ─── */:where(.snowui-code-block-scroll-shell) {position:relative;height:var(\n --snowui-code-block-content-height-override,\n var(--snowui-code-block-content-height)\n );min-height:0;overflow:clip;background:transparent;}:where(.snowui-code-block[data-resized="true"] .snowui-code-block-scroll-shell) {flex:1 1 0;height:auto;}\n\n /* 上下滚动渐隐:接入「内容渐隐层」通用能力的 CSS 静态形态(.snowui-scroll-mask,见 lib/edge-fade.md)。 */:where(.snowui-code-block-body) {--snowui-code-block-scroll-mask-size: var(\n --snowui-code-block-scroll-mask-size-override,\n 32px\n );display:flex;align-items:flex-start;gap:var(\n --snowui-code-block-code-gap-override,\n var(--snowui-code-block-code-gap)\n );flex:1 1 0;height:100%;overflow-x:auto;min-height:0;background:transparent;}\n\n /* ─── 行号槽 ─── */:where(.snowui-code-block-gutter) {display:block;flex-shrink:0;width:max-content;color:var(--snowui-code-block-gutter-fg);background:transparent;text-align:right;user-select:none;font:inherit;}:where(.snowui-code-block-line-number) {display:block;line-height:inherit;}:where(.snowui-code-block-pre-wrap) {flex:1 1 0;min-width:0;overflow:visible;background:transparent;}:where(.snowui-code-block-pre) {box-sizing:border-box;margin:0;tab-size:4;white-space:pre;overflow:visible;background:transparent;font:inherit;}:where(.snowui-code-block-code) {box-sizing:border-box;display:block;color:inherit;background:transparent;border-radius:0;font:inherit;margin:0;padding:0;}\n :where(\n .snowui-code-block[data-variant="singleLine"]\n .snowui-code-block-pre\n )\n {white-space:nowrap;}\n :where(\n .snowui-code-block[data-variant="singleLine"]\n .snowui-code-block-code\n )\n {display:inline;}:where(.snowui-code-block-line) {display:block;line-height:inherit;}:where(.snowui-code-block-token-comment) {color:var(--black-40, #00000066);}:where(.snowui-code-block-token-keyword) {color:#ff32c6;}:where(.snowui-code-block-token-function) {color:#ffac60;}:where(.snowui-code-block-token-property) {color:#1ac69c;}:where(.snowui-code-block-token-string) {color:#3fa4ff;}:where(.snowui-code-block-token-variable) {color:#c478ff;}\n\n /* ─── 全屏覆盖层 ─── */:where(.snowui-code-block-fullscreen) {position:fixed;inset:0;z-index:9999;display:flex;flex-direction:column;font-size:var(--snowui-code-block-font-size);line-height:var(--snowui-code-block-line-height);font-family:var(--snowui-code-block-font-family);background-color:var(\n --snowui-code-block-bg-override,\n var(--snowui-code-block-bg)\n );color:var(\n --snowui-code-block-fg-override,\n var(--snowui-code-block-fg)\n );border-radius:0;padding:var(\n --snowui-code-block-padding-override,\n var(\n --snowui-code-block-padding-y-override,\n var(--snowui-code-block-padding-y)\n )\n var(\n --snowui-code-block-padding-x-override,\n var(--snowui-code-block-padding-x)\n )\n );}\n\n /* 全屏工具栏与普通态保持一致:距上/右 8px。 */:where(.snowui-code-block-toolbar-fullscreen) {padding:0;}:where(.snowui-code-block-body-fullscreen) {padding-bottom:max(var(--padding-0), env(safe-area-inset-bottom));}:where(.snowui-code-block-scroll-shell-fullscreen) {flex:1 1 0;height:auto;}\n\n /* 组件只声明轨道定位;视觉样式由 scrollbar.css 的 .snowui-overlay-scrollbar 承接。 */\n /* 滚动条提升到根容器(position:relative),绕开 scroll-shell 的 overflow:clip 裁切。 */\n /* top/bottom 对齐 scroll-shell 上下边缘(即容器 padding-y 处),right: 4px 贴近右边缘。 */:where(.snowui-code-block-scrollbar[data-axis="vertical"]) {top:var(\n --snowui-code-block-padding-y-override,\n var(--snowui-code-block-padding-y)\n );right:4px;bottom:var(--snowui-code-block-footer-height);z-index:2;}:where(.snowui-code-block-accessories) {position:absolute;width:0;height:0;overflow:hidden;pointer-events:none;opacity:0;}\n\n /* ─── 内置 SVG 图标基础样式 ─── */:where(.snowui-code-block-icon-builtin),\n :where(.snowui-code-block-icon-custom) {display:block;flex-shrink:0;color:inherit;}:where(.snowui-code-block-icon-custom > *) {display:block;}:where(.snowui-code-block-trailing-custom) {display:inline-flex;align-items:center;justify-content:center;color:inherit;}:where(.snowui-code-block-trailing-custom > *) {display:inline-flex;}'
|
|
62
|
+
code: '\n /* ─── Level 2:组件基类(降权 0,0,0) ─── */:where(.snowui-code-block) {--snowui-code-block-bg: var(--background-2, #f9f9fa);--snowui-code-block-fg: var(--black-100, #000000ff);--snowui-code-block-muted-fg: var(--black-40, #00000066);--snowui-code-block-gutter-fg: var(--black-20, #00000033);--snowui-code-block-btn-fg: var(--black-100, #000000ff);--snowui-code-block-keyword-fg: #ff32c6;--snowui-code-block-function-fg: #ffac60;--snowui-code-block-property-fg: #1ac69c;--snowui-code-block-string-fg: #3fa4ff;--snowui-code-block-variable-fg: #c478ff;--snowui-code-block-radius: var(--radius-4);--snowui-code-block-padding-x: var(--padding-5);--snowui-code-block-padding-y: var(--padding-5);--snowui-code-block-gap: var(--gap-2);--snowui-code-block-code-gap: var(--gap-3);--snowui-code-block-footer-height: var(--padding-3);--snowui-code-block-font-size: var(--text-12);--snowui-code-block-line-height: var(--leading-12);--snowui-code-block-font-family: inherit;--snowui-code-block-visible-lines: 5;--snowui-code-block-content-height: calc(\n var(--snowui-code-block-visible-lines) * 1lh\n );background-color:var(\n --snowui-code-block-bg-override,\n var(--snowui-code-block-bg)\n );color:var(\n --snowui-code-block-fg-override,\n var(--snowui-code-block-fg)\n );border-radius:var(\n --snowui-code-block-radius-override,\n var(--snowui-code-block-radius)\n );padding:var(\n --snowui-code-block-padding-override,\n var(\n --snowui-code-block-padding-y-override,\n var(--snowui-code-block-padding-y)\n )\n var(\n --snowui-code-block-padding-x-override,\n var(--snowui-code-block-padding-x)\n )\n );font-size:var(--snowui-code-block-font-size);line-height:var(--snowui-code-block-line-height);font-family:var(--snowui-code-block-font-family);overflow:hidden;position:relative;width:100%;}:where(.snowui-code-block[data-variant="default"]) {display:flex;flex-direction:column;gap:var(--gap-2);}\n\n /* singleLine:沿用 Input 的 Leading / Content / Trailing 三槽结构。 */:where(.snowui-code-block[data-variant="singleLine"]) {--snowui-code-block-padding-x: var(--padding-4);--snowui-code-block-padding-y: var(--padding-3);gap:max(4px, var(\n --snowui-code-block-gap-override,\n var(--snowui-code-block-gap)\n ));box-sizing:border-box;height:auto;}:where(.snowui-code-block-single-line-content) {grid-row:1;min-width:0;overflow-x:auto;overflow-y:hidden;white-space:nowrap;scrollbar-width:none;}:where(.snowui-code-block-single-line-content::-webkit-scrollbar) {display:none;}\n :where(\n .snowui-code-block[data-variant="singleLine"]\n > [data-as="leading"],\n .snowui-code-block[data-variant="singleLine"]\n > [data-as="trailing"]\n )\n {display:inline-flex;align-items:center;justify-content:center;min-width:0;white-space:nowrap;line-height:inherit;}:where(.snowui-code-block-fullscreen) {--snowui-code-block-bg: var(--background-2, #f9f9fa);--snowui-code-block-fg: var(--black-100, #000000ff);--snowui-code-block-muted-fg: var(--black-40, #00000066);--snowui-code-block-gutter-fg: var(--black-20, #00000033);--snowui-code-block-btn-fg: var(--black-100, #000000ff);--snowui-code-block-radius: var(--radius-4);--snowui-code-block-padding-x: var(--padding-5);--snowui-code-block-padding-y: var(--padding-5);--snowui-code-block-gap: var(--gap-2);--snowui-code-block-code-gap: var(--gap-3);--snowui-code-block-footer-height: var(--padding-3);--snowui-code-block-font-size: var(--text-12);--snowui-code-block-line-height: var(--leading-12);--snowui-code-block-font-family: inherit;--snowui-code-block-content-height: 5lh;}\n\n /* ─── 工具栏 ─── */:where(.snowui-code-block-toolbar) {display:flex;align-items:center;justify-content:space-between;gap:max(4px, var(--gap-2));max-width:calc(100% - var(--size-3));z-index:3;}:where(.snowui-code-block-lang) {color:var(--snowui-code-block-muted-fg);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;user-select:none;}:where(.snowui-code-block-actions) {display:flex;align-items:center;flex-shrink:0;gap:var(\n --snowui-code-block-gap-override,\n var(--snowui-code-block-gap)\n );}\n\n /* 默认态与全屏态各按钮独立拥有背景与命中区;singleLine 保留行内 trailing。 */:where(.snowui-code-block-toolbar button).snowui-code-block-btn {--snowui-field-focus-ring-width: 0;--snowui-button-padding-override: var(--padding-1) var(--padding-2);--snowui-button-radius-override: var(--radius-2);--snowui-button-background-override: var(--black-20, #00000033);color:var(--snowui-code-block-btn-fg);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);transition:color var(--snowui-frame-color-motion-duration, 0.15s)\n var(--snowui-frame-color-motion-easing, ease-out);}\n :where(.snowui-code-block-toolbar button).snowui-code-block-btn:focus-visible\n {outline:2px solid var(--brand, #33d1ffff);outline-offset:1px;}:where(.snowui-code-block-toolbar button).snowui-code-block-btn:hover:not(:disabled) {background-image:none;}\n\n /* ─── 代码主体区域 ─── */:where(.snowui-code-block-scroll-shell) {position:relative;height:var(\n --snowui-code-block-content-height-override,\n var(--snowui-code-block-content-height)\n );min-height:0;overflow:clip;background:transparent;}:where(.snowui-code-block[data-resized="true"] .snowui-code-block-scroll-shell) {flex:1 1 0;height:auto;}\n\n /* 上下滚动渐隐:接入「内容渐隐层」通用能力的 CSS 静态形态(.snowui-scroll-mask,见 lib/edge-fade.md)。 */:where(.snowui-code-block-body) {--snowui-code-block-scroll-mask-size: var(\n --snowui-code-block-scroll-mask-size-override,\n 32px\n );display:flex;align-items:flex-start;gap:var(\n --snowui-code-block-code-gap-override,\n var(--snowui-code-block-code-gap)\n );flex:1 1 0;height:100%;overflow-x:auto;min-height:0;background:transparent;}\n\n /* ─── 行号槽 ─── */:where(.snowui-code-block-gutter) {display:block;flex-shrink:0;width:max-content;color:var(--snowui-code-block-gutter-fg);background:transparent;text-align:right;user-select:none;font:inherit;}:where(.snowui-code-block-line-number) {display:block;line-height:inherit;}:where(.snowui-code-block-pre-wrap) {flex:1 1 0;min-width:0;overflow:visible;background:transparent;}:where(.snowui-code-block-pre) {box-sizing:border-box;margin:0;tab-size:4;white-space:pre;overflow:visible;background:transparent;font:inherit;}:where(.snowui-code-block-code) {box-sizing:border-box;display:block;color:inherit;background:transparent;border-radius:0;font:inherit;margin:0;padding:0;}\n :where(\n .snowui-code-block[data-variant="singleLine"]\n .snowui-code-block-pre\n )\n {white-space:nowrap;}\n :where(\n .snowui-code-block[data-variant="singleLine"]\n .snowui-code-block-code\n )\n {display:inline;}:where(.snowui-code-block-line) {display:block;line-height:inherit;}:where(.snowui-code-block-token-comment) {color:var(--black-40, #00000066);}:where(.snowui-code-block-token-keyword) {color:#ff32c6;}:where(.snowui-code-block-token-function) {color:#ffac60;}:where(.snowui-code-block-token-property) {color:#1ac69c;}:where(.snowui-code-block-token-string) {color:#3fa4ff;}:where(.snowui-code-block-token-variable) {color:#c478ff;}\n\n /* ─── 全屏覆盖层 ─── */:where(.snowui-code-block-fullscreen) {position:fixed;inset:0;z-index:9999;display:flex;flex-direction:column;font-size:var(--snowui-code-block-font-size);line-height:var(--snowui-code-block-line-height);font-family:var(--snowui-code-block-font-family);background-color:var(\n --snowui-code-block-bg-override,\n var(--snowui-code-block-bg)\n );color:var(\n --snowui-code-block-fg-override,\n var(--snowui-code-block-fg)\n );border-radius:0;padding:var(\n --snowui-code-block-padding-override,\n var(\n --snowui-code-block-padding-y-override,\n var(--snowui-code-block-padding-y)\n )\n var(\n --snowui-code-block-padding-x-override,\n var(--snowui-code-block-padding-x)\n )\n );}:where(.snowui-code-block[data-top-actions="true"]),\n :where(.snowui-code-block-fullscreen) {padding-top:calc(\n var(--snowui-code-block-padding-y-override, var(--snowui-code-block-padding-y))\n + var(--padding-4)\n );}\n\n /* 全屏工具栏与普通态保持一致:距上/右 8px。 */:where(.snowui-code-block-toolbar-fullscreen) {padding:0;}:where(.snowui-code-block-body-fullscreen) {padding-bottom:max(var(--padding-0), env(safe-area-inset-bottom));}:where(.snowui-code-block-scroll-shell-fullscreen) {flex:1 1 0;height:auto;}\n\n /* 组件只声明轨道定位;视觉样式由 scrollbar.css 的 .snowui-overlay-scrollbar 承接。 */\n /* 滚动条提升到根容器(position:relative),绕开 scroll-shell 的 overflow:clip 裁切。 */\n /* top/bottom 对齐 scroll-shell 上下边缘(即容器 padding-y 处),right: 4px 贴近右边缘。 */:where(.snowui-code-block-scrollbar[data-axis="vertical"]) {top:var(\n --snowui-code-block-padding-y-override,\n var(--snowui-code-block-padding-y)\n );right:4px;bottom:var(--snowui-code-block-footer-height);z-index:2;}:where(.snowui-code-block[data-top-actions="true"] .snowui-code-block-scrollbar[data-axis="vertical"]),\n :where(.snowui-code-block-fullscreen .snowui-code-block-scrollbar[data-axis="vertical"]) {top:calc(var(--padding-2) + var(--size-6) + var(--padding-1));}:where(.snowui-code-block-accessories) {position:absolute;width:0;height:0;overflow:hidden;pointer-events:none;opacity:0;}\n\n /* ─── 内置 SVG 图标基础样式 ─── */:where(.snowui-code-block-icon-builtin),\n :where(.snowui-code-block-icon-custom) {display:block;flex-shrink:0;color:inherit;}:where(.snowui-code-block-icon-custom > *) {display:block;}:where(.snowui-code-block-trailing-custom) {display:inline-flex;align-items:center;justify-content:center;color:inherit;}:where(.snowui-code-block-trailing-custom > *) {display:inline-flex;}'
|
|
61
63
|
};
|
|
62
64
|
|
|
63
65
|
export default function CodeBlock($$anchor, $$props) {
|
|
@@ -252,6 +254,7 @@ export default function CodeBlock($$anchor, $$props) {
|
|
|
252
254
|
/* ─── 内部状态 ─── */
|
|
253
255
|
const fullscreenMotionId = `code-block-fullscreen-${++codeBlockInstanceSeed}`;
|
|
254
256
|
|
|
257
|
+
const localeContext = useLocale();
|
|
255
258
|
let isFullscreen = $.state(false);
|
|
256
259
|
let isExitingFullscreen = $.state(false);
|
|
257
260
|
|
|
@@ -672,7 +675,8 @@ export default function CodeBlock($$anchor, $$props) {
|
|
|
672
675
|
className()
|
|
673
676
|
].filter(Boolean).join(" "));
|
|
674
677
|
|
|
675
|
-
let $1 = $.derived(() => !$.get(isSingleLine) && $.get(
|
|
678
|
+
let $1 = $.derived(() => !$.get(isSingleLine) && (showLanguage() && language() || showCopyButton() || showExpandButton() || $.get(hasCustomTrailing)) ? "true" : undefined);
|
|
679
|
+
let $2 = $.derived(() => !$.get(isSingleLine) && $.get(resizeHeight) !== undefined ? "true" : undefined);
|
|
676
680
|
|
|
677
681
|
Frame(node_3, $.spread_props(() => rest, {
|
|
678
682
|
get enableResponsive() {
|
|
@@ -695,6 +699,10 @@ export default function CodeBlock($$anchor, $$props) {
|
|
|
695
699
|
return $.get(isSingleLine);
|
|
696
700
|
},
|
|
697
701
|
|
|
702
|
+
get singleLine() {
|
|
703
|
+
return $.get(isSingleLine);
|
|
704
|
+
},
|
|
705
|
+
|
|
698
706
|
get class() {
|
|
699
707
|
return $.get($0);
|
|
700
708
|
},
|
|
@@ -703,10 +711,14 @@ export default function CodeBlock($$anchor, $$props) {
|
|
|
703
711
|
return variant();
|
|
704
712
|
},
|
|
705
713
|
|
|
706
|
-
get 'data-
|
|
714
|
+
get 'data-top-actions'() {
|
|
707
715
|
return $.get($1);
|
|
708
716
|
},
|
|
709
717
|
|
|
718
|
+
get 'data-resized'() {
|
|
719
|
+
return $.get($2);
|
|
720
|
+
},
|
|
721
|
+
|
|
710
722
|
get style() {
|
|
711
723
|
return $.get(rootStyle);
|
|
712
724
|
},
|
|
@@ -795,6 +807,7 @@ export default function CodeBlock($$anchor, $$props) {
|
|
|
795
807
|
let $0 = $.derived(() => parts()?.CopyButton?.emphasis ?? "muted");
|
|
796
808
|
let $1 = $.derived(() => $.get(hasCustomCopyIcon) ? normalizeActionSnippet(copyIconSnippet) : undefined);
|
|
797
809
|
let $2 = $.derived(() => $.get(hasCustomCopiedIcon) ? normalizeActionSnippet(copiedIconSnippet) : undefined);
|
|
810
|
+
let $3 = $.derived(() => localeContext.t("codeBlock.copyCode"));
|
|
798
811
|
|
|
799
812
|
CopyButton(node_7, {
|
|
800
813
|
get text() {
|
|
@@ -817,7 +830,9 @@ export default function CodeBlock($$anchor, $$props) {
|
|
|
817
830
|
return $.get($2);
|
|
818
831
|
},
|
|
819
832
|
class: 'snowui-code-block-btn snowui-hoverable',
|
|
820
|
-
ariaLabel
|
|
833
|
+
get ariaLabel() {
|
|
834
|
+
return $.get($3);
|
|
835
|
+
}
|
|
821
836
|
});
|
|
822
837
|
}
|
|
823
838
|
|
|
@@ -875,6 +890,7 @@ export default function CodeBlock($$anchor, $$props) {
|
|
|
875
890
|
let $0 = $.derived(() => parts()?.CopyButton?.emphasis ?? "muted");
|
|
876
891
|
let $1 = $.derived(() => $.get(hasCustomCopyIcon) ? normalizeActionSnippet(copyIconSnippet) : undefined);
|
|
877
892
|
let $2 = $.derived(() => $.get(hasCustomCopiedIcon) ? normalizeActionSnippet(copiedIconSnippet) : undefined);
|
|
893
|
+
let $3 = $.derived(() => localeContext.t("codeBlock.copyCode"));
|
|
878
894
|
|
|
879
895
|
CopyButton($$anchor, {
|
|
880
896
|
get text() {
|
|
@@ -897,7 +913,9 @@ export default function CodeBlock($$anchor, $$props) {
|
|
|
897
913
|
return $.get($2);
|
|
898
914
|
},
|
|
899
915
|
class: 'snowui-code-block-btn snowui-hoverable',
|
|
900
|
-
ariaLabel
|
|
916
|
+
get ariaLabel() {
|
|
917
|
+
return $.get($3);
|
|
918
|
+
}
|
|
901
919
|
});
|
|
902
920
|
}
|
|
903
921
|
};
|
|
@@ -913,9 +931,11 @@ export default function CodeBlock($$anchor, $$props) {
|
|
|
913
931
|
var consequent_9 = ($$anchor) => {
|
|
914
932
|
{
|
|
915
933
|
let $0 = $.derived(() => parts()?.ExpandButton?.emphasis ?? "muted");
|
|
916
|
-
let $1 = $.derived(() =>
|
|
934
|
+
let $1 = $.derived(() => localeContext.t("codeBlock.fullscreen"));
|
|
935
|
+
let $2 = $.derived(() => localeContext.t("codeBlock.exitFullscreen"));
|
|
936
|
+
let $3 = $.derived(() => $.get(hasCustomExpandIcon) ? normalizeActionSnippet(expandIconSnippet) : undefined);
|
|
917
937
|
|
|
918
|
-
let $
|
|
938
|
+
let $4 = $.derived(() => $.get(hasCustomCollapseIcon)
|
|
919
939
|
? normalizeActionSnippet(collapseIconSnippet)
|
|
920
940
|
: undefined);
|
|
921
941
|
|
|
@@ -928,15 +948,20 @@ export default function CodeBlock($$anchor, $$props) {
|
|
|
928
948
|
return $.get($0);
|
|
929
949
|
},
|
|
930
950
|
class: 'snowui-code-block-btn',
|
|
931
|
-
ariaLabel
|
|
932
|
-
|
|
951
|
+
get ariaLabel() {
|
|
952
|
+
return $.get($1);
|
|
953
|
+
},
|
|
954
|
+
|
|
955
|
+
get collapseAriaLabel() {
|
|
956
|
+
return $.get($2);
|
|
957
|
+
},
|
|
933
958
|
onclick: toggleFullscreen,
|
|
934
959
|
get icon() {
|
|
935
|
-
return $.get($
|
|
960
|
+
return $.get($3);
|
|
936
961
|
},
|
|
937
962
|
|
|
938
963
|
get collapseIcon() {
|
|
939
|
-
return $.get($
|
|
964
|
+
return $.get($4);
|
|
940
965
|
}
|
|
941
966
|
});
|
|
942
967
|
}
|
|
@@ -1022,20 +1047,26 @@ export default function CodeBlock($$anchor, $$props) {
|
|
|
1022
1047
|
|
|
1023
1048
|
var node_13 = $.sibling(div_8, 2);
|
|
1024
1049
|
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1050
|
+
{
|
|
1051
|
+
let $0 = $.derived(() => localeContext.t("codeBlock.resize"));
|
|
1052
|
+
|
|
1053
|
+
Indicator(node_13, {
|
|
1054
|
+
get target() {
|
|
1055
|
+
return $.get(hostElement);
|
|
1056
|
+
},
|
|
1057
|
+
|
|
1058
|
+
get revealTarget() {
|
|
1059
|
+
return $.get(hostElement);
|
|
1060
|
+
},
|
|
1061
|
+
appearance: 'corner',
|
|
1062
|
+
applySize: false,
|
|
1063
|
+
minSize: 60,
|
|
1064
|
+
get ariaLabel() {
|
|
1065
|
+
return $.get($0);
|
|
1066
|
+
},
|
|
1067
|
+
onSizeChange: handleResizeSize
|
|
1068
|
+
});
|
|
1069
|
+
}
|
|
1039
1070
|
|
|
1040
1071
|
$.template_effect(
|
|
1041
1072
|
($0) => {
|
|
@@ -1069,7 +1100,17 @@ export default function CodeBlock($$anchor, $$props) {
|
|
|
1069
1100
|
var div_12 = root_15();
|
|
1070
1101
|
var node_15 = $.child(div_12);
|
|
1071
1102
|
|
|
1072
|
-
|
|
1103
|
+
ComponentPartsBoundary(node_15, {
|
|
1104
|
+
children: ($$anchor, $$slotProps) => {
|
|
1105
|
+
var fragment_11 = $.comment();
|
|
1106
|
+
var node_16 = $.first_child(fragment_11);
|
|
1107
|
+
|
|
1108
|
+
$.snippet(node_16, () => $$props.children);
|
|
1109
|
+
$.append($$anchor, fragment_11);
|
|
1110
|
+
},
|
|
1111
|
+
$$slots: { default: true }
|
|
1112
|
+
});
|
|
1113
|
+
|
|
1073
1114
|
$.reset(div_12);
|
|
1074
1115
|
$.append($$anchor, div_12);
|
|
1075
1116
|
};
|
|
@@ -1091,228 +1132,244 @@ export default function CodeBlock($$anchor, $$props) {
|
|
|
1091
1132
|
}));
|
|
1092
1133
|
}
|
|
1093
1134
|
|
|
1094
|
-
var
|
|
1135
|
+
var node_17 = $.sibling(node_3, 2);
|
|
1095
1136
|
|
|
1096
1137
|
{
|
|
1097
1138
|
var consequent_17 = ($$anchor) => {
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
{
|
|
1128
|
-
var
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
$.reset(span_12);
|
|
1133
|
-
$.template_effect(() => $.set_text(text_4, language()));
|
|
1134
|
-
$.append($$anchor, span_12);
|
|
1135
|
-
};
|
|
1136
|
-
|
|
1137
|
-
$.if(node_17, ($$render) => {
|
|
1138
|
-
if (showLanguage() && language()) $$render(consequent_12);
|
|
1139
|
-
});
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
var div_14 = $.sibling(node_17, 2);
|
|
1143
|
-
var node_18 = $.child(div_14);
|
|
1144
|
-
|
|
1145
|
-
{
|
|
1146
|
-
var consequent_13 = ($$anchor) => {
|
|
1147
|
-
var span_13 = root_6();
|
|
1148
|
-
|
|
1149
|
-
$.html(span_13, () => $.get(customTrailingHtml), true);
|
|
1150
|
-
$.reset(span_13);
|
|
1151
|
-
$.append($$anchor, span_13);
|
|
1152
|
-
};
|
|
1153
|
-
|
|
1154
|
-
var consequent_14 = ($$anchor) => {
|
|
1155
|
-
{
|
|
1156
|
-
let $0 = $.derived(() => parts()?.CopyButton?.emphasis ?? "muted");
|
|
1157
|
-
let $1 = $.derived(() => $.get(hasCustomCopyIcon) ? normalizeActionSnippet(copyIconSnippet) : undefined);
|
|
1158
|
-
let $2 = $.derived(() => $.get(hasCustomCopiedIcon) ? normalizeActionSnippet(copiedIconSnippet) : undefined);
|
|
1159
|
-
|
|
1160
|
-
CopyButton($$anchor, {
|
|
1161
|
-
get text() {
|
|
1162
|
-
return $.get(resolvedCode);
|
|
1163
|
-
},
|
|
1164
|
-
bare: true,
|
|
1165
|
-
get emphasis() {
|
|
1166
|
-
return $.get($0);
|
|
1167
|
-
},
|
|
1168
|
-
showText: false,
|
|
1169
|
-
get feedbackDuration() {
|
|
1170
|
-
return copyTimeout();
|
|
1171
|
-
},
|
|
1172
|
-
|
|
1173
|
-
get icon() {
|
|
1174
|
-
return $.get($1);
|
|
1175
|
-
},
|
|
1176
|
-
|
|
1177
|
-
get successIcon() {
|
|
1178
|
-
return $.get($2);
|
|
1179
|
-
},
|
|
1180
|
-
class: 'snowui-code-block-btn snowui-hoverable',
|
|
1181
|
-
ariaLabel: '复制代码'
|
|
1182
|
-
});
|
|
1183
|
-
}
|
|
1184
|
-
};
|
|
1139
|
+
{
|
|
1140
|
+
let $0 = $.derived(() => localeContext.t("codeBlock.fullscreenDialog"));
|
|
1141
|
+
|
|
1142
|
+
Frame($$anchor, {
|
|
1143
|
+
get componentParts() {
|
|
1144
|
+
return parts();
|
|
1145
|
+
},
|
|
1146
|
+
tag: 'div',
|
|
1147
|
+
role: 'dialog',
|
|
1148
|
+
'aria-modal': 'true',
|
|
1149
|
+
get 'aria-label'() {
|
|
1150
|
+
return $.get($0);
|
|
1151
|
+
},
|
|
1152
|
+
enableResponsive: false,
|
|
1153
|
+
enableContext: false,
|
|
1154
|
+
enableScaleObserver: false,
|
|
1155
|
+
class: 'snowui-code-block-fullscreen snowui-overlay-scrollbar-host',
|
|
1156
|
+
get style() {
|
|
1157
|
+
return $.get(fullscreenBackgroundStyle);
|
|
1158
|
+
},
|
|
1159
|
+
tabindex: -1,
|
|
1160
|
+
get element() {
|
|
1161
|
+
return $.get(fullscreenElement);
|
|
1162
|
+
},
|
|
1163
|
+
|
|
1164
|
+
set element($$value) {
|
|
1165
|
+
$.set(fullscreenElement, $$value, true);
|
|
1166
|
+
},
|
|
1167
|
+
|
|
1168
|
+
children: ($$anchor, $$slotProps) => {
|
|
1169
|
+
var fragment_13 = root_17();
|
|
1170
|
+
var div_13 = $.first_child(fragment_13);
|
|
1171
|
+
var node_18 = $.child(div_13);
|
|
1185
1172
|
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
var node_19 = $.sibling(node_18, 2);
|
|
1192
|
-
|
|
1193
|
-
{
|
|
1194
|
-
var consequent_15 = ($$anchor) => {
|
|
1195
|
-
{
|
|
1196
|
-
let $0 = $.derived(() => parts()?.ExpandButton?.emphasis ?? "muted");
|
|
1197
|
-
|
|
1198
|
-
let $1 = $.derived(() => $.get(hasCustomCollapseIcon)
|
|
1199
|
-
? normalizeActionSnippet(collapseIconSnippet)
|
|
1200
|
-
: undefined);
|
|
1201
|
-
|
|
1202
|
-
ExpandButton($$anchor, {
|
|
1203
|
-
expanded: true,
|
|
1204
|
-
bare: true,
|
|
1205
|
-
get emphasis() {
|
|
1206
|
-
return $.get($0);
|
|
1207
|
-
},
|
|
1208
|
-
class: 'snowui-code-block-btn',
|
|
1209
|
-
ariaLabel: '全屏查看',
|
|
1210
|
-
collapseAriaLabel: '退出全屏',
|
|
1211
|
-
onclick: exitFullscreen,
|
|
1212
|
-
get collapseIcon() {
|
|
1213
|
-
return $.get($1);
|
|
1214
|
-
}
|
|
1215
|
-
});
|
|
1216
|
-
}
|
|
1217
|
-
};
|
|
1173
|
+
{
|
|
1174
|
+
var consequent_12 = ($$anchor) => {
|
|
1175
|
+
var span_12 = root_9();
|
|
1176
|
+
var text_4 = $.child(span_12, true);
|
|
1218
1177
|
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1178
|
+
$.reset(span_12);
|
|
1179
|
+
$.template_effect(() => $.set_text(text_4, language()));
|
|
1180
|
+
$.append($$anchor, span_12);
|
|
1181
|
+
};
|
|
1182
|
+
|
|
1183
|
+
$.if(node_18, ($$render) => {
|
|
1184
|
+
if (showLanguage() && language()) $$render(consequent_12);
|
|
1185
|
+
});
|
|
1186
|
+
}
|
|
1223
1187
|
|
|
1224
|
-
|
|
1225
|
-
|
|
1188
|
+
var div_14 = $.sibling(node_18, 2);
|
|
1189
|
+
var node_19 = $.child(div_14);
|
|
1226
1190
|
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1191
|
+
{
|
|
1192
|
+
var consequent_13 = ($$anchor) => {
|
|
1193
|
+
var span_13 = root_6();
|
|
1230
1194
|
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1195
|
+
$.html(span_13, () => $.get(customTrailingHtml), true);
|
|
1196
|
+
$.reset(span_13);
|
|
1197
|
+
$.append($$anchor, span_13);
|
|
1198
|
+
};
|
|
1199
|
+
|
|
1200
|
+
var consequent_14 = ($$anchor) => {
|
|
1201
|
+
{
|
|
1202
|
+
let $0 = $.derived(() => parts()?.CopyButton?.emphasis ?? "muted");
|
|
1203
|
+
let $1 = $.derived(() => $.get(hasCustomCopyIcon) ? normalizeActionSnippet(copyIconSnippet) : undefined);
|
|
1204
|
+
let $2 = $.derived(() => $.get(hasCustomCopiedIcon) ? normalizeActionSnippet(copiedIconSnippet) : undefined);
|
|
1205
|
+
let $3 = $.derived(() => localeContext.t("codeBlock.copyCode"));
|
|
1206
|
+
|
|
1207
|
+
CopyButton($$anchor, {
|
|
1208
|
+
get text() {
|
|
1209
|
+
return $.get(resolvedCode);
|
|
1210
|
+
},
|
|
1211
|
+
bare: true,
|
|
1212
|
+
get emphasis() {
|
|
1213
|
+
return $.get($0);
|
|
1214
|
+
},
|
|
1215
|
+
showText: false,
|
|
1216
|
+
get feedbackDuration() {
|
|
1217
|
+
return copyTimeout();
|
|
1218
|
+
},
|
|
1234
1219
|
|
|
1235
|
-
|
|
1236
|
-
|
|
1220
|
+
get icon() {
|
|
1221
|
+
return $.get($1);
|
|
1222
|
+
},
|
|
1237
1223
|
|
|
1238
|
-
|
|
1239
|
-
|
|
1224
|
+
get successIcon() {
|
|
1225
|
+
return $.get($2);
|
|
1226
|
+
},
|
|
1227
|
+
class: 'snowui-code-block-btn snowui-hoverable',
|
|
1228
|
+
get ariaLabel() {
|
|
1229
|
+
return $.get($3);
|
|
1230
|
+
}
|
|
1231
|
+
});
|
|
1232
|
+
}
|
|
1233
|
+
};
|
|
1234
|
+
|
|
1235
|
+
$.if(node_19, ($$render) => {
|
|
1236
|
+
if ($.get(hasCustomTrailing)) $$render(consequent_13); else if (showCopyButton()) $$render(consequent_14, 1);
|
|
1240
1237
|
});
|
|
1238
|
+
}
|
|
1241
1239
|
|
|
1242
|
-
|
|
1243
|
-
$.append($$anchor, div_17);
|
|
1244
|
-
};
|
|
1240
|
+
var node_20 = $.sibling(node_19, 2);
|
|
1245
1241
|
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1242
|
+
{
|
|
1243
|
+
var consequent_15 = ($$anchor) => {
|
|
1244
|
+
{
|
|
1245
|
+
let $0 = $.derived(() => parts()?.ExpandButton?.emphasis ?? "muted");
|
|
1246
|
+
let $1 = $.derived(() => localeContext.t("codeBlock.fullscreen"));
|
|
1247
|
+
let $2 = $.derived(() => localeContext.t("codeBlock.exitFullscreen"));
|
|
1248
|
+
|
|
1249
|
+
let $3 = $.derived(() => $.get(hasCustomCollapseIcon)
|
|
1250
|
+
? normalizeActionSnippet(collapseIconSnippet)
|
|
1251
|
+
: undefined);
|
|
1252
|
+
|
|
1253
|
+
ExpandButton($$anchor, {
|
|
1254
|
+
expanded: true,
|
|
1255
|
+
bare: true,
|
|
1256
|
+
get emphasis() {
|
|
1257
|
+
return $.get($0);
|
|
1258
|
+
},
|
|
1259
|
+
class: 'snowui-code-block-btn',
|
|
1260
|
+
get ariaLabel() {
|
|
1261
|
+
return $.get($1);
|
|
1262
|
+
},
|
|
1250
1263
|
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1264
|
+
get collapseAriaLabel() {
|
|
1265
|
+
return $.get($2);
|
|
1266
|
+
},
|
|
1267
|
+
onclick: exitFullscreen,
|
|
1268
|
+
get collapseIcon() {
|
|
1269
|
+
return $.get($3);
|
|
1270
|
+
}
|
|
1271
|
+
});
|
|
1272
|
+
}
|
|
1273
|
+
};
|
|
1254
1274
|
|
|
1255
|
-
|
|
1256
|
-
|
|
1275
|
+
$.if(node_20, ($$render) => {
|
|
1276
|
+
if (showExpandButton()) $$render(consequent_15);
|
|
1277
|
+
});
|
|
1278
|
+
}
|
|
1257
1279
|
|
|
1258
|
-
$.
|
|
1259
|
-
|
|
1260
|
-
var text_5 = $.child(span_16, true);
|
|
1280
|
+
$.reset(div_14);
|
|
1281
|
+
$.reset(div_13);
|
|
1261
1282
|
|
|
1262
|
-
|
|
1283
|
+
var div_15 = $.sibling(div_13, 2);
|
|
1284
|
+
var div_16 = $.child(div_15);
|
|
1285
|
+
var node_21 = $.child(div_16);
|
|
1263
1286
|
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1287
|
+
{
|
|
1288
|
+
var consequent_16 = ($$anchor) => {
|
|
1289
|
+
var div_17 = root_12();
|
|
1290
|
+
|
|
1291
|
+
$.each(div_17, 21, () => $.get(lines), $.index, ($$anchor, _, i) => {
|
|
1292
|
+
var span_14 = root_11();
|
|
1293
|
+
|
|
1294
|
+
span_14.textContent = i + 1;
|
|
1295
|
+
$.append($$anchor, span_14);
|
|
1296
|
+
});
|
|
1297
|
+
|
|
1298
|
+
$.reset(div_17);
|
|
1299
|
+
$.append($$anchor, div_17);
|
|
1300
|
+
};
|
|
1301
|
+
|
|
1302
|
+
$.if(node_21, ($$render) => {
|
|
1303
|
+
if (showLineNumbers() && $.get(lines).length > 0) $$render(consequent_16);
|
|
1304
|
+
});
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
var div_18 = $.sibling(node_21, 2);
|
|
1308
|
+
var pre_2 = $.child(div_18);
|
|
1309
|
+
var code_3 = $.child(pre_2);
|
|
1310
|
+
|
|
1311
|
+
$.each(code_3, 21, () => $.get(highlightedLines), $.index, ($$anchor, line) => {
|
|
1312
|
+
var span_15 = root_13();
|
|
1313
|
+
|
|
1314
|
+
$.each(span_15, 21, () => $.get(line), $.index, ($$anchor, token) => {
|
|
1315
|
+
var span_16 = root_5();
|
|
1316
|
+
var text_5 = $.child(span_16, true);
|
|
1317
|
+
|
|
1318
|
+
$.reset(span_16);
|
|
1319
|
+
|
|
1320
|
+
$.template_effect(() => {
|
|
1321
|
+
$.set_class(span_16, 1, `snowui-code-block-token snowui-code-block-token-${$.get(token).kind}`);
|
|
1322
|
+
$.set_text(text_5, $.get(token).text);
|
|
1323
|
+
});
|
|
1324
|
+
|
|
1325
|
+
$.append($$anchor, span_16);
|
|
1267
1326
|
});
|
|
1268
1327
|
|
|
1269
|
-
$.
|
|
1328
|
+
$.reset(span_15);
|
|
1329
|
+
$.append($$anchor, span_15);
|
|
1270
1330
|
});
|
|
1271
1331
|
|
|
1272
|
-
$.reset(
|
|
1273
|
-
$.
|
|
1274
|
-
|
|
1332
|
+
$.reset(code_3);
|
|
1333
|
+
$.reset(pre_2);
|
|
1334
|
+
$.reset(div_18);
|
|
1335
|
+
$.reset(div_16);
|
|
1336
|
+
$.bind_this(div_16, ($$value) => $.set(fullscreenViewportElement, $$value), () => $.get(fullscreenViewportElement));
|
|
1337
|
+
$.reset(div_15);
|
|
1275
1338
|
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
);
|
|
1308
|
-
|
|
1309
|
-
$.append($$anchor, fragment_12);
|
|
1310
|
-
},
|
|
1311
|
-
$$slots: { default: true }
|
|
1312
|
-
});
|
|
1339
|
+
var div_19 = $.sibling(div_15, 2);
|
|
1340
|
+
var div_20 = $.child(div_19);
|
|
1341
|
+
|
|
1342
|
+
$.reset(div_19);
|
|
1343
|
+
$.bind_this(div_19, ($$value) => $.set(fullscreenScrollbarElement, $$value), () => $.get(fullscreenScrollbarElement));
|
|
1344
|
+
|
|
1345
|
+
var div_21 = $.sibling(div_19, 2);
|
|
1346
|
+
var div_22 = $.child(div_21);
|
|
1347
|
+
|
|
1348
|
+
$.reset(div_21);
|
|
1349
|
+
$.bind_this(div_21, ($$value) => $.set(fullscreenHorizontalScrollbarElement, $$value), () => $.get(fullscreenHorizontalScrollbarElement));
|
|
1350
|
+
|
|
1351
|
+
$.template_effect(
|
|
1352
|
+
($0) => {
|
|
1353
|
+
$.set_attribute(div_16, 'data-scroll-mask', $0);
|
|
1354
|
+
$.set_attribute(div_19, 'data-visible', fullscreenScrollbar.hasOverflow ? "true" : undefined);
|
|
1355
|
+
$.set_style(div_20, `height: ${fullscreenScrollbar.thumbHeight ?? ''}px; transform: translate3d(0, ${fullscreenScrollbar.thumbY ?? ''}px, 0);`);
|
|
1356
|
+
$.set_attribute(div_21, 'data-visibility', horizontalScrollbarVisibility());
|
|
1357
|
+
$.set_attribute(div_21, 'data-visible', fullscreenHorizontalScrollbar.hasOverflow ? "true" : undefined);
|
|
1358
|
+
$.set_style(div_22, `width: ${fullscreenHorizontalScrollbar.thumbSize ?? ''}px; transform: translate3d(${fullscreenHorizontalScrollbar.thumbOffset ?? ''}px, 0, 0);`);
|
|
1359
|
+
},
|
|
1360
|
+
[
|
|
1361
|
+
() => resolveScrollMask($.get(showFullscreenTopFade), $.get(showFullscreenBottomFade))
|
|
1362
|
+
]
|
|
1363
|
+
);
|
|
1364
|
+
|
|
1365
|
+
$.append($$anchor, fragment_13);
|
|
1366
|
+
},
|
|
1367
|
+
$$slots: { default: true }
|
|
1368
|
+
});
|
|
1369
|
+
}
|
|
1313
1370
|
};
|
|
1314
1371
|
|
|
1315
|
-
$.if(
|
|
1372
|
+
$.if(node_17, ($$render) => {
|
|
1316
1373
|
if (!$.get(isSingleLine) && ($.get(isFullscreen) || $.get(isExitingFullscreen))) $$render(consequent_17);
|
|
1317
1374
|
});
|
|
1318
1375
|
}
|