@weasel-js/ui 0.7.2 → 1.0.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.
Files changed (107) hide show
  1. package/dist/chunks/{ActionBar-CiKvEvXi.js → ActionBar-GThu74LC.js} +4 -4
  2. package/dist/chunks/ActionBar-GThu74LC.js.map +1 -0
  3. package/dist/chunks/{Badge-DU8ihE7Z.js → Badge-DZQqAV4d.js} +5 -5
  4. package/dist/chunks/Badge-DZQqAV4d.js.map +1 -0
  5. package/dist/chunks/{Checkbox-CtK8H_OQ.js → Checkbox-Cf6YHVWV.js} +5 -5
  6. package/dist/chunks/Checkbox-Cf6YHVWV.js.map +1 -0
  7. package/dist/chunks/{ComboBox-CotoRgNi.js → ComboBox-EnV1IytN.js} +8 -8
  8. package/dist/chunks/ComboBox-EnV1IytN.js.map +1 -0
  9. package/dist/chunks/{DataGrid-mUq38k0Q.js → DataGrid-BQklXGRl.js} +10 -10
  10. package/dist/chunks/DataGrid-BQklXGRl.js.map +1 -0
  11. package/dist/chunks/GradientEditor-Co9aGyRe.js +260 -0
  12. package/dist/chunks/GradientEditor-Co9aGyRe.js.map +1 -0
  13. package/dist/chunks/{Input-D_Xzgr2b.js → Input-qk44ESKC.js} +4 -4
  14. package/dist/chunks/Input-qk44ESKC.js.map +1 -0
  15. package/dist/chunks/{Keycaps-B9dJMYx_.js → Keycaps-CFX7UAj8.js} +5 -5
  16. package/dist/chunks/Keycaps-CFX7UAj8.js.map +1 -0
  17. package/dist/chunks/{NumberField-BQmELz32.js → NumberField-CYhQeWoM.js} +5 -5
  18. package/dist/chunks/NumberField-CYhQeWoM.js.map +1 -0
  19. package/dist/chunks/{Powerline-C8rddbbK.js → Powerline-Bg9M5oBK.js} +2 -2
  20. package/dist/chunks/{Powerline-C8rddbbK.js.map → Powerline-Bg9M5oBK.js.map} +1 -1
  21. package/dist/chunks/{Prefs-BkDJ5Cdz.js → Prefs-DZjXp2Ln.js} +23 -23
  22. package/dist/chunks/Prefs-DZjXp2Ln.js.map +1 -0
  23. package/dist/chunks/{RadioGroup-Ci-I9NEx.js → RadioGroup-rL2i3afr.js} +5 -5
  24. package/dist/chunks/RadioGroup-rL2i3afr.js.map +1 -0
  25. package/dist/chunks/{RangeSlider-CW-edtNx.js → RangeSlider-DPldYd4O.js} +8 -8
  26. package/dist/chunks/RangeSlider-DPldYd4O.js.map +1 -0
  27. package/dist/chunks/{ResizeHandle-C2OBMqTs.js → ResizeHandle-DR8X229y.js} +3 -3
  28. package/dist/chunks/ResizeHandle-DR8X229y.js.map +1 -0
  29. package/dist/chunks/{Select-CLyBisCS.js → Select-vSeAbspK.js} +9 -9
  30. package/dist/chunks/Select-vSeAbspK.js.map +1 -0
  31. package/dist/chunks/{SelectionPanel-DBdhAKIK.js → SelectionPanel-1mmALQba.js} +19 -19
  32. package/dist/chunks/SelectionPanel-1mmALQba.js.map +1 -0
  33. package/dist/chunks/{Sidebar-doLqiTZH.js → Sidebar-CigrFvpL.js} +4 -4
  34. package/dist/chunks/Sidebar-CigrFvpL.js.map +1 -0
  35. package/dist/chunks/{SidebarPanel-DjTfOzB9.js → SidebarPanel-C0w16BrF.js} +10 -10
  36. package/dist/chunks/SidebarPanel-C0w16BrF.js.map +1 -0
  37. package/dist/chunks/{Slider-sUJGgmKR.js → Slider-Di2kNqVy.js} +11 -11
  38. package/dist/chunks/Slider-Di2kNqVy.js.map +1 -0
  39. package/dist/chunks/{StatusBar-OOjfqCD8.js → StatusBar-lt_Ok6WK.js} +6 -6
  40. package/dist/chunks/StatusBar-lt_Ok6WK.js.map +1 -0
  41. package/dist/chunks/{Switch-DxJLMYki.js → Switch-BYj762hm.js} +5 -5
  42. package/dist/chunks/Switch-BYj762hm.js.map +1 -0
  43. package/dist/chunks/{ToolButton-Dv6NdZKh.js → ToolButton-5L1sAlJC.js} +6 -6
  44. package/dist/chunks/ToolButton-5L1sAlJC.js.map +1 -0
  45. package/dist/chunks/{ToolOptionsBar-ChiL-HVA.js → ToolOptionsBar-D4xmXa_a.js} +4 -4
  46. package/dist/chunks/ToolOptionsBar-D4xmXa_a.js.map +1 -0
  47. package/dist/chunks/{ToolPalette-DXVIEO0w.js → ToolPalette-BDkvV3pJ.js} +7 -7
  48. package/dist/chunks/ToolPalette-BDkvV3pJ.js.map +1 -0
  49. package/dist/components/ActionBar/index.js +1 -1
  50. package/dist/components/Badge/index.js +1 -1
  51. package/dist/components/Checkbox/index.js +1 -1
  52. package/dist/components/ComboBox/index.js +1 -1
  53. package/dist/components/DataGrid/index.js +1 -1
  54. package/dist/components/GradientEditor/GradientEditor.d.ts +34 -0
  55. package/dist/components/GradientEditor/GradientEditor.d.ts.map +1 -0
  56. package/dist/components/GradientEditor/GradientHandles.d.ts +53 -0
  57. package/dist/components/GradientEditor/GradientHandles.d.ts.map +1 -0
  58. package/dist/components/GradientEditor/index.d.ts +3 -0
  59. package/dist/components/GradientEditor/index.d.ts.map +1 -0
  60. package/dist/components/GradientEditor/index.js +2 -0
  61. package/dist/components/Input/index.js +1 -1
  62. package/dist/components/Keycaps/index.js +1 -1
  63. package/dist/components/NumberField/index.js +1 -1
  64. package/dist/components/Powerline/index.js +2 -2
  65. package/dist/components/Prefs/index.js +1 -1
  66. package/dist/components/RadioGroup/index.js +1 -1
  67. package/dist/components/RangeSlider/index.js +1 -1
  68. package/dist/components/ResizeHandle/index.js +1 -1
  69. package/dist/components/Select/index.js +1 -1
  70. package/dist/components/SelectionPanel/index.js +1 -1
  71. package/dist/components/Sidebar/index.js +1 -1
  72. package/dist/components/SidebarPanel/index.js +1 -1
  73. package/dist/components/Slider/index.js +1 -1
  74. package/dist/components/StatusBar/index.js +1 -1
  75. package/dist/components/Switch/index.js +1 -1
  76. package/dist/components/ToolButton/index.js +1 -1
  77. package/dist/components/ToolOptionsBar/index.js +1 -1
  78. package/dist/components/ToolPalette/ToolPalette.d.ts.map +1 -1
  79. package/dist/components/ToolPalette/index.js +1 -1
  80. package/dist/index.d.ts +1 -0
  81. package/dist/index.d.ts.map +1 -1
  82. package/dist/index.js +36 -70
  83. package/dist/index.js.map +1 -1
  84. package/dist/style.css +1 -1
  85. package/package.json +2 -2
  86. package/dist/chunks/ActionBar-CiKvEvXi.js.map +0 -1
  87. package/dist/chunks/Badge-DU8ihE7Z.js.map +0 -1
  88. package/dist/chunks/Checkbox-CtK8H_OQ.js.map +0 -1
  89. package/dist/chunks/ComboBox-CotoRgNi.js.map +0 -1
  90. package/dist/chunks/DataGrid-mUq38k0Q.js.map +0 -1
  91. package/dist/chunks/Input-D_Xzgr2b.js.map +0 -1
  92. package/dist/chunks/Keycaps-B9dJMYx_.js.map +0 -1
  93. package/dist/chunks/NumberField-BQmELz32.js.map +0 -1
  94. package/dist/chunks/Prefs-BkDJ5Cdz.js.map +0 -1
  95. package/dist/chunks/RadioGroup-Ci-I9NEx.js.map +0 -1
  96. package/dist/chunks/RangeSlider-CW-edtNx.js.map +0 -1
  97. package/dist/chunks/ResizeHandle-C2OBMqTs.js.map +0 -1
  98. package/dist/chunks/Select-CLyBisCS.js.map +0 -1
  99. package/dist/chunks/SelectionPanel-DBdhAKIK.js.map +0 -1
  100. package/dist/chunks/Sidebar-doLqiTZH.js.map +0 -1
  101. package/dist/chunks/SidebarPanel-DjTfOzB9.js.map +0 -1
  102. package/dist/chunks/Slider-sUJGgmKR.js.map +0 -1
  103. package/dist/chunks/StatusBar-OOjfqCD8.js.map +0 -1
  104. package/dist/chunks/Switch-DxJLMYki.js.map +0 -1
  105. package/dist/chunks/ToolButton-Dv6NdZKh.js.map +0 -1
  106. package/dist/chunks/ToolOptionsBar-ChiL-HVA.js.map +0 -1
  107. package/dist/chunks/ToolPalette-DXVIEO0w.js.map +0 -1
