@uniformdev/canvas-next-rsc 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/UniformComposition-0pvEHduc.d.mts +64 -0
- package/dist/UniformComposition-0pvEHduc.d.ts +77 -0
- package/dist/UniformComposition-38e22896.d.ts +74 -0
- package/dist/UniformComposition-B-Z17dUt.d.ts +56 -43
- package/dist/UniformComposition-D4tBQ2U4.d.mts +64 -0
- package/dist/UniformComposition-D4tBQ2U4.d.ts +77 -0
- package/dist/UniformComposition-Dw55RFP6.d.mts +67 -0
- package/dist/UniformComposition-Dw55RFP6.d.ts +67 -0
- package/dist/UniformComposition-d178d865.d.ts +77 -0
- package/dist/actions/updateContext.d.ts +2 -0
- package/dist/actions/updateContext.js +17 -0
- package/dist/client/canvasClient.d.ts +5 -0
- package/dist/client/canvasClient.js +53 -0
- package/dist/client/manifestClient.d.ts +209 -0
- package/dist/client/manifestClient.js +33 -0
- package/dist/client/projectMapClient.d.ts +5 -0
- package/dist/client/projectMapClient.js +17 -0
- package/dist/client/routeClient.d.ts +5 -0
- package/dist/client/routeClient.js +68 -0
- package/dist/component.d.mts +23 -5
- package/dist/component.d.ts +23 -5
- package/dist/component.js +94 -37
- package/dist/component.mjs +93 -35
- package/dist/components/DefaultNotImplementedComponent.d.ts +4 -0
- package/dist/components/DefaultNotImplementedComponent.js +45 -0
- package/dist/components/GoogleTagManagerAnalytics.d.ts +3 -0
- package/dist/components/GoogleTagManagerAnalytics.js +44 -0
- package/dist/components/UniformComponent.d.ts +35 -0
- package/dist/components/UniformComponent.js +14 -0
- package/dist/components/UniformComposition.d.ts +47 -0
- package/dist/components/UniformComposition.js +35 -0
- package/dist/components/UniformContext.d.ts +13 -0
- package/dist/components/UniformContext.js +19 -0
- package/dist/components/UniformRichText.d.ts +42 -0
- package/dist/components/UniformRichText.js +15 -0
- package/dist/components/UniformRichTextNode.d.ts +14 -0
- package/dist/components/UniformRichTextNode.js +49 -0
- package/dist/components/UniformScript.d.ts +5 -0
- package/dist/components/UniformScript.js +49 -0
- package/dist/components/UniformSlot.d.ts +48 -0
- package/dist/components/UniformSlot.js +38 -0
- package/dist/components/UniformText.d.ts +10 -0
- package/dist/components/UniformText.js +5 -0
- package/dist/components/__tests__/evaluateComposition.spec.d.ts +1 -0
- package/dist/components/__tests__/evaluateComposition.spec.js +80 -0
- package/dist/components/convertComponentToProps.d.ts +18 -0
- package/dist/components/convertComponentToProps.js +22 -0
- package/dist/components/evaluateComposition.d.ts +32 -0
- package/dist/components/evaluateComposition.js +183 -0
- package/dist/components/getEnrichmentTags.d.ts +5 -0
- package/dist/components/getEnrichmentTags.js +13 -0
- package/dist/components/getUniformContext.d.ts +10 -0
- package/dist/components/getUniformContext.js +17 -0
- package/dist/components/nodes/HeadingRichTextNode.d.ts +2 -0
- package/dist/components/nodes/HeadingRichTextNode.js +6 -0
- package/dist/components/nodes/LinebreakRichTextNode.d.ts +2 -0
- package/dist/components/nodes/LinebreakRichTextNode.js +4 -0
- package/dist/components/nodes/LinkRichTextNode.d.ts +2 -0
- package/dist/components/nodes/LinkRichTextNode.js +6 -0
- package/dist/components/nodes/ListItemRichTextNode.d.ts +2 -0
- package/dist/components/nodes/ListItemRichTextNode.js +5 -0
- package/dist/components/nodes/ListRichTextNode.d.ts +2 -0
- package/dist/components/nodes/ListRichTextNode.js +6 -0
- package/dist/components/nodes/ParagraphRichTextNode.d.ts +2 -0
- package/dist/components/nodes/ParagraphRichTextNode.js +6 -0
- package/dist/components/nodes/TabRichTextNode.d.ts +2 -0
- package/dist/components/nodes/TabRichTextNode.js +4 -0
- package/dist/components/nodes/TextRichTextNode.d.ts +2 -0
- package/dist/components/nodes/TextRichTextNode.js +9 -0
- package/dist/components/renderComponent.d.ts +26 -0
- package/dist/components/renderComponent.js +52 -0
- package/dist/components/resolvePath.d.ts +5 -0
- package/dist/components/resolvePath.js +34 -0
- package/dist/components/retrieveRoute.d.ts +198 -0
- package/dist/components/retrieveRoute.js +146 -0
- package/dist/components/types.d.ts +15 -0
- package/dist/components/types.js +1 -0
- package/dist/config/helpers.d.ts +23 -0
- package/dist/config/helpers.js +34 -0
- package/dist/config/models.d.ts +51 -0
- package/dist/config/models.js +1 -0
- package/dist/config/uniform.server.config.d.ts +3 -0
- package/dist/config/uniform.server.config.js +4 -0
- package/dist/config.js +11 -17
- package/dist/config.mjs +11 -14
- package/dist/cookie/index.d.ts +12 -0
- package/dist/cookie/index.js +21 -0
- package/dist/handler/createPreviewGETRouteHandler.d.ts +1 -0
- package/dist/handler/createPreviewGETRouteHandler.js +43 -0
- package/dist/handler/createPreviewPOSTRouteHandler.d.ts +1 -0
- package/dist/handler/createPreviewPOSTRouteHandler.js +88 -0
- package/dist/handler/createUniformRouteHandler.d.ts +4 -0
- package/dist/handler/createUniformRouteHandler.js +10 -0
- package/dist/handler/helpers.d.ts +17 -0
- package/dist/handler/helpers.js +148 -0
- package/dist/handler/messages/handleCompositionChanged.d.ts +2 -0
- package/dist/handler/messages/handleCompositionChanged.js +9 -0
- package/dist/handler/messages/handleCompositionDeleted.d.ts +2 -0
- package/dist/handler/messages/handleCompositionDeleted.js +9 -0
- package/dist/handler/messages/handleCompositionPublished.d.ts +2 -0
- package/dist/handler/messages/handleCompositionPublished.js +9 -0
- package/dist/handler/messages/handleManifestPublished.d.ts +2 -0
- package/dist/handler/messages/handleManifestPublished.js +10 -0
- package/dist/handler/messages/handleProjectMapNodeDelete.d.ts +2 -0
- package/dist/handler/messages/handleProjectMapNodeDelete.js +21 -0
- package/dist/handler/messages/handleProjectMapNodeInsert.d.ts +2 -0
- package/dist/handler/messages/handleProjectMapNodeInsert.js +21 -0
- package/dist/handler/messages/handleProjectMapNodeUpdate.d.ts +2 -0
- package/dist/handler/messages/handleProjectMapNodeUpdate.js +22 -0
- package/dist/handler/messages/handleRedirectDelete.d.ts +2 -0
- package/dist/handler/messages/handleRedirectDelete.js +15 -0
- package/dist/handler/messages/handleRedirectInsert.d.ts +2 -0
- package/dist/handler/messages/handleRedirectInsert.js +15 -0
- package/dist/handler/messages/handleRedirectUpdate.d.ts +2 -0
- package/dist/handler/messages/handleRedirectUpdate.js +15 -0
- package/dist/handler.js +14 -10
- package/dist/handler.mjs +3 -16
- package/dist/hooks/useForgetMe.d.ts +4 -0
- package/dist/hooks/useForgetMe.js +10 -0
- package/dist/hooks/useToggleConsent.d.ts +7 -0
- package/dist/hooks/useToggleConsent.js +22 -0
- package/dist/hooks/useUniformContext.d.ts +1 -0
- package/dist/hooks/useUniformContext.js +3 -0
- package/dist/index.d.mts +38 -38
- package/dist/index.d.ts +38 -38
- package/dist/index.esm.js +57 -37
- package/dist/index.js +85 -62
- package/dist/index.mjs +57 -37
- package/dist/models/index.d.ts +30 -0
- package/dist/models/index.js +1 -0
- package/dist/register/componentStore.d.ts +1 -0
- package/dist/register/componentStore.js +2 -0
- package/dist/register/componentStoreResolver.d.ts +4 -0
- package/dist/register/componentStoreResolver.js +5 -0
- package/dist/register/createComponentStore.d.ts +12 -0
- package/dist/register/createComponentStore.js +13 -0
- package/dist/register/createComponentStoreResolver.d.ts +12 -0
- package/dist/register/createComponentStoreResolver.js +9 -0
- package/dist/register/getTypeWithVariant.d.ts +1 -0
- package/dist/register/getTypeWithVariant.js +1 -0
- package/dist/register/registerUniformComponent.d.ts +10 -0
- package/dist/register/registerUniformComponent.js +8 -0
- package/dist/resolve/resolveChildren.d.ts +17 -0
- package/dist/resolve/resolveChildren.js +20 -0
- package/dist/score/index.d.ts +3 -0
- package/dist/score/index.js +114 -0
- package/dist/utils/__tests__/apply.spec.d.ts +1 -0
- package/dist/utils/__tests__/apply.spec.js +358 -0
- package/dist/utils/__tests__/diff.spec.d.ts +1 -0
- package/dist/utils/__tests__/diff.spec.js +394 -0
- package/dist/utils/apply.d.ts +10 -0
- package/dist/utils/apply.js +124 -0
- package/dist/utils/comp.d.ts +25 -0
- package/dist/utils/comp.js +65 -0
- package/dist/utils/diff.d.ts +58 -0
- package/dist/utils/diff.js +144 -0
- package/dist/utils/draft.d.ts +20 -0
- package/dist/utils/draft.js +22 -0
- package/dist/utils/tag.d.ts +2 -0
- package/dist/utils/tag.js +7 -0
- package/dist/utils/url.d.ts +1 -0
- package/dist/utils/url.js +10 -0
- package/package.json +21 -21
package/dist/component.js
CHANGED
|
@@ -48,56 +48,71 @@ var DefaultNotImplementedComponent = ({ component }) => {
|
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
// src/components/UniformRichText.tsx
|
|
51
|
-
var
|
|
52
|
-
var
|
|
51
|
+
var import_canvas = require("@uniformdev/canvas");
|
|
52
|
+
var import_richtext6 = require("@uniformdev/richtext");
|
|
53
|
+
var import_react13 = __toESM(require("react"));
|
|
53
54
|
|
|
54
55
|
// src/components/UniformRichTextNode.tsx
|
|
55
|
-
var
|
|
56
|
-
var
|
|
56
|
+
var import_richtext5 = require("@uniformdev/richtext");
|
|
57
|
+
var import_react12 = __toESM(require("react"));
|
|
57
58
|
|
|
58
|
-
// src/components/nodes/
|
|
59
|
+
// src/components/nodes/AssetRichTextNode.tsx
|
|
59
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
|
+
};
|
|
72
|
+
|
|
73
|
+
// src/components/nodes/HeadingRichTextNode.tsx
|
|
74
|
+
var import_react3 = __toESM(require("react"));
|
|
60
75
|
var HeadingRichTextNode = ({ children, node }) => {
|
|
61
76
|
const { tag } = node;
|
|
62
77
|
const HTag = tag != null ? tag : "h1";
|
|
63
|
-
return /* @__PURE__ */
|
|
78
|
+
return /* @__PURE__ */ import_react3.default.createElement(HTag, null, children);
|
|
64
79
|
};
|
|
65
80
|
|
|
66
81
|
// src/components/nodes/LinebreakRichTextNode.tsx
|
|
67
|
-
var
|
|
82
|
+
var import_react4 = __toESM(require("react"));
|
|
68
83
|
var LinebreakRichTextNode = () => {
|
|
69
|
-
return /* @__PURE__ */
|
|
84
|
+
return /* @__PURE__ */ import_react4.default.createElement("br", null);
|
|
70
85
|
};
|
|
71
86
|
|
|
72
87
|
// src/components/nodes/LinkRichTextNode.tsx
|
|
73
88
|
var import_richtext = require("@uniformdev/richtext");
|
|
74
|
-
var
|
|
89
|
+
var import_react5 = __toESM(require("react"));
|
|
75
90
|
var LinkRichTextNode = ({ children, node }) => {
|
|
76
91
|
const { link } = node;
|
|
77
|
-
return /* @__PURE__ */
|
|
92
|
+
return /* @__PURE__ */ import_react5.default.createElement("a", { href: (0, import_richtext.linkParamValueToHref)(link) }, children);
|
|
78
93
|
};
|
|
79
94
|
|
|
80
95
|
// src/components/nodes/ListItemRichTextNode.tsx
|
|
81
|
-
var
|
|
96
|
+
var import_react6 = __toESM(require("react"));
|
|
82
97
|
var ListItemRichTextNode = ({ children, node }) => {
|
|
83
98
|
const { value } = node;
|
|
84
|
-
return /* @__PURE__ */
|
|
99
|
+
return /* @__PURE__ */ import_react6.default.createElement("li", { value: Number.isFinite(value) && value > 0 ? value : void 0 }, children);
|
|
85
100
|
};
|
|
86
101
|
|
|
87
102
|
// src/components/nodes/ListRichTextNode.tsx
|
|
88
|
-
var
|
|
103
|
+
var import_react7 = __toESM(require("react"));
|
|
89
104
|
var ListRichTextNode = ({ children, node }) => {
|
|
90
105
|
const { tag, start } = node;
|
|
91
106
|
const ListTag = tag != null ? tag : "ul";
|
|
92
|
-
return /* @__PURE__ */
|
|
107
|
+
return /* @__PURE__ */ import_react7.default.createElement(ListTag, { start: Number.isFinite(start) && start > 0 ? start : void 0 }, children);
|
|
93
108
|
};
|
|
94
109
|
|
|
95
110
|
// src/components/nodes/ParagraphRichTextNode.tsx
|
|
96
111
|
var import_richtext2 = require("@uniformdev/richtext");
|
|
97
|
-
var
|
|
112
|
+
var import_react8 = __toESM(require("react"));
|
|
98
113
|
var ParagraphRichTextNode = ({ children, node }) => {
|
|
99
114
|
const { format, direction } = node;
|
|
100
|
-
return /* @__PURE__ */
|
|
115
|
+
return /* @__PURE__ */ import_react8.default.createElement(
|
|
101
116
|
"p",
|
|
102
117
|
{
|
|
103
118
|
dir: (0, import_richtext2.isPureDirection)(direction) ? direction : void 0,
|
|
@@ -107,25 +122,34 @@ var ParagraphRichTextNode = ({ children, node }) => {
|
|
|
107
122
|
);
|
|
108
123
|
};
|
|
109
124
|
|
|
125
|
+
// src/components/nodes/TableCellRichTextNode.tsx
|
|
126
|
+
var import_richtext3 = require("@uniformdev/richtext");
|
|
127
|
+
var import_react9 = __toESM(require("react"));
|
|
128
|
+
var TableCellRichTextNode = ({ children, node }) => {
|
|
129
|
+
const { headerState } = node;
|
|
130
|
+
const TableCellTag = (0, import_richtext3.getRichTextTagFromTableCellHeaderState)(headerState);
|
|
131
|
+
return /* @__PURE__ */ import_react9.default.createElement(TableCellTag, null, children);
|
|
132
|
+
};
|
|
133
|
+
|
|
110
134
|
// src/components/nodes/TabRichTextNode.tsx
|
|
111
|
-
var
|
|
135
|
+
var import_react10 = __toESM(require("react"));
|
|
112
136
|
var TabRichTextNode = () => {
|
|
113
|
-
return /* @__PURE__ */
|
|
137
|
+
return /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null, " ");
|
|
114
138
|
};
|
|
115
139
|
|
|
116
140
|
// src/components/nodes/TextRichTextNode.tsx
|
|
117
|
-
var
|
|
118
|
-
var
|
|
141
|
+
var import_richtext4 = require("@uniformdev/richtext");
|
|
142
|
+
var import_react11 = __toESM(require("react"));
|
|
119
143
|
var TextRichTextNode = ({ node }) => {
|
|
120
144
|
const { text, format } = node;
|
|
121
|
-
const tags = (0,
|
|
122
|
-
return /* @__PURE__ */
|
|
145
|
+
const tags = (0, import_richtext4.getRichTextTagsFromTextFormat)(format);
|
|
146
|
+
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);
|
|
123
147
|
};
|
|
124
148
|
|
|
125
149
|
// src/components/UniformRichTextNode.tsx
|
|
126
150
|
function UniformRichTextNode({ node, ...props }) {
|
|
127
151
|
var _a;
|
|
128
|
-
if (!(0,
|
|
152
|
+
if (!(0, import_richtext5.isRichTextNode)(node)) return null;
|
|
129
153
|
let NodeRenderer = (_a = props.resolveRichTextRenderer) == null ? void 0 : _a.call(props, node);
|
|
130
154
|
if (typeof NodeRenderer === "undefined") {
|
|
131
155
|
NodeRenderer = resolveRichTextDefaultRenderer(node);
|
|
@@ -133,8 +157,8 @@ function UniformRichTextNode({ node, ...props }) {
|
|
|
133
157
|
if (!NodeRenderer) {
|
|
134
158
|
return null;
|
|
135
159
|
}
|
|
136
|
-
const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */
|
|
137
|
-
return /* @__PURE__ */
|
|
160
|
+
const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */ import_react12.default.createElement(UniformRichTextNode, { ...props, key: i, node: childNode })) : null;
|
|
161
|
+
return /* @__PURE__ */ import_react12.default.createElement(NodeRenderer, { node }, children);
|
|
138
162
|
}
|
|
139
163
|
var rendererMap = /* @__PURE__ */ new Map([
|
|
140
164
|
["heading", HeadingRichTextNode],
|
|
@@ -143,26 +167,59 @@ var rendererMap = /* @__PURE__ */ new Map([
|
|
|
143
167
|
["list", ListRichTextNode],
|
|
144
168
|
["listitem", ListItemRichTextNode],
|
|
145
169
|
["paragraph", ParagraphRichTextNode],
|
|
146
|
-
["quote", ({ children }) => /* @__PURE__ */
|
|
170
|
+
["quote", ({ children }) => /* @__PURE__ */ import_react12.default.createElement("blockquote", null, children)],
|
|
147
171
|
[
|
|
148
172
|
"code",
|
|
149
|
-
({ children }) => /* @__PURE__ */
|
|
173
|
+
({ children }) => /* @__PURE__ */ import_react12.default.createElement("pre", null, /* @__PURE__ */ import_react12.default.createElement("code", null, children))
|
|
150
174
|
],
|
|
151
|
-
["root", ({ children }) => /* @__PURE__ */
|
|
175
|
+
["root", ({ children }) => /* @__PURE__ */ import_react12.default.createElement(import_react12.default.Fragment, null, children)],
|
|
152
176
|
["text", TextRichTextNode],
|
|
153
|
-
["tab", TabRichTextNode]
|
|
177
|
+
["tab", TabRichTextNode],
|
|
178
|
+
[
|
|
179
|
+
"table",
|
|
180
|
+
({ children }) => /* @__PURE__ */ import_react12.default.createElement("table", null, /* @__PURE__ */ import_react12.default.createElement("tbody", null, children))
|
|
181
|
+
],
|
|
182
|
+
["tablerow", ({ children }) => /* @__PURE__ */ import_react12.default.createElement("tr", null, children)],
|
|
183
|
+
["tablecell", TableCellRichTextNode],
|
|
184
|
+
["asset", AssetRichTextNode]
|
|
154
185
|
]);
|
|
155
186
|
var resolveRichTextDefaultRenderer = (node) => {
|
|
156
187
|
return rendererMap.get(node.type);
|
|
157
188
|
};
|
|
158
189
|
|
|
159
190
|
// src/components/UniformRichText.tsx
|
|
160
|
-
var UniformRichText =
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
191
|
+
var UniformRichText = import_react13.default.forwardRef(function UniformRichText2({
|
|
192
|
+
parameterId,
|
|
193
|
+
component,
|
|
194
|
+
resolveRichTextRenderer,
|
|
195
|
+
as: Tag = "div",
|
|
196
|
+
context,
|
|
197
|
+
placeholder,
|
|
198
|
+
...props
|
|
199
|
+
}, ref) {
|
|
200
|
+
var _a, _b;
|
|
201
|
+
const isContextualEditing = (_a = context == null ? void 0 : context.isContextualEditing) != null ? _a : false;
|
|
202
|
+
const parameter = (_b = component == null ? void 0 : component.parameters) == null ? void 0 : _b[parameterId];
|
|
203
|
+
if (!parameter) {
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
const computedPlaceholder = typeof placeholder === "function" ? placeholder({ id: parameterId }) : placeholder;
|
|
207
|
+
const value = parameter.value;
|
|
208
|
+
if (!value || !(0, import_richtext6.isRichTextValue)(value)) return null;
|
|
209
|
+
if (!isContextualEditing && (0, import_richtext6.isRichTextValueConsideredEmpty)(value)) return null;
|
|
210
|
+
return Tag === null ? /* @__PURE__ */ import_react13.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ import_react13.default.createElement(
|
|
211
|
+
Tag,
|
|
212
|
+
{
|
|
213
|
+
ref,
|
|
214
|
+
...props,
|
|
215
|
+
...isContextualEditing ? {
|
|
216
|
+
[import_canvas.ATTRIBUTE_COMPONENT_ID]: component._id,
|
|
217
|
+
[import_canvas.ATTRIBUTE_PARAMETER_ID]: parameterId,
|
|
218
|
+
[import_canvas.ATTRIBUTE_PARAMETER_TYPE]: "richText"
|
|
219
|
+
} : {}
|
|
220
|
+
},
|
|
221
|
+
(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 })
|
|
222
|
+
);
|
|
166
223
|
});
|
|
167
224
|
|
|
168
225
|
// src/components/UniformSlot.tsx
|
|
@@ -193,9 +250,9 @@ var UniformSlot = ({ data, slot, children }) => {
|
|
|
193
250
|
|
|
194
251
|
// src/components/UniformText.tsx
|
|
195
252
|
var import_core = require("@uniformdev/canvas-react/core");
|
|
196
|
-
var
|
|
253
|
+
var import_react14 = __toESM(require("react"));
|
|
197
254
|
var UniformText = ({ context, ...rest }) => {
|
|
198
|
-
return /* @__PURE__ */
|
|
255
|
+
return /* @__PURE__ */ import_react14.default.createElement(
|
|
199
256
|
import_core.PureUniformText,
|
|
200
257
|
{
|
|
201
258
|
...rest,
|
package/dist/component.mjs
CHANGED
|
@@ -6,58 +6,74 @@ var DefaultNotImplementedComponent = ({ component }) => {
|
|
|
6
6
|
|
|
7
7
|
// src/components/UniformRichText.tsx
|
|
8
8
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
ATTRIBUTE_COMPONENT_ID,
|
|
10
|
+
ATTRIBUTE_PARAMETER_ID,
|
|
11
|
+
ATTRIBUTE_PARAMETER_TYPE
|
|
12
|
+
} from "@uniformdev/canvas";
|
|
13
|
+
import { isRichTextValue, isRichTextValueConsideredEmpty } from "@uniformdev/richtext";
|
|
14
|
+
import React13 from "react";
|
|
13
15
|
|
|
14
16
|
// src/components/UniformRichTextNode.tsx
|
|
15
17
|
import { isRichTextNode } from "@uniformdev/richtext";
|
|
16
|
-
import
|
|
18
|
+
import React12 from "react";
|
|
17
19
|
|
|
18
|
-
// src/components/nodes/
|
|
20
|
+
// src/components/nodes/AssetRichTextNode.tsx
|
|
19
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
|
+
};
|
|
33
|
+
|
|
34
|
+
// src/components/nodes/HeadingRichTextNode.tsx
|
|
35
|
+
import React3 from "react";
|
|
20
36
|
var HeadingRichTextNode = ({ children, node }) => {
|
|
21
37
|
const { tag } = node;
|
|
22
38
|
const HTag = tag != null ? tag : "h1";
|
|
23
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ React3.createElement(HTag, null, children);
|
|
24
40
|
};
|
|
25
41
|
|
|
26
42
|
// src/components/nodes/LinebreakRichTextNode.tsx
|
|
27
|
-
import
|
|
43
|
+
import React4 from "react";
|
|
28
44
|
var LinebreakRichTextNode = () => {
|
|
29
|
-
return /* @__PURE__ */
|
|
45
|
+
return /* @__PURE__ */ React4.createElement("br", null);
|
|
30
46
|
};
|
|
31
47
|
|
|
32
48
|
// src/components/nodes/LinkRichTextNode.tsx
|
|
33
49
|
import { linkParamValueToHref } from "@uniformdev/richtext";
|
|
34
|
-
import
|
|
50
|
+
import React5 from "react";
|
|
35
51
|
var LinkRichTextNode = ({ children, node }) => {
|
|
36
52
|
const { link } = node;
|
|
37
|
-
return /* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ React5.createElement("a", { href: linkParamValueToHref(link) }, children);
|
|
38
54
|
};
|
|
39
55
|
|
|
40
56
|
// src/components/nodes/ListItemRichTextNode.tsx
|
|
41
|
-
import
|
|
57
|
+
import React6 from "react";
|
|
42
58
|
var ListItemRichTextNode = ({ children, node }) => {
|
|
43
59
|
const { value } = node;
|
|
44
|
-
return /* @__PURE__ */
|
|
60
|
+
return /* @__PURE__ */ React6.createElement("li", { value: Number.isFinite(value) && value > 0 ? value : void 0 }, children);
|
|
45
61
|
};
|
|
46
62
|
|
|
47
63
|
// src/components/nodes/ListRichTextNode.tsx
|
|
48
|
-
import
|
|
64
|
+
import React7 from "react";
|
|
49
65
|
var ListRichTextNode = ({ children, node }) => {
|
|
50
66
|
const { tag, start } = node;
|
|
51
67
|
const ListTag = tag != null ? tag : "ul";
|
|
52
|
-
return /* @__PURE__ */
|
|
68
|
+
return /* @__PURE__ */ React7.createElement(ListTag, { start: Number.isFinite(start) && start > 0 ? start : void 0 }, children);
|
|
53
69
|
};
|
|
54
70
|
|
|
55
71
|
// src/components/nodes/ParagraphRichTextNode.tsx
|
|
56
72
|
import { isPureDirection, isPureTextAlign } from "@uniformdev/richtext";
|
|
57
|
-
import
|
|
73
|
+
import React8 from "react";
|
|
58
74
|
var ParagraphRichTextNode = ({ children, node }) => {
|
|
59
75
|
const { format, direction } = node;
|
|
60
|
-
return /* @__PURE__ */
|
|
76
|
+
return /* @__PURE__ */ React8.createElement(
|
|
61
77
|
"p",
|
|
62
78
|
{
|
|
63
79
|
dir: isPureDirection(direction) ? direction : void 0,
|
|
@@ -67,19 +83,28 @@ var ParagraphRichTextNode = ({ children, node }) => {
|
|
|
67
83
|
);
|
|
68
84
|
};
|
|
69
85
|
|
|
86
|
+
// src/components/nodes/TableCellRichTextNode.tsx
|
|
87
|
+
import { getRichTextTagFromTableCellHeaderState } from "@uniformdev/richtext";
|
|
88
|
+
import React9 from "react";
|
|
89
|
+
var TableCellRichTextNode = ({ children, node }) => {
|
|
90
|
+
const { headerState } = node;
|
|
91
|
+
const TableCellTag = getRichTextTagFromTableCellHeaderState(headerState);
|
|
92
|
+
return /* @__PURE__ */ React9.createElement(TableCellTag, null, children);
|
|
93
|
+
};
|
|
94
|
+
|
|
70
95
|
// src/components/nodes/TabRichTextNode.tsx
|
|
71
|
-
import
|
|
96
|
+
import React10 from "react";
|
|
72
97
|
var TabRichTextNode = () => {
|
|
73
|
-
return /* @__PURE__ */
|
|
98
|
+
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, " ");
|
|
74
99
|
};
|
|
75
100
|
|
|
76
101
|
// src/components/nodes/TextRichTextNode.tsx
|
|
77
102
|
import { getRichTextTagsFromTextFormat } from "@uniformdev/richtext";
|
|
78
|
-
import
|
|
103
|
+
import React11 from "react";
|
|
79
104
|
var TextRichTextNode = ({ node }) => {
|
|
80
105
|
const { text, format } = node;
|
|
81
106
|
const tags = getRichTextTagsFromTextFormat(format);
|
|
82
|
-
return /* @__PURE__ */
|
|
107
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, tags.length > 0 ? tags.reduceRight((children, Tag) => /* @__PURE__ */ React11.createElement(Tag, null, children), text) : text);
|
|
83
108
|
};
|
|
84
109
|
|
|
85
110
|
// src/components/UniformRichTextNode.tsx
|
|
@@ -93,8 +118,8 @@ function UniformRichTextNode({ node, ...props }) {
|
|
|
93
118
|
if (!NodeRenderer) {
|
|
94
119
|
return null;
|
|
95
120
|
}
|
|
96
|
-
const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */
|
|
97
|
-
return /* @__PURE__ */
|
|
121
|
+
const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */ React12.createElement(UniformRichTextNode, { ...props, key: i, node: childNode })) : null;
|
|
122
|
+
return /* @__PURE__ */ React12.createElement(NodeRenderer, { node }, children);
|
|
98
123
|
}
|
|
99
124
|
var rendererMap = /* @__PURE__ */ new Map([
|
|
100
125
|
["heading", HeadingRichTextNode],
|
|
@@ -103,26 +128,59 @@ var rendererMap = /* @__PURE__ */ new Map([
|
|
|
103
128
|
["list", ListRichTextNode],
|
|
104
129
|
["listitem", ListItemRichTextNode],
|
|
105
130
|
["paragraph", ParagraphRichTextNode],
|
|
106
|
-
["quote", ({ children }) => /* @__PURE__ */
|
|
131
|
+
["quote", ({ children }) => /* @__PURE__ */ React12.createElement("blockquote", null, children)],
|
|
107
132
|
[
|
|
108
133
|
"code",
|
|
109
|
-
({ children }) => /* @__PURE__ */
|
|
134
|
+
({ children }) => /* @__PURE__ */ React12.createElement("pre", null, /* @__PURE__ */ React12.createElement("code", null, children))
|
|
110
135
|
],
|
|
111
|
-
["root", ({ children }) => /* @__PURE__ */
|
|
136
|
+
["root", ({ children }) => /* @__PURE__ */ React12.createElement(React12.Fragment, null, children)],
|
|
112
137
|
["text", TextRichTextNode],
|
|
113
|
-
["tab", TabRichTextNode]
|
|
138
|
+
["tab", TabRichTextNode],
|
|
139
|
+
[
|
|
140
|
+
"table",
|
|
141
|
+
({ children }) => /* @__PURE__ */ React12.createElement("table", null, /* @__PURE__ */ React12.createElement("tbody", null, children))
|
|
142
|
+
],
|
|
143
|
+
["tablerow", ({ children }) => /* @__PURE__ */ React12.createElement("tr", null, children)],
|
|
144
|
+
["tablecell", TableCellRichTextNode],
|
|
145
|
+
["asset", AssetRichTextNode]
|
|
114
146
|
]);
|
|
115
147
|
var resolveRichTextDefaultRenderer = (node) => {
|
|
116
148
|
return rendererMap.get(node.type);
|
|
117
149
|
};
|
|
118
150
|
|
|
119
151
|
// src/components/UniformRichText.tsx
|
|
120
|
-
var UniformRichText =
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
152
|
+
var UniformRichText = React13.forwardRef(function UniformRichText2({
|
|
153
|
+
parameterId,
|
|
154
|
+
component,
|
|
155
|
+
resolveRichTextRenderer,
|
|
156
|
+
as: Tag = "div",
|
|
157
|
+
context,
|
|
158
|
+
placeholder,
|
|
159
|
+
...props
|
|
160
|
+
}, ref) {
|
|
161
|
+
var _a, _b;
|
|
162
|
+
const isContextualEditing = (_a = context == null ? void 0 : context.isContextualEditing) != null ? _a : false;
|
|
163
|
+
const parameter = (_b = component == null ? void 0 : component.parameters) == null ? void 0 : _b[parameterId];
|
|
164
|
+
if (!parameter) {
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
const computedPlaceholder = typeof placeholder === "function" ? placeholder({ id: parameterId }) : placeholder;
|
|
168
|
+
const value = parameter.value;
|
|
169
|
+
if (!value || !isRichTextValue(value)) return null;
|
|
170
|
+
if (!isContextualEditing && isRichTextValueConsideredEmpty(value)) return null;
|
|
171
|
+
return Tag === null ? /* @__PURE__ */ React13.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ React13.createElement(
|
|
172
|
+
Tag,
|
|
173
|
+
{
|
|
174
|
+
ref,
|
|
175
|
+
...props,
|
|
176
|
+
...isContextualEditing ? {
|
|
177
|
+
[ATTRIBUTE_COMPONENT_ID]: component._id,
|
|
178
|
+
[ATTRIBUTE_PARAMETER_ID]: parameterId,
|
|
179
|
+
[ATTRIBUTE_PARAMETER_TYPE]: "richText"
|
|
180
|
+
} : {}
|
|
181
|
+
},
|
|
182
|
+
isRichTextValueConsideredEmpty(value) ? /* @__PURE__ */ React13.createElement("p", null, /* @__PURE__ */ React13.createElement("i", null, computedPlaceholder)) : /* @__PURE__ */ React13.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
|
|
183
|
+
);
|
|
126
184
|
});
|
|
127
185
|
|
|
128
186
|
// src/components/UniformSlot.tsx
|
|
@@ -153,9 +211,9 @@ var UniformSlot = ({ data, slot, children }) => {
|
|
|
153
211
|
|
|
154
212
|
// src/components/UniformText.tsx
|
|
155
213
|
import { PureUniformText } from "@uniformdev/canvas-react/core";
|
|
156
|
-
import
|
|
214
|
+
import React14 from "react";
|
|
157
215
|
var UniformText = ({ context, ...rest }) => {
|
|
158
|
-
return /* @__PURE__ */
|
|
216
|
+
return /* @__PURE__ */ React14.createElement(
|
|
159
217
|
PureUniformText,
|
|
160
218
|
{
|
|
161
219
|
...rest,
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CANVAS_LOCALIZATION_TYPE } from '@uniformdev/canvas';
|
|
3
|
+
const wrapperStyles = {
|
|
4
|
+
display: 'flex',
|
|
5
|
+
flexDirection: 'column',
|
|
6
|
+
gap: '0.5rem',
|
|
7
|
+
borderLeft: '4px solid #e42535',
|
|
8
|
+
padding: '16px',
|
|
9
|
+
fontSize: '16px',
|
|
10
|
+
borderRadius: '0 8px 8px 0',
|
|
11
|
+
margin: '8px',
|
|
12
|
+
backgroundColor: 'rgba(255, 255, 255, 0.45)',
|
|
13
|
+
color: '#1d3557',
|
|
14
|
+
};
|
|
15
|
+
export function DefaultNotImplementedComponent(props) {
|
|
16
|
+
var _a, _b, _c;
|
|
17
|
+
const componentType = (_a = props.component) === null || _a === void 0 ? void 0 : _a.type;
|
|
18
|
+
if (!componentType) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
if (componentType === CANVAS_LOCALIZATION_TYPE) {
|
|
22
|
+
return (_jsx("div", { style: wrapperStyles, children: _jsxs("p", { children: ["Seems like localization is not enabled in your application. Please read our documentation on how to", ' ', _jsx("a", { href: "https://docs.uniform.app/guides/composition/localization#activate-front-end", target: "_blank", style: { fontWeight: 'bolder', textDecoration: 'underline' }, rel: "noreferrer", children: "enable localization in your front-end application." })] }) }));
|
|
23
|
+
}
|
|
24
|
+
const proposedFileName = `${componentType[0].toUpperCase()}${componentType.substring(1)}`;
|
|
25
|
+
const probableProps = Object.keys((_b = props.component.parameters) !== null && _b !== void 0 ? _b : {});
|
|
26
|
+
const probableSlots = Object.keys((_c = props.component.slots) !== null && _c !== void 0 ? _c : {});
|
|
27
|
+
return (_jsxs("div", { style: wrapperStyles, children: [_jsx("h2", { style: { fontSize: '1.2rem' }, children: "Unknown Component" }), _jsxs("p", { children: ["Received request from Uniform to render a component with the public ID: ", _jsx("code", { children: componentType }), "."] }), _jsxs("p", { children: [_jsx("code", { children: "<UniformComposition />" }), " does not have ", _jsx("code", { children: componentType }), " mapped to a React component yet."] }), _jsx("p", { children: "To teach your app how to render this component:" }), ' ', _jsxs("ul", { style: {
|
|
28
|
+
listStyleType: 'disc',
|
|
29
|
+
marginLeft: '1rem',
|
|
30
|
+
display: 'flex',
|
|
31
|
+
flexDirection: 'column',
|
|
32
|
+
gap: '0.5rem',
|
|
33
|
+
}, children: [_jsxs("li", { children: ["Create a React component and register it with Uniform, for example", _jsx("pre", { children: `function ${proposedFileName}(${probableProps.length > 0 ? `{ ${probableProps.join(', ')} }` : ''}) {
|
|
34
|
+
return (
|
|
35
|
+
<div>
|
|
36
|
+
${proposedFileName}!
|
|
37
|
+
${probableSlots.length > 0
|
|
38
|
+
? probableSlots.map((slot) => `<UniformSlot name="${slot}" />`).join('\n ')
|
|
39
|
+
: ''}
|
|
40
|
+
</div>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
registerUniformComponent({ type: "${componentType}", component: ${proposedFileName} })` }), _jsxs("details", { children: [_jsx("summary", { style: { cursor: 'pointer' }, children: "Props that your React component will receive" }), _jsx("pre", { children: JSON.stringify(props, null, 2) })] })] }), _jsxs("li", { children: ["Import the component into the file where ", _jsx("code", { children: "<UniformComposition />" }), " is defined, for example ", _jsx("pre", { children: `import "../components/${proposedFileName}.tsx"` })] })] }), ' ', _jsxs("p", { children: ["Need more help?", ' ', _jsx("a", { href: "https://docs.uniform.app/docs/guides/composition/rendering", target: "_blank", rel: "noreferrer", style: { textDecoration: 'underline' }, children: "Check out the documentation." })] })] }));
|
|
45
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import Script from 'next/script';
|
|
4
|
+
import { useEffect } from 'react';
|
|
5
|
+
import { useUniformContext } from '../hooks/useUniformContext';
|
|
6
|
+
const isGtagConfigured = () => {
|
|
7
|
+
return typeof window !== 'undefined' && typeof window.gtag === 'function';
|
|
8
|
+
};
|
|
9
|
+
export const GoogleTagManagerAnalytics = (props) => {
|
|
10
|
+
const { seenComponents } = useUniformContext();
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (!(seenComponents === null || seenComponents === void 0 ? void 0 : seenComponents.length)) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (!isGtagConfigured()) {
|
|
16
|
+
// eslint-disable-next-line no-console
|
|
17
|
+
console.warn('Google Tag Manager is not configured. Please add the gtag script to your site.');
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
seenComponents.forEach((component) => {
|
|
21
|
+
var _a, _b, _c, _d, _e;
|
|
22
|
+
if (component.type === 'personalization') {
|
|
23
|
+
(_b = (_a = window).gtag) === null || _b === void 0 ? void 0 : _b.call(_a, 'event', component.id, {
|
|
24
|
+
event_category: 'Uniform Personalization',
|
|
25
|
+
event_label: component.variants.join(', '),
|
|
26
|
+
is_control_group: component.control ? 1 : 0,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
else if (component.type === 'test') {
|
|
30
|
+
(_d = (_c = window).gtag) === null || _d === void 0 ? void 0 : _d.call(_c, 'event', component.id, {
|
|
31
|
+
event_category: 'Uniform AB Testing',
|
|
32
|
+
event_label: (_e = component.variant) !== null && _e !== void 0 ? _e : 'No Variant',
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}, [seenComponents]);
|
|
37
|
+
return (_jsx(_Fragment, { children: Boolean(props === null || props === void 0 ? void 0 : props.measurementId) && (_jsxs(_Fragment, { children: [_jsx(Script, { src: `https://www.googletagmanager.com/gtag/js?id=${props.measurementId}`, strategy: "afterInteractive" }), _jsx(Script, { id: "google-analytics", strategy: "afterInteractive", children: `
|
|
38
|
+
window.dataLayer = window.dataLayer || [];
|
|
39
|
+
function gtag(){window.dataLayer.push(arguments);}
|
|
40
|
+
gtag('js', new Date());
|
|
41
|
+
|
|
42
|
+
gtag('config', '${props.measurementId}');
|
|
43
|
+
` })] })) }));
|
|
44
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ComponentInstance,
|
|
3
|
+
type RootComponentInstance,
|
|
4
|
+
RouteGetResponseComposition,
|
|
5
|
+
} from '@uniformdev/canvas';
|
|
6
|
+
import { ReactNode } from 'react';
|
|
7
|
+
export type CompositionContext = Omit<RouteGetResponseComposition, 'compositionApiResponse'> & {
|
|
8
|
+
composition: RootComponentInstance;
|
|
9
|
+
path: string;
|
|
10
|
+
state?: number;
|
|
11
|
+
searchParams:
|
|
12
|
+
| {
|
|
13
|
+
[key: string]: string | undefined;
|
|
14
|
+
}
|
|
15
|
+
| undefined;
|
|
16
|
+
cookieValue: string | undefined;
|
|
17
|
+
isDraftMode: boolean;
|
|
18
|
+
isContextualEditing: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type ComponentProps<TProps = unknown> = TProps & {
|
|
21
|
+
component: ComponentInstance;
|
|
22
|
+
context: CompositionContext;
|
|
23
|
+
};
|
|
24
|
+
export type UniformComponentProps<TRenderProps = unknown> = {
|
|
25
|
+
data: ComponentInstance;
|
|
26
|
+
context: CompositionContext;
|
|
27
|
+
children?: ReactNode | ((props: ComponentProps<TRenderProps>) => JSX.Element);
|
|
28
|
+
};
|
|
29
|
+
export declare function UniformComponent({
|
|
30
|
+
data,
|
|
31
|
+
children,
|
|
32
|
+
context,
|
|
33
|
+
}: UniformComponentProps): import('react').FunctionComponentElement<{
|
|
34
|
+
children?: ReactNode;
|
|
35
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createElement, Fragment } from 'react';
|
|
2
|
+
import { componentStoreResolver } from '../register/componentStoreResolver';
|
|
3
|
+
import { resolveChildren } from '../resolve/resolveChildren';
|
|
4
|
+
export function UniformComponent({ data, children, context }) {
|
|
5
|
+
const resolvedChildren = resolveChildren({
|
|
6
|
+
children,
|
|
7
|
+
data,
|
|
8
|
+
context,
|
|
9
|
+
hasParentLayout: false,
|
|
10
|
+
resolveRenderer: componentStoreResolver,
|
|
11
|
+
});
|
|
12
|
+
const childrenToRender = [resolvedChildren];
|
|
13
|
+
return createElement(Fragment, {}, childrenToRender);
|
|
14
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ContextState } from '@uniformdev/context';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export type SuspenseOptions =
|
|
4
|
+
| {
|
|
5
|
+
mode: 'off';
|
|
6
|
+
}
|
|
7
|
+
| {
|
|
8
|
+
mode: 'fallback';
|
|
9
|
+
fallback: React.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export type UniformCompositionProps = {
|
|
12
|
+
/**
|
|
13
|
+
* The params object from Next.js router. Used to resolve a composition.
|
|
14
|
+
*/
|
|
15
|
+
params: {
|
|
16
|
+
slug: string | string[];
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* The searchParams object from Next.js router. Used for signal evaluation.
|
|
20
|
+
*/
|
|
21
|
+
searchParams?: {
|
|
22
|
+
[key: string]: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Behavior of root Suspense component.
|
|
26
|
+
*/
|
|
27
|
+
suspense?:
|
|
28
|
+
| {
|
|
29
|
+
mode: 'off';
|
|
30
|
+
}
|
|
31
|
+
| {
|
|
32
|
+
mode: 'fallback';
|
|
33
|
+
fallback: ReactNode;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Update state that should be added to the call to update before composition evaluation
|
|
37
|
+
*/
|
|
38
|
+
update?: Partial<ContextState>;
|
|
39
|
+
/**
|
|
40
|
+
* The children of the UniformComposition component.
|
|
41
|
+
*/
|
|
42
|
+
children?: ReactNode;
|
|
43
|
+
};
|
|
44
|
+
export declare const UniformComposition: ({
|
|
45
|
+
suspense,
|
|
46
|
+
...props
|
|
47
|
+
}: UniformCompositionProps) => import('react/jsx-runtime').JSX.Element;
|