@makeswift/prop-controllers 0.1.0-canary.2 → 0.1.0-canary.4

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,57 +1,965 @@
1
- import { ControlDataTypeKey, CopyContext, Options, Types } from '../prop-controllers';
2
- type OpenPageLink = {
3
- type: 'OPEN_PAGE';
1
+ import { CopyContext, Options, Types } from '../prop-controllers';
2
+ import { z } from 'zod';
3
+ export declare const linkDataSchema: z.ZodUnion<[z.ZodObject<{
4
+ type: z.ZodLiteral<"OPEN_PAGE">;
5
+ payload: z.ZodEffects<z.ZodObject<{
6
+ pageId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7
+ openInNewTab: z.ZodBoolean;
8
+ }, "strip", z.ZodTypeAny, {
9
+ openInNewTab: boolean;
10
+ pageId?: string | null | undefined;
11
+ }, {
12
+ openInNewTab: boolean;
13
+ pageId?: string | null | undefined;
14
+ }>, {
15
+ openInNewTab: boolean;
16
+ pageId: string | null | undefined;
17
+ }, {
18
+ openInNewTab: boolean;
19
+ pageId?: string | null | undefined;
20
+ }>;
21
+ }, "strip", z.ZodTypeAny, {
22
+ type: "OPEN_PAGE";
4
23
  payload: {
24
+ openInNewTab: boolean;
5
25
  pageId: string | null | undefined;
26
+ };
27
+ }, {
28
+ type: "OPEN_PAGE";
29
+ payload: {
6
30
  openInNewTab: boolean;
31
+ pageId?: string | null | undefined;
7
32
  };
8
- };
9
- type OpenURLLink = {
10
- type: 'OPEN_URL';
33
+ }>, z.ZodObject<{
34
+ type: z.ZodLiteral<"OPEN_URL">;
35
+ payload: z.ZodObject<{
36
+ url: z.ZodString;
37
+ openInNewTab: z.ZodBoolean;
38
+ }, "strip", z.ZodTypeAny, {
39
+ openInNewTab: boolean;
40
+ url: string;
41
+ }, {
42
+ openInNewTab: boolean;
43
+ url: string;
44
+ }>;
45
+ }, "strip", z.ZodTypeAny, {
46
+ type: "OPEN_URL";
11
47
  payload: {
48
+ openInNewTab: boolean;
12
49
  url: string;
50
+ };
51
+ }, {
52
+ type: "OPEN_URL";
53
+ payload: {
13
54
  openInNewTab: boolean;
55
+ url: string;
14
56
  };
15
- };
16
- type SendEmailLink = {
17
- type: 'SEND_EMAIL';
57
+ }>, z.ZodObject<{
58
+ type: z.ZodLiteral<"SEND_EMAIL">;
59
+ payload: z.ZodObject<{
60
+ to: z.ZodString;
61
+ subject: z.ZodOptional<z.ZodString>;
62
+ body: z.ZodOptional<z.ZodString>;
63
+ }, "strip", z.ZodTypeAny, {
64
+ to: string;
65
+ subject?: string | undefined;
66
+ body?: string | undefined;
67
+ }, {
68
+ to: string;
69
+ subject?: string | undefined;
70
+ body?: string | undefined;
71
+ }>;
72
+ }, "strip", z.ZodTypeAny, {
73
+ type: "SEND_EMAIL";
18
74
  payload: {
19
75
  to: string;
20
- subject?: string;
21
- body?: string;
76
+ subject?: string | undefined;
77
+ body?: string | undefined;
22
78
  };
23
- };
24
- type CallPhoneLink = {
25
- type: 'CALL_PHONE';
79
+ }, {
80
+ type: "SEND_EMAIL";
81
+ payload: {
82
+ to: string;
83
+ subject?: string | undefined;
84
+ body?: string | undefined;
85
+ };
86
+ }>, z.ZodObject<{
87
+ type: z.ZodLiteral<"CALL_PHONE">;
88
+ payload: z.ZodObject<{
89
+ phoneNumber: z.ZodString;
90
+ }, "strip", z.ZodTypeAny, {
91
+ phoneNumber: string;
92
+ }, {
93
+ phoneNumber: string;
94
+ }>;
95
+ }, "strip", z.ZodTypeAny, {
96
+ type: "CALL_PHONE";
26
97
  payload: {
27
98
  phoneNumber: string;
28
99
  };
29
- };
30
- type ScrollToElementLink = {
31
- type: 'SCROLL_TO_ELEMENT';
100
+ }, {
101
+ type: "CALL_PHONE";
32
102
  payload: {
103
+ phoneNumber: string;
104
+ };
105
+ }>, z.ZodObject<{
106
+ type: z.ZodLiteral<"SCROLL_TO_ELEMENT">;
107
+ payload: z.ZodEffects<z.ZodObject<{
108
+ elementIdConfig: z.ZodOptional<z.ZodNullable<z.ZodObject<{
109
+ elementKey: z.ZodString;
110
+ propName: z.ZodString;
111
+ }, "strip", z.ZodTypeAny, {
112
+ elementKey: string;
113
+ propName: string;
114
+ }, {
115
+ elementKey: string;
116
+ propName: string;
117
+ }>>>;
118
+ block: z.ZodUnion<[z.ZodLiteral<"start">, z.ZodLiteral<"center">, z.ZodLiteral<"end">]>;
119
+ }, "strip", z.ZodTypeAny, {
120
+ block: "start" | "center" | "end";
121
+ elementIdConfig?: {
122
+ elementKey: string;
123
+ propName: string;
124
+ } | null | undefined;
125
+ }, {
126
+ block: "start" | "center" | "end";
127
+ elementIdConfig?: {
128
+ elementKey: string;
129
+ propName: string;
130
+ } | null | undefined;
131
+ }>, {
132
+ block: "start" | "center" | "end";
133
+ elementIdConfig: {
134
+ elementKey: string;
135
+ propName: string;
136
+ } | null | undefined;
137
+ }, {
138
+ block: "start" | "center" | "end";
139
+ elementIdConfig?: {
140
+ elementKey: string;
141
+ propName: string;
142
+ } | null | undefined;
143
+ }>;
144
+ }, "strip", z.ZodTypeAny, {
145
+ type: "SCROLL_TO_ELEMENT";
146
+ payload: {
147
+ block: "start" | "center" | "end";
33
148
  elementIdConfig: {
34
149
  elementKey: string;
35
150
  propName: string;
36
151
  } | null | undefined;
37
- block: 'start' | 'center' | 'end';
38
152
  };
39
- };
40
- type Link = OpenPageLink | OpenURLLink | SendEmailLink | CallPhoneLink | ScrollToElementLink;
41
- export type LinkData = Link;
42
- export type LinkPropControllerDataV0 = Link;
153
+ }, {
154
+ type: "SCROLL_TO_ELEMENT";
155
+ payload: {
156
+ block: "start" | "center" | "end";
157
+ elementIdConfig?: {
158
+ elementKey: string;
159
+ propName: string;
160
+ } | null | undefined;
161
+ };
162
+ }>]>;
163
+ export type LinkData = z.infer<typeof linkDataSchema>;
164
+ declare const linkPropControllerDataV0Schema: z.ZodUnion<[z.ZodObject<{
165
+ type: z.ZodLiteral<"OPEN_PAGE">;
166
+ payload: z.ZodEffects<z.ZodObject<{
167
+ pageId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
168
+ openInNewTab: z.ZodBoolean;
169
+ }, "strip", z.ZodTypeAny, {
170
+ openInNewTab: boolean;
171
+ pageId?: string | null | undefined;
172
+ }, {
173
+ openInNewTab: boolean;
174
+ pageId?: string | null | undefined;
175
+ }>, {
176
+ openInNewTab: boolean;
177
+ pageId: string | null | undefined;
178
+ }, {
179
+ openInNewTab: boolean;
180
+ pageId?: string | null | undefined;
181
+ }>;
182
+ }, "strip", z.ZodTypeAny, {
183
+ type: "OPEN_PAGE";
184
+ payload: {
185
+ openInNewTab: boolean;
186
+ pageId: string | null | undefined;
187
+ };
188
+ }, {
189
+ type: "OPEN_PAGE";
190
+ payload: {
191
+ openInNewTab: boolean;
192
+ pageId?: string | null | undefined;
193
+ };
194
+ }>, z.ZodObject<{
195
+ type: z.ZodLiteral<"OPEN_URL">;
196
+ payload: z.ZodObject<{
197
+ url: z.ZodString;
198
+ openInNewTab: z.ZodBoolean;
199
+ }, "strip", z.ZodTypeAny, {
200
+ openInNewTab: boolean;
201
+ url: string;
202
+ }, {
203
+ openInNewTab: boolean;
204
+ url: string;
205
+ }>;
206
+ }, "strip", z.ZodTypeAny, {
207
+ type: "OPEN_URL";
208
+ payload: {
209
+ openInNewTab: boolean;
210
+ url: string;
211
+ };
212
+ }, {
213
+ type: "OPEN_URL";
214
+ payload: {
215
+ openInNewTab: boolean;
216
+ url: string;
217
+ };
218
+ }>, z.ZodObject<{
219
+ type: z.ZodLiteral<"SEND_EMAIL">;
220
+ payload: z.ZodObject<{
221
+ to: z.ZodString;
222
+ subject: z.ZodOptional<z.ZodString>;
223
+ body: z.ZodOptional<z.ZodString>;
224
+ }, "strip", z.ZodTypeAny, {
225
+ to: string;
226
+ subject?: string | undefined;
227
+ body?: string | undefined;
228
+ }, {
229
+ to: string;
230
+ subject?: string | undefined;
231
+ body?: string | undefined;
232
+ }>;
233
+ }, "strip", z.ZodTypeAny, {
234
+ type: "SEND_EMAIL";
235
+ payload: {
236
+ to: string;
237
+ subject?: string | undefined;
238
+ body?: string | undefined;
239
+ };
240
+ }, {
241
+ type: "SEND_EMAIL";
242
+ payload: {
243
+ to: string;
244
+ subject?: string | undefined;
245
+ body?: string | undefined;
246
+ };
247
+ }>, z.ZodObject<{
248
+ type: z.ZodLiteral<"CALL_PHONE">;
249
+ payload: z.ZodObject<{
250
+ phoneNumber: z.ZodString;
251
+ }, "strip", z.ZodTypeAny, {
252
+ phoneNumber: string;
253
+ }, {
254
+ phoneNumber: string;
255
+ }>;
256
+ }, "strip", z.ZodTypeAny, {
257
+ type: "CALL_PHONE";
258
+ payload: {
259
+ phoneNumber: string;
260
+ };
261
+ }, {
262
+ type: "CALL_PHONE";
263
+ payload: {
264
+ phoneNumber: string;
265
+ };
266
+ }>, z.ZodObject<{
267
+ type: z.ZodLiteral<"SCROLL_TO_ELEMENT">;
268
+ payload: z.ZodEffects<z.ZodObject<{
269
+ elementIdConfig: z.ZodOptional<z.ZodNullable<z.ZodObject<{
270
+ elementKey: z.ZodString;
271
+ propName: z.ZodString;
272
+ }, "strip", z.ZodTypeAny, {
273
+ elementKey: string;
274
+ propName: string;
275
+ }, {
276
+ elementKey: string;
277
+ propName: string;
278
+ }>>>;
279
+ block: z.ZodUnion<[z.ZodLiteral<"start">, z.ZodLiteral<"center">, z.ZodLiteral<"end">]>;
280
+ }, "strip", z.ZodTypeAny, {
281
+ block: "start" | "center" | "end";
282
+ elementIdConfig?: {
283
+ elementKey: string;
284
+ propName: string;
285
+ } | null | undefined;
286
+ }, {
287
+ block: "start" | "center" | "end";
288
+ elementIdConfig?: {
289
+ elementKey: string;
290
+ propName: string;
291
+ } | null | undefined;
292
+ }>, {
293
+ block: "start" | "center" | "end";
294
+ elementIdConfig: {
295
+ elementKey: string;
296
+ propName: string;
297
+ } | null | undefined;
298
+ }, {
299
+ block: "start" | "center" | "end";
300
+ elementIdConfig?: {
301
+ elementKey: string;
302
+ propName: string;
303
+ } | null | undefined;
304
+ }>;
305
+ }, "strip", z.ZodTypeAny, {
306
+ type: "SCROLL_TO_ELEMENT";
307
+ payload: {
308
+ block: "start" | "center" | "end";
309
+ elementIdConfig: {
310
+ elementKey: string;
311
+ propName: string;
312
+ } | null | undefined;
313
+ };
314
+ }, {
315
+ type: "SCROLL_TO_ELEMENT";
316
+ payload: {
317
+ block: "start" | "center" | "end";
318
+ elementIdConfig?: {
319
+ elementKey: string;
320
+ propName: string;
321
+ } | null | undefined;
322
+ };
323
+ }>]>;
324
+ export type LinkPropControllerDataV0 = z.infer<typeof linkPropControllerDataV0Schema>;
43
325
  export declare const LinkPropControllerDataV1Type = "prop-controllers::link::v1";
