@uniformdev/canvas-next-rsc 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/component.js CHANGED
@@ -48,12 +48,12 @@ var DefaultNotImplementedComponent = ({ component }) => {
48
48
  };
49
49
 
50
50
  // src/components/UniformRichText.tsx
51
- var import_richtext5 = require("@uniformdev/richtext");
52
- var import_react11 = __toESM(require("react"));
51
+ var import_richtext6 = require("@uniformdev/richtext");
52
+ var import_react12 = __toESM(require("react"));
53
53
 
54
54
  // src/components/UniformRichTextNode.tsx
55
- var import_richtext4 = require("@uniformdev/richtext");
56
- var import_react10 = __toESM(require("react"));
55
+ var import_richtext5 = require("@uniformdev/richtext");
56
+ var import_react11 = __toESM(require("react"));
57
57
 
58
58
  // src/components/nodes/HeadingRichTextNode.tsx
59
59
  var import_react2 = __toESM(require("react"));
@@ -107,25 +107,34 @@ var ParagraphRichTextNode = ({ children, node }) => {
107
107
  );
108
108
  };
109
109
 
110
- // src/components/nodes/TabRichTextNode.tsx
110
+ // src/components/nodes/TableCellRichTextNode.tsx
111
+ var import_richtext3 = require("@uniformdev/richtext");
111
112
  var import_react8 = __toESM(require("react"));
113
+ var TableCellRichTextNode = ({ children, node }) => {
114
+ const { headerState } = node;
115
+ const TableCellTag = (0, import_richtext3.getRichTextTagFromTableCellHeaderState)(headerState);
116
+ return /* @__PURE__ */ import_react8.default.createElement(TableCellTag, null, children);
117
+ };
118
+
119
+ // src/components/nodes/TabRichTextNode.tsx
120
+ var import_react9 = __toESM(require("react"));
112
121
  var TabRichTextNode = () => {
113
- return /* @__PURE__ */ import_react8.default.createElement(import_react8.default.Fragment, null, " ");
122
+ return /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, " ");
114
123
  };
115
124
 
116
125
  // src/components/nodes/TextRichTextNode.tsx
117
- var import_richtext3 = require("@uniformdev/richtext");
118
- var import_react9 = __toESM(require("react"));
126
+ var import_richtext4 = require("@uniformdev/richtext");
127
+ var import_react10 = __toESM(require("react"));
119
128
  var TextRichTextNode = ({ node }) => {
120
129
  const { text, format } = node;
121
- const tags = (0, import_richtext3.getRichTextTagsFromTextFormat)(format);
122
- return /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, tags.length > 0 ? tags.reduceRight((children, Tag) => /* @__PURE__ */ import_react9.default.createElement(Tag, null, children), text) : text);
130
+ const tags = (0, import_richtext4.getRichTextTagsFromTextFormat)(format);
131
+ return /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null, tags.length > 0 ? tags.reduceRight((children, Tag) => /* @__PURE__ */ import_react10.default.createElement(Tag, null, children), text) : text);
123
132
  };
124
133
 
125
134
  // src/components/UniformRichTextNode.tsx
126
135
  function UniformRichTextNode({ node, ...props }) {
127
136
  var _a;
128
- if (!(0, import_richtext4.isRichTextNode)(node)) return null;
137
+ if (!(0, import_richtext5.isRichTextNode)(node)) return null;
129
138
  let NodeRenderer = (_a = props.resolveRichTextRenderer) == null ? void 0 : _a.call(props, node);
130
139
  if (typeof NodeRenderer === "undefined") {
131
140
  NodeRenderer = resolveRichTextDefaultRenderer(node);
@@ -133,8 +142,8 @@ function UniformRichTextNode({ node, ...props }) {
133
142
  if (!NodeRenderer) {
134
143
  return null;
135
144
  }
136
- const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */ import_react10.default.createElement(UniformRichTextNode, { ...props, key: i, node: childNode })) : null;
137
- return /* @__PURE__ */ import_react10.default.createElement(NodeRenderer, { node }, children);
145
+ const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */ import_react11.default.createElement(UniformRichTextNode, { ...props, key: i, node: childNode })) : null;
146
+ return /* @__PURE__ */ import_react11.default.createElement(NodeRenderer, { node }, children);
138
147
  }
