@uniformdev/canvas-react 17.7.1-alpha.140 → 17.7.1-alpha.169
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/index.esm.js +445 -1
- package/dist/index.js +473 -1
- package/dist/index.mjs +445 -1
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
|
@@ -1 +1,445 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/Composition.tsx
|
|
2
|
+
import { CANVAS_ENRICHMENT_TAG_PARAM } from "@uniformdev/canvas";
|
|
3
|
+
import { Track, TrackFragment, useUniformContext } from "@uniformdev/context-react";
|
|
4
|
+
import React3, { createContext, useContext } from "react";
|
|
5
|
+
|
|
6
|
+
// src/convertComponentToProps.ts
|
|
7
|
+
function convertComponentToProps(component) {
|
|
8
|
+
var _a;
|
|
9
|
+
const parameters = (_a = component.parameters) != null ? _a : {};
|
|
10
|
+
const renderComponentProps = {
|
|
11
|
+
...Object.keys(parameters).reduce((acc, cur) => {
|
|
12
|
+
acc[cur] = parameters[cur].value;
|
|
13
|
+
return acc;
|
|
14
|
+
}, {}),
|
|
15
|
+
...component.data,
|
|
16
|
+
component
|
|
17
|
+
};
|
|
18
|
+
return renderComponentProps;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// src/storeDefinition.ts
|
|
22
|
+
var createComponentStore = () => {
|
|
23
|
+
const components = /* @__PURE__ */ new Map();
|
|
24
|
+
return {
|
|
25
|
+
register: ({ type, component }) => {
|
|
26
|
+
components.set(type, component);
|
|
27
|
+
},
|
|
28
|
+
get: (name) => {
|
|
29
|
+
return components.get(name);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
var createComponentStoreResolver = (options) => {
|
|
34
|
+
return (component) => {
|
|
35
|
+
const resolved = options.store.get(component.type);
|
|
36
|
+
return resolved || options.defaultComponent || null;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// src/store.ts
|
|
41
|
+
var componentStore = createComponentStore();
|
|
42
|
+
var registerUniformComponent = ({
|
|
43
|
+
type,
|
|
44
|
+
component
|
|
45
|
+
}) => {
|
|
46
|
+
if (Array.isArray(type)) {
|
|
47
|
+
type.forEach((t) => {
|
|
48
|
+
componentStore.register({
|
|
49
|
+
type: t,
|
|
50
|
+
component
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
} else {
|
|
54
|
+
componentStore.register({
|
|
55
|
+
type,
|
|
56
|
+
component
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
var componentStoreResolver = createComponentStoreResolver({
|
|
61
|
+
store: componentStore
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// src/components/Slot.tsx
|
|
65
|
+
import {
|
|
66
|
+
CANVAS_PERSONALIZE_TYPE,
|
|
67
|
+
CANVAS_TEST_TYPE,
|
|
68
|
+
IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
|
|
69
|
+
PLACEHOLDER_ID
|
|
70
|
+
} from "@uniformdev/canvas";
|
|
71
|
+
import React2 from "react";
|
|
72
|
+
|
|
73
|
+
// src/defaultSystemComponentResolver.tsx
|
|
74
|
+
import {
|
|
75
|
+
mapSlotToPersonalizedVariations,
|
|
76
|
+
mapSlotToTestVariations
|
|
77
|
+
} from "@uniformdev/canvas";
|
|
78
|
+
import { Personalize, Test } from "@uniformdev/context-react";
|
|
79
|
+
import * as React from "react";
|
|
80
|
+
var defaultSystemComponentResolver = {
|
|
81
|
+
test: (component, key, renderChild) => {
|
|
82
|
+
var _a, _b, _c, _d, _e;
|
|
83
|
+
const testComponent = component;
|
|
84
|
+
const variants = (_b = (_a = testComponent.slots) == null ? void 0 : _a.test) != null ? _b : [];
|
|
85
|
+
const testName = (_e = (_d = (_c = testComponent.parameters) == null ? void 0 : _c.test) == null ? void 0 : _d.value) != null ? _e : "Untitled Test";
|
|
86
|
+
const finalVariants = mapSlotToTestVariations(variants);
|
|
87
|
+
return /* @__PURE__ */ React.createElement(
|
|
88
|
+
Test,
|
|
89
|
+
{
|
|
90
|
+
key,
|
|
91
|
+
variations: finalVariants,
|
|
92
|
+
name: testName,
|
|
93
|
+
component: (variation) => renderChild(variation, key)
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
},
|
|
97
|
+
personalization: (component, key, renderChild) => {
|
|
98
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
99
|
+
const pzComponent = component;
|
|
100
|
+
const processedVariants = mapSlotToPersonalizedVariations((_a = pzComponent == null ? void 0 : pzComponent.slots) == null ? void 0 : _a.pz);
|
|
101
|
+
return /* @__PURE__ */ React.createElement(
|
|
102
|
+
Personalize,
|
|
103
|
+
{
|
|
104
|
+
key,
|
|
105
|
+
variations: processedVariants,
|
|
106
|
+
count: Number((_d = (_c = (_b = pzComponent.parameters) == null ? void 0 : _b.count) == null ? void 0 : _c.value) != null ? _d : 1),
|
|
107
|
+
name: (_g = (_f = (_e = pzComponent.parameters) == null ? void 0 : _e.trackingEventName) == null ? void 0 : _f.value) != null ? _g : "Untitled Personalization",
|
|
108
|
+
component: (variation) => renderChild(variation, 0)
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// src/components/Slot.tsx
|
|
115
|
+
function Slot({
|
|
116
|
+
name,
|
|
117
|
+
resolveRenderer,
|
|
118
|
+
children,
|
|
119
|
+
emptyPlaceholder
|
|
120
|
+
}) {
|
|
121
|
+
var _a;
|
|
122
|
+
const compositionContext = useComposition();
|
|
123
|
+
if (!(compositionContext == null ? void 0 : compositionContext.composition)) {
|
|
124
|
+
throw new Error("Slot must be rendered within a Composition");
|
|
125
|
+
}
|
|
126
|
+
const { composition: layout, resolveRenderer: parentResolveRenderer } = compositionContext;
|
|
127
|
+
if (!layout) {
|
|
128
|
+
throw new Error("Cannot use Slot without a Composition wrapper.");
|
|
129
|
+
}
|
|
130
|
+
const slot = (_a = layout.slots) == null ? void 0 : _a[name];
|
|
131
|
+
if (!slot || !Array.isArray(slot)) {
|
|
132
|
+
if (process.env.NODE_ENV === "development") {
|
|
133
|
+
console.warn(
|
|
134
|
+
`[canvas-dev] slot '${name}' was rendered, but it was not defined on its component. This is expected if the slot is optional, otherwise it may indicate a typo. Component:`,
|
|
135
|
+
layout
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
const resolver = resolveRenderer != null ? resolveRenderer : parentResolveRenderer;
|
|
141
|
+
const systemResolver = defaultSystemComponentResolver;
|
|
142
|
+
const finalChildren = slot.map((component, index) => {
|
|
143
|
+
const child = renderComponent({
|
|
144
|
+
component,
|
|
145
|
+
resolveRenderer: resolver,
|
|
146
|
+
resolveSystem: systemResolver,
|
|
147
|
+
key: `inner-${index}`,
|
|
148
|
+
indexInSlot: index,
|
|
149
|
+
slotName: name,
|
|
150
|
+
parentComponent: layout,
|
|
151
|
+
slotChildrenCount: slot.length,
|
|
152
|
+
emptyPlaceholder
|
|
153
|
+
});
|
|
154
|
+
const elements = children ? children({ child, component, key: `wrapped-inner-${index}` }) : child;
|
|
155
|
+
return React2.createElement(React2.Fragment, { key: index }, elements);
|
|
156
|
+
});
|
|
157
|
+
return React2.createElement(React2.Fragment, void 0, finalChildren);
|
|
158
|
+
}
|
|
159
|
+
function renderComponent({
|
|
160
|
+
component,
|
|
161
|
+
resolveRenderer,
|
|
162
|
+
resolveSystem,
|
|
163
|
+
key = 0,
|
|
164
|
+
indexInSlot,
|
|
165
|
+
slotName,
|
|
166
|
+
parentComponent,
|
|
167
|
+
slotChildrenCount,
|
|
168
|
+
emptyPlaceholder
|
|
169
|
+
}) {
|
|
170
|
+
var _a, _b, _c;
|
|
171
|
+
const RenderComponent = resolveRenderer == null ? void 0 : resolveRenderer(component);
|
|
172
|
+
if (component.type === CANVAS_TEST_TYPE) {
|
|
173
|
+
return resolveSystem.test(
|
|
174
|
+
component,
|
|
175
|
+
key,
|
|
176
|
+
(component2, key2) => renderComponent({ component: component2, resolveRenderer, resolveSystem, key: key2 })
|
|
177
|
+
);
|
|
178
|
+
} else if (component.type === CANVAS_PERSONALIZE_TYPE) {
|
|
179
|
+
return resolveSystem.personalization(
|
|
180
|
+
component,
|
|
181
|
+
key,
|
|
182
|
+
(component2, key2) => renderComponent({ component: component2, resolveRenderer, resolveSystem, key: key2 })
|
|
183
|
+
);
|
|
184
|
+
} else if (RenderComponent) {
|
|
185
|
+
const props = convertComponentToProps(component);
|
|
186
|
+
const shouldRenderContextualEditingTags = Boolean(component._id);
|
|
187
|
+
const isPlaceholder = component._id === PLACEHOLDER_ID;
|
|
188
|
+
return /* @__PURE__ */ React2.createElement(Composition, { key, data: component, resolveRenderer }, !shouldRenderContextualEditingTags ? null : /* @__PURE__ */ React2.createElement(
|
|
189
|
+
"script",
|
|
190
|
+
{
|
|
191
|
+
key,
|
|
192
|
+
"data-role": IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
|
|
193
|
+
"data-parent-id": parentComponent == null ? void 0 : parentComponent._id,
|
|
194
|
+
"data-parent-type": parentComponent == null ? void 0 : parentComponent.type,
|
|
195
|
+
"data-component-id": component._id,
|
|
196
|
+
"data-slot-name": slotName != null ? slotName : "",
|
|
197
|
+
"data-component-index": indexInSlot != null ? indexInSlot : "",
|
|
198
|
+
"data-total-components": slotChildrenCount != null ? slotChildrenCount : "",
|
|
199
|
+
"data-component-name": component.type,
|
|
200
|
+
"data-is-placeholder": isPlaceholder ? "true" : void 0,
|
|
201
|
+
"data-component-title": (_c = (_b = (_a = component.parameters) == null ? void 0 : _a.title) == null ? void 0 : _b.value) != null ? _c : ""
|
|
202
|
+
}
|
|
203
|
+
), isPlaceholder && emptyPlaceholder !== void 0 ? emptyPlaceholder : /* @__PURE__ */ React2.createElement(RenderComponent, { ...props }), !shouldRenderContextualEditingTags ? null : /* @__PURE__ */ React2.createElement("script", { "data-role": "component-end" }));
|
|
204
|
+
} else if (process.env.NODE_ENV !== "production") {
|
|
205
|
+
console.warn(
|
|
206
|
+
`[canvas] found component of type '${component.type}' which the resolveRenderer prop returned no component for. Nothing will be rendered. The resolveRenderer function may need to be extended to handle the new type.`,
|
|
207
|
+
component
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
return null;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// src/components/Composition.tsx
|
|
214
|
+
var CompositionContext = createContext(void 0);
|
|
215
|
+
function useComposition() {
|
|
216
|
+
return useContext(CompositionContext);
|
|
217
|
+
}
|
|
218
|
+
var componentStoreResolver2 = (component) => {
|
|
219
|
+
const resolved = componentStore.get(component.type);
|
|
220
|
+
return resolved || null;
|
|
221
|
+
};
|
|
222
|
+
function Composition({
|
|
223
|
+
data,
|
|
224
|
+
resolveRenderer,
|
|
225
|
+
children,
|
|
226
|
+
behaviorTracking
|
|
227
|
+
}) {
|
|
228
|
+
var _a, _b, _c;
|
|
229
|
+
const parentLayout = useComposition();
|
|
230
|
+
const contextContextProviderPresent = useUniformContext({ throwOnMissingProvider: false }) !== void 0;
|
|
231
|
+
if (!data) {
|
|
232
|
+
if (process.env.NODE_ENV === "development") {
|
|
233
|
+
console.warn(`[canvas-dev] Composition was rendered with no data, nothing will be output.`);
|
|
234
|
+
}
|
|
235
|
+
return null;
|
|
236
|
+
}
|
|
237
|
+
const context = {
|
|
238
|
+
composition: data,
|
|
239
|
+
resolveRenderer: resolveRenderer || (parentLayout == null ? void 0 : parentLayout.resolveRenderer) || componentStoreResolver2,
|
|
240
|
+
behaviorTracking: (_a = behaviorTracking != null ? behaviorTracking : parentLayout == null ? void 0 : parentLayout.behaviorTracking) != null ? _a : "onView"
|
|
241
|
+
};
|
|
242
|
+
const enrichmentTags = (_c = (_b = data.parameters) == null ? void 0 : _b[CANVAS_ENRICHMENT_TAG_PARAM]) == null ? void 0 : _c.value;
|
|
243
|
+
const TrackComponent = context.behaviorTracking === "onLoad" ? TrackFragment : Track;
|
|
244
|
+
const resolvedChildren = resolveChildren({
|
|
245
|
+
children,
|
|
246
|
+
data,
|
|
247
|
+
hasParentLayout: Boolean(parentLayout)
|
|
248
|
+
});
|
|
249
|
+
return /* @__PURE__ */ React3.createElement(CompositionContext.Provider, { value: context }, contextContextProviderPresent ? /* @__PURE__ */ React3.createElement(TrackComponent, { behavior: enrichmentTags }, resolvedChildren) : resolvedChildren);
|
|
250
|
+
}
|
|
251
|
+
function resolveChildren({
|
|
252
|
+
children,
|
|
253
|
+
data,
|
|
254
|
+
hasParentLayout
|
|
255
|
+
}) {
|
|
256
|
+
var _a;
|
|
257
|
+
let compositionChildren = children;
|
|
258
|
+
if (!compositionChildren && !hasParentLayout) {
|
|
259
|
+
const rootComponent = componentStore.get(data.type);
|
|
260
|
+
if (rootComponent) {
|
|
261
|
+
compositionChildren = React3.createElement(rootComponent, convertComponentToProps(data));
|
|
262
|
+
} else {
|
|
263
|
+
if (Object.keys((_a = data.slots) != null ? _a : {}).length > 1 && process.env.NODE_ENV === "development") {
|
|
264
|
+
console.warn(
|
|
265
|
+
`[canvas-dev] All the slots in component '${data.type}' are rendered in no particular order. Use '<Slot name={slotName} />' to reliably render the slots.`
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
compositionChildren = Object.keys(data.slots || {}).map((slotName) => /* @__PURE__ */ React3.createElement(Slot, { key: slotName, name: slotName }));
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
const renderChildren = typeof compositionChildren === "function" ? compositionChildren(convertComponentToProps(data)) : compositionChildren;
|
|
272
|
+
return renderChildren;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// src/components/DefaultNotImplementedComponent.tsx
|
|
276
|
+
import React4 from "react";
|
|
277
|
+
function DefaultNotImplementedComponent(props) {
|
|
278
|
+
var _a;
|
|
279
|
+
const componentType = (_a = props.component) == null ? void 0 : _a.type;
|
|
280
|
+
if (!componentType) {
|
|
281
|
+
return null;
|
|
282
|
+
}
|
|
283
|
+
return /* @__PURE__ */ React4.createElement(
|
|
284
|
+
"div",
|
|
285
|
+
{
|
|
286
|
+
style: {
|
|
287
|
+
borderLeft: "10px solid #e42535!important",
|
|
288
|
+
padding: "0.01em 16px 16px",
|
|
289
|
+
borderRadius: "16px",
|
|
290
|
+
backgroundColor: "rgba(122, 215, 218, 0.3)",
|
|
291
|
+
color: "#1d3557"
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
/* @__PURE__ */ React4.createElement("h2", null, "Component: ", componentType),
|
|
295
|
+
/* @__PURE__ */ React4.createElement("p", null, /* @__PURE__ */ React4.createElement("strong", null, componentType), " has no React implementation. It may need to be added to your", " ", /* @__PURE__ */ React4.createElement("code", null, "resolveRenderer()"), " function."),
|
|
296
|
+
/* @__PURE__ */ React4.createElement("details", null, /* @__PURE__ */ React4.createElement("summary", null, "Props"), /* @__PURE__ */ React4.createElement("pre", null, JSON.stringify(props, null, 2)))
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// src/hooks/useCompositionEventEffect.ts
|
|
301
|
+
import {
|
|
302
|
+
CANVAS_DRAFT_STATE,
|
|
303
|
+
createEventBus,
|
|
304
|
+
subscribeToComposition
|
|
305
|
+
} from "@uniformdev/canvas";
|
|
306
|
+
import { useEffect } from "react";
|
|
307
|
+
function useCompositionEventEffect({
|
|
308
|
+
enabled,
|
|
309
|
+
projectId,
|
|
310
|
+
compositionId,
|
|
311
|
+
effect
|
|
312
|
+
}) {
|
|
313
|
+
useEffect(() => {
|
|
314
|
+
if (!enabled || !compositionId || !projectId) {
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
let goodbye = void 0;
|
|
318
|
+
const loadEffect = async () => {
|
|
319
|
+
const eventBus = await createEventBus();
|
|
320
|
+
if (eventBus) {
|
|
321
|
+
goodbye = subscribeToComposition({
|
|
322
|
+
eventBus,
|
|
323
|
+
compositionId,
|
|
324
|
+
compositionState: CANVAS_DRAFT_STATE,
|
|
325
|
+
projectId,
|
|
326
|
+
callback: effect,
|
|
327
|
+
event: "updated"
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
loadEffect();
|
|
332
|
+
return () => {
|
|
333
|
+
if (goodbye) {
|
|
334
|
+
goodbye();
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
}, [compositionId, enabled, projectId, effect]);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// src/hooks/useContextualEditing.ts
|
|
341
|
+
import {
|
|
342
|
+
createCanvasChannel,
|
|
343
|
+
IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
|
|
344
|
+
isUpdateCompositionMessage
|
|
345
|
+
} from "@uniformdev/canvas";
|
|
346
|
+
import { useEffect as useEffect2, useMemo, useState } from "react";
|
|
347
|
+
var previewScriptId = "uniform-canvas-preview-script";
|
|
348
|
+
var createApiEnhancer = ({ apiUrl }) => {
|
|
349
|
+
return async (message) => {
|
|
350
|
+
const response = await fetch(apiUrl, {
|
|
351
|
+
method: "post",
|
|
352
|
+
body: JSON.stringify({
|
|
353
|
+
composition: message.composition,
|
|
354
|
+
hash: message.hash
|
|
355
|
+
}),
|
|
356
|
+
headers: {
|
|
357
|
+
"Content-Type": "application/json"
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
const json = await response.json();
|
|
361
|
+
if (!response.ok) {
|
|
362
|
+
throw new Error("Error reading enhanced composition");
|
|
363
|
+
}
|
|
364
|
+
const body = json;
|
|
365
|
+
return body.composition;
|
|
366
|
+
};
|
|
367
|
+
};
|
|
368
|
+
var useContextualEditing = ({
|
|
369
|
+
initialCompositionValue,
|
|
370
|
+
enhance = (message) => message.composition
|
|
371
|
+
}) => {
|
|
372
|
+
const [contextualComposition, setContextualComposition] = useState();
|
|
373
|
+
const channel = useMemo(() => {
|
|
374
|
+
var _a;
|
|
375
|
+
if (!isInContextEditingMode()) {
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
const channel2 = createCanvasChannel({
|
|
379
|
+
broadcastTo: [(_a = window.opener) != null ? _a : window.top],
|
|
380
|
+
listenTo: [window]
|
|
381
|
+
});
|
|
382
|
+
return channel2;
|
|
383
|
+
}, []);
|
|
384
|
+
useEffect2(() => {
|
|
385
|
+
if (!channel) {
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
const unsubscribe = channel.on("update-composition", async (message) => {
|
|
389
|
+
if (isUpdateCompositionMessage(message)) {
|
|
390
|
+
const composition = await enhance(message);
|
|
391
|
+
setContextualComposition(composition);
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
return () => {
|
|
395
|
+
unsubscribe();
|
|
396
|
+
};
|
|
397
|
+
}, [channel, enhance]);
|
|
398
|
+
useEffect2(() => {
|
|
399
|
+
if (!isInContextEditingMode()) {
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
const existingScript = document.getElementById(previewScriptId);
|
|
403
|
+
if (existingScript) {
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
const script = document.createElement("script");
|
|
407
|
+
script.id = previewScriptId;
|
|
408
|
+
script.src = getCanvasInContextEmbedScriptUrl();
|
|
409
|
+
script.async = true;
|
|
410
|
+
document.head.appendChild(script);
|
|
411
|
+
}, []);
|
|
412
|
+
return {
|
|
413
|
+
composition: contextualComposition != null ? contextualComposition : initialCompositionValue
|
|
414
|
+
};
|
|
415
|
+
};
|
|
416
|
+
function getCanvasInContextEmbedScriptUrl() {
|
|
417
|
+
const scriptUrl = `${window.document.referrer}files/canvas-in-context-embed/index.js`;
|
|
418
|
+
return scriptUrl;
|
|
419
|
+
}
|
|
420
|
+
function isInContextEditingMode() {
|
|
421
|
+
if (typeof window === "undefined") {
|
|
422
|
+
return false;
|
|
423
|
+
}
|
|
424
|
+
const isOpenedByInContextEditor = new URLSearchParams(window.location.search).has(
|
|
425
|
+
IN_CONTEXT_EDITOR_QUERY_STRING_PARAM
|
|
426
|
+
);
|
|
427
|
+
const isAllowlistedReferrer = Boolean(
|
|
428
|
+
window.document.referrer.match(/(^https:\/\/|\.)(uniform.app|uniform.wtf|localhost:\d{4})\//)
|
|
429
|
+
);
|
|
430
|
+
return isOpenedByInContextEditor && isAllowlistedReferrer;
|
|
431
|
+
}
|
|
432
|
+
export {
|
|
433
|
+
Composition,
|
|
434
|
+
DefaultNotImplementedComponent,
|
|
435
|
+
Slot,
|
|
436
|
+
componentStore,
|
|
437
|
+
componentStoreResolver,
|
|
438
|
+
createApiEnhancer,
|
|
439
|
+
createComponentStore,
|
|
440
|
+
createComponentStoreResolver,
|
|
441
|
+
registerUniformComponent,
|
|
442
|
+
useComposition,
|
|
443
|
+
useCompositionEventEffect,
|
|
444
|
+
useContextualEditing
|
|
445
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-react",
|
|
3
|
-
"version": "17.7.1-alpha.
|
|
3
|
+
"version": "17.7.1-alpha.169+522807b78",
|
|
4
4
|
"description": "React SDK for Uniform Canvas",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
16
|
"sideEffects": false,
|
|
17
17
|
"scripts": {
|
|
18
|
-
"build": "tsup
|
|
18
|
+
"build": "tsup",
|
|
19
19
|
"dev": "tsup --watch",
|
|
20
20
|
"clean": "rimraf dist",
|
|
21
21
|
"test": "jest --maxWorkers=1",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"format": "prettier --write \"src/**/*.{js,ts,tsx}\""
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@uniformdev/canvas": "^17.7.1-alpha.
|
|
27
|
-
"@uniformdev/context": "^17.7.1-alpha.
|
|
28
|
-
"@uniformdev/context-react": "^17.7.1-alpha.
|
|
26
|
+
"@uniformdev/canvas": "^17.7.1-alpha.169+522807b78",
|
|
27
|
+
"@uniformdev/context": "^17.7.1-alpha.169+522807b78",
|
|
28
|
+
"@uniformdev/context-react": "^17.7.1-alpha.169+522807b78"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"react": ">= 16",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "522807b78c5e15b076bd07b4a1a4124de07dcb5b"
|
|
46
46
|
}
|