@uniformdev/canvas-react 19.173.1-alpha.17 → 19.173.2-alpha.258

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
@@ -695,59 +695,70 @@ import {
695
695
  ATTRIBUTE_PARAMETER_ID,
696
696
  ATTRIBUTE_PARAMETER_TYPE
697
697
  } from "@uniformdev/canvas";
698
- import {
699
- isRichTextValue,
700
- isRichTextValueConsideredEmpty
701
- } from "@uniformdev/richtext";
702
- import React18, { useMemo as useMemo5 } from "react";
698
+ import { isRichTextValue, isRichTextValueConsideredEmpty } from "@uniformdev/richtext";
699
+ import React20 from "react";
703
700
 
704
701
  // src/components/UniformRichText/UniformRichTextNode.tsx
705
702
  import { isRichTextNode } from "@uniformdev/richtext";
706
- import React17 from "react";
703
+ import React19 from "react";
707
704
 
708
- // src/components/UniformRichText/nodes/HeadingRichTextNode.tsx
705
+ // src/components/UniformRichText/nodes/AssetRichTextNode.tsx
709
706
  import React9 from "react";
707
+ var AssetRichTextNode = ({ node }) => {
708
+ var _a, _b;
709
+ const { __asset } = node;
710
+ if (__asset === void 0) {
711
+ return null;
712
+ }
713
+ if (__asset.type !== "image") {
714
+ return null;
715
+ }
716
+ return /* @__PURE__ */ React9.createElement("figure", null, /* @__PURE__ */ React9.createElement("img", { src: __asset.fields.url.value, alt: (_a = __asset.fields.title) == null ? void 0 : _a.value }), ((_b = __asset.fields.description) == null ? void 0 : _b.value) ? /* @__PURE__ */ React9.createElement("figcaption", null, __asset.fields.description.value) : null);
717
+ };
718
+
719
+ // src/components/UniformRichText/nodes/HeadingRichTextNode.tsx
720
+ import React10 from "react";
710
721
  var HeadingRichTextNode = ({ children, node }) => {
711
722
  const { tag } = node;
712
723
  const HTag = tag != null ? tag : "h1";
713
- return /* @__PURE__ */ React9.createElement(HTag, null, children);
724
+ return /* @__PURE__ */ React10.createElement(HTag, null, children);
714
725
  };
715
726
 
716
727
  // src/components/UniformRichText/nodes/LinebreakRichTextNode.tsx
717
- import React10 from "react";
728
+ import React11 from "react";
718
729
  var LinebreakRichTextNode = () => {
719
- return /* @__PURE__ */ React10.createElement("br", null);
730
+ return /* @__PURE__ */ React11.createElement("br", null);
720
731
  };
721
732
 
722
733
  // src/components/UniformRichText/nodes/LinkRichTextNode.tsx
723
734
  import { linkParamValueToHref } from "@uniformdev/richtext";
724
- import React11 from "react";
735
+ import React12 from "react";
725
736
  var LinkRichTextNode = ({ children, node }) => {
726
737
  const { link } = node;
727
- return /* @__PURE__ */ React11.createElement("a", { href: linkParamValueToHref(link) }, children);
738
+ return /* @__PURE__ */ React12.createElement("a", { href: linkParamValueToHref(link) }, children);
728
739
  };
729
740
 
730
741
  // src/components/UniformRichText/nodes/ListItemRichTextNode.tsx
731
- import React12 from "react";
742
+ import React13 from "react";
732
743
  var ListItemRichTextNode = ({ children, node }) => {
733
744
  const { value } = node;
734
- return /* @__PURE__ */ React12.createElement("li", { value: Number.isFinite(value) && value > 0 ? value : void 0 }, children);
745
+ return /* @__PURE__ */ React13.createElement("li", { value: Number.isFinite(value) && value > 0 ? value : void 0 }, children);
735
746
  };
736
747
 
737
748
  // src/components/UniformRichText/nodes/ListRichTextNode.tsx
738
- import React13 from "react";
749
+ import React14 from "react";
739
750
  var ListRichTextNode = ({ children, node }) => {
740
751
  const { tag, start } = node;
741
752
  const ListTag = tag != null ? tag : "ul";
742
- return /* @__PURE__ */ React13.createElement(ListTag, { start: Number.isFinite(start) && start > 0 ? start : void 0 }, children);
753
+ return /* @__PURE__ */ React14.createElement(ListTag, { start: Number.isFinite(start) && start > 0 ? start : void 0 }, children);
743
754
  };
