efficient-web-builder 26.0.0 → 26.0.1
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 26.0.1 - 2026-10-20
|
|
6
|
+
|
|
7
|
+
**No "Clear changes" in a text part's Style list** (Lewis 2026-10-19: "do not use Clear changes"). A PATCH: no export, prop or peer range changes.
|
|
8
|
+
|
|
9
|
+
### Changed for merchants
|
|
10
|
+
|
|
11
|
+
- The Style list of a text part's settings ends in Edit styles · Update style. "Clear changes" is gone. Update style still clears the part's own changes after it writes them to the style, as before.
|
|
12
|
+
|
|
5
13
|
## 26.0.0 - 2026-10-20
|
|
6
14
|
|
|
7
15
|
**One Publish puts the whole website live** (Lewis, 2026-10-19: like Wix; the site-wide Publish plan, PR 5). Where the backend offers it, every edit in the editor is a draft, and Publish puts the pages and every site-wide draft live together; the ▾ menu lists what the press will put live.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,Fragment as te,jsxs as h}from"react/jsx-runtime";import{useContext as Ye,useEffect as ne,useRef as qe,useState as ke}from"react";import{PartResetDot as Je}from"./PartResetDot.js";import{FieldSelect as Qe,InspectorField as Ze}from"efficient-easel/fields";import{SettingsField as et}from"efficient-easel/panel";import{InspectorUpLevel as K}from"efficient-easel/chrome";import{StylesIcon as tt,TypeIcon as nt}from"efficient-easel/icons";import{useEasel as ot}from"efficient-easel/easel";import{TextPartPanel as st}from"efficient-easel/copy";import{Tooltip as lt}from"efficient-shell/ui";import{PartTextBox as rt,partTextCells as it}from"./PartTextBox.js";import{UiIcon as Oe}from"efficient-easel/draw/client";import{usePreviewHeader as at}from"../../render/components/PreviewHeaderContext.js";import{UpdateStyleDialog as ct}from"./UpdateStyleDialog.js";import{StorefrontDocumentContext as dt}from"./StorefrontDocumentContext.js";import{hasStyleChange as ut,partStyleToTextStyleValues as ft,pushIntoStyle as pt,resolveTextStyles as mt,styleIdOfRole as Re}from"../lib/site-text-styles.js";import{useSiteTextStylesWriter as ht}from"../lib/site-text-styles-writer.js";import{useThemeRowPersist as yt}from"../lib/theme-row-persist.js";import{usePreviewDevice as gt}from"efficient-easel/draw/client";import{usePartStyle as St}from"./PreviewPartStyleContext.js";import{say as s}from"../../format/lib/editor-words.js";import{readHidable as U,textFieldOffPage as bt,textFieldPanelOnly as xt}from"../lib/puck/controls.js";import{TEXT_FIELD_MARKER as Pt}from"efficient-easel/draw";import{useSectionOps as wt}from"../lib/puck/use-section-ops.js";import{FONT_OPTIONS as Tt,FONT_ROLES as oe,FONT_ROLE_LABELS as se,fontOption as le}from"../../format/lib/fonts.js";import{isMultilineKind as vt,partPlaceholder as Nt,typeInPlaceKind as Ct}from"../../render/lib/puck/part-text.js";import{partRowField as kt}from"../lib/puck/part-row-field.js";import{decodePartKey as Ot,partPropsWithRowValue as Rt,partRowValue as It}from"../../render/lib/puck/part-rows.js";import{PART_WIDTH_MAX as Et,propsWithPartStyleValue as B,propsWithoutPartStyle as Ft,readPartStyle as Ie}from"../../render/lib/puck/part-styles.js";import{partThemeColors as _t}from"../../format/lib/puck/part-inks.js";import{styleKeyForPart as zt}from"../../format/lib/sections/section-text-kinds.js";import{commitPartText as At}from"../lib/puck/part-typing.js";import{keysOnCanvas as Vt,useCanvasTypingPart as Lt}from"../lib/puck/canvas-typing.js";import{useEditorHost as Kt}from"../lib/editor-host.js";import{SOURCE_LINES as Ut,SOURCE_ACTIONS as Bt,SOURCE_ACTION_LABEL as Dt,partSourceNoteFor as Wt,partSourceOf as Mt,sourceMenuIdOf as jt,sourceSlugOf as Ee}from"../../format/lib/puck/source-bound-parts.js";import{encodePartId as Gt,holdsAuthoredText as Ht}from"../../render/lib/puck/text-parts.js";import{regionsForSection as $t}from"../../format/lib/sections/section-text-regions.js";import{textRegionOfPartKey as Xt}from"../../format/lib/sections/text-regions.js";function re(n){return n?s(n):null}function Fe(n){return n.kind==="role"?se[n.role]:n.kind==="custom"?"Custom":null}function Yt(n){const o=n.role;return o&&oe.includes(o)?{kind:"role",role:o}:null}function qt(n,o){if(!n)return{kind:"unread"};const{faceRole:l,base:a}=n;if(o[l]===a.fontKey)return{kind:"role",role:l};const i=Object.keys(o).filter(r=>o[r]===a.fontKey);return i.length===1?{kind:"role",role:i[0]}:{kind:"custom"}}function ie(n,o,l,a){return Yt(Ie(n,o))??qt(l,a)}function Jt(n,o){if(!n.length)return null;const l=o(n[0]);return n.every(a=>o(a)===l)?l:null}const D="";function Qt({face:n,base:o,onPick:l}){const a=n.kind==="role"?n.role:D,i=[{label:s("No style"),value:D},...oe.map(r=>({label:s(se[r]),value:r}))];return t(Qe,{ariaLabel:s("Style"),value:a,options:i,inline:!0,onChange:r=>l(r===D?null:r),renderOption:r=>r.value===D?h(te,{children:[t("span",{className:"es-fsel-label sf-part-style-keep",children:r.label}),t("span",{className:"sf-part-style-aside","aria-hidden":"true",children:s("Section’s own")})]}):t("span",{className:"es-fsel-label",style:{fontFamily:`var(--font-role-${r.value})`},children:r.label}),renderValue:()=>t("span",{style:{fontFamily:o?.fontKey?`var(${le(o.fontKey)?.cssVar})`:void 0,fontWeight:o?.weight},children:re(Fe(n))}),valueText:r=>re(Fe(n))??r?.label??""})}function Zt({sectionName:n,onBack:o,textEditor:l,styleRow:a,children:i}){return h("div",{className:"sf-part-panel",children:[t(K,{inline:!0,name:s(n),onSelect:o}),l,a,i]})}function _e({source:n,slug:o,menuId:l}){const a=Kt(),i=Bt[n],r=!i.needsSlug||!!o;return t("div",{className:"sf-note sf-note--source",children:h("p",{className:"es-field-hint sf-hint-keep",children:[s(Ut[n]),r?h(te,{children:[" ",t("button",{type:"button",className:"sf-source-open",onClick:()=>{i.type==="storefront-editor:open-menus"?a.send(i.type,{menuId:l??null}):o&&a.send(i.type,{slug:o})},children:s(Dt)})]}):null]})})}const ze=4,en=120;function tn({region:n,sizePx:o,face:l,base:a,onFollowStyle:i,source:r,slug:W,onBack:P}){const E=n.follows;return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:s(n.label)})}),t("p",{children:o?s("Its size follows Site styles ▸ {follows} — {px}px right now.",{follows:s(E),px:Math.round(o)}):s("Its size follows Site styles ▸ {follows}.",{follows:s(E)})}),i?t(te,{children:t(et,{label:s("Style"),icon:t(tt,{}),hint:s("Every {part} in this section follows it. The face and the size change; the letter case is the section’s own and stays as it is.",{part:s(n.label).toLowerCase()}),children:t(Qt,{face:l,base:a,onPick:i})})}):t("p",{className:"es-field-hint sf-hint-keep",children:s("Only the size follows a site style. This section sets its own font, weight and letter case.")}),r?t(_e,{source:r,slug:W}):null,t(K,{inline:!0,name:s("Page"),onSelect:P})]})}function nn({onBack:n}){return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:s("This part is no longer here.")})}),t("p",{children:s("The section it belonged to has been changed or removed.")}),t(K,{inline:!0,name:s("Page"),onSelect:n})]})}function on({onBack:n,partId:o,why:l}){return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:s("This part's settings did not open.")})}),t("p",{children:s("The words are still on your page and nothing has been lost. The editor could not work out which control belongs to them, which is a fault on our side. Go back and click the section to open its settings instead.")}),t("p",{className:"sf-note-detail",children:h("code",{children:[o," — ",l]})}),t(K,{inline:!0,name:s("Page"),onSelect:n})]})}function sn({nodeId:n,propKey:o,onBack:l,onEditStyle:a}){const{getItemById:i,getSelectorForId:r,config:W}=ot(e=>e),P=wt(),E=Lt(),{partStyle:F}=St(),{fonts:_,textStyles:Ae}=at(),M=Ye(dt),ae=!M?.capabilities?.hasSiteTheme,{persist:Ve}=yt({themeFromDocument:ae,tokenRef:M?.tokenRef,siteId:M?.siteId??null}),O=ht({themeFromDocument:ae,persist:Ve}),[Le,j]=ke(!1),Ke=gt()==="mobile",ce=qe(null),d=i(n),m=r(n),de=d?W.components[d.type]:void 0,{key:g,row:S}=Ot(o),ue=de?.fields?.[g],y=S?kt(ue,S):ue,w=Gt(n,o),p=d?.props??{},b=Ct(y),fe=bt(y),pe=Ht(y),Ue=d?Mt(d.type):null,me=d?Wt(d.type,g):null,G=S?It(p[g],S):p[g],he=!!S&&!(Array.isArray(p[g])&&S.index<p[g].length);ne(()=>{if(Vt(document))return;ce.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[w]);const[H,ye]=ke(0);ne(()=>ye(0),[w]);const $=!!d&&!he&&(!m||!y);ne(()=>{if(!$||H>=ze)return;const e=setTimeout(()=>ye(c=>c+1),en);return()=>clearTimeout(e)},[$,H]);const Be=$&&H<ze;if(!d||he)return t(nn,{onBack:l});const z=$t(d.type),ge=z?Xt(z,o):null;if(z&&ge){const e=F?.partId===w?F:null,c=z[ge],f=c.writable===!0&&!!m,I=ee=>{m&&P.replaceComponent(m.zone,m.index,{...d,props:B(p,o,"role",ee)})};return t(tn,{region:c,sizePx:e?.base.sizePx??null,face:ie(p,o,e,_),base:e?.base??null,onFollowStyle:f?I:void 0,source:Ue,slug:Ee(p),onBack:l})}if(!m||!y)return Be?t("div",{className:"sf-note","aria-busy":"true"}):t(on,{onBack:l,partId:w,why:m?"no field":"no selector"});const Se=e=>{P.replaceComponent(m.zone,m.index,{...d,props:e})},X=e=>{if(U(e).hidden!==U(G).hidden||!b){const f=S?Rt(p,g,S,e):{...p,[g]:e};f&&Se(f);return}At({node:d,propKey:o,kind:b,zone:m.zone,index:m.index},U(e).text,P.replaceComponent)},De=G,T=F?.partId===w?F:null,v=T?.styleOwner,A=v?i(v.owner):null,Y=v&&A?r(v.owner):null,q=!!(v&&A&&Y),N=q?A.props??{}:p,J=q?e=>P.replaceComponent(Y.zone,Y.index,{...A,props:e}):Se,V=q?v.kind:zt(d?.type,o),C=Ie(N,V),u=[{partKey:V,face:ie(N,V,T,_),sizeGroup:T?.sizeGroup??null,base:T?.base??rn,style:C}],We=Jt(u,e=>e.sizeGroup),Me=_t(T?.inks),R=(e,c)=>{let f=N;for(const I of u)f=B(f,I.partKey,e,c);J(f)},je=e=>R("role",e),be=e=>{let c=N;for(const f of u)for(const[I,ee]of Object.entries(e))c=B(c,f.partKey,I,ee??null);J(c)},Q=b==="text"||b==="textarea",{text:xe,hidden:k}=U(G),L=y?.[Pt]?.label??o,Pe=k?s("Show {label} on the slide",{label:s(L)}):s("Hide {label} on the slide",{label:s(L)}),we=h("div",{className:"sf-field-head",children:[t(nt,{}),t("span",{className:"sf-field-label sf-field-label--inline",children:s(L)}),Q&&t(lt,{content:Pe,children:t("button",{type:"button",className:"sf-field-eye","aria-pressed":k,"aria-label":Pe,onClick:()=>X({text:xe,hidden:!k}),children:k?t(Oe,{name:"eye-off",size:14}):t(Oe,{name:"eye",size:14})})})]}),Te=!fe&&pe,Ge=!!b&&(xt(y)||fe||k||!pe),ve=ie(N,V,T,_),Z=ve.kind==="role"?ve.role:null,Ne=Object.entries(C).filter(([e,c])=>e!=="role"&&c!==void 0).length,Ce=()=>{let e=N;for(const c of u){const f=c.style.role;e=Ft(e,c.partKey),f&&(e=B(e,c.partKey,"role",f))}J(e)},x=Re(Z),He=ut(u[0].style),$e=x?mt(O.saved,O.old).find(e=>e.id===x)?.name??x:"",Xe=()=>{j(!1),x&&(O.write(pt({saved:O.saved,old:O.old,styleId:x,values:ft(u[0].style)}),!0),Ce())};return h(Zt,{sectionName:de?.label??d.type,onBack:l,textEditor:t("div",{ref:ce,className:"sf-part-text",children:Ge?t(rt,{text:xe,onTextChange:e=>X(Q?{text:e,hidden:k}:e),multiline:vt(b),markup:b!=="plainText",styled:!1,style:u[0].style,base:u[0].base,setValue:be,colors:Me,placeholder:re(Nt(y))??void 0,ariaLabel:s(L),head:we,typedOnCanvas:E===w}):b?Q?we:null:t(Ze,{field:y,name:o,value:De,onChange:X,id:`sf-part-${n}-${o}`})}),children:[me&&t(_e,{source:me,slug:Ee(p),menuId:jt(p)}),Te&&t(st,{style:{value:Z??"",options:[{value:"",label:s("No style"),description:s("Section’s own")},...oe.map(e=>({value:e,label:s(se[e]),description:le(_[e])?.label}))],onChange:e=>je(e||null),changed:Ne>0,onClearChanges:Ne>0?Ce:void 0,onEditStyles:a,onUpdateStyle:x&&He?()=>j(!0):void 0},font:{value:C.font??"",styleValue:le(u[0].base.fontKey)?.label,options:Tt.map(e=>({label:e.label,value:e.key})),onChange:e=>R("font",e||null)},italic:{value:C.italic,styleValue:ln(Ae,Z),onChange:e=>R("italic",e??null)},cells:it(u[0].style,u[0].base,be,{phone:Ke}),align:{value:C.align??"",styleValue:u[0].base.align,onChange:e=>R("align",e||null)},letterCase:{value:C.case??"",styleValue:u[0].base.case,onChange:e=>R("case",e||null)}}),Le&&x&&t(ct,{styleName:$e,onCancel:()=>j(!1),onConfirm:Xe}),Te&&We===null&&t("p",{className:"es-field-hint sf-hint-keep",children:s("Fixed size — the site’s Text setting doesn’t resize this.")})]})}function ln(n,o){const l=Re(o);return!l||!Array.isArray(n)?!1:n.find(i=>i?.id===l)?.values?.italic===!0}const rn={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0,widthPx:Et};export{Zt as PartPanelBody,Je as PartResetDot,_e as PartSourceNote,Qt as PartStyleSelect,sn as default,ie as partFace};
|
|
1
|
+
"use client";import{jsx as t,Fragment as te,jsxs as h}from"react/jsx-runtime";import{useContext as Ye,useEffect as ne,useRef as qe,useState as Ne}from"react";import{PartResetDot as Je}from"./PartResetDot.js";import{FieldSelect as Qe,InspectorField as Ze}from"efficient-easel/fields";import{SettingsField as et}from"efficient-easel/panel";import{InspectorUpLevel as K}from"efficient-easel/chrome";import{StylesIcon as tt,TypeIcon as nt}from"efficient-easel/icons";import{useEasel as ot}from"efficient-easel/easel";import{TextPartPanel as st}from"efficient-easel/copy";import{Tooltip as lt}from"efficient-shell/ui";import{PartTextBox as rt,partTextCells as it}from"./PartTextBox.js";import{UiIcon as ke}from"efficient-easel/draw/client";import{usePreviewHeader as at}from"../../render/components/PreviewHeaderContext.js";import{UpdateStyleDialog as ct}from"./UpdateStyleDialog.js";import{StorefrontDocumentContext as dt}from"./StorefrontDocumentContext.js";import{hasStyleChange as ut,partStyleToTextStyleValues as ft,pushIntoStyle as pt,resolveTextStyles as mt,styleIdOfRole as Ce}from"../lib/site-text-styles.js";import{useSiteTextStylesWriter as ht}from"../lib/site-text-styles-writer.js";import{useThemeRowPersist as yt}from"../lib/theme-row-persist.js";import{usePreviewDevice as gt}from"efficient-easel/draw/client";import{usePartStyle as St}from"./PreviewPartStyleContext.js";import{say as s}from"../../format/lib/editor-words.js";import{readHidable as U,textFieldOffPage as bt,textFieldPanelOnly as xt}from"../lib/puck/controls.js";import{TEXT_FIELD_MARKER as Pt}from"efficient-easel/draw";import{useSectionOps as wt}from"../lib/puck/use-section-ops.js";import{FONT_OPTIONS as Tt,FONT_ROLES as oe,FONT_ROLE_LABELS as se,fontOption as le}from"../../format/lib/fonts.js";import{isMultilineKind as vt,partPlaceholder as Nt,typeInPlaceKind as kt}from"../../render/lib/puck/part-text.js";import{partRowField as Ct}from"../lib/puck/part-row-field.js";import{decodePartKey as Ot,partPropsWithRowValue as Rt,partRowValue as It}from"../../render/lib/puck/part-rows.js";import{PART_WIDTH_MAX as Et,propsWithPartStyleValue as B,propsWithoutPartStyle as Ft,readPartStyle as Oe}from"../../render/lib/puck/part-styles.js";import{partThemeColors as _t}from"../../format/lib/puck/part-inks.js";import{styleKeyForPart as zt}from"../../format/lib/sections/section-text-kinds.js";import{commitPartText as At}from"../lib/puck/part-typing.js";import{keysOnCanvas as Vt,useCanvasTypingPart as Lt}from"../lib/puck/canvas-typing.js";import{useEditorHost as Kt}from"../lib/editor-host.js";import{SOURCE_LINES as Ut,SOURCE_ACTIONS as Bt,SOURCE_ACTION_LABEL as Dt,partSourceNoteFor as Wt,partSourceOf as Mt,sourceMenuIdOf as jt,sourceSlugOf as Re}from"../../format/lib/puck/source-bound-parts.js";import{encodePartId as Gt,holdsAuthoredText as Ht}from"../../render/lib/puck/text-parts.js";import{regionsForSection as $t}from"../../format/lib/sections/section-text-regions.js";import{textRegionOfPartKey as Xt}from"../../format/lib/sections/text-regions.js";function re(n){return n?s(n):null}function Ie(n){return n.kind==="role"?se[n.role]:n.kind==="custom"?"Custom":null}function Yt(n){const o=n.role;return o&&oe.includes(o)?{kind:"role",role:o}:null}function qt(n,o){if(!n)return{kind:"unread"};const{faceRole:l,base:a}=n;if(o[l]===a.fontKey)return{kind:"role",role:l};const i=Object.keys(o).filter(r=>o[r]===a.fontKey);return i.length===1?{kind:"role",role:i[0]}:{kind:"custom"}}function ie(n,o,l,a){return Yt(Oe(n,o))??qt(l,a)}function Jt(n,o){if(!n.length)return null;const l=o(n[0]);return n.every(a=>o(a)===l)?l:null}const D="";function Qt({face:n,base:o,onPick:l}){const a=n.kind==="role"?n.role:D,i=[{label:s("No style"),value:D},...oe.map(r=>({label:s(se[r]),value:r}))];return t(Qe,{ariaLabel:s("Style"),value:a,options:i,inline:!0,onChange:r=>l(r===D?null:r),renderOption:r=>r.value===D?h(te,{children:[t("span",{className:"es-fsel-label sf-part-style-keep",children:r.label}),t("span",{className:"sf-part-style-aside","aria-hidden":"true",children:s("Section’s own")})]}):t("span",{className:"es-fsel-label",style:{fontFamily:`var(--font-role-${r.value})`},children:r.label}),renderValue:()=>t("span",{style:{fontFamily:o?.fontKey?`var(${le(o.fontKey)?.cssVar})`:void 0,fontWeight:o?.weight},children:re(Ie(n))}),valueText:r=>re(Ie(n))??r?.label??""})}function Zt({sectionName:n,onBack:o,textEditor:l,styleRow:a,children:i}){return h("div",{className:"sf-part-panel",children:[t(K,{inline:!0,name:s(n),onSelect:o}),l,a,i]})}function Ee({source:n,slug:o,menuId:l}){const a=Kt(),i=Bt[n],r=!i.needsSlug||!!o;return t("div",{className:"sf-note sf-note--source",children:h("p",{className:"es-field-hint sf-hint-keep",children:[s(Ut[n]),r?h(te,{children:[" ",t("button",{type:"button",className:"sf-source-open",onClick:()=>{i.type==="storefront-editor:open-menus"?a.send(i.type,{menuId:l??null}):o&&a.send(i.type,{slug:o})},children:s(Dt)})]}):null]})})}const Fe=4,en=120;function tn({region:n,sizePx:o,face:l,base:a,onFollowStyle:i,source:r,slug:W,onBack:P}){const E=n.follows;return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:s(n.label)})}),t("p",{children:o?s("Its size follows Site styles ▸ {follows} — {px}px right now.",{follows:s(E),px:Math.round(o)}):s("Its size follows Site styles ▸ {follows}.",{follows:s(E)})}),i?t(te,{children:t(et,{label:s("Style"),icon:t(tt,{}),hint:s("Every {part} in this section follows it. The face and the size change; the letter case is the section’s own and stays as it is.",{part:s(n.label).toLowerCase()}),children:t(Qt,{face:l,base:a,onPick:i})})}):t("p",{className:"es-field-hint sf-hint-keep",children:s("Only the size follows a site style. This section sets its own font, weight and letter case.")}),r?t(Ee,{source:r,slug:W}):null,t(K,{inline:!0,name:s("Page"),onSelect:P})]})}function nn({onBack:n}){return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:s("This part is no longer here.")})}),t("p",{children:s("The section it belonged to has been changed or removed.")}),t(K,{inline:!0,name:s("Page"),onSelect:n})]})}function on({onBack:n,partId:o,why:l}){return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:s("This part's settings did not open.")})}),t("p",{children:s("The words are still on your page and nothing has been lost. The editor could not work out which control belongs to them, which is a fault on our side. Go back and click the section to open its settings instead.")}),t("p",{className:"sf-note-detail",children:h("code",{children:[o," — ",l]})}),t(K,{inline:!0,name:s("Page"),onSelect:n})]})}function sn({nodeId:n,propKey:o,onBack:l,onEditStyle:a}){const{getItemById:i,getSelectorForId:r,config:W}=ot(e=>e),P=wt(),E=Lt(),{partStyle:F}=St(),{fonts:_,textStyles:_e}=at(),M=Ye(dt),ae=!M?.capabilities?.hasSiteTheme,{persist:ze}=yt({themeFromDocument:ae,tokenRef:M?.tokenRef,siteId:M?.siteId??null}),O=ht({themeFromDocument:ae,persist:ze}),[Ae,j]=Ne(!1),Ve=gt()==="mobile",ce=qe(null),d=i(n),m=r(n),de=d?W.components[d.type]:void 0,{key:g,row:S}=Ot(o),ue=de?.fields?.[g],y=S?Ct(ue,S):ue,w=Gt(n,o),p=d?.props??{},b=kt(y),fe=bt(y),pe=Ht(y),Le=d?Mt(d.type):null,me=d?Wt(d.type,g):null,G=S?It(p[g],S):p[g],he=!!S&&!(Array.isArray(p[g])&&S.index<p[g].length);ne(()=>{if(Vt(document))return;ce.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[w]);const[H,ye]=Ne(0);ne(()=>ye(0),[w]);const $=!!d&&!he&&(!m||!y);ne(()=>{if(!$||H>=Fe)return;const e=setTimeout(()=>ye(c=>c+1),en);return()=>clearTimeout(e)},[$,H]);const Ke=$&&H<Fe;if(!d||he)return t(nn,{onBack:l});const z=$t(d.type),ge=z?Xt(z,o):null;if(z&&ge){const e=F?.partId===w?F:null,c=z[ge],f=c.writable===!0&&!!m,I=ee=>{m&&P.replaceComponent(m.zone,m.index,{...d,props:B(p,o,"role",ee)})};return t(tn,{region:c,sizePx:e?.base.sizePx??null,face:ie(p,o,e,_),base:e?.base??null,onFollowStyle:f?I:void 0,source:Le,slug:Re(p),onBack:l})}if(!m||!y)return Ke?t("div",{className:"sf-note","aria-busy":"true"}):t(on,{onBack:l,partId:w,why:m?"no field":"no selector"});const Se=e=>{P.replaceComponent(m.zone,m.index,{...d,props:e})},X=e=>{if(U(e).hidden!==U(G).hidden||!b){const f=S?Rt(p,g,S,e):{...p,[g]:e};f&&Se(f);return}At({node:d,propKey:o,kind:b,zone:m.zone,index:m.index},U(e).text,P.replaceComponent)},Ue=G,T=F?.partId===w?F:null,v=T?.styleOwner,A=v?i(v.owner):null,Y=v&&A?r(v.owner):null,q=!!(v&&A&&Y),N=q?A.props??{}:p,J=q?e=>P.replaceComponent(Y.zone,Y.index,{...A,props:e}):Se,V=q?v.kind:zt(d?.type,o),k=Oe(N,V),u=[{partKey:V,face:ie(N,V,T,_),sizeGroup:T?.sizeGroup??null,base:T?.base??rn,style:k}],Be=Jt(u,e=>e.sizeGroup),De=_t(T?.inks),R=(e,c)=>{let f=N;for(const I of u)f=B(f,I.partKey,e,c);J(f)},We=e=>R("role",e),be=e=>{let c=N;for(const f of u)for(const[I,ee]of Object.entries(e))c=B(c,f.partKey,I,ee??null);J(c)},Q=b==="text"||b==="textarea",{text:xe,hidden:C}=U(G),L=y?.[Pt]?.label??o,Pe=C?s("Show {label} on the slide",{label:s(L)}):s("Hide {label} on the slide",{label:s(L)}),we=h("div",{className:"sf-field-head",children:[t(nt,{}),t("span",{className:"sf-field-label sf-field-label--inline",children:s(L)}),Q&&t(lt,{content:Pe,children:t("button",{type:"button",className:"sf-field-eye","aria-pressed":C,"aria-label":Pe,onClick:()=>X({text:xe,hidden:!C}),children:C?t(ke,{name:"eye-off",size:14}):t(ke,{name:"eye",size:14})})})]}),Te=!fe&&pe,Me=!!b&&(xt(y)||fe||C||!pe),ve=ie(N,V,T,_),Z=ve.kind==="role"?ve.role:null,je=Object.entries(k).filter(([e,c])=>e!=="role"&&c!==void 0).length,Ge=()=>{let e=N;for(const c of u){const f=c.style.role;e=Ft(e,c.partKey),f&&(e=B(e,c.partKey,"role",f))}J(e)},x=Ce(Z),He=ut(u[0].style),$e=x?mt(O.saved,O.old).find(e=>e.id===x)?.name??x:"",Xe=()=>{j(!1),x&&(O.write(pt({saved:O.saved,old:O.old,styleId:x,values:ft(u[0].style)}),!0),Ge())};return h(Zt,{sectionName:de?.label??d.type,onBack:l,textEditor:t("div",{ref:ce,className:"sf-part-text",children:Me?t(rt,{text:xe,onTextChange:e=>X(Q?{text:e,hidden:C}:e),multiline:vt(b),markup:b!=="plainText",styled:!1,style:u[0].style,base:u[0].base,setValue:be,colors:De,placeholder:re(Nt(y))??void 0,ariaLabel:s(L),head:we,typedOnCanvas:E===w}):b?Q?we:null:t(Ze,{field:y,name:o,value:Ue,onChange:X,id:`sf-part-${n}-${o}`})}),children:[me&&t(Ee,{source:me,slug:Re(p),menuId:jt(p)}),Te&&t(st,{style:{value:Z??"",options:[{value:"",label:s("No style"),description:s("Section’s own")},...oe.map(e=>({value:e,label:s(se[e]),description:le(_[e])?.label}))],onChange:e=>We(e||null),changed:je>0,onEditStyles:a,onUpdateStyle:x&&He?()=>j(!0):void 0},font:{value:k.font??"",styleValue:le(u[0].base.fontKey)?.label,options:Tt.map(e=>({label:e.label,value:e.key})),onChange:e=>R("font",e||null)},italic:{value:k.italic,styleValue:ln(_e,Z),onChange:e=>R("italic",e??null)},cells:it(u[0].style,u[0].base,be,{phone:Ve}),align:{value:k.align??"",styleValue:u[0].base.align,onChange:e=>R("align",e||null)},letterCase:{value:k.case??"",styleValue:u[0].base.case,onChange:e=>R("case",e||null)}}),Ae&&x&&t(ct,{styleName:$e,onCancel:()=>j(!1),onConfirm:Xe}),Te&&Be===null&&t("p",{className:"es-field-hint sf-hint-keep",children:s("Fixed size — the site’s Text setting doesn’t resize this.")})]})}function ln(n,o){const l=Ce(o);return!l||!Array.isArray(n)?!1:n.find(i=>i?.id===l)?.values?.italic===!0}const rn={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0,widthPx:Et};export{Zt as PartPanelBody,Je as PartResetDot,Ee as PartSourceNote,Qt as PartStyleSelect,sn as default,ie as partFace};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-web-builder",
|
|
3
|
-
"version": "26.0.
|
|
3
|
+
"version": "26.0.1",
|
|
4
4
|
"description": "The EFFICIENT website builder: the website editor, the general sections and the renderer that draws them, compiled. Hostable by any EFFICIENT product; nothing here imports a host.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Efficient Pty Ltd",
|