efficient-web-builder 70.4.0 → 71.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 CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## 71.0.0 - 2026-11-18
4
+
5
+ From main at `5d29f197`: #784. A major: #784 is `!`. The `efficient-easel` peer narrows to `^35.1.0`; `efficient-shell` stays `^13.17.0`. No export is removed. One new export and one new optional field. No stored key or value moves.
6
+
7
+ ### BREAKING
8
+
9
+ - **`efficient-easel` peer `^35.0.0` -> `^35.1.0`** (#784): the builder uses easel's `createRenderKeep` and `Render`'s `keep`.
10
+ - **The published-mounts rule now needs a keep on every published `Render` mount** (#784): `lib/source-rules/published-mounts` fails a published mount that draws `Render` with no `keep={keep}` from `useRenderKeep()`, and fails a file that reaches `Render` with no mount row.
11
+
12
+ **For hosts:**
13
+ - Install `efficient-easel` 35.1.0 or later with this release.
14
+ - In each published mount file that draws `Render`, import `useRenderKeep` from `efficient-web-builder/render/lib/document/render-keep`, set `const keep = useRenderKeep();` and pass `keep={keep}` to `Render`. In storefront-blocks these are `PublishedHeader` and `PublishedFooter`.
15
+ - Give each such mount row `keepFrom` (the module the hook is imported from) in the host's published-mounts test.
16
+
17
+ ### Fixed
18
+
19
+ - **A published page keeps its slots when it draws again** (#784): the page render passes one keep per mount, so a block that draws again (a product hero whose pick state sits above it) no longer gives every Box inside it a new slot type. Keyboard focus and held state (the gallery photo) stay. The HTML is the same.
20
+
21
+ ### Added
22
+
23
+ - **`useRenderKeep()`** (`render/lib/document/render-keep`, #784): the per-mount keep, made once and held in a ref. Never module-level.
24
+ - **`PublishedMount.keepFrom`** (optional, #784): where a mount imports `useRenderKeep`; left out, the builder's own module.
25
+
3
26
  ## 70.4.0 - 2026-11-18
4
27
 
5
28
  From main at `f6660eee`: #786. A minor: no `!`, no export is removed, no export changes its type, the peers stay `efficient-easel` `^35.0.0` and `efficient-shell` `^13.17.0`. One new export. No stored key or value moves.
@@ -8,6 +8,7 @@ export type PublishedMount = {
8
8
  readonly inputs?: readonly string[];
9
9
  readonly readers?: readonly (string | PublishedReader)[];
10
10
  readonly renderFrom?: string;
11
+ readonly keepFrom?: string;
11
12
  };
12
13
  export type PublishedReader = {
13
14
  readonly name: string;
@@ -1,58 +1,68 @@
1
- import{ruleChecks as M}from"./rule.js";import{programOf as _}from"./support/ts-program.js";function Z(n){const a=[];let e=0,u=0;for(let o=0;o<n.length;o++){const p=n[o];"([{".includes(p)?e++:")]}".includes(p)?e--:p===","&&e===0&&(a.push(n.slice(u,o)),u=o+1)}return a.push(n.slice(u)),a.map(o=>o.trim()).filter(o=>o!=="")}const Y=/^[A-Za-z_$][\w$]*$/,ee=/^(?:@\/|\.\.?\/)/;function te(n,a){const e=_(n,[{path:"mount.tsx",text:a}]);return{sf:e.getSourceFile("/mount.tsx"),checker:e.getTypeChecker()}}function ne(n,a){const e=[],u=o=>{e.push(o),n.forEachChild(o,u)};return u(a),e}function v(n,a){const e=a.parent;return(n.isVariableDeclaration(e)||n.isParameter(e)||n.isBindingElement(e)||n.isFunctionDeclaration(e)||n.isFunctionExpression(e)||n.isClassDeclaration(e)||n.isClassExpression(e)||n.isImportSpecifier(e)||n.isImportClause(e)||n.isNamespaceImport(e)||n.isImportEqualsDeclaration(e))&&e.name===a}function F(n,a){return n.isParenthesizedExpression(a)||n.isAsExpression(a)||n.isNonNullExpression(a)||n.isTypeAssertionExpression(a)||n.isSatisfiesExpression(a)}function ae(n,a){for(;a.parent&&F(n,a.parent);)a=a.parent;return a}function V(n,a){let e=a,u=!1;for(;;){e=ae(n,e);const o=e.parent;if(o&&(n.isPropertyAccessExpression(o)||n.isElementAccessExpression(o))&&o.expression===e){e=o,u=!0;continue}return{top:e,path:u}}}const W=(n,a)=>n.isBinaryExpression(a)&&(a.operatorToken.kind===n.SyntaxKind.QuestionQuestionToken||a.operatorToken.kind===n.SyntaxKind.BarBarToken);function re(n,a){const e=a.parent;if(!e)return"used";if(n.isBinaryExpression(e)&&e.left===a&&e.operatorToken.kind>=n.SyntaxKind.FirstAssignment&&e.operatorToken.kind<=n.SyntaxKind.LastAssignment)return"assigned";if((n.isPrefixUnaryExpression(e)||n.isPostfixUnaryExpression(e))&&(e.operator===n.SyntaxKind.PlusPlusToken||e.operator===n.SyntaxKind.MinusMinusToken))return"changed by ++ or --";if(n.isDeleteExpression(e))return"deleted";if(n.isCallExpression(e)&&e.expression===a)return"called, or a method called on it";if(n.isCallExpression(e)||n.isNewExpression(e))return`handed to ${e.expression.getText()}(…)`;if(n.isJsxExpression(e)&&n.isJsxAttribute(e.parent))return`handed to the JSX attribute ${e.parent.name.getText()}`;if(n.isVariableDeclaration(e)||n.isBindingElement(e))return"aliased by a local";if(n.isSpreadElement(e)||n.isSpreadAssignment(e)||n.isJsxSpreadAttribute(e))return"spread";if(n.isForOfStatement(e)||n.isForInStatement(e))return"looped over";for(let u=a;u.parent;u=u.parent){const o=u.parent;if(n.isBinaryExpression(o)){if(o.left===u&&o.operatorToken.kind===n.SyntaxKind.EqualsToken)return"a destructuring target";break}if(!(n.isObjectLiteralExpression(o)||n.isArrayLiteralExpression(o)||n.isPropertyAssignment(o)||n.isShorthandPropertyAssignment(o)||n.isSpreadAssignment(o)||n.isSpreadElement(o)||F(n,o)))break}return`used in a ${n.SyntaxKind[e.kind]} (syntax kind)`}function G(n,a,e){if(!e)return["the rule was not handed the compiler (`options.ts`)"];const{sf:u,checker:o}=te(e,n),p=ne(e,u),x=p.filter(e.isIdentifier),$=t=>u.getLineAndCharacterOfPosition(t.getStart(u)).line+1,m=t=>e.isShorthandPropertyAssignment(t.parent)&&t.parent.name===t?o.getShorthandAssignmentValueSymbol(t.parent):o.getSymbolAtLocation(t),d=t=>x.filter(r=>r.text===t&&v(e,r)),c=t=>{for(let r=t;r.parent;r=r.parent){const i=r.parent;if(e.isExpressionWithTypeArguments(i)&&i.expression===r)return!1;if(e.isTypeNode(i))return!0}return!1},s=[],C=(t,r,i)=>{const l=p.filter(k=>e.isImportSpecifier(k)&&k.name.text===r),f=l[0],y=f?f.parent.parent.parent.moduleSpecifier.text:"";return l.length!==1?`${t} is not imported once in the mount`:f.propertyName&&f.propertyName.text!==r?`${t} is ${f.propertyName.text} renamed: it is imported by its own name`:f.isTypeOnly||f.parent.parent.isTypeOnly?`${t} is a type-only import`:(i===void 0?!ee.test(y):y!==i)?`${t} comes from "${y}", not ${i===void 0?"a module inside this package":`"${i}"`}`:d(r).length!==1?`${t} is declared again in the mount: it is the imported function`:o.getSymbolAtLocation(f.name)??`${t} has no binding in the mount`},A=d(a.variable);if(A.length!==1)return[`\`${a.variable}\` is declared ${A.length} times, not once`];const h=A[0].parent;if(!e.isVariableDeclaration(h))return[`\`${a.variable}\` is not a variable declaration`];const g=m(A[0]),b=h.initializer;let S=null;const w=C(`the call ${a.call}`,a.call,a.callFrom);if(typeof w=="string"&&s.push(w),!b||!e.isCallExpression(b)||!e.isIdentifier(b.expression)||b.expression.text!==a.call||typeof w!="string"&&m(b.expression)!==w)s.push(`\`${a.variable}\` is not set straight from ${a.call}(…): a pass wraps it, or something follows the call`);else{S=b;const t=n.slice(b.arguments.pos,b.arguments.end).trim();a.args!==void 0&&t!==a.args&&s.push(`${a.call} is handed \`${t}\`, not \`${a.args}\``)}const R=e.findAncestor(h,t=>e.isFunctionDeclaration(t)||e.isFunctionExpression(t)||e.isArrowFunction(t));if(!R||!R.body||h.parent.parent.parent!==R.body)return[...s,`\`${a.variable}\` is not declared at the top level of a component's body`];const T=R.parameters[0]?.name,D=new Map;if(T&&e.isObjectBindingPattern(T))for(const t of T.elements)e.isIdentifier(t.name)&&!t.dotDotDotToken&&D.set(t.name.text,t.name);else s.push("the component does not destructure its props");const B=a.inputs??Z(a.args??"").filter(t=>Y.test(t));B.length===0&&s.push(`${a.call}(…) reads no input the rule can check: name the props it reads in \`inputs\`, or bare names in \`args\``);const N=new Set;for(const t of B){const r=D.get(t);if(!r){s.push(`\`${t}\` is not a prop of the component: the call is handed something made in the mount`);continue}d(t).length!==1&&s.push(`\`${t}\` is declared ${d(t).length} times in the file: a second binding would pass for the input`);const i=m(r);i&&N.add(i)}for(const t of x)t.text==="arguments"&&!v(e,t)&&e.findAncestor(t,r=>r===R)&&s.push(`\`arguments\` is used in the component (line ${$(t)}): it is the props by another name`);for(const t of x)(t.text==="eval"||t.text==="Function")&&!v(e,t)&&!c(t)&&!(e.isPropertyAccessExpression(t.parent)&&t.parent.name===t)&&s.push(`\`${t.text}\` is used in the mount file (line ${$(t)}): code run from a string cannot be read`);const L=new Set;for(const t of a.readers??[]){const r=typeof t=="string"?t:t.name,i=C(`the reader ${r}`,r,typeof t=="string"?void 0:t.from);typeof i=="string"?s.push(i):L.add(i)}const X=t=>{if(!e.isCallExpression(t)||!e.isIdentifier(t.expression))return!1;const r=m(t.expression);return r!==void 0&&L.has(r)};let z=null;const P=p.filter(t=>e.isImportSpecifier(t)&&t.name.text==="Render"),O=a.renderFrom??"efficient-easel/render",q=P.length===1?P[0].parent.parent.parent.moduleSpecifier.text:"",I=p.filter(t=>e.isImportDeclaration(t)&&e.isStringLiteral(t.moduleSpecifier)&&t.moduleSpecifier.text===O&&!t.importClause?.isTypeOnly).flatMap(t=>{const r=t.importClause;if(!r)return[];const i=r.namedBindings;return[...r.name?[r.name.text]:[],...i&&e.isNamespaceImport(i)?[`* as ${i.name.text}`]:[],...i&&e.isNamedImports(i)?i.elements.filter(l=>!l.isTypeOnly).map(l=>l.propertyName?`${l.propertyName.text} as ${l.name.text}`:l.name.text):[]]});(I.length!==1||I[0]!=="Render")&&s.push(`"${O}" gives this file ${I.length} binding(s) (${I.join(", ")||"none"}), not the one \`Render\``);const J=P.length===1&&!P[0].propertyName&&q===O?o.getSymbolAtLocation(P[0].name):void 0;if(!J||d("Render").length!==1)s.push(`\`Render\` is not imported once by its own name from "${O}"`);else{const t=x.filter(i=>!v(e,i)&&m(i)===J),r=t.filter(i=>(e.isJsxOpeningElement(i.parent)||e.isJsxSelfClosingElement(i.parent))&&i.parent.tagName===i);if(r.length!==1||t.length!==1)s.push(`\`Render\` is used ${t.length} times, ${r.length} as a tag: one <Render> and no alias`);else{const l=r[0].parent.attributes.properties;l.some(j=>e.isJsxSpreadAttribute(j))&&s.push("the Render tag has a spread attribute, which can hand it another document");const f=l.filter(j=>e.isJsxAttribute(j)&&j.name.getText()==="data"),y=f.length===1?f[0].initializer:void 0,k=y&&e.isJsxExpression(y)?y.expression:void 0;!k||!e.isIdentifier(k)||m(k)!==g?s.push(`the Render tag draws \`${k?k.getText():f.length===1?f[0].getText():"nothing"}\`, not \`${a.variable}\``):z=k}}const E=new Map;for(const t of N)E.set(t,t.name);g&&E.set(g,a.variable);const H=t=>{for(let r=t;r.parent;r=r.parent){const i=r.parent;if(S&&i===S)return S.arguments.some(f=>f===r);if(!(F(e,i)||e.isObjectLiteralExpression(i)||e.isPropertyAssignment(i)&&i.initializer===r||e.isShorthandPropertyAssignment(i)||e.isSpreadAssignment(i)||e.isArrayLiteralExpression(i)||e.isSpreadElement(i)||e.isConditionalExpression(i)&&i.condition!==r||W(e,i)))return!1}return!1},Q=t=>{let r=t,i=!1;for(;;){const l=r.parent;if(!l)return;if(F(e,l))r=l;else if(e.isConditionalExpression(l)&&l.condition!==r)r=l,i=!0;else if(e.isSpreadAssignment(l)&&e.isObjectLiteralExpression(l.parent))r=l.parent,i=!0;else return e.isVariableDeclaration(l)&&l.initializer===r&&e.isIdentifier(l.name)&&i?m(l.name):void 0}},K=(t,r)=>{if(c(t))return!0;const{top:i,path:l}=V(e,t);if(t===z)return!0;let f=i;for(;f.parent&&(F(e,f.parent)||W(e,f.parent));)f=f.parent;if(f.parent&&X(f.parent)&&f.parent.arguments.some(k=>k===f)||N.has(r)&&H(i))return!0;const y=l?void 0:Q(i);return y?(E.has(y)||E.set(y,y.name),!0):!1};for(let t=-1;t!==E.size;){t=E.size;for(const r of x){if(v(e,r))continue;const i=m(r);i&&E.has(i)&&K(r,i)}}for(const t of x){if(v(e,t))continue;const r=m(t);if(!r||!E.has(r)||K(t,r))continue;const{top:i}=V(e,t),l=E.get(r),f=N.has(r)||r===g?"":" (a local that holds an input or the variable)";s.push(`\`${l}\`${f} is ${re(e,i)} at line ${$(t)}`)}return s}const U=new WeakMap;function ie(n){const a=U.get(n);if(a)return a;const{check:e,report:u}=M("published mounts fixtures"),o=(h,g)=>G(h,g,n),p={call:"publishedPageData",variable:"page",args:"data, metadata",readers:["first"]},x="return <Render config={c} data={page} />;",$=`const page = ${p.call}(data, metadata);`,m=h=>`import { Render } from "efficient-easel/render";
1
+ import{ruleChecks as U}from"./rule.js";import{programOf as ae}from"./support/ts-program.js";function re(n){const a=[];let e=0,m=0;for(let i=0;i<n.length;i++){const l=n[i];"([{".includes(l)?e++:")]}".includes(l)?e--:l===","&&e===0&&(a.push(n.slice(m,i)),m=i+1)}return a.push(n.slice(m)),a.map(i=>i.trim()).filter(i=>i!=="")}const ie=/^[A-Za-z_$][\w$]*$/,oe=/^(?:@\/|\.\.?\/)/;function se(n,a){const e=ae(n,[{path:"mount.tsx",text:a}]);return{sf:e.getSourceFile("/mount.tsx"),checker:e.getTypeChecker()}}function pe(n,a){const e=[],m=i=>{e.push(i),n.forEachChild(i,m)};return m(a),e}function N(n,a){const e=a.parent;return(n.isVariableDeclaration(e)||n.isParameter(e)||n.isBindingElement(e)||n.isFunctionDeclaration(e)||n.isFunctionExpression(e)||n.isClassDeclaration(e)||n.isClassExpression(e)||n.isImportSpecifier(e)||n.isImportClause(e)||n.isNamespaceImport(e)||n.isImportEqualsDeclaration(e))&&e.name===a}function L(n,a){return n.isParenthesizedExpression(a)||n.isAsExpression(a)||n.isNonNullExpression(a)||n.isTypeAssertionExpression(a)||n.isSatisfiesExpression(a)}function le(n,a){for(;a.parent&&L(n,a.parent);)a=a.parent;return a}function _(n,a){let e=a,m=!1;for(;;){e=le(n,e);const i=e.parent;if(i&&(n.isPropertyAccessExpression(i)||n.isElementAccessExpression(i))&&i.expression===e){e=i,m=!0;continue}return{top:e,path:m}}}const H=(n,a)=>n.isBinaryExpression(a)&&(a.operatorToken.kind===n.SyntaxKind.QuestionQuestionToken||a.operatorToken.kind===n.SyntaxKind.BarBarToken);function ce(n,a){const e=a.parent;if(!e)return"used";if(n.isBinaryExpression(e)&&e.left===a&&e.operatorToken.kind>=n.SyntaxKind.FirstAssignment&&e.operatorToken.kind<=n.SyntaxKind.LastAssignment)return"assigned";if((n.isPrefixUnaryExpression(e)||n.isPostfixUnaryExpression(e))&&(e.operator===n.SyntaxKind.PlusPlusToken||e.operator===n.SyntaxKind.MinusMinusToken))return"changed by ++ or --";if(n.isDeleteExpression(e))return"deleted";if(n.isCallExpression(e)&&e.expression===a)return"called, or a method called on it";if(n.isCallExpression(e)||n.isNewExpression(e))return`handed to ${e.expression.getText()}(…)`;if(n.isJsxExpression(e)&&n.isJsxAttribute(e.parent))return`handed to the JSX attribute ${e.parent.name.getText()}`;if(n.isVariableDeclaration(e)||n.isBindingElement(e))return"aliased by a local";if(n.isSpreadElement(e)||n.isSpreadAssignment(e)||n.isJsxSpreadAttribute(e))return"spread";if(n.isForOfStatement(e)||n.isForInStatement(e))return"looped over";for(let m=a;m.parent;m=m.parent){const i=m.parent;if(n.isBinaryExpression(i)){if(i.left===m&&i.operatorToken.kind===n.SyntaxKind.EqualsToken)return"a destructuring target";break}if(!(n.isObjectLiteralExpression(i)||n.isArrayLiteralExpression(i)||n.isPropertyAssignment(i)||n.isShorthandPropertyAssignment(i)||n.isSpreadAssignment(i)||n.isSpreadElement(i)||L(n,i)))break}return`used in a ${n.SyntaxKind[e.kind]} (syntax kind)`}function Q(n,a,e){if(!e)return["the rule was not handed the compiler (`options.ts`)"];const{sf:m,checker:i}=se(e,n),l=pe(e,m),x=l.filter(e.isIdentifier),f=t=>m.getLineAndCharacterOfPosition(t.getStart(m)).line+1,p=t=>e.isShorthandPropertyAssignment(t.parent)&&t.parent.name===t?i.getShorthandAssignmentValueSymbol(t.parent):i.getSymbolAtLocation(t),h=t=>x.filter(r=>r.text===t&&N(e,r)),d=t=>{for(let r=t;r.parent;r=r.parent){const o=r.parent;if(e.isExpressionWithTypeArguments(o)&&o.expression===r)return!1;if(e.isTypeNode(o))return!0}return!1},s=[],c=(t,r,o)=>{const u=l.filter(E=>e.isImportSpecifier(E)&&E.name.text===r),g=u[0],b=g?g.parent.parent.parent.moduleSpecifier.text:"";return u.length!==1?`${t} is not imported once in the mount`:g.propertyName&&g.propertyName.text!==r?`${t} is ${g.propertyName.text} renamed: it is imported by its own name`:g.isTypeOnly||g.parent.parent.isTypeOnly?`${t} is a type-only import`:(o===void 0?!oe.test(b):b!==o)?`${t} comes from "${b}", not ${o===void 0?"a module inside this package":`"${o}"`}`:h(r).length!==1?`${t} is declared again in the mount: it is the imported function`:i.getSymbolAtLocation(g.name)??`${t} has no binding in the mount`},K=h(a.variable);if(K.length!==1)return[`\`${a.variable}\` is declared ${K.length} times, not once`];const A=K[0].parent;if(!e.isVariableDeclaration(A))return[`\`${a.variable}\` is not a variable declaration`];const $=p(K[0]),k=A.initializer;let y=null;const T=c(`the call ${a.call}`,a.call,a.callFrom);if(typeof T=="string"&&s.push(T),!k||!e.isCallExpression(k)||!e.isIdentifier(k.expression)||k.expression.text!==a.call||typeof T!="string"&&p(k.expression)!==T)s.push(`\`${a.variable}\` is not set straight from ${a.call}(…): a pass wraps it, or something follows the call`);else{y=k;const t=n.slice(k.arguments.pos,k.arguments.end).trim();a.args!==void 0&&t!==a.args&&s.push(`${a.call} is handed \`${t}\`, not \`${a.args}\``)}const R=e.findAncestor(A,t=>e.isFunctionDeclaration(t)||e.isFunctionExpression(t)||e.isArrowFunction(t));if(!R||!R.body||A.parent.parent.parent!==R.body)return[...s,`\`${a.variable}\` is not declared at the top level of a component's body`];const C=R.parameters[0]?.name,S=new Map;if(C&&e.isObjectBindingPattern(C))for(const t of C.elements)e.isIdentifier(t.name)&&!t.dotDotDotToken&&S.set(t.name.text,t.name);else s.push("the component does not destructure its props");const B=a.inputs??re(a.args??"").filter(t=>ie.test(t));B.length===0&&s.push(`${a.call}(…) reads no input the rule can check: name the props it reads in \`inputs\`, or bare names in \`args\``);const P=new Set;for(const t of B){const r=S.get(t);if(!r){s.push(`\`${t}\` is not a prop of the component: the call is handed something made in the mount`);continue}h(t).length!==1&&s.push(`\`${t}\` is declared ${h(t).length} times in the file: a second binding would pass for the input`);const o=p(r);o&&P.add(o)}for(const t of x)t.text==="arguments"&&!N(e,t)&&e.findAncestor(t,r=>r===R)&&s.push(`\`arguments\` is used in the component (line ${f(t)}): it is the props by another name`);for(const t of x)(t.text==="eval"||t.text==="Function")&&!N(e,t)&&!d(t)&&!(e.isPropertyAccessExpression(t.parent)&&t.parent.name===t)&&s.push(`\`${t.text}\` is used in the mount file (line ${f(t)}): code run from a string cannot be read`);const z=new Set;for(const t of a.readers??[]){const r=typeof t=="string"?t:t.name,o=c(`the reader ${r}`,r,typeof t=="string"?void 0:t.from);typeof o=="string"?s.push(o):z.add(o)}const Y=t=>{if(!e.isCallExpression(t)||!e.isIdentifier(t.expression))return!1;const r=p(t.expression);return r!==void 0&&z.has(r)};let V=null;const I=l.filter(t=>e.isImportSpecifier(t)&&t.name.text==="Render"),J=a.renderFrom??"efficient-easel/render",ee=I.length===1?I[0].parent.parent.parent.moduleSpecifier.text:"",M=l.filter(t=>e.isImportDeclaration(t)&&e.isStringLiteral(t.moduleSpecifier)&&t.moduleSpecifier.text===J&&!t.importClause?.isTypeOnly).flatMap(t=>{const r=t.importClause;if(!r)return[];const o=r.namedBindings;return[...r.name?[r.name.text]:[],...o&&e.isNamespaceImport(o)?[`* as ${o.name.text}`]:[],...o&&e.isNamedImports(o)?o.elements.filter(u=>!u.isTypeOnly).map(u=>u.propertyName?`${u.propertyName.text} as ${u.name.text}`:u.name.text):[]]});(M.length!==1||M[0]!=="Render")&&s.push(`"${J}" gives this file ${M.length} binding(s) (${M.join(", ")||"none"}), not the one \`Render\``);const q=I.length===1&&!I[0].propertyName&&ee===J?i.getSymbolAtLocation(I[0].name):void 0;if(!q||h("Render").length!==1)s.push(`\`Render\` is not imported once by its own name from "${J}"`);else{const t=x.filter(o=>!N(e,o)&&p(o)===q),r=t.filter(o=>(e.isJsxOpeningElement(o.parent)||e.isJsxSelfClosingElement(o.parent))&&o.parent.tagName===o);if(r.length!==1||t.length!==1)s.push(`\`Render\` is used ${t.length} times, ${r.length} as a tag: one <Render> and no alias`);else{const u=r[0].parent.attributes.properties;u.some(w=>e.isJsxSpreadAttribute(w))&&s.push("the Render tag has a spread attribute, which can hand it another document");const g=u.filter(w=>e.isJsxAttribute(w)&&w.name.getText()==="data"),b=g.length===1?g[0].initializer:void 0,E=b&&e.isJsxExpression(b)?b.expression:void 0;!E||!e.isIdentifier(E)||p(E)!==$?s.push(`the Render tag draws \`${E?E.getText():g.length===1?g[0].getText():"nothing"}\`, not \`${a.variable}\``):V=E;const G=u.filter(w=>e.isJsxAttribute(w)&&w.name.getText()==="keep"),W=G.length===1?G[0].initializer:void 0,F=W&&e.isJsxExpression(W)?W.expression:void 0;if(!F||!e.isIdentifier(F))s.push("the Render tag has no `keep={keep}`: a mount drawn again would remount every slot it holds (lib/document/render-keep)");else{const w=c("the keep hook useRenderKeep","useRenderKeep",a.keepFrom??j);typeof w=="string"&&s.push(w);const D=p(F)?.valueDeclaration;if(!D||!e.isVariableDeclaration(D)||D.parent.parent.parent!==R.body||h(F.text).length!==1)s.push(`\`${F.text}\` (the Render tag's keep) is not declared once at the top level of the component's body: a keep made at module level is shared by every mount and request`);else if(!(e.getCombinedNodeFlags(D)&e.NodeFlags.Const))s.push(`\`${F.text}\` (the Render tag's keep) is not a \`const\`: a keep set again is a new keep`);else{const O=D.initializer;(!O||!e.isCallExpression(O)||O.arguments.length!==0||!e.isIdentifier(O.expression)||typeof w=="string"||p(O.expression)!==w)&&s.push(`\`${F.text}\` is not set straight from useRenderKeep(): a keep made new on each draw keeps nothing`)}}}}const v=new Map;for(const t of P)v.set(t,t.name);$&&v.set($,a.variable);const te=t=>{for(let r=t;r.parent;r=r.parent){const o=r.parent;if(y&&o===y)return y.arguments.some(g=>g===r);if(!(L(e,o)||e.isObjectLiteralExpression(o)||e.isPropertyAssignment(o)&&o.initializer===r||e.isShorthandPropertyAssignment(o)||e.isSpreadAssignment(o)||e.isArrayLiteralExpression(o)||e.isSpreadElement(o)||e.isConditionalExpression(o)&&o.condition!==r||H(e,o)))return!1}return!1},ne=t=>{let r=t,o=!1;for(;;){const u=r.parent;if(!u)return;if(L(e,u))r=u;else if(e.isConditionalExpression(u)&&u.condition!==r)r=u,o=!0;else if(e.isSpreadAssignment(u)&&e.isObjectLiteralExpression(u.parent))r=u.parent,o=!0;else return e.isVariableDeclaration(u)&&u.initializer===r&&e.isIdentifier(u.name)&&o?p(u.name):void 0}},X=(t,r)=>{if(d(t))return!0;const{top:o,path:u}=_(e,t);if(t===V)return!0;let g=o;for(;g.parent&&(L(e,g.parent)||H(e,g.parent));)g=g.parent;if(g.parent&&Y(g.parent)&&g.parent.arguments.some(E=>E===g)||P.has(r)&&te(o))return!0;const b=u?void 0:ne(o);return b?(v.has(b)||v.set(b,b.name),!0):!1};for(let t=-1;t!==v.size;){t=v.size;for(const r of x){if(N(e,r))continue;const o=p(r);o&&v.has(o)&&X(r,o)}}for(const t of x){if(N(e,t))continue;const r=p(t);if(!r||!v.has(r)||X(t,r))continue;const{top:o}=_(e,t),u=v.get(r),g=P.has(r)||r===$?"":" (a local that holds an input or the variable)";s.push(`\`${u}\`${g} is ${ce(e,o)} at line ${f(t)}`)}return s}const j="@/lib/document/render-keep";function de(n,a,e,m){if(!e.includes(m))return!1;const i=n.createSourceFile(a,e,n.ScriptTarget.Latest,!0,a.endsWith(".tsx")?n.ScriptKind.TSX:n.ScriptKind.TS),l=f=>f.some(p=>!p.isTypeOnly&&(p.propertyName??p.name).text==="Render"),x=f=>{if(n.isImportDeclaration(f)&&n.isStringLiteral(f.moduleSpecifier)&&f.moduleSpecifier.text===m){const p=f.importClause;if(!p||p.isTypeOnly)return!1;const h=p.namedBindings;return!!p.name||h!==void 0&&(n.isNamespaceImport(h)||l(h.elements))}if(n.isExportDeclaration(f)&&f.moduleSpecifier&&n.isStringLiteral(f.moduleSpecifier)&&f.moduleSpecifier.text===m){if(f.isTypeOnly)return!1;const p=f.exportClause;return!p||n.isNamespaceExport(p)||l(p.elements)}return n.isCallExpression(f)&&f.arguments.length>0&&n.isStringLiteralLike(f.arguments[0])&&f.arguments[0].text===m&&(f.expression.kind===n.SyntaxKind.ImportKeyword||n.isIdentifier(f.expression)&&f.expression.text==="require")?!0:n.forEachChild(f,x)??!1};return x(i)}const Z=new WeakMap;function ue(n){const a=Z.get(n);if(a)return a;const{check:e,report:m}=U("published mounts fixtures"),i=($,k)=>Q($,k,n),l={call:"publishedPageData",variable:"page",args:"data, metadata",readers:["first"]},x="return <Render config={c} keep={keep} data={page} />;",f=`const page = ${l.call}(data, metadata);`,p="const keep = useRenderKeep();",h=$=>`import { Render } from "efficient-easel/render";
2
2
  import { first } from "./first";
3
- import { ${p.call} } from "./published-passes";
3
+ import { useRenderKeep } from "${j}";
4
+ import { ${l.call} } from "./published-passes";
4
5
  export default function P({ data, metadata = {} }: Props) {
5
- ${h}
6
- }`,d=m(`${$}
7
- ${x}`),c=h=>m(`${h}
6
+ ${p}
8
7
  ${$}
9
- ${x}`),s=h=>m(`${$}
10
- ${h}
11
- ${x}`);e("the one call, drawn, passes",o(d,p).length===0,o(d,p).join("; "));{const h={...p,callFrom:"@/lib/document/published-passes"},g=d.replace('from "./published-passes"',`from "${h.callFrom}"`);e("…the call imported from the module the mount names passes",o(g,h).length===0,o(g,h).join("; ")),e("…and the call imported from another module inside this package fails it",o(d,h).length>0)}e("…a comment naming a wrapper does not fail it",o(`// const page = x(${p.call}(data, metadata));
12
- ${d}`,p).length===0),e("…a path handed to a listed reader does not fail it",o(s("const lead = first(page.content);"),p).length===0),e("…an input spread, and an input as a ternary's last branch, do not fail it",o(s("const facts = ok ? { ...metadata, k: 1 } : metadata;"),p).length===0,o(s("const facts = ok ? { ...metadata, k: 1 } : metadata;"),p).join("; "));{const h="efficient-web-builder/render/lib/document/published-passes",g={call:"publishedChromeData",callFrom:h,variable:"data",inputs:["group"]},b=`import { Render } from "efficient-easel/render";
13
- import { ${g.call} } from "${h}";
8
+ }`,d=h(`${f}
9
+ ${x}`),s=$=>h(`${$}
10
+ ${f}
11
+ ${x}`),c=$=>h(`${f}
12
+ ${$}
13
+ ${x}`);e("the one call, drawn, passes",i(d,l).length===0,i(d,l).join("; "));{const $={...l,callFrom:"@/lib/document/published-passes"},k=d.replace('from "./published-passes"',`from "${$.callFrom}"`);e("…the call imported from the module the mount names passes",i(k,$).length===0,i(k,$).join("; ")),e("…and the call imported from another module inside this package fails it",i(d,$).length>0)}e("…a comment naming a wrapper does not fail it",i(`// const page = x(${l.call}(data, metadata));
14
+ ${d}`,l).length===0),e("…a path handed to a listed reader does not fail it",i(c("const lead = first(page.content);"),l).length===0),e("…an input spread, and an input as a ternary's last branch, do not fail it",i(c("const facts = ok ? { ...metadata, k: 1 } : metadata;"),l).length===0,i(c("const facts = ok ? { ...metadata, k: 1 } : metadata;"),l).join("; "));{const $="efficient-web-builder/render/lib/document/published-passes",k="efficient-web-builder/render/lib/document/render-keep",y={call:"publishedChromeData",callFrom:$,variable:"data",inputs:["group"],keepFrom:k},T=`import { useRenderKeep } from "${k}";
15
+ `,R=`import { Render } from "efficient-easel/render";
16
+ ${T}import { ${y.call} } from "${$}";
14
17
  export default function H({ group }: { group: G }) {
15
- const data = ${g.call}({ content: [group] } as unknown as D);
16
- return <Render config={c} data={data} />;
17
- }`;e("…a chrome mount drawing `data={data}` passes",o(b,g).length===0,o(b,g).join("; ")),e("…and a write into its prop fails it",o(b.replace("const data",`group.props = {};
18
- const data`),g).length>0);const S="<Render config={headerRenderConfig()} data={data} />",w=`import { Render } from "efficient-easel/render";
19
- import { ${g.call} } from "${h}";
18
+ const data = ${y.call}({ content: [group] } as unknown as D);
19
+ const keep = useRenderKeep();
20
+ return <Render config={c} keep={keep} data={data} />;
21
+ }`;e("…a chrome mount drawing `data={data}` passes",i(R,y).length===0,i(R,y).join("; ")),e("…and a write into its prop fails it",i(R.replace("const data",`group.props = {};
22
+ const data`),y).length>0);const C="<Render config={headerRenderConfig()} keep={keep} data={data} />",S=`import { Render } from "efficient-easel/render";
23
+ ${T}import { ${y.call} } from "${$}";
20
24
  export default function PublishedHeader({ group }: { group: G }) {
21
- const data = ${g.call}({ root: { props: {} }, content: [group], zones: {} } as unknown as D);
25
+ const data = ${y.call}({ root: { props: {} }, content: [group], zones: {} } as unknown as D);
26
+ const keep = useRenderKeep();
22
27
  return (
23
28
  <Bar sticky={sticky}>
24
- ${S}
29
+ ${C}
25
30
  </Bar>
26
31
  );
27
- }`;e("…a header mount drawing `data={data}` inside a wrapper passes",o(w,g).length===0,o(w,g).join("; "));const R=[["`data` assigned after the call",w.replace(" return (",` data = extra;
28
- return (`)],["a property write on `data`",w.replace(" return (",` data.content = [];
29
- return (`)],["a second Render with `data={data}` and a spread",w.replace(S,`${S}
30
- <Render data={data} {...extra} />`)],["its call imported from another module",w.replace(`from "${h}"`,'from "./published-passes"')]];for(const[T,D]of R)e(`…${T} fails it`,o(D,g).length>0)}const C=[["a wrapping pass",m(`const page = extra(${p.call}(data, metadata));
31
- ${x}`)],["a pass after the call",m(`const page = ${p.call}(data, metadata).x;
32
- ${x}`)],["a reassignment",m(`let page = ${p.call}(data, metadata);
32
+ }`;e("…a header mount drawing `data={data}` inside a wrapper passes",i(S,y).length===0,i(S,y).join("; "));const B=[["`data` assigned after the call",S.replace(" return (",` data = extra;
33
+ return (`)],["a property write on `data`",S.replace(" return (",` data.content = [];
34
+ return (`)],["a second Render with `data={data}` and a spread",S.replace(C,`${C}
35
+ <Render data={data} {...extra} />`)],["its call imported from another module",S.replace(`from "${$}"`,'from "./published-passes"')],["no keep on the tag",S.replace(" keep={keep}","")],["its keep hook imported from another module",S.replace(`from "${k}"`,'from "./render-keep"')]];for(const[P,z]of B)e(`…${P} fails it`,i(z,y).length>0)}const K=[["a wrapping pass",h(`const page = extra(${l.call}(data, metadata));
36
+ ${x}`)],["a pass after the call",h(`const page = ${l.call}(data, metadata).x;
37
+ ${x}`)],["a reassignment",h(`let page = ${l.call}(data, metadata);
33
38
  page = extra(page);
34
- ${x}`)],["a pass in the Render prop",m(`${$}
35
- return <Render data={extra(page)} />;`)],["other arguments",m(`const page = ${p.call}(extra(data), metadata);
36
- ${x}`)],["no call at all",m(x)],["a pass on the input before the call",c("data = extra(data);")],["a compound assignment to the input",c("metadata ??= {};")],["an increment of the input",c("data++;")],["a destructured reassignment of the input",c("({ data } = extra({ data }));")],["an array reassignment of the input",c("[data, metadata] = extra([data, metadata]);")],["a local shadowing the input",c("{ const data = extra(0); }")],["a rebuilt argument named as the args",m(`const d = extra(data);
37
- const page = ${p.call}(d, metadata);
38
- ${x}`),{...p,args:"d, metadata"}],["an argument that is no prop at all",`const page = ${p.call}(data, metadata);
39
- ${x}`],["a property write",s("page.content = extra(page.content);")],["a deep property write",s("page.root.props = {};")],["a compound property write",s("page.count += 1;")],["a bracket write",s('page["content"] = [];')],["an optional-path write",s("page.root!.props = {};")],["a delete",s("delete page.root;")],["Object.assign into it",s("Object.assign(page, extra(page));")],["the variable handed whole to a call",s("mutate(page);")],["the variable aliased",s("const shown = page;")],["a push on a path from it",s("page.content.push(extra(0));")],["a splice on an optional path from it",s("page.content?.splice(0, 1);")],["a sort on a bracket path from it",s('page["content"].sort();')],["an input handed to a pass through a cast",c("inPlacePass(data as Doc);")],["an input handed whole to a call",c("mutate(data);")],["a push through a cast of an input",c("(data as Doc).content.push(x);")],["a property write through a cast of an input",c("(metadata as any).x = 1;")],["a property write through an old-style cast",c("(<any>metadata).x = 1;")],["a property write through a non-null input",c("(metadata!).x = 1;")],["a push on a non-null input",c("data!.content.push(x);")],["an input aliased through a cast, then written",c(`const d = data as any;
40
- d.content = [];`)],["an input aliased",c("const d = data;")],["an input path aliased",c("const p = metadata.facts;")],["a path value bound to a local",s("const one = page.content.length === 1;")],["a path alias pushed into",s(`const c = page.content;
41
- c.push(x);`)],["a path alias written",s(`const r = page.root;
42
- r.props = {};`)],["a path assigned to a let",s(`let c;
43
- c = page.content;`)],["a path handed to a writing call",s("mutate(page.content);")],["a path's forEach writing",s("page.content.forEach((s) => { s.props = {}; });")],["a path's for-of writing",s("for (const s of page.content) s.props.x = 1;")],["a path in an array literal",s("const all = [page.content];")],["the variable spread into a copy",s(`const copy = { ...page };
44
- copy.content.push(x);`)],["a path handed to a method that shares a reader's name",s("evil.first(page.content);")],["a local from an input's ternary branch, written through a cast",c(`const f = ok ? {} : metadata;
45
- (f as any).x = 1;`)],["a local from an input's ternary branch, handed to a call",c(`const f = ok ? {} : metadata;
46
- mutate(f);`)],["an input assigned an object with no space",c("data={content: [], root: {}};")],["an input assigned a cast object with no space",c("data={ content: [] } as unknown;")],["a second input assigned with no space",c("metadata={k: 1};")],["an input assigned a string with no space",c('data="";')],["the variable assigned with no space",s("page={content: [], root:{props:{}}} as any;")],["a spread copy of an input, written deep",c(`const copy: any = { ...metadata };
47
- copy.theme.x = 1;`)],["a spread copy of an input, handed to a call",c(`const copy = { ...metadata };
39
+ ${x}`)],["a pass in the Render prop",h(`${f}
40
+ return <Render data={extra(page)} />;`)],["other arguments",h(`const page = ${l.call}(extra(data), metadata);
41
+ ${x}`)],["no call at all",h(x)],["a pass on the input before the call",s("data = extra(data);")],["a compound assignment to the input",s("metadata ??= {};")],["an increment of the input",s("data++;")],["a destructured reassignment of the input",s("({ data } = extra({ data }));")],["an array reassignment of the input",s("[data, metadata] = extra([data, metadata]);")],["a local shadowing the input",s("{ const data = extra(0); }")],["a rebuilt argument named as the args",h(`const d = extra(data);
42
+ const page = ${l.call}(d, metadata);
43
+ ${x}`),{...l,args:"d, metadata"}],["an argument that is no prop at all",`const page = ${l.call}(data, metadata);
44
+ ${x}`],["a property write",c("page.content = extra(page.content);")],["a deep property write",c("page.root.props = {};")],["a compound property write",c("page.count += 1;")],["a bracket write",c('page["content"] = [];')],["an optional-path write",c("page.root!.props = {};")],["a delete",c("delete page.root;")],["Object.assign into it",c("Object.assign(page, extra(page));")],["the variable handed whole to a call",c("mutate(page);")],["the variable aliased",c("const shown = page;")],["a push on a path from it",c("page.content.push(extra(0));")],["a splice on an optional path from it",c("page.content?.splice(0, 1);")],["a sort on a bracket path from it",c('page["content"].sort();')],["an input handed to a pass through a cast",s("inPlacePass(data as Doc);")],["an input handed whole to a call",s("mutate(data);")],["a push through a cast of an input",s("(data as Doc).content.push(x);")],["a property write through a cast of an input",s("(metadata as any).x = 1;")],["a property write through an old-style cast",s("(<any>metadata).x = 1;")],["a property write through a non-null input",s("(metadata!).x = 1;")],["a push on a non-null input",s("data!.content.push(x);")],["an input aliased through a cast, then written",s(`const d = data as any;
45
+ d.content = [];`)],["an input aliased",s("const d = data;")],["an input path aliased",s("const p = metadata.facts;")],["a path value bound to a local",c("const one = page.content.length === 1;")],["a path alias pushed into",c(`const c = page.content;
46
+ c.push(x);`)],["a path alias written",c(`const r = page.root;
47
+ r.props = {};`)],["a path assigned to a let",c(`let c;
48
+ c = page.content;`)],["a path handed to a writing call",c("mutate(page.content);")],["a path's forEach writing",c("page.content.forEach((s) => { s.props = {}; });")],["a path's for-of writing",c("for (const s of page.content) s.props.x = 1;")],["a path in an array literal",c("const all = [page.content];")],["the variable spread into a copy",c(`const copy = { ...page };
49
+ copy.content.push(x);`)],["a path handed to a method that shares a reader's name",c("evil.first(page.content);")],["a local from an input's ternary branch, written through a cast",s(`const f = ok ? {} : metadata;
50
+ (f as any).x = 1;`)],["a local from an input's ternary branch, handed to a call",s(`const f = ok ? {} : metadata;
51
+ mutate(f);`)],["an input assigned an object with no space",s("data={content: [], root: {}};")],["an input assigned a cast object with no space",s("data={ content: [] } as unknown;")],["a second input assigned with no space",s("metadata={k: 1};")],["an input assigned a string with no space",s('data="";')],["the variable assigned with no space",c("page={content: [], root:{props:{}}} as any;")],["a spread copy of an input, written deep",s(`const copy: any = { ...metadata };
52
+ copy.theme.x = 1;`)],["a spread copy of an input, handed to a call",s(`const copy = { ...metadata };
48
53
  mutate(copy);`)],["a reader declared in the mount",`${d}
49
54
  function first(x) { x.content = []; }`],["a reader declared as a local arrow",`${d}
50
55
  const first = (x) => { x.content = []; };`],["a reader that is not imported",d.replace(`import { first } from "./first";
51
- `,"")],["eval",s('eval("page.content = []");')],["new Function",s('new Function("p", "p.content = []")(page);')],["Function called",s('Function("p", "p.content = []");')],["a call in a class extends clause",s("class W extends (mutate(page), Object) {}")],["a call in an instantiation expression",s("const g = (mutate(page), id)<number>;")],["a Render from another module",d.replace('from "efficient-easel/render"','from "./fake-render"')],["a second Render import, renamed",d.replace('import { Render } from "efficient-easel/render";',`import { Render } from "efficient-easel/render";
56
+ `,"")],["eval",c('eval("page.content = []");')],["new Function",c('new Function("p", "p.content = []")(page);')],["Function called",c('Function("p", "p.content = []");')],["a call in a class extends clause",c("class W extends (mutate(page), Object) {}")],["a call in an instantiation expression",c("const g = (mutate(page), id)<number>;")],["a Render from another module",d.replace('from "efficient-easel/render"','from "./fake-render"')],["a second Render import, renamed",d.replace('import { Render } from "efficient-easel/render";',`import { Render } from "efficient-easel/render";
52
57
  import { Render as Second } from "efficient-easel/render";`)],["a namespace import of Render's module",d.replace('import { Render } from "efficient-easel/render";',`import { Render } from "efficient-easel/render";
53
58
  import * as E from "efficient-easel/render";`)],["a default import of Render's module",d.replace('import { Render } from "efficient-easel/render";',`import { Render } from "efficient-easel/render";
54
- import E from "efficient-easel/render";`)],["the call declared in the mount, not imported",`${d.replace(`import { ${p.call} } from "./published-passes";
59
+ import E from "efficient-easel/render";`)],["the call declared in the mount, not imported",`${d.replace(`import { ${l.call} } from "./published-passes";
60
+ `,"")}
61
+ function ${l.call}(d, m) { const x: any = d; x.content = []; return x; }`],["the call declared again beside its import",`${d}
62
+ function ${l.call}(d, m) { return d; }`],["the call imported from outside this package",d.replace('from "./published-passes"','from "evil-passes"')],["another function imported as the call",d.replace(`import { ${l.call} }`,`import { evilPass as ${l.call} }`)],["the call as a type-only import",d.replace(`import { ${l.call} }`,`import type { ${l.call} }`)],["no keep on the tag",d.replace(" keep={keep}","")],["a keep made at module level",d.replace(`${p}
63
+ `,"").replace("export default function",`const keep = createRenderKeep();
64
+ export default function`)],["a keep made new on each draw",d.replace(p,"const keep = createRenderKeep();")],["a keep wrapped in a call",d.replace(p,"const keep = other(useRenderKeep());")],["a keep set again",d.replace(p,`let keep = useRenderKeep();
65
+ keep = createRenderKeep();`)],["a keep hook declared in the mount",`${d.replace(`import { useRenderKeep } from "${j}";
55
66
  `,"")}
56
- function ${p.call}(d, m) { const x: any = d; x.content = []; return x; }`],["the call declared again beside its import",`${d}
57
- function ${p.call}(d, m) { return d; }`],["the call imported from outside this package",d.replace('from "./published-passes"','from "evil-passes"')],["another function imported as the call",d.replace(`import { ${p.call} }`,`import { evilPass as ${p.call} }`)],["the call as a type-only import",d.replace(`import { ${p.call} }`,`import type { ${p.call} }`)],["a call with no input it can check",m(`const page = ${p.call}({ ...data });
58
- ${x}`),{call:p.call,variable:"page",args:"{ ...data }"}],["a call with no args and no inputs named",d,{call:p.call,variable:"page"}]];for(const[h,g,b]of C)e(`…${h} fails it`,o(g,b??p).length>0);const A=u().checks;return U.set(n,A),A}function le(n,a){const{check:e,report:u}=M("published mounts"),o=a.ts;if(!e("the rule is handed the compiler (`options.ts`)",o!==void 0,"a host passes `ts` from its own typescript"))return u();for(const $ of ie(o))e($.name,$.ok,$.detail);const p=n.filter($=>/\.tsx?$/.test($.path));e(`the source scan reached the tree (${p.length} TS/TSX files, at least ${a.minFiles})`,p.length>=a.minFiles);const x=Object.keys(a.mounts);e("at least one published mount is named",x.length>0);for(const $ of x){const m=p.find(c=>c.path===$);if(!e(`${$} is here`,m!==void 0,"a stale row would shelter nothing"))continue;const d=G(m.text,a.mounts[$],o);e(`${$} draws exactly what ${a.mounts[$].call} returns — a pass belongs in lib/document/published-passes`,d.length===0,d.join("; "))}return u()}export{G as mountProblems,le as publishedMounts};
67
+ function useRenderKeep() { return new WeakMap(); }`],["a keep hook from outside this package",d.replace(`from "${j}"`,'from "evil-keep"')],["a keep hook from another module of this package",d.replace(`from "${j}"`,'from "./render-keep"')],["a call with no input it can check",h(`const page = ${l.call}({ ...data });
68
+ ${x}`),{call:l.call,variable:"page",args:"{ ...data }"}],["a call with no args and no inputs named",d,{call:l.call,variable:"page"}]];for(const[$,k,y]of K)e(`…${$} fails it`,i(k,y??l).length>0);const A=m().checks;return Z.set(n,A),A}function ge(n,a){const{check:e,report:m}=U("published mounts"),i=a.ts;if(!e("the rule is handed the compiler (`options.ts`)",i!==void 0,"a host passes `ts` from its own typescript"))return m();for(const p of ue(i))e(p.name,p.ok,p.detail);const l=n.filter(p=>/\.tsx?$/.test(p.path));e(`the source scan reached the tree (${l.length} TS/TSX files, at least ${a.minFiles})`,l.length>=a.minFiles);const x=Object.keys(a.mounts);e("at least one published mount is named",x.length>0);const f=new Set(x.map(p=>a.mounts[p].renderFrom??"efficient-easel/render"));for(const p of l)!x.includes(p.path)&&[...f].some(h=>de(i,p.path,p.text,h))&&e(`${p.path} draws easel Render: it is a named published mount (a row), or the rule never reads it`,!1,"add its row to the mounts this repository names");for(const p of x){const h=l.find(s=>s.path===p);if(!e(`${p} is here`,h!==void 0,"a stale row would shelter nothing"))continue;const d=Q(h.text,a.mounts[p],i);e(`${p} draws exactly what ${a.mounts[p].call} returns — a pass belongs in lib/document/published-passes`,d.length===0,d.join("; "))}return m()}export{Q as mountProblems,ge as publishedMounts};
@@ -1,6 +1,8 @@
1
1
  import type { Config } from "efficient-easel/blocks";
2
- export default function PageRender({ config, data, metadata, }: {
2
+ declare function PageRender({ config, data, metadata, }: {
3
3
  config: Config;
4
4
  data: unknown;
5
5
  metadata?: Record<string, unknown>;
6
6
  }): import("react").JSX.Element;
7
+ declare const _default: import("react").MemoExoticComponent<typeof PageRender>;
8
+ export default _default;
@@ -1 +1 @@
1
- "use client";import{jsx as n}from"react/jsx-runtime";import{Render as c}from"efficient-easel/render";import{BelowFirstScreen as d,LATER_SLIDES_KEY as l,firstScreenLead as f,laterSlideIdsOf as m,useLeadDrawsFirst as p}from"../first-screen.js";import{publishedPageData as u}from"./published-passes.js";import{withSlotCounts as S}from"./slot-counts.js";function g({config:o,data:s,metadata:t}){const e=u(s,t),i=p(o,f(e.content)),r=m(e.content),a=r.length>0?{...t,[l]:r}:t;return n(d,{children:n(c,{config:i,metadata:S(a,e.content),data:e})})}export{g as default};
1
+ "use client";import{jsx as o}from"react/jsx-runtime";import{memo as a}from"react";import{Render as p}from"efficient-easel/render";import{BelowFirstScreen as d,LATER_SLIDES_KEY as f,firstScreenLead as l,laterSlideIdsOf as u,useLeadDrawsFirst as S}from"../first-screen.js";import{publishedPageData as g}from"./published-passes.js";import{useRenderKeep as h}from"./render-keep.js";import{withSlotCounts as w}from"./slot-counts.js";function L({config:n,data:s,metadata:t}){const e=g(s,t),i=h(),c=S(n,l(e.content)),r=u(e.content),m=r.length>0?{...t,[f]:r}:t;return o(d,{children:o(p,{config:c,metadata:w(m,e.content),keep:i,data:e})})}var k=a(L);export{k as default};
@@ -0,0 +1,2 @@
1
+ import { type RenderKeep } from "efficient-easel/render";
2
+ export declare function useRenderKeep(): RenderKeep;
@@ -0,0 +1 @@
1
+ "use client";import{useRef as r}from"react";import{createRenderKeep as n}from"efficient-easel/render";function o(){const e=r(null);return e.current??=n(),e.current}export{o as useRenderKeep};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-web-builder",
3
- "version": "70.4.0",
3
+ "version": "71.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
  },
55
55
  "peerDependencies": {
56
56
  "@tabler/icons-react": "^3.46.0",
57
- "efficient-easel": "^35.0.0",
57
+ "efficient-easel": "^35.1.0",
58
58
  "efficient-shell": "^13.17.0",
59
59
  "isomorphic-dompurify": "^3.18.0",
60
60
  "next": ">=16",
@@ -73,7 +73,7 @@
73
73
  "@types/node": "^20",
74
74
  "@types/react": "^19",
75
75
  "@types/react-dom": "^19",
76
- "efficient-easel": "^35.0.0",
76
+ "efficient-easel": "^35.1.0",
77
77
  "efficient-shell": "^13.17.0",
78
78
  "efficient-shell-checker": "npm:efficient-shell@13.17.0",
79
79
  "esbuild": "^0.28.0",