@uniformdev/canvas-next 19.173.1-alpha.17 → 19.173.2-alpha.210

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.
@@ -3,8 +3,9 @@ import { GetServerSidePropsContext, GetServerSidePropsResult, GetServerSideProps
3
3
  import { a as UniformPreviewData } from '../models-CupnCqnn.mjs';
4
4
  import * as querystring from 'querystring';
5
5
  import { ParsedUrlQuery } from 'querystring';
6
+ import * as _uniformdev_canvas from '@uniformdev/canvas';
6
7
  import { RouteGetResponseEdgehancedComposition, RouteGetResponseNotFound, RouteGetResponseRedirect, RouteClient, RouteGetParameters, RootComponentInstance } from '@uniformdev/canvas';
7
- import { ProjectMapNodeGetResponse, ProjectMapClient } from '@uniformdev/project-map';
8
+ import { ProjectMapNodeGetRequest, ProjectMapNodeGetResponse, ProjectMapClient } from '@uniformdev/project-map';
8
9
  import { RedirectClient } from '@uniformdev/redirect';
9
10
  import { GetStaticPropsContext as GetStaticPropsContext$1, GetServerSidePropsContext as GetServerSidePropsContext$1 } from 'next/types';
10
11
  import '@uniformdev/canvas-react';
@@ -45,43 +46,25 @@ declare const withUniformGetServerSideProps: <TProps extends {
45
46
  [key: string]: any;
46
47
  } = {
47
48
  data: RootComponentInstance;
48
- }>(options?: RouteHandlerOptions<GetServerSidePropsContext<ParsedUrlQuery, UniformPreviewData>, GetServerSidePropsResult<never>, GetServerSidePropsResult<TProps>> | undefined) => GetServerSideProps<TProps, ParsedUrlQuery, UniformPreviewData>;
49
+ }>(options?: RouteHandlerOptions<GetServerSidePropsContext<ParsedUrlQuery, UniformPreviewData>, GetServerSidePropsResult<never>, GetServerSidePropsResult<TProps>>) => GetServerSideProps<TProps, ParsedUrlQuery, UniformPreviewData>;
49
50
 
50
51
  declare const withUniformGetStaticPaths: (options?: {
51
- projectMapId?: string | undefined;
52
+ projectMapId?: string;
52
53
  /** Starting path to fetch nodes from */
53
- rootPath?: string | undefined;
54
+ rootPath?: string;
54
55
  /** A string that you want prepended to paths returned by your project map. Useful when calling from a nested folder which is not part of your project map structure */
55
- prefix?: string | undefined;
56
+ prefix?: string;
56
57
  /** Set to true if you want to include draft compositions */
57
- preview?: boolean | undefined;
58
+ preview?: boolean;
58
59
  /** Way to override getNodes request params */
59
- requestOptions?: Partial<{
60
- projectMapId?: string | undefined;
61
- projectId: string;
62
- releaseId?: string | undefined;
63
- id?: string | undefined;
64
- path?: string | undefined;
65
- compositionId?: string | undefined;
66
- limit?: number | undefined;
67
- offset?: number | undefined;
68
- depth?: number | undefined;
69
- state?: number | undefined;
70
- tree?: boolean | undefined;
71
- search?: string | undefined;
72
- includeAncestors?: boolean | undefined;
73
- expanded?: boolean | undefined;
74
- withCompositionData?: boolean | undefined;
75
- withCompositionUIStatus?: boolean | undefined;
76
- withRedirectData?: boolean | undefined;
77
- }> | undefined;
60
+ requestOptions?: Partial<ProjectMapNodeGetRequest>;
78
61
  /** Way to modify list of nodes before building array of paths */
79
- callback?: ((nodes: ProjectMapNodeGetResponse['nodes']) => Promise<ProjectMapNodeGetResponse['nodes']>) | undefined;
62
+ callback?: (nodes: ProjectMapNodeGetResponse["nodes"]) => Promise<ProjectMapNodeGetResponse["nodes"]>;
80
63
  /** If you need to override the default client, you can pass it here */
81
- client?: ProjectMapClient | undefined;
64
+ client?: ProjectMapClient;
82
65
  /** If you need to override the default redirect client, you can pass it here */
83
- redirectClient?: RedirectClient | undefined;
84
- } | undefined) => () => Promise<{
66
+ redirectClient?: RedirectClient;
67
+ }) => () => Promise<{
85
68
  paths: string[];
86
69
  fallback: boolean;
87
70
  }>;
