efficient-web-builder 47.0.0 → 47.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 47.1.0 - 2026-11-03
4
+
5
+ Cut from the `v47.0.0` tag, with only the changes of #435. Main holds later work that this release does not carry. A minor because it adds three exports and one optional prop. No stored value moves.
6
+
7
+ **Back to main:** #435 brings the same change to main. The next release from main must be a version above 47.1.0, and its CHANGELOG must carry this entry. The release owner checks both before that release.
8
+
9
+ ### Fixed
10
+
11
+ - **A Text's Content width reaches its words.** The paragraph kept its 680px cap under the block's Size wrapper, so a stored Content width above 680 drew at 680. The cap steps aside for a desktop Content width, Fill or Fixed (`blockSetsItsWidth`). A Text with no Size width keeps the cap and draws the same bytes.
12
+
13
+ ### Look limits (not changed in this release)
14
+
15
+ - With its cap gone, a Text's Center or Right alignment places nothing: the paragraph is as wide as its block, so the words start at the left edge.
16
+ - The cap is taken off by a desktop value only. On a phone from 680px to 799px wide, a phone Content width above 680 still stops at 680.
17
+
18
+ ### Added
19
+
20
+ - `InsideSiteColumn` (`render/components/SiteGutterFrame`): what it holds stands in a column that already keeps its side space, so a Box in it draws no site Side space. It adds no element. Its first user is efficient-storefront-blocks (`trust-bullets.tsx`).
21
+ - `blockSetsItsWidth` (`render/lib/content/block-size`): whether a block's desktop Size rows decide how wide its words run (a Content width, or a Width of Fill or Fixed).
22
+ - `blockSizeValuesOf` (`render/lib/content/block-size`): the Size values off a block's props, moved from the Size pass, the same as main.
23
+ - `ownWidth` on `Text` (`render/components/Text`), optional, default `false`: the paragraph draws no 680px cap. The Text block passes `blockSetsItsWidth(...)`.
24
+
3
25
  ## 47.0.0 - 2026-10-31
4
26
 
5
27
  **MAJOR for hosts.** Published names and one path go (harness CI-3); no stored value moves (0 data moves: every row keeps the key it stored). Peers: `efficient-easel` `^26.7.0` (was `^26.1.0`; `^26.7.0` from #417: the Button set, the block Size set, and a phone strip that rests on the host's own rule, from 26.2; the Duplicate page dialog, `efficient-easel/page-copy`, with its IME Enter fix, from 26.4; the handle it sends and shows finished, "summer" not "summer-", from 26.5; the one button-look and corner reader, from 26.7), `efficient-shell` `^11.8.0` (unchanged).
@@ -1,5 +1,8 @@
1
1
  import { type CSSProperties, type ReactNode } from "react";
2
2
  import { type PadValues } from "../lib/content/section-padding.js";
3
+ export declare function InsideSiteColumn({ children }: {
4
+ children?: ReactNode;
5
+ }): import("react").JSX.Element;
3
6
  export declare function SplitBandAndColumn({ children }: {
4
7
  children?: ReactNode;
5
8
  }): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as e,Fragment as w}from"react/jsx-runtime";import{createContext as f,useContext as v}from"react";import{rootPadAttrs as A,wrapperPadAttrs as G}from"../lib/content/section-padding.js";import{SECTION_BORDER_CLASS as L,SECTION_BORDER_SELF_CLASS as D}from"../../format/lib/content/borders.js";import{drawsSiteGutter as T}from"../../format/lib/content/site-gutter.js";const P=f(!1),h=f(!1);function K({children:n}){return e(h.Provider,{value:!0,children:n})}const R=f(!1);function M({atTop:n,nested:a}){return e(w,{children:v(R)?a:n})}function k({contained:n,framedClass:a,fillClass:y,columnClass:E,style:p,tabLabel:I,pad:s,border:o,outerAttrs:i,box:g=!1,outerStyle:r,children:x}){const j=v(P),C=v(h),c=T(n,j),l=c&&!C,d=s&&!l?A(s.values,s.frame):null,u=o&&!l?o:null,F=[l?a:y,d?.className,u?D:null].filter(Boolean).join(" "),N=d||u?{...p,...d?.style,...u}:p,S=g?e(R.Provider,{value:!0,children:x}):x,m=c?e(P.Provider,{value:!0,children:S}):S,t=s&&l?G(s.values):null,B=i&&Object.keys(i).length>0?i:null,O=e("div",{...t?null:B,className:F,style:t||!r?N:{...N,...r},"data-tab-label":I,children:C?e(h.Provider,{value:!1,children:c?e("div",{className:E,children:m}):m}):m}),_=t?e("div",{...B,className:t.className,style:r?{...t.style,...r}:t.style,children:O}):O;return o&&l?e("div",{className:L,style:{display:"contents",...o},children:_}):_}export{M as NestedBoxChoice,K as SplitBandAndColumn,k as default};
