@saar-ai/web-widget 0.5.0 → 0.6.1
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/dist/card-aspect.d.ts +58 -0
- package/dist/card-aspect.d.ts.map +1 -0
- package/dist/chunks/{host-widget-B0SkhMIs.js → host-widget-CAPud_Jz.js} +4609 -5776
- package/dist/chunks/{telemetry-Bw-3F_Zk.js → telemetry-BI_SEWTb.js} +104 -2
- package/dist/dock/dock-caption.d.ts +67 -0
- package/dist/dock/dock-caption.d.ts.map +1 -0
- package/dist/dock/dock-motion.d.ts +270 -0
- package/dist/dock/dock-motion.d.ts.map +1 -0
- package/dist/dock/dock-pill.d.ts +38 -0
- package/dist/dock/dock-pill.d.ts.map +1 -0
- package/dist/dock/dock-row.d.ts +120 -0
- package/dist/dock/dock-row.d.ts.map +1 -0
- package/dist/dock/dock-sheet.d.ts +89 -0
- package/dist/dock/dock-sheet.d.ts.map +1 -0
- package/dist/dock/dock-shelf.d.ts +38 -0
- package/dist/dock/dock-shelf.d.ts.map +1 -0
- package/dist/dock/dock-state.d.ts +221 -0
- package/dist/dock/dock-state.d.ts.map +1 -0
- package/dist/dock/dock.d.ts +344 -0
- package/dist/dock/dock.d.ts.map +1 -0
- package/dist/dock/geometry.d.ts +161 -0
- package/dist/dock/geometry.d.ts.map +1 -0
- package/dist/dock/motion-gate.d.ts +123 -0
- package/dist/dock/motion-gate.d.ts.map +1 -0
- package/dist/generated/widget-css.d.ts.map +1 -1
- package/dist/host-widget.d.ts +94 -16
- package/dist/host-widget.d.ts.map +1 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4029 -7
- package/dist/messages.d.ts +69 -0
- package/dist/messages.d.ts.map +1 -1
- package/dist/next/index.js +1 -1
- package/dist/session-log.d.ts +7 -0
- package/dist/session-log.d.ts.map +1 -1
- package/dist/session-panel.d.ts +13 -3
- package/dist/session-panel.d.ts.map +1 -1
- package/dist/theme/color.d.ts +114 -0
- package/dist/theme/color.d.ts.map +1 -0
- package/dist/theme/derive.d.ts +92 -0
- package/dist/theme/derive.d.ts.map +1 -0
- package/dist/theme/index.d.ts +10 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/use-chat-session.d.ts +18 -16
- package/dist/use-chat-session.d.ts.map +1 -1
- package/dist/use-voice-session.d.ts +79 -3
- package/dist/use-voice-session.d.ts.map +1 -1
- package/dist/voice-widget.d.ts +49 -19
- package/dist/voice-widget.d.ts.map +1 -1
- package/dist/widget-cards.d.ts +28 -1
- package/dist/widget-cards.d.ts.map +1 -1
- package/dist/widget.css +1 -1
- package/package.json +4 -4
- package/src/styles/concierge.css +758 -28
- package/src/styles/tokens.css +67 -0
- package/dist/concierge-launcher.d.ts +0 -53
- package/dist/concierge-launcher.d.ts.map +0 -1
- package/dist/concierge-shell.d.ts +0 -256
- package/dist/concierge-shell.d.ts.map +0 -1
- package/dist/position.d.ts +0 -65
- package/dist/position.d.ts.map +0 -1
- package/dist/transcript-geometry.d.ts +0 -220
- package/dist/transcript-geometry.d.ts.map +0 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* §9.1 `cards.imageAspect` — the one place the tenant's three choices are
|
|
3
|
+
* turned into a ratio.
|
|
4
|
+
*
|
|
5
|
+
* It is a TENANT choice because a catalogue is shot one way: a fashion
|
|
6
|
+
* merchant's photography is portrait and a rug merchant's is landscape, and
|
|
7
|
+
* cropping either to a square is the difference between a shelf that looks
|
|
8
|
+
* like their store and one that looks like ours.
|
|
9
|
+
*
|
|
10
|
+
* Frozen, and looked up rather than interpolated, so a value from an
|
|
11
|
+
* unauthenticated config can never become CSS of its own.
|
|
12
|
+
*
|
|
13
|
+
* ## Why this is a module and not a constant in the component that draws
|
|
14
|
+
*
|
|
15
|
+
* Two surfaces draw a product image from this field and they are not the same
|
|
16
|
+
* component: the voice SHELF (`dock/dock-shelf.tsx`, sized by the
|
|
17
|
+
* `--wgt-card-aspect` custom property `dock.tsx` writes onto the dock root)
|
|
18
|
+
* and the text TRANSCRIPT's cards (`widget-cards.tsx`, which renders outside
|
|
19
|
+
* the dock too — Storybook, the marketing preview, `apps/web`'s harness — and
|
|
20
|
+
* so cannot rely on inheriting that property). A tenant who picks `portrait`
|
|
21
|
+
* and gets it in one of those and not the other is the exact defect this
|
|
22
|
+
* module exists to make impossible: there is one table, both read it, and
|
|
23
|
+
* `3 / 4` is written down once.
|
|
24
|
+
*/
|
|
25
|
+
export type WidgetImageAspect = 'square' | 'portrait' | 'landscape';
|
|
26
|
+
/** The CSS `aspect-ratio` value each of §9.1's three choices means. */
|
|
27
|
+
export declare const CARD_ASPECT: Readonly<Record<WidgetImageAspect, string>>;
|
|
28
|
+
/** §9.1's default, for every caller that was given no opinion. */
|
|
29
|
+
export declare const DEFAULT_CARD_ASPECT: WidgetImageAspect;
|
|
30
|
+
/**
|
|
31
|
+
* The `aspect-ratio` value for a tenant's published `cards.imageAspect`,
|
|
32
|
+
* substituting §9.1's default for anything this build does not recognise.
|
|
33
|
+
*
|
|
34
|
+
* A bare `CARD_ASPECT[value]` is not enough, for two reasons that both end
|
|
35
|
+
* with a box that is not fixed:
|
|
36
|
+
*
|
|
37
|
+
* - **`undefined` is not the default.** TypeScript types the callers it can
|
|
38
|
+
* see, and `cdn/core.ts` narrows the CDN path with `oneOf`. Neither covers
|
|
39
|
+
* `mountConciergeWidget`, a public npm entry a plain-JavaScript host calls,
|
|
40
|
+
* or `apps/web`'s console preview handing a component a config row. For any
|
|
41
|
+
* of those an unrecognised value yields `undefined`, React omits
|
|
42
|
+
* `aspect-ratio` altogether, and §7.1 rule 7's fixed box silently turns
|
|
43
|
+
* off — while the voice shelf, whose CSS reads
|
|
44
|
+
* `var(--wgt-card-aspect, 1 / 1)`, degrades to square on its own. That is
|
|
45
|
+
* the shelf/transcript disagreement this module exists to make impossible,
|
|
46
|
+
* reappearing in the malformed case.
|
|
47
|
+
* - **`CARD_ASPECT` has a prototype.** `Object.freeze` seals the three own
|
|
48
|
+
* keys and does nothing about the chain behind them, so `'constructor'` or
|
|
49
|
+
* `'toString'` reaches `Object.prototype` and returns a FUNCTION where a
|
|
50
|
+
* CSS value belongs. `widget-cards.tsx` spends it on `aspect-ratio`, which
|
|
51
|
+
* the CSSOM rejects; `dock.tsx` spends it on the CUSTOM property
|
|
52
|
+
* `--wgt-card-aspect`, which the CSSOM does not validate at all.
|
|
53
|
+
*
|
|
54
|
+
* So the lookup is guarded by the key LIST rather than by `in`, and this is
|
|
55
|
+
* the only way either surface is allowed to read the table.
|
|
56
|
+
*/
|
|
57
|
+
export declare function cardAspectRatio(aspect: unknown): string;
|
|
58
|
+
//# sourceMappingURL=card-aspect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-aspect.d.ts","sourceRoot":"","sources":["../src/card-aspect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC;AAEpE,uEAAuE;AACvE,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAIlE,CAAC;AAEH,kEAAkE;AAClE,eAAO,MAAM,mBAAmB,EAAE,iBAA4B,CAAC;AAK/D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAIvD"}
|