@tailor-cms/ce-image-edit 2.0.0 → 2.0.2
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.cjs +7 -10
- package/dist/index.js +8 -11
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -92,6 +92,10 @@ var SideToolbar_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
92
92
|
const props = __props;
|
|
93
93
|
const emit = __emit;
|
|
94
94
|
const altText = (0, vue.ref)(props.element.data.alt || "");
|
|
95
|
+
(0, vue.watch)(() => props.element.data.alt, (value = "") => {
|
|
96
|
+
if (value === altText.value) return;
|
|
97
|
+
altText.value = value;
|
|
98
|
+
});
|
|
95
99
|
const onFocusChange = (focused) => {
|
|
96
100
|
if (focused) return;
|
|
97
101
|
emit("save", {
|
|
@@ -133,7 +137,7 @@ var TopToolbar_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
133
137
|
];
|
|
134
138
|
const props = __props;
|
|
135
139
|
const emit = __emit;
|
|
136
|
-
const
|
|
140
|
+
const save = ({ url, publicUrl }) => {
|
|
137
141
|
const assets = { url };
|
|
138
142
|
emit("save", {
|
|
139
143
|
...props.element.data,
|
|
@@ -141,13 +145,6 @@ var TopToolbar_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
141
145
|
assets
|
|
142
146
|
});
|
|
143
147
|
};
|
|
144
|
-
const onInput = (payload) => {
|
|
145
|
-
if (!payload) return;
|
|
146
|
-
emit("save", {
|
|
147
|
-
...props.element.data,
|
|
148
|
-
url: payload.publicUrl
|
|
149
|
-
});
|
|
150
|
-
};
|
|
151
148
|
const onDelete = () => {
|
|
152
149
|
emit("save", {
|
|
153
150
|
...props.element.data,
|
|
@@ -163,8 +160,8 @@ var TopToolbar_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
163
160
|
class: "mx-auto",
|
|
164
161
|
"allow-url-source": "",
|
|
165
162
|
onDelete,
|
|
166
|
-
onInput,
|
|
167
|
-
onUpload
|
|
163
|
+
onInput: save,
|
|
164
|
+
onUpload: save
|
|
168
165
|
}, null, 8, ["file-key"])]);
|
|
169
166
|
};
|
|
170
167
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createBlock, createElementBlock, createElementVNode, createVNode, defineComponent, openBlock, ref, resolveComponent, unref, withCtx } from "vue";
|
|
1
|
+
import { createBlock, createElementBlock, createElementVNode, createVNode, defineComponent, openBlock, ref, resolveComponent, unref, watch, withCtx } from "vue";
|
|
2
2
|
import './index.css';//#region ../manifest/dist/index.mjs
|
|
3
3
|
var type = "IMAGE";
|
|
4
4
|
var name = "Image";
|
|
@@ -88,6 +88,10 @@ var SideToolbar_default = /* @__PURE__ */ defineComponent({
|
|
|
88
88
|
const props = __props;
|
|
89
89
|
const emit = __emit;
|
|
90
90
|
const altText = ref(props.element.data.alt || "");
|
|
91
|
+
watch(() => props.element.data.alt, (value = "") => {
|
|
92
|
+
if (value === altText.value) return;
|
|
93
|
+
altText.value = value;
|
|
94
|
+
});
|
|
91
95
|
const onFocusChange = (focused) => {
|
|
92
96
|
if (focused) return;
|
|
93
97
|
emit("save", {
|
|
@@ -129,7 +133,7 @@ var TopToolbar_default = /* @__PURE__ */ defineComponent({
|
|
|
129
133
|
];
|
|
130
134
|
const props = __props;
|
|
131
135
|
const emit = __emit;
|
|
132
|
-
const
|
|
136
|
+
const save = ({ url, publicUrl }) => {
|
|
133
137
|
const assets = { url };
|
|
134
138
|
emit("save", {
|
|
135
139
|
...props.element.data,
|
|
@@ -137,13 +141,6 @@ var TopToolbar_default = /* @__PURE__ */ defineComponent({
|
|
|
137
141
|
assets
|
|
138
142
|
});
|
|
139
143
|
};
|
|
140
|
-
const onInput = (payload) => {
|
|
141
|
-
if (!payload) return;
|
|
142
|
-
emit("save", {
|
|
143
|
-
...props.element.data,
|
|
144
|
-
url: payload.publicUrl
|
|
145
|
-
});
|
|
146
|
-
};
|
|
147
144
|
const onDelete = () => {
|
|
148
145
|
emit("save", {
|
|
149
146
|
...props.element.data,
|
|
@@ -159,8 +156,8 @@ var TopToolbar_default = /* @__PURE__ */ defineComponent({
|
|
|
159
156
|
class: "mx-auto",
|
|
160
157
|
"allow-url-source": "",
|
|
161
158
|
onDelete,
|
|
162
|
-
onInput,
|
|
163
|
-
onUpload
|
|
159
|
+
onInput: save,
|
|
160
|
+
onUpload: save
|
|
164
161
|
}, null, 8, ["file-key"])]);
|
|
165
162
|
};
|
|
166
163
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Tailor CMS image element authoring component",
|
|
4
4
|
"author": "Studion <info@gostudion.com> (https://github.com/tailor-cms)",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"version": "2.0.
|
|
6
|
+
"version": "2.0.2",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
9
|
"import": "./dist/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
27
27
|
"vue-tsc": "^3.2.7",
|
|
28
28
|
"vuetify": "^4.0.6",
|
|
29
|
-
"@tailor-cms/ce-image-manifest": "2.0.
|
|
29
|
+
"@tailor-cms/ce-image-manifest": "2.0.2"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@tailor-cms/cek-common": "^2.0.1"
|