efficient-easel 26.4.0 → 26.6.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 CHANGED
@@ -663,7 +663,9 @@ allow a published page to take easel through `render`, `draw` and
663
663
  Button's and the corners' stored keys (`BUTTON_STYLE_KEYS`,
664
664
  `BUTTON_PAD_KEYS`, `CORNER_SIDES`: the same objects as
665
665
  `screen/lib/content/style-keys` and the editor's `button-fields` /
666
- `style-fields`), and the
666
+ `style-fields`), the one reader of a stored corner set
667
+ (`normalizeCornerSides`: `null` = nothing stored = all four, `[]` = square,
668
+ else known corners in `border-radius` order; `hasCornerSubset`), and the
667
669
  names of the wrapper round each drawn copy of a template
668
670
  (`REPEAT_ATTRIBUTE` = `data-sf-repeat`, `REPEAT_INDEX_ATTRIBUTE` =
669
671
  `data-sf-repeat-index`; see `canvas` below). No React and no import: a
@@ -1438,6 +1440,8 @@ A host with a window system of its own does not use the dialog: it calls
1438
1440
  `usePageCopyForm({ source, taken, duplicate, onDuplicated })` and draws
1439
1441
  `<DuplicatePageFields form={form} host={host} />` inside its own window, with
1440
1442
  `form.submit` on its own button (efficient-admin-portal's `PopupForm`).
1443
+ `form.slug` is the handle as typed (it may end on the word-break "-");
1444
+ `form.finalSlug` is the handle that is checked, shown in the URL hint and sent.
1441
1445
  Its words are `pageCopy` in `efficient-easel/strings`.
1442
1446
 
1443
1447
  ## The engine's words — `efficient-easel/strings`
@@ -1 +1 @@
1
- import{styleFieldBuilders as e,keptByRow as s}from"./chunk-SS2NY7PP.js";import{boxFieldBuilders as o,PHONE_KEY_ACCESS as l,phoneTwinFields as r,section as i}from"./chunk-UJU42JM4.js";import{deviceField as t}from"./chunk-7GGNFLHT.js";import{BUTTON_STYLE_KEYS as c,BUTTON_PAD_KEYS as n}from"./chunk-BTQ3FJKT.js";import{TextColorIcon as u,GroundIcon as d}from"efficient-shell/icons/efficient";import{jsx as f}from"react/jsx-runtime";function a(a){const p=o(a.say),y=e(a.say),F=c,m=a.style,k=a.phone??l;return{_dSize:i("Size"),...p.sidesPaddingFields({keys:n,group:!1,...a.padding}),_dDesign:i("Design"),[F.fill]:y.colourField({key:F.fill,access:m,label:"Fill color",icon:/* @__PURE__ */f(d,{}),useFollows:a.follows.useFill,usePresets:a.usePresets,resetTo:a.resetTo,opacity:{key:F.fillOpacity,useUnset:a.follows.useFillOpacity}}),[F.fillOpacity]:s(F.fill),[F.border]:y.borderField({key:F.border,access:m,useFollows:a.follows.useBorder}),[F.text]:y.colourField({key:F.text,access:m,label:"Text color",icon:/* @__PURE__ */f(u,{}),useFollows:a.follows.useText,usePresets:a.usePresets,resetTo:a.resetTo}),[F.corners]:y.cornersField({key:F.corners,access:m,sidesKey:F.cornerSides,useFollows:a.follows.useCorners}),[F.cornerSides]:s(F.corners),_dLayout:i("Layout"),...r("align",p.blockAlignmentField({phone:!0},""),k),align:t("desktop",p.blockAlignmentField())}}export{a as buttonFieldSet};
1
+ import{styleFieldBuilders as e,keptByRow as s}from"./chunk-XGSYK6SO.js";import{boxFieldBuilders as o,PHONE_KEY_ACCESS as l,phoneTwinFields as r,section as i}from"./chunk-UJU42JM4.js";import{deviceField as t}from"./chunk-7GGNFLHT.js";import{BUTTON_STYLE_KEYS as c,BUTTON_PAD_KEYS as n}from"./chunk-BAI7MIH4.js";import{TextColorIcon as u,GroundIcon as d}from"efficient-shell/icons/efficient";import{jsx as f}from"react/jsx-runtime";function a(a){const p=o(a.say),y=e(a.say),F=c,m=a.style,k=a.phone??l;return{_dSize:i("Size"),...p.sidesPaddingFields({keys:n,group:!1,...a.padding}),_dDesign:i("Design"),[F.fill]:y.colourField({key:F.fill,access:m,label:"Fill color",icon:/* @__PURE__ */f(d,{}),useFollows:a.follows.useFill,usePresets:a.usePresets,resetTo:a.resetTo,opacity:{key:F.fillOpacity,useUnset:a.follows.useFillOpacity}}),[F.fillOpacity]:s(F.fill),[F.border]:y.borderField({key:F.border,access:m,useFollows:a.follows.useBorder}),[F.text]:y.colourField({key:F.text,access:m,label:"Text color",icon:/* @__PURE__ */f(u,{}),useFollows:a.follows.useText,usePresets:a.usePresets,resetTo:a.resetTo}),[F.corners]:y.cornersField({key:F.corners,access:m,sidesKey:F.cornerSides,useFollows:a.follows.useCorners,useFollowsSides:a.follows.useCornerSides}),[F.cornerSides]:s(F.corners),_dLayout:i("Layout"),...r("align",p.blockAlignmentField({phone:!0},""),k),align:t("desktop",p.blockAlignmentField())}}export{a as buttonFieldSet};
@@ -0,0 +1 @@
1
+ var t={fill:"buttonColor",fillOpacity:"buttonFillOpacity",border:"buttonBorder",text:"buttonTextColor",corners:"buttonCorners",cornerSides:"buttonCornerSides"},n={top:"buttonPaddingTop",right:"buttonPaddingRight",bottom:"buttonPaddingBottom",left:"buttonPaddingLeft"},o=["tl","tr","br","bl"];function r(t){if(!Array.isArray(t))return null;const n=t.filter(t=>o.includes(t));return o.filter(t=>n.includes(t))}function e(t){const n=r(t);return null!==n&&n.length<o.length}export{n as BUTTON_PAD_KEYS,t as BUTTON_STYLE_KEYS,o as CORNER_SIDES,e as hasCornerSubset,r as normalizeCornerSides};
@@ -0,0 +1,4 @@
1
+ import{useAccessPatch as e,FLAT_ACCESS as o,onDesktopWords as r,useAccessValue as t}from"./chunk-UJU42JM4.js";import{CornersInput as s,BorderInput as l,SettingsColour as n}from"./chunk-CLAADE4J.js";import{SettingsDefaultReset as i}from"./chunk-2T22IY3J.js";import{noControlField as c,NoControlMark as a}from"./chunk-22I55W37.js";import{normalizeCornerSides as d,CORNER_SIDES as u}from"./chunk-BAI7MIH4.js";import{DEFAULT_PANEL_WORDS as p,DEFAULT_COLOUR_ROW_WORDS as y}from"./chunk-56ID6FKZ.js";import{SettingsField as f}from"./chunk-MIX7EGRG.js";import{useWords as h}from"./chunk-MFIRYGHW.js";import{CornerIcon as m,BorderAllIcon as b}from"efficient-shell/icons/efficient";import{jsx as w}from"react/jsx-runtime";var g=e=>e;function v(e,o){const r=o.twinAccess;return r?{key:e.key,access:r,ownField:r.ownField}:e}function k(e,r){const s=!e.access||e.ownField?{value:r.value,onChange:r.onChange}:void 0;return t(e.access??o,e.key,s)}function F(e,r){return t(e.access??o,r??"")}function j(e){return{...c({type:"custom",render:()=>/* @__PURE__ */w(a,{})},"always"),reachedBy:e}}function B({o:t,say:s,props:l}){const i=h("colourRow",y),c=h("panel",p),a=t.useFollows(),d=t.usePresets?.(),u=t.opacity?.useUnset?.()??100,f=v(t,l),[m,b]=k(f,l),[g,j]=F(f,t.opacity?.key),B=e(f.access??o),C="string"==typeof m?m:"",O="number"==typeof g,A="follows"in l,x=(A&&"string"==typeof l.follows&&""!==l.follows?l.follows:void 0)??a,I=t.access||A?void 0:"";/* @__PURE__ */
2
+ return w(n,{label:s(t.label),icon:t.icon,value:C,onChange:e=>b(""===e?I:e),inherited:x,presets:d,changed:""!==C||O,onReset:()=>{O&&t.opacity?B([[t.key,I],[t.opacity.key,void 0]]):b(I)},resetTo:A?r(s,x.toUpperCase()):t.resetTo?t.resetTo(a.toUpperCase()):a.toUpperCase(),...t.opacity?{opacity:O?g:u,onOpacityChange:e=>j(e)}:{},readOnly:l.readOnly,words:i,resetWords:c})}var C=20;function O({o:e,say:o,props:t}){const s=e.useFollows(),[n,c]=k(v(e,t),t),a=n&&"object"==typeof n?n:{},d="follows"in t,u=d&&t.follows&&"object"==typeof t.follows?t.follows:{},p="number"==typeof u.width?u.width:s.width,y="string"==typeof u.color&&""!==u.color?u.color:s.color,h=Object.keys(a).length>0,m={width:o("Border width"),sides:{top:o("Border top"),right:o("Border right"),bottom:o("Border bottom"),left:o("Border left")},style:o("Border style"),styles:{solid:o("Solid"),dashed:o("Dashed"),dotted:o("Dotted")},color:o("Border color"),unit:"px"};/* @__PURE__ */
3
+ return w(f,{label:o("Border"),icon:/* @__PURE__ */w(b,{}),action:d?/* @__PURE__ */w(i,{label:o("Border"),changed:h,detail:r(o,`${p}px`),disabled:t.readOnly,onReset:()=>c(void 0)}):void 0,children:/* @__PURE__ */w(l,{label:o("Border"),value:a,each:!1,onChange:o=>c(function(e){const o=Object.fromEntries(Object.entries(e).filter(([,e])=>null!=e&&""!==e));return Object.keys(o).length?o:void 0}(e.styles?{width:o.width,color:o.color,style:o.style}:{width:o.width,color:o.color})),placeholder:{sides:{top:p,right:p,bottom:p,left:p},style:u.style??"solid",color:y},presets:[y],words:m,styles:e.styles??!1,max:20,readOnly:t.readOnly})})}var A=40,x=()=>null;function I({o:r,say:t,props:l}){const n=h("panel",p),c=r.useFollows(),[a,y]=k(r,l),[b,g]=F(r,r.sidesKey),v=e(r.access??o),j=r.access?void 0:null,B="number"==typeof a&&Number.isFinite(a)?a:null,C=d((r.useFollowsSides??x)())??[...u],O=d(b)??C,A=[{value:"tl",label:t("Top left")},{value:"tr",label:t("Top right")},{value:"bl",label:t("Bottom left")},{value:"br",label:t("Bottom right")}];/* @__PURE__ */
4
+ return w(f,{label:t("Corners"),icon:/* @__PURE__ */w(m,{}),changed:null!==B||Array.isArray(b),action:/* @__PURE__ */w(i,{label:t("Corners"),changed:null!==B||Array.isArray(b),detail:`${c}px`,onReset:()=>Array.isArray(b)?v([[r.key,j],[r.sidesKey,j]]):y(j),words:n}),children:/* @__PURE__ */w(s,{label:t("Corners"),value:O,corners:A,onChange:e=>{const o=u.filter(o=>e.includes(o)),r=o.length===C.length&&o.every(e=>C.includes(e));g(r?j:o)},radius:B,onRadiusChange:e=>y(e??j),radiusMin:0,radiusMax:40,radiusStep:r.step??1,radiusPlaceholder:String(c),disabled:l.readOnly})})}function R(e=g){return{colourField:o=>({type:"custom",render:r=>/* @__PURE__ */w(B,{o:o,say:e,props:r})}),borderField:o=>({type:"custom",render:r=>/* @__PURE__ */w(O,{o:o,say:e,props:r})}),cornersField:o=>({type:"custom",render:r=>/* @__PURE__ */w(I,{o:o,say:e,props:r})})}}var{colourField:M,borderField:T,cornersField:U}=R();export{C as BORDER_WIDTH_MAX,A as CORNER_RADIUS_MAX,T as borderField,M as colourField,U as cornersField,j as keptByRow,R as styleFieldBuilders};
@@ -9,5 +9,5 @@ export { HERO_SLIDER_GOTO_EVENT, HeroSliderGotoDetail } from '../screen/lib/docu
9
9
  export { B as BLOCK_ATTRIBUTE, R as REPEAT_ATTRIBUTE, a as REPEAT_INDEX_ATTRIBUTE } from '../dom-BpxMcHFP.js';
10
10
  export { TEXT_STYLE_CASES, TEXT_STYLE_CASE_CSS, TextStyleCase, TextStyleCaseCss, isTextStyleCase, textStyleCaseCss, textStyleCaseOfCss } from '../text-styles/model.js';
11
11
  export { BLOCK_FIXED_WIDTH, BLOCK_SIZE_KEYS, BLOCK_WIDTH_FIT_DEFAULT, BLOCK_WIDTH_FIT_POINTS, BLOCK_WIDTH_LIMIT, BlockSizeKey, BlockWidthFit, TEXT_FIT_MIN_FONT, TEXT_FIT_POINTS, TextFit, parseBlockWidthFit, parseTextFit } from '../screen/lib/content/block-size.js';
12
- export { BUTTON_PAD_KEYS, BUTTON_STYLE_KEYS, CORNER_SIDES, CornerSide } from '../screen/lib/content/style-keys.js';
12
+ export { BUTTON_PAD_KEYS, BUTTON_STYLE_KEYS, CORNER_SIDES, CornerSide, hasCornerSubset, normalizeCornerSides } from '../screen/lib/content/style-keys.js';
13
13
  import '../words-B5Gb7KFq.js';
@@ -1 +1 @@
1
- export{SCALAR_TEXT_CONTROLS,TEXT_CONTROL_KINDS}from"../chunk-I6SK6ZDT.js";export{BUTTON_PAD_KEYS,BUTTON_STYLE_KEYS,CORNER_SIDES}from"../chunk-BTQ3FJKT.js";export{BLOCK_FIXED_WIDTH,BLOCK_SIZE_KEYS,BLOCK_WIDTH_FIT_DEFAULT,BLOCK_WIDTH_FIT_POINTS,BLOCK_WIDTH_LIMIT,TEXT_FIT_MIN_FONT,TEXT_FIT_POINTS,parseBlockWidthFit,parseTextFit}from"../chunk-X3EMJ2EX.js";export{AUTO_RULES,FOLLOW_RULES,VIEW_DESKTOP_MIN,VIEW_TABLET_MIN,VIEW_TIERS,VIEW_TIER_LABEL,isAuto,phoneKey,resolveViewValue,tabletKey,viewTierForWidth}from"../chunk-E52W3M5I.js";export{rootRowName,sectionRenameProp,slotChildName,slotChildRenameProp,slotChildRowName}from"../chunk-5NHQ452C.js";export{HERO_SLIDER_GOTO_EVENT}from"../chunk-AJ2SUSET.js";export{hidableText,readHidable}from"../chunk-6UAEFOJ4.js";export{ANCHOR_FIELD_KEYS,FOLD_FIELD_MARKER,LINK_FIELD_MARKER,MEDIA_FIELD_MARKER,SCAFFOLD_FIELD_MARKER,TEXT_FIELD_MARKER,foldMetaOf,textFieldIdentifier}from"../chunk-ANPOR6EY.js";export{PART_SEP,decodePartId,encodePartId}from"../chunk-R4AUZVA3.js";export{FOOTER_TYPE,HEADER_TYPE,ROOT_ZONE,TREE_MAX_DEPTH,blockNodeActions,childSlotsOf,locateNode,missingPinnedTypes,nestsInTree,newNodeId,pinnedDuplicateIds,pinnedDuplicateIndices,slotChildrenIn,slotFieldsOf}from"../chunk-TCAAOYQY.js";export{TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,isTextStyleCase,textStyleCaseCss,textStyleCaseOfCss}from"../chunk-YHZSBL2N.js";export{BLOCK_ATTRIBUTE}from"../chunk-FR7EEKFF.js";export{REPEAT_ATTRIBUTE,REPEAT_INDEX_ATTRIBUTE}from"../chunk-7UFKEX72.js";
1
+ export{SCALAR_TEXT_CONTROLS,TEXT_CONTROL_KINDS}from"../chunk-I6SK6ZDT.js";export{BUTTON_PAD_KEYS,BUTTON_STYLE_KEYS,CORNER_SIDES,hasCornerSubset,normalizeCornerSides}from"../chunk-BAI7MIH4.js";export{BLOCK_FIXED_WIDTH,BLOCK_SIZE_KEYS,BLOCK_WIDTH_FIT_DEFAULT,BLOCK_WIDTH_FIT_POINTS,BLOCK_WIDTH_LIMIT,TEXT_FIT_MIN_FONT,TEXT_FIT_POINTS,parseBlockWidthFit,parseTextFit}from"../chunk-X3EMJ2EX.js";export{AUTO_RULES,FOLLOW_RULES,VIEW_DESKTOP_MIN,VIEW_TABLET_MIN,VIEW_TIERS,VIEW_TIER_LABEL,isAuto,phoneKey,resolveViewValue,tabletKey,viewTierForWidth}from"../chunk-E52W3M5I.js";export{rootRowName,sectionRenameProp,slotChildName,slotChildRenameProp,slotChildRowName}from"../chunk-5NHQ452C.js";export{HERO_SLIDER_GOTO_EVENT}from"../chunk-AJ2SUSET.js";export{hidableText,readHidable}from"../chunk-6UAEFOJ4.js";export{ANCHOR_FIELD_KEYS,FOLD_FIELD_MARKER,LINK_FIELD_MARKER,MEDIA_FIELD_MARKER,SCAFFOLD_FIELD_MARKER,TEXT_FIELD_MARKER,foldMetaOf,textFieldIdentifier}from"../chunk-ANPOR6EY.js";export{PART_SEP,decodePartId,encodePartId}from"../chunk-R4AUZVA3.js";export{FOOTER_TYPE,HEADER_TYPE,ROOT_ZONE,TREE_MAX_DEPTH,blockNodeActions,childSlotsOf,locateNode,missingPinnedTypes,nestsInTree,newNodeId,pinnedDuplicateIds,pinnedDuplicateIndices,slotChildrenIn,slotFieldsOf}from"../chunk-TCAAOYQY.js";export{TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,isTextStyleCase,textStyleCaseCss,textStyleCaseOfCss}from"../chunk-YHZSBL2N.js";export{BLOCK_ATTRIBUTE}from"../chunk-FR7EEKFF.js";export{REPEAT_ATTRIBUTE,REPEAT_INDEX_ATTRIBUTE}from"../chunk-7UFKEX72.js";
@@ -60,6 +60,8 @@ type PageCopyFormInput<Copy> = {
60
60
  declare function usePageCopyForm<Copy>({ source, taken, duplicate, onDuplicated }: PageCopyFormInput<Copy>): {
61
61
  title: string;
62
62
  slug: string;
63
+ /** The handle that is checked and sent: `slug` without the typing hyphen. */
64
+ finalSlug: string;
63
65
  clash: boolean;
64
66
  canSubmit: boolean;
65
67
  busy: boolean;
@@ -1,5 +1,5 @@
1
- import{DEFAULT_PAGE_COPY_WORDS as t}from"../chunk-CEC5XLN4.js";export{DEFAULT_PAGE_COPY_WORDS}from"../chunk-CEC5XLN4.js";import{useWords as e}from"../chunk-MFIRYGHW.js";import{slugify as n}from"efficient-shell/format";import{useState as o,useId as i}from"react";import{FormField as l,Input as r,Dialog as a,Button as s}from"efficient-shell/ui";import{jsxs as u,jsx as c}from"react/jsx-runtime";var h=255,m=/* @__PURE__ */new Set(["normal","dynamic"]);function f(t,e){return(!t.kind||m.has(t.kind))&&!e?.(t.slug)}function g(t){const e=n(t);return e&&/[^a-z0-9]$/.test(t.toLowerCase())?`${e}-`:e}function d(t,e){const n=new Set(e);if(!n.has(t))return t;let o=2;for(;n.has(`${t}-${o}`);)o+=1;return`${t}-${o}`}function p(t,e){return d(n(t)||"page",e)}function C(t,e){return new Set(e).has(t)}function y(t,e){return{title:`${t.title||t.slug} copy`,slug:p(`${t.slug}-copy`,e)}}function b({source:t,taken:e,duplicate:i,onDuplicated:l}){const[r]=o(()=>y(t,e)),[a,s]=o(r.title),[u,c]=o(r.slug),[h,m]=o(!1),[f,d]=o(!1),[p,b]=o(!1),[v,k]=o(!1),x=C(u,e),S=Boolean(a.trim()&&u&&!x&&!p);return{title:a,slug:u,clash:x,canSubmit:S,busy:p,failed:v,touched:f,titleMax:255,onTitleChange:t=>{d(!0),s(t),h||c(n(t))},onSlugChange:t=>{d(!0),m(!0),c(g(t))},submit:async()=>{if(S){b(!0),k(!1);try{l(await i({title:a.trim(),slug:u}))}catch{k(!0)}finally{b(!1)}}}}}function v({form:n,host:o}){const a=e("pageCopy",t),s=i(),h=i(),m=t=>{t.nativeEvent.isComposing||229===t.keyCode||"Enter"===t.key&&n.submit()};/* @__PURE__ */
2
- return u("div",{className:"flex flex-col gap-4",children:[
3
- /* @__PURE__ */c(l,{label:a.titleLabel,htmlFor:s,error:n.failed?a.failed:void 0,hint:a.hint,children:/* @__PURE__ */c(r,{id:s,autoFocus:!0,value:n.title,maxLength:n.titleMax,onChange:t=>n.onTitleChange(t.target.value),onKeyDown:m})}),
4
- /* @__PURE__ */c(l,{label:a.slugLabel,htmlFor:h,error:n.clash?a.clash:void 0,hint:a.address({host:o,slug:n.slug}),children:/* @__PURE__ */c(r,{id:h,value:n.slug,invalid:n.clash,onChange:t=>n.onSlugChange(t.target.value),onKeyDown:m})})]})}function k({host:n,onClose:o,...i}){const l=e("pageCopy",t),r=b(i),u=i.source.title||i.source.slug;/* @__PURE__ */
5
- return c(a,{open:!0,dirty:r.touched,onClose:()=>{r.busy||o()},title:l.title({name:u}),size:"sm",footer:/* @__PURE__ */c(s,{disabled:!r.canSubmit,loading:r.busy,onClick:()=>{r.submit()},children:l.submit}),children:/* @__PURE__ */c(v,{form:r,host:n})})}export{h as DUPLICATE_TITLE_MAX,k as DuplicatePageDialog,v as DuplicatePageFields,f as canDuplicatePage,y as copySuggestion,d as firstFreeSlug,g as slugWhileTyping,p as uniqueSlug,C as urlHandleTaken,b as usePageCopyForm};
1
+ import{DEFAULT_PAGE_COPY_WORDS as t}from"../chunk-CEC5XLN4.js";export{DEFAULT_PAGE_COPY_WORDS}from"../chunk-CEC5XLN4.js";import{useWords as e}from"../chunk-MFIRYGHW.js";import{slugify as n}from"efficient-shell/format";import{useState as o,useId as i}from"react";import{FormField as l,Input as r,Dialog as a,Button as u}from"efficient-shell/ui";import{jsxs as s,jsx as c}from"react/jsx-runtime";var h=255,f=/* @__PURE__ */new Set(["normal","dynamic"]);function m(t,e){return(!t.kind||f.has(t.kind))&&!e?.(t.slug)}function g(t){const e=n(t);return e&&/[^a-z0-9]$/.test(t.toLowerCase())?`${e}-`:e}function d(t,e){const n=new Set(e);if(!n.has(t))return t;let o=2;for(;n.has(`${t}-${o}`);)o+=1;return`${t}-${o}`}function p(t,e){return d(n(t)||"page",e)}function C(t,e){return new Set(e).has(t)}function y(t,e){return{title:`${t.title||t.slug} copy`,slug:p(`${t.slug}-copy`,e)}}function b({source:t,taken:e,duplicate:i,onDuplicated:l}){const[r]=o(()=>y(t,e)),[a,u]=o(r.title),[s,c]=o(r.slug),[h,f]=o(!1),[m,d]=o(!1),[p,b]=o(!1),[v,S]=o(!1),k=n(s),x=C(k,e),$=Boolean(a.trim()&&k&&!x&&!p);return{title:a,slug:s,finalSlug:k,clash:x,canSubmit:$,busy:p,failed:v,touched:m,titleMax:255,onTitleChange:t=>{d(!0),u(t),h||c(n(t))},onSlugChange:t=>{d(!0),f(!0),c(g(t))},submit:async()=>{if($){b(!0),S(!1);try{l(await i({title:a.trim(),slug:k}))}catch{S(!0)}finally{b(!1)}}}}}function v({form:n,host:o}){const a=e("pageCopy",t),u=i(),h=i(),f=t=>{t.nativeEvent.isComposing||229===t.keyCode||"Enter"===t.key&&n.submit()};/* @__PURE__ */
2
+ return s("div",{className:"flex flex-col gap-4",children:[
3
+ /* @__PURE__ */c(l,{label:a.titleLabel,htmlFor:u,error:n.failed?a.failed:void 0,hint:a.hint,children:/* @__PURE__ */c(r,{id:u,autoFocus:!0,value:n.title,maxLength:n.titleMax,onChange:t=>n.onTitleChange(t.target.value),onKeyDown:f})}),
4
+ /* @__PURE__ */c(l,{label:a.slugLabel,htmlFor:h,error:n.clash?a.clash:void 0,hint:a.address({host:o,slug:n.finalSlug}),children:/* @__PURE__ */c(r,{id:h,value:n.slug,invalid:n.clash,onChange:t=>n.onSlugChange(t.target.value),onKeyDown:f})})]})}function S({host:n,onClose:o,...i}){const l=e("pageCopy",t),r=b(i),s=i.source.title||i.source.slug;/* @__PURE__ */
5
+ return c(a,{open:!0,dirty:r.touched,onClose:()=>{r.busy||o()},title:l.title({name:s}),size:"sm",footer:/* @__PURE__ */c(u,{disabled:!r.canSubmit,loading:r.busy,onClick:()=>{r.submit()},children:l.submit}),children:/* @__PURE__ */c(v,{form:r,host:n})})}export{h as DUPLICATE_TITLE_MAX,S as DuplicatePageDialog,v as DuplicatePageFields,m as canDuplicatePage,y as copySuggestion,d as firstFreeSlug,g as slugWhileTyping,p as uniqueSlug,C as urlHandleTaken,b as usePageCopyForm};
@@ -31,5 +31,17 @@ declare const BUTTON_PAD_KEYS: {
31
31
  declare const CORNER_SIDES: readonly ["tl", "tr", "br", "bl"];
32
32
  /** One corner. */
33
33
  type CornerSide = (typeof CORNER_SIDES)[number];
34
+ /**
35
+ * A stored corner set, or `null` when none is stored.
36
+ *
37
+ * `null` means all four: every node that predates a corner row stores nothing
38
+ * and draws all four. An empty array is the merchant switching every corner
39
+ * off, which is square. A set comes back in `border-radius` order (TL, TR, BR,
40
+ * BL), known corners only, once each, whatever order it was stored in.
41
+ */
42
+ declare function normalizeCornerSides(value: unknown): CornerSide[] | null;
43
+ /** `true` when a stored set switches at least one corner off: the only case
44
+ * that draws differently from all four. */
45
+ declare function hasCornerSubset(value: unknown): boolean;
34
46
 
35
- export { BUTTON_PAD_KEYS, BUTTON_STYLE_KEYS, CORNER_SIDES, type CornerSide };
47
+ export { BUTTON_PAD_KEYS, BUTTON_STYLE_KEYS, CORNER_SIDES, type CornerSide, hasCornerSubset, normalizeCornerSides };
@@ -1 +1 @@
1
- export{BUTTON_PAD_KEYS,BUTTON_STYLE_KEYS,CORNER_SIDES}from"../../../chunk-BTQ3FJKT.js";
1
+ export{BUTTON_PAD_KEYS,BUTTON_STYLE_KEYS,CORNER_SIDES,hasCornerSubset,normalizeCornerSides}from"../../../chunk-BAI7MIH4.js";
@@ -1 +1 @@
1
- import{buttonFieldSet as e}from"../../../chunk-4O4FSRJL.js";import"../../../chunk-SS2NY7PP.js";import{boxFieldSet as o}from"../../../chunk-UJU42JM4.js";import"../../../chunk-CLAADE4J.js";import"../../../chunk-2T22IY3J.js";import"../../../chunk-7GGNFLHT.js";import"../../../chunk-22I55W37.js";import"../../../chunk-LX23TCTP.js";import"../../../chunk-Q3VAJMXS.js";import"../../../chunk-CWELHADJ.js";import"../../../chunk-6WY6ZXJG.js";import"../../../chunk-BTQ3FJKT.js";import{phoneKey as t}from"../../../chunk-E52W3M5I.js";import{foldMetaOf as n}from"../../../chunk-ANPOR6EY.js";import"../../../chunk-YAFMYW4J.js";import"../../../chunk-JQQFB7EZ.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-YCSZAP7T.js";import"../../../chunk-FM6JO4WF.js";import"../../../chunk-56ID6FKZ.js";import"../../../chunk-K53PQAMP.js";import"../../../chunk-QTHQPJWA.js";import"../../../chunk-OECWLNKJ.js";import"../../../chunk-HZSZT3BE.js";import"../../../chunk-PMRN5Z3T.js";import"../../../chunk-KFWNGPW3.js";import"../../../chunk-MIX7EGRG.js";import"../../../chunk-DX3VILZ3.js";import"../../../chunk-JACEEVVF.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-TOKMFZPB.js";import"../../../chunk-FR7EEKFF.js";import"../../../chunk-7UFKEX72.js";import"../../../chunk-EUFDQ4KL.js";import"../../../chunk-KXM6YRG2.js";import"../../../chunk-BSPCSC45.js";function s(e){return Object.keys(e).filter(o=>{return t=e[o],!(null!==n(t));var t})}function r(e,o){const t=o.off??{},s=o.keys??{};for(const[e,o]of Object.entries(t))if(!o.trim())throw new Error(`blockSetFor: off row "${e}" needs a reason.`);for(const o of[...Object.keys(t),...Object.keys(s)]){if(!Object.hasOwn(e,o))throw new Error(`blockSetFor: the set has no row "${o}".`);if(Object.hasOwn(t,o)&&Object.hasOwn(s,o))throw new Error(`blockSetFor: row "${o}" is both off and renamed.`)}const r={};let i=[];for(const[o,c]of Object.entries(e)){const a=n(c);if(a){i=i.filter(([,e])=>n(e).level<a.level),i.push([o,c]);continue}if(Object.hasOwn(t,o))continue;for(const[e,o]of i)r[e]=o;i=[];const u=Object.hasOwn(s,o)?s[o]:o;if(Object.hasOwn(r,u)||u!==o&&Object.hasOwn(e,u))throw new Error(`blockSetFor: renamed key "${u}" is already a row.`);r[u]=c}return r}function i(e){const o=e.build();r(o,e.email),r(o,e.website);const t=s(o),n=e=>new Set(Object.keys(e.off??{})),i=n(e.email),c=n(e.website),a=[];for(const o of t)i.has(o)&&!c.has(o)&&a.push({row:o,only:"website",reason:e.email.off[o]}),c.has(o)&&!i.has(o)&&a.push({row:o,only:"email",reason:e.website.off[o]});return a}var c=["button","image","box","divider","logo","text","section","social"],a={useFill:()=>"",useText:()=>"",useBorder:()=>({width:0,color:""}),useCorners:()=>0},u={button:{build:()=>e({follows:a,padding:{fallback:{}}}),email:{editor:"email"},website:{editor:"website"}},box:{build:()=>o(),email:{editor:"email",keys:{gap:"itemGap"},off:Object.fromEntries(["sectionPaddingTop","sectionPaddingRight","sectionPaddingBottom","sectionPaddingLeft"].map(e=>[t(e),"email: a Banner Box draws in the desktop view only (admin inBannerFields)"]))},website:{editor:"website"}}},h={button:"the set is in easel; admin (A-B) and web-builder (W-B) still build their own rows (plan group 1)",image:"no easel set yet (plan group 2)",box:"the set is in easel and the email Banner Box imports it; the website Flex builds its own rows (plan group 3)",divider:"no easel set yet (plan group 4)",logo:"no easel set yet (plan group 5)",text:"no easel set yet (plan group 6)",section:"no easel set yet (plan group 7)",social:"no easel set yet (plan group 7)"};export{c as BLOCK_KINDS,h as BLOCK_SETS_STILL_TWO_COPIES,u as BLOCK_SET_PAIRS,i as blockSetDifferences,r as blockSetFor,s as blockSetRowKeys};
1
+ import{buttonFieldSet as e}from"../../../chunk-7EFT3QYV.js";import"../../../chunk-XGSYK6SO.js";import{boxFieldSet as o}from"../../../chunk-UJU42JM4.js";import"../../../chunk-CLAADE4J.js";import"../../../chunk-2T22IY3J.js";import"../../../chunk-7GGNFLHT.js";import"../../../chunk-22I55W37.js";import"../../../chunk-LX23TCTP.js";import"../../../chunk-Q3VAJMXS.js";import"../../../chunk-CWELHADJ.js";import"../../../chunk-6WY6ZXJG.js";import"../../../chunk-BAI7MIH4.js";import{phoneKey as t}from"../../../chunk-E52W3M5I.js";import{foldMetaOf as n}from"../../../chunk-ANPOR6EY.js";import"../../../chunk-YAFMYW4J.js";import"../../../chunk-JQQFB7EZ.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-YCSZAP7T.js";import"../../../chunk-FM6JO4WF.js";import"../../../chunk-56ID6FKZ.js";import"../../../chunk-K53PQAMP.js";import"../../../chunk-QTHQPJWA.js";import"../../../chunk-OECWLNKJ.js";import"../../../chunk-HZSZT3BE.js";import"../../../chunk-PMRN5Z3T.js";import"../../../chunk-KFWNGPW3.js";import"../../../chunk-MIX7EGRG.js";import"../../../chunk-DX3VILZ3.js";import"../../../chunk-JACEEVVF.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-TOKMFZPB.js";import"../../../chunk-FR7EEKFF.js";import"../../../chunk-7UFKEX72.js";import"../../../chunk-EUFDQ4KL.js";import"../../../chunk-KXM6YRG2.js";import"../../../chunk-BSPCSC45.js";function s(e){return Object.keys(e).filter(o=>{return t=e[o],!(null!==n(t));var t})}function r(e,o){const t=o.off??{},s=o.keys??{};for(const[e,o]of Object.entries(t))if(!o.trim())throw new Error(`blockSetFor: off row "${e}" needs a reason.`);for(const o of[...Object.keys(t),...Object.keys(s)]){if(!Object.hasOwn(e,o))throw new Error(`blockSetFor: the set has no row "${o}".`);if(Object.hasOwn(t,o)&&Object.hasOwn(s,o))throw new Error(`blockSetFor: row "${o}" is both off and renamed.`)}const r={};let i=[];for(const[o,c]of Object.entries(e)){const a=n(c);if(a){i=i.filter(([,e])=>n(e).level<a.level),i.push([o,c]);continue}if(Object.hasOwn(t,o))continue;for(const[e,o]of i)r[e]=o;i=[];const u=Object.hasOwn(s,o)?s[o]:o;if(Object.hasOwn(r,u)||u!==o&&Object.hasOwn(e,u))throw new Error(`blockSetFor: renamed key "${u}" is already a row.`);r[u]=c}return r}function i(e){const o=e.build();r(o,e.email),r(o,e.website);const t=s(o),n=e=>new Set(Object.keys(e.off??{})),i=n(e.email),c=n(e.website),a=[];for(const o of t)i.has(o)&&!c.has(o)&&a.push({row:o,only:"website",reason:e.email.off[o]}),c.has(o)&&!i.has(o)&&a.push({row:o,only:"email",reason:e.website.off[o]});return a}var c=["button","image","box","divider","logo","text","section","social"],a={useFill:()=>"",useText:()=>"",useBorder:()=>({width:0,color:""}),useCorners:()=>0},u={button:{build:()=>e({follows:a,padding:{fallback:{}}}),email:{editor:"email"},website:{editor:"website"}},box:{build:()=>o(),email:{editor:"email",keys:{gap:"itemGap"},off:Object.fromEntries(["sectionPaddingTop","sectionPaddingRight","sectionPaddingBottom","sectionPaddingLeft"].map(e=>[t(e),"email: a Banner Box draws in the desktop view only (admin inBannerFields)"]))},website:{editor:"website"}}},h={button:"the set is in easel; admin (A-B) and web-builder (W-B) still build their own rows (plan group 1)",image:"no easel set yet (plan group 2)",box:"the set is in easel and the email Banner Box imports it; the website Flex builds its own rows (plan group 3)",divider:"no easel set yet (plan group 4)",logo:"no easel set yet (plan group 5)",text:"no easel set yet (plan group 6)",section:"no easel set yet (plan group 7)",social:"no easel set yet (plan group 7)"};export{c as BLOCK_KINDS,h as BLOCK_SETS_STILL_TWO_COPIES,u as BLOCK_SET_PAIRS,i as blockSetDifferences,r as blockSetFor,s as blockSetRowKeys};
@@ -1,5 +1,6 @@
1
1
  import { ValueAccess, SidesPaddingOptions, PhoneValueAccess, BoxFieldSay, BoxField } from './box-fields.js';
2
2
  import { ColorPreset } from 'efficient-shell/ui';
3
+ import { CornerSide } from '../content/style-keys.js';
3
4
  export { BUTTON_PAD_KEYS, BUTTON_STYLE_KEYS } from '../content/style-keys.js';
4
5
  import 'react';
5
6
  import 'efficient-shell/format';
@@ -41,6 +42,9 @@ interface ButtonFieldSetOptions {
41
42
  color: string;
42
43
  };
43
44
  useCorners: () => number;
45
+ /** Which corners an unset corner set draws (`null`: all four). Left out:
46
+ * all four. A hook: give it always or never for one field set. */
47
+ useCornerSides?: () => readonly CornerSide[] | null;
44
48
  /** What an unset Fill opacity draws. 100 when left out. */
45
49
  useFillOpacity?: () => number;
46
50
  };
@@ -1 +1 @@
1
- export{buttonFieldSet}from"../../../chunk-4O4FSRJL.js";import"../../../chunk-SS2NY7PP.js";import"../../../chunk-UJU42JM4.js";import"../../../chunk-CLAADE4J.js";import"../../../chunk-2T22IY3J.js";import"../../../chunk-7GGNFLHT.js";import"../../../chunk-22I55W37.js";import"../../../chunk-LX23TCTP.js";import"../../../chunk-Q3VAJMXS.js";import"../../../chunk-CWELHADJ.js";import"../../../chunk-6WY6ZXJG.js";export{BUTTON_PAD_KEYS,BUTTON_STYLE_KEYS}from"../../../chunk-BTQ3FJKT.js";import"../../../chunk-E52W3M5I.js";import"../../../chunk-ANPOR6EY.js";import"../../../chunk-YAFMYW4J.js";import"../../../chunk-JQQFB7EZ.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-YCSZAP7T.js";import"../../../chunk-FM6JO4WF.js";import"../../../chunk-56ID6FKZ.js";import"../../../chunk-K53PQAMP.js";import"../../../chunk-QTHQPJWA.js";import"../../../chunk-OECWLNKJ.js";import"../../../chunk-HZSZT3BE.js";import"../../../chunk-PMRN5Z3T.js";import"../../../chunk-KFWNGPW3.js";import"../../../chunk-MIX7EGRG.js";import"../../../chunk-DX3VILZ3.js";import"../../../chunk-JACEEVVF.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-TOKMFZPB.js";import"../../../chunk-FR7EEKFF.js";import"../../../chunk-7UFKEX72.js";import"../../../chunk-EUFDQ4KL.js";import"../../../chunk-KXM6YRG2.js";import"../../../chunk-BSPCSC45.js";
1
+ export{buttonFieldSet}from"../../../chunk-7EFT3QYV.js";import"../../../chunk-XGSYK6SO.js";import"../../../chunk-UJU42JM4.js";import"../../../chunk-CLAADE4J.js";import"../../../chunk-2T22IY3J.js";import"../../../chunk-7GGNFLHT.js";import"../../../chunk-22I55W37.js";import"../../../chunk-LX23TCTP.js";import"../../../chunk-Q3VAJMXS.js";import"../../../chunk-CWELHADJ.js";import"../../../chunk-6WY6ZXJG.js";export{BUTTON_PAD_KEYS,BUTTON_STYLE_KEYS}from"../../../chunk-BAI7MIH4.js";import"../../../chunk-E52W3M5I.js";import"../../../chunk-ANPOR6EY.js";import"../../../chunk-YAFMYW4J.js";import"../../../chunk-JQQFB7EZ.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-YCSZAP7T.js";import"../../../chunk-FM6JO4WF.js";import"../../../chunk-56ID6FKZ.js";import"../../../chunk-K53PQAMP.js";import"../../../chunk-QTHQPJWA.js";import"../../../chunk-OECWLNKJ.js";import"../../../chunk-HZSZT3BE.js";import"../../../chunk-PMRN5Z3T.js";import"../../../chunk-KFWNGPW3.js";import"../../../chunk-MIX7EGRG.js";import"../../../chunk-DX3VILZ3.js";import"../../../chunk-JACEEVVF.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-TOKMFZPB.js";import"../../../chunk-FR7EEKFF.js";import"../../../chunk-7UFKEX72.js";import"../../../chunk-EUFDQ4KL.js";import"../../../chunk-KXM6YRG2.js";import"../../../chunk-BSPCSC45.js";
@@ -1,5 +1,6 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { ColorPreset } from 'efficient-shell/ui';
3
+ import { CornerSide } from '../content/style-keys.js';
3
4
  export { CORNER_SIDES } from '../content/style-keys.js';
4
5
  import { ValueAccess, BoxField, BoxFieldSay } from './box-fields.js';
5
6
  import 'efficient-shell/format';
@@ -98,6 +99,10 @@ interface CornersFieldOptions extends Stored {
98
99
  sidesKey: string;
99
100
  /** The radius an unset row draws, px. A hook. */
100
101
  useFollows: () => number;
102
+ /** The corners an unset corner set draws (the campaign's, for an email
103
+ * Button block); `null` is all four. A hook: give it always or never for
104
+ * one field set. Left out: all four. */
105
+ useFollowsSides?: () => readonly CornerSide[] | null;
101
106
  step?: number;
102
107
  }
103
108
  /** The three style rows, in the host's words. */
@@ -1 +1 @@
1
- export{BORDER_WIDTH_MAX,CORNER_RADIUS_MAX,borderField,colourField,cornersField,keptByRow,styleFieldBuilders}from"../../../chunk-SS2NY7PP.js";import"../../../chunk-UJU42JM4.js";import"../../../chunk-CLAADE4J.js";import"../../../chunk-2T22IY3J.js";import"../../../chunk-7GGNFLHT.js";import"../../../chunk-22I55W37.js";import"../../../chunk-LX23TCTP.js";import"../../../chunk-Q3VAJMXS.js";import"../../../chunk-CWELHADJ.js";import"../../../chunk-6WY6ZXJG.js";export{CORNER_SIDES}from"../../../chunk-BTQ3FJKT.js";import"../../../chunk-E52W3M5I.js";import"../../../chunk-ANPOR6EY.js";import"../../../chunk-YAFMYW4J.js";import"../../../chunk-JQQFB7EZ.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-YCSZAP7T.js";import"../../../chunk-FM6JO4WF.js";import"../../../chunk-56ID6FKZ.js";import"../../../chunk-K53PQAMP.js";import"../../../chunk-QTHQPJWA.js";import"../../../chunk-OECWLNKJ.js";import"../../../chunk-HZSZT3BE.js";import"../../../chunk-PMRN5Z3T.js";import"../../../chunk-KFWNGPW3.js";import"../../../chunk-MIX7EGRG.js";import"../../../chunk-DX3VILZ3.js";import"../../../chunk-JACEEVVF.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-TOKMFZPB.js";import"../../../chunk-FR7EEKFF.js";import"../../../chunk-7UFKEX72.js";import"../../../chunk-EUFDQ4KL.js";import"../../../chunk-KXM6YRG2.js";import"../../../chunk-BSPCSC45.js";
1
+ export{BORDER_WIDTH_MAX,CORNER_RADIUS_MAX,borderField,colourField,cornersField,keptByRow,styleFieldBuilders}from"../../../chunk-XGSYK6SO.js";import"../../../chunk-UJU42JM4.js";import"../../../chunk-CLAADE4J.js";import"../../../chunk-2T22IY3J.js";import"../../../chunk-7GGNFLHT.js";import"../../../chunk-22I55W37.js";import"../../../chunk-LX23TCTP.js";import"../../../chunk-Q3VAJMXS.js";import"../../../chunk-CWELHADJ.js";import"../../../chunk-6WY6ZXJG.js";export{CORNER_SIDES}from"../../../chunk-BAI7MIH4.js";import"../../../chunk-E52W3M5I.js";import"../../../chunk-ANPOR6EY.js";import"../../../chunk-YAFMYW4J.js";import"../../../chunk-JQQFB7EZ.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-YCSZAP7T.js";import"../../../chunk-FM6JO4WF.js";import"../../../chunk-56ID6FKZ.js";import"../../../chunk-K53PQAMP.js";import"../../../chunk-QTHQPJWA.js";import"../../../chunk-OECWLNKJ.js";import"../../../chunk-HZSZT3BE.js";import"../../../chunk-PMRN5Z3T.js";import"../../../chunk-KFWNGPW3.js";import"../../../chunk-MIX7EGRG.js";import"../../../chunk-DX3VILZ3.js";import"../../../chunk-JACEEVVF.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-TOKMFZPB.js";import"../../../chunk-FR7EEKFF.js";import"../../../chunk-7UFKEX72.js";import"../../../chunk-EUFDQ4KL.js";import"../../../chunk-KXM6YRG2.js";import"../../../chunk-BSPCSC45.js";
@@ -1,2 +1,2 @@
1
- import{DEFAULT_TEXT_STYLES_WORDS as o}from"../chunk-OGH6CC3E.js";import{DEFAULT_SCREEN_WORDS as r,DEFAULT_IMAGE_ROW_WORDS as n}from"../chunk-Q3VAJMXS.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"../chunk-6WY6ZXJG.js";import{DEFAULT_CANVAS_WORDS as c}from"../chunk-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as e}from"../chunk-K56YDHYQ.js";import{DEFAULT_COLOUR_ROW_WORDS as m,DEFAULT_PANEL_WORDS as i}from"../chunk-56ID6FKZ.js";import{DEFAULT_PAGE_COPY_WORDS as s}from"../chunk-CEC5XLN4.js";import{DEFAULT_NODE_MENU_WORDS as u}from"../chunk-WK3AFPXY.js";import{DEFAULT_SAVE_WORDS as f}from"../chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as p,DEFAULT_NOTICE_WORDS as l}from"../chunk-AJSDWWJW.js";import{DEFAULT_RAIL_WORDS as h}from"../chunk-2OAZYSWJ.js";import{DEFAULT_LOCK_WORDS as j}from"../chunk-RE4LP46F.js";import{DEFAULT_COPY_WORDS as a}from"../chunk-PMRN5Z3T.js";import{DEFAULT_FIELDS_WORDS as k}from"../chunk-JACEEVVF.js";import{stringsContext as y}from"../chunk-MFIRYGHW.js";import{DEFAULT_DRAG_WORDS as Y}from"../chunk-TQ5Y6S2X.js";import{useContext as C,useMemo as W}from"react";import{jsx as d}from"react/jsx-runtime";var g={notice:l,lock:j,save:f,chrome:p,rail:h,tree:e,panel:i,fields:k,colourRow:m,imageRow:n,drag:Y,menu:u,styleClipboard:t,copy:a,canvas:c,textStyles:o,screen:r,pageCopy:s},v=o=>"object"==typeof o&&null!==o;function D(o,r){const n={};for(const t of Object.keys(o)){const c=o[t],e=r[t];null==e?n[t]=c:v(c)?n[t]=v(e)?D(c,e):c:n[t]=typeof e==typeof c?e:c}return n}function F(o,r){return r?D(o,r):o}function J({value:o,locale:r,children:n}){const t=y(),c=C(t),e=c?.strings??g,m=r??c?.locale??"en",i=W(()=>({strings:F(e,o),locale:m}),[e,o,m]);/* @__PURE__ */
1
+ import{DEFAULT_TEXT_STYLES_WORDS as o}from"../chunk-OGH6CC3E.js";import{DEFAULT_SCREEN_WORDS as r,DEFAULT_IMAGE_ROW_WORDS as n}from"../chunk-Q3VAJMXS.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"../chunk-6WY6ZXJG.js";import{DEFAULT_CANVAS_WORDS as c}from"../chunk-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as e}from"../chunk-K56YDHYQ.js";import{DEFAULT_COLOUR_ROW_WORDS as m,DEFAULT_PANEL_WORDS as i}from"../chunk-56ID6FKZ.js";import{DEFAULT_NODE_MENU_WORDS as s}from"../chunk-WK3AFPXY.js";import{DEFAULT_PAGE_COPY_WORDS as u}from"../chunk-CEC5XLN4.js";import{DEFAULT_SAVE_WORDS as f}from"../chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as p,DEFAULT_NOTICE_WORDS as l}from"../chunk-AJSDWWJW.js";import{DEFAULT_RAIL_WORDS as h}from"../chunk-2OAZYSWJ.js";import{DEFAULT_LOCK_WORDS as j}from"../chunk-RE4LP46F.js";import{DEFAULT_COPY_WORDS as a}from"../chunk-PMRN5Z3T.js";import{DEFAULT_FIELDS_WORDS as k}from"../chunk-JACEEVVF.js";import{stringsContext as y}from"../chunk-MFIRYGHW.js";import{DEFAULT_DRAG_WORDS as Y}from"../chunk-TQ5Y6S2X.js";import{useContext as C,useMemo as W}from"react";import{jsx as d}from"react/jsx-runtime";var g={notice:l,lock:j,save:f,chrome:p,rail:h,tree:e,panel:i,fields:k,colourRow:m,imageRow:n,drag:Y,menu:s,styleClipboard:t,copy:a,canvas:c,textStyles:o,screen:r,pageCopy:u},v=o=>"object"==typeof o&&null!==o;function D(o,r){const n={};for(const t of Object.keys(o)){const c=o[t],e=r[t];null==e?n[t]=c:v(c)?n[t]=v(e)?D(c,e):c:n[t]=typeof e==typeof c?e:c}return n}function F(o,r){return r?D(o,r):o}function J({value:o,locale:r,children:n}){const t=y(),c=C(t),e=c?.strings??g,m=r??c?.locale??"en",i=W(()=>({strings:F(e,o),locale:m}),[e,o,m]);/* @__PURE__ */
2
2
  return d(t.Provider,{value:i,children:n})}function S(){return C(y())?.strings??g}function A(){return C(y())?.locale??"en"}export{g as DEFAULT_EASEL_STRINGS,J as EaselStringsProvider,F as mergeEaselStrings,A as useEaselLocale,S as useEaselStrings};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-easel",
