efficient-web-builder 51.0.0 → 53.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 +66 -0
- package/dist/editor/components/ChatSettingsPanel.js +1 -1
- package/dist/editor/components/MediaUploadField.d.ts +7 -7
- package/dist/editor/components/MediaUploadField.js +1 -1
- package/dist/editor/components/PartSettingsPanel.js +1 -1
- package/dist/editor/components/PartTextBox.js +1 -1
- package/dist/editor/components/PreviewPartAnchors.js +1 -1
- package/dist/editor/components/PreviewPartStyleContext.d.ts +2 -2
- package/dist/editor/components/SectionTextPartBridge.js +1 -1
- package/dist/editor/components/SiteAccentField.js +1 -1
- package/dist/editor/components/SiteTextStylesField.d.ts +3 -2
- package/dist/editor/components/SiteTextStylesField.js +1 -1
- package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
- package/dist/editor/components/storefront-editor.css +82 -64
- package/dist/editor/lib/animation/entrance-fields.js +1 -1
- package/dist/editor/lib/animation/hover-fields.js +1 -1
- package/dist/editor/lib/document/ColourControl.d.ts +11 -8
- package/dist/editor/lib/document/ColourControl.js +1 -1
- package/dist/editor/lib/document/blocks/general/Breadcrumb/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/ButtonBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Cards/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Chart/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Contents/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Divider/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Hero/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/HeroSingle/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/HeroSlide/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/ImageBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/IntroBleed/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Logos/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Mockup/fields.js +2 -2
- package/dist/editor/lib/document/blocks/general/PostCard/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/SectionHeader/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Series/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/StatsParagraph/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Timeline/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/index.d.ts +2 -2
- package/dist/editor/lib/document/blocks/shared-fields.d.ts +5 -0
- package/dist/editor/lib/document/blocks/shared-fields.js +1 -1
- package/dist/editor/lib/document/box-fields.d.ts +23 -2
- package/dist/editor/lib/document/box-fields.js +1 -1
- package/dist/editor/lib/document/card-row-fields.js +1 -1
- package/dist/editor/lib/document/choice-pictures.d.ts +21 -0
- package/dist/editor/lib/document/choice-pictures.js +1 -0
- package/dist/editor/lib/document/controls.d.ts +33 -9
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/hidable-rows-drawn.d.ts +1 -0
- package/dist/editor/lib/document/hidable-rows-drawn.js +1 -1
- package/dist/editor/lib/document/overrides.js +1 -1
- package/dist/editor/lib/document/part-panel-rows.d.ts +1 -0
- package/dist/editor/lib/document/part-panel-rows.js +1 -1
- package/dist/editor/lib/document/passes/inspector.js +1 -1
- package/dist/editor/lib/document/separator-field.d.ts +9 -1
- package/dist/editor/lib/document/separator-field.js +1 -1
- package/dist/editor/lib/document/shape-picker.d.ts +37 -0
- package/dist/editor/lib/document/shape-picker.js +1 -0
- package/dist/editor/lib/document/show-for-field.d.ts +6 -0
- package/dist/editor/lib/document/show-for-field.js +1 -0
- package/dist/format/lib/animation/hover.d.ts +0 -2
- package/dist/format/lib/animation/hover.js +1 -1
- package/dist/format/lib/content/borders.d.ts +4 -2
- package/dist/format/lib/content/borders.js +1 -1
- package/dist/format/lib/content/box-layout.d.ts +21 -6
- package/dist/format/lib/content/box-layout.js +1 -1
- package/dist/format/lib/content/box-shape.d.ts +1 -5
- package/dist/format/lib/content/box-shape.js +1 -1
- package/dist/format/lib/content/box-show-for-choices.d.ts +9 -0
- package/dist/format/lib/content/box-show-for-choices.js +1 -0
- package/dist/format/lib/content/button-icon.d.ts +1 -1
- package/dist/format/lib/content/button-icon.js +1 -1
- package/dist/format/lib/content/card-state.d.ts +8 -0
- package/dist/format/lib/content/card-state.js +1 -0
- package/dist/format/lib/content/card-template.js +1 -1
- package/dist/format/lib/content/gallery-card-layout.d.ts +45 -1
- package/dist/format/lib/content/gallery-card-layout.js +1 -1
- package/dist/format/lib/content/image-aspect.d.ts +47 -0
- package/dist/format/lib/content/image-aspect.js +1 -0
- package/dist/format/lib/content/list-number.d.ts +11 -0
- package/dist/format/lib/content/list-number.js +1 -1
- package/dist/format/lib/content/phone-focus.d.ts +4 -1
- package/dist/format/lib/content/phone-focus.js +1 -1
- package/dist/format/lib/content/record-row.d.ts +14 -0
- package/dist/format/lib/content/record-row.js +1 -0
- package/dist/format/lib/content/record-types.d.ts +1 -1
- package/dist/format/lib/content/record-types.js +1 -1
- package/dist/format/lib/content/section-background.d.ts +10 -3
- package/dist/format/lib/content/section-background.js +1 -1
- package/dist/format/lib/content/section-height.d.ts +8 -0
- package/dist/format/lib/content/section-height.js +1 -1
- package/dist/format/lib/content/section-min-height.d.ts +17 -1
- package/dist/format/lib/content/section-min-height.js +1 -1
- package/dist/format/lib/content/section-sticky.d.ts +9 -0
- package/dist/format/lib/content/section-sticky.js +1 -1
- package/dist/format/lib/document/blocks/general/text-part-shapes.json +2 -2
- package/dist/format/lib/document/card-template-layers.d.ts +1 -1
- package/dist/format/lib/document/card-template-layers.js +1 -1
- package/dist/format/lib/document/media-manifest.json +5 -2
- package/dist/format/lib/document/mockup-variant-fields.d.ts +1 -0
- package/dist/format/lib/document/mockup-variant-fields.js +1 -1
- package/dist/format/lib/document/part-inks.d.ts +5 -10
- package/dist/format/lib/document/part-inks.js +1 -1
- package/dist/format/lib/document/passes/types.d.ts +1 -0
- package/dist/format/lib/document/section-catalog.js +2 -2
- package/dist/format/lib/document/section-descriptions.js +1 -1
- package/dist/format/lib/document/show-when-attach.d.ts +2 -1
- package/dist/format/lib/document/show-when-attach.js +1 -1
- package/dist/format/lib/editor-words-catalogue.d.ts +25 -14
- package/dist/format/lib/editor-words-catalogue.js +4 -4
- package/dist/format/lib/fonts.js +1 -1
- package/dist/format/lib/sections/divider-style.d.ts +4 -0
- package/dist/format/lib/sections/divider-style.js +1 -1
- package/dist/format/lib/sections/hero-single-to-hero.js +1 -1
- package/dist/format/lib/sections/section-presets.js +1 -1
- package/dist/format/lib/source-rules/editor-words.js +2 -2
- package/dist/format/lib/source-rules/mirrored-rows-agree.js +4 -4
- package/dist/format/lib/source-rules/panel-rows-use-the-shared-row.d.ts +4 -0
- package/dist/format/lib/source-rules/panel-rows-use-the-shared-row.js +37 -20
- package/dist/format/lib/source-rules/shape-rows-use-the-picker.d.ts +7 -0
- package/dist/format/lib/source-rules/shape-rows-use-the-picker.js +2 -0
- package/dist/format/lib/source-rules/support/part-slider-call-sites.d.ts +0 -1
- package/dist/format/lib/source-rules/support/part-slider-call-sites.js +6 -6
- package/dist/format/lib/text-styles/site-text-colours.d.ts +4 -0
- package/dist/format/lib/text-styles/site-text-colours.js +1 -0
- package/dist/format/lib/theme.d.ts +1 -0
- package/dist/format/lib/theme.js +3 -3
- package/dist/format/lib/word-styles.d.ts +0 -1
- package/dist/format/lib/word-styles.js +1 -1
- package/dist/render/components/Breadcrumb.d.ts +2 -1
- package/dist/render/components/Breadcrumb.js +1 -1
- package/dist/render/components/ButtonBlock.d.ts +1 -0
- package/dist/render/components/ButtonBlock.js +1 -1
- package/dist/render/components/CardRowContext.d.ts +6 -3
- package/dist/render/components/CardRowContext.js +1 -1
- package/dist/render/components/ContentsList.d.ts +4 -1
- package/dist/render/components/ContentsList.js +1 -1
- package/dist/render/components/CurrentRecord.d.ts +23 -0
- package/dist/render/components/CurrentRecord.js +1 -0
- package/dist/render/components/Flex.d.ts +3 -2
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/HeroPictures.d.ts +2 -0
- package/dist/render/components/HeroPictures.js +1 -1
- package/dist/render/components/HeroPoster.d.ts +2 -1
- package/dist/render/components/HeroPoster.js +1 -1
- package/dist/render/components/HeroSection.d.ts +2 -1
- package/dist/render/components/HeroSection.js +1 -1
- package/dist/render/components/HeroSingle.d.ts +3 -1
- package/dist/render/components/HeroSingle.js +1 -1
- package/dist/render/components/HeroSlide.d.ts +3 -1
- package/dist/render/components/HeroSlide.js +1 -1
- package/dist/render/components/ImageBlock.d.ts +5 -3
- package/dist/render/components/ImageBlock.js +1 -1
- package/dist/render/components/InBoxContext.d.ts +3 -0
- package/dist/render/components/SiteGutterFrame.d.ts +1 -0
- package/dist/render/components/SiteGutterFrame.js +1 -1
- package/dist/render/components/goldPhrases.js +2 -2
- package/dist/render/lib/content/block-size.d.ts +3 -0
- package/dist/render/lib/content/block-size.js +1 -1
- package/dist/render/lib/content/box-shared-columns.js +1 -1
- package/dist/render/lib/content/box-show-for.d.ts +14 -0
- package/dist/render/lib/content/box-show-for.js +1 -0
- package/dist/render/lib/content/page-contents.d.ts +1 -0
- package/dist/render/lib/content/page-contents.js +1 -1
- package/dist/render/lib/content/picture-focus-rows.d.ts +13 -0
- package/dist/render/lib/content/picture-focus-rows.js +1 -0
- package/dist/render/lib/document/blocks/general/Breadcrumb/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Cards/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Contents/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Hero/render.js +1 -1
- package/dist/render/lib/document/blocks/general/HeroSingle/render.js +1 -1
- package/dist/render/lib/document/blocks/general/HeroSlide/render.js +1 -1
- package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +2 -0
- 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-cards.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-stats.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.js +2 -2
- package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
- package/dist/render/lib/document/part-styles.d.ts +21 -7
- 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/borders.js +1 -1
- package/dist/render/lib/document/passes/index.js +1 -1
- package/dist/render/lib/document/passes/section-height.js +1 -1
- package/dist/render/lib/document/passes/section-sticky.js +1 -1
- package/dist/render/lib/document/passes/show-for.d.ts +2 -0
- package/dist/render/lib/document/passes/show-for.js +1 -0
- package/dist/render/lib/document/show-when.d.ts +1 -1
- package/dist/render/lib/document/show-when.js +1 -1
- package/dist/render/lib/text-styles/site-text-styles.js +2 -2
- package/package.json +3 -3
- package/dist/editor/components/PartInkControl.d.ts +0 -7
- package/dist/editor/components/PartInkControl.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as i}from"react/jsx-runtime";import{SECTION_BORDER_CLASS as d,sectionBorderStyle as c}from"../../../../format/lib/content/borders.js";import{PAD_ON_ROOT as a}from"./section-padding.js";const m={name:"sectionBorder",applies:(e,
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{SECTION_BORDER_CLASS as d,sectionBorderStyle as c}from"../../../../format/lib/content/borders.js";import{PAD_ON_ROOT as a}from"./section-padding.js";const m={name:"sectionBorder",applies:(e,o,r)=>o.isSection(e)&&!!r&&typeof r.render=="function",draw(e,o){if(a.has(o))return;const r=e.render;e.render=n=>{const t=c(n.sectionBorder,n.sectionBorderPhone,n.sectionBorderTablet),s=r(n);return t?i("div",{className:d,style:{display:"contents",...t},children:s}):s}}};export{m as sectionBorder};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{catalogueLabel as e}from"../../../../format/lib/document/passes/catalogue-labels.js";import{blockSize as n}from"./block-size.js";import{cardTemplateOnInsert as s}from"../../../../format/lib/document/passes/card-template-on-insert.js";import{cellWidth as p}from"./cell-width.js";import{clickableParts as c}from"./clickable-parts.js";import{cardCorners as f,sectionCorners as a}from"./corners.js";import{emptyHeadings as l}from"../../../../format/lib/document/passes/empty-headings.js";import{showWhenRows as d}from"../../../../format/lib/document/passes/show-when-rows.js";import{hiddenNodes as h}from"../../../../format/lib/document/passes/hidden-nodes.js";import{
|
|
1
|
+
import{catalogueLabel as e}from"../../../../format/lib/document/passes/catalogue-labels.js";import{blockSize as n}from"./block-size.js";import{cardTemplateOnInsert as s}from"../../../../format/lib/document/passes/card-template-on-insert.js";import{cellWidth as p}from"./cell-width.js";import{clickableParts as c}from"./clickable-parts.js";import{cardCorners as f,sectionCorners as a}from"./corners.js";import{emptyHeadings as l}from"../../../../format/lib/document/passes/empty-headings.js";import{showWhenRows as d}from"../../../../format/lib/document/passes/show-when-rows.js";import{hiddenNodes as h}from"../../../../format/lib/document/passes/hidden-nodes.js";import{showFor as u}from"./show-for.js";import{mediaValues as S}from"../../../../format/lib/document/passes/media-values.js";import{sectionAnchor as g}from"./section-anchor.js";import{blockEntrance as w,sectionAnimation as b}from"./section-animation.js";import{sectionHeight as A}from"./section-height.js";import{cardSticky as P,sectionSticky as k}from"./section-sticky.js";import{sectionBorder as C}from"./borders.js";import{blockPadding as W,sectionPadding as y}from"./section-padding.js";import{sectionTheme as B,slideTheme as G}from"./section-theme.js";import{buttonAlignInRow as T,containedWidth as E,sectionWidth as H}from"./section-width.js";import{blockGroups as I,sectionGroups as L}from"../../../../format/lib/document/passes/settings-groups.js";import{slotsStartAfresh as O}from"./slots-start-afresh.js";import{openSlotDisallow as R,sectionGroupAllow as z}from"../../../../format/lib/document/passes/slot-rules.js";import{registryPassContext as po}from"../../../../format/lib/document/passes/registry-context.js";const D=[O,S,z,R,y,a,C,f,W,w,p,H,E,T,A,g,B,b,k,P,G,n,L,I,d,l,c,u,h,e,s];function eo(r,m,o){const t=m;for(const i of D)i.applies(r,o,t)&&(o.inspector&&i.panel?.(t,r,o.inspector,o),i.draw?.(t,r,o));return m}export{D as BLOCK_PASSES,eo as applyBlockPasses,po as registryPassContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as v}from"react/jsx-runtime";import{SECTION_HEIGHT_MODES as u,SECTION_MIN_HEIGHT_EXCLUDED as E,hasPhoneHeight as _,hasTabletHeight as F,resolvePhoneHeight as T,resolveTabletHeight as w,resolveSectionMinHeight as x,sectionMinHeightAttrs as I}from"../../../../format/lib/content/section-min-height.js";import{CellWrap as M}from"../../../components/InBoxContext.js";import{phoneKey as S,tabletKey as a}from"efficient-easel/draw";import{shownByUsedValue as H,shownForOption as V,withRowRules as b}from"../../../../format/lib/document/show-when-attach.js";const N=(()=>{const e=n=>[[n],[a(n),n],[S(n),a(n),n]],i=n=>({field:n,in:u}),t=n=>r=>V(r,u,"auto",n),[o,s]=[e("sectionHeightValue"),e("sectionHeightUnit")];return e("sectionHeightMode").flatMap((n,r)=>[[[o[r][0]],H(n,i,t(["fixed","screen"]))],[[s[r][0]],H(n,i,t(["fixed"]))]])})(),P={name:"sectionHeight",applies:(e,i,t)=>i.isSection(e)&&!E.has(e)&&!!t&&typeof t.render=="function",panel(e,i,t){const o=t.heightFields;e.fields={...e.fields,...b(o(),N)};const s=e.resolveFields;e.resolveFields=(n,r)=>{const h=s?s(n,r):r.fields,c=n?.props??{},f=x(c),d=F(c)?w(c):null,p=_(c)?T(c):null,l=m=>g(g(O(m,f),"sectionHeightValueTablet",d),"sectionHeightValuePhone",p);return h&&typeof h.then=="function"?h.then(l):l(h)}},draw(e){const i=e.render;e.render=t=>{const o=I(t);return o?v(M,{className:o.className,style:o.style,children:i(t)}):i(t)}}};function O(e,i){if(!e||!("sectionHeightMode"in e)||i.mode==="auto")return e;const t={...e},o=t.sectionHeightValue;return o&&(t.sectionHeightValue={...o,unit:i.unit}),t}function g(e,i,t){if(!e||!(i in e)||!t||t.mode==="auto")return e;const o={...e},s=o[i];return s&&(o[i]={...s,unit:t.unit}),o}export{P as sectionHeight};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{SECTION_STICK_EXCLUDED as l,sectionStickAttrs as d}from"../../../../format/lib/content/section-sticky.js";import{shownByUsedValue as c,withRowRules as f}from"../../../../format/lib/document/show-when-attach.js";import{SlotsStartAfresh as k}from"../../../components/InBoxContext.js";import{CARD_BLOCK_KEYS as T}from"./corners.js";const m=a("sectionSticky",(e,s,t)=>s.isSection(e)&&!l.has(e)&&!!t&&typeof t.render=="function"),C=a("cardSticky",(e,s,t)=>T.includes(e)&&!!t&&typeof t.render=="function");function a(e,s){return{name:e,applies:s,panel(t,o,i){t.fields={...t.fields,...f(i.stickFields(),S)}},draw(t){const o=t.render;t.render=i=>{const n=d(i);return n?r("div",{className:n.className,style:n.style,children:r(k,{children:o(i)})}):o(i)}}}}const S=(()=>{const e=t=>({field:t,in:[!0,!1]}),s=t=>({field:t,is:!0});return[[["stickTopDistance"],s("stickTop")],[["stickTopDistanceTablet"],c(["stickTopTablet","stickTop"],e,s)],[["stickTopDistancePhone"],c(["stickTopPhone","stickTopTablet","stickTop"],e,s)]]})();export{C as cardSticky,m as sectionSticky};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{ShowForGate as d}from"../../content/box-show-for.js";import{SHOW_FOR_PROP as s,showForOf as a}from"../../../../format/lib/content/box-show-for-choices.js";const m="Flex",h={name:"showFor",applies:(n,r,e)=>n===m&&typeof e?.render=="function",draw(n){const r=n.render;n.render=e=>{const o=a(e[s])?.name;if(o===void 0)return r(e);const t=!!e.editor?.isEditing;return i(d,{name:o,editing:t,children:r(e)})}}};export{h as showFor};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ShowWhenContext, type ShowWhenRule } from "efficient-shell/format";
|
|
2
2
|
import type { SlotConfigView, TreeItem } from "efficient-easel/draw";
|
|
3
3
|
export type { ShowWhenRule, ShowWhenContext };
|
|
4
|
-
export { showWhenOf, shownForOption, truthy, withRowRules, withRowsShownWhen, withShowWhen, type RowRule, type WithShowWhen } from "../../../format/lib/document/show-when-attach.js";
|
|
4
|
+
export { showWhenOf, shownByUsedValue, shownForOption, truthy, withRowRules, withRowsShownWhen, withShowWhen, type RowRule, type WithShowWhen } from "../../../format/lib/document/show-when-attach.js";
|
|
5
5
|
export declare function visibleFields<T extends Record<string, unknown>>(fields: T, values: Readonly<Record<string, unknown>> | null | undefined, context: ShowWhenContext): T;
|
|
6
6
|
export type ShowWhenSelector = {
|
|
7
7
|
index: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isShown as
|
|
1
|
+
import{isShown as f,lazyShowWhenContext as u}from"efficient-shell/format";import{isEditorOnDynamicPage as a}from"../../../format/lib/document/editor-page-context.js";import{parentOfSelection as c}from"./selection-parent.js";import{showWhenOf as C,shownByUsedValue as b,shownForOption as R,truthy as j,withRowRules as F,withRowsShownWhen as P,withShowWhen as T}from"../../../format/lib/document/show-when-attach.js";import{showWhenOf as w}from"../../../format/lib/document/show-when-attach.js";function W(t,o,n){let r=!1;const e={};for(const[s,i]of Object.entries(t)){if(!f(w(i),o??{},n)){r=!0;continue}const p=y(i,o?.[s],o??{},n);p!==i&&(r=!0),e[s]=p}return r?e:t}function y(t,o,n,r){const e=t?.options;if(!Array.isArray(e))return t;const s=e.filter(i=>i?.value===o||!i?.showWhen||f(i.showWhen,n,r));return s.length===e.length?t:{...t,options:s}}function O(t,o,n,r){const e=c(o,n,r);return{device:t,parentType:e?.item.type,parent:e?.item.props}}function h(t,o){if(!t||typeof t!="object")return!1;const n=t;if(typeof n.context=="string"&&(n.context===o||n.context.startsWith(`${o}.`)))return!0;if("not"in n)return h(n.not,o);for(const r of[n.all,n.any])if(Array.isArray(r)&&r.some(e=>h(e,o)))return!0;return!1}function S(t,o={}){return u({parentType:()=>t.parent?.type??void 0,parent:()=>t.parent?.props??void 0,dynamicPage:()=>a(),root:()=>t.appState?.data?.root?.props,...o})}export{h as readsContext,S as resolverContext,O as showWhenContext,C as showWhenOf,b as shownByUsedValue,R as shownForOption,j as truthy,W as visibleFields,F as withRowRules,P as withRowsShownWhen,T as withShowWhen};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{defaultTextStyles as Y,textStyleCaseCss as
|
|
2
|
-
`)}function $e(e,t,i,n){const o=e.values,r=
|
|
1
|
+
import{defaultTextStyles as Y,textStyleCaseCss as le,textStyleViewKey as ce}from"efficient-easel/text-styles/model";import{phoneKey as de,resolveViewValue as B,tabletKey as pe}from"efficient-easel/draw";import{FONT_OPTIONS as ue,normalizeFonts as U}from"../../../format/lib/fonts.js";import{PHONE_MEDIA as fe,TABLET_MEDIA as ge,viewOverrides as O,viewRules as X}from"../content/view-values.js";import{STYLE_ID_OF_ROLE as he,TEXT_STYLE_ATTR as me,paragraphRules as Z,partSpacingOf as Se}from"../document/part-styles.js";import{faceClassOf as q}from"../../../format/lib/text-style-face.js";import{partColourName as Q,partInkCss as ye}from"../../../format/lib/document/part-inks.js";import{compressionMetrics as be,headingTypographyFromRow as xe,normalizeHeadingCompression as E,normalizeSizes as ee}from"../../../format/lib/theme.js";import{finiteNumber as v}from"../../../format/lib/finite-number.js";import{nonEmptyString as C}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"],P=(e,t)=>t==="desktop"?e:t==="tablet"?pe(e):de(e),k=(e,t)=>t==="desktop"?e:ce(e,t);function j(e,t,i,n=X()){return B("textSize",t,e.sizeTablet,e.sizePhone,n)[i]}const ze=[["lineSpacing","lineHeight","line"],["letterSpacing","letterSpacing","letter"]];function M(e){for(const[t,i,n]of ze)for(const o of w)if(e===k(t,o))return{key:P(i,o),view:o,spacing:n};return{key:e,view:"desktop",spacing:null}}function b(e){const t={};for(const i of ne)e[i]!==void 0&&(t[i]=e[i]);return t}function R(e,t){const{auto:i,...n}=e,o=new Set(t??[]),r=ne.filter(s=>o.has(s)&&e.values[s]===void 0);return r.length?{...n,auto:r}:n}function te(e){const t=e.fonts,i=e.sizes,n=e.typography,o=be(e.compression),r={"heading-1":{font:C(t.heading),size:v(i.headingLarge),weight:v(n.weight),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:L(n.case),largestSize:v(n.maxPx)},"heading-2":{font:C(t.heading2),size:v(i.headingMedium),weight:v(n.weight2),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:L(n.case2)},"heading-3":{font:C(t.heading3),size:v(i.headingSmall),weight:v(n.weight3),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:L(n.case3)},"body-1":{font:C(t.body),size:v(i.body)},"body-5":{font:C(t.label),size:v(i.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(i=>i&&typeof i=="object"&&typeof i.id=="string"&&(i.kind==="heading"||i.kind==="body")&&typeof i.name=="string")?e.map(i=>R({...i,values:b(i.values??{})},Array.isArray(i.auto)?i.auto:void 0)):null}function je(e){return N(e)??[]}function ie(e){return N(e)??Y().map(({id:t,kind:i,name:n})=>({id:t,kind:i,name:n,values:{}}))}function V(e,t){const i=te(t),n=N(e);return n?n.map(o=>{const r={...F(i,o.id)};for(const s of o.auto??[])delete r[s];return{...o,values:b({...r,...o.values})}}):i}const F=(e,t)=>e.find(i=>i.id===t)?.values??{},oe=["heading-1","heading-2","heading-3"];function Me({saved:e,old:t,cur:i,next:n,sizeOf:o,panelView:r="desktop"}){const s=te(t),l=ie(e),d=V(l,t),c=[],u=n.map(a=>{const S=i.find(g=>g.id===a.id),h=l.find(g=>g.id===a.id);if(!S||!h){const g=ve([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,I=y[g];if(I===void 0){delete p[$],F(s,a.id)[$]!==void 0&&(c.push([a.id,$]),x.add($));continue}if(x.delete($),K==="line")p[$]=H(I/100,3);else if(K==="letter"){const W={...d.find(A=>A.id===a.id)?.values??{}};for(const A of z)y[A]===void 0&&delete W[M(A).key];const G=b({...W,...p}),J=j(G,o({...a,values:G}),re);p[$]=J?H(I/J,4):0}else p[$]=I}return R({id:a.id,kind:a.kind,name:a.name,values:b(p)},x)});let f=t.compression;if(c.some(([a,S])=>(S==="lineHeight"||S==="letterSpacing")&&oe.includes(a))&&E(f)!=="normal"){for(const a of oe){const S=u.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)}f="normal"}return{saved:u,old:{...t,compression:f}}}function Re(e,t){const i={text_styles:e.saved};return e.old.compression!==t.compression&&(i.heading_compression=E(e.old.compression)),i}const H=(e,t)=>Number(e.toFixed(t)),se=(e,t)=>w.indexOf(e)<w.indexOf(t)?t:e;function Ve(e,t,i="desktop"){return e.map(n=>{const o={...n.values},r=t(n);for(const s of w){const l=P("lineHeight",s),d=n.values[l],c=n.values[P("letterSpacing",s)];delete o[l],d!==void 0&&(o[k("lineSpacing",s)]=H(d*100,1));const u=se(s,i);c!==void 0&&(o[k("letterSpacing",s)]=H(c*j(n.values,r,u),u===s?2:4))}return{id:n.id,kind:n.kind,name:n.name,values:o}})}function ve(e,t,i="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=t({...s,values:{...s.values}});for(const c of w){const u=o[k("lineSpacing",c)],f=o[k("letterSpacing",c)];if(typeof u=="number"&&(l[P("lineHeight",c)]=H(u/100,3)),typeof f=="number"){const m=j(s.values,d,se(c,i));l[P("letterSpacing",c)]=m?H(f/m,4):0}}return{...s,values:b(l)}})}function Fe(e){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}),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:E(e.heading_compression),typography:xe(e)},i=e.text_styles??null,n=Array.isArray(i)?ae(V(i,t),t):t;return{fonts:U(n.fonts),sizes:ee(n.sizes),compression:E(n.compression),typography:n.typography,textStyles:i}}function ae(e,t){const i=m=>e.find(a=>a.id===m)?.values??{},n=i("heading-1"),o=i("heading-2"),r=i("heading-3"),s=i("body-1"),l=i("body-5"),d=t.fonts,c=t.sizes,u=t.typography,f=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:t.compression,typography:{...u,case:f(n.letterCase),weight:n.weight??null,maxPx:n.largestSize??null,weight2:o.weight??null,weight3:r.weight??null,case2:f(o.letterCase),case3:f(r.letterCase)}}}function De(e){const t=N(e.textStyles);if(!t||t.every(o=>Object.keys(o.values).length===0&&!o.auto))return e;const i={fonts:e.fonts??{},sizes:e.sizes??{},compression:String(e.headingCompression??"normal"),typography:e.headingTypography??{}},n=ae(V(t,i),i);return{...e,fonts:n.fonts,sizes:n.sizes,headingCompression:n.compression,headingTypography:n.typography}}function Ke(e){const t=[];for(const i of e){const n=i.values,o=`.${q(i)}`,r=`[${me}="${i.id}"]`,s=`${o}, ${r}`,l=[],d=n.font!==void 0?ue.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=ye(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 u=[];n.lineHeight!==void 0&&u.push(`line-height: ${n.lineHeight}`),n.letterSpacing!==void 0&&u.push(`letter-spacing: ${n.letterSpacing}em`),i.kind==="body"&&l.push(...u);const f=le(n.letterCase);f&&i.kind==="body"&&l.push(`text-transform: ${f}`),n.paragraphSpacing&&l.push(`--sf-part-para: ${n.paragraphSpacing}px`),l.length&&t.push(`${s} { ${l.join("; ")} }`),i.kind==="heading"&&u.length&&t.push(`${s}, ${o}:is(h1, h2, h3, h4), ${r}:is(h1, h2, h3, h4) { ${u.join("; ")} }`),i.kind==="heading"&&f&&t.push(`${r}, ${o}:is(h1, h2, h3, h4) { text-transform: ${f} }`),n.paragraphSpacing&&(t.push(`*:has(> ${r}) { --sf-part-para: ${n.paragraphSpacing}px }`),t.push(...Z(`:is(${s})`,`*:has(> ${r})`))),t.push(...$e(i,s,o,r))}return t.join(`
|
|
2
|
+
`)}function $e(e,t,i,n){const o=e.values,r=O("textSize",o.size,o.sizeTablet,o.sizePhone),s=O("textSize",o.largestSize,o.largestSizeTablet,o.largestSizePhone),l=O("same",o.lineHeight,o.lineHeightTablet,o.lineHeightPhone),d=O("same",o.letterSpacing,o.letterSpacingTablet,o.letterSpacingPhone),c=O("spacing",o.paragraphSpacing,o.paragraphSpacingTablet,o.paragraphSpacingPhone),u=B("textSize",o.size,o.sizeTablet,o.sizePhone,X()),f=_e[e.id],m=[];for(const[a,S]of[["tablet",ge],["phone",fe]]){const h=[],p=[],x=u[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(`${t} { ${p.join("; ")} }`),e.kind==="heading"&&z.length&&h.push(`${t}, ${i}: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(${t})`,`*:has(> ${n})`)),_!==void 0&&f&&h.push(`.sf-themed-content { --size-${f}: ${_}px !important }`),h.length&&m.push(`@media ${S} { ${h.join(" ")} }`)}return m}const _e={"heading-1":"headingLarge","heading-2":"headingMedium","heading-3":"headingSmall","body-1":"body","body-5":"label"};function We(e){return e!==!0&&e!==!1?"":`em.text-accent { font-style: ${e?"italic":"normal"} }`}function Ge(e){return e?he[e]:void 0}function ke(e){const t=Se(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:t.lineHeight,letterSpacing:t.letterSpacingEm,paragraphSpacing:e.paragraphSpacing,letterCase:e.case})}function Je(e){return Object.keys(ke(e)).length>0}function Ye({saved:e,old:t,styleId:i,values:n}){const o=ie(e);return{saved:Te(o,i,n),old:t}}function Te(e,t,i){return e.map(n=>n.id===t?R({...n,values:b({...n.values,...i})},n.auto):n)}function Be(e){const t=e.filter(i=>i.kind==="body").map(i=>Number(/^body-(\d+)$/.exec(i.id)?.[1])).filter(i=>Number.isInteger(i)&&i>0);return t.length?`body-${Math.max(...t)}`:"body-1"}export{We as accentItalicCss,Me as applyListChange,Be as eyebrowStyleId,q as faceClassOf,ve as fromPanelStyles,Je as hasStyleChange,Re as listChangePatch,ie as listToWrite,ke as partStyleToTextStyleValues,Ye as pushIntoStyle,V as resolveTextStyles,Te as setStyleValues,Fe as siteTextFromRow,je as storedTextStyles,Ge as styleIdOfRole,Ke as textStylesCss,te as textStylesFromOld,ae as textStylesToOld,De as themeWithTextStyles,Ve 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": "53.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",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@tabler/icons-react": "^3.46.0",
|
|
56
|
-
"efficient-easel": "^27.
|
|
56
|
+
"efficient-easel": "^27.6.0",
|
|
57
57
|
"efficient-shell": "^11.8.0",
|
|
58
58
|
"isomorphic-dompurify": "^3.18.0",
|
|
59
59
|
"next": ">=16",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"@types/node": "^20",
|
|
73
73
|
"@types/react": "^19",
|
|
74
74
|
"@types/react-dom": "^19",
|
|
75
|
-
"efficient-easel": "^27.
|
|
75
|
+
"efficient-easel": "^27.6.0",
|
|
76
76
|
"efficient-shell": "^11.8.0",
|
|
77
77
|
"esbuild": "^0.28.0",
|
|
78
78
|
"happy-dom": "^20.14.5",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { PartInk } from "../../format/lib/document/part-inks.js";
|
|
2
|
-
export declare function PartInkControl({ value, label, colors, onChange, }: {
|
|
3
|
-
value: string | null;
|
|
4
|
-
label: string;
|
|
5
|
-
colors: readonly PartInk[];
|
|
6
|
-
onChange: (next: string | null) => void;
|
|
7
|
-
}): import("react").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{jsx as o,jsxs as n}from"react/jsx-runtime";import{parseHexColor as c}from"efficient-shell/format";import{ColorSwatch as f,Tooltip as k}from"efficient-shell/ui";import{say as s}from"../../format/lib/editor-words.js";import{AnyColourSwatch as u}from"../lib/document/ColourControl.js";function v({value:t,label:i,colors:p,onChange:m}){const d=t===null,a=t||void 0,r=p.find(e=>e.key===a),l=r?r.value:a&&c(a)===a.toLowerCase()?a:void 0;return n("div",{className:"sf-part-ink",children:[n("div",{className:"sf-part-ink-top",children:[o("span",{className:"sf-part-ink-label",children:s(i)}),o("span",{className:"sf-part-ink-read",children:l?l.toUpperCase():d?s("Mixed"):s("Follows the style")})]}),n("div",{className:"sf-part-ink-swatches",role:"group","aria-label":s(i),children:[p.map(e=>o(k,{content:`${s(e.name)} · ${e.value.toUpperCase()}`,children:o(f,{color:e.value,"aria-label":s(e.name),size:"sm",selected:a===e.key,onClick:()=>m(a===e.key?null:e.key)})},e.key)),u({value:r?"":(l??"").toLowerCase(),label:"Any color",onChange:m})]})]})}export{v as PartInkControl};
|