@opentiny/tiny-engine-toolbar-save 2.2.0-rc.1 → 2.2.1
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.js +18 -18
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./style.css";
|
|
2
|
-
import { reactive as x, ref as P,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { reactive as x, ref as P, resolveComponent as m, createElementBlock as w, openBlock as A, createVNode as d, withCtx as r, createBlock as D, createCommentVNode as L, createTextVNode as k, createElementVNode as g, onMounted as M, onUnmounted as U } from "vue";
|
|
3
|
+
import { ToolbarBase as G, VueMonaco as J } from "@opentiny/tiny-engine-common";
|
|
4
|
+
import { Select as R, Checkbox as j, DialogBox as Y, Popover as I, Button as q } from "@opentiny/vue";
|
|
5
|
+
import { useCanvas as S, getOptions as z, useNotify as C, useLayout as F, usePage as H, getMetaApi as K, META_APP as Q, useBlock as W } from "@opentiny/tiny-engine-meta-register";
|
|
6
6
|
import { constants as B } from "@opentiny/tiny-engine-utils";
|
|
7
7
|
import { handlePageUpdate as X } from "@opentiny/tiny-engine-common/js/http";
|
|
8
8
|
const E = {
|
|
@@ -30,7 +30,7 @@ const E = {
|
|
|
30
30
|
};
|
|
31
31
|
y.value = !0, await X(e.id, { ...e, ...o }, !1, !0), y.value = !1;
|
|
32
32
|
}, T = (n) => {
|
|
33
|
-
const { pageSettingState: e, isTemporaryPage: o } =
|
|
33
|
+
const { pageSettingState: e, isTemporaryPage: o } = H(), { isBlock: t, canvasApi: i, pageState: a, resetBlockCanvasState: u, resetPageCanvasState: l } = S(), s = JSON.parse(n), { selectNode: c } = i.value;
|
|
34
34
|
if (t() ? u({ ...a, pageSchema: s }) : l({ ...a, pageSchema: s }), e != null && e.isAIPage) {
|
|
35
35
|
o.saved && (o.saved = !1), o.saved = !0;
|
|
36
36
|
const p = "page_content";
|
|
@@ -42,7 +42,7 @@ const E = {
|
|
|
42
42
|
const { isSaved: n, getSchema: e } = S();
|
|
43
43
|
if (n() || _.disabled)
|
|
44
44
|
return;
|
|
45
|
-
const { beforeSave: o, saveMethod: t, saved: i } =
|
|
45
|
+
const { beforeSave: o, saveMethod: t, saved: i } = z(E.id);
|
|
46
46
|
try {
|
|
47
47
|
if (typeof o == "function" && await o(), typeof t == "function" && await t())
|
|
48
48
|
return;
|
|
@@ -52,7 +52,7 @@ const E = {
|
|
|
52
52
|
message: `Error in saving: ${f}`
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
-
const a = (p =
|
|
55
|
+
const a = (p = F().layoutState) == null ? void 0 : p.pageStatus, u = a == null ? void 0 : a.state, l = a == null ? void 0 : a.data, s = {
|
|
56
56
|
[v.Release]: "当前页面未锁定,请先锁定再保存",
|
|
57
57
|
[v.Empty]: "当前应用无页面,请先新建页面再保存",
|
|
58
58
|
[v.Guest]: "官网演示应用不能保存页面,如需体验请切换应用",
|
|
@@ -102,13 +102,13 @@ const E = {
|
|
|
102
102
|
openCommon: N
|
|
103
103
|
}, se = {
|
|
104
104
|
components: {
|
|
105
|
-
VueMonaco:
|
|
106
|
-
TinyButton:
|
|
107
|
-
TinyPopover:
|
|
105
|
+
VueMonaco: J,
|
|
106
|
+
TinyButton: q,
|
|
107
|
+
TinyPopover: I,
|
|
108
108
|
TinyDialogBox: Y,
|
|
109
|
-
TinyCheckbox:
|
|
110
|
-
TinySelect:
|
|
111
|
-
ToolbarBase:
|
|
109
|
+
TinyCheckbox: j,
|
|
110
|
+
TinySelect: R,
|
|
111
|
+
ToolbarBase: G
|
|
112
112
|
},
|
|
113
113
|
props: {
|
|
114
114
|
iconExpand: {
|
|
@@ -152,9 +152,9 @@ const E = {
|
|
|
152
152
|
}, c = () => {
|
|
153
153
|
te(o.checked), o.checked ? s() : clearTimeout(o.preservationTime);
|
|
154
154
|
};
|
|
155
|
-
return
|
|
155
|
+
return M(() => {
|
|
156
156
|
o.checked = ee(), o.checked && s();
|
|
157
|
-
}),
|
|
157
|
+
}), U(() => {
|
|
158
158
|
clearTimeout(o.preservationTime);
|
|
159
159
|
}), {
|
|
160
160
|
state: o,
|
|
@@ -173,7 +173,7 @@ const E = {
|
|
|
173
173
|
}, ie = { class: "toolbar-save" }, le = { class: "save-style" }, re = { class: "save-time" }, ce = { class: "save-button-group" };
|
|
174
174
|
function de(n, e, o, t, i, a) {
|
|
175
175
|
const u = m("svg-icon"), l = m("tiny-checkbox"), s = m("tiny-select"), c = m("tiny-button"), p = m("tiny-popover"), f = m("vue-monaco"), O = m("tiny-dialog-box"), h = m("toolbar-base");
|
|
176
|
-
return A(),
|
|
176
|
+
return A(), w("div", ie, [
|
|
177
177
|
d(h, {
|
|
178
178
|
content: t.isLoading ? "保存中" : "保存",
|
|
179
179
|
icon: o.options.icon.default || o.options.icon,
|
|
@@ -257,7 +257,7 @@ function de(n, e, o, t, i, a) {
|
|
|
257
257
|
}, 8, ["onClick"])
|
|
258
258
|
]),
|
|
259
259
|
default: r(() => [
|
|
260
|
-
t.state.visible ? (A(),
|
|
260
|
+
t.state.visible ? (A(), D(f, {
|
|
261
261
|
key: 0,
|
|
262
262
|
ref: "editor",
|
|
263
263
|
class: "monaco-editor",
|
|
@@ -265,7 +265,7 @@ function de(n, e, o, t, i, a) {
|
|
|
265
265
|
options: t.editorOptions,
|
|
266
266
|
value: t.state.code,
|
|
267
267
|
original: t.state.originalCode
|
|
268
|
-
}, null, 8, ["options", "value", "original"])) :
|
|
268
|
+
}, null, 8, ["options", "value", "original"])) : L("", !0)
|
|
269
269
|
]),
|
|
270
270
|
_: 1
|
|
271
271
|
}, 8, ["visible"])
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/tiny-engine-toolbar-save",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"homepage": "https://opentiny.design/tiny-engine",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@opentiny/tiny-engine-common": "2.2.
|
|
29
|
-
"@opentiny/tiny-engine-meta-register": "2.2.0
|
|
30
|
-
"@opentiny/tiny-engine-utils": "2.2.0
|
|
28
|
+
"@opentiny/tiny-engine-common": "2.2.1",
|
|
29
|
+
"@opentiny/tiny-engine-meta-register": "2.2.0",
|
|
30
|
+
"@opentiny/tiny-engine-utils": "2.2.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.2.0
|
|
33
|
+
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.2.0",
|
|
34
34
|
"@vitejs/plugin-vue": "^5.1.2",
|
|
35
35
|
"@vitejs/plugin-vue-jsx": "^4.0.1",
|
|
36
36
|
"vite": "^5.4.2"
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"@opentiny/vue": "^3.14.0",
|
|
40
40
|
"vue": "^3.4.15"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "589fcf9717f4ba565ded2f2eb520d5066a53ab64"
|
|
43
43
|
}
|