@tailor-cms/ce-file-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 +8 -10
- package/dist/index.js +9 -11
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -104,6 +104,11 @@ var SideToolbar_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
104
104
|
const props = __props;
|
|
105
105
|
const emit = __emit;
|
|
106
106
|
const label = (0, vue.ref)(props.element.data.label || "");
|
|
107
|
+
(0, vue.watch)(() => props.element.data.label, (value) => {
|
|
108
|
+
const next = value || "";
|
|
109
|
+
if (next === label.value) return;
|
|
110
|
+
label.value = next;
|
|
111
|
+
});
|
|
107
112
|
const onFocusChange = (focused) => {
|
|
108
113
|
if (focused) return;
|
|
109
114
|
emit("save", {
|
|
@@ -137,7 +142,7 @@ var TopToolbar_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
137
142
|
const EXTENSIONS = [];
|
|
138
143
|
const props = __props;
|
|
139
144
|
const emit = __emit;
|
|
140
|
-
const
|
|
145
|
+
const save = ({ url, publicUrl, name }) => {
|
|
141
146
|
const assets = { url };
|
|
142
147
|
emit("save", {
|
|
143
148
|
...props.element.data,
|
|
@@ -146,13 +151,6 @@ var TopToolbar_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
146
151
|
assets
|
|
147
152
|
});
|
|
148
153
|
};
|
|
149
|
-
const onInput = (payload) => {
|
|
150
|
-
if (!payload) return;
|
|
151
|
-
emit("save", {
|
|
152
|
-
...props.element.data,
|
|
153
|
-
url: payload.publicUrl
|
|
154
|
-
});
|
|
155
|
-
};
|
|
156
154
|
const onDelete = () => {
|
|
157
155
|
emit("save", {
|
|
158
156
|
...props.element.data,
|
|
@@ -168,8 +166,8 @@ var TopToolbar_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
168
166
|
class: "mx-auto",
|
|
169
167
|
"allow-url-source": "",
|
|
170
168
|
onDelete,
|
|
171
|
-
onInput,
|
|
172
|
-
onUpload
|
|
169
|
+
onInput: save,
|
|
170
|
+
onUpload: save
|
|
173
171
|
}, null, 8, ["file-key"])]);
|
|
174
172
|
};
|
|
175
173
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createBlock, createElementBlock, createTextVNode, createVNode, defineComponent, openBlock, ref, resolveComponent, toDisplayString, unref, withCtx } from "vue";
|
|
1
|
+
import { createBlock, createElementBlock, createTextVNode, createVNode, defineComponent, openBlock, ref, resolveComponent, toDisplayString, unref, watch, withCtx } from "vue";
|
|
2
2
|
import './index.css';//#region ../manifest/dist/index.mjs
|
|
3
3
|
var type = "FILE";
|
|
4
4
|
var name = "File";
|
|
@@ -100,6 +100,11 @@ var SideToolbar_default = /* @__PURE__ */ defineComponent({
|
|
|
100
100
|
const props = __props;
|
|
101
101
|
const emit = __emit;
|
|
102
102
|
const label = ref(props.element.data.label || "");
|
|
103
|
+
watch(() => props.element.data.label, (value) => {
|
|
104
|
+
const next = value || "";
|
|
105
|
+
if (next === label.value) return;
|
|
106
|
+
label.value = next;
|
|
107
|
+
});
|
|
103
108
|
const onFocusChange = (focused) => {
|
|
104
109
|
if (focused) return;
|
|
105
110
|
emit("save", {
|
|
@@ -133,7 +138,7 @@ var TopToolbar_default = /* @__PURE__ */ defineComponent({
|
|
|
133
138
|
const EXTENSIONS = [];
|
|
134
139
|
const props = __props;
|
|
135
140
|
const emit = __emit;
|
|
136
|
-
const
|
|
141
|
+
const save = ({ url, publicUrl, name }) => {
|
|
137
142
|
const assets = { url };
|
|
138
143
|
emit("save", {
|
|
139
144
|
...props.element.data,
|
|
@@ -142,13 +147,6 @@ var TopToolbar_default = /* @__PURE__ */ defineComponent({
|
|
|
142
147
|
assets
|
|
143
148
|
});
|
|
144
149
|
};
|
|
145
|
-
const onInput = (payload) => {
|
|
146
|
-
if (!payload) return;
|
|
147
|
-
emit("save", {
|
|
148
|
-
...props.element.data,
|
|
149
|
-
url: payload.publicUrl
|
|
150
|
-
});
|
|
151
|
-
};
|
|
152
150
|
const onDelete = () => {
|
|
153
151
|
emit("save", {
|
|
154
152
|
...props.element.data,
|
|
@@ -164,8 +162,8 @@ var TopToolbar_default = /* @__PURE__ */ defineComponent({
|
|
|
164
162
|
class: "mx-auto",
|
|
165
163
|
"allow-url-source": "",
|
|
166
164
|
onDelete,
|
|
167
|
-
onInput,
|
|
168
|
-
onUpload
|
|
165
|
+
onInput: save,
|
|
166
|
+
onUpload: save
|
|
169
167
|
}, null, 8, ["file-key"])]);
|
|
170
168
|
};
|
|
171
169
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Tailor CMS file 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",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
28
28
|
"vue-tsc": "^3.2.7",
|
|
29
29
|
"vuetify": "^4.0.6",
|
|
30
|
-
"@tailor-cms/ce-file-manifest": "2.0.
|
|
30
|
+
"@tailor-cms/ce-file-manifest": "2.0.2"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@tailor-cms/cek-common": "2.0.1",
|