efficient-easel 16.1.0 → 18.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -65
- package/dist/autosave/index.d.ts +4 -4
- package/dist/blocks/index.d.ts +2 -2
- package/dist/chrome/index.d.ts +3 -3
- package/dist/chrome/index.js +1 -1
- package/dist/chunk-43AEUUNQ.js +1 -0
- package/dist/{chunk-K6EM4F5N.js → chunk-5VD2LGIZ.js} +18 -18
- package/dist/{chunk-ATOXCKEE.js → chunk-7TOQCTHV.js} +3 -3
- package/dist/chunk-A6Z4SD3I.js +10 -0
- package/dist/{chunk-V6VKM2QX.js → chunk-A7FF65FL.js} +1 -1
- package/dist/chunk-BHRC3ASL.js +1 -0
- package/dist/chunk-BRMYJBMB.js +8 -0
- package/dist/chunk-C2RHV42O.js +1 -0
- package/dist/chunk-F7FDF6NS.js +4 -0
- package/dist/{chunk-IE55HNMA.js → chunk-GWIVPLOX.js} +11 -11
- package/dist/{chunk-2H3W5OLQ.js → chunk-HGV3FWOB.js} +1 -1
- package/dist/chunk-LLDHIBYG.js +18 -0
- package/dist/chunk-M2Z775ZC.js +1 -0
- package/dist/{chunk-2L2L7G5L.js → chunk-MPF5QZJ7.js} +1 -1
- package/dist/chunk-N3VPBHR6.js +62 -0
- package/dist/chunk-QEAUF632.js +14 -0
- package/dist/{chunk-UVQR7W6I.js → chunk-RFE7ZG3Y.js} +1 -1
- package/dist/chunk-STWSCR25.js +2 -0
- package/dist/{chunk-TZIIRGVY.js → chunk-U277UX5I.js} +1 -1
- package/dist/chunk-VEZPDGDQ.js +1 -0
- package/dist/{chunk-JQOYUH4A.js → chunk-W2GEGVUY.js} +4 -4
- package/dist/{chunk-GPLMNRHR.js → chunk-WOETW3H6.js} +1 -1
- package/dist/chunk-X3TYRF5V.js +1 -0
- package/dist/{chunk-62VPYC7F.js → chunk-XDZHKYQX.js} +1 -1
- package/dist/{chunk-HV56SLR2.js → chunk-XHHVMAGM.js} +1 -1
- package/dist/chunk-XHSGRH42.js +5 -0
- package/dist/{chunk-XQGV2XAK.js → chunk-YI4QXOVJ.js} +1 -1
- package/dist/{chunk-RFSLDGDA.js → chunk-YLQYEDUQ.js} +1 -1
- package/dist/copy/index.js +23 -11
- package/dist/drag/drag.css +8 -0
- package/dist/drag/index.d.ts +15 -1
- package/dist/drag/index.js +1 -1
- package/dist/draw/client.js +1 -1
- package/dist/draw/index.js +1 -1
- package/dist/easel/easel.css +8 -0
- package/dist/easel/index.d.ts +45 -6
- package/dist/easel/index.js +1 -1
- package/dist/fields/index.js +1 -1
- package/dist/gold/gold.css +1 -1
- package/dist/{host-DGmdCaNL.d.ts → host-epHo7r8P.d.ts} +12 -5
- package/dist/icons/index.d.ts +0 -2
- package/dist/node-ops/index.d.ts +2 -2
- package/dist/node-ops/index.js +1 -1
- package/dist/panel/index.js +1 -1
- package/dist/{plan-CGREINRO.d.ts → plan-CZS902DV.d.ts} +27 -1
- package/dist/rail/index.d.ts +2 -2
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.d.ts +6 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/MediaSidePanel.d.ts +4 -3
- package/dist/screen/components/MediaSidePanel.js +1 -1
- package/dist/screen/components/NodeContextMenu.d.ts +8 -7
- package/dist/screen/components/NodeContextMenu.js +1 -1
- package/dist/screen/components/PageEditGuardNotices.js +1 -1
- package/dist/screen/components/SaveControls.d.ts +7 -6
- package/dist/screen/components/SaveControls.js +1 -1
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenDocumentContext.d.ts +4 -3
- package/dist/screen/components/ScreenDocumentContext.js +1 -1
- package/dist/screen/components/ScreenMount.d.ts +7 -6
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.d.ts +7 -6
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +15 -15
- package/dist/screen/components/SidePanelHead.js +1 -1
- package/dist/screen/components/panel-widths.js +1 -1
- package/dist/screen/components/usePartBridge.d.ts +7 -6
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.d.ts +8 -7
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/admin-bridge.d.ts +3 -2
- package/dist/screen/lib/document-addressing.d.ts +4 -3
- package/dist/screen/lib/document-hooks.d.ts +2 -2
- package/dist/screen/lib/host-chrome.d.ts +0 -10
- package/dist/screen/lib/host.d.ts +4 -3
- package/dist/screen/lib/key-scope.js +1 -1
- package/dist/screen/lib/media-panel.d.ts +4 -3
- package/dist/screen/lib/media-picker.d.ts +7 -9
- package/dist/screen/lib/page-lock.d.ts +3 -2
- package/dist/screen/lib/puck/block-choice.d.ts +13 -1
- package/dist/screen/lib/puck/block-choice.js +1 -1
- package/dist/screen/lib/puck/device-fields.js +1 -1
- package/dist/screen/lib/puck/palette-sections.d.ts +2 -2
- package/dist/screen/lib/puck/section-doc.d.ts +2 -2
- package/dist/screen/lib/puck/slot-child-name.js +1 -1
- package/dist/screen/lib/puck/style-clipboard.d.ts +7 -6
- package/dist/screen/lib/puck/style-clipboard.js +1 -1
- package/dist/screen/lib/puck/use-section-ops.d.ts +2 -2
- package/dist/screen/lib/puck/use-section-ops.js +1 -1
- package/dist/screen/lib/save-status.d.ts +2 -2
- package/dist/screen/lib/screen-parts.d.ts +71 -29
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/screen/lib/section-templates.d.ts +3 -2
- package/dist/screen/lib/session-context.d.ts +3 -2
- package/dist/screen/lib/session.d.ts +6 -2
- package/dist/screen/lib/shared-section-types.d.ts +71 -0
- package/dist/screen/lib/shared-section-types.js +1 -0
- package/dist/screen/lib/shared-sections.d.ts +34 -0
- package/dist/screen/lib/shared-sections.js +1 -0
- package/dist/screen/screen.css +7 -0
- package/dist/screen/words.d.ts +49 -3
- package/dist/screen/words.js +1 -1
- package/dist/shell/shell.css +6 -1
- package/dist/strings/index.d.ts +134 -20
- package/dist/strings/index.js +2 -2
- package/dist/text-styles/index.js +23 -23
- package/dist/tree/index.d.ts +3 -3
- package/dist/tree/index.js +1 -1
- package/dist/tree/tree.css +17 -0
- package/dist/{types-D8P9q-BG.d.ts → types-Bqq6ya0y.d.ts} +9 -0
- package/dist/{types-NQozKWEz.d.ts → types-Cq53lL8d.d.ts} +1 -1
- package/dist/{types-CsgMwHHa.d.ts → types-Cy7rdmXt.d.ts} +1 -1
- package/dist/{types-DGyDHiJV.d.ts → types-DT8ywrFQ.d.ts} +1 -1
- package/dist/{useNodeOps-BHRkUFfG.d.ts → useNodeOps-fIDWzftn.d.ts} +3 -1
- package/dist/{words-pgIK0I6g.d.ts → words-DkWcK1rh.d.ts} +2 -2
- package/package.json +16 -43
- package/dist/chunk-44COUKXO.js +0 -5
- package/dist/chunk-4BGYVIDQ.js +0 -57
- package/dist/chunk-4JSBIW5H.js +0 -9
- package/dist/chunk-ECM5F6JJ.js +0 -1
- package/dist/chunk-H4UMY7QF.js +0 -13
- package/dist/chunk-HMXIAMCU.js +0 -1
- package/dist/chunk-HQ4VVRIC.js +0 -1
- package/dist/chunk-IN22IYOM.js +0 -1
- package/dist/chunk-L2VGRQ4R.js +0 -4
- package/dist/chunk-L3GSW4XI.js +0 -1
- package/dist/chunk-POSLNRTO.js +0 -18
- package/dist/chunk-QX7GVECM.js +0 -13
- package/dist/chunk-TBF5CVPA.js +0 -1
- package/dist/chunk-U25CP5VX.js +0 -5
- package/dist/chunk-VVPZMWJE.js +0 -1
- package/dist/chunk-ZZ64CEC2.js +0 -2
- package/dist/gold/index.d.ts +0 -283
- package/dist/gold/index.js +0 -1
- package/dist/icons/meanings.d.ts +0 -1
- package/dist/icons/meanings.js +0 -1
- package/dist/index.d.ts +0 -6
- package/dist/index.js +0 -1
- package/dist/markup/index.d.ts +0 -1
- package/dist/markup/index.js +0 -1
- package/dist/shell/index.d.ts +0 -195
- package/dist/shell/index.js +0 -1
- package/dist/strings/catalogue.d.ts +0 -139
- package/dist/strings/catalogue.js +0 -1
package/dist/copy/index.js
CHANGED
|
@@ -1,17 +1,29 @@
|
|
|
1
|
-
import{TEXT_STYLE_CASES as e}from"../chunk-YHZSBL2N.js";import{selectionToVisible as t,selectionToSource as n,richLayout as r,createHistory as l,colorRunOf as o,textRange as a,selectionBox as s,placeWindow as c,offsetOrigin as i,visibleArea as u,ColorWindow as d,markPress as p,pasteToMarkup as
|
|
1
|
+
import{TEXT_STYLE_CASES as e}from"../chunk-YHZSBL2N.js";import{selectionToVisible as t,selectionToSource as n,richLayout as r,createHistory as l,colorRunOf as o,textRange as a,selectionBox as s,placeWindow as c,offsetOrigin as i,visibleArea as u,ColorWindow as d,markPress as p,pasteToMarkup as h,richInput as m,editVisible as f,MARKUP_CLIPBOARD_TYPE as g,markupOfRange as y}from"../chunk-23VM4PMV.js";export{ColorWindow,MARKUP_CLIPBOARD_TYPE,TYPING_BURST_MS,colorRunOf,createHistory,editVisible,markupOfRange,newLine,pasteToMarkup,richInput,richLayout,selectionToSource,selectionToVisible,setBullet,startCanvasTyping,textMap,toSource,toSourceStart,toVisible}from"../chunk-23VM4PMV.js";import{DEFAULT_COPY_WORDS as v}from"../chunk-B4JN227A.js";import{FieldNumber as b}from"../chunk-2XMHLXMA.js";import{FieldSelect as k}from"../chunk-G3GWAP5R.js";import"../chunk-WRFD4EXD.js";import{SettingsSwitch as x,SettingsField as S,SettingsSegmented as w}from"../chunk-36LVP5WD.js";import{useWords as E}from"../chunk-MFIRYGHW.js";import{registerModalEscapeInterceptor as C,textToolbarRows as D,TextToolbar as N,LinkPicker as L,Tooltip as T,IconButton as O}from"efficient-shell/ui";export{TextToolbar}from"efficient-shell/ui";import{useRef as R,useState as K,useLayoutEffect as M,useEffect as P,useId as j}from"react";import{RETIRED_MARKS as B,applyMark as V,marksIn as F,STANDARD_MARKUP as H,listIn as W,colorIn as $,spanFor as z,findLink as I,tokenizeInline as q,colorOver as A,setList as U,unlinkAt as Y,removeLink as G,linkOver as _,writeLink as X}from"efficient-shell/markup";import{jsxs as Z,jsx as J,Fragment as Q}from"react/jsx-runtime";import{ParagraphSpacingIcon as ee,LetterSpacingIcon as te,LineSpacingIcon as ne,TextSizeIcon as re,AlignJustifyIcon as le,AlignRightIcon as oe,AlignCenterIcon as ae,AlignLeftIcon as se,StylesIcon as ce,TypeIcon as ie,AlignmentIcon as ue,ListFormatIcon as de,CaseIcon as pe,ItalicIcon as he,NumberedListIcon as me,ListIcon as fe,ListNoneIcon as ge,CaseLowerIcon as ye,CaseCapitalizedIcon as ve,CaseUpperIcon as be,CaseNormalIcon as ke}from"efficient-shell/icons/efficient";function xe(e,t,n,r,l){for(const o of l){if(o.kind!==n)continue;if(!e.startsWith(o.open,t))continue;const l=t+o.open.length;if(e.startsWith(r,l)&&e.startsWith(o.close,l+r.length))return o}return null}function Se({value:e,rules:t=H,className:n,layerRef:r}){const l=function(e,t){const n=[];let r=0;for(const l of q(e,t)){if("text"===l.kind){l.text.length>0&&(n.push({kind:"text",text:e.slice(r,r+l.text.length)}),r+=l.text.length);continue}const o=xe(e,r,l.kind,l.text,t);if(!o)return[{kind:"text",text:e}];const a=r+o.open.length,s=a+l.text.length,c=s+o.close.length;n.push({kind:"delimiter",text:e.slice(r,a)}),n.push({kind:l.kind,text:e.slice(a,s)}),n.push({kind:"delimiter",text:e.slice(s,c)}),r=c}return n.map(e=>e.text).join("")!==e?[{kind:"text",text:e}]:n}(e,t);/* @__PURE__ */
|
|
2
|
+
return J("div",{ref:r,className:["es-gold-layer",n??""].filter(Boolean).join(" "),"aria-hidden":"true",children:l.map((e,t)=>function(e,t){const{kind:n,text:r}=e;switch(n){case"delimiter":/* @__PURE__ */
|
|
3
|
+
return J("span",{className:"es-gold-delim",children:r},t);case"accent":case"highlight":/* @__PURE__ */
|
|
4
|
+
return J("em",{className:"es-gold-mark es-gold-accent",children:r},t);case"bold":/* @__PURE__ */
|
|
5
|
+
return J("strong",{className:"es-gold-mark es-gold-bold",children:r},t);case"italic":/* @__PURE__ */
|
|
6
|
+
return J("em",{className:"es-gold-mark es-gold-italic",children:r},t);case"strike":/* @__PURE__ */
|
|
7
|
+
return J("s",{className:"es-gold-mark es-gold-strike",children:r},t);case"quiet":/* @__PURE__ */
|
|
8
|
+
return J("span",{className:"es-gold-mark es-gold-quiet",children:r},t);default:/* @__PURE__ */
|
|
9
|
+
return J("span",{className:"es-gold-text",children:r},t)}}(e,t))})}function we({value:e,onInput:t,onCommit:n,onCancel:r,multiline:l=!1,placeholder:o,className:a,rules:s=H,ariaLabel:c,disabled:i=!1,inputRef:u}){const d=R(null),p=R(e),h=R(!1);function m(e){h.current&&(h.current=!1,n?.(e))}/* @__PURE__ */
|
|
10
|
+
return Z("div",{className:["es-gold",l?"es-gold-is-multiline":"es-gold-is-single",i?"es-gold-is-off":"",a??""].filter(Boolean).join(" "),children:[
|
|
11
|
+
/* @__PURE__ */J(Se,{value:e,rules:s,layerRef:d}),o&&""===e?
|
|
12
|
+
/* @__PURE__ */J("div",{className:"es-gold-placeholder","aria-hidden":"true",children:o}):null,
|
|
13
|
+
/* @__PURE__ */J("textarea",{ref:u,className:"es-gold-input",disabled:i,value:e,placeholder:o,"aria-label":c,onChange:function(e){h.current=!0,t(e.currentTarget.value)},onFocus:function(){p.current=e,h.current=!1},onBlur:function(){m(e)},onKeyDown:function(t){return"Escape"===t.key?(t.preventDefault(),h.current=!1,void r?.(p.current)):"Enter"!==t.key||l?void 0:(t.preventDefault(),void m(e))},onScroll:function(e){const t=d.current;t&&(t.scrollTop=e.currentTarget.scrollTop,t.scrollLeft=e.currentTarget.scrollLeft)}})]})}function Ee(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function Ce(e,t,n,r=V){const{start:l,end:o}=Ee(e,n);return r(e,l,o,t)}function De(e,t,n){const{start:r,end:l}=Ee(e,n),o=r+t.length;return{text:e.slice(0,r)+t+e.slice(l),selectionStart:o,selectionEnd:o}}function Ne(e,t,n,r){switch(t){case"bold":return e.createElement("strong");case"italic":return e.createElement("em");case"strike":return e.createElement("s");case"underline":return e.createElement("u");case"sup":return e.createElement("sup");case"sub":return e.createElement("sub");case"color":{const t=e.createElement("span");return t.className="es-rich-color",r&&(t.dataset.color=r,t.title=r.startsWith("#")?r.toUpperCase():r,t.style.color=r.startsWith("#")?r:`var(--es-color-${r}, inherit)`),t}case"link":{const t=e.createElement("a");return t.className="es-rich-link",n&&(t.title=n),t}default:{const n=e.createElement("span");return n.className="highlight"===t||"accent"===t?"es-rich-emphasis":`es-rich-${t}`,n}}}function Le(e,t,n,r){const l=e.layout.lines;if(n===t)return r>=e.lines.length?e.layout.text.length:l[r].vis;const o=e.lines.findIndex(e=>e===n||e.contains(n));if(-1===o)return 0;const a=t.ownerDocument.createRange();a.setStart(e.lines[o],0);try{a.setEnd(n,r)}catch{return l[o].vis}return l[o].vis+Math.min(a.toString().length,l[o].text.length)}function Te(e,t){const n=e.layout.lines;let r=n.length-1;for(let e=0;e<n.length;e+=1)if(t<=n[e].vis+n[e].text.length){r=e;break}let l=Math.max(0,t-n[r].vis);const o=e.lines[r].ownerDocument.createTreeWalker(e.lines[r],4);let a=o.nextNode(),s=null;for(;a;){if(l<=a.data.length)return[a,l];l-=a.data.length,s=a,a=o.nextNode()}return s?[s,s.data.length]:[e.lines[r],0]}function Oe({value:e,rules:l,multiline:o,readOnly:a=!1,placeholder:s,ariaLabel:c,handle:i,onEdit:u,onSelect:d,onHistory:p,onFormat:v,pending:b,onCommit:k,onCancel:x}){const S=R(null),w=R(null),E=R(null),C=R(null),D=R(null),N=R(e),[L,T]=K(0),O=R({value:e,rules:l,multiline:o,readOnly:a,pending:b,onEdit:u,onHistory:p,onFormat:v});O.current={value:e,rules:l,multiline:o,readOnly:a,pending:b,onEdit:u,onHistory:p,onFormat:v};const j=()=>{const e=S.current,t=w.current,n=e?.ownerDocument.getSelection();if(!(e&&t&&n&&0!==n.rangeCount&&n.anchorNode&&e.contains(n.anchorNode)))return null;const r=Le(t,e,n.anchorNode,n.anchorOffset),l=n.focusNode&&e.contains(n.focusNode)?Le(t,e,n.focusNode,n.focusOffset):r;return r<=l?[r,l]:[l,r]},B=(e,t)=>{const n=S.current,r=w.current;if(!n||!r)return;const[l,o]=Te(r,e),[a,s]=Te(r,t);n.ownerDocument.getSelection()?.setBaseAndExtent(l,o,a,s)};i.current={getSource(){const e=j(),t=w.current;if(!e||!t)return null;const[r,l]=n(t.layout,e[0],e[1]);return{start:r,end:l}},setSource(e,t,n){C.current={text:n,src:[e,t]},T(e=>e+1)},focus(){S.current?.focus()},rangeOf(e,n){const r=S.current,l=w.current;if(!r||!l)return null;const[o,a]=t(l.layout,e,n),[s,c]=Te(l,o),[i,u]=Te(l,a),d=r.ownerDocument.createRange();return d.setStart(s,c),d.setEnd(i,u),d}},M(()=>{const n=S.current;if(!n||D.current)return;const o=C.current?null:j();w.current=function(e,t){const n=e.ownerDocument;e.replaceChildren();const r=t.lines.map(t=>{const r=n.createElement("div");r.className=null!=t.number?"es-rich-line is-numbered":t.bullet?"es-rich-line is-bullet":"es-rich-line",null!=t.number&&(r.dataset.number=t.number);const l=[],o=()=>l.length?l[l.length-1].el:r;let a=null;for(const e of t.chars){let t=0;for(;t<l.length&&t<e.marks.length&&l[t].id===e.marks[t].id;)t+=1;(l.length>t||e.marks.length>t)&&(a=null),l.length=t;for(let r=t;r<e.marks.length;r+=1){const t=Ne(n,e.marks[r].kind,e.marks[r].href,e.marks[r].color);o().appendChild(t),l.push({id:e.marks[r].id,el:t})}a||(a=n.createTextNode(""),o().appendChild(a)),a.data+=e.ch}return 0===t.chars.length&&r.appendChild(n.createElement("br")),e.appendChild(r),r});return{layout:t,lines:r}}(n,r(e,l)),E.current=e;const a=C.current;if(!a||a.text!==e)return void(o&&n.ownerDocument.activeElement===n&&B(o[0],Math.min(o[1],w.current.layout.text.length)));C.current=null;const s=w.current.layout,[c,i]=a.vis??t(s,a.src[0],a.src[1]);n.ownerDocument.activeElement!==n&&n.focus(),B(c,i)},[e,l,L]);const V=(e,t,r)=>{const l=w.current,[o,a]=n(l.layout,t[0],t[1]);C.current={text:e.text,vis:[e.caret,e.caret]},e.text!==O.current.value?O.current.onEdit(e.text,{start:o,end:a},r):T(e=>e+1)};P(()=>{const e=S.current;if(!e)return;const t=t=>{const{value:n,rules:r,multiline:l,readOnly:o,pending:a}=O.current;if("insertCompositionText"===t.inputType)return;if(t.preventDefault(),o)return;const s=w.current,c=j();if(!s||!c)return;const i="function"==typeof t.getTargetRanges?t.getTargetRanges()[0]:void 0,u=i&&!i.collapsed?[Le(s,e,i.startContainer,i.startOffset),Le(s,e,i.endContainer,i.endOffset)]:null,d=m({value:n,rules:r,multiline:l,inputType:t.inputType,data:t.data??t.dataTransfer?.getData("text/plain")??"",html:t.dataTransfer?.getData("text/html"),doc:e.ownerDocument,sel:c,target:u,pending:a});d&&("history"!==d.kind?"format"!==d.kind?V(d.edit,d.range,d.kind):O.current.onFormat(d.style):O.current.onHistory(d.dir))},n=()=>{D.current||T(e=>e+1)};return e.addEventListener("beforeinput",t),e.addEventListener("input",n),()=>{e.removeEventListener("beforeinput",t),e.removeEventListener("input",n)}},[]),P(()=>{const e=S.current;if(!e)return;const t=e.ownerDocument,n=()=>{const e=i.current?.getSource();e&&d(e)};return t.addEventListener("selectionchange",n),()=>t.removeEventListener("selectionchange",n)});const F=(t,n=!1)=>{const r=j();if(!r||r[0]===r[1])return;t.preventDefault();const o=w.current;t.clipboardData.setData("text/plain",o.layout.text.slice(r[0],r[1])),t.clipboardData.setData(g,y(e,l,r[0],r[1])),n&&!a&&V(f(e,l,r[0],r[1],{text:""}),r,"edit")};/* @__PURE__ */
|
|
2
14
|
return Z("div",{className:"es-rich-wrap",children:[s&&""===e?/* @__PURE__ */J("div",{className:"es-rich-placeholder","aria-hidden":"true",children:s}):null,
|
|
3
|
-
/* @__PURE__ */J("div",{ref:
|
|
15
|
+
/* @__PURE__ */J("div",{ref:S,className:`es-rich${o?" is-multiline":" is-single"}${a?" is-off":""}`,contentEditable:!a,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":o,"aria-label":c,"aria-readonly":a||void 0,"aria-placeholder":s,tabIndex:a?-1:0,spellCheck:!0,onFocus:()=>{N.current=e},onBlur:()=>{e!==N.current&&k?.(e),N.current=e},onKeyDown:t=>{if("Escape"===t.key)return t.preventDefault(),x?.(N.current),void(N.current=e);"Enter"!==t.key||o||(t.preventDefault(),e!==N.current&&k?.(e),N.current=e)},onCompositionStart:()=>{const e=j()??[0,0];D.current={from:e[0],to:e[1]}},onCompositionEnd:e=>{const t=D.current;if(D.current=null,!t)return;const{value:n,rules:r,pending:l}=O.current;e.data?V(f(n,r,t.from,t.to,{text:e.data,add:l?.add,drop:l?.drop,color:l?.color}),[t.from,t.to],"type"):T(e=>e+1)},onCopy:e=>F(e),onCut:e=>F(e,!0),onPaste:t=>{if(t.preventDefault(),a)return;const n=j();if(!n)return;const r=t.clipboardData.getData(g),s=r?o?r:r.replace(/\s*\r?\n\s*/g," "):h({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:t.currentTarget.ownerDocument,multiline:o,rules:l});V(f(e,l,n[0],n[1],{markup:s}),n,"edit")}})]})}var Re={fontSize:{key:"fontSize",nameKey:"fontSize",icon:/* @__PURE__ */J(re,{}),unit:"px",step:1,shiftStep:10,min:5},lineHeight:{key:"lineHeight",nameKey:"lineHeight",icon:/* @__PURE__ */J(ne,{}),unit:"%",step:1,shiftStep:10,min:50,max:250,scale:100},letterSpacing:{key:"letterSpacing",nameKey:"letterSpacing",icon:/* @__PURE__ */J(te,{}),unit:"px",step:.1,shiftStep:1,min:-10},paragraphSpacing:{key:"paragraphSpacing",nameKey:"paragraphSpacing",icon:/* @__PURE__ */J(ee,{}),unit:"px",step:1,shiftStep:10,min:0}};function Ke(e,t){return void 0===e?void 0:Number((e*t).toFixed(6))}function Me({cells:e,words:t,readOnly:n=!1}){const r=t??v.cells,l=j();/* @__PURE__ */
|
|
4
16
|
return J("div",{className:"es-copy-cells-fit",children:/* @__PURE__ */J("div",{className:"es-copy-cells",children:e.map(e=>{const t=e.scale??1,o=e.name??(e.nameKey?r[e.nameKey]:e.key),a=e.unit??"",s=e.step??1,c=`${l}-${e.key}`;/* @__PURE__ */
|
|
5
17
|
return Z("div",{className:"es-copy-cell",children:[
|
|
6
18
|
/* @__PURE__ */J("label",{className:"es-field-label es-copy-cell-name",htmlFor:c,children:o}),
|
|
7
|
-
/* @__PURE__ */J(b,{id:c,value:
|
|
8
|
-
return Z("div",{ref:lt,className:"es-copy"+(y?` ${y}`:""),onFocus:()=>he(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||he(!1)},onKeyDown:e=>{const t=e.target===
|
|
9
|
-
/* @__PURE__ */J(
|
|
19
|
+
/* @__PURE__ */J(b,{id:c,value:Ke(e.value,t),styleValue:Ke(e.styleValue,t),onChange:n=>e.onChange(void 0===n?void 0:Number((n/t).toFixed(6))),min:e.min,max:e.max,step:s,shiftStep:e.shiftStep,icon:e.icon,unit:a||void 0,steppers:"compact",readOnly:n,ariaLabel:o,title:r.tip({name:o,step:s,unit:a})})]},e.key)})})})}function Pe({target:e,onChange:t}){const n=R(null);return M(()=>{const t=n.current,r=e.current;t&&r&&r.value===t.text&&(n.current=null,r.focus(),r.setSelectionRange(t.start,t.end))}),r=>{const l=r(e.current);t(l.text),n.current={start:l.selectionStart,end:l.selectionEnd,text:l.text}}}var je=/* @__PURE__ */new Set([...B,"clear"]);function Be({value:e,onChange:t,onCommit:n,onCancel:r,multiline:m=!1,placeholder:f,ariaLabel:g,className:y,readOnly:b=!1,rules:k,tools:S=[],writeMark:w,align:T,actions:O,toolbar:B,barLabel:q,renderFooter:ee,inputRef:te,barShows:ne="always",richText:re=!0,defaultShowMarks:le=!1,colors:oe,cells:ae,letterCase:se,lastTool:ce}){const ie=E("copy",v),ue=R(null),de=te??ue,[pe,he]=K(!1),[me,fe]=K(null),ge=R(l()).current,ye=R(null);P(()=>{const t=ye.current;t&&e===t.to?ye.current=null:t&&e===t.from||(ye.current=null,ge.reset())},[e,ge]);const ve=n=>{ye.current={from:ye.current?.from??e,to:n},t(n)},be=t=>({text:e,start:t?.selectionStart??me?.start??e.length,end:t?.selectionEnd??me?.end??e.length}),[ke,xe]=K(le),Se=re&&!(m&&ke),Ee=R(null),Ne=j(),[Le,Te]=K(null),[Re,Ke]=K(!1),Be=()=>{if(!Se)return de.current;const e=Ee.current?.getSource()??me;return e?{selectionStart:e.start,selectionEnd:e.end}:null},Ve=Pe({target:de,onChange:ve}),Fe=e=>(fe({start:e.selectionStart,end:e.selectionEnd}),e),He=(t,n)=>{if(!Se)return void Ve(e=>(n&&ge.record(be(e),"edit",Date.now()),Fe(t(e))));const r=Be(),l=Fe(t(r));n&&ge.record(be(r),"edit",Date.now()),Te(null),l.text!==e&&ve(l.text),Ee.current?.setSource(l.selectionStart,l.selectionEnd,l.text)},We=e=>He(e,!0),$e=e=>He(t=>{const n=be(t),r=ge[e](n);return r?{text:r.text,selectionStart:r.start,selectionEnd:r.end}:{text:n.text,selectionStart:n.start,selectionEnd:n.end}},!1),ze=R(null);M(()=>{const t=ze.current;t&&(ze.current=null,Se?Ee.current?.setSource(t.start,t.end,e):(de.current?.focus(),de.current?.setSelectionRange(t.start,t.end),fe(t)))},[Se]);const[Ie,qe]=K(null),Ae=k??H,Ue=("string"==typeof S[0]?S:S.map(e=>e.style)).filter(e=>!je.has(e)),Ye={};if(me){const t=F(e,me.start,me.end,Ae);for(const e of Ue){const n=t.has(e)||"highlight"===e&&t.has("accent");Ye[e]=!!Le?.add.includes(e)||!Le?.drop.includes(e)&&n}Ye.link=t.has("link")}const Ge=()=>{const t=Be(),n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}},_e=t=>{if("link"!==t&&z(0,t)){const{start:n,end:r}=Ge();if(n===r&&!Se)return void We(n=>Ce(e,t,n,(e,t,n,r)=>V(e,t,n,r,Ae,ie.placeholders)));const l=p({value:e,rules:Ae,start:n,end:r,style:t,pending:Le});return void("pending"===l.kind?Te(l.pending):We(()=>l.result))}if("link"!==t){const n=w??((e,t,n,r)=>V(e,t,n,r,H,ie.placeholders));return void We(r=>Ce(e,t,r,n))}const n=Be(),r=n?.selectionStart??e.length,l=n?.selectionEnd??r;Ke(!1),qe({start:r,end:l,link:I(e,r,l)})},Xe=Boolean(me&&me.start!==me.end),Ze=me?W(e,me.start,me.end,Ae):null,Je=me?Le&&void 0!==Le.color&&Le.at===me.start?Le.color:$(e,me.start,me.end,Ae):null,Qe=o(Je,oe),et=t=>{Se?t?Ee.current?.setSource(t.start,t.end,e):Ee.current?.focus():(de.current?.focus(),t&&de.current?.setSelectionRange(t.start,t.end))},tt=()=>{const e=Ie;qe(null),et(e?{start:e.start,end:e.end}:me)},nt=()=>{const e=lt.current,t=Boolean(e&&e.querySelector(".es-copy-colors")?.contains(e.ownerDocument.activeElement));Ke(!1),t&&et(me)},rt=R(nt);rt.current=nt,P(()=>{if(Re)return C(e=>{const t=lt.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(rt.current(),!0)},()=>lt.current?.querySelector(".es-copy-colors"))},[Re]);const lt=R(null),ot=Re||null!==Ie;P(()=>{const e=lt.current;if(!ot||!e)return;const t=e.ownerDocument,n=()=>{Ke(!1),qe(null)},r=t=>{e.contains(t.target)||n()};let l;const o=r=>{const o=r.relatedTarget;o?e.contains(o)||n():(clearTimeout(l),l=setTimeout(()=>{const r=t.activeElement;t.hasFocus()&&r&&r!==t.body&&!e.contains(r)&&n()},0))};return t.addEventListener("pointerdown",r,!0),e.addEventListener("focusout",o),()=>{clearTimeout(l),t.removeEventListener("pointerdown",r,!0),e.removeEventListener("focusout",o)}},[ot]);const at=Ie??(Re?me??{start:e.length,end:e.length}:null),st=R(()=>{});st.current=()=>{const e=lt.current,t=e?.querySelector(".rosh-tb-wrap > .es-copy-pop");if(!e||!t||!at)return;const n=Se?null:e.querySelector(".es-gold-layer"),r=Se?Ee.current?.rangeOf(at.start,at.end)??null:n?a(n,at.start,at.end):null,l=r?.endContainer,o=l?1===l.nodeType?l:l.parentElement:null,d=r?s(r,o?.closest(".es-rich-line, .es-gold-layer")??null):null;if(!d)return;const p=c({anchor:d,size:{width:t.offsetWidth,height:t.offsetHeight},within:e.getBoundingClientRect(),clip:u(e),parent:i(t)});t.style.top=`${p.top}px`,t.style.left=`${p.left}px`,t.style.setProperty("--es-pop-point",`${p.point}px`),t.dataset.side=p.above?"above":"below"},M(()=>{const e=lt.current;if(!ot||!e)return;const t=()=>st.current();t();const n=e.ownerDocument.defaultView;n?.addEventListener("resize",t);const r=e.querySelector(".rosh-tb-wrap > .es-copy-pop"),l=n?.ResizeObserver,o=l&&r?new l(t):null;return o&&r&&o.observe(r),()=>{n?.removeEventListener("resize",t),o?.disconnect()}},[ot,Re,Ie,at?.start,at?.end,Se]);const ct="always"===ne||pe||null!==Ie||Re,it=oe&&oe.length>0?{run:Qe,open:Re,onToggle:()=>{qe(null),Re?nt():Ke(!0)}}:void 0,ut=ct?ce?ce({className:"rosh-tb-btn",disabled:b,selected:Xe,keepCaret:e=>e.preventDefault(),insert:t=>We(n=>De(e,t,n))}):"classic"===B?O:void 0:void 0,dt=new Set(Ue),pt=T?{value:T.value,allow:T.allow,onChange:T.onChange,disabled:T.disabled}:void 0,ht={pressed:Ze,onList:t=>{const{start:n,end:r}=Ge(),l=W(e,n,r,Ae);We(()=>U(e,n,r,l===t?null:t,Ae))}},mt=D({offered:dt,color:it,last:ut,alignment:pt,list:ht,letterCase:se});/* @__PURE__ */
|
|
20
|
+
return Z("div",{ref:lt,className:"es-copy"+(y?` ${y}`:""),onFocus:()=>he(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||he(!1)},onKeyDown:e=>{const t=e.target===de.current||Boolean(e.target.closest?.(".es-rich"));if(b||!t)return;if(e.altKey||e.metaKey===e.ctrlKey)return;const n=e.key.toLowerCase(),r="KeyZ"===e.code||"z"===n,l=("KeyY"===e.code||"y"===n)&&!e.shiftKey;if(r||l)return e.preventDefault(),e.stopPropagation(),void $e(l||e.shiftKey?"redo":"undo");const o={b:"bold",i:"italic",u:"underline",k:"link"}[`${e.shiftKey?"shift+":""}${n}`];o&&Ue.includes(o)&&(e.preventDefault(),e.stopPropagation(),_e(o))},onPaste:t=>{const n=de.current;if(b||!n||t.target!==n)return;t.preventDefault();const r=h({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:n.ownerDocument,multiline:m,rules:Ae});We(t=>De(e,r,t))},style:oe&&oe.length>0?Object.fromEntries(oe.map(e=>[`--es-color-${e.name}`,e.value])):void 0,onSelect:()=>{const t=de.current;t&&t.ownerDocument.activeElement===t&&fe({start:t.selectionStart??e.length,end:t.selectionEnd??e.length})},children:[ct&&(mt.words||mt.paragraph)?
|
|
21
|
+
/* @__PURE__ */J(N,{className:"es-copy-toolbar","aria-label":q??ie.formatting,offered:dt,pressed:Ye,onMark:e=>_e(e),color:it,linkOpen:null!==Ie,last:ut,alignment:pt,list:ht,letterCase:se,disabled:b,windows:/* @__PURE__ */Z(Q,{children:[Re&&oe&&oe.length>0?/* @__PURE__ */J(d,{colors:oe,current:Je,words:ie.colors??v.colors,onPick:t=>{const{start:n,end:r}=Ge();if(n!==r)We(()=>A(e,n,r,t,Ae));else{if(!Se)return;Te({add:Le?.add??[],drop:Le?.drop??[],color:t,at:n})}}}):null,Ie?Ie&&/* @__PURE__ */J(L,{className:"es-copy-link es-copy-pop",value:Ie.link?.href??"",onApply:t=>{const n=Ie;qe(null),We(()=>Se?_(e,n.start,n.end,t,Ae):X(e,n.start,n.end,t))},onRemove:Ie.link?()=>{const t=Ie.link,n=Ie;qe(null),t&&We(()=>Se?Y(e,n.start,n.end,Ae):G(e,t))}:void 0,onCancel:tt}):null]})}):null,ae&&ae.length>0?/* @__PURE__ */J(Me,{cells:ae,words:ie.cells??v.cells,readOnly:b}):null,Se?/* @__PURE__ */J(Oe,{value:e,rules:Ae,multiline:m,readOnly:b,placeholder:f,ariaLabel:g,handle:Ee,pending:Le??void 0,onEdit:(t,n,r)=>{ge.record({text:e,start:n.start,end:n.end},r,Date.now()),Te(null),ve(t)},onSelect:e=>{fe(t=>t&&t.start===e.start&&t.end===e.end?t:e),!Le||e.start===Le.at&&e.end===Le.at||Te(null)},onHistory:$e,onFormat:e=>{Ue.includes(e)&&_e(e)},onCommit:n,onCancel:r}):/* @__PURE__ */J(we,{value:e,onInput:e=>{ge.record(be(null),"type",Date.now()),ve(e)},onCommit:n,onCancel:r,multiline:m,placeholder:f,ariaLabel:g,rules:k,disabled:b,inputRef:de,className:"es-copy-box"}),ee?ee({focused:pe,insert:t=>We(n=>De(e,t,n))}):null,re&&m?
|
|
10
22
|
/* @__PURE__ */Z("div",{className:"es-copy-marks",children:[
|
|
11
|
-
/* @__PURE__ */J(
|
|
12
|
-
/* @__PURE__ */J("span",{id:
|
|
13
|
-
return J(
|
|
23
|
+
/* @__PURE__ */J(x,{checked:ke,onChange:()=>{const e=Be();ze.current=e&&null!==e.selectionStart&&null!==e.selectionEnd?{start:e.selectionStart,end:e.selectionEnd}:me,Te(null),xe(e=>!e)},ariaLabelledBy:Ne,disabled:b}),
|
|
24
|
+
/* @__PURE__ */J("span",{id:Ne,className:"es-copy-marks-label",children:ie.showMarks??"Show marks"})]}):null]})}var Ve=["left","center","right","justify"],Fe=v.align,He={left:/* @__PURE__ */J(se,{}),center:/* @__PURE__ */J(ae,{}),right:/* @__PURE__ */J(oe,{}),justify:/* @__PURE__ */J(le,{})},We={three:{labelsPx:94.5,widestLabelPx:39.94},four:{labelsPx:140,widestLabelPx:44}};function $e(e,t=Fe){return Ve.filter(t=>e.includes(t)).map(e=>({id:e,label:t[e],icon:He[e],title:t[e]}))}var ze=["none","bullet","number"],Ie=e,qe={none:/* @__PURE__ */J(ge,{}),bullet:/* @__PURE__ */J(fe,{}),number:/* @__PURE__ */J(me,{})},Ae={none:/* @__PURE__ */J(ke,{}),upper:/* @__PURE__ */J(be,{}),capitalize:/* @__PURE__ */J(ve,{}),lower:/* @__PURE__ */J(ye,{})};function Ue({label:e,icon:t,answers:n,names:r,glyphs:l,row:o,readOnly:a}){const s=o.value||o.styleValue||"";/* @__PURE__ */
|
|
25
|
+
return J(S,{label:e,icon:t,children:/* @__PURE__ */J(w,{ariaLabel:e,value:s,disabled:a,onChange:e=>{a||o.onChange(function(e,t){return t===e.value||""===e.value&&t===e.styleValue?"":t}(o,e))},options:n.map(e=>({id:e,label:l[e],title:r[e]}))})})}function Ye({kept:e,keptHint:t,readOnly:n=!1,style:r,font:l,italic:o,cells:a,align:s,list:c,letterCase:i}){const u=E("copy",v),d={...v.panel,...u.panel},p=r&&!n?[r.onEditStyles&&{label:d.editStyles,onSelect:r.onEditStyles},r.onUpdateStyle&&{label:d.updateStyle,onSelect:r.onUpdateStyle}].filter(e=>!!e):[],h=!!o&&(o.value??o.styleValue??!1),m=o?/* @__PURE__ */J(T,{content:d.italic,children:/* @__PURE__ */J(O,{size:"sm",variant:"ghost","aria-label":d.italic,"aria-pressed":h,disabled:n,onClick:()=>{if(n)return;const e=!h;o.onChange(e===(o.styleValue??!1)?void 0:e)},children:/* @__PURE__ */J(he,{})})}):null;/* @__PURE__ */
|
|
14
26
|
return Z("div",{className:"es-tpp",children:[e?/* @__PURE__ */Z("div",{className:"es-tpp-kept",children:[
|
|
15
|
-
/* @__PURE__ */J(
|
|
16
|
-
/* @__PURE__ */J("div",{className:"es-tpp-font-select",children:/* @__PURE__ */J(
|
|
17
|
-
/* @__PURE__ */J(
|
|
27
|
+
/* @__PURE__ */J(Be,{...e,readOnly:n||e.readOnly}),t?/* @__PURE__ */J("p",{className:"es-field-hint",children:t}):null]}):null,r?/* @__PURE__ */J(S,{label:d.style,icon:/* @__PURE__ */J(ce,{}),children:/* @__PURE__ */J(k,{ariaLabel:d.style,value:r.value,options:r.options,onChange:r.onChange,changed:r.changed,footer:p,readOnly:n})}):null,l?/* @__PURE__ */J(S,{label:d.font,icon:/* @__PURE__ */J(ie,{}),children:/* @__PURE__ */Z("div",{className:"es-tpp-font",children:[
|
|
28
|
+
/* @__PURE__ */J("div",{className:"es-tpp-font-select",children:/* @__PURE__ */J(k,{ariaLabel:d.font,value:l.value||void 0,placeholder:l.styleValue,options:l.options,onChange:l.onChange,searchable:l.searchable,readOnly:n})}),m]})}):m?
|
|
29
|
+
/* @__PURE__ */J(S,{label:d.italic,icon:/* @__PURE__ */J(ie,{}),children:/* @__PURE__ */J("div",{className:"es-tpp-font",children:m})}):null,a?.length?/* @__PURE__ */J(Me,{cells:a,words:u.cells,readOnly:n}):null,s?/* @__PURE__ */J(Ue,{label:u.alignment,icon:/* @__PURE__ */J(ue,{}),answers:Ve.filter(e=>!s.allow||s.allow.includes(e)),names:u.align,glyphs:He,row:s,readOnly:n}):null,c?/* @__PURE__ */J(Ue,{label:d.list,icon:/* @__PURE__ */J(de,{}),answers:ze,names:d.lists,glyphs:qe,row:c,readOnly:n}):null,i?/* @__PURE__ */J(Ue,{label:d.capitalization,icon:/* @__PURE__ */J(pe,{}),answers:Ie,names:d.cases,glyphs:Ae,row:i,readOnly:n}):null]})}export{Ve as COPY_ALIGNS,We as COPY_ALIGN_FIT,He as COPY_ALIGN_GLYPHS,Fe as COPY_ALIGN_LABELS,Re as COPY_CELLS,Be as CopyBox,Me as CopyCells,Oe as RichBox,Ye as TextPartPanel,$e as copyAlignOptions,De as insertSelection,Ce as markSelection,Pe as useCaretEdit};
|
package/dist/drag/drag.css
CHANGED
|
@@ -401,6 +401,14 @@
|
|
|
401
401
|
.es-add-tile.has-cover .es-add-tile-label {
|
|
402
402
|
padding: 0 2px;
|
|
403
403
|
}
|
|
404
|
+
/* A tile's mark after its name (`AddTile.mark`): a shared section's, in the
|
|
405
|
+
shell's success ink, as its Layers row is (Shared section design v4). */
|
|
406
|
+
.es-add-tile-mark {
|
|
407
|
+
display: inline-flex;
|
|
408
|
+
vertical-align: middle;
|
|
409
|
+
margin-left: 4px;
|
|
410
|
+
color: var(--status-success-soft-ink);
|
|
411
|
+
}
|
|
404
412
|
.es-add-empty {
|
|
405
413
|
display: flex;
|
|
406
414
|
flex-direction: column;
|
package/dist/drag/index.d.ts
CHANGED
|
@@ -200,6 +200,9 @@ type AddTile = {
|
|
|
200
200
|
/** Why, in the host's words ("A page has one header"): a disabled tile's
|
|
201
201
|
* tooltip, in place of "Add …". Left out, a disabled tile has none. */
|
|
202
202
|
disabledReason?: string;
|
|
203
|
+
/** A glyph after the caption — a shared section's mark. A picture of what
|
|
204
|
+
* the tile IS: its words are the tile's `title`. */
|
|
205
|
+
mark?: ReactNode;
|
|
203
206
|
};
|
|
204
207
|
/**
|
|
205
208
|
* One headed group of tiles.
|
|
@@ -234,6 +237,17 @@ type AddPanelProps<I> = {
|
|
|
234
237
|
label: string;
|
|
235
238
|
onClear: () => void;
|
|
236
239
|
};
|
|
240
|
+
/**
|
|
241
|
+
* A tile's own menu: a right-click on it (or the menu key while it has the
|
|
242
|
+
* focus) asks the host, with the tile's type and the point, and the host
|
|
243
|
+
* draws its menu there. A host answers only for the tiles it has rows for;
|
|
244
|
+
* the browser's own menu is held back only when it does. Left out: none.
|
|
245
|
+
*/
|
|
246
|
+
onTileMenu?: (type: string, at: {
|
|
247
|
+
x: number;
|
|
248
|
+
y: number;
|
|
249
|
+
owner: Element;
|
|
250
|
+
}) => boolean;
|
|
237
251
|
/** The line under the title. Default "Drag onto the page." */
|
|
238
252
|
hint?: string;
|
|
239
253
|
/** The search field's name. Default "Search blocks". */
|
|
@@ -247,7 +261,7 @@ type AddPanelProps<I> = {
|
|
|
247
261
|
*/
|
|
248
262
|
words?: DragWords['add'];
|
|
249
263
|
};
|
|
250
|
-
declare function AddPanel<I>({ groups, session, itemFor, onInsert, at, hint: ownHint, searchLabel: ownSearchLabel, readOnly, words, }: AddPanelProps<I>): react.JSX.Element;
|
|
264
|
+
declare function AddPanel<I>({ groups, session, itemFor, onInsert, onTileMenu, at, hint: ownHint, searchLabel: ownSearchLabel, readOnly, words, }: AddPanelProps<I>): react.JSX.Element;
|
|
251
265
|
|
|
252
266
|
/**
|
|
253
267
|
* The effect a drop target names (second host, 2026-10-06).
|
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-LLDHIBYG.js";import"../chunk-KAML3KQH.js";export{AUTO_SCROLL_EDGE,AUTO_SCROLL_MAX_SPEED,autoScrollDelta,autoScrollSpeed,createDragSession,dropEffectFor,dropOnRow,frameScrollBox,gapToMoveIndex,isNoOpDrop,scrollBoxOf,scrollParent,startAutoScroll,stepGap,useTreeDrag}from"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-X4T6JT3M.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
|
package/dist/draw/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{UiIcon}from"../chunk-OG2SKSSK.js";export{PreviewPartsProvider,usePreviewParts}from"../chunk-I54UCYOU.js";export{createPreviewSelectionContext,useSelectHandler}from"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";
|
|
1
|
+
export{UiIcon}from"../chunk-OG2SKSSK.js";export{PreviewDeviceContext,usePreviewDevice}from"../chunk-BSPCSC45.js";export{PreviewPartsProvider,usePreviewParts}from"../chunk-I54UCYOU.js";export{createPreviewSelectionContext,useSelectHandler}from"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";
|
package/dist/draw/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SCALAR_TEXT_CONTROLS,TEXT_CONTROL_KINDS}from"../chunk-PIND6KE7.js";export{VIEW_DESKTOP_MIN,VIEW_TABLET_MIN,VIEW_TIERS,VIEW_TIER_LABEL,viewTierForWidth}from"../chunk-DWIOHQG7.js";export{
|
|
1
|
+
export{SCALAR_TEXT_CONTROLS,TEXT_CONTROL_KINDS}from"../chunk-PIND6KE7.js";export{VIEW_DESKTOP_MIN,VIEW_TABLET_MIN,VIEW_TIERS,VIEW_TIER_LABEL,viewTierForWidth}from"../chunk-DWIOHQG7.js";export{rootRowName,sectionRenameProp,slotChildName,slotChildRenameProp,slotChildRowName}from"../chunk-BHRC3ASL.js";export{hidableText,readHidable}from"../chunk-6W7WLPZH.js";export{HERO_SLIDER_GOTO_EVENT}from"../chunk-IQ5TA7AM.js";export{ANCHOR_FIELD_KEYS,FOLD_FIELD_MARKER,LINK_FIELD_MARKER,MEDIA_FIELD_MARKER,SCAFFOLD_FIELD_MARKER,TEXT_FIELD_MARKER,foldMetaOf,textFieldIdentifier}from"../chunk-DUVRZ456.js";export{PART_SEP,decodePartId,encodePartId}from"../chunk-IYT6NN2J.js";export{FOOTER_TYPE,HEADER_TYPE,ROOT_ZONE,TREE_MAX_DEPTH,blockNodeActions,childSlotsOf,locateNode,missingPinnedTypes,nestsInTree,newNodeId,pinnedDuplicateIds,pinnedDuplicateIndices,slotChildrenIn,slotFieldsOf}from"../chunk-PLVEGYK6.js";export{TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,isTextStyleCase,textStyleCaseCss,textStyleCaseOfCss}from"../chunk-YHZSBL2N.js";
|
package/dist/easel/easel.css
CHANGED
|
@@ -112,6 +112,14 @@
|
|
|
112
112
|
outline: 1px solid color-mix(in srgb, var(--es-canvas-outline-colour) 60%, transparent);
|
|
113
113
|
outline-offset: -1px;
|
|
114
114
|
}
|
|
115
|
+
/* A node many pages use live (`CanvasSharedContext`; Shared section design v4,
|
|
116
|
+
Lewis 2026-10-21): its selected and hover outlines in the shell's success
|
|
117
|
+
colour, as its Layers row and tab are. The frame holds the host's sheets,
|
|
118
|
+
and with them the shell's tokens; without them, the accent. No colour of
|
|
119
|
+
our own (harness UI-24). */
|
|
120
|
+
.es-canvas-outline.is-shared {
|
|
121
|
+
--es-canvas-outline-colour: var(--status-success-solid, var(--es-accent));
|
|
122
|
+
}
|
|
115
123
|
/* The words being typed (EaselCanvas `typing`, Lewis 2026-10-14): ONE plain
|
|
116
124
|
box round the whole words, like an input — a 2px line in the selection's
|
|
117
125
|
colour, 4px clear of them, with the selection outline's square corners. It
|
package/dist/easel/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DataInput } from '../data/index.js';
|
|
2
|
-
import { N as NodeSelection, P as PassThrough } from '../plan-
|
|
3
|
-
export { I as ItemSelector } from '../plan-
|
|
4
|
-
import { E as EaselConfig, a as EaselView, b as EaselAction, P as Permissions, c as EaselCore, d as EaselUi } from '../types-
|
|
5
|
-
export { A as AppState, e as EaselHistory, H as HistoryEntry, S as SetDataPatch } from '../types-
|
|
2
|
+
import { N as NodeSelection, P as PassThrough } from '../plan-CZS902DV.js';
|
|
3
|
+
export { I as ItemSelector } from '../plan-CZS902DV.js';
|
|
4
|
+
import { E as EaselConfig, a as EaselView, b as EaselAction, P as Permissions, c as EaselCore, d as EaselUi } from '../types-Cq53lL8d.js';
|
|
5
|
+
export { A as AppState, e as EaselHistory, H as HistoryEntry, S as SetDataPatch } from '../types-Cq53lL8d.js';
|
|
6
6
|
import { S as SlotAddress, D as Data, P as Place, N as Node } from '../types-41704JE4.js';
|
|
7
7
|
import { c as ResolveTrigger, a as ResolveCache, R as ResolvableItem } from '../resolve-D68pb3Bx.js';
|
|
8
8
|
import * as react from 'react';
|
|
@@ -10,7 +10,7 @@ import { ReactNode, CSSProperties, ComponentType, ReactElement } from 'react';
|
|
|
10
10
|
import { TextToolbarProps } from 'efficient-shell/ui';
|
|
11
11
|
import { C as CopyBoxLastTool, a as CopyThemeColor, b as CanvasTypingEnd } from '../canvas-typing-BsNigaCa.js';
|
|
12
12
|
import { InlineRule } from 'efficient-shell/markup';
|
|
13
|
-
import { b as NodeOpsHost, C as ClipboardEntry } from '../useNodeOps-
|
|
13
|
+
import { b as NodeOpsHost, C as ClipboardEntry } from '../useNodeOps-fIDWzftn.js';
|
|
14
14
|
import { I as InspectorFields } from '../types-CDX6vd6A.js';
|
|
15
15
|
import '../words-D-yhjdOg.js';
|
|
16
16
|
import '../buckets-Tj-nkBpg.js';
|
|
@@ -330,6 +330,44 @@ declare function EditDocument({ metadata }: {
|
|
|
330
330
|
* Absent: every container is a step, as before.
|
|
331
331
|
*/
|
|
332
332
|
declare const CanvasPassThroughContext: react.Context<PassThrough | undefined>;
|
|
333
|
+
/**
|
|
334
|
+
* THE NODES MANY PAGES USE LIVE (Shared section design v4, Lewis 2026-10-21):
|
|
335
|
+
* is the node with this id one of them? Its selected and its hover outline
|
|
336
|
+
* then carry `is-shared`, which easel.css draws in the success colour — green,
|
|
337
|
+
* as the shared node's Layers row and canvas tab are (Wix: "a global section
|
|
338
|
+
* has a green overlay when you hover over it"). The screen provides it round
|
|
339
|
+
* its canvas from the layer's `pinned.sharedReach`. Absent: no outline is.
|
|
340
|
+
*/
|
|
341
|
+
declare const CanvasSharedContext: react.Context<((id: string) => boolean) | undefined>;
|
|
342
|
+
/**
|
|
343
|
+
* A PART a host draws inside one of its blocks — a run of words, a picture —
|
|
344
|
+
* and where it is drawn.
|
|
345
|
+
*/
|
|
346
|
+
interface CanvasPart {
|
|
347
|
+
id: string;
|
|
348
|
+
element: Element;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* THE HOST'S PARTS ON THE CLICK CHAIN (W0, click-through plan 2026-10-12; card
|
|
352
|
+
* [MERGE] One Text Block And Click Through Parts). A host that lets a merchant
|
|
353
|
+
* select a part of a block says which part is under the pointer, and the canvas
|
|
354
|
+
* puts it on the chain after its block: one rule for the click, the hover
|
|
355
|
+
* outline and Escape (`clickPickPart`). Before this the website caught a click
|
|
356
|
+
* on its parts itself and stopped it, so the canvas never saw it.
|
|
357
|
+
*
|
|
358
|
+
* Absent: a click picks blocks only, as before.
|
|
359
|
+
*/
|
|
360
|
+
interface CanvasParts {
|
|
361
|
+
/** The part drawn at `target` that block `ownerId` OWNS, or null. Asked of
|
|
362
|
+
* the innermost block under the pointer only, so an outer block never
|
|
363
|
+
* claims an inner block's part. */
|
|
364
|
+
partAt(target: Element, ownerId: string): CanvasPart | null;
|
|
365
|
+
/** The part the host has selected now, or null. */
|
|
366
|
+
selected(): string | null;
|
|
367
|
+
/** Select `partId` (its block is already the selection), or let it go. */
|
|
368
|
+
select(partId: string | null): void;
|
|
369
|
+
}
|
|
370
|
+
declare const CanvasPartsContext: react.Context<CanvasParts | undefined>;
|
|
333
371
|
/** What a host may wrap an outline in — Puck's `componentOverlay`: render
|
|
334
372
|
* `children` to draw it, or nothing to hide it (a text part open on the
|
|
335
373
|
* block, say). */
|
|
@@ -492,6 +530,7 @@ declare function useEaselNodeOps(options?: Omit<NodeOpsHost, 'data' | 'config' |
|
|
|
492
530
|
cut: (id: string, label: string) => boolean;
|
|
493
531
|
paste: (at: Place) => boolean;
|
|
494
532
|
restore: (node: Node, at: Place) => boolean;
|
|
533
|
+
swap: (id: string, node: Node) => boolean;
|
|
495
534
|
parentOf: (selection: NodeSelection) => NodeSelection;
|
|
496
535
|
};
|
|
497
536
|
interface SelectedFields {
|
|
@@ -571,4 +610,4 @@ declare function bindUndoKeys(doc: Document, easel: Pick<Easel, 'undo' | 'redo'>
|
|
|
571
610
|
leaveTyping?: boolean;
|
|
572
611
|
}): () => void;
|
|
573
612
|
|
|
574
|
-
export { CanvasFrame, type CanvasFrameProps, type CanvasOverlay, CanvasPassThroughContext, type CanvasSlotProps, type CanvasTyping, type CanvasTypingState, type CanvasTypingTarget, DEFAULT_UI, type Easel, EaselAction, EaselCanvas, type EaselCanvasProps, EaselConfig, EaselCore, type EaselOptions, EaselProvider, type EaselProviderProps, EaselUi, EaselView, EditDocument, NodeSelection, Permissions, type SelectedFields, bindUndoKeys, createEasel, createUseEasel, recordsByDefault, reduce, uiView, useEasel, useEaselApi, useEaselNodeOps, useSelectedFields, validSelection };
|
|
613
|
+
export { CanvasFrame, type CanvasFrameProps, type CanvasOverlay, type CanvasPart, type CanvasParts, CanvasPartsContext, CanvasPassThroughContext, CanvasSharedContext, type CanvasSlotProps, type CanvasTyping, type CanvasTypingState, type CanvasTypingTarget, DEFAULT_UI, type Easel, EaselAction, EaselCanvas, type EaselCanvasProps, EaselConfig, EaselCore, type EaselOptions, EaselProvider, type EaselProviderProps, EaselUi, EaselView, EditDocument, NodeSelection, Permissions, type SelectedFields, bindUndoKeys, createEasel, createUseEasel, recordsByDefault, reduce, uiView, useEasel, useEaselApi, useEaselNodeOps, useSelectedFields, validSelection };
|
package/dist/easel/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{CanvasFrame,CanvasPassThroughContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-
|
|
1
|
+
export{CanvasFrame,CanvasPartsContext,CanvasPassThroughContext,CanvasSharedContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-QEAUF632.js";import"../chunk-TBY3DFKS.js";import"../chunk-YRLPFZW3.js";import"../chunk-X3TYRF5V.js";import"../chunk-23VM4PMV.js";import"../chunk-B4JN227A.js";import"../chunk-MFIRYGHW.js";import"../chunk-X4T6JT3M.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
|
package/dist/fields/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-
|
|
1
|
+
export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-5VD2LGIZ.js";export{fieldIsShown,showWhenOf,shownFields,withShowWhen}from"../chunk-BPXEFVSQ.js";import"../chunk-A6Z4SD3I.js";import"../chunk-BALFHI3G.js";import"../chunk-K56YDHYQ.js";export{FieldSlider}from"../chunk-XWFH2NHZ.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-RC25EGHD.js";import"../chunk-KFV7N2DJ.js";export{FieldNumber}from"../chunk-2XMHLXMA.js";export{FieldSelect,optionFor}from"../chunk-G3GWAP5R.js";import"../chunk-WRFD4EXD.js";import"../chunk-36LVP5WD.js";import"../chunk-MFIRYGHW.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
|
package/dist/gold/gold.css
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
.es-gold {
|
|
21
|
-
/* — tokens
|
|
21
|
+
/* — tokens: this sheet is their one source — */
|
|
22
22
|
--es-gold-accent: var(--gold, #c9a461);
|
|
23
23
|
--es-gold-quiet: var(--es-muted, var(--ink-faint));
|
|
24
24
|
--es-gold-caret: var(--es-text, var(--ink-strongest));
|
|
@@ -142,7 +142,6 @@ type ScreenTarget = {
|
|
|
142
142
|
kind: "page";
|
|
143
143
|
slug: string;
|
|
144
144
|
siteId?: string;
|
|
145
|
-
originSlug?: string;
|
|
146
145
|
} | {
|
|
147
146
|
kind: "template";
|
|
148
147
|
id: string;
|
|
@@ -230,9 +229,6 @@ type ScreenDocumentValue = {
|
|
|
230
229
|
* read-only origin backdrop in footer focus) without reaching into Puck's store.
|
|
231
230
|
* Lean accessor (ISP) — never exposes the ref. */
|
|
232
231
|
getLiveData: () => Data | null;
|
|
233
|
-
/** FOOTER FOCUS: the slug of the page the footer was opened from, or null. Rides
|
|
234
|
-
* the nav target, so it's atomic with the retarget (never stale). */
|
|
235
|
-
footerOriginSlug: string | null;
|
|
236
232
|
error: string | null;
|
|
237
233
|
/** True while the template-entry bounce is redirecting to the Home page. */
|
|
238
234
|
redirecting: boolean;
|
|
@@ -367,11 +363,22 @@ declare function ScreenDocumentProvider({ target, addressing: handed, onHostMess
|
|
|
367
363
|
* panel) gets {@link DETACHED_EASEL_HOST}: nobody listening, nothing sent — a
|
|
368
364
|
* request that needs an answer settles empty instead of waiting forever.
|
|
369
365
|
*/
|
|
366
|
+
/**
|
|
367
|
+
* What a picked file's `id` names:
|
|
368
|
+
* - `asset`: a file in the host's Media Library;
|
|
369
|
+
* - `design_image`: a product's picture (a render);
|
|
370
|
+
* - `url`: nothing that lasts; the picture is known by its address only, and
|
|
371
|
+
* `id` repeats it.
|
|
372
|
+
*/
|
|
373
|
+
type PickedMediaSource = "asset" | "design_image" | "url";
|
|
370
374
|
/** A picked media item, as the host's media picker returns it. */
|
|
371
375
|
interface HostPickedMedia {
|
|
372
376
|
id: string;
|
|
373
377
|
url: string;
|
|
374
378
|
kind: "image" | "video";
|
|
379
|
+
/** What `id` names. A host that sends none answers as before: a
|
|
380
|
+
* field that keeps ids treats the pick as `url`. */
|
|
381
|
+
source?: PickedMediaSource;
|
|
375
382
|
}
|
|
376
383
|
/** The SECTION editor's target (the standalone one-section surface). */
|
|
377
384
|
type SectionScreenTarget = {
|
|
@@ -608,4 +615,4 @@ declare function createEaselHost(options: {
|
|
|
608
615
|
deliver: (message: HostToEaselMessage) => void;
|
|
609
616
|
};
|
|
610
617
|
|
|
611
|
-
export { type AnyDocumentAddressing as A, DETACHED_EASEL_HOST as D, type EaselHost as E, type HostPickedMedia as H, type InboundHostMessage as I, NO_DOCUMENT_ADDRESSING as N, type SectionScreenTarget as S, type DocumentAddressing as a, type EaselHostAddress as b, EaselHostContext as c, EaselHostProvider as d, type EaselMessageType as e, type EaselToHostMessage as f, type HostToEaselMessage as g, type SendToHost as h, createEaselHost as i, useHostEscape as j, type AnyScreenTarget as k, type DocumentTarget as l, ScreenDocumentContext as m, ScreenDocumentProvider as n, type ScreenDocumentValue as o, type ScreenTarget as p, useScreenDocument as q, useEaselHost as u };
|
|
618
|
+
export { type AnyDocumentAddressing as A, DETACHED_EASEL_HOST as D, type EaselHost as E, type HostPickedMedia as H, type InboundHostMessage as I, NO_DOCUMENT_ADDRESSING as N, type PickedMediaSource as P, type SectionScreenTarget as S, type DocumentAddressing as a, type EaselHostAddress as b, EaselHostContext as c, EaselHostProvider as d, type EaselMessageType as e, type EaselToHostMessage as f, type HostToEaselMessage as g, type SendToHost as h, createEaselHost as i, useHostEscape as j, type AnyScreenTarget as k, type DocumentTarget as l, ScreenDocumentContext as m, ScreenDocumentProvider as n, type ScreenDocumentValue as o, type ScreenTarget as p, useScreenDocument as q, useEaselHost as u };
|
package/dist/icons/index.d.ts
CHANGED
package/dist/node-ops/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as AfterRemove, I as ItemSelector, N as NodeSelection, P as PassThrough, a as Planned, S as StepBounds, c as canStep, b as clickPick, f as fromItemSelector, n as nextInChain,
|
|
2
|
-
export { C as ClipboardEntry, N as NodeClipboard, a as NodeOps, b as NodeOpsHost, c as createNodeClipboard, u as useNodeOps } from '../useNodeOps-
|
|
1
|
+
export { A as AfterRemove, I as ItemSelector, N as NodeSelection, P as PassThrough, a as Planned, S as StepBounds, c as canStep, b as clickPick, d as clickPickPart, f as fromItemSelector, n as nextInChain, e as nodeChain, p as parentStep, g as planDuplicate, h as planMove, i as planPaste, j as planRemove, k as planRestore, l as planSetProps, m as planStep, o as planSwap, t as toItemSelector } from '../plan-CZS902DV.js';
|
|
2
|
+
export { C as ClipboardEntry, N as NodeClipboard, a as NodeOps, b as NodeOpsHost, c as createNodeClipboard, u as useNodeOps } from '../useNodeOps-fIDWzftn.js';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
import { E as EaselContextMenuItem } from '../types-BsyPh6EW.js';
|
|
5
5
|
import { N as NodeMenuWords } from '../words-DMG4dYq2.js';
|
package/dist/node-ops/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{createNodeClipboard,nodeMenuItems}from"../chunk-OSPUG6S6.js";import"../chunk-WK3AFPXY.js";export{canStep,clickPick,fromItemSelector,nextInChain,nodeChain,parentStep,planDuplicate,planMove,planPaste,planRemove,planRestore,planSetProps,planStep,toItemSelector,useNodeOps}from"../chunk-
|
|
1
|
+
export{createNodeClipboard,nodeMenuItems}from"../chunk-OSPUG6S6.js";import"../chunk-WK3AFPXY.js";export{canStep,clickPick,clickPickPart,fromItemSelector,nextInChain,nodeChain,parentStep,planDuplicate,planMove,planPaste,planRemove,planRestore,planSetProps,planStep,planSwap,toItemSelector,useNodeOps}from"../chunk-X3TYRF5V.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
|
package/dist/panel/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export{DESIGN_GROUPS,SETTINGS_BUCKETS,SettingsGroup}from"../chunk-RC25EGHD.js";import{DEFAULT_PANEL_WORDS as e}from"../chunk-KFV7N2DJ.js";
|
|
1
|
+
export{DESIGN_GROUPS,SETTINGS_BUCKETS,SettingsGroup}from"../chunk-RC25EGHD.js";import{DEFAULT_PANEL_WORDS as e}from"../chunk-KFV7N2DJ.js";export{SettingsField,SettingsSegmented,SettingsSwitch}from"../chunk-36LVP5WD.js";import{withTip as t}from"../chunk-P2VEMZH5.js";import{Tabs as s,CountBadge as i,Tooltip as n}from"efficient-shell/ui";export{BorderInput as SettingsBorder,CornersInput as SettingsCorners,AlignmentGrid as SettingsPlacement,SidesInput as SettingsSides,SidesEachToggle as SettingsSidesEach,borderSides,borderStartEach,sidesStartEach}from"efficient-shell/ui";import{jsx as a,jsxs as l,Fragment as r}from"react/jsx-runtime";import{RevertIcon as d}from"efficient-shell/icons/efficient";function c(e){const t=e[0];if(!t?.htmlId||!t.htmlId.endsWith(`-tab-${t.id}`))return;const s=t.htmlId.slice(0,-`-tab-${t.id}`.length);return e.every(e=>e.htmlId===`${s}-tab-${e.id}`)?s:void 0}function o({items:t,activeId:n,onSelect:d,ariaLabel:o=e.settings,idPrefix:u,className:m}){
|
|
2
2
|
/* @__PURE__ */
|
|
3
3
|
return a("div",{className:"es-tabs-fit",children:/* @__PURE__ */a(s,{variant:"pill","aria-label":o,idPrefix:u??c(t),className:m?`es-tabs ${m}`:"es-tabs",value:n,onChange:d,items:t.map(e=>{const t="number"==typeof e.badge&&e.badge>0?/* @__PURE__ */a(i,{count:e.badge,tone:"accent"}):null;return e.icon?{id:e.id,tooltip:e.label,label:/* @__PURE__ */l(r,{children:[
|
|
4
4
|
/* @__PURE__ */l("span",{className:"es-tab-tip",children:[
|
|
@@ -72,6 +72,14 @@ declare function planPaste(data: Data, config: DataConfig, node: Node, at: Place
|
|
|
72
72
|
* Null when a node with that id is already back (a second Undo).
|
|
73
73
|
*/
|
|
74
74
|
declare function planRestore(data: Data, config: DataConfig, node: Node, at: Place): Planned | null;
|
|
75
|
+
/**
|
|
76
|
+
* Put `node` where `id` stands, in one step, and select it: the node at `id`
|
|
77
|
+
* goes, `node` takes its place in the same list. Its ids are the caller's —
|
|
78
|
+
* a shared section's own copy (Detach from shared, Shared section design v4)
|
|
79
|
+
* comes with fresh ones. Null when `id` is not in the document, or when a node
|
|
80
|
+
* with `node`'s id already is (anywhere but at `id` itself).
|
|
81
|
+
*/
|
|
82
|
+
declare function planSwap(data: Data, config: DataConfig, id: string, node: Node): Planned | null;
|
|
75
83
|
/** Change props on `id` (hide, rename, anything) in one step; selection unchanged. */
|
|
76
84
|
declare function planSetProps(data: Data, config: DataConfig, id: string, patch: Record<string, unknown>): Planned;
|
|
77
85
|
/**
|
|
@@ -114,6 +122,24 @@ declare function nextInChain(chain: readonly string[], selected: string | null):
|
|
|
114
122
|
* in the document.
|
|
115
123
|
*/
|
|
116
124
|
declare function clickPick(data: Data, config: DataConfig, id: string, selected: string | null, passThrough?: PassThrough): string | null;
|
|
125
|
+
/**
|
|
126
|
+
* WHAT A CLICK PICKS ON A PART (W0, card [MERGE] One Text Block And Click
|
|
127
|
+
* Through Parts): the pointer is on `part`, a part the innermost block `id`
|
|
128
|
+
* owns (a host's own idea: a run of words, a picture; `CanvasPartsContext`).
|
|
129
|
+
* `selectedPart` is the part the host has selected now, or null.
|
|
130
|
+
*
|
|
131
|
+
* - a block with no lists of its own: the block AND the part, at once. The
|
|
132
|
+
* block and its words are ONE rung (GG 2026-10-22, answer B).
|
|
133
|
+
* - a container: the part is one more rung after it on {@link nodeChain}, so
|
|
134
|
+
* a click walks the outer layers first and the part last, by
|
|
135
|
+
* {@link nextInChain}'s rule.
|
|
136
|
+
*
|
|
137
|
+
* `null` when `id` is not in the document.
|
|
138
|
+
*/
|
|
139
|
+
declare function clickPickPart(data: Data, config: DataConfig, id: string, part: string, selected: string | null, selectedPart: string | null, passThrough?: PassThrough): {
|
|
140
|
+
node: string;
|
|
141
|
+
part: string | null;
|
|
142
|
+
} | null;
|
|
117
143
|
/** A node by its place: the zone key `"<parentId>:<slot>"` and its index. */
|
|
118
144
|
interface ItemSelector {
|
|
119
145
|
zone?: string;
|
|
@@ -124,4 +150,4 @@ declare function toItemSelector(data: Data, config: DataConfig, selection: NodeS
|
|
|
124
150
|
/** Puck's `itemSelector` as a node selection; `null` when it points at nothing. */
|
|
125
151
|
declare function fromItemSelector(data: Data, config: DataConfig, selector: ItemSelector | null | undefined): NodeSelection;
|
|
126
152
|
|
|
127
|
-
export { type AfterRemove as A, type ItemSelector as I, type NodeSelection as N, type PassThrough as P, type StepBounds as S, type Planned as a, clickPick as b, canStep as c,
|
|
153
|
+
export { type AfterRemove as A, type ItemSelector as I, type NodeSelection as N, type PassThrough as P, type StepBounds as S, type Planned as a, clickPick as b, canStep as c, clickPickPart as d, nodeChain as e, fromItemSelector as f, planDuplicate as g, planMove as h, planPaste as i, planRemove as j, planRestore as k, planSetProps as l, planStep as m, nextInChain as n, planSwap as o, parentStep as p, toItemSelector as t };
|
package/dist/rail/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { a as EaselRailProps, b as EaselRailButtonProps } from '../types-Cy7rdmXt.js';
|
|
3
|
+
export { E as EaselRailItem, c as EaselRailOrientation } from '../types-Cy7rdmXt.js';
|
|
4
4
|
export { AddIcon, LayersIcon, MediaIcon, PageIcon as PagesIcon, EfficientIconProps as RailIconProps, SitemapIcon, StylesIcon } from 'efficient-shell/icons/efficient';
|
|
5
5
|
export { W as WordFit } from '../wordFit-7XpmhcaW.js';
|
|
6
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AddBlockRow as default}from"../../chunk-
|
|
1
|
+
export{AddBlockRow as default}from"../../chunk-F7FDF6NS.js";import"../../chunk-M2Z775ZC.js";import"../../chunk-XHSGRH42.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-C2RHV42O.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-QEAUF632.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-5VD2LGIZ.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-A6Z4SD3I.js";import"../../chunk-BALFHI3G.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-X3TYRF5V.js";import"../../chunk-23VM4PMV.js";import"../../chunk-B4JN227A.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-X4T6JT3M.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -2,6 +2,7 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { D as DragSession } from '../../session-DSQFmIvx.js';
|
|
4
4
|
import { SectionTemplate } from '../lib/section-template-types.js';
|
|
5
|
+
import { SharedSection } from '../lib/shared-section-types.js';
|
|
5
6
|
import { BlockChoice } from '../lib/puck/block-choice.js';
|
|
6
7
|
import '../../types-41704JE4.js';
|
|
7
8
|
import '../lib/puck/content-tree.js';
|
|
@@ -13,6 +14,9 @@ type AddKey = {
|
|
|
13
14
|
} | {
|
|
14
15
|
kind: "template";
|
|
15
16
|
template: SectionTemplate;
|
|
17
|
+
} | {
|
|
18
|
+
kind: "shared";
|
|
19
|
+
section: SharedSection;
|
|
16
20
|
} | {
|
|
17
21
|
kind: "block";
|
|
18
22
|
type: string;
|
|
@@ -20,6 +24,7 @@ type AddKey = {
|
|
|
20
24
|
declare const sectionKey: (type: string) => string;
|
|
21
25
|
declare const blockKey: (type: string) => string;
|
|
22
26
|
declare const templateKey: (id: string) => string;
|
|
27
|
+
declare const sharedKey: (id: string) => string;
|
|
23
28
|
type AddSidePanelProps<I> = {
|
|
24
29
|
/** Where the next thing goes, when the panel was opened at a place. */
|
|
25
30
|
at?: {
|
|
@@ -51,4 +56,4 @@ type AddSidePanelProps<I> = {
|
|
|
51
56
|
};
|
|
52
57
|
declare function AddSidePanel<I>({ at, placeBlocks, canTake, onPick, itemFor, session, siteWide, onClose, onHide, readOnly, }: AddSidePanelProps<I>): react.JSX.Element;
|
|
53
58
|
|
|
54
|
-
export { type AddKey, type AddSidePanelProps, blockKey, AddSidePanel as default, sectionKey, templateKey };
|
|
59
|
+
export { type AddKey, type AddSidePanelProps, blockKey, AddSidePanel as default, sectionKey, sharedKey, templateKey };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-
|
|
1
|
+
export{blockKey,AddSidePanel as default,sectionKey,sharedKey,templateKey}from"../../chunk-BRMYJBMB.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-43AEUUNQ.js";import"../../chunk-XDZHKYQX.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-M2Z775ZC.js";import"../../chunk-XHSGRH42.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-WXFZD7WC.js";import"../../chunk-C2RHV42O.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-QEAUF632.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-5VD2LGIZ.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-A6Z4SD3I.js";import"../../chunk-BALFHI3G.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-X3TYRF5V.js";import"../../chunk-GWIVPLOX.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-23VM4PMV.js";import"../../chunk-B4JN227A.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LLDHIBYG.js";import"../../chunk-KAML3KQH.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-X4T6JT3M.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { MediaPanelComponent, MediaPickRequest } from '../lib/media-panel.js';
|
|
3
|
-
import '../../host-
|
|
3
|
+
import '../../host-epHo7r8P.js';
|
|
4
4
|
import '../../blocks/index.js';
|
|
5
|
-
import '../../types-
|
|
5
|
+
import '../../types-Cq53lL8d.js';
|
|
6
6
|
import '../../data/index.js';
|
|
7
7
|
import '../../types-41704JE4.js';
|
|
8
8
|
import '../../resolve-D68pb3Bx.js';
|
|
9
|
-
import '../../plan-
|
|
9
|
+
import '../../plan-CZS902DV.js';
|
|
10
10
|
import '../lib/document-contract.js';
|
|
11
11
|
import '../lib/session.js';
|
|
12
12
|
import '../lib/backend-error.js';
|
|
@@ -17,6 +17,7 @@ import 'efficient-shell/ui';
|
|
|
17
17
|
import '../lib/document-hooks.js';
|
|
18
18
|
import '../lib/section-template-types.js';
|
|
19
19
|
import '../lib/puck/content-tree.js';
|
|
20
|
+
import '../lib/shared-section-types.js';
|
|
20
21
|
import '../lib/document-switch.js';
|
|
21
22
|
import '../../engine-CvXpFE86.js';
|
|
22
23
|
import '../lib/admin-bridge.js';
|