@uniformdev/canvas-react 19.177.1 → 19.177.2-alpha.10

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.esm.js CHANGED
@@ -694,11 +694,11 @@ import {
694
694
  isRichTextValue,
695
695
  isRichTextValueConsideredEmpty
696
696
  } from "@uniformdev/richtext";
697
- import React18, { useMemo as useMemo5 } from "react";
697
+ import React19, { useMemo as useMemo5 } from "react";
698
698
 
699
699
  // src/components/UniformRichText/UniformRichTextNode.tsx
700
700
  import { isRichTextNode } from "@uniformdev/richtext";
701
- import React17 from "react";
701
+ import React18 from "react";
702
702
 
703
703
  // src/components/UniformRichText/nodes/HeadingRichTextNode.tsx
704
704
  import React9 from "react";
@@ -752,19 +752,28 @@ var ParagraphRichTextNode = ({ children, node }) => {
752
752
  );
753
753
  };
754
754
 
755
- // src/components/UniformRichText/nodes/TabRichTextNode.tsx
755
+ // src/components/UniformRichText/nodes/TableCellRichTextNode.tsx
756
+ import { getRichTextTagFromTableCellHeaderState } from "@uniformdev/richtext";
756
757
  import React15 from "react";
758
+ var TableCellRichTextNode = ({ children, node }) => {
759
+ const { headerState } = node;
760
+ const TableCellTag = getRichTextTagFromTableCellHeaderState(headerState);
761
+ return /* @__PURE__ */ React15.createElement(TableCellTag, null, children);
762
+ };
763
+
764
+ // src/components/UniformRichText/nodes/TabRichTextNode.tsx
765
+ import React16 from "react";
757
766
  var TabRichTextNode = () => {
758
- return /* @__PURE__ */ React15.createElement(React15.Fragment, null, " ");
767
+ return /* @__PURE__ */ React16.createElement(React16.Fragment, null, " ");
759
768
  };
760
769
 
761
770
  // src/components/UniformRichText/nodes/TextRichTextNode.tsx
762
771
  import { getRichTextTagsFromTextFormat } from "@uniformdev/richtext";
763
- import React16 from "react";
772
+ import React17 from "react";
764
773
  var TextRichTextNode = ({ node }) => {
765
774
  const { text, format } = node;
766
775
  const tags = getRichTextTagsFromTextFormat(format);
767
- return /* @__PURE__ */ React16.createElement(React16.Fragment, null, tags.length > 0 ? tags.reduceRight((children, Tag) => /* @__PURE__ */ React16.createElement(Tag, null, children), text) : text);
776
+ return /* @__PURE__ */ React17.createElement(React17.Fragment, null, tags.length > 0 ? tags.reduceRight((children, Tag) => /* @__PURE__ */ React17.createElement(Tag, null, children), text) : text);
768
777
  };
769
778
 
770
779
  // src/components/UniformRichText/UniformRichTextNode.tsx
@@ -778,8 +787,8 @@ function UniformRichTextNode({ node, ...props }) {
778
787
  if (!NodeRenderer) {
779
788
  return null;
780
789
  }
781
- const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */ React17.createElement(UniformRichTextNode, { ...props, key: i, node: childNode })) : null;
782
- return /* @__PURE__ */ React17.createElement(NodeRenderer, { node }, children);
790
+ const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */ React18.createElement(UniformRichTextNode, { ...props, key: i, node: childNode })) : null;
791
+ return /* @__PURE__ */ React18.createElement(NodeRenderer, { node }, children);
783
792
  }
