efficient-easel 27.2.0 → 27.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.
Files changed (97) hide show
  1. package/dist/{AddSidePanel-DoCx-ZrM.d.ts → AddSidePanel-DwfZOS5C.d.ts} +11 -3
  2. package/dist/blocks/index.d.ts +1 -1
  3. package/dist/{canvas-typing-CD1aeYnk.d.ts → canvas-typing-B33ssbpU.d.ts} +22 -3
  4. package/dist/chunk-2DFSODES.js +1 -0
  5. package/dist/{chunk-I4Z75MCX.js → chunk-2ODVRWRM.js} +1 -1
  6. package/dist/{chunk-SR2535CN.js → chunk-36AWYQLN.js} +17 -17
  7. package/dist/{chunk-JI7GUM3C.js → chunk-4JPAVKV6.js} +1 -1
  8. package/dist/{chunk-ZSP4ZAQ2.js → chunk-7WONGRN3.js} +40 -40
  9. package/dist/chunk-AI5IQV4A.js +2 -0
  10. package/dist/chunk-BDYS3UAD.js +5 -0
  11. package/dist/{chunk-3RGHXL5V.js → chunk-DFLPDOZF.js} +1 -1
  12. package/dist/chunk-IHYRYSP2.js +7 -0
  13. package/dist/chunk-JEKFHCKS.js +8 -0
  14. package/dist/{chunk-XGTO4LHI.js → chunk-JNNBGI6Y.js} +1 -1
  15. package/dist/chunk-KRONK73U.js +1 -0
  16. package/dist/{chunk-HGTDDSFJ.js → chunk-NMLAW6FI.js} +17 -17
  17. package/dist/chunk-OHHODU7N.js +26 -0
  18. package/dist/{chunk-MMHYTIUY.js → chunk-PMDIDRDB.js} +4 -4
  19. package/dist/{chunk-DQSRGKSM.js → chunk-SEC6NV6Y.js} +4 -4
  20. package/dist/{chunk-2Y4CAWZQ.js → chunk-TWXA55SR.js} +3 -3
  21. package/dist/chunk-WW24O7HT.js +1 -0
  22. package/dist/chunk-XT75WETI.js +1 -0
  23. package/dist/copy/index.d.ts +3 -3
  24. package/dist/copy/index.js +29 -29
  25. package/dist/data/index.d.ts +1 -1
  26. package/dist/drag/index.js +1 -1
  27. package/dist/easel/index.d.ts +10 -2
  28. package/dist/easel/index.js +1 -1
  29. package/dist/fields/index.d.ts +1 -1
  30. package/dist/fields/index.js +1 -1
  31. package/dist/panel/index.d.ts +5 -0
  32. package/dist/panel/index.js +1 -1
  33. package/dist/{phone-order-CRKvsTsz.d.ts → phone-order-BCM_f8A1.d.ts} +7 -1
  34. package/dist/screen/components/AddBlockRow.js +1 -1
  35. package/dist/screen/components/AddSidePanel.d.ts +2 -2
  36. package/dist/screen/components/AddSidePanel.js +1 -1
  37. package/dist/screen/components/NodeContextMenu.d.ts +2 -2
  38. package/dist/screen/components/NodeContextMenu.js +1 -1
  39. package/dist/screen/components/SaveControls.d.ts +2 -2
  40. package/dist/screen/components/ScreenChrome.js +1 -1
  41. package/dist/screen/components/ScreenDocumentContext.d.ts +1 -1
  42. package/dist/screen/components/ScreenMount.d.ts +2 -2
  43. package/dist/screen/components/ScreenMount.js +1 -1
  44. package/dist/screen/components/ScreenStoreProvider.d.ts +2 -2
  45. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  46. package/dist/screen/components/SectionScreenShell.js +16 -16
  47. package/dist/screen/components/usePartBridge.d.ts +2 -2
  48. package/dist/screen/components/usePartBridge.js +1 -1
  49. package/dist/screen/index.d.ts +2 -2
  50. package/dist/screen/index.js +1 -1
  51. package/dist/screen/lib/admin-bridge.d.ts +1 -1
  52. package/dist/screen/lib/document/add-target-types.d.ts +2 -2
  53. package/dist/screen/lib/document/block-set-host.js +1 -1
  54. package/dist/screen/lib/document/block-size-fields.d.ts +1 -1
  55. package/dist/screen/lib/document/block-size-fields.js +1 -1
  56. package/dist/screen/lib/document/box-fields.d.ts +1 -1
  57. package/dist/screen/lib/document/box-fields.js +1 -1
  58. package/dist/screen/lib/document/button-fields.d.ts +1 -1
  59. package/dist/screen/lib/document/button-fields.js +1 -1
  60. package/dist/screen/lib/document/image-fields.d.ts +1 -1
  61. package/dist/screen/lib/document/image-fields.js +4 -4
  62. package/dist/screen/lib/document/new-child.d.ts +2 -2
  63. package/dist/screen/lib/document/palette-sections.d.ts +2 -2
  64. package/dist/screen/lib/document/section-doc.d.ts +1 -1
  65. package/dist/screen/lib/document/shadow-fields.d.ts +1 -1
  66. package/dist/screen/lib/document/shadow-fields.js +2 -2
  67. package/dist/screen/lib/document/slot-section-spec.d.ts +2 -2
  68. package/dist/screen/lib/document/style-clipboard.d.ts +2 -2
  69. package/dist/screen/lib/document/style-clipboard.js +1 -1
  70. package/dist/screen/lib/document/style-fields.d.ts +1 -1
  71. package/dist/screen/lib/document/style-fields.js +1 -1
  72. package/dist/screen/lib/document/use-section-ops.d.ts +37 -3
  73. package/dist/screen/lib/document/use-section-ops.js +1 -1
  74. package/dist/screen/lib/document-addressing.d.ts +1 -1
  75. package/dist/screen/lib/document-hooks.d.ts +1 -1
  76. package/dist/screen/lib/host.d.ts +1 -1
  77. package/dist/screen/lib/key-scope.js +1 -1
  78. package/dist/screen/lib/media-panel.d.ts +1 -1
  79. package/dist/screen/lib/media-picker.d.ts +1 -1
  80. package/dist/screen/lib/page-lock.d.ts +1 -1
  81. package/dist/screen/lib/screen-parts.d.ts +2 -2
  82. package/dist/screen/lib/screen-parts.js +1 -1
  83. package/dist/screen/lib/section-templates.d.ts +1 -1
  84. package/dist/screen/lib/session-context.d.ts +1 -1
  85. package/dist/screen/lib/session.d.ts +1 -1
  86. package/dist/screen/lib/shared-sections.d.ts +1 -1
  87. package/dist/text-styles/index.js +11 -11
  88. package/package.json +4 -4
  89. package/dist/chunk-D4TH4QQR.js +0 -2
  90. package/dist/chunk-DCBUJ36Q.js +0 -5
  91. package/dist/chunk-LK56FUFT.js +0 -1
  92. package/dist/chunk-M5UCPD66.js +0 -1
  93. package/dist/chunk-MNQDOSAX.js +0 -7
  94. package/dist/chunk-OSF2H3LO.js +0 -1
  95. package/dist/chunk-PTTQWCD7.js +0 -1
  96. package/dist/chunk-SDSBXW3V.js +0 -26
  97. package/dist/chunk-YCYGY54I.js +0 -8
@@ -474,6 +474,12 @@ interface ScreenLeftView {
474
474
  * does.
475
475
  */
476
476
  type ScreenRailItem = ScreenLeftView | EaselRailItem;
477
+ /** How a full node goes in (`ScreenDocumentOps.insertNode`, `SectionOps.insertNode`). */
478
+ interface InsertNodeOptions {
479
+ /** The node holds SAVED answers (a saved section template, a stored section
480
+ * rebuilt): resolved with trigger `"copy"`, so an emptied slot stays empty. */
481
+ copy?: boolean;
482
+ }
477
483
  /**
478
484
  * The screen's own writes of the document, as far as a layer's pass over a
479
485
  * document needs them. They are the writes every surface of the screen makes
@@ -493,8 +499,10 @@ interface ScreenDocumentOps {
493
499
  * returns the id it was given. */
494
500
  insertSection: (type: string, index: number) => string;
495
501
  /** Insert a FULL node — its type and its props, slot children inline — into
496
- * the list `zone` names; returns the id it was given. */
497
- insertNode: (zone: string, index: number, node: ScreenNode) => string;
502
+ * the list `zone` names; returns the id it was given. `{ copy: true }` for
503
+ * a node that holds SAVED answers (a stored section rebuilt, a saved
504
+ * template): it is resolved as `"copy"`, not `"insert"` (use-section-ops). */
505
+ insertNode: (zone: string, index: number, node: ScreenNode, options?: InsertNodeOptions) => string;
498
506
  /** Write the node at a place back, whole. */
499
507
  replaceComponent: (zone: string, index: number, node: ScreenNode) => void;
500
508
  }
@@ -1991,4 +1999,4 @@ type AddSidePanelProps<I> = {
1991
1999
  };
1992
2000
  declare function AddSidePanel<I>({ at, placeBlocks, placeNames, canTake, onPick, itemFor, session, siteWide, onClose, onHide, readOnly, }: AddSidePanelProps<I>): react.JSX.Element;
1993
2001
 
