@taprootio/site-authoring 0.10.7 → 0.10.9
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taprootio/site-authoring",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.9",
|
|
4
4
|
"description": "Taproot site authoring CLI: sign in once in the browser, then pull, validate, push, preview, approve, and deploy a site from the terminal",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "ISC",
|
package/src/constants.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const CLI_NAME = "@taprootio/site-authoring";
|
|
2
|
-
export const CLI_VERSION = "0.10.
|
|
2
|
+
export const CLI_VERSION = "0.10.9";
|
|
3
3
|
export const CLI_BINARY_NAME = "taproot-site";
|
|
4
4
|
export const RESULT_SCHEMA_VERSION = 1;
|
|
5
5
|
export const CONFIG_FILE_NAME = "taproot-site.json";
|
|
@@ -157,6 +157,10 @@ const CTA = Object.freeze({
|
|
|
157
157
|
}),
|
|
158
158
|
imagePosition: enumOf("top", "left", "right"),
|
|
159
159
|
mediaImage: image(),
|
|
160
|
+
// TR00890: "waitlist" replaces the link button with an email-capture form
|
|
161
|
+
// that posts to the platform's public waitlist endpoint. buttonUrl is
|
|
162
|
+
// ignored in that mode; buttonText becomes the submit button's label.
|
|
163
|
+
formMode: enumOf("none", "waitlist"),
|
|
160
164
|
});
|
|
161
165
|
|
|
162
166
|
/** `FeatureGridData`. */
|
|
@@ -359,10 +363,12 @@ const COMPONENT_DEFINITIONS = Object.freeze({
|
|
|
359
363
|
borderWidth: 0,
|
|
360
364
|
imagePosition: "top",
|
|
361
365
|
mediaImage: null,
|
|
366
|
+
formMode: "none",
|
|
362
367
|
},
|
|
363
368
|
[
|
|
364
369
|
"Button text must describe its action or destination.",
|
|
365
370
|
"Give meaningful media a descriptive alt value and decorative media an empty alt value.",
|
|
371
|
+
"formMode \"waitlist\" renders an email-capture form instead of the link button; leave buttonUrl empty and use buttonText for the submit label.",
|
|
366
372
|
],
|
|
367
373
|
{
|
|
368
374
|
heading: "Ready to begin?",
|
|
@@ -76,6 +76,8 @@ export interface RenderProseMirrorOptions {
|
|
|
76
76
|
};
|
|
77
77
|
/** Records visible document-order content after each node is rendered. */
|
|
78
78
|
onRenderedNode?: (node: ProseMirrorNode, html: string) => void;
|
|
79
|
+
/** Maps an authored heading level (1–4) to the level rendered; defaults to the authored level. */
|
|
80
|
+
headingLevel?: (authored: number) => number;
|
|
79
81
|
/** Claims the page's one LCP slot before rendering a section photo. */
|
|
80
82
|
claimSectionBackgroundImage?: () => boolean;
|
|
81
83
|
}
|
|
@@ -363,7 +365,8 @@ function wrapMark(html: string, mark: ProseMirrorMark): string {
|
|
|
363
365
|
|
|
364
366
|
function renderHeading(node: ProseMirrorNode, options: RenderProseMirrorOptions): string {
|
|
365
367
|
const rawLevel = numberAttr(node.attrs?.level) ?? 1;
|
|
366
|
-
const
|
|
368
|
+
const authored = Math.min(4, Math.max(1, Math.trunc(rawLevel)));
|
|
369
|
+
const level = Math.min(6, Math.max(1, options.headingLevel?.(authored) ?? authored));
|
|
367
370
|
return renderElement(
|
|
368
371
|
`h${level}`,
|
|
369
372
|
withProseMeasure(textBlockAttrs(node.attrs), node.type, options),
|