@uniformdev/canvas-next-rsc 19.186.2-alpha.14 → 19.186.4-alpha.4
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 +33 -48
- package/dist/component.mjs +33 -48
- package/dist/config.js +11 -17
- package/dist/config.mjs +11 -14
- package/dist/handler.js +12 -9
- package/dist/handler.mjs +1 -15
- package/dist/index.esm.js +6 -18
- package/dist/index.js +7 -12
- package/dist/index.mjs +6 -18
- package/package.json +11 -11
package/dist/component.js
CHANGED
|
@@ -50,69 +50,55 @@ var DefaultNotImplementedComponent = ({ component }) => {
|
|
|
50
50
|
// src/components/UniformRichText.tsx
|
|
51
51
|
var import_canvas = require("@uniformdev/canvas");
|
|
52
52
|
var import_richtext6 = require("@uniformdev/richtext");
|
|
53
|
-
var
|
|
53
|
+
var import_react12 = __toESM(require("react"));
|
|
54
54
|
|
|
55
55
|
// src/components/UniformRichTextNode.tsx
|
|
56
56
|
var import_richtext5 = require("@uniformdev/richtext");
|
|
57
|
-
var
|
|
58
|
-
|
|
59
|
-
// src/components/nodes/AssetRichTextNode.tsx
|
|
60
|
-
var import_react2 = __toESM(require("react"));
|
|
61
|
-
var AssetRichTextNode = ({ node }) => {
|
|
62
|
-
var _a, _b;
|
|
63
|
-
const { __asset } = node;
|
|
64
|
-
if (__asset === void 0) {
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
if (__asset.type !== "image") {
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
return /* @__PURE__ */ import_react2.default.createElement("figure", null, /* @__PURE__ */ import_react2.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_react2.default.createElement("figcaption", null, __asset.fields.description.value) : null);
|
|
71
|
-
};
|
|
57
|
+
var import_react11 = __toESM(require("react"));
|
|
72
58
|
|
|
73
59
|
// src/components/nodes/HeadingRichTextNode.tsx
|
|
74
|
-
var
|
|
60
|
+
var import_react2 = __toESM(require("react"));
|
|
75
61
|
var HeadingRichTextNode = ({ children, node }) => {
|
|
76
62
|
const { tag } = node;
|
|
77
63
|
const HTag = tag != null ? tag : "h1";
|
|
78
|
-
return /* @__PURE__ */
|
|
64
|
+
return /* @__PURE__ */ import_react2.default.createElement(HTag, null, children);
|
|
79
65
|
};
|
|
80
66
|
|
|
81
67
|
// src/components/nodes/LinebreakRichTextNode.tsx
|
|
82
|
-
var
|
|
68
|
+
var import_react3 = __toESM(require("react"));
|
|
83
69
|
var LinebreakRichTextNode = () => {
|
|
84
|
-
return /* @__PURE__ */
|
|
70
|
+
return /* @__PURE__ */ import_react3.default.createElement("br", null);
|
|
85
71
|
};
|
|
86
72
|
|
|
87
73
|
// src/components/nodes/LinkRichTextNode.tsx
|
|
88
74
|
var import_richtext = require("@uniformdev/richtext");
|
|
89
|
-
var
|
|
75
|
+
var import_react4 = __toESM(require("react"));
|
|
90
76
|
var LinkRichTextNode = ({ children, node }) => {
|
|
91
77
|
const { link } = node;
|
|
92
|
-
return /* @__PURE__ */
|
|
78
|
+
return /* @__PURE__ */ import_react4.default.createElement("a", { href: (0, import_richtext.linkParamValueToHref)(link) }, children);
|
|
93
79
|
};
|
|
94
80
|
|
|
95
81
|
// src/components/nodes/ListItemRichTextNode.tsx
|
|
96
|
-
var
|
|
82
|
+
var import_react5 = __toESM(require("react"));
|
|
97
83
|
var ListItemRichTextNode = ({ children, node }) => {
|
|
98
84
|
const { value } = node;
|
|
99
|
-
return /* @__PURE__ */
|
|
85
|
+
return /* @__PURE__ */ import_react5.default.createElement("li", { value: Number.isFinite(value) && value > 0 ? value : void 0 }, children);
|
|
100
86
|
};
|
|
101
87
|
|
|
102
88
|
// src/components/nodes/ListRichTextNode.tsx
|
|
103
|
-
var
|
|
89
|
+
var import_react6 = __toESM(require("react"));
|
|
104
90
|
var ListRichTextNode = ({ children, node }) => {
|
|
105
91
|
const { tag, start } = node;
|
|
106
92
|
const ListTag = tag != null ? tag : "ul";
|
|
107
|
-
return /* @__PURE__ */
|
|
93
|
+
return /* @__PURE__ */ import_react6.default.createElement(ListTag, { start: Number.isFinite(start) && start > 0 ? start : void 0 }, children);
|
|
108
94
|
};
|
|
109
95
|
|
|
110
96
|
// src/components/nodes/ParagraphRichTextNode.tsx
|
|
111
97
|
var import_richtext2 = require("@uniformdev/richtext");
|
|
112
|
-
var
|
|
98
|
+
var import_react7 = __toESM(require("react"));
|
|
113
99
|
var ParagraphRichTextNode = ({ children, node }) => {
|
|
114
100
|
const { format, direction } = node;
|
|
115
|
-
return /* @__PURE__ */
|
|
101
|
+
return /* @__PURE__ */ import_react7.default.createElement(
|
|
116
102
|
"p",
|
|
117
103
|
{
|
|
118
104
|
dir: (0, import_richtext2.isPureDirection)(direction) ? direction : void 0,
|
|
@@ -124,26 +110,26 @@ var ParagraphRichTextNode = ({ children, node }) => {
|
|
|
124
110
|
|
|
125
111
|
// src/components/nodes/TableCellRichTextNode.tsx
|
|
126
112
|
var import_richtext3 = require("@uniformdev/richtext");
|
|
127
|
-
var
|
|
113
|
+
var import_react8 = __toESM(require("react"));
|
|
128
114
|
var TableCellRichTextNode = ({ children, node }) => {
|
|
129
115
|
const { headerState } = node;
|
|
130
116
|
const TableCellTag = (0, import_richtext3.getRichTextTagFromTableCellHeaderState)(headerState);
|
|
131
|
-
return /* @__PURE__ */
|
|
117
|
+
return /* @__PURE__ */ import_react8.default.createElement(TableCellTag, null, children);
|
|
132
118
|
};
|
|
133
119
|
|
|
134
120
|
// src/components/nodes/TabRichTextNode.tsx
|
|
135
|
-
var
|
|
121
|
+
var import_react9 = __toESM(require("react"));
|
|
136
122
|
var TabRichTextNode = () => {
|
|
137
|
-
return /* @__PURE__ */
|
|
123
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, " ");
|
|
138
124
|
};
|
|
139
125
|
|
|
140
126
|
// src/components/nodes/TextRichTextNode.tsx
|
|
141
127
|
var import_richtext4 = require("@uniformdev/richtext");
|
|
142
|
-
var
|
|
128
|
+
var import_react10 = __toESM(require("react"));
|
|
143
129
|
var TextRichTextNode = ({ node }) => {
|
|
144
130
|
const { text, format } = node;
|
|
145
131
|
const tags = (0, import_richtext4.getRichTextTagsFromTextFormat)(format);
|
|
146
|
-
return /* @__PURE__ */
|
|
132
|
+
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);
|
|
147
133
|
};
|
|
148
134
|
|
|
149
135
|
// src/components/UniformRichTextNode.tsx
|
|
@@ -157,8 +143,8 @@ function UniformRichTextNode({ node, ...props }) {
|
|
|
157
143
|
if (!NodeRenderer) {
|
|
158
144
|
return null;
|
|
159
145
|
}
|
|
160
|
-
const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */
|
|
161
|
-
return /* @__PURE__ */
|
|
146
|
+
const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */ import_react11.default.createElement(UniformRichTextNode, { ...props, key: i, node: childNode })) : null;
|
|
147
|
+
return /* @__PURE__ */ import_react11.default.createElement(NodeRenderer, { node }, children);
|
|
162
148
|
}
|
|
163
149
|
var rendererMap = /* @__PURE__ */ new Map([
|
|
164
150
|
["heading", HeadingRichTextNode],
|
|
@@ -167,28 +153,27 @@ var rendererMap = /* @__PURE__ */ new Map([
|
|
|
167
153
|
["list", ListRichTextNode],
|
|
168
154
|
["listitem", ListItemRichTextNode],
|
|
169
155
|
["paragraph", ParagraphRichTextNode],
|
|
170
|
-
["quote", ({ children }) => /* @__PURE__ */
|
|
156
|
+
["quote", ({ children }) => /* @__PURE__ */ import_react11.default.createElement("blockquote", null, children)],
|
|
171
157
|
[
|
|
172
158
|
"code",
|
|
173
|
-
({ children }) => /* @__PURE__ */
|
|
159
|
+
({ children }) => /* @__PURE__ */ import_react11.default.createElement("pre", null, /* @__PURE__ */ import_react11.default.createElement("code", null, children))
|
|
174
160
|
],
|
|
175
|
-
["root", ({ children }) => /* @__PURE__ */
|
|
161
|
+
["root", ({ children }) => /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, children)],
|
|
176
162
|
["text", TextRichTextNode],
|
|
177
163
|
["tab", TabRichTextNode],
|
|
178
164
|
[
|
|
179
165
|
"table",
|
|
180
|
-
({ children }) => /* @__PURE__ */
|
|
166
|
+
({ children }) => /* @__PURE__ */ import_react11.default.createElement("table", null, /* @__PURE__ */ import_react11.default.createElement("tbody", null, children))
|
|
181
167
|
],
|
|
182
|
-
["tablerow", ({ children }) => /* @__PURE__ */
|
|
183
|
-
["tablecell", TableCellRichTextNode]
|
|
184
|
-
["asset", AssetRichTextNode]
|
|
168
|
+
["tablerow", ({ children }) => /* @__PURE__ */ import_react11.default.createElement("tr", null, children)],
|
|
169
|
+
["tablecell", TableCellRichTextNode]
|
|
185
170
|
]);
|
|
186
171
|
var resolveRichTextDefaultRenderer = (node) => {
|
|
187
172
|
return rendererMap.get(node.type);
|
|
188
173
|
};
|
|
189
174
|
|
|
190
175
|
// src/components/UniformRichText.tsx
|
|
191
|
-
var UniformRichText =
|
|
176
|
+
var UniformRichText = import_react12.default.forwardRef(function UniformRichText2({
|
|
192
177
|
parameterId,
|
|
193
178
|
component,
|
|
194
179
|
resolveRichTextRenderer,
|
|
@@ -207,7 +192,7 @@ var UniformRichText = import_react13.default.forwardRef(function UniformRichText
|
|
|
207
192
|
const value = parameter.value;
|
|
208
193
|
if (!value || !(0, import_richtext6.isRichTextValue)(value)) return null;
|
|
209
194
|
if (!isContextualEditing && (0, import_richtext6.isRichTextValueConsideredEmpty)(value)) return null;
|
|
210
|
-
return Tag === null ? /* @__PURE__ */
|
|
195
|
+
return Tag === null ? /* @__PURE__ */ import_react12.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ import_react12.default.createElement(
|
|
211
196
|
Tag,
|
|
212
197
|
{
|
|
213
198
|
ref,
|
|
@@ -218,7 +203,7 @@ var UniformRichText = import_react13.default.forwardRef(function UniformRichText
|
|
|
218
203
|
[import_canvas.ATTRIBUTE_PARAMETER_TYPE]: "richText"
|
|
219
204
|
} : {}
|
|
220
205
|
},
|
|
221
|
-
(0, import_richtext6.isRichTextValueConsideredEmpty)(value) ? /* @__PURE__ */
|
|
206
|
+
(0, import_richtext6.isRichTextValueConsideredEmpty)(value) ? /* @__PURE__ */ import_react12.default.createElement("p", null, /* @__PURE__ */ import_react12.default.createElement("i", null, computedPlaceholder)) : /* @__PURE__ */ import_react12.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
|
|
222
207
|
);
|
|
223
208
|
});
|
|
224
209
|
|
|
@@ -250,9 +235,9 @@ var UniformSlot = ({ data, slot, children }) => {
|
|
|
250
235
|
|
|
251
236
|
// src/components/UniformText.tsx
|
|
252
237
|
var import_core = require("@uniformdev/canvas-react/core");
|
|
253
|
-
var
|
|
238
|
+
var import_react13 = __toESM(require("react"));
|
|
254
239
|
var UniformText = ({ context, ...rest }) => {
|
|
255
|
-
return /* @__PURE__ */
|
|
240
|
+
return /* @__PURE__ */ import_react13.default.createElement(
|
|
256
241
|
import_core.PureUniformText,
|
|
257
242
|
{
|
|
258
243
|
...rest,
|
package/dist/component.mjs
CHANGED
|
@@ -11,69 +11,55 @@ import {
|
|
|
11
11
|
ATTRIBUTE_PARAMETER_TYPE
|
|
12
12
|
} from "@uniformdev/canvas";
|
|
13
13
|
import { isRichTextValue, isRichTextValueConsideredEmpty } from "@uniformdev/richtext";
|
|
14
|
-
import
|
|
14
|
+
import React12 from "react";
|
|
15
15
|
|
|
16
16
|
// src/components/UniformRichTextNode.tsx
|
|
17
17
|
import { isRichTextNode } from "@uniformdev/richtext";
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
// src/components/nodes/AssetRichTextNode.tsx
|
|
21
|
-
import React2 from "react";
|
|
22
|
-
var AssetRichTextNode = ({ node }) => {
|
|
23
|
-
var _a, _b;
|
|
24
|
-
const { __asset } = node;
|
|
25
|
-
if (__asset === void 0) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
if (__asset.type !== "image") {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
return /* @__PURE__ */ React2.createElement("figure", null, /* @__PURE__ */ React2.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__ */ React2.createElement("figcaption", null, __asset.fields.description.value) : null);
|
|
32
|
-
};
|
|
18
|
+
import React11 from "react";
|
|
33
19
|
|
|
34
20
|
// src/components/nodes/HeadingRichTextNode.tsx
|
|
35
|
-
import
|
|
21
|
+
import React2 from "react";
|
|
36
22
|
var HeadingRichTextNode = ({ children, node }) => {
|
|
37
23
|
const { tag } = node;
|
|
38
24
|
const HTag = tag != null ? tag : "h1";
|
|
39
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ React2.createElement(HTag, null, children);
|
|
40
26
|
};
|
|
41
27
|
|
|
42
28
|
// src/components/nodes/LinebreakRichTextNode.tsx
|
|
43
|
-
import
|
|
29
|
+
import React3 from "react";
|
|
44
30
|
var LinebreakRichTextNode = () => {
|
|
45
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ React3.createElement("br", null);
|
|
46
32
|
};
|
|
47
33
|
|
|
48
34
|
// src/components/nodes/LinkRichTextNode.tsx
|
|
49
35
|
import { linkParamValueToHref } from "@uniformdev/richtext";
|
|
50
|
-
import
|
|
36
|
+
import React4 from "react";
|
|
51
37
|
var LinkRichTextNode = ({ children, node }) => {
|
|
52
38
|
const { link } = node;
|
|
53
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ React4.createElement("a", { href: linkParamValueToHref(link) }, children);
|
|
54
40
|
};
|
|
55
41
|
|
|
56
42
|
// src/components/nodes/ListItemRichTextNode.tsx
|
|
57
|
-
import
|
|
43
|
+
import React5 from "react";
|
|
58
44
|
var ListItemRichTextNode = ({ children, node }) => {
|
|
59
45
|
const { value } = node;
|
|
60
|
-
return /* @__PURE__ */
|
|
46
|
+
return /* @__PURE__ */ React5.createElement("li", { value: Number.isFinite(value) && value > 0 ? value : void 0 }, children);
|
|
61
47
|
};
|
|
62
48
|
|
|
63
49
|
// src/components/nodes/ListRichTextNode.tsx
|
|
64
|
-
import
|
|
50
|
+
import React6 from "react";
|
|
65
51
|
var ListRichTextNode = ({ children, node }) => {
|
|
66
52
|
const { tag, start } = node;
|
|
67
53
|
const ListTag = tag != null ? tag : "ul";
|
|
68
|
-
return /* @__PURE__ */
|
|
54
|
+
return /* @__PURE__ */ React6.createElement(ListTag, { start: Number.isFinite(start) && start > 0 ? start : void 0 }, children);
|
|
69
55
|
};
|
|
70
56
|
|
|
71
57
|
// src/components/nodes/ParagraphRichTextNode.tsx
|
|
72
58
|
import { isPureDirection, isPureTextAlign } from "@uniformdev/richtext";
|
|
73
|
-
import
|
|
59
|
+
import React7 from "react";
|
|
74
60
|
var ParagraphRichTextNode = ({ children, node }) => {
|
|
75
61
|
const { format, direction } = node;
|
|
76
|
-
return /* @__PURE__ */
|
|
62
|
+
return /* @__PURE__ */ React7.createElement(
|
|
77
63
|
"p",
|
|
78
64
|
{
|
|
79
65
|
dir: isPureDirection(direction) ? direction : void 0,
|
|
@@ -85,26 +71,26 @@ var ParagraphRichTextNode = ({ children, node }) => {
|
|
|
85
71
|
|
|
86
72
|
// src/components/nodes/TableCellRichTextNode.tsx
|
|
87
73
|
import { getRichTextTagFromTableCellHeaderState } from "@uniformdev/richtext";
|
|
88
|
-
import
|
|
74
|
+
import React8 from "react";
|
|
89
75
|
var TableCellRichTextNode = ({ children, node }) => {
|
|
90
76
|
const { headerState } = node;
|
|
91
77
|
const TableCellTag = getRichTextTagFromTableCellHeaderState(headerState);
|
|
92
|
-
return /* @__PURE__ */
|
|
78
|
+
return /* @__PURE__ */ React8.createElement(TableCellTag, null, children);
|
|
93
79
|
};
|
|
94
80
|
|
|
95
81
|
// src/components/nodes/TabRichTextNode.tsx
|
|
96
|
-
import
|
|
82
|
+
import React9 from "react";
|
|
97
83
|
var TabRichTextNode = () => {
|
|
98
|
-
return /* @__PURE__ */
|
|
84
|
+
return /* @__PURE__ */ React9.createElement(React9.Fragment, null, " ");
|
|
99
85
|
};
|
|
100
86
|
|
|
101
87
|
// src/components/nodes/TextRichTextNode.tsx
|
|
102
88
|
import { getRichTextTagsFromTextFormat } from "@uniformdev/richtext";
|
|
103
|
-
import
|
|
89
|
+
import React10 from "react";
|
|
104
90
|
var TextRichTextNode = ({ node }) => {
|
|
105
91
|
const { text, format } = node;
|
|
106
92
|
const tags = getRichTextTagsFromTextFormat(format);
|
|
107
|
-
return /* @__PURE__ */
|
|
93
|
+
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, tags.length > 0 ? tags.reduceRight((children, Tag) => /* @__PURE__ */ React10.createElement(Tag, null, children), text) : text);
|
|
108
94
|
};
|
|
109
95
|
|
|
110
96
|
// src/components/UniformRichTextNode.tsx
|
|
@@ -118,8 +104,8 @@ function UniformRichTextNode({ node, ...props }) {
|
|
|
118
104
|
if (!NodeRenderer) {
|
|
119
105
|
return null;
|
|
120
106
|
}
|
|
121
|
-
const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */
|
|
122
|
-
return /* @__PURE__ */
|
|
107
|
+
const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */ React11.createElement(UniformRichTextNode, { ...props, key: i, node: childNode })) : null;
|
|
108
|
+
return /* @__PURE__ */ React11.createElement(NodeRenderer, { node }, children);
|
|
123
109
|
}
|
|
124
110
|
var rendererMap = /* @__PURE__ */ new Map([
|
|
125
111
|
["heading", HeadingRichTextNode],
|
|
@@ -128,28 +114,27 @@ var rendererMap = /* @__PURE__ */ new Map([
|
|
|
128
114
|
["list", ListRichTextNode],
|
|
129
115
|
["listitem", ListItemRichTextNode],
|
|
130
116
|
["paragraph", ParagraphRichTextNode],
|
|
131
|
-
["quote", ({ children }) => /* @__PURE__ */
|
|
117
|
+
["quote", ({ children }) => /* @__PURE__ */ React11.createElement("blockquote", null, children)],
|
|
132
118
|
[
|
|
133
119
|
"code",
|
|
134
|
-
({ children }) => /* @__PURE__ */
|
|
120
|
+
({ children }) => /* @__PURE__ */ React11.createElement("pre", null, /* @__PURE__ */ React11.createElement("code", null, children))
|
|
135
121
|
],
|
|
136
|
-
["root", ({ children }) => /* @__PURE__ */
|
|
122
|
+
["root", ({ children }) => /* @__PURE__ */ React11.createElement(React11.Fragment, null, children)],
|
|
137
123
|
["text", TextRichTextNode],
|
|
138
124
|
["tab", TabRichTextNode],
|
|
139
125
|
[
|
|
140
126
|
"table",
|
|
141
|
-
({ children }) => /* @__PURE__ */
|
|
127
|
+
({ children }) => /* @__PURE__ */ React11.createElement("table", null, /* @__PURE__ */ React11.createElement("tbody", null, children))
|
|
142
128
|
],
|
|
143
|
-
["tablerow", ({ children }) => /* @__PURE__ */
|
|
144
|
-
["tablecell", TableCellRichTextNode]
|
|
145
|
-
["asset", AssetRichTextNode]
|
|
129
|
+
["tablerow", ({ children }) => /* @__PURE__ */ React11.createElement("tr", null, children)],
|
|
130
|
+
["tablecell", TableCellRichTextNode]
|
|
146
131
|
]);
|
|
147
132
|
var resolveRichTextDefaultRenderer = (node) => {
|
|
148
133
|
return rendererMap.get(node.type);
|
|
149
134
|
};
|
|
150
135
|
|
|
151
136
|
// src/components/UniformRichText.tsx
|
|
152
|
-
var UniformRichText =
|
|
137
|
+
var UniformRichText = React12.forwardRef(function UniformRichText2({
|
|
153
138
|
parameterId,
|
|
154
139
|
component,
|
|
155
140
|
resolveRichTextRenderer,
|
|
@@ -168,7 +153,7 @@ var UniformRichText = React13.forwardRef(function UniformRichText2({
|
|
|
168
153
|
const value = parameter.value;
|
|
169
154
|
if (!value || !isRichTextValue(value)) return null;
|
|
170
155
|
if (!isContextualEditing && isRichTextValueConsideredEmpty(value)) return null;
|
|
171
|
-
return Tag === null ? /* @__PURE__ */
|
|
156
|
+
return Tag === null ? /* @__PURE__ */ React12.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ React12.createElement(
|
|
172
157
|
Tag,
|
|
173
158
|
{
|
|
174
159
|
ref,
|
|
@@ -179,7 +164,7 @@ var UniformRichText = React13.forwardRef(function UniformRichText2({
|
|
|
179
164
|
[ATTRIBUTE_PARAMETER_TYPE]: "richText"
|
|
180
165
|
} : {}
|
|
181
166
|
},
|
|
182
|
-
isRichTextValueConsideredEmpty(value) ? /* @__PURE__ */
|
|
167
|
+
isRichTextValueConsideredEmpty(value) ? /* @__PURE__ */ React12.createElement("p", null, /* @__PURE__ */ React12.createElement("i", null, computedPlaceholder)) : /* @__PURE__ */ React12.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
|
|
183
168
|
);
|
|
184
169
|
});
|
|
185
170
|
|
|
@@ -211,9 +196,9 @@ var UniformSlot = ({ data, slot, children }) => {
|
|
|
211
196
|
|
|
212
197
|
// src/components/UniformText.tsx
|
|
213
198
|
import { PureUniformText } from "@uniformdev/canvas-react/core";
|
|
214
|
-
import
|
|
199
|
+
import React13 from "react";
|
|
215
200
|
var UniformText = ({ context, ...rest }) => {
|
|
216
|
-
return /* @__PURE__ */
|
|
201
|
+
return /* @__PURE__ */ React13.createElement(
|
|
217
202
|
PureUniformText,
|
|
218
203
|
{
|
|
219
204
|
...rest,
|
package/dist/config.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
|
|
30
20
|
// src/config.ts
|
|
@@ -33,13 +23,17 @@ __export(config_exports, {
|
|
|
33
23
|
withUniformConfig: () => withUniformConfig
|
|
34
24
|
});
|
|
35
25
|
module.exports = __toCommonJS(config_exports);
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var { join } = require("path");
|
|
26
|
+
var import_fs = require("fs");
|
|
27
|
+
var import_path = require("path");
|
|
39
28
|
var getConfigPath = () => {
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
29
|
+
const possibleExtensions = [".js", ".cjs", ".mjs", ".ts"];
|
|
30
|
+
let configFilePath;
|
|
31
|
+
for (const extension of possibleExtensions) {
|
|
32
|
+
const filePath = (0, import_path.join)(process.cwd(), `uniform.server.config${extension}`);
|
|
33
|
+
if ((0, import_fs.existsSync)(filePath)) {
|
|
34
|
+
configFilePath = filePath;
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
43
37
|
}
|
|
44
38
|
return configFilePath;
|
|
45
39
|
};
|
|
@@ -53,7 +47,7 @@ var withUniformConfig = (nextConfig) => ({
|
|
|
53
47
|
const uniformConfigPath = getConfigPath();
|
|
54
48
|
if (uniformConfigPath) {
|
|
55
49
|
console.log("Using Uniform config from", uniformConfigPath);
|
|
56
|
-
config.resolve.alias["uniform.server.config
|
|
50
|
+
config.resolve.alias["uniform.server.config"] = (0, import_path.resolve)(config.context, uniformConfigPath);
|
|
57
51
|
}
|
|
58
52
|
}
|
|
59
53
|
return config;
|
package/dist/config.mjs
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
-
}) : x)(function(x) {
|
|
4
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
-
});
|
|
7
|
-
|
|
8
1
|
// src/config.ts
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
var { join } = __require("path");
|
|
2
|
+
import { existsSync } from "fs";
|
|
3
|
+
import { join, resolve } from "path";
|
|
12
4
|
var getConfigPath = () => {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
const possibleExtensions = [".js", ".cjs", ".mjs", ".ts"];
|
|
6
|
+
let configFilePath;
|
|
7
|
+
for (const extension of possibleExtensions) {
|
|
8
|
+
const filePath = join(process.cwd(), `uniform.server.config${extension}`);
|
|
9
|
+
if (existsSync(filePath)) {
|
|
10
|
+
configFilePath = filePath;
|
|
11
|
+
break;
|
|
12
|
+
}
|
|
16
13
|
}
|
|
17
14
|
return configFilePath;
|
|
18
15
|
};
|
|
@@ -26,7 +23,7 @@ var withUniformConfig = (nextConfig) => ({
|
|
|
26
23
|
const uniformConfigPath = getConfigPath();
|
|
27
24
|
if (uniformConfigPath) {
|
|
28
25
|
console.log("Using Uniform config from", uniformConfigPath);
|
|
29
|
-
config.resolve.alias["uniform.server.config
|
|
26
|
+
config.resolve.alias["uniform.server.config"] = resolve(config.context, uniformConfigPath);
|
|
30
27
|
}
|
|
31
28
|
}
|
|
32
29
|
return config;
|
package/dist/handler.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// src/handler.ts
|
|
@@ -168,16 +178,9 @@ var import_svix = require("svix");
|
|
|
168
178
|
var import_canvas2 = require("@uniformdev/canvas");
|
|
169
179
|
|
|
170
180
|
// src/config/helpers.ts
|
|
181
|
+
var import_uniform_server = __toESM(require("uniform.server.config"));
|
|
171
182
|
var getServerConfig = () => {
|
|
172
|
-
|
|
173
|
-
try {
|
|
174
|
-
serverConfig = require("uniform.server.config.js");
|
|
175
|
-
} catch (e) {
|
|
176
|
-
serverConfig = {
|
|
177
|
-
defaultConsent: false
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
return serverConfig;
|
|
183
|
+
return import_uniform_server.default;
|
|
181
184
|
};
|
|
182
185
|
|
|
183
186
|
// src/env/index.ts
|
package/dist/handler.mjs
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
-
}) : x)(function(x) {
|
|
4
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
-
});
|
|
7
|
-
|
|
8
1
|
// src/handler/createPreviewGETRouteHandler.ts
|
|
9
2
|
import {
|
|
10
3
|
IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM,
|
|
@@ -152,15 +145,8 @@ import { Webhook } from "svix";
|
|
|
152
145
|
import { CanvasClient } from "@uniformdev/canvas";
|
|
153
146
|
|
|
154
147
|
// src/config/helpers.ts
|
|
148
|
+
import serverConfig from "uniform.server.config";
|
|
155
149
|
var getServerConfig = () => {
|
|
156
|
-
let serverConfig;
|
|
157
|
-
try {
|
|
158
|
-
serverConfig = __require("uniform.server.config.js");
|
|
159
|
-
} catch (e) {
|
|
160
|
-
serverConfig = {
|
|
161
|
-
defaultConsent: false
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
150
|
return serverConfig;
|
|
165
151
|
};
|
|
166
152
|
|
package/dist/index.esm.js
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
-
}) : x)(function(x) {
|
|
4
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
-
});
|
|
7
|
-
|
|
8
1
|
// src/index.ts
|
|
9
2
|
import "server-only";
|
|
10
3
|
|
|
11
4
|
// src/clients/canvasClient.ts
|
|
12
5
|
import { CanvasClient } from "@uniformdev/canvas";
|
|
13
6
|
|
|
7
|
+
// src/config/helpers.ts
|
|
8
|
+
import serverConfig from "uniform.server.config";
|
|
9
|
+
|
|
14
10
|
// src/utils/draft.ts
|
|
15
11
|
import { IN_CONTEXT_EDITOR_QUERY_STRING_PARAM } from "@uniformdev/canvas";
|
|
16
12
|
import { draftMode } from "next/headers";
|
|
@@ -42,14 +38,6 @@ var isDevelopmentEnvironment = () => {
|
|
|
42
38
|
|
|
43
39
|
// src/config/helpers.ts
|
|
44
40
|
var getServerConfig = () => {
|
|
45
|
-
let serverConfig;
|
|
46
|
-
try {
|
|
47
|
-
serverConfig = __require("uniform.server.config.js");
|
|
48
|
-
} catch (e) {
|
|
49
|
-
serverConfig = {
|
|
50
|
-
defaultConsent: false
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
41
|
return serverConfig;
|
|
54
42
|
};
|
|
55
43
|
var shouldCacheBeDisabled = (options) => {
|
|
@@ -1045,9 +1033,9 @@ var UniformContext = async ({
|
|
|
1045
1033
|
searchParams: {}
|
|
1046
1034
|
});
|
|
1047
1035
|
const ContextComponent = clientContextComponent || DefaultUniformClientContext;
|
|
1048
|
-
const
|
|
1049
|
-
const disableDevTools = ((_a =
|
|
1050
|
-
const defaultConsent =
|
|
1036
|
+
const serverConfig2 = getServerConfig();
|
|
1037
|
+
const disableDevTools = ((_a = serverConfig2.context) == null ? void 0 : _a.disableDevTools) || false;
|
|
1038
|
+
const defaultConsent = serverConfig2.defaultConsent || false;
|
|
1051
1039
|
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, children, /* @__PURE__ */ React7.createElement(
|
|
1052
1040
|
ContextComponent,
|
|
1053
1041
|
{
|
package/dist/index.js
CHANGED
|
@@ -60,6 +60,9 @@ var import_server_only = require("server-only");
|
|
|
60
60
|
// src/clients/canvasClient.ts
|
|
61
61
|
var import_canvas2 = require("@uniformdev/canvas");
|
|
62
62
|
|
|
63
|
+
// src/config/helpers.ts
|
|
64
|
+
var import_uniform_server = __toESM(require("uniform.server.config"));
|
|
65
|
+
|
|
63
66
|
// src/utils/draft.ts
|
|
64
67
|
var import_canvas = require("@uniformdev/canvas");
|
|
65
68
|
var import_headers = require("next/headers");
|
|
@@ -91,15 +94,7 @@ var isDevelopmentEnvironment = () => {
|
|
|
91
94
|
|
|
92
95
|
// src/config/helpers.ts
|
|
93
96
|
var getServerConfig = () => {
|
|
94
|
-
|
|
95
|
-
try {
|
|
96
|
-
serverConfig = require("uniform.server.config.js");
|
|
97
|
-
} catch (e) {
|
|
98
|
-
serverConfig = {
|
|
99
|
-
defaultConsent: false
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
return serverConfig;
|
|
97
|
+
return import_uniform_server.default;
|
|
103
98
|
};
|
|
104
99
|
var shouldCacheBeDisabled = (options) => {
|
|
105
100
|
if (isDraftModeEnabled(options)) {
|
|
@@ -1069,9 +1064,9 @@ var UniformContext = async ({
|
|
|
1069
1064
|
searchParams: {}
|
|
1070
1065
|
});
|
|
1071
1066
|
const ContextComponent = clientContextComponent || import_canvas_next_rsc_client8.DefaultUniformClientContext;
|
|
1072
|
-
const
|
|
1073
|
-
const disableDevTools = ((_a =
|
|
1074
|
-
const defaultConsent =
|
|
1067
|
+
const serverConfig2 = getServerConfig();
|
|
1068
|
+
const disableDevTools = ((_a = serverConfig2.context) == null ? void 0 : _a.disableDevTools) || false;
|
|
1069
|
+
const defaultConsent = serverConfig2.defaultConsent || false;
|
|
1075
1070
|
return /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, children, /* @__PURE__ */ import_react11.default.createElement(
|
|
1076
1071
|
ContextComponent,
|
|
1077
1072
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
-
}) : x)(function(x) {
|
|
4
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
-
});
|
|
7
|
-
|
|
8
1
|
// src/index.ts
|
|
9
2
|
import "server-only";
|
|
10
3
|
|
|
11
4
|
// src/clients/canvasClient.ts
|
|
12
5
|
import { CanvasClient } from "@uniformdev/canvas";
|
|
13
6
|
|
|
7
|
+
// src/config/helpers.ts
|
|
8
|
+
import serverConfig from "uniform.server.config";
|
|
9
|
+
|
|
14
10
|
// src/utils/draft.ts
|
|
15
11
|
import { IN_CONTEXT_EDITOR_QUERY_STRING_PARAM } from "@uniformdev/canvas";
|
|
16
12
|
import { draftMode } from "next/headers";
|
|
@@ -42,14 +38,6 @@ var isDevelopmentEnvironment = () => {
|
|
|
42
38
|
|
|
43
39
|
// src/config/helpers.ts
|
|
44
40
|
var getServerConfig = () => {
|
|
45
|
-
let serverConfig;
|
|
46
|
-
try {
|
|
47
|
-
serverConfig = __require("uniform.server.config.js");
|
|
48
|
-
} catch (e) {
|
|
49
|
-
serverConfig = {
|
|
50
|
-
defaultConsent: false
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
41
|
return serverConfig;
|
|
54
42
|
};
|
|
55
43
|
var shouldCacheBeDisabled = (options) => {
|
|
@@ -1045,9 +1033,9 @@ var UniformContext = async ({
|
|
|
1045
1033
|
searchParams: {}
|
|
1046
1034
|
});
|
|
1047
1035
|
const ContextComponent = clientContextComponent || DefaultUniformClientContext;
|
|
1048
|
-
const
|
|
1049
|
-
const disableDevTools = ((_a =
|
|
1050
|
-
const defaultConsent =
|
|
1036
|
+
const serverConfig2 = getServerConfig();
|
|
1037
|
+
const disableDevTools = ((_a = serverConfig2.context) == null ? void 0 : _a.disableDevTools) || false;
|
|
1038
|
+
const defaultConsent = serverConfig2.defaultConsent || false;
|
|
1051
1039
|
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, children, /* @__PURE__ */ React7.createElement(
|
|
1052
1040
|
ContextComponent,
|
|
1053
1041
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-next-rsc",
|
|
3
|
-
"version": "19.186.
|
|
3
|
+
"version": "19.186.4-alpha.4+1424f4a2db",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
@@ -61,15 +61,15 @@
|
|
|
61
61
|
"react-dom": "18.3.1"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@uniformdev/canvas": "19.186.
|
|
65
|
-
"@uniformdev/canvas-next-rsc-client": "^19.186.
|
|
66
|
-
"@uniformdev/canvas-next-rsc-shared": "^19.186.
|
|
67
|
-
"@uniformdev/canvas-react": "19.186.
|
|
68
|
-
"@uniformdev/context": "19.186.
|
|
69
|
-
"@uniformdev/project-map": "19.186.
|
|
70
|
-
"@uniformdev/redirect": "19.186.
|
|
71
|
-
"@uniformdev/richtext": "19.186.
|
|
72
|
-
"@uniformdev/webhooks": "19.186.
|
|
64
|
+
"@uniformdev/canvas": "19.186.4-alpha.4+1424f4a2db",
|
|
65
|
+
"@uniformdev/canvas-next-rsc-client": "^19.186.4-alpha.4+1424f4a2db",
|
|
66
|
+
"@uniformdev/canvas-next-rsc-shared": "^19.186.4-alpha.4+1424f4a2db",
|
|
67
|
+
"@uniformdev/canvas-react": "19.186.4-alpha.4+1424f4a2db",
|
|
68
|
+
"@uniformdev/context": "19.186.4-alpha.4+1424f4a2db",
|
|
69
|
+
"@uniformdev/project-map": "19.186.4-alpha.4+1424f4a2db",
|
|
70
|
+
"@uniformdev/redirect": "19.186.4-alpha.4+1424f4a2db",
|
|
71
|
+
"@uniformdev/richtext": "19.186.4-alpha.4+1424f4a2db",
|
|
72
|
+
"@uniformdev/webhooks": "19.186.4-alpha.4+1424f4a2db",
|
|
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": "
|
|
89
|
+
"gitHead": "1424f4a2db7b2f40aab77fee598eb714ac00b807"
|
|
90
90
|
}
|