@uniformdev/canvas-react 19.166.1 → 19.169.0
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.mts +10 -8
- package/dist/index.d.ts +10 -8
- package/dist/index.esm.js +54 -23
- package/dist/index.js +160 -129
- package/dist/index.mjs +54 -23
- package/package.json +8 -6
package/dist/index.d.mts
CHANGED
|
@@ -10,7 +10,7 @@ import { RichTextNode } from '@uniformdev/richtext';
|
|
|
10
10
|
* all enhancers have been applied.
|
|
11
11
|
*/
|
|
12
12
|
type ComponentProps<TProps = unknown> = TProps & {
|
|
13
|
-
component: ComponentInstance;
|
|
13
|
+
component: ComponentInstance | RootComponentInstance;
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
16
|
* Function that maps a Canvas component instance to its React component to render it.
|
|
@@ -313,24 +313,26 @@ declare function useUniformCurrentComposition(): UniformCompositionContextValue;
|
|
|
313
313
|
declare function UniformComposition<TRenderProps = unknown>({ data, behaviorTracking, children, resolveRenderer, contextualEditingEnhancer, contextualEditingDefaultPlaceholder, }: UniformCompositionProps<TRenderProps>): React$1.JSX.Element;
|
|
314
314
|
|
|
315
315
|
type UniformPlaygroundDecorator = (props: {
|
|
316
|
-
/** The rendered component instance, needs to wrapped and rendered by the decorator */
|
|
316
|
+
/** The rendered component instance, needs to be wrapped and rendered by the decorator */
|
|
317
317
|
children: React$1.ReactNode;
|
|
318
318
|
/** The component instance data */
|
|
319
319
|
data: ComponentInstance | RootComponentInstance;
|
|
320
320
|
}) => React$1.ReactElement;
|
|
321
321
|
type UniformPlaygroundProps = {
|
|
322
322
|
/**
|
|
323
|
-
* Allows wrapping the playground in custom
|
|
324
|
-
* Useful to customize the playground to allow previewing the
|
|
325
|
-
* (e.g.
|
|
323
|
+
* Allows wrapping the playground in custom layouts.
|
|
324
|
+
* Useful to customize the playground to allow previewing the patterns in realistic scenarios
|
|
325
|
+
* (e.g. wrap the pattern in a specific layout, show a background color selector, parent size selector, etc.)
|
|
326
326
|
* @deprecated This feature is not stable yet and might be changed or removed in a minor release. Do not use it in production environments.
|
|
327
327
|
*/
|
|
328
328
|
decorators?: UniformPlaygroundDecorator[];
|
|
329
|
-
|
|
329
|
+
/** @deprecated This prop is not supported anymore. */
|
|
330
|
+
children?: ReactNode;
|
|
331
|
+
} & Omit<UniformCompositionProps, 'data' | 'children'>;
|
|
330
332
|
/**
|
|
331
|
-
* Playground where you can freely live preview your components and
|
|
333
|
+
* Playground where you can freely live preview your components and patterns.
|
|
332
334
|
*/
|
|
333
|
-
declare const UniformPlayground: ({ resolveRenderer, decorators, contextualEditingEnhancer, behaviorTracking, contextualEditingDefaultPlaceholder,
|
|
335
|
+
declare const UniformPlayground: ({ resolveRenderer, decorators, contextualEditingEnhancer, behaviorTracking, contextualEditingDefaultPlaceholder, }: UniformPlaygroundProps) => React$1.JSX.Element;
|
|
334
336
|
|
|
335
337
|
type RichTextComponentProps<TNode extends RichTextNode = RichTextNode> = {
|
|
336
338
|
node: TNode;
|
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { RichTextNode } from '@uniformdev/richtext';
|
|
|
10
10
|
* all enhancers have been applied.
|
|
11
11
|
*/
|
|
12
12
|
type ComponentProps<TProps = unknown> = TProps & {
|
|
13
|
-
component: ComponentInstance;
|
|
13
|
+
component: ComponentInstance | RootComponentInstance;
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
16
|
* Function that maps a Canvas component instance to its React component to render it.
|
|
@@ -313,24 +313,26 @@ declare function useUniformCurrentComposition(): UniformCompositionContextValue;
|
|
|
313
313
|
declare function UniformComposition<TRenderProps = unknown>({ data, behaviorTracking, children, resolveRenderer, contextualEditingEnhancer, contextualEditingDefaultPlaceholder, }: UniformCompositionProps<TRenderProps>): React$1.JSX.Element;
|
|
314
314
|
|
|
315
315
|
type UniformPlaygroundDecorator = (props: {
|
|
316
|
-
/** The rendered component instance, needs to wrapped and rendered by the decorator */
|
|
316
|
+
/** The rendered component instance, needs to be wrapped and rendered by the decorator */
|
|
317
317
|
children: React$1.ReactNode;
|
|
318
318
|
/** The component instance data */
|
|
319
319
|
data: ComponentInstance | RootComponentInstance;
|
|
320
320
|
}) => React$1.ReactElement;
|
|
321
321
|
type UniformPlaygroundProps = {
|
|
322
322
|
/**
|
|
323
|
-
* Allows wrapping the playground in custom
|
|
324
|
-
* Useful to customize the playground to allow previewing the
|
|
325
|
-
* (e.g.
|
|
323
|
+
* Allows wrapping the playground in custom layouts.
|
|
324
|
+
* Useful to customize the playground to allow previewing the patterns in realistic scenarios
|
|
325
|
+
* (e.g. wrap the pattern in a specific layout, show a background color selector, parent size selector, etc.)
|
|
326
326
|
* @deprecated This feature is not stable yet and might be changed or removed in a minor release. Do not use it in production environments.
|
|
327
327
|
*/
|
|
328
328
|
decorators?: UniformPlaygroundDecorator[];
|
|
329
|
-
|
|
329
|
+
/** @deprecated This prop is not supported anymore. */
|
|
330
|
+
children?: ReactNode;
|
|
331
|
+
} & Omit<UniformCompositionProps, 'data' | 'children'>;
|
|
330
332
|
/**
|
|
331
|
-
* Playground where you can freely live preview your components and
|
|
333
|
+
* Playground where you can freely live preview your components and patterns.
|
|
332
334
|
*/
|
|
333
|
-
declare const UniformPlayground: ({ resolveRenderer, decorators, contextualEditingEnhancer, behaviorTracking, contextualEditingDefaultPlaceholder,
|
|
335
|
+
declare const UniformPlayground: ({ resolveRenderer, decorators, contextualEditingEnhancer, behaviorTracking, contextualEditingDefaultPlaceholder, }: UniformPlaygroundProps) => React$1.JSX.Element;
|
|
334
336
|
|
|
335
337
|
type RichTextComponentProps<TNode extends RichTextNode = RichTextNode> = {
|
|
336
338
|
node: TNode;
|
package/dist/index.esm.js
CHANGED
|
@@ -233,6 +233,45 @@ var PureContextualEditingComponentWrapper = ({
|
|
|
233
233
|
// src/components/UniformComposition.tsx
|
|
234
234
|
import React4, { createContext, useContext } from "react";
|
|
235
235
|
|
|
236
|
+
// src/hooks/useClientConditionsComposition.ts
|
|
237
|
+
import { evaluateWalkTreeVisibility, walkNodeTree } from "@uniformdev/canvas";
|
|
238
|
+
import { produce } from "immer";
|
|
239
|
+
import { useMemo as useMemo2 } from "react";
|
|
240
|
+
|
|
241
|
+
// src/hooks/useClientVisibilityRules.ts
|
|
242
|
+
import { createQuirksVisibilityRule } from "@uniformdev/canvas";
|
|
243
|
+
import { useQuirks } from "@uniformdev/context-react";
|
|
244
|
+
import { useMemo } from "react";
|
|
245
|
+
function useClientVisibilityRules() {
|
|
246
|
+
const quirks = useQuirks({ throwOnMissingProvider: false });
|
|
247
|
+
return useMemo(() => {
|
|
248
|
+
return {
|
|
249
|
+
...createQuirksVisibilityRule(quirks)
|
|
250
|
+
};
|
|
251
|
+
}, [quirks]);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// src/hooks/useClientConditionsComposition.ts
|
|
255
|
+
function useClientConditionsComposition(data) {
|
|
256
|
+
const rules = useClientVisibilityRules();
|
|
257
|
+
const preprocessedValue = useMemo2(() => {
|
|
258
|
+
if (!data) {
|
|
259
|
+
return data;
|
|
260
|
+
}
|
|
261
|
+
try {
|
|
262
|
+
return produce(data, (draft) => {
|
|
263
|
+
walkNodeTree(draft, (context) => {
|
|
264
|
+
evaluateWalkTreeVisibility({ context, rules, showIndeterminate: false });
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
} catch (e) {
|
|
268
|
+
console.error("Error evaluating visibility rules:", e.stack);
|
|
269
|
+
return data;
|
|
270
|
+
}
|
|
271
|
+
}, [data, rules]);
|
|
272
|
+
return preprocessedValue;
|
|
273
|
+
}
|
|
274
|
+
|
|
236
275
|
// src/hooks/useUniformContextualEditing.ts
|
|
237
276
|
import {
|
|
238
277
|
createCanvasChannel,
|
|
@@ -243,7 +282,7 @@ import {
|
|
|
243
282
|
isAllowedReferrer,
|
|
244
283
|
isUpdateCompositionInternalMessage
|
|
245
284
|
} from "@uniformdev/canvas";
|
|
246
|
-
import { useEffect, useMemo, useRef, useState } from "react";
|
|
285
|
+
import { useEffect, useMemo as useMemo3, useRef, useState } from "react";
|
|
247
286
|
var registeredCompositionIds = /* @__PURE__ */ new Set();
|
|
248
287
|
var useUniformContextualEditing = ({
|
|
249
288
|
initialCompositionValue,
|
|
@@ -251,7 +290,7 @@ var useUniformContextualEditing = ({
|
|
|
251
290
|
}) => {
|
|
252
291
|
const [contextualComposition, setContextualComposition] = useState();
|
|
253
292
|
const latestEventTimeStamp = useRef();
|
|
254
|
-
const channel =
|
|
293
|
+
const channel = useMemo3(() => {
|
|
255
294
|
var _a;
|
|
256
295
|
if (!isInContextEditingMode()) {
|
|
257
296
|
return;
|
|
@@ -341,8 +380,9 @@ function UniformComposition({
|
|
|
341
380
|
contextualEditingEnhancer,
|
|
342
381
|
contextualEditingDefaultPlaceholder
|
|
343
382
|
}) {
|
|
383
|
+
const ruledComposition = useClientConditionsComposition(data);
|
|
344
384
|
const { composition, isContextualEditing } = useUniformContextualEditing({
|
|
345
|
-
initialCompositionValue:
|
|
385
|
+
initialCompositionValue: ruledComposition,
|
|
346
386
|
enhance: contextualEditingEnhancer
|
|
347
387
|
});
|
|
348
388
|
return /* @__PURE__ */ React4.createElement(
|
|
@@ -605,20 +645,19 @@ function resolveChildren({
|
|
|
605
645
|
|
|
606
646
|
// src/components/UniformPlayground.tsx
|
|
607
647
|
import { EMPTY_COMPOSITION as EMPTY_COMPOSITION4 } from "@uniformdev/canvas";
|
|
608
|
-
import React8, { useMemo as
|
|
648
|
+
import React8, { useMemo as useMemo4 } from "react";
|
|
609
649
|
var UniformPlayground = ({
|
|
610
650
|
resolveRenderer,
|
|
611
651
|
decorators = [],
|
|
612
652
|
contextualEditingEnhancer,
|
|
613
653
|
behaviorTracking,
|
|
614
|
-
contextualEditingDefaultPlaceholder
|
|
615
|
-
children
|
|
654
|
+
contextualEditingDefaultPlaceholder
|
|
616
655
|
}) => {
|
|
617
656
|
const { composition, isContextualEditing } = useUniformContextualEditing({
|
|
618
657
|
initialCompositionValue: EMPTY_COMPOSITION4,
|
|
619
658
|
enhance: contextualEditingEnhancer
|
|
620
659
|
});
|
|
621
|
-
const renderedComponent =
|
|
660
|
+
const renderedComponent = useMemo4(() => {
|
|
622
661
|
if (!composition) {
|
|
623
662
|
return null;
|
|
624
663
|
}
|
|
@@ -629,21 +668,13 @@ var UniformPlayground = ({
|
|
|
629
668
|
behaviorTracking,
|
|
630
669
|
resolveRenderer,
|
|
631
670
|
contextualEditingDefaultPlaceholder
|
|
632
|
-
}
|
|
633
|
-
children
|
|
671
|
+
}
|
|
634
672
|
));
|
|
635
673
|
decorators.forEach((Decorator) => {
|
|
636
674
|
component = /* @__PURE__ */ React8.createElement(Decorator, { data: composition }, component);
|
|
637
675
|
});
|
|
638
676
|
return component;
|
|
639
|
-
}, [
|
|
640
|
-
children,
|
|
641
|
-
resolveRenderer,
|
|
642
|
-
decorators,
|
|
643
|
-
composition,
|
|
644
|
-
behaviorTracking,
|
|
645
|
-
contextualEditingDefaultPlaceholder
|
|
646
|
-
]);
|
|
677
|
+
}, [resolveRenderer, decorators, composition, behaviorTracking, contextualEditingDefaultPlaceholder]);
|
|
647
678
|
return /* @__PURE__ */ React8.createElement(
|
|
648
679
|
UniformCompositionContext.Provider,
|
|
649
680
|
{
|
|
@@ -663,7 +694,7 @@ import {
|
|
|
663
694
|
isRichTextValue,
|
|
664
695
|
isRichTextValueConsideredEmpty
|
|
665
696
|
} from "@uniformdev/richtext";
|
|
666
|
-
import React18, { useMemo as
|
|
697
|
+
import React18, { useMemo as useMemo5 } from "react";
|
|
667
698
|
|
|
668
699
|
// src/components/UniformRichText/UniformRichTextNode.tsx
|
|
669
700
|
import { isRichTextNode } from "@uniformdev/richtext";
|
|
@@ -773,11 +804,11 @@ var resolveRichTextDefaultRenderer = (node) => {
|
|
|
773
804
|
// src/components/UniformRichText/UniformRichText.tsx
|
|
774
805
|
var UniformRichText = React18.forwardRef(function UniformRichText2({ parameterId, resolveRichTextRenderer, as: Tag = "div", ...props }, ref) {
|
|
775
806
|
const { data: componentData } = useUniformCurrentComponent();
|
|
776
|
-
const parameter =
|
|
807
|
+
const parameter = useMemo5(() => {
|
|
777
808
|
var _a;
|
|
778
809
|
return (_a = componentData == null ? void 0 : componentData.parameters) == null ? void 0 : _a[parameterId];
|
|
779
810
|
}, [componentData, parameterId]);
|
|
780
|
-
const value =
|
|
811
|
+
const value = useMemo5(() => parameter == null ? void 0 : parameter.value, [parameter]);
|
|
781
812
|
if (!value || !isRichTextValue(value) || isRichTextValueConsideredEmpty(value)) return null;
|
|
782
813
|
return Tag === null ? /* @__PURE__ */ React18.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ React18.createElement(
|
|
783
814
|
Tag,
|
|
@@ -936,7 +967,7 @@ import {
|
|
|
936
967
|
createCanvasChannel as createCanvasChannel2,
|
|
937
968
|
isUpdateContextualEditingStateInternalMessage
|
|
938
969
|
} from "@uniformdev/canvas";
|
|
939
|
-
import { useEffect as useEffect3, useMemo as
|
|
970
|
+
import { useEffect as useEffect3, useMemo as useMemo6, useState as useState3 } from "react";
|
|
940
971
|
var useUniformContextualEditingState = ({
|
|
941
972
|
global = false
|
|
942
973
|
} = {}) => {
|
|
@@ -946,7 +977,7 @@ var useUniformContextualEditingState = ({
|
|
|
946
977
|
const [previewMode, setPreviewMode] = useState3(
|
|
947
978
|
isContextualEditing ? "editor" : void 0
|
|
948
979
|
);
|
|
949
|
-
const channel =
|
|
980
|
+
const channel = useMemo6(() => {
|
|
950
981
|
if (!isContextualEditing) {
|
|
951
982
|
return;
|
|
952
983
|
}
|
|
@@ -980,7 +1011,7 @@ var useUniformContextualEditingState = ({
|
|
|
980
1011
|
unsubscribe();
|
|
981
1012
|
};
|
|
982
1013
|
}, [global, channel, componentData == null ? void 0 : componentData._id, setSelectedComponentReference, setPreviewMode]);
|
|
983
|
-
return
|
|
1014
|
+
return useMemo6(
|
|
984
1015
|
() => ({
|
|
985
1016
|
isContextualEditing,
|
|
986
1017
|
selectedComponentReference,
|
package/dist/index.js
CHANGED
|
@@ -46,7 +46,7 @@ __export(src_exports, {
|
|
|
46
46
|
convertComponentToProps: () => convertComponentToProps,
|
|
47
47
|
createComponentStore: () => createComponentStore,
|
|
48
48
|
createComponentStoreResolver: () => createComponentStoreResolver,
|
|
49
|
-
createUniformApiEnhancer: () =>
|
|
49
|
+
createUniformApiEnhancer: () => import_canvas6.createUniformApiEnhancer,
|
|
50
50
|
getParameterAttributes: () => getParameterAttributes,
|
|
51
51
|
registerUniformComponent: () => registerUniformComponent,
|
|
52
52
|
useCompositionEventEffect: () => useCompositionEventEffect,
|
|
@@ -131,9 +131,9 @@ registerUniformComponent({ type: "${componentType}", component: ${proposedFileNa
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
// src/components/UniformComponent.tsx
|
|
134
|
-
var
|
|
135
|
-
var
|
|
136
|
-
var
|
|
134
|
+
var import_canvas9 = require("@uniformdev/canvas");
|
|
135
|
+
var import_context_react3 = require("@uniformdev/context-react");
|
|
136
|
+
var import_react9 = __toESM(require("react"));
|
|
137
137
|
|
|
138
138
|
// src/helpers/convertComponentToProps.ts
|
|
139
139
|
function convertComponentToProps(component) {
|
|
@@ -192,8 +192,8 @@ var componentStoreResolver = createComponentStoreResolver({
|
|
|
192
192
|
});
|
|
193
193
|
|
|
194
194
|
// src/components/UniformSlot.tsx
|
|
195
|
-
var
|
|
196
|
-
var
|
|
195
|
+
var import_canvas8 = require("@uniformdev/canvas");
|
|
196
|
+
var import_react8 = __toESM(require("react"));
|
|
197
197
|
|
|
198
198
|
// src/defaultSystemComponentResolver.tsx
|
|
199
199
|
var import_canvas2 = require("@uniformdev/canvas");
|
|
@@ -234,8 +234,8 @@ var defaultSystemComponentResolver = {
|
|
|
234
234
|
};
|
|
235
235
|
|
|
236
236
|
// src/components/ContextualEditingComponentWrapper.tsx
|
|
237
|
-
var
|
|
238
|
-
var
|
|
237
|
+
var import_canvas7 = require("@uniformdev/canvas");
|
|
238
|
+
var import_react7 = __toESM(require("react"));
|
|
239
239
|
|
|
240
240
|
// src/components/PureContextualEditingComponentWrapper.tsx
|
|
241
241
|
var import_canvas3 = require("@uniformdev/canvas");
|
|
@@ -271,31 +271,70 @@ var PureContextualEditingComponentWrapper = ({
|
|
|
271
271
|
};
|
|
272
272
|
|
|
273
273
|
// src/components/UniformComposition.tsx
|
|
274
|
-
var
|
|
274
|
+
var import_react6 = __toESM(require("react"));
|
|
275
275
|
|
|
276
|
-
// src/hooks/
|
|
276
|
+
// src/hooks/useClientConditionsComposition.ts
|
|
277
|
+
var import_canvas5 = require("@uniformdev/canvas");
|
|
278
|
+
var import_immer = require("immer");
|
|
279
|
+
var import_react4 = require("react");
|
|
280
|
+
|
|
281
|
+
// src/hooks/useClientVisibilityRules.ts
|
|
277
282
|
var import_canvas4 = require("@uniformdev/canvas");
|
|
283
|
+
var import_context_react2 = require("@uniformdev/context-react");
|
|
278
284
|
var import_react3 = require("react");
|
|
285
|
+
function useClientVisibilityRules() {
|
|
286
|
+
const quirks = (0, import_context_react2.useQuirks)({ throwOnMissingProvider: false });
|
|
287
|
+
return (0, import_react3.useMemo)(() => {
|
|
288
|
+
return {
|
|
289
|
+
...(0, import_canvas4.createQuirksVisibilityRule)(quirks)
|
|
290
|
+
};
|
|
291
|
+
}, [quirks]);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// src/hooks/useClientConditionsComposition.ts
|
|
295
|
+
function useClientConditionsComposition(data) {
|
|
296
|
+
const rules = useClientVisibilityRules();
|
|
297
|
+
const preprocessedValue = (0, import_react4.useMemo)(() => {
|
|
298
|
+
if (!data) {
|
|
299
|
+
return data;
|
|
300
|
+
}
|
|
301
|
+
try {
|
|
302
|
+
return (0, import_immer.produce)(data, (draft) => {
|
|
303
|
+
(0, import_canvas5.walkNodeTree)(draft, (context) => {
|
|
304
|
+
(0, import_canvas5.evaluateWalkTreeVisibility)({ context, rules, showIndeterminate: false });
|
|
305
|
+
});
|
|
306
|
+
});
|
|
307
|
+
} catch (e) {
|
|
308
|
+
console.error("Error evaluating visibility rules:", e.stack);
|
|
309
|
+
return data;
|
|
310
|
+
}
|
|
311
|
+
}, [data, rules]);
|
|
312
|
+
return preprocessedValue;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// src/hooks/useUniformContextualEditing.ts
|
|
316
|
+
var import_canvas6 = require("@uniformdev/canvas");
|
|
317
|
+
var import_react5 = require("react");
|
|
279
318
|
var registeredCompositionIds = /* @__PURE__ */ new Set();
|
|
280
319
|
var useUniformContextualEditing = ({
|
|
281
320
|
initialCompositionValue,
|
|
282
321
|
enhance = (message) => message.composition
|
|
283
322
|
}) => {
|
|
284
|
-
const [contextualComposition, setContextualComposition] = (0,
|
|
285
|
-
const latestEventTimeStamp = (0,
|
|
286
|
-
const channel = (0,
|
|
323
|
+
const [contextualComposition, setContextualComposition] = (0, import_react5.useState)();
|
|
324
|
+
const latestEventTimeStamp = (0, import_react5.useRef)();
|
|
325
|
+
const channel = (0, import_react5.useMemo)(() => {
|
|
287
326
|
var _a;
|
|
288
327
|
if (!isInContextEditingMode()) {
|
|
289
328
|
return;
|
|
290
329
|
}
|
|
291
|
-
const channel2 = (0,
|
|
330
|
+
const channel2 = (0, import_canvas6.createCanvasChannel)({
|
|
292
331
|
broadcastTo: [(_a = window.opener) != null ? _a : window.top],
|
|
293
332
|
listenTo: [window]
|
|
294
333
|
});
|
|
295
334
|
return channel2;
|
|
296
335
|
}, []);
|
|
297
|
-
(0,
|
|
298
|
-
if ((contextualComposition == null ? void 0 : contextualComposition._id) && (initialCompositionValue == null ? void 0 : initialCompositionValue._id) !==
|
|
336
|
+
(0, import_react5.useEffect)(() => {
|
|
337
|
+
if ((contextualComposition == null ? void 0 : contextualComposition._id) && (initialCompositionValue == null ? void 0 : initialCompositionValue._id) !== import_canvas6.EMPTY_COMPOSITION._id && (initialCompositionValue == null ? void 0 : initialCompositionValue._id) !== (contextualComposition == null ? void 0 : contextualComposition._id)) {
|
|
299
338
|
setContextualComposition(void 0);
|
|
300
339
|
return;
|
|
301
340
|
}
|
|
@@ -303,7 +342,7 @@ var useUniformContextualEditing = ({
|
|
|
303
342
|
return;
|
|
304
343
|
}
|
|
305
344
|
const unsubscribeFromCompositionUpdates = channel.on("update-composition-internal", async (message) => {
|
|
306
|
-
if (!(0,
|
|
345
|
+
if (!(0, import_canvas6.isUpdateCompositionInternalMessage)(message)) {
|
|
307
346
|
return;
|
|
308
347
|
}
|
|
309
348
|
if (latestEventTimeStamp.current && message.eventTimestamp && message.eventTimestamp <= latestEventTimeStamp.current) {
|
|
@@ -319,11 +358,11 @@ var useUniformContextualEditing = ({
|
|
|
319
358
|
registeredCompositionIds.delete(initialCompositionValue == null ? void 0 : initialCompositionValue._id);
|
|
320
359
|
};
|
|
321
360
|
}, [channel, enhance, initialCompositionValue == null ? void 0 : initialCompositionValue._id, contextualComposition == null ? void 0 : contextualComposition._id]);
|
|
322
|
-
(0,
|
|
361
|
+
(0, import_react5.useEffect)(() => {
|
|
323
362
|
if (!isInContextEditingMode()) {
|
|
324
363
|
return;
|
|
325
364
|
}
|
|
326
|
-
const existingScript = document.getElementById(
|
|
365
|
+
const existingScript = document.getElementById(import_canvas6.IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID);
|
|
327
366
|
if (existingScript) {
|
|
328
367
|
return;
|
|
329
368
|
}
|
|
@@ -333,7 +372,7 @@ var useUniformContextualEditing = ({
|
|
|
333
372
|
version: 2
|
|
334
373
|
};
|
|
335
374
|
const script = document.createElement("script");
|
|
336
|
-
script.id =
|
|
375
|
+
script.id = import_canvas6.IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID;
|
|
337
376
|
script.src = getCanvasInContextEmbedScriptUrl();
|
|
338
377
|
script.async = true;
|
|
339
378
|
document.head.appendChild(script);
|
|
@@ -352,18 +391,18 @@ function isInContextEditingMode() {
|
|
|
352
391
|
return false;
|
|
353
392
|
}
|
|
354
393
|
const isOpenedByInContextEditor = new URLSearchParams(window.location.search).has(
|
|
355
|
-
|
|
394
|
+
import_canvas6.IN_CONTEXT_EDITOR_QUERY_STRING_PARAM
|
|
356
395
|
);
|
|
357
|
-
return isOpenedByInContextEditor && (0,
|
|
396
|
+
return isOpenedByInContextEditor && (0, import_canvas6.isAllowedReferrer)(window.document.referrer);
|
|
358
397
|
}
|
|
359
398
|
|
|
360
399
|
// src/components/UniformComposition.tsx
|
|
361
|
-
var UniformCompositionContext = (0,
|
|
400
|
+
var UniformCompositionContext = (0, import_react6.createContext)({
|
|
362
401
|
data: void 0,
|
|
363
402
|
isContextualEditing: false
|
|
364
403
|
});
|
|
365
404
|
function useUniformCurrentComposition() {
|
|
366
|
-
return (0,
|
|
405
|
+
return (0, import_react6.useContext)(UniformCompositionContext);
|
|
367
406
|
}
|
|
368
407
|
function UniformComposition({
|
|
369
408
|
data,
|
|
@@ -373,16 +412,17 @@ function UniformComposition({
|
|
|
373
412
|
contextualEditingEnhancer,
|
|
374
413
|
contextualEditingDefaultPlaceholder
|
|
375
414
|
}) {
|
|
415
|
+
const ruledComposition = useClientConditionsComposition(data);
|
|
376
416
|
const { composition, isContextualEditing } = useUniformContextualEditing({
|
|
377
|
-
initialCompositionValue:
|
|
417
|
+
initialCompositionValue: ruledComposition,
|
|
378
418
|
enhance: contextualEditingEnhancer
|
|
379
419
|
});
|
|
380
|
-
return /* @__PURE__ */
|
|
420
|
+
return /* @__PURE__ */ import_react6.default.createElement(
|
|
381
421
|
UniformCompositionContext.Provider,
|
|
382
422
|
{
|
|
383
423
|
value: { data: composition, behaviorTracking, resolveRenderer, isContextualEditing }
|
|
384
424
|
},
|
|
385
|
-
/* @__PURE__ */
|
|
425
|
+
/* @__PURE__ */ import_react6.default.createElement(ContextualEditingComponentWrapper, { component: composition }, /* @__PURE__ */ import_react6.default.createElement(
|
|
386
426
|
UniformComponent,
|
|
387
427
|
{
|
|
388
428
|
data: composition,
|
|
@@ -406,16 +446,16 @@ function ContextualEditingComponentWrapper({
|
|
|
406
446
|
children
|
|
407
447
|
}) {
|
|
408
448
|
var _a;
|
|
409
|
-
const isPlaceholder = (0,
|
|
449
|
+
const isPlaceholder = (0, import_canvas7.isComponentPlaceholderId)(component == null ? void 0 : component._id);
|
|
410
450
|
const { isContextualEditing } = useUniformCurrentComposition();
|
|
411
451
|
const isReadOnly = ((_a = component == null ? void 0 : component._contextualEditing) == null ? void 0 : _a.isEditable) ? void 0 : "true";
|
|
412
452
|
if (!isContextualEditing) {
|
|
413
|
-
return /* @__PURE__ */
|
|
453
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, children);
|
|
414
454
|
}
|
|
415
455
|
if (isPlaceholder && emptyPlaceholder === null) {
|
|
416
456
|
return null;
|
|
417
457
|
}
|
|
418
|
-
return /* @__PURE__ */
|
|
458
|
+
return /* @__PURE__ */ import_react7.default.createElement(
|
|
419
459
|
PureContextualEditingComponentWrapper,
|
|
420
460
|
{
|
|
421
461
|
isPlaceholder,
|
|
@@ -445,7 +485,7 @@ function UniformSlot({
|
|
|
445
485
|
}
|
|
446
486
|
const slot = (_a = parentData.slots) == null ? void 0 : _a[name];
|
|
447
487
|
if (!slot || !Array.isArray(slot)) {
|
|
448
|
-
if (process.env.NODE_ENV === "development" && parentData.type !==
|
|
488
|
+
if (process.env.NODE_ENV === "development" && parentData.type !== import_canvas8.EMPTY_COMPOSITION.type) {
|
|
449
489
|
console.warn(
|
|
450
490
|
`[canvas-dev] slot '${name}' was rendered, but it was not defined on its component. This is expected if the slot is optional, otherwise it may indicate a typo. Component:`,
|
|
451
491
|
parentData
|
|
@@ -466,13 +506,13 @@ function UniformSlot({
|
|
|
466
506
|
emptyPlaceholder
|
|
467
507
|
});
|
|
468
508
|
const elements = children ? children({ child, component, key: `wrapped-inner-${index}` }) : child;
|
|
469
|
-
return
|
|
509
|
+
return import_react8.default.createElement(import_react8.default.Fragment, { key: index }, elements);
|
|
470
510
|
});
|
|
471
511
|
if (!wrapperComponent) {
|
|
472
|
-
return
|
|
512
|
+
return import_react8.default.createElement(import_react8.default.Fragment, void 0, finalChildren);
|
|
473
513
|
}
|
|
474
514
|
const Wrapper = wrapperComponent;
|
|
475
|
-
return /* @__PURE__ */
|
|
515
|
+
return /* @__PURE__ */ import_react8.default.createElement(Wrapper, { items: finalChildren, slotName: name });
|
|
476
516
|
}
|
|
477
517
|
function renderComponent({
|
|
478
518
|
component,
|
|
@@ -485,7 +525,7 @@ function renderComponent({
|
|
|
485
525
|
emptyPlaceholder
|
|
486
526
|
}) {
|
|
487
527
|
const RenderComponent = resolveRenderer == null ? void 0 : resolveRenderer(component);
|
|
488
|
-
if (component.type ===
|
|
528
|
+
if (component.type === import_canvas8.CANVAS_TEST_TYPE) {
|
|
489
529
|
const testComponent = defaultSystemComponentResolver.test(
|
|
490
530
|
component,
|
|
491
531
|
key,
|
|
@@ -496,15 +536,15 @@ function renderComponent({
|
|
|
496
536
|
resolveRenderer,
|
|
497
537
|
key: key2,
|
|
498
538
|
parentComponent: component,
|
|
499
|
-
slotName:
|
|
500
|
-
slotChildrenCount: (_a = component == null ? void 0 : component.slots) == null ? void 0 : _a[
|
|
501
|
-
indexInSlot: (_b = component == null ? void 0 : component.slots) == null ? void 0 : _b[
|
|
539
|
+
slotName: import_canvas8.CANVAS_TEST_SLOT,
|
|
540
|
+
slotChildrenCount: (_a = component == null ? void 0 : component.slots) == null ? void 0 : _a[import_canvas8.CANVAS_TEST_SLOT].length,
|
|
541
|
+
indexInSlot: (_b = component == null ? void 0 : component.slots) == null ? void 0 : _b[import_canvas8.CANVAS_TEST_SLOT].findIndex(
|
|
502
542
|
({ _id }) => variantComponent._id === _id
|
|
503
543
|
)
|
|
504
544
|
});
|
|
505
545
|
}
|
|
506
546
|
);
|
|
507
|
-
return /* @__PURE__ */
|
|
547
|
+
return /* @__PURE__ */ import_react8.default.createElement(
|
|
508
548
|
ContextualEditingComponentWrapper,
|
|
509
549
|
{
|
|
510
550
|
component,
|
|
@@ -516,7 +556,7 @@ function renderComponent({
|
|
|
516
556
|
},
|
|
517
557
|
testComponent
|
|
518
558
|
);
|
|
519
|
-
} else if (component.type ===
|
|
559
|
+
} else if (component.type === import_canvas8.CANVAS_PERSONALIZE_TYPE) {
|
|
520
560
|
const personalizationComponent = defaultSystemComponentResolver.personalization(
|
|
521
561
|
component,
|
|
522
562
|
key,
|
|
@@ -527,15 +567,15 @@ function renderComponent({
|
|
|
527
567
|
resolveRenderer,
|
|
528
568
|
key: key2,
|
|
529
569
|
parentComponent: component,
|
|
530
|
-
slotName:
|
|
531
|
-
slotChildrenCount: (_a = component == null ? void 0 : component.slots) == null ? void 0 : _a[
|
|
532
|
-
indexInSlot: (_b = component == null ? void 0 : component.slots) == null ? void 0 : _b[
|
|
570
|
+
slotName: import_canvas8.CANVAS_PERSONALIZE_SLOT,
|
|
571
|
+
slotChildrenCount: (_a = component == null ? void 0 : component.slots) == null ? void 0 : _a[import_canvas8.CANVAS_PERSONALIZE_SLOT].length,
|
|
572
|
+
indexInSlot: (_b = component == null ? void 0 : component.slots) == null ? void 0 : _b[import_canvas8.CANVAS_PERSONALIZE_SLOT].findIndex(
|
|
533
573
|
({ _id }) => variantComponent._id === _id
|
|
534
574
|
)
|
|
535
575
|
});
|
|
536
576
|
}
|
|
537
577
|
);
|
|
538
|
-
return /* @__PURE__ */
|
|
578
|
+
return /* @__PURE__ */ import_react8.default.createElement(
|
|
539
579
|
ContextualEditingComponentWrapper,
|
|
540
580
|
{
|
|
541
581
|
component,
|
|
@@ -549,7 +589,7 @@ function renderComponent({
|
|
|
549
589
|
);
|
|
550
590
|
} else if (RenderComponent) {
|
|
551
591
|
const props = convertComponentToProps(component);
|
|
552
|
-
return /* @__PURE__ */
|
|
592
|
+
return /* @__PURE__ */ import_react8.default.createElement(UniformComponent, { key, data: component, resolveRenderer }, /* @__PURE__ */ import_react8.default.createElement(
|
|
553
593
|
ContextualEditingComponentWrapper,
|
|
554
594
|
{
|
|
555
595
|
component,
|
|
@@ -559,7 +599,7 @@ function renderComponent({
|
|
|
559
599
|
slotChildrenCount,
|
|
560
600
|
emptyPlaceholder
|
|
561
601
|
},
|
|
562
|
-
/* @__PURE__ */
|
|
602
|
+
/* @__PURE__ */ import_react8.default.createElement(RenderComponent, { ...props })
|
|
563
603
|
));
|
|
564
604
|
} else if (process.env.NODE_ENV !== "production") {
|
|
565
605
|
console.warn(
|
|
@@ -572,9 +612,9 @@ function renderComponent({
|
|
|
572
612
|
}
|
|
573
613
|
|
|
574
614
|
// src/components/UniformComponent.tsx
|
|
575
|
-
var UniformComponentContext = (0,
|
|
615
|
+
var UniformComponentContext = (0, import_react9.createContext)({});
|
|
576
616
|
function useUniformCurrentComponent() {
|
|
577
|
-
return (0,
|
|
617
|
+
return (0, import_react9.useContext)(UniformComponentContext);
|
|
578
618
|
}
|
|
579
619
|
function UniformComponent({
|
|
580
620
|
data,
|
|
@@ -585,7 +625,7 @@ function UniformComponent({
|
|
|
585
625
|
}) {
|
|
586
626
|
var _a, _b, _c;
|
|
587
627
|
const parentData = useUniformCurrentComponent();
|
|
588
|
-
const contextContextProviderPresent = (0,
|
|
628
|
+
const contextContextProviderPresent = (0, import_context_react3.useUniformContext)({ throwOnMissingProvider: false }) !== void 0;
|
|
589
629
|
if (!data) {
|
|
590
630
|
if (process.env.NODE_ENV === "development") {
|
|
591
631
|
console.warn(`[canvas-dev] UniformComponent was rendered with no data, nothing will be output.`);
|
|
@@ -598,17 +638,17 @@ function UniformComponent({
|
|
|
598
638
|
behaviorTracking: (_a = behaviorTracking != null ? behaviorTracking : parentData == null ? void 0 : parentData.behaviorTracking) != null ? _a : "onView",
|
|
599
639
|
contextualEditingDefaultPlaceholder: contextualEditingDefaultPlaceholder != null ? contextualEditingDefaultPlaceholder : parentData.contextualEditingDefaultPlaceholder
|
|
600
640
|
};
|
|
601
|
-
const enrichmentTags = (_c = (_b = data.parameters) == null ? void 0 : _b[
|
|
602
|
-
const TrackComponent = contextValue.behaviorTracking === "onLoad" ?
|
|
641
|
+
const enrichmentTags = (_c = (_b = data.parameters) == null ? void 0 : _b[import_canvas9.CANVAS_ENRICHMENT_TAG_PARAM]) == null ? void 0 : _c.value;
|
|
642
|
+
const TrackComponent = contextValue.behaviorTracking === "onLoad" ? import_context_react3.TrackFragment : import_context_react3.Track;
|
|
603
643
|
const resolvedChildren = resolveChildren({
|
|
604
644
|
children,
|
|
605
645
|
data,
|
|
606
646
|
hasParentLayout: Boolean(parentData.data),
|
|
607
647
|
resolveRenderer: contextValue.resolveRenderer
|
|
608
648
|
});
|
|
609
|
-
return /* @__PURE__ */
|
|
649
|
+
return /* @__PURE__ */ import_react9.default.createElement(UniformComponentContext.Provider, { value: contextValue }, contextContextProviderPresent ? (
|
|
610
650
|
/* auto-track behavior signals when in a Canvas context */
|
|
611
|
-
/* @__PURE__ */
|
|
651
|
+
/* @__PURE__ */ import_react9.default.createElement(TrackComponent, { behavior: enrichmentTags }, resolvedChildren)
|
|
612
652
|
) : resolvedChildren);
|
|
613
653
|
}
|
|
614
654
|
function resolveChildren({
|
|
@@ -621,14 +661,14 @@ function resolveChildren({
|
|
|
621
661
|
if (!children && !hasParentLayout) {
|
|
622
662
|
const topLevelComponent = resolveRenderer({ type: data.type });
|
|
623
663
|
if (topLevelComponent) {
|
|
624
|
-
children =
|
|
664
|
+
children = import_react9.default.createElement(topLevelComponent, convertComponentToProps(data));
|
|
625
665
|
} else {
|
|
626
666
|
if (Object.keys((_a = data.slots) != null ? _a : {}).length > 1 && process.env.NODE_ENV === "development") {
|
|
627
667
|
console.warn(
|
|
628
668
|
`[canvas-dev] All the slots in component '${data.type}' are rendered in no particular order. Use '<UniformSlot name={slotName} />' to reliably render the slots.`
|
|
629
669
|
);
|
|
630
670
|
}
|
|
631
|
-
children = Object.keys(data.slots || {}).map((slotName) => /* @__PURE__ */
|
|
671
|
+
children = Object.keys(data.slots || {}).map((slotName) => /* @__PURE__ */ import_react9.default.createElement(UniformSlot, { key: slotName, name: slotName }));
|
|
632
672
|
}
|
|
633
673
|
}
|
|
634
674
|
const renderChildren = typeof children === "function" ? children(convertComponentToProps(data)) : children;
|
|
@@ -636,47 +676,38 @@ function resolveChildren({
|
|
|
636
676
|
}
|
|
637
677
|
|
|
638
678
|
// src/components/UniformPlayground.tsx
|
|
639
|
-
var
|
|
640
|
-
var
|
|
679
|
+
var import_canvas10 = require("@uniformdev/canvas");
|
|
680
|
+
var import_react10 = __toESM(require("react"));
|
|
641
681
|
var UniformPlayground = ({
|
|
642
682
|
resolveRenderer,
|
|
643
683
|
decorators = [],
|
|
644
684
|
contextualEditingEnhancer,
|
|
645
685
|
behaviorTracking,
|
|
646
|
-
contextualEditingDefaultPlaceholder
|
|
647
|
-
children
|
|
686
|
+
contextualEditingDefaultPlaceholder
|
|
648
687
|
}) => {
|
|
649
688
|
const { composition, isContextualEditing } = useUniformContextualEditing({
|
|
650
|
-
initialCompositionValue:
|
|
689
|
+
initialCompositionValue: import_canvas10.EMPTY_COMPOSITION,
|
|
651
690
|
enhance: contextualEditingEnhancer
|
|
652
691
|
});
|
|
653
|
-
const renderedComponent = (0,
|
|
692
|
+
const renderedComponent = (0, import_react10.useMemo)(() => {
|
|
654
693
|
if (!composition) {
|
|
655
694
|
return null;
|
|
656
695
|
}
|
|
657
|
-
let component = /* @__PURE__ */
|
|
696
|
+
let component = /* @__PURE__ */ import_react10.default.createElement(ContextualEditingComponentWrapper, { component: composition }, /* @__PURE__ */ import_react10.default.createElement(
|
|
658
697
|
UniformComponent,
|
|
659
698
|
{
|
|
660
699
|
data: composition,
|
|
661
700
|
behaviorTracking,
|
|
662
701
|
resolveRenderer,
|
|
663
702
|
contextualEditingDefaultPlaceholder
|
|
664
|
-
}
|
|
665
|
-
children
|
|
703
|
+
}
|
|
666
704
|
));
|
|
667
705
|
decorators.forEach((Decorator) => {
|
|
668
|
-
component = /* @__PURE__ */
|
|
706
|
+
component = /* @__PURE__ */ import_react10.default.createElement(Decorator, { data: composition }, component);
|
|
669
707
|
});
|
|
670
708
|
return component;
|
|
671
|
-
}, [
|
|
672
|
-
|
|
673
|
-
resolveRenderer,
|
|
674
|
-
decorators,
|
|
675
|
-
composition,
|
|
676
|
-
behaviorTracking,
|
|
677
|
-
contextualEditingDefaultPlaceholder
|
|
678
|
-
]);
|
|
679
|
-
return /* @__PURE__ */ import_react8.default.createElement(
|
|
709
|
+
}, [resolveRenderer, decorators, composition, behaviorTracking, contextualEditingDefaultPlaceholder]);
|
|
710
|
+
return /* @__PURE__ */ import_react10.default.createElement(
|
|
680
711
|
UniformCompositionContext.Provider,
|
|
681
712
|
{
|
|
682
713
|
value: { data: composition, behaviorTracking, resolveRenderer, isContextualEditing }
|
|
@@ -686,57 +717,57 @@ var UniformPlayground = ({
|
|
|
686
717
|
};
|
|
687
718
|
|
|
688
719
|
// src/components/UniformRichText/UniformRichText.tsx
|
|
689
|
-
var
|
|
720
|
+
var import_canvas11 = require("@uniformdev/canvas");
|
|
690
721
|
var import_richtext5 = require("@uniformdev/richtext");
|
|
691
|
-
var
|
|
722
|
+
var import_react20 = __toESM(require("react"));
|
|
692
723
|
|
|
693
724
|
// src/components/UniformRichText/UniformRichTextNode.tsx
|
|
694
725
|
var import_richtext4 = require("@uniformdev/richtext");
|
|
695
|
-
var
|
|
726
|
+
var import_react19 = __toESM(require("react"));
|
|
696
727
|
|
|
697
728
|
// src/components/UniformRichText/nodes/HeadingRichTextNode.tsx
|
|
698
|
-
var
|
|
729
|
+
var import_react11 = __toESM(require("react"));
|
|
699
730
|
var HeadingRichTextNode = ({ children, node }) => {
|
|
700
731
|
const { tag } = node;
|
|
701
732
|
const HTag = tag != null ? tag : "h1";
|
|
702
|
-
return /* @__PURE__ */
|
|
733
|
+
return /* @__PURE__ */ import_react11.default.createElement(HTag, null, children);
|
|
703
734
|
};
|
|
704
735
|
|
|
705
736
|
// src/components/UniformRichText/nodes/LinebreakRichTextNode.tsx
|
|
706
|
-
var
|
|
737
|
+
var import_react12 = __toESM(require("react"));
|
|
707
738
|
var LinebreakRichTextNode = () => {
|
|
708
|
-
return /* @__PURE__ */
|
|
739
|
+
return /* @__PURE__ */ import_react12.default.createElement("br", null);
|
|
709
740
|
};
|
|
710
741
|
|
|
711
742
|
// src/components/UniformRichText/nodes/LinkRichTextNode.tsx
|
|
712
743
|
var import_richtext = require("@uniformdev/richtext");
|
|
713
|
-
var
|
|
744
|
+
var import_react13 = __toESM(require("react"));
|
|
714
745
|
var LinkRichTextNode = ({ children, node }) => {
|
|
715
746
|
const { link } = node;
|
|
716
|
-
return /* @__PURE__ */
|
|
747
|
+
return /* @__PURE__ */ import_react13.default.createElement("a", { href: (0, import_richtext.linkParamValueToHref)(link) }, children);
|
|
717
748
|
};
|
|
718
749
|
|
|
719
750
|
// src/components/UniformRichText/nodes/ListItemRichTextNode.tsx
|
|
720
|
-
var
|
|
751
|
+
var import_react14 = __toESM(require("react"));
|
|
721
752
|
var ListItemRichTextNode = ({ children, node }) => {
|
|
722
753
|
const { value } = node;
|
|
723
|
-
return /* @__PURE__ */
|
|
754
|
+
return /* @__PURE__ */ import_react14.default.createElement("li", { value: Number.isFinite(value) && value > 0 ? value : void 0 }, children);
|
|
724
755
|
};
|
|
725
756
|
|
|
726
757
|
// src/components/UniformRichText/nodes/ListRichTextNode.tsx
|
|
727
|
-
var
|
|
758
|
+
var import_react15 = __toESM(require("react"));
|
|
728
759
|
var ListRichTextNode = ({ children, node }) => {
|
|
729
760
|
const { tag, start } = node;
|
|
730
761
|
const ListTag = tag != null ? tag : "ul";
|
|
731
|
-
return /* @__PURE__ */
|
|
762
|
+
return /* @__PURE__ */ import_react15.default.createElement(ListTag, { start: Number.isFinite(start) && start > 0 ? start : void 0 }, children);
|
|
732
763
|
};
|
|
733
764
|
|
|
734
765
|
// src/components/UniformRichText/nodes/ParagraphRichTextNode.tsx
|
|
735
766
|
var import_richtext2 = require("@uniformdev/richtext");
|
|
736
|
-
var
|
|
767
|
+
var import_react16 = __toESM(require("react"));
|
|
737
768
|
var ParagraphRichTextNode = ({ children, node }) => {
|
|
738
769
|
const { format, direction } = node;
|
|
739
|
-
return /* @__PURE__ */
|
|
770
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
740
771
|
"p",
|
|
741
772
|
{
|
|
742
773
|
dir: (0, import_richtext2.isPureDirection)(direction) ? direction : void 0,
|
|
@@ -747,18 +778,18 @@ var ParagraphRichTextNode = ({ children, node }) => {
|
|
|
747
778
|
};
|
|
748
779
|
|
|
749
780
|
// src/components/UniformRichText/nodes/TabRichTextNode.tsx
|
|
750
|
-
var
|
|
781
|
+
var import_react17 = __toESM(require("react"));
|
|
751
782
|
var TabRichTextNode = () => {
|
|
752
|
-
return /* @__PURE__ */
|
|
783
|
+
return /* @__PURE__ */ import_react17.default.createElement(import_react17.default.Fragment, null, " ");
|
|
753
784
|
};
|
|
754
785
|
|
|
755
786
|
// src/components/UniformRichText/nodes/TextRichTextNode.tsx
|
|
756
787
|
var import_richtext3 = require("@uniformdev/richtext");
|
|
757
|
-
var
|
|
788
|
+
var import_react18 = __toESM(require("react"));
|
|
758
789
|
var TextRichTextNode = ({ node }) => {
|
|
759
790
|
const { text, format } = node;
|
|
760
791
|
const tags = (0, import_richtext3.getRichTextTagsFromTextFormat)(format);
|
|
761
|
-
return /* @__PURE__ */
|
|
792
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, tags.length > 0 ? tags.reduceRight((children, Tag) => /* @__PURE__ */ import_react18.default.createElement(Tag, null, children), text) : text);
|
|
762
793
|
};
|
|
763
794
|
|
|
764
795
|
// src/components/UniformRichText/UniformRichTextNode.tsx
|
|
@@ -772,8 +803,8 @@ function UniformRichTextNode({ node, ...props }) {
|
|
|
772
803
|
if (!NodeRenderer) {
|
|
773
804
|
return null;
|
|
774
805
|
}
|
|
775
|
-
const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */
|
|
776
|
-
return /* @__PURE__ */
|
|
806
|
+
const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */ import_react19.default.createElement(UniformRichTextNode, { ...props, key: i, node: childNode })) : null;
|
|
807
|
+
return /* @__PURE__ */ import_react19.default.createElement(NodeRenderer, { node }, children);
|
|
777
808
|
}
|
|
778
809
|
var rendererMap = /* @__PURE__ */ new Map([
|
|
779
810
|
["heading", HeadingRichTextNode],
|
|
@@ -782,12 +813,12 @@ var rendererMap = /* @__PURE__ */ new Map([
|
|
|
782
813
|
["list", ListRichTextNode],
|
|
783
814
|
["listitem", ListItemRichTextNode],
|
|
784
815
|
["paragraph", ParagraphRichTextNode],
|
|
785
|
-
["quote", ({ children }) => /* @__PURE__ */
|
|
816
|
+
["quote", ({ children }) => /* @__PURE__ */ import_react19.default.createElement("blockquote", null, children)],
|
|
786
817
|
[
|
|
787
818
|
"code",
|
|
788
|
-
({ children }) => /* @__PURE__ */
|
|
819
|
+
({ children }) => /* @__PURE__ */ import_react19.default.createElement("pre", null, /* @__PURE__ */ import_react19.default.createElement("code", null, children))
|
|
789
820
|
],
|
|
790
|
-
["root", ({ children }) => /* @__PURE__ */
|
|
821
|
+
["root", ({ children }) => /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, children)],
|
|
791
822
|
["text", TextRichTextNode],
|
|
792
823
|
["tab", TabRichTextNode]
|
|
793
824
|
]);
|
|
@@ -796,34 +827,34 @@ var resolveRichTextDefaultRenderer = (node) => {
|
|
|
796
827
|
};
|
|
797
828
|
|
|
798
829
|
// src/components/UniformRichText/UniformRichText.tsx
|
|
799
|
-
var UniformRichText =
|
|
830
|
+
var UniformRichText = import_react20.default.forwardRef(function UniformRichText2({ parameterId, resolveRichTextRenderer, as: Tag = "div", ...props }, ref) {
|
|
800
831
|
const { data: componentData } = useUniformCurrentComponent();
|
|
801
|
-
const parameter = (0,
|
|
832
|
+
const parameter = (0, import_react20.useMemo)(() => {
|
|
802
833
|
var _a;
|
|
803
834
|
return (_a = componentData == null ? void 0 : componentData.parameters) == null ? void 0 : _a[parameterId];
|
|
804
835
|
}, [componentData, parameterId]);
|
|
805
|
-
const value = (0,
|
|
836
|
+
const value = (0, import_react20.useMemo)(() => parameter == null ? void 0 : parameter.value, [parameter]);
|
|
806
837
|
if (!value || !(0, import_richtext5.isRichTextValue)(value) || (0, import_richtext5.isRichTextValueConsideredEmpty)(value)) return null;
|
|
807
|
-
return Tag === null ? /* @__PURE__ */
|
|
838
|
+
return Tag === null ? /* @__PURE__ */ import_react20.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ import_react20.default.createElement(
|
|
808
839
|
Tag,
|
|
809
840
|
{
|
|
810
841
|
ref,
|
|
811
842
|
...props,
|
|
812
843
|
...{
|
|
813
|
-
[
|
|
814
|
-
[
|
|
815
|
-
[
|
|
844
|
+
[import_canvas11.ATTRIBUTE_COMPONENT_ID]: componentData == null ? void 0 : componentData._id,
|
|
845
|
+
[import_canvas11.ATTRIBUTE_PARAMETER_ID]: parameterId,
|
|
846
|
+
[import_canvas11.ATTRIBUTE_PARAMETER_TYPE]: "richText"
|
|
816
847
|
}
|
|
817
848
|
},
|
|
818
|
-
/* @__PURE__ */
|
|
849
|
+
/* @__PURE__ */ import_react20.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
|
|
819
850
|
);
|
|
820
851
|
});
|
|
821
852
|
|
|
822
853
|
// src/components/UniformText.tsx
|
|
823
|
-
var
|
|
854
|
+
var import_react22 = __toESM(require("react"));
|
|
824
855
|
|
|
825
856
|
// src/components/PureUniformText.tsx
|
|
826
|
-
var
|
|
857
|
+
var import_react21 = __toESM(require("react"));
|
|
827
858
|
var PureUniformText = ({
|
|
828
859
|
as: Tag = "span",
|
|
829
860
|
parameterId,
|
|
@@ -842,10 +873,10 @@ var PureUniformText = ({
|
|
|
842
873
|
return null;
|
|
843
874
|
}
|
|
844
875
|
if (!isContextualEditing) {
|
|
845
|
-
return /* @__PURE__ */
|
|
876
|
+
return /* @__PURE__ */ import_react21.default.createElement(Tag, { style: isMultiline ? { whiteSpace: "pre-wrap" } : {}, ...props }, render(value));
|
|
846
877
|
}
|
|
847
878
|
const computedPlaceholder = typeof placeholder === "function" ? placeholder({ id: parameterId }) : placeholder;
|
|
848
|
-
return /* @__PURE__ */
|
|
879
|
+
return /* @__PURE__ */ import_react21.default.createElement(
|
|
849
880
|
Tag,
|
|
850
881
|
{
|
|
851
882
|
...props,
|
|
@@ -874,7 +905,7 @@ var UniformText = ({
|
|
|
874
905
|
var _a, _b, _c;
|
|
875
906
|
const { data: componentData, contextualEditingDefaultPlaceholder } = useUniformCurrentComponent();
|
|
876
907
|
const { isContextualEditing } = useUniformCurrentComposition();
|
|
877
|
-
const [isFocused, setIsFocused] = (0,
|
|
908
|
+
const [isFocused, setIsFocused] = (0, import_react22.useState)(false);
|
|
878
909
|
const parameter = (_a = componentData == null ? void 0 : componentData.parameters) == null ? void 0 : _a[parameterId];
|
|
879
910
|
const isEditable = (_c = (_b = parameter == null ? void 0 : parameter._contextualEditing) == null ? void 0 : _b.isEditable) != null ? _c : false;
|
|
880
911
|
const shouldSkipCustomRendering = isFocused && isEditable;
|
|
@@ -883,7 +914,7 @@ var UniformText = ({
|
|
|
883
914
|
}
|
|
884
915
|
const placeholderProp = placeholder != null ? placeholder : contextualEditingDefaultPlaceholder;
|
|
885
916
|
const computedPlaceholder = typeof placeholderProp === "function" ? placeholderProp({ id: parameterId }) : placeholderProp;
|
|
886
|
-
return /* @__PURE__ */
|
|
917
|
+
return /* @__PURE__ */ import_react22.default.createElement(
|
|
887
918
|
PureUniformText,
|
|
888
919
|
{
|
|
889
920
|
...props,
|
|
@@ -906,35 +937,35 @@ var UniformText = ({
|
|
|
906
937
|
};
|
|
907
938
|
|
|
908
939
|
// src/helpers/getParameterAttributes.ts
|
|
909
|
-
var
|
|
940
|
+
var import_canvas12 = require("@uniformdev/canvas");
|
|
910
941
|
var getParameterAttributes = (options) => {
|
|
911
942
|
return {
|
|
912
|
-
...(0,
|
|
943
|
+
...(0, import_canvas12.getParameterAttributes)(options),
|
|
913
944
|
suppressContentEditableWarning: true
|
|
914
945
|
};
|
|
915
946
|
};
|
|
916
947
|
|
|
917
948
|
// src/hooks/useCompositionEventEffect.ts
|
|
918
|
-
var
|
|
919
|
-
var
|
|
949
|
+
var import_canvas13 = require("@uniformdev/canvas");
|
|
950
|
+
var import_react23 = require("react");
|
|
920
951
|
function useCompositionEventEffect({
|
|
921
952
|
enabled,
|
|
922
953
|
projectId,
|
|
923
954
|
compositionId,
|
|
924
955
|
effect
|
|
925
956
|
}) {
|
|
926
|
-
(0,
|
|
957
|
+
(0, import_react23.useEffect)(() => {
|
|
927
958
|
if (!enabled || !compositionId || !projectId) {
|
|
928
959
|
return;
|
|
929
960
|
}
|
|
930
961
|
let goodbye = void 0;
|
|
931
962
|
const loadEffect = async () => {
|
|
932
|
-
const eventBus = await (0,
|
|
963
|
+
const eventBus = await (0, import_canvas13.createEventBus)();
|
|
933
964
|
if (eventBus) {
|
|
934
|
-
goodbye = (0,
|
|
965
|
+
goodbye = (0, import_canvas13.subscribeToComposition)({
|
|
935
966
|
eventBus,
|
|
936
967
|
compositionId,
|
|
937
|
-
compositionState:
|
|
968
|
+
compositionState: import_canvas13.CANVAS_DRAFT_STATE,
|
|
938
969
|
projectId,
|
|
939
970
|
callback: effect,
|
|
940
971
|
event: "updated"
|
|
@@ -951,28 +982,28 @@ function useCompositionEventEffect({
|
|
|
951
982
|
}
|
|
952
983
|
|
|
953
984
|
// src/hooks/useUniformContextualEditingState.ts
|
|
954
|
-
var
|
|
955
|
-
var
|
|
985
|
+
var import_canvas14 = require("@uniformdev/canvas");
|
|
986
|
+
var import_react24 = require("react");
|
|
956
987
|
var useUniformContextualEditingState = ({
|
|
957
988
|
global = false
|
|
958
989
|
} = {}) => {
|
|
959
990
|
const { isContextualEditing } = useUniformCurrentComposition();
|
|
960
991
|
const { data: componentData } = useUniformCurrentComponent();
|
|
961
|
-
const [selectedComponentReference, setSelectedComponentReference] = (0,
|
|
962
|
-
const [previewMode, setPreviewMode] = (0,
|
|
992
|
+
const [selectedComponentReference, setSelectedComponentReference] = (0, import_react24.useState)();
|
|
993
|
+
const [previewMode, setPreviewMode] = (0, import_react24.useState)(
|
|
963
994
|
isContextualEditing ? "editor" : void 0
|
|
964
995
|
);
|
|
965
|
-
const channel = (0,
|
|
996
|
+
const channel = (0, import_react24.useMemo)(() => {
|
|
966
997
|
if (!isContextualEditing) {
|
|
967
998
|
return;
|
|
968
999
|
}
|
|
969
|
-
const channel2 = (0,
|
|
1000
|
+
const channel2 = (0, import_canvas14.createCanvasChannel)({
|
|
970
1001
|
broadcastTo: [window],
|
|
971
1002
|
listenTo: [window]
|
|
972
1003
|
});
|
|
973
1004
|
return channel2;
|
|
974
1005
|
}, [isContextualEditing]);
|
|
975
|
-
(0,
|
|
1006
|
+
(0, import_react24.useEffect)(() => {
|
|
976
1007
|
var _a, _b;
|
|
977
1008
|
if (!channel) {
|
|
978
1009
|
return;
|
|
@@ -982,7 +1013,7 @@ var useUniformContextualEditingState = ({
|
|
|
982
1013
|
}
|
|
983
1014
|
const unsubscribe = channel.on("update-contextual-editing-state-internal", async (message) => {
|
|
984
1015
|
var _a2;
|
|
985
|
-
if (!(0,
|
|
1016
|
+
if (!(0, import_canvas14.isUpdateContextualEditingStateInternalMessage)(message)) {
|
|
986
1017
|
return;
|
|
987
1018
|
}
|
|
988
1019
|
setPreviewMode(message.state.previewMode);
|
|
@@ -996,7 +1027,7 @@ var useUniformContextualEditingState = ({
|
|
|
996
1027
|
unsubscribe();
|
|
997
1028
|
};
|
|
998
1029
|
}, [global, channel, componentData == null ? void 0 : componentData._id, setSelectedComponentReference, setPreviewMode]);
|
|
999
|
-
return (0,
|
|
1030
|
+
return (0, import_react24.useMemo)(
|
|
1000
1031
|
() => ({
|
|
1001
1032
|
isContextualEditing,
|
|
1002
1033
|
selectedComponentReference,
|
package/dist/index.mjs
CHANGED
|
@@ -233,6 +233,45 @@ var PureContextualEditingComponentWrapper = ({
|
|
|
233
233
|
// src/components/UniformComposition.tsx
|
|
234
234
|
import React4, { createContext, useContext } from "react";
|
|
235
235
|
|
|
236
|
+
// src/hooks/useClientConditionsComposition.ts
|
|
237
|
+
import { evaluateWalkTreeVisibility, walkNodeTree } from "@uniformdev/canvas";
|
|
238
|
+
import { produce } from "immer";
|
|
239
|
+
import { useMemo as useMemo2 } from "react";
|
|
240
|
+
|
|
241
|
+
// src/hooks/useClientVisibilityRules.ts
|
|
242
|
+
import { createQuirksVisibilityRule } from "@uniformdev/canvas";
|
|
243
|
+
import { useQuirks } from "@uniformdev/context-react";
|
|
244
|
+
import { useMemo } from "react";
|
|
245
|
+
function useClientVisibilityRules() {
|
|
246
|
+
const quirks = useQuirks({ throwOnMissingProvider: false });
|
|
247
|
+
return useMemo(() => {
|
|
248
|
+
return {
|
|
249
|
+
...createQuirksVisibilityRule(quirks)
|
|
250
|
+
};
|
|
251
|
+
}, [quirks]);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// src/hooks/useClientConditionsComposition.ts
|
|
255
|
+
function useClientConditionsComposition(data) {
|
|
256
|
+
const rules = useClientVisibilityRules();
|
|
257
|
+
const preprocessedValue = useMemo2(() => {
|
|
258
|
+
if (!data) {
|
|
259
|
+
return data;
|
|
260
|
+
}
|
|
261
|
+
try {
|
|
262
|
+
return produce(data, (draft) => {
|
|
263
|
+
walkNodeTree(draft, (context) => {
|
|
264
|
+
evaluateWalkTreeVisibility({ context, rules, showIndeterminate: false });
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
} catch (e) {
|
|
268
|
+
console.error("Error evaluating visibility rules:", e.stack);
|
|
269
|
+
return data;
|
|
270
|
+
}
|
|
271
|
+
}, [data, rules]);
|
|
272
|
+
return preprocessedValue;
|
|
273
|
+
}
|
|
274
|
+
|
|
236
275
|
// src/hooks/useUniformContextualEditing.ts
|
|
237
276
|
import {
|
|
238
277
|
createCanvasChannel,
|
|
@@ -243,7 +282,7 @@ import {
|
|
|
243
282
|
isAllowedReferrer,
|
|
244
283
|
isUpdateCompositionInternalMessage
|
|
245
284
|
} from "@uniformdev/canvas";
|
|
246
|
-
import { useEffect, useMemo, useRef, useState } from "react";
|
|
285
|
+
import { useEffect, useMemo as useMemo3, useRef, useState } from "react";
|
|
247
286
|
var registeredCompositionIds = /* @__PURE__ */ new Set();
|
|
248
287
|
var useUniformContextualEditing = ({
|
|
249
288
|
initialCompositionValue,
|
|
@@ -251,7 +290,7 @@ var useUniformContextualEditing = ({
|
|
|
251
290
|
}) => {
|
|
252
291
|
const [contextualComposition, setContextualComposition] = useState();
|
|
253
292
|
const latestEventTimeStamp = useRef();
|
|
254
|
-
const channel =
|
|
293
|
+
const channel = useMemo3(() => {
|
|
255
294
|
var _a;
|
|
256
295
|
if (!isInContextEditingMode()) {
|
|
257
296
|
return;
|
|
@@ -341,8 +380,9 @@ function UniformComposition({
|
|
|
341
380
|
contextualEditingEnhancer,
|
|
342
381
|
contextualEditingDefaultPlaceholder
|
|
343
382
|
}) {
|
|
383
|
+
const ruledComposition = useClientConditionsComposition(data);
|
|
344
384
|
const { composition, isContextualEditing } = useUniformContextualEditing({
|
|
345
|
-
initialCompositionValue:
|
|
385
|
+
initialCompositionValue: ruledComposition,
|
|
346
386
|
enhance: contextualEditingEnhancer
|
|
347
387
|
});
|
|
348
388
|
return /* @__PURE__ */ React4.createElement(
|
|
@@ -605,20 +645,19 @@ function resolveChildren({
|
|
|
605
645
|
|
|
606
646
|
// src/components/UniformPlayground.tsx
|
|
607
647
|
import { EMPTY_COMPOSITION as EMPTY_COMPOSITION4 } from "@uniformdev/canvas";
|
|
608
|
-
import React8, { useMemo as
|
|
648
|
+
import React8, { useMemo as useMemo4 } from "react";
|
|
609
649
|
var UniformPlayground = ({
|
|
610
650
|
resolveRenderer,
|
|
611
651
|
decorators = [],
|
|
612
652
|
contextualEditingEnhancer,
|
|
613
653
|
behaviorTracking,
|
|
614
|
-
contextualEditingDefaultPlaceholder
|
|
615
|
-
children
|
|
654
|
+
contextualEditingDefaultPlaceholder
|
|
616
655
|
}) => {
|
|
617
656
|
const { composition, isContextualEditing } = useUniformContextualEditing({
|
|
618
657
|
initialCompositionValue: EMPTY_COMPOSITION4,
|
|
619
658
|
enhance: contextualEditingEnhancer
|
|
620
659
|
});
|
|
621
|
-
const renderedComponent =
|
|
660
|
+
const renderedComponent = useMemo4(() => {
|
|
622
661
|
if (!composition) {
|
|
623
662
|
return null;
|
|
624
663
|
}
|
|
@@ -629,21 +668,13 @@ var UniformPlayground = ({
|
|
|
629
668
|
behaviorTracking,
|
|
630
669
|
resolveRenderer,
|
|
631
670
|
contextualEditingDefaultPlaceholder
|
|
632
|
-
}
|
|
633
|
-
children
|
|
671
|
+
}
|
|
634
672
|
));
|
|
635
673
|
decorators.forEach((Decorator) => {
|
|
636
674
|
component = /* @__PURE__ */ React8.createElement(Decorator, { data: composition }, component);
|
|
637
675
|
});
|
|
638
676
|
return component;
|
|
639
|
-
}, [
|
|
640
|
-
children,
|
|
641
|
-
resolveRenderer,
|
|
642
|
-
decorators,
|
|
643
|
-
composition,
|
|
644
|
-
behaviorTracking,
|
|
645
|
-
contextualEditingDefaultPlaceholder
|
|
646
|
-
]);
|
|
677
|
+
}, [resolveRenderer, decorators, composition, behaviorTracking, contextualEditingDefaultPlaceholder]);
|
|
647
678
|
return /* @__PURE__ */ React8.createElement(
|
|
648
679
|
UniformCompositionContext.Provider,
|
|
649
680
|
{
|
|
@@ -663,7 +694,7 @@ import {
|
|
|
663
694
|
isRichTextValue,
|
|
664
695
|
isRichTextValueConsideredEmpty
|
|
665
696
|
} from "@uniformdev/richtext";
|
|
666
|
-
import React18, { useMemo as
|
|
697
|
+
import React18, { useMemo as useMemo5 } from "react";
|
|
667
698
|
|
|
668
699
|
// src/components/UniformRichText/UniformRichTextNode.tsx
|
|
669
700
|
import { isRichTextNode } from "@uniformdev/richtext";
|
|
@@ -773,11 +804,11 @@ var resolveRichTextDefaultRenderer = (node) => {
|
|
|
773
804
|
// src/components/UniformRichText/UniformRichText.tsx
|
|
774
805
|
var UniformRichText = React18.forwardRef(function UniformRichText2({ parameterId, resolveRichTextRenderer, as: Tag = "div", ...props }, ref) {
|
|
775
806
|
const { data: componentData } = useUniformCurrentComponent();
|
|
776
|
-
const parameter =
|
|
807
|
+
const parameter = useMemo5(() => {
|
|
777
808
|
var _a;
|
|
778
809
|
return (_a = componentData == null ? void 0 : componentData.parameters) == null ? void 0 : _a[parameterId];
|
|
779
810
|
}, [componentData, parameterId]);
|
|
780
|
-
const value =
|
|
811
|
+
const value = useMemo5(() => parameter == null ? void 0 : parameter.value, [parameter]);
|
|
781
812
|
if (!value || !isRichTextValue(value) || isRichTextValueConsideredEmpty(value)) return null;
|
|
782
813
|
return Tag === null ? /* @__PURE__ */ React18.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ React18.createElement(
|
|
783
814
|
Tag,
|
|
@@ -936,7 +967,7 @@ import {
|
|
|
936
967
|
createCanvasChannel as createCanvasChannel2,
|
|
937
968
|
isUpdateContextualEditingStateInternalMessage
|
|
938
969
|
} from "@uniformdev/canvas";
|
|
939
|
-
import { useEffect as useEffect3, useMemo as
|
|
970
|
+
import { useEffect as useEffect3, useMemo as useMemo6, useState as useState3 } from "react";
|
|
940
971
|
var useUniformContextualEditingState = ({
|
|
941
972
|
global = false
|
|
942
973
|
} = {}) => {
|
|
@@ -946,7 +977,7 @@ var useUniformContextualEditingState = ({
|
|
|
946
977
|
const [previewMode, setPreviewMode] = useState3(
|
|
947
978
|
isContextualEditing ? "editor" : void 0
|
|
948
979
|
);
|
|
949
|
-
const channel =
|
|
980
|
+
const channel = useMemo6(() => {
|
|
950
981
|
if (!isContextualEditing) {
|
|
951
982
|
return;
|
|
952
983
|
}
|
|
@@ -980,7 +1011,7 @@ var useUniformContextualEditingState = ({
|
|
|
980
1011
|
unsubscribe();
|
|
981
1012
|
};
|
|
982
1013
|
}, [global, channel, componentData == null ? void 0 : componentData._id, setSelectedComponentReference, setPreviewMode]);
|
|
983
|
-
return
|
|
1014
|
+
return useMemo6(
|
|
984
1015
|
() => ({
|
|
985
1016
|
isContextualEditing,
|
|
986
1017
|
selectedComponentReference,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-react",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.169.0",
|
|
4
4
|
"description": "React SDK for Uniform Canvas",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -45,17 +45,19 @@
|
|
|
45
45
|
"document": "api-extractor run --local"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@uniformdev/canvas": "19.
|
|
49
|
-
"@uniformdev/context": "19.
|
|
50
|
-
"@uniformdev/context-react": "19.
|
|
51
|
-
"@uniformdev/richtext": "19.
|
|
48
|
+
"@uniformdev/canvas": "19.169.0",
|
|
49
|
+
"@uniformdev/context": "19.169.0",
|
|
50
|
+
"@uniformdev/context-react": "19.169.0",
|
|
51
|
+
"@uniformdev/richtext": "19.169.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
+
"immer": ">= 10",
|
|
54
55
|
"react": ">= 16 || 17 || 18",
|
|
55
56
|
"react-dom": ">=16"
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
58
59
|
"@types/react": "18.2.40",
|
|
60
|
+
"immer": "10.1.1",
|
|
59
61
|
"react": "18.2.0",
|
|
60
62
|
"react-dom": "18.2.0"
|
|
61
63
|
},
|
|
@@ -65,5 +67,5 @@
|
|
|
65
67
|
"publishConfig": {
|
|
66
68
|
"access": "public"
|
|
67
69
|
},
|
|
68
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "78f454f7178dfac0480403a9728c430b7697a724"
|
|
69
71
|
}
|