1994
- export { isSelectionMode as $, type ScreenNodeActions as A, type ScreenNodeAt as B, type CopyItemAction as C, type ScreenNodeLevel as D, type ScreenNodeMaker as E, type ScreenPartMode as F, type ScreenParts as G, ScreenPartsProvider as H, type ScreenPinnedBand as I, type ScreenPinnedNodes as J, type ScreenRailItem as K, type ScreenSelector as L, type ScreenSharedSections as M, type NodeDefaults as N, type ScreenSlot as O, type ScreenSlotAction as P, type ScreenSlotMode as Q, type ScreenStyleClipboard as R, SELECTION_MODE as S, type ScreenStyleDocument as T, type ScreenStylePastePlan as U, type ScreenToastExtra as V, type ScreenTree as W, type ScreenTreeFolds as X, type ScreenTreeRows as Y, isPinnedFirst as Z, isPinnedLast as _, type CopyItemRequest as a, isSlotMode as a0, sameInspectorMode as a1, screenSlotsOf as a2, shownChildSlotsOf as a3, shownSlotFieldsOf as a4, useScreenBlockLook as a5, useScreenBlockRules as a6, useScreenBridges as a7, useScreenCanvasDrag as a8, useScreenCanvasFrame as a9, matchesQuery as aA, paletteWithoutPinned as aB, pinnedSection as aC, type AddKey as aD, type AddSidePanelProps as aE, blockKey as aF, AddSidePanel as aG, presetKey as aH, sectionKey as aI, sharedKey as aJ, templateKey as aK, useScreenCanvasHead as aa, useScreenCanvasTarget as ab, useScreenDevices as ac, useScreenDocumentLabel as ad, useScreenDocumentPass as ae, useScreenInspectorPanel as af, useScreenLeftView as ag, useScreenNodeKeys as ah, useScreenNotify as ai, useScreenOwnerName as aj, useScreenParts as ak, useScreenPickFollowsSelection as al, useScreenPinned as am, useScreenSaveSwitch as an, useScreenStorageNamespace as ao, useScreenStyleClipboard as ap, useStandaloneScreenBridges as aq, type SlotSectionSpec as ar, type NodeDefaults$1 as as, type AddTarget as at, type AddTargetSource as au, type PaletteLook as av, type PalettePreset as aw, type PaletteSection as ax, buildPaletteSections as ay, categoryLabel as az, type ScreenBlockLook as b, type ScreenBlockRules as c, type ScreenBridges as d, type ScreenCanvas as e, type ScreenCanvasDrag as f, type ScreenCanvasDragContext as g, type ScreenCanvasHeadProps as h, ScreenCanvasTargetProvider as i, type ScreenDevices as j, type ScreenDocumentOps as k, type ScreenDragItem as l, type ScreenInspector as m, type ScreenInspectorMode as n, type ScreenInspectorPanelProps as o, type ScreenLeftPanel as p, type ScreenLeftView as q, type ScreenLeftViewFrame as r, type ScreenLeftViewRules as s, type ScreenMainAction as t, type ScreenMediaDrop as u, type ScreenMediaFile as v, type ScreenMenuItem as w, type ScreenMenuRows as x, type ScreenNewNode as y, type ScreenNode as z };
2002
+ export { isPinnedLast as $, type ScreenNodeActions as A, type ScreenNodeAt as B, type CopyItemAction as C, type ScreenNodeLevel as D, type ScreenNodeMaker as E, type ScreenPartMode as F, type ScreenParts as G, ScreenPartsProvider as H, type InsertNodeOptions as I, type ScreenPinnedBand as J, type ScreenPinnedNodes as K, type ScreenRailItem as L, type ScreenSelector as M, type NodeDefaults as N, type ScreenSharedSections as O, type ScreenSlot as P, type ScreenSlotAction as Q, type ScreenSlotMode as R, SELECTION_MODE as S, type ScreenStyleClipboard as T, type ScreenStyleDocument as U, type ScreenStylePastePlan as V, type ScreenToastExtra as W, type ScreenTree as X, type ScreenTreeFolds as Y, type ScreenTreeRows as Z, isPinnedFirst as _, type CopyItemRequest as a, isSelectionMode as a0, isSlotMode as a1, sameInspectorMode as a2, screenSlotsOf as a3, shownChildSlotsOf as a4, shownSlotFieldsOf as a5, useScreenBlockLook as a6, useScreenBlockRules as a7, useScreenBridges as a8, useScreenCanvasDrag as a9, categoryLabel as aA, matchesQuery as aB, paletteWithoutPinned as aC, pinnedSection as aD, type AddKey as aE, type AddSidePanelProps as aF, blockKey as aG, AddSidePanel as aH, presetKey as aI, sectionKey as aJ, sharedKey as aK, templateKey as aL, useScreenCanvasFrame as aa, useScreenCanvasHead as ab, useScreenCanvasTarget as ac, useScreenDevices as ad, useScreenDocumentLabel as ae, useScreenDocumentPass as af, useScreenInspectorPanel as ag, useScreenLeftView as ah, useScreenNodeKeys as ai, useScreenNotify as aj, useScreenOwnerName as ak, useScreenParts as al, useScreenPickFollowsSelection as am, useScreenPinned as an, useScreenSaveSwitch as ao, useScreenStorageNamespace as ap, useScreenStyleClipboard as aq, useStandaloneScreenBridges as ar, type SlotSectionSpec as as, type NodeDefaults$1 as at, type AddTarget as au, type AddTargetSource as av, type PaletteLook as aw, type PalettePreset as ax, type PaletteSection as ay, buildPaletteSections as az, type ScreenBlockLook as b, type ScreenBlockRules as c, type ScreenBridges as d, type ScreenCanvas as e, type ScreenCanvasDrag as f, type ScreenCanvasDragContext as g, type ScreenCanvasHeadProps as h, ScreenCanvasTargetProvider as i, type ScreenDevices as j, type ScreenDocumentOps as k, type ScreenDragItem as l, type ScreenInspector as m, type ScreenInspectorMode as n, type ScreenInspectorPanelProps as o, type ScreenLeftPanel as p, type ScreenLeftView as q, type ScreenLeftViewFrame as r, type ScreenLeftViewRules as s, type ScreenMainAction as t, type ScreenMediaDrop as u, type ScreenMediaFile as v, type ScreenMenuItem as w, type ScreenMenuRows as x, type ScreenNewNode as y, type ScreenNode as z };
@@ -2,7 +2,7 @@ import { ReactElement, FC, CSSProperties, ReactNode, JSX } from 'react';
2
2
  import { P as Permissions, A as AppState } from '../types-BljCVdzR.js';
3
3
  import '../data/index.js';
4
4
  import '../types-Dq180WRV.js';
5
- import '../phone-order-CRKvsTsz.js';
5
+ import '../phone-order-BCM_f8A1.js';
6
6
  import '../plan-D0DgSLnY.js';
7
7
 
8
8
  /**
@@ -51,16 +51,27 @@ interface CopyThemeColor {
51
51
  label: string;
52
52
  value: string;
53
53
  }
54
+ /**
55
+ * The host's map from a STORED colour name to its colour's current name.
56
+ * A host that renamed its theme colours (web-builder: `accent` became `main`)
57
+ * keeps old words as they were saved; the map lets them still find their
58
+ * colour. It is read only: nothing is rewritten until a person picks a colour.
59
+ * Left out, a stored name must match a colour's name exactly. A hex never goes
60
+ * through it.
61
+ */
62
+ type ColorNameOf = (stored: string) => string;
54
63
  /**
55
64
  * The colour the toolbar's A shows for `current` (a theme colour's name or a
56
65
  * hex): the hex itself, or theme colour's value. One rule for every bar
57
66
  * that opens this window — the panel's text box and the canvas typing bar.
58
67
  */
