efficient-web-builder 73.2.0 → 74.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/editor/components/CustomHtmlCodeWindow.d.ts +11 -0
  3. package/dist/editor/components/CustomHtmlCodeWindow.js +20 -0
  4. package/dist/editor/components/PreviewPartAnchors.d.ts +2 -1
  5. package/dist/editor/components/PreviewPartAnchors.js +1 -1
  6. package/dist/editor/components/SectionThemePicker.d.ts +3 -2
  7. package/dist/editor/components/SectionThemePicker.js +1 -1
  8. package/dist/editor/components/SiteTextStylesField.d.ts +2 -1
  9. package/dist/editor/components/SiteTextStylesField.js +1 -1
  10. package/dist/editor/components/StandaloneSectionEditor.js +1 -1
  11. package/dist/editor/components/StorefrontEditor.js +1 -1
  12. package/dist/editor/components/WebsiteSettingsPanel.d.ts +2 -0
  13. package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
  14. package/dist/editor/components/storefront-editor.css +111 -0
  15. package/dist/editor/lib/document/blocks/general/CustomHTML/fields.d.ts +6 -0
  16. package/dist/editor/lib/document/blocks/general/CustomHTML/fields.js +1 -0
  17. package/dist/editor/lib/document/blocks/general/index.js +1 -1
  18. package/dist/editor/lib/document/controls.d.ts +2 -0
  19. package/dist/editor/lib/document/controls.js +1 -1
  20. package/dist/editor/lib/document/custom-html-preview.d.ts +12 -0
  21. package/dist/editor/lib/document/custom-html-preview.js +1 -0
  22. package/dist/editor/lib/document/own-pad-fields.d.ts +7 -1
  23. package/dist/editor/lib/document/own-pad-fields.js +1 -1
  24. package/dist/format/lib/animation/hover.js +1 -1
  25. package/dist/format/lib/animation/loop.js +1 -1
  26. package/dist/format/lib/content/accordion-row-style.js +1 -1
  27. package/dist/format/lib/content/borders.d.ts +2 -1
  28. package/dist/format/lib/content/borders.js +1 -1
  29. package/dist/format/lib/content/box-layout.js +1 -1
  30. package/dist/format/lib/content/button-icon.js +1 -1
  31. package/dist/format/lib/content/card-place.js +1 -1
  32. package/dist/format/lib/content/chat-launcher.js +1 -1
  33. package/dist/format/lib/content/container-direction.js +1 -1
  34. package/dist/format/lib/content/footprint.js +1 -1
  35. package/dist/format/lib/content/image-fit.js +1 -1
  36. package/dist/format/lib/content/image-text-rows.js +1 -1
  37. package/dist/format/lib/content/list-number.js +1 -1
  38. package/dist/format/lib/content/list-position.js +1 -1
  39. package/dist/format/lib/content/text-tag.js +1 -1
  40. package/dist/format/lib/document/blocks/block-types.d.ts +1 -0
  41. package/dist/format/lib/document/blocks/general/text-part-shapes.json +0 -6
  42. package/dist/format/lib/document/box-footer.js +1 -1
  43. package/dist/format/lib/document/custom-html-place.d.ts +19 -0
  44. package/dist/format/lib/document/custom-html-place.js +7 -0
  45. package/dist/format/lib/document/left-view.js +1 -1
  46. package/dist/format/lib/document/mockup-variant-fields.js +1 -1
  47. package/dist/format/lib/document/part-inks.d.ts +1 -0
  48. package/dist/format/lib/document/part-inks.js +1 -1
  49. package/dist/format/lib/document/passes/types.d.ts +4 -2
  50. package/dist/format/lib/editor-words-catalogue.d.ts +19 -0
  51. package/dist/format/lib/editor-words-catalogue.js +4 -4
  52. package/dist/format/lib/hero-arrows.js +1 -1
  53. package/dist/format/lib/hero-group-placement.js +1 -1
  54. package/dist/format/lib/hero-media-layout.js +1 -1
  55. package/dist/format/lib/hero-phone-stack.js +1 -1
  56. package/dist/format/lib/hero-video.js +1 -1
  57. package/dist/format/lib/reel.js +1 -1
  58. package/dist/format/lib/sections/divider-style.js +1 -1
  59. package/dist/format/lib/sections/hero-overlay.js +1 -1
  60. package/dist/format/lib/sections/intro-bleed-layout.js +1 -1
  61. package/dist/format/lib/sections/logo-look.js +1 -1
  62. package/dist/format/lib/sections/product-card-style.js +1 -1
  63. package/dist/format/lib/sections/section-eyebrow-look.js +1 -1
  64. package/dist/format/lib/sections/section-head-placement.js +1 -1
  65. package/dist/format/lib/sections/section-head-style.js +1 -1
  66. package/dist/format/lib/sections/section-number-style.js +1 -1
  67. package/dist/format/lib/sections/strip-shape.d.ts +1 -0
  68. package/dist/format/lib/sections/strip-shape.js +1 -1
  69. package/dist/format/lib/sections/ticker-style.js +1 -1
  70. package/dist/format/lib/text-style-face.d.ts +6 -0
  71. package/dist/format/lib/text-style-face.js +2 -1
  72. package/dist/format/lib/theme.d.ts +2 -1
  73. package/dist/format/lib/theme.js +3 -3
  74. package/dist/render/components/BoxTabs.js +1 -1
  75. package/dist/render/components/Breadcrumb.d.ts +4 -1
  76. package/dist/render/components/Breadcrumb.js +1 -1
  77. package/dist/render/components/PhoneMenuTools.d.ts +3 -1
  78. package/dist/render/components/PhoneMenuTools.js +1 -1
  79. package/dist/render/components/PublishedPartStylesContext.d.ts +2 -1
  80. package/dist/render/components/PublishedPartStylesContext.js +1 -1
  81. package/dist/render/components/SpecStrip.d.ts +4 -1
  82. package/dist/render/components/SpecStrip.js +1 -1
  83. package/dist/render/lib/content/section-padding.d.ts +24 -14
  84. package/dist/render/lib/content/section-padding.js +1 -1
  85. package/dist/render/lib/document/blocks/general/Breadcrumb/render.js +1 -1
  86. package/dist/render/lib/document/blocks/general/CustomHTML/render.js +1 -1
  87. package/dist/render/lib/document/blocks/general/LocationMap/render.js +1 -1
  88. package/dist/render/lib/document/blocks/general/SpecStrip/render.js +1 -1
  89. package/dist/render/lib/document/blocks/general/section-head-looks.js +1 -1
  90. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +1 -0
  91. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
  92. package/dist/render/lib/document/blocks/general/section-to-box-rows-editorial.js +1 -1
  93. package/dist/render/lib/document/blocks/general/section-to-box-rows-logos.js +1 -1
  94. package/dist/render/lib/document/blocks/general/section-to-box-rows-pageheader.js +1 -1
  95. package/dist/render/lib/document/blocks/general/section-to-box-rows-strip.js +1 -1
  96. package/dist/render/lib/document/custom-css.d.ts +4 -0
  97. package/dist/render/lib/document/custom-css.js +3 -2
  98. package/dist/render/lib/document/header-clearance.js +1 -1
  99. package/dist/render/lib/document/header-ink.js +1 -1
  100. package/dist/render/lib/document/part-styles.d.ts +7 -4
  101. package/dist/render/lib/document/part-styles.js +2 -2
  102. package/dist/render/lib/document/passes/clickable-parts.js +1 -1
  103. package/dist/render/lib/document/passes/section-padding.d.ts +2 -1
  104. package/dist/render/lib/document/passes/section-padding.js +1 -1
  105. package/dist/render/lib/text-styles/site-text-styles.js +2 -2
  106. package/dist/routine-index.json +1 -1
  107. package/dist/value-index.json +1 -1
  108. package/package.json +27 -6
  109. package/dist/format/lib/document/blocks/general/CustomHTML/fields.d.ts +0 -2
  110. package/dist/format/lib/document/blocks/general/CustomHTML/fields.js +0 -1
  111. package/dist/format/lib/parse-option.d.ts +0 -3
  112. package/dist/format/lib/parse-option.js +0 -1
  113. package/dist/format/lib/source-rules/one-option-parser.d.ts +0 -12
  114. package/dist/format/lib/source-rules/one-option-parser.js +0 -12
