@mkbabb/glass-ui 3.10.0 → 3.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CardAction-DuArVky-.js → CardAction-DrAcAV4d.js} +2 -2
- package/dist/{CommandShortcut-CefCj5mt.js → CommandShortcut-mV2e1aG6.js} +2 -2
- package/dist/{DataTable-CUHMukiQ.js → DataTable-C3E6jZ5B.js} +2 -2
- package/dist/{DialogContent-BRkT1cjP.js → DialogContent-BxaaafFi.js} +1 -1
- package/dist/{HoverPopover-2LOIW34a.js → HoverPopover-CDA_SaCe.js} +1 -1
- package/dist/{MetricBadge-BZVWIxNy.js → MetricBadge-idgrkqoP.js} +5 -7
- package/dist/{Notification-DLMhblXR.js → Notification-Cu0nN17_.js} +1 -1
- package/dist/{NumberFieldContent-BbLOh8RU.js → NumberFieldContent-CHEWghnY.js} +2 -2
- package/dist/{PopoverContent-BId6ggf_.js → PopoverContent-DpUvdYY-.js} +1 -1
- package/dist/{Progress-iEuD9pxG.js → Progress-BW-StFw2.js} +1 -1
- package/dist/{ScrollingText-BPP84wKo.js → ScrollingText-DruYCni_.js} +1 -1
- package/dist/{SelectScrollDownButton-T32cVFeM.js → SelectScrollDownButton-pirzjm--.js} +3 -3
- package/dist/{Switch-Ch-k3Rv-.js → Switch-DeAqg6pi.js} +1 -1
- package/dist/{TabsList-B8CVOQPC.js → TabsList-BAVzOZpg.js} +2 -2
- package/dist/{Toaster-1rYWrmAm.js → Toaster-CvuuW_y9.js} +49 -46
- package/dist/{ToggleGroupItem-Cev4pOVK.js → ToggleGroupItem-DtD37b4G.js} +4 -4
- package/dist/animated-digit.js +2 -2
- package/dist/api/index.d.ts +3 -4
- package/dist/api.js +1 -1
- package/dist/aurora.js +66 -66
- package/dist/{badge-CaoFJzRb.js → badge-NdCQMvvB.js} +1 -1
- package/dist/badge.js +1 -1
- package/dist/{button-DN39cGqL.js → button-DyiWFAOE.js} +12 -12
- package/dist/button.js +1 -1
- package/dist/canvas.js +2 -2
- package/dist/card.js +1 -1
- package/dist/carousel.js +5 -5
- package/dist/collapsible.js +1 -1
- package/dist/{color-C5ls_QF7.js → color-B65wWyQz.js} +9 -7
- package/dist/color.js +1 -1
- package/dist/command.js +1 -1
- package/dist/components/custom/aurora/constants/shaders/mediums.glsl.d.ts +1 -1
- package/dist/components/custom/aurora/constants/shaders/vangogh-medium.glsl.d.ts +1 -0
- package/dist/components/custom/constellation/Constellation.vue.d.ts +12 -0
- package/dist/components/custom/constellation/composables/createConstellationField.d.ts +35 -0
- package/dist/components/custom/constellation/composables/useConstellationPointer.d.ts +35 -0
- package/dist/components/custom/constellation/constants.d.ts +36 -0
- package/dist/components/custom/constellation/constellationDraw.d.ts +18 -0
- package/dist/components/custom/constellation/constellationField.d.ts +10 -151
- package/dist/components/custom/constellation/constellationInteraction.d.ts +102 -0
- package/dist/components/custom/constellation/index.d.ts +3 -1
- package/dist/components/custom/controls/DarkModeToggle.vue.d.ts +11 -0
- package/dist/components/custom/dock/DockTabButton.vue.d.ts +3 -4
- package/dist/components/custom/dock/GlassDock.vue.d.ts +2 -110
- package/dist/components/custom/dock/composables/dockMorphContext.d.ts +36 -0
- package/dist/components/custom/dock/composables/useDockMorphWindow.d.ts +15 -0
- package/dist/components/custom/dock/composables/useDockShellProps.d.ts +131 -0
- package/dist/components/custom/dock/composables/useLayerTransition.d.ts +44 -0
- package/dist/components/custom/dock/constants.d.ts +23 -0
- package/dist/components/custom/expandable-container/ExpandableContainer.vue.d.ts +0 -29
- package/dist/components/custom/fourier-field/index.d.ts +1 -1
- package/dist/components/custom/fourier-field/math.d.ts +17 -0
- package/dist/components/custom/fourier-field/presets.d.ts +54 -0
- package/dist/components/custom/goo-blob/composables/buildMetaballProgram.d.ts +18 -0
- package/dist/components/custom/goo-blob/composables/uploadBlobUniforms.d.ts +41 -0
- package/dist/components/custom/goo-blob/composables/useBlobPointer.d.ts +4 -3
- package/dist/components/custom/goo-blob/composables/useMetaballRenderer.d.ts +11 -8
- package/dist/components/custom/goo-blob/constants.d.ts +52 -0
- package/dist/components/custom/goo-blob/shaders/metaball-uniforms.glsl.d.ts +1 -0
- package/dist/components/custom/instrument-chassis/InstrumentChassis.vue.d.ts +2 -2
- package/dist/components/custom/metric-badge/MetricBadge.vue.d.ts +0 -8
- package/dist/components/custom/tabs/constants.d.ts +12 -0
- package/dist/components/custom/underline/GlassUnderline.vue.d.ts +84 -0
- package/dist/components/custom/underline/index.d.ts +2 -0
- package/dist/components/custom/underline/types.d.ts +56 -0
- package/dist/components/ui/drawer/Drawer.vue.d.ts +1 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +2 -2
- package/dist/components/ui/slider/index.d.ts +22 -19
- package/dist/components/ui/toast/use-toast.d.ts +2 -2
- package/dist/composables/color/index.d.ts +12 -0
- package/dist/composables/glass/useSpecularTracking.d.ts +12 -3
- package/dist/composables/motion/core/index.d.ts +0 -1
- package/dist/composables/motion/curves.d.ts +48 -0
- package/dist/composables/motion/index.d.ts +2 -0
- package/dist/composables/motion/springPresets.d.ts +33 -0
- package/dist/composables/motion/suite.d.ts +2 -0
- package/dist/composables/motion/useSpringMount.d.ts +1 -1
- package/dist/configurator.js +1 -1
- package/dist/confirm-dialog.js +2 -2
- package/dist/constellation.js +260 -225
- package/dist/controls.js +48 -14
- package/dist/dark.js +1 -1
- package/dist/data-table.js +1 -1
- package/dist/dialog.js +2 -2
- package/dist/dock.js +339 -327
- package/dist/dockContext-bho8B1A4.js +17 -0
- package/dist/{dropdown-menu-D77jX6Df.js → dropdown-menu-DVnQcA0E.js} +7 -4
- package/dist/dropdown-menu.js +1 -1
- package/dist/expandable-container.js +38 -61
- package/dist/forms.js +2 -2
- package/dist/fourier-field.js +137 -102
- package/dist/fourier-math.js +2 -2
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +287 -209
- package/dist/goo-blob.js +243 -212
- package/dist/hover-popover.js +1 -1
- package/dist/icon-tooltip.js +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/keyboard.js +1 -1
- package/dist/labeled-field.js +5 -5
- package/dist/{math-DTpRVC0e.js → math-BUU9hHID.js} +18 -2
- package/dist/metric-badge.js +1 -1
- package/dist/metric-stack.js +1 -1
- package/dist/motion-core.js +69 -70
- package/dist/motion-curves.d.ts +1 -0
- package/dist/motion-curves.js +130 -0
- package/dist/motion.js +38 -37
- package/dist/notification.js +1 -1
- package/dist/number-field.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/progress.js +1 -1
- package/dist/pulse.js +1 -1
- package/dist/reactive.js +1 -1
- package/dist/scrolling-text.js +1 -1
- package/dist/search.js +6 -6
- package/dist/select.js +1 -1
- package/dist/{sheet-VZEtNFvO.js → sheet-ChSXcJpU.js} +1 -1
- package/dist/sheet.js +1 -1
- package/dist/{slider-CyzcxBoh.js → slider-sfl8gFDD.js} +4 -4
- package/dist/slider.js +1 -1
- package/dist/sortable-list.js +2 -2
- package/dist/springPresets-aRSm-4_k.js +40 -0
- package/dist/stacked-icons.js +6 -6
- package/dist/styles/animations.css +18 -74
- package/dist/styles/components.css +1 -1
- package/dist/styles/dock/layer-group.css +22 -0
- package/dist/styles/dock/layers.css +11 -1
- package/dist/styles/dock/morph.css +95 -19
- package/dist/styles/dock/shell.css +12 -0
- package/dist/styles/dock-controls.css +28 -31
- package/dist/styles/drawer.css +2 -0
- package/dist/styles/floating-panel.css +2 -0
- package/dist/styles/glass/a11y-fallback.css +245 -0
- package/dist/styles/glass/ladder.css +304 -0
- package/dist/styles/glass/material.css +238 -0
- package/dist/styles/glass/progress-rail.css +78 -0
- package/dist/styles/glass/squircle.css +66 -0
- package/dist/styles/glass/surfaces.css +306 -0
- package/dist/styles/glass-refract.css +2 -0
- package/dist/styles/glass.css +31 -1188
- package/dist/styles/hover-popover.css +2 -0
- package/dist/styles/index.css +24 -6
- package/dist/styles/instrument-chassis.css +4 -0
- package/dist/styles/paper.css +2 -68
- package/dist/styles/theme.css +13 -20
- package/dist/styles/tokens/color-radius.css +250 -0
- package/dist/styles/tokens/dark-arm.css +194 -0
- package/dist/styles/tokens/glass.css +413 -0
- package/dist/styles/tokens/light-dark.css +158 -0
- package/dist/styles/tokens/offsets-sizing.css +406 -0
- package/dist/styles/tokens/property-regs.css +169 -0
- package/dist/styles/tokens/scale-paper.css +361 -0
- package/dist/styles/tokens/scheme-motion.css +334 -0
- package/dist/styles/tokens/shadow.css +132 -0
- package/dist/styles/tokens.css +22 -2355
- package/dist/styles/typography.css +18 -6
- package/dist/styles/utilities/a11y-overrides.css +140 -0
- package/dist/styles/utilities/animate.css +26 -0
- package/dist/styles/utilities/base.css +365 -0
- package/dist/styles/utilities/btn.css +399 -0
- package/dist/styles/utilities/components.css +317 -0
- package/dist/styles/utilities.css +19 -1260
- package/dist/styles/view-transition.css +0 -51
- package/dist/switch.js +1 -1
- package/dist/tabs.js +98 -98
- package/dist/timeline.js +2 -2
- package/dist/toast.js +1 -1
- package/dist/toggle-group.js +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/underline.d.ts +1 -0
- package/dist/underline.js +85 -0
- package/dist/{useAnimatedNumber-Bcpy5Etf.js → useAnimatedNumber-DfVgP4te.js} +1 -1
- package/dist/{useConfiguratorState-DxAqksK6.js → useConfiguratorState-BdQXh9ie.js} +1 -1
- package/dist/useSpecularTracking-DFK_fhpG.js +32 -0
- package/dist/useSpringMount-DXUzxBjV.js +108 -0
- package/dist/vReveal-CqaCz_mC.js +44 -0
- package/dist/watercolor-dot.js +2 -2
- package/package.json +34 -52
- package/src/styles/animations.css +18 -74
- package/src/styles/dock/layer-group.css +22 -0
- package/src/styles/dock/layers.css +11 -1
- package/src/styles/dock/morph.css +95 -19
- package/src/styles/dock/shell.css +12 -0
- package/src/styles/dock-controls.css +28 -31
- package/src/styles/glass/a11y-fallback.css +245 -0
- package/src/styles/glass/ladder.css +304 -0
- package/src/styles/glass/material.css +238 -0
- package/src/styles/glass/progress-rail.css +78 -0
- package/src/styles/glass/squircle.css +66 -0
- package/src/styles/glass/surfaces.css +306 -0
- package/src/styles/glass.css +31 -1188
- package/src/styles/index.css +24 -6
- package/src/styles/paper.css +2 -68
- package/src/styles/theme.css +13 -20
- package/src/styles/tokens/color-radius.css +250 -0
- package/src/styles/tokens/dark-arm.css +194 -0
- package/src/styles/tokens/glass.css +413 -0
- package/src/styles/tokens/light-dark.css +158 -0
- package/src/styles/tokens/offsets-sizing.css +406 -0
- package/src/styles/tokens/property-regs.css +169 -0
- package/src/styles/tokens/scale-paper.css +361 -0
- package/src/styles/tokens/scheme-motion.css +334 -0
- package/src/styles/tokens/shadow.css +132 -0
- package/src/styles/tokens.css +22 -2355
- package/src/styles/typography.css +18 -6
- package/src/styles/utilities/a11y-overrides.css +140 -0
- package/src/styles/utilities/animate.css +26 -0
- package/src/styles/utilities/base.css +365 -0
- package/src/styles/utilities/btn.css +399 -0
- package/src/styles/utilities/components.css +317 -0
- package/src/styles/utilities.css +19 -1260
- package/src/styles/view-transition.css +0 -51
- package/dist/DeckProgress-Dmk4_AKN.js +0 -23
- package/dist/InstrumentRail-CUJ05YVG.js +0 -44
- package/dist/components/custom/deck-progress/DeckProgress.vue.d.ts +0 -27
- package/dist/components/custom/deck-progress/index.d.ts +0 -2
- package/dist/components/custom/dialog-native/GlassDialogNative.vue.d.ts +0 -57
- package/dist/components/custom/dialog-native/index.d.ts +0 -1
- package/dist/components/custom/glass-panel/GlassPanel.vue.d.ts +0 -41
- package/dist/components/custom/glass-panel/index.d.ts +0 -2
- package/dist/components/custom/handmark/HandMark.vue.d.ts +0 -29
- package/dist/components/custom/handmark/brush.d.ts +0 -219
- package/dist/components/custom/handmark/freehand.d.ts +0 -69
- package/dist/components/custom/handmark/geometry.d.ts +0 -32
- package/dist/components/custom/handmark/index.d.ts +0 -21
- package/dist/components/custom/handmark/ink.d.ts +0 -11
- package/dist/components/custom/handmark/texture.d.ts +0 -39
- package/dist/components/custom/handmark/types.d.ts +0 -53
- package/dist/components/custom/handmark/useHandMark.d.ts +0 -66
- package/dist/components/custom/header-ribbon/HeaderRibbon.vue.d.ts +0 -31
- package/dist/components/custom/header-ribbon/index.d.ts +0 -2
- package/dist/components/custom/header-ribbon/types.d.ts +0 -7
- package/dist/components/custom/instrument-rail/InstrumentRail.vue.d.ts +0 -91
- package/dist/components/custom/instrument-rail/index.d.ts +0 -2
- package/dist/composables/motion/useRouteTransition.d.ts +0 -42
- package/dist/deck-progress.d.ts +0 -1
- package/dist/deck-progress.js +0 -2
- package/dist/dockContext-BKeIMmNk.js +0 -9
- package/dist/glass-panel.d.ts +0 -1
- package/dist/glass-panel.js +0 -44
- package/dist/handmark.d.ts +0 -1
- package/dist/handmark.js +0 -609
- package/dist/header-ribbon.d.ts +0 -1
- package/dist/header-ribbon.js +0 -63
- package/dist/instrument-rail.d.ts +0 -1
- package/dist/instrument-rail.js +0 -2
- package/dist/useGlassRenderer-D7YGOYiM.js +0 -69
- package/dist/useSpecularTracking-BVRZsRHA.js +0 -26
- package/dist/useSpringMount-BJSHcLl3.js +0 -113
- package/dist/useViewTransition-DaN5Zrox.js +0 -21
- package/dist/vReveal-zUIQk-rJ.js +0 -53
- /package/dist/{CollapsibleContent-CP9qF1v4.js → CollapsibleContent-Drow5WkV.js} +0 -0
- /package/dist/{DialogFooter-Gprw8H_A.js → DialogFooter-DufLHi0y.js} +0 -0
- /package/dist/{IconTooltip-Cus0fvK0.js → IconTooltip-BrQ5p181.js} +0 -0
- /package/dist/{Input-xuDwALQR.js → Input-B-F818RU.js} +0 -0
- /package/dist/{_plugin-vue_export-helper-ok8pgSl5.js → _plugin-vue_export-helper-DWghtRt7.js} +0 -0
- /package/dist/{compile-BOXjLUxu.js → compile-Ce_V55zi.js} +0 -0
- /package/dist/{constants-yKeKnE84.js → constants-C8NMonuo.js} +0 -0
- /package/dist/{presets-Dkdv55Gt.js → presets-1OhFpaIC.js} +0 -0
- /package/dist/{prng-D27-B3tK.js → prng-CjVgzjQT.js} +0 -0
- /package/dist/{resolveCanvasColor-BBiYfp8g.js → resolveCanvasColor-CRvVzOvP.js} +0 -0
- /package/dist/{useCanvas2D-ClrQuZtp.js → useCanvas2D-CSeH8h16.js} +0 -0
- /package/dist/{useGlobalDark-d6waty-X.js → useGlobalDark-D7R9OypB.js} +0 -0
- /package/dist/{useIntersectionPause-Cck5Uxk8.js → useIntersectionPause-DAdVPVp4.js} +0 -0
- /package/dist/{useInterval-Dsmqwi03.js → useInterval-D3USn0yc.js} +0 -0
- /package/dist/{useKeyboardShortcuts-CyIYrndH.js → useKeyboardShortcuts-i8tHd5WO.js} +0 -0
- /package/dist/{useScrollProgress-CffFGLa5.js → useScrollProgress-CcgmgMQt.js} +0 -0
- /package/dist/{useSortable-C8ReQ50P.js → useSortable-DnyGXKKY.js} +0 -0
- /package/dist/{useTextHighlight-CWEi25hf.js → useTextHighlight-B3b10W6r.js} +0 -0
package/dist/handmark.js
DELETED
|
@@ -1,609 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./_plugin-vue_export-helper-ok8pgSl5.js";
|
|
2
|
-
import { Fragment as t, computed as n, createCommentVNode as r, createElementBlock as i, defineComponent as a, normalizeClass as o, normalizeStyle as s, onBeforeUnmount as c, onMounted as l, openBlock as u, ref as d, renderList as f, renderSlot as p, unref as m, useId as h, watch as g } from "vue";
|
|
3
|
-
import { catmullRomToBezier as _, ellipsePoints as v, mulberry32 as y, perturbPoints as b, perturbPointsClosed as x, pointsToLinear as S, useLineBoil as C, wobbleLinePoints as w } from "@mkbabb/pencil-boil";
|
|
4
|
-
//#region src/components/custom/handmark/brush.ts
|
|
5
|
-
var T = {
|
|
6
|
-
pen: {
|
|
7
|
-
weight: 6,
|
|
8
|
-
weightJitter: .1,
|
|
9
|
-
thinning: .15,
|
|
10
|
-
taper: {
|
|
11
|
-
start: 14,
|
|
12
|
-
end: 14,
|
|
13
|
-
ease: "out-cubic"
|
|
14
|
-
},
|
|
15
|
-
ribbon: "stroke",
|
|
16
|
-
opacity: 1,
|
|
17
|
-
blend: "source-over",
|
|
18
|
-
passes: 1,
|
|
19
|
-
passOpacity: 0,
|
|
20
|
-
grain: 0,
|
|
21
|
-
grainFreq: .1,
|
|
22
|
-
grainScale: 0,
|
|
23
|
-
octaves: 2,
|
|
24
|
-
roughness: .7,
|
|
25
|
-
wobble: 1.2,
|
|
26
|
-
segments: 9,
|
|
27
|
-
cap: "round"
|
|
28
|
-
},
|
|
29
|
-
pencil: {
|
|
30
|
-
weight: 3,
|
|
31
|
-
weightJitter: .3,
|
|
32
|
-
thinning: .4,
|
|
33
|
-
taper: {
|
|
34
|
-
start: 8,
|
|
35
|
-
end: 18,
|
|
36
|
-
ease: "out-cubic"
|
|
37
|
-
},
|
|
38
|
-
ribbon: "stroke",
|
|
39
|
-
opacity: .6,
|
|
40
|
-
blend: "source-over",
|
|
41
|
-
passes: 1,
|
|
42
|
-
passOpacity: 0,
|
|
43
|
-
grain: .5,
|
|
44
|
-
grainFreq: .42,
|
|
45
|
-
grainScale: 1.5,
|
|
46
|
-
octaves: 3,
|
|
47
|
-
roughness: 1,
|
|
48
|
-
wobble: 1.6,
|
|
49
|
-
segments: 11,
|
|
50
|
-
cap: "round"
|
|
51
|
-
},
|
|
52
|
-
crayon: {
|
|
53
|
-
weight: 16,
|
|
54
|
-
weightJitter: 1,
|
|
55
|
-
thinning: .25,
|
|
56
|
-
taper: {
|
|
57
|
-
start: 6,
|
|
58
|
-
end: 6,
|
|
59
|
-
ease: "linear"
|
|
60
|
-
},
|
|
61
|
-
ribbon: "stroke",
|
|
62
|
-
opacity: .8,
|
|
63
|
-
blend: "source-over",
|
|
64
|
-
passes: 2,
|
|
65
|
-
passOpacity: .18,
|
|
66
|
-
grain: .85,
|
|
67
|
-
grainFreq: .16,
|
|
68
|
-
grainScale: 2.6,
|
|
69
|
-
octaves: 4,
|
|
70
|
-
roughness: 1.5,
|
|
71
|
-
wobble: 3,
|
|
72
|
-
segments: 13,
|
|
73
|
-
cap: "round"
|
|
74
|
-
},
|
|
75
|
-
marker: {
|
|
76
|
-
weight: 12,
|
|
77
|
-
weightJitter: .2,
|
|
78
|
-
thinning: .1,
|
|
79
|
-
taper: {
|
|
80
|
-
start: 4,
|
|
81
|
-
end: 10,
|
|
82
|
-
ease: "out-cubic"
|
|
83
|
-
},
|
|
84
|
-
ribbon: "stroke",
|
|
85
|
-
opacity: .92,
|
|
86
|
-
blend: "source-over",
|
|
87
|
-
passes: 1,
|
|
88
|
-
passOpacity: 0,
|
|
89
|
-
grain: .22,
|
|
90
|
-
grainFreq: .09,
|
|
91
|
-
grainScale: 1,
|
|
92
|
-
octaves: 3,
|
|
93
|
-
roughness: 1,
|
|
94
|
-
wobble: 2.2,
|
|
95
|
-
segments: 9,
|
|
96
|
-
cap: "square"
|
|
97
|
-
},
|
|
98
|
-
highlighter: {
|
|
99
|
-
weight: 26,
|
|
100
|
-
weightJitter: .05,
|
|
101
|
-
thinning: 0,
|
|
102
|
-
taper: {
|
|
103
|
-
start: 0,
|
|
104
|
-
end: 0,
|
|
105
|
-
ease: "linear"
|
|
106
|
-
},
|
|
107
|
-
ribbon: "stroke",
|
|
108
|
-
opacity: .38,
|
|
109
|
-
blend: "multiply",
|
|
110
|
-
passes: 1,
|
|
111
|
-
passOpacity: 0,
|
|
112
|
-
grain: .12,
|
|
113
|
-
grainFreq: .2,
|
|
114
|
-
grainScale: 1.5,
|
|
115
|
-
octaves: 2,
|
|
116
|
-
roughness: .5,
|
|
117
|
-
wobble: 1.4,
|
|
118
|
-
segments: 9,
|
|
119
|
-
cap: "square"
|
|
120
|
-
}
|
|
121
|
-
}, E = (e, t) => ({
|
|
122
|
-
...T[typeof e == "string" ? e : "pen"],
|
|
123
|
-
...typeof e == "object" ? e : {},
|
|
124
|
-
...t
|
|
125
|
-
}), D = (e, t, n) => {
|
|
126
|
-
let r = (e, t) => e + (t - e) * n, i = (e, t) => n < .5 ? e : t;
|
|
127
|
-
return {
|
|
128
|
-
weight: r(e.weight, t.weight),
|
|
129
|
-
weightJitter: r(e.weightJitter, t.weightJitter),
|
|
130
|
-
thinning: r(e.thinning, t.thinning),
|
|
131
|
-
taper: {
|
|
132
|
-
start: r(e.taper.start, t.taper.start),
|
|
133
|
-
end: r(e.taper.end, t.taper.end),
|
|
134
|
-
ease: i(e.taper.ease, t.taper.ease)
|
|
135
|
-
},
|
|
136
|
-
ribbon: i(e.ribbon, t.ribbon),
|
|
137
|
-
opacity: r(e.opacity, t.opacity),
|
|
138
|
-
blend: i(e.blend, t.blend),
|
|
139
|
-
passes: Math.max(1, Math.round(r(e.passes, t.passes))),
|
|
140
|
-
passOpacity: r(e.passOpacity, t.passOpacity),
|
|
141
|
-
grain: r(e.grain, t.grain),
|
|
142
|
-
grainFreq: r(e.grainFreq, t.grainFreq),
|
|
143
|
-
grainScale: r(e.grainScale, t.grainScale),
|
|
144
|
-
octaves: Math.max(1, Math.round(r(e.octaves, t.octaves))),
|
|
145
|
-
roughness: r(e.roughness, t.roughness),
|
|
146
|
-
wobble: r(e.wobble, t.wobble),
|
|
147
|
-
segments: Math.max(2, Math.round(r(e.segments, t.segments))),
|
|
148
|
-
cap: i(e.cap, t.cap)
|
|
149
|
-
};
|
|
150
|
-
}, O = 100, k = 40;
|
|
151
|
-
function A(e, t, n = null) {
|
|
152
|
-
let r = n ? n.x : 4, i = n ? n.x + n.w : 96, a = n ? n.y + n.h / 2 : 40 / 2, o = n ? n.y + n.h * .92 : 32, s = t.seed ?? 1, c = (e, n, r, i, a = 0) => w(e, n, r, i, {
|
|
153
|
-
...t,
|
|
154
|
-
seed: s + a
|
|
155
|
-
});
|
|
156
|
-
switch (e) {
|
|
157
|
-
case "underline": return {
|
|
158
|
-
lines: [c(r, o, i, o)],
|
|
159
|
-
closed: !1
|
|
160
|
-
};
|
|
161
|
-
case "strikethrough": return {
|
|
162
|
-
lines: [c(r, a, i, a)],
|
|
163
|
-
closed: !1
|
|
164
|
-
};
|
|
165
|
-
case "highlight": return {
|
|
166
|
-
lines: [c(r, a, i, a)],
|
|
167
|
-
closed: !1
|
|
168
|
-
};
|
|
169
|
-
case "box": {
|
|
170
|
-
let e = n ? n.y : 4, t = n ? n.y + n.h : 36;
|
|
171
|
-
return {
|
|
172
|
-
lines: [
|
|
173
|
-
c(r, e, i, e, 0),
|
|
174
|
-
c(i, e, i, t, 1),
|
|
175
|
-
c(i, t, r, t, 2),
|
|
176
|
-
c(r, t, r, e, 3)
|
|
177
|
-
],
|
|
178
|
-
closed: !1
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
case "bracket": {
|
|
182
|
-
let e = n ? n.y : 4, t = n ? n.y + n.h : 36, a = (i - r) * .22;
|
|
183
|
-
return {
|
|
184
|
-
lines: [
|
|
185
|
-
c(r + a, e, r, e, 0),
|
|
186
|
-
c(r, e, r, t, 1),
|
|
187
|
-
c(r, t, r + a, t, 2)
|
|
188
|
-
],
|
|
189
|
-
closed: !1
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
case "circle": return {
|
|
193
|
-
lines: [v(n ? n.x + n.w / 2 : 100 / 2, n ? n.y + n.h / 2 : 40 / 2, (n ? n.w / 2 : 100 / 2) - 3, (n ? n.h / 2 : 40 / 2) - 3, t)],
|
|
194
|
-
closed: !0
|
|
195
|
-
};
|
|
196
|
-
case "path": return {
|
|
197
|
-
lines: [],
|
|
198
|
-
closed: !1
|
|
199
|
-
};
|
|
200
|
-
default: return {
|
|
201
|
-
lines: [c(r, o, i, o)],
|
|
202
|
-
closed: !1
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
function j({ lines: e, closed: t }, n, r) {
|
|
207
|
-
return e.map((e, i) => {
|
|
208
|
-
if (t) return x(e, n, r + i);
|
|
209
|
-
let a = e[0], o = e[e.length - 1];
|
|
210
|
-
return b(e, a[0], a[1], o[0], o[1], n, r + i);
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
function M(e, t = !1) {
|
|
214
|
-
return e.map((e) => t ? S(e) : _(e)).join(" ");
|
|
215
|
-
}
|
|
216
|
-
//#endregion
|
|
217
|
-
//#region src/components/custom/handmark/freehand.ts
|
|
218
|
-
var N = (e, t) => [e[0] + t[0], e[1] + t[1]], P = (e, t) => [e[0] - t[0], e[1] - t[1]], F = (e, t) => [e[0] * t, e[1] * t], I = (e) => [-e[0], -e[1]], L = (e) => [e[1], -e[0]], R = (e, t) => e[0] * t[0] + e[1] * t[1], z = (e) => e[0] * e[0] + e[1] * e[1], B = (e, t) => z(P(e, t)), V = (e, t) => Math.hypot(e[1] - t[1], e[0] - t[0]), ee = (e) => F(e, 1 / (Math.hypot(e[0], e[1]) || 1)), H = (e, t, n) => N(e, F(P(t, e), n)), U = (e, t) => F(N(e, t), .5), W = (e, t, n) => {
|
|
219
|
-
let r = Math.sin(n), i = Math.cos(n), a = e[0] - t[0], o = e[1] - t[1];
|
|
220
|
-
return [a * i - o * r + t[0], a * r + o * i + t[1]];
|
|
221
|
-
}, { min: G, PI: te } = Math, K = te + 1e-4, q = (e) => e;
|
|
222
|
-
function J(e, t = {}) {
|
|
223
|
-
let { streamline: n = .5, size: r = 16, last: i = !1 } = t;
|
|
224
|
-
if (e.length === 0) return [];
|
|
225
|
-
let a = .15 + (1 - n) * .85, o = e.map((e) => [
|
|
226
|
-
e[0],
|
|
227
|
-
e[1],
|
|
228
|
-
e[2] ?? .5
|
|
229
|
-
]);
|
|
230
|
-
if (o.length === 2) {
|
|
231
|
-
let e = o[1];
|
|
232
|
-
o[1] = H(o[0], e, .5), o.push(e);
|
|
233
|
-
}
|
|
234
|
-
o.length === 1 && o.push([...N(o[0], [1, 1]), ...o[0].slice(2)]);
|
|
235
|
-
let s = [{
|
|
236
|
-
point: [o[0][0], o[0][1]],
|
|
237
|
-
pressure: o[0][2] >= 0 ? o[0][2] : .25,
|
|
238
|
-
vector: [1, 1],
|
|
239
|
-
distance: 0,
|
|
240
|
-
runningLength: 0
|
|
241
|
-
}], c = !1, l = 0, u = s[0], d = o.length - 1;
|
|
242
|
-
for (let e = 1; e < o.length; e++) {
|
|
243
|
-
let t = i && e === d ? [o[e][0], o[e][1]] : H(u.point, [o[e][0], o[e][1]], a);
|
|
244
|
-
if (B(u.point, t) < 1e-4) continue;
|
|
245
|
-
let n = V(t, u.point);
|
|
246
|
-
if (l += n, e < d && !c) {
|
|
247
|
-
if (l < r) continue;
|
|
248
|
-
c = !0;
|
|
249
|
-
}
|
|
250
|
-
u = {
|
|
251
|
-
point: t,
|
|
252
|
-
pressure: o[e][2] >= 0 ? o[e][2] : .5,
|
|
253
|
-
vector: ee(P(u.point, t)),
|
|
254
|
-
distance: n,
|
|
255
|
-
runningLength: l
|
|
256
|
-
}, s.push(u);
|
|
257
|
-
}
|
|
258
|
-
return s.length > 0 && (s[0].vector = s[1]?.vector ?? [0, 0]), s;
|
|
259
|
-
}
|
|
260
|
-
function ne(e, t = {}) {
|
|
261
|
-
let { size: n = 16, smoothing: r = .5, thinning: i = .5, simulatePressure: a = !0, easing: o = q, start: s = {}, end: c = {}, last: l = !1 } = t, { cap: u = !0, easing: d = (e) => e * (2 - e) } = s, { cap: f = !0, easing: p = (e) => --e * e * e + 1 } = c;
|
|
262
|
-
if (e.length === 0 || n <= 0) return [];
|
|
263
|
-
let m = e[e.length - 1].runningLength, h = s.taper === !1 ? 0 : s.taper === !0 ? Math.max(n, m) : s.taper ?? 0, g = c.taper === !1 ? 0 : c.taper === !0 ? Math.max(n, m) : c.taper ?? 0, _ = (n * r) ** 2, v = [], y = [], b = [], x = e.slice(0, 10).reduce((e, t) => {
|
|
264
|
-
let r = t.pressure;
|
|
265
|
-
if (a) {
|
|
266
|
-
let i = G(1, t.distance / n);
|
|
267
|
-
r = G(1, e + (G(1, 1 - i) - e) * (i * .275));
|
|
268
|
-
}
|
|
269
|
-
return (e + r) / 2;
|
|
270
|
-
}, e[0].pressure), S = Y(n, i, e[e.length - 1].pressure, o), C, w = e[0].vector, T = e[0].point, E = T, D = T, O = E, k = !1;
|
|
271
|
-
for (let t = 0; t < e.length; t++) {
|
|
272
|
-
let { pressure: r } = e[t], { point: s, vector: c, distance: l, runningLength: u } = e[t];
|
|
273
|
-
if (t < e.length - 1 && m - u < 3) continue;
|
|
274
|
-
if (i) {
|
|
275
|
-
if (a) {
|
|
276
|
-
let e = G(1, l / n), t = G(1, 1 - e);
|
|
277
|
-
r = G(1, x + (t - x) * (e * .275));
|
|
278
|
-
}
|
|
279
|
-
S = Y(n, i, r, o);
|
|
280
|
-
} else S = n / 2;
|
|
281
|
-
C === void 0 && (C = S);
|
|
282
|
-
let f = u < h ? d(u / h) : 1, A = m - u < g ? p((m - u) / g) : 1;
|
|
283
|
-
S = Math.max(.01, S * Math.min(f, A));
|
|
284
|
-
let j = (t < e.length - 1 ? e[t + 1] : e[t]).vector, M = t < e.length - 1 ? R(c, j) : 1, I = R(c, w) < 0 && !k, z = M !== null && M < .2;
|
|
285
|
-
if (I || z) {
|
|
286
|
-
let e = F(L(w), S);
|
|
287
|
-
for (let t = 0; t <= 1; t += .07692307692307693) D = W(P(s, e), s, K * t), v.push(D), O = W(N(s, e), s, K * -t), y.push(O);
|
|
288
|
-
T = D, E = O, z && (k = !0);
|
|
289
|
-
continue;
|
|
290
|
-
}
|
|
291
|
-
if (k = !1, t === e.length - 1) {
|
|
292
|
-
let e = F(L(c), S);
|
|
293
|
-
v.push(P(s, e)), y.push(N(s, e));
|
|
294
|
-
continue;
|
|
295
|
-
}
|
|
296
|
-
let V = F(L(H(j, c, M)), S);
|
|
297
|
-
D = P(s, V), (t <= 1 || B(T, D) > _) && (v.push(D), T = D), O = N(s, V), (t <= 1 || B(E, O) > _) && (y.push(O), E = O), x = r, w = c, b.push(S);
|
|
298
|
-
}
|
|
299
|
-
let A = e[0].point.slice(0, 2), j = e.length > 1 ? e[e.length - 1].point.slice(0, 2) : N(e[0].point, [1, 1]), M = [], z = [];
|
|
300
|
-
if (e.length === 1) {
|
|
301
|
-
if (!(h || g) || l) {
|
|
302
|
-
let e = N(A, F(ee(L(P(A, j))), -(C ?? S))), t = [];
|
|
303
|
-
for (let n = 1 / 13, r = n; r <= 1; r += n) t.push(W(e, A, K * 2 * r));
|
|
304
|
-
return t;
|
|
305
|
-
}
|
|
306
|
-
} else {
|
|
307
|
-
if (!(h || g && e.length === 1)) if (u) for (let e = 1 / 13, t = e; t <= 1; t += e) {
|
|
308
|
-
let e = W(y[0], A, K * t);
|
|
309
|
-
M.push(e);
|
|
310
|
-
}
|
|
311
|
-
else {
|
|
312
|
-
let e = P(v[0], y[0]), t = F(e, .5), n = F(e, .51);
|
|
313
|
-
M.push(P(A, t), P(A, n), N(A, n), N(A, t));
|
|
314
|
-
}
|
|
315
|
-
let t = L(I(e[e.length - 1].vector));
|
|
316
|
-
if (g || h && e.length === 1) z.push(j);
|
|
317
|
-
else if (f) {
|
|
318
|
-
let e = N(j, F(t, S));
|
|
319
|
-
for (let t = 1 / 29, n = t; n < 1; n += t) z.push(W(e, j, K * 3 * n));
|
|
320
|
-
} else z.push(N(j, F(t, S)), N(j, F(t, S * .99)), P(j, F(t, S * .99)), P(j, F(t, S)));
|
|
321
|
-
}
|
|
322
|
-
return v.concat(z, y.reverse(), M);
|
|
323
|
-
}
|
|
324
|
-
function Y(e, t, n, r = q) {
|
|
325
|
-
if (!t) return e / 2;
|
|
326
|
-
let i = n;
|
|
327
|
-
return i < 0 && (i = 0), i > 1 && (i = 1), e * r(.5 - t * (.5 - i)) * .5 + e / 2 * (1 - Math.abs(t));
|
|
328
|
-
}
|
|
329
|
-
function X(e, t = {}) {
|
|
330
|
-
return ne(J(e, t), t);
|
|
331
|
-
}
|
|
332
|
-
function Z(e, t = !0) {
|
|
333
|
-
if (e.length < 4) return "";
|
|
334
|
-
let n = e[0], r = e[1], i = e[2], a = `M${n[0].toFixed(2)},${n[1].toFixed(2)} Q${r[0].toFixed(2)},${r[1].toFixed(2)} ${U(r, i)[0].toFixed(2)},${U(r, i)[1].toFixed(2)} T`;
|
|
335
|
-
for (let t = 2, i = e.length - 1; t < i; t++) n = e[t], r = e[t + 1], a += `${U(n, r)[0].toFixed(2)},${U(n, r)[1].toFixed(2)} `;
|
|
336
|
-
return t && (a += "Z"), a;
|
|
337
|
-
}
|
|
338
|
-
//#endregion
|
|
339
|
-
//#region src/components/custom/handmark/texture.ts
|
|
340
|
-
function Q(e, t, n) {
|
|
341
|
-
if (t.grain <= 0 && t.grainScale <= 0) return "";
|
|
342
|
-
let r = (n ^ 34283) & 65535, i = (.55 - t.grain * .42).toFixed(3), a = t.grain > 0 ? "in" : "over";
|
|
343
|
-
return `
|
|
344
|
-
<filter id="${e}" x="-40%" y="-60%" width="180%" height="220%" color-interpolation-filters="sRGB">
|
|
345
|
-
<feTurbulence type="fractalNoise" baseFrequency="${(.012 * t.roughness).toFixed(4)}" numOctaves="2" seed="${r}" result="warp"/>
|
|
346
|
-
<feDisplacementMap in="SourceGraphic" in2="warp" scale="${(t.grainScale * 1.4).toFixed(2)}" xChannelSelector="R" yChannelSelector="G" result="wob"/>
|
|
347
|
-
<feTurbulence type="fractalNoise" baseFrequency="${t.grainFreq}" numOctaves="${t.octaves}" seed="${r + 17}" result="grain"/>
|
|
348
|
-
<feColorMatrix in="grain" type="matrix" result="grainA"
|
|
349
|
-
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ${(6 + t.grain * 10).toFixed(2)} ${i}"/>
|
|
350
|
-
<feComposite in="wob" in2="grainA" operator="${a}" result="grained"/>
|
|
351
|
-
<feDisplacementMap in="grained" in2="grain" scale="${(t.grainScale * 2).toFixed(2)}" xChannelSelector="R" yChannelSelector="G"/>
|
|
352
|
-
</filter>`;
|
|
353
|
-
}
|
|
354
|
-
function $(e) {
|
|
355
|
-
return e.grain > 0 || e.grainScale > 0;
|
|
356
|
-
}
|
|
357
|
-
//#endregion
|
|
358
|
-
//#region src/components/custom/handmark/ink.ts
|
|
359
|
-
function re(e) {
|
|
360
|
-
let t = 0;
|
|
361
|
-
for (let n = 1; n < e.length; n++) t += Math.hypot(e[n][0] - e[n - 1][0], e[n][1] - e[n - 1][1]);
|
|
362
|
-
return t;
|
|
363
|
-
}
|
|
364
|
-
function ie(e, t, n) {
|
|
365
|
-
let r = y(n);
|
|
366
|
-
return e.map((n, i) => {
|
|
367
|
-
let a = i / Math.max(1, e.length - 1), o = .5 + .35 * Math.sin(Math.PI * a) + (r() - .5) * t.weightJitter * .4;
|
|
368
|
-
return [
|
|
369
|
-
n[0],
|
|
370
|
-
n[1],
|
|
371
|
-
Math.max(.05, Math.min(1, o))
|
|
372
|
-
];
|
|
373
|
-
});
|
|
374
|
-
}
|
|
375
|
-
function ae(e) {
|
|
376
|
-
return e === "out-cubic" ? (e) => 1 - (1 - e) ** 3 : (e) => e;
|
|
377
|
-
}
|
|
378
|
-
function oe(e, t, n, r, i, a = !1) {
|
|
379
|
-
if (t.stamp) {
|
|
380
|
-
let i = y(n), a = t.stamp({
|
|
381
|
-
centerline: e,
|
|
382
|
-
brush: t,
|
|
383
|
-
rng: i,
|
|
384
|
-
seed: n,
|
|
385
|
-
length: re(e),
|
|
386
|
-
color: r
|
|
387
|
-
});
|
|
388
|
-
return {
|
|
389
|
-
paths: a.paths,
|
|
390
|
-
filterId: a.filterId ?? null,
|
|
391
|
-
defs: a.defs ?? []
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
let o = [], s = (e) => a ? S(e) : _(e);
|
|
395
|
-
for (let i = 0; i < t.passes; i++) {
|
|
396
|
-
let a = e[0], c = e[e.length - 1], l = b(e, a[0], a[1], c[0], c[1], t.weight * .06, n + 991 * i), u = t.opacity * (1 - t.passOpacity * i);
|
|
397
|
-
if (t.ribbon === "hull") {
|
|
398
|
-
let e = X(ie(l, t, n + 7 * i), {
|
|
399
|
-
size: t.weight,
|
|
400
|
-
thinning: t.thinning,
|
|
401
|
-
streamline: Math.max(.1, .55 - t.roughness * .1),
|
|
402
|
-
last: !0,
|
|
403
|
-
start: {
|
|
404
|
-
taper: t.taper.start,
|
|
405
|
-
easing: ae(t.taper.ease)
|
|
406
|
-
},
|
|
407
|
-
end: {
|
|
408
|
-
taper: t.taper.end,
|
|
409
|
-
easing: ae(t.taper.ease)
|
|
410
|
-
}
|
|
411
|
-
});
|
|
412
|
-
o.push({
|
|
413
|
-
d: Z(e),
|
|
414
|
-
fill: r,
|
|
415
|
-
opacity: u,
|
|
416
|
-
blend: t.blend
|
|
417
|
-
});
|
|
418
|
-
} else o.push({
|
|
419
|
-
d: s(l),
|
|
420
|
-
stroke: r,
|
|
421
|
-
opacity: u,
|
|
422
|
-
blend: t.blend
|
|
423
|
-
});
|
|
424
|
-
}
|
|
425
|
-
let c = $(t) ? Q(i, t, n) : "";
|
|
426
|
-
return {
|
|
427
|
-
paths: o,
|
|
428
|
-
filterId: c ? i : null,
|
|
429
|
-
defs: c ? [c] : []
|
|
430
|
-
};
|
|
431
|
-
}
|
|
432
|
-
//#endregion
|
|
433
|
-
//#region src/components/custom/handmark/useHandMark.ts
|
|
434
|
-
function se(e, t) {
|
|
435
|
-
return {
|
|
436
|
-
brush: e.brush ?? "pen",
|
|
437
|
-
shape: e.shape ?? "underline",
|
|
438
|
-
color: e.color ?? "currentColor",
|
|
439
|
-
seed: e.seed ?? 1,
|
|
440
|
-
overrides: e.overrides,
|
|
441
|
-
animation: e.animation ?? "none",
|
|
442
|
-
boilFps: e.boilFps ?? 8,
|
|
443
|
-
boilFrames: e.boilFrames ?? 3,
|
|
444
|
-
roughness: e.roughness ?? null,
|
|
445
|
-
segments: e.segments ?? null,
|
|
446
|
-
jagged: e.jagged ?? !1,
|
|
447
|
-
box: e.box ?? null,
|
|
448
|
-
path: e.path ?? null,
|
|
449
|
-
filterId: t
|
|
450
|
-
};
|
|
451
|
-
}
|
|
452
|
-
function ce(e) {
|
|
453
|
-
let t = n(() => {
|
|
454
|
-
let t = { ...e.value.overrides ?? {} };
|
|
455
|
-
return e.value.roughness != null && (t.roughness = e.value.roughness), e.value.segments != null && (t.segments = e.value.segments), E(e.value.brush, t);
|
|
456
|
-
}), r = n(() => $(t.value)), i = n(() => A(e.value.shape, {
|
|
457
|
-
roughness: t.value.roughness,
|
|
458
|
-
segments: t.value.segments,
|
|
459
|
-
seed: e.value.seed,
|
|
460
|
-
jagged: e.value.jagged
|
|
461
|
-
}, e.value.box)), a = n(() => e.value.animation === "boil" || e.value.animation === "draw-then-boil"), o = n(() => e.value.animation === "draw-on" || e.value.animation === "draw-then-boil"), s = n(() => r.value ? "clip" : "dashoffset"), c = d(!1), l = C(() => a.value && c.value ? e.value.boilFrames : 1, () => Math.max(16, 1e3 / e.value.boilFps)), u = n(() => {
|
|
462
|
-
if (e.value.path) return e.value.path;
|
|
463
|
-
let n = i.value.lines;
|
|
464
|
-
if (a.value && c.value) {
|
|
465
|
-
let r = t.value.wobble * .4 + .4, a = l.currentFrame.value;
|
|
466
|
-
n = j(i.value, r, e.value.seed + a * 31);
|
|
467
|
-
}
|
|
468
|
-
return M(n, e.value.jagged);
|
|
469
|
-
}), f = n(() => e.value.path ? [] : a.value && c.value ? j(i.value, t.value.wobble * .4 + .4, e.value.seed + l.currentFrame.value * 31) : i.value.lines);
|
|
470
|
-
return {
|
|
471
|
-
brush: t,
|
|
472
|
-
baseGeom: i,
|
|
473
|
-
fragment: n(() => {
|
|
474
|
-
let n = {
|
|
475
|
-
paths: [],
|
|
476
|
-
filterId: null,
|
|
477
|
-
defs: []
|
|
478
|
-
}, r = f.value.length ? f.value : [[]];
|
|
479
|
-
for (let i of r) {
|
|
480
|
-
let r = oe(i, t.value, e.value.seed, e.value.color, e.value.filterId, e.value.jagged);
|
|
481
|
-
n.paths.push(...r.paths), r.filterId && !n.filterId && (n.filterId = r.filterId, n.defs = r.defs);
|
|
482
|
-
}
|
|
483
|
-
return n;
|
|
484
|
-
}),
|
|
485
|
-
pathD: u,
|
|
486
|
-
grained: r,
|
|
487
|
-
drawKind: s,
|
|
488
|
-
draws: o,
|
|
489
|
-
boils: a,
|
|
490
|
-
boil: l,
|
|
491
|
-
boilArmed: c
|
|
492
|
-
};
|
|
493
|
-
}
|
|
494
|
-
//#endregion
|
|
495
|
-
//#region src/components/custom/handmark/HandMark.vue?vue&type=script&setup=true&lang.ts
|
|
496
|
-
var le = [
|
|
497
|
-
"data-shape",
|
|
498
|
-
"data-behind",
|
|
499
|
-
"data-grained"
|
|
500
|
-
], ue = ["viewBox"], de = ["innerHTML"], fe = [
|
|
501
|
-
"d",
|
|
502
|
-
"stroke",
|
|
503
|
-
"fill",
|
|
504
|
-
"stroke-width",
|
|
505
|
-
"stroke-opacity",
|
|
506
|
-
"fill-opacity",
|
|
507
|
-
"filter"
|
|
508
|
-
], pe = 100, me = 40, he = /* @__PURE__ */ e(/* @__PURE__ */ a({
|
|
509
|
-
__name: "HandMark",
|
|
510
|
-
props: {
|
|
511
|
-
brush: { default: "pen" },
|
|
512
|
-
shape: { default: "underline" },
|
|
513
|
-
color: { default: "currentColor" },
|
|
514
|
-
seed: { default: 1 },
|
|
515
|
-
overrides: {},
|
|
516
|
-
animation: { default: "none" },
|
|
517
|
-
drawMs: { default: 800 },
|
|
518
|
-
drawDelayMs: { default: 0 },
|
|
519
|
-
appear: { default: "visible" },
|
|
520
|
-
boilFps: { default: 8 },
|
|
521
|
-
boilFrames: { default: 3 },
|
|
522
|
-
roughness: {},
|
|
523
|
-
segments: {},
|
|
524
|
-
jagged: {
|
|
525
|
-
type: Boolean,
|
|
526
|
-
default: !1
|
|
527
|
-
},
|
|
528
|
-
box: {},
|
|
529
|
-
path: {},
|
|
530
|
-
points: {}
|
|
531
|
-
},
|
|
532
|
-
setup(e, { expose: a }) {
|
|
533
|
-
let _ = e, v = `hm-${h().replace(/[^a-zA-Z0-9_-]/g, "")}`, { brush: y, fragment: b, grained: x, drawKind: S, draws: C, boils: w, boil: T, boilArmed: E } = ce(n(() => se(_, v))), D = n(() => _.shape === "highlight"), O = n(() => _.path ?? null), k = d(!1), A = d(null), j = n(() => C.value ? `${S.value === "clip" ? "clip-path" : "stroke-dashoffset"} ${_.drawMs}ms cubic-bezier(.16,1,.3,1) ${_.drawDelayMs}ms` : "none");
|
|
534
|
-
function M() {
|
|
535
|
-
w.value && (E.value = !0, T.start());
|
|
536
|
-
}
|
|
537
|
-
function N() {
|
|
538
|
-
if (!C.value) {
|
|
539
|
-
M();
|
|
540
|
-
return;
|
|
541
|
-
}
|
|
542
|
-
k.value = !1, A.value && A.value.offsetWidth, requestAnimationFrame(() => {
|
|
543
|
-
k.value = !0;
|
|
544
|
-
});
|
|
545
|
-
}
|
|
546
|
-
function P() {
|
|
547
|
-
_.animation === "draw-then-boil" && M();
|
|
548
|
-
}
|
|
549
|
-
a({ play: N });
|
|
550
|
-
let F = null;
|
|
551
|
-
l(() => {
|
|
552
|
-
_.animation === "boil" && M(), _.appear === "mount" ? N() : _.appear === "visible" && typeof IntersectionObserver < "u" ? (F = new IntersectionObserver((e) => {
|
|
553
|
-
e.some((e) => e.isIntersecting) && (N(), F?.disconnect());
|
|
554
|
-
}, { threshold: .35 }), A.value && F.observe(A.value)) : _.appear === "visible" && N();
|
|
555
|
-
}), c(() => {
|
|
556
|
-
F?.disconnect(), T.stop();
|
|
557
|
-
}), g(() => _.animation, () => {
|
|
558
|
-
k.value = !1, E.value = !1;
|
|
559
|
-
});
|
|
560
|
-
let I = {
|
|
561
|
-
"source-over": "normal",
|
|
562
|
-
multiply: "multiply",
|
|
563
|
-
darken: "darken",
|
|
564
|
-
screen: "screen"
|
|
565
|
-
};
|
|
566
|
-
function L(e) {
|
|
567
|
-
return {
|
|
568
|
-
mixBlendMode: I[e],
|
|
569
|
-
transition: j.value
|
|
570
|
-
};
|
|
571
|
-
}
|
|
572
|
-
return (n, a) => (u(), i("span", {
|
|
573
|
-
class: "hm",
|
|
574
|
-
ref_key: "root",
|
|
575
|
-
ref: A,
|
|
576
|
-
"data-shape": e.shape,
|
|
577
|
-
"data-behind": D.value,
|
|
578
|
-
"data-grained": m(x)
|
|
579
|
-
}, [p(n.$slots, "default", {}, void 0, !0), (u(), i("svg", {
|
|
580
|
-
class: "hm__svg",
|
|
581
|
-
viewBox: `0 0 ${pe} ${me}`,
|
|
582
|
-
preserveAspectRatio: "none",
|
|
583
|
-
"aria-hidden": "true",
|
|
584
|
-
focusable: "false"
|
|
585
|
-
}, [m(b).filterId ? (u(), i("defs", {
|
|
586
|
-
key: 0,
|
|
587
|
-
innerHTML: m(b).defs[0]
|
|
588
|
-
}, null, 8, de)) : r("", !0), (u(!0), i(t, null, f(m(b).paths, (e, t) => (u(), i("path", {
|
|
589
|
-
key: t,
|
|
590
|
-
class: o(["hm__path", {
|
|
591
|
-
drawn: k.value,
|
|
592
|
-
[`hm__path--${m(S)}`]: m(C)
|
|
593
|
-
}]),
|
|
594
|
-
d: O.value ?? e.d,
|
|
595
|
-
pathLength: "1",
|
|
596
|
-
"vector-effect": "non-scaling-stroke",
|
|
597
|
-
stroke: e.stroke ?? "none",
|
|
598
|
-
fill: e.fill ?? "none",
|
|
599
|
-
"stroke-width": e.stroke ? m(y).weight : 0,
|
|
600
|
-
"stroke-opacity": e.stroke ? e.opacity : void 0,
|
|
601
|
-
"fill-opacity": e.fill ? e.opacity : void 0,
|
|
602
|
-
filter: m(b).filterId ? `url(#${m(b).filterId})` : void 0,
|
|
603
|
-
style: s(L(e.blend)),
|
|
604
|
-
onTransitionend: P
|
|
605
|
-
}, null, 46, fe))), 128))], 8, ue))], 8, le));
|
|
606
|
-
}
|
|
607
|
-
}), [["__scopeId", "data-v-c600d5df"]]);
|
|
608
|
-
//#endregion
|
|
609
|
-
export { T as BRUSHES, he as HandMark, he as InkMark, k as VB_H, O as VB_W, j as boilLines, X as getStroke, J as getStrokePoints, Z as getSvgPathFromStroke, Q as grainFilter, $ as hasGrain, oe as ink, D as lerpBrush, se as normalizeProps, E as resolveBrush, M as serialize, A as shapeGeom, ce as useHandMark };
|
package/dist/header-ribbon.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./components/custom/header-ribbon";
|
package/dist/header-ribbon.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./_plugin-vue_export-helper-ok8pgSl5.js";
|
|
2
|
-
import { computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, normalizeClass as o, onBeforeUnmount as s, openBlock as c, ref as l, renderSlot as u } from "vue";
|
|
3
|
-
//#region src/components/custom/header-ribbon/HeaderRibbon.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var d = {
|
|
5
|
-
key: 0,
|
|
6
|
-
class: "pointer-events-auto shrink-0 mr-2"
|
|
7
|
-
}, f = /* @__PURE__ */ e(/* @__PURE__ */ a({
|
|
8
|
-
__name: "HeaderRibbon",
|
|
9
|
-
props: {
|
|
10
|
-
position: { default: "left" },
|
|
11
|
-
hideTimeoutMs: { default: 2e3 }
|
|
12
|
-
},
|
|
13
|
-
setup(e, { expose: a }) {
|
|
14
|
-
let f = e, p = l(!1), m = l(!1), h = l(!1), g = l(!1), _, v = t(() => p.value || m.value);
|
|
15
|
-
function y() {
|
|
16
|
-
_ != null && (clearTimeout(_), _ = void 0);
|
|
17
|
-
}
|
|
18
|
-
function b() {
|
|
19
|
-
g.value || (y(), _ = setTimeout(() => {
|
|
20
|
-
p.value = !1;
|
|
21
|
-
}, f.hideTimeoutMs));
|
|
22
|
-
}
|
|
23
|
-
function x() {
|
|
24
|
-
g.value = !0, y(), p.value = !0;
|
|
25
|
-
}
|
|
26
|
-
function S() {
|
|
27
|
-
g.value = !1, m.value || b();
|
|
28
|
-
}
|
|
29
|
-
function C() {
|
|
30
|
-
m.value ? (m.value = !1, h.value = !1, b()) : (m.value = !0, p.value = !0, h.value = !0, y());
|
|
31
|
-
}
|
|
32
|
-
return s(y), a({
|
|
33
|
-
isPinned: m,
|
|
34
|
-
isExpanded: p,
|
|
35
|
-
isVisible: v,
|
|
36
|
-
isToggled: h
|
|
37
|
-
}), (t, a) => (c(), r("div", {
|
|
38
|
-
class: o(["fixed z-dock pointer-events-none w-fit flex items-center px-4 pt-4 pb-2", e.position === "left" ? "top-0 left-0" : "top-0 right-0"]),
|
|
39
|
-
onMouseleave: S
|
|
40
|
-
}, [t.$slots.left ? (c(), r("div", d, [u(t.$slots, "left", {}, void 0, !0)])) : n("", !0), i("div", {
|
|
41
|
-
class: "pointer-events-auto flex items-center h-6",
|
|
42
|
-
onMouseenter: x
|
|
43
|
-
}, [
|
|
44
|
-
e.position === "right" ? (c(), r("div", {
|
|
45
|
-
key: 0,
|
|
46
|
-
class: o(["header-items-wrapper header-items-right flex items-center gap-3", v.value ? "" : "header-collapsed-right"])
|
|
47
|
-
}, [u(t.$slots, "items", {}, void 0, !0)], 2)) : n("", !0),
|
|
48
|
-
i("div", {
|
|
49
|
-
class: "shrink-0",
|
|
50
|
-
onClick: C
|
|
51
|
-
}, [u(t.$slots, "anchor", {
|
|
52
|
-
pinned: m.value,
|
|
53
|
-
toggled: h.value
|
|
54
|
-
}, void 0, !0)]),
|
|
55
|
-
e.position === "left" ? (c(), r("div", {
|
|
56
|
-
key: 1,
|
|
57
|
-
class: o(["header-items-wrapper header-items-left flex items-center gap-3", v.value ? "" : "header-collapsed-left"])
|
|
58
|
-
}, [u(t.$slots, "items", {}, void 0, !0)], 2)) : n("", !0)
|
|
59
|
-
], 32)], 34));
|
|
60
|
-
}
|
|
61
|
-
}), [["__scopeId", "data-v-7f77154a"]]);
|
|
62
|
-
//#endregion
|
|
63
|
-
export { f as HeaderRibbon };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./components/custom/instrument-rail";
|
package/dist/instrument-rail.js
DELETED