139
148
  var rendererMap = /* @__PURE__ */ new Map([
140
149
  ["heading", HeadingRichTextNode],
@@ -143,26 +152,32 @@ var rendererMap = /* @__PURE__ */ new Map([
143
152
  ["list", ListRichTextNode],
144
153
  ["listitem", ListItemRichTextNode],
145
154
  ["paragraph", ParagraphRichTextNode],
146
- ["quote", ({ children }) => /* @__PURE__ */ import_react10.default.createElement("blockquote", null, children)],
155
+ ["quote", ({ children }) => /* @__PURE__ */ import_react11.default.createElement("blockquote", null, children)],
147
156
  [
148
157
  "code",
149
- ({ children }) => /* @__PURE__ */ import_react10.default.createElement("pre", null, /* @__PURE__ */ import_react10.default.createElement("code", null, children))
158
+ ({ children }) => /* @__PURE__ */ import_react11.default.createElement("pre", null, /* @__PURE__ */ import_react11.default.createElement("code", null, children))
150
159
  ],
151
- ["root", ({ children }) => /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null, children)],
160
+ ["root", ({ children }) => /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, children)],
152
161
  ["text", TextRichTextNode],
153
- ["tab", TabRichTextNode]
162
+ ["tab", TabRichTextNode],
163
+ [
164
+ "table",
165
+ ({ children }) => /* @__PURE__ */ import_react11.default.createElement("table", null, /* @__PURE__ */ import_react11.default.createElement("tbody", null, children))
166
+ ],
167
+ ["tablerow", ({ children }) => /* @__PURE__ */ import_react11.default.createElement("tr", null, children)],
168
+ ["tablecell", TableCellRichTextNode]
154
169
  ]);
155
170
  var resolveRichTextDefaultRenderer = (node) => {
156
171
  return rendererMap.get(node.type);
157
172
  };
158
173
 
159
174
  // src/components/UniformRichText.tsx
160
- var UniformRichText = import_react11.default.forwardRef(function UniformRichText2({ parameterId, component, resolveRichTextRenderer, as: Tag = "div", ...props }, ref) {
175
+ var UniformRichText = import_react12.default.forwardRef(function UniformRichText2({ parameterId, component, resolveRichTextRenderer, as: Tag = "div", ...props }, ref) {
161
176
  var _a;
162
177
  const parameter = (_a = component == null ? void 0 : component.parameters) == null ? void 0 : _a[parameterId];
163
178
  const value = parameter == null ? void 0 : parameter.value;
164
- if (!value || !(0, import_richtext5.isRichTextValue)(value) || (0, import_richtext5.isRichTextValueConsideredEmpty)(value)) return null;
165
- return Tag === null ? /* @__PURE__ */ import_react11.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ import_react11.default.createElement(Tag, { ref, ...props }, /* @__PURE__ */ import_react11.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }));
179
+ if (!value || !(0, import_richtext6.isRichTextValue)(value) || (0, import_richtext6.isRichTextValueConsideredEmpty)(value)) return null;
180
+ return Tag === null ? /* @__PURE__ */ import_react12.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ import_react12.default.createElement(Tag, { ref, ...props }, /* @__PURE__ */ import_react12.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }));
166
181
  });
167
182
 
168
183
  // src/components/UniformSlot.tsx
