efficient-easel 25.1.0 → 26.2.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-2S7PJZWH.js +1 -0
- package/dist/chunk-2T22IY3J.js +2 -0
- package/dist/chunk-4FFDGEWA.js +1 -0
- package/dist/{chunk-BBD3FLU3.js → chunk-53ME3GAI.js} +14 -14
- package/dist/{chunk-KFV7N2DJ.js → chunk-56ID6FKZ.js} +1 -1
- package/dist/{chunk-OXOUGEAT.js → chunk-7GGNFLHT.js} +1 -1
- package/dist/chunk-BYONFJVQ.js +2 -0
- package/dist/chunk-CLAADE4J.js +14 -0
- package/dist/{chunk-FEP6XMNX.js → chunk-CP6KQP5A.js} +1 -1
- package/dist/chunk-FIH23CB7.js +1 -0
- package/dist/chunk-FT3O7X6U.js +5 -0
- package/dist/{chunk-UCZQWQNS.js → chunk-FYV6GZXP.js} +1 -1
- package/dist/{chunk-6WTWYHC2.js → chunk-I3KB7LH7.js} +4 -4
- package/dist/{chunk-IW5QXREH.js → chunk-IHXQZDDW.js} +39 -39
- package/dist/chunk-JYVQ62TL.js +1 -0
- package/dist/{chunk-XLC7HWW3.js → chunk-LDXYMHYW.js} +1 -1
- package/dist/chunk-LUG22U5L.js +1 -0
- package/dist/chunk-M5IKANJ5.js +13 -0
- package/dist/{chunk-SQTVXE5D.js → chunk-MBEUSPIN.js} +4 -4
- package/dist/{chunk-S6YOIRXQ.js → chunk-Q3VAJMXS.js} +1 -1
- package/dist/{chunk-U3LTJSBU.js → chunk-R76XMEKT.js} +11 -11
- package/dist/{chunk-62UGN7VM.js → chunk-TOEJCZUO.js} +1 -1
- package/dist/{chunk-ITIVCER6.js → chunk-WQXAAVCE.js} +1 -1
- package/dist/chunk-X3EMJ2EX.js +1 -0
- package/dist/{chunk-KF3LT7J2.js → chunk-YDJZX2XS.js} +1 -1
- package/dist/{chunk-XTDOSL2M.js → chunk-ZIEINXSZ.js} +6 -6
- package/dist/chunk-ZJRMB5KN.js +4 -0
- package/dist/drag/index.js +1 -1
- package/dist/draw/index.d.ts +1 -0
- package/dist/draw/index.js +1 -1
- package/dist/easel/index.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/content/block-size.d.ts +74 -0
- package/dist/screen/lib/content/block-size.js +1 -0
- package/dist/screen/lib/document/block-set-host.js +1 -1
- package/dist/screen/lib/document/block-size-fields.d.ts +48 -0
- package/dist/screen/lib/document/block-size-fields.js +1 -0
- package/dist/screen/lib/document/box-fields.d.ts +58 -10
- 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/key-scope.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 +31 -1
- package/dist/chunk-ERB6FAZT.js +0 -2
- package/dist/chunk-H6BER2EU.js +0 -1
- package/dist/chunk-JQQFB7EZ.js +0 -1
- package/dist/chunk-KVIEUWTX.js +0 -11
- package/dist/chunk-LUHGBFOD.js +0 -5
- package/dist/chunk-OFBZOI6W.js +0 -1
- package/dist/chunk-SC6E3UUS.js +0 -13
- package/dist/chunk-U6LJ5UKD.js +0 -6
- package/dist/chunk-UDWXBS46.js +0 -1
- package/dist/words-DWvCJXwR.d.ts +0 -51
|
@@ -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{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};
|
|
@@ -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-FT3O7X6U.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:[
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=[{label:"Fit content",value:"fit"},{label:"Fill",value:"fill"},{label:"Fixed",value:"fixed"}],a="fit";function i(a){return e.some(e=>e.value===a)?a:void 0}var l={min:40,max:2e3,step:10,fallback:480},t={min:40,max:2e3,step:10},n=[{label:"Wrap",value:"wrap"},{label:"Shrink to fit",value:"shrink"}];function r(e){return n.some(a=>a.value===e)?e:void 0}var v={min:8,max:120,step:1,fallback:16},m=["widthFit","width","minWidth","maxWidth","textFit","minFont"];export{l as BLOCK_FIXED_WIDTH,m as BLOCK_SIZE_KEYS,a as BLOCK_WIDTH_FIT_DEFAULT,e as BLOCK_WIDTH_FIT_POINTS,t as BLOCK_WIDTH_LIMIT,v as TEXT_FIT_MIN_FONT,n as TEXT_FIT_POINTS,i as parseBlockWidthFit,r as parseTextFit};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ScreenPartsProvider as t}from"./chunk-
|
|
1
|
+
import{ScreenPartsProvider as t}from"./chunk-FT3O7X6U.js";import{useEaselHost as e}from"./chunk-LX23TCTP.js";import{createEasel as r,EaselProvider as o}from"./chunk-53ME3GAI.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,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__ */
|
|
4
|
-
/* @__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-FT3O7X6U.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-53ME3GAI.js";import{easelMenuEntries as y}from"./chunk-FIVU2COQ.js";import{useWords as h}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-MBEUSPIN.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 I,AddIcon as C}from"efficient-shell/icons/efficient";import{ContextMenu as O,toast as E,Dialog as M,Button as $}from"efficient-shell/ui";import{jsx as F,jsxs as S,Fragment as x}from"react/jsx-runtime";function G({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(M,{open:!0,role:"alertdialog",size:"sm",title:r.deleteTitle({name:e}),onClose:o,initialFocus:s,footer:/* @__PURE__ */S(x,{children:[
|
|
3
|
+
/* @__PURE__ */F($,{ref:s,variant:"secondary",onClick:o,children:r.cancel}),
|
|
4
|
+
/* @__PURE__ */F($,{variant:"danger",loading:l,onClick:()=>{(async()=>{i(!0);try{await n()}finally{i(!1)}})()},children:r.deleteShared})]}),children:r.deleteMessage({count:t})})}var T=e=>`section:${e}`,A=e=>`block:${e}`,B=e=>`template:${e}`,Q=e=>`shared:${e}`,U=e=>`preset:${e}`;function W({at:w,placeBlocks:M,canTake:$,onPick:W,itemFor:H,session:J,siteWide:N,onClose:z,onHide:D,readOnly:L}){const V=u(e=>e.config),P=a(),{labelAtLevel:R,categoryLabel:X,firstSection:Y,Icon:_,Thumbnail:K}=P,{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=V.components;re(n.filter(e=>e.node?.type&&r[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[V,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=V.components;ce(n.filter(e=>e.node?.type&&r[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[V,ne,ae]);const[de,me]=b(null),[fe,ue]=b(null),ye=j(()=>e(V,P),[V]),he=e=>R(e,"section",V.components[e]?.label??e),ke=e=>({type:e.preset?U(e.preset.key):T(e.type),label:e.name,cover:/* @__PURE__ */F(K,{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(_,{type:e,size:26})}),ve=j(()=>{const e=t(ye,Y),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))}M?.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:A(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:Q(e.id),label:e.title,cover:/* @__PURE__ */F(K,{type:e.node.type}),mark:/* @__PURE__ */F(I,{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:B(e.id),label:e.name,cover:/* @__PURE__ */F(K,{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(V.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(V,t,X),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)})}),!$)return p;const u=p.map(e=>({...e,tiles:e.tiles.map(e=>{const t=ge(e.type),n=t?$(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,V,ee,$,M,ne]);/* @__PURE__ */
|
|
5
5
|
return S(x,{children:[
|
|
6
|
-
/* @__PURE__ */
|
|
6
|
+
/* @__PURE__ */F(i,{icon:/* @__PURE__ */F(C,{size:15}),title:ee.title,context:ee.contextAll,actions:/* @__PURE__ */F(s,{label:ee.done,description:ee.doneDescription,onClick:z}),onHide:D}),
|
|
7
7
|
/* @__PURE__ */S("div",{className:"sf-addside sf-scroll",children:[
|
|
8
|
-
/* @__PURE__ */
|
|
8
|
+
/* @__PURE__ */F(k,{groups:ve,session:J,itemFor:e=>H(ge(e)??{kind:"section",type:e}),onInsert:W?e=>{const t=ge(e);t&&W(t)}:void 0,onTileMenu:(e,t)=>{const n=ge(e);return"shared"===n?.kind&&!L&&(me({section:n.section,...t}),!0)},at:w,hint:ee.hint,searchLabel:ee.search,readOnly:L,words:te}),N??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(G,{name:fe.title,pages:fe.used_on.length,onDelete:()=>(async e=>{try{await l(ne).remove(e.id)}catch{return void E.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{W as AddSidePanel,A as blockKey,U as presetKey,T as sectionKey,Q as sharedKey,B as templateKey};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{useAccessPatch as e,FLAT_ACCESS as r,useAccessValue as o}from"./chunk-M5IKANJ5.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),k=e(o.access??r),C="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:C,onChange:e=>m(""===e?B:e),inherited:a,presets:u,changed:""!==C||j,onReset:()=>{j&&o.opacity?k([[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 k=20;function C({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),k=o.access?void 0:null,C="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!==C||Array.isArray(m),action:/* @__PURE__ */f(n,{label:s("Corners"),changed:null!==C||Array.isArray(m),detail:`${a}px`,onReset:()=>Array.isArray(m)?w([[o.key,k],[o.sidesKey,k]]):h(k),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?k:r)},radius:C,onRadiusChange:e=>h(e??k),radiusMin:0,radiusMax:40,radiusStep:o.step??1,radiusPlaceholder:String(a),disabled:l.readOnly})})}function A(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(C,{o:r,say:e,props:o})}),cornersField:r=>({type:"custom",render:o=>/* @__PURE__ */f(F,{o:r,say:e,props:o})})}}var{colourField:O,borderField:x,cornersField:I}=A();export{k as BORDER_WIDTH_MAX,B as CORNER_RADIUS_MAX,j as CORNER_SIDES,x as borderField,O as colourField,I as cornersField,v as keptByRow,A as styleFieldBuilders};
|
package/dist/drag/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AddPanel,CanvasDragLayer,CanvasInsert,EMPTY_MEASURE,HANDLE_GRACE_MS,canvasTarget,contains,gapInZone,gapLine,insertSeams,measureCanvas,pickSource,seamsBetween,sourcesAt}from"../chunk-
|
|
1
|
+
export{AddPanel,CanvasDragLayer,CanvasInsert,EMPTY_MEASURE,HANDLE_GRACE_MS,canvasTarget,contains,gapInZone,gapLine,insertSeams,measureCanvas,pickSource,seamsBetween,sourcesAt}from"../chunk-MBEUSPIN.js";import"../chunk-TQ5Y6S2X.js";export{AUTO_SCROLL_EDGE,AUTO_SCROLL_MAX_SPEED,autoScrollDelta,autoScrollSpeed,createDragSession,dropEffectFor,dropOnRow,frameScrollBox,gapToMoveIndex,isNoOpDrop,scrollBoxOf,scrollParent,startAutoScroll,stepGap,useTreeDrag}from"../chunk-3XECMGXX.js";import"../chunk-P2VEMZH5.js";import"../chunk-EUFDQ4KL.js";import"../chunk-KXM6YRG2.js";import"../chunk-TOKMFZPB.js";import"../chunk-FR7EEKFF.js";import"../chunk-7UFKEX72.js";
|
package/dist/draw/index.d.ts
CHANGED
|
@@ -8,4 +8,5 @@ export { AUTO_RULES, AutoRule, FOLLOW_RULES, VIEW_DESKTOP_MIN, VIEW_TABLET_MIN,
|
|
|
8
8
|
export { HERO_SLIDER_GOTO_EVENT, HeroSliderGotoDetail } from '../screen/lib/document/preview-events.js';
|
|
9
9
|
export { B as BLOCK_ATTRIBUTE, R as REPEAT_ATTRIBUTE, a as REPEAT_INDEX_ATTRIBUTE } from '../dom-BpxMcHFP.js';
|
|
10
10
|
export { TEXT_STYLE_CASES, TEXT_STYLE_CASE_CSS, TextStyleCase, TextStyleCaseCss, isTextStyleCase, textStyleCaseCss, textStyleCaseOfCss } from '../text-styles/model.js';
|
|
11
|
+
export { BLOCK_FIXED_WIDTH, BLOCK_SIZE_KEYS, BLOCK_WIDTH_FIT_DEFAULT, BLOCK_WIDTH_FIT_POINTS, BLOCK_WIDTH_LIMIT, BlockSizeKey, BlockWidthFit, TEXT_FIT_MIN_FONT, TEXT_FIT_POINTS, TextFit, parseBlockWidthFit, parseTextFit } from '../screen/lib/content/block-size.js';
|
|
11
12
|
import '../words-B5Gb7KFq.js';
|
package/dist/draw/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SCALAR_TEXT_CONTROLS,TEXT_CONTROL_KINDS}from"../chunk-I6SK6ZDT.js";export{AUTO_RULES,FOLLOW_RULES,VIEW_DESKTOP_MIN,VIEW_TABLET_MIN,VIEW_TIERS,VIEW_TIER_LABEL,isAuto,phoneKey,resolveViewValue,tabletKey,viewTierForWidth}from"../chunk-E52W3M5I.js";export{
|
|
1
|
+
export{SCALAR_TEXT_CONTROLS,TEXT_CONTROL_KINDS}from"../chunk-I6SK6ZDT.js";export{BLOCK_FIXED_WIDTH,BLOCK_SIZE_KEYS,BLOCK_WIDTH_FIT_DEFAULT,BLOCK_WIDTH_FIT_POINTS,BLOCK_WIDTH_LIMIT,TEXT_FIT_MIN_FONT,TEXT_FIT_POINTS,parseBlockWidthFit,parseTextFit}from"../chunk-X3EMJ2EX.js";export{AUTO_RULES,FOLLOW_RULES,VIEW_DESKTOP_MIN,VIEW_TABLET_MIN,VIEW_TIERS,VIEW_TIER_LABEL,isAuto,phoneKey,resolveViewValue,tabletKey,viewTierForWidth}from"../chunk-E52W3M5I.js";export{rootRowName,sectionRenameProp,slotChildName,slotChildRenameProp,slotChildRowName}from"../chunk-5NHQ452C.js";export{HERO_SLIDER_GOTO_EVENT}from"../chunk-AJ2SUSET.js";export{hidableText,readHidable}from"../chunk-6UAEFOJ4.js";export{ANCHOR_FIELD_KEYS,FOLD_FIELD_MARKER,LINK_FIELD_MARKER,MEDIA_FIELD_MARKER,SCAFFOLD_FIELD_MARKER,TEXT_FIELD_MARKER,foldMetaOf,textFieldIdentifier}from"../chunk-ANPOR6EY.js";export{PART_SEP,decodePartId,encodePartId}from"../chunk-R4AUZVA3.js";export{FOOTER_TYPE,HEADER_TYPE,ROOT_ZONE,TREE_MAX_DEPTH,blockNodeActions,childSlotsOf,locateNode,missingPinnedTypes,nestsInTree,newNodeId,pinnedDuplicateIds,pinnedDuplicateIndices,slotChildrenIn,slotFieldsOf}from"../chunk-TCAAOYQY.js";export{TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,isTextStyleCase,textStyleCaseCss,textStyleCaseOfCss}from"../chunk-YHZSBL2N.js";export{BLOCK_ATTRIBUTE}from"../chunk-FR7EEKFF.js";export{REPEAT_ATTRIBUTE,REPEAT_INDEX_ATTRIBUTE}from"../chunk-7UFKEX72.js";
|
package/dist/easel/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{CHROME_ATTR,CanvasChromeContext,CanvasFrame,CanvasPartsContext,CanvasPassThroughContext,CanvasSharedContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,partHasOwnBox,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useRootFields,useSelectedFields,useSelectedHost,validSelection}from"../chunk-
|
|
1
|
+
export{CHROME_ATTR,CanvasChromeContext,CanvasFrame,CanvasPartsContext,CanvasPassThroughContext,CanvasSharedContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,partHasOwnBox,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useRootFields,useSelectedFields,useSelectedHost,validSelection}from"../chunk-53ME3GAI.js";export{repeatCopyAt}from"../chunk-LUG22U5L.js";import"../chunk-TBY3DFKS.js";import"../chunk-K53PQAMP.js";import"../chunk-QTHQPJWA.js";import"../chunk-HZSZT3BE.js";import"../chunk-PMRN5Z3T.js";import"../chunk-MFIRYGHW.js";import"../chunk-EUFDQ4KL.js";import"../chunk-KXM6YRG2.js";import"../chunk-TOKMFZPB.js";import"../chunk-FR7EEKFF.js";import"../chunk-7UFKEX72.js";
|
package/dist/fields/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,fieldShownInView,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-
|
|
1
|
+
export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,fieldShownInView,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-R76XMEKT.js";export{fieldIsShown,showWhenOf,shownFields,withShowWhen}from"../chunk-BPXEFVSQ.js";import"../chunk-YCSZAP7T.js";export{FieldSlider}from"../chunk-ZEH6QLBH.js";import"../chunk-WHS6Y55E.js";import"../chunk-FM6JO4WF.js";import"../chunk-K56YDHYQ.js";import"../chunk-56ID6FKZ.js";export{useResolvedFields}from"../chunk-K53PQAMP.js";import"../chunk-FIVU2COQ.js";export{FieldNumber}from"../chunk-Y2T3JX7K.js";export{FieldSelect,optionFor}from"../chunk-KFWNGPW3.js";import"../chunk-MIX7EGRG.js";import"../chunk-DX3VILZ3.js";import"../chunk-JACEEVVF.js";import"../chunk-MFIRYGHW.js";import"../chunk-3XECMGXX.js";import"../chunk-P2VEMZH5.js";import"../chunk-EUFDQ4KL.js";import"../chunk-KXM6YRG2.js";
|
package/dist/panel/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { W as WordFit } from '../wordFit-7XpmhcaW.js';
|
|
4
|
-
import { P as PanelWords } from '../words-
|
|
4
|
+
import { P as PanelWords, C as ColourRowWords } from '../words-BrN08Fup.js';
|
|
5
|
+
import { ColorPreset } from 'efficient-shell/ui';
|
|
5
6
|
export { BorderInput as SettingsBorder, BorderLineStyle as SettingsBorderLineStyle, BorderInputProps as SettingsBorderProps, BorderValue as SettingsBorderValue, CornerOption as SettingsCornerPoint, CornersInput as SettingsCorners, CornersInputProps as SettingsCornersProps, AlignmentGrid as SettingsPlacement, AlignmentPoint as SettingsPlacementPoint, AlignmentGridProps as SettingsPlacementProps, SidesInput as SettingsSides, SidesEachToggle as SettingsSidesEach, SidesInputProps as SettingsSidesProps, SidesValue as SettingsSidesValue, borderSides, borderStartEach, sidesStartEach } from 'efficient-shell/ui';
|
|
6
7
|
export { a as DESIGN_GROUPS, D as DesignGroup, b as SETTINGS_BUCKETS, S as SettingsBucket } from '../buckets-_MGDYJlb.js';
|
|
7
8
|
|
|
@@ -714,6 +715,66 @@ declare function SettingsDefaultReset({ label, changed, onReset, detail, disable
|
|
|
714
715
|
*/
|
|
715
716
|
declare function SettingsDrill({ name, preview, offPage, status, onOpen, id, className, }: SettingsDrillProps): react.JSX.Element;
|
|
716
717
|
|
|
718
|
+
interface SettingsColourProps {
|
|
719
|
+
/** The row's name, in the host's words. */
|
|
720
|
+
label: string;
|
|
721
|
+
/** The stored colour, `#rrggbb` — or `""` while it has none of its own. */
|
|
722
|
+
value: string;
|
|
723
|
+
/** Called with a lower-case `#rrggbb`, and only when it differs from `value`. */
|
|
724
|
+
onChange: (hex: string) => void;
|
|
725
|
+
icon?: ReactNode;
|
|
726
|
+
hint?: ReactNode;
|
|
727
|
+
/** The swatch's DOM id, where the row's label points at it. */
|
|
728
|
+
id?: string;
|
|
729
|
+
/** The swatch's name where the row's visible label names something else. */
|
|
730
|
+
ariaLabel?: string;
|
|
731
|
+
/** The colours the window offers first: the site's theme colours, the
|
|
732
|
+
* email's palette. The host's; the row holds no colour of its own. */
|
|
733
|
+
presets?: readonly ColorPreset[];
|
|
734
|
+
/** The colour in force while `value` is `""`: the swatch paints it and the
|
|
735
|
+
* hex box shows it in grey. Nothing is written for it. */
|
|
736
|
+
inherited?: string;
|
|
737
|
+
/** A WORD in place of the hex box ("Theme 2", "Auto"): the state the colour
|
|
738
|
+
* is in rather than the colour. Not drawn when it IS the value's hex. */
|
|
739
|
+
caption?: string;
|
|
740
|
+
/** The colour's opacity, 0-100, and its write: the row becomes the shell's
|
|
741
|
+
* one-line picker with its `%` box. */
|
|
742
|
+
opacity?: number;
|
|
743
|
+
onOpacityChange?: (opacity: number) => void;
|
|
744
|
+
/** The row holds a value of its own: the label is marked and ↺ shows. */
|
|
745
|
+
changed?: boolean;
|
|
746
|
+
/** Given, the label line carries `SettingsDefaultReset`. */
|
|
747
|
+
onReset?: () => void;
|
|
748
|
+
/** What ↺ goes back to, for its tooltip. */
|
|
749
|
+
resetTo?: string;
|
|
750
|
+
/** A sent campaign: every part is drawn and none can be pressed. */
|
|
751
|
+
readOnly?: boolean;
|
|
752
|
+
/** The row's words, `useEaselStrings().colourRow`. English when left out. */
|
|
753
|
+
words?: Partial<ColourRowWords>;
|
|
754
|
+
/** The ↺'s words, `useEaselStrings().panel`. English when left out. */
|
|
755
|
+
resetWords?: SettingsDefaultResetProps['words'];
|
|
756
|
+
/** Drawn under the control line. */
|
|
757
|
+
children?: ReactNode;
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* THE COLOUR ROW of both editors (twins plan E3; the look is the website's,
|
|
761
|
+
* Lewis 2026-10-23 option 2, confirmed for both editors 2026-10-30). The label
|
|
762
|
+
* line holds the label and the row's ↺; the shell's `ColorPicker` swatch and
|
|
763
|
+
* its `HexInput` sit on their own line under it, both 32 (harness FT-6). On
|
|
764
|
+
* the label line at 32 a long label, the swatch and the box ran past a 220
|
|
765
|
+
* panel.
|
|
766
|
+
*
|
|
767
|
+
* What is written is one lower-case `#rrggbb`, from every way in, and nothing
|
|
768
|
+
* until the merchant moves something: a row that only SHOWS the colour it
|
|
769
|
+
* follows (`inherited`) never pins it from the hex box. The followed colour is the box's VALUE
|
|
770
|
+
* in grey, not a placeholder: it is the colour most often copied, and the
|
|
771
|
+
* shell's box writes only a hex that differs from what it shows.
|
|
772
|
+
*
|
|
773
|
+
* Hook-free, like the rest of `panel`: a host may call it as a function inside
|
|
774
|
+
* a field's render. The theme or palette is the host's to read and hand in.
|
|
775
|
+
*/
|
|
776
|
+
declare function SettingsColour({ label, value, onChange, icon, hint, id, ariaLabel, presets, inherited, caption, opacity, onOpacityChange, changed, onReset, resetTo, readOnly, words, resetWords, children, }: SettingsColourProps): react.JSX.Element;
|
|
777
|
+
|
|
717
778
|
/**
|
|
718
779
|
* A FULL-WIDTH BUTTON UNDER A GROUP'S ROWS THAT COMMITS A CHANGE.
|
|
719
780
|
*
|
|
@@ -858,4 +919,4 @@ interface SettingsContentWidthProps {
|
|
|
858
919
|
}
|
|
859
920
|
declare function SettingsContentWidth({ mode, onMode, number, changed, detail, onReset, fullClosed, disabled, hint, labelId, words, resetWords, }: SettingsContentWidthProps): react.JSX.Element;
|
|
860
921
|
|
|
861
|
-
export { BACKGROUND_WIDTHS, type BackgroundWidth, type BackgroundWidthWords, type ContentWidthWords, DEFAULT_BACKGROUND_WIDTH_WORDS, DEFAULT_CONTENT_WIDTH_WORDS, SettingsAction, type SettingsActionBaseProps, type SettingsActionNote, type SettingsActionProps, SettingsBackgroundWidth, type SettingsBackgroundWidthProps, SettingsContentWidth, type SettingsContentWidthProps, SettingsDefaultReset, type SettingsDefaultResetProps, SettingsDrill, type SettingsDrillProps, SettingsField, type SettingsFieldProps, SettingsGroup, SettingsGroupHead, type SettingsGroupHeadProps, type SettingsGroupProps, SettingsGroupSub, type SettingsGroupSubProps, SettingsSegmented, type SettingsSegmentedFit, type SettingsSegmentedOption, type SettingsSegmentedProps, SettingsSwitch, type SettingsSwitchBaseProps, type SettingsSwitchLabel, type SettingsSwitchProps };
|
|
922
|
+
export { BACKGROUND_WIDTHS, type BackgroundWidth, type BackgroundWidthWords, ColourRowWords, type ContentWidthWords, DEFAULT_BACKGROUND_WIDTH_WORDS, DEFAULT_CONTENT_WIDTH_WORDS, SettingsAction, type SettingsActionBaseProps, type SettingsActionNote, type SettingsActionProps, SettingsBackgroundWidth, type SettingsBackgroundWidthProps, SettingsColour, type SettingsColourProps, SettingsContentWidth, type SettingsContentWidthProps, SettingsDefaultReset, type SettingsDefaultResetProps, SettingsDrill, type SettingsDrillProps, SettingsField, type SettingsFieldProps, SettingsGroup, SettingsGroupHead, type SettingsGroupHeadProps, type SettingsGroupProps, SettingsGroupSub, type SettingsGroupSubProps, SettingsSegmented, type SettingsSegmentedFit, type SettingsSegmentedOption, type SettingsSegmentedProps, SettingsSwitch, type SettingsSwitchBaseProps, type SettingsSwitchLabel, type SettingsSwitchProps };
|
package/dist/panel/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{BACKGROUND_WIDTHS,DEFAULT_BACKGROUND_WIDTH_WORDS,DEFAULT_CONTENT_WIDTH_WORDS,SettingsAction,SettingsBackgroundWidth,BorderInput as SettingsBorder,SettingsContentWidth,CornersInput as SettingsCorners,
|
|
1
|
+
export{BACKGROUND_WIDTHS,DEFAULT_BACKGROUND_WIDTH_WORDS,DEFAULT_CONTENT_WIDTH_WORDS,SettingsAction,SettingsBackgroundWidth,BorderInput as SettingsBorder,SettingsColour,SettingsContentWidth,CornersInput as SettingsCorners,SettingsDrill,SettingsGroupHead,SettingsGroupSub,AlignmentGrid as SettingsPlacement,SidesInput as SettingsSides,SidesEachToggle as SettingsSidesEach,borderSides,borderStartEach,sidesStartEach}from"../chunk-CLAADE4J.js";export{SettingsDefaultReset}from"../chunk-2T22IY3J.js";export{DESIGN_GROUPS,SETTINGS_BUCKETS,SettingsGroup}from"../chunk-FM6JO4WF.js";import"../chunk-56ID6FKZ.js";export{SettingsSwitch}from"../chunk-OECWLNKJ.js";export{SettingsField}from"../chunk-MIX7EGRG.js";export{SettingsSegmented}from"../chunk-DX3VILZ3.js";
|
package/dist/panel/panel.css
CHANGED
|
@@ -769,3 +769,49 @@
|
|
|
769
769
|
width: 100%;
|
|
770
770
|
min-width: 0;
|
|
771
771
|
}
|
|
772
|
+
|
|
773
|
+
/* ── SettingsColour: the colour row of both editors (twins plan E3) ─────────
|
|
774
|
+
The swatch and the hex box have their own line under the label, both 32
|
|
775
|
+
(Lewis 2026-10-23, option 2). The hex box's width is the shell's: it is
|
|
776
|
+
never narrower than its seven characters. */
|
|
777
|
+
.es-colour {
|
|
778
|
+
display: flex;
|
|
779
|
+
align-items: center;
|
|
780
|
+
gap: var(--es-space-8);
|
|
781
|
+
min-width: 0;
|
|
782
|
+
}
|
|
783
|
+
.es-colour-hexwrap {
|
|
784
|
+
flex: none;
|
|
785
|
+
display: flex;
|
|
786
|
+
}
|
|
787
|
+
.es-colour-caption {
|
|
788
|
+
font-size: var(--text-xs, 12px);
|
|
789
|
+
color: var(--es-muted);
|
|
790
|
+
white-space: nowrap;
|
|
791
|
+
}
|
|
792
|
+
/* The colour a row FOLLOWS, in its box in grey: the grey says the setting has
|
|
793
|
+
no colour of its own. */
|
|
794
|
+
.es-colour input.es-colour-hex.is-inherited {
|
|
795
|
+
color: var(--es-muted);
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
/* ── The image row of both editors (twins plan E3) ──────────────────────────
|
|
799
|
+
`.es-field-ctl` lays its control out in a flex ROW, where the shell's media
|
|
800
|
+
box would shrink to its content: this column takes the row, with the
|
|
801
|
+
host's notes and the paste box under the box. */
|
|
802
|
+
.es-image-row {
|
|
803
|
+
flex: 1 1 auto;
|
|
804
|
+
display: flex;
|
|
805
|
+
flex-direction: column;
|
|
806
|
+
align-items: stretch;
|
|
807
|
+
gap: var(--es-space-8);
|
|
808
|
+
min-width: 0;
|
|
809
|
+
}
|
|
810
|
+
.es-image-row > button {
|
|
811
|
+
align-self: flex-start;
|
|
812
|
+
}
|
|
813
|
+
/* A template's slot: the words in place of the box. */
|
|
814
|
+
.es-image-row-note {
|
|
815
|
+
font-size: var(--text-xs, 12px);
|
|
816
|
+
color: var(--es-muted);
|
|
817
|
+
}
|
package/dist/pick/index.d.ts
CHANGED
|
@@ -1,205 +1,26 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import { P as PickWords } from '../words-DWvCJXwR.js';
|
|
4
|
-
export { Hsv, hexToHsv, hsvToHex } from 'efficient-shell/ui';
|
|
5
|
-
|
|
6
|
-
/** One colour the site's theme names — offered first, by name. */
|
|
7
|
-
type ThemeColour = {
|
|
8
|
-
name: string;
|
|
9
|
-
value: string;
|
|
10
|
-
};
|
|
11
|
-
type ColourPickerProps = {
|
|
12
|
-
/** The colour, `#rrggbb` — or `''` while the setting has none of its own. */
|
|
13
|
-
value: string;
|
|
14
|
-
/** Live, as the colour moves — the same `#rrggbb` from every way in. */
|
|
15
|
-
onChange: (next: string) => void;
|
|
16
|
-
/** The row's name: the swatch is "<label>", the hex box "<label> hex code". */
|
|
17
|
-
label: string;
|
|
18
|
-
/** The theme's colours, offered first in the window. */
|
|
19
|
-
theme?: readonly ThemeColour[];
|
|
20
|
-
/**
|
|
21
|
-
* A WORD the row prints in place of the hex. While `value` is `''` it names
|
|
22
|
-
* the empty state ("Not set" by default). Given WITH a colour, it names the
|
|
23
|
-
* state that colour is in — "Auto" for an ink that follows its fill, "Accent"
|
|
24
|
-
* for a button on theme's colour: the swatch shows the colour the page
|
|
25
|
-
* really has, the row prints the word, and the hex is in the window. A
|
|
26
|
-
* caption that IS the value's hex is no word, and the row's hex box stays.
|
|
27
|
-
*/
|
|
28
|
-
caption?: string;
|
|
29
|
-
/**
|
|
30
|
-
* The colour IN FORCE while `value` is `''`: the setting has none of its own
|
|
31
|
-
* and follows a style (the email's body text, `#333333`). The swatch paints
|
|
32
|
-
* it (`is-inherited`, not the not-set look), the row prints `caption` or
|
|
33
|
-
* else that colour's hex in grey (no word: the row's Default part already
|
|
34
|
-
* says the state, one idea one word, GG 2026-10-07) — in the hex BOX, so a
|
|
35
|
-
* press selects it all for copying (GG for Lewis, 2026-10-07: the colour a
|
|
36
|
-
* row follows is the one most often copied); and the window starts
|
|
37
|
-
* from it with its hex as a placeholder. ⚠️ Nothing is written until the merchant moves something:
|
|
38
|
-
* showing the colour a setting follows must not pin it. Left out, or `''`,
|
|
39
|
-
* an empty value is "Not set", exactly as before.
|
|
40
|
-
*/
|
|
41
|
-
inherited?: string;
|
|
42
|
-
/**
|
|
43
|
-
* A control drawn at the END of the row, after the hex: the panel's Default /
|
|
44
|
-
* Reset part (`SettingsDefaultReset`, Lewis 2026-10-06). ⚠️ INSIDE the row,
|
|
45
|
-
* not after the picker: a line that holds the picker wraps item by item, and
|
|
46
|
-
* a part beside the picker could drop onto a line of its own at a narrow
|
|
47
|
-
* panel (measured at 220px on a short label) while the swatch stayed above.
|
|
48
|
-
* In the row, the swatch, the hex and the part wrap as one.
|
|
49
|
-
*/
|
|
50
|
-
after?: ReactNode;
|
|
51
|
-
/** The swatch's DOM id, for a row whose own `<label for>` points at it. */
|
|
52
|
-
id?: string;
|
|
53
|
-
readOnly?: boolean;
|
|
54
|
-
/**
|
|
55
|
-
* The picker's own words in the host's language:
|
|
56
|
-
* `useEaselStrings().pick.colour` (0.95.0). Left out, English. A prop, not
|
|
57
|
-
* the strings provider: the pickers import nothing outside their folder.
|
|
58
|
-
*/
|
|
59
|
-
words?: PickWords['colour'];
|
|
60
|
-
};
|
|
61
1
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* THE SWATCH AND WHAT IT OPENS ARE THE SHELL'S (easel#199 step 4, harness
|
|
72
|
-
* UI-24): the shell's `Popover` holding its `ColorPickerPanel`, the trigger
|
|
73
|
-
* wearing `colorSwatchClasses` and painted with `colorFill` — exactly the
|
|
74
|
-
* shell `ColorPicker`'s own composition. Composed here rather than taken as
|
|
75
|
-
* `ColorPicker` for two things it cannot carry: the swatch's NAME is the row's
|
|
76
|
-
* (`words.swatch`, with the caption word — "Auto", "Accent" — where the row
|
|
77
|
-
* prints one, in the host's language), and the trigger keeps the
|
|
78
|
-
* `es-pick-swatch` / `is-inherited` / `is-unset` hooks hosts read.
|
|
79
|
-
*
|
|
80
|
-
* It FLOATS now, on the shell's popup layer. It opened in the panel's own flow
|
|
81
|
-
* because a floating window was clipped by the scrolling panel and sat outside
|
|
82
|
-
* the `--es-*` root; the shell's Popover is portalled to `<body>`, follows its
|
|
83
|
-
* trigger as the panel scrolls, keeps inside the shell window that owns it
|
|
84
|
-
* (UI-11), and draws on the shell's tokens, not `--es-*`. Placement, Escape
|
|
85
|
-
* (focus back on the swatch), Tab and a press outside are the Popover's — and
|
|
86
|
-
* since nothing in the panel moves when it closes, the press outside may close
|
|
87
|
-
* it on its pointerdown.
|
|
88
|
-
*
|
|
89
|
-
* The hex box is always a box you can type into — pasting a brand colour
|
|
90
|
-
* costs no clicks — live on the keystroke that makes it a colour, and put back
|
|
91
|
-
* to what is stored on Enter, Escape or leaving it.
|
|
92
|
-
*
|
|
93
|
-
* ONE LINE (Lewis, 2026-10-07, option E, final v9). In a line that holds it
|
|
94
|
-
* (`.es-field-head`, `.es-pick-line`) the label, the swatch, the hex and the
|
|
95
|
-
* host's `after` never wrap: short of room the label fades at its end (it
|
|
96
|
-
* keeps 56px), then the hex (it keeps 36px) — pick.css. What is cut is
|
|
97
|
-
* MEASURED here (`data-clipped` turns the fade on; text that fits is never
|
|
98
|
-
* faded), and over a cut label or hex a small dark tag shows the whole text.
|
|
99
|
-
* A press on the hex edits it IN PLACE: pick.css widens it to seven
|
|
100
|
-
* characters from its own left edge, never past the row's end
|
|
101
|
-
* (`--es-pick-edit-room`, measured here), and the `after` part steps aside
|
|
102
|
-
* only when that box reaches it (`data-editing="over"`). The swatch and the
|
|
103
|
-
* label never move. The accessible names are whole throughout: the fade and
|
|
104
|
-
* the tag are for the eye.
|
|
2
|
+
* The colour helpers hosts import from `efficient-easel/pick` — pure, no React,
|
|
3
|
+
* no DOM.
|
|
4
|
+
*
|
|
5
|
+
* A colour is stored as `#rrggbb`, lower case, everywhere a document holds one.
|
|
6
|
+
* The window that picks one is the shell's `ColorPickerPanel` (easel#199 step
|
|
7
|
+
* 4, harness UI-24), with its own colour maths. The square's and the strip's
|
|
8
|
+
* point maths, the box's length and the HSV re-exports went in the twins plan
|
|
9
|
+
* E3 (no reader). A media file's name is the shell's `mediaFileName`; easel's
|
|
10
|
+
* `mediaName`, which nothing read, went in 15.0.0.
|
|
105
11
|
*/
|
|
106
|
-
|
|
107
|
-
type
|
|
108
|
-
|
|
12
|
+
/** One colour the site's theme names: a theme preset, offered first, by name. */
|
|
13
|
+
type ThemeColour = {
|
|
14
|
+
name: string;
|
|
109
15
|
value: string;
|
|
110
|
-
/** Live, as the colour moves: one `#rrggbb` from every way in. */
|
|
111
|
-
onChange: (next: string) => void;
|
|
112
|
-
/** The colour's name: it names the panel's hex box ("<label> hex code"). */
|
|
113
|
-
label: string;
|
|
114
|
-
/** The theme's colours, offered first — the shell panel's `presets`, each named by theme. */
|
|
115
|
-
theme?: readonly ThemeColour[];
|
|
116
|
-
/** Escape in the window. The opener closes it and takes the focus back. */
|
|
117
|
-
onClose?: () => void;
|
|
118
|
-
/** The window's DOM id, for the opener's `aria-controls`. */
|
|
119
|
-
id?: string;
|
|
120
|
-
/** The colour in force while `value` is `''` (see `ColourPicker`): the window starts from it, its hex a placeholder. */
|
|
121
|
-
inherited?: string;
|
|
122
|
-
readOnly?: boolean;
|
|
123
|
-
/**
|
|
124
|
-
* Accepted and unused since the window is the shell's: its words (the
|
|
125
|
-
* square, the strip, the hex box, the presets) are the shell's
|
|
126
|
-
* `useShellStrings().color`, translated through the host's
|
|
127
|
-
* `ShellStringsProvider`.
|
|
128
|
-
*/
|
|
129
|
-
words?: PickWords['colour'];
|
|
130
|
-
/**
|
|
131
|
-
* Accepted and moot: the shell's panel always starts its hex row with a
|
|
132
|
-
* swatch of the colour (what the text box's window asked for, E5b).
|
|
133
|
-
*/
|
|
134
|
-
swatch?: boolean;
|
|
135
|
-
/**
|
|
136
|
-
* When a drag on the square or the hue bar writes. `'live'` (the default,
|
|
137
|
-
* as `ColourPicker` always has): every move. `'end'`: once, where the
|
|
138
|
-
* pointer comes up — one undo step for a host whose every write is one,
|
|
139
|
-
* like the text box (E5b). The thumbs, the hex and the swatch follow the
|
|
140
|
-
* drag live either way. An arrow key writes each press in both.
|
|
141
|
-
*/
|
|
142
|
-
dragWrites?: 'live' | 'end';
|
|
143
16
|
};
|
|
144
17
|
/**
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
* `ColourPicker` opens it in the shell's Popover; a row that draws its own
|
|
149
|
-
* swatches (the text-styles list's Any color, plan step E6) opens the same one
|
|
150
|
-
* in its own flow, so there is one window, not two.
|
|
151
|
-
*
|
|
152
|
-
* What it maps: `theme` → `presets` (`label` = theme colour's name),
|
|
153
|
-
* `inherited` → `fallback` (the panel starts from it, its hex a placeholder,
|
|
154
|
-
* and nothing is written until something moves), `readOnly` → `disabled`.
|
|
155
|
-
* A pick EQUAL to the inherited colour still writes — it pins it — because the
|
|
156
|
-
* panel compares with `value`, not with what is shown.
|
|
157
|
-
*/
|
|
158
|
-
declare function ColourWindow({ value, onChange, label, theme, onClose, id, inherited, readOnly, words: _words, swatch: _swatch, dragWrites, }: ColourWindowProps): react.JSX.Element;
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* The colour maths the picker runs on — pure, no React, no DOM.
|
|
162
|
-
*
|
|
163
|
-
* A colour is stored as `#rrggbb`, lower case, everywhere a document holds one;
|
|
164
|
-
* the picker WORKS in HSV (hue, saturation, value), because that is what a
|
|
165
|
-
* square and a hue strip are a picture of. These turn one into the other.
|
|
166
|
-
*
|
|
167
|
-
* ⚠️ HSV FROM A HEX LOSES THE HUE OF A GREY. `#808080` has no hue, so converting
|
|
168
|
-
* it back gives hue 0 — red — and a merchant who drags the square down to grey
|
|
169
|
-
* would find the strip jumped to red. The picker therefore keeps its own HSV
|
|
170
|
-
* while it is open and only reads one back from the stored hex when the value
|
|
171
|
-
* changes from OUTSIDE (the shell's `ColorPickerPanel`).
|
|
172
|
-
*
|
|
173
|
-
* What is still easel's own: the readout (`hexReadout`), the box's length, the
|
|
174
|
-
* point maths the shell keeps private (`svFromPoint`), `hueFromPoint` (which
|
|
175
|
-
* reaches 360 at the strip's end, where the shell's stops at 359) — exported
|
|
176
|
-
* names hosts already import. A media file's name is the shell's
|
|
177
|
-
* `mediaFileName`; easel's `mediaName`, which nothing read, went in 15.0.0.
|
|
18
|
+
* The shell's `parseHexColor` under the name hosts import: `#rrggbb`, lower
|
|
19
|
+
* case, or `null` while it is not a colour yet — three or six digits, with or
|
|
20
|
+
* without `#`, any case.
|
|
178
21
|
*/
|
|
179
|
-
|
|
180
22
|
declare const typedHex: (text: string) => string | null;
|
|
181
|
-
/** The most a hex box takes: `#` and six digits. */
|
|
182
|
-
declare const HEX_MAX_LENGTH = 7;
|
|
183
23
|
/** A stored hex as a person reads it: upper case. */
|
|
184
24
|
declare const hexReadout: (hex: string) => string;
|
|
185
|
-
/**
|
|
186
|
-
* A point in the saturation/brightness square → s and v. Saturation runs left
|
|
187
|
-
* to right, brightness bottom to top; a point outside the square is held to
|
|
188
|
-
* its edge, so a drag that leaves it keeps working.
|
|
189
|
-
*/
|
|
190
|
-
declare function svFromPoint(x: number, y: number, box: {
|
|
191
|
-
left: number;
|
|
192
|
-
top: number;
|
|
193
|
-
width: number;
|
|
194
|
-
height: number;
|
|
195
|
-
}): {
|
|
196
|
-
s: number;
|
|
197
|
-
v: number;
|
|
198
|
-
};
|
|
199
|
-
/** A point along the hue strip → a hue, 0–360, held to the strip's ends. */
|
|
200
|
-
declare function hueFromPoint(x: number, box: {
|
|
201
|
-
left: number;
|
|
202
|
-
width: number;
|
|
203
|
-
}): number;
|
|
204
25
|
|
|
205
|
-
export {
|
|
26
|
+
export { type ThemeColour, hexReadout, typedHex };
|
package/dist/pick/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{hexReadout,typedHex}from"../chunk-4FFDGEWA.js";
|