@@ -95,10 +78,10 @@ declare const withUniformGetStaticProps: <TProps extends {
95
78
  [key: string]: any;
96
79
  } = {
97
80
  data: RootComponentInstance;
98
- }>(options?: (RouteHandlerOptions<GetStaticPropsContext<ParsedUrlQuery, UniformPreviewData>, GetStaticPropsResult<never>, GetStaticPropsResult<TProps>> & {
81
+ }>(options?: RouteHandlerOptions<GetStaticPropsContext<ParsedUrlQuery, UniformPreviewData>, GetStaticPropsResult<never>, GetStaticPropsResult<TProps>> & {
99
82
  /** Name of dynamic parameter coming from getStaticPath, usually specified in page file name (e.g. [...slug].jsx will have param = 'slug' */
100
- param?: string | undefined;
101
- }) | undefined) => GetStaticProps<TProps, ParsedUrlQuery, UniformPreviewData>;
83
+ param?: string;
84
+ }) => GetStaticProps<TProps, ParsedUrlQuery, UniformPreviewData>;
102
85
 
103
86
  /**
104
87
  * Prepends correct locale to the path before sending it to Uniform Route API.
@@ -117,303 +100,7 @@ declare const prependLocale: (path: string, { locale, defaultLocale, locales }:
117
100
  * export getServerSideProps = withUniformGetServerSideProps({ ... });
118
101
  */