@@ -193,9 +208,9 @@ var UniformSlot = ({ data, slot, children }) => {
193
208
 
194
209
  // src/components/UniformText.tsx
195
210
  var import_core = require("@uniformdev/canvas-react/core");
196
- var import_react12 = __toESM(require("react"));
211
+ var import_react13 = __toESM(require("react"));
197
212
  var UniformText = ({ context, ...rest }) => {
198
- return /* @__PURE__ */ import_react12.default.createElement(
213
+ return /* @__PURE__ */ import_react13.default.createElement(
199
214
  import_core.PureUniformText,
200
215
  {
201
216
  ...rest,
@@ -9,11 +9,11 @@ import {
9
9
  isRichTextValue,
10
10
  isRichTextValueConsideredEmpty
11
11
  } from "@uniformdev/richtext";
12
- import React11 from "react";
12
+ import React12 from "react";
13
13
 
14
14
  // src/components/UniformRichTextNode.tsx
15
15
  import { isRichTextNode } from "@uniformdev/richtext";
16
- import React10 from "react";
16
+ import React11 from "react";
17
17
 
18
18
  // src/components/nodes/HeadingRichTextNode.tsx
19
19
  import React2 from "react";
@@ -67,19 +67,28 @@ var ParagraphRichTextNode = ({ children, node }) => {
67
67
  );
68
68
  };
69
69
 
70
- // src/components/nodes/TabRichTextNode.tsx
70
+ // src/components/nodes/TableCellRichTextNode.tsx
71
+ import { getRichTextTagFromTableCellHeaderState } from "@uniformdev/richtext";
71
72
  import React8 from "react";
73
+ var TableCellRichTextNode = ({ children, node }) => {
74
+ const { headerState } = node;
75
+ const TableCellTag = getRichTextTagFromTableCellHeaderState(headerState);
76
+ return /* @__PURE__ */ React8.createElement(TableCellTag, null, children);
77
+ };
78
+
79
+ // src/components/nodes/TabRichTextNode.tsx
80
+ import React9 from "react";
72
81
  var TabRichTextNode = () => {
73
- return /* @__PURE__ */ React8.createElement(React8.Fragment, null, " ");
82
+ return /* @__PURE__ */ React9.createElement(React9.Fragment, null, " ");
74
83
  };
75
84
 
76
85
  // src/components/nodes/TextRichTextNode.tsx
77
86
  import { getRichTextTagsFromTextFormat } from "@uniformdev/richtext";
78
- import React9 from "react";
87
+ import React10 from "react";
79
88
  var TextRichTextNode = ({ node }) => {
80
89
  const { text, format } = node;
81
90
  const tags = getRichTextTagsFromTextFormat(format);
82
- return /* @__PURE__ */ React9.createElement(React9.Fragment, null, tags.length > 0 ? tags.reduceRight((children, Tag) => /* @__PURE__ */ React9.createElement(Tag, null, children), text) : text);
91
+ return /* @__PURE__ */ React10.createElement(React10.Fragment, null, tags.length > 0 ? tags.reduceRight((children, Tag) => /* @__PURE__ */ React10.createElement(Tag, null, children), text) : text);
83
92
  };
84
93
 
85
94
  // src/components/UniformRichTextNode.tsx
@@ -93,8 +102,8 @@ function UniformRichTextNode({ node, ...props }) {
93
102
  if (!NodeRenderer) {
94
103
  return null;
95
104
  }
96
- const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */ React10.createElement(UniformRichTextNode, { ...props, key: i, node: childNode })) : null;
97
- return /* @__PURE__ */ React10.createElement(NodeRenderer, { node }, children);
105
+ const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */ React11.createElement(UniformRichTextNode, { ...props, key: i, node: childNode })) : null;
106
+ return /* @__PURE__ */ React11.createElement(NodeRenderer, { node }, children);
98
107
  }
99
108
  var rendererMap = /* @__PURE__ */ new Map([
100
109
  ["heading", HeadingRichTextNode],
@@ -103,26 +112,32 @@ var rendererMap = /* @__PURE__ */ new Map([
103
112
  ["list", ListRichTextNode],
104
113
  ["listitem", ListItemRichTextNode],
105
114
  ["paragraph", ParagraphRichTextNode],
106
- ["quote", ({ children }) => /* @__PURE__ */ React10.createElement("blockquote", null, children)],
115
+ ["quote", ({ children }) => /* @__PURE__ */ React11.createElement("blockquote", null, children)],
107
116
  [
108
117
  "code",
109
- ({ children }) => /* @__PURE__ */ React10.createElement("pre", null, /* @__PURE__ */ React10.createElement("code", null, children))
118
+ ({ children }) => /* @__PURE__ */ React11.createElement("pre", null, /* @__PURE__ */ React11.createElement("code", null, children))
110
119
  ],
111
- ["root", ({ children }) => /* @__PURE__ */ React10.createElement(React10.Fragment, null, children)],
120
+ ["root", ({ children }) => /* @__PURE__ */ React11.createElement(React11.Fragment, null, children)],
112
121
  ["text", TextRichTextNode],
113
- ["tab", TabRichTextNode]
122
+ ["tab", TabRichTextNode],
123
+ [
124
+ "table",
125
+ ({ children }) => /* @__PURE__ */ React11.createElement("table", null, /* @__PURE__ */ React11.createElement("tbody", null, children))
126
+ ],
127
+ ["tablerow", ({ children }) => /* @__PURE__ */ React11.createElement("tr", null, children)],
128
+ ["tablecell", TableCellRichTextNode]
114
129
  ]);
115
130
  var resolveRichTextDefaultRenderer = (node) => {
116
131
  return rendererMap.get(node.type);
117
132
  };
118
133
 
119
134
  // src/components/UniformRichText.tsx
120
- var UniformRichText = React11.forwardRef(function UniformRichText2({ parameterId, component, resolveRichTextRenderer, as: Tag = "div", ...props }, ref) {
135
+ var UniformRichText = React12.forwardRef(function UniformRichText2({ parameterId, component, resolveRichTextRenderer, as: Tag = "div", ...props }, ref) {
121
136
  var _a;
122
137
  const parameter = (_a = component == null ? void 0 : component.parameters) == null ? void 0 : _a[parameterId];
123
138
  const value = parameter == null ? void 0 : parameter.value;
124
139
  if (!value || !isRichTextValue(value) || isRichTextValueConsideredEmpty(value)) return null;
125
- return Tag === null ? /* @__PURE__ */ React11.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ React11.createElement(Tag, { ref, ...props }, /* @__PURE__ */ React11.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }));
140
+ return Tag === null ? /* @__PURE__ */ React12.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ React12.createElement(Tag, { ref, ...props }, /* @__PURE__ */ React12.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }));
126
141
  });
127
142
 
128
143
  // src/components/UniformSlot.tsx
@@ -153,9 +168,9 @@ var UniformSlot = ({ data, slot, children }) => {
153
168
 
154
169
  // src/components/UniformText.tsx
155
170
  import { PureUniformText } from "@uniformdev/canvas-react/core";
156
- import React12 from "react";
171
+ import React13 from "react";
157
172
  var UniformText = ({ context, ...rest }) => {
158
- return /* @__PURE__ */ React12.createElement(
173
+ return /* @__PURE__ */ React13.createElement(
159
174
  PureUniformText,
160
175
  {
161
176
  ...rest,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas-next-rsc",
3
- "version": "19.177.1",
3
+ "version": "19.177.2-alpha.10+c9cb5f414c",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "scripts": {
6
6
  "build": "tsup",
@@ -14,22 +14,22 @@
14
14
  "exports": {
15
15
  ".": {
16
16
  "require": "./dist/index.js",
17
- "import": "./dist/index.js",
17
+ "import": "./dist/index.esm.js",
18
18
  "types": "./dist/index.d.ts"
19
19
  },
20
20
  "./handler": {
21
21
  "require": "./dist/handler.js",
22
- "import": "./dist/handler.js",
22
+ "import": "./dist/handler.mjs",
23
23
  "types": "./dist/handler.d.ts"
24
24
  },
25
25
  "./config": {
26
26
  "require": "./dist/config.js",
27
- "import": "./dist/config.js",
27
+ "import": "./dist/config.mjs",
28
28
  "types": "./dist/config.d.ts"
29
29
  },
30
30
  "./component": {
31
31
  "require": "./dist/component.js",
32
- "import": "./dist/component.js",
32
+ "import": "./dist/component.mjs",
33
33
  "types": "./dist/component.d.ts"
34
34
  }
35
35
  },
@@ -61,15 +61,15 @@
61
61
  "react-dom": "18.2.0"
62
62
  },
63
63
  "dependencies": {
64
- "@uniformdev/canvas": "19.177.1",
65
- "@uniformdev/canvas-next-rsc-client": "^19.177.1",
66
- "@uniformdev/canvas-next-rsc-shared": "^19.177.1",
67
- "@uniformdev/canvas-react": "19.177.1",
68
- "@uniformdev/context": "19.177.1",
69
- "@uniformdev/project-map": "19.177.1",
70
- "@uniformdev/redirect": "19.177.1",
71
- "@uniformdev/richtext": "19.177.1",
72
- "@uniformdev/webhooks": "19.177.1",
64
+ "@uniformdev/canvas": "19.177.2-alpha.10+c9cb5f414c",
65
+ "@uniformdev/canvas-next-rsc-client": "^19.177.2-alpha.10+c9cb5f414c",
66
+ "@uniformdev/canvas-next-rsc-shared": "^19.177.2-alpha.10+c9cb5f414c",
67
+ "@uniformdev/canvas-react": "19.177.2-alpha.10+c9cb5f414c",
68
+ "@uniformdev/context": "19.177.2-alpha.10+c9cb5f414c",
69
+ "@uniformdev/project-map": "19.177.2-alpha.10+c9cb5f414c",
70
+ "@uniformdev/redirect": "19.177.2-alpha.10+c9cb5f414c",
71
+ "@uniformdev/richtext": "19.177.2-alpha.10+c9cb5f414c",
72
+ "@uniformdev/webhooks": "19.177.2-alpha.10+c9cb5f414c",
73
73
  "@vercel/edge-config": "^0.4.0",
74
74
  "encoding": "^0.1.13",
75
75
  "server-only": "^0.0.1",
@@ -86,5 +86,5 @@
86
86
  "publishConfig": {
87
87
  "access": "public"
88
88
  },
89
- "gitHead": "1236153b0d17f18fc96d50f803a7eeaa4b366688"
89
+ "gitHead": "c9cb5f414c41dc1d2c37dff02a5b87484901657e"
90
90
  }