784
793
  var rendererMap = /* @__PURE__ */ new Map([
785
794
  ["heading", HeadingRichTextNode],
@@ -788,21 +797,27 @@ var rendererMap = /* @__PURE__ */ new Map([
788
797
  ["list", ListRichTextNode],
789
798
  ["listitem", ListItemRichTextNode],
790
799
  ["paragraph", ParagraphRichTextNode],
791
- ["quote", ({ children }) => /* @__PURE__ */ React17.createElement("blockquote", null, children)],
800
+ ["quote", ({ children }) => /* @__PURE__ */ React18.createElement("blockquote", null, children)],
792
801
  [
793
802
  "code",
794
- ({ children }) => /* @__PURE__ */ React17.createElement("pre", null, /* @__PURE__ */ React17.createElement("code", null, children))
803
+ ({ children }) => /* @__PURE__ */ React18.createElement("pre", null, /* @__PURE__ */ React18.createElement("code", null, children))
795
804
  ],
796
- ["root", ({ children }) => /* @__PURE__ */ React17.createElement(React17.Fragment, null, children)],
805
+ ["root", ({ children }) => /* @__PURE__ */ React18.createElement(React18.Fragment, null, children)],
797
806
  ["text", TextRichTextNode],
798
- ["tab", TabRichTextNode]
807
+ ["tab", TabRichTextNode],
808
+ [
809
+ "table",
810
+ ({ children }) => /* @__PURE__ */ React18.createElement("table", null, /* @__PURE__ */ React18.createElement("tbody", null, children))
811
+ ],
812
+ ["tablerow", ({ children }) => /* @__PURE__ */ React18.createElement("tr", null, children)],
813
+ ["tablecell", TableCellRichTextNode]
799
814
  ]);
800
815
  var resolveRichTextDefaultRenderer = (node) => {
801
816
  return rendererMap.get(node.type);
802
817
  };
803
818
 
804
819
  // src/components/UniformRichText/UniformRichText.tsx
805
- var UniformRichText = React18.forwardRef(function UniformRichText2({ parameterId, resolveRichTextRenderer, as: Tag = "div", ...props }, ref) {
820
+ var UniformRichText = React19.forwardRef(function UniformRichText2({ parameterId, resolveRichTextRenderer, as: Tag = "div", ...props }, ref) {
806
821
  const { data: componentData } = useUniformCurrentComponent();
807
822
  const parameter = useMemo5(() => {
808
823
  var _a;
@@ -810,7 +825,7 @@ var UniformRichText = React18.forwardRef(function UniformRichText2({ parameterId
810
825
  }, [componentData, parameterId]);
811
826
  const value = useMemo5(() => parameter == null ? void 0 : parameter.value, [parameter]);
812
827
  if (!value || !isRichTextValue(value) || isRichTextValueConsideredEmpty(value)) return null;
813
- return Tag === null ? /* @__PURE__ */ React18.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ React18.createElement(
828
+ return Tag === null ? /* @__PURE__ */ React19.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ React19.createElement(
814
829
  Tag,
815
830
  {
816
831
  ref,
@@ -821,15 +836,15 @@ var UniformRichText = React18.forwardRef(function UniformRichText2({ parameterId
821
836
  [ATTRIBUTE_PARAMETER_TYPE]: "richText"
822
837
  }
823
838
  },
824
- /* @__PURE__ */ React18.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
839
+ /* @__PURE__ */ React19.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
825
840
  );
826
841
  });
827
842
 
828
843
  // src/components/UniformText.tsx
829
- import React20, { useState as useState2 } from "react";
844
+ import React21, { useState as useState2 } from "react";
830
845
 
831
846
  // src/components/PureUniformText.tsx
832
- import React19 from "react";
847
+ import React20 from "react";
833
848
  var PureUniformText = ({
834
849
  as: Tag = "span",
835
850
  parameterId,
@@ -848,10 +863,10 @@ var PureUniformText = ({
848
863
  return null;
849
864
  }
850
865
  if (!isContextualEditing) {
851
- return /* @__PURE__ */ React19.createElement(Tag, { style: isMultiline ? { whiteSpace: "pre-wrap" } : {}, ...props }, render(value));
866
+ return /* @__PURE__ */ React20.createElement(Tag, { style: isMultiline ? { whiteSpace: "pre-wrap" } : {}, ...props }, render(value));
852
867
  }
853
868
  const computedPlaceholder = typeof placeholder === "function" ? placeholder({ id: parameterId }) : placeholder;
854
- return /* @__PURE__ */ React19.createElement(
869
+ return /* @__PURE__ */ React20.createElement(
855
870
  Tag,
856
871
  {
857
872
  ...props,
@@ -889,7 +904,7 @@ var UniformText = ({
889
904
  }
890
905
  const placeholderProp = placeholder != null ? placeholder : contextualEditingDefaultPlaceholder;
891
906
  const computedPlaceholder = typeof placeholderProp === "function" ? placeholderProp({ id: parameterId }) : placeholderProp;
892
- return /* @__PURE__ */ React20.createElement(
907
+ return /* @__PURE__ */ React21.createElement(
893
908
  PureUniformText,
894
909
  {
895
910
  ...props,
package/dist/index.js CHANGED
@@ -718,12 +718,12 @@ var UniformPlayground = ({
718
718
 
719
719
  // src/components/UniformRichText/UniformRichText.tsx
720
720
  var import_canvas11 = require("@uniformdev/canvas");
721
- var import_richtext5 = require("@uniformdev/richtext");
722
- var import_react20 = __toESM(require("react"));
721
+ var import_richtext6 = require("@uniformdev/richtext");
722
+ var import_react21 = __toESM(require("react"));
723
723
 
724
724
  // src/components/UniformRichText/UniformRichTextNode.tsx
725
- var import_richtext4 = require("@uniformdev/richtext");
726
- var import_react19 = __toESM(require("react"));
725
+ var import_richtext5 = require("@uniformdev/richtext");
726
+ var import_react20 = __toESM(require("react"));
727
727
 
728
728
  // src/components/UniformRichText/nodes/HeadingRichTextNode.tsx
729
729
  var import_react11 = __toESM(require("react"));
@@ -777,25 +777,34 @@ var ParagraphRichTextNode = ({ children, node }) => {
777
777
  );
778
778
  };
779
779
 
780
- // src/components/UniformRichText/nodes/TabRichTextNode.tsx
780
+ // src/components/UniformRichText/nodes/TableCellRichTextNode.tsx
781
+ var import_richtext3 = require("@uniformdev/richtext");
781
782
  var import_react17 = __toESM(require("react"));
783
+ var TableCellRichTextNode = ({ children, node }) => {
784
+ const { headerState } = node;
785
+ const TableCellTag = (0, import_richtext3.getRichTextTagFromTableCellHeaderState)(headerState);
786
+ return /* @__PURE__ */ import_react17.default.createElement(TableCellTag, null, children);
787
+ };
788
+
789
+ // src/components/UniformRichText/nodes/TabRichTextNode.tsx
790
+ var import_react18 = __toESM(require("react"));
782
791
  var TabRichTextNode = () => {
783
- return /* @__PURE__ */ import_react17.default.createElement(import_react17.default.Fragment, null, " ");
792
+ return /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, " ");
784
793
  };
785
794
 
786
795
  // src/components/UniformRichText/nodes/TextRichTextNode.tsx
787
- var import_richtext3 = require("@uniformdev/richtext");
788
- var import_react18 = __toESM(require("react"));
796
+ var import_richtext4 = require("@uniformdev/richtext");
797
+ var import_react19 = __toESM(require("react"));
789
798
  var TextRichTextNode = ({ node }) => {
790
799
  const { text, format } = node;
791
- const tags = (0, import_richtext3.getRichTextTagsFromTextFormat)(format);
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);
800
+ const tags = (0, import_richtext4.getRichTextTagsFromTextFormat)(format);
801
+ return /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, tags.length > 0 ? tags.reduceRight((children, Tag) => /* @__PURE__ */ import_react19.default.createElement(Tag, null, children), text) : text);
793
802
  };
794
803
 
795
804
  // src/components/UniformRichText/UniformRichTextNode.tsx
796
805
  function UniformRichTextNode({ node, ...props }) {
797
806
  var _a;
798
- if (!(0, import_richtext4.isRichTextNode)(node)) return null;
807
+ if (!(0, import_richtext5.isRichTextNode)(node)) return null;
799
808
  let NodeRenderer = (_a = props.resolveRichTextRenderer) == null ? void 0 : _a.call(props, node);
800
809
  if (typeof NodeRenderer === "undefined") {
801
810
  NodeRenderer = resolveRichTextDefaultRenderer(node);
@@ -803,8 +812,8 @@ function UniformRichTextNode({ node, ...props }) {
803
812
  if (!NodeRenderer) {
804
813
  return null;
805
814
  }
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);
815
+ const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */ import_react20.default.createElement(UniformRichTextNode, { ...props, key: i, node: childNode })) : null;
816
+ return /* @__PURE__ */ import_react20.default.createElement(NodeRenderer, { node }, children);
808
817
  }
809
818
  var rendererMap = /* @__PURE__ */ new Map([
810
819
  ["heading", HeadingRichTextNode],
@@ -813,29 +822,35 @@ var rendererMap = /* @__PURE__ */ new Map([
813
822
  ["list", ListRichTextNode],
814
823
  ["listitem", ListItemRichTextNode],
815
824
  ["paragraph", ParagraphRichTextNode],
816
- ["quote", ({ children }) => /* @__PURE__ */ import_react19.default.createElement("blockquote", null, children)],
825
+ ["quote", ({ children }) => /* @__PURE__ */ import_react20.default.createElement("blockquote", null, children)],
817
826
  [
818
827
  "code",
819
- ({ children }) => /* @__PURE__ */ import_react19.default.createElement("pre", null, /* @__PURE__ */ import_react19.default.createElement("code", null, children))
828
+ ({ children }) => /* @__PURE__ */ import_react20.default.createElement("pre", null, /* @__PURE__ */ import_react20.default.createElement("code", null, children))
820
829
  ],
821
- ["root", ({ children }) => /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, children)],
830
+ ["root", ({ children }) => /* @__PURE__ */ import_react20.default.createElement(import_react20.default.Fragment, null, children)],
822
831
  ["text", TextRichTextNode],
823
- ["tab", TabRichTextNode]
832
+ ["tab", TabRichTextNode],
833
+ [
834
+ "table",
835
+ ({ children }) => /* @__PURE__ */ import_react20.default.createElement("table", null, /* @__PURE__ */ import_react20.default.createElement("tbody", null, children))
836
+ ],
837
+ ["tablerow", ({ children }) => /* @__PURE__ */ import_react20.default.createElement("tr", null, children)],
838
+ ["tablecell", TableCellRichTextNode]
824
839
  ]);
825
840
  var resolveRichTextDefaultRenderer = (node) => {
826
841
  return rendererMap.get(node.type);
827
842
  };
828
843
 
829
844
  // src/components/UniformRichText/UniformRichText.tsx
830
- var UniformRichText = import_react20.default.forwardRef(function UniformRichText2({ parameterId, resolveRichTextRenderer, as: Tag = "div", ...props }, ref) {
845
+ var UniformRichText = import_react21.default.forwardRef(function UniformRichText2({ parameterId, resolveRichTextRenderer, as: Tag = "div", ...props }, ref) {
831
846
  const { data: componentData } = useUniformCurrentComponent();
832
- const parameter = (0, import_react20.useMemo)(() => {
847
+ const parameter = (0, import_react21.useMemo)(() => {
833
848
  var _a;
834
849
  return (_a = componentData == null ? void 0 : componentData.parameters) == null ? void 0 : _a[parameterId];
835
850
  }, [componentData, parameterId]);
836
- const value = (0, import_react20.useMemo)(() => parameter == null ? void 0 : parameter.value, [parameter]);
837
- if (!value || !(0, import_richtext5.isRichTextValue)(value) || (0, import_richtext5.isRichTextValueConsideredEmpty)(value)) return null;
838
- return Tag === null ? /* @__PURE__ */ import_react20.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ import_react20.default.createElement(
851
+ const value = (0, import_react21.useMemo)(() => parameter == null ? void 0 : parameter.value, [parameter]);
852
+ if (!value || !(0, import_richtext6.isRichTextValue)(value) || (0, import_richtext6.isRichTextValueConsideredEmpty)(value)) return null;
853
+ return Tag === null ? /* @__PURE__ */ import_react21.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ import_react21.default.createElement(
839
854
  Tag,
840
855
  {
841
856
  ref,
@@ -846,15 +861,15 @@ var UniformRichText = import_react20.default.forwardRef(function UniformRichText
846
861
  [import_canvas11.ATTRIBUTE_PARAMETER_TYPE]: "richText"
847
862
  }
848
863
  },
849
- /* @__PURE__ */ import_react20.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
864
+ /* @__PURE__ */ import_react21.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
850
865
  );
851
866
  });
852
867
 
853
868
  // src/components/UniformText.tsx
854
- var import_react22 = __toESM(require("react"));
869
+ var import_react23 = __toESM(require("react"));
855
870
 
856
871
  // src/components/PureUniformText.tsx
857
- var import_react21 = __toESM(require("react"));
872
+ var import_react22 = __toESM(require("react"));
858
873
  var PureUniformText = ({
859
874
  as: Tag = "span",
860
875
  parameterId,
@@ -873,10 +888,10 @@ var PureUniformText = ({
873
888
  return null;
874
889
  }
875
890
  if (!isContextualEditing) {
876
- return /* @__PURE__ */ import_react21.default.createElement(Tag, { style: isMultiline ? { whiteSpace: "pre-wrap" } : {}, ...props }, render(value));
891
+ return /* @__PURE__ */ import_react22.default.createElement(Tag, { style: isMultiline ? { whiteSpace: "pre-wrap" } : {}, ...props }, render(value));
877
892
  }
878
893
  const computedPlaceholder = typeof placeholder === "function" ? placeholder({ id: parameterId }) : placeholder;
879
- return /* @__PURE__ */ import_react21.default.createElement(
894
+ return /* @__PURE__ */ import_react22.default.createElement(
880
895
  Tag,
881
896
  {
882
897
  ...props,
@@ -905,7 +920,7 @@ var UniformText = ({
905
920
  var _a, _b, _c;
906
921
  const { data: componentData, contextualEditingDefaultPlaceholder } = useUniformCurrentComponent();
907
922
  const { isContextualEditing } = useUniformCurrentComposition();
908
- const [isFocused, setIsFocused] = (0, import_react22.useState)(false);
923
+ const [isFocused, setIsFocused] = (0, import_react23.useState)(false);
909
924
  const parameter = (_a = componentData == null ? void 0 : componentData.parameters) == null ? void 0 : _a[parameterId];
910
925
  const isEditable = (_c = (_b = parameter == null ? void 0 : parameter._contextualEditing) == null ? void 0 : _b.isEditable) != null ? _c : false;
911
926
  const shouldSkipCustomRendering = isFocused && isEditable;
@@ -914,7 +929,7 @@ var UniformText = ({
914
929
  }
915
930
  const placeholderProp = placeholder != null ? placeholder : contextualEditingDefaultPlaceholder;
916
931
  const computedPlaceholder = typeof placeholderProp === "function" ? placeholderProp({ id: parameterId }) : placeholderProp;
917
- return /* @__PURE__ */ import_react22.default.createElement(
932
+ return /* @__PURE__ */ import_react23.default.createElement(
918
933
  PureUniformText,
919
934
  {
920
935
  ...props,
@@ -947,14 +962,14 @@ var getParameterAttributes = (options) => {
947
962
 
948
963
  // src/hooks/useCompositionEventEffect.ts
949
964
  var import_canvas13 = require("@uniformdev/canvas");
950
- var import_react23 = require("react");
965
+ var import_react24 = require("react");
951
966
  function useCompositionEventEffect({
952
967
  enabled,
953
968
  projectId,
954
969
  compositionId,
955
970
  effect
956
971
  }) {
957
- (0, import_react23.useEffect)(() => {
972
+ (0, import_react24.useEffect)(() => {
958
973
  if (!enabled || !compositionId || !projectId) {
959
974
  return;
960
975
  }
@@ -983,17 +998,17 @@ function useCompositionEventEffect({
983
998
 
984
999
  // src/hooks/useUniformContextualEditingState.ts
985
1000
  var import_canvas14 = require("@uniformdev/canvas");
986
- var import_react24 = require("react");
1001
+ var import_react25 = require("react");
987
1002
  var useUniformContextualEditingState = ({
988
1003
  global = false
989
1004
  } = {}) => {
990
1005
  const { isContextualEditing } = useUniformCurrentComposition();
991
1006
  const { data: componentData } = useUniformCurrentComponent();
992
- const [selectedComponentReference, setSelectedComponentReference] = (0, import_react24.useState)();
993
- const [previewMode, setPreviewMode] = (0, import_react24.useState)(
1007
+ const [selectedComponentReference, setSelectedComponentReference] = (0, import_react25.useState)();
1008
+ const [previewMode, setPreviewMode] = (0, import_react25.useState)(
994
1009
  isContextualEditing ? "editor" : void 0
995
1010
  );
996
- const channel = (0, import_react24.useMemo)(() => {
1011
+ const channel = (0, import_react25.useMemo)(() => {
997
1012
  if (!isContextualEditing) {
998
1013
  return;
999
1014
  }
@@ -1003,7 +1018,7 @@ var useUniformContextualEditingState = ({
1003
1018
  });
1004
1019
  return channel2;
1005
1020
  }, [isContextualEditing]);
1006
- (0, import_react24.useEffect)(() => {
1021
+ (0, import_react25.useEffect)(() => {
1007
1022
  var _a, _b;
1008
1023
  if (!channel) {
1009
1024
  return;
@@ -1027,7 +1042,7 @@ var useUniformContextualEditingState = ({
1027
1042
  unsubscribe();
1028
1043
  };
1029
1044
  }, [global, channel, componentData == null ? void 0 : componentData._id, setSelectedComponentReference, setPreviewMode]);
1030
- return (0, import_react24.useMemo)(
1045
+ return (0, import_react25.useMemo)(
1031
1046
  () => ({
1032
1047
  isContextualEditing,
1033
1048
  selectedComponentReference,
package/dist/index.mjs CHANGED
@@ -694,11 +694,11 @@ import {
694
694
  isRichTextValue,
695
695
  isRichTextValueConsideredEmpty
696
696
  } from "@uniformdev/richtext";
697
- import React18, { useMemo as useMemo5 } from "react";
697
+ import React19, { useMemo as useMemo5 } from "react";
698
698
 
699
699
  // src/components/UniformRichText/UniformRichTextNode.tsx
700
700
  import { isRichTextNode } from "@uniformdev/richtext";
701
- import React17 from "react";
701
+ import React18 from "react";
702
702
 
703
703
  // src/components/UniformRichText/nodes/HeadingRichTextNode.tsx
704
704
  import React9 from "react";
@@ -752,19 +752,28 @@ var ParagraphRichTextNode = ({ children, node }) => {
752
752
  );
753
753
  };
754
754
 
755
- // src/components/UniformRichText/nodes/TabRichTextNode.tsx
755
+ // src/components/UniformRichText/nodes/TableCellRichTextNode.tsx
756
+ import { getRichTextTagFromTableCellHeaderState } from "@uniformdev/richtext";
756
757
  import React15 from "react";
758
+ var TableCellRichTextNode = ({ children, node }) => {
759
+ const { headerState } = node;
760
+ const TableCellTag = getRichTextTagFromTableCellHeaderState(headerState);
761
+ return /* @__PURE__ */ React15.createElement(TableCellTag, null, children);
762
+ };
763
+
764
+ // src/components/UniformRichText/nodes/TabRichTextNode.tsx
765
+ import React16 from "react";
757
766
  var TabRichTextNode = () => {
758
- return /* @__PURE__ */ React15.createElement(React15.Fragment, null, " ");
767
+ return /* @__PURE__ */ React16.createElement(React16.Fragment, null, " ");
759
768
  };
760
769
 
761
770
  // src/components/UniformRichText/nodes/TextRichTextNode.tsx
762
771
  import { getRichTextTagsFromTextFormat } from "@uniformdev/richtext";
763
- import React16 from "react";
772
+ import React17 from "react";
764
773
  var TextRichTextNode = ({ node }) => {
765
774
  const { text, format } = node;
766
775
  const tags = getRichTextTagsFromTextFormat(format);
767
- return /* @__PURE__ */ React16.createElement(React16.Fragment, null, tags.length > 0 ? tags.reduceRight((children, Tag) => /* @__PURE__ */ React16.createElement(Tag, null, children), text) : text);
776
+ return /* @__PURE__ */ React17.createElement(React17.Fragment, null, tags.length > 0 ? tags.reduceRight((children, Tag) => /* @__PURE__ */ React17.createElement(Tag, null, children), text) : text);
768
777
  };
769
778
 
770
779
  // src/components/UniformRichText/UniformRichTextNode.tsx
@@ -778,8 +787,8 @@ function UniformRichTextNode({ node, ...props }) {
778
787
  if (!NodeRenderer) {
779
788
  return null;
780
789
  }
781
- const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */ React17.createElement(UniformRichTextNode, { ...props, key: i, node: childNode })) : null;
782
- return /* @__PURE__ */ React17.createElement(NodeRenderer, { node }, children);
790
+ const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */ React18.createElement(UniformRichTextNode, { ...props, key: i, node: childNode })) : null;
791
+ return /* @__PURE__ */ React18.createElement(NodeRenderer, { node }, children);
783
792
  }
784
793
  var rendererMap = /* @__PURE__ */ new Map([
785
794
  ["heading", HeadingRichTextNode],
@@ -788,21 +797,27 @@ var rendererMap = /* @__PURE__ */ new Map([
788
797
  ["list", ListRichTextNode],
789
798
  ["listitem", ListItemRichTextNode],
790
799
  ["paragraph", ParagraphRichTextNode],
791
- ["quote", ({ children }) => /* @__PURE__ */ React17.createElement("blockquote", null, children)],
800
+ ["quote", ({ children }) => /* @__PURE__ */ React18.createElement("blockquote", null, children)],
792
801
  [
793
802
  "code",
794
- ({ children }) => /* @__PURE__ */ React17.createElement("pre", null, /* @__PURE__ */ React17.createElement("code", null, children))
803
+ ({ children }) => /* @__PURE__ */ React18.createElement("pre", null, /* @__PURE__ */ React18.createElement("code", null, children))
795
804
  ],
796
- ["root", ({ children }) => /* @__PURE__ */ React17.createElement(React17.Fragment, null, children)],
805
+ ["root", ({ children }) => /* @__PURE__ */ React18.createElement(React18.Fragment, null, children)],
797
806
  ["text", TextRichTextNode],
798
- ["tab", TabRichTextNode]
807
+ ["tab", TabRichTextNode],
808
+ [
809
+ "table",
810
+ ({ children }) => /* @__PURE__ */ React18.createElement("table", null, /* @__PURE__ */ React18.createElement("tbody", null, children))
811
+ ],
812
+ ["tablerow", ({ children }) => /* @__PURE__ */ React18.createElement("tr", null, children)],
813
+ ["tablecell", TableCellRichTextNode]
799
814
  ]);
800
815
  var resolveRichTextDefaultRenderer = (node) => {
801
816
  return rendererMap.get(node.type);
802
817
  };
803
818
 
804
819
  // src/components/UniformRichText/UniformRichText.tsx
805
- var UniformRichText = React18.forwardRef(function UniformRichText2({ parameterId, resolveRichTextRenderer, as: Tag = "div", ...props }, ref) {
820
+ var UniformRichText = React19.forwardRef(function UniformRichText2({ parameterId, resolveRichTextRenderer, as: Tag = "div", ...props }, ref) {
806
821
  const { data: componentData } = useUniformCurrentComponent();
807
822
  const parameter = useMemo5(() => {
808
823
  var _a;
@@ -810,7 +825,7 @@ var UniformRichText = React18.forwardRef(function UniformRichText2({ parameterId
810
825
  }, [componentData, parameterId]);
811
826
  const value = useMemo5(() => parameter == null ? void 0 : parameter.value, [parameter]);
812
827
  if (!value || !isRichTextValue(value) || isRichTextValueConsideredEmpty(value)) return null;
813
- return Tag === null ? /* @__PURE__ */ React18.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ React18.createElement(
828
+ return Tag === null ? /* @__PURE__ */ React19.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ React19.createElement(
814
829
  Tag,
815
830
  {
816
831
  ref,
@@ -821,15 +836,15 @@ var UniformRichText = React18.forwardRef(function UniformRichText2({ parameterId
821
836
  [ATTRIBUTE_PARAMETER_TYPE]: "richText"
822
837
  }
823
838
  },
824
- /* @__PURE__ */ React18.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
839
+ /* @__PURE__ */ React19.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
825
840
  );
826
841
  });
827
842
 
828
843
  // src/components/UniformText.tsx
829
- import React20, { useState as useState2 } from "react";
844
+ import React21, { useState as useState2 } from "react";
830
845
 
831
846
  // src/components/PureUniformText.tsx
832
- import React19 from "react";
847
+ import React20 from "react";
833
848
  var PureUniformText = ({
834
849
  as: Tag = "span",
835
850
  parameterId,
@@ -848,10 +863,10 @@ var PureUniformText = ({
848
863
  return null;
849
864
  }
850
865
  if (!isContextualEditing) {
851
- return /* @__PURE__ */ React19.createElement(Tag, { style: isMultiline ? { whiteSpace: "pre-wrap" } : {}, ...props }, render(value));
866
+ return /* @__PURE__ */ React20.createElement(Tag, { style: isMultiline ? { whiteSpace: "pre-wrap" } : {}, ...props }, render(value));
852
867
  }
853
868
  const computedPlaceholder = typeof placeholder === "function" ? placeholder({ id: parameterId }) : placeholder;
854
- return /* @__PURE__ */ React19.createElement(
869
+ return /* @__PURE__ */ React20.createElement(
855
870
  Tag,
856
871
  {
857
872
  ...props,
@@ -889,7 +904,7 @@ var UniformText = ({
889
904
  }
890
905
  const placeholderProp = placeholder != null ? placeholder : contextualEditingDefaultPlaceholder;
891
906
  const computedPlaceholder = typeof placeholderProp === "function" ? placeholderProp({ id: parameterId }) : placeholderProp;
892
- return /* @__PURE__ */ React20.createElement(
907
+ return /* @__PURE__ */ React21.createElement(
893
908
  PureUniformText,
894
909
  {
895
910
  ...props,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas-react",
3
- "version": "19.177.1",
3
+ "version": "19.177.2-alpha.10+c9cb5f414c",
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.177.1",
49
- "@uniformdev/context": "19.177.1",
50
- "@uniformdev/context-react": "19.177.1",
51
- "@uniformdev/richtext": "19.177.1"
48
+ "@uniformdev/canvas": "19.177.2-alpha.10+c9cb5f414c",
49
+ "@uniformdev/context": "19.177.2-alpha.10+c9cb5f414c",
50
+ "@uniformdev/context-react": "19.177.2-alpha.10+c9cb5f414c",
51
+ "@uniformdev/richtext": "19.177.2-alpha.10+c9cb5f414c"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "immer": ">= 10",
@@ -67,5 +67,5 @@
67
67
  "publishConfig": {
68
68
  "access": "public"
69
69
  },
70
- "gitHead": "1236153b0d17f18fc96d50f803a7eeaa4b366688"
70
+ "gitHead": "c9cb5f414c41dc1d2c37dff02a5b87484901657e"
71
71
  }