@uniformdev/canvas-next-rsc 20.75.1-alpha.0 → 20.75.1-alpha.16
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 +31 -15
- package/dist/component.mjs +18 -2
- package/package.json +11 -11
package/dist/component.js
CHANGED
|
@@ -119,11 +119,11 @@ Add this component mapping to your resolveComponent function on UniformCompositi
|
|
|
119
119
|
|
|
120
120
|
// src/components/UniformRichText.tsx
|
|
121
121
|
var import_canvas = require("@uniformdev/canvas");
|
|
122
|
-
var
|
|
122
|
+
var import_richtext8 = require("@uniformdev/richtext");
|
|
123
123
|
var import_react13 = __toESM(require("react"));
|
|
124
124
|
|
|
125
125
|
// src/components/UniformRichTextNode.tsx
|
|
126
|
-
var
|
|
126
|
+
var import_richtext7 = require("@uniformdev/richtext");
|
|
127
127
|
var import_react12 = __toESM(require("react"));
|
|
128
128
|
|
|
129
129
|
// src/components/nodes/AssetRichTextNode.tsx
|
|
@@ -169,41 +169,57 @@ var LinkRichTextNode = ({ children, node }) => {
|
|
|
169
169
|
};
|
|
170
170
|
|
|
171
171
|
// src/components/nodes/ListItemRichTextNode.tsx
|
|
172
|
+
var import_richtext2 = require("@uniformdev/richtext");
|
|
172
173
|
var import_react6 = __toESM(require("react"));
|
|
173
174
|
var ListItemRichTextNode = ({ children, node }) => {
|
|
174
175
|
const { value } = node;
|
|
175
|
-
|
|
176
|
+
const normalizedValue = (0, import_richtext2.getRichTextListItemValue)(value);
|
|
177
|
+
return /* @__PURE__ */ import_react6.default.createElement(
|
|
178
|
+
"li",
|
|
179
|
+
{
|
|
180
|
+
value: typeof normalizedValue === "number" && Number.isFinite(normalizedValue) && normalizedValue > 0 ? normalizedValue : void 0
|
|
181
|
+
},
|
|
182
|
+
children
|
|
183
|
+
);
|
|
176
184
|
};
|
|
177
185
|
|
|
178
186
|
// src/components/nodes/ListRichTextNode.tsx
|
|
187
|
+
var import_richtext3 = require("@uniformdev/richtext");
|
|
179
188
|
var import_react7 = __toESM(require("react"));
|
|
180
189
|
var ListRichTextNode = ({ children, node }) => {
|
|
181
190
|
const { tag, start } = node;
|
|
182
191
|
const ListTag = tag != null ? tag : "ul";
|
|
183
|
-
|
|
192
|
+
const normalizedStart = (0, import_richtext3.getRichTextListStart)(start);
|
|
193
|
+
return /* @__PURE__ */ import_react7.default.createElement(
|
|
194
|
+
ListTag,
|
|
195
|
+
{
|
|
196
|
+
start: typeof normalizedStart === "number" && Number.isFinite(normalizedStart) && normalizedStart > 0 ? normalizedStart : void 0
|
|
197
|
+
},
|
|
198
|
+
children
|
|
199
|
+
);
|
|
184
200
|
};
|
|
185
201
|
|
|
186
202
|
// src/components/nodes/ParagraphRichTextNode.tsx
|
|
187
|
-
var
|
|
203
|
+
var import_richtext4 = require("@uniformdev/richtext");
|
|
188
204
|
var import_react8 = __toESM(require("react"));
|
|
189
205
|
var ParagraphRichTextNode = ({ children, node }) => {
|
|
190
206
|
const { format, direction } = node;
|
|
191
207
|
return /* @__PURE__ */ import_react8.default.createElement(
|
|
192
208
|
"p",
|
|
193
209
|
{
|
|
194
|
-
dir: (0,
|
|
195
|
-
style: (0,
|
|
210
|
+
dir: (0, import_richtext4.isPureDirection)(direction) ? direction : void 0,
|
|
211
|
+
style: (0, import_richtext4.isPureTextAlign)(format) ? { textAlign: format } : void 0
|
|
196
212
|
},
|
|
197
213
|
children
|
|
198
214
|
);
|
|
199
215
|
};
|
|
200
216
|
|
|
201
217
|
// src/components/nodes/TableCellRichTextNode.tsx
|
|
202
|
-
var
|
|
218
|
+
var import_richtext5 = require("@uniformdev/richtext");
|
|
203
219
|
var import_react9 = __toESM(require("react"));
|
|
204
220
|
var TableCellRichTextNode = ({ children, node }) => {
|
|
205
221
|
const { headerState } = node;
|
|
206
|
-
const TableCellTag = (0,
|
|
222
|
+
const TableCellTag = (0, import_richtext5.getRichTextTagFromTableCellHeaderState)(headerState);
|
|
207
223
|
return /* @__PURE__ */ import_react9.default.createElement(TableCellTag, null, children);
|
|
208
224
|
};
|
|
209
225
|
|
|
@@ -214,18 +230,18 @@ var TabRichTextNode = () => {
|
|
|
214
230
|
};
|
|
215
231
|
|
|
216
232
|
// src/components/nodes/TextRichTextNode.tsx
|
|
217
|
-
var
|
|
233
|
+
var import_richtext6 = require("@uniformdev/richtext");
|
|
218
234
|
var import_react11 = __toESM(require("react"));
|
|
219
235
|
var TextRichTextNode = ({ node }) => {
|
|
220
236
|
const { text, format } = node;
|
|
221
|
-
const tags = (0,
|
|
237
|
+
const tags = (0, import_richtext6.getRichTextTagsFromTextFormat)(format);
|
|
222
238
|
return /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, tags.length > 0 ? tags.reduceRight((children, Tag) => /* @__PURE__ */ import_react11.default.createElement(Tag, null, children), text) : text);
|
|
223
239
|
};
|
|
224
240
|
|
|
225
241
|
// src/components/UniformRichTextNode.tsx
|
|
226
242
|
function UniformRichTextNode({ node, ...props }) {
|
|
227
243
|
var _a;
|
|
228
|
-
if (!(0,
|
|
244
|
+
if (!(0, import_richtext7.isRichTextNode)(node)) return null;
|
|
229
245
|
let NodeRenderer = (_a = props.resolveRichTextRenderer) == null ? void 0 : _a.call(props, node);
|
|
230
246
|
if (typeof NodeRenderer === "undefined") {
|
|
231
247
|
NodeRenderer = resolveRichTextDefaultRenderer(node);
|
|
@@ -281,8 +297,8 @@ var UniformRichText = import_react13.default.forwardRef(function UniformRichText
|
|
|
281
297
|
}
|
|
282
298
|
const computedPlaceholder = typeof placeholder === "function" ? placeholder({ id: parameterId }) : placeholder;
|
|
283
299
|
const value = parameter.value;
|
|
284
|
-
if (!value || !(0,
|
|
285
|
-
if (!isContextualEditing && (0,
|
|
300
|
+
if (!value || !(0, import_richtext8.isRichTextValue)(value)) return null;
|
|
301
|
+
if (!isContextualEditing && (0, import_richtext8.isRichTextValueConsideredEmpty)(value)) return null;
|
|
286
302
|
return Tag === null ? /* @__PURE__ */ import_react13.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ import_react13.default.createElement(
|
|
287
303
|
Tag,
|
|
288
304
|
{
|
|
@@ -294,7 +310,7 @@ var UniformRichText = import_react13.default.forwardRef(function UniformRichText
|
|
|
294
310
|
[import_canvas.ATTRIBUTE_PARAMETER_TYPE]: "richText"
|
|
295
311
|
} : {}
|
|
296
312
|
},
|
|
297
|
-
(0,
|
|
313
|
+
(0, import_richtext8.isRichTextValueConsideredEmpty)(value) ? /* @__PURE__ */ import_react13.default.createElement("p", null, /* @__PURE__ */ import_react13.default.createElement("i", null, computedPlaceholder)) : /* @__PURE__ */ import_react13.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
|
|
298
314
|
);
|
|
299
315
|
});
|
|
300
316
|
|
package/dist/component.mjs
CHANGED
|
@@ -130,18 +130,34 @@ var LinkRichTextNode = ({ children, node }) => {
|
|
|
130
130
|
};
|
|
131
131
|
|
|
132
132
|
// src/components/nodes/ListItemRichTextNode.tsx
|
|
133
|
+
import { getRichTextListItemValue } from "@uniformdev/richtext";
|
|
133
134
|
import React6 from "react";
|
|
134
135
|
var ListItemRichTextNode = ({ children, node }) => {
|
|
135
136
|
const { value } = node;
|
|
136
|
-
|
|
137
|
+
const normalizedValue = getRichTextListItemValue(value);
|
|
138
|
+
return /* @__PURE__ */ React6.createElement(
|
|
139
|
+
"li",
|
|
140
|
+
{
|
|
141
|
+
value: typeof normalizedValue === "number" && Number.isFinite(normalizedValue) && normalizedValue > 0 ? normalizedValue : void 0
|
|
142
|
+
},
|
|
143
|
+
children
|
|
144
|
+
);
|
|
137
145
|
};
|
|
138
146
|
|
|
139
147
|
// src/components/nodes/ListRichTextNode.tsx
|
|
148
|
+
import { getRichTextListStart } from "@uniformdev/richtext";
|
|
140
149
|
import React7 from "react";
|
|
141
150
|
var ListRichTextNode = ({ children, node }) => {
|
|
142
151
|
const { tag, start } = node;
|
|
143
152
|
const ListTag = tag != null ? tag : "ul";
|
|
144
|
-
|
|
153
|
+
const normalizedStart = getRichTextListStart(start);
|
|
154
|
+
return /* @__PURE__ */ React7.createElement(
|
|
155
|
+
ListTag,
|
|
156
|
+
{
|
|
157
|
+
start: typeof normalizedStart === "number" && Number.isFinite(normalizedStart) && normalizedStart > 0 ? normalizedStart : void 0
|
|
158
|
+
},
|
|
159
|
+
children
|
|
160
|
+
);
|
|
145
161
|
};
|
|
146
162
|
|
|
147
163
|
// src/components/nodes/ParagraphRichTextNode.tsx
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-next-rsc",
|
|
3
|
-
"version": "20.75.1-alpha.
|
|
3
|
+
"version": "20.75.1-alpha.16+4e56d1cd21",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
@@ -62,15 +62,15 @@
|
|
|
62
62
|
"react-dom": "19.2.1"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@uniformdev/canvas": "20.75.1-alpha.
|
|
66
|
-
"@uniformdev/canvas-next-rsc-client": "^20.75.1-alpha.
|
|
67
|
-
"@uniformdev/canvas-next-rsc-shared": "^20.75.1-alpha.
|
|
68
|
-
"@uniformdev/canvas-react": "20.75.1-alpha.
|
|
69
|
-
"@uniformdev/context": "20.75.1-alpha.
|
|
70
|
-
"@uniformdev/project-map": "20.75.1-alpha.
|
|
71
|
-
"@uniformdev/redirect": "20.75.1-alpha.
|
|
72
|
-
"@uniformdev/richtext": "20.75.1-alpha.
|
|
73
|
-
"@uniformdev/webhooks": "20.75.1-alpha.
|
|
65
|
+
"@uniformdev/canvas": "20.75.1-alpha.16+4e56d1cd21",
|
|
66
|
+
"@uniformdev/canvas-next-rsc-client": "^20.75.1-alpha.16+4e56d1cd21",
|
|
67
|
+
"@uniformdev/canvas-next-rsc-shared": "^20.75.1-alpha.16+4e56d1cd21",
|
|
68
|
+
"@uniformdev/canvas-react": "20.75.1-alpha.16+4e56d1cd21",
|
|
69
|
+
"@uniformdev/context": "20.75.1-alpha.16+4e56d1cd21",
|
|
70
|
+
"@uniformdev/project-map": "20.75.1-alpha.16+4e56d1cd21",
|
|
71
|
+
"@uniformdev/redirect": "20.75.1-alpha.16+4e56d1cd21",
|
|
72
|
+
"@uniformdev/richtext": "20.75.1-alpha.16+4e56d1cd21",
|
|
73
|
+
"@uniformdev/webhooks": "20.75.1-alpha.16+4e56d1cd21",
|
|
74
74
|
"@vercel/edge-config": "^1.4.3",
|
|
75
75
|
"encoding": "^0.1.13",
|
|
76
76
|
"server-only": "^0.0.1",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"publishConfig": {
|
|
88
88
|
"access": "public"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "4e56d1cd21f2d4a02b13d733e51fb71441cac298"
|
|
91
91
|
}
|