@uniformdev/canvas-vue 20.74.6-alpha.6 → 20.74.7-alpha.14.sha-79426f9415
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 +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.esm.js +4 -3
- package/dist/index.js +16 -15
- package/dist/index.mjs +4 -3
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -52,20 +52,20 @@ type ResolveRenderer = (componentInstance: ComponentInstance) => Component<any>;
|
|
|
52
52
|
type UniformTextProps = {
|
|
53
53
|
/**
|
|
54
54
|
* The name of the HTML tag to render.
|
|
55
|
-
* @
|
|
55
|
+
* @defaultValue "span"
|
|
56
56
|
*/
|
|
57
57
|
as?: string;
|
|
58
58
|
/** The ID of the parameter. */
|
|
59
59
|
parameterId: string;
|
|
60
60
|
/**
|
|
61
61
|
* When set to true, it adds `whiteSpace: 'pre-wrap'` to the styles of the root element to allow the rendering of line breaks.
|
|
62
|
-
* @
|
|
62
|
+
* @defaultValue false
|
|
63
63
|
*/
|
|
64
64
|
isMultiline?: boolean;
|
|
65
65
|
/**
|
|
66
66
|
* Sets the value to show in Canvas editor when the parameter value is empty.
|
|
67
67
|
* Can be a static string, or a function to generate the placeholder out of parameter info.
|
|
68
|
-
* @
|
|
68
|
+
* @defaultValue undefined
|
|
69
69
|
*/
|
|
70
70
|
placeholder?: string | ((parameter: {
|
|
71
71
|
id: string;
|
|
@@ -938,7 +938,7 @@ type UniformRichTextProps = {
|
|
|
938
938
|
/**
|
|
939
939
|
* Sets the value to show in Canvas editor when the parameter value is empty.
|
|
940
940
|
* Can be a static string, or a function to generate the placeholder out of parameter info.
|
|
941
|
-
* @
|
|
941
|
+
* @defaultValue undefined
|
|
942
942
|
*/
|
|
943
943
|
placeholder?: string | ((parameter: {
|
|
944
944
|
id: string;
|
|
@@ -1049,7 +1049,7 @@ type UseUniformContextualEditingStateProps = {
|
|
|
1049
1049
|
/**
|
|
1050
1050
|
* When set to true, the hook will return the global contextual state no matter where its used.
|
|
1051
1051
|
* When set to false, it will return only the state relevant to the current component (determined using `useUniformCurrentComponent`).
|
|
1052
|
-
* @
|
|
1052
|
+
* @defaultValue false
|
|
1053
1053
|
**/
|
|
1054
1054
|
global?: boolean;
|
|
1055
1055
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -52,20 +52,20 @@ type ResolveRenderer = (componentInstance: ComponentInstance) => Component<any>;
|
|
|
52
52
|
type UniformTextProps = {
|
|
53
53
|
/**
|
|
54
54
|
* The name of the HTML tag to render.
|
|
55
|
-
* @
|
|
55
|
+
* @defaultValue "span"
|
|
56
56
|
*/
|
|
57
57
|
as?: string;
|
|
58
58
|
/** The ID of the parameter. */
|
|
59
59
|
parameterId: string;
|
|
60
60
|
/**
|
|
61
61
|
* When set to true, it adds `whiteSpace: 'pre-wrap'` to the styles of the root element to allow the rendering of line breaks.
|
|
62
|
-
* @
|
|
62
|
+
* @defaultValue false
|
|
63
63
|
*/
|
|
64
64
|
isMultiline?: boolean;
|
|
65
65
|
/**
|
|
66
66
|
* Sets the value to show in Canvas editor when the parameter value is empty.
|
|
67
67
|
* Can be a static string, or a function to generate the placeholder out of parameter info.
|
|
68
|
-
* @
|
|
68
|
+
* @defaultValue undefined
|
|
69
69
|
*/
|
|
70
70
|
placeholder?: string | ((parameter: {
|
|
71
71
|
id: string;
|
|
@@ -938,7 +938,7 @@ type UniformRichTextProps = {
|
|
|
938
938
|
/**
|
|
939
939
|
* Sets the value to show in Canvas editor when the parameter value is empty.
|
|
940
940
|
* Can be a static string, or a function to generate the placeholder out of parameter info.
|
|
941
|
-
* @
|
|
941
|
+
* @defaultValue undefined
|
|
942
942
|
*/
|
|
943
943
|
placeholder?: string | ((parameter: {
|
|
944
944
|
id: string;
|
|
@@ -1049,7 +1049,7 @@ type UseUniformContextualEditingStateProps = {
|
|
|
1049
1049
|
/**
|
|
1050
1050
|
* When set to true, the hook will return the global contextual state no matter where its used.
|
|
1051
1051
|
* When set to false, it will return only the state relevant to the current component (determined using `useUniformCurrentComponent`).
|
|
1052
|
-
* @
|
|
1052
|
+
* @defaultValue false
|
|
1053
1053
|
**/
|
|
1054
1054
|
global?: boolean;
|
|
1055
1055
|
};
|
package/dist/index.esm.js
CHANGED
|
@@ -260,8 +260,7 @@ var useUniformContextualEditing = ({
|
|
|
260
260
|
};
|
|
261
261
|
};
|
|
262
262
|
function getCanvasInContextEmbedScriptUrl() {
|
|
263
|
-
|
|
264
|
-
return scriptUrl;
|
|
263
|
+
return new URL("/files/canvas-in-context-embed/index.js", window.document.referrer).toString();
|
|
265
264
|
}
|
|
266
265
|
function isInContextEditingMode() {
|
|
267
266
|
if (typeof window === "undefined") {
|
|
@@ -613,13 +612,15 @@ var LinkRichTextNode = (props, context) => {
|
|
|
613
612
|
};
|
|
614
613
|
|
|
615
614
|
// src/components/UniformRichText/nodes/ListItemRichTextNode.ts
|
|
615
|
+
import { getRichTextListItemValue } from "@uniformdev/richtext";
|
|
616
616
|
import { h as h9 } from "vue";
|
|
617
617
|
var ListItemRichTextNode = (props, context) => {
|
|
618
618
|
const { value } = props.node;
|
|
619
|
+
const normalizedValue = getRichTextListItemValue(value);
|
|
619
620
|
return h9(
|
|
620
621
|
"li",
|
|
621
622
|
{
|
|
622
|
-
value: Number.isFinite(
|
|
623
|
+
value: typeof normalizedValue === "number" && Number.isFinite(normalizedValue) && normalizedValue > 0 ? normalizedValue : void 0
|
|
623
624
|
},
|
|
624
625
|
context.slots
|
|
625
626
|
);
|
package/dist/index.js
CHANGED
|
@@ -295,8 +295,7 @@ var useUniformContextualEditing = ({
|
|
|
295
295
|
};
|
|
296
296
|
};
|
|
297
297
|
function getCanvasInContextEmbedScriptUrl() {
|
|
298
|
-
|
|
299
|
-
return scriptUrl;
|
|
298
|
+
return new URL("/files/canvas-in-context-embed/index.js", window.document.referrer).toString();
|
|
300
299
|
}
|
|
301
300
|
function isInContextEditingMode() {
|
|
302
301
|
if (typeof window === "undefined") {
|
|
@@ -633,13 +632,15 @@ var LinkRichTextNode = (props, context) => {
|
|
|
633
632
|
};
|
|
634
633
|
|
|
635
634
|
// src/components/UniformRichText/nodes/ListItemRichTextNode.ts
|
|
635
|
+
var import_richtext2 = require("@uniformdev/richtext");
|
|
636
636
|
var import_vue10 = require("vue");
|
|
637
637
|
var ListItemRichTextNode = (props, context) => {
|
|
638
638
|
const { value } = props.node;
|
|
639
|
+
const normalizedValue = (0, import_richtext2.getRichTextListItemValue)(value);
|
|
639
640
|
return (0, import_vue10.h)(
|
|
640
641
|
"li",
|
|
641
642
|
{
|
|
642
|
-
value: Number.isFinite(
|
|
643
|
+
value: typeof normalizedValue === "number" && Number.isFinite(normalizedValue) && normalizedValue > 0 ? normalizedValue : void 0
|
|
643
644
|
},
|
|
644
645
|
context.slots
|
|
645
646
|
);
|
|
@@ -653,15 +654,15 @@ var ListRichTextNode = (props, context) => {
|
|
|
653
654
|
};
|
|
654
655
|
|
|
655
656
|
// src/components/UniformRichText/nodes/ParagraphRichTextNode.ts
|
|
656
|
-
var
|
|
657
|
+
var import_richtext3 = require("@uniformdev/richtext");
|
|
657
658
|
var import_vue12 = require("vue");
|
|
658
659
|
var ParagraphRichTextNode = (props, context) => {
|
|
659
660
|
const { format, direction } = props.node;
|
|
660
661
|
return (0, import_vue12.h)(
|
|
661
662
|
"p",
|
|
662
663
|
{
|
|
663
|
-
dir: (0,
|
|
664
|
-
style: (0,
|
|
664
|
+
dir: (0, import_richtext3.isPureDirection)(direction) ? direction : void 0,
|
|
665
|
+
style: (0, import_richtext3.isPureTextAlign)(format) ? { textAlign: format } : void 0
|
|
665
666
|
},
|
|
666
667
|
context.slots
|
|
667
668
|
);
|
|
@@ -680,11 +681,11 @@ var RootRichTextNode = (props, c) => {
|
|
|
680
681
|
};
|
|
681
682
|
|
|
682
683
|
// src/components/UniformRichText/nodes/TableCellRichTextNode.ts
|
|
683
|
-
var
|
|
684
|
+
var import_richtext4 = require("@uniformdev/richtext");
|
|
684
685
|
var import_vue15 = require("vue");
|
|
685
686
|
var TableCellRichTextNode = (props, context) => {
|
|
686
687
|
const { headerState } = props.node;
|
|
687
|
-
const tag = (0,
|
|
688
|
+
const tag = (0, import_richtext4.getRichTextTagFromTableCellHeaderState)(headerState);
|
|
688
689
|
return (0, import_vue15.h)(tag, {}, context.slots);
|
|
689
690
|
};
|
|
690
691
|
|
|
@@ -701,11 +702,11 @@ var TableRowRichTextNode = (_, context) => {
|
|
|
701
702
|
};
|
|
702
703
|
|
|
703
704
|
// src/components/UniformRichText/nodes/TextRichTextNode.ts
|
|
704
|
-
var
|
|
705
|
+
var import_richtext5 = require("@uniformdev/richtext");
|
|
705
706
|
var import_vue18 = require("vue");
|
|
706
707
|
var TextRichTextNode = (props) => {
|
|
707
708
|
const { format, text } = props.node;
|
|
708
|
-
const tags = (0,
|
|
709
|
+
const tags = (0, import_richtext5.getRichTextTagsFromTextFormat)(format);
|
|
709
710
|
return tags.length > 0 ? tags.reduceRight(
|
|
710
711
|
(children, tag) => {
|
|
711
712
|
return (0, import_vue18.h)(tag, null, children);
|
|
@@ -718,11 +719,11 @@ var TextRichTextNode = (props) => {
|
|
|
718
719
|
|
|
719
720
|
// src/components/UniformRichText/UniformRichText.ts
|
|
720
721
|
var import_canvas7 = require("@uniformdev/canvas");
|
|
721
|
-
var
|
|
722
|
+
var import_richtext7 = require("@uniformdev/richtext");
|
|
722
723
|
var import_vue23 = require("vue");
|
|
723
724
|
|
|
724
725
|
// src/components/UniformRichText/UniformRichTextNode.ts
|
|
725
|
-
var
|
|
726
|
+
var import_richtext6 = require("@uniformdev/richtext");
|
|
726
727
|
var import_vue22 = require("vue");
|
|
727
728
|
|
|
728
729
|
// src/components/UniformRichText/nodes/CodeRichTextNode.ts
|
|
@@ -759,7 +760,7 @@ var UniformRichTextNode = (0, import_vue22.defineComponent)({
|
|
|
759
760
|
setup(props, context) {
|
|
760
761
|
var _a;
|
|
761
762
|
const node = props.node;
|
|
762
|
-
if (!(0,
|
|
763
|
+
if (!(0, import_richtext6.isRichTextNode)(node)) return () => null;
|
|
763
764
|
let NodeRenderer = node.type in context.slots ? context.slots[node.type] : (_a = props.resolveRichTextRenderer) == null ? void 0 : _a.call(props, node);
|
|
764
765
|
if (typeof NodeRenderer === "undefined") {
|
|
765
766
|
NodeRenderer = resolveRichTextDefaultRenderer(node);
|
|
@@ -838,10 +839,10 @@ var UniformRichText = (0, import_vue23.defineComponent)({
|
|
|
838
839
|
}
|
|
839
840
|
const placeholderProp = (_b = props.placeholder) != null ? _b : contextualEditingDefaultPlaceholder;
|
|
840
841
|
const computedPlaceholder = typeof placeholderProp === "function" ? placeholderProp({ id: props.parameterId }) : placeholderProp;
|
|
841
|
-
if (!(0,
|
|
842
|
+
if (!(0, import_richtext7.isRichTextNode)(root)) {
|
|
842
843
|
return () => null;
|
|
843
844
|
}
|
|
844
|
-
if ((isContextualEditing == null ? void 0 : isContextualEditing.value) && (0,
|
|
845
|
+
if ((isContextualEditing == null ? void 0 : isContextualEditing.value) && (0, import_richtext7.isRichTextValueConsideredEmpty)(value.value)) {
|
|
845
846
|
return () => maybeWrapInTag(
|
|
846
847
|
tag,
|
|
847
848
|
{ isContextualEditing, componentId: componentData == null ? void 0 : componentData._id, parameterId: props.parameterId },
|
package/dist/index.mjs
CHANGED
|
@@ -260,8 +260,7 @@ var useUniformContextualEditing = ({
|
|
|
260
260
|
};
|
|
261
261
|
};
|
|
262
262
|
function getCanvasInContextEmbedScriptUrl() {
|
|
263
|
-
|
|
264
|
-
return scriptUrl;
|
|
263
|
+
return new URL("/files/canvas-in-context-embed/index.js", window.document.referrer).toString();
|
|
265
264
|
}
|
|
266
265
|
function isInContextEditingMode() {
|
|
267
266
|
if (typeof window === "undefined") {
|
|
@@ -613,13 +612,15 @@ var LinkRichTextNode = (props, context) => {
|
|
|
613
612
|
};
|
|
614
613
|
|
|
615
614
|
// src/components/UniformRichText/nodes/ListItemRichTextNode.ts
|
|
615
|
+
import { getRichTextListItemValue } from "@uniformdev/richtext";
|
|
616
616
|
import { h as h9 } from "vue";
|
|
617
617
|
var ListItemRichTextNode = (props, context) => {
|
|
618
618
|
const { value } = props.node;
|
|
619
|
+
const normalizedValue = getRichTextListItemValue(value);
|
|
619
620
|
return h9(
|
|
620
621
|
"li",
|
|
621
622
|
{
|
|
622
|
-
value: Number.isFinite(
|
|
623
|
+
value: typeof normalizedValue === "number" && Number.isFinite(normalizedValue) && normalizedValue > 0 ? normalizedValue : void 0
|
|
623
624
|
},
|
|
624
625
|
context.slots
|
|
625
626
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-vue",
|
|
3
|
-
"version": "20.74.
|
|
3
|
+
"version": "20.74.7-alpha.14.sha-79426f9415",
|
|
4
4
|
"description": "Vue SDK for Uniform Canvas",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"apidocs-extract": "api-extractor run --local"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@uniformdev/canvas": "20.74.
|
|
33
|
-
"@uniformdev/context-vue": "20.74.
|
|
34
|
-
"@uniformdev/richtext": "20.74.
|
|
32
|
+
"@uniformdev/canvas": "20.74.7-alpha.14.sha-79426f9415",
|
|
33
|
+
"@uniformdev/context-vue": "20.74.7-alpha.14.sha-79426f9415",
|
|
34
|
+
"@uniformdev/richtext": "20.74.7-alpha.14.sha-79426f9415"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"vue": ">=3.0.0"
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "79426f9415aefb8cf26dd8fe7a265b24a490749c"
|
|
62
62
|
}
|