@webflow/designer-extension-typings 2.0.30 → 2.0.33
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/api.d.ts +25 -0
- package/components.d.ts +337 -0
- package/element-presets-generated.d.ts +2 -0
- package/element-settings-generated.d.ts +24 -2
- package/element-settings.d.ts +89 -1
- package/elements-generated.d.ts +357 -2
- package/elements.d.ts +5 -0
- package/instance-props.d.ts +192 -0
- package/package.json +1 -1
package/elements.d.ts
CHANGED
|
@@ -14,6 +14,11 @@ type FormState = 'normal' | 'success' | 'error';
|
|
|
14
14
|
|
|
15
15
|
type FormMethod = 'get' | 'post';
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Use `element.getSettings()` (returns `ElementSettingSummaries`) or
|
|
19
|
+
* `element.searchSettings()` (returns `Record<string, ElementSetting>`) instead.
|
|
20
|
+
* These generic APIs return the same form fields plus all other applicable settings.
|
|
21
|
+
*/
|
|
17
22
|
type FormSettings = {
|
|
18
23
|
state: FormState;
|
|
19
24
|
name: string;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
// Instance Props types
|
|
2
|
+
|
|
3
|
+
/** All public-facing link mode identifiers. */
|
|
4
|
+
type LinkMode =
|
|
5
|
+
| 'url'
|
|
6
|
+
| 'page'
|
|
7
|
+
| 'pageSection'
|
|
8
|
+
| 'email'
|
|
9
|
+
| 'phone'
|
|
10
|
+
| 'file'
|
|
11
|
+
| 'collectionPage';
|
|
12
|
+
|
|
13
|
+
interface LinkResolvedValueBase {
|
|
14
|
+
mode: LinkMode;
|
|
15
|
+
openInNewTab?: boolean;
|
|
16
|
+
rel?: 'none' | 'preload' | 'prefetch' | 'prerender';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface PageLinkResolvedValue extends LinkResolvedValueBase {
|
|
20
|
+
mode: 'page';
|
|
21
|
+
to?: {pageId: string};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface PageSectionLinkResolvedValue extends LinkResolvedValueBase {
|
|
25
|
+
mode: 'pageSection';
|
|
26
|
+
to?: {fullElementId: FullElementId};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface CollectionPageLinkResolvedValue extends LinkResolvedValueBase {
|
|
30
|
+
mode: 'collectionPage';
|
|
31
|
+
to?: {pageSlug: string};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface EmailLinkResolvedValue extends LinkResolvedValueBase {
|
|
35
|
+
mode: 'email';
|
|
36
|
+
to?: string;
|
|
37
|
+
emailSubject?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
interface FileLinkResolvedValue extends LinkResolvedValueBase {
|
|
41
|
+
mode: 'file';
|
|
42
|
+
to?: {assetId: string};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface GenericLinkResolvedValue extends LinkResolvedValueBase {
|
|
46
|
+
mode: 'url' | 'phone';
|
|
47
|
+
to?: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
type LinkResolvedValue =
|
|
51
|
+
| PageLinkResolvedValue
|
|
52
|
+
| PageSectionLinkResolvedValue
|
|
53
|
+
| CollectionPageLinkResolvedValue
|
|
54
|
+
| EmailLinkResolvedValue
|
|
55
|
+
| FileLinkResolvedValue
|
|
56
|
+
| GenericLinkResolvedValue;
|
|
57
|
+
|
|
58
|
+
interface VideoResolvedValue {
|
|
59
|
+
src?: string;
|
|
60
|
+
title?: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
interface RichTextResolvedValue {
|
|
64
|
+
innerText: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
type ResolvedValue =
|
|
68
|
+
| string
|
|
69
|
+
| number
|
|
70
|
+
| boolean
|
|
71
|
+
| null
|
|
72
|
+
| LinkResolvedValue
|
|
73
|
+
| VideoResolvedValue
|
|
74
|
+
| RichTextResolvedValue;
|
|
75
|
+
|
|
76
|
+
interface StaticPropValue {
|
|
77
|
+
sourceType: 'static';
|
|
78
|
+
value: ResolvedValue | null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
type BindingValue =
|
|
82
|
+
| {
|
|
83
|
+
sourceType: 'prop';
|
|
84
|
+
propId: string;
|
|
85
|
+
propName: string;
|
|
86
|
+
propGroup: string | null;
|
|
87
|
+
}
|
|
88
|
+
| {
|
|
89
|
+
sourceType: 'cms';
|
|
90
|
+
collectionId: string;
|
|
91
|
+
collectionName: string;
|
|
92
|
+
fieldId: string;
|
|
93
|
+
fieldName: string;
|
|
94
|
+
fieldGroup: string | null;
|
|
95
|
+
fieldType: CmsFieldType;
|
|
96
|
+
}
|
|
97
|
+
| {
|
|
98
|
+
sourceType: 'locale';
|
|
99
|
+
fieldKey: string;
|
|
100
|
+
fieldName: string;
|
|
101
|
+
fieldType: 'string';
|
|
102
|
+
}
|
|
103
|
+
| {
|
|
104
|
+
sourceType: 'localeItem';
|
|
105
|
+
fieldKey: string;
|
|
106
|
+
fieldName: string;
|
|
107
|
+
fieldType: 'string';
|
|
108
|
+
}
|
|
109
|
+
| {
|
|
110
|
+
sourceType: 'page';
|
|
111
|
+
fieldKey: string;
|
|
112
|
+
fieldName: string;
|
|
113
|
+
}
|
|
114
|
+
| {sourceType: 'conditional'}
|
|
115
|
+
| {sourceType: 'legacy'};
|
|
116
|
+
|
|
117
|
+
type SettingValue = StaticPropValue | BindingValue;
|
|
118
|
+
|
|
119
|
+
interface SettingDisplay {
|
|
120
|
+
label: string;
|
|
121
|
+
group: string | null;
|
|
122
|
+
trueLabel?: string;
|
|
123
|
+
falseLabel?: string;
|
|
124
|
+
/** Available choices for variant props. Each entry is a variant the component author defined. */
|
|
125
|
+
options?: Array<Pick<Variant, 'id' | 'name'>>;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
interface InstanceProp {
|
|
129
|
+
propId: string;
|
|
130
|
+
valueType: BindableValueType;
|
|
131
|
+
hasOverride: boolean;
|
|
132
|
+
value: SettingValue;
|
|
133
|
+
resolvedValue: ResolvedValue | null;
|
|
134
|
+
defaultValue: ResolvedValue | null;
|
|
135
|
+
display: SettingDisplay;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
interface InstancePropSummary {
|
|
139
|
+
propId: string;
|
|
140
|
+
value: ResolvedValue | BindingValue | null;
|
|
141
|
+
hasOverride: boolean;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
interface ResolvedInstanceProp {
|
|
145
|
+
propId: string;
|
|
146
|
+
value: ResolvedValue | null;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
interface SearchInstancePropsOptions {
|
|
150
|
+
/** Filter to props that produce a specific value type (e.g., "string", "boolean") */
|
|
151
|
+
valueType?: BindableValueType;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Set Instance Props types
|
|
155
|
+
|
|
156
|
+
interface PropBindingInput {
|
|
157
|
+
sourceType: 'prop';
|
|
158
|
+
propId: string;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
interface CmsBindingInput {
|
|
162
|
+
sourceType: 'cms';
|
|
163
|
+
collectionId: string;
|
|
164
|
+
fieldId: string;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
interface PageBindingInput {
|
|
168
|
+
sourceType: 'page';
|
|
169
|
+
fieldKey: string;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
interface LocaleBindingInput {
|
|
173
|
+
sourceType: 'locale';
|
|
174
|
+
fieldKey: string;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
interface LocaleItemBindingInput {
|
|
178
|
+
sourceType: 'localeItem';
|
|
179
|
+
fieldKey: string;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
type BindingInput =
|
|
183
|
+
| PropBindingInput
|
|
184
|
+
| CmsBindingInput
|
|
185
|
+
| PageBindingInput
|
|
186
|
+
| LocaleBindingInput
|
|
187
|
+
| LocaleItemBindingInput;
|
|
188
|
+
|
|
189
|
+
interface SetInstancePropEntry {
|
|
190
|
+
propId: string;
|
|
191
|
+
value: ResolvedValue | BindingInput | null;
|
|
192
|
+
}
|