efficient-web-builder 18.4.0 → 19.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/CHANGELOG.md +30 -0
- package/dist/components/SiteFields.js +1 -1
- package/dist/components/StandaloneSectionEditor.js +1 -1
- package/dist/lib/pinned-chrome-doc.js +1 -1
- package/dist/lib/puck/apply-card-corners.d.ts +1 -1
- package/dist/lib/puck/apply-card-corners.js +1 -1
- package/dist/lib/puck/booking-preview.js +1 -1
- package/dist/lib/puck/controls.d.ts +2 -0
- package/dist/lib/puck/selection-parent.d.ts +12 -0
- package/dist/lib/puck/selection-parent.js +1 -0
- package/dist/lib/puck/show-when.d.ts +14 -0
- package/dist/lib/puck/show-when.js +1 -0
- package/dist/lib/section-retarget.d.ts +2 -0
- package/dist/lib/section-retarget.js +1 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 19.0.0 - 2026-10-17
|
|
4
|
+
|
|
5
|
+
**A settings row may carry the shell's one show-when rule, read in ONE place** (Lewis 2026-10-17: one rule, one place; efficient-shell #516). No field carries a rule yet, so every panel draws what it drew.
|
|
6
|
+
|
|
7
|
+
### Breaking for hosts
|
|
8
|
+
|
|
9
|
+
- **efficient-shell 7.50.0 or later is required.** The peer range narrows from `^7.48.0` to `^7.50.0`: the rows panel reads `showWhen` with the shell's `isShown`, first published in 7.50.0. On an older shell the import is missing. A narrowed range is a major (scripts/test-shell-peer-range).
|
|
10
|
+
|
|
11
|
+
### Added for hosts
|
|
12
|
+
|
|
13
|
+
- `showWhen` on a field definition: the shell's `ShowWhenRule` as data, next to the label (`CustomField.showWhen`). The rows panel (`components/SiteFields`) drops a field whose rule is false before the Inspector draws; its value is kept. No field wraps itself.
|
|
14
|
+
- `lib/puck/show-when`: `visibleFields(fields, values, context)`, `showWhenContext(device, config, content, selector)`, `showWhenOf(field)`, and `withShowWhen(field, rule)` — the one way to give a field its rule, keeping the field's own type. The context a rule may read: `device` (the preview's view, in the editor's own words: `desktop` / `tablet` / `mobile`), `parentType`, and `parent` (the parent node's props, for a card-template row).
|
|
15
|
+
|
|
16
|
+
### Changed for hosts
|
|
17
|
+
|
|
18
|
+
- **Which node owns a zone is answered once** (`lib/puck/selection-parent`: `zoneOwner(zone)`, `parentOfSelection(config, content, selector)`; Lewis's SSOT clean-up, 2026-10-17). `apply-card-corners`, `booking-preview` (`sectionIdOfBoxZone`), `pinned-chrome-doc` and `show-when` cut no zone by hand any more; each answers what it answered before (the last colon; no owner for an absent, empty or colon-less zone).
|
|
19
|
+
|
|
20
|
+
### Not moved yet
|
|
21
|
+
|
|
22
|
+
- The 13 hand-written `resolveFields` hides. They move onto this next, as the show-when roll-out's own step.
|
|
23
|
+
|
|
24
|
+
### Guards
|
|
25
|
+
|
|
26
|
+
- `scripts/test-shell-peer-range.ts` records the 7.50.0 floor.
|
|
27
|
+
- New `scripts/test-selection-parent.ts`: the cut, the parent found inside a Box, the old callers' answers, and no hand cut left in the four files. Failed first (module not found).
|
|
28
|
+
- New `scripts/test-field-show-when.tsx`: a `{ context: "device", is: "mobile" }` row shows only in the phone view; a `{ field: "x", is: true }` row follows x; a hidden row keeps its value (the values are frozen and come out unchanged); no rule or an unreadable one shows the row; the parent's type and values reach the rule; SiteFields is the one reader. Failed before the change (module not found).
|
|
29
|
+
|
|
30
|
+
### Needs
|
|
31
|
+
|
|
32
|
+
- efficient-shell 7.50.0 (`isShown`).
|
|
3
33
|
## 18.4.0 - 2026-10-17
|
|
4
34
|
|
|
5
35
|
**A site can show a Share button on its blog posts, and Assistant joins the fonts** (Panthera rebuild; Lewis approved the design 2026-10-17). A minor: no stored key changes, and every site draws what it drew.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as E}from"react/jsx-runtime";import{useLayoutEffect as j,useMemo as C,useRef as L,useState as T}from"react";import{useEasel as q,useSelectedFields as P}from"efficient-easel/easel";import{Inspector as R,planFields as F}from"efficient-easel/fields";import{BUCKET_ICONS as U,entriesHiddenForTab as X}from"../lib/puck/controls.js";import{BUCKETS as G}from"../lib/puck/field-groups.js";import{say as H}from"../lib/editor-words.js";import{usePreviewDevice as W}from"./PreviewDeviceContext.js";import{showWhenContext as Y,visibleFields as z}from"../lib/puck/show-when.js";import{bandIsDropped as J,droppedBands as Q,sameKeys as V,TEXT_BAND_KEY as v,TEXT_BAND_TITLE as Z,withoutBands as $}from"../lib/puck/panel-bands.js";const g=new Map,f=new Set;function ee(o,r){const n=new Map;for(const s of o.querySelectorAll(".es-insp-row[data-field]"))n.set(s.getAttribute("data-field")??"",s);const a=[];for(const[s,m]of r)a.push({key:s,rows:m.map(p=>{const l=n.get(p),d=!!l&&[...l.children].some(b=>!b.hidden),w=l?.querySelector(".es-field-label, .es-list-label")?.textContent?.trim();return{shown:d,labelled:d&&!!w}})});return a}const te=Object.fromEntries(G.map(o=>{const r=U[o];return[o,E(r,{},o)]}));function fe({entries:o,entryCount:r=0}){const{id:n,fields:a,values:s,readOnly:m,onChange:p}=P(),l=W(),{appState:d,config:w}=q(e=>e),b=Y(l,w,d.data.content??[],d.ui.itemSelector),c=z(a,s,b),[_,A]=T(()=>new Set(f)),[x,I]=T(()=>new Set),B=L(null),M=C(()=>{const e=new Map;for(const t of F(c).rows){if(!t.fold)continue;const i=e.get(t.fold.key)??[];i.push(t.name),e.set(t.fold.key,i)}return e},[c]);j(()=>{const e=B.current?.parentElement;if(!e)return;const t=new Set(Q(ee(e,M)));I(i=>V(i,t)?i:t)});const D=C(()=>$(c,x),[c,x]),N={key:v,rows:Array.from({length:r},()=>({shown:!0,labelled:!0}))},O=J(N)?void 0:{key:v,title:Z},[h,k]=T(()=>g.get(n)),y=g.get(n),u=F(c).buckets,S=y&&u.includes(y)?y:h&&u.includes(h)?h:u[0],K=S===void 0||X(u,S)!==!0;return E(R,{fields:D,values:s,onChange:p,readOnly:m,tab:S,onTab:e=>{g.set(n,e),k(e)},tabIcons:te,idPrefix:n,ariaLabel:H("Section settings"),lead:K?o:null,leadFold:O,closedFolds:_,onFold:(e,t)=>{t?f.delete(e):f.add(e),A(new Set(f))},children:E("span",{ref:B,hidden:!0})})}export{fe as SiteFields,te as TAB_ICONS};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as o}from"react/jsx-runtime";import{useCallback as R,useEffect as S,useMemo as l,useRef as V,useState as u}from"react";import x from"next/dynamic";import"efficient-easel/easel.css";import"efficient-easel/shell.css";import"efficient-easel/rail.css";import"efficient-easel/panel.css";import"efficient-easel/fields.css";import"efficient-easel/pick.css";import"efficient-easel/copy.css";import"efficient-easel/gold.css";import"efficient-easel/text-styles.css";import"efficient-easel/menu.css";import"efficient-easel/chrome.css";import"efficient-easel/tree.css";import"efficient-easel/screen.css";import"./storefront-editor.css";import{buildConfig as X}from"../lib/puck/build-config.js";import{withTemplateMediaPlaceholders as Z}from"../lib/puck/templateFields.js";import{setEditorPageSlug as B}from"../lib/puck/editor-page-context.js";import{StorefrontDocumentContext as $}from"./StorefrontDocumentContext.js";import{PreviewHeaderProvider as ee}from"./PreviewHeaderContext.js";import{PreviewTickerProvider as te}from"./PreviewTickerContext.js";import{PreviewPartsProvider as re}from"./PreviewPartsContext.js";import{PreviewLocationPartProvider as oe}from"./PreviewLocationPartContext.js";import{PreviewPartStyleProvider as ie}from"./PreviewPartStyleContext.js";import{sectionTemplates as O}from"../lib/editor-section-templates.js";import{nodeToDoc as ne,docToNode as F}from"../lib/puck/section-doc.js";import{newNodeId as se}from"../lib/puck/content-tree.js";import{migrateRenamedProps as de}from"../lib/puck/renamed-props.js";import{buildSlotSeedChildren as ae}from"../lib/puck/slot-specs.js";import{FOOTER_TYPE as ce,buildDefaultFooterBlocks as me}from"../lib/puck/footer-blocks.js";import{NO_BRIDGED_CAPABILITIES as le,useAdminBridge as ue}from"../lib/editor-admin-bridge.js";import{useEditorHost as fe}from"../lib/editor-host.js";import{ChromeWrap as pe}from"../lib/editor-chrome.js";import{sessionRegistry as ve}from"../lib/editor-session.js";import{useEditorSession as ge}from"../lib/editor-session-context.js";import{say as H}from"../lib/editor-words.js";import{
|
|
1
|
+
"use client";import{jsx as o}from"react/jsx-runtime";import{useCallback as R,useEffect as S,useMemo as l,useRef as V,useState as u}from"react";import x from"next/dynamic";import"efficient-easel/easel.css";import"efficient-easel/shell.css";import"efficient-easel/rail.css";import"efficient-easel/panel.css";import"efficient-easel/fields.css";import"efficient-easel/pick.css";import"efficient-easel/copy.css";import"efficient-easel/gold.css";import"efficient-easel/text-styles.css";import"efficient-easel/menu.css";import"efficient-easel/chrome.css";import"efficient-easel/tree.css";import"efficient-easel/screen.css";import"./storefront-editor.css";import{buildConfig as X}from"../lib/puck/build-config.js";import{withTemplateMediaPlaceholders as Z}from"../lib/puck/templateFields.js";import{setEditorPageSlug as B}from"../lib/puck/editor-page-context.js";import{StorefrontDocumentContext as $}from"./StorefrontDocumentContext.js";import{PreviewHeaderProvider as ee}from"./PreviewHeaderContext.js";import{PreviewTickerProvider as te}from"./PreviewTickerContext.js";import{PreviewPartsProvider as re}from"./PreviewPartsContext.js";import{PreviewLocationPartProvider as oe}from"./PreviewLocationPartContext.js";import{PreviewPartStyleProvider as ie}from"./PreviewPartStyleContext.js";import{sectionTemplates as O}from"../lib/editor-section-templates.js";import{nodeToDoc as ne,docToNode as F}from"../lib/puck/section-doc.js";import{newNodeId as se}from"../lib/puck/content-tree.js";import{migrateRenamedProps as de}from"../lib/puck/renamed-props.js";import{buildSlotSeedChildren as ae}from"../lib/puck/slot-specs.js";import{FOOTER_TYPE as ce,buildDefaultFooterBlocks as me}from"../lib/puck/footer-blocks.js";import{NO_BRIDGED_CAPABILITIES as le,useAdminBridge as ue}from"../lib/editor-admin-bridge.js";import{useEditorHost as fe}from"../lib/editor-host.js";import{ChromeWrap as pe}from"../lib/editor-chrome.js";import{sessionRegistry as ve}from"../lib/editor-session.js";import{useEditorSession as ge}from"../lib/editor-session-context.js";import{say as H}from"../lib/editor-words.js";import{retargetWhenSaved as he}from"../lib/section-retarget.js";import{routeSharedHostMessage as Se}from"../lib/editor-host-inbound.js";import{routeWebsiteHostMessage as Pe}from"../lib/website-host-inbound.js";import{DEFAULT_THEME_MODE as P,THEME_MODE_KEY as Ee}from"../lib/theme.js";import{makeSitePageAdapter as L}from"../lib/editor-document-adapter.js";import{documentPermissions as ye}from"efficient-easel/edit-lock";import{useAutosave as Te}from"efficient-easel/autosave";import{saveStatusOf as we}from"../lib/puck/pinned-seed-gate.js";import{blocksOf as Ne}from"../lib/website-session.js";const ke=x(()=>import("./SiteEditorProvider.js"),{ssr:!1}),Ae=x(()=>import("./SectionEditorShell.js"),{ssr:!1}),U="HeroSingle",W="Untitled section";function Ce(i,E){const d=E.components,r=d[i]?i:U,y=d[r]?.defaultProps??{},n=ae(r,f=>d[f]?.defaultProps??{}),s=r===ce?{blocks:me()}:null;return{type:r,props:{id:se(r),...y,...n?{[n.slot]:n.children}:null,...s}}}function Ie(){if(typeof window>"u")return P;try{const i=window.localStorage.getItem(Ee);return i==="light"||i==="dark"||i==="auto"?i:P}catch{return P}}function Oe({id:i,initialType:E,initialName:d=W}){const[r,y]=u(i),n=V(r);S(()=>{n.current=r},[r]);const s=fe(),[f,Y]=u(E),[b,j]=u(d),[a,T]=u(void 0),[K,G]=u(P),{token:w,tokenRef:M}=ue({onMessage:e=>{if(Pe(e)||Se(e))return;const t=e;if(t?.type==="storefront-editor:navigate"&&t.target?.kind==="section"&&t.target.id){const I=t.target.id;if(I===n.current)return;const J=t.target.type,Q=t.target.name;he(k,()=>{Y(J),j(Q||W),y(I),s.address.show({kind:"section",id:I})},()=>s.send("storefront-editor:save-failed"))}}}),N=Te({save:e=>O.update(e.id,e.node).then(()=>{}),onFailure:(e,t)=>{t===0&&s.send("storefront-editor:save-failed")}}),{state:p,push:_,flush:k}=N;S(()=>G(Ie()),[]);const c=ge(),v=c.usesBridgedToken?!!w:!0,g=l(()=>X(ve(c),Ne(c)),[c]);S(()=>{if(!v)return;let e=!1;return T(void 0),O.ensure(r,b,Ce(f??U,g)).then(t=>!e&&T(t.node)).catch(()=>!e&&T(null)),()=>{e=!0}},[r,f,b,v,g]);const A=R(e=>{s.send("storefront-editor:dirty");const t=F(e);t&&_({id:n.current,node:t})},[_,s]),h=s.send,D=R(async e=>{try{return await e(M.current??""),!0}catch{return h("storefront-editor:save-failed"),!1}},[h]),q=l(()=>Z(g,!0),[g]);S(()=>(B(null),()=>B(null)),[]);const m=l(()=>a?de(ne(a)):null,[a]),C=l(()=>({target:{kind:"page",slug:""},adapter:L(void 0),capabilities:L(void 0).capabilities,templateId:null,currentSlug:"",currentKind:null,siteId:null,ready:v,token:w,tokenRef:M,notifyParent:h,runAuthed:D,docId:r,data:m,getLiveData:()=>m,footerOriginSlug:null,error:null,redirecting:!1,saveStatus:we(p),saveState:p,autoSaveEnabled:!0,autoSaveStoppedByConflict:!1,hasUnsavedEdits:p.pending,toggleAutoSave:()=>{},retrySave:()=>{N.retryNow()},onChange:A,flushSave:k,onPublish:async e=>{const t=F(e);t&&await O.update(n.current,t)},bridgeCapabilities:le,access:{kind:"editing"},readOnly:!1,takeOverEditing:()=>{},viewReadOnly:()=>{},saveConflict:null,reloadFromServer:()=>{},navigate:()=>{},pendingNav:null,cancelPendingNav:()=>{},discardAndNavigate:()=>{},saveAndNavigate:async()=>{}}),[r,v,w,h,D,m,p,A,k,N.retryNow]),z=l(()=>ye(!C.readOnly),[C.readOnly]);return a===void 0?o("div",{className:"sf-msg",children:H("Loading…")}):a===null||!m?o("div",{className:"sf-msg sf-msg--error",children:H("Couldn’t open this section.")}):o($.Provider,{value:C,children:o(ee,{themeMode:K,chromePlaceholder:!0,children:o(pe,{wrap:c.chrome?.wrap,surface:"section",children:o(te,{children:o(re,{children:o(oe,{children:o(ie,{children:o(ke,{config:q,data:m,onChange:A,permissions:z,children:o(Ae,{})},r)})})})})})})})}export{Oe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isSectionGroupType as F,SITE_FOOTER_TYPE as E,SITE_HEADER_TYPE as O,siteFooterDocChrome as
|
|
1
|
+
import{isSectionGroupType as F,SITE_FOOTER_TYPE as E,SITE_HEADER_TYPE as O,siteFooterDocChrome as k}from"./puck/section-groups.js";import{zoneOwner as N}from"./puck/selection-parent.js";const A="Footer",x=[O,A,E],y=e=>{const t=e?.content;return Array.isArray(t)?t:[]},l=e=>{const t=e?.zones;return t&&typeof t=="object"&&!Array.isArray(t)?t:null},h=e=>{const t=e?.props?.id;return typeof t=="string"?t:void 0},I=e=>N(e)?.ownerId??"";function P(e){const t=k(y(e)),o=t.some(r=>r?.type===E);return t.filter(r=>r?.type===O||r?.type===E||r?.type===A&&!o)}function z(e,t){const o=new Set,r=s=>{if(Array.isArray(s)){for(const f of s)r(f);return}if(!s||typeof s!="object")return;const i=s;if(typeof i.type=="string"&&i.props&&typeof i.props=="object"){const f=h(i);f&&o.add(f)}for(const f of Object.values(s))r(f)};if(r(e),t){let s=!0;const i=new Set;for(;s;){s=!1;for(const[f,p]of Object.entries(t))i.has(f)||!o.has(I(f))||(i.add(f),r(p),s=!0)}}return o}function T(e,t){const o={},r={};for(const[s,i]of Object.entries(e??{}))(t.has(I(s))?o:r)[s]=i;return{owned:o,rest:r}}function Z(e,t){if(!t)return e;const o=P(t);if(!o.length)return e;const r=o.filter(p=>p.type===O),s=o.filter(p=>p.type!==O),i={...e,content:[...r,...y(e),...s]},{owned:f}=T(l(t),z(o,l(t)));return Object.keys(f).length&&(i.zones={...l(e)??{},...f}),i}function v(e,t){if(!t)return{page:e,chrome:null};const o=P(t),r=new Set(o.map(h).filter(n=>!!n)),s=[],i=[];for(const n of y(e)){const c=h(n);c&&r.has(c)||F(n?.type)?i.push(n):s.push(n)}const f=new Map(i.map(n=>[h(n),n])),p=new Set;let d=k(y(t)).flatMap(n=>{const c=h(n);if(!c||!r.has(c))return[n];const u=f.get(c);return u?(p.add(u),[u]):[]});for(const n of i)p.has(n)||d.some(c=>c?.type===n.type)||(d=n.type===O?[n,...d]:[...d,n]);d=k(d);const m=d.length===y(t).length&&d.every((n,c)=>n===y(t)[c]),g=l(e),C=z(d,g),{owned:w,rest:S}=T(g,C),_=T(l(t),z(o,l(t))).owned,b={...t,content:m?t.content:[...d]},a=l(t);if(a||Object.keys(w).length){const n={};for(const[c,u]of Object.entries(a??{}))c in _?c in w&&(n[c]=w[c]):n[c]=u;for(const[c,u]of Object.entries(w))c in n||(n[c]=u);b.zones=n,a&&D(b.zones,a)&&(b.zones=a)}const j={...e,content:s};return g&&(Object.keys(S).length||!Object.keys(_).length?j.zones=S:delete j.zones),{page:j,chrome:b}}function D(e,t){const o=Object.keys(e),r=Object.keys(t);return o.length===r.length&&o.every((s,i)=>s===r[i]&&e[s]===t[s])}function H(e,t){return o=>e(o)||o!==void 0&&x.includes(o)&&t()}export{x as PINNED_CHROME_TYPES,H as lockedWhileHeld,Z as spliceChrome,v as splitChrome};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{say as
|
|
1
|
+
import{say as i,sayCount as h}from"../editor-words.js";import{hasOwnCardCorners as f,cardsWithSharedCorners as u}from"../content/card-corners.js";import{parentOfSelection as l}from"./selection-parent.js";function y(r,t,c){const e=l(r,t,c),o=e?.slot??"",n=e&&Array.isArray(e.item.props[o])?e.item.props[o]:[],p=c?.index??-1,s=p>=0?n[p]:void 0,d=s?.props?.id?String(s.props.id):"",a=Math.max(n.length-1,0);return!e||!d?{can:!1,reason:"unreachable",others:0}:n.length<=1?{can:!1,reason:"alone",others:a}:f(s?.props?.cardCorners)?{can:!0,others:a,zone:e.zone,index:e.index,data:{...e.item,props:{...e.item.props,[o]:u(n,d)}}}:{can:!1,reason:"unset",others:a}}function A(r){return r.can?h("Gives the other card this card's Corners.","Gives the other {n} cards this card's Corners.",r.others):r.reason==="alone"?i("This is the only card in the section."):r.reason==="unset"?i("Set this card's corners first."):i("This card is not in a section that can share corners.")}function g(r){return h("Applied to {n} card","Applied to {n} cards",r)}function S(r,t){r.can&&t(r.zone,r.index,r.data)}export{S as applyCorners,g as applyCornersDoneLabel,A as applyCornersNote,y as planApplyCorners};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useSyncExternalStore as
|
|
1
|
+
"use client";import{useSyncExternalStore as t}from"react";import{zoneOwner as i}from"./selection-parent.js";let n=null;const o=new Set;function f(e){if(n!==e){n=e;for(const r of o)r()}}function u(e){return o.add(e),()=>{o.delete(e)}}function c(){return t(u,()=>n,()=>null)}function w(e){return i(e)?.ownerId??null}export{w as sectionIdOfBoxZone,f as setBookingPreview,c as useBookingPreview};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ReactElement, type ReactNode } from "react";
|
|
2
2
|
import { readHidable, hidableText, type HidableValue } from "./hidable.js";
|
|
3
3
|
import { FOLD_FIELD_MARKER, LINK_FIELD_MARKER, MEDIA_FIELD_MARKER, SCAFFOLD_FIELD_MARKER, TEXT_FIELD_MARKER, foldMetaOf, textFieldIdentifier, type EdgeCell, type FoldFieldMeta, type TextFieldMeta, type TextListRendering } from "./field-markers.js";
|
|
4
|
+
import type { ShowWhenRule } from "./show-when.js";
|
|
4
5
|
import { type HeroGroupPlacement } from "../hero-group-placement.js";
|
|
5
6
|
import { type SettingsSidesValue, type SettingsBorderValue } from "efficient-easel/panel";
|
|
6
7
|
import { type AlignmentPoint, FOCAL_DEFAULT } from "efficient-shell/ui";
|
|
@@ -34,6 +35,7 @@ export type CustomField<V> = {
|
|
|
34
35
|
type: "custom";
|
|
35
36
|
render: Render<V>;
|
|
36
37
|
[GAP_FIELD_CONTAINER]?: GapContainer;
|
|
38
|
+
showWhen?: ShowWhenRule;
|
|
37
39
|
};
|
|
38
40
|
export declare function Label({ children }: {
|
|
39
41
|
children: ReactNode;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type NodeLocation, type SlotConfigView, type TreeItem } from "./content-tree.js";
|
|
2
|
+
export declare function zoneOwner(zone: string | null | undefined): {
|
|
3
|
+
ownerId: string;
|
|
4
|
+
slot: string;
|
|
5
|
+
} | null;
|
|
6
|
+
export type SelectionAddress = {
|
|
7
|
+
index: number;
|
|
8
|
+
zone?: string;
|
|
9
|
+
} | null | undefined;
|
|
10
|
+
export declare function parentOfSelection(config: SlotConfigView, content: ReadonlyArray<TreeItem>, selector: SelectionAddress): (NodeLocation & {
|
|
11
|
+
slot: string;
|
|
12
|
+
}) | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{locateNode as r}from"./content-tree.js";function c(n){if(!n)return null;const t=n.lastIndexOf(":");return t>0?{ownerId:n.slice(0,t),slot:n.slice(t+1)}:null}function s(n,t,l){const o=c(l?.zone),e=o?r(n,t,o.ownerId):null;return e&&o?{...e,slot:o.slot}:null}export{s as parentOfSelection,c as zoneOwner};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ShowWhenContext, type ShowWhenRule } from "efficient-shell/ui";
|
|
2
|
+
import type { SlotConfigView, TreeItem } from "./content-tree.js";
|
|
3
|
+
export type { ShowWhenRule, ShowWhenContext };
|
|
4
|
+
export type WithShowWhen = {
|
|
5
|
+
showWhen?: ShowWhenRule;
|
|
6
|
+
};
|
|
7
|
+
export declare function withShowWhen<F extends object>(field: F, rule: ShowWhenRule): F;
|
|
8
|
+
export declare function showWhenOf(field: unknown): ShowWhenRule | undefined;
|
|
9
|
+
export declare function visibleFields<T extends Record<string, unknown>>(fields: T, values: Readonly<Record<string, unknown>> | null | undefined, context: ShowWhenContext): T;
|
|
10
|
+
export type ShowWhenSelector = {
|
|
11
|
+
index: number;
|
|
12
|
+
zone?: string;
|
|
13
|
+
} | null | undefined;
|
|
14
|
+
export declare function showWhenContext(device: string | undefined, config: SlotConfigView, content: ReadonlyArray<TreeItem>, selector: ShowWhenSelector): ShowWhenContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isShown as s}from"efficient-shell/ui";import{parentOfSelection as f}from"./selection-parent.js";function w(e,t){return{...e,showWhen:t}}function h(e){return e&&typeof e=="object"?e.showWhen:void 0}function m(e,t,r){let o=!1;const n={};for(const[i,p]of Object.entries(e))s(h(p),t??{},r)?n[i]=p:o=!0;return o?n:e}function a(e,t,r,o){const n=f(t,r,o);return{device:e,parentType:n?.item.type,parent:n?.item.props}}export{a as showWhenContext,h as showWhenOf,m as visibleFields,w as withShowWhen};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
async function n(t,r,a){let e=!1;try{e=await t()}catch{}return e?(r(),"switched"):(a(),"refused")}export{n as retargetWhenSaved};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-web-builder",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "19.0.0",
|
|
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",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@tabler/icons-react": "^3.46.0",
|
|
43
43
|
"efficient-easel": "^11.2.0",
|
|
44
|
-
"efficient-shell": "^7.
|
|
44
|
+
"efficient-shell": "^7.50.0",
|
|
45
45
|
"isomorphic-dompurify": "^3.18.0",
|
|
46
46
|
"next": ">=16",
|
|
47
47
|
"react": ">=19",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@types/react": "^19",
|
|
61
61
|
"@types/react-dom": "^19",
|
|
62
62
|
"efficient-easel": "^11.2.0",
|
|
63
|
-
"efficient-shell": "^7.
|
|
63
|
+
"efficient-shell": "^7.50.0",
|
|
64
64
|
"esbuild": "^0.28.0",
|
|
65
65
|
"happy-dom": "^20.14.5",
|
|
66
66
|
"isomorphic-dompurify": "^3.18.0",
|