3
- "version": "26.4.0",
3
+ "version": "26.6.0",
4
4
  "description": "Efficient Easel: the EFFICIENT editors' shared engine and chrome: the saved document as pure functions, the published renderer, and the editor frame, panels, Layers tree, text grammar and type-in-place box. Published as editor-shell up to 0.66.0 and as efficient-editor up to 0.95.0.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Efficient Pty Ltd",
@@ -1 +0,0 @@
1
- var t={fill:"buttonColor",fillOpacity:"buttonFillOpacity",border:"buttonBorder",text:"buttonTextColor",corners:"buttonCorners",cornerSides:"buttonCornerSides"},o={top:"buttonPaddingTop",right:"buttonPaddingRight",bottom:"buttonPaddingBottom",left:"buttonPaddingLeft"},r=["tl","tr","br","bl"];export{o as BUTTON_PAD_KEYS,t as BUTTON_STYLE_KEYS,r as CORNER_SIDES};
@@ -1,4 +0,0 @@
1
- import{useAccessPatch as e,FLAT_ACCESS as o,onDesktopWords as r,useAccessValue as t}from"./chunk-UJU42JM4.js";import{CornersInput as s,BorderInput as l,SettingsColour as n}from"./chunk-CLAADE4J.js";import{SettingsDefaultReset as i}from"./chunk-2T22IY3J.js";import{noControlField as a,NoControlMark as c}from"./chunk-22I55W37.js";import{CORNER_SIDES as d}from"./chunk-BTQ3FJKT.js";import{DEFAULT_PANEL_WORDS as u,DEFAULT_COLOUR_ROW_WORDS as p}from"./chunk-56ID6FKZ.js";import{SettingsField as y}from"./chunk-MIX7EGRG.js";import{useWords as f}from"./chunk-MFIRYGHW.js";import{CornerIcon as h,BorderAllIcon as m}from"efficient-shell/icons/efficient";import{jsx as b}from"react/jsx-runtime";var w=e=>e;function g(e,o){const r=o.twinAccess;return r?{key:e.key,access:r,ownField:r.ownField}:e}function v(e,r){const s=!e.access||e.ownField?{value:r.value,onChange:r.onChange}:void 0;return t(e.access??o,e.key,s)}function k(e,r){return t(e.access??o,r??"")}function F(e){return{...a({type:"custom",render:()=>/* @__PURE__ */b(c,{})},"always"),reachedBy:e}}function j({o:t,say:s,props:l}){const i=f("colourRow",p),a=f("panel",u),c=t.useFollows(),d=t.usePresets?.(),y=t.opacity?.useUnset?.()??100,h=g(t,l),[m,w]=v(h,l),[F,j]=k(h,t.opacity?.key),B=e(h.access??o),C="string"==typeof m?m:"",A="number"==typeof F,O="follows"in l,T=(O&&"string"==typeof l.follows&&""!==l.follows?l.follows:void 0)??c,x=t.access||O?void 0:"";/* @__PURE__ */
2
- return b(n,{label:s(t.label),icon:t.icon,value:C,onChange:e=>w(""===e?x:e),inherited:T,presets:d,changed:""!==C||A,onReset:()=>{A&&t.opacity?B([[t.key,x],[t.opacity.key,void 0]]):w(x)},resetTo:O?r(s,T.toUpperCase()):t.resetTo?t.resetTo(c.toUpperCase()):c.toUpperCase(),...t.opacity?{opacity:A?F:y,onOpacityChange:e=>j(e)}:{},readOnly:l.readOnly,words:i,resetWords:a})}var B=20;function C({o:e,say:o,props:t}){const s=e.useFollows(),[n,a]=v(g(e,t),t),c=n&&"object"==typeof n?n:{},d="follows"in t,u=d&&t.follows&&"object"==typeof t.follows?t.follows:{},p="number"==typeof u.width?u.width:s.width,f="string"==typeof u.color&&""!==u.color?u.color:s.color,h=Object.keys(c).length>0,w={width:o("Border width"),sides:{top:o("Border top"),right:o("Border right"),bottom:o("Border bottom"),left:o("Border left")},style:o("Border style"),styles:{solid:o("Solid"),dashed:o("Dashed"),dotted:o("Dotted")},color:o("Border color"),unit:"px"};/* @__PURE__ */
3
- return b(y,{label:o("Border"),icon:/* @__PURE__ */b(m,{}),action:d?/* @__PURE__ */b(i,{label:o("Border"),changed:h,detail:r(o,`${p}px`),disabled:t.readOnly,onReset:()=>a(void 0)}):void 0,children:/* @__PURE__ */b(l,{label:o("Border"),value:c,each:!1,onChange:o=>a(function(e){const o=Object.fromEntries(Object.entries(e).filter(([,e])=>null!=e&&""!==e));return Object.keys(o).length?o:void 0}(e.styles?{width:o.width,color:o.color,style:o.style}:{width:o.width,color:o.color})),placeholder:{sides:{top:p,right:p,bottom:p,left:p},style:u.style??"solid",color:f},presets:[f],words:w,styles:e.styles??!1,max:20,readOnly:t.readOnly})})}var A=40;function O({o:r,say:t,props:l}){const n=f("panel",u),a=r.useFollows(),[c,p]=v(r,l),[m,w]=k(r,r.sidesKey),g=e(r.access??o),F=r.access?void 0:null,j="number"==typeof c&&Number.isFinite(c)?c:null,B=Array.isArray(m)?d.filter(e=>m.includes(e)):[...d],C=[{value:"tl",label:t("Top left")},{value:"tr",label:t("Top right")},{value:"bl",label:t("Bottom left")},{value:"br",label:t("Bottom right")}];/* @__PURE__ */
4
- return b(y,{label:t("Corners"),icon:/* @__PURE__ */b(h,{}),changed:null!==j||Array.isArray(m),action:/* @__PURE__ */b(i,{label:t("Corners"),changed:null!==j||Array.isArray(m),detail:`${a}px`,onReset:()=>Array.isArray(m)?g([[r.key,F],[r.sidesKey,F]]):p(F),words:n}),children:/* @__PURE__ */b(s,{label:t("Corners"),value:B,corners:C,onChange:e=>{const o=d.filter(o=>e.includes(o));w(o.length===d.length?F:o)},radius:j,onRadiusChange:e=>p(e??F),radiusMin:0,radiusMax:40,radiusStep:r.step??1,radiusPlaceholder:String(a),disabled:l.readOnly})})}function T(e=w){return{colourField:o=>({type:"custom",render:r=>/* @__PURE__ */b(j,{o:o,say:e,props:r})}),borderField:o=>({type:"custom",render:r=>/* @__PURE__ */b(C,{o:o,say:e,props:r})}),cornersField:o=>({type:"custom",render:r=>/* @__PURE__ */b(O,{o:o,say:e,props:r})})}}var{colourField:x,borderField:R,cornersField:U}=T();export{B as BORDER_WIDTH_MAX,A as CORNER_RADIUS_MAX,R as borderField,x as colourField,U as cornersField,F as keptByRow,T as styleFieldBuilders};