@certrev/cert-block 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/README.md +83 -27
- package/dist/builder/cert-chrome-data.d.ts +1 -1
- package/dist/builder/cert-chrome-data.js +1 -1
- package/dist/builder/cert-review-card.d.ts +27 -3
- package/dist/builder/cert-review-card.d.ts.map +1 -1
- package/dist/builder/cert-review-card.js +21 -3
- package/dist/builder/cert-review-card.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/components/preview-block.d.ts +1 -1
- package/dist/components/preview-block.js +1 -1
- package/dist/components/render-def.d.ts +1 -1
- package/package.json +6 -4
- package/src/__tests__/render-cert-block.test.ts +1 -1
- package/src/builder/__tests__/builder.test.tsx +19 -0
- package/src/builder/cert-chrome-data.ts +1 -1
- package/src/builder/cert-review-card.tsx +38 -3
- package/src/builder/index.tsx +2 -0
- package/src/components/preview-block.ts +1 -1
- package/src/components/render-def.ts +1 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Changelog — @certrev/cert-block
|
|
2
|
+
|
|
3
|
+
The cert card is a **design-locked** component. Semver contract: **patch and minor releases never
|
|
4
|
+
change the rendered cert output and never break a compiling integration** (registration surface,
|
|
5
|
+
exports, types). Anything that would alter what a visitor sees — or require integration changes —
|
|
6
|
+
is announced loudly here first.
|
|
7
|
+
|
|
8
|
+
## 0.5.3 — 2026-07-22
|
|
9
|
+
|
|
10
|
+
- **New:** `certRevCertComponent` (`./builder`) — the drop-in gen2 registration entry, with the
|
|
11
|
+
mutable `inputs[]` the SDK's `RegisteredComponent` type expects:
|
|
12
|
+
`customComponents={[...yourComponents, certRevCertComponent]}`. One import, no re-wrapping, no
|
|
13
|
+
readonly spread. `BUILDER_REGISTRATION` (the readonly canonical view) is unchanged.
|
|
14
|
+
- **New:** the 19 exporter-populated wire inputs are marked `advanced` — the Builder editor's
|
|
15
|
+
Options tab now leads with the two placement inputs (`mode`, `part`) and tucks the
|
|
16
|
+
system-populated fields under "Advanced". Editor-cosmetic only.
|
|
17
|
+
- **Changed:** `@certrev/cert-contract` moved from a peer dependency (`>=0.5.0`, unbounded) to a
|
|
18
|
+
regular dependency (bounded `^0.5.0`) — a plain `npm i @certrev/cert-block` is a complete
|
|
19
|
+
install regardless of the consumer's peer-install settings, and a future contract 0.6 can no
|
|
20
|
+
longer float in unreviewed.
|
|
21
|
+
- **Docs:** README rewritten for the gen2 SDK (`customComponents` array) — the previous README
|
|
22
|
+
showed the gen1 `Builder.registerComponent` API and pre-publish notes that no longer applied
|
|
23
|
+
(the contract package and the modal bundle both ship for real since 0.5.x). Added in-package
|
|
24
|
+
modal instructions (`?url` import + external script + literal CSP allowances), a known-issues
|
|
25
|
+
note (`@builder.io/sdk-react@5.2.4` types under `moduleResolution: nodenext`), and this
|
|
26
|
+
changelog.
|
|
27
|
+
- Rendered output: **byte-identical to 0.5.2** (changes outside the registration surface are
|
|
28
|
+
comment-only).
|
|
29
|
+
|
|
30
|
+
## 0.5.2 — 2026-07-21
|
|
31
|
+
|
|
32
|
+
- Republish of 0.5.1 (the 0.5.1 GitHub-Packages tarball was unfetchable). No code changes.
|
|
33
|
+
|
|
34
|
+
## 0.5.1 — 2026-07
|
|
35
|
+
|
|
36
|
+
- `./modal/placement` subpath exposed (the side-effect-free placement engine).
|
|
37
|
+
|
|
38
|
+
## 0.5.0 — 2026-07
|
|
39
|
+
|
|
40
|
+
- The certificate-modal Web Component moved **into** the package (POR-10721 W2): prebuilt
|
|
41
|
+
dependency-free IIFE at `./modal/certrev-cert.js` (byte-parity with the deployed theme-extension
|
|
42
|
+
asset) + the `./modal` subpath. Banner memo placement (`part`), font hook, static preview block.
|
|
43
|
+
|
|
44
|
+
## 0.4.0 — 2026-07
|
|
45
|
+
|
|
46
|
+
- Render strictly from `placedFields` + `renderCustomFace`; v2 brand-ink theming
|
|
47
|
+
(`barInk` / `inkColor`).
|
|
48
|
+
|
|
49
|
+
## 0.3.0 and earlier
|
|
50
|
+
|
|
51
|
+
- The locked 3-mode `renderCertBlock` faces, re-synced to the final Liquid design; the
|
|
52
|
+
ambient-URL anchor model (`CertRevAnchor`, zero-input); the initial React components, JSON-LD
|
|
53
|
+
projector, fail-closed verify layer, and `<certrev-badge>` Web Component.
|
package/README.md
CHANGED
|
@@ -52,6 +52,9 @@ import { verifyEnvelope, renderVerdict, verifySignatureOnly } from '@certrev/cer
|
|
|
52
52
|
|
|
53
53
|
// Web Component (separate subpath — does NOT touch customElements on import)
|
|
54
54
|
import { defineCertRevBadge, setCertRevKidResolver } from '@certrev/cert-block/webcomponent'
|
|
55
|
+
|
|
56
|
+
// Builder.io registration (separate subpath; no Builder dependency)
|
|
57
|
+
import { certRevCertComponent, BUILDER_REGISTRATION, CERT_COMPONENT_NAME } from '@certrev/cert-block/builder'
|
|
55
58
|
```
|
|
56
59
|
|
|
57
60
|
## Usage — headless React (Hydrogen / Next server component)
|
|
@@ -121,32 +124,76 @@ is the editor-placed alternative (W4, POR-10721).
|
|
|
121
124
|
### PUSH — the registered cert block (recommended)
|
|
122
125
|
|
|
123
126
|
CertREV's exporter emits a cert block whose options are the `BuilderCertChromeData` projection.
|
|
124
|
-
Register the ready component once, from the `./builder` subpath —
|
|
125
|
-
|
|
127
|
+
Register the ready component once, from the `./builder` subpath — one import, one entry in the
|
|
128
|
+
`customComponents` array your app already passes to the gen2 SDK's `<Content>` (the same array
|
|
129
|
+
your other custom components render from). No hand-mapped options, no hand-maintained inputs:
|
|
130
|
+
|
|
131
|
+
```tsx
|
|
132
|
+
// gen2 SDKs (@builder.io/sdk-react and friends — Hydrogen/Remix, Next, Gatsby)
|
|
133
|
+
import { certRevCertComponent } from '@certrev/cert-block/builder'
|
|
134
|
+
|
|
135
|
+
<Content
|
|
136
|
+
model="blog-article"
|
|
137
|
+
content={content}
|
|
138
|
+
apiKey={apiKey}
|
|
139
|
+
customComponents={[...yourExistingComponents, certRevCertComponent]}
|
|
140
|
+
/>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
On `0.5.2` and earlier (before `certRevCertComponent` existed), build the entry from the
|
|
144
|
+
canonical readonly view — the spread sheds the `readonly` typing, which the gen2 SDK's mutable
|
|
145
|
+
`inputs[]` type won't accept directly:
|
|
126
146
|
|
|
127
147
|
```ts
|
|
128
|
-
import { Builder } from '@builder.io/react'
|
|
129
148
|
import { BUILDER_REGISTRATION } from '@certrev/cert-block/builder'
|
|
130
149
|
|
|
131
|
-
|
|
150
|
+
const certRevComponent = {
|
|
151
|
+
component: BUILDER_REGISTRATION.component,
|
|
152
|
+
name: BUILDER_REGISTRATION.name,
|
|
153
|
+
inputs: [...BUILDER_REGISTRATION.inputs],
|
|
154
|
+
}
|
|
132
155
|
```
|
|
133
156
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
157
|
+
Gen1 SDK (`@builder.io/react`) consumers register the same data imperatively:
|
|
158
|
+
`Builder.registerComponent(certRevCertComponent.component, certRevCertComponent)`.
|
|
159
|
+
|
|
160
|
+
`CERT_COMPONENT_NAME` (`"CertREV Cert"`) is the canonical block name the portal's
|
|
161
|
+
`certComponent` connection field defaults to; the inputs are single-sourced from the
|
|
162
|
+
`BuilderCertChromeData` wire type (drift-locked — the exporter option keys, the registered
|
|
163
|
+
inputs, and the type can never diverge silently). The 19 exporter-populated wire inputs are
|
|
164
|
+
marked `advanced`, so the editor's Options tab leads with the two placement choices an editor
|
|
165
|
+
actually makes (`mode`, `part`). The component enforces the fused-credential rule by
|
|
166
|
+
construction (a credential is unrenderable without its dated verification) and themes to the
|
|
167
|
+
brand's render-def (accent / surface / corners / font + v2 bar-ink / body-ink).
|
|
140
168
|
|
|
141
169
|
### The certificate modal + CSP
|
|
142
170
|
|
|
143
|
-
The "View certificate" affordance opens an envelope-verified modal.
|
|
144
|
-
|
|
145
|
-
|
|
171
|
+
The "View certificate" affordance opens an envelope-verified modal. The browser bundle **ships
|
|
172
|
+
in-package**: a prebuilt, dependency-free, minified IIFE at `@certrev/cert-block/modal/certrev-cert.js`.
|
|
173
|
+
Serve it as an external `<script>` — do **not** side-effect-import it into server code (it
|
|
174
|
+
registers `customElements` and touches `window`; keeping it an external script keeps it out of
|
|
175
|
+
the SSR bundle entirely):
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
// Vite-family stacks (Hydrogen/Remix): resolve the shipped asset to a URL, load it deferred
|
|
179
|
+
import certScriptUrl from '@certrev/cert-block/modal/certrev-cert.js?url'
|
|
180
|
+
|
|
181
|
+
<certrev-cert-modal
|
|
182
|
+
data-delivery-api="https://portal.certrev.com"
|
|
183
|
+
data-platform={platform}
|
|
184
|
+
data-external-id={externalId}
|
|
185
|
+
data-fonts="host"
|
|
186
|
+
/>
|
|
187
|
+
<script src={certScriptUrl} defer />
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Two CSP allowances for the headless host — the modal is the ONLY part that needs any (the card
|
|
191
|
+
renders zero external assets: no fonts fetched, no images, inline-SVG logo):
|
|
146
192
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
- `img-src` → `cdn.builder.io` +
|
|
193
|
+
- `connect-src` → the CertREV Delivery origin the element fetches the signed envelope from
|
|
194
|
+
(production `https://portal.certrev.com`; staging `https://staging.portal.certrev.com`).
|
|
195
|
+
- `img-src` → `https://cdn.builder.io` + whatever origin the envelope's expert-headshot
|
|
196
|
+
`photoUrl` points at (CertREV portal assets in production).
|
|
150
197
|
|
|
151
198
|
`data-delivery-api` is the **origin only** — the element appends
|
|
152
199
|
`/api/cert/v1/delivery/{platform}/{externalId}`. Preview drafts with `includeUnpublished` on the
|
|
@@ -169,21 +216,27 @@ The package never renders an unverified credential. Every error path — bad sig
|
|
|
169
216
|
- The React components are render-pure (verified by `react-dom/server` SSR tests) so they work as Server Components and as client components that SSR identically — same crawlable output either way.
|
|
170
217
|
- Date formatting is deterministic UTC (fixed English month abbreviations, not `toLocaleDateString`) so SSR output is byte-stable and never causes a hydration mismatch.
|
|
171
218
|
|
|
172
|
-
##
|
|
219
|
+
## The contract dependency
|
|
173
220
|
|
|
174
|
-
The shared contract types + the `VerdictKernel` live in
|
|
221
|
+
The shared contract types + the fail-closed `VerdictKernel` live in
|
|
222
|
+
[`@certrev/cert-contract`](https://www.npmjs.com/package/@certrev/cert-contract) (published, MIT).
|
|
223
|
+
Since `0.5.3` it is a **regular dependency** — `npm i @certrev/cert-block` brings it along; a
|
|
224
|
+
brand integration never imports it directly. Its one runtime dependency is `canonicalize` (the
|
|
225
|
+
RFC-8785 JCS implementation used for signature verification). To be clear about that word:
|
|
226
|
+
**nothing cryptographic runs at card render** — the cert card draws purely from block options;
|
|
227
|
+
verification enters only with the modal / the `getVerifiedEnvelope` verify layer.
|
|
175
228
|
|
|
176
|
-
|
|
177
|
-
2. In `src/contract/kernel.ts` (the single binding point), **replace both re-export blocks** with one line: `export * from '@certrev/cert-contract'`. The exported names are deliberately identical, so nothing else in the SDK changes.
|
|
178
|
-
3. In `package.json`, flip the `@certrev/cert-contract` peer dependency back to **`optional: false`** and **remove the root `.npmrc`** `auto-install-peers=false` line (it exists only so the workspace installs against the stub).
|
|
179
|
-
4. Point `src/contract/fixtures.ts` at cert-contract's real `canonicalPayloadBytes` (RFC 8785) so the test fixtures sign bytes the published kernel verifies. (Today the stub + fixtures share a minimal JCS sufficient for the all-string/number/bool envelope shape.)
|
|
180
|
-
5. Confirm `verifyEnvelope` / `renderVerdict` / `verifySignatureOnly` / `toEd25519PublicKey` resolve from the published package, then re-run `pnpm typecheck && pnpm test && pnpm build`.
|
|
229
|
+
## Known issues (upstream)
|
|
181
230
|
|
|
182
|
-
|
|
231
|
+
- `@builder.io/sdk-react@5.2.4` ships types that fail to compile under
|
|
232
|
+
`moduleResolution: "nodenext"` (TS2834 cascade inside the SDK's own imports). cert-block's own
|
|
233
|
+
types are clean under both `bundler` and `nodenext` in an ESM consumer. Hydrogen / Remix / Vite
|
|
234
|
+
storefronts use `bundler` resolution and are unaffected.
|
|
183
235
|
|
|
184
|
-
##
|
|
236
|
+
## Target surfaces
|
|
185
237
|
|
|
186
|
-
-
|
|
238
|
+
- Brand-owned Hydrogen / Next / Remix storefronts (`headless_react`), Builder.io spaces
|
|
239
|
+
(`headless_visual_cms`), and any site dropping in `<certrev-badge>` (`universal_embed`).
|
|
187
240
|
|
|
188
241
|
## Tests
|
|
189
242
|
|
|
@@ -198,4 +251,7 @@ Facts are mocked via `makeMockPayload` / `makeSignedEnvelope` (`src/contract/fix
|
|
|
198
251
|
|
|
199
252
|
## Version
|
|
200
253
|
|
|
201
|
-
`0.
|
|
254
|
+
`0.5.3` — see [CHANGELOG.md](./CHANGELOG.md) for the release history and the semver contract
|
|
255
|
+
(patch/minor never change the rendered cert output or break a compiling integration). Publishes
|
|
256
|
+
**publicly** to npm as `@certrev/cert-block` (`publishConfig.access: public`) via GitHub Actions
|
|
257
|
+
trusted publishing (OIDC); the internal `@certrev` GitHub-Packages channel mirrors it.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* ─────────────────────────────────────────────────────────────────────────────
|
|
5
5
|
*
|
|
6
6
|
* The brand-render projection of the cert envelope (portal POR-10091) — the OPTIONS
|
|
7
|
-
* of a brand's native cert component (
|
|
7
|
+
* of a brand's native cert component (the registered `CertReviewCard`) on
|
|
8
8
|
* a headless blocks-mode entry (Builder.io). CertREV serves the data + the ready-made
|
|
9
9
|
* strings; the brand renders it within the design-guide ladder (enforced live by the
|
|
10
10
|
* crawl monitor + the MSA anti-stripping teeth).
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* ─────────────────────────────────────────────────────────────────────────────
|
|
5
5
|
*
|
|
6
6
|
* The brand-render projection of the cert envelope (portal POR-10091) — the OPTIONS
|
|
7
|
-
* of a brand's native cert component (
|
|
7
|
+
* of a brand's native cert component (the registered `CertReviewCard`) on
|
|
8
8
|
* a headless blocks-mode entry (Builder.io). CertREV serves the data + the ready-made
|
|
9
9
|
* strings; the brand renders it within the design-guide ladder (enforced live by the
|
|
10
10
|
* crawl monitor + the MSA anti-stripping teeth).
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* `CertReviewCard` — the ready-to-register Builder.io PUSH cert component (W1)
|
|
4
4
|
* ─────────────────────────────────────────────────────────────────────────────
|
|
5
5
|
*
|
|
6
|
-
* A headless brand
|
|
6
|
+
* A headless brand registers `certRevCertComponent` in its Builder
|
|
7
7
|
* `customComponents` and CertREV's exporter emits a block whose options are the
|
|
8
8
|
* `BuilderCertChromeData` projection — so the visible cert chrome renders itself,
|
|
9
9
|
* design-identical to the Shopify Liquid + WordPress PHP faces (same `renderCertBlock`
|
|
@@ -44,6 +44,8 @@ export interface BuilderInput {
|
|
|
44
44
|
readonly type: 'string' | 'longText' | 'object' | 'boolean' | 'number';
|
|
45
45
|
readonly friendlyName?: string;
|
|
46
46
|
readonly helperText?: string;
|
|
47
|
+
/** Tucks the input under the editor's "Advanced" reveal (Builder's `Input.advanced`). */
|
|
48
|
+
readonly advanced?: boolean;
|
|
47
49
|
}
|
|
48
50
|
/**
|
|
49
51
|
* The wire-type inputs — DERIVED from `BUILDER_CERT_CHROME_KEYS`, so the 19-field
|
|
@@ -60,9 +62,31 @@ export interface CertBlockBuilderRegistration {
|
|
|
60
62
|
readonly inputs: readonly BuilderInput[];
|
|
61
63
|
}
|
|
62
64
|
/**
|
|
63
|
-
*
|
|
64
|
-
* `
|
|
65
|
+
* The canonical registration data (readonly view). Most consumers want
|
|
66
|
+
* `certRevCertComponent` below — drop-in ready for the gen2 SDK's `customComponents`
|
|
67
|
+
* array. This readonly view remains for consumers that build their own entry
|
|
68
|
+
* (`inputs` must be spread — `[...BUILDER_REGISTRATION.inputs]` — because the gen2
|
|
69
|
+
* SDK's `RegisteredComponent.inputs` type is mutable).
|
|
65
70
|
* The exporter-emitted option keys === these `inputs` === the wire type — locked by W3.
|
|
66
71
|
*/
|
|
67
72
|
export declare const BUILDER_REGISTRATION: CertBlockBuilderRegistration;
|
|
73
|
+
/**
|
|
74
|
+
* Structural shape of the gen2 SDK's `RegisteredComponent` — the subset the PUSH kit
|
|
75
|
+
* populates, with the MUTABLE `inputs` array the SDK's type requires. Declared locally
|
|
76
|
+
* (same pattern as `CertRevBuilderRegistration` on the anchor path) so cert-block needs
|
|
77
|
+
* no Builder dependency; directly assignable at `<Content customComponents={[...]}>`.
|
|
78
|
+
*/
|
|
79
|
+
export interface CertReviewCardRegisteredComponent {
|
|
80
|
+
component: typeof CertReviewCard;
|
|
81
|
+
name: string;
|
|
82
|
+
description?: string;
|
|
83
|
+
inputs: BuilderInput[];
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Ready-to-register: `customComponents={[...yourComponents, certRevCertComponent]}` —
|
|
87
|
+
* one import, no re-wrapping, no spread. Carries the identical W3-locked input set as
|
|
88
|
+
* `BUILDER_REGISTRATION` in a FRESH mutable array (the two never share an instance, so
|
|
89
|
+
* an SDK-side mutation can never corrupt the canonical readonly view).
|
|
90
|
+
*/
|
|
91
|
+
export declare const certRevCertComponent: CertReviewCardRegisteredComponent;
|
|
68
92
|
//# sourceMappingURL=cert-review-card.d.ts.map
|
|
@@ -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,EAAE,KAAK,aAAa,EAAmB,MAAM,oCAAoC,CAAA;AAExF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAGlE;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,iBAAiB,CAAA;AAEjD,MAAM,WAAW,mBAAoB,SAAQ,OAAO,CAAC,qBAAqB,CAAC;IAC1E,gGAAgG;IAChG,IAAI,CAAC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AC,YAAY,CAAC,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,yFAAyF;IACzF,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAC3B;AAyBD;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,SAAS,YAAY,EAM5C,CAAA;AAEH,uGAAuG;AACvG,eAAO,MAAM,gBAAgB,EAAE,SAAS,YAAY,EAQnD,CAAA;AAED,gGAAgG;AAChG,MAAM,WAAW,4BAA4B;IAC5C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,SAAS,EAAE,OAAO,cAAc,CAAA;IACzC,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAA;CACxC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,EAAE,4BAIlC,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;CACtB;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,iCAMlC,CAAA"}
|
|
@@ -4,7 +4,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
4
4
|
* `CertReviewCard` — the ready-to-register Builder.io PUSH cert component (W1)
|
|
5
5
|
* ─────────────────────────────────────────────────────────────────────────────
|
|
6
6
|
*
|
|
7
|
-
* A headless brand
|
|
7
|
+
* A headless brand registers `certRevCertComponent` in its Builder
|
|
8
8
|
* `customComponents` and CertREV's exporter emits a block whose options are the
|
|
9
9
|
* `BuilderCertChromeData` projection — so the visible cert chrome renders itself,
|
|
10
10
|
* design-identical to the Shopify Liquid + WordPress PHP faces (same `renderCertBlock`
|
|
@@ -105,6 +105,9 @@ const WIRE_INPUT_TYPE = {
|
|
|
105
105
|
export const WIRE_INPUTS = BUILDER_CERT_CHROME_KEYS.map((name) => ({
|
|
106
106
|
name,
|
|
107
107
|
type: WIRE_INPUT_TYPE[name],
|
|
108
|
+
// Exporter-populated wire fields: collapsed under the editor's "Advanced" reveal so the
|
|
109
|
+
// Options tab leads with the two placement choices an editor actually makes (mode/part).
|
|
110
|
+
advanced: true,
|
|
108
111
|
}));
|
|
109
112
|
/** Placement inputs — chosen by the entry/editor, NOT emitted by the exporter (not wire-type keys). */
|
|
110
113
|
export const PLACEMENT_INPUTS = [
|
|
@@ -117,8 +120,11 @@ export const PLACEMENT_INPUTS = [
|
|
|
117
120
|
{ name: 'part', type: 'string', friendlyName: 'Banner part', helperText: 'full (default) · header · memo' },
|
|
118
121
|
];
|
|
119
122
|
/**
|
|
120
|
-
*
|
|
121
|
-
* `
|
|
123
|
+
* The canonical registration data (readonly view). Most consumers want
|
|
124
|
+
* `certRevCertComponent` below — drop-in ready for the gen2 SDK's `customComponents`
|
|
125
|
+
* array. This readonly view remains for consumers that build their own entry
|
|
126
|
+
* (`inputs` must be spread — `[...BUILDER_REGISTRATION.inputs]` — because the gen2
|
|
127
|
+
* SDK's `RegisteredComponent.inputs` type is mutable).
|
|
122
128
|
* The exporter-emitted option keys === these `inputs` === the wire type — locked by W3.
|
|
123
129
|
*/
|
|
124
130
|
export const BUILDER_REGISTRATION = {
|
|
@@ -126,4 +132,16 @@ export const BUILDER_REGISTRATION = {
|
|
|
126
132
|
component: CertReviewCard,
|
|
127
133
|
inputs: [...PLACEMENT_INPUTS, ...WIRE_INPUTS],
|
|
128
134
|
};
|
|
135
|
+
/**
|
|
136
|
+
* Ready-to-register: `customComponents={[...yourComponents, certRevCertComponent]}` —
|
|
137
|
+
* one import, no re-wrapping, no spread. Carries the identical W3-locked input set as
|
|
138
|
+
* `BUILDER_REGISTRATION` in a FRESH mutable array (the two never share an instance, so
|
|
139
|
+
* an SDK-side mutation can never corrupt the canonical readonly view).
|
|
140
|
+
*/
|
|
141
|
+
export const certRevCertComponent = {
|
|
142
|
+
name: CERT_COMPONENT_NAME,
|
|
143
|
+
component: CertReviewCard,
|
|
144
|
+
description: 'CertREV expert-review cert card. Options are populated by the CertREV exporter — editors choose placement (mode/part) only.',
|
|
145
|
+
inputs: [...PLACEMENT_INPUTS, ...WIRE_INPUTS],
|
|
146
|
+
};
|
|
129
147
|
//# sourceMappingURL=cert-review-card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cert-review-card.js","sourceRoot":"","sources":["../../src/builder/cert-review-card.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAsB,eAAe,EAAE,MAAM,oCAAoC,CAAA;AAGxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAEhE;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,cAAc,CAAA;AAejD,MAAM,UAAU,cAAc,CAAC,KAA0B;IACxD,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,KAAK,CAAA;IACzC,IAAI,CAAC,YAAY,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAA,CAAC,qBAAqB;IAElE,kFAAkF;IAClF,oFAAoF;IACpF,mFAAmF;IACnF,MAAM,EAAE,GAAG,KAAK,CAAC,sBAAsB,IAAI,IAAI,CAAA;IAC/C,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,EAAE,eAAe,KAAK,KAAK,CAAA;IACzD,MAAM,QAAQ,GAAG,EAAE,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;IAE3C,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,EAAE,MAAM,CAAA;IACtC,MAAM,KAAK,GAA4C,MAAM;QAC5D,CAAC,CAAC;YACA,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,YAAY,EAAE,M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AAY,EAAE,aAAa,EAAE,UAAU,EAAE,gCAAgC,EAAE;CAC3G,CAAA;AASD;;;;;;;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;CAC7C,CAAA;AAeD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAsC;IACtE,IAAI,EAAE,mBAAmB;IACzB,SAAS,EAAE,cAAc;IACzB,WAAW,EACV,6HAA6H;IAC9H,MAAM,EAAE,CAAC,GAAG,gBAAgB,EAAE,GAAG,WAAW,CAAC;CAC7C,CAAA"}
|
package/dist/builder/index.d.ts
CHANGED
|
@@ -73,5 +73,5 @@ export interface CertRevBuilderRegistration {
|
|
|
73
73
|
*/
|
|
74
74
|
export declare const certRevAnchorComponent: CertRevBuilderRegistration;
|
|
75
75
|
export { BUILDER_CERT_CHROME_KEYS, type BuilderCertChromeData, type BuilderCertChromeKey, type CertChromeRenderDef, } from './cert-chrome-data.js';
|
|
76
|
-
export { BUILDER_REGISTRATION, type BuilderInput, CERT_COMPONENT_NAME, type CertBlockBuilderRegistration, CertReviewCard, type CertReviewCardProps, PLACEMENT_INPUTS, WIRE_INPUTS, } from './cert-review-card.js';
|
|
76
|
+
export { BUILDER_REGISTRATION, type BuilderInput, CERT_COMPONENT_NAME, type CertBlockBuilderRegistration, certRevCertComponent, CertReviewCard, type CertReviewCardProps, type CertReviewCardRegisteredComponent, PLACEMENT_INPUTS, WIRE_INPUTS, } from './cert-review-card.js';
|
|
77
77
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/builder/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAiB,KAAK,SAAS,EAAc,MAA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CAAA;AAEjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,2FAA2F;AAC3F,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,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAC1C,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;CAC5B,+BAEA;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,gCAiBvC;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,uCAO5B;AAED;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IAC1C,SAAS,EAAE,OAAO,aAAa,CAAA;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,KAAK,EAAE,CAAA;CACf;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,0BAIpC,CAAA;AAGD,OAAO,EACN,wBAAwB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACxB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACN,oBAAoB,EACpB,KAAK,YAAY,EACjB,mBAAmB,EACnB,KAAK,4BAA4B,EACjC,oBAAoB,EACpB,cAAc,EACd,KAAK,mBAAmB,EACxB,KAAK,iCAAiC,EACtC,gBAAgB,EAChB,WAAW,GACX,MAAM,uBAAuB,CAAA"}
|
package/dist/builder/index.js
CHANGED
|
@@ -79,5 +79,5 @@ export const certRevAnchorComponent = {
|
|
|
79
79
|
};
|
|
80
80
|
// ── POR-10721 W1/W3: the Builder.io PUSH kit (CertReviewCard) + single-sourced wire type ──
|
|
81
81
|
export { BUILDER_CERT_CHROME_KEYS, } from './cert-chrome-data.js';
|
|
82
|
-
export { BUILDER_REGISTRATION, CERT_COMPONENT_NAME, CertReviewCard, PLACEMENT_INPUTS, WIRE_INPUTS, } from './cert-review-card.js';
|
|
82
|
+
export { BUILDER_REGISTRATION, CERT_COMPONENT_NAME, certRevCertComponent, CertReviewCard, PLACEMENT_INPUTS, WIRE_INPUTS, } from './cert-review-card.js';
|
|
83
83
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/builder/index.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;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,oBAAoB;YAC5B,YAAY,EAAE,CAAC;YACf,OAAO,EAAE,WAAW;YACpB,IAAI,EAAE,gBAAgB;YACtB,KAAK,EAAE,SAAS;YAChB,UAAU,EAAE,SAAS;SACrB,uCAEgB,8CAA0B,oJAEtC,CACN,CAAA;AACF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa;IAC5B,MA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;IACvC,OAAO,CACN,kDACiC,EAAE,EAClC,KAAK,EAAE;YACN,MAAM,EAAE,oBAAoB;YAC5B,YAAY,EAAE,CAAC;YACf,OAAO,EAAE,WAAW;YACpB,IAAI,EAAE,gBAAgB;YACtB,KAAK,EAAE,SAAS;YAChB,UAAU,EAAE,SAAS;SACrB,uCAEgB,8CAA0B,oJAEtC,CACN,CAAA;AACF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa;IAC5B,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IACzD,IAAI,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACtD,OAAO,KAAC,UAAU,IAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,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,6FAA6F;AAC7F,OAAO,EACN,wBAAwB,GAIxB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACN,oBAAoB,EAEpB,mBAAmB,EAEnB,oBAAoB,EACpB,cAAc,EAGd,gBAAgB,EAChB,WAAW,GACX,MAAM,uBAAuB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `renderPreviewBlock` — a STATIC, NON-DELIVERY preview of the cert block for pre-sales
|
|
3
|
-
* look-demos (POR-10743, from the
|
|
3
|
+
* look-demos (POR-10743, from the Builder demo).
|
|
4
4
|
*
|
|
5
5
|
* The visual is BYTE-FOR-BYTE `renderCertBlock` (pixel-parity — "see it on your own site
|
|
6
6
|
* today"), wrapped in a `[data-certrev-preview]` container carrying a REQUIRED expiry.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `renderPreviewBlock` — a STATIC, NON-DELIVERY preview of the cert block for pre-sales
|
|
3
|
-
* look-demos (POR-10743, from the
|
|
3
|
+
* look-demos (POR-10743, from the Builder demo).
|
|
4
4
|
*
|
|
5
5
|
* The visual is BYTE-FOR-BYTE `renderCertBlock` (pixel-parity — "see it on your own site
|
|
6
6
|
* today"), wrapped in a `[data-certrev-preview]` container carrying a REQUIRED expiry.
|
|
@@ -160,7 +160,7 @@ export interface ResolvedBlockTheme {
|
|
|
160
160
|
readonly fontSlot: RenderBlockFontSlot;
|
|
161
161
|
readonly accentFg: '#141414' | '#ffffff';
|
|
162
162
|
/**
|
|
163
|
-
* V2 chrome-ink (Phase 1
|
|
163
|
+
* V2 chrome-ink (Phase 1) — the header/seal bar (and floating-pill) FILL. OPTIONAL:
|
|
164
164
|
* present ONLY when the def themes it, so an un-barInk'd face emits nothing extra and the bar
|
|
165
165
|
* keeps its locked navy/white base (byte-identical). Mirrors the portal's `ThemeTokens.barInk`.
|
|
166
166
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@certrev/cert-block",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "Headless / crypto_verify render edge for the CertREV CertDeliveryEnvelope. SSR-safe React components (<CertBadge>/<ExpertBio>/<CertRevBacklink>), a deterministic schema.org JSON-LD projector, a fail-closed verify layer over the shared VerdictKernel, and a framework-agnostic <certrev-badge> Web Component. Sign once (portal), render everywhere (Hydrogen / Next / Builder / universal embed).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"files": [
|
|
36
36
|
"dist",
|
|
37
37
|
"src",
|
|
38
|
-
"README.md"
|
|
38
|
+
"README.md",
|
|
39
|
+
"CHANGELOG.md"
|
|
39
40
|
],
|
|
40
41
|
"publishConfig": {
|
|
41
42
|
"registry": "https://registry.npmjs.org",
|
|
@@ -51,8 +52,10 @@
|
|
|
51
52
|
"typecheck": "tsc --noEmit",
|
|
52
53
|
"test": "vitest run"
|
|
53
54
|
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@certrev/cert-contract": "^0.5.0"
|
|
57
|
+
},
|
|
54
58
|
"peerDependencies": {
|
|
55
|
-
"@certrev/cert-contract": ">=0.5.0",
|
|
56
59
|
"react": ">=18.0.0"
|
|
57
60
|
},
|
|
58
61
|
"peerDependenciesMeta": {
|
|
@@ -61,7 +64,6 @@
|
|
|
61
64
|
}
|
|
62
65
|
},
|
|
63
66
|
"devDependencies": {
|
|
64
|
-
"@certrev/cert-contract": "workspace:*",
|
|
65
67
|
"@testing-library/react": "^16.1.0",
|
|
66
68
|
"@types/node": "^20.0.0",
|
|
67
69
|
"@types/react": "^18.3.0",
|
|
@@ -51,7 +51,7 @@ const THEMED: ResolvedBlockTheme = {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
|
-
* A v2 brand-ink themed brand
|
|
54
|
+
* A v2 brand-ink themed brand: a black seal bar + near-black free-content ink on
|
|
55
55
|
* top of the accent/surface/corner/font theming. `barInkFg` is DERIVED at the edge from `barInk`
|
|
56
56
|
* (accentFg('#000000') = '#ffffff'), so it need not be supplied here.
|
|
57
57
|
*/
|
|
@@ -73,6 +73,7 @@ import {
|
|
|
73
73
|
BUILDER_REGISTRATION,
|
|
74
74
|
type BuilderCertChromeData,
|
|
75
75
|
CERT_COMPONENT_NAME,
|
|
76
|
+
certRevCertComponent,
|
|
76
77
|
CertReviewCard,
|
|
77
78
|
WIRE_INPUTS,
|
|
78
79
|
} from '../index.js'
|
|
@@ -89,6 +90,24 @@ describe('POR-10721 W3 — Builder kit contract lock (inputs ⇄ wire-type parit
|
|
|
89
90
|
})
|
|
90
91
|
})
|
|
91
92
|
|
|
93
|
+
describe('POR-10721 — certRevCertComponent (the drop-in gen2 registration)', () => {
|
|
94
|
+
it('carries the identical W3-locked registration as BUILDER_REGISTRATION (name/component/inputs)', () => {
|
|
95
|
+
expect(certRevCertComponent.name).toBe(CERT_COMPONENT_NAME)
|
|
96
|
+
expect(certRevCertComponent.component).toBe(CertReviewCard)
|
|
97
|
+
expect(certRevCertComponent.inputs).toEqual([...BUILDER_REGISTRATION.inputs])
|
|
98
|
+
})
|
|
99
|
+
it('inputs is a FRESH mutable array — never the canonical readonly instance', () => {
|
|
100
|
+
expect(certRevCertComponent.inputs).not.toBe(BUILDER_REGISTRATION.inputs)
|
|
101
|
+
expect(Object.isFrozen(certRevCertComponent.inputs)).toBe(false)
|
|
102
|
+
})
|
|
103
|
+
it('wire inputs sit under the editor "Advanced" reveal; placement inputs stay front-and-center', () => {
|
|
104
|
+
const byName = new Map(certRevCertComponent.inputs.map((i) => [i.name, i]))
|
|
105
|
+
for (const k of BUILDER_CERT_CHROME_KEYS) expect(byName.get(k)?.advanced).toBe(true)
|
|
106
|
+
expect(byName.get('mode')?.advanced).toBeUndefined()
|
|
107
|
+
expect(byName.get('part')?.advanced).toBeUndefined()
|
|
108
|
+
})
|
|
109
|
+
})
|
|
110
|
+
|
|
92
111
|
describe('POR-10721 W1 — CertReviewCard render + the fused-credential R1 gate', () => {
|
|
93
112
|
const base: Partial<BuilderCertChromeData> = {
|
|
94
113
|
reviewerName: 'Dr. Jane Doe',
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* ─────────────────────────────────────────────────────────────────────────────
|
|
5
5
|
*
|
|
6
6
|
* The brand-render projection of the cert envelope (portal POR-10091) — the OPTIONS
|
|
7
|
-
* of a brand's native cert component (
|
|
7
|
+
* of a brand's native cert component (the registered `CertReviewCard`) on
|
|
8
8
|
* a headless blocks-mode entry (Builder.io). CertREV serves the data + the ready-made
|
|
9
9
|
* strings; the brand renders it within the design-guide ladder (enforced live by the
|
|
10
10
|
* crawl monitor + the MSA anti-stripping teeth).
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* `CertReviewCard` — the ready-to-register Builder.io PUSH cert component (W1)
|
|
4
4
|
* ─────────────────────────────────────────────────────────────────────────────
|
|
5
5
|
*
|
|
6
|
-
* A headless brand
|
|
6
|
+
* A headless brand registers `certRevCertComponent` in its Builder
|
|
7
7
|
* `customComponents` and CertREV's exporter emits a block whose options are the
|
|
8
8
|
* `BuilderCertChromeData` projection — so the visible cert chrome renders itself,
|
|
9
9
|
* design-identical to the Shopify Liquid + WordPress PHP faces (same `renderCertBlock`
|
|
@@ -112,6 +112,8 @@ export interface BuilderInput {
|
|
|
112
112
|
readonly type: 'string' | 'longText' | 'object' | 'boolean' | 'number'
|
|
113
113
|
readonly friendlyName?: string
|
|
114
114
|
readonly helperText?: string
|
|
115
|
+
/** Tucks the input under the editor's "Advanced" reveal (Builder's `Input.advanced`). */
|
|
116
|
+
readonly advanced?: boolean
|
|
115
117
|
}
|
|
116
118
|
|
|
117
119
|
/** Builder input TYPE per wire-type key — the exporter serializes these option values. */
|
|
@@ -145,6 +147,9 @@ const WIRE_INPUT_TYPE: Record<(typeof BUILDER_CERT_CHROME_KEYS)[number], Builder
|
|
|
145
147
|
export const WIRE_INPUTS: readonly BuilderInput[] = BUILDER_CERT_CHROME_KEYS.map((name) => ({
|
|
146
148
|
name,
|
|
147
149
|
type: WIRE_INPUT_TYPE[name],
|
|
150
|
+
// Exporter-populated wire fields: collapsed under the editor's "Advanced" reveal so the
|
|
151
|
+
// Options tab leads with the two placement choices an editor actually makes (mode/part).
|
|
152
|
+
advanced: true,
|
|
148
153
|
}))
|
|
149
154
|
|
|
150
155
|
/** Placement inputs — chosen by the entry/editor, NOT emitted by the exporter (not wire-type keys). */
|
|
@@ -166,8 +171,11 @@ export interface CertBlockBuilderRegistration {
|
|
|
166
171
|
}
|
|
167
172
|
|
|
168
173
|
/**
|
|
169
|
-
*
|
|
170
|
-
* `
|
|
174
|
+
* The canonical registration data (readonly view). Most consumers want
|
|
175
|
+
* `certRevCertComponent` below — drop-in ready for the gen2 SDK's `customComponents`
|
|
176
|
+
* array. This readonly view remains for consumers that build their own entry
|
|
177
|
+
* (`inputs` must be spread — `[...BUILDER_REGISTRATION.inputs]` — because the gen2
|
|
178
|
+
* SDK's `RegisteredComponent.inputs` type is mutable).
|
|
171
179
|
* The exporter-emitted option keys === these `inputs` === the wire type — locked by W3.
|
|
172
180
|
*/
|
|
173
181
|
export const BUILDER_REGISTRATION: CertBlockBuilderRegistration = {
|
|
@@ -175,3 +183,30 @@ export const BUILDER_REGISTRATION: CertBlockBuilderRegistration = {
|
|
|
175
183
|
component: CertReviewCard,
|
|
176
184
|
inputs: [...PLACEMENT_INPUTS, ...WIRE_INPUTS],
|
|
177
185
|
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Structural shape of the gen2 SDK's `RegisteredComponent` — the subset the PUSH kit
|
|
189
|
+
* populates, with the MUTABLE `inputs` array the SDK's type requires. Declared locally
|
|
190
|
+
* (same pattern as `CertRevBuilderRegistration` on the anchor path) so cert-block needs
|
|
191
|
+
* no Builder dependency; directly assignable at `<Content customComponents={[...]}>`.
|
|
192
|
+
*/
|
|
193
|
+
export interface CertReviewCardRegisteredComponent {
|
|
194
|
+
component: typeof CertReviewCard
|
|
195
|
+
name: string
|
|
196
|
+
description?: string
|
|
197
|
+
inputs: BuilderInput[]
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Ready-to-register: `customComponents={[...yourComponents, certRevCertComponent]}` —
|
|
202
|
+
* one import, no re-wrapping, no spread. Carries the identical W3-locked input set as
|
|
203
|
+
* `BUILDER_REGISTRATION` in a FRESH mutable array (the two never share an instance, so
|
|
204
|
+
* an SDK-side mutation can never corrupt the canonical readonly view).
|
|
205
|
+
*/
|
|
206
|
+
export const certRevCertComponent: CertReviewCardRegisteredComponent = {
|
|
207
|
+
name: CERT_COMPONENT_NAME,
|
|
208
|
+
component: CertReviewCard,
|
|
209
|
+
description:
|
|
210
|
+
'CertREV expert-review cert card. Options are populated by the CertREV exporter — editors choose placement (mode/part) only.',
|
|
211
|
+
inputs: [...PLACEMENT_INPUTS, ...WIRE_INPUTS],
|
|
212
|
+
}
|
package/src/builder/index.tsx
CHANGED
|
@@ -133,8 +133,10 @@ export {
|
|
|
133
133
|
type BuilderInput,
|
|
134
134
|
CERT_COMPONENT_NAME,
|
|
135
135
|
type CertBlockBuilderRegistration,
|
|
136
|
+
certRevCertComponent,
|
|
136
137
|
CertReviewCard,
|
|
137
138
|
type CertReviewCardProps,
|
|
139
|
+
type CertReviewCardRegisteredComponent,
|
|
138
140
|
PLACEMENT_INPUTS,
|
|
139
141
|
WIRE_INPUTS,
|
|
140
142
|
} from './cert-review-card.js'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `renderPreviewBlock` — a STATIC, NON-DELIVERY preview of the cert block for pre-sales
|
|
3
|
-
* look-demos (POR-10743, from the
|
|
3
|
+
* look-demos (POR-10743, from the Builder demo).
|
|
4
4
|
*
|
|
5
5
|
* The visual is BYTE-FOR-BYTE `renderCertBlock` (pixel-parity — "see it on your own site
|
|
6
6
|
* today"), wrapped in a `[data-certrev-preview]` container carrying a REQUIRED expiry.
|
|
@@ -263,7 +263,7 @@ export interface ResolvedBlockTheme {
|
|
|
263
263
|
readonly fontSlot: RenderBlockFontSlot
|
|
264
264
|
readonly accentFg: '#141414' | '#ffffff'
|
|
265
265
|
/**
|
|
266
|
-
* V2 chrome-ink (Phase 1
|
|
266
|
+
* V2 chrome-ink (Phase 1) — the header/seal bar (and floating-pill) FILL. OPTIONAL:
|
|
267
267
|
* present ONLY when the def themes it, so an un-barInk'd face emits nothing extra and the bar
|
|
268
268
|
* keeps its locked navy/white base (byte-identical). Mirrors the portal's `ThemeTokens.barInk`.
|
|
269
269
|
*/
|