@taprootio/site-authoring 0.38.1 → 0.40.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/README.md +73 -17
- package/examples/riverbend-wellness/manifest.fixture.json +1 -1
- package/examples/riverbend-wellness/settings/site-publishing-preferences.json +29 -14
- package/package.json +2 -2
- package/src/api.js +4 -5
- package/src/appearance-contract.js +64 -55
- package/src/atomic-file.js +2 -1
- package/src/changelog.json +37 -0
- package/src/cli.js +2 -2
- package/src/content/free-form-sections.js +2 -3
- package/src/display-scale.js +17 -0
- package/src/footer-alignment.js +97 -0
- package/src/footer-brand-inputs.js +33 -0
- package/src/footer-branding.js +44 -0
- package/src/footer-content.js +10 -0
- package/src/footer-contract.js +167 -43
- package/src/footer-draft-hash.js +26 -27
- package/src/footer-fit-widths.js +10 -0
- package/src/footer-fit.js +328 -0
- package/src/footer-font-metrics.js +8345 -0
- package/src/footer-workspace.js +4 -6
- package/src/header-presentation.js +17 -15
- package/src/logo-inputs.js +38 -0
- package/src/logo-surface-checks.js +67 -0
- package/src/presentation-reference.js +119 -46
- package/src/reference-help.js +3 -3
- package/src/setting-reference.js +15 -4
- package/src/settings-catalog.js +10 -3
- package/src/site-check-findings.js +73 -11
- package/src/site-check-rules.json +4 -2
- package/src/theme-contexts.js +82 -0
- package/src/theme-resolve.js +2 -2
- package/src/theme-validation.js +30 -13
- package/src/verbs/footer-push.js +20 -9
- package/src/verbs/plan.js +2 -2
- package/src/verbs/theme-push.js +46 -41
- package/src/verbs/validate.js +33 -17
- package/src/workspace-check.js +1 -1
- package/src/workspace.js +1 -1
package/README.md
CHANGED
|
@@ -125,12 +125,12 @@ writes it (`help appearance` prints the same text beside each writable field,
|
|
|
125
125
|
and the shipped help is the authority if this table drifts). The ones that are
|
|
126
126
|
easy to confuse:
|
|
127
127
|
|
|
128
|
-
| App control
|
|
129
|
-
|
|
|
130
|
-
| Brand & style > Page style > Background image | `lightTheme` / `darkTheme` `pageBackgroundImage` (with `pageBackgroundImageOpacity`)
|
|
131
|
-
| Brand & style > Page canvas > Canvas image
|
|
132
|
-
| Brand & style > Brand > Logo
|
|
133
|
-
| Brand & style > Brand > Favicon
|
|
128
|
+
| App control | Workspace field | Where it renders |
|
|
129
|
+
| --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
130
|
+
| Brand & style > Page style > Background image | `lightTheme` / `darkTheme` `pageBackgroundImage` (with `pageBackgroundImageOpacity`) | One layer across the page box behind the content; the opaque header and footer cover it, so it shows behind the main content. |
|
|
131
|
+
| Brand & style > Page canvas > Canvas image | `lightCanvasImageId` / `darkCanvasImageId` in `taproot-styles.json` (with the two `...CanvasImageOpacity` fields) | Only the empty side margins of a page. Not on a standard site today, whose margins are 0 px wide. |
|
|
132
|
+
| Brand & style > Brand > Logo | `lightLogoId` / `darkLogoId` | The header brand and the enabled footer's inherited logo. Each footer scheme may override it with `logoId`. |
|
|
133
|
+
| Brand & style > Brand > Favicon | `brand.json` `faviconId` | The icon set in every page's head and `/favicon.ico`. |
|
|
134
134
|
|
|
135
135
|
Both background layers tile at the image's natural pixel size from the top-left;
|
|
136
136
|
neither sets a size, repeat or position.
|
|
@@ -147,6 +147,49 @@ Warnings never refuse: `linkWarnings` names a link whose address is only
|
|
|
147
147
|
`http(s)://` plus its own text (`content.link_autolinked`, left by older editor
|
|
148
148
|
autolinking), and `pages push` reports the same for the pages it sends.
|
|
149
149
|
|
|
150
|
+
Footer regions have individual widths: `brandSpan` is 1–3, a link column's
|
|
151
|
+
`span` and `asideSpan` are 1–2, and `brandSize` is `standard` or `large`.
|
|
152
|
+
Omitted spans are 1; omitted or empty size is `standard`. `brandSize` changes
|
|
153
|
+
only brand text. `logoScale` independently sets logo size as a string from
|
|
154
|
+
`"1.0"` through `"5.0"` in 0.1 steps. Empty and `"1"` normalize to `"1.0"`;
|
|
155
|
+
whitespace, exponents, numeric JSON values and extra decimal places are refused.
|
|
156
|
+
Old absent or null scales migrate to `"1.5"` for Large text and `"1.0"`
|
|
157
|
+
otherwise; pull and footer push write the explicit value, so later text-size
|
|
158
|
+
edits do not change the logo. Each scheme's `logoId` accepts a site-owned PNG
|
|
159
|
+
or WebP; empty inherits that scheme's site logo independently. `logoUrl` is
|
|
160
|
+
read-only metadata and stays out of workspace requests. There is no total
|
|
161
|
+
track limit. Set `logoBox` to `natural` to fit constrained artwork dimensions;
|
|
162
|
+
`fixed` keeps the scaled image height, including spare space. Missing, null or
|
|
163
|
+
empty means `fixed`. Positioning the brand at Top moves spare space below the
|
|
164
|
+
artwork; natural mode removes the unused envelope without cropping alpha padding.
|
|
165
|
+
|
|
166
|
+
`alignment` sets whole-footer defaults. `brandAlignment`, `asideAlignment` and
|
|
167
|
+
each link column's `alignment` override individual regions. Each is a sparse
|
|
168
|
+
object with optional `wide`, `wrapped` (Brand row) and `stacked` layouts, whose
|
|
169
|
+
`horizontal` and `vertical` choices are `start`, `center` or `end`. Logical
|
|
170
|
+
start/end follow writing direction. `textAlign` also accepts `auto` and `justify`.
|
|
171
|
+
`bottomAlignment` uses the same layouts with only `horizontal` and `textAlign`.
|
|
172
|
+
For each axis, the active layout tries the region then whole-footer choice,
|
|
173
|
+
then repeats toward wider layouts. Empty or omitted axes inherit; null or empty
|
|
174
|
+
profiles disappear on pull. Explicit `start` stays authored intent. Text `auto`
|
|
175
|
+
follows current horizontal placement and resets inherited justification.
|
|
176
|
+
Justification affects prose with a normal last line; headings, brand text,
|
|
177
|
+
menus and CTA labels follow horizontal placement. Save only authored choices,
|
|
178
|
+
for example `"alignment": { "stacked": { "horizontal": "center" } }`.
|
|
179
|
+
|
|
180
|
+
`validate` and `footer push` estimate `footer.word_breaks` at five widths:
|
|
181
|
+
Desktop, Small desktop, Tablet, Phone and Small phone (320px). They show at most
|
|
182
|
+
12 footer warnings, with the true count and any remainder. Generated default-font
|
|
183
|
+
metrics, type scale and gaps are assumed; custom fonts or scale may differ.
|
|
184
|
+
Supported whitespace, hyphen and zero-width breaks are estimated, with bounded
|
|
185
|
+
contextual shaping; fragments containing Han, Kana or Thai are skipped.
|
|
186
|
+
Local upload dimensions follow the selected footer artwork. Unknown proportions
|
|
187
|
+
use the 4:1 maximum, so a narrow logo can produce extra brand warnings.
|
|
188
|
+
Warnings allow the push. Managed Docs workspaces get the same check; deployment
|
|
189
|
+
checks cover standard and profile sites. Footer overrides count as logos even without
|
|
190
|
+
a site logo. After upgrading to the v8 footer hash
|
|
191
|
+
contract, pull again before pushing.
|
|
192
|
+
|
|
150
193
|
`validate` also runs the site checks that need nothing but the workspace, from
|
|
151
194
|
the same rule catalogue the editor and the site-health page read. `findings`
|
|
152
195
|
lists each one as a rule id (`link.page_missing`, a link to a page the workspace
|
|
@@ -309,12 +352,12 @@ explicitly and bypasses discovery. `login`, `logout`, `sites`, `use`,
|
|
|
309
352
|
}
|
|
310
353
|
```
|
|
311
354
|
|
|
312
|
-
| Field | Rule
|
|
313
|
-
| ------------------ |
|
|
314
|
-
| `configVersion` | Must be `1`.
|
|
315
|
-
| `siteId` | Optional. The canonical lowercase UUID of the site the next command writes to. `use` writes it; a present but malformed value is refused.
|
|
316
|
-
| `authoringSurface` | Optional. `standard`, `docs-presentation`, or `none`: the verbs the site accepts, as `use` recorded them. A present but unknown value is refused; Taproot re-resolves the surface on every write.
|
|
317
|
-
| `workspaceDir` | Required. A relative POSIX path beneath the configuration directory that `pull` writes into. Every existing segment must be a real directory.
|
|
355
|
+
| Field | Rule |
|
|
356
|
+
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
357
|
+
| `configVersion` | Must be `1`. |
|
|
358
|
+
| `siteId` | Optional. The canonical lowercase UUID of the site the next command writes to. `use` writes it; a present but malformed value is refused. |
|
|
359
|
+
| `authoringSurface` | Optional. `standard`, `docs-presentation`, or `none`: the verbs the site accepts, as `use` recorded them. A present but unknown value is refused; Taproot re-resolves the surface on every write. |
|
|
360
|
+
| `workspaceDir` | Required. A relative POSIX path beneath the configuration directory that `pull` writes into. Every existing segment must be a real directory. |
|
|
318
361
|
|
|
319
362
|
The file is a small, closed JSON object. Unknown fields, duplicate keys, links
|
|
320
363
|
in the path, and unsupported versions are refused before any credential is
|
|
@@ -375,7 +418,7 @@ each step names the reference it relies on.
|
|
|
375
418
|
`theme push --dry-run` reads the site and lists the JSON paths at which
|
|
376
419
|
each settings file differs from it, and whether the baseline `pull`
|
|
377
420
|
recorded is still current; `theme push` saves both themes, the appearance
|
|
378
|
-
scalars
|
|
421
|
+
scalars, header/footer contexts and logo variants in one transaction fenced by
|
|
379
422
|
that baseline. A concurrent change to any of those fields refuses the
|
|
380
423
|
whole push (`theme.concurrent_modification`) and nothing is written: keep
|
|
381
424
|
copies of the edited files, pull, re-apply, push again. A lost response is
|
|
@@ -383,8 +426,17 @@ each step names the reference it relies on.
|
|
|
383
426
|
`theme push` again with the same files replays it under its original
|
|
384
427
|
baseline, and the site answers `applied: false` when it already holds the
|
|
385
428
|
change set. `pull` reads the four settings documents and the revision
|
|
386
|
-
from one snapshot
|
|
387
|
-
|
|
429
|
+
from one snapshot. `footer push` saves only content and retains local presentation
|
|
430
|
+
edits for the next `theme push`; it does not advance over unseen presentation edits.
|
|
431
|
+
Set `site-header.context` and `footerSettings.context` to a context declared
|
|
432
|
+
by both themes, or remove the key to follow the page colors. The five footer
|
|
433
|
+
color fields are retired; `help appearance` gives the color-to-context recipe.
|
|
434
|
+
Each surface's `logoVariant` is empty to match the color scheme, `light` for
|
|
435
|
+
light-background artwork, or `dark` for dark-background artwork. `validate`
|
|
436
|
+
reports an advisory brightness mismatch when another variant can fix it;
|
|
437
|
+
inspect the artwork in both schemes on staging. Offline workspaces have no
|
|
438
|
+
profile fallback metadata, and unknown image dimensions retain conservative
|
|
439
|
+
footer-fit estimates.
|
|
388
440
|
6. **Review on staging in both schemes.** `staging review` (or
|
|
389
441
|
`deploy --staging --handoff`) returns a single-use handoff in
|
|
390
442
|
`stagingPreview.url`, on a managed Docs site too; open it once and use the
|
|
@@ -491,7 +543,7 @@ Markdown subset accepts levels 1 to 4.
|
|
|
491
543
|
A `.pm.json` page's title, path, description and author live in the workspace
|
|
492
544
|
manifest rather than the file. `pages meta set <path> --title <text>
|
|
493
545
|
--description <text>` changes the title or description there (a Markdown page
|
|
494
|
-
keeps them in its front matter; `--author` is described under
|
|
546
|
+
keeps them in its front matter; `--author` is described under _Page authors_); `pull` keeps that edit until `pages push`
|
|
495
547
|
sends it, and a site edit to the same page conflicts only while that edit is unpushed
|
|
496
548
|
(`pages.pull_conflict`; see the pull rule above). A
|
|
497
549
|
description over 160 characters is a warning (`descriptionWarnings`), because
|
|
@@ -508,6 +560,7 @@ section. The regions stack in source order when the section is too narrow.
|
|
|
508
560
|
:::section {}
|
|
509
561
|
:::columns {"ratio":"40-60"}
|
|
510
562
|
:::column {}
|
|
563
|
+
|
|
511
564
|
## Start a conversation
|
|
512
565
|
|
|
513
566
|
Tell us about your project.
|
|
@@ -1237,7 +1290,10 @@ The same ProseMirror node is:
|
|
|
1237
1290
|
"cite": "https://www.huxley.net/bnw/four.html"
|
|
1238
1291
|
},
|
|
1239
1292
|
"content": [
|
|
1240
|
-
{
|
|
1293
|
+
{
|
|
1294
|
+
"type": "paragraph",
|
|
1295
|
+
"content": [{ "type": "text", "text": "Words can be like X-rays." }]
|
|
1296
|
+
}
|
|
1241
1297
|
]
|
|
1242
1298
|
}
|
|
1243
1299
|
```
|
|
@@ -27,30 +27,22 @@
|
|
|
27
27
|
}
|
|
28
28
|
],
|
|
29
29
|
"light": {
|
|
30
|
-
"backgroundColor": "--esp-color-layer-1",
|
|
31
|
-
"textColor": "--esp-color-text",
|
|
32
|
-
"headingColor": "--esp-color-headings",
|
|
33
|
-
"linkColor": "--esp-color-link",
|
|
34
|
-
"linkHoverColor": "--esp-color-link-hover",
|
|
35
30
|
"backgroundImageId": "",
|
|
36
31
|
"backgroundImageOpacity": 0,
|
|
37
32
|
"backgroundPresentation": "FOOTER_BACKGROUND_PRESENTATION_COVER",
|
|
38
33
|
"backgroundFade": "FOOTER_FADE_MODE_NONE",
|
|
39
34
|
"backgroundRepeatHeightPx": 160,
|
|
40
|
-
"additionalTopPaddingRem": 1
|
|
35
|
+
"additionalTopPaddingRem": 1,
|
|
36
|
+
"logoId": "a0000000-0000-4000-8000-0000000000a0"
|
|
41
37
|
},
|
|
42
38
|
"dark": {
|
|
43
|
-
"backgroundColor": "--esp-color-layer-1",
|
|
44
|
-
"textColor": "--esp-color-text",
|
|
45
|
-
"headingColor": "--esp-color-headings",
|
|
46
|
-
"linkColor": "--esp-color-link",
|
|
47
|
-
"linkHoverColor": "--esp-color-link-hover",
|
|
48
39
|
"backgroundImageId": "",
|
|
49
40
|
"backgroundImageOpacity": 0,
|
|
50
41
|
"backgroundPresentation": "FOOTER_BACKGROUND_PRESENTATION_COVER",
|
|
51
42
|
"backgroundFade": "FOOTER_FADE_MODE_NONE",
|
|
52
43
|
"backgroundRepeatHeightPx": 160,
|
|
53
|
-
"additionalTopPaddingRem": 1
|
|
44
|
+
"additionalTopPaddingRem": 1,
|
|
45
|
+
"logoId": ""
|
|
54
46
|
},
|
|
55
47
|
"linkColumns": [
|
|
56
48
|
{
|
|
@@ -72,7 +64,11 @@
|
|
|
72
64
|
}
|
|
73
65
|
]
|
|
74
66
|
}
|
|
75
|
-
]
|
|
67
|
+
],
|
|
68
|
+
"span": 1,
|
|
69
|
+
"alignment": {
|
|
70
|
+
"stacked": { "horizontal": "start", "textAlign": "start" }
|
|
71
|
+
}
|
|
76
72
|
}
|
|
77
73
|
],
|
|
78
74
|
"asideHeadingContent": {
|
|
@@ -109,7 +105,26 @@
|
|
|
109
105
|
}
|
|
110
106
|
]
|
|
111
107
|
},
|
|
112
|
-
"featureImage": null
|
|
108
|
+
"featureImage": null,
|
|
109
|
+
"brandSpan": 1,
|
|
110
|
+
"asideSpan": 1,
|
|
111
|
+
"brandSize": "standard",
|
|
112
|
+
"logoScale": "1.0",
|
|
113
|
+
"logoBox": "natural",
|
|
114
|
+
"alignment": {
|
|
115
|
+
"stacked": { "horizontal": "center" }
|
|
116
|
+
},
|
|
117
|
+
"brandAlignment": {
|
|
118
|
+
"wide": { "vertical": "start" },
|
|
119
|
+
"wrapped": { "horizontal": "center" }
|
|
120
|
+
},
|
|
121
|
+
"asideAlignment": {
|
|
122
|
+
"wide": { "textAlign": "justify" },
|
|
123
|
+
"stacked": { "textAlign": "auto" }
|
|
124
|
+
},
|
|
125
|
+
"bottomAlignment": {
|
|
126
|
+
"stacked": { "textAlign": "auto" }
|
|
127
|
+
}
|
|
113
128
|
}
|
|
114
129
|
}
|
|
115
130
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taprootio/site-authoring",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
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": "
|
|
31
|
+
"@taprootio/espalier": "7.1.1",
|
|
32
32
|
"mediabunny": "1.61.1"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
package/src/api.js
CHANGED
|
@@ -877,11 +877,10 @@ export async function getSitePresentation(client, siteId) {
|
|
|
877
877
|
|
|
878
878
|
/**
|
|
879
879
|
* Applies a presentation change set atomically (TR00807). `expectedRevision`
|
|
880
|
-
* is the revision the workspace was pulled at
|
|
881
|
-
* the
|
|
882
|
-
*
|
|
883
|
-
*
|
|
884
|
-
* current when it committed, and applied when it did not.
|
|
880
|
+
* is the revision the workspace was pulled at. Surface contexts are saved
|
|
881
|
+
* with the themes that declare them, independently of footer content. The
|
|
882
|
+
* replayable POST answers a lost response as already current when the save
|
|
883
|
+
* committed, and applies it when it did not.
|
|
885
884
|
*/
|
|
886
885
|
export async function saveSitePresentation(client, siteId, body) {
|
|
887
886
|
const response = requireObject(
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { BLOCK_SPACINGS, DEFAULT_BLOCK_SPACING } from "./block-flow.js";
|
|
2
2
|
import { hasControlCharacter, isCanonicalUuid, SiteAuthoringError } from "./errors.js";
|
|
3
|
-
import {
|
|
3
|
+
import { FOOTER_PRESENTATION_FIELDS } from "./footer-content.js";
|
|
4
|
+
import { refuseRetiredFooterColors } from "./footer-contract.js";
|
|
5
|
+
import { HEADER_HEIGHT_MULTIPLIER_LIMITS, LOGO_VARIANTS, parseHeaderHeightMultiplier } from "./header-presentation.js";
|
|
4
6
|
import {
|
|
5
7
|
SETTINGS_TYPE_BRAND,
|
|
6
8
|
SETTINGS_TYPE_SITE_HEADER,
|
|
7
9
|
SETTINGS_TYPE_SITE_PUBLISHING_PREFERENCES,
|
|
8
10
|
SETTINGS_TYPE_TAPROOT_STYLES,
|
|
9
11
|
} from "./settings-catalog.js";
|
|
10
|
-
import {
|
|
12
|
+
import { HEADER_BRAND_COLOR_TOKENS, requireAppearanceColor } from "./theme-validation.js";
|
|
11
13
|
|
|
12
14
|
export const APPEARANCE_FILES = Object.freeze({
|
|
13
15
|
[SETTINGS_TYPE_TAPROOT_STYLES]: "settings/taproot-styles.json",
|
|
@@ -67,6 +69,23 @@ export const APPEARANCE_SCALAR_FIELDS = Object.freeze([
|
|
|
67
69
|
type: "site-owned-image-id",
|
|
68
70
|
default: "",
|
|
69
71
|
}),
|
|
72
|
+
Object.freeze({
|
|
73
|
+
settingsType: SETTINGS_TYPE_SITE_HEADER,
|
|
74
|
+
name: "logoVariant",
|
|
75
|
+
path: "site-header.logoVariant",
|
|
76
|
+
type: "enum",
|
|
77
|
+
values: LOGO_VARIANTS,
|
|
78
|
+
optional: true,
|
|
79
|
+
default: "",
|
|
80
|
+
}),
|
|
81
|
+
Object.freeze({
|
|
82
|
+
settingsType: SETTINGS_TYPE_SITE_HEADER,
|
|
83
|
+
name: "context",
|
|
84
|
+
path: "site-header.context",
|
|
85
|
+
type: "theme-context",
|
|
86
|
+
optional: true,
|
|
87
|
+
default: "",
|
|
88
|
+
}),
|
|
70
89
|
Object.freeze({
|
|
71
90
|
settingsType: SETTINGS_TYPE_SITE_HEADER,
|
|
72
91
|
name: "headerLayout",
|
|
@@ -131,15 +150,17 @@ export const APPEARANCE_SCALAR_FIELDS = Object.freeze([
|
|
|
131
150
|
values: Object.freeze(["normal", "sticky", "fixed"]),
|
|
132
151
|
default: "normal",
|
|
133
152
|
}),
|
|
134
|
-
...["headerHeightMultiplier", "headerMinHeightMultiplier"].map(name =>
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
153
|
+
...["headerHeightMultiplier", "headerMinHeightMultiplier"].map(name =>
|
|
154
|
+
Object.freeze({
|
|
155
|
+
settingsType: SETTINGS_TYPE_SITE_HEADER,
|
|
156
|
+
name,
|
|
157
|
+
path: `site-header.${name}`,
|
|
158
|
+
type: "header-height-multiplier",
|
|
159
|
+
...HEADER_HEIGHT_MULTIPLIER_LIMITS,
|
|
160
|
+
optional: true,
|
|
161
|
+
default: "",
|
|
162
|
+
})
|
|
163
|
+
),
|
|
143
164
|
Object.freeze({
|
|
144
165
|
settingsType: SETTINGS_TYPE_SITE_HEADER,
|
|
145
166
|
name: "showThemeToggle",
|
|
@@ -218,21 +239,16 @@ export const APPEARANCE_READ_ONLY_FIELDS = Object.freeze([
|
|
|
218
239
|
Object.freeze({ file: APPEARANCE_FILES[SETTINGS_TYPE_BRAND], path: "settings.faviconUrl" }),
|
|
219
240
|
]);
|
|
220
241
|
|
|
221
|
-
export const
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
allowedTokens: FOOTER_COLOR_TOKENS[name],
|
|
232
|
-
})
|
|
233
|
-
)
|
|
234
|
-
),
|
|
235
|
-
);
|
|
242
|
+
export const APPEARANCE_FOOTER_FIELDS = Object.freeze(FOOTER_PRESENTATION_FIELDS.map(name =>
|
|
243
|
+
Object.freeze({
|
|
244
|
+
file: APPEARANCE_FILES[SETTINGS_TYPE_SITE_PUBLISHING_PREFERENCES],
|
|
245
|
+
path: `settings.footerSettings.${name}`,
|
|
246
|
+
name,
|
|
247
|
+
...(name === "context" ? { type: "theme-context" } : { type: "enum", values: LOGO_VARIANTS }),
|
|
248
|
+
optional: true,
|
|
249
|
+
default: "",
|
|
250
|
+
})
|
|
251
|
+
));
|
|
236
252
|
|
|
237
253
|
export const APPEARANCE_IMAGE_FIELDS = Object.freeze(
|
|
238
254
|
APPEARANCE_SCALAR_FIELDS.filter((field) => field.type === "site-owned-image-id"),
|
|
@@ -283,6 +299,15 @@ function validateScalar(definition, value, knownImageIds) {
|
|
|
283
299
|
return value;
|
|
284
300
|
case "string":
|
|
285
301
|
return requireString(value, definition.path);
|
|
302
|
+
case "theme-context":
|
|
303
|
+
if (typeof value !== "string") {
|
|
304
|
+
fail(
|
|
305
|
+
"settings.context_unknown",
|
|
306
|
+
`${definition.path} must name a shared theme context or be empty.`,
|
|
307
|
+
definition.path,
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
return value;
|
|
286
311
|
case "plain-text": {
|
|
287
312
|
const text = requireString(value, definition.path, definition.maximumLength);
|
|
288
313
|
if ([...text].some((character) => character === "<" || character === ">" || character === "\"")) {
|
|
@@ -355,7 +380,7 @@ export function buildAppearanceScalarOperations(documents, knownImageIds) {
|
|
|
355
380
|
}));
|
|
356
381
|
}
|
|
357
382
|
|
|
358
|
-
export function
|
|
383
|
+
export function footerPresentationOverlay(workspaceFooter) {
|
|
359
384
|
if (workspaceFooter === null || typeof workspaceFooter !== "object" || Array.isArray(workspaceFooter)) {
|
|
360
385
|
fail(
|
|
361
386
|
"theme.footer_missing",
|
|
@@ -363,38 +388,22 @@ export function footerColorOverlay(workspaceFooter) {
|
|
|
363
388
|
"site-publishing-preferences.footerSettings",
|
|
364
389
|
);
|
|
365
390
|
}
|
|
366
|
-
|
|
367
|
-
for (const
|
|
368
|
-
const scheme = workspaceFooter[
|
|
391
|
+
refuseRetiredFooterColors(workspaceFooter);
|
|
392
|
+
for (const name of ["light", "dark"]) {
|
|
393
|
+
const scheme = workspaceFooter[name];
|
|
369
394
|
if (scheme === null || typeof scheme !== "object" || Array.isArray(scheme)) {
|
|
370
395
|
fail(
|
|
371
396
|
"theme.footer_invalid",
|
|
372
|
-
`footerSettings.${
|
|
373
|
-
`footerSettings.${
|
|
397
|
+
`footerSettings.${name} must be an object.`,
|
|
398
|
+
`footerSettings.${name}`,
|
|
374
399
|
);
|
|
375
400
|
}
|
|
376
|
-
colors[definition.scheme][definition.name] = requireAppearanceColor(
|
|
377
|
-
scheme[definition.name] === undefined ? "" : scheme[definition.name],
|
|
378
|
-
definition.allowedTokens,
|
|
379
|
-
`footerSettings.${definition.scheme}.${definition.name}`,
|
|
380
|
-
);
|
|
381
401
|
}
|
|
382
|
-
return
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
: {},
|
|
390
|
-
);
|
|
391
|
-
for (const scheme of ["light", "dark"]) {
|
|
392
|
-
next[scheme] = {
|
|
393
|
-
...(next[scheme] !== null && typeof next[scheme] === "object" && !Array.isArray(next[scheme])
|
|
394
|
-
? next[scheme]
|
|
395
|
-
: {}),
|
|
396
|
-
...colors[scheme],
|
|
397
|
-
};
|
|
398
|
-
}
|
|
399
|
-
return next;
|
|
402
|
+
return Object.fromEntries(APPEARANCE_FOOTER_FIELDS.map(definition => [
|
|
403
|
+
definition.name,
|
|
404
|
+
validateScalar(
|
|
405
|
+
{ ...definition, path: `footerSettings.${definition.name}` },
|
|
406
|
+
workspaceFooter[definition.name] === undefined ? definition.default : workspaceFooter[definition.name],
|
|
407
|
+
),
|
|
408
|
+
]));
|
|
400
409
|
}
|
package/src/atomic-file.js
CHANGED
|
@@ -90,7 +90,8 @@ export async function atomicWriteFile(filePath, contents, {
|
|
|
90
90
|
throw failures.notRegular();
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
// A valid destination filename can already use the filesystem's full limit.
|
|
94
|
+
const temporaryPath = path.join(directory, `.taproot-site-${randomUUID()}.tmp`);
|
|
94
95
|
let handle;
|
|
95
96
|
let renamed = false;
|
|
96
97
|
try {
|
package/src/changelog.json
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
|
+
{
|
|
4
|
+
"version": "0.40.0",
|
|
5
|
+
"note": "Choose a theme context and logo artwork independently for the header and footer, with an offline warning when the selected artwork may be hard to see.",
|
|
6
|
+
"behavior": [
|
|
7
|
+
"The bundled Espalier is 7.1.1. Header and footer contexts reach their controls and navigation, and panel menus keep a full-screen dismissing scrim. The default site theme is unchanged apart from its Espalier version.",
|
|
8
|
+
"Header context and footerSettings.context select a context declared in both theme schemes. Empty uses the root colors. Theme push saves both contexts with the theme atomically; footer push preserves them.",
|
|
9
|
+
"The five footer color overrides in each scheme are retired. Before this API release deploys, pull every site with custom footer colors using the previous CLI and preserve those values. After upgrading, pull again and recreate the colors as a context in both theme schemes. Old color keys are refused with their field paths.",
|
|
10
|
+
"Header logoVariant and footerSettings.logoVariant accept empty, light or dark. Empty follows the page scheme; light and dark select that artwork in both schemes. Header and footer select independently, including compact header artwork and per-scheme footer overrides. Theme push owns these choices; footer push preserves them, logo ids, scale, box and alignment.",
|
|
11
|
+
"Offline validation adds the warning brand.logo_on_surface when the selected artwork is likely hard to see on its resolved surface and another choice selects different artwork. It uses theme brightness and artwork identity, not image pixels or background images. Unavailable theme engines and surfaces with no meaningful alternative are skipped; warnings never block a save.",
|
|
12
|
+
"Workspace manifests now use version 8. Footer concurrency uses footer-draft-v8, footer content uses footer-content-v3, and atomic presentation revisions use site-presentation-v2. Upgrade and pull again before validating, planning or pushing an older workspace.",
|
|
13
|
+
"The help reference version is 61."
|
|
14
|
+
],
|
|
15
|
+
"help": [
|
|
16
|
+
"theme",
|
|
17
|
+
"appearance",
|
|
18
|
+
"footer"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"version": "0.39.0",
|
|
23
|
+
"note": "Set footer widths, responsive alignment and artwork space, choose independent logos and scale, and check whether words fit before saving.",
|
|
24
|
+
"behavior": [
|
|
25
|
+
"The bundled Espalier is 7.1.0, with independent footer logos, logo-only scaling and responsive footer alignment.",
|
|
26
|
+
"Footer settings accept brandSpan (1–3), asideSpan (1–2), brandSize (standard or large) for text, and span (1–2) on each link column. Omitted spans are 1 and an omitted or empty brandSize is standard. There is no total track limit.",
|
|
27
|
+
"logoScale independently sizes the footer logo from \"1.0\" through \"5.0\" in 0.1 steps. It must be a string; empty and \"1\" normalize to \"1.0\". Old absent or null values migrate to \"1.5\" for large text, otherwise \"1.0\"; pull and footer push materialize the scale, so later text-size edits keep the logo size.",
|
|
28
|
+
"Each footer scheme accepts a site-owned PNG/WebP logoId. Empty independently inherits that scheme's site logo. logoUrl is read-only metadata, excluded from requests and concurrency hashing. Footer push owns logo ids and scale; theme push still owns only the ten footer colors and preserves all other footer content.",
|
|
29
|
+
"Sparse alignment, brandAlignment, asideAlignment and column alignment profiles accept wide, wrapped (Brand row) and stacked horizontal/vertical/textAlign choices. bottomAlignment omits vertical. Empty axes inherit; start/center/end retain intent. Text also accepts auto to follow horizontal placement and justify for prose only. The active layout tries the region then footer default before searching wider layouts; invalid, padded, non-string and wrong-axis choices are refused.",
|
|
30
|
+
"logoBox natural fits constrained artwork dimensions and its reservation without cropping transparent padding. Fixed preserves scaled height, including spare image-box space; omitted, null or empty means fixed. Footer push owns every profile and logoBox. Theme push preserves them, explicit auto and all logo content, and refuses unsaved local content under the unchanged footer-content-v2 baseline.",
|
|
31
|
+
"validate and footer push report footer.word_breaks warnings at five widths, including Small phone (320px) and settings-only managed Docs workspaces. At most 12 footer findings are shown, with their true count; warnings never block a push. Generated default-font metrics and bounded break opportunities guide the estimate; custom fonts or scale may differ, and Han, Kana or Thai fragments are skipped. Logo proportions are unknown to the CLI, so a narrow logo can lead to extra brand warnings. Deployment checks cover standard and profile sites.",
|
|
32
|
+
"The footer concurrency hash is now footer-draft-v7, including logoBox and sparse profiles without expanding inherited choices. Upgrade to the latest CLI and pull again before pushing an existing workspace.",
|
|
33
|
+
"Pull can write a page whose source filename reaches the filesystem's filename limit; atomic temporary names no longer grow with the page slug.",
|
|
34
|
+
"The help reference version is 60."
|
|
35
|
+
],
|
|
36
|
+
"help": [
|
|
37
|
+
"footer"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
3
40
|
{
|
|
4
41
|
"version": "0.38.1",
|
|
5
42
|
"note": "Uses Espalier 6.15.1, whose header controls stay in place during pointer activation.",
|
package/src/cli.js
CHANGED
|
@@ -519,7 +519,7 @@ const VERBS = Object.freeze([
|
|
|
519
519
|
tokens: ["plan"],
|
|
520
520
|
summary: "Check the whole workspace against the live site and order what is left to send. Writes nothing.",
|
|
521
521
|
note: "Runs every check the pushes run — each page against the site's pages, revisions, videos and forms; media that "
|
|
522
|
-
+ "pages reference and media upload has not sent; the theme, appearance and
|
|
522
|
+
+ "pages reference and media upload has not sent; the theme, appearance, surface contexts and logo variants against the site's "
|
|
523
523
|
+ "presentation revision; the footer against its draft; navigation against the live page list and the revision pull recorded (an unchanged tree under a stale revision is listed ready with settlesLostPush, so apply settles a push whose answer was lost) — and lists "
|
|
524
524
|
+ "every problem with its area, file, code and field. It then orders the steps that remain: media upload, "
|
|
525
525
|
+ "pages push, footer push (theme push refuses unsaved footer content), theme push, nav push, each marked "
|
|
@@ -689,7 +689,7 @@ const VERBS = Object.freeze([
|
|
|
689
689
|
summary: "Validate and push the workspace's complete theme and appearance settings in one atomic save.",
|
|
690
690
|
note: "Run pull first. Theme JSON stays decoded in the workspace; this command validates the complete light/dark"
|
|
691
691
|
+ " pair and encodes it only at the API boundary. Image settings reference site-owned image IDs from media upload. "
|
|
692
|
-
+ "The complete change set — both themes, the appearance scalars, and the
|
|
692
|
+
+ "The complete change set — both themes, the appearance scalars, and the header/footer contexts and logo variants — is saved in "
|
|
693
693
|
+ "one transaction fenced by the presentation revision pull recorded: a concurrent change to any of those "
|
|
694
694
|
+ "fields refuses the whole push (theme.concurrent_modification) and nothing is written. A save whose response "
|
|
695
695
|
+ "was lost is replayed safely; the site answers applied=false when it already holds the change set. "
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sharedDeclaredThemeContextNames } from "../theme-contexts.js";
|
|
1
2
|
import registry from "./free-form-section-registry.json" with { type: "json" };
|
|
2
3
|
import { imageDescriptionIssues, pickImageDescriptionFields } from "./image-description-validation.js";
|
|
3
4
|
|
|
@@ -538,9 +539,7 @@ export function normalizeFreeFormSectionDecoration(
|
|
|
538
539
|
|
|
539
540
|
/** The exact, sorted context names present in both staged site themes. */
|
|
540
541
|
export function sharedThemeContextNames(lightTheme, darkTheme) {
|
|
541
|
-
|
|
542
|
-
const dark = isPlainObject(darkTheme?.contexts) ? darkTheme.contexts : {};
|
|
543
|
-
return Object.freeze(Object.keys(light).filter((name) => Object.hasOwn(dark, name)).sort());
|
|
542
|
+
return Object.freeze(sharedDeclaredThemeContextNames(lightTheme, darkTheme));
|
|
544
543
|
}
|
|
545
544
|
|
|
546
545
|
/**
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Generated from shared/display-scale.ts by scripts/sync-field-validation.mjs. Do not edit.
|
|
2
|
+
export const DISPLAY_SCALE_LIMITS = Object.freeze({ minimum: 1, maximum: 5, step: 0.1 });
|
|
3
|
+
const NORMAL_SCALE = Object.freeze({ tenths: 10, scale: 1, canonical: "1.0" });
|
|
4
|
+
const DISPLAY_SCALE = /^(?:[1-4](?:\.[0-9])?|5(?:\.0)?)$/u;
|
|
5
|
+
/** Parse authored tenths without floating-point remainder or whitespace normalization. */
|
|
6
|
+
export function parseDisplayScale(value) {
|
|
7
|
+
if (value === undefined || value === "")
|
|
8
|
+
return NORMAL_SCALE;
|
|
9
|
+
if (typeof value !== "string" || DISPLAY_SCALE.exec(value)?.[0] !== value)
|
|
10
|
+
return null;
|
|
11
|
+
const whole = value.charCodeAt(0) - 48;
|
|
12
|
+
const fraction = value.length === 3 ? value.charCodeAt(2) - 48 : 0;
|
|
13
|
+
const tenths = whole * 10 + fraction;
|
|
14
|
+
return tenths === 10
|
|
15
|
+
? NORMAL_SCALE
|
|
16
|
+
: Object.freeze({ tenths, scale: tenths / 10, canonical: `${whole}.${fraction}` });
|
|
17
|
+
}
|