@uniformdev/canvas-react 19.107.0 → 19.109.1-alpha.0
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 +10 -7
- package/dist/index.js +3 -0
- package/dist/index.mjs +10 -7
- package/package.json +6 -6
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
// src/components/DefaultNotImplementedComponent.tsx
|
|
4
|
-
import { CANVAS_LOCALIZATION_TYPE } from "@uniformdev/canvas";
|
|
4
|
+
import { CANVAS_LOCALIZATION_TYPE, EMPTY_COMPOSITION } from "@uniformdev/canvas";
|
|
5
5
|
import React from "react";
|
|
6
6
|
var wrapperStyles = {
|
|
7
7
|
display: "flex",
|
|
@@ -21,6 +21,9 @@ function DefaultNotImplementedComponent(props) {
|
|
|
21
21
|
if (!componentType) {
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
24
|
+
if (componentType === EMPTY_COMPOSITION.type) {
|
|
25
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("style", null, `@keyframes _uniformDelayedFadeIn { 0%,75% { opacity: 0; } to { opacity: 1; } }`), /* @__PURE__ */ React.createElement("p", { style: { animation: "_uniformDelayedFadeIn 3s" } }, "This component only works inside Uniform Canvas editor.", /* @__PURE__ */ React.createElement("br", null), "If you think this is an error, try", " ", /* @__PURE__ */ React.createElement("a", { href: "", style: { fontWeight: "bolder", textDecoration: "underline" } }, "reloading the page"), "."));
|
|
26
|
+
}
|
|
24
27
|
if (componentType === CANVAS_LOCALIZATION_TYPE) {
|
|
25
28
|
return /* @__PURE__ */ React.createElement("div", { style: wrapperStyles }, /* @__PURE__ */ React.createElement("p", null, "Seems like localization is not enabled in your application. Please read our documentation on how to", " ", /* @__PURE__ */ React.createElement(
|
|
26
29
|
"a",
|
|
@@ -139,7 +142,7 @@ import {
|
|
|
139
142
|
CANVAS_PERSONALIZE_TYPE,
|
|
140
143
|
CANVAS_TEST_SLOT,
|
|
141
144
|
CANVAS_TEST_TYPE,
|
|
142
|
-
EMPTY_COMPOSITION as
|
|
145
|
+
EMPTY_COMPOSITION as EMPTY_COMPOSITION3
|
|
143
146
|
} from "@uniformdev/canvas";
|
|
144
147
|
import React6 from "react";
|
|
145
148
|
|
|
@@ -234,7 +237,7 @@ import React4, { createContext, useContext } from "react";
|
|
|
234
237
|
import {
|
|
235
238
|
createCanvasChannel,
|
|
236
239
|
createUniformApiEnhancer,
|
|
237
|
-
EMPTY_COMPOSITION,
|
|
240
|
+
EMPTY_COMPOSITION as EMPTY_COMPOSITION2,
|
|
238
241
|
IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID,
|
|
239
242
|
IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
|
|
240
243
|
isAllowedReferrer,
|
|
@@ -259,7 +262,7 @@ var useUniformContextualEditing = ({
|
|
|
259
262
|
return channel2;
|
|
260
263
|
}, []);
|
|
261
264
|
useEffect(() => {
|
|
262
|
-
if ((contextualComposition == null ? void 0 : contextualComposition._id) && (initialCompositionValue == null ? void 0 : initialCompositionValue._id) !==
|
|
265
|
+
if ((contextualComposition == null ? void 0 : contextualComposition._id) && (initialCompositionValue == null ? void 0 : initialCompositionValue._id) !== EMPTY_COMPOSITION2._id && (initialCompositionValue == null ? void 0 : initialCompositionValue._id) !== (contextualComposition == null ? void 0 : contextualComposition._id)) {
|
|
263
266
|
setContextualComposition(void 0);
|
|
264
267
|
return;
|
|
265
268
|
}
|
|
@@ -405,7 +408,7 @@ function UniformSlot({
|
|
|
405
408
|
}
|
|
406
409
|
const slot = (_a = parentData.slots) == null ? void 0 : _a[name];
|
|
407
410
|
if (!slot || !Array.isArray(slot)) {
|
|
408
|
-
if (process.env.NODE_ENV === "development" && parentData.type !==
|
|
411
|
+
if (process.env.NODE_ENV === "development" && parentData.type !== EMPTY_COMPOSITION3.type) {
|
|
409
412
|
console.warn(
|
|
410
413
|
`[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:`,
|
|
411
414
|
parentData
|
|
@@ -596,7 +599,7 @@ function resolveChildren({
|
|
|
596
599
|
}
|
|
597
600
|
|
|
598
601
|
// src/components/UniformPlayground.tsx
|
|
599
|
-
import { EMPTY_COMPOSITION as
|
|
602
|
+
import { EMPTY_COMPOSITION as EMPTY_COMPOSITION4 } from "@uniformdev/canvas";
|
|
600
603
|
import React8, { useMemo as useMemo2 } from "react";
|
|
601
604
|
var UniformPlayground = ({
|
|
602
605
|
resolveRenderer,
|
|
@@ -607,7 +610,7 @@ var UniformPlayground = ({
|
|
|
607
610
|
children
|
|
608
611
|
}) => {
|
|
609
612
|
const { composition, isContextualEditing } = useUniformContextualEditing({
|
|
610
|
-
initialCompositionValue:
|
|
613
|
+
initialCompositionValue: EMPTY_COMPOSITION4,
|
|
611
614
|
enhance: contextualEditingEnhancer
|
|
612
615
|
});
|
|
613
616
|
const renderedComponent = useMemo2(() => {
|
package/dist/index.js
CHANGED
|
@@ -78,6 +78,9 @@ function DefaultNotImplementedComponent(props) {
|
|
|
78
78
|
if (!componentType) {
|
|
79
79
|
return null;
|
|
80
80
|
}
|
|
81
|
+
if (componentType === import_canvas.EMPTY_COMPOSITION.type) {
|
|
82
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("style", null, `@keyframes _uniformDelayedFadeIn { 0%,75% { opacity: 0; } to { opacity: 1; } }`), /* @__PURE__ */ import_react.default.createElement("p", { style: { animation: "_uniformDelayedFadeIn 3s" } }, "This component only works inside Uniform Canvas editor.", /* @__PURE__ */ import_react.default.createElement("br", null), "If you think this is an error, try", " ", /* @__PURE__ */ import_react.default.createElement("a", { href: "", style: { fontWeight: "bolder", textDecoration: "underline" } }, "reloading the page"), "."));
|
|
83
|
+
}
|
|
81
84
|
if (componentType === import_canvas.CANVAS_LOCALIZATION_TYPE) {
|
|
82
85
|
return /* @__PURE__ */ import_react.default.createElement("div", { style: wrapperStyles }, /* @__PURE__ */ import_react.default.createElement("p", null, "Seems like localization is not enabled in your application. Please read our documentation on how to", " ", /* @__PURE__ */ import_react.default.createElement(
|
|
83
86
|
"a",
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
// src/components/DefaultNotImplementedComponent.tsx
|
|
4
|
-
import { CANVAS_LOCALIZATION_TYPE } from "@uniformdev/canvas";
|
|
4
|
+
import { CANVAS_LOCALIZATION_TYPE, EMPTY_COMPOSITION } from "@uniformdev/canvas";
|
|
5
5
|
import React from "react";
|
|
6
6
|
var wrapperStyles = {
|
|
7
7
|
display: "flex",
|
|
@@ -21,6 +21,9 @@ function DefaultNotImplementedComponent(props) {
|
|
|
21
21
|
if (!componentType) {
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
24
|
+
if (componentType === EMPTY_COMPOSITION.type) {
|
|
25
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("style", null, `@keyframes _uniformDelayedFadeIn { 0%,75% { opacity: 0; } to { opacity: 1; } }`), /* @__PURE__ */ React.createElement("p", { style: { animation: "_uniformDelayedFadeIn 3s" } }, "This component only works inside Uniform Canvas editor.", /* @__PURE__ */ React.createElement("br", null), "If you think this is an error, try", " ", /* @__PURE__ */ React.createElement("a", { href: "", style: { fontWeight: "bolder", textDecoration: "underline" } }, "reloading the page"), "."));
|
|
26
|
+
}
|
|
24
27
|
if (componentType === CANVAS_LOCALIZATION_TYPE) {
|
|
25
28
|
return /* @__PURE__ */ React.createElement("div", { style: wrapperStyles }, /* @__PURE__ */ React.createElement("p", null, "Seems like localization is not enabled in your application. Please read our documentation on how to", " ", /* @__PURE__ */ React.createElement(
|
|
26
29
|
"a",
|
|
@@ -139,7 +142,7 @@ import {
|
|
|
139
142
|
CANVAS_PERSONALIZE_TYPE,
|
|
140
143
|
CANVAS_TEST_SLOT,
|
|
141
144
|
CANVAS_TEST_TYPE,
|
|
142
|
-
EMPTY_COMPOSITION as
|
|
145
|
+
EMPTY_COMPOSITION as EMPTY_COMPOSITION3
|
|
143
146
|
} from "@uniformdev/canvas";
|
|
144
147
|
import React6 from "react";
|
|
145
148
|
|
|
@@ -234,7 +237,7 @@ import React4, { createContext, useContext } from "react";
|
|
|
234
237
|
import {
|
|
235
238
|
createCanvasChannel,
|
|
236
239
|
createUniformApiEnhancer,
|
|
237
|
-
EMPTY_COMPOSITION,
|
|
240
|
+
EMPTY_COMPOSITION as EMPTY_COMPOSITION2,
|
|
238
241
|
IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID,
|
|
239
242
|
IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
|
|
240
243
|
isAllowedReferrer,
|
|
@@ -259,7 +262,7 @@ var useUniformContextualEditing = ({
|
|
|
259
262
|
return channel2;
|
|
260
263
|
}, []);
|
|
261
264
|
useEffect(() => {
|
|
262
|
-
if ((contextualComposition == null ? void 0 : contextualComposition._id) && (initialCompositionValue == null ? void 0 : initialCompositionValue._id) !==
|
|
265
|
+
if ((contextualComposition == null ? void 0 : contextualComposition._id) && (initialCompositionValue == null ? void 0 : initialCompositionValue._id) !== EMPTY_COMPOSITION2._id && (initialCompositionValue == null ? void 0 : initialCompositionValue._id) !== (contextualComposition == null ? void 0 : contextualComposition._id)) {
|
|
263
266
|
setContextualComposition(void 0);
|
|
264
267
|
return;
|
|
265
268
|
}
|
|
@@ -405,7 +408,7 @@ function UniformSlot({
|
|
|
405
408
|
}
|
|
406
409
|
const slot = (_a = parentData.slots) == null ? void 0 : _a[name];
|
|
407
410
|
if (!slot || !Array.isArray(slot)) {
|
|
408
|
-
if (process.env.NODE_ENV === "development" && parentData.type !==
|
|
411
|
+
if (process.env.NODE_ENV === "development" && parentData.type !== EMPTY_COMPOSITION3.type) {
|
|
409
412
|
console.warn(
|
|
410
413
|
`[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:`,
|
|
411
414
|
parentData
|
|
@@ -596,7 +599,7 @@ function resolveChildren({
|
|
|
596
599
|
}
|
|
597
600
|
|
|
598
601
|
// src/components/UniformPlayground.tsx
|
|
599
|
-
import { EMPTY_COMPOSITION as
|
|
602
|
+
import { EMPTY_COMPOSITION as EMPTY_COMPOSITION4 } from "@uniformdev/canvas";
|
|
600
603
|
import React8, { useMemo as useMemo2 } from "react";
|
|
601
604
|
var UniformPlayground = ({
|
|
602
605
|
resolveRenderer,
|
|
@@ -607,7 +610,7 @@ var UniformPlayground = ({
|
|
|
607
610
|
children
|
|
608
611
|
}) => {
|
|
609
612
|
const { composition, isContextualEditing } = useUniformContextualEditing({
|
|
610
|
-
initialCompositionValue:
|
|
613
|
+
initialCompositionValue: EMPTY_COMPOSITION4,
|
|
611
614
|
enhance: contextualEditingEnhancer
|
|
612
615
|
});
|
|
613
616
|
const renderedComponent = useMemo2(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-react",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.109.1-alpha.0+d14ca8a09",
|
|
4
4
|
"description": "React SDK for Uniform Canvas",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"document": "api-extractor run --local"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@uniformdev/canvas": "19.
|
|
49
|
-
"@uniformdev/context": "19.
|
|
50
|
-
"@uniformdev/context-react": "19.
|
|
51
|
-
"@uniformdev/richtext": "19.
|
|
48
|
+
"@uniformdev/canvas": "19.109.1-alpha.0+d14ca8a09",
|
|
49
|
+
"@uniformdev/context": "19.109.1-alpha.0+d14ca8a09",
|
|
50
|
+
"@uniformdev/context-react": "19.109.1-alpha.0+d14ca8a09",
|
|
51
|
+
"@uniformdev/richtext": "19.109.1-alpha.0+d14ca8a09"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"react": ">= 16 || 17 || 18",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "d14ca8a09847ebe49f053958ed3c3d27492f764c"
|
|
69
69
|
}
|