@uniformdev/canvas-react 19.185.1-alpha.8 → 19.186.2-alpha.14
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.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.esm.js +1 -2
- package/dist/index.js +14 -15
- package/dist/index.mjs +1 -2
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -227,6 +227,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
227
227
|
isPatternParameter?: boolean;
|
|
228
228
|
ignorePatternParameterDefault?: boolean;
|
|
229
229
|
optionalPatternParameter?: boolean;
|
|
230
|
+
dataSourceVariant?: "unpublished";
|
|
230
231
|
variables?: {
|
|
231
232
|
[key: string]: string;
|
|
232
233
|
};
|
|
@@ -238,6 +239,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
238
239
|
isPatternParameter?: boolean;
|
|
239
240
|
ignorePatternParameterDefault?: boolean;
|
|
240
241
|
optionalPatternParameter?: boolean;
|
|
242
|
+
dataSourceVariant?: "unpublished";
|
|
241
243
|
variables?: {
|
|
242
244
|
[key: string]: string;
|
|
243
245
|
};
|
|
@@ -320,6 +322,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
320
322
|
isPatternParameter?: boolean;
|
|
321
323
|
ignorePatternParameterDefault?: boolean;
|
|
322
324
|
optionalPatternParameter?: boolean;
|
|
325
|
+
dataSourceVariant?: "unpublished";
|
|
323
326
|
variables?: {
|
|
324
327
|
[key: string]: string;
|
|
325
328
|
};
|
|
@@ -331,6 +334,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
331
334
|
isPatternParameter?: boolean;
|
|
332
335
|
ignorePatternParameterDefault?: boolean;
|
|
333
336
|
optionalPatternParameter?: boolean;
|
|
337
|
+
dataSourceVariant?: "unpublished";
|
|
334
338
|
variables?: {
|
|
335
339
|
[key: string]: string;
|
|
336
340
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -227,6 +227,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
227
227
|
isPatternParameter?: boolean;
|
|
228
228
|
ignorePatternParameterDefault?: boolean;
|
|
229
229
|
optionalPatternParameter?: boolean;
|
|
230
|
+
dataSourceVariant?: "unpublished";
|
|
230
231
|
variables?: {
|
|
231
232
|
[key: string]: string;
|
|
232
233
|
};
|
|
@@ -238,6 +239,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
238
239
|
isPatternParameter?: boolean;
|
|
239
240
|
ignorePatternParameterDefault?: boolean;
|
|
240
241
|
optionalPatternParameter?: boolean;
|
|
242
|
+
dataSourceVariant?: "unpublished";
|
|
241
243
|
variables?: {
|
|
242
244
|
[key: string]: string;
|
|
243
245
|
};
|
|
@@ -320,6 +322,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
320
322
|
isPatternParameter?: boolean;
|
|
321
323
|
ignorePatternParameterDefault?: boolean;
|
|
322
324
|
optionalPatternParameter?: boolean;
|
|
325
|
+
dataSourceVariant?: "unpublished";
|
|
323
326
|
variables?: {
|
|
324
327
|
[key: string]: string;
|
|
325
328
|
};
|
|
@@ -331,6 +334,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
|
|
|
331
334
|
isPatternParameter?: boolean;
|
|
332
335
|
ignorePatternParameterDefault?: boolean;
|
|
333
336
|
optionalPatternParameter?: boolean;
|
|
337
|
+
dataSourceVariant?: "unpublished";
|
|
334
338
|
variables?: {
|
|
335
339
|
[key: string]: string;
|
|
336
340
|
};
|
package/dist/index.esm.js
CHANGED
|
@@ -703,7 +703,6 @@ import { isRichTextNode } from "@uniformdev/richtext";
|
|
|
703
703
|
import React19 from "react";
|
|
704
704
|
|
|
705
705
|
// src/components/UniformRichText/nodes/AssetRichTextNode.tsx
|
|
706
|
-
import { ASSETS_SOURCE_UNIFORM } from "@uniformdev/canvas";
|
|
707
706
|
import React9 from "react";
|
|
708
707
|
var AssetRichTextNode = ({ node }) => {
|
|
709
708
|
var _a, _b;
|
|
@@ -711,7 +710,7 @@ var AssetRichTextNode = ({ node }) => {
|
|
|
711
710
|
if (__asset === void 0) {
|
|
712
711
|
return null;
|
|
713
712
|
}
|
|
714
|
-
if (__asset.type !== "image"
|
|
713
|
+
if (__asset.type !== "image") {
|
|
715
714
|
return null;
|
|
716
715
|
}
|
|
717
716
|
return /* @__PURE__ */ React9.createElement("figure", null, /* @__PURE__ */ React9.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__ */ React9.createElement("figcaption", null, __asset.fields.description.value) : null);
|
package/dist/index.js
CHANGED
|
@@ -718,7 +718,7 @@ var UniformPlayground = ({
|
|
|
718
718
|
};
|
|
719
719
|
|
|
720
720
|
// src/components/UniformRichText/UniformRichText.tsx
|
|
721
|
-
var
|
|
721
|
+
var import_canvas11 = require("@uniformdev/canvas");
|
|
722
722
|
var import_richtext6 = require("@uniformdev/richtext");
|
|
723
723
|
var import_react22 = __toESM(require("react"));
|
|
724
724
|
|
|
@@ -727,7 +727,6 @@ var import_richtext5 = require("@uniformdev/richtext");
|
|
|
727
727
|
var import_react21 = __toESM(require("react"));
|
|
728
728
|
|
|
729
729
|
// src/components/UniformRichText/nodes/AssetRichTextNode.tsx
|
|
730
|
-
var import_canvas11 = require("@uniformdev/canvas");
|
|
731
730
|
var import_react11 = __toESM(require("react"));
|
|
732
731
|
var AssetRichTextNode = ({ node }) => {
|
|
733
732
|
var _a, _b;
|
|
@@ -735,7 +734,7 @@ var AssetRichTextNode = ({ node }) => {
|
|
|
735
734
|
if (__asset === void 0) {
|
|
736
735
|
return null;
|
|
737
736
|
}
|
|
738
|
-
if (__asset.type !== "image"
|
|
737
|
+
if (__asset.type !== "image") {
|
|
739
738
|
return null;
|
|
740
739
|
}
|
|
741
740
|
return /* @__PURE__ */ import_react11.default.createElement("figure", null, /* @__PURE__ */ import_react11.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_react11.default.createElement("figcaption", null, __asset.fields.description.value) : null);
|
|
@@ -878,9 +877,9 @@ var UniformRichText = import_react22.default.forwardRef(function UniformRichText
|
|
|
878
877
|
ref,
|
|
879
878
|
...props,
|
|
880
879
|
...isContextualEditing ? {
|
|
881
|
-
[
|
|
882
|
-
[
|
|
883
|
-
[
|
|
880
|
+
[import_canvas11.ATTRIBUTE_COMPONENT_ID]: componentData == null ? void 0 : componentData._id,
|
|
881
|
+
[import_canvas11.ATTRIBUTE_PARAMETER_ID]: parameterId,
|
|
882
|
+
[import_canvas11.ATTRIBUTE_PARAMETER_TYPE]: "richText"
|
|
884
883
|
} : {}
|
|
885
884
|
},
|
|
886
885
|
(0, import_richtext6.isRichTextValueConsideredEmpty)(value) ? /* @__PURE__ */ import_react22.default.createElement("p", null, /* @__PURE__ */ import_react22.default.createElement("i", null, computedPlaceholder)) : /* @__PURE__ */ import_react22.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
|
|
@@ -974,16 +973,16 @@ var UniformText = ({
|
|
|
974
973
|
};
|
|
975
974
|
|
|
976
975
|
// src/helpers/getParameterAttributes.ts
|
|
977
|
-
var
|
|
976
|
+
var import_canvas12 = require("@uniformdev/canvas");
|
|
978
977
|
var getParameterAttributes = (options) => {
|
|
979
978
|
return {
|
|
980
|
-
...(0,
|
|
979
|
+
...(0, import_canvas12.getParameterAttributes)(options),
|
|
981
980
|
suppressContentEditableWarning: true
|
|
982
981
|
};
|
|
983
982
|
};
|
|
984
983
|
|
|
985
984
|
// src/hooks/useCompositionEventEffect.ts
|
|
986
|
-
var
|
|
985
|
+
var import_canvas13 = require("@uniformdev/canvas");
|
|
987
986
|
var import_react25 = require("react");
|
|
988
987
|
function useCompositionEventEffect({
|
|
989
988
|
enabled,
|
|
@@ -997,12 +996,12 @@ function useCompositionEventEffect({
|
|
|
997
996
|
}
|
|
998
997
|
let goodbye = void 0;
|
|
999
998
|
const loadEffect = async () => {
|
|
1000
|
-
const eventBus = await (0,
|
|
999
|
+
const eventBus = await (0, import_canvas13.createEventBus)();
|
|
1001
1000
|
if (eventBus) {
|
|
1002
|
-
goodbye = (0,
|
|
1001
|
+
goodbye = (0, import_canvas13.subscribeToComposition)({
|
|
1003
1002
|
eventBus,
|
|
1004
1003
|
compositionId,
|
|
1005
|
-
compositionState:
|
|
1004
|
+
compositionState: import_canvas13.CANVAS_DRAFT_STATE,
|
|
1006
1005
|
projectId,
|
|
1007
1006
|
callback: effect,
|
|
1008
1007
|
event: "updated"
|
|
@@ -1019,7 +1018,7 @@ function useCompositionEventEffect({
|
|
|
1019
1018
|
}
|
|
1020
1019
|
|
|
1021
1020
|
// src/hooks/useUniformContextualEditingState.ts
|
|
1022
|
-
var
|
|
1021
|
+
var import_canvas14 = require("@uniformdev/canvas");
|
|
1023
1022
|
var import_react26 = require("react");
|
|
1024
1023
|
var useUniformContextualEditingState = ({
|
|
1025
1024
|
global = false
|
|
@@ -1034,7 +1033,7 @@ var useUniformContextualEditingState = ({
|
|
|
1034
1033
|
if (!isContextualEditing) {
|
|
1035
1034
|
return;
|
|
1036
1035
|
}
|
|
1037
|
-
const channel2 = (0,
|
|
1036
|
+
const channel2 = (0, import_canvas14.createCanvasChannel)({
|
|
1038
1037
|
broadcastTo: [window],
|
|
1039
1038
|
listenTo: [window]
|
|
1040
1039
|
});
|
|
@@ -1050,7 +1049,7 @@ var useUniformContextualEditingState = ({
|
|
|
1050
1049
|
}
|
|
1051
1050
|
const unsubscribe = channel.on("update-contextual-editing-state-internal", async (message) => {
|
|
1052
1051
|
var _a2;
|
|
1053
|
-
if (!(0,
|
|
1052
|
+
if (!(0, import_canvas14.isUpdateContextualEditingStateInternalMessage)(message)) {
|
|
1054
1053
|
return;
|
|
1055
1054
|
}
|
|
1056
1055
|
setPreviewMode(message.state.previewMode);
|
package/dist/index.mjs
CHANGED
|
@@ -703,7 +703,6 @@ import { isRichTextNode } from "@uniformdev/richtext";
|
|
|
703
703
|
import React19 from "react";
|
|
704
704
|
|
|
705
705
|
// src/components/UniformRichText/nodes/AssetRichTextNode.tsx
|
|
706
|
-
import { ASSETS_SOURCE_UNIFORM } from "@uniformdev/canvas";
|
|
707
706
|
import React9 from "react";
|
|
708
707
|
var AssetRichTextNode = ({ node }) => {
|
|
709
708
|
var _a, _b;
|
|
@@ -711,7 +710,7 @@ var AssetRichTextNode = ({ node }) => {
|
|
|
711
710
|
if (__asset === void 0) {
|
|
712
711
|
return null;
|
|
713
712
|
}
|
|
714
|
-
if (__asset.type !== "image"
|
|
713
|
+
if (__asset.type !== "image") {
|
|
715
714
|
return null;
|
|
716
715
|
}
|
|
717
716
|
return /* @__PURE__ */ React9.createElement("figure", null, /* @__PURE__ */ React9.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__ */ React9.createElement("figcaption", null, __asset.fields.description.value) : null);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-react",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.186.2-alpha.14+2868049c36",
|
|
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.186.2-alpha.14+2868049c36",
|
|
49
|
+
"@uniformdev/context": "19.186.2-alpha.14+2868049c36",
|
|
50
|
+
"@uniformdev/context-react": "19.186.2-alpha.14+2868049c36",
|
|
51
|
+
"@uniformdev/richtext": "19.186.2-alpha.14+2868049c36"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"immer": ">= 10",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "2868049c365d370abc91762e89dc845c61c02b78"
|
|
71
71
|
}
|