@plasmicapp/host 1.0.129 → 1.0.131
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/canvas-host.d.ts +41 -41
- package/dist/common.d.ts +1 -1
- package/dist/data.d.ts +43 -43
- package/dist/element-types.d.ts +115 -115
- package/dist/exports.d.ts +10 -10
- package/dist/fetcher.d.ts +40 -40
- package/dist/global-actions.d.ts +9 -9
- package/dist/host.esm.js +441 -406
- package/dist/host.esm.js.map +1 -1
- package/dist/index.cjs.js +457 -422
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/lang-utils.d.ts +3 -3
- package/dist/registerComponent.d.ts +590 -589
- package/dist/registerGlobalContext.d.ts +75 -75
- package/dist/registerToken.d.ts +13 -13
- package/dist/registerTrait.d.ts +20 -20
- package/dist/repeatedElement.d.ts +15 -15
- package/dist/useForceUpdate.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +5 -6
- package/registerComponent/dist/element-types.d.ts +115 -115
- package/registerComponent/dist/index.cjs.js +12 -12
- package/registerComponent/dist/index.esm.js +12 -12
- package/registerComponent/dist/registerComponent.d.ts +590 -589
- package/registerGlobalContext/dist/element-types.d.ts +115 -115
- package/registerGlobalContext/dist/index.cjs.js +12 -12
- package/registerGlobalContext/dist/index.esm.js +12 -12
- package/registerGlobalContext/dist/registerComponent.d.ts +590 -589
- package/registerGlobalContext/dist/registerGlobalContext.d.ts +75 -75
- package/registerToken/dist/index.cjs.js +6 -6
- package/registerToken/dist/index.esm.js +6 -6
- package/registerToken/dist/registerToken.d.ts +13 -13
- package/registerTrait/dist/index.cjs.js +9 -9
- package/registerTrait/dist/index.esm.js +9 -9
- package/registerTrait/dist/registerTrait.d.ts +20 -20
|
@@ -1,589 +1,590 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { CodeComponentElement, CSSProperties, PlasmicElement } from "./element-types";
|
|
3
|
-
export interface CanvasComponentProps<Data = any> {
|
|
4
|
-
/**
|
|
5
|
-
* This prop is only provided within the canvas of Plasmic Studio.
|
|
6
|
-
* Allows the component to set data to be consumed by the props' controls.
|
|
7
|
-
*/
|
|
8
|
-
setControlContextData?: (data: Data) => void;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
path: (string | number)[];
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Context that we pass back to control functions.
|
|
16
|
-
*/
|
|
17
|
-
export
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
P,
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
InferDataType<P> | null,
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
ControlExtras
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
*
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
export
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
*
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
*
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
*
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* * `
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
*
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
*
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
*
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
*
|
|
345
|
-
* arguments
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
export
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
*
|
|
370
|
-
*
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
*
|
|
385
|
-
*
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
export
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
*
|
|
454
|
-
*
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
*
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
*
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
*
|
|
474
|
-
*
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
*
|
|
488
|
-
*
|
|
489
|
-
*
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
*
|
|
499
|
-
*
|
|
500
|
-
*
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
*
|
|
510
|
-
*
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
*
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
*
|
|
521
|
-
*
|
|
522
|
-
*
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
*
|
|
528
|
-
*
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
*
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
*
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
export
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
export
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CodeComponentElement, CSSProperties, PlasmicElement } from "./element-types";
|
|
3
|
+
export interface CanvasComponentProps<Data = any> {
|
|
4
|
+
/**
|
|
5
|
+
* This prop is only provided within the canvas of Plasmic Studio.
|
|
6
|
+
* Allows the component to set data to be consumed by the props' controls.
|
|
7
|
+
*/
|
|
8
|
+
setControlContextData?: (data: Data) => void;
|
|
9
|
+
}
|
|
10
|
+
type InferDataType<P> = P extends CanvasComponentProps<infer Data> ? Data : any;
|
|
11
|
+
export type ControlExtras = {
|
|
12
|
+
path: (string | number)[];
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Context that we pass back to control functions.
|
|
16
|
+
*/
|
|
17
|
+
export type ControlContext<P> = [
|
|
18
|
+
/**
|
|
19
|
+
* props
|
|
20
|
+
*/
|
|
21
|
+
P,
|
|
22
|
+
/**
|
|
23
|
+
* `contextData` can be `null` if the prop controls are rendering before
|
|
24
|
+
* the component instance itself (it will re-render once the component
|
|
25
|
+
* calls `setControlContextData`)
|
|
26
|
+
*/
|
|
27
|
+
InferDataType<P> | null,
|
|
28
|
+
/**
|
|
29
|
+
* Extra information for the control to use
|
|
30
|
+
*/
|
|
31
|
+
ControlExtras
|
|
32
|
+
];
|
|
33
|
+
/**
|
|
34
|
+
* Config option that takes the context (e.g., props) of the component instance
|
|
35
|
+
* to dynamically set its value.
|
|
36
|
+
*/
|
|
37
|
+
export type ContextDependentConfig<P, R> = (...args: ControlContext<P>) => R;
|
|
38
|
+
export interface PropTypeBase<P> {
|
|
39
|
+
displayName?: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
helpText?: string;
|
|
42
|
+
/**
|
|
43
|
+
* If the user has chosen to use a dynamic expression for this prop, provide
|
|
44
|
+
* a hint as to the expected values that the expression should evaluate to.
|
|
45
|
+
* This hint will be displayed alongside the code editor. You may use
|
|
46
|
+
* markdown in the text here.
|
|
47
|
+
*/
|
|
48
|
+
exprHint?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Function for whether this prop should be hidden in the right panel,
|
|
51
|
+
* given the current props for this component
|
|
52
|
+
*/
|
|
53
|
+
hidden?: ContextDependentConfig<P, boolean>;
|
|
54
|
+
readOnly?: boolean | ContextDependentConfig<P, boolean>;
|
|
55
|
+
/**
|
|
56
|
+
* If true, will hide the prop in a collapsed section; good for props that
|
|
57
|
+
* should not usually be used.
|
|
58
|
+
*/
|
|
59
|
+
advanced?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* If true, does not allow the user to use a dynamic expression for this prop
|
|
62
|
+
*/
|
|
63
|
+
disableDynamicValue?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* If set to true, the component will be remounted when the prop value is updated.
|
|
66
|
+
* (This behavior only appliees to canvas)
|
|
67
|
+
*/
|
|
68
|
+
forceRemount?: boolean;
|
|
69
|
+
}
|
|
70
|
+
export type DefaultValueOrExpr<P, T> = {
|
|
71
|
+
defaultExpr?: undefined;
|
|
72
|
+
defaultExprHint?: undefined;
|
|
73
|
+
defaultValue?: T;
|
|
74
|
+
defaultValueHint?: T | ContextDependentConfig<P, T | undefined>;
|
|
75
|
+
} | {
|
|
76
|
+
defaultValue?: undefined;
|
|
77
|
+
defaultValueHint?: undefined;
|
|
78
|
+
defaultExpr?: string;
|
|
79
|
+
defaultExprHint?: string;
|
|
80
|
+
};
|
|
81
|
+
type StringTypeBase<P> = PropTypeBase<P> & DefaultValueOrExpr<P, string>;
|
|
82
|
+
export type StringType<P> = "string" | (({
|
|
83
|
+
type: "string";
|
|
84
|
+
control?: "default" | "large";
|
|
85
|
+
} | {
|
|
86
|
+
type: "code";
|
|
87
|
+
lang: "css" | "html" | "javascript" | "json";
|
|
88
|
+
} | {
|
|
89
|
+
type: "richText";
|
|
90
|
+
} | {
|
|
91
|
+
type: "color";
|
|
92
|
+
/**
|
|
93
|
+
* If specified, and the user picks a color token in the Studio, then
|
|
94
|
+
* the value passed in as prop is a css variable reference, like
|
|
95
|
+
* `var(--TOKEN_ID)`, instead of the resolved hex value of the token.
|
|
96
|
+
* You should take care in using this in the proper css context --
|
|
97
|
+
* the css token is only defined if you are rendering under some
|
|
98
|
+
* Plasmic component in the DOM tree, which is usually the case,
|
|
99
|
+
* unless you are using a React portal.
|
|
100
|
+
*/
|
|
101
|
+
keepCssVar?: boolean;
|
|
102
|
+
} | {
|
|
103
|
+
type: "class";
|
|
104
|
+
/**
|
|
105
|
+
* Additional css selectors that can change how this style should look.
|
|
106
|
+
* Some examples:
|
|
107
|
+
*
|
|
108
|
+
* * `:hover` -- on hover
|
|
109
|
+
* * `[data-something="blah"] -- when the element with this class has
|
|
110
|
+
* an html attribute "data-something=blah"
|
|
111
|
+
* * :component[data-something="blah"] :self -- when the root of the
|
|
112
|
+
* component has an html attribute "data-something=blah". Note that
|
|
113
|
+
* the non-standard `:component` selector is used to select the
|
|
114
|
+
* component root, and the non-standard `:self` selector is used
|
|
115
|
+
* to select the element that this class is attached to.
|
|
116
|
+
*/
|
|
117
|
+
selectors?: {
|
|
118
|
+
/**
|
|
119
|
+
* A css selector, like `:hover` or `[data-something="blah"]`.
|
|
120
|
+
*/
|
|
121
|
+
selector: string;
|
|
122
|
+
/**
|
|
123
|
+
* An optional human-friendly label for the selector, so the studio user
|
|
124
|
+
* knows what this selector means.
|
|
125
|
+
*/
|
|
126
|
+
label?: string;
|
|
127
|
+
}[];
|
|
128
|
+
/**
|
|
129
|
+
* If specified, then only shows these style sections for styling this class
|
|
130
|
+
*/
|
|
131
|
+
styleSections?: StyleSection[];
|
|
132
|
+
} | {
|
|
133
|
+
type: "themeResetClass";
|
|
134
|
+
/**
|
|
135
|
+
* Normally, theme reset class will only target Plasmic-generated tags
|
|
136
|
+
* with the default tag styles. If you also want to target non-Plasmic-generated
|
|
137
|
+
* tags (say, rendered by your code components, or fetched as an HTML blob
|
|
138
|
+
* from somewhere), then specify `true` here.
|
|
139
|
+
*/
|
|
140
|
+
targetAllTags?: boolean;
|
|
141
|
+
} | {
|
|
142
|
+
type: "cardPicker";
|
|
143
|
+
modalTitle?: React.ReactNode | ContextDependentConfig<P, React.ReactNode>;
|
|
144
|
+
options: {
|
|
145
|
+
value: string;
|
|
146
|
+
label?: string;
|
|
147
|
+
imgUrl: string;
|
|
148
|
+
footer?: React.ReactNode;
|
|
149
|
+
}[] | ContextDependentConfig<P, {
|
|
150
|
+
value: string;
|
|
151
|
+
label?: string;
|
|
152
|
+
imgUrl: string;
|
|
153
|
+
footer?: React.ReactNode;
|
|
154
|
+
}[]>;
|
|
155
|
+
showInput?: boolean | ContextDependentConfig<P, boolean>;
|
|
156
|
+
onSearch?: ContextDependentConfig<P, ((value: string) => void) | undefined>;
|
|
157
|
+
}) & StringTypeBase<P>);
|
|
158
|
+
export type BooleanType<P> = "boolean" | ({
|
|
159
|
+
type: "boolean";
|
|
160
|
+
} & DefaultValueOrExpr<P, boolean> & PropTypeBase<P>);
|
|
161
|
+
type GraphQLValue = {
|
|
162
|
+
query: string;
|
|
163
|
+
variables?: Record<string, any>;
|
|
164
|
+
};
|
|
165
|
+
export type GraphQLType<P> = {
|
|
166
|
+
type: "code";
|
|
167
|
+
lang: "graphql";
|
|
168
|
+
endpoint: string | ContextDependentConfig<P, string>;
|
|
169
|
+
method?: string | ContextDependentConfig<P, string>;
|
|
170
|
+
headers?: object | ContextDependentConfig<P, object>;
|
|
171
|
+
} & DefaultValueOrExpr<P, GraphQLValue> & PropTypeBase<P>;
|
|
172
|
+
type NumberTypeBase<P> = PropTypeBase<P> & DefaultValueOrExpr<P, number> & {
|
|
173
|
+
type: "number";
|
|
174
|
+
};
|
|
175
|
+
export type NumberType<P> = "number" | (({
|
|
176
|
+
control?: "default";
|
|
177
|
+
min?: number | ContextDependentConfig<P, number>;
|
|
178
|
+
max?: number | ContextDependentConfig<P, number>;
|
|
179
|
+
} | {
|
|
180
|
+
control: "slider";
|
|
181
|
+
min: number | ContextDependentConfig<P, number>;
|
|
182
|
+
max: number | ContextDependentConfig<P, number>;
|
|
183
|
+
step?: number | ContextDependentConfig<P, number>;
|
|
184
|
+
}) & NumberTypeBase<P>);
|
|
185
|
+
/**
|
|
186
|
+
* Expects defaultValue to be a JSON-compatible value
|
|
187
|
+
*/
|
|
188
|
+
export type JSONLikeType<P> = "object" | ({
|
|
189
|
+
type: "object";
|
|
190
|
+
fields?: {
|
|
191
|
+
[p: string]: PropType<P>;
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* Optional function that generates a name for this item in the array
|
|
195
|
+
*/
|
|
196
|
+
nameFunc?: (item: any, ...args: ControlContext<P>) => string | undefined;
|
|
197
|
+
} & DefaultValueOrExpr<P, any> & PropTypeBase<P>) | ({
|
|
198
|
+
type: "array";
|
|
199
|
+
itemType?: {
|
|
200
|
+
type: "object";
|
|
201
|
+
fields: {
|
|
202
|
+
[p: string]: PropType<P>;
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* Optional function that generates a name for this item in the array
|
|
206
|
+
*/
|
|
207
|
+
nameFunc?: (item: any, ...args: ControlContext<P>) => string | undefined;
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* Optional function that determines whether the user can delete a given item.
|
|
211
|
+
*/
|
|
212
|
+
unstable__canDelete?: (item: any, ...args: ControlContext<P>) => boolean;
|
|
213
|
+
/**
|
|
214
|
+
* Specify how to let Plasmic know how to update its own internal representation of the data when the value has
|
|
215
|
+
* changed, or when issuing a minimalValue or shownValue that is different.
|
|
216
|
+
*
|
|
217
|
+
* Important to specify this if you are expecting any nested expression values in this data type!
|
|
218
|
+
*/
|
|
219
|
+
unstable__keyFunc?: (item: any) => any;
|
|
220
|
+
/**
|
|
221
|
+
* Specify what would be the tentative new value that is set if the user makes any changes.
|
|
222
|
+
*
|
|
223
|
+
* Useful for field mappings.
|
|
224
|
+
*
|
|
225
|
+
* For instance, consider a Table where we have a `fields` prop:
|
|
226
|
+
*
|
|
227
|
+
* - Initially, the value is undefined. But if the user makes any changes, we would want to save an array of at
|
|
228
|
+
* least three items (corresponding to, say, three columns inferred from a schema).
|
|
229
|
+
*
|
|
230
|
+
* - Let's say there are 5 columns in the value. The data schema changes, removing a column and adding two new
|
|
231
|
+
* ones. Now we would want a different minimal value, containing 6 items.
|
|
232
|
+
*/
|
|
233
|
+
unstable__minimalValue?: ContextDependentConfig<P, any>;
|
|
234
|
+
} & DefaultValueOrExpr<P, any[]> & PropTypeBase<P>) | ({
|
|
235
|
+
type: "dataSource";
|
|
236
|
+
dataSource: "airtable" | "cms";
|
|
237
|
+
} & PropTypeBase<P>);
|
|
238
|
+
type DataPickerValueType = string | number | (string | number)[];
|
|
239
|
+
export type DataPickerType<P> = ({
|
|
240
|
+
type: "dataSelector";
|
|
241
|
+
data: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
242
|
+
alwaysShowValuePathAsLabel?: boolean;
|
|
243
|
+
} & DefaultValueOrExpr<P, DataPickerValueType> & PropTypeBase<P>) | ({
|
|
244
|
+
type: "exprEditor";
|
|
245
|
+
data: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
246
|
+
} & DefaultValueOrExpr<P, DataPickerValueType> & PropTypeBase<P>);
|
|
247
|
+
export type FormValidationRulesType<P> = {
|
|
248
|
+
type: "formValidationRules";
|
|
249
|
+
} & DefaultValueOrExpr<P, any> & PropTypeBase<P>;
|
|
250
|
+
export type EventHandlerType<P> = {
|
|
251
|
+
type: "eventHandler";
|
|
252
|
+
argTypes: {
|
|
253
|
+
name: string;
|
|
254
|
+
type: PropType<any>;
|
|
255
|
+
}[];
|
|
256
|
+
} & DefaultValueOrExpr<P, (...args: any) => any> & PropTypeBase<P>;
|
|
257
|
+
interface ChoiceTypeBase<P> extends PropTypeBase<P> {
|
|
258
|
+
type: "choice";
|
|
259
|
+
options: string[] | {
|
|
260
|
+
label: string;
|
|
261
|
+
value: string | number | boolean;
|
|
262
|
+
}[] | ContextDependentConfig<P, string[] | {
|
|
263
|
+
label: string;
|
|
264
|
+
value: string | number | boolean;
|
|
265
|
+
}[]>;
|
|
266
|
+
allowSearch?: boolean;
|
|
267
|
+
filterOption?: boolean;
|
|
268
|
+
onSearch?: ContextDependentConfig<P, ((value: string) => void) | undefined>;
|
|
269
|
+
}
|
|
270
|
+
export type ChoiceType<P> = (({
|
|
271
|
+
multiSelect?: false;
|
|
272
|
+
} & DefaultValueOrExpr<P, string | number | boolean>) | ({
|
|
273
|
+
multiSelect: true;
|
|
274
|
+
} & DefaultValueOrExpr<P, (string | number | boolean)[]>) | ({
|
|
275
|
+
multiSelect: ContextDependentConfig<P, boolean>;
|
|
276
|
+
} & DefaultValueOrExpr<P, string | number | boolean | (string | number | boolean)[]>)) & ChoiceTypeBase<P>;
|
|
277
|
+
export interface ModalProps {
|
|
278
|
+
show?: boolean;
|
|
279
|
+
children?: React.ReactNode;
|
|
280
|
+
onClose: () => void;
|
|
281
|
+
style?: CSSProperties;
|
|
282
|
+
}
|
|
283
|
+
interface CustomControlProps<P> {
|
|
284
|
+
componentProps: P;
|
|
285
|
+
/**
|
|
286
|
+
* `contextData` can be `null` if the prop controls are rendering before
|
|
287
|
+
* the component instance itself (it will re-render once the component
|
|
288
|
+
* calls `setControlContextData`)
|
|
289
|
+
*/
|
|
290
|
+
contextData: InferDataType<P> | null;
|
|
291
|
+
value: any;
|
|
292
|
+
/**
|
|
293
|
+
* Sets the value to be passed to the prop. Expects a JSON-compatible value.
|
|
294
|
+
*/
|
|
295
|
+
updateValue: (newVal: any) => void;
|
|
296
|
+
/**
|
|
297
|
+
* Full screen modal component
|
|
298
|
+
*/
|
|
299
|
+
FullscreenModal: React.ComponentType<ModalProps>;
|
|
300
|
+
/**
|
|
301
|
+
* Modal component for the side pane
|
|
302
|
+
*/
|
|
303
|
+
SideModal: React.ComponentType<ModalProps>;
|
|
304
|
+
/**
|
|
305
|
+
* The document that the component will be rendered into; instead of using
|
|
306
|
+
* `document` directly (for, say, `document.querySelector()` etc.), you
|
|
307
|
+
* should use this instead.
|
|
308
|
+
*/
|
|
309
|
+
studioDocument: typeof document;
|
|
310
|
+
}
|
|
311
|
+
export type CustomControl<P> = React.ComponentType<CustomControlProps<P>>;
|
|
312
|
+
/**
|
|
313
|
+
* Expects defaultValue to be a JSON-compatible value
|
|
314
|
+
*/
|
|
315
|
+
export type CustomType<P> = CustomControl<P> | ({
|
|
316
|
+
type: "custom";
|
|
317
|
+
control: CustomControl<P>;
|
|
318
|
+
} & PropTypeBase<P> & DefaultValueOrExpr<P, any>);
|
|
319
|
+
type SlotType<P> = "slot" | ({
|
|
320
|
+
type: "slot";
|
|
321
|
+
/**
|
|
322
|
+
* The unique names of all code components that can be placed in the slot
|
|
323
|
+
*/
|
|
324
|
+
allowedComponents?: string[];
|
|
325
|
+
/**
|
|
326
|
+
* Whether the "empty slot" placeholder should be hidden in the canvas.
|
|
327
|
+
*/
|
|
328
|
+
hidePlaceholder?: boolean;
|
|
329
|
+
/**
|
|
330
|
+
* Whether the slot is repeated, i.e., is rendered multiple times using
|
|
331
|
+
* repeatedElement().
|
|
332
|
+
*/
|
|
333
|
+
isRepeated?: boolean;
|
|
334
|
+
/**
|
|
335
|
+
* A nicer, human-readable display name for your slot prop
|
|
336
|
+
*/
|
|
337
|
+
displayName?: string;
|
|
338
|
+
/**
|
|
339
|
+
* Function for whether this slot should be hidden from the left tree,
|
|
340
|
+
* given the current props for this component
|
|
341
|
+
*/
|
|
342
|
+
hidden?: ContextDependentConfig<P, boolean>;
|
|
343
|
+
/**
|
|
344
|
+
* If slot is a render prop (accepts a function that takes in some
|
|
345
|
+
* arguments and returns some JSX), then specify the names of the
|
|
346
|
+
* arguments expected by the render prop function.
|
|
347
|
+
*/
|
|
348
|
+
renderPropParams?: string[];
|
|
349
|
+
} & Omit<DefaultValueOrExpr<P, PlasmicElement | PlasmicElement[]>, "defaultValueHint" | "defaultExpr" | "defaultExprHint">);
|
|
350
|
+
type ImageUrlType<P> = "imageUrl" | ({
|
|
351
|
+
type: "imageUrl";
|
|
352
|
+
} & DefaultValueOrExpr<P, string> & PropTypeBase<P>);
|
|
353
|
+
export type PrimitiveType<P = any> = Extract<StringType<P> | BooleanType<P> | NumberType<P> | JSONLikeType<P>, String>;
|
|
354
|
+
type ControlTypeBase = {
|
|
355
|
+
editOnly?: false;
|
|
356
|
+
} | {
|
|
357
|
+
editOnly: true;
|
|
358
|
+
/**
|
|
359
|
+
* The prop where the values should be mapped to
|
|
360
|
+
*/
|
|
361
|
+
uncontrolledProp?: string;
|
|
362
|
+
};
|
|
363
|
+
export type SupportControlled<T> = Extract<T, String | CustomControl<any>> | (Exclude<T, String | CustomControl<any>> & ControlTypeBase);
|
|
364
|
+
export type PropType<P> = SupportControlled<StringType<P> | BooleanType<P> | NumberType<P> | JSONLikeType<P> | ChoiceType<P> | ImageUrlType<P> | CustomType<P> | GraphQLType<P> | DataPickerType<P> | FormValidationRulesType<P> | EventHandlerType<P>> | SlotType<P>;
|
|
365
|
+
type RestrictPropType<T, P> = T extends string ? SupportControlled<StringType<P> | ChoiceType<P> | JSONLikeType<P> | ImageUrlType<P> | CustomType<P> | DataPickerType<P>> : T extends boolean ? SupportControlled<BooleanType<P> | JSONLikeType<P> | CustomType<P> | DataPickerType<P>> : T extends number ? SupportControlled<NumberType<P> | JSONLikeType<P> | CustomType<P> | DataPickerType<P>> : PropType<P>;
|
|
366
|
+
export interface ActionProps<P> {
|
|
367
|
+
componentProps: P;
|
|
368
|
+
/**
|
|
369
|
+
* `contextData` can be `null` if the prop controls are rendering before
|
|
370
|
+
* the component instance itself (it will re-render once the component
|
|
371
|
+
* calls `setControlContextData`)
|
|
372
|
+
*/
|
|
373
|
+
contextData: InferDataType<P> | null;
|
|
374
|
+
studioOps: {
|
|
375
|
+
showModal: (modalProps: Omit<ModalProps, "onClose"> & {
|
|
376
|
+
onClose?: () => void;
|
|
377
|
+
}) => void;
|
|
378
|
+
refreshQueryData: () => void;
|
|
379
|
+
appendToSlot: (element: PlasmicElement, slotName: string) => void;
|
|
380
|
+
removeFromSlotAt: (pos: number, slotName: string) => void;
|
|
381
|
+
updateProps: (newValues: any) => void;
|
|
382
|
+
};
|
|
383
|
+
/**
|
|
384
|
+
* The document that the component will be rendered into; instead of using
|
|
385
|
+
* `document` directly (for, say, `document.querySelector()` etc.), you
|
|
386
|
+
* should use this instead.
|
|
387
|
+
*/
|
|
388
|
+
studioDocument: typeof document;
|
|
389
|
+
}
|
|
390
|
+
export type Action<P> = {
|
|
391
|
+
type: "button-action";
|
|
392
|
+
label: string;
|
|
393
|
+
onClick: (props: ActionProps<P>) => void;
|
|
394
|
+
} | {
|
|
395
|
+
type: "custom-action";
|
|
396
|
+
control: React.ComponentType<ActionProps<P>>;
|
|
397
|
+
};
|
|
398
|
+
type DistributedKeyOf<T> = T extends any ? keyof T : never;
|
|
399
|
+
interface ComponentTemplate<P> extends Omit<CodeComponentElement<P>, "type" | "name"> {
|
|
400
|
+
/**
|
|
401
|
+
* A preview picture for the template.
|
|
402
|
+
*/
|
|
403
|
+
previewImg?: string;
|
|
404
|
+
}
|
|
405
|
+
export interface ComponentTemplates<P> {
|
|
406
|
+
[name: string]: ComponentTemplate<P>;
|
|
407
|
+
}
|
|
408
|
+
export type StateSpec = {
|
|
409
|
+
onChangeProp: string;
|
|
410
|
+
} & ({
|
|
411
|
+
type: "readonly";
|
|
412
|
+
variableType: "text";
|
|
413
|
+
initVal?: string;
|
|
414
|
+
} | {
|
|
415
|
+
type: "readonly";
|
|
416
|
+
variableType: "number";
|
|
417
|
+
initVal?: number;
|
|
418
|
+
} | {
|
|
419
|
+
type: "readonly";
|
|
420
|
+
variableType: "boolean";
|
|
421
|
+
initVal?: boolean;
|
|
422
|
+
} | {
|
|
423
|
+
type: "readonly";
|
|
424
|
+
variableType: "array";
|
|
425
|
+
initVal?: any[];
|
|
426
|
+
} | {
|
|
427
|
+
type: "readonly";
|
|
428
|
+
variableType: "object";
|
|
429
|
+
initVal?: object;
|
|
430
|
+
} | {
|
|
431
|
+
type: "writable";
|
|
432
|
+
variableType: "text" | "number" | "boolean" | "array" | "object";
|
|
433
|
+
valueProp: string;
|
|
434
|
+
});
|
|
435
|
+
export interface StateHelpers<P, T> {
|
|
436
|
+
initFunc?: ($props: P) => T;
|
|
437
|
+
onChangeArgsToValue?: (...args: any) => T;
|
|
438
|
+
}
|
|
439
|
+
export type ComponentHelpers<P> = {
|
|
440
|
+
states: Record<string, StateHelpers<P, any>>;
|
|
441
|
+
};
|
|
442
|
+
export type ExternalComponentHelpers<P> = {
|
|
443
|
+
helpers: ComponentHelpers<P>;
|
|
444
|
+
importPath: string;
|
|
445
|
+
} & ({
|
|
446
|
+
importName: string;
|
|
447
|
+
} | {
|
|
448
|
+
isDefaultExport: true;
|
|
449
|
+
});
|
|
450
|
+
export type StyleSection = "visibility" | "typography" | "sizing" | "spacing" | "background" | "transform" | "transitions" | "layout" | "overflow" | "border" | "shadows" | "effects";
|
|
451
|
+
export interface CodeComponentMeta<P> {
|
|
452
|
+
/**
|
|
453
|
+
* Any unique string name used to identify that component. Each component
|
|
454
|
+
* should be registered with a different `meta.name`, even if they have the
|
|
455
|
+
* same name in the code.
|
|
456
|
+
*/
|
|
457
|
+
name: string;
|
|
458
|
+
/**
|
|
459
|
+
* The name to be displayed for the component in Studio. Optional: if not
|
|
460
|
+
* specified, `meta.name` is used.
|
|
461
|
+
*/
|
|
462
|
+
displayName?: string;
|
|
463
|
+
/**
|
|
464
|
+
* The description of the component to be shown in Studio.
|
|
465
|
+
*/
|
|
466
|
+
description?: string;
|
|
467
|
+
/**
|
|
468
|
+
* The javascript name to be used when generating code. Optional: if not
|
|
469
|
+
* provided, `meta.name` is used.
|
|
470
|
+
*/
|
|
471
|
+
importName?: string;
|
|
472
|
+
/**
|
|
473
|
+
* An object describing the component properties to be used in Studio.
|
|
474
|
+
* For each `prop`, there should be an entry `meta.props[prop]` describing
|
|
475
|
+
* its type.
|
|
476
|
+
*/
|
|
477
|
+
props: {
|
|
478
|
+
[prop in DistributedKeyOf<P>]?: RestrictPropType<P[prop], P>;
|
|
479
|
+
} & {
|
|
480
|
+
[prop: string]: PropType<P>;
|
|
481
|
+
};
|
|
482
|
+
/**
|
|
483
|
+
* An object describing the component states to be used in Studio.
|
|
484
|
+
*/
|
|
485
|
+
states?: Record<string, StateSpec>;
|
|
486
|
+
/**
|
|
487
|
+
* An object describing the components helpers to be used in Studio.
|
|
488
|
+
* 1. states helpers: Each state can receive an "initFunc" prop to initialize
|
|
489
|
+
* the implicit state in Studio, and an "onChangeArgsToValue" prop to
|
|
490
|
+
* transform the event handler arguments into a value
|
|
491
|
+
*/
|
|
492
|
+
componentHelpers?: ExternalComponentHelpers<P>;
|
|
493
|
+
/**
|
|
494
|
+
* An array describing the component actions to be used in Studio.
|
|
495
|
+
*/
|
|
496
|
+
actions?: Action<P>[];
|
|
497
|
+
/**
|
|
498
|
+
* Whether style sections should be shown in Studio. For styles to work, the
|
|
499
|
+
* component must accept a `className` prop. If unset, defaults to all styles.
|
|
500
|
+
* Set to `false` if this component cannot be styled (for example, if it doesn't
|
|
501
|
+
* render any DOM elements).
|
|
502
|
+
*/
|
|
503
|
+
styleSections?: StyleSection[] | boolean;
|
|
504
|
+
/**
|
|
505
|
+
* Whether the element can be repeated in Studio. If unset, defaults to true.
|
|
506
|
+
*/
|
|
507
|
+
isRepeatable?: boolean;
|
|
508
|
+
/**
|
|
509
|
+
* The path to be used when importing the component in the generated code.
|
|
510
|
+
* It can be the name of the package that contains the component, or the path
|
|
511
|
+
* to the file in the project (relative to the root directory).
|
|
512
|
+
*/
|
|
513
|
+
importPath: string;
|
|
514
|
+
/**
|
|
515
|
+
* Whether the component is the default export from that path. Optional: if
|
|
516
|
+
* not specified, it's considered `false`.
|
|
517
|
+
*/
|
|
518
|
+
isDefaultExport?: boolean;
|
|
519
|
+
/**
|
|
520
|
+
* The prop that expects the CSS classes with styles to be applied to the
|
|
521
|
+
* component. Optional: if not specified, Plasmic will expect it to be
|
|
522
|
+
* `className`. Notice that if the component does not accept CSS classes, the
|
|
523
|
+
* component will not be able to receive styles from the Studio.
|
|
524
|
+
*/
|
|
525
|
+
classNameProp?: string;
|
|
526
|
+
/**
|
|
527
|
+
* The prop that receives and forwards a React `ref`. Plasmic only uses `ref`
|
|
528
|
+
* to interact with components, so it's not used in the generated code.
|
|
529
|
+
* Optional: If not provided, the usual `ref` is used.
|
|
530
|
+
*/
|
|
531
|
+
refProp?: string;
|
|
532
|
+
/**
|
|
533
|
+
* Default styles to start with when instantiating the component in Plasmic.
|
|
534
|
+
*/
|
|
535
|
+
defaultStyles?: CSSProperties;
|
|
536
|
+
/**
|
|
537
|
+
* Component templates to start with on Plasmic.
|
|
538
|
+
*/
|
|
539
|
+
templates?: ComponentTemplates<P>;
|
|
540
|
+
/**
|
|
541
|
+
* Registered name of parent component, used for grouping related components.
|
|
542
|
+
*/
|
|
543
|
+
parentComponentName?: string;
|
|
544
|
+
/**
|
|
545
|
+
* Whether the component can be used as an attachment to an element.
|
|
546
|
+
*/
|
|
547
|
+
isAttachment?: boolean;
|
|
548
|
+
/**
|
|
549
|
+
* Whether the component provides data to its slots using DataProvider.
|
|
550
|
+
*/
|
|
551
|
+
providesData?: boolean;
|
|
552
|
+
/**
|
|
553
|
+
* If specified, then Figma components with the specified names will be mapped
|
|
554
|
+
* to this component when you paste Figma content into Plasmic
|
|
555
|
+
*/
|
|
556
|
+
figmaMappings?: {
|
|
557
|
+
figmaComponentName: string;
|
|
558
|
+
}[];
|
|
559
|
+
/**
|
|
560
|
+
* If true, when an instance of this component is added, the element
|
|
561
|
+
* will always be named by the name of this component.
|
|
562
|
+
*/
|
|
563
|
+
alwaysAutoName?: boolean;
|
|
564
|
+
unstable__refActions?: Record<string, RefActionRegistration<P>>;
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* @deprecated use CodeComponentMeta instead
|
|
568
|
+
*/
|
|
569
|
+
export type ComponentMeta<P> = CodeComponentMeta<P>;
|
|
570
|
+
export interface FunctionParam<P> {
|
|
571
|
+
name: string;
|
|
572
|
+
displayName?: string;
|
|
573
|
+
type: PropType<P>;
|
|
574
|
+
}
|
|
575
|
+
export interface RefActionRegistration<P> {
|
|
576
|
+
displayName?: string;
|
|
577
|
+
description?: string;
|
|
578
|
+
parameters: FunctionParam<P>[];
|
|
579
|
+
}
|
|
580
|
+
export interface ComponentRegistration {
|
|
581
|
+
component: React.ComponentType<any>;
|
|
582
|
+
meta: CodeComponentMeta<any>;
|
|
583
|
+
}
|
|
584
|
+
declare global {
|
|
585
|
+
interface Window {
|
|
586
|
+
__PlasmicComponentRegistry: ComponentRegistration[];
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
export default function registerComponent<T extends React.ComponentType<any>>(component: T, meta: CodeComponentMeta<React.ComponentProps<T>>): void;
|
|
590
|
+
export {};
|