efficient-easel 27.0.0 → 27.1.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 (137) hide show
  1. package/dist/blocks/index.d.ts +1 -1
  2. package/dist/canvas/index.d.ts +2 -1
  3. package/dist/canvas/index.js +1 -1
  4. package/dist/chrome/index.js +1 -1
  5. package/dist/{chunk-PVBDKBJB.js → chunk-2EEYFRQM.js} +1 -1
  6. package/dist/{chunk-TYTMUHUK.js → chunk-3FANFZ4D.js} +1 -1
  7. package/dist/{chunk-CWELHADJ.js → chunk-3OOYGEJY.js} +1 -1
  8. package/dist/{chunk-JIP5JNRB.js → chunk-5HYVOOH3.js} +1 -1
  9. package/dist/chunk-6GJEOER4.js +1 -0
  10. package/dist/{chunk-6ATIYLUL.js → chunk-6V6LC7QV.js} +1 -1
  11. package/dist/{chunk-KO47WAWR.js → chunk-7YXWWMBM.js} +1 -1
  12. package/dist/{chunk-GR3XRILS.js → chunk-A5USZ6Z6.js} +1 -1
  13. package/dist/{chunk-Y2T3JX7K.js → chunk-ANBPE45L.js} +1 -1
  14. package/dist/{chunk-KFWNGPW3.js → chunk-C63IB4VW.js} +5 -5
  15. package/dist/chunk-DTEYSPJE.js +64 -0
  16. package/dist/{chunk-YYD257TD.js → chunk-G7J6SGMF.js} +1 -1
  17. package/dist/chunk-GJ427TZL.js +8 -0
  18. package/dist/chunk-J5VPNHOW.js +1 -0
  19. package/dist/{chunk-QZJKWKGH.js → chunk-JUJEVGLY.js} +1 -1
  20. package/dist/chunk-L36E2WCO.js +19 -0
  21. package/dist/chunk-LAJYMOY3.js +1 -0
  22. package/dist/{chunk-K53PQAMP.js → chunk-LDHUPZBK.js} +1 -1
  23. package/dist/{chunk-SBVIW3KJ.js → chunk-MTWQYLJE.js} +1 -1
  24. package/dist/chunk-OB4KI2AN.js +2 -0
  25. package/dist/{chunk-W3UZNKGS.js → chunk-P3HXHLES.js} +4 -4
  26. package/dist/{chunk-3XECMGXX.js → chunk-QEEW4X64.js} +1 -1
  27. package/dist/{chunk-AAZIMKLQ.js → chunk-QPNNWQ24.js} +1 -1
  28. package/dist/{chunk-BFJAEQZ6.js → chunk-RTMDZJNE.js} +1 -1
  29. package/dist/chunk-SDSBXW3V.js +26 -0
  30. package/dist/chunk-SEC6NV6Y.js +18 -0
  31. package/dist/{chunk-5JNVMCCB.js → chunk-SEH3Q3EL.js} +1 -1
  32. package/dist/{chunk-QTHQPJWA.js → chunk-TF6NAIV7.js} +1 -1
  33. package/dist/{chunk-6EDVZBUO.js → chunk-TQUEVJOO.js} +1 -1
  34. package/dist/{chunk-2262JGFV.js → chunk-TUIBPB77.js} +5 -5
  35. package/dist/chunk-UMTUKSE6.js +1 -0
  36. package/dist/chunk-VNUXFD4X.js +1 -0
  37. package/dist/{chunk-VBEVZZTV.js → chunk-VTY7OQB5.js} +11 -11
  38. package/dist/{chunk-76MUJIZE.js → chunk-WL57KM5C.js} +17 -17
  39. package/dist/{chunk-NTG5ODKZ.js → chunk-WW24O7HT.js} +1 -1
  40. package/dist/{chunk-ZFEAWEFS.js → chunk-XESNAMI3.js} +3 -3
  41. package/dist/chunk-XT75WETI.js +1 -0
  42. package/dist/{chunk-YES5F7OS.js → chunk-XV5D4V2T.js} +1 -1
  43. package/dist/chunk-YDTEYXQW.js +1 -0
  44. package/dist/copy/index.js +11 -11
  45. package/dist/data/index.d.ts +2 -1
  46. package/dist/data/index.js +1 -1
  47. package/dist/drag/index.js +1 -1
  48. package/dist/easel/index.d.ts +1 -1
  49. package/dist/easel/index.js +1 -1
  50. package/dist/edit-lock/index.js +1 -1
  51. package/dist/fields/fields.css +8 -0
  52. package/dist/fields/index.d.ts +47 -3
  53. package/dist/fields/index.js +1 -1
  54. package/dist/node-ops/index.js +1 -1
  55. package/dist/phone-order-CRKvsTsz.d.ts +141 -0
  56. package/dist/screen/components/AddBlockRow.js +1 -1
  57. package/dist/screen/components/AddSidePanel.d.ts +1 -1
  58. package/dist/screen/components/AddSidePanel.js +1 -1
  59. package/dist/screen/components/NodeContextMenu.d.ts +1 -1
  60. package/dist/screen/components/NodeContextMenu.js +1 -1
  61. package/dist/screen/components/PageEditGuardNotices.js +1 -1
  62. package/dist/screen/components/SaveControls.d.ts +1 -1
  63. package/dist/screen/components/SaveControls.js +1 -1
  64. package/dist/screen/components/ScreenChrome.js +1 -1
  65. package/dist/screen/components/ScreenDocumentContext.d.ts +1 -1
  66. package/dist/screen/components/ScreenDocumentContext.js +1 -1
  67. package/dist/screen/components/ScreenMount.d.ts +1 -1
  68. package/dist/screen/components/ScreenMount.js +1 -1
  69. package/dist/screen/components/ScreenStoreProvider.d.ts +1 -1
  70. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  71. package/dist/screen/components/SectionScreenShell.js +17 -17
  72. package/dist/screen/components/SidePanelHead.js +1 -1
  73. package/dist/screen/components/panel-widths.js +1 -1
  74. package/dist/screen/components/usePartBridge.d.ts +1 -1
  75. package/dist/screen/components/usePartBridge.js +1 -1
  76. package/dist/screen/index.d.ts +1 -1
  77. package/dist/screen/index.js +1 -1
  78. package/dist/screen/lib/admin-bridge.d.ts +1 -1
  79. package/dist/screen/lib/document/block-set-host.js +1 -1
  80. package/dist/screen/lib/document/block-size-fields.d.ts +1 -1
  81. package/dist/screen/lib/document/block-size-fields.js +1 -1
  82. package/dist/screen/lib/document/block-types-in.js +1 -1
  83. package/dist/screen/lib/document/box-fields.d.ts +1 -1
  84. package/dist/screen/lib/document/box-fields.js +1 -1
  85. package/dist/screen/lib/document/button-fields.d.ts +1 -1
  86. package/dist/screen/lib/document/button-fields.js +1 -1
  87. package/dist/screen/lib/document/image-fields.d.ts +1 -1
  88. package/dist/screen/lib/document/image-fields.js +5 -5
  89. package/dist/screen/lib/document/palette-sections.d.ts +1 -1
  90. package/dist/screen/lib/document/section-doc.d.ts +1 -1
  91. package/dist/screen/lib/document/section-doc.js +1 -1
  92. package/dist/screen/lib/document/shadow-fields.d.ts +1 -1
  93. package/dist/screen/lib/document/shadow-fields.js +2 -2
  94. package/dist/screen/lib/document/style-clipboard.d.ts +1 -1
  95. package/dist/screen/lib/document/style-clipboard.js +1 -1
  96. package/dist/screen/lib/document/style-fields.d.ts +1 -1
  97. package/dist/screen/lib/document/style-fields.js +1 -1
  98. package/dist/screen/lib/document/use-section-ops.d.ts +1 -1
  99. package/dist/screen/lib/document/use-section-ops.js +1 -1
  100. package/dist/screen/lib/document-addressing.d.ts +1 -1
  101. package/dist/screen/lib/document-hooks.d.ts +1 -1
  102. package/dist/screen/lib/document-switch.js +1 -1
  103. package/dist/screen/lib/failure.js +1 -1
  104. package/dist/screen/lib/host-inbound.js +1 -1
  105. package/dist/screen/lib/host.d.ts +1 -1
  106. package/dist/screen/lib/key-scope.js +1 -1
  107. package/dist/screen/lib/media-panel.d.ts +1 -1
  108. package/dist/screen/lib/media-picker.d.ts +1 -1
  109. package/dist/screen/lib/media-picker.js +1 -1
  110. package/dist/screen/lib/page-lock.d.ts +1 -1
  111. package/dist/screen/lib/page-lock.js +1 -1
  112. package/dist/screen/lib/screen-parts.d.ts +1 -1
  113. package/dist/screen/lib/screen-parts.js +1 -1
  114. package/dist/screen/lib/section-templates.d.ts +1 -1
  115. package/dist/screen/lib/session-context.d.ts +1 -1
  116. package/dist/screen/lib/session.d.ts +1 -1
  117. package/dist/screen/lib/shared-sections.d.ts +1 -1
  118. package/dist/strings/index.d.ts +1 -1
  119. package/dist/strings/index.js +2 -2
  120. package/dist/style-clipboard/index.js +1 -1
  121. package/dist/text-styles/index.js +27 -27
  122. package/dist/{words-CFkb8XtN.d.ts → words-dNm6REMa.d.ts} +21 -0
  123. package/package.json +1 -1
  124. package/dist/chunk-3W2O22DZ.js +0 -19
  125. package/dist/chunk-5OWAV3MH.js +0 -1
  126. package/dist/chunk-DAKKPW2Z.js +0 -1
  127. package/dist/chunk-EUFDQ4KL.js +0 -1
  128. package/dist/chunk-FW35PCK7.js +0 -1
  129. package/dist/chunk-HG65R6IN.js +0 -20
  130. package/dist/chunk-JACEEVVF.js +0 -1
  131. package/dist/chunk-JQQFB7EZ.js +0 -1
  132. package/dist/chunk-L2WK5JYB.js +0 -2
  133. package/dist/chunk-L7PSERQH.js +0 -8
  134. package/dist/chunk-O4OWODU2.js +0 -64
  135. package/dist/chunk-SQTVXE5D.js +0 -18
  136. package/dist/chunk-TOKMFZPB.js +0 -1
  137. package/dist/resolve-Bz4mszpL.d.ts +0 -57
