@mkbabb/glass-ui 3.1.1 → 3.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/dist/{CardFooter-CSGcJkqa.js → CardFooter-C390imy7.js} +3 -3
- package/dist/{CollapsibleContent-CVMOcYlV.js → CollapsibleContent-cauTbZEM.js} +1 -1
- package/dist/{CommandShortcut-DWT19a2Y.js → CommandShortcut-BiVyqipe.js} +7 -6
- package/dist/{ContextMenuSubContent-gAFxJ-qi.js → ContextMenuSubContent-DrWkXKQP.js} +4 -4
- package/dist/DataTable-FfkaAg2z.js +465 -0
- package/dist/DialogContent-IQ8_BRrC.js +100 -0
- package/dist/{DialogFooter-ClrNEOVU.js → DialogFooter-Er0wA3K6.js} +2 -2
- package/dist/{DiscoGlyph-C3JfMnRV.js → DiscoGlyph-BaZ8OawK.js} +1 -1
- package/dist/{GlyphFace-BRS8vUb7.js → GlyphFace-B_7vOmYn.js} +1 -1
- package/dist/HoverPopover-DTSYkJtw.js +96 -0
- package/dist/{IconTooltip-BkaA7tZ2.js → IconTooltip-BTyYn4mr.js} +1 -1
- package/dist/Input-CU9CNKmo.js +52 -0
- package/dist/{MetricBadge-DmAihkXd.js → MetricBadge-BlrdbOGN.js} +2 -2
- package/dist/{Notification-OqIpADml.js → Notification-DP_ApJLo.js} +3 -3
- package/dist/{NumberFieldContent-DTH9gb_N.js → NumberFieldContent-iOTQ5rGO.js} +9 -5
- package/dist/{PopoverContent-EiklFrna.js → PopoverContent-B8WtJECb.js} +1 -1
- package/dist/Progress-DjM86vfb.js +254 -0
- package/dist/{ScrollingText-BFd0i2zJ.js → ScrollingText-P9o_DuMn.js} +2 -2
- package/dist/{SelectScrollDownButton-Dth8-wXQ.js → SelectScrollDownButton-BGn3rjs9.js} +12 -11
- package/dist/TabsIndicator-DA0x9gPr.js +97 -0
- package/dist/{Toaster-Bjlunvq4.js → Toaster-DdhMKfus.js} +1 -1
- package/dist/{ToggleGroupItem-OesUouE7.js → ToggleGroupItem-gyXj998A.js} +37 -40
- package/dist/UnderlineTabs-Cq_AD03t.js +39 -0
- package/dist/animated-digit.js +3 -3
- package/dist/api/index.d.ts +2 -0
- package/dist/api.js +1 -1
- package/dist/aurora.js +471 -320
- package/dist/badge.js +1 -1
- package/dist/{button-C0aHmBbt.js → button-Ckn3eDfB.js} +27 -22
- package/dist/button.js +1 -1
- package/dist/card.js +1 -1
- package/dist/carousel.js +6 -6
- package/dist/{check-dwgetki8.js → check-CdkxGxXJ.js} +1 -1
- package/dist/{chevron-down-DILQA1t6.js → chevron-down-pBY8sYfV.js} +1 -1
- package/dist/{chevron-right-fS7fal2t.js → chevron-right-BjeKC22V.js} +1 -1
- package/dist/{chevron-up-BtYjYQOS.js → chevron-up-DBeNHUm1.js} +1 -1
- package/dist/collapsible.js +1 -1
- package/dist/color-rkK4RMx2.js +33 -0
- package/dist/color.d.ts +1 -0
- package/dist/color.js +2 -0
- package/dist/command.js +1 -1
- package/dist/compile-DVgAxagk.js +106 -0
- package/dist/components/custom/animated-digit/AnimatedDigit.vue.d.ts +7 -7
- package/dist/components/custom/aurora/Aurora.vue.d.ts +3 -3
- package/dist/components/custom/aurora/composables/color.d.ts +42 -16
- package/dist/components/custom/aurora/composables/cursorModel.d.ts +45 -0
- package/dist/components/custom/aurora/composables/frameLoop.d.ts +30 -0
- package/dist/components/custom/aurora/composables/glSetup.d.ts +29 -0
- package/dist/components/custom/aurora/composables/runtime.d.ts +45 -35
- package/dist/components/custom/aurora/composables/uniformBridge.d.ts +67 -0
- package/dist/components/custom/aurora/composables/useAurora.d.ts +14 -1
- package/dist/components/custom/aurora/composables/useCursorInteraction.d.ts +1 -1
- package/dist/components/custom/aurora/constants/budget.d.ts +50 -0
- package/dist/components/custom/aurora/{presets.d.ts → constants/presets.d.ts} +3 -6
- package/dist/components/custom/aurora/constants/shaders/aurora.frag.d.ts +1 -0
- package/dist/components/custom/aurora/constants/shaders/brush.glsl.d.ts +1 -0
- package/dist/components/custom/aurora/constants/shaders/composition.glsl.d.ts +1 -0
- package/dist/components/custom/aurora/constants/shaders/flow.glsl.d.ts +1 -0
- package/dist/components/custom/aurora/constants/shaders/mediums.glsl.d.ts +2 -0
- package/dist/components/custom/aurora/constants/shaders/tonemap.glsl.d.ts +1 -0
- package/dist/components/custom/aurora/index.d.ts +4 -3
- package/dist/components/custom/configurator/Configurator.vue.d.ts +26 -0
- package/dist/components/custom/configurator/ConfiguratorLayer.vue.d.ts +14 -7
- package/dist/components/custom/configurator/density.d.ts +3 -8
- package/dist/components/custom/configurator/index.d.ts +1 -1
- package/dist/components/custom/dock/DockBackgroundToggle.vue.d.ts +46 -0
- package/dist/components/custom/dock/DockIconButton.vue.d.ts +15 -4
- package/dist/components/custom/dock/DockLayerGroup.vue.d.ts +2 -2
- package/dist/components/custom/dock/GlassDock.vue.d.ts +34 -13
- package/dist/components/custom/dock/composables/dockContext.d.ts +4 -4
- package/dist/components/custom/dock/composables/dockLayerContext.d.ts +13 -6
- package/dist/components/custom/dock/composables/useLayerTransition.d.ts +32 -8
- package/dist/components/custom/dock/index.d.ts +1 -0
- package/dist/components/custom/expandable-container/ExpandableContainer.vue.d.ts +10 -0
- package/dist/components/custom/glass-panel/GlassPanel.vue.d.ts +1 -1
- package/dist/components/custom/glyph-face/keys.d.ts +3 -29
- package/dist/components/custom/goo-blob/GooBlob.vue.d.ts +48 -0
- package/dist/components/custom/goo-blob/composables/easing.d.ts +6 -0
- package/dist/components/custom/goo-blob/composables/useBlobMood.d.ts +14 -0
- package/dist/components/custom/goo-blob/composables/useBlobPointer.d.ts +18 -0
- package/dist/components/custom/goo-blob/composables/useBlobSatellites.d.ts +13 -0
- package/dist/components/custom/goo-blob/composables/useMetaballRenderer.d.ts +42 -0
- package/dist/components/custom/goo-blob/index.d.ts +7 -0
- package/dist/components/custom/goo-blob/shaders/metaball.frag.d.ts +1 -0
- package/dist/components/custom/goo-blob/shaders/metaball.vert.d.ts +1 -0
- package/dist/components/custom/goo-blob/shaders/oklch-perturb.glsl.d.ts +1 -0
- package/dist/components/custom/goo-blob/shaders/sdf-body.glsl.d.ts +1 -0
- package/dist/components/custom/goo-blob/shaders/watercolor-edges.glsl.d.ts +2 -0
- package/dist/components/custom/goo-blob/types.d.ts +77 -0
- package/dist/components/custom/hover-popover/HoverPopover.vue.d.ts +48 -9
- package/dist/components/custom/labeled-field/LabeledField.vue.d.ts +2 -0
- package/dist/components/custom/labeled-field/LabeledSelect.vue.d.ts +2 -2
- package/dist/components/custom/metric-stack/MetricRow.vue.d.ts +2 -2
- package/dist/components/custom/responsive-tabs/ResponsiveTabs.vue.d.ts +13 -7
- package/dist/components/custom/search/FuzzySearch.vue.d.ts +1 -1
- package/dist/components/custom/search/SearchBar.vue.d.ts +1 -1
- package/dist/components/custom/sortable-list/SortableHandle.vue.d.ts +7 -1
- package/dist/components/custom/sortable-list/context.d.ts +2 -3
- package/dist/components/custom/tabs/BouncyTabs.vue.d.ts +6 -3
- package/dist/components/custom/tabs/BouncyToggle.vue.d.ts +7 -3
- package/dist/components/custom/tabs/UnderlineTabs.vue.d.ts +6 -3
- package/dist/components/custom/tabs/composables/useBouncySlider.d.ts +39 -0
- package/dist/components/custom/timeline/ContinuousMarkers.vue.d.ts +49 -0
- package/dist/components/custom/timeline/ContinuousRail.vue.d.ts +26 -0
- package/dist/components/custom/timeline/ContinuousTimeline.vue.d.ts +4 -4
- package/dist/components/custom/typewriter/TypewriterText.vue.d.ts +2 -2
- package/dist/components/custom/watercolor-dot/WatercolorDot.vue.d.ts +45 -0
- package/dist/components/custom/watercolor-dot/index.d.ts +3 -0
- package/dist/components/custom/watercolor-dot/prng.d.ts +5 -0
- package/dist/components/custom/watercolor-dot/useWatercolorBlob.d.ts +24 -0
- package/dist/components/ui/_shared/menuItemVariants.d.ts +1 -1
- package/dist/components/ui/avatar/Avatar.vue.d.ts +1 -1
- package/dist/components/ui/avatar/AvatarImage.vue.d.ts +5 -1
- package/dist/components/ui/avatar/index.d.ts +1 -1
- package/dist/components/ui/badge/index.d.ts +2 -2
- package/dist/components/ui/button/Button.vue.d.ts +3 -1
- package/dist/components/ui/button/index.d.ts +2 -2
- package/dist/components/ui/carousel/CarouselNext.vue.d.ts +2 -2
- package/dist/components/ui/carousel/CarouselPrevious.vue.d.ts +2 -2
- package/dist/components/ui/combobox/Combobox.vue.d.ts +2 -2
- package/dist/components/ui/combobox/ComboboxInput.vue.d.ts +2 -1
- package/dist/components/ui/command/Command.vue.d.ts +3 -3
- package/dist/components/ui/command/CommandInput.vue.d.ts +2 -1
- package/dist/components/ui/data-table/DataTable.vue.d.ts +5 -4
- package/dist/components/ui/dialog/DialogContent.vue.d.ts +8 -0
- package/dist/components/ui/drawer/Drawer.vue.d.ts +4 -4
- package/dist/components/ui/input/Input.vue.d.ts +19 -1
- package/dist/components/ui/multi-select/MultiSelect.vue.d.ts +8 -4
- package/dist/components/ui/progress/Progress.vue.d.ts +26 -88
- package/dist/components/ui/progress/ProgressDefault.vue.d.ts +14 -0
- package/dist/components/ui/progress/ProgressGradient.vue.d.ts +25 -0
- package/dist/components/ui/progress/ProgressSectioned.vue.d.ts +36 -0
- package/dist/components/ui/progress/index.d.ts +5 -2
- package/dist/components/ui/progress/useProgressGeometry.d.ts +60 -0
- package/dist/components/ui/select/Select.vue.d.ts +2 -2
- package/dist/components/ui/select/SelectContent.vue.d.ts +1 -1
- package/dist/components/ui/select/SelectTrigger.vue.d.ts +3 -0
- package/dist/components/ui/sheet/index.d.ts +1 -1
- package/dist/components/ui/slider/index.d.ts +12 -11
- package/dist/components/ui/tags-input/TagsInput.vue.d.ts +2 -2
- package/dist/components/ui/textarea/Textarea.vue.d.ts +5 -1
- package/dist/components/ui/toast/Toast.vue.d.ts +4 -4
- package/dist/components/ui/toggle/Toggle.vue.d.ts +1 -1
- package/dist/components/ui/toggle/index.d.ts +1 -1
- package/dist/components/ui/toggle-group/toggleGroupContext.d.ts +2 -3
- package/dist/composables/color/index.d.ts +49 -0
- package/dist/composables/context/createContext.d.ts +56 -0
- package/dist/composables/context/index.d.ts +1 -0
- package/dist/composables/dark/darkModeSyncScript.d.ts +23 -0
- package/dist/composables/dark/index.d.ts +3 -0
- package/dist/composables/dark/useGlobalDark.d.ts +19 -2
- package/dist/composables/dom/index.d.ts +1 -3
- package/dist/composables/dom/useClipboard.d.ts +35 -12
- package/dist/composables/dom/useDocumentVisibility.d.ts +20 -0
- package/dist/composables/dom/useTextHighlight.d.ts +40 -0
- package/dist/composables/glass/webgl/compile.d.ts +15 -0
- package/dist/composables/glass/webgl/shaders/procedural-color.glsl.d.ts +3 -0
- package/dist/composables/glass/webgl/useWebGLCanvas.d.ts +55 -0
- package/dist/composables/motion/core/index.d.ts +2 -1
- package/dist/composables/motion/index.d.ts +1 -1
- package/dist/composables/motion/useCountup.d.ts +29 -0
- package/dist/composables/motion/usePrioritizedTask.d.ts +41 -0
- package/dist/composables/motion/vReveal.d.ts +2 -0
- package/dist/composables/sidebar/useSidebarState.d.ts +2 -2
- package/dist/composables/sortable/dragController.d.ts +44 -0
- package/dist/composables/sortable/dropResolver.d.ts +34 -0
- package/dist/composables/sortable/ghostRenderer.d.ts +44 -0
- package/dist/composables/sortable/index.d.ts +1 -1
- package/dist/composables/sortable/touchGate.d.ts +26 -0
- package/dist/composables/sortable/transitionTiming.d.ts +50 -0
- package/dist/composables/sortable/types.d.ts +133 -0
- package/dist/composables/sortable/useSortable.d.ts +25 -140
- package/dist/configurator.js +1 -1
- package/dist/confirm-dialog.js +3 -3
- package/dist/context-menu.js +2 -2
- package/dist/controls.js +5 -5
- package/dist/createContext-DBMGRlx4.js +25 -0
- package/dist/dark.d.ts +2 -1
- package/dist/dark.js +9 -2
- package/dist/data-table.js +1 -1
- package/dist/dialog.js +2 -2
- package/dist/disco-glyph.js +1 -1
- package/dist/dock.js +410 -254
- package/dist/dockContext-spUj_-E5.js +9 -0
- package/dist/dom.js +6 -5
- package/dist/{dropdown-menu-BvRUamNs.js → dropdown-menu-EFjl5iKo.js} +4 -4
- package/dist/dropdown-menu.js +1 -1
- package/dist/expandable-container.js +28 -22
- package/dist/fonts/README.md +21 -0
- package/dist/fonts/fraunces/fraunces-latin.woff2 +0 -0
- package/dist/forms.js +70 -61
- package/dist/glass-carousel.js +59 -52
- package/dist/glass-panel.js +2 -2
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +159 -254
- package/dist/glyph-face.js +2 -2
- package/dist/goo-blob.d.ts +1 -0
- package/dist/goo-blob.js +538 -0
- package/dist/header-ribbon.js +3 -3
- package/dist/hover-card.js +1 -1
- package/dist/hover-popover.js +1 -1
- package/dist/icon-tooltip.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/instrument-chassis.js +1 -1
- package/dist/instrument-rail.js +1 -1
- package/dist/keyboard.js +1 -1
- package/dist/keys-BFoma9vm.js +9 -0
- package/dist/label.js +1 -1
- package/dist/labeled-field.js +57 -39
- package/dist/metric-badge.js +1 -1
- package/dist/metric-stack.js +1 -1
- package/dist/{minimize-2-LsCJ_eNt.js → minimize-2-BP27-qBY.js} +1 -1
- package/dist/motion-core.js +154 -135
- package/dist/motion.js +63 -15
- package/dist/notification.js +1 -1
- package/dist/number-field.js +1 -1
- package/dist/paper-backdrop.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/{presets-a-D93K1S.js → presets-1OhFpaIC.js} +5 -5
- package/dist/prng-Bz_1Tydc.js +15 -0
- package/dist/progress.js +2 -2
- package/dist/pulse.js +1 -1
- package/dist/reactive.js +2 -2
- package/dist/responsive-tabs.js +38 -32
- package/dist/scrolling-text.js +1 -1
- package/dist/{search-DBAiUABx.js → search-DBG8qaRs.js} +1 -1
- package/dist/search.js +153 -149
- package/dist/select.js +3 -3
- package/dist/separator.js +1 -1
- package/dist/{sheet-CukNDezz.js → sheet-CQYYrkr9.js} +3 -3
- package/dist/sheet.js +1 -1
- package/dist/{slider-DJvHkTRe.js → slider-BOh8ycfZ.js} +8 -12
- package/dist/slider.js +1 -1
- package/dist/sortable-list.js +37 -39
- package/dist/stacked-icons.js +2 -2
- package/dist/styles/animations.css +1 -1
- package/dist/styles/cards.css +1 -1
- package/dist/styles/components.css +45 -0
- package/dist/styles/dock-controls.css +486 -0
- package/dist/styles/dock.css +325 -431
- package/dist/styles/fonts.css +25 -0
- package/dist/styles/glass-specular-track.css +154 -0
- package/dist/styles/glass.css +74 -2
- package/dist/styles/index.css +25 -2
- package/dist/styles/instrument-chassis.css +11 -4
- package/dist/styles/theme.css +73 -21
- package/dist/styles/tokens.css +282 -140
- package/dist/styles/typography.css +14 -8
- package/dist/styles/utilities.css +92 -8
- package/dist/styles/view-transition.css +10 -4
- package/dist/switch.js +1 -1
- package/dist/tabs.js +148 -106
- package/dist/timeline.js +220 -159
- package/dist/toast.js +1 -1
- package/dist/toggle-group.js +1 -1
- package/dist/tokens.d.ts +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/{useAnimatedNumber-DKQYVB7s.js → useAnimatedNumber-BF6r64lA.js} +1 -1
- package/dist/useClipboard-D8vFyRCa.js +97 -0
- package/dist/useConfiguratorState-DUtC1jxr.js +276 -0
- package/dist/useGlobalDark-CWiaCoEw.js +34 -0
- package/dist/useIntersectionPause-DAdVPVp4.js +53 -0
- package/dist/useSortable-DnyGXKKY.js +246 -0
- package/dist/useTextHighlight-Dmtofpk2.js +72 -0
- package/dist/{useTouchGate-D9Zvrzyc.js → useTouchGate-CS5Csc2h.js} +1 -1
- package/dist/{useViewTransition-DYIK6Gzb.js → useViewTransition-D4ssvnXZ.js} +5 -3
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/platformSupport.d.ts +8 -0
- package/dist/utils/prng.d.ts +4 -0
- package/dist/vReveal-u2wSG2El.js +35 -0
- package/dist/watercolor-dot.d.ts +1 -0
- package/dist/watercolor-dot.js +129 -0
- package/dist/{x-q7pJa83X.js → x-C4pz9nbD.js} +1 -1
- package/package.json +110 -16
- package/src/fonts/README.md +21 -0
- package/src/fonts/fraunces/fraunces-latin.woff2 +0 -0
- package/src/styles/animations.css +1 -1
- package/src/styles/cards.css +1 -1
- package/src/styles/dock-controls.css +486 -0
- package/src/styles/dock.css +325 -431
- package/src/styles/fonts.css +25 -0
- package/src/styles/glass-specular-track.css +154 -0
- package/src/styles/glass.css +74 -2
- package/src/styles/index.css +21 -2
- package/src/styles/instrument-chassis.css +11 -4
- package/src/styles/theme.css +73 -21
- package/src/styles/tokens.css +282 -140
- package/src/styles/typography.css +14 -8
- package/src/styles/utilities.css +92 -8
- package/src/styles/view-transition.css +10 -4
- package/dist/DataTable-R8-Zidms.js +0 -460
- package/dist/DialogContent-2fALDSvc.js +0 -93
- package/dist/HoverPopover-CWFCfLx3.js +0 -96
- package/dist/Input-DDpFn568.js +0 -30
- package/dist/Progress-FApA9fm_.js +0 -126
- package/dist/UnderlineTabs-DAWMLmJG.js +0 -37
- package/dist/components/custom/aurora/shaders/aurora.frag.d.ts +0 -1
- package/dist/composables/dom/useBreakpoint.d.ts +0 -38
- package/dist/composables/dom/useIdleReady.d.ts +0 -63
- package/dist/composables/dom/useViewportReady.d.ts +0 -87
- package/dist/composables/glass/webgl/frostShader.d.ts +0 -27
- package/dist/composables/motion/useAnimatedNumberMap.d.ts +0 -29
- package/dist/composables/motion/useStagger.d.ts +0 -50
- package/dist/dockContext-D5NZCWJs.js +0 -16
- package/dist/keys-CaTQS-vx.js +0 -11
- package/dist/useConfiguratorState-CtRBE0m_.js +0 -268
- package/dist/useGlobalDark-B0WvLJE3.js +0 -24
- package/dist/useIdleReady-Cmkhm03v.js +0 -162
- package/dist/useIntersectionPause-IY2CwPQb.js +0 -39
- package/dist/useSortable-Cq2Y1JLO.js +0 -175
- /package/dist/{ContextMenuContent-otjFIu8v.js → ContextMenuContent-De01_83g.js} +0 -0
- /package/dist/{HoverCardContent-DaGrgJBO.js → HoverCardContent-ICfIMZX1.js} +0 -0
- /package/dist/{InstrumentChassis-CnHTMxds.js → InstrumentChassis-DaHIZCqy.js} +0 -0
- /package/dist/{InstrumentRail-C6dEbi8E.js → InstrumentRail-B0qqLFN0.js} +0 -0
- /package/dist/{Label-DJty89bp.js → Label-CZk-3nTc.js} +0 -0
- /package/dist/{ModalOverlay-iWiAgbYH.js → ModalOverlay-B_CBtqcE.js} +0 -0
- /package/dist/{PaperBackdrop-CeZ-w0R0.js → PaperBackdrop-D_YZW47j.js} +0 -0
- /package/dist/{SelectGroup-DdR4tdDY.js → SelectGroup-CMdoCjRE.js} +0 -0
- /package/dist/{SelectSeparator-CXm_hlqA.js → SelectSeparator-CaJnPF3_.js} +0 -0
- /package/dist/{Separator-D8AUMhxY.js → Separator-C2XtAXRp.js} +0 -0
- /package/dist/{Switch-Cr1t_F_U.js → Switch-x8n6husW.js} +0 -0
- /package/dist/{TooltipProvider-DE78vbEP.js → TooltipProvider-D-JrSqDu.js} +0 -0
- /package/dist/{_plugin-vue_export-helper-Dq1MygBL.js → _plugin-vue_export-helper-C1je1s0u.js} +0 -0
- /package/dist/{badge-x46my_Fo.js → badge-Cl6JZ1B7.js} +0 -0
- /package/dist/components/custom/aurora/{renderMode.d.ts → constants/renderMode.d.ts} +0 -0
- /package/dist/components/custom/aurora/{shaders → constants/shaders}/aurora.vert.d.ts +0 -0
- /package/dist/{constants-DwBwnG8N.js → constants-DsCdlK9I.js} +0 -0
- /package/dist/{createLucideIcon-Bn9a1b70.js → createLucideIcon-DuDoe_ra.js} +0 -0
- /package/dist/{menuItemVariants-BsbGNq9C.js → menuItemVariants-C2QlXqT3.js} +0 -0
- /package/dist/{useGlassRenderer-Ds-nmrGz.js → useGlassRenderer-Dn3WpfG-.js} +0 -0
- /package/dist/{useInterval-DVgGUf_y.js → useInterval-CHVYFpXV.js} +0 -0
- /package/dist/{useKeyboardShortcuts-Dpw_RUcB.js → useKeyboardShortcuts-BQfnAHHW.js} +0 -0
- /package/dist/{useResizeObserver-Cg9npuM3.js → useResizeObserver-DX-STszm.js} +0 -0
- /package/dist/{useSpringMount-Cfk1XK1R.js → useSpringMount-CnizvZGm.js} +0 -0
- /package/dist/{useTimer-NAaj9zNq.js → useTimer-DGgoxTXL.js} +0 -0
- /package/dist/{useUserInvalidAria-DVu1eTXG.js → useUserInvalidAria-DmvZ_6Dx.js} +0 -0
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./cn-DJXf4yaB.js";
|
|
2
|
-
import { t } from "./x-q7pJa83X.js";
|
|
3
|
-
import { t as n } from "./useSpringMount-Cfk1XK1R.js";
|
|
4
|
-
import { t as r } from "./ModalOverlay-iWiAgbYH.js";
|
|
5
|
-
import { computed as i, createBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, guardReactiveProps as l, mergeProps as u, normalizeProps as d, openBlock as f, renderSlot as p, unref as m, withCtx as h } from "vue";
|
|
6
|
-
import { DialogClose as g, DialogContent as _, DialogPortal as v, DialogRoot as y, injectDialogRootContext as b, useForwardPropsEmits as x } from "reka-ui";
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/components/ui/dialog/Dialog.vue
|
|
9
|
-
var S = /* @__PURE__ */ c({
|
|
10
|
-
__name: "Dialog",
|
|
11
|
-
props: {
|
|
12
|
-
open: { type: Boolean },
|
|
13
|
-
defaultOpen: { type: Boolean },
|
|
14
|
-
modal: { type: Boolean }
|
|
15
|
-
},
|
|
16
|
-
emits: ["update:open"],
|
|
17
|
-
setup(e, { emit: t }) {
|
|
18
|
-
let n = x(e, t);
|
|
19
|
-
return (e, t) => (f(), a(m(y), d(l(m(n))), {
|
|
20
|
-
default: h(() => [p(e.$slots, "default")]),
|
|
21
|
-
_: 3
|
|
22
|
-
}, 16));
|
|
23
|
-
}
|
|
24
|
-
}), C = "fixed left-1/2 top-1/2 z-modal grid w-full max-w-lg gap-4 p-6", w = "-translate-x-1/2 -translate-y-1/2 duration-[var(--duration-normal)] popover-animate", T = /* @__PURE__ */ c({
|
|
25
|
-
__name: "DialogContent",
|
|
26
|
-
props: {
|
|
27
|
-
forceMount: { type: Boolean },
|
|
28
|
-
disableOutsidePointerEvents: { type: Boolean },
|
|
29
|
-
asChild: { type: Boolean },
|
|
30
|
-
as: {},
|
|
31
|
-
class: { type: [
|
|
32
|
-
Boolean,
|
|
33
|
-
null,
|
|
34
|
-
String,
|
|
35
|
-
Object,
|
|
36
|
-
Array
|
|
37
|
-
] },
|
|
38
|
-
variant: { default: "glass" },
|
|
39
|
-
scrimAnimation: {},
|
|
40
|
-
spring: { type: [Boolean, String] }
|
|
41
|
-
},
|
|
42
|
-
emits: [
|
|
43
|
-
"escapeKeyDown",
|
|
44
|
-
"pointerDownOutside",
|
|
45
|
-
"focusOutside",
|
|
46
|
-
"interactOutside",
|
|
47
|
-
"openAutoFocus",
|
|
48
|
-
"closeAutoFocus"
|
|
49
|
-
],
|
|
50
|
-
setup(c, { emit: l }) {
|
|
51
|
-
let d = c, y = l, S = x(i(() => {
|
|
52
|
-
let { class: e, variant: t, scrimAnimation: n, spring: r, ...i } = d;
|
|
53
|
-
return i;
|
|
54
|
-
}), y), T = i(() => d.variant === "opaque" ? "bg-background border sm:rounded-dialog" : "glass-floating rounded-dialog"), E = d.spring ? b() : null, D = d.spring && E ? n({
|
|
55
|
-
open: E.open,
|
|
56
|
-
preset: typeof d.spring == "string" ? d.spring : "smooth"
|
|
57
|
-
}) : null, O = i(() => {
|
|
58
|
-
if (!D) return;
|
|
59
|
-
let e = D.position.value;
|
|
60
|
-
return {
|
|
61
|
-
transform: `translate(-50%, -50%) scale(${1 - .05 * e})`,
|
|
62
|
-
opacity: String(1 - e),
|
|
63
|
-
animation: "none",
|
|
64
|
-
transition: "none"
|
|
65
|
-
};
|
|
66
|
-
});
|
|
67
|
-
return (n, i) => (f(), a(m(v), null, {
|
|
68
|
-
default: h(() => [s(r, {
|
|
69
|
-
scrim: "glass",
|
|
70
|
-
animate: "fade",
|
|
71
|
-
layout: "centered",
|
|
72
|
-
"scrim-animation": d.scrimAnimation
|
|
73
|
-
}, null, 8, ["scrim-animation"]), s(m(_), u(m(S), {
|
|
74
|
-
class: m(e)(C, d.spring ? "" : w, T.value, d.class),
|
|
75
|
-
style: O.value,
|
|
76
|
-
"data-spring": d.spring ? typeof d.spring == "string" ? d.spring : "smooth" : void 0
|
|
77
|
-
}), {
|
|
78
|
-
default: h(() => [p(n.$slots, "default"), s(m(g), { class: "focus-ring absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground" }, {
|
|
79
|
-
default: h(() => [s(m(t), { class: "w-4 h-4" }), i[0] ||= o("span", { class: "sr-only" }, "Close", -1)]),
|
|
80
|
-
_: 1
|
|
81
|
-
})]),
|
|
82
|
-
_: 3
|
|
83
|
-
}, 16, [
|
|
84
|
-
"class",
|
|
85
|
-
"style",
|
|
86
|
-
"data-spring"
|
|
87
|
-
])]),
|
|
88
|
-
_: 3
|
|
89
|
-
}));
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
//#endregion
|
|
93
|
-
export { S as n, T as t };
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./cn-DJXf4yaB.js";
|
|
2
|
-
import { i as t } from "./dockContext-D5NZCWJs.js";
|
|
3
|
-
import { Fragment as n, computed as r, createBlock as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, mergeProps as l, openBlock as u, ref as d, renderSlot as f, toDisplayString as p, unref as m, useId as h, watch as g, withCtx as _ } from "vue";
|
|
4
|
-
import { HoverCardContent as v, HoverCardPortal as y, HoverCardRoot as b, HoverCardTrigger as x } from "reka-ui";
|
|
5
|
-
//#region src/components/custom/hover-popover/HoverPopover.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var S = { class: "hover-popover-label" }, C = { class: "hover-popover-label" }, w = /* @__PURE__ */ c({
|
|
7
|
-
__name: "HoverPopover",
|
|
8
|
-
props: {
|
|
9
|
-
content: {},
|
|
10
|
-
open: { type: Boolean },
|
|
11
|
-
side: { default: "top" },
|
|
12
|
-
align: { default: "center" },
|
|
13
|
-
hoverOpenDelay: { default: 250 },
|
|
14
|
-
closeDelay: { default: 150 },
|
|
15
|
-
sideOffset: { default: 6 },
|
|
16
|
-
class: { type: [
|
|
17
|
-
Boolean,
|
|
18
|
-
null,
|
|
19
|
-
String,
|
|
20
|
-
Object,
|
|
21
|
-
Array
|
|
22
|
-
] },
|
|
23
|
-
keepDockOpen: {
|
|
24
|
-
type: Boolean,
|
|
25
|
-
default: !1
|
|
26
|
-
},
|
|
27
|
-
native: {
|
|
28
|
-
type: Boolean,
|
|
29
|
-
default: !1
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
emits: ["update:open"],
|
|
33
|
-
setup(c, { emit: w }) {
|
|
34
|
-
let T = w, E = c, D = r(() => e("z-popover hover-popover-panel popover-animate", E.class)), O = typeof HTMLButtonElement < "u" && "interestForElement" in HTMLButtonElement.prototype, k = r(() => E.native && O), A = `gl-hover-popover-${h() ?? "0"}`, j = d(E.open ?? !1);
|
|
35
|
-
g(() => E.open, (e) => {
|
|
36
|
-
typeof e == "boolean" && e !== j.value && (j.value = e);
|
|
37
|
-
}), g(j, (e) => {
|
|
38
|
-
T("update:open", e);
|
|
39
|
-
});
|
|
40
|
-
function M(e) {
|
|
41
|
-
let t = e.newState === "open";
|
|
42
|
-
t !== j.value && (j.value = t);
|
|
43
|
-
}
|
|
44
|
-
let N = t(), P = !1;
|
|
45
|
-
g(j, (e) => {
|
|
46
|
-
E.keepDockOpen && (e && !P ? (N?.keepOpen(), P = !0) : !e && P && (N?.release(), P = !1));
|
|
47
|
-
});
|
|
48
|
-
let F = r(() => E.keepDockOpen && N?.id ? {
|
|
49
|
-
"data-glass-dock-portal": "",
|
|
50
|
-
"data-glass-dock-owner": N.id
|
|
51
|
-
} : {});
|
|
52
|
-
return (t, r) => k.value ? (u(), a(n, { key: 0 }, [o("span", {
|
|
53
|
-
class: "hover-popover-native-trigger",
|
|
54
|
-
interestfor: A
|
|
55
|
-
}, [f(t.$slots, "trigger", {}, () => [f(t.$slots, "default")])]), o("div", l({
|
|
56
|
-
id: A,
|
|
57
|
-
popover: "hint",
|
|
58
|
-
class: m(e)("glass-top-layer hover-popover-panel", E.class)
|
|
59
|
-
}, F.value, { onToggle: M }), [f(t.$slots, "content", {}, () => [o("span", S, p(c.content), 1)])], 16)], 64)) : (u(), i(m(b), {
|
|
60
|
-
key: 1,
|
|
61
|
-
open: j.value,
|
|
62
|
-
"onUpdate:open": r[0] ||= (e) => j.value = e,
|
|
63
|
-
"open-delay": c.hoverOpenDelay,
|
|
64
|
-
"close-delay": c.closeDelay
|
|
65
|
-
}, {
|
|
66
|
-
default: _(() => [s(m(x), { "as-child": "" }, {
|
|
67
|
-
default: _(() => [f(t.$slots, "trigger", {}, () => [f(t.$slots, "default")])]),
|
|
68
|
-
_: 3
|
|
69
|
-
}), s(m(y), null, {
|
|
70
|
-
default: _(() => [s(m(v), l({
|
|
71
|
-
side: c.side,
|
|
72
|
-
align: c.align,
|
|
73
|
-
"side-offset": c.sideOffset,
|
|
74
|
-
"avoid-collisions": !0,
|
|
75
|
-
class: D.value
|
|
76
|
-
}, F.value), {
|
|
77
|
-
default: _(() => [f(t.$slots, "content", {}, () => [o("span", C, p(c.content), 1)])]),
|
|
78
|
-
_: 3
|
|
79
|
-
}, 16, [
|
|
80
|
-
"side",
|
|
81
|
-
"align",
|
|
82
|
-
"side-offset",
|
|
83
|
-
"class"
|
|
84
|
-
])]),
|
|
85
|
-
_: 3
|
|
86
|
-
})]),
|
|
87
|
-
_: 3
|
|
88
|
-
}, 8, [
|
|
89
|
-
"open",
|
|
90
|
-
"open-delay",
|
|
91
|
-
"close-delay"
|
|
92
|
-
]));
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
//#endregion
|
|
96
|
-
export { w as t };
|
package/dist/Input-DDpFn568.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./cn-DJXf4yaB.js";
|
|
2
|
-
import { createElementBlock as t, defineComponent as n, isRef as r, mergeProps as i, openBlock as a, unref as o, vModelDynamic as s, withDirectives as c } from "vue";
|
|
3
|
-
import { useVModel as l } from "@vueuse/core";
|
|
4
|
-
//#endregion
|
|
5
|
-
//#region src/components/ui/input/Input.vue
|
|
6
|
-
var u = /* @__PURE__ */ n({
|
|
7
|
-
inheritAttrs: !1,
|
|
8
|
-
__name: "Input",
|
|
9
|
-
props: {
|
|
10
|
-
defaultValue: {},
|
|
11
|
-
modelValue: {},
|
|
12
|
-
class: { type: [
|
|
13
|
-
Boolean,
|
|
14
|
-
null,
|
|
15
|
-
String,
|
|
16
|
-
Object,
|
|
17
|
-
Array
|
|
18
|
-
] }
|
|
19
|
-
},
|
|
20
|
-
emits: ["update:modelValue"],
|
|
21
|
-
setup(n, { emit: u }) {
|
|
22
|
-
let d = n, f = l(d, "modelValue", u, {
|
|
23
|
-
passive: !0,
|
|
24
|
-
defaultValue: d.defaultValue
|
|
25
|
-
});
|
|
26
|
-
return (n, l) => c((a(), t("input", i({ "onUpdate:modelValue": l[0] ||= (e) => r(f) ? f.value = e : null }, n.$attrs, { class: o(e)("input-pill text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium", d.class) }), null, 16)), [[s, o(f)]]);
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
//#endregion
|
|
30
|
-
export { u as t };
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./cn-DJXf4yaB.js";
|
|
2
|
-
import { t } from "./_plugin-vue_export-helper-Dq1MygBL.js";
|
|
3
|
-
import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, mergeProps as u, normalizeClass as d, normalizeStyle as f, openBlock as p, renderList as m, unref as h, withCtx as g } from "vue";
|
|
4
|
-
import { ProgressIndicator as _, ProgressRoot as v } from "reka-ui";
|
|
5
|
-
//#region src/components/ui/progress/Progress.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var y = ["data-state", "data-index"], b = {
|
|
7
|
-
key: 0,
|
|
8
|
-
class: "progress-sectioned-sweep",
|
|
9
|
-
"aria-hidden": "true"
|
|
10
|
-
}, x = /* @__PURE__ */ t(/* @__PURE__ */ l({
|
|
11
|
-
__name: "Progress",
|
|
12
|
-
props: {
|
|
13
|
-
modelValue: { default: 0 },
|
|
14
|
-
max: {},
|
|
15
|
-
getValueLabel: {},
|
|
16
|
-
getValueText: {},
|
|
17
|
-
asChild: { type: Boolean },
|
|
18
|
-
as: {},
|
|
19
|
-
class: { type: [
|
|
20
|
-
Boolean,
|
|
21
|
-
null,
|
|
22
|
-
String,
|
|
23
|
-
Object,
|
|
24
|
-
Array
|
|
25
|
-
] },
|
|
26
|
-
variant: { default: "default" },
|
|
27
|
-
segments: { default: () => [] },
|
|
28
|
-
currentSegmentKey: { default: null },
|
|
29
|
-
activeProgress: { default: 0 },
|
|
30
|
-
indeterminate: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
default: !1
|
|
33
|
-
},
|
|
34
|
-
disableCrescendo: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
default: !1
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
setup(t) {
|
|
40
|
-
let l = t, x = r(() => {
|
|
41
|
-
let { class: e, variant: t, segments: n, currentSegmentKey: r, activeProgress: i, indeterminate: a, disableCrescendo: o, ...s } = l;
|
|
42
|
-
return s;
|
|
43
|
-
}), S = r(() => {
|
|
44
|
-
if (l.variant === "sectioned" || l.indeterminate) return "idle";
|
|
45
|
-
let e = l.modelValue ?? 0;
|
|
46
|
-
return e <= 0 ? "idle" : e >= 100 ? "complete" : e < 5 ? "loading" : "progressing";
|
|
47
|
-
}), C = r(() => {
|
|
48
|
-
if (l.variant !== "gradient" || l.indeterminate) return;
|
|
49
|
-
if (l.disableCrescendo) return { "--progress-crescendo": "0%" };
|
|
50
|
-
let e = l.modelValue ?? 0;
|
|
51
|
-
if (e < 85) return { "--progress-crescendo": "0%" };
|
|
52
|
-
let t = (e - 85) / 15 * 100;
|
|
53
|
-
return { "--progress-crescendo": `${Math.min(100, Math.max(0, t))}%` };
|
|
54
|
-
}), w = r(() => l.variant === "sectioned" ? "relative h-[var(--progress-sectioned-height,0.875rem)] w-full overflow-hidden rounded-pill progress-sectioned-rail" : l.variant === "gradient" ? "relative h-4 w-full overflow-hidden rounded-pill bg-[var(--progress-track,theme(colors.secondary.DEFAULT))] progress-gradient-rail" : "relative h-4 w-full overflow-hidden rounded-pill bg-secondary"), T = r(() => l.variant === "sectioned" ? "absolute inset-0 pointer-events-none opacity-0" : l.variant === "gradient" ? "h-full w-full flex-1 rounded-pill [background:var(--progress-fill,theme(colors.primary.DEFAULT))] transition-transform" : "h-full w-full flex-1 rounded-pill bg-primary transition-transform"), E = r(() => {
|
|
55
|
-
if (l.variant !== "sectioned" || l.segments.length === 0) return [];
|
|
56
|
-
let e = l.segments.map((e) => e.weight ?? 1), t = e.reduce((e, t) => e + t, 0) || 1, n = l.segments.findIndex((e) => e.key === l.currentSegmentKey), r = 0;
|
|
57
|
-
return l.segments.map((i, a) => {
|
|
58
|
-
let o = e[a] / t * 100, s = r, c = r + o;
|
|
59
|
-
r = c;
|
|
60
|
-
let u;
|
|
61
|
-
u = i.state ? i.state : n < 0 ? "pending" : a < n ? "completed" : a === n ? "active" : "pending";
|
|
62
|
-
let d = u === "completed" ? 1 : u === "active" ? Math.max(0, Math.min(1, l.activeProgress)) : 0;
|
|
63
|
-
return {
|
|
64
|
-
...i,
|
|
65
|
-
startPct: s,
|
|
66
|
-
endPct: c,
|
|
67
|
-
widthPct: o,
|
|
68
|
-
resolvedState: u,
|
|
69
|
-
fill: d
|
|
70
|
-
};
|
|
71
|
-
});
|
|
72
|
-
}), D = r(() => {
|
|
73
|
-
if (l.variant !== "sectioned" || E.value.length === 0) return l.modelValue ?? 0;
|
|
74
|
-
let e = 0;
|
|
75
|
-
for (let t of E.value) e += t.fill * t.widthPct;
|
|
76
|
-
return Math.max(0, Math.min(100, e));
|
|
77
|
-
}), O = r(() => l.variant === "sectioned" ? D.value : l.modelValue ?? 0);
|
|
78
|
-
return (r, D) => (p(), i(h(v), u(x.value, {
|
|
79
|
-
"model-value": O.value,
|
|
80
|
-
class: h(e)(w.value, l.class),
|
|
81
|
-
"data-lifecycle": S.value,
|
|
82
|
-
"data-indeterminate": t.indeterminate || void 0,
|
|
83
|
-
"data-crescendo": t.disableCrescendo ? "disabled" : void 0
|
|
84
|
-
}), {
|
|
85
|
-
default: g(() => [c(h(_), {
|
|
86
|
-
class: d(T.value),
|
|
87
|
-
style: f(t.variant === "sectioned" ? void 0 : {
|
|
88
|
-
transform: `translateX(-${100 - (l.modelValue ?? 0)}%)`,
|
|
89
|
-
...C.value ?? {}
|
|
90
|
-
})
|
|
91
|
-
}, null, 8, ["class", "style"]), t.variant === "sectioned" ? (p(), o(n, { key: 0 }, [(p(!0), o(n, null, m(E.value, (e, t) => (p(), o("div", {
|
|
92
|
-
key: e.key,
|
|
93
|
-
class: "progress-sectioned-cell",
|
|
94
|
-
"data-state": e.resolvedState,
|
|
95
|
-
"data-index": t,
|
|
96
|
-
style: f({
|
|
97
|
-
left: e.startPct + "%",
|
|
98
|
-
width: e.widthPct + "%",
|
|
99
|
-
"--cell-color": e.color,
|
|
100
|
-
"--cell-fill": e.fill
|
|
101
|
-
})
|
|
102
|
-
}, [s("span", {
|
|
103
|
-
class: "progress-sectioned-fill",
|
|
104
|
-
style: f({ width: e.fill * 100 + "%" })
|
|
105
|
-
}, null, 4), e.resolvedState === "active" ? (p(), o("span", b)) : a("", !0)], 12, y))), 128)), (p(!0), o(n, null, m(E.value, (e, t) => (p(), o(n, { key: `seam-${e.key}` }, [t < E.value.length - 1 ? (p(), o("span", {
|
|
106
|
-
key: 0,
|
|
107
|
-
class: "progress-sectioned-seam",
|
|
108
|
-
style: f({
|
|
109
|
-
left: e.endPct + "%",
|
|
110
|
-
"--seam-from": e.color,
|
|
111
|
-
"--seam-to": E.value[t + 1].color
|
|
112
|
-
}),
|
|
113
|
-
"aria-hidden": "true"
|
|
114
|
-
}, null, 4)) : a("", !0)], 64))), 128))], 64)) : a("", !0)]),
|
|
115
|
-
_: 1
|
|
116
|
-
}, 16, [
|
|
117
|
-
"model-value",
|
|
118
|
-
"class",
|
|
119
|
-
"data-lifecycle",
|
|
120
|
-
"data-indeterminate",
|
|
121
|
-
"data-crescendo"
|
|
122
|
-
]));
|
|
123
|
-
}
|
|
124
|
-
}), [["__scopeId", "data-v-ca211071"]]);
|
|
125
|
-
//#endregion
|
|
126
|
-
export { x as t };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./cn-DJXf4yaB.js";
|
|
2
|
-
import { t } from "./_plugin-vue_export-helper-Dq1MygBL.js";
|
|
3
|
-
import { Fragment as n, createElementBlock as r, defineComponent as i, normalizeClass as a, openBlock as o, renderList as s, toDisplayString as c, unref as l } from "vue";
|
|
4
|
-
//#region src/components/custom/tabs/UnderlineTabs.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var u = ["aria-selected", "onClick"], d = /* @__PURE__ */ t(/* @__PURE__ */ i({
|
|
6
|
-
__name: "UnderlineTabs",
|
|
7
|
-
props: {
|
|
8
|
-
options: {},
|
|
9
|
-
modelValue: {},
|
|
10
|
-
class: { type: [
|
|
11
|
-
Boolean,
|
|
12
|
-
null,
|
|
13
|
-
String,
|
|
14
|
-
Object,
|
|
15
|
-
Array
|
|
16
|
-
] }
|
|
17
|
-
},
|
|
18
|
-
emits: ["update:modelValue"],
|
|
19
|
-
setup(t, { emit: i }) {
|
|
20
|
-
let d = t, f = i;
|
|
21
|
-
function p(e) {
|
|
22
|
-
f("update:modelValue", e);
|
|
23
|
-
}
|
|
24
|
-
return (i, f) => (o(), r("div", {
|
|
25
|
-
role: "tablist",
|
|
26
|
-
class: a(l(e)("underline-tabs", d.class))
|
|
27
|
-
}, [(o(!0), r(n, null, s(t.options, (e) => (o(), r("button", {
|
|
28
|
-
key: e.value,
|
|
29
|
-
class: "underline-tab",
|
|
30
|
-
role: "tab",
|
|
31
|
-
"aria-selected": t.modelValue === e.value ? "true" : "false",
|
|
32
|
-
onClick: (t) => p(e.value)
|
|
33
|
-
}, c(e.label), 9, u))), 128))], 2));
|
|
34
|
-
}
|
|
35
|
-
}), [["__scopeId", "data-v-93401bfa"]]);
|
|
36
|
-
//#endregion
|
|
37
|
-
export { d as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const FRAGMENT_SRC = "#version 300 es\nprecision highp float;\n\nin vec2 vUv;\nout vec4 fragColor;\n\n#define MAX_NUCLEI 6\n#define MAX_STOPS 8\n\n// \u2500\u2500 Uniforms \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nuniform float uTime;\n\n// Palette baked CPU-side to linear-sRGB\nuniform vec3 uPalette[MAX_STOPS];\nuniform int uStopCount;\n\n// Nuclei (parallel arrays)\nuniform int uNucleiCount;\nuniform vec2 uNucleiPos[MAX_NUCLEI];\nuniform float uNucleiRadius[MAX_NUCLEI];\nuniform float uNucleiPaletteBias[MAX_NUCLEI];\nuniform float uNucleiValueBias[MAX_NUCLEI];\nuniform float uNucleiDriftRadius[MAX_NUCLEI];\nuniform float uNucleiDriftPhase[MAX_NUCLEI];\n// Anisotropy: per-nucleus elongation (1.0 = isotropic) and major-axis angle (radians).\n// Defaults (1.0 / 0.0) reduce to the original circular Gaussian.\nuniform float uNucleiElong[MAX_NUCLEI];\nuniform float uNucleiAngle[MAX_NUCLEI];\nuniform float uSoftmaxBeta;\nuniform float uValueVariance;\n\n// Warp\nuniform float uWarpAmount;\nuniform float uWarpScale;\nuniform float uWarpDrift;\nuniform int uWarpMode; // 0=fbm 1=cellular 2=hybrid\nuniform int uNoiseOctaves;\n\n// Medium\n// 0 smooth, 1 pastel, 2 watercolor, 3 oil\nuniform int uMedium;\nuniform int uFlowPattern; // 0 none, 1 radial, 2 swirl, 3 diagonal, 4 multi\nuniform vec2 uFlowFocal;\nuniform float uFlowAngle;\nuniform float uFlowCurl;\nuniform vec2 uCursor; // in 0..1 screen space (matches pN)\nuniform float uCursorStrength; // 0..1 attraction amount\nuniform float uCursorRadius; // radius of influence (0.05..0.5)\nuniform float uStrokeAmount;\nuniform float uStrokeScale;\nuniform float uStrokeAnisotropy;\nuniform int uStrokeLayers; // 1 or 2 (crosshatch)\nuniform int uStrokeMode; // 0 oil (modern gestural), 1 palette-knife, 2 crayon/oil-pastel, 3 modern-chunky\nuniform float uWetEdge;\nuniform float uGranulation;\nuniform float uImpasto;\nuniform float uBrokenColor;\nuniform float uCanvasGrain;\n\n// Motion\nuniform float uNucleiDrift;\nuniform float uPaletteDrift;\nuniform float uBreathDepth;\nuniform float uBreathPeriod;\n\n// Output\nuniform float uSaturation;\nuniform float uPaperGrain;\nuniform float uAlpha;\n\n// \u2500\u2500 Noise \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nfloat hash21(vec2 p) {\n p = fract(p * vec2(123.34, 456.21));\n p += dot(p, p + 45.32);\n return fract(p.x * p.y);\n}\n\nvec2 hash22(vec2 p) {\n p = vec2(dot(p, vec2(127.1, 311.7)),\n dot(p, vec2(269.5, 183.3)));\n return fract(sin(p) * 43758.5453);\n}\n\nfloat vnoise(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n vec2 u = f * f * (3.0 - 2.0 * f);\n float a = hash21(i);\n float b = hash21(i + vec2(1.0, 0.0));\n float c = hash21(i + vec2(0.0, 1.0));\n float d = hash21(i + vec2(1.0, 1.0));\n return mix(mix(a, b, u.x), mix(c, d, u.x), u.y);\n}\n\nfloat fbm(vec2 p) {\n float v = 0.0;\n float a = 0.5;\n mat2 r = mat2(0.8, 0.6, -0.6, 0.8);\n for (int i = 0; i < 5; i++) {\n if (i >= uNoiseOctaves) break;\n v += a * vnoise(p);\n p = r * p * 2.02;\n a *= 0.5;\n }\n return v;\n}\n\n// Cellular / Worley f1\nfloat cellular(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n float m = 1e9;\n for (int y = -1; y <= 1; y++) {\n for (int x = -1; x <= 1; x++) {\n vec2 g = vec2(float(x), float(y));\n vec2 o = hash22(i + g);\n vec2 r = g + o - f;\n m = min(m, dot(r, r));\n }\n }\n return sqrt(m);\n}\n\n// \u2500\u2500 Warp \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nvec2 domainWarp(vec2 p, float t) {\n // Quilez canonical double warp\n vec2 q = vec2(fbm(p * uWarpScale + vec2(0.0, 0.0) + t * uWarpDrift),\n fbm(p * uWarpScale + vec2(5.2, 1.3) + t * uWarpDrift));\n vec2 r = vec2(fbm(p * uWarpScale + 4.0 * q + vec2(1.7, 9.2)),\n fbm(p * uWarpScale + 4.0 * q + vec2(8.3, 2.8)));\n\n vec2 warp = r;\n if (uWarpMode == 1) {\n // cellular \u2014 chunky territories (MEADOW block-like)\n float c1 = cellular(p * uWarpScale * 1.5 + vec2(t * uWarpDrift * 2.0, 0.0));\n float c2 = cellular(p * uWarpScale * 1.5 + vec2(11.0, 7.0 + t * uWarpDrift * 2.0));\n warp = vec2(c1, c2);\n } else if (uWarpMode == 2) {\n // hybrid \u2014 fbm + cellular averaged\n float c1 = cellular(p * uWarpScale * 1.2);\n float c2 = cellular(p * uWarpScale * 1.2 + vec2(11.0, 7.0));\n warp = mix(r, vec2(c1, c2), 0.5);\n }\n vec2 warped = p + uWarpAmount * warp;\n\n // Cursor swirl \u2014 rotate p around uCursor with radial falloff.\n // This warps the underlying color field so the bands sweep around the pointer.\n if (uCursorStrength > 0.001) {\n vec2 toP = p - uCursor;\n float d = length(toP);\n float r = max(uCursorRadius, 0.01);\n // Smooth falloff; strong near cursor, zero beyond ~1.5\u00D7 radius.\n float w = exp(-(d * d) / (r * r * 0.45));\n // Max rotation ~120\u00B0 at cursor center, scaled by strength\n float ang = w * uCursorStrength * 2.1;\n float ca = cos(ang), sa = sin(ang);\n vec2 rotated = vec2(ca * toP.x - sa * toP.y, sa * toP.x + ca * toP.y) + uCursor;\n // Also pinch slightly toward the cursor (gravity) \u2014 adds depth to swirl\n float pinch = w * uCursorStrength * 0.08;\n rotated = mix(rotated, uCursor, pinch);\n // Blend original warped position with cursor-rotated version\n warped = mix(warped, rotated + uWarpAmount * warp * 0.7, w * uCursorStrength);\n }\n\n return warped;\n}\n\n// \u2500\u2500 Palette LUT \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nvec3 samplePalette(float id) {\n id = clamp(id, 0.0, 1.0);\n float scaled = id * float(uStopCount - 1);\n int i0 = int(floor(scaled));\n int i1 = min(i0 + 1, uStopCount - 1);\n float t = fract(scaled);\n t = smoothstep(0.0, 1.0, t);\n return mix(uPalette[i0], uPalette[i1], t);\n}\n\n// \u2500\u2500 Nuclei field \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nvoid nucleiField(vec2 p, float t, out float paletteId, out float valueMod) {\n float accumBias = 0.0;\n float accumValue = 0.0;\n float accumW = 0.0;\n for (int i = 0; i < MAX_NUCLEI; i++) {\n if (i >= uNucleiCount) break;\n vec2 posI = uNucleiPos[i]\n + uNucleiDriftRadius[i] * vec2(\n cos(t * uNucleiDrift + uNucleiDriftPhase[i]),\n sin(t * uNucleiDrift + uNucleiDriftPhase[i] * 1.13)\n );\n vec2 diff = p - posI;\n // Anisotropic Gaussian: rotate diff into the nucleus's local frame\n // (major axis along uNucleiAngle), then scale the major-axis component by\n // 1/elongation so the squared distance describes an ellipse. Defaults\n // 1.0/0.0 reduce to the isotropic dot(diff, diff).\n float ca = cos(uNucleiAngle[i]);\n float sa = sin(uNucleiAngle[i]);\n vec2 local = vec2( ca * diff.x + sa * diff.y,\n -sa * diff.x + ca * diff.y);\n float along = local.x / max(uNucleiElong[i], 0.01);\n float across = local.y;\n float d2 = along * along + across * across;\n float r = max(uNucleiRadius[i], 0.01);\n float w = exp(-uSoftmaxBeta * d2 / (r * r));\n accumBias += w * uNucleiPaletteBias[i];\n accumValue += w * uNucleiValueBias[i];\n accumW += w;\n }\n paletteId = accumBias / max(accumW, 1e-4);\n valueMod = accumValue / max(accumW, 1e-4);\n\n // Palette drift \u2014 subtle global paletteId shift\n paletteId += 0.04 * sin(t * uPaletteDrift * 6.2831) * uPaletteDrift * 20.0;\n paletteId = clamp(paletteId, 0.0, 1.0);\n}\n\n// \u2500\u2500 Flow field \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nvec2 flowField(vec2 p, float t) {\n vec2 dir = vec2(1.0, 0.0);\n if (uFlowPattern == 1) {\n // radial\n dir = normalize(p - uFlowFocal + 1e-4);\n } else if (uFlowPattern == 2) {\n // swirl \u2014 tangent to radial\n vec2 rad = normalize(p - uFlowFocal + 1e-4);\n dir = vec2(-rad.y, rad.x);\n } else if (uFlowPattern == 3) {\n // diagonal\n float a = radians(uFlowAngle);\n dir = vec2(cos(a), sin(a));\n } else if (uFlowPattern == 4) {\n // multi \u2014 curl-noise driven\n float n = fbm(p * 2.0 + t * 0.02);\n float a = n * 6.2831;\n dir = vec2(cos(a), sin(a));\n }\n // curl \u2014 perturb by noise. Radial gets much less curl so rays stay clean.\n if (uFlowCurl > 0.0) {\n float n = fbm(p * 3.0) - 0.5;\n float curlAmt = uFlowCurl;\n if (uFlowPattern == 1) curlAmt *= 0.25; // radial: preserve ray clarity\n if (uFlowPattern == 2) curlAmt *= 0.55; // swirl: allow moderate curl\n float a = atan(dir.y, dir.x) + n * 3.14159 * curlAmt;\n dir = vec2(cos(a), sin(a));\n }\n // cursor influence \u2014 swirl around the cursor position\n if (uCursorStrength > 0.001) {\n vec2 toCur = uCursor - p;\n float d = length(toCur);\n float r = max(uCursorRadius, 0.01);\n float w = exp(-(d * d) / (r * r * 0.5));\n // swirl tangent\n vec2 tangent = vec2(-toCur.y, toCur.x) / max(d, 1e-4);\n float a0 = atan(dir.y, dir.x);\n float a1 = atan(tangent.y, tangent.x);\n // blend angle\n float da = a1 - a0;\n da = atan(sin(da), cos(da)); // wrap to [-pi, pi]\n float a = a0 + da * w * uCursorStrength;\n dir = vec2(cos(a), sin(a));\n }\n return dir;\n}\n\n// \u2500\u2500 Color utils \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nconst vec3 W_LUMA = vec3(0.2126, 0.7152, 0.0722);\n\nvec3 hueShift(vec3 c, float degrees) {\n float a = radians(degrees);\n float co = cos(a), si = sin(a);\n mat3 m = mat3(\n 0.299 + 0.701 * co + 0.168 * si,\n 0.587 - 0.587 * co + 0.330 * si,\n 0.114 - 0.114 * co - 0.497 * si,\n\n 0.299 - 0.299 * co - 0.328 * si,\n 0.587 + 0.413 * co + 0.035 * si,\n 0.114 - 0.114 * co + 0.292 * si,\n\n 0.299 - 0.300 * co + 1.250 * si,\n 0.587 - 0.588 * co - 1.050 * si,\n 0.114 + 0.886 * co - 0.203 * si\n );\n return m * c;\n}\n\nvec3 brokenColorJitter(vec3 c, float hueSeed, float valueSeed, float strength) {\n float amt = clamp(uBrokenColor * strength, 0.0, 1.0);\n if (amt <= 0.001) return c;\n float hueDeg = (hueSeed - 0.5) * 32.0 * amt;\n float valueMul = 1.0 + (valueSeed - 0.5) * 0.28 * amt;\n return max(hueShift(c, hueDeg) * valueMul, vec3(0.0));\n}\n\nvec3 saturate3(vec3 c, float amt) {\n float l = dot(c, W_LUMA);\n return mix(vec3(l), c, amt);\n}\n\n// ACES approximation\nvec3 aces(vec3 x) {\n float a = 2.51;\n float b = 0.03;\n float c = 2.43;\n float d = 0.59;\n float e = 0.14;\n return clamp((x * (a * x + b)) / (x * (c * x + d) + e), 0.0, 1.0);\n}\n\n// \u2500\u2500 Medium overlays \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n// A quick re-computation of base color for edge-mask sampling\nvec3 sampleBase(vec2 p, float t) {\n vec2 pw = domainWarp(p, t);\n float id; float vm;\n nucleiField(pw, t, id, vm);\n vec3 c = samplePalette(id);\n c *= 1.0 + uValueVariance * vm;\n return c;\n}\n\nvec3 mediumWatercolor(vec3 col, vec2 p, float t) {\n // Wet-edge cauliflowers via luma-gradient magnitude\n float eps = 0.004;\n vec3 cx1 = sampleBase(p + vec2(eps, 0.0), t);\n vec3 cx2 = sampleBase(p - vec2(eps, 0.0), t);\n vec3 cy1 = sampleBase(p + vec2(0.0, eps), t);\n vec3 cy2 = sampleBase(p - vec2(0.0, eps), t);\n float gx = dot(cx1 - cx2, W_LUMA);\n float gy = dot(cy1 - cy2, W_LUMA);\n float edge = sqrt(gx * gx + gy * gy) / (2.0 * eps);\n float mask = smoothstep(0.0, 2.5, edge);\n col *= mix(1.0, 0.78, mask * uWetEdge);\n\n // Granulation \u2014 pigment settles in paper tooth\n float paper = 0.5 * vnoise(p * 160.0) + 0.5 * vnoise(p * 360.0);\n float pigLoad = 1.0 - dot(col, W_LUMA);\n col *= 1.0 - uGranulation * pigLoad * (paper - 0.5);\n\n // Wash banding \u2014 faint horizontal wet gradient\n float band = fbm(vec2(p.x * 1.5, p.y * 0.4));\n col *= 1.0 + 0.04 * (band - 0.5);\n return col;\n}\n\nvec3 mediumPastel(vec3 col, vec2 p, float t) {\n vec2 flow = flowField(p, t);\n vec2 perp = vec2(-flow.y, flow.x);\n float along = dot(p, flow) * uStrokeScale;\n float across = dot(p, perp) * uStrokeScale;\n across += 0.03 * (vnoise(p * 260.0) - 0.5);\n\n float aniso = mix(1.0, 0.18, uStrokeAnisotropy);\n float stroke = fbm(vec2(along * aniso, across));\n col *= mix(1.0, 0.82 + 0.32 * stroke, uStrokeAmount);\n\n // Pastel tooth \u2014 tiny high-frequency grain\n float tooth = vnoise(p * 800.0);\n col *= 1.0 - 0.08 * uStrokeAmount * (tooth - 0.5);\n return col;\n}\n\n// \u2500\u2500 Curved swept brushstroke primitive \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// A stroke is a curved spine from A to B with quadratic bulge K (sideways offset\n// at midpoint). Width varies along length via a shape profile. Edge is ragged\n// (bristle-modulated), ends are rounded blobs, inside has streak modulation.\n//\n// For pixel p, we invert an approximate projection onto the curved spine:\n// 1) project p onto straight AB axis -> along0, cross0\n// 2) at parameter along0, spine offset = 4\u00B7K\u00B7along0\u00B7(1-along0) perpendicular\n// 3) cross = cross0 - spineOffset, refine along one iteration\n// Coverage blends paint atop col based on per-stroke color sampled from the\n// underlying base at spine midpoint \u2014 so overlapping strokes from different\n// palette regions meet at hard, ragged demarcations.\n\nstruct StrokeHit {\n float coverage; // 0..1\n vec3 color;\n float alongT; // 0..1 along spine, for internal modulation\n float crossN; // cross distance / current half-width, signed\n float edgeN; // distance to edge in half-widths (0 = at edge, 1 = at spine)\n};\n\nStrokeHit noHit() { return StrokeHit(0.0, vec3(0.0), 0.0, 0.0, 0.0); }\n\nvec2 rotateDir(vec2 dir, float angle) {\n float ca = cos(angle), sa = sin(angle);\n return vec2(dir.x * ca - dir.y * sa, dir.x * sa + dir.y * ca);\n}\n\nvec2 safeDir(vec2 dir) {\n float len = length(dir);\n return len > 1e-4 ? dir / len : vec2(1.0, 0.0);\n}\n\n// Shape profile along the stroke. type:\n// 0 tapered \u2014 thin-fat-thin (classic brush)\n// 1 load-drag \u2014 fat start, tapers to a point\n// 2 dab \u2014 ellipse-like, round center\n// 3 even \u2014 near-constant, slight end taper\nfloat strokeShape(float t, int type) {\n t = clamp(t, 0.0, 1.0);\n if (type == 1) {\n // loaded at t=0, tapering\n return pow(1.0 - t, 0.55) * smoothstep(0.0, 0.08, t);\n } else if (type == 2) {\n // dab / blob\n float d = t - 0.5;\n return exp(-d * d * 12.0);\n } else if (type == 3) {\n // mostly even, slight end softening\n return smoothstep(0.0, 0.08, t) * smoothstep(1.0, 0.92, t) * 0.95 + 0.05;\n }\n // 0 tapered\n return smoothstep(0.0, 0.22, t) * smoothstep(1.0, 0.78, t);\n}\n\n// A single curved stroke.\n// a, b \u2014 endpoints\n// halfW \u2014 base half-width (world units)\n// bulge \u2014 signed perpendicular midpoint offset, in world units\n// shapeType \u2014 0..3\n// bristleFreq \u2014 spatial frequency of edge raggedness\n// bristleAmp \u2014 0..0.5 fraction of halfW chewed away at edge extrema\n// streakSeed \u2014 uniqueness seed for internal streaks\n// colAtMid \u2014 pre-sampled color at midpoint\nStrokeHit curvedStroke(vec2 p, vec2 a, vec2 b, float halfW,\n float bulge, int shapeType,\n float bristleFreq, float bristleAmp,\n float streakSeed, vec3 colAtMid) {\n vec2 ab = b - a;\n float L = length(ab);\n if (L < 1e-5) return noHit();\n vec2 tang = ab / L;\n vec2 norm = vec2(-tang.y, tang.x);\n\n vec2 rel = p - a;\n float along0 = dot(rel, tang) / L; // straight projection 0..1 along AB\n float cross0 = dot(rel, norm); // signed cross\n\n // Spine sideways offset due to bulge (parabolic)\n float bend = 4.0 * bulge * along0 * (1.0 - along0);\n float cross1 = cross0 - bend;\n\n // One refinement step: as the spine bends, the closest-point along shifts.\n // Spine tangent differs from straight tangent; first-order correction:\n float dBend = 4.0 * bulge * (1.0 - 2.0 * along0); // d(bend)/d(along)\n float along1 = along0 + (cross1 * dBend) / (L * (1.0 + dBend * dBend / (L * L)));\n\n // Bristle-ragged edge: half-width gets chewed by 1D noise along the spine\n float edgeNoise = fbm(vec2(along1 * bristleFreq, streakSeed * 7.3)) - 0.5;\n float edgeNoise2 = fbm(vec2(along1 * bristleFreq * 2.3, streakSeed * 3.1 + 17.0)) - 0.5;\n float edgeMod = 1.0 - bristleAmp * (0.6 + 0.4 * edgeNoise) * (0.5 + edgeNoise2);\n\n // Width profile along the stroke\n float shape = strokeShape(along1, shapeType);\n float halfWNow = halfW * shape * edgeMod;\n\n // Inside-segment coverage\n float cov = 0.0;\n if (along1 >= 0.0 && along1 <= 1.0 && halfWNow > 1e-6) {\n float cn = abs(cross1) / halfWNow;\n // razor-hard edge with tiny aa\n cov = 1.0 - smoothstep(0.88, 1.02, cn);\n }\n\n // End-cap blobs (rounded tips, not perpendicular cuts)\n float capA = 0.0, capB = 0.0;\n {\n vec2 capCenterA = a + norm * (bulge * 0.0); // at a\n vec2 capCenterB = a + tang * L + norm * bend * 0.0 + norm * 0.0; // at b; bend is 0 at endpoints\n capCenterB = b;\n float endShapeA = strokeShape(0.02, shapeType);\n float endShapeB = strokeShape(0.98, shapeType);\n float rA = halfW * endShapeA * (0.9 + 0.2 * fbm(vec2(streakSeed * 13.0)));\n float rB = halfW * endShapeB * (0.9 + 0.2 * fbm(vec2(streakSeed * 19.0 + 5.0)));\n float dA = length(p - capCenterA);\n float dB = length(p - capCenterB);\n capA = 1.0 - smoothstep(rA * 0.85, rA * 1.05, dA);\n capB = 1.0 - smoothstep(rB * 0.85, rB * 1.05, dB);\n // Only apply caps if we're BEYOND the segment; otherwise the segment wins.\n capA *= (along1 < 0.05) ? 1.0 : 0.0;\n capB *= (along1 > 0.95) ? 1.0 : 0.0;\n }\n\n float coverage = max(cov, max(capA, capB));\n if (coverage < 0.002) return noHit();\n\n // Edge distance (for impasto later): 0 at edge, 1 at spine\n float edgeDist = halfWNow > 1e-6 ? clamp(1.0 - abs(cross1) / halfWNow, 0.0, 1.0) : 0.0;\n\n return StrokeHit(\n coverage,\n colAtMid,\n clamp(along1, 0.0, 1.0),\n halfWNow > 1e-6 ? cross1 / halfWNow : 0.0,\n edgeDist\n );\n}\n\n// Composite stroke over col with internal streaking + impasto edge highlight.\n// streakAmp \u2014 0..0.2 how much internal streaks darken/lighten\n// impastoAmp \u2014 0..1 edge catch-light strength\n// hardness \u2014 0..1 how crisp the compositing transition is (1 = razor, 0 = creamy)\nvoid paintOver(inout vec3 col, StrokeHit s, float streakFreq, float streakAmp,\n float impastoAmp, float hardness, float streakSeed) {\n if (s.coverage < 0.002) return;\n float strokeOpacity = clamp(uStrokeAmount, 0.0, 1.0);\n if (strokeOpacity <= 0.001) return;\n vec3 c = s.color;\n\n // Internal streaks \u2014 fbm along spine, modulated by cross position. Gives\n // the loaded-brush look: some bristles carry more pigment than others.\n float streakA = fbm(vec2(s.alongT * streakFreq, s.crossN * 2.7 + streakSeed));\n float streakB = fbm(vec2(s.alongT * streakFreq * 0.6 + streakSeed * 3.7, s.crossN * 4.1));\n float streak = 0.6 * (streakA - 0.5) + 0.4 * (streakB - 0.5);\n c *= 1.0 + streak * streakAmp * 2.0;\n\n // Subtle value variance across width (hollow-center catch-light)\n float crossShade = smoothstep(0.0, 0.4, s.edgeN) * (1.0 - smoothstep(0.65, 1.0, s.edgeN));\n c *= 1.0 + crossShade * 0.05;\n\n // Impasto edge highlight \u2014 bright rim on one side of the stroke\n float rim = smoothstep(0.85, 1.0, 1.0 - s.edgeN) * step(0.0, s.crossN);\n c += impastoAmp * rim * vec3(0.18, 0.15, 0.11);\n // Shadow on the other side (darker, cooler)\n float shadow = smoothstep(0.85, 1.0, 1.0 - s.edgeN) * step(0.0, -s.crossN);\n c -= impastoAmp * shadow * 0.25 * vec3(0.10, 0.09, 0.07);\n\n float softLimit = mix(0.35, 0.98, hardness);\n float alpha = smoothstep(0.0, 1.0 - softLimit, s.coverage) * strokeOpacity;\n col = mix(col, c, alpha);\n}\n\n// Best-of-9-neighbor placement: sample 3x3 surrounding cells and take the\n// stroke that covers this pixel most. Breaks the grid by per-cell jitter and\n// sparse density via noise thresholding.\nStrokeHit bestOil(vec2 p, float cellSize, float lenMul, float halfWMul,\n float jitterAmt, float density, int shapeType,\n float bristleAmp, vec2 flow, float t, float seed) {\n vec2 cell = floor(p / cellSize);\n\n StrokeHit best = noHit();\n // 3x3 neighborhood\n for (int dy = -1; dy <= 1; dy++) {\n for (int dx = -1; dx <= 1; dx++) {\n vec2 cc = cell + vec2(float(dx), float(dy));\n vec2 hh = hash22(cc + seed) - 0.5;\n // Density gate \u2014 noise threshold; sparse placement.\n float gate = hash21(cc * 1.7 + seed * 0.3);\n if (gate > density) continue;\n\n vec2 center = (cc + 0.5 + hh * jitterAmt) * cellSize;\n\n // Per-stroke direction: consume the layer-provided flow, then add only\n // deterministic local perturbation so alternate stroke layers stay live.\n vec2 f = safeDir(flow);\n float angJ = (hash21(cc + seed + 11.0) - 0.5) * 0.9; // +/- 0.45 rad\n float localCurl = (fbm(center * (2.6 + seed * 0.11) + seed * 1.9) - 0.5) * 0.55 * uFlowCurl;\n vec2 dir = rotateDir(f, angJ + localCurl);\n\n float lenV = cellSize * lenMul * (0.65 + 0.55 * hash21(cc + seed + 23.0));\n float halfW = cellSize * halfWMul * (0.70 + 0.55 * hash21(cc + seed + 41.0));\n float bulge = (hash21(cc + seed + 53.0) - 0.5) * lenV * 0.35;\n\n vec2 a = center - dir * (lenV * 0.5);\n vec2 b = center + dir * (lenV * 0.5);\n\n vec3 colMid = brokenColorJitter(\n sampleBase(center, t),\n hash21(cc + seed + 89.0),\n hash21(cc * 2.3 + seed + 97.0),\n 1.0\n );\n\n StrokeHit h = curvedStroke(p, a, b, halfW, bulge, shapeType,\n 7.0, bristleAmp,\n hash21(cc + seed + 67.0), colMid);\n if (h.coverage > best.coverage) best = h;\n }\n }\n return best;\n}\n\n// \u2500\u2500 Crayon / oil-pastel \u2014 paper tooth \u00D7 wax pigment \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Crayon is not strokes. It's pigment crumbs dragged across paper tooth.\n// Model: heavy 2D tooth noise at multiple scales, anisotropically stretched\n// along flow direction, multiplied into the base color. Add a slow \"waxy\n// film\" that slightly unifies hues, and occasional darker \"pressed\" spots\n// where the crayon dug in. NO straight segments.\nvec3 mediumOil_crayon(vec3 col, vec2 p, float t) {\n vec2 flow = flowField(p, t);\n float ang = atan(flow.y, flow.x);\n float ca = cos(-ang), sa = sin(-ang);\n vec2 pr = vec2(p.x * ca - p.y * sa, p.x * sa + p.y * ca);\n\n // Anisotropic tooth \u2014 squished along flow, coarse cross flow.\n float aniso = mix(0.45, 0.95, uStrokeAnisotropy);\n float scale = max(uStrokeScale * 1.6, 180.0);\n\n float t1 = vnoise(vec2(pr.x * scale * aniso, pr.y * scale));\n float t2 = vnoise(vec2(pr.x * scale * aniso * 0.4, pr.y * scale * 0.4) + 11.0);\n float t3 = vnoise(vec2(pr.x * scale * aniso * 2.1, pr.y * scale * 2.1) + 23.0);\n float tooth = 0.55 * t1 + 0.30 * t2 + 0.15 * t3;\n // Center at 0, amplify\n tooth = (tooth - 0.5) * 1.4;\n\n // Multiplicative darkening where tooth is low (pigment skipped paper valleys)\n float lay = 1.0 + tooth * 0.32 * uStrokeAmount;\n vec3 result = col * lay;\n\n // Occasional pressed-in crumbs \u2014 rare darker crumbs\n float crumbs = smoothstep(0.78, 0.95, vnoise(pr * scale * 3.0));\n result *= 1.0 - crumbs * 0.18 * uStrokeAmount;\n\n // Waxy highlight film \u2014 slight lightening on tooth peaks\n float waxy = smoothstep(0.55, 0.85, t1);\n result += waxy * 0.04 * vec3(1.0);\n\n // Paper tooth overlay (subtler than oil's canvas)\n float paperTooth = vnoise(p * 340.0) - 0.5;\n result *= 1.0 + paperTooth * 0.14 * uCanvasGrain;\n\n // Broken-color pigment: stable wax/pigment patches, not temporal flicker.\n vec2 pigmentCell = floor(pr * max(scale * 0.18, 32.0));\n float pigmentMask = smoothstep(0.28, 0.82, vnoise(pr * scale * 0.21 + 19.0));\n result = brokenColorJitter(\n result,\n hash21(pigmentCell + 17.0),\n hash21(pigmentCell * 2.1 + 31.0),\n 0.45 + 0.55 * pigmentMask\n );\n\n // Crayon is saturation-amplified\n result = saturate3(result, 1.12);\n\n return result;\n}\n\nvec3 mediumOil(vec3 col, vec2 p, float t) {\n // Mode knobs (uStrokeMode):\n // 0 oil \u2014 balanced modern-abstract/palette-knife hybrid\n // 1 knife \u2014 palette-knife impasto: razor edges, heavy bristle/shadow\n // 2 crayon \u2014 soft-edged wax smudges on tooth (no straight segments)\n // 3 brushwork \u2014 thick bristle brush\n int mode = uStrokeMode;\n\n // Per-mode parameters\n int shapeType = 0; // tapered\n float bristleAmp = 0.25; // 0..0.5\n float streakFreq = 9.0;\n float streakAmp = 0.09;\n float impastoAmp = 0.9;\n float hardness = 0.80; // edge compositing\n float toothScale = 240.0;\n float toothAmp = 0.09;\n float pigmentSat = 1.03;\n float densityBig = 0.65;\n float densityMed = 0.78;\n float densitySml = 0.90;\n\n if (mode == 1) { // palette knife\n shapeType = 3; // flat, even\n bristleAmp = 0.12;\n streakFreq = 4.0; streakAmp = 0.05;\n impastoAmp = 1.6;\n hardness = 0.95;\n toothAmp = 0.04;\n densityBig = 0.80; densityMed = 0.88; densitySml = 0.70;\n } else if (mode == 2) { // crayon \u2014 handled specially below\n return mediumOil_crayon(col, p, t);\n } else if (mode == 3) { // thick brushwork\n shapeType = 0; // tapered\n bristleAmp = 0.32;\n streakFreq = 14.0; streakAmp = 0.14;\n impastoAmp = 1.2;\n hardness = 0.85;\n toothAmp = 0.07;\n }\n\n // Scales & multipliers from uniforms\n float baseScale = max(uStrokeScale * 0.006, 0.008);\n // Three layers: big gestural, medium body, small dabs\n float sBig = baseScale * 2.4;\n float sMed = baseScale * 1.1;\n float sSml = baseScale * 0.45;\n\n float lenMulBig = mix(2.2, 3.8, uStrokeAnisotropy);\n float widMulBig = mix(0.55, 0.32, uStrokeAnisotropy);\n float lenMulMed = mix(2.0, 3.4, uStrokeAnisotropy);\n float widMulMed = mix(0.50, 0.30, uStrokeAnisotropy);\n float lenMulSml = mix(1.6, 2.6, uStrokeAnisotropy);\n float widMulSml = mix(0.45, 0.32, uStrokeAnisotropy);\n\n float jitterAmt = 0.75; // large jitter \u2014 no grid\n vec2 flow = flowField(p, t);\n\n vec3 result = col;\n\n // Layer 1 \u2014 big gestural strokes (sparse, shaping)\n StrokeHit hBig = bestOil(p, sBig, lenMulBig, widMulBig, jitterAmt * 0.55,\n densityBig, shapeType, bristleAmp, flow, t, 1.3);\n paintOver(result, hBig, streakFreq * 0.7, streakAmp,\n uImpasto * impastoAmp * uStrokeAmount, hardness, 1.3);\n\n // Layer 2 \u2014 medium body strokes\n StrokeHit hMed = bestOil(p + vec2(11.3, 3.7), sMed, lenMulMed, widMulMed,\n jitterAmt, densityMed, shapeType, bristleAmp, flow, t, 2.7);\n paintOver(result, hMed, streakFreq, streakAmp,\n uImpasto * impastoAmp * uStrokeAmount, hardness, 2.7);\n\n // Layer 3 \u2014 small dabs (more frequent, smaller)\n int smlShape = (mode == 1) ? 2 : shapeType; // knife uses dabs for sparkle\n StrokeHit hSml = bestOil(p + vec2(-5.1, 8.4), sSml, lenMulSml, widMulSml,\n jitterAmt * 1.3, densitySml, smlShape,\n bristleAmp * 0.85, flow, t, 4.1);\n paintOver(result, hSml, streakFreq * 1.4, streakAmp * 0.8,\n uImpasto * impastoAmp * 0.65 * uStrokeAmount, hardness, 4.1);\n\n // Layer 4 \u2014 fill dabs (very dense, very small) \u2014 covers bald spots\n float sFill = baseScale * 0.22;\n float lenMulFill = mix(1.4, 2.0, uStrokeAnisotropy);\n float widMulFill = mix(0.50, 0.38, uStrokeAnisotropy);\n int fillShape = (mode == 1) ? 3 : 2; // knife=even, others=dab (round fills)\n StrokeHit hFill = bestOil(p + vec2(3.9, -6.2), sFill, lenMulFill, widMulFill,\n jitterAmt * 1.5, 0.95, fillShape,\n bristleAmp * 0.6, flow, t, 8.9);\n paintOver(result, hFill, streakFreq * 1.8, streakAmp * 0.6,\n uImpasto * impastoAmp * 0.4 * uStrokeAmount, hardness * 0.9, 8.9);\n\n // Optional crosshatch layer\n if (uStrokeLayers == 2) {\n vec2 flow2 = vec2(-flow.y, flow.x);\n StrokeHit hX = bestOil(p + vec2(7.3, -2.1), sMed, lenMulMed * 0.9, widMulMed,\n jitterAmt, densityMed * 0.7, shapeType, bristleAmp, flow2, t, 6.5);\n paintOver(result, hX, streakFreq, streakAmp * 0.85,\n uImpasto * impastoAmp * 0.55 * uStrokeAmount, hardness, 6.5);\n }\n\n // Canvas tooth \u2014 linen weave\n float tooth1 = vnoise(p * toothScale);\n float tooth2 = vnoise(p * toothScale * vec2(0.6, 2.4) + 37.0);\n float tooth = (0.6 * tooth1 + 0.4 * tooth2) - 0.5;\n result *= 1.0 + tooth * toothAmp * uCanvasGrain;\n\n // Pigment saturation boost\n result = saturate3(result, pigmentSat);\n\n return result;\n}\n\n// \u2500\u2500 Main \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nvoid main() {\n // Normalized 0..1 coordinates for nuclei, domain warp, and medium sampling.\n vec2 uv = vUv;\n vec2 pN = uv;\n\n float t = uTime;\n\n // Warp in pN space\n vec2 p_warp = domainWarp(pN, t);\n\n // Composition\n float paletteId; float valueMod;\n nucleiField(p_warp, t, paletteId, valueMod);\n vec3 col = samplePalette(paletteId);\n col *= 1.0 + uValueVariance * valueMod;\n\n // Breath \u2014 slow global luminance wobble\n float breath = sin(t * 6.2831 / max(uBreathPeriod, 1.0));\n col *= 1.0 + uBreathDepth * breath * 0.5;\n\n // Medium\n if (uMedium == 1) col = mediumPastel(col, pN, t);\n else if (uMedium == 2) col = mediumWatercolor(col, pN, t);\n else if (uMedium == 3) col = mediumOil(col, pN, t);\n\n // Saturation trim\n col = saturate3(col, uSaturation);\n\n // Tonemap + film grain\n col = aces(col);\n float grain = hash21(gl_FragCoord.xy + t * 17.0);\n col += (grain - 0.5) * uPaperGrain;\n\n col = clamp(col * 0.985 + 0.008, 0.0, 1.0);\n fragColor = vec4(col * uAlpha, uAlpha);\n}\n";
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { type Ref } from "vue";
|
|
2
|
-
export interface UseBreakpointControls {
|
|
3
|
-
/** Live `matches` state for the given media query. */
|
|
4
|
-
readonly matches: Readonly<Ref<boolean>>;
|
|
5
|
-
/** Tear down the `matchMedia` listener. Auto-called on scope dispose. */
|
|
6
|
-
stop: () => void;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* `useBreakpoint(query)` — a reactive read of a CSS media query's `matches`
|
|
10
|
-
* state, kept live across resize / orientation / display-mode changes.
|
|
11
|
-
*
|
|
12
|
-
* Wraps `window.matchMedia(query)`, subscribes a single `change` handler,
|
|
13
|
-
* and mirrors `mql.matches` into a `Ref<boolean>`. Auto-cleans on Vue scope
|
|
14
|
-
* disposal (mirrors `useResizeObserver` / `useInterval` upstream); outside
|
|
15
|
-
* a scope callers use the returned `stop()` control.
|
|
16
|
-
*
|
|
17
|
-
* SSR-safe: when `window` is undefined the composable returns a
|
|
18
|
-
* permanently-`false` ref. Consumers should treat the initial frame as
|
|
19
|
-
* "mobile-first / narrow-default" because the matchMedia subscription only
|
|
20
|
-
* mounts client-side. This is the same shape consumers wrote by hand at the
|
|
21
|
-
* speedtest origin sites.
|
|
22
|
-
*
|
|
23
|
-
* Why this exists (speedtest origin, glass-ui promotion W6-β): the survey
|
|
24
|
-
* cockpit (`SurveyWizard.vue`) and the admin data-source toggle
|
|
25
|
-
* (`AdminDataSourceToggle.vue`) both hand-rolled the same `matchMedia`
|
|
26
|
-
* subscribe-on-mount + tear-down-on-unmount pattern. Two hand-rolls of one
|
|
27
|
-
* pattern is the `feedback_generic_components` 2-consumer trigger;
|
|
28
|
-
* absorbed publisher-side per `feedback_library_gaps`.
|
|
29
|
-
*
|
|
30
|
-
* Usage:
|
|
31
|
-
* const { matches: isDesktop } = useBreakpoint("(min-width: 720px)");
|
|
32
|
-
* const wide = isDesktop.value; // live across resize.
|
|
33
|
-
*
|
|
34
|
-
* @param query A CSS `@media` query string, e.g. `"(min-width: 720px)"`.
|
|
35
|
-
* @returns Object with `matches: Ref<boolean>` and `stop()` for manual
|
|
36
|
-
* disposal outside a Vue scope.
|
|
37
|
-
*/
|
|
38
|
-
export declare function useBreakpoint(query: string): UseBreakpointControls;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { type Ref } from "vue";
|
|
2
|
-
export interface UseIdleReadyOptions {
|
|
3
|
-
/**
|
|
4
|
-
* `requestIdleCallback` timeout, in ms. Default 2_000 — the canonical
|
|
5
|
-
* value at every speedtest hand-rolled site (App.vue + useIPInfo both
|
|
6
|
-
* pass `{ timeout: 2000 }`). Unlike useViewportReady's 10s (which fronts
|
|
7
|
-
* the budget with an IO gate), useIdleReady has no visibility stage, so
|
|
8
|
-
* the timeout is the only ceiling — 2s matches the consumer sites and
|
|
9
|
-
* keeps the deferred work inside a reasonable post-paint window.
|
|
10
|
-
*/
|
|
11
|
-
timeout?: number;
|
|
12
|
-
/**
|
|
13
|
-
* Optional task run the moment the gate flips (the scope-aware variant —
|
|
14
|
-
* useIPInfo's `() => void refresh()`). Runs exactly once; auto-cancelled
|
|
15
|
-
* on scope dispose with the rIC handle so a short-lived consumer cannot
|
|
16
|
-
* leak a deferred write to disposed refs. Consumers that only need the
|
|
17
|
-
* `ready` ref omit it.
|
|
18
|
-
*/
|
|
19
|
-
onReady?: () => void;
|
|
20
|
-
}
|
|
21
|
-
export interface UseIdleReadyControls {
|
|
22
|
-
/** Flips `false → true` exactly once on the first idle tick (post-mount). */
|
|
23
|
-
readonly ready: Ref<boolean>;
|
|
24
|
-
/** Tear down the pending idle/timer handle. Auto-called on scope dispose. */
|
|
25
|
-
stop: () => void;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* `useIdleReady(options?)` — `requestIdleCallback` (+ `setTimeout(0)` Safari
|
|
29
|
-
* fallback) post-mount idle gate that flips a `Ref<boolean>` exactly once on
|
|
30
|
-
* the first idle tick, and optionally runs an `onReady` task at that moment.
|
|
31
|
-
*
|
|
32
|
-
* The rIC-only sibling of `useViewportReady` — same one-shot `ready` ref +
|
|
33
|
-
* `stop()` shape, same auto-dispose discipline — minus the
|
|
34
|
-
* `IntersectionObserver` visibility stage. The gate is "idle, full stop", not
|
|
35
|
-
* "visible AND idle"; reach for it when there is no element to gate on (a
|
|
36
|
-
* top-level lazy mount, a composable's first-idle data fetch).
|
|
37
|
-
*
|
|
38
|
-
* Two unified use shapes:
|
|
39
|
-
*
|
|
40
|
-
* 1. `ready`-flag — `v-if`-gate a heavy mount on the returned ref:
|
|
41
|
-
* const { ready } = useIdleReady();
|
|
42
|
-
* // <Aurora v-if="ready" />
|
|
43
|
-
* 2. scope-aware task — run a callback on first idle, cancelled on dispose:
|
|
44
|
-
* useIdleReady({ onReady: () => void refresh() });
|
|
45
|
-
* The handle is auto-cancelled on Vue scope disposal so a short-lived
|
|
46
|
-
* consumer cannot leak a deferred write to disposed refs.
|
|
47
|
-
*
|
|
48
|
-
* The composable schedules synchronously at call time (NOT inside an
|
|
49
|
-
* `onMounted`) so it works outside a component too (e.g. inside `useIPInfo`,
|
|
50
|
-
* a composable not a component). SSR / non-browser flips synchronously so
|
|
51
|
-
* consumers don't stall.
|
|
52
|
-
*
|
|
53
|
-
* Why this exists (speedtest origin, glass-ui promotion AO.W3): the gate is
|
|
54
|
-
* hand-rolled at 5 speedtest sites (App.vue, MapView.vue, DashboardMap.vue,
|
|
55
|
-
* useAutoStart.ts, useIPInfo.ts) — the ≥2-consumer substrate-promotion gate
|
|
56
|
-
* (J inv 10 / L inv 8) fires for a publisher-side absorption.
|
|
57
|
-
*
|
|
58
|
-
* @param options.timeout Default `2000` ms — forwarded to `requestIdleCallback`.
|
|
59
|
-
* @param options.onReady Optional one-shot task run on the idle flip.
|
|
60
|
-
* @returns Object with `ready: Ref<boolean>` (flips false → true once) and
|
|
61
|
-
* `stop()` for manual disposal outside a Vue scope.
|
|
62
|
-
*/
|
|
63
|
-
export declare function useIdleReady(options?: UseIdleReadyOptions): UseIdleReadyControls;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { type Ref } from "vue";
|
|
2
|
-
/**
|
|
3
|
-
* Structural Ref shape — accepts the consumer's `Ref<T>` regardless of which
|
|
4
|
-
* `@vue/reactivity` package the brand symbol comes from. Glass-ui may sit at
|
|
5
|
-
* a different vue minor than the consumer, and Vue 3.5's `[RefSymbol]`
|
|
6
|
-
* phantom is nominal-by-package; structural-by-`.value` is the correct
|
|
7
|
-
* contract for a consumer-facing API. Same shape `useResizeObserver` uses.
|
|
8
|
-
*/
|
|
9
|
-
type RefLike<T> = {
|
|
10
|
-
value: T;
|
|
11
|
-
};
|
|
12
|
-
export interface UseViewportReadyOptions {
|
|
13
|
-
/**
|
|
14
|
-
* IntersectionObserver `rootMargin`. Default `"200px"` so the gate flips
|
|
15
|
-
* before the host actually crosses the viewport edge — gives the
|
|
16
|
-
* consumer a quiet window for lazy-mount (`echarts`, `<canvas>` re-init,
|
|
17
|
-
* heavy widget hydration) to land off the LCP frame.
|
|
18
|
-
*/
|
|
19
|
-
rootMargin?: string;
|
|
20
|
-
/**
|
|
21
|
-
* `requestIdleCallback` timeout, in ms. Default 10_000.
|
|
22
|
-
*
|
|
23
|
-
* Why 10s and not the conventional 1–2s: a cold-loading consumer (slow
|
|
24
|
-
* throughput, weak device) may not sustainably idle inside a 1–2s
|
|
25
|
-
* window — the timeout fires inside the LCP measurement window and
|
|
26
|
-
* defeats the IO gate's "wait for viewport AND idle main thread"
|
|
27
|
-
* semantic. The IO gate fronts the budget, so the timeout only fires
|
|
28
|
-
* after intersection has already resolved; ten seconds gives the main
|
|
29
|
-
* thread room to idle naturally.
|
|
30
|
-
*/
|
|
31
|
-
idleTimeout?: number;
|
|
32
|
-
/**
|
|
33
|
-
* IntersectionObserver `threshold`. Default 0.01 (1 % visible). Mirrors
|
|
34
|
-
* the speedtest origin-site semantic — "any pixel visible counts".
|
|
35
|
-
*/
|
|
36
|
-
threshold?: number;
|
|
37
|
-
}
|
|
38
|
-
export interface UseViewportReadyControls {
|
|
39
|
-
/** Flips `false → true` exactly once when the host is visible + idle. */
|
|
40
|
-
readonly ready: Ref<boolean>;
|
|
41
|
-
/** Tear down observer + idle handle. Auto-called on scope dispose. */
|
|
42
|
-
stop: () => void;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* `useViewportReady(host)` — two-stage `IntersectionObserver` +
|
|
46
|
-
* `requestIdleCallback` gate that flips a `Ref<boolean>` exactly once when
|
|
47
|
-
* the host element has entered the viewport AND the main thread has idled.
|
|
48
|
-
*
|
|
49
|
-
* The intended use is lazy-mount of a heavy widget (echarts, leaflet,
|
|
50
|
-
* three.js, codemirror, custom canvas) that would otherwise pull its chunk
|
|
51
|
-
* into the first-paint critical path. The two-stage gate ensures:
|
|
52
|
-
*
|
|
53
|
-
* 1. Visibility-first — `IntersectionObserver` watches `host`. Until the
|
|
54
|
-
* host crosses into the viewport (+ `rootMargin`), no fetch fires.
|
|
55
|
-
* 2. Idle-second — once visible, `requestIdleCallback` schedules the flip
|
|
56
|
-
* so the chunk fetch waits for an idle main thread. Safari (no rIC)
|
|
57
|
-
* falls back to `setTimeout(fire, 16)` — one frame later — so the
|
|
58
|
-
* composition still defers past the IO callback's paint frame.
|
|
59
|
-
*
|
|
60
|
-
* The composable is one-shot: once the gate flips to `true` it disconnects
|
|
61
|
-
* its observer and clears any pending idle handle. Auto-cleans on Vue scope
|
|
62
|
-
* disposal (mirrors `useResizeObserver` / `useInterval` upstream); outside
|
|
63
|
-
* a scope callers receive the manual `stop()` control.
|
|
64
|
-
*
|
|
65
|
-
* Why this exists (speedtest origin, glass-ui promotion AJ.W6-α): both
|
|
66
|
-
* `AdminOverviewView` and `ChartsView` shipped a near-identical `chartReady`
|
|
67
|
-
* flag flipped by `requestIdleCallback` alone. The W3-R1 idiom in those
|
|
68
|
-
* sites — gate visibility first, then schedule rIC inside the IO callback —
|
|
69
|
-
* is generic across heavy-widget hydration; the speedtest 2-consumer trigger
|
|
70
|
-
* fired for a publisher-side absorption per `feedback_generic_components`.
|
|
71
|
-
*
|
|
72
|
-
* Usage:
|
|
73
|
-
* const host = ref<HTMLElement | null>(null);
|
|
74
|
-
* const { ready } = useViewportReady(host);
|
|
75
|
-
* // <Chart v-if="ready" /> — fetched lazily once host is visible + idle.
|
|
76
|
-
*
|
|
77
|
-
* @param host A `Ref<Element | null>` for the element to gate visibility on.
|
|
78
|
-
* The observer watches THIS element, not the lazy-mounted
|
|
79
|
-
* widget (which doesn't exist pre-flip).
|
|
80
|
-
* @param options.rootMargin Default `"200px"`.
|
|
81
|
-
* @param options.idleTimeout Default `10000` ms.
|
|
82
|
-
* @param options.threshold Default `0.01`.
|
|
83
|
-
* @returns Object with `ready: Ref<boolean>` (flips false → true once) and
|
|
84
|
-
* `stop()` for manual disposal outside a Vue scope.
|
|
85
|
-
*/
|
|
86
|
-
export declare function useViewportReady(host: RefLike<Element | null>, options?: UseViewportReadyOptions): UseViewportReadyControls;
|
|
87
|
-
export {};
|