@opentiny/tiny-engine-toolbar-save 2.5.0-alpha.6 → 2.5.0-alpha.7

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.
Files changed (2) hide show
  1. package/dist/index.js +29 -29
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -21,9 +21,9 @@ const V = {
21
21
  originalCode: "",
22
22
  disabled: !1
23
23
  }), b = h(!1), te = async (a) => {
24
- var i;
24
+ var s;
25
25
  const e = W(X.BlockManage), { getCurrentBlock: o } = Z(), t = o();
26
- t.label = a.fileName, t.content = a, b.value = !0, t.screenshot = await e.getBlockBase64(), await ((i = e.saveBlock) == null ? void 0 : i.call(e, t)), b.value = !1;
26
+ t.label = a.fileName, t.content = a, b.value = !0, t.screenshot = await e.getBlockBase64(), await ((s = e.saveBlock) == null ? void 0 : s.call(e, t)), b.value = !1;
27
27
  }, oe = async (a) => {
28
28
  const { currentPage: e } = B().pageState, o = {
29
29
  page_content: a
@@ -35,19 +35,19 @@ const V = {
35
35
  };
36
36
  await ee(t), b.value = !1;
37
37
  }, T = (a) => {
38
- const { pageSettingState: e, isTemporaryPage: o } = Q(), { isBlock: t, canvasApi: i, pageState: c, resetBlockCanvasState: r, resetPageCanvasState: l } = B(), n = JSON.parse(a), { clearSelect: s } = i.value;
39
- if (t() ? r({ ...c, pageSchema: n }) : l({ ...c, pageSchema: n }), e != null && e.isAIPage) {
38
+ const { pageSettingState: e, isTemporaryPage: o } = Q(), { isBlock: t, canvasApi: s, pageState: l, resetBlockCanvasState: r, resetPageCanvasState: i } = B(), n = JSON.parse(a), { selectNode: c } = s.value;
39
+ if (t() ? r({ ...l, pageSchema: n }) : i({ ...l, pageSchema: n }), e != null && e.isAIPage) {
40
40
  o.saved && (o.saved = !1), o.saved = !0;
41
41
  const p = "page_content";
42
42
  return e.currentPageData[p] = n, Promise.resolve();
43
43
  }
44
- return s == null || s(), t() ? te(n) : oe(n);
44
+ return c(null), t() ? te(n) : oe(n);
45
45
  }, F = async () => {
46
46
  var p;
47
47
  const { isSaved: a, getSchema: e } = B();
48
48
  if (a() || _.disabled)
49
49
  return;
50
- const { beforeSave: o, saveMethod: t, saved: i } = H(V.id);
50
+ const { beforeSave: o, saveMethod: t, saved: s } = H(V.id);
51
51
  try {
52
52
  if (typeof o == "function" && await o(), typeof t == "function" && await t())
53
53
  return;
@@ -57,11 +57,11 @@ const V = {
57
57
  message: `Error in saving: ${d}`
58
58
  });
59
59
  }
60
- const c = (p = K().layoutState) == null ? void 0 : p.pageStatus, r = c == null ? void 0 : c.state, l = c == null ? void 0 : c.data, n = {
60
+ const l = (p = K().layoutState) == null ? void 0 : p.pageStatus, r = l == null ? void 0 : l.state, i = l == null ? void 0 : l.data, n = {
61
61
  [g.Release]: "当前页面未锁定,请先锁定再保存",
62
62
  [g.Empty]: "当前应用无页面,请先新建页面再保存",
63
63
  [g.Guest]: "官网演示应用不能保存页面,如需体验请切换应用",
64
- [g.Lock]: `当前页面被 ${l == null ? void 0 : l.username} ${l == null ? void 0 : l.resetPasswordToken} 锁定,如需编辑请先联系他解锁文件,然后再锁定该页面后编辑!`
64
+ [g.Lock]: `当前页面被 ${i == null ? void 0 : i.username} ${i == null ? void 0 : i.resetPasswordToken} 锁定,如需编辑请先联系他解锁文件,然后再锁定该页面后编辑!`
65
65
  };
66
66
  if ([g.Release, g.Empty, g.Guest, g.Lock].includes(r)) {
67
67
  D({
@@ -72,11 +72,11 @@ const V = {
72
72
  return;
73
73
  }
74
74
  _.disabled = !0;
75
- const s = e();
76
- _.code = JSON.stringify(s || {}, null, 2), T(_.code).finally(() => {
77
- if (_.disabled = !1, typeof i == "function")
75
+ const c = e();
76
+ _.code = JSON.stringify(c || {}, null, 2), T(_.code).finally(() => {
77
+ if (_.disabled = !1, typeof s == "function")
78
78
  try {
79
- i();
79
+ s();
80
80
  } catch (d) {
81
81
  D({
82
82
  type: "error",
@@ -132,35 +132,35 @@ const V = {
132
132
  checked: !1,
133
133
  timeValue: 5,
134
134
  preservationTime: null
135
- }), o = h(null), { isSaved: t, setSaved: i, getSchema: c } = B(), { subscribe: r, unsubscribe: l } = $(), n = "toolbar-save", s = h(null);
135
+ }), o = h(null), { isSaved: t, setSaved: s, getSchema: l } = B(), { subscribe: r, unsubscribe: i } = $(), n = "toolbar-save", c = h(null);
136
136
  A(() => {
137
137
  r({
138
138
  topic: "pageOrBlockInit",
139
139
  subscriber: n,
140
140
  callback: (y) => {
141
- s.value = JSON.stringify(y), i(!0);
141
+ c.value = JSON.stringify(y), s(!0);
142
142
  }
143
143
  }), r({
144
144
  topic: "schemaChange",
145
145
  subscriber: n,
146
146
  callback: () => {
147
- if (s.value) {
148
- const y = JSON.stringify(c()) === s.value;
149
- i(y);
147
+ if (c.value) {
148
+ const y = JSON.stringify(l()) === c.value;
149
+ s(y);
150
150
  }
151
151
  }
152
152
  }), r({
153
153
  topic: "schemaImport",
154
154
  subscriber: n,
155
155
  callback: () => {
156
- if (s.value) {
157
- const y = JSON.stringify(c()) === s.value;
158
- i(y);
156
+ if (c.value) {
157
+ const y = JSON.stringify(l()) === c.value;
158
+ s(y);
159
159
  }
160
160
  }
161
161
  });
162
162
  }), O(() => {
163
- l({ topic: "pageOrBlockInit", subscriber: n }), l({ topic: "schemaChange", subscriber: n }), l({ topic: "schemaImport", subscriber: n });
163
+ i({ topic: "pageOrBlockInit", subscriber: n }), i({ topic: "schemaChange", subscriber: n }), i({ topic: "schemaImport", subscriber: n });
164
164
  });
165
165
  const p = () => {
166
166
  e.visible = !1, e.originalCode = "";
@@ -201,12 +201,12 @@ const V = {
201
201
  }
202
202
  }, ce = (a, e) => {
203
203
  const o = a.__vccOpts || a;
204
- for (const [t, i] of e)
205
- o[t] = i;
204
+ for (const [t, s] of e)
205
+ o[t] = s;
206
206
  return o;
207
207
  }, re = { class: "toolbar-save" }, ue = { class: "save-style" }, de = { class: "save-time" }, me = { class: "save-button-group" };
208
- function ve(a, e, o, t, i, c) {
209
- const r = f("svg-icon"), l = f("tiny-checkbox"), n = f("tiny-select"), s = f("tiny-button"), p = f("tiny-popover"), d = f("vue-monaco"), C = f("tiny-dialog-box"), E = f("toolbar-base");
208
+ function ve(a, e, o, t, s, l) {
209
+ const r = f("svg-icon"), i = f("tiny-checkbox"), n = f("tiny-select"), c = f("tiny-button"), p = f("tiny-popover"), d = f("vue-monaco"), C = f("tiny-dialog-box"), E = f("toolbar-base");
210
210
  return P(), J("div", re, [
211
211
  v(E, {
212
212
  content: t.isLoading ? "保存中" : "保存",
@@ -227,7 +227,7 @@ function ve(a, e, o, t, i, c) {
227
227
  default: u(() => [
228
228
  k("div", ue, [
229
229
  e[6] || (e[6] = k("div", { class: "save-setting" }, "保存设置", -1)),
230
- v(l, {
230
+ v(i, {
231
231
  modelValue: t.state.checked,
232
232
  "onUpdate:modelValue": e[0] || (e[0] = (m) => t.state.checked = m),
233
233
  name: "tiny-checkbox"
@@ -248,7 +248,7 @@ function ve(a, e, o, t, i, c) {
248
248
  }, null, 8, ["modelValue", "options", "disabled"])
249
249
  ]),
250
250
  k("div", me, [
251
- v(s, {
251
+ v(c, {
252
252
  type: "primary",
253
253
  onClick: t.saveConfig
254
254
  }, {
@@ -274,13 +274,13 @@ function ve(a, e, o, t, i, c) {
274
274
  "onUpdate:visible": e[2] || (e[2] = (m) => t.state.visible = m)
275
275
  }, {
276
276
  footer: u(() => [
277
- v(s, { onClick: t.close }, {
277
+ v(c, { onClick: t.close }, {
278
278
  default: u(() => e[7] || (e[7] = [
279
279
  S("取 消")
280
280
  ])),
281
281
  _: 1
282
282
  }, 8, ["onClick"]),
283
- v(s, {
283
+ v(c, {
284
284
  type: "primary",
285
285
  onClick: t.saveApi
286
286
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/tiny-engine-toolbar-save",
3
- "version": "2.5.0-alpha.6",
3
+ "version": "2.5.0-alpha.7",
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.5.0-alpha.6",
29
- "@opentiny/tiny-engine-meta-register": "2.5.0-alpha.6",
30
- "@opentiny/tiny-engine-utils": "2.5.0-alpha.6"
28
+ "@opentiny/tiny-engine-common": "2.5.0-alpha.7",
29
+ "@opentiny/tiny-engine-meta-register": "2.5.0-alpha.7",
30
+ "@opentiny/tiny-engine-utils": "2.5.0-alpha.7"
31
31
  },
32
32
  "devDependencies": {
33
- "@opentiny/tiny-engine-vite-plugin-meta-comments": "2.5.0-alpha.6",
33
+ "@opentiny/tiny-engine-vite-plugin-meta-comments": "2.5.0-alpha.7",
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.20.0",
40
40
  "vue": "^3.4.15"
41
41
  },
42
- "gitHead": "c9f5d8bfe427807cd0ef141a56b2e9c5183b0a20"
42
+ "gitHead": "bfd7dec1c4e6e40ce71649e5fb3646c1606e8c7c"
43
43
  }