efficient-web-builder 63.0.0 → 65.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/dist/editor/components/PreviewPartAnchors.js +1 -1
- package/dist/editor/lib/animation/entrance-fields.js +1 -1
- package/dist/editor/lib/animation/fields.js +1 -1
- package/dist/editor/lib/animation/loop-fields.js +1 -1
- package/dist/editor/lib/animation/scroll-fields.d.ts +3 -0
- package/dist/editor/lib/animation/scroll-fields.js +1 -0
- package/dist/editor/lib/animation/view-rows.d.ts +20 -0
- package/dist/editor/lib/animation/view-rows.js +1 -0
- package/dist/editor/lib/document/blocks/general/FAQ/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/IntroBleed/fields.js +1 -1
- package/dist/editor/lib/document/card-display-chips.d.ts +3 -2
- package/dist/editor/lib/document/card-display-chips.js +1 -1
- package/dist/editor/lib/document/card-row-fields.js +1 -1
- package/dist/editor/lib/document/controls.d.ts +8 -2
- 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-motion-canvas.d.ts +2 -1
- package/dist/editor/lib/document/part-motion-canvas.js +1 -1
- package/dist/format/lib/animation/entrance-keys.d.ts +8 -0
- package/dist/format/lib/animation/entrance-keys.js +1 -0
- package/dist/format/lib/animation/loop.d.ts +1 -0
- package/dist/format/lib/animation/loop.js +1 -1
- package/dist/format/lib/animation/mark-zoom.d.ts +11 -0
- package/dist/format/lib/animation/mark-zoom.js +1 -0
- package/dist/format/lib/animation/scroll.d.ts +19 -0
- package/dist/format/lib/animation/scroll.js +1 -0
- package/dist/format/lib/animation/views.d.ts +6 -0
- package/dist/format/lib/animation/views.js +1 -0
- package/dist/format/lib/content/block-sources.js +1 -1
- package/dist/format/lib/content/box-shape.d.ts +1 -1
- package/dist/format/lib/content/card-template.d.ts +8 -5
- package/dist/format/lib/content/card-template.js +1 -1
- package/dist/format/lib/content/image-aspect.d.ts +6 -0
- package/dist/format/lib/content/image-aspect.js +1 -1
- package/dist/format/lib/content/section-sticky.d.ts +57 -13
- package/dist/format/lib/content/section-sticky.js +1 -1
- package/dist/format/lib/content/slot-field-blocks.d.ts +1 -0
- package/dist/format/lib/content/slot-field-blocks.js +1 -0
- package/dist/format/lib/document/blocks/block-types.d.ts +2 -0
- package/dist/format/lib/document/blocks/general/Banner/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/ContactLocations/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/FeaturedCover/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/Hero/meta.d.ts +1 -0
- package/dist/format/lib/document/blocks/general/Hero/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/HeroSingle/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/ImageBlock/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/IntroBleed/meta.js +2 -2
- package/dist/format/lib/document/blocks/general/LogoBlock/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/Logos/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/LongRead/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/Manifesto/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/PaymentBadges/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/PostCard/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/ProcessSteps/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/SectionHeader/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/Split/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/Timeline/meta.js +1 -1
- package/dist/format/lib/document/passes/types.d.ts +6 -1
- package/dist/format/lib/editor-words-catalogue.d.ts +16 -0
- package/dist/format/lib/editor-words-catalogue.js +5 -5
- package/dist/format/lib/sections/hero-single-to-hero.js +1 -1
- package/dist/format/lib/source-rules/motion-vars-from-the-shell.d.ts +6 -0
- package/dist/format/lib/source-rules/motion-vars-from-the-shell.js +4 -0
- package/dist/render/components/Banner.js +1 -1
- package/dist/render/components/CardRowContext.d.ts +1 -0
- package/dist/render/components/CardRowContext.js +1 -1
- package/dist/render/components/ContactLocations.js +2 -2
- package/dist/render/components/HeroPictures.d.ts +23 -6
- package/dist/render/components/HeroPictures.js +1 -1
- package/dist/render/components/HeroSection.js +1 -1
- package/dist/render/components/HeroSingle.js +1 -1
- package/dist/render/components/HeroSlide.js +1 -1
- package/dist/render/components/ImageBlock.js +1 -1
- package/dist/render/components/InBoxContext.d.ts +2 -1
- package/dist/render/components/InBoxContext.js +1 -1
- package/dist/render/components/IntroBleed.d.ts +1 -2
- package/dist/render/components/IntroBleed.js +1 -1
- package/dist/render/components/LogoBlock.js +1 -1
- package/dist/render/components/Logos.js +1 -1
- package/dist/render/components/PictureZoom.d.ts +24 -0
- package/dist/render/components/PictureZoom.js +1 -0
- package/dist/render/components/Placeholder.js +1 -1
- package/dist/render/components/PublishedPartStylesContext.js +1 -1
- package/dist/render/components/ScrollEffect.d.ts +14 -0
- package/dist/render/components/ScrollEffect.js +1 -0
- package/dist/render/components/ScrollProgressArm.d.ts +5 -0
- package/dist/render/components/ScrollProgressArm.js +1 -0
- package/dist/render/components/SectionAnimation.d.ts +9 -13
- package/dist/render/components/SectionAnimation.js +1 -1
- package/dist/render/components/SectionHeader.js +1 -1
- package/dist/render/lib/animation/entrance.d.ts +6 -14
- package/dist/render/lib/animation/entrance.js +1 -1
- package/dist/render/lib/animation/part-motion.d.ts +4 -1
- package/dist/render/lib/animation/part-motion.js +2 -2
- package/dist/render/lib/document/blocks/general/CardList/render.js +1 -1
- package/dist/render/lib/document/blocks/general/IntroBleed/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-editorial.js +1 -1
- package/dist/render/lib/document/page-frame.d.ts +2 -1
- package/dist/render/lib/document/page-frame.js +1 -1
- package/dist/render/lib/document/part-styles.d.ts +10 -0
- package/dist/render/lib/document/part-styles.js +2 -2
- package/dist/render/lib/document/passes/index.js +1 -1
- package/dist/render/lib/document/passes/scroll-effect.d.ts +3 -0
- package/dist/render/lib/document/passes/scroll-effect.js +1 -0
- package/dist/render/lib/document/passes/section-animation.js +1 -1
- package/dist/render/lib/document/passes/section-sticky.js +1 -1
- package/dist/render/lib/document/passes/slots-start-afresh.js +1 -1
- package/dist/render/lib/text-styles/site-text-styles.js +2 -2
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{defaultTextStyles as Y,textStyleCaseCss as le,textStyleViewKey as ce}from"efficient-easel/text-styles/model";import{
|
|
2
|
-
`)}function
|
|
1
|
+
import{defaultTextStyles as Y,textStyleCaseCss as le,textStyleViewKey as ce}from"efficient-easel/text-styles/model";import{resolveViewValue as B}from"efficient-easel/draw";import{viewKey as O}from"../../../format/lib/animation/views.js";import{FONT_OPTIONS as de,normalizeFonts as U}from"../../../format/lib/fonts.js";import{PHONE_MEDIA as pe,TABLET_MEDIA as fe,viewOverrides as C,viewRules as X}from"../content/view-values.js";import{STYLE_ID_OF_ROLE as ue,TEXT_STYLE_ATTR as ge,paragraphRules as Z,partSpacingOf as he}from"../document/part-styles.js";import{faceClassOf as q}from"../../../format/lib/text-style-face.js";import{partColourName as Q,partInkCss as me}from"../../../format/lib/document/part-inks.js";import{compressionMetrics as Se,headingTypographyFromRow as ye,normalizeHeadingCompression as I,normalizeSizes as ee}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 L=e=>e==="sentence"?"none":void 0,ne=["font","color","size","sizeTablet","sizePhone","weight","italic","lineHeight","lineHeightTablet","lineHeightPhone","letterSpacing","letterSpacingTablet","letterSpacingPhone","paragraphSpacing","paragraphSpacingTablet","paragraphSpacingPhone","letterCase","largestSize","largestSizeTablet","largestSizePhone"],w=["desktop","tablet","phone"],k=(e,i)=>i==="desktop"?e:ce(e,i);function j(e,i,t,n=X()){return B("textSize",i,e.sizeTablet,e.sizePhone,n)[t]}const be=[["lineSpacing","lineHeight","line"],["letterSpacing","letterSpacing","letter"]];function M(e){for(const[i,t,n]of be)for(const o of w)if(e===k(i,o))return{key:O(t,o),view:o,spacing:n};return{key:e,view:"desktop",spacing:null}}function b(e){const i={};for(const t of ne)e[t]!==void 0&&(i[t]=e[t]);return i}function R(e,i){const{auto:t,...n}=e,o=new Set(i??[]),r=ne.filter(s=>o.has(s)&&e.values[s]===void 0);return r.length?{...n,auto:r}:n}function te(e){const i=e.fonts,t=e.sizes,n=e.typography,o=Se(e.compression),r={"heading-1":{font:P(i.heading),size:v(t.headingLarge),weight:v(n.weight),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:L(n.case),largestSize:v(n.maxPx)},"heading-2":{font:P(i.heading2),size:v(t.headingMedium),weight:v(n.weight2),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:L(n.case2)},"heading-3":{font:P(i.heading3),size:v(t.headingSmall),weight:v(n.weight3),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:L(n.case3)},"body-1":{font:P(i.body),size:v(t.body)},"body-5":{font:P(i.label),size:v(t.label)}};return Y().map(({id:s,kind:l,name:d})=>({id:s,kind:l,name:d,values:b(r[s]??{})}))}function N(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=>R({...t,values:b(t.values??{})},Array.isArray(t.auto)?t.auto:void 0)):null}function Le(e){return N(e)??[]}function ie(e){return N(e)??Y().map(({id:i,kind:t,name:n})=>({id:i,kind:t,name:n,values:{}}))}function V(e,i){const t=te(i),n=N(e);return n?n.map(o=>{const r={...F(t,o.id)};for(const s of o.auto??[])delete r[s];return{...o,values:b({...r,...o.values})}}):t}const F=(e,i)=>e.find(t=>t.id===i)?.values??{},oe=["heading-1","heading-2","heading-3"];function je({saved:e,old:i,cur:t,next:n,sizeOf:o,panelView:r="desktop"}){const s=te(i),l=ie(e),d=V(l,i),c=[],f=n.map(a=>{const S=t.find(g=>g.id===a.id),h=l.find(g=>g.id===a.id);if(!S||!h){const g=xe([a],o,r)[0],T=g.values.color;return T===void 0?g:{...g,values:{...g.values,color:Q(T)}}}const p={...h.values},x=new Set(h.auto??[]),y=a.values,_=S.values,z=[...new Set([...Object.keys(y),...Object.keys(_)])].filter(g=>JSON.stringify(y[g])!==JSON.stringify(_[g])),D=g=>M(g).spacing==="letter";z.sort((g,T)=>Number(D(g))-Number(D(T)));for(const g of z){const{key:T,view:re,spacing:K}=M(g),$=T,A=y[g];if(A===void 0){delete p[$],F(s,a.id)[$]!==void 0&&(c.push([a.id,$]),x.add($));continue}if(x.delete($),K==="line")p[$]=H(A/100,3);else if(K==="letter"){const W={...d.find(E=>E.id===a.id)?.values??{}};for(const E of z)y[E]===void 0&&delete W[M(E).key];const G=b({...W,...p}),J=j(G,o({...a,values:G}),re);p[$]=J?H(A/J,4):0}else p[$]=A}return R({id:a.id,kind:a.kind,name:a.name,values:b(p)},x)});let u=i.compression;if(c.some(([a,S])=>(S==="lineHeight"||S==="letterSpacing")&&oe.includes(a))&&I(u)!=="normal"){for(const a of oe){const S=f.find(p=>p.id===a);if(!S)continue;const h={...S.values};for(const p of["lineHeight","letterSpacing"])c.some(([x,y])=>x===a&&y===p)||h[p]===void 0&&!(S.auto??[]).includes(p)&&(h[p]=F(s,a)[p]);S.values=b(h)}u="normal"}return{saved:f,old:{...i,compression:u}}}function Me(e,i){const t={text_styles:e.saved};return e.old.compression!==i.compression&&(t.heading_compression=I(e.old.compression)),t}const H=(e,i)=>Number(e.toFixed(i)),se=(e,i)=>w.indexOf(e)<w.indexOf(i)?i:e;function Re(e,i,t="desktop"){return e.map(n=>{const o={...n.values},r=i(n);for(const s of w){const l=O("lineHeight",s),d=n.values[l],c=n.values[O("letterSpacing",s)];delete o[l],d!==void 0&&(o[k("lineSpacing",s)]=H(d*100,1));const f=se(s,t);c!==void 0&&(o[k("letterSpacing",s)]=H(c*j(n.values,r,f),f===s?2:4))}return{id:n.id,kind:n.kind,name:n.name,values:o}})}function xe(e,i,t="desktop"){return e.map(n=>{const o=n.values,r={...o};for(const c of w)delete r[k("lineSpacing",c)],delete r[k("letterSpacing",c)];const s={id:n.id,kind:n.kind,name:n.name,values:b(r)},l={...s.values},d=i({...s,values:{...s.values}});for(const c of w){const f=o[k("lineSpacing",c)],u=o[k("letterSpacing",c)];if(typeof f=="number"&&(l[O("lineHeight",c)]=H(f/100,3)),typeof u=="number"){const m=j(s.values,d,se(c,t));l[O("letterSpacing",c)]=m?H(u/m,4):0}}return{...s,values:b(l)}})}function Ve(e){const i={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}),sizes:ee({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)},t=e.text_styles??null,n=Array.isArray(t)?ae(V(t,i),i):i;return{fonts:U(n.fonts),sizes:ee(n.sizes),compression:I(n.compression),typography:n.typography,textStyles:t}}function ae(e,i){const t=m=>e.find(a=>a.id===m)?.values??{},n=t("heading-1"),o=t("heading-2"),r=t("heading-3"),s=t("body-1"),l=t("body-5"),d=i.fonts,c=i.sizes,f=i.typography,u=m=>m==="none"?"sentence":"authored";return{fonts:{...d,heading:n.font??d.heading,heading2:o.font??n.font??d.heading2,heading3:r.font??n.font??d.heading3,body:s.font??d.body,label:l.font??d.label},sizes:{...c,headingLarge:n.size??null,headingMedium:o.size??null,headingSmall:r.size??null,body:s.size??null,label:l.size??null},compression:i.compression,typography:{...f,case:u(n.letterCase),weight:n.weight??null,maxPx:n.largestSize??null,weight2:o.weight??null,weight3:r.weight??null,case2:u(o.letterCase),case3:u(r.letterCase)}}}function Fe(e){const i=N(e.textStyles);if(!i||i.every(o=>Object.keys(o.values).length===0&&!o.auto))return e;const t={fonts:e.fonts??{},sizes:e.sizes??{},compression:String(e.headingCompression??"normal"),typography:e.headingTypography??{}},n=ae(V(i,t),t);return{...e,fonts:n.fonts,sizes:n.sizes,headingCompression:n.compression,headingTypography:n.typography}}function De(e){const i=[];for(const t of e){const n=t.values,o=`.${q(t)}`,r=`[${ge}="${t.id}"]`,s=`${o}, ${r}`,l=[],d=n.font!==void 0?de.find(m=>m.key===n.font)?.cssVar:void 0;if(d&&l.push(`font-family: var(${d})`),n.size!==void 0){const m=n.largestSize!==void 0?Math.min(n.size,n.largestSize):n.size;l.push(`font-size: ${m}px`)}const c=me(n.color);c&&l.push(`color: ${c}`),n.italic===!0&&l.push("font-style: italic"),n.weight!==void 0&&l.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`),t.kind==="body"&&l.push(...f);const u=le(n.letterCase);u&&t.kind==="body"&&l.push(`text-transform: ${u}`),n.paragraphSpacing&&l.push(`--sf-part-para: ${n.paragraphSpacing}px`),l.length&&i.push(`${s} { ${l.join("; ")} }`),t.kind==="heading"&&f.length&&i.push(`${s}, ${o}:is(h1, h2, h3, h4), ${r}:is(h1, h2, h3, h4) { ${f.join("; ")} }`),t.kind==="heading"&&u&&i.push(`${r}, ${o}:is(h1, h2, h3, h4) { text-transform: ${u} }`),n.paragraphSpacing&&(i.push(`*:has(> ${r}) { --sf-part-para: ${n.paragraphSpacing}px }`),i.push(...Z(`:is(${s})`,`*:has(> ${r})`))),i.push(...ze(t,s,o,r))}return i.join(`
|
|
2
|
+
`)}function ze(e,i,t,n){const o=e.values,r=C("textSize",o.size,o.sizeTablet,o.sizePhone),s=C("textSize",o.largestSize,o.largestSizeTablet,o.largestSizePhone),l=C("same",o.lineHeight,o.lineHeightTablet,o.lineHeightPhone),d=C("same",o.letterSpacing,o.letterSpacingTablet,o.letterSpacingPhone),c=C("spacing",o.paragraphSpacing,o.paragraphSpacingTablet,o.paragraphSpacingPhone),f=B("textSize",o.size,o.sizeTablet,o.sizePhone,X()),u=ve[e.id],m=[];for(const[a,S]of[["tablet",fe],["phone",pe]]){const h=[],p=[],x=f[a],y=s[a],_=r[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=[];l[a]!==void 0&&z.push(`line-height: ${l[a]}`),d[a]!==void 0&&z.push(`letter-spacing: ${d[a]}em`),e.kind==="body"&&p.push(...z),c[a]!==void 0&&p.push(`--sf-part-para: ${c[a]}px`),p.length&&h.push(`${i} { ${p.join("; ")} }`),e.kind==="heading"&&z.length&&h.push(`${i}, ${t}:is(h1, h2, h3, h4), ${n}:is(h1, h2, h3, h4) { ${z.join("; ")} }`),c[a]!==void 0&&h.push(`*:has(> ${n}) { --sf-part-para: ${c[a]}px }`),c[a]!==void 0&&!o.paragraphSpacing&&h.push(...Z(`:is(${i})`,`*:has(> ${n})`)),_!==void 0&&u&&h.push(`.sf-themed-content { --size-${u}: ${_}px !important }`),h.length&&m.push(`@media ${S} { ${h.join(" ")} }`)}return m}const ve={"heading-1":"headingLarge","heading-2":"headingMedium","heading-3":"headingSmall","body-1":"body","body-5":"label"};function Ke(e){return e!==!0&&e!==!1?"":`em.text-accent { font-style: ${e?"italic":"normal"} }`}function We(e){return e?ue[e]:void 0}function $e(e){const i=he(e);return b({font:e.font,color:e.color===void 0?void 0:Q(e.color),size:e.size,weight:e.weight,italic:e.italic,lineHeight:i.lineHeight,letterSpacing:i.letterSpacingEm,paragraphSpacing:e.paragraphSpacing,letterCase:e.case})}function Ge(e){return Object.keys($e(e)).length>0}function Je({saved:e,old:i,styleId:t,values:n}){const o=ie(e);return{saved:_e(o,t,n),old:i}}function _e(e,i,t){return e.map(n=>n.id===i?R({...n,values:b({...n.values,...t})},n.auto):n)}function Ye(e){const i=e.filter(t=>t.kind==="body").map(t=>Number(/^body-(\d+)$/.exec(t.id)?.[1])).filter(t=>Number.isInteger(t)&&t>0);return i.length?`body-${Math.max(...i)}`:"body-1"}export{Ke as accentItalicCss,je as applyListChange,Ye as eyebrowStyleId,q as faceClassOf,xe as fromPanelStyles,Ge as hasStyleChange,Me as listChangePatch,ie as listToWrite,$e as partStyleToTextStyleValues,Je as pushIntoStyle,V as resolveTextStyles,_e as setStyleValues,Ve as siteTextFromRow,Le as storedTextStyles,We as styleIdOfRole,De as textStylesCss,te as textStylesFromOld,ae as textStylesToOld,Fe as themeWithTextStyles,Re as toPanelStyles,j as viewSizeOf};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-web-builder",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "65.0.0",
|
|
4
4
|
"description": "The EFFICIENT website builder: the website editor, the general sections and the renderer that draws them, compiled. Hostable by any EFFICIENT product; nothing here imports a host.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Efficient Pty Ltd",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@tabler/icons-react": "^3.46.0",
|
|
56
56
|
"efficient-easel": "^30.1.0",
|
|
57
|
-
"efficient-shell": "^12.
|
|
57
|
+
"efficient-shell": "^12.22.0",
|
|
58
58
|
"isomorphic-dompurify": "^3.18.0",
|
|
59
59
|
"next": ">=16",
|
|
60
60
|
"react": ">=19",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@types/react": "^19",
|
|
74
74
|
"@types/react-dom": "^19",
|
|
75
75
|
"efficient-easel": "^30.1.0",
|
|
76
|
-
"efficient-shell": "^12.
|
|
76
|
+
"efficient-shell": "^12.22.0",
|
|
77
77
|
"esbuild": "^0.28.0",
|
|
78
78
|
"happy-dom": "^20.14.5",
|
|
79
79
|
"isomorphic-dompurify": "^3.18.0",
|