efficient-web-builder 33.0.0 → 35.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 +71 -0
- package/dist/editor/components/CanvasPartsBridge.d.ts +4 -0
- package/dist/editor/components/CanvasPartsBridge.js +1 -0
- package/dist/editor/components/MediaUploadField.d.ts +2 -1
- package/dist/editor/components/MediaUploadField.js +1 -1
- package/dist/editor/components/PartSettingsPanel.js +1 -1
- package/dist/editor/components/PreviewPartAnchors.js +1 -1
- package/dist/editor/components/SectionTextPartBridge.js +1 -1
- package/dist/editor/components/StandaloneSectionEditor.js +1 -1
- package/dist/editor/components/StorefrontEditor.js +1 -1
- package/dist/editor/lib/puck/blocks/general/Cards/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/general/Timeline/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/general/index.d.ts +2 -2
- package/dist/editor/lib/puck/controls.d.ts +2 -1
- package/dist/editor/lib/puck/part-anchors.d.ts +4 -2
- package/dist/editor/lib/puck/part-anchors.js +1 -1
- package/dist/editor/lib/site-text-styles.d.ts +3 -2
- package/dist/editor/lib/site-text-styles.js +2 -2
- package/dist/format/lib/content/contact.d.ts +0 -2
- package/dist/format/lib/content/contact.js +2 -2
- package/dist/format/lib/content/footprint.d.ts +3 -3
- package/dist/format/lib/content/footprint.js +1 -1
- package/dist/format/lib/editor-words-catalogue.d.ts +4 -0
- package/dist/format/lib/editor-words-catalogue.js +2 -2
- package/dist/format/lib/map-styles.d.ts +1 -27
- package/dist/format/lib/map-styles.js +1 -1
- package/dist/format/lib/media-value.d.ts +9 -0
- package/dist/format/lib/media-value.js +1 -0
- package/dist/format/lib/puck/passes/media-values.d.ts +3 -0
- package/dist/format/lib/puck/passes/media-values.js +1 -0
- package/dist/format/lib/puck/section-catalog.js +7 -1
- package/dist/format/lib/puck/templateFields.js +1 -1
- package/dist/format/lib/text-style-face.d.ts +3 -0
- package/dist/format/lib/text-style-face.js +1 -0
- package/dist/render/components/ContactLocations.d.ts +1 -3
- package/dist/render/components/ContactLocations.js +6 -26
- package/dist/render/components/DealerFinder.d.ts +1 -1
- package/dist/render/components/DealerFinder.js +1 -1
- package/dist/render/components/Footprint.d.ts +2 -4
- package/dist/render/components/Footprint.js +1 -27
- package/dist/render/components/Heading.d.ts +7 -1
- package/dist/render/components/Heading.js +1 -1
- package/dist/render/components/PartStyledKind.js +1 -1
- package/dist/render/components/PartStyledText.js +1 -1
- package/dist/render/components/PublishedPartStylesContext.js +1 -1
- package/dist/render/components/SiteMap.d.ts +19 -0
- package/dist/render/components/SiteMap.js +1 -0
- package/dist/render/components/Text.d.ts +2 -1
- package/dist/render/components/Text.js +1 -1
- package/dist/render/components/useCountUp.js +1 -1
- package/dist/render/lib/puck/blocks/general/Cards/render.d.ts +1 -0
- package/dist/render/lib/puck/blocks/general/Cards/render.js +1 -1
- package/dist/render/lib/puck/blocks/general/ContactLocations/render.js +1 -1
- package/dist/render/lib/puck/blocks/general/Footprint/render.js +2 -2
- package/dist/render/lib/puck/blocks/general/KeyFeatures/render.d.ts +2 -0
- package/dist/render/lib/puck/blocks/general/KeyFeatures/render.js +1 -1
- package/dist/render/lib/puck/blocks/general/Text/render.js +1 -1
- package/dist/render/lib/puck/blocks/general/Timeline/render.d.ts +2 -0
- package/dist/render/lib/puck/blocks/general/Timeline/render.js +2 -2
- package/dist/render/lib/puck/blocks/general/TimelineTrack/render.d.ts +2 -0
- package/dist/render/lib/puck/blocks/general/TimelineTrack/render.js +1 -1
- package/dist/render/lib/puck/part-styles.d.ts +13 -3
- package/dist/render/lib/puck/part-styles.js +2 -2
- package/dist/render/lib/puck/passes/index.js +1 -1
- package/dist/render/lib/puck/text-parts.d.ts +1 -0
- package/dist/render/lib/puck/text-parts.js +1 -1
- package/package.json +3 -4
- package/dist/format/lib/maps-loader.d.ts +0 -8
- package/dist/format/lib/maps-loader.js +0 -1
- package/dist/render/lib/maps-config.d.ts +0 -16
- package/dist/render/lib/maps-config.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{textStyleCaseCss as
|
|
2
|
-
`)}function
|
|
1
|
+
import{textStyleCaseCss as q,textStyleCaseOfCss as J}from"efficient-easel/draw";import{FONT_OPTIONS as Q,FONT_ROLES as O,fontOption as v,SIZE_STEP_OF_ROLE as tt}from"../../../format/lib/fonts.js";import{encodePartKey as et}from"../../../format/lib/puck/part-key.js";import{decodePartId as H,normalizePartText as N}from"./text-parts.js";import{COLOUR_TOKEN as F}from"../../../format/lib/word-styles.js";const w="_partStyles",nt="data-sf-part-styled",L="data-sf-text-style",rt=/^(heading|body)-[1-7]$/;function g(t){return typeof t=="string"&&rt.test(t)}const z={heading:"heading-1",heading2:"heading-2",heading3:"heading-3",body:"body-1",label:"body-5"};function ot(t){if(!t)return null;for(const[e,n]of Object.entries(z))if(n===t)return e;return null}function ne(t){if(g(t.textStyle))return t.textStyle;const e=t.role&&O.includes(t.role)?t.role:null;return e?z[e]:void 0}const it=[400,500,600,700],k=["left","center","right","justify"],j=5,D=1e3,st=-5,at=10,ct=0,lt=64,ft=2,ut=120,E=1280,pt=10,C={size:{min:j,max:D,step:1},sizePhone:{min:j,max:D,step:1},padding:{min:ct,max:lt,step:ft},width:{min:ut,max:E,step:pt}},dt=.05,xt=.01,ht=["line","letter"],St=.5,gt=2.5,mt=-1,Pt=1,Tt=0,_t=400;function T(t){return!t||typeof t!="object"||Array.isArray(t)?null:t}function W(t){return T(t?.[w])??{}}function K(t,e){const n=W(t);return Object.hasOwn(n,e)?T(n[e])??{}:{}}function re(t,e){return Object.values(K(t,e)).filter(n=>n!==void 0).length}function G(t,e,n){const r={...W(t)};if(At(n).length?r[e]=n:delete r[e],!Object.keys(r).length){const{[w]:o,...i}=t;return i}return{...t,[w]:r}}function At(t){return Object.entries(t).filter(([,e])=>e!==void 0)}function bt(t){return ht.includes(t)}const _=(t,e,n)=>Math.min(n,Math.max(e,t));function Rt(t,e){if(bt(t)){const n=Math.round(Number(e));return!Number.isFinite(n)||n===0?null:_(n,st,at)}if(t==="lineHeight"){const n=Number(e);return Number.isFinite(n)?m(_(n,St,gt),3):null}if(t==="letterSpacing"){const n=Number(e);return Number.isFinite(n)?m(_(n,mt,Pt),4):null}if(t==="paragraphSpacing"){const n=Math.round(Number(e));return!Number.isFinite(n)||n<=0?null:_(n,Tt,_t)}if(Object.hasOwn(C,t)){const{min:n,max:r}=C[t],o=Math.round(Number(e));return Number.isFinite(o)?_(o,n,r):null}return t==="italic"?typeof e=="boolean"?e:null:t==="role"?O.includes(String(e))?e:null:t==="textStyle"?g(e)?e:null:e}const Et=["weight","size","sizePhone","line","letter","lineHeight","letterSpacing","paragraphSpacing","padding","width"];function X(t){let e=null;const n=r=>{e??={...t},delete e[r]};for(const r of Et){const o=t[r];o!==void 0&&!(typeof o=="number"&&Number.isFinite(o))&&n(r)}return t.align!==void 0&&!k.includes(t.align)&&n("align"),t.textStyle!==void 0&&!g(t.textStyle)&&n("textStyle"),e??t}const yt=[["font","role"],["role","textStyle"],["line","lineHeight"],["letter","letterSpacing"]];function Ot(t){const e=[];for(const[n,r]of yt)n===t?e.push(r):r===t&&e.push(n);return e}function oe(t,e,n,r){const o={...K(t,e)},i=r==null?null:Rt(n,r);if(i===null)delete o[n];else{o[n]=i;for(const s of Ot(n))delete o[s]}return G(t,e,o)}function ie(t,e){return G(t,e,{})}function Nt(t){return J(t)??"none"}function wt(t){return q(t)??""}const It={heading:"--font-role-heading",heading2:"--font-role-heading2",heading3:"--font-role-heading3",body:"--font-role-body",accent:"--font-role-accent",label:"--font-role-label"};function $t(t,e){const n=t.role;return n&&O.includes(n)?n:e?.blockDrawsStyle?null:ot(t.textStyle)}function se(t,e){return t==="Text"&&e==="text"}const Mt={headingLarge:"min(clamp(64px,9vw,144px), var(--sf-heading-max,9999px))",headingMedium:"min(32px, var(--sf-heading-max,9999px))",headingSmall:"min(24px, var(--sf-heading-max,9999px))",accent:"32px",body:"14px",label:"12px"};function Ht(t){const e=tt[t],n=Mt[e];return n?`var(--size-${e}, ${n})`:`var(--size-${e})`}function Ft(t){const e={};return typeof t.lineHeight=="number"?e.lineHeight=t.lineHeight:t.line&&(e.lineHeight=m(Lt+t.line*dt,3)),typeof t.letterSpacing=="number"?e.letterSpacingEm=t.letterSpacing:t.letter&&(e.letterSpacingEm=m(t.letter*xt,4)),e}const Lt=1,A="--sf-part-para",zt="(max-width: 719.98px)";function U(t){return t=X(t),typeof t.sizePhone=="number"&&t.sizePhone>0?{fontSize:`${t.sizePhone}px`}:{}}function kt(t,e){return e&&typeof t.sizePhone=="number"&&t.sizePhone>0?{...t,size:t.sizePhone}:t}function y(t,e,n){t=X(t);const r=$t(t,n),o=Ft(t),i=t.size?`${t.size}px`:r?Ht(r):"";return{fontFamily:t.font?Wt(t.font):r?`var(${It[r]})`:"",fontWeight:t.weight?String(t.weight):"",fontSize:i,minWidth:i?"0":"",overflowWrap:i?"break-word":"",lineHeight:o.lineHeight!==void 0?String(o.lineHeight):"",letterSpacing:o.letterSpacingEm!==void 0?`${o.letterSpacingEm}em`:"",[A]:t.paragraphSpacing?`${t.paragraphSpacing}px`:"",textTransform:wt(t.case),textAlign:t.align??"",paddingTop:I(t.padding),paddingBottom:I(t.padding),maxWidth:I(t.width),color:jt(t.color),fontStyle:t.italic===!0?"italic":t.italic===!1?"normal":""}}const jt=t=>t===void 0||t===""?"":Object.hasOwn(F,t)?F[t]:B.test(t)?t:"",B=/^#[0-9a-fA-F]{6}$/;function ae(t){return B.test(t)}const I=t=>t===void 0?"":`${t}px`,m=(t,e)=>Number(t.toFixed(e));function ce(t,e){const n=Number.parseFloat(t.fontSize)||16,r=Number.parseFloat(t.lineHeight),o=Number.parseFloat(t.letterSpacing),i=Number.parseFloat(t.paddingTop),s=Number.parseFloat(t.maxWidth);return{fontKey:e,sizePx:n,weight:Dt(Number.parseInt(t.fontWeight,10)),lineRatio:Number.isFinite(r)?m(r/n,3):1.2,letterEm:Number.isFinite(o)?m(o/n,4):0,align:Ct(t.textAlign),case:Nt(t.textTransform),paddingPx:Number.isFinite(i)?Math.round(i):0,widthPx:Number.isFinite(s)&&s<E?Math.round(s):E}}function Dt(t){return Number.isFinite(t)?it.reduce((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e):400}function Ct(t){for(const e of k)if(e===t)return e;return t==="end"?"right":"left"}function le(t,e){const n=V(t);if(!n)return"";for(const r of Q)if(V(e(r.cssVar))===n)return r.key;return""}const V=t=>(t.split(",")[0]??"").replace(/["']/g,"").replace(/\s+/g," ").trim().toLowerCase();function Wt(t){const e=v(t);return e?`var(${e.cssVar})`:""}function fe(t,e,n,r){return!e||H(e)?.nodeId!==t?null:n.find(i=>r(i.getAttribute("class")))??n[0]??null}function ue(t,e,n=()=>b,r=d=>d,o=Xt,i=!1,s=()=>!1){let d=0;for(const{element:a,partId:c}of t){const u=H(c)?.propKey;if(!u)continue;const l=r(u),p=Object.hasOwn(e,l)?T(e[l])??{}:{},f=y(kt(p,i),b,{blockDrawsStyle:s(u)});g(p.textStyle)?a.setAttribute?.(L,p.textStyle):a.removeAttribute?.(L);const S=M.some(h=>a.style[h]);let x=!1;for(const[h,P]of Object.entries(f))Ut(a,h,P),P&&(x=!0);if(S||M.some(h=>f[h]))for(const h of Kt(a,o))for(const P of M)h.style[P]=f[P]??"";x&&(d+=1)}return d}function Kt(t,e){const n=N(t.textContent??""),r=[];let o=t;for(let i=0;i<Gt&&e(o);i+=1){const s=o.parentElement;if(!s||N(s.textContent??"")!==n)break;r.push(s),o=s}return r}const Gt=8;function Xt(t){const e=t;return typeof window>"u"||!e?.ownerDocument?!1:window.getComputedStyle(e).display==="inline"}const b={fontKey:"",sizePx:16,weight:400,lineRatio:1,letterEm:0,align:"left",case:"none",paddingPx:0,widthPx:E};function Ut(t,e,n){if(!e.startsWith("--")){t.style[e]=n;return}const r=t.style;typeof r.setProperty=="function"?n?r.setProperty(e,n):r.removeProperty?.(e):r[e]=n;const o=t;e===A&&(n?o.setAttribute?.(Y,""):o.removeAttribute?.(Y))}const Y="data-sf-part-para",Bt=Object.keys(y({},b)),$=new Set(["color","overflowWrap",A,"fontStyle"]),M=Bt.filter(t=>!$.has(t));function pe(t,e,n,r=i=>i,o=()=>!1){const i=new Map;for(const a of t){const c=et(a.key,a.row);for(const u of a.texts){const l=i.get(u);l?(l.keys.add(a.key),l.partKeys.add(c)):i.set(u,{keys:new Set([a.key]),partKeys:new Set([c])})}}const s=new Map;for(const a of Object.keys(e)){if(!Vt(a))continue;const c=T(e[a])??{},u=y(c,b),l=U(c),p=g(c.textStyle)?c.textStyle:void 0;!Object.values(u).some(Boolean)&&!Object.keys(l).length&&!p||s.set(a,{stamp:Z(n,a),declarations:u,...Object.keys(l).length?{phone:l}:{},...p?{textStyle:p}:{}})}const d=new Map;for(const[a,{keys:c,partKeys:u}]of i){const l=u.size===1?[...u][0]:c.size===1?[...c][0]:null;if(!l)continue;const p=r(l);if(!Object.hasOwn(e,p))continue;const f=T(e[p])??{},S=y(f,b,{blockDrawsStyle:o(l)}),x=U(f),R=g(f.textStyle)?f.textStyle:void 0;!Object.values(S).some(Boolean)&&!Object.keys(x).length&&!R||d.set(a,{stamp:Z(n,l),declarations:S,...Object.keys(x).length?{phone:x}:{},...R?{textStyle:R}:{}})}return d.size||s.size?{rules:d,kindRules:s,drawn:new Set(i.keys())}:null}function Vt(t){return t.startsWith("@")}function de(t,e){return t?.kindRules.get(e)??null}function Z(t,e){const n=r=>r.replace(/[^A-Za-z0-9_-]+/g,"-");return`${n(t)}~${n(e)}`}function xe(t){const e=[],n=new Set,r=o=>{const{stamp:i,declarations:s}=o;if(n.has(i))return;n.add(i);const d=Object.entries(s).filter(([,f])=>f!==""),a=f=>f.map(([S,x])=>`${Zt(S)}: ${x}`).join("; "),c=`[${nt}="${i}"]`,u=d.filter(([f])=>!$.has(f)),l=d.filter(([f])=>$.has(f));u.length&&e.push(`${c}, *:has(> ${c}) { ${a(u)} }`),l.length&&e.push(`${c} { ${a(l)} }`),s[A]&&e.push(...Yt(c));const p=Object.entries(o.phone??{}).filter(([,f])=>f!=="");p.length&&e.push(`@media ${zt} { ${c}, *:has(> ${c}) { ${a(p)} } }`)};for(const o of t.rules.values())r(o);for(const o of t.kindRules.values())r(o);return e.join(`
|
|
2
|
+
`)}function Yt(t){const e=`var(${A})`,n=":is([data-sf-bullet], [data-sf-number])";return[`${t} br:not(br + br) { display: block; content: ""; margin-top: ${e} }`,`${t} ${n}:not(:first-child) { margin-top: ${e} }`,`${t} ${n}:not(:last-child) { margin-bottom: ${e} }`]}const Zt=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`);function he(t,e){if(!t)return null;const n=N(e),r=t.rules.get(n);if(r)return r;if(n.length<qt||t.drawn.has(n))return null;let o=null;for(const[i,s]of t.rules)if(i.includes(n)){if(o&&o.stamp!==s.stamp)return null;o=s}return o}const qt=8;export{k as PART_ALIGNS,Pt as PART_LETTER_EM_MAX,mt as PART_LETTER_EM_MIN,xt as PART_LETTER_STEP,gt as PART_LINE_HEIGHT_MAX,St as PART_LINE_HEIGHT_MIN,dt as PART_LINE_STEP,C as PART_MEASURED_TRACKS,at as PART_NUDGE_MAX,st as PART_NUDGE_MIN,lt as PART_PADDING_MAX,ct as PART_PADDING_MIN,ft as PART_PADDING_STEP,Y as PART_PARAGRAPH_ATTR,_t as PART_PARAGRAPH_MAX,Tt as PART_PARAGRAPH_MIN,A as PART_PARAGRAPH_VAR,zt as PART_PHONE_MAX_CSS,ht as PART_RELATIVE_PROPS,D as PART_SIZE_MAX,j as PART_SIZE_MIN,nt as PART_STYLED_ATTR,w as PART_STYLES_PROP,Bt as PART_STYLE_PROPERTIES,it as PART_WEIGHTS,E as PART_WIDTH_MAX,ut as PART_WIDTH_MIN,pt as PART_WIDTH_STEP,M as SHARED_PART_PROPERTIES,z as STYLE_ID_OF_ROLE,L as TEXT_STYLE_ATTR,ue as applyPartStyles,se as blockDrawsTextStyle,ne as followedStyleOf,ae as isHexColour,Vt as isPartKindKey,g as isTextStyleId,Yt as paragraphRules,Nt as partCaseOfTransform,wt as partCaseTransform,le as partFontKeyOf,U as partPhoneDeclarations,de as partRuleForKind,he as partRuleForText,Ft as partSpacingOf,ce as partStyleBase,re as partStyleCount,xe as partStyleCss,y as partStyleDeclarations,kt as partStyleForScreen,fe as partStyleSource,oe as propsWithPartStyleValue,ie as propsWithoutPartStyle,pe as publishedPartStyles,K as readPartStyle,W as readPartStyles};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{catalogueLabel as m}from"../../../../format/lib/puck/passes/catalogue-labels.js";import{cellWidth as n}from"./cell-width.js";import{clickableParts as s}from"./clickable-parts.js";import{cardCorners as p,sectionCorners as c}from"./corners.js";import{emptyHeadings as f}from"../../../../format/lib/puck/passes/empty-headings.js";import{showWhenRows as a}from"../../../../format/lib/puck/passes/show-when-rows.js";import{hiddenNodes as d}from"../../../../format/lib/puck/passes/hidden-nodes.js";import{
|
|
1
|
+
import{catalogueLabel as m}from"../../../../format/lib/puck/passes/catalogue-labels.js";import{cellWidth as n}from"./cell-width.js";import{clickableParts as s}from"./clickable-parts.js";import{cardCorners as p,sectionCorners as c}from"./corners.js";import{emptyHeadings as f}from"../../../../format/lib/puck/passes/empty-headings.js";import{showWhenRows as a}from"../../../../format/lib/puck/passes/show-when-rows.js";import{hiddenNodes as d}from"../../../../format/lib/puck/passes/hidden-nodes.js";import{mediaValues as l}from"../../../../format/lib/puck/passes/media-values.js";import{sectionAnchor as h}from"./section-anchor.js";import{sectionAnimation as u}from"./section-animation.js";import{sectionHeight as g}from"./section-height.js";import{cardSticky as w,sectionSticky as P}from"./section-sticky.js";import{sectionBorder as S}from"./borders.js";import{blockPadding as A,sectionPadding as W}from"./section-padding.js";import{sectionTheme as b,slideTheme as C}from"./section-theme.js";import{buttonAlignInRow as k,containedWidth as y,imageWidth as B,sectionWidth as G}from"./section-width.js";import{blockGroups as H,sectionGroups as L}from"../../../../format/lib/puck/passes/settings-groups.js";import{openSlotDisallow as R,sectionGroupAllow as T}from"../../../../format/lib/puck/passes/slot-rules.js";import{registryPassContext as oo}from"../../../../format/lib/puck/passes/registry-context.js";const D=[l,T,R,W,c,S,p,A,n,G,y,k,B,g,h,b,u,P,w,C,L,H,a,f,s,d,m];function Y(r,e,o){const i=e;for(const t of D)t.applies(r,o,i)&&(o.inspector&&t.panel?.(i,r,o.inspector,o),t.draw?.(i,r,o));return e}export{D as BLOCK_PASSES,Y as applyBlockPasses,oo as registryPassContext};
|
|
@@ -2,6 +2,7 @@ import { decodePartId, encodePartId } from "efficient-easel/draw";
|
|
|
2
2
|
import { type TextFieldMeta } from "efficient-easel/draw";
|
|
3
3
|
import { type PartRow } from "./part-rows.js";
|
|
4
4
|
export declare const PART_ATTR = "data-sf-part";
|
|
5
|
+
export declare const REGION_PART_ATTR = "data-sf-region-part";
|
|
5
6
|
export declare const PART_SELECTED_ATTR = "data-sf-part-selected";
|
|
6
7
|
export declare const PART_KIND_ATTR = "data-sf-part-kind";
|
|
7
8
|
export declare const PART_STYLE_OWNER_ATTR = "data-sf-part-style-owner";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{decodePartId as m,encodePartId as g}from"efficient-easel/draw";import{stripMarkup as y}from"../../../format/lib/markup.js";import{LINK_FIELD_MARKER as A,SCAFFOLD_FIELD_MARKER as R,TEXT_FIELD_MARKER as u}from"efficient-easel/draw";import{readHidable as
|
|
1
|
+
import{decodePartId as m,encodePartId as g}from"efficient-easel/draw";import{stripMarkup as y}from"../../../format/lib/markup.js";import{LINK_FIELD_MARKER as A,SCAFFOLD_FIELD_MARKER as R,TEXT_FIELD_MARKER as u}from"efficient-easel/draw";import{readHidable as _}from"efficient-easel/draw";import{SCALAR_TEXT_CONTROLS as L}from"efficient-easel/draw";import{isStructuralTextProp as b}from"../../../format/lib/puck/neutralization-contracts.js";import{fieldInOwnBox as P}from"../../../format/lib/puck/own-box.js";import{partRowTexts as I}from"./part-rows.js";const B="data-sf-part",H="data-sf-region-part",G="data-sf-part-selected",W="data-sf-part-kind",S="data-sf-part-style-owner",j="data-sf-part-style-kind";function q(e){for(let t=e;t;t=t.parentElement){const r=t.getAttribute(S),n=t.getAttribute(j);if(r&&n)return{owner:r,kind:n};if(t.getAttribute("data-puck-component"))return null}return null}const h=2;function J(e,t){if(!e)return!1;const r=m(e);return!!r?.propKey&&r.nodeId===t}function E(e){return y(e).replace(/\s+/gu,"")}function l(e,t,r){const n=e[u];if(n){if(n.control==="textList"){const o=n.itemKey??"text";if(!Array.isArray(t))return;for(const i of t){const c=i?.[o];typeof c=="string"&&r.push(c)}return}const{text:s}=_(t);s?r.push(s):n.placeholder&&r.push(n.placeholder);return}if(!e[A]){if(e.type==="text"||e.type==="textarea"){typeof t=="string"&&t&&r.push(t);return}if(e.arrayFields&&Array.isArray(t)){for(const s of t)for(const[o,i]of Object.entries(e.arrayFields))l(i,s?.[o],r);return}if(e.objectFields&&t&&typeof t=="object")for(const[s,o]of Object.entries(e.objectFields))l(o,t[s],r)}}function Q(e){if(!e||typeof e!="object")return!1;const t=e;return t[A]?!1:!!t[u]||t.type==="text"||t.type==="textarea"}function O(e,t){const r=e[u];return r?.label?r.label:typeof e.label=="string"?e.label:t}function N(e){const t=e.indexOf(" (");return(t>0?e.slice(0,t):e).trim()}function U(e,t){if(!e)return[];const r=[];for(const[n,s]of Object.entries(e)){if(!s||typeof s!="object"||b(n))continue;const o=s,i=[];l(o,t?.[n],i),!i.length&&o[R]!==void 0&&l(o,o[R],i);const c=O(o,n),a=new Set;for(const{row:T,text:f}of I(o,t?.[n])){const d=E(f);d.length<h||(a.add(d),r.push({key:n,label:c,texts:[d],row:T}))}const p=new Set(a),x=[];for(const T of i){const f=E(T);f.length<h||p.has(f)||(p.add(f),x.push(f))}x.length&&r.push({key:n,label:c,texts:x})}return r}const F=L;function w(e,t){if(!t||typeof t!="object"||b(e)||P(t))return null;const r=t[u];return!r||!F.includes(r.control)?null:r}function V(e,t){const r=w(e,t);return r!==null&&r.identifier!==!0}function Z(e,t){if(!e)return[];const r=[];for(const[n,s]of Object.entries(e)){const o=w(n,s);if(!o)continue;const{text:i,hidden:c}=_(t?.[n]),a=i||o.placeholder||"",p=y(a).replace(/\s+/gu," ").trim();r.push({key:n,label:N(O(s,n)),preview:p,offPage:o.offPage===!0,identifier:o.identifier===!0,hidden:!!c})}return r}export{B as PART_ATTR,W as PART_KIND_ATTR,G as PART_SELECTED_ATTR,j as PART_STYLE_KIND_ATTR,S as PART_STYLE_OWNER_ATTR,H as REGION_PART_ATTR,m as decodePartId,g as encodePartId,w as entryPartMetaOf,V as fieldDrawsEntryRow,Q as holdsAuthoredText,E as normalizePartText,N as partHeadLabel,O as partLabel,U as partNeedles,J as partOpenOn,q as partStyleOwnerOf,Z as sectionTextParts};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-web-builder",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "35.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",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@tabler/icons-react": "^3.46.0",
|
|
56
|
-
"efficient-easel": "^
|
|
56
|
+
"efficient-easel": "^17.0.0",
|
|
57
57
|
"efficient-shell": "^8.18.0",
|
|
58
58
|
"isomorphic-dompurify": "^3.18.0",
|
|
59
59
|
"next": ">=16",
|
|
@@ -69,11 +69,10 @@
|
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@tabler/icons-react": "^3.46.0",
|
|
71
71
|
"@tanstack/react-query": "^5.100.9",
|
|
72
|
-
"@types/google.maps": "^3.64.1",
|
|
73
72
|
"@types/node": "^20",
|
|
74
73
|
"@types/react": "^19",
|
|
75
74
|
"@types/react-dom": "^19",
|
|
76
|
-
"efficient-easel": "^
|
|
75
|
+
"efficient-easel": "^17.0.0",
|
|
77
76
|
"efficient-shell": "^8.18.0",
|
|
78
77
|
"esbuild": "^0.28.0",
|
|
79
78
|
"happy-dom": "^20.14.5",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const GOOGLE_MAPS_API_KEY: string;
|
|
2
|
-
export declare function loadGoogleMaps(apiKey?: string): Promise<typeof google.maps>;
|
|
3
|
-
export declare function hasMapCoords(lat: number, lng: number): boolean;
|
|
4
|
-
export declare const MAP_LOAD_TIMEOUT_MS = 15000;
|
|
5
|
-
export declare function watchMapLoad(onFail: () => void): {
|
|
6
|
-
ready: () => void;
|
|
7
|
-
stop: () => void;
|
|
8
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const u=process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY??"",l="https://maps.googleapis.com/maps/api/js",d="__storefrontMapsReady__";let i=null;function w(e){if(typeof window>"u")return Promise.reject(new Error("ssr"));if(window.google?.maps)return Promise.resolve(window.google.maps);if(i)return i;const o=e&&e.trim()||u;return o?(i=new Promise((n,s)=>{const t=d;window[t]=()=>n(window.google.maps);const r=document.createElement("script");r.src=`${l}?key=${encodeURIComponent(o)}&libraries=marker&callback=${t}&v=weekly&loading=async`,r.async=!0,r.defer=!0,r.onerror=()=>s(new Error("Failed to load Google Maps JS SDK")),document.head.appendChild(r)}),i):Promise.reject(new Error("No Google Maps API key configured"))}function f(e,o){return Number.isFinite(e)&&Number.isFinite(o)&&!(e===0&&o===0)}const p=15e3,c=new Set,m=()=>c.forEach(e=>e());function _(e){const o=window;return o.gm_authFailure=m,c.add(e),()=>{c.delete(e)}}function A(e){let o=!1,n;const s=()=>{o||(o=!0,a(),e())},t=()=>{n=setTimeout(()=>{document.visibilityState==="visible"?s():t()},p)},r=_(s),a=()=>{clearTimeout(n),r()};return t(),{ready:()=>{o||(o=!0,a())},stop:a}}export{u as GOOGLE_MAPS_API_KEY,p as MAP_LOAD_TIMEOUT_MS,f as hasMapCoords,w as loadGoogleMaps,A as watchMapLoad};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare const MAPS_API_KEY_STORAGE = "sf:maps-api-key";
|
|
2
|
-
export declare const MAPS_MAP_ID_STORAGE = "sf:maps-map-id";
|
|
3
|
-
export declare function readSiteMapsKey(): string;
|
|
4
|
-
export declare function writeSiteMapsKey(key: string): void;
|
|
5
|
-
export declare function readSiteMapId(): string;
|
|
6
|
-
export declare function writeSiteMapId(id: string): void;
|
|
7
|
-
export interface SiteMapsValue {
|
|
8
|
-
apiKey: string;
|
|
9
|
-
setApiKey: (key: string) => void;
|
|
10
|
-
mapId: string;
|
|
11
|
-
}
|
|
12
|
-
export declare const SiteMapsProvider: import("react").Provider<SiteMapsValue>;
|
|
13
|
-
export declare const useSiteMapsKey: () => string;
|
|
14
|
-
export declare const useSiteMapId: () => string;
|
|
15
|
-
export declare function resolveMapsKey(perBlockKey: string | undefined, siteKey: string): string;
|
|
16
|
-
export declare function resolveMapId(perBlockMapId: string | undefined, siteMapId: string): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{createContext as p,useContext as o}from"react";import{GOOGLE_MAPS_API_KEY as a}from"../../format/lib/maps-loader.js";const n="sf:maps-api-key",i="sf:maps-map-id";function u(){if(typeof window>"u")return"";try{return window.localStorage.getItem(n)??""}catch{return""}}function s(t){if(!(typeof window>"u"))try{window.localStorage.setItem(n,t)}catch{}}function f(){if(typeof window>"u")return"";try{return window.localStorage.getItem(i)??""}catch{return""}}function w(t){if(!(typeof window>"u"))try{window.localStorage.setItem(i,t)}catch{}}const r=p({apiKey:"",setApiKey:()=>{},mapId:""}),m=r.Provider,S=()=>o(r).apiKey,x=()=>o(r).mapId;function y(t,e){return t&&t.trim()||e&&e.trim()||a}function M(t,e){return t&&t.trim()||e&&e.trim()||""}export{n as MAPS_API_KEY_STORAGE,i as MAPS_MAP_ID_STORAGE,m as SiteMapsProvider,f as readSiteMapId,u as readSiteMapsKey,M as resolveMapId,y as resolveMapsKey,x as useSiteMapId,S as useSiteMapsKey,w as writeSiteMapId,s as writeSiteMapsKey};
|