@rokt/dcui-orchestrator 1.2.1-rc.7 → 1.2.1-rc.8
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.
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CatalogSelectorsStackedModel, LayoutSchemaModel, WhenPredicate } from '@rokt/dcui-layout-schema';
|
|
3
3
|
export interface CatalogSelectorsStackedProps<Template extends LayoutSchemaModel> {
|
|
4
|
+
/**
|
|
5
|
+
* - `default`: the template rendered once per variant dimension. Each render
|
|
6
|
+
* resolves the dimension it is rendering, so one shared template can label
|
|
7
|
+
* itself:
|
|
8
|
+
* * `%^DATA.variantAttribute.attributeId^%`: the dimension id, e.g.
|
|
9
|
+
* `color`. It comes from the merchant's variant option key and is
|
|
10
|
+
* neither normalised nor guaranteed lowercase or single-word, so
|
|
11
|
+
* `shoe_size` reaches the shopper verbatim. Apply casing with the node's
|
|
12
|
+
* `text.textTransform` rather than transforming the value, so `When`
|
|
13
|
+
* comparisons stay stable.
|
|
14
|
+
* * `%^DATA.variantAttribute.hasMultipleOptions^%`: `"true"` or `"false"`.
|
|
15
|
+
* `CatalogDropdown` renders nothing for a single option, so a label
|
|
16
|
+
* would otherwise sit above no control. Gate the label on this.
|
|
17
|
+
* Tokens from the enclosing scope stay resolvable alongside these.
|
|
18
|
+
*
|
|
19
|
+
* Put a `When` on `hasMultipleOptions` around the label node **only**, and
|
|
20
|
+
* keep `CatalogDropdown` as its sibling:
|
|
21
|
+
*
|
|
22
|
+
* Column [ When(hasMultipleOptions is "true") [ BasicText ],
|
|
23
|
+
* CatalogDropdown ]
|
|
24
|
+
*
|
|
25
|
+
* A `When` that encloses the dropdown instead would stop it mounting, and
|
|
26
|
+
* a dropdown that never mounts never registers its validator field key —
|
|
27
|
+
* a trigger that then resolves zero keys fails closed, blocking the CTA
|
|
28
|
+
* with nothing on screen to explain it.
|
|
29
|
+
*
|
|
30
|
+
* Bind the label with `BasicText`. `RichText` sends the value through the
|
|
31
|
+
* HTML sanitiser, which throws on markup-shaped input; the node is then
|
|
32
|
+
* dropped by its error boundary.
|
|
33
|
+
* - `dropdown`: accepted by the layout schema, currently ignored — this
|
|
34
|
+
* component only ever renders `default`.
|
|
35
|
+
* - `styles`:
|
|
36
|
+
* * `elements`:
|
|
37
|
+
* - `own`
|
|
38
|
+
*/
|
|
4
39
|
schema: CatalogSelectorsStackedModel<Template, WhenPredicate>;
|
|
5
40
|
testId?: string;
|
|
6
41
|
}
|