@plasmicapp/host 1.0.165 → 1.0.166
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/host.esm.js +1 -1
- package/dist/host.esm.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/prop-types.d.ts +40 -41
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
- package/registerComponent/dist/prop-types.d.ts +40 -41
- package/registerComponent/dist/version.d.ts +1 -1
- package/registerGlobalContext/dist/prop-types.d.ts +40 -41
- package/registerGlobalContext/dist/version.d.ts +1 -1
- package/registerToken/dist/prop-types.d.ts +40 -41
- package/registerToken/dist/version.d.ts +1 -1
- package/registerTrait/dist/prop-types.d.ts +40 -41
- package/registerTrait/dist/version.d.ts +1 -1
|
@@ -70,7 +70,7 @@ export interface PropTypeBase<P> {
|
|
|
70
70
|
*/
|
|
71
71
|
forceRemount?: boolean;
|
|
72
72
|
}
|
|
73
|
-
interface Defaultable<P, T> {
|
|
73
|
+
export interface Defaultable<P, T> {
|
|
74
74
|
/**
|
|
75
75
|
* Default value to set for this prop when the component is instantiated
|
|
76
76
|
*/
|
|
@@ -91,7 +91,7 @@ interface Defaultable<P, T> {
|
|
|
91
91
|
*/
|
|
92
92
|
validator?: (value: T, ...args: ControlContext<P>) => (string | true) | Promise<string | true>;
|
|
93
93
|
}
|
|
94
|
-
interface Controllable {
|
|
94
|
+
export interface Controllable {
|
|
95
95
|
/**
|
|
96
96
|
* If true, this is a prop that should only be used inside Plasmic
|
|
97
97
|
* Studio for rendering artboards; will not be actually used in
|
|
@@ -109,22 +109,22 @@ interface Controllable {
|
|
|
109
109
|
}
|
|
110
110
|
export interface PropTypeBaseDefault<P, T> extends PropTypeBase<P>, Defaultable<P, T>, Controllable {
|
|
111
111
|
}
|
|
112
|
-
interface PlainStringType<P> extends PropTypeBaseDefault<P, string> {
|
|
112
|
+
export interface PlainStringType<P> extends PropTypeBaseDefault<P, string> {
|
|
113
113
|
type: "string";
|
|
114
114
|
control?: "default" | "large";
|
|
115
115
|
isLocalizable?: boolean;
|
|
116
116
|
}
|
|
117
|
-
interface CodeStringType<P> extends PropTypeBaseDefault<P, string> {
|
|
117
|
+
export interface CodeStringType<P> extends PropTypeBaseDefault<P, string> {
|
|
118
118
|
type: "code";
|
|
119
119
|
lang: "css" | "html" | "javascript" | "json";
|
|
120
120
|
}
|
|
121
|
-
interface RichTextType<P> extends PropTypeBaseDefault<P, string> {
|
|
121
|
+
export interface RichTextType<P> extends PropTypeBaseDefault<P, string> {
|
|
122
122
|
type: "richText";
|
|
123
123
|
}
|
|
124
|
-
interface HrefType<P> extends PropTypeBaseDefault<P, string> {
|
|
124
|
+
export interface HrefType<P> extends PropTypeBaseDefault<P, string> {
|
|
125
125
|
type: "href";
|
|
126
126
|
}
|
|
127
|
-
interface ColorType<P> extends PropTypeBaseDefault<P, string> {
|
|
127
|
+
export interface ColorType<P> extends PropTypeBaseDefault<P, string> {
|
|
128
128
|
type: "color";
|
|
129
129
|
/**
|
|
130
130
|
* If specified, and the user picks a color token in the Studio, then
|
|
@@ -141,13 +141,13 @@ interface ColorType<P> extends PropTypeBaseDefault<P, string> {
|
|
|
141
141
|
*/
|
|
142
142
|
disableTokens?: boolean;
|
|
143
143
|
}
|
|
144
|
-
interface DateStringType<P> extends PropTypeBaseDefault<P, string> {
|
|
144
|
+
export interface DateStringType<P> extends PropTypeBaseDefault<P, string> {
|
|
145
145
|
type: "dateString";
|
|
146
146
|
}
|
|
147
|
-
interface DateRangeStringsType<P> extends PropTypeBaseDefault<P, [string, string]> {
|
|
147
|
+
export interface DateRangeStringsType<P> extends PropTypeBaseDefault<P, [string, string]> {
|
|
148
148
|
type: "dateRangeStrings";
|
|
149
149
|
}
|
|
150
|
-
interface ClassType<P> extends PropTypeBase<P> {
|
|
150
|
+
export interface ClassType<P> extends PropTypeBase<P> {
|
|
151
151
|
type: "class";
|
|
152
152
|
/**
|
|
153
153
|
* Additional css selectors that can change how this style should look.
|
|
@@ -178,7 +178,7 @@ interface ClassType<P> extends PropTypeBase<P> {
|
|
|
178
178
|
*/
|
|
179
179
|
styleSections?: StyleSection[];
|
|
180
180
|
}
|
|
181
|
-
interface ThemeResetClassType<P> extends PropTypeBase<P> {
|
|
181
|
+
export interface ThemeResetClassType<P> extends PropTypeBase<P> {
|
|
182
182
|
type: "themeResetClass";
|
|
183
183
|
/**
|
|
184
184
|
* Normally, theme reset class will only target Plasmic-generated tags
|
|
@@ -188,7 +188,7 @@ interface ThemeResetClassType<P> extends PropTypeBase<P> {
|
|
|
188
188
|
*/
|
|
189
189
|
targetAllTags?: boolean;
|
|
190
190
|
}
|
|
191
|
-
interface CardPickerType<P> extends PropTypeBaseDefault<P, string> {
|
|
191
|
+
export interface CardPickerType<P> extends PropTypeBaseDefault<P, string> {
|
|
192
192
|
type: "cardPicker";
|
|
193
193
|
modalTitle?: React.ReactNode | ContextDependentConfig<P, React.ReactNode>;
|
|
194
194
|
options: {
|
|
@@ -205,36 +205,36 @@ interface CardPickerType<P> extends PropTypeBaseDefault<P, string> {
|
|
|
205
205
|
showInput?: boolean | ContextDependentConfig<P, boolean>;
|
|
206
206
|
onSearch?: ContextDependentConfig<P, ((value: string) => void) | undefined>;
|
|
207
207
|
}
|
|
208
|
-
type RichStringType<P> = PlainStringType<P> | CodeStringType<P> | RichTextType<P> | ColorType<P> | ClassType<P> | ThemeResetClassType<P> | CardPickerType<P> | HrefType<P>;
|
|
208
|
+
export type RichStringType<P> = PlainStringType<P> | CodeStringType<P> | RichTextType<P> | ColorType<P> | ClassType<P> | ThemeResetClassType<P> | CardPickerType<P> | HrefType<P>;
|
|
209
209
|
export type StringType<P> = "string" | "href" | RichStringType<P>;
|
|
210
|
-
interface RichBooleanType<P> extends PropTypeBaseDefault<P, boolean> {
|
|
210
|
+
export interface RichBooleanType<P> extends PropTypeBaseDefault<P, boolean> {
|
|
211
211
|
type: "boolean";
|
|
212
212
|
}
|
|
213
213
|
export type BooleanType<P> = "boolean" | RichBooleanType<P>;
|
|
214
|
-
type GraphQLValue = {
|
|
214
|
+
export type GraphQLValue = {
|
|
215
215
|
query: string;
|
|
216
216
|
variables?: Record<string, any>;
|
|
217
217
|
};
|
|
218
|
-
interface GraphQLType<P> extends PropTypeBaseDefault<P, GraphQLValue> {
|
|
218
|
+
export interface GraphQLType<P> extends PropTypeBaseDefault<P, GraphQLValue> {
|
|
219
219
|
type: "code";
|
|
220
220
|
lang: "graphql";
|
|
221
221
|
endpoint: string | ContextDependentConfig<P, string>;
|
|
222
222
|
method?: string | ContextDependentConfig<P, string>;
|
|
223
223
|
headers?: object | ContextDependentConfig<P, object>;
|
|
224
224
|
}
|
|
225
|
-
interface NumberTypeBase<P> extends PropTypeBaseDefault<P, number> {
|
|
225
|
+
export interface NumberTypeBase<P> extends PropTypeBaseDefault<P, number> {
|
|
226
226
|
type: "number";
|
|
227
227
|
min?: number | ContextDependentConfig<P, number>;
|
|
228
228
|
max?: number | ContextDependentConfig<P, number>;
|
|
229
229
|
}
|
|
230
|
-
interface PlainNumberType<P> extends NumberTypeBase<P> {
|
|
230
|
+
export interface PlainNumberType<P> extends NumberTypeBase<P> {
|
|
231
231
|
control?: "default";
|
|
232
232
|
}
|
|
233
|
-
interface SliderNumberType<P> extends NumberTypeBase<P> {
|
|
233
|
+
export interface SliderNumberType<P> extends NumberTypeBase<P> {
|
|
234
234
|
control: "slider";
|
|
235
235
|
step?: number | ContextDependentConfig<P, number>;
|
|
236
236
|
}
|
|
237
|
-
type RichNumberType<P> = PlainNumberType<P> | SliderNumberType<P>;
|
|
237
|
+
export type RichNumberType<P> = PlainNumberType<P> | SliderNumberType<P>;
|
|
238
238
|
export type NumberType<P> = "number" | RichNumberType<P>;
|
|
239
239
|
export interface ObjectType<P> extends PropTypeBaseDefault<P, Record<string, any>> {
|
|
240
240
|
type: "object";
|
|
@@ -275,31 +275,31 @@ export interface DataSourceType<P> extends PropTypeBase<P> {
|
|
|
275
275
|
type: "dataSource";
|
|
276
276
|
dataSource: "airtable" | "cms";
|
|
277
277
|
}
|
|
278
|
-
type DataPickerValueType = string | number | (string | number)[];
|
|
279
|
-
interface RichDataPickerType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
278
|
+
export type DataPickerValueType = string | number | (string | number)[];
|
|
279
|
+
export interface RichDataPickerType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
280
280
|
type: "dataSelector";
|
|
281
281
|
data?: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
282
282
|
alwaysShowValuePathAsLabel?: boolean;
|
|
283
283
|
isolateEnv?: boolean;
|
|
284
284
|
}
|
|
285
|
-
type DataPickerType<P> = "dataPicker" | RichDataPickerType<P>;
|
|
286
|
-
interface RichExprEditorType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
285
|
+
export type DataPickerType<P> = "dataPicker" | RichDataPickerType<P>;
|
|
286
|
+
export interface RichExprEditorType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
287
287
|
type: "exprEditor";
|
|
288
288
|
data?: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
289
289
|
isolateEnv?: boolean;
|
|
290
290
|
}
|
|
291
|
-
type ExprEditorType<P> = "exprEditor" | RichExprEditorType<P>;
|
|
292
|
-
interface FormValidationRulesType<P> extends PropTypeBaseDefault<P, any> {
|
|
291
|
+
export type ExprEditorType<P> = "exprEditor" | RichExprEditorType<P>;
|
|
292
|
+
export interface FormValidationRulesType<P> extends PropTypeBaseDefault<P, any> {
|
|
293
293
|
type: "formValidationRules";
|
|
294
294
|
}
|
|
295
|
-
interface EventHandlerType<P> extends PropTypeBase<P> {
|
|
295
|
+
export interface EventHandlerType<P> extends PropTypeBase<P> {
|
|
296
296
|
type: "eventHandler";
|
|
297
297
|
argTypes: {
|
|
298
298
|
name: string;
|
|
299
299
|
type: PropType<any>;
|
|
300
300
|
}[];
|
|
301
301
|
}
|
|
302
|
-
interface ChoiceTypeBase<P, T> extends PropTypeBaseDefault<P, T> {
|
|
302
|
+
export interface ChoiceTypeBase<P, T> extends PropTypeBaseDefault<P, T> {
|
|
303
303
|
type: "choice";
|
|
304
304
|
options: string[] | {
|
|
305
305
|
label: string;
|
|
@@ -312,17 +312,17 @@ interface ChoiceTypeBase<P, T> extends PropTypeBaseDefault<P, T> {
|
|
|
312
312
|
filterOption?: boolean;
|
|
313
313
|
onSearch?: ContextDependentConfig<P, ((value: string) => void) | undefined>;
|
|
314
314
|
}
|
|
315
|
-
interface SingleChoiceType<P> extends ChoiceTypeBase<P, string | number | boolean> {
|
|
315
|
+
export interface SingleChoiceType<P> extends ChoiceTypeBase<P, string | number | boolean> {
|
|
316
316
|
multiSelect?: false;
|
|
317
317
|
}
|
|
318
|
-
interface MultiChoiceType<P> extends ChoiceTypeBase<P, (string | number | boolean)[]> {
|
|
318
|
+
export interface MultiChoiceType<P> extends ChoiceTypeBase<P, (string | number | boolean)[]> {
|
|
319
319
|
multiSelect: true;
|
|
320
320
|
}
|
|
321
|
-
interface CustomChoiceType<P> extends ChoiceTypeBase<P, string | number | boolean | (string | number | boolean)[]> {
|
|
321
|
+
export interface CustomChoiceType<P> extends ChoiceTypeBase<P, string | number | boolean | (string | number | boolean)[]> {
|
|
322
322
|
multiSelect: ContextDependentConfig<P, boolean>;
|
|
323
323
|
}
|
|
324
324
|
export type ChoiceType<P> = SingleChoiceType<P> | MultiChoiceType<P> | CustomChoiceType<P>;
|
|
325
|
-
interface RichSlotType<P> {
|
|
325
|
+
export interface RichSlotType<P> {
|
|
326
326
|
type: "slot";
|
|
327
327
|
/**
|
|
328
328
|
* The unique names of all code components that can be placed in the slot
|
|
@@ -372,18 +372,18 @@ interface RichSlotType<P> {
|
|
|
372
372
|
*/
|
|
373
373
|
hiddenMergedProps?: ContextDependentConfig<P, boolean>;
|
|
374
374
|
}
|
|
375
|
-
type SlotType<P> = "slot" | RichSlotType<P>;
|
|
376
|
-
interface RichImageUrlType<P> extends PropTypeBaseDefault<P, string> {
|
|
375
|
+
export type SlotType<P> = "slot" | RichSlotType<P>;
|
|
376
|
+
export interface RichImageUrlType<P> extends PropTypeBaseDefault<P, string> {
|
|
377
377
|
type: "imageUrl";
|
|
378
378
|
}
|
|
379
|
-
type ImageUrlType<P> = "imageUrl" | RichImageUrlType<P>;
|
|
379
|
+
export type ImageUrlType<P> = "imageUrl" | RichImageUrlType<P>;
|
|
380
380
|
export interface ModalProps {
|
|
381
381
|
show?: boolean;
|
|
382
382
|
children?: React.ReactNode;
|
|
383
383
|
onClose: () => void;
|
|
384
384
|
style?: CSSProperties;
|
|
385
385
|
}
|
|
386
|
-
interface CustomControlProps<P> {
|
|
386
|
+
export interface CustomControlProps<P> {
|
|
387
387
|
componentProps: P;
|
|
388
388
|
/**
|
|
389
389
|
* `contextData` can be `null` if the prop controls are rendering before
|
|
@@ -412,15 +412,14 @@ interface CustomControlProps<P> {
|
|
|
412
412
|
studioDocument: typeof document;
|
|
413
413
|
}
|
|
414
414
|
export type CustomControl<P> = React.ComponentType<CustomControlProps<P>>;
|
|
415
|
-
interface RichCustomType<P> extends PropTypeBaseDefault<P, any> {
|
|
415
|
+
export interface RichCustomType<P> extends PropTypeBaseDefault<P, any> {
|
|
416
416
|
type: "custom";
|
|
417
417
|
control: CustomControl<P>;
|
|
418
418
|
}
|
|
419
419
|
export type CustomType<P> = RichCustomType<P> | CustomControl<P>;
|
|
420
420
|
export type PrimitiveType<P = any> = Extract<StringType<P> | BooleanType<P> | NumberType<P> | JSONLikeType<P>, string>;
|
|
421
421
|
export type PropType<P> = StringType<P> | BooleanType<P> | GraphQLType<P> | NumberType<P> | JSONLikeType<P> | DataSourceType<P> | DataPickerType<P> | ExprEditorType<P> | FormValidationRulesType<P> | EventHandlerType<P> | ChoiceType<P> | CustomType<P> | ImageUrlType<P> | SlotType<P> | DateStringType<P> | DateRangeStringsType<P>;
|
|
422
|
-
type StringCompatType<P> = DateStringType<P> | StringType<P> | ChoiceType<P> | JSONLikeType<P> | ImageUrlType<P> | CustomType<P> | DataPickerType<P>;
|
|
423
|
-
type BoolCompatType<P> = BooleanType<P> | CustomType<P> | DataPickerType<P>;
|
|
424
|
-
type NumberCompatType<P> = NumberType<P> | CustomType<P> | DataPickerType<P>;
|
|
422
|
+
export type StringCompatType<P> = DateStringType<P> | StringType<P> | ChoiceType<P> | JSONLikeType<P> | ImageUrlType<P> | CustomType<P> | DataPickerType<P>;
|
|
423
|
+
export type BoolCompatType<P> = BooleanType<P> | CustomType<P> | DataPickerType<P>;
|
|
424
|
+
export type NumberCompatType<P> = NumberType<P> | CustomType<P> | DataPickerType<P>;
|
|
425
425
|
export type RestrictPropType<T, P> = T extends string ? StringCompatType<P> : T extends boolean ? BoolCompatType<P> : T extends number ? NumberCompatType<P> : PropType<P>;
|
|
426
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const hostVersion = "1.0.
|
|
1
|
+
export declare const hostVersion = "1.0.166";
|
|
@@ -70,7 +70,7 @@ export interface PropTypeBase<P> {
|
|
|
70
70
|
*/
|
|
71
71
|
forceRemount?: boolean;
|
|
72
72
|
}
|
|
73
|
-
interface Defaultable<P, T> {
|
|
73
|
+
export interface Defaultable<P, T> {
|
|
74
74
|
/**
|
|
75
75
|
* Default value to set for this prop when the component is instantiated
|
|
76
76
|
*/
|
|
@@ -91,7 +91,7 @@ interface Defaultable<P, T> {
|
|
|
91
91
|
*/
|
|
92
92
|
validator?: (value: T, ...args: ControlContext<P>) => (string | true) | Promise<string | true>;
|
|
93
93
|
}
|
|
94
|
-
interface Controllable {
|
|
94
|
+
export interface Controllable {
|
|
95
95
|
/**
|
|
96
96
|
* If true, this is a prop that should only be used inside Plasmic
|
|
97
97
|
* Studio for rendering artboards; will not be actually used in
|
|
@@ -109,22 +109,22 @@ interface Controllable {
|
|
|
109
109
|
}
|
|
110
110
|
export interface PropTypeBaseDefault<P, T> extends PropTypeBase<P>, Defaultable<P, T>, Controllable {
|
|
111
111
|
}
|
|
112
|
-
interface PlainStringType<P> extends PropTypeBaseDefault<P, string> {
|
|
112
|
+
export interface PlainStringType<P> extends PropTypeBaseDefault<P, string> {
|
|
113
113
|
type: "string";
|
|
114
114
|
control?: "default" | "large";
|
|
115
115
|
isLocalizable?: boolean;
|
|
116
116
|
}
|
|
117
|
-
interface CodeStringType<P> extends PropTypeBaseDefault<P, string> {
|
|
117
|
+
export interface CodeStringType<P> extends PropTypeBaseDefault<P, string> {
|
|
118
118
|
type: "code";
|
|
119
119
|
lang: "css" | "html" | "javascript" | "json";
|
|
120
120
|
}
|
|
121
|
-
interface RichTextType<P> extends PropTypeBaseDefault<P, string> {
|
|
121
|
+
export interface RichTextType<P> extends PropTypeBaseDefault<P, string> {
|
|
122
122
|
type: "richText";
|
|
123
123
|
}
|
|
124
|
-
interface HrefType<P> extends PropTypeBaseDefault<P, string> {
|
|
124
|
+
export interface HrefType<P> extends PropTypeBaseDefault<P, string> {
|
|
125
125
|
type: "href";
|
|
126
126
|
}
|
|
127
|
-
interface ColorType<P> extends PropTypeBaseDefault<P, string> {
|
|
127
|
+
export interface ColorType<P> extends PropTypeBaseDefault<P, string> {
|
|
128
128
|
type: "color";
|
|
129
129
|
/**
|
|
130
130
|
* If specified, and the user picks a color token in the Studio, then
|
|
@@ -141,13 +141,13 @@ interface ColorType<P> extends PropTypeBaseDefault<P, string> {
|
|
|
141
141
|
*/
|
|
142
142
|
disableTokens?: boolean;
|
|
143
143
|
}
|
|
144
|
-
interface DateStringType<P> extends PropTypeBaseDefault<P, string> {
|
|
144
|
+
export interface DateStringType<P> extends PropTypeBaseDefault<P, string> {
|
|
145
145
|
type: "dateString";
|
|
146
146
|
}
|
|
147
|
-
interface DateRangeStringsType<P> extends PropTypeBaseDefault<P, [string, string]> {
|
|
147
|
+
export interface DateRangeStringsType<P> extends PropTypeBaseDefault<P, [string, string]> {
|
|
148
148
|
type: "dateRangeStrings";
|
|
149
149
|
}
|
|
150
|
-
interface ClassType<P> extends PropTypeBase<P> {
|
|
150
|
+
export interface ClassType<P> extends PropTypeBase<P> {
|
|
151
151
|
type: "class";
|
|
152
152
|
/**
|
|
153
153
|
* Additional css selectors that can change how this style should look.
|
|
@@ -178,7 +178,7 @@ interface ClassType<P> extends PropTypeBase<P> {
|
|
|
178
178
|
*/
|
|
179
179
|
styleSections?: StyleSection[];
|
|
180
180
|
}
|
|
181
|
-
interface ThemeResetClassType<P> extends PropTypeBase<P> {
|
|
181
|
+
export interface ThemeResetClassType<P> extends PropTypeBase<P> {
|
|
182
182
|
type: "themeResetClass";
|
|
183
183
|
/**
|
|
184
184
|
* Normally, theme reset class will only target Plasmic-generated tags
|
|
@@ -188,7 +188,7 @@ interface ThemeResetClassType<P> extends PropTypeBase<P> {
|
|
|
188
188
|
*/
|
|
189
189
|
targetAllTags?: boolean;
|
|
190
190
|
}
|
|
191
|
-
interface CardPickerType<P> extends PropTypeBaseDefault<P, string> {
|
|
191
|
+
export interface CardPickerType<P> extends PropTypeBaseDefault<P, string> {
|
|
192
192
|
type: "cardPicker";
|
|
193
193
|
modalTitle?: React.ReactNode | ContextDependentConfig<P, React.ReactNode>;
|
|
194
194
|
options: {
|
|
@@ -205,36 +205,36 @@ interface CardPickerType<P> extends PropTypeBaseDefault<P, string> {
|
|
|
205
205
|
showInput?: boolean | ContextDependentConfig<P, boolean>;
|
|
206
206
|
onSearch?: ContextDependentConfig<P, ((value: string) => void) | undefined>;
|
|
207
207
|
}
|
|
208
|
-
type RichStringType<P> = PlainStringType<P> | CodeStringType<P> | RichTextType<P> | ColorType<P> | ClassType<P> | ThemeResetClassType<P> | CardPickerType<P> | HrefType<P>;
|
|
208
|
+
export type RichStringType<P> = PlainStringType<P> | CodeStringType<P> | RichTextType<P> | ColorType<P> | ClassType<P> | ThemeResetClassType<P> | CardPickerType<P> | HrefType<P>;
|
|
209
209
|
export type StringType<P> = "string" | "href" | RichStringType<P>;
|
|
210
|
-
interface RichBooleanType<P> extends PropTypeBaseDefault<P, boolean> {
|
|
210
|
+
export interface RichBooleanType<P> extends PropTypeBaseDefault<P, boolean> {
|
|
211
211
|
type: "boolean";
|
|
212
212
|
}
|
|
213
213
|
export type BooleanType<P> = "boolean" | RichBooleanType<P>;
|
|
214
|
-
type GraphQLValue = {
|
|
214
|
+
export type GraphQLValue = {
|
|
215
215
|
query: string;
|
|
216
216
|
variables?: Record<string, any>;
|
|
217
217
|
};
|
|
218
|
-
interface GraphQLType<P> extends PropTypeBaseDefault<P, GraphQLValue> {
|
|
218
|
+
export interface GraphQLType<P> extends PropTypeBaseDefault<P, GraphQLValue> {
|
|
219
219
|
type: "code";
|
|
220
220
|
lang: "graphql";
|
|
221
221
|
endpoint: string | ContextDependentConfig<P, string>;
|
|
222
222
|
method?: string | ContextDependentConfig<P, string>;
|
|
223
223
|
headers?: object | ContextDependentConfig<P, object>;
|
|
224
224
|
}
|
|
225
|
-
interface NumberTypeBase<P> extends PropTypeBaseDefault<P, number> {
|
|
225
|
+
export interface NumberTypeBase<P> extends PropTypeBaseDefault<P, number> {
|
|
226
226
|
type: "number";
|
|
227
227
|
min?: number | ContextDependentConfig<P, number>;
|
|
228
228
|
max?: number | ContextDependentConfig<P, number>;
|
|
229
229
|
}
|
|
230
|
-
interface PlainNumberType<P> extends NumberTypeBase<P> {
|
|
230
|
+
export interface PlainNumberType<P> extends NumberTypeBase<P> {
|
|
231
231
|
control?: "default";
|
|
232
232
|
}
|
|
233
|
-
interface SliderNumberType<P> extends NumberTypeBase<P> {
|
|
233
|
+
export interface SliderNumberType<P> extends NumberTypeBase<P> {
|
|
234
234
|
control: "slider";
|
|
235
235
|
step?: number | ContextDependentConfig<P, number>;
|
|
236
236
|
}
|
|
237
|
-
type RichNumberType<P> = PlainNumberType<P> | SliderNumberType<P>;
|
|
237
|
+
export type RichNumberType<P> = PlainNumberType<P> | SliderNumberType<P>;
|
|
238
238
|
export type NumberType<P> = "number" | RichNumberType<P>;
|
|
239
239
|
export interface ObjectType<P> extends PropTypeBaseDefault<P, Record<string, any>> {
|
|
240
240
|
type: "object";
|
|
@@ -275,31 +275,31 @@ export interface DataSourceType<P> extends PropTypeBase<P> {
|
|
|
275
275
|
type: "dataSource";
|
|
276
276
|
dataSource: "airtable" | "cms";
|
|
277
277
|
}
|
|
278
|
-
type DataPickerValueType = string | number | (string | number)[];
|
|
279
|
-
interface RichDataPickerType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
278
|
+
export type DataPickerValueType = string | number | (string | number)[];
|
|
279
|
+
export interface RichDataPickerType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
280
280
|
type: "dataSelector";
|
|
281
281
|
data?: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
282
282
|
alwaysShowValuePathAsLabel?: boolean;
|
|
283
283
|
isolateEnv?: boolean;
|
|
284
284
|
}
|
|
285
|
-
type DataPickerType<P> = "dataPicker" | RichDataPickerType<P>;
|
|
286
|
-
interface RichExprEditorType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
285
|
+
export type DataPickerType<P> = "dataPicker" | RichDataPickerType<P>;
|
|
286
|
+
export interface RichExprEditorType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
287
287
|
type: "exprEditor";
|
|
288
288
|
data?: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
289
289
|
isolateEnv?: boolean;
|
|
290
290
|
}
|
|
291
|
-
type ExprEditorType<P> = "exprEditor" | RichExprEditorType<P>;
|
|
292
|
-
interface FormValidationRulesType<P> extends PropTypeBaseDefault<P, any> {
|
|
291
|
+
export type ExprEditorType<P> = "exprEditor" | RichExprEditorType<P>;
|
|
292
|
+
export interface FormValidationRulesType<P> extends PropTypeBaseDefault<P, any> {
|
|
293
293
|
type: "formValidationRules";
|
|
294
294
|
}
|
|
295
|
-
interface EventHandlerType<P> extends PropTypeBase<P> {
|
|
295
|
+
export interface EventHandlerType<P> extends PropTypeBase<P> {
|
|
296
296
|
type: "eventHandler";
|
|
297
297
|
argTypes: {
|
|
298
298
|
name: string;
|
|
299
299
|
type: PropType<any>;
|
|
300
300
|
}[];
|
|
301
301
|
}
|
|
302
|
-
interface ChoiceTypeBase<P, T> extends PropTypeBaseDefault<P, T> {
|
|
302
|
+
export interface ChoiceTypeBase<P, T> extends PropTypeBaseDefault<P, T> {
|
|
303
303
|
type: "choice";
|
|
304
304
|
options: string[] | {
|
|
305
305
|
label: string;
|
|
@@ -312,17 +312,17 @@ interface ChoiceTypeBase<P, T> extends PropTypeBaseDefault<P, T> {
|
|
|
312
312
|
filterOption?: boolean;
|
|
313
313
|
onSearch?: ContextDependentConfig<P, ((value: string) => void) | undefined>;
|
|
314
314
|
}
|
|
315
|
-
interface SingleChoiceType<P> extends ChoiceTypeBase<P, string | number | boolean> {
|
|
315
|
+
export interface SingleChoiceType<P> extends ChoiceTypeBase<P, string | number | boolean> {
|
|
316
316
|
multiSelect?: false;
|
|
317
317
|
}
|
|
318
|
-
interface MultiChoiceType<P> extends ChoiceTypeBase<P, (string | number | boolean)[]> {
|
|
318
|
+
export interface MultiChoiceType<P> extends ChoiceTypeBase<P, (string | number | boolean)[]> {
|
|
319
319
|
multiSelect: true;
|
|
320
320
|
}
|
|
321
|
-
interface CustomChoiceType<P> extends ChoiceTypeBase<P, string | number | boolean | (string | number | boolean)[]> {
|
|
321
|
+
export interface CustomChoiceType<P> extends ChoiceTypeBase<P, string | number | boolean | (string | number | boolean)[]> {
|
|
322
322
|
multiSelect: ContextDependentConfig<P, boolean>;
|
|
323
323
|
}
|
|
324
324
|
export type ChoiceType<P> = SingleChoiceType<P> | MultiChoiceType<P> | CustomChoiceType<P>;
|
|
325
|
-
interface RichSlotType<P> {
|
|
325
|
+
export interface RichSlotType<P> {
|
|
326
326
|
type: "slot";
|
|
327
327
|
/**
|
|
328
328
|
* The unique names of all code components that can be placed in the slot
|
|
@@ -372,18 +372,18 @@ interface RichSlotType<P> {
|
|
|
372
372
|
*/
|
|
373
373
|
hiddenMergedProps?: ContextDependentConfig<P, boolean>;
|
|
374
374
|
}
|
|
375
|
-
type SlotType<P> = "slot" | RichSlotType<P>;
|
|
376
|
-
interface RichImageUrlType<P> extends PropTypeBaseDefault<P, string> {
|
|
375
|
+
export type SlotType<P> = "slot" | RichSlotType<P>;
|
|
376
|
+
export interface RichImageUrlType<P> extends PropTypeBaseDefault<P, string> {
|
|
377
377
|
type: "imageUrl";
|
|
378
378
|
}
|
|
379
|
-
type ImageUrlType<P> = "imageUrl" | RichImageUrlType<P>;
|
|
379
|
+
export type ImageUrlType<P> = "imageUrl" | RichImageUrlType<P>;
|
|
380
380
|
export interface ModalProps {
|
|
381
381
|
show?: boolean;
|
|
382
382
|
children?: React.ReactNode;
|
|
383
383
|
onClose: () => void;
|
|
384
384
|
style?: CSSProperties;
|
|
385
385
|
}
|
|
386
|
-
interface CustomControlProps<P> {
|
|
386
|
+
export interface CustomControlProps<P> {
|
|
387
387
|
componentProps: P;
|
|
388
388
|
/**
|
|
389
389
|
* `contextData` can be `null` if the prop controls are rendering before
|
|
@@ -412,15 +412,14 @@ interface CustomControlProps<P> {
|
|
|
412
412
|
studioDocument: typeof document;
|
|
413
413
|
}
|
|
414
414
|
export type CustomControl<P> = React.ComponentType<CustomControlProps<P>>;
|
|
415
|
-
interface RichCustomType<P> extends PropTypeBaseDefault<P, any> {
|
|
415
|
+
export interface RichCustomType<P> extends PropTypeBaseDefault<P, any> {
|
|
416
416
|
type: "custom";
|
|
417
417
|
control: CustomControl<P>;
|
|
418
418
|
}
|
|
419
419
|
export type CustomType<P> = RichCustomType<P> | CustomControl<P>;
|
|
420
420
|
export type PrimitiveType<P = any> = Extract<StringType<P> | BooleanType<P> | NumberType<P> | JSONLikeType<P>, string>;
|
|
421
421
|
export type PropType<P> = StringType<P> | BooleanType<P> | GraphQLType<P> | NumberType<P> | JSONLikeType<P> | DataSourceType<P> | DataPickerType<P> | ExprEditorType<P> | FormValidationRulesType<P> | EventHandlerType<P> | ChoiceType<P> | CustomType<P> | ImageUrlType<P> | SlotType<P> | DateStringType<P> | DateRangeStringsType<P>;
|
|
422
|
-
type StringCompatType<P> = DateStringType<P> | StringType<P> | ChoiceType<P> | JSONLikeType<P> | ImageUrlType<P> | CustomType<P> | DataPickerType<P>;
|
|
423
|
-
type BoolCompatType<P> = BooleanType<P> | CustomType<P> | DataPickerType<P>;
|
|
424
|
-
type NumberCompatType<P> = NumberType<P> | CustomType<P> | DataPickerType<P>;
|
|
422
|
+
export type StringCompatType<P> = DateStringType<P> | StringType<P> | ChoiceType<P> | JSONLikeType<P> | ImageUrlType<P> | CustomType<P> | DataPickerType<P>;
|
|
423
|
+
export type BoolCompatType<P> = BooleanType<P> | CustomType<P> | DataPickerType<P>;
|
|
424
|
+
export type NumberCompatType<P> = NumberType<P> | CustomType<P> | DataPickerType<P>;
|
|
425
425
|
export type RestrictPropType<T, P> = T extends string ? StringCompatType<P> : T extends boolean ? BoolCompatType<P> : T extends number ? NumberCompatType<P> : PropType<P>;
|
|
426
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const hostVersion = "1.0.
|
|
1
|
+
export declare const hostVersion = "1.0.166";
|