@certrev/cert-block 1.1.1 → 1.2.0-canary.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/CHANGELOG.md +43 -0
- package/README.md +50 -4
- package/dist/builder/cert-chrome-data.d.ts +10 -0
- package/dist/builder/cert-chrome-data.d.ts.map +1 -1
- package/dist/builder/cert-chrome-data.js.map +1 -1
- package/dist/builder/cert-review-card.d.ts.map +1 -1
- package/dist/builder/cert-review-card.js +22 -2
- package/dist/builder/cert-review-card.js.map +1 -1
- package/dist/builder/envelope-face.d.ts +25 -1
- package/dist/builder/envelope-face.d.ts.map +1 -1
- package/dist/builder/envelope-face.js +40 -0
- package/dist/builder/envelope-face.js.map +1 -1
- package/dist/builder/index.d.ts +1 -1
- package/dist/builder/index.d.ts.map +1 -1
- package/dist/builder/index.js +1 -1
- package/dist/builder/index.js.map +1 -1
- package/dist/reader/face.d.ts +12 -0
- package/dist/reader/face.d.ts.map +1 -0
- package/dist/reader/face.js +19 -0
- package/dist/reader/face.js.map +1 -0
- package/dist/reader/helpers.d.ts +48 -0
- package/dist/reader/helpers.d.ts.map +1 -0
- package/dist/reader/helpers.js +166 -0
- package/dist/reader/helpers.js.map +1 -0
- package/dist/reader/index.d.ts +10 -0
- package/dist/reader/index.d.ts.map +1 -0
- package/dist/reader/index.js +10 -0
- package/dist/reader/index.js.map +1 -0
- package/dist/reader/logo.d.ts +4 -0
- package/dist/reader/logo.d.ts.map +1 -0
- package/dist/reader/logo.js +23 -0
- package/dist/reader/logo.js.map +1 -0
- package/dist/reader/reader-css.generated.d.ts +2 -0
- package/dist/reader/reader-css.generated.d.ts.map +1 -0
- package/dist/reader/reader-css.generated.js +6 -0
- package/dist/reader/reader-css.generated.js.map +1 -0
- package/dist/reader/render.d.ts +26 -0
- package/dist/reader/render.d.ts.map +1 -0
- package/dist/reader/render.js +230 -0
- package/dist/reader/render.js.map +1 -0
- package/dist/reader/tokens.d.ts +8 -0
- package/dist/reader/tokens.d.ts.map +1 -0
- package/dist/reader/tokens.js +65 -0
- package/dist/reader/tokens.js.map +1 -0
- package/dist/verify/get-verified-delivery.d.ts.map +1 -1
- package/dist/verify/get-verified-delivery.js +5 -1
- package/dist/verify/get-verified-delivery.js.map +1 -1
- package/package.json +7 -1
- package/src/builder/cert-chrome-data.ts +10 -0
- package/src/builder/cert-review-card.tsx +31 -2
- package/src/builder/envelope-face.ts +54 -5
- package/src/builder/index.tsx +3 -0
- package/src/reader/face.ts +35 -0
- package/src/reader/helpers.ts +178 -0
- package/src/reader/index.ts +14 -0
- package/src/reader/logo.ts +28 -0
- package/src/reader/reader-css.generated.ts +5 -0
- package/src/reader/reader.css +550 -0
- package/src/reader/render.ts +319 -0
- package/src/reader/tokens.ts +76 -0
- package/src/verify/get-verified-delivery.ts +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,49 @@ 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.0 · 2026-10-03
|
|
9
|
+
|
|
10
|
+
Minor, published to the `canary` dist-tag only until a CertREV Builder space has painted it: a new,
|
|
11
|
+
**opt-in** card face. **Legacy output is unchanged**: every def that does not say `face: 'reader'`
|
|
12
|
+
renders exactly the bytes 1.1.1 renders, and an options-only block (no `delivery` marker) never reads
|
|
13
|
+
the def at all. No integration needs a code change.
|
|
14
|
+
|
|
15
|
+
- **The reader face.** certrev.com's "reader" design (the banner card with the expert memo, the sidebar
|
|
16
|
+
card, the floating pill) as a second face on the Builder card. It is selected only when the delivered
|
|
17
|
+
render def says `face: 'reader'`, spelled exactly; `legacy`, an unknown name, a non-string, a padded or
|
|
18
|
+
capitalised `Reader` all keep painting the face 1.1.1 paints. The markup is byte-equal to the Shopify
|
|
19
|
+
`certrev-reader-*` snippets (the portal's canonical render), held by golden pages copied from the
|
|
20
|
+
portal with their sha256 and by a differential suite over the Liquid harness's output.
|
|
21
|
+
- **What 1.1.1 did with the new keys.** Its def parser kept only `v`, `preset`, `rung`, `tokens`,
|
|
22
|
+
`hidden`, `barInkFg`, `layout` and `customFace`: a def carrying `face` or `accentFg` was neither
|
|
23
|
+
rejected nor honoured, the keys were dropped and the legacy face painted with the def's tokens. So a
|
|
24
|
+
1.1.x space keeps painting the legacy face for a reader-face brand, and 1.2.0 reads `face` (a string)
|
|
25
|
+
and `accentFg` (`#141414` or `#ffffff`) from the def; a malformed value is dropped, never a reason to
|
|
26
|
+
reject the def.
|
|
27
|
+
- **The stylesheet** is the portal's reader CSS (the generated section of `certrev-cert.css`), copied
|
|
28
|
+
byte for byte: new exports `@certrev/cert-block/reader.css` (the file) and `READER_CSS`
|
|
29
|
+
(`@certrev/cert-block/reader`, react-free). The Builder card inlines it once per card, inside the
|
|
30
|
+
face's wrapper, in a `<style data-certrev-reader-css>`. The `--cr-*` variables stay on `.certrev-reader`.
|
|
31
|
+
`pnpm refresh:reader` regenerates the CSS, its TS copy and the golden fixtures from a portal checkout.
|
|
32
|
+
- **Fonts.** The stylesheet declares reader-only `@font-face` aliases, "CertREV Reader Serif" (400-700, with
|
|
33
|
+
italic) and "CertREV Reader Grotesk" (400-800), whose `src` is `https://assets.certrev.com/fonts/*.woff2`,
|
|
34
|
+
and the serif and grotesk `--cr-bf` stacks name the alias first, then the legacy family. The card makes no
|
|
35
|
+
request itself, but the browser fetches those woff2 files for a serif or grotesk reader card: a host with a
|
|
36
|
+
`font-src` CSP needs `https://assets.certrev.com` for the card too, and without it the stack falls through
|
|
37
|
+
to the legacy name and the generic family. The legacy `@font-face` rules and the other slots are untouched.
|
|
38
|
+
- **New exports.** `@certrev/cert-block/reader` (`renderReaderFace`, `READER_CSS`),
|
|
39
|
+
`envelopeCardHtml`, `isReaderFaceDef` and `READER_FACE` on `./builder` and `./builder/face`, and
|
|
40
|
+
`face` / `accentFg` on `CertChromeRenderDef`. `envelopeCardInput`, `renderCertBlock` and
|
|
41
|
+
`@certrev/cert-contract` are untouched.
|
|
42
|
+
- **Modal and links.** The profile and certificate links carry `data-certrev-modal-open` (the profile's
|
|
43
|
+
`="expert"`), as the Liquid face's; the card emits the hooks and the host wires the modal script. The
|
|
44
|
+
face makes no request of its own (the fonts above are the browser's). Its anchors carry `CERTREV_LINK_REL` (`nofollow sponsored noopener`), as the legacy
|
|
45
|
+
faces' do, so the sponsored/nofollow signal Builder pages declare today survives the new face. The Liquid
|
|
46
|
+
snippets say `noopener noreferrer`; the `rel` value on the anchors is the only byte the reader differs
|
|
47
|
+
from them in, and a named test (`reader-link-rel.test.ts`) pins that over every golden and harness cell.
|
|
48
|
+
- **Tests.** The legacy face is pinned against 1.1.1's own output (136 cases, from the `cert-block@1.1.1`
|
|
49
|
+
tag's source) and `avatar-alt-sync` now knows the brand mark the reader paints.
|
|
50
|
+
|
|
8
51
|
## 1.1.1 · 2026-09-26
|
|
9
52
|
|
|
10
53
|
Patch: the browser bundle no longer hides or replaces a face, and each certificate control opens
|
package/README.md
CHANGED
|
@@ -64,6 +64,17 @@ import { certRevCertComponent, BUILDER_REGISTRATION, CERT_COMPONENT_NAME } from
|
|
|
64
64
|
// plus the brand's render def, to the renderCertBlock input a `delivery`-marker card paints.
|
|
65
65
|
// A server-side preview renders through the same function as the card.
|
|
66
66
|
import { envelopeCardInput, faceFromDef, themeFromDef, layoutFor, CERT_FACE_FIELDS } from '@certrev/cert-block/builder/face'
|
|
67
|
+
// 1.2.0: the same subpath's card-level entry, which also picks the reader face when the def says
|
|
68
|
+
// `face: 'reader'` (every other def gets exactly the renderCertBlock face, as before).
|
|
69
|
+
import { envelopeCardHtml, isReaderFaceDef, READER_FACE } from '@certrev/cert-block/builder/face'
|
|
70
|
+
|
|
71
|
+
// 1.2.0: the reader face (certrev.com's "What your reader sees" design), react-free: the same markup
|
|
72
|
+
// the Shopify reader snippets paint, and its stylesheet. A `delivery`-marker Builder card paints it by
|
|
73
|
+
// itself when the brand's def says `face: 'reader'`; import this subpath for a server-side preview,
|
|
74
|
+
// or a host that places the pieces itself.
|
|
75
|
+
import { renderReaderFace, READER_CSS } from '@certrev/cert-block/reader'
|
|
76
|
+
// The same stylesheet as a file: the generated reader section of the Shopify stylesheet, byte for byte.
|
|
77
|
+
import readerCss from '@certrev/cert-block/reader.css'
|
|
67
78
|
|
|
68
79
|
// Certificate modal: the ONE SIDE-EFFECTING entry in the package. Importing it registers
|
|
69
80
|
// <certrev-cert-modal> and, in a browser, starts three DOM passes (placement, interactions,
|
|
@@ -276,6 +287,39 @@ actually makes (`mode`, `part`). The component enforces the fused-credential rul
|
|
|
276
287
|
construction (a credential is unrenderable without its dated verification) and themes to the
|
|
277
288
|
brand's render-def (accent / surface / corners / font + v2 bar-ink / body-ink).
|
|
278
289
|
|
|
290
|
+
### The reader face (1.2.0, opt-in)
|
|
291
|
+
|
|
292
|
+
certrev.com's "reader" design (a banner card plus the expert memo, a sidebar card, a floating pill) is a
|
|
293
|
+
**second face** beside the one every earlier version paints. A `delivery`-marker card paints it only when
|
|
294
|
+
the Delivery API's render def says `face: 'reader'`, spelled exactly. Any other def (no `face`, `legacy`, an
|
|
295
|
+
unknown name, a non-string) paints exactly the bytes 1.1.1 painted: the byte tests in
|
|
296
|
+
`src/builder/__tests__/legacy-face-1.1.1.test.ts` compare it to the 1.1.1 tag's own output. A block without
|
|
297
|
+
the `delivery` marker (an options-only block) never reads the envelope, so it stays on the legacy face.
|
|
298
|
+
|
|
299
|
+
- **Same bytes as the Liquid.** The markup is the Shopify `certrev-reader-*` snippets', and the portal's
|
|
300
|
+
golden pages are copied into `src/reader/__tests__/fixtures/golden/` with their sha256, so the two
|
|
301
|
+
cannot drift without a test saying so.
|
|
302
|
+
- **The stylesheet** is the generated reader section of `certrev-cert.css`
|
|
303
|
+
(`/* CERTREV-READER-GEN:BEGIN */ ... END`), copied byte for byte as `src/reader/reader.css` (`./reader.css`)
|
|
304
|
+
and as `READER_CSS`. The card inlines it once, in a `<style data-certrev-reader-css>`, inside the face's
|
|
305
|
+
wrapper; the brand's colours, corners and font ride the `--cr-*` variables on `.certrev-reader`.
|
|
306
|
+
`pnpm refresh:reader` regenerates the CSS, the TS copy and the fixtures from a portal checkout.
|
|
307
|
+
The stylesheet carries six `@font-face` rules for the reader's own serif and grotesk aliases ("CertREV
|
|
308
|
+
Reader Serif" and "CertREV Reader Grotesk", Playfair Display and Plus Jakarta Sans at the widths the
|
|
309
|
+
reader paints). Their `src` is `https://assets.certrev.com/fonts/*.woff2`, so the **browser** loads
|
|
310
|
+
those files when a serif or grotesk reader card paints; the card itself still makes no request. A host
|
|
311
|
+
whose CSP has no `font-src` for that origin gets the stack's next family (the legacy Playfair or Jakarta
|
|
312
|
+
name, then the generic), never a broken card.
|
|
313
|
+
- **Modal and links.** The profile and certificate links carry `data-certrev-modal-open` (the profile's
|
|
314
|
+
with `="expert"`), as in the Liquid face; the card only emits the hooks, and the host loads the modal
|
|
315
|
+
script as for any face. The face makes no request of its own. Its links carry `CERTREV_LINK_REL`
|
|
316
|
+
(`nofollow sponsored noopener`), as every other face's do, so a Builder page keeps declaring the paid
|
|
317
|
+
placement; the Liquid snippets say `noopener noreferrer`, and that `rel` value is the one byte the face
|
|
318
|
+
does not share with them.
|
|
319
|
+
- **Layout** follows the editor's `mode` when set, else the def's `layout`, else the banner; the reader
|
|
320
|
+
has no custom composition, so a `custom` layout paints the banner. The sidebar card floats right inside
|
|
321
|
+
a wrapper that establishes its own formatting context (`display: flow-root`).
|
|
322
|
+
|
|
279
323
|
### PUSH trust model
|
|
280
324
|
|
|
281
325
|
Read this before choosing PUSH. The registered card is **chrome, not a verifier**, and it is a
|
|
@@ -344,9 +388,11 @@ import certScriptUrl from '@certrev/cert-block/modal/certrev-cert.js?url'
|
|
|
344
388
|
<script src={certScriptUrl} defer />
|
|
345
389
|
```
|
|
346
390
|
|
|
347
|
-
CSP allowances for the headless host. The **registered card** needs none
|
|
348
|
-
loads no image (the avatar is rendered initials) and inlines its logo as SVG.
|
|
349
|
-
|
|
391
|
+
CSP allowances for the headless host. The **registered card** needs none on the legacy face: it fetches
|
|
392
|
+
no font, loads no image (the avatar is rendered initials) and inlines its logo as SVG. The reader face's
|
|
393
|
+
inlined stylesheet names `https://assets.certrev.com/fonts/` in its `@font-face` rules for the serif and
|
|
394
|
+
grotesk slots, so a host that wants those fonts needs the `font-src` below for the card as well as the
|
|
395
|
+
modal (`data-fonts="host"` only stops the modal's injection). These are what the **modal** needs:
|
|
350
396
|
|
|
351
397
|
- `connect-src` → the CertREV Delivery origin the element fetches the signed envelope from
|
|
352
398
|
(production `https://portal.certrev.com`; staging `https://staging.portal.certrev.com`).
|
|
@@ -625,7 +671,7 @@ published at `@certrev/cert-block/fixtures`).
|
|
|
625
671
|
|
|
626
672
|
## Version
|
|
627
673
|
|
|
628
|
-
`1.
|
|
674
|
+
`1.2.0-canary.0`: see [CHANGELOG.md](./CHANGELOG.md) for the release history and the semver contract
|
|
629
675
|
(patch/minor never change the rendered cert output or break a compiling integration). Publishes
|
|
630
676
|
**publicly** to npm as `@certrev/cert-block` (`publishConfig.access: public`) via GitHub Actions
|
|
631
677
|
trusted publishing (OIDC); the internal `@certrev` GitHub-Packages channel mirrors it.
|
|
@@ -46,6 +46,16 @@ export interface CertChromeRenderDef {
|
|
|
46
46
|
};
|
|
47
47
|
/** The auto-contrast bar foreground — present only on a barInk-themed face (v2). */
|
|
48
48
|
readonly barInkFg?: '#141414' | '#ffffff';
|
|
49
|
+
/**
|
|
50
|
+
* The ink painted over the ACCENT fill, as the portal derived it (1.2.0, reader face). Only the reader face reads
|
|
51
|
+
* it: the legacy face re-derives its own accent ink from `tokens.accentColor` and ignores this.
|
|
52
|
+
*/
|
|
53
|
+
readonly accentFg?: '#141414' | '#ffffff';
|
|
54
|
+
/**
|
|
55
|
+
* The face the brand chose (1.2.0). `'reader'` selects the certrev.com reader face; absent, or any other value,
|
|
56
|
+
* paints the face 1.1.1 paints (unknown faces degrade to the legacy face, never to nothing).
|
|
57
|
+
*/
|
|
58
|
+
readonly face?: string;
|
|
49
59
|
/** The subtractive field-visibility hide-set. */
|
|
50
60
|
readonly hidden: readonly string[];
|
|
51
61
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cert-chrome-data.d.ts","sourceRoot":"","sources":["../../src/builder/cert-chrome-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IACnC,8EAA8E;IAC9E,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE;QAChB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;QAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;QACzB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;QAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;QAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;QACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAC1B,CAAA;IACD,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IACzC,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;IAClC;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,uEAAuE;IACvE,QAAQ,CAAC,UAAU,CAAC,EAAE;QAAE,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,CAAA;CAClE;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,kBAAkB;IAClC,mFAAmF;IACnF,QAAQ,CAAC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M,GAAG,IAAI,CAAA;IACzB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,0DAA0D;IAC1D,OAAO,EAAE;QACR,eAAe,EAAE,OAAO,CAAA;QACxB,kGAAkG;QAClG,eAAe,EAAE,OAAO,CAAA;KACxB,CAAA;IACD,qFAAqF;IACrF,SAAS,EAAE,mBAAmB,GAAG,IAAI,CAAA;IACrC,kGAAkG;IAClG,cAAc,EAAE,MAAM,CAAA;IACtB;;;;;OAKG;IACH,QAAQ,EAAE,kBAAkB,GAAG,IAAI,CAAA;CACnC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,kUAqB3B,CAAA;AAEV,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cert-chrome-data.js","sourceRoot":"","sources":["../../src/builder/cert-chrome-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;
|
|
1
|
+
{"version":3,"file":"cert-chrome-data.js","sourceRoot":"","sources":["../../src/builder/cert-chrome-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAuJH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACvC,oBAAoB;IACpB,wBAAwB;IACxB,aAAa;IACb,cAAc;IACd,KAAK;IACL,YAAY;IACZ,MAAM;IACN,iBAAiB;IACjB,WAAW;IACX,eAAe;IACf,oBAAoB;IACpB,WAAW;IACX,aAAa;IACb,mBAAmB;IACnB,YAAY;IACZ,aAAa;IACb,SAAS;IACT,WAAW;IACX,gBAAgB;IAChB,UAAU;CACD,CAAA;AAIV;;;;;GAKG;AACH,MAAM,cAAc,GAA8C,MAAM,CAAC,WAAW,CACnF,wBAAwB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CACR,CAAA;AACvC,MAAM,eAAe,GAAuC,cAAc,CAAA;AAC1E,KAAK,eAAe,CAAA"}
|
|
@@ -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;AAIxF,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;;;;;OAKG;IACH,cAAc,CAAC,EAAE;QAAE,QAAQ,CAAC,OAAO,CAAC,EAAE;YAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,OAAO,CAAA;SAAE,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAA;CAC/E;AAsCD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAe1F;AA2GD,wBAAgB,cAA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A;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"}
|
|
@@ -23,10 +23,11 @@ import { Suspense } from 'react';
|
|
|
23
23
|
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
|
+
import { READER_CSS } from '../reader/reader-css.generated.js';
|
|
26
27
|
import { getVerifiedDelivery, peekVerifiedDelivery } from '../verify/get-verified-delivery.js';
|
|
27
28
|
import { BUILDER_CERT_CHROME_KEYS } from './cert-chrome-data.js';
|
|
28
29
|
import { cardDeliveryRuntime } from './delivery-runtime.js';
|
|
29
|
-
import { envelopeCardInput } from './envelope-face.js';
|
|
30
|
+
import { envelopeCardHtml, envelopeCardInput, isReaderFaceDef } from './envelope-face.js';
|
|
30
31
|
/**
|
|
31
32
|
* The canonical Builder block name. A brand's registration + the portal
|
|
32
33
|
* `certComponent` connection field default to THIS; config exists only for
|
|
@@ -119,6 +120,11 @@ function suspendOn(key, start) {
|
|
|
119
120
|
* in; the button is native, so Enter and Space reach it as clicks. Bound after hydration only: the
|
|
120
121
|
* server HTML is the collapsed face, which is also what a reader without JS keeps (the whole memo
|
|
121
122
|
* is still in the text for a screen reader, and the desktop never clamps it).
|
|
123
|
+
*
|
|
124
|
+
* `reader` (1.2.0) is true ONLY for a def whose `face` is `'reader'`; it adds two things to the wrapper and nothing to
|
|
125
|
+
* any other face: `data-certrev-face="reader"` and `display: flow-root`. The reader sidebar card is a right float, and
|
|
126
|
+
* on a Shopify page the placement script and its wrapper contain it; a Builder block has no such ancestor, so the
|
|
127
|
+
* wrapper contains the float itself and the block keeps its own box in the page.
|
|
122
128
|
*/
|
|
123
129
|
function EnvelopeFace(props) {
|
|
124
130
|
const ref = React.useRef(null);
|
|
@@ -134,7 +140,7 @@ function EnvelopeFace(props) {
|
|
|
134
140
|
el.addEventListener('click', onClick);
|
|
135
141
|
return () => el.removeEventListener('click', onClick);
|
|
136
142
|
}, []);
|
|
137
|
-
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,
|
|
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' } } : {}),
|
|
138
144
|
// biome-ignore lint/security/noDangerouslySetInnerHtml: renderCertBlock is the escaping-safe SSR string renderer
|
|
139
145
|
dangerouslySetInnerHTML: { __html: props.html } }));
|
|
140
146
|
}
|
|
@@ -148,6 +154,20 @@ function EnvelopeCertReviewCard(props) {
|
|
|
148
154
|
// Revoked, expired, unverifiable, for another entry, or unreachable: nothing at all.
|
|
149
155
|
if (settled.verdict.decision !== 'render')
|
|
150
156
|
return null;
|
|
157
|
+
// 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
|
+
// def (no face, an unknown face) falls through to the legacy lines below, untouched since 1.1.1.
|
|
159
|
+
if (isReaderFaceDef(settled.renderDef)) {
|
|
160
|
+
const reader = envelopeCardHtml(settled.verdict.payload.content, settled.renderDef, {
|
|
161
|
+
mode: props.mode,
|
|
162
|
+
part: props.part,
|
|
163
|
+
certId: settled.verdict.payload.certId,
|
|
164
|
+
});
|
|
165
|
+
if (!reader)
|
|
166
|
+
return null;
|
|
167
|
+
return (_jsx(EnvelopeFace, { reader: true,
|
|
168
|
+
// The stylesheet rides inside the face, once per card; it is the portal's reader CSS byte for byte.
|
|
169
|
+
html: `<style data-certrev-reader-css>${READER_CSS}</style>${reader}`, defVersion: settled.renderDef ? settled.renderDef.v : undefined }));
|
|
170
|
+
}
|
|
151
171
|
const input = envelopeCardInput(settled.verdict.payload.content, settled.renderDef, {
|
|
152
172
|
mode: props.mode,
|
|
153
173
|
part: props.part,
|
|
@@ -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,EAA2B,MAAM,6BAA6B,CAAA;AAC3F,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAyB,MAAM,oCAAoC,CAAA;AAErH,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;
|
|
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,EAA2B,MAAM,6BAA6B,CAAA;AAC3F,OAAO,EAAE,UAAU,EAAE,M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,uCAAuC;QACnD,YAAY,EAAE,SAAS;QACvB,IAAI,EAAE;YACL,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;YACtC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;YACpC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;SACxC;KACD;IACD;QACC,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,aAAa;QAC3B,yFAAyF;QACzF,wEAAwE;QACxE,UAAU,EAAE,wDAAwD;QACpE,YAAY,EAAE,MAAM;QACpB,IAAI,EAAE;YACL,EAAE,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,MAAM,EAAE;YAChD,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE;YACzC,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE;SACrC;KACD;CACD,CAAA;AAWD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAiC;IACjE,IAAI,EAAE,mBAAmB;IACzB,SAAS,EAAE,cAAc;IACzB,MAAM,EAAE,CAAC,GAAG,gBAAgB,EAAE,GAAG,WAAW,CAAC;IAC7C,yBAAyB,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE;CACnD,CAAA;AAqBD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAsC;IACtE,IAAI,EAAE,mBAAmB;IACzB,SAAS,EAAE,cAAc;IACzB,WAAW,EACV,4HAA4H;IAC7H,MAAM,EAAE,CAAC,GAAG,gBAAgB,EAAE,GAAG,WAAW,CAAC;IAC7C,yBAAyB,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE;CACnD,CAAA"}
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* The caller has already run the kernel. This function never decides WHETHER to render a cert;
|
|
26
26
|
* it only returns null when the verified content cannot make a face (no reviewer, no verify URL).
|
|
27
27
|
*/
|
|
28
|
-
import type
|
|
28
|
+
import { type CertBlockFace, type CertBlockLayout, type RenderCertBlockInput } from '../components/render-cert-block.js';
|
|
29
29
|
import { type ResolvedBlockTheme } from '../components/render-def.js';
|
|
30
30
|
import type { CertContent } from '../contract/kernel.js';
|
|
31
31
|
import type { CertChromeRenderDef } from './cert-chrome-data.js';
|
|
@@ -39,6 +39,10 @@ export interface EnvelopeCardOptions {
|
|
|
39
39
|
readonly mode?: unknown;
|
|
40
40
|
/** Banner memo placement, passed through as on the options path. */
|
|
41
41
|
readonly part?: unknown;
|
|
42
|
+
/** The verified payload's `certId`: stamped on the reader face (`data-certrev-cert-id`). The legacy face ignores it. */
|
|
43
|
+
readonly certId?: unknown;
|
|
44
|
+
/** A CertREV preview, never a live page: the reader face words the cue's empty slot as the demo does. Only `true` counts. */
|
|
45
|
+
readonly illustrative?: unknown;
|
|
42
46
|
}
|
|
43
47
|
/** The def's theme tokens as `renderCertBlock` theme input, with the accent ink derived. */
|
|
44
48
|
export declare function themeFromDef(def: CertChromeRenderDef | null): Partial<ResolvedBlockTheme> | undefined;
|
|
@@ -60,4 +64,24 @@ export declare function credentialLabel(expert: Record<string, unknown>): {
|
|
|
60
64
|
* null when the content cannot make a face.
|
|
61
65
|
*/
|
|
62
66
|
export declare function envelopeCardInput(content: CertContent, renderDef: CertChromeRenderDef | null, options?: EnvelopeCardOptions): RenderCertBlockInput | null;
|
|
67
|
+
/** The def `face` that selects the certrev.com reader face (1.2.0). Nothing else does. */
|
|
68
|
+
export declare const READER_FACE = "reader";
|
|
69
|
+
/** Whether a def asks for the reader face: `face === 'reader'`, exactly. Absent or any other value is the legacy face. */
|
|
70
|
+
export declare function isReaderFaceDef(def: CertChromeRenderDef | null | undefined): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* The card's HTML for a verified envelope's content and the brand's def, or '' when nothing paints.
|
|
73
|
+
*
|
|
74
|
+
* THE ONE SELECTION POINT between the two faces, react-free so the portal's preview reaches it too:
|
|
75
|
+
* - `renderDef.face === 'reader'` paints the reader face (`renderReaderFace`), the same bytes as the Shopify reader
|
|
76
|
+
* snippets for the same facts;
|
|
77
|
+
* - EVERY other def (no `face`, `face: 'legacy'`, a face this version has never heard of, no def at all) paints
|
|
78
|
+
* exactly `renderCertBlock(envelopeCardInput(...))`, byte for byte what 1.1.1 paints. An unknown face degrades to
|
|
79
|
+
* the face the page had before, never to nothing and never to the reader.
|
|
80
|
+
* The reader branch sits BESIDE the legacy one; `envelopeCardInput` and `renderCertBlock` are not touched.
|
|
81
|
+
*
|
|
82
|
+
* Both faces keep the one gate they share: a content with no reviewer name or no certificate URL cannot make a face.
|
|
83
|
+
* The reader's layout is `layoutFor` (an editor mode wins, then the def's own layout, else banner); the legacy-only
|
|
84
|
+
* `custom` composition has no reader twin and paints the reader banner.
|
|
85
|
+
*/
|
|
86
|
+
export declare function envelopeCardHtml(content: CertContent, renderDef: CertChromeRenderDef | null, options?: EnvelopeCardOptions): string;
|
|
63
87
|
//# sourceMappingURL=envelope-face.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envelope-face.d.ts","sourceRoot":"","sources":["../../src/builder/envelope-face.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"envelope-face.d.ts","sourceRoot":"","sources":["../../src/builder/envelope-face.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,eAAe,EAEpB,KAAK,oBAAoB,EAEzB,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EAA+C,KAAK,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAClH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAA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;GAcG;AACH,wBAAgB,gBAAgB,CAC/B,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,mBAAmB,GAAG,IAAI,EACrC,OAAO,GAAE,mBAAwB,GAC/B,MAAM,CAcR"}
|
|
@@ -25,7 +25,9 @@
|
|
|
25
25
|
* The caller has already run the kernel. This function never decides WHETHER to render a cert;
|
|
26
26
|
* it only returns null when the verified content cannot make a face (no reviewer, no verify URL).
|
|
27
27
|
*/
|
|
28
|
+
import { renderCertBlock, } from '../components/render-cert-block.js';
|
|
28
29
|
import { accentFg, HIDEABLE_FIELDS, isOpaqueHexColor } from '../components/render-def.js';
|
|
30
|
+
import { renderReaderFace } from '../reader/render.js';
|
|
29
31
|
/**
|
|
30
32
|
* Every field id `renderCertBlock` places, in its canonical order. A def-driven face places all of
|
|
31
33
|
* them except what the def hides; `renderCertBlock` still gates each on its fact being present.
|
|
@@ -148,4 +150,42 @@ export function envelopeCardInput(content, renderDef, options = {}) {
|
|
|
148
150
|
},
|
|
149
151
|
};
|
|
150
152
|
}
|
|
153
|
+
/** The def `face` that selects the certrev.com reader face (1.2.0). Nothing else does. */
|
|
154
|
+
export const READER_FACE = 'reader';
|
|
155
|
+
/** Whether a def asks for the reader face: `face === 'reader'`, exactly. Absent or any other value is the legacy face. */
|
|
156
|
+
export function isReaderFaceDef(def) {
|
|
157
|
+
return def?.face === READER_FACE;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* The card's HTML for a verified envelope's content and the brand's def, or '' when nothing paints.
|
|
161
|
+
*
|
|
162
|
+
* THE ONE SELECTION POINT between the two faces, react-free so the portal's preview reaches it too:
|
|
163
|
+
* - `renderDef.face === 'reader'` paints the reader face (`renderReaderFace`), the same bytes as the Shopify reader
|
|
164
|
+
* snippets for the same facts;
|
|
165
|
+
* - EVERY other def (no `face`, `face: 'legacy'`, a face this version has never heard of, no def at all) paints
|
|
166
|
+
* exactly `renderCertBlock(envelopeCardInput(...))`, byte for byte what 1.1.1 paints. An unknown face degrades to
|
|
167
|
+
* the face the page had before, never to nothing and never to the reader.
|
|
168
|
+
* The reader branch sits BESIDE the legacy one; `envelopeCardInput` and `renderCertBlock` are not touched.
|
|
169
|
+
*
|
|
170
|
+
* Both faces keep the one gate they share: a content with no reviewer name or no certificate URL cannot make a face.
|
|
171
|
+
* The reader's layout is `layoutFor` (an editor mode wins, then the def's own layout, else banner); the legacy-only
|
|
172
|
+
* `custom` composition has no reader twin and paints the reader banner.
|
|
173
|
+
*/
|
|
174
|
+
export function envelopeCardHtml(content, renderDef, options = {}) {
|
|
175
|
+
const input = envelopeCardInput(content, renderDef, options);
|
|
176
|
+
if (!input)
|
|
177
|
+
return '';
|
|
178
|
+
if (!isReaderFaceDef(renderDef))
|
|
179
|
+
return renderCertBlock(input);
|
|
180
|
+
const chosen = layoutFor(renderDef, options.mode);
|
|
181
|
+
const layout = chosen === 'custom' ? 'banner' : chosen;
|
|
182
|
+
return renderReaderFace({
|
|
183
|
+
content,
|
|
184
|
+
def: renderDef,
|
|
185
|
+
layout,
|
|
186
|
+
part: input.part,
|
|
187
|
+
certId: typeof options.certId === 'string' ? options.certId : undefined,
|
|
188
|
+
illustrative: options.illustrative === true,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
151
191
|
//# sourceMappingURL=envelope-face.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envelope-face.js","sourceRoot":"","sources":["../../src/builder/envelope-face.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;
|
|
1
|
+
{"version":3,"file":"envelope-face.js","sourceRoot":"","sources":["../../src/builder/envelope-face.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAKN,eAAe,GACf,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,gBAAgB,EAA2B,MAAM,6BAA6B,CAAA;AAElH,OAAO,EAAqB,gBAAgB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CHANGED
|
@@ -102,5 +102,5 @@ export interface CertRevBuilderRegistration {
|
|
|
102
102
|
export declare const certRevAnchorComponent: CertRevBuilderRegistration;
|
|
103
103
|
export { BUILDER_CERT_CHROME_KEYS, type BuilderCertChromeData, type BuilderCertChromeKey, type CertChromeRenderDef, type CertDeliveryMarker, } from './cert-chrome-data.js';
|
|
104
104
|
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
|
-
export { CERT_FACE_FIELDS, credentialLabel, type EnvelopeCardOptions, envelopeCardInput, faceFromDef, layoutFor, themeFromDef, } from './envelope-face.js';
|
|
105
|
+
export { CERT_FACE_FIELDS, credentialLabel, type EnvelopeCardOptions, envelopeCardHtml, envelopeCardInput, faceFromDef, isReaderFaceDef, layoutFor, READER_FACE, themeFromDef, } from './envelope-face.js';
|
|
106
106
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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,CAAC,EAAE,MAAM,CAAA;CACzB;AASD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAC/B,OAAO,EACP,SAAiB,EACjB,QAAQ,GACR,EAAE;IACF,QAAQ,CA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108,5 @@ export const certRevAnchorComponent = {
|
|
|
108
108
|
// ── The Builder.io PUSH kit (CertReviewCard) + the single-sourced wire type ──
|
|
109
109
|
export { BUILDER_CERT_CHROME_KEYS, } from './cert-chrome-data.js';
|
|
110
110
|
export { acceptedDeliveryMarker, BUILDER_REGISTRATION, CERT_COMPONENT_NAME, CertReviewCard, certRevCertComponent, PLACEMENT_INPUTS, WIRE_INPUTS, } from './cert-review-card.js';
|
|
111
|
-
export { CERT_FACE_FIELDS, credentialLabel, envelopeCardInput, faceFromDef, layoutFor, themeFromDef, } from './envelope-face.js';
|
|
111
|
+
export { CERT_FACE_FIELDS, credentialLabel, envelopeCardHtml, envelopeCardInput, faceFromDef, isReaderFaceDef, layoutFor, READER_FACE, themeFromDef, } from './envelope-face.js';
|
|
112
112
|
//# sourceMappingURL=index.js.map
|
|
@@ -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,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,YAAG,QAAQ,GAA2B,CAAA;AACpG,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB;IACvC,OAAO,CACN,kDACiC,EAAE,EAClC,KAAK,EAAE;YACN,MAAM,EAAE,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IACtB,MAAM,EAAE,EAAE;CACV,CAAA;AAED,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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type ReaderFaceSize = '' | 'sm' | 'lg';
|
|
2
|
+
export interface ReaderFaceInput {
|
|
3
|
+
/** The photo URL on the envelope. */
|
|
4
|
+
readonly photo: unknown;
|
|
5
|
+
/** Whether to ATTEMPT the photo: false never reads the URL (the silhouette shows). */
|
|
6
|
+
readonly show: boolean;
|
|
7
|
+
readonly size: ReaderFaceSize;
|
|
8
|
+
/** The pixel width the resizer is asked for. */
|
|
9
|
+
readonly width: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function readerFace({ photo, show, size, width }: ReaderFaceInput): string;
|
|
12
|
+
//# sourceMappingURL=face.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"face.d.ts","sourceRoot":"","sources":["../../src/reader/face.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,cAAc,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAA;AAE7C,MAAM,WAAW,eAAe;IAC/B,qCAAqC;IACrC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,sFAAsF;IACtF,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;IAC7B,gDAAgD;IAChD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACtB;AAOD,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,eAAe,GAAG,MAAM,CAUhF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `certrev-reader-face`: the round avatar on a reader byline: the person's photo when there is one to show, the
|
|
3
|
+
* silhouette when there is not. The span carries a size class (`sm` for the author, none for the banner reviewer,
|
|
4
|
+
* `lg` for the memo and sidebar reviewer); the image is requested at `width` square through the asset resizer.
|
|
5
|
+
*/
|
|
6
|
+
import { avatarUrl, cleaned, esc, safeUrl } from './helpers.js';
|
|
7
|
+
const SILHOUETTE = '<svg viewBox="0 0 40 40" aria-hidden="true" focusable="false"><circle cx="20" cy="14.8" r="7"/><path d="M20 23.4c-6.9 0-12.6 4.8-13.8 11.2a20 20 0 0 0 27.6 0C32.6 28.2 26.9 23.4 20 23.4Z"/></svg>';
|
|
8
|
+
const DIMENSION = { '': 42, sm: 36, lg: 46 };
|
|
9
|
+
export function readerFace({ photo, show, size, width }) {
|
|
10
|
+
const safe = show ? cleaned(safeUrl(photo)) : '';
|
|
11
|
+
const src = cleaned(avatarUrl(safe, width));
|
|
12
|
+
const dim = DIMENSION[size];
|
|
13
|
+
const cls = size === '' ? 'certrev-r-face' : `certrev-r-face ${esc(size)}`;
|
|
14
|
+
const inner = src !== ''
|
|
15
|
+
? `<img src="${esc(src)}" alt="" width="${dim}" height="${dim}" loading="lazy" decoding="async">`
|
|
16
|
+
: SILHOUETTE;
|
|
17
|
+
return `<span class="${cls}">${inner}</span>`;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=face.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"face.js","sourceRoot":"","sources":["../../src/reader/face.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAc/D,MAAM,UAAU,GACf,qMAAqM,CAAA;AAEtM,MAAM,SAAS,GAA6C,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAA;AAEtF,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAmB;IACvE,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAChD,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAA;IAC3C,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,CAAA;IAC3B,MAAM,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,kBAAkB,GAAG,CAAC,IAAI,CAAC,EAAE,CAAA;IAC1E,MAAM,KAAK,GACV,GAAG,KAAK,EAAE;QACT,CAAC,CAAC,aAAa,GAAG,CAAC,GAAG,CAAC,mBAAmB,GAAG,aAAa,GAAG,oCAAoC;QACjG,CAAC,CAAC,UAAU,CAAA;IACd,OAAO,gBAAgB,GAAG,KAAK,KAAK,SAAS,CAAA;AAC9C,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export type Rec = Readonly<Record<string, unknown>>;
|
|
2
|
+
/** An object's fields, or none: Liquid reads a missing field as nil, never an error. */
|
|
3
|
+
export declare function rec(value: unknown): Rec;
|
|
4
|
+
/** Liquid `escape` as Shopify (and this package) spell it: `& < > " '`. */
|
|
5
|
+
export declare const esc: (value: unknown) => string;
|
|
6
|
+
/** Liquid `default: fallback`: replaces nil, false and the empty string only (whitespace stays). */
|
|
7
|
+
export declare function orDefault(value: unknown, fallback: string): unknown;
|
|
8
|
+
/** `value | default: ''` read as text. */
|
|
9
|
+
export declare const textOr: (value: unknown, fallback?: string) => string;
|
|
10
|
+
/** Liquid's `== blank` for the string-ish values the envelope carries: nil, false, empty or whitespace only. */
|
|
11
|
+
export declare const isBlank: (value: unknown) => boolean;
|
|
12
|
+
/** `{% if x %}` for a value read as a flag: Liquid treats only nil and false as false (the empty string is true). */
|
|
13
|
+
export declare const isTruthy: (value: unknown) => boolean;
|
|
14
|
+
/** Whether a field carries a value after `| default: ''` (so `!= ''` in the snippet). */
|
|
15
|
+
export declare const isPresent: (value: unknown) => boolean;
|
|
16
|
+
/** Liquid `contains`: an array holds the needle, a string includes it, anything else does not. */
|
|
17
|
+
export declare function contains(container: unknown, needle: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Liquid `strip_html` as the portal's liquidjs harness runs it: raw-text blocks (`<script…</script>`, `<style…</style>`,
|
|
20
|
+
* `<!-- … -->`) and then any `<…>` tag are dropped; an opener with no closer is not a block, and once no opener fits
|
|
21
|
+
* the rest of the string is kept as it is. The snippets use it on every captured value because Shopify wraps each
|
|
22
|
+
* `{% render %}` of an app snippet in `<!-- BEGIN/END app snippet -->` comments that would corrupt an attribute.
|
|
23
|
+
*/
|
|
24
|
+
export declare function stripHtml(input: string): string;
|
|
25
|
+
/** `{% capture x %}…{% endcapture %}` then `x | strip_html | strip`, which every snippet applies to a captured value. */
|
|
26
|
+
export declare const cleaned: (value: string) => string;
|
|
27
|
+
/**
|
|
28
|
+
* `certrev-safe-url`: the trimmed URL when it is http(s), protocol-relative or site-relative (`/…`, `#…`), else ''.
|
|
29
|
+
* A `javascript:`, `data:` or other scheme collapses to '' so the caller's `!= ''` guard drops the link or the photo.
|
|
30
|
+
*/
|
|
31
|
+
export declare function safeUrl(url: unknown): string;
|
|
32
|
+
/**
|
|
33
|
+
* `certrev-avatar-url`: a CertREV asset-host photo is requested through the host's `cdn-cgi/image` resizer at
|
|
34
|
+
* `width` square (the query string dropped, which the WAF allowlist pins to empty); any other URL, a lookalike host,
|
|
35
|
+
* an `http://` or `//` form, or a URL already carrying `cdn-cgi/image/`, is returned as it is.
|
|
36
|
+
*/
|
|
37
|
+
export declare function avatarUrl(url: string, width: number): string;
|
|
38
|
+
/**
|
|
39
|
+
* `certrev-reader-first-name`: the name's first word with a leading honorific (Dr., Mr., Mrs., Ms., Prof., Mx.,
|
|
40
|
+
* any case) dropped; '' when nothing is left, which the caller words as "View profile".
|
|
41
|
+
*/
|
|
42
|
+
export declare function firstName(name: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* `certrev-reader-date`: "June 20, 2026" for an ISO timestamp, read in UTC (the portal harness's `date` filter does
|
|
45
|
+
* the same). A value that is not a date prints nothing, so the caller's `!= ''` guard falls to the undated wording.
|
|
46
|
+
*/
|
|
47
|
+
export declare function longDate(iso: unknown): string;
|
|
48
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/reader/helpers.ts"],"names":[],"mappings":"AAeA,MAAM,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;AAInD,wFAAwF;AACxF,wBAAgB,GAAG,CAAC,KAAK,EAAE,OAAO,GAAG,GAAG,CAEvC;AAED,8FAA8F;AAC9F,eAAO,MAAM,GAAG,GAAI,OAAO,OAAO,KAAG,MAAmC,CAAA;AAExE,oGAAoG;AACpG,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEnE;AAED,0CAA0C;AAC1C,eAAO,MAAM,MAAM,GAAI,OAAO,OAAO,EAAE,iBAAa,KAAG,MAA4C,CAAA;AAEnG,gHAAgH;AAChH,eAAO,MAAM,OAAO,GAAI,OAAO,OAAO,KAAG,OAAsC,CAAA;AAE/E,qHAAqH;AACrH,eAAO,MAAM,QAAQ,GAAI,OAAO,OAAO,KAAG,OAAmE,CAAA;AAE7G,yFAAyF;AACzF,eAAO,MAA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