@certrev/cert-block 1.2.0-canary.4 → 1.2.0-canary.6
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 +74 -0
- package/README.md +44 -1
- package/dist/builder/cert-review-card.d.ts +18 -0
- package/dist/builder/cert-review-card.d.ts.map +1 -1
- package/dist/builder/cert-review-card.js +56 -10
- package/dist/builder/cert-review-card.js.map +1 -1
- package/dist/builder/index.d.ts +1 -0
- package/dist/builder/index.d.ts.map +1 -1
- package/dist/builder/index.js +2 -0
- package/dist/builder/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/verify/get-verified-delivery.d.ts +44 -6
- package/dist/verify/get-verified-delivery.d.ts.map +1 -1
- package/dist/verify/get-verified-delivery.js +60 -6
- package/dist/verify/get-verified-delivery.js.map +1 -1
- package/package.json +1 -1
- package/src/builder/cert-review-card.tsx +82 -11
- package/src/builder/index.tsx +3 -0
- package/src/index.ts +3 -0
- package/src/verify/get-verified-delivery.ts +75 -9
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,80 @@ change the rendered cert output and never break a compiling integration** (regis
|
|
|
5
5
|
exports, types). Anything that would alter what a visitor sees, or require integration changes,
|
|
6
6
|
is announced loudly here first.
|
|
7
7
|
|
|
8
|
+
## 1.2.0-canary.6 · 2026-10-06
|
|
9
|
+
|
|
10
|
+
Still on the `canary` dist-tag. It lets the reader sidebar card's float out of its Builder block, so on a Builder
|
|
11
|
+
page the sidebar sits in the article column the way it does on a WordPress or Shopify page (the judge's round 11:
|
|
12
|
+
all 80 `sidebar.*.desktop` cells failed placement). **Only a reader face's output changes**, by one element. Every
|
|
13
|
+
other face, the options-only card, a revoked or failed card, the stylesheet, the modal, `CERT_FONT_FACE_CSS` and
|
|
14
|
+
`@certrev/cert-contract` are byte for byte as in canary.5. No integration needs a code change.
|
|
15
|
+
|
|
16
|
+
- **Cause.** Builder serves a page's blocks as a flex column (`.builder-blocks`), and each block
|
|
17
|
+
(`.builder-block`) is a flex item, which is a formatting context of its own. A formatting context contains a
|
|
18
|
+
float. So the block around a sidebar card spanned the whole column at the aside's height (at 1280: 1208 px wide,
|
|
19
|
+
the aside plus its 2 px and 18 px margins tall), and no copy could sit beside the aside.
|
|
20
|
+
- **Fix.** A reader face paints one more element, right after its wrapper: `<style data-certrev-builder-flow="">`
|
|
21
|
+
holding `BUILDER_SIDEBAR_FLOW_CSS`. Its three rules apply only above the reader CSS's own stacking breakpoint
|
|
22
|
+
(`@media not all and (max-width: 820px)`, the complement of the reader CSS's `(max-width: 820px)`), and only in a
|
|
23
|
+
Builder column that holds a reader SIDEBAR card as `.builder-blocks > .builder-block > [data-certrev-face="reader"]
|
|
24
|
+
> .certrev-reader > .certrev-r-side`:
|
|
25
|
+
- that column becomes `display: flow-root`, so it lays its blocks out as blocks and still contains the float;
|
|
26
|
+
- the card's block and the face's wrapper become `display: block`, so they take no height, and the aside is
|
|
27
|
+
the box the copy flows around.
|
|
28
|
+
|
|
29
|
+
A column with no reader sidebar (a banner, a floating pill, a legacy face), a card that is not a direct child of
|
|
30
|
+
a Builder block, the stacked widths, and a browser with no `:has()` keep exactly the layout they had. In the
|
|
31
|
+
column the rules do apply, its blocks lay out as blocks rather than flex items: `align-self` on a block there has
|
|
32
|
+
no effect, and vertical margins between blocks collapse.
|
|
33
|
+
- **Export.** `BUILDER_SIDEBAR_FLOW_CSS` from `./builder/cert-review-card` (not re-exported from `.` or `./builder`).
|
|
34
|
+
- **Tests.** `reader-face-sidebar-flow.test.tsx` (new) pins:
|
|
35
|
+
- that every reader face paints the rules once, after its wrapper, unescaped;
|
|
36
|
+
- that no other face and no options-only or revoked card paints them;
|
|
37
|
+
- that the breakpoint is read from the reader CSS;
|
|
38
|
+
- that the rules set only `display`;
|
|
39
|
+
- which elements the rules select in a page shaped as Builder serves it.
|
|
40
|
+
|
|
41
|
+
`reader-face-card.test.tsx` and `reader-face-card-hydrate.test.tsx` now count the second style element. Hydration
|
|
42
|
+
keeps both style nodes in place, with no mismatch, and a revocation removes both.
|
|
43
|
+
|
|
44
|
+
## 1.2.0-canary.5 · 2026-10-06
|
|
45
|
+
|
|
46
|
+
Minor, still on the `canary` dist-tag. It adds a design pin for CertREV's own canary replica (the judge's Part 3,
|
|
47
|
+
route a). **Output without a pin is unchanged.** A card with no pin reads the same Delivery URL, under the same
|
|
48
|
+
cache key, and paints the same bytes as canary.4. The faces, the stylesheet, the modal, `CERT_FONT_FACE_CSS` and
|
|
49
|
+
`@certrev/cert-contract` are as they were. No integration needs a code change, and production brands never send
|
|
50
|
+
a pin.
|
|
51
|
+
|
|
52
|
+
- **The pin.** Builder `<Content>`'s `context` prop may carry `certrevDesignPin` (`{ design, designBrand? }`).
|
|
53
|
+
The card reads it from `builderContext.context`. A pinned card reads
|
|
54
|
+
`<base>/api/cert/v1/delivery/builder/<entryId>?design=<version>[&designBrand=<brandKey>]`. The version must
|
|
55
|
+
match `/^[1-9][0-9]{0,8}$/` and the brand `/^[a-z0-9](?:[a-z0-9-]{0,98}[a-z0-9])?$/`; the brand is sent
|
|
56
|
+
URL-encoded. The pinned read gets its own cache entry and suspense key.
|
|
57
|
+
- **Fail-closed.** A pinned card paints only a reader def (`face: 'reader'`) at exactly the pinned version, and
|
|
58
|
+
never the live design in its place. Each of these renders nothing:
|
|
59
|
+
- a pin that cannot be read, with no fetch;
|
|
60
|
+
- a pin on a block without the `delivery` marker, with no fetch;
|
|
61
|
+
- a 404 (`no_design`) or 503 from the API;
|
|
62
|
+
- any other def: none, malformed, legacy, an unknown face, or another version.
|
|
63
|
+
|
|
64
|
+
A missing pin is `undefined` or `null`, including a missing or empty `context`. Such a card is the unpinned
|
|
65
|
+
card.
|
|
66
|
+
- **API.** These are new on `.` and `./builder`:
|
|
67
|
+
- `DesignPin` (`{ version, brand? }`);
|
|
68
|
+
- `parseDesignPin(raw)`, which returns a `DesignPin`, `'invalid'` or `undefined`;
|
|
69
|
+
- `designPinFromUrl(url)`, which returns `{ design, designBrand? }` from a URL's query, or `undefined`, and
|
|
70
|
+
never throws.
|
|
71
|
+
|
|
72
|
+
`GetVerifiedDeliveryOptions` gains an optional `design`. `deliveryUrl`, `deliveryCacheKey`,
|
|
73
|
+
`peekVerifiedDelivery` and `invalidateDelivery` take it. Without it, they build exactly what canary.4 built.
|
|
74
|
+
- **Tests.** There are two new files:
|
|
75
|
+
- `design-pin-card.test.tsx`, which covers the card through the real delivery path;
|
|
76
|
+
- `design-pin-card-use.test.tsx`, which covers the React 19 `use` path, with one promise per read.
|
|
77
|
+
|
|
78
|
+
`get-verified-delivery.test.ts` adds the pinned URL, key and cache, and the grammar tables for
|
|
79
|
+
`parseDesignPin` and `designPinFromUrl`. One of those checks is that the unpinned key is unchanged. No
|
|
80
|
+
existing test changed.
|
|
81
|
+
|
|
8
82
|
## 1.2.0-canary.4 · 2026-10-05
|
|
9
83
|
|
|
10
84
|
Minor, still on the `canary` dist-tag: the judge's round 6 E1 (portal `1ff942fff6`). **Legacy output is
|
package/README.md
CHANGED
|
@@ -59,6 +59,9 @@ import { defineCertRevBadge, setCertRevKidResolver } from '@certrev/cert-block/w
|
|
|
59
59
|
|
|
60
60
|
// Builder.io registration (separate subpath; no Builder dependency)
|
|
61
61
|
import { certRevCertComponent, BUILDER_REGISTRATION, CERT_COMPONENT_NAME } from '@certrev/cert-block/builder'
|
|
62
|
+
// 1.2.0-canary.5: the design pin, for CertREV's own canary replica only (see "Design pin (staging replica)").
|
|
63
|
+
// Also on the main entry. Production brands never use it.
|
|
64
|
+
import { designPinFromUrl, parseDesignPin, type DesignPin } from '@certrev/cert-block/builder'
|
|
62
65
|
|
|
63
66
|
// The envelope face mapping on its own (separate subpath, react-free): verified envelope content
|
|
64
67
|
// plus the brand's render def, to the renderCertBlock input a `delivery`-marker card paints.
|
|
@@ -355,6 +358,46 @@ the `delivery` marker (an options-only block) never reads the envelope, so it st
|
|
|
355
358
|
with no displayed credential makes no verification claim. The writer's `<em>` under the name is the
|
|
356
359
|
envelope's `author.title`, printed only when it is non-empty.
|
|
357
360
|
|
|
361
|
+
### Design pin (staging replica)
|
|
362
|
+
|
|
363
|
+
1.2.0-canary.5. **This is for CertREV's own canary replica only; production brands never send it.** The
|
|
364
|
+
replica paints one saved design version of a brand's Appearance settings on a real Builder page, chosen by the
|
|
365
|
+
replica's own page URL. A production page passes no pin, and its card reads
|
|
366
|
+
the same URL, under the same cache key, and paints the same bytes as before.
|
|
367
|
+
|
|
368
|
+
- **The URL.** A pinned card asks the Delivery API for that design instead of the brand's live def:
|
|
369
|
+
`GET <base>/api/cert/v1/delivery/builder/<entryId>?design=<version>[&designBrand=<brandKey>]`. `version`
|
|
370
|
+
matches `/^[1-9][0-9]{0,8}$/` and `brandKey` matches `/^[a-z0-9](?:[a-z0-9-]{0,98}[a-z0-9])?$/` (sent
|
|
371
|
+
URL-encoded). The pin is part of the URL, so a pinned read has its own cache entry and its own suspense key.
|
|
372
|
+
It never shares either with the unpinned read or with another pin.
|
|
373
|
+
- **The context key.** The card never reads the page URL itself. The replica passes the pin through Builder
|
|
374
|
+
`<Content>`'s own `context` prop as `certrevDesignPin`, and the card reads
|
|
375
|
+
`builderContext.context.certrevDesignPin`. `designPinFromUrl(request.url)` builds that value from the
|
|
376
|
+
replica's own request: `{ design, designBrand? }` as strings, or `undefined` when the URL has neither param. It
|
|
377
|
+
never throws. `parseDesignPin` is the card's judge: `undefined` for no pin, a `DesignPin`
|
|
378
|
+
(`{ version, brand? }`), or `'invalid'`.
|
|
379
|
+
|
|
380
|
+
```tsx
|
|
381
|
+
import { certRevCertComponent, designPinFromUrl } from '@certrev/cert-block/builder'
|
|
382
|
+
|
|
383
|
+
const certrevDesignPin = designPinFromUrl(request.url) // in the replica's loader
|
|
384
|
+
<Content model="blog-article" content={content} apiKey={apiKey} customComponents={[certRevCertComponent]}
|
|
385
|
+
context={certrevDesignPin ? { certrevDesignPin } : {}} />
|
|
386
|
+
```
|
|
387
|
+
- **Fail-closed.** A pin never falls back to the live design. Each of these renders nothing:
|
|
388
|
+
- a pin that cannot be read. This covers a brand without a version, `0`, a leading zero, a word, an
|
|
389
|
+
upper-case or empty brand, and anything that is not a `{ design, designBrand? }` object. Nothing is
|
|
390
|
+
fetched.
|
|
391
|
+
- a pin on a block without the `delivery` marker. The options face is never the pinned design, and nothing
|
|
392
|
+
is fetched.
|
|
393
|
+
- a 404 (`no_design`) or 503 from the API, and every verdict that already suppresses an unpinned card
|
|
394
|
+
(revoked, expired, unverifiable, another entry).
|
|
395
|
+
- a def that is anything other than a **reader** def (`face: 'reader'`) at **exactly** the pinned version.
|
|
396
|
+
That includes no def, a malformed def, a legacy or unknown face, and another version.
|
|
397
|
+
|
|
398
|
+
No pin at all is `undefined` or `null`, which also covers a missing or empty `context`. In that case the
|
|
399
|
+
card is the unpinned card, byte for byte, as `src/builder/__tests__/design-pin-card.test.tsx` checks.
|
|
400
|
+
|
|
358
401
|
### PUSH trust model
|
|
359
402
|
|
|
360
403
|
Read this before choosing PUSH. The registered card is **chrome, not a verifier**, and it is a
|
|
@@ -707,7 +750,7 @@ published at `@certrev/cert-block/fixtures`).
|
|
|
707
750
|
|
|
708
751
|
## Version
|
|
709
752
|
|
|
710
|
-
`1.2.0-canary.
|
|
753
|
+
`1.2.0-canary.6`: see [CHANGELOG.md](./CHANGELOG.md) for the release history and the semver contract
|
|
711
754
|
(patch/minor never change the rendered cert output or break a compiling integration). Publishes
|
|
712
755
|
**publicly** to npm as `@certrev/cert-block` (`publishConfig.access: public`) via GitHub Actions
|
|
713
756
|
trusted publishing (OIDC); the internal `@certrev` GitHub-Packages channel mirrors it.
|
|
@@ -50,11 +50,17 @@ export interface CertReviewCardProps extends Partial<BuilderCertChromeData> {
|
|
|
50
50
|
* `shouldReceiveBuilderProps: { builderContext: true }`. Only `content.id` is read: it is the
|
|
51
51
|
* Builder entry this block renders inside, which IS the Delivery placement's `externalId`, so a
|
|
52
52
|
* block copied onto another entry asks for that entry's cert and never shows this one's.
|
|
53
|
+
*
|
|
54
|
+
* 1.2.0-canary.5: `context` is Builder `<Content>`'s own `context` prop. Only `certrevDesignPin` is read: the design
|
|
55
|
+
* pin CertREV's canary replica passes (`designPinFromUrl(request.url)`). Production brands never set it.
|
|
53
56
|
*/
|
|
54
57
|
builderContext?: {
|
|
55
58
|
readonly content?: {
|
|
56
59
|
readonly id?: unknown;
|
|
57
60
|
} | null;
|
|
61
|
+
readonly context?: {
|
|
62
|
+
readonly certrevDesignPin?: unknown;
|
|
63
|
+
} | null;
|
|
58
64
|
} | null;
|
|
59
65
|
}
|
|
60
66
|
/**
|
|
@@ -66,6 +72,18 @@ export interface CertReviewCardProps extends Partial<BuilderCertChromeData> {
|
|
|
66
72
|
export declare function acceptedDeliveryMarker(value: unknown): {
|
|
67
73
|
readonly baseUrl: string;
|
|
68
74
|
} | null;
|
|
75
|
+
/**
|
|
76
|
+
* 1.2.0-canary.6: the reader sidebar card is a right float that the article's copy flows around, as it does on a
|
|
77
|
+
* WordPress or Shopify page. On a Builder page the card sits in its own block, a flex item of the flex column that holds
|
|
78
|
+
* the page's blocks, and a flex item is a formatting context of its own: it contains the float, so the block spans the
|
|
79
|
+
* whole column at the aside's height and no copy can sit beside the aside. These rules let the float out of its block,
|
|
80
|
+
* and only there: in a column that holds a reader SIDEBAR card, at the widths where the sidebar floats (above the reader
|
|
81
|
+
* CSS's own 820px breakpoint, below which it stacks as a plain block), the column lays its blocks out as blocks and
|
|
82
|
+
* still contains the float (`flow-root`), and the card's block and the face's wrapper become plain blocks, so they take
|
|
83
|
+
* no height and the aside is the box the copy flows around. A column with no reader sidebar, the stacked widths, and a
|
|
84
|
+
* browser with no `:has()` keep exactly what they had.
|
|
85
|
+
*/
|
|
86
|
+
export declare const BUILDER_SIDEBAR_FLOW_CSS: string;
|
|
69
87
|
export declare function CertReviewCard(props: CertReviewCardProps): React.JSX.Element | null;
|
|
70
88
|
/**
|
|
71
89
|
* The subset of the Builder.io input schema this kit emits. Every field below is verified
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cert-review-card.d.ts","sourceRoot":"","sources":["../../src/builder/cert-review-card.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAE,KAAK,aAAa,EAAmB,MAAM,oCAAoC,CAAA;
|
|
1
|
+
{"version":3,"file":"cert-review-card.d.ts","sourceRoot":"","sources":["../../src/builder/cert-review-card.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAE,KAAK,aAAa,EAAmB,MAAM,oCAAoC,CAAA;AAUxF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAKlE;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,iBAAiB,CAAA;AAEjD,MAAM,WAAW,mBAAoB,SAAQ,OAAO,CAAC,qBAAqB,CAAC;IAC1E;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,aAAa,GAAG,IAAI,CAAA;IAC3B;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAA;IACxC;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE;QAChB,QAAQ,CAAC,OAAO,CAAC,EAAE;YAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,OAAO,CAAA;SAAE,GAAG,IAAI,CAAA;QACnD,QAAQ,CAAC,OAAO,CAAC,EAAE;YAAE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;SAAE,GAAG,IAAI,CAAA;KACjE,GAAG,IAAI,CAAA;CACR;AAsCD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG;IAAE,QAAQ,CAAC,OA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AoB,EAAE,4BAKlC,CAAA;AAED;;;;;GAKG;AACH,MAAM,WAAW,iCAAiC;IACjD,SAAS,EAAE,OAAO,cAAc,CAAA;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,YAAY,EAAE,CAAA;IACtB;;;;OAIG;IACH,yBAAyB,EAAE;QAAE,cAAc,EAAE,OAAO,CAAA;KAAE,CAAA;CACtD;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,iCAOlC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/**
|
|
3
3
|
* ─────────────────────────────────────────────────────────────────────────────
|
|
4
4
|
* `CertReviewCard` — the ready-to-register Builder.io PUSH cert component (W1)
|
|
@@ -24,7 +24,7 @@ import { memoToggleFor, toggleMemo } from '../components/memo-toggle.js';
|
|
|
24
24
|
import { renderCertBlock } from '../components/render-cert-block.js';
|
|
25
25
|
import { CERT_STRINGS_VERSION } from '../components/render-def.js';
|
|
26
26
|
import { READER_CSS } from '../reader/reader-css.generated.js';
|
|
27
|
-
import { getVerifiedDelivery, peekVerifiedDelivery } from '../verify/get-verified-delivery.js';
|
|
27
|
+
import { getVerifiedDelivery, parseDesignPin, peekVerifiedDelivery, } from '../verify/get-verified-delivery.js';
|
|
28
28
|
import { BUILDER_CERT_CHROME_KEYS } from './cert-chrome-data.js';
|
|
29
29
|
import { cardDeliveryRuntime } from './delivery-runtime.js';
|
|
30
30
|
import { envelopeCardHtml, envelopeCardInput, isReaderFaceDef } from './envelope-face.js';
|
|
@@ -114,6 +114,28 @@ function suspendOn(key, start) {
|
|
|
114
114
|
return use(pending);
|
|
115
115
|
throw pending;
|
|
116
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* 1.2.0-canary.6: the reader sidebar card is a right float that the article's copy flows around, as it does on a
|
|
119
|
+
* WordPress or Shopify page. On a Builder page the card sits in its own block, a flex item of the flex column that holds
|
|
120
|
+
* the page's blocks, and a flex item is a formatting context of its own: it contains the float, so the block spans the
|
|
121
|
+
* whole column at the aside's height and no copy can sit beside the aside. These rules let the float out of its block,
|
|
122
|
+
* and only there: in a column that holds a reader SIDEBAR card, at the widths where the sidebar floats (above the reader
|
|
123
|
+
* CSS's own 820px breakpoint, below which it stacks as a plain block), the column lays its blocks out as blocks and
|
|
124
|
+
* still contains the float (`flow-root`), and the card's block and the face's wrapper become plain blocks, so they take
|
|
125
|
+
* no height and the aside is the box the copy flows around. A column with no reader sidebar, the stacked widths, and a
|
|
126
|
+
* browser with no `:has()` keep exactly what they had.
|
|
127
|
+
*/
|
|
128
|
+
export const BUILDER_SIDEBAR_FLOW_CSS = '@media not all and (max-width: 820px){' +
|
|
129
|
+
'.builder-blocks:has(> .builder-block > [data-certrev-face="reader"] > .certrev-reader > .certrev-r-side){display:flow-root !important}' +
|
|
130
|
+
'.builder-blocks > .builder-block:has(> [data-certrev-face="reader"] > .certrev-reader > .certrev-r-side){display:block !important}' +
|
|
131
|
+
'.builder-blocks > .builder-block > [data-certrev-face="reader"]:has(> .certrev-reader > .certrev-r-side){display:block !important}' +
|
|
132
|
+
'}';
|
|
133
|
+
/** A reader face, with the sidebar flow rules beside it (`BUILDER_SIDEBAR_FLOW_CSS`); any other face, as it is. */
|
|
134
|
+
function withSidebarFlow(reader, face) {
|
|
135
|
+
if (!reader)
|
|
136
|
+
return face;
|
|
137
|
+
return (_jsxs(_Fragment, { children: [face, _jsx("style", { "data-certrev-builder-flow": "", dangerouslySetInnerHTML: { __html: BUILDER_SIDEBAR_FLOW_CSS } })] }));
|
|
138
|
+
}
|
|
117
139
|
/**
|
|
118
140
|
* The painted envelope face, with the phone memo toggle bound. One native click listener on the
|
|
119
141
|
* wrapper (delegated, so it survives a re-render of the HTML) flips the memo box the button sits
|
|
@@ -121,10 +143,12 @@ function suspendOn(key, start) {
|
|
|
121
143
|
* server HTML is the collapsed face, which is also what a reader without JS keeps (the whole memo
|
|
122
144
|
* is still in the text for a screen reader, and the desktop never clamps it).
|
|
123
145
|
*
|
|
124
|
-
* `reader` (1.2.0) is true ONLY for a def whose `face` is `'reader'`; it adds
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* wrapper
|
|
146
|
+
* `reader` (1.2.0) is true ONLY for a def whose `face` is `'reader'`; it adds three things and nothing to any other
|
|
147
|
+
* face: `data-certrev-face="reader"` and `display: flow-root` on the wrapper, and (1.2.0-canary.6) the sidebar flow
|
|
148
|
+
* rules beside it (`BUILDER_SIDEBAR_FLOW_CSS`). The reader sidebar card is a right float. On a Shopify page the
|
|
149
|
+
* placement script and its wrapper contain it. On a Builder page the wrapper contains it wherever the flow rules do not
|
|
150
|
+
* apply (the reader CSS's stacked widths, a browser with no `:has()`); where they do, the float leaves its block and
|
|
151
|
+
* the page's copy flows beside it.
|
|
128
152
|
*/
|
|
129
153
|
function EnvelopeFace(props) {
|
|
130
154
|
const ref = React.useRef(null);
|
|
@@ -140,20 +164,35 @@ function EnvelopeFace(props) {
|
|
|
140
164
|
el.addEventListener('click', onClick);
|
|
141
165
|
return () => el.removeEventListener('click', onClick);
|
|
142
166
|
}, []);
|
|
143
|
-
return (_jsx("div", { ref: ref, "data-certrev-cert-chrome": "", "data-certrev-delivery": "", "data-certrev-strings-version": CERT_STRINGS_VERSION, "data-certrev-def-version": props.defVersion, ...(props.reader ? { 'data-certrev-face': 'reader', style: { display: 'flow-root' } } : {}),
|
|
167
|
+
return withSidebarFlow(props.reader, _jsx("div", { ref: ref, "data-certrev-cert-chrome": "", "data-certrev-delivery": "", "data-certrev-strings-version": CERT_STRINGS_VERSION, "data-certrev-def-version": props.defVersion, ...(props.reader ? { 'data-certrev-face': 'reader', style: { display: 'flow-root' } } : {}),
|
|
144
168
|
// biome-ignore lint/security/noDangerouslySetInnerHtml: renderCertBlock is the escaping-safe SSR string renderer
|
|
145
169
|
dangerouslySetInnerHTML: { __html: props.html } }));
|
|
146
170
|
}
|
|
147
171
|
function EnvelopeCertReviewCard(props) {
|
|
148
172
|
const rt = cardDeliveryRuntime();
|
|
173
|
+
const { design } = props;
|
|
149
174
|
// The clock is read per render, so the lifecycle is judged NOW, not when the envelope was fetched.
|
|
150
175
|
const context = { platform: 'builder', externalId: props.externalId, now: new Date(rt.now()) };
|
|
151
|
-
const read = {
|
|
176
|
+
const read = {
|
|
177
|
+
baseUrl: props.baseUrl,
|
|
178
|
+
platform: 'builder',
|
|
179
|
+
externalId: props.externalId,
|
|
180
|
+
context,
|
|
181
|
+
cache: rt.cache,
|
|
182
|
+
design,
|
|
183
|
+
};
|
|
184
|
+
const key = design
|
|
185
|
+
? `${props.baseUrl}|${props.externalId}|design=${design.version}|${design.brand ?? ''}`
|
|
186
|
+
: `${props.baseUrl}|${props.externalId}`;
|
|
152
187
|
const settled = peekVerifiedDelivery(read) ??
|
|
153
|
-
suspendOn(
|
|
188
|
+
suspendOn(key, () => getVerifiedDelivery({ ...read, resolveKid: rt.resolveKid, fetchImpl: rt.fetchImpl(), timeoutMs: rt.timeoutMs }));
|
|
154
189
|
// Revoked, expired, unverifiable, for another entry, or unreachable: nothing at all.
|
|
155
190
|
if (settled.verdict.decision !== 'render')
|
|
156
191
|
return null;
|
|
192
|
+
// A pinned read paints only the design it pinned: a reader def at exactly that version. A def the API served for
|
|
193
|
+
// anything else (none, another face, another version) paints nothing, never the live design in its place.
|
|
194
|
+
if (design && !(isReaderFaceDef(settled.renderDef) && settled.renderDef?.v === design.version))
|
|
195
|
+
return null;
|
|
157
196
|
// The reader face is opt-in by the def's own `face` and is chosen HERE and nowhere else on this path; every other
|
|
158
197
|
// def (no face, an unknown face) falls through to the legacy lines below, untouched since 1.1.1.
|
|
159
198
|
if (isReaderFaceDef(settled.renderDef)) {
|
|
@@ -180,13 +219,20 @@ export function CertReviewCard(props) {
|
|
|
180
219
|
// 1.1.0: a block that carries the delivery marker paints from the signed envelope and the
|
|
181
220
|
// brand's def, never from the options beside it. No marker (every entry exported before 1.1.0)
|
|
182
221
|
// takes the options path below, unchanged from 1.0.3.
|
|
222
|
+
// 1.2.0-canary.5: a design pin (CertREV's canary replica only) fails closed. One that cannot be read renders
|
|
223
|
+
// nothing, and so does one on a block without the delivery marker: the options face is never the pinned design.
|
|
224
|
+
const design = parseDesignPin(props.builderContext?.context?.certrevDesignPin);
|
|
225
|
+
if (design === 'invalid')
|
|
226
|
+
return null;
|
|
183
227
|
if (props.delivery != null) {
|
|
184
228
|
const marker = acceptedDeliveryMarker(props.delivery);
|
|
185
229
|
const entryId = text(props.builderContext?.content?.id);
|
|
186
230
|
if (!marker || !entryId)
|
|
187
231
|
return null;
|
|
188
|
-
return (_jsx(Suspense, { fallback: null, children: _jsx(EnvelopeCertReviewCard, { baseUrl: marker.baseUrl, externalId: entryId, mode: props.mode, part: props.part }) }));
|
|
232
|
+
return (_jsx(Suspense, { fallback: null, children: _jsx(EnvelopeCertReviewCard, { baseUrl: marker.baseUrl, externalId: entryId, mode: props.mode, part: props.part, design: design }) }));
|
|
189
233
|
}
|
|
234
|
+
if (design)
|
|
235
|
+
return null;
|
|
190
236
|
const reviewerName = text(props.reviewerName);
|
|
191
237
|
const verifyUrl = text(props.verifyUrl);
|
|
192
238
|
if (!reviewerName || !verifyUrl)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cert-review-card.js","sourceRoot":"","sources":["../../src/builder/cert-review-card.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AACxE,OAAO,EAAsB,eAAe,EAAE,MAAM,oCAAoC,CAAA;AACxF,OAAO,EAAE,oBAAoB,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H,MAAM,EAAE,CAAC,GAAG,gBAAgB,EAAE,GAAG,WAAW,CAAC;IAC7C,yBAAyB,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE;CACnD,CAAA"}
|
package/dist/builder/index.d.ts
CHANGED
|
@@ -100,6 +100,7 @@ export interface CertRevBuilderRegistration {
|
|
|
100
100
|
* (truth). Matched by NAME at render, so Write-API content works without visual-editor setup.
|
|
101
101
|
*/
|
|
102
102
|
export declare const certRevAnchorComponent: CertRevBuilderRegistration;
|
|
103
|
+
export { type DesignPin, designPinFromUrl, parseDesignPin } from '../verify/get-verified-delivery.js';
|
|
103
104
|
export { BUILDER_CERT_CHROME_KEYS, type BuilderCertChromeData, type BuilderCertChromeKey, type CertChromeRenderDef, type CertDeliveryMarker, } from './cert-chrome-data.js';
|
|
104
105
|
export { acceptedDeliveryMarker, BUILDER_REGISTRATION, type BuilderInput, CERT_COMPONENT_NAME, type CertBlockBuilderRegistration, CertReviewCard, type CertReviewCardProps, type CertReviewCardRegisteredComponent, certRevCertComponent, PLACEMENT_INPUTS, WIRE_INPUTS, } from './cert-review-card.js';
|
|
105
106
|
export { CERT_FACE_FIELDS, credentialLabel, type EnvelopeCardOptions, envelopeCardHtml, envelopeCardInput, faceFromDef, isReaderFaceDef, layoutFor, READER_FACE, themeFromDef, } from './envelope-face.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/builder/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,OAAO,EAAiB,KAAK,SAAS,EAAc,MAAM,OAAO,CAAA;AAEjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,mFAAmF;AACnF,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;IAC7B,sGAAsG;IACtG,QAAQ,CAAC,OAAO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B,gBAAgB,EAChB,WAAW,GACX,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACN,gBAAgB,EAChB,eAAe,EACf,KAAK,mBAAmB,EACxB,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,SAAS,EACT,WAAW,EACX,YAAY,GACZ,MAAM,oBAAoB,CAAA"}
|
package/dist/builder/index.js
CHANGED
|
@@ -105,6 +105,8 @@ export const certRevAnchorComponent = {
|
|
|
105
105
|
name: 'CertREV Review',
|
|
106
106
|
inputs: [],
|
|
107
107
|
};
|
|
108
|
+
// 1.2.0-canary.5: the design pin, for CertREV's own canary replica (`<Content context={{ certrevDesignPin }}>`).
|
|
109
|
+
export { designPinFromUrl, parseDesignPin } from '../verify/get-verified-delivery.js';
|
|
108
110
|
// ── The Builder.io PUSH kit (CertReviewCard) + the single-sourced wire type ──
|
|
109
111
|
export { BUILDER_CERT_CHROME_KEYS, } from './cert-chrome-data.js';
|
|
110
112
|
export { acceptedDeliveryMarker, BUILDER_REGISTRATION, CERT_COMPONENT_NAME, CertReviewCard, certRevCertComponent, PLACEMENT_INPUTS, WIRE_INPUTS, } from './cert-review-card.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/builder/index.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,OAAO,EAAE,aAAa,EAAkB,UAAU,EAAE,MAAM,OAAO,CAAA;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAexD,MAAM,cAAc,GAAG,aAAa,CAAsB,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAA;AAE9F;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,EAC/B,OAAO,EACP,SAAS,GAAG,KAAK,EACjB,QAAQ,GAKR;IACA,OAAO,KAAC,cAAc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AC,OAAO,EAAE,UAAU,SAAG,CAAA;IACrF,CAAC;IACD,IAAI,SAAS;QAAE,OAAO,KAAC,wBAAwB,KAAG,CAAA;IAClD,OAAO,IAAI,CAAA;AACZ,CAAC;AAaD;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAA+B;IACjE,SAAS,EAAE,aAAa;IACxB,IAAI,EAAE,gBAAgB;IACtB,MAAM,EAAE,EAAE;CACV,CAAA;AAED,iHAAiH;AACjH,OAAO,EAAkB,gBAAgB,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AAErG,gFAAgF;AAChF,OAAO,EACN,wBAAwB,GAKxB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACN,sBAAsB,EACtB,oBAAoB,EAEpB,mBAAmB,EAEnB,cAAc,EAGd,oBAAoB,EACpB,gBAAgB,EAChB,WAAW,GACX,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACN,gBAAgB,EAChB,eAAe,EAEf,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,SAAS,EACT,WAAW,EACX,YAAY,GACZ,MAAM,oBAAoB,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export { accentFg, type BadgeVisibilityFieldId, CERT_SCOPE_LINE, CERT_STRINGS_VE
|
|
|
34
34
|
export { CANONICALIZATION, type CertContent, type CertCredential, type CertDeliveryEnvelope, type CertDisplayConfig, type CertLifecycle, type CertPayload, type CertSignature, type CertSubject, type CertSuppressReason, type CertVerdict, CONTRACT_VERSION, type ContractVersion, type Ed25519PublicKeyInput, type RenderContext, type ResolvePublicKeyByKid, renderVerdict, SIGNATURE_ALG, type SignatureAlg, type VerdictKernel, verifyEnvelope, verifySignatureOnly, } from './contract/kernel.js';
|
|
35
35
|
export { type JsonLdValue, type ProjectJsonLdOptions, projectCertJsonLd, projectCertJsonLdString, serializeJsonLdForScript, } from './jsonld/project.js';
|
|
36
36
|
export { TtlCache, type TtlCacheOptions } from './verify/cache.js';
|
|
37
|
-
export { type CachedDelivery, deliveryCacheKey, deliveryUrl, type GetVerifiedDeliveryOptions, getVerifiedDelivery, invalidateDelivery, parseRenderDef, peekVerifiedDelivery, settleDelivery, sharedDeliveryCache, type VerifiedDelivery, } from './verify/get-verified-delivery.js';
|
|
37
|
+
export { type CachedDelivery, type DesignPin, deliveryCacheKey, deliveryUrl, designPinFromUrl, type GetVerifiedDeliveryOptions, getVerifiedDelivery, invalidateDelivery, parseDesignPin, parseRenderDef, peekVerifiedDelivery, settleDelivery, sharedDeliveryCache, type VerifiedDelivery, } from './verify/get-verified-delivery.js';
|
|
38
38
|
export { type EnvelopeSource, type GetVerifiedEnvelopeOptions, getVerifiedEnvelope, invalidateVerdict, sharedVerdictCache, } from './verify/get-verified-envelope.js';
|
|
39
39
|
export { type FetchingKidResolverOptions, fetchingKidResolver, type StaticKeySet, staticKidResolver, } from './verify/resolve-kid.js';
|
|
40
40
|
export { type RenderBadgeOptions, renderBadgeHtml } from './webcomponent/render-badge-html.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC7E,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAC5F,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC7E,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,wB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VERSION, renderVerdict, SIGNATURE_ALG, verif
|
|
|
45
45
|
// ── JSON-LD projector ───────────────────────────────────────────────────────────────
|
|
46
46
|
export { projectCertJsonLd, projectCertJsonLdString, serializeJsonLdForScript, } from './jsonld/project.js';
|
|
47
47
|
export { TtlCache } from './verify/cache.js';
|
|
48
|
-
export { deliveryCacheKey, deliveryUrl, getVerifiedDelivery, invalidateDelivery, parseRenderDef, peekVerifiedDelivery, settleDelivery, sharedDeliveryCache, } from './verify/get-verified-delivery.js';
|
|
48
|
+
export { deliveryCacheKey, deliveryUrl, designPinFromUrl, getVerifiedDelivery, invalidateDelivery, parseDesignPin, parseRenderDef, peekVerifiedDelivery, settleDelivery, sharedDeliveryCache, } from './verify/get-verified-delivery.js';
|
|
49
49
|
// ── Verify layer ──────────────────────────────────────────────────────────────────
|
|
50
50
|
export { getVerifiedEnvelope, invalidateVerdict, sharedVerdictCache, } from './verify/get-verified-envelope.js';
|
|
51
51
|
export { fetchingKidResolver, staticKidResolver, } from './verify/resolve-kid.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,qFAAqF;AACrF,OAAO,EAAE,SAAS,EAAuB,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EAAE,UAAU,EAAwB,MAAM,4BAA4B,CAAA;AAC7E,OAAO,EAAE,eAAe,EAA6B,MAAM,iCAAiC,CAAA;AAC5F,OAAO,EAAE,UAAU,EAAwB,MAAM,4BAA4B,CAAA;AAC7E,OAAO,EAAE,SAAS,EAAuB,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACzG,uFAAuF;AACvF,OAAO,EACN,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,UAAU,EAEV,cAAc,GACd,MAAM,wBAAwB,CAAA;AAC/B,wFAAwF;AACxF,OAAO,EACN,SAAS,EACT,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,eAAe,EACf,UAAU,GACV,MAAM,6BAA6B,CAAA;AACpC,qEAAqE;AACrE,OAAO,EAEN,aAAa,EACb,kBAAkB,GAClB,MAAM,+BAA+B,CAAA;AACtC,2FAA2F;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,qFAAqF;AACrF,OAAO,EAMN,eAAe,GACf,MAAM,mCAAmC,CAAA;AAC1C,oFAAoF;AACpF,OAAO,EACN,QAAQ,EAER,eAAe,EACf,oBAAoB,EAGpB,sBAAsB,EACtB,+BAA+B,EAC/B,mBAAmB,EACnB,UAAU,EACV,WAAW,EAEX,eAAe,EACf,cAAc,EACd,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EAIxB,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,GACvB,MAAM,4BAA4B,CAAA;AACnC,sFAAsF;AACtF,qFAAqF;AACrF,2FAA2F;AAC3F,OAAO,EACN,gBAAgB,EAWhB,gBAAgB,EAKhB,aAAa,EACb,aAAa,EAGb,cAAc,EACd,mBAAmB,GACnB,MAAM,sBAAsB,CAAA;AAC7B,uFAAuF;AACvF,OAAO,EAGN,iBAAiB,EACjB,uBAAuB,EACvB,wBAAwB,GACxB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,QAAQ,EAAwB,MAAM,mBAAmB,CAAA;AAClE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,qFAAqF;AACrF,OAAO,EAAE,SAAS,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ACN,gBAAgB,EAWhB,gBAAgB,EAKhB,aAAa,EACb,aAAa,EAGb,cAAc,EACd,mBAAmB,GACnB,MAAM,sBAAsB,CAAA;AAC7B,uFAAuF;AACvF,OAAO,EAGN,iBAAiB,EACjB,uBAAuB,EACvB,wBAAwB,GACxB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,QAAQ,EAAwB,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAGN,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAEhB,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,mBAAmB,GAEnB,MAAM,mCAAmC,CAAA;AAC1C,qFAAqF;AACrF,OAAO,EAGN,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,GAClB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAEN,mBAAmB,EAEnB,iBAAiB,GACjB,MAAM,yBAAyB,CAAA;AAChC,sFAAsF;AACtF,OAAO,EAA2B,eAAe,EAAE,MAAM,qCAAqC,CAAA"}
|
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
* 2. The CACHE KEY is the Delivery URL plus the rendering placement, so a staging and a
|
|
22
22
|
* production origin never share an entry, and neither do two placements.
|
|
23
23
|
*
|
|
24
|
+
* 1.2.0-canary.5: an optional design PIN (`design`, CertREV's own canary replica only) asks the Delivery
|
|
25
|
+
* API for one saved design version (`?design=<v>[&designBrand=<brand>]`). The pin is part of the URL, so
|
|
26
|
+
* it is part of the cache key: a pinned read never shares an entry with the unpinned one. Without a pin
|
|
27
|
+
* the URL and the key are exactly what 1.1.0 built.
|
|
28
|
+
*
|
|
24
29
|
* `peekVerifiedDelivery` is the synchronous read of the same cache: a React component suspends on
|
|
25
30
|
* `getVerifiedDelivery` once, then reads the settled value without a second promise (which is what
|
|
26
31
|
* keeps a streaming SSR render from suspending forever on a fresh promise every retry).
|
|
@@ -59,12 +64,45 @@ export interface GetVerifiedDeliveryOptions {
|
|
|
59
64
|
readonly ttlMs?: number;
|
|
60
65
|
/** Deadline in ms for the fetch (default `DEFAULT_FETCH_TIMEOUT_MS`, 3s). */
|
|
61
66
|
readonly timeoutMs?: number;
|
|
67
|
+
/**
|
|
68
|
+
* 1.2.0-canary.5: read one saved design version instead of the brand's live def. CertREV's own canary
|
|
69
|
+
* replica only; production brands never send it. Build it with `parseDesignPin`.
|
|
70
|
+
*/
|
|
71
|
+
readonly design?: DesignPin;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A design pin: the saved design `version` the Delivery API should serve the def for, and optionally the
|
|
75
|
+
* brand whose saved design it is (`brand`, a brand key). The API answers a pin it cannot honour with a
|
|
76
|
+
* 404 or a 503, which settle to suppressed like any other failed read.
|
|
77
|
+
*/
|
|
78
|
+
export interface DesignPin {
|
|
79
|
+
readonly version: number;
|
|
80
|
+
readonly brand?: string;
|
|
62
81
|
}
|
|
63
82
|
/** Shared per-process cache: 60s for a verified read, 5s for a suppressed one. */
|
|
64
83
|
declare const sharedDeliveryCache: TtlCache<CachedDelivery>;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
84
|
+
/** The Delivery route; a design pin adds `?design=<v>` and, with a brand, `&designBrand=<brand>`. */
|
|
85
|
+
export declare function deliveryUrl(baseUrl: string, platform: string, externalId: string, design?: DesignPin): string;
|
|
86
|
+
/** Cache key: the URL (origin and pin included) × the placement rendering it. No clock: the TTL bounds time. */
|
|
87
|
+
export declare function deliveryCacheKey(opts: Pick<GetVerifiedDeliveryOptions, 'baseUrl' | 'platform' | 'externalId' | 'context' | 'design'>): string;
|
|
88
|
+
/**
|
|
89
|
+
* The pin the canary replica passes (`{ design, designBrand? }`, as `designPinFromUrl` returns it),
|
|
90
|
+
* judged. `undefined` ONLY for undefined or null: no pin. A `design` (string or number) and an optional
|
|
91
|
+
* `designBrand` string that both pass the API's grammars are a pin. Anything else is `'invalid'`,
|
|
92
|
+
* including a `designBrand` without a valid `design`, and the card renders nothing for it: a pin that
|
|
93
|
+
* cannot be read never falls back to the live design. Keys other than these two are ignored.
|
|
94
|
+
*/
|
|
95
|
+
export declare function parseDesignPin(raw: unknown): DesignPin | 'invalid' | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* The raw pin on a page URL, for the canary replica to hand the card as Builder `context`:
|
|
98
|
+
* `searchParams` `design` and `designBrand`, as strings (`design` is '' when only `designBrand` is
|
|
99
|
+
* there, which `parseDesignPin` judges invalid). `undefined` when neither is present, or when `url`
|
|
100
|
+
* does not parse. Never throws; a relative URL is read against a placeholder origin.
|
|
101
|
+
*/
|
|
102
|
+
export declare function designPinFromUrl(url: string | URL): {
|
|
103
|
+
design: string;
|
|
104
|
+
designBrand?: string;
|
|
105
|
+
} | undefined;
|
|
68
106
|
/**
|
|
69
107
|
* The def sibling, shape-checked. Anything that is not the metafield shape is null, which paints
|
|
70
108
|
* the preset default (the same thing an absent def paints): a def is presentation, never a claim,
|
|
@@ -84,8 +122,8 @@ export declare function getVerifiedDelivery(opts: GetVerifiedDeliveryOptions): P
|
|
|
84
122
|
* The synchronous read: the settled answer when a fresh read is cached, else `undefined` (the
|
|
85
123
|
* caller then awaits `getVerifiedDelivery`). Never fetches.
|
|
86
124
|
*/
|
|
87
|
-
export declare function peekVerifiedDelivery(opts: Pick<GetVerifiedDeliveryOptions, 'baseUrl' | 'platform' | 'externalId' | 'context' | 'cache'>): VerifiedDelivery | undefined;
|
|
88
|
-
/** Drop
|
|
89
|
-
export declare function invalidateDelivery(opts: Pick<GetVerifiedDeliveryOptions, 'baseUrl' | 'platform' | 'externalId' | 'context'>, cache?: TtlCache<CachedDelivery>): void;
|
|
125
|
+
export declare function peekVerifiedDelivery(opts: Pick<GetVerifiedDeliveryOptions, 'baseUrl' | 'platform' | 'externalId' | 'context' | 'cache' | 'design'>): VerifiedDelivery | undefined;
|
|
126
|
+
/** Drop the cached read for one placement (e.g. from a revocation webhook); with `design`, that pinned read. */
|
|
127
|
+
export declare function invalidateDelivery(opts: Pick<GetVerifiedDeliveryOptions, 'baseUrl' | 'platform' | 'externalId' | 'context' | 'design'>, cache?: TtlCache<CachedDelivery>): void;
|
|
90
128
|
export { sharedDeliveryCache };
|
|
91
129
|
//# sourceMappingURL=get-verified-delivery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-verified-delivery.d.ts","sourceRoot":"","sources":["../../src/verify/get-verified-delivery.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"get-verified-delivery.d.ts","sourceRoot":"","sources":["../../src/verify/get-verified-delivery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AACzE,OAAO,KAAK,EAEX,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,qBAAqB,EACrB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGrC,qGAAqG;AACrG,MAAM,MAAM,cAAc,GACvB;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,mBAAmB,GAAG,IAAI,CAAA;CAAE,GAC5G;IAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAA;CAAE,CAAA;AAEvE,mGAAmG;AACnG,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;IAC7B,iGAAiG;IACjG,QAAQ,CAAC,SAAS,EAAE,mBAAmB,GAAG,IAAI,CAAA;CAC9C;AAED,MAAM,WAAW,0BAA0B;IAC1C,mGAAmG;IACnG,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,C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IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAWxG;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,mBAAmB,GAAG,IAAI,CAgCzE;AAyCD,iGAAiG;AACjG,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,GAAG,gBAAgB,CAI/F;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,gBAAgB,CAAC,CASrG;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CACnC,IAAI,EAAE,IAAI,CAAC,0BAA0B,EAAE,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC,GAC5G,gBAAgB,GAAG,SAAS,CAG9B;AAED,gHAAgH;AAChH,wBAAgB,kBAAkB,CACjC,IAAI,EAAE,IAAI,CAAC,0BAA0B,EAAE,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAC,EACpG,KAAK,GAAE,QAAQ,CAAC,cAAc,CAAuB,GACnD,IAAI,CAEN;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
* 2. The CACHE KEY is the Delivery URL plus the rendering placement, so a staging and a
|
|
22
22
|
* production origin never share an entry, and neither do two placements.
|
|
23
23
|
*
|
|
24
|
+
* 1.2.0-canary.5: an optional design PIN (`design`, CertREV's own canary replica only) asks the Delivery
|
|
25
|
+
* API for one saved design version (`?design=<v>[&designBrand=<brand>]`). The pin is part of the URL, so
|
|
26
|
+
* it is part of the cache key: a pinned read never shares an entry with the unpinned one. Without a pin
|
|
27
|
+
* the URL and the key are exactly what 1.1.0 built.
|
|
28
|
+
*
|
|
24
29
|
* `peekVerifiedDelivery` is the synchronous read of the same cache: a React component suspends on
|
|
25
30
|
* `getVerifiedDelivery` once, then reads the settled value without a second promise (which is what
|
|
26
31
|
* keeps a streaming SSR render from suspending forever on a fresh promise every retry).
|
|
@@ -33,16 +38,65 @@ const sharedDeliveryCache = new TtlCache({ ttlMs: 60_000, negativeTtlMs: 5_000 }
|
|
|
33
38
|
function suppressed(reason) {
|
|
34
39
|
return { kind: 'suppressed', reason };
|
|
35
40
|
}
|
|
36
|
-
|
|
41
|
+
/** The Delivery route; a design pin adds `?design=<v>` and, with a brand, `&designBrand=<brand>`. */
|
|
42
|
+
export function deliveryUrl(baseUrl, platform, externalId, design) {
|
|
37
43
|
const base = baseUrl.replace(/\/+$/, '');
|
|
38
|
-
|
|
44
|
+
const url = `${base}/api/cert/v1/delivery/${encodeURIComponent(platform)}/${encodeURIComponent(externalId)}`;
|
|
45
|
+
if (!design)
|
|
46
|
+
return url;
|
|
47
|
+
const brand = design.brand === undefined ? '' : `&designBrand=${encodeURIComponent(design.brand)}`;
|
|
48
|
+
return `${url}?design=${design.version}${brand}`;
|
|
39
49
|
}
|
|
40
|
-
/** Cache key: the URL (origin included) × the placement rendering it. No clock: the TTL bounds time. */
|
|
50
|
+
/** Cache key: the URL (origin and pin included) × the placement rendering it. No clock: the TTL bounds time. */
|
|
41
51
|
export function deliveryCacheKey(opts) {
|
|
42
|
-
return `delivery:${deliveryUrl(opts.baseUrl, opts.platform, opts.externalId)}|${encodeURIComponent(opts.context.platform)}:${encodeURIComponent(opts.context.externalId)}`;
|
|
52
|
+
return `delivery:${deliveryUrl(opts.baseUrl, opts.platform, opts.externalId, opts.design)}|${encodeURIComponent(opts.context.platform)}:${encodeURIComponent(opts.context.externalId)}`;
|
|
43
53
|
}
|
|
44
54
|
const isString = (v) => typeof v === 'string';
|
|
45
55
|
const isRecord = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
56
|
+
/** The pin's two grammars, the Delivery API's own: a version 1..999999999 with no leading zero, a brand key. */
|
|
57
|
+
const DESIGN_VERSION = /^[1-9][0-9]{0,8}$/;
|
|
58
|
+
const DESIGN_BRAND = /^[a-z0-9](?:[a-z0-9-]{0,98}[a-z0-9])?$/;
|
|
59
|
+
/**
|
|
60
|
+
* The pin the canary replica passes (`{ design, designBrand? }`, as `designPinFromUrl` returns it),
|
|
61
|
+
* judged. `undefined` ONLY for undefined or null: no pin. A `design` (string or number) and an optional
|
|
62
|
+
* `designBrand` string that both pass the API's grammars are a pin. Anything else is `'invalid'`,
|
|
63
|
+
* including a `designBrand` without a valid `design`, and the card renders nothing for it: a pin that
|
|
64
|
+
* cannot be read never falls back to the live design. Keys other than these two are ignored.
|
|
65
|
+
*/
|
|
66
|
+
export function parseDesignPin(raw) {
|
|
67
|
+
if (raw === undefined || raw === null)
|
|
68
|
+
return undefined;
|
|
69
|
+
if (!isRecord(raw))
|
|
70
|
+
return 'invalid';
|
|
71
|
+
const { design, designBrand } = raw;
|
|
72
|
+
const version = typeof design === 'number' ? String(design) : design;
|
|
73
|
+
if (typeof version !== 'string' || !DESIGN_VERSION.test(version))
|
|
74
|
+
return 'invalid';
|
|
75
|
+
if (designBrand !== undefined && (typeof designBrand !== 'string' || !DESIGN_BRAND.test(designBrand))) {
|
|
76
|
+
return 'invalid';
|
|
77
|
+
}
|
|
78
|
+
return designBrand === undefined ? { version: Number(version) } : { version: Number(version), brand: designBrand };
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The raw pin on a page URL, for the canary replica to hand the card as Builder `context`:
|
|
82
|
+
* `searchParams` `design` and `designBrand`, as strings (`design` is '' when only `designBrand` is
|
|
83
|
+
* there, which `parseDesignPin` judges invalid). `undefined` when neither is present, or when `url`
|
|
84
|
+
* does not parse. Never throws; a relative URL is read against a placeholder origin.
|
|
85
|
+
*/
|
|
86
|
+
export function designPinFromUrl(url) {
|
|
87
|
+
let params;
|
|
88
|
+
try {
|
|
89
|
+
params = new URL(url, 'http://x').searchParams;
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
94
|
+
const design = params.get('design');
|
|
95
|
+
const designBrand = params.get('designBrand');
|
|
96
|
+
if (design === null && designBrand === null)
|
|
97
|
+
return undefined;
|
|
98
|
+
return designBrand === null ? { design: design ?? '' } : { design: design ?? '', designBrand };
|
|
99
|
+
}
|
|
46
100
|
/**
|
|
47
101
|
* The def sibling, shape-checked. Anything that is not the metafield shape is null, which paints
|
|
48
102
|
* the preset default (the same thing an absent def paints): a def is presentation, never a claim,
|
|
@@ -93,7 +147,7 @@ async function loadDelivery(opts) {
|
|
|
93
147
|
const fetchImpl = opts.fetchImpl ?? globalThis.fetch;
|
|
94
148
|
let res;
|
|
95
149
|
try {
|
|
96
|
-
res = await fetchWithDeadline(fetchImpl, deliveryUrl(opts.baseUrl, opts.platform, opts.externalId), { headers: { accept: 'application/json' } }, opts.timeoutMs ?? DEFAULT_FETCH_TIMEOUT_MS);
|
|
150
|
+
res = await fetchWithDeadline(fetchImpl, deliveryUrl(opts.baseUrl, opts.platform, opts.externalId, opts.design), { headers: { accept: 'application/json' } }, opts.timeoutMs ?? DEFAULT_FETCH_TIMEOUT_MS);
|
|
97
151
|
}
|
|
98
152
|
catch {
|
|
99
153
|
// Unreachable, DNS/TLS, or the deadline. Same least-wrong member as getVerifiedEnvelope.
|
|
@@ -153,7 +207,7 @@ export function peekVerifiedDelivery(opts) {
|
|
|
153
207
|
const cached = (opts.cache ?? sharedDeliveryCache).peek(deliveryCacheKey(opts));
|
|
154
208
|
return cached === undefined ? undefined : settleDelivery(cached, opts.context);
|
|
155
209
|
}
|
|
156
|
-
/** Drop
|
|
210
|
+
/** Drop the cached read for one placement (e.g. from a revocation webhook); with `design`, that pinned read. */
|
|
157
211
|
export function invalidateDelivery(opts, cache = sharedDeliveryCache) {
|
|
158
212
|
cache.delete(deliveryCacheKey(opts));
|
|
159
213
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-verified-delivery.js","sourceRoot":"","sources":["../../src/verify/get-verified-delivery.ts"],"names":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canary.
|
|
3
|
+
"version": "1.2.0-canary.6",
|
|
4
4
|
"description": "Headless render edge for the CertREV CertDeliveryEnvelope: SSR-safe React cert components, a framework-agnostic <certrev-badge> Web Component, a schema.org JSON-LD projector, and a fail-closed verify layer over the shared VerdictKernel.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,7 +24,13 @@ import { memoToggleFor, toggleMemo } from '../components/memo-toggle.js'
|
|
|
24
24
|
import { type CertBlockMode, renderCertBlock } from '../components/render-cert-block.js'
|
|
25
25
|
import { CERT_STRINGS_VERSION, type ResolvedBlockTheme } from '../components/render-def.js'
|
|
26
26
|
import { READER_CSS } from '../reader/reader-css.generated.js'
|
|
27
|
-
import {
|
|
27
|
+
import {
|
|
28
|
+
type DesignPin,
|
|
29
|
+
getVerifiedDelivery,
|
|
30
|
+
parseDesignPin,
|
|
31
|
+
peekVerifiedDelivery,
|
|
32
|
+
type VerifiedDelivery,
|
|
33
|
+
} from '../verify/get-verified-delivery.js'
|
|
28
34
|
import type { BuilderCertChromeData } from './cert-chrome-data.js'
|
|
29
35
|
import { BUILDER_CERT_CHROME_KEYS } from './cert-chrome-data.js'
|
|
30
36
|
import { cardDeliveryRuntime } from './delivery-runtime.js'
|
|
@@ -61,8 +67,14 @@ export interface CertReviewCardProps extends Partial<BuilderCertChromeData> {
|
|
|
61
67
|
* `shouldReceiveBuilderProps: { builderContext: true }`. Only `content.id` is read: it is the
|
|
62
68
|
* Builder entry this block renders inside, which IS the Delivery placement's `externalId`, so a
|
|
63
69
|
* block copied onto another entry asks for that entry's cert and never shows this one's.
|
|
70
|
+
*
|
|
71
|
+
* 1.2.0-canary.5: `context` is Builder `<Content>`'s own `context` prop. Only `certrevDesignPin` is read: the design
|
|
72
|
+
* pin CertREV's canary replica passes (`designPinFromUrl(request.url)`). Production brands never set it.
|
|
64
73
|
*/
|
|
65
|
-
builderContext?: {
|
|
74
|
+
builderContext?: {
|
|
75
|
+
readonly content?: { readonly id?: unknown } | null
|
|
76
|
+
readonly context?: { readonly certrevDesignPin?: unknown } | null
|
|
77
|
+
} | null
|
|
66
78
|
}
|
|
67
79
|
|
|
68
80
|
/**
|
|
@@ -142,6 +154,36 @@ function suspendOn(key: string, start: () => Promise<VerifiedDelivery>): Verifie
|
|
|
142
154
|
throw pending
|
|
143
155
|
}
|
|
144
156
|
|
|
157
|
+
/**
|
|
158
|
+
* 1.2.0-canary.6: the reader sidebar card is a right float that the article's copy flows around, as it does on a
|
|
159
|
+
* WordPress or Shopify page. On a Builder page the card sits in its own block, a flex item of the flex column that holds
|
|
160
|
+
* the page's blocks, and a flex item is a formatting context of its own: it contains the float, so the block spans the
|
|
161
|
+
* whole column at the aside's height and no copy can sit beside the aside. These rules let the float out of its block,
|
|
162
|
+
* and only there: in a column that holds a reader SIDEBAR card, at the widths where the sidebar floats (above the reader
|
|
163
|
+
* CSS's own 820px breakpoint, below which it stacks as a plain block), the column lays its blocks out as blocks and
|
|
164
|
+
* still contains the float (`flow-root`), and the card's block and the face's wrapper become plain blocks, so they take
|
|
165
|
+
* no height and the aside is the box the copy flows around. A column with no reader sidebar, the stacked widths, and a
|
|
166
|
+
* browser with no `:has()` keep exactly what they had.
|
|
167
|
+
*/
|
|
168
|
+
export const BUILDER_SIDEBAR_FLOW_CSS =
|
|
169
|
+
'@media not all and (max-width: 820px){' +
|
|
170
|
+
'.builder-blocks:has(> .builder-block > [data-certrev-face="reader"] > .certrev-reader > .certrev-r-side){display:flow-root !important}' +
|
|
171
|
+
'.builder-blocks > .builder-block:has(> [data-certrev-face="reader"] > .certrev-reader > .certrev-r-side){display:block !important}' +
|
|
172
|
+
'.builder-blocks > .builder-block > [data-certrev-face="reader"]:has(> .certrev-reader > .certrev-r-side){display:block !important}' +
|
|
173
|
+
'}'
|
|
174
|
+
|
|
175
|
+
/** A reader face, with the sidebar flow rules beside it (`BUILDER_SIDEBAR_FLOW_CSS`); any other face, as it is. */
|
|
176
|
+
function withSidebarFlow(reader: boolean | undefined, face: React.ReactElement): React.ReactElement {
|
|
177
|
+
if (!reader) return face
|
|
178
|
+
return (
|
|
179
|
+
<>
|
|
180
|
+
{face}
|
|
181
|
+
{/* biome-ignore lint/security/noDangerouslySetInnerHtml: a package constant; React would escape the `>` and `"` of its selectors */}
|
|
182
|
+
<style data-certrev-builder-flow="" dangerouslySetInnerHTML={{ __html: BUILDER_SIDEBAR_FLOW_CSS }} />
|
|
183
|
+
</>
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
|
|
145
187
|
/**
|
|
146
188
|
* The painted envelope face, with the phone memo toggle bound. One native click listener on the
|
|
147
189
|
* wrapper (delegated, so it survives a re-render of the HTML) flips the memo box the button sits
|
|
@@ -149,10 +191,12 @@ function suspendOn(key: string, start: () => Promise<VerifiedDelivery>): Verifie
|
|
|
149
191
|
* server HTML is the collapsed face, which is also what a reader without JS keeps (the whole memo
|
|
150
192
|
* is still in the text for a screen reader, and the desktop never clamps it).
|
|
151
193
|
*
|
|
152
|
-
* `reader` (1.2.0) is true ONLY for a def whose `face` is `'reader'`; it adds
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
* wrapper
|
|
194
|
+
* `reader` (1.2.0) is true ONLY for a def whose `face` is `'reader'`; it adds three things and nothing to any other
|
|
195
|
+
* face: `data-certrev-face="reader"` and `display: flow-root` on the wrapper, and (1.2.0-canary.6) the sidebar flow
|
|
196
|
+
* rules beside it (`BUILDER_SIDEBAR_FLOW_CSS`). The reader sidebar card is a right float. On a Shopify page the
|
|
197
|
+
* placement script and its wrapper contain it. On a Builder page the wrapper contains it wherever the flow rules do not
|
|
198
|
+
* apply (the reader CSS's stacked widths, a browser with no `:has()`); where they do, the float leaves its block and
|
|
199
|
+
* the page's copy flows beside it.
|
|
156
200
|
*/
|
|
157
201
|
function EnvelopeFace(props: {
|
|
158
202
|
readonly html: string
|
|
@@ -170,7 +214,8 @@ function EnvelopeFace(props: {
|
|
|
170
214
|
el.addEventListener('click', onClick)
|
|
171
215
|
return () => el.removeEventListener('click', onClick)
|
|
172
216
|
}, [])
|
|
173
|
-
return (
|
|
217
|
+
return withSidebarFlow(
|
|
218
|
+
props.reader,
|
|
174
219
|
<div
|
|
175
220
|
ref={ref}
|
|
176
221
|
data-certrev-cert-chrome=""
|
|
@@ -182,7 +227,7 @@ function EnvelopeFace(props: {
|
|
|
182
227
|
{...(props.reader ? { 'data-certrev-face': 'reader', style: { display: 'flow-root' } } : {})}
|
|
183
228
|
// biome-ignore lint/security/noDangerouslySetInnerHtml: renderCertBlock is the escaping-safe SSR string renderer
|
|
184
229
|
dangerouslySetInnerHTML={{ __html: props.html }}
|
|
185
|
-
|
|
230
|
+
/>,
|
|
186
231
|
)
|
|
187
232
|
}
|
|
188
233
|
|
|
@@ -191,18 +236,33 @@ function EnvelopeCertReviewCard(props: {
|
|
|
191
236
|
readonly externalId: string
|
|
192
237
|
readonly mode: unknown
|
|
193
238
|
readonly part: unknown
|
|
239
|
+
readonly design?: DesignPin
|
|
194
240
|
}) {
|
|
195
241
|
const rt = cardDeliveryRuntime()
|
|
242
|
+
const { design } = props
|
|
196
243
|
// The clock is read per render, so the lifecycle is judged NOW, not when the envelope was fetched.
|
|
197
244
|
const context = { platform: 'builder', externalId: props.externalId, now: new Date(rt.now()) }
|
|
198
|
-
const read = {
|
|
245
|
+
const read = {
|
|
246
|
+
baseUrl: props.baseUrl,
|
|
247
|
+
platform: 'builder',
|
|
248
|
+
externalId: props.externalId,
|
|
249
|
+
context,
|
|
250
|
+
cache: rt.cache,
|
|
251
|
+
design,
|
|
252
|
+
}
|
|
253
|
+
const key = design
|
|
254
|
+
? `${props.baseUrl}|${props.externalId}|design=${design.version}|${design.brand ?? ''}`
|
|
255
|
+
: `${props.baseUrl}|${props.externalId}`
|
|
199
256
|
const settled =
|
|
200
257
|
peekVerifiedDelivery(read) ??
|
|
201
|
-
suspendOn(
|
|
258
|
+
suspendOn(key, () =>
|
|
202
259
|
getVerifiedDelivery({ ...read, resolveKid: rt.resolveKid, fetchImpl: rt.fetchImpl(), timeoutMs: rt.timeoutMs }),
|
|
203
260
|
)
|
|
204
261
|
// Revoked, expired, unverifiable, for another entry, or unreachable: nothing at all.
|
|
205
262
|
if (settled.verdict.decision !== 'render') return null
|
|
263
|
+
// A pinned read paints only the design it pinned: a reader def at exactly that version. A def the API served for
|
|
264
|
+
// anything else (none, another face, another version) paints nothing, never the live design in its place.
|
|
265
|
+
if (design && !(isReaderFaceDef(settled.renderDef) && settled.renderDef?.v === design.version)) return null
|
|
206
266
|
// The reader face is opt-in by the def's own `face` and is chosen HERE and nowhere else on this path; every other
|
|
207
267
|
// def (no face, an unknown face) falls through to the legacy lines below, untouched since 1.1.1.
|
|
208
268
|
if (isReaderFaceDef(settled.renderDef)) {
|
|
@@ -233,16 +293,27 @@ export function CertReviewCard(props: CertReviewCardProps) {
|
|
|
233
293
|
// 1.1.0: a block that carries the delivery marker paints from the signed envelope and the
|
|
234
294
|
// brand's def, never from the options beside it. No marker (every entry exported before 1.1.0)
|
|
235
295
|
// takes the options path below, unchanged from 1.0.3.
|
|
296
|
+
// 1.2.0-canary.5: a design pin (CertREV's canary replica only) fails closed. One that cannot be read renders
|
|
297
|
+
// nothing, and so does one on a block without the delivery marker: the options face is never the pinned design.
|
|
298
|
+
const design = parseDesignPin(props.builderContext?.context?.certrevDesignPin)
|
|
299
|
+
if (design === 'invalid') return null
|
|
236
300
|
if (props.delivery != null) {
|
|
237
301
|
const marker = acceptedDeliveryMarker(props.delivery)
|
|
238
302
|
const entryId = text(props.builderContext?.content?.id)
|
|
239
303
|
if (!marker || !entryId) return null
|
|
240
304
|
return (
|
|
241
305
|
<Suspense fallback={null}>
|
|
242
|
-
<EnvelopeCertReviewCard
|
|
306
|
+
<EnvelopeCertReviewCard
|
|
307
|
+
baseUrl={marker.baseUrl}
|
|
308
|
+
externalId={entryId}
|
|
309
|
+
mode={props.mode}
|
|
310
|
+
part={props.part}
|
|
311
|
+
design={design}
|
|
312
|
+
/>
|
|
243
313
|
</Suspense>
|
|
244
314
|
)
|
|
245
315
|
}
|
|
316
|
+
if (design) return null
|
|
246
317
|
|
|
247
318
|
const reviewerName = text(props.reviewerName)
|
|
248
319
|
const verifyUrl = text(props.verifyUrl)
|
package/src/builder/index.tsx
CHANGED
|
@@ -149,6 +149,9 @@ export const certRevAnchorComponent: CertRevBuilderRegistration = {
|
|
|
149
149
|
inputs: [],
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
+
// 1.2.0-canary.5: the design pin, for CertREV's own canary replica (`<Content context={{ certrevDesignPin }}>`).
|
|
153
|
+
export { type DesignPin, designPinFromUrl, parseDesignPin } from '../verify/get-verified-delivery.js'
|
|
154
|
+
|
|
152
155
|
// ── The Builder.io PUSH kit (CertReviewCard) + the single-sourced wire type ──
|
|
153
156
|
export {
|
|
154
157
|
BUILDER_CERT_CHROME_KEYS,
|
package/src/index.ts
CHANGED
|
@@ -135,11 +135,14 @@ export {
|
|
|
135
135
|
export { TtlCache, type TtlCacheOptions } from './verify/cache.js'
|
|
136
136
|
export {
|
|
137
137
|
type CachedDelivery,
|
|
138
|
+
type DesignPin,
|
|
138
139
|
deliveryCacheKey,
|
|
139
140
|
deliveryUrl,
|
|
141
|
+
designPinFromUrl,
|
|
140
142
|
type GetVerifiedDeliveryOptions,
|
|
141
143
|
getVerifiedDelivery,
|
|
142
144
|
invalidateDelivery,
|
|
145
|
+
parseDesignPin,
|
|
143
146
|
parseRenderDef,
|
|
144
147
|
peekVerifiedDelivery,
|
|
145
148
|
settleDelivery,
|
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
* 2. The CACHE KEY is the Delivery URL plus the rendering placement, so a staging and a
|
|
22
22
|
* production origin never share an entry, and neither do two placements.
|
|
23
23
|
*
|
|
24
|
+
* 1.2.0-canary.5: an optional design PIN (`design`, CertREV's own canary replica only) asks the Delivery
|
|
25
|
+
* API for one saved design version (`?design=<v>[&designBrand=<brand>]`). The pin is part of the URL, so
|
|
26
|
+
* it is part of the cache key: a pinned read never shares an entry with the unpinned one. Without a pin
|
|
27
|
+
* the URL and the key are exactly what 1.1.0 built.
|
|
28
|
+
*
|
|
24
29
|
* `peekVerifiedDelivery` is the synchronous read of the same cache: a React component suspends on
|
|
25
30
|
* `getVerifiedDelivery` once, then reads the settled value without a second promise (which is what
|
|
26
31
|
* keeps a streaming SSR render from suspending forever on a fresh promise every retry).
|
|
@@ -67,6 +72,21 @@ export interface GetVerifiedDeliveryOptions {
|
|
|
67
72
|
readonly ttlMs?: number
|
|
68
73
|
/** Deadline in ms for the fetch (default `DEFAULT_FETCH_TIMEOUT_MS`, 3s). */
|
|
69
74
|
readonly timeoutMs?: number
|
|
75
|
+
/**
|
|
76
|
+
* 1.2.0-canary.5: read one saved design version instead of the brand's live def. CertREV's own canary
|
|
77
|
+
* replica only; production brands never send it. Build it with `parseDesignPin`.
|
|
78
|
+
*/
|
|
79
|
+
readonly design?: DesignPin
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* A design pin: the saved design `version` the Delivery API should serve the def for, and optionally the
|
|
84
|
+
* brand whose saved design it is (`brand`, a brand key). The API answers a pin it cannot honour with a
|
|
85
|
+
* 404 or a 503, which settle to suppressed like any other failed read.
|
|
86
|
+
*/
|
|
87
|
+
export interface DesignPin {
|
|
88
|
+
readonly version: number
|
|
89
|
+
readonly brand?: string
|
|
70
90
|
}
|
|
71
91
|
|
|
72
92
|
/** Shared per-process cache: 60s for a verified read, 5s for a suppressed one. */
|
|
@@ -76,21 +96,67 @@ function suppressed(reason: CertSuppressReason): CachedDelivery {
|
|
|
76
96
|
return { kind: 'suppressed', reason }
|
|
77
97
|
}
|
|
78
98
|
|
|
79
|
-
|
|
99
|
+
/** The Delivery route; a design pin adds `?design=<v>` and, with a brand, `&designBrand=<brand>`. */
|
|
100
|
+
export function deliveryUrl(baseUrl: string, platform: string, externalId: string, design?: DesignPin): string {
|
|
80
101
|
const base = baseUrl.replace(/\/+$/, '')
|
|
81
|
-
|
|
102
|
+
const url = `${base}/api/cert/v1/delivery/${encodeURIComponent(platform)}/${encodeURIComponent(externalId)}`
|
|
103
|
+
if (!design) return url
|
|
104
|
+
const brand = design.brand === undefined ? '' : `&designBrand=${encodeURIComponent(design.brand)}`
|
|
105
|
+
return `${url}?design=${design.version}${brand}`
|
|
82
106
|
}
|
|
83
107
|
|
|
84
|
-
/** Cache key: the URL (origin included) × the placement rendering it. No clock: the TTL bounds time. */
|
|
108
|
+
/** Cache key: the URL (origin and pin included) × the placement rendering it. No clock: the TTL bounds time. */
|
|
85
109
|
export function deliveryCacheKey(
|
|
86
|
-
opts: Pick<GetVerifiedDeliveryOptions, 'baseUrl' | 'platform' | 'externalId' | 'context'>,
|
|
110
|
+
opts: Pick<GetVerifiedDeliveryOptions, 'baseUrl' | 'platform' | 'externalId' | 'context' | 'design'>,
|
|
87
111
|
): string {
|
|
88
|
-
return `delivery:${deliveryUrl(opts.baseUrl, opts.platform, opts.externalId)}|${encodeURIComponent(opts.context.platform)}:${encodeURIComponent(opts.context.externalId)}`
|
|
112
|
+
return `delivery:${deliveryUrl(opts.baseUrl, opts.platform, opts.externalId, opts.design)}|${encodeURIComponent(opts.context.platform)}:${encodeURIComponent(opts.context.externalId)}`
|
|
89
113
|
}
|
|
90
114
|
|
|
91
115
|
const isString = (v: unknown): v is string => typeof v === 'string'
|
|
92
116
|
const isRecord = (v: unknown): v is Record<string, unknown> => typeof v === 'object' && v !== null && !Array.isArray(v)
|
|
93
117
|
|
|
118
|
+
/** The pin's two grammars, the Delivery API's own: a version 1..999999999 with no leading zero, a brand key. */
|
|
119
|
+
const DESIGN_VERSION = /^[1-9][0-9]{0,8}$/
|
|
120
|
+
const DESIGN_BRAND = /^[a-z0-9](?:[a-z0-9-]{0,98}[a-z0-9])?$/
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* The pin the canary replica passes (`{ design, designBrand? }`, as `designPinFromUrl` returns it),
|
|
124
|
+
* judged. `undefined` ONLY for undefined or null: no pin. A `design` (string or number) and an optional
|
|
125
|
+
* `designBrand` string that both pass the API's grammars are a pin. Anything else is `'invalid'`,
|
|
126
|
+
* including a `designBrand` without a valid `design`, and the card renders nothing for it: a pin that
|
|
127
|
+
* cannot be read never falls back to the live design. Keys other than these two are ignored.
|
|
128
|
+
*/
|
|
129
|
+
export function parseDesignPin(raw: unknown): DesignPin | 'invalid' | undefined {
|
|
130
|
+
if (raw === undefined || raw === null) return undefined
|
|
131
|
+
if (!isRecord(raw)) return 'invalid'
|
|
132
|
+
const { design, designBrand } = raw
|
|
133
|
+
const version = typeof design === 'number' ? String(design) : design
|
|
134
|
+
if (typeof version !== 'string' || !DESIGN_VERSION.test(version)) return 'invalid'
|
|
135
|
+
if (designBrand !== undefined && (typeof designBrand !== 'string' || !DESIGN_BRAND.test(designBrand))) {
|
|
136
|
+
return 'invalid'
|
|
137
|
+
}
|
|
138
|
+
return designBrand === undefined ? { version: Number(version) } : { version: Number(version), brand: designBrand }
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* The raw pin on a page URL, for the canary replica to hand the card as Builder `context`:
|
|
143
|
+
* `searchParams` `design` and `designBrand`, as strings (`design` is '' when only `designBrand` is
|
|
144
|
+
* there, which `parseDesignPin` judges invalid). `undefined` when neither is present, or when `url`
|
|
145
|
+
* does not parse. Never throws; a relative URL is read against a placeholder origin.
|
|
146
|
+
*/
|
|
147
|
+
export function designPinFromUrl(url: string | URL): { design: string; designBrand?: string } | undefined {
|
|
148
|
+
let params: URLSearchParams
|
|
149
|
+
try {
|
|
150
|
+
params = new URL(url, 'http://x').searchParams
|
|
151
|
+
} catch {
|
|
152
|
+
return undefined
|
|
153
|
+
}
|
|
154
|
+
const design = params.get('design')
|
|
155
|
+
const designBrand = params.get('designBrand')
|
|
156
|
+
if (design === null && designBrand === null) return undefined
|
|
157
|
+
return designBrand === null ? { design: design ?? '' } : { design: design ?? '', designBrand }
|
|
158
|
+
}
|
|
159
|
+
|
|
94
160
|
/**
|
|
95
161
|
* The def sibling, shape-checked. Anything that is not the metafield shape is null, which paints
|
|
96
162
|
* the preset default (the same thing an absent def paints): a def is presentation, never a claim,
|
|
@@ -138,7 +204,7 @@ async function loadDelivery(opts: GetVerifiedDeliveryOptions): Promise<CachedDel
|
|
|
138
204
|
try {
|
|
139
205
|
res = await fetchWithDeadline(
|
|
140
206
|
fetchImpl,
|
|
141
|
-
deliveryUrl(opts.baseUrl, opts.platform, opts.externalId),
|
|
207
|
+
deliveryUrl(opts.baseUrl, opts.platform, opts.externalId, opts.design),
|
|
142
208
|
{ headers: { accept: 'application/json' } },
|
|
143
209
|
opts.timeoutMs ?? DEFAULT_FETCH_TIMEOUT_MS,
|
|
144
210
|
)
|
|
@@ -198,15 +264,15 @@ export async function getVerifiedDelivery(opts: GetVerifiedDeliveryOptions): Pro
|
|
|
198
264
|
* caller then awaits `getVerifiedDelivery`). Never fetches.
|
|
199
265
|
*/
|
|
200
266
|
export function peekVerifiedDelivery(
|
|
201
|
-
opts: Pick<GetVerifiedDeliveryOptions, 'baseUrl' | 'platform' | 'externalId' | 'context' | 'cache'>,
|
|
267
|
+
opts: Pick<GetVerifiedDeliveryOptions, 'baseUrl' | 'platform' | 'externalId' | 'context' | 'cache' | 'design'>,
|
|
202
268
|
): VerifiedDelivery | undefined {
|
|
203
269
|
const cached = (opts.cache ?? sharedDeliveryCache).peek(deliveryCacheKey(opts))
|
|
204
270
|
return cached === undefined ? undefined : settleDelivery(cached, opts.context)
|
|
205
271
|
}
|
|
206
272
|
|
|
207
|
-
/** Drop
|
|
273
|
+
/** Drop the cached read for one placement (e.g. from a revocation webhook); with `design`, that pinned read. */
|
|
208
274
|
export function invalidateDelivery(
|
|
209
|
-
opts: Pick<GetVerifiedDeliveryOptions, 'baseUrl' | 'platform' | 'externalId' | 'context'>,
|
|
275
|
+
opts: Pick<GetVerifiedDeliveryOptions, 'baseUrl' | 'platform' | 'externalId' | 'context' | 'design'>,
|
|
210
276
|
cache: TtlCache<CachedDelivery> = sharedDeliveryCache,
|
|
211
277
|
): void {
|
|
212
278
|
cache.delete(deliveryCacheKey(opts))
|