efficient-web-builder 74.8.0 → 74.9.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 +17 -0
- package/dist/editor/lib/content/section-one-padding.d.ts +1 -1
- package/dist/editor/lib/content/section-one-padding.js +1 -1
- package/dist/render/lib/content/section-own-pads.d.ts +9 -1
- package/dist/render/lib/content/section-own-pads.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 74.9.0 - 2026-11-23
|
|
4
|
+
|
|
5
|
+
From main at `2293b328`: #843.
|
|
6
|
+
|
|
7
|
+
A minor: the one-padding rule reads phone-first and container-query edges, and a host can split a section's padding total over its first and last parts. One new export; no export removed, no new peer, and no page's bytes change.
|
|
8
|
+
|
|
9
|
+
**For hosts:**
|
|
10
|
+
- No step. A host section made of sibling parts with no common element (a crumb bar over a hero) may draw its top total on its first part and its bottom total on its last part with `sectionSplitPads`.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **`sectionSplitPads(type, props, ownPad, { firstBottom, lastTop })`** (`lib/content/section-own-pads`): the one way a host splits a stored padding total over two sibling parts. Each part keeps its inner room as a frame; it returns null for both parts while no stored value is a total.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- **`sectionOnePadding`** (`lib/content/section-one-padding`) reads the desktop edge at 1440 with each view prefix as its width test, so a frame written phone first (`py-16 view-wide:py-[88px]`) reads 88. A container prefix (`@max-[720px]:`, `@min-[N]:`, `@[N]:`) is read as the same test on the view width. A split total passes when the top total is on the section's first part and the bottom total on its last part.
|
|
19
|
+
|
|
3
20
|
## 74.8.0 - 2026-11-23
|
|
4
21
|
|
|
5
22
|
From main at `4ff3fee2`: #838, #840, #841.
|
|
@@ -22,7 +22,7 @@ export declare function edgeLineAt(start: Element, side: "t" | "b", width: numbe
|
|
|
22
22
|
sum: number;
|
|
23
23
|
seen: string;
|
|
24
24
|
};
|
|
25
|
-
export declare
|
|
25
|
+
export declare const edgeLine: (start: Element, side: "t" | "b", unknown?: string[]) => {
|
|
26
26
|
sum: number;
|
|
27
27
|
seen: string;
|
|
28
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{frameAt as B}from"../../../render/lib/content/section-padding.js";import{ownEntry as
|
|
1
|
+
import{frameAt as B}from"../../../render/lib/content/section-padding.js";import{ownEntry as D}from"../../../format/lib/own-entry.js";const Z=/^(?:[^\s]*:)?p[ytb]-/,T=/(^|;)\s*padding-(top|bottom)\s*:/,z=/^p[ytb]-0$/,J={sectionPaddingTop:40,sectionPaddingBottom:50,sectionPaddingTopTablet:30,sectionPaddingBottomTablet:36,sectionPaddingTopPhone:20,sectionPaddingBottomPhone:24,padTotal:["sectionPaddingTop","sectionPaddingBottom","sectionPaddingTopTablet","sectionPaddingBottomTablet","sectionPaddingTopPhone","sectionPaddingBottomPhone"]};function K(t){const o=/^([pm])([ytb])-(?:(\d+(?:\.\d+)?)|\[(\d+(?:\.\d+)?)px\])$/.exec(t);return o?{kind:o[1],side:o[2],px:o[3]!==void 0?Number(o[3])*4:Number(o[4])}:null}const y=t=>(t.getAttribute("class")??"").split(/\s+/).filter(Boolean),a=t=>t.getAttribute("style")??"",Q=(t,o)=>new RegExp(`(?:^|;)\\s*padding-${o==="t"?"top":"bottom"}\\s*:\\s*(\\d+(?:\\.\\d+)?)px`).exec(a(t)),H={desktop:1440,tablet:1099,mobile:390},V={"view-desktop":1100,"view-wide":800,"view-tablet":720,sm:640,md:768,lg:1024,xl:1280,"2xl":1536},q=/^max-(?:\[(\d+)px\]|(.+))$/,F=/^@(?:(max-|min-)?\[(\d+)px\])$/,W=t=>{const o=q.exec(t);return o?o[1]!==void 0?Number(o[1]):D(V,o[2]):void 0};function U(t,o){const c=F.exec(t);if(c)return c[1]==="max-"?o<Number(c[2]):o>=Number(c[2]);if(q.test(t)){const $=W(t);return $===void 0?void 0:o<$}const i=/^(?:min-\[(\d+)px\]|(.+))$/.exec(t),b=i?.[1]!==void 0?Number(i[1]):D(V,i?.[2]??"");return b===void 0?void 0:o>=b}function tt(t,o,c,i){const b=t.split(":"),$=K(b.pop()??"");if(!$)return null;let m=0;for(const d of b){const w=(d==="first"?!c.previousElementSibling:d==="last"?!c.nextElementSibling:void 0)??U(d,o);if(w===void 0)return i.push(t),null;if(!w)return null;const e=F.exec(d),l=e?e[1]==="max-"?Number(e[2]):void 0:W(d);m+=1+(l!==void 0?1/(1+l):0)}return{...$,rank:m}}function L(t,o,c,i,b=!1){let $=0;const m=[];for(let d=t;d;d=o==="t"?d.firstElementChild:d.lastElementChild){const E=Q(d,o);let w={px:E?Number(E[1]):0,rank:E?1/0:-1},e={px:0,rank:-1};for(const x of y(d)){const f=tt(x,c,d,i);!f||f.side!=="y"&&f.side!==o||(f.kind==="m"?e=f.rank>=e.rank?f:e:w=f.rank>=w.rank?f:w)}const l=(b&&d===t?0:w.px)+e.px;l&&m.push(`${d.tagName.toLowerCase()}:${l}`),$+=l}return{sum:$,seen:m.join(" > ")}}const X=(t,o,c=[])=>L(t,o,H.desktop,c),et=(t,o,c,i)=>t-c>=0&&o-i===t-c,R=t=>Z.test(t)&&!z.test(t);function it(t){const o=[];let c=0;const i=(e,l,x="")=>{c++,e||o.push(`${l}${x?` — ${x.slice(0,600)}`:""}`)},b=t.innerRoom??{},$=t.defaultsOf??(()=>({})),m=[],d=e=>t.sectionOf(e)?.querySelectorAll("*").length??0,E=t.types.filter(e=>{const l=t.draw(e,{sectionPaddingTop:40});return l.includes("sf-section-pad")&&d(l)===d(t.draw(e,{}))+1}),w=[];for(const e of E){const l=t.frameOf(e),x=t.draw(e,J),f=t.sectionOf(x);if(!f){i(!1,`§2 ${e}: draws`,x.slice(0,200));continue}const k=Array.from(f.querySelectorAll("*")),A=k.filter(n=>y(n).includes("sf-section-pad")&&!n.parentElement?.closest("section")),G=Array.from(t.sectionOf(t.draw(e,{}))?.querySelectorAll("*")??[]).some(n=>y(n).some(R)||T.test(a(n))),v=Object.prototype.hasOwnProperty.call(b,e);if(v&&i(typeof l!="function",`§1 ${e}: its padding is a column's (${b[e]}), so it declares no frame`),!G||v){i(A.length===1&&/padding-top\s*:\s*40px/.test(a(A[0])),`§2 ${e}: no padding of its own, so the wrapper draws the total once`,x.slice(0,300));continue}i(typeof l=="function",`§1 ${e}: has padding of its own, so it declares its own frame (the builder's table, or its meta's ownPad)`),w.push(e),i(A.every(n=>!T.test(a(n))),`§2 ${e}: no outer wrapper draws a top or bottom`,A.map(a).join(" | "));const N=k.filter(n=>/(^|;)\s*padding-top\s*:\s*40px/.test(a(n))),C=k.filter(n=>/(^|;)\s*padding-bottom\s*:\s*50px/.test(a(n)));i(N.length===1,`§2 ${e}: ONE element draws the total top 40`,`${N.length} found`),i(C.length===1,`§2 ${e}: ONE element draws the total bottom 50`,`${C.length} found`);const u=N[0],g=C[0];if(!u||!g)continue;if(u!==g){const n=(p,r)=>{for(let s=f;s;s=r==="t"?s.firstElementChild:s.lastElementChild)if(s===p)return!0;return!1};i(n(u,"t")&&n(g,"b"),`§2 ${e}: a split total draws its top on the section's first part and its bottom on its last part`,`${u.tagName.toLowerCase()} / ${g.tagName.toLowerCase()}`)}i(/--sf-pad-t-tablet\s*:\s*30px/.test(a(u))&&/--sf-pad-b-tablet\s*:\s*36px/.test(a(g)),`§2 ${e}: …its tablet 30 / 36`,`${a(u)} | ${a(g)}`),i(/--sf-pad-t-phone\s*:\s*20px/.test(a(u))&&/--sf-pad-b-phone\s*:\s*24px/.test(a(g)),`§2 ${e}: …its phone 20 / 24`,`${a(u)} | ${a(g)}`);const I={t:u,b:g};for(const n of new Set([u,g])){const p=y(n).filter(R);i(p.length===0,`§2 ${e}: the padded element keeps no vertical padding class`,p.join(" "));const r=[];for(let s=n.parentElement;s&&s!==f;s=s.parentElement){const h=y(s).filter(R);(h.length||T.test(a(s)))&&r.push(`${s.tagName.toLowerCase()}[${h.join(" ")}${T.test(a(s))?` style=${a(s)}`:""}]`)}i(r.length===0,`§2 ${e}: nothing between the section's edge and the padded element pads`,r.join(" > "))}if(typeof l!="function")continue;const M=t.sectionOf(t.draw(e,{})),_=n=>{const p=[];for(let s=n;s&&s!==f;s=s.parentElement)p.unshift(Array.from(s.parentElement?.children??[]).indexOf(s));let r=M;for(const s of p)r=r?.children[s];return r},O={t:_(u),b:_(g)};if(!O.t||!O.b){i(!1,`§3 ${e}: the padded element is drawn with nothing stored`);continue}const P=l({...$(e),editor:{isEditing:!0}}),Y=typeof P=="object"&&P!==null&&"top"in P,j=n=>Y?P[n==="t"?"top":"bottom"]:P;for(const[n,p]of[["t",40],["b",50]]){const r=B(j(n),"desktop"),s=X(O[n],n,m),h=X(I[n],n,m);i(et(s.sum,h.sum,r,p),`§3 ${e}: the ${n==="t"?"top":"bottom"} edge draws its frame ${r} once, and a total in its place`,`nothing stored ${s.sum} (${s.seen}); total ${p} draws ${h.sum} (${h.seen})`)}for(const n of["tablet","mobile"]){const p=(t.views??H)[n];for(const r of["t","b"]){const s=B(j(r),n),h=L(O[r],r,p,m),S=L(I[r],r,p,m,!0);i(h.sum-s===S.sum,`§3 ${e} ${n}: the ${r==="t"?"top":"bottom"} edge at ${p}px draws its frame ${s} once`,`nothing stored ${h.sum} (${h.seen}); content under the total ${S.sum} (${S.seen})`)}}}return i(m.length===0,"§3 every view prefix on an edge line is one the rule reads",[...new Set(m)].join(" ")),{wrapped:E,owns:w,checks:c,failures:o}}export{et as edgeHolds,X as edgeLine,L as edgeLineAt,it as sectionOnePadding};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CSSProperties } from "react";
|
|
2
|
-
import { type OwnFrame, type RootPadAttrs } from "./section-padding.js";
|
|
2
|
+
import { type OwnFrame, type RootPadAttrs, type TierFrames } from "./section-padding.js";
|
|
3
3
|
import type { OwnPad } from "../document/blocks/general/section-to-box-row-parts.js";
|
|
4
4
|
export declare const BANNER_OWN: OwnPad;
|
|
5
5
|
export declare const CARDS_OWN: OwnPad;
|
|
@@ -28,6 +28,14 @@ export type SectionOwnPad = {
|
|
|
28
28
|
};
|
|
29
29
|
export declare const SECTION_OWN_PADS: Readonly<Record<string, SectionOwnPad>>;
|
|
30
30
|
export declare function sectionRootPad(type: string, props: Props, ownPad?: SectionOwnPad): RootPadAttrs | null;
|
|
31
|
+
type SideFrame = number | TierFrames;
|
|
32
|
+
export declare function sectionSplitPads(type: string, props: Props, ownPad: SectionOwnPad | undefined, inner: {
|
|
33
|
+
firstBottom: SideFrame;
|
|
34
|
+
lastTop: SideFrame;
|
|
35
|
+
}): {
|
|
36
|
+
first: RootPadAttrs | null;
|
|
37
|
+
last: RootPadAttrs | null;
|
|
38
|
+
};
|
|
31
39
|
export declare function withRootPad(className: string, pad: RootPadAttrs | null | undefined, style?: CSSProperties): {
|
|
32
40
|
className: string;
|
|
33
41
|
style?: CSSProperties;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{framePadAttrs as
|
|
1
|
+
import{framePadAttrs as P,padValuesOf as c,SECTION_PAD_KEYS as h}from"./section-padding.js";import{parseSectionHeadPlacement as E}from"../../../format/lib/sections/section-head-placement.js";import{parseSectionHeadStyle as x}from"../../../format/lib/sections/section-head-style.js";import{readHidable as W,VIEW_TIERS as D,viewKeyAt as C}from"efficient-easel/draw";import{TICKER_PAD as R}from"../../../format/lib/sections/strip-shape.js";import{finiteNumber as g}from"../../../format/lib/finite-number.js";import{ownEntry as f}from"../../../format/lib/own-entry.js";const I={top:24,bottom:24,topPhone:24,bottomPhone:24},B={top:72,bottom:72,topPhone:72,bottomPhone:72},i={top:100,bottom:100,topPhone:60,bottomPhone:60},y={top:120,bottom:120,topPhone:70,bottomPhone:70},M={top:24,bottom:24,topPhone:24,bottomPhone:24},F=40,L={top:120,bottom:120,topTablet:80,bottomTablet:80,topPhone:80,bottomPhone:80},w={top:24,bottom:24,topPhone:24,bottomPhone:24},H={top:24,bottom:24,topPhone:24,bottomPhone:24},G={top:84,bottom:84,topPhone:84,bottomPhone:84},k={top:48,bottom:48,topPhone:48,bottomPhone:48},v={top:80,bottom:80,topPhone:60,bottomPhone:60},K={top:100,bottom:60,topPhone:60,bottomPhone:40},Y={top:60,bottom:60,topPhone:40,bottomPhone:40},U={top:80,bottom:80,topTablet:60,bottomTablet:60,topPhone:60,bottomPhone:60},V={top:76,bottom:76,topPhone:76,bottomPhone:76},j={top:76,bottom:76,topPhone:76,bottomPhone:76},O={top:80,bottom:40,topPhone:60,bottomPhone:32},d={top:76,bottom:76,topPhone:76,bottomPhone:76},Q={top:72,bottom:72,topPhone:72,bottomPhone:72},q={top:40,bottom:64,topPhone:24,bottomPhone:36},z={top:120,bottom:120,topPhone:80,bottomPhone:80,topTablet:80,bottomTablet:80},J={top:48,bottom:48,topPhone:48,bottomPhone:48},X=o=>{const t=g(o.bandPadding)??F;return{top:t,bottom:t,topPhone:t,bottomPhone:t}},_=(o,t,n)=>({desktop:o,tablet:t,mobile:n}),s=o=>E(o.headPlacement)==="own-box",e=(o,t)=>({top:_(o.top,t?.top??o.topTablet??o.top,o.topPhone),bottom:_(o.bottom,t?.bottom??o.bottomTablet??o.bottom,o.bottomPhone)}),u=o=>({top:o.topPhone,bottom:o.bottomPhone}),a=o=>t=>s(t)?{top:0,bottom:o.bottom}:o,Z=(o,t)=>{const n=W(o[t]);return n.hidden?!1:!!n.text||o.editor?.isEditing===!0},l={Banner:{frame:()=>e(I)},Cards:{frame:a(e(B))},Chart:{frame:()=>e(d)},ContactLocations:{frame:()=>e(i,u(i))},Countdown:{frame:()=>e(k)},DocBody:{frame:()=>e(v)},DocMasthead:{frame:()=>e(K)},DocMetaCards:{frame:()=>e(Y)},FAQ:{frame:o=>{const t=s(o)||!["num","title","linkText"].some(r=>Z(o,r)),n=e(y);return t?{top:0,bottom:n.bottom}:n},edge:!0},FeaturedCover:{frame:()=>e(U)},Grid:{frame:()=>e(M)},Integrations:{frame:()=>e(V)},KeyFeatures:{frame:()=>e(j)},Logos:{frame:o=>s(o)?0:e(X(o))},LongRead:{frame:a(e(L))},Masthead:{frame:()=>e(O,u(O))},Mockup:{frame:()=>e(d)},OrderSummary:{frame:()=>e(w)},PaymentBadges:{frame:()=>e(H)},Prose:{frame:a(e(Q))},SectionHeader:{frame:o=>{const t=e(q);return x(o.headStyle)==="standard"?t:{top:t.top,bottom:0}},edge:!0},Series:{frame:a(e(z))},Stats:{frame:()=>e(J)},Testimonials:{frame:a(e(G))},Ticker:{frame:()=>e(R),edge:!0}};function so(o,t,n){const r=f(l,o)??n;return r?P({values:c(t,h,!0),frame:r.frame(t),drawsFrame:!0,edge:r.edge},!0).root:null}const N=(o,t)=>typeof o=="object"&&"top"in o?o[t]:o;function $(o,t){const n={...o};for(const r of D)delete n[C(t,r)];return n}function bo(o,t,n,r){const m=f(l,o)??n;if(!m)return{first:null,last:null};const p=m.frame(t),S=c(t,h,!0),b=(T,A)=>P({values:$(S,T),frame:A,drawsFrame:!0,edge:m.edge},!0).root;return{first:b("bottom",{top:N(p,"top"),bottom:r.firstBottom}),last:b("top",{top:r.lastTop,bottom:N(p,"bottom")})}}const oo=/^(?:[^\s]*:)?p[ytb]-/;function Po(o,t,n){if(!t)return n?{className:o,style:n}:{className:o};const r=o.split(/\s+/).filter(p=>p&&!oo.test(p)),m={...n,...t.style};return{className:[...r,t.className].filter(Boolean).join(" "),...Object.keys(m).length?{style:m}:{},...t.attrs}}export{I as BANNER_OWN,B as CARDS_OWN,i as CONTACT_LOCATIONS_OWN,k as COUNTDOWN_OWN,v as DOC_BODY_OWN,K as DOC_MASTHEAD_OWN,Y as DOC_META_CARDS_OWN,y as FAQ_OWN,U as FEATURED_COVER_OWN,V as INTEGRATIONS_OWN,j as KEY_FEATURES_OWN,L as LONG_READ_OWN,O as MASTHEAD_OWN,H as PAYMENT_BADGES_OWN,d as PROOF_OWN,Q as PROSE_OWN,q as SECTION_HEADER_OWN,l as SECTION_OWN_PADS,z as SERIES_OWN,J as STATS_OWN,X as logosBandOwn,so as sectionRootPad,bo as sectionSplitPads,Po as withRootPad};
|