119
102
  declare const getServerSideProps: next.GetServerSideProps<{
120
- data: {
121
- type: string;
122
- parameters?: {
123
- [key: string]: {
124
- value?: unknown;
125
- type: string;
126
- connectedData?: {
127
- pointer: string;
128
- syntax: "jptr";
129
- failureAction?: "t" | "p" | "c" | "a" | undefined;
130
- failureLogLevel?: "e" | "w" | "i" | undefined;
131
- failureDefault?: string | undefined;
132
- } | undefined;
133
- locales?: {
134
- [key: string]: unknown;
135
- } | undefined;
136
- conditions?: {
137
- when: {
138
- op?: "&" | "|" | undefined;
139
- clauses: (any | {
140
- rule: string;
141
- source?: string | undefined;
142
- op: string;
143
- value: string | string[];
144
- })[];
145
- };
146
- value: unknown;
147
- id: number;
148
- }[] | undefined;
149
- localesConditions?: {
150
- [key: string]: {
151
- when: {
152
- op?: "&" | "|" | undefined;
153
- clauses: (any | {
154
- rule: string;
155
- source?: string | undefined;
156
- op: string;
157
- value: string | string[];
158
- })[];
159
- };
160
- value: unknown;
161
- id: number;
162
- }[];
163
- } | undefined;
164
- };
165
- } | undefined;
166
- variant?: string | undefined;
167
- projectMapNodes?: {
168
- id: string;
169
- path: string;
170
- projectMapId: string;
171
- data?: {
172
- isSearchHit?: boolean | undefined;
173
- queryStrings?: {
174
- name: string;
175
- value?: string | undefined;
176
- helpText?: string | undefined;
177
- }[] | undefined;
178
- previewValue?: string | undefined;
179
- } | undefined;
180
- locales?: {
181
- [key: string]: {
182
- path: string;
183
- inherited: boolean;
184
- };
185
- } | undefined;
186
- }[] | undefined;
187
- slots?: {
188
- [key: string]: {
189
- type: string;
190
- parameters?: {
191
- [key: string]: {
192
- value?: unknown;
193
- type: string;
194
- connectedData?: {
195
- pointer: string;
196
- syntax: "jptr";
197
- failureAction?: "t" | "p" | "c" | "a" | undefined;
198
- failureLogLevel?: "e" | "w" | "i" | undefined;
199
- failureDefault?: string | undefined;
200
- } | undefined;
201
- locales?: {
202
- [key: string]: unknown;
203
- } | undefined;
204
- conditions?: {
205
- when: {
206
- op?: "&" | "|" | undefined;
207
- clauses: (any | {
208
- rule: string;
209
- source?: string | undefined;
210
- op: string;
211
- value: string | string[];
212
- })[];
213
- };
214
- value: unknown;
215
- id: number;
216
- }[] | undefined;
217
- localesConditions?: {
218
- [key: string]: {
219
- when: {
220
- op?: "&" | "|" | undefined;
221
- clauses: (any | {
222
- rule: string;
223
- source?: string | undefined;
224
- op: string;
225
- value: string | string[];
226
- })[];
227
- };
228
- value: unknown;
229
- id: number;
230
- }[];
231
- } | undefined;
232
- };
233
- } | undefined;
234
- variant?: string | undefined;
235
- slots?: {
236
- [key: string]: any[];
237
- } | undefined;
238
- _id?: string | undefined;
239
- _pattern?: string | undefined;
240
- _dataResources?: {
241
- [key: string]: {
242
- type: string;
243
- isPatternParameter?: boolean | undefined;
244
- ignorePatternParameterDefault?: boolean | undefined;
245
- optionalPatternParameter?: boolean | undefined;
246
- variables?: {
247
- [key: string]: string;
248
- } | undefined;
249
- };
250
- } | undefined;
251
- _patternDataResources?: {
252
- [key: string]: {
253
- type: string;
254
- isPatternParameter?: boolean | undefined;
255
- ignorePatternParameterDefault?: boolean | undefined;
256
- optionalPatternParameter?: boolean | undefined;
257
- variables?: {
258
- [key: string]: string;
259
- } | undefined;
260
- };
261
- } | undefined;
262
- _patternError?: "NOTFOUND" | "CYCLIC" | undefined;
263
- _overrides?: {
264
- [key: string]: {
265
- parameters?: {
266
- [key: string]: {
267
- value?: unknown;
268
- type: string;
269
- connectedData?: {
270
- pointer: string;
271
- syntax: "jptr";
272
- failureAction?: "t" | "p" | "c" | "a" | undefined;
273
- failureLogLevel?: "e" | "w" | "i" | undefined;
274
- failureDefault?: string | undefined;
275
- } | undefined;
276
- locales?: {
277
- [key: string]: unknown;
278
- } | undefined;
279
- conditions?: {
280
- when: {
281
- op?: "&" | "|" | undefined;
282
- clauses: (any | {
283
- rule: string;
284
- source?: string | undefined;
285
- op: string;
286
- value: string | string[];
287
- })[];
288
- };
289
- value: unknown;
290
- id: number;
291
- }[] | undefined;
292
- localesConditions?: {
293
- [key: string]: {
294
- when: {
295
- op?: "&" | "|" | undefined;
296
- clauses: (any | {
297
- rule: string;
298
- source?: string | undefined;
299
- op: string;
300
- value: string | string[];
301
- })[];
302
- };
303
- value: unknown;
304
- id: number;
305
- }[];
306
- } | undefined;
307
- };
308
- } | undefined;
309
- slots?: {
310
- [key: string]: any[];
311
- } | undefined;
312
- variant?: string | undefined;
313
- };
314
- } | undefined;
315
- _overridability?: {
316
- parameters?: {
317
- [key: string]: "yes" | "no";
318
- } | undefined;
319
- variants?: boolean | undefined;
320
- hideLockedParameters?: boolean | undefined;
321
- } | undefined;
322
- _locales?: string[] | undefined;
323
- }[];
324
- } | undefined;
325
- _id: string;
326
- _slug?: string | null | undefined;
327
- _name: string;
328
- _author?: string | undefined;
329
- _authorSubject?: string | undefined;
330
- _creator?: string | undefined;
331
- _creatorSubject?: string | undefined;
332
- _pattern?: string | undefined;
333
- _patternDataResources?: {
334
- [key: string]: {
335
- type: string;
336
- isPatternParameter?: boolean | undefined;
337
- ignorePatternParameterDefault?: boolean | undefined;
338
- optionalPatternParameter?: boolean | undefined;
339
- variables?: {
340
- [key: string]: string;
341
- } | undefined;
342
- };
343
- } | undefined;
344
- _dataResources?: {
345
- [key: string]: {
346
- type: string;
347
- isPatternParameter?: boolean | undefined;
348
- ignorePatternParameterDefault?: boolean | undefined;
349
- optionalPatternParameter?: boolean | undefined;
350
- variables?: {
351
- [key: string]: string;
352
- } | undefined;
353
- };
354
- } | undefined;
355
- _patternError?: "NOTFOUND" | "CYCLIC" | undefined;
356
- _overrides?: {
357
- [key: string]: {
358
- parameters?: {
359
- [key: string]: {
360
- value?: unknown;
361
- type: string;
362
- connectedData?: {
363
- pointer: string;
364
- syntax: "jptr";
365
- failureAction?: "t" | "p" | "c" | "a" | undefined;
366
- failureLogLevel?: "e" | "w" | "i" | undefined;
367
- failureDefault?: string | undefined;
368
- } | undefined;
369
- locales?: {
370
- [key: string]: unknown;
371
- } | undefined;
372
- conditions?: {
373
- when: {
374
- op?: "&" | "|" | undefined;
375
- clauses: (any | {
376
- rule: string;
377
- source?: string | undefined;
378
- op: string;
379
- value: string | string[];
380
- })[];
381
- };
382
- value: unknown;
383
- id: number;
384
- }[] | undefined;
385
- localesConditions?: {
386
- [key: string]: {
387
- when: {
388
- op?: "&" | "|" | undefined;
389
- clauses: (any | {
390
- rule: string;
391
- source?: string | undefined;
392
- op: string;
393
- value: string | string[];
394
- })[];
395
- };
396
- value: unknown;
397
- id: number;
398
- }[];
399
- } | undefined;
400
- };
401
- } | undefined;
402
- slots?: {
403
- [key: string]: any[];
404
- } | undefined;
405
- variant?: string | undefined;
406
- };
407
- } | undefined;
408
- _overridability?: {
409
- parameters?: {
410
- [key: string]: "yes" | "no";
411
- } | undefined;
412
- variants?: boolean | undefined;
413
- hideLockedParameters?: boolean | undefined;
414
- } | undefined;
415
- _locales?: string[] | undefined;
416
- };
103
+ data: _uniformdev_canvas.RootComponentInstance;
417
104
  }, querystring.ParsedUrlQuery, UniformPreviewData>;
