efficient-web-builder 74.7.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 +46 -0
- package/dist/editor/components/CustomHtmlCodeWindow.js +3 -3
- package/dist/editor/components/DuplicateToPageMenu.js +1 -1
- package/dist/editor/components/PagesPanel.js +1 -1
- package/dist/editor/components/PartSettingsPanel.js +1 -1
- package/dist/editor/components/PreviewPartAnchors.d.ts +2 -2
- package/dist/editor/components/PreviewPartAnchors.js +1 -1
- package/dist/editor/components/SectionTextPartBridge.js +1 -1
- package/dist/editor/components/SiteAccentField.js +1 -1
- package/dist/editor/components/SiteTextStylesField.d.ts +2 -0
- package/dist/editor/components/SiteTextStylesField.js +1 -1
- package/dist/editor/components/StandaloneSectionEditor.js +1 -1
- package/dist/editor/components/StorefrontEditor.js +1 -1
- package/dist/editor/components/storefront-editor.css +5 -5
- package/dist/editor/components/useSocialSettings.d.ts +2 -2
- package/dist/editor/lib/content/section-one-padding.d.ts +31 -0
- package/dist/editor/lib/content/section-one-padding.js +1 -0
- package/dist/editor/lib/document/blocks/general/index.d.ts +2 -2
- package/dist/editor/lib/document/box-fields.d.ts +1 -1
- package/dist/editor/lib/document/page-root.js +2 -2
- package/dist/format/lib/content/box-shape.d.ts +1 -1
- package/dist/format/lib/document/blocks/block-types.d.ts +2 -0
- package/dist/format/lib/document/passes/types.d.ts +2 -0
- package/dist/format/lib/document/style-text.d.ts +2 -0
- package/dist/format/lib/document/style-text.js +1 -1
- package/dist/format/lib/fonts.d.ts +43 -7
- package/dist/format/lib/fonts.js +1 -1
- package/dist/format/lib/site-font-faces.d.ts +9 -0
- package/dist/format/lib/site-font-faces.js +2 -0
- package/dist/format/lib/site-theme-row.d.ts +29 -1
- package/dist/format/lib/site-theme-row.js +1 -0
- package/dist/format/lib/sized-image.js +1 -1
- package/dist/format/lib/source-rules/one-dropdown.js +3 -3
- package/dist/format/lib/source-rules/page-picture-place.js +3 -3
- package/dist/format/lib/source-rules/published-mounts.js +38 -38
- package/dist/format/lib/source-rules/shape-rows-use-the-picker.js +2 -2
- package/dist/format/lib/source-rules/support/element-call.d.ts +5 -0
- package/dist/format/lib/source-rules/support/element-call.js +1 -0
- package/dist/format/lib/word-styles.d.ts +7 -6
- package/dist/format/lib/word-styles.js +1 -1
- package/dist/render/components/HeroPictures.d.ts +2 -2
- package/dist/render/components/PublishedPartStylesContext.js +1 -1
- package/dist/render/components/SiteFontsContext.d.ts +11 -0
- package/dist/render/components/SiteFontsContext.js +2 -0
- package/dist/render/lib/content/section-own-pads.d.ts +11 -3
- package/dist/render/lib/content/section-own-pads.js +1 -1
- package/dist/render/lib/document/part-styles.d.ts +7 -5
- package/dist/render/lib/document/part-styles.js +2 -2
- package/dist/render/lib/document/passes/section-padding.d.ts +2 -1
- package/dist/render/lib/document/passes/section-padding.js +1 -1
- package/dist/render/lib/text-styles/site-text-styles.d.ts +3 -3
- package/dist/render/lib/text-styles/site-text-styles.js +2 -2
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type OwnFrame } from "../../content/section-padding.js";
|
|
2
|
-
import type { BlockPass } from "../../../../format/lib/document/passes/types.js";
|
|
2
|
+
import type { BlockPass, PassBlock } from "../../../../format/lib/document/passes/types.js";
|
|
3
3
|
type InnerPadding = {
|
|
4
4
|
top: number;
|
|
5
5
|
bottom: number;
|
|
@@ -15,6 +15,7 @@ export declare const PAD_ON_ROOT: ReadonlySet<string>;
|
|
|
15
15
|
export declare const PADS_ITS_OWN_SPACE: ReadonlySet<string>;
|
|
16
16
|
export declare const sectionPadding: BlockPass;
|
|
17
17
|
export declare const OWN_PAD_FRAME: Readonly<Record<string, (props: Record<string, unknown>) => OwnFrame>>;
|
|
18
|
+
export declare function ownFrameOf(key: string, comp: Pick<PassBlock, "ownPad"> | undefined): ((props: Record<string, unknown>) => OwnFrame) | undefined;
|
|
18
19
|
export declare const OWN_PAD_LABEL: Readonly<Record<string, string>>;
|
|
19
20
|
export declare function withPadTotals(props: Record<string, unknown>, changed: Readonly<Record<string, unknown>> | undefined): Record<string, unknown>;
|
|
20
21
|
export declare function olderPadNote(props: Record<string, unknown>, frame: number, side?: "top" | "bottom"): string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as g}from"react/jsx-runtime";import{SideOnceClass as
|
|
1
|
+
import{jsx as g}from"react/jsx-runtime";import{SideOnceClass as C}from"../../../components/SideSpaceOnce.js";import{HideTaker as F}from"../../../components/ViewHideRoot.js";import{LineChoice as L}from"../../../components/InBoxContext.js";import{isBackgroundBox as R}from"../../../../format/lib/content/box-background.js";import{boxSideSpaceOf as W}from"../../../../format/lib/content/box-side-space.js";import{SECTION_OWN_PADS as y}from"../../content/section-own-pads.js";import{BAND_PAD_KEYS as m,BAND_PAD_UNIT_KEY as K,BLOCK_PAD_FRAME as P,PAD_TOTAL_KEY as f,SECTION_PAD_KEYS as x,framePadAttrs as H,padTotalKeys as S,padValuesOf as j,sectionPadAttrs as v,tierFramesOf as h}from"../../content/section-padding.js";import{readPartStyle as Y}from"../part-styles.js";import{CRUMB_PAD as M,SPEC_PAD as U}from"../../../../format/lib/sections/strip-shape.js";import{say as $}from"../../../../format/lib/editor-words.js";import{sectionFillPassClass as D}from"../../../../format/lib/content/section-min-height.js";import{COPIES_IN_THE_BOX as k,drawsCopiesInTheBox as V}from"../../../../format/lib/content/copies-in-box.js";import{ownEntry as c}from"../../../../format/lib/own-entry.js";const E={ParagraphsA:{top:60,bottom:80},StatsParagraph:{top:120,bottom:120},Timeline:{top:120,bottom:120},Footprint:{top:120,bottom:120},TimelineTrack:{top:120,bottom:120},TitleWithButtons:{top:140,bottom:140},ProcessSteps:{top:120,bottom:120}},_t=new Set(Object.keys(E));function A(t,e){return e?.innerPadding??c(E,t)}const gt=t=>A(t)??{},mt=t=>c({DetailRows:{top:100,bottom:100}},t),B=new Set(["Flex","Text","Heading","ImageBlock","ButtonBlock"]),X=new Set(["Divider"]),G=new Set(["Hero","HeroSingle","IntroBleed","CategoryBar","DocTabs"]),T=new Set(["ProductGrid"]);function O(t,e,n=!1,o){const a=t.render;t.render=r=>{if(e?.(r))return a(r);const s={...j(r,x,n),sideSpace:W(r.sideSpace)},d=o?H({values:s,frame:o(r)},!0).outer:v(s),i=a(r);if(!d)return i;const l=u=>g(C,{className:u?`${d.className} ${u}`:d.className,children:I=>g(F,{className:I,style:d.style,children:i})}),_=D(r,{atSectionLine:!0}),b=D(r);return _===b?l(_):g(L,{line:"by-box",draw:u=>l(u?b:_)})}}const St={name:"sectionPadding",applies:(t,e,n)=>e.isSection(t)&&!G.has(t)&&!!n&&typeof n.render=="function",panel(t,e,n){const o=A(e,t);if(o){t.fields={...t.fields,...n.sidesPaddingFields({keys:m,unitKey:K,fallback:o,tablet:!0,siteSide:!0})};return}if(T.has(e))return;const a=[m.top,m.bottom].filter(s=>t.fields!=null&&s in t.fields);if(a.length)throw new Error(`section-padding: ${e} declares its own ${a.join(" / ")} row; declare \`innerPadding: { top, bottom }\` in its meta and the one Padding row draws on its band`);const r=N(e,t);if(r){p(t,e,n,r);return}t.fields={...t.fields,...n.sidesPaddingFields({tablet:!0,siteSide:!0})}},draw(t,e){if(!A(e,t)){if(T.has(e)){O(t);return}B.has(e)||X.has(e)||O(t,e==="Flex"?n=>R(n.bgImage):k.has(e)?n=>V(e,n):void 0,!0,N(e,t))}}},q=["Heading","Text","ImageBlock","ButtonBlock"],z=["LogoBlock"],w={Text:t=>Y(t,"text").textStyle?.startsWith("heading-")?P.heading:P.text,Heading:()=>P.heading,ButtonBlock:()=>P.text,Breadcrumb:()=>h(M),SpecStrip:()=>h(U),...Object.fromEntries(Object.entries(y).map(([t,e])=>[t,e.frame]))};function N(t,e){return c(w,t)??e?.ownPad?.frame}const J={ButtonBlock:"Outer padding"};function Q(t,e){const n=t[f],o=Array.isArray(n)?n.filter(i=>typeof i=="string"):[],a=S().filter(i=>e?.[i]);if(!a.length)return t;const r=[...o.filter(i=>!a.includes(i)),...a.filter(i=>typeof t[i]=="number")];if(r.length===o.length&&r.every((i,l)=>i===o[l]))return t;const{[f]:s,...d}=t;return r.length?{...d,[f]:r}:d}function Z(t,e,n){if(e<=0)return null;const o=Array.isArray(t[f])?t[f]:[];return(n?S().filter(s=>s.startsWith(x[n])):S()).some(s=>typeof t[s]=="number"&&!o.includes(s))?$("plus {n} px (older setting)",{n:e}):null}function p(t,e,n,o){t.fields={...t.fields,...n.ownPaddingFields?.(o,Z,c(J,e))??n.sidesPaddingFields({tablet:!0,siteSide:!0})};const a=t.resolveData;t.resolveData=(r,s)=>{const d=r.props??{},i=s?.trigger==="replace"?Q(d,s.changed):d,l=i===d?r:{...r,props:i};return a?a(l,s):l}}const At={name:"blockPadding",applies:(t,e,n)=>(q.includes(t)||z.includes(t))&&!!n&&typeof n.render=="function",panel(t,e,n){const o=c(w,e);if(!o){t.fields={...t.fields,...n.sidesPaddingFields({tablet:!0,siteSide:!0})};return}p(t,e,n,o)},draw(t,e){B.has(e)||O(t,void 0,!0)}};export{w as OWN_PAD_FRAME,J as OWN_PAD_LABEL,X as PADS_ITS_OWN_SPACE,B as PAD_ON_ROOT,_t as SECTION_PAD_INNER,E as SECTION_PAD_INNER_DEFAULTS,At as blockPadding,gt as innerPaddingFallback,Z as olderPadNote,N as ownFrameOf,mt as ownPairDefault,St as sectionPadding,Q as withPadTotals};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type TextStyle, type TextStyleCase, type TextStyleDevice } from "efficient-easel/text-styles/model";
|
|
2
|
-
import { type FontRole, type FontsValue } from "../../../format/lib/fonts.js";
|
|
2
|
+
import { type FontRegistry, type FontRole, type FontsValue } from "../../../format/lib/fonts.js";
|
|
3
3
|
import { viewRules } from "../content/view-values.js";
|
|
4
4
|
import { type PartStyle } from "../document/part-styles.js";
|
|
5
5
|
import { faceClassOf } from "../../../format/lib/text-style-face.js";
|
|
@@ -70,7 +70,7 @@ export type SiteTextSeed = {
|
|
|
70
70
|
typography: ResolvedHeadingTypography;
|
|
71
71
|
textStyles: unknown;
|
|
72
72
|
};
|
|
73
|
-
export declare function siteTextFromRow(row: Partial<SiteThemeRow
|
|
73
|
+
export declare function siteTextFromRow(row: Partial<SiteThemeRow>, registry?: FontRegistry): SiteTextSeed;
|
|
74
74
|
export declare function textStylesToOld(list: readonly StoredTextStyle[], prev: OldSiteText): OldSiteText;
|
|
75
75
|
export declare function themeWithTextStyles<T extends {
|
|
76
76
|
fonts?: unknown;
|
|
@@ -79,7 +79,7 @@ export declare function themeWithTextStyles<T extends {
|
|
|
79
79
|
headingTypography?: unknown;
|
|
80
80
|
textStyles?: unknown;
|
|
81
81
|
}>(theme: T): T;
|
|
82
|
-
export declare function textStylesCss(list: readonly StoredTextStyle[]): string;
|
|
82
|
+
export declare function textStylesCss(list: readonly StoredTextStyle[], registry?: FontRegistry): string;
|
|
83
83
|
export declare function accentItalicCss(italic: boolean | null | undefined): string;
|
|
84
84
|
export declare function styleIdOfRole(role: FontRole | null | undefined): string | undefined;
|
|
85
85
|
export declare function partStyleToTextStyleValues(style: PartStyle): StoredTextStyleValues;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{defaultTextStyles as
|
|
2
|
-
`)}function ze(e,
|
|
1
|
+
import{defaultTextStyles as J,textStyleCaseCss as ce}from"efficient-easel/text-styles/model";import{resolveViewValue as Z}from"efficient-easel/draw";import{viewKey as w}from"../../../format/lib/animation/views.js";import{POOL_FONT_REGISTRY as B,normalizeFonts as U}from"../../../format/lib/fonts.js";import{PHONE_MEDIA as de,TABLET_MEDIA as pe,viewOverrides as H,viewRules as X}from"../content/view-values.js";import{STYLE_ID_OF_ROLE as fe,TEXT_STYLE_ATTR as ue,paragraphRules as q,partSpacingOf as ge}from"../document/part-styles.js";import{FACE_SIZE as he,faceClassOf as Q}from"../../../format/lib/text-style-face.js";import{partColourName as ee,partInkCss as me}from"../../../format/lib/document/part-inks.js";import{compressionMetrics as Se,headingTypographyFromRow as ye,normalizeHeadingCompression as I,normalizeSizes as ne}from"../../../format/lib/theme.js";import{finiteNumber as v}from"../../../format/lib/finite-number.js";import{nonEmptyString as P}from"../../../format/lib/non-empty-string.js";const N=e=>e==="sentence"?"none":void 0,te=["font","color","size","sizeTablet","sizePhone","weight","italic","lineHeight","lineHeightTablet","lineHeightPhone","letterSpacing","letterSpacingTablet","letterSpacingPhone","paragraphSpacing","paragraphSpacingTablet","paragraphSpacingPhone","letterCase","largestSize","largestSizeTablet","largestSizePhone"],O=["desktop","tablet","phone"],k=(e,o)=>w(e,o);function L(e,o,t,i=X()){return Z("textSize",o,e.sizeTablet,e.sizePhone,i)[t]}const be=[["lineSpacing","lineHeight","line"],["letterSpacing","letterSpacing","letter"]];function R(e){for(const[o,t,i]of be)for(const n of O)if(e===k(o,n))return{key:w(t,n),view:n,spacing:i};return{key:e,view:"desktop",spacing:null}}function b(e){const o={};for(const t of te)e[t]!==void 0&&(o[t]=e[t]);return o}function F(e,o){const{auto:t,...i}=e,n=new Set(o??[]),l=te.filter(s=>n.has(s)&&e.values[s]===void 0);return l.length?{...i,auto:l}:i}function ie(e){const o=e.fonts,t=e.sizes,i=e.typography,n=Se(e.compression),l={"heading-1":{font:P(o.heading),size:v(t.headingLarge),weight:v(i.weight),lineHeight:n.lineHeight,letterSpacing:n.letterSpacing,letterCase:N(i.case),largestSize:v(i.maxPx)},"heading-2":{font:P(o.heading2),size:v(t.headingMedium),weight:v(i.weight2),lineHeight:n.lineHeight,letterSpacing:n.letterSpacing,letterCase:N(i.case2)},"heading-3":{font:P(o.heading3),size:v(t.headingSmall),weight:v(i.weight3),lineHeight:n.lineHeight,letterSpacing:n.letterSpacing,letterCase:N(i.case3)},"body-1":{font:P(o.body),size:v(t.body)},"body-5":{font:P(o.label),size:v(t.label)}};return J().map(({id:s,kind:d,name:r})=>({id:s,kind:d,name:r,values:b(l[s]??{})}))}function j(e){return Array.isArray(e)&&e.every(t=>t&&typeof t=="object"&&typeof t.id=="string"&&(t.kind==="heading"||t.kind==="body")&&typeof t.name=="string")?e.map(t=>F({...t,values:b(t.values??{})},Array.isArray(t.auto)?t.auto:void 0)):null}function Ne(e){return j(e)??[]}function oe(e){return j(e)??J().map(({id:o,kind:t,name:i})=>({id:o,kind:t,name:i,values:{}}))}function M(e,o){const t=ie(o),i=j(e);return i?i.map(n=>{const l={...V(t,n.id)};for(const s of n.auto??[])delete l[s];return{...n,values:b({...l,...n.values})}}):t}const V=(e,o)=>e.find(t=>t.id===o)?.values??{},se=["heading-1","heading-2","heading-3"];function Le({saved:e,old:o,cur:t,next:i,sizeOf:n,panelView:l="desktop"}){const s=ie(o),d=oe(e),r=M(d,o),c=[],g=i.map(a=>{const S=t.find(u=>u.id===a.id),m=d.find(u=>u.id===a.id);if(!S||!m){const u=xe([a],n,l)[0],T=u.values.color;return T===void 0?u:{...u,values:{...u.values,color:ee(T)}}}const p={...m.values},x=new Set(m.auto??[]),y=a.values,_=S.values,z=[...new Set([...Object.keys(y),...Object.keys(_)])].filter(u=>JSON.stringify(y[u])!==JSON.stringify(_[u])),D=u=>R(u).spacing==="letter";z.sort((u,T)=>Number(D(u))-Number(D(T)));for(const u of z){const{key:T,view:le,spacing:K}=R(u),$=T,E=y[u];if(E===void 0){delete p[$],V(s,a.id)[$]!==void 0&&(c.push([a.id,$]),x.add($));continue}if(x.delete($),K==="line")p[$]=C(E/100,3);else if(K==="letter"){const G={...r.find(A=>A.id===a.id)?.values??{}};for(const A of z)y[A]===void 0&&delete G[R(A).key];const W=b({...G,...p}),Y=L(W,n({...a,values:W}),le);p[$]=Y?C(E/Y,4):0}else p[$]=E}return F({id:a.id,kind:a.kind,name:a.name,values:b(p)},x)});let f=o.compression;if(c.some(([a,S])=>(S==="lineHeight"||S==="letterSpacing")&&se.includes(a))&&I(f)!=="normal"){for(const a of se){const S=g.find(p=>p.id===a);if(!S)continue;const m={...S.values};for(const p of["lineHeight","letterSpacing"])c.some(([x,y])=>x===a&&y===p)||m[p]===void 0&&!(S.auto??[]).includes(p)&&(m[p]=V(s,a)[p]);S.values=b(m)}f="normal"}return{saved:g,old:{...o,compression:f}}}function Re(e,o){const t={text_styles:e.saved};return e.old.compression!==o.compression&&(t.heading_compression=I(e.old.compression)),t}const C=(e,o)=>Number(e.toFixed(o)),ae=(e,o)=>O.indexOf(e)<O.indexOf(o)?o:e;function Fe(e,o,t="desktop"){return e.map(i=>{const n={...i.values},l=o(i);for(const s of O){const d=w("lineHeight",s),r=i.values[d],c=i.values[w("letterSpacing",s)];delete n[d],r!==void 0&&(n[k("lineSpacing",s)]=C(r*100,1));const g=ae(s,t);c!==void 0&&(n[k("letterSpacing",s)]=C(c*L(i.values,l,g),g===s?2:4))}return{id:i.id,kind:i.kind,name:i.name,values:n}})}function xe(e,o,t="desktop"){return e.map(i=>{const n=i.values,l={...n};for(const c of O)delete l[k("lineSpacing",c)],delete l[k("letterSpacing",c)];const s={id:i.id,kind:i.kind,name:i.name,values:b(l)},d={...s.values},r=o({...s,values:{...s.values}});for(const c of O){const g=n[k("lineSpacing",c)],f=n[k("letterSpacing",c)];if(typeof g=="number"&&(d[w("lineHeight",c)]=C(g/100,3)),typeof f=="number"){const h=L(s.values,r,ae(c,t));d[w("letterSpacing",c)]=h?C(f/h,4):0}}return{...s,values:b(d)}})}function Me(e,o=B){const t={fonts:U({heading:e.heading_font??void 0,heading2:e.heading_2_font??void 0,heading3:e.heading_3_font??void 0,body:e.body_font??void 0,accent:e.accent_font??void 0,label:e.label_font??void 0},o),sizes:ne({headingLarge:e.heading_size_large_px,headingMedium:e.heading_size_medium_px,headingSmall:e.heading_size_small_px,accent:e.accent_size_px,body:e.body_size_px,label:e.label_size_px}),compression:I(e.heading_compression),typography:ye(e)},i=e.text_styles??null,n=Array.isArray(i)?re(M(i,t),t):t;return{fonts:U(n.fonts,o),sizes:ne(n.sizes),compression:I(n.compression),typography:n.typography,textStyles:i}}function re(e,o){const t=h=>e.find(a=>a.id===h)?.values??{},i=t("heading-1"),n=t("heading-2"),l=t("heading-3"),s=t("body-1"),d=t("body-5"),r=o.fonts,c=o.sizes,g=o.typography,f=h=>h==="none"?"sentence":"authored";return{fonts:{...r,heading:i.font??r.heading,heading2:n.font??i.font??r.heading2,heading3:l.font??i.font??r.heading3,body:s.font??r.body,label:d.font??r.label},sizes:{...c,headingLarge:i.size??null,headingMedium:n.size??null,headingSmall:l.size??null,body:s.size??null,label:d.size??null},compression:o.compression,typography:{...g,case:f(i.letterCase),weight:i.weight??null,maxPx:i.largestSize??null,weight2:n.weight??null,weight3:l.weight??null,case2:f(n.letterCase),case3:f(l.letterCase)}}}function Ve(e){const o=j(e.textStyles);if(!o||o.every(n=>Object.keys(n.values).length===0&&!n.auto))return e;const t={fonts:e.fonts??{},sizes:e.sizes??{},compression:String(e.headingCompression??"normal"),typography:e.headingTypography??{}},i=re(M(o,t),t);return{...e,fonts:i.fonts,sizes:i.sizes,headingCompression:i.compression,headingTypography:i.typography}}function De(e,o=B){const t=[];for(const i of e){const n=i.values,l=`.${Q(i)}`,s=`[${ue}="${i.id}"]`,d=`${l}, ${s}`,r=[],c=n.font!==void 0?o.byKey.get(n.font)?.cssVar:void 0;if(c&&r.push(`font-family: var(${c})`),n.size!==void 0){const a=n.largestSize!==void 0?Math.min(n.size,n.largestSize):n.size;r.push(`font-size: ${a}px`)}const g=me(n.color);g&&r.push(`color: ${g}`),n.italic===!0&&r.push("font-style: italic"),n.weight!==void 0&&r.push(`font-weight: ${n.weight}`);const f=[];n.lineHeight!==void 0&&f.push(`line-height: ${n.lineHeight}`),n.letterSpacing!==void 0&&f.push(`letter-spacing: ${n.letterSpacing}em`),i.kind==="body"&&r.push(...f);const h=ce(n.letterCase);h&&i.kind==="body"&&r.push(`text-transform: ${h}`),n.paragraphSpacing&&r.push(`--sf-part-para: ${n.paragraphSpacing}px`),r.length&&t.push(`${d} { ${r.join("; ")} }`),i.kind==="heading"&&f.length&&t.push(`${d}, ${l}:is(h1, h2, h3, h4), ${s}:is(h1, h2, h3, h4) { ${f.join("; ")} }`),i.kind==="heading"&&h&&t.push(`${s}, ${l}:is(h1, h2, h3, h4) { text-transform: ${h} }`),n.paragraphSpacing&&(t.push(`*:has(> ${s}) { --sf-part-para: ${n.paragraphSpacing}px }`),t.push(...q(`:is(${d})`,`*:has(> ${s})`))),t.push(...ze(i,d,l,s))}return t.join(`
|
|
2
|
+
`)}function ze(e,o,t,i){const n=e.values,l=H("textSize",n.size,n.sizeTablet,n.sizePhone),s=H("textSize",n.largestSize,n.largestSizeTablet,n.largestSizePhone),d=H("same",n.lineHeight,n.lineHeightTablet,n.lineHeightPhone),r=H("same",n.letterSpacing,n.letterSpacingTablet,n.letterSpacingPhone),c=H("spacing",n.paragraphSpacing,n.paragraphSpacingTablet,n.paragraphSpacingPhone),g=Z("textSize",n.size,n.sizeTablet,n.sizePhone,X()),f=ve[e.id],h=[];for(const[a,S]of[["tablet",pe],["phone",de]]){const m=[],p=[],x=g[a],y=s[a],_=l[a]===void 0&&y===void 0||x===void 0?void 0:y===void 0?x:Math.min(x,y);_!==void 0&&p.push(`font-size: ${_}px`);const z=[];d[a]!==void 0&&z.push(`line-height: ${d[a]}`),r[a]!==void 0&&z.push(`letter-spacing: ${r[a]}em`),e.kind==="body"&&p.push(...z),c[a]!==void 0&&p.push(`--sf-part-para: ${c[a]}px`),p.length&&m.push(`${o} { ${p.join("; ")} }`),e.kind==="heading"&&z.length&&m.push(`${o}, ${t}:is(h1, h2, h3, h4), ${i}:is(h1, h2, h3, h4) { ${z.join("; ")} }`),c[a]!==void 0&&m.push(`*:has(> ${i}) { --sf-part-para: ${c[a]}px }`),c[a]!==void 0&&!n.paragraphSpacing&&m.push(...q(`:is(${o})`,`*:has(> ${i})`)),_!==void 0&&f&&m.push(`.sf-themed-content { --size-${f}: ${_}px !important }`),m.length&&h.push(`@media ${S} { ${m.join(" ")} }`)}return h}const ve=Object.fromEntries(Object.entries(he).map(([e,{step:o}])=>[e,o]));function Ke(e){return e!==!0&&e!==!1?"":`em.text-accent { font-style: ${e?"italic":"normal"} }`}function Ge(e){return e?fe[e]:void 0}function $e(e){const o=ge(e);return b({font:e.font,color:e.color===void 0?void 0:ee(e.color),size:e.size,weight:e.weight,italic:e.italic,lineHeight:o.lineHeight,letterSpacing:o.letterSpacingEm,paragraphSpacing:e.paragraphSpacing,letterCase:e.case})}function We(e){return Object.keys($e(e)).length>0}function Ye({saved:e,old:o,styleId:t,values:i}){const n=oe(e);return{saved:_e(n,t,i),old:o}}function _e(e,o,t){return e.map(i=>i.id===o?F({...i,values:b({...i.values,...t})},i.auto):i)}function Je(e){const o=e.filter(t=>t.kind==="body").map(t=>Number(/^body-(\d+)$/.exec(t.id)?.[1])).filter(t=>Number.isInteger(t)&&t>0);return o.length?`body-${Math.max(...o)}`:"body-1"}export{Ke as accentItalicCss,Le as applyListChange,Je as eyebrowStyleId,Q as faceClassOf,xe as fromPanelStyles,We as hasStyleChange,Re as listChangePatch,oe as listToWrite,$e as partStyleToTextStyleValues,Ye as pushIntoStyle,M as resolveTextStyles,_e as setStyleValues,Me as siteTextFromRow,Ne as storedTextStyles,Ge as styleIdOfRole,De as textStylesCss,ie as textStylesFromOld,re as textStylesToOld,Ve as themeWithTextStyles,Fe as toPanelStyles,L as viewSizeOf};
|