@@ -1,4 +1,4 @@
1
- import{useAccessPatch as e,FLAT_ACCESS as o,onDesktopWords as r,useAccessValue as s}from"./chunk-76MUJIZE.js";import{CornersInput as l,BorderInput as t,SettingsColour as n}from"./chunk-XWTQTANN.js";import{SettingsDefaultReset as i}from"./chunk-2T22IY3J.js";import{noControlField as c,NoControlMark as a}from"./chunk-22I55W37.js";import{normalizeCornerSides as d,CORNER_SIDES as u}from"./chunk-PLTTPHK5.js";import{DEFAULT_PANEL_WORDS as y,DEFAULT_COLOUR_ROW_WORDS as p}from"./chunk-56ID6FKZ.js";import{viewFollows as f}from"./chunk-DIOTWSCO.js";import{SettingsField as h}from"./chunk-MIX7EGRG.js";import{useWords as w}from"./chunk-MFIRYGHW.js";import{CornerIcon as m,BorderAllIcon as b}from"efficient-shell/icons/efficient";import{jsx as g}from"react/jsx-runtime";var v=e=>e;function k(e,o){const r=o.twinAccess;return r?{key:e.key,access:r,ownField:r.ownField}:e}function j(e,r){const l=!e.access||e.ownField?{value:r.value,onChange:r.onChange}:void 0;return s(e.access??o,e.key,l)}function F(e,r){return s(e.access??o,r??"")}function C(e){return{...c({type:"custom",render:()=>/* @__PURE__ */g(a,{})},"always"),reachedBy:e}}function O({o:s,say:l,props:t}){const i=w("colourRow",p),c=w("panel",y),a=s.useFollows(),d=s.usePresets?.(),u=s.opacity?.useUnset?.()??100,f=k(s,t),[h,m]=j(f,t),[b,v]=F(f,s.opacity?.key),C=e(f.access??o),O="string"==typeof h?h:"",B="number"==typeof b,T="follows"in t,A=(T&&"string"==typeof t.follows&&""!==t.follows?t.follows:void 0)??a,x=s.access||T?void 0:"";/* @__PURE__ */
1
+ import{useAccessPatch as e,FLAT_ACCESS as o,onDesktopWords as r,useAccessValue as s}from"./chunk-WL57KM5C.js";import{CornersInput as l,BorderInput as t,SettingsColour as n}from"./chunk-XWTQTANN.js";import{SettingsDefaultReset as i}from"./chunk-2T22IY3J.js";import{noControlField as c,NoControlMark as a}from"./chunk-22I55W37.js";import{normalizeCornerSides as d,CORNER_SIDES as u}from"./chunk-PLTTPHK5.js";import{DEFAULT_PANEL_WORDS as y,DEFAULT_COLOUR_ROW_WORDS as p}from"./chunk-56ID6FKZ.js";import{viewFollows as f}from"./chunk-DIOTWSCO.js";import{SettingsField as h}from"./chunk-MIX7EGRG.js";import{useWords as w}from"./chunk-MFIRYGHW.js";import{CornerIcon as m,BorderAllIcon as b}from"efficient-shell/icons/efficient";import{jsx as g}from"react/jsx-runtime";var v=e=>e;function k(e,o){const r=o.twinAccess;return r?{key:e.key,access:r,ownField:r.ownField}:e}function j(e,r){const l=!e.access||e.ownField?{value:r.value,onChange:r.onChange}:void 0;return s(e.access??o,e.key,l)}function F(e,r){return s(e.access??o,r??"")}function C(e){return{...c({type:"custom",render:()=>/* @__PURE__ */g(a,{})},"always"),reachedBy:e}}function O({o:s,say:l,props:t}){const i=w("colourRow",p),c=w("panel",y),a=s.useFollows(),d=s.usePresets?.(),u=s.opacity?.useUnset?.()??100,f=k(s,t),[h,m]=j(f,t),[b,v]=F(f,s.opacity?.key),C=e(f.access??o),O="string"==typeof h?h:"",B="number"==typeof b,T="follows"in t,A=(T&&"string"==typeof t.follows&&""!==t.follows?t.follows:void 0)??a,x=s.access||T?void 0:"";/* @__PURE__ */
2
2
  return g(n,{label:l(s.label),icon:s.icon,hint:s.hint,value:O,onChange:e=>m(""===e?x:e),inherited:A,presets:d,changed:""!==O||B,onReset:()=>{B&&s.opacity?C([[s.key,x],[s.opacity.key,void 0]]):m(x)},resetTo:T?r(l,A.toUpperCase(),t.followsView):s.resetTo?s.resetTo(a.toUpperCase()):a.toUpperCase(),...s.opacity?{opacity:B?b:u,onOpacityChange:e=>v(e)}:{},readOnly:t.readOnly,words:i,resetWords:c})}var B=20;function T({o:e,say:o,props:s}){const l=e.useFollows(),[n,c]=j(k(e,s),s),a=n&&"object"==typeof n?n:{},d="follows"in s,u=d&&s.follows&&"object"==typeof s.follows?s.follows:{},y="number"==typeof u.width?u.width:l.width,p="string"==typeof u.color&&""!==u.color?u.color:l.color,f=Object.keys(a).length>0,w={width:o("Border width"),sides:{top:o("Border top"),right:o("Border right"),bottom:o("Border bottom"),left:o("Border left")},style:o("Border style"),styles:{solid:o("Solid"),dashed:o("Dashed"),dotted:o("Dotted")},color:o("Border color"),unit:"px"};/* @__PURE__ */
3
- return g(h,{label:o("Border"),icon:/* @__PURE__ */g(b,{}),action:d?/* @__PURE__ */g(i,{label:o("Border"),changed:f,detail:r(o,`${y}px`,s.followsView),disabled:s.readOnly,onReset:()=>c(void 0)}):void 0,children:/* @__PURE__ */g(t,{label:o("Border"),value:a,each:!1,onChange:o=>c(function(e){const o=Object.fromEntries(Object.entries(e).filter(([,e])=>null!=e&&""!==e));return Object.keys(o).length?o:void 0}(e.styles?{width:o.width,color:o.color,style:o.style}:{width:o.width,color:o.color})),placeholder:{sides:{top:y,right:y,bottom:y,left:y},style:u.style??"solid",color:p},presets:[p],words:w,styles:e.styles??!1,max:20,readOnly:s.readOnly})})}var A=40,x=()=>null;function I({o:s,say:t,props:n}){const c=w("panel",y),a=s.useFollows(),p=(s.useFollowsSides??x)(),b=k(s,n),[v,C]=j(b,n),[O,B]=F(b,s.sidesKey),[T]=F(s,s.sidesKey),[A]=F({key:s.key,access:n.widerAccess},n.widerAccess?s.sidesKey:void 0),I=e(b.access??o),R="follows"in n,K=s.access||R?void 0:null,M=R&&"number"==typeof n.follows?n.follows:a,S="number"==typeof v&&Number.isFinite(v)?v:null,U=(R?f(d(T),d(A)):null)??d(p)??[...u],W=d(O)??U,D=[{value:"tl",label:t("Top left")},{value:"tr",label:t("Top right")},{value:"bl",label:t("Bottom left")},{value:"br",label:t("Bottom right")}];/* @__PURE__ */
4
- return g(h,{label:t("Corners"),icon:/* @__PURE__ */g(m,{}),changed:null!==S||Array.isArray(O),action:/* @__PURE__ */g(i,{label:t("Corners"),changed:null!==S||Array.isArray(O),detail:R?r(t,`${M}px`,n.followsView):`${M}px`,disabled:n.readOnly,onReset:()=>Array.isArray(O)?I([[s.key,K],[s.sidesKey,K]]):C(K),words:c}),children:/* @__PURE__ */g(l,{label:t("Corners"),value:W,corners:D,onChange:e=>{const o=u.filter(o=>e.includes(o)),r=o.length===U.length&&o.every(e=>U.includes(e));B(r?K:o)},radius:S,onRadiusChange:e=>C(e??K),radiusMin:0,radiusMax:40,radiusStep:s.step??1,radiusPlaceholder:String(M),disabled:n.readOnly})})}function R(e=v){return{colourField:o=>({type:"custom",render:r=>/* @__PURE__ */g(O,{o:o,say:e,props:r})}),borderField:o=>({type:"custom",render:r=>/* @__PURE__ */g(T,{o:o,say:e,props:r})}),cornersField:o=>({type:"custom",render:r=>/* @__PURE__ */g(I,{o:o,say:e,props:r})})}}var{colourField:K,borderField:M,cornersField:S}=R();export{B as BORDER_WIDTH_MAX,A as CORNER_RADIUS_MAX,M as borderField,K as colourField,S as cornersField,C as keptByRow,R as styleFieldBuilders};
3
+ return g(h,{label:o("Border"),icon:/* @__PURE__ */g(b,{}),action:d?/* @__PURE__ */g(i,{label:o("Border"),changed:f,detail:r(o,`${y}px`,s.followsView),disabled:s.readOnly,onReset:()=>c(void 0)}):void 0,children:/* @__PURE__ */g(t,{label:o("Border"),value:a,each:!1,onChange:o=>c(function(e){const o=Object.fromEntries(Object.entries(e).filter(([,e])=>null!=e&&""!==e));return Object.keys(o).length?o:void 0}(e.styles?{width:o.width,color:o.color,style:o.style}:{width:o.width,color:o.color})),placeholder:{sides:{top:y,right:y,bottom:y,left:y},style:u.style??"solid",color:p},presets:[p],words:w,styles:e.styles??!1,max:20,readOnly:s.readOnly})})}var A=40,x=()=>null;function K({o:s,say:t,props:n}){const c=w("panel",y),a=s.useFollows(),p=(s.useFollowsSides??x)(),b=k(s,n),[v,C]=j(b,n),[O,B]=F(b,s.sidesKey),[T]=F(s,s.sidesKey),[A]=F({key:s.key,access:n.widerAccess},n.widerAccess?s.sidesKey:void 0),K=e(b.access??o),R="follows"in n,I=s.access||R?void 0:null,W=R&&"number"==typeof n.follows?n.follows:a,M="number"==typeof v&&Number.isFinite(v)?v:null,S=(R?f(d(T),d(A)):null)??d(p)??[...u],D=d(O)??S,P=[{value:"tl",label:t("Top left")},{value:"tr",label:t("Top right")},{value:"bl",label:t("Bottom left")},{value:"br",label:t("Bottom right")}];/* @__PURE__ */
4
+ return g(h,{label:t("Corners"),icon:/* @__PURE__ */g(m,{}),changed:null!==M||Array.isArray(O),action:/* @__PURE__ */g(i,{label:t("Corners"),changed:null!==M||Array.isArray(O),detail:R?r(t,`${W}px`,n.followsView):`${W}px`,disabled:n.readOnly,onReset:()=>Array.isArray(O)?K([[s.key,I],[s.sidesKey,I]]):C(I),words:c}),children:/* @__PURE__ */g(l,{label:t("Corners"),value:D,corners:P,onChange:e=>{const o=u.filter(o=>e.includes(o)),r=o.length===S.length&&o.every(e=>S.includes(e));B(r?I:o)},radius:M,onRadiusChange:e=>C(e??I),radiusMin:0,radiusMax:40,radiusStep:s.step??1,radiusPlaceholder:String(W),disabled:n.readOnly})})}function R(e=v){return{colourField:o=>({type:"custom",render:r=>/* @__PURE__ */g(O,{o:o,say:e,props:r})}),borderField:o=>({type:"custom",render:r=>/* @__PURE__ */g(T,{o:o,say:e,props:r})}),cornersField:o=>({type:"custom",render:r=>/* @__PURE__ */g(K,{o:o,say:e,props:r})})}}var{colourField:I,borderField:W,cornersField:M}=R();export{B as BORDER_WIDTH_MAX,A as CORNER_RADIUS_MAX,W as borderField,I as colourField,M as cornersField,C as keptByRow,R as styleFieldBuilders};
@@ -0,0 +1 @@
1
+ import{parseZoneKey as t}from"./chunk-YDTEYXQW.js";import{repeatWrapperAt as e,REPEAT_ATTRIBUTE as r,REPEAT_INDEX_ATTRIBUTE as n}from"./chunk-7UFKEX72.js";var o=`[${r}][${n}]`;function l(l){const c=e(l);if(!c)return null;let i;try{i=t(c.zone)}catch{return null}if(!i.parentId||!i.slot)return null;const{wrapper:a,zone:p,index:f}=c;let s=a.parentElement;for(let t=a.parentElement;t;t=t.parentElement)if(t.getAttribute("data-easel-block")===i.parentId){s=t;break}const d=/* @__PURE__ */new Set;for(const t of Array.from(s?.querySelectorAll(o)??[]))t.getAttribute(r)===p&&d.add(t.getAttribute(n)??"");const m={ownerId:i.parentId,slot:i.slot,index:f,count:Math.max(d.size,f+1)},y=a.parentElement?u(a.parentElement):null;return y&&(m.outer=y),{copy:m,wrapper:a}}function u(t){return l(t)?.copy??null}function c(t,e){return t&&e?t.ownerId===e.ownerId&&t.slot===e.slot&&t.index===e.index&&c(t.outer,e.outer):t===e}function i(t,e){for(const r of Array.from(t.querySelectorAll(o))){if(r.getAttribute(n)!==String(e.index))continue;const t=l(r);if(t?.wrapper===r&&c(t.copy,e))return r}return null}export{i as findCopy,u as repeatCopyAt,l as repeatCopyWithWrapper};
@@ -1 +1 @@
1
- import{useScreenDocument as n}from"./chunk-L2WK5JYB.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-G2VZ4DET.js";import{EditNotice as r}from"./chunk-VBEVZZTV.js";import{useWords as e}from"./chunk-MFIRYGHW.js";import{jsx as i}from"react/jsx-runtime";function t(){const{capabilities:t,access:c,takeOverEditing:a,viewReadOnly:s,saveConflict:m,reloadFromServer:u}=n(),{noun:l}=e("screen",o);return t.hasEditGuard?/* @__PURE__ */i(r,{access:c,conflict:m,noun:l,onTakeOver:a,onViewReadOnly:s,onReload:u}):null}export{t as PageEditGuardNotices};
1
+ import{useScreenDocument as n}from"./chunk-OB4KI2AN.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-G2VZ4DET.js";import{EditNotice as r}from"./chunk-VTY7OQB5.js";import{useWords as e}from"./chunk-MFIRYGHW.js";import{jsx as i}from"react/jsx-runtime";function t(){const{capabilities:t,access:c,takeOverEditing:a,viewReadOnly:s,saveConflict:m,reloadFromServer:u}=n(),{noun:l}=e("screen",o);return t.hasEditGuard?/* @__PURE__ */i(r,{access:c,conflict:m,noun:l,onTakeOver:a,onViewReadOnly:s,onReload:u}):null}export{t as PageEditGuardNotices};
@@ -0,0 +1 @@
1
+ import{isRecord as t,fieldsFrom as n,blockOf as o,topLevelSlotKeys as e,slotLocations as r,setIn as s,fieldsOf as i,isNode as c,defaultsFrom as p}from"./chunk-KXM6YRG2.js";var f=()=>({lastChange:{}});function a(t,n){if(t===n)return!0;if(!t||!n||"object"!=typeof t||"object"!=typeof n)return t!=t&&n!=n;if(Array.isArray(t)!==Array.isArray(n))return!1;if(Array.isArray(t)){const o=n;if(t.length!==o.length)return!1;for(let n=0;n<t.length;n++)if(!a(t[n],o[n]))return!1;return!0}const o=Object.keys(t),e=Object.keys(n);if(o.length!==e.length)return!1;for(const e of o){if(!Object.prototype.hasOwnProperty.call(n,e))return!1;if(!a(t[e],n[e]))return!1}return!0}function l(t,n){if(!t)return{};const o=t.props??{},e=n?.props??{},r={};for(const t of Object.keys(o))r[t]=!a(e[t],o[t]);return r}async function u(i,c,p={}){const{metadata:d={},trigger:h="replace",cache:y=f(),onResolveStart:g,onResolveEnd:m}=p,b=function(t,n){return t.type&&"root"!==t.type?n.components[t.type]:n.root}(i,c);let w={...i};const v=Boolean(b?.resolveData&&i.props),j=t(i.props)&&"id"in i.props?String(i.props.id):"root";if(v){const t=y.lastChange[j];if("force"!==h&&t&&a(i,t.item))return{node:t.resolved,didChange:!1};const n=l(i,t?.item??null);g?.(i);const o=await b.resolveData(i,{changed:n,lastData:t?.item??null,metadata:{...d,...b.metadata??{}},trigger:h})??{};w.props={...i.props,...o.props??{}},o.readOnly&&Object.keys(o.readOnly).length&&(w.readOnly=o.readOnly)}const $=n(i.type&&"root"!==i.type?o(c,i.type):c.root);if(b)for(const t of e($))void 0===w.props[t]&&(w={...w,props:{...w.props,[t]:[]}});for(const t of r(w.props,$)){if(!t.present)continue;const n=await Promise.all(t.content.map(async t=>(await u(t,c,{metadata:d,trigger:h,cache:y,onResolveStart:g,onResolveEnd:m})).node));w={...w,props:s(w.props,t.segments,n)}}return v&&m?.(w),y.lastChange[j]={item:i,resolved:w},{node:w,didChange:!a(i,w)}}var d="root";function h(t){if(void 0===t)return"u";if("string"==typeof t)return`s${t.length.toString(36)}.${y(t)}`;const n=g(t);return`j${n.length.toString(36)}.${y(n)}`}function y(t){let n=2166136261;for(let o=0;o<t.length;o++)n^=t.charCodeAt(o),n=Math.imul(n,16777619);return(n>>>0).toString(36)}function g(t){if(null===t||"object"!=typeof t)return JSON.stringify(t)??"null";if(Array.isArray(t))return`[${t.map(g).join(",")}]`;const n=t;return`{${Object.keys(n).filter(t=>void 0!==n[t]).sort().map(t=>`${JSON.stringify(t)}:${g(n[t])}`).join(",")}}`}var m=(t,n)=>Object.prototype.hasOwnProperty.call(t,n);function b(t,n){return t&&m(t,n)?t[n]:void 0}var w=t=>Object.keys(t).length>0,v=n=>t(n)&&"string"==typeof n.src&&void 0!==n.v,j=t=>null==t||"string"==typeof t&&""===t.trim(),$=t=>"text"===t||"textarea"===t,O=(t,n)=>"boolean"==typeof t.translatable?t.translatable:n;function k(n,o){const e=b(n,o);return t(e)?e:void 0}function A(t,n){const o=[];return x(t,n,[],[],[],void 0,o),o}function x(n,o,e,r,s,i,c){for(const p of Object.keys(o)){const f=o[p];if(!f||"slot"===f.type)continue;if(0===e.length&&"id"===p)continue;const a=[...e,p],l=[...r,p],u=b(n,p),d=O(f,i);if("object"===f.type&&f.objectFields)null==u?x({},f.objectFields,a,l,s,d,c):t(u)&&x(u,f.objectFields,a,l,s,d,c);else if("array"===f.type&&f.arrayFields){if(!Array.isArray(u))continue;const n=f.arrayFields;u.forEach((o,e)=>{t(o)&&x(o,n,[...a,e],[...l,"*"],[...s,e],d,c)})}else(d??$(f.type))&&c.push({path:a.join("."),segments:a,pattern:l.join("."),indices:s,value:u})}}function I(t,n){const o=t.split("."),e=[],r=[];let s,i=n,c=0;for(;c<o.length;){const t=b(i,o[c]);if(!t||"slot"===t.type)return null;if(0===c&&"id"===o[c])return null;e.push(o[c]),c+=1;const n=O(t,s);if("object"===t.type&&t.objectFields)i=t.objectFields,s=n;else{if("array"!==t.type||!t.arrayFields)return c!==o.length?null:n??$(t.type)?{pattern:e.join("."),indices:r}:null;{const p=o[c];if(void 0===p||!/^(0|[1-9]\d*)$/.test(p))return null;r.push(Number(p)),e.push("*"),c+=1,i=t.arrayFields,s=n}}}return null}function z(n,o){return A(t(n?.props)?n.props:{},i(o,n?.type??d)).map(({path:t,value:n})=>({path:t,value:n}))}function S(t,n,o){const e=A(t,n),r=/* @__PURE__ */new Map,s=[],i=[];if(!o)return{positions:e,hits:r,orphans:s,beaten:i};const c=/* @__PURE__ */new Map;for(const t of e)c.set(t.path,t);const p=/* @__PURE__ */new Map,f=t=>{let n=p.get(t);return void 0===n&&(n=h(t.value),p.set(t,n)),n},a=[];for(const t of Object.keys(o)){const e=o[t],p=c.get(t);if(!v(e)){(p?i:s).push(t);continue}if(p&&f(p)===e.src){r.set(t,{position:p,entry:e,from:t,stale:!1,applied:!0});continue}const l=p??I(t,n);l?l.indices.length>0?a.push({path:t,entry:e,own:p,pattern:l.pattern,indices:l.indices}):p?r.set(t,{position:p,entry:e,from:t,stale:!0,applied:!0}):s.push(t):s.push(t)}a.sort((t,n)=>function(t,n){const o=Math.min(t.length,n.length);for(let e=0;e<o;e++)if(t[e]!==n[e])return t[e]-n[e];return t.length-n.length}(t.indices,n.indices)||(t.path<n.path?-1:t.path>n.path?1:0));const l=[];for(const t of a){let n,o=-1;for(const s of e){if(s.pattern!==t.pattern||r.has(s.path))continue;if(f(s)!==t.entry.src)continue;const e=N(s.indices,t.indices);e>o&&(n=s,o=e)}n?r.set(n.path,{position:n,entry:t.entry,from:t.path,stale:!1,applied:!0}):l.push(t)}for(const t of l)t.own?r.has(t.path)?i.push(t.path):r.set(t.path,{position:t.own,entry:t.entry,from:t.path,stale:!0,applied:!1}):s.push(t.path);return{positions:e,hits:r,orphans:s,beaten:i}}function N(t,n){let o=0;for(;o<t.length&&o<n.length&&t[o]===n[o];)o+=1;return o}function F(n,o,e){const p=t=>{if(!Array.isArray(t))return t;let n=null;return t.forEach((o,r)=>{if(!c(o))return;const s=f(e(o.props.id,o.type,o.props),o.type);s!==o.props&&(n??=[...t],n[r]={...o,props:s})}),n??t},f=(t,n)=>{let e=t;for(const c of r(t,i(o,n))){if(!c.present)continue;const t=p(c.content);t!==c.content&&(e=s(e,c.segments,t))}return e};let a=n;const l=t(n.root?.props)?n.root.props:{},u=e(d,d,l),h=p(n.content);h!==n.content&&(a={...a,content:h});const y=f(u,d);y!==l&&(a={...a,root:{...a.root,props:y}});const g=n.zones;if(t(g)){let t=g;for(const n of Object.keys(g)){if(-1===n.indexOf(":"))continue;const o=p(g[n]);o!==g[n]&&(t={...t,[n]:o})}t!==g&&(a={...a,zones:t})}return a}function M(t,n){const o=/* @__PURE__ */new Map;return F(t,n,(t,n,e)=>(o.has(t)||o.set(t,{type:n,props:e}),e)),o}function E(t,n,o){return o&&w(o)?F(t,n,(t,e,r)=>{const c=k(o,t);if(!c)return r;const p=S(r,i(n,e),c);let f=r;for(const t of p.positions){const n=p.hits.get(t.path);n&&n.applied&&!a(t.value,n.entry.v)&&(f=s(f,t.segments,n.entry.v))}return f}):t}function D(t,n,o){const e={total:0,missing:[],stale:[]};return F(t,n,(t,r,s)=>{const c=S(s,i(n,r),k(o,t));for(const n of c.positions){const o=c.hits.get(n.path);!o&&j(n.value)||(e.total+=1,o?o.stale&&e.stale.push({id:t,path:n.path}):e.missing.push({id:t,path:n.path}))}return s}),e}function C(n,o){let e=n;for(let n=0;n<o.length-1;n++){const r=o[n];if("number"==typeof r){if(!Array.isArray(e)||r>=e.length)return{held:!1,value:void 0};e=e[r]}else{if(!t(e))return{held:!1,value:void 0};e=b(e,r)}}return t(e)?{held:!0,value:b(e,String(o[o.length-1]))}:{held:!1,value:void 0}}function R(n,e,r,s){const c=M(e,r),p={},f=/* @__PURE__ */new Set;if(F(n,r,(t,n,e)=>{if(f.has(t))return e;f.add(t);const l=k(s,t),u=c.get(t);if(!u||u.type!==n||!o(r,n))return l&&(p[t]=l),e;const d=S(e,i(r,n),l),y={};for(const t of d.positions){const n=d.hits.get(t.path),{held:o,value:e}=C(u.props,t.segments),r=n&&n.applied?n.entry.v:t.value;!o||void 0!==e&&a(e,r)?n&&(y[t.path]=n.entry):void 0===e||a(e,t.value)||(y[t.path]={v:e,src:h(t.value)})}if(l)for(const t of d.orphans)m(y,t)||(y[t]=l[t]);return w(y)&&(p[t]=l&&J(y,l)?l:y),e}),!s)return p;for(const n of Object.keys(s))f.has(n)||m(p,n)||!t(s[n])||(p[n]=s[n]);return J(p,s)?s:p}function J(t,n){const o=Object.keys(t);return o.length===Object.keys(n).length&&o.every(o=>m(n,o)&&t[o]===n[o])}function P(t,n,e){const r={},s=/* @__PURE__ */new Set;let c=!1;F(t,n,(t,p,f)=>{if(m(r,t))return f;const a=k(e,t);if(!o(n,p))return U(f,s),a&&(r[t]=a),f;if(!a)return f;const l=function(t,n){let o=0===t.orphans.length&&0===t.beaten.length;const e={};for(const n of t.positions){const r=t.hits.get(n.path);r&&(e[n.path]=r.entry,r.from!==n.path&&(o=!1))}return o?n:e}(S(f,i(n,p),a),a);return l!==a&&(c=!0),w(l)&&(r[t]=l),f});for(const t of s){const n=k(e,t);n&&!m(r,t)&&(r[t]=n)}return c||Object.keys(r).length!==Object.keys(e).length?r:e}function U(n,o){if(Array.isArray(n))for(const t of n)U(t,o);else if(t(n)){c(n)&&"string"==typeof n.props.id&&o.add(n.props.id);for(const t of Object.keys(n))U(n[t],o)}}function B(n,e,r,s){if(!t(s)||!w(s))return s;const c=M(e,r),p=/* @__PURE__ */new Map;if(F(n,r,(t,n,e)=>{if(p.has(t))return e;const f=k(s,t),a=c.get(t);if(!f||!a||a.type!==n||!o(r,n))return e;const l=function(t,n,o,e){const r=S(t,o,e),s=/* @__PURE__ */new Map,i=/* @__PURE__ */new Map;G(t,n,o,"","",void 0,s,i);const c={};let p=0===r.beaten.length;for(const t of r.positions){const n=r.hits.get(t.path);if(!n)continue;const o=s.get(t.path)?.[0];void 0!==o?(c[o]=n.entry,o!==n.from&&(p=!1)):p=!1}for(const t of r.positions){const n=r.hits.get(t.path);if(n)for(const o of i.get(t.path)??[])m(c,o)||(c[o]=n.entry,p=!1)}for(const t of[...r.orphans].sort())m(c,t)?p=!1:c[t]=e[t];return p?e:c}(e,a.props,i(r,n),f);return l!==f&&p.set(t,l),e}),0===p.size)return s;const f={};for(const t of Object.keys(s)){const n=p.get(t);n?w(n)&&(f[t]=n):f[t]=s[t]}return f}function G(n,o,e,r,s,i,c,p){for(const f of Object.keys(e)){const a=e[f];if(!a||"slot"===a.type)continue;if(""===r&&"id"===f)continue;const l=""===r?f:`${r}.${f}`,u=""===s?f:`${s}.${f}`,d=b(n,f),h=b(o,f),y=O(a,i);if("object"===a.type&&a.objectFields){if(null!=d&&!t(d))continue;G(t(d)?d:{},t(h)?h:{},a.objectFields,l,u,y,c,p)}else if("array"===a.type&&a.arrayFields){if(!Array.isArray(d))continue;const n=Array.isArray(h)?h:[];for(const o of K(d,n)){const e=d[o.from];if(!t(e))continue;const r="edited"===o.kind?n[o.to]:e;G(e,t(r)?r:{},a.arrayFields,`${l}.${o.from}`,`${u}.${o.to}`,y,"copy"===o.kind?p:c,p)}}else if(y??$(a.type)){const t=c.get(l);t?t.push(u):c.set(l,[u])}}}function K(t,n){const o=t.map(g),e=n.map(g),r=o.map(()=>!1),s=e.map(()=>!1),i=[],c=Math.min(o.length,e.length);for(let t=0;t<c;t++)o[t]===e[t]&&(i.push({from:t,to:t,kind:"same"}),r[t]=s[t]=!0);for(let t=0;t<e.length;t++){if(s[t])continue;const n=o.findIndex((n,o)=>!r[o]&&n===e[t]);-1!==n&&(i.push({from:n,to:t,kind:"same"}),r[n]=s[t]=!0)}for(let t=0;t<c;t++)r[t]||s[t]||(i.push({from:t,to:t,kind:"edited"}),r[t]=s[t]=!0);for(let t=0;t<e.length;t++){if(s[t])continue;const n=o.indexOf(e[t]);-1!==n&&i.push({from:n,to:t,kind:"copy"})}return i}function T(t,n,o){const e={},s=(t,n)=>{if(t.type!==n.type)return;e[t.props.id]=n.props.id;const p=r(n.props,i(o,n.type));for(const n of r(t.props,i(o,t.type))){const t=p.find(t=>t.slot===n.slot);t&&n.content.forEach((n,o)=>{const e=t.content[o];c(n)&&c(e)&&s(n,e)})}};return c(t)&&c(n)&&s(t,n),e}function X(t,n){const o={};if(!t)return o;for(const e of Object.keys(n)){const r=k(t,e),s=n[e];r&&w(r)&&"string"==typeof s&&(o[s]={...r})}return o}var Y=t=>Number.isFinite(t)&&t>0?Math.floor(t):0;function q(t,n){const o=Y(n),e=/* @__PURE__ */new Set,r=[];if(Array.isArray(t))for(const n of t){const t="number"==typeof n?n:Number.NaN;!Number.isInteger(t)||t<0||t>=o||e.has(t)||(e.add(t),r.push(t))}for(let t=0;t<o;t++)e.has(t)||r.push(t);return r}var H=t=>t.some((t,n)=>t!==n);function L(t,n){const o=q([...t],n);return H(o)?o:void 0}function Q(t,n,o,e){const r=Y(n);if(o===e)return null;if(!Number.isInteger(o)||!Number.isInteger(e))return null;if(o<0||o>=r||e<0||e>=r)return null;const s=q(t,r);return s.splice(e,0,...s.splice(o,1)),L(s,r)}function V(t,n,o,e,r){const s=q(t,n),i=[];for(const t of s){const n=e(t);n>=0&&i.push(n),r&&t===r.after&&i.push(r.at)}return L(i,o)}var W="root",Z="default-zone",_={parentId:W,slot:Z},tt=({parentId:t,slot:n})=>`${t}:${n}`;function nt(t){const n=t.indexOf(":");if(-1===n)throw new et("no-slot",`"${t}" is not a zone key`);return{parentId:t.slice(0,n),slot:t.slice(n+1)}}var ot=t=>t.parentId===W&&t.slot===Z,et=class extends Error{code;constructor(t,n){super(n),this.name="DataError",this.code=t}};function rt(t){try{const n=globalThis.crypto;if(n&&"function"==typeof n.randomUUID)return`${t}-${n.randomUUID()}`}catch{}return`${t}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function st(t,n){return r(t.props,i(n,t.type)).map(({slot:t,content:n})=>({slot:t,content:n}))}function it(t,o){return r(ct(t),n(o.root))}function ct(n){return t(n.root?.props)?n.root.props:{}}function pt(t,n,o){const e=(t,n,e,r,s)=>{if(!Array.isArray(t))return t;const i=[...e,n];let f=null;return t.forEach((e,a)=>{if(!c(e))return;const l={place:{...n,index:a},path:i,parent:r,depth:s};let u=o(e,l)??e;if(u!==e&&u.props.id!==e.props.id)throw new et("id-change",`walk: ${e.props.id} came back as ${u.props.id}`);u=p(u,i,s+1),u!==e&&(f??=[...t],f[a]=u)}),f??t},p=(t,o,c)=>{let p=t.props;for(const f of r(t.props,i(n,t.type))){if(!f.present)continue;const n=e(f.content,{parentId:t.props.id,slot:f.slot},o,t,c);n!==f.content&&(p=s(p,f.segments,n))}return p===t.props?t:{...t,props:p}};let f=t;const a=e(t.content,_,[],null,0);a!==t.content&&(f={...f,content:a});let l=ct(f);for(const t of it(f,n)){if(!t.present)continue;const n=e(t.content,{parentId:W,slot:t.slot},[],null,0);n!==t.content&&(l=s(l,t.segments,n))}l!==ct(f)&&(f={...f,root:{...f.root,props:l}});const u=f.zones;if(u){let t=u;for(const n of Object.keys(u)){const o=ft(n);if(!o)continue;const r=e(u[n],o,[],null,0);r!==u[n]&&(t={...t,[n]:r})}t!==u&&(f={...f,zones:t})}return f}function ft(t){const n=t.indexOf(":");return-1===n?null:{parentId:t.slice(0,n),slot:t.slice(n+1)}}function at(t,n,o){let e=null;const r={};try{pt(t,n,(t,n)=>{if(t.props.id===o)throw e={node:t,place:n.place,path:n.path},r})}catch(t){if(t!==r)throw t}return e}function lt(t,n,o){if(ot(o))return Array.isArray(t.content)?t.content:[];const e=t.zones?.[tt(o)];if(o.parentId===W){const r=it(t,n).find(t=>t.slot===o.slot);return r?r.content:e??null}const s=at(t,n,o.parentId);if(s){const t=r(s.node.props,i(n,s.node.type)).find(t=>t.slot===o.slot);if(t)return t.content}return e??null}function ut(t,n){const o=/* @__PURE__ */new Set;return pt(t,n,t=>{o.add(t.props.id)}),o}function dt(t,n){const o=/* @__PURE__ */new Set([t.props.id]),e=t=>{for(const{content:r}of st(t,n))for(const t of r)c(t)&&(o.add(t.props.id),e(t))};return e(t),o}function ht(t,n,o,e){if(ot(o)){const n=Array.isArray(t.content)?t.content:[];return{...t,content:e(n)}}const c=tt(o),p=!!t.zones&&Array.isArray(t.zones[c]);if(o.parentId===W){const r=it(t,n).find(t=>t.slot===o.slot);if(r){const n=s(ct(t),r.segments,e(r.content));return{...t,root:{...t.root,props:n}}}}else{const c=at(t,n,o.parentId);if(c){const p=r(c.node.props,i(n,c.node.type)).find(t=>t.slot===o.slot);if(p)return yt(t,n,c,t=>({...t,props:s(t.props,p.segments,e(p.content))}))}else if(!p)throw new et("not-found",`no node ${o.parentId}`)}if(p)return{...t,zones:{...t.zones,[c]:e(t.zones[c])}};throw new et("no-slot",`no slot "${o.slot}" on ${o.parentId}`)}function yt(t,n,o,e){return ht(t,n,o.place,t=>{const n=[...t];return n[o.place.index]=e(t[o.place.index]),n})}function gt(t,n,o){const e=at(t,n,o);if(!e)throw new et("not-found",`no node ${o}`);return e}function mt(t,n,o){const e=lt(t,n,o);if(e)return e;if(o.parentId!==W&&!at(t,n,o.parentId))throw new et("not-found",`no node ${o.parentId}`);throw new et("no-slot",`no slot "${o.slot}" on ${o.parentId}`)}function bt(t,n,o){if(!Number.isInteger(t)||t<0||t>n)throw new et("bad-index",`${o}: index ${t} is outside 0…${n}`)}function wt(t,i){const c=o(i,t.type);if(!c)return t;const p=n(c);let f=t.props;for(const t of e(p))null==f[t]&&(f={...f,[t]:[]});for(const t of r(f,p)){if(!t.present)continue;const n=vt(t.content,i);n!==t.content&&(f=s(f,t.segments,n))}return f===t.props?t:{...t,props:f}}function vt(n,o){let e=null;return n.forEach((r,s)=>{if(!t(r)||"string"!=typeof r.type)return;let i=r;if(t(i.props)){if("string"!=typeof i.props.id||""===i.props.id){const{id:t,...n}=i.props;i={...i,props:{id:rt(i.type),...n}}}}else i={...i,props:{id:rt(i.type)}};const c=wt(i,o);c!==r&&(e??=[...n],e[s]=c)}),e??n}function jt(t,o){const i=n(o.root);let c=t.props;for(const t of e(i))null==c[t]&&(c={...c,[t]:[]});for(const t of r(c,i)){if(!t.present)continue;const n=vt(t.content,o);n!==t.content&&(c=s(c,t.segments,n))}return c===t.props?t:{...t,props:c}}function $t(n,o){let e=t(n)?n:{};const r=e.root;if(t(r)){if(!t(r.props)){const t=Object.keys(r).filter(t=>"props"!==t);e={...e,root:t.length?{props:{...kt(r,t)}}:{props:{}}}}}else e={...e,root:{props:{}}};const s=p(o.root);if(s){const t=Object.keys(s).filter(t=>!(t in e.root.props));if(t.length){const n=At(kt(s,t));e={...e,root:{...e.root,props:{...e.root.props,...n}}}}}const i=jt(e.root,o);i!==e.root&&(e={...e,root:i}),Array.isArray(e.content)||(e={...e,content:[]});const c=vt(e.content,o);return c!==e.content&&(e={...e,content:c}),e=t(e.zones)?function(t,n){let o=t;for(const e of Object.keys(t.zones??{})){const t=o.zones[e];if(!Array.isArray(t)||0===t.length)continue;const r=ft(e);if(!r||ot(r))continue;const s=Ot(o,n,r);if(!s||s.content.length>0)continue;const{[e]:i,...c}=o.zones;o=ht({...o,zones:c},n,r,()=>vt(t,n))}const e=o.zones;let r=e;for(const t of Object.keys(e)){if(!Array.isArray(e[t]))continue;const o=vt(e[t],n);o!==e[t]&&(r={...r,[t]:o})}return r===e?o:{...o,zones:r}}(e,o):{...e,zones:{}},e}function Ot(t,n,o){if(o.parentId===W)return it(t,n).find(t=>t.slot===o.slot);const e=at(t,n,o.parentId);return e?r(e.node.props,i(n,e.node.type)).find(t=>t.slot===o.slot):void 0}function kt(t,n){const o={};for(const e of n)o[e]=t[e];return o}function At(t){return void 0===t?t:JSON.parse(JSON.stringify(t))}function xt(t,n,o={},e={}){const r=t.components[n];if(!r)throw new et("unknown-type",`no block type "${n}" in the config`);return wt({type:n,props:{...At(p(r)??{}),...At(o),id:e.id??rt(n)}},t)}function It(n,o,e,r){if(!c(r))throw new et("unknown-type","insert: not a node");const s=mt(n,o,e);bt(e.index,s.length,"insert");const i=wt(t(r.props)&&"string"==typeof r.props.id&&r.props.id?r:{...r,props:{...r.props,id:rt(r.type)}},o),p=ut(n,o);for(const t of dt(i,o))if(p.has(t))throw new et("duplicate-id",`insert: ${t} is already in the document`);return ht(n,o,e,t=>[...t.slice(0,e.index),i,...t.slice(e.index)])}function zt(t,n,o){const e=gt(t,n,o);let r=ht(t,n,e.place,t=>[...t.slice(0,e.place.index),...t.slice(e.place.index+1)]);if(r.zones&&Object.keys(r.zones).length){const t=dt(e.node,n),o=Object.keys(r.zones).filter(n=>!t.has(n.split(":")[0]));o.length!==Object.keys(r.zones).length&&(r={...r,zones:kt(r.zones,o)})}return r}function St(t,n,o,e){const r=gt(t,n,o);if(dt(r.node,n).has(e.parentId))throw new et("cycle",`move: ${o} cannot go inside itself`);if(r.place.parentId===e.parentId&&r.place.slot===e.slot){const o=mt(t,n,e);return bt(e.index,o.length-1,"move"),e.index===r.place.index?t:ht(t,n,e,t=>{const n=[...t],[o]=n.splice(r.place.index,1);return n.splice(e.index,0,o),n})}bt(e.index,mt(t,n,e).length,"move");const s=ht(t,n,r.place,t=>[...t.slice(0,r.place.index),...t.slice(r.place.index+1)]);return ht(s,n,e,t=>[...t.slice(0,e.index),r.node,...t.slice(e.index)])}function Nt(t,n,o,e={}){const r=gt(t,n,o),s=Mt(At(r.node),n,e.strip,e.id);return ht(t,n,r.place,t=>[...t.slice(0,r.place.index+1),s,...t.slice(r.place.index+1)])}function Ft(t,n,o={}){return Mt(At(t),n,o.strip,o.id)}function Mt(t,n,o,e){let p={...t,props:{...t.props,id:e??rt(t.type)}};if(o){const t=o(p);if(t.props.id!==p.props.id)throw new et("id-change","duplicate: strip must not change the id");p=t}let f=p.props;for(const t of r(f,i(n,p.type))){if(!t.present)continue;const e=t.content.map(t=>c(t)?Mt(t,n,o):t);f=s(f,t.segments,e)}return wt({...p,props:f},n)}function Et(t,n,o,e){if("id"in e&&e.id!==o)throw new et("id-change",`setProps: ${o} cannot become ${String(e.id)}`);const r=gt(t,n,o);return Rt(r.node.props,e)?yt(t,n,r,t=>wt({...t,props:{...t.props,...e,id:o}},n)):t}function Dt(t,n,o,e){if(!c(e))throw new et("unknown-type","replaceNode: not a node");if(e.props.id!==o)throw new et("id-change",`replaceNode: ${o} cannot become ${String(e.props.id)}`);const r=gt(t,n,o),s=wt(e,n),i=ut(t,n);for(const t of dt(r.node,n))i.delete(t);for(const t of dt(s,n))if(i.has(t))throw new et("duplicate-id",`replaceNode: ${t} is already in the document`);return yt(t,n,r,()=>s)}function Ct(t,n,o){const e=ct(t);if(!Rt(e,o))return t;const r=jt({...t.root,props:{...e,...o}},n);return{...t,root:r}}function Rt(t,n){return Object.keys(n).some(o=>!(o in t)||!Object.is(t[o],n[o]))}export{et as DataError,W as ROOT_ID,_ as ROOT_LIST,Z as ROOT_SLOT,E as applyTranslation,V as carryPhoneOrder,l as changedProps,At as clone,Ft as copyNode,X as copyTranslation,xt as createNode,f as createResolveCache,a as deepEqual,Nt as duplicate,R as extractTranslation,at as find,lt as getList,It as insert,H as isCustomPhoneOrder,T as mapIds,St as move,Q as movePhoneOrder,rt as newId,$t as normalizeData,q as normalizePhoneOrder,nt as parseZoneKey,P as pruneTranslation,B as rebaseTranslation,zt as remove,Dt as replaceNode,u as resolveNodeData,Et as setProps,Ct as setRoot,L as settlePhoneOrder,st as slotsOf,z as translatablePaths,h as translationFingerprint,D as translationStatus,pt as walk,tt as zoneKey};
@@ -1,4 +1,4 @@
1
- import{SettingsSwitch as e}from"../chunk-OECWLNKJ.js";import{TEXT_STYLE_CASES as t}from"../chunk-53QUHEHK.js";import"../chunk-DIOTWSCO.js";import{selectionToVisible as n,selectionToSource as r,richLayout as l,createHistory as o,colorRunOf as a,textRange as s,selectionBox as c,placeWindow as i,offsetOrigin as u,visibleArea as d,styleChange as p,clearRangeOf as h,ColorWindow as m,markPress as f,pasteToMarkup as g,richInput as y,editVisible as v,MARKUP_CLIPBOARD_TYPE as b,markupOfRange as k}from"../chunk-MNQDOSAX.js";export{ColorWindow,MARKUP_CLIPBOARD_TYPE,TYPING_BURST_MS,clearRangeOf,colorRunOf,createHistory,editVisible,markupOfRange,newLine,pasteToMarkup,richInput,richLayout,selectionToSource,selectionToVisible,setBullet,startCanvasTyping,textMap,toSource,toSourceStart,toVisible}from"../chunk-MNQDOSAX.js";import{DEFAULT_COPY_WORDS as x}from"../chunk-PMRN5Z3T.js";import{FieldNumber as S}from"../chunk-Y2T3JX7K.js";import{FieldSelect as E}from"../chunk-KFWNGPW3.js";import{SettingsSegmented as w}from"../chunk-DX3VILZ3.js";import{SettingsField as C}from"../chunk-MIX7EGRG.js";import"../chunk-JACEEVVF.js";import{useWords as N}from"../chunk-MFIRYGHW.js";import{registerModalEscapeInterceptor as D,textToolbarRows as T,TextToolbar as O,textAlignWords as L,useShellStrings as R,textAlignOptions as K,TEXT_ALIGNS as j,LinkPicker as F,Tooltip as M,IconButton as B}from"efficient-shell/ui";export{TextToolbar}from"efficient-shell/ui";import{useRef as H,useState as V,useLayoutEffect as W,useEffect as $,useId as P}from"react";import{RETIRED_MARKS as z,applyMark as I,marksIn as q,STANDARD_MARKUP as A,listIn as U,colorIn as G,styleIn as X,clearStyle as Y,spanFor as _,findLink as J,tokenizeInline as Q,colorOver as Z,setList as ee,unlinkAt as te,removeLink as ne,linkOver as re,writeLink as le}from"efficient-shell/markup";import{jsxs as oe,jsx as ae,Fragment as se}from"react/jsx-runtime";import{ParagraphSpacingIcon as ce,LetterSpacingIcon as ie,LineSpacingIcon as ue,TextSizeIcon as de,StylesIcon as pe,TypeIcon as he,AlignmentIcon as me,ListFormatIcon as fe,CaseIcon as ge,ItalicIcon as ye,NumberedListIcon as ve,ListIcon as be,ListNoneIcon as ke,CaseLowerIcon as xe,CaseCapitalizedIcon as Se,CaseUpperIcon as Ee,CaseNormalIcon as we}from"efficient-shell/icons/efficient";function Ce(e,t,n,r,l){for(const o of l){if(o.kind!==n)continue;if(!e.startsWith(o.open,t))continue;const l=t+o.open.length;if(e.startsWith(r,l)&&e.startsWith(o.close,l+r.length))return o}return null}function Ne({value:e,rules:t=A,className:n,layerRef:r}){const l=function(e,t){const n=[];let r=0;for(const l of Q(e,t)){if("text"===l.kind){l.text.length>0&&(n.push({kind:"text",text:e.slice(r,r+l.text.length)}),r+=l.text.length);continue}const o=Ce(e,r,l.kind,l.text,t);if(!o)return[{kind:"text",text:e}];const a=r+o.open.length,s=a+l.text.length,c=s+o.close.length;n.push({kind:"delimiter",text:e.slice(r,a)}),n.push({kind:l.kind,text:e.slice(a,s)}),n.push({kind:"delimiter",text:e.slice(s,c)}),r=c}return n.map(e=>e.text).join("")!==e?[{kind:"text",text:e}]:n}(e,t);/* @__PURE__ */
1
+ import{SettingsSwitch as e}from"../chunk-OECWLNKJ.js";import{TEXT_STYLE_CASES as t}from"../chunk-53QUHEHK.js";import"../chunk-DIOTWSCO.js";import{selectionToVisible as n,selectionToSource as r,richLayout as l,createHistory as o,colorRunOf as a,textRange as s,selectionBox as c,placeWindow as i,offsetOrigin as u,visibleArea as d,styleChange as p,clearRangeOf as h,ColorWindow as m,markPress as f,pasteToMarkup as g,richInput as y,editVisible as v,MARKUP_CLIPBOARD_TYPE as b,markupOfRange as k}from"../chunk-MNQDOSAX.js";export{ColorWindow,MARKUP_CLIPBOARD_TYPE,TYPING_BURST_MS,clearRangeOf,colorRunOf,createHistory,editVisible,markupOfRange,newLine,pasteToMarkup,richInput,richLayout,selectionToSource,selectionToVisible,setBullet,startCanvasTyping,textMap,toSource,toSourceStart,toVisible}from"../chunk-MNQDOSAX.js";import{DEFAULT_COPY_WORDS as x}from"../chunk-PMRN5Z3T.js";import{FieldNumber as S}from"../chunk-ANBPE45L.js";import{FieldSelect as E}from"../chunk-C63IB4VW.js";import{SettingsSegmented as w}from"../chunk-DX3VILZ3.js";import{SettingsField as C}from"../chunk-MIX7EGRG.js";import"../chunk-UMTUKSE6.js";import{useWords as N}from"../chunk-MFIRYGHW.js";import{registerModalEscapeInterceptor as D,textToolbarRows as T,TextToolbar as O,textAlignWords as L,useShellStrings as R,textAlignOptions as K,TEXT_ALIGNS as j,LinkPicker as M,Tooltip as B,IconButton as F}from"efficient-shell/ui";export{TextToolbar}from"efficient-shell/ui";import{useRef as H,useState as V,useLayoutEffect as W,useEffect as $,useId as I}from"react";import{RETIRED_MARKS as P,applyMark as z,marksIn as U,STANDARD_MARKUP as q,listIn as A,colorIn as G,styleIn as X,clearStyle as Y,spanFor as _,findLink as Q,tokenizeInline as Z,colorOver as J,setList as ee,unlinkAt as te,removeLink as ne,linkOver as re,writeLink as le}from"efficient-shell/markup";import{jsxs as oe,jsx as ae,Fragment as se}from"react/jsx-runtime";import{ParagraphSpacingIcon as ce,LetterSpacingIcon as ie,LineSpacingIcon as ue,TextSizeIcon as de,StylesIcon as pe,TypeIcon as he,AlignmentIcon as me,ListFormatIcon as fe,CaseIcon as ge,ItalicIcon as ye,NumberedListIcon as ve,ListIcon as be,ListNoneIcon as ke,CaseLowerIcon as xe,CaseCapitalizedIcon as Se,CaseUpperIcon as Ee,CaseNormalIcon as we}from"efficient-shell/icons/efficient";function Ce(e,t,n,r,l){for(const o of l){if(o.kind!==n)continue;if(!e.startsWith(o.open,t))continue;const l=t+o.open.length;if(e.startsWith(r,l)&&e.startsWith(o.close,l+r.length))return o}return null}function Ne({value:e,rules:t=q,className:n,layerRef:r}){const l=function(e,t){const n=[];let r=0;for(const l of Z(e,t)){if("text"===l.kind){l.text.length>0&&(n.push({kind:"text",text:e.slice(r,r+l.text.length)}),r+=l.text.length);continue}const o=Ce(e,r,l.kind,l.text,t);if(!o)return[{kind:"text",text:e}];const a=r+o.open.length,s=a+l.text.length,c=s+o.close.length;n.push({kind:"delimiter",text:e.slice(r,a)}),n.push({kind:l.kind,text:e.slice(a,s)}),n.push({kind:"delimiter",text:e.slice(s,c)}),r=c}return n.map(e=>e.text).join("")!==e?[{kind:"text",text:e}]:n}(e,t);/* @__PURE__ */
2
2
  return ae("div",{ref:r,className:["es-gold-layer",n??""].filter(Boolean).join(" "),"aria-hidden":"true",children:l.map((e,t)=>function(e,t){const{kind:n,text:r}=e;switch(n){case"delimiter":/* @__PURE__ */
3
3
  return ae("span",{className:"es-gold-delim",children:r},t);case"accent":case"highlight":/* @__PURE__ */
4
4
  return ae("em",{className:"es-gold-mark es-gold-accent",children:r},t);case"bold":/* @__PURE__ */
@@ -6,24 +6,24 @@ return ae("strong",{className:"es-gold-mark es-gold-bold",children:r},t);case"it
6
6
  return ae("em",{className:"es-gold-mark es-gold-italic",children:r},t);case"strike":/* @__PURE__ */
7
7
  return ae("s",{className:"es-gold-mark es-gold-strike",children:r},t);case"quiet":/* @__PURE__ */
8
8
  return ae("span",{className:"es-gold-mark es-gold-quiet",children:r},t);default:/* @__PURE__ */
9
- return ae("span",{className:"es-gold-text",children:r},t)}}(e,t))})}function De({value:e,onInput:t,onCommit:n,onCancel:r,multiline:l=!1,placeholder:o,className:a,rules:s=A,ariaLabel:c,disabled:i=!1,inputRef:u}){const d=H(null),p=H(e),h=H(!1);function m(e){h.current&&(h.current=!1,n?.(e))}/* @__PURE__ */
9
+ return ae("span",{className:"es-gold-text",children:r},t)}}(e,t))})}function De({value:e,onInput:t,onCommit:n,onCancel:r,multiline:l=!1,placeholder:o,className:a,rules:s=q,ariaLabel:c,disabled:i=!1,inputRef:u}){const d=H(null),p=H(e),h=H(!1);function m(e){h.current&&(h.current=!1,n?.(e))}/* @__PURE__ */
10
10
  return oe("div",{className:["es-gold",l?"es-gold-is-multiline":"es-gold-is-single",i?"es-gold-is-off":"",a??""].filter(Boolean).join(" "),children:[
11
11
  /* @__PURE__ */ae(Ne,{value:e,rules:s,layerRef:d}),o&&""===e?
12
12
  /* @__PURE__ */ae("div",{className:"es-gold-placeholder","aria-hidden":"true",children:o}):null,
13
- /* @__PURE__ */ae("textarea",{ref:u,className:"es-gold-input",disabled:i,value:e,placeholder:o,"aria-label":c,onChange:function(e){h.current=!0,t(e.currentTarget.value)},onFocus:function(){p.current=e,h.current=!1},onBlur:function(){m(e)},onKeyDown:function(t){return"Escape"===t.key?(t.preventDefault(),h.current=!1,void r?.(p.current)):"Enter"!==t.key||l?void 0:(t.preventDefault(),void m(e))},onScroll:function(e){const t=d.current;t&&(t.scrollTop=e.currentTarget.scrollTop,t.scrollLeft=e.currentTarget.scrollLeft)}})]})}function Te(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function Oe(e,t,n,r=I){const{start:l,end:o}=Te(e,n);return r(e,l,o,t)}function Le(e,t,n){const{start:r,end:l}=Te(e,n),o=r+t.length;return{text:e.slice(0,r)+t+e.slice(l),selectionStart:o,selectionEnd:o}}function Re(e,t,n,r,l){switch(t){case"bold":return e.createElement("strong");case"italic":return e.createElement("em");case"strike":return e.createElement("s");case"underline":return e.createElement("u");case"sup":return e.createElement("sup");case"sub":return e.createElement("sub");case"color":{const t=e.createElement("span");return t.className="es-rich-color",r&&(t.dataset.color=r,t.title=r.startsWith("#")?r.toUpperCase():r,t.style.color=r.startsWith("#")?r:`var(--es-color-${r}, inherit)`),t}case"link":{const t=e.createElement("a");return t.className="es-rich-link",n&&(t.title=n),t}default:{const n=e.createElement("span");return n.className="highlight"===t||"accent"===t?"es-rich-emphasis":`es-rich-${t}`,l&&(n.dataset.textStyle=l),n}}}function Ke(e,t,n,r){const l=e.layout.lines;if(n===t)return r>=e.lines.length?e.layout.text.length:l[r].vis;const o=e.lines.findIndex(e=>e===n||e.contains(n));if(-1===o)return 0;const a=t.ownerDocument.createRange();a.setStart(e.lines[o],0);try{a.setEnd(n,r)}catch{return l[o].vis}return l[o].vis+Math.min(a.toString().length,l[o].text.length)}function je(e,t){const n=e.layout.lines;let r=n.length-1;for(let e=0;e<n.length;e+=1)if(t<=n[e].vis+n[e].text.length){r=e;break}let l=Math.max(0,t-n[r].vis);const o=e.lines[r].ownerDocument.createTreeWalker(e.lines[r],4);let a=o.nextNode(),s=null;for(;a;){if(l<=a.data.length)return[a,l];l-=a.data.length,s=a,a=o.nextNode()}return s?[s,s.data.length]:[e.lines[r],0]}function Fe({value:e,rules:t,multiline:o,readOnly:a=!1,placeholder:s,ariaLabel:c,handle:i,onEdit:u,onSelect:d,onHistory:p,onFormat:h,pending:m,onCommit:f,onCancel:x}){const S=H(null),E=H(null),w=H(null),C=H(null),N=H(null),D=H(e),[T,O]=V(0),L=H({value:e,rules:t,multiline:o,readOnly:a,pending:m,onEdit:u,onHistory:p,onFormat:h});L.current={value:e,rules:t,multiline:o,readOnly:a,pending:m,onEdit:u,onHistory:p,onFormat:h};const R=()=>{const e=S.current,t=E.current,n=e?.ownerDocument.getSelection();if(!(e&&t&&n&&0!==n.rangeCount&&n.anchorNode&&e.contains(n.anchorNode)))return null;const r=Ke(t,e,n.anchorNode,n.anchorOffset),l=n.focusNode&&e.contains(n.focusNode)?Ke(t,e,n.focusNode,n.focusOffset):r;return r<=l?[r,l]:[l,r]},K=(e,t)=>{const n=S.current,r=E.current;if(!n||!r)return;const[l,o]=je(r,e),[a,s]=je(r,t);n.ownerDocument.getSelection()?.setBaseAndExtent(l,o,a,s)};i.current={getSource(){const e=R(),t=E.current;if(!e||!t)return null;const[n,l]=r(t.layout,e[0],e[1]);return{start:n,end:l}},setSource(e,t,n){C.current={text:n,src:[e,t]},O(e=>e+1)},focus(){S.current?.focus()},rangeOf(e,t){const r=S.current,l=E.current;if(!r||!l)return null;const[o,a]=n(l.layout,e,t),[s,c]=je(l,o),[i,u]=je(l,a),d=r.ownerDocument.createRange();return d.setStart(s,c),d.setEnd(i,u),d}},W(()=>{const r=S.current;if(!r||N.current)return;const o=C.current?null:R();E.current=function(e,t){const n=e.ownerDocument;e.replaceChildren();const r=t.lines.map(t=>{const r=n.createElement("div");r.className=null!=t.number?"es-rich-line is-numbered":t.bullet?"es-rich-line is-bullet":"es-rich-line",null!=t.number&&(r.dataset.number=t.number);const l=[],o=()=>l.length?l[l.length-1].el:r;let a=null;for(const e of t.chars){let t=0;for(;t<l.length&&t<e.marks.length&&l[t].id===e.marks[t].id;)t+=1;(l.length>t||e.marks.length>t)&&(a=null),l.length=t;for(let r=t;r<e.marks.length;r+=1){const t=Re(n,e.marks[r].kind,e.marks[r].href,e.marks[r].color,e.marks[r].style);o().appendChild(t),l.push({id:e.marks[r].id,el:t})}a||(a=n.createTextNode(""),o().appendChild(a)),a.data+=e.ch}return 0===t.chars.length&&r.appendChild(n.createElement("br")),e.appendChild(r),r});return{layout:t,lines:r}}(r,l(e,t)),w.current=e;const a=C.current;if(!a||a.text!==e)return void(o&&r.ownerDocument.activeElement===r&&K(o[0],Math.min(o[1],E.current.layout.text.length)));C.current=null;const s=E.current.layout,[c,i]=a.vis??n(s,a.src[0],a.src[1]);r.ownerDocument.activeElement!==r&&r.focus(),K(c,i)},[e,t,T]);const j=(e,t,n)=>{const l=E.current,[o,a]=r(l.layout,t[0],t[1]);C.current={text:e.text,vis:[e.caret,e.caret]},e.text!==L.current.value?L.current.onEdit(e.text,{start:o,end:a},n):O(e=>e+1)};$(()=>{const e=S.current;if(!e)return;const t=t=>{const{value:n,rules:r,multiline:l,readOnly:o,pending:a}=L.current;if("insertCompositionText"===t.inputType)return;if(t.preventDefault(),o)return;const s=E.current,c=R();if(!s||!c)return;const i="function"==typeof t.getTargetRanges?t.getTargetRanges()[0]:void 0,u=i&&!i.collapsed?[Ke(s,e,i.startContainer,i.startOffset),Ke(s,e,i.endContainer,i.endOffset)]:null,d=y({value:n,rules:r,multiline:l,inputType:t.inputType,data:t.data??t.dataTransfer?.getData("text/plain")??"",html:t.dataTransfer?.getData("text/html"),doc:e.ownerDocument,sel:c,target:u,pending:a});d&&("history"!==d.kind?"format"!==d.kind?j(d.edit,d.range,d.kind):L.current.onFormat(d.style):L.current.onHistory(d.dir))},n=()=>{N.current||O(e=>e+1)};return e.addEventListener("beforeinput",t),e.addEventListener("input",n),()=>{e.removeEventListener("beforeinput",t),e.removeEventListener("input",n)}},[]),$(()=>{const e=S.current;if(!e)return;const t=e.ownerDocument,n=()=>{const e=i.current?.getSource();e&&d(e)};return t.addEventListener("selectionchange",n),()=>t.removeEventListener("selectionchange",n)});const F=(n,r=!1)=>{const l=R();if(!l||l[0]===l[1])return;n.preventDefault();const o=E.current;n.clipboardData.setData("text/plain",o.layout.text.slice(l[0],l[1])),n.clipboardData.setData(b,k(e,t,l[0],l[1])),r&&!a&&j(v(e,t,l[0],l[1],{text:""}),l,"edit")};/* @__PURE__ */
13
+ /* @__PURE__ */ae("textarea",{ref:u,className:"es-gold-input",disabled:i,value:e,placeholder:o,"aria-label":c,onChange:function(e){h.current=!0,t(e.currentTarget.value)},onFocus:function(){p.current=e,h.current=!1},onBlur:function(){m(e)},onKeyDown:function(t){return"Escape"===t.key?(t.preventDefault(),h.current=!1,void r?.(p.current)):"Enter"!==t.key||l?void 0:(t.preventDefault(),void m(e))},onScroll:function(e){const t=d.current;t&&(t.scrollTop=e.currentTarget.scrollTop,t.scrollLeft=e.currentTarget.scrollLeft)}})]})}function Te(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function Oe(e,t,n,r=z){const{start:l,end:o}=Te(e,n);return r(e,l,o,t)}function Le(e,t,n){const{start:r,end:l}=Te(e,n),o=r+t.length;return{text:e.slice(0,r)+t+e.slice(l),selectionStart:o,selectionEnd:o}}function Re(e,t,n,r,l){switch(t){case"bold":return e.createElement("strong");case"italic":return e.createElement("em");case"strike":return e.createElement("s");case"underline":return e.createElement("u");case"sup":return e.createElement("sup");case"sub":return e.createElement("sub");case"color":{const t=e.createElement("span");return t.className="es-rich-color",r&&(t.dataset.color=r,t.title=r.startsWith("#")?r.toUpperCase():r,t.style.color=r.startsWith("#")?r:`var(--es-color-${r}, inherit)`),t}case"link":{const t=e.createElement("a");return t.className="es-rich-link",n&&(t.title=n),t}default:{const n=e.createElement("span");return n.className="highlight"===t||"accent"===t?"es-rich-emphasis":`es-rich-${t}`,l&&(n.dataset.textStyle=l),n}}}function Ke(e,t,n,r){const l=e.layout.lines;if(n===t)return r>=e.lines.length?e.layout.text.length:l[r].vis;const o=e.lines.findIndex(e=>e===n||e.contains(n));if(-1===o)return 0;const a=t.ownerDocument.createRange();a.setStart(e.lines[o],0);try{a.setEnd(n,r)}catch{return l[o].vis}return l[o].vis+Math.min(a.toString().length,l[o].text.length)}function je(e,t){const n=e.layout.lines;let r=n.length-1;for(let e=0;e<n.length;e+=1)if(t<=n[e].vis+n[e].text.length){r=e;break}let l=Math.max(0,t-n[r].vis);const o=e.lines[r].ownerDocument.createTreeWalker(e.lines[r],4);let a=o.nextNode(),s=null;for(;a;){if(l<=a.data.length)return[a,l];l-=a.data.length,s=a,a=o.nextNode()}return s?[s,s.data.length]:[e.lines[r],0]}function Me({value:e,rules:t,multiline:o,readOnly:a=!1,placeholder:s,ariaLabel:c,handle:i,onEdit:u,onSelect:d,onHistory:p,onFormat:h,pending:m,onCommit:f,onCancel:x}){const S=H(null),E=H(null),w=H(null),C=H(null),N=H(null),D=H(e),[T,O]=V(0),L=H({value:e,rules:t,multiline:o,readOnly:a,pending:m,onEdit:u,onHistory:p,onFormat:h});L.current={value:e,rules:t,multiline:o,readOnly:a,pending:m,onEdit:u,onHistory:p,onFormat:h};const R=()=>{const e=S.current,t=E.current,n=e?.ownerDocument.getSelection();if(!(e&&t&&n&&0!==n.rangeCount&&n.anchorNode&&e.contains(n.anchorNode)))return null;const r=Ke(t,e,n.anchorNode,n.anchorOffset),l=n.focusNode&&e.contains(n.focusNode)?Ke(t,e,n.focusNode,n.focusOffset):r;return r<=l?[r,l]:[l,r]},K=(e,t)=>{const n=S.current,r=E.current;if(!n||!r)return;const[l,o]=je(r,e),[a,s]=je(r,t);n.ownerDocument.getSelection()?.setBaseAndExtent(l,o,a,s)};i.current={getSource(){const e=R(),t=E.current;if(!e||!t)return null;const[n,l]=r(t.layout,e[0],e[1]);return{start:n,end:l}},setSource(e,t,n){C.current={text:n,src:[e,t]},O(e=>e+1)},focus(){S.current?.focus()},rangeOf(e,t){const r=S.current,l=E.current;if(!r||!l)return null;const[o,a]=n(l.layout,e,t),[s,c]=je(l,o),[i,u]=je(l,a),d=r.ownerDocument.createRange();return d.setStart(s,c),d.setEnd(i,u),d}},W(()=>{const r=S.current;if(!r||N.current)return;const o=C.current?null:R();E.current=function(e,t){const n=e.ownerDocument;e.replaceChildren();const r=t.lines.map(t=>{const r=n.createElement("div");r.className=null!=t.number?"es-rich-line is-numbered":t.bullet?"es-rich-line is-bullet":"es-rich-line",null!=t.number&&(r.dataset.number=t.number);const l=[],o=()=>l.length?l[l.length-1].el:r;let a=null;for(const e of t.chars){let t=0;for(;t<l.length&&t<e.marks.length&&l[t].id===e.marks[t].id;)t+=1;(l.length>t||e.marks.length>t)&&(a=null),l.length=t;for(let r=t;r<e.marks.length;r+=1){const t=Re(n,e.marks[r].kind,e.marks[r].href,e.marks[r].color,e.marks[r].style);o().appendChild(t),l.push({id:e.marks[r].id,el:t})}a||(a=n.createTextNode(""),o().appendChild(a)),a.data+=e.ch}return 0===t.chars.length&&r.appendChild(n.createElement("br")),e.appendChild(r),r});return{layout:t,lines:r}}(r,l(e,t)),w.current=e;const a=C.current;if(!a||a.text!==e)return void(o&&r.ownerDocument.activeElement===r&&K(o[0],Math.min(o[1],E.current.layout.text.length)));C.current=null;const s=E.current.layout,[c,i]=a.vis??n(s,a.src[0],a.src[1]);r.ownerDocument.activeElement!==r&&r.focus(),K(c,i)},[e,t,T]);const j=(e,t,n)=>{const l=E.current,[o,a]=r(l.layout,t[0],t[1]);C.current={text:e.text,vis:[e.caret,e.caret]},e.text!==L.current.value?L.current.onEdit(e.text,{start:o,end:a},n):O(e=>e+1)};$(()=>{const e=S.current;if(!e)return;const t=t=>{const{value:n,rules:r,multiline:l,readOnly:o,pending:a}=L.current;if("insertCompositionText"===t.inputType)return;if(t.preventDefault(),o)return;const s=E.current,c=R();if(!s||!c)return;const i="function"==typeof t.getTargetRanges?t.getTargetRanges()[0]:void 0,u=i&&!i.collapsed?[Ke(s,e,i.startContainer,i.startOffset),Ke(s,e,i.endContainer,i.endOffset)]:null,d=y({value:n,rules:r,multiline:l,inputType:t.inputType,data:t.data??t.dataTransfer?.getData("text/plain")??"",html:t.dataTransfer?.getData("text/html"),doc:e.ownerDocument,sel:c,target:u,pending:a});d&&("history"!==d.kind?"format"!==d.kind?j(d.edit,d.range,d.kind):L.current.onFormat(d.style):L.current.onHistory(d.dir))},n=()=>{N.current||O(e=>e+1)};return e.addEventListener("beforeinput",t),e.addEventListener("input",n),()=>{e.removeEventListener("beforeinput",t),e.removeEventListener("input",n)}},[]),$(()=>{const e=S.current;if(!e)return;const t=e.ownerDocument,n=()=>{const e=i.current?.getSource();e&&d(e)};return t.addEventListener("selectionchange",n),()=>t.removeEventListener("selectionchange",n)});const M=(n,r=!1)=>{const l=R();if(!l||l[0]===l[1])return;n.preventDefault();const o=E.current;n.clipboardData.setData("text/plain",o.layout.text.slice(l[0],l[1])),n.clipboardData.setData(b,k(e,t,l[0],l[1])),r&&!a&&j(v(e,t,l[0],l[1],{text:""}),l,"edit")};/* @__PURE__ */
14
14
  return oe("div",{className:"es-rich-wrap",children:[s&&""===e?/* @__PURE__ */ae("div",{className:"es-rich-placeholder","aria-hidden":"true",children:s}):null,
15
- /* @__PURE__ */ae("div",{ref:S,className:`es-rich${o?" is-multiline":" is-single"}${a?" is-off":""}`,contentEditable:!a,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":o,"aria-label":c,"aria-readonly":a||void 0,"aria-placeholder":s,tabIndex:a?-1:0,spellCheck:!0,onFocus:()=>{D.current=e},onBlur:()=>{e!==D.current&&f?.(e),D.current=e},onKeyDown:t=>{if("Escape"===t.key)return t.preventDefault(),x?.(D.current),void(D.current=e);"Enter"!==t.key||o||(t.preventDefault(),e!==D.current&&f?.(e),D.current=e)},onCompositionStart:()=>{const e=R()??[0,0];N.current={from:e[0],to:e[1]}},onCompositionEnd:e=>{const t=N.current;if(N.current=null,!t)return;const{value:n,rules:r,pending:l}=L.current;e.data?j(v(n,r,t.from,t.to,{text:e.data,add:l?.add,drop:l?.drop,color:l?.color}),[t.from,t.to],"type"):O(e=>e+1)},onCopy:e=>F(e),onCut:e=>F(e,!0),onPaste:n=>{if(n.preventDefault(),a)return;const r=R();if(!r)return;const l=n.clipboardData.getData(b),s=l?o?l:l.replace(/\s*\r?\n\s*/g," "):g({html:n.clipboardData.getData("text/html"),text:n.clipboardData.getData("text/plain")},{doc:n.currentTarget.ownerDocument,multiline:o,rules:t});j(v(e,t,r[0],r[1],{markup:s}),r,"edit")}})]})}var Me={fontSize:{key:"fontSize",nameKey:"fontSize",icon:/* @__PURE__ */ae(de,{}),unit:"px",step:1,shiftStep:10,min:5},lineHeight:{key:"lineHeight",nameKey:"lineHeight",icon:/* @__PURE__ */ae(ue,{}),unit:"%",step:1,shiftStep:10,min:50,max:250,scale:100},letterSpacing:{key:"letterSpacing",nameKey:"letterSpacing",icon:/* @__PURE__ */ae(ie,{}),unit:"px",step:.1,shiftStep:1,min:-10},paragraphSpacing:{key:"paragraphSpacing",nameKey:"paragraphSpacing",icon:/* @__PURE__ */ae(ce,{}),unit:"px",step:1,shiftStep:10,min:0}};function Be(e,t){return void 0===e?void 0:Number((e*t).toFixed(6))}function He({cells:e,words:t,readOnly:n=!1}){const r=t??x.cells,l=P();/* @__PURE__ */
15
+ /* @__PURE__ */ae("div",{ref:S,className:`es-rich${o?" is-multiline":" is-single"}${a?" is-off":""}`,contentEditable:!a,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":o,"aria-label":c,"aria-readonly":a||void 0,"aria-placeholder":s,tabIndex:a?-1:0,spellCheck:!0,onFocus:()=>{D.current=e},onBlur:()=>{e!==D.current&&f?.(e),D.current=e},onKeyDown:t=>{if("Escape"===t.key)return t.preventDefault(),x?.(D.current),void(D.current=e);"Enter"!==t.key||o||(t.preventDefault(),e!==D.current&&f?.(e),D.current=e)},onCompositionStart:()=>{const e=R()??[0,0];N.current={from:e[0],to:e[1]}},onCompositionEnd:e=>{const t=N.current;if(N.current=null,!t)return;const{value:n,rules:r,pending:l}=L.current;e.data?j(v(n,r,t.from,t.to,{text:e.data,add:l?.add,drop:l?.drop,color:l?.color}),[t.from,t.to],"type"):O(e=>e+1)},onCopy:e=>M(e),onCut:e=>M(e,!0),onPaste:n=>{if(n.preventDefault(),a)return;const r=R();if(!r)return;const l=n.clipboardData.getData(b),s=l?o?l:l.replace(/\s*\r?\n\s*/g," "):g({html:n.clipboardData.getData("text/html"),text:n.clipboardData.getData("text/plain")},{doc:n.currentTarget.ownerDocument,multiline:o,rules:t});j(v(e,t,r[0],r[1],{markup:s}),r,"edit")}})]})}var Be={fontSize:{key:"fontSize",nameKey:"fontSize",icon:/* @__PURE__ */ae(de,{}),unit:"px",step:1,shiftStep:10,min:5},lineHeight:{key:"lineHeight",nameKey:"lineHeight",icon:/* @__PURE__ */ae(ue,{}),unit:"%",step:1,shiftStep:10,min:50,max:250,scale:100},letterSpacing:{key:"letterSpacing",nameKey:"letterSpacing",icon:/* @__PURE__ */ae(ie,{}),unit:"px",step:.1,shiftStep:1,min:-10},paragraphSpacing:{key:"paragraphSpacing",nameKey:"paragraphSpacing",icon:/* @__PURE__ */ae(ce,{}),unit:"px",step:1,shiftStep:10,min:0}};function Fe(e,t){return void 0===e?void 0:Number((e*t).toFixed(6))}function He({cells:e,words:t,readOnly:n=!1}){const r=t??x.cells,l=I();/* @__PURE__ */
16
16
  return ae("div",{className:"es-copy-cells-fit",children:/* @__PURE__ */ae("div",{className:"es-copy-cells",children:e.map(e=>{const t=e.scale??1,o=e.name??(e.nameKey?r[e.nameKey]:e.key),a=e.unit??"",s=e.step??1,c=`${l}-${e.key}`;/* @__PURE__ */
17
17
  return oe("div",{className:"es-copy-cell",children:[
18
18
  /* @__PURE__ */ae("label",{className:"es-field-label es-copy-cell-name",htmlFor:c,children:o}),
19
- /* @__PURE__ */ae(S,{id:c,value:Be(e.value,t),styleValue:Be(e.styleValue,t),onChange:n=>e.onChange(void 0===n?void 0:Number((n/t).toFixed(6))),min:e.min,max:e.max,step:s,shiftStep:e.shiftStep,icon:e.icon,unit:a||void 0,steppers:"compact",readOnly:n,ariaLabel:o,title:r.tip({name:o,step:s,unit:a})})]},e.key)})})})}function Ve({target:e,onChange:t}){const n=H(null);return W(()=>{const t=n.current,r=e.current;t&&r&&r.value===t.text&&(n.current=null,r.focus(),r.setSelectionRange(t.start,t.end))}),r=>{const l=r(e.current);t(l.text),n.current={start:l.selectionStart,end:l.selectionEnd,text:l.text}}}var We=/* @__PURE__ */new Set([...z,"clear"]);function $e({value:t,onChange:n,onCommit:r,onCancel:l,multiline:y=!1,placeholder:v,ariaLabel:b,className:k,readOnly:S=!1,rules:E,tools:w=[],writeMark:C,align:L,actions:R,toolbar:K,barLabel:j,renderFooter:M,inputRef:B,barShows:z="always",richText:Q=!0,defaultShowMarks:ce=!1,colors:ie,cells:ue,letterCase:de,lastTool:pe}){const he=N("copy",x),me=H(null),fe=B??me,[ge,ye]=V(!1),[ve,be]=V(null),ke=H(o()).current,xe=H(null);$(()=>{const e=xe.current;e&&t===e.to?xe.current=null:e&&t===e.from||(xe.current=null,ke.reset(),be(Te.current?.getSource()??null))},[t,ke]);const Se=e=>{xe.current={from:xe.current?.from??t,to:e},n(e)},Ee=e=>({text:t,start:e?.selectionStart??ve?.start??t.length,end:e?.selectionEnd??ve?.end??t.length}),[we,Ce]=V(ce),Ne=Q&&!(y&&we),Te=H(null),Re=P(),[Ke,je]=V(null),[Me,Be]=V(!1),$e=()=>{if(!Ne)return fe.current;const e=Te.current?.getSource()??ve;return e?{selectionStart:e.start,selectionEnd:e.end}:null},Pe=Ve({target:fe,onChange:Se}),ze=e=>(be({start:e.selectionStart,end:e.selectionEnd}),e),Ie=(e,n)=>{if(!Ne)return void Pe(t=>(n&&ke.record(Ee(t),"edit",Date.now()),ze(e(t))));const r=$e(),l=ze(e(r));n&&ke.record(Ee(r),"edit",Date.now()),je(null),l.text!==t&&Se(l.text),Te.current?.setSource(l.selectionStart,l.selectionEnd,l.text)},qe=e=>Ie(e,!0),Ae=e=>Ie(t=>{const n=Ee(t),r=ke[e](n);return r?{text:r.text,selectionStart:r.start,selectionEnd:r.end}:{text:n.text,selectionStart:n.start,selectionEnd:n.end}},!1),Ue=H(null);W(()=>{const e=Ue.current;e&&(Ue.current=null,Ne?Te.current?.setSource(e.start,e.end,t):(fe.current?.focus(),fe.current?.setSelectionRange(e.start,e.end),be(e)))},[Ne]);const[Ge,Xe]=V(null),Ye=E??A,_e=("string"==typeof w[0]?w:w.map(e=>e.style)).filter(e=>!We.has(e)),Je={};if(ve){const e=q(t,ve.start,ve.end,Ye);for(const t of _e){const n=e.has(t)||"highlight"===t&&e.has("accent");Je[t]=!!Ke?.add.includes(t)||!Ke?.drop.includes(t)&&n}Je.link=e.has("link")}const Qe=()=>{const e=$e(),n=e?.selectionStart??t.length;return{start:n,end:e?.selectionEnd??n}},Ze=e=>{if("link"!==e&&_(0,e)){const{start:n,end:r}=Qe();if(n===r&&!Ne)return void qe(n=>Oe(t,e,n,(e,t,n,r)=>I(e,t,n,r,Ye,he.placeholders)));const l=f({value:t,rules:Ye,start:n,end:r,style:e,pending:Ke});return void("pending"===l.kind?je(l.pending):qe(()=>l.result))}if("link"!==e){const n=C??((e,t,n,r)=>I(e,t,n,r,A,he.placeholders));return void qe(r=>Oe(t,e,r,n))}const n=$e(),r=n?.selectionStart??t.length,l=n?.selectionEnd??r;Be(!1),Xe({start:r,end:l,link:J(t,r,l)})},et=Boolean(ve&&ve.start!==ve.end),tt=ve?U(t,ve.start,ve.end,Ye):null,nt=ve?Ke&&void 0!==Ke.color&&Ke.at===ve.start?Ke.color:G(t,ve.start,ve.end,Ye):null,rt=a(nt,ie),lt=e=>{Ne?e?Te.current?.setSource(e.start,e.end,t):Te.current?.focus():(fe.current?.focus(),e&&fe.current?.setSelectionRange(e.start,e.end))},ot=()=>{const e=Ge;Xe(null),lt(e?{start:e.start,end:e.end}:ve)},at=()=>{const e=ct.current,t=Boolean(e&&e.querySelector(".es-copy-colors")?.contains(e.ownerDocument.activeElement));Be(!1),t&&lt(ve)},st=H(at);st.current=at,$(()=>{if(Me)return D(e=>{const t=ct.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(st.current(),!0)},()=>ct.current?.querySelector(".es-copy-colors"))},[Me]);const ct=H(null),it=Me||null!==Ge;$(()=>{const e=ct.current;if(!it||!e)return;const t=e.ownerDocument,n=()=>{Be(!1),Xe(null)},r=t=>{e.contains(t.target)||n()};let l;const o=r=>{const o=r.relatedTarget;o?e.contains(o)||n():(clearTimeout(l),l=setTimeout(()=>{const r=t.activeElement;t.hasFocus()&&r&&r!==t.body&&!e.contains(r)&&n()},0))};return t.addEventListener("pointerdown",r,!0),e.addEventListener("focusout",o),()=>{clearTimeout(l),t.removeEventListener("pointerdown",r,!0),e.removeEventListener("focusout",o)}},[it]);const ut=Ge??(Me?ve??{start:t.length,end:t.length}:null),dt=H(()=>{});dt.current=()=>{const e=ct.current,t=e?.querySelector(".rosh-tb-wrap > .es-copy-pop");if(!e||!t||!ut)return;const n=Ne?null:e.querySelector(".es-gold-layer"),r=Ne?Te.current?.rangeOf(ut.start,ut.end)??null:n?s(n,ut.start,ut.end):null,l=r?.endContainer,o=l?1===l.nodeType?l:l.parentElement:null,a=r?c(r,o?.closest(".es-rich-line, .es-gold-layer")??null):null;if(!a)return;const p=i({anchor:a,size:{width:t.offsetWidth,height:t.offsetHeight},within:e.getBoundingClientRect(),clip:d(e),parent:u(t)});t.style.top=`${p.top}px`,t.style.left=`${p.left}px`,t.style.setProperty("--es-pop-point",`${p.point}px`),t.dataset.side=p.above?"above":"below"},W(()=>{const e=ct.current;if(!it||!e)return;const t=()=>dt.current();t();const n=e.ownerDocument.defaultView;n?.addEventListener("resize",t);const r=e.querySelector(".rosh-tb-wrap > .es-copy-pop"),l=n?.ResizeObserver,o=l&&r?new l(t):null;return o&&r&&o.observe(r),()=>{n?.removeEventListener("resize",t),o?.disconnect()}},[it,Me,Ge,ut?.start,ut?.end,Ne]);const pt="always"===z||ge||null!==Ge||Me,ht=ie&&ie.length>0?{run:rt,open:Me,onToggle:()=>{Xe(null),Me?at():Be(!0)}}:void 0,mt=pt?pe?pe({className:"rosh-tb-btn",disabled:S,selected:et,keepCaret:e=>e.preventDefault(),insert:e=>qe(n=>Le(t,e,n)),style:et&&ve?X(t,ve.start,ve.end,Ye):null,applyStyle:e=>{if(S)return;const{start:n,end:r}=Qe();if(n===r)return;const l=p({value:t,start:n,end:r,id:e,rules:Ye});l?qe(()=>l):((e,n)=>{be({start:e,end:n}),Ne?Te.current?.setSource(e,n,t):(fe.current?.focus(),fe.current?.setSelectionRange(e,n))})(n,r)}}):"classic"===K?R:void 0:void 0,ft=new Set(_e),gt=L?{value:L.value,allow:L.allow,onChange:L.onChange,disabled:L.disabled}:void 0,yt={pressed:tt,onList:e=>{const{start:n,end:r}=Qe(),l=U(t,n,r,Ye);qe(()=>ee(t,n,r,l===e?null:e,Ye))}},vt=h(ve,t.length),bt=S||Y(t,vt.start,vt.end,Ye).text===t?void 0:{onClear:()=>{const{start:e,end:n}=h(Qe(),t.length);qe(()=>Y(t,e,n,Ye))}},kt=T({offered:ft,color:ht,last:mt,alignment:gt,list:yt,letterCase:de,clear:bt});/* @__PURE__ */
20
- return oe("div",{ref:ct,className:"es-copy"+(k?` ${k}`:""),onFocus:()=>ye(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||ye(!1)},onKeyDown:e=>{const t=e.target===fe.current||Boolean(e.target.closest?.(".es-rich"));if(S||!t)return;if(e.altKey||e.metaKey===e.ctrlKey)return;const n=e.key.toLowerCase(),r="KeyZ"===e.code||"z"===n,l=("KeyY"===e.code||"y"===n)&&!e.shiftKey;if(r||l)return e.preventDefault(),e.stopPropagation(),void Ae(l||e.shiftKey?"redo":"undo");const o={b:"bold",i:"italic",u:"underline",k:"link"}[`${e.shiftKey?"shift+":""}${n}`];o&&_e.includes(o)&&(e.preventDefault(),e.stopPropagation(),Ze(o))},onPaste:e=>{const n=fe.current;if(S||!n||e.target!==n)return;e.preventDefault();const r=g({html:e.clipboardData.getData("text/html"),text:e.clipboardData.getData("text/plain")},{doc:n.ownerDocument,multiline:y,rules:Ye});qe(e=>Le(t,r,e))},style:ie&&ie.length>0?Object.fromEntries(ie.map(e=>[`--es-color-${e.name}`,e.value])):void 0,onSelect:()=>{const e=fe.current;e&&e.ownerDocument.activeElement===e&&be({start:e.selectionStart??t.length,end:e.selectionEnd??t.length})},children:[pt&&(kt.words||kt.paragraph)?
21
- /* @__PURE__ */ae(O,{className:"es-copy-toolbar","aria-label":j??he.formatting,offered:ft,pressed:Je,onMark:e=>Ze(e),color:ht,linkOpen:null!==Ge,last:mt,alignment:gt,list:yt,letterCase:de,clear:bt,disabled:S,windows:/* @__PURE__ */oe(se,{children:[Me&&ie&&ie.length>0?/* @__PURE__ */ae(m,{colors:ie,current:nt,words:he.colors??x.colors,onPick:e=>{const{start:n,end:r}=Qe();if(n!==r)qe(()=>Z(t,n,r,e,Ye));else{if(!Ne)return;je({add:Ke?.add??[],drop:Ke?.drop??[],color:e,at:n})}}}):null,Ge?Ge&&/* @__PURE__ */ae(F,{className:"es-copy-link es-copy-pop",value:Ge.link?.href??"",onApply:e=>{const n=Ge;Xe(null),qe(()=>Ne?re(t,n.start,n.end,e,Ye):le(t,n.start,n.end,e))},onRemove:Ge.link?()=>{const e=Ge.link,n=Ge;Xe(null),e&&qe(()=>Ne?te(t,n.start,n.end,Ye):ne(t,e))}:void 0,onCancel:ot}):null]})}):null,ue&&ue.length>0?/* @__PURE__ */ae(He,{cells:ue,words:he.cells??x.cells,readOnly:S}):null,Ne?/* @__PURE__ */ae(Fe,{value:t,rules:Ye,multiline:y,readOnly:S,placeholder:v,ariaLabel:b,handle:Te,pending:Ke??void 0,onEdit:(e,n,r)=>{ke.record({text:t,start:n.start,end:n.end},r,Date.now()),je(null),Se(e)},onSelect:e=>{be(t=>t&&t.start===e.start&&t.end===e.end?t:e),!Ke||e.start===Ke.at&&e.end===Ke.at||je(null)},onHistory:Ae,onFormat:e=>{_e.includes(e)&&Ze(e)},onCommit:r,onCancel:l}):/* @__PURE__ */ae(De,{value:t,onInput:e=>{ke.record(Ee(null),"type",Date.now()),Se(e)},onCommit:r,onCancel:l,multiline:y,placeholder:v,ariaLabel:b,rules:E,disabled:S,inputRef:fe,className:"es-copy-box"}),M?M({focused:ge,insert:e=>qe(n=>Le(t,e,n))}):null,Q&&y?
19
+ /* @__PURE__ */ae(S,{id:c,value:Fe(e.value,t),styleValue:Fe(e.styleValue,t),onChange:n=>e.onChange(void 0===n?void 0:Number((n/t).toFixed(6))),min:e.min,max:e.max,step:s,shiftStep:e.shiftStep,icon:e.icon,unit:a||void 0,steppers:"compact",readOnly:n,ariaLabel:o,title:r.tip({name:o,step:s,unit:a})})]},e.key)})})})}function Ve({target:e,onChange:t}){const n=H(null);return W(()=>{const t=n.current,r=e.current;t&&r&&r.value===t.text&&(n.current=null,r.focus(),r.setSelectionRange(t.start,t.end))}),r=>{const l=r(e.current);t(l.text),n.current={start:l.selectionStart,end:l.selectionEnd,text:l.text}}}var We=/* @__PURE__ */new Set([...P,"clear"]);function $e({value:t,onChange:n,onCommit:r,onCancel:l,multiline:y=!1,placeholder:v,ariaLabel:b,className:k,readOnly:S=!1,rules:E,tools:w=[],writeMark:C,align:L,actions:R,toolbar:K,barLabel:j,renderFooter:B,inputRef:F,barShows:P="always",richText:Z=!0,defaultShowMarks:ce=!1,colors:ie,cells:ue,letterCase:de,lastTool:pe}){const he=N("copy",x),me=H(null),fe=F??me,[ge,ye]=V(!1),[ve,be]=V(null),ke=H(o()).current,xe=H(null);$(()=>{const e=xe.current;e&&t===e.to?xe.current=null:e&&t===e.from||(xe.current=null,ke.reset(),be(Te.current?.getSource()??null))},[t,ke]);const Se=e=>{xe.current={from:xe.current?.from??t,to:e},n(e)},Ee=e=>({text:t,start:e?.selectionStart??ve?.start??t.length,end:e?.selectionEnd??ve?.end??t.length}),[we,Ce]=V(ce),Ne=Z&&!(y&&we),Te=H(null),Re=I(),[Ke,je]=V(null),[Be,Fe]=V(!1),$e=()=>{if(!Ne)return fe.current;const e=Te.current?.getSource()??ve;return e?{selectionStart:e.start,selectionEnd:e.end}:null},Ie=Ve({target:fe,onChange:Se}),Pe=e=>(be({start:e.selectionStart,end:e.selectionEnd}),e),ze=(e,n)=>{if(!Ne)return void Ie(t=>(n&&ke.record(Ee(t),"edit",Date.now()),Pe(e(t))));const r=$e(),l=Pe(e(r));n&&ke.record(Ee(r),"edit",Date.now()),je(null),l.text!==t&&Se(l.text),Te.current?.setSource(l.selectionStart,l.selectionEnd,l.text)},Ue=e=>ze(e,!0),qe=e=>ze(t=>{const n=Ee(t),r=ke[e](n);return r?{text:r.text,selectionStart:r.start,selectionEnd:r.end}:{text:n.text,selectionStart:n.start,selectionEnd:n.end}},!1),Ae=H(null);W(()=>{const e=Ae.current;e&&(Ae.current=null,Ne?Te.current?.setSource(e.start,e.end,t):(fe.current?.focus(),fe.current?.setSelectionRange(e.start,e.end),be(e)))},[Ne]);const[Ge,Xe]=V(null),Ye=E??q,_e=("string"==typeof w[0]?w:w.map(e=>e.style)).filter(e=>!We.has(e)),Qe={};if(ve){const e=U(t,ve.start,ve.end,Ye);for(const t of _e){const n=e.has(t)||"highlight"===t&&e.has("accent");Qe[t]=!!Ke?.add.includes(t)||!Ke?.drop.includes(t)&&n}Qe.link=e.has("link")}const Ze=()=>{const e=$e(),n=e?.selectionStart??t.length;return{start:n,end:e?.selectionEnd??n}},Je=e=>{if("link"!==e&&_(0,e)){const{start:n,end:r}=Ze();if(n===r&&!Ne)return void Ue(n=>Oe(t,e,n,(e,t,n,r)=>z(e,t,n,r,Ye,he.placeholders)));const l=f({value:t,rules:Ye,start:n,end:r,style:e,pending:Ke});return void("pending"===l.kind?je(l.pending):Ue(()=>l.result))}if("link"!==e){const n=C??((e,t,n,r)=>z(e,t,n,r,q,he.placeholders));return void Ue(r=>Oe(t,e,r,n))}const n=$e(),r=n?.selectionStart??t.length,l=n?.selectionEnd??r;Fe(!1),Xe({start:r,end:l,link:Q(t,r,l)})},et=Boolean(ve&&ve.start!==ve.end),tt=ve?A(t,ve.start,ve.end,Ye):null,nt=ve?Ke&&void 0!==Ke.color&&Ke.at===ve.start?Ke.color:G(t,ve.start,ve.end,Ye):null,rt=a(nt,ie),lt=e=>{Ne?e?Te.current?.setSource(e.start,e.end,t):Te.current?.focus():(fe.current?.focus(),e&&fe.current?.setSelectionRange(e.start,e.end))},ot=()=>{const e=Ge;Xe(null),lt(e?{start:e.start,end:e.end}:ve)},at=()=>{const e=ct.current,t=Boolean(e&&e.querySelector(".es-copy-colors")?.contains(e.ownerDocument.activeElement));Fe(!1),t&&lt(ve)},st=H(at);st.current=at,$(()=>{if(Be)return D(e=>{const t=ct.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(st.current(),!0)},()=>ct.current?.querySelector(".es-copy-colors"))},[Be]);const ct=H(null),it=Be||null!==Ge;$(()=>{const e=ct.current;if(!it||!e)return;const t=e.ownerDocument,n=()=>{Fe(!1),Xe(null)},r=t=>{e.contains(t.target)||n()};let l;const o=r=>{const o=r.relatedTarget;o?e.contains(o)||n():(clearTimeout(l),l=setTimeout(()=>{const r=t.activeElement;t.hasFocus()&&r&&r!==t.body&&!e.contains(r)&&n()},0))};return t.addEventListener("pointerdown",r,!0),e.addEventListener("focusout",o),()=>{clearTimeout(l),t.removeEventListener("pointerdown",r,!0),e.removeEventListener("focusout",o)}},[it]);const ut=Ge??(Be?ve??{start:t.length,end:t.length}:null),dt=H(()=>{});dt.current=()=>{const e=ct.current,t=e?.querySelector(".rosh-tb-wrap > .es-copy-pop");if(!e||!t||!ut)return;const n=Ne?null:e.querySelector(".es-gold-layer"),r=Ne?Te.current?.rangeOf(ut.start,ut.end)??null:n?s(n,ut.start,ut.end):null,l=r?.endContainer,o=l?1===l.nodeType?l:l.parentElement:null,a=r?c(r,o?.closest(".es-rich-line, .es-gold-layer")??null):null;if(!a)return;const p=i({anchor:a,size:{width:t.offsetWidth,height:t.offsetHeight},within:e.getBoundingClientRect(),clip:d(e),parent:u(t)});t.style.top=`${p.top}px`,t.style.left=`${p.left}px`,t.style.setProperty("--es-pop-point",`${p.point}px`),t.dataset.side=p.above?"above":"below"},W(()=>{const e=ct.current;if(!it||!e)return;const t=()=>dt.current();t();const n=e.ownerDocument.defaultView;n?.addEventListener("resize",t);const r=e.querySelector(".rosh-tb-wrap > .es-copy-pop"),l=n?.ResizeObserver,o=l&&r?new l(t):null;return o&&r&&o.observe(r),()=>{n?.removeEventListener("resize",t),o?.disconnect()}},[it,Be,Ge,ut?.start,ut?.end,Ne]);const pt="always"===P||ge||null!==Ge||Be,ht=ie&&ie.length>0?{run:rt,open:Be,onToggle:()=>{Xe(null),Be?at():Fe(!0)}}:void 0,mt=pt?pe?pe({className:"rosh-tb-btn",disabled:S,selected:et,keepCaret:e=>e.preventDefault(),insert:e=>Ue(n=>Le(t,e,n)),style:et&&ve?X(t,ve.start,ve.end,Ye):null,applyStyle:e=>{if(S)return;const{start:n,end:r}=Ze();if(n===r)return;const l=p({value:t,start:n,end:r,id:e,rules:Ye});l?Ue(()=>l):((e,n)=>{be({start:e,end:n}),Ne?Te.current?.setSource(e,n,t):(fe.current?.focus(),fe.current?.setSelectionRange(e,n))})(n,r)}}):"classic"===K?R:void 0:void 0,ft=new Set(_e),gt=L?{value:L.value,allow:L.allow,onChange:L.onChange,disabled:L.disabled}:void 0,yt={pressed:tt,onList:e=>{const{start:n,end:r}=Ze(),l=A(t,n,r,Ye);Ue(()=>ee(t,n,r,l===e?null:e,Ye))}},vt=h(ve,t.length),bt=S||Y(t,vt.start,vt.end,Ye).text===t?void 0:{onClear:()=>{const{start:e,end:n}=h(Ze(),t.length);Ue(()=>Y(t,e,n,Ye))}},kt=T({offered:ft,color:ht,last:mt,alignment:gt,list:yt,letterCase:de,clear:bt});/* @__PURE__ */
20
+ return oe("div",{ref:ct,className:"es-copy"+(k?` ${k}`:""),onFocus:()=>ye(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||ye(!1)},onKeyDown:e=>{const t=e.target===fe.current||Boolean(e.target.closest?.(".es-rich"));if(S||!t)return;if(e.altKey||e.metaKey===e.ctrlKey)return;const n=e.key.toLowerCase(),r="KeyZ"===e.code||"z"===n,l=("KeyY"===e.code||"y"===n)&&!e.shiftKey;if(r||l)return e.preventDefault(),e.stopPropagation(),void qe(l||e.shiftKey?"redo":"undo");const o={b:"bold",i:"italic",u:"underline",k:"link"}[`${e.shiftKey?"shift+":""}${n}`];o&&_e.includes(o)&&(e.preventDefault(),e.stopPropagation(),Je(o))},onPaste:e=>{const n=fe.current;if(S||!n||e.target!==n)return;e.preventDefault();const r=g({html:e.clipboardData.getData("text/html"),text:e.clipboardData.getData("text/plain")},{doc:n.ownerDocument,multiline:y,rules:Ye});Ue(e=>Le(t,r,e))},style:ie&&ie.length>0?Object.fromEntries(ie.map(e=>[`--es-color-${e.name}`,e.value])):void 0,onSelect:()=>{const e=fe.current;e&&e.ownerDocument.activeElement===e&&be({start:e.selectionStart??t.length,end:e.selectionEnd??t.length})},children:[pt&&(kt.words||kt.paragraph)?
21
+ /* @__PURE__ */ae(O,{className:"es-copy-toolbar","aria-label":j??he.formatting,offered:ft,pressed:Qe,onMark:e=>Je(e),color:ht,linkOpen:null!==Ge,last:mt,alignment:gt,list:yt,letterCase:de,clear:bt,disabled:S,windows:/* @__PURE__ */oe(se,{children:[Be&&ie&&ie.length>0?/* @__PURE__ */ae(m,{colors:ie,current:nt,words:he.colors??x.colors,onPick:e=>{const{start:n,end:r}=Ze();if(n!==r)Ue(()=>J(t,n,r,e,Ye));else{if(!Ne)return;je({add:Ke?.add??[],drop:Ke?.drop??[],color:e,at:n})}}}):null,Ge?Ge&&/* @__PURE__ */ae(M,{className:"es-copy-link es-copy-pop",value:Ge.link?.href??"",onApply:e=>{const n=Ge;Xe(null),Ue(()=>Ne?re(t,n.start,n.end,e,Ye):le(t,n.start,n.end,e))},onRemove:Ge.link?()=>{const e=Ge.link,n=Ge;Xe(null),e&&Ue(()=>Ne?te(t,n.start,n.end,Ye):ne(t,e))}:void 0,onCancel:ot}):null]})}):null,ue&&ue.length>0?/* @__PURE__ */ae(He,{cells:ue,words:he.cells??x.cells,readOnly:S}):null,Ne?/* @__PURE__ */ae(Me,{value:t,rules:Ye,multiline:y,readOnly:S,placeholder:v,ariaLabel:b,handle:Te,pending:Ke??void 0,onEdit:(e,n,r)=>{ke.record({text:t,start:n.start,end:n.end},r,Date.now()),je(null),Se(e)},onSelect:e=>{be(t=>t&&t.start===e.start&&t.end===e.end?t:e),!Ke||e.start===Ke.at&&e.end===Ke.at||je(null)},onHistory:qe,onFormat:e=>{_e.includes(e)&&Je(e)},onCommit:r,onCancel:l}):/* @__PURE__ */ae(De,{value:t,onInput:e=>{ke.record(Ee(null),"type",Date.now()),Se(e)},onCommit:r,onCancel:l,multiline:y,placeholder:v,ariaLabel:b,rules:E,disabled:S,inputRef:fe,className:"es-copy-box"}),B?B({focused:ge,insert:e=>Ue(n=>Le(t,e,n))}):null,Z&&y?
22
22
  /* @__PURE__ */oe("div",{className:"es-copy-marks",children:[
23
- /* @__PURE__ */ae(e,{checked:we,onChange:()=>{const e=$e();Ue.current=e&&null!==e.selectionStart&&null!==e.selectionEnd?{start:e.selectionStart,end:e.selectionEnd}:ve,je(null),Ce(e=>!e)},ariaLabelledBy:Re,disabled:S}),
24
- /* @__PURE__ */ae("span",{id:Re,className:"es-copy-marks-label",children:he.showMarks??"Show marks"})]}):null]})}var Pe=["none","bullet","number"],ze=t,Ie={none:/* @__PURE__ */ae(ke,{}),bullet:/* @__PURE__ */ae(be,{}),number:/* @__PURE__ */ae(ve,{})},qe={none:/* @__PURE__ */ae(we,{}),upper:/* @__PURE__ */ae(Ee,{}),capitalize:/* @__PURE__ */ae(Se,{}),lower:/* @__PURE__ */ae(xe,{})};function Ae({label:e,icon:t,answers:n,names:r,glyphs:l,row:o,readOnly:a}){const s=o.value||o.styleValue||"";/* @__PURE__ */
25
- return ae(C,{label:e,icon:t,children:/* @__PURE__ */ae(w,{ariaLabel:e,value:s,disabled:a,onChange:e=>{a||o.onChange(function(e,t){return t===e.value||""===e.value&&t===e.styleValue?"":t}(o,e))},options:n.map(e=>({id:e,label:l[e],title:r[e]}))})})}function Ue({kept:e,keptHint:t,readOnly:n=!1,style:r,font:l,italic:o,cells:a,align:s,list:c,letterCase:i}){const u=N("copy",x),d=L(R().textToolbar),p=Object.fromEntries(K(j).map(e=>[e.value,e.icon])),h={...x.panel,...u.panel},m=r&&!n?[r.onEditStyles&&{label:h.editStyles,onSelect:r.onEditStyles},r.onUpdateStyle&&{label:h.updateStyle,onSelect:r.onUpdateStyle}].filter(e=>!!e):[],f=!!o&&(o.value??o.styleValue??!1),g=o?/* @__PURE__ */ae(M,{content:h.italic,children:/* @__PURE__ */ae(B,{size:"md",variant:"ghost","aria-label":h.italic,"aria-pressed":f,disabled:n,onClick:()=>{if(n)return;const e=!f;o.onChange(e===(o.styleValue??!1)?void 0:e)},children:/* @__PURE__ */ae(ye,{})})}):null;/* @__PURE__ */
23
+ /* @__PURE__ */ae(e,{checked:we,onChange:()=>{const e=$e();Ae.current=e&&null!==e.selectionStart&&null!==e.selectionEnd?{start:e.selectionStart,end:e.selectionEnd}:ve,je(null),Ce(e=>!e)},ariaLabelledBy:Re,disabled:S}),
24
+ /* @__PURE__ */ae("span",{id:Re,className:"es-copy-marks-label",children:he.showMarks??"Show marks"})]}):null]})}var Ie=["none","bullet","number"],Pe=t,ze={none:/* @__PURE__ */ae(ke,{}),bullet:/* @__PURE__ */ae(be,{}),number:/* @__PURE__ */ae(ve,{})},Ue={none:/* @__PURE__ */ae(we,{}),upper:/* @__PURE__ */ae(Ee,{}),capitalize:/* @__PURE__ */ae(Se,{}),lower:/* @__PURE__ */ae(xe,{})};function qe({label:e,icon:t,answers:n,names:r,glyphs:l,row:o,readOnly:a}){const s=o.value||o.styleValue||"";/* @__PURE__ */
25
+ return ae(C,{label:e,icon:t,children:/* @__PURE__ */ae(w,{ariaLabel:e,value:s,disabled:a,onChange:e=>{a||o.onChange(function(e,t){return t===e.value||""===e.value&&t===e.styleValue?"":t}(o,e))},options:n.map(e=>({id:e,label:l[e],title:r[e]}))})})}function Ae({kept:e,keptHint:t,readOnly:n=!1,style:r,font:l,italic:o,cells:a,align:s,list:c,letterCase:i}){const u=N("copy",x),d=L(R().textToolbar),p=Object.fromEntries(K(j).map(e=>[e.value,e.icon])),h={...x.panel,...u.panel},m=r&&!n?[r.onEditStyles&&{label:h.editStyles,onSelect:r.onEditStyles},r.onUpdateStyle&&{label:h.updateStyle,onSelect:r.onUpdateStyle}].filter(e=>!!e):[],f=!!o&&(o.value??o.styleValue??!1),g=o?/* @__PURE__ */ae(B,{content:h.italic,children:/* @__PURE__ */ae(F,{size:"md",variant:"ghost","aria-label":h.italic,"aria-pressed":f,disabled:n,onClick:()=>{if(n)return;const e=!f;o.onChange(e===(o.styleValue??!1)?void 0:e)},children:/* @__PURE__ */ae(ye,{})})}):null;/* @__PURE__ */
26
26
  return oe("div",{className:"es-tpp",children:[e?/* @__PURE__ */oe("div",{className:"es-tpp-kept",children:[
27
27
  /* @__PURE__ */ae($e,{...e,readOnly:n||e.readOnly}),t?/* @__PURE__ */ae("p",{className:"es-field-hint",children:t}):null]}):null,r?/* @__PURE__ */ae(C,{label:h.style,icon:/* @__PURE__ */ae(pe,{}),children:/* @__PURE__ */ae(E,{ariaLabel:h.style,value:r.value,options:r.options,onChange:r.onChange,changed:r.changed,footer:m,readOnly:n})}):null,l?/* @__PURE__ */ae(C,{label:h.font,icon:/* @__PURE__ */ae(he,{}),children:/* @__PURE__ */oe("div",{className:"es-tpp-font",children:[
28
28
  /* @__PURE__ */ae("div",{className:"es-tpp-font-select",children:/* @__PURE__ */ae(E,{ariaLabel:h.font,value:l.value||void 0,placeholder:l.styleValue,options:l.options,onChange:l.onChange,searchable:l.searchable,readOnly:n})}),g]})}):g?
29
- /* @__PURE__ */ae(C,{label:h.italic,icon:/* @__PURE__ */ae(he,{}),children:/* @__PURE__ */ae("div",{className:"es-tpp-font",children:g})}):null,a?.length?/* @__PURE__ */ae(He,{cells:a,words:u.cells,readOnly:n}):null,s?/* @__PURE__ */ae(Ae,{label:u.alignment,icon:/* @__PURE__ */ae(me,{}),answers:j.filter(e=>!s.allow||s.allow.includes(e)),names:d,glyphs:p,row:s,readOnly:n}):null,c?/* @__PURE__ */ae(Ae,{label:h.list,icon:/* @__PURE__ */ae(fe,{}),answers:Pe,names:h.lists,glyphs:Ie,row:c,readOnly:n}):null,i?/* @__PURE__ */ae(Ae,{label:h.capitalization,icon:/* @__PURE__ */ae(ge,{}),answers:ze,names:h.cases,glyphs:qe,row:i,readOnly:n}):null]})}export{Me as COPY_CELLS,$e as CopyBox,He as CopyCells,Fe as RichBox,Ue as TextPartPanel,Le as insertSelection,Oe as markSelection,Ve as useCaretEdit};
29
+ /* @__PURE__ */ae(C,{label:h.italic,icon:/* @__PURE__ */ae(he,{}),children:/* @__PURE__ */ae("div",{className:"es-tpp-font",children:g})}):null,a?.length?/* @__PURE__ */ae(He,{cells:a,words:u.cells,readOnly:n}):null,s?/* @__PURE__ */ae(qe,{label:u.alignment,icon:/* @__PURE__ */ae(me,{}),answers:j.filter(e=>!s.allow||s.allow.includes(e)),names:d,glyphs:p,row:s,readOnly:n}):null,c?/* @__PURE__ */ae(qe,{label:h.list,icon:/* @__PURE__ */ae(fe,{}),answers:Ie,names:h.lists,glyphs:ze,row:c,readOnly:n}):null,i?/* @__PURE__ */ae(qe,{label:h.capitalization,icon:/* @__PURE__ */ae(ge,{}),answers:Pe,names:h.cases,glyphs:Ue,row:i,readOnly:n}):null]})}export{Be as COPY_CELLS,$e as CopyBox,He as CopyCells,Me as RichBox,Ae as TextPartPanel,Le as insertSelection,Oe as markSelection,Ve as useCaretEdit};
@@ -1,6 +1,6 @@
1
1
  import { N as Node, D as Data, a as DataConfig, S as SlotAddress, F as Found, P as Place, b as SlotEntry, W as WalkInfo } from '../types-Dq180WRV.js';
2
2
  export { B as BlockShape, c as FieldShape, d as FieldsShape, e as NodeProps, R as RootData } from '../types-Dq180WRV.js';
3
- export { R as ResolvableItem, a as ResolveCache, b as ResolveOptions, c as ResolveTrigger, d as changedProps, e as createResolveCache, f as deepEqual, r as resolveNodeData } from '../resolve-Bz4mszpL.js';
3
+ export { P as PhoneOrder, R as ResolvableItem, a as ResolveCache, b as ResolveOptions, c as ResolveTrigger, d as carryPhoneOrder, e as changedProps, f as createResolveCache, g as deepEqual, i as isCustomPhoneOrder, m as movePhoneOrder, n as normalizePhoneOrder, r as resolveNodeData, s as settlePhoneOrder } from '../phone-order-CRKvsTsz.js';
4
4
 
5
5
  /**
6
6
  * Finding a node's slots, and reading or writing a value at a prop path.
@@ -215,6 +215,7 @@ declare function copyTranslation(overlay: TranslationOverlay | null | undefined,
215
215
  * normalizeData what the easel does to a document it opens
216
216
  * createNode · newId make a block the way the Add panel does
217
217
  * applyTranslation · … a page's other languages, kept beside it (./translate)
218
+ * normalizePhoneOrder · … the order children stack in on a phone (./phone-order)
218
219
  *
219
220
  * THE FORMAT DOES NOT CHANGE. A document goes in and comes out in exactly the
220
221
  * shape Puck 0.20 saves (see ./types). Four rules keep it that way, and the
@@ -1 +1 @@
1
- export{DataError,ROOT_ID,ROOT_LIST,ROOT_SLOT,applyTranslation,changedProps,clone,copyNode,copyTranslation,createNode,createResolveCache,deepEqual,duplicate,extractTranslation,find,getList,insert,mapIds,move,newId,normalizeData,parseZoneKey,pruneTranslation,rebaseTranslation,remove,replaceNode,resolveNodeData,setProps,setRoot,slotsOf,translatablePaths,translationFingerprint,translationStatus,walk,zoneKey}from"../chunk-EUFDQ4KL.js";export{getIn,isNode,isNodeList}from"../chunk-KXM6YRG2.js";
1
+ export{DataError,ROOT_ID,ROOT_LIST,ROOT_SLOT,applyTranslation,carryPhoneOrder,changedProps,clone,copyNode,copyTranslation,createNode,createResolveCache,deepEqual,duplicate,extractTranslation,find,getList,insert,isCustomPhoneOrder,mapIds,move,movePhoneOrder,newId,normalizeData,normalizePhoneOrder,parseZoneKey,pruneTranslation,rebaseTranslation,remove,replaceNode,resolveNodeData,setProps,setRoot,settlePhoneOrder,slotsOf,translatablePaths,translationFingerprint,translationStatus,walk,zoneKey}from"../chunk-YDTEYXQW.js";export{getIn,isNode,isNodeList}from"../chunk-KXM6YRG2.js";
@@ -1 +1 @@
1
- export{AddPanel,CanvasDragLayer,CanvasInsert,EMPTY_MEASURE,HANDLE_GRACE_MS,canvasTarget,contains,gapInZone,gapLine,insertSeams,measureCanvas,pickSource,seamsBetween,sourcesAt}from"../chunk-SQTVXE5D.js";import"../chunk-TQ5Y6S2X.js";export{AUTO_SCROLL_EDGE,AUTO_SCROLL_MAX_SPEED,autoScrollDelta,autoScrollSpeed,createDragSession,dropEffectFor,dropOnRow,frameScrollBox,gapToMoveIndex,isNoOpDrop,scrollBoxOf,scrollParent,startAutoScroll,stepGap,useTreeDrag}from"../chunk-3XECMGXX.js";import"../chunk-P2VEMZH5.js";import"../chunk-TOKMFZPB.js";import"../chunk-FR7EEKFF.js";import"../chunk-7UFKEX72.js";import"../chunk-EUFDQ4KL.js";import"../chunk-KXM6YRG2.js";
1
+ export{AddPanel,CanvasDragLayer,CanvasInsert,EMPTY_MEASURE,HANDLE_GRACE_MS,canvasTarget,contains,gapInZone,gapLine,insertSeams,measureCanvas,pickSource,seamsBetween,sourcesAt}from"../chunk-SEC6NV6Y.js";import"../chunk-TQ5Y6S2X.js";export{AUTO_SCROLL_EDGE,AUTO_SCROLL_MAX_SPEED,autoScrollDelta,autoScrollSpeed,createDragSession,dropEffectFor,dropOnRow,frameScrollBox,gapToMoveIndex,isNoOpDrop,scrollBoxOf,scrollParent,startAutoScroll,stepGap,useTreeDrag}from"../chunk-QEEW4X64.js";import"../chunk-P2VEMZH5.js";import"../chunk-YDTEYXQW.js";import"../chunk-KXM6YRG2.js";import"../chunk-6GJEOER4.js";import"../chunk-FR7EEKFF.js";import"../chunk-7UFKEX72.js";
@@ -4,7 +4,7 @@ export { I as ItemSelector } from '../plan-D0DgSLnY.js';
4
4
  import { E as EaselConfig, a as EaselView, b as EaselAction, P as Permissions, c as EaselCore, d as EaselUi } from '../types-BljCVdzR.js';
5
5
  export { A as AppState, e as EaselHistory, H as HistoryEntry, S as SetDataPatch } from '../types-BljCVdzR.js';
6
6
  import { S as SlotAddress, D as Data, a as DataConfig, P as Place, N as Node } from '../types-Dq180WRV.js';
7
- import { c as ResolveTrigger, a as ResolveCache, R as ResolvableItem } from '../resolve-Bz4mszpL.js';
7
+ import { c as ResolveTrigger, a as ResolveCache, R as ResolvableItem } from '../phone-order-CRKvsTsz.js';
8
8
  import * as react from 'react';
9
9
  import { ReactNode, CSSProperties, ComponentType, ReactElement } from 'react';
10
10
  import { TextToolbarProps } from 'efficient-shell/ui';
@@ -1 +1 @@
1
- export{CHROME_ATTR,CanvasChromeContext,CanvasFrame,CanvasPartsContext,CanvasPassThroughContext,CanvasSharedContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,RootHostScope,bindUndoKeys,createEasel,createUseEasel,partHasOwnBox,recordsByDefault,reduce,subscribeLateWrites,uiView,useEasel,useEaselApi,useEaselNodeOps,useRootFields,useSelectedFields,useSelectedHost,useSettledAction,useSettledPress,validSelection,writesSettled}from"../chunk-3W2O22DZ.js";export{repeatCopyAt}from"../chunk-JQQFB7EZ.js";import"../chunk-TBY3DFKS.js";import"../chunk-K53PQAMP.js";import"../chunk-QTHQPJWA.js";import"../chunk-MNQDOSAX.js";import"../chunk-PMRN5Z3T.js";import"../chunk-MFIRYGHW.js";import"../chunk-TOKMFZPB.js";import"../chunk-FR7EEKFF.js";import"../chunk-7UFKEX72.js";import"../chunk-EUFDQ4KL.js";import"../chunk-KXM6YRG2.js";
1
+ export{CHROME_ATTR,CanvasChromeContext,CanvasFrame,CanvasPartsContext,CanvasPassThroughContext,CanvasSharedContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,RootHostScope,bindUndoKeys,createEasel,createUseEasel,partHasOwnBox,recordsByDefault,reduce,subscribeLateWrites,uiView,useEasel,useEaselApi,useEaselNodeOps,useRootFields,useSelectedFields,useSelectedHost,useSettledAction,useSettledPress,validSelection,writesSettled}from"../chunk-L36E2WCO.js";export{repeatCopyAt}from"../chunk-XT75WETI.js";import"../chunk-TBY3DFKS.js";import"../chunk-LDHUPZBK.js";import"../chunk-TF6NAIV7.js";import"../chunk-MNQDOSAX.js";import"../chunk-PMRN5Z3T.js";import"../chunk-MFIRYGHW.js";import"../chunk-YDTEYXQW.js";import"../chunk-KXM6YRG2.js";import"../chunk-6GJEOER4.js";import"../chunk-FR7EEKFF.js";import"../chunk-7UFKEX72.js";
@@ -1 +1 @@
1
- export{CLAIM_FAIL_OPEN_MS,EDIT_LOCK_TAKEN,FAIL_OPEN_RETRY_MS,accessForNewDocument,canWriteDocument,createEditLock,describeAge,documentPermissions,documentVersionMoved,holderOf,nameOrSomeone,newEaselClientId,openUnansweredClaim,readLockHolder,reloadIfVersionMoved,shouldReleaseHeldWrite,shouldReloadAfterTakeover}from"../chunk-YYD257TD.js";import"../chunk-RE4LP46F.js";import"../chunk-EUFDQ4KL.js";import"../chunk-KXM6YRG2.js";
1
+ export{CLAIM_FAIL_OPEN_MS,EDIT_LOCK_TAKEN,FAIL_OPEN_RETRY_MS,accessForNewDocument,canWriteDocument,createEditLock,describeAge,documentPermissions,documentVersionMoved,holderOf,nameOrSomeone,newEaselClientId,openUnansweredClaim,readLockHolder,reloadIfVersionMoved,shouldReleaseHeldWrite,shouldReloadAfterTakeover}from"../chunk-G7J6SGMF.js";import"../chunk-RE4LP46F.js";import"../chunk-YDTEYXQW.js";import"../chunk-KXM6YRG2.js";
@@ -173,3 +173,11 @@ span:has(> .es-fnum) { display: flex; min-width: 0; }
173
173
 
174
174
  /* Read out after a move; never seen. */
175
175
  .es-list-said { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
176
+
177
+ /* PhoneOrderField: the fixed list, a note and the reset, 8px apart (the list's step). */
178
+ .es-phone-order { display: flex; flex-direction: column; flex: 1 1 auto; gap: 8px; min-width: 0; }
179
+ .es-phone-order > .es-list { margin-top: 0; }
180
+ .es-phone-order-row { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--text-xs, 12px); }
181
+ .es-phone-order-pos { flex: none; width: 16px; text-align: right; font-size: var(--text-2xs, 11px); font-weight: 500; font-variant-numeric: tabular-nums; color: var(--es-muted); }
182
+ .es-phone-order-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--es-text); }
183
+ .es-phone-order-note { margin: 0; font-size: var(--text-xs, 12px); line-height: 1.5; color: var(--es-muted); }
@@ -6,8 +6,8 @@ import { ShowWhenContext } from 'efficient-shell/format';
6
6
  export { ShowWhenContext, ShowWhenRule, showWhenOf, withShowWhen } from 'efficient-shell/format';
7
7
  import { a as InspectorFieldDef, b as FieldRenderer, I as InspectorFields, c as FieldTextProps, d as FieldNumberProps, e as FieldSliderProps, f as FieldSelectManyProps, g as FieldSelectOneProps, F as FieldOption } from '../types-DcyH17ij.js';
8
8
  export { A as ArrayFieldDef, C as CustomFieldDef, h as CustomFieldRenderProps, i as FieldSelectProps, N as NumberFieldDef, O as ObjectFieldDef, R as RadioFieldDef, S as SelectFieldDef, j as SlotFieldDef, T as TextFieldDef, k as TextareaFieldDef } from '../types-DcyH17ij.js';
9
- import { R as ResolvableItem } from '../resolve-Bz4mszpL.js';
10
- export { F as FieldsWords } from '../words-CFkb8XtN.js';
9
+ import { R as ResolvableItem, P as PhoneOrder } from '../phone-order-CRKvsTsz.js';
10
+ export { F as FieldsWords } from '../words-dNm6REMa.js';
11
11
  export { LinkFilter, LinkFilterField, LinkKindChoice, LinkOption, LinkOptionGroup, LinkPicker, LinkPickerProps, LinkRules, LinkTarget } from 'efficient-shell/ui';
12
12
  import '../types-Dq180WRV.js';
13
13
 
@@ -474,6 +474,50 @@ declare function moveTo<T>(items: readonly T[], from: number, to: number): T[];
474
474
  declare function removeAt<T>(items: readonly T[], index: number): T[];
475
475
  declare function ListField<T>({ label, icon, noun: ownNoun, items, onChange, newItem, summary, itemName, thumb, min, max, readOnly, open, onOpen, renderItem, renderRow, canRemove: removable, lockedReason, fixed, removeOnRow, canDuplicate, above, head, }: ListFieldProps<T>): react.JSX.Element;
476
476
 
477
+ /**
478
+ * "Phone order" — the control that reorders a parent's children for the PHONE
479
+ * STACK ONLY, leaving the desktop layout exactly where it is. Drawn once for
480
+ * both editors (the email section's columns, the website Box's children); the
481
+ * rule it writes through is `efficient-easel/data`'s phone order.
482
+ *
483
+ * WHY A LIST AND NOT A CANVAS DRAG. Children laid out side by side on desktop
484
+ * and stacked on a phone give a drag on the canvas two orders it could belong
485
+ * to the moment the two differ. This row is the unambiguous statement of the
486
+ * same fact: a labelled list, in phone order, that says which child stacks
487
+ * where.
488
+ *
489
+ * WHAT IT MUST NEVER LOOK LIKE is a desktop reorder. Everything is named for
490
+ * the phone (the name, the note, the reset), and the note states the
491
+ * guarantee outright ("Your desktop layout doesn't change"), since the surest
492
+ * way to stop someone worrying about that is to answer it before they ask.
493
+ * A host's own limits (the email's mail-client note) are its `children`,
494
+ * drawn under the list once an order is set.
495
+ *
496
+ * EMPTY STATE IS THE DEFAULT: until someone moves something, the list shows
497
+ * the desktop order and stores nothing. Every write goes through
498
+ * `settlePhoneOrder`, so an order put back to the desktop one is CLEARED, not
499
+ * stored. Below two children there is no order to speak of, and the row draws
500
+ * nothing at all: no name over an empty control.
501
+ */
502
+ interface PhoneOrderFieldProps {
503
+ /** The stored order (desktop positions, phone first), or undefined = follow desktop. */
504
+ value: PhoneOrder | undefined;
505
+ /** How many children the parent lays out now: the list follows it at once. */
506
+ count: number;
507
+ /** The new order, or undefined = follow desktop again. */
508
+ onChange: (next: PhoneOrder | undefined) => void;
509
+ readOnly?: boolean;
510
+ /** One child's word, lower case: "column", "block". */
511
+ noun: string;
512
+ /** A child's name by its DESKTOP position: "Column 2", "Heading". */
513
+ itemLabel: (position: number) => string;
514
+ /** The row's hint; default "The order the <noun>s stack in on a phone." */
515
+ hint?: ReactNode;
516
+ /** The host's extra lines under the list, drawn once an order is set. */
517
+ children?: ReactNode;
518
+ }
519
+ declare function PhoneOrderField({ value, count, onChange, readOnly, noun, itemLabel, hint, children, }: PhoneOrderFieldProps): react.JSX.Element | null;
520
+
477
521
  /**
478
522
  * A text value, one line or several (blueprint step 4.1, "native inputs become
479
523
  * shell controls"): the shell's `Input` / `Textarea` (harness UI-24,
@@ -586,4 +630,4 @@ declare function optionFor<V>(options: readonly FieldOption<V>[], value: V | und
586
630
  declare function FieldSelect<V>(props: FieldSelectManyProps<V>): ReactNode;
587
631
  declare function FieldSelect<V>(props: FieldSelectOneProps<V>): ReactNode;
588
632
 
589
- export { FieldNumber, FieldNumberProps, FieldOption, type FieldPlan, FieldRenderer, FieldSelect, FieldSelectManyProps, FieldSelectOneProps, FieldSlider, FieldSliderProps, FieldText, FieldTextProps, type FieldsBlock, Inspector, InspectorField, InspectorFieldDef, type InspectorFieldProps, InspectorFields, type InspectorProps, ListField, type ListFieldProps, type PlannedFold, type PlannedRow, type ResolvedFieldsInput, type RowShownInView, SettingsBucket, type ShowWhenInput, bucketsOf, fieldIsShown, fieldShownInView, innerRowCount, insertAt, labelOf, moveTo, optionFor, planFields, removeAt, rowViewState, shownFields, useResolvedFields, viewReadsIn };
633
+ export { FieldNumber, FieldNumberProps, FieldOption, type FieldPlan, FieldRenderer, FieldSelect, FieldSelectManyProps, FieldSelectOneProps, FieldSlider, FieldSliderProps, FieldText, FieldTextProps, type FieldsBlock, Inspector, InspectorField, InspectorFieldDef, type InspectorFieldProps, InspectorFields, type InspectorProps, ListField, type ListFieldProps, PhoneOrderField, type PhoneOrderFieldProps, type PlannedFold, type PlannedRow, type ResolvedFieldsInput, type RowShownInView, SettingsBucket, type ShowWhenInput, bucketsOf, fieldIsShown, fieldShownInView, innerRowCount, insertAt, labelOf, moveTo, optionFor, planFields, removeAt, rowViewState, shownFields, useResolvedFields, viewReadsIn };
@@ -1 +1 @@
1
- export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,fieldShownInView,innerRowCount,insertAt,labelOf,moveTo,planFields,removeAt,rowViewState,viewReadsIn}from"../chunk-HG65R6IN.js";export{fieldIsShown,showWhenOf,shownFields,withShowWhen}from"../chunk-BPXEFVSQ.js";import"../chunk-YCSZAP7T.js";export{FieldSlider}from"../chunk-TDEBPOWV.js";import"../chunk-WHS6Y55E.js";import"../chunk-D4TH4QQR.js";import"../chunk-K56YDHYQ.js";import"../chunk-56ID6FKZ.js";export{useResolvedFields}from"../chunk-K53PQAMP.js";import"../chunk-FIVU2COQ.js";export{FieldNumber}from"../chunk-Y2T3JX7K.js";export{FieldSelect,optionFor}from"../chunk-KFWNGPW3.js";import"../chunk-DX3VILZ3.js";import"../chunk-MIX7EGRG.js";import"../chunk-JACEEVVF.js";import"../chunk-MFIRYGHW.js";import"../chunk-3XECMGXX.js";import"../chunk-P2VEMZH5.js";import"../chunk-EUFDQ4KL.js";import"../chunk-KXM6YRG2.js";
1
+ export{FieldText,Inspector,InspectorField,LinkPicker,ListField,PhoneOrderField,bucketsOf,fieldShownInView,innerRowCount,insertAt,labelOf,moveTo,planFields,removeAt,rowViewState,viewReadsIn}from"../chunk-SDSBXW3V.js";export{fieldIsShown,showWhenOf,shownFields,withShowWhen}from"../chunk-BPXEFVSQ.js";import"../chunk-YCSZAP7T.js";export{FieldSlider}from"../chunk-TDEBPOWV.js";import"../chunk-WHS6Y55E.js";import"../chunk-D4TH4QQR.js";import"../chunk-K56YDHYQ.js";import"../chunk-56ID6FKZ.js";export{useResolvedFields}from"../chunk-LDHUPZBK.js";import"../chunk-FIVU2COQ.js";export{FieldNumber}from"../chunk-ANBPE45L.js";export{FieldSelect,optionFor}from"../chunk-C63IB4VW.js";import"../chunk-DX3VILZ3.js";import"../chunk-MIX7EGRG.js";import"../chunk-UMTUKSE6.js";import"../chunk-MFIRYGHW.js";import"../chunk-QEEW4X64.js";import"../chunk-P2VEMZH5.js";import"../chunk-YDTEYXQW.js";import"../chunk-KXM6YRG2.js";
@@ -1 +1 @@
1
- export{createNodeClipboard,nodeMenuItems}from"../chunk-P5VYGWYO.js";import"../chunk-WK3AFPXY.js";export{canStep,clickPick,clickPickPart,fromItemSelector,nextInChain,nodeChain,parentStep,planDuplicate,planMove,planPaste,planRemove,planRestore,planSetProps,planStep,planSwap,toItemSelector,useNodeOps}from"../chunk-QTHQPJWA.js";import"../chunk-EUFDQ4KL.js";import"../chunk-KXM6YRG2.js";
1
+ export{createNodeClipboard,nodeMenuItems}from"../chunk-P5VYGWYO.js";import"../chunk-WK3AFPXY.js";export{canStep,clickPick,clickPickPart,fromItemSelector,nextInChain,nodeChain,parentStep,planDuplicate,planMove,planPaste,planRemove,planRestore,planSetProps,planStep,planSwap,toItemSelector,useNodeOps}from"../chunk-TF6NAIV7.js";import"../chunk-YDTEYXQW.js";import"../chunk-KXM6YRG2.js";
@@ -0,0 +1,141 @@
1
+ import { a as DataConfig } from './types-Dq180WRV.js';
2
+
3
+ /**
4
+ * A BLOCK'S `resolveData`, RUN AS THE OLD LIBRARY RAN IT — `resolveComponentData` in the old library
5
+ * 0.20 (`lib/resolve-component-data.ts`), because the documents both editors
6
+ * hold were resolved by it and must go on resolving the same way.
7
+ *
8
+ * - It runs only when the item differs from the last one resolved for that id
9
+ * (deep-equal), unless the trigger is "force"; the last answer is reused.
10
+ * - `changed` names every prop of the new item with whether it differs from
11
+ * the last one resolved (`changedProps`, the old library's `getChanged`).
12
+ * - The block's own `metadata` is spread over the host's.
13
+ * - The answer's `props` are spread OVER the item's, and its `readOnly` kept
14
+ * when it has any key.
15
+ * - Then every slot's children are resolved the same way, in order.
16
+ *
17
+ * What differs from the old library is only where the memory lives: the old library kept the last
18
+ * change per id in a module-level object shared by every editor on the page;
19
+ * here the host hands in its own (`createResolveCache`), one per editor.
20
+ *
21
+ * Pure apart from the resolvers it calls: no React, no browser global.
22
+ */
23
+ type ResolveTrigger = 'insert' | 'replace' | 'load' | 'force' | 'move';
24
+ /** An item to resolve: a node, or the root (`{ props }`, no type). */
25
+ interface ResolvableItem {
26
+ type?: string;
27
+ props: Record<string, unknown>;
28
+ readOnly?: Record<string, boolean>;
29
+ }
30
+ interface ResolveCache {
31
+ lastChange: Record<string, {
32
+ item: ResolvableItem;
33
+ resolved: ResolvableItem;
34
+ }>;
35
+ }
36
+ declare const createResolveCache: () => ResolveCache;
37
+ interface ResolveOptions {
38
+ metadata?: Record<string, unknown>;
39
+ trigger?: ResolveTrigger;
40
+ cache?: ResolveCache;
41
+ onResolveStart?: (item: ResolvableItem) => void;
42
+ onResolveEnd?: (item: ResolvableItem) => void;
43
+ }
44
+ /** Deep equality of JSON-shaped values, as `fast-deep-equal` answers it for them. */
45
+ declare function deepEqual(a: unknown, b: unknown): boolean;
46
+ /** Every prop of `next`, and whether it differs from `last` (the old library's `getChanged`). */
47
+ declare function changedProps(next: ResolvableItem | null | undefined, last: ResolvableItem | null | undefined): Record<string, boolean>;
48
+ /**
49
+ * Resolve one item and everything in its slots. `didChange` says whether the
50
+ * answer differs from the item handed in.
51
+ */
52
+ declare function resolveNodeData<T extends ResolvableItem>(item: T, config: DataConfig, options?: ResolveOptions): Promise<{
53
+ node: T;
54
+ didChange: boolean;
55
+ }>;
56
+
57
+ /**
58
+ * THE PHONE ORDER — the order a parent's children stack in on a phone, for
59
+ * both editors (the email section's columns, the website Box's children): a
60
+ * permutation of their DESKTOP positions, first entry = top of the phone stack.
61
+ * Pure, no import: what is stored is the host's prop, this only reads and
62
+ * writes the array.
63
+ *
64
+ * ABSENT MEANS "FOLLOW THE DESKTOP ORDER", and that is load-bearing. Every
65
+ * document written before this rule has no order, so it follows desktop and
66
+ * renders as it did; a new parent does the same until someone actually
67
+ * reorders it. It also settles what a desktop reorder does: a parent that is
68
+ * merely FOLLOWING desktop keeps following it (the phone order changes with
69
+ * the desktop one), while a parent with a CUSTOM order has that order carried
70
+ * by child identity (`carryPhoneOrder`). Those are different answers, and
71
+ * storing "no order" as the absence of the prop is what lets the code tell
72
+ * them apart at all.
73
+ */
74
+ /** Desktop positions in phone order; `[2, 0, 1]` puts the third child on top. */
75
+ type PhoneOrder = number[];
76
+ /**
77
+ * The phone order as something safe to render from: a permutation of exactly
78
+ * the positions `0 … count-1`, whatever was stored.
79
+ *
80
+ * This is the ONE normaliser, and it is deliberately total: it never throws
81
+ * and never loses a child, because the stored value is untrusted JSON and the
82
+ * cost of getting it wrong is a child missing from the page or the email:
83
+ * - unset / not an array (every document predating the order) → the desktop
84
+ * order;
85
+ * - entries that are not usable positions (strings, floats, negatives, out of
86
+ * range, `null`) → dropped;
87
+ * - a position named twice → the first mention wins, the rest dropped;
88
+ * - positions the parent lays out but the order never mentions → APPENDED, in
89
+ * desktop order. This is what makes "new child" free: a child no stored
90
+ * order knows about lands at the end of the phone stack without any control
91
+ * having to notice.
92
+ */
93
+ declare function normalizePhoneOrder(value: unknown, count: number): PhoneOrder;
94
+ /** Does this order say anything the desktop order does not? An order equal to
95
+ * the desktop one is NOT a customisation: it is the default spelled out, so
96
+ * nothing renders for it and nothing is stored. */
97
+ declare const isCustomPhoneOrder: (order: readonly number[]) => boolean;
98
+ /**
99
+ * The value a control writes: normalised on the way in, and CLEARED
100
+ * (`undefined`) when it comes out equal to the desktop order, so "drag it back
101
+ * to where it started" and "Match desktop order" are the same thing and both
102
+ * leave the parent following desktop rather than pinned to a copy of it that
103
+ * would start diverging on the next desktop reorder.
104
+ */
105
+ declare function settlePhoneOrder(order: readonly number[], count: number): PhoneOrder | undefined;
106
+ /**
107
+ * Move a child within the PHONE stack only, by phone positions: the same
108
+ * move-not-swap semantics as a desktop move (splice out, splice in), so a drag
109
+ * feels identical whichever order it rearranges. The desktop order is not
110
+ * touched.
111
+ *
112
+ * `null` when the move changes nothing or names a position out of range, so a
113
+ * caller can refuse it the way it refuses a desktop no-op; otherwise the
114
+ * settled order (`undefined` = back to desktop).
115
+ */
116
+ declare function movePhoneOrder(value: unknown, count: number, from: number, to: number): PhoneOrder | undefined | null;
117
+ /**
118
+ * Carry a STORED phone order through a desktop edit of the children: a move,
119
+ * a delete or a duplicate.
120
+ *
121
+ * `relocate` says where the child that WAS at a desktop position has ended up
122
+ * (`-1` = it is gone), and `insert` puts a brand-new position into the phone
123
+ * stack directly after the one it was copied from. Between them those two
124
+ * cover every edit: a move permutes, a delete removes, a duplicate relocates
125
+ * AND inserts.
126
+ *
127
+ * Call it ONLY when an order is stored. A parent with no order follows desktop,
128
+ * and writing one here would silently turn "follows the desktop order" into a
129
+ * frozen copy of whatever the desktop order was at the moment of an unrelated
130
+ * edit; every document would acquire one the first time anybody moved a child.
131
+ *
132
+ * Returns the settled order: `undefined` (an explicit clear) when the carried
133
+ * order comes out equal to the desktop one, so a parent shuffled back into
134
+ * agreement goes back to simply following desktop.
135
+ */
136
+ declare function carryPhoneOrder(value: unknown, prevCount: number, nextCount: number, relocate: (from: number) => number, insert?: {
137
+ after: number;
138
+ at: number;
139
+ }): PhoneOrder | undefined;
140
+
141
+ export { type PhoneOrder as P, type ResolvableItem as R, type ResolveCache as a, type ResolveOptions as b, type ResolveTrigger as c, carryPhoneOrder as d, changedProps as e, createResolveCache as f, deepEqual as g, isCustomPhoneOrder as i, movePhoneOrder as m, normalizePhoneOrder as n, resolveNodeData as r, settlePhoneOrder as s };
@@ -1 +1 @@
1
- export{AddBlockRow as default}from"../../chunk-5JNVMCCB.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-2262JGFV.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-LX23TCTP.js";import"../../chunk-G2VZ4DET.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-3W2O22DZ.js";import"../../chunk-JQQFB7EZ.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-HG65R6IN.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-TDEBPOWV.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-D4TH4QQR.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-56ID6FKZ.js";import"../../chunk-K53PQAMP.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-QTHQPJWA.js";import"../../chunk-MNQDOSAX.js";import"../../chunk-PMRN5Z3T.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-DX3VILZ3.js";import"../../chunk-MIX7EGRG.js";import"../../chunk-JACEEVVF.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-3XECMGXX.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-TOKMFZPB.js";import"../../chunk-FR7EEKFF.js";import"../../chunk-7UFKEX72.js";import"../../chunk-EUFDQ4KL.js";import"../../chunk-KXM6YRG2.js";
1
+ export{AddBlockRow as default}from"../../chunk-SEH3Q3EL.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-TUIBPB77.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-LX23TCTP.js";import"../../chunk-G2VZ4DET.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-L36E2WCO.js";import"../../chunk-XT75WETI.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-SDSBXW3V.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-TDEBPOWV.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-D4TH4QQR.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-56ID6FKZ.js";import"../../chunk-LDHUPZBK.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-TF6NAIV7.js";import"../../chunk-MNQDOSAX.js";import"../../chunk-PMRN5Z3T.js";import"../../chunk-ANBPE45L.js";import"../../chunk-C63IB4VW.js";import"../../chunk-DX3VILZ3.js";import"../../chunk-MIX7EGRG.js";import"../../chunk-UMTUKSE6.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-QEEW4X64.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YDTEYXQW.js";import"../../chunk-KXM6YRG2.js";import"../../chunk-6GJEOER4.js";import"../../chunk-FR7EEKFF.js";import"../../chunk-7UFKEX72.js";
@@ -11,7 +11,7 @@ import '../lib/document/content-tree.js';
11
11
  import '../../blocks/index.js';
12
12
  import '../../types-BljCVdzR.js';
13
13
  import '../../data/index.js';
14
- import '../../resolve-Bz4mszpL.js';
14
+ import '../../phone-order-CRKvsTsz.js';
15
15
  import '../../plan-D0DgSLnY.js';
16
16
  import '../../types-SrGNzYeO.js';
17
17
  import '../../types-Cy7rdmXt.js';
@@ -1 +1 @@
1
- export{blockKey,AddSidePanel as default,presetKey,sectionKey,sharedKey,templateKey}from"../../chunk-L7PSERQH.js";import"../../chunk-GDO4QJ4G.js";import"../../chunk-IZGFJWH4.js";import"../../chunk-N7E6264U.js";import"../../chunk-N3MJOHAG.js";import"../../chunk-SBVIW3KJ.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-2262JGFV.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-LX23TCTP.js";import"../../chunk-G2VZ4DET.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-3W2O22DZ.js";import"../../chunk-JQQFB7EZ.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-HG65R6IN.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-TDEBPOWV.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-D4TH4QQR.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-56ID6FKZ.js";import"../../chunk-K53PQAMP.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-QTHQPJWA.js";import"../../chunk-VBEVZZTV.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-YYD257TD.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MNQDOSAX.js";import"../../chunk-PMRN5Z3T.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-DX3VILZ3.js";import"../../chunk-MIX7EGRG.js";import"../../chunk-JACEEVVF.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-SQTVXE5D.js";import"../../chunk-TQ5Y6S2X.js";import"../../chunk-3XECMGXX.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-TOKMFZPB.js";import"../../chunk-FR7EEKFF.js";import"../../chunk-7UFKEX72.js";import"../../chunk-EUFDQ4KL.js";import"../../chunk-KXM6YRG2.js";
1
+ export{blockKey,AddSidePanel as default,presetKey,sectionKey,sharedKey,templateKey}from"../../chunk-GJ427TZL.js";import"../../chunk-GDO4QJ4G.js";import"../../chunk-IZGFJWH4.js";import"../../chunk-N7E6264U.js";import"../../chunk-N3MJOHAG.js";import"../../chunk-MTWQYLJE.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-TUIBPB77.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-LX23TCTP.js";import"../../chunk-G2VZ4DET.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-L36E2WCO.js";import"../../chunk-XT75WETI.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-SDSBXW3V.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-TDEBPOWV.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-D4TH4QQR.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-56ID6FKZ.js";import"../../chunk-LDHUPZBK.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-TF6NAIV7.js";import"../../chunk-VTY7OQB5.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-G7J6SGMF.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MNQDOSAX.js";import"../../chunk-PMRN5Z3T.js";import"../../chunk-ANBPE45L.js";import"../../chunk-C63IB4VW.js";import"../../chunk-DX3VILZ3.js";import"../../chunk-MIX7EGRG.js";import"../../chunk-UMTUKSE6.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-SEC6NV6Y.js";import"../../chunk-TQ5Y6S2X.js";import"../../chunk-QEEW4X64.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YDTEYXQW.js";import"../../chunk-KXM6YRG2.js";import"../../chunk-6GJEOER4.js";import"../../chunk-FR7EEKFF.js";import"../../chunk-7UFKEX72.js";