44
- export type LinkPropControllerDataV1 = {
45
- [ControlDataTypeKey]: typeof LinkPropControllerDataV1Type;
46
- value: Link;
47
- };
48
- export type LinkPropControllerData = LinkPropControllerDataV0 | LinkPropControllerDataV1;
49
- export type LinkOptions = Options<{
326
+ declare const linkPropControllerDataV1Schema: z.ZodObject<{
327
+ "@@makeswift/type": z.ZodLiteral<"prop-controllers::link::v1">;
328
+ value: z.ZodUnion<[z.ZodObject<{
329
+ type: z.ZodLiteral<"OPEN_PAGE">;
330
+ payload: z.ZodEffects<z.ZodObject<{
331
+ pageId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
332
+ openInNewTab: z.ZodBoolean;
333
+ }, "strip", z.ZodTypeAny, {
334
+ openInNewTab: boolean;
335
+ pageId?: string | null | undefined;
336
+ }, {
337
+ openInNewTab: boolean;
338
+ pageId?: string | null | undefined;
339
+ }>, {
340
+ openInNewTab: boolean;
341
+ pageId: string | null | undefined;
342
+ }, {
343
+ openInNewTab: boolean;
344
+ pageId?: string | null | undefined;
345
+ }>;
346
+ }, "strip", z.ZodTypeAny, {
347
+ type: "OPEN_PAGE";
348
+ payload: {
349
+ openInNewTab: boolean;
350
+ pageId: string | null | undefined;
351
+ };
352
+ }, {
353
+ type: "OPEN_PAGE";
354
+ payload: {
355
+ openInNewTab: boolean;
356
+ pageId?: string | null | undefined;
357
+ };
358
+ }>, z.ZodObject<{
359
+ type: z.ZodLiteral<"OPEN_URL">;
360
+ payload: z.ZodObject<{
361
+ url: z.ZodString;
362
+ openInNewTab: z.ZodBoolean;
363
+ }, "strip", z.ZodTypeAny, {
364
+ openInNewTab: boolean;
365
+ url: string;
366
+ }, {
367
+ openInNewTab: boolean;
368
+ url: string;
369
+ }>;
370
+ }, "strip", z.ZodTypeAny, {
371
+ type: "OPEN_URL";
372
+ payload: {
373
+ openInNewTab: boolean;
374
+ url: string;
375
+ };
376
+ }, {
377
+ type: "OPEN_URL";
378
+ payload: {
379
+ openInNewTab: boolean;
380
+ url: string;
381
+ };
382
+ }>, z.ZodObject<{
383
+ type: z.ZodLiteral<"SEND_EMAIL">;
384
+ payload: z.ZodObject<{
385
+ to: z.ZodString;
386
+ subject: z.ZodOptional<z.ZodString>;
387
+ body: z.ZodOptional<z.ZodString>;
388
+ }, "strip", z.ZodTypeAny, {
389
+ to: string;
390
+ subject?: string | undefined;
391
+ body?: string | undefined;
392
+ }, {
393
+ to: string;
394
+ subject?: string | undefined;
395
+ body?: string | undefined;
396
+ }>;
397
+ }, "strip", z.ZodTypeAny, {
398
+ type: "SEND_EMAIL";
399
+ payload: {
400
+ to: string;
401
+ subject?: string | undefined;
402
+ body?: string | undefined;
403
+ };
404
+ }, {
405
+ type: "SEND_EMAIL";
406
+ payload: {
407
+ to: string;
408
+ subject?: string | undefined;
409
+ body?: string | undefined;
410
+ };
411
+ }>, z.ZodObject<{
412
+ type: z.ZodLiteral<"CALL_PHONE">;
413
+ payload: z.ZodObject<{
414
+ phoneNumber: z.ZodString;
415
+ }, "strip", z.ZodTypeAny, {
416
+ phoneNumber: string;
417
+ }, {
418
+ phoneNumber: string;
419
+ }>;
420
+ }, "strip", z.ZodTypeAny, {
421
+ type: "CALL_PHONE";
422
+ payload: {
423
+ phoneNumber: string;
424
+ };
425
+ }, {
426
+ type: "CALL_PHONE";
427
+ payload: {
428
+ phoneNumber: string;
429
+ };
430
+ }>, z.ZodObject<{
431
+ type: z.ZodLiteral<"SCROLL_TO_ELEMENT">;
432
+ payload: z.ZodEffects<z.ZodObject<{
433
+ elementIdConfig: z.ZodOptional<z.ZodNullable<z.ZodObject<{
434
+ elementKey: z.ZodString;
435
+ propName: z.ZodString;
436
+ }, "strip", z.ZodTypeAny, {
437
+ elementKey: string;
438
+ propName: string;
439
+ }, {
440
+ elementKey: string;
441
+ propName: string;
442
+ }>>>;
443
+ block: z.ZodUnion<[z.ZodLiteral<"start">, z.ZodLiteral<"center">, z.ZodLiteral<"end">]>;
444
+ }, "strip", z.ZodTypeAny, {
445
+ block: "start" | "center" | "end";
446
+ elementIdConfig?: {
447
+ elementKey: string;
448
+ propName: string;
449
+ } | null | undefined;
450
+ }, {
451
+ block: "start" | "center" | "end";
452
+ elementIdConfig?: {
453
+ elementKey: string;
454
+ propName: string;
455
+ } | null | undefined;
456
+ }>, {
457
+ block: "start" | "center" | "end";
458
+ elementIdConfig: {
459
+ elementKey: string;
460
+ propName: string;
461
+ } | null | undefined;
462
+ }, {
463
+ block: "start" | "center" | "end";
464
+ elementIdConfig?: {
465
+ elementKey: string;
466
+ propName: string;
467
+ } | null | undefined;
468
+ }>;
469
+ }, "strip", z.ZodTypeAny, {
470
+ type: "SCROLL_TO_ELEMENT";
471
+ payload: {
472
+ block: "start" | "center" | "end";
473
+ elementIdConfig: {
474
+ elementKey: string;
475
+ propName: string;
476
+ } | null | undefined;
477
+ };
478
+ }, {
479
+ type: "SCROLL_TO_ELEMENT";
480
+ payload: {
481
+ block: "start" | "center" | "end";
482
+ elementIdConfig?: {
483
+ elementKey: string;
484
+ propName: string;
485
+ } | null | undefined;
486
+ };
487
+ }>]>;
488
+ }, "strip", z.ZodTypeAny, {
489
+ value: {
490
+ type: "OPEN_PAGE";
491
+ payload: {
492
+ openInNewTab: boolean;
493
+ pageId: string | null | undefined;
494
+ };
495
+ } | {
496
+ type: "OPEN_URL";
497
+ payload: {
498
+ openInNewTab: boolean;
499
+ url: string;
500
+ };
501
+ } | {
502
+ type: "SEND_EMAIL";
503
+ payload: {
504
+ to: string;
505
+ subject?: string | undefined;
506
+ body?: string | undefined;
507
+ };
508
+ } | {
509
+ type: "CALL_PHONE";
510
+ payload: {
511
+ phoneNumber: string;
512
+ };
513
+ } | {
514
+ type: "SCROLL_TO_ELEMENT";
515
+ payload: {
516
+ block: "start" | "center" | "end";
517
+ elementIdConfig: {
518
+ elementKey: string;
519
+ propName: string;
520
+ } | null | undefined;
521
+ };
522
+ };
523
+ "@@makeswift/type": "prop-controllers::link::v1";
524
+ }, {
525
+ value: {
526
+ type: "OPEN_PAGE";
527
+ payload: {
528
+ openInNewTab: boolean;
529
+ pageId?: string | null | undefined;
530
+ };
531
+ } | {
532
+ type: "OPEN_URL";
533
+ payload: {
534
+ openInNewTab: boolean;
535
+ url: string;
536
+ };
537
+ } | {
538
+ type: "SEND_EMAIL";
539
+ payload: {
540
+ to: string;
541
+ subject?: string | undefined;
542
+ body?: string | undefined;
543
+ };
544
+ } | {
545
+ type: "CALL_PHONE";
546
+ payload: {
547
+ phoneNumber: string;
548
+ };
549
+ } | {
550
+ type: "SCROLL_TO_ELEMENT";
551
+ payload: {
552
+ block: "start" | "center" | "end";
553
+ elementIdConfig?: {
554
+ elementKey: string;
555
+ propName: string;
556
+ } | null | undefined;
557
+ };
558
+ };
559
+ "@@makeswift/type": "prop-controllers::link::v1";
560
+ }>;
561
+ export type LinkPropControllerDataV1 = z.infer<typeof linkPropControllerDataV1Schema>;
562
+ export declare const linkPropControllerDataSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
563
+ type: z.ZodLiteral<"OPEN_PAGE">;
564
+ payload: z.ZodEffects<z.ZodObject<{
565
+ pageId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
566
+ openInNewTab: z.ZodBoolean;
567
+ }, "strip", z.ZodTypeAny, {
568
+ openInNewTab: boolean;
569
+ pageId?: string | null | undefined;
570
+ }, {
571
+ openInNewTab: boolean;
572
+ pageId?: string | null | undefined;
573
+ }>, {
574
+ openInNewTab: boolean;
575
+ pageId: string | null | undefined;
576
+ }, {
577
+ openInNewTab: boolean;
578
+ pageId?: string | null | undefined;
579
+ }>;
580
+ }, "strip", z.ZodTypeAny, {
581
+ type: "OPEN_PAGE";
582
+ payload: {
583
+ openInNewTab: boolean;
584
+ pageId: string | null | undefined;
585
+ };
586
+ }, {
587
+ type: "OPEN_PAGE";
588
+ payload: {
589
+ openInNewTab: boolean;
590
+ pageId?: string | null | undefined;
591
+ };
592
+ }>, z.ZodObject<{
593
+ type: z.ZodLiteral<"OPEN_URL">;
594
+ payload: z.ZodObject<{
595
+ url: z.ZodString;
596
+ openInNewTab: z.ZodBoolean;
597
+ }, "strip", z.ZodTypeAny, {
598
+ openInNewTab: boolean;
599
+ url: string;
600
+ }, {
601
+ openInNewTab: boolean;
602
+ url: string;
603
+ }>;
604
+ }, "strip", z.ZodTypeAny, {
605
+ type: "OPEN_URL";
606
+ payload: {
607
+ openInNewTab: boolean;
608
+ url: string;
609
+ };
610
+ }, {
611
+ type: "OPEN_URL";
612
+ payload: {
613
+ openInNewTab: boolean;
614
+ url: string;
615
+ };
616
+ }>, z.ZodObject<{
617
+ type: z.ZodLiteral<"SEND_EMAIL">;
618
+ payload: z.ZodObject<{
619
+ to: z.ZodString;
620
+ subject: z.ZodOptional<z.ZodString>;
621
+ body: z.ZodOptional<z.ZodString>;
622
+ }, "strip", z.ZodTypeAny, {
623
+ to: string;
624
+ subject?: string | undefined;
625
+ body?: string | undefined;
626
+ }, {
627
+ to: string;
628
+ subject?: string | undefined;
629
+ body?: string | undefined;
630
+ }>;
631
+ }, "strip", z.ZodTypeAny, {
632
+ type: "SEND_EMAIL";
633
+ payload: {
634
+ to: string;
635
+ subject?: string | undefined;
636
+ body?: string | undefined;
637
+ };
638
+ }, {
639
+ type: "SEND_EMAIL";
640
+ payload: {
641
+ to: string;
642
+ subject?: string | undefined;
643
+ body?: string | undefined;
644
+ };
645
+ }>, z.ZodObject<{
646
+ type: z.ZodLiteral<"CALL_PHONE">;
647
+ payload: z.ZodObject<{
648
+ phoneNumber: z.ZodString;
649
+ }, "strip", z.ZodTypeAny, {
650
+ phoneNumber: string;
651
+ }, {
652
+ phoneNumber: string;
653
+ }>;
654
+ }, "strip", z.ZodTypeAny, {
655
+ type: "CALL_PHONE";
656
+ payload: {
657
+ phoneNumber: string;
658
+ };
659
+ }, {
660
+ type: "CALL_PHONE";
661
+ payload: {
662
+ phoneNumber: string;
663
+ };
664
+ }>, z.ZodObject<{
665
+ type: z.ZodLiteral<"SCROLL_TO_ELEMENT">;
666
+ payload: z.ZodEffects<z.ZodObject<{
667
+ elementIdConfig: z.ZodOptional<z.ZodNullable<z.ZodObject<{
668
+ elementKey: z.ZodString;
669
+ propName: z.ZodString;
670
+ }, "strip", z.ZodTypeAny, {
671
+ elementKey: string;
672
+ propName: string;
673
+ }, {
674
+ elementKey: string;
675
+ propName: string;
676
+ }>>>;
677
+ block: z.ZodUnion<[z.ZodLiteral<"start">, z.ZodLiteral<"center">, z.ZodLiteral<"end">]>;
678
+ }, "strip", z.ZodTypeAny, {
679
+ block: "start" | "center" | "end";
680
+ elementIdConfig?: {
681
+ elementKey: string;
682
+ propName: string;
683
+ } | null | undefined;
684
+ }, {
685
+ block: "start" | "center" | "end";
686
+ elementIdConfig?: {
687
+ elementKey: string;
688
+ propName: string;
689
+ } | null | undefined;
690
+ }>, {
691
+ block: "start" | "center" | "end";
692
+ elementIdConfig: {
693
+ elementKey: string;
694
+ propName: string;
695
+ } | null | undefined;
696
+ }, {
697
+ block: "start" | "center" | "end";
698
+ elementIdConfig?: {
699
+ elementKey: string;
700
+ propName: string;
701
+ } | null | undefined;
702
+ }>;
703
+ }, "strip", z.ZodTypeAny, {
704
+ type: "SCROLL_TO_ELEMENT";
705
+ payload: {
706
+ block: "start" | "center" | "end";
707
+ elementIdConfig: {
708
+ elementKey: string;
709
+ propName: string;
710
+ } | null | undefined;
711
+ };
712
+ }, {
713
+ type: "SCROLL_TO_ELEMENT";
714
+ payload: {
715
+ block: "start" | "center" | "end";
716
+ elementIdConfig?: {
717
+ elementKey: string;
718
+ propName: string;
719
+ } | null | undefined;
720
+ };
721
+ }>]>, z.ZodObject<{
722
+ "@@makeswift/type": z.ZodLiteral<"prop-controllers::link::v1">;
723
+ value: z.ZodUnion<[z.ZodObject<{
724
+ type: z.ZodLiteral<"OPEN_PAGE">;
725
+ payload: z.ZodEffects<z.ZodObject<{
726
+ pageId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
727
+ openInNewTab: z.ZodBoolean;
728
+ }, "strip", z.ZodTypeAny, {
729
+ openInNewTab: boolean;
730
+ pageId?: string | null | undefined;
731
+ }, {
732
+ openInNewTab: boolean;
733
+ pageId?: string | null | undefined;
734
+ }>, {
735
+ openInNewTab: boolean;
736
+ pageId: string | null | undefined;
737
+ }, {
738
+ openInNewTab: boolean;
739
+ pageId?: string | null | undefined;
740
+ }>;
741
+ }, "strip", z.ZodTypeAny, {
742
+ type: "OPEN_PAGE";
743
+ payload: {
744
+ openInNewTab: boolean;
745
+ pageId: string | null | undefined;
746
+ };
747
+ }, {
748
+ type: "OPEN_PAGE";
749
+ payload: {
750
+ openInNewTab: boolean;
751
+ pageId?: string | null | undefined;
752
+ };
753
+ }>, z.ZodObject<{
754
+ type: z.ZodLiteral<"OPEN_URL">;
755
+ payload: z.ZodObject<{
756
+ url: z.ZodString;
757
+ openInNewTab: z.ZodBoolean;
758
+ }, "strip", z.ZodTypeAny, {
759
+ openInNewTab: boolean;
760
+ url: string;
761
+ }, {
762
+ openInNewTab: boolean;
763
+ url: string;
764
+ }>;
765
+ }, "strip", z.ZodTypeAny, {
766
+ type: "OPEN_URL";
767
+ payload: {
768
+ openInNewTab: boolean;
769
+ url: string;
770
+ };
771
+ }, {
772
+ type: "OPEN_URL";
773
+ payload: {
774
+ openInNewTab: boolean;
775
+ url: string;
776
+ };
777
+ }>, z.ZodObject<{
778
+ type: z.ZodLiteral<"SEND_EMAIL">;
779
+ payload: z.ZodObject<{
780
+ to: z.ZodString;
781
+ subject: z.ZodOptional<z.ZodString>;
782
+ body: z.ZodOptional<z.ZodString>;
783
+ }, "strip", z.ZodTypeAny, {
784
+ to: string;
785
+ subject?: string | undefined;
786
+ body?: string | undefined;
787
+ }, {
788
+ to: string;
789
+ subject?: string | undefined;
790
+ body?: string | undefined;
791
+ }>;
792
+ }, "strip", z.ZodTypeAny, {
793
+ type: "SEND_EMAIL";
794
+ payload: {
795
+ to: string;
796
+ subject?: string | undefined;
797
+ body?: string | undefined;
798
+ };
799
+ }, {
800
+ type: "SEND_EMAIL";
801
+ payload: {
802
+ to: string;
803
+ subject?: string | undefined;
804
+ body?: string | undefined;
805
+ };
806
+ }>, z.ZodObject<{
807
+ type: z.ZodLiteral<"CALL_PHONE">;
808
+ payload: z.ZodObject<{
809
+ phoneNumber: z.ZodString;
810
+ }, "strip", z.ZodTypeAny, {
811
+ phoneNumber: string;
812
+ }, {
813
+ phoneNumber: string;
814
+ }>;
815
+ }, "strip", z.ZodTypeAny, {
816
+ type: "CALL_PHONE";
817
+ payload: {
818
+ phoneNumber: string;
819
+ };
820
+ }, {
821
+ type: "CALL_PHONE";
822
+ payload: {
823
+ phoneNumber: string;
824
+ };
825
+ }>, z.ZodObject<{
826
+ type: z.ZodLiteral<"SCROLL_TO_ELEMENT">;
827
+ payload: z.ZodEffects<z.ZodObject<{
828
+ elementIdConfig: z.ZodOptional<z.ZodNullable<z.ZodObject<{
829
+ elementKey: z.ZodString;
830
+ propName: z.ZodString;
831
+ }, "strip", z.ZodTypeAny, {
832
+ elementKey: string;
833
+ propName: string;
834
+ }, {
835
+ elementKey: string;
836
+ propName: string;
837
+ }>>>;
838
+ block: z.ZodUnion<[z.ZodLiteral<"start">, z.ZodLiteral<"center">, z.ZodLiteral<"end">]>;
839
+ }, "strip", z.ZodTypeAny, {
840
+ block: "start" | "center" | "end";
841
+ elementIdConfig?: {
842
+ elementKey: string;
843
+ propName: string;
844
+ } | null | undefined;
845
+ }, {
846
+ block: "start" | "center" | "end";
847
+ elementIdConfig?: {
848
+ elementKey: string;
849
+ propName: string;
850
+ } | null | undefined;
851
+ }>, {
852
+ block: "start" | "center" | "end";
853
+ elementIdConfig: {
854
+ elementKey: string;
855
+ propName: string;
856
+ } | null | undefined;
857
+ }, {
858
+ block: "start" | "center" | "end";
859
+ elementIdConfig?: {
860
+ elementKey: string;
861
+ propName: string;
862
+ } | null | undefined;
863
+ }>;
864
+ }, "strip", z.ZodTypeAny, {
865
+ type: "SCROLL_TO_ELEMENT";
866
+ payload: {
867
+ block: "start" | "center" | "end";
868
+ elementIdConfig: {
869
+ elementKey: string;
870
+ propName: string;
871
+ } | null | undefined;
872
+ };
873
+ }, {
874
+ type: "SCROLL_TO_ELEMENT";
875
+ payload: {
876
+ block: "start" | "center" | "end";
877
+ elementIdConfig?: {
878
+ elementKey: string;
879
+ propName: string;
880
+ } | null | undefined;
881
+ };
882
+ }>]>;
883
+ }, "strip", z.ZodTypeAny, {
884
+ value: {
885
+ type: "OPEN_PAGE";
886
+ payload: {
887
+ openInNewTab: boolean;
888
+ pageId: string | null | undefined;
889
+ };
890
+ } | {
891
+ type: "OPEN_URL";
892
+ payload: {
893
+ openInNewTab: boolean;
894
+ url: string;
895
+ };
896
+ } | {
897
+ type: "SEND_EMAIL";
898
+ payload: {
899
+ to: string;
900
+ subject?: string | undefined;
901
+ body?: string | undefined;
902
+ };
903
+ } | {
904
+ type: "CALL_PHONE";
905
+ payload: {
906
+ phoneNumber: string;
907
+ };
908
+ } | {
909
+ type: "SCROLL_TO_ELEMENT";
910
+ payload: {
911
+ block: "start" | "center" | "end";
912
+ elementIdConfig: {
913
+ elementKey: string;
914
+ propName: string;
915
+ } | null | undefined;
916
+ };
917
+ };
918
+ "@@makeswift/type": "prop-controllers::link::v1";
919
+ }, {
920
+ value: {
921
+ type: "OPEN_PAGE";
922
+ payload: {
923
+ openInNewTab: boolean;
924
+ pageId?: string | null | undefined;
925
+ };
926
+ } | {
927
+ type: "OPEN_URL";
928
+ payload: {
929
+ openInNewTab: boolean;
930
+ url: string;
931
+ };
932
+ } | {
933
+ type: "SEND_EMAIL";
934
+ payload: {
935
+ to: string;
936
+ subject?: string | undefined;
937
+ body?: string | undefined;
938
+ };
939
+ } | {
940
+ type: "CALL_PHONE";
941
+ payload: {
942
+ phoneNumber: string;
943
+ };
944
+ } | {
945
+ type: "SCROLL_TO_ELEMENT";
946
+ payload: {
947
+ block: "start" | "center" | "end";
948
+ elementIdConfig?: {
949
+ elementKey: string;
950
+ propName: string;
951
+ } | null | undefined;
952
+ };
953
+ };
954
+ "@@makeswift/type": "prop-controllers::link::v1";
955
+ }>]>;
956
+ export type LinkPropControllerData = z.infer<typeof linkPropControllerDataSchema>;
957
+ type LinkOptions = Options<{
50
958
  preset?: LinkPropControllerData;
51
959
  label?: string;
52
- defaultValue?: Link;
960
+ defaultValue?: LinkData;
53
961
  options?: {
54
- value: Link['type'];
962
+ value: LinkData['type'];
55
963
  label: string;
56
964
  }[];
57
965
  hidden?: boolean;
@@ -66,14 +974,16 @@ type LinkDescriptorV1<_T = LinkPropControllerData, U extends LinkOptions = LinkO
66
974
  options: U;
67
975
  };