418
105
  /**
419
106
  * Default implementation of getStaticProps with routes
@@ -421,303 +108,7 @@ declare const getServerSideProps: next.GetServerSideProps<{
421
108
  * export getStaticProps = withUniformGetStaticProps({ ... });
422
109
  */
423
110
  declare const getStaticProps: next.GetStaticProps<{
424
- data: {
425
- type: string;
426
- parameters?: {
427
- [key: string]: {
428
- value?: unknown;
429
- type: string;
430
- connectedData?: {
431
- pointer: string;
432
- syntax: "jptr";
433
- failureAction?: "t" | "p" | "c" | "a" | undefined;
434
- failureLogLevel?: "e" | "w" | "i" | undefined;
435
- failureDefault?: string | undefined;
436
- } | undefined;
437
- locales?: {
438
- [key: string]: unknown;
439
- } | undefined;
440
- conditions?: {
441
- when: {
442
- op?: "&" | "|" | undefined;
443
- clauses: (any | {
444
- rule: string;
445
- source?: string | undefined;
446
- op: string;
447
- value: string | string[];
448
- })[];
449
- };
450
- value: unknown;
451
- id: number;
452
- }[] | undefined;
453
- localesConditions?: {
454
- [key: string]: {
455
- when: {
456
- op?: "&" | "|" | undefined;
457
- clauses: (any | {
458
- rule: string;
459
- source?: string | undefined;
460
- op: string;
461
- value: string | string[];
462
- })[];
463
- };
464
- value: unknown;
465
- id: number;
466
- }[];
467
- } | undefined;
468
- };
469
- } | undefined;
470
- variant?: string | undefined;
471
- projectMapNodes?: {
472
- id: string;
473
- path: string;
474
- projectMapId: string;
475
- data?: {
476
- isSearchHit?: boolean | undefined;
477
- queryStrings?: {
478
- name: string;
479
- value?: string | undefined;
480
- helpText?: string | undefined;
481
- }[] | undefined;
482
- previewValue?: string | undefined;
483
- } | undefined;
484
- locales?: {
485
- [key: string]: {
486
- path: string;
487
- inherited: boolean;
488
- };
489
- } | undefined;
490
- }[] | undefined;
491
- slots?: {
492
- [key: string]: {
493
- type: string;
494
- parameters?: {
495
- [key: string]: {
496
- value?: unknown;
497
- type: string;
498
- connectedData?: {
499
- pointer: string;
500
- syntax: "jptr";
501
- failureAction?: "t" | "p" | "c" | "a" | undefined;
502
- failureLogLevel?: "e" | "w" | "i" | undefined;
503
- failureDefault?: string | undefined;
504
- } | undefined;
505
- locales?: {
506
- [key: string]: unknown;
507
- } | undefined;
508
- conditions?: {
509
- when: {
510
- op?: "&" | "|" | undefined;
511
- clauses: (any | {
512
- rule: string;
513
- source?: string | undefined;
514
- op: string;
515
- value: string | string[];
516
- })[];
517
- };
518
- value: unknown;
519
- id: number;
520
- }[] | undefined;
521
- localesConditions?: {
522
- [key: string]: {
523
- when: {
524
- op?: "&" | "|" | undefined;
525
- clauses: (any | {
526
- rule: string;
527
- source?: string | undefined;
528
- op: string;
529
- value: string | string[];
530
- })[];
531
- };
532
- value: unknown;
533
- id: number;
534
- }[];
535
- } | undefined;
536
- };
537
- } | undefined;
538
- variant?: string | undefined;
539
- slots?: {
540
- [key: string]: any[];
541
- } | undefined;
542
- _id?: string | undefined;
543
- _pattern?: string | undefined;
544
- _dataResources?: {
545
- [key: string]: {
546
- type: string;
547
- isPatternParameter?: boolean | undefined;
548
- ignorePatternParameterDefault?: boolean | undefined;
549
- optionalPatternParameter?: boolean | undefined;
550
- variables?: {
551
- [key: string]: string;
552
- } | undefined;
553
- };
554
- } | undefined;
555
- _patternDataResources?: {
556
- [key: string]: {
557
- type: string;
558
- isPatternParameter?: boolean | undefined;
559
- ignorePatternParameterDefault?: boolean | undefined;
560
- optionalPatternParameter?: boolean | undefined;
561
- variables?: {
562
- [key: string]: string;
563
- } | undefined;
564
- };
565
- } | undefined;
566
- _patternError?: "NOTFOUND" | "CYCLIC" | undefined;
567
- _overrides?: {
568
- [key: string]: {
569
- parameters?: {
570
- [key: string]: {
571
- value?: unknown;
572
- type: string;
573
- connectedData?: {
574
- pointer: string;
575
- syntax: "jptr";
576
- failureAction?: "t" | "p" | "c" | "a" | undefined;
577
- failureLogLevel?: "e" | "w" | "i" | undefined;
578
- failureDefault?: string | undefined;
579
- } | undefined;
580
- locales?: {
581
- [key: string]: unknown;
582
- } | undefined;
583
- conditions?: {
584
- when: {
585
- op?: "&" | "|" | undefined;
586
- clauses: (any | {
587
- rule: string;
588
- source?: string | undefined;
589
- op: string;
590
- value: string | string[];
591
- })[];
592
- };
593
- value: unknown;
594
- id: number;
595
- }[] | undefined;
596
- localesConditions?: {
597
- [key: string]: {
598
- when: {
599
- op?: "&" | "|" | undefined;
600
- clauses: (any | {
601
- rule: string;
602
- source?: string | undefined;
603
- op: string;
604
- value: string | string[];
605
- })[];
606
- };
607
- value: unknown;
608
- id: number;
609
- }[];
610
- } | undefined;
611
- };
612
- } | undefined;
613
- slots?: {
614
- [key: string]: any[];
615
- } | undefined;
616
- variant?: string | undefined;
617
- };
618
- } | undefined;
619
- _overridability?: {
620
- parameters?: {
621
- [key: string]: "yes" | "no";
622
- } | undefined;
623
- variants?: boolean | undefined;
624
- hideLockedParameters?: boolean | undefined;
625
- } | undefined;
626
- _locales?: string[] | undefined;
627
- }[];
628
- } | undefined;
629
- _id: string;
630
- _slug?: string | null | undefined;
631
- _name: string;
632
- _author?: string | undefined;
633
- _authorSubject?: string | undefined;
634
- _creator?: string | undefined;
635
- _creatorSubject?: string | undefined;
636
- _pattern?: string | undefined;
637
- _patternDataResources?: {
638
- [key: string]: {
639
- type: string;
640
- isPatternParameter?: boolean | undefined;
641
- ignorePatternParameterDefault?: boolean | undefined;
642
- optionalPatternParameter?: boolean | undefined;
643
- variables?: {
644
- [key: string]: string;
645
- } | undefined;
646
- };
647
- } | undefined;
648
- _dataResources?: {
649
- [key: string]: {
650
- type: string;
651
- isPatternParameter?: boolean | undefined;
652
- ignorePatternParameterDefault?: boolean | undefined;
653
- optionalPatternParameter?: boolean | undefined;
654
- variables?: {
655
- [key: string]: string;
656
- } | undefined;
657
- };
658
- } | undefined;
659
- _patternError?: "NOTFOUND" | "CYCLIC" | undefined;
660
- _overrides?: {
661
- [key: string]: {
662
- parameters?: {
663
- [key: string]: {
664
- value?: unknown;
665
- type: string;
666
- connectedData?: {
667
- pointer: string;
668
- syntax: "jptr";
669
- failureAction?: "t" | "p" | "c" | "a" | undefined;
670
- failureLogLevel?: "e" | "w" | "i" | undefined;
671
- failureDefault?: string | undefined;
672
- } | undefined;
673
- locales?: {
674
- [key: string]: unknown;
675
- } | undefined;
676
- conditions?: {
677
- when: {
678
- op?: "&" | "|" | undefined;
679
- clauses: (any | {
680
- rule: string;
681
- source?: string | undefined;
682
- op: string;
683
- value: string | string[];
684
- })[];
685
- };
686
- value: unknown;
687
- id: number;
688
- }[] | undefined;
689
- localesConditions?: {
690
- [key: string]: {
691
- when: {
692
- op?: "&" | "|" | undefined;
693
- clauses: (any | {
694
- rule: string;
695
- source?: string | undefined;
696
- op: string;
697
- value: string | string[];
698
- })[];
699
- };
700
- value: unknown;
701
- id: number;
702
- }[];
703
- } | undefined;
704
- };
705
- } | undefined;
706
- slots?: {
707
- [key: string]: any[];
708
- } | undefined;
709
- variant?: string | undefined;
710
- };
711
- } | undefined;
712
- _overridability?: {
713
- parameters?: {
714
- [key: string]: "yes" | "no";
715
- } | undefined;
716
- variants?: boolean | undefined;
717
- hideLockedParameters?: boolean | undefined;
718
- } | undefined;
719
- _locales?: string[] | undefined;
720
- };
111
+ data: _uniformdev_canvas.RootComponentInstance;
721
112
  }, querystring.ParsedUrlQuery, UniformPreviewData>;
722
113
  /**
723
114
  * Default implementation of getStaticPaths with routes