@taprootio/site-authoring 0.39.0 → 0.41.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 +62 -22
- package/examples/riverbend-wellness/manifest.fixture.json +1 -1
- package/examples/riverbend-wellness/settings/site-publishing-preferences.json +0 -10
- package/package.json +2 -2
- package/src/api.js +4 -5
- package/src/appearance-contract.js +64 -55
- package/src/changelog.json +33 -0
- package/src/cli.js +2 -2
- package/src/content/components.js +36 -2
- package/src/content/free-form-sections.js +2 -3
- package/src/content/testimonial-google-reviews.js +140 -10
- package/src/footer-brand-inputs.js +12 -5
- package/src/footer-branding.js +11 -5
- package/src/footer-content.js +10 -0
- package/src/footer-contract.js +52 -42
- package/src/footer-draft-hash.js +8 -27
- package/src/footer-workspace.js +4 -6
- package/src/header-presentation.js +13 -0
- package/src/logo-inputs.js +38 -0
- package/src/logo-surface-checks.js +67 -0
- package/src/presentation-reference.js +70 -62
- 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 +31 -1
- package/src/site-check-rules.json +2 -1
- 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 +9 -9
- package/src/verbs/plan.js +2 -2
- package/src/verbs/theme-push.js +46 -41
- package/src/verbs/validate.js +20 -10
- 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.
|
|
@@ -183,11 +183,11 @@ Desktop, Small desktop, Tablet, Phone and Small phone (320px). They show at most
|
|
|
183
183
|
metrics, type scale and gaps are assumed; custom fonts or scale may differ.
|
|
184
184
|
Supported whitespace, hyphen and zero-width breaks are estimated, with bounded
|
|
185
185
|
contextual shaping; fragments containing Han, Kana or Thai are skipped.
|
|
186
|
-
Unknown
|
|
186
|
+
Local upload dimensions follow the selected footer artwork. Unknown proportions
|
|
187
187
|
use the 4:1 maximum, so a narrow logo can produce extra brand warnings.
|
|
188
188
|
Warnings allow the push. Managed Docs workspaces get the same check; deployment
|
|
189
189
|
checks cover standard and profile sites. Footer overrides count as logos even without
|
|
190
|
-
a site logo. After upgrading to
|
|
190
|
+
a site logo. After upgrading to the v8 footer hash
|
|
191
191
|
contract, pull again before pushing.
|
|
192
192
|
|
|
193
193
|
`validate` also runs the site checks that need nothing but the workspace, from
|
|
@@ -352,12 +352,12 @@ explicitly and bypasses discovery. `login`, `logout`, `sites`, `use`,
|
|
|
352
352
|
}
|
|
353
353
|
```
|
|
354
354
|
|
|
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.
|
|
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. |
|
|
361
361
|
|
|
362
362
|
The file is a small, closed JSON object. Unknown fields, duplicate keys, links
|
|
363
363
|
in the path, and unsupported versions are refused before any credential is
|
|
@@ -418,7 +418,7 @@ each step names the reference it relies on.
|
|
|
418
418
|
`theme push --dry-run` reads the site and lists the JSON paths at which
|
|
419
419
|
each settings file differs from it, and whether the baseline `pull`
|
|
420
420
|
recorded is still current; `theme push` saves both themes, the appearance
|
|
421
|
-
scalars
|
|
421
|
+
scalars, header/footer contexts and logo variants in one transaction fenced by
|
|
422
422
|
that baseline. A concurrent change to any of those fields refuses the
|
|
423
423
|
whole push (`theme.concurrent_modification`) and nothing is written: keep
|
|
424
424
|
copies of the edited files, pull, re-apply, push again. A lost response is
|
|
@@ -426,8 +426,17 @@ each step names the reference it relies on.
|
|
|
426
426
|
`theme push` again with the same files replays it under its original
|
|
427
427
|
baseline, and the site answers `applied: false` when it already holds the
|
|
428
428
|
change set. `pull` reads the four settings documents and the revision
|
|
429
|
-
from one snapshot
|
|
430
|
-
|
|
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.
|
|
431
440
|
6. **Review on staging in both schemes.** `staging review` (or
|
|
432
441
|
`deploy --staging --handoff`) returns a single-use handoff in
|
|
433
442
|
`stagingPreview.url`, on a managed Docs site too; open it once and use the
|
|
@@ -534,7 +543,7 @@ Markdown subset accepts levels 1 to 4.
|
|
|
534
543
|
A `.pm.json` page's title, path, description and author live in the workspace
|
|
535
544
|
manifest rather than the file. `pages meta set <path> --title <text>
|
|
536
545
|
--description <text>` changes the title or description there (a Markdown page
|
|
537
|
-
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`
|
|
538
547
|
sends it, and a site edit to the same page conflicts only while that edit is unpushed
|
|
539
548
|
(`pages.pull_conflict`; see the pull rule above). A
|
|
540
549
|
description over 160 characters is a warning (`descriptionWarnings`), because
|
|
@@ -551,6 +560,7 @@ section. The regions stack in source order when the section is too narrow.
|
|
|
551
560
|
:::section {}
|
|
552
561
|
:::columns {"ratio":"40-60"}
|
|
553
562
|
:::column {}
|
|
563
|
+
|
|
554
564
|
## Start a conversation
|
|
555
565
|
|
|
556
566
|
Tell us about your project.
|
|
@@ -1280,7 +1290,10 @@ The same ProseMirror node is:
|
|
|
1280
1290
|
"cite": "https://www.huxley.net/bnw/four.html"
|
|
1281
1291
|
},
|
|
1282
1292
|
"content": [
|
|
1283
|
-
{
|
|
1293
|
+
{
|
|
1294
|
+
"type": "paragraph",
|
|
1295
|
+
"content": [{ "type": "text", "text": "Words can be like X-rays." }]
|
|
1296
|
+
}
|
|
1284
1297
|
]
|
|
1285
1298
|
}
|
|
1286
1299
|
```
|
|
@@ -1302,7 +1315,7 @@ tracked-Markdown conflict, and a stale push is refused. There is no reverse
|
|
|
1302
1315
|
Markdown exporter. See `taproot-site help page free-form` for the closed attrs
|
|
1303
1316
|
reference and examples.
|
|
1304
1317
|
|
|
1305
|
-
### Testimonial Google reviews in 0.38.0
|
|
1318
|
+
### Testimonial Google reviews in 0.38.0 and 0.41.0
|
|
1306
1319
|
|
|
1307
1320
|
A Testimonial block can show the site's selected Google reviews instead of
|
|
1308
1321
|
hand-written quotes. In its component data set `"source": "google-reviews"` and
|
|
@@ -1314,12 +1327,39 @@ hand-written `items`. The `items` are kept in the data whichever source is set.
|
|
|
1314
1327
|
`source` and `maxItems` are refused at their field path when the value is
|
|
1315
1328
|
unknown or out of range.
|
|
1316
1329
|
|
|
1330
|
+
From 0.41.0 a block can show particular reviews: set `"reviewSelection":
|
|
1331
|
+
"chosen"` and list the reviews in `"reviewIds"`, at most 12 review ids. They are
|
|
1332
|
+
shown in the listed order and `maxItems` is ignored. A chosen review keeps showing
|
|
1333
|
+
after it passes the newest 200 (a site keeps up to 200 such older reviews across
|
|
1334
|
+
all its pages, and the oldest of them stop showing if pages chose more), and is
|
|
1335
|
+
left out of the page when it is hidden, below the minimum rating, without text or
|
|
1336
|
+
deleted at Google. Omit
|
|
1337
|
+
`reviewSelection`, or use `"newest"`, for the newest reviews; the ids are kept in
|
|
1338
|
+
the data and not used. No command lists reviews, so an id comes from a page that
|
|
1339
|
+
was pulled after someone chose reviews in the app: copy it exactly as pulled. An
|
|
1340
|
+
unknown `reviewSelection`, more than 12 ids and an id that is not 1 to 256 letters,
|
|
1341
|
+
digits, underscores or hyphens are refused at their field path.
|
|
1342
|
+
|
|
1343
|
+
Also from 0.41.0 two switches, both `true` or `false` (anything else is refused at
|
|
1344
|
+
its field path, and omitted is `false`). `"showAll": true` lists every review that
|
|
1345
|
+
can be shown, up to the newest 200, in a grid on a page of its own, such as one
|
|
1346
|
+
titled Reviews, each with its star rating written out and the owner's reply; it
|
|
1347
|
+
ignores `maxItems` and `carousel` (the carousel setting is kept in the data and not
|
|
1348
|
+
used) and does nothing beside chosen reviews. `"showProfileSummary": true` shows
|
|
1349
|
+
Google's average rating and total number of reviews above the reviews, with a link
|
|
1350
|
+
to read all reviews on Google and, when Google provides one, a link to write a
|
|
1351
|
+
review, and works with either selection. Reviews hidden in Marketing, reviews
|
|
1352
|
+
without text and reviews below the minimum rating stay off the list. The figures
|
|
1353
|
+
are as of the last time Taproot checked Google, once a day, and a page that shows
|
|
1354
|
+
them is published again when Google's average rating or total number of reviews changes.
|
|
1355
|
+
|
|
1317
1356
|
Which reviews are selected, and the minimum star rating, are set by someone who
|
|
1318
1357
|
can manage the site's settings in the app under **Marketing → Google reviews**;
|
|
1319
1358
|
they are not in the pulled workspace. The site needs a connected Google profile.
|
|
1320
1359
|
Until it has reviews to show, a Google Testimonial publishes as empty. A release
|
|
1321
|
-
takes the reviews as they are when it is published.
|
|
1322
|
-
|
|
1360
|
+
takes the reviews as they are when it is published. A quotation's own line breaks
|
|
1361
|
+
are kept as line breaks on the published page. Help reference version 62 covers
|
|
1362
|
+
the fields in `taproot-site help component testimonial`.
|
|
1323
1363
|
|
|
1324
1364
|
### What changed between releases
|
|
1325
1365
|
|
|
@@ -27,11 +27,6 @@
|
|
|
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",
|
|
@@ -41,11 +36,6 @@
|
|
|
41
36
|
"logoId": "a0000000-0000-4000-8000-0000000000a0"
|
|
42
37
|
},
|
|
43
38
|
"dark": {
|
|
44
|
-
"backgroundColor": "--esp-color-layer-1",
|
|
45
|
-
"textColor": "--esp-color-text",
|
|
46
|
-
"headingColor": "--esp-color-headings",
|
|
47
|
-
"linkColor": "--esp-color-link",
|
|
48
|
-
"linkHoverColor": "--esp-color-link-hover",
|
|
49
39
|
"backgroundImageId": "",
|
|
50
40
|
"backgroundImageOpacity": 0,
|
|
51
41
|
"backgroundPresentation": "FOOTER_BACKGROUND_PRESENTATION_COVER",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taprootio/site-authoring",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.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": "7.1.
|
|
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/changelog.json
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
|
+
{
|
|
4
|
+
"version": "0.41.0",
|
|
5
|
+
"note": "A Google Testimonial can show particular reviews (reviewSelection and reviewIds), list every review with showAll, and show Google's rating and links with showProfileSummary. A quotation's own line breaks are kept on the published page.",
|
|
6
|
+
"behavior": [
|
|
7
|
+
"Testimonial component data accepts reviewSelection (newest or chosen) and reviewIds (at most 12 review ids, each 1 to 256 letters, digits, underscores or hyphens). Omitted reviewSelection is newest, so every existing page is unchanged. Other values, more than 12 ids and a malformed id are refused at the field path before saving.",
|
|
8
|
+
"With reviewSelection chosen and source google-reviews the published page shows the listed reviews in the listed order, ignoring maxItems, and leaves out one that is hidden, below the minimum rating, without text or deleted at Google. A chosen review keeps showing after it passes the newest 200, up to 200 such older reviews across all the pages of a site: if pages chose more, the oldest of them stop showing. The ids stay in the data while reviewSelection is newest.",
|
|
9
|
+
"No command lists reviews: an id comes from a page that was pulled after someone chose reviews in the app. Copy it exactly as pulled.",
|
|
10
|
+
"Testimonial component data accepts showAll and showProfileSummary, each true or false (anything else is refused at the field path before saving, and omitted is false). With source google-reviews and the newest selection, showAll true lists every review that can be shown, up to the newest 200, in a grid with each star rating written out and the owner's reply, ignoring maxItems and carousel; beside chosen reviews it does nothing. showProfileSummary true shows Google's average rating and total above the reviews with links to read and to write reviews, with either selection. The published page follows both by itself, and is published again when Google's average rating or total number of reviews changes.",
|
|
11
|
+
"A quotation's own line breaks, and a Google review's, are kept as line breaks on the published page after its next publish.",
|
|
12
|
+
"The help reference version is 62."
|
|
13
|
+
],
|
|
14
|
+
"help": [
|
|
15
|
+
"component"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"version": "0.40.0",
|
|
20
|
+
"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.",
|
|
21
|
+
"behavior": [
|
|
22
|
+
"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.",
|
|
23
|
+
"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.",
|
|
24
|
+
"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.",
|
|
25
|
+
"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.",
|
|
26
|
+
"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.",
|
|
27
|
+
"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.",
|
|
28
|
+
"The help reference version is 61."
|
|
29
|
+
],
|
|
30
|
+
"help": [
|
|
31
|
+
"theme",
|
|
32
|
+
"appearance",
|
|
33
|
+
"footer"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
3
36
|
{
|
|
4
37
|
"version": "0.39.0",
|
|
5
38
|
"note": "Set footer widths, responsive alignment and artwork space, choose independent logos and scale, and check whether words fit before saving.",
|
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. "
|
|
@@ -22,7 +22,13 @@ import {
|
|
|
22
22
|
} from "./vocabulary.js";
|
|
23
23
|
import { normalizeCssLengthOverride } from "./media-presentation.js";
|
|
24
24
|
import { isVideoEmbedId, parseVideoEmbedUrl, VIDEO_EMBED_REFUSAL } from "./video-embed-url.js";
|
|
25
|
-
import {
|
|
25
|
+
import {
|
|
26
|
+
REVIEW_ID_PATTERN,
|
|
27
|
+
TESTIMONIAL_MAX_CHOSEN_REVIEWS,
|
|
28
|
+
TESTIMONIAL_MAX_ITEMS,
|
|
29
|
+
TESTIMONIAL_REVIEW_SELECTIONS,
|
|
30
|
+
TESTIMONIAL_SOURCES,
|
|
31
|
+
} from "./testimonial-google-reviews.js";
|
|
26
32
|
|
|
27
33
|
/**
|
|
28
34
|
* The eight canonical `componentBlock` data shapes. Seven remain mirrored
|
|
@@ -216,8 +222,29 @@ const TESTIMONIAL = Object.freeze({
|
|
|
216
222
|
integer: true,
|
|
217
223
|
minimum: TESTIMONIAL_MAX_ITEMS.minimum,
|
|
218
224
|
maximum: TESTIMONIAL_MAX_ITEMS.maximum,
|
|
219
|
-
description:
|
|
225
|
+
description:
|
|
226
|
+
"How many Google reviews to show, newest first. Used only when source is google-reviews, reviewSelection is newest and showAll is not true.",
|
|
220
227
|
}),
|
|
228
|
+
reviewSelection: described(
|
|
229
|
+
enumOf(...TESTIMONIAL_REVIEW_SELECTIONS),
|
|
230
|
+
"newest shows the newest selected reviews, as many as maxItems says (up to the newest 200 reviews that can be shown when showAll is true). chosen shows the reviews listed in reviewIds, in that order, and ignores maxItems. Used only when source is google-reviews. Omitted is newest.",
|
|
231
|
+
),
|
|
232
|
+
reviewIds: described(
|
|
233
|
+
list(boundedStr(256, {
|
|
234
|
+
pattern: REVIEW_ID_PATTERN,
|
|
235
|
+
patternSource: REVIEW_ID_PATTERN.source,
|
|
236
|
+
patternDescription: "1 to 256 letters, digits, underscores or hyphens",
|
|
237
|
+
}), { maxItems: TESTIMONIAL_MAX_CHOSEN_REVIEWS }),
|
|
238
|
+
"The Google reviews a chosen component shows, by review id, at most 12. No command lists reviews: an id comes from a page that was pulled after someone chose reviews in the app, so copy it as it is. A chosen review that is hidden, below the minimum rating, without text or deleted at Google is left out of the page. Kept, and not used, while reviewSelection is newest.",
|
|
239
|
+
),
|
|
240
|
+
showAll: described(
|
|
241
|
+
bool(),
|
|
242
|
+
"true lists every review that can be shown, up to the newest 200, in a grid, each with its star rating written out and the owner's reply, and ignores maxItems and carousel (a carousel setting is kept in the data and not used). Used only when source is google-reviews and reviewSelection is newest; beside chosen reviews it does nothing. Omitted is false.",
|
|
243
|
+
),
|
|
244
|
+
showProfileSummary: described(
|
|
245
|
+
bool(),
|
|
246
|
+
"true shows Google's average rating and total number of reviews above the reviews, with a link to read all reviews on Google and, when Google provides one, a link to write a review. Used only when source is google-reviews, with either selection. Omitted is false.",
|
|
247
|
+
),
|
|
221
248
|
items: withOmission(
|
|
222
249
|
list(shape({
|
|
223
250
|
quote: str(),
|
|
@@ -666,6 +693,10 @@ const COMPONENT_DEFINITIONS = Object.freeze({
|
|
|
666
693
|
{
|
|
667
694
|
source: "manual",
|
|
668
695
|
maxItems: TESTIMONIAL_MAX_ITEMS.default,
|
|
696
|
+
reviewSelection: "newest",
|
|
697
|
+
reviewIds: [],
|
|
698
|
+
showAll: false,
|
|
699
|
+
showProfileSummary: false,
|
|
669
700
|
items: [{ quote: "", authorName: "", authorTitle: "", authorImage: null }],
|
|
670
701
|
columns: 1,
|
|
671
702
|
carousel: false,
|
|
@@ -679,6 +710,9 @@ const COMPONENT_DEFINITIONS = Object.freeze({
|
|
|
679
710
|
"Set carousel:true for directional previous/next arrows, dot navigation and a play/pause control. Navigation or keyboard focus pauses rotation; reduced-motion users get manual navigation without sliding or automatic rotation.",
|
|
680
711
|
"Use real attributed reviews, or clearly label fictional demo reviews. Never imply invented testimonials are genuine customer endorsements.",
|
|
681
712
|
"Set source:\"google-reviews\" only for a site with a connected Google profile; the published page shows the selected reviews with their reviewer names and a link to read all reviews on Google, and shows nothing until the profile has reviews it can show.",
|
|
713
|
+
"A Google Testimonial shows the newest reviews unless reviewSelection is \"chosen\". Choose reviews in the app: it writes their ids into reviewIds, and a pulled page carries them. Keep an id exactly as pulled, because no command lists reviews and a made-up id shows nothing.",
|
|
714
|
+
"A quotation's own line breaks are kept on the published page.",
|
|
715
|
+
"Set showAll:true on a Google Testimonial with the newest selection to list up to the newest 200 reviews that can be shown on a page of its own, such as one titled Reviews; reviews hidden in Marketing, without text or below the minimum rating stay off it. Set showProfileSummary:true to show Google's average rating and total number of reviews above the reviews, with links to read and to write reviews.",
|
|
682
716
|
],
|
|
683
717
|
{
|
|
684
718
|
items: [{
|
|
@@ -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
|
/**
|