efficient-web-builder 6.1.0 → 8.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 CHANGED
@@ -1,5 +1,87 @@
1
1
  # Changelog
2
2
 
3
+ ## 8.0.0 - 2026-10-14
4
+
5
+ - **Breaking: the page has no "Page Title" field** (owner, 2026-10-13,
6
+ editor audit A2f). `GENERAL_ROOT_FIELDS.title` is gone, with its word in
7
+ the editor's catalogue. It stored `root.props.title`, which nothing reads:
8
+ the published page's `<title>` is the record's SEO title, else its title,
9
+ edited in the Console's Page settings. A host that spread
10
+ `GENERAL_ROOT_FIELDS` loses the row; one that named `.title` must drop it.
11
+ Titles already stored are left alone.
12
+ - **`LABEL_BUCKET` drops its "Opening filter" row.** efficient-storefront-blocks
13
+ removes that page group (editor audit A2i: no page in production used it),
14
+ so the row would be dead, and blocks' own guard fails on a dead row.
15
+
16
+ ## 7.1.1 - 2026-10-14
17
+
18
+ - **"Duplicate to page" has no trailing dots** (owner ruling, 2026-10-14:
19
+ "…" means only that words were cut, so no button, link or menu label ends in
20
+ it). The menu heading now says the phrase the menu already names itself by,
21
+ so the editor's catalogue has one phrase fewer: `"Duplicate to page…"` is
22
+ gone. No host has a word for it (searched efficient-storefront,
23
+ efficient-admin-portal, efficient-storefront-blocks and efficient-easel).
24
+ - **`efficient-shell-ui-check` counts it now.** The dev shell is 7.19.0 and
25
+ `ui-kit.config.json` names `ellipsis-label`, which reads the phrase handed to
26
+ `say()`. Peer ranges are unchanged.
27
+
28
+ ## 7.1.0 - 2026-10-14
29
+
30
+ - **The Layers head names the open page** ("About us", not "/about"; owner,
31
+ 2026-10-14, editor audit item 10). The Pages head's second line names the
32
+ website, so the Layers head's names the page: each says what its panel is
33
+ about. The website hands the screen `useDocumentLabel`; the address stays
34
+ as the fallback while the list loads.
35
+ - **The page list is held once** (`lib/page-rows`): the Pages panel and the
36
+ Layers head read the same rows from one `listPages()` per site, instead of
37
+ the panel keeping its own copy.
38
+
39
+ ## 7.0.1 - 2026-10-14
40
+
41
+ - **The Pages panel has one way to add a page** (Lewis, 2026-10-14). The bottom
42
+ "+ New page" button and its `.sf-pages-new` rules are gone. The panel head's
43
+ New page icon button already did the same thing. An empty list now says
44
+ "No pages yet. Add one with + above." and points at that head button. A host
45
+ that translated "No pages yet" gives the new sentence instead.
46
+ - **Pages list rows keep a 4px gap** (`.sf-pgroup-body`, `var(--space-4)`), the
47
+ shell Tree's own row gap. A hovered row next to the selected one is now two
48
+ rounded shapes, not one block.
49
+ - **The add dialog's busy button keeps saying "Add page"** and shows the shell
50
+ Button's spinner (`loading`). The "Adding…" label is gone (no trailing dots on
51
+ a button). The words catalogue is rewritten: 1,176 phrases.
52
+ - The new guard `scripts/test-pages-panel-one-add.ts` holds all three.
53
+
54
+ ## 7.0.0 - 2026-10-14
55
+
56
+ - **The Layers panel no longer shows the heading outline** (owner,
57
+ 2026-10-14, editor audit). The box under the tree — the heading count,
58
+ "No H1 — add one for SEO." and the list of headings by level — is removed,
59
+ not moved: it is not a layer, "H1" and "SEO" are not a merchant's words, and
60
+ on an empty page it read as an error. The website hands the screen no
61
+ `treeFoot` any more.
62
+ - **Breaking: `components/HeadingAudit` is deleted** (it was reachable through
63
+ the package's `./*` export). No host imports it. Its four words are out of
64
+ the editor's catalogue, and the `.sf-tree-tool` rule is gone with it.
65
+ - `lib/puck/heading-outline` stays: the one-H1 rule's join and the
66
+ storefront's guards still read it.
67
+
68
+ ## 6.1.1 - 2026-10-14
69
+
70
+ - **The editor's stylesheet reads the shell's tokens instead of restating
71
+ them** (the duplicate scan of 2026-10-13, GG for Lewis). Every text size
72
+ reads a shell step token, as the shell's own `ui.css` does:
73
+ `var(--text-sm)` for 14, `--text-xs` for 12, `--text-2xs` for 11, and so on
74
+ (80 rules). The settings panel's side padding reads `var(--space-16)`, and
75
+ `var(--space-8)` in the narrow step. Same pixels; one place each. The theme
76
+ card's preview keeps its own px (a drawing).
77
+ - **Two rules no markup draws are deleted**: `.sf-addempty-sub` and
78
+ `.sf-readability-head`. Neither class appears in any repository's source
79
+ (web-builder, easel, storefront, storefront-blocks, admin and the portals);
80
+ the only hits were old CSS copies inlined in storefront's
81
+ `scripts/harness/*.html` snapshots.
82
+ - The padding guards' reader (`scripts/panel-body-padding.ts`) resolves the
83
+ shell's `--space-*` scale from the installed shell's `ui.css`, in px.
84
+
3
85
  ## 6.1.0 - 2026-10-14
4
86
 
5
87
  **The editor speaks its host's language.** A host that runs in another
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as g,Fragment as A}from"react/jsx-runtime";import{useCallback as L,useRef as z,useState as s}from"react";import{InspectorIconButton as W}from"efficient-easel/chrome";import{PopupMenu as H,PopupMenuItem as Y,PopupMenuLabel as a}from"efficient-shell/ui";import{CopyToPageIcon as $}from"efficient-easel/icons";import{backendOf as M}from"../lib/website-session.js";import{useEditorSession as q}from"../lib/editor-session-context.js";import{say as n}from"../lib/editor-words.js";import{cloneNodeWithFreshIds as G}from"../lib/puck/section-doc.js";import{FOOTER_TYPE as J}from"../lib/puck/content-tree.js";function K({node:N,currentSlug:T,siteId:i,tokenRef:h,runAuthed:D,onNotify:I}){const[c,r]=s(!1),[y,x]=s(null),o=q(),[j,u]=s(!1),[d,b]=s(null),P=z(null),[p,B]=s(null),F=L(async()=>{if(o.usesBridgedToken&&!h.current){u(!0);return}try{x(await M(o).pages.list(i?{siteId:i}:void 0))}catch{u(!0)}},[h,i,o]),O=()=>{if(c){r(!1);return}const e=P.current?.getBoundingClientRect();e&&B({top:e.bottom+6,right:Math.max(8,window.innerWidth-e.right)}),x(null),u(!1),F(),r(!0)},k=(y??[]).filter(e=>e.slug!==T),R=async e=>{if(d)return;b(e.slug);const w=G(N),S=o.documentHooks?.storedNode?.(w)??w,C=M(o).pages,v=await D(async()=>{const m=await C.load({id:e.id});if(!m)throw new Error(`Page "${e.slug}" no longer exists.`);const f=m.layout??{},l=Array.isArray(f.content)?[...f.content]:[],E=l.findIndex(_=>_?.type===J);l.splice(E===-1?l.length:E,0,S),await C.save(e.id,{layout:{root:{},zones:{},...f,content:l}},{version:m.version,clientId:""})});b(null),r(!1),I?.(v?n("Duplicated to “{name}”",{name:e.label}):n("Couldn’t duplicate the section — please retry"),v?"success":"error")};return g(A,{children:[t("span",{"data-menu-toggle":!0,style:{display:"contents"},children:t(W,{buttonRef:P,label:n("Duplicate to another page"),hasPopup:"menu",expanded:c,onClick:O,children:t($,{size:15})})}),c&&p&&t(H,{portal:!0,style:{top:p.top,right:p.right},onClose:()=>r(!1),children:g("div",{role:"menu","aria-label":n("Duplicate to page"),children:[t(a,{children:n("Duplicate to page…")}),j?t(a,{children:n("Couldn’t load pages")}):y===null?t(a,{children:n("Loading…")}):k.length===0?t(a,{children:n("No other pages")}):k.map(e=>g(Y,{role:"menuitem",disabled:d!==null,onClick:()=>{R(e)},children:[t("span",{className:"min-w-0 flex-1 truncate",children:e.label}),d===e.slug?t("span",{className:"shrink-0 text-xs",children:n("Copying…")}):e.draft&&t("span",{className:"shrink-0 text-xs",children:n("draft")})]},e.id))]})})]})}export{K as default};
1
+ "use client";import{jsx as t,jsxs as g,Fragment as A}from"react/jsx-runtime";import{useCallback as L,useRef as z,useState as s}from"react";import{InspectorIconButton as W}from"efficient-easel/chrome";import{PopupMenu as H,PopupMenuItem as Y,PopupMenuLabel as a}from"efficient-shell/ui";import{CopyToPageIcon as $}from"efficient-easel/icons";import{backendOf as M}from"../lib/website-session.js";import{useEditorSession as q}from"../lib/editor-session-context.js";import{say as n}from"../lib/editor-words.js";import{cloneNodeWithFreshIds as G}from"../lib/puck/section-doc.js";import{FOOTER_TYPE as J}from"../lib/puck/content-tree.js";function K({node:N,currentSlug:T,siteId:i,tokenRef:h,runAuthed:D,onNotify:I}){const[c,r]=s(!1),[y,x]=s(null),o=q(),[j,u]=s(!1),[d,b]=s(null),P=z(null),[p,B]=s(null),F=L(async()=>{if(o.usesBridgedToken&&!h.current){u(!0);return}try{x(await M(o).pages.list(i?{siteId:i}:void 0))}catch{u(!0)}},[h,i,o]),O=()=>{if(c){r(!1);return}const e=P.current?.getBoundingClientRect();e&&B({top:e.bottom+6,right:Math.max(8,window.innerWidth-e.right)}),x(null),u(!1),F(),r(!0)},k=(y??[]).filter(e=>e.slug!==T),R=async e=>{if(d)return;b(e.slug);const w=G(N),S=o.documentHooks?.storedNode?.(w)??w,C=M(o).pages,v=await D(async()=>{const m=await C.load({id:e.id});if(!m)throw new Error(`Page "${e.slug}" no longer exists.`);const f=m.layout??{},l=Array.isArray(f.content)?[...f.content]:[],E=l.findIndex(_=>_?.type===J);l.splice(E===-1?l.length:E,0,S),await C.save(e.id,{layout:{root:{},zones:{},...f,content:l}},{version:m.version,clientId:""})});b(null),r(!1),I?.(v?n("Duplicated to “{name}”",{name:e.label}):n("Couldn’t duplicate the section — please retry"),v?"success":"error")};return g(A,{children:[t("span",{"data-menu-toggle":!0,style:{display:"contents"},children:t(W,{buttonRef:P,label:n("Duplicate to another page"),hasPopup:"menu",expanded:c,onClick:O,children:t($,{size:15})})}),c&&p&&t(H,{portal:!0,style:{top:p.top,right:p.right},onClose:()=>r(!1),children:g("div",{role:"menu","aria-label":n("Duplicate to page"),children:[t(a,{children:n("Duplicate to page")}),j?t(a,{children:n("Couldn’t load pages")}):y===null?t(a,{children:n("Loading…")}):k.length===0?t(a,{children:n("No other pages")}):k.map(e=>g(Y,{role:"menuitem",disabled:d!==null,onClick:()=>{R(e)},children:[t("span",{className:"min-w-0 flex-1 truncate",children:e.label}),d===e.slug?t("span",{className:"shrink-0 text-xs",children:n("Copying…")}):e.draft&&t("span",{className:"shrink-0 text-xs",children:n("draft")})]},e.id))]})})]})}export{K as default};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as l,Fragment as se}from"react/jsx-runtime";import{useCallback as le,useEffect as U,useId as oe,useMemo as q,useState as d}from"react";import{useStorefrontDocument as re}from"./StorefrontDocumentContext.js";import f from"./UiIcon.js";import ie from"./SidePanelHead.js";import{useWebsiteName as ce}from"./WebsiteSettingsPanel.js";import{InspectorIconButton as de}from"efficient-easel/chrome";import{Button as K,Dialog as pe,FormField as ue,Input as me,Tooltip as O}from"efficient-shell/ui";import{AddIcon as he}from"efficient-easel/icons";import{PagesIcon as ge}from"efficient-easel/rail";import{useEditorHost as fe}from"../lib/editor-host.js";import{bucketEditorPageRows as be,DYNAMIC_PAGES_GROUP_KEY as ye,isDynamicPageRow as we,MAIN_PAGES_GROUP as Ne}from"../lib/editor-page-rows.js";import{useEditorSession as ke}from"../lib/editor-session-context.js";import{say as a}from"../lib/editor-words.js";const Y="sf-editor-pages-collapsed-groups",ve=i=>i.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),J=(i,b)=>{const c=ve(i)||"page";if(!b.has(c))return c;let m=2;for(;b.has(`${c}-${m}`);)m+=1;return`${c}-${m}`};function Ce({onNavigate:i,onClose:b,activeSurface:c,onPreviewSurface:m}){const y=ke().chrome?.pageRows,_=fe(),{adapter:p,capabilities:w,ready:N,currentSlug:z}=re(),Q=ce(),[r,k]=d(null),[S,T]=d(""),[u,v]=d(!1),[C,h]=d(null),[F,P]=d(!1),[g,I]=d(""),G=oe(),A=le(async()=>{if(N)try{k(await p.listPages())}catch{k([])}},[p,N]);U(()=>{k(null),A()},[A]);const[x,V]=d(()=>{if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(Y);return new Set(e?JSON.parse(e):[])}catch{return new Set}});U(()=>{try{window.localStorage.setItem(Y,JSON.stringify([...x]))}catch{}},[x]);const X=e=>V(s=>{const n=new Set(s);return n.has(e)?n.delete(e):n.add(e),n}),Z=q(()=>be(r??[]),[r]),E=S.trim().toLowerCase(),W=e=>!E||e.toLowerCase().includes(E),ee=e=>E?!0:!x.has(e),$=q(()=>new Set((r??[]).map(e=>e.slug)),[r]),B=()=>{if(w.pageCreationInAdminForm){_.send("storefront-editor:new-page");return}I(""),h(null),P(!0)},j=async()=>{const e=g.trim();if(!(!e||!N||u||!p.createPage)){v(!0),h(null);try{const s=await p.createPage({slug:J(e,$),title:e,layout:{}});await A(),P(!1),I(""),i(s.slug)}catch{h(a("Couldn’t add the page — please retry."))}finally{v(!1)}}},te=async e=>{if(!(!N||u||!p.deletePage||(r??[]).length<=1)){v(!0);try{await p.deletePage(e.id);const s=(r??[]).filter(n=>n.id!==e.id);k(s),h(null),e.slug===z&&s[0]&&i(s[0].slug)}catch{h(a("Couldn’t delete the page — please retry."))}finally{v(!1)}}},ae=e=>_.send("storefront-editor:open-page",{slug:e}),ne=e=>{if(!W(e.label))return null;const s=!c&&e.slug===z,n=w.canDeletePagesInline&&(r??[]).length>1;return l("div",{className:`sf-row sf-prow ${s?"is-selected":""}`,onClick:()=>i(e.slug),children:[t("span",{className:"sf-chip",children:t(Pe,{})}),t("span",{className:"sf-row-name",children:e.label}),we(e)&&t("span",{className:"sf-badge-dynamic",children:a("Dynamic")}),e.kind==="lightbox"&&t("span",{className:"sf-badge-lightbox",children:a("Lightbox")}),e.draft&&t("span",{className:"sf-page-draft",children:a("draft")}),w.pageCreationInAdminForm&&t(O,{content:a("Edit “{name}” in {place}",{name:e.label,place:a("the admin")}),children:t("button",{type:"button",className:"sf-page-edit","aria-label":a("Edit {name} in {place}",{name:e.label,place:a("the admin")}),onClick:o=>{o.stopPropagation(),ae(e.slug)},children:t(f,{name:"pencil",size:13,strokeWidth:1.7,rounded:!0})})}),n&&t(O,{content:a("Delete “{name}”",{name:e.label}),children:t("button",{type:"button",className:"sf-page-edit sf-page-edit--danger",disabled:u,"aria-label":a("Delete {name}",{name:e.label}),onClick:o=>{o.stopPropagation(),te(e)},children:t(f,{name:"trash",size:13,strokeWidth:1.7,rounded:!0})})})]},e.id)},D=(e,s,n)=>{const o=n.filter(Boolean);if(o.length===0)return null;const L=ee(e);return l("div",{className:"sf-pgroup",children:[l("button",{type:"button",className:"sf-pgroup-head","aria-expanded":L,onClick:()=>X(e),children:[t(f,{name:"chevron-right",size:10,strokeWidth:2.6,rounded:!0,style:{transform:L?"rotate(90deg)":"none",transition:"transform 0.14s"}}),t("span",{className:"sf-pgroup-label",children:s}),t("span",{className:"sf-pgroup-count",children:o.length})]}),L&&t("div",{className:"sf-pgroup-body",children:o})]},e)},H=(y?.rows??[]).filter(e=>W(e.label)).map(e=>{const s=c===e.key;return l("div",{className:`sf-row sf-prow sf-prow--shop ${s?"is-selected":""}`,onClick:()=>m(e.key),children:[t("span",{className:"sf-chip",children:e.icon}),t("span",{className:"sf-row-name",children:e.label}),t("span",{className:"sf-badge-preview",children:a("Preview")}),t(O,{content:a("Open the {name} in a new tab",{name:e.label}),children:t("a",{className:"sf-page-edit",href:e.href,target:"_blank",rel:"noopener noreferrer","aria-label":a("Open the {name} in a new tab",{name:e.label}),onClick:n=>n.stopPropagation(),children:t(f,{name:"external-link",size:13,strokeWidth:1.7,rounded:!0})})})]},e.key)}),M=w.hasSiteSettings&&!!y,R=(()=>{if(r===null)return null;const e=[];let s=!1;for(const n of Z){M&&!s&&n.key.startsWith("system:")&&(e.push(D("shop",y.title,H)),s=!0);const o=n.key===ye||n.label===Ne?a(n.label):n.label;e.push(D(n.key,o,n.rows.map(ne)))}return M&&!s&&e.push(D("shop",y.title,H)),e})();return l("div",{className:"sf-pages",children:[t(ie,{icon:t(ge,{}),title:a("Pages"),context:Q,actions:t(de,{label:a("New page"),onClick:B,children:t(he,{size:15})}),onHide:b}),l("div",{className:"sf-pages-search",children:[t(f,{name:"search",size:14,rounded:!0}),t("input",{type:"search",className:"sf-pages-search-input",placeholder:a("Search all pages…"),value:S,onChange:e=>T(e.target.value),"aria-label":a("Search all pages")})]}),l("div",{className:"sf-pages-list sf-scroll",children:[C&&!F&&t("div",{className:"sf-note sf-note--error",role:"alert",children:C}),R===null?t("div",{className:"sf-note",children:a("Loading…")}):R.some(Boolean)?R:t("div",{className:"sf-note",children:S.trim()?a("No pages match your search"):a("No pages yet")})]}),l("button",{type:"button",className:"sf-pages-new",onClick:B,children:[t("span",{className:"sf-plus",children:"+"}),a("New page")]}),t(pe,{open:F,onClose:()=>P(!1),size:"sm",title:a("Add a page"),description:a("Give the new template page a name. It starts blank — add sections once it opens."),footer:l(se,{children:[t(K,{variant:"secondary",onClick:()=>P(!1),children:a("Cancel")}),t(K,{onClick:()=>{j()},disabled:u||!g.trim(),loading:u,children:u?a("Adding…"):a("Add page")})]}),children:t(ue,{label:a("Page name"),htmlFor:G,hint:g.trim()?a("URL: /{slug}",{slug:J(g,$)}):void 0,error:C??void 0,children:t(me,{id:G,value:g,invalid:!!C,onChange:e=>I(e.target.value),onKeyDown:e=>{e.key==="Enter"&&j()},placeholder:a("e.g. About")})})})]})}function Pe(){return l("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),t("path",{d:"M14 3v5h5"})]})}export{Ce as default};
1
+ "use client";import{jsx as t,jsxs as r,Fragment as ne}from"react/jsx-runtime";import{useEffect as se,useId as oe,useMemo as j,useState as d}from"react";import{useStorefrontDocument as re}from"./StorefrontDocumentContext.js";import g from"./UiIcon.js";import le from"./SidePanelHead.js";import{useWebsiteName as ie}from"./WebsiteSettingsPanel.js";import{InspectorIconButton as ce}from"efficient-easel/chrome";import{Button as H,Dialog as de,FormField as pe,Input as me,Tooltip as R}from"efficient-shell/ui";import{AddIcon as ue}from"efficient-easel/icons";import{PagesIcon as he}from"efficient-easel/rail";import{useEditorHost as ge}from"../lib/editor-host.js";import{bucketEditorPageRows as fe,DYNAMIC_PAGES_GROUP_KEY as be,isDynamicPageRow as we,MAIN_PAGES_GROUP as ye}from"../lib/editor-page-rows.js";import{useEditorSession as Ne}from"../lib/editor-session-context.js";import{usePageRows as ke}from"../lib/page-rows.js";import{say as a}from"../lib/editor-words.js";const M="sf-editor-pages-collapsed-groups",ve=i=>i.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),U=(i,f)=>{const c=ve(i)||"page";if(!f.has(c))return c;let p=2;for(;f.has(`${c}-${p}`);)p+=1;return`${c}-${p}`};function Pe({onNavigate:i,onClose:f,activeSurface:c,onPreviewSurface:p}){const b=Ne().chrome?.pageRows,D=ge(),{adapter:w,capabilities:y,ready:L,currentSlug:O}=re(),q=ie(),{rows:l,reload:K,setRows:Y}=ke(),[P,J]=d(""),[m,N]=d(!1),[k,u]=d(null),[_,v]=d(!1),[h,C]=d(""),z=oe(),[S,Q]=d(()=>{if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(M);return new Set(e?JSON.parse(e):[])}catch{return new Set}});se(()=>{try{window.localStorage.setItem(M,JSON.stringify([...S]))}catch{}},[S]);const T=e=>Q(s=>{const n=new Set(s);return n.has(e)?n.delete(e):n.add(e),n}),V=j(()=>fe(l??[]),[l]),I=P.trim().toLowerCase(),F=e=>!I||e.toLowerCase().includes(I),X=e=>I?!0:!S.has(e),G=j(()=>new Set((l??[]).map(e=>e.slug)),[l]),Z=()=>{if(y.pageCreationInAdminForm){D.send("storefront-editor:new-page");return}C(""),u(null),v(!0)},W=async()=>{const e=h.trim();if(!(!e||!L||m||!w.createPage)){N(!0),u(null);try{const s=await w.createPage({slug:U(e,G),title:e,layout:{}});await K(),v(!1),C(""),i(s.slug)}catch{u(a("Couldn’t add the page — please retry."))}finally{N(!1)}}},ee=async e=>{if(!(!L||m||!w.deletePage||(l??[]).length<=1)){N(!0);try{await w.deletePage(e.id);const s=(l??[]).filter(n=>n.id!==e.id);Y(s),u(null),e.slug===O&&s[0]&&i(s[0].slug)}catch{u(a("Couldn’t delete the page — please retry."))}finally{N(!1)}}},te=e=>D.send("storefront-editor:open-page",{slug:e}),ae=e=>{if(!F(e.label))return null;const s=!c&&e.slug===O,n=y.canDeletePagesInline&&(l??[]).length>1;return r("div",{className:`sf-row sf-prow ${s?"is-selected":""}`,onClick:()=>i(e.slug),children:[t("span",{className:"sf-chip",children:t(Ce,{})}),t("span",{className:"sf-row-name",children:e.label}),we(e)&&t("span",{className:"sf-badge-dynamic",children:a("Dynamic")}),e.kind==="lightbox"&&t("span",{className:"sf-badge-lightbox",children:a("Lightbox")}),e.draft&&t("span",{className:"sf-page-draft",children:a("draft")}),y.pageCreationInAdminForm&&t(R,{content:a("Edit “{name}” in {place}",{name:e.label,place:a("the admin")}),children:t("button",{type:"button",className:"sf-page-edit","aria-label":a("Edit {name} in {place}",{name:e.label,place:a("the admin")}),onClick:o=>{o.stopPropagation(),te(e.slug)},children:t(g,{name:"pencil",size:13,strokeWidth:1.7,rounded:!0})})}),n&&t(R,{content:a("Delete “{name}”",{name:e.label}),children:t("button",{type:"button",className:"sf-page-edit sf-page-edit--danger",disabled:m,"aria-label":a("Delete {name}",{name:e.label}),onClick:o=>{o.stopPropagation(),ee(e)},children:t(g,{name:"trash",size:13,strokeWidth:1.7,rounded:!0})})})]},e.id)},A=(e,s,n)=>{const o=n.filter(Boolean);if(o.length===0)return null;const E=X(e);return r("div",{className:"sf-pgroup",children:[r("button",{type:"button",className:"sf-pgroup-head","aria-expanded":E,onClick:()=>T(e),children:[t(g,{name:"chevron-right",size:10,strokeWidth:2.6,rounded:!0,style:{transform:E?"rotate(90deg)":"none",transition:"transform 0.14s"}}),t("span",{className:"sf-pgroup-label",children:s}),t("span",{className:"sf-pgroup-count",children:o.length})]}),E&&t("div",{className:"sf-pgroup-body",children:o})]},e)},$=(b?.rows??[]).filter(e=>F(e.label)).map(e=>{const s=c===e.key;return r("div",{className:`sf-row sf-prow sf-prow--shop ${s?"is-selected":""}`,onClick:()=>p(e.key),children:[t("span",{className:"sf-chip",children:e.icon}),t("span",{className:"sf-row-name",children:e.label}),t("span",{className:"sf-badge-preview",children:a("Preview")}),t(R,{content:a("Open the {name} in a new tab",{name:e.label}),children:t("a",{className:"sf-page-edit",href:e.href,target:"_blank",rel:"noopener noreferrer","aria-label":a("Open the {name} in a new tab",{name:e.label}),onClick:n=>n.stopPropagation(),children:t(g,{name:"external-link",size:13,strokeWidth:1.7,rounded:!0})})})]},e.key)}),B=y.hasSiteSettings&&!!b,x=(()=>{if(l===null)return null;const e=[];let s=!1;for(const n of V){B&&!s&&n.key.startsWith("system:")&&(e.push(A("shop",b.title,$)),s=!0);const o=n.key===be||n.label===ye?a(n.label):n.label;e.push(A(n.key,o,n.rows.map(ae)))}return B&&!s&&e.push(A("shop",b.title,$)),e})();return r("div",{className:"sf-pages",children:[t(le,{icon:t(he,{}),title:a("Pages"),context:q,actions:t(ce,{label:a("New page"),onClick:Z,children:t(ue,{size:15})}),onHide:f}),r("div",{className:"sf-pages-search",children:[t(g,{name:"search",size:14,rounded:!0}),t("input",{type:"search",className:"sf-pages-search-input",placeholder:a("Search all pages…"),value:P,onChange:e=>J(e.target.value),"aria-label":a("Search all pages")})]}),r("div",{className:"sf-pages-list sf-scroll",children:[k&&!_&&t("div",{className:"sf-note sf-note--error",role:"alert",children:k}),x===null?t("div",{className:"sf-note",children:a("Loading…")}):x.some(Boolean)?x:t("div",{className:"sf-note",children:P.trim()?a("No pages match your search"):a("No pages yet. Add one with + above.")})]}),t(de,{open:_,onClose:()=>v(!1),size:"sm",title:a("Add a page"),description:a("Give the new template page a name. It starts blank — add sections once it opens."),footer:r(ne,{children:[t(H,{variant:"secondary",onClick:()=>v(!1),children:a("Cancel")}),t(H,{onClick:()=>{W()},disabled:m||!h.trim(),loading:m,children:a("Add page")})]}),children:t(pe,{label:a("Page name"),htmlFor:z,hint:h.trim()?a("URL: /{slug}",{slug:U(h,G)}):void 0,error:k??void 0,children:t(me,{id:z,value:h,invalid:!!k,onChange:e=>C(e.target.value),onKeyDown:e=>{e.key==="Enter"&&W()},placeholder:a("e.g. About")})})})]})}function Ce(){return r("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),t("path",{d:"M14 3v5h5"})]})}export{Pe as default};
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as k}from"react/jsx-runtime";import{useCallback as I,useEffect as S,useState as j}from"react";import{ExternalIcon as z}from"efficient-easel/icons";import{Button as K,Tooltip as A,buttonClasses as U}from"efficient-shell/ui";import{SettingsSwitch as Z}from"efficient-easel/panel";import{PagesIcon as q,StylesIcon as X}from"efficient-easel/rail";import{TreeRow as J}from"efficient-easel/tree";import{useEaselStrings as Q}from"efficient-easel/strings";import $ from"./HeadingAudit.js";import{LocationsTreeContext as ee}from"./LocationsTreeContext.js";import te from"./PagesPanel.js";import{usePreviewChat as oe}from"./PreviewChatContext.js";import{PREVIEW_DEVICES as re}from"./preview-devices.js";import{PreviewDeviceContext as ie}from"./PreviewDeviceContext.js";import{usePreviewHeader as se}from"./PreviewHeaderContext.js";import{usePreviewSocial as ne}from"./PreviewSocialContext.js";import{usePreviewSurface as ae}from"./PreviewSurfaceContext.js";import{TICKER_PART_LABEL as ce,usePreviewTicker as le}from"./PreviewTickerContext.js";import de,{CHAT_MODE as pe,HEADER_MODE as B,SOCIAL_MODE as me,WEBSITE_MODE as N}from"./SectionEditor.js";import C from"./SectionIcon.js";import fe from"./SectionThumbnail.js";import{useStorefrontDocument as g}from"./StorefrontDocumentContext.js";import ue from"./StylesPanel.js";import Se from"./TemplateGlyph.js";import{useFooterFocus as Te}from"./useFooterFocus.js";import{LOCATIONS_TYPE as Ee,useLocationsTree as he}from"./useLocationsTree.js";import{usePinnedChromeSeed as we}from"./usePinnedChromeSeed.js";import{usePreviewHref as be}from"./usePreviewHref.js";import{SITE_STYLES_TABS as Pe,SITE_STYLES_TEXT_TAB as ve,useWebsiteName as ke}from"./WebsiteSettingsPanel.js";import{HERO_GROUP_TYPE as Ie,duplicateBlocked as Ce,heroGroupNestDepth as ge}from"../lib/hero-group-placement.js";import{stripMarkup as _e}from"../lib/markup.js";import{categoryShortLabel as Le,PINNED_SECTION_TYPE as ye}from"../lib/puck/add-palette.js";import{canAddTo as Oe}from"../lib/puck/add-target.js";import{blockIsOffered as Ae}from"../lib/puck/block-offer.js";import{sectionIdOfBoxZone as Be,setBookingPreview as Ne}from"../lib/puck/booking-preview.js";import{footerBlockRowName as Re}from"../lib/puck/footer-block-row-name.js";import{FOOTER_TYPE as He,HEADER_TYPE as R}from"../lib/puck/footer-blocks.js";import{leftViewForSelection as De,readLeftView as We,resolveLeftView as xe,writeLeftView as Ve}from"../lib/puck/left-view.js";import{isLockedBlock as Me}from"../lib/puck/locked-blocks.js";import{scrollPreviewToSection as Fe,scrollPreviewToTop as H}from"../lib/puck/preview-dom.js";import{SiteCanvas as Ye}from"../lib/puck/overrides.js";import{labelAtLevel as Ge}from"../lib/puck/section-catalog.js";import{editorWords as je,say as i}from"../lib/editor-words.js";import{SECTION_DESCRIPTIONS as ze}from"../lib/puck/section-descriptions.js";import{isSectionGroupType as Ke,sectionGroupZone as Ue,SITE_FOOTER_TYPE as Ze,SITE_HEADER_TYPE as qe}from"../lib/puck/section-groups.js";import{resolveSaveAsTemplateAction as Xe,SAVE_AS_TEMPLATE_EVENT as Je}from"../lib/save-as-template-action.js";import{newSectionNode as Qe}from"../lib/sections/new-section-node.js";import{useHostProducts as $e}from"../lib/use-host-products.js";function D({mode:e,open:t}){const{setSelectedHeroId:o,setSelectHandler:s}=le(),f=Q().tree,c=e,l=c.kind==="ticker"?c.heroId:null,n=I(d=>{if(!d)return;t({kind:"ticker",heroId:d}),Fe(d)},[t]);return S(()=>{o(l)},[l,o]),S(()=>{s(n)},[s,n]),{partRows:(d,{rowClick:a})=>{const u=String(d.props.id);return d.type==="Hero"&&r(J,{icon:r(C,{type:"ticker",size:13}),name:i(ce),onSelect:()=>n(u),selected:l===u,rowProps:{onClick:a(()=>n(u))},words:f})}}}function et(){const{adapter:e,capabilities:t,currentSlug:o,siteId:s,hasUnsavedEdits:f,bridgeCapabilities:c,notifyParent:l,token:n}=g(),{hasPreviewLink:d}=t,a=Xe({hasTrustedConsole:!!n,canCreatePlatformTemplate:c.canCreatePlatformTemplate,capabilities:t,siteId:s,hasUnsavedEdits:f}),u=I(()=>{!s||!o||l(Je,{siteId:s,slug:o})},[l,s,o]),T=be({pageSlug:o,siteId:s,token:n}),E=e.previewHref?.(o)??T;return{barLead:()=>a.visible&&r(A,{side:"bottom",content:a.enabled?i("Save this website as a platform template"):i(a.disabledReason),children:r("span",{className:"sf-tip-disabled",tabIndex:a.enabled?void 0:0,children:r(K,{variant:"secondary",disabled:!a.enabled,onClick:u,rightIcon:r(Se,{}),children:i("Save as Template")})})}),barTrail:()=>d&&o&&r(A,{content:i("Preview the live site (opens in a new tab)"),children:k("a",{className:U({variant:"secondary"}),href:E,target:"_blank",rel:"noopener noreferrer","aria-label":i("Preview the live site in a new tab"),children:[i("Preview"),r(z,{size:15})]})})}}function tt(){return k("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round",children:[r("path",{d:"M12 3a9 9 0 0 0 0 18 2.3 2.3 0 0 0 2.3-2.3c0-.55-.22-1.05-.57-1.42-.34-.37-.56-.87-.56-1.43A2.35 2.35 0 0 1 15.6 13.5H18a3 3 0 0 0 3-3c0-4.14-4-7.5-9-7.5z"}),r("circle",{cx:"7.7",cy:"11.3",r:"1.05",fill:"currentColor",stroke:"none"}),r("circle",{cx:"12",cy:"8",r:"1.05",fill:"currentColor",stroke:"none"}),r("circle",{cx:"16",cy:"11",r:"1.05",fill:"currentColor",stroke:"none"})]})}function ot(e,t){const{capabilities:o,templateId:s,siteId:f,tokenRef:c,navigate:l}=g(),{hasSiteTheme:n,explainsSiteSettings:d}=o,a=p=>t.setView(p),[u,T]=j(Pe[0].id),{surface:E,setSurface:b}=ae(),P=()=>{if(n){a("styles"),t.reveal(),H();return}e.show(N),e.reveal(),H()},v={id:"pages",label:i("Pages"),icon:r(q,{}),panel:({onHide:p})=>r(te,{activeSurface:E,onPreviewSurface:b,onNavigate:m=>{b(null),l(s?{kind:"template",id:s,pageSlug:m}:{kind:"page",slug:m,siteId:f??void 0})},onClose:p})},h=[];return!n&&d&&h.push({id:"appearance",label:i("Appearance"),icon:r(tt,{}),active:e.kind==="website",onSelect:P}),n&&h.push({id:"styles",label:i("Site styles"),icon:r(X,{}),panel:({onHide:p,notify:m})=>r(ue,{tokenRef:c,siteId:f??void 0,onClose:p,onNotify:m,tab:u,onTabChange:T})}),{railLead:[v],railTrail:h,resolveLeftView:(p,m)=>xe(p,n,m),openSettings:P,openStyles:()=>{T(ve),a("styles")}}}function rt(e,t,o,s){const{kind:f,open:c}=e,{selected:l,zoneOf:n}=t,d=Te(t,o);S(()=>{Ne(l?.type==="BookingBox"&&l.props.region==="confirm"?Be(n(String(l.props.id))):null)},[l?.props.id]);const a=he(e,t),{capabilities:{hasSiteSettings:u}}=g(),{setSelected:T,setSelectHandler:E}=se(),{chat:b,setChat:P,setSelected:v,setSelectHandler:h}=oe(),p=f==="header";S(()=>{T(p)},[p,T]),S(()=>{E(()=>c(B))},[E,c]);const m=I(()=>c(pe),[c]),L=f==="chat";S(()=>{v(L)},[L,v]),S(()=>{h(m)},[h,m]);const{setOpenHandler:y}=ne(),O=I(()=>c(me),[c]);S(()=>{y(O)},[y,O]);const V=D(e),M=et(),F=ot(e,s),Y=o.device;return{...d,...V,...M,...F,treeFoot:()=>r("div",{className:"sf-tree-tool",children:r($,{})}),hasOwnRows:w=>w.type===Ee,ownRows:a.renderLocationTree,sectionPressed:a.sectionPressed,wrap:w=>r(ee.Provider,{value:!0,children:r(ie.Provider,{value:Y,children:w})}),addPanelRow:w=>u?k("div",{className:"sf-addside-sitewide",children:[r("span",{className:"sf-addside-sitewide-glyph","aria-hidden":"true",children:r(C,{type:"chat",size:16})}),k("button",{type:"button",className:"sf-addside-sitewide-name",onClick:()=>{w(),m()},children:[i("Live chat"),r("span",{className:"sf-addside-sitewide-desc",children:i("A chat bubble on every page")})]}),r(Z,{checked:b.enabled,onChange:G=>P({enabled:G}),ariaLabel:i("Show the chat bubble on the whole site")})]}):void 0}}let W=null,_=new WeakMap;function it(e){const t=je();if(!e||!t)return e;W!==t&&(W=t,_=new WeakMap);let o=_.get(e);return o||(o={...e,choices:e.choices?e.choices.map(s=>({...s,label:i(s.label)})):null,spec:e.spec?{...e.spec,addLabel:i(e.spec.addLabel)}:null},_.set(e,o)),o}const st={isLockedBlock:Me,duplicateBlocked:Ce,nestDepth:(e,t,o)=>t===Ie?ge(e,o):0,newSectionNode:Qe,canAddTo:(e,t)=>it(Oe(e,t)),blockIsOffered:Ae},nt=new Proxy(ze,{get:(e,t)=>{const o=Reflect.get(e,t);return typeof o=="string"?i(o):o}}),at={labelAtLevel:(e,t,o)=>i(Ge(e,t,o)),descriptions:nt,categoryLabel:e=>{const t=Le(e);return t===void 0?void 0:i(t)},firstSection:ye,blockRowName:Re,plainText:_e,Icon:C,Thumbnail:fe,useProducts:$e},ct={desktop:2e3,tablet:800,mobile:390},x="desktop",lt={options:re,initial:x,fluid:x,widths:ct},dt={read:We,write:e=>Ve(e),forSelection:(e,t)=>De(e,t)},pt={first:R,last:He,firstGroup:qe,lastGroup:Ze,isSectionGroup:Ke,sectionGroupZone:Ue,panelOf:e=>e===R?B:null};function mt(e){return{...D(e),openSettings:()=>e.show(N)}}const ao={useOwnerName:ke,useBridges:rt,useStandaloneBridges:mt,useDocumentPass:we,blockRules:st,blockLook:at,devices:lt,leftView:dt,pinned:pt,Canvas:Ye,Inspector:de};export{ao as WEBSITE_SCREEN};
1
+ "use client";import{jsx as r,jsxs as k}from"react/jsx-runtime";import{useCallback as I,useEffect as S,useState as j}from"react";import{ExternalIcon as z}from"efficient-easel/icons";import{Button as K,Tooltip as A,buttonClasses as U}from"efficient-shell/ui";import{SettingsSwitch as Z}from"efficient-easel/panel";import{PagesIcon as q,StylesIcon as X}from"efficient-easel/rail";import{TreeRow as J}from"efficient-easel/tree";import{useEaselStrings as Q}from"efficient-easel/strings";import{LocationsTreeContext as $}from"./LocationsTreeContext.js";import ee from"./PagesPanel.js";import{usePreviewChat as te}from"./PreviewChatContext.js";import{PREVIEW_DEVICES as oe}from"./preview-devices.js";import{PreviewDeviceContext as re}from"./PreviewDeviceContext.js";import{usePreviewHeader as ie}from"./PreviewHeaderContext.js";import{usePreviewSocial as se}from"./PreviewSocialContext.js";import{usePreviewSurface as ne}from"./PreviewSurfaceContext.js";import{TICKER_PART_LABEL as ae,usePreviewTicker as ce}from"./PreviewTickerContext.js";import le,{CHAT_MODE as de,HEADER_MODE as B,SOCIAL_MODE as pe,WEBSITE_MODE as N}from"./SectionEditor.js";import C from"./SectionIcon.js";import me from"./SectionThumbnail.js";import{useStorefrontDocument as g}from"./StorefrontDocumentContext.js";import fe from"./StylesPanel.js";import ue from"./TemplateGlyph.js";import{useFooterFocus as Se}from"./useFooterFocus.js";import{LOCATIONS_TYPE as Te,useLocationsTree as Ee}from"./useLocationsTree.js";import{usePinnedChromeSeed as he}from"./usePinnedChromeSeed.js";import{usePreviewHref as we}from"./usePreviewHref.js";import{SITE_STYLES_TABS as be,SITE_STYLES_TEXT_TAB as Pe,useWebsiteName as ve}from"./WebsiteSettingsPanel.js";import{useOpenPageName as ke}from"../lib/page-rows.js";import{HERO_GROUP_TYPE as Ie,duplicateBlocked as Ce,heroGroupNestDepth as ge}from"../lib/hero-group-placement.js";import{stripMarkup as _e}from"../lib/markup.js";import{categoryShortLabel as Le,PINNED_SECTION_TYPE as Oe}from"../lib/puck/add-palette.js";import{canAddTo as ye}from"../lib/puck/add-target.js";import{blockIsOffered as Ae}from"../lib/puck/block-offer.js";import{sectionIdOfBoxZone as Be,setBookingPreview as Ne}from"../lib/puck/booking-preview.js";import{footerBlockRowName as Re}from"../lib/puck/footer-block-row-name.js";import{FOOTER_TYPE as De,HEADER_TYPE as R}from"../lib/puck/footer-blocks.js";import{leftViewForSelection as He,readLeftView as We,resolveLeftView as xe,writeLeftView as Ve}from"../lib/puck/left-view.js";import{isLockedBlock as Me}from"../lib/puck/locked-blocks.js";import{scrollPreviewToSection as Ye,scrollPreviewToTop as D}from"../lib/puck/preview-dom.js";import{SiteCanvas as Fe}from"../lib/puck/overrides.js";import{labelAtLevel as Ge}from"../lib/puck/section-catalog.js";import{editorWords as je,say as i}from"../lib/editor-words.js";import{SECTION_DESCRIPTIONS as ze}from"../lib/puck/section-descriptions.js";import{isSectionGroupType as Ke,sectionGroupZone as Ue,SITE_FOOTER_TYPE as Ze,SITE_HEADER_TYPE as qe}from"../lib/puck/section-groups.js";import{resolveSaveAsTemplateAction as Xe,SAVE_AS_TEMPLATE_EVENT as Je}from"../lib/save-as-template-action.js";import{newSectionNode as Qe}from"../lib/sections/new-section-node.js";import{useHostProducts as $e}from"../lib/use-host-products.js";function H({mode:e,open:t}){const{setSelectedHeroId:o,setSelectHandler:s}=ce(),f=Q().tree,c=e,l=c.kind==="ticker"?c.heroId:null,n=I(d=>{if(!d)return;t({kind:"ticker",heroId:d}),Ye(d)},[t]);return S(()=>{o(l)},[l,o]),S(()=>{s(n)},[s,n]),{partRows:(d,{rowClick:a})=>{const u=String(d.props.id);return d.type==="Hero"&&r(J,{icon:r(C,{type:"ticker",size:13}),name:i(ae),onSelect:()=>n(u),selected:l===u,rowProps:{onClick:a(()=>n(u))},words:f})}}}function et(){const{adapter:e,capabilities:t,currentSlug:o,siteId:s,hasUnsavedEdits:f,bridgeCapabilities:c,notifyParent:l,token:n}=g(),{hasPreviewLink:d}=t,a=Xe({hasTrustedConsole:!!n,canCreatePlatformTemplate:c.canCreatePlatformTemplate,capabilities:t,siteId:s,hasUnsavedEdits:f}),u=I(()=>{!s||!o||l(Je,{siteId:s,slug:o})},[l,s,o]),T=we({pageSlug:o,siteId:s,token:n}),E=e.previewHref?.(o)??T;return{barLead:()=>a.visible&&r(A,{side:"bottom",content:a.enabled?i("Save this website as a platform template"):i(a.disabledReason),children:r("span",{className:"sf-tip-disabled",tabIndex:a.enabled?void 0:0,children:r(K,{variant:"secondary",disabled:!a.enabled,onClick:u,rightIcon:r(ue,{}),children:i("Save as Template")})})}),barTrail:()=>d&&o&&r(A,{content:i("Preview the live site (opens in a new tab)"),children:k("a",{className:U({variant:"secondary"}),href:E,target:"_blank",rel:"noopener noreferrer","aria-label":i("Preview the live site in a new tab"),children:[i("Preview"),r(z,{size:15})]})})}}function tt(){return k("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round",children:[r("path",{d:"M12 3a9 9 0 0 0 0 18 2.3 2.3 0 0 0 2.3-2.3c0-.55-.22-1.05-.57-1.42-.34-.37-.56-.87-.56-1.43A2.35 2.35 0 0 1 15.6 13.5H18a3 3 0 0 0 3-3c0-4.14-4-7.5-9-7.5z"}),r("circle",{cx:"7.7",cy:"11.3",r:"1.05",fill:"currentColor",stroke:"none"}),r("circle",{cx:"12",cy:"8",r:"1.05",fill:"currentColor",stroke:"none"}),r("circle",{cx:"16",cy:"11",r:"1.05",fill:"currentColor",stroke:"none"})]})}function ot(e,t){const{capabilities:o,templateId:s,siteId:f,tokenRef:c,navigate:l}=g(),{hasSiteTheme:n,explainsSiteSettings:d}=o,a=p=>t.setView(p),[u,T]=j(be[0].id),{surface:E,setSurface:b}=ne(),P=()=>{if(n){a("styles"),t.reveal(),D();return}e.show(N),e.reveal(),D()},v={id:"pages",label:i("Pages"),icon:r(q,{}),panel:({onHide:p})=>r(ee,{activeSurface:E,onPreviewSurface:b,onNavigate:m=>{b(null),l(s?{kind:"template",id:s,pageSlug:m}:{kind:"page",slug:m,siteId:f??void 0})},onClose:p})},h=[];return!n&&d&&h.push({id:"appearance",label:i("Appearance"),icon:r(tt,{}),active:e.kind==="website",onSelect:P}),n&&h.push({id:"styles",label:i("Site styles"),icon:r(X,{}),panel:({onHide:p,notify:m})=>r(fe,{tokenRef:c,siteId:f??void 0,onClose:p,onNotify:m,tab:u,onTabChange:T})}),{railLead:[v],railTrail:h,resolveLeftView:(p,m)=>xe(p,n,m),openSettings:P,openStyles:()=>{T(Pe),a("styles")}}}function rt(e,t,o,s){const{kind:f,open:c}=e,{selected:l,zoneOf:n}=t,d=Se(t,o);S(()=>{Ne(l?.type==="BookingBox"&&l.props.region==="confirm"?Be(n(String(l.props.id))):null)},[l?.props.id]);const a=Ee(e,t),{capabilities:{hasSiteSettings:u}}=g(),{setSelected:T,setSelectHandler:E}=ie(),{chat:b,setChat:P,setSelected:v,setSelectHandler:h}=te(),p=f==="header";S(()=>{T(p)},[p,T]),S(()=>{E(()=>c(B))},[E,c]);const m=I(()=>c(de),[c]),L=f==="chat";S(()=>{v(L)},[L,v]),S(()=>{h(m)},[h,m]);const{setOpenHandler:O}=se(),y=I(()=>c(pe),[c]);S(()=>{O(y)},[O,y]);const V=H(e),M=et(),Y=ot(e,s),F=o.device;return{...d,...V,...M,...Y,hasOwnRows:w=>w.type===Te,ownRows:a.renderLocationTree,sectionPressed:a.sectionPressed,wrap:w=>r($.Provider,{value:!0,children:r(re.Provider,{value:F,children:w})}),addPanelRow:w=>u?k("div",{className:"sf-addside-sitewide",children:[r("span",{className:"sf-addside-sitewide-glyph","aria-hidden":"true",children:r(C,{type:"chat",size:16})}),k("button",{type:"button",className:"sf-addside-sitewide-name",onClick:()=>{w(),m()},children:[i("Live chat"),r("span",{className:"sf-addside-sitewide-desc",children:i("A chat bubble on every page")})]}),r(Z,{checked:b.enabled,onChange:G=>P({enabled:G}),ariaLabel:i("Show the chat bubble on the whole site")})]}):void 0}}let W=null,_=new WeakMap;function it(e){const t=je();if(!e||!t)return e;W!==t&&(W=t,_=new WeakMap);let o=_.get(e);return o||(o={...e,choices:e.choices?e.choices.map(s=>({...s,label:i(s.label)})):null,spec:e.spec?{...e.spec,addLabel:i(e.spec.addLabel)}:null},_.set(e,o)),o}const st={isLockedBlock:Me,duplicateBlocked:Ce,nestDepth:(e,t,o)=>t===Ie?ge(e,o):0,newSectionNode:Qe,canAddTo:(e,t)=>it(ye(e,t)),blockIsOffered:Ae},nt=new Proxy(ze,{get:(e,t)=>{const o=Reflect.get(e,t);return typeof o=="string"?i(o):o}}),at={labelAtLevel:(e,t,o)=>i(Ge(e,t,o)),descriptions:nt,categoryLabel:e=>{const t=Le(e);return t===void 0?void 0:i(t)},firstSection:Oe,blockRowName:Re,plainText:_e,Icon:C,Thumbnail:me,useProducts:$e},ct={desktop:2e3,tablet:800,mobile:390},x="desktop",lt={options:oe,initial:x,fluid:x,widths:ct},dt={read:We,write:e=>Ve(e),forSelection:(e,t)=>He(e,t)},pt={first:R,last:De,firstGroup:qe,lastGroup:Ze,isSectionGroup:Ke,sectionGroupZone:Ue,panelOf:e=>e===R?B:null};function mt(e){return{...H(e),openSettings:()=>e.show(N)}}const ao={useOwnerName:ve,useDocumentLabel:ke,useBridges:rt,useStandaloneBridges:mt,useDocumentPass:he,blockRules:st,blockLook:at,devices:lt,leftView:dt,pinned:pt,Canvas:Fe,Inspector:le};export{ao as WEBSITE_SCREEN};