@easemate/web-kit 0.1.5 → 0.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/README.md +360 -168
- package/build/decorators.cjs +921 -0
- package/build/decorators.cjs.map +1 -0
- package/build/decorators.d.cts +123 -0
- package/build/decorators.d.ts +123 -0
- package/build/decorators.js +889 -0
- package/build/decorators.js.map +1 -0
- package/build/elements.cjs +27604 -0
- package/build/elements.cjs.map +1 -0
- package/build/elements.d.cts +373 -0
- package/build/elements.d.ts +373 -0
- package/build/elements.js +27528 -0
- package/build/elements.js.map +1 -0
- package/build/{elements/monitor/index.d.ts → index-31iOHBv0.d.cts} +26 -5
- package/build/{elements/monitor/index.d.cts → index-31iOHBv0.d.ts} +26 -5
- package/build/index-NzGpn7ai.d.cts +70 -0
- package/build/index-NzGpn7ai.d.ts +70 -0
- package/build/index-qZoNKsHn.d.cts +136 -0
- package/build/index-qZoNKsHn.d.ts +136 -0
- package/build/index.cjs +38651 -38
- package/build/index.cjs.map +1 -0
- package/build/index.d.cts +85 -6
- package/build/index.d.ts +85 -6
- package/build/index.js +38535 -12
- package/build/index.js.map +1 -0
- package/build/init-B7gNNyTd.d.ts +235 -0
- package/build/init-DwVGVxkx.d.cts +235 -0
- package/build/jsx.cjs +31 -0
- package/build/jsx.cjs.map +1 -0
- package/build/jsx.d.cts +317 -0
- package/build/jsx.d.ts +317 -0
- package/build/jsx.js +6 -0
- package/build/jsx.js.map +1 -0
- package/build/outside-click-rZ3Di_WX.d.cts +16 -0
- package/build/outside-click-rZ3Di_WX.d.ts +16 -0
- package/build/react.cjs +37827 -0
- package/build/react.cjs.map +1 -0
- package/build/react.d.cts +356 -0
- package/build/react.d.ts +356 -0
- package/build/react.js +37802 -0
- package/build/react.js.map +1 -0
- package/build/register.cjs +35832 -35
- package/build/register.cjs.map +1 -0
- package/build/register.d.cts +4 -32
- package/build/register.d.ts +4 -32
- package/build/register.js +35831 -34
- package/build/register.js.map +1 -0
- package/build/register.server.cjs +19 -0
- package/build/register.server.cjs.map +1 -0
- package/build/register.server.d.cts +2 -0
- package/build/register.server.d.ts +2 -0
- package/build/register.server.js +1 -0
- package/build/register.server.js.map +1 -0
- package/build/registry-9GX9KTG1.d.cts +264 -0
- package/build/registry-9GX9KTG1.d.ts +264 -0
- package/build/template-helpers-CguLXtLD.d.cts +10 -0
- package/build/template-helpers-CguLXtLD.d.ts +10 -0
- package/build/theme.cjs +746 -0
- package/build/theme.cjs.map +1 -0
- package/build/{theme/index.d.cts → theme.d.cts} +41 -21
- package/build/{theme/index.d.ts → theme.d.ts} +41 -21
- package/build/theme.js +692 -0
- package/build/theme.js.map +1 -0
- package/build/utils.cjs +205 -0
- package/build/utils.cjs.map +1 -0
- package/build/utils.d.cts +26 -0
- package/build/utils.d.ts +26 -0
- package/build/utils.js +167 -0
- package/build/utils.js.map +1 -0
- package/package.json +57 -29
- package/build/components/code/index.cjs +0 -152
- package/build/components/code/index.d.cts +0 -11
- package/build/components/code/index.d.ts +0 -11
- package/build/components/code/index.js +0 -148
- package/build/components/code/utils/highlight-api.cjs +0 -18
- package/build/components/code/utils/highlight-api.d.cts +0 -7
- package/build/components/code/utils/highlight-api.d.ts +0 -7
- package/build/components/code/utils/highlight-api.js +0 -14
- package/build/components/code/utils/syntax-grammars.cjs +0 -62
- package/build/components/code/utils/syntax-grammars.d.cts +0 -7
- package/build/components/code/utils/syntax-grammars.d.ts +0 -7
- package/build/components/code/utils/syntax-grammars.js +0 -59
- package/build/components/code/utils/syntax-highlighter-theme.cjs +0 -27
- package/build/components/code/utils/syntax-highlighter-theme.d.cts +0 -3
- package/build/components/code/utils/syntax-highlighter-theme.d.ts +0 -3
- package/build/components/code/utils/syntax-highlighter-theme.js +0 -23
- package/build/components/code/utils/syntax-highlighter-types.cjs +0 -2
- package/build/components/code/utils/syntax-highlighter-types.d.cts +0 -12
- package/build/components/code/utils/syntax-highlighter-types.d.ts +0 -12
- package/build/components/code/utils/syntax-highlighter-types.js +0 -1
- package/build/components/code/utils/syntax-tokenizer.cjs +0 -63
- package/build/components/code/utils/syntax-tokenizer.d.cts +0 -3
- package/build/components/code/utils/syntax-tokenizer.d.ts +0 -3
- package/build/components/code/utils/syntax-tokenizer.js +0 -58
- package/build/components/curve/bezier-conversion.cjs +0 -23
- package/build/components/curve/bezier-conversion.d.cts +0 -2
- package/build/components/curve/bezier-conversion.d.ts +0 -2
- package/build/components/curve/bezier-conversion.js +0 -19
- package/build/components/curve/canvas-controls.cjs +0 -300
- package/build/components/curve/canvas-controls.d.cts +0 -12
- package/build/components/curve/canvas-controls.d.ts +0 -12
- package/build/components/curve/canvas-controls.js +0 -296
- package/build/components/curve/canvas.cjs +0 -1208
- package/build/components/curve/canvas.d.cts +0 -24
- package/build/components/curve/canvas.d.ts +0 -24
- package/build/components/curve/canvas.js +0 -1204
- package/build/components/curve/constants.cjs +0 -203
- package/build/components/curve/constants.d.cts +0 -23
- package/build/components/curve/constants.d.ts +0 -23
- package/build/components/curve/constants.js +0 -200
- package/build/components/curve/controls.cjs +0 -942
- package/build/components/curve/controls.d.cts +0 -37
- package/build/components/curve/controls.d.ts +0 -37
- package/build/components/curve/controls.js +0 -938
- package/build/components/curve/index.cjs +0 -335
- package/build/components/curve/index.d.cts +0 -31
- package/build/components/curve/index.d.ts +0 -31
- package/build/components/curve/index.js +0 -330
- package/build/components/curve/output.cjs +0 -141
- package/build/components/curve/output.d.cts +0 -19
- package/build/components/curve/output.d.ts +0 -19
- package/build/components/curve/output.js +0 -137
- package/build/components/curve/styles.cjs +0 -493
- package/build/components/curve/styles.d.cts +0 -6
- package/build/components/curve/styles.d.ts +0 -6
- package/build/components/curve/styles.js +0 -490
- package/build/components/curve/svg-renderer.cjs +0 -185
- package/build/components/curve/svg-renderer.d.cts +0 -9
- package/build/components/curve/svg-renderer.d.ts +0 -9
- package/build/components/curve/svg-renderer.js +0 -175
- package/build/components/curve/toolbar.cjs +0 -368
- package/build/components/curve/toolbar.d.cts +0 -26
- package/build/components/curve/toolbar.d.ts +0 -26
- package/build/components/curve/toolbar.js +0 -364
- package/build/components/curve/types.cjs +0 -10
- package/build/components/curve/types.d.cts +0 -33
- package/build/components/curve/types.d.ts +0 -33
- package/build/components/curve/types.js +0 -7
- package/build/components/curve/utils.cjs +0 -541
- package/build/components/curve/utils.d.cts +0 -33
- package/build/components/curve/utils.d.ts +0 -33
- package/build/components/curve/utils.js +0 -521
- package/build/components/index.cjs +0 -18
- package/build/components/index.d.cts +0 -2
- package/build/components/index.d.ts +0 -2
- package/build/components/index.js +0 -2
- package/build/decorators/Component.cjs +0 -127
- package/build/decorators/Component.d.cts +0 -28
- package/build/decorators/Component.d.ts +0 -28
- package/build/decorators/Component.js +0 -123
- package/build/decorators/Listen.cjs +0 -154
- package/build/decorators/Listen.d.cts +0 -18
- package/build/decorators/Listen.d.ts +0 -18
- package/build/decorators/Listen.js +0 -151
- package/build/decorators/OutsideClick.cjs +0 -64
- package/build/decorators/OutsideClick.d.cts +0 -16
- package/build/decorators/OutsideClick.d.ts +0 -16
- package/build/decorators/OutsideClick.js +0 -59
- package/build/decorators/Prop.cjs +0 -273
- package/build/decorators/Prop.d.cts +0 -22
- package/build/decorators/Prop.d.ts +0 -22
- package/build/decorators/Prop.js +0 -270
- package/build/decorators/Query.cjs +0 -79
- package/build/decorators/Query.d.cts +0 -27
- package/build/decorators/Query.d.ts +0 -27
- package/build/decorators/Query.js +0 -76
- package/build/decorators/Watch.cjs +0 -52
- package/build/decorators/Watch.d.cts +0 -11
- package/build/decorators/Watch.d.ts +0 -11
- package/build/decorators/Watch.js +0 -49
- package/build/decorators/index.cjs +0 -15
- package/build/decorators/index.d.cts +0 -6
- package/build/decorators/index.d.ts +0 -6
- package/build/decorators/index.js +0 -6
- package/build/elements/button/index.cjs +0 -214
- package/build/elements/button/index.d.cts +0 -11
- package/build/elements/button/index.d.ts +0 -11
- package/build/elements/button/index.js +0 -210
- package/build/elements/checkbox/index.cjs +0 -316
- package/build/elements/checkbox/index.d.cts +0 -14
- package/build/elements/checkbox/index.d.ts +0 -14
- package/build/elements/checkbox/index.js +0 -312
- package/build/elements/color/index.cjs +0 -154
- package/build/elements/color/index.d.cts +0 -18
- package/build/elements/color/index.d.ts +0 -18
- package/build/elements/color/index.js +0 -150
- package/build/elements/color/picker.cjs +0 -544
- package/build/elements/color/picker.d.cts +0 -37
- package/build/elements/color/picker.d.ts +0 -37
- package/build/elements/color/picker.js +0 -540
- package/build/elements/color/utils.cjs +0 -235
- package/build/elements/color/utils.d.cts +0 -37
- package/build/elements/color/utils.d.ts +0 -37
- package/build/elements/color/utils.js +0 -218
- package/build/elements/dropdown/index.cjs +0 -875
- package/build/elements/dropdown/index.d.cts +0 -30
- package/build/elements/dropdown/index.d.ts +0 -30
- package/build/elements/dropdown/index.js +0 -871
- package/build/elements/field/index.cjs +0 -82
- package/build/elements/field/index.d.cts +0 -4
- package/build/elements/field/index.d.ts +0 -4
- package/build/elements/field/index.js +0 -78
- package/build/elements/icons/animation/chevron.cjs +0 -57
- package/build/elements/icons/animation/chevron.d.cts +0 -10
- package/build/elements/icons/animation/chevron.d.ts +0 -10
- package/build/elements/icons/animation/chevron.js +0 -53
- package/build/elements/icons/animation/clear.cjs +0 -74
- package/build/elements/icons/animation/clear.d.cts +0 -3
- package/build/elements/icons/animation/clear.d.ts +0 -3
- package/build/elements/icons/animation/clear.js +0 -70
- package/build/elements/icons/animation/grid.cjs +0 -77
- package/build/elements/icons/animation/grid.d.cts +0 -8
- package/build/elements/icons/animation/grid.d.ts +0 -8
- package/build/elements/icons/animation/grid.js +0 -73
- package/build/elements/icons/animation/loading.cjs +0 -68
- package/build/elements/icons/animation/loading.d.cts +0 -3
- package/build/elements/icons/animation/loading.d.ts +0 -3
- package/build/elements/icons/animation/loading.js +0 -64
- package/build/elements/icons/animation/snap.cjs +0 -133
- package/build/elements/icons/animation/snap.d.cts +0 -8
- package/build/elements/icons/animation/snap.d.ts +0 -8
- package/build/elements/icons/animation/snap.js +0 -129
- package/build/elements/icons/index.cjs +0 -40
- package/build/elements/icons/index.d.cts +0 -24
- package/build/elements/icons/index.d.ts +0 -24
- package/build/elements/icons/index.js +0 -24
- package/build/elements/icons/interface/anchor-add.cjs +0 -35
- package/build/elements/icons/interface/anchor-add.d.cts +0 -3
- package/build/elements/icons/interface/anchor-add.d.ts +0 -3
- package/build/elements/icons/interface/anchor-add.js +0 -31
- package/build/elements/icons/interface/anchor-remove.cjs +0 -34
- package/build/elements/icons/interface/anchor-remove.d.cts +0 -3
- package/build/elements/icons/interface/anchor-remove.d.ts +0 -3
- package/build/elements/icons/interface/anchor-remove.js +0 -30
- package/build/elements/icons/interface/arrow-up.cjs +0 -30
- package/build/elements/icons/interface/arrow-up.d.cts +0 -3
- package/build/elements/icons/interface/arrow-up.d.ts +0 -3
- package/build/elements/icons/interface/arrow-up.js +0 -26
- package/build/elements/icons/interface/arrows-vertical.cjs +0 -30
- package/build/elements/icons/interface/arrows-vertical.d.cts +0 -3
- package/build/elements/icons/interface/arrows-vertical.d.ts +0 -3
- package/build/elements/icons/interface/arrows-vertical.js +0 -26
- package/build/elements/icons/interface/bezier-angle.cjs +0 -33
- package/build/elements/icons/interface/bezier-angle.d.cts +0 -3
- package/build/elements/icons/interface/bezier-angle.d.ts +0 -3
- package/build/elements/icons/interface/bezier-angle.js +0 -29
- package/build/elements/icons/interface/bezier-distribute.cjs +0 -34
- package/build/elements/icons/interface/bezier-distribute.d.cts +0 -3
- package/build/elements/icons/interface/bezier-distribute.d.ts +0 -3
- package/build/elements/icons/interface/bezier-distribute.js +0 -30
- package/build/elements/icons/interface/bezier-length.cjs +0 -31
- package/build/elements/icons/interface/bezier-length.d.cts +0 -3
- package/build/elements/icons/interface/bezier-length.d.ts +0 -3
- package/build/elements/icons/interface/bezier-length.js +0 -27
- package/build/elements/icons/interface/bezier-mirror.cjs +0 -31
- package/build/elements/icons/interface/bezier-mirror.d.cts +0 -3
- package/build/elements/icons/interface/bezier-mirror.d.ts +0 -3
- package/build/elements/icons/interface/bezier-mirror.js +0 -27
- package/build/elements/icons/interface/bezier.cjs +0 -26
- package/build/elements/icons/interface/bezier.d.cts +0 -3
- package/build/elements/icons/interface/bezier.d.ts +0 -3
- package/build/elements/icons/interface/bezier.js +0 -22
- package/build/elements/icons/interface/check.cjs +0 -30
- package/build/elements/icons/interface/check.d.cts +0 -3
- package/build/elements/icons/interface/check.d.ts +0 -3
- package/build/elements/icons/interface/check.js +0 -26
- package/build/elements/icons/interface/circle-arrow-left.cjs +0 -30
- package/build/elements/icons/interface/circle-arrow-left.d.cts +0 -3
- package/build/elements/icons/interface/circle-arrow-left.d.ts +0 -3
- package/build/elements/icons/interface/circle-arrow-left.js +0 -26
- package/build/elements/icons/interface/circle-arrow-right.cjs +0 -30
- package/build/elements/icons/interface/circle-arrow-right.d.cts +0 -3
- package/build/elements/icons/interface/circle-arrow-right.d.ts +0 -3
- package/build/elements/icons/interface/circle-arrow-right.js +0 -26
- package/build/elements/icons/interface/code.cjs +0 -30
- package/build/elements/icons/interface/code.d.cts +0 -3
- package/build/elements/icons/interface/code.d.ts +0 -3
- package/build/elements/icons/interface/code.js +0 -26
- package/build/elements/icons/interface/dots.cjs +0 -32
- package/build/elements/icons/interface/dots.d.cts +0 -3
- package/build/elements/icons/interface/dots.d.ts +0 -3
- package/build/elements/icons/interface/dots.js +0 -28
- package/build/elements/icons/interface/mention.cjs +0 -30
- package/build/elements/icons/interface/mention.d.cts +0 -3
- package/build/elements/icons/interface/mention.d.ts +0 -3
- package/build/elements/icons/interface/mention.js +0 -26
- package/build/elements/icons/interface/minus.cjs +0 -30
- package/build/elements/icons/interface/minus.d.cts +0 -3
- package/build/elements/icons/interface/minus.d.ts +0 -3
- package/build/elements/icons/interface/minus.js +0 -26
- package/build/elements/icons/interface/picker.cjs +0 -34
- package/build/elements/icons/interface/picker.d.cts +0 -3
- package/build/elements/icons/interface/picker.d.ts +0 -3
- package/build/elements/icons/interface/picker.js +0 -30
- package/build/elements/icons/interface/plus.cjs +0 -30
- package/build/elements/icons/interface/plus.d.cts +0 -3
- package/build/elements/icons/interface/plus.d.ts +0 -3
- package/build/elements/icons/interface/plus.js +0 -26
- package/build/elements/icons/interface/settings.cjs +0 -30
- package/build/elements/icons/interface/settings.d.cts +0 -3
- package/build/elements/icons/interface/settings.d.ts +0 -3
- package/build/elements/icons/interface/settings.js +0 -26
- package/build/elements/index.cjs +0 -62
- package/build/elements/index.d.cts +0 -22
- package/build/elements/index.d.ts +0 -22
- package/build/elements/index.js +0 -22
- package/build/elements/input/index.cjs +0 -273
- package/build/elements/input/index.d.cts +0 -17
- package/build/elements/input/index.d.ts +0 -17
- package/build/elements/input/index.js +0 -269
- package/build/elements/logo/index.cjs +0 -732
- package/build/elements/logo/index.d.cts +0 -17
- package/build/elements/logo/index.d.ts +0 -17
- package/build/elements/logo/index.js +0 -728
- package/build/elements/monitor/fps.cjs +0 -432
- package/build/elements/monitor/fps.d.cts +0 -21
- package/build/elements/monitor/fps.d.ts +0 -21
- package/build/elements/monitor/fps.js +0 -428
- package/build/elements/monitor/index.cjs +0 -670
- package/build/elements/monitor/index.js +0 -666
- package/build/elements/number/index.cjs +0 -173
- package/build/elements/number/index.d.cts +0 -19
- package/build/elements/number/index.d.ts +0 -19
- package/build/elements/number/index.js +0 -169
- package/build/elements/origin/index.cjs +0 -169
- package/build/elements/origin/index.d.cts +0 -12
- package/build/elements/origin/index.d.ts +0 -12
- package/build/elements/origin/index.js +0 -165
- package/build/elements/popover/index.cjs +0 -209
- package/build/elements/popover/index.d.cts +0 -19
- package/build/elements/popover/index.d.ts +0 -19
- package/build/elements/popover/index.js +0 -205
- package/build/elements/radio/index.cjs +0 -301
- package/build/elements/radio/index.d.cts +0 -13
- package/build/elements/radio/index.d.ts +0 -13
- package/build/elements/radio/index.js +0 -283
- package/build/elements/radio/input.cjs +0 -329
- package/build/elements/radio/input.d.cts +0 -15
- package/build/elements/radio/input.d.ts +0 -15
- package/build/elements/radio/input.js +0 -325
- package/build/elements/radio/option.cjs +0 -15
- package/build/elements/radio/option.d.cts +0 -3
- package/build/elements/radio/option.d.ts +0 -3
- package/build/elements/radio/option.js +0 -11
- package/build/elements/shared.cjs +0 -66
- package/build/elements/shared.d.cts +0 -40
- package/build/elements/shared.d.ts +0 -40
- package/build/elements/shared.js +0 -59
- package/build/elements/slider/index.cjs +0 -232
- package/build/elements/slider/index.d.cts +0 -20
- package/build/elements/slider/index.d.ts +0 -20
- package/build/elements/slider/index.js +0 -228
- package/build/elements/state/index.cjs +0 -681
- package/build/elements/state/index.d.cts +0 -86
- package/build/elements/state/index.d.ts +0 -86
- package/build/elements/state/index.js +0 -677
- package/build/elements/toggle/index.cjs +0 -151
- package/build/elements/toggle/index.d.cts +0 -9
- package/build/elements/toggle/index.d.ts +0 -9
- package/build/elements/toggle/index.js +0 -147
- package/build/elements/tooltip/index.cjs +0 -187
- package/build/elements/tooltip/index.d.cts +0 -17
- package/build/elements/tooltip/index.d.ts +0 -17
- package/build/elements/tooltip/index.js +0 -183
- package/build/init.cjs +0 -325
- package/build/init.d.cts +0 -157
- package/build/init.d.ts +0 -157
- package/build/init.js +0 -289
- package/build/internal/component-loaders.cjs +0 -206
- package/build/internal/component-loaders.d.cts +0 -52
- package/build/internal/component-loaders.d.ts +0 -52
- package/build/internal/component-loaders.js +0 -167
- package/build/internal/fonts.cjs +0 -128
- package/build/internal/fonts.d.cts +0 -32
- package/build/internal/fonts.d.ts +0 -32
- package/build/internal/fonts.js +0 -123
- package/build/internal/lazy-load.cjs +0 -89
- package/build/internal/lazy-load.d.cts +0 -32
- package/build/internal/lazy-load.d.ts +0 -32
- package/build/internal/lazy-load.js +0 -86
- package/build/internal/style-inject.cjs +0 -236
- package/build/internal/style-inject.d.cts +0 -44
- package/build/internal/style-inject.d.ts +0 -44
- package/build/internal/style-inject.js +0 -226
- package/build/theme/index.cjs +0 -452
- package/build/theme/index.js +0 -423
- package/build/theme/presets.cjs +0 -54
- package/build/theme/presets.d.cts +0 -19
- package/build/theme/presets.d.ts +0 -19
- package/build/theme/presets.js +0 -51
- package/build/theme/registry.cjs +0 -204
- package/build/theme/registry.d.cts +0 -99
- package/build/theme/registry.d.ts +0 -99
- package/build/theme/registry.js +0 -194
- package/build/theme/tokens.cjs +0 -148
- package/build/theme/tokens.d.cts +0 -163
- package/build/theme/tokens.d.ts +0 -163
- package/build/theme/tokens.js +0 -145
- package/build/utils/dismiss-controller.cjs +0 -77
- package/build/utils/dismiss-controller.d.cts +0 -14
- package/build/utils/dismiss-controller.d.ts +0 -14
- package/build/utils/dismiss-controller.js +0 -73
- package/build/utils/index.cjs +0 -18
- package/build/utils/index.d.cts +0 -3
- package/build/utils/index.d.ts +0 -3
- package/build/utils/index.js +0 -3
- package/build/utils/outside-click.cjs +0 -82
- package/build/utils/outside-click.d.cts +0 -18
- package/build/utils/outside-click.d.ts +0 -18
- package/build/utils/outside-click.js +0 -74
- package/build/utils/template-helpers.cjs +0 -39
- package/build/utils/template-helpers.d.cts +0 -13
- package/build/utils/template-helpers.d.ts +0 -13
- package/build/utils/template-helpers.js +0 -28
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateHighlightStyles = exports.DEFAULT_THEME = void 0;
|
|
4
|
-
exports.DEFAULT_THEME = {
|
|
5
|
-
keyword: 'var(--ease-syntax-keyword, #e47ab4)',
|
|
6
|
-
string: 'var(--ease-syntax-string, #6ad09d)',
|
|
7
|
-
comment: 'var(--ease-syntax-comment, var(--color-gray-700))',
|
|
8
|
-
number: 'var(--ease-syntax-number, #f2c24b)',
|
|
9
|
-
operator: 'var(--ease-syntax-operator, var(--color-gray-500))',
|
|
10
|
-
tag: 'var(--ease-syntax-tag, #c36571)',
|
|
11
|
-
attribute: 'var(--ease-syntax-attribute, #ff6600)',
|
|
12
|
-
property: 'var(--ease-syntax-property, #61bf90)',
|
|
13
|
-
type: 'var(--ease-syntax-type, #FFAB77)',
|
|
14
|
-
variable: 'var(--ease-syntax-variable, #ea7987)',
|
|
15
|
-
selector: 'var(--ease-syntax-selector, #4F9CED)',
|
|
16
|
-
function: 'var(--ease-syntax-function, #71a4f4)'
|
|
17
|
-
};
|
|
18
|
-
const generateHighlightStyles = (instanceId, theme = exports.DEFAULT_THEME) => {
|
|
19
|
-
let styles = '';
|
|
20
|
-
for (const [type, color] of Object.entries(theme)) {
|
|
21
|
-
const highlightName = `syntax-${type}-${instanceId}`;
|
|
22
|
-
const italic = type === 'comment' ? 'font-style: italic;' : '';
|
|
23
|
-
styles += `::highlight(${highlightName}) { color: ${color}; ${italic} }`;
|
|
24
|
-
}
|
|
25
|
-
return styles;
|
|
26
|
-
};
|
|
27
|
-
exports.generateHighlightStyles = generateHighlightStyles;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export const DEFAULT_THEME = {
|
|
2
|
-
keyword: 'var(--ease-syntax-keyword, #e47ab4)',
|
|
3
|
-
string: 'var(--ease-syntax-string, #6ad09d)',
|
|
4
|
-
comment: 'var(--ease-syntax-comment, var(--color-gray-700))',
|
|
5
|
-
number: 'var(--ease-syntax-number, #f2c24b)',
|
|
6
|
-
operator: 'var(--ease-syntax-operator, var(--color-gray-500))',
|
|
7
|
-
tag: 'var(--ease-syntax-tag, #c36571)',
|
|
8
|
-
attribute: 'var(--ease-syntax-attribute, #ff6600)',
|
|
9
|
-
property: 'var(--ease-syntax-property, #61bf90)',
|
|
10
|
-
type: 'var(--ease-syntax-type, #FFAB77)',
|
|
11
|
-
variable: 'var(--ease-syntax-variable, #ea7987)',
|
|
12
|
-
selector: 'var(--ease-syntax-selector, #4F9CED)',
|
|
13
|
-
function: 'var(--ease-syntax-function, #71a4f4)'
|
|
14
|
-
};
|
|
15
|
-
export const generateHighlightStyles = (instanceId, theme = DEFAULT_THEME) => {
|
|
16
|
-
let styles = '';
|
|
17
|
-
for (const [type, color] of Object.entries(theme)) {
|
|
18
|
-
const highlightName = `syntax-${type}-${instanceId}`;
|
|
19
|
-
const italic = type === 'comment' ? 'font-style: italic;' : '';
|
|
20
|
-
styles += `::highlight(${highlightName}) { color: ${color}; ${italic} }`;
|
|
21
|
-
}
|
|
22
|
-
return styles;
|
|
23
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export type TokenType = 'comment' | 'string' | 'number' | 'keyword' | 'operator' | 'function' | 'type' | 'tag' | 'attribute' | 'property' | 'selector' | 'variable';
|
|
2
|
-
export interface Token {
|
|
3
|
-
type: TokenType;
|
|
4
|
-
start: number;
|
|
5
|
-
end: number;
|
|
6
|
-
}
|
|
7
|
-
export type GrammarRule = [TokenType, RegExp];
|
|
8
|
-
export type Grammar = GrammarRule[];
|
|
9
|
-
export interface SyntaxHighlighterOptions {
|
|
10
|
-
language?: string;
|
|
11
|
-
theme?: Record<TokenType, string>;
|
|
12
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export type TokenType = 'comment' | 'string' | 'number' | 'keyword' | 'operator' | 'function' | 'type' | 'tag' | 'attribute' | 'property' | 'selector' | 'variable';
|
|
2
|
-
export interface Token {
|
|
3
|
-
type: TokenType;
|
|
4
|
-
start: number;
|
|
5
|
-
end: number;
|
|
6
|
-
}
|
|
7
|
-
export type GrammarRule = [TokenType, RegExp];
|
|
8
|
-
export type Grammar = GrammarRule[];
|
|
9
|
-
export interface SyntaxHighlighterOptions {
|
|
10
|
-
language?: string;
|
|
11
|
-
theme?: Record<TokenType, string>;
|
|
12
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeIndent = exports.tokenize = void 0;
|
|
4
|
-
const syntax_grammars_1 = require("./syntax-grammars.cjs");
|
|
5
|
-
const tokenize = (code, language) => {
|
|
6
|
-
const grammar = syntax_grammars_1.GRAMMARS[language.toLowerCase()];
|
|
7
|
-
if (!grammar) {
|
|
8
|
-
return [];
|
|
9
|
-
}
|
|
10
|
-
const regexParts = [];
|
|
11
|
-
const groupMap = new Map();
|
|
12
|
-
let groupIndex = 0;
|
|
13
|
-
grammar.forEach(([type, pattern]) => {
|
|
14
|
-
const groupName = `G${groupIndex++}`;
|
|
15
|
-
groupMap.set(groupName, type);
|
|
16
|
-
regexParts.push(`(?<${groupName}>${pattern.source})`);
|
|
17
|
-
});
|
|
18
|
-
const masterRegex = new RegExp(regexParts.join('|'), 'gm');
|
|
19
|
-
const tokens = [];
|
|
20
|
-
let match;
|
|
21
|
-
while (true) {
|
|
22
|
-
match = masterRegex.exec(code);
|
|
23
|
-
if (match === null) {
|
|
24
|
-
break;
|
|
25
|
-
}
|
|
26
|
-
if (match.index === masterRegex.lastIndex) {
|
|
27
|
-
masterRegex.lastIndex++;
|
|
28
|
-
}
|
|
29
|
-
if (match.groups) {
|
|
30
|
-
for (const groupName in match.groups) {
|
|
31
|
-
if (match.groups[groupName] !== undefined) {
|
|
32
|
-
const type = groupMap.get(groupName);
|
|
33
|
-
if (type) {
|
|
34
|
-
const start = match.index;
|
|
35
|
-
const end = start + match[0].length;
|
|
36
|
-
if ((language === 'html' || language === 'tsx' || language === 'jsx') && type === 'tag') {
|
|
37
|
-
const tagNameMatch = match[0].match(/[a-zA-Z0-9-]+/);
|
|
38
|
-
if (tagNameMatch && tagNameMatch.index !== undefined) {
|
|
39
|
-
const tagNameStart = start + tagNameMatch.index;
|
|
40
|
-
const tagNameEnd = tagNameStart + tagNameMatch[0].length;
|
|
41
|
-
tokens.push({ type, start: tagNameStart, end: tagNameEnd });
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
tokens.push({ type, start, end });
|
|
46
|
-
break;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return tokens;
|
|
53
|
-
};
|
|
54
|
-
exports.tokenize = tokenize;
|
|
55
|
-
const normalizeIndent = (code) => {
|
|
56
|
-
const lines = code.split('\n').filter((line) => line.trim());
|
|
57
|
-
if (!lines.length) {
|
|
58
|
-
return '';
|
|
59
|
-
}
|
|
60
|
-
const minIndent = Math.min(...lines.map((line) => line.match(/^\s*/)?.[0].length || 0));
|
|
61
|
-
return lines.map((line) => line.substring(minIndent)).join('\n');
|
|
62
|
-
};
|
|
63
|
-
exports.normalizeIndent = normalizeIndent;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { GRAMMARS } from "./syntax-grammars.js";
|
|
2
|
-
export const tokenize = (code, language) => {
|
|
3
|
-
const grammar = GRAMMARS[language.toLowerCase()];
|
|
4
|
-
if (!grammar) {
|
|
5
|
-
return [];
|
|
6
|
-
}
|
|
7
|
-
const regexParts = [];
|
|
8
|
-
const groupMap = new Map();
|
|
9
|
-
let groupIndex = 0;
|
|
10
|
-
grammar.forEach(([type, pattern]) => {
|
|
11
|
-
const groupName = `G${groupIndex++}`;
|
|
12
|
-
groupMap.set(groupName, type);
|
|
13
|
-
regexParts.push(`(?<${groupName}>${pattern.source})`);
|
|
14
|
-
});
|
|
15
|
-
const masterRegex = new RegExp(regexParts.join('|'), 'gm');
|
|
16
|
-
const tokens = [];
|
|
17
|
-
let match;
|
|
18
|
-
while (true) {
|
|
19
|
-
match = masterRegex.exec(code);
|
|
20
|
-
if (match === null) {
|
|
21
|
-
break;
|
|
22
|
-
}
|
|
23
|
-
if (match.index === masterRegex.lastIndex) {
|
|
24
|
-
masterRegex.lastIndex++;
|
|
25
|
-
}
|
|
26
|
-
if (match.groups) {
|
|
27
|
-
for (const groupName in match.groups) {
|
|
28
|
-
if (match.groups[groupName] !== undefined) {
|
|
29
|
-
const type = groupMap.get(groupName);
|
|
30
|
-
if (type) {
|
|
31
|
-
const start = match.index;
|
|
32
|
-
const end = start + match[0].length;
|
|
33
|
-
if ((language === 'html' || language === 'tsx' || language === 'jsx') && type === 'tag') {
|
|
34
|
-
const tagNameMatch = match[0].match(/[a-zA-Z0-9-]+/);
|
|
35
|
-
if (tagNameMatch && tagNameMatch.index !== undefined) {
|
|
36
|
-
const tagNameStart = start + tagNameMatch.index;
|
|
37
|
-
const tagNameEnd = tagNameStart + tagNameMatch[0].length;
|
|
38
|
-
tokens.push({ type, start: tagNameStart, end: tagNameEnd });
|
|
39
|
-
break;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
tokens.push({ type, start, end });
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return tokens;
|
|
50
|
-
};
|
|
51
|
-
export const normalizeIndent = (code) => {
|
|
52
|
-
const lines = code.split('\n').filter((line) => line.trim());
|
|
53
|
-
if (!lines.length) {
|
|
54
|
-
return '';
|
|
55
|
-
}
|
|
56
|
-
const minIndent = Math.min(...lines.map((line) => line.match(/^\s*/)?.[0].length || 0));
|
|
57
|
-
return lines.map((line) => line.substring(minIndent)).join('\n');
|
|
58
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cubicBezierToLinearPoints = void 0;
|
|
4
|
-
const cubicBezierToLinearPoints = (points) => {
|
|
5
|
-
const start = {
|
|
6
|
-
x: 0,
|
|
7
|
-
y: 0,
|
|
8
|
-
cpOutX: points.p1.x,
|
|
9
|
-
cpOutY: points.p1.y,
|
|
10
|
-
isLinked: true,
|
|
11
|
-
mirrorLength: true
|
|
12
|
-
};
|
|
13
|
-
const end = {
|
|
14
|
-
x: 1,
|
|
15
|
-
y: 1,
|
|
16
|
-
cpInX: points.p2.x - 1,
|
|
17
|
-
cpInY: points.p2.y - 1,
|
|
18
|
-
isLinked: true,
|
|
19
|
-
mirrorLength: true
|
|
20
|
-
};
|
|
21
|
-
return [start, end];
|
|
22
|
-
};
|
|
23
|
-
exports.cubicBezierToLinearPoints = cubicBezierToLinearPoints;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export const cubicBezierToLinearPoints = (points) => {
|
|
2
|
-
const start = {
|
|
3
|
-
x: 0,
|
|
4
|
-
y: 0,
|
|
5
|
-
cpOutX: points.p1.x,
|
|
6
|
-
cpOutY: points.p1.y,
|
|
7
|
-
isLinked: true,
|
|
8
|
-
mirrorLength: true
|
|
9
|
-
};
|
|
10
|
-
const end = {
|
|
11
|
-
x: 1,
|
|
12
|
-
y: 1,
|
|
13
|
-
cpInX: points.p2.x - 1,
|
|
14
|
-
cpInY: points.p2.y - 1,
|
|
15
|
-
isLinked: true,
|
|
16
|
-
mirrorLength: true
|
|
17
|
-
};
|
|
18
|
-
return [start, end];
|
|
19
|
-
};
|
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CanvasControls = void 0;
|
|
4
|
-
const lit_html_1 = require("lit-html");
|
|
5
|
-
const constants_1 = require("./constants.cjs");
|
|
6
|
-
const styles_1 = require("./styles.cjs");
|
|
7
|
-
const types_1 = require("./types.cjs");
|
|
8
|
-
const utils_1 = require("./utils.cjs");
|
|
9
|
-
const Component_1 = require("../../decorators/Component");
|
|
10
|
-
const Prop_1 = require("../../decorators/Prop");
|
|
11
|
-
const shared_1 = require("../../elements/shared");
|
|
12
|
-
const HOST_HANDLER_MAP = {
|
|
13
|
-
'points-change': 'handlePointsChange',
|
|
14
|
-
'linear-point-focus': 'handleLinearPointFocus'
|
|
15
|
-
};
|
|
16
|
-
@(0, Component_1.Component)({
|
|
17
|
-
tag: 'ease-curve-canvas-controls',
|
|
18
|
-
styles: styles_1.canvasControlsStyles,
|
|
19
|
-
template() {
|
|
20
|
-
if (this.easingType !== types_1.EasingType.LINEAR || !Array.isArray(this.points)) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
const focusedIndex = this.focusedLinearIndex;
|
|
24
|
-
if (focusedIndex === null) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
const points = this.points;
|
|
28
|
-
const selectedPoint = points[focusedIndex];
|
|
29
|
-
if (!selectedPoint) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
const isInnerPoint = focusedIndex > 0 && focusedIndex < points.length - 1;
|
|
33
|
-
if (!isInnerPoint) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
const hasInHandle = selectedPoint.cpInX !== undefined || selectedPoint.cpInY !== undefined;
|
|
37
|
-
const hasOutHandle = selectedPoint.cpOutX !== undefined || selectedPoint.cpOutY !== undefined;
|
|
38
|
-
const hasAnyHandle = hasInHandle || hasOutHandle;
|
|
39
|
-
return (0, lit_html_1.html) `
|
|
40
|
-
<div class="overlay-controls">
|
|
41
|
-
<button
|
|
42
|
-
type="button"
|
|
43
|
-
class="overlay-button ${selectedPoint.isLinked ? 'active' : 'inactive'}"
|
|
44
|
-
@click=${this.handleToggleMirrorAngle}
|
|
45
|
-
>
|
|
46
|
-
<ease-icon-bezier-angle></ease-icon-bezier-angle>
|
|
47
|
-
</button>
|
|
48
|
-
<button
|
|
49
|
-
type="button"
|
|
50
|
-
class="overlay-button ${selectedPoint.mirrorLength !== false && selectedPoint.isLinked ? 'active' : 'inactive'}"
|
|
51
|
-
@click=${this.handleToggleMirrorLength}
|
|
52
|
-
?disabled=${!selectedPoint.isLinked}
|
|
53
|
-
>
|
|
54
|
-
<ease-icon-bezier-length></ease-icon-bezier-length>
|
|
55
|
-
</button>
|
|
56
|
-
${hasAnyHandle
|
|
57
|
-
? (0, lit_html_1.html) `
|
|
58
|
-
<button
|
|
59
|
-
type="button"
|
|
60
|
-
class="overlay-button"
|
|
61
|
-
@click=${this.handleRemoveSmoothing}
|
|
62
|
-
>
|
|
63
|
-
<ease-icon-bezier></ease-icon-bezier>
|
|
64
|
-
</button>
|
|
65
|
-
`
|
|
66
|
-
: (0, lit_html_1.html) `
|
|
67
|
-
<button
|
|
68
|
-
type="button"
|
|
69
|
-
class="overlay-button"
|
|
70
|
-
@click=${this.handleAddSmoothing}
|
|
71
|
-
>
|
|
72
|
-
<ease-icon-bezier-mirror></ease-icon-bezier-mirror>
|
|
73
|
-
</button>
|
|
74
|
-
`}
|
|
75
|
-
</div>
|
|
76
|
-
`;
|
|
77
|
-
}
|
|
78
|
-
})
|
|
79
|
-
class CanvasControls extends HTMLElement {
|
|
80
|
-
@(0, Prop_1.Prop)({ reflect: true })
|
|
81
|
-
accessor easingType;
|
|
82
|
-
@(0, Prop_1.Prop)({ type: Object, reflect: false })
|
|
83
|
-
accessor points;
|
|
84
|
-
@(0, Prop_1.Prop)({ type: Number, reflect: false, defaultValue: null })
|
|
85
|
-
accessor focusedLinearIndex = null;
|
|
86
|
-
#getEventTarget = () => {
|
|
87
|
-
const root = this.getRootNode();
|
|
88
|
-
if (root instanceof ShadowRoot && root.host instanceof HTMLElement) {
|
|
89
|
-
return root.host;
|
|
90
|
-
}
|
|
91
|
-
return this;
|
|
92
|
-
};
|
|
93
|
-
#getLinearPoints = () => {
|
|
94
|
-
if (!Array.isArray(this.points)) {
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
return this.points;
|
|
98
|
-
};
|
|
99
|
-
#notifyHost = (type, value, event) => {
|
|
100
|
-
const target = this.#getEventTarget();
|
|
101
|
-
const detail = { value, event };
|
|
102
|
-
(0, shared_1.dispatchControlEvent)(target, type, detail);
|
|
103
|
-
};
|
|
104
|
-
#emitPoints = (points, event) => {
|
|
105
|
-
this.points = points;
|
|
106
|
-
this.#notifyHost('points-change', points, event);
|
|
107
|
-
};
|
|
108
|
-
handleToggleMirrorAngle = (event) => {
|
|
109
|
-
event.preventDefault();
|
|
110
|
-
const points = this.#getLinearPoints();
|
|
111
|
-
if (!points) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
const index = this.focusedLinearIndex;
|
|
115
|
-
if (index === null) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
const point = points[index];
|
|
119
|
-
if (!point) {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
const updatedPoints = [...points];
|
|
123
|
-
const updatedPoint = { ...point };
|
|
124
|
-
updatedPoints[index] = updatedPoint;
|
|
125
|
-
const nextState = !updatedPoint.isLinked;
|
|
126
|
-
if (nextState) {
|
|
127
|
-
this.#ensureSmoothHandles(updatedPoint, index, points);
|
|
128
|
-
updatedPoint.mirrorLength = true;
|
|
129
|
-
this.#alignMirrorLength(updatedPoint);
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
updatedPoint.mirrorLength = false;
|
|
133
|
-
}
|
|
134
|
-
updatedPoint.isLinked = nextState;
|
|
135
|
-
const normalizedPoints = (0, utils_1.normalizeLinearPoints)(updatedPoints);
|
|
136
|
-
this.#emitPoints(normalizedPoints, event);
|
|
137
|
-
this.focusedLinearIndex = index;
|
|
138
|
-
this.#notifyHost('linear-point-focus', index, event);
|
|
139
|
-
};
|
|
140
|
-
handleToggleMirrorLength = (event) => {
|
|
141
|
-
event.preventDefault();
|
|
142
|
-
const points = this.#getLinearPoints();
|
|
143
|
-
if (!points) {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
const index = this.focusedLinearIndex;
|
|
147
|
-
if (index === null) {
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
const point = points[index];
|
|
151
|
-
if (!point || !point.isLinked) {
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
const updatedPoints = [...points];
|
|
155
|
-
const updatedPoint = { ...point };
|
|
156
|
-
updatedPoints[index] = updatedPoint;
|
|
157
|
-
const nextState = updatedPoint.mirrorLength === false;
|
|
158
|
-
updatedPoint.mirrorLength = nextState;
|
|
159
|
-
if (nextState) {
|
|
160
|
-
this.#ensureSmoothHandles(updatedPoint, index, points);
|
|
161
|
-
this.#alignMirrorLength(updatedPoint);
|
|
162
|
-
}
|
|
163
|
-
const normalizedPoints = (0, utils_1.normalizeLinearPoints)(updatedPoints);
|
|
164
|
-
this.#emitPoints(normalizedPoints, event);
|
|
165
|
-
this.focusedLinearIndex = index;
|
|
166
|
-
this.#notifyHost('linear-point-focus', index, event);
|
|
167
|
-
};
|
|
168
|
-
handleRemoveSmoothing = (event) => {
|
|
169
|
-
event.preventDefault();
|
|
170
|
-
const points = this.#getLinearPoints();
|
|
171
|
-
if (!points) {
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
const index = this.focusedLinearIndex;
|
|
175
|
-
if (index === null) {
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
const existingPoint = points[index];
|
|
179
|
-
if (!existingPoint) {
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
const updatedPoints = [...points];
|
|
183
|
-
const updatedPoint = { ...existingPoint };
|
|
184
|
-
updatedPoints[index] = updatedPoint;
|
|
185
|
-
delete updatedPoint.cpInX;
|
|
186
|
-
delete updatedPoint.cpInY;
|
|
187
|
-
delete updatedPoint.cpOutX;
|
|
188
|
-
delete updatedPoint.cpOutY;
|
|
189
|
-
delete updatedPoint.isLinked;
|
|
190
|
-
delete updatedPoint.mirrorLength;
|
|
191
|
-
const normalizedPoints = (0, utils_1.normalizeLinearPoints)(updatedPoints);
|
|
192
|
-
this.#emitPoints(normalizedPoints, event);
|
|
193
|
-
this.focusedLinearIndex = index;
|
|
194
|
-
this.#notifyHost('linear-point-focus', index, event);
|
|
195
|
-
};
|
|
196
|
-
handleAddSmoothing = (event) => {
|
|
197
|
-
event.preventDefault();
|
|
198
|
-
const points = this.#getLinearPoints();
|
|
199
|
-
if (!points) {
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
const index = this.focusedLinearIndex;
|
|
203
|
-
if (index === null) {
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
const point = points[index];
|
|
207
|
-
if (!point) {
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
const updatedPoints = [...points];
|
|
211
|
-
const updatedPoint = { ...point };
|
|
212
|
-
updatedPoints[index] = updatedPoint;
|
|
213
|
-
this.#ensureSmoothHandles(updatedPoint, index, points);
|
|
214
|
-
updatedPoint.isLinked = true;
|
|
215
|
-
updatedPoint.mirrorLength = true;
|
|
216
|
-
this.#alignMirrorLength(updatedPoint);
|
|
217
|
-
const normalizedPoints = (0, utils_1.normalizeLinearPoints)(updatedPoints);
|
|
218
|
-
this.#emitPoints(normalizedPoints, event);
|
|
219
|
-
this.focusedLinearIndex = index;
|
|
220
|
-
this.#notifyHost('linear-point-focus', index, event);
|
|
221
|
-
};
|
|
222
|
-
#ensureSmoothHandles(point, index, points) {
|
|
223
|
-
const prev = points[index - 1];
|
|
224
|
-
const next = points[index + 1];
|
|
225
|
-
let refDx = point.cpOutX ?? -(point.cpInX ?? 0);
|
|
226
|
-
let refDy = point.cpOutY ?? -(point.cpInY ?? 0);
|
|
227
|
-
if (refDx === 0 && refDy === 0) {
|
|
228
|
-
let dirX = 0;
|
|
229
|
-
let dirY = 0;
|
|
230
|
-
if (prev && next) {
|
|
231
|
-
dirX = next.x - prev.x;
|
|
232
|
-
dirY = next.y - prev.y;
|
|
233
|
-
}
|
|
234
|
-
else if (next) {
|
|
235
|
-
dirX = next.x - point.x;
|
|
236
|
-
dirY = next.y - point.y;
|
|
237
|
-
}
|
|
238
|
-
else if (prev) {
|
|
239
|
-
dirX = point.x - prev.x;
|
|
240
|
-
dirY = point.y - prev.y;
|
|
241
|
-
}
|
|
242
|
-
else {
|
|
243
|
-
dirX = 1;
|
|
244
|
-
dirY = 0;
|
|
245
|
-
}
|
|
246
|
-
const direction = (0, utils_1.normalizeVector)(dirX, dirY);
|
|
247
|
-
const length = constants_1.DEFAULT_HANDLE_LENGTH;
|
|
248
|
-
point.cpInX = -direction.dx * length;
|
|
249
|
-
point.cpInY = -direction.dy * length;
|
|
250
|
-
point.cpOutX = direction.dx * length;
|
|
251
|
-
point.cpOutY = direction.dy * length;
|
|
252
|
-
refDx = point.cpOutX;
|
|
253
|
-
refDy = point.cpOutY;
|
|
254
|
-
}
|
|
255
|
-
if (refDx === 0 && refDy === 0) {
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
const normalized = (0, utils_1.normalizeVector)(refDx, refDy);
|
|
259
|
-
const referenceLength = (0, utils_1.vectorLength)(refDx, refDy);
|
|
260
|
-
const inLength = (0, utils_1.vectorLength)(point.cpInX ?? 0, point.cpInY ?? 0) || referenceLength;
|
|
261
|
-
point.cpInX = -normalized.dx * inLength;
|
|
262
|
-
point.cpInY = -normalized.dy * inLength;
|
|
263
|
-
const outLength = (0, utils_1.vectorLength)(point.cpOutX ?? 0, point.cpOutY ?? 0) || referenceLength;
|
|
264
|
-
point.cpOutX = normalized.dx * outLength;
|
|
265
|
-
point.cpOutY = normalized.dy * outLength;
|
|
266
|
-
}
|
|
267
|
-
#alignMirrorLength(point) {
|
|
268
|
-
if (!point.isLinked) {
|
|
269
|
-
point.mirrorLength = false;
|
|
270
|
-
return;
|
|
271
|
-
}
|
|
272
|
-
const outLength = (0, utils_1.vectorLength)(point.cpOutX ?? 0, point.cpOutY ?? 0);
|
|
273
|
-
const inLength = (0, utils_1.vectorLength)(point.cpInX ?? 0, point.cpInY ?? 0);
|
|
274
|
-
const targetLength = Math.max(outLength, inLength);
|
|
275
|
-
if (targetLength <= 0) {
|
|
276
|
-
return;
|
|
277
|
-
}
|
|
278
|
-
if (outLength > 0) {
|
|
279
|
-
const outDirection = (0, utils_1.normalizeVector)(point.cpOutX ?? 0, point.cpOutY ?? 0);
|
|
280
|
-
point.cpOutX = outDirection.dx * targetLength;
|
|
281
|
-
point.cpOutY = outDirection.dy * targetLength;
|
|
282
|
-
}
|
|
283
|
-
else if (inLength > 0) {
|
|
284
|
-
const inDirection = (0, utils_1.normalizeVector)(point.cpInX ?? 0, point.cpInY ?? 0);
|
|
285
|
-
point.cpOutX = -inDirection.dx * targetLength;
|
|
286
|
-
point.cpOutY = -inDirection.dy * targetLength;
|
|
287
|
-
}
|
|
288
|
-
if (inLength > 0) {
|
|
289
|
-
const inDirection = (0, utils_1.normalizeVector)(point.cpInX ?? 0, point.cpInY ?? 0);
|
|
290
|
-
point.cpInX = inDirection.dx * targetLength;
|
|
291
|
-
point.cpInY = inDirection.dy * targetLength;
|
|
292
|
-
}
|
|
293
|
-
else if (outLength > 0) {
|
|
294
|
-
const outDirection = (0, utils_1.normalizeVector)(point.cpOutX ?? 0, point.cpOutY ?? 0);
|
|
295
|
-
point.cpInX = -outDirection.dx * targetLength;
|
|
296
|
-
point.cpInY = -outDirection.dy * targetLength;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
exports.CanvasControls = CanvasControls;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type CubicBezierPoints, EasingType, type LinearPoints } from "./types.cjs";
|
|
2
|
-
export declare class CanvasControls extends HTMLElement {
|
|
3
|
-
#private;
|
|
4
|
-
requestRender: () => void;
|
|
5
|
-
accessor easingType: EasingType;
|
|
6
|
-
accessor points: CubicBezierPoints | LinearPoints;
|
|
7
|
-
accessor focusedLinearIndex: number | null;
|
|
8
|
-
readonly handleToggleMirrorAngle: (event: Event) => void;
|
|
9
|
-
readonly handleToggleMirrorLength: (event: Event) => void;
|
|
10
|
-
readonly handleRemoveSmoothing: (event: Event) => void;
|
|
11
|
-
readonly handleAddSmoothing: (event: Event) => void;
|
|
12
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type CubicBezierPoints, EasingType, type LinearPoints } from "./types.js";
|
|
2
|
-
export declare class CanvasControls extends HTMLElement {
|
|
3
|
-
#private;
|
|
4
|
-
requestRender: () => void;
|
|
5
|
-
accessor easingType: EasingType;
|
|
6
|
-
accessor points: CubicBezierPoints | LinearPoints;
|
|
7
|
-
accessor focusedLinearIndex: number | null;
|
|
8
|
-
readonly handleToggleMirrorAngle: (event: Event) => void;
|
|
9
|
-
readonly handleToggleMirrorLength: (event: Event) => void;
|
|
10
|
-
readonly handleRemoveSmoothing: (event: Event) => void;
|
|
11
|
-
readonly handleAddSmoothing: (event: Event) => void;
|
|
12
|
-
}
|