@wix/web5-core 1.56.1 → 1.57.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/dist/cjs/client/wixAuthFetch.js +2 -2
- package/dist/cjs/client/wixAuthFetch.js.map +1 -1
- package/dist/cjs/component/componentDefinitions/HeroEntitySectionDefinition.js +20 -15
- package/dist/cjs/component/componentDefinitions/HeroEntitySectionDefinition.js.map +1 -1
- package/dist/cjs/component/componentDefinitions/HeroSectionDefinition.js +12 -4
- package/dist/cjs/component/componentDefinitions/HeroSectionDefinition.js.map +1 -1
- package/dist/cjs/component/componentDefinitions/listItemsSectionDefinition.js +24 -29
- package/dist/cjs/component/componentDefinitions/listItemsSectionDefinition.js.map +1 -1
- package/dist/cjs/component/componentParser.js +8 -1
- package/dist/cjs/component/componentParser.js.map +1 -1
- package/dist/cjs/component/types.js.map +1 -1
- package/dist/cjs/components/placement/PlacementResponseRenderer.css +0 -4
- package/dist/cjs/components/placement/PlacementResponseRenderer.js +11 -33
- package/dist/cjs/components/placement/PlacementResponseRenderer.js.map +1 -1
- package/dist/cjs/components/placement/buildPlacementDependencies.js.map +1 -1
- package/dist/cjs/components/ui/OptimizedImage.js +59 -14
- package/dist/cjs/components/ui/OptimizedImage.js.map +1 -1
- package/dist/cjs/components/ui/SectionSkeleton.css +19 -0
- package/dist/cjs/components/ui/SectionSkeleton.js +8 -4
- package/dist/cjs/components/ui/SectionSkeleton.js.map +1 -1
- package/dist/cjs/components/ui/UserQuery.css +72 -0
- package/dist/cjs/components/ui/UserQuery.js +131 -37
- package/dist/cjs/components/ui/UserQuery.js.map +1 -1
- package/dist/cjs/context/UserQueryContext.js +34 -0
- package/dist/cjs/context/UserQueryContext.js.map +1 -0
- package/dist/cjs/entity/defaultExtractor.js +9 -2
- package/dist/cjs/entity/defaultExtractor.js.map +1 -1
- package/dist/cjs/entity/fetchEntityListData.js +13 -26
- package/dist/cjs/entity/fetchEntityListData.js.map +1 -1
- package/dist/cjs/entity/index.js +5 -1
- package/dist/cjs/entity/index.js.map +1 -1
- package/dist/cjs/entity/listEntityItems.js +90 -0
- package/dist/cjs/entity/listEntityItems.js.map +1 -0
- package/dist/cjs/hostScope.js +63 -0
- package/dist/cjs/hostScope.js.map +1 -0
- package/dist/cjs/index.js +38 -13
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/patternValidator/validator.test.js +61 -61
- package/dist/cjs/patternValidator/validator.test.js.map +1 -1
- package/dist/cjs/registry/ComponentRegistry.js +22 -2
- package/dist/cjs/registry/ComponentRegistry.js.map +1 -1
- package/dist/cjs/registry/index.js +1 -3
- package/dist/cjs/registry/index.js.map +1 -1
- package/dist/cjs/registry/types.js.map +1 -1
- package/dist/cjs/styles/base-utilities.css +35 -0
- package/dist/cjs/styles/components.css +1 -0
- package/dist/cjs/styles/host-reset.css +81 -0
- package/dist/cjs/styles/tailwind-theme.css +6 -6
- package/dist/cjs/utils/backendEnvironment.js +78 -0
- package/dist/cjs/utils/backendEnvironment.js.map +1 -0
- package/dist/cjs/utils/entityLinkParser.js +3 -1
- package/dist/cjs/utils/entityLinkParser.js.map +1 -1
- package/dist/cjs/utils/imageBackdrop.js +269 -0
- package/dist/cjs/utils/imageBackdrop.js.map +1 -0
- package/dist/cjs/utils/intentExtractor.js +20 -9
- package/dist/cjs/utils/intentExtractor.js.map +1 -1
- package/dist/cjs/utils/productBackHandoff.js +106 -0
- package/dist/cjs/utils/productBackHandoff.js.map +1 -0
- package/dist/cjs/utils/refreshPrompts.js +72 -0
- package/dist/cjs/utils/refreshPrompts.js.map +1 -0
- package/dist/esm/client/wixAuthFetch.js +2 -2
- package/dist/esm/client/wixAuthFetch.js.map +1 -1
- package/dist/esm/component/componentDefinitions/HeroEntitySectionDefinition.js +20 -15
- package/dist/esm/component/componentDefinitions/HeroEntitySectionDefinition.js.map +1 -1
- package/dist/esm/component/componentDefinitions/HeroSectionDefinition.js +12 -4
- package/dist/esm/component/componentDefinitions/HeroSectionDefinition.js.map +1 -1
- package/dist/esm/component/componentDefinitions/listItemsSectionDefinition.js +25 -30
- package/dist/esm/component/componentDefinitions/listItemsSectionDefinition.js.map +1 -1
- package/dist/esm/component/componentParser.js +8 -1
- package/dist/esm/component/componentParser.js.map +1 -1
- package/dist/esm/component/types.js.map +1 -1
- package/dist/esm/components/placement/PlacementResponseRenderer.css +0 -4
- package/dist/esm/components/placement/PlacementResponseRenderer.js +1 -16
- package/dist/esm/components/placement/PlacementResponseRenderer.js.map +1 -1
- package/dist/esm/components/placement/buildPlacementDependencies.js.map +1 -1
- package/dist/esm/components/ui/OptimizedImage.js +50 -5
- package/dist/esm/components/ui/OptimizedImage.js.map +1 -1
- package/dist/esm/components/ui/SectionSkeleton.css +19 -0
- package/dist/esm/components/ui/SectionSkeleton.js +5 -1
- package/dist/esm/components/ui/SectionSkeleton.js.map +1 -1
- package/dist/esm/components/ui/UserQuery.css +72 -0
- package/dist/esm/components/ui/UserQuery.js +52 -6
- package/dist/esm/components/ui/UserQuery.js.map +1 -1
- package/dist/esm/context/UserQueryContext.js +21 -0
- package/dist/esm/context/UserQueryContext.js.map +1 -0
- package/dist/esm/entity/defaultExtractor.js +9 -2
- package/dist/esm/entity/defaultExtractor.js.map +1 -1
- package/dist/esm/entity/fetchEntityListData.js +14 -26
- package/dist/esm/entity/fetchEntityListData.js.map +1 -1
- package/dist/esm/entity/index.js +1 -0
- package/dist/esm/entity/index.js.map +1 -1
- package/dist/esm/entity/listEntityItems.js +85 -0
- package/dist/esm/entity/listEntityItems.js.map +1 -0
- package/dist/esm/hostScope.js +59 -0
- package/dist/esm/hostScope.js.map +1 -0
- package/dist/esm/index.js +13 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/patternValidator/validator.test.js +61 -61
- package/dist/esm/patternValidator/validator.test.js.map +1 -1
- package/dist/esm/registry/ComponentRegistry.js +22 -2
- package/dist/esm/registry/ComponentRegistry.js.map +1 -1
- package/dist/esm/registry/index.js +0 -1
- package/dist/esm/registry/index.js.map +1 -1
- package/dist/esm/registry/types.js.map +1 -1
- package/dist/esm/styles/base-utilities.css +35 -0
- package/dist/esm/styles/components.css +1 -0
- package/dist/esm/styles/host-reset.css +81 -0
- package/dist/esm/styles/tailwind-theme.css +6 -6
- package/dist/esm/utils/backendEnvironment.js +71 -0
- package/dist/esm/utils/backendEnvironment.js.map +1 -0
- package/dist/esm/utils/entityLinkParser.js +3 -1
- package/dist/esm/utils/entityLinkParser.js.map +1 -1
- package/dist/esm/utils/imageBackdrop.js +262 -0
- package/dist/esm/utils/imageBackdrop.js.map +1 -0
- package/dist/esm/utils/intentExtractor.js +21 -12
- package/dist/esm/utils/intentExtractor.js.map +1 -1
- package/dist/esm/utils/productBackHandoff.js +100 -0
- package/dist/esm/utils/productBackHandoff.js.map +1 -0
- package/dist/esm/utils/refreshPrompts.js +67 -0
- package/dist/esm/utils/refreshPrompts.js.map +1 -0
- package/dist/types/component/componentDefinitions/HeroEntitySectionDefinition.d.ts.map +1 -1
- package/dist/types/component/componentDefinitions/HeroSectionDefinition.d.ts.map +1 -1
- package/dist/types/component/componentDefinitions/listItemsSectionDefinition.d.ts +2 -2
- package/dist/types/component/componentDefinitions/listItemsSectionDefinition.d.ts.map +1 -1
- package/dist/types/component/componentParser.d.ts.map +1 -1
- package/dist/types/component/types.d.ts +1 -5
- package/dist/types/component/types.d.ts.map +1 -1
- package/dist/types/components/placement/PlacementResponseRenderer.d.ts +1 -1
- package/dist/types/components/placement/PlacementResponseRenderer.d.ts.map +1 -1
- package/dist/types/components/placement/buildPlacementDependencies.d.ts +1 -2
- package/dist/types/components/placement/buildPlacementDependencies.d.ts.map +1 -1
- package/dist/types/components/ui/OptimizedImage.d.ts +9 -0
- package/dist/types/components/ui/OptimizedImage.d.ts.map +1 -1
- package/dist/types/components/ui/SectionSkeleton.d.ts.map +1 -1
- package/dist/types/components/ui/UserQuery.d.ts +21 -0
- package/dist/types/components/ui/UserQuery.d.ts.map +1 -1
- package/dist/types/context/UserQueryContext.d.ts +12 -0
- package/dist/types/context/UserQueryContext.d.ts.map +1 -0
- package/dist/types/entity/defaultExtractor.d.ts.map +1 -1
- package/dist/types/entity/fetchEntityListData.d.ts +0 -2
- package/dist/types/entity/fetchEntityListData.d.ts.map +1 -1
- package/dist/types/entity/index.d.ts +1 -0
- package/dist/types/entity/index.d.ts.map +1 -1
- package/dist/types/entity/listEntityItems.d.ts +40 -0
- package/dist/types/entity/listEntityItems.d.ts.map +1 -0
- package/dist/types/hostScope.d.ts +83 -0
- package/dist/types/hostScope.d.ts.map +1 -0
- package/dist/types/index.d.ts +11 -7
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/registry/ComponentRegistry.d.ts +8 -0
- package/dist/types/registry/ComponentRegistry.d.ts.map +1 -1
- package/dist/types/registry/index.d.ts +0 -1
- package/dist/types/registry/index.d.ts.map +1 -1
- package/dist/types/registry/types.d.ts +5 -6
- package/dist/types/registry/types.d.ts.map +1 -1
- package/dist/types/utils/backendEnvironment.d.ts +30 -0
- package/dist/types/utils/backendEnvironment.d.ts.map +1 -0
- package/dist/types/utils/entityLinkParser.d.ts.map +1 -1
- package/dist/types/utils/imageBackdrop.d.ts +102 -0
- package/dist/types/utils/imageBackdrop.d.ts.map +1 -0
- package/dist/types/utils/intentExtractor.d.ts +21 -4
- package/dist/types/utils/intentExtractor.d.ts.map +1 -1
- package/dist/types/utils/productBackHandoff.d.ts +43 -0
- package/dist/types/utils/productBackHandoff.d.ts.map +1 -0
- package/dist/types/utils/refreshPrompts.d.ts +32 -0
- package/dist/types/utils/refreshPrompts.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/components/placement/PlacementResponseRenderer.css +0 -4
- package/src/components/ui/SectionSkeleton.css +19 -0
- package/src/components/ui/UserQuery.css +72 -0
- package/src/styles/base-utilities.css +35 -0
- package/src/styles/components.css +1 -0
- package/src/styles/host-reset.css +81 -0
- package/src/styles/tailwind-theme.css +6 -6
- package/dist/cjs/registry/Intent.js +0 -19
- package/dist/cjs/registry/Intent.js.map +0 -1
- package/dist/cjs/utils/conversationApi.js +0 -52
- package/dist/cjs/utils/conversationApi.js.map +0 -1
- package/dist/cjs/utils/conversationMode.js +0 -23
- package/dist/cjs/utils/conversationMode.js.map +0 -1
- package/dist/esm/registry/Intent.js +0 -15
- package/dist/esm/registry/Intent.js.map +0 -1
- package/dist/esm/utils/conversationApi.js +0 -45
- package/dist/esm/utils/conversationApi.js.map +0 -1
- package/dist/esm/utils/conversationMode.js +0 -18
- package/dist/esm/utils/conversationMode.js.map +0 -1
- package/dist/types/registry/Intent.d.ts +0 -12
- package/dist/types/registry/Intent.d.ts.map +0 -1
- package/dist/types/utils/conversationApi.d.ts +0 -26
- package/dist/types/utils/conversationApi.d.ts.map +0 -1
- package/dist/types/utils/conversationMode.d.ts +0 -16
- package/dist/types/utils/conversationMode.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entityLinkParser.d.ts","sourceRoot":"","sources":["../../../src/utils/entityLinkParser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EACL,WAAW,EAEX,KAAK,YAAY,EAClB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,aAAa,GACrB,aAAa,GACb,gBAAgB,GAChB,eAAe,GACf,cAAc,GACd,gBAAgB,GAChB,gBAAgB,CAAC;AAIrB;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"entityLinkParser.d.ts","sourceRoot":"","sources":["../../../src/utils/entityLinkParser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EACL,WAAW,EAEX,KAAK,YAAY,EAClB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,aAAa,GACrB,aAAa,GACb,gBAAgB,GAChB,eAAe,GACf,cAAc,GACd,gBAAgB,GAChB,gBAAgB,CAAC;AAIrB;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CA+E9D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEnD;AAKD;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,GAAG,SAAS,GACtB,YAAY,GAAG,SAAS,CA8B1B;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAKjD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,GACV;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CA0BjD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAW/D;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,GAAG,GAAG,YAAY,GAAG,IAAI,CAgClE"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result of inspecting an image's edges to decide how it should sit in a slot
|
|
3
|
+
* whose aspect ratio differs from the image's own.
|
|
4
|
+
*
|
|
5
|
+
* The problem: a single CSS `object-fit` can't serve both kinds of imagery a
|
|
6
|
+
* conversational page surfaces. Product cutouts (subject on a seamless white
|
|
7
|
+
* sweep, or a transparent PNG) must never be cropped — `cover` chops the
|
|
8
|
+
* product. Full-bleed scenes (a model in a street, a flat-lay that fills the
|
|
9
|
+
* frame) look broken when letterboxed — they want `cover`.
|
|
10
|
+
*
|
|
11
|
+
* We can't tell these apart from the resolver metadata (it only exposes url +
|
|
12
|
+
* optional dimensions), so we sniff the pixels: sample the image's border ring
|
|
13
|
+
* and ask "is there a consistent backdrop colour behind the subject?".
|
|
14
|
+
* - Consistent border → seamless backdrop → render `contain` and paint the
|
|
15
|
+
* slot that backdrop colour, so the "letterbox" becomes an invisible
|
|
16
|
+
* extension of the image's own sweep (white shoe → white fill; green
|
|
17
|
+
* sweater sweep → green fill). The whole subject is always visible.
|
|
18
|
+
* - Noisy border → edge-to-edge scene → render `cover`; cropping the
|
|
19
|
+
* margins is safe and letterboxing would look wrong.
|
|
20
|
+
*/
|
|
21
|
+
export interface BackdropAnalysis {
|
|
22
|
+
/** True when the border reads as a seamless backdrop (uniform or transparent). */
|
|
23
|
+
hasBackdrop: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* CSS colour to paint behind a `contain`ed image so the letterbox blends.
|
|
26
|
+
* `'transparent'` for cutouts with an alpha border (the page background then
|
|
27
|
+
* shows through). Undefined when `hasBackdrop` is false.
|
|
28
|
+
*/
|
|
29
|
+
backgroundColor?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Inspect the 1px border ring of an RGBA buffer and classify the backdrop.
|
|
33
|
+
* Pure and synchronous so it can be unit-tested without a DOM.
|
|
34
|
+
*/
|
|
35
|
+
export declare function analyzeBackdrop(data: Uint8ClampedArray, width: number, height: number): BackdropAnalysis;
|
|
36
|
+
/**
|
|
37
|
+
* Bounding box of the non-background content in a probed image, in sample-grid
|
|
38
|
+
* coordinates (0..size-1), plus the sampled background colour. Used by callers
|
|
39
|
+
* that need *where the subject sits* (e.g. crop-safety in a fixed-aspect slot),
|
|
40
|
+
* which is a different question from `analyzeBackdrop`'s "is there a backdrop".
|
|
41
|
+
*/
|
|
42
|
+
export interface ContentBBox {
|
|
43
|
+
top: number;
|
|
44
|
+
bottom: number;
|
|
45
|
+
left: number;
|
|
46
|
+
right: number;
|
|
47
|
+
/** Background colour, sampled from the top-left pixel. */
|
|
48
|
+
background: {
|
|
49
|
+
r: number;
|
|
50
|
+
g: number;
|
|
51
|
+
b: number;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Find the bounding box of the subject by treating the top-left pixel as the
|
|
56
|
+
* background colour and flagging every pixel that differs from it (or is
|
|
57
|
+
* transparent). Pure and synchronous. Returns null for an all-background frame.
|
|
58
|
+
*
|
|
59
|
+
* `backgroundTolerance`/`alphaThreshold` default to the values tuned for
|
|
60
|
+
* uniform studio catalog shots; callers can override.
|
|
61
|
+
*/
|
|
62
|
+
export declare function computeContentBBox(data: Uint8ClampedArray, size: number, options?: {
|
|
63
|
+
backgroundTolerance?: number;
|
|
64
|
+
alphaThreshold?: number;
|
|
65
|
+
}): ContentBBox | null;
|
|
66
|
+
/**
|
|
67
|
+
* Build the URL of a tiny, aspect-preserving (`fit`) version of an image so we
|
|
68
|
+
* can read its true edges. Wix media is downscaled by the CDN; other URLs are
|
|
69
|
+
* probed at full size (still drawn onto a small canvas).
|
|
70
|
+
*/
|
|
71
|
+
export declare function buildProbeUrl(effectiveFilename: string): string;
|
|
72
|
+
/** RGBA pixels of a probed image, drawn onto a `size`×`size` grid, alongside the
|
|
73
|
+
* source's true intrinsic dimensions (needed for aspect-aware crop math). */
|
|
74
|
+
export interface ImagePixels {
|
|
75
|
+
data: Uint8ClampedArray;
|
|
76
|
+
size: number;
|
|
77
|
+
naturalWidth: number;
|
|
78
|
+
naturalHeight: number;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Shared probe plumbing: load a (downscaled, for Wix) version of the image
|
|
82
|
+
* cross-origin, draw it onto a `size`×`size` canvas, and return its pixels plus
|
|
83
|
+
* intrinsic dimensions. Resolves to `null` on any failure — missing DOM, a
|
|
84
|
+
* data/blob source, a load error, or a tainted canvas (if CORS ever regresses)
|
|
85
|
+
* — so every caller can fall back to its own default. Browser-only.
|
|
86
|
+
*
|
|
87
|
+
* Both the backdrop classifier (`loadBackdropAnalysis`) and bounding-box callers
|
|
88
|
+
* build on this so the canvas/CORS/taint handling lives in exactly one place.
|
|
89
|
+
*/
|
|
90
|
+
export declare function loadImagePixels(effectiveFilename: string, options?: {
|
|
91
|
+
size?: number;
|
|
92
|
+
}, signal?: {
|
|
93
|
+
aborted: boolean;
|
|
94
|
+
}): Promise<ImagePixels | null>;
|
|
95
|
+
/**
|
|
96
|
+
* Load a probe image and analyze its backdrop. Resolves to `NO_BACKDROP` on any
|
|
97
|
+
* failure so callers fall back to their default fit. Browser-only.
|
|
98
|
+
*/
|
|
99
|
+
export declare function loadBackdropAnalysis(effectiveFilename: string, signal?: {
|
|
100
|
+
aborted: boolean;
|
|
101
|
+
}): Promise<BackdropAnalysis>;
|
|
102
|
+
//# sourceMappingURL=imageBackdrop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imageBackdrop.d.ts","sourceRoot":"","sources":["../../../src/utils/imageBackdrop.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,gBAAgB;IAC/B,kFAAkF;IAClF,WAAW,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAwBD;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,gBAAgB,CAkElB;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,UAAU,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACjD;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,iBAAiB,EACvB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;IAAE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,GAClE,WAAW,GAAG,IAAI,CAmCpB;AAMD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAa/D;AAED;8EAC8E;AAC9E,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,iBAAiB,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,iBAAiB,EAAE,MAAM,EACzB,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAC3B,MAAM,CAAC,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GAC5B,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CA+C7B;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,iBAAiB,EAAE,MAAM,EACzB,MAAM,CAAC,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GAC5B,OAAO,CAAC,gBAAgB,CAAC,CAO3B"}
|
|
@@ -1,11 +1,28 @@
|
|
|
1
|
-
import { Intent } from '../registry/Intent';
|
|
2
1
|
export type ResponseState = 'full' | 'partial';
|
|
3
2
|
export interface IntentInfo {
|
|
4
|
-
intent:
|
|
3
|
+
intent: string;
|
|
5
4
|
stage?: string;
|
|
6
5
|
reason?: string;
|
|
7
6
|
state?: ResponseState;
|
|
8
7
|
}
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Controls how a raw intent string is validated / defaulted during extraction.
|
|
10
|
+
* Core holds NO intent list of its own — the taxonomy is client-specific. A
|
|
11
|
+
* caller supplies the client's list (typically `registry.getKnownIntents()`) to
|
|
12
|
+
* make the FE honour that client's intents; with no list, any emitted intent is
|
|
13
|
+
* accepted verbatim (resolution then falls back to the section default when the
|
|
14
|
+
* intent has no registered variant).
|
|
15
|
+
*/
|
|
16
|
+
export interface IntentExtractionOptions {
|
|
17
|
+
/**
|
|
18
|
+
* The intents to accept (matched case-insensitively). An emitted intent
|
|
19
|
+
* outside this list is treated as absent. When omitted, no filtering is
|
|
20
|
+
* applied and the emitted intent passes through as-is.
|
|
21
|
+
*/
|
|
22
|
+
validIntents?: readonly string[];
|
|
23
|
+
/** Intent assumed when the markdown carries no intent annotation. Defaults to ''. */
|
|
24
|
+
defaultIntent?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function extractIntentFromMarkdown(markdown: string, options?: IntentExtractionOptions): IntentInfo | null;
|
|
27
|
+
export declare function getIntentFromMarkdown(markdown: string, options?: IntentExtractionOptions): IntentInfo;
|
|
11
28
|
//# sourceMappingURL=intentExtractor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intentExtractor.d.ts","sourceRoot":"","sources":["../../../src/utils/intentExtractor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"intentExtractor.d.ts","sourceRoot":"","sources":["../../../src/utils/intentExtractor.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,CAAC;AAE/C,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,qFAAqF;IACrF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAsBD,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,uBAAuB,GAChC,UAAU,GAAG,IAAI,CAwBnB;AAED,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,uBAAuB,GAChC,UAAU,CAOZ"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Product-page → full-app "back" context hand-off (DL #114).
|
|
3
|
+
*
|
|
4
|
+
* A PDP placement writes the product context to `sessionStorage` immediately
|
|
5
|
+
* before redirecting the visitor to the full Web5 page; the app reads it once
|
|
6
|
+
* on load and renders a back-to-product badge in the conversation header.
|
|
7
|
+
*
|
|
8
|
+
* The context never enters the URL, so there is no shareable/tamperable link
|
|
9
|
+
* that could spoof the header (the security driver in DL #114). The hand-off
|
|
10
|
+
* relies on the redirect being a same-origin, same-tab top-level navigation
|
|
11
|
+
* (`searchRedirectUrl`, e.g. `/ai`), which is what keeps `sessionStorage`
|
|
12
|
+
* readable on the other side. Cross-origin → nothing is read → no badge.
|
|
13
|
+
*/
|
|
14
|
+
export declare const PRODUCT_BACK_SESSION_KEY = "web5:productBack";
|
|
15
|
+
export interface ProductBackHandoff {
|
|
16
|
+
/** Product display name (first-party; e.g. the PDP `og:title`). */
|
|
17
|
+
title?: string;
|
|
18
|
+
/** Product thumbnail URL (first-party; e.g. the PDP `og:image`). */
|
|
19
|
+
imageUrl?: string;
|
|
20
|
+
/** The product page to return to — the PDP's own URL. */
|
|
21
|
+
backUrl?: string;
|
|
22
|
+
/** Epoch ms when written; the reader drops stale entries. */
|
|
23
|
+
ts?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Write the back-context just before navigating away from a product page.
|
|
27
|
+
* Values default to the page's own first-party Open Graph tags and URL, so a
|
|
28
|
+
* standard PDP needs no extra wiring; pass `overrides` to supply exact data.
|
|
29
|
+
* No-op outside the browser or when no product title can be determined.
|
|
30
|
+
*/
|
|
31
|
+
export declare function writeProductBackHandoff(overrides?: {
|
|
32
|
+
title?: string;
|
|
33
|
+
imageUrl?: string;
|
|
34
|
+
backUrl?: string;
|
|
35
|
+
}): void;
|
|
36
|
+
/**
|
|
37
|
+
* Read and immediately delete the back-context (consume-once: survives exactly
|
|
38
|
+
* one page load, so a reload or bfcache restore won't replay it). Returns null
|
|
39
|
+
* when absent or unparseable. Callers must still validate the values before use
|
|
40
|
+
* (freshness window, allowed-domain check on `backUrl`, `https:` on `imageUrl`).
|
|
41
|
+
*/
|
|
42
|
+
export declare function readProductBackHandoff(): ProductBackHandoff | null;
|
|
43
|
+
//# sourceMappingURL=productBackHandoff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productBackHandoff.d.ts","sourceRoot":"","sources":["../../../src/utils/productBackHandoff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,wBAAwB,qBAAqB,CAAC;AAE3D,MAAM,WAAW,kBAAkB;IACjC,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAoCD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,CAAC,EAAE;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,CAuBP;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,kBAAkB,GAAG,IAAI,CAmBlE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Refresh-prompts flag (debug-only).
|
|
3
|
+
*
|
|
4
|
+
* When active, the Turn RPC request (`POST /v1/turn`, DL #110) carries
|
|
5
|
+
* `additionalData.refresh_prompts: 'true'`, asking the BE to re-pull prompts
|
|
6
|
+
* instead of serving cached ones.
|
|
7
|
+
*
|
|
8
|
+
* Keeping it on slows the app, so the flag self-expires: rather than a bare
|
|
9
|
+
* boolean we persist an expiry timestamp in
|
|
10
|
+
* `localStorage["web5_refresh_prompts_until"]`. `shouldRefreshPrompts()` is
|
|
11
|
+
* true only while now < expiry, so the cap holds even across reloads or if a
|
|
12
|
+
* UI timer never fires. Lives in web5-core so the request builder and any
|
|
13
|
+
* surface honor the same toggle.
|
|
14
|
+
*/
|
|
15
|
+
export declare const REFRESH_PROMPTS_UNTIL_KEY = "web5_refresh_prompts_until";
|
|
16
|
+
/** How long the flag stays active once enabled (2 minutes). */
|
|
17
|
+
export declare const REFRESH_PROMPTS_WINDOW_MS: number;
|
|
18
|
+
/**
|
|
19
|
+
* Read the expiry timestamp (ms epoch) from localStorage. Returns 0 when
|
|
20
|
+
* unset, invalid, or storage is unavailable.
|
|
21
|
+
*/
|
|
22
|
+
export declare const getRefreshPromptsExpiry: () => number;
|
|
23
|
+
/** Whether the refresh-prompts flag is currently active (within its window). */
|
|
24
|
+
export declare const shouldRefreshPrompts: () => boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Activate the flag for `windowMs` from now and return the new expiry
|
|
27
|
+
* timestamp. Re-enabling restarts the window.
|
|
28
|
+
*/
|
|
29
|
+
export declare const enableRefreshPrompts: (windowMs?: number) => number;
|
|
30
|
+
/** Deactivate the flag immediately (proactive off). */
|
|
31
|
+
export declare const disableRefreshPrompts: () => void;
|
|
32
|
+
//# sourceMappingURL=refreshPrompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refreshPrompts.d.ts","sourceRoot":"","sources":["../../../src/utils/refreshPrompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,yBAAyB,+BAA+B,CAAC;AAEtE,+DAA+D;AAC/D,eAAO,MAAM,yBAAyB,QAAgB,CAAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,QAAO,MAY1C,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,oBAAoB,QAAO,OACA,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,oBAAoB,cACrB,MAAM,KACf,MAQF,CAAC;AAEF,uDAAuD;AACvD,eAAO,MAAM,qBAAqB,QAAO,IAMxC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/web5-core",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.57.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "tsachis",
|
|
7
7
|
"email": "tsachis@wix.com"
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"wallaby": {
|
|
101
101
|
"autoDetect": true
|
|
102
102
|
},
|
|
103
|
-
"falconPackageHash": "
|
|
103
|
+
"falconPackageHash": "d81e7d4252b50b94d46bdb6c4a55696d95b2787761303c708cb8bf9e"
|
|
104
104
|
}
|
|
@@ -9,6 +9,25 @@
|
|
|
9
9
|
pointer-events: none;
|
|
10
10
|
user-select: none;
|
|
11
11
|
padding-block: 4rem;
|
|
12
|
+
/* `min-height` (per-shape, below) includes the block padding so the reserved
|
|
13
|
+
space matches the eventual section regardless of the consuming app's reset. */
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* Per-section-type height reservation (DL #114 C) — approximate the eventual
|
|
18
|
+
section so the skeleton→content swap causes near-zero layout shift below it.
|
|
19
|
+
Erring slightly tall is preferable (content settles up, not down). */
|
|
20
|
+
.w5-skeleton--cards {
|
|
21
|
+
min-height: 28rem;
|
|
22
|
+
}
|
|
23
|
+
.w5-skeleton--tiles {
|
|
24
|
+
min-height: 14rem;
|
|
25
|
+
}
|
|
26
|
+
.w5-skeleton--rows {
|
|
27
|
+
min-height: 18rem;
|
|
28
|
+
}
|
|
29
|
+
.w5-skeleton--lines {
|
|
30
|
+
min-height: 10rem;
|
|
12
31
|
}
|
|
13
32
|
|
|
14
33
|
@media (min-width: 64rem) {
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/* Product-page back badge (DL #114) — self-contained CSS so the badge renders
|
|
2
|
+
styled even where the consumer doesn't compile Tailwind from web5-core/src.
|
|
3
|
+
Mounted inside the shared `UserQuery` header; clients can re-skin via the
|
|
4
|
+
`--web5-product-back-*` custom properties, or replace the whole header via
|
|
5
|
+
the `UserQueryComponent` UI slot. */
|
|
6
|
+
|
|
7
|
+
/* Left column: the badge row stacked above the user's query, with the row→query
|
|
8
|
+
gap. Used whether or not a badge is present (harmless with a single child). */
|
|
9
|
+
.web5-user-query__left {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
gap: var(--web5-user-query-row-gap, 11px);
|
|
13
|
+
min-width: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* Badge row: back arrow + thumbnail + product name. */
|
|
17
|
+
.web5-user-query__product-back {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: var(--web5-product-back-gap, 11px);
|
|
21
|
+
min-width: 0;
|
|
22
|
+
max-width: var(--web5-product-back-max-width, 440px);
|
|
23
|
+
margin: 0;
|
|
24
|
+
padding: 0;
|
|
25
|
+
background: transparent;
|
|
26
|
+
border: 0;
|
|
27
|
+
text-align: left;
|
|
28
|
+
color: inherit;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
transition: color 0.15s ease;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* Non-clickable variant (no validated backUrl). */
|
|
34
|
+
.web5-user-query__product-back--static {
|
|
35
|
+
cursor: default;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.web5-user-query__product-back-icon {
|
|
39
|
+
flex: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.web5-user-query__product-back-thumb {
|
|
43
|
+
flex: none;
|
|
44
|
+
width: var(--web5-product-thumb-size, 34px);
|
|
45
|
+
height: var(--web5-product-thumb-size, 34px);
|
|
46
|
+
border-radius: var(--web5-product-thumb-radius, 3px);
|
|
47
|
+
border: 1px solid var(--web5-product-thumb-border, #f1f0ee);
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
background: #fff;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.web5-user-query__product-back-thumb img {
|
|
53
|
+
display: block;
|
|
54
|
+
width: 100%;
|
|
55
|
+
height: 100%;
|
|
56
|
+
object-fit: cover;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.web5-user-query__product-back-title {
|
|
60
|
+
min-width: 0;
|
|
61
|
+
overflow: hidden;
|
|
62
|
+
text-overflow: ellipsis;
|
|
63
|
+
white-space: nowrap;
|
|
64
|
+
font-size: var(--web5-product-back-title-size, 16px);
|
|
65
|
+
line-height: var(--web5-product-back-title-line-height, 20px);
|
|
66
|
+
font-weight: var(--web5-product-back-title-weight, 500);
|
|
67
|
+
color: var(--web5-product-back-title-color, var(--body-text-color, #2b2b2b));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.web5-user-query__product-back:hover .web5-user-query__product-back-title {
|
|
71
|
+
text-decoration: underline;
|
|
72
|
+
}
|
|
@@ -378,6 +378,41 @@
|
|
|
378
378
|
100% { background-position: 200% 0; }
|
|
379
379
|
}
|
|
380
380
|
|
|
381
|
+
/* Section content reveal (DL #114 C) — a one-shot fade/slide-in applied the first
|
|
382
|
+
time a streamed section swaps from its skeleton to real content, so it appears
|
|
383
|
+
smoothly instead of popping in. Motion is suppressed under reduced-motion. */
|
|
384
|
+
@keyframes w5-section-in {
|
|
385
|
+
from { opacity: 0; transform: translateY(16px); }
|
|
386
|
+
to { opacity: 1; transform: none; }
|
|
387
|
+
}
|
|
388
|
+
.w5-section-enter {
|
|
389
|
+
animation: w5-section-in 360ms ease-out both;
|
|
390
|
+
}
|
|
391
|
+
@media (prefers-reduced-motion: reduce) {
|
|
392
|
+
.w5-section-enter {
|
|
393
|
+
animation: none;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/* Section skeleton entrance (DL #114 C) — when a section's skeleton first shows
|
|
398
|
+
up it unfolds from the top (scaleY) so it grows into place instead of popping
|
|
399
|
+
in at full height. Transform-based, so it doesn't shift the sections below
|
|
400
|
+
(their space is already reserved). Shared by every client skeleton (core
|
|
401
|
+
default + per-client overrides) via `w5-skeleton-expand`. Reduced-motion off. */
|
|
402
|
+
@keyframes w5-skeleton-expand {
|
|
403
|
+
from { opacity: 0; transform: scaleY(0); }
|
|
404
|
+
to { opacity: 1; transform: scaleY(1); }
|
|
405
|
+
}
|
|
406
|
+
.w5-skeleton-expand {
|
|
407
|
+
transform-origin: top center;
|
|
408
|
+
animation: w5-skeleton-expand 320ms ease-out both;
|
|
409
|
+
}
|
|
410
|
+
@media (prefers-reduced-motion: reduce) {
|
|
411
|
+
.w5-skeleton-expand {
|
|
412
|
+
animation: none;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
381
416
|
/* Global accessible focus indicator — only visible on keyboard navigation */
|
|
382
417
|
:focus-visible {
|
|
383
418
|
outline: 2px solid rgba(128, 0, 177, 0.5);
|
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
@import '../components/ui/PromptEntryEmptyState.css';
|
|
3
3
|
@import '../components/ui/FeedbackBar.css';
|
|
4
4
|
@import '../components/ui/Disclaimer.css';
|
|
5
|
+
@import '../components/ui/UserQuery.css';
|
|
5
6
|
@import '../components/ui/PlacementLoader.css';
|
|
6
7
|
@import '../components/placement/PlacementResponseRenderer.css';
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* host-reset.css — re-establishes the Web5 typographic baseline inside the
|
|
3
|
+
* mount root.
|
|
4
|
+
*
|
|
5
|
+
* Tailwind's preflight already neutralises most of what a host theme imposes
|
|
6
|
+
* (margins, list markers, heading font-size/weight, link decoration), and the
|
|
7
|
+
* build scopes it to the root, so inside Web5 it outranks the theme. What
|
|
8
|
+
* preflight does NOT cover is everything it expects to inherit from `html`:
|
|
9
|
+
* font-family, line-height, letter-spacing, text-transform and colour. A theme
|
|
10
|
+
* that sets those on its rich-text wrapper — `.rte p { line-height: 1.4 }`,
|
|
11
|
+
* `.rte h1 { font-family: … }` — still wins there, because inheritance loses to
|
|
12
|
+
* any matching rule.
|
|
13
|
+
*
|
|
14
|
+
* So each of those properties is re-asserted here at element specificity. After
|
|
15
|
+
* scoping these become `(1,0,1)`: above a theme's `(0,1,1)` descendant rules,
|
|
16
|
+
* below our own `(1,1,0)` utilities. That ordering is the whole point — the
|
|
17
|
+
* theme is overridden, atoms still win.
|
|
18
|
+
*
|
|
19
|
+
* Wrapped in `@layer base` so Storybook (which compiles this file without the
|
|
20
|
+
* scoping pass) keeps the same relationship to utilities as the shipped bundle.
|
|
21
|
+
*
|
|
22
|
+
* `#root` is rewritten to the scope selector by `config/scope-css.ts`.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
@layer base {
|
|
26
|
+
/*
|
|
27
|
+
* The baseline every descendant inherits. Without it the root inherits the
|
|
28
|
+
* theme's body type — 14px/1.4 on the reference store — and every element we
|
|
29
|
+
* do not explicitly size comes out wrong.
|
|
30
|
+
*
|
|
31
|
+
* `--w5-root-font-size` is the escape hatch for themes that rescale the root
|
|
32
|
+
* (`html { font-size: 62.5% }` is a common pattern): a client sets it in
|
|
33
|
+
* `users/<msid>/theme.css` to bring our rem-based scale back to intent.
|
|
34
|
+
*/
|
|
35
|
+
#root {
|
|
36
|
+
font-family: var(--font-sans);
|
|
37
|
+
font-size: var(--w5-root-font-size, 1rem);
|
|
38
|
+
font-style: normal;
|
|
39
|
+
font-weight: 400;
|
|
40
|
+
line-height: 1.5;
|
|
41
|
+
letter-spacing: normal;
|
|
42
|
+
text-align: start;
|
|
43
|
+
text-transform: none;
|
|
44
|
+
color: hsl(var(--foreground));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Headings take the display face regardless of what the theme sets on its
|
|
48
|
+
* rich-text headings. Sizes and weights come from the Heading atom. */
|
|
49
|
+
:is(h1, h2, h3, h4, h5, h6) {
|
|
50
|
+
font-family: var(--font-display);
|
|
51
|
+
letter-spacing: inherit;
|
|
52
|
+
text-transform: none;
|
|
53
|
+
color: inherit;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Everything that carries body copy inherits our baseline rather than the
|
|
57
|
+
* theme's rich-text rules. */
|
|
58
|
+
:is(p, li, dd, dt, blockquote, figcaption, label, td, th, address, small) {
|
|
59
|
+
font-family: inherit;
|
|
60
|
+
font-size: inherit;
|
|
61
|
+
line-height: inherit;
|
|
62
|
+
letter-spacing: inherit;
|
|
63
|
+
text-transform: none;
|
|
64
|
+
color: inherit;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* Links: preflight already inherits colour and decoration; themes also set
|
|
68
|
+
* the face and casing on them. */
|
|
69
|
+
a {
|
|
70
|
+
font-family: inherit;
|
|
71
|
+
letter-spacing: inherit;
|
|
72
|
+
text-transform: none;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Form controls inherit the face from preflight but not the rest, and the
|
|
76
|
+
* conversation input is a form control. */
|
|
77
|
+
:is(button, input, optgroup, select, textarea) {
|
|
78
|
+
letter-spacing: inherit;
|
|
79
|
+
text-transform: none;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -117,12 +117,12 @@
|
|
|
117
117
|
--leading-body-sm: var(--body-small-text-line-height);
|
|
118
118
|
--leading-callout: 36px;
|
|
119
119
|
|
|
120
|
-
/* Placement card body copy — short framing / conversation answers
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
--text-placement-body:
|
|
125
|
-
--leading-placement-body:
|
|
120
|
+
/* Placement card body copy — short framing / conversation answers and the
|
|
121
|
+
search-overview lead block. Medium weight body with bold leading-phrase
|
|
122
|
+
emphasis. Used by `PlacementGeneralTextSection` (the placement variant of
|
|
123
|
+
the fallback section) and `SearchOverviewSection`. */
|
|
124
|
+
--text-placement-body: 16px;
|
|
125
|
+
--leading-placement-body: 24px;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
/* Font tokens use @theme inline so utilities emit `font-family: var(--font-*)`
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.Intent = void 0;
|
|
5
|
-
let Intent = exports.Intent = /*#__PURE__*/function (Intent) {
|
|
6
|
-
// New intent taxonomy
|
|
7
|
-
Intent["COMPARISON"] = "COMPARISON";
|
|
8
|
-
Intent["DECISION"] = "DECISION";
|
|
9
|
-
Intent["VALIDATION"] = "VALIDATION";
|
|
10
|
-
Intent["STRATEGY"] = "STRATEGY";
|
|
11
|
-
Intent["EXPLORATION"] = "EXPLORATION";
|
|
12
|
-
Intent["INQUIRY"] = "INQUIRY";
|
|
13
|
-
// Legacy intents (still used in hero registrations and intentExtractor)
|
|
14
|
-
Intent["DISCOVERY"] = "DISCOVERY";
|
|
15
|
-
Intent["LEARN"] = "LEARN";
|
|
16
|
-
Intent["EVALUATE"] = "EVALUATE";
|
|
17
|
-
return Intent;
|
|
18
|
-
}({});
|
|
19
|
-
//# sourceMappingURL=Intent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Intent","exports"],"sources":["../../../src/registry/Intent.ts"],"sourcesContent":["export enum Intent {\n // New intent taxonomy\n COMPARISON = 'COMPARISON',\n DECISION = 'DECISION',\n VALIDATION = 'VALIDATION',\n STRATEGY = 'STRATEGY',\n EXPLORATION = 'EXPLORATION',\n INQUIRY = 'INQUIRY',\n // Legacy intents (still used in hero registrations and intentExtractor)\n DISCOVERY = 'DISCOVERY',\n LEARN = 'LEARN',\n EVALUATE = 'EVALUATE',\n}\n"],"mappings":";;;;IAAYA,MAAM,GAAAC,OAAA,CAAAD,MAAA,0BAANA,MAAM;EAChB;EADUA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAQhB;EARUA,MAAM;EAANA,MAAM;EAANA,MAAM;EAAA,OAANA,MAAM;AAAA","ignoreList":[]}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.usesTurnApi = exports.setConversationApi = exports.getConversationApi = exports.DEFAULT_CONVERSATION_API = exports.CONVERSATION_API_KEY = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Conversation API selection (debug-only).
|
|
7
|
-
*
|
|
8
|
-
* Switches the conversation between the default `Conversation` RPC
|
|
9
|
-
* (`POST /v1/conversation`) and the parallel-safe `Turn` RPC
|
|
10
|
-
* (`POST /v1/turn`, DL #110). Persisted in
|
|
11
|
-
* `localStorage["web5_conversation_api"]`, read at request time. Default
|
|
12
|
-
* `conversation` (Turn is opt-in via the debug toggle for now).
|
|
13
|
-
*
|
|
14
|
-
* `Turn` returns a flat markdown stream (no sectioned page frames), so the
|
|
15
|
-
* sectioned-stream consumption path only runs on the `Conversation` API. Lives
|
|
16
|
-
* in web5-core so any surface can honor the same toggle.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
const CONVERSATION_API_KEY = exports.CONVERSATION_API_KEY = 'web5_conversation_api';
|
|
20
|
-
const DEFAULT_CONVERSATION_API = exports.DEFAULT_CONVERSATION_API = 'conversation';
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Read the selected conversation API from localStorage. Falls back to the
|
|
24
|
-
* default (`conversation`) when unset, invalid, or storage is unavailable.
|
|
25
|
-
*/
|
|
26
|
-
const getConversationApi = () => {
|
|
27
|
-
try {
|
|
28
|
-
const value = localStorage.getItem(CONVERSATION_API_KEY);
|
|
29
|
-
if (value === 'turn' || value === 'conversation') {
|
|
30
|
-
return value;
|
|
31
|
-
}
|
|
32
|
-
} catch {
|
|
33
|
-
// localStorage can throw in privacy mode / non-DOM environments.
|
|
34
|
-
}
|
|
35
|
-
return DEFAULT_CONVERSATION_API;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
/** Persist the selected conversation API to localStorage. */
|
|
39
|
-
exports.getConversationApi = getConversationApi;
|
|
40
|
-
const setConversationApi = api => {
|
|
41
|
-
try {
|
|
42
|
-
localStorage.setItem(CONVERSATION_API_KEY, api);
|
|
43
|
-
} catch {
|
|
44
|
-
// Ignore — selection simply won't persist across reloads.
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/** Whether the conversation should use the Turn RPC (opt-in; default is Conversation). */
|
|
49
|
-
exports.setConversationApi = setConversationApi;
|
|
50
|
-
const usesTurnApi = () => getConversationApi() === 'turn';
|
|
51
|
-
exports.usesTurnApi = usesTurnApi;
|
|
52
|
-
//# sourceMappingURL=conversationApi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["CONVERSATION_API_KEY","exports","DEFAULT_CONVERSATION_API","getConversationApi","value","localStorage","getItem","setConversationApi","api","setItem","usesTurnApi"],"sources":["../../../src/utils/conversationApi.ts"],"sourcesContent":["/**\n * Conversation API selection (debug-only).\n *\n * Switches the conversation between the default `Conversation` RPC\n * (`POST /v1/conversation`) and the parallel-safe `Turn` RPC\n * (`POST /v1/turn`, DL #110). Persisted in\n * `localStorage[\"web5_conversation_api\"]`, read at request time. Default\n * `conversation` (Turn is opt-in via the debug toggle for now).\n *\n * `Turn` returns a flat markdown stream (no sectioned page frames), so the\n * sectioned-stream consumption path only runs on the `Conversation` API. Lives\n * in web5-core so any surface can honor the same toggle.\n */\n\nexport type ConversationApiKind = 'turn' | 'conversation';\n\nexport const CONVERSATION_API_KEY = 'web5_conversation_api';\n\nexport const DEFAULT_CONVERSATION_API: ConversationApiKind = 'conversation';\n\n/**\n * Read the selected conversation API from localStorage. Falls back to the\n * default (`conversation`) when unset, invalid, or storage is unavailable.\n */\nexport const getConversationApi = (): ConversationApiKind => {\n try {\n const value = localStorage.getItem(CONVERSATION_API_KEY);\n if (value === 'turn' || value === 'conversation') {\n return value;\n }\n } catch {\n // localStorage can throw in privacy mode / non-DOM environments.\n }\n return DEFAULT_CONVERSATION_API;\n};\n\n/** Persist the selected conversation API to localStorage. */\nexport const setConversationApi = (api: ConversationApiKind): void => {\n try {\n localStorage.setItem(CONVERSATION_API_KEY, api);\n } catch {\n // Ignore — selection simply won't persist across reloads.\n }\n};\n\n/** Whether the conversation should use the Turn RPC (opt-in; default is Conversation). */\nexport const usesTurnApi = (): boolean => getConversationApi() === 'turn';\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIO,MAAMA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,uBAAuB;AAEpD,MAAME,wBAA6C,GAAAD,OAAA,CAAAC,wBAAA,GAAG,cAAc;;AAE3E;AACA;AACA;AACA;AACO,MAAMC,kBAAkB,GAAGA,CAAA,KAA2B;EAC3D,IAAI;IACF,MAAMC,KAAK,GAAGC,YAAY,CAACC,OAAO,CAACN,oBAAoB,CAAC;IACxD,IAAII,KAAK,KAAK,MAAM,IAAIA,KAAK,KAAK,cAAc,EAAE;MAChD,OAAOA,KAAK;IACd;EACF,CAAC,CAAC,MAAM;IACN;EAAA;EAEF,OAAOF,wBAAwB;AACjC,CAAC;;AAED;AAAAD,OAAA,CAAAE,kBAAA,GAAAA,kBAAA;AACO,MAAMI,kBAAkB,GAAIC,GAAwB,IAAW;EACpE,IAAI;IACFH,YAAY,CAACI,OAAO,CAACT,oBAAoB,EAAEQ,GAAG,CAAC;EACjD,CAAC,CAAC,MAAM;IACN;EAAA;AAEJ,CAAC;;AAED;AAAAP,OAAA,CAAAM,kBAAA,GAAAA,kBAAA;AACO,MAAMG,WAAW,GAAGA,CAAA,KAAeP,kBAAkB,CAAC,CAAC,KAAK,MAAM;AAACF,OAAA,CAAAS,WAAA,GAAAA,WAAA","ignoreList":[]}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.resolveConversationMode = exports.CONVERSATION_MODE = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Conversation wire mode.
|
|
7
|
-
*
|
|
8
|
-
* There is a single conversation engine: the page streams section-by-section
|
|
9
|
-
* (each markdown frame tagged with a numeric section `id` + `status`). The
|
|
10
|
-
* `additionalData.mode` sent on every `/conversation` request is fixed.
|
|
11
|
-
*
|
|
12
|
-
* A `?mode=` query param, when present, overrides this value and is sent to the
|
|
13
|
-
* backend verbatim (callers read the param themselves); the frontend always
|
|
14
|
-
* uses the sectioned-stream consumption path regardless.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/** `additionalData.mode` sent on a `/conversation` request. */
|
|
18
|
-
const CONVERSATION_MODE = exports.CONVERSATION_MODE = 'markdown_history_v3';
|
|
19
|
-
|
|
20
|
-
/** Resolve the `additionalData.mode` to send on a `/conversation` request. */
|
|
21
|
-
const resolveConversationMode = () => CONVERSATION_MODE;
|
|
22
|
-
exports.resolveConversationMode = resolveConversationMode;
|
|
23
|
-
//# sourceMappingURL=conversationMode.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["CONVERSATION_MODE","exports","resolveConversationMode"],"sources":["../../../src/utils/conversationMode.ts"],"sourcesContent":["/**\n * Conversation wire mode.\n *\n * There is a single conversation engine: the page streams section-by-section\n * (each markdown frame tagged with a numeric section `id` + `status`). The\n * `additionalData.mode` sent on every `/conversation` request is fixed.\n *\n * A `?mode=` query param, when present, overrides this value and is sent to the\n * backend verbatim (callers read the param themselves); the frontend always\n * uses the sectioned-stream consumption path regardless.\n */\n\n/** `additionalData.mode` sent on a `/conversation` request. */\nexport const CONVERSATION_MODE = 'markdown_history_v3';\n\n/** Resolve the `additionalData.mode` to send on a `/conversation` request. */\nexport const resolveConversationMode = (): string => CONVERSATION_MODE;\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACO,MAAMA,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,qBAAqB;;AAEtD;AACO,MAAME,uBAAuB,GAAGA,CAAA,KAAcF,iBAAiB;AAACC,OAAA,CAAAC,uBAAA,GAAAA,uBAAA","ignoreList":[]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export let Intent = /*#__PURE__*/function (Intent) {
|
|
2
|
-
// New intent taxonomy
|
|
3
|
-
Intent["COMPARISON"] = "COMPARISON";
|
|
4
|
-
Intent["DECISION"] = "DECISION";
|
|
5
|
-
Intent["VALIDATION"] = "VALIDATION";
|
|
6
|
-
Intent["STRATEGY"] = "STRATEGY";
|
|
7
|
-
Intent["EXPLORATION"] = "EXPLORATION";
|
|
8
|
-
Intent["INQUIRY"] = "INQUIRY";
|
|
9
|
-
// Legacy intents (still used in hero registrations and intentExtractor)
|
|
10
|
-
Intent["DISCOVERY"] = "DISCOVERY";
|
|
11
|
-
Intent["LEARN"] = "LEARN";
|
|
12
|
-
Intent["EVALUATE"] = "EVALUATE";
|
|
13
|
-
return Intent;
|
|
14
|
-
}({});
|
|
15
|
-
//# sourceMappingURL=Intent.js.map
|