@taprootio/site-authoring 0.6.2 → 0.6.3
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 +2 -2
- package/src/constants.js +1 -1
- package/src/content/tiptap-prosemirror.ts +19 -12
- package/src/settings-catalog.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taprootio/site-authoring",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
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",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"README.md"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@taprootio/espalier": "4.
|
|
31
|
+
"@taprootio/espalier": "4.11.0"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"test": "node --test",
|
package/src/constants.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const CLI_NAME = "@taprootio/site-authoring";
|
|
2
|
-
export const CLI_VERSION = "0.6.
|
|
2
|
+
export const CLI_VERSION = "0.6.3";
|
|
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";
|
|
@@ -52,6 +52,7 @@ export interface RenderProseMirrorOptions {
|
|
|
52
52
|
freeFormSections?: boolean;
|
|
53
53
|
imageDefaults?: {
|
|
54
54
|
placement?: TiptapImagePresentationPlacement | string | null;
|
|
55
|
+
/** The page shell emits this default once so rich-text formats inherit it. */
|
|
55
56
|
maxHeightVh?: TiptapImageMaxHeightVh | number | null;
|
|
56
57
|
};
|
|
57
58
|
}
|
|
@@ -1013,7 +1014,7 @@ function resolveImagePresentation(
|
|
|
1013
1014
|
attrs: Record<string, JsonValue | undefined>,
|
|
1014
1015
|
defaults: RenderProseMirrorOptions["imageDefaults"],
|
|
1015
1016
|
): Record<string, string | number | undefined> {
|
|
1016
|
-
const
|
|
1017
|
+
const explicitMaxHeight = explicitImageMaxHeight(attrs.maxHeightVh);
|
|
1017
1018
|
const maxHeightOverride = normalizeCssLengthOverride(attrs.maxHeight, { allowNone: true });
|
|
1018
1019
|
const borderWidthOverride = normalizeCssLengthOverride(attrs.borderWidth);
|
|
1019
1020
|
const placement = resolvePlacement(attrs, defaults?.placement);
|
|
@@ -1022,9 +1023,12 @@ function resolveImagePresentation(
|
|
|
1022
1023
|
if (maxHeightOverride) styleParts.push(`--taproot-article-image-max-height: ${maxHeightOverride}`);
|
|
1023
1024
|
if (borderWidthOverride) styleParts.push(`--esp-image-border: ${imageBorderValue(borderWidthOverride)}`);
|
|
1024
1025
|
return {
|
|
1026
|
+
// The page shell owns the inherited site default so HTML and structured
|
|
1027
|
+
// rich text share it. Serialize only an explicit legacy choice; this
|
|
1028
|
+
// includes 60vh when it intentionally overrides a taller site default.
|
|
1025
1029
|
// An explicit CSS max height supersedes the legacy vh enum entirely.
|
|
1026
|
-
...(maxHeightOverride === null &&
|
|
1027
|
-
? { "data-image-max-height-vh":
|
|
1030
|
+
...(maxHeightOverride === null && explicitMaxHeight !== null
|
|
1031
|
+
? { "data-image-max-height-vh": explicitMaxHeight }
|
|
1028
1032
|
: {}),
|
|
1029
1033
|
...(maxHeightOverride ? { "data-image-max-height": maxHeightOverride } : {}),
|
|
1030
1034
|
...(borderWidthOverride ? { "data-image-border-width": borderWidthOverride } : {}),
|
|
@@ -1034,11 +1038,9 @@ function resolveImagePresentation(
|
|
|
1034
1038
|
};
|
|
1035
1039
|
}
|
|
1036
1040
|
|
|
1037
|
-
function
|
|
1038
|
-
if (value === TIPTAP_SITE_DEFAULT || value === undefined || value === null)
|
|
1039
|
-
|
|
1040
|
-
}
|
|
1041
|
-
return normalizeImageMaxHeight(value);
|
|
1041
|
+
function explicitImageMaxHeight(value: unknown): TiptapImageMaxHeightVh | null {
|
|
1042
|
+
if (value === TIPTAP_SITE_DEFAULT || value === undefined || value === null) return null;
|
|
1043
|
+
return isImageMaxHeightOption(value) ? imageMaxHeightOption(value) : null;
|
|
1042
1044
|
}
|
|
1043
1045
|
|
|
1044
1046
|
function resolvePlacement(
|
|
@@ -1068,10 +1070,15 @@ function isAbsentPresentationValue(value: unknown): boolean {
|
|
|
1068
1070
|
}
|
|
1069
1071
|
|
|
1070
1072
|
export function normalizeImageMaxHeight(value: unknown): TiptapImageMaxHeightVh {
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1073
|
+
return isImageMaxHeightOption(value) ? imageMaxHeightOption(value) : DEFAULT_TIPTAP_IMAGE_MAX_HEIGHT_VH;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
function isImageMaxHeightOption(value: unknown): boolean {
|
|
1077
|
+
return TIPTAP_IMAGE_MAX_HEIGHT_OPTIONS.includes(imageMaxHeightOption(value));
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
function imageMaxHeightOption(value: unknown): TiptapImageMaxHeightVh {
|
|
1081
|
+
return (typeof value === "number" ? value : Number(value)) as TiptapImageMaxHeightVh;
|
|
1075
1082
|
}
|
|
1076
1083
|
|
|
1077
1084
|
const CSS_LENGTH_UNITS = "px|em|rem|ch|ex|vw|vh|svh|lvh|dvh|svw|lvw|dvw|vmin|vmax|%";
|
package/src/settings-catalog.js
CHANGED
|
@@ -120,6 +120,7 @@ export const SETTINGS_GROUPS = Object.freeze([
|
|
|
120
120
|
{ name: "tiptapImageBorderWidth", wireType: "int" },
|
|
121
121
|
{ name: "albumBorderWidth", wireType: "int" },
|
|
122
122
|
{ name: "albumMaxImagesPerRow", wireType: "int" },
|
|
123
|
+
{ name: "albumMaxRowHeightVh", wireType: "int" },
|
|
123
124
|
{ name: "footerSettings", wireType: "document", zero: {} },
|
|
124
125
|
]),
|
|
125
126
|
}),
|