744
755
 
745
756
  // src/components/UniformRichText/nodes/ParagraphRichTextNode.tsx
746
757
  import { isPureDirection, isPureTextAlign } from "@uniformdev/richtext";
747
- import React14 from "react";
758
+ import React15 from "react";
748
759
  var ParagraphRichTextNode = ({ children, node }) => {
749
760
  const { format, direction } = node;
750
- return /* @__PURE__ */ React14.createElement(
761
+ return /* @__PURE__ */ React15.createElement(
751
762
  "p",
752
763
  {
753
764
  dir: isPureDirection(direction) ? direction : void 0,
@@ -757,19 +768,28 @@ var ParagraphRichTextNode = ({ children, node }) => {
757
768
  );
758
769
  };
759
770
 
771
+ // src/components/UniformRichText/nodes/TableCellRichTextNode.tsx
772
+ import { getRichTextTagFromTableCellHeaderState } from "@uniformdev/richtext";
773
+ import React16 from "react";
774
+ var TableCellRichTextNode = ({ children, node }) => {
775
+ const { headerState } = node;
776
+ const TableCellTag = getRichTextTagFromTableCellHeaderState(headerState);
777
+ return /* @__PURE__ */ React16.createElement(TableCellTag, null, children);
778
+ };
779
+
760
780
  // src/components/UniformRichText/nodes/TabRichTextNode.tsx
761
- import React15 from "react";
781
+ import React17 from "react";
762
782
  var TabRichTextNode = () => {
763
- return /* @__PURE__ */ React15.createElement(React15.Fragment, null, " ");
783
+ return /* @__PURE__ */ React17.createElement(React17.Fragment, null, " ");
764
784
  };
765
785
 
766
786
  // src/components/UniformRichText/nodes/TextRichTextNode.tsx
767
787
  import { getRichTextTagsFromTextFormat } from "@uniformdev/richtext";
768
- import React16 from "react";
788
+ import React18 from "react";
769
789
  var TextRichTextNode = ({ node }) => {
770
790
  const { text, format } = node;
771
791
  const tags = getRichTextTagsFromTextFormat(format);
772
- return /* @__PURE__ */ React16.createElement(React16.Fragment, null, tags.length > 0 ? tags.reduceRight((children, Tag) => /* @__PURE__ */ React16.createElement(Tag, null, children), text) : text);
792
+ return /* @__PURE__ */ React18.createElement(React18.Fragment, null, tags.length > 0 ? tags.reduceRight((children, Tag) => /* @__PURE__ */ React18.createElement(Tag, null, children), text) : text);
773
793
  };
774
794
 
775
795
  // src/components/UniformRichText/UniformRichTextNode.tsx
@@ -783,8 +803,8 @@ function UniformRichTextNode({ node, ...props }) {
783
803
  if (!NodeRenderer) {
784
804
  return null;
785
805
  }
786
- const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */ React17.createElement(UniformRichTextNode, { ...props, key: i, node: childNode })) : null;
787
- return /* @__PURE__ */ React17.createElement(NodeRenderer, { node }, children);
806
+ const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */ React19.createElement(UniformRichTextNode, { ...props, key: i, node: childNode })) : null;
807
+ return /* @__PURE__ */ React19.createElement(NodeRenderer, { node }, children);
788
808
  }
789
809
  var rendererMap = /* @__PURE__ */ new Map([
790
810
  ["heading", HeadingRichTextNode],
@@ -793,48 +813,60 @@ var rendererMap = /* @__PURE__ */ new Map([
793
813
  ["list", ListRichTextNode],
794
814
  ["listitem", ListItemRichTextNode],
795
815
  ["paragraph", ParagraphRichTextNode],
796
- ["quote", ({ children }) => /* @__PURE__ */ React17.createElement("blockquote", null, children)],
816
+ ["quote", ({ children }) => /* @__PURE__ */ React19.createElement("blockquote", null, children)],
797
817
  [
798
818
  "code",
799
- ({ children }) => /* @__PURE__ */ React17.createElement("pre", null, /* @__PURE__ */ React17.createElement("code", null, children))
819
+ ({ children }) => /* @__PURE__ */ React19.createElement("pre", null, /* @__PURE__ */ React19.createElement("code", null, children))
800
820
  ],
801
- ["root", ({ children }) => /* @__PURE__ */ React17.createElement(React17.Fragment, null, children)],
821
+ ["root", ({ children }) => /* @__PURE__ */ React19.createElement(React19.Fragment, null, children)],
802
822
  ["text", TextRichTextNode],
803
- ["tab", TabRichTextNode]
823
+ ["tab", TabRichTextNode],
824
+ [
825
+ "table",
826
+ ({ children }) => /* @__PURE__ */ React19.createElement("table", null, /* @__PURE__ */ React19.createElement("tbody", null, children))
827
+ ],
828
+ ["tablerow", ({ children }) => /* @__PURE__ */ React19.createElement("tr", null, children)],
829
+ ["tablecell", TableCellRichTextNode],
830
+ ["asset", AssetRichTextNode]
804
831
  ]);
805
832
  var resolveRichTextDefaultRenderer = (node) => {
806
833
  return rendererMap.get(node.type);
807
834
  };
808
835
 
809
836
  // src/components/UniformRichText/UniformRichText.tsx
810
- var UniformRichText = React18.forwardRef(function UniformRichText2({ parameterId, resolveRichTextRenderer, as: Tag = "div", ...props }, ref) {
811
- const { data: componentData } = useUniformCurrentComponent();
812
- const parameter = useMemo5(() => {
813
- var _a;
814
- return (_a = componentData == null ? void 0 : componentData.parameters) == null ? void 0 : _a[parameterId];
815
- }, [componentData, parameterId]);
816
- const value = useMemo5(() => parameter == null ? void 0 : parameter.value, [parameter]);
817
- if (!value || !isRichTextValue(value) || isRichTextValueConsideredEmpty(value)) return null;
818
- return Tag === null ? /* @__PURE__ */ React18.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ React18.createElement(
837
+ var UniformRichText = React20.forwardRef(function UniformRichText2({ parameterId, resolveRichTextRenderer, as: Tag = "div", placeholder, ...props }, ref) {
838
+ var _a;
839
+ const { data: componentData, contextualEditingDefaultPlaceholder } = useUniformCurrentComponent();
840
+ const { isContextualEditing } = useUniformCurrentComposition();
841
+ const parameter = (_a = componentData == null ? void 0 : componentData.parameters) == null ? void 0 : _a[parameterId];
842
+ if (!parameter) {
843
+ return null;
844
+ }
845
+ const placeholderProp = placeholder != null ? placeholder : contextualEditingDefaultPlaceholder;
846
+ const computedPlaceholder = typeof placeholderProp === "function" ? placeholderProp({ id: parameterId }) : placeholderProp;
847
+ const value = parameter.value;
848
+ if (!value || !isRichTextValue(value)) return null;
849
+ if (!isContextualEditing && isRichTextValueConsideredEmpty(value)) return null;
850
+ return Tag === null ? /* @__PURE__ */ React20.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ React20.createElement(
819
851
  Tag,
820
852
  {
821
853
  ref,
822
854
  ...props,
823
- ...{
855
+ ...isContextualEditing ? {
824
856
  [ATTRIBUTE_COMPONENT_ID]: componentData == null ? void 0 : componentData._id,
825
857
  [ATTRIBUTE_PARAMETER_ID]: parameterId,
826
858
  [ATTRIBUTE_PARAMETER_TYPE]: "richText"
827
- }
859
+ } : {}
828
860
  },
829
- /* @__PURE__ */ React18.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
861
+ isRichTextValueConsideredEmpty(value) ? /* @__PURE__ */ React20.createElement("p", null, /* @__PURE__ */ React20.createElement("i", null, computedPlaceholder)) : /* @__PURE__ */ React20.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
830
862
  );
831
863
  });
832
864
 
833
865
  // src/components/UniformText.tsx
834
- import React20, { useState as useState2 } from "react";
866
+ import React22, { useState as useState2 } from "react";
835
867
 
836
868
  // src/components/PureUniformText.tsx
837
- import React19 from "react";
869
+ import React21 from "react";
838
870
  var PureUniformText = ({
839
871
  as: Tag = "span",
840
872
  parameterId,
@@ -853,10 +885,10 @@ var PureUniformText = ({
853
885
  return null;
854
886
  }
855
887
  if (!isContextualEditing) {
856
- return /* @__PURE__ */ React19.createElement(Tag, { style: isMultiline ? { whiteSpace: "pre-wrap" } : {}, ...props }, render(value));
888
+ return /* @__PURE__ */ React21.createElement(Tag, { style: isMultiline ? { whiteSpace: "pre-wrap" } : {}, ...props }, render(value));
857
889
  }
858
890
  const computedPlaceholder = typeof placeholder === "function" ? placeholder({ id: parameterId }) : placeholder;
859
- return /* @__PURE__ */ React19.createElement(
891
+ return /* @__PURE__ */ React21.createElement(
860
892
  Tag,
861
893
  {
862
894
  ...props,
@@ -894,7 +926,7 @@ var UniformText = ({
894
926
  }
895
927
  const placeholderProp = placeholder != null ? placeholder : contextualEditingDefaultPlaceholder;
896
928
  const computedPlaceholder = typeof placeholderProp === "function" ? placeholderProp({ id: parameterId }) : placeholderProp;
897
- return /* @__PURE__ */ React20.createElement(
929
+ return /* @__PURE__ */ React22.createElement(
898
930
  PureUniformText,
899
931
  {
900
932
  ...props,
@@ -972,7 +1004,7 @@ import {
972
1004
  createCanvasChannel as createCanvasChannel2,
973
1005
  isUpdateContextualEditingStateInternalMessage
974
1006
  } from "@uniformdev/canvas";
975
- import { useEffect as useEffect3, useMemo as useMemo6, useState as useState3 } from "react";
1007
+ import { useEffect as useEffect3, useMemo as useMemo5, useState as useState3 } from "react";
976
1008
  var useUniformContextualEditingState = ({
977
1009
  global = false
978
1010
  } = {}) => {
@@ -982,7 +1014,7 @@ var useUniformContextualEditingState = ({
982
1014
  const [previewMode, setPreviewMode] = useState3(
983
1015
  isContextualEditing ? "editor" : void 0
984
1016
  );
985
- const channel = useMemo6(() => {
1017
+ const channel = useMemo5(() => {
986
1018
  if (!isContextualEditing) {
987
1019
  return;
988
1020
  }
@@ -1016,7 +1048,7 @@ var useUniformContextualEditingState = ({
1016
1048
  unsubscribe();
1017
1049
  };
1018
1050
  }, [global, channel, componentData == null ? void 0 : componentData._id, setSelectedComponentReference, setPreviewMode]);
1019
- return useMemo6(
1051
+ return useMemo5(
1020
1052
  () => ({
1021
1053
  isContextualEditing,
1022
1054
  selectedComponentReference,
package/dist/index.js CHANGED
@@ -719,56 +719,70 @@ var UniformPlayground = ({
719
719
 
720
720
  // src/components/UniformRichText/UniformRichText.tsx
721
721
  var import_canvas11 = require("@uniformdev/canvas");
722
- var import_richtext5 = require("@uniformdev/richtext");
723
- var import_react20 = __toESM(require("react"));
722
+ var import_richtext6 = require("@uniformdev/richtext");
723
+ var import_react22 = __toESM(require("react"));
724
724
 
725
725
  // src/components/UniformRichText/UniformRichTextNode.tsx
726
- var import_richtext4 = require("@uniformdev/richtext");
727
- var import_react19 = __toESM(require("react"));
726
+ var import_richtext5 = require("@uniformdev/richtext");
727
+ var import_react21 = __toESM(require("react"));
728
728
 
729
- // src/components/UniformRichText/nodes/HeadingRichTextNode.tsx
729
+ // src/components/UniformRichText/nodes/AssetRichTextNode.tsx
730
730
  var import_react11 = __toESM(require("react"));
731
+ var AssetRichTextNode = ({ node }) => {
732
+ var _a, _b;
733
+ const { __asset } = node;
734
+ if (__asset === void 0) {
735
+ return null;
736
+ }
737
+ if (__asset.type !== "image") {
738
+ return null;
739
+ }
740
+ return /* @__PURE__ */ import_react11.default.createElement("figure", null, /* @__PURE__ */ import_react11.default.createElement("img", { src: __asset.fields.url.value, alt: (_a = __asset.fields.title) == null ? void 0 : _a.value }), ((_b = __asset.fields.description) == null ? void 0 : _b.value) ? /* @__PURE__ */ import_react11.default.createElement("figcaption", null, __asset.fields.description.value) : null);
741
+ };
742
+
743
+ // src/components/UniformRichText/nodes/HeadingRichTextNode.tsx
744
+ var import_react12 = __toESM(require("react"));
731
745
  var HeadingRichTextNode = ({ children, node }) => {
732
746
  const { tag } = node;
733
747
  const HTag = tag != null ? tag : "h1";
734
- return /* @__PURE__ */ import_react11.default.createElement(HTag, null, children);
748
+ return /* @__PURE__ */ import_react12.default.createElement(HTag, null, children);
735
749
  };
736
750
 
737
751
  // src/components/UniformRichText/nodes/LinebreakRichTextNode.tsx
738
- var import_react12 = __toESM(require("react"));
752
+ var import_react13 = __toESM(require("react"));
739
753
  var LinebreakRichTextNode = () => {
740
- return /* @__PURE__ */ import_react12.default.createElement("br", null);
754
+ return /* @__PURE__ */ import_react13.default.createElement("br", null);
741
755
  };
742
756
 
743
757
  // src/components/UniformRichText/nodes/LinkRichTextNode.tsx
744
758
  var import_richtext = require("@uniformdev/richtext");
745
- var import_react13 = __toESM(require("react"));
759
+ var import_react14 = __toESM(require("react"));
746
760
  var LinkRichTextNode = ({ children, node }) => {
747
761
  const { link } = node;
748
- return /* @__PURE__ */ import_react13.default.createElement("a", { href: (0, import_richtext.linkParamValueToHref)(link) }, children);
762
+ return /* @__PURE__ */ import_react14.default.createElement("a", { href: (0, import_richtext.linkParamValueToHref)(link) }, children);
749
763
  };
750
764
 
751
765
  // src/components/UniformRichText/nodes/ListItemRichTextNode.tsx
752
- var import_react14 = __toESM(require("react"));
766
+ var import_react15 = __toESM(require("react"));
753
767
  var ListItemRichTextNode = ({ children, node }) => {
754
768
  const { value } = node;
755
- return /* @__PURE__ */ import_react14.default.createElement("li", { value: Number.isFinite(value) && value > 0 ? value : void 0 }, children);
769
+ return /* @__PURE__ */ import_react15.default.createElement("li", { value: Number.isFinite(value) && value > 0 ? value : void 0 }, children);
756
770
  };
757
771
 
758
772
  // src/components/UniformRichText/nodes/ListRichTextNode.tsx
759
- var import_react15 = __toESM(require("react"));
773
+ var import_react16 = __toESM(require("react"));
760
774
  var ListRichTextNode = ({ children, node }) => {
761
775
  const { tag, start } = node;
762
776
  const ListTag = tag != null ? tag : "ul";
763
- return /* @__PURE__ */ import_react15.default.createElement(ListTag, { start: Number.isFinite(start) && start > 0 ? start : void 0 }, children);
777
+ return /* @__PURE__ */ import_react16.default.createElement(ListTag, { start: Number.isFinite(start) && start > 0 ? start : void 0 }, children);
764
778
  };
765
779
 
766
780
  // src/components/UniformRichText/nodes/ParagraphRichTextNode.tsx
767
781
  var import_richtext2 = require("@uniformdev/richtext");
768
- var import_react16 = __toESM(require("react"));
782
+ var import_react17 = __toESM(require("react"));
769
783
  var ParagraphRichTextNode = ({ children, node }) => {
770
784
  const { format, direction } = node;
771
- return /* @__PURE__ */ import_react16.default.createElement(
785
+ return /* @__PURE__ */ import_react17.default.createElement(
772
786
  "p",
773
787
  {
774
788
  dir: (0, import_richtext2.isPureDirection)(direction) ? direction : void 0,
@@ -778,25 +792,34 @@ var ParagraphRichTextNode = ({ children, node }) => {
778
792
  );
779
793
  };
780
794
 
795
+ // src/components/UniformRichText/nodes/TableCellRichTextNode.tsx
796
+ var import_richtext3 = require("@uniformdev/richtext");
797
+ var import_react18 = __toESM(require("react"));
798
+ var TableCellRichTextNode = ({ children, node }) => {
799
+ const { headerState } = node;
800
+ const TableCellTag = (0, import_richtext3.getRichTextTagFromTableCellHeaderState)(headerState);
801
+ return /* @__PURE__ */ import_react18.default.createElement(TableCellTag, null, children);
802
+ };
803
+
781
804
  // src/components/UniformRichText/nodes/TabRichTextNode.tsx
782
- var import_react17 = __toESM(require("react"));
805
+ var import_react19 = __toESM(require("react"));
783
806
  var TabRichTextNode = () => {
784
- return /* @__PURE__ */ import_react17.default.createElement(import_react17.default.Fragment, null, " ");
807
+ return /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, " ");
785
808
  };
786
809
 
787
810
  // src/components/UniformRichText/nodes/TextRichTextNode.tsx
788
- var import_richtext3 = require("@uniformdev/richtext");
789
- var import_react18 = __toESM(require("react"));
811
+ var import_richtext4 = require("@uniformdev/richtext");
812
+ var import_react20 = __toESM(require("react"));
790
813
  var TextRichTextNode = ({ node }) => {
791
814
  const { text, format } = node;
792
- const tags = (0, import_richtext3.getRichTextTagsFromTextFormat)(format);
793
- 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);
815
+ const tags = (0, import_richtext4.getRichTextTagsFromTextFormat)(format);
816
+ return /* @__PURE__ */ import_react20.default.createElement(import_react20.default.Fragment, null, tags.length > 0 ? tags.reduceRight((children, Tag) => /* @__PURE__ */ import_react20.default.createElement(Tag, null, children), text) : text);
794
817
  };
795
818
 
796
819
  // src/components/UniformRichText/UniformRichTextNode.tsx
797
820
  function UniformRichTextNode({ node, ...props }) {
798
821
  var _a;
799
- if (!(0, import_richtext4.isRichTextNode)(node)) return null;
822
+ if (!(0, import_richtext5.isRichTextNode)(node)) return null;
800
823
  let NodeRenderer = (_a = props.resolveRichTextRenderer) == null ? void 0 : _a.call(props, node);
801
824
  if (typeof NodeRenderer === "undefined") {
802
825
  NodeRenderer = resolveRichTextDefaultRenderer(node);
@@ -804,8 +827,8 @@ function UniformRichTextNode({ node, ...props }) {
804
827
  if (!NodeRenderer) {
805
828
  return null;
806
829
  }
807
- const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */ import_react19.default.createElement(UniformRichTextNode, { ...props, key: i, node: childNode })) : null;
808
- return /* @__PURE__ */ import_react19.default.createElement(NodeRenderer, { node }, children);
830
+ const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */ import_react21.default.createElement(UniformRichTextNode, { ...props, key: i, node: childNode })) : null;
831
+ return /* @__PURE__ */ import_react21.default.createElement(NodeRenderer, { node }, children);
809
832
  }
810
833
  var rendererMap = /* @__PURE__ */ new Map([
811
834
  ["heading", HeadingRichTextNode],
@@ -814,48 +837,60 @@ var rendererMap = /* @__PURE__ */ new Map([
814
837
  ["list", ListRichTextNode],
815
838
  ["listitem", ListItemRichTextNode],
816
839
  ["paragraph", ParagraphRichTextNode],
817
- ["quote", ({ children }) => /* @__PURE__ */ import_react19.default.createElement("blockquote", null, children)],
840
+ ["quote", ({ children }) => /* @__PURE__ */ import_react21.default.createElement("blockquote", null, children)],
818
841
  [
819
842
  "code",
820
- ({ children }) => /* @__PURE__ */ import_react19.default.createElement("pre", null, /* @__PURE__ */ import_react19.default.createElement("code", null, children))
843
+ ({ children }) => /* @__PURE__ */ import_react21.default.createElement("pre", null, /* @__PURE__ */ import_react21.default.createElement("code", null, children))
821
844
  ],
822
- ["root", ({ children }) => /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, children)],
845
+ ["root", ({ children }) => /* @__PURE__ */ import_react21.default.createElement(import_react21.default.Fragment, null, children)],
823
846
  ["text", TextRichTextNode],
824
- ["tab", TabRichTextNode]
847
+ ["tab", TabRichTextNode],
848
+ [
849
+ "table",
850
+ ({ children }) => /* @__PURE__ */ import_react21.default.createElement("table", null, /* @__PURE__ */ import_react21.default.createElement("tbody", null, children))
851
+ ],
852
+ ["tablerow", ({ children }) => /* @__PURE__ */ import_react21.default.createElement("tr", null, children)],
853
+ ["tablecell", TableCellRichTextNode],
854
+ ["asset", AssetRichTextNode]
825
855
  ]);
826
856
  var resolveRichTextDefaultRenderer = (node) => {
827
857
  return rendererMap.get(node.type);
828
858
  };
829
859
 
830
860
  // src/components/UniformRichText/UniformRichText.tsx
831
- var UniformRichText = import_react20.default.forwardRef(function UniformRichText2({ parameterId, resolveRichTextRenderer, as: Tag = "div", ...props }, ref) {
832
- const { data: componentData } = useUniformCurrentComponent();
833
- const parameter = (0, import_react20.useMemo)(() => {
834
- var _a;
835
- return (_a = componentData == null ? void 0 : componentData.parameters) == null ? void 0 : _a[parameterId];
836
- }, [componentData, parameterId]);
837
- const value = (0, import_react20.useMemo)(() => parameter == null ? void 0 : parameter.value, [parameter]);
838
- if (!value || !(0, import_richtext5.isRichTextValue)(value) || (0, import_richtext5.isRichTextValueConsideredEmpty)(value)) return null;
839
- return Tag === null ? /* @__PURE__ */ import_react20.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ import_react20.default.createElement(
861
+ var UniformRichText = import_react22.default.forwardRef(function UniformRichText2({ parameterId, resolveRichTextRenderer, as: Tag = "div", placeholder, ...props }, ref) {
862
+ var _a;
863
+ const { data: componentData, contextualEditingDefaultPlaceholder } = useUniformCurrentComponent();
864
+ const { isContextualEditing } = useUniformCurrentComposition();
865
+ const parameter = (_a = componentData == null ? void 0 : componentData.parameters) == null ? void 0 : _a[parameterId];
866
+ if (!parameter) {
867
+ return null;
868
+ }
869
+ const placeholderProp = placeholder != null ? placeholder : contextualEditingDefaultPlaceholder;
870
+ const computedPlaceholder = typeof placeholderProp === "function" ? placeholderProp({ id: parameterId }) : placeholderProp;
871
+ const value = parameter.value;
872
+ if (!value || !(0, import_richtext6.isRichTextValue)(value)) return null;
873
+ if (!isContextualEditing && (0, import_richtext6.isRichTextValueConsideredEmpty)(value)) return null;
874
+ return Tag === null ? /* @__PURE__ */ import_react22.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ import_react22.default.createElement(
840
875
  Tag,
841
876
  {
842
877
  ref,
843
878
  ...props,
844
- ...{
879
+ ...isContextualEditing ? {
845
880
  [import_canvas11.ATTRIBUTE_COMPONENT_ID]: componentData == null ? void 0 : componentData._id,
846
881
  [import_canvas11.ATTRIBUTE_PARAMETER_ID]: parameterId,
847
882
  [import_canvas11.ATTRIBUTE_PARAMETER_TYPE]: "richText"
848
- }
883
+ } : {}
849
884
  },
850
- /* @__PURE__ */ import_react20.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
885
+ (0, import_richtext6.isRichTextValueConsideredEmpty)(value) ? /* @__PURE__ */ import_react22.default.createElement("p", null, /* @__PURE__ */ import_react22.default.createElement("i", null, computedPlaceholder)) : /* @__PURE__ */ import_react22.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
851
886
  );
852
887
  });
853
888
 
854
889
  // src/components/UniformText.tsx
855
- var import_react22 = __toESM(require("react"));
890
+ var import_react24 = __toESM(require("react"));
856
891
 
857
892
  // src/components/PureUniformText.tsx
858
- var import_react21 = __toESM(require("react"));
893
+ var import_react23 = __toESM(require("react"));
859
894
  var PureUniformText = ({
860
895
  as: Tag = "span",
861
896
  parameterId,
@@ -874,10 +909,10 @@ var PureUniformText = ({
874
909
  return null;
875
910
  }
876
911
  if (!isContextualEditing) {
877
- return /* @__PURE__ */ import_react21.default.createElement(Tag, { style: isMultiline ? { whiteSpace: "pre-wrap" } : {}, ...props }, render(value));
912
+ return /* @__PURE__ */ import_react23.default.createElement(Tag, { style: isMultiline ? { whiteSpace: "pre-wrap" } : {}, ...props }, render(value));
878
913
  }
879
914
  const computedPlaceholder = typeof placeholder === "function" ? placeholder({ id: parameterId }) : placeholder;
880
- return /* @__PURE__ */ import_react21.default.createElement(
915
+ return /* @__PURE__ */ import_react23.default.createElement(
881
916
  Tag,
882
917
  {
883
918
  ...props,
@@ -906,7 +941,7 @@ var UniformText = ({
906
941
  var _a, _b, _c;
907
942
  const { data: componentData, contextualEditingDefaultPlaceholder } = useUniformCurrentComponent();
908
943
  const { isContextualEditing } = useUniformCurrentComposition();
909
- const [isFocused, setIsFocused] = (0, import_react22.useState)(false);
944
+ const [isFocused, setIsFocused] = (0, import_react24.useState)(false);
910
945
  const parameter = (_a = componentData == null ? void 0 : componentData.parameters) == null ? void 0 : _a[parameterId];
911
946
  const isEditable = (_c = (_b = parameter == null ? void 0 : parameter._contextualEditing) == null ? void 0 : _b.isEditable) != null ? _c : false;
912
947
  const shouldSkipCustomRendering = isFocused && isEditable;
@@ -915,7 +950,7 @@ var UniformText = ({
915
950
  }
916
951
  const placeholderProp = placeholder != null ? placeholder : contextualEditingDefaultPlaceholder;
917
952
  const computedPlaceholder = typeof placeholderProp === "function" ? placeholderProp({ id: parameterId }) : placeholderProp;
918
- return /* @__PURE__ */ import_react22.default.createElement(
953
+ return /* @__PURE__ */ import_react24.default.createElement(
919
954
  PureUniformText,
920
955
  {
921
956
  ...props,
@@ -948,14 +983,14 @@ var getParameterAttributes = (options) => {
948
983
 
949
984
  // src/hooks/useCompositionEventEffect.ts
950
985
  var import_canvas13 = require("@uniformdev/canvas");
951
- var import_react23 = require("react");
986
+ var import_react25 = require("react");
952
987
  function useCompositionEventEffect({
953
988
  enabled,
954
989
  projectId,
955
990
  compositionId,
956
991
  effect
957
992
  }) {
958
- (0, import_react23.useEffect)(() => {
993
+ (0, import_react25.useEffect)(() => {
959
994
  if (!enabled || !compositionId || !projectId) {
960
995
  return;
961
996
  }
@@ -984,17 +1019,17 @@ function useCompositionEventEffect({
984
1019
 
985
1020
  // src/hooks/useUniformContextualEditingState.ts
986
1021
  var import_canvas14 = require("@uniformdev/canvas");
987
- var import_react24 = require("react");
1022
+ var import_react26 = require("react");
988
1023
  var useUniformContextualEditingState = ({
989
1024
  global = false
990
1025
  } = {}) => {
991
1026
  const { isContextualEditing } = useUniformCurrentComposition();
992
1027
  const { data: componentData } = useUniformCurrentComponent();
993
- const [selectedComponentReference, setSelectedComponentReference] = (0, import_react24.useState)();
994
- const [previewMode, setPreviewMode] = (0, import_react24.useState)(
1028
+ const [selectedComponentReference, setSelectedComponentReference] = (0, import_react26.useState)();
1029
+ const [previewMode, setPreviewMode] = (0, import_react26.useState)(
995
1030
  isContextualEditing ? "editor" : void 0
996
1031
  );
997
- const channel = (0, import_react24.useMemo)(() => {
1032
+ const channel = (0, import_react26.useMemo)(() => {
998
1033
  if (!isContextualEditing) {
999
1034
  return;
1000
1035
  }
@@ -1004,7 +1039,7 @@ var useUniformContextualEditingState = ({
1004
1039
  });
1005
1040
  return channel2;
1006
1041
  }, [isContextualEditing]);
1007
- (0, import_react24.useEffect)(() => {
1042
+ (0, import_react26.useEffect)(() => {
1008
1043
  var _a, _b;
1009
1044
  if (!channel) {
1010
1045
  return;
@@ -1028,7 +1063,7 @@ var useUniformContextualEditingState = ({
1028
1063
  unsubscribe();
1029
1064
  };
1030
1065
  }, [global, channel, componentData == null ? void 0 : componentData._id, setSelectedComponentReference, setPreviewMode]);
1031
- return (0, import_react24.useMemo)(
1066
+ return (0, import_react26.useMemo)(
1032
1067
  () => ({
1033
1068
  isContextualEditing,
1034
1069
  selectedComponentReference,