@uniformdev/canvas-react 19.51.1-alpha.10 → 19.51.1-alpha.22

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 CHANGED
@@ -1,5 +1,4 @@
1
1
  import React$1, { Key, ReactNode, PropsWithChildren } from 'react';
2
- import * as _uniformdev_canvas from '@uniformdev/canvas';
3
2
  import { ComponentInstance, RootComponentInstance, UpdateCompositionMessage, getParameterAttributes as getParameterAttributes$1, SubscribeToCompositionOptions } from '@uniformdev/canvas';
4
3
  export { GetParameterAttributesProps, createUniformApiEnhancer } from '@uniformdev/canvas';
5
4
  import { PureUniformTextProps } from './core.mjs';
@@ -42,7 +41,7 @@ type ComponentStore = {
42
41
  **/
43
42
  declare function DefaultNotImplementedComponent(props: ComponentProps): React$1.JSX.Element | null;
44
43
 
45
- type UniformTextProps = Omit<PureUniformTextProps, 'skipCustomRendering' | 'isContextualEditing'>;
44
+ type UniformTextProps = Omit<PureUniformTextProps, 'skipCustomRendering' | 'isContextualEditing' | 'component'>;
46
45
  /**
47
46
  * Renders text parameters. Offers inline editing capability out of the box.
48
47
  */
@@ -243,8 +242,10 @@ declare function useUniformCurrentComposition(): UniformCompositionContextValue;
243
242
  */
244
243
  declare function UniformComposition<TRenderProps = unknown>({ data, behaviorTracking, children, resolveRenderer, contextualEditingEnhancer, contextualEditingDefaultPlaceholder, }: UniformCompositionProps<TRenderProps>): React$1.JSX.Element;
245
244
 
246
- type UniformPlaygroundDecorator = (options: {
245
+ type UniformPlaygroundDecorator = (props: {
246
+ /** The rendered component instance, needs to wrapped and rendered by the decorator */
247
247
  children: React$1.ReactNode;
248
+ /** The component instance data */
248
249
  data: ComponentInstance | RootComponentInstance;
249
250
  }) => React$1.ReactElement;
250
251
  type UniformPlaygroundProps = {
@@ -378,7 +379,18 @@ type UseUniformContextualEditingStateProps = {
378
379
  */
379
380
  declare const useUniformContextualEditingState: ({ global, }?: UseUniformContextualEditingStateProps) => {
380
381
  isContextualEditing: boolean;
381
- selectedComponentReference: Omit<_uniformdev_canvas.ContextualEditingComponentReference, "elements"> | undefined;
382
+ selectedComponentReference: {
383
+ id: string;
384
+ slotName?: string | undefined;
385
+ componentIndex?: number | undefined;
386
+ totalComponents?: number | undefined;
387
+ componentName?: string | undefined;
388
+ componentTitle?: string | undefined;
389
+ parentId?: string | undefined;
390
+ parentType?: string | undefined;
391
+ isLocalized?: boolean | undefined;
392
+ isReadOnly?: boolean | undefined;
393
+ } | undefined;
382
394
  };
383
395
 
384
396
  declare const componentStore: ComponentStore;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import React$1, { Key, ReactNode, PropsWithChildren } from 'react';
2
- import * as _uniformdev_canvas from '@uniformdev/canvas';
3
2
  import { ComponentInstance, RootComponentInstance, UpdateCompositionMessage, getParameterAttributes as getParameterAttributes$1, SubscribeToCompositionOptions } from '@uniformdev/canvas';
4
3
  export { GetParameterAttributesProps, createUniformApiEnhancer } from '@uniformdev/canvas';
5
4
  import { PureUniformTextProps } from './core.js';
@@ -42,7 +41,7 @@ type ComponentStore = {
42
41
  **/
43
42
  declare function DefaultNotImplementedComponent(props: ComponentProps): React$1.JSX.Element | null;
44
43
 
45
- type UniformTextProps = Omit<PureUniformTextProps, 'skipCustomRendering' | 'isContextualEditing'>;
44
+ type UniformTextProps = Omit<PureUniformTextProps, 'skipCustomRendering' | 'isContextualEditing' | 'component'>;
46
45
  /**
47
46
  * Renders text parameters. Offers inline editing capability out of the box.
48
47
  */
@@ -243,8 +242,10 @@ declare function useUniformCurrentComposition(): UniformCompositionContextValue;
243
242
  */
244
243
  declare function UniformComposition<TRenderProps = unknown>({ data, behaviorTracking, children, resolveRenderer, contextualEditingEnhancer, contextualEditingDefaultPlaceholder, }: UniformCompositionProps<TRenderProps>): React$1.JSX.Element;
245
244
 
246
- type UniformPlaygroundDecorator = (options: {
245
+ type UniformPlaygroundDecorator = (props: {
246
+ /** The rendered component instance, needs to wrapped and rendered by the decorator */
247
247
  children: React$1.ReactNode;
248
+ /** The component instance data */
248
249
  data: ComponentInstance | RootComponentInstance;
249
250
  }) => React$1.ReactElement;
250
251
  type UniformPlaygroundProps = {
@@ -378,7 +379,18 @@ type UseUniformContextualEditingStateProps = {
378
379
  */
379
380
  declare const useUniformContextualEditingState: ({ global, }?: UseUniformContextualEditingStateProps) => {
380
381
  isContextualEditing: boolean;
381
- selectedComponentReference: Omit<_uniformdev_canvas.ContextualEditingComponentReference, "elements"> | undefined;
382
+ selectedComponentReference: {
383
+ id: string;
384
+ slotName?: string | undefined;
385
+ componentIndex?: number | undefined;
386
+ totalComponents?: number | undefined;
387
+ componentName?: string | undefined;
388
+ componentTitle?: string | undefined;
389
+ parentId?: string | undefined;
390
+ parentType?: string | undefined;
391
+ isLocalized?: boolean | undefined;
392
+ isReadOnly?: boolean | undefined;
393
+ } | undefined;
382
394
  };
383
395
 
384
396
  declare const componentStore: ComponentStore;
package/dist/index.esm.js CHANGED
@@ -186,7 +186,7 @@ import {
186
186
  CANVAS_LOCALE_TAG_PARAM,
187
187
  IN_CONTEXT_EDITOR_COMPONENT_END_ROLE,
188
188
  IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
189
- PLACEHOLDER_ID
189
+ isComponentPlaceholderId
190
190
  } from "@uniformdev/canvas";
191
191
  import React4 from "react";
192
192
 
@@ -200,6 +200,7 @@ import {
200
200
  EMPTY_COMPOSITION,
201
201
  IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID,
202
202
  IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
203
+ isAllowedReferrer,
203
204
  isUpdateCompositionInternalMessage
204
205
  } from "@uniformdev/canvas";
205
206
  import { useEffect, useMemo, useState } from "react";
@@ -276,10 +277,7 @@ function isInContextEditingMode() {
276
277
  const isOpenedByInContextEditor = new URLSearchParams(window.location.search).has(
277
278
  IN_CONTEXT_EDITOR_QUERY_STRING_PARAM
278
279
  );
279
- const isAllowlistedReferrer = Boolean(
280
- window.document.referrer.match(/(^https:\/\/|\.)(uniform.app|uniform.wtf|localhost:\d{4})\//)
281
- );
282
- return isOpenedByInContextEditor && isAllowlistedReferrer;
280
+ return isOpenedByInContextEditor && isAllowedReferrer(window.document.referrer);
283
281
  }
284
282
 
285
283
  // src/components/UniformComposition.tsx
@@ -331,7 +329,7 @@ function ContextualEditingComponentWrapper({
331
329
  children
332
330
  }) {
333
331
  var _a, _b, _c, _d, _e;
334
- const isPlaceholder = (component == null ? void 0 : component._id) === PLACEHOLDER_ID;
332
+ const isPlaceholder = isComponentPlaceholderId(component == null ? void 0 : component._id);
335
333
  const { isContextualEditing } = useUniformCurrentComposition();
336
334
  const isReadOnly = ((_a = component == null ? void 0 : component._contextualEditing) == null ? void 0 : _a.isEditable) ? void 0 : "true";
337
335
  return !isContextualEditing ? /* @__PURE__ */ React4.createElement(React4.Fragment, null, children) : isPlaceholder && emptyPlaceholder === null ? null : /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(
@@ -577,7 +575,7 @@ var UniformPlayground = ({
577
575
  if (!composition) {
578
576
  return null;
579
577
  }
580
- let component = /* @__PURE__ */ React7.createElement(
578
+ let component = /* @__PURE__ */ React7.createElement(ContextualEditingComponentWrapper, { component: composition }, /* @__PURE__ */ React7.createElement(
581
579
  UniformComponent,
582
580
  {
583
581
  data: composition,
@@ -586,7 +584,7 @@ var UniformPlayground = ({
586
584
  contextualEditingDefaultPlaceholder
587
585
  },
588
586
  children
589
- );
587
+ ));
590
588
  decorators.forEach((Decorator) => {
591
589
  component = /* @__PURE__ */ React7.createElement(Decorator, { data: composition }, component);
592
590
  });
@@ -604,11 +602,16 @@ var UniformPlayground = ({
604
602
  {
605
603
  value: { data: composition, behaviorTracking, resolveRenderer, isContextualEditing }
606
604
  },
607
- /* @__PURE__ */ React7.createElement(ContextualEditingComponentWrapper, { component: composition }, renderedComponent)
605
+ renderedComponent
608
606
  );
609
607
  };
610
608
 
611
609
  // src/components/UniformRichText/UniformRichText.tsx
610
+ import {
611
+ ATTRIBUTE_COMPONENT_ID,
612
+ ATTRIBUTE_PARAMETER_ID,
613
+ ATTRIBUTE_PARAMETER_TYPE
614
+ } from "@uniformdev/canvas";
612
615
  import {
613
616
  isRichTextValue,
614
617
  isRichTextValueConsideredEmpty
@@ -731,7 +734,19 @@ var UniformRichText = React17.forwardRef(function UniformRichText2({ parameterId
731
734
  const value = useMemo3(() => parameter == null ? void 0 : parameter.value, [parameter]);
732
735
  if (!value || !isRichTextValue(value) || isRichTextValueConsideredEmpty(value))
733
736
  return null;
734
- return Tag === null ? /* @__PURE__ */ React17.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ React17.createElement(Tag, { ref, ...props }, /* @__PURE__ */ React17.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }));
737
+ return Tag === null ? /* @__PURE__ */ React17.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ React17.createElement(
738
+ Tag,
739
+ {
740
+ ref,
741
+ ...props,
742
+ ...{
743
+ [ATTRIBUTE_COMPONENT_ID]: componentData == null ? void 0 : componentData._id,
744
+ [ATTRIBUTE_PARAMETER_ID]: parameterId,
745
+ [ATTRIBUTE_PARAMETER_TYPE]: "richText"
746
+ }
747
+ },
748
+ /* @__PURE__ */ React17.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
749
+ );
735
750
  });
736
751
 
737
752
  // src/components/UniformText.tsx
@@ -911,11 +926,14 @@ var useUniformContextualEditingState = ({
911
926
  return () => {
912
927
  unsubscribe();
913
928
  };
914
- }, [global, channel, componentData == null ? void 0 : componentData._id]);
915
- return {
916
- isContextualEditing,
917
- selectedComponentReference
918
- };
929
+ }, [global, channel, componentData == null ? void 0 : componentData._id, setSelectedComponentReference]);
930
+ return useMemo4(
931
+ () => ({
932
+ isContextualEditing,
933
+ selectedComponentReference
934
+ }),
935
+ [isContextualEditing, selectedComponentReference]
936
+ );
919
937
  };
920
938
  export {
921
939
  DefaultNotImplementedComponent,
package/dist/index.js CHANGED
@@ -310,10 +310,7 @@ function isInContextEditingMode() {
310
310
  const isOpenedByInContextEditor = new URLSearchParams(window.location.search).has(
311
311
  import_canvas3.IN_CONTEXT_EDITOR_QUERY_STRING_PARAM
312
312
  );
313
- const isAllowlistedReferrer = Boolean(
314
- window.document.referrer.match(/(^https:\/\/|\.)(uniform.app|uniform.wtf|localhost:\d{4})\//)
315
- );
316
- return isOpenedByInContextEditor && isAllowlistedReferrer;
313
+ return isOpenedByInContextEditor && (0, import_canvas3.isAllowedReferrer)(window.document.referrer);
317
314
  }
318
315
 
319
316
  // src/components/UniformComposition.tsx
@@ -365,7 +362,7 @@ function ContextualEditingComponentWrapper({
365
362
  children
366
363
  }) {
367
364
  var _a, _b, _c, _d, _e;
368
- const isPlaceholder = (component == null ? void 0 : component._id) === import_canvas4.PLACEHOLDER_ID;
365
+ const isPlaceholder = (0, import_canvas4.isComponentPlaceholderId)(component == null ? void 0 : component._id);
369
366
  const { isContextualEditing } = useUniformCurrentComposition();
370
367
  const isReadOnly = ((_a = component == null ? void 0 : component._contextualEditing) == null ? void 0 : _a.isEditable) ? void 0 : "true";
371
368
  return !isContextualEditing ? /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, children) : isPlaceholder && emptyPlaceholder === null ? null : /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement(
@@ -611,7 +608,7 @@ var UniformPlayground = ({
611
608
  if (!composition) {
612
609
  return null;
613
610
  }
614
- let component = /* @__PURE__ */ import_react7.default.createElement(
611
+ let component = /* @__PURE__ */ import_react7.default.createElement(ContextualEditingComponentWrapper, { component: composition }, /* @__PURE__ */ import_react7.default.createElement(
615
612
  UniformComponent,
616
613
  {
617
614
  data: composition,
@@ -620,7 +617,7 @@ var UniformPlayground = ({
620
617
  contextualEditingDefaultPlaceholder
621
618
  },
622
619
  children
623
- );
620
+ ));
624
621
  decorators.forEach((Decorator) => {
625
622
  component = /* @__PURE__ */ import_react7.default.createElement(Decorator, { data: composition }, component);
626
623
  });
@@ -638,11 +635,12 @@ var UniformPlayground = ({
638
635
  {
639
636
  value: { data: composition, behaviorTracking, resolveRenderer, isContextualEditing }
640
637
  },
641
- /* @__PURE__ */ import_react7.default.createElement(ContextualEditingComponentWrapper, { component: composition }, renderedComponent)
638
+ renderedComponent
642
639
  );
643
640
  };
644
641
 
645
642
  // src/components/UniformRichText/UniformRichText.tsx
643
+ var import_canvas8 = require("@uniformdev/canvas");
646
644
  var import_richtext5 = require("@uniformdev/richtext");
647
645
  var import_react17 = __toESM(require("react"));
648
646
 
@@ -762,7 +760,19 @@ var UniformRichText = import_react17.default.forwardRef(function UniformRichText
762
760
  const value = (0, import_react17.useMemo)(() => parameter == null ? void 0 : parameter.value, [parameter]);
763
761
  if (!value || !(0, import_richtext5.isRichTextValue)(value) || (0, import_richtext5.isRichTextValueConsideredEmpty)(value))
764
762
  return null;
765
- return Tag === null ? /* @__PURE__ */ import_react17.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ import_react17.default.createElement(Tag, { ref, ...props }, /* @__PURE__ */ import_react17.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }));
763
+ return Tag === null ? /* @__PURE__ */ import_react17.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ import_react17.default.createElement(
764
+ Tag,
765
+ {
766
+ ref,
767
+ ...props,
768
+ ...{
769
+ [import_canvas8.ATTRIBUTE_COMPONENT_ID]: componentData == null ? void 0 : componentData._id,
770
+ [import_canvas8.ATTRIBUTE_PARAMETER_ID]: parameterId,
771
+ [import_canvas8.ATTRIBUTE_PARAMETER_TYPE]: "richText"
772
+ }
773
+ },
774
+ /* @__PURE__ */ import_react17.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
775
+ );
766
776
  });
767
777
 
768
778
  // src/components/UniformText.tsx
@@ -852,16 +862,16 @@ var UniformText = ({
852
862
  };
853
863
 
854
864
  // src/helpers/getParameterAttributes.ts
855
- var import_canvas8 = require("@uniformdev/canvas");
865
+ var import_canvas9 = require("@uniformdev/canvas");
856
866
  var getParameterAttributes = (options) => {
857
867
  return {
858
- ...(0, import_canvas8.getParameterAttributes)(options),
868
+ ...(0, import_canvas9.getParameterAttributes)(options),
859
869
  suppressContentEditableWarning: true
860
870
  };
861
871
  };
862
872
 
863
873
  // src/hooks/useCompositionEventEffect.ts
864
- var import_canvas9 = require("@uniformdev/canvas");
874
+ var import_canvas10 = require("@uniformdev/canvas");
865
875
  var import_react20 = require("react");
866
876
  function useCompositionEventEffect({
867
877
  enabled,
@@ -875,12 +885,12 @@ function useCompositionEventEffect({
875
885
  }
876
886
  let goodbye = void 0;
877
887
  const loadEffect = async () => {
878
- const eventBus = await (0, import_canvas9.createEventBus)();
888
+ const eventBus = await (0, import_canvas10.createEventBus)();
879
889
  if (eventBus) {
880
- goodbye = (0, import_canvas9.subscribeToComposition)({
890
+ goodbye = (0, import_canvas10.subscribeToComposition)({
881
891
  eventBus,
882
892
  compositionId,
883
- compositionState: import_canvas9.CANVAS_DRAFT_STATE,
893
+ compositionState: import_canvas10.CANVAS_DRAFT_STATE,
884
894
  projectId,
885
895
  callback: effect,
886
896
  event: "updated"
@@ -897,7 +907,7 @@ function useCompositionEventEffect({
897
907
  }
898
908
 
899
909
  // src/hooks/useUniformContextualEditingState.ts
900
- var import_canvas10 = require("@uniformdev/canvas");
910
+ var import_canvas11 = require("@uniformdev/canvas");
901
911
  var import_react21 = require("react");
902
912
  var useUniformContextualEditingState = ({
903
913
  global = false
@@ -909,7 +919,7 @@ var useUniformContextualEditingState = ({
909
919
  if (!isContextualEditing) {
910
920
  return;
911
921
  }
912
- const channel2 = (0, import_canvas10.createCanvasChannel)({
922
+ const channel2 = (0, import_canvas11.createCanvasChannel)({
913
923
  broadcastTo: [window],
914
924
  listenTo: [window]
915
925
  });
@@ -921,7 +931,7 @@ var useUniformContextualEditingState = ({
921
931
  }
922
932
  const unsubscribe = channel.on("update-contextual-editing-state-internal", async (message) => {
923
933
  var _a;
924
- if (!(0, import_canvas10.isUpdateContextualEditingStateInternalMessage)(message)) {
934
+ if (!(0, import_canvas11.isUpdateContextualEditingStateInternalMessage)(message)) {
925
935
  return;
926
936
  }
927
937
  if (!global && (componentData == null ? void 0 : componentData._id) !== ((_a = message.state.selectedComponentReference) == null ? void 0 : _a.parentId)) {
@@ -933,11 +943,14 @@ var useUniformContextualEditingState = ({
933
943
  return () => {
934
944
  unsubscribe();
935
945
  };
936
- }, [global, channel, componentData == null ? void 0 : componentData._id]);
937
- return {
938
- isContextualEditing,
939
- selectedComponentReference
940
- };
946
+ }, [global, channel, componentData == null ? void 0 : componentData._id, setSelectedComponentReference]);
947
+ return (0, import_react21.useMemo)(
948
+ () => ({
949
+ isContextualEditing,
950
+ selectedComponentReference
951
+ }),
952
+ [isContextualEditing, selectedComponentReference]
953
+ );
941
954
  };
942
955
  // Annotate the CommonJS export names for ESM import in node:
943
956
  0 && (module.exports = {
package/dist/index.mjs CHANGED
@@ -186,7 +186,7 @@ import {
186
186
  CANVAS_LOCALE_TAG_PARAM,
187
187
  IN_CONTEXT_EDITOR_COMPONENT_END_ROLE,
188
188
  IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
189
- PLACEHOLDER_ID
189
+ isComponentPlaceholderId
190
190
  } from "@uniformdev/canvas";
191
191
  import React4 from "react";
192
192
 
@@ -200,6 +200,7 @@ import {
200
200
  EMPTY_COMPOSITION,
201
201
  IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID,
202
202
  IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
203
+ isAllowedReferrer,
203
204
  isUpdateCompositionInternalMessage
204
205
  } from "@uniformdev/canvas";
205
206
  import { useEffect, useMemo, useState } from "react";
@@ -276,10 +277,7 @@ function isInContextEditingMode() {
276
277
  const isOpenedByInContextEditor = new URLSearchParams(window.location.search).has(
277
278
  IN_CONTEXT_EDITOR_QUERY_STRING_PARAM
278
279
  );
279
- const isAllowlistedReferrer = Boolean(
280
- window.document.referrer.match(/(^https:\/\/|\.)(uniform.app|uniform.wtf|localhost:\d{4})\//)
281
- );
282
- return isOpenedByInContextEditor && isAllowlistedReferrer;
280
+ return isOpenedByInContextEditor && isAllowedReferrer(window.document.referrer);
283
281
  }
284
282
 
285
283
  // src/components/UniformComposition.tsx
@@ -331,7 +329,7 @@ function ContextualEditingComponentWrapper({
331
329
  children
332
330
  }) {
333
331
  var _a, _b, _c, _d, _e;
334
- const isPlaceholder = (component == null ? void 0 : component._id) === PLACEHOLDER_ID;
332
+ const isPlaceholder = isComponentPlaceholderId(component == null ? void 0 : component._id);
335
333
  const { isContextualEditing } = useUniformCurrentComposition();
336
334
  const isReadOnly = ((_a = component == null ? void 0 : component._contextualEditing) == null ? void 0 : _a.isEditable) ? void 0 : "true";
337
335
  return !isContextualEditing ? /* @__PURE__ */ React4.createElement(React4.Fragment, null, children) : isPlaceholder && emptyPlaceholder === null ? null : /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(
@@ -577,7 +575,7 @@ var UniformPlayground = ({
577
575
  if (!composition) {
578
576
  return null;
579
577
  }
580
- let component = /* @__PURE__ */ React7.createElement(
578
+ let component = /* @__PURE__ */ React7.createElement(ContextualEditingComponentWrapper, { component: composition }, /* @__PURE__ */ React7.createElement(
581
579
  UniformComponent,
582
580
  {
583
581
  data: composition,
@@ -586,7 +584,7 @@ var UniformPlayground = ({
586
584
  contextualEditingDefaultPlaceholder
587
585
  },
588
586
  children
589
- );
587
+ ));
590
588
  decorators.forEach((Decorator) => {
591
589
  component = /* @__PURE__ */ React7.createElement(Decorator, { data: composition }, component);
592
590
  });
@@ -604,11 +602,16 @@ var UniformPlayground = ({
604
602
  {
605
603
  value: { data: composition, behaviorTracking, resolveRenderer, isContextualEditing }
606
604
  },
607
- /* @__PURE__ */ React7.createElement(ContextualEditingComponentWrapper, { component: composition }, renderedComponent)
605
+ renderedComponent
608
606
  );
609
607
  };
610
608
 
611
609
  // src/components/UniformRichText/UniformRichText.tsx
610
+ import {
611
+ ATTRIBUTE_COMPONENT_ID,
612
+ ATTRIBUTE_PARAMETER_ID,
613
+ ATTRIBUTE_PARAMETER_TYPE
614
+ } from "@uniformdev/canvas";
612
615
  import {
613
616
  isRichTextValue,
614
617
  isRichTextValueConsideredEmpty
@@ -731,7 +734,19 @@ var UniformRichText = React17.forwardRef(function UniformRichText2({ parameterId
731
734
  const value = useMemo3(() => parameter == null ? void 0 : parameter.value, [parameter]);
732
735
  if (!value || !isRichTextValue(value) || isRichTextValueConsideredEmpty(value))
733
736
  return null;
734
- return Tag === null ? /* @__PURE__ */ React17.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ React17.createElement(Tag, { ref, ...props }, /* @__PURE__ */ React17.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }));
737
+ return Tag === null ? /* @__PURE__ */ React17.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ React17.createElement(
738
+ Tag,
739
+ {
740
+ ref,
741
+ ...props,
742
+ ...{
743
+ [ATTRIBUTE_COMPONENT_ID]: componentData == null ? void 0 : componentData._id,
744
+ [ATTRIBUTE_PARAMETER_ID]: parameterId,
745
+ [ATTRIBUTE_PARAMETER_TYPE]: "richText"
746
+ }
747
+ },
748
+ /* @__PURE__ */ React17.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
749
+ );
735
750
  });
736
751
 
737
752
  // src/components/UniformText.tsx
@@ -911,11 +926,14 @@ var useUniformContextualEditingState = ({
911
926
  return () => {
912
927
  unsubscribe();
913
928
  };
914
- }, [global, channel, componentData == null ? void 0 : componentData._id]);
915
- return {
916
- isContextualEditing,
917
- selectedComponentReference
918
- };
929
+ }, [global, channel, componentData == null ? void 0 : componentData._id, setSelectedComponentReference]);
930
+ return useMemo4(
931
+ () => ({
932
+ isContextualEditing,
933
+ selectedComponentReference
934
+ }),
935
+ [isContextualEditing, selectedComponentReference]
936
+ );
919
937
  };
920
938
  export {
921
939
  DefaultNotImplementedComponent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas-react",
3
- "version": "19.51.1-alpha.10+ee32ab8b6",
3
+ "version": "19.51.1-alpha.22+ee274f045",
4
4
  "description": "React SDK for Uniform Canvas",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -45,10 +45,10 @@
45
45
  "document": "api-extractor run --local"
46
46
  },
47
47
  "dependencies": {
48
- "@uniformdev/canvas": "19.51.1-alpha.10+ee32ab8b6",
49
- "@uniformdev/context": "19.51.1-alpha.10+ee32ab8b6",
50
- "@uniformdev/context-react": "19.51.1-alpha.10+ee32ab8b6",
51
- "@uniformdev/richtext": "19.51.1-alpha.10+ee32ab8b6"
48
+ "@uniformdev/canvas": "19.51.1-alpha.22+ee274f045",
49
+ "@uniformdev/context": "19.51.1-alpha.22+ee274f045",
50
+ "@uniformdev/context-react": "19.51.1-alpha.22+ee274f045",
51
+ "@uniformdev/richtext": "19.51.1-alpha.22+ee274f045"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "react": ">= 16 || 17 || 18",
@@ -65,5 +65,5 @@
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  },
68
- "gitHead": "ee32ab8b66da53e39f0714b708d5cd2ec49592bd"
68
+ "gitHead": "ee274f04521c4024826b21fee01d50fcc1e414a1"
69
69
  }