1
+ "use client";import{jsx as e,Fragment as w}from"react/jsx-runtime";import{createContext as f,useContext as v}from"react";import{rootPadAttrs as A,wrapperPadAttrs as G}from"../lib/content/section-padding.js";import{SECTION_BORDER_CLASS as L,SECTION_BORDER_SELF_CLASS as D}from"../../format/lib/content/borders.js";import{drawsSiteGutter as T}from"../../format/lib/content/site-gutter.js";const h=f(!1);function K({children:t}){return e(h.Provider,{value:!0,children:t})}const p=f(!1);function M({children:t}){return e(p.Provider,{value:!0,children:t})}const I=f(!1);function Q({atTop:t,nested:i}){return e(w,{children:v(I)?i:t})}function k({contained:t,framedClass:i,fillClass:R,columnClass:y,style:x,tabLabel:E,pad:s,border:l,outerAttrs:a,box:g=!1,outerStyle:r,children:C}){const j=v(h),S=v(p),c=T(t,j),o=c&&!S,u=s&&!o?A(s.values,s.frame):null,d=l&&!o?l:null,F=[o?i:R,u?.className,d?D:null].filter(Boolean).join(" "),N=u||d?{...x,...u?.style,...d}:x,B=g?e(I.Provider,{value:!0,children:C}):C,m=c?e(h.Provider,{value:!0,children:B}):B,n=s&&o?G(s.values):null,O=a&&Object.keys(a).length>0?a:null,P=e("div",{...n?null:O,className:F,style:n||!r?N:{...N,...r},"data-tab-label":E,children:S?e(p.Provider,{value:!1,children:c?e("div",{className:y,children:m}):m}):m}),_=n?e("div",{...O,className:n.className,style:r?{...n.style,...r}:n.style,children:P}):P;return l&&o?e("div",{className:L,style:{display:"contents",...l},children:_}):_}export{K as InsideSiteColumn,Q as NestedBoxChoice,M as SplitBandAndColumn,k as default};
@@ -4,6 +4,7 @@ import { type BlockAlign as Align } from "../../format/lib/content/block-align.j
4
4
  type Tone = "default" | "dim";
