@wix/web5-core 1.63.23 → 1.63.25
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/component/componentDefinitions/MetricsSectionDefinition.js +149 -0
- package/dist/cjs/component/componentDefinitions/MetricsSectionDefinition.js.map +1 -0
- package/dist/cjs/component/componentDefinitions/index.js +3 -1
- package/dist/cjs/component/componentDefinitions/index.js.map +1 -1
- package/dist/cjs/component/types.js.map +1 -1
- package/dist/cjs/index.js +4 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/registry/ComponentRegistry.js +35 -8
- package/dist/cjs/registry/ComponentRegistry.js.map +1 -1
- package/dist/esm/component/componentDefinitions/MetricsSectionDefinition.js +144 -0
- package/dist/esm/component/componentDefinitions/MetricsSectionDefinition.js.map +1 -0
- package/dist/esm/component/componentDefinitions/index.js +3 -1
- package/dist/esm/component/componentDefinitions/index.js.map +1 -1
- package/dist/esm/component/types.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/registry/ComponentRegistry.js +35 -8
- package/dist/esm/registry/ComponentRegistry.js.map +1 -1
- package/dist/types/component/componentDefinitions/MetricsSectionDefinition.d.ts +49 -0
- package/dist/types/component/componentDefinitions/MetricsSectionDefinition.d.ts.map +1 -0
- package/dist/types/component/componentDefinitions/index.d.ts +1 -0
- package/dist/types/component/componentDefinitions/index.d.ts.map +1 -1
- package/dist/types/component/types.d.ts +19 -0
- package/dist/types/component/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/registry/ComponentRegistry.d.ts +4 -0
- package/dist/types/registry/ComponentRegistry.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.MetricsSectionDefinition = void 0;
|
|
6
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
7
|
+
var _parseUtils = require("./parse-utils");
|
|
8
|
+
var _parts = require("../../parts/parts");
|
|
9
|
+
var _diagnosticTypes = require("../diagnosticTypes");
|
|
10
|
+
/**
|
|
11
|
+
* Metrics — a band of headline facts about one subject.
|
|
12
|
+
*
|
|
13
|
+
* Claims the orchestrator's `metrics` layout:
|
|
14
|
+
*
|
|
15
|
+
* <!-- section:metrics, semantic:metrics -->
|
|
16
|
+
* ## Sleep product price ranges and SKUs on this page
|
|
17
|
+
* - **Single-dose liquid price:** 3.9
|
|
18
|
+
* - **Melatonin liquids/gummies price range:** 9.8–15.96
|
|
19
|
+
*
|
|
20
|
+
* ## Why this is not `KpiSectionDefinition`
|
|
21
|
+
*
|
|
22
|
+
* That definition parses a near-identical shape but gates on
|
|
23
|
+
* `html_comment[section^="kpi"]`, and no prompt emits `section:kpi` — the word
|
|
24
|
+
* appears nowhere in the orchestrator prompt and was never once emitted across
|
|
25
|
+
* 220 pages of captured production output. It stays because two clients still
|
|
26
|
+
* register it, but nothing reaches it. Until this definition existed a real
|
|
27
|
+
* `section:metrics` block was claimed by `FeatureSection9PlusDefinition` and
|
|
28
|
+
* rendered as feature cards with icons, prices as card descriptions.
|
|
29
|
+
*
|
|
30
|
+
* ## The value/label inversion
|
|
31
|
+
*
|
|
32
|
+
* This is the one behavioural difference from `KpiSectionDefinition`, and the
|
|
33
|
+
* reason re-pointing that definition at the `metrics` marker would not have
|
|
34
|
+
* been enough. `prompt/base/section:metrics` mandates bolding the **label**:
|
|
35
|
+
*
|
|
36
|
+
* - **<Label>:** <value>
|
|
37
|
+
*
|
|
38
|
+
* while `parseKpiItem` reads the first bold run as the *title* — which every
|
|
39
|
+
* renderer shows as the large numeral. Under that contract a real page renders
|
|
40
|
+
* "Single-dose liquid price:" at display size and "3.9" as the caption. So here
|
|
41
|
+
* the bold run is the **label** (`description`) and the text after it is the
|
|
42
|
+
* **value** (`title`).
|
|
43
|
+
*
|
|
44
|
+
* The colon is accepted on either side of the bold: the section prompt's
|
|
45
|
+
* template puts it inside (`**Label:**`), the older KPI fixtures put it outside
|
|
46
|
+
* (`**48.8%**:`).
|
|
47
|
+
*/
|
|
48
|
+
class MetricsSectionDefinition {
|
|
49
|
+
constructor() {
|
|
50
|
+
(0, _defineProperty2.default)(this, "sectionType", 'metrics');
|
|
51
|
+
(0, _defineProperty2.default)(this, "patterns", ['html_comment[section^="metrics"] > h2 > list{item[1-]:icon? > t+}', 'html_comment[section^="metrics"] > h2 > (icon? > t)+']);
|
|
52
|
+
(0, _defineProperty2.default)(this, "defaults", {
|
|
53
|
+
title: 'Key metrics',
|
|
54
|
+
items: [{
|
|
55
|
+
title: '12',
|
|
56
|
+
description: 'Brands carried'
|
|
57
|
+
}]
|
|
58
|
+
});
|
|
59
|
+
(0, _defineProperty2.default)(this, "fixtures", [{
|
|
60
|
+
markdown: `<!-- section:metrics, semantic:metrics -->
|
|
61
|
+
## Sleep product price ranges and SKUs on this page
|
|
62
|
+
- **Single-dose liquid price:** 3.9
|
|
63
|
+
- **Example SKUs shown:** 8`,
|
|
64
|
+
expected: {
|
|
65
|
+
title: 'Sleep product price ranges and SKUs on this page',
|
|
66
|
+
items: [{
|
|
67
|
+
title: '3.9',
|
|
68
|
+
description: 'Single-dose liquid price'
|
|
69
|
+
}, {
|
|
70
|
+
title: '8',
|
|
71
|
+
description: 'Example SKUs shown'
|
|
72
|
+
}]
|
|
73
|
+
}
|
|
74
|
+
}]);
|
|
75
|
+
}
|
|
76
|
+
parse(parts, context) {
|
|
77
|
+
const title = (0, _parseUtils.headingText)(parts, 2);
|
|
78
|
+
const items = [];
|
|
79
|
+
let dropped = 0;
|
|
80
|
+
const collect = markdown => {
|
|
81
|
+
const parsed = parseMetricItem(markdown);
|
|
82
|
+
if (parsed) {
|
|
83
|
+
items.push(parsed);
|
|
84
|
+
} else if (markdown.trim()) {
|
|
85
|
+
dropped++;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// The shape the section prompt emits: a heading followed by one bullet list.
|
|
90
|
+
for (const list of (0, _parts.getPartsByType)(parts, 'list')) {
|
|
91
|
+
for (const item of ((_list$meta = list.meta) == null ? void 0 : _list$meta.items) ?? []) {
|
|
92
|
+
var _list$meta, _item$meta;
|
|
93
|
+
const itemParts = ((_item$meta = item.meta) == null ? void 0 : _item$meta.parts) ?? [];
|
|
94
|
+
collect(itemParts.filter(p => p.type !== 'icon').map(p => {
|
|
95
|
+
var _p$meta;
|
|
96
|
+
return ((_p$meta = p.meta) == null ? void 0 : _p$meta.markdown) || p.content;
|
|
97
|
+
}).filter(Boolean).join(' '));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Fallback: the same facts emitted as loose lines rather than a list.
|
|
102
|
+
if (items.length === 0) {
|
|
103
|
+
for (const part of parts) {
|
|
104
|
+
var _part$meta;
|
|
105
|
+
if (part.type !== 'text' && part.type !== 'richText') {
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
const markdown = ((_part$meta = part.meta) == null ? void 0 : _part$meta.markdown) || part.content || '';
|
|
109
|
+
for (const line of markdown.split('\n')) {
|
|
110
|
+
collect(line);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (dropped > 0) {
|
|
115
|
+
context == null || context.reportDiagnostic == null || context.reportDiagnostic(_diagnosticTypes.DIAGNOSTIC_TYPES.ITEMS_DROPPED, `metrics: ${dropped} item(s) dropped (no bold label, or no value after it)`);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Nothing usable — reject the match so the block falls through rather than
|
|
119
|
+
// rendering an empty band.
|
|
120
|
+
return items.length > 0 ? {
|
|
121
|
+
title,
|
|
122
|
+
items
|
|
123
|
+
} : null;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* `**Label:** value` → `{ title: value, description: label }`.
|
|
129
|
+
*
|
|
130
|
+
* Null when there is no bold run, or nothing after it. A metric with no value
|
|
131
|
+
* is malformed rather than merely sparse — the band exists to show a number,
|
|
132
|
+
* and deriving one from the label is exactly what the section prompt forbids —
|
|
133
|
+
* so it is dropped and counted rather than rendered blank.
|
|
134
|
+
*/
|
|
135
|
+
exports.MetricsSectionDefinition = MetricsSectionDefinition;
|
|
136
|
+
function parseMetricItem(markdown) {
|
|
137
|
+
const trimmed = markdown.trim();
|
|
138
|
+
const boldMatch = trimmed.match(/\*\*(.+?)\*\*/);
|
|
139
|
+
if (!boldMatch) {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
const label = boldMatch[1].trim().replace(/:$/, '').trim();
|
|
143
|
+
const value = trimmed.slice(trimmed.indexOf(boldMatch[0]) + boldMatch[0].length).replace(/^[:\s]+/, '').trim();
|
|
144
|
+
return value && label ? {
|
|
145
|
+
title: value,
|
|
146
|
+
description: label
|
|
147
|
+
} : null;
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=MetricsSectionDefinition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_parseUtils","require","_parts","_diagnosticTypes","MetricsSectionDefinition","constructor","_defineProperty2","default","title","items","description","markdown","expected","parse","parts","context","headingText","dropped","collect","parsed","parseMetricItem","push","trim","list","getPartsByType","item","_list$meta","meta","_item$meta","itemParts","filter","p","type","map","_p$meta","content","Boolean","join","length","part","_part$meta","line","split","reportDiagnostic","DIAGNOSTIC_TYPES","ITEMS_DROPPED","exports","trimmed","boldMatch","match","label","replace","value","slice","indexOf"],"sources":["../../../../src/component/componentDefinitions/MetricsSectionDefinition.ts"],"sourcesContent":["import { headingText } from './parse-utils';\nimport { getPartsByType, type Part, type ListPart } from '../../parts/parts';\nimport type {\n MetricsCompProps,\n MetricsItemCompProps,\n MetricsSectionComponent,\n SectionFixture,\n} from '../types';\nimport type { ParseContext, SectionDefinition } from '../section-definition';\nimport { DIAGNOSTIC_TYPES } from '../diagnosticTypes';\n\n/**\n * Metrics — a band of headline facts about one subject.\n *\n * Claims the orchestrator's `metrics` layout:\n *\n * <!-- section:metrics, semantic:metrics -->\n * ## Sleep product price ranges and SKUs on this page\n * - **Single-dose liquid price:** 3.9\n * - **Melatonin liquids/gummies price range:** 9.8–15.96\n *\n * ## Why this is not `KpiSectionDefinition`\n *\n * That definition parses a near-identical shape but gates on\n * `html_comment[section^=\"kpi\"]`, and no prompt emits `section:kpi` — the word\n * appears nowhere in the orchestrator prompt and was never once emitted across\n * 220 pages of captured production output. It stays because two clients still\n * register it, but nothing reaches it. Until this definition existed a real\n * `section:metrics` block was claimed by `FeatureSection9PlusDefinition` and\n * rendered as feature cards with icons, prices as card descriptions.\n *\n * ## The value/label inversion\n *\n * This is the one behavioural difference from `KpiSectionDefinition`, and the\n * reason re-pointing that definition at the `metrics` marker would not have\n * been enough. `prompt/base/section:metrics` mandates bolding the **label**:\n *\n * - **<Label>:** <value>\n *\n * while `parseKpiItem` reads the first bold run as the *title* — which every\n * renderer shows as the large numeral. Under that contract a real page renders\n * \"Single-dose liquid price:\" at display size and \"3.9\" as the caption. So here\n * the bold run is the **label** (`description`) and the text after it is the\n * **value** (`title`).\n *\n * The colon is accepted on either side of the bold: the section prompt's\n * template puts it inside (`**Label:**`), the older KPI fixtures put it outside\n * (`**48.8%**:`).\n */\nexport class MetricsSectionDefinition\n implements SectionDefinition<MetricsSectionComponent>\n{\n sectionType = 'metrics' as const;\n\n patterns = [\n 'html_comment[section^=\"metrics\"] > h2 > list{item[1-]:icon? > t+}',\n 'html_comment[section^=\"metrics\"] > h2 > (icon? > t)+',\n ];\n\n defaults: MetricsCompProps = {\n title: 'Key metrics',\n items: [{ title: '12', description: 'Brands carried' }],\n };\n\n fixtures: SectionFixture<MetricsCompProps>[] = [\n {\n markdown: `<!-- section:metrics, semantic:metrics -->\n## Sleep product price ranges and SKUs on this page\n- **Single-dose liquid price:** 3.9\n- **Example SKUs shown:** 8`,\n expected: {\n title: 'Sleep product price ranges and SKUs on this page',\n items: [\n { title: '3.9', description: 'Single-dose liquid price' },\n { title: '8', description: 'Example SKUs shown' },\n ],\n },\n },\n ];\n\n parse(parts: Part[], context?: ParseContext): MetricsCompProps | null {\n const title = headingText(parts, 2);\n const items: MetricsItemCompProps[] = [];\n let dropped = 0;\n\n const collect = (markdown: string) => {\n const parsed = parseMetricItem(markdown);\n if (parsed) {\n items.push(parsed);\n } else if (markdown.trim()) {\n dropped++;\n }\n };\n\n // The shape the section prompt emits: a heading followed by one bullet list.\n for (const list of getPartsByType<ListPart>(parts, 'list')) {\n for (const item of (list.meta?.items ?? []) as Part[]) {\n const itemParts = (item.meta?.parts ?? []) as Part[];\n collect(\n itemParts\n .filter((p) => p.type !== 'icon')\n .map((p) => (p.meta?.markdown as string) || p.content)\n .filter(Boolean)\n .join(' '),\n );\n }\n }\n\n // Fallback: the same facts emitted as loose lines rather than a list.\n if (items.length === 0) {\n for (const part of parts) {\n if (part.type !== 'text' && part.type !== 'richText') {\n continue;\n }\n const markdown = (part.meta?.markdown as string) || part.content || '';\n for (const line of markdown.split('\\n')) {\n collect(line);\n }\n }\n }\n\n if (dropped > 0) {\n context?.reportDiagnostic?.(\n DIAGNOSTIC_TYPES.ITEMS_DROPPED,\n `metrics: ${dropped} item(s) dropped (no bold label, or no value after it)`,\n );\n }\n\n // Nothing usable — reject the match so the block falls through rather than\n // rendering an empty band.\n return items.length > 0 ? { title, items } : null;\n }\n}\n\n/**\n * `**Label:** value` → `{ title: value, description: label }`.\n *\n * Null when there is no bold run, or nothing after it. A metric with no value\n * is malformed rather than merely sparse — the band exists to show a number,\n * and deriving one from the label is exactly what the section prompt forbids —\n * so it is dropped and counted rather than rendered blank.\n */\nfunction parseMetricItem(markdown: string): MetricsItemCompProps | null {\n const trimmed = markdown.trim();\n const boldMatch = trimmed.match(/\\*\\*(.+?)\\*\\*/);\n if (!boldMatch) {\n return null;\n }\n\n const label = boldMatch[1].trim().replace(/:$/, '').trim();\n const value = trimmed\n .slice(trimmed.indexOf(boldMatch[0]) + boldMatch[0].length)\n .replace(/^[:\\s]+/, '')\n .trim();\n\n return value && label ? { title: value, description: label } : null;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAQA,IAAAE,gBAAA,GAAAF,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,wBAAwB,CAErC;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,uBACgB,SAAS;IAAA,IAAAD,gBAAA,CAAAC,OAAA,oBAEZ,CACT,mEAAmE,EACnE,sDAAsD,CACvD;IAAA,IAAAD,gBAAA,CAAAC,OAAA,oBAE4B;MAC3BC,KAAK,EAAE,aAAa;MACpBC,KAAK,EAAE,CAAC;QAAED,KAAK,EAAE,IAAI;QAAEE,WAAW,EAAE;MAAiB,CAAC;IACxD,CAAC;IAAA,IAAAJ,gBAAA,CAAAC,OAAA,oBAE8C,CAC7C;MACEI,QAAQ,EAAE;AAChB;AACA;AACA,4BAA4B;MACtBC,QAAQ,EAAE;QACRJ,KAAK,EAAE,kDAAkD;QACzDC,KAAK,EAAE,CACL;UAAED,KAAK,EAAE,KAAK;UAAEE,WAAW,EAAE;QAA2B,CAAC,EACzD;UAAEF,KAAK,EAAE,GAAG;UAAEE,WAAW,EAAE;QAAqB,CAAC;MAErD;IACF,CAAC,CACF;EAAA;EAEDG,KAAKA,CAACC,KAAa,EAAEC,OAAsB,EAA2B;IACpE,MAAMP,KAAK,GAAG,IAAAQ,uBAAW,EAACF,KAAK,EAAE,CAAC,CAAC;IACnC,M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,KAAK,IAAIF,KAAK,GAAG;IAAE1C,KAAK,EAAE4C,KAAK;IAAE1C,WAAW,EAAEwC;EAAM,CAAC,GAAG,IAAI;AACrE","ignoreList":[]}
|
|
@@ -12,6 +12,8 @@ var _HeroEntitySectionDefinition = require("./HeroEntitySectionDefinition");
|
|
|
12
12
|
exports.HeroEntitySectionDefinition = _HeroEntitySectionDefinition.HeroEntitySectionDefinition;
|
|
13
13
|
var _KpiSectionDefinition = require("./KpiSectionDefinition");
|
|
14
14
|
exports.KpiSectionDefinition = _KpiSectionDefinition.KpiSectionDefinition;
|
|
15
|
+
var _MetricsSectionDefinition = require("./MetricsSectionDefinition");
|
|
16
|
+
exports.MetricsSectionDefinition = _MetricsSectionDefinition.MetricsSectionDefinition;
|
|
15
17
|
var _FeatureCardsSectionDefinition = require("./FeatureCardsSectionDefinition");
|
|
16
18
|
exports.FeatureCardsSectionDefinition = _FeatureCardsSectionDefinition.FeatureCardsSectionDefinition;
|
|
17
19
|
var _EntitySectionDefinition = require("./EntitySectionDefinition");
|
|
@@ -45,7 +47,7 @@ var _registry = require("../../registry");
|
|
|
45
47
|
* Registration order determines evaluation priority — first match wins.
|
|
46
48
|
*/
|
|
47
49
|
function createSdkRegistry() {
|
|
48
|
-
return new _registry.ComponentRegistry(null).register(new _SkipNodesSectionDefinition.SkipNodesSectionDefinition()).register(new _SearchSectionDefinition.SearchSectionDefinition()).register(new _KpiSectionDefinition.KpiSectionDefinition()).register(new _NextStepsSectionDefinition.NextStepsSectionDefinition())
|
|
50
|
+
return new _registry.ComponentRegistry(null).register(new _SkipNodesSectionDefinition.SkipNodesSectionDefinition()).register(new _SearchSectionDefinition.SearchSectionDefinition()).register(new _KpiSectionDefinition.KpiSectionDefinition()).register(new _MetricsSectionDefinition.MetricsSectionDefinition()).register(new _NextStepsSectionDefinition.NextStepsSectionDefinition())
|
|
49
51
|
// Collection entities are claimed by their own definition first — it is a
|
|
50
52
|
// strictly narrower match than EntitySectionDefinition, which would
|
|
51
53
|
// otherwise swallow collection, product and article blocks alike.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_ComparisonSectionDefinition","require","exports","ComparisonSectionDefinition","_TextBlockSectionDefinition","TextBlockSectionDefinition","_HeroSectionDefinition","HeroSectionDefinition","_HeroEntitySectionDefinition","HeroEntitySectionDefinition","_KpiSectionDefinition","KpiSectionDefinition","_FeatureCardsSectionDefinition","FeatureCardsSectionDefinition","_EntitySectionDefinition","EntitySectionDefinition","_EntityCollectionSectionDefinition","EntityCollectionSectionDefinition","_CtaBannerSectionDefinition","CtaBannerSectionDefinition","_CalloutSectionDefinition","CalloutSectionDefinition","_NextStepsSectionDefinition","NextStepsSectionDefinition","_FeatureSection9PlusDefinition","FeatureSection9PlusDefinition","_listItemsSectionDefinition","ListItemsSectionDefinition","_SkipNodesSectionDefinition","SkipNodesSectionDefinition","_HtmlCommentSectionDefinition","HtmlCommentSectionDefinition","_SearchSectionDefinition","SearchSectionDefinition","_ErrorSectionDefinition","ErrorSectionDefinition","_FallbackSectionDefinition","FallbackSectionDefinition","_registry","createSdkRegistry","ComponentRegistry","register"],"sources":["../../../../src/component/componentDefinitions/index.ts"],"sourcesContent":["export type { SectionDefinition } from '../section-definition';\nexport { ComparisonSectionDefinition } from './ComparisonSectionDefinition';\nexport { TextBlockSectionDefinition } from './TextBlockSectionDefinition';\nexport { HeroSectionDefinition } from './HeroSectionDefinition';\nexport { HeroEntitySectionDefinition } from './HeroEntitySectionDefinition';\nexport { KpiSectionDefinition } from './KpiSectionDefinition';\nexport { FeatureCardsSectionDefinition } from './FeatureCardsSectionDefinition';\nexport { EntitySectionDefinition } from './EntitySectionDefinition';\nexport { EntityCollectionSectionDefinition } from './EntityCollectionSectionDefinition';\nexport { CtaBannerSectionDefinition } from './CtaBannerSectionDefinition';\nexport { CalloutSectionDefinition } from './CalloutSectionDefinition';\nexport { NextStepsSectionDefinition } from './NextStepsSectionDefinition';\nexport { FeatureSection9PlusDefinition } from './FeatureSection9PlusDefinition';\nexport { ListItemsSectionDefinition } from './listItemsSectionDefinition';\nexport { SkipNodesSectionDefinition } from './SkipNodesSectionDefinition';\nexport { HtmlCommentSectionDefinition } from './HtmlCommentSectionDefinition';\nexport { SearchSectionDefinition } from './SearchSectionDefinition';\nexport { ErrorSectionDefinition } from './ErrorSectionDefinition';\nexport { FallbackSectionDefinition } from './FallbackSectionDefinition';\n\nimport { ComponentRegistry } from '../../registry';\nimport { SkipNodesSectionDefinition } from './SkipNodesSectionDefinition';\nimport { SearchSectionDefinition } from './SearchSectionDefinition';\nimport { KpiSectionDefinition } from './KpiSectionDefinition';\nimport { NextStepsSectionDefinition } from './NextStepsSectionDefinition';\nimport { EntitySectionDefinition } from './EntitySectionDefinition';\nimport { EntityCollectionSectionDefinition } from './EntityCollectionSectionDefinition';\nimport { HeroEntitySectionDefinition } from './HeroEntitySectionDefinition';\nimport { HeroSectionDefinition } from './HeroSectionDefinition';\nimport { FeatureCardsSectionDefinition } from './FeatureCardsSectionDefinition';\nimport { FeatureSection9PlusDefinition } from './FeatureSection9PlusDefinition';\nimport { ListItemsSectionDefinition } from './listItemsSectionDefinition';\nimport { ComparisonSectionDefinition } from './ComparisonSectionDefinition';\nimport { HtmlCommentSectionDefinition } from './HtmlCommentSectionDefinition';\nimport { CtaBannerSectionDefinition } from './CtaBannerSectionDefinition';\nimport { CalloutSectionDefinition } from './CalloutSectionDefinition';\nimport { FallbackSectionDefinition } from './FallbackSectionDefinition';\nimport { ErrorSectionDefinition } from './ErrorSectionDefinition';\nimport { TextBlockSectionDefinition } from './TextBlockSectionDefinition';\n\n/**\n * Creates an SDK registry with all section definitions registered in the\n * same priority order as the app registry (createAppRegistry.ts).\n * Registration order determines evaluation priority — first match wins.\n */\nexport function createSdkRegistry(): ComponentRegistry<null> {\n return (\n new ComponentRegistry<null>(null)\n .register(new SkipNodesSectionDefinition())\n .register(new SearchSectionDefinition())\n .register(new KpiSectionDefinition())\n .register(new NextStepsSectionDefinition())\n // Collection entities are claimed by their own definition first — it is a\n // strictly narrower match than EntitySectionDefinition, which would\n // otherwise swallow collection, product and article blocks alike.\n .register(new EntityCollectionSectionDefinition())\n .register(new EntitySectionDefinition())\n .register(new HeroEntitySectionDefinition())\n .register(new HeroSectionDefinition())\n .register(new FeatureCardsSectionDefinition())\n .register(new ListItemsSectionDefinition())\n .register(new FeatureSection9PlusDefinition())\n .register(new ComparisonSectionDefinition())\n // Callout sits above HtmlComment: a callout block opens with its own\n // `<!-- section:callout -->` descriptor, and HtmlComment's bare\n // `html_comment` pattern would match that comment alone. A pattern may\n // match a PREFIX of a block, so HtmlComment would claim the descriptor\n // and strand the prose below it in the fallback, unstyled.\n .register(new CalloutSectionDefinition())\n .register(new HtmlCommentSectionDefinition())\n .register(new CtaBannerSectionDefinition())\n // textBlock comes after every definition whose block opens `h2 > t`\n // (entity, listItems, featureCards, ctaBanner, comparison, …). Its\n // `h2 > t+` also matches a bare `h2 > t`, and a pattern matches a PREFIX\n // of the block — registered above those it would claim the heading +\n // intro copy and strand the list / links / table that follow in a\n // separate section. It stops before a trailing callout, which Callout\n // (registered above) then claims on the parser's next iteration.\n .register(new TextBlockSectionDefinition())\n .register(new FallbackSectionDefinition())\n .register(new ErrorSectionDefinition())\n );\n}\n"],"mappings":";;;;AACA,IAAAA,4BAAA,GAAAC,OAAA;AAA4EC,OAAA,CAAAC,2BAAA,GAAAH,4BAAA,CAAAG,2BAAA;AAC5E,IAAAC,2BAAA,GAAAH,OAAA;AAA0EC,OAAA,CAAAG,0BAAA,GAAAD,2BAAA,CAAAC,0BAAA;AAC1E,IAAAC,sBAAA,GAAAL,OAAA;AAAgEC,OAAA,CAAAK,qBAAA,GAAAD,sBAAA,CAAAC,qBAAA;AAChE,IAAAC,4BAAA,GAAAP,OAAA;AAA4EC,OAAA,CAAAO,2BAAA,GAAAD,4BAAA,CAAAC,2BAAA;AAC5E,IAAAC,qBAAA,GAAAT,OAAA;AAA8DC,OAAA,CAAAS,oBAAA,GAAAD,qBAAA,CAAAC,oBAAA;AAC9D,IAAAC,
|
|
1
|
+
{"version":3,"names":["_ComparisonSectionDefinition","require","exports","ComparisonSectionDefinition","_TextBlockSectionDefinition","TextBlockSectionDefinition","_HeroSectionDefinition","HeroSectionDefinition","_HeroEntitySectionDefinition","HeroEntitySectionDefinition","_KpiSectionDefinition","KpiSectionDefinition","_MetricsSectionDefinition","MetricsSectionDefinition","_FeatureCardsSectionDefinition","FeatureCardsSectionDefinition","_EntitySectionDefinition","EntitySectionDefinition","_EntityCollectionSectionDefinition","EntityCollectionSectionDefinition","_CtaBannerSectionDefinition","CtaBannerSectionDefinition","_CalloutSectionDefinition","CalloutSectionDefinition","_NextStepsSectionDefinition","NextStepsSectionDefinition","_FeatureSection9PlusDefinition","FeatureSection9PlusDefinition","_listItemsSectionDefinition","ListItemsSectionDefinition","_SkipNodesSectionDefinition","SkipNodesSectionDefinition","_HtmlCommentSectionDefinition","HtmlCommentSectionDefinition","_SearchSectionDefinition","SearchSectionDefinition","_ErrorSectionDefinition","ErrorSectionDefinition","_FallbackSectionDefinition","FallbackSectionDefinition","_registry","createSdkRegistry","ComponentRegistry","register"],"sources":["../../../../src/component/componentDefinitions/index.ts"],"sourcesContent":["export type { SectionDefinition } from '../section-definition';\nexport { ComparisonSectionDefinition } from './ComparisonSectionDefinition';\nexport { TextBlockSectionDefinition } from './TextBlockSectionDefinition';\nexport { HeroSectionDefinition } from './HeroSectionDefinition';\nexport { HeroEntitySectionDefinition } from './HeroEntitySectionDefinition';\nexport { KpiSectionDefinition } from './KpiSectionDefinition';\nexport { MetricsSectionDefinition } from './MetricsSectionDefinition';\nexport { FeatureCardsSectionDefinition } from './FeatureCardsSectionDefinition';\nexport { EntitySectionDefinition } from './EntitySectionDefinition';\nexport { EntityCollectionSectionDefinition } from './EntityCollectionSectionDefinition';\nexport { CtaBannerSectionDefinition } from './CtaBannerSectionDefinition';\nexport { CalloutSectionDefinition } from './CalloutSectionDefinition';\nexport { NextStepsSectionDefinition } from './NextStepsSectionDefinition';\nexport { FeatureSection9PlusDefinition } from './FeatureSection9PlusDefinition';\nexport { ListItemsSectionDefinition } from './listItemsSectionDefinition';\nexport { SkipNodesSectionDefinition } from './SkipNodesSectionDefinition';\nexport { HtmlCommentSectionDefinition } from './HtmlCommentSectionDefinition';\nexport { SearchSectionDefinition } from './SearchSectionDefinition';\nexport { ErrorSectionDefinition } from './ErrorSectionDefinition';\nexport { FallbackSectionDefinition } from './FallbackSectionDefinition';\n\nimport { ComponentRegistry } from '../../registry';\nimport { SkipNodesSectionDefinition } from './SkipNodesSectionDefinition';\nimport { SearchSectionDefinition } from './SearchSectionDefinition';\nimport { KpiSectionDefinition } from './KpiSectionDefinition';\nimport { MetricsSectionDefinition } from './MetricsSectionDefinition';\nimport { NextStepsSectionDefinition } from './NextStepsSectionDefinition';\nimport { EntitySectionDefinition } from './EntitySectionDefinition';\nimport { EntityCollectionSectionDefinition } from './EntityCollectionSectionDefinition';\nimport { HeroEntitySectionDefinition } from './HeroEntitySectionDefinition';\nimport { HeroSectionDefinition } from './HeroSectionDefinition';\nimport { FeatureCardsSectionDefinition } from './FeatureCardsSectionDefinition';\nimport { FeatureSection9PlusDefinition } from './FeatureSection9PlusDefinition';\nimport { ListItemsSectionDefinition } from './listItemsSectionDefinition';\nimport { ComparisonSectionDefinition } from './ComparisonSectionDefinition';\nimport { HtmlCommentSectionDefinition } from './HtmlCommentSectionDefinition';\nimport { CtaBannerSectionDefinition } from './CtaBannerSectionDefinition';\nimport { CalloutSectionDefinition } from './CalloutSectionDefinition';\nimport { FallbackSectionDefinition } from './FallbackSectionDefinition';\nimport { ErrorSectionDefinition } from './ErrorSectionDefinition';\nimport { TextBlockSectionDefinition } from './TextBlockSectionDefinition';\n\n/**\n * Creates an SDK registry with all section definitions registered in the\n * same priority order as the app registry (createAppRegistry.ts).\n * Registration order determines evaluation priority — first match wins.\n */\nexport function createSdkRegistry(): ComponentRegistry<null> {\n return (\n new ComponentRegistry<null>(null)\n .register(new SkipNodesSectionDefinition())\n .register(new SearchSectionDefinition())\n .register(new KpiSectionDefinition())\n .register(new MetricsSectionDefinition())\n .register(new NextStepsSectionDefinition())\n // Collection entities are claimed by their own definition first — it is a\n // strictly narrower match than EntitySectionDefinition, which would\n // otherwise swallow collection, product and article blocks alike.\n .register(new EntityCollectionSectionDefinition())\n .register(new EntitySectionDefinition())\n .register(new HeroEntitySectionDefinition())\n .register(new HeroSectionDefinition())\n .register(new FeatureCardsSectionDefinition())\n .register(new ListItemsSectionDefinition())\n .register(new FeatureSection9PlusDefinition())\n .register(new ComparisonSectionDefinition())\n // Callout sits above HtmlComment: a callout block opens with its own\n // `<!-- section:callout -->` descriptor, and HtmlComment's bare\n // `html_comment` pattern would match that comment alone. A pattern may\n // match a PREFIX of a block, so HtmlComment would claim the descriptor\n // and strand the prose below it in the fallback, unstyled.\n .register(new CalloutSectionDefinition())\n .register(new HtmlCommentSectionDefinition())\n .register(new CtaBannerSectionDefinition())\n // textBlock comes after every definition whose block opens `h2 > t`\n // (entity, listItems, featureCards, ctaBanner, comparison, …). Its\n // `h2 > t+` also matches a bare `h2 > t`, and a pattern matches a PREFIX\n // of the block — registered above those it would claim the heading +\n // intro copy and strand the list / links / table that follow in a\n // separate section. It stops before a trailing callout, which Callout\n // (registered above) then claims on the parser's next iteration.\n .register(new TextBlockSectionDefinition())\n .register(new FallbackSectionDefinition())\n .register(new ErrorSectionDefinition())\n );\n}\n"],"mappings":";;;;AACA,IAAAA,4BAAA,GAAAC,OAAA;AAA4EC,OAAA,CAAAC,2BAAA,GAAAH,4BAAA,CAAAG,2BAAA;AAC5E,IAAAC,2BAAA,GAAAH,OAAA;AAA0EC,OAAA,CAAAG,0BAAA,GAAAD,2BAAA,CAAAC,0BAAA;AAC1E,IAAAC,sBAAA,GAAAL,OAAA;AAAgEC,OAAA,CAAAK,qBAAA,GAAAD,sBAAA,CAAAC,qBAAA;AAChE,IAAAC,4BAAA,GAAAP,OAAA;AAA4EC,OAAA,CAAAO,2BAAA,G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C5CU,QAAQ,CAAC,IAAItB,sDAA0B,CAAC,CAAC;EAC1C;EACA;EACA;EACA;EACA;EACA;EACA;EAAA,CACCsB,QAAQ,CAAC,IAAItC,sDAA0B,CAAC,CAAC,CAAC,CAC1CsC,QAAQ,CAAC,IAAIJ,oDAAyB,CAAC,CAAC,CAAC,CACzCI,QAAQ,CAAC,IAAIN,8CAAsB,CAAC,CAAC,CAAC;AAE7C","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/component/types.ts"],"sourcesContent":["import type { FC } from 'react';\nimport type { Callout } from '../types/callout';\n\n/** Props extracted from markdown (base layer). */\nexport interface BaseCompProps {}\nexport interface SlotCompProps extends BaseCompProps {\n callout?: Callout;\n}\n\nexport interface SectionCompProps extends BaseCompProps {\n callout?: Callout;\n}\n\n/** Section props with a slot. TSlot enforces which slot component this section accepts. */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface SectionCompPropsWithSlot<TSlot extends FC<any> = FC<any>>\n extends SectionCompProps {\n slot?: TSlot;\n}\n\n// ----------------------\n// Base Components\n// ----------------------\n\nexport interface TextCompProps extends BaseCompProps {\n content: string;\n variant?: 'h1' | 'h2' | 'body' | 'caption';\n}\n\nexport interface ButtonCompProps extends BaseCompProps {\n label: string;\n variant?: 'primary' | 'secondary' | 'ghost';\n onClick?: string;\n}\n\nexport interface ImageCompProps extends BaseCompProps {\n src: string;\n alt: string;\n ratio?: '16:9' | '4:3' | '1:1' | '9:16' | '3:4';\n}\n\nexport interface BadgeCompProps extends BaseCompProps {\n label: string;\n color?: 'primary' | 'secondary' | 'success' | 'warning' | 'error';\n}\n\n// ----------------------\n// Hero Button (aligned to HeroSection1Button)\n// ----------------------\n\nexport interface HeroButton {\n id: string;\n text: string;\n variant?: 'primary' | 'secondary';\n onClick?: string;\n}\n\n// ----------------------\n// Slot Components\n// ----------------------\n\nexport interface KpiItemCompProps extends SlotCompProps {\n title: string;\n description: string;\n icon?: string;\n}\n\n/** Feature item — aligned to web50-server-ui Feature interface */\nexport interface FeatureItemCompProps extends SlotCompProps {\n title?: string;\n description?: string;\n icon?: string;\n}\n\n/** Feature card — aligned to web50-server-ui FeatureCard */\nexport interface FeatureCardCompProps extends SlotCompProps {\n title: string;\n description: string;\n imageUrl?: string;\n imageFromText?: boolean;\n linkText?: string;\n linkHref?: string;\n callout?: Callout;\n}\n\n/** Resolved entity data (populated at runtime via useResolveGenericEntityData) */\nexport interface EntityItemData {\n url: string;\n title: string;\n type: string;\n description?: string;\n excerpt?: string;\n imageUrl?: string;\n date?: string;\n publishDate?: string;\n author?: string;\n cmsItemId?: string;\n usage?: number;\n tags?: string[];\n /** Product vendor / brand name (e.g. \"HOKA\") */\n vendor?: string;\n /**\n * The `{ name, value }` pairs of the one variant a search matched, in the\n * store's own order. Present only when retrieval resolved the product down\n * to a single variant. The names are the store's own, so read this by\n * iterating it — never by looking a name up.\n */\n matchedOptions?: { name: string; value: string }[];\n /**\n * Id of the one variant a search matched — the same variant `imageUrl`,\n * `url` and `matchedOptions` describe. Bare store id, no `gid://` prefix.\n * A live enricher reads this to price that variant rather than the product.\n */\n variantId?: string;\n /** Whether the matched variant is in stock, as of the last live fetch */\n available?: boolean;\n /** Formatted lowest price across the product's variants (e.g. \"$107.95\") */\n priceMin?: string;\n /** Formatted highest price across the product's variants */\n priceMax?: string;\n /** Formatted price string (e.g. \"542.00 NIS\") */\n price?: string;\n /** Secondary product image URL — shown on hover */\n secondaryImageUrl?: string;\n /** Available sizes for the product */\n sizes?: string[];\n /** Original price before discount (formatted, e.g. \"494.00 NIS\") — shown with strikethrough */\n compareAtPrice?: string;\n /** Discount percentage (e.g. \"30% OFF\") */\n discountPercent?: string;\n /** Product variants with IDs and availability — used for add-to-cart and size display */\n variants?: {\n label: string;\n variantId: string;\n available: boolean;\n selectedOptions?: { name: string; value: string }[];\n price?: string;\n compareAtPrice?: string;\n }[];\n /** All product image URLs (not just featured + secondary) */\n allImages?: string[];\n /** Product option groups (e.g. Size, Color) with their available values */\n options?: { name: string; values: string[] }[];\n}\n\n/** Single entity item within an entity section */\nexport interface EntityItem {\n entityId: string;\n linkText?: string;\n entityType: string;\n entityUrl: string;\n description?: string;\n imageUrl?: string;\n /** Per-item callout from a blockquote inside the list item */\n callout?: Callout;\n /** Resolved at runtime via useResolveGenericEntityData hook; not produced by parse() */\n data?: EntityItemData;\n}\n\n// ---------------------------------------------------------------------------\n// Deprecated aliases — kept for seed-components compilation\n// ---------------------------------------------------------------------------\n/** @deprecated Use EntityItemData */\nexport type GenericEntityData = EntityItemData;\n/** @deprecated Use EntityItemData */\nexport type SolutionEntityData = EntityItemData;\n/** @deprecated Use EntityItemData */\nexport type BlogEntityData = EntityItemData;\n/** @deprecated Use EntityItem */\nexport type GenericEntityCompProps = EntityItem;\n\n/** Comparison row — aligned to web50-server-ui ComparisonRow */\nexport interface ComparisonRow {\n feature: string;\n iconHint?: string;\n values: (boolean | string)[];\n}\n\nexport interface ComparisonColumn {\n label: string;\n href?: string;\n entityId?: string;\n entityType?: string;\n}\n\n/** @deprecated Use Callout from types/callout instead */\nexport interface AiNarrativeCompProps extends SlotCompProps {\n content: string;\n}\n\n// ----------------------\n// Section Components\n// ----------------------\n\n/** Hero — aligned to HeroSection1Props */\nexport interface HeroCompProps extends SectionCompProps {\n headline: string;\n badge?: string | { text: string; showIndicator?: boolean };\n content?: string;\n buttons?: HeroButton[];\n image?: string;\n trailingList?: string;\n leadingQuote?: string;\n}\n\n/**\n * Entity hero — a hero section whose body carries one or more web5 entity\n * links (`web5://entity/...`). Shares the hero framing fields with\n * {@link HeroCompProps} but, instead of CTA buttons, surfaces the entities as\n * resolvable {@link EntityItem}s for rich rendering.\n */\nexport interface HeroEntityCompProps extends SectionCompProps {\n headline: string;\n badge?: string | { text: string; showIndicator?: boolean };\n content?: string;\n image?: string;\n leadingQuote?: string;\n items: EntityItem[];\n}\n\n/** KPI — aligned to KpiSectionProps */\nexport interface KpiCompProps\n extends SectionCompPropsWithSlot<KpiItemComponent> {\n title: string;\n items: KpiItemCompProps[];\n}\n\n/** Feature cards — aligned to FeatureCardsSectionProps */\nexport interface FeatureCardsCompProps extends SectionCompProps {\n cards: FeatureCardCompProps[];\n}\n\n/** Unified entity section — replaces EntityCompProps, SolutionEntityCompProps, BlogEntityCompProps */\nexport interface EntityCompProps extends SectionCompProps {\n title: string;\n description?: string;\n items: EntityItem[];\n}\n\n/** Comparison — aligned to ComparisonSection1Props */\nexport interface ComparisonCompProps extends SectionCompProps {\n title: string;\n description?: string;\n columnLabels: string[];\n columns?: ComparisonColumn[];\n rows: ComparisonRow[];\n featureColumnLabel?: string;\n ctaText?: string;\n ctaHref?: string;\n}\n\n/** General text — aligned to GeneralTextSectionProps (used by Fallback) */\nexport interface GeneralTextCompProps extends SectionCompProps {\n markdown: string;\n}\n\n/** Callout — aligned to CalloutSectionProps */\nexport interface CalloutCompProps extends SectionCompProps {\n callouts: Callout[];\n title?: string;\n relatedLinks?: { text: string; url: string }[];\n}\n\n/** Next steps — aligned to NextStepsSectionProps */\nexport interface NextStepsCompProps extends SectionCompProps {\n title: string;\n body?: string;\n /**\n * True when the chips are already rendered inline inside `body`. Renderers\n * must show `body` alone in that case — listing `steps` as well repeats every\n * chip. `steps` stays populated either way; it is the machine-readable chip\n * list (the scroll chips under the answer are built from it).\n */\n chipsInlineInBody?: boolean;\n backgroundImage?: string;\n steps: { content: string; iconHint?: string }[];\n}\n\n/** Feature section 9+ — aligned to FeatureSection9PlusProps */\nexport interface FeatureSection9PlusCompProps extends SectionCompProps {\n title: string;\n description?: string;\n features: { title?: string; description: string; iconHint?: string }[];\n}\n\n/** List items section — title + a list of feature items. */\nexport interface ListItemsSectionCompProps extends SectionCompProps {\n title: string;\n features: { title?: string; description: string }[];\n}\n\nexport type ListItemsSectionComponent = FC<ListItemsSectionCompProps>;\n\n/** Error — aligned to ErrorSection */\nexport interface ErrorCompProps extends SectionCompProps {\n type: import('../errors/conversationErrorTypes').ConversationErrorType;\n}\n\n/** Skip/HTML/Search — null-component parsers */\nexport interface NullCompProps extends SectionCompProps {}\n\n/** @deprecated Use EntityCompProps */\nexport type SolutionEntityCompProps = EntityCompProps;\n/** @deprecated Use EntityCompProps */\nexport type BlogEntityCompProps = EntityCompProps;\n\n/** CTA Banner — dark purple gradient card with headline, description, and pill link buttons */\nexport interface CtaBannerCompProps extends SectionCompProps {\n headline: string;\n description?: string;\n links: { text: string; href: string }[];\n /** Contextual background image — resolved from allowed keywords during parse() */\n imageUrl?: string;\n imageFromText?: boolean;\n}\n\nexport type CtaBannerSectionComponent = FC<CtaBannerCompProps>;\n\n/** Text block — heading + body with an optional pullquote callout on the side */\nexport interface TextBlockCompProps extends SectionCompProps {\n title: string;\n description: string;\n}\n\n/** Personalized narrative — standalone section with no parse() definition */\nexport interface PersonalizedNarrativeCompProps extends SectionCompProps {\n title: string;\n content?: string;\n}\n\n// --------------------------------\n// Types of component - all components\n// --------------------------------\n\nexport type Component = BaseComponent | SlotComponent | SectionComponent;\n\nexport type BaseComponent = FC<BaseCompProps>;\nexport type SlotComponent = FC<SlotCompProps>;\nexport type SectionComponent = FC<SectionCompProps>;\n\n// Base Components\nexport type TextComponent = FC<TextCompProps>;\nexport type ButtonComponent = FC<ButtonCompProps>;\nexport type ImageComponent = FC<ImageCompProps>;\nexport type BadgeComponent = FC<BadgeCompProps>;\n\n// Slot Components\nexport type KpiItemComponent = FC<KpiItemCompProps>;\nexport type FeatureItemComponent = FC<FeatureItemCompProps>;\nexport type FeatureCardComponent = FC<FeatureCardCompProps>;\n/** @deprecated Use FC<EntityItem> */\nexport type GenericEntityComponent = FC<EntityItem>;\nexport type AiNarrativeComponent = FC<AiNarrativeCompProps>;\n\n// Section Components\nexport type ComparisonSectionComponent = FC<ComparisonCompProps>;\nexport type GeneralTextSectionComponent = FC<GeneralTextCompProps>;\nexport type TextBlockSectionComponent = FC<TextBlockCompProps>;\nexport type HeroSectionComponent = FC<HeroCompProps>;\nexport type HeroEntitySectionComponent = FC<HeroEntityCompProps>;\n\n// section components with slots\nexport type KpiSectionComponent = FC<KpiCompProps>;\nexport type FeatureCardsSectionComponent = FC<FeatureCardsCompProps>;\nexport type EntitySectionComponent = FC<EntityCompProps>;\n\n// New section component types for Phase 4\nexport type CalloutSectionComponent = FC<CalloutCompProps>;\nexport type NextStepsSectionComponent = FC<NextStepsCompProps>;\nexport type FeatureSection9PlusSectionComponent =\n FC<FeatureSection9PlusCompProps>;\nexport type NullSectionComponent = FC<NullCompProps>;\nexport type ErrorSectionComponent = FC<ErrorCompProps>;\nexport type SolutionEntitySectionComponent = FC<SolutionEntityCompProps>;\nexport type BlogEntitySectionComponent = FC<BlogEntityCompProps>;\nexport type PersonalizedNarrativeSectionComponent =\n FC<PersonalizedNarrativeCompProps>;\n\nexport type PropsOf<T> = T extends (props: infer P) => unknown ? P : never;\n\nexport interface SectionFixture<TProps> {\n markdown: string;\n expected: Partial<TProps>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/component/types.ts"],"sourcesContent":["import type { FC } from 'react';\nimport type { Callout } from '../types/callout';\n\n/** Props extracted from markdown (base layer). */\nexport interface BaseCompProps {}\nexport interface SlotCompProps extends BaseCompProps {\n callout?: Callout;\n}\n\nexport interface SectionCompProps extends BaseCompProps {\n callout?: Callout;\n}\n\n/** Section props with a slot. TSlot enforces which slot component this section accepts. */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface SectionCompPropsWithSlot<TSlot extends FC<any> = FC<any>>\n extends SectionCompProps {\n slot?: TSlot;\n}\n\n// ----------------------\n// Base Components\n// ----------------------\n\nexport interface TextCompProps extends BaseCompProps {\n content: string;\n variant?: 'h1' | 'h2' | 'body' | 'caption';\n}\n\nexport interface ButtonCompProps extends BaseCompProps {\n label: string;\n variant?: 'primary' | 'secondary' | 'ghost';\n onClick?: string;\n}\n\nexport interface ImageCompProps extends BaseCompProps {\n src: string;\n alt: string;\n ratio?: '16:9' | '4:3' | '1:1' | '9:16' | '3:4';\n}\n\nexport interface BadgeCompProps extends BaseCompProps {\n label: string;\n color?: 'primary' | 'secondary' | 'success' | 'warning' | 'error';\n}\n\n// ----------------------\n// Hero Button (aligned to HeroSection1Button)\n// ----------------------\n\nexport interface HeroButton {\n id: string;\n text: string;\n variant?: 'primary' | 'secondary';\n onClick?: string;\n}\n\n// ----------------------\n// Slot Components\n// ----------------------\n\nexport interface KpiItemCompProps extends SlotCompProps {\n title: string;\n description: string;\n icon?: string;\n}\n\n/** Feature item — aligned to web50-server-ui Feature interface */\nexport interface FeatureItemCompProps extends SlotCompProps {\n title?: string;\n description?: string;\n icon?: string;\n}\n\n/** Feature card — aligned to web50-server-ui FeatureCard */\nexport interface FeatureCardCompProps extends SlotCompProps {\n title: string;\n description: string;\n imageUrl?: string;\n imageFromText?: boolean;\n linkText?: string;\n linkHref?: string;\n callout?: Callout;\n}\n\n/** Resolved entity data (populated at runtime via useResolveGenericEntityData) */\nexport interface EntityItemData {\n url: string;\n title: string;\n type: string;\n description?: string;\n excerpt?: string;\n imageUrl?: string;\n date?: string;\n publishDate?: string;\n author?: string;\n cmsItemId?: string;\n usage?: number;\n tags?: string[];\n /** Product vendor / brand name (e.g. \"HOKA\") */\n vendor?: string;\n /**\n * The `{ name, value }` pairs of the one variant a search matched, in the\n * store's own order. Present only when retrieval resolved the product down\n * to a single variant. The names are the store's own, so read this by\n * iterating it — never by looking a name up.\n */\n matchedOptions?: { name: string; value: string }[];\n /**\n * Id of the one variant a search matched — the same variant `imageUrl`,\n * `url` and `matchedOptions` describe. Bare store id, no `gid://` prefix.\n * A live enricher reads this to price that variant rather than the product.\n */\n variantId?: string;\n /** Whether the matched variant is in stock, as of the last live fetch */\n available?: boolean;\n /** Formatted lowest price across the product's variants (e.g. \"$107.95\") */\n priceMin?: string;\n /** Formatted highest price across the product's variants */\n priceMax?: string;\n /** Formatted price string (e.g. \"542.00 NIS\") */\n price?: string;\n /** Secondary product image URL — shown on hover */\n secondaryImageUrl?: string;\n /** Available sizes for the product */\n sizes?: string[];\n /** Original price before discount (formatted, e.g. \"494.00 NIS\") — shown with strikethrough */\n compareAtPrice?: string;\n /** Discount percentage (e.g. \"30% OFF\") */\n discountPercent?: string;\n /** Product variants with IDs and availability — used for add-to-cart and size display */\n variants?: {\n label: string;\n variantId: string;\n available: boolean;\n selectedOptions?: { name: string; value: string }[];\n price?: string;\n compareAtPrice?: string;\n }[];\n /** All product image URLs (not just featured + secondary) */\n allImages?: string[];\n /** Product option groups (e.g. Size, Color) with their available values */\n options?: { name: string; values: string[] }[];\n}\n\n/** Single entity item within an entity section */\nexport interface EntityItem {\n entityId: string;\n linkText?: string;\n entityType: string;\n entityUrl: string;\n description?: string;\n imageUrl?: string;\n /** Per-item callout from a blockquote inside the list item */\n callout?: Callout;\n /** Resolved at runtime via useResolveGenericEntityData hook; not produced by parse() */\n data?: EntityItemData;\n}\n\n// ---------------------------------------------------------------------------\n// Deprecated aliases — kept for seed-components compilation\n// ---------------------------------------------------------------------------\n/** @deprecated Use EntityItemData */\nexport type GenericEntityData = EntityItemData;\n/** @deprecated Use EntityItemData */\nexport type SolutionEntityData = EntityItemData;\n/** @deprecated Use EntityItemData */\nexport type BlogEntityData = EntityItemData;\n/** @deprecated Use EntityItem */\nexport type GenericEntityCompProps = EntityItem;\n\n/** Comparison row — aligned to web50-server-ui ComparisonRow */\nexport interface ComparisonRow {\n feature: string;\n iconHint?: string;\n values: (boolean | string)[];\n}\n\nexport interface ComparisonColumn {\n label: string;\n href?: string;\n entityId?: string;\n entityType?: string;\n}\n\n/** @deprecated Use Callout from types/callout instead */\nexport interface AiNarrativeCompProps extends SlotCompProps {\n content: string;\n}\n\n// ----------------------\n// Section Components\n// ----------------------\n\n/** Hero — aligned to HeroSection1Props */\nexport interface HeroCompProps extends SectionCompProps {\n headline: string;\n badge?: string | { text: string; showIndicator?: boolean };\n content?: string;\n buttons?: HeroButton[];\n image?: string;\n trailingList?: string;\n leadingQuote?: string;\n}\n\n/**\n * Entity hero — a hero section whose body carries one or more web5 entity\n * links (`web5://entity/...`). Shares the hero framing fields with\n * {@link HeroCompProps} but, instead of CTA buttons, surfaces the entities as\n * resolvable {@link EntityItem}s for rich rendering.\n */\nexport interface HeroEntityCompProps extends SectionCompProps {\n headline: string;\n badge?: string | { text: string; showIndicator?: boolean };\n content?: string;\n image?: string;\n leadingQuote?: string;\n items: EntityItem[];\n}\n\n/** KPI — aligned to KpiSectionProps */\nexport interface KpiCompProps\n extends SectionCompPropsWithSlot<KpiItemComponent> {\n title: string;\n items: KpiItemCompProps[];\n}\n\n/**\n * Metrics — a band of headline facts about one subject.\n *\n * `title` is the VALUE (the large numeral) and `description` its LABEL. That\n * ordering is deliberate and is the inverse of how the markdown reads, which\n * bolds the label: see `MetricsSectionDefinition` for why.\n */\nexport interface MetricsItemCompProps extends SlotCompProps {\n title: string;\n description: string;\n icon?: string;\n}\n\n/** Metrics — aligned to MetricsSectionProps */\nexport interface MetricsCompProps\n extends SectionCompPropsWithSlot<MetricsItemComponent> {\n title: string;\n items: MetricsItemCompProps[];\n}\n\n/** Feature cards — aligned to FeatureCardsSectionProps */\nexport interface FeatureCardsCompProps extends SectionCompProps {\n cards: FeatureCardCompProps[];\n}\n\n/** Unified entity section — replaces EntityCompProps, SolutionEntityCompProps, BlogEntityCompProps */\nexport interface EntityCompProps extends SectionCompProps {\n title: string;\n description?: string;\n items: EntityItem[];\n}\n\n/** Comparison — aligned to ComparisonSection1Props */\nexport interface ComparisonCompProps extends SectionCompProps {\n title: string;\n description?: string;\n columnLabels: string[];\n columns?: ComparisonColumn[];\n rows: ComparisonRow[];\n featureColumnLabel?: string;\n ctaText?: string;\n ctaHref?: string;\n}\n\n/** General text — aligned to GeneralTextSectionProps (used by Fallback) */\nexport interface GeneralTextCompProps extends SectionCompProps {\n markdown: string;\n}\n\n/** Callout — aligned to CalloutSectionProps */\nexport interface CalloutCompProps extends SectionCompProps {\n callouts: Callout[];\n title?: string;\n relatedLinks?: { text: string; url: string }[];\n}\n\n/** Next steps — aligned to NextStepsSectionProps */\nexport interface NextStepsCompProps extends SectionCompProps {\n title: string;\n body?: string;\n /**\n * True when the chips are already rendered inline inside `body`. Renderers\n * must show `body` alone in that case — listing `steps` as well repeats every\n * chip. `steps` stays populated either way; it is the machine-readable chip\n * list (the scroll chips under the answer are built from it).\n */\n chipsInlineInBody?: boolean;\n backgroundImage?: string;\n steps: { content: string; iconHint?: string }[];\n}\n\n/** Feature section 9+ — aligned to FeatureSection9PlusProps */\nexport interface FeatureSection9PlusCompProps extends SectionCompProps {\n title: string;\n description?: string;\n features: { title?: string; description: string; iconHint?: string }[];\n}\n\n/** List items section — title + a list of feature items. */\nexport interface ListItemsSectionCompProps extends SectionCompProps {\n title: string;\n features: { title?: string; description: string }[];\n}\n\nexport type ListItemsSectionComponent = FC<ListItemsSectionCompProps>;\n\n/** Error — aligned to ErrorSection */\nexport interface ErrorCompProps extends SectionCompProps {\n type: import('../errors/conversationErrorTypes').ConversationErrorType;\n}\n\n/** Skip/HTML/Search — null-component parsers */\nexport interface NullCompProps extends SectionCompProps {}\n\n/** @deprecated Use EntityCompProps */\nexport type SolutionEntityCompProps = EntityCompProps;\n/** @deprecated Use EntityCompProps */\nexport type BlogEntityCompProps = EntityCompProps;\n\n/** CTA Banner — dark purple gradient card with headline, description, and pill link buttons */\nexport interface CtaBannerCompProps extends SectionCompProps {\n headline: string;\n description?: string;\n links: { text: string; href: string }[];\n /** Contextual background image — resolved from allowed keywords during parse() */\n imageUrl?: string;\n imageFromText?: boolean;\n}\n\nexport type CtaBannerSectionComponent = FC<CtaBannerCompProps>;\n\n/** Text block — heading + body with an optional pullquote callout on the side */\nexport interface TextBlockCompProps extends SectionCompProps {\n title: string;\n description: string;\n}\n\n/** Personalized narrative — standalone section with no parse() definition */\nexport interface PersonalizedNarrativeCompProps extends SectionCompProps {\n title: string;\n content?: string;\n}\n\n// --------------------------------\n// Types of component - all components\n// --------------------------------\n\nexport type Component = BaseComponent | SlotComponent | SectionComponent;\n\nexport type BaseComponent = FC<BaseCompProps>;\nexport type SlotComponent = FC<SlotCompProps>;\nexport type SectionComponent = FC<SectionCompProps>;\n\n// Base Components\nexport type TextComponent = FC<TextCompProps>;\nexport type ButtonComponent = FC<ButtonCompProps>;\nexport type ImageComponent = FC<ImageCompProps>;\nexport type BadgeComponent = FC<BadgeCompProps>;\n\n// Slot Components\nexport type KpiItemComponent = FC<KpiItemCompProps>;\nexport type MetricsItemComponent = FC<MetricsItemCompProps>;\nexport type FeatureItemComponent = FC<FeatureItemCompProps>;\nexport type FeatureCardComponent = FC<FeatureCardCompProps>;\n/** @deprecated Use FC<EntityItem> */\nexport type GenericEntityComponent = FC<EntityItem>;\nexport type AiNarrativeComponent = FC<AiNarrativeCompProps>;\n\n// Section Components\nexport type ComparisonSectionComponent = FC<ComparisonCompProps>;\nexport type GeneralTextSectionComponent = FC<GeneralTextCompProps>;\nexport type TextBlockSectionComponent = FC<TextBlockCompProps>;\nexport type HeroSectionComponent = FC<HeroCompProps>;\nexport type HeroEntitySectionComponent = FC<HeroEntityCompProps>;\n\n// section components with slots\nexport type KpiSectionComponent = FC<KpiCompProps>;\nexport type MetricsSectionComponent = FC<MetricsCompProps>;\nexport type FeatureCardsSectionComponent = FC<FeatureCardsCompProps>;\nexport type EntitySectionComponent = FC<EntityCompProps>;\n\n// New section component types for Phase 4\nexport type CalloutSectionComponent = FC<CalloutCompProps>;\nexport type NextStepsSectionComponent = FC<NextStepsCompProps>;\nexport type FeatureSection9PlusSectionComponent =\n FC<FeatureSection9PlusCompProps>;\nexport type NullSectionComponent = FC<NullCompProps>;\nexport type ErrorSectionComponent = FC<ErrorCompProps>;\nexport type SolutionEntitySectionComponent = FC<SolutionEntityCompProps>;\nexport type BlogEntitySectionComponent = FC<BlogEntityCompProps>;\nexport type PersonalizedNarrativeSectionComponent =\n FC<PersonalizedNarrativeCompProps>;\n\nexport type PropsOf<T> = T extends (props: infer P) => unknown ? P : never;\n\nexport interface SectionFixture<TProps> {\n markdown: string;\n expected: Partial<TProps>;\n}\n"],"mappings":"","ignoreList":[]}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
6
|
-
exports.writeProductBackHandoff = exports.validatePatternWithBlocks = exports.validatePatternSyntax = exports.validatePattern = exports.validateLinkUrl = exports.usesStagingBackend = exports.useWeb5Link = exports.useUserQuery = exports.useResolvedImageSources = exports.useResolveShopifyEntityData = exports.useResolveSearchSpringEntityData = exports.useResolveGenericEntityData = exports.usePlacementPayload = exports.useMarkdownUtils = exports.useFeatureToggles = exports.useFeatureToggle = exports.useEntityTransforms = exports.useDebugImageContext = exports.useConversation = exports.useComponentDependencies = exports.useChips = exports.unlockOnUserAction = exports.tryParseComponent = exports.trimTrailingWhitespace = exports.transmit = exports.transformToSolutionEntityData = exports.transformToGenericEntityData = exports.transformToBlogPostEntityData = exports.transformShopifyProduct = exports.transformShopifyEntityToItemData = exports.transformShopifyCollection = exports.transformShopifyArticle = exports.transformSSProductToEntityItemData = exports.toRgb = exports.toMatchedOptions = exports.toCatalogPath = exports.subscribeToConsent = exports.stripMarkdown = exports.startNewChatId = exports.shouldRefreshPrompts = exports.setMatchDebug = exports.setForwardStack = exports.setConsentOverride = exports.setConsentBufferLimit = exports.setChatId = exports.setBackendEnvironment = exports.rgbToHsl = exports.resolveShopifyEntity = exports.resolveShopifyConfig = exports.resolveErrorTemplate = exports.resolveClientBundleUrl = exports.resetMatchDebugCache = exports.resetConsentGateForTests = exports.resetChatIdForTests = exports.registerEntityExtractor = exports.readProductBackHandoff = exports.readCurrencyCode = exports.pushToForwardStack = exports.pushPromptSubmit = exports.pushLinkClick = exports.pushExit = exports.pushEvent = exports.pushError = exports.pushEntityFiltered = exports.publishHostConsent = exports.preprocessMarkdown = exports.popFromForwardStack = exports.parseWeb5Url = exports.parseMarkdownToComponents = exports.parseMarkdownToAst = exports.parseEntityLink = exports.parseAstToMarkdown = exports.normalizeImageUrl = exports.normalizeIconUrls = exports.normalizeEntityItem = exports.nodesToParts = exports.mergeSectionsWithStableReferences = exports.mergeEntityData = exports.mergeClientConfig = exports.mayTransmit = exports.mayPersistIdentity = exports.matchMarkdown = exports.matchAllSections = exports.logMatchDebug = exports.loadImagePixels = exports.loadClientBundle = exports.loadBackdropAnalysis = exports.listEntityItems = exports.isWeb5Url = exports.isWeb5SearchUrl = exports.isWeb5ImageUrl = exports.isWeb5IconUrl = exports.isWeb5EntityUrl = exports.isWeb5AskUrl = exports.isWeb5ActionUrl = exports.isValidWeb5Url = exports.isValidTemplateId = void 0;
|
|
4
|
+
exports.addToCart = exports.Web5UrlType = exports.WEB5_USER_QUERY_EVENT = exports.WEB5_SCOPES = exports.WEB5_SCOPE = exports.WEB5_ROOT_ID = exports.WEB5_ROOT_CLASS = exports.WEB5_REDIRECT_EVENT = exports.WEB5_GLOBAL_TOKENS = exports.WEB5_ANSWER_UPDATED_EVENT = exports.WEB5_ANSWER_SETTLED_EVENT = exports.UserQueryProvider = exports.UserQuery = exports.UnifiedMarkdownParser = exports.UnifiedLink = exports.UNKNOWN_CONSENT = exports.TextBlockSectionDefinition = exports.TableRow = exports.TableHeader = exports.TableHead = exports.TableFooter = exports.TableCell = exports.TableCaption = exports.TableBody = exports.Table = exports.TOKEN_NAME_PATTERN = exports.THEME_TOKEN_CONTRACT = exports.THEME_OVERRIDE_TOKENS = exports.THEME_DEBUG_QUERY_PARAM = exports.THEME_DEBUG_KEY = exports.TEMPLATES_MANIFEST_URL = exports.TEMPLATES_CDN_BASE = exports.SmartIcon = exports.SkipNodesSectionDefinition = exports.ShopifyStorefrontClient = exports.SectionSkeleton = exports.SearchSectionDefinition = exports.SearchSection = exports.STREAMING_TIMEOUT_MS = exports.REFRESH_PROMPTS_WINDOW_MS = exports.REFRESH_PROMPTS_UNTIL_KEY = exports.PromptEntryEmptyState = exports.PlacementSmoothHeight = exports.PlacementResponseRenderer = exports.PlacementPayloadProvider = exports.PlacementLoader = exports.PRODUCT_BY_HANDLE_QUERY = exports.PRODUCT_BACK_SESSION_KEY = exports.OptimizedImage = exports.NextStepsSectionDefinition = exports.MetricsSectionDefinition = exports.MarkdownText = exports.MATCH_DEBUG_QUERY_PARAM = exports.MATCH_DEBUG_KEY = exports.Loader = exports.ListItemsSectionDefinition = exports.LinkType = exports.LIST_ITEMS_ENDPOINT = exports.KpiSectionDefinition = exports.ImageSearchFilterToken = exports.HtmlCommentSectionDefinition = exports.HeroSectionDefinition = exports.HeroEntitySectionDefinition = exports.HOST_CONSENT_GLOBAL = exports.FeedbackBar = exports.FeatureToggleProvider = exports.FeatureSection9PlusDefinition = exports.FeatureCardsSectionDefinition = exports.FallbackSectionDefinition = exports.ErrorSectionDefinition = exports.EntitySectionDefinition = exports.EntityCollectionSectionDefinition = exports.EXPERIMENT_IDS = exports.ERROR_MARKDOWN = exports.EDITABLE_TOKENS = exports.Disclaimer = exports.DiagnosticsCollector = exports.DROP_SECTION = exports.DIAGNOSTIC_TYPES = exports.DEFAULT_ERROR_TEMPLATES = exports.DEFAULT_BACKEND_ENVIRONMENT = exports.CtaBannerSectionDefinition = exports.ComponentTracking = exports.ComponentRegistry = exports.ComponentDependenciesProvider = exports.ComparisonSectionDefinition = exports.ChipsProvider = exports.CalloutSectionDefinition = exports.CalloutBlock = exports.CONSENT_OVERRIDE_QUERY_PARAM = exports.CONSENT_OVERRIDE_KEY = exports.COLLECTION_BY_HANDLE_QUERY = exports.CLIENT_IDS = exports.CALLOUT_SEMANTICS = exports.CALLOUT_KINDS = exports.BottomContainer = exports.BRAND_TOKENS = exports.BACKEND_ENVIRONMENT_QUERY_PARAM = exports.BACKEND_ENVIRONMENT_KEY = exports.ARTICLE_BY_HANDLE_QUERY = void 0;
|
|
5
|
+
exports.isUserEngaged = exports.isTrustedBundleHost = exports.isThemeDebugEnabled = exports.isTemplatePickerRequested = exports.isSimulationTraffic = exports.isShopifyHost = exports.isProductFamilyEntityType = exports.isOneTrustHost = exports.isNavigableUrl = exports.isMatchDebugEnabled = exports.isLegacyUrl = exports.isHtmlComment = exports.isHslTriplet = exports.isEntityLink = exports.installConsentProvider = exports.initConsentGate = exports.hslTripletToHex = exports.hslToRgb = exports.hostAliasFor = exports.hexToHslTriplet = exports.hasImage = exports.hasHostSuppliedConsent = exports.hasAnalyticsConsent = exports.getTemplateOverride = exports.getSessionId = exports.getResizedImageUrl = exports.getRefreshPromptsExpiry = exports.getPartsByType = exports.getPartByRole = exports.getOrCreateSessionId = exports.getLinks = exports.getIntentFromMarkdown = exports.getInstalledProviderName = exports.getImages = exports.getHeading = exports.getGateView = exports.getForwardStack = exports.getErrorTypeFromStatus = exports.getEntityExtractor = exports.getContextualImageFilename = exports.getConsentSnapshot = exports.getConsentOverride = exports.getConsentGateStats = exports.getClientBundleOverride = exports.getChatId = exports.getBackendEnvironment = exports.getAllByRole = exports.generateSectionId = exports.generateId = exports.formatProductPriceLabel = exports.formatPriceField = exports.formatMoney = exports.fixMalformedLinks = exports.findKeywordsInContent = exports.findInvalidWeb5Links = exports.findImageInNode = exports.findImageInChildren = exports.fetchProductsByHandlesMap = exports.fetchProductsByHandles = exports.fetchEntityListData = exports.extractProtocol = exports.extractLinkMetadata = exports.extractIntentFromMarkdown = exports.extractContentMarkdown = exports.extractContent = exports.escapeWeb5Links = exports.entityPayloadFromItems = exports.entityHref = exports.ensureMinLightness = exports.enrichEntitiesFromPayload = exports.enableRefreshPrompts = exports.disableRefreshPrompts = exports.detectLinkType = exports.detectConsentProvider = exports.deriveRole = exports.deriveLightColor = exports.deriveDarkGradient = exports.deriveDarkColor = exports.defaultExtractor = exports.decodeLinkText = exports.createWixAuthFetch = exports.createShopifyConsentProvider = exports.createSdkRegistry = exports.createPageSection = exports.createOneTrustConsentProvider = exports.createHostSuppliedConsentProvider = exports.createFeatureToggleReader = exports.createErrorMarkdown = exports.convertToBlockElementsWithMapping = exports.convertToBlockElements = exports.computeContentBBox = exports.cn = exports.clearForwardStack = exports.buildProbeUrl = exports.buildPlacementDependencies = exports.buildImageSearchFilter = exports.bucketOf = exports.backgroundFilter = exports.applyThemeOverrides = exports.analyzeBackdrop = void 0;
|
|
6
|
+
exports.writeProductBackHandoff = exports.validatePatternWithBlocks = exports.validatePatternSyntax = exports.validatePattern = exports.validateLinkUrl = exports.usesStagingBackend = exports.useWeb5Link = exports.useUserQuery = exports.useResolvedImageSources = exports.useResolveShopifyEntityData = exports.useResolveSearchSpringEntityData = exports.useResolveGenericEntityData = exports.usePlacementPayload = exports.useMarkdownUtils = exports.useFeatureToggles = exports.useFeatureToggle = exports.useEntityTransforms = exports.useDebugImageContext = exports.useConversation = exports.useComponentDependencies = exports.useChips = exports.unlockOnUserAction = exports.tryParseComponent = exports.trimTrailingWhitespace = exports.transmit = exports.transformToSolutionEntityData = exports.transformToGenericEntityData = exports.transformToBlogPostEntityData = exports.transformShopifyProduct = exports.transformShopifyEntityToItemData = exports.transformShopifyCollection = exports.transformShopifyArticle = exports.transformSSProductToEntityItemData = exports.toRgb = exports.toMatchedOptions = exports.toCatalogPath = exports.subscribeToConsent = exports.stripMarkdown = exports.startNewChatId = exports.shouldRefreshPrompts = exports.setMatchDebug = exports.setForwardStack = exports.setConsentOverride = exports.setConsentBufferLimit = exports.setChatId = exports.setBackendEnvironment = exports.rgbToHsl = exports.resolveShopifyEntity = exports.resolveShopifyConfig = exports.resolveErrorTemplate = exports.resolveClientBundleUrl = exports.resetMatchDebugCache = exports.resetConsentGateForTests = exports.resetChatIdForTests = exports.registerEntityExtractor = exports.readProductBackHandoff = exports.readCurrencyCode = exports.pushToForwardStack = exports.pushPromptSubmit = exports.pushLinkClick = exports.pushExit = exports.pushEvent = exports.pushError = exports.pushEntityFiltered = exports.publishHostConsent = exports.preprocessMarkdown = exports.popFromForwardStack = exports.parseWeb5Url = exports.parseMarkdownToComponents = exports.parseMarkdownToAst = exports.parseEntityLink = exports.parseAstToMarkdown = exports.normalizeImageUrl = exports.normalizeIconUrls = exports.normalizeEntityItem = exports.nodesToParts = exports.mergeSectionsWithStableReferences = exports.mergeEntityData = exports.mergeClientConfig = exports.mayTransmit = exports.mayPersistIdentity = exports.matchMarkdown = exports.matchAllSections = exports.logMatchDebug = exports.loadImagePixels = exports.loadClientBundle = exports.loadBackdropAnalysis = exports.listEntityItems = exports.isWeb5Url = exports.isWeb5SearchUrl = exports.isWeb5ImageUrl = exports.isWeb5IconUrl = exports.isWeb5EntityUrl = exports.isWeb5AskUrl = exports.isWeb5ActionUrl = exports.isValidWeb5Url = exports.isValidTemplateId = exports.isValidLinkUrl = void 0;
|
|
7
7
|
var _clients = require("./clients");
|
|
8
8
|
exports.CLIENT_IDS = _clients.CLIENT_IDS;
|
|
9
9
|
exports.EXPERIMENT_IDS = _clients.EXPERIMENT_IDS;
|
|
@@ -35,6 +35,7 @@ var _componentDefinitions = require("./component/componentDefinitions");
|
|
|
35
35
|
exports.HeroSectionDefinition = _componentDefinitions.HeroSectionDefinition;
|
|
36
36
|
exports.HeroEntitySectionDefinition = _componentDefinitions.HeroEntitySectionDefinition;
|
|
37
37
|
exports.KpiSectionDefinition = _componentDefinitions.KpiSectionDefinition;
|
|
38
|
+
exports.MetricsSectionDefinition = _componentDefinitions.MetricsSectionDefinition;
|
|
38
39
|
exports.FeatureCardsSectionDefinition = _componentDefinitions.FeatureCardsSectionDefinition;
|
|
39
40
|
exports.EntitySectionDefinition = _componentDefinitions.EntitySectionDefinition;
|
|
40
41
|
exports.EntityCollectionSectionDefinition = _componentDefinitions.EntityCollectionSectionDefinition;
|