@@ -1,12 +0,0 @@
1
- import{ruleChecks as L}from"./rule.js";const b=/\.(?:[cm]?[jt]sx?)$/;function q(t,v){return/\.tsx$/.test(v)?t.ScriptKind.TSX:/\.[cm]?ts$/.test(v)?t.ScriptKind.TS:/\.jsx$/.test(v)?t.ScriptKind.JSX:t.ScriptKind.JS}function E(t,v,x="source.tsx"){const i=t.createSourceFile(x,v,t.ScriptTarget.Latest,!0,q(t,x)),y=i.parseDiagnostics??[];if(y.length>0){const n=i.getLineAndCharacterOfPosition(y[0].start).line+1;throw new Error(`cannot parse ${x}:${n}: ${t.flattenDiagnosticMessageText(y[0].messageText," ")}`)}const r=n=>{let e=n;for(;t.isParenthesizedExpression(e)||t.isAsExpression(e)||t.isSatisfiesExpression(e)||t.isTypeAssertionExpression(e)||t.isNonNullExpression(e);)e=e.expression;return e},g=n=>{const e=r(n);return t.isStringLiteral(e)||t.isNoSubstitutionTemplateLiteral(e)?e.text:void 0},d=(n,e)=>r(n).getText(i).replace(/\s+/g,"")===r(e).getText(i).replace(/\s+/g,""),k=n=>n===t.SyntaxKind.EqualsEqualsEqualsToken||n===t.SyntaxKind.EqualsEqualsToken,T=n=>n===t.SyntaxKind.ExclamationEqualsEqualsToken||n===t.SyntaxKind.ExclamationEqualsToken,u=(n,e)=>{const o=r(n);if(!(!t.isBinaryExpression(o)||!(e?k:T)(o.operatorToken.kind)))for(const[p,m]of[[o.right,o.left],[o.left,o.right]]){const c=g(p);if(c!==void 0&&g(m)===void 0)return{value:m,text:c}}},f=(n,e)=>g(n)===e.text||d(n,e.value),h=(n,e)=>{const o=r(n);if(!t.isCallExpression(o)||o.arguments.length!==1)return!1;const p=o.expression;return t.isPropertyAccessExpression(p)&&(p.name.text==="includes"||p.name.text==="has")&&d(e,o.arguments[0])},w=n=>{const e=r(n);return t.isBinaryExpression(e)&&e.operatorToken.kind===t.SyntaxKind.BarBarToken?[...w(e.left),...w(e.right)]:[e]},s=n=>{const e=r(n.condition),o=u(e,!0);if(o&&f(n.whenTrue,o))return!0;const p=u(e,!1);if(p&&f(n.whenFalse,p))return!0;if(t.isPrefixUnaryExpression(e)&&e.operator===t.SyntaxKind.ExclamationToken){const c=u(e.operand,!0);if(c&&f(n.whenFalse,c)||h(e.operand,n.whenFalse))return!0}if(h(e,n.whenTrue))return!0;const m=w(e);if(m.length>1){const c=m.map(S=>u(S,!0));if(c.every(S=>S!==void 0)&&c.every(S=>d(S.value,c[0].value))&&d(n.whenTrue,c[0].value))return!0}return!1},l=[],a=n=>{if(t.isConditionalExpression(n)&&s(n)){l.push({line:i.getLineAndCharacterOfPosition(n.getStart(i)).line+1,text:n.getText(i).replace(/\s+/g," ")});return}t.forEachChild(n,a)};return a(i),l}const A=[["A ===, the literal kept",'const a = (v: unknown) => v === "x" ? "x" : "y";'],["A ==",'const a = (v: unknown) => v == "x" ? "x" : "y";'],["A literal first",'const a = (v: unknown) => "x" === v ? "x" : "y";'],["A single quotes","const a = (v: unknown) => v === 'x' ? 'x' : 'y';"],["A a plain template","const a = (v: unknown) => v === `x` ? `x` : `y`;"],["A the tested value kept",'const a = (v: unknown) => v === "x" ? v : "y";'],["A a member",'const a = (p: { m?: string }) => p.m === "x" ? "x" : "y";'],["A optional chaining",'const a = (p?: { m?: string }) => p?.m === "x" ? p?.m : "y";'],["A as const answers",'const a = (v: unknown) => v === "x" ? ("x" as const) : ("y" as const);'],["A as and satisfies",'const a = (v: unknown) => (v as string) === "x" ? "x" satisfies string : "y";'],["A parentheses",'const a = (v: unknown) => (v === "x") ? (("x")) : "y";'],["A a <T> assertion",'const a = (v: unknown) => <string>v === "x" ? <"x">"x" : "y";',"file.ts"],["A a non-null side",'const a = (v?: string) => v! === "x" ? v! : "y";'],["A split over lines, a chain is one read",`const a = (v: unknown) =>
2
- v === "x"
3
- ? "x"
4
- : v === "z"
5
- ? "z"
6
- : "y";`],["A inside JSX",'const A = (p: { m?: string }) => <i data-m={p.m === "x" ? "x" : "y"} />;'],["B !==",'const a = (v: unknown) => v !== "x" ? "y" : "x";'],["B != with the value kept",'const a = (v: unknown) => v != "x" ? "y" : v;'],["B !(v === x)",'const a = (v: unknown) => !(v === "x") ? "y" : "x";'],["C includes with as",'const L = ["a", "b"] as const; const a = (v: string) => L.includes(v as never) ? v : "a";'],["C a list cast",'const L = ["a", "b"] as const; const a = (v: string) => (L as readonly string[]).includes(v) ? (v as "a") : "a";'],["C a set",'const S = new Set(["a"]); const a = (v: string) => S.has(v) ? v : "a";'],["C optional chaining",'const L = ["a"]; const a = (v: string) => L?.includes(v) ? v : "a";'],["C negated",'const L = ["a"]; const a = (v: string) => !L.includes(v) ? "a" : v;'],["C split over lines",`const L = ["a"]; const a = (v: string) =>
7
- L.includes(v)
8
- ? v
9
- : "a";`],["D two options with ||",'const a = (v: unknown) => v === "a" || v === "b" ? v : undefined;'],["D three options, a member",'const a = (p: { s?: string }) => p.s === "a" || p.s === "b" || p.s === "c" ? p.s : "a";']],$=[["a mapping",'const a = (v: unknown) => v === "x" ? "y" : "z";'],["another value answered",'const a = (v: unknown, w: string) => v === "x" ? w : "z";'],["a list test answering another value",'const L = ["a"]; const a = (v: string, w: string) => L.includes(v) ? w : "a";'],["a boolean test",'const a = (v?: string) => (v ?? "left") === "center";'],["a conditional type",'type A<T> = T extends "x" ? "x" : never;'],["two literals compared",'const a = "x" === "x" ? "x" : "y";'],["|| over two values",'const a = (v: unknown, w: unknown) => v === "a" || w === "b" ? v : "c";'],["the job done right",'const a = (v: unknown) => parseOption(["x", "y"], "y", v);']];function K(t,v,x){const{check:i,report:y}=L("one option parser: a stored option is read with parseOption"),r=A.filter(([,s,l])=>E(t,s,l).length!==1).map(([s])=>s);i(`the scan finds each of the ${A.length} listed forms once`,r.length===0,r.join("; "));const g=$.filter(([,s])=>E(t,s).length!==0).map(([s])=>s);i(`…and none of the ${$.length} near misses`,g.length===0,g.join("; "));const d=E(t,A[13][1]);i("a read split over lines is reported at the line it starts",d[0]?.line===2,String(d[0]?.line));const k=v.filter(s=>b.test(s.path)&&!s.path.endsWith(".d.ts"));i(`read the source (${k.length} JS/TS files, at least ${x.minFiles})`,k.length>=x.minFiles);const T=x.kept??{},u=new Map,f=[],h=[];for(const s of k){let l;try{l=E(t,s.text,s.path)}catch(a){h.push(a.message);continue}for(const a of l){if(T[s.path]?.[a.text]!==void 0){const n=`${s.path} ${a.text}`;u.set(n,(u.get(n)??0)+1);continue}f.push(`${s.path}:${a.line} ${a.text}`)}}i("every file parses",h.length===0,h.join(`
10
- `)),i("no stored option is read by a hand-written conditional (use parseOption)",f.length===0,f.join(`
11
- `));const w=Object.entries(T).flatMap(([s,l])=>Object.keys(l).map(a=>[`${s} ${a}`,u.get(`${s} ${a}`)??0]).filter(([,a])=>a!==1).map(([a,n])=>`${a} (found ${n})`));return i("every kept entry is found exactly once in its file",w.length===0,w.join(`
12
- `)),y()}export{K as oneOptionParser,E as optionReads};