efficient-web-builder 55.0.0 → 55.2.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 +43 -0
- package/dist/editor/lib/document/block-source-fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/CardList/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/general/CardList/fields.js +1 -0
- package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Footprint/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Logos/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/index.d.ts +2 -2
- package/dist/editor/lib/document/blocks/general/index.js +1 -1
- package/dist/editor/lib/document/card-row-fields.js +1 -1
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/field-groups.js +1 -1
- package/dist/editor/lib/document/part-anchors.js +1 -1
- package/dist/editor/lib/host-document-bridge.d.ts +4 -1
- package/dist/editor/lib/host-document-bridge.js +1 -1
- package/dist/editor/lib/sections/text-layouts.d.ts +2 -1
- package/dist/editor/lib/sections/text-layouts.js +1 -1
- package/dist/format/lib/content/block-sources.d.ts +6 -1
- package/dist/format/lib/content/block-sources.js +1 -1
- package/dist/format/lib/content/box-background.d.ts +19 -0
- package/dist/format/lib/content/box-background.js +1 -1
- package/dist/format/lib/content/box-layout.d.ts +2 -0
- package/dist/format/lib/content/box-layout.js +1 -1
- package/dist/format/lib/content/box-phone-place.d.ts +3 -3
- package/dist/format/lib/content/box-phone-place.js +1 -1
- package/dist/format/lib/content/box-separator.js +1 -1
- package/dist/format/lib/content/box-shape.d.ts +1 -1
- package/dist/format/lib/content/card-state.d.ts +8 -0
- package/dist/format/lib/content/card-state.js +1 -1
- package/dist/format/lib/content/card-template.d.ts +17 -1
- package/dist/format/lib/content/card-template.js +1 -1
- package/dist/format/lib/content/footprint.d.ts +1 -0
- package/dist/format/lib/content/footprint.js +1 -1
- package/dist/format/lib/content/phone-focus.js +1 -1
- package/dist/format/lib/content/view-lines.d.ts +1 -1
- package/dist/format/lib/content/view-var-split.d.ts +11 -0
- package/dist/format/lib/content/view-var-split.js +1 -0
- package/dist/format/lib/document/blocks/general/CardList/item-seed.d.ts +4 -0
- package/dist/format/lib/document/blocks/general/CardList/item-seed.js +1 -0
- package/dist/format/lib/document/blocks/general/CardList/meta.d.ts +8 -0
- package/dist/format/lib/document/blocks/general/CardList/meta.js +1 -0
- package/dist/format/lib/document/blocks/general/Footprint/card-seed.d.ts +2 -0
- package/dist/format/lib/document/blocks/general/Footprint/card-seed.js +1 -0
- package/dist/format/lib/document/blocks/general/Footprint/meta.d.ts +6 -0
- package/dist/format/lib/document/blocks/general/Footprint/meta.js +2 -2
- package/dist/format/lib/document/blocks/general/Logos/meta.d.ts +7 -0
- package/dist/format/lib/document/blocks/general/Logos/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/metas.d.ts +1 -0
- package/dist/format/lib/document/blocks/general/metas.js +1 -1
- package/dist/format/lib/document/general-order.d.ts +1 -1
- package/dist/format/lib/document/general-order.js +1 -1
- package/dist/format/lib/document/section-catalog.js +6 -2
- package/dist/format/lib/editor-words-catalogue.d.ts +1 -0
- package/dist/format/lib/editor-words-catalogue.js +1 -1
- package/dist/format/lib/editor-words-kept.d.ts +1 -0
- package/dist/format/lib/editor-words-kept.js +1 -0
- package/dist/format/lib/fit-words.d.ts +8 -0
- package/dist/format/lib/fit-words.js +23 -12
- package/dist/format/lib/fonts.js +1 -1
- package/dist/render/components/CardRowContext.d.ts +4 -2
- package/dist/render/components/CardRowContext.js +1 -1
- package/dist/render/components/Flex.d.ts +8 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/Footprint.d.ts +4 -1
- package/dist/render/components/Footprint.js +1 -1
- package/dist/render/components/HeroPictures.d.ts +2 -2
- package/dist/render/components/PartStyledKind.d.ts +2 -1
- package/dist/render/components/PartStyledKind.js +1 -1
- package/dist/render/components/SiteGutterFrame.d.ts +2 -1
- package/dist/render/components/SiteGutterFrame.js +1 -1
- package/dist/render/components/Text.d.ts +3 -1
- package/dist/render/components/Text.js +1 -1
- package/dist/render/lib/content/block-size.d.ts +2 -6
- package/dist/render/lib/content/block-size.js +1 -1
- package/dist/render/lib/content/box-shared-columns.d.ts +6 -0
- package/dist/render/lib/content/box-shared-columns.js +1 -1
- package/dist/render/lib/document/blocks/general/ButtonBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/general/CardList/render.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/CardList/render.js +1 -0
- package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Footprint/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Logos/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Text/render.js +1 -1
- package/dist/render/lib/document/blocks/general/renders.d.ts +1 -0
- package/dist/render/lib/document/blocks/general/renders.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-fitment.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-fitment.js +1 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-forms.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-forms.js +1 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-head.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-head.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-logos.d.ts +1 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-logos.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-pageheader.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
- package/dist/render/lib/document/hero-media-parts.d.ts +2 -2
- package/dist/render/lib/document/part-styles.js +2 -2
- package/dist/render/lib/document/passes/block-size.js +1 -1
- package/dist/render/lib/document/passes/clickable-parts.js +1 -1
- package/dist/render/lib/document/text-parts.d.ts +2 -1
- package/dist/render/lib/document/text-parts.js +1 -1
- package/dist/render/lib/sections/section-to-box.d.ts +2 -0
- package/dist/render/lib/sections/section-to-box.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{anchorFields as m,bucketHeader as L,cardMediaFields as Y,cardShowFields as U,cardStyleFields as W,designGroupHeader as F,foldMarker as z,foldMetaOf as h,quietMarker as q,heightFields as E,sectionShapeFields as w,sectionThemeFields as O,stickFields as x,widthField as D}from"./controls.js";import{group as J}from"efficient-easel/screen/lib/document/box-fields";import{sidesPaddingFields as T}from"./box-fields.js";import{deviceField as Q,deviceMetaOf as P}from"efficient-easel/screen/lib/document/device-fields";import{entranceFields as B}from"../animation/entrance-fields.js";import{DESIGN_GROUPS as k,SETTINGS_BUCKETS as V}from"efficient-easel/panel";import{BUCKET_KEY as d,DESIGN_GROUP_KEY as b}from"efficient-easel/screen/lib/document/field-buckets";const A=V;function X(e){return e==="Animation"?"Animation":"Design"}const Z="Editor only — not shown live",I={"Archive link":"Content",Article:"Content",Blocks:"Content","Blog posts":"Content","Browser mock":"Content",Button:"Content","Call to action":"Content","Car prompt":"Content","Card link":"Content",Cards:"Content","Claims bars":"Content","Contact info":"Content",Content:"Content",Display:"Content","Content source":"Content",Contents:"Content",Filters:"Content","Show on a card":"Content",Footnote:"Content",Form:"Content",Founders:"Content","Gallery A":"Content","Gallery B":"Content","Gallery link":"Content",Header:"Content","Header link":"Content","Image caption":"Content","In this issue":"Content",Items:"Content","Kanban columns":"Content",Lead:"Content","Left panel":"Content",Link:"Content",Links:"Content",List:"Content","Message form":"Content",Metadata:"Content",Milestones:"Content","Mockup card":"Content","Newsletter panel":"Content",Offices:"Content",Options:"Content","Others gallery":"Content","Overlay button":"Content",Product:"Content","Product page":"Content",Products:"Content","Pull quote":"Content",Questions:"Content","Recent issues":"Content","Recent posts":"Content",Reviews:"Content","Right panel · actions":"Content","Right panel · choices":"Content","Right panel · form":"Content","Routing groups":"Content",Rows:"Content",Search:"Content",Section:"Content","Section header":"Content",Sections:"Content","Signup form":"Content",Source:"Content","Source product":"Content","Stat & note":"Content",Stats:"Content","Submit button":"Content","Success state":"Content",Wheel:"Content",Terminal:"Content",Text:"Content","Text column":"Content","Timeline entries":"Content","Top row":"Content",Total:"Content","Trailing note":"Content","“Other” reason":"Content","Background images":"Design",Gallery:"Content",Image:"Content","Image column":"Content",Images:"Content",Logo:"Content",Map:"Content",Media:"Content","Background image":"Design",Color:"Design","Image tint":"Design",Style:"Design",Shape:"Design",Shadow:"Design",Texture:"Design",Overlay:"Design","Text style":"Design",Entrance:"Animation",Hover:"Animation",Anchor:"Anchor",Arrangement:"Layout","Auto-slide":"Layout",Bar:"Layout","Cell width":"Size",Behavior:"Layout",Schedule:"Layout",Controls:"Layout",Diagram:"Layout",[Z]:"Layout","Filters shown":"Layout","Slide picker":"Layout",Arrows:"Layout","On a phone":"Layout",Placement:"Position",Nudge:"Position","Stick to top":"Position","Image gallery":"Layout",Grid:"Layout",Layout:"Layout",Padding:"Layout",Price:"Layout",Preview:"Layout",Setup:"Layout","Show / hide elements":"Layout","Show in the buy box":"Layout",Visibility:"Layout",Width:"Size",Size:"Size",Height:"Size"},$={"AlloyWheelsListing._gCards":"Design","ProductGrid._gCards":"Design"},G={"Text._gSpacing":"Size","Heading._gSpacing":"Size"};function _(e,t,o){const a=`${e}.${t}`;return G[a]??$[a]??I[o]}function ge(e,t,o){const a=_(e,t,o);return a?X(a):void 0}function H(e){return e==="Animation"?[d.Animation]:[d.Design,b[e]]}function S(...e){const t=[];for(const o of e)for(const a of Object.values(o)){const C=P(a),g=h(C?C.inner:a),l=g?I[g.label]:void 0;if(l)for(const p of H(l))t.includes(p)||t.push(p)}return t}const pe=[...S(T({tablet:!0}),D("full"),E(),m(),x()),...Object.keys(T({tablet:!0})),...Object.keys(D("full")),...Object.keys(E()),...Object.keys(m()),...Object.keys(x())],ye=[...S(O()),...Object.keys(O())],ke=[...S(w()),...Object.keys(w())],_e=[...S(B()),...Object.keys(B())],ee=Object.keys(Y()),te=new Set(["cardImage","imageBackground"]),Se=[...H(_("ProductGrid","_gCards","Cards")??"Design"),...ee.filter(e=>e.startsWith("_g")||te.has(e))],ve=Object.keys(W()),fe=Object.keys(U()),ne={"ImageBlock._gStyle":"duplicated the Style bucket header above it (2026-09-04)","ButtonBlock._gStyle":"duplicated the Style bucket header above it (2026-09-04)","HeroGroup._gContent":"duplicated the Content bucket header above it (2026-09-04)","HeroGroup._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","Footer._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","FooterLogo._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterLogo._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterMenu._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterMenu._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterGroup._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","FooterText._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterText._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterSocial._gStyle":"duplicated the Style bucket header above it (born tabbed, 2026-09-17)","FooterSocial._gLayout":"duplicated the Layout bucket header above it (born tabbed, 2026-09-17)","MenuBlock._gContent":"duplicated the Content bucket header above it (born tabbed, H.1)","MenuBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.1)","SocialLogosBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.1)","SocialLogosBlock._gLayout":"duplicated the Layout bucket header above it (born tabbed, H.1)","SearchBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.2)","CartBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.2)","CountrySwitchBlock._gStyle":"duplicated the Style bucket header above it (born tabbed with its Show as, 2026-10-17)","Split._gContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gVehicleContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gWheelContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gOthersContent":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gHeadCopy":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gLeftCopy":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gRightCopy":"duplicated the Content bucket header above it (2026-09-04)","CollectionCard._gContent":"duplicated the Content bucket header above it (A Card Sets Its Own Corners)","HeroSlide._gContent":"duplicated the Content bucket header above it (Hero Slide Tabs And Theme)","KeyFeatures._gContent":"duplicated the Content bucket header above it (66049)","KeyFeatures._gStyle":"duplicated the Style bucket header above it (66049)","ParagraphsA._gContent":"duplicated the Content bucket header above it (66049)","ParagraphsA._gStyle":"duplicated the Style bucket header above it (66049)","Chart._gContent":"duplicated the Content bucket header above it (66049)","Chart._gStyle":"duplicated the Style bucket header above it (66049)","Logos._gContent":"duplicated the Content bucket header above it (66049)","Logos._gStyle":"duplicated the Style bucket header above it (66049)","Mockup._gContent":"duplicated the Content bucket header above it (66049)","Mockup._gStyle":"duplicated the Style bucket header above it (66049)","Stats._gContent":"duplicated the Content bucket header above it (66049)","Stats._gStyle":"duplicated the Style bucket header above it (66049)","StatsParagraph._gContent":"duplicated the Content bucket header above it (66049)","StatsParagraph._gStyle":"duplicated the Style bucket header above it (66049)","Testimonials._gContent":"duplicated the Content bucket header above it (66049)","Testimonials._gStyle":"duplicated the Style bucket header above it (66049)","AppointmentBooking._gContent":"duplicated the Content bucket header above it (66050)","BookingBox._gContent":"duplicated the Content bucket header above it ([SPLIT] Booking Form Into Three Boxes) — the same fault its own section retired in 66050, one level down","FAQ._gContent":"duplicated the Content bucket header above it (66050, family sweep)","FAQ._gLayout":"duplicated the Layout bucket header above it (66050, family sweep)","Form._gContent":"duplicated the Content bucket header above it (66050)","ReviewForm._gContent":"duplicated the Content bucket header above it (66050)","SubmitBuild._gContent":"duplicated the Content bucket header above it (66050)","SubmitBox._gContent":"duplicated the Content bucket header above it ([SPLIT] SubmitBuild Keeps Its Two Columns) — the same fault its own section retired in 66050, one level down","CheckoutCTA._gContent":"duplicated the Content bucket header above it (66051)","CheckoutCTA._gLayout":"duplicated the Layout bucket header above it (66051)","DeliveryOptions._gContent":"duplicated the Content bucket header above it (66051)","DeliveryOptions._gLayout":"duplicated the Layout bucket header above it (66051)","OrderSummary._gContent":"duplicated the Content bucket header above it (66051)","OrderSummary._gLayout":"duplicated the Layout bucket header above it (66051)","PaymentBadges._gContent":"duplicated the Content bucket header above it (66051)","PaymentBadges._gLayout":"duplicated the Layout bucket header above it (66051)","Collections._gContent":"duplicated the Content bucket header above it (66052)","Collections._gLayout":"duplicated the Layout bucket header above it (66052)","DocMasthead._gContent":"duplicated the Content bucket header above it (66053)","Events._gContent":"duplicated the Content bucket header above it (66054)","Events._gLayout":"duplicated the Layout bucket header above it (66054)","FeaturedCover._gContent":"duplicated the Content bucket header above it (66054)","Series._gStyle":"duplicated the Style bucket header above it (66054)","Flex._gContent":"duplicated the Content bucket header above it (66055)","Flex._gLayout":"duplicated the Layout bucket header above it (66055)","SectionHeader._gContent":"duplicated the Content bucket header above it (66055)","Breadcrumb._gContent":"duplicated the Content bucket header above it (66056)","CategoryBar._gStyle":"duplicated the Style bucket header above it (66056)","Hero._gContent":"duplicated the Content bucket header above it (66056)","Hero._gStyle":"duplicated the Style bucket header above it (66056)","HeroSingle._gStyle":"duplicated the Style bucket header above it (66056)","IntroBleed._gContent":"duplicated the Content bucket header above it (66056)","IntroBleed._gLayout":"duplicated the Layout bucket header above it (66056)","BundleOffer._gLayout":"duplicated the Layout bucket header above it (66059)","ProcessSteps._gContent":"duplicated the Content bucket header above it (66059)","Banner._gContent":"duplicated the Content bucket header above it (66060.1)","Banner._gLayout":"duplicated the Layout bucket header above it, and governed no controls (66060.1)","Manifesto._gContent":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gHeadCopy":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gLeftCopy":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gRightCopy":"duplicated the Content bucket header above it (66060.1)","Ticker._gContent":"duplicated the Content bucket header above it (66060.1)","Ticker._gStyle":"duplicated the Style bucket header above it (66060.1)","Timeline._gContent":"duplicated the Content bucket header above it (66060.1)","TitleWithButtons._gContent":"duplicated the Content bucket header above it (66060.1)","TitleWithButtons._gStyle":"duplicated the Style bucket header above it (66060.1)","Cards._gContent":"duplicated the Content bucket header above it (66218)","Cards._gStyle":"duplicated the Style bucket header above it (66218)","Prose._gContent":"duplicated the Content bucket header above it (66218)","Reviews._gContent":"duplicated the Content bucket header above it (66218)","Reviews._gStyle":"duplicated the Style bucket header above it (66218)"},K={Content:["Content"],Size:["Size"],Design:["Design","Style"],Layout:["Layout"],Position:["Position"],Anchor:["Anchor"],Animation:["Animation"]},M={_gAnchor:"repeated the Anchor group heading above it (two tabs, 11.0.0)"};{const e={...T({tablet:!0}),...D("full"),...E(),...m(),...O(),...w(),...B()};for(const t of Object.keys(M)){const o=h(e[t]),a=o?I[o.label]:void 0;if(!o||o.level!==2||!a||!K[a].includes(o.label))throw new Error(`INJECTED_RETIRED (lib/document/field-groups.ts) lists "${t}", but no uniform builder makes a level-2 heading by that key whose label repeats its place's word. The heading was renamed, moved or removed and the row is stale — a list that quietly matches nothing is worse than no list.`)}}const oe=new Set(["_sContent","_sStyle","_sLayout","_sMedia"]),ae=new Map([[d.Design,"Content"],[d.Animation,"Animation"],...k.map(e=>[b[e],e])]);function me(e){const t=new Set([...Object.values(d),b.Content]);for(const[o,a]of Object.entries(e))if(!t.has(o)&&h(a)?.level===1)return 1;return 2}function ie(e){const t=`${e}.`;return Object.keys(ne).filter(o=>o.startsWith(t)).map(o=>o.slice(t.length))}function re(e,t){const o=P(e),a=J(t);return o?Q(o.tier,a):a}function de(e,t){const o=h(t);return o?e==="Content"||e==="Animation"?z(t,o.label):q(t):t}function j(e){return e==="Design"?k:["Animation"]}function Le(e,t){const o=[],a=new Set(ie(t)),C=new Set;let g=!1,l=null;for(const[n,r]of Object.entries(e)){const i=h(r);if(oe.has(n))throw new Error(`${t}.${n}: that key was a tab header until efficient-web-builder 11.0.0, when the panel moved to two tabs (Design · Animation). Its tab is gone, so the key may not come back. Give the heading a key of the section's own (\`_g…\`), or open a Design group with its own key (\`_dDesign: section("Design")\`, \`_dLayout: section("Layout")\`).`);const c=ae.get(n);if(c!==void 0){if(i?.level!==1)throw new Error(`${t}.${n}: that key is reserved for the ${c} heading of the settings panel, but this field is ${i?`a level-${i.level} "${i.label}" header`:"not a header"}, so it cannot serve as one. Rename the section's own field.`);(n===d.Design||n===d.Animation)&&(g=!0),o.push(l={place:c,entries:[],adopted:!0});continue}if(!i){l||o.push(l={place:"Content",entries:[]}),l.entries.push([n,r]);continue}if(a.has(n)||n in M){const s=_(t,n,i.label);if(i.level!==2||!s||!K[s].includes(i.label))throw new Error(`${t}.${n}: ${a.has(n)?"RETIRED":"INJECTED_RETIRED"} (lib/document/field-groups.ts) lists this sub-heading as one whose name repeats the place it sits in, but it is a level-${i.level} "${i.label}" header in the ${s??"(unclassified)"} place. Only a level-2 header whose label is one of its place's words (PLACE_WORDS) may be retired — anything else is a heading a merchant reads for its own sake. Fix the row or drop it.`);a.has(n)&&C.add(n),o.push(l={place:s,entries:[]});continue}const u=_(t,n,i.label);if(!u)throw new Error(`${t}.${n}: the inspector group "${i.label}" is not classified in LABEL_GROUP (lib/document/field-groups.ts), so there is no way to say which of ${[...k,"Animation"].join(" / ")} its controls belong under. Classify it — an unclassified group silently lands wherever it was declared, which is the whole bug.`);o.push(l={place:u,entries:[[n,i.level===2?r:re(r,i.label)]]})}const p=new Set(Object.entries(e).filter(([,n])=>h(n)).map(([n])=>n));for(const[n,r]of[["BLOCK_KEY_GROUP",G],["KEY_GROUP",$]]){const i=Object.keys(r).filter(c=>c.startsWith(`${t}.`)).filter(c=>!p.has(c.slice(t.length+1)));if(i.length)throw new Error(`${t}: ${n} (lib/document/field-groups.ts) lists ${JSON.stringify(i)}, but no fold header by that key is in this section's panel. Either the heading was renamed or removed and the row is stale, or the row names the wrong key — an override that quietly matches nothing is worse than no override.`)}const v=g?[]:[...a].filter(n=>!C.has(n));if(v.length)throw new Error(`${t}: RETIRED (lib/document/field-groups.ts) lists ${JSON.stringify(v)}, but this section has no such fold header${v.length>1?"s":""}. Either the heading was renamed or removed and the row is stale, or the row names the wrong section — a list that quietly matches nothing is worse than no list.`);const R=new Set(o.filter(n=>n.entries.length>0).map(n=>n.place)),f=A.filter(n=>j(n).some(r=>R.has(r))),y={};for(const n of f){y[d[n]]=L(n,n===f[0]?f:null);for(const r of j(n)){if(!R.has(r))continue;const i=o.filter(u=>u.place===r),c=i.findIndex(u=>u.adopted);c>0&&i.unshift(...i.splice(c,1)),n==="Design"&&(y[b[r]]=F(r));for(const u of i)for(const[s,N]of u.entries)y[s]=de(r,N)}}return y}function Ee(e){return d.Design in e?e:{[d.Design]:L("Design",null),[b.Content]:F("Content"),...e}}function we(e){return A.some(t=>d[t]in e)}function Oe(e){const t=A.filter(a=>d[a]in e);if(t.length===0)return e;const o={...e};for(const a of t)o[d[a]]=L(a,a===t[0]?t:null);return o}export{G as BLOCK_KEY_GROUP,Se as BOUND_CARD_MEDIA_FIELD_KEYS,A as BUCKETS,d as BUCKET_KEY,ee as CARD_MEDIA_FIELD_KEYS,fe as CARD_SHOW_FIELD_KEYS,ve as CARD_STYLE_FIELD_KEYS,k as DESIGN_GROUPS,b as DESIGN_GROUP_KEY,Z as EDITOR_ONLY_GROUP,M as INJECTED_RETIRED,$ as KEY_GROUP,I as LABEL_GROUP,pe as LAYOUT_FIELD_KEYS,K as PLACE_WORDS,ne as RETIRED,_e as SECTION_ANIM_FIELD_KEYS,ke as SECTION_SHAPE_FIELD_KEYS,ye as SECTION_THEME_FIELD_KEYS,Le as assignSectionGroups,ge as bucketOf,X as bucketOfPlace,me as foldTopTier,we as hasBucketTabs,S as headerKeysOf,H as headerKeysOfPlace,_ as placeOf,Oe as reseatBucketTabs,ie as retiredHeadings,Ee as seatDesignBucket};
|
|
1
|
+
import{anchorFields as m,bucketHeader as L,cardMediaFields as Y,cardShowFields as U,cardStyleFields as W,designGroupHeader as F,foldMarker as z,foldMetaOf as h,quietMarker as q,heightFields as E,sectionShapeFields as w,sectionThemeFields as O,stickFields as x,widthField as D}from"./controls.js";import{group as J}from"efficient-easel/screen/lib/document/box-fields";import{sidesPaddingFields as T}from"./box-fields.js";import{deviceField as Q,deviceMetaOf as P}from"efficient-easel/screen/lib/document/device-fields";import{entranceFields as B}from"../animation/entrance-fields.js";import{DESIGN_GROUPS as k,SETTINGS_BUCKETS as V}from"efficient-easel/panel";import{BUCKET_KEY as d,DESIGN_GROUP_KEY as b}from"efficient-easel/screen/lib/document/field-buckets";const A=V;function X(e){return e==="Animation"?"Animation":"Design"}const Z="Editor only — not shown live",I={"Archive link":"Content",Article:"Content",Blocks:"Content","Blog posts":"Content","Browser mock":"Content",Button:"Content","Call to action":"Content","Car prompt":"Content","Card link":"Content","Card list":"Content",Cards:"Content","Claims bars":"Content","Contact info":"Content",Content:"Content",Display:"Content","Content source":"Content",Contents:"Content",Filters:"Content","Show on a card":"Content",Footnote:"Content",Form:"Content",Founders:"Content","Gallery A":"Content","Gallery B":"Content","Gallery link":"Content",Header:"Content","Header link":"Content","Image caption":"Content","In this issue":"Content",Items:"Content","Kanban columns":"Content",Lead:"Content","Left panel":"Content",Link:"Content",Links:"Content",List:"Content","Message form":"Content",Metadata:"Content",Milestones:"Content","Mockup card":"Content","Newsletter panel":"Content",Offices:"Content",Options:"Content","Others gallery":"Content","Overlay button":"Content",Product:"Content","Product page":"Content",Products:"Content","Pull quote":"Content",Questions:"Content","Recent issues":"Content","Recent posts":"Content",Reviews:"Content","Right panel · actions":"Content","Right panel · choices":"Content","Right panel · form":"Content","Routing groups":"Content",Rows:"Content",Search:"Content",Section:"Content","Section header":"Content",Sections:"Content","Signup form":"Content",Source:"Content","Source product":"Content","Stat & note":"Content",Stats:"Content","Submit button":"Content","Success state":"Content",Wheel:"Content",Terminal:"Content",Text:"Content","Text column":"Content","Timeline entries":"Content","Top row":"Content",Total:"Content","Trailing note":"Content","“Other” reason":"Content","Background images":"Design",Gallery:"Content",Image:"Content","Image column":"Content",Images:"Content",Logo:"Content",Map:"Content",Media:"Content","Background image":"Design",Color:"Design","Image tint":"Design",Style:"Design",Shape:"Design",Shadow:"Design",Texture:"Design",Overlay:"Design","Text style":"Design",Entrance:"Animation",Hover:"Animation",Anchor:"Anchor",Arrangement:"Layout","Auto-slide":"Layout",Bar:"Layout","Cell width":"Size",Behavior:"Layout",Schedule:"Layout",Controls:"Layout",Diagram:"Layout",[Z]:"Layout","Filters shown":"Layout","Slide picker":"Layout",Arrows:"Layout","On a phone":"Layout",Placement:"Position",Nudge:"Position","Stick to top":"Position","Image gallery":"Layout",Grid:"Layout",Layout:"Layout",Padding:"Layout",Price:"Layout",Preview:"Layout",Setup:"Layout","Show / hide elements":"Layout","Show in the buy box":"Layout",Visibility:"Layout",Width:"Size",Size:"Size",Height:"Size"},$={"AlloyWheelsListing._gCards":"Design"},H={"Text._gSpacing":"Size","Heading._gSpacing":"Size"};function _(e,t,o){const a=`${e}.${t}`;return H[a]??$[a]??I[o]}function ge(e,t,o){const a=_(e,t,o);return a?X(a):void 0}function G(e){return e==="Animation"?[d.Animation]:[d.Design,b[e]]}function S(...e){const t=[];for(const o of e)for(const a of Object.values(o)){const C=P(a),g=h(C?C.inner:a),l=g?I[g.label]:void 0;if(l)for(const p of G(l))t.includes(p)||t.push(p)}return t}const pe=[...S(T({tablet:!0}),D("full"),E(),m(),x()),...Object.keys(T({tablet:!0})),...Object.keys(D("full")),...Object.keys(E()),...Object.keys(m()),...Object.keys(x())],ye=[...S(O()),...Object.keys(O())],ke=[...S(w()),...Object.keys(w())],_e=[...S(B()),...Object.keys(B())],ee=Object.keys(Y()),te=new Set(["cardImage","imageBackground"]),Se=[...G(_("ProductGrid","_gCards","Cards")??"Design"),...ee.filter(e=>e.startsWith("_g")||te.has(e))],ve=Object.keys(W()),fe=Object.keys(U()),ne={"ImageBlock._gStyle":"duplicated the Style bucket header above it (2026-09-04)","ButtonBlock._gStyle":"duplicated the Style bucket header above it (2026-09-04)","HeroGroup._gContent":"duplicated the Content bucket header above it (2026-09-04)","HeroGroup._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","Footer._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","FooterLogo._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterLogo._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterMenu._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterMenu._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterGroup._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","FooterText._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterText._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterSocial._gStyle":"duplicated the Style bucket header above it (born tabbed, 2026-09-17)","FooterSocial._gLayout":"duplicated the Layout bucket header above it (born tabbed, 2026-09-17)","MenuBlock._gContent":"duplicated the Content bucket header above it (born tabbed, H.1)","MenuBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.1)","SocialLogosBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.1)","SocialLogosBlock._gLayout":"duplicated the Layout bucket header above it (born tabbed, H.1)","SearchBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.2)","CartBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.2)","CountrySwitchBlock._gStyle":"duplicated the Style bucket header above it (born tabbed with its Show as, 2026-10-17)","Split._gContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gVehicleContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gWheelContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gOthersContent":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gHeadCopy":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gLeftCopy":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gRightCopy":"duplicated the Content bucket header above it (2026-09-04)","CollectionCard._gContent":"duplicated the Content bucket header above it (A Card Sets Its Own Corners)","HeroSlide._gContent":"duplicated the Content bucket header above it (Hero Slide Tabs And Theme)","KeyFeatures._gContent":"duplicated the Content bucket header above it (66049)","KeyFeatures._gStyle":"duplicated the Style bucket header above it (66049)","ParagraphsA._gContent":"duplicated the Content bucket header above it (66049)","ParagraphsA._gStyle":"duplicated the Style bucket header above it (66049)","Chart._gContent":"duplicated the Content bucket header above it (66049)","Chart._gStyle":"duplicated the Style bucket header above it (66049)","Logos._gContent":"duplicated the Content bucket header above it (66049)","Logos._gStyle":"duplicated the Style bucket header above it (66049)","Mockup._gContent":"duplicated the Content bucket header above it (66049)","Mockup._gStyle":"duplicated the Style bucket header above it (66049)","Stats._gContent":"duplicated the Content bucket header above it (66049)","Stats._gStyle":"duplicated the Style bucket header above it (66049)","StatsParagraph._gContent":"duplicated the Content bucket header above it (66049)","StatsParagraph._gStyle":"duplicated the Style bucket header above it (66049)","Testimonials._gContent":"duplicated the Content bucket header above it (66049)","Testimonials._gStyle":"duplicated the Style bucket header above it (66049)","AppointmentBooking._gContent":"duplicated the Content bucket header above it (66050)","BookingBox._gContent":"duplicated the Content bucket header above it ([SPLIT] Booking Form Into Three Boxes) — the same fault its own section retired in 66050, one level down","FAQ._gContent":"duplicated the Content bucket header above it (66050, family sweep)","FAQ._gLayout":"duplicated the Layout bucket header above it (66050, family sweep)","Form._gContent":"duplicated the Content bucket header above it (66050)","ReviewForm._gContent":"duplicated the Content bucket header above it (66050)","SubmitBuild._gContent":"duplicated the Content bucket header above it (66050)","SubmitBox._gContent":"duplicated the Content bucket header above it ([SPLIT] SubmitBuild Keeps Its Two Columns) — the same fault its own section retired in 66050, one level down","CheckoutCTA._gContent":"duplicated the Content bucket header above it (66051)","CheckoutCTA._gLayout":"duplicated the Layout bucket header above it (66051)","DeliveryOptions._gContent":"duplicated the Content bucket header above it (66051)","DeliveryOptions._gLayout":"duplicated the Layout bucket header above it (66051)","OrderSummary._gContent":"duplicated the Content bucket header above it (66051)","OrderSummary._gLayout":"duplicated the Layout bucket header above it (66051)","PaymentBadges._gContent":"duplicated the Content bucket header above it (66051)","PaymentBadges._gLayout":"duplicated the Layout bucket header above it (66051)","Collections._gContent":"duplicated the Content bucket header above it (66052)","Collections._gLayout":"duplicated the Layout bucket header above it (66052)","DocMasthead._gContent":"duplicated the Content bucket header above it (66053)","Events._gContent":"duplicated the Content bucket header above it (66054)","Events._gLayout":"duplicated the Layout bucket header above it (66054)","FeaturedCover._gContent":"duplicated the Content bucket header above it (66054)","Series._gStyle":"duplicated the Style bucket header above it (66054)","Flex._gContent":"duplicated the Content bucket header above it (66055)","Flex._gLayout":"duplicated the Layout bucket header above it (66055)","SectionHeader._gContent":"duplicated the Content bucket header above it (66055)","Breadcrumb._gContent":"duplicated the Content bucket header above it (66056)","CategoryBar._gStyle":"duplicated the Style bucket header above it (66056)","Hero._gContent":"duplicated the Content bucket header above it (66056)","Hero._gStyle":"duplicated the Style bucket header above it (66056)","HeroSingle._gStyle":"duplicated the Style bucket header above it (66056)","IntroBleed._gContent":"duplicated the Content bucket header above it (66056)","IntroBleed._gLayout":"duplicated the Layout bucket header above it (66056)","BundleOffer._gLayout":"duplicated the Layout bucket header above it (66059)","ProcessSteps._gContent":"duplicated the Content bucket header above it (66059)","Banner._gContent":"duplicated the Content bucket header above it (66060.1)","Banner._gLayout":"duplicated the Layout bucket header above it, and governed no controls (66060.1)","Manifesto._gContent":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gHeadCopy":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gLeftCopy":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gRightCopy":"duplicated the Content bucket header above it (66060.1)","Ticker._gContent":"duplicated the Content bucket header above it (66060.1)","Ticker._gStyle":"duplicated the Style bucket header above it (66060.1)","Timeline._gContent":"duplicated the Content bucket header above it (66060.1)","TitleWithButtons._gContent":"duplicated the Content bucket header above it (66060.1)","TitleWithButtons._gStyle":"duplicated the Style bucket header above it (66060.1)","Cards._gContent":"duplicated the Content bucket header above it (66218)","Cards._gStyle":"duplicated the Style bucket header above it (66218)","Prose._gContent":"duplicated the Content bucket header above it (66218)","Reviews._gContent":"duplicated the Content bucket header above it (66218)","Reviews._gStyle":"duplicated the Style bucket header above it (66218)"},K={Content:["Content"],Size:["Size"],Design:["Design","Style"],Layout:["Layout"],Position:["Position"],Anchor:["Anchor"],Animation:["Animation"]},M={_gAnchor:"repeated the Anchor group heading above it (two tabs, 11.0.0)"};{const e={...T({tablet:!0}),...D("full"),...E(),...m(),...O(),...w(),...B()};for(const t of Object.keys(M)){const o=h(e[t]),a=o?I[o.label]:void 0;if(!o||o.level!==2||!a||!K[a].includes(o.label))throw new Error(`INJECTED_RETIRED (lib/document/field-groups.ts) lists "${t}", but no uniform builder makes a level-2 heading by that key whose label repeats its place's word. The heading was renamed, moved or removed and the row is stale — a list that quietly matches nothing is worse than no list.`)}}const oe=new Set(["_sContent","_sStyle","_sLayout","_sMedia"]),ae=new Map([[d.Design,"Content"],[d.Animation,"Animation"],...k.map(e=>[b[e],e])]);function me(e){const t=new Set([...Object.values(d),b.Content]);for(const[o,a]of Object.entries(e))if(!t.has(o)&&h(a)?.level===1)return 1;return 2}function ie(e){const t=`${e}.`;return Object.keys(ne).filter(o=>o.startsWith(t)).map(o=>o.slice(t.length))}function re(e,t){const o=P(e),a=J(t);return o?Q(o.tier,a):a}function de(e,t){const o=h(t);return o?e==="Content"||e==="Animation"?z(t,o.label):q(t):t}function j(e){return e==="Design"?k:["Animation"]}function Le(e,t){const o=[],a=new Set(ie(t)),C=new Set;let g=!1,l=null;for(const[n,r]of Object.entries(e)){const i=h(r);if(oe.has(n))throw new Error(`${t}.${n}: that key was a tab header until efficient-web-builder 11.0.0, when the panel moved to two tabs (Design · Animation). Its tab is gone, so the key may not come back. Give the heading a key of the section's own (\`_g…\`), or open a Design group with its own key (\`_dDesign: section("Design")\`, \`_dLayout: section("Layout")\`).`);const c=ae.get(n);if(c!==void 0){if(i?.level!==1)throw new Error(`${t}.${n}: that key is reserved for the ${c} heading of the settings panel, but this field is ${i?`a level-${i.level} "${i.label}" header`:"not a header"}, so it cannot serve as one. Rename the section's own field.`);(n===d.Design||n===d.Animation)&&(g=!0),o.push(l={place:c,entries:[],adopted:!0});continue}if(!i){l||o.push(l={place:"Content",entries:[]}),l.entries.push([n,r]);continue}if(a.has(n)||n in M){const s=_(t,n,i.label);if(i.level!==2||!s||!K[s].includes(i.label))throw new Error(`${t}.${n}: ${a.has(n)?"RETIRED":"INJECTED_RETIRED"} (lib/document/field-groups.ts) lists this sub-heading as one whose name repeats the place it sits in, but it is a level-${i.level} "${i.label}" header in the ${s??"(unclassified)"} place. Only a level-2 header whose label is one of its place's words (PLACE_WORDS) may be retired — anything else is a heading a merchant reads for its own sake. Fix the row or drop it.`);a.has(n)&&C.add(n),o.push(l={place:s,entries:[]});continue}const u=_(t,n,i.label);if(!u)throw new Error(`${t}.${n}: the inspector group "${i.label}" is not classified in LABEL_GROUP (lib/document/field-groups.ts), so there is no way to say which of ${[...k,"Animation"].join(" / ")} its controls belong under. Classify it — an unclassified group silently lands wherever it was declared, which is the whole bug.`);o.push(l={place:u,entries:[[n,i.level===2?r:re(r,i.label)]]})}const p=new Set(Object.entries(e).filter(([,n])=>h(n)).map(([n])=>n));for(const[n,r]of[["BLOCK_KEY_GROUP",H],["KEY_GROUP",$]]){const i=Object.keys(r).filter(c=>c.startsWith(`${t}.`)).filter(c=>!p.has(c.slice(t.length+1)));if(i.length)throw new Error(`${t}: ${n} (lib/document/field-groups.ts) lists ${JSON.stringify(i)}, but no fold header by that key is in this section's panel. Either the heading was renamed or removed and the row is stale, or the row names the wrong key — an override that quietly matches nothing is worse than no override.`)}const v=g?[]:[...a].filter(n=>!C.has(n));if(v.length)throw new Error(`${t}: RETIRED (lib/document/field-groups.ts) lists ${JSON.stringify(v)}, but this section has no such fold header${v.length>1?"s":""}. Either the heading was renamed or removed and the row is stale, or the row names the wrong section — a list that quietly matches nothing is worse than no list.`);const R=new Set(o.filter(n=>n.entries.length>0).map(n=>n.place)),f=A.filter(n=>j(n).some(r=>R.has(r))),y={};for(const n of f){y[d[n]]=L(n,n===f[0]?f:null);for(const r of j(n)){if(!R.has(r))continue;const i=o.filter(u=>u.place===r),c=i.findIndex(u=>u.adopted);c>0&&i.unshift(...i.splice(c,1)),n==="Design"&&(y[b[r]]=F(r));for(const u of i)for(const[s,N]of u.entries)y[s]=de(r,N)}}return y}function Ee(e){return d.Design in e?e:{[d.Design]:L("Design",null),[b.Content]:F("Content"),...e}}function we(e){return A.some(t=>d[t]in e)}function Oe(e){const t=A.filter(a=>d[a]in e);if(t.length===0)return e;const o={...e};for(const a of t)o[d[a]]=L(a,a===t[0]?t:null);return o}export{H as BLOCK_KEY_GROUP,Se as BOUND_CARD_MEDIA_FIELD_KEYS,A as BUCKETS,d as BUCKET_KEY,ee as CARD_MEDIA_FIELD_KEYS,fe as CARD_SHOW_FIELD_KEYS,ve as CARD_STYLE_FIELD_KEYS,k as DESIGN_GROUPS,b as DESIGN_GROUP_KEY,Z as EDITOR_ONLY_GROUP,M as INJECTED_RETIRED,$ as KEY_GROUP,I as LABEL_GROUP,pe as LAYOUT_FIELD_KEYS,K as PLACE_WORDS,ne as RETIRED,_e as SECTION_ANIM_FIELD_KEYS,ke as SECTION_SHAPE_FIELD_KEYS,ye as SECTION_THEME_FIELD_KEYS,Le as assignSectionGroups,ge as bucketOf,X as bucketOfPlace,me as foldTopTier,we as hasBucketTabs,S as headerKeysOf,G as headerKeysOfPlace,_ as placeOf,Oe as reseatBucketTabs,ie as retiredHeadings,Ee as seatDesignBucket};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{encodePartKey as
|
|
1
|
+
import{encodePartKey as O}from"../../../format/lib/document/part-key.js";import{HERO_MEDIA_PART_LABELS as U,HERO_PART_ATTR as z,heroPartId as J,readHeroPartId as Q}from"../../../render/lib/document/hero-media-parts.js";import{TICKER_PART_ATTR as N,TICKER_PART_LABEL as V,readTickerPartId as X,tickerPartId as Y}from"../../../render/components/PreviewTickerContext.js";import{BLOCK_ATTRIBUTE as T}from"efficient-easel/canvas";import{decodeLocationPartId as Z,encodeLocationPartId as tt}from"../../../render/components/PreviewLocationPartContext.js";import{PART_ATTR as b,PART_KIND_ATTR as et,PART_ROW_ATTR as v,REGION_PART_ATTR as _,decodePartId as nt,encodePartId as E,encodePartRow as ot,normalizePartText as rt,partHeadLabel as st}from"../../../render/lib/document/text-parts.js";const B="data-sf-part-label";function C(c,o){return c.closest(`[${T}]`)?.getAttribute(T)===o}function H(c,o,r){const s=c.querySelectorAll("*"),l=new Map(r.map(t=>[t.key,st(t.label)])),a=[],u=new Set;for(let t=0;t<s.length;t+=1){const e=s[t];if(!C(e,o))continue;const i=e.getAttribute(et);if(!i)continue;const n=l.get(i);a.push({element:e,partId:E(o,i),...n?{label:n}:{}}),u.add(e)}const f=[],g=new Set;for(let t=0;t<s.length;t+=1){const e=s[t];if(!C(e,o)||u.has(e))continue;const i=rt(e.textContent??"");if(!i)continue;const n=e.closest(`[${v}]`)?.getAttribute(v)||null;n&&g.add(n.replace(/\[\d+\]$/u,"")),f.push({element:e,text:i,row:n})}const P=t=>f.filter(e=>e.row===ot(t.key,t.row.index)),R=f.filter(t=>t.row===null),m=t=>t.row&&g.has(t.key)?P(t):g.size?R:f,h=new Map,w=[],I=t=>t.row?`${t.key}.${t.row.rowKey}`:null,S=new Map;for(const t of r){const e=I(t);if(!e||g.has(t.key))continue;const i=S.get(e);i?i.push(t):S.set(e,[t])}const K=new Set;for(const[t,e]of S){if(e.length<2)continue;const i=e.flatMap(d=>d.texts);if(new Set(i).size===i.length)continue;const n=m(e[0]).filter(d=>i.includes(d.text));if(n.length!==e.length)continue;const A=[...e].sort((d,x)=>(d.row?.index??0)-(x.row?.index??0));for(let d=0;d<A.length;d+=1){const x=A[d],p=n[d].element,y={key:x.key,partKey:O(x.key,x.row),exact:!0},k=h.get(p);k?k.push(y):(h.set(p,[y]),w.push(p))}K.add(t)}const $=new Map;for(const t of r){if(K.has(I(t)??""))continue;const e=O(t.key,t.row);for(const i of t.texts)for(const n of m(t)){if(n.text!==i)continue;const A=$.get(n.element);A?A.add(e):$.set(n.element,new Set([e]))}}const G=(t,e)=>[...$].some(([i,n])=>i!==t&&!n.has(e)&&i.contains(t));for(const t of r){if(K.has(I(t)??""))continue;const e=O(t.key,t.row);for(const i of t.texts){const n=[];let A=null;for(const p of m(t))p.text===i?G(p.element,e)||n.push(p.element):!n.length&&p.text.includes(i)&&(!A||p.text.length<=A.length)&&(A={element:p.element,length:p.text.length});const d=n.length?n:A?[A.element]:[],x=d.filter(p=>!d.some(y=>y!==p&&p.contains(y)));for(const p of x){const y={key:t.key,partKey:e,exact:n.length>0},k=h.get(p);k?k.push(y):(h.set(p,[y]),w.push(p))}}}const L=[...a];for(const t of w){const e=h.get(t)??[],i=e.some(n=>n.exact)?e.filter(n=>n.exact):e;if(new Set(i.map(n=>n.partKey)).size===1){const n=l.get(i[0].key);L.push({element:t,partId:E(o,i[0].partKey),...n?{label:n}:{}});continue}new Set(i.map(n=>n.key)).size===1&&L.push({element:t,partId:E(o,i[0].key)})}return L}function M(c,o,r){const s=c.querySelectorAll(`[${b}]`);for(let a=0;a<s.length;a+=1){const u=s[a];C(u,o)&&(u.removeAttribute(b),u.removeAttribute(B))}const l=[];for(const{element:a,partId:u,label:f}of r)a.setAttribute(b,u),f&&a.setAttribute(B,f),l.push(a);return l}function dt(c,o,r,s,l,a=()=>null){let u=null,f=null,g=null;const P=()=>{const R=r(),m=R?.getAttribute(T)??null;if(!R||!m)return!1;u=m;let h=H(c,m,o);return l(R,m,M(c,m,h)),g=a(()=>{const w=H(c,m,o);ct(h,w)||(h=w,l(R,m,M(c,m,w)))}),!0};return P()||(f=s(()=>{(u||P())&&(f?.(),f=null)})),()=>{f?.(),f=null,g?.(),g=null,u&&M(c,u,[])}}function ct(c,o){return c.length===o.length&&c.every((r,s)=>r.element===o[s].element&&r.partId===o[s].partId)}function mt(c,o){const r=c?.closest?.(`[${b}],[${_}]`),s=r?.getAttribute(b)??r?.getAttribute(_),l=s?nt(s):null;if(r&&s&&l?.nodeId===o&&l.propKey)return{id:s,element:r,whole:F(r,s),label:W(r,s)};const a=c?.closest?.(j.slice(2).map(g=>`[${g}]`).join(","));if(!a)return null;const f=a.closest?.(`[${T}]`)?.getAttribute(T)===o?D(a,o):null;return f?{id:f,element:a,whole:F(a,f),label:W(a,f)}:null}function W(c,o){const r=Z(o);if(r)return r.part==="map"?"Map":r.part==="city"?"City":"Image";const s=Q(o);return s?U[s.part]:X(o)?V:c.getAttribute(B)??void 0}const q="data-loc-pick",j=[b,_,z,N,q];function D(c,o){const r=c.getAttribute(b)??c.getAttribute(_);if(r)return r;const s=c.getAttribute(z);if(s)return J(o,s);if(c.getAttribute(N)!==null)return Y(o);const l=c.getAttribute(q)?.split(":");return l&&(l[1]==="image"||l[1]==="map"||l[1]==="city")&&/^\d+$/.test(l[0])?tt(o,Number(l[0]),l[1]):null}function F(c,o){const r=c.closest?.(`[${T}]`),s=r?.getAttribute(T);if(!r||!s)return!1;const l=new Set;for(const a of r.querySelectorAll(j.map(u=>`[${u}]`).join(","))){if(a.closest?.(`[${T}]`)!==r)continue;const u=D(a,s);u&&l.add(u)}return l.size===1&&l.has(o)}export{q as LOCATION_PICK_ATTR,B as PART_LABEL_ATTR,M as applyPartStamps,dt as engagePartAnchors,F as isOnlyPart,W as partLabelOf,mt as partOfBlockAt,H as resolvePartStamps};
|
|
@@ -14,7 +14,10 @@ type BlockConfig = {
|
|
|
14
14
|
};
|
|
15
15
|
export declare function blockLabel(config: BlockConfig, type: string): string;
|
|
16
16
|
export declare function describeSelection(config: BlockConfig, document: AnyDocument, selectedId: string | null | undefined): EaselSelection | null;
|
|
17
|
-
export declare function describeBlocks(config: BlockConfig): Record<string,
|
|
17
|
+
export declare function describeBlocks(config: BlockConfig): Record<string, DescribedBlockType>;
|
|
18
|
+
export type DescribedBlockType = EaselBlockType & {
|
|
19
|
+
retired?: true;
|
|
20
|
+
};
|
|
18
21
|
export type ApplyResult<D> = {
|
|
19
22
|
ok: true;
|
|
20
23
|
document: D;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FIELD_DESCRIPTION_MARKER as
|
|
1
|
+
import{FIELD_DESCRIPTION_MARKER as $}from"efficient-easel/screen/lib/host";import{isNode as d}from"efficient-easel/data";import{RETIRED_SECTIONS as j}from"../../format/lib/document/section-catalog.js";import{layoutPresetFor as v}from"./sections/text-layouts.js";function u(r,t){const e=r.components[t]?.label;return typeof e=="string"&&e.trim()?e.trim():t}function O(r){return r.length>3&&r.endsWith("s")?r.slice(0,-1):r}function b(r,t,e,o){r.forEach((s,i)=>{if(d(s)){o.push({node:s,list:r,index:i,parent:t,slot:e});for(const[n,l]of Object.entries(s.props))Array.isArray(l)&&l.some(d)&&b(l,s,n,o)}})}function E(r){const t=[];b(Array.isArray(r.content)?r.content:[],null,"",t);for(const e of Object.values(r.zones??{}))Array.isArray(e)&&b(e,null,"",t);return t}function h(r,t){return E(r).find(e=>String(e.node.props.id)===t)}function P(r,t,e){if(!e)return null;const o=h(t,e);if(!o)return null;const s=u(r,o.node.type),i=o.parent?`${u(r,o.parent.type)} · ${O(o.slot)} ${o.index+1}`:s;return{blockId:e,type:o.node.type,label:i,path:""}}const x=r=>r.filter(t=>!!t&&typeof t=="object"&&"value"in t).map(t=>typeof t.label=="string"?{value:t.value,label:t.label}:{value:t.value});function w(r){if(!r||typeof r!="object")return null;const t=r;if(typeof t.type!="string")return null;const e=t.type==="custom"?t[$]:void 0,o={type:e?.type??t.type},s=e?.label??t.label;typeof s=="string"&&(o.label=s);const i=e?.options??t.options;Array.isArray(i)&&(o.options=x(i));for(const n of["arrayFields","objectFields"]){const l=e?.[n]??t[n];l&&typeof l=="object"&&(o[n]=k(l))}return o}function k(r){const t={};for(const[e,o]of Object.entries(r??{})){const s=w(o);s&&(t[e]=s)}return t}function N(r){const t={};for(const[e,o]of Object.entries(r.components))o&&(t[e]={label:u(r,e),fields:k(o.fields),...m(e)?{retired:!0}:{}});return t}function m(r){return Object.prototype.hasOwnProperty.call(j,r)}function A(r,t){const e=r.components[t]?.defaultProps;return e&&typeof e=="object"?structuredClone(e):{}}function F(r,t){let e=r;for(const o of t?t.split("."):[]){const s=/^([A-Za-z_][A-Za-z0-9_]*)(?:\[(\d+)\])?$/.exec(o);if(!s||!e||typeof e!="object")return null;e=e[s[1]],s[2]!==void 0&&(e=Array.isArray(e)?e[Number(s[2])]:void 0)}return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function y(r,t){return r.findIndex(e=>d(e)&&String(e.props.id)===t)}function g(r,t,e){const o=t||e;if(!o)return r.length;const s=y(r,o);if(s<0)throw new Error(`there is no top-level block ${o}`);return t?s+1:s}function z(r,t,e,o){const s=structuredClone(t),i=Array.isArray(s.content)?s.content:s.content=[];try{e.forEach((n,l)=>{const a=c=>{throw new Error(`change ${l+1}: ${c}`)};switch(n.op){case"set_props":{const c=h(s,n.block_id)??a(`there is no block ${n.block_id}`);"id"in n.props&&a("a block's id is never changed");const f=F(c.node.props,n.path)??a(`there is no ${n.path} in that block`);Object.assign(f,structuredClone(n.props));break}case"insert_block":{r.components[n.type]??a(`there is no block type ${n.type}`),m(n.type)&&a(`${u(r,n.type)} is retired: it is no longer added (a page that holds one keeps it)`);const c=v(n.type),f=Object.keys(n.props??{}).filter(p=>p!=="id");c&&f.length&&a(`${u(r,n.type)} is laid down as a Box of blocks: insert it with no props, then change its blocks`);const _=c?c(p=>A(r,p),o):{type:n.type,props:{...A(r,n.type),...structuredClone(n.props),id:o(n.type)}};i.splice(g(i,n.after,n.before),0,_);break}case"remove_block":{const c=y(i,n.block_id);c<0&&a(`there is no top-level block ${n.block_id}`),i.splice(c,1);break}case"move_block":{const c=y(i,n.block_id);c<0&&a(`there is no top-level block ${n.block_id}`);const[f]=i.splice(c,1);i.splice(g(i,n.after,n.before),0,f);break}default:a(`"${n.op}" is not a change this editor makes`)}})}catch(n){return{ok:!1,reason:n instanceof Error?n.message:String(n)}}return{ok:!0,document:s}}export{z as applyPageEdits,u as blockLabel,N as describeBlocks,P as describeSelection};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type SectionToBoxRow } from "../../../render/lib/sections/section-to-box.js";
|
|
2
2
|
import { type SectionPreset } from "../../../format/lib/sections/section-presets.js";
|
|
3
3
|
export declare const TEXT_LAYOUTS: readonly string[];
|
|
4
|
-
export declare
|
|
4
|
+
export declare const MERGE_LAYOUTS: Readonly<Record<string, () => Readonly<Record<string, unknown>>>>;
|
|
5
|
+
export declare function conversionPreset(type: string, row: SectionToBoxRow, piece?: number, starter?: () => Readonly<Record<string, unknown>>): SectionPreset;
|
|
5
6
|
export declare function layoutPresetFor(type: string, press?: readonly string[]): SectionPreset | null;
|
|
6
7
|
export declare function layoutTypes(): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{convertSection as u,pressesAsBox as
|
|
1
|
+
import{convertSection as u,pressesAsBox as c,SECTION_TO_BOX_PRESS as O,sectionToBoxRow as T}from"../../../render/lib/sections/section-to-box.js";import{SECTION_PRESETS as m,presetFor as E}from"../../../format/lib/sections/section-presets.js";import{GENERAL_SECTION_TO_BOX as S}from"../../../render/lib/document/blocks/general/section-to-box-rows.js";import{logosPressStarter as _}from"../../../render/lib/document/blocks/general/section-to-box-rows-logos.js";import{isNodeList as l}from"efficient-easel/data";const x=Object.keys(S),p={Logos:_};function f(r,o,t){const e={};for(const s of Object.keys(o(r.type)))e[s]=void 0;for(const[s,n]of Object.entries(r.props))e[s]=l(n)?n.map(i=>f(i,o,t)):n;return e.id=t(r.type),{type:r.type,props:e}}function k(r,o,t=0,e=()=>({})){return(s,n)=>{const{nodes:i}=u({type:r,props:{...s(r),...e(),id:n(r)}},o,{press:!0});return f(i[t],s,n)}}function P(r,o){if(!c(r,o))return null;const t=T(r);return t?k(r,t,0,p[r]):null}function R(r,o=O){return E(r)??P(r,o)}function A(){return[...Object.keys(m),...x.filter(r=>c(r)),...Object.keys(p).filter(r=>c(r))]}export{p as MERGE_LAYOUTS,x as TEXT_LAYOUTS,k as conversionPreset,R as layoutPresetFor,A as layoutTypes};
|
|
@@ -16,7 +16,7 @@ export interface BlockSourceSpec {
|
|
|
16
16
|
sample?: readonly SourceRow[];
|
|
17
17
|
choices?: readonly SourceChoice[];
|
|
18
18
|
fields?: readonly SourceFieldSpec[];
|
|
19
|
-
edit?: SourceEditLink;
|
|
19
|
+
edit?: SourceEditLink | SourceEditAction;
|
|
20
20
|
}
|
|
21
21
|
export interface SourceFieldSpec {
|
|
22
22
|
key: string;
|
|
@@ -27,6 +27,11 @@ export interface SourceEditLink {
|
|
|
27
27
|
label: string;
|
|
28
28
|
href: string;
|
|
29
29
|
}
|
|
30
|
+
export interface SourceEditAction {
|
|
31
|
+
label: string;
|
|
32
|
+
open: () => void;
|
|
33
|
+
}
|
|
34
|
+
export declare function isSourceEditAction(link: SourceEditLink | SourceEditAction): link is SourceEditAction;
|
|
30
35
|
export declare function registerBlockSources(sources: readonly BlockSourceSpec[]): void;
|
|
31
36
|
export declare function blockSources(block?: string): readonly BlockSourceSpec[];
|
|
32
37
|
export declare function blockSourceSpec(key: string): BlockSourceSpec | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{globalRegistry as
|
|
1
|
+
import{globalRegistry as c}from"../global-registry.js";import{nonEmptyString as a}from"../non-empty-string.js";const f="dataSource",R="dataSourceOptions",u="dataRows",E="countKey",A="counts";function p(e){return typeof e.open=="function"}const y=/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;function s(){return c("efficient.block-sources",()=>({sources:new Map,revision:0}))}const b=e=>[e?.key,e?.label,e?.value].every(t=>typeof t=="string"&&t.trim()!==""),m=e=>[e?.key,e?.label].every(t=>typeof t=="string"&&t.trim()!==""),l=e=>typeof e=="string"&&e.trim()!=="";function k(e){if(!e||!l(e.label))return null;if(p(e))return{label:e.label.trim(),open:e.open};const t=e.href;return l(t)?{label:e.label.trim(),href:t.trim()}:null}function h(e){if(typeof e.key!="string"||!y.test(e.key))throw new Error(`A block source key is lower-case words joined by hyphens, not ${JSON.stringify(e.key)}.`);if(typeof e.label!="string"||!e.label.trim())throw new Error(`The block source ${e.key} has no label.`);if(!Array.isArray(e.blocks)||!e.blocks.length||e.blocks.some(r=>typeof r!="string"||!r))throw new Error(`The block source ${e.key} names no block it can fill.`);const t=k(e.edit);return{key:e.key,label:e.label.trim(),blocks:[...e.blocks],...e.sample?{sample:e.sample.map(r=>i(r)).filter(r=>r!==null)}:{},...Array.isArray(e.choices)?{choices:e.choices.filter(b)}:{},...Array.isArray(e.fields)?{fields:e.fields.filter(m).map(r=>({...r}))}:{},...t?{edit:t}:{}}}function C(e){const t=e.map(h),r=s();for(const o of t)r.sources.set(o.key,o);t.length&&(r.revision+=1)}function _(e){const t=[...s().sources.values()];return e===void 0?t:t.filter(r=>r.blocks.includes(e))}function d(e){return s().sources.get(e)??null}function v(e){return s().sources.get(e)?.choices??[]}function w(){return s().revision}function O(e){const t=e?.[f];return typeof t=="string"?t.trim():""}function i(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t={};for(const[r,o]of Object.entries(e)){const n=a(o);n&&(t[r]=n)}return Object.keys(t).length?t:null}function S(e){const t=e?.[u];return Array.isArray(t)?t.map(i).filter(r=>r!==null):null}function P(e,t,r=[]){const o=S(e);if(o!==null&&(o.length||!t))return{rows:o,sample:!1};if(!t)return{rows:[],sample:!1};const n=d(O(e))?.sample;return{rows:n?.length?n:r,sample:!0}}export{R as BLOCK_SOURCE_OPTIONS_PROP,f as BLOCK_SOURCE_PROP,u as BLOCK_SOURCE_ROWS_PROP,A as COUNTS_SOURCE,E as COUNT_KEY_PROP,d as blockSourceSpec,_ as blockSources,w as blockSourcesRevision,O as declaredBlockSource,p as isSourceEditAction,C as registerBlockSources,S as servedRows,v as sourceChoices,P as sourcedRows};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CSSProperties } from "react";
|
|
2
|
+
import { type ViewVarNames } from "./view-var-split.js";
|
|
2
3
|
export declare const CARD_SHADOW_CLASS = "sf-card";
|
|
3
4
|
export declare const BOX_DARKEN: {
|
|
4
5
|
readonly min: 0;
|
|
@@ -28,4 +29,22 @@ export declare const BOX_CARD_SIDE: {
|
|
|
28
29
|
};
|
|
29
30
|
export declare function isBackgroundBox(src?: string | null): boolean;
|
|
30
31
|
export declare function boxDarkenStyle(darken: unknown, style?: unknown): CSSProperties | null;
|
|
32
|
+
export declare const boxFillOf: (value: unknown) => string | null;
|
|
33
|
+
export declare const BOX_FILL_VIEWS: ViewVarNames;
|
|
34
|
+
export declare function boxFillViews(fill: unknown, fillTablet: unknown, fillPhone: unknown): {
|
|
35
|
+
className: string;
|
|
36
|
+
style: CSSProperties;
|
|
37
|
+
};
|
|
38
|
+
export declare const BOX_WASH_VIEWS: ViewVarNames;
|
|
39
|
+
export declare function boxWashViews(views: {
|
|
40
|
+
darken: unknown;
|
|
41
|
+
darkenStyle: unknown;
|
|
42
|
+
darkenTablet: unknown;
|
|
43
|
+
darkenStyleTablet: unknown;
|
|
44
|
+
darkenPhone: unknown;
|
|
45
|
+
darkenStylePhone: unknown;
|
|
46
|
+
}): {
|
|
47
|
+
className: string;
|
|
48
|
+
style: CSSProperties;
|
|
49
|
+
};
|
|
31
50
|
export declare function boxPlacementClasses(anchor: string, direction: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{scrim as
|
|
1
|
+
import{parseHexColor as h}from"efficient-shell/format";import{scrim as p}from"./scrim.js";import{viewVarSplit as b}from"./view-var-split.js";const C="sf-card",S={min:0,max:100,step:5,fallback:0,unit:"%"},_=[{label:"Even",value:"even"},{label:"From the bottom",value:"bottom"}],g="68%",E={desktop:20,phone:20,side:40,sidePhone:24},B="sf-box-sides",F={min:0,max:200,step:10};function N(t){return typeof t=="string"&&t.trim()!==""}function x(t,o){const e=typeof t=="number"?t:Number.parseFloat(String(t??""));if(!Number.isFinite(e)||e<=0)return null;const r=(Math.min(S.max,Math.max(S.min,e))/100).toFixed(2);return o!=="bottom"?{background:p(Number(r))}:{background:`linear-gradient(0deg, ${p(Number(r))} 0%, ${p(0)} ${g})`}}const d=t=>typeof t=="string"?h(t.trim()):null,k={tabletClass:"sf-fill-tablet",tabletVar:"--sf-fill-tablet",phoneClass:"sf-fill-phone",phoneVar:"--sf-fill-phone"};function T(t,o,e){return b(k,d(t),d(o),d(e))}const y={tabletClass:"sf-wash-tablet",tabletVar:"--sf-wash-tablet",phoneClass:"sf-wash-phone",phoneVar:"--sf-wash-phone"};function V(t){const o=x(t.darken,t.darkenStyle);if(!o)return{className:"",style:{}};const e=(n,f)=>String(x(n,f)?.background??"none"),s=n=>(typeof n=="number"||typeof n=="string"&&n.trim()!=="")&&Number.isFinite(Number(n))?n:void 0,r=n=>_.some(f=>f.value===n)?n:void 0,[a,l,i,c]=[s(t.darkenTablet),r(t.darkenStyleTablet),s(t.darkenPhone),r(t.darkenStylePhone)],u=a??t.darken,m=l??t.darkenStyle;return b(y,String(o.background),a!==void 0||l!==void 0?e(u,m):null,i!==void 0||c!==void 0?e(i??u,c??m):null)}function P(t,o){const e={"top-left":["start","start"],"top-center":["center","start"],"top-right":["end","start"],left:["start","center"],center:["center","center"],right:["end","center"],"bottom-left":["start","end"],"bottom-center":["center","end"],"bottom-right":["end","end"]},[s,r]=e[t]??e.center,[a,l]=o==="column"?[r,s]:[s,r],i={start:"justify-start",center:"justify-center",end:"justify-end"},c={start:"items-start",center:"items-center",end:"items-end"};return`${i[a]} ${c[l]}`}export{E as BOX_CARD_PAD,F as BOX_CARD_SIDE,S as BOX_DARKEN,_ as BOX_DARKEN_STYLES,k as BOX_FILL_VIEWS,B as BOX_OWNS_SIDES_CLASS,y as BOX_WASH_VIEWS,C as CARD_SHADOW_CLASS,x as boxDarkenStyle,d as boxFillOf,T as boxFillViews,P as boxPlacementClasses,V as boxWashViews,N as isBackgroundBox};
|
|
@@ -37,6 +37,8 @@ export declare const BOX_SHARE_POINTS: readonly [{
|
|
|
37
37
|
readonly weights: readonly [2, 3];
|
|
38
38
|
}];
|
|
39
39
|
export type BoxShare = (typeof BOX_SHARE_POINTS)[number]["value"];
|
|
40
|
+
export declare const BOX_ITEMS_ATTR = "data-sf-box-items";
|
|
41
|
+
export declare function withoutBoxItemsHalf(text: string): string;
|
|
40
42
|
export declare const BOX_SHARE_CHOICES: readonly [{
|
|
41
43
|
readonly label: "Fit content";
|
|
42
44
|
readonly value: "content";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isStripBox as f}from"./box-separator.js";import{viewOverrides as y}from"./view-overrides.js";const te={sectionPaddingTop:0,sectionPaddingBottom:0},p={start:"justify-start",center:"justify-center",between:"justify-between",end:"justify-end"},v={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"};function ie(e,t){const n=typeof e=="string"&&e in p?p[e]:"",i=typeof t=="string"&&t in v?v[t]:"";return[n,i].filter(Boolean).join(" ")}function B(e){return e===!0||e==="wrap"?"flex-wrap":""}const N={start:"view-tablet:max-view-desktop:justify-start!",center:"view-tablet:max-view-desktop:justify-center!",between:"view-tablet:max-view-desktop:justify-between!",end:"view-tablet:max-view-desktop:justify-end!"},T={start:"max-view-tablet:justify-start",center:"max-view-tablet:justify-center",between:"max-view-tablet:justify-between",end:"max-view-tablet:justify-end"},P={start:"view-tablet:max-view-desktop:items-start!",center:"view-tablet:max-view-desktop:items-center!",end:"view-tablet:max-view-desktop:items-end!",stretch:"view-tablet:max-view-desktop:items-stretch!"},R={start:"max-view-tablet:items-start",center:"max-view-tablet:items-center",end:"max-view-tablet:items-end",stretch:"max-view-tablet:items-stretch"},I={wrap:"view-tablet:max-view-desktop:flex-wrap!",nowrap:"view-tablet:max-view-desktop:flex-nowrap!"};function s(e,t){return typeof t=="string"&&Object.prototype.hasOwnProperty.call(e,t)?t:void 0}function h(e,t,n){const i=y("same",e,t,n),a={};return i.tablet!==void 0&&i.tablet!==e&&(a.tablet=i.tablet),i.phone!==void 0&&i.phone!==e&&(a.phone=i.phone),a}function u(e,t,n){return[e.tablet?t[e.tablet]:"",e.phone?n[e.phone]:""].filter(Boolean).join(" ")}function H(e,t,n){return h(s(p,e)??"start",s(p,t),s(p,n))}function ne(e,t,n){return u(H(e,t,n),N,T)}function ae(e,t,n){const i=s(v,e)??"stretch";if(i==="stretch")return"";const a=h(i,s(v,t),s(v,n));return u(a,P,R)}function $(e){if(e===!0||e==="wrap")return"wrap";if(e===!1||e==="nowrap")return"nowrap"}function oe(e,t){const n=B(e)===""?"nowrap":"wrap",i=$(t);return i&&i!==n?I[i]:""}const re="Block widths",m=[{label:"Fit content",value:"content",weights:null},{label:"Equal",value:"equal",weights:[1,1]},{value:"bigLeft",weights:[2,1]},{value:"bigRight",weights:[1,2]},{value:"biggerLeft",weights:[3,1]},{value:"biggerRight",weights:[1,3]},{value:"twoThree",weights:[2,3]}],se=[{label:"Fit content",value:"content",weights:null},{label:"Equal",value:"equal",weights:[1,1]},{label:"Custom",value:"custom",weights:[2,1]}];function le(e){return Array.isArray(e)?"custom":e==="equal"?"equal":typeof e=="string"&&e in x?"custom":"content"}const _=4,g=10;function X(e,t){if(!Number.isInteger(t)||t<2||t>_||e.length!==t-1||!e.every(a=>typeof a=="number"&&Number.isFinite(a)))return;const n=[];let i=0;return e.forEach((a,o)=>{const r=100-i-g*(t-1-o),d=Math.min(r,Math.max(g,Math.round(a)));n.push(d),i+=d}),n}function S(e,t,n){if(!Array.isArray(t))return;const i=X(t,n),a=i?[...i,100-i.reduce((r,d)=>r+d,0)]:[],o={};for(let r=0;r<_;r+=1)o[`--${e}-${r+1}`]=a[r]??1;return o}function we(e,t,n){const i=S("sf-share",e,n),a=S("sf-share-tablet",t,n);return i||a?{...i,...a}:void 0}function W(e,t){const n=Array.from({length:t},()=>1),i=m.find(r=>r.value===e);if(!i?.weights||t<1)return n;const[a,o]=i.weights;return a>1&&(n[0]=a),o>1&&(n[t-1]=o),n}function ce(e,t){if(typeof e!="string"||!(e in x)||e==="equal")return e;const n=W(e,t),i=n.reduce((a,o)=>a+o,0);return n.slice(0,-1).map(a=>Math.round(a/i*100))}const l="[&>*]:min-w-0 [&>*]:flex-1 [&>*]:basis-0",x={equal:l,bigLeft:`${l} [&>*:first-child]:view-wide:grow-[2]`,bigRight:`${l} [&>*:last-child]:view-wide:grow-[2]`,biggerLeft:`${l} [&>*:first-child]:view-wide:grow-[3]`,biggerRight:`${l} [&>*:last-child]:view-wide:grow-[3]`,twoThree:`${l} [&>*:first-child]:view-wide:grow-[2] [&>*:last-child]:view-wide:grow-[3]`},M=`${l} [&>*:nth-child(1)]:view-wide:grow-[var(--sf-share-1,1)] [&>*:nth-child(2)]:view-wide:grow-[var(--sf-share-2,1)] [&>*:nth-child(3)]:view-wide:grow-[var(--sf-share-3,1)] [&>*:nth-child(4)]:view-wide:grow-[var(--sf-share-4,1)]`;function j(e){return Array.isArray(e)?M:typeof e=="string"?x[e]??"":""}const pe={all:[{context:"parentType",is:"Flex"},{context:"parent.direction",is:"row"},{any:[{not:{context:"parent.align",set:!0}},{context:"parent.align",is:"stretch"}]},{not:{context:"parent.separator",set:!0}},{not:{context:"parent.loop",is:"scroll"}},{not:{context:"parent.line",is:!0}},{not:{context:"parent.bgImage",set:!0}},{any:[{context:"parent.columns",in:[2,3,4,5,6]},{all:[{not:{context:"parent.columns",is:1}},{context:"parent.share",in:Object.keys(x)}]}]}]},A="view-tablet:max-view-desktop:flex-row!",w=`${A} [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-0!`,O={content:`${A} [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[content]!`,equal:w,bigLeft:`${w} [&>*:first-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[2]!`,bigRight:`${w} [&>*:last-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[2]!`,biggerLeft:`${w} [&>*:first-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[3]!`,biggerRight:`${w} [&>*:last-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[3]!`,twoThree:`${w} [&>*:first-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[2]! [&>*:last-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[3]!`},U=`${w} [&>*:nth-child(1):nth-child(n)]:view-tablet:max-view-desktop:grow-[var(--sf-share-tablet-1,1)]! [&>*:nth-child(2):nth-child(n)]:view-tablet:max-view-desktop:grow-[var(--sf-share-tablet-2,1)]! [&>*:nth-child(3):nth-child(n)]:view-tablet:max-view-desktop:grow-[var(--sf-share-tablet-3,1)]! [&>*:nth-child(4):nth-child(n)]:view-tablet:max-view-desktop:grow-[var(--sf-share-tablet-4,1)]!`;function F(e){return Array.isArray(e)||typeof e=="string"&&e in O?e:null}function ve(e){if(e.direction!=="row"||f(e.direction,e.separator)||e.loop==="scroll"||e.line===!0||C(e.columns)!==""||L(e.columnsTablet)!=="")return"";const t=F(e.shareTablet);return t===null?"":typeof t=="string"?O[t]:U}const G="[&>*]:view-wide:basis-[content]";function de(e){return j(e)===""?G:""}const xe="Columns",fe=1,he=3,b={2:"max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px)))/2)]",3:"max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px))_*_2)/3)]"},ue=m.filter(e=>e.value==="content"||e.value==="equal"),be="equal",me=1,_e=6,c="view-wide:flex-wrap [&>*]:view-wide:min-w-0 [&>*]:view-wide:grow-0!",q={1:`${c} [&>*]:view-wide:basis-[calc(100%/1)]!`,2:`${c} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px))/2)]!`,3:`${c} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_2)/3)]!`,4:`${c} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_3)/4)]!`,5:`${c} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_4)/5)]!`,6:`${c} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_5)/6)]!`};function C(e){return typeof e=="number"?q[e]??"":""}const V={1:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc(100%/1)]!",2:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px)))/2)]!",3:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_2)/3)]!",4:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_3)/4)]!",5:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_4)/5)]!",6:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_5)/6)]!"};function L(e){return typeof e=="number"?V[e]??"":""}function ge(e){return e.direction!=="row"||f(e.direction,e.separator)||e.loop==="scroll"||e.line===!0?"":L(e.columnsTablet)}function Se(e){return e.direction!=="row"||f(e.direction,e.separator)||e.loop==="scroll"||e.line===!0?"":C(e.columns)}const J="max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:grow-0 [&>*]:max-view-wide:basis-[content]",K={2:"max-view-wide:flex-nowrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px)))/2)]",3:"max-view-wide:flex-nowrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px))_*_2)/3)]"},D="max-view-wide:flex-nowrap [&>*]:max-view-wide:grow-0 [&>*]:max-view-wide:basis-[content]";function Y(e){return e===!1||e==="nowrap"}function Ae(e,t,n){const i=b[Number(e)];if(!i)return"max-view-wide:flex-col";const a=Y(n);return k(e,t)?a?D:J:a?K[Number(e)]:i}function Oe(e,t){return Number(e)in b&&!k(e,t)}function k(e,t){return Number(e)in b&&t==="content"}const Ce="Block spacing",Le=[{label:"Each block",value:"each"},{label:"Gap only",value:"gap"}],Q="sf-box-gap-only";function ke(e){return e==="gap"?Q:""}const E={each:"sf-box-each-tablet",gap:"sf-box-gap-only-tablet"},z={each:"sf-box-each-phone",gap:"sf-box-gap-only-phone"};function Ee(e,t,n){const i=o=>s(E,o),a=h(e==="gap"?"gap":"each",i(t),i(n));return u(a,E,z)}export{v as BOX_ALIGN_CLASS,Ce as BOX_BLOCK_SPACING_LABEL,Le as BOX_BLOCK_SPACING_POINTS,_e as BOX_COLUMNS_MAX,me as BOX_COLUMNS_MIN,Q as BOX_GAP_ONLY_CLASS,pe as BOX_GIVES_PICTURES_A_HEIGHT,xe as BOX_PHONE_ROW_LABEL,he as BOX_PHONE_ROW_MAX,fe as BOX_PHONE_ROW_MIN,se as BOX_SHARE_CHOICES,re as BOX_SHARE_LABEL,be as BOX_SHARE_PHONE_DEFAULT,ue as BOX_SHARE_PHONE_POINTS,m as BOX_SHARE_POINTS,te as NESTED_BOX_PADDING,ae as boxAlignViewClasses,ke as boxBlockSpacingClass,Ee as boxBlockSpacingViewClasses,C as boxColumnsClass,de as boxFitContentClass,ne as boxJustifyViewClasses,ie as boxLayoutClasses,Oe as boxPhoneCellsShareLine,Ae as boxPhoneRowClasses,k as boxPhoneRowFits,Y as boxPhoneRowOneLine,Se as boxRowColumnsClass,ge as boxRowTabletColumnsClass,ve as boxRowTabletShareClass,le as boxShareChoiceOf,j as boxShareClasses,F as boxShareTabletOf,we as boxShareVars,ce as boxShareWidthsOf,L as boxTabletColumnsClass,B as boxWrapClass,oe as boxWrapTabletClass,$ as boxWrapWordOf};
|
|
1
|
+
import{isStripBox as b}from"./box-separator.js";import{viewOverrides as T}from"./view-overrides.js";const ae={sectionPaddingTop:0,sectionPaddingBottom:0},c={start:"justify-start",center:"justify-center",between:"justify-between",end:"justify-end"},v={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"};function se(e,t){const a=typeof e=="string"&&e in c?c[e]:"",i=typeof t=="string"&&t in v?v[t]:"";return[a,i].filter(Boolean).join(" ")}function B(e){return e===!0||e==="wrap"?"flex-wrap":""}const y={start:"view-tablet:max-view-desktop:justify-start!",center:"view-tablet:max-view-desktop:justify-center!",between:"view-tablet:max-view-desktop:justify-between!",end:"view-tablet:max-view-desktop:justify-end!"},N={start:"max-view-tablet:justify-start",center:"max-view-tablet:justify-center",between:"max-view-tablet:justify-between",end:"max-view-tablet:justify-end"},P={start:"view-tablet:max-view-desktop:items-start!",center:"view-tablet:max-view-desktop:items-center!",end:"view-tablet:max-view-desktop:items-end!",stretch:"view-tablet:max-view-desktop:items-stretch!"},R={start:"max-view-tablet:items-start",center:"max-view-tablet:items-center",end:"max-view-tablet:items-end",stretch:"max-view-tablet:items-stretch"},I={wrap:"view-tablet:max-view-desktop:flex-wrap!",nowrap:"view-tablet:max-view-desktop:flex-nowrap!"};function w(e,t){return typeof t=="string"&&Object.prototype.hasOwnProperty.call(e,t)?t:void 0}function f(e,t,a){const i=T("same",e,t,a),s={};return i.tablet!==void 0&&i.tablet!==e&&(s.tablet=i.tablet),i.phone!==void 0&&i.phone!==e&&(s.phone=i.phone),s}function h(e,t,a){return[e.tablet?t[e.tablet]:"",e.phone?a[e.phone]:""].filter(Boolean).join(" ")}function H(e,t,a){return f(w(c,e)??"start",w(c,t),w(c,a))}function ne(e,t,a){return h(H(e,t,a),y,N)}function oe(e,t,a){const i=w(v,e)??"stretch";if(i==="stretch")return"";const s=f(i,w(v,t),w(v,a));return h(s,P,R)}function $(e){if(e===!0||e==="wrap")return"wrap";if(e===!1||e==="nowrap")return"nowrap"}function we(e,t){const a=B(e)===""?"nowrap":"wrap",i=$(t);return i&&i!==a?I[i]:""}const le="Block widths",_=[{label:"Fit content",value:"content",weights:null},{label:"Equal",value:"equal",weights:[1,1]},{value:"bigLeft",weights:[2,1]},{value:"bigRight",weights:[1,2]},{value:"biggerLeft",weights:[3,1]},{value:"biggerRight",weights:[1,3]},{value:"twoThree",weights:[2,3]}],X="data-sf-box-items",M=new RegExp(`[ \\t]+[^\\s"'\`]*\\[${X}\\][^\\s"'\`]*`,"g");function re(e){return e.replace(M,"")}const de=[{label:"Fit content",value:"content",weights:null},{label:"Equal",value:"equal",weights:[1,1]},{label:"Custom",value:"custom",weights:[2,1]}];function ce(e){return Array.isArray(e)?"custom":e==="equal"?"equal":typeof e=="string"&&e in p?"custom":"content"}const g=4,u=10;function W(e,t){if(!Number.isInteger(t)||t<2||t>g||e.length!==t-1||!e.every(s=>typeof s=="number"&&Number.isFinite(s)))return;const a=[];let i=0;return e.forEach((s,n)=>{const o=100-i-u*(t-1-n),x=Math.min(o,Math.max(u,Math.round(s)));a.push(x),i+=x}),a}function k(e,t,a){if(!Array.isArray(t))return;const i=W(t,a),s=i?[...i,100-i.reduce((o,x)=>o+x,0)]:[],n={};for(let o=0;o<g;o+=1)n[`--${e}-${o+1}`]=s[o]??1;return n}function ve(e,t,a){const i=k("sf-share",e,a),s=k("sf-share-tablet",t,a);return i||s?{...i,...s}:void 0}function j(e,t){const a=Array.from({length:t},()=>1),i=_.find(o=>o.value===e);if(!i?.weights||t<1)return a;const[s,n]=i.weights;return s>1&&(a[0]=s),n>1&&(a[t-1]=n),a}function xe(e,t){if(typeof e!="string"||!(e in p)||e==="equal")return e;const a=j(e,t),i=a.reduce((s,n)=>s+n,0);return a.slice(0,-1).map(s=>Math.round(s/i*100))}const l="[&>*]:min-w-0 [&>[data-sf-box-items]>*]:min-w-0 [&>*]:flex-1 [&>[data-sf-box-items]>*]:flex-1 [&>*]:basis-0 [&>[data-sf-box-items]>*]:basis-0",p={equal:l,bigLeft:`${l} [&>*:first-child]:view-wide:grow-[2] [&>[data-sf-box-items]:first-child>*:first-child]:view-wide:grow-[2]`,bigRight:`${l} [&>*:last-child]:view-wide:grow-[2] [&>[data-sf-box-items]:last-child>*:last-child]:view-wide:grow-[2]`,biggerLeft:`${l} [&>*:first-child]:view-wide:grow-[3] [&>[data-sf-box-items]:first-child>*:first-child]:view-wide:grow-[3]`,biggerRight:`${l} [&>*:last-child]:view-wide:grow-[3] [&>[data-sf-box-items]:last-child>*:last-child]:view-wide:grow-[3]`,twoThree:`${l} [&>*:first-child]:view-wide:grow-[2] [&>[data-sf-box-items]:first-child>*:first-child]:view-wide:grow-[2] [&>*:last-child]:view-wide:grow-[3] [&>[data-sf-box-items]:last-child>*:last-child]:view-wide:grow-[3]`},U=`${l} [&>*:nth-child(1)]:view-wide:grow-[var(--sf-share-1,1)] [&>[data-sf-box-items]>*:nth-child(1)]:view-wide:grow-[var(--sf-share-1,1)] [&>*:nth-child(2)]:view-wide:grow-[var(--sf-share-2,1)] [&>[data-sf-box-items]>*:nth-child(2)]:view-wide:grow-[var(--sf-share-2,1)] [&>*:nth-child(3)]:view-wide:grow-[var(--sf-share-3,1)] [&>[data-sf-box-items]>*:nth-child(3)]:view-wide:grow-[var(--sf-share-3,1)] [&>*:nth-child(4)]:view-wide:grow-[var(--sf-share-4,1)] [&>[data-sf-box-items]>*:nth-child(4)]:view-wide:grow-[var(--sf-share-4,1)]`;function F(e){return Array.isArray(e)?U:typeof e=="string"?p[e]??"":""}const pe={all:[{context:"parentType",is:"Flex"},{context:"parent.direction",is:"row"},{any:[{not:{context:"parent.align",set:!0}},{context:"parent.align",is:"stretch"}]},{not:{context:"parent.separator",set:!0}},{not:{context:"parent.loop",is:"scroll"}},{not:{context:"parent.line",is:!0}},{not:{context:"parent.bgImage",set:!0}},{any:[{context:"parent.columns",in:[2,3,4,5,6]},{all:[{not:{context:"parent.columns",is:1}},{context:"parent.share",in:Object.keys(p)}]}]}]},S="view-tablet:max-view-desktop:flex-row!",r=`${S} [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>[data-sf-box-items]>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow! [&>[data-sf-box-items]>*:nth-child(n)]:view-tablet:max-view-desktop:grow! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-0! [&>[data-sf-box-items]>*:nth-child(n)]:view-tablet:max-view-desktop:basis-0!`,A={content:`${S} [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>[data-sf-box-items]>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[content]! [&>[data-sf-box-items]>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[content]!`,equal:r,bigLeft:`${r} [&>*:first-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[2]! [&>[data-sf-box-items]:first-child>*:first-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[2]!`,bigRight:`${r} [&>*:last-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[2]! [&>[data-sf-box-items]:last-child>*:last-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[2]!`,biggerLeft:`${r} [&>*:first-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[3]! [&>[data-sf-box-items]:first-child>*:first-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[3]!`,biggerRight:`${r} [&>*:last-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[3]! [&>[data-sf-box-items]:last-child>*:last-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[3]!`,twoThree:`${r} [&>*:first-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[2]! [&>[data-sf-box-items]:first-child>*:first-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[2]! [&>*:last-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[3]! [&>[data-sf-box-items]:last-child>*:last-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[3]!`},G=`${r} [&>*:nth-child(1):nth-child(n)]:view-tablet:max-view-desktop:grow-[var(--sf-share-tablet-1,1)]! [&>[data-sf-box-items]>*:nth-child(1):nth-child(n)]:view-tablet:max-view-desktop:grow-[var(--sf-share-tablet-1,1)]! [&>*:nth-child(2):nth-child(n)]:view-tablet:max-view-desktop:grow-[var(--sf-share-tablet-2,1)]! [&>[data-sf-box-items]>*:nth-child(2):nth-child(n)]:view-tablet:max-view-desktop:grow-[var(--sf-share-tablet-2,1)]! [&>*:nth-child(3):nth-child(n)]:view-tablet:max-view-desktop:grow-[var(--sf-share-tablet-3,1)]! [&>[data-sf-box-items]>*:nth-child(3):nth-child(n)]:view-tablet:max-view-desktop:grow-[var(--sf-share-tablet-3,1)]! [&>*:nth-child(4):nth-child(n)]:view-tablet:max-view-desktop:grow-[var(--sf-share-tablet-4,1)]! [&>[data-sf-box-items]>*:nth-child(4):nth-child(n)]:view-tablet:max-view-desktop:grow-[var(--sf-share-tablet-4,1)]!`;function q(e){return Array.isArray(e)||typeof e=="string"&&e in A?e:null}function be(e){if(e.direction!=="row"||b(e.direction,e.separator)||e.loop==="scroll"||e.line===!0||O(e.columns)!==""||C(e.columnsTablet)!=="")return"";const t=q(e.shareTablet);return t===null?"":typeof t=="string"?A[t]:G}const V="[&>*]:view-wide:basis-[content] [&>[data-sf-box-items]>*]:view-wide:basis-[content]";function fe(e){return F(e)===""?V:""}const he="Columns",me=1,_e=3,m={2:"max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>[data-sf-box-items]>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px)))/2)] [&>[data-sf-box-items]>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px)))/2)]",3:"max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>[data-sf-box-items]>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px))_*_2)/3)] [&>[data-sf-box-items]>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px))_*_2)/3)]"},ge=_.filter(e=>e.value==="content"||e.value==="equal"),ue="equal",ke=1,Se=6,d="view-wide:flex-wrap [&>*]:view-wide:min-w-0 [&>[data-sf-box-items]>*]:view-wide:min-w-0 [&>*]:view-wide:grow-0! [&>[data-sf-box-items]>*]:view-wide:grow-0!",K={1:`${d} [&>*]:view-wide:basis-[calc(100%/1)]! [&>[data-sf-box-items]>*]:view-wide:basis-[calc(100%/1)]!`,2:`${d} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px))/2)]! [&>[data-sf-box-items]>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px))/2)]!`,3:`${d} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_2)/3)]! [&>[data-sf-box-items]>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_2)/3)]!`,4:`${d} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_3)/4)]! [&>[data-sf-box-items]>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_3)/4)]!`,5:`${d} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_4)/5)]! [&>[data-sf-box-items]>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_4)/5)]!`,6:`${d} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_5)/6)]! [&>[data-sf-box-items]>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_5)/6)]!`};function O(e){return typeof e=="number"?K[e]??"":""}const J={1:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>[data-sf-box-items]>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>[data-sf-box-items]>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc(100%/1)]! [&>[data-sf-box-items]>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc(100%/1)]!",2:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>[data-sf-box-items]>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>[data-sf-box-items]>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px)))/2)]! [&>[data-sf-box-items]>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px)))/2)]!",3:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>[data-sf-box-items]>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>[data-sf-box-items]>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_2)/3)]! [&>[data-sf-box-items]>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_2)/3)]!",4:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>[data-sf-box-items]>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>[data-sf-box-items]>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_3)/4)]! [&>[data-sf-box-items]>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_3)/4)]!",5:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>[data-sf-box-items]>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>[data-sf-box-items]>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_4)/5)]! [&>[data-sf-box-items]>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_4)/5)]!",6:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>[data-sf-box-items]>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>[data-sf-box-items]>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_5)/6)]! [&>[data-sf-box-items]>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_5)/6)]!"};function C(e){return typeof e=="number"?J[e]??"":""}function Ae(e){return e.direction!=="row"||b(e.direction,e.separator)||e.loop==="scroll"||e.line===!0?"":C(e.columnsTablet)}function Oe(e){return e.direction!=="row"||b(e.direction,e.separator)||e.loop==="scroll"||e.line===!0?"":O(e.columns)}const D="max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>[data-sf-box-items]>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:grow-0 [&>[data-sf-box-items]>*]:max-view-wide:grow-0 [&>*]:max-view-wide:basis-[content] [&>[data-sf-box-items]>*]:max-view-wide:basis-[content]",Y={2:"max-view-wide:flex-nowrap [&>*]:max-view-wide:min-w-0 [&>[data-sf-box-items]>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px)))/2)] [&>[data-sf-box-items]>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px)))/2)]",3:"max-view-wide:flex-nowrap [&>*]:max-view-wide:min-w-0 [&>[data-sf-box-items]>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px))_*_2)/3)] [&>[data-sf-box-items]>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px))_*_2)/3)]"},Q="max-view-wide:flex-nowrap [&>*]:max-view-wide:grow-0 [&>[data-sf-box-items]>*]:max-view-wide:grow-0 [&>*]:max-view-wide:basis-[content] [&>[data-sf-box-items]>*]:max-view-wide:basis-[content]";function z(e){return e===!1||e==="nowrap"}function Ce(e,t,a){const i=m[Number(e)];if(!i)return"max-view-wide:flex-col";const s=z(a);return L(e,t)?s?Q:D:s?Y[Number(e)]:i}function Le(e,t){return Number(e)in m&&!L(e,t)}function L(e,t){return Number(e)in m&&t==="content"}const Ee="Block spacing",Te=[{label:"Each block",value:"each"},{label:"Gap only",value:"gap"}],Z="sf-box-gap-only";function Be(e){return e==="gap"?Z:""}const E={each:"sf-box-each-tablet",gap:"sf-box-gap-only-tablet"},ee={each:"sf-box-each-phone",gap:"sf-box-gap-only-phone"};function ye(e,t,a){const i=n=>w(E,n),s=f(e==="gap"?"gap":"each",i(t),i(a));return h(s,E,ee)}export{v as BOX_ALIGN_CLASS,Ee as BOX_BLOCK_SPACING_LABEL,Te as BOX_BLOCK_SPACING_POINTS,Se as BOX_COLUMNS_MAX,ke as BOX_COLUMNS_MIN,Z as BOX_GAP_ONLY_CLASS,pe as BOX_GIVES_PICTURES_A_HEIGHT,X as BOX_ITEMS_ATTR,he as BOX_PHONE_ROW_LABEL,_e as BOX_PHONE_ROW_MAX,me as BOX_PHONE_ROW_MIN,de as BOX_SHARE_CHOICES,le as BOX_SHARE_LABEL,ue as BOX_SHARE_PHONE_DEFAULT,ge as BOX_SHARE_PHONE_POINTS,_ as BOX_SHARE_POINTS,ae as NESTED_BOX_PADDING,oe as boxAlignViewClasses,Be as boxBlockSpacingClass,ye as boxBlockSpacingViewClasses,O as boxColumnsClass,fe as boxFitContentClass,ne as boxJustifyViewClasses,se as boxLayoutClasses,Le as boxPhoneCellsShareLine,Ce as boxPhoneRowClasses,L as boxPhoneRowFits,z as boxPhoneRowOneLine,Oe as boxRowColumnsClass,Ae as boxRowTabletColumnsClass,be as boxRowTabletShareClass,ce as boxShareChoiceOf,F as boxShareClasses,q as boxShareTabletOf,ve as boxShareVars,xe as boxShareWidthsOf,C as boxTabletColumnsClass,B as boxWrapClass,we as boxWrapTabletClass,$ as boxWrapWordOf,re as withoutBoxItemsHalf};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { SlotCell } from "efficient-easel/render";
|
|
2
|
-
export declare const BOX_PHONE_PLACE_CLASS = "max-view-wide:[&>*]:order-[var(--sf-phone-place)]";
|
|
3
|
-
export declare const BOX_PHONE_PLACE_TABLET_CLASS = "max-view-tablet:[&>*]:order-[var(--sf-phone-place)]";
|
|
2
|
+
export declare const BOX_PHONE_PLACE_CLASS = "max-view-wide:[&>*]:order-[var(--sf-phone-place)] max-view-wide:[&>[data-sf-box-items]>*]:order-[var(--sf-phone-place)]";
|
|
3
|
+
export declare const BOX_PHONE_PLACE_TABLET_CLASS = "max-view-tablet:[&>*]:order-[var(--sf-phone-place)] max-view-tablet:[&>[data-sf-box-items]>*]:order-[var(--sf-phone-place)]";
|
|
4
4
|
export declare const BOX_PHONE_PLACE_CANVAS_CLASS = "max-view-wide:order-[var(--sf-phone-place)]";
|
|
5
5
|
export declare const BOX_PHONE_PLACE_CANVAS_TABLET_CLASS = "max-view-tablet:order-[var(--sf-phone-place)]";
|
|
6
|
-
export declare const BOX_CELL_CLASS = "contents [&>*]:grow-[inherit] [&>*]:shrink-[inherit] [&>*]:basis-[inherit] [&>*]:min-w-[inherit]";
|
|
6
|
+
export declare const BOX_CELL_CLASS = "contents [&>*]:grow-[inherit] [&>[data-sf-box-items]>*]:grow-[inherit] [&>*]:shrink-[inherit] [&>[data-sf-box-items]>*]:shrink-[inherit] [&>*]:basis-[inherit] [&>[data-sf-box-items]>*]:basis-[inherit] [&>*]:min-w-[inherit] [&>[data-sf-box-items]>*]:min-w-[inherit]";
|
|
7
7
|
export declare function boxPhoneOrder(value: unknown, ids: readonly string[]): string[] | undefined;
|
|
8
8
|
export declare function boxPhoneCell(order: readonly string[] | undefined, { tabletKeepsRow, editing }: {
|
|
9
9
|
tabletKeepsRow: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readPhoneOrderIds as s}from"efficient-easel/data";const a="max-view-wide:[&>*]:order-[var(--sf-phone-place)]",
|
|
1
|
+
import{readPhoneOrderIds as s}from"efficient-easel/data";const a="max-view-wide:[&>*]:order-[var(--sf-phone-place)] max-view-wide:[&>[data-sf-box-items]>*]:order-[var(--sf-phone-place)]",d="max-view-tablet:[&>*]:order-[var(--sf-phone-place)] max-view-tablet:[&>[data-sf-box-items]>*]:order-[var(--sf-phone-place)]",h="max-view-wide:order-[var(--sf-phone-place)]",p="max-view-tablet:order-[var(--sf-phone-place)]",x="contents [&>*]:grow-[inherit] [&>[data-sf-box-items]>*]:grow-[inherit] [&>*]:shrink-[inherit] [&>[data-sf-box-items]>*]:shrink-[inherit] [&>*]:basis-[inherit] [&>[data-sf-box-items]>*]:basis-[inherit] [&>*]:min-w-[inherit] [&>[data-sf-box-items]>*]:min-w-[inherit]",f="unnamed:";function _(e,t){const n=Array.isArray(e)?e.filter(r=>!(typeof r=="string"&&r.startsWith(f))):e;return s(n,t)}function m(e,{tabletKeepsRow:t,editing:n}){if(!e)return;const r=n?t?p:h:`${x} ${t?d:a}`;return o=>{const i=e.indexOf(o);return{className:r,style:{"--sf-phone-place":i<0?e.length:i}}}}export{x as BOX_CELL_CLASS,h as BOX_PHONE_PLACE_CANVAS_CLASS,p as BOX_PHONE_PLACE_CANVAS_TABLET_CLASS,a as BOX_PHONE_PLACE_CLASS,d as BOX_PHONE_PLACE_TABLET_CLASS,m as boxPhoneCell,_ as boxPhoneOrder};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseTickerSeparator as
|
|
1
|
+
import{parseTickerSeparator as l,SEPARATOR_GLYPH as a,separatorScaleClass as r,TICKER_SEPARATOR_OPTIONS as c}from"../sections/ticker-style.js";const p=[{value:"none"},{value:"dot"},{value:"cross"},{value:"slash"},{value:"triangle"}];function f(h){return c.some(s=>s.value===h)?l(h):void 0}const n="overflow-x-clip [&>*]:shrink-0 [&>[data-sf-box-items]>*]:shrink-0 [&>*]:max-view-wide:basis-[content] [&>[data-sf-box-items]>*]:max-view-wide:basis-[content] [&>*_:is(p,h1,h2,h3,h4,h5,h6)]:max-w-none [&>[data-sf-box-items]>*_:is(p,h1,h2,h3,h4,h5,h6)]:max-w-none [&>*_:is(.sf-button-block>div)]:font-mono [&>[data-sf-box-items]>*_:is(.sf-button-block>div)]:font-mono [&>*_:is(.sf-button-block>div)]:text-[length:var(--size-label,14px)] [&>[data-sf-box-items]>*_:is(.sf-button-block>div)]:text-[length:var(--size-label,14px)] [&>*_:is(.sf-button-block>div)]:tracking-[0.2em] [&>[data-sf-box-items]>*_:is(.sf-button-block>div)]:tracking-[0.2em] [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:inline-flex [&>[data-sf-box-items]>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:inline-flex [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:items-center [&>[data-sf-box-items]>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:items-center [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:align-top [&>[data-sf-box-items]>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:align-top [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:h-[calc(1lh/var(--sf-sep-k,1))] [&>[data-sf-box-items]>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:h-[calc(1lh/var(--sf-sep-k,1))] [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:mr-[var(--sf-gap-len,0px)] [&>[data-sf-box-items]>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:mr-[var(--sf-gap-len,0px)] [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:max-view-wide:before:mr-[var(--sf-gap-len-phone,calc(var(--sf-gap-len,0px)/2))] [&>[data-sf-box-items]>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:max-view-wide:before:mr-[var(--sf-gap-len-phone,calc(var(--sf-gap-len,0px)/2))] [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:text-accent [&>[data-sf-box-items]>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:text-accent [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:text-[length:calc(var(--sf-sep-k,1)*1em)] [&>[data-sf-box-items]>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:text-[length:calc(var(--sf-sep-k,1)*1em)] [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:content-[var(--sf-sep-mark)] [&>[data-sf-box-items]>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:content-[var(--sf-sep-mark)]";function t(h,s){return h==="row"&&f(s)!==void 0}function v(h,s){return t(h,s)?n:""}const b="[&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:inline-flex [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:items-center [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:align-top [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:h-[calc(1lh/var(--sf-sep-k,1))] [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:ml-[var(--sf-gap-len,0px)] [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:max-view-wide:after:ml-[var(--sf-gap-len-phone,calc(var(--sf-gap-len,0px)/2))] [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:text-accent [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:text-[length:calc(var(--sf-sep-k,1)*1em)] [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:content-[var(--sf-sep-mark)] [&>[data-sf-box-items]:last-child>*:not(:last-child)_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:content-none";function x(h,s){return t(h,s)?b:""}function u(h,s){if(!t(h,s))return{};const i=f(s),e=/^text-\[([\d.]+)em\]$/.exec(r("small",i))?.[1],o=a[i];return{"--sf-sep-mark":o===""?"none":JSON.stringify(o),...e?{"--sf-sep-k":e}:{}}}export{p as BOX_SEPARATOR_POINTS,v as boxSeparatorClasses,f as boxSeparatorOf,x as boxSeparatorSeamClass,u as boxSeparatorStyle,t as isStripBox};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const BOX_SHAPES: ("square" | "video" | "
|
|
1
|
+
export declare const BOX_SHAPES: ("square" | "video" | "auto" | "poster" | "tall" | "wide" | "landscape" | "portrait" | "panorama" | "story")[];
|
|
2
2
|
export type BoxShape = (typeof BOX_SHAPES)[number];
|
|
3
3
|
export declare function boxShapeOf(value: unknown): BoxShape;
|
|
4
4
|
export declare function boxShapeClass(value: unknown): string;
|
|
@@ -3,6 +3,14 @@ type CardRowStateName = (typeof CARD_ROW_STATES)[number];
|
|
|
3
3
|
export type CardRowState = Readonly<Partial<Record<CardRowStateName, boolean>>>;
|
|
4
4
|
export declare const CARD_STATE_ATTR = "data-sf-card-state";
|
|
5
5
|
export declare const CARD_STATE_LINE_CLASS = "pointer-events-none absolute inset-0 border border-accent";
|
|
6
|
+
export type CardStateLine = "frame" | "under";
|
|
7
|
+
export declare const CARD_STATE_UNDER_LINE_CLASS = "pointer-events-none absolute inset-x-0 bottom-0 border-b-2 border-accent";
|
|
6
8
|
export declare function cardStateValue(state: CardRowState | undefined | null): string;
|
|
7
9
|
export declare function cardStateAttrs(state: CardRowState | undefined | null): Record<string, string>;
|
|
10
|
+
export type CardItemAction = {
|
|
11
|
+
readonly press: () => void;
|
|
12
|
+
};
|
|
13
|
+
export declare function cardItemAction(item: unknown): CardItemAction | undefined;
|
|
14
|
+
export declare const CARD_ACTION_ATTR = "data-sf-card-press";
|
|
15
|
+
export declare const CARD_ACTION_CLASS = "absolute inset-0 -z-[1] outline-none focus-visible:z-[2] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent appearance-none bg-transparent border-0 p-0 m-0 cursor-pointer";
|
|
8
16
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
import{BOX_LINK_CLASS as r}from"./box-link.js";const n=["selected","highlighted"],o="data-sf-card-state",a="pointer-events-none absolute inset-0 border border-accent",p="pointer-events-none absolute inset-x-0 bottom-0 border-b-2 border-accent";function s(e){return e?n.filter(t=>e[t]===!0).join(" "):""}function A(e){const t=s(e);return t?{[o]:t,className:"relative"}:{}}function d(e){if(!e||typeof e!="object")return;const t=e.press;return typeof t=="function"?{press:t}:void 0}const i="data-sf-card-press",u=`${r} appearance-none bg-transparent border-0 p-0 m-0 cursor-pointer`;export{i as CARD_ACTION_ATTR,u as CARD_ACTION_CLASS,o as CARD_STATE_ATTR,a as CARD_STATE_LINE_CLASS,p as CARD_STATE_UNDER_LINE_CLASS,d as cardItemAction,A as cardStateAttrs,s as cardStateValue};
|
|
@@ -2,6 +2,7 @@ import { type SourceRow } from "./block-sources.js";
|
|
|
2
2
|
import type { CardCopyPlace } from "./mirror-cards.js";
|
|
3
3
|
export declare const CARD_TEMPLATE_SLOT = "template";
|
|
4
4
|
export declare const CARD_TEMPLATE_LABEL = "Card template";
|
|
5
|
+
export declare const CARD_LIST_TYPE = "CardList";
|
|
5
6
|
export declare const CARD_TEMPLATE_BLOCKS: readonly ["Text", "ImageBlock", "ButtonBlock", "Flex"];
|
|
6
7
|
export declare const CARD_ROW_FIELD_PROP = "rowField";
|
|
7
8
|
export declare const CARD_ROW_LINK_PROP = "rowLinkField";
|
|
@@ -9,7 +10,12 @@ export declare function cardTemplateSlot(): {
|
|
|
9
10
|
type: "slot";
|
|
10
11
|
allow: string[];
|
|
11
12
|
};
|
|
12
|
-
export
|
|
13
|
+
export declare const CARD_LIST_ITEM_BLOCKS: ("Flex" | "Text" | "ImageBlock")[];
|
|
14
|
+
export declare function cardListItemSlot(): {
|
|
15
|
+
type: "slot";
|
|
16
|
+
allow: string[];
|
|
17
|
+
};
|
|
18
|
+
export type CardRowFieldKind = "text" | "image" | "link" | "list";
|
|
13
19
|
export interface CardRowFieldSpec {
|
|
14
20
|
key: string;
|
|
15
21
|
label: string;
|
|
@@ -18,6 +24,7 @@ export interface CardRowFieldSpec {
|
|
|
18
24
|
alt?: string;
|
|
19
25
|
next?: string;
|
|
20
26
|
everySource?: boolean;
|
|
27
|
+
fields?: readonly CardRowFieldSpec[];
|
|
21
28
|
mark?: "accentItalic";
|
|
22
29
|
}
|
|
23
30
|
export interface CardTemplateSpec {
|
|
@@ -40,6 +47,8 @@ export declare function isCardTemplateBlock(type: string): boolean;
|
|
|
40
47
|
export declare function cardTemplateTypedRows(type: unknown): string;
|
|
41
48
|
export declare function hasCardTemplate(type: unknown): boolean;
|
|
42
49
|
export declare function cardTemplateFields(type: string, kind?: CardRowFieldKind): readonly CardRowFieldSpec[];
|
|
50
|
+
export declare function defaultListField(type: unknown): string;
|
|
51
|
+
export declare function cardListShows(props: Record<string, unknown> | null | undefined, ownerType: unknown): string;
|
|
43
52
|
export declare function cardTemplateFieldsOf(owner: {
|
|
44
53
|
type?: unknown;
|
|
45
54
|
props?: Record<string, unknown>;
|
|
@@ -52,6 +61,9 @@ export declare function namedRowField(props: Record<string, unknown> | null | un
|
|
|
52
61
|
export declare function cardKeyOf(row: SourceRow, index: number): string;
|
|
53
62
|
export declare function cardRow(value: unknown): SourceRow;
|
|
54
63
|
export declare function rowNextPicture(item: unknown, next: string | undefined, cover?: string): string;
|
|
64
|
+
export declare const ROW_BOUND_PROPS: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
65
|
+
export declare const ROW_PART_BY_WORDS: ReadonlySet<string>;
|
|
66
|
+
export declare function rowPartByKey(type: string, props: Record<string, unknown> | null | undefined, key: string): boolean;
|
|
55
67
|
export declare function rowBound(type: string, props: Record<string, unknown> | null | undefined, key: string): boolean;
|
|
56
68
|
export declare function rowFieldOf(type: string, props: Record<string, unknown> | null | undefined, key: string): string;
|
|
57
69
|
export declare function rowFieldText(row: SourceRow | null | undefined, key: string): string | null;
|
|
@@ -63,4 +75,8 @@ type DocNode = {
|
|
|
63
75
|
export declare function cardTemplateOwner(appState: unknown, id: unknown): DocNode | null | undefined;
|
|
64
76
|
export declare function cardTemplateCardOwner(appState: unknown, id: unknown): DocNode | null | undefined;
|
|
65
77
|
export declare function cardCopyPlace(appState: unknown, id: unknown): CardCopyPlace | undefined;
|
|
78
|
+
export declare function cardListFieldsOf(appState: unknown, list: {
|
|
79
|
+
type?: unknown;
|
|
80
|
+
props?: Record<string, unknown>;
|
|
81
|
+
} | null | undefined, kind?: CardRowFieldKind): readonly CardRowFieldSpec[];
|
|
66
82
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{blockSourceSpec as
|
|
1
|
+
import{blockSourceSpec as w,declaredBlockSource as B}from"./block-sources.js";import{isNodeList as R}from"efficient-easel/data";import{BOX_TYPE as C}from"../document/container-blocks.js";import{globalRegistry as O}from"../global-registry.js";import{nonEmptyString as k}from"../non-empty-string.js";import{accentItalicRuns as L}from"../markup.js";import{withCardsTemplate as _}from"../document/cards-template-on-read.js";import{withCardListTemplate as A}from"../document/blocks/general/CardList/item-seed.js";const h="template",J="Card template",b="CardList",x=["Text","ImageBlock","ButtonBlock","Flex"],f="rowField",S="rowLinkField";function Z(){return{type:"slot",allow:[...x]}}const P=x.filter(e=>e!=="ButtonBlock");function ee(){return{type:"slot",allow:[...P]}}const E=[{block:"OrderSummary",typedRows:"rows",fields:[{key:"label",label:"Item"},{key:"meta",label:"Meta line"},{key:"amount",label:"Amount"}]},{block:"Footprint",typedRows:"offices",fields:[{key:"badge",label:"HQ"},{key:"role",label:"Role"},{key:"city",label:"City"},{key:"country",label:"Region · country"},{key:"address",label:"Address"},{key:"linkLabel",label:"Button"},{key:"href",label:"Link",kind:"link"}]},{block:"Cards",typedRows:"items",fields:[{key:"num",label:"Number"},{key:"since",label:"Corner note"},{key:"label",label:"Label"},{key:"title",label:"Card title"},{key:"value",label:"Value"},{key:"body",label:"Card body",multiline:!0},{key:"href",label:"Link",kind:"link"},{key:"count",label:"Count"},{key:"badge",label:"Highlight badge",everySource:!0}],seed:e=>_("Cards",e)},{block:b,fields:[],seed:e=>A(e)}];function c(){return O("efficient.card-templates",()=>new Map(E.map(e=>[e.block,e])))}function te(e){for(const t of e){if(typeof t.block!="string"||!t.block)throw new Error("A card template names no block.");const r=[];for(const o of t.blocks??[]){if(typeof o?.type!="string"||!o.type)throw new Error(`The card template of ${t.block} names an empty block.`);r.some(i=>i.type===o.type)||r.push({type:o.type,label:o.label||o.type})}const n=k(t.typedRows);c().set(t.block,{block:t.block,fields:t.fields.map(o=>({...o})),blocks:r,typedRows:n,...t.seed?{seed:t.seed}:{}})}}function F(e,t){const r=e?c().get(e)?.seed:void 0;return r?r(t):t}function re(e,t){if(!(t.template===void 0||Array.isArray(t.template)&&t.template.length===0))return t;const{template:n,...o}=t,i=F(e,o);return i===o?t:i}function ne(){for(const e of c().values())if(e.blocks?.length)return!0;return!1}function oe(e){return c().get(e)?.blocks??[]}function le(e){for(const t of c().values())if(t.blocks?.some(r=>r.type===e))return!0;return!1}function ie(e){return typeof e=="string"&&c().get(e)?.typedRows||""}function I(e){return typeof e=="string"&&c().has(e)}function D(e,t){const r=c().get(e)?.fields??[];return t?r.filter(n=>(n.kind??"text")===t):r}function M(e){return typeof e=="string"?D(e,"list")[0]?.key??"":""}function N(e,t){return a(e)||M(t)}function g(e,t){const r=typeof e?.type=="string"?e.type:"";if(!r)return[];const n=c().get(r)?.fields??[],o=w(B(e?.props))?.fields,i=o?.length?[...o.map(l=>({...l})),...n.filter(l=>l.everySource&&!o.some(s=>s.key===l.key))]:n;return t?i.filter(l=>(l.kind??"text")===t):i}function v(e,t,r){return e?r?g(r).find(n=>n.key===t)??null:c().get(e)?.fields.find(n=>n.key===t)??null:null}function a(e,t=f){const r=e?.[t];return typeof r=="string"?r.trim():""}function se(e,t){return e.key||String(t+1)}function ce(e){const t={};if(e&&typeof e=="object"&&!Array.isArray(e))for(const[r,n]of Object.entries(e))typeof n=="string"&&(t[r]=n);return t}function ue(e,t,r=""){const n=t&&e&&typeof e=="object"?e[t]:void 0;if(!Array.isArray(n))return"";for(const o of n){const i=typeof o=="string"?o:o?.src,l=k(typeof i=="string"?i.trim():void 0);if(l&&l!==r.trim())return l}return""}const d={Text:{text:f},ImageBlock:{src:f},ButtonBlock:{label:f,href:S},Breadcrumb:{currentCrumb:f}},fe=d,W=new Set(["ButtonBlock.label"]);function ae(e,t,r){return j(e,t,r)&&!W.has(`${e}.${r}`)}function j(e,t,r){return K(e,t,r)!==""}function K(e,t,r){const n=d[e]?.[r];return n?a(t,n):""}function U(e,t){return!t||!e?null:e[t]??""}function de(e,t,r,n){if(!r)return t;let o=null;for(const[i,l]of Object.entries(d[e]??{})){const s=a(t,l),u=U(r,s);u!==null&&(o??={...t},o[i]=n&&v(n,s)?.mark==="accentItalic"?L(u):u)}return o??t}function p(e,t){const r=e?.data?.content;if(!Array.isArray(r)||typeof t!="string")return;const n=(i,l)=>{for(const s of i){if(s?.props?.id===t)return l;for(const[u,y]of Object.entries(s?.props??{})){if(!R(y))continue;const T=u===h&&I(s.type)?{owner:s,direct:!0,nested:l!==null,underBox:!1}:l&&{owner:l.owner,direct:!1,nested:l.nested,underBox:l.underBox||s.type===C},m=n(y,T);if(m!==void 0)return m}}},o=n(r,null);return o===void 0?null:o}function Y(e,t){const r=p(e,t);return r&&r.owner}function pe(e,t){const r=p(e,t);return r&&(r.direct?r.owner:null)}function ye(e,t){const r=p(e,t);if(r!==void 0)return r===null?{inCopy:!1,nestedCopy:!1,underBox:!1}:{inCopy:!0,nestedCopy:r.nested,underBox:r.underBox}}function me(e,t,r){if(t?.type!==b)return[];const n=Y(e,t.props?.id),o=n?N(t.props,n.type):"",i=o&&n&&g(n,"list").find(l=>l.key===o)?.fields||[];return r?i.filter(l=>(l.kind??"text")===r):i}export{P as CARD_LIST_ITEM_BLOCKS,b as CARD_LIST_TYPE,f as CARD_ROW_FIELD_PROP,S as CARD_ROW_LINK_PROP,x as CARD_TEMPLATE_BLOCKS,J as CARD_TEMPLATE_LABEL,h as CARD_TEMPLATE_SLOT,fe as ROW_BOUND_PROPS,W as ROW_PART_BY_WORDS,ye as cardCopyPlace,se as cardKeyOf,me as cardListFieldsOf,ee as cardListItemSlot,N as cardListShows,ce as cardRow,oe as cardTemplateBlocks,pe as cardTemplateCardOwner,v as cardTemplateField,D as cardTemplateFields,g as cardTemplateFieldsOf,Y as cardTemplateOwner,Z as cardTemplateSlot,ie as cardTemplateTypedRows,ne as cardTemplatesNameBlocks,M as defaultListField,I as hasCardTemplate,le as isCardTemplateBlock,a as namedRowField,te as registerCardTemplates,j as rowBound,K as rowFieldOf,U as rowFieldText,de as rowFilledProps,ue as rowNextPicture,ae as rowPartByKey,re as templateOnInsert,F as templateOnRead};
|
|
@@ -15,6 +15,7 @@ export interface FootprintOffice {
|
|
|
15
15
|
linkLabel?: string;
|
|
16
16
|
}
|
|
17
17
|
export declare function footprintOfficeOfRow(row: Readonly<Record<string, string>>): FootprintOffice;
|
|
18
|
+
export declare function footprintCardRow(office: FootprintOffice): Record<string, string>;
|
|
18
19
|
export interface FootprintContent {
|
|
19
20
|
sectionNumber: string;
|
|
20
21
|
heading: string;
|