@uniformdev/canvas-react 18.32.1-alpha.26 → 18.33.1-alpha.7
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/index.d.ts +2 -260
- package/dist/index.esm.js +1 -11
- package/dist/index.js +1 -16
- package/dist/index.mjs +1 -11
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -69,134 +69,11 @@ type UniformComponentContextValue = {
|
|
|
69
69
|
declare function useUniformCurrentComponent(): UniformComponentContextValue;
|
|
70
70
|
/**
|
|
71
71
|
* Allows the rendering of a Canvas component instance (root or not), and its children if it has any.
|
|
72
|
-
* Note that the actual rendering happens inside `<
|
|
72
|
+
* Note that the actual rendering happens inside `<UniformSlot />`, this component only provides the services needed to achieve that.
|
|
73
73
|
* This component is used internally by `<UniformComposition />`, which you should use in most cases.
|
|
74
74
|
*/
|
|
75
75
|
declare function UniformComponent<TRenderProps = unknown>({ data, resolveRenderer, children, behaviorTracking, }: UniformComponentProps<TRenderProps>): JSX.Element | null;
|
|
76
76
|
|
|
77
|
-
/** @deprecated use `createUniformApiEnhancer` instead */
|
|
78
|
-
declare const createApiEnhancer: ({ apiUrl }: {
|
|
79
|
-
apiUrl: string;
|
|
80
|
-
}) => (message: UpdateCompositionMessage) => Promise<{
|
|
81
|
-
type: string;
|
|
82
|
-
parameters?: {
|
|
83
|
-
[key: string]: {
|
|
84
|
-
value: unknown;
|
|
85
|
-
type: string;
|
|
86
|
-
connectedData?: {
|
|
87
|
-
pointer: string;
|
|
88
|
-
syntax: "jptr";
|
|
89
|
-
required?: boolean | undefined;
|
|
90
|
-
} | undefined;
|
|
91
|
-
};
|
|
92
|
-
} | undefined;
|
|
93
|
-
variant?: string | undefined;
|
|
94
|
-
projectMapNodes?: {
|
|
95
|
-
id: string;
|
|
96
|
-
path: string;
|
|
97
|
-
projectMapId: string;
|
|
98
|
-
}[] | undefined;
|
|
99
|
-
slots?: {
|
|
100
|
-
[key: string]: {
|
|
101
|
-
type: string;
|
|
102
|
-
parameters?: {
|
|
103
|
-
[key: string]: {
|
|
104
|
-
value: unknown;
|
|
105
|
-
type: string;
|
|
106
|
-
connectedData?: {
|
|
107
|
-
pointer: string;
|
|
108
|
-
syntax: "jptr";
|
|
109
|
-
required?: boolean | undefined;
|
|
110
|
-
} | undefined;
|
|
111
|
-
};
|
|
112
|
-
} | undefined;
|
|
113
|
-
variant?: string | undefined;
|
|
114
|
-
slots?: {
|
|
115
|
-
[key: string]: any[];
|
|
116
|
-
} | undefined;
|
|
117
|
-
_id?: string | undefined;
|
|
118
|
-
_pattern?: string | undefined;
|
|
119
|
-
_dataResources?: {
|
|
120
|
-
[key: string]: {
|
|
121
|
-
type: string;
|
|
122
|
-
isPatternParameter?: boolean | undefined;
|
|
123
|
-
ignorePatternParameterDefault?: boolean | undefined;
|
|
124
|
-
variables?: {
|
|
125
|
-
[key: string]: string;
|
|
126
|
-
} | undefined;
|
|
127
|
-
};
|
|
128
|
-
} | undefined;
|
|
129
|
-
_patternDataResources?: {
|
|
130
|
-
[key: string]: {
|
|
131
|
-
type: string;
|
|
132
|
-
isPatternParameter?: boolean | undefined;
|
|
133
|
-
ignorePatternParameterDefault?: boolean | undefined;
|
|
134
|
-
variables?: {
|
|
135
|
-
[key: string]: string;
|
|
136
|
-
} | undefined;
|
|
137
|
-
};
|
|
138
|
-
} | undefined;
|
|
139
|
-
_patternError?: "NOTFOUND" | "CYCLIC" | undefined;
|
|
140
|
-
_overrides?: {
|
|
141
|
-
[key: string]: {
|
|
142
|
-
parameters?: {
|
|
143
|
-
[key: string]: {
|
|
144
|
-
value: unknown;
|
|
145
|
-
type: string;
|
|
146
|
-
connectedData?: {
|
|
147
|
-
pointer: string;
|
|
148
|
-
syntax: "jptr";
|
|
149
|
-
required?: boolean | undefined;
|
|
150
|
-
} | undefined;
|
|
151
|
-
};
|
|
152
|
-
} | undefined;
|
|
153
|
-
variant?: string | undefined;
|
|
154
|
-
};
|
|
155
|
-
} | undefined;
|
|
156
|
-
_overridability?: {
|
|
157
|
-
parameters?: {
|
|
158
|
-
[key: string]: "yes" | "no";
|
|
159
|
-
} | undefined;
|
|
160
|
-
variants?: boolean | undefined;
|
|
161
|
-
} | undefined;
|
|
162
|
-
}[];
|
|
163
|
-
} | undefined;
|
|
164
|
-
_id: string;
|
|
165
|
-
_slug?: string | null | undefined;
|
|
166
|
-
_name: string;
|
|
167
|
-
_dataResources?: {
|
|
168
|
-
[key: string]: {
|
|
169
|
-
type: string;
|
|
170
|
-
isPatternParameter?: boolean | undefined;
|
|
171
|
-
ignorePatternParameterDefault?: boolean | undefined;
|
|
172
|
-
variables?: {
|
|
173
|
-
[key: string]: string;
|
|
174
|
-
} | undefined;
|
|
175
|
-
};
|
|
176
|
-
} | undefined;
|
|
177
|
-
_overrides?: {
|
|
178
|
-
[key: string]: {
|
|
179
|
-
parameters?: {
|
|
180
|
-
[key: string]: {
|
|
181
|
-
value: unknown;
|
|
182
|
-
type: string;
|
|
183
|
-
connectedData?: {
|
|
184
|
-
pointer: string;
|
|
185
|
-
syntax: "jptr";
|
|
186
|
-
required?: boolean | undefined;
|
|
187
|
-
} | undefined;
|
|
188
|
-
};
|
|
189
|
-
} | undefined;
|
|
190
|
-
variant?: string | undefined;
|
|
191
|
-
};
|
|
192
|
-
} | undefined;
|
|
193
|
-
_overridability?: {
|
|
194
|
-
parameters?: {
|
|
195
|
-
[key: string]: "yes" | "no";
|
|
196
|
-
} | undefined;
|
|
197
|
-
variants?: boolean | undefined;
|
|
198
|
-
} | undefined;
|
|
199
|
-
}>;
|
|
200
77
|
type UseUniformContextualEditingProps = {
|
|
201
78
|
initialCompositionValue?: RootComponentInstance;
|
|
202
79
|
/**
|
|
@@ -331,131 +208,6 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
331
208
|
} | undefined;
|
|
332
209
|
} | undefined;
|
|
333
210
|
};
|
|
334
|
-
/** @deprecated use useUniformContextualEditing instead */
|
|
335
|
-
declare const useContextualEditing: ({ initialCompositionValue, enhance, }: UseUniformContextualEditingProps) => {
|
|
336
|
-
composition: {
|
|
337
|
-
type: string;
|
|
338
|
-
parameters?: {
|
|
339
|
-
[key: string]: {
|
|
340
|
-
value: unknown;
|
|
341
|
-
type: string;
|
|
342
|
-
connectedData?: {
|
|
343
|
-
pointer: string;
|
|
344
|
-
syntax: "jptr";
|
|
345
|
-
required?: boolean | undefined;
|
|
346
|
-
} | undefined;
|
|
347
|
-
};
|
|
348
|
-
} | undefined;
|
|
349
|
-
variant?: string | undefined;
|
|
350
|
-
projectMapNodes?: {
|
|
351
|
-
id: string;
|
|
352
|
-
path: string;
|
|
353
|
-
projectMapId: string;
|
|
354
|
-
}[] | undefined;
|
|
355
|
-
slots?: {
|
|
356
|
-
[key: string]: {
|
|
357
|
-
type: string;
|
|
358
|
-
parameters?: {
|
|
359
|
-
[key: string]: {
|
|
360
|
-
value: unknown;
|
|
361
|
-
type: string;
|
|
362
|
-
connectedData?: {
|
|
363
|
-
pointer: string;
|
|
364
|
-
syntax: "jptr";
|
|
365
|
-
required?: boolean | undefined;
|
|
366
|
-
} | undefined;
|
|
367
|
-
};
|
|
368
|
-
} | undefined;
|
|
369
|
-
variant?: string | undefined;
|
|
370
|
-
slots?: {
|
|
371
|
-
[key: string]: any[];
|
|
372
|
-
} | undefined;
|
|
373
|
-
_id?: string | undefined;
|
|
374
|
-
_pattern?: string | undefined;
|
|
375
|
-
_dataResources?: {
|
|
376
|
-
[key: string]: {
|
|
377
|
-
type: string;
|
|
378
|
-
isPatternParameter?: boolean | undefined;
|
|
379
|
-
ignorePatternParameterDefault?: boolean | undefined;
|
|
380
|
-
variables?: {
|
|
381
|
-
[key: string]: string;
|
|
382
|
-
} | undefined;
|
|
383
|
-
};
|
|
384
|
-
} | undefined;
|
|
385
|
-
_patternDataResources?: {
|
|
386
|
-
[key: string]: {
|
|
387
|
-
type: string;
|
|
388
|
-
isPatternParameter?: boolean | undefined;
|
|
389
|
-
ignorePatternParameterDefault?: boolean | undefined;
|
|
390
|
-
variables?: {
|
|
391
|
-
[key: string]: string;
|
|
392
|
-
} | undefined;
|
|
393
|
-
};
|
|
394
|
-
} | undefined;
|
|
395
|
-
_patternError?: "NOTFOUND" | "CYCLIC" | undefined;
|
|
396
|
-
_overrides?: {
|
|
397
|
-
[key: string]: {
|
|
398
|
-
parameters?: {
|
|
399
|
-
[key: string]: {
|
|
400
|
-
value: unknown;
|
|
401
|
-
type: string;
|
|
402
|
-
connectedData?: {
|
|
403
|
-
pointer: string;
|
|
404
|
-
syntax: "jptr";
|
|
405
|
-
required?: boolean | undefined;
|
|
406
|
-
} | undefined;
|
|
407
|
-
};
|
|
408
|
-
} | undefined;
|
|
409
|
-
variant?: string | undefined;
|
|
410
|
-
};
|
|
411
|
-
} | undefined;
|
|
412
|
-
_overridability?: {
|
|
413
|
-
parameters?: {
|
|
414
|
-
[key: string]: "yes" | "no";
|
|
415
|
-
} | undefined;
|
|
416
|
-
variants?: boolean | undefined;
|
|
417
|
-
} | undefined;
|
|
418
|
-
}[];
|
|
419
|
-
} | undefined;
|
|
420
|
-
_id: string;
|
|
421
|
-
_slug?: string | null | undefined;
|
|
422
|
-
_name: string;
|
|
423
|
-
_dataResources?: {
|
|
424
|
-
[key: string]: {
|
|
425
|
-
type: string;
|
|
426
|
-
isPatternParameter?: boolean | undefined;
|
|
427
|
-
ignorePatternParameterDefault?: boolean | undefined;
|
|
428
|
-
variables?: {
|
|
429
|
-
[key: string]: string;
|
|
430
|
-
} | undefined;
|
|
431
|
-
};
|
|
432
|
-
} | undefined;
|
|
433
|
-
_overrides?: {
|
|
434
|
-
[key: string]: {
|
|
435
|
-
parameters?: {
|
|
436
|
-
[key: string]: {
|
|
437
|
-
value: unknown;
|
|
438
|
-
type: string;
|
|
439
|
-
connectedData?: {
|
|
440
|
-
pointer: string;
|
|
441
|
-
syntax: "jptr";
|
|
442
|
-
required?: boolean | undefined;
|
|
443
|
-
} | undefined;
|
|
444
|
-
};
|
|
445
|
-
} | undefined;
|
|
446
|
-
variant?: string | undefined;
|
|
447
|
-
};
|
|
448
|
-
} | undefined;
|
|
449
|
-
_overridability?: {
|
|
450
|
-
parameters?: {
|
|
451
|
-
[key: string]: "yes" | "no";
|
|
452
|
-
} | undefined;
|
|
453
|
-
variants?: boolean | undefined;
|
|
454
|
-
} | undefined;
|
|
455
|
-
} | undefined;
|
|
456
|
-
};
|
|
457
|
-
/** @deprecated use UseUniformContextualEditingProps instead */
|
|
458
|
-
type UseContextualEditingProps = UseUniformContextualEditingProps;
|
|
459
211
|
|
|
460
212
|
type UniformCompositionProps<TRenderProps = unknown> = UniformComponentProps<TRenderProps> & {
|
|
461
213
|
/** The composition data */
|
|
@@ -477,12 +229,6 @@ declare function useUniformCurrentComposition(): UniformCompositionContextValue;
|
|
|
477
229
|
* It also takes care of enabling [Contextual Editing](https://docs.uniform.app/capabilities/composition/contextual-editing).
|
|
478
230
|
*/
|
|
479
231
|
declare function UniformComposition<TRenderProps = unknown>({ data, behaviorTracking, children, resolveRenderer, contextualEditingEnhancer, }: UniformCompositionProps<TRenderProps>): JSX.Element;
|
|
480
|
-
/** @deprecated use `useUniformCurrentComposition` instead */
|
|
481
|
-
declare const useComposition: typeof useUniformCurrentComposition;
|
|
482
|
-
/** @deprecated use `UniformComposition` instead */
|
|
483
|
-
declare const Composition: typeof UniformComposition;
|
|
484
|
-
/** @deprecated use `UniformCompositionProps` instead */
|
|
485
|
-
type CompositionProps<TRenderProps = unknown> = UniformCompositionProps<TRenderProps>;
|
|
486
232
|
|
|
487
233
|
type CustomSlotChildRenderFunc = (options: {
|
|
488
234
|
child: ReactNode;
|
|
@@ -508,10 +254,6 @@ type UniformSlotProps<TSlotNames extends string> = {
|
|
|
508
254
|
};
|
|
509
255
|
/** Renders a named Slot within a Composition. */
|
|
510
256
|
declare function UniformSlot<TSlotNames extends string = string>({ name, resolveRenderer, children, emptyPlaceholder, }: UniformSlotProps<TSlotNames>): JSX.Element | null;
|
|
511
|
-
/** @deprecated use `UniformSlotProps` instead */
|
|
512
|
-
type SlotProps<TSlotNames extends string> = UniformSlotProps<TSlotNames>;
|
|
513
|
-
/** @deprecated use `UniformSlot` instead */
|
|
514
|
-
declare const Slot: typeof UniformSlot;
|
|
515
257
|
|
|
516
258
|
type UseCompositionEventEffectOptions = Omit<Partial<SubscribeToCompositionOptions>, 'callback'> & {
|
|
517
259
|
enabled: boolean;
|
|
@@ -536,4 +278,4 @@ declare const createComponentStoreResolver: (options: {
|
|
|
536
278
|
defaultComponent?: React$1.ComponentType<ComponentProps<any>>;
|
|
537
279
|
}) => RenderComponentResolver;
|
|
538
280
|
|
|
539
|
-
export { ComponentProps, ComponentStore,
|
|
281
|
+
export { ComponentProps, ComponentStore, DefaultNotImplementedComponent, NOT_IMPLEMENTED_COMPONENT, RenderComponentResolver, SystemRenderConfig, SystemRenderFunction, UniformComponent, UniformComponentContextValue, UniformComponentProps, UniformComposition, UniformCompositionProps, UniformSlot, UniformSlotProps, UseCompositionEventEffectOptions, UseUniformContextualEditingProps, componentStore, componentStoreResolver, createComponentStore, createComponentStoreResolver, registerUniformComponent, useCompositionEventEffect, useUniformContextualEditing, useUniformCurrentComponent, useUniformCurrentComposition };
|
package/dist/index.esm.js
CHANGED
|
@@ -269,7 +269,6 @@ function renderComponent({
|
|
|
269
269
|
}
|
|
270
270
|
return null;
|
|
271
271
|
}
|
|
272
|
-
var Slot = UniformSlot;
|
|
273
272
|
|
|
274
273
|
// src/components/UniformComponent.tsx
|
|
275
274
|
var UniformComponentContext = createContext({});
|
|
@@ -323,7 +322,7 @@ function resolveChildren({
|
|
|
323
322
|
} else {
|
|
324
323
|
if (Object.keys((_a = data.slots) != null ? _a : {}).length > 1 && process.env.NODE_ENV === "development") {
|
|
325
324
|
console.warn(
|
|
326
|
-
`[canvas-dev] All the slots in component '${data.type}' are rendered in no particular order. Use '<
|
|
325
|
+
`[canvas-dev] All the slots in component '${data.type}' are rendered in no particular order. Use '<UniformSlot name={slotName} />' to reliably render the slots.`
|
|
327
326
|
);
|
|
328
327
|
}
|
|
329
328
|
children = Object.keys(data.slots || {}).map((slotName) => /* @__PURE__ */ React4.createElement(UniformSlot, { key: slotName, name: slotName }));
|
|
@@ -345,7 +344,6 @@ import {
|
|
|
345
344
|
isUpdateCompositionMessage
|
|
346
345
|
} from "@uniformdev/canvas";
|
|
347
346
|
import { useEffect, useMemo, useState } from "react";
|
|
348
|
-
var createApiEnhancer = createUniformApiEnhancer;
|
|
349
347
|
var registeredCompositionIds = /* @__PURE__ */ new Set();
|
|
350
348
|
var useUniformContextualEditing = ({
|
|
351
349
|
initialCompositionValue,
|
|
@@ -417,7 +415,6 @@ function isInContextEditingMode() {
|
|
|
417
415
|
);
|
|
418
416
|
return isOpenedByInContextEditor && isAllowlistedReferrer;
|
|
419
417
|
}
|
|
420
|
-
var useContextualEditing = useUniformContextualEditing;
|
|
421
418
|
|
|
422
419
|
// src/components/UniformComposition.tsx
|
|
423
420
|
var UniformCompositionContext = createContext2({ data: void 0 });
|
|
@@ -445,8 +442,6 @@ function UniformComposition({
|
|
|
445
442
|
children
|
|
446
443
|
));
|
|
447
444
|
}
|
|
448
|
-
var useComposition = useUniformCurrentComposition;
|
|
449
|
-
var Composition = UniformComposition;
|
|
450
445
|
|
|
451
446
|
// src/hooks/useCompositionEventEffect.ts
|
|
452
447
|
import {
|
|
@@ -488,23 +483,18 @@ function useCompositionEventEffect({
|
|
|
488
483
|
}, [compositionId, enabled, projectId, effect]);
|
|
489
484
|
}
|
|
490
485
|
export {
|
|
491
|
-
Composition,
|
|
492
486
|
DefaultNotImplementedComponent,
|
|
493
487
|
NOT_IMPLEMENTED_COMPONENT,
|
|
494
|
-
Slot,
|
|
495
488
|
UniformComponent,
|
|
496
489
|
UniformComposition,
|
|
497
490
|
UniformSlot,
|
|
498
491
|
componentStore,
|
|
499
492
|
componentStoreResolver,
|
|
500
|
-
createApiEnhancer,
|
|
501
493
|
createComponentStore,
|
|
502
494
|
createComponentStoreResolver,
|
|
503
495
|
createUniformApiEnhancer,
|
|
504
496
|
registerUniformComponent,
|
|
505
|
-
useComposition,
|
|
506
497
|
useCompositionEventEffect,
|
|
507
|
-
useContextualEditing,
|
|
508
498
|
useUniformContextualEditing,
|
|
509
499
|
useUniformCurrentComponent,
|
|
510
500
|
useUniformCurrentComposition
|
package/dist/index.js
CHANGED
|
@@ -30,23 +30,18 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
|
-
Composition: () => Composition,
|
|
34
33
|
DefaultNotImplementedComponent: () => DefaultNotImplementedComponent,
|
|
35
34
|
NOT_IMPLEMENTED_COMPONENT: () => NOT_IMPLEMENTED_COMPONENT,
|
|
36
|
-
Slot: () => Slot,
|
|
37
35
|
UniformComponent: () => UniformComponent,
|
|
38
36
|
UniformComposition: () => UniformComposition,
|
|
39
37
|
UniformSlot: () => UniformSlot,
|
|
40
38
|
componentStore: () => componentStore,
|
|
41
39
|
componentStoreResolver: () => componentStoreResolver,
|
|
42
|
-
createApiEnhancer: () => createApiEnhancer,
|
|
43
40
|
createComponentStore: () => createComponentStore,
|
|
44
41
|
createComponentStoreResolver: () => createComponentStoreResolver,
|
|
45
42
|
createUniformApiEnhancer: () => import_canvas5.createUniformApiEnhancer,
|
|
46
43
|
registerUniformComponent: () => registerUniformComponent,
|
|
47
|
-
useComposition: () => useComposition,
|
|
48
44
|
useCompositionEventEffect: () => useCompositionEventEffect,
|
|
49
|
-
useContextualEditing: () => useContextualEditing,
|
|
50
45
|
useUniformContextualEditing: () => useUniformContextualEditing,
|
|
51
46
|
useUniformCurrentComponent: () => useUniformCurrentComponent,
|
|
52
47
|
useUniformCurrentComposition: () => useUniformCurrentComposition
|
|
@@ -311,7 +306,6 @@ function renderComponent({
|
|
|
311
306
|
}
|
|
312
307
|
return null;
|
|
313
308
|
}
|
|
314
|
-
var Slot = UniformSlot;
|
|
315
309
|
|
|
316
310
|
// src/components/UniformComponent.tsx
|
|
317
311
|
var UniformComponentContext = (0, import_react3.createContext)({});
|
|
@@ -365,7 +359,7 @@ function resolveChildren({
|
|
|
365
359
|
} else {
|
|
366
360
|
if (Object.keys((_a = data.slots) != null ? _a : {}).length > 1 && process.env.NODE_ENV === "development") {
|
|
367
361
|
console.warn(
|
|
368
|
-
`[canvas-dev] All the slots in component '${data.type}' are rendered in no particular order. Use '<
|
|
362
|
+
`[canvas-dev] All the slots in component '${data.type}' are rendered in no particular order. Use '<UniformSlot name={slotName} />' to reliably render the slots.`
|
|
369
363
|
);
|
|
370
364
|
}
|
|
371
365
|
children = Object.keys(data.slots || {}).map((slotName) => /* @__PURE__ */ import_react3.default.createElement(UniformSlot, { key: slotName, name: slotName }));
|
|
@@ -381,7 +375,6 @@ var import_react5 = __toESM(require("react"));
|
|
|
381
375
|
// src/hooks/useUniformContextualEditing.ts
|
|
382
376
|
var import_canvas5 = require("@uniformdev/canvas");
|
|
383
377
|
var import_react4 = require("react");
|
|
384
|
-
var createApiEnhancer = import_canvas5.createUniformApiEnhancer;
|
|
385
378
|
var registeredCompositionIds = /* @__PURE__ */ new Set();
|
|
386
379
|
var useUniformContextualEditing = ({
|
|
387
380
|
initialCompositionValue,
|
|
@@ -453,7 +446,6 @@ function isInContextEditingMode() {
|
|
|
453
446
|
);
|
|
454
447
|
return isOpenedByInContextEditor && isAllowlistedReferrer;
|
|
455
448
|
}
|
|
456
|
-
var useContextualEditing = useUniformContextualEditing;
|
|
457
449
|
|
|
458
450
|
// src/components/UniformComposition.tsx
|
|
459
451
|
var UniformCompositionContext = (0, import_react5.createContext)({ data: void 0 });
|
|
@@ -481,8 +473,6 @@ function UniformComposition({
|
|
|
481
473
|
children
|
|
482
474
|
));
|
|
483
475
|
}
|
|
484
|
-
var useComposition = useUniformCurrentComposition;
|
|
485
|
-
var Composition = UniformComposition;
|
|
486
476
|
|
|
487
477
|
// src/hooks/useCompositionEventEffect.ts
|
|
488
478
|
var import_canvas6 = require("@uniformdev/canvas");
|
|
@@ -521,23 +511,18 @@ function useCompositionEventEffect({
|
|
|
521
511
|
}
|
|
522
512
|
// Annotate the CommonJS export names for ESM import in node:
|
|
523
513
|
0 && (module.exports = {
|
|
524
|
-
Composition,
|
|
525
514
|
DefaultNotImplementedComponent,
|
|
526
515
|
NOT_IMPLEMENTED_COMPONENT,
|
|
527
|
-
Slot,
|
|
528
516
|
UniformComponent,
|
|
529
517
|
UniformComposition,
|
|
530
518
|
UniformSlot,
|
|
531
519
|
componentStore,
|
|
532
520
|
componentStoreResolver,
|
|
533
|
-
createApiEnhancer,
|
|
534
521
|
createComponentStore,
|
|
535
522
|
createComponentStoreResolver,
|
|
536
523
|
createUniformApiEnhancer,
|
|
537
524
|
registerUniformComponent,
|
|
538
|
-
useComposition,
|
|
539
525
|
useCompositionEventEffect,
|
|
540
|
-
useContextualEditing,
|
|
541
526
|
useUniformContextualEditing,
|
|
542
527
|
useUniformCurrentComponent,
|
|
543
528
|
useUniformCurrentComposition
|
package/dist/index.mjs
CHANGED
|
@@ -269,7 +269,6 @@ function renderComponent({
|
|
|
269
269
|
}
|
|
270
270
|
return null;
|
|
271
271
|
}
|
|
272
|
-
var Slot = UniformSlot;
|
|
273
272
|
|
|
274
273
|
// src/components/UniformComponent.tsx
|
|
275
274
|
var UniformComponentContext = createContext({});
|
|
@@ -323,7 +322,7 @@ function resolveChildren({
|
|
|
323
322
|
} else {
|
|
324
323
|
if (Object.keys((_a = data.slots) != null ? _a : {}).length > 1 && process.env.NODE_ENV === "development") {
|
|
325
324
|
console.warn(
|
|
326
|
-
`[canvas-dev] All the slots in component '${data.type}' are rendered in no particular order. Use '<
|
|
325
|
+
`[canvas-dev] All the slots in component '${data.type}' are rendered in no particular order. Use '<UniformSlot name={slotName} />' to reliably render the slots.`
|
|
327
326
|
);
|
|
328
327
|
}
|
|
329
328
|
children = Object.keys(data.slots || {}).map((slotName) => /* @__PURE__ */ React4.createElement(UniformSlot, { key: slotName, name: slotName }));
|
|
@@ -345,7 +344,6 @@ import {
|
|
|
345
344
|
isUpdateCompositionMessage
|
|
346
345
|
} from "@uniformdev/canvas";
|
|
347
346
|
import { useEffect, useMemo, useState } from "react";
|
|
348
|
-
var createApiEnhancer = createUniformApiEnhancer;
|
|
349
347
|
var registeredCompositionIds = /* @__PURE__ */ new Set();
|
|
350
348
|
var useUniformContextualEditing = ({
|
|
351
349
|
initialCompositionValue,
|
|
@@ -417,7 +415,6 @@ function isInContextEditingMode() {
|
|
|
417
415
|
);
|
|
418
416
|
return isOpenedByInContextEditor && isAllowlistedReferrer;
|
|
419
417
|
}
|
|
420
|
-
var useContextualEditing = useUniformContextualEditing;
|
|
421
418
|
|
|
422
419
|
// src/components/UniformComposition.tsx
|
|
423
420
|
var UniformCompositionContext = createContext2({ data: void 0 });
|
|
@@ -445,8 +442,6 @@ function UniformComposition({
|
|
|
445
442
|
children
|
|
446
443
|
));
|
|
447
444
|
}
|
|
448
|
-
var useComposition = useUniformCurrentComposition;
|
|
449
|
-
var Composition = UniformComposition;
|
|
450
445
|
|
|
451
446
|
// src/hooks/useCompositionEventEffect.ts
|
|
452
447
|
import {
|
|
@@ -488,23 +483,18 @@ function useCompositionEventEffect({
|
|
|
488
483
|
}, [compositionId, enabled, projectId, effect]);
|
|
489
484
|
}
|
|
490
485
|
export {
|
|
491
|
-
Composition,
|
|
492
486
|
DefaultNotImplementedComponent,
|
|
493
487
|
NOT_IMPLEMENTED_COMPONENT,
|
|
494
|
-
Slot,
|
|
495
488
|
UniformComponent,
|
|
496
489
|
UniformComposition,
|
|
497
490
|
UniformSlot,
|
|
498
491
|
componentStore,
|
|
499
492
|
componentStoreResolver,
|
|
500
|
-
createApiEnhancer,
|
|
501
493
|
createComponentStore,
|
|
502
494
|
createComponentStoreResolver,
|
|
503
495
|
createUniformApiEnhancer,
|
|
504
496
|
registerUniformComponent,
|
|
505
|
-
useComposition,
|
|
506
497
|
useCompositionEventEffect,
|
|
507
|
-
useContextualEditing,
|
|
508
498
|
useUniformContextualEditing,
|
|
509
499
|
useUniformCurrentComponent,
|
|
510
500
|
useUniformCurrentComposition
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-react",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.33.1-alpha.7+7127237a1",
|
|
4
4
|
"description": "React SDK for Uniform Canvas",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"document": "api-extractor run --local"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@uniformdev/canvas": "18.
|
|
28
|
-
"@uniformdev/context": "18.
|
|
29
|
-
"@uniformdev/context-react": "18.
|
|
27
|
+
"@uniformdev/canvas": "18.33.1-alpha.7+7127237a1",
|
|
28
|
+
"@uniformdev/context": "18.33.1-alpha.7+7127237a1",
|
|
29
|
+
"@uniformdev/context-react": "18.33.1-alpha.7+7127237a1"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"react": ">= 16 || 17 || 18",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "7127237a1e099d2a11fa8c06d49cb01cf16c0852"
|
|
47
47
|
}
|