59
- declare function colorRunOf(current: string | null, colors: readonly CopyThemeColor[] | undefined): string | undefined;
60
- declare function ColorWindow({ colors, current, words, onPick, }: {
68
+ declare function colorRunOf(current: string | null, colors: readonly CopyThemeColor[] | undefined, nameOf?: ColorNameOf): string | undefined;
69
+ declare function ColorWindow({ colors, current, nameOf, words, onPick, }: {
61
70
  colors: readonly CopyThemeColor[];
62
71
  /** The colour the selection wears — a theme name or a hex — or null. */
63
72
  current: string | null;
73
+ /** The host's map from a stored name to its colour's name (`ColorNameOf`). */
74
+ nameOf?: ColorNameOf;
64
75
  words: NonNullable<CopyWords['colors']>;
65
76
  /** A theme name, a lowercase `#rrggbb`, or null to take the colour off. */
66
77
  onPick: (color: string | null) => void;
@@ -288,6 +299,14 @@ interface CopyBoxProps {
288
299
  * no colour button, and no blank where it was (Lewis 2026-10-13).
289
300
  */
290
301
  colors?: readonly CopyThemeColor[];
302
+ /**
303
+ * The host's map from a STORED colour name to the name of one of `colors`
304
+ * (`ColorNameOf`), for words saved before the host renamed a colour. Read
305
+ * only: the window lights, the A shows and the box paints the mapped colour,
306
+ * and the value is not rewritten until a person picks one. Left out, a
307
+ * stored name must match exactly.
308
+ */
309
+ colorNameOf?: ColorNameOf;
291
310
  /** The number cells between the toolbar and the box (final toolbar), each
292
311
  * the host's value — see `COPY_CELLS`. None: no cells. */
293
312
  cells?: readonly CopyCell[];
@@ -459,4 +478,4 @@ interface CanvasTypingSession {
459
478
  /** Start typing in the words `element()` drew, or `null` where they are not the string's. */
460
479
  declare function startCanvasTyping(o: CanvasTypingOptions): CanvasTypingSession | null;
461
480
 
462
- export { type CopyBoxLastTool as C, type MarkWriter as M, type SelectionSource as S, type TextBoxHandle as T, type CopyThemeColor as a, type CanvasTypingEnd as b, type CopyBoxProps as c, type CopyCell as d, COPY_CELLS as e, type CanvasTypingOptions as f, type CanvasTypingSession as g, ColorWindow as h, type CopyBoxAlign as i, type CopyBoxFooter as j, type CopyCase as k, type CopyCellPreset as l, CopyCells as m, type TextAreaHandle as n, type TextMap as o, type ToolbarMark as p, colorRunOf as q, insertSelection as r, markSelection as s, startCanvasTyping as t, textMap as u };
481
+ export { type CopyBoxLastTool as C, type MarkWriter as M, type SelectionSource as S, type TextBoxHandle as T, type CopyThemeColor as a, type ColorNameOf as b, type CanvasTypingEnd as c, type CopyBoxProps as d, type CopyCell as e, COPY_CELLS as f, type CanvasTypingOptions as g, type CanvasTypingSession as h, ColorWindow as i, type CopyBoxAlign as j, type CopyBoxFooter as k, type CopyCase as l, type CopyCellPreset as m, CopyCells as n, type TextAreaHandle as o, type TextMap as p, type ToolbarMark as q, colorRunOf as r, insertSelection as s, markSelection as t, startCanvasTyping as u, textMap as v };
@@ -0,0 +1 @@
1
+ import{useSectionOps as o}from"./chunk-KRONK73U.js";import{SELECTION_MODE as e}from"./chunk-BDYS3UAD.js";import{decodePartId as r,encodePartId as t}from"./chunk-R4AUZVA3.js";import{useEasel as n}from"./chunk-NMLAW6FI.js";import{usePreviewParts as p}from"./chunk-467WWV4I.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:a}){const{getSelectorForId:u}=n(o=>o),I=o(),{setSelectedPartId:f,setSelectHandler:k}=p(),l=d(o=>{const t=r(o);if(!t)return;const{nodeId:n,propKey:p}=t;p?(i(o=>s(o)&&o.nodeId===n&&o.propKey===p?o:{kind:"part",nodeId:n,propKey:p}),a?.(n)):i(o=>"part"===o.kind?e:o)},[i,a]);c(()=>{k(l)},[k,l]);const K=s(m)?t(m.nodeId,m.propKey):null;c(()=>{f(K)},[K,f]);return{selectNode:d(o=>{i(()=>e);const r=u(o);r&&I.select(r)},[i,u,I]),openPartId:K}}export{m as usePartBridge};
@@ -1 +1 @@
1
- import{styleFieldBuilders as e,keptByRow as s}from"./chunk-MMHYTIUY.js";import{boxFieldBuilders as o,PHONE_KEY_ACCESS as l,phoneTwinFields as r,section as i}from"./chunk-SR2535CN.js";import{deviceField as t}from"./chunk-ZNLODQD4.js";import{BUTTON_STYLE_KEYS as c,BUTTON_PAD_KEYS as n}from"./chunk-PLTTPHK5.js";import{TextColorIcon as u,GroundIcon as d}from"efficient-shell/icons/efficient";import{jsx as f}from"react/jsx-runtime";function a(a){const p=o(a.say),y=e(a.say),m=c,F=a.style,k=a.phone??l;return{...a.padding&&{_dSize:i("Size"),...p.sidesPaddingFields({keys:n,group:!1,...a.padding})},_dDesign:i("Design"),[m.fill]:y.colourField({key:m.fill,access:F,label:"Fill color",icon:/* @__PURE__ */f(d,{}),useFollows:a.follows.useFill,usePresets:a.usePresets,resetTo:a.resetTo,opacity:{key:m.fillOpacity,useUnset:a.follows.useFillOpacity}}),[m.fillOpacity]:s(m.fill),[m.border]:y.borderField({key:m.border,access:F,useFollows:a.follows.useBorder}),[m.text]:y.colourField({key:m.text,access:F,label:"Text color",icon:/* @__PURE__ */f(u,{}),useFollows:a.follows.useText,usePresets:a.usePresets,resetTo:a.resetTo}),[m.corners]:y.cornersField({key:m.corners,access:F,sidesKey:m.cornerSides,useFollows:a.follows.useCorners,useFollowsSides:a.follows.useCornerSides}),[m.cornerSides]:s(m.corners),_dLayout:i("Layout"),...r("align",p.blockAlignmentField({phone:!0},""),k),align:t("desktop",p.blockAlignmentField())}}export{a as buttonFieldSet};
1
+ import{styleFieldBuilders as e,keptByRow as s}from"./chunk-PMDIDRDB.js";import{boxFieldBuilders as o,PHONE_KEY_ACCESS as l,phoneTwinFields as r,section as i}from"./chunk-36AWYQLN.js";import{deviceField as t}from"./chunk-ZNLODQD4.js";import{BUTTON_STYLE_KEYS as c,BUTTON_PAD_KEYS as n}from"./chunk-PLTTPHK5.js";import{TextColorIcon as u,GroundIcon as d}from"efficient-shell/icons/efficient";import{jsx as f}from"react/jsx-runtime";function a(a){const p=o(a.say),y=e(a.say),m=c,F=a.style,k=a.phone??l;return{...a.padding&&{_dSize:i("Size"),...p.sidesPaddingFields({keys:n,group:!1,...a.padding})},_dDesign:i("Design"),[m.fill]:y.colourField({key:m.fill,access:F,label:"Fill color",icon:/* @__PURE__ */f(d,{}),useFollows:a.follows.useFill,usePresets:a.usePresets,resetTo:a.resetTo,opacity:{key:m.fillOpacity,useUnset:a.follows.useFillOpacity}}),[m.fillOpacity]:s(m.fill),[m.border]:y.borderField({key:m.border,access:F,useFollows:a.follows.useBorder}),[m.text]:y.colourField({key:m.text,access:F,label:"Text color",icon:/* @__PURE__ */f(u,{}),useFollows:a.follows.useText,usePresets:a.usePresets,resetTo:a.resetTo}),[m.corners]:y.cornersField({key:m.corners,access:F,sidesKey:m.cornerSides,useFollows:a.follows.useCorners,useFollowsSides:a.follows.useCornerSides}),[m.cornerSides]:s(m.corners),_dLayout:i("Layout"),...r("align",p.blockAlignmentField({phone:!0},""),k),align:t("desktop",p.blockAlignmentField())}}export{a as buttonFieldSet};
@@ -1,17 +1,17 @@
1
- import{sidesStartEach as e,SidesInput as n,SidesEachToggle as t}from"./chunk-XWTQTANN.js";import{SettingsDefaultReset as l}from"./chunk-2T22IY3J.js";import{deviceField as o}from"./chunk-ZNLODQD4.js";import{noControlField as a,NoControlMark as i}from"./chunk-22I55W37.js";import{describedAs as r}from"./chunk-LX23TCTP.js";import{withStyleKind as s}from"./chunk-3OOYGEJY.js";import{foldMetaOf as u,FOLD_FIELD_MARKER as c}from"./chunk-ANPOR6EY.js";import{useSelectedHost as d,useEasel as p}from"./chunk-HGTDDSFJ.js";import{DEFAULT_PANEL_WORDS as f}from"./chunk-56ID6FKZ.js";import{SettingsSwitch as b}from"./chunk-OECWLNKJ.js";import{phoneKey as m,tabletKey as h,viewFollows as v,isAuto as g}from"./chunk-DIOTWSCO.js";import{FieldSelect as y}from"./chunk-C63IB4VW.js";import{SettingsSegmented as w}from"./chunk-DX3VILZ3.js";import{SettingsField as k}from"./chunk-MIX7EGRG.js";import{useWords as x}from"./chunk-MFIRYGHW.js";import{useState as C}from"react";import{AlignmentIcon as j,BoxJustifyIcon as F,WrapIcon as O,ArrowRightIcon as L,GapIcon as S,WidthIcon as K,PlacementIcon as V,NudgeIcon as E,DesktopIcon as P,BoxXEndIcon as R,BoxXCenterIcon as A,BoxXStartIcon as I,PaddingAllIcon as M,BoxYBetweenIcon as T,BoxYStretchIcon as B,BoxYEndIcon as W,BoxYCenterIcon as N,BoxYStartIcon as $,BoxXBetweenIcon as G,BoxXStretchIcon as D,BoxItemAlignmentIcon as J}from"efficient-shell/icons/efficient";import{textAlignOptions as Y,AlignmentGrid as H,PositionInput as X,Slider as _}from"efficient-shell/ui";import{jsx as z,Fragment as Z,jsxs as Q}from"react/jsx-runtime";var U=e=>e;function q(e,n,t="desktop"){return e("tablet"===t?"{value} on tablet":"{value} on desktop").replace("{value}",n)}var ee=()=>{};function ne(){return null}function te(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");/* @__PURE__ */
2
- return z(ne,{},e)}function le(e){return e.type===ne}function oe(e){return le(e)?void 0:e}function ae(e){for(const[n,t]of Object.entries(e))t&&"object"==typeof t&&!u(t)&&s(t,`section:${n}`);return e}function ie(e,n){return{type:"custom",[c]:{label:e,level:n},marker:!0,fold:e,render:()=>/* @__PURE__ */z(Z,{})}}function re(e){return ie(e,2)}function se(e){return ie(e,1)}var ue=[{label:"Start",value:"start"},{label:"Center",value:"center"},{label:"Space between",value:"between"},{label:"End",value:"end"}],ce=[{label:"Start",value:"start"},{label:"Center",value:"center"},{label:"End",value:"end"},{label:"Stretch",value:"stretch"}],de="Wrap",pe=[{label:"Wrap",value:"wrap"},{label:"No wrap",value:"nowrap"}],fe="Direction",be=[{label:"Stacked",value:"column"},{label:"One row",value:"row"}],me={min:-32,max:64,step:2,builtIn:0},he={min:30,max:100,step:5,fallback:60},ve=["top-left","top-center","top-right","left","center","right","bottom-left","bottom-center","bottom-right"],ge="bottom-left",ye={"top-left":"Top left","top-center":"Top center","top-right":"Top right",left:"Left",center:"Center",right:"Right","bottom-left":"Bottom left","bottom-center":"Bottom center","bottom-right":"Bottom right"},we=ve.map(e=>({value:e,label:ye[e]}));function ke(e,n=ge){return ve.includes(e)?e:n}var xe=40,Ce=e=>"number"==typeof e?e:null;function je(e,n,t){const l={};for(const o of["x","y"])t[o]!==n[o]&&(l[e[o]]=t[o]??void 0);return l}var Fe=["top","right","bottom","left"],Oe={top:"sectionPaddingTop",right:"sectionPaddingRight",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft"},Le=e=>"number"==typeof e?e:null;function Se(e,n,t){const l={};for(const o of Fe)t[o]!==n[o]&&(l[e[o]]=t[o]??void 0);return l}function Ke(e){if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};const n=e&&"object"==typeof e?e:{};return Object.fromEntries(Fe.map(e=>[e,Le(n[e])]))}function Ve(e){const n={};for(const t of Fe)"number"==typeof e[t]&&(n[t]=e[t]);return Object.keys(n).length?n:void 0}function Ee(e,n={}){const t=n=>{const t=n[e];return t&&"object"==typeof t?t:{}},l=e=>Object.hasOwn(n,e)?n[e]:e;return{read:(e,n)=>t(e)[l(n)],write:(n,o,a)=>{const i={...t(n)};return void 0===a?delete i[l(o)]:i[l(o)]=a,{[e]:Object.keys(i).length?i:void 0}}}}function Pe(e,n,t){const l=Re(e),o=d();if(t)return[t.value,t.onChange];const a=o?.values??{};return[e.read(a,n),e=>l([[n,e]])]}function Re(e){const n=d();return t=>{n&&n.onChangeMany(n=>{let l={};for(const[o,a]of t)l={...l,...e.write({...n,...l},o,a)};return l})}}var Ae={read:(e,n)=>e[n],write:(e,n,t)=>({[n]:t})},Ie={fieldKey:m,ownField:!0,read:(e,n)=>e[m(n)],write:(e,n,t)=>({[m(n)]:t})},Me={fieldKey:h,ownField:!0,read:(e,n)=>e[h(n)],write:(e,n,t)=>({[h(n)]:t})},Te={...Ie,tablet:Me};function Be(e){return{...Ee(e),fieldKey:n=>`_${e}_${n}`}}function We({row:e,desktopKey:n,access:t,wider:l,props:o}){const a=d(),i=a?.values??{},r=l?.read(i,n),s=v(i[n],r),u=g(r)?"desktop":"tablet",[c,p]=Pe(t,n);return t.ownField?e.render({...o,follows:s,followsView:u,twinAccess:t,widerAccess:l}):e.render({...o,value:c,storedValue:c,follows:s,followsView:u,twinAccess:t,widerAccess:l,onChange:p})}function Ne(e,n,t=Ie,l={}){const a=l.phoneRow??n,i=(n,t)=>({...a,render:l=>/* @__PURE__ */z(We,{row:a,desktopKey:e,access:n,wider:t,props:l})}),r=t.tablet;return{[e]:o("desktop",n),...r?{[r.fieldKey(e)]:o("tablet",i(r))}:{},[t.fieldKey(e)]:o("mobile",i(t,r))}}var $e=["left","center","right"];function Ge(e,{options:n,value:t,onChange:l,ariaLabel:o,disabled:a=!1}){/* @__PURE__ */
3
- return z(w,{options:n.map(n=>n.picture?{id:n.value,label:n.picture,title:e(n.title??n.label)}:{id:n.value,label:e(n.label),title:void 0===n.title?void 0:e(n.title)}),value:t,onChange:l,ariaLabel:e(o),disabled:a})}function De(e,{label:n,value:t,onChange:l,points:o}){const a=o.find(e=>e.disabled),i=o.map(n=>({...n,label:e(n.label),...n.title?{title:e(n.title)}:null}));/* @__PURE__ */
4
- return z(k,{label:e(n),icon:/* @__PURE__ */z(V,{}),hint:a?.title?e(a.title):void 0,children:/* @__PURE__ */z(H,{label:e(n),value:t,points:i,onChange:l})})}function Je({say:e,label:n,value:t,onChange:l,pointsFor:o}){const{appState:a,selectedItem:i}=p(e=>e),r=i?.props?.id?String(i.props.id):void 0;return De(e,{label:n,value:t,onChange:l,points:o(a?.data,r)})}function Ye({say:e,o:n}){const t=d(),o=x("panel",f),a=t?.values??{},i={x:Ce(a[n.keys.x]),y:Ce(a[n.keys.y])},r=e(n.label??"Position"),s=Boolean(i.x||i.y),u=e=>{const l=je(n.keys,i,e);Object.keys(l).length&&t?.onChangeMany(l)},c=/* @__PURE__ */z(X,{label:r,value:i,onChange:u,words:{x:e("Left and right"),y:e("Up and down"),unit:"px"},placeholder:{x:"0",y:"0"},min:n.min,max:n.max,step:n.step??1}),p=/* @__PURE__ */z(l,{words:o,label:r,changed:s,detail:"0 px, 0 px",onReset:()=>u({x:null,y:null})});return null===n.label?/* @__PURE__ */Q("div",{className:"sf-position-line",children:[c,p]}):/* @__PURE__ */z(k,{label:r,icon:/* @__PURE__ */z(E,{}),changed:s,action:p,children:c})}var He={x:{start:/* @__PURE__ */z(I,{}),center:/* @__PURE__ */z(A,{}),end:/* @__PURE__ */z(R,{}),stretch:/* @__PURE__ */z(D,{}),between:/* @__PURE__ */z(G,{})},y:{start:/* @__PURE__ */z($,{}),center:/* @__PURE__ */z(N,{}),end:/* @__PURE__ */z(W,{}),stretch:/* @__PURE__ */z(B,{}),between:/* @__PURE__ */z(T,{})}},Xe=e=>"row"===e?"row":"column";function _e({say:e,kind:n,label:t,options:l,value:o,onChange:a,o:i}){const r=d(),s="justify"===n==("row"===(i.runs??Xe)(r?.values?.[i.directionKey??"direction"]))?"x":"y";return Ge(e,{options:l.map(e=>({label:e.label,value:e.value,picture:He[s][e.value]})),value:o,onChange:a,ariaLabel:t})}function ze(e,n){const t=(e.useFallback??ee)(n);return Object.fromEntries(Fe.map(n=>[n,t?.[n]??e.fallback[n]]))}function Ze({say:e,tier:n,o:t,props:l}){const o=ze(t,l),a=d(),i=a?.values??{},r="mobile"===n?t.phoneKeys:"tablet"===n?t.tabletKeys:t.keys,s=Object.fromEntries(Fe.map(e=>[e,Le(i[r[e]])])),u="desktop"===n?null:Object.fromEntries(Fe.map(e=>[e,v(Le(i[t.keys[e]]),"mobile"===n?Le(i[t.tabletKeys[e]]):null)]));/* @__PURE__ */
5
- return z(Ue,{say:e,o:t,fallback:o,value:s,follows:u,followsView:"mobile"===n&&Fe.some(e=>null!==Le(i[t.tabletKeys[e]]))?"tablet":"desktop",readOnly:l.readOnly,onChange:e=>{const n=Se(r,s,e);Object.keys(n).length&&a?.onChangeMany(n)}})}function Qe({say:e,o:n,props:t}){const l=ze(n,t);/* @__PURE__ */
6
- return z(Ue,{say:e,o:n,fallback:l,value:Ke(t.value),follows:"follows"in t?Ke(t.follows):null,followsView:t.followsView,readOnly:t.readOnly,onChange:e=>t.onChange(Ve(e))})}function Ue({say:o,o:a,fallback:i,value:r,follows:s,followsView:u,readOnly:c,onChange:d}){const p=Object.fromEntries(Fe.map(e=>[e,String(s?.[e]??i[e])])),[b,m]=C(()=>e(r,p)),h=x("panel",f),v=Fe.map(e=>p[e]),g=`${1===new Set(v).size?v[0]:v.join(" / ")}px`;/* @__PURE__ */
7
- return z(k,{label:o(a.label),icon:a.icon??/* @__PURE__ */z(M,{}),action:/* @__PURE__ */Q(Z,{children:[
8
- /* @__PURE__ */z(t,{each:b,label:o("Each side"),onChange:m,disabled:c}),
9
- /* @__PURE__ */z(l,{words:h,label:o(a.label),changed:Fe.some(e=>"number"==typeof r[e]),detail:s?q(o,g,u):g,disabled:c,onReset:()=>d({top:null,right:null,bottom:null,left:null})})]}),children:/* @__PURE__ */z(n,{label:o(a.label),each:b,value:r,placeholder:p,min:a.min,max:a.max,step:a.step,readOnly:c,onChange:d,words:{sides:{top:o("Padding top"),right:o("Padding right"),bottom:o("Padding bottom"),left:o("Padding left")},vertical:o("Top and bottom"),horizontal:o("Left and right"),unit:"px"}})})}var qe=e=>""===e||"px"===e?e:` ${e}`;function en({label:e,value:n,onChange:t,min:o,max:a,step:i=1,unit:r="",hint:s,emptyLabel:u,inputMax:c,readOnly:d=!1,clears:p,detail:f,resetWords:b}){const m="number"==typeof n,h=p?/* @__PURE__ */z(l,{label:e,changed:m,detail:f??u??(void 0===s?void 0:`${s}${qe(r)}`),disabled:d,onReset:()=>t(void 0),...b?{words:b}:{}}):void 0;return{track:/* @__PURE__ */z("div",{className:"sf-slider",children:/* @__PURE__ */z(_,{min:o,max:a,step:i,value:n,suffix:r||void 0,showInput:!0,label:e,disabled:d,...p&&void 0!==s?{placeholderValue:s}:{},...u?{emptyLabel:u}:{},...void 0!==c?{inputMax:c}:{},size:"sm",boxSize:"md",className:"sf-slider-track",onChange:e=>{null===e?p&&m&&t(void 0):e!==n&&t(e)}})}),reset:h}}function nn({caption:e,label:n,value:t,hint:l,emptyLabel:o,...a}){const i=void 0!==l||void 0!==o,r="number"==typeof t,{track:s,reset:u}=en({...a,label:n,value:r?t:i?null:a.min,hint:l,emptyLabel:o,clears:i});/* @__PURE__ */
10
- return z(k,{label:e??n,action:u,children:s})}function tn({draw:e,props:n,useMax:t,useHint:l}){return e(n,{max:(t??ee)(n),hint:(l??ee)(n)})}function ln(e=U){function n(n,t,l,o,a,i,s="",u){const c="function"==typeof u?{action:u}:u??{},{action:d,clear:p}=c,f=(r,u)=>{const f="storedValue"in r?r.storedValue:r.value,b="follows"in r,m=b&&!1!==p?.phoneFollows,h=b||void 0!==p,v="number"==typeof r.value,g=void 0===p?i:u.hint??("function"==typeof p.hint?p.hint(r):p.hint)??i,y=m&&"number"==typeof r.follows?r.follows:g,w=qe(s),x=!p?.emptyLabel||m&&"number"==typeof r.follows?void 0:p.emptyLabel,C=x??`${y}${w}`,j="function"==typeof c.hint?c.hint(r):c.hint,{track:F,reset:O}=en({label:e(n),value:v?r.value:h?null:i,onChange:e=>r.onChange(e),min:l,max:u.max??o,step:a,unit:s,hint:h?y:void 0,emptyLabel:x,inputMax:c.inputMax,readOnly:!0===r.readOnly,clears:h,detail:m?q(e,C,r.followsView):C});/* @__PURE__ */
11
- return z(k,{label:e(n),icon:oe(t),hint:void 0===j?void 0:e(j),action:h?O:d?d(f,r.onChange):void 0,children:F})},b=c.useMax,m=p?.useHint;return{type:"custom",...r({},{type:"number",label:n}),render:b||m?e=>/* @__PURE__ */z(tn,{draw:f,props:e,useMax:b,useHint:m}):e=>f(e,{})}}function t(n){return Ge(e,n)}function s(n,o,a,i,s={}){const u=a.map(e=>"string"==typeof e?{label:e,value:e}:e);return{type:"custom",...r({},{type:"radio",label:n,options:u.map(e=>({value:e.value,label:e.label}))}),render:a=>{const{value:r,onChange:c,field:d}=a,p=u.some(e=>e.value===r),f=!0===a.readOnly;if("follows"in a&&!u.some(e=>""===e.value)){const d=s.phoneRest?s.phoneRest(a.follows):a.follows,b=u.find(e=>e.value===d)??u.find(e=>e.value===i);/* @__PURE__ */
12
- return z(k,{label:e(n),icon:oe(o),action:/* @__PURE__ */z(l,{label:e(n),changed:p,detail:q(e,e(b?.label??""),a.followsView),disabled:f,onReset:()=>c(void 0)}),children:t({options:u,value:p?r:b?.value??i,onChange:c,ariaLabel:n,disabled:f})})}const b="follows"in a&&s.followsLabel?s.followsLabel(a.follows):void 0;/* @__PURE__ */
13
- return z(k,{label:e(n),icon:oe(o),action:"follows"in a&&s.followsLabel?/* @__PURE__ */z(l,{label:e(n),changed:null!=r&&""!==r,detail:void 0===b?void 0:q(e,e(b),a.followsView),disabled:f,onReset:()=>c(void 0)}):void 0,children:t({options:u,value:p?r:r||d?.currentValue||i,onChange:c,ariaLabel:n,disabled:f})})}}}function u(e,n){return n.phone?e.unshift({label:"Match desktop",value:"",picture:/* @__PURE__ */z(P,{})}):n.inherit&&e.unshift({label:n.inherit,value:""}),e}function c(e,n){return n.inherit||n.phone?{...e,render:n=>e.render({...n,onChange:e=>n.onChange(""===e?void 0:e)})}:e}function d(e,n,t,l){if(l.access){const o=l.inherit?"":l.fallback??"left",a=t({...l,phone:!1}),i=e=>{const n="string"==typeof e&&""!==e&&a.some(n=>n.value===e)?e:o;return a.find(e=>e.value===n)?.label};return Ne(e,n(l,o),l.access,{phoneRow:n({...l,phone:!0},"",i)})}return{[e]:o("desktop",n(l)),[m(e)]:o("mobile",n({...l,phone:!0},""))}}function p(e){return u(Y(e.allow??$e).map(e=>({label:e.label,value:e.value,picture:e.icon})),e)}function f(e,n=e.fallback??"left",t){return c(s(e.label??"Text alignment",/* @__PURE__ */z(j,{}),p(e),n,t?{followsLabel:t}:{}),e)}function v(e){const n={left:He.x.start,center:He.x.center,right:He.x.end};return u(Y((e.allow??$e).filter(e=>e in n)).map(e=>({label:e.label,value:e.value,picture:n[e.value]})),e)}function g(e,n=e.fallback??"left",t){return c(s(e.label??"Block alignment",/* @__PURE__ */z(F,{}),v(e),n,t?{followsLabel:t}:{}),e)}function w(n,t,l,o,a,i){return{type:"custom",options:o,fallback:a,...r({},{type:"radio",label:t,options:o.map(e=>({value:e.value,label:e.label}))}),render:({value:r,onChange:s,field:u})=>{const c=u.options??o,d=u.fallback??a,p=c.some(e=>e.value===r)?r:d;/* @__PURE__ */
14
- return z(k,{label:e(t),icon:oe(l),children:/* @__PURE__ */z(_e,{say:e,kind:n,label:t,options:c,value:p,onChange:s,o:i})})}}}function x(e={}){return w("justify","Justify",/* @__PURE__ */z(F,{}),ue,ue[0].value,e)}function C(e={}){return w("align","Item alignment",/* @__PURE__ */z(J,{}),ce,"stretch",e)}function V(){const n=de;return{type:"custom",options:pe,fallback:pe[1].value,...r({},{type:"radio",label:n,options:pe.map(e=>({value:e.value,label:e.label}))}),render:({value:t,onChange:l,id:o,name:a})=>{const i=`${o??a??n}-label`;/* @__PURE__ */
15
- return z(k,{label:e(n),labelId:i,icon:/* @__PURE__ */z(O,{}),action:/* @__PURE__ */z(b,{checked:(r=t,!0===r||"wrap"===r),onChange:e=>l(e?pe[0].value:pe[1].value),ariaLabelledBy:i})});var r}}}function E({offered:e,fallback:n,resolve:t}){const l=t??(t=>e.some(e=>e.value===t)?t:n),o=s(fe,
16
- /* @__PURE__ */z(L,{}),e.map(e=>({label:e.label,value:e.value})),l(void 0));return{type:"custom",render:e=>o.render({...e,value:l(e.value),onChange:n=>e.onChange(n)})}}function R({min:e,max:t,step:l,builtIn:o,resolve:a,action:i,mark:r}){const s=n("Gap",/* @__PURE__ */z(S,{}),e,t,l,o,"px",i),u=a??(e=>"number"==typeof e?e:o);return{...r,type:"custom",render:e=>s.render({...e,value:u(e.value,e.field),storedValue:e.value,onChange:n=>e.onChange(n)})}}function A(n,{fallback:t=ge,pointsFor:l}={}){return{type:"custom",render:({value:o,onChange:a})=>{const i=ke(o,t);return l?/* @__PURE__ */z(Je,{say:e,label:n,value:i,onChange:a,pointsFor:l}):De(e,{label:n,value:i,onChange:a,points:we})}}}function I(n){return{[n.keys.x]:{type:"custom",render:()=>/* @__PURE__ */z(Ye,{say:e,o:n})},[n.keys.y]:{...a({type:"custom",render:()=>/* @__PURE__ */z(i,{})},"always"),reachedBy:n.keys.x}}}function M(n={}){const t={...Oe,...n.keys},l={keys:t,tabletKeys:Object.fromEntries(Fe.map(e=>[e,h(t[e])])),phoneKeys:Object.fromEntries(Fe.map(e=>[e,m(t[e])])),fallback:{top:0,right:0,bottom:0,left:0,...n.fallback},useFallback:n.useFallback,label:n.label??"Padding",icon:n.icon,min:n.min??0,max:n.max??200,step:n.step??4},r=!1!==n.phone,s=!1===n.group?{}:{_gSpacing:re("Padding")};if(n.object){const t={type:"custom",render:n=>/* @__PURE__ */z(Qe,{say:e,o:l,props:n})};return ae({...s,...r?Ne(n.object.key,t,n.object.phone):{[n.object.key]:t}})}const u=r&&!0===n.tablet,c=n=>{const t={type:"custom",render:t=>/* @__PURE__ */z(Ze,{say:e,tier:n,o:l,props:t})};return r?o(n,t):t},d=()=>a({type:"custom",render:()=>/* @__PURE__ */z(i,{})},"always"),p=Fe.filter(e=>"top"!==e);return ae({...s,[l.keys.top]:c("desktop"),...u?{[l.tabletKeys.top]:c("tablet")}:{},...r?{[l.phoneKeys.top]:c("mobile")}:{},...Object.fromEntries(p.map(e=>[l.keys[e],{...d(),reachedBy:l.keys.top}])),...u?Object.fromEntries(p.map(e=>[l.tabletKeys[e],o("tablet",d())])):{},...r?Object.fromEntries(p.map(e=>[l.phoneKeys[e],o("mobile",d())])):{}})}return{slider:n,select:function(n,t,o,a,i){const{note:s,phoneRest:u}="string"==typeof i?{note:i,phoneRest:void 0}:i??{};return{type:"custom",options:o,fallback:a,...s?{note:s}:{},...r({},{type:"select",label:n}),render:i=>{const{value:r,onChange:c,field:d}=i,p=d.options??o,f=d.fallback??a,b=p.some(e=>e.value===r),m="follows"in i,h=m?u?u(i.follows):i.follows:void 0,v=m?p.find(e=>e.value===h)??p.find(e=>e.value===f):void 0,g=b?r:v?.value??f,w=!0===i.readOnly;/* @__PURE__ */
17
- return z(k,{label:e(n),icon:oe(t),action:m?/* @__PURE__ */z(l,{label:e(n),changed:null!=r&&""!==r,detail:v?q(e,e(v.label),i.followsView):void 0,disabled:w,onReset:()=>c(void 0)}):void 0,children:/* @__PURE__ */z(y,{value:g,ariaLabel:e(n),readOnly:w,onChange:c,options:[...s?[{label:e(s),value:"\0note",disabled:!0}]:[],...p.map(n=>({label:e(n.label),value:n.value}))]})})}}},Segmented:t,segmented:s,boxJustifyField:x,boxAlignField:C,boxWrapField:V,directionField:E,gapField:R,placementField:A,PlacementGridView:function(n){return De(e,n)},positionFields:I,sidesPaddingFields:M,alignmentField:function(e={},n=e.fallback??"left"){return f(e,n)},alignmentFields:function(e="align",n={}){return d(e,f,p,n)},AlignmentStrip:function({opts:e={},value:n,onChange:l,ariaLabel:o,disabled:a=!1}){return t({options:p(e),value:n,onChange:l,ariaLabel:o,disabled:a})},blockAlignmentField:function(e={},n=e.fallback??"left"){return g(e,n)},blockAlignmentFields:function(e="align",n={}){return d(e,g,v,n)},BlockAlignmentStrip:function({opts:e={},value:n,onChange:l,ariaLabel:o,disabled:a=!1}){return t({options:v(e),value:n,onChange:l,ariaLabel:o,disabled:a})},boxFieldSet:function(e={}){const t=e.width??he,l=e.nudge?.limit??40,o=e.direction??{offered:be,fallback:"column"},a=o.resolve??(e=>o.offered.some(n=>n.value===e)?e:o.fallback),i={runs:e=>"row"===a(e)?"row":"column"};return{_gLayout:re("Layout"),placement:A("Placement",e.placement),width:n("Width",/* @__PURE__ */z(K,{}),t.min,t.max,t.step,t.fallback,"%"),direction:E(o),gap:R(e.gap??me),justify:x(i),align:C(i),wrap:V(),_gNudge:re("Nudge"),...I({keys:e.nudge?.keys??{x:"nudgeX",y:"nudgeY"},min:-l,max:l,label:null}),...M(e.padding)}}}}var{slider:on,select:an,Segmented:rn,segmented:sn,boxJustifyField:un,boxAlignField:cn,boxWrapField:dn,directionField:pn,gapField:fn,placementField:bn,PlacementGridView:mn,positionFields:hn,sidesPaddingFields:vn,alignmentField:gn,alignmentFields:yn,AlignmentStrip:wn,blockAlignmentField:kn,blockAlignmentFields:xn,BlockAlignmentStrip:Cn,boxFieldSet:jn}=ln();export{ye as ANCHOR_LABELS,wn as AlignmentStrip,ce as BOX_ALIGN_POINTS,be as BOX_DIRECTIONS,fe as BOX_DIRECTION_LABEL,me as BOX_GAP,ue as BOX_JUSTIFY_POINTS,xe as BOX_NUDGE_LIMIT,ve as BOX_PLACEMENTS,ge as BOX_PLACEMENT_DEFAULT,he as BOX_WIDTH,de as BOX_WRAP_LABEL,pe as BOX_WRAP_POINTS,Cn as BlockAlignmentStrip,Ae as FLAT_ACCESS,we as OPEN_PLACEMENT_POINTS,Ie as PHONE_KEY_ACCESS,mn as PlacementGridView,Oe as SIDE_PAD_KEYS,rn as Segmented,nn as SliderControl,Te as VIEW_KEY_ACCESS,gn as alignmentField,yn as alignmentFields,kn as blockAlignmentField,xn as blockAlignmentFields,cn as boxAlignField,ln as boxFieldBuilders,jn as boxFieldSet,un as boxJustifyField,dn as boxWrapField,pn as directionField,fn as gapField,re as group,oe as iconOf,le as isNoGlyph,te as noGlyph,ke as normaliseBoxPlacement,Ee as objectAccess,q as onDesktopWords,Be as phoneObjectAccess,Ne as phoneTwinFields,bn as placementField,hn as positionFields,je as positionPatch,se as section,sn as segmented,an as select,ae as sharedStyleKinds,Ke as sidesFromObject,vn as sidesPaddingFields,Se as sidesPaddingPatch,Ve as sidesToObject,on as slider,Re as useAccessPatch,Pe as useAccessValue};
1
+ import{sidesStartEach as e,SidesInput as n,SidesEachToggle as t}from"./chunk-XWTQTANN.js";import{SettingsDefaultReset as l}from"./chunk-2T22IY3J.js";import{deviceField as o}from"./chunk-ZNLODQD4.js";import{noControlField as a,NoControlMark as i}from"./chunk-22I55W37.js";import{describedAs as r}from"./chunk-LX23TCTP.js";import{withStyleKind as s}from"./chunk-3OOYGEJY.js";import{foldMetaOf as u,FOLD_FIELD_MARKER as c}from"./chunk-ANPOR6EY.js";import{useSelectedHost as d,useEasel as p}from"./chunk-NMLAW6FI.js";import{DEFAULT_PANEL_WORDS as f}from"./chunk-56ID6FKZ.js";import{SettingsSwitch as b}from"./chunk-OECWLNKJ.js";import{phoneKey as m,tabletKey as h,viewFollows as v,isAuto as g}from"./chunk-DIOTWSCO.js";import{FieldSelect as y}from"./chunk-C63IB4VW.js";import{SettingsSegmented as w}from"./chunk-DX3VILZ3.js";import{SettingsField as k}from"./chunk-MIX7EGRG.js";import{useWords as x}from"./chunk-MFIRYGHW.js";import{useState as C}from"react";import{AlignmentIcon as j,BoxJustifyIcon as F,WrapIcon as O,ArrowRightIcon as L,GapIcon as K,WidthIcon as S,PlacementIcon as V,NudgeIcon as E,DesktopIcon as P,BoxXEndIcon as A,BoxXCenterIcon as R,BoxXStartIcon as I,PaddingAllIcon as M,BoxYBetweenIcon as W,BoxYStretchIcon as B,BoxYEndIcon as N,BoxYCenterIcon as T,BoxYStartIcon as $,BoxXBetweenIcon as G,BoxXStretchIcon as D,BoxItemAlignmentIcon as J}from"efficient-shell/icons/efficient";import{textAlignOptions as Y,AlignmentGrid as X,PositionInput as _,Slider as z}from"efficient-shell/ui";import{jsx as H,Fragment as Z,jsxs as Q}from"react/jsx-runtime";var U=e=>e;function q(e,n,t="desktop"){return e("tablet"===t?"{value} on tablet":"{value} on desktop").replace("{value}",n)}var ee=()=>{};function ne(){return null}function te(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");/* @__PURE__ */
2
+ return H(ne,{},e)}function le(e){return e.type===ne}function oe(e){return le(e)?void 0:e}function ae(e){for(const[n,t]of Object.entries(e))t&&"object"==typeof t&&!u(t)&&s(t,`section:${n}`);return e}function ie(e,n){return{type:"custom",[c]:{label:e,level:n},marker:!0,fold:e,render:()=>/* @__PURE__ */H(Z,{})}}function re(e){return ie(e,2)}function se(e){return ie(e,1)}var ue=[{label:"Start",value:"start"},{label:"Center",value:"center"},{label:"Space between",value:"between"},{label:"End",value:"end"}],ce=[{label:"Start",value:"start"},{label:"Center",value:"center"},{label:"End",value:"end"},{label:"Stretch",value:"stretch"}],de="Wrap",pe=[{label:"Wrap",value:"wrap"},{label:"No wrap",value:"nowrap"}],fe="Direction",be=[{label:"Stacked",value:"column"},{label:"One row",value:"row"}],me={min:-32,max:64,step:2,builtIn:0},he={min:30,max:100,step:5,fallback:60},ve=["top-left","top-center","top-right","left","center","right","bottom-left","bottom-center","bottom-right"],ge="bottom-left",ye={"top-left":"Top left","top-center":"Top center","top-right":"Top right",left:"Left",center:"Center",right:"Right","bottom-left":"Bottom left","bottom-center":"Bottom center","bottom-right":"Bottom right"},we=ve.map(e=>({value:e,label:ye[e]}));function ke(e,n=ge){return ve.includes(e)?e:n}var xe=40,Ce=e=>"number"==typeof e?e:null;function je(e,n,t){const l={};for(const o of["x","y"])t[o]!==n[o]&&(l[e[o]]=t[o]??void 0);return l}var Fe=["top","right","bottom","left"],Oe={top:"sectionPaddingTop",right:"sectionPaddingRight",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft"},Le=e=>"number"==typeof e?e:null;function Ke(e,n,t){const l={};for(const o of Fe)t[o]!==n[o]&&(l[e[o]]=t[o]??void 0);return l}function Se(e){if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};const n=e&&"object"==typeof e?e:{};return Object.fromEntries(Fe.map(e=>[e,Le(n[e])]))}function Ve(e){const n={};for(const t of Fe)"number"==typeof e[t]&&(n[t]=e[t]);return Object.keys(n).length?n:void 0}function Ee(e,n={}){const t=n=>{const t=n[e];return t&&"object"==typeof t?t:{}},l=e=>Object.hasOwn(n,e)?n[e]:e;return{read:(e,n)=>t(e)[l(n)],write:(n,o,a)=>{const i={...t(n)};return void 0===a?delete i[l(o)]:i[l(o)]=a,{[e]:Object.keys(i).length?i:void 0}}}}function Pe(e,n,t){const l=Ae(e),o=d();if(t)return[t.value,t.onChange];const a=o?.values??{};return[e.read(a,n),e=>l([[n,e]])]}function Ae(e){const n=d();return t=>{n&&n.onChangeMany(n=>{let l={};for(const[o,a]of t)l={...l,...e.write({...n,...l},o,a)};return l})}}var Re={read:(e,n)=>e[n],write:(e,n,t)=>({[n]:t})},Ie={fieldKey:m,ownField:!0,read:(e,n)=>e[m(n)],write:(e,n,t)=>({[m(n)]:t})},Me={fieldKey:h,ownField:!0,read:(e,n)=>e[h(n)],write:(e,n,t)=>({[h(n)]:t})},We={...Ie,tablet:Me};function Be(e){return{...Ee(e),fieldKey:n=>`_${e}_${n}`}}function Ne({row:e,desktopKey:n,access:t,wider:l,props:o}){const a=d(),i=a?.values??{},r=l?.read(i,n),s=v(i[n],r),u=g(r)?"desktop":"tablet",[c,p]=Pe(t,n);return t.ownField?e.render({...o,follows:s,followsView:u,twinAccess:t,widerAccess:l}):e.render({...o,value:c,storedValue:c,follows:s,followsView:u,twinAccess:t,widerAccess:l,onChange:p})}function Te(e,n,t=Ie,l={}){const a=l.phoneRow??n,i=(n,t)=>({...a,render:l=>/* @__PURE__ */H(Ne,{row:a,desktopKey:e,access:n,wider:t,props:l})}),r=t.tablet;return{[e]:o("desktop",n),...r?{[r.fieldKey(e)]:o("tablet",i(r))}:{},[t.fieldKey(e)]:o("mobile",i(t,r))}}var $e=["left","center","right"];function Ge(e,{options:n,value:t,onChange:l,ariaLabel:o,disabled:a=!1}){/* @__PURE__ */
3
+ return H(w,{options:n.map(n=>n.picture?{id:n.value,label:n.picture,title:e(n.title??n.label)}:{id:n.value,label:e(n.label),title:void 0===n.title?void 0:e(n.title)}),value:t,onChange:l,ariaLabel:e(o),disabled:a})}function De(e,{label:n,value:t,onChange:l,points:o}){const a=o.find(e=>e.disabled),i=o.map(n=>({...n,label:e(n.label),...n.title?{title:e(n.title)}:null}));/* @__PURE__ */
4
+ return H(k,{label:e(n),icon:/* @__PURE__ */H(V,{}),hint:a?.title?e(a.title):void 0,children:/* @__PURE__ */H(X,{label:e(n),value:t,points:i,onChange:l})})}function Je({say:e,label:n,value:t,onChange:l,pointsFor:o}){const{appState:a,selectedItem:i}=p(e=>e),r=i?.props?.id?String(i.props.id):void 0;return De(e,{label:n,value:t,onChange:l,points:o(a?.data,r)})}function Ye({say:e,o:n}){const t=d(),o=x("panel",f),a=t?.values??{},i={x:Ce(a[n.keys.x]),y:Ce(a[n.keys.y])},r=e(n.label??"Position"),s=Boolean(i.x||i.y),u=e=>{const l=je(n.keys,i,e);Object.keys(l).length&&t?.onChangeMany(l)},c=/* @__PURE__ */H(_,{label:r,value:i,onChange:u,words:{x:e("Left and right"),y:e("Up and down"),unit:"px"},placeholder:{x:"0",y:"0"},min:n.min,max:n.max,step:n.step??1}),p=/* @__PURE__ */H(l,{words:o,label:r,changed:s,detail:"0 px, 0 px",onReset:()=>u({x:null,y:null})});return null===n.label?/* @__PURE__ */Q("div",{className:"sf-position-line",children:[c,p]}):/* @__PURE__ */H(k,{label:r,icon:/* @__PURE__ */H(E,{}),changed:s,action:p,children:c})}var Xe={x:{start:/* @__PURE__ */H(I,{}),center:/* @__PURE__ */H(R,{}),end:/* @__PURE__ */H(A,{}),stretch:/* @__PURE__ */H(D,{}),between:/* @__PURE__ */H(G,{})},y:{start:/* @__PURE__ */H($,{}),center:/* @__PURE__ */H(T,{}),end:/* @__PURE__ */H(N,{}),stretch:/* @__PURE__ */H(B,{}),between:/* @__PURE__ */H(W,{})}},_e=e=>"row"===e?"row":"column";function ze({say:e,kind:n,label:t,options:l,value:o,onChange:a,o:i}){const r=d(),s="justify"===n==("row"===(i.runs??_e)(r?.values?.[i.directionKey??"direction"]))?"x":"y";return Ge(e,{options:l.map(e=>({label:e.label,value:e.value,picture:Xe[s][e.value]})),value:o,onChange:a,ariaLabel:t})}function He(e,n){const t=(e.useFallback??ee)(n);return Object.fromEntries(Fe.map(n=>[n,t?.[n]??e.fallback[n]]))}function Ze({say:e,tier:n,o:t,props:l}){const o=He(t,l),a=d(),i=a?.values??{},r="mobile"===n?t.phoneKeys:"tablet"===n?t.tabletKeys:t.keys,s=Object.fromEntries(Fe.map(e=>[e,Le(i[r[e]])])),u="desktop"===n?null:Object.fromEntries(Fe.map(e=>[e,v(Le(i[t.keys[e]]),"mobile"===n?Le(i[t.tabletKeys[e]]):null)]));/* @__PURE__ */
5
+ return H(Ue,{say:e,o:t,fallback:o,value:s,follows:u,followsView:"mobile"===n&&Fe.some(e=>null!==Le(i[t.tabletKeys[e]]))?"tablet":"desktop",readOnly:l.readOnly,onChange:e=>{const n=Ke(r,s,e);Object.keys(n).length&&a?.onChangeMany(n)}})}function Qe({say:e,o:n,props:t}){const l=He(n,t);/* @__PURE__ */
6
+ return H(Ue,{say:e,o:n,fallback:l,value:Se(t.value),follows:"follows"in t?Se(t.follows):null,followsView:t.followsView,readOnly:t.readOnly,onChange:e=>t.onChange(Ve(e))})}function Ue({say:o,o:a,fallback:i,value:r,follows:s,followsView:u,readOnly:c,onChange:d}){const p=Object.fromEntries(Fe.map(e=>[e,String(s?.[e]??i[e])])),[b,m]=C(()=>e(r,p)),h=x("panel",f),v=Fe.map(e=>p[e]),g=`${1===new Set(v).size?v[0]:v.join(" / ")}px`;/* @__PURE__ */
7
+ return H(k,{label:o(a.label),icon:a.icon??/* @__PURE__ */H(M,{}),action:/* @__PURE__ */Q(Z,{children:[
8
+ /* @__PURE__ */H(t,{each:b,label:o("Each side"),onChange:m,disabled:c}),
9
+ /* @__PURE__ */H(l,{words:h,label:o(a.label),changed:Fe.some(e=>"number"==typeof r[e]),detail:s?q(o,g,u):g,disabled:c,onReset:()=>d({top:null,right:null,bottom:null,left:null})})]}),children:/* @__PURE__ */H(n,{label:o(a.label),each:b,value:r,placeholder:p,min:a.min,max:a.max,step:a.step,readOnly:c,onChange:d,words:{sides:{top:o("Padding top"),right:o("Padding right"),bottom:o("Padding bottom"),left:o("Padding left")},vertical:o("Top and bottom"),horizontal:o("Left and right"),unit:"px"}})})}var qe=e=>""===e||"px"===e?e:` ${e}`;function en({label:e,value:n,onChange:t,min:o,max:a,step:i=1,unit:r="",hint:s,emptyLabel:u,inputMax:c,readOnly:d=!1,clears:p,detail:f,resetWords:b}){const m="number"==typeof n,h=p?/* @__PURE__ */H(l,{label:e,changed:m,detail:f??u??(void 0===s?void 0:`${s}${qe(r)}`),disabled:d,onReset:()=>t(void 0),...b?{words:b}:{}}):void 0;return{track:/* @__PURE__ */H("div",{className:"sf-slider",children:/* @__PURE__ */H(z,{min:o,max:a,step:i,value:n,suffix:r||void 0,showInput:!0,label:e,disabled:d,...p&&void 0!==s?{placeholderValue:s}:{},...u?{emptyLabel:u}:{},...void 0!==c?{inputMax:c}:{},size:"sm",boxSize:"md",className:"sf-slider-track",onChange:e=>{null===e?p&&m&&t(void 0):e!==n&&t(e)}})}),reset:h}}function nn({caption:e,label:n,value:t,hint:l,emptyLabel:o,...a}){const i=void 0!==l||void 0!==o,r="number"==typeof t,{track:s,reset:u}=en({...a,label:n,value:r?t:i?null:a.min,hint:l,emptyLabel:o,clears:i});/* @__PURE__ */
10
+ return H(k,{label:e??n,action:u,children:s})}function tn({draw:e,props:n,useMax:t,useHint:l}){return e(n,{max:(t??ee)(n),hint:(l??ee)(n)})}function ln(e=U){function n(n,t,l,o,a,i,s="",u){const c="function"==typeof u?{action:u}:u??{},{action:d,clear:p}=c,f=(r,u)=>{const f="storedValue"in r?r.storedValue:r.value,b="follows"in r,m=b&&!1!==p?.phoneFollows,h=b||void 0!==p,v="number"==typeof r.value,g=void 0===p?i:u.hint??("function"==typeof p.hint?p.hint(r):p.hint)??i,y=m&&"number"==typeof r.follows?r.follows:g,w=qe(s),x=!p?.emptyLabel||m&&"number"==typeof r.follows?void 0:p.emptyLabel,C=x??`${y}${w}`,j="function"==typeof c.hint?c.hint(r):c.hint,{track:F,reset:O}=en({label:e(n),value:v?r.value:h?null:i,onChange:e=>r.onChange(e),min:l,max:u.max??o,step:a,unit:s,hint:h?y:void 0,emptyLabel:x,inputMax:c.inputMax,readOnly:!0===r.readOnly,clears:h,detail:m?q(e,C,r.followsView):C});/* @__PURE__ */
11
+ return H(k,{label:e(n),icon:oe(t),hint:void 0===j?void 0:e(j),action:h?O:d?d(f,r.onChange):void 0,children:F})},b=c.useMax,m=p?.useHint;return{type:"custom",...r({},{type:"number",label:n}),render:b||m?e=>/* @__PURE__ */H(tn,{draw:f,props:e,useMax:b,useHint:m}):e=>f(e,{})}}function t(n){return Ge(e,n)}function s(n,o,a,i,s={}){const u=a.map(e=>"string"==typeof e?{label:e,value:e}:e);return{type:"custom",...r({},{type:"radio",label:n,options:u.map(e=>({value:e.value,label:e.label}))}),render:a=>{const{value:r,onChange:c,field:d}=a,p=u.some(e=>e.value===r),f=!0===a.readOnly;if("follows"in a&&!u.some(e=>""===e.value)){const d=s.phoneRest?s.phoneRest(a.follows):a.follows,b=u.find(e=>e.value===d)??u.find(e=>e.value===i);/* @__PURE__ */
12
+ return H(k,{label:e(n),icon:oe(o),action:/* @__PURE__ */H(l,{label:e(n),changed:p,detail:q(e,e(b?.label??""),a.followsView),disabled:f,onReset:()=>c(void 0)}),children:t({options:u,value:p?r:b?.value??i,onChange:c,ariaLabel:n,disabled:f})})}const b="follows"in a&&s.followsLabel?s.followsLabel(a.follows):void 0;/* @__PURE__ */
13
+ return H(k,{label:e(n),icon:oe(o),action:"follows"in a&&s.followsLabel?/* @__PURE__ */H(l,{label:e(n),changed:null!=r&&""!==r,detail:void 0===b?void 0:q(e,e(b),a.followsView),disabled:f,onReset:()=>c(void 0)}):void 0,children:t({options:u,value:p?r:r||d?.currentValue||i,onChange:c,ariaLabel:n,disabled:f})})}}}function u(e,n){return n.phone?e.unshift({label:"Match desktop",value:"",picture:/* @__PURE__ */H(P,{})}):n.inherit&&e.unshift({label:n.inherit,value:""}),e}function c(e,n){return n.inherit||n.phone?{...e,render:n=>e.render({...n,onChange:e=>n.onChange(""===e?void 0:e)})}:e}function d(e,n,t,l){if(l.access){const o=l.inherit?"":l.fallback??"left",a=t({...l,phone:!1}),i=e=>{const n="string"==typeof e&&""!==e&&a.some(n=>n.value===e)?e:o;return a.find(e=>e.value===n)?.label};return Te(e,n(l,o),l.access,{phoneRow:n({...l,phone:!0},"",i)})}return{[e]:o("desktop",n(l)),[m(e)]:o("mobile",n({...l,phone:!0},""))}}function p(e){return u(Y(e.allow??$e).map(e=>({label:e.label,value:e.value,picture:e.icon})),e)}function f(e,n=e.fallback??"left",t){return c(s(e.label??"Text alignment",/* @__PURE__ */H(j,{}),p(e),n,t?{followsLabel:t}:{}),e)}function v(e){const n={left:Xe.x.start,center:Xe.x.center,right:Xe.x.end};return u(Y((e.allow??$e).filter(e=>e in n)).map(e=>({label:e.label,value:e.value,picture:n[e.value]})),e)}function g(e,n=e.fallback??"left",t){return c(s(e.label??"Block alignment",/* @__PURE__ */H(F,{}),v(e),n,t?{followsLabel:t}:{}),e)}function w(n,t,l,o,a,i){return{type:"custom",options:o,fallback:a,...r({},{type:"radio",label:t,options:o.map(e=>({value:e.value,label:e.label}))}),render:({value:r,onChange:s,field:u})=>{const c=u.options??o,d=u.fallback??a,p=c.some(e=>e.value===r)?r:d;/* @__PURE__ */
14
+ return H(k,{label:e(t),icon:oe(l),children:/* @__PURE__ */H(ze,{say:e,kind:n,label:t,options:c,value:p,onChange:s,o:i})})}}}function x(e={}){return w("justify","Justify",/* @__PURE__ */H(F,{}),ue,ue[0].value,e)}function C(e={}){return w("align","Item alignment",/* @__PURE__ */H(J,{}),ce,"stretch",e)}function V(){const n=de;return{type:"custom",options:pe,fallback:pe[1].value,...r({},{type:"radio",label:n,options:pe.map(e=>({value:e.value,label:e.label}))}),render:({value:t,onChange:l,id:o,name:a})=>{const i=`${o??a??n}-label`;/* @__PURE__ */
15
+ return H(k,{label:e(n),labelId:i,icon:/* @__PURE__ */H(O,{}),action:/* @__PURE__ */H(b,{checked:(r=t,!0===r||"wrap"===r),onChange:e=>l(e?pe[0].value:pe[1].value),ariaLabelledBy:i})});var r}}}function E({offered:e,fallback:n,resolve:t}){const l=t??(t=>e.some(e=>e.value===t)?t:n),o=s(fe,
16
+ /* @__PURE__ */H(L,{}),e.map(e=>({label:e.label,value:e.value})),l(void 0));return{type:"custom",render:e=>o.render({...e,value:l(e.value),onChange:n=>e.onChange(n)})}}function A({min:e,max:t,step:l,builtIn:o,resolve:a,action:i,mark:r}){const s=n("Gap",/* @__PURE__ */H(K,{}),e,t,l,o,"px",i),u=a??(e=>"number"==typeof e?e:o);return{...r,type:"custom",render:e=>s.render({...e,value:u(e.value,e.field),storedValue:e.value,onChange:n=>e.onChange(n)})}}function R(n,{fallback:t=ge,pointsFor:l}={}){return{type:"custom",render:({value:o,onChange:a})=>{const i=ke(o,t);return l?/* @__PURE__ */H(Je,{say:e,label:n,value:i,onChange:a,pointsFor:l}):De(e,{label:n,value:i,onChange:a,points:we})}}}function I(n){return{[n.keys.x]:{type:"custom",render:()=>/* @__PURE__ */H(Ye,{say:e,o:n})},[n.keys.y]:{...a({type:"custom",render:()=>/* @__PURE__ */H(i,{})},"always"),reachedBy:n.keys.x}}}function M(n={}){const t={...Oe,...n.keys},l={keys:t,tabletKeys:Object.fromEntries(Fe.map(e=>[e,h(t[e])])),phoneKeys:Object.fromEntries(Fe.map(e=>[e,m(t[e])])),fallback:{top:0,right:0,bottom:0,left:0,...n.fallback},useFallback:n.useFallback,label:n.label??"Padding",icon:n.icon,min:n.min??0,max:n.max??200,step:n.step??4},r=!1!==n.phone,s=!1===n.group?{}:{_gSpacing:re("Padding")};if(n.object){const t={type:"custom",render:n=>/* @__PURE__ */H(Qe,{say:e,o:l,props:n})};return ae({...s,...r?Te(n.object.key,t,n.object.phone):{[n.object.key]:t}})}const u=r&&!0===n.tablet,c=n=>{const t={type:"custom",render:t=>/* @__PURE__ */H(Ze,{say:e,tier:n,o:l,props:t})};return r?o(n,t):t},d=()=>a({type:"custom",render:()=>/* @__PURE__ */H(i,{})},"always"),p=Fe.filter(e=>"top"!==e);return ae({...s,[l.keys.top]:c("desktop"),...u?{[l.tabletKeys.top]:c("tablet")}:{},...r?{[l.phoneKeys.top]:c("mobile")}:{},...Object.fromEntries(p.map(e=>[l.keys[e],{...d(),reachedBy:l.keys.top}])),...u?Object.fromEntries(p.map(e=>[l.tabletKeys[e],o("tablet",d())])):{},...r?Object.fromEntries(p.map(e=>[l.phoneKeys[e],o("mobile",d())])):{}})}return{slider:n,select:function(n,t,o,a,i){const{note:s,phoneRest:u}="string"==typeof i?{note:i,phoneRest:void 0}:i??{};return{type:"custom",options:o,fallback:a,...s?{note:s}:{},...r({},{type:"select",label:n}),render:i=>{const{value:r,onChange:c,field:d}=i,p=d.options??o,f=d.fallback??a,b=p.some(e=>e.value===r),m="follows"in i,h=m?u?u(i.follows):i.follows:void 0,v=m?p.find(e=>e.value===h)??p.find(e=>e.value===f):void 0,g=b?r:v?.value??f,w=!0===i.readOnly;/* @__PURE__ */
17
+ return H(k,{label:e(n),icon:oe(t),action:m?/* @__PURE__ */H(l,{label:e(n),changed:null!=r&&""!==r,detail:v?q(e,e(v.label),i.followsView):void 0,disabled:w,onReset:()=>c(void 0)}):void 0,children:/* @__PURE__ */H(y,{value:g,ariaLabel:e(n),readOnly:w,onChange:c,options:[...s?[{label:e(s),value:"\0note",disabled:!0}]:[],...p.map(n=>({label:e(n.label),value:n.value}))]})})}}},Segmented:t,segmented:s,boxJustifyField:x,boxAlignField:C,boxWrapField:V,directionField:E,gapField:A,placementField:R,PlacementGridView:function(n){return De(e,n)},positionFields:I,sidesPaddingFields:M,alignmentField:function(e={},n=e.fallback??"left"){return f(e,n)},alignmentFields:function(e="align",n={}){return d(e,f,p,n)},AlignmentStrip:function({opts:e={},value:n,onChange:l,ariaLabel:o,disabled:a=!1}){return t({options:p(e),value:n,onChange:l,ariaLabel:o,disabled:a})},blockAlignmentField:function(e={},n=e.fallback??"left"){return g(e,n)},blockAlignmentFields:function(e="align",n={}){return d(e,g,v,n)},BlockAlignmentStrip:function({opts:e={},value:n,onChange:l,ariaLabel:o,disabled:a=!1}){return t({options:v(e),value:n,onChange:l,ariaLabel:o,disabled:a})},boxFieldSet:function(e={}){const t=e.width??he,l=e.nudge?.limit??40,o=e.direction??{offered:be,fallback:"column"},a=o.resolve??(e=>o.offered.some(n=>n.value===e)?e:o.fallback),i={runs:e=>"row"===a(e)?"row":"column"};return{_gLayout:re("Layout"),placement:R("Placement",e.placement),width:n("Width",/* @__PURE__ */H(S,{}),t.min,t.max,t.step,t.fallback,"%"),direction:E(o),gap:A(e.gap??me),justify:x(i),align:C(i),wrap:V(),_gNudge:re("Nudge"),...I({keys:e.nudge?.keys??{x:"nudgeX",y:"nudgeY"},min:-l,max:l,label:null}),...M(e.padding)}}}}var{slider:on,select:an,Segmented:rn,segmented:sn,boxJustifyField:un,boxAlignField:cn,boxWrapField:dn,directionField:pn,gapField:fn,placementField:bn,PlacementGridView:mn,positionFields:hn,sidesPaddingFields:vn,alignmentField:gn,alignmentFields:yn,AlignmentStrip:wn,blockAlignmentField:kn,blockAlignmentFields:xn,BlockAlignmentStrip:Cn,boxFieldSet:jn}=ln();export{ye as ANCHOR_LABELS,wn as AlignmentStrip,ce as BOX_ALIGN_POINTS,be as BOX_DIRECTIONS,fe as BOX_DIRECTION_LABEL,me as BOX_GAP,ue as BOX_JUSTIFY_POINTS,xe as BOX_NUDGE_LIMIT,ve as BOX_PLACEMENTS,ge as BOX_PLACEMENT_DEFAULT,he as BOX_WIDTH,de as BOX_WRAP_LABEL,pe as BOX_WRAP_POINTS,Cn as BlockAlignmentStrip,Re as FLAT_ACCESS,we as OPEN_PLACEMENT_POINTS,Ie as PHONE_KEY_ACCESS,mn as PlacementGridView,Oe as SIDE_PAD_KEYS,rn as Segmented,nn as SliderControl,We as VIEW_KEY_ACCESS,gn as alignmentField,yn as alignmentFields,kn as blockAlignmentField,xn as blockAlignmentFields,cn as boxAlignField,ln as boxFieldBuilders,jn as boxFieldSet,un as boxJustifyField,dn as boxWrapField,pn as directionField,fn as gapField,re as group,oe as iconOf,le as isNoGlyph,te as noGlyph,ke as normaliseBoxPlacement,Ee as objectAccess,q as onDesktopWords,Be as phoneObjectAccess,Te as phoneTwinFields,bn as placementField,hn as positionFields,je as positionPatch,se as section,sn as segmented,an as select,ae as sharedStyleKinds,Se as sidesFromObject,vn as sidesPaddingFields,Ke as sidesPaddingPatch,Ve as sidesToObject,on as slider,Ae as useAccessPatch,Pe as useAccessValue};
@@ -1,2 +1,2 @@
1
- import{ScreenPartsProvider as t}from"./chunk-DCBUJ36Q.js";import{useEaselHost as e}from"./chunk-LX23TCTP.js";import{createEasel as r,EaselProvider as o}from"./chunk-HGTDDSFJ.js";import{useState as n,useEffect as s}from"react";import{jsx as a}from"react/jsx-runtime";function i({config:i,data:c,onChange:m,permissions:p,parts:f,children:u}){const[d]=n(()=>r({config:i,data:c,permissions:p}));s(()=>{d.setConfig(i)},[d,i]),s(()=>{if(!m)return;let t=d.getState().appState.data,e=!1;return d.subscribe(()=>{const r=d.getState().appState.data;r!==t&&(t=r,(e||r!==d.loaded)&&(e=!0,m(r)))})},[d,m]),s(()=>{p&&d.setPermissions(p)},[d,p]);const h=e();/* @__PURE__ */
1
+ import{ScreenPartsProvider as t}from"./chunk-BDYS3UAD.js";import{useEaselHost as e}from"./chunk-LX23TCTP.js";import{createEasel as r,EaselProvider as o}from"./chunk-NMLAW6FI.js";import{useState as n,useEffect as s}from"react";import{jsx as a}from"react/jsx-runtime";function i({config:i,data:c,onChange:m,permissions:p,parts:f,children:u}){const[d]=n(()=>r({config:i,data:c,permissions:p}));s(()=>{d.setConfig(i)},[d,i]),s(()=>{if(!m)return;let t=d.getState().appState.data,e=!1;return d.subscribe(()=>{const r=d.getState().appState.data;r!==t&&(t=r,(e||r!==d.loaded)&&(e=!0,m(r)))})},[d,m]),s(()=>{p&&d.setPermissions(p)},[d,p]);const h=e();/* @__PURE__ */
2
2
  return a(o,{easel:d,hotkeys:h.ownsDocument,children:/* @__PURE__ */a(t,{parts:f,children:u})})}export{i as ScreenStoreProvider};