@uniformdev/canvas-react 20.7.1-alpha.12 → 20.7.1-alpha.121
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/LICENSE.txt +1 -1
- package/dist/index.d.mts +206 -20
- package/dist/index.d.ts +206 -20
- package/dist/index.esm.js +158 -120
- package/dist/index.js +177 -143
- package/dist/index.mjs +158 -120
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import React$1, { Key, ReactNode, PropsWithChildren } from 'react';
|
|
|
2
2
|
import { ComponentInstance, RootComponentInstance, UpdateCompositionMessage, getParameterAttributes as getParameterAttributes$1, UpdateContextualEditingStateInternalMessage } from '@uniformdev/canvas';
|
|
3
3
|
export { GetParameterAttributesProps, createUniformApiEnhancer } from '@uniformdev/canvas';
|
|
4
4
|
import { P as PureUniformTextProps } from './PureUniformText-B3GAm6Dc.js';
|
|
5
|
+
import { CompositionMetadata } from '@uniformdev/context';
|
|
5
6
|
import { RichTextNode } from '@uniformdev/richtext';
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -125,7 +126,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
125
126
|
source?: string;
|
|
126
127
|
op: string;
|
|
127
128
|
value: string | string[];
|
|
128
|
-
} | any)[];
|
|
129
|
+
} | /*elided*/ any)[];
|
|
129
130
|
};
|
|
130
131
|
value: unknown;
|
|
131
132
|
id: number;
|
|
@@ -139,7 +140,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
139
140
|
source?: string;
|
|
140
141
|
op: string;
|
|
141
142
|
value: string | string[];
|
|
142
|
-
} | any)[];
|
|
143
|
+
} | /*elided*/ any)[];
|
|
143
144
|
};
|
|
144
145
|
value: unknown;
|
|
145
146
|
id: number;
|
|
@@ -158,6 +159,13 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
158
159
|
name: string;
|
|
159
160
|
value?: string;
|
|
160
161
|
helpText?: string;
|
|
162
|
+
optionsSource?: {
|
|
163
|
+
source: "static";
|
|
164
|
+
options: {
|
|
165
|
+
name: string;
|
|
166
|
+
value: string;
|
|
167
|
+
}[];
|
|
168
|
+
};
|
|
161
169
|
}[];
|
|
162
170
|
previewValue?: string;
|
|
163
171
|
};
|
|
@@ -193,7 +201,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
193
201
|
source?: string;
|
|
194
202
|
op: string;
|
|
195
203
|
value: string | string[];
|
|
196
|
-
} | any)[];
|
|
204
|
+
} | /*elided*/ any)[];
|
|
197
205
|
};
|
|
198
206
|
value: unknown;
|
|
199
207
|
id: number;
|
|
@@ -207,7 +215,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
207
215
|
source?: string;
|
|
208
216
|
op: string;
|
|
209
217
|
value: string | string[];
|
|
210
|
-
} | any)[];
|
|
218
|
+
} | /*elided*/ any)[];
|
|
211
219
|
};
|
|
212
220
|
value: unknown;
|
|
213
221
|
id: number;
|
|
@@ -217,7 +225,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
217
225
|
};
|
|
218
226
|
variant?: string;
|
|
219
227
|
slots?: {
|
|
220
|
-
[key: string]: any[];
|
|
228
|
+
[key: string]: /*elided*/ any[];
|
|
221
229
|
};
|
|
222
230
|
_id?: string;
|
|
223
231
|
_pattern?: string;
|
|
@@ -268,7 +276,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
268
276
|
source?: string;
|
|
269
277
|
op: string;
|
|
270
278
|
value: string | string[];
|
|
271
|
-
} | any)[];
|
|
279
|
+
} | /*elided*/ any)[];
|
|
272
280
|
};
|
|
273
281
|
value: unknown;
|
|
274
282
|
id: number;
|
|
@@ -282,7 +290,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
282
290
|
source?: string;
|
|
283
291
|
op: string;
|
|
284
292
|
value: string | string[];
|
|
285
|
-
} | any)[];
|
|
293
|
+
} | /*elided*/ any)[];
|
|
286
294
|
};
|
|
287
295
|
value: unknown;
|
|
288
296
|
id: number;
|
|
@@ -291,7 +299,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
291
299
|
};
|
|
292
300
|
};
|
|
293
301
|
slots?: {
|
|
294
|
-
[key: string]: any[];
|
|
302
|
+
[key: string]: /*elided*/ any[];
|
|
295
303
|
};
|
|
296
304
|
variant?: string;
|
|
297
305
|
dataResources?: {
|
|
@@ -331,7 +339,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
331
339
|
source?: string;
|
|
332
340
|
op: string;
|
|
333
341
|
value: string | string[];
|
|
334
|
-
} | any)[];
|
|
342
|
+
} | /*elided*/ any)[];
|
|
335
343
|
};
|
|
336
344
|
value: unknown;
|
|
337
345
|
id: number;
|
|
@@ -345,7 +353,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
345
353
|
source?: string;
|
|
346
354
|
op: string;
|
|
347
355
|
value: string | string[];
|
|
348
|
-
} | any)[];
|
|
356
|
+
} | /*elided*/ any)[];
|
|
349
357
|
};
|
|
350
358
|
value: unknown;
|
|
351
359
|
id: number;
|
|
@@ -354,7 +362,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
354
362
|
};
|
|
355
363
|
};
|
|
356
364
|
slots?: {
|
|
357
|
-
[key: string]: any[];
|
|
365
|
+
[key: string]: /*elided*/ any[];
|
|
358
366
|
};
|
|
359
367
|
variant?: string;
|
|
360
368
|
dataResources?: {
|
|
@@ -435,7 +443,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
435
443
|
source?: string;
|
|
436
444
|
op: string;
|
|
437
445
|
value: string | string[];
|
|
438
|
-
} | any)[];
|
|
446
|
+
} | /*elided*/ any)[];
|
|
439
447
|
};
|
|
440
448
|
value: unknown;
|
|
441
449
|
id: number;
|
|
@@ -449,7 +457,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
449
457
|
source?: string;
|
|
450
458
|
op: string;
|
|
451
459
|
value: string | string[];
|
|
452
|
-
} | any)[];
|
|
460
|
+
} | /*elided*/ any)[];
|
|
453
461
|
};
|
|
454
462
|
value: unknown;
|
|
455
463
|
id: number;
|
|
@@ -458,7 +466,96 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
458
466
|
};
|
|
459
467
|
};
|
|
460
468
|
slots?: {
|
|
461
|
-
[key: string]:
|
|
469
|
+
[key: string]: {
|
|
470
|
+
type: string;
|
|
471
|
+
parameters?: {
|
|
472
|
+
[key: string]: {
|
|
473
|
+
value?: unknown;
|
|
474
|
+
type: string;
|
|
475
|
+
connectedData?: {
|
|
476
|
+
pointer: string;
|
|
477
|
+
syntax: "jptr";
|
|
478
|
+
failureAction?: "t" | "p" | "c" | "a";
|
|
479
|
+
failureLogLevel?: "e" | "w" | "i";
|
|
480
|
+
failureDefault?: string;
|
|
481
|
+
};
|
|
482
|
+
locales?: {
|
|
483
|
+
[key: string]: unknown;
|
|
484
|
+
};
|
|
485
|
+
conditions?: {
|
|
486
|
+
when: {
|
|
487
|
+
op?: "&" | "|";
|
|
488
|
+
clauses: ({
|
|
489
|
+
rule: string;
|
|
490
|
+
source?: string;
|
|
491
|
+
op: string;
|
|
492
|
+
value: string | string[];
|
|
493
|
+
} | /*elided*/ any)[];
|
|
494
|
+
};
|
|
495
|
+
value: unknown;
|
|
496
|
+
id: number;
|
|
497
|
+
}[];
|
|
498
|
+
localesConditions?: {
|
|
499
|
+
[key: string]: {
|
|
500
|
+
when: {
|
|
501
|
+
op?: "&" | "|";
|
|
502
|
+
clauses: ({
|
|
503
|
+
rule: string;
|
|
504
|
+
source?: string;
|
|
505
|
+
op: string;
|
|
506
|
+
value: string | string[];
|
|
507
|
+
} | /*elided*/ any)[];
|
|
508
|
+
};
|
|
509
|
+
value: unknown;
|
|
510
|
+
id: number;
|
|
511
|
+
}[];
|
|
512
|
+
};
|
|
513
|
+
};
|
|
514
|
+
};
|
|
515
|
+
variant?: string;
|
|
516
|
+
slots?: {
|
|
517
|
+
[key: string]: /*elided*/ any[];
|
|
518
|
+
};
|
|
519
|
+
_id?: string;
|
|
520
|
+
_pattern?: string;
|
|
521
|
+
_dataResources?: {
|
|
522
|
+
[key: string]: {
|
|
523
|
+
type: string;
|
|
524
|
+
isPatternParameter?: boolean;
|
|
525
|
+
ignorePatternParameterDefault?: boolean;
|
|
526
|
+
optionalPatternParameter?: boolean;
|
|
527
|
+
variables?: {
|
|
528
|
+
[key: string]: string;
|
|
529
|
+
};
|
|
530
|
+
};
|
|
531
|
+
};
|
|
532
|
+
_patternDataResources?: {
|
|
533
|
+
[key: string]: {
|
|
534
|
+
type: string;
|
|
535
|
+
isPatternParameter?: boolean;
|
|
536
|
+
ignorePatternParameterDefault?: boolean;
|
|
537
|
+
optionalPatternParameter?: boolean;
|
|
538
|
+
variables?: {
|
|
539
|
+
[key: string]: string;
|
|
540
|
+
};
|
|
541
|
+
};
|
|
542
|
+
};
|
|
543
|
+
_patternError?: "NOTFOUND" | "CYCLIC";
|
|
544
|
+
_overrides?: {
|
|
545
|
+
[key: string]: /*elided*/ any;
|
|
546
|
+
};
|
|
547
|
+
_patternOverrides?: {
|
|
548
|
+
[key: string]: /*elided*/ any;
|
|
549
|
+
};
|
|
550
|
+
_overridability?: {
|
|
551
|
+
parameters?: {
|
|
552
|
+
[key: string]: "yes" | "no";
|
|
553
|
+
};
|
|
554
|
+
variants?: boolean;
|
|
555
|
+
hideLockedParameters?: boolean;
|
|
556
|
+
};
|
|
557
|
+
_locales?: string[];
|
|
558
|
+
}[];
|
|
462
559
|
};
|
|
463
560
|
variant?: string;
|
|
464
561
|
dataResources?: {
|
|
@@ -498,7 +595,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
498
595
|
source?: string;
|
|
499
596
|
op: string;
|
|
500
597
|
value: string | string[];
|
|
501
|
-
} | any)[];
|
|
598
|
+
} | /*elided*/ any)[];
|
|
502
599
|
};
|
|
503
600
|
value: unknown;
|
|
504
601
|
id: number;
|
|
@@ -512,7 +609,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
512
609
|
source?: string;
|
|
513
610
|
op: string;
|
|
514
611
|
value: string | string[];
|
|
515
|
-
} | any)[];
|
|
612
|
+
} | /*elided*/ any)[];
|
|
516
613
|
};
|
|
517
614
|
value: unknown;
|
|
518
615
|
id: number;
|
|
@@ -521,7 +618,96 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
521
618
|
};
|
|
522
619
|
};
|
|
523
620
|
slots?: {
|
|
524
|
-
[key: string]:
|
|
621
|
+
[key: string]: {
|
|
622
|
+
type: string;
|
|
623
|
+
parameters?: {
|
|
624
|
+
[key: string]: {
|
|
625
|
+
value?: unknown;
|
|
626
|
+
type: string;
|
|
627
|
+
connectedData?: {
|
|
628
|
+
pointer: string;
|
|
629
|
+
syntax: "jptr";
|
|
630
|
+
failureAction?: "t" | "p" | "c" | "a";
|
|
631
|
+
failureLogLevel?: "e" | "w" | "i";
|
|
632
|
+
failureDefault?: string;
|
|
633
|
+
};
|
|
634
|
+
locales?: {
|
|
635
|
+
[key: string]: unknown;
|
|
636
|
+
};
|
|
637
|
+
conditions?: {
|
|
638
|
+
when: {
|
|
639
|
+
op?: "&" | "|";
|
|
640
|
+
clauses: ({
|
|
641
|
+
rule: string;
|
|
642
|
+
source?: string;
|
|
643
|
+
op: string;
|
|
644
|
+
value: string | string[];
|
|
645
|
+
} | /*elided*/ any)[];
|
|
646
|
+
};
|
|
647
|
+
value: unknown;
|
|
648
|
+
id: number;
|
|
649
|
+
}[];
|
|
650
|
+
localesConditions?: {
|
|
651
|
+
[key: string]: {
|
|
652
|
+
when: {
|
|
653
|
+
op?: "&" | "|";
|
|
654
|
+
clauses: ({
|
|
655
|
+
rule: string;
|
|
656
|
+
source?: string;
|
|
657
|
+
op: string;
|
|
658
|
+
value: string | string[];
|
|
659
|
+
} | /*elided*/ any)[];
|
|
660
|
+
};
|
|
661
|
+
value: unknown;
|
|
662
|
+
id: number;
|
|
663
|
+
}[];
|
|
664
|
+
};
|
|
665
|
+
};
|
|
666
|
+
};
|
|
667
|
+
variant?: string;
|
|
668
|
+
slots?: {
|
|
669
|
+
[key: string]: /*elided*/ any[];
|
|
670
|
+
};
|
|
671
|
+
_id?: string;
|
|
672
|
+
_pattern?: string;
|
|
673
|
+
_dataResources?: {
|
|
674
|
+
[key: string]: {
|
|
675
|
+
type: string;
|
|
676
|
+
isPatternParameter?: boolean;
|
|
677
|
+
ignorePatternParameterDefault?: boolean;
|
|
678
|
+
optionalPatternParameter?: boolean;
|
|
679
|
+
variables?: {
|
|
680
|
+
[key: string]: string;
|
|
681
|
+
};
|
|
682
|
+
};
|
|
683
|
+
};
|
|
684
|
+
_patternDataResources?: {
|
|
685
|
+
[key: string]: {
|
|
686
|
+
type: string;
|
|
687
|
+
isPatternParameter?: boolean;
|
|
688
|
+
ignorePatternParameterDefault?: boolean;
|
|
689
|
+
optionalPatternParameter?: boolean;
|
|
690
|
+
variables?: {
|
|
691
|
+
[key: string]: string;
|
|
692
|
+
};
|
|
693
|
+
};
|
|
694
|
+
};
|
|
695
|
+
_patternError?: "NOTFOUND" | "CYCLIC";
|
|
696
|
+
_overrides?: {
|
|
697
|
+
[key: string]: /*elided*/ any;
|
|
698
|
+
};
|
|
699
|
+
_patternOverrides?: {
|
|
700
|
+
[key: string]: /*elided*/ any;
|
|
701
|
+
};
|
|
702
|
+
_overridability?: {
|
|
703
|
+
parameters?: {
|
|
704
|
+
[key: string]: "yes" | "no";
|
|
705
|
+
};
|
|
706
|
+
variants?: boolean;
|
|
707
|
+
hideLockedParameters?: boolean;
|
|
708
|
+
};
|
|
709
|
+
_locales?: string[];
|
|
710
|
+
}[];
|
|
525
711
|
};
|
|
526
712
|
variant?: string;
|
|
527
713
|
dataResources?: {
|
|
@@ -549,12 +735,12 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
549
735
|
isContextualEditing: boolean;
|
|
550
736
|
};
|
|
551
737
|
|
|
552
|
-
type UniformCompositionProps<TRenderProps = unknown> = UniformComponentProps<TRenderProps> & {
|
|
738
|
+
type UniformCompositionProps<TRenderProps = unknown> = UniformComponentProps<TRenderProps> & Omit<CompositionMetadata, 'compositionId'> & {
|
|
553
739
|
/** The composition data */
|
|
554
740
|
data?: RootComponentInstance;
|
|
555
741
|
contextualEditingEnhancer?: UseUniformContextualEditingProps['enhance'];
|
|
556
742
|
};
|
|
557
|
-
type UniformCompositionContextValue = {
|
|
743
|
+
type UniformCompositionContextValue = Omit<CompositionMetadata, 'compositionId'> & {
|
|
558
744
|
data: UniformCompositionProps['data'] | undefined;
|
|
559
745
|
resolveRenderer?: UniformCompositionProps['resolveRenderer'];
|
|
560
746
|
behaviorTracking?: UniformCompositionProps['behaviorTracking'];
|
|
@@ -570,7 +756,7 @@ declare function useUniformCurrentComposition(): UniformCompositionContextValue;
|
|
|
570
756
|
* It renders the full tree of components, and provides some services to the children, such as `useUniformCurrentComposition`.
|
|
571
757
|
* It also takes care of enabling [Contextual Editing](https://docs.uniform.app/capabilities/composition/contextual-editing).
|
|
572
758
|
*/
|
|
573
|
-
declare function UniformComposition<TRenderProps = unknown>({ data, behaviorTracking, children, resolveRenderer, contextualEditingEnhancer, contextualEditingDefaultPlaceholder, }: UniformCompositionProps<TRenderProps>): React$1.JSX.Element;
|
|
759
|
+
declare function UniformComposition<TRenderProps = unknown>({ data, behaviorTracking, children, resolveRenderer, contextualEditingEnhancer, contextualEditingDefaultPlaceholder, matchedRoute, dynamicInputs, }: UniformCompositionProps<TRenderProps>): React$1.JSX.Element;
|
|
574
760
|
|
|
575
761
|
type UniformPlaygroundDecorator = (props: {
|
|
576
762
|
/** The rendered component instance, needs to be wrapped and rendered by the decorator */
|