@uniformdev/canvas-next-rsc 20.75.1-alpha.16 → 20.75.1-alpha.6
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.d.mts +4 -4
- package/dist/component.d.ts +4 -4
- package/dist/component.js +15 -31
- package/dist/component.mjs +2 -18
- package/package.json +11 -11
package/dist/component.d.mts
CHANGED
|
@@ -22,7 +22,7 @@ type RenderRichTextComponentResolver = (node: RichTextNode) => RichTextRendererC
|
|
|
22
22
|
type UniformRichTextProps = {
|
|
23
23
|
/**
|
|
24
24
|
* The name of the HTML tag to render.
|
|
25
|
-
* @
|
|
25
|
+
* @defaultValue "div"
|
|
26
26
|
*/
|
|
27
27
|
as?: React.ElementType;
|
|
28
28
|
/** The ID of the parameter. */
|
|
@@ -38,7 +38,7 @@ type UniformRichTextProps = {
|
|
|
38
38
|
/**
|
|
39
39
|
* Sets the value to show in Canvas editor when the parameter value is empty.
|
|
40
40
|
* Can be a static string, or a function to generate the placeholder out of parameter info.
|
|
41
|
-
* @
|
|
41
|
+
* @defaultValue undefined
|
|
42
42
|
*/
|
|
43
43
|
placeholder?: string | ((parameter: {
|
|
44
44
|
id: string;
|
|
@@ -50,7 +50,7 @@ type UniformRichTextProps = {
|
|
|
50
50
|
declare const UniformRichText: React.ForwardRefExoticComponent<{
|
|
51
51
|
/**
|
|
52
52
|
* The name of the HTML tag to render.
|
|
53
|
-
* @
|
|
53
|
+
* @defaultValue "div"
|
|
54
54
|
*/
|
|
55
55
|
as?: React.ElementType;
|
|
56
56
|
/** The ID of the parameter. */
|
|
@@ -66,7 +66,7 @@ declare const UniformRichText: React.ForwardRefExoticComponent<{
|
|
|
66
66
|
/**
|
|
67
67
|
* Sets the value to show in Canvas editor when the parameter value is empty.
|
|
68
68
|
* Can be a static string, or a function to generate the placeholder out of parameter info.
|
|
69
|
-
* @
|
|
69
|
+
* @defaultValue undefined
|
|
70
70
|
*/
|
|
71
71
|
placeholder?: string | ((parameter: {
|
|
72
72
|
id: string;
|
package/dist/component.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ type RenderRichTextComponentResolver = (node: RichTextNode) => RichTextRendererC
|
|
|
22
22
|
type UniformRichTextProps = {
|
|
23
23
|
/**
|
|
24
24
|
* The name of the HTML tag to render.
|
|
25
|
-
* @
|
|
25
|
+
* @defaultValue "div"
|
|
26
26
|
*/
|
|
27
27
|
as?: React.ElementType;
|
|
28
28
|
/** The ID of the parameter. */
|
|
@@ -38,7 +38,7 @@ type UniformRichTextProps = {
|
|
|
38
38
|
/**
|
|
39
39
|
* Sets the value to show in Canvas editor when the parameter value is empty.
|
|
40
40
|
* Can be a static string, or a function to generate the placeholder out of parameter info.
|
|
41
|
-
* @
|
|
41
|
+
* @defaultValue undefined
|
|
42
42
|
*/
|
|
43
43
|
placeholder?: string | ((parameter: {
|
|
44
44
|
id: string;
|
|
@@ -50,7 +50,7 @@ type UniformRichTextProps = {
|
|
|
50
50
|
declare const UniformRichText: React.ForwardRefExoticComponent<{
|
|
51
51
|
/**
|
|
52
52
|
* The name of the HTML tag to render.
|
|
53
|
-
* @
|
|
53
|
+
* @defaultValue "div"
|
|
54
54
|
*/
|
|
55
55
|
as?: React.ElementType;
|
|
56
56
|
/** The ID of the parameter. */
|
|
@@ -66,7 +66,7 @@ declare const UniformRichText: React.ForwardRefExoticComponent<{
|
|
|
66
66
|
/**
|
|
67
67
|
* Sets the value to show in Canvas editor when the parameter value is empty.
|
|
68
68
|
* Can be a static string, or a function to generate the placeholder out of parameter info.
|
|
69
|
-
* @
|
|
69
|
+
* @defaultValue undefined
|
|
70
70
|
*/
|
|
71
71
|
placeholder?: string | ((parameter: {
|
|
72
72
|
id: string;
|
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_richtext6 = require("@uniformdev/richtext");
|
|
123
123
|
var import_react13 = __toESM(require("react"));
|
|
124
124
|
|
|
125
125
|
// src/components/UniformRichTextNode.tsx
|
|
126
|
-
var
|
|
126
|
+
var import_richtext5 = require("@uniformdev/richtext");
|
|
127
127
|
var import_react12 = __toESM(require("react"));
|
|
128
128
|
|
|
129
129
|
// src/components/nodes/AssetRichTextNode.tsx
|
|
@@ -169,57 +169,41 @@ var LinkRichTextNode = ({ children, node }) => {
|
|
|
169
169
|
};
|
|
170
170
|
|
|
171
171
|
// src/components/nodes/ListItemRichTextNode.tsx
|
|
172
|
-
var import_richtext2 = require("@uniformdev/richtext");
|
|
173
172
|
var import_react6 = __toESM(require("react"));
|
|
174
173
|
var ListItemRichTextNode = ({ children, node }) => {
|
|
175
174
|
const { value } = node;
|
|
176
|
-
|
|
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
|
-
);
|
|
175
|
+
return /* @__PURE__ */ import_react6.default.createElement("li", { value: Number.isFinite(value) && value > 0 ? value : void 0 }, children);
|
|
184
176
|
};
|
|
185
177
|
|
|
186
178
|
// src/components/nodes/ListRichTextNode.tsx
|
|
187
|
-
var import_richtext3 = require("@uniformdev/richtext");
|
|
188
179
|
var import_react7 = __toESM(require("react"));
|
|
189
180
|
var ListRichTextNode = ({ children, node }) => {
|
|
190
181
|
const { tag, start } = node;
|
|
191
182
|
const ListTag = tag != null ? tag : "ul";
|
|
192
|
-
|
|
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
|
-
);
|
|
183
|
+
return /* @__PURE__ */ import_react7.default.createElement(ListTag, { start: Number.isFinite(start) && start > 0 ? start : void 0 }, children);
|
|
200
184
|
};
|
|
201
185
|
|
|
202
186
|
// src/components/nodes/ParagraphRichTextNode.tsx
|
|
203
|
-
var
|
|
187
|
+
var import_richtext2 = require("@uniformdev/richtext");
|
|
204
188
|
var import_react8 = __toESM(require("react"));
|
|
205
189
|
var ParagraphRichTextNode = ({ children, node }) => {
|
|
206
190
|
const { format, direction } = node;
|
|
207
191
|
return /* @__PURE__ */ import_react8.default.createElement(
|
|
208
192
|
"p",
|
|
209
193
|
{
|
|
210
|
-
dir: (0,
|
|
211
|
-
style: (0,
|
|
194
|
+
dir: (0, import_richtext2.isPureDirection)(direction) ? direction : void 0,
|
|
195
|
+
style: (0, import_richtext2.isPureTextAlign)(format) ? { textAlign: format } : void 0
|
|
212
196
|
},
|
|
213
197
|
children
|
|
214
198
|
);
|
|
215
199
|
};
|
|
216
200
|
|
|
217
201
|
// src/components/nodes/TableCellRichTextNode.tsx
|
|
218
|
-
var
|
|
202
|
+
var import_richtext3 = require("@uniformdev/richtext");
|
|
219
203
|
var import_react9 = __toESM(require("react"));
|
|
220
204
|
var TableCellRichTextNode = ({ children, node }) => {
|
|
221
205
|
const { headerState } = node;
|
|
222
|
-
const TableCellTag = (0,
|
|
206
|
+
const TableCellTag = (0, import_richtext3.getRichTextTagFromTableCellHeaderState)(headerState);
|
|
223
207
|
return /* @__PURE__ */ import_react9.default.createElement(TableCellTag, null, children);
|
|
224
208
|
};
|
|
225
209
|
|
|
@@ -230,18 +214,18 @@ var TabRichTextNode = () => {
|
|
|
230
214
|
};
|
|
231
215
|
|
|
232
216
|
// src/components/nodes/TextRichTextNode.tsx
|
|
233
|
-
var
|
|
217
|
+
var import_richtext4 = require("@uniformdev/richtext");
|
|
234
218
|
var import_react11 = __toESM(require("react"));
|
|
235
219
|
var TextRichTextNode = ({ node }) => {
|
|
236
220
|
const { text, format } = node;
|
|
237
|
-
const tags = (0,
|
|
221
|
+
const tags = (0, import_richtext4.getRichTextTagsFromTextFormat)(format);
|
|
238
222
|
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);
|
|
239
223
|
};
|
|
240
224
|
|
|
241
225
|
// src/components/UniformRichTextNode.tsx
|
|
242
226
|
function UniformRichTextNode({ node, ...props }) {
|
|
243
227
|
var _a;
|
|
244
|
-
if (!(0,
|
|
228
|
+
if (!(0, import_richtext5.isRichTextNode)(node)) return null;
|
|
245
229
|
let NodeRenderer = (_a = props.resolveRichTextRenderer) == null ? void 0 : _a.call(props, node);
|
|
246
230
|
if (typeof NodeRenderer === "undefined") {
|
|
247
231
|
NodeRenderer = resolveRichTextDefaultRenderer(node);
|
|
@@ -297,8 +281,8 @@ var UniformRichText = import_react13.default.forwardRef(function UniformRichText
|
|
|
297
281
|
}
|
|
298
282
|
const computedPlaceholder = typeof placeholder === "function" ? placeholder({ id: parameterId }) : placeholder;
|
|
299
283
|
const value = parameter.value;
|
|
300
|
-
if (!value || !(0,
|
|
301
|
-
if (!isContextualEditing && (0,
|
|
284
|
+
if (!value || !(0, import_richtext6.isRichTextValue)(value)) return null;
|
|
285
|
+
if (!isContextualEditing && (0, import_richtext6.isRichTextValueConsideredEmpty)(value)) return null;
|
|
302
286
|
return Tag === null ? /* @__PURE__ */ import_react13.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ import_react13.default.createElement(
|
|
303
287
|
Tag,
|
|
304
288
|
{
|
|
@@ -310,7 +294,7 @@ var UniformRichText = import_react13.default.forwardRef(function UniformRichText
|
|
|
310
294
|
[import_canvas.ATTRIBUTE_PARAMETER_TYPE]: "richText"
|
|
311
295
|
} : {}
|
|
312
296
|
},
|
|
313
|
-
(0,
|
|
297
|
+
(0, import_richtext6.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 })
|
|
314
298
|
);
|
|
315
299
|
});
|
|
316
300
|
|
package/dist/component.mjs
CHANGED
|
@@ -130,34 +130,18 @@ var LinkRichTextNode = ({ children, node }) => {
|
|
|
130
130
|
};
|
|
131
131
|
|
|
132
132
|
// src/components/nodes/ListItemRichTextNode.tsx
|
|
133
|
-
import { getRichTextListItemValue } from "@uniformdev/richtext";
|
|
134
133
|
import React6 from "react";
|
|
135
134
|
var ListItemRichTextNode = ({ children, node }) => {
|
|
136
135
|
const { value } = node;
|
|
137
|
-
|
|
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
|
-
);
|
|
136
|
+
return /* @__PURE__ */ React6.createElement("li", { value: Number.isFinite(value) && value > 0 ? value : void 0 }, children);
|
|
145
137
|
};
|
|
146
138
|
|
|
147
139
|
// src/components/nodes/ListRichTextNode.tsx
|
|
148
|
-
import { getRichTextListStart } from "@uniformdev/richtext";
|
|
149
140
|
import React7 from "react";
|
|
150
141
|
var ListRichTextNode = ({ children, node }) => {
|
|
151
142
|
const { tag, start } = node;
|
|
152
143
|
const ListTag = tag != null ? tag : "ul";
|
|
153
|
-
|
|
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
|
-
);
|
|
144
|
+
return /* @__PURE__ */ React7.createElement(ListTag, { start: Number.isFinite(start) && start > 0 ? start : void 0 }, children);
|
|
161
145
|
};
|
|
162
146
|
|
|
163
147
|
// 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.6+28f494b01a",
|
|
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.6+28f494b01a",
|
|
66
|
+
"@uniformdev/canvas-next-rsc-client": "^20.75.1-alpha.6+28f494b01a",
|
|
67
|
+
"@uniformdev/canvas-next-rsc-shared": "^20.75.1-alpha.6+28f494b01a",
|
|
68
|
+
"@uniformdev/canvas-react": "20.75.1-alpha.6+28f494b01a",
|
|
69
|
+
"@uniformdev/context": "20.75.1-alpha.6+28f494b01a",
|
|
70
|
+
"@uniformdev/project-map": "20.75.1-alpha.6+28f494b01a",
|
|
71
|
+
"@uniformdev/redirect": "20.75.1-alpha.6+28f494b01a",
|
|
72
|
+
"@uniformdev/richtext": "20.75.1-alpha.6+28f494b01a",
|
|
73
|
+
"@uniformdev/webhooks": "20.75.1-alpha.6+28f494b01a",
|
|
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": "28f494b01a1b988afdf9f7e3ecf6fad402bb3777"
|
|
91
91
|
}
|