efficient-easel 9.0.0 → 10.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 -0
- package/dist/chunk-26GHWMNN.js +21 -0
- package/dist/{chunk-CKBGJ53M.js → chunk-2AKW6UXX.js} +1 -1
- package/dist/{chunk-X5SPTRG3.js → chunk-4CE7XFCE.js} +1 -1
- package/dist/chunk-65Z5FSAW.js +6 -0
- package/dist/{chunk-W3BK5T4O.js → chunk-BPLCMQ6S.js} +50 -50
- package/dist/{chunk-EJZ4RIRW.js → chunk-GKGBKSZ7.js} +1 -1
- package/dist/{chunk-NMUS2VVD.js → chunk-K2YSFVOJ.js} +1 -1
- package/dist/{chunk-FJRAYUCX.js → chunk-LGDQLTJW.js} +5 -5
- package/dist/{chunk-GMXWP5XP.js → chunk-Q6AM43CA.js} +1 -1
- package/dist/chunk-RC25EGHD.js +5 -0
- package/dist/{chunk-CXLWPZZK.js → chunk-U5RF4USK.js} +3 -3
- package/dist/{chunk-GD7QFYER.js → chunk-XF2AIO46.js} +1 -1
- package/dist/chunk-XJCMEEBH.js +9 -0
- package/dist/{chunk-VNN6VB4V.js → chunk-XO7OUCZV.js} +1 -1
- package/dist/chunk-XTDBTCVO.js +5 -0
- package/dist/chunk-XWFH2NHZ.js +4 -0
- package/dist/copy/copy.css +26 -0
- package/dist/copy/index.d.ts +55 -3
- package/dist/copy/index.js +23 -20
- package/dist/easel/index.d.ts +1 -1
- package/dist/fields/index.d.ts +2 -2
- package/dist/fields/index.js +1 -1
- package/dist/panel/index.d.ts +1 -1
- package/dist/panel/index.js +18 -18
- package/dist/panel/panel.css +7 -4
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/MediaSidePanel.js +1 -1
- package/dist/screen/components/ScreenChrome.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 +15 -15
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/puck/use-section-ops.js +1 -1
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/strings/catalogue.d.ts +1 -1
- package/dist/strings/catalogue.js +1 -1
- package/dist/strings/index.d.ts +1 -1
- package/dist/strings/index.js +1 -1
- package/dist/text-styles/index.js +13 -13
- package/dist/{types-OUl0mK1k.d.ts → types-C97TAUKi.d.ts} +16 -0
- package/dist/{words-DohP5ieg.d.ts → words-dsex49Jh.d.ts} +24 -0
- package/package.json +3 -3
- package/dist/chunk-GZH4UVDH.js +0 -8
- package/dist/chunk-NRC43NHG.js +0 -5
- package/dist/chunk-OZ72A6MY.js +0 -9
- package/dist/chunk-PEDDDWSG.js +0 -21
- package/dist/chunk-QLD57GBB.js +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_TEXT_STYLES_WORDS as o}from"./chunk-M6F6LS3H.js";import{DEFAULT_PICK_WORDS as r}from"./chunk-ZAOM6PFH.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-JTUUIVBZ.js";import{DEFAULT_CANVAS_WORDS as n}from"./chunk-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as c}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-KFV7N2DJ.js";import{DEFAULT_NODE_MENU_WORDS as f}from"./chunk-WK3AFPXY.js";import{DEFAULT_SAVE_WORDS as p}from"./chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as e,DEFAULT_NOTICE_WORDS as i}from"./chunk-Z6PVRXVY.js";import{DEFAULT_LOCK_WORDS as u}from"./chunk-RE4LP46F.js";import{DEFAULT_RAIL_WORDS as k}from"./chunk-2OAZYSWJ.js";import{DEFAULT_COPY_WORDS as j}from"./chunk-
|
|
1
|
+
import{DEFAULT_TEXT_STYLES_WORDS as o}from"./chunk-M6F6LS3H.js";import{DEFAULT_PICK_WORDS as r}from"./chunk-ZAOM6PFH.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-JTUUIVBZ.js";import{DEFAULT_CANVAS_WORDS as n}from"./chunk-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as c}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-KFV7N2DJ.js";import{DEFAULT_NODE_MENU_WORDS as f}from"./chunk-WK3AFPXY.js";import{DEFAULT_SAVE_WORDS as p}from"./chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as e,DEFAULT_NOTICE_WORDS as i}from"./chunk-Z6PVRXVY.js";import{DEFAULT_LOCK_WORDS as u}from"./chunk-RE4LP46F.js";import{DEFAULT_RAIL_WORDS as k}from"./chunk-2OAZYSWJ.js";import{DEFAULT_COPY_WORDS as j}from"./chunk-Q6AM43CA.js";import{DEFAULT_FIELDS_WORDS as h}from"./chunk-FFYXVAAL.js";import{DEFAULT_DRAG_WORDS as l}from"./chunk-O2NLQBFX.js";var F={notice:i,lock:u,save:p,chrome:e,rail:k,tree:c,panel:s,fields:h,pick:r,drag:l,menu:f,styleClipboard:t,copy:j,canvas:n,textStyles:o,screen:m},a=o=>"object"==typeof o&&null!==o;function Y(o,r){const t={};for(const m of Object.keys(o)){const n=o[m],c=r[m];null==c?t[m]=n:a(n)?t[m]=a(c)?Y(n,c):n:t[m]=typeof c==typeof n?c:n}return t}function y(o,r){return r?Y(o,r):o}export{F as DEFAULT_EASEL_STRINGS,y as mergeEaselStrings};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{Segmented as e,Switch as a,Tooltip as l}from"efficient-shell/ui";import{jsx as s,jsxs as i,Fragment as n}from"react/jsx-runtime";import{isValidElement as r,cloneElement as d}from"react";function c({options:a,value:n,onChange:r,ariaLabel:d,fit:c,disabled:t=!1,className:o}){const h=c&&function(e,a){return{"--es-fit-count":e,"--es-fit-labels":`${a.labelsPx}px`,"--es-fit-widest":`${a.widestLabelPx}px`}}(a.length,c),u=a.findIndex(e=>e.id===n);
|
|
2
|
+
/* @__PURE__ */
|
|
3
|
+
return s("div",{className:"es-segs-fit","data-disabled":t||void 0,style:h,children:/* @__PURE__ */s(e,{size:"sm",label:d,className:`es-segs${h?" is-measured":""}${o?` ${o}`:""}`,value:u<0?"":String(u),onChange:e=>r(a[Number(e)].id),options:a.map((e,a)=>{const n=e.title??("string"==typeof e.label?e.label:void 0),r="string"!=typeof e.label,d=a=>n&&(e.icon||r)?/* @__PURE__ */s(l,{content:n,children:a}):a;return{value:String(a),disabled:t||!0===e.disabled,icon:e.icon?d(
|
|
4
|
+
/* @__PURE__ */s("span",{className:"es-seg-icon","aria-hidden":"true",children:e.icon})):void 0,label:r?/* @__PURE__ */i("span",{className:"es-seg-word",children:[d(/* @__PURE__ */s("span",{"aria-hidden":"true",children:e.label})),
|
|
5
|
+
/* @__PURE__ */s("span",{className:"es-vh",children:n})]}):/* @__PURE__ */s("span",{className:"es-seg-word",children:e.label})}})})})}function t({checked:e,onChange:l,disabled:i,id:n,ariaLabel:r,ariaLabelledBy:d,className:c}){/* @__PURE__ */
|
|
6
|
+
return s(a,{size:"sm",id:n,checked:e,"aria-label":r,"aria-labelledby":d,disabled:i,className:c?`es-switch ${c}`:"es-switch",onChange:l})}function o(e){return Array.isArray(e)?e.some(o):r(e)}function h(e,a,l){if(!r(e)||e.type!==t)return e;const s=e.props;return s.ariaLabel||s.ariaLabelledBy?e:d(e,l?{ariaLabelledBy:l}:{ariaLabel:a})}function u({label:e,labelId:a,icon:l,value:r,hint:d,changed:c,htmlFor:t,action:u,children:m,className:b}){const f=o(m),p=o(u);if(!f&&!p)return null;const N=["es-field"];f||N.push("is-inline"),c&&N.push("is-changed"),b&&N.push(b);const g=/* @__PURE__ */i(n,{children:[l?/* @__PURE__ */s("span",{className:"es-field-icon","aria-hidden":"true",children:l}):null,
|
|
7
|
+
/* @__PURE__ */s("span",{className:"es-field-label",id:a,children:e})]});/* @__PURE__ */
|
|
8
|
+
return i("div",{className:N.join(" "),children:[
|
|
9
|
+
/* @__PURE__ */i("div",{className:"es-field-head",children:[t?/* @__PURE__ */s("label",{className:"es-field-name",htmlFor:t,children:g}):/* @__PURE__ */s("span",{className:"es-field-name",children:g}),null!=r?/* @__PURE__ */s("span",{className:"es-field-value",children:r}):null,p?h(u,e,a):null]}),f?/* @__PURE__ */s("div",{className:"es-field-ctl",children:m}):null,d?/* @__PURE__ */s("p",{className:"es-field-hint",children:d}):null]})}export{u as SettingsField,c as SettingsSegmented,t as SettingsSwitch};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useSectionOps as o}from"./chunk-
|
|
1
|
+
import{useSectionOps as o}from"./chunk-K2YSFVOJ.js";import{decodePartId as e,encodePartId as r}from"./chunk-IYT6NN2J.js";import{usePreviewParts as t}from"./chunk-I54UCYOU.js";import{SELECTION_MODE as n}from"./chunk-LGDQLTJW.js";import{useEasel as p}from"./chunk-K5744MTM.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:a}){const{getSelectorForId:u}=p(o=>o),I=o(),{setSelectedPartId:f,setSelectHandler:k}=t(),l=d(o=>{const r=e(o);if(!r)return;const{nodeId:t,propKey:p}=r;p?(i(o=>s(o)&&o.nodeId===t&&o.propKey===p?o:{kind:"part",nodeId:t,propKey:p}),a?.(t)):i(o=>"part"===o.kind?n:o)},[i,a]);c(()=>{k(l)},[k,l]);const K=s(m)?r(m.nodeId,m.propKey):null;c(()=>{f(K)},[K,f]);return{selectNode:d(o=>{i(()=>n);const e=u(o);e&&I.select(e)},[i,u,I]),openPartId:K}}export{m as usePartBridge};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{buildPaletteSections as e,pinnedSection as t,paletteWithoutPinned as o,categoryLabel as n}from"./chunk-PA3PNTVV.js";import{blockTypesIn as i}from"./chunk-5ZBY24K7.js";import{sectionTemplatesOf as s}from"./chunk-BVN33R76.js";import{SidePanelHead as r,PanelModeExit as c}from"./chunk-PPL7GB7D.js";import{useEaselSession as l}from"./chunk-O7Q4DDJT.js";import{blockRuns as a}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as p,useScreenBlockRules as m}from"./chunk-LGDQLTJW.js";import{DEFAULT_SCREEN_WORDS as d}from"./chunk-JTUUIVBZ.js";import{useEasel as f}from"./chunk-K5744MTM.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-FCLW4LEN.js";import{DEFAULT_DRAG_WORDS as y}from"./chunk-O2NLQBFX.js";import{useState as h,useEffect as b,useMemo as j}from"react";import{AddIcon as g}from"efficient-shell/icons/efficient";import{jsx as B,jsxs as L,Fragment as $}from"react/jsx-runtime";var O=e=>`section:${e}`,v=e=>`block:${e}`,x=e=>`template:${e}`;function I({blocks:I,blocksOnly:N,at:T,sectionAccepts:V,onAdd:A,itemFor:D,session:F,siteWide:C,onClose:H,onHide:P,readOnly:Q}){const W=f(e=>e.config),w=p(),{labelAtLevel:G,categoryLabel:J,firstSection:M,Icon:R,Thumbnail:z}=w,{blockIsOffered:E}=m(),K=u("screen",d).add,S=u("drag",y).add,U=l(),[Y,Z]=h([]);b(()=>{let e=!1;const t=e=>E(e,U);return s(U).list().then(o=>{if(e)return;const n=W.components;Z(o.filter(e=>e.node?.type&&n[e.node.type]&&i(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[W,U]);const X=j(()=>e(W,w),[W]),q=e=>({type:O(e.type),label:e.name,cover:/* @__PURE__ */B(z,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:K.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),_=j(()=>{const e=[];if(I&&I.choices.length>0&&a(I.choices).forEach((t,o)=>{e.push({key:`blocks:${o}`,title:0===o?`${K.inside({name:I.parentName})}${t.group?` · ${t.group}`:""}`:t.group??"",tiles:t.items.map(e=>({type:v(e.type),label:e.label,icon:/* @__PURE__ */B(R,{type:e.type,size:18}),title:K.tile({name:e.label})}))})}),N)return e;const i=e=>!V||V(e),s=t(X,M);s&&i(s.type)&&e.push({key:"start",title:K.startBlank,tiles:[q(s)]});const r=Y.filter(e=>i(e.node.type));r.length>0&&e.push({key:"templates",title:K.templates,tiles:r.map(e=>{return{type:x(e.id),label:e.name,cover:/* @__PURE__ */B(z,{type:e.node.type}),keywords:[(t=e.node.type,G(t,"section",W.components[t]?.label??t)),e.node.type]};var t})});const c=o(X,M);for(const t of Object.keys(W.categories??{})){const o=c.filter(e=>e.cat===t&&i(e.type));0!==o.length&&e.push({key:`category:${t}`,title:n(W,t,J),tiles:o.map(q)})}return e},[I,N,Y,X,W,K,V]),ee=e=>{const t=e.indexOf(":"),o=e.slice(0,t),n=e.slice(t+1);if("section"===o)return{kind:"section",type:n};if("block"===o)return{kind:"block",type:n};if("template"===o){const e=Y.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null};/* @__PURE__ */
|
|
2
|
+
return L($,{children:[
|
|
3
|
+
/* @__PURE__ */B(r,{icon:/* @__PURE__ */B(g,{size:15}),title:K.title,context:N?K.contextBlocks:K.contextAll,actions:/* @__PURE__ */B(c,{label:K.done,description:K.doneDescription,onClick:H}),onHide:P}),
|
|
4
|
+
/* @__PURE__ */L("div",{className:"sf-addside sf-scroll",children:[
|
|
5
|
+
/* @__PURE__ */B(k,{groups:_,session:F,itemFor:e=>D(ee(e)??{kind:"section",type:e}),onInsert:e=>{const t=ee(e);t&&A(t)},at:T,hint:N?K.hintBlocks:K.hint,searchLabel:N?K.searchBlocks:K.searchSections,readOnly:Q,words:S}),C&&!N?C:null]})]})}export{I as AddSidePanel,v as blockKey,O as sectionKey,x as templateKey};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{Slider as e}from"efficient-shell/ui";import{useId as i,useRef as o}from"react";import{jsxs as t,jsx as r}from"react/jsx-runtime";function n({id:n,label:l,value:a,onChange:d,min:s,max:u,step:m=1,shiftStep:v,styleValue:p,unit:f,sliderMin:c,sliderMax:h,auto:b,readOnly:x=!1}){const y=i(),N=n??y,C="number"==typeof a&&Number.isFinite(a)?a:void 0,g=void 0!==b&&void 0===C,F=!g&&void 0===C&&void 0!==p,I=Number((c-m).toFixed(6)),M=o(!1),S=e=>{M.current="range"===e.target.type},V=e=>{x||e===C||d(e)};/* @__PURE__ */
|
|
2
|
+
return t("div",{className:"es-fslider"+(F||g?" is-style":""),onChangeCapture:S,onKeyDownCapture:S,onPointerDownCapture:S,children:[
|
|
3
|
+
/* @__PURE__ */r("label",{className:"es-fslider-name",htmlFor:N,children:l}),
|
|
4
|
+
/* @__PURE__ */r(e,{id:N,label:l,value:C??null,onChange:e=>{if(null===e)return V(void 0);V(void 0!==b&&M.current&&e<c?void 0:e)},min:void 0!==b?I:c,max:h,inputMin:s??-1e9,inputMax:u??Number.POSITIVE_INFINITY,step:m,shiftStep:v,suffix:f&&!g?f:void 0,emptyLabel:b??(void 0===p?"":void 0),placeholderValue:void 0===b?p:void 0,stepFrom:void 0!==b?I:void 0,disabled:x,size:"sm"})]})}export{n as FieldSlider};
|
package/dist/copy/copy.css
CHANGED
|
@@ -506,3 +506,29 @@
|
|
|
506
506
|
text-overflow: ellipsis;
|
|
507
507
|
white-space: nowrap;
|
|
508
508
|
}
|
|
509
|
+
|
|
510
|
+
/* — the one text panel (`TextPartPanel`, text panel v3; wave 2 · E2) — */
|
|
511
|
+
/* The rows are the panel's own `SettingsField`s (panel.css); only what is the
|
|
512
|
+
text panel's is said here. The cells sit between Font and Alignment at the
|
|
513
|
+
panel's row rhythm, the same room a row has above it. */
|
|
514
|
+
.es-tpp > .es-copy-cells-fit {
|
|
515
|
+
margin-top: max(var(--es-row-gap), var(--es-rhythm-between));
|
|
516
|
+
margin-bottom: 0;
|
|
517
|
+
}
|
|
518
|
+
.es-tpp-kept {
|
|
519
|
+
margin-bottom: var(--es-space-8, 8px);
|
|
520
|
+
}
|
|
521
|
+
/* `Font [Inter ▾] [I]`: the font takes the row, the Italic button its end. */
|
|
522
|
+
.es-tpp-font {
|
|
523
|
+
display: flex;
|
|
524
|
+
align-items: center;
|
|
525
|
+
gap: var(--es-space-4, 4px);
|
|
526
|
+
/* `.es-field-ctl` is a flex row: without a width this row sizes to its
|
|
527
|
+
content and the font box stops short of the I (measured at 320 and 220). */
|
|
528
|
+
width: 100%;
|
|
529
|
+
min-width: 0;
|
|
530
|
+
}
|
|
531
|
+
.es-tpp-font-select {
|
|
532
|
+
flex: 1;
|
|
533
|
+
min-width: 0;
|
|
534
|
+
}
|
package/dist/copy/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { MarkStyle, MarkupTool, WrapResult, InlineRule, MarkedLine } from '../markup/index.js';
|
|
4
|
-
import { C as CopyWords, a as CopyAlign } from '../words-
|
|
5
|
-
export { b as COPY_ALIGNS, c as COPY_ALIGN_FIT, d as COPY_ALIGN_GLYPHS, e as COPY_ALIGN_LABELS, f as copyAlignOptions } from '../words-
|
|
4
|
+
import { C as CopyWords, a as CopyAlign } from '../words-dsex49Jh.js';
|
|
5
|
+
export { b as COPY_ALIGNS, c as COPY_ALIGN_FIT, d as COPY_ALIGN_GLYPHS, e as COPY_ALIGN_LABELS, f as copyAlignOptions } from '../words-dsex49Jh.js';
|
|
6
6
|
import { TextToolbarCase, TextToolbarMark } from 'efficient-shell/ui';
|
|
7
7
|
export { TextToolbar, TextToolbarProps } from 'efficient-shell/ui';
|
|
8
|
+
import { g as FieldOption } from '../types-C97TAUKi.js';
|
|
8
9
|
export { C as CanvasTypingEnd, a as CanvasTypingOptions, b as CanvasTypingSession, T as TextMap, s as startCanvasTyping, t as textMap } from '../canvas-typing-Cnvlsh_V.js';
|
|
10
|
+
import '../buckets-Tj-nkBpg.js';
|
|
9
11
|
|
|
10
12
|
type CellWords = NonNullable<CopyWords['cells']>;
|
|
11
13
|
interface CopyCell {
|
|
@@ -398,6 +400,56 @@ interface CopyBoxProps {
|
|
|
398
400
|
|
|
399
401
|
declare function CopyBox({ value, onChange, onCommit, onCancel, multiline, placeholder, ariaLabel, className, readOnly, rules, tools, writeMark, actions, align, glyphs, barLabel, renderFooter, inputRef, barShows, richText, defaultShowMarks, toolbar, colors, cells, letterCase, lastTool, }: CopyBoxProps): react.JSX.Element;
|
|
400
402
|
|
|
403
|
+
/** Whether the lines are a list, and which kind. */
|
|
404
|
+
type TextList = 'none' | 'bullet' | 'number';
|
|
405
|
+
/** How the letters are drawn: as typed, all capitals, each word capitalized, all small. */
|
|
406
|
+
type TextCase = 'none' | 'upper' | 'capitalize' | 'lower';
|
|
407
|
+
/** A strip row: the box's own answer (`''` = follows the style) and the style's. */
|
|
408
|
+
interface TextPartStrip<V extends string> {
|
|
409
|
+
value: V | '';
|
|
410
|
+
styleValue?: V;
|
|
411
|
+
onChange: (next: V | '') => void;
|
|
412
|
+
}
|
|
413
|
+
interface TextPartPanelProps {
|
|
414
|
+
/** The kept box, on top: a `CopyBox` for words the canvas cannot take. */
|
|
415
|
+
kept?: CopyBoxProps;
|
|
416
|
+
style?: {
|
|
417
|
+
value: string;
|
|
418
|
+
/** The site's (or the email's) text styles. `description` is the second
|
|
419
|
+
* line, the style's weight. */
|
|
420
|
+
options: readonly FieldOption<string>[];
|
|
421
|
+
onChange: (next: string) => void;
|
|
422
|
+
/** This box differs from its style: the field shows "*". */
|
|
423
|
+
changed?: boolean;
|
|
424
|
+
/** Footer actions; one the host does not hand is not drawn. */
|
|
425
|
+
onClearChanges?: () => void;
|
|
426
|
+
onEditStyles?: () => void;
|
|
427
|
+
onUpdateStyle?: () => void;
|
|
428
|
+
};
|
|
429
|
+
font?: {
|
|
430
|
+
/** The box's own font, `''` while it follows the style. */
|
|
431
|
+
value: string;
|
|
432
|
+
styleValue?: string;
|
|
433
|
+
options: readonly FieldOption<string>[];
|
|
434
|
+
onChange: (next: string) => void;
|
|
435
|
+
/** A long list (the website's fonts): the field is a search. */
|
|
436
|
+
searchable?: boolean;
|
|
437
|
+
};
|
|
438
|
+
/** The Italic button at the end of the Font row. `undefined` follows the style. */
|
|
439
|
+
italic?: {
|
|
440
|
+
value: boolean | undefined;
|
|
441
|
+
styleValue?: boolean;
|
|
442
|
+
onChange: (next: boolean | undefined) => void;
|
|
443
|
+
};
|
|
444
|
+
cells?: readonly CopyCell[];
|
|
445
|
+
align?: TextPartStrip<CopyAlign> & {
|
|
446
|
+
allow?: readonly CopyAlign[];
|
|
447
|
+
};
|
|
448
|
+
list?: TextPartStrip<TextList>;
|
|
449
|
+
letterCase?: TextPartStrip<TextCase>;
|
|
450
|
+
}
|
|
451
|
+
declare function TextPartPanel({ kept, style, font, italic, cells, align, list, letterCase }: TextPartPanelProps): react.JSX.Element;
|
|
452
|
+
|
|
401
453
|
interface PasteData {
|
|
402
454
|
/** The clipboard's `text/html`, when there is one. */
|
|
403
455
|
html?: string;
|
|
@@ -648,4 +700,4 @@ interface CaretEdit {
|
|
|
648
700
|
*/
|
|
649
701
|
declare function useCaretEdit({ target, onChange }: CaretEdit): (edit: (el: HTMLInputElement | HTMLTextAreaElement | null) => WrapResult) => void;
|
|
650
702
|
|
|
651
|
-
export { COPY_CELLS, type CaretEdit, ColorWindow, CopyAlign, CopyBox, type CopyBoxAlign, type CopyBoxFooter, type CopyBoxLastTool, type CopyBoxProps, type CopyCase, type CopyCell, type CopyCellPreset, CopyCells, type CopyThemeColor, CopyWords, type History, MARKUP_CLIPBOARD_TYPE, MarkBar, type MarkBarProps, type MarkWriter, type PasteData, type PasteOptions, RichBox, type RichBoxProps, type RichEdit, type RichHandle, type RichInputEvent, type RichInputResult, type RichInsert, type RichLayout, type RichLine, type RichPending, type SelectionSource, type Snapshot, TYPING_BURST_MS, type TextAreaHandle, type TextBoxHandle, type ToolbarMark, ariaShortcut, createHistory, editVisible, insertSelection, markSelection, markupOfRange, newLine, pasteToMarkup, richInput, richLayout, selectionToSource, selectionToVisible, setBullet, toSource, toSourceStart, toVisible, useCaretEdit };
|
|
703
|
+
export { COPY_CELLS, type CaretEdit, ColorWindow, CopyAlign, CopyBox, type CopyBoxAlign, type CopyBoxFooter, type CopyBoxLastTool, type CopyBoxProps, type CopyCase, type CopyCell, type CopyCellPreset, CopyCells, type CopyThemeColor, CopyWords, type History, MARKUP_CLIPBOARD_TYPE, MarkBar, type MarkBarProps, type MarkWriter, type PasteData, type PasteOptions, RichBox, type RichBoxProps, type RichEdit, type RichHandle, type RichInputEvent, type RichInputResult, type RichInsert, type RichLayout, type RichLine, type RichPending, type SelectionSource, type Snapshot, TYPING_BURST_MS, type TextAreaHandle, type TextBoxHandle, type TextCase, type TextList, TextPartPanel, type TextPartPanelProps, type TextPartStrip, type ToolbarMark, ariaShortcut, createHistory, editVisible, insertSelection, markSelection, markupOfRange, newLine, pasteToMarkup, richInput, richLayout, selectionToSource, selectionToVisible, setBullet, toSource, toSourceStart, toVisible, useCaretEdit };
|
package/dist/copy/index.js
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import{DEFAULT_COPY_WORDS as e}from"../chunk-
|
|
2
|
-
return
|
|
3
|
-
/* @__PURE__ */
|
|
4
|
-
return
|
|
5
|
-
return
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
return
|
|
9
|
-
/* @__PURE__ */
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
/* @__PURE__ */
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
-
/* @__PURE__ */
|
|
15
|
-
return
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
1
|
+
import{DEFAULT_COPY_WORDS as e}from"../chunk-Q6AM43CA.js";import{selectionToVisible as t,selectionToSource as n,richLayout as r,createHistory as l,markPress as o,pasteToMarkup as a,richInput as s,editVisible as i,MARKUP_CLIPBOARD_TYPE as c,markupOfRange as u}from"../chunk-WQASXLXS.js";export{MARKUP_CLIPBOARD_TYPE,TYPING_BURST_MS,createHistory,editVisible,markupOfRange,newLine,pasteToMarkup,richInput,richLayout,selectionToSource,selectionToVisible,setBullet,startCanvasTyping,textMap,toSource,toSourceStart,toVisible}from"../chunk-WQASXLXS.js";import{FieldNumber as d}from"../chunk-66LWADFP.js";import{FieldSelect as p}from"../chunk-65Z5FSAW.js";import{SettingsSegmented as h,SettingsSwitch as f,SettingsField as m}from"../chunk-XJCMEEBH.js";import"../chunk-FFYXVAAL.js";import{GoldTextInput as g}from"../chunk-2FZJWH24.js";import{RETIRED_MARKS as y,applyMark as v,markupTools as b,marksIn as w,STANDARD_MARKUP as k,findLink as S,markedAt as x,listIn as C,colorIn as E,spanFor as D,clearStyle as N,toggleMark as L,colorOver as T,setList as M,unlinkAt as R,removeLink as z,linkOver as P,writeLink as B}from"../chunk-546BBOPE.js";import{useWords as O}from"../chunk-MFIRYGHW.js";import{withTip as F}from"../chunk-P2VEMZH5.js";import{Tooltip as $,ColorSwatch as K,ColorPickerPanel as W,Button as j,IconButton as H,registerModalEscapeInterceptor as V,textToolbarRows as A,TextToolbar as U,LinkPicker as I}from"efficient-shell/ui";export{TextToolbar}from"efficient-shell/ui";import{useRef as X,useState as q,useLayoutEffect as Y,useEffect as Z,useId as _}from"react";import{AlignJustifyIcon as Q,AlignRightIcon as G,AlignCenterIcon as J,AlignLeftIcon as ee,ParagraphSpacingIcon as te,LetterSpacingIcon as ne,LineSpacingIcon as re,TextSizeIcon as le,ClearMarksIcon as oe,StylesIcon as ae,ItalicIcon as se,TypeIcon as ie,AlignmentIcon as ce,ListFormatIcon as ue,CaseIcon as de,LinkIcon as pe,QuietIcon as he,EmphasisIcon as fe,StrikeIcon as me,BoldIcon as ge,NumberedListIcon as ye,ListIcon as ve,ListNoneIcon as be,CaseLowerIcon as we,CaseCapitalizedIcon as ke,CaseUpperIcon as Se,CaseNormalIcon as xe}from"efficient-shell/icons/efficient";import{jsx as Ce,jsxs as Ee,Fragment as De}from"react/jsx-runtime";var Ne=["left","center","right","justify"],Le=e.align,Te={left:/* @__PURE__ */Ce(ee,{}),center:/* @__PURE__ */Ce(J,{}),right:/* @__PURE__ */Ce(G,{}),justify:/* @__PURE__ */Ce(Q,{})},Me={three:{labelsPx:94.5,widestLabelPx:39.94},four:{labelsPx:140,widestLabelPx:44}};function Re(e,t=Le){return Ne.filter(t=>e.includes(t)).map(e=>({id:e,label:t[e],icon:Te[e],title:t[e]}))}var ze=/[\u1100-\u11ff\u2e80-\u9fff\uac00-\ud7af\uf900-\ufaff\uff00-\uffef]/;function Pe(e){if(e.every(e=>e.label===Le[e.id]))return e.length>3?Me.four:Me.three;const t=e.map(e=>[...e.label].reduce((e,t)=>e+(ze.test(t)?13:8),0));return{labelsPx:t.reduce((e,t)=>e+t,0),widestLabelPx:Math.max(0,...t)}}function Be(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function Oe(e,t,n,r=v){const{start:l,end:o}=Be(e,n);return r(e,l,o,t)}function Fe(e,t,n){const{start:r,end:l}=Be(e,n),o=r+t.length;return{text:e.slice(0,r)+t+e.slice(l),selectionStart:o,selectionEnd:o}}function $e(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 Ke(e,t,n,r){const l=e.layout.lines;if(n===t)return r>=e.lines.length?e.layout.text.length:l[r].vis;const o=e.lines.findIndex(e=>e===n||e.contains(n));if(-1===o)return 0;const a=t.ownerDocument.createRange();a.setStart(e.lines[o],0);try{a.setEnd(n,r)}catch{return l[o].vis}return l[o].vis+Math.min(a.toString().length,l[o].text.length)}function We(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 je({value:e,rules:l,multiline:o,readOnly:d=!1,placeholder:p,ariaLabel:h,handle:f,onEdit:m,onSelect:g,onHistory:y,onFormat:v,pending:b,onCommit:w,onCancel:k}){const S=X(null),x=X(null),C=X(null),E=X(null),D=X(null),N=X(e),[L,T]=q(0),M=X({value:e,rules:l,multiline:o,readOnly:d,pending:b,onEdit:m,onHistory:y,onFormat:v});M.current={value:e,rules:l,multiline:o,readOnly:d,pending:b,onEdit:m,onHistory:y,onFormat:v};const R=()=>{const e=S.current,t=x.current,n=e?.ownerDocument.getSelection();if(!(e&&t&&n&&0!==n.rangeCount&&n.anchorNode&&e.contains(n.anchorNode)))return null;const r=Ke(t,e,n.anchorNode,n.anchorOffset),l=n.focusNode&&e.contains(n.focusNode)?Ke(t,e,n.focusNode,n.focusOffset):r;return r<=l?[r,l]:[l,r]},z=(e,t)=>{const n=S.current,r=x.current;if(!n||!r)return;const[l,o]=We(r,e),[a,s]=We(r,t);n.ownerDocument.getSelection()?.setBaseAndExtent(l,o,a,s)};f.current={getSource(){const e=R(),t=x.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){E.current={text:n,src:[e,t]},T(e=>e+1)},focus(){S.current?.focus()},rangeOf(e,n){const r=S.current,l=x.current;if(!r||!l)return null;const[o,a]=t(l.layout,e,n),[s,i]=We(l,o),[c,u]=We(l,a),d=r.ownerDocument.createRange();return d.setStart(s,i),d.setEnd(c,u),d}},Y(()=>{const n=S.current;if(!n||D.current)return;const o=E.current?null:R();x.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=$e(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)),C.current=e;const a=E.current;if(!a||a.text!==e)return void(o&&n.ownerDocument.activeElement===n&&z(o[0],Math.min(o[1],x.current.layout.text.length)));E.current=null;const s=x.current.layout,[i,c]=a.vis??t(s,a.src[0],a.src[1]);n.ownerDocument.activeElement!==n&&n.focus(),z(i,c)},[e,l,L]);const P=(e,t,r)=>{const l=x.current,[o,a]=n(l.layout,t[0],t[1]);E.current={text:e.text,vis:[e.caret,e.caret]},e.text!==M.current.value?M.current.onEdit(e.text,{start:o,end:a},r):T(e=>e+1)};Z(()=>{const e=S.current;if(!e)return;const t=t=>{const{value:n,rules:r,multiline:l,readOnly:o,pending:a}=M.current;if("insertCompositionText"===t.inputType)return;if(t.preventDefault(),o)return;const i=x.current,c=R();if(!i||!c)return;const u="function"==typeof t.getTargetRanges?t.getTargetRanges()[0]:void 0,d=u&&!u.collapsed?[Ke(i,e,u.startContainer,u.startOffset),Ke(i,e,u.endContainer,u.endOffset)]:null,p=s({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:d,pending:a});p&&("history"!==p.kind?"format"!==p.kind?P(p.edit,p.range,p.kind):M.current.onFormat(p.style):M.current.onHistory(p.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)}},[]),Z(()=>{const e=S.current;if(!e)return;const t=e.ownerDocument,n=()=>{const e=f.current?.getSource();e&&g(e)};return t.addEventListener("selectionchange",n),()=>t.removeEventListener("selectionchange",n)});const B=(t,n=!1)=>{const r=R();if(!r||r[0]===r[1])return;t.preventDefault();const o=x.current;t.clipboardData.setData("text/plain",o.layout.text.slice(r[0],r[1])),t.clipboardData.setData(c,u(e,l,r[0],r[1])),n&&!d&&P(i(e,l,r[0],r[1],{text:""}),r,"edit")};/* @__PURE__ */
|
|
2
|
+
return Ee("div",{className:"es-rich-wrap",children:[p&&""===e?/* @__PURE__ */Ce("div",{className:"es-rich-placeholder","aria-hidden":"true",children:p}):null,
|
|
3
|
+
/* @__PURE__ */Ce("div",{ref:S,className:`es-rich${o?" is-multiline":" is-single"}${d?" is-off":""}`,contentEditable:!d,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":o,"aria-label":h,"aria-readonly":d||void 0,"aria-placeholder":p,tabIndex:d?-1:0,spellCheck:!0,onFocus:()=>{N.current=e},onBlur:()=>{e!==N.current&&w?.(e),N.current=e},onKeyDown:t=>{if("Escape"===t.key)return t.preventDefault(),k?.(N.current),void(N.current=e);"Enter"!==t.key||o||(t.preventDefault(),e!==N.current&&w?.(e),N.current=e)},onCompositionStart:()=>{const e=R()??[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}=M.current;e.data?P(i(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=>B(e),onCut:e=>B(e,!0),onPaste:t=>{if(t.preventDefault(),d)return;const n=R();if(!n)return;const r=t.clipboardData.getData(c),s=r?o?r:r.replace(/\s*\r?\n\s*/g," "):a({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:t.currentTarget.ownerDocument,multiline:o,rules:l});P(i(e,l,n[0],n[1],{markup:s}),n,"edit")}})]})}var He={fontSize:{key:"fontSize",nameKey:"fontSize",icon:/* @__PURE__ */Ce(le,{}),unit:"px",step:1,shiftStep:10,min:5},lineHeight:{key:"lineHeight",nameKey:"lineHeight",icon:/* @__PURE__ */Ce(re,{}),unit:"%",step:1,shiftStep:10,min:50,max:250,scale:100},letterSpacing:{key:"letterSpacing",nameKey:"letterSpacing",icon:/* @__PURE__ */Ce(ne,{}),unit:"px",step:.1,shiftStep:1,min:-10},paragraphSpacing:{key:"paragraphSpacing",nameKey:"paragraphSpacing",icon:/* @__PURE__ */Ce(te,{}),unit:"px",step:1,shiftStep:10,min:0}};function Ve(e,t){return void 0===e?void 0:Number((e*t).toFixed(6))}function Ae({cells:t,words:n,readOnly:r=!1}){const l=n??e.cells,o=_();/* @__PURE__ */
|
|
4
|
+
return Ce("div",{className:"es-copy-cells-fit",children:/* @__PURE__ */Ce("div",{className:"es-copy-cells",children:t.map(e=>{const t=e.scale??1,n=e.name??(e.nameKey?l[e.nameKey]:e.key),a=e.unit??"",s=e.step??1,i=`${o}-${e.key}`;/* @__PURE__ */
|
|
5
|
+
return Ee("div",{className:"es-copy-cell",children:[
|
|
6
|
+
/* @__PURE__ */Ce("label",{className:"es-field-label es-copy-cell-name",htmlFor:i,children:n}),
|
|
7
|
+
/* @__PURE__ */Ce(d,{id:i,value:Ve(e.value,t),styleValue:Ve(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:r,ariaLabel:n,title:l.tip({name:n,step:s,unit:a})})]},e.key)})})})}var Ue=e=>e.preventDefault();function Ie({colors:e,current:t,words:n,onPick:r}){const l=null===t?null:t.startsWith("#")?t.toLowerCase():e.find(e=>e.name===t)?.value.toLowerCase()??null;/* @__PURE__ */
|
|
8
|
+
return Ee("div",{className:"es-copy-pop es-copy-colors",role:"dialog","aria-label":n.title,onMouseDown:e=>{"INPUT"!==e.target.tagName&&e.preventDefault()},children:[
|
|
9
|
+
/* @__PURE__ */Ce("span",{className:"es-copy-pop-label",children:n.theme}),
|
|
10
|
+
/* @__PURE__ */Ce("div",{className:"es-copy-theme",role:"group","aria-label":n.theme,children:e.map(e=>/* @__PURE__ */Ce($,{content:`${e.label} · ${e.value.toUpperCase()}`,children:/* @__PURE__ */Ce(K,{color:e.value,size:"sm",className:"es-copy-theme-swatch","data-color":e.name,"aria-label":e.label,selected:t===e.name,onMouseDown:Ue,onClick:()=>r(e.name)})},e.name))}),
|
|
11
|
+
/* @__PURE__ */Ce("span",{className:"es-copy-pop-label",children:n.any}),
|
|
12
|
+
/* @__PURE__ */Ce(W,{className:"es-copy-any",value:l??"",onChange:e=>{e!==t&&r(e)},label:n.title,dragWrites:"end"}),
|
|
13
|
+
/* @__PURE__ */Ce("div",{className:"es-copy-pop-foot",children:/* @__PURE__ */Ce(j,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onMouseDown:Ue,onClick:()=>r(null),children:n.remove})})]})}var Xe=(e,t,n)=>Math.min(Math.max(e,t),Math.max(t,n));var qe=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom});function Ye(e){const t=e.ownerDocument,n=t.documentElement,r={left:0,top:0,right:n.clientWidth,bottom:n.clientHeight},l=t.defaultView?.getComputedStyle.bind(t.defaultView);for(let o=e.parentElement;o&&o!==n&&o!==t.body;o=o.parentElement){const e=l?.(o);if(!e||"visible"===e.overflowX&&"visible"===e.overflowY)continue;const t=o.getBoundingClientRect();if(0===t.width&&0===t.height)continue;const n=t.left+o.clientLeft,a=t.top+o.clientTop;r.left=Math.max(r.left,n),r.top=Math.max(r.top,a),r.right=Math.min(r.right,n+(o.clientWidth||t.width)),r.bottom=Math.min(r.bottom,a+(o.clientHeight||t.height))}return r}function Ze(e){const t=e.offsetParent??e.parentElement;if(!t)return{left:0,top:0};const n=t.getBoundingClientRect();return{left:n.left+t.clientLeft-t.scrollLeft,top:n.top+t.clientTop-t.scrollTop}}var _e=/* @__PURE__ */new Set([...y,"clear"]),Qe={bold:/* @__PURE__ */Ce(ge,{size:16}),italic:/* @__PURE__ */Ce(se,{size:16}),strike:/* @__PURE__ */Ce(me,{size:16}),highlight:/* @__PURE__ */Ce(fe,{size:16}),quiet:/* @__PURE__ */Ce(he,{size:16}),link:/* @__PURE__ */Ce(pe,{size:16}),clear:/* @__PURE__ */Ce(oe,{size:16})};function Ge(e){if(!e)return;const t=e.split("+"),n=t.pop().toUpperCase();return["Meta",...t.map(e=>e[0].toUpperCase()+e.slice(1)),n].join("+")}var Je={bold:"is-bold",italic:"is-italic",strike:"is-strike"};function et({tools:t,onApply:n,disabled:r=!1,actions:l,align:o,glyphs:a,ariaLabel:s,pressed:i,open:c=null}){const u=O("copy",e),d=("string"==typeof t[0]?b(t).map(e=>({...e,...u.marks[e.style]})):t).filter(e=>!_e.has(e.style));return 0!==d.length||l||o?/* @__PURE__ */Ee("div",{className:"es-copy-bar",role:"group","aria-label":s??u.formatting,children:[d.map(e=>{const t=a?.[e.style]??Qe[e.style],l=c===e.style||Boolean(i?.[e.style]),o="link"===e.style&&Boolean(i);return F(e.title,/* @__PURE__ */Ce(H,{onMouseDown:e=>e.preventDefault(),onClick:()=>n(e.style),disabled:r,"aria-label":e.name??e.title,"aria-keyshortcuts":Ge(e.shortcut),"aria-pressed":o||!i&&!c?void 0:l,pressed:o?l:void 0,"aria-haspopup":o?"dialog":void 0,"aria-expanded":o?"link"===c:void 0,className:`es-copy-mark${t?" has-glyph":Je[e.style]?` ${Je[e.style]}`:""}${l?" is-active":""}`,children:t??e.label},e.style))}),l?/* @__PURE__ */Ee(De,{children:[
|
|
14
|
+
/* @__PURE__ */Ce("span",{className:"es-copy-bar-split","aria-hidden":"true"}),l]}):null,o?/* @__PURE__ */Ce("span",{className:"es-copy-bar-end",children:o}):null]}):null}function tt({target:e,onChange:t}){const n=X(null);return Y(()=>{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 nt=["bold","italic","underline","strike","sup","sub"];function rt({value:t,onChange:n,onCommit:r,onCancel:s,multiline:i=!1,placeholder:c,ariaLabel:u,className:d,readOnly:p=!1,rules:m,tools:y=[],writeMark:$,actions:K,align:W,glyphs:H,barLabel:Q,renderFooter:G,inputRef:J,barShows:ee="always",richText:te=!0,defaultShowMarks:ne=!1,toolbar:re="final",colors:le,cells:ae,letterCase:se,lastTool:ie}){const ce="final"===re,ue=O("copy",e),de=X(null),pe=J??de,[he,fe]=q(!1),[me,ge]=q(null),ye=X(l()).current,ve=X(null);Z(()=>{const e=ve.current;e&&t===e.to?ve.current=null:e&&t===e.from||(ve.current=null,ye.reset())},[t,ye]);const be=e=>{ve.current={from:ve.current?.from??t,to:e},n(e)},we=e=>({text:t,start:e?.selectionStart??me?.start??t.length,end:e?.selectionEnd??me?.end??t.length}),[ke,Se]=q(ne),xe=te&&!(i&&ke),Ne=X(null),Le=_(),[Te,Me]=q(null),[ze,Be]=q(!1),$e=()=>{if(!xe)return pe.current;const e=Ne.current?.getSource()??me;return e?{selectionStart:e.start,selectionEnd:e.end}:null},Ke=tt({target:pe,onChange:be}),We=e=>(ge({start:e.selectionStart,end:e.selectionEnd}),e),He=(e,n)=>{if(!xe)return void Ke(t=>(n&&ye.record(we(t),"edit",Date.now()),We(e(t))));const r=$e(),l=We(e(r));n&&ye.record(we(r),"edit",Date.now()),Me(null),l.text!==t&&be(l.text),Ne.current?.setSource(l.selectionStart,l.selectionEnd,l.text)},Ve=e=>He(e,!0),Ue=e=>He(t=>{const n=we(t),r=ye[e](n);return r?{text:r.text,selectionStart:r.start,selectionEnd:r.end}:{text:n.text,selectionStart:n.start,selectionEnd:n.end}},!1),Qe=X(null);Y(()=>{const e=Qe.current;e&&(Qe.current=null,xe?Ne.current?.setSource(e.start,e.end,t):(pe.current?.focus(),pe.current?.setSelectionRange(e.start,e.end),ge(e)))},[xe]);const[Ge,Je]=q(null),rt=m??k,lt=("string"==typeof y[0]?b(y):y).filter(e=>!_e.has(e.style)),ot=ce?("string"==typeof y[0]?y:y.map(e=>e.style)).filter(e=>!_e.has(e)):lt.map(e=>e.style),at={};if(me&&(xe||ce)){const e=w(t,me.start,me.end,rt);for(const t of ot){const n=e.has(t)||"highlight"===t&&e.has("accent");at[t]=!!Te?.add.includes(t)||!Te?.drop.includes(t)&&n}ce&&(at.link=e.has("link"))}else if(me)for(const e of ot)at[e]="link"===e?null!==S(t,me.start,me.end):x(t,me.start,me.end,e);const st=()=>{const e=$e(),n=e?.selectionStart??t.length;return{start:n,end:e?.selectionEnd??n}},it=e=>{if(ce&&"link"!==e&&D(0,e)){const{start:n,end:r}=st();if(n===r&&!xe)return void Ve(n=>Oe(t,e,n,(e,t,n,r)=>v(e,t,n,r,rt,ue.placeholders)));const l=o({value:t,rules:rt,start:n,end:r,style:e,pending:Te});return void("pending"===l.kind?Me(l.pending):Ve(()=>l.result))}if("clear"===e)return void Ve(n=>Oe(t,e,n,(e,t,n)=>v(e,t,n,"clear",rt)));if("link"!==e&&xe&&D(0,e)){const n=$e(),r=n?.selectionStart??t.length,l=n?.selectionEnd??r;if(r===l){const n=w(t,r,l,rt),o=n.has(e)||"highlight"===e&&n.has("accent"),a=Te&&Te.at===r?Te:null,s=!!a?.add.includes(e)||!a?.drop.includes(e)&&o,i=(a?.add??[]).filter(t=>t!==e),c=(a?.drop??[]).filter(t=>t!==e);return s&&o?c.push(e):s||o||i.push(e),void Me(i.length||c.length?{add:i,drop:c,at:r}:null)}return void Ve(n=>L(t,n?.selectionStart??r,n?.selectionEnd??l,e,rt))}if("link"!==e){const n=$??((e,t,n,r)=>v(e,t,n,r,k,ue.placeholders));return void Ve(r=>Oe(t,e,r,n))}const n=$e(),r=n?.selectionStart??t.length,l=n?.selectionEnd??r;Be(!1),Je({start:r,end:l,link:S(t,r,l)})},ct=Boolean(me&&me.start!==me.end),ut=me?C(t,me.start,me.end,rt):null,dt=me?Te&&void 0!==Te.color&&Te.at===me.start?Te.color:E(t,me.start,me.end,rt):null,pt=dt?dt.startsWith("#")?dt:le?.find(e=>e.name===dt)?.value:void 0,ht=e=>{xe?e?Ne.current?.setSource(e.start,e.end,t):Ne.current?.focus():(pe.current?.focus(),e&&pe.current?.setSelectionRange(e.start,e.end))},ft=()=>{const e=Ge;Je(null),ht(e?{start:e.start,end:e.end}:me)},mt=()=>{const e=yt.current,t=Boolean(e&&e.querySelector(".es-copy-colors")?.contains(e.ownerDocument.activeElement));Be(!1),t&&ht(me)},gt=X(mt);gt.current=mt,Z(()=>{if(ze)return V(e=>{const t=yt.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(gt.current(),!0)},()=>yt.current?.querySelector(".es-copy-colors"))},[ze]);const yt=X(null),vt=ze||null!==Ge;Z(()=>{const e=yt.current;if(!vt||!e)return;const t=e.ownerDocument,n=()=>{Be(!1),Je(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)}},[vt]);const bt=Ge??(ze?me??{start:t.length,end:t.length}:null),wt=X(()=>{});wt.current=()=>{const e=yt.current,t=e?.querySelector(".rosh-tb-wrap > .es-copy-pop");if(!e||!t||!bt)return;const n=xe?null:e.querySelector(".es-gold-layer"),r=xe?Ne.current?.rangeOf(bt.start,bt.end)??null:n?function(e,t,n){const r=e.ownerDocument,l=r.createTreeWalker(e,4),o=e=>{let t=e,n=null;for(let e=l.nextNode();e;e=l.nextNode()){if(t<=e.data.length)return[e,t];t-=e.data.length,n=e}return n?[n,n.data.length]:null},a=o(t);l.currentNode=e;const s=o(n);if(!a||!s)return null;const i=r.createRange();return i.setStart(a[0],a[1]),i.setEnd(s[0],s[1]),i}(n,bt.start,bt.end):null,l=r?.endContainer,o=l?1===l.nodeType?l:l.parentElement:null,a=r?function(e,t){const n=("function"==typeof e.getClientRects?[...e.getClientRects()]:[]).filter(e=>e.height>0);if(n.length>0){const t="function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():n[0];return t.height>0?qe(t):qe(n[0])}if(!t)return null;const r=t.getBoundingClientRect();return{left:r.left,top:r.top,right:r.left,bottom:r.bottom}}(r,o?.closest(".es-rich-line, .es-gold-layer")??null):null;if(!a)return;const s=function({anchor:e,size:t,within:n,clip:r,parent:l,gap:o=8}){const a=Math.max(n.left,r.left),s=Math.min(n.right,r.right)-t.width,i=Xe(e.left,a,s),c=r.bottom-(e.bottom+o),u=e.top-o-r.top,d=t.height>c&&(t.height<=u||u>c),p=d?e.top-o-t.height:e.bottom+o,h=e.left+Math.min((e.right-e.left)/2,10),f=Xe(h-5-i,10,t.width-10-10);return{top:p-l.top,left:i-l.left,above:d,point:f}}({anchor:a,size:{width:t.offsetWidth,height:t.offsetHeight},within:e.getBoundingClientRect(),clip:Ye(e),parent:Ze(t)});t.style.top=`${s.top}px`,t.style.left=`${s.left}px`,t.style.setProperty("--es-pop-point",`${s.point}px`),t.dataset.side=s.above?"above":"below"},Y(()=>{const e=yt.current;if(!vt||!e)return;const t=()=>wt.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()}},[vt,ze,Ge,bt?.start,bt?.end,xe]);const kt=e=>Ge&&/* @__PURE__ */Ce(I,{className:e?"es-copy-link es-copy-pop":"es-copy-link",value:Ge.link?.href??"",onApply:e=>{const n=Ge;Je(null),Ve(()=>xe?P(t,n.start,n.end,e,rt):B(t,n.start,n.end,e))},onRemove:Ge.link?()=>{const e=Ge.link,n=Ge;Je(null),e&&Ve(()=>xe?R(t,n.start,n.end,rt):z(t,e))}:void 0,onCancel:ft}),St=W?Re(W.allow,ue.align):[],xt="always"===ee||he||null!==Ge||ze,Ct=le&&le.length>0?{run:pt,open:ze,onToggle:()=>{Je(null),ze?mt():Be(!0)}}:void 0,Et=xt&&ce&&ie?ie({className:"rosh-tb-btn",disabled:p,selected:ct,keepCaret:e=>e.preventDefault(),insert:e=>Ve(n=>Fe(t,e,n))}):void 0,Dt=new Set(ot),Nt=W?{value:W.value,allow:W.allow,onChange:W.onChange,disabled:W.disabled}:void 0,Lt={pressed:ut,onList:e=>{const{start:n,end:r}=st(),l=C(t,n,r,rt);Ve(()=>M(t,n,r,l===e?null:e,rt))}},Tt=A({offered:Dt,color:Ct,last:Et,alignment:Nt,list:Lt,letterCase:se}),Mt=ce&&xt&&(nt.some(e=>Dt.has(e))||Boolean(Ct));/* @__PURE__ */
|
|
15
|
+
return Ee("div",{ref:yt,className:"es-copy"+(d?` ${d}`:""),onFocus:()=>fe(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||fe(!1)},onKeyDown:e=>{const t=e.target===pe.current||Boolean(e.target.closest?.(".es-rich"));if(p||!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 Ue(l||e.shiftKey?"redo":"undo");const o=`${e.shiftKey?"shift+":""}${n}`;if(ce){const t={b:"bold",i:"italic",u:"underline",k:"link"}[o];if(!t||!ot.includes(t))return;return e.preventDefault(),e.stopPropagation(),void it(t)}const a=lt.find(e=>e.shortcut===o);a&&(e.preventDefault(),e.stopPropagation(),it(a.style))},onPaste:e=>{const n=pe.current;if(p||!n||e.target!==n)return;e.preventDefault();const r=a({html:e.clipboardData.getData("text/html"),text:e.clipboardData.getData("text/plain")},{doc:n.ownerDocument,multiline:i,rules:rt});Ve(e=>Fe(t,r,e))},style:le&&le.length>0?Object.fromEntries(le.map(e=>[`--es-color-${e.name}`,e.value])):void 0,onSelect:()=>{const e=pe.current;e&&e.ownerDocument.activeElement===e&&ge({start:e.selectionStart??t.length,end:e.selectionEnd??t.length})},children:[xt&&ce&&(Tt.words||Tt.paragraph)?
|
|
16
|
+
/* @__PURE__ */Ce(U,{className:"es-copy-toolbar","aria-label":Q??ue.formatting,offered:Dt,pressed:at,onMark:e=>it(e),color:Ct,linkOpen:null!==Ge,last:Et,alignment:Nt,list:Lt,letterCase:se,disabled:p,windows:/* @__PURE__ */Ee(De,{children:[ze&&le&&le.length>0?/* @__PURE__ */Ce(Ie,{colors:le,current:dt,words:ue.colors??e.colors,onPick:e=>{const{start:n,end:r}=st();if(n!==r)Ve(()=>T(t,n,r,e,rt));else{if(!xe)return;Me({add:Te?.add??[],drop:Te?.drop??[],color:e,at:n})}}}):null,Ge?kt(!0):null]})}):null,ce&&ae&&ae.length>0?/* @__PURE__ */Ce(Ae,{cells:ae,words:ue.cells??e.cells,readOnly:p}):null,xt&&!ce?/* @__PURE__ */Ce(et,{tools:y,disabled:p,actions:K,glyphs:H,ariaLabel:Q,pressed:at,open:Ge?"link":null,onApply:it,align:W?/* @__PURE__ */Ce(h,{options:St,value:W.value,onChange:W.onChange,ariaLabel:ue.alignment,disabled:p||W.disabled,fit:Pe(St)}):null}):null,xe?/* @__PURE__ */Ce(je,{value:t,rules:rt,multiline:i,readOnly:p,placeholder:c,ariaLabel:u,handle:Ne,pending:Te??void 0,onEdit:(e,n,r)=>{ye.record({text:t,start:n.start,end:n.end},r,Date.now()),Me(null),be(e)},onSelect:e=>{ge(t=>t&&t.start===e.start&&t.end===e.end?t:e),!Te||e.start===Te.at&&e.end===Te.at||Me(null)},onHistory:Ue,onFormat:e=>{ot.includes(e)&&it(e)},onCommit:r,onCancel:s}):/* @__PURE__ */Ce(g,{value:t,onInput:e=>{ye.record(we(null),"type",Date.now()),be(e)},onCommit:r,onCancel:s,multiline:i,placeholder:c,ariaLabel:u,rules:m,disabled:p,inputRef:pe,className:"es-copy-box"}),Ge&&!ce?kt(!1):null,G?G({focused:he,insert:e=>Ve(n=>Fe(t,e,n))}):null,te&&i||Mt?
|
|
17
|
+
/* @__PURE__ */Ee("div",{className:"es-copy-marks",children:[te&&i?/* @__PURE__ */Ee(De,{children:[
|
|
18
|
+
/* @__PURE__ */Ce(f,{checked:ke,onChange:()=>{const e=$e();Qe.current=e&&null!==e.selectionStart&&null!==e.selectionEnd?{start:e.selectionStart,end:e.selectionEnd}:me,Me(null),Se(e=>!e)},ariaLabelledBy:Le,disabled:p}),
|
|
19
|
+
/* @__PURE__ */Ce("span",{id:Le,className:"es-copy-marks-label",children:ue.showMarks??"Show marks"})]}):null,Mt?F(ct?void 0:ue.clearStyleEmpty??"Select words first",/* @__PURE__ */Ee(j,{variant:"secondary",size:"sm",className:"es-copy-clear",disabled:p||!ct,onMouseDown:e=>e.preventDefault(),onClick:()=>{const{start:e,end:n}=st();if(e===n)return;const r=N(t,e,n,rt);r.text!==t&&Ve(()=>r)},children:[
|
|
20
|
+
/* @__PURE__ */Ce(oe,{size:16}),ue.clearStyle??e.clearStyle]})):null]}):null]})}var lt=["none","bullet","number"],ot=["none","upper","capitalize","lower"],at={none:/* @__PURE__ */Ce(be,{}),bullet:/* @__PURE__ */Ce(ve,{}),number:/* @__PURE__ */Ce(ye,{})},st={none:/* @__PURE__ */Ce(xe,{}),upper:/* @__PURE__ */Ce(Se,{}),capitalize:/* @__PURE__ */Ce(ke,{}),lower:/* @__PURE__ */Ce(we,{})};function it({label:e,icon:t,answers:n,names:r,glyphs:l,row:o}){const a=o.value||o.styleValue||"";/* @__PURE__ */
|
|
21
|
+
return Ce(m,{label:e,icon:t,children:/* @__PURE__ */Ce(h,{ariaLabel:e,value:a,onChange:e=>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 ct({kept:t,style:n,font:r,italic:l,cells:o,align:a,list:s,letterCase:i}){const c=O("copy",e),u={...e.panel,...c.panel},d=c.clearStyle??e.clearStyle,h=n?[n.onClearChanges&&{label:d,onSelect:n.onClearChanges},n.onEditStyles&&{label:u.editStyles,onSelect:n.onEditStyles},n.onUpdateStyle&&{label:u.updateStyle,onSelect:n.onUpdateStyle}].filter(e=>!!e):[],f=!!l&&(l.value??l.styleValue??!1);/* @__PURE__ */
|
|
22
|
+
return Ee("div",{className:"es-tpp",children:[t?/* @__PURE__ */Ce("div",{className:"es-tpp-kept",children:/* @__PURE__ */Ce(rt,{...t})}):null,n?/* @__PURE__ */Ce(m,{label:u.style,icon:/* @__PURE__ */Ce(ae,{}),children:/* @__PURE__ */Ce(p,{ariaLabel:u.style,value:n.value,options:n.options,onChange:n.onChange,changed:n.changed,footer:h})}):null,r?/* @__PURE__ */Ce(m,{label:u.font,icon:/* @__PURE__ */Ce(ie,{}),children:/* @__PURE__ */Ee("div",{className:"es-tpp-font",children:[
|
|
23
|
+
/* @__PURE__ */Ce("div",{className:"es-tpp-font-select",children:/* @__PURE__ */Ce(p,{ariaLabel:u.font,value:r.value||void 0,placeholder:r.styleValue,options:r.options,onChange:r.onChange,searchable:r.searchable})}),l?/* @__PURE__ */Ce($,{content:u.italic,children:/* @__PURE__ */Ce(H,{size:"sm",variant:"ghost","aria-label":u.italic,"aria-pressed":f,onClick:()=>{const e=!f;l.onChange(e===(l.styleValue??!1)?void 0:e)},children:/* @__PURE__ */Ce(se,{})})}):null]})}):null,o?.length?/* @__PURE__ */Ce(Ae,{cells:o,words:c.cells}):null,a?/* @__PURE__ */Ce(it,{label:c.alignment,icon:/* @__PURE__ */Ce(ce,{}),answers:Ne.filter(e=>!a.allow||a.allow.includes(e)),names:c.align,glyphs:Te,row:a}):null,s?/* @__PURE__ */Ce(it,{label:u.list,icon:/* @__PURE__ */Ce(ue,{}),answers:lt,names:u.lists,glyphs:at,row:s}):null,i?/* @__PURE__ */Ce(it,{label:u.capitalization,icon:/* @__PURE__ */Ce(de,{}),answers:ot,names:u.cases,glyphs:st,row:i}):null]})}export{Ne as COPY_ALIGNS,Me as COPY_ALIGN_FIT,Te as COPY_ALIGN_GLYPHS,Le as COPY_ALIGN_LABELS,He as COPY_CELLS,Ie as ColorWindow,rt as CopyBox,Ae as CopyCells,et as MarkBar,je as RichBox,ct as TextPartPanel,Ge as ariaShortcut,Re as copyAlignOptions,Fe as insertSelection,Oe as markSelection,tt as useCaretEdit};
|
package/dist/easel/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { TextToolbarProps } from 'efficient-shell/ui';
|
|
|
11
11
|
import { C as CanvasTypingEnd } from '../canvas-typing-Cnvlsh_V.js';
|
|
12
12
|
import { InlineRule } from '../markup/index.js';
|
|
13
13
|
import { b as NodeOpsHost, C as ClipboardEntry } from '../useNodeOps-BHRkUFfG.js';
|
|
14
|
-
import { I as InspectorFields } from '../types-
|
|
14
|
+
import { I as InspectorFields } from '../types-C97TAUKi.js';
|
|
15
15
|
import '../buckets-Tj-nkBpg.js';
|
|
16
16
|
|
|
17
17
|
interface EaselOptions<C extends EaselConfig = EaselConfig> {
|
package/dist/fields/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { S as SettingsBucket } from '../buckets-Tj-nkBpg.js';
|
|
4
4
|
export { D as DesignGroup } from '../buckets-Tj-nkBpg.js';
|
|
5
|
-
import { a as InspectorFieldDef, F as FieldRenderer, I as InspectorFields, b as FieldTextProps, c as FieldNumberProps, d as FieldSliderProps, e as FieldSelectManyProps, f as FieldSelectOneProps, g as FieldOption } from '../types-
|
|
6
|
-
export { A as ArrayFieldDef, C as CustomFieldDef, h as CustomFieldRenderProps, i as FieldSelectProps, N as NumberFieldDef, O as ObjectFieldDef, R as RadioFieldDef, S as SelectFieldDef, j as SlotFieldDef, T as TextFieldDef, k as TextareaFieldDef } from '../types-
|
|
5
|
+
import { a as InspectorFieldDef, F as FieldRenderer, I as InspectorFields, b as FieldTextProps, c as FieldNumberProps, d as FieldSliderProps, e as FieldSelectManyProps, f as FieldSelectOneProps, g as FieldOption } from '../types-C97TAUKi.js';
|
|
6
|
+
export { A as ArrayFieldDef, C as CustomFieldDef, h as CustomFieldRenderProps, i as FieldSelectProps, N as NumberFieldDef, O as ObjectFieldDef, R as RadioFieldDef, S as SelectFieldDef, j as SlotFieldDef, T as TextFieldDef, k as TextareaFieldDef } from '../types-C97TAUKi.js';
|
|
7
7
|
import { R as ResolvableItem } from '../resolve-D68pb3Bx.js';
|
|
8
8
|
export { F as FieldsWords } from '../words-vhnV8sM7.js';
|
|
9
9
|
export { LinkFilter, LinkFilterField, LinkKindChoice, LinkOption, LinkOptionGroup, LinkPicker, LinkPickerProps, LinkRules, LinkTarget } from 'efficient-shell/ui';
|
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-26GHWMNN.js";export{FieldSlider}from"../chunk-XWFH2NHZ.js";import"../chunk-4JSBIW5H.js";import"../chunk-RC25EGHD.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-EA2HTX37.js";export{FieldNumber}from"../chunk-66LWADFP.js";export{FieldSelect,optionFor}from"../chunk-65Z5FSAW.js";import"../chunk-XJCMEEBH.js";import"../chunk-FFYXVAAL.js";import"../chunk-MFIRYGHW.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
|
package/dist/panel/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { W as WordFit } from '../wordFit-7XpmhcaW.js';
|
|
4
4
|
import { P as PanelWords } from '../words-zH1H0WFw.js';
|
|
5
|
-
export { CornerOption as SettingsCornerPoint, CornersInput as SettingsCorners, CornersInputProps as SettingsCornersProps, AlignmentGrid as SettingsPlacement, AlignmentPoint as SettingsPlacementPoint, AlignmentGridProps as SettingsPlacementProps } from 'efficient-shell/ui';
|
|
5
|
+
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
6
|
export { a as DESIGN_GROUPS, D as DesignGroup, b as SETTINGS_BUCKETS, S as SettingsBucket } from '../buckets-Tj-nkBpg.js';
|
|
7
7
|
|
|
8
8
|
/**
|
package/dist/panel/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export{DESIGN_GROUPS,SETTINGS_BUCKETS,
|
|
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-XJCMEEBH.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
|
-
return
|
|
4
|
-
/* @__PURE__ */
|
|
5
|
-
/* @__PURE__ */
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
return
|
|
9
|
-
return
|
|
10
|
-
return
|
|
11
|
-
return
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
-
/* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
return
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
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
|
+
/* @__PURE__ */l("span",{className:"es-tab-tip",children:[
|
|
5
|
+
/* @__PURE__ */a("span",{className:"es-tab-icon","aria-hidden":"true",children:e.icon}),
|
|
6
|
+
/* @__PURE__ */a("span",{className:"es-tab-word has-icon",children:e.label})]}),t]})}:{id:e.id,label:/* @__PURE__ */l(r,{children:[
|
|
7
|
+
/* @__PURE__ */a("span",{className:"es-tab-word",children:e.label}),t]})}})})})}function u({title:e,level:t=3,id:s,className:i}){/* @__PURE__ */
|
|
8
|
+
return a(`h${t}`,{id:s,className:i?`es-group-head ${i}`:"es-group-head",children:e})}function m({title:e,level:t=4,id:s,className:i}){/* @__PURE__ */
|
|
9
|
+
return a(`h${t}`,{id:s,className:i?`es-group-sub ${i}`:"es-group-sub",children:e})}function h({label:s,changed:i,onReset:n,detail:l,disabled:r,defaultAction:c,words:o,className:u}){const m={...e,...o},h=["es-default-reset"];if(i&&h.push("is-changed"),u&&h.push(u),!i&&c)return h.push("is-pressable"),t(c.title,/* @__PURE__ */a("button",{type:"button",className:h.join(" "),"aria-label":c.title,disabled:r,onClick:c.onPress,children:c.icon}));if(!i)/* @__PURE__ */
|
|
10
|
+
return a("span",{className:h.join(" "),"aria-hidden":"true"});const N=m.resetName({label:s});return t(l?m.resetTitle({label:s,detail:l}):N,/* @__PURE__ */a("button",{type:"button",className:h.join(" "),"aria-label":N,"aria-description":l||void 0,disabled:r,onClick:e=>{n(),function(e){const t=e.currentTarget,s=t.closest(".es-field");let i=s?.querySelector(p(".es-field-ctl"))??s?.querySelector(p(".es-field-head"))??null,n=s?null:t.parentElement;for(let e=0;!i&&n&&e<f;e+=1,n=n.parentElement)i=[...n.querySelectorAll(b)].find(e=>e!==t)??null;i?.focus()}(e)},children:/* @__PURE__ */a(d,{size:15})}))}var b=['input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","button:not([disabled]):not(.es-default-reset)",'[tabindex]:not([tabindex="-1"])'].join(", "),p=e=>b.split(", ").map(t=>`${e} ${t}`).join(", "),f=4;function N({name:e,preview:t,offPage:s,status:i,onOpen:d,id:c,className:o}){const u=null!=t;/* @__PURE__ */
|
|
11
|
+
return l("button",{type:"button",id:c,className:o?`es-drill ${o}`:"es-drill",onClick:d,children:[
|
|
12
|
+
/* @__PURE__ */l(n,{content:u?/* @__PURE__ */l(r,{children:[e,
|
|
13
|
+
/* @__PURE__ */a("br",{}),t]}):e,describe:!1,className:"es-drill-text",children:[
|
|
14
|
+
/* @__PURE__ */a("span",{className:"es-drill-name",children:e}),u?/* @__PURE__ */a("span",{className:s?"es-drill-preview is-offpage":"es-drill-preview",children:t}):null]}),i?/* @__PURE__ */a("span",{className:"es-drill-status",children:i}):null,
|
|
15
|
+
/* @__PURE__ */a("span",{className:"es-drill-chev","aria-hidden":"true"})]})}function g({label:e,onPress:t,disabled:s,note:i,done:n,doneLabel:r,icon:d,id:c,className:o}){const u=void 0===r?e:r,m=n?u:e,h=null!=i,b=h&&c?`${c}-note`:void 0;/* @__PURE__ */
|
|
16
|
+
return l("div",{className:o?`es-action-wrap ${o}`:"es-action-wrap",children:[
|
|
17
|
+
/* @__PURE__ */l("button",{type:"button",id:c,className:n?"es-action is-done":"es-action",disabled:s,"aria-describedby":b,onClick:t,children:[d?/* @__PURE__ */a("span",{className:"es-action-icon","aria-hidden":"true",children:d}):null,
|
|
18
|
+
/* @__PURE__ */a("span",{className:"es-action-label",children:m})]}),h?/* @__PURE__ */a("p",{id:b,className:"es-action-note",children:i}):null,
|
|
19
|
+
/* @__PURE__ */a("span",{className:"es-action-live",role:"status","aria-live":"polite",children:n?u:null})]})}export{g as SettingsAction,h as SettingsDefaultReset,N as SettingsDrill,u as SettingsGroupHead,m as SettingsGroupSub,o as SettingsTabs};
|
package/dist/panel/panel.css
CHANGED
|
@@ -889,10 +889,13 @@ button.es-group-head:hover { background: var(--es-chip-bg); }
|
|
|
889
889
|
outline-offset: 1px;
|
|
890
890
|
}
|
|
891
891
|
|
|
892
|
-
/* A
|
|
893
|
-
|
|
894
|
-
.
|
|
895
|
-
|
|
892
|
+
/* WHATEVER A HOST PUTS IN `action` SITS AT THE ROW'S RIGHT END: the Default /
|
|
893
|
+
Reset part (or the shell Tooltip wrapper round it), a switch, the `Each side`
|
|
894
|
+
toggle of the Padding and Border rows. ONE rule for all of them (plan E-P,
|
|
895
|
+
2026-10-16), where the Default / Reset part had two of its own. A value, when
|
|
896
|
+
drawn, already takes the free space (`.es-field-value`), and the action
|
|
897
|
+
follows it. */
|
|
898
|
+
.es-field-name + :not(.es-field-value) { margin-left: auto; }
|
|
896
899
|
|
|
897
900
|
/* THE GREY VALUE IS THE "DEFAULT" WORD NOW (option E): a row whose slot is
|
|
898
901
|
empty draws its value grey, and the value takes the text colour once the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AddBlockRow as default}from"../../chunk-
|
|
1
|
+
export{AddBlockRow as default}from"../../chunk-4CE7XFCE.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-LGDQLTJW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-JTUUIVBZ.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-26GHWMNN.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-RC25EGHD.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-65Z5FSAW.js";import"../../chunk-XJCMEEBH.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-
|
|
1
|
+
export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-XTDBTCVO.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-PPL7GB7D.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-LGDQLTJW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-JTUUIVBZ.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-26GHWMNN.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-RC25EGHD.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-65Z5FSAW.js";import"../../chunk-XJCMEEBH.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-FCLW4LEN.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MediaSidePanel as default}from"../../chunk-
|
|
1
|
+
export{MediaSidePanel as default}from"../../chunk-2AKW6UXX.js";import"../../chunk-LGDQLTJW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-26GHWMNN.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-RC25EGHD.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-65Z5FSAW.js";import"../../chunk-XJCMEEBH.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ScreenChrome as default}from"../../chunk-
|
|
1
|
+
export{ScreenChrome as default}from"../../chunk-BPLCMQ6S.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-BRDCD4LK.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-OGCROOTI.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-BHRC3ASL.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-OWW44DVK.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-TZIIRGVY.js";import"../../chunk-XO7OUCZV.js";import"../../chunk-K2YSFVOJ.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-D6N77AOS.js";import"../../chunk-P4CL4YQI.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-W4U4SHKW.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-THZ46DC5.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-V7U33NF2.js";import"../../chunk-5545A3PC.js";import"../../chunk-XTDBTCVO.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-PPL7GB7D.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-2AKW6UXX.js";import"../../chunk-LGDQLTJW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-JTUUIVBZ.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-26GHWMNN.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-RC25EGHD.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-4VJATVVR.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-65Z5FSAW.js";import"../../chunk-XJCMEEBH.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-FCLW4LEN.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|