@pagenflow/email 1.4.7 → 1.4.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.
- package/dist/components/Button.d.ts +3 -1
- package/dist/components/Column.d.ts +3 -1
- package/dist/components/Container.d.ts +4 -2
- package/dist/components/Divider.d.ts +3 -1
- package/dist/components/Heading.d.ts +6 -1
- package/dist/components/Icon.d.ts +4 -2
- package/dist/components/Image.d.ts +25 -2
- package/dist/components/Row.d.ts +20 -1
- package/dist/components/Section.d.ts +2 -0
- package/dist/components/Spacer.d.ts +6 -1
- package/dist/components/Text.d.ts +6 -1
- package/dist/components/utils/bindingAttribute.d.ts +38 -0
- package/dist/components/utils/linearizeStyle.d.ts +10 -0
- package/dist/index.cjs.js +302 -133
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +302 -133
- package/dist/index.esm.js.map +1 -1
- package/dist/types/DataBindings.d.ts +87 -0
- package/package.json +1 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data Binding logic for mapping properties to the Data Layer.
|
|
3
|
+
*/
|
|
4
|
+
export type DataBindings = {
|
|
5
|
+
/**
|
|
6
|
+
* If defined, this component becomes a repeater.
|
|
7
|
+
* Path to the array in the Data Layer (e.g., "job_listings" or "co.open_roles").
|
|
8
|
+
*/
|
|
9
|
+
dataList?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The alias used by children to reference current iteration data (e.g., "job").
|
|
12
|
+
*/
|
|
13
|
+
itemAlias?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Conditional rendering logic. String evaluated against the Data Layer.
|
|
16
|
+
* e.g., "role.type === 'Remote'"
|
|
17
|
+
*/
|
|
18
|
+
visible?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Map of config properties to Data Layer paths.
|
|
21
|
+
* Key: The property path in 'config' (e.g., "text" or "src").
|
|
22
|
+
* Value: The path in the Data Layer (e.g., "job.title").
|
|
23
|
+
*/
|
|
24
|
+
propertyMap?: Record<string, string | PropertyBinding>;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* A single property binding: a data path plus an ordered chain of filters.
|
|
28
|
+
*
|
|
29
|
+
* Replaces the previous `Record<string, string>` with a richer structure.
|
|
30
|
+
*
|
|
31
|
+
* The filter chain is applied left to right (like Liquid's pipe operator):
|
|
32
|
+
* value | filters[0] | filters[1] | ...
|
|
33
|
+
*/
|
|
34
|
+
export type PropertyBinding = {
|
|
35
|
+
/** Dot-notation path into the data layer, e.g. "product.price" */
|
|
36
|
+
path: string;
|
|
37
|
+
/** Ordered filter pipeline. Each filter receives the output of the previous one. */
|
|
38
|
+
filters?: PropertyFilter[];
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* A literal string value, e.g. "%Y-%m-%d" for date format.
|
|
42
|
+
*/
|
|
43
|
+
export type FilterParamString = {
|
|
44
|
+
type: "string";
|
|
45
|
+
value: string;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* A literal number value, e.g. 50 for truncate length.
|
|
49
|
+
*/
|
|
50
|
+
export type FilterParamNumber = {
|
|
51
|
+
type: "number";
|
|
52
|
+
value: number;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* A literal boolean value.
|
|
56
|
+
*/
|
|
57
|
+
export type FilterParamBoolean = {
|
|
58
|
+
type: "boolean";
|
|
59
|
+
value: boolean;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* A path into the data layer, resolved at runtime.
|
|
63
|
+
* e.g. "product.currency_code" — evaluated against the current data context.
|
|
64
|
+
*/
|
|
65
|
+
export type FilterParamPath = {
|
|
66
|
+
type: "path";
|
|
67
|
+
value: string;
|
|
68
|
+
};
|
|
69
|
+
export type FilterParam = FilterParamString | FilterParamNumber | FilterParamBoolean | FilterParamPath;
|
|
70
|
+
/**
|
|
71
|
+
* A single filter applied to a bound value.
|
|
72
|
+
*
|
|
73
|
+
* name: always lower_snake_case, e.g. "money", "truncate", "date", "upcase"
|
|
74
|
+
* params: ordered list of parameters. Order matters — matches the filter's signature.
|
|
75
|
+
*
|
|
76
|
+
* Examples:
|
|
77
|
+
* { name: "money" }
|
|
78
|
+
* { name: "truncate", params: [{ type: "number", value: 50 }, { type: "string", value: "…" }] }
|
|
79
|
+
* { name: "date", params: [{ type: "string", value: "%B %d, %Y" }] }
|
|
80
|
+
* { name: "prepend", params: [{ type: "path", value: "store.currency_symbol" }] }
|
|
81
|
+
*/
|
|
82
|
+
export type PropertyFilter = {
|
|
83
|
+
/** lower_snake_case filter name */
|
|
84
|
+
name: string;
|
|
85
|
+
/** Ordered parameters. Omit or leave empty for zero-param filters. */
|
|
86
|
+
params?: FilterParam[];
|
|
87
|
+
};
|