efficient-web-builder 72.0.0 → 73.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 +29 -0
- package/dist/editor/components/AddPageWindow.js +1 -1
- package/dist/editor/components/MediaUploadField.d.ts +2 -1
- package/dist/editor/components/PageStarterCard.js +1 -1
- package/dist/editor/components/SideSpaceField.d.ts +3 -0
- package/dist/editor/components/SideSpaceField.js +1 -1
- package/dist/editor/components/storefront-editor.css +9 -19
- package/dist/editor/lib/content/site-length-rows.js +1 -1
- package/dist/editor/lib/document/blocks/hero-shared-fields.js +1 -1
- package/dist/editor/lib/document/controls.d.ts +4 -2
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/shape-picker.d.ts +16 -8
- package/dist/editor/lib/document/shape-picker.js +1 -1
- package/dist/editor/lib/document/show-when-resolve.js +1 -1
- package/dist/format/lib/content/box-shape.d.ts +2 -1
- package/dist/format/lib/content/box-shape.js +1 -1
- package/dist/format/lib/content/css-length.d.ts +2 -3
- package/dist/format/lib/content/css-length.js +1 -1
- package/dist/format/lib/content/gallery-card-layout.d.ts +22 -1
- package/dist/format/lib/content/gallery-card-layout.js +1 -1
- package/dist/format/lib/content/grid-span.d.ts +15 -2
- package/dist/format/lib/content/grid-span.js +1 -1
- package/dist/format/lib/content/image-aspect.d.ts +5 -3
- package/dist/format/lib/content/image-aspect.js +1 -1
- package/dist/format/lib/content/page-width.d.ts +3 -0
- package/dist/format/lib/content/page-width.js +1 -1
- package/dist/format/lib/content/section-min-height.js +1 -1
- package/dist/format/lib/content/view-hide-class.js +1 -1
- package/dist/format/lib/content/view-tier.d.ts +2 -2
- package/dist/format/lib/document/style-text.d.ts +1 -0
- package/dist/format/lib/document/style-text.js +1 -0
- package/dist/format/lib/editor-words-catalogue.d.ts +3 -0
- package/dist/format/lib/editor-words-catalogue.js +1 -1
- package/dist/format/lib/site-twin-row.d.ts +2 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/ImageBlock.js +1 -1
- package/dist/render/components/PublishedPartStylesContext.js +1 -1
- package/dist/render/lib/content/section-padding.d.ts +2 -1
- package/dist/render/lib/document/blocks/general/CustomHTML/render.js +1 -1
- package/dist/render/lib/document/custom-css.d.ts +7 -0
- package/dist/render/lib/document/custom-css.js +2 -0
- package/dist/render/lib/document/part-styles.d.ts +2 -2
- package/dist/render/lib/document/passes/cell-width.js +1 -1
- package/dist/render/lib/document/render-registry.js +1 -1
- package/package.json +9 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as E,jsx as f,jsxs as O}from"react/jsx-runtime";import{createContext as P,useContext as m,useEffect as A,useId as k,useMemo as F,useRef as M}from"react";import{armEntrance as j}from"efficient-shell/format";import{blockDrawsTextStyle as D,partRuleForKind as y,partRuleForText as K,partStyleCss as L,publishedPartStyles as N}from"../lib/document/part-styles.js";import{useViewWidth as I}from"./SectionAnimation.js";import{useDrawsAtEdge as $}from"./InBoxContext.js";import{styleKeyForPart as B}from"../../format/lib/sections/section-text-kinds.js";import{NO_MOTIONS as H,PART_LIFT_ATTR as
|
|
1
|
+
"use client";import{Fragment as E,jsx as f,jsxs as O}from"react/jsx-runtime";import{createContext as P,useContext as m,useEffect as A,useId as k,useMemo as F,useRef as M}from"react";import{armEntrance as j}from"efficient-shell/format";import{blockDrawsTextStyle as D,partRuleForKind as y,partRuleForText as K,partStyleCss as L,publishedPartStyles as N}from"../lib/document/part-styles.js";import{useViewWidth as I}from"./SectionAnimation.js";import{useDrawsAtEdge as $}from"./InBoxContext.js";import{styleKeyForPart as B}from"../../format/lib/sections/section-text-kinds.js";import{NO_MOTIONS as H,PART_LIFT_ATTR as T,drawPartEntrance as J,drawPartScroll as W,ensurePartLiftSheet as Y,firstOnPage as b,partBoxOf as V,partMotionDrawn as q,partMoves as z}from"../lib/animation/part-motion.js";import{styleElementText as G}from"../../format/lib/document/style-text.js";const S=P(null),R=P(null),_=P(null);function ue({needles:e,styles:t,motions:r=H,type:o,atEdge:n=!1,children:i}){const u=k(),d=$(n?"edge":"by-box"),x=JSON.stringify([u,e,t,r,o]),c=F(()=>{const p=Object.keys(r).filter(l=>z(r[l]));return N(e,t,u,l=>B(o,l),l=>D(o,l),l=>p.includes(l)?q(r[l]):null,p)},[x]);if(!c)return f(E,{children:i});const s=L(c,{inBox:d});return O(E,{children:[s&&f("style",{href:`${Q}${u}-${U(s)}`,precedence:w,dangerouslySetInnerHTML:{__html:G(s)}}),f(S.Provider,{value:c,children:i})]})}const g=new WeakMap;function v(e,t){const r=b(t.filter(n=>n.arm)),o=t.some(n=>n.entering)?void 0:b(t.filter(n=>n.scroll));for(const n of t)n!==r&&n.undo&&(n.undo(),n.undo=void 0),n!==o&&n.undoScroll&&(n.undoScroll(),n.undoScroll=void 0);r?.arm&&!r.undo&&(r.undo=r.arm()),o?.scroll&&!o.undoScroll&&(o.undoScroll=o.scroll()),t.some(n=>n.lift)?(Y(e.ownerDocument),e.setAttribute(T,"")):e.removeAttribute(T)}function ce(e){const t=M(null),r=e?.motion?.entrance??null,o=e?.motion?.scroll??null,n=e?.motion?.hover==="lift",i=I(t,r!==null||o!==null),u=r?r[i]:null,d=o&&o[i].effect!=="none"?o[i]:null,x=JSON.stringify([u,d]);return A(()=>{const c=t.current,s=V(c?.parentElement??null);if(!r&&!o&&!n||!c||!s)return;const p=u?()=>{const h=J(s,u),C=j(s);return()=>{C?.(),h()}}:null,l=g.get(s)??[];g.set(s,l);const a={element:c,arm:p,entering:u!==null&&u.kind!=="none",scroll:d?()=>W(s,d):null,lift:n};return l.push(a),v(s,l),()=>{const h=l.indexOf(a);h<0||(l.splice(h,1),a.undo?.(),a.undo=void 0,a.undoScroll?.(),a.undoScroll=void 0,v(s,l),l.length||g.delete(s))}},[x,n]),t}const w="sf-part-styles",Q=`${w}-`;function U(e){let t=2166136261;for(let r=0;r<e.length;r+=1)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function ie(e){const t=m(S),r=m(R),o=K(t,e);return o&&o.stamp!==r?o:null}function ae(e){return y(m(S),e)}function de({stamp:e,children:t}){return f(R.Provider,{value:e,children:t})}function fe({children:e}){const t=m(S);return f(_.Provider,{value:t,children:e})}function me(e){return y(m(_),e)}export{de as ClaimedStamp,w as PART_STYLES_PRECEDENCE,ue as PublishedPartStyles,fe as SharedPartKinds,ce as usePartEntrance,ae as usePublishedPartKindRule,ie as usePublishedPartRule,me as usePublishedSharedKindRule};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CSSProperties } from "react";
|
|
2
|
+
import { type ViewTier } from "efficient-easel/draw";
|
|
2
3
|
import { type SiteSide } from "efficient-easel/screen/lib/content/length-units";
|
|
3
4
|
export declare const SECTION_PADDING: {
|
|
4
5
|
readonly min: 10;
|
|
@@ -34,7 +35,7 @@ export type PadSides = {
|
|
|
34
35
|
bottom?: unknown;
|
|
35
36
|
left?: unknown;
|
|
36
37
|
};
|
|
37
|
-
export declare function padDefaultIn(px: number, unit: unknown, tier:
|
|
38
|
+
export declare function padDefaultIn(px: number, unit: unknown, tier: ViewTier): number;
|
|
38
39
|
export type PadUnits = {
|
|
39
40
|
desktop?: unknown;
|
|
40
41
|
tablet?: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{HideTaker as m}from"../../../../../components/ViewHideRoot.js";import{CUSTOM_HTML_SCOPE_ATTR as p,scopeCustomCss as T,splitCustomHtml as l}from"../../../custom-css.js";import{CustomHTMLMeta as u}from"../../../../../../format/lib/document/blocks/general/CustomHTML/meta.js";const a={...u,render:({html:n,id:t})=>{const{css:r,markup:s}=l(n??""),o=r?T(r,String(t??"")):"";return o?e(m,{[p]:t,dangerouslySetInnerHTML:{__html:`<style>${o}</style>${s}`}}):e(m,{dangerouslySetInnerHTML:{__html:s}})}};export{a as CustomHTMLRender};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const CUSTOM_HTML_SCOPE_ATTR = "data-sf-custom-html";
|
|
2
|
+
export declare function customHtmlScope(id: string): string;
|
|
3
|
+
export declare function scopeCustomCss(css: string, id: string): string;
|
|
4
|
+
export declare function splitCustomHtml(html: string): {
|
|
5
|
+
css: string;
|
|
6
|
+
markup: string;
|
|
7
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import y from"isomorphic-dompurify";import S from"postcss";import w from"postcss-selector-parser";import{sanitizeHtml as C}from"./sanitize.js";import{styleElementText as d}from"../../../format/lib/document/style-text.js";const O="data-sf-custom-html",g=/^[A-Za-z][\w-]*$/;function E(n){return`[${O}="${n}"]`}const m=new Set(["media","supports","container"]),_=new Set(["behavior","-moz-binding"]),h=/expression\s*\(|javascript:|vbscript:/i,T=/^[a-z][a-z0-9+.-]*:/i,A=new Set(["none","initial","inherit","unset","revert","revert-layer","default","auto","normal","ease","ease-in","ease-out","ease-in-out","linear","step-start","step-end","infinite","reverse","alternate","alternate-reverse","forwards","backwards","both","running","paused"]);function $(n){return n.replace(/\\([0-9a-f]{1,6})\s?|\\(.)/gi,(s,r,o)=>r?String.fromCodePoint(Math.min(+`0x${r}`,1114111)||65533):o??"")}function p(n){const s=n.trim();return s.startsWith("//")?!0:T.test(s)&&!/^https:\/\//i.test(s)}const v=/\/\*[\s\S]*?(?:\*\/|$)/g;function N(n,s){const r=$(s.replace(v,"")).replace(v,"");if(h.test(r))return!1;for(const o of r.matchAll(/url\(\s*(['"]?)(.*?)\1\s*\)/gi))if(p(o[2]))return!1;if(n.startsWith("--")||/(?:image-set|image|src)\(/i.test(r)){for(const o of r.matchAll(/(['"])(.*?)\1/g))if(p(o[2]))return!1}return!0}function R(n){const s=n.find(r=>r.type==="combinator");return s?s.value.trim()||" ":null}function L(n,s){let r;try{r=w().astSync(n)}catch{return null}const o=[];for(const i of r.nodes){const l=i.nodes;if(l.length===0)return null;let c=!1;if(i.walkNesting(()=>{c=!0}),c)continue;const t=l[0],e=t.type==="tag"&&/^(html|body)$/i.test(t.value)||t.type==="pseudo"&&t.value.toLowerCase()===":root",a=t.type==="universal",u=R(l.slice(1));if((e||a)&&(u==="~"||u==="+"))a&&o.push(`${s} ${String(i).trim()}`);else if(e||a){const f=l.slice(1).map(String).join("").trimEnd();o.push(f?s+f:a?`${s} *`:s)}else{if(t.type==="combinator"&&/^[~+]$/.test(t.value.trim()))continue;o.push(`${s} ${String(i).trim()}`)}}return o.length?o.join(", "):null}function k(n,s){if(!g.test(s))return"";let r;try{r=S.parse(n)}catch{return""}const o=E(s),i=new Map;r.walkComments(t=>{t.remove()});const l=t=>{for(const e of[...t.nodes??[]])e.type==="atrule"?m.has(e.name.toLowerCase())&&e.nodes?l(e):e.remove():e.type==="rule"&&e.remove()},c=t=>{for(const e of[...t.nodes??[]])if(e.type==="atrule"){const a=e.name.toLowerCase();if(/^(-[a-z]+-)?keyframes$/.test(a)){const u=e.params.trim();if(!/^[A-Za-z_][\w-]*$/.test(u)||A.has(u.toLowerCase()))e.remove();else{const f=`${u}-${s}`;i.set(u,f),e.params=f}}else m.has(a)&&e.nodes?c(e):e.remove()}else if(e.type==="rule"){const a=L(e.selector,o);a===null?e.remove():(e.selector=a,l(e))}else e.type==="decl"&&e.remove()};return c(r),r.walkDecls(t=>{if(_.has(t.prop.toLowerCase())||!N(t.prop,t.raws.value?.raw??t.value)){t.remove();return}i.size>0&&/^(-[a-z]+-)?animation(-name)?$/i.test(t.prop)&&(t.value=t.value.replace(/(?<![\w-])[A-Za-z_][\w-]*(?![\w(-])/g,e=>i.get(e)??e))}),r.walkAtRules(t=>{t.nodes&&t.nodes.length===0&&t.remove()}),d(r.toString()).trim()}const x={ALLOWED_TAGS:["style","#text"],ALLOWED_ATTR:[],KEEP_CONTENT:!1,FORBID_CONTENTS:[],FORCE_BODY:!0,RETURN_DOM_FRAGMENT:!0};function I(n){const s=C(n);if(!/<style/i.test(n))return{css:"",markup:s};const r=y.sanitize(n,x).querySelectorAll("style");return{css:Array.from(r,i=>i.textContent??"").join(`
|
|
2
|
+
`),markup:s}}export{O as CUSTOM_HTML_SCOPE_ATTR,E as customHtmlScope,k as scopeCustomCss,I as splitCustomHtml};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type TextStyleCase } from "efficient-easel/draw";
|
|
1
|
+
import { type TextStyleCase, type ViewTier } from "efficient-easel/draw";
|
|
2
2
|
import { type FontRole } from "../../../format/lib/fonts.js";
|
|
3
3
|
import type { PartEl } from "../../../editor/lib/document/part-anchors.js";
|
|
4
4
|
import { type PartNeedle } from "./text-parts.js";
|
|
@@ -139,7 +139,7 @@ export declare const PART_PARAGRAPH_VAR = "--sf-part-para";
|
|
|
139
139
|
export declare function partPhoneDeclarations(style: PartStyle): Record<string, string>;
|
|
140
140
|
export declare function partTabletDeclarations(style: PartStyle): Record<string, string>;
|
|
141
141
|
export declare function partAlignFollowed(style: PartStyle, screen: PartScreen): PartAlign | undefined;
|
|
142
|
-
export type PartScreen =
|
|
142
|
+
export type PartScreen = ViewTier;
|
|
143
143
|
export declare function partStyleForScreen(style: PartStyle, screen: PartScreen): PartStyle;
|
|
144
144
|
export declare function partCanvasDeclarations(style: PartStyle, screen: PartScreen, options?: PartDeclarationOptions): Record<string, string>;
|
|
145
145
|
export declare function partSizeBoxOf(screen: PartScreen): "size" | "sizeTablet" | "sizePhone";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as E}from"react/jsx-runtime";import{HideTaker as u}from"../../../components/ViewHideRoot.js";import{phoneKey as s}from"efficient-easel/draw";import{GRID_ROW_SPAN_ATTR as I,GRID_ROW_SPAN_PHONE_ATTR as O,GRID_SPAN_ATTR as A,GRID_SPAN_PHONE_ATTR as W,GRID_TILE_AT_KEY as a,GRID_TILE_AT_VAR as m,resolveGridRowSpan as p,resolveGridRowSpanPhone as w,resolveGridSpan as h,resolveGridSpanPhone as L,resolveGridTileAt as N}from"../../../../format/lib/content/grid-span.js";import{withRowsShownWhen as f}from"../../../../format/lib/document/show-when-attach.js";import{CONTAINER_BLOCK_CHOICES as G}from"../../../../format/lib/document/container-blocks.js";import{RETIRED_NESTABLE_SECTIONS as g}from"../../../../format/lib/document/section-catalog.js";import{BOX_MAY_HOLD as H}from"../../../../format/lib/document/passes/slot-rules.js";const c=Array.from(new Set([...G.map(n=>n.type),...H]));function P(n,t){return c.includes(n)||t?.sitsInBox===!0}const x=Array.from(new Set([...c,...g,"GalleryItem"])),D={not:{context:"parentOffersPositions",is:!1}},y={not:{context:"parentTileSlot",is:!1}},R=[a,s("gridSpan"),s("gridRowSpan")],X={name:"cellWidth",applies:(n,t,e)=>(x.includes(n)||P(n,e))&&!!e&&typeof e.render=="function",panel(n,t,e){const r=e.cellWidthFields;n.fields={...n.fields,...r()};const i=Object.keys(r());n.fields=f(n.fields??{},i.filter(l=>!R.includes(l)),D),n.fields=f(n.fields??{},R,y)},draw(n){const t=n.render;n.render=e=>{const r=h(e.gridSpan),i=p(e.gridRowSpan),l=N(e[a]),_=L(e[s("gridSpan")]),d=w(e[s("gridRowSpan")]),S=t(e);if(r==null&&i==null&&l==null&&_==null&&d==null)return S;const o={};r!=null&&(o[A]=String(r)),i!=null&&(o[I]=String(i)),_!=null&&(o[W]=String(_)),d!=null&&(o[O]=String(d));const T=l!=null?{[m]:l}:void 0;return E(u,{className:"sf-grid-cell",style:T,...o,children:S})}}};export{D as CELL_WIDTH_SHOW_WHEN,X as cellWidth,P as sitsInBox};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{applyBlockPasses as
|
|
1
|
+
import{declarePositionSlots as c}from"../../../format/lib/content/grid-span.js";import{applyBlockPasses as i,registryPassContext as l}from"./passes/index.js";function a(t,o){const e={...l(Object.keys(t.components),t.categories?.structure?.components??[]),...o?{inspector:o}:{}};for(const[s,n]of Object.entries(t.components)){const r=n.positionSlots;r?.length&&c(s,r),i(s,n,e)}return e}export{a as finishRenderRegistry};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-web-builder",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "73.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,10 +54,12 @@
|
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@tabler/icons-react": "^3.46.0",
|
|
57
|
-
"efficient-easel": "^
|
|
58
|
-
"efficient-shell": "^13.
|
|
57
|
+
"efficient-easel": "^37.0.0",
|
|
58
|
+
"efficient-shell": "^13.24.1",
|
|
59
59
|
"isomorphic-dompurify": "^3.18.0",
|
|
60
60
|
"next": ">=16",
|
|
61
|
+
"postcss": "^8.5.33",
|
|
62
|
+
"postcss-selector-parser": "^7.2.1",
|
|
61
63
|
"react": ">=19",
|
|
62
64
|
"typescript": "^5"
|
|
63
65
|
},
|
|
@@ -73,8 +75,8 @@
|
|
|
73
75
|
"@types/node": "^20",
|
|
74
76
|
"@types/react": "^19",
|
|
75
77
|
"@types/react-dom": "^19",
|
|
76
|
-
"efficient-easel": "^
|
|
77
|
-
"efficient-shell": "^13.
|
|
78
|
+
"efficient-easel": "^37.0.0",
|
|
79
|
+
"efficient-shell": "^13.24.1",
|
|
78
80
|
"efficient-shell-checker": "npm:efficient-shell@13.17.0",
|
|
79
81
|
"esbuild": "^0.28.0",
|
|
80
82
|
"happy-dom": "^20.14.5",
|
|
@@ -82,6 +84,8 @@
|
|
|
82
84
|
"maplibre-gl": "6.11.2",
|
|
83
85
|
"next": "16.2.11",
|
|
84
86
|
"playwright": "^1.63.0",
|
|
87
|
+
"postcss": "8.5.33",
|
|
88
|
+
"postcss-selector-parser": "7.2.1",
|
|
85
89
|
"react": "19.2.4",
|
|
86
90
|
"react-dom": "19.2.4",
|
|
87
91
|
"tailwindcss": "^4.3.3",
|