5
5
  interface TextProps {
6
6
  pad?: PadValues;
7
+ ownWidth?: boolean;
7
8
  text: string;
8
9
  align: Align;
9
10
  alignPhone?: unknown;
@@ -14,5 +15,5 @@ interface TextProps {
14
15
  hero?: boolean;
15
16
  }
16
17
  export declare function headingLevelOfStyle(id: string): HeadingLevel;
17
- export default function Text({ text, align, alignPhone, tone, contained, hero, pad, tag, textStyle }: TextProps): import("react").JSX.Element;
18
+ export default function Text({ text, align, alignPhone, tone, contained, hero, pad, tag, textStyle, ownWidth }: TextProps): import("react").JSX.Element;
18
19
  export {};
@@ -1 +1 @@
1
- import{jsx as a}from"react/jsx-runtime";import x from"./BlockFrame.js";import{renderGold as d,renderHeadline as b,splitParagraphs as N}from"./goldPhrases.js";import{headingLook as T}from"./Heading.js";import{alignPhoneClass as $}from"../../format/lib/content/block-align.js";import{textTagOf as v}from"../../format/lib/content/text-tag.js";import{isTextStyleId as S}from"../lib/document/part-styles.js";import{faceClassOf as h}from"../../format/lib/text-style-face.js";const s={bodyUpTo800:"max-[800px]:text-[length:var(--size-body,14px)]",bodySmall:"text-[length:var(--size-body,15px)]",bodyLarge:"text-[length:var(--size-body,17px)]",label:"text-[length:var(--size-label,13px)]"};function L(e,l){const n=$("place",e,l);return n?` ${n}`:""}const O={left:"text-left",center:"text-left mx-auto",right:"text-left ml-auto"},z=`max-w-[380px] ${s.bodySmall} leading-[1.5] opacity-80 ${s.bodyUpTo800}`,C={default:"text-fg",dim:"text-fg-dim"};function E(e){return String(Math.min(Number(e.slice(8)),6))}function k({text:e,align:l,alignPhone:n,tone:g,contained:c,hero:u=!1,pad:r,tag:y,textStyle:f}){if(u)return a("p",{className:z,children:d(e)});const t=S(f)?f:void 0,p=`${t?`${h({id:t})} `:""}max-w-[680px] whitespace-pre-line ${t==="body-5"?s.label:s.bodyLarge} leading-[1.7] ${O[l]}${L(l,n)} ${C[g]}`,i=v(y);if(t?.startsWith("heading-")){const m=E(t),o=T(m,h({id:t}));return a(x,{contained:c,className:"py-6",pad:r?{values:r,frame:24}:void 0,children:a(i,{className:o.className,style:o.style,children:b(e.trim(),!1)})})}return a(x,{contained:c,className:"py-4",pad:r?{values:r,frame:16}:void 0,children:i==="p"?N(e).map((m,o)=>a("p",{className:p,children:d(m)},o)):a(i,{className:p,children:d(e.trim())})})}export{k as default,E as headingLevelOfStyle};
1
+ import{jsx as a}from"react/jsx-runtime";import x from"./BlockFrame.js";import{renderGold as m,renderHeadline as N,splitParagraphs as $}from"./goldPhrases.js";import{headingLook as T}from"./Heading.js";import{alignPhoneClass as v}from"../../format/lib/content/block-align.js";import{textTagOf as S}from"../../format/lib/content/text-tag.js";import{isTextStyleId as L}from"../lib/document/part-styles.js";import{faceClassOf as h}from"../../format/lib/text-style-face.js";const s={bodyUpTo800:"max-[800px]:text-[length:var(--size-body,14px)]",bodySmall:"text-[length:var(--size-body,15px)]",bodyLarge:"text-[length:var(--size-body,17px)]",label:"text-[length:var(--size-label,13px)]"};function O(e,l){const n=v("place",e,l);return n?` ${n}`:""}const z={left:"text-left",center:"text-left mx-auto",right:"text-left ml-auto"},C=`max-w-[380px] ${s.bodySmall} leading-[1.5] opacity-80 ${s.bodyUpTo800}`,E={default:"text-fg",dim:"text-fg-dim"};function k(e){return String(Math.min(Number(e.slice(8)),6))}function w({text:e,align:l,alignPhone:n,tone:g,contained:d,hero:u=!1,pad:o,tag:y,textStyle:f,ownWidth:b=!1}){if(u)return a("p",{className:C,children:m(e)});const t=L(f)?f:void 0,p=`${t?`${h({id:t})} `:""}${b?"":"max-w-[680px] "}whitespace-pre-line ${t==="body-5"?s.label:s.bodyLarge} leading-[1.7] ${z[l]}${O(l,n)} ${E[g]}`,i=S(y);if(t?.startsWith("heading-")){const c=k(t),r=T(c,h({id:t}));return a(x,{contained:d,className:"py-6",pad:o?{values:o,frame:24}:void 0,children:a(i,{className:r.className,style:r.style,children:N(e.trim(),!1)})})}return a(x,{contained:d,className:"py-4",pad:o?{values:o,frame:16}:void 0,children:i==="p"?$(e).map((c,r)=>a("p",{className:p,children:m(c)},r)):a(i,{className:p,children:m(e.trim())})})}export{w as default,k as headingLevelOfStyle};
@@ -17,3 +17,5 @@ export type BlockSize = {
17
17
  attrs: Record<string, string>;
18
18
  };
19
19
  export declare function blockSizeOf(values: BlockSizeValues): BlockSize | null;
20
+ export declare function blockSetsItsWidth(values: BlockSizeValues): boolean;
21
+ export declare function blockSizeValuesOf(props: Readonly<Record<string, unknown>>): BlockSizeValues;
@@ -1 +1 @@
1
- import{BLOCK_FIXED_WIDTH as S,parseBlockWidthFit as w,parseTextFit as b}from"efficient-easel/draw";const _="sf-block-size",p={fit:"data-fit",fitPhone:"data-fit-phone",min:"data-fit-min",minPhone:"data-fit-min-phone"},e=n=>typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0,g={desktop:{fill:"min-[800px]:w-full min-[800px]:[.flex-row>&]:grow",fixed:"min-[800px]:w-[min(var(--sf-bw),100%)] min-[800px]:basis-auto! min-[800px]:grow-0! min-[800px]:shrink-0"},phone:{fill:"max-[800px]:w-full",fixed:"max-[800px]:w-[min(var(--sf-bw-p),100%)] max-[800px]:basis-auto! max-[800px]:grow-0! max-[800px]:shrink-0"}},u={desktop:"--sf-bw",phone:"--sf-bw-p"},P={minWidth:{desktop:["--sf-bmin","min-[800px]:min-w-[var(--sf-bmin)]"],phone:["--sf-bmin-p","max-[800px]:min-w-[var(--sf-bmin-p)]"]},maxWidth:{desktop:["--sf-bmax","min-[800px]:max-w-[var(--sf-bmax)]"],phone:["--sf-bmax-p","max-[800px]:max-w-[var(--sf-bmax-p)]"]}};function y(n){const s=[],f={},i={},d=w(n.widthFit?.desktop),l=w(n.widthFit?.phone)??d,x=e(n.width?.desktop),F=e(n.width?.phone)??x;for(const[o,t,m]of[["desktop",d,x],["phone",l,F]])!t||t==="fit"||(s.push(g[o][t]),t==="fixed"&&(f[u[o]]=`${m??S.fallback}px`));for(const o of["minWidth","maxWidth"]){const t=e(n[o]?.desktop),m=e(n[o]?.phone)??t;for(const[T,k]of[["desktop",t],["phone",m]]){if(k===void 0)continue;const[W,I]=P[o][T];f[W]=`${k}px`,s.push(I)}}const h=b(n.textFit?.desktop),c=b(n.textFit?.phone),a=e(n.minFont?.desktop),r=e(n.minFont?.phone);return h&&(i[p.fit]=h),c&&(i[p.fitPhone]=c),a!==void 0&&(i[p.min]=String(a)),r!==void 0&&(i[p.minPhone]=String(r)),s.length===0&&Object.keys(i).length===0?null:{className:[_,...s].join(" "),style:f,attrs:i}}export{_ as BLOCK_SIZE_CLASS,p as TEXT_FIT_ATTR,y as blockSizeOf};
1
+ import{BLOCK_FIXED_WIDTH as I,BLOCK_SIZE_KEYS as T,parseBlockWidthFit as x,phoneKey as _,parseTextFit as w}from"efficient-easel/draw";const g="sf-block-size",d={fit:"data-fit",fitPhone:"data-fit-phone",min:"data-fit-min",minPhone:"data-fit-min-phone"},s=n=>typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0,y={desktop:{fill:"min-[800px]:w-full min-[800px]:[.flex-row>&]:grow",fixed:"min-[800px]:w-[min(var(--sf-bw),100%)] min-[800px]:basis-auto! min-[800px]:grow-0! min-[800px]:shrink-0"},phone:{fill:"max-[800px]:w-full",fixed:"max-[800px]:w-[min(var(--sf-bw-p),100%)] max-[800px]:basis-auto! max-[800px]:grow-0! max-[800px]:shrink-0"}},L={desktop:"--sf-bw",phone:"--sf-bw-p"},O={minWidth:{desktop:["--sf-bmin","min-[800px]:min-w-[var(--sf-bmin)]"],phone:["--sf-bmin-p","max-[800px]:min-w-[var(--sf-bmin-p)]"]},maxWidth:{desktop:["--sf-bmax","min-[800px]:max-w-[var(--sf-bmax)]"],phone:["--sf-bmax-p","max-[800px]:max-w-[var(--sf-bmax-p)]"]}};function C(n){const t=[],i={},o={},f=x(n.widthFit?.desktop),u=x(n.widthFit?.phone)??f,h=s(n.width?.desktop),l=s(n.width?.phone)??h;for(const[p,e,m]of[["desktop",f,h],["phone",u,l]])!e||e==="fit"||(t.push(y[p][e]),e==="fixed"&&(i[L[p]]=`${m??I.fallback}px`));for(const p of["minWidth","maxWidth"]){const e=s(n[p]?.desktop),m=s(n[p]?.phone)??e;for(const[F,b]of[["desktop",e],["phone",m]]){if(b===void 0)continue;const[S,W]=O[p][F];i[S]=`${b}px`,t.push(W)}}const c=w(n.textFit?.desktop),r=w(n.textFit?.phone),a=s(n.minFont?.desktop),k=s(n.minFont?.phone);return c&&(o[d.fit]=c),r&&(o[d.fitPhone]=r),a!==void 0&&(o[d.min]=String(a)),k!==void 0&&(o[d.minPhone]=String(k)),t.length===0&&Object.keys(o).length===0?null:{className:[g,...t].join(" "),style:i,attrs:o}}function E(n){if(s(n.maxWidth?.desktop)!==void 0)return!0;const t=x(n.widthFit?.desktop);return t==="fill"||t==="fixed"}function K(n){const t={};for(const i of T){const o=n[i],f=n[_(i)];(o!==void 0||f!==void 0)&&(t[i]={desktop:o,phone:f})}return t}export{g as BLOCK_SIZE_CLASS,d as TEXT_FIT_ATTR,E as blockSetsItsWidth,C as blockSizeOf,K as blockSizeValuesOf};
@@ -1 +1 @@
1
- import{Fragment as p,jsx as r}from"react/jsx-runtime";import{CardRowDrawn as s}from"../../../../../components/CardRowContext.js";import{namedRowField as y}from"../../../../../../format/lib/content/card-template.js";import{padValuesOf as P}from"../../../../content/section-padding.js";import T from"../../../../../components/Text.js";import{hidableText as i,readHidable as u}from"efficient-easel/draw";import{PH as d}from"../../../../../../format/lib/document/blocks/placeholders.js";import{phPrev as w}from"../../scaffold.js";import{readPartStyle as S}from"../../../part-styles.js";import{TextMeta as b}from"../../../../../../format/lib/document/blocks/general/Text/meta.js";const W={...b,render:t=>{const{text:o,align:m,alignPhone:l,tone:f,tag:x,contained:c,editor:g}=t;if(u(o).hidden)return r(p,{});const n=S(t,"text").textStyle,h=n?.startsWith("heading-")?d.heading:d.body,a=e=>r(T,{text:w(e,h,g)??"",align:m,alignPhone:l,tone:f,tag:x,textStyle:n,contained:c,pad:P(t)});return y(t)?r(s,{type:"Text",props:t,children:e=>a(i(e.text))}):a(i(o))}};export{W as TextRender};
1
+ import{Fragment as g,jsx as r}from"react/jsx-runtime";import{CardRowDrawn as p}from"../../../../../components/CardRowContext.js";import{namedRowField as y}from"../../../../../../format/lib/content/card-template.js";import{blockSetsItsWidth as S,blockSizeValuesOf as b}from"../../../../content/block-size.js";import{padValuesOf as u}from"../../../../content/section-padding.js";import w from"../../../../../components/Text.js";import{hidableText as a,readHidable as P}from"efficient-easel/draw";import{PH as d}from"../../../../../../format/lib/document/blocks/placeholders.js";import{phPrev as T}from"../../scaffold.js";import{readPartStyle as F}from"../../../part-styles.js";import{TextMeta as R}from"../../../../../../format/lib/document/blocks/general/Text/meta.js";const M={...R,render:t=>{const{text:o,align:m,alignPhone:l,tone:f,tag:x,contained:c,editor:h}=t;if(P(o).hidden)return r(g,{});const i=F(t,"text").textStyle,s=i?.startsWith("heading-")?d.heading:d.body,n=e=>r(w,{text:T(e,s,h)??"",align:m,alignPhone:l,tone:f,tag:x,textStyle:i,ownWidth:S(b(t)),contained:c,pad:u(t)});return y(t)?r(p,{type:"Text",props:t,children:e=>n(a(e.text))}):n(a(o))}};export{M as TextRender};
@@ -1 +1 @@
1
- import{jsx as H}from"react/jsx-runtime";import{BLOCK_SIZE_KEYS as N,parseBlockWidthFit as z,phoneKey as o}from"efficient-easel/draw";import{blockSizeOf as R}from"../../content/block-size.js";import{CellWrap as j}from"../../../components/InBoxContext.js";import{boxPhoneRowFits as D,boxShareClasses as K}from"../../../../format/lib/content/box-layout.js";import{resolveContainerDirection as C}from"../../../../format/lib/content/container-direction.js";import{containerBlocksFor as P}from"../../../../format/lib/document/container-blocks.js";import{readPartStyle as A}from"../part-styles.js";import{addShowWhenFacts as L,withRowRules as h}from"../../../../format/lib/document/show-when-attach.js";import{BOX_BLOCK_KEYS as Z}from"./cell-width.js";import{findParentNode as v}from"../../../../format/lib/document/passes/document-position.js";const G=new Set(["Text","Heading"]),X=new Set(["h1","h2","h3","h4","h5","h6"]);function _(t,e){return t==="Heading"?!0:t!=="Text"?!1:typeof e.tag=="string"&&X.has(e.tag)?!0:A(e,"text").textStyle?.startsWith("heading-")===!0}const c={not:{context:"blockOutsideBox",is:!0}},m={all:[c,{not:{context:"boxSharesWidth",is:!0}}]},g={all:[c,{not:{context:"boxSharesWidthPhone",is:!0}}]};function O(t,e,n){return{any:[{field:o(t),is:e},{all:[{field:o(t),set:!1},n??{field:t,is:e}]}]}}const b={any:[{field:"textFit",is:"shrink"},{all:[{field:"textFit",set:!1},{not:{context:"textWrapsByDefault",is:!0}}]}]},U=[[["_gBlockSize","minWidth",o("minWidth"),"maxWidth",o("maxWidth")],c],[["widthFit"],m],[[o("widthFit")],g],[["width"],{all:[m,{field:"widthFit",is:"fixed"}]}],[[o("width")],{all:[g,O("widthFit","fixed")]}]],W=[[["_gText","textFit",o("textFit")],c],[["minFont"],{all:[c,b]}],[[o("minFont")],{all:[c,O("textFit","shrink",b)]}]],u=(t,e)=>v(e.appState,t.props?.id),x=t=>!!t&&typeof t.type=="string"&&P(t.type)!==null,k=t=>(t.type==="Flex"||t.type==="HeroGroup")&&C(t.type,t.props?.direction)==="row",B=t=>{const e=z(t);return e!==void 0&&e!=="fit"},Y={blockOutsideBox:(t,e)=>!x(u(t,e)),boxSharesWidth:(t,e)=>{const n=u(t,e);return x(n)&&k(n)&&K(n.props?.share)!==""&&!B(t.props?.widthFit)},boxSharesWidthPhone:(t,e)=>{const n=u(t,e);if(!x(n)||!k(n))return!1;const i=n.props?.phoneRow;return(Number(i)===2||Number(i)===3)&&!D(i,n.props?.[o("share")])&&!B(t.props?.[o("widthFit")]??t.props?.widthFit)}},M=t=>/^_[gds][A-Z]/.test(t);function V(t,e,n){const i=Object.entries(t),r=i.findIndex(([l])=>l===e);if(r===-1)return null;let s=r+1;for(;s<i.length&&!M(i[s][0]);)s++;return Object.fromEntries([...i.slice(0,s),...Object.entries(n),...i.slice(s)])}function T(t,e,n){const i=Object.entries(t);return Object.fromEntries([...i.slice(0,e),...Object.entries(n),...i.slice(e)])}function q(t,e,n){const i=Object.keys(e);if(i.includes("_dSize")){const{_gBlockSize:r,...s}=n;return T(e,i.indexOf("_dSize")+1,s)}return J.has(t)&&i.includes("_gSpacing")?T(e,i.indexOf("_gSpacing"),n):{...e,...n}}const J=new Set(["Text","Heading"]);function Q(t,e){const{_gText:n,...i}=e;return V(t,"_gText",i)??{...t,...e}}function $(t){const e=new WeakMap;return n=>{if(!n||!("textFit"in n))return n;let i=e.get(n);if(!i){i={...n};for(const r of["textFit",o("textFit")])r in i&&(i[r]=t[r]);e.set(n,i)}return i}}const ut={name:"blockSize",applies:(t,e,n)=>Z.includes(t)&&!!n&&typeof n.render=="function",panel(t,e,n){const i=G.has(e),{size:r,text:s}=n.blockSizeFields(i?{textFit:e==="Heading"?"shrink":"wrap"}:{});let l=q(e,t.fields??{},h(r,U));if(i){const f=h(s,W);if(l=Q(l,f),e==="Text"){const y=h(n.blockSizeFields({textFit:"shrink"}).text,W),E=$(y),p=t.resolveFields,I=(S,a)=>{const d=p?p(S,a):a.fields,w=F=>_(e,S?.props??{})?E(F??a.fields):F;return d instanceof Promise?d.then(w):w(d)};t.resolveFields=I}}t.fields=l,L(t,{...Y,textWrapsByDefault:f=>!_(e,f.props??{})})},draw(t){et(t)}};function tt(t){const e={};for(const n of N){const i=t[n],r=t[o(n)];(i!==void 0||r!==void 0)&&(e[n]={desktop:i,phone:r})}return e}function et(t){const e=t.render;t.render=n=>{const i=R(tt(n)),r=e(n);return i===null?r:H(j,{className:i.className,...Object.keys(i.style).length?{style:i.style}:{},attrs:i.attrs,children:r})}}export{ut as blockSize,_ as textShrinksByDefault};
1
+ import{jsx as N}from"react/jsx-runtime";import{parseBlockWidthFit as z,phoneKey as s}from"efficient-easel/draw";import{blockSizeOf as E,blockSizeValuesOf as R}from"../../content/block-size.js";import{CellWrap as j}from"../../../components/InBoxContext.js";import{boxPhoneRowFits as D,boxShareClasses as P}from"../../../../format/lib/content/box-layout.js";import{resolveContainerDirection as C}from"../../../../format/lib/content/container-direction.js";import{containerBlocksFor as K}from"../../../../format/lib/document/container-blocks.js";import{readPartStyle as A}from"../part-styles.js";import{addShowWhenFacts as L,withRowRules as d}from"../../../../format/lib/document/show-when-attach.js";import{BOX_BLOCK_KEYS as G}from"./cell-width.js";import{findParentNode as X}from"../../../../format/lib/document/passes/document-position.js";const Z=new Set(["Text","Heading"]),v=new Set(["h1","h2","h3","h4","h5","h6"]);function _(t,e){return t==="Heading"?!0:t!=="Text"?!1:typeof e.tag=="string"&&v.has(e.tag)?!0:A(e,"text").textStyle?.startsWith("heading-")===!0}const c={not:{context:"blockOutsideBox",is:!0}},m={all:[c,{not:{context:"boxSharesWidth",is:!0}}]},g={all:[c,{not:{context:"boxSharesWidthPhone",is:!0}}]};function b(t,e,n){return{any:[{field:s(t),is:e},{all:[{field:s(t),set:!1},n??{field:t,is:e}]}]}}const O={any:[{field:"textFit",is:"shrink"},{all:[{field:"textFit",set:!1},{not:{context:"textWrapsByDefault",is:!0}}]}]},U=[[["_gBlockSize","minWidth",s("minWidth"),"maxWidth",s("maxWidth")],c],[["widthFit"],m],[[s("widthFit")],g],[["width"],{all:[m,{field:"widthFit",is:"fixed"}]}],[[s("width")],{all:[g,b("widthFit","fixed")]}]],W=[[["_gText","textFit",s("textFit")],c],[["minFont"],{all:[c,O]}],[[s("minFont")],{all:[c,b("textFit","shrink",O)]}]],u=(t,e)=>X(e.appState,t.props?.id),x=t=>!!t&&typeof t.type=="string"&&K(t.type)!==null,k=t=>(t.type==="Flex"||t.type==="HeroGroup")&&C(t.type,t.props?.direction)==="row",B=t=>{const e=z(t);return e!==void 0&&e!=="fit"},M={blockOutsideBox:(t,e)=>!x(u(t,e)),boxSharesWidth:(t,e)=>{const n=u(t,e);return x(n)&&k(n)&&P(n.props?.share)!==""&&!B(t.props?.widthFit)},boxSharesWidthPhone:(t,e)=>{const n=u(t,e);if(!x(n)||!k(n))return!1;const i=n.props?.phoneRow;return(Number(i)===2||Number(i)===3)&&!D(i,n.props?.[s("share")])&&!B(t.props?.[s("widthFit")]??t.props?.widthFit)}},V=t=>/^_[gds][A-Z]/.test(t);function Y(t,e,n){const i=Object.entries(t),r=i.findIndex(([l])=>l===e);if(r===-1)return null;let o=r+1;for(;o<i.length&&!V(i[o][0]);)o++;return Object.fromEntries([...i.slice(0,o),...Object.entries(n),...i.slice(o)])}function T(t,e,n){const i=Object.entries(t);return Object.fromEntries([...i.slice(0,e),...Object.entries(n),...i.slice(e)])}function q(t,e,n){const i=Object.keys(e);if(i.includes("_dSize")){const{_gBlockSize:r,...o}=n;return T(e,i.indexOf("_dSize")+1,o)}return J.has(t)&&i.includes("_gSpacing")?T(e,i.indexOf("_gSpacing"),n):{...e,...n}}const J=new Set(["Text","Heading"]);function Q(t,e){const{_gText:n,...i}=e;return Y(t,"_gText",i)??{...t,...e}}function $(t){const e=new WeakMap;return n=>{if(!n||!("textFit"in n))return n;let i=e.get(n);if(!i){i={...n};for(const r of["textFit",s("textFit")])r in i&&(i[r]=t[r]);e.set(n,i)}return i}}const dt={name:"blockSize",applies:(t,e,n)=>G.includes(t)&&!!n&&typeof n.render=="function",panel(t,e,n){const i=Z.has(e),{size:r,text:o}=n.blockSizeFields(i?{textFit:e==="Heading"?"shrink":"wrap"}:{});let l=q(e,t.fields??{},d(r,U));if(i){const a=d(o,W);if(l=Q(l,a),e==="Text"){const y=d(n.blockSizeFields({textFit:"shrink"}).text,W),H=$(y),p=t.resolveFields,I=(S,f)=>{const h=p?p(S,f):f.fields,w=F=>_(e,S?.props??{})?H(F??f.fields):F;return h instanceof Promise?h.then(w):w(h)};t.resolveFields=I}}t.fields=l,L(t,{...M,textWrapsByDefault:a=>!_(e,a.props??{})})},draw(t){tt(t)}};function tt(t){const e=t.render;t.render=n=>{const i=E(R(n)),r=e(n);return i===null?r:N(j,{className:i.className,...Object.keys(i.style).length?{style:i.style}:{},attrs:i.attrs,children:r})}}export{dt as blockSize,_ as textShrinksByDefault};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-web-builder",
3
- "version": "47.0.0",
3
+ "version": "47.1.0",
4
4
  "description": "The EFFICIENT website builder: the website editor, the general sections and the renderer that draws them, compiled. Hostable by any EFFICIENT product; nothing here imports a host.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Efficient Pty Ltd",