efficient-web-builder 74.6.0 → 74.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/dist/editor/components/AddPageWindow.js +1 -1
- package/dist/editor/components/CustomHtmlCodeWindow.js +3 -3
- package/dist/editor/components/DuplicateToPageMenu.js +1 -1
- package/dist/editor/components/PageStarterCard.js +1 -1
- package/dist/editor/components/PagesPanel.js +1 -1
- package/dist/editor/components/PartSettingsPanel.js +1 -1
- package/dist/editor/components/PreviewPartAnchors.d.ts +2 -2
- package/dist/editor/components/PreviewPartAnchors.js +1 -1
- package/dist/editor/components/SectionTextPartBridge.js +1 -1
- package/dist/editor/components/SiteAccentField.js +1 -1
- package/dist/editor/components/SiteTextStylesField.d.ts +2 -0
- package/dist/editor/components/SiteTextStylesField.js +1 -1
- package/dist/editor/components/StandaloneSectionEditor.js +1 -1
- package/dist/editor/components/StorefrontEditor.js +1 -1
- package/dist/editor/components/WebsiteScreenParts.js +1 -1
- package/dist/editor/components/storefront-editor.css +45 -8
- package/dist/editor/components/useSocialSettings.d.ts +2 -2
- package/dist/editor/lib/content/section-one-padding.d.ts +31 -0
- package/dist/editor/lib/content/section-one-padding.js +1 -0
- package/dist/editor/lib/document/blocks/general/index.d.ts +2 -2
- package/dist/editor/lib/document/box-fields.d.ts +1 -1
- package/dist/editor/lib/document/page-root.js +2 -2
- package/dist/format/lib/content/box-shape.d.ts +1 -1
- package/dist/format/lib/content/box-side-space.d.ts +6 -2
- package/dist/format/lib/content/box-side-space.js +1 -1
- package/dist/format/lib/content/page-width.d.ts +10 -1
- package/dist/format/lib/content/page-width.js +1 -1
- package/dist/format/lib/content/view-lines.d.ts +1 -0
- package/dist/format/lib/content/view-lines.js +1 -1
- package/dist/format/lib/document/blocks/block-types.d.ts +2 -0
- package/dist/format/lib/document/passes/types.d.ts +2 -0
- package/dist/format/lib/document/style-text.d.ts +2 -0
- package/dist/format/lib/document/style-text.js +1 -1
- package/dist/format/lib/editor-words-catalogue.d.ts +1 -0
- package/dist/format/lib/editor-words-catalogue.js +1 -1
- package/dist/format/lib/editor-words-kept.js +1 -1
- package/dist/format/lib/fonts.d.ts +43 -7
- package/dist/format/lib/fonts.js +1 -1
- package/dist/format/lib/frame-viewport.d.ts +3 -0
- package/dist/format/lib/frame-viewport.js +1 -0
- package/dist/format/lib/page-starters.d.ts +2 -0
- package/dist/format/lib/page-starters.js +1 -1
- package/dist/format/lib/site-font-faces.d.ts +9 -0
- package/dist/format/lib/site-font-faces.js +2 -0
- package/dist/format/lib/site-theme-row.d.ts +29 -1
- package/dist/format/lib/site-theme-row.js +1 -0
- package/dist/format/lib/sized-image.js +1 -1
- package/dist/format/lib/source-rules/one-dropdown.js +3 -3
- package/dist/format/lib/source-rules/page-picture-place.js +3 -3
- package/dist/format/lib/source-rules/published-mounts.js +38 -38
- package/dist/format/lib/source-rules/shape-rows-use-the-picker.js +2 -2
- package/dist/format/lib/source-rules/support/element-call.d.ts +5 -0
- package/dist/format/lib/source-rules/support/element-call.js +1 -0
- package/dist/format/lib/word-styles.d.ts +7 -6
- package/dist/format/lib/word-styles.js +1 -1
- package/dist/render/components/BlockFrame.d.ts +3 -1
- package/dist/render/components/BlockFrame.js +1 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/HeroPictures.d.ts +2 -2
- package/dist/render/components/PublishedPartStylesContext.js +1 -1
- package/dist/render/components/SiteFontsContext.d.ts +11 -0
- package/dist/render/components/SiteFontsContext.js +2 -0
- package/dist/render/lib/content/section-own-pads.d.ts +2 -2
- package/dist/render/lib/content/section-own-pads.js +1 -1
- package/dist/render/lib/content/section-padding.d.ts +3 -2
- package/dist/render/lib/document/part-styles.d.ts +7 -5
- package/dist/render/lib/document/part-styles.js +2 -2
- package/dist/render/lib/document/passes/section-padding.d.ts +2 -1
- package/dist/render/lib/document/passes/section-padding.js +1 -1
- package/dist/render/lib/text-styles/site-text-styles.d.ts +3 -3
- package/dist/render/lib/text-styles/site-text-styles.js +2 -2
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/package.json +2 -2
|
@@ -1,68 +1,68 @@
|
|
|
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";
|
|
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 I(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 j(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&&j(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)||j(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),d=t=>m.getLineAndCharacterOfPosition(t.getStart(m)).line+1,s=t=>e.isShorthandPropertyAssignment(t.parent)&&t.parent.name===t?i.getShorthandAssignmentValueSymbol(t.parent):i.getSymbolAtLocation(t),h=t=>x.filter(r=>r.text===t&&I(e,r)),u=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},p=[],c=(t,r,o)=>{const f=l.filter(E=>e.isImportSpecifier(E)&&E.name.text===r),g=f[0],b=g?g.parent.parent.parent.moduleSpecifier.text:"";return f.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`},F=h(a.variable);if(F.length!==1)return[`\`${a.variable}\` is declared ${F.length} times, not once`];const A=F[0].parent;if(!e.isVariableDeclaration(A))return[`\`${a.variable}\` is not a variable declaration`];const $=s(F[0]),y=A.initializer;let k=null;const T=c(`the call ${a.call}`,a.call,a.callFrom);if(typeof T=="string"&&p.push(T),!y||!e.isCallExpression(y)||!e.isIdentifier(y.expression)||y.expression.text!==a.call||typeof T!="string"&&s(y.expression)!==T)p.push(`\`${a.variable}\` is not set straight from ${a.call}(…): a pass wraps it, or something follows the call`);else{k=y;const t=n.slice(y.arguments.pos,y.arguments.end).trim();a.args!==void 0&&t!==a.args&&p.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[...p,`\`${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 p.push("the component does not destructure its props");const B=a.inputs??re(a.args??"").filter(t=>ie.test(t));B.length===0&&p.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){p.push(`\`${t}\` is not a prop of the component: the call is handed something made in the mount`);continue}h(t).length!==1&&p.push(`\`${t}\` is declared ${h(t).length} times in the file: a second binding would pass for the input`);const o=s(r);o&&P.add(o)}for(const t of x)t.text==="arguments"&&!I(e,t)&&e.findAncestor(t,r=>r===R)&&p.push(`\`arguments\` is used in the component (line ${d(t)}): it is the props by another name`);for(const t of x)(t.text==="eval"||t.text==="Function")&&!I(e,t)&&!u(t)&&!(e.isPropertyAccessExpression(t.parent)&&t.parent.name===t)&&p.push(`\`${t.text}\` is used in the mount file (line ${d(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"?p.push(o):z.add(o)}const Y=t=>{if(!e.isCallExpression(t)||!e.isIdentifier(t.expression))return!1;const r=s(t.expression);return r!==void 0&&z.has(r)};let W=null;const N=l.filter(t=>e.isImportSpecifier(t)&&t.name.text==="Render"),J=a.renderFrom??"efficient-easel/render",ee=N.length===1?N[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(f=>!f.isTypeOnly).map(f=>f.propertyName?`${f.propertyName.text} as ${f.name.text}`:f.name.text):[]]});(M.length!==1||M[0]!=="Render")&&p.push(`"${J}" gives this file ${M.length} binding(s) (${M.join(", ")||"none"}), not the one \`Render\``);const q=N.length===1&&!N[0].propertyName&&ee===J?i.getSymbolAtLocation(N[0].name):void 0;if(!q||h("Render").length!==1)p.push(`\`Render\` is not imported once by its own name from "${J}"`);else{const t=x.filter(o=>!I(e,o)&&s(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)p.push(`\`Render\` is used ${t.length} times, ${r.length} as a tag: one <Render> and no alias`);else{const f=r[0].parent.attributes.properties;f.some(w=>e.isJsxSpreadAttribute(w))&&p.push("the Render tag has a spread attribute, which can hand it another document");const g=f.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)||s(E)!==$?p.push(`the Render tag draws \`${E?E.getText():g.length===1?g[0].getText():"nothing"}\`, not \`${a.variable}\``):W=E;const G=f.filter(w=>e.isJsxAttribute(w)&&w.name.getText()==="keep"),V=G.length===1?G[0].initializer:void 0,K=V&&e.isJsxExpression(V)?V.expression:void 0;if(!K||!e.isIdentifier(K))p.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??L);typeof w=="string"&&p.push(w);const D=s(K)?.valueDeclaration;if(!D||!e.isVariableDeclaration(D)||D.parent.parent.parent!==R.body||h(K.text).length!==1)p.push(`\`${K.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))p.push(`\`${K.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"||s(O.expression)!==w)&&p.push(`\`${K.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(k&&o===k)return k.arguments.some(g=>g===r);if(!(j(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 f=r.parent;if(!f)return;if(j(e,f))r=f;else if(e.isConditionalExpression(f)&&f.condition!==r)r=f,o=!0;else if(e.isSpreadAssignment(f)&&e.isObjectLiteralExpression(f.parent))r=f.parent,o=!0;else return e.isVariableDeclaration(f)&&f.initializer===r&&e.isIdentifier(f.name)&&o?s(f.name):void 0}},X=(t,r)=>{if(u(t))return!0;const{top:o,path:f}=_(e,t);if(t===W)return!0;let g=o;for(;g.parent&&(j(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=f?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(I(e,r))continue;const o=s(r);o&&v.has(o)&&X(r,o)}}for(const t of x){if(I(e,t))continue;const r=s(t);if(!r||!v.has(r)||X(t,r))continue;const{top:o}=_(e,t),f=v.get(r),g=P.has(r)||r===$?"":" (a local that holds an input or the variable)";p.push(`\`${f}\`${g} is ${ce(e,o)} at line ${d(t)}`)}return p}const L="@/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,/\.[jt]sx$/.test(a)?n.ScriptKind.TSX:/\.[jt]s$/.test(a)?n.ScriptKind.TS:n.ScriptKind.TSX),l=d=>d.some(s=>!s.isTypeOnly&&(s.propertyName??s.name).text==="Render"),x=d=>{if(n.isImportDeclaration(d)&&n.isStringLiteral(d.moduleSpecifier)&&d.moduleSpecifier.text===m){const s=d.importClause;if(!s||s.isTypeOnly)return!1;const h=s.namedBindings;return!!s.name||h!==void 0&&(n.isNamespaceImport(h)||l(h.elements))}if(n.isExportDeclaration(d)&&d.moduleSpecifier&&n.isStringLiteral(d.moduleSpecifier)&&d.moduleSpecifier.text===m){if(d.isTypeOnly)return!1;const s=d.exportClause;return!s||n.isNamespaceExport(s)||l(s.elements)}if(n.isCallExpression(d)&&d.arguments.length>0&&n.isStringLiteralLike(d.arguments[0])&&d.arguments[0].text===m){if(d.expression.kind===n.SyntaxKind.ImportKeyword||n.isIdentifier(d.expression)&&d.expression.text==="require"||n.isPropertyAccessExpression(d.expression)&&d.expression.name.text==="require")return!0;const s=d.expression;if(n.isCallExpression(s)&&n.isIdentifier(s.expression)&&s.expression.text==="createRequire")return!0}return n.forEachChild(d,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=($,y)=>Q($,y,n),l={call:"publishedPageData",variable:"page",args:"data, metadata",readers:["first"]},x="return <Render config={c} keep={keep} data={page} />;",d=`const page = ${l.call}(data, metadata);`,s="const keep = useRenderKeep();",h=$=>`import { Render } from "efficient-easel/render";
|
|
2
2
|
import { first } from "./first";
|
|
3
|
-
import { useRenderKeep } from "${
|
|
3
|
+
import { useRenderKeep } from "${L}";
|
|
4
4
|
import { ${l.call} } from "./published-passes";
|
|
5
5
|
export default function P({ data, metadata = {} }: Props) {
|
|
6
|
-
${
|
|
6
|
+
${s}
|
|
7
7
|
${$}
|
|
8
|
-
}`,
|
|
9
|
-
${x}`),
|
|
10
|
-
${
|
|
11
|
-
${x}`),c=$=>h(`${
|
|
8
|
+
}`,u=h(`${d}
|
|
9
|
+
${x}`),p=$=>h(`${$}
|
|
10
|
+
${d}
|
|
11
|
+
${x}`),c=$=>h(`${d}
|
|
12
12
|
${$}
|
|
13
|
-
${x}`);e("the one call, drawn, passes",i(
|
|
14
|
-
${
|
|
13
|
+
${x}`);e("the one call, drawn, passes",i(u,l).length===0,i(u,l).join("; "));{const $={...l,callFrom:"@/lib/document/published-passes"},y=u.replace('from "./published-passes"',`from "${$.callFrom}"`);e("…the call imported from the module the mount names passes",i(y,$).length===0,i(y,$).join("; ")),e("…and the call imported from another module inside this package fails it",i(u,$).length>0)}e("…a comment naming a wrapper does not fail it",i(`// const page = x(${l.call}(data, metadata));
|
|
14
|
+
${u}`,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",y="efficient-web-builder/render/lib/document/render-keep",k={call:"publishedChromeData",callFrom:$,variable:"data",inputs:["group"],keepFrom:y},T=`import { useRenderKeep } from "${y}";
|
|
15
15
|
`,R=`import { Render } from "efficient-easel/render";
|
|
16
|
-
${T}import { ${
|
|
16
|
+
${T}import { ${k.call} } from "${$}";
|
|
17
17
|
export default function H({ group }: { group: G }) {
|
|
18
|
-
const data = ${
|
|
18
|
+
const data = ${k.call}({ content: [group] } as unknown as D);
|
|
19
19
|
const keep = useRenderKeep();
|
|
20
20
|
return <Render config={c} keep={keep} data={data} />;
|
|
21
|
-
}`;e("…a chrome mount drawing `data={data}` passes",i(R,
|
|
22
|
-
const data`),
|
|
23
|
-
${T}import { ${
|
|
21
|
+
}`;e("…a chrome mount drawing `data={data}` passes",i(R,k).length===0,i(R,k).join("; ")),e("…and a write into its prop fails it",i(R.replace("const data",`group.props = {};
|
|
22
|
+
const data`),k).length>0);const C="<Render config={headerRenderConfig()} keep={keep} data={data} />",S=`import { Render } from "efficient-easel/render";
|
|
23
|
+
${T}import { ${k.call} } from "${$}";
|
|
24
24
|
export default function PublishedHeader({ group }: { group: G }) {
|
|
25
|
-
const data = ${
|
|
25
|
+
const data = ${k.call}({ root: { props: {} }, content: [group], zones: {} } as unknown as D);
|
|
26
26
|
const keep = useRenderKeep();
|
|
27
27
|
return (
|
|
28
28
|
<Bar sticky={sticky}>
|
|
29
29
|
${C}
|
|
30
30
|
</Bar>
|
|
31
31
|
);
|
|
32
|
-
}`;e("…a header mount drawing `data={data}` inside a wrapper passes",i(S,
|
|
32
|
+
}`;e("…a header mount drawing `data={data}` inside a wrapper passes",i(S,k).length===0,i(S,k).join("; "));const B=[["`data` assigned after the call",S.replace(" return (",` data = extra;
|
|
33
33
|
return (`)],["a property write on `data`",S.replace(" return (",` data.content = [];
|
|
34
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 "${
|
|
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 "${y}"`,'from "./render-keep"')]];for(const[P,z]of B)e(`…${P} fails it`,i(z,k).length>0)}const F=[["a wrapping pass",h(`const page = extra(${l.call}(data, metadata));
|
|
36
36
|
${x}`)],["a pass after the call",h(`const page = ${l.call}(data, metadata).x;
|
|
37
37
|
${x}`)],["a reassignment",h(`let page = ${l.call}(data, metadata);
|
|
38
38
|
page = extra(page);
|
|
39
|
-
${x}`)],["a pass in the Render prop",h(`${
|
|
39
|
+
${x}`)],["a pass in the Render prop",h(`${d}
|
|
40
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",
|
|
41
|
+
${x}`)],["no call at all",h(x)],["a pass on the input before the call",p("data = extra(data);")],["a compound assignment to the input",p("metadata ??= {};")],["an increment of the input",p("data++;")],["a destructured reassignment of the input",p("({ data } = extra({ data }));")],["an array reassignment of the input",p("[data, metadata] = extra([data, metadata]);")],["a local shadowing the input",p("{ const data = extra(0); }")],["a rebuilt argument named as the args",h(`const d = extra(data);
|
|
42
42
|
const page = ${l.call}(d, metadata);
|
|
43
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",
|
|
45
|
-
d.content = [];`)],["an input aliased",
|
|
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",p("inPlacePass(data as Doc);")],["an input handed whole to a call",p("mutate(data);")],["a push through a cast of an input",p("(data as Doc).content.push(x);")],["a property write through a cast of an input",p("(metadata as any).x = 1;")],["a property write through an old-style cast",p("(<any>metadata).x = 1;")],["a property write through a non-null input",p("(metadata!).x = 1;")],["a push on a non-null input",p("data!.content.push(x);")],["an input aliased through a cast, then written",p(`const d = data as any;
|
|
45
|
+
d.content = [];`)],["an input aliased",p("const d = data;")],["an input path aliased",p("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
46
|
c.push(x);`)],["a path alias written",c(`const r = page.root;
|
|
47
47
|
r.props = {};`)],["a path assigned to a let",c(`let c;
|
|
48
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",
|
|
50
|
-
(f as any).x = 1;`)],["a local from an input's ternary branch, handed to a call",
|
|
51
|
-
mutate(f);`)],["an input assigned an object with no space",
|
|
52
|
-
copy.theme.x = 1;`)],["a spread copy of an input, handed to a call",
|
|
53
|
-
mutate(copy);`)],["a reader declared in the mount",`${
|
|
54
|
-
function first(x) { x.content = []; }`],["a reader declared as a local arrow",`${
|
|
55
|
-
const first = (x) => { x.content = []; };`],["a reader that is not imported",
|
|
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",
|
|
57
|
-
import { Render as Second } from "efficient-easel/render";`)],["a namespace import of Render's module",
|
|
58
|
-
import * as E from "efficient-easel/render";`)],["a default import of Render's module",
|
|
59
|
-
import E from "efficient-easel/render";`)],["the call declared in the mount, not imported",`${
|
|
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",p(`const f = ok ? {} : metadata;
|
|
50
|
+
(f as any).x = 1;`)],["a local from an input's ternary branch, handed to a call",p(`const f = ok ? {} : metadata;
|
|
51
|
+
mutate(f);`)],["an input assigned an object with no space",p("data={content: [], root: {}};")],["an input assigned a cast object with no space",p("data={ content: [] } as unknown;")],["a second input assigned with no space",p("metadata={k: 1};")],["an input assigned a string with no space",p('data="";')],["the variable assigned with no space",c("page={content: [], root:{props:{}}} as any;")],["a spread copy of an input, written deep",p(`const copy: any = { ...metadata };
|
|
52
|
+
copy.theme.x = 1;`)],["a spread copy of an input, handed to a call",p(`const copy = { ...metadata };
|
|
53
|
+
mutate(copy);`)],["a reader declared in the mount",`${u}
|
|
54
|
+
function first(x) { x.content = []; }`],["a reader declared as a local arrow",`${u}
|
|
55
|
+
const first = (x) => { x.content = []; };`],["a reader that is not imported",u.replace(`import { first } from "./first";
|
|
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",u.replace('from "efficient-easel/render"','from "./fake-render"')],["a second Render import, renamed",u.replace('import { Render } from "efficient-easel/render";',`import { Render } from "efficient-easel/render";
|
|
57
|
+
import { Render as Second } from "efficient-easel/render";`)],["a namespace import of Render's module",u.replace('import { Render } from "efficient-easel/render";',`import { Render } from "efficient-easel/render";
|
|
58
|
+
import * as E from "efficient-easel/render";`)],["a default import of Render's module",u.replace('import { Render } from "efficient-easel/render";',`import { Render } from "efficient-easel/render";
|
|
59
|
+
import E from "efficient-easel/render";`)],["the call declared in the mount, not imported",`${u.replace(`import { ${l.call} } from "./published-passes";
|
|
60
60
|
`,"")}
|
|
61
|
-
function ${l.call}(d, m) { const x: any = d; x.content = []; return x; }`],["the call declared again beside its import",`${
|
|
62
|
-
function ${l.call}(d, m) { return d; }`],["the call imported from outside this package",
|
|
61
|
+
function ${l.call}(d, m) { const x: any = d; x.content = []; return x; }`],["the call declared again beside its import",`${u}
|
|
62
|
+
function ${l.call}(d, m) { return d; }`],["the call imported from outside this package",u.replace('from "./published-passes"','from "evil-passes"')],["another function imported as the call",u.replace(`import { ${l.call} }`,`import { evilPass as ${l.call} }`)],["the call as a type-only import",u.replace(`import { ${l.call} }`,`import type { ${l.call} }`)],["no keep on the tag",u.replace(" keep={keep}","")],["a keep made at module level",u.replace(`${s}
|
|
63
63
|
`,"").replace("export default function",`const keep = createRenderKeep();
|
|
64
|
-
export default function`)],["a keep made new on each draw",
|
|
65
|
-
keep = createRenderKeep();`)],["a keep hook declared in the mount",`${
|
|
64
|
+
export default function`)],["a keep made new on each draw",u.replace(s,"const keep = createRenderKeep();")],["a keep wrapped in a call",u.replace(s,"const keep = other(useRenderKeep());")],["a keep set again",u.replace(s,`let keep = useRenderKeep();
|
|
65
|
+
keep = createRenderKeep();`)],["a keep hook declared in the mount",`${u.replace(`import { useRenderKeep } from "${L}";
|
|
66
66
|
`,"")}
|
|
67
|
-
function useRenderKeep() { return new WeakMap(); }`],["a keep hook from outside this package",
|
|
68
|
-
${x}`),{call:l.call,variable:"page",args:"{ ...data }"}],["a call with no args and no inputs named",
|
|
67
|
+
function useRenderKeep() { return new WeakMap(); }`],["a keep hook from outside this package",u.replace(`from "${L}"`,'from "evil-keep"')],["a keep hook from another module of this package",u.replace(`from "${L}"`,'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",u,{call:l.call,variable:"page"}]];for(const[$,y,k]of F)e(`…${$} fails it`,i(y,k??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 s of ue(i))e(s.name,s.ok,s.detail);const l=n.filter(s=>/\.[jt]sx?$/.test(s.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 d=new Set(x.map(s=>a.mounts[s].renderFrom??"efficient-easel/render"));for(const s of l)!x.includes(s.path)&&[...d].some(h=>de(i,s.path,s.text,h))&&e(`${s.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 s of x){const h=l.find(p=>p.path===s);if(!e(`${s} is here`,h!==void 0,"a stale row would shelter nothing"))continue;const u=Q(h.text,a.mounts[s],i);e(`${s} draws exactly what ${a.mounts[s].call} returns — a pass belongs in lib/document/published-passes`,u.length===0,u.join("; "))}return m()}export{Q as mountProblems,ge as publishedMounts};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{isRuleSource as
|
|
2
|
-
`),
|
|
1
|
+
import{isRuleSource as k,ruleChecks as S}from"./rule.js";import{elementOf as P}from"./support/element-call.js";const w=new Set(["Select","SettingsSelect","FieldSelect"]);function g(t,n){const i=t.createSourceFile(n.path,n.text,t.ScriptTarget.Latest,!0,t.ScriptKind.TSX),r=[],p=[],c=e=>i.getLineAndCharacterOfPosition(e.getStart(i)).line+1,d=e=>{let s=e;for(;s&&(t.isAsExpression(s)||t.isSatisfiesExpression(s)||t.isParenthesizedExpression(s));)s=s.expression;return s},a=e=>e?t.isStringLiteralLike(e)?e.text:e.getText(i):"(no label)",f=e=>e.name&&(t.isIdentifier(e.name)||t.isStringLiteralLike(e.name))?e.name.text:void 0,x=(e,s)=>{for(const o of e.properties)if(f(o)===s){if(t.isPropertyAssignment(o))return o.initializer;if(t.isShorthandPropertyAssignment(o))return o.name}},h=e=>{const s=e.parent;return t.isCallExpression(s)&&t.isIdentifier(s.expression)&&s.expression.text==="describedAs"&&s.arguments[1]===e},m=e=>{if(t.isCallExpression(e)){const s=e.arguments[0];(t.isIdentifier(e.expression)&&e.expression.text==="select"||t.isPropertyAccessExpression(e.expression)&&e.expression.name.text==="select")&&e.arguments.length>=2&&s&&!t.isObjectLiteralExpression(s)&&r.push(`${n.path}|${a(s)}`);const l=e.arguments[1],u=P(t,e);u&&t.isIdentifier(u)&&u.text==="IconPicker"&&l&&t.isObjectLiteralExpression(l)&&l.properties.some(b=>f(b)==="emptyValue")&&p.push(c(l))}if(t.isImportSpecifier(e)&&e.propertyName&&(e.propertyName.text==="select"||e.propertyName.text==="IconPicker")&&r.push(`${n.path}|alias ${e.name.text}`),t.isBindingElement(e)&&e.propertyName&&t.isIdentifier(e.propertyName)&&e.propertyName.text==="select"&&r.push(`${n.path}|alias ${e.name.getText(i)}`),(t.isJsxOpeningElement(e)||t.isJsxSelfClosingElement(e))&&w.has(e.tagName.getText(i))){const s=e.attributes.properties.find(l=>t.isJsxAttribute(l)&&l.name.getText(i)==="label"),o=s&&t.isJsxAttribute(s)?s.initializer:void 0;r.push(`${n.path}|<${e.tagName.getText(i)}> ${o?a(t.isJsxExpression(o)?o.expression:o):"(no label)"}`)}if(t.isObjectLiteralExpression(e))for(const s of["type","kind"]){const o=d(x(e,s));o&&t.isStringLiteralLike(o)&&o.text==="select"&&!h(e)&&r.push(`${n.path}|${a(x(e,"label"))}`)}t.isJsxAttribute(e)&&e.name.getText(i)==="emptyValue"&&e.parent.parent.tagName.getText(i)==="IconPicker"&&p.push(c(e)),t.isJsxSpreadAttribute(e)&&e.parent.parent.tagName.getText(i)==="IconPicker"&&p.push(c(e)),t.forEachChild(e,m)};return m(i),{selects:r,emptyValues:p}}function y(t){const n=new Map;for(const i of t)n.set(i,(n.get(i)??0)+1);return n}function $(t,n,i){const{check:r,report:p}=S("shape rows use the picker");{const e=['const a = select("Corner shape", icon, options);','const b = { type: "select", label: "Card shape", options };','const c = { type: "select" as const, label: LABEL, options };',"const d = select(item);",'const e = iconPickerRow("Corner shape", icon, options, "a");','const f = <IconPicker label="x" emptyValue="none" options={o} />;','const g = <IconPicker label="x" options={o} />;','const h = <Other emptyValue="none" />;','// select("A comment", icon) is not a use','const i = select(say("Said"), icon, options);',"const j = select(LABELS.x, icon, options);","const k = select(`A ${b}`, icon, options);",'const l = { "type": "select", label, options };',"const m = select({ index }, other);",'import { select as pick } from "x";','const n = createElement(IconPicker<V>, { label: "x", emptyValue: "none" });','const o = createElement(IconPicker, { label: "x" });','const p = rows.select("By a member", icon, options);',"const { select: q } = rows;",'const r = { type: "select" satisfies string, label: "Satisfied", options };','const s = { kind: "select", label: "A kind", options };','const t = <SettingsSelect label="Hand drawn" options={o} />;',"const u = <FieldSelect value={v} options={o} />;",'const v = <IconPicker label="x" {...rest} />;','import { IconPicker as Pick } from "x";','const w = describedAs(field, { type: "select", label: "Described" });',"const x = rows.select(item);"].join(`
|
|
2
|
+
`),s=g(t,{path:"f.tsx",text:e});r("R1 finds the builder and both field forms, and nothing else",JSON.stringify(s.selects)===JSON.stringify(["f.tsx|Corner shape","f.tsx|Card shape","f.tsx|LABEL",'f.tsx|say("Said")',"f.tsx|LABELS.x","f.tsx|`A ${b}`","f.tsx|label","f.tsx|alias pick","f.tsx|By a member","f.tsx|alias q","f.tsx|Satisfied","f.tsx|A kind","f.tsx|<SettingsSelect> Hand drawn","f.tsx|<FieldSelect> (no label)","f.tsx|alias Pick"]),JSON.stringify(s.selects)),r("R2 finds emptyValue on an IconPicker only, in both forms, and a spread",JSON.stringify(s.emptyValues)==="[6,16,24]",JSON.stringify(s.emptyValues))}const c=n.filter(e=>/\.tsx?$/.test(e.path)&&!e.path.endsWith(".d.ts")&&!k(e.path)),d=[],a=[];for(const e of c){const s=g(t,e);d.push(...s.selects),s.emptyValues.forEach(o=>a.push(`${e.path}:${o}`))}const f=y(d),x=y(i.selectRows),h=[...f].filter(([e,s])=>s>(x.get(e)??0)).map(([e])=>e).sort(),m=[...x].filter(([e,s])=>s>(f.get(e)??0)).map(([e])=>e);return r("R1 every select row is on the repository's list",h.length===0,`${h.join(", ")}: a row that picks between shapes uses iconPickerRow or shapePickerRow; a row that picks words joins the list`),r("R1 every name on the list is still a select row",m.length===0,`${m.join(", ")}: remove the entry`),r("R2 no IconPicker takes emptyValue",a.length===0,`${a.join(", ")}: use pickerNoneIcon, so the closed word has the size of every other`),r(`walked the source (${c.length} TS/TSX files, at least ${i.minFiles})`,c.length>=i.minFiles),p()}export{$ as shapeRowsUseThePicker};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type * as TS from "typescript";
|
|
2
|
+
export declare const ELEMENT_FACTORIES: ReadonlySet<string>;
|
|
3
|
+
export declare const ELEMENT_FACTORY_PATTERN = "(?:createElement|\\bh|_?jsxs?|_?jsxDEV)";
|
|
4
|
+
export declare function factoryCall(ts: typeof TS, call: TS.CallExpression): boolean;
|
|
5
|
+
export declare function elementOf(ts: typeof TS, call: TS.CallExpression): TS.Expression | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const i=new Set(["createElement","h","jsx","jsxs","jsxDEV","_jsx","_jsxs","_jsxDEV"]),o="(?:createElement|\\bh|_?jsxs?|_?jsxDEV)";function r(s,n){const e=n.expression;if(s.isIdentifier(e))return e.text;if(s.isPropertyAccessExpression(e))return e.name.text}function t(s,n){const e=r(s,n);return e!==void 0&&i.has(e)}function x(s,n){if(!t(s,n))return;let e=n.arguments[0];for(;e;)if(s.isParenthesizedExpression(e)||s.isAsExpression(e)||s.isNonNullExpression(e)||s.isSatisfiesExpression(e))e=e.expression;else if(s.isExpressionWithTypeArguments(e))e=e.expression;else break;return e}export{i as ELEMENT_FACTORIES,o as ELEMENT_FACTORY_PATTERN,x as elementOf,t as factoryCall};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type FontRegistry } from "./fonts.js";
|
|
1
2
|
export declare const WORD_STYLES: readonly ["highlight", "strong", "quiet"];
|
|
2
3
|
export type WordStyleName = (typeof WORD_STYLES)[number];
|
|
3
4
|
export declare const WORD_STYLE_LABELS: Record<WordStyleName, string>;
|
|
@@ -40,14 +41,14 @@ export declare const WORD_STYLE_TEXT_GAP_MIN = -0.1;
|
|
|
40
41
|
export declare const WORD_STYLE_TEXT_GAP_MAX = 0.5;
|
|
41
42
|
export declare const WORD_STYLE_GAP_PRECISION = 3;
|
|
42
43
|
export declare const DEFAULT_WORD_STYLES: Record<WordStyleName, ResolvedWordStyle>;
|
|
43
|
-
export declare function normalizeWordStyle(v?: WordStyleValue | null): ResolvedWordStyle;
|
|
44
|
-
export declare function normalizeWordStyles(v?: Partial<Record<WordStyleName, WordStyleValue | null>> | null): Record<WordStyleName, ResolvedWordStyle>;
|
|
45
|
-
export declare function wordStyleIsDefault(name: WordStyleName, v?: WordStyleValue | null): boolean;
|
|
46
|
-
export declare function wordStyleTokens(v?: Partial<Record<WordStyleName, WordStyleValue | null>> | null): Record<string, string>;
|
|
44
|
+
export declare function normalizeWordStyle(v?: WordStyleValue | null, registry?: FontRegistry): ResolvedWordStyle;
|
|
45
|
+
export declare function normalizeWordStyles(v?: Partial<Record<WordStyleName, WordStyleValue | null>> | null, registry?: FontRegistry): Record<WordStyleName, ResolvedWordStyle>;
|
|
46
|
+
export declare function wordStyleIsDefault(name: WordStyleName, v?: WordStyleValue | null, registry?: FontRegistry): boolean;
|
|
47
|
+
export declare function wordStyleTokens(v?: Partial<Record<WordStyleName, WordStyleValue | null>> | null, registry?: FontRegistry): Record<string, string>;
|
|
47
48
|
export interface WordStylesRow {
|
|
48
49
|
word_styles?: Partial<Record<string, WordStyleValue | null>> | null;
|
|
49
50
|
}
|
|
50
|
-
export declare function wordStylesFromRow(row?: WordStylesRow | null): Record<WordStyleName, ResolvedWordStyle>;
|
|
51
|
-
export declare function wordStylesToRow(v?: Partial<Record<WordStyleName, WordStyleValue | null>> | null): {
|
|
51
|
+
export declare function wordStylesFromRow(row?: WordStylesRow | null, registry?: FontRegistry): Record<WordStyleName, ResolvedWordStyle>;
|
|
52
|
+
export declare function wordStylesToRow(v?: Partial<Record<WordStyleName, WordStyleValue | null>> | null, registry?: FontRegistry): {
|
|
52
53
|
word_styles: Record<WordStyleName, ResolvedWordStyle>;
|
|
53
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{POOL_FONT_REGISTRY as s}from"./fonts.js";const c=["highlight","strong","quiet"],G={highlight:"Highlight",strong:"Bold",quiet:"Quiet"},E={highlight:{kind:"wordHighlight",delimiter:"@@"},strong:{kind:"wordStrong",delimiter:"++"},quiet:{kind:"wordQuiet",delimiter:"^^"}},Y=Object.fromEntries(c.map(t=>[E[t].kind,t])),N="data-sf-ws",T=["accent","text","labels"],g={accent:"var(--accent)",text:"var(--fg)",labels:"var(--fg-dim)"},h=80,O=120,m=100,R=900,L=.5,w=3,y=-.1,W=.5,b=3,u={font:null,size:null,weight:null,bold:null,italic:null,lineGap:null,textGap:null,colour:null},f={highlight:{...u},strong:{...u},quiet:{...u}};function p(t,e,l){return typeof t!="number"||!Number.isFinite(t)?null:Math.round(Math.min(Math.max(t,e),l))}function d(t,e,l){if(typeof t!="number"||!Number.isFinite(t))return null;const o=10**b;return Math.round(Math.min(Math.max(t,e),l)*o)/o}function S(t){return typeof t=="boolean"?t:null}function x(t,e=s){const l=typeof t?.font=="string"&&e.byKey.has(t.font)?t.font:null,o=typeof t?.colour=="string"&&T.includes(t.colour)?t.colour:null;return{font:l,size:p(t?.size,h,O),weight:p(t?.weight,m,R),bold:S(t?.bold),italic:S(t?.italic),lineGap:d(t?.lineGap,L,w),textGap:d(t?.textGap,y,W),colour:o}}function a(t,e=s){const l={};for(const o of c)l[o]=t&&o in t&&t[o]?x(t[o],e):{...f[o]};return l}function I(t,e,l=s){const o=x(e,l),r=f[t];return Object.keys(r).every(n=>o[n]===r[n])}function M(t,e=s){const l=a(t,e),o={};for(const r of c){const n=l[r],i=`--sf-ws-${r}`;if(n.font){const _=e.byKey.get(n.font);_&&(o[`${i}-font`]=`var(${_.cssVar})`)}n.size!==null&&(o[`${i}-size`]=`${n.size/100}em`),n.weight!==null&&(o[`${i}-weight`]=String(n.weight)),n.bold!==null&&(o[`${i}-weight-bold`]=n.bold?"700":"400"),n.italic!==null&&(o[`${i}-style`]=n.italic?"italic":"normal"),n.lineGap!==null&&(o[`${i}-line`]=String(n.lineGap)),n.textGap!==null&&(o[`${i}-track`]=`${n.textGap}em`),n.colour!==null&&(o[`${i}-color`]=g[n.colour])}return o}function A(t,e=s){const l=t?.word_styles??void 0,o={};for(const r of c)l&&r in l&&(o[r]=l[r]??null);return a(o,e)}function $(t,e=s){return{word_styles:a(t,e)}}export{g as COLOUR_TOKEN,f as DEFAULT_WORD_STYLES,c as WORD_STYLES,N as WORD_STYLE_ATTR,Y as WORD_STYLE_BY_KIND,T as WORD_STYLE_COLOURS,b as WORD_STYLE_GAP_PRECISION,G as WORD_STYLE_LABELS,w as WORD_STYLE_LINE_GAP_MAX,L as WORD_STYLE_LINE_GAP_MIN,E as WORD_STYLE_MARKS,O as WORD_STYLE_SIZE_MAX,h as WORD_STYLE_SIZE_MIN,W as WORD_STYLE_TEXT_GAP_MAX,y as WORD_STYLE_TEXT_GAP_MIN,R as WORD_STYLE_WEIGHT_MAX,m as WORD_STYLE_WEIGHT_MIN,x as normalizeWordStyle,a as normalizeWordStyles,I as wordStyleIsDefault,M as wordStyleTokens,A as wordStylesFromRow,$ as wordStylesToRow};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from "react";
|
|
2
|
+
import { type SideSpace } from "../../format/lib/content/page-width.js";
|
|
2
3
|
import type { PadValues } from "../lib/content/section-padding.js";
|
|
3
4
|
import type { PartAttr } from "../../format/lib/content/part-names.js";
|
|
4
5
|
interface BlockFrameProps {
|
|
@@ -17,7 +18,8 @@ export declare const FRAME_BASE = "mx-auto w-full max-w-[var(--sf-site-width,160
|
|
|
17
18
|
export declare const FRAME_GUTTER: "max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]";
|
|
18
19
|
export declare const FRAME: string;
|
|
19
20
|
export declare const FRAME_SITE_GUTTER: "max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]";
|
|
20
|
-
export declare
|
|
21
|
+
export declare const FRAME_NONE_GUTTER: "view-wide:px-0 max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]";
|
|
22
|
+
export declare function frameGutterOf(side: boolean | SideSpace): string;
|
|
21
23
|
export declare const PRE_FRAME_BASE = "mx-auto w-full max-w-[1280px] px-[60px]";
|
|
22
24
|
export declare const PRE_FRAME_GUTTER = "max-[960px]:px-6";
|
|
23
25
|
export declare const PRE_FRAME = "mx-auto w-full max-w-[1280px] px-[60px] max-[960px]:px-6";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as m}from"react/jsx-runtime";import{siteSideRoom as e}from"../../format/lib/content/page-width.js";import E from"./SiteGutterFrame.js";const l="mx-auto w-full max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)]",r=e("box").frame,x=`${l} ${r}`,R=e("site").frame,i=e("none").frame;function M(t){const o=t===!0?"site":t===!1?"box":t;return o==="none"?i:o==="site"?R:r}const u="mx-auto w-full max-w-[1280px] px-[60px]",c="max-[960px]:px-6",$=`${u} ${c}`;function _({contained:t,className:o="",style:s,pad:n,fillWidth:p="w-full",part:a,children:f}){return m(E,{contained:t,framedClass:`${x} ${o}`,fillClass:`${p} ${o}`,columnClass:x,style:s,pad:n,part:a,children:f})}export{x as FRAME,l as FRAME_BASE,r as FRAME_GUTTER,i as FRAME_NONE_GUTTER,R as FRAME_SITE_GUTTER,$ as PRE_FRAME,u as PRE_FRAME_BASE,c as PRE_FRAME_GUTTER,_ as default,M as frameGutterOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as P,jsx as e,jsxs as L}from"react/jsx-runtime";import{useContext as Or,useId as Rr,useState as Ar}from"react";import Pr from"./BoxTabs.js";import{AccordionRowStyleContext as oo,BoxAnchorContext as Lr,BoxTabPaneContext as so,copyAnchorOf as $r,useAccordionRowStyle as yr,useBoxPaneKind as Nr,useCopyAnchors as Er,useFirstCopyOpens as kr,useIsTabPane as Ir}from"./BoxTabPaneContext.js";import Br,{ACCORDION_COUNTER_RESET as gr}from"./BoxAccordionRow.js";import{readAnchorName as Tr}from"../../format/lib/content/anchor-name.js";import{ACCORDION_MARK_SHEET as Fr}from"./AccordionMark.js";import{EDGE_LINE_ATTRS as Hr}from"../../format/lib/content/view-lines.js";import{accordionRowStyleOf as Dr}from"../../format/lib/content/accordion-row-style.js";import{boxPhoneCell as Vr,boxPhoneOrder as Mr}from"../../format/lib/content/box-phone-place.js";import{CellFillContext as Bs,InBoxContext as gs,useCellOfStretchedRow as Wr,useFillsCell as Gr}from"./InBoxContext.js";import Xr,{InsideSiteColumn as Ts,useInsideSiteGutter as jr,useSectionRoot as Kr}from"./SiteGutterFrame.js";import{BoxSurfaceProvider as Ur}from"./BoxSurfaceContext.js";import zr from"./PictureWash.js";import{BoxCellContext as Fs,NoCellBound as Yr}from"./BoxCellContext.js";import{boxCellFractions as Jr}from"../lib/content/box-cell-bound.js";import{boundOf as Zr}from"../../format/lib/content/cell-picture-sizes.js";import{useInSiteHeader as qr}from"./PhoneMenuTools.js";import{useCardRow as Qr}from"./CardRowContext.js";import{cardLineBetween as no,framesItsCards as et}from"../../format/lib/content/card-place.js";import{rowLinkText as ot}from"../../format/lib/content/card-template.js";import{HandedMirrorContext as st,MirrorContext as nt,RowHandContext as Hs,boxPlace as rt,useHandedMirrorAbove as tt,useHandedRows as lt,useMirroredCopy as it,useUnderCardBox as ct}from"./MirrorContext.js";import{boxChildrenHand as at,isMirroredCopy as dt,mirrorCardsActs as Ds,mirrorCardsOf as ut,mirroredBoxClass as mt,MIRROR_ROW_CLASS as ft,ownsCard as ht}from"../../format/lib/content/mirror-cards.js";import{FRAME_BASE as ro,frameGutterOf as Ct}from"./BlockFrame.js";import{BOX_SIDE_SPACE_SITE as bt,boxSideSpaceOf as St}from"../../format/lib/content/box-side-space.js";import{containerGapProps as Vs}from"../../format/lib/content/container-gap.js";import{boxLayoutClasses as pt,boxAlignViewClasses as wt,boxBlockSpacingClass as xt,boxBlockSpacingViewClasses as _t,boxJustifyViewClasses as vt,boxWrapTabletClass as Ot,boxFitContentClass as Rt,boxAccordionColumnsClass as Ms,boxRowColumnsClass as At,boxRowTabletColumnsClass as Pt,boxRowTabletShareClass as Lt,boxPhoneCellsShareLine as $t,boxPhoneRowClasses as ce,boxPhoneRowFits as Ws,boxShareClasses as $,boxShareVars as yt,boxWrapClass as Nt,BOX_GAP_ONLY_CLASS as Et}from"../../format/lib/content/box-layout.js";import{boxSeparatorClasses as kt,boxSeparatorSeamClass as It,boxSeparatorStyle as Bt,isStripBox as gt}from"../../format/lib/content/box-separator.js";import{DEFAULT_LOOP_DELAY as Tt,DEFAULT_LOOP_DIRECTION as Ft,DEFAULT_LOOP_SECONDS as Ht,isVerticalLoop as Dt}from"../../format/lib/animation/index.js";import{LoopTrack as Vt}from"../lib/animation/LoopTrack.js";import{BOX_CARD_PAD as y,BOX_OWNS_SIDES_CLASS as Mt,boxDarkenStyle as Gs,boxPaintOf as Wt,boxFillFadeStyle as Gt,boxFillViews as Xt,boxPlacementClasses as jt,boxCardProps as Kt,boxIsCard as Xs,boxRowPicture as Ut,boxSwatchFill as zt,boxWashViews as Yt,CARD_NO_LIFT_CLASS as Jt,CARD_SHADOW_CLASS as Zt,isBackgroundBox as _e}from"../../format/lib/content/box-background.js";import{BOX_ROW_IMAGE_PROP as x}from"../../format/lib/content/box-card-rule.js";import{boxShadowAttrs as qt,boxShadowOnAnyView as Qt,boxShadowViewAttrs as el}from"../../format/lib/content/box-shadow.js";import{boxRunsEdgeToEdge as ol,drawsSiteGutter as sl}from"../../format/lib/content/site-gutter.js";import{boxShapeClass as nl,boxShapeClasses as rl,boxShapeStyle as tl}from"../../format/lib/content/box-shape.js";import{boxAngleStyle as ll}from"../../format/lib/content/box-angle.js";import{BOX_JUMP_ATTR as il,BOX_LINK_ATTR as js,BOX_LINK_CLASS as Ks,BOX_LINKED_CLASS as cl,boxJumpBlocksClass as al,boxJumpCss as dl,boxJumpSlug as ul,boxLinkOf as ml,siteLinkDraws as fl}from"../../format/lib/content/box-link.js";import{SiteLink as hl}from"../lib/site-runtime.js";import{sectionBorderStyle as Us}from"../../format/lib/content/borders.js";import{finiteNumber as ve}from"../../format/lib/finite-number.js";import{padDefaultIn as N,padSideValue as Oe,sectionPadAttrs as Cl}from"../lib/content/section-padding.js";import{SECTION_FILL_CLASS as Re}from"../../format/lib/content/section-min-height.js";import{ON_MEDIA_INK_STYLE as bl,rowFillInkStyle as Sl}from"../../format/lib/content/ink.js";import{useThemeLightInk as pl}from"./ThemeLightInkContext.js";import{sizedBackground as to}from"../../format/lib/sized-image.js";import{BOX_REVEAL_CLASS as wl,BOX_REVEAL_CSS as xl,BOX_REVEAL_SHEET as _l,PHOTO_HOST_ATTR as vl,resolveImageTreatment as Ol}from"../../format/lib/content/image-treatment.js";import Rl,{HoverArrowsSlot as Al,HoverMediaArrows as Pl}from"./HoverMediaLayer.js";import{HOVER_ARROWS_HOST_ATTR as Ll,HOVER_ARROWS_HOST_CLASS as $l,HOVER_LAYER_GROUND as yl,cardRowHoverMedia as Nl,hoverLayerName as El}from"../../format/lib/content/hover-media.js";import{BOX_HIGHLIGHT_CLASS as kl,BOX_HIGHLIGHT_OVER_ROW_INK_CLASS as Il,BOX_SHOW_ON_CARD_HOVER as Bl}from"../../format/lib/animation/hover.js";import{BoxRail as gl,BoxRailStop as Tl,RAIL_STOPS_CLASS as Fl,useTimelineRail as Hl}from"./TimelineRail.js";import{SHARED_PLAIN_ATTR as Dl,sharedColumnsClasses as Vl,sharedColumnsCss as Ml,sharedRowsClasses as Wl,sharedRowsCss as Gl}from"../lib/content/box-shared-columns.js";import zs from"./PhotoHoverSheet.js";import{PICTURE_FRAME_ONLY as Xl,PictureHoverMoveSheet as jl,PictureHoverZoom as Kl,pictureHoverMoveOf as Ul}from"./PictureHoverMove.js";import{BOX_DESKTOP_LINE as zl,stackGutterClass as Yl,stackLineCss as Jl,stackOuterClass as Zl,stackRowClass as ql,storedStackLine as lo}from"../lib/content/box-stack-line.js";import{partAttr as io}from"../../format/lib/content/part-names.js";import{withSideOnce as Ys}from"../../format/lib/content/page-width.js";import{useSideSpaceOnce as Ql}from"./SideSpaceOnce.js";const co={"--sf-site-gutter":"0px"},ei={overflowX:"clip",overflowY:"visible"},oi={stretchedRow:!1,fillingColumn:!1,columnsRow:!1},Js={desktop:!1,phone:!1},Zs="bg-cover bg-center bg-[image:var(--sf-box-bg)] max-view-wide:bg-[image:var(--sf-box-bg-p)]",ao=m=>m==null||m==="",uo=m=>!ao(m)&&Number(m)===0;function si({children:m}){return e(P,{children:m(Rr())})}function ni({direction:m,label:qs,tabShape:Qs,gap:mo,gapPhone:en,gapTablet:Ae,justify:z,align:E,wrap:ae,share:on,sharePhone:F,shareTablet:H,wrapPhone:sn,orderPhone:nn,phoneRow:C,columns:f,columnsTablet:D,separator:h,stackBelow:de,blockSpacing:fo,bgImage:rn,bgImagePhone:tn,rowImage:ln,hoverShow:cn,pictureHover:V,darken:Pe,darkenStyle:ue,darkenTablet:an,darkenPhone:dn,darkenStyleTablet:un,darkenStylePhone:mn,placement:fn,padV2:ho=!1,border:hn,borderTablet:Cn,borderPhone:bn,borderUnits:Co,pad:t={},contained:Le=!0,fillHeight:_=!1,shadow:$e,shadowTablet:bo,shadowPhone:So,justifyTablet:po,justifyPhone:Sn,alignTablet:pn,alignPhone:wn,wrapTablet:wo,blockSpacingTablet:xn,blockSpacingPhone:_n,loop:b,scrollDirection:ye=Ft,loopSeconds:vn=Ht,loopDelay:On=Tt,editing:k=!1,fillColor:xo,fillColorTablet:Rn,fillColorPhone:An,fillFade:Pn,swatch:Ln,line:v,upcoming:$n,link:yn,rowLink:_o,highlight:Nn,boxShape:Ne,boxShapePhone:vo,boxShapeTablet:Oo,angle:En,jumpHighlight:kn,anchor:Ro,sharedSides:In=Js,sharedRows:Bn=!1,boxId:M,slotCount:gn,mirrorCards:Ao,content:c,rowTitle:Ee,startsOpen:Tn,rowStyle:Fn,sideSpace:Hn}){const n=Qr(),I=Kt({[x]:ln},n!==null)[x],Po=Xs({[x]:I}),d=Po?Js:In,Dn=Po?!1:Bn,Lo=Ut({[x]:I},n?.row),S=Lo??rn,ke=Lo===null?tn:void 0,$o=Or(Fs),[yo,Vn]=Ar(null),Mn=tt(),No=ct()&&!(Mn&&n!==null),O=lt(),u=ht({inCopy:n!==null,nestedCopy:n?.nested===!0,underBox:No}),Ie=cn===Bl&&n!==null&&!u&&!(k&&n.previewHover===!0),Eo=no(hn,n,u),ko=no(Cn,n,u),Io=no(bn,n,u),Bo=n===null&&!No&&O?.ids&&M?O.ids.indexOf(M):-1,me=Bo>=0&&O&&M?rt(O,M,Bo):-1,p=me>=0?O?.hand??null:u&&O?.copies===!0?O.hand:null,o=p?.row?"row":m,a=p?.row?p.row.share:on,Wn=p?.row?p.row.phoneReverse?[...c.blockIds??[]].reverse():void 0:nn,fe=Dn&&!p?.row,W=k?"":_o&&n?ot(n.row,_o)??"":ml(yn),R=_?"":rl(Ne,vo,Oo),Gn=!_&&nl(Ne)!=="",B=ul(kn,Ro),Be=zt({swatch:Ln},n?.row),Y=Be??Wt(xo),g=Be?{className:"",style:{}}:Xt(xo,Rn,An),Xn=pl(),go=Sl(Be,Xn??void 0),jn=_e(S)||_e(ke),Kn=(Y||g.className)&&!jn?Gt(Pn):null,To=Y||g.className?{...Y?{backgroundColor:Y}:{},...g.style,...Kn,...go}:void 0,Fo=Hl(),J=v===!0&&o!=="tabs"&&o!=="accordion",r=Xs({bgImage:S,[x]:I}),Ho=ll(En),Do=r?void 0:To,he=r?null:Nn??null,Vo=_?null:tl(Ne,vo,Oo),Un=Ho||he||Vo?{...Do,...Ho,...he,...Vo}:Do,Ce=qr(),zn=Kr(),Yn=Ir(),Mo=Nr(),Wo=yr(),Jn=kr(),Zn=Er(),l=o==="accordion",ge=Dr(Fn),Z=l&&ge==="numbered",Te=l&&ge==="chevron",Fe=Gr(),Go=Wr(),G=gt(o,h),i=b==="scroll"&&o!=="tabs"&&!l,qn=it(),be=u||me>=0&&p!==null,Xo=p?p.mirror:Ao,Qn=me>=0?me:n?.index,q=u&&et(n?.ownerType),jo=Ds({direction:o,separator:h,loop:b,line:v,bgImage:S,[x]:I,columns:f,columnsTablet:D,share:a,wrap:ae},be,d.desktop)&&dt(Xo,Qn),er=Ds({direction:o,separator:h,loop:b,line:v,bgImage:S,[x]:I,columns:f,columnsTablet:D,share:a,wrap:ae},be,d.desktop)&&ut(Xo)!==null,X=At({direction:o,separator:h,loop:b,line:v,columns:f}),T=Pt({direction:o,separator:h,loop:b,line:v,columnsTablet:D}),Q=Lt({direction:o,separator:h,loop:b,line:v,columns:f,columnsTablet:D,share:a,shareTablet:H}),ee=St(Hn)===bt,He=Ct(ee),Ko=Ql(),Uo=J&&lo(de)===zl,j=o==="row"&&!r&&!G&&!i&&(!J||Uo)&&T===""&&Q===""?lo(de):void 0,K=j??(o==="column"&&!r?lo(de):void 0),or=jr(),Se=Vl(d,c.blockCount??0,j),sr=(Se&&(!n||n.index===0)?Ml(d,c.blockCount??0,j):"")+(fe&&(!n||n.index===0)?Gl(fe,c.blockCount??0):""),zo=Wl(fe,c.blockCount??0),Yo=T!==""?Number(D)>=2:Q===""||$(H)!=="",Jo=T!==""||Q!=="",De=o==="row"&&!G&&!i&&v!==!0,Ve=De&&!d.phone&&!d.desktop?Vr(Mr(Wn,c.blockIds??[]),{editing:k}):void 0,Zo=Ve!==void 0&&!k,nr=X!==""?Number(f)>=2:$(a)!=="",qo=!r&&!l&&!er&&!d.desktop&&!d.phone,pe=qo&&!i?vt(z,po,Sn):"",Me=r||be?"":mt(qn,o,i?void 0:z,E,pe?po:void 0),rr=/view-wide:max-view-desktop:justify-/.test(Me)?pe.split(" ").filter(s=>!s.startsWith("view-wide:max-view-desktop:justify-")).join(" "):pe,tr=qo&&o==="row"?wt(E,pn,wn):"",Qo=Go&&o==="column"&&!r&&!i&&!l,We=typeof z=="string"&&z!=="start"||pe!=="",es=Qo&&We&&$(a)!=="",os=Qo&&!We&&$(a)!==""&&(c.blockCount??0)===1,lr=!i&&!l&&X===""&&T===""&&!d.desktop?Ot(ae,wo):"",ss=[l||es?"":$(a),o==="row"?Rt(a):"",X,T,Q,xt(l?"gap":fo),kt(o,h),l&&!Z&&!Te?"border-t border-line":"",rr,tr,lr,l?"":_t(fo,xn,_n),l?Ms(f,C,Z||Te):"",Z?gr:""].filter(Boolean).join(" "),ir=ss?` ${ss}`:"",ns=["flex",o==="row"?G||i?"flex-row":`flex-row ${ce(C,F,sn,wo)}`:"flex-col",Nt(i||l?!1:ae),r?jt(fn??"center",o):pt(i||l?void 0:z,l?void 0:E)+(Me?` ${Me}`:"")].join(" ")+ir,oe=_||r||R||Fe?` ${Re}`:"",Ge=Gn?` ${R}`:R?`${oe} ${R}`:oe,rs=Go&&o==="column"&&!r&&!i&&$(a)===""&&We||es,ts=oe||(rs||os?` ${Re}`:""),Xe=W?` ${cl}`:"",je=r||Ce||ho?"":" py-6",cr=j===void 0?"":` ${ql(j)}`,ls=K===void 0||ee?"":` ${Yl(K)}`,Ke=K===void 0?"":` ${Zl(K)}`,ar=`${ro}${je} ${He}${Ge}${Xe}${ls}${Ke}`,dr=Ce?`${Ge}${Xe}${Ke}`.trim():`w-full${je}${Ge}${Xe}${Ke}`,se=(Z||Te)&&Ms(f,C)===""?Vs("Flex",0,"block"):Vs("Flex",mo,o==="row"?"inline":"block",en,G||i?void 0:Ae),is=yt(a,H,o==="row"?c.blockCount??0:0),cs=G?{...se.style,...Bt(o,h)}:se.style,ur=is?{...cs,...is}:cs,Ue=(s="")=>e(c,{className:`${ns}${jo?` ${ft}`:""}${se.className}${ts}${cr}${s?` ${s}`:""}${J?` ${Fl}`:""}${B?` ${al(B)}`:""}${Se}${zo}`,style:ur,minEmptyHeight:120,...Ve?{cell:Ve}:null}),as=Dt(ye)?"":It(o,h),ds=i?e(Vt,{direction:ye,seconds:vn,delay:On,editing:k,copy:s=>Ue(s&&as?`${s} ${as}`:s)}):Z?L(P,{children:[e("style",{children:Fr}),Ue()]}):Ue(),ze=o==="tabs"?e(Pr,{className:`${ns}${se.className}${Fe&&!_&&!r&&!R?"":oe}`,style:se.style,shape:Qs,children:ds}):ds,Ye=l?e(so.Provider,{value:"accordion",children:e(oo.Provider,{value:ge,children:ze})}):Mo?e(so.Provider,{value:!1,children:e(oo.Provider,{value:"plain",children:ze})}):ze,us=o==="row"&&!r&&(E===void 0||E==="stretch"),mr={stretchedRow:us,fillingColumn:o==="column"&&(Fe||rs),columnsRow:X!==""||T!==""||Se!==""||zo!==""||o==="row"&&(Array.isArray(a)||Array.isArray(H))||Zo,...Zo?{phoneCells:!0}:null,...us&&De&&(c.blockCount??0)>=2&&nr||os?{picturesFillRow:!0}:null,...Jo&&!Yo?{fillFrom:"desktop"}:null,...$t(C,F)&&(!Jo||Yo)?{phoneRowFills:!0}:null,...De&&Ws(C,F)?{phoneRowFits:!0}:null,...i?{loops:!0}:null,...M?{id:M}:null},ms=n===null?at({direction:o,loop:b,bgImage:S,[x]:I,columns:f,mirrorCards:Ao},!1):null,fs=ms?e(Hs.Provider,{value:{hand:ms,ids:c.blockIds??[],boxes:[]},children:Ye}):O?e(Hs.Provider,{value:null,children:Ye}):Ye,hs=Tr(Ro),Cs=e(gs.Provider,{value:mr,children:e(Bs.Provider,{value:!1,children:be?e(nt.Provider,{value:jo,children:e(st.Provider,{value:!u,children:fs})}):fs})}),bs=hs?e(Lr.Provider,{value:hs,children:Cs}):Cs,fr=Ee?.blockCount??0,Ss=Mo==="accordion"&&!!Ee&&(k||fr>0)?e(Br,{startsOpen:Tn===!0||Jn&&u&&n?.index===0,editing:k,numbered:Wo==="numbered",chevron:Wo==="chevron",anchor:u?$r(Zn,n):void 0,title:e(gs.Provider,{value:oi,children:e(Bs.Provider,{value:!1,children:e(so.Provider,{value:!1,children:e(oo.Provider,{value:"plain",children:e(Ee,{className:`min-w-0 flex-1 ${Et}`,minEmptyHeight:24})})})})}),children:bs}):bs,Je=J?e(gl,{row:o==="row",stops:c.blockCount??0,desktopLine:j!==void 0&&Uo,children:Ss}):Ss,hr=qs?.trim()||(Yn?"":void 0),Cr={values:t,frame:je?24:0},br=s=>Fo?e(Tl,{on:Fo,future:$n===!0,children:s}):s,Sr=s=>fl(W)?e(hl,{href:W,newTab:"auto",className:Ks,"aria-labelledby":s,[js]:""}):e("a",{href:W,className:Ks,"aria-labelledby":s,[js]:""}),ps=(B?dl(B):"")+sr+(K===void 0||n&&n.index!==0?"":Jl(K,{gutter:!ee})),ws=ps?e("style",{dangerouslySetInnerHTML:{__html:ps}}):null,ne=ol({loop:b,direction:o,scrollDirection:ye,bgImage:S,[x]:I}),pr=d.desktop&&Se!==""&&!Y&&!g.className&&!Us(Eo,Io,ko,Co)&&!Qt($e,bo,So)&&!W&&!R&&!_&&!B&&!sl(Le&&!ne,or)&&uo(mo)&&(ao(Ae)||uo(Ae))&&ho&&Object.values(t).every(s=>ao(s)||uo(s)),wr=s=>({...Hr,...pr?{[Dl]:""}:null,...r?null:{...qt($e),...el($e,bo,So)},...B?{[il]:B}:null,...s?{id:s}:null}),xs=X!==""?Number(f):0,xr=ce(C,F)===ce(void 0),_r=(o==="column"||o==="row"&&!G&&!i&&(xs===1&&xr||xs===0&&c.blockCount===1))&&!r&&!J&&!Ce,_s=r&&zn&&!Ce,we=!r&&n!==null?Gs(Pe,ue):null,vs=Ie||we?L(P,{children:[Ie?e(zs,{sheet:xl,name:_l}):null,we?e("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 -z-10 rounded-[inherit]",style:we}):null]}):null,Os=[Ie?wl:"",we?"relative isolate":""].filter(Boolean).join(" "),Rs=s=>vs?L(P,{children:[vs,s]}):s,As=(s,A)=>br(e(Xr,{contained:Le&&!ne,style:ne?co:void 0,framedClass:ar,fillClass:dr,columnClass:`${ro} ${He}${ts}${ls}`,tabLabel:hr,pad:r?void 0:Cr,border:Us(Eo,Io,ko,Co),outerAttrs:wr(A),box:!0,edge:_r,outerStyle:Un,outerClass:r?Os||void 0:[g.className,he?kl:"",he&&go?Il:"",Os].filter(Boolean).join(" ")||void 0,bleed:_s,siteSide:ee,part:io("box"),children:ws||A?L(P,{children:[ws,A?Sr(A):null,ne?e(Ts,{children:s}):s]}):ne?e(Ts,{children:s}):s})),Ze=s=>W?e(si,{children:A=>As(Rs(s),A)}):As(Rs(s)),Ps=s=>$o.bound?e(Yr,{children:s}):s;if(!r){const s=E===void 0||E==="stretch",A=($(a)!==""||X!==""||T!=="")&&!Ws(C,F)&&!(Q!==""&&$(H)==="")&&(s||ce(C)!==ce(void 0));if(!(o==="row"?A:o==="column"&&s))return Ze(Ps(Je));const Is=Jr({direction:o,separator:h,loop:b,line:v,share:a,shareTablet:H,sharePhone:F,phoneRow:C,columns:f,columnsTablet:D,stackBelow:de,shared:d.desktop||d.phone||fe,count:gn}),vr={hasWidth:!0,...Is?{bound:Zr(Is,$o.bound)}:null};return Ze(e(Fs.Provider,{value:vr,children:Je}))}const re=_e(S),te=re?Gs(Pe,ue):null,xe=re?Yt({darken:Pe,darkenStyle:ue,darkenTablet:an,darkenStyleTablet:un,darkenPhone:dn,darkenStylePhone:mn}):{className:"",style:{}},qe=_e(ke),Ls=re?qe?{"--sf-box-bg":to(S??""),"--sf-box-bg-p":to(ke??"")}:{backgroundImage:to(S??""),backgroundSize:"cover",backgroundPosition:"center"}:{},$s=Ol(void 0,void 0,V),U=$s.className?$s:null,le=re&&n&&V?.kind==="nextImage"&&V.media?Nl(n,V.media):null,w=re?Ul(V,ue)??(le?Xl:null):null,ys=V?.media?.cover??"picture",Qe=le?e("div",{className:`absolute inset-0 isolate${q?" rounded-[inherit]":""}`,children:e(Al.Provider,{value:Vn,children:e(Rl,{media:le,name:El(n?.row),cover:ys,ground:yl[ys],arrowsAbove:!0})})}):null,ie=U!==null||!!w?.zoom,Ns=ie?e("div",{"aria-hidden":!0,className:`absolute inset-0${q?" rounded-[inherit]":""}${qe?` ${Zs}`:""}${U?` ${U.className}`:""}`,style:{...Ls,...U?.style??{}}}):null,eo=Cl({...t,top:ve(t.top)??N(y.desktop,t.unit,"desktop"),bottom:ve(t.bottom)??N(y.desktop,t.unit,"desktop"),topPhone:ve(t.topPhone)??N(y.phone,t.unitPhone,"mobile"),bottomPhone:ve(t.bottomPhone)??N(y.phone,t.unitPhone,"mobile"),left:Oe(t.left)??N(y.side,t.unit,"desktop"),right:Oe(t.right)??N(y.side,t.unit,"desktop"),leftPhone:Oe(t.leftPhone)??N(y.sidePhone,t.unitPhone,"mobile"),rightPhone:Oe(t.rightPhone)??N(y.sidePhone,t.unitPhone,"mobile"),sideSpace:ee?"site":"box"}),Es=e("div",{className:`relative z-[1] ${Mt} ${Ys(eo?.className??"",Ko)}${_||R?` ${Re}`:""}`.trimEnd(),style:te?{...eo?.style,...co,...bl}:{...eo?.style,...co},...io("card-content"),children:Ps(Je)}),ks=_s&&Le?e("div",{className:Ys(`${ro} ${He}${_||R?` ${Re}`:""}`,Ko),children:Es}):Es;return Ze(e(P,{children:L("div",{className:`relative isolate overflow-hidden ${Zt}${n!==null&&!u?` ${Jt}`:""}${oe}${qe&&!ie?` ${Zs}`:""}${g.className?` ${g.className}`:""}${w?` ${w.className}`:""}`,style:{...q?ei:{},...To,...ie?{}:Ls,...w?w.style:{}},...U||le?{[vl]:""}:{},...io("card"),children:[e(jl,{move:w}),ie&&L(P,{children:[e(zs,{sheet:U?.sheet}),w?.zoom?e("div",{className:`absolute inset-0 overflow-hidden${q?" rounded-[inherit]":""}`,children:L(Kl,{move:w,className:"absolute inset-0",children:[Ns,Qe]})}):L(P,{children:[Ns,Qe]})]}),!ie&&Qe,e(zr,{wash:te&&xe.className?{...te,...xe.style}:te,hover:w?.washHover,...q?{className:"rounded-[inherit]"}:{},...xe.className?{restClassName:xe.className}:{}}),te?e(Ur,{children:ks}):ks,le?e("div",{[Ll]:"",className:$l,children:yo?e(Pl,{state:yo}):null}):null]})}))}export{ni as default};
|
|
1
|
+
import{Fragment as P,jsx as e,jsxs as L}from"react/jsx-runtime";import{useContext as Rr,useId as Ar,useState as Pr}from"react";import Lr from"./BoxTabs.js";import{AccordionRowStyleContext as so,BoxAnchorContext as $r,BoxTabPaneContext as no,copyAnchorOf as yr,useAccordionRowStyle as Nr,useBoxPaneKind as Er,useCopyAnchors as kr,useFirstCopyOpens as Ir,useIsTabPane as Br}from"./BoxTabPaneContext.js";import gr,{ACCORDION_COUNTER_RESET as Tr}from"./BoxAccordionRow.js";import{readAnchorName as Fr}from"../../format/lib/content/anchor-name.js";import{ACCORDION_MARK_SHEET as Hr}from"./AccordionMark.js";import{EDGE_LINE_ATTRS as Dr}from"../../format/lib/content/view-lines.js";import{accordionRowStyleOf as Vr}from"../../format/lib/content/accordion-row-style.js";import{boxPhoneCell as Mr,boxPhoneOrder as Wr}from"../../format/lib/content/box-phone-place.js";import{CellFillContext as gs,InBoxContext as Ts,useCellOfStretchedRow as Gr,useFillsCell as Xr}from"./InBoxContext.js";import jr,{InsideSiteColumn as Fs,useInsideSiteGutter as Kr,useSectionRoot as Ur}from"./SiteGutterFrame.js";import{BoxSurfaceProvider as zr}from"./BoxSurfaceContext.js";import Yr from"./PictureWash.js";import{BoxCellContext as Hs,NoCellBound as Jr}from"./BoxCellContext.js";import{boxCellFractions as Zr}from"../lib/content/box-cell-bound.js";import{boundOf as qr}from"../../format/lib/content/cell-picture-sizes.js";import{useInSiteHeader as Qr}from"./PhoneMenuTools.js";import{useCardRow as et}from"./CardRowContext.js";import{cardLineBetween as ro,framesItsCards as ot}from"../../format/lib/content/card-place.js";import{rowLinkText as st}from"../../format/lib/content/card-template.js";import{HandedMirrorContext as nt,MirrorContext as rt,RowHandContext as Ds,boxPlace as tt,useHandedMirrorAbove as lt,useHandedRows as it,useMirroredCopy as ct,useUnderCardBox as at}from"./MirrorContext.js";import{boxChildrenHand as dt,isMirroredCopy as ut,mirrorCardsActs as Vs,mirrorCardsOf as mt,mirroredBoxClass as ft,MIRROR_ROW_CLASS as ht,ownsCard as Ct}from"../../format/lib/content/mirror-cards.js";import{FRAME_BASE as to,frameGutterOf as bt}from"./BlockFrame.js";import{BOX_SIDE_SPACE_NONE as St,boxSideSpaceOf as pt}from"../../format/lib/content/box-side-space.js";import{containerGapProps as Ms}from"../../format/lib/content/container-gap.js";import{boxLayoutClasses as wt,boxAlignViewClasses as xt,boxBlockSpacingClass as _t,boxBlockSpacingViewClasses as vt,boxJustifyViewClasses as Ot,boxWrapTabletClass as Rt,boxFitContentClass as At,boxAccordionColumnsClass as Ws,boxRowColumnsClass as Pt,boxRowTabletColumnsClass as Lt,boxRowTabletShareClass as $t,boxPhoneCellsShareLine as yt,boxPhoneRowClasses as ie,boxPhoneRowFits as Gs,boxShareClasses as $,boxShareVars as Nt,boxWrapClass as Et,BOX_GAP_ONLY_CLASS as kt}from"../../format/lib/content/box-layout.js";import{boxSeparatorClasses as It,boxSeparatorSeamClass as Bt,boxSeparatorStyle as gt,isStripBox as Tt}from"../../format/lib/content/box-separator.js";import{DEFAULT_LOOP_DELAY as Ft,DEFAULT_LOOP_DIRECTION as Ht,DEFAULT_LOOP_SECONDS as Dt,isVerticalLoop as Vt}from"../../format/lib/animation/index.js";import{LoopTrack as Mt}from"../lib/animation/LoopTrack.js";import{BOX_CARD_PAD as y,BOX_OWNS_SIDES_CLASS as Wt,boxDarkenStyle as Xs,boxPaintOf as Gt,boxFillFadeStyle as Xt,boxFillViews as jt,boxPlacementClasses as Kt,boxCardProps as Ut,boxIsCard as js,boxRowPicture as zt,boxSwatchFill as Yt,boxWashViews as Jt,CARD_NO_LIFT_CLASS as Zt,CARD_SHADOW_CLASS as qt,isBackgroundBox as _e}from"../../format/lib/content/box-background.js";import{BOX_ROW_IMAGE_PROP as x}from"../../format/lib/content/box-card-rule.js";import{boxShadowAttrs as Qt,boxShadowOnAnyView as el,boxShadowViewAttrs as ol}from"../../format/lib/content/box-shadow.js";import{boxRunsEdgeToEdge as sl,drawsSiteGutter as nl}from"../../format/lib/content/site-gutter.js";import{boxShapeClass as rl,boxShapeClasses as tl,boxShapeStyle as ll}from"../../format/lib/content/box-shape.js";import{boxAngleStyle as il}from"../../format/lib/content/box-angle.js";import{BOX_JUMP_ATTR as cl,BOX_LINK_ATTR as Ks,BOX_LINK_CLASS as Us,BOX_LINKED_CLASS as al,boxJumpBlocksClass as dl,boxJumpCss as ul,boxJumpSlug as ml,boxLinkOf as fl,siteLinkDraws as hl}from"../../format/lib/content/box-link.js";import{SiteLink as Cl}from"../lib/site-runtime.js";import{sectionBorderStyle as zs}from"../../format/lib/content/borders.js";import{finiteNumber as ve}from"../../format/lib/finite-number.js";import{padDefaultIn as N,padSideValue as Oe,sectionPadAttrs as bl}from"../lib/content/section-padding.js";import{SECTION_FILL_CLASS as Re}from"../../format/lib/content/section-min-height.js";import{ON_MEDIA_INK_STYLE as Sl,rowFillInkStyle as pl}from"../../format/lib/content/ink.js";import{useThemeLightInk as wl}from"./ThemeLightInkContext.js";import{sizedBackground as lo}from"../../format/lib/sized-image.js";import{BOX_REVEAL_CLASS as xl,BOX_REVEAL_CSS as _l,BOX_REVEAL_SHEET as vl,PHOTO_HOST_ATTR as Ol,resolveImageTreatment as Rl}from"../../format/lib/content/image-treatment.js";import Al,{HoverArrowsSlot as Pl,HoverMediaArrows as Ll}from"./HoverMediaLayer.js";import{HOVER_ARROWS_HOST_ATTR as $l,HOVER_ARROWS_HOST_CLASS as yl,HOVER_LAYER_GROUND as Nl,cardRowHoverMedia as El,hoverLayerName as kl}from"../../format/lib/content/hover-media.js";import{BOX_HIGHLIGHT_CLASS as Il,BOX_HIGHLIGHT_OVER_ROW_INK_CLASS as Bl,BOX_SHOW_ON_CARD_HOVER as gl}from"../../format/lib/animation/hover.js";import{BoxRail as Tl,BoxRailStop as Fl,RAIL_STOPS_CLASS as Hl,useTimelineRail as Dl}from"./TimelineRail.js";import{SHARED_PLAIN_ATTR as Vl,sharedColumnsClasses as Ml,sharedColumnsCss as Wl,sharedRowsClasses as Gl,sharedRowsCss as Xl}from"../lib/content/box-shared-columns.js";import Ys from"./PhotoHoverSheet.js";import{PICTURE_FRAME_ONLY as jl,PictureHoverMoveSheet as Kl,PictureHoverZoom as Ul,pictureHoverMoveOf as zl}from"./PictureHoverMove.js";import{BOX_DESKTOP_LINE as Yl,stackGutterClass as Jl,stackLineCss as Zl,stackOuterClass as ql,stackRowClass as Ql,storedStackLine as io}from"../lib/content/box-stack-line.js";import{partAttr as co}from"../../format/lib/content/part-names.js";import{withSideOnce as Js}from"../../format/lib/content/page-width.js";import{useSideSpaceOnce as ei}from"./SideSpaceOnce.js";const ao={"--sf-site-gutter":"0px"},oi={overflowX:"clip",overflowY:"visible"},si={stretchedRow:!1,fillingColumn:!1,columnsRow:!1},Zs={desktop:!1,phone:!1},qs="bg-cover bg-center bg-[image:var(--sf-box-bg)] max-view-wide:bg-[image:var(--sf-box-bg-p)]",uo=m=>m==null||m==="",mo=m=>!uo(m)&&Number(m)===0;function ni({children:m}){return e(P,{children:m(Ar())})}function ri({direction:m,label:Qs,tabShape:en,gap:fo,gapPhone:on,gapTablet:Ae,justify:z,align:E,wrap:ce,share:sn,sharePhone:F,shareTablet:H,wrapPhone:nn,orderPhone:rn,phoneRow:C,columns:f,columnsTablet:D,separator:h,stackBelow:ae,blockSpacing:ho,bgImage:tn,bgImagePhone:ln,rowImage:cn,hoverShow:an,pictureHover:V,darken:Pe,darkenStyle:de,darkenTablet:dn,darkenPhone:un,darkenStyleTablet:mn,darkenStylePhone:fn,placement:hn,padV2:Co=!1,border:Cn,borderTablet:bn,borderPhone:Sn,borderUnits:bo,pad:t={},contained:Le=!0,fillHeight:_=!1,shadow:$e,shadowTablet:So,shadowPhone:po,justifyTablet:wo,justifyPhone:pn,alignTablet:wn,alignPhone:xn,wrapTablet:xo,blockSpacingTablet:_n,blockSpacingPhone:vn,loop:b,scrollDirection:ye=Ht,loopSeconds:On=Dt,loopDelay:Rn=Ft,editing:k=!1,fillColor:_o,fillColorTablet:An,fillColorPhone:Pn,fillFade:Ln,swatch:$n,line:v,upcoming:yn,link:Nn,rowLink:vo,highlight:En,boxShape:Ne,boxShapePhone:Oo,boxShapeTablet:Ro,angle:kn,jumpHighlight:In,anchor:Ao,sharedSides:Bn=Zs,sharedRows:gn=!1,boxId:M,slotCount:Tn,mirrorCards:Po,content:c,rowTitle:Ee,startsOpen:Fn,rowStyle:Hn,sideSpace:Dn}){const n=et(),I=Ut({[x]:cn},n!==null)[x],Lo=js({[x]:I}),d=Lo?Zs:Bn,Vn=Lo?!1:gn,$o=zt({[x]:I},n?.row),S=$o??tn,ke=$o===null?ln:void 0,yo=Rr(Hs),[No,Mn]=Pr(null),Wn=lt(),Eo=at()&&!(Wn&&n!==null),O=it(),u=Ct({inCopy:n!==null,nestedCopy:n?.nested===!0,underBox:Eo}),Ie=an===gl&&n!==null&&!u&&!(k&&n.previewHover===!0),ko=ro(Cn,n,u),Io=ro(bn,n,u),Bo=ro(Sn,n,u),go=n===null&&!Eo&&O?.ids&&M?O.ids.indexOf(M):-1,ue=go>=0&&O&&M?tt(O,M,go):-1,p=ue>=0?O?.hand??null:u&&O?.copies===!0?O.hand:null,o=p?.row?"row":m,a=p?.row?p.row.share:sn,Gn=p?.row?p.row.phoneReverse?[...c.blockIds??[]].reverse():void 0:rn,me=Vn&&!p?.row,W=k?"":vo&&n?st(n.row,vo)??"":fl(Nn),R=_?"":tl(Ne,Oo,Ro),Xn=!_&&rl(Ne)!=="",B=ml(In,Ao),Be=Yt({swatch:$n},n?.row),Y=Be??Gt(_o),g=Be?{className:"",style:{}}:jt(_o,An,Pn),jn=wl(),To=pl(Be,jn??void 0),Kn=_e(S)||_e(ke),Un=(Y||g.className)&&!Kn?Xt(Ln):null,Fo=Y||g.className?{...Y?{backgroundColor:Y}:{},...g.style,...Un,...To}:void 0,Ho=Dl(),J=v===!0&&o!=="tabs"&&o!=="accordion",r=js({bgImage:S,[x]:I}),Do=il(kn),Vo=r?void 0:Fo,fe=r?null:En??null,Mo=_?null:ll(Ne,Oo,Ro),zn=Do||fe||Mo?{...Vo,...Do,...fe,...Mo}:Vo,he=Qr(),Yn=Ur(),Jn=Br(),Wo=Er(),Go=Nr(),Zn=Ir(),qn=kr(),l=o==="accordion",ge=Vr(Hn),Z=l&&ge==="numbered",Te=l&&ge==="chevron",Fe=Xr(),Xo=Gr(),G=Tt(o,h),i=b==="scroll"&&o!=="tabs"&&!l,Qn=ct(),Ce=u||ue>=0&&p!==null,jo=p?p.mirror:Po,er=ue>=0?ue:n?.index,q=u&&ot(n?.ownerType),Ko=Vs({direction:o,separator:h,loop:b,line:v,bgImage:S,[x]:I,columns:f,columnsTablet:D,share:a,wrap:ce},Ce,d.desktop)&&ut(jo,er),or=Vs({direction:o,separator:h,loop:b,line:v,bgImage:S,[x]:I,columns:f,columnsTablet:D,share:a,wrap:ce},Ce,d.desktop)&&mt(jo)!==null,X=Pt({direction:o,separator:h,loop:b,line:v,columns:f}),T=Lt({direction:o,separator:h,loop:b,line:v,columnsTablet:D}),Q=$t({direction:o,separator:h,loop:b,line:v,columns:f,columnsTablet:D,share:a,shareTablet:H}),be=pt(Dn),He=be!=="box",De=bt(be),Uo=ei(),zo=J&&io(ae)===Yl,j=o==="row"&&!r&&!G&&!i&&(!J||zo)&&T===""&&Q===""?io(ae):void 0,K=j??(o==="column"&&!r?io(ae):void 0),sr=Kr(),Se=Ml(d,c.blockCount??0,j),nr=(Se&&(!n||n.index===0)?Wl(d,c.blockCount??0,j):"")+(me&&(!n||n.index===0)?Xl(me,c.blockCount??0):""),Yo=Gl(me,c.blockCount??0),Jo=T!==""?Number(D)>=2:Q===""||$(H)!=="",Zo=T!==""||Q!=="",Ve=o==="row"&&!G&&!i&&v!==!0,Me=Ve&&!d.phone&&!d.desktop?Mr(Wr(Gn,c.blockIds??[]),{editing:k}):void 0,qo=Me!==void 0&&!k,rr=X!==""?Number(f)>=2:$(a)!=="",Qo=!r&&!l&&!or&&!d.desktop&&!d.phone,pe=Qo&&!i?Ot(z,wo,pn):"",We=r||Ce?"":ft(Qn,o,i?void 0:z,E,pe?wo:void 0),tr=/view-wide:max-view-desktop:justify-/.test(We)?pe.split(" ").filter(s=>!s.startsWith("view-wide:max-view-desktop:justify-")).join(" "):pe,lr=Qo&&o==="row"?xt(E,wn,xn):"",es=Xo&&o==="column"&&!r&&!i&&!l,Ge=typeof z=="string"&&z!=="start"||pe!=="",os=es&&Ge&&$(a)!=="",ss=es&&!Ge&&$(a)!==""&&(c.blockCount??0)===1,ir=!i&&!l&&X===""&&T===""&&!d.desktop?Rt(ce,xo):"",ns=[l||os?"":$(a),o==="row"?At(a):"",X,T,Q,_t(l?"gap":ho),It(o,h),l&&!Z&&!Te?"border-t border-line":"",tr,lr,ir,l?"":vt(ho,_n,vn),l?Ws(f,C,Z||Te):"",Z?Tr:""].filter(Boolean).join(" "),cr=ns?` ${ns}`:"",rs=["flex",o==="row"?G||i?"flex-row":`flex-row ${ie(C,F,nn,xo)}`:"flex-col",Et(i||l?!1:ce),r?Kt(hn??"center",o):wt(i||l?void 0:z,l?void 0:E)+(We?` ${We}`:"")].join(" ")+cr,ee=_||r||R||Fe?` ${Re}`:"",Xe=Xn?` ${R}`:R?`${ee} ${R}`:ee,ts=Xo&&o==="column"&&!r&&!i&&$(a)===""&&Ge||os,ls=ee||(ts||ss?` ${Re}`:""),je=W?` ${al}`:"",Ke=r||he||Co?"":" py-6",ar=j===void 0?"":` ${Ql(j)}`,is=K===void 0||He?"":` ${Jl(K)}`,Ue=K===void 0?"":` ${ql(K)}`,dr=`${to}${Ke} ${De}${Xe}${je}${is}${Ue}`,ur=he?`${Xe}${je}${Ue}`.trim():`w-full${Ke}${Xe}${je}${Ue}`,oe=(Z||Te)&&Ws(f,C)===""?Ms("Flex",0,"block"):Ms("Flex",fo,o==="row"?"inline":"block",on,G||i?void 0:Ae),cs=Nt(a,H,o==="row"?c.blockCount??0:0),as=G?{...oe.style,...gt(o,h)}:oe.style,mr=cs?{...as,...cs}:as,ze=(s="")=>e(c,{className:`${rs}${Ko?` ${ht}`:""}${oe.className}${ls}${ar}${s?` ${s}`:""}${J?` ${Hl}`:""}${B?` ${dl(B)}`:""}${Se}${Yo}`,style:mr,minEmptyHeight:120,...Me?{cell:Me}:null}),ds=Vt(ye)?"":Bt(o,h),us=i?e(Mt,{direction:ye,seconds:On,delay:Rn,editing:k,copy:s=>ze(s&&ds?`${s} ${ds}`:s)}):Z?L(P,{children:[e("style",{children:Hr}),ze()]}):ze(),Ye=o==="tabs"?e(Lr,{className:`${rs}${oe.className}${Fe&&!_&&!r&&!R?"":ee}`,style:oe.style,shape:en,children:us}):us,Je=l?e(no.Provider,{value:"accordion",children:e(so.Provider,{value:ge,children:Ye})}):Wo?e(no.Provider,{value:!1,children:e(so.Provider,{value:"plain",children:Ye})}):Ye,ms=o==="row"&&!r&&(E===void 0||E==="stretch"),fr={stretchedRow:ms,fillingColumn:o==="column"&&(Fe||ts),columnsRow:X!==""||T!==""||Se!==""||Yo!==""||o==="row"&&(Array.isArray(a)||Array.isArray(H))||qo,...qo?{phoneCells:!0}:null,...ms&&Ve&&(c.blockCount??0)>=2&&rr||ss?{picturesFillRow:!0}:null,...Zo&&!Jo?{fillFrom:"desktop"}:null,...yt(C,F)&&(!Zo||Jo)?{phoneRowFills:!0}:null,...Ve&&Gs(C,F)?{phoneRowFits:!0}:null,...i?{loops:!0}:null,...M?{id:M}:null},fs=n===null?dt({direction:o,loop:b,bgImage:S,[x]:I,columns:f,mirrorCards:Po},!1):null,hs=fs?e(Ds.Provider,{value:{hand:fs,ids:c.blockIds??[],boxes:[]},children:Je}):O?e(Ds.Provider,{value:null,children:Je}):Je,Cs=Fr(Ao),bs=e(Ts.Provider,{value:fr,children:e(gs.Provider,{value:!1,children:Ce?e(rt.Provider,{value:Ko,children:e(nt.Provider,{value:!u,children:hs})}):hs})}),Ss=Cs?e($r.Provider,{value:Cs,children:bs}):bs,hr=Ee?.blockCount??0,ps=Wo==="accordion"&&!!Ee&&(k||hr>0)?e(gr,{startsOpen:Fn===!0||Zn&&u&&n?.index===0,editing:k,numbered:Go==="numbered",chevron:Go==="chevron",anchor:u?yr(qn,n):void 0,title:e(Ts.Provider,{value:si,children:e(gs.Provider,{value:!1,children:e(no.Provider,{value:!1,children:e(so.Provider,{value:"plain",children:e(Ee,{className:`min-w-0 flex-1 ${kt}`,minEmptyHeight:24})})})})}),children:Ss}):Ss,Ze=J?e(Tl,{row:o==="row",stops:c.blockCount??0,desktopLine:j!==void 0&&zo,children:ps}):ps,Cr=Qs?.trim()||(Jn?"":void 0),br={values:t,frame:Ke?24:0},Sr=s=>Ho?e(Fl,{on:Ho,future:yn===!0,children:s}):s,pr=s=>hl(W)?e(Cl,{href:W,newTab:"auto",className:Us,"aria-labelledby":s,[Ks]:""}):e("a",{href:W,className:Us,"aria-labelledby":s,[Ks]:""}),ws=(B?ul(B):"")+nr+(K===void 0||n&&n.index!==0?"":Zl(K,{gutter:!He})),xs=ws?e("style",{dangerouslySetInnerHTML:{__html:ws}}):null,se=sl({loop:b,direction:o,scrollDirection:ye,bgImage:S,[x]:I}),wr=d.desktop&&Se!==""&&!Y&&!g.className&&!zs(ko,Bo,Io,bo)&&!el($e,So,po)&&!W&&!R&&!_&&!B&&!nl(Le&&!se,sr)&&mo(fo)&&(uo(Ae)||mo(Ae))&&Co&&Object.values(t).every(s=>uo(s)||mo(s)),xr=s=>({...Dr,...wr?{[Vl]:""}:null,...r?null:{...Qt($e),...ol($e,So,po)},...B?{[cl]:B}:null,...s?{id:s}:null}),_s=X!==""?Number(f):0,_r=ie(C,F)===ie(void 0),vr=(o==="column"||o==="row"&&!G&&!i&&(_s===1&&_r||_s===0&&c.blockCount===1))&&!r&&!J&&!he,vs=r&&Yn&&!he,we=!r&&n!==null?Xs(Pe,de):null,Os=Ie||we?L(P,{children:[Ie?e(Ys,{sheet:_l,name:vl}):null,we?e("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 -z-10 rounded-[inherit]",style:we}):null]}):null,Rs=[Ie?xl:"",we?"relative isolate":""].filter(Boolean).join(" "),As=s=>Os?L(P,{children:[Os,s]}):s,Ps=(s,A)=>Sr(e(jr,{contained:Le&&!se,style:se?ao:void 0,framedClass:dr,fillClass:ur,columnClass:`${to} ${De}${ls}${is}`,tabLabel:Cr,pad:r?void 0:br,border:zs(ko,Bo,Io,bo),outerAttrs:xr(A),box:!0,edge:vr&&be!==St,outerStyle:zn,outerClass:r?Rs||void 0:[g.className,fe?Il:"",fe&&To?Bl:"",Rs].filter(Boolean).join(" ")||void 0,bleed:vs,siteSide:He,part:co("box"),children:xs||A?L(P,{children:[xs,A?pr(A):null,se?e(Fs,{children:s}):s]}):se?e(Fs,{children:s}):s})),qe=s=>W?e(ni,{children:A=>Ps(As(s),A)}):Ps(As(s)),Ls=s=>yo.bound?e(Jr,{children:s}):s;if(!r){const s=E===void 0||E==="stretch",A=($(a)!==""||X!==""||T!=="")&&!Gs(C,F)&&!(Q!==""&&$(H)==="")&&(s||ie(C)!==ie(void 0));if(!(o==="row"?A:o==="column"&&s))return qe(Ls(Ze));const Bs=Zr({direction:o,separator:h,loop:b,line:v,share:a,shareTablet:H,sharePhone:F,phoneRow:C,columns:f,columnsTablet:D,stackBelow:ae,shared:d.desktop||d.phone||me,count:Tn}),Or={hasWidth:!0,...Bs?{bound:qr(Bs,yo.bound)}:null};return qe(e(Hs.Provider,{value:Or,children:Ze}))}const ne=_e(S),re=ne?Xs(Pe,de):null,xe=ne?Jt({darken:Pe,darkenStyle:de,darkenTablet:dn,darkenStyleTablet:mn,darkenPhone:un,darkenStylePhone:fn}):{className:"",style:{}},Qe=_e(ke),$s=ne?Qe?{"--sf-box-bg":lo(S??""),"--sf-box-bg-p":lo(ke??"")}:{backgroundImage:lo(S??""),backgroundSize:"cover",backgroundPosition:"center"}:{},ys=Rl(void 0,void 0,V),U=ys.className?ys:null,te=ne&&n&&V?.kind==="nextImage"&&V.media?El(n,V.media):null,w=ne?zl(V,de)??(te?jl:null):null,Ns=V?.media?.cover??"picture",eo=te?e("div",{className:`absolute inset-0 isolate${q?" rounded-[inherit]":""}`,children:e(Pl.Provider,{value:Mn,children:e(Al,{media:te,name:kl(n?.row),cover:Ns,ground:Nl[Ns],arrowsAbove:!0})})}):null,le=U!==null||!!w?.zoom,Es=le?e("div",{"aria-hidden":!0,className:`absolute inset-0${q?" rounded-[inherit]":""}${Qe?` ${qs}`:""}${U?` ${U.className}`:""}`,style:{...$s,...U?.style??{}}}):null,oo=bl({...t,top:ve(t.top)??N(y.desktop,t.unit,"desktop"),bottom:ve(t.bottom)??N(y.desktop,t.unit,"desktop"),topPhone:ve(t.topPhone)??N(y.phone,t.unitPhone,"mobile"),bottomPhone:ve(t.bottomPhone)??N(y.phone,t.unitPhone,"mobile"),left:Oe(t.left)??N(y.side,t.unit,"desktop"),right:Oe(t.right)??N(y.side,t.unit,"desktop"),leftPhone:Oe(t.leftPhone)??N(y.sidePhone,t.unitPhone,"mobile"),rightPhone:Oe(t.rightPhone)??N(y.sidePhone,t.unitPhone,"mobile"),sideSpace:be}),ks=e("div",{className:`relative z-[1] ${Wt} ${Js(oo?.className??"",Uo)}${_||R?` ${Re}`:""}`.trimEnd(),style:re?{...oo?.style,...ao,...Sl}:{...oo?.style,...ao},...co("card-content"),children:Ls(Ze)}),Is=vs&&Le?e("div",{className:Js(`${to} ${De}${_||R?` ${Re}`:""}`,Uo),children:ks}):ks;return qe(e(P,{children:L("div",{className:`relative isolate overflow-hidden ${qt}${n!==null&&!u?` ${Zt}`:""}${ee}${Qe&&!le?` ${qs}`:""}${g.className?` ${g.className}`:""}${w?` ${w.className}`:""}`,style:{...q?oi:{},...Fo,...le?{}:$s,...w?w.style:{}},...U||te?{[Ol]:""}:{},...co("card"),children:[e(Kl,{move:w}),le&&L(P,{children:[e(Ys,{sheet:U?.sheet}),w?.zoom?e("div",{className:`absolute inset-0 overflow-hidden${q?" rounded-[inherit]":""}`,children:L(Ul,{move:w,className:"absolute inset-0",children:[Es,eo]})}):L(P,{children:[Es,eo]})]}),!le&&eo,e(Yr,{wash:re&&xe.className?{...re,...xe.style}:re,hover:w?.washHover,...q?{className:"rounded-[inherit]"}:{},...xe.className?{restClassName:xe.className}:{}}),re?e(zr,{children:Is}):Is,te?e("div",{[$l]:"",className:yl,children:No?e(Ll,{state:No}):null}):null]})}))}export{ri as default};
|
|
@@ -16,8 +16,8 @@ export declare function heroMediaReading(p: {
|
|
|
16
16
|
onClick: boolean;
|
|
17
17
|
youTubeId: string | null;
|
|
18
18
|
backgroundFile: boolean;
|
|
19
|
-
desktopLayout: "
|
|
20
|
-
phoneLayout: "
|
|
19
|
+
desktopLayout: "side" | "one" | "stacked";
|
|
20
|
+
phoneLayout: "side" | "one" | "stacked";
|
|
21
21
|
twoPictures: boolean;
|
|
22
22
|
};
|
|
23
23
|
export declare function heroPartEntrance(partMotion: Record<string, unknown> | undefined, part: HeroMediaPart): Readonly<Record<import("../../format/lib/animation/views.js").MotionView, import("efficient-shell/ui").EntranceValue>> | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as
|
|
1
|
+
"use client";import{Fragment as y,jsx as p,jsxs as O}from"react/jsx-runtime";import{createContext as x,useContext as S,useEffect as k,useId as F,useMemo as A,useRef as M}from"react";import{armEntrance as j}from"efficient-shell/format";import{blockCapsPartSize as D,blockDrawsTextStyle as K,partRuleForKind as E,partRuleForText as L,partStyleCss as N,publishedPartStyles as I}from"../lib/document/part-styles.js";import{useViewWidth as $}from"./SectionAnimation.js";import{useDrawsAtEdge as B}from"./InBoxContext.js";import{styleKeyForPart as H}from"../../format/lib/sections/section-text-kinds.js";import{NO_MOTIONS as J,PART_LIFT_ATTR as b,drawPartEntrance as W,drawPartScroll as Y,ensurePartLiftSheet as V,firstOnPage as R,partBoxOf as q,partMotionDrawn as z,partMoves as G}from"../lib/animation/part-motion.js";import{cssHash as Q,styleElementText as U}from"../../format/lib/document/style-text.js";import{useFontRegistry as X}from"./SiteFontsContext.js";const P=x(null),T=x(null),_=x(null);function ae({needles:t,styles:r,motions:o=J,type:n,atEdge:e=!1,sizeCaps:d,children:i}){const a=F(),h=B(e?"edge":"by-box"),f=JSON.stringify([a,t,r,o,n,d]),s=X(),m=A(()=>{const c=Object.keys(o).filter(l=>G(o[l]));return I(t,r,a,l=>H(n,l),l=>K(n,l),l=>c.includes(l)?z(o[l]):null,c,l=>D(d,l),s)},[f,s]);if(!m)return p(y,{children:i});const u=N(m,{inBox:h});return O(y,{children:[u&&p("style",{href:`${Z}${a}-${Q(u)}`,precedence:w,dangerouslySetInnerHTML:{__html:U(u)}}),p(P.Provider,{value:m,children:i})]})}const g=new WeakMap;function v(t,r){const o=R(r.filter(e=>e.arm)),n=r.some(e=>e.entering)?void 0:R(r.filter(e=>e.scroll));for(const e of r)e!==o&&e.undo&&(e.undo(),e.undo=void 0),e!==n&&e.undoScroll&&(e.undoScroll(),e.undoScroll=void 0);o?.arm&&!o.undo&&(o.undo=o.arm()),n?.scroll&&!n.undoScroll&&(n.undoScroll=n.scroll()),r.some(e=>e.lift)?(V(t.ownerDocument),t.setAttribute(b,"")):t.removeAttribute(b)}function de(t){const r=M(null),o=t?.motion?.entrance??null,n=t?.motion?.scroll??null,e=t?.motion?.hover==="lift",d=$(r,o!==null||n!==null),i=o?o[d]:null,a=n&&n[d].effect!=="none"?n[d]:null,h=JSON.stringify([i,a]);return k(()=>{const f=r.current,s=q(f?.parentElement??null);if(!o&&!n&&!e||!f||!s)return;const m=i?()=>{const l=W(s,i),C=j(s);return()=>{C?.(),l()}}:null,u=g.get(s)??[];g.set(s,u);const c={element:f,arm:m,entering:i!==null&&i.kind!=="none",scroll:a?()=>Y(s,a):null,lift:e};return u.push(c),v(s,u),()=>{const l=u.indexOf(c);l<0||(u.splice(l,1),c.undo?.(),c.undo=void 0,c.undoScroll?.(),c.undoScroll=void 0,v(s,u),u.length||g.delete(s))}},[h,e]),r}const w="sf-part-styles",Z=`${w}-`;function fe(t){const r=S(P),o=S(T),n=L(r,t);return n&&n.stamp!==o?n:null}function me(t){return E(S(P),t)}function pe({stamp:t,children:r}){return p(T.Provider,{value:t,children:r})}function Se({children:t}){const r=S(P);return p(_.Provider,{value:r,children:t})}function Pe(t){return E(S(_),t)}export{pe as ClaimedStamp,w as PART_STYLES_PRECEDENCE,ae as PublishedPartStyles,Se as SharedPartKinds,de as usePartEntrance,me as usePublishedPartKindRule,fe as usePublishedPartRule,Pe as usePublishedSharedKindRule};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type FontRegistry, type SiteFont } from "../../format/lib/fonts.js";
|
|
3
|
+
export declare function SiteFontsProvider({ siteFonts, children, }: {
|
|
4
|
+
siteFonts: readonly SiteFont[] | null | undefined;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
export declare function useFontRegistry(): FontRegistry;
|
|
8
|
+
export declare function SiteFontFaces({ usedKeys, preload }: {
|
|
9
|
+
usedKeys: Iterable<string>;
|
|
10
|
+
preload?: boolean;
|
|
11
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsx as i,Fragment as m,jsxs as u}from"react/jsx-runtime";import{createContext as p,useContext as F,useMemo as x}from"react";import{POOL_FONT_REGISTRY as _,fontRegistry as d}from"../../format/lib/fonts.js";import{siteFontFaces as g}from"../../format/lib/site-font-faces.js";import{cssHash as h}from"../../format/lib/document/style-text.js";const a=p(_);function v({siteFonts:t,children:r}){const o=x(()=>d(t),[t]);return i(a.Provider,{value:o,children:r})}function j(){return F(a)}const f="sf-site-fonts";function R({usedKeys:t,preload:r=!0}){const o=j(),n=g(o,t),c=Object.entries(n.vars),s=[n.css,c.length?`:root { ${c.map(([e,l])=>`${e}: ${l}`).join("; ")} }`:""].filter(Boolean).join(`
|
|
2
|
+
`);return s?u(m,{children:[(r?n.preload:[]).map(e=>i("link",{rel:"preload",as:"font",type:"font/woff2",href:e.url,crossOrigin:""},e.id)),i("style",{href:`${f}-${h(s)}`,precedence:f,dangerouslySetInnerHTML:{__html:s}})]}):null}export{R as SiteFontFaces,v as SiteFontsProvider,j as useFontRegistry};
|
|
@@ -22,12 +22,12 @@ export declare const SERIES_OWN: OwnPad;
|
|
|
22
22
|
export declare const STATS_OWN: OwnPad;
|
|
23
23
|
type Props = Record<string, unknown>;
|
|
24
24
|
export declare const logosBandOwn: (props: Props) => OwnPad;
|
|
25
|
-
type SectionOwnPad = {
|
|
25
|
+
export type SectionOwnPad = {
|
|
26
26
|
readonly frame: (props: Props) => OwnFrame;
|
|
27
27
|
readonly edge?: boolean;
|
|
28
28
|
};
|
|
29
29
|
export declare const SECTION_OWN_PADS: Readonly<Record<string, SectionOwnPad>>;
|
|
30
|
-
export declare function sectionRootPad(type: string, props: Props): RootPadAttrs | null;
|
|
30
|
+
export declare function sectionRootPad(type: string, props: Props, ownPad?: SectionOwnPad): RootPadAttrs | null;
|
|
31
31
|
export declare function withRootPad(className: string, pad: RootPadAttrs | null | undefined, style?: CSSProperties): {
|
|
32
32
|
className: string;
|
|
33
33
|
style?: CSSProperties;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{framePadAttrs as f,padValuesOf as _,SECTION_PAD_KEYS as d}from"./section-padding.js";import{parseSectionHeadPlacement as i}from"../../../format/lib/sections/section-head-placement.js";import{parseSectionHeadStyle as N}from"../../../format/lib/sections/section-head-style.js";import{readHidable as T}from"efficient-easel/draw";import{TICKER_PAD as S}from"../../../format/lib/sections/strip-shape.js";import{finiteNumber as A}from"../../../format/lib/finite-number.js";import{ownEntry as l}from"../../../format/lib/own-entry.js";const E={top:24,bottom:24,topPhone:24,bottomPhone:24},u={top:72,bottom:72,topPhone:72,bottomPhone:72},s={top:100,bottom:100,topPhone:60,bottomPhone:60},x={top:120,bottom:120,topPhone:70,bottomPhone:70},W={top:24,bottom:24,topPhone:24,bottomPhone:24},D=40,C={top:120,bottom:120,topTablet:80,bottomTablet:80,topPhone:80,bottomPhone:80},R={top:24,bottom:24,topPhone:24,bottomPhone:24},g={top:24,bottom:24,topPhone:24,bottomPhone:24},I={top:84,bottom:84,topPhone:84,bottomPhone:84},B={top:48,bottom:48,topPhone:48,bottomPhone:48},M={top:80,bottom:80,topPhone:60,bottomPhone:60},y={top:100,bottom:60,topPhone:60,bottomPhone:40},L={top:60,bottom:60,topPhone:40,bottomPhone:40},F={top:80,bottom:80,topTablet:60,bottomTablet:60,topPhone:60,bottomPhone:60},H={top:76,bottom:76,topPhone:76,bottomPhone:76},G={top:76,bottom:76,topPhone:76,bottomPhone:76},P={top:80,bottom:40,topPhone:60,bottomPhone:32},h={top:76,bottom:76,topPhone:76,bottomPhone:76},k={top:72,bottom:72,topPhone:72,bottomPhone:72},Y={top:40,bottom:64,topPhone:24,bottomPhone:36},w={top:120,bottom:120,topPhone:80,bottomPhone:80,topTablet:80,bottomTablet:80},K={top:48,bottom:48,topPhone:48,bottomPhone:48},U=o=>{const t=A(o.bandPadding)??D;return{top:t,bottom:t,topPhone:t,bottomPhone:t}},c=(o,t,n)=>({desktop:o,tablet:t,mobile:n}),p=o=>i(o.headPlacement)==="own-box",e=(o,t)=>({top:c(o.top,t?.top??o.topTablet??o.top,o.topPhone),bottom:c(o.bottom,t?.bottom??o.bottomTablet??o.bottom,o.bottomPhone)}),O=o=>({top:o.topPhone,bottom:o.bottomPhone}),
|
|
1
|
+
import{framePadAttrs as f,padValuesOf as _,SECTION_PAD_KEYS as d}from"./section-padding.js";import{parseSectionHeadPlacement as i}from"../../../format/lib/sections/section-head-placement.js";import{parseSectionHeadStyle as N}from"../../../format/lib/sections/section-head-style.js";import{readHidable as T}from"efficient-easel/draw";import{TICKER_PAD as S}from"../../../format/lib/sections/strip-shape.js";import{finiteNumber as A}from"../../../format/lib/finite-number.js";import{ownEntry as l}from"../../../format/lib/own-entry.js";const E={top:24,bottom:24,topPhone:24,bottomPhone:24},u={top:72,bottom:72,topPhone:72,bottomPhone:72},s={top:100,bottom:100,topPhone:60,bottomPhone:60},x={top:120,bottom:120,topPhone:70,bottomPhone:70},W={top:24,bottom:24,topPhone:24,bottomPhone:24},D=40,C={top:120,bottom:120,topTablet:80,bottomTablet:80,topPhone:80,bottomPhone:80},R={top:24,bottom:24,topPhone:24,bottomPhone:24},g={top:24,bottom:24,topPhone:24,bottomPhone:24},I={top:84,bottom:84,topPhone:84,bottomPhone:84},B={top:48,bottom:48,topPhone:48,bottomPhone:48},M={top:80,bottom:80,topPhone:60,bottomPhone:60},y={top:100,bottom:60,topPhone:60,bottomPhone:40},L={top:60,bottom:60,topPhone:40,bottomPhone:40},F={top:80,bottom:80,topTablet:60,bottomTablet:60,topPhone:60,bottomPhone:60},H={top:76,bottom:76,topPhone:76,bottomPhone:76},G={top:76,bottom:76,topPhone:76,bottomPhone:76},P={top:80,bottom:40,topPhone:60,bottomPhone:32},h={top:76,bottom:76,topPhone:76,bottomPhone:76},k={top:72,bottom:72,topPhone:72,bottomPhone:72},Y={top:40,bottom:64,topPhone:24,bottomPhone:36},w={top:120,bottom:120,topPhone:80,bottomPhone:80,topTablet:80,bottomTablet:80},K={top:48,bottom:48,topPhone:48,bottomPhone:48},U=o=>{const t=A(o.bandPadding)??D;return{top:t,bottom:t,topPhone:t,bottomPhone:t}},c=(o,t,n)=>({desktop:o,tablet:t,mobile:n}),p=o=>i(o.headPlacement)==="own-box",e=(o,t)=>({top:c(o.top,t?.top??o.topTablet??o.top,o.topPhone),bottom:c(o.bottom,t?.bottom??o.bottomTablet??o.bottom,o.bottomPhone)}),O=o=>({top:o.topPhone,bottom:o.bottomPhone}),m=o=>t=>p(t)?{top:0,bottom:o.bottom}:o,V=(o,t)=>{const n=T(o[t]);return n.hidden?!1:!!n.text||o.editor?.isEditing===!0},j={Banner:{frame:()=>e(E)},Cards:{frame:m(e(u))},Chart:{frame:()=>e(h)},ContactLocations:{frame:()=>e(s,O(s))},Countdown:{frame:()=>e(B)},DocBody:{frame:()=>e(M)},DocMasthead:{frame:()=>e(y)},DocMetaCards:{frame:()=>e(L)},FAQ:{frame:o=>{const t=p(o)||!["num","title","linkText"].some(r=>V(o,r)),n=e(x);return t?{top:0,bottom:n.bottom}:n},edge:!0},FeaturedCover:{frame:()=>e(F)},Grid:{frame:()=>e(W)},Integrations:{frame:()=>e(H)},KeyFeatures:{frame:()=>e(G)},Logos:{frame:o=>p(o)?0:e(U(o))},LongRead:{frame:m(e(C))},Masthead:{frame:()=>e(P,O(P))},Mockup:{frame:()=>e(h)},OrderSummary:{frame:()=>e(R)},PaymentBadges:{frame:()=>e(g)},Prose:{frame:m(e(k))},SectionHeader:{frame:o=>{const t=e(Y);return N(o.headStyle)==="standard"?t:{top:t.top,bottom:0}},edge:!0},Series:{frame:m(e(w))},Stats:{frame:()=>e(K)},Testimonials:{frame:m(e(I))},Ticker:{frame:()=>e(S),edge:!0}};function oo(o,t,n){const r=l(j,o)??n;return r?f({values:_(t,d,!0),frame:r.frame(t),drawsFrame:!0,edge:r.edge},!0).root:null}const v=/^(?:[^\s]*:)?p[ytb]-/;function to(o,t,n){if(!t)return n?{className:o,style:n}:{className:o};const r=o.split(/\s+/).filter(b=>b&&!v.test(b)),a={...n,...t.style};return{className:[...r,t.className].filter(Boolean).join(" "),...Object.keys(a).length?{style:a}:{},...t.attrs}}export{E as BANNER_OWN,u as CARDS_OWN,s as CONTACT_LOCATIONS_OWN,B as COUNTDOWN_OWN,M as DOC_BODY_OWN,y as DOC_MASTHEAD_OWN,L as DOC_META_CARDS_OWN,x as FAQ_OWN,F as FEATURED_COVER_OWN,H as INTEGRATIONS_OWN,G as KEY_FEATURES_OWN,C as LONG_READ_OWN,P as MASTHEAD_OWN,g as PAYMENT_BADGES_OWN,h as PROOF_OWN,k as PROSE_OWN,Y as SECTION_HEADER_OWN,j as SECTION_OWN_PADS,w as SERIES_OWN,K as STATS_OWN,U as logosBandOwn,oo as sectionRootPad,to as withRootPad};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CSSProperties } from "react";
|
|
2
2
|
import { type ViewTier } from "efficient-easel/draw";
|
|
3
3
|
import { type SiteSide } from "efficient-easel/screen/lib/content/length-units";
|
|
4
|
+
import { type SideSpace } from "../../../format/lib/content/page-width.js";
|
|
4
5
|
export declare const SECTION_PADDING: {
|
|
5
6
|
readonly min: 10;
|
|
6
7
|
readonly max: 200;
|
|
@@ -54,7 +55,7 @@ export declare function sideViewLengths(desktop: number | SiteSide | undefined,
|
|
|
54
55
|
tablet?: string;
|
|
55
56
|
phone?: string;
|
|
56
57
|
};
|
|
57
|
-
export declare function padSideAttrs(inline: PadSides, phone: PadSides, tablet?: PadSides, desktop?: PadSides, units?: PadUnits, frame?: number | SideFrames, sideSpace?:
|
|
58
|
+
export declare function padSideAttrs(inline: PadSides, phone: PadSides, tablet?: PadSides, desktop?: PadSides, units?: PadUnits, frame?: number | SideFrames, sideSpace?: SideSpace): {
|
|
58
59
|
classes: string[];
|
|
59
60
|
style: CSSProperties;
|
|
60
61
|
};
|
|
@@ -108,7 +109,7 @@ export type PadValues = {
|
|
|
108
109
|
unitPhone?: unknown;
|
|
109
110
|
frame?: OwnFrame;
|
|
110
111
|
totals?: readonly string[];
|
|
111
|
-
sideSpace?:
|
|
112
|
+
sideSpace?: SideSpace;
|
|
112
113
|
};
|
|
113
114
|
export declare const SECTION_PAD_KEYS: {
|
|
114
115
|
readonly top: "sectionPaddingTop";
|