68
976
  export type LinkDescriptor<_T = LinkPropControllerData, U extends LinkOptions = LinkOptions> = LinkDescriptorV0<_T, U> | LinkDescriptorV1<_T, U>;
69
- export type LinkPropControllerValue = Link;
70
- export declare function getLinkPropControllerValue(data: LinkPropControllerData): LinkPropControllerValue;
71
- export declare function getLinkPropControllerPageIds(linkData: LinkPropControllerData | null | undefined): string[];
72
- export declare function copyLinkPropControllerData(data: LinkPropControllerData | undefined, context: CopyContext): LinkPropControllerData | undefined;
977
+ export type ResolveLinkPropControllerValue<T extends LinkDescriptor> = T extends LinkDescriptor ? LinkData | undefined : never;
73
978
  /**
74
979
  * @deprecated Imports from `@makeswift/prop-controllers` are deprecated. Use
75
980
  * `@makeswift/runtime/controls` instead.
76
981
  */
77
982
  export declare function Link(options?: LinkOptions): LinkDescriptor;
983
+ export declare function getLinkPropControllerDataLinkData(data: LinkPropControllerData): LinkData;
984
+ export declare function createLinkPropControllerDataFromLinkData(value: LinkData, definition: LinkDescriptor): LinkPropControllerData;
985
+ export declare function getLinkPropControllerPageIds(linkData: LinkPropControllerData | null | undefined): string[];
986
+ export declare function copyLinkData(data: LinkData | undefined, context: CopyContext): LinkData | undefined;
987
+ export declare function copyLinkPropControllerData(data: LinkPropControllerData | undefined, context: CopyContext): LinkPropControllerData | undefined;
78
988
  export {};
79
989
  //# sourceMappingURL=link.d.ts.map