@@ -1,10 +1,10 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  var t = {
3
- bar: "_bar_15iu9_1",
4
- item: "_item_15iu9_14",
5
- muted: "_muted_15iu9_18",
6
- hasTitle: "_hasTitle_15iu9_23",
7
- spacer: "_spacer_15iu9_27"
3
+ bar: "_bar_38xae_1",
4
+ item: "_item_38xae_14",
5
+ muted: "_muted_38xae_18",
6
+ hasTitle: "_hasTitle_38xae_23",
7
+ spacer: "_spacer_38xae_27"
8
8
  };
9
9
  //#endregion
10
10
  //#region src/components/StatusBar/StatusBar.tsx
@@ -38,4 +38,4 @@ function i() {
38
38
  //#endregion
39
39
  export { r as n, i as r, n as t };
40
40
 
41
- //# sourceMappingURL=StatusBar-OOjfqCD8.js.map
41
+ //# sourceMappingURL=StatusBar-lt_Ok6WK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatusBar-lt_Ok6WK.js","names":[],"sources":["../../src/components/StatusBar/StatusBar.module.css","../../src/components/StatusBar/StatusBar.tsx"],"sourcesContent":[".bar {\n display: flex;\n align-items: center;\n gap: 16px;\n flex-shrink: 0;\n padding: 4px 12px;\n font-family: var(--wzl-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);\n font-size: 11px;\n color: var(--wzl-fg-muted);\n background: var(--wzl-surface);\n border-top: 1px solid var(--wzl-border);\n}\n\n.item {\n white-space: nowrap;\n}\n\n.muted {\n opacity: 0.6;\n font-variant-numeric: tabular-nums;\n}\n\n.hasTitle {\n cursor: help;\n}\n\n.spacer {\n margin-left: auto;\n}\n","import type { ReactNode } from 'react';\nimport s from './StatusBar.module.css';\n\nexport interface StatusBarProps {\n /**\n * Accessible label for the bar. Deliberately not a live region — a status\n * bar's readouts change on every pointer move (zoom, cursor position,\n * selection count), and announcing each one would make a screen reader\n * unusable. Screen-reader users reach the same facts through the controls\n * that own them.\n */\n ariaLabel?: string;\n children?: ReactNode;\n className?: string;\n}\n\n/**\n * The thin readout strip along the bottom of an editor window: monospace,\n * one row, items separated by a fixed gap, with an optional spacer that\n * pushes everything after it to the trailing edge.\n *\n * Pure presentation — it holds whatever the app puts in it. Compose with\n * `<StatusBarItem>` and `<StatusBarSpacer>`.\n */\nexport function StatusBar(props: StatusBarProps) {\n const { ariaLabel, children, className } = props;\n return (\n <footer className={[s.bar, className].filter(Boolean).join(' ')} aria-label={ariaLabel}>\n {children}\n </footer>\n );\n}\n\nexport interface StatusBarItemProps {\n /**\n * Hover text. Items that carry one also get a `help` cursor, so the\n * affordance is discoverable rather than hidden behind a hover delay.\n */\n title?: string;\n /**\n * Dim the item and use tabular figures. For reference material that\n * shouldn't compete with live readouts — build stamps, hints, units.\n */\n muted?: boolean;\n children?: ReactNode;\n className?: string;\n}\n\n/** One readout in a `<StatusBar>`. */\nexport function StatusBarItem(props: StatusBarItemProps) {\n const { title, muted, children, className } = props;\n const cls = [s.item, muted && s.muted, title !== undefined && s.hasTitle, className]\n .filter(Boolean).join(' ');\n return <span className={cls} title={title}>{children}</span>;\n}\n\n/**\n * Splits a status bar into leading and trailing runs — everything after the\n * spacer is pushed to the trailing edge. Decorative, so it's hidden from the\n * accessibility tree.\n */\nexport function StatusBarSpacer() {\n return <span className={s.spacer} aria-hidden=\"true\" />;\n}\n"],"mappings":";;;;;;;;;;ACwBA,SAAgB,EAAU,GAAuB;CAC/C,IAAM,EAAE,cAAW,aAAU,iBAAc;AAC3C,QACE,kBAAC,UAAD;EAAQ,WAAW,CAAC,EAAE,KAAK,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EAAE,cAAY;EAC1E;EACM,CAAA;;AAoBb,SAAgB,EAAc,GAA2B;CACvD,IAAM,EAAE,UAAO,UAAO,aAAU,iBAAc;AAG9C,QAAO,kBAAC,QAAD;EAAM,WAFD;GAAC,EAAE;GAAM,KAAS,EAAE;GAAO,MAAU,KAAA,KAAa,EAAE;GAAU;GAAU,CACjF,OAAO,QAAQ,CAAC,KAAK,IACA;EAAY;EAAQ;EAAgB,CAAA;;AAQ9D,SAAgB,IAAkB;AAChC,QAAO,kBAAC,QAAD;EAAM,WAAW,EAAE;EAAQ,eAAY;EAAS,CAAA"}
@@ -2,10 +2,10 @@ import { forwardRef as e } from "react";
2
2
  import { Switch as t } from "react-aria-components";
3
3
  import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
4
  var i = {
5
- switch: "_switch_1yfo6_1",
6
- track: "_track_1yfo6_18",
7
- thumb: "_thumb_1yfo6_38",
8
- label: "_label_1yfo6_54"
5
+ switch: "_switch_qsj3o_1",
6
+ track: "_track_qsj3o_18",
7
+ thumb: "_thumb_qsj3o_38",
8
+ label: "_label_qsj3o_54"
9
9
  }, a = e(function(e, a) {
10
10
  let { children: o, className: s, ...c } = e;
11
11
  return /* @__PURE__ */ r(t, {
@@ -24,4 +24,4 @@ var i = {
24
24
  //#endregion
25
25
  export { a as t };
26
26
 
27
- //# sourceMappingURL=Switch-DxJLMYki.js.map
27
+ //# sourceMappingURL=Switch-BYj762hm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Switch-BYj762hm.js","names":[],"sources":["../../src/components/Switch/Switch.module.css","../../src/components/Switch/Switch.tsx"],"sourcesContent":[".switch {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n cursor: pointer;\n font-family: var(--wzl-font-ui);\n font-size: 13px;\n color: var(--wzl-fg);\n user-select: none;\n -webkit-user-select: none;\n}\n\n.switch[data-disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.track {\n position: relative;\n flex: 0 0 auto;\n width: 28px;\n height: 16px;\n background: var(--wzl-surface-sunken);\n border: 1px solid var(--wzl-border-strong);\n border-radius: 8px;\n transition: background-color var(--wzl-motion-fast), border-color var(--wzl-motion-fast), box-shadow var(--wzl-motion-fast);\n}\n\n.switch[data-focus-visible] .track {\n box-shadow: 0 0 0 2px var(--wzl-focus-ring);\n}\n\n.switch[data-selected] .track {\n background: var(--wzl-accent-strong);\n border-color: var(--wzl-accent-strong);\n}\n\n.thumb {\n position: absolute;\n top: 1px;\n left: 1px;\n width: 12px;\n height: 12px;\n background: var(--wzl-fg);\n border-radius: 50%;\n transition: transform var(--wzl-motion-fast);\n}\n\n.switch[data-selected] .thumb {\n transform: translateX(12px);\n background: var(--wzl-fg-on-accent);\n}\n\n.label {\n line-height: 1.2;\n}\n","import { forwardRef, type ReactNode, type Ref } from 'react';\nimport {\n Switch as RACSwitch,\n type SwitchProps as RACSwitchProps,\n} from 'react-aria-components';\nimport s from './Switch.module.css';\n\nexport type SwitchProps = Omit<RACSwitchProps, 'children' | 'className'> & {\n children?: ReactNode;\n className?: string;\n};\n\nexport const Switch = forwardRef(function Switch(\n props: SwitchProps,\n ref: Ref<HTMLLabelElement>,\n) {\n const { children, className, ...rest } = props;\n return (\n <RACSwitch\n {...rest}\n ref={ref}\n className={[s.switch, className].filter(Boolean).join(' ')}\n >\n <span className={s.track}>\n <span className={s.thumb} />\n </span>\n {children !== undefined && <span className={s.label}>{children}</span>}\n </RACSwitch>\n );\n});\n"],"mappings":";;;;;;;;GCYa,IAAS,EAAW,SAC/B,GACA,GACA;CACA,IAAM,EAAE,aAAU,cAAW,GAAG,MAAS;AACzC,QACE,kBAAC,GAAD;EACE,GAAI;EACC;EACL,WAAW,CAAC,EAAE,QAAQ,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;YAH5D,CAKE,kBAAC,QAAD;GAAM,WAAW,EAAE;aACjB,kBAAC,QAAD,EAAM,WAAW,EAAE,OAAS,CAAA;GACvB,CAAA,EACN,MAAa,KAAA,KAAa,kBAAC,QAAD;GAAM,WAAW,EAAE;GAAQ;GAAgB,CAAA,CAC5D;;EAEd"}
@@ -2,11 +2,11 @@ import { n as e, t } from "./Tooltip-Clgn4trm.js";
2
2
  import { Focusable as n } from "react-aria-components";
3
3
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
4
  var a = {
5
- button: "_button_rsrcm_1",
6
- active: "_active_rsrcm_26",
7
- icon: "_icon_rsrcm_35",
8
- label: "_label_rsrcm_37",
9
- shortcut: "_shortcut_rsrcm_38"
5
+ button: "_button_1jvxe_1",
6
+ active: "_active_1jvxe_26",
7
+ icon: "_icon_1jvxe_35",
8
+ label: "_label_1jvxe_37",
9
+ shortcut: "_shortcut_1jvxe_38"
10
10
  };
11
11
  //#endregion
12
12
  //#region src/components/ToolButton/ToolButton.tsx
@@ -50,4 +50,4 @@ function o(o) {
50
50
  //#endregion
51
51
  export { o as t };
52
52
 
53
- //# sourceMappingURL=ToolButton-Dv6NdZKh.js.map
53
+ //# sourceMappingURL=ToolButton-5L1sAlJC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToolButton-5L1sAlJC.js","names":[],"sources":["../../src/components/ToolButton/ToolButton.module.css","../../src/components/ToolButton/ToolButton.tsx"],"sourcesContent":[".button {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 2px;\n min-width: 44px;\n padding: 6px 4px;\n background: transparent;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--wzl-fg);\n cursor: default;\n font-family: inherit;\n font-size: 10px;\n line-height: 1.1;\n}\n.button:hover:not([disabled]) {\n background: var(--wzl-surface-hover);\n color: var(--wzl-fg);\n}\n.button:focus-visible {\n outline: 2px solid var(--wzl-accent);\n outline-offset: -2px;\n}\n.button.active {\n background: var(--wzl-surface-pressed);\n border-color: var(--wzl-accent);\n color: var(--wzl-fg);\n}\n.button[disabled] {\n opacity: 0.4;\n}\n\n.icon { display: block; }\n.icon > svg { display: block; }\n.label { font-size: 10px; }\n.shortcut {\n color: var(--wzl-fg-muted);\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n font-size: 9px;\n}\n","import type { ReactNode } from 'react';\nimport { Focusable } from 'react-aria-components';\nimport { Tooltip, TooltipTrigger } from '../Tooltip';\nimport s from './ToolButton.module.css';\n\nexport interface ToolButtonProps {\n /** Icon node (typically an SVG component). */\n icon: ReactNode;\n /** Human-readable label shown under the icon. */\n label: string;\n /** Optional shortcut hint (e.g. \"V\" or \"⌘Z\"). */\n shortcut?: string;\n /** Selected/active state — toggles the active visual treatment. */\n active?: boolean;\n /** Disabled state — passes through to the underlying button. */\n disabled?: boolean;\n /**\n * When true, sets `aria-disabled=\"true\"` on the button without using the\n * native `disabled` attribute. This keeps the button focusable and reachable\n * by keyboard (roving-tabindex still applies) while marking it as ineligible\n * to screen readers. The caller is responsible for making `onClick` a no-op.\n */\n ariaDisabled?: boolean;\n /**\n * Whether this button is the currently tabbable member of its toolbar.\n * Toolbars use roving tabindex: exactly one button has `tabIndex=0` at\n * a time; the rest are `-1`. Caller manages which.\n */\n tabbable?: boolean;\n /** Click handler. */\n onClick(): void;\n /**\n * Tooltip content. Defaults to `label` (plus `shortcut` if provided).\n */\n title?: string;\n /** Additional class for the root button. */\n className?: string;\n}\n\n/**\n * Generic icon-+-label toolbar button — building block for `ToolPalette`\n * and similar surfaces. Headless about layout direction (parent group\n * supplies flex direction via `ToolGroup`). Theme via `--wzl-*` tokens.\n */\nexport function ToolButton(props: ToolButtonProps) {\n const { icon, label, shortcut, active, disabled, ariaDisabled, tabbable, onClick, title, className } = props;\n const resolvedTitle = title ?? (shortcut ? `${label} (${shortcut})` : label);\n const cls = [s.button, active && s.active, className].filter(Boolean).join(' ');\n return (\n <TooltipTrigger isDisabled={disabled}>\n <Focusable isDisabled={disabled}>\n <button\n type=\"button\"\n tabIndex={tabbable ? 0 : -1}\n className={cls}\n aria-current={active ? 'true' : undefined}\n aria-disabled={ariaDisabled ? 'true' : undefined}\n disabled={disabled}\n onClick={onClick}\n >\n <span className={s.icon} aria-hidden=\"true\">{icon}</span>\n <span className={s.label}>{label}</span>\n {shortcut && <span className={s.shortcut}>{shortcut}</span>}\n </button>\n </Focusable>\n <Tooltip>{resolvedTitle}</Tooltip>\n </TooltipTrigger>\n );\n}\n"],"mappings":";;;;;;;;;;;;AC4CA,SAAgB,EAAW,GAAwB;CACjD,IAAM,EAAE,SAAM,UAAO,aAAU,WAAQ,aAAU,iBAAc,aAAU,YAAS,UAAO,iBAAc,GACjG,IAAgB,MAAU,IAAW,GAAG,EAAM,IAAI,EAAS,KAAK,IAChE,IAAM;EAAC,EAAE;EAAQ,KAAU,EAAE;EAAQ;EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;AAC/E,QACE,kBAAC,GAAD;EAAgB,YAAY;YAA5B,CACE,kBAAC,GAAD;GAAW,YAAY;aACrB,kBAAC,UAAD;IACE,MAAK;IACL,UAAU,IAAW,IAAI;IACzB,WAAW;IACX,gBAAc,IAAS,SAAS,KAAA;IAChC,iBAAe,IAAe,SAAS,KAAA;IAC7B;IACD;cAPX;KASE,kBAAC,QAAD;MAAM,WAAW,EAAE;MAAM,eAAY;gBAAQ;MAAY,CAAA;KACzD,kBAAC,QAAD;MAAM,WAAW,EAAE;gBAAQ;MAAa,CAAA;KACvC,KAAY,kBAAC,QAAD;MAAM,WAAW,EAAE;gBAAW;MAAgB,CAAA;KACpD;;GACC,CAAA,EACZ,kBAAC,GAAD,EAAA,UAAU,GAAwB,CAAA,CACnB"}
@@ -1,8 +1,8 @@
1
1
  import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
2
  var n = {
3
- root: "_root_zcxef_13",
4
- label: "_label_zcxef_25",
5
- controls: "_controls_zcxef_6"
3
+ root: "_root_ps46a_13",
4
+ label: "_label_ps46a_25",
5
+ controls: "_controls_ps46a_6"
6
6
  };
7
7
  //#endregion
8
8
  //#region src/components/ToolOptionsBar/ToolOptionsBar.tsx
@@ -24,4 +24,4 @@ function r(r) {
24
24
  //#endregion
25
25
  export { r as t };
26
26
 
27
- //# sourceMappingURL=ToolOptionsBar-ChiL-HVA.js.map
27
+ //# sourceMappingURL=ToolOptionsBar-D4xmXa_a.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToolOptionsBar-D4xmXa_a.js","names":[],"sources":["../../src/components/ToolOptionsBar/ToolOptionsBar.module.css","../../src/components/ToolOptionsBar/ToolOptionsBar.tsx"],"sourcesContent":["/* Horizontal strip reserved above the workspace for contextual tool\n options. Fixed height so mounting/unmounting content never resizes\n the workspace beneath it — that's the whole reason this row exists\n as permanent chrome rather than an on-demand overlay.\n\n Overflow: when controls exceed the available width, `.controls`\n scrolls horizontally rather than wrapping (which would grow the row\n and defeat the fixed-height guarantee above) or clipping (which\n would hide controls with no way to reach them). A flyout/long-press\n affordance was considered and rejected — grouped, directly visible\n layouts are preferred in this repo. */\n\n.root {\n display: flex;\n align-items: center;\n gap: 8px;\n height: var(--wzl-tb-height, 28px);\n padding: 0 8px;\n background: var(--wzl-surface);\n border-bottom: 1px solid var(--wzl-border);\n color: var(--wzl-fg);\n overflow: hidden;\n}\n\n.label {\n flex: 0 0 auto;\n font-size: 11px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n color: var(--wzl-fg-muted);\n white-space: nowrap;\n}\n\n.controls {\n display: flex;\n align-items: center;\n gap: 6px;\n flex: 1 1 auto;\n min-width: 0;\n height: 100%;\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: thin;\n}\n\n/* Firefox gets a thin scrollbar for free via `scrollbar-width` above.\n * Chromium/WebKit need it spelled out — on a classic (non-overlay)\n * scrollbar theme (default on Windows Chrome/Edge), an unstyled\n * horizontal scrollbar is ~15-17px tall and renders *inside* this box,\n * clipping/off-centering the row's controls. That would reintroduce the\n * exact height instability the scroll-over-wrap overflow choice above\n * exists to avoid — just at the row's inner edge instead of its outer\n * one. Pin it thin and out of the way instead. */\n.controls::-webkit-scrollbar {\n height: 4px;\n}\n.controls::-webkit-scrollbar-track {\n background: transparent;\n}\n.controls::-webkit-scrollbar-thumb {\n background: var(--wzl-border);\n border-radius: 2px;\n}\n","import type { ReactNode } from 'react';\nimport s from './ToolOptionsBar.module.css';\n\nexport interface ToolOptionsBarProps {\n /**\n * Context label for the row — e.g. the active tool's name. Rendered\n * before the children and doubles as the toolbar's `aria-label`. Omit\n * it and the row still renders (it's a permanently reserved slot), just\n * without an accessible name.\n *\n * Using `label` for both the visible text and `aria-label` means a\n * screen reader announces it twice when landing on the toolbar (\"Text,\n * toolbar\", then \"Text\" again when browsing into the visible span).\n * `aria-labelledby` would avoid the echo at the cost of id plumbing and\n * an awkward no-`id`-to-point-at case when `label` is omitted. The\n * double-announcement is common enough for labelled landmark regions\n * that it's left as-is — considered, not missed.\n */\n label?: string;\n children?: ReactNode;\n className?: string;\n}\n\n/**\n * Horizontal strip reserved above the workspace for contextual tool\n * options — its first tenant is the character controls a text tool\n * exposes while a caret range is active. Pure chrome: it renders an\n * optional label and a children slot, nothing else. It knows nothing\n * about text, or about any specific tool — any tool can fill it.\n *\n * The row always renders, even with no `label` and no `children`,\n * because the app reserves its height permanently rather than mounting\n * it on demand — mounting mid-edit would resize the workspace under a\n * canvas that's sized to the page.\n *\n * `role=\"toolbar\"` without roving tabindex: the ARIA authoring practices\n * expect arrow-key roving focus across a toolbar's items, but this\n * component doesn't own or know the shape of its children — they're\n * arbitrary, possibly compound controls (`NumberField`, `Select`,\n * `ColorField`) that already use arrow keys for their own value editing.\n * Imposing roving focus here would fight those controls' own key\n * handling. Tab order falls back to normal DOM order for now; revisit\n * once the first tenant's control set is concrete and a roving-focus\n * contract can be designed in coordination with those controls.\n */\nexport function ToolOptionsBar(props: ToolOptionsBarProps) {\n const { label, children, className } = props;\n const cls = [s.root, className].filter(Boolean).join(' ');\n return (\n <div className={cls} role=\"toolbar\" aria-label={label}>\n {label !== undefined && <span className={s.label}>{label}</span>}\n <div className={s.controls}>{children}</div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;AC6CA,SAAgB,EAAe,GAA4B;CACzD,IAAM,EAAE,UAAO,aAAU,iBAAc;AAEvC,QACE,kBAAC,OAAD;EAAK,WAFK,CAAC,EAAE,MAAM,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAEnC;EAAK,MAAK;EAAU,cAAY;YAAhD,CACG,MAAU,KAAA,KAAa,kBAAC,QAAD;GAAM,WAAW,EAAE;aAAQ;GAAa,CAAA,EAChE,kBAAC,OAAD;GAAK,WAAW,EAAE;GAAW;GAAe,CAAA,CACxC"}
@@ -1,15 +1,15 @@
1
1
  import { t as e } from "./keyGlyph-BDH5fqkO.js";
2
- import { t } from "./ToolButton-Dv6NdZKh.js";
2
+ import { t } from "./ToolButton-5L1sAlJC.js";
3
3
  import { t as n } from "./ToolGroup-BAthcF5H.js";
4
4
  import { Fragment as r, useRef as i } from "react";
5
5
  import { UnknownIcon as a } from "@weasel-js/core";
6
6
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
- import { eligibleTool as c } from "@weasel-js/modes";
7
+ import { eligibleContribution as c } from "@weasel-js/modes";
8
8
  var l = {
9
- palette: "_palette_1ygdo_1",
10
- horizontal: "_horizontal_1ygdo_11",
11
- ineligibleBtn: "_ineligibleBtn_1ygdo_16",
12
- separator: "_separator_1ygdo_21"
9
+ palette: "_palette_1ntz3_1",
10
+ horizontal: "_horizontal_1ntz3_11",
11
+ ineligibleBtn: "_ineligibleBtn_1ntz3_16",
12
+ separator: "_separator_1ntz3_21"
13
13
  };
14
14
  //#endregion
15
15
  //#region src/components/ToolPalette/formatShortcut.ts
@@ -114,4 +114,4 @@ function _(e) {
114
114
  //#endregion
115
115
  export { d as n, u as r, _ as t };
116
116
 
117
- //# sourceMappingURL=ToolPalette-DXVIEO0w.js.map
117
+ //# sourceMappingURL=ToolPalette-BDkvV3pJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToolPalette-BDkvV3pJ.js","names":[],"sources":["../../src/components/ToolPalette/ToolPalette.module.css","../../src/components/ToolPalette/formatShortcut.ts","../../src/components/ToolPalette/ToolPalette.tsx"],"sourcesContent":[".palette {\n display: flex;\n flex-direction: column;\n gap: 4px;\n background: var(--wzl-surface);\n border: 1px solid var(--wzl-border);\n border-radius: 4px;\n padding: 4px;\n user-select: none;\n}\n.palette.horizontal {\n flex-direction: row;\n}\n\n/* Applied to ineligible tool buttons in the active mode. */\n.ineligibleBtn {\n opacity: 0.35;\n cursor: not-allowed;\n}\n\n.separator {\n background: var(--wzl-border);\n}\n.palette:not(.horizontal) .separator {\n height: 1px;\n margin: 2px 0;\n}\n.palette.horizontal .separator {\n width: 1px;\n margin: 0 2px;\n}\n","import { keyGlyph } from '../Keycaps/keyGlyph';\n\nexport interface ShortcutInput {\n key: string | readonly string[];\n mod?: boolean;\n alt?: boolean;\n shift?: boolean | 'optional';\n}\n\n/** Format a shortcut as an array of display chips, one per key — modifier\n * icons (⌘, ↑, ⌥) followed by the key glyph. UIs that want a boxed\n * per-key look render each chip in its own element. `shift: 'optional'` is\n * treated as falsy. */\nexport function formatShortcutParts(b: ShortcutInput | undefined): readonly string[] | undefined {\n if (!b) return undefined;\n const rawKey = Array.isArray(b.key) ? b.key[0] : (b.key as string);\n const parts: string[] = [];\n if (b.mod) parts.push('⌘');\n if (b.shift === true) parts.push('⇧');\n if (b.alt) parts.push('⌥');\n parts.push(keyGlyph(rawKey));\n return parts;\n}\n\n/** Format a shortcut as a single display string. Order: mod, shift, alt,\n * key. Returns `undefined` for `undefined` input so callers can `??` a\n * fallback. When `key` is an array, the first element is used. `shift: 'optional'`\n * is treated as falsy. */\nexport function formatShortcut(b: ShortcutInput | undefined): string | undefined {\n const parts = formatShortcutParts(b);\n return parts ? parts.join('') : undefined;\n}\n","import { Fragment, useRef, type ReactNode } from 'react';\nimport { UnknownIcon } from '@weasel-js/core';\nimport type { AnyTool, ToolsApi } from '@weasel-js/core';\nimport { eligibleContribution, type ModeRegistry } from '@weasel-js/modes';\nimport { ToolButton } from '../ToolButton';\nimport { ToolGroup } from '../ToolGroup';\nimport s from './ToolPalette.module.css';\nimport { formatShortcut, type ShortcutInput } from './formatShortcut';\n\nconst DEFAULT_GROUP_ORDER = ['select', 'shape', 'draw', 'type', 'view'] as const;\nconst MISC = 'misc';\n\nfunction partitionByGroup(list: AnyTool[]): Map<string, AnyTool[]> {\n const groups = new Map<string, AnyTool[]>();\n for (const tool of list) {\n const g = tool.presentation?.group ?? MISC;\n const bucket = groups.get(g) ?? [];\n bucket.push(tool);\n groups.set(g, bucket);\n }\n return groups;\n}\n\nfunction orderedGroupKeys(\n groups: Map<string, AnyTool[]>,\n groupOrder: readonly string[],\n): string[] {\n const seen = new Set(groups.keys());\n const ordered: string[] = [];\n for (const known of groupOrder) {\n if (seen.has(known)) {\n ordered.push(known);\n seen.delete(known);\n }\n }\n // Unknown groups in insertion order (Map preserves it), misc last.\n for (const key of groups.keys()) {\n if (seen.has(key) && key !== MISC) {\n ordered.push(key);\n seen.delete(key);\n }\n }\n if (seen.has(MISC)) ordered.push(MISC);\n return ordered;\n}\n\nfunction resolveIcon(tool: AnyTool): ReactNode {\n const rawIcon = tool.presentation?.icon;\n if (rawIcon == null) return <UnknownIcon />;\n if (typeof rawIcon === 'function') return rawIcon(undefined);\n return rawIcon;\n}\n\nexport interface ToolPaletteProps {\n tools: ToolsApi;\n orientation?: 'vertical' | 'horizontal';\n className?: string;\n /** Derive the keyboard shortcut for a tool button from the action registry.\n * Called with the tool's id; return `undefined` to suppress a chip. When\n * omitted, falls back to `tool.keybinding` (legacy path). */\n lookupShortcut?: (toolId: string) => ShortcutInput | undefined;\n /**\n * Optional mode registry. When provided, tools whose `capabilities` do not\n * match the current mode are rendered greyed-out, aria-disabled, and their\n * onClick is suppressed. When omitted, all tools are treated as eligible\n * (preserves existing behaviour in consumers that haven't wired a registry).\n */\n modeRegistry?: ModeRegistry;\n /**\n * Presentation-group display order. Groups not listed keep their registry\n * insertion order after the listed ones; `misc` always renders last.\n * Defaults to `['select', 'shape', 'draw', 'type', 'view']`.\n */\n groupOrder?: readonly string[];\n}\n\nexport function ToolPalette(props: ToolPaletteProps) {\n const {\n tools, orientation = 'vertical', className, lookupShortcut, modeRegistry,\n groupOrder = DEFAULT_GROUP_ORDER,\n } = props;\n const list = Object.values(tools.registry);\n const groups = partitionByGroup(list);\n const groupKeys = orderedGroupKeys(groups, groupOrder);\n const cls = [s.palette, orientation === 'horizontal' && s.horizontal, className]\n .filter(Boolean).join(' ');\n\n const orderedIds = groupKeys.flatMap((k) => groups.get(k)!.map((t) => t.id));\n const tabbableId = tools.active && orderedIds.includes(tools.active)\n ? tools.active\n : orderedIds[0];\n const rootRef = useRef<HTMLDivElement | null>(null);\n\n function onKeyDown(e: React.KeyboardEvent<HTMLDivElement>) {\n const target = e.target as HTMLElement;\n if (target.tagName !== 'BUTTON') return;\n const root = rootRef.current;\n if (!root) return;\n const buttons = Array.from(root.querySelectorAll<HTMLButtonElement>('button'));\n const i = buttons.indexOf(target as HTMLButtonElement);\n if (i < 0) return;\n\n let next = -1;\n switch (e.key) {\n case 'ArrowDown':\n case 'ArrowRight':\n next = (i + 1) % buttons.length;\n break;\n case 'ArrowUp':\n case 'ArrowLeft':\n next = (i - 1 + buttons.length) % buttons.length;\n break;\n case 'Home':\n next = 0;\n break;\n case 'End':\n next = buttons.length - 1;\n break;\n }\n if (next >= 0) {\n e.preventDefault();\n buttons[next].focus();\n }\n }\n\n return (\n <div\n ref={rootRef}\n className={cls}\n role=\"toolbar\"\n aria-label=\"Tools\"\n onKeyDown={onKeyDown}\n >\n {groupKeys.map((key, i) => (\n <Fragment key={key}>\n {i > 0 && (\n <div\n className={s.separator}\n role=\"separator\"\n aria-orientation={orientation === 'horizontal' ? 'vertical' : 'horizontal'}\n />\n )}\n <ToolGroup orientation={orientation} groupKey={key}>\n {groups.get(key)!.map((tool) => {\n const label = tool.presentation?.label ?? tool.id;\n const shortcut = tool.presentation?.shortcut\n ?? formatShortcut(lookupShortcut ? lookupShortcut(tool.id) : tool.keybinding);\n const enabled = modeRegistry ? eligibleContribution(modeRegistry, tool) : true;\n const modeName = modeRegistry ? modeRegistry.current().id : undefined;\n const resolvedTitle = !enabled && modeName\n ? `${label}${shortcut ? ` (${shortcut})` : ''} — disabled in ${modeName} mode`\n : undefined;\n return (\n <ToolButton\n key={tool.id}\n icon={resolveIcon(tool)}\n label={label}\n shortcut={shortcut}\n active={tools.active === tool.id}\n tabbable={tool.id === tabbableId}\n ariaDisabled={!enabled}\n className={!enabled ? s.ineligibleBtn : undefined}\n title={resolvedTitle}\n onClick={enabled ? () => tools.setActive(tool.id) : () => {}}\n />\n );\n })}\n </ToolGroup>\n </Fragment>\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;ACaA,SAAgB,EAAoB,GAA6D;AAC/F,KAAI,CAAC,EAAG;CACR,IAAM,IAAS,MAAM,QAAQ,EAAE,IAAI,GAAG,EAAE,IAAI,KAAM,EAAE,KAC9C,IAAkB,EAAE;AAK1B,QAJI,EAAE,OAAK,EAAM,KAAK,IAAI,EACtB,EAAE,UAAU,MAAM,EAAM,KAAK,IAAI,EACjC,EAAE,OAAK,EAAM,KAAK,IAAI,EAC1B,EAAM,KAAK,EAAS,EAAO,CAAC,EACrB;;AAOT,SAAgB,EAAe,GAAkD;CAC/E,IAAM,IAAQ,EAAoB,EAAE;AACpC,QAAO,IAAQ,EAAM,KAAK,GAAG,GAAG,KAAA;;;;ACrBlC,IAAM,IAAsB;CAAC;CAAU;CAAS;CAAQ;CAAQ;CAAO,EACjE,IAAO;AAEb,SAAS,EAAiB,GAAyC;CACjE,IAAM,oBAAS,IAAI,KAAwB;AAC3C,MAAK,IAAM,KAAQ,GAAM;EACvB,IAAM,IAAI,EAAK,cAAc,SAAS,GAChC,IAAS,EAAO,IAAI,EAAE,IAAI,EAAE;AAElC,EADA,EAAO,KAAK,EAAK,EACjB,EAAO,IAAI,GAAG,EAAO;;AAEvB,QAAO;;AAGT,SAAS,EACP,GACA,GACU;CACV,IAAM,IAAO,IAAI,IAAI,EAAO,MAAM,CAAC,EAC7B,IAAoB,EAAE;AAC5B,MAAK,IAAM,KAAS,EAClB,CAAI,EAAK,IAAI,EAAM,KACjB,EAAQ,KAAK,EAAM,EACnB,EAAK,OAAO,EAAM;AAItB,MAAK,IAAM,KAAO,EAAO,MAAM,CAC7B,CAAI,EAAK,IAAI,EAAI,IAAI,MAAQ,MAC3B,EAAQ,KAAK,EAAI,EACjB,EAAK,OAAO,EAAI;AAIpB,QADI,EAAK,IAAI,EAAK,IAAE,EAAQ,KAAK,EAAK,EAC/B;;AAGT,SAAS,EAAY,GAA0B;CAC7C,IAAM,IAAU,EAAK,cAAc;AAGnC,QAFI,KAAW,OAAa,kBAAC,GAAD,EAAe,CAAA,GACvC,OAAO,KAAY,aAAmB,EAAQ,KAAA,EAAU,GACrD;;AA0BT,SAAgB,EAAY,GAAyB;CACnD,IAAM,EACJ,UAAO,iBAAc,YAAY,cAAW,mBAAgB,iBAC5D,gBAAa,MACX,GAEE,IAAS,EADF,OAAO,OAAO,EAAM,SACD,CAAK,EAC/B,IAAY,EAAiB,GAAQ,EAAW,EAChD,IAAM;EAAC,EAAE;EAAS,MAAgB,gBAAgB,EAAE;EAAY;EAAU,CAC7E,OAAO,QAAQ,CAAC,KAAK,IAAI,EAEtB,IAAa,EAAU,SAAS,MAAM,EAAO,IAAI,EAAE,CAAE,KAAK,MAAM,EAAE,GAAG,CAAC,EACtE,IAAa,EAAM,UAAU,EAAW,SAAS,EAAM,OAAO,GAChE,EAAM,SACN,EAAW,IACT,IAAU,EAA8B,KAAK;CAEnD,SAAS,EAAU,GAAwC;EACzD,IAAM,IAAS,EAAE;AACjB,MAAI,EAAO,YAAY,SAAU;EACjC,IAAM,IAAO,EAAQ;AACrB,MAAI,CAAC,EAAM;EACX,IAAM,IAAU,MAAM,KAAK,EAAK,iBAAoC,SAAS,CAAC,EACxE,IAAI,EAAQ,QAAQ,EAA4B;AACtD,MAAI,IAAI,EAAG;EAEX,IAAI,IAAO;AACX,UAAQ,EAAE,KAAV;GACE,KAAK;GACL,KAAK;AACH,SAAQ,IAAI,KAAK,EAAQ;AACzB;GACF,KAAK;GACL,KAAK;AACH,SAAQ,IAAI,IAAI,EAAQ,UAAU,EAAQ;AAC1C;GACF,KAAK;AACH,QAAO;AACP;GACF,KAAK;AACH,QAAO,EAAQ,SAAS;AACxB;;AAEJ,EAAI,KAAQ,MACV,EAAE,gBAAgB,EAClB,EAAQ,GAAM,OAAO;;AAIzB,QACE,kBAAC,OAAD;EACE,KAAK;EACL,WAAW;EACX,MAAK;EACL,cAAW;EACA;YAEV,EAAU,KAAK,GAAK,MACnB,kBAAC,GAAD,EAAA,UAAA,CACG,IAAI,KACH,kBAAC,OAAD;GACE,WAAW,EAAE;GACb,MAAK;GACL,oBAAkB,MAAgB,eAAe,aAAa;GAC9D,CAAA,EAEJ,kBAAC,GAAD;GAAwB;GAAa,UAAU;aAC5C,EAAO,IAAI,EAAI,CAAE,KAAK,MAAS;IAC9B,IAAM,IAAQ,EAAK,cAAc,SAAS,EAAK,IACzC,IAAW,EAAK,cAAc,YAC/B,EAAe,IAAiB,EAAe,EAAK,GAAG,GAAG,EAAK,WAAW,EACzE,IAAU,IAAe,EAAqB,GAAc,EAAK,GAAG,IACpE,IAAW,IAAe,EAAa,SAAS,CAAC,KAAK,KAAA,GACtD,IAAgB,CAAC,KAAW,IAC9B,GAAG,IAAQ,IAAW,KAAK,EAAS,KAAK,GAAG,iBAAiB,EAAS,SACtE,KAAA;AACJ,WACE,kBAAC,GAAD;KAEE,MAAM,EAAY,EAAK;KAChB;KACG;KACV,QAAQ,EAAM,WAAW,EAAK;KAC9B,UAAU,EAAK,OAAO;KACtB,cAAc,CAAC;KACf,WAAY,IAA4B,KAAA,IAAlB,EAAE;KACxB,OAAO;KACP,SAAS,UAAgB,EAAM,UAAU,EAAK,GAAG,SAAS;KAC1D,EAVK,EAAK,GAUV;KAEJ;GACQ,CAAA,CACH,EAAA,EAlCI,EAkCJ,CACX;EACE,CAAA"}
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../chunks/ActionBar-CiKvEvXi.js";
1
+ import { t as e } from "../../chunks/ActionBar-GThu74LC.js";
2
2
  export { e as ActionBar };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../chunks/Badge-DU8ihE7Z.js";
1
+ import { t as e } from "../../chunks/Badge-DZQqAV4d.js";
2
2
  export { e as Badge };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../chunks/Checkbox-CtK8H_OQ.js";
1
+ import { t as e } from "../../chunks/Checkbox-Cf6YHVWV.js";
2
2
  export { e as Checkbox };
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "../../chunks/ComboBox-CotoRgNi.js";
1
+ import { n as e, t } from "../../chunks/ComboBox-EnV1IytN.js";
2
2
  export { t as ComboBox, e as ComboBoxItem };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../chunks/DataGrid-mUq38k0Q.js";
1
+ import { t as e } from "../../chunks/DataGrid-BQklXGRl.js";
2
2
  export { e as DataGrid };
@@ -0,0 +1,34 @@
1
+ import { type ReactElement } from 'react';
2
+ import { type GradientFill } from '@weasel-js/core';
3
+ export interface GradientEditorProps {
4
+ /** The gradient being edited. */
5
+ value: GradientFill;
6
+ /**
7
+ * Live value during a gesture — a stop drag, a color-picker scrub. Wire
8
+ * it for preview; it fires many times per gesture and must not be
9
+ * written to history.
10
+ */
11
+ onInput?: (next: GradientFill) => void;
12
+ /** Committed value: one call per completed gesture. Pair with an
13
+ * undoable write. */
14
+ onChange: (next: GradientFill) => void;
15
+ /** Show the linear / radial / conic switch. Default true; turn it off
16
+ * when the surrounding UI already owns the kind. */
17
+ kindSwitch?: boolean;
18
+ className?: string;
19
+ }
20
+ /**
21
+ * Editor for a gradient's kind and stop list.
22
+ *
23
+ * Geometry (`from`/`to`, `center`, `radius`, `angle`) is deliberately not
24
+ * edited here — on a canvas that belongs on the artwork, via
25
+ * `<GradientHandles>`. This component owns the parts with no spatial
26
+ * meaning, so it composes into a properties panel at any width.
27
+ *
28
+ * Stops are addressed by their position in `value.stops`, which is never
29
+ * reordered — dragging one stop past another leaves both indices alone, so
30
+ * a drag can cross a neighbour without the two swapping under the pointer.
31
+ * Rendering sorts a copy.
32
+ */
33
+ export declare function GradientEditor(props: GradientEditorProps): ReactElement;
34
+ //# sourceMappingURL=GradientEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GradientEditor.d.ts","sourceRoot":"","sources":["../../../src/components/GradientEditor/GradientEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAIL,KAAK,YAAY,EAElB,MAAM,iBAAiB,CAAC;AAgBzB,MAAM,WAAW,mBAAmB;IAClC,iCAAiC;IACjC,KAAK,EAAE,YAAY,CAAC;IACpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACvC;0BACsB;IACtB,QAAQ,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACvC;yDACqD;IACrD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,YAAY,CAoEvE"}
@@ -0,0 +1,53 @@
1
+ import { type ReactElement } from 'react';
2
+ import { type GradientFill } from '@weasel-js/core';
3
+ /** Structural, and deliberately not exported — `Plot2D` and `CurveEditor`
4
+ * each publish their own `Point`, and a third would only be ambiguous at
5
+ * the package barrel. Consumers pass any `{ x, y }`. */
6
+ interface Point {
7
+ x: number;
8
+ y: number;
9
+ }
10
+ export interface GradientHandlesProps {
11
+ /**
12
+ * The gradient whose geometry these handles move, in a **resolved,
13
+ * isotropic** frame — one where `radius` is a length in the same units as
14
+ * `center.x` and a right angle is a right angle.
15
+ *
16
+ * A `units: 'bounds'` gradient is not such a frame: `x` and `y` are
17
+ * fractions of two different lengths, so a circle there is an ellipse on
18
+ * screen and polar math silently mixes scales. Resolve it first with
19
+ * `fillInPoseFrame(fill, box)` and convert edits back with
20
+ * `fillToBoundsFrame(next, box)`.
21
+ */
22
+ value: GradientFill;
23
+ /**
24
+ * Gradient space → overlay pixels. For a `units: 'local'` gradient this
25
+ * is the node's local-to-screen transform; for `'world'`, the view.
26
+ */
27
+ toScreen: (p: Point) => Point;
28
+ /** Overlay pixels → gradient space. Must invert `toScreen`. */
29
+ toLocal: (p: Point) => Point;
30
+ /** Live during a drag — wire for preview, do not write to history. */
31
+ onInput?: (next: GradientFill) => void;
32
+ /** Committed at drag end: one call per gesture. */
33
+ onChange: (next: GradientFill) => void;
34
+ /** Overlay size in CSS pixels. */
35
+ width: number;
36
+ height: number;
37
+ className?: string;
38
+ }
39
+ /**
40
+ * Direct-manipulation handles for a gradient's geometry, drawn as an SVG
41
+ * overlay above a canvas: endpoints for linear, center and radius for
42
+ * radial, center and angle arm for conic.
43
+ *
44
+ * Positioning is entirely the consumer's `toScreen` / `toLocal` — this
45
+ * component never sees a view or a scene node, so the same handles serve a
46
+ * node-local gradient, a world-space one, and a plain unzoomed preview.
47
+ *
48
+ * The overlay ignores pointer events except on the handles themselves, so
49
+ * it can sit over live canvas content without swallowing tool input.
50
+ */
51
+ export declare function GradientHandles(props: GradientHandlesProps): ReactElement;
52
+ export {};
53
+ //# sourceMappingURL=GradientHandles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GradientHandles.d.ts","sourceRoot":"","sources":["../../../src/components/GradientEditor/GradientHandles.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,YAAY,EAAkB,MAAM,OAAO,CAAC;AAClE,OAAO,EAAmC,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGrF;;yDAEyD;AACzD,UAAU,KAAK;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;;;OAUG;IACH,KAAK,EAAE,YAAY,CAAC;IACpB;;;OAGG;IACH,QAAQ,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,KAAK,CAAC;IAC9B,+DAA+D;IAC/D,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,KAAK,CAAC;IAC7B,sEAAsE;IACtE,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACvC,mDAAmD;IACnD,QAAQ,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACvC,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,CAYzE"}
@@ -0,0 +1,3 @@
1
+ export { GradientEditor, type GradientEditorProps } from './GradientEditor';
2
+ export { GradientHandles, type GradientHandlesProps } from './GradientHandles';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/GradientEditor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { n as e, t } from "../../chunks/GradientEditor-Co9aGyRe.js";
2
+ export { e as GradientEditor, t as GradientHandles };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../chunks/Input-D_Xzgr2b.js";
1
+ import { t as e } from "../../chunks/Input-qk44ESKC.js";
2
2
  export { e as Input };
@@ -1,3 +1,3 @@
1
- import { a as e, i as t, n, o as r, r as i, t as a } from "../../chunks/Keycaps-B9dJMYx_.js";
1
+ import { a as e, i as t, n, o as r, r as i, t as a } from "../../chunks/Keycaps-CFX7UAj8.js";
2
2
  import { t as o } from "../../chunks/keyGlyph-BDH5fqkO.js";
3
3
  export { e as KeyCap, t as KeySequence, a as detectPlatform, r as inferKeycapKind, o as keyGlyph, n as keySpecFromKey, i as keySpecsFromMods };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../chunks/NumberField-BQmELz32.js";
1
+ import { t as e } from "../../chunks/NumberField-CYhQeWoM.js";
2
2
  export { e as NumberField };
@@ -1,3 +1,3 @@
1
- import { n as e } from "../../chunks/Badge-DU8ihE7Z.js";
2
- import { t } from "../../chunks/Powerline-C8rddbbK.js";
1
+ import { n as e } from "../../chunks/Badge-DZQqAV4d.js";
2
+ import { t } from "../../chunks/Powerline-Bg9M5oBK.js";
3
3
  export { e as EDGE_PROFILES, t as Powerline };
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, n, r, t as i } from "../../chunks/Prefs-BkDJ5Cdz.js";
1
+ import { a as e, i as t, n, r, t as i } from "../../chunks/Prefs-DZjXp2Ln.js";
2
2
  export { i as PrefsDialog, n as PrefsForm, r as isPrefLeaf, t as prefValueAtPath, e as visiblePrefSubtree };
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "../../chunks/RadioGroup-Ci-I9NEx.js";
1
+ import { n as e, t } from "../../chunks/RadioGroup-rL2i3afr.js";
2
2
  export { t as Radio, e as RadioGroup };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../chunks/RangeSlider-CW-edtNx.js";
1
+ import { t as e } from "../../chunks/RangeSlider-DPldYd4O.js";
2
2
  export { e as RangeSlider };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../chunks/ResizeHandle-C2OBMqTs.js";
1
+ import { t as e } from "../../chunks/ResizeHandle-DR8X229y.js";
2
2
  export { e as ResizeHandle };
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "../../chunks/Select-CLyBisCS.js";
1
+ import { n as e, t } from "../../chunks/Select-vSeAbspK.js";
2
2
  export { t as Select, e as SelectItem };
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../../chunks/SelectionPanel-DBdhAKIK.js";
1
+ import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../../chunks/SelectionPanel-1mmALQba.js";
2
2
  export { r as MIXED, s as SelectionPanel, a as aggregateValue, n as classifyKind, e as effectiveSections, i as kindBreakdown, o as nodeValueAt, t as setAtPath };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../chunks/Sidebar-doLqiTZH.js";
1
+ import { t as e } from "../../chunks/Sidebar-CigrFvpL.js";
2
2
  export { e as Sidebar };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../chunks/SidebarPanel-DjTfOzB9.js";
1
+ import { t as e } from "../../chunks/SidebarPanel-C0w16BrF.js";
2
2
  export { e as SidebarPanel };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../chunks/Slider-sUJGgmKR.js";
1
+ import { t as e } from "../../chunks/Slider-Di2kNqVy.js";
2
2
  export { e as Slider };
@@ -1,2 +1,2 @@
1
- import { n as e, r as t, t as n } from "../../chunks/StatusBar-OOjfqCD8.js";
1
+ import { n as e, r as t, t as n } from "../../chunks/StatusBar-lt_Ok6WK.js";
2
2
  export { n as StatusBar, e as StatusBarItem, t as StatusBarSpacer };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../chunks/Switch-DxJLMYki.js";
1
+ import { t as e } from "../../chunks/Switch-BYj762hm.js";
2
2
  export { e as Switch };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../chunks/ToolButton-Dv6NdZKh.js";
1
+ import { t as e } from "../../chunks/ToolButton-5L1sAlJC.js";
2
2
  export { e as ToolButton };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../chunks/ToolOptionsBar-ChiL-HVA.js";
1
+ import { t as e } from "../../chunks/ToolOptionsBar-D4xmXa_a.js";
2
2
  export { e as ToolOptionsBar };
@@ -1 +1 @@
1
- {"version":3,"file":"ToolPalette.d.ts","sourceRoot":"","sources":["../../../src/components/ToolPalette/ToolPalette.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAW,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAInE,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AA8CtE,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,QAAQ,CAAC;IAChB,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;kEAE8D;IAC9D,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,aAAa,GAAG,SAAS,CAAC;IAC/D;;;;;OAKG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAgGlD"}
1
+ {"version":3,"file":"ToolPalette.d.ts","sourceRoot":"","sources":["../../../src/components/ToolPalette/ToolPalette.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAW,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAwB,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAI3E,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AA8CtE,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,QAAQ,CAAC;IAChB,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;kEAE8D;IAC9D,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,aAAa,GAAG,SAAS,CAAC;IAC/D;;;;;OAKG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAgGlD"}
@@ -1,2 +1,2 @@
1
- import { n as e, r as t, t as n } from "../../chunks/ToolPalette-DXVIEO0w.js";
1
+ import { n as e, r as t, t as n } from "../../chunks/ToolPalette-BDkvV3pJ.js";
2
2
  export { n as ToolPalette, e as formatShortcut, t as formatShortcutParts };
package/dist/index.d.ts CHANGED
@@ -37,6 +37,7 @@ export * from './components/Plot2D';
37
37
  export * from './components/CurveEditor';
38
38
  export * from './components/PointPlotter';
39
39
  export * from './components/ColorField';
40
+ export * from './components/GradientEditor';
40
41
  export { paintGradientTrack } from './paintGradientTrack';
41
42
  export type { GradientTrackOpts } from './paintGradientTrack';
42
43
  export { oklchToHex, chromaAt } from './color/oklch';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACrD,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC3D,YAAY,EACV,aAAa,EACb,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACrD,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC3D,YAAY,EACV,aAAa,EACb,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -1,84 +1,50 @@
1
1
  import { a as e, i as t, n, r, t as i } from "./chunks/Plot2D-CEnhzodm.js";
2
2
  import { n as a, t as o } from "./chunks/Tooltip-Clgn4trm.js";
3
- import { t as s } from "./chunks/ActionBar-CiKvEvXi.js";
4
- import { n as c, t as l } from "./chunks/Badge-DU8ihE7Z.js";
3
+ import { t as s } from "./chunks/ActionBar-GThu74LC.js";
4
+ import { n as c, t as ee } from "./chunks/Badge-DZQqAV4d.js";
5
5
  import "./components/Badge/index.js";
6
- import { t as ee } from "./chunks/Button-9QNIYugK.js";
7
- import { n as te, t as u } from "./chunks/DataGrid-mUq38k0Q.js";
8
- import { a as d, i as f, n as p, o as m, r as h, t as g } from "./chunks/Keycaps-B9dJMYx_.js";
9
- import { t as _ } from "./chunks/keyGlyph-BDH5fqkO.js";
10
- import { n as v, r as y, t as b } from "./chunks/Slider-sUJGgmKR.js";
11
- import { t as x } from "./chunks/ToggleBar-Defj6Asn.js";
12
- import { t as S } from "./chunks/OptionsBar-CHOP_CiW.js";
13
- import { t as C } from "./chunks/ActionsBar-CzU6Of3B.js";
14
- import { t as w } from "./chunks/ToolOptionsBar-ChiL-HVA.js";
15
- import { t as T } from "./chunks/Powerline-C8rddbbK.js";
16
- import { t as E } from "./chunks/Checkbox-CtK8H_OQ.js";
17
- import { t as D } from "./chunks/ColorField-sGLnThpB.js";
18
- import { n as O, t as k } from "./chunks/Field-BHSu2F3E.js";
19
- import { t as A } from "./chunks/Input-D_Xzgr2b.js";
20
- import { t as j } from "./chunks/NumberField-BQmELz32.js";
21
- import { n as M, t as N } from "./chunks/RadioGroup-Ci-I9NEx.js";
22
- import { t as P } from "./chunks/RangeSlider-CW-edtNx.js";
23
- import { n as F, t as I } from "./chunks/Select-CLyBisCS.js";
24
- import { t as L } from "./chunks/Switch-DxJLMYki.js";
25
- import { a as R, i as z, n as B, r as V, t as H } from "./chunks/Prefs-BkDJ5Cdz.js";
26
- import { t as U } from "./chunks/Dialog-CQymDCAl.js";
27
- import { a as W, c as G, i as K, n as q, o as J, r as Y, s as X, t as Z } from "./chunks/SelectionPanel-DBdhAKIK.js";
28
- import { t as Q } from "./chunks/ResizeHandle-C2OBMqTs.js";
29
- import { t as ne } from "./chunks/Sidebar-doLqiTZH.js";
30
- import { t as re } from "./chunks/SidebarPanel-DjTfOzB9.js";
31
- import { n as ie, r as ae, t as oe } from "./chunks/StatusBar-OOjfqCD8.js";
32
- import { t as se } from "./chunks/ToolButton-Dv6NdZKh.js";
6
+ import { t as l } from "./chunks/Button-9QNIYugK.js";
7
+ import { n as u, t as d } from "./chunks/DataGrid-BQklXGRl.js";
8
+ import { a as f, i as p, n as m, o as h, r as g, t as _ } from "./chunks/Keycaps-CFX7UAj8.js";
9
+ import { t as v } from "./chunks/keyGlyph-BDH5fqkO.js";
10
+ import { n as y, r as b, t as x } from "./chunks/Slider-Di2kNqVy.js";
11
+ import { t as S } from "./chunks/ToggleBar-Defj6Asn.js";
12
+ import { t as C } from "./chunks/OptionsBar-CHOP_CiW.js";
13
+ import { t as w } from "./chunks/ActionsBar-CzU6Of3B.js";
14
+ import { t as T } from "./chunks/ToolOptionsBar-D4xmXa_a.js";
15
+ import { t as E } from "./chunks/Powerline-Bg9M5oBK.js";
16
+ import { t as D } from "./chunks/Checkbox-Cf6YHVWV.js";
17
+ import { t as O } from "./chunks/ColorField-sGLnThpB.js";
18
+ import { n as k, t as A } from "./chunks/Field-BHSu2F3E.js";
19
+ import { t as j } from "./chunks/Input-qk44ESKC.js";
20
+ import { t as M } from "./chunks/NumberField-CYhQeWoM.js";
21
+ import { n as N, t as P } from "./chunks/RadioGroup-rL2i3afr.js";
22
+ import { t as F } from "./chunks/RangeSlider-DPldYd4O.js";
23
+ import { n as I, t as L } from "./chunks/Select-vSeAbspK.js";
24
+ import { t as R } from "./chunks/Switch-BYj762hm.js";
25
+ import { a as z, i as B, n as V, r as H, t as U } from "./chunks/Prefs-DZjXp2Ln.js";
26
+ import { t as W } from "./chunks/Dialog-CQymDCAl.js";
27
+ import { a as G, c as K, i as q, n as J, o as Y, r as X, s as Z, t as Q } from "./chunks/SelectionPanel-1mmALQba.js";
28
+ import { t as te } from "./chunks/ResizeHandle-DR8X229y.js";
29
+ import { t as ne } from "./chunks/Sidebar-CigrFvpL.js";
30
+ import { t as re } from "./chunks/SidebarPanel-C0w16BrF.js";
31
+ import { n as ie, r as ae, t as oe } from "./chunks/StatusBar-lt_Ok6WK.js";
32
+ import { t as se } from "./chunks/ToolButton-5L1sAlJC.js";
33
33
  import { t as ce } from "./chunks/ToolGroup-BAthcF5H.js";
34
- import { n as le, r as ue, t as de } from "./chunks/ToolPalette-DXVIEO0w.js";
34
+ import { n as le, r as ue, t as de } from "./chunks/ToolPalette-BDkvV3pJ.js";
35
35
  import "./components/Field/index.js";
36
36
  import { i as fe, n as pe, r as me, t as he } from "./chunks/Tabs-DOW5jtnq.js";
37
- import { n as ge, t as _e } from "./chunks/ComboBox-CotoRgNi.js";
37
+ import { n as ge, t as _e } from "./chunks/ComboBox-EnV1IytN.js";
38
38
  import { n as ve, t as ye } from "./chunks/Callout-CxxrEcSb.js";
39
39
  import { a as be, i as xe, n as Se, r as Ce, t as we } from "./chunks/Toast-DLM2AsTz.js";
40
40
  import { a as Te, i as Ee, n as De, o as $, r as Oe, t as ke } from "./chunks/CurveEditor-DAb2EMyR.js";
41
41
  import { t as Ae } from "./chunks/PointPlotter-EkbCBK9j.js";
42
- import { oklabToSrgbU8 as je, oklchToOklab as Me, rgbaToHex as Ne } from "@weasel-js/core";
43
- import { jsx as Pe } from "react/jsx-runtime";
44
- //#region src/paintGradientTrack.tsx
45
- var Fe = {
46
- angleDeg: 135,
47
- stripe: 2,
48
- gap: 4,
49
- dim: 75
50
- };
51
- function Ie(e) {
52
- let { gradient: t, samples: n = 16, activeRange: r, hatch: i } = e;
53
- return (e) => {
54
- let a = [];
55
- for (let e = 0; e <= n; e++) {
56
- let r = e / n;
57
- a.push(`${t(r)} ${(r * 100).toFixed(1)}%`);
58
- }
59
- let o = `linear-gradient(to right, ${a.join(", ")})`, s = [];
60
- if (r) {
61
- let t = e.valueToFraction(r[0]) * 100, n = e.valueToFraction(r[1]) * 100, a = {
62
- ...Fe,
63
- ...i
64
- }, o = `repeating-linear-gradient(${a.angleDeg}deg, transparent 0 ${a.stripe}px, var(--wzl-panel-bg, #fafbfc) ${a.stripe}px ${a.stripe + a.gap}px)`, c = `color-mix(in srgb, var(--wzl-panel-bg, #fafbfc) ${a.dim}%, transparent)`, l = `linear-gradient(${c}, ${c})`;
65
- if (t > 0 && (s.push(`${l} left 0 / ${t.toFixed(2)}% 100% no-repeat`), s.push(`${o} left 0 / ${t.toFixed(2)}% 100% no-repeat`)), n < 100) {
66
- let e = (100 - n).toFixed(2);
67
- s.push(`${l} right 0 / ${e}% 100% no-repeat`), s.push(`${o} right 0 / ${e}% 100% no-repeat`);
68
- }
69
- }
70
- return s.push(o), /* @__PURE__ */ Pe("div", { style: {
71
- position: "absolute",
72
- inset: 0,
73
- background: s.join(", ")
74
- } });
75
- };
76
- }
77
- //#endregion
42
+ import { n as je, r as Me, t as Ne } from "./chunks/GradientEditor-Co9aGyRe.js";
43
+ import { oklabToSrgbU8 as Pe, oklchToOklab as Fe, rgbaToHex as Ie } from "@weasel-js/core";
78
44
  //#region src/color/oklch.ts
79
45
  function Le(e, t, n) {
80
- let [r, i, a] = Me(e, t, n * Math.PI / 180), [o, s, c] = je(r, i, a);
81
- return Ne([
46
+ let [r, i, a] = Fe(e, t, n * Math.PI / 180), [o, s, c] = Pe(r, i, a);
47
+ return Ie([
82
48
  o / 255,
83
49
  s / 255,
84
50
  c / 255
@@ -89,6 +55,6 @@ function Re(e, t) {
89
55
  return e <= n ? t.cBot : e >= r ? t.cTop : e <= t.midL ? t.cBot + (t.cPeak - t.cBot) * ((e - n) / (t.midL - n)) : t.cPeak + (t.cTop - t.cPeak) * ((e - t.midL) / (r - t.midL));
90
56
  }
91
57
  //#endregion
92
- export { s as ActionBar, C as ActionsBar, l as Badge, ee as Button, ye as Callout, ve as CalloutTrigger, E as Checkbox, D as ColorField, _e as ComboBox, ge as ComboBoxItem, De as CurveEditor, u as DataGrid, U as Dialog, c as EDGE_PROFILES, k as Field, A as Input, d as KeyCap, f as KeySequence, Oe as LayeredCurveEditor, v as MINUS_SIGN, q as MIXED, j as NumberField, S as OptionsBar, i as Plot2D, Ae as PointPlotter, T as Powerline, H as PrefsDialog, B as PrefsForm, N as Radio, M as RadioGroup, P as RangeSlider, Q as ResizeHandle, I as Select, F as SelectItem, Z as SelectionPanel, ne as Sidebar, re as SidebarPanel, b as Slider, oe as StatusBar, ie as StatusBarItem, ae as StatusBarSpacer, L as Switch, he as Tab, pe as TabList, me as TabPanel, fe as Tabs, Se as ToastQueue, we as ToastRegion, x as ToggleBar, se as ToolButton, ce as ToolGroup, w as ToolOptionsBar, de as ToolPalette, o as Tooltip, a as TooltipTrigger, Y as aggregateValue, Re as chromaAt, K as classifyKind, Ee as createFunctionLayer, ke as createSetCurveOp, Ce as createToastQueue, xe as defaultToastQueue, g as detectPlatform, t as dlog, W as effectiveSections, O as fieldClasses, y as formatNumber, le as formatShortcut, ue as formatShortcutParts, Te as functionLayerState, m as inferKeycapKind, e as isDebugEnabled, V as isPrefLeaf, _ as keyGlyph, p as keySpecFromKey, h as keySpecsFromMods, J as kindBreakdown, n as modelToPlot, X as nodeValueAt, Le as oklchToHex, Ie as paintGradientTrack, r as plotToModel, z as prefValueAtPath, $ as sampleByInterpolation, G as setAtPath, be as toast, te as useReorderDragList, R as visiblePrefSubtree };
58
+ export { s as ActionBar, w as ActionsBar, ee as Badge, l as Button, ye as Callout, ve as CalloutTrigger, D as Checkbox, O as ColorField, _e as ComboBox, ge as ComboBoxItem, De as CurveEditor, d as DataGrid, W as Dialog, c as EDGE_PROFILES, A as Field, je as GradientEditor, Ne as GradientHandles, j as Input, f as KeyCap, p as KeySequence, Oe as LayeredCurveEditor, y as MINUS_SIGN, J as MIXED, M as NumberField, C as OptionsBar, i as Plot2D, Ae as PointPlotter, E as Powerline, U as PrefsDialog, V as PrefsForm, P as Radio, N as RadioGroup, F as RangeSlider, te as ResizeHandle, L as Select, I as SelectItem, Q as SelectionPanel, ne as Sidebar, re as SidebarPanel, x as Slider, oe as StatusBar, ie as StatusBarItem, ae as StatusBarSpacer, R as Switch, he as Tab, pe as TabList, me as TabPanel, fe as Tabs, Se as ToastQueue, we as ToastRegion, S as ToggleBar, se as ToolButton, ce as ToolGroup, T as ToolOptionsBar, de as ToolPalette, o as Tooltip, a as TooltipTrigger, X as aggregateValue, Re as chromaAt, q as classifyKind, Ee as createFunctionLayer, ke as createSetCurveOp, Ce as createToastQueue, xe as defaultToastQueue, _ as detectPlatform, t as dlog, G as effectiveSections, k as fieldClasses, b as formatNumber, le as formatShortcut, ue as formatShortcutParts, Te as functionLayerState, h as inferKeycapKind, e as isDebugEnabled, H as isPrefLeaf, v as keyGlyph, m as keySpecFromKey, g as keySpecsFromMods, Y as kindBreakdown, n as modelToPlot, Z as nodeValueAt, Le as oklchToHex, Me as paintGradientTrack, r as plotToModel, B as prefValueAtPath, $ as sampleByInterpolation, K as setAtPath, be as toast, u as useReorderDragList, z as visiblePrefSubtree };
93
59
 
94
60
  //# sourceMappingURL=index.js.map