efficient-easel 25.1.0 → 26.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.
- package/README.md +3 -4
- package/dist/chunk-2T22IY3J.js +2 -0
- package/dist/chunk-4FFDGEWA.js +1 -0
- package/dist/{chunk-KFV7N2DJ.js → chunk-56ID6FKZ.js} +1 -1
- package/dist/chunk-5OKOCRXT.js +11 -0
- package/dist/{chunk-ITIVCER6.js → chunk-5QUIXGQU.js} +1 -1
- package/dist/{chunk-6WTWYHC2.js → chunk-6BOOYHHK.js} +4 -4
- package/dist/{chunk-OXOUGEAT.js → chunk-7GGNFLHT.js} +1 -1
- package/dist/{chunk-XTDOSL2M.js → chunk-7PGO4K5M.js} +8 -8
- package/dist/chunk-BA5X67LQ.js +1 -0
- package/dist/chunk-BYONFJVQ.js +2 -0
- package/dist/chunk-CLAADE4J.js +14 -0
- package/dist/chunk-IMAN6IP5.js +4 -0
- package/dist/{chunk-LUHGBFOD.js → chunk-LSGKADNV.js} +3 -3
- package/dist/{chunk-UDWXBS46.js → chunk-O4DQ6O6W.js} +1 -1
- package/dist/{chunk-S6YOIRXQ.js → chunk-Q3VAJMXS.js} +1 -1
- package/dist/{chunk-KF3LT7J2.js → chunk-QAVA4V2C.js} +1 -1
- package/dist/{chunk-U3LTJSBU.js → chunk-R76XMEKT.js} +11 -11
- package/dist/{chunk-FEP6XMNX.js → chunk-STQDOTHF.js} +1 -1
- package/dist/{chunk-62UGN7VM.js → chunk-TOEJCZUO.js} +1 -1
- package/dist/chunk-TTCUC2Q3.js +1 -0
- package/dist/{chunk-IW5QXREH.js → chunk-VXAGXHKI.js} +40 -40
- package/dist/{chunk-XLC7HWW3.js → chunk-WOA775T4.js} +1 -1
- package/dist/fields/index.js +1 -1
- package/dist/panel/index.d.ts +63 -2
- package/dist/panel/index.js +1 -1
- package/dist/panel/panel.css +46 -0
- package/dist/pick/index.d.ts +16 -195
- package/dist/pick/index.js +1 -1
- package/dist/pick/pick.css +6 -196
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/NodeContextMenu.js +1 -1
- package/dist/screen/components/PageEditGuardNotices.js +1 -1
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenDocumentContext.js +1 -1
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +17 -17
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/document/block-set-host.js +1 -1
- package/dist/screen/lib/document/box-fields.d.ts +44 -6
- package/dist/screen/lib/document/box-fields.js +1 -1
- package/dist/screen/lib/document/button-fields.d.ts +97 -0
- package/dist/screen/lib/document/button-fields.js +1 -0
- package/dist/screen/lib/document/device-fields.js +1 -1
- package/dist/screen/lib/document/image-fields.d.ts +118 -0
- package/dist/screen/lib/document/image-fields.js +5 -0
- package/dist/screen/lib/document/style-clipboard.js +1 -1
- package/dist/screen/lib/document/style-fields.d.ts +109 -0
- package/dist/screen/lib/document/style-fields.js +1 -0
- package/dist/screen/lib/document/use-section-ops.js +1 -1
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/screen/words.d.ts +22 -1
- package/dist/screen/words.js +1 -1
- package/dist/strings/index.d.ts +12 -9
- package/dist/strings/index.js +2 -2
- package/dist/text-styles/index.d.ts +3 -3
- package/dist/text-styles/index.js +37 -37
- package/dist/{words-fbR9IwxH.d.ts → words-BrN08Fup.d.ts} +16 -1
- package/package.json +19 -1
- package/dist/chunk-ERB6FAZT.js +0 -2
- package/dist/chunk-H6BER2EU.js +0 -1
- package/dist/chunk-KVIEUWTX.js +0 -11
- package/dist/chunk-OFBZOI6W.js +0 -1
- package/dist/chunk-SC6E3UUS.js +0 -13
- package/dist/chunk-U6LJ5UKD.js +0 -6
- package/dist/words-DWvCJXwR.d.ts +0 -51
package/README.md
CHANGED
|
@@ -1167,7 +1167,6 @@ What still writes a `style`, and where it matters:
|
|
|
1167
1167
|
| The drag layer's handle, line and cells; context menus; the rail's measured words | In the browser only, from state or a measurement | Nothing to do: never in a server's HTML |
|
|
1168
1168
|
| Everything inside the canvas frame (lists, block wrappers, outlines) | In the browser only: the frame is filled once it mounts | Nothing to do |
|
|
1169
1169
|
| `EaselCanvas frame={false}` | Server-rendered with the page | Mount it on the client |
|
|
1170
|
-
| `ColourPicker`'s swatch, when it has a value | Server-rendered with a settings panel that holds a colour | Mount that panel on the client |
|
|
1171
1170
|
| `SaveState` with `counting` and `waitMs` | Only while a save waits, which a server render is not | Nothing to do |
|
|
1172
1171
|
| A `style` or a slot's `style` you pass (`CanvasFrame`, `TopBarCluster`, `Render`) | As you wrote it | Yours to move to a class |
|
|
1173
1172
|
|
|
@@ -1448,8 +1447,9 @@ const german: DeepPartial<EaselStrings> = {
|
|
|
1448
1447
|
```
|
|
1449
1448
|
|
|
1450
1449
|
- **`EaselStrings`** is grouped by the module that says the word (`notice`,
|
|
1451
|
-
`lock`, `save`, `chrome`, `rail`, `tree`, `panel`, `fields`, `
|
|
1452
|
-
`menu`, `styleClipboard`, `copy`, `canvas`, `textStyles`,
|
|
1450
|
+
`lock`, `save`, `chrome`, `rail`, `tree`, `panel`, `fields`, `colourRow`,
|
|
1451
|
+
`imageRow`, `drag`, `menu`, `styleClipboard`, `copy`, `canvas`, `textStyles`,
|
|
1452
|
+
`screen`, `pageCopy`). A plain word is a `string`;
|
|
1453
1453
|
anything with a value in it is a function, so the host places the value and
|
|
1454
1454
|
does its own plural. `DEFAULT_EASEL_STRINGS` is the English.
|
|
1455
1455
|
- **What is left out falls back** (`mergeEaselStrings`), and a provider inside
|
|
@@ -1474,7 +1474,6 @@ const german: DeepPartial<EaselStrings> = {
|
|
|
1474
1474
|
|
|
1475
1475
|
<EaselRail items={items} ariaLabel={strings.rail.label} />
|
|
1476
1476
|
<TreeRow … words={strings.tree} />
|
|
1477
|
-
<ColourPicker … words={strings.pick.colour} />
|
|
1478
1477
|
<AddPanel … words={strings.drag.add} />
|
|
1479
1478
|
<CanvasDragLayer … words={strings.drag.canvas} />
|
|
1480
1479
|
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{DEFAULT_PANEL_WORDS as e}from"./chunk-56ID6FKZ.js";import{SettingReset as t}from"efficient-shell/ui";import{jsx as a}from"react/jsx-runtime";function l({label:l,changed:i,onReset:s,detail:n,disabled:o,defaultAction:r,words:d,className:c}){const m={...e,...d},f=m.resetName({label:l});/* @__PURE__ */
|
|
2
|
+
return a(t,{label:l,changed:i,onReset:s,detail:n,disabled:o,defaultAction:r,name:f,tip:n?m.resetTitle({label:l,detail:n}):f,className:c})}export{l as SettingsDefaultReset};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseHexColor as e}from"efficient-shell/ui";var r=e,i=e=>e.toUpperCase();export{i as hexReadout,r as typedHex};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={settings:"Settings",buckets:{Design:"Design",Animation:"Animation"},designGroups:{Content:"Content",Size:"Size",Design:"Design",Layout:"Layout",Position:"Position",Anchor:"Anchor"},followsDefault:"Default",reset:"Reset",resetName:({label:e})=>`Reset ${e}`,backToDefault:({detail:e})=>`Back to default: ${e}`,resetTitle:({label:e,detail:t})=>`Reset ${e} (back to ${t})`};export{e as DEFAULT_PANEL_WORDS};
|
|
1
|
+
var e={settings:"Settings",buckets:{Design:"Design",Animation:"Animation"},designGroups:{Content:"Content",Size:"Size",Design:"Design",Layout:"Layout",Position:"Position",Anchor:"Anchor"},followsDefault:"Default",reset:"Reset",resetName:({label:e})=>`Reset ${e}`,backToDefault:({detail:e})=>`Back to default: ${e}`,resetTitle:({label:e,detail:t})=>`Reset ${e} (back to ${t})`},t={hexCode:({label:e})=>`${e} hex code`,notSet:"Not set"};export{t as DEFAULT_COLOUR_ROW_WORDS,e as DEFAULT_PANEL_WORDS};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{sidesStartEach as e,SidesInput as n,SidesEachToggle as t}from"./chunk-CLAADE4J.js";import{SettingsDefaultReset as o}from"./chunk-2T22IY3J.js";import{deviceField as l}from"./chunk-7GGNFLHT.js";import{noControlField as a,NoControlMark as r}from"./chunk-22I55W37.js";import{describedAs as i}from"./chunk-LX23TCTP.js";import{withStyleKind as u}from"./chunk-CWELHADJ.js";import{phoneKey as s}from"./chunk-E52W3M5I.js";import{foldMetaOf as c,FOLD_FIELD_MARKER as d}from"./chunk-ANPOR6EY.js";import{useSelectedHost as p,useEaselApi as f,useEasel as m}from"./chunk-BBD3FLU3.js";import{DEFAULT_PANEL_WORDS as b}from"./chunk-56ID6FKZ.js";import{SettingsSwitch as h}from"./chunk-OECWLNKJ.js";import{FieldSelect as g}from"./chunk-KFWNGPW3.js";import{SettingsField as v}from"./chunk-MIX7EGRG.js";import{SettingsSegmented as y}from"./chunk-DX3VILZ3.js";import{useWords as k}from"./chunk-MFIRYGHW.js";import{useState as C}from"react";import{AlignmentIcon as w,BoxJustifyIcon as x,WrapIcon as j,GapIcon as F,WidthIcon as L,PlacementIcon as O,NudgeIcon as S,DesktopIcon as P,BoxXEndIcon as E,BoxXCenterIcon as I,BoxXStartIcon as A,PaddingAllIcon as B,BoxYBetweenIcon as K,BoxYStretchIcon as W,BoxYEndIcon as G,BoxYCenterIcon as M,BoxYStartIcon as N,BoxXBetweenIcon as T,BoxXStretchIcon as R,BoxItemAlignmentIcon as V}from"efficient-shell/icons/efficient";import{Slider as D,textAlignOptions as J,AlignmentGrid as $,PositionInput as _}from"efficient-shell/ui";import{jsx as X,Fragment as Y,jsxs as z}from"react/jsx-runtime";var H=e=>e;function U(){return null}function Z(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");/* @__PURE__ */
|
|
2
|
+
return X(U,{},e)}function q(e){return e.type===U}function Q(e){return q(e)?void 0:e}function ee(e){for(const[n,t]of Object.entries(e))t&&"object"==typeof t&&!c(t)&&u(t,`section:${n}`);return e}function ne(e,n){return{type:"custom",[d]:{label:e,level:n},marker:!0,fold:e,render:()=>/* @__PURE__ */X(Y,{})}}function te(e){return ne(e,2)}function oe(e){return ne(e,1)}var le=[{label:"Start",value:"start"},{label:"Center",value:"center"},{label:"Space between",value:"between"},{label:"End",value:"end"}],ae=[{label:"Start",value:"start"},{label:"Center",value:"center"},{label:"End",value:"end"},{label:"Stretch",value:"stretch"}],re="Wrap",ie=[{label:"Wrap",value:"wrap"},{label:"No wrap",value:"nowrap"}],ue="Direction",se=[{label:"Stacked",value:"column"},{label:"One row",value:"row"}],ce={min:-32,max:64,step:2,builtIn:0},de={min:30,max:100,step:5,fallback:60},pe=["top-left","top-center","top-right","left","center","right","bottom-left","bottom-center","bottom-right"],fe="bottom-left",me={"top-left":"Top left","top-center":"Top center","top-right":"Top right",left:"Left",center:"Center",right:"Right","bottom-left":"Bottom left","bottom-center":"Bottom center","bottom-right":"Bottom right"},be=pe.map(e=>({value:e,label:me[e]}));function he(e,n=fe){return pe.includes(e)?e:n}var ge=40,ve=e=>"number"==typeof e?e:null;function ye(e,n,t){const o={};for(const l of["x","y"])t[l]!==n[l]&&(o[e[l]]=t[l]??void 0);return o}var ke=["top","right","bottom","left"],Ce={top:"sectionPaddingTop",right:"sectionPaddingRight",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft"},we=e=>"number"==typeof e?e:null;function xe(e,n,t){const o={};for(const l of ke)t[l]!==n[l]&&(o[e[l]]=t[l]??void 0);return o}function je(e){if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};const n=e&&"object"==typeof e?e:{};return Object.fromEntries(ke.map(e=>[e,we(n[e])]))}function Fe(e){const n={};for(const t of ke)"number"==typeof e[t]&&(n[t]=e[t]);return Object.keys(n).length?n:void 0}function Le(e,n={}){const t=n=>{const t=n[e];return t&&"object"==typeof t?t:{}},o=e=>Object.hasOwn(n,e)?n[e]:e;return{read:(e,n)=>t(e)[o(n)],write:(n,l,a)=>{const r={...t(n)};return void 0===a?delete r[o(l)]:r[o(l)]=a,{[e]:Object.keys(r).length?r:void 0}}}}function Oe(e,n,t){const o=Se(e),l=p();if(t)return[t.value,t.onChange];const a=l?.values??{};return[e.read(a,n),e=>o([[n,e]])]}function Se(e){const n=p(),t=function(){try{return f()}catch{return null}}();return o=>{if(!n)return;const l=t?.getState(),a=(l?"root"===n.id?l.appState.data.root.props:l.getItemById(n.id)?.props:void 0)??n.values??{};let r={};for(const[n,t]of o)r={...r,...e.write({...a,...r},n,t)};n.onChangeMany(r)}}var Pe={read:(e,n)=>e[n],write:(e,n,t)=>({[n]:t})},Ee={fieldKey:s,ownField:!0,read:(e,n)=>e[s(n)],write:(e,n,t)=>({[s(n)]:t})};function Ie(e){return{...Le(e),fieldKey:n=>`_${e}_${n}`}}function Ae({row:e,desktopKey:n,access:t,props:o}){const l=p(),a=l?.values?.[n],[r,i]=Oe(t,n);return t.ownField?e.render({...o,follows:a}):e.render({...o,value:r,storedValue:r,follows:a,onChange:i})}function Be(e,n,t=Ee){const o={...n,render:o=>/* @__PURE__ */X(Ae,{row:n,desktopKey:e,access:t,props:o})};return{[e]:l("desktop",n),[t.fieldKey(e)]:l("mobile",o)}}var Ke=["left","center","right"];function We(e,{options:n,value:t,onChange:o,ariaLabel:l,disabled:a=!1}){/* @__PURE__ */
|
|
3
|
+
return X(y,{options:n.map(n=>n.picture?{id:n.value,label:n.picture,title:e(n.title??n.label)}:{id:n.value,label:e(n.label),title:void 0===n.title?void 0:e(n.title)}),value:t,onChange:o,ariaLabel:e(l),disabled:a})}function Ge(e,{label:n,value:t,onChange:o,points:l}){const a=l.find(e=>e.disabled),r=l.map(n=>({...n,label:e(n.label),...n.title?{title:e(n.title)}:null}));/* @__PURE__ */
|
|
4
|
+
return X(v,{label:e(n),icon:/* @__PURE__ */X(O,{}),hint:a?.title?e(a.title):void 0,children:/* @__PURE__ */X($,{label:e(n),value:t,points:r,onChange:o})})}function Me({say:e,label:n,value:t,onChange:o,pointsFor:l}){const{appState:a,selectedItem:r}=m(e=>e),i=r?.props?.id?String(r.props.id):void 0;return Ge(e,{label:n,value:t,onChange:o,points:l(a?.data,i)})}function Ne({say:e,o:n}){const t=p(),l=k("panel",b),a=t?.values??{},r={x:ve(a[n.keys.x]),y:ve(a[n.keys.y])},i=e(n.label??"Position"),u=Boolean(r.x||r.y),s=e=>{const o=ye(n.keys,r,e);Object.keys(o).length&&t?.onChangeMany(o)},c=/* @__PURE__ */X(_,{label:i,value:r,onChange:s,words:{x:e("Left and right"),y:e("Up and down"),unit:"px"},placeholder:{x:"0",y:"0"},min:n.min,max:n.max,step:n.step??1}),d=/* @__PURE__ */X(o,{words:l,label:i,changed:u,detail:"0 px, 0 px",onReset:()=>s({x:null,y:null})});return null===n.label?/* @__PURE__ */z("div",{className:"sf-position-line",children:[c,d]}):/* @__PURE__ */X(v,{label:i,icon:/* @__PURE__ */X(S,{}),changed:u,action:d,children:c})}var Te={x:{start:/* @__PURE__ */X(A,{}),center:/* @__PURE__ */X(I,{}),end:/* @__PURE__ */X(E,{}),stretch:/* @__PURE__ */X(R,{}),between:/* @__PURE__ */X(T,{})},y:{start:/* @__PURE__ */X(N,{}),center:/* @__PURE__ */X(M,{}),end:/* @__PURE__ */X(G,{}),stretch:/* @__PURE__ */X(W,{}),between:/* @__PURE__ */X(K,{})}},Re=e=>"row"===e?"row":"column";function Ve({say:e,kind:n,label:t,options:o,value:l,onChange:a,o:r}){const i=p(),u="justify"===n==("row"===(r.runs??Re)(i?.values?.[r.directionKey??"direction"]))?"x":"y";return We(e,{options:o.map(e=>({label:e.label,value:e.value,picture:Te[u][e.value]})),value:l,onChange:a,ariaLabel:t})}function De({say:e,tier:n,o:t}){const o=p(),l=o?.values??{},a="mobile"===n?t.phoneKeys:t.keys,r=Object.fromEntries(ke.map(e=>[e,we(l[a[e]])])),i="mobile"===n?Object.fromEntries(ke.map(e=>[e,we(l[t.keys[e]])])):null;/* @__PURE__ */
|
|
5
|
+
return X($e,{say:e,o:t,value:r,follows:i,onChange:e=>{const n=xe(a,r,e);Object.keys(n).length&&o?.onChangeMany(n)}})}function Je({say:e,o:n,props:t}){/* @__PURE__ */
|
|
6
|
+
return X($e,{say:e,o:n,value:je(t.value),follows:"follows"in t?je(t.follows):null,readOnly:t.readOnly,onChange:e=>t.onChange(Fe(e))})}function $e({say:o,o:l,value:a,follows:r,readOnly:i,onChange:u}){const s=Object.fromEntries(ke.map(e=>[e,String(r?.[e]??l.fallback[e])])),[c,d]=C(()=>e(a,s));/* @__PURE__ */
|
|
7
|
+
return X(v,{label:o("Padding"),icon:/* @__PURE__ */X(B,{}),action:/* @__PURE__ */X(t,{each:c,label:o("Each side"),onChange:d,disabled:i}),children:/* @__PURE__ */X(n,{label:o("Padding"),each:c,value:a,placeholder:s,min:l.min,max:l.max,step:l.step,readOnly:i,onChange:u,words:{sides:{top:o("Padding top"),right:o("Padding right"),bottom:o("Padding bottom"),left:o("Padding left")},vertical:o("Top and bottom"),horizontal:o("Left and right"),unit:"px"}})})}function _e(e=H){function n(n,t,l,a,r,u,s="",c){const d="function"==typeof c?{action:c}:c??{},{action:p,clear:f}=d;return{type:"custom",...i({},{type:"number",label:n}),render:i=>{const c="storedValue"in i?i.storedValue:i.value,m="follows"in i,b=m||void 0!==f,h="number"==typeof i.value,g=m&&"number"==typeof i.follows?i.follows:void 0===f?u:"function"==typeof f.hint?f.hint(i):f.hint,y=h?i.value:b?null:u,k=""===s||"px"===s?s:` ${s}`,C=!f?.emptyLabel||m&&"number"==typeof i.follows?void 0:f.emptyLabel,w=C??`${g}${k}`,x=m?e("{value} on desktop").replace("{value}",w):w,j=!0===i.readOnly;/* @__PURE__ */
|
|
8
|
+
return X(v,{label:e(n),icon:Q(t),action:b?/* @__PURE__ */X(o,{label:e(n),changed:h,detail:x,disabled:j,onReset:()=>i.onChange(void 0)}):p?p(c,i.onChange):void 0,children:/* @__PURE__ */X("div",{className:"sf-slider",children:/* @__PURE__ */X(D,{min:l,max:a,step:r,value:y,suffix:s||void 0,showInput:!0,label:e(n),disabled:j,...b?{placeholderValue:g}:{},...C?{emptyLabel:C}:{},...void 0!==d.inputMax?{inputMax:d.inputMax}:{},size:"sm",boxSize:"md",className:"sf-slider-track",onChange:e=>{null===e?b&&h&&i.onChange(void 0):e!==y&&i.onChange(e)}})})})}}}function t(n){return We(e,n)}function u(n,o,l,a){const r=l.map(e=>"string"==typeof e?{label:e,value:e}:e);return{type:"custom",...i({},{type:"radio",label:n,options:r.map(e=>({value:e.value,label:e.label}))}),render:({value:l,onChange:i,field:u})=>/* @__PURE__ */X(v,{label:e(n),icon:Q(o),children:t({options:r,value:r.some(e=>e.value===l)?l:l||u?.currentValue||a,onChange:i,ariaLabel:n})})}}function c(e,n){return n.phone?e.unshift({label:"Match desktop",value:"",picture:/* @__PURE__ */X(P,{})}):n.inherit&&e.unshift({label:n.inherit,value:""}),e}function d(e,n){return n.inherit||n.phone?{...e,render:n=>e.render({...n,onChange:e=>n.onChange(""===e?void 0:e)})}:e}function p(e,n,t){return{[e]:l("desktop",n(t)),[s(e)]:l("mobile",n({...t,phone:!0},""))}}function f(e){return c(J(e.allow??Ke).map(e=>({label:e.label,value:e.value,picture:e.icon})),e)}function m(e={},n=e.fallback??"left"){return d(u(e.label??"Text alignment",/* @__PURE__ */X(w,{}),f(e),n),e)}function b(e){const n={left:Te.x.start,center:Te.x.center,right:Te.x.end};return c(J((e.allow??Ke).filter(e=>e in n)).map(e=>({label:e.label,value:e.value,picture:n[e.value]})),e)}function y(e={},n=e.fallback??"left"){return d(u(e.label??"Block alignment",/* @__PURE__ */X(x,{}),b(e),n),e)}function k(n,t,o,l,a,r){return{type:"custom",options:l,fallback:a,...i({},{type:"radio",label:t,options:l.map(e=>({value:e.value,label:e.label}))}),render:({value:i,onChange:u,field:s})=>{const c=s.options??l,d=s.fallback??a,p=c.some(e=>e.value===i)?i:d;/* @__PURE__ */
|
|
9
|
+
return X(v,{label:e(t),icon:Q(o),children:/* @__PURE__ */X(Ve,{say:e,kind:n,label:t,options:c,value:p,onChange:u,o:r})})}}}function C(e={}){return k("justify","Justify",/* @__PURE__ */X(x,{}),le,le[0].value,e)}function O(e={}){return k("align","Item alignment",/* @__PURE__ */X(V,{}),ae,"stretch",e)}function S(){const n=re;return{type:"custom",options:ie,fallback:ie[1].value,...i({},{type:"radio",label:n,options:ie.map(e=>({value:e.value,label:e.label}))}),render:({value:t,onChange:o,id:l,name:a})=>{const r=`${l??a??n}-label`;/* @__PURE__ */
|
|
10
|
+
return X(v,{label:e(n),labelId:r,icon:/* @__PURE__ */X(j,{}),action:/* @__PURE__ */X(h,{checked:(i=t,!0===i||"wrap"===i),onChange:e=>o(e?ie[0].value:ie[1].value),ariaLabelledBy:r})});var i}}}function E({offered:e,fallback:n,resolve:t}){const o=t??(t=>e.some(e=>e.value===t)?t:n),l=u(ue,Z("`Direction` names how a container’s children run — a MODIFIER, not a thing. doc/naming.md N10.1 gives the idea a dash in its Glyph column; the shell’s own `direction` meaning says the bare row is CORRECT and not an omission (SS seat, 2026-09-11)."),e.map(e=>({label:e.label,value:e.value})),o(void 0));return{type:"custom",render:e=>l.render({...e,value:o(e.value),onChange:n=>e.onChange(n)})}}function I({min:e,max:t,step:o,builtIn:l,resolve:a,action:r,mark:i}){const u=n("Gap",/* @__PURE__ */X(F,{}),e,t,o,l,"px",r),s=a??(e=>"number"==typeof e?e:l);return{...i,type:"custom",render:e=>u.render({...e,value:s(e.value,e.field),storedValue:e.value,onChange:n=>e.onChange(n)})}}function A(n,{fallback:t=fe,pointsFor:o}={}){return{type:"custom",render:({value:l,onChange:a})=>{const r=he(l,t);return o?/* @__PURE__ */X(Me,{say:e,label:n,value:r,onChange:a,pointsFor:o}):Ge(e,{label:n,value:r,onChange:a,points:be})}}}function B(n){return{[n.keys.x]:{type:"custom",render:()=>/* @__PURE__ */X(Ne,{say:e,o:n})},[n.keys.y]:{...a({type:"custom",render:()=>/* @__PURE__ */X(r,{})},"always"),reachedBy:n.keys.x}}}function K(n={}){const t={...Ce,...n.keys},o={keys:t,phoneKeys:Object.fromEntries(ke.map(e=>[e,s(t[e])])),fallback:{top:0,right:0,bottom:0,left:0,...n.fallback},min:n.min??0,max:n.max??200,step:n.step??4},i=!1!==n.phone,u=!1===n.group?{}:{_gSpacing:te("Padding")};if(n.object){const t={type:"custom",render:n=>/* @__PURE__ */X(Je,{say:e,o:o,props:n})};return ee({...u,...i?Be(n.object.key,t,n.object.phone):{[n.object.key]:t}})}const c=n=>{const t={type:"custom",render:()=>/* @__PURE__ */X(De,{say:e,tier:n,o:o})};return i?l(n,t):t},d=()=>a({type:"custom",render:()=>/* @__PURE__ */X(r,{})},"always"),p=ke.filter(e=>"top"!==e);return ee({...u,[o.keys.top]:c("desktop"),...i?{[o.phoneKeys.top]:c("mobile")}:{},...Object.fromEntries(p.map(e=>[o.keys[e],{...d(),reachedBy:o.keys.top}])),...i?Object.fromEntries(p.map(e=>[o.phoneKeys[e],l("mobile",d())])):{}})}return{slider:n,select:function(n,t,o,l,a){return{type:"custom",options:o,fallback:l,...a?{note:a}:{},...i({},{type:"select",label:n}),render:({value:r,onChange:i,field:u})=>{const s=u.options??o,c=u.fallback??l,d=s.some(e=>e.value===r)?r:c;/* @__PURE__ */
|
|
11
|
+
return X(v,{label:e(n),icon:Q(t),children:/* @__PURE__ */X(g,{value:d,ariaLabel:e(n),onChange:i,options:[...a?[{label:e(a),value:"\0note",disabled:!0}]:[],...s.map(n=>({label:e(n.label),value:n.value}))]})})}}},Segmented:t,segmented:u,boxJustifyField:C,boxAlignField:O,boxWrapField:S,directionField:E,gapField:I,placementField:A,PlacementGridView:function(n){return Ge(e,n)},positionFields:B,sidesPaddingFields:K,alignmentField:m,alignmentFields:function(e="align",n={}){return p(e,m,n)},AlignmentStrip:function({opts:e={},value:n,onChange:o,ariaLabel:l,disabled:a=!1}){return t({options:f(e),value:n,onChange:o,ariaLabel:l,disabled:a})},blockAlignmentField:y,blockAlignmentFields:function(e="align",n={}){return p(e,y,n)},BlockAlignmentStrip:function({opts:e={},value:n,onChange:o,ariaLabel:l,disabled:a=!1}){return t({options:b(e),value:n,onChange:o,ariaLabel:l,disabled:a})},boxFieldSet:function(e={}){const t=e.width??de,o=e.nudge?.limit??40,l=e.direction??{offered:se,fallback:"column"},a=l.resolve??(e=>l.offered.some(n=>n.value===e)?e:l.fallback),r={runs:e=>"row"===a(e)?"row":"column"};return{_gLayout:te("Layout"),placement:A("Placement",e.placement),width:n("Width",/* @__PURE__ */X(L,{}),t.min,t.max,t.step,t.fallback,"%"),direction:E(l),gap:I(e.gap??ce),justify:C(r),align:O(r),wrap:S(),_gNudge:te("Nudge"),...B({keys:e.nudge?.keys??{x:"nudgeX",y:"nudgeY"},min:-o,max:o,label:null}),...K(e.padding)}}}}var{slider:Xe,select:Ye,Segmented:ze,segmented:He,boxJustifyField:Ue,boxAlignField:Ze,boxWrapField:qe,directionField:Qe,gapField:en,placementField:nn,PlacementGridView:tn,positionFields:on,sidesPaddingFields:ln,alignmentField:an,alignmentFields:rn,AlignmentStrip:un,blockAlignmentField:sn,blockAlignmentFields:cn,BlockAlignmentStrip:dn,boxFieldSet:pn}=_e();export{me as ANCHOR_LABELS,un as AlignmentStrip,ae as BOX_ALIGN_POINTS,se as BOX_DIRECTIONS,ue as BOX_DIRECTION_LABEL,ce as BOX_GAP,le as BOX_JUSTIFY_POINTS,ge as BOX_NUDGE_LIMIT,pe as BOX_PLACEMENTS,fe as BOX_PLACEMENT_DEFAULT,de as BOX_WIDTH,re as BOX_WRAP_LABEL,ie as BOX_WRAP_POINTS,dn as BlockAlignmentStrip,Pe as FLAT_ACCESS,be as OPEN_PLACEMENT_POINTS,Ee as PHONE_KEY_ACCESS,tn as PlacementGridView,Ce as SIDE_PAD_KEYS,ze as Segmented,an as alignmentField,rn as alignmentFields,sn as blockAlignmentField,cn as blockAlignmentFields,Ze as boxAlignField,_e as boxFieldBuilders,pn as boxFieldSet,Ue as boxJustifyField,qe as boxWrapField,Qe as directionField,en as gapField,te as group,Q as iconOf,q as isNoGlyph,Z as noGlyph,he as normaliseBoxPlacement,Le as objectAccess,Ie as phoneObjectAccess,Be as phoneTwinFields,nn as placementField,on as positionFields,ye as positionPatch,oe as section,He as segmented,Ye as select,ee as sharedStyleKinds,je as sidesFromObject,ln as sidesPaddingFields,xe as sidesPaddingPatch,Fe as sidesToObject,Xe as slider,Se as useAccessPatch,Oe as useAccessValue};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{blockRuns as e,offeredChoices as s}from"./chunk-RUQOIQWI.js";import{useScreenBlockLook as t}from"./chunk-
|
|
1
|
+
import{blockRuns as e,offeredChoices as s}from"./chunk-RUQOIQWI.js";import{useScreenBlockLook as t}from"./chunk-LSGKADNV.js";import{DEFAULT_SCREEN_WORDS as l}from"./chunk-Q3VAJMXS.js";import{useWords as r}from"./chunk-MFIRYGHW.js";import{ItemCount as n,DropdownMenu as c}from"efficient-shell/ui";import{jsxs as a,jsx as o,Fragment as i}from"react/jsx-runtime";function m({choices:m,onPick:p}){const{Icon:u}=t(),f=r("screen",l),h=e(s(m)).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */a("span",{className:"flex w-full items-center gap-2",children:[
|
|
2
2
|
/* @__PURE__ */o("span",{children:e.group}),
|
|
3
3
|
/* @__PURE__ */o(n,{count:e.items.length,label:f.blockCount({count:e.items.length}),className:"ml-auto"})]})}]:[],...e.items.map(e=>({key:e.type,label:e.label,icon:/* @__PURE__ */o("span",{className:"sf-chip",children:/* @__PURE__ */o(u,{type:e.type,size:13})}),onSelect:()=>p(e.type)}))]);/* @__PURE__ */
|
|
4
4
|
return o(c,{align:"start",triggerClassName:"sf-add-card",items:h,trigger:/* @__PURE__ */a(i,{children:[
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as n}from"./chunk-
|
|
1
|
+
import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as n}from"./chunk-QAVA4V2C.js";import{ScreenChrome as e}from"./chunk-VXAGXHKI.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-BYONFJVQ.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-Q3VAJMXS.js";import{documentPermissions as s}from"./chunk-YYD257TD.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{useMemo as t,useState as d,useRef as l,useEffect as m,useCallback as g}from"react";import{Dialog as h,Button as f}from"efficient-shell/ui";import{jsx as u,jsxs as p,Fragment as v}from"react/jsx-runtime";var k=r(n),C=r(e);function N({onCancel:r,onDiscard:n,onSave:e}){const i=c("screen",o).leave,[a,s]=d(!1),t=l(!0);m(()=>(t.current=!0,()=>{t.current=!1}),[]);const k=g(async()=>{s(!0);try{await e()}finally{t.current&&s(!1)}},[e]);/* @__PURE__ */
|
|
2
2
|
return u(h,{open:!0,role:"alertdialog",size:"sm",title:i.title,onClose:r,footer:/* @__PURE__ */p(v,{children:[
|
|
3
3
|
/* @__PURE__ */u(f,{variant:"secondary",onClick:r,children:i.cancel}),
|
|
4
4
|
/* @__PURE__ */u(f,{variant:"ghost-danger",onClick:n,children:i.discard}),
|
|
5
|
-
/* @__PURE__ */u(f,{variant:"primary",loading:a,onClick:()=>{k()},children:i.save})]}),children:i.body})}function
|
|
6
|
-
return u(i,{target:r,addressing:n,onHostMessage:e,children:a})}var
|
|
7
|
-
/* @__PURE__ */u(k,{config:r,data:i,onChange:h,permissions:A,parts:n,children:/* @__PURE__ */u(C,{})}),f&&/* @__PURE__ */u(
|
|
5
|
+
/* @__PURE__ */u(f,{variant:"primary",loading:a,onClick:()=>{k()},children:i.save})]}),children:i.body})}function j({target:r,addressing:n,onHostMessage:e,children:a}){/* @__PURE__ */
|
|
6
|
+
return u(i,{target:r,addressing:n,onHostMessage:e,children:a})}var y=(r,n)=>/* @__PURE__ */p(v,{children:[r,n]});function A({config:r,parts:n,wrap:e=y}){const{data:i,error:d,redirecting:l,ready:m,readOnly:g,onChange:h,pendingNav:f,cancelPendingNav:p,discardAndNavigate:v,saveAndNavigate:j}=a(),A=t(()=>s(!g),[g]),V=c("screen",o);return l?/* @__PURE__ */u("div",{className:"sf-msg",children:V.loading}):d?/* @__PURE__ */u("div",{className:"sf-msg sf-msg--error",children:d}):m?i?e(
|
|
7
|
+
/* @__PURE__ */u(k,{config:r,data:i,onChange:h,permissions:A,parts:n,children:/* @__PURE__ */u(C,{})}),f&&/* @__PURE__ */u(N,{onCancel:p,onDiscard:v,onSave:j})):/* @__PURE__ */u("div",{className:"sf-msg",children:V.loading}):/* @__PURE__ */u("div",{className:"sf-msg",children:V.waitingForAuthorization})}export{A as DocumentScreen,j as ScreenMount};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{noControlField as e}from"./chunk-22I55W37.js";import{DEFAULT_SCREEN_WORDS as r}from"./chunk-
|
|
1
|
+
import{noControlField as e}from"./chunk-22I55W37.js";import{DEFAULT_SCREEN_WORDS as r}from"./chunk-Q3VAJMXS.js";import{deviceMetaOf as n,DEVICE_FIELD_MARKER as t}from"./chunk-YCSZAP7T.js";import{useWords as o}from"./chunk-MFIRYGHW.js";import{usePreviewDevice as i}from"./chunk-BSPCSC45.js";import{jsx as c}from"react/jsx-runtime";function u(e){return"mobile"===e?"mobile":"desktop"}var s={desktop:null,tablet:r.deviceNote.tablet,mobile:r.deviceNote.mobile},d="data-sf-device-hidden";function m(){/* @__PURE__ */
|
|
2
2
|
return c("span",{hidden:!0,[d]:""})}function f({tier:e,render:r,...n}){const t=i();return"each"===e?/* @__PURE__ */c(r,{...n,tier:u(t)}):u(t)===e?/* @__PURE__ */c(r,{...n}):/* @__PURE__ */c(m,{})}function l(e){return n(e)?.inner??e}function p(e,r){const n=r.render;return{...r,[t]:{tier:e,inner:r},render:r=>/* @__PURE__ */c(f,{tier:e,render:n,...r})}}function a(){const e=o("screen",r).deviceNote,n=i(),t="desktop"===n?null:e[n];return t?/* @__PURE__ */c("div",{className:"sf-device-scope",children:t}):/* @__PURE__ */c(m,{})}function h(){return e({type:"custom",render:()=>/* @__PURE__ */c(a,{})},"always")}export{d as DEVICE_HIDDEN_ATTR,s as DEVICE_NOTE,p as deviceField,h as deviceNote,u as shownTier,l as withoutDeviceGate};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{buildPaletteSections as e,pinnedSection as t,categoryLabel as n}from"./chunk-GDO4QJ4G.js";import{blockTypesIn as o}from"./chunk-IZGFJWH4.js";import{sectionTemplatesOf as r}from"./chunk-N7E6264U.js";import{sharedSectionsOf as l}from"./chunk-N3MJOHAG.js";import{SidePanelHead as i,PanelModeExit as s}from"./chunk-SBVIW3KJ.js";import{blockRuns as c}from"./chunk-RUQOIQWI.js";import{useScreenBlockLook as a,useScreenBlockRules as p,useScreenPinned as d}from"./chunk-
|
|
2
|
-
return
|
|
3
|
-
/* @__PURE__ */E
|
|
4
|
-
/* @__PURE__ */E
|
|
5
|
-
return
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */
|
|
1
|
+
import{buildPaletteSections as e,pinnedSection as t,categoryLabel as n}from"./chunk-GDO4QJ4G.js";import{blockTypesIn as o}from"./chunk-IZGFJWH4.js";import{sectionTemplatesOf as r}from"./chunk-N7E6264U.js";import{sharedSectionsOf as l}from"./chunk-N3MJOHAG.js";import{SidePanelHead as i,PanelModeExit as s}from"./chunk-SBVIW3KJ.js";import{blockRuns as c}from"./chunk-RUQOIQWI.js";import{useScreenBlockLook as a,useScreenBlockRules as p,useScreenPinned as d}from"./chunk-LSGKADNV.js";import{useEaselSession as m}from"./chunk-YM4UEGBV.js";import{DEFAULT_SCREEN_WORDS as f}from"./chunk-Q3VAJMXS.js";import{useEasel as u}from"./chunk-BBD3FLU3.js";import{easelMenuEntries as y}from"./chunk-FIVU2COQ.js";import{useWords as h}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-SQTVXE5D.js";import{DEFAULT_DRAG_WORDS as g}from"./chunk-TQ5Y6S2X.js";import{useState as b,useEffect as v,useMemo as j,useRef as w}from"react";import{SharedIcon as C,AddIcon as I}from"efficient-shell/icons/efficient";import{ContextMenu as O,toast as S,Dialog as $,Button as E}from"efficient-shell/ui";import{jsx as F,jsxs as x,Fragment as B}from"react/jsx-runtime";function D({name:e,pages:t,onDelete:n,onCancel:o}){const r=h("screen",f).shared,[l,i]=b(!1),s=w(null);/* @__PURE__ */
|
|
2
|
+
return F($,{open:!0,role:"alertdialog",size:"sm",title:r.deleteTitle({name:e}),onClose:o,initialFocus:s,footer:/* @__PURE__ */x(B,{children:[
|
|
3
|
+
/* @__PURE__ */F(E,{ref:s,variant:"secondary",onClick:o,children:r.cancel}),
|
|
4
|
+
/* @__PURE__ */F(E,{variant:"danger",loading:l,onClick:()=>{(async()=>{i(!0);try{await n()}finally{i(!1)}})()},children:r.deleteShared})]}),children:r.deleteMessage({count:t})})}var G=e=>`section:${e}`,M=e=>`block:${e}`,Q=e=>`template:${e}`,T=e=>`shared:${e}`,A=e=>`preset:${e}`;function L({at:w,placeBlocks:$,canTake:E,onPick:L,itemFor:V,session:W,siteWide:H,onClose:J,onHide:N,readOnly:U}){const z=u(e=>e.config),R=a(),{labelAtLevel:X,categoryLabel:Y,firstSection:K,Icon:P,Thumbnail:_}=R,{blockIsOffered:Z,canAddTo:q}=p(),ee=h("screen",f).add,te=h("drag",g).add,ne=m(),[oe,re]=b([]);v(()=>{let e=!1;const t=e=>Z(e,ne);return r(ne).list().then(n=>{if(e)return;const r=z.components;re(n.filter(e=>e.node?.type&&r[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[z,ne]);const le=d().shared,ie=h("screen",f).shared,[se,ce]=b([]),[ae,pe]=b(0);v(()=>{if(!le)return;let e=!1;const t=e=>Z(e,ne);return l(ne).list().then(n=>{if(e)return;const r=z.components;ce(n.filter(e=>e.node?.type&&r[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[z,ne,ae]);const[de,me]=b(null),[fe,ue]=b(null),ye=j(()=>e(z,R),[z]),he=e=>X(e,"section",z.components[e]?.label??e),ke=e=>({type:e.preset?A(e.preset.key):G(e.type),label:e.name,cover:/* @__PURE__ */F(_,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:ee.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),ge=e=>{const t=e.indexOf(":"),n=e.slice(0,t),o=e.slice(t+1);if("section"===n)return{kind:"section",type:o};if("block"===n)return{kind:"block",type:o};if("template"===n){const e=oe.find(e=>e.id===o);return e?{kind:"template",template:e}:null}if("shared"===n){const e=se.find(e=>e.id===o);return e?{kind:"shared",section:e}:null}if("preset"===n){const e=ye.find(e=>e.preset?.key===o)?.preset;return e?{kind:"preset",preset:e}:null}return null},be=e=>/* @__PURE__ */F("span",{className:"es-add-glyph-cover",children:/* @__PURE__ */F(P,{type:e,size:26})}),ve=j(()=>{const e=t(ye,K),o=/* @__PURE__ */new Map,r=e=>{e.retired||o.has(e.type)||!Z(e.type,ne)||o.set(e.type,e)};for(const t of e?[e]:ye.filter(e=>!e.preset)){const e=q(t.type)?.choices??[];e.forEach(r),e.forEach(e=>q(e.type,1)?.choices?.forEach(r))}$?.forEach(r);const l=new Set(ye.filter(e=>!e.preset).map(e=>e.type)),i=[...o.values()].filter(e=>!l.has(e.type)),s=e=>({type:M(e.type),label:e.label,cover:be(e.type),title:ee.tile({name:e.label}),keywords:[e.group??"",e.type].filter(Boolean)}),a=e=>!e.preset&&o.has(e.type)?{...ke(e),cover:be(e.type)}:ke(e),p=[];se.length>0&&p.push({key:"shared",title:ie.group,tiles:se.map(e=>({type:T(e.id),label:e.title,cover:/* @__PURE__ */F(_,{type:e.node.type}),mark:/* @__PURE__ */F(C,{size:12}),title:ie.onPages({count:e.used_on.length}),keywords:[he(e.node.type),e.node.type]}))}),oe.length>0&&p.push({key:"templates",title:ee.templates,tiles:oe.map(e=>({type:Q(e.id),label:e.name,cover:/* @__PURE__ */F(_,{type:e.node.type}),keywords:[he(e.node.type),e.node.type]}))});const d=i.filter(e=>!e.group);let m=!1;for(const t of Object.keys(z.categories??{})){const o=ye.filter(e=>e.cat===t);if(0===o.length)continue;const r=e&&o.some(t=>t.type===e.type)?e:null,l=(r?[r,...o.filter(e=>e.type!==r.type)]:o).map(a);r&&!m&&(l.splice(1,0,...d.map(s)),m=!0),p.push({key:`category:${t}`,title:n(z,t,Y),tiles:l})}const f=p.find(e=>e.key?.startsWith("category:"));if(!m&&f&&d.length>0&&(f.tiles=[...f.tiles,...d.map(s)],m=!0),c(i.filter(e=>e.group||!m)).forEach((e,t)=>{p.push({key:`blocks:${t}`,title:e.group??"",tiles:e.items.map(s)})}),!E)return p;const u=p.map(e=>({...e,tiles:e.tiles.map(e=>{const t=ge(e.type),n=t?E(t):null;return n?{...e,disabled:!0,disabledReason:n}:e})})),y=e=>e.tiles.some(e=>!e.disabled);return[...u.filter(y),...u.filter(e=>!y(e))]},[oe,se,ie,ye,z,ee,E,$,ne]);/* @__PURE__ */
|
|
5
|
+
return x(B,{children:[
|
|
6
|
+
/* @__PURE__ */F(i,{icon:/* @__PURE__ */F(I,{size:15}),title:ee.title,context:ee.contextAll,actions:/* @__PURE__ */F(s,{label:ee.done,description:ee.doneDescription,onClick:J}),onHide:N}),
|
|
7
|
+
/* @__PURE__ */x("div",{className:"sf-addside sf-scroll",children:[
|
|
8
|
+
/* @__PURE__ */F(k,{groups:ve,session:W,itemFor:e=>V(ge(e)??{kind:"section",type:e}),onInsert:L?e=>{const t=ge(e);t&&L(t)}:void 0,onTileMenu:(e,t)=>{const n=ge(e);return"shared"===n?.kind&&!U&&(me({section:n.section,...t}),!0)},at:w,hint:ee.hint,searchLabel:ee.search,readOnly:U,words:te}),H??null]}),de?/* @__PURE__ */F(O,{at:{x:de.x,y:de.y},owner:de.owner,onClose:()=>me(null),"aria-label":de.section.title,items:y([{label:ie.deleteShared,danger:!0,onClick:()=>{ue(de.section),me(null)}}])}):null,fe?/* @__PURE__ */F(D,{name:fe.title,pages:fe.used_on.length,onDelete:()=>(async e=>{try{await l(ne).remove(e.id)}catch{return void S.error(ie.deleteFailed)}ue(null),le?.removed?.(e),ce(t=>t.filter(t=>t.id!==e.id)),pe(e=>e+1)})(fe),onCancel:()=>ue(null)}):null]})}export{L as AddSidePanel,M as blockKey,A as presetKey,G as sectionKey,T as sharedKey,Q as templateKey};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DESIGN_GROUP_KEY as t,BUCKET_KEY as o}from"./chunk-3QB2ZQXK.js";import{panelFieldsOf as n}from"./chunk-5XL2RXFU.js";import{withoutDeviceGate as e}from"./chunk-7GGNFLHT.js";import{STYLE_KIND as r,fieldKind as s,copyStyle as c,heldStyle as i,planPaste as p,pasteMessage as u}from"./chunk-CWELHADJ.js";import{ANCHOR_FIELD_KEYS as f,foldMetaOf as a,MEDIA_FIELD_MARKER as l,TEXT_FIELD_MARKER as m,LINK_FIELD_MARKER as h}from"./chunk-ANPOR6EY.js";import{deviceMetaOf as y}from"./chunk-YCSZAP7T.js";var j=/* @__PURE__ */new Set([t.Size,t.Design,t.Layout,t.Position]),w=new Set(Object.values(t)),b=new Set(Object.values(o)),S=new Set(f),k=/* @__PURE__ */new Set(["focal","imageFocal"]),g=[l,m,h];function v(t){return`site:${t??""}`}function A(t){if(!t||"object"!=typeof t)return null;const o=t,n=e(t)??t,c=o[r]??n[r];if("string"==typeof c)return c;const i=o.options??n.options;if(Array.isArray(i)){return`choice:${i.map(t=>String(t?.value)).sort().join("|")}`}return s(n)}function L(t){const o=t,n=e(t);return g.some(t=>t in o||n&&t in n)}function O(t,e){const r=n(t,e)??{},s=[];let c=!0,i=!1;for(const[t,n]of Object.entries(r))b.has(t)?(c=t===o.Design,i=!1):w.has(t)?c&&(i=j.has(t)):i&&n&&"object"==typeof n&&!t.startsWith("_")&&(a(n)||S.has(t)||k.has(t)||L(n)||"slot"!==n.type&&s.push({path:[t],kind:A(n),counted:"mobile"!==y(n)?.tier}));return s}function d(t,o,n,e,r){c({scope:n,type:e.type,label:r,rows:t(o,e),props:e.props})}function D(t,o,n,e,r,s){const c=i(n);if(!c)return null;const f=p(c,{type:e.type,rows:t(o,e),props:e.props});return{...f,message:u(f,c.sourceLabel,r,s)}}function F(t,o,n,e){d(O,t,o,n,e)}function P(t,o,n,e,r){return D(O,t,o,n,e,r)}var X={scope:t=>v(t.siteId),rows:(t,o)=>O(t,o),copy:(t,o,n,e)=>F(e,t,o,n),plan:(t,o,n,e)=>P(e,t,o,n)};function C(t,o){if(!t&&!o)return X;const n=t?.rows,e=n?(t,o)=>n(t,o):O;return{scope:t?.scope??X.scope,rows:(t,o)=>e(t,o),copy:t?.copy??((t,o,n,r)=>d(e,r,t,o,n)),plan:t?.plan??((t,n,r,s)=>D(e,s,t,n,r,o))}}export{F as copyNodeStyle,O as nodeStyleRows,P as planNodePaste,A as shopFieldKind,v as siteStyleScope,C as styleClipboardOf};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{routeSharedHostMessage as e}from"./chunk-QZJKWKGH.js";import{describeLoadFailure as r,hostLoadRefusal as n}from"./chunk-ERR437B5.js";import{editLockOf as t}from"./chunk-GR3XRILS.js";import{NO_DOCUMENT_ADDRESSING as o}from"./chunk-RLBXE4EU.js";import{saveStatusOf as u,resetForDocumentSwitch as a}from"./chunk-6ATIYLUL.js";import{isExpiredSession as s,readEaselFailure as i}from"./chunk-KO47WAWR.js";import{useAdminBridge as l}from"./chunk-NQW6XCAY.js";import{STATUS_UNREACHABLE as c}from"./chunk-KCOBHPN6.js";import{useEaselSession as d}from"./chunk-YM4UEGBV.js";import{backendOf as f,setSessionDocumentSite as m}from"./chunk-SNF5764Q.js";import{useEaselHost as k}from"./chunk-LX23TCTP.js";import{DEFAULT_SCREEN_WORDS as v}from"./chunk-Q3VAJMXS.js";import{useAutosave as g}from"./chunk-NDRZP6YR.js";import{canWriteDocument as p,newEaselClientId as h,reloadIfVersionMoved as y,openUnansweredClaim as w,FAIL_OPEN_RETRY_MS as b,CLAIM_FAIL_OPEN_MS as S,holderOf as I}from"./chunk-YYD257TD.js";import{useWords as P}from"./chunk-MFIRYGHW.js";import{createContext as j,useContext as R,useState as E,useMemo as A,useCallback as B,useEffect as T,useRef as C}from"react";import{jsx as H}from"react/jsx-runtime";var L={content:[],root:{},zones:{}};var D=j(null);function N(){const e=R(D);if(!e)throw new Error("useStorefrontDocument must be used within StorefrontDocumentProvider");return e}function O({target:j,addressing:R=o,onHostMessage:N,children:O}){const M=R,{homeSlug:Y,entryMayBounce:F,entryBounce:W,onSwitch:V,tellsHost:K,adapterFor:U,migrateRenamedProps:X,describeMissing:G,onLoadFailed:Q}=M,[x,J]=E(j),Z=k(),z=d(),_=A(()=>f(z),[z]),q=A(()=>t(z),[z]),$="template"===x.kind,ee="template"===x.kind?x.id:null,re="template"===x.kind?x.pageSlug??Y??"":"document"===x.kind?x.slug??"":x.slug,ne="page"===x.kind?x.siteId??null:null,te=z.blocks,oe=A(()=>U(x,_,te),[U,_,te,x.kind,"template"===x.kind?x.id:"document"===x.kind?x.record:x.siteId]),ue=oe.capabilities,ae=B(e=>z.documentHooks?.stored?.(e)??e,[z]);T(()=>{m(z,ne)},[z,ne]);const se=C(x);T(()=>{se.current=x},[x]);const{token:ie,tokenRef:le,capabilities:ce}=l({onMessage:r=>{if(N?.(r)||e(r))return;const n=r;if("storefront-editor:navigate"===n?.type){const e=r;e?.target&&Er(e.target)}}}),de=!z.usesBridgedToken||null!==ie,fe=oe.lock,me=Boolean(_.lock),[ke,ve]=E(null),[ge,pe]=E(null),[he,ye]=E(null),[we,be]=E(null),Se=P("screen",v),Ie=we?function(e,r){if(null!==e.sentence)return e.sentence;if(!e.missing)return r.loadFailed({cause:e.cause});switch(e.target.kind){case"template":return r.missingTemplatePage;case"document":return r.missingDocument;default:return r.missingPage({slug:e.slug})}}(we,Se):null,[Pe,je]=E(null),Re=C(null),Ee=C(null),[Ae,Be]=E(!1),Te=C(null),[Ce,He]=E(null),Le=C(null),[De,Ne]=E(null),[Oe,Me]=E(!1),Ye=C(null);T(()=>{Ye.current=De},[De]);const[Fe,We]=E(ue.hasEditLock?{kind:"checking"}:{kind:"editing"}),Ve=C(Fe);T(()=>{Ve.current=Fe},[Fe]);const Ke=C(()=>Promise.resolve(!1)),Ue=B(e=>{Ee.current=e,Be(!0)},[]),Xe=g({save:async({id:e,data:r})=>{if(p(Ve.current)){if(!await Ke.current(e,r)){if(!p(Ve.current))return void Ue({id:e,data:r});throw new Error("page save did not land")}}else Ue({id:e,data:r})},onFailure:(e,r)=>{0===r&&Z.send("storefront-editor:save-failed")}}),{state:Ge,push:Qe,flush:xe,pause:Je,resume:Ze,stop:ze,reset:_e,retryNow:qe,hasPending:$e}=Xe,er=C(Ge);T(()=>{er.current=Ge},[Ge]);const rr=u(Ge),nr=B(()=>{const e=Ee.current;e&&(Ee.current=null,Be(!1),Qe(e))},[Qe]),tr=C("");tr.current||(tr.current=h());const[or,ur]=E(0),ar=C(!1),[sr,ir]=E(F(j)),lr=C(!1);T(()=>{if(lr.current)return;lr.current=!0;const e=Z.address.search(),r=W(j,e);r?Z.address.load(r):F(j)&&ir(!1)},[j,Z]);const cr=Z.send;T(()=>{if(!de)return;let e=!1;const t=se.current,o=oe.resolve(re),u=z.documentHooks?.opening?.({slug:re,isTemplate:$,capabilities:ue});return o.then(async r=>{if(e)return;if(!r)return"page"===t.kind&&null!==Y&&re!==Y?void Z.address.load({kind:"page",slug:Y,siteId:ne??void 0}):(be({target:t,slug:re,missing:!0,sentence:G?.(t)??null}),void Q?.(t,null));const n=r.readOnlyReason?r.readOnlyReason:null;Re.current=n,je(n),ve(r.id),pe(r.kind??null),Le.current=r.version??null;const o=r.layout,a=o&&Object.keys(o).length?o:L,s=X(a),i=u?await u(s):s;e||ye(i)}).catch(o=>{e||(console.error("[storefront-editor] document load failed",o),be({target:t,slug:re,missing:!1,sentence:n(o,{slug:re},z),cause:r(o,z)}),Q?.(t,o))}),()=>{e=!0}},[de,ie,$,oe,re]);const dr=B(e=>new Promise(r=>{const n=Date.now(),t=setInterval(()=>{const o=le.current;o&&o!==e?(clearInterval(t),r(o)):Date.now()-n>6e3&&(clearInterval(t),r(null))},200)}),[]),fr=B(async e=>{const r=le.current;if(!r&&z.usesBridgedToken)return{ok:!1,error:new Error("no editor token")};try{return{ok:!0,value:await e(r??"")}}catch(n){if(s(n,z)){cr("storefront-editor:auth-expired");const n=r?await dr(r):null;if(n)try{return{ok:!0,value:await e(n)}}catch(e){return{ok:!1,error:e}}}return{ok:!1,error:n}}},[cr,dr,z]),mr=B(async e=>{const r=le.current?await fr(e):{ok:!1};return r.ok||cr("storefront-editor:save-failed"),r.ok},[cr,fr]),kr=B(async(e,r,n=!1)=>{if(null!==Re.current)return!1;if(!p(Ve.current))return!1;if(Ye.current)return!1;const t=await fr(()=>oe.saveLayout(e,r,Le.current,tr.current));if(t.ok)return Le.current=t.value.version??Le.current,Me(!1),!0;const o=q.readLockTaken(t.error);if(o){const e={kind:"takenover",holder:o};return Ve.current=e,We(e),!1}const u=q.readSaveConflict(t.error);if(u){if(u.savedByYou&&!n&&oe.rereadVersion){const n=await fr(()=>oe.rereadVersion(e));if(n.ok&&n.value)return Le.current=n.value,Ke.current(e,r,!0)}ze(),Ye.current=u,Ne(u)}return Me(i(t.error,z)?.status===c),!1},[oe,fr,ze,z]);T(()=>{Ke.current=kr},[kr]);const vr=B(e=>{if(null!==Re.current)return;if(cr("storefront-editor:dirty"),!ke)return;const r=ae(e);Te.current=r,p(Ve.current)?Qe({id:ke,data:r}):Ue({id:ke,data:r})},[ke,cr,Ue,Qe,ae]),gr=B(async()=>{p(Ve.current)&&nr();return await xe()&&null==Ee.current},[nr,xe]),pr=C(gr);T(()=>{pr.current=gr},[gr]);const hr=C(fr);T(()=>{hr.current=fr},[fr]);const yr=B(()=>{Z.address.reload()},[Z]),wr=C(()=>Promise.resolve(!1));T(()=>{wr.current=()=>{const e=oe.rereadVersion;return ke&&e?y({ours:Le.current,stored:async()=>{const r=await hr.current(()=>e(ke));return r.ok?r.value:null},hasPending:()=>null!=Ee.current||$e(),reload:yr}):Promise.resolve(!1)}},[oe,ke,$e,yr]);const br=null!==Pe;T(()=>{if(!fe||!ke||!de||br)return;let e=!1,r=null,n=null;const t=tr.current,o={claim:async e=>{const r=await hr.current(()=>fe.claim(ke,t,e));if(r.ok)return{heartbeat_seconds:r.value.heartbeatSeconds};throw r.error},cancelled:()=>e,currentAccess:()=>Ve.current,heldWrite:()=>({pending:null!=Ee.current||$e(),autoSaveEnabled:!er.current.paused,saveConflict:null!=Ye.current}),setAccess:e=>{Ve.current=e,We(e)},releaseHeldWrite:()=>{pr.current()},startHeartbeat:e=>{r&&clearInterval(r),r=setInterval(()=>{u(!1)},e)},stopHeartbeat:()=>{r&&(clearInterval(r),r=null)},reloadIfMoved:()=>{wr.current()}},u=q.makeClaimBeat(o),a=ar.current;return ar.current=!1,a||(We({kind:"checking"}),n=setTimeout(()=>{n=null,w(o)&&o.startHeartbeat(b)},S)),u(a).finally(()=>{n&&clearTimeout(n),n=null}),()=>{e=!0,n&&clearTimeout(n),r&&clearInterval(r),fe.release(ke,t).catch(()=>{})}},[ke,fe,de,ie,or,br]);const Sr=B(()=>{fe&&ke&&(ar.current=!0,ur(e=>e+1))},[ke,fe]),Ir=B(()=>{We(e=>{const r="blocked"===e.kind||"takenover"===e.kind?e.holder:null;return r?{kind:"readonly",holder:r}:e})},[]),Pr=B(()=>{er.current.paused?(p(Ve.current)&&nr(),Ze()):Je()},[nr,Je,Ze]),jr=B(()=>{qe()},[qe]),Rr=B(e=>{Te.current=null,a("template"!==e.kind&&me,{resetAutosave:()=>{_e(),Ee.current=null,Be(!1)},setVersion:e=>{Le.current=e},setSaveConflict:Ne,setAccess:We}),V(e),J(e),Re.current=null,je(null),ve(null),pe(null),ye(null),be(null),Z.address.show(e),"document"!==e.kind&&K(e)&&Z.send("storefront-editor:navigated",{target:e})},[_e,Z,me,V,K]),Er=B(e=>{if(function(e,r,n){if(e.kind!==r.kind)return!1;if("template"===e.kind){const t=r;return e.id===t.id&&(e.pageSlug??n)===(t.pageSlug??n)}if("document"===e.kind){const n=r;return e.record===n.record&&(e.slug??"")===(n.slug??"")}const t=r;return e.slug===t.slug&&e.siteId===t.siteId}(e,se.current,Y))return;const r=null!=Ee.current;if(!r&&!$e())return void Rr(e);const n=er.current;r||n.paused||n.failed||n.stopped?He(e):xe().then(r=>{r?Rr(e):He(e)})},[Rr,$e,xe,Y]),Ar=B(()=>He(null),[]),Br=B(()=>{He(e=>(e&&Rr(e),null))},[Rr]),Tr=B(async()=>{const e=Ce;if(!e)return;await gr()&&(He(null),Rr(e))},[Ce,gr,Rr]),Cr=B(async e=>{if(null!==Re.current)return;if(!ke)return;if(!p(Ve.current)||Ye.current)return;const r=ae(e);if(!await kr(ke,r))return void(Ye.current||cr("storefront-editor:save-failed"));const n=oe.publish;if(!ue.canPublish||!n)return void cr("storefront-editor:saved");const t=await fr(()=>n(ke,Le.current??void 0));if(!t.ok){const{error:e}=t;return void cr("storefront-editor:publish-failed",{reason:e instanceof Error&&e.message?e.message:null})}Le.current=t.value.version??Le.current,cr("storefront-editor:published")},[ke,oe,ue.canPublish,cr,kr,fr,ae]);/* @__PURE__ */
|
|
2
|
+
return H(D.Provider,{value:{target:x,adapter:oe,capabilities:ue,templateId:ee,currentSlug:re,currentKind:ge,siteId:ne,ready:de,token:ie,tokenRef:le,notifyParent:cr,bridgeCapabilities:ce,runAuthed:mr,docId:ke,data:he,getLiveData:()=>Te.current??he,error:Ie,redirecting:sr,saveStatus:rr,saveState:Ge,autoSaveEnabled:!Ge.paused,autoSaveStoppedByConflict:Ge.stopped,hasUnsavedEdits:Ge.pending||Ae,toggleAutoSave:Pr,retrySave:jr,onChange:vr,flushSave:gr,onPublish:Cr,access:Fe,readOnly:null!==I(Fe)||null!==Pe||null!==De,readOnlyReason:Pe,takeOverEditing:Sr,viewReadOnly:Ir,saveConflict:De,saveUnreachable:Oe,reloadFromServer:yr,navigate:Er,pendingNav:Ce,cancelPendingNav:Ar,discardAndNavigate:Br,saveAndNavigate:Tr},children:O})}export{D as ScreenDocumentContext,O as ScreenDocumentProvider,N as useScreenDocument};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{SettingsDefaultReset as e}from"./chunk-2T22IY3J.js";import{DEFAULT_COLOUR_ROW_WORDS as l}from"./chunk-56ID6FKZ.js";import{SettingsField as n}from"./chunk-MIX7EGRG.js";import{SettingsSegmented as a}from"./chunk-DX3VILZ3.js";import{AccordionHeading as i,Tooltip as s,HexInput as t,Button as o,toast as d,ColorPicker as r}from"efficient-shell/ui";export{AlignmentGrid,BorderInput,CornersInput,SidesEachToggle,SidesInput,borderSides,borderStartEach,sidesStartEach}from"efficient-shell/ui";import{jsx as c,jsxs as h,Fragment as u}from"react/jsx-runtime";import{parseHexColor as b}from"efficient-shell/format";import{BackgroundIcon as m,WidthIcon as p}from"efficient-shell/icons/efficient";function f({title:e,level:l=3,id:n,className:a}){/* @__PURE__ */
|
|
2
|
+
return c(i,{title:e,level:l,id:n,className:a?`es-panel-band ${a}`:"es-panel-band"})}function v({title:e,level:l=4,id:n,className:a}){/* @__PURE__ */
|
|
3
|
+
return c(i,{tier:"row",title:e,level:l,id:n,className:a})}function g({name:e,preview:l,offPage:n,status:a,onOpen:i,id:t,className:o}){const d=null!=l;/* @__PURE__ */
|
|
4
|
+
return h("button",{type:"button",id:t,className:o?`es-drill ${o}`:"es-drill",onClick:i,children:[
|
|
5
|
+
/* @__PURE__ */h(s,{content:d?/* @__PURE__ */h(u,{children:[e,
|
|
6
|
+
/* @__PURE__ */c("br",{}),l]}):e,describe:!1,className:"es-drill-text",children:[
|
|
7
|
+
/* @__PURE__ */c("span",{className:"es-drill-name",children:e}),d?/* @__PURE__ */c("span",{className:n?"es-drill-preview is-offpage":"es-drill-preview",children:l}):null]}),a?/* @__PURE__ */c("span",{className:"es-drill-status",children:a}):null,
|
|
8
|
+
/* @__PURE__ */c("span",{className:"es-drill-chev","aria-hidden":"true"})]})}function N({label:a,value:i,onChange:s,icon:o,hint:d,id:u,ariaLabel:m,presets:p,inherited:f,caption:v,opacity:g,onOpacityChange:N,changed:w,onReset:C,resetTo:I,readOnly:k,words:x,resetWords:y,children:R}){const S={...l,...x},j=m??a,L=i?null:b(f??""),E=void 0===v||i&&b(v)===b(i)?null:v,F=e=>b(e)===b(i),O=e=>{F(e)||s(e)},$=e=>/* @__PURE__ */c(r,{id:u,value:i,onChange:O,label:j,presets:p?[...p]:void 0,fallback:L??void 0,disabled:k,size:"md",align:"start",...e});/* @__PURE__ */
|
|
9
|
+
return h(n,{label:a,icon:o,htmlFor:u,changed:w,hint:d,action:C?/* @__PURE__ */c(e,{words:y,label:a,changed:Boolean(w),detail:I,onReset:C,disabled:k}):void 0,children:[N?
|
|
10
|
+
/* @__PURE__ */c("div",{className:"es-colour",children:$({showHexInput:!0,opacity:g,onOpacityChange:N})}):/* @__PURE__ */h("div",{className:"es-colour",children:[$({}),/* @__PURE__ */c("span",null!==E?{className:"es-colour-caption",children:E}:{className:"es-colour-hexwrap",children:/* @__PURE__ */c(t,{value:i||L||"",onChange:e=>{F(e)||e===L||s(e)},label:S.hexCode({label:j}),placeholder:i||L?void 0:S.notSet,className:L?"es-colour-hex is-inherited":"es-colour-hex",disabled:k,size:"md"})})]}),R]})}function w({label:e,onPress:l,disabled:n,note:a,doneLabel:i,icon:s,id:t,className:r}){const u=null!=a,b=u&&t?`${t}-note`:void 0;/* @__PURE__ */
|
|
11
|
+
return h("div",{className:r?`es-action-wrap ${r}`:"es-action-wrap",children:[
|
|
12
|
+
/* @__PURE__ */c(o,{variant:"secondary",size:"lg",block:!0,id:t,disabled:n,"aria-describedby":b,onClick:()=>{const e=l();e&&"function"==typeof e.then?e.then(()=>{d.success(i)}):d.success(i)},leftIcon:s?/* @__PURE__ */c("span",{className:"es-action-icon","aria-hidden":"true",children:s}):void 0,children:/* @__PURE__ */c("span",{className:"es-action-label",children:e})}),u?/* @__PURE__ */c("p",{id:b,className:"es-action-note",children:a}):null]})}var C=["full","content"],I={label:"Background",full:"Full width",content:"Content width"};function k({value:l,changed:i,detail:s,onChange:t,onReset:o,disabled:d=!1,hint:r,labelId:h,words:u,resetWords:b}){const p={...I,...u};/* @__PURE__ */
|
|
13
|
+
return c(n,{label:p.label,labelId:h,icon:/* @__PURE__ */c(m,{}),changed:i,hint:r,action:/* @__PURE__ */c(e,{words:b,label:p.label,changed:i,detail:s,onReset:o}),children:/* @__PURE__ */c(a,{options:C.map(e=>({id:e,label:"full"===e?p.full:p.content})),value:l,onChange:t,ariaLabel:p.label,disabled:d})})}var x={label:"Content",full:"Full width",content:"Content width"};function y({mode:l,onMode:i,number:s,changed:t,detail:o,onReset:d,fullClosed:r=!1,disabled:u=!1,hint:b,labelId:m,words:f,resetWords:v}){const g={...x,...f},N=void 0!==l&&i?/* @__PURE__ */c(a,{options:C.map(e=>({id:e,label:"full"===e?g.full:g.content,disabled:"full"===e&&r})),value:l,onChange:i,ariaLabel:g.label,disabled:u}):null;/* @__PURE__ */
|
|
14
|
+
return c(n,{label:g.label,labelId:m,icon:/* @__PURE__ */c(p,{}),changed:t,hint:b,action:/* @__PURE__ */c(e,{words:v,label:g.label,changed:t,detail:o,onReset:d}),children:N&&s?/* @__PURE__ */h("div",{className:"es-width-stack",children:[N,s]}):N??s??null})}export{C as BACKGROUND_WIDTHS,I as DEFAULT_BACKGROUND_WIDTH_WORDS,x as DEFAULT_CONTENT_WIDTH_WORDS,w as SettingsAction,k as SettingsBackgroundWidth,N as SettingsColour,y as SettingsContentWidth,g as SettingsDrill,f as SettingsGroupHead,v as SettingsGroupSub};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{useAccessPatch as e,FLAT_ACCESS as r,useAccessValue as o}from"./chunk-5OKOCRXT.js";import{CornersInput as t,BorderInput as s,SettingsColour as l}from"./chunk-CLAADE4J.js";import{SettingsDefaultReset as n}from"./chunk-2T22IY3J.js";import{noControlField as i,NoControlMark as a}from"./chunk-22I55W37.js";import{DEFAULT_PANEL_WORDS as c,DEFAULT_COLOUR_ROW_WORDS as d}from"./chunk-56ID6FKZ.js";import{SettingsField as u}from"./chunk-MIX7EGRG.js";import{useWords as p}from"./chunk-MFIRYGHW.js";import{CornerIcon as y,BorderAllIcon as h}from"efficient-shell/icons/efficient";import{jsx as f}from"react/jsx-runtime";var m=e=>e;function b(e,t){const s=e.access?void 0:{value:t.value,onChange:t.onChange};return o(e.access??r,e.key,s)}function g(e,t){return o(e.access??r,t??"")}function v(e){return{...i({type:"custom",render:()=>/* @__PURE__ */f(a,{})},"always"),reachedBy:e}}function w({o:o,say:t,props:s}){const n=p("colourRow",d),i=p("panel",c),a=o.useFollows(),u=o.usePresets?.(),y=o.opacity?.useUnset?.()??100,[h,m]=b(o,s),[v,w]=g(o,o.opacity?.key),C=e(o.access??r),k="string"==typeof h?h:"",j="number"==typeof v,B=o.access?void 0:"";/* @__PURE__ */
|
|
2
|
+
return f(l,{label:t(o.label),icon:o.icon,value:k,onChange:e=>m(""===e?B:e),inherited:a,presets:u,changed:""!==k||j,onReset:()=>{j&&o.opacity?C([[o.key,B],[o.opacity.key,void 0]]):m(B)},resetTo:o.resetTo?o.resetTo(a.toUpperCase()):a.toUpperCase(),...o.opacity?{opacity:j?v:y,onOpacityChange:e=>w(e)}:{},readOnly:s.readOnly,words:n,resetWords:i})}var C=20;function k({o:e,say:r,props:o}){const t=e.useFollows(),[l,n]=b(e,o),i=l&&"object"==typeof l?l:{},a=t.width,c={width:r("Border width"),sides:{top:r("Border top"),right:r("Border right"),bottom:r("Border bottom"),left:r("Border left")},style:r("Border style"),styles:{solid:r("Solid"),dashed:r("Dashed"),dotted:r("Dotted")},color:r("Border color"),unit:"px"};/* @__PURE__ */
|
|
3
|
+
return f(u,{label:r("Border"),icon:/* @__PURE__ */f(h,{}),children:/* @__PURE__ */f(s,{label:r("Border"),value:i,each:!1,onChange:r=>n(function(e){const r=Object.fromEntries(Object.entries(e).filter(([,e])=>null!=e&&""!==e));return Object.keys(r).length?r:void 0}(e.styles?{width:r.width,color:r.color,style:r.style}:{width:r.width,color:r.color})),placeholder:{sides:{top:a,right:a,bottom:a,left:a},style:"solid",color:t.color},presets:[t.color],words:c,styles:e.styles??!1,max:20,readOnly:o.readOnly})})}var j=["tl","tr","br","bl"],B=40;function F({o:o,say:s,props:l}){const i=p("panel",c),a=o.useFollows(),[d,h]=b(o,l),[m,v]=g(o,o.sidesKey),w=e(o.access??r),C=o.access?void 0:null,k="number"==typeof d&&Number.isFinite(d)?d:null,B=Array.isArray(m)?j.filter(e=>m.includes(e)):[...j],F=[{value:"tl",label:s("Top left")},{value:"tr",label:s("Top right")},{value:"bl",label:s("Bottom left")},{value:"br",label:s("Bottom right")}];/* @__PURE__ */
|
|
4
|
+
return f(u,{label:s("Corners"),icon:/* @__PURE__ */f(y,{}),changed:null!==k||Array.isArray(m),action:/* @__PURE__ */f(n,{label:s("Corners"),changed:null!==k||Array.isArray(m),detail:`${a}px`,onReset:()=>Array.isArray(m)?w([[o.key,C],[o.sidesKey,C]]):h(C),words:i}),children:/* @__PURE__ */f(t,{label:s("Corners"),value:B,corners:F,onChange:e=>{const r=j.filter(r=>e.includes(r));v(r.length===j.length?C:r)},radius:k,onRadiusChange:e=>h(e??C),radiusMin:0,radiusMax:40,radiusStep:o.step??1,radiusPlaceholder:String(a),disabled:l.readOnly})})}function O(e=m){return{colourField:r=>({type:"custom",render:o=>/* @__PURE__ */f(w,{o:r,say:e,props:o})}),borderField:r=>({type:"custom",render:o=>/* @__PURE__ */f(k,{o:r,say:e,props:o})}),cornersField:r=>({type:"custom",render:o=>/* @__PURE__ */f(F,{o:r,say:e,props:o})})}}var{colourField:A,borderField:R,cornersField:T}=O();export{C as BORDER_WIDTH_MAX,B as CORNER_RADIUS_MAX,j as CORNER_SIDES,R as borderField,A as colourField,T as cornersField,v as keptByRow,O as styleFieldBuilders};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{usePickFollowsSelection as n}from"./chunk-NCXYC7WI.js";import{slotFieldsOf as e,slotChildrenIn as t}from"./chunk-TCAAOYQY.js";import{EaselCanvas as r,useSelectedFields as o}from"./chunk-BBD3FLU3.js";import{Inspector as i}from"./chunk-
|
|
1
|
+
import{usePickFollowsSelection as n}from"./chunk-NCXYC7WI.js";import{slotFieldsOf as e,slotChildrenIn as t}from"./chunk-TCAAOYQY.js";import{EaselCanvas as r,useSelectedFields as o}from"./chunk-BBD3FLU3.js";import{Inspector as i}from"./chunk-R76XMEKT.js";import{fieldIsShown as u}from"./chunk-BPXEFVSQ.js";import{createContext as l,useContext as s}from"react";import{DesktopIcon as c}from"efficient-shell/icons/efficient";import{jsx as f}from"react/jsx-runtime";var a={kind:"selection"};function d(n){return"selection"===n.kind}function p(n,e){if(d(n)&&d(e))return!0;const t=n,r=e,o=Object.keys(t);return o.length===Object.keys(r).length&&o.every(n=>Object.is(t[n],r[n]))}function m(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function k(n,t){const r=n.components?.[t.type]?.fields??{};return e(n,t.type).filter(n=>u(r[n],{values:t.props}))}function h(n,e){return k(n,e).flatMap(n=>t(e,n))}function v(n,e,t){const r=n.slotsOf?.(t);return r||k(e,t).map(n=>({slot:n,label:n,rung:!1}))}function y(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function g(n,e){return n.isLast?n.isLast(e):e.type===n.last}var b={},O=()=>b,j=()=>"",w=()=>null,C=()=>{},L={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},S={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},B={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */f(c,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},D={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},N={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function P(){/* @__PURE__ */
|
|
2
2
|
return f(r,{height:"fill"})}function F(){const{id:n,fields:e,values:t,readOnly:r,onChange:u}=o();/* @__PURE__ */
|
|
3
3
|
return f("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */f(i,{fields:e,values:t,onChange:u,readOnly:r,idPrefix:n})})}var I=l({});function T({parts:n,children:e}){/* @__PURE__ */
|
|
4
|
-
return f(I.Provider,{value:n,children:e})}function x(){return s(I)}function A(){return(x().useOwnerName??j)()}function G(){return(x().useDocumentLabel??
|
|
5
|
-
return f(nn.Provider,{value:n,children:e})}function tn(){return s(nn)}function rn(){return x().Inspector??F}export{a as SELECTION_MODE,en as ScreenCanvasTargetProvider,T as ScreenPartsProvider,y as isPinnedFirst,g as isPinnedLast,d as isSelectionMode,m as isSlotMode,p as sameInspectorMode,v as screenSlotsOf,h as shownChildSlotsOf,k as shownSlotFieldsOf,
|
|
4
|
+
return f(I.Provider,{value:n,children:e})}function x(){return s(I)}function A(){return(x().useOwnerName??j)()}function G(){return(x().useDocumentLabel??w)()}function R(n,e,t,r){return(x().useBridges??O)(n,e,t,r)}function X(n){return(x().useStandaloneBridges??O)(n)}function Y(n,e){(x().useDocumentPass??C)(n,e)}function E(){return x().blockRules??L}function K(){return x().blockLook??S}function M(){return x().devices??B}function Q(){return x().leftView??D}function V(){return x().pinned??N}function H(){return x().saveSwitch??!0}function U(e){n(!0===x().pickFollowsSelection,e)}function W(){return x().storageNamespace||void 0}function Z(){return x().styleClipboard??null}function q(){return x().nodeKeys??!0}function z(){return x().notify??null}function J(){return x().Canvas??P}function $(){return x().CanvasHead??null}function _(){return x().canvasDrag??null}var nn=l(null);function en({target:n,children:e}){/* @__PURE__ */
|
|
5
|
+
return f(nn.Provider,{value:n,children:e})}function tn(){return s(nn)}function rn(){return x().Inspector??F}export{a as SELECTION_MODE,en as ScreenCanvasTargetProvider,T as ScreenPartsProvider,y as isPinnedFirst,g as isPinnedLast,d as isSelectionMode,m as isSlotMode,p as sameInspectorMode,v as screenSlotsOf,h as shownChildSlotsOf,k as shownSlotFieldsOf,K as useScreenBlockLook,E as useScreenBlockRules,R as useScreenBridges,_ as useScreenCanvasDrag,J as useScreenCanvasFrame,$ as useScreenCanvasHead,tn as useScreenCanvasTarget,M as useScreenDevices,G as useScreenDocumentLabel,Y as useScreenDocumentPass,rn as useScreenInspectorPanel,Q as useScreenLeftView,q as useScreenNodeKeys,z as useScreenNotify,A as useScreenOwnerName,x as useScreenParts,U as useScreenPickFollowsSelection,V as useScreenPinned,H as useScreenSaveSwitch,W as useScreenStorageNamespace,Z as useScreenStyleClipboard,X as useStandaloneScreenBridges};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useSectionOps as o}from"./chunk-
|
|
1
|
+
import{useSectionOps as o}from"./chunk-WOA775T4.js";import{SELECTION_MODE as e}from"./chunk-LSGKADNV.js";import{decodePartId as r,encodePartId as t}from"./chunk-R4AUZVA3.js";import{useEasel as n}from"./chunk-BBD3FLU3.js";import{usePreviewParts as p}from"./chunk-467WWV4I.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:a}){const{getSelectorForId:u}=n(o=>o),f=o(),{setSelectedPartId:k,setSelectHandler:l}=p(),I=d(o=>{const t=r(o);if(!t)return;const{nodeId:n,propKey:p}=t;p?(i(o=>s(o)&&o.nodeId===n&&o.propKey===p?o:{kind:"part",nodeId:n,propKey:p}),a?.(n)):i(o=>"part"===o.kind?e:o)},[i,a]);c(()=>{l(I)},[l,I]);const h=s(m)?t(m.nodeId,m.propKey):null;c(()=>{k(h)},[h,k]);return{selectNode:d(o=>{i(()=>e);const r=u(o);r&&f.select(r)},[i,u,f]),openPartId:h}}export{m as usePartBridge};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={title:"Add",contextAll:"Sections and blocks",done:"Done",doneDescription:"Close Add and go back",templates:"Your templates",tile:({name:e})=>`Add ${e}`,hint:"Drag onto the page.",search:"Search",onlySections:"Only sections go here",notInside:({name:e})=>`Cannot go inside ${e}`,addingTo:({name:e})=>`Adding to ${e}`,addingBefore:({name:e})=>`Adding before ${e}`,addingAtEnd:"Adding at the end of the page",addingHere:"Adding here"},a=e=>1===e?"1 page":`${e} pages`,t={group:"Shared sections",onPages:({count:e})=>`On ${a(e)}`,makeShared:"Make shared",makeSharedHint:"Use this section on other pages from Add. Change it once, and every page changes.",name:"Name",cancel:"Cancel",makeFailed:"Could not make it shared. Try again.",detach:"Detach from shared",removeFromPage:"Remove from this page",removed:({count:e})=>e>0?`Removed from this page · still on ${a(e)}`:"Removed from this page",deleteShared:"Delete shared section",deleteTitle:({name:e})=>`Delete “${e}”?`,deleteMessage:({count:e})=>0===e?"No page uses it. Nothing on the website changes.":1===e?"The page that uses it keeps its own copy. Nothing disappears from the website.":`The ${e} pages that use it each keep their own copy. Nothing disappears from the website.`,deleteFailed:"Could not delete it. Try again.",alreadyHere:"Already on this page"};var o={savedAgo:function({seconds:e}){const a=Math.max(0,Math.floor(e));if(a<1)return"Saved just now";if(a<60)return`Saved ${a} second${1===a?"":"s"} ago`;const t=Math.floor(a/60);if(t<60)return`Saved ${t} minute${1===t?"":"s"} ago`;const o=Math.floor(t/60);return`Saved ${o} hour${1===o?"":"s"} ago`},saved:"All changes saved",saving:"Saving",pending:"Changes not saved yet — saving in a moment",failedIn:({seconds:e})=>`Not saved — trying again in ${e} s`,failedSoon:"Not saved — trying again soon",offline:"You’re offline — we’ll save when you’re back",pausedHeld:"Auto-save is off — changes not saved",paused:"Auto-save is off",locked:({editing:e})=>`Not saving — ${e}`,blockedOffline:"You’re offline. Try again when you’re back online.",blockedFailed:"Your last changes are not saved yet. Try again when they are.",blockedConflict:"Your last save was refused. See the notice below."},n={blockCount:({count:e})=>`${e} ${1===e?"block":"blocks"}`,loading:"Loading",waitingForAuthorization:"Waiting for editor authorization",missingTemplatePage:"Couldn’t open a page in this template.",missingPage:({slug:e})=>`No page with slug "${e}".`,missingDocument:"Couldn’t open this document.",loadFailed:({cause:e})=>`Could not load the document — ${e}`,noun:"page",pageStyles:"This page",header:"Header",footer:"Footer",pageSections:"Page",templateSections:"Template",addSection:"Add section",addSectionHere:"Add section here",done:"Done",copied:({name:e})=>`Copied ${e}`,pasteRefused:({name:e})=>`${e} can’t be pasted here.`,add:e,shared:t,canvasAddBlock:"Add block",canvasReplaceImage:"Replace image",railMedia:"Media library",leftPanel:"Left panel",resizeLeftPanel:"Resize left panel",leave:{title:"Unsaved changes",body:"Your most recent edits haven’t finished saving yet. Save them before switching, or leave and discard them.",cancel:"Cancel",discard:"Discard & leave",save:"Save & leave",saving:"Saving"},bar:{undo:"Undo",redo:"Redo",refresh:"Reload the preview",refreshTip:"Reload the preview (keeps your place)",notSaving:"Not saving — see the notice below",retry:"Retry now",autoSaveOff:"Auto-save is off — click to turn it back on (saves your held edits)",autoSaveOn:"Auto-save is on — click to pause it",views:"Left panel views",saveOptions:"Save options",autoSave:"Auto-save",saveNow:"Save now"},saveStatus:o,menu:{undo:"Undo",redo:"Redo",collapseAll:"Collapse all layers",selectAll:"Select all",pinned:"Pinned — can’t be moved or deleted",clipboardRefused:"Your browser won’t let us read the clipboard — press ⌘V",itemAddAfter:"Add item after",itemMoveEarlier:"Move item earlier",itemMoveLater:"Move item later",itemDelete:"Delete item"},layers:"Layers",expandAll:"Expand all sections",collapseAll:"Collapse all sections",nothingToFold:"Nothing to fold on this page",rename:"Rename",deleteNamed:({name:e})=>`Delete ${e}`,hideNamed:({name:e})=>`Hide ${e}`,showNamed:({name:e})=>`Show ${e}`,addBlockHere:"Add block here",sectionFirst:({name:e})=>`“${e}” is already first`,sectionLast:({name:e})=>`“${e}” is already last`,sectionMoved:({name:e,n:a,total:t})=>`Moved “${e}” to position ${a} of ${t}`,sectionAdded:({name:e})=>`Added “${e}” section`,deleted:({name:e})=>`Deleted “${e}”`,resizeSettingsPanel:"Resize settings panel",sectionSettings:({name:e})=>`${e} settings`,headerSettings:"Header settings",addBlockMenu:"Add block",deviceNote:{tablet:"Tablet uses the desktop settings.",mobile:"Showing the phone settings for this section."}};export{e as DEFAULT_SCREEN_ADD_WORDS,o as DEFAULT_SCREEN_SAVE_STATUS_WORDS,t as DEFAULT_SCREEN_SHARED_WORDS,n as DEFAULT_SCREEN_WORDS};
|
|
1
|
+
var e={title:"Add",contextAll:"Sections and blocks",done:"Done",doneDescription:"Close Add and go back",templates:"Your templates",tile:({name:e})=>`Add ${e}`,hint:"Drag onto the page.",search:"Search",onlySections:"Only sections go here",notInside:({name:e})=>`Cannot go inside ${e}`,addingTo:({name:e})=>`Adding to ${e}`,addingBefore:({name:e})=>`Adding before ${e}`,addingAtEnd:"Adding at the end of the page",addingHere:"Adding here"},a=e=>1===e?"1 page":`${e} pages`,t={group:"Shared sections",onPages:({count:e})=>`On ${a(e)}`,makeShared:"Make shared",makeSharedHint:"Use this section on other pages from Add. Change it once, and every page changes.",name:"Name",cancel:"Cancel",makeFailed:"Could not make it shared. Try again.",detach:"Detach from shared",removeFromPage:"Remove from this page",removed:({count:e})=>e>0?`Removed from this page · still on ${a(e)}`:"Removed from this page",deleteShared:"Delete shared section",deleteTitle:({name:e})=>`Delete “${e}”?`,deleteMessage:({count:e})=>0===e?"No page uses it. Nothing on the website changes.":1===e?"The page that uses it keeps its own copy. Nothing disappears from the website.":`The ${e} pages that use it each keep their own copy. Nothing disappears from the website.`,deleteFailed:"Could not delete it. Try again.",alreadyHere:"Already on this page"};var o={savedAgo:function({seconds:e}){const a=Math.max(0,Math.floor(e));if(a<1)return"Saved just now";if(a<60)return`Saved ${a} second${1===a?"":"s"} ago`;const t=Math.floor(a/60);if(t<60)return`Saved ${t} minute${1===t?"":"s"} ago`;const o=Math.floor(t/60);return`Saved ${o} hour${1===o?"":"s"} ago`},saved:"All changes saved",saving:"Saving",pending:"Changes not saved yet — saving in a moment",failedIn:({seconds:e})=>`Not saved — trying again in ${e} s`,failedSoon:"Not saved — trying again soon",offline:"You’re offline — we’ll save when you’re back",pausedHeld:"Auto-save is off — changes not saved",paused:"Auto-save is off",locked:({editing:e})=>`Not saving — ${e}`,blockedOffline:"You’re offline. Try again when you’re back online.",blockedFailed:"Your last changes are not saved yet. Try again when they are.",blockedConflict:"Your last save was refused. See the notice below."},n={blockCount:({count:e})=>`${e} ${1===e?"block":"blocks"}`,loading:"Loading",waitingForAuthorization:"Waiting for editor authorization",missingTemplatePage:"Couldn’t open a page in this template.",missingPage:({slug:e})=>`No page with slug "${e}".`,missingDocument:"Couldn’t open this document.",loadFailed:({cause:e})=>`Could not load the document — ${e}`,noun:"page",pageStyles:"This page",header:"Header",footer:"Footer",pageSections:"Page",templateSections:"Template",addSection:"Add section",addSectionHere:"Add section here",done:"Done",copied:({name:e})=>`Copied ${e}`,pasteRefused:({name:e})=>`${e} can’t be pasted here.`,add:e,shared:t,canvasAddBlock:"Add block",canvasReplaceImage:"Replace image",railMedia:"Media library",leftPanel:"Left panel",resizeLeftPanel:"Resize left panel",leave:{title:"Unsaved changes",body:"Your most recent edits haven’t finished saving yet. Save them before switching, or leave and discard them.",cancel:"Cancel",discard:"Discard & leave",save:"Save & leave",saving:"Saving"},bar:{undo:"Undo",redo:"Redo",refresh:"Reload the preview",refreshTip:"Reload the preview (keeps your place)",notSaving:"Not saving — see the notice below",retry:"Retry now",autoSaveOff:"Auto-save is off — click to turn it back on (saves your held edits)",autoSaveOn:"Auto-save is on — click to pause it",views:"Left panel views",saveOptions:"Save options",autoSave:"Auto-save",saveNow:"Save now"},saveStatus:o,menu:{undo:"Undo",redo:"Redo",collapseAll:"Collapse all layers",selectAll:"Select all",pinned:"Pinned — can’t be moved or deleted",clipboardRefused:"Your browser won’t let us read the clipboard — press ⌘V",itemAddAfter:"Add item after",itemMoveEarlier:"Move item earlier",itemMoveLater:"Move item later",itemDelete:"Delete item"},layers:"Layers",expandAll:"Expand all sections",collapseAll:"Collapse all sections",nothingToFold:"Nothing to fold on this page",rename:"Rename",deleteNamed:({name:e})=>`Delete ${e}`,hideNamed:({name:e})=>`Hide ${e}`,showNamed:({name:e})=>`Show ${e}`,addBlockHere:"Add block here",sectionFirst:({name:e})=>`“${e}” is already first`,sectionLast:({name:e})=>`“${e}” is already last`,sectionMoved:({name:e,n:a,total:t})=>`Moved “${e}” to position ${a} of ${t}`,sectionAdded:({name:e})=>`Added “${e}” section`,deleted:({name:e})=>`Deleted “${e}”`,resizeSettingsPanel:"Resize settings panel",sectionSettings:({name:e})=>`${e} settings`,headerSettings:"Header settings",addBlockMenu:"Add block",deviceNote:{tablet:"Tablet uses the desktop settings.",mobile:"Showing the phone settings for this section."}},s={focus:"Image focus",onDesktop:e=>`${e} on desktop`,pasteLink:"or paste an image URL",pasteName:"Image URL",template:"Templates don’t store images. This slot stays a placeholder. Each website picks its own after it’s created.",templateVideo:"Templates don’t store videos. This slot stays a placeholder. Each website picks its own after it’s created."};export{s as DEFAULT_IMAGE_ROW_WORDS,e as DEFAULT_SCREEN_ADD_WORDS,o as DEFAULT_SCREEN_SAVE_STATUS_WORDS,t as DEFAULT_SCREEN_SHARED_WORDS,n as DEFAULT_SCREEN_WORDS};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ScreenPartsProvider as t}from"./chunk-
|
|
1
|
+
import{ScreenPartsProvider as t}from"./chunk-LSGKADNV.js";import{useEaselHost as e}from"./chunk-LX23TCTP.js";import{createEasel as r,EaselProvider as o}from"./chunk-BBD3FLU3.js";import{useState as n,useEffect as s}from"react";import{jsx as a}from"react/jsx-runtime";function i({config:i,data:c,onChange:m,permissions:p,parts:f,children:u}){const[d]=n(()=>r({config:i,data:c,permissions:p}));s(()=>{d.setConfig(i)},[d,i]),s(()=>{if(!m)return;let t=d.getState().appState.data,e=!1;return d.subscribe(()=>{const r=d.getState().appState.data;r!==t&&(t=r,(e||r!==d.loaded)&&(e=!0,m(r)))})},[d,m]),s(()=>{p&&d.setPermissions(p)},[d,p]);const h=e();/* @__PURE__ */
|
|
2
2
|
return a(o,{easel:d,hotkeys:h.ownsDocument,children:/* @__PURE__ */a(t,{parts:f,children:u})})}export{i as ScreenStoreProvider};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import{fieldIsShown as e,shownFields as n}from"./chunk-BPXEFVSQ.js";import{noControlMetaOf as t,deviceMetaOf as l}from"./chunk-YCSZAP7T.js";import{TreeSeam as r}from"./chunk-WHS6Y55E.js";import{SETTINGS_BUCKETS as o,SettingsGroup as a}from"./chunk-FM6JO4WF.js";import{DEFAULT_TREE_WORDS as i}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-
|
|
1
|
+
import{fieldIsShown as e,shownFields as n}from"./chunk-BPXEFVSQ.js";import{noControlMetaOf as t,deviceMetaOf as l}from"./chunk-YCSZAP7T.js";import{TreeSeam as r}from"./chunk-WHS6Y55E.js";import{SETTINGS_BUCKETS as o,SettingsGroup as a}from"./chunk-FM6JO4WF.js";import{DEFAULT_TREE_WORDS as i}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-56ID6FKZ.js";import{easelMenuEntries as c}from"./chunk-FIVU2COQ.js";import{FieldNumber as d}from"./chunk-Y2T3JX7K.js";import{FieldSelect as u}from"./chunk-KFWNGPW3.js";import{SettingsField as m}from"./chunk-MIX7EGRG.js";import{SettingsSegmented as h}from"./chunk-DX3VILZ3.js";import{DEFAULT_FIELDS_WORDS as p}from"./chunk-JACEEVVF.js";import{useWords as f}from"./chunk-MFIRYGHW.js";import{useTreeDrag as b,gapToMoveIndex as g}from"./chunk-3XECMGXX.js";import{withTip as v}from"./chunk-P2VEMZH5.js";import{clone as y}from"./chunk-EUFDQ4KL.js";import{Textarea as k,Input as x,ItemCount as w,SortableList as C,ListRow as O,IconButton as N,ContextMenu as j,tabPanelId as $,Tabs as I,tabButtonId as D}from"efficient-shell/ui";export{LinkPicker}from"efficient-shell/ui";import{useRef as S,useState as F,useLayoutEffect as P,useId as L}from"react";import{jsx as E,jsxs as M,Fragment as T}from"react/jsx-runtime";import{LockIcon as W,CloseIcon as z,MoveUpIcon as R,MoveDownIcon as A,DuplicateIcon as K,TrashIcon as X}from"efficient-shell/icons/efficient";function H({id:e,value:n,onChange:t,placeholder:l,multiline:r=!1,rows:o=3,readOnly:a=!1,ariaLabel:i,ariaLabelledBy:s}){const c=n??"";return r?/* @__PURE__ */E(k,{id:e,size:"sm",className:"es-fin",value:c,rows:o,placeholder:l,readOnly:a,"aria-label":i,"aria-labelledby":s,onChange:e=>t(e.target.value)}):/* @__PURE__ */E(x,{id:e,size:"md",className:"es-fin",type:"text",value:c,placeholder:l,readOnly:a,"aria-label":i,"aria-labelledby":s,onChange:e=>t(e.target.value)})}function V(e,n,t){const l=e.slice();return l.splice(Math.max(0,Math.min(n,l.length)),0,t),l}function Y(e,n,t){const l=e.slice(),[r]=l.splice(n,1);return l.splice(Math.max(0,Math.min(t,l.length)),0,r),l}function Z(e,n){return e.filter((e,t)=>t!==n)}var B='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',G={parentId:"list",slot:"items"};function Q({label:e,icon:n,noun:t,items:l,onChange:o,newItem:a,summary:s,itemName:d,thumb:u,min:m=0,max:h,readOnly:k=!1,open:x,onOpen:$,renderItem:I,renderRow:D,canRemove:L,lockedReason:H,fixed:Q=!1,removeOnRow:J=!0,canDuplicate:U,above:q,head:_=!0}){const ee=f("fields",p).list,ne=f("tree",i),te=t??ee.item,le=!k&&!Q&&("number"!=typeof h||l.length<h),re=l.length<=m,oe=e=>!!L&&!L(l[e],e),ae=e=>!k&&!Q&&J&&!re&&!oe(e),ie=e=>le&&(!U||U(l[e],e)),se=(e,n)=>d?d(e,n):ee.itemName({noun:te,n:n+1}),ce=S([]),de=S(null),[ue,me]=F(null),he=S(null),[pe,fe]=F(null),[be,ge]=F("");P(()=>{const e=de.current;if(!e)return;de.current=null;const n=ce.current[e.index]?.querySelectorAll(B)[e.nth]??ce.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const ve=(e,n)=>{if(n<0||n>=l.length||n===e)return;const t=ce.current[e],r=t?.ownerDocument.activeElement;if(t&&r&&t.contains(r)){const e=[...t.querySelectorAll(B)].indexOf(r),l=r;de.current={index:n,nth:e,start:"number"==typeof l.selectionStart?l.selectionStart:null,end:"number"==typeof l.selectionEnd?l.selectionEnd:null}}o(Y(l,e,n));const a=function(e,n,t){return null===e?null:e===n?t:n<e&&t>=e?e-1:n>e&&t<=e?e+1:e}(x,e,n);a!==x&&$(a),ge(ee.moved({n:n+1,total:l.length}))},ye=e=>{le&&(o(V(l,e,a())),D?(de.current={index:e,nth:0,start:null,end:null},null!==x&&x>=e&&$(x+1)):$(e))},ke=e=>{ae(e)&&(o(Z(l,e)),x===e?$(null):null!==x&&x>e&&$(x-1))},xe=b({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===G.parentId&&n.slot===G.slot,onDrop:(e,n)=>{const t=g({...G,index:e},n);t!==e&&ve(e,t)},onStep:(e,n)=>ve(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<l.length,readOnly:k}),we=e=>{const n=[];return e>0&&n.push({label:ee.moveUp,icon:/* @__PURE__ */E(R,{size:14}),shortcut:"⌥↑",onClick:()=>ve(e,e-1)}),e<l.length-1&&n.push({label:ee.moveDown,icon:/* @__PURE__ */E(A,{size:14}),shortcut:"⌥↓",onClick:()=>ve(e,e+1)}),ie(e)&&n.push({label:ee.duplicate,icon:/* @__PURE__ */E(K,{size:14}),onClick:()=>(e=>{ie(e)&&(o(V(l,e+1,y(l[e]))),null!==x&&x>e&&$(x+1))})(e)}),ae(e)&&n.push({label:ee.delete,icon:/* @__PURE__ */E(X,{size:14}),danger:!0,onClick:()=>ke(e)}),n},Ce=(e,n,t,l)=>{k||0===we(e).length||fe({index:e,x:n,y:t,owner:l})},Oe=e=>n=>{const t=l.slice();t[e]=n,o(t)};/* @__PURE__ */
|
|
2
2
|
return M("div",{className:"es-list",children:[_?/* @__PURE__ */M("div",{className:"es-list-head",children:[
|
|
3
3
|
/* @__PURE__ */M("span",{className:"es-list-label",children:[n?/* @__PURE__ */E("span",{className:"es-field-icon","aria-hidden":"true",children:n}):null,e]}),
|
|
4
|
-
/* @__PURE__ */E(w,{count:l.length,label:ee.count({noun:te,n:l.length}),showZero:!0})]}):null,q?/* @__PURE__ */E("div",{className:"es-list-above",children:q}):null,l.length?/* @__PURE__ */M(C,{"aria-label":e,spacing:"comfortable",className:"es-list-rows",rootProps:xe.rootProps(),children:[l.map((e,n)=>{const t=xe.row({item:n,place:{...
|
|
4
|
+
/* @__PURE__ */E(w,{count:l.length,label:ee.count({noun:te,n:l.length}),showZero:!0})]}):null,q?/* @__PURE__ */E("div",{className:"es-list-above",children:q}):null,l.length?/* @__PURE__ */M(C,{"aria-label":e,spacing:"comfortable",className:"es-list-rows",rootProps:xe.rootProps(),children:[l.map((e,n)=>{const t=xe.row({item:n,place:{...G,index:n}}),l=t.draggable&&ue!==n,o=!D&&x===n,a=!k&&!Q&&J&&oe(n),i=["es-list-row",D?"is-inline":"is-item",o?"is-open":"",l?"is-draggable":"",t.dragging?"is-dragging":"",t.drop?`is-drop-${t.drop}`:""].filter(Boolean).join(" ");return[n>0?/* @__PURE__ */E(r,{...xe.seam({place:{...G,index:n}}),onAdd:le?()=>ye(n):void 0,label:ee.addHere({noun:te})},`seam-${n}`):null,
|
|
5
5
|
/* @__PURE__ */E(O,{className:i,flat:!!D,active:o,title:D?void 0:/* @__PURE__ */M(T,{children:[
|
|
6
|
-
/* @__PURE__ */E("span",{className:"es-list-row-name",children:se(e,n)}),s?/* @__PURE__ */E("span",{className:"es-list-row-summary",children:s(e,n)}):null]}),thumb:!D&&u?u(e,n):void 0,expanded:D?void 0:o,onToggle:D?void 0:()=>$(o?null:n),draggable:t.draggable,dragHint:ne.dragHint,dragging:t.dragging,drop:"before"===t.drop||"after"===t.drop?t.drop:void 0,onMove:t.draggable?e=>ve(n,"up"===e?n-1:n+1):void 0,rowRef:e=>{ce.current[n]=e},rowProps:{...t.rowProps,draggable:l||void 0,onPointerDown:e=>{const l=e.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'),r=!!l&&l===l.ownerDocument.activeElement;e.currentTarget.draggable=t.draggable&&!r,he.current=l&&!r?l:null,me(r?n:null)},onDragStart:e=>{const n=he.current;he.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),t.rowProps.onDragStart?.(e)},onContextMenu:e=>{k||(e.preventDefault(),e.stopPropagation(),Ce(n,e.clientX,e.clientY,e.currentTarget))},onKeyDown:e=>{if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){e.preventDefault();const t=e.currentTarget.ownerDocument,l=e=>e.preventDefault();t.addEventListener("contextmenu",l,{capture:!0,once:!0}),t.defaultView?.setTimeout(()=>t.removeEventListener("contextmenu",l,{capture:!0}),500);const r=e.currentTarget.getBoundingClientRect();return void Ce(n,r.left+24,r.bottom,e.currentTarget)}t.rowProps.onKeyDown?.(e)}},actions:k||J
|
|
7
|
-
/* @__PURE__ */E(r,{...xe.seam({place:{...
|
|
6
|
+
/* @__PURE__ */E("span",{className:"es-list-row-name",children:se(e,n)}),s?/* @__PURE__ */E("span",{className:"es-list-row-summary",children:s(e,n)}):null]}),thumb:!D&&u?u(e,n):void 0,expanded:D?void 0:o,onToggle:D?void 0:()=>$(o?null:n),draggable:t.draggable,dragHint:ne.dragHint,dragging:t.dragging,drop:"before"===t.drop||"after"===t.drop?t.drop:void 0,onMove:t.draggable?e=>ve(n,"up"===e?n-1:n+1):void 0,rowRef:e=>{ce.current[n]=e},rowProps:{...t.rowProps,draggable:l||void 0,onPointerDown:e=>{const l=e.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'),r=!!l&&l===l.ownerDocument.activeElement;e.currentTarget.draggable=t.draggable&&!r,he.current=l&&!r?l:null,me(r?n:null)},onDragStart:e=>{const n=he.current;he.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),t.rowProps.onDragStart?.(e)},onContextMenu:e=>{k||(e.preventDefault(),e.stopPropagation(),Ce(n,e.clientX,e.clientY,e.currentTarget))},onKeyDown:e=>{if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){e.preventDefault();const t=e.currentTarget.ownerDocument,l=e=>e.preventDefault();t.addEventListener("contextmenu",l,{capture:!0,once:!0}),t.defaultView?.setTimeout(()=>t.removeEventListener("contextmenu",l,{capture:!0}),500);const r=e.currentTarget.getBoundingClientRect();return void Ce(n,r.left+24,r.bottom,e.currentTarget)}t.rowProps.onKeyDown?.(e)}},actions:k||Q||!J?void 0:a?v(H?H(e,n):ee.locked,/* @__PURE__ */E("span",{className:"es-list-lock",role:"img","aria-label":H?H(e,n):ee.locked,children:/* @__PURE__ */E(W,{size:13})})):v(ee.deleteItem({noun:te}),/* @__PURE__ */E(N,{size:"sm",className:"es-list-x","aria-label":ee.deleteItem({noun:te}),disabled:!ae(n),onClick:()=>ke(n),children:/* @__PURE__ */E(z,{size:14,"aria-hidden":"true"})})),below:o?/* @__PURE__ */E("div",{className:"es-list-item",children:I(e,n,Oe(n))}):void 0,children:D?/* @__PURE__ */E("div",{className:"es-list-row-main",children:D(e,n,Oe(n))}):null},n)]}),
|
|
7
|
+
/* @__PURE__ */E(r,{...xe.seam({place:{...G,index:l.length}})})]}):null,k||Q?null:/* @__PURE__ */E("button",{type:"button",className:"es-list-add",disabled:!le,onClick:()=>ye(l.length),children:ee.add({noun:te})}),
|
|
8
8
|
/* @__PURE__ */E("span",{className:"es-list-said","aria-live":"polite",children:be}),pe&&pe.index<l.length?
|
|
9
|
-
/* @__PURE__ */E(j,{at:{x:pe.x,y:pe.y},owner:pe.owner,onClose:()=>fe(null),items:c(we(pe.index))}):null]})}var
|
|
10
|
-
return E(a,{id:`${l}-group`,title:U(e,t),open:m,onToggle:h,level:u,children:Object.entries(n(e.objectFields,{values:p,context:c})).map(([e,n])=>/* @__PURE__ */E(ee,{field:n,name:`${t}.${e}`,id:`${l}-${e}`,value:p[e],onChange:n=>o({...p,[e]:n}),readOnly:i,context:s,showWhenContext:c,renderers:d,headingLevel:
|
|
11
|
-
return E(
|
|
12
|
-
return E(m,{label:U(n,t),htmlFor:l,icon:n.icon,hint:n.hint,children:/* @__PURE__ */E(
|
|
9
|
+
/* @__PURE__ */E(j,{at:{x:pe.x,y:pe.y},owner:pe.owner,onClose:()=>fe(null),items:c(we(pe.index))}):null]})}var J=e=>e<6?e+1:6,U=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function q({field:e,name:t,id:l,value:r,onChange:o,readOnly:i,context:s,showWhenContext:c,renderers:d,headingLevel:u=3}){const[m,h]=F(!0),p=r&&"object"==typeof r?r:{};/* @__PURE__ */
|
|
10
|
+
return E(a,{id:`${l}-group`,title:U(e,t),open:m,onToggle:h,level:u,children:Object.entries(n(e.objectFields,{values:p,context:c})).map(([e,n])=>/* @__PURE__ */E(ee,{field:n,name:`${t}.${e}`,id:`${l}-${e}`,value:p[e],onChange:n=>o({...p,[e]:n}),readOnly:i,context:s,showWhenContext:c,renderers:d,headingLevel:J(u)},e))})}function _({field:e,name:t,id:l,value:r,onChange:o,readOnly:a,context:i,showWhenContext:s,renderers:c,openItem:d,onOpenItem:u,headingLevel:m}){const[h,p]=F(null),f=u?d??null:h,b=u??p,g=Array.isArray(r)?r:[],v=e.getItemSummary;/* @__PURE__ */
|
|
11
|
+
return E(Q,{label:U(e,t),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:g,onChange:o,newItem:()=>y({...e.defaultItemProps??{}}),summary:v?(e,n)=>v(e,n):void 0,min:e.min,max:e.max,readOnly:a,open:f,onOpen:b,renderItem:(r,o,d)=>Object.entries(n(e.arrayFields,{values:r,context:s})).map(([e,n])=>/* @__PURE__ */E(ee,{field:n,name:`${t}[${o}].${e}`,id:`${l}-${o}-${e}`,value:r?.[e],onChange:n=>d({...r,[e]:n}),readOnly:a,context:i,showWhenContext:s,renderers:c,headingLevel:m},e))})}function ee(e){const{field:n,name:t,id:l,value:r,onChange:o,readOnly:a,context:i,renderers:s}=e;if(!n||n.marker||!1===n.visible)return null;const c=s?.[n.type];if(c)return c({field:n,name:t,id:l,value:r,onChange:o,readOnly:a});switch(n.type){case"custom":{const e={...i,field:n,name:t,id:l,value:r,onChange:o,readOnly:a};return n.render(e)}case"text":case"textarea":/* @__PURE__ */
|
|
12
|
+
return E(m,{label:U(n,t),htmlFor:l,icon:n.icon,hint:n.hint,children:/* @__PURE__ */E(H,{id:l,value:"string"==typeof r?r:null==r?"":String(r),onChange:o,placeholder:n.placeholder,multiline:"textarea"===n.type,readOnly:a})});case"number":/* @__PURE__ */
|
|
13
13
|
return E(m,{label:U(n,t),htmlFor:l,icon:n.icon,hint:n.hint,children:/* @__PURE__ */E(d,{id:l,value:"number"==typeof r?r:void 0,onChange:o,min:n.min,max:n.max,step:n.step,placeholder:n.placeholder,readOnly:a})});case"select":{const e=`${l}-label`;/* @__PURE__ */
|
|
14
14
|
return E(m,{label:U(n,t),labelId:e,htmlFor:l,icon:n.icon,hint:n.hint,children:/* @__PURE__ */E(u,{id:l,value:r,options:n.options,onChange:o,readOnly:a,ariaLabelledBy:e})})}case"radio":/* @__PURE__ */
|
|
15
15
|
return E(m,{label:U(n,t),icon:n.icon,hint:n.hint,children:/* @__PURE__ */E(h,{ariaLabel:U(n,t),value:r,options:n.options.map(e=>({id:e.value,label:e.label,icon:e.icon,disabled:e.disabled||a})),onChange:e=>{a||o(e)}})});case"object":/* @__PURE__ */
|
|
16
16
|
return E(q,{...e,field:n});case"array":/* @__PURE__ */
|
|
17
|
-
return E(_,{...e,field:n});case"slot":return null}}function ne(e,n){if("mobile"!==n)return!0;const r=e;if(!r||r.marker||"slot"===r.type||"always"===t(e))return!0;const o=l(e)?.tier;return"mobile"===o||"each"===o}var te={},le=e=>o.includes(e);function re(n,t){let l,r=o[0];const a=[],i=/* @__PURE__ */new Set;for(const[o,s]of Object.entries(n))s&&(le(s.bucket)&&((s.marker||s.bucket!==r)&&(l=void 0),r=s.bucket),s.marker&&"string"==typeof s.fold?l={key:o,title:s.fold}:s.marker&&!1===s.fold&&(l=void 0),s.marker||!1===s.visible||t&&!e(s,t)||t&&!ne(s,t.context?.device)||(a.push(l?{name:o,field:s,bucket:r,fold:l}:{name:o,field:s,bucket:r}),"slot"!==s.type&&i.add(r)));return{rows:a,buckets:o.filter(e=>i.has(e))}}function oe(e){return new Map(re(e).rows.map(e=>[e.name,e.bucket]))}function ae(e){const n=[];for(const t of e){const e=n[n.length-1];e&&e.fold?.key===t.fold?.key?e.rows.push(t):n.push({fold:t.fold,rows:[t]})}return n}function ie({fields:e,values:n,onChange:t,readOnly:l=!1,context:r,showWhenContext:o,tab:i,onTab:c,tabs:d=!0,tabIcons:u,renderers:m,idPrefix:h,ariaLabel:p,lead:b,children:g,leadFold:v,closedFolds:y,onFold:k,headingLevel:x=3}){const w=f("panel",s),C=L(),O=h??`es-insp${C.replace(/:/g,"")}`,N=re(e,{values:n,context:o}),[j,S]=F(void 0),P=i??j,T=P&&N.buckets.includes(P)?P:N.buckets[0],[W,z]=F(null),R=W&&W.panel===O&&N.rows.some(e=>e.name===W.name)?W:null,A=d&&N.buckets.length>1,K=A&&T?$(O,T):`${O}-rows`,[
|
|
17
|
+
return E(_,{...e,field:n});case"slot":return null}}function ne(e,n){if("mobile"!==n)return!0;const r=e;if(!r||r.marker||"slot"===r.type||"always"===t(e))return!0;const o=l(e)?.tier;return"mobile"===o||"each"===o}var te={},le=e=>o.includes(e);function re(n,t){let l,r=o[0];const a=[],i=/* @__PURE__ */new Set;for(const[o,s]of Object.entries(n))s&&(le(s.bucket)&&((s.marker||s.bucket!==r)&&(l=void 0),r=s.bucket),s.marker&&"string"==typeof s.fold?l={key:o,title:s.fold}:s.marker&&!1===s.fold&&(l=void 0),s.marker||!1===s.visible||t&&!e(s,t)||t&&!ne(s,t.context?.device)||(a.push(l?{name:o,field:s,bucket:r,fold:l}:{name:o,field:s,bucket:r}),"slot"!==s.type&&i.add(r)));return{rows:a,buckets:o.filter(e=>i.has(e))}}function oe(e){return new Map(re(e).rows.map(e=>[e.name,e.bucket]))}function ae(e){const n=[];for(const t of e){const e=n[n.length-1];e&&e.fold?.key===t.fold?.key?e.rows.push(t):n.push({fold:t.fold,rows:[t]})}return n}function ie({fields:e,values:n,onChange:t,readOnly:l=!1,context:r,showWhenContext:o,tab:i,onTab:c,tabs:d=!0,tabIcons:u,renderers:m,idPrefix:h,ariaLabel:p,lead:b,children:g,leadFold:v,closedFolds:y,onFold:k,headingLevel:x=3}){const w=f("panel",s),C=L(),O=h??`es-insp${C.replace(/:/g,"")}`,N=re(e,{values:n,context:o}),[j,S]=F(void 0),P=i??j,T=P&&N.buckets.includes(P)?P:N.buckets[0],[W,z]=F(null),R=W&&W.panel===O&&N.rows.some(e=>e.name===W.name)?W:null,A=d&&N.buckets.length>1,K=A&&T?$(O,T):`${O}-rows`,[X,H]=F(()=>/* @__PURE__ */new Set),V=y??X,Y=(e,n)=>{/* @__PURE__ */return E(a,{title:e.title,open:!V.has(e.key),onToggle:n=>((e,n)=>{void 0===y&&H(t=>{const l=new Set(t);return n?l.delete(e):l.add(e),l}),k?.(e,n)})(e.key,n),id:`${O}-fold-${t=e.key,[...t].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join("")}`,level:x,children:n});var t},Z=e=>A&&e!==T,B=({name:e,field:a,bucket:i,fold:s})=>/* @__PURE__ */E("div",{className:"es-insp-row","data-field":e,"data-bucket":i,hidden:!!Z(i)||void 0,children:/* @__PURE__ */E(ee,{field:a,name:e,id:`${O}-${e}`,value:n[e],onChange:n=>t(e,n),readOnly:l,context:r,showWhenContext:o,renderers:m,openItem:R&&R.name===e?R.index:null,onOpenItem:n=>z(null===n?null:{panel:O,name:e,index:n}),headingLevel:s?J(x):x})},e);/* @__PURE__ */
|
|
18
18
|
return M("div",{className:"es-insp",children:[A?/* @__PURE__ */E("div",{className:"es-insp-tabs",children:/* @__PURE__ */E(I,{variant:"underline",block:!0,"aria-label":p??w.settings,idPrefix:O,value:T,onChange:e=>{const n=e;void 0===i&&S(n),c?.(n)},items:N.buckets.map(e=>{const n=w.buckets[e],t=u?.[e];return t?{id:e,icon:t,label:/* @__PURE__ */E("span",{className:"sr-only",children:n}),tooltip:n}:{id:e,label:n}})})}):null,
|
|
19
|
-
/* @__PURE__ */M("div",{className:"es-insp-rows",id:K,role:A?"tabpanel":void 0,"aria-labelledby":A&&T?D(O,T):void 0,children:[b&&ne(te,o?.device)?v?/* @__PURE__ */E("div",{className:"es-insp-band","data-fold":v.key,children:Y(v,b)}):b:null,ae(N.rows).map((e,n)=>{if(!e.fold)return e.rows.map(
|
|
20
|
-
return E("div",{className:"es-insp-band","data-fold":e.fold.key,"data-bucket":t,hidden:!(!
|
|
19
|
+
/* @__PURE__ */M("div",{className:"es-insp-rows",id:K,role:A?"tabpanel":void 0,"aria-labelledby":A&&T?D(O,T):void 0,children:[b&&ne(te,o?.device)?v?/* @__PURE__ */E("div",{className:"es-insp-band","data-fold":v.key,children:Y(v,b)}):b:null,ae(N.rows).map((e,n)=>{if(!e.fold)return e.rows.map(B);const t=e.rows[0].bucket,l=e.rows.every(e=>"slot"===e.field.type);/* @__PURE__ */
|
|
20
|
+
return E("div",{className:"es-insp-band","data-fold":e.fold.key,"data-bucket":t,hidden:!(!Z(t)&&!l)||void 0,children:Y(e.fold,e.rows.map(B))},`fold-${e.fold.key}-${n}`)}),g]})]})}export{H as FieldText,ie as Inspector,ee as InspectorField,Q as ListField,oe as bucketsOf,ne as fieldShownInView,V as insertAt,U as labelOf,Y as moveTo,re as planFields,Z as removeAt};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEaselSession as e}from"./chunk-YM4UEGBV.js";import{useHostEscape as n}from"./chunk-LX23TCTP.js";import{DEFAULT_SCREEN_WORDS as t}from"./chunk-
|
|
1
|
+
import{useEaselSession as e}from"./chunk-YM4UEGBV.js";import{useHostEscape as n}from"./chunk-LX23TCTP.js";import{DEFAULT_SCREEN_WORDS as t}from"./chunk-Q3VAJMXS.js";import{styleMenuItems as o}from"./chunk-CWELHADJ.js";import{ROOT_ZONE as l}from"./chunk-TCAAOYQY.js";import{repeatCopyAt as r}from"./chunk-JQQFB7EZ.js";import{easelMenuEntries as i,menuLabel as c}from"./chunk-FIVU2COQ.js";import{createNodeClipboard as s,nodeMenuItems as a}from"./chunk-P5VYGWYO.js";import{DEFAULT_NODE_MENU_WORDS as u}from"./chunk-WK3AFPXY.js";import{useCanvasEvent as d}from"./chunk-TOKMFZPB.js";import{isTypingTarget as p,framePointToHost as f}from"./chunk-FR7EEKFF.js";import{zoneKey as m,ROOT_SLOT as y,ROOT_ID as h}from"./chunk-EUFDQ4KL.js";import{useState as k,useCallback as b,useRef as v,useEffect as x}from"react";import{ContextMenu as g}from"efficient-shell/ui";import{TrashIcon as w,AddIcon as C,MoveUpIcon as O,MoveDownIcon as z,UndoIcon as A,RedoIcon as P,PasteIcon as E,StylesIcon as j,LayersIcon as M,CopyIcon as D}from"efficient-shell/icons/efficient";import{jsx as K}from"react/jsx-runtime";function T(e,n){const t=[],o=/* @__PURE__ */new Set;let r={zone:n.zone,index:n.index};for(;r;){const n=e.nodeAt(r.zone,r.index);if(!n||o.has(n.props.id))break;if(o.add(n.props.id),t.push({zone:r.zone,index:r.index,node:n,parentType:null}),r.zone===l)break;const i=r.zone.lastIndexOf(":");if(i<=0)break;r=e.locate(r.zone.slice(0,i))}for(let e=0;e<t.length-1;e+=1)t[e].parentType=t[e+1].node.type;return t}var L=s(),I=/* @__PURE__ */new WeakMap;function S(e){if(e.claimsPage)return L;const n=e.registry;if(!n)return e.cache("easel:node-clipboard",s);let t=I.get(n);return t||(t=s(),I.set(n,t)),t}function Y(){return S(e())}function F(e,n,t){if(n===l){const{floor:n,cap:o}=e.sectionBand();return{parentId:h,slot:y,index:Math.min(Math.max(t,n),o)}}const o=n.lastIndexOf(":");return{parentId:n.slice(0,o),slot:n.slice(o+1),index:t}}function X(e,n,t){const o=e.isPinned(n,t),l=!o&&!e.isLocked(n)&&!e.duplicateBlocked(n),r=e.permits?.(n)??{duplicate:!0,delete:!0};return{copy:!o&&r.duplicate,cut:l&&r.duplicate&&r.delete,delete:l&&r.delete}}function B(e,n,t){const o=e.canPasteAt;if(!o)return m(n.from)===t.zone?F(e,t.zone,t.index+1):null;for(const l of T(e,t)){const t=F(e,l.zone,l.index+1);if(o(n,t))return t}return null}function R(e){if(e.defaultPrevented||e.altKey||e.shiftKey)return null;if(p(e.target))return null;const n=e.target,t=n&&"ownerDocument"in n?n.ownerDocument??n:null,o=t?.getSelection?.();if(o&&!o.isCollapsed&&o.toString().trim())return null;if(!e.metaKey&&!e.ctrlKey)return"Delete"===e.key?"delete":null;const l=e.code||(1===e.key.length?`Key${e.key.toUpperCase()}`:"");return"KeyC"===l?"copy":"KeyX"===l?"cut":"KeyV"===l?"paste":null}function V(e,n,t,o){const l=e.nodeAt(t.zone,t.index);if(!l)return null;const r=l.props.id,i=e.labelOf(l.type,t.zone),c=X(e,l,t.zone);if("copy"===n)return c.copy?(e.nodeOps.copy(r,i),{done:"copied",name:i}):null;if(o.readOnly)return null;if("cut"===n)return c.cut?(e.nodeOps.cut(r,i),{done:"cut",name:i}):null;if("delete"===n)return c.delete?(e.nodeOps.remove(r),{done:"deleted",name:i}):null;const s=o.held;if(!s)return null;const a=e.isPinned(l,t.zone)?null:B(e,s,t);return a?(e.nodeOps.paste(a),{done:"pasted",name:s.label}):(e.onPasteRefused(s),{done:"refused",name:s.label})}function Q(e,n){const{zone:t,index:r}=n,i=e.nodeAt(t,r);if(!i)return[];const c=i.props.id,s=e.labelOf(i.type,t),u=Boolean(i.props._hidden),d=e.nodeOps,p=e.isPinned(i,t),f=e.isLocked(i),m=!p&&!f&&!e.duplicateBlocked(i),y=e.permits?.(i)??{duplicate:!0,delete:!0},h=X(e,i,t),k=T(e,n),b=d.held,v=b&&!p?B(e,b,n):null,x=!e.readOnly,g=e.style?o({held:x?e.style.held():null,canCopy:e.style.canCopy(i,t),onCopy:()=>e.style?.copy(i,t),onPaste:()=>e.style?.paste(t,r,i),words:e.words?.styleClipboard}):[];return a({title:s,words:e.words?.menu,layer:{group:"pick",items:k.flatMap((n,t)=>{const o={label:e.rowNameOf(n.node,n.zone),checked:0===t,onClick:()=>e.selectAt(n.zone,n.index,n.node.props.id,n.parentType)},r=n.zone===l?null:e.slotRung?.(n.zone)??null;return r?[o,{label:r.label,checked:!1,onClick:r.select}]:[o]})},actions:{duplicate:x&&m&&y.duplicate?()=>d.duplicate(c):void 0,...W(x&&!p,e=>d.canStep(c,e),e=>d.step(c,e)),copy:h.copy?()=>d.copy(c,s):void 0,cut:x&&h.cut?()=>d.cut(c,s):void 0,paste:x&&b&&v?{label:b.label,run:()=>d.paste(v)}:void 0,rename:x&&e.renamePropOf(i,t)?()=>e.beginRename(t,r):void 0,hide:!x||f||p?void 0:{hidden:u,run:()=>d.setProps(c,{_hidden:!u})},delete:x&&m&&y.delete?()=>d.remove(c):void 0},style:g,extras:N(x?U(e,n.copy):null,e.menuRows?.(i,t,r)),pinnedLine:p?Z(e).pinned:void 0})}function U(e,n){const o=e.copyItem;if(!o||!n)return null;const l=Z(e),r=t.menu,i=e=>l[e]??r[e]??"",c={ownerId:n.ownerId,slot:n.slot,index:n.index,...n.outer?{outer:n.outer}:{}},s=e=>()=>o({...c,action:e});return{make:[{label:i("itemAddAfter"),icon:/* @__PURE__ */K(C,{}),onClick:s("addAfter")},{label:i("itemMoveEarlier"),icon:/* @__PURE__ */K(O,{}),onClick:s("moveEarlier"),disabled:n.index<=0},{label:i("itemMoveLater"),icon:/* @__PURE__ */K(z,{}),onClick:s("moveLater"),disabled:n.index>=n.count-1}],remove:[{label:i("itemDelete"),icon:/* @__PURE__ */K(w,{}),danger:!0,onClick:s("delete")}]}}function N(e,n){if(!e)return n??void 0;if(!n)return e;return Object.fromEntries(["pick","make","change","remove"].map(t=>[t,[...e[t]??[],...n[t]??[]]]).filter(([,e])=>e.length>0))}function W(e,n,t){return e?{moveUp:n(-1)?()=>t(-1):null,moveDown:n(1)?()=>t(1):null}:{}}var Z=e=>e.words?.screen??t.menu;function J(e){const n=Z(e),o=!e.readOnly,r=[];o&&e.history.hasPast&&r.push({label:n.undo,icon:/* @__PURE__ */K(A,{}),shortcut:"⌘Z",onClick:e.history.back}),o&&e.history.hasFuture&&r.push({label:n.redo,icon:/* @__PURE__ */K(P,{}),shortcut:"⇧⌘Z",onClick:e.history.forward});const i=[],c=e.nodeOps.held,s=F(e,l,e.sectionBand().cap);if(o&&c&&(e.canPasteAt?e.canPasteAt(c,s):m(c.from)===l)){const n=s,t=e.words?.menu??u;i.push({label:t.pasteNamed({paste:t.paste,label:c.label}),icon:/* @__PURE__ */K(E,{}),shortcut:"⌘V",onClick:()=>e.nodeOps.paste(n)})}const a=[r,i,[...e.openPageStyles?[{label:e.pageStylesLabel??t.pageStyles,icon:/* @__PURE__ */K(j,{}),onClick:e.openPageStyles}]:[],{label:n.collapseAll,icon:/* @__PURE__ */K(M,{}),onClick:e.collapseAll}]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return a.flatMap((e,n)=>n?[d,...e]:e)}function G(e,n){const t=n.selectionStart??0,o=n.selectionEnd??0,l=n.value.slice(t,o),r=e=>{n.focus(),n.setRangeText(e,t,o,"end"),n.dispatchEvent(new Event("input",{bubbles:!0}))},i=e.words?.menu??u,c=Z(e),s=[];l&&(s.push({label:i.copy,icon:/* @__PURE__ */K(D,{}),shortcut:"⌘C",onClick:()=>navigator.clipboard?.writeText(l)}),s.push({label:i.cut,icon:/* @__PURE__ */K(D,{}),shortcut:"⌘X",onClick:()=>{navigator.clipboard?.writeText(l),r("")}})),s.push({label:i.paste,icon:/* @__PURE__ */K(E,{}),shortcut:"⌘V",onClick:()=>{navigator.clipboard?.readText().then(e=>{e&&r(e)}).catch(()=>e.onPasteRefused())}});const a=[s,n.value?[{label:c.selectAll,shortcut:"⌘A",onClick:()=>{n.focus(),n.select()}}]:[]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return a.flatMap((e,n)=>n?[d,...e]:e)}function _(e){return e.shiftKey}function H(e,t){const[o,l]=k(null),i=b(()=>l(null),[]);n(null!==o,i);const c=v(e);c.current=e;const s=b(e=>{const n=c.current,t=n.keys;if(!t)return;const o=R(e);if(!o)return;const l=t.selected();if(!l)return;const r=V(n,o,l,{readOnly:t.readOnly,held:t.held()});r&&(e.preventDefault(),t.onDone?.(r))},[]),a=e.keys?.target??null;x(()=>{if(!a)return;const e=e=>s(e);return a.addEventListener("keydown",e),()=>a.removeEventListener("keydown",e)},[a,s]),d(t,"keydown",s);const u=b(n=>{if(_(n))return;const t=n.target;if(t?.closest?.("[data-slot-zone]"))return n.preventDefault(),void l(null);const o=function(e){const n=e?.closest?.("input, textarea");return n&&("INPUT"!==n.tagName||["text","search","url","email","tel","number",""].includes(n.type))?n:null}(t);if(o)return n.preventDefault(),void l({kind:"input",x:n.clientX,y:n.clientY,el:o,owner:t});const r=t?.closest?.("[data-node-id]")?.getAttribute("data-node-id"),i=r?e.locate(r):null;n.preventDefault(),l(i?{kind:"node",x:n.clientX,y:n.clientY,...i,owner:t}:{kind:"empty",x:n.clientX,y:n.clientY,owner:t})},[e]);d(t,"contextmenu",n=>{if(_(n)||!t)return;const o=n.target?.closest?.("[data-easel-block]")??null,i=o?.getAttribute("data-easel-block"),c=i?e.locate(i):null;n.preventDefault();const s=f(t.frame,n.clientX,n.clientY),a=t.frame,u=o?r(o):null;l(c?{kind:"node",...s,...c,copy:u,owner:a}:{kind:"empty",...s,owner:a})}),d(t,"mousedown",i),d(t,"scroll",i,{on:"window"});return{onEditorContextMenu:u,menu:o?/* @__PURE__ */K($,{host:e,target:o,onClose:i}):null,closeMenu:i}}function $({host:e,target:n,onClose:t}){const o="node"===n.kind?Q(e,n):"input"===n.kind?G(e,n.el):J(e);return 0===o.length?null:/* @__PURE__ */K(g,{at:{x:n.x,y:n.y},owner:n.owner??null,onClose:t,"aria-label":c(o),items:i(o)})}export{L as EASEL_NODE_CLIPBOARD,T as ancestorChain,S as nodeClipboardOf,X as nodeClipboardRules,Q as nodeMenuItems,R as nodeShortcut,J as pageMenuItems,B as pastePlace,V as runNodeShortcut,G as textMenuItems,Y as useNodeClipboard,H as useNodeContextMenu};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useScreenDocument as n}from"./chunk-
|
|
1
|
+
import{useScreenDocument as n}from"./chunk-BYONFJVQ.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-Q3VAJMXS.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{styleFieldBuilders as e,keptByRow as o}from"./chunk-IMAN6IP5.js";import{boxFieldBuilders as s,PHONE_KEY_ACCESS as t,phoneTwinFields as l,section as r}from"./chunk-5OKOCRXT.js";import{deviceField as i}from"./chunk-7GGNFLHT.js";import{TextColorIcon as n,GroundIcon as c}from"efficient-shell/icons/efficient";import{jsx as d}from"react/jsx-runtime";var u={fill:"buttonColor",fillOpacity:"buttonFillOpacity",border:"buttonBorder",text:"buttonTextColor",corners:"buttonCorners",cornerSides:"buttonCornerSides"},a={top:"buttonPaddingTop",right:"buttonPaddingRight",bottom:"buttonPaddingBottom",left:"buttonPaddingLeft"};function f(f){const b=s(f.say),p=e(f.say),y=u,F=f.style,g=f.phone??t;return{_dSize:r("Size"),...b.sidesPaddingFields({keys:a,group:!1,...f.padding}),_dDesign:r("Design"),[y.fill]:p.colourField({key:y.fill,access:F,label:"Fill color",icon:/* @__PURE__ */d(c,{}),useFollows:f.follows.useFill,usePresets:f.usePresets,resetTo:f.resetTo,opacity:{key:y.fillOpacity,useUnset:f.follows.useFillOpacity}}),[y.fillOpacity]:o(y.fill),[y.border]:p.borderField({key:y.border,access:F,useFollows:f.follows.useBorder}),[y.text]:p.colourField({key:y.text,access:F,label:"Text color",icon:/* @__PURE__ */d(n,{}),useFollows:f.follows.useText,usePresets:f.usePresets,resetTo:f.resetTo}),[y.corners]:p.cornersField({key:y.corners,access:F,sidesKey:y.cornerSides,useFollows:f.follows.useCorners}),[y.cornerSides]:o(y.corners),_dLayout:r("Layout"),...l("align",b.blockAlignmentField({phone:!0},""),g),align:i("desktop",b.blockAlignmentField())}}export{a as BUTTON_PAD_KEYS,u as BUTTON_STYLE_KEYS,f as buttonFieldSet};
|