@vtj/designer 0.9.5 → 0.9.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.
- package/dist/index.mjs +173 -171
- package/package.json +7 -7
- package/types/components/shared/slots.d.ts +2 -0
- package/types/framework/designer.d.ts +1 -1
- package/types/version.d.ts +2 -2
package/dist/index.mjs
CHANGED
@@ -1,30 +1,30 @@
|
|
1
1
|
var pl = Object.defineProperty;
|
2
2
|
var ml = (i, t, e) => t in i ? pl(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
3
3
|
var F = (i, t, e) => ml(i, typeof t != "symbol" ? t + "" : t, e);
|
4
|
-
import { computed as C, unref as n, ref as x, reactive as He, watchEffect as vl, watch as q, toValue as
|
5
|
-
import { ElNotification as Nt, ElMessageBox as
|
4
|
+
import { computed as C, unref as n, ref as x, reactive as He, watchEffect as vl, watch as q, toValue as Tt, defineComponent as P, openBlock as c, createElementBlock as E, toDisplayString as L, createVNode as m, withCtx as y, createElementVNode as A, createBlock as w, createCommentVNode as D, createTextVNode as U, mergeProps as ue, h as Oe, readonly as gl, getCurrentScope as fl, onScopeDispose as hl, onMounted as ht, nextTick as Ce, getCurrentInstance as fn, shallowRef as Ye, toRaw as hn, Fragment as z, renderList as W, normalizeClass as K, defineAsyncComponent as bl, resolveDynamicComponent as bn, createSlots as yl, withDirectives as Ee, vShow as Ne, renderSlot as Ve, withModifiers as Re, isRef as $t, normalizeStyle as ut, inject as Wt, provide as _l, withKeys as Ue, normalizeProps as yn, guardReactiveProps as _n, onUnmounted as wn, markRaw as Rt, createApp as kn, shallowReactive as wl, triggerRef as Te, KeepAlive as Sn } from "vue";
|
5
|
+
import { ElNotification as Nt, ElMessageBox as De, ElMessage as Pe, ElButton as te, ElDivider as bt, ElRadioGroup as xn, ElRadioButton as ct, ElButtonGroup as kl, ElImage as Cn, ElDropdown as Vn, ElDropdownMenu as An, ElDropdownItem as dt, ElInput as ye, ElEmpty as ie, ElAlert as jn, ElTooltip as En, ElTag as Dn, ElSwitch as Pn, ElTree as Mt, ElCollapse as yt, ElCollapseItem as _t, ElRow as mt, ElCol as vt, ElDrawer as In, ElForm as be, ElFormItem as Tn, ElBreadcrumb as Sl, ElBreadcrumbItem as xl, ElLoading as Cl, ElAvatar as $n, vLoading as Vl, ElSelect as Al, ElOption as jl, ElInputNumber as El, ElColorPicker as Dl, ElUpload as Pl, ElSlider as Il, ElConfigProvider as Tl, ElContainer as tn, ElHeader as $l, ElAside as nn, ElMain as Rl, ElFooter as Bl } from "element-plus";
|
6
6
|
import Ol from "element-plus/es/locale/lang/zh-cn";
|
7
|
-
import { XDialogForm as
|
8
|
-
import { jsonp as Je, groupBy as kt, dataURLtoBlob as Ll, delay as qt, upperFirstCamelCase as On, toRawType as jt, cloneDeep as lt, logger as
|
9
|
-
import { isBlock as le, DirectiveModel as zn, createNodeFrom as ql, BUILT_IN_VUE as Hl, BUILT_IN_VUE_ROUTER as Gl, BUILT_IN_NAME as
|
7
|
+
import { XDialogForm as Ae, XField as $, createDialog as Rn, XIcon as ze, XDialog as Fe, XPanel as wt, XAction as ge, XTabs as Jt, XContainer as G, XForm as Ut, XAttachment as zl, XActionBar as Fl, XInputUnit as Bn, vResizable as ln } from "@vtj/ui";
|
8
|
+
import { jsonp as Je, groupBy as kt, dataURLtoBlob as Ll, delay as qt, upperFirstCamelCase as On, toRawType as jt, cloneDeep as lt, logger as Ie, isPlainObject as Wl, fileToBase64 as Nl, merge as Ht, debounce as Ml, arrayToMap as Jl, toArray as Ul } from "@vtj/utils";
|
9
|
+
import { isBlock as le, DirectiveModel as zn, createNodeFrom as ql, BUILT_IN_VUE as Hl, BUILT_IN_VUE_ROUTER as Gl, BUILT_IN_NAME as Bt, emitter as oe, EVENT_PROJECT_ACTIVED as Ot, EVENT_NODE_CHANGE as Ze, NodeModel as an, EVENT_BLOCK_CHANGE as zt, Base as Fn, BUILT_IN_LIBRARAY_MAP as Kl, ProjectModel as Xl, EVENT_PROJECT_CHANGE as Ql, EVENT_PROJECT_BLOCKS_CHANGE as Yl, EVENT_PROJECT_PAGES_CHANGE as Zl, EVENT_PROJECT_DEPS_CHANGE as ea, EVENT_PROJECT_PUBLISH as ta, EVENT_PROJECT_FILE_PUBLISH as na, EVENT_HISTORY_CHANGE as la, EVENT_HISTORY_LOAD as aa, EVENT_PROJECT_GEN_SOURCE as sa, BlockModel as sn, HistoryModel as oa } from "@vtj/core";
|
10
10
|
import { parseExpression as et, parseFunction as ra, BUILT_IN_DIRECTIVES as ia, JSCodeToString as qe, LIFE_CYCLES_LIST as ua, DATA_TYPES as ca, createMock as da, isJSExpression as tt, ContextMode as Ln, parseDeps as pa, createAssetsCss as ma, createAssetScripts as on, getRawComponent as rn, createSchemaApis as va, mockCleanup as ga, mockApis as fa, Provider as ha, isJSFunction as ba } from "@vtj/renderer";
|
11
|
-
import { VtjIconBack as ya, VtjIconPc as _a, VtjIconPhone as wa, VtjIconPad as ka, VtjIconUndo as Sa, VtjIconRedo as xa, VtjIconTemplate as gt, VtjIconPreview as Ca, VtjIconRefresh as Wn, VtjIconSetting as Nn, Download as
|
11
|
+
import { VtjIconBack as ya, VtjIconPc as _a, VtjIconPhone as wa, VtjIconPad as ka, VtjIconUndo as Sa, VtjIconRedo as xa, VtjIconTemplate as gt, VtjIconPreview as Ca, VtjIconRefresh as Wn, VtjIconSetting as Nn, Download as Ft, VtjIconPublish as Va, VtjIconProject as Aa, icons as Lt, ArrowDown as Mn, Search as at, CopyDocument as ja, Back as Ea, VtjIconPlus as Jn, EditPen as Da, Delete as Un, VtjIconSave as Pa, ArrowUp as Ia, MoreFilled as st, VtjIconCheck as qn, VtjIconCopy as Gt, VtjIconEdit as Hn, VtjIconRemove as St, VtjIconLock as Gn, VtjIconUnlock as Ta, VtjIconInvisible as Kn, VtjIconVisible as $a, VtjIconHome as Ra, VtjIconShare as Ba, VtjIconComponents as Xn, Files as Oa, VtjIconSearch as za, VtjIconHelp as Qn, VtjIconLayers as Yn, Rank as Fa, VtjIconArrowUp as La, VtjIconArrowDown as Wa, IconDisplayBlock as Na, IconDisplayFlex as Ma, IconDisplayInlineBlock as Ja, IconDisplayInline as Ua, IconEyeInvisible as qa, IconFlexDirectionrow as Ha, IconFlexDirectionrowReverse as Ga, IconFlexDirectioncolumn as Ka, IconFlexDirectioncolumnReverse as Xa, IconFlexJustifyflexStartrow as Qa, IconFlexJustifyflexEndrow as Ya, IconFlexJustifycenterrow as Za, IconFlexJustifyspaceBetweenrow as es, IconFlexJustifyspaceAroundrow as ts, IconFlexAlignflexStartrow as ns, IconFlexAlignflexEndrow as ls, IconFlexAligncenterrow as as, IconFlexAlignbaselinerow as ss, IconFlexAlignstretchrow as os, IconPositionTopLeft as rs, IconPositionTopRight as is, IconPositionBottomLeft as us, IconPositionBottomRight as cs, IconPositionLeft as ds, IconPositionRight as ps, IconPositionTop as ms, IconPositionBottom as vs, IconPositionAll as gs, IconTextAlignLeft as fs, IconTextAlignCenter as hs, IconTextAlignRight as bs, IconTextAlignJustify as ys, IconFontStyleNone as _s, IconFontStyleItalic as ws, IconCross as Zn, IconTextDecorationUnderline as ks, IconTextDecorationStrike as Ss, IconTextDecorationOverline as xs, IconTileXy as Cs, IconTileX as Vs, IconTileY as As, IconClose as js, IconBorderAll as Es, IconBorderLeft as Ds, IconBorderTop as Ps, IconBorderBottom as Is, IconBorderRight as Ts, IconBorderStyleSolid as $s, IconBorderStyleDashed as Rs, IconBorderStyleDotted as Bs, IconCursorAuto as Os, IconCursorPointer as zs, IconCursorNotAllowed as Fs, IconCursorNone as Ls, ArrowRight as Ws, UserFilled as el, VtjIconDocument as Ns, VtjIconBlock as Ms, VtjIconOutline as Js, VtjIconHistory as Us, VtjIconApi as qs, VtjIconCategory as Hs, HomeFilled as Gs, Plus as Ks, Close as Xs, VtjIconVars as Qs, VtjIconSwitch as Ys, Switch as Zs } from "@vtj/icons";
|
12
12
|
import eo from "html2canvas";
|
13
13
|
import to from "mockjs";
|
14
14
|
/**!
|
15
15
|
* Copyright (c) 2025, VTJ.PRO All rights reserved.
|
16
16
|
* @name @vtj/designer
|
17
17
|
* @author CHC chenhuachun1549@dingtalk.com
|
18
|
-
* @version 0.9.
|
18
|
+
* @version 0.9.7
|
19
19
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
20
20
|
*/
|
21
|
-
const no = "0.9.
|
21
|
+
const no = "0.9.7", un = {
|
22
22
|
width: 390,
|
23
23
|
height: 844
|
24
24
|
}, cn = {
|
25
25
|
width: 1024,
|
26
26
|
height: 768
|
27
|
-
},
|
27
|
+
}, je = /^[A-Za-z_$][\:\w_-]*$/, lo = /(\d+)\.(\d+)\.(\d+)/, ao = [
|
28
28
|
"click",
|
29
29
|
"dblclick",
|
30
30
|
"mouseenter",
|
@@ -194,7 +194,7 @@ function Et(i, t) {
|
|
194
194
|
position: fo(t.rect, i !== "selected")
|
195
195
|
};
|
196
196
|
}
|
197
|
-
function
|
197
|
+
function xe() {
|
198
198
|
const i = ce(), t = C(
|
199
199
|
() => i.simulator.designer.value
|
200
200
|
), e = C(() => t.value?.selected.value), l = C(() => le(e.value?.model));
|
@@ -206,8 +206,8 @@ function Ce() {
|
|
206
206
|
};
|
207
207
|
}
|
208
208
|
function bo(i, t) {
|
209
|
-
const e = x(""), { selected: l, isSelectBlock: a } =
|
210
|
-
const u =
|
209
|
+
const e = x(""), { selected: l, isSelectBlock: a } = xe(), o = C(() => l.value?.model.id), s = C(() => {
|
210
|
+
const u = Tt(i), f = Tt(t), g = [];
|
211
211
|
if (!u) return g;
|
212
212
|
const v = f?.__contextRefs[o.value || ""], _ = f === v || a.value ? [] : Object.keys(v?.context || {}).filter((R) => !["context", "ref"].includes(R)).map((R) => `this.context.${R}`);
|
213
213
|
_.length && g.push({ title: "上下文", items: _ });
|
@@ -334,12 +334,12 @@ function re(i, t = "提示") {
|
|
334
334
|
});
|
335
335
|
}
|
336
336
|
async function Me(i) {
|
337
|
-
return await
|
337
|
+
return await De.confirm(i, "提示", { type: "warning" }).catch(
|
338
338
|
() => !1
|
339
339
|
);
|
340
340
|
}
|
341
341
|
function de(i, t = "success") {
|
342
|
-
return
|
342
|
+
return Pe({
|
343
343
|
message: i,
|
344
344
|
type: t
|
345
345
|
});
|
@@ -602,20 +602,20 @@ function Ao() {
|
|
602
602
|
const _ = i.current.value, d = i.project.value;
|
603
603
|
if (!d) return;
|
604
604
|
if (!_) {
|
605
|
-
|
605
|
+
Pe.warning({
|
606
606
|
message: "设计区无文件,请先打开页面或区块"
|
607
607
|
});
|
608
608
|
return;
|
609
609
|
}
|
610
610
|
const h = await o(p);
|
611
611
|
if (!h)
|
612
|
-
return await
|
612
|
+
return await De.alert("模板不可用,可能该模板没发布过版本", {
|
613
613
|
type: "error",
|
614
614
|
title: "提示"
|
615
615
|
});
|
616
616
|
const b = _.toDsl(), { id: S, name: k } = b, V = { ...h, id: S, name: k }, j = d.currentFile;
|
617
617
|
i.onSaveBlockFileFinish(() => {
|
618
|
-
_.update(V),
|
618
|
+
_.update(V), Pe.success({
|
619
619
|
message: "模板已加载完成"
|
620
620
|
});
|
621
621
|
}), j && (j.market = {
|
@@ -806,13 +806,13 @@ const jo = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!
|
|
806
806
|
});
|
807
807
|
const u = C(() => t.canvas ? t.canvas.toDataURL("image/png") : null), f = async () => {
|
808
808
|
if (!u.value)
|
809
|
-
return await
|
809
|
+
return await De.alert("截图失败,无法完成发布", {
|
810
810
|
title: "提示",
|
811
811
|
type: "error"
|
812
812
|
}), !1;
|
813
813
|
const g = Ll(u.value), { dsl: v, id: p } = t;
|
814
814
|
let _;
|
815
|
-
r.value && (_ = await
|
815
|
+
r.value && (_ = await De.confirm(
|
816
816
|
"该模板已存在,请确认您的操作是更新模板还是新建",
|
817
817
|
{
|
818
818
|
type: "warning",
|
@@ -829,14 +829,14 @@ const jo = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!
|
|
829
829
|
category: "",
|
830
830
|
version: "",
|
831
831
|
...s
|
832
|
-
}, h = await l(d).catch((b) => (
|
832
|
+
}, h = await l(d).catch((b) => (Pe.error({
|
833
833
|
message: b.message || b || "未知错误"
|
834
834
|
}), !1));
|
835
|
-
return h && (
|
835
|
+
return h && (Pe.success({
|
836
836
|
message: "发布模板成功!"
|
837
837
|
}), o.skeleton?.getWidget("Templates")?.widgetRef.refreshTemplates()), !!h;
|
838
838
|
};
|
839
|
-
return (g, v) => (c(), w(n(
|
839
|
+
return (g, v) => (c(), w(n(Ae), {
|
840
840
|
width: "600px",
|
841
841
|
height: "760px",
|
842
842
|
icon: n(gt),
|
@@ -861,7 +861,7 @@ const jo = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!
|
|
861
861
|
name: "name",
|
862
862
|
required: "",
|
863
863
|
rules: {
|
864
|
-
pattern: n(
|
864
|
+
pattern: n(je),
|
865
865
|
message: "名称格式不正确,要求英文字母大写驼峰格式"
|
866
866
|
}
|
867
867
|
}, null, 8, ["rules"]),
|
@@ -932,7 +932,7 @@ const jo = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!
|
|
932
932
|
coder: { type: Boolean, default: !1 }
|
933
933
|
},
|
934
934
|
setup(i) {
|
935
|
-
const t = i, { engine: e, designer: l } =
|
935
|
+
const t = i, { engine: e, designer: l } = xe(), { isLogined: a, toRemoteAuth: o } = xt(), s = x(!1), r = x(!1), u = x(), f = () => {
|
936
936
|
e.current.value ? (s.value ? e.skeleton?.getWidget("Previewer")?.widgetRef.refresh() : (l.value?.setSelected(null), e.simulator.refresh()), de("刷新完成", "success")) : de("请先打开文件", "warning");
|
937
937
|
}, g = async () => {
|
938
938
|
e.current.value ? (s.value && (e.skeleton?.closePreview(), s.value = !1, await qt(1e3)), l.value?.setSelected(e.current.value)) : de("请先打开文件", "warning");
|
@@ -967,7 +967,7 @@ const jo = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!
|
|
967
967
|
dsl: e.current.value?.toDsl()
|
968
968
|
}, r.value = !0;
|
969
969
|
} else
|
970
|
-
await
|
970
|
+
await De.confirm(
|
971
971
|
"发布到模板需登录系统,您还没登录或登录已过期,请重新登录!",
|
972
972
|
"提示",
|
973
973
|
{
|
@@ -998,7 +998,7 @@ const jo = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!
|
|
998
998
|
width: "600px",
|
999
999
|
height: "200px",
|
1000
1000
|
title: "出码",
|
1001
|
-
icon:
|
1001
|
+
icon: Ft,
|
1002
1002
|
content: Oe(Jo, { link: S })
|
1003
1003
|
});
|
1004
1004
|
};
|
@@ -1042,7 +1042,7 @@ const jo = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!
|
|
1042
1042
|
t.coder ? (c(), w(n(te), {
|
1043
1043
|
key: 2,
|
1044
1044
|
onClick: h,
|
1045
|
-
icon: n(
|
1045
|
+
icon: n(Ft),
|
1046
1046
|
size: "small",
|
1047
1047
|
type: "success"
|
1048
1048
|
}, {
|
@@ -1121,6 +1121,9 @@ const jo = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!
|
|
1121
1121
|
function Qt(i) {
|
1122
1122
|
return fl() ? (hl(i), !0) : !1;
|
1123
1123
|
}
|
1124
|
+
function Be(i) {
|
1125
|
+
return typeof i == "function" ? i() : n(i);
|
1126
|
+
}
|
1124
1127
|
const Ct = typeof window < "u" && typeof document < "u";
|
1125
1128
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
1126
1129
|
const Ho = Object.prototype.toString, Go = (i) => Ho.call(i) === "[object Object]", pt = () => {
|
@@ -1142,11 +1145,8 @@ function Qo(i) {
|
|
1142
1145
|
function Yo(i) {
|
1143
1146
|
return fn();
|
1144
1147
|
}
|
1145
|
-
function Lt(i) {
|
1146
|
-
return Array.isArray(i) ? i : [i];
|
1147
|
-
}
|
1148
1148
|
function Zo(i, t = !0, e) {
|
1149
|
-
Yo() ? ht(i, e) : t ? i() :
|
1149
|
+
Yo() ? ht(i, e) : t ? i() : Ce(i);
|
1150
1150
|
}
|
1151
1151
|
function er(i, t, e = {}) {
|
1152
1152
|
const {
|
@@ -1162,7 +1162,7 @@ function er(i, t, e = {}) {
|
|
1162
1162
|
function u(...f) {
|
1163
1163
|
s(), a.value = !0, o = setTimeout(() => {
|
1164
1164
|
a.value = !1, o = null, i(...f);
|
1165
|
-
},
|
1165
|
+
}, Be(t));
|
1166
1166
|
}
|
1167
1167
|
return l && (a.value = !0, Ct && u()), Qt(r), {
|
1168
1168
|
isPending: gl(a),
|
@@ -1173,18 +1173,18 @@ function er(i, t, e = {}) {
|
|
1173
1173
|
const Vt = Ct ? window : void 0, ll = Ct ? window.navigator : void 0;
|
1174
1174
|
function Se(i) {
|
1175
1175
|
var t;
|
1176
|
-
const e =
|
1176
|
+
const e = Be(i);
|
1177
1177
|
return (t = e?.$el) != null ? t : e;
|
1178
1178
|
}
|
1179
1179
|
function Qe(...i) {
|
1180
1180
|
let t, e, l, a;
|
1181
1181
|
if (typeof i[0] == "string" || Array.isArray(i[0]) ? ([e, l, a] = i, t = Vt) : [t, e, l, a] = i, !t)
|
1182
1182
|
return pt;
|
1183
|
-
e
|
1183
|
+
Array.isArray(e) || (e = [e]), Array.isArray(l) || (l = [l]);
|
1184
1184
|
const o = [], s = () => {
|
1185
1185
|
o.forEach((g) => g()), o.length = 0;
|
1186
1186
|
}, r = (g, v, p, _) => (g.addEventListener(v, p, _), () => g.removeEventListener(v, p, _)), u = q(
|
1187
|
-
() => [Se(t),
|
1187
|
+
() => [Se(t), Be(a)],
|
1188
1188
|
([g, v]) => {
|
1189
1189
|
if (s(), !g)
|
1190
1190
|
return;
|
@@ -1206,7 +1206,7 @@ function tr(i, t, e = {}) {
|
|
1206
1206
|
return pt;
|
1207
1207
|
Ko && !pn && (pn = !0, Array.from(l.document.body.children).forEach((h) => h.addEventListener("click", pt)), l.document.documentElement.addEventListener("click", pt));
|
1208
1208
|
let r = !0;
|
1209
|
-
const u = (h) =>
|
1209
|
+
const u = (h) => Be(a).some((b) => {
|
1210
1210
|
if (typeof b == "string")
|
1211
1211
|
return Array.from(l.document.querySelectorAll(b)).some((S) => S === h.target || h.composedPath().includes(S));
|
1212
1212
|
{
|
@@ -1215,11 +1215,11 @@ function tr(i, t, e = {}) {
|
|
1215
1215
|
}
|
1216
1216
|
});
|
1217
1217
|
function f(h) {
|
1218
|
-
const b =
|
1218
|
+
const b = Be(h);
|
1219
1219
|
return b && b.$.subTree.shapeFlag === 16;
|
1220
1220
|
}
|
1221
1221
|
function g(h, b) {
|
1222
|
-
const S =
|
1222
|
+
const S = Be(h), k = S.$.subTree && S.$.subTree.children;
|
1223
1223
|
return k == null || !Array.isArray(k) ? !1 : k.some((V) => V.el === b.target || b.composedPath().includes(V.el));
|
1224
1224
|
}
|
1225
1225
|
const v = (h) => {
|
@@ -1299,14 +1299,14 @@ function al(i = {}) {
|
|
1299
1299
|
source: l,
|
1300
1300
|
copiedDuring: a = 1500,
|
1301
1301
|
legacy: o = !1
|
1302
|
-
} = i, s = Yt(() => t && "clipboard" in t), r = mn("clipboard-read"), u = mn("clipboard-write"), f = C(() => s.value || o), g = x(""), v = x(!1), p = er(() => v.value = !1, a
|
1302
|
+
} = i, s = Yt(() => t && "clipboard" in t), r = mn("clipboard-read"), u = mn("clipboard-write"), f = C(() => s.value || o), g = x(""), v = x(!1), p = er(() => v.value = !1, a);
|
1303
1303
|
function _() {
|
1304
1304
|
s.value && S(r.value) ? t.clipboard.readText().then((k) => {
|
1305
1305
|
g.value = k;
|
1306
1306
|
}) : g.value = b();
|
1307
1307
|
}
|
1308
1308
|
f.value && e && Qe(["copy", "cut"], _);
|
1309
|
-
async function d(k =
|
1309
|
+
async function d(k = Be(l)) {
|
1310
1310
|
f.value && k != null && (s.value && S(u.value) ? await t.clipboard.writeText(k) : h(k), g.value = k, v.value = !0, p.start());
|
1311
1311
|
}
|
1312
1312
|
function h(k) {
|
@@ -1333,7 +1333,7 @@ function lr(i, t, e = {}) {
|
|
1333
1333
|
const s = Yt(() => l && "ResizeObserver" in l), r = () => {
|
1334
1334
|
o && (o.disconnect(), o = void 0);
|
1335
1335
|
}, u = C(() => {
|
1336
|
-
const v =
|
1336
|
+
const v = Be(i);
|
1337
1337
|
return Array.isArray(v) ? v.map((p) => Se(p)) : [Se(v)];
|
1338
1338
|
}), f = q(
|
1339
1339
|
u,
|
@@ -1368,7 +1368,7 @@ function nt(i, t = { width: 0, height: 0 }, e = {}) {
|
|
1368
1368
|
s.value = d.width, r.value = d.height;
|
1369
1369
|
}
|
1370
1370
|
} else if (p) {
|
1371
|
-
const _ =
|
1371
|
+
const _ = Array.isArray(p) ? p : [p];
|
1372
1372
|
s.value = _.reduce((d, { inlineSize: h }) => d + h, 0), r.value = _.reduce((d, { blockSize: h }) => d + h, 0);
|
1373
1373
|
} else
|
1374
1374
|
s.value = v.contentRect.width, r.value = v.contentRect.height;
|
@@ -1404,9 +1404,9 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
1404
1404
|
emits: ["change", "update:modelValue"],
|
1405
1405
|
setup(i, { emit: t }) {
|
1406
1406
|
const e = i, l = t, a = x(!1), o = x(e.modelValue), s = x(""), r = C(
|
1407
|
-
() =>
|
1407
|
+
() => Lt[e.modelValue] || e.modelValue
|
1408
1408
|
), u = C(() => {
|
1409
|
-
const _ = Object.entries(
|
1409
|
+
const _ = Object.entries(Lt);
|
1410
1410
|
return s.value ? _.filter((d) => d[0].toLowerCase().includes(s.value)) : _;
|
1411
1411
|
}), f = (_) => {
|
1412
1412
|
o.value = _;
|
@@ -1499,7 +1499,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
1499
1499
|
parentId: {}
|
1500
1500
|
},
|
1501
1501
|
setup(i) {
|
1502
|
-
const t = i, { project: e, engine: l } = Ge(), { designer: a } =
|
1502
|
+
const t = i, { project: e, engine: l } = Ge(), { designer: a } = xe(), o = C(() => t.item ? "编辑页面" : "新增页面"), s = () => ({
|
1503
1503
|
dir: !1,
|
1504
1504
|
name: "",
|
1505
1505
|
title: "",
|
@@ -1527,11 +1527,11 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
1527
1527
|
], g = (d) => {
|
1528
1528
|
r.value && (r.value.name = On(d));
|
1529
1529
|
}, v = async (d) => e.value?.existPageName(d.name, [d.id]) ? (re("页面名称已存在,请更换"), !1) : (t.item ? (e.value?.updatePage(d), a.value?.setSelected(null), l.simulator.refresh()) : e.value?.createPage(d, t.parentId), !0), { copy: p } = al({}), _ = (d) => {
|
1530
|
-
p(d),
|
1530
|
+
p(d), Pe.success({
|
1531
1531
|
message: "已经复制到粘贴板"
|
1532
1532
|
});
|
1533
1533
|
};
|
1534
|
-
return (d, h) => (c(), w(n(
|
1534
|
+
return (d, h) => (c(), w(n(Ae), {
|
1535
1535
|
title: o.value,
|
1536
1536
|
width: "800px",
|
1537
1537
|
height: "700px",
|
@@ -1575,7 +1575,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
1575
1575
|
label: "名称",
|
1576
1576
|
required: "",
|
1577
1577
|
onChange: g,
|
1578
|
-
rules: { pattern: n(
|
1578
|
+
rules: { pattern: n(je), message: "名称格式不正确" }
|
1579
1579
|
}, null, 8, ["rules"]),
|
1580
1580
|
m(n($), {
|
1581
1581
|
name: "title",
|
@@ -1799,7 +1799,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
1799
1799
|
title: "保存",
|
1800
1800
|
onClick: v
|
1801
1801
|
}, null, 8, ["size", "icon"])) : D("", !0),
|
1802
|
-
e.collapsable ?
|
1802
|
+
e.collapsable ? Ee((c(), w(n(ge), {
|
1803
1803
|
key: 5,
|
1804
1804
|
size: h.$attrs.size,
|
1805
1805
|
mode: "icon",
|
@@ -1810,7 +1810,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
1810
1810
|
}, null, 8, ["size", "icon"])), [
|
1811
1811
|
[Ne, a.value]
|
1812
1812
|
]) : D("", !0),
|
1813
|
-
e.collapsable ?
|
1813
|
+
e.collapsable ? Ee((c(), w(n(ge), {
|
1814
1814
|
key: 6,
|
1815
1815
|
size: h.$attrs.size,
|
1816
1816
|
mode: "icon",
|
@@ -1821,17 +1821,17 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
1821
1821
|
}, null, 8, ["size", "icon"])), [
|
1822
1822
|
[Ne, !a.value]
|
1823
1823
|
]) : D("", !0),
|
1824
|
-
|
1824
|
+
Ve(h.$slots, "actions")
|
1825
1825
|
]),
|
1826
1826
|
default: y(() => [
|
1827
|
-
|
1827
|
+
Ve(h.$slots, "default")
|
1828
1828
|
]),
|
1829
1829
|
_: 2
|
1830
1830
|
}, [
|
1831
1831
|
h.$slots.footer ? {
|
1832
1832
|
name: "footer",
|
1833
1833
|
fn: y(() => [
|
1834
|
-
|
1834
|
+
Ve(h.$slots, "footer")
|
1835
1835
|
]),
|
1836
1836
|
key: "0"
|
1837
1837
|
} : void 0
|
@@ -1924,7 +1924,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
1924
1924
|
])
|
1925
1925
|
]),
|
1926
1926
|
default: y(() => [
|
1927
|
-
|
1927
|
+
Ve(u.$slots, "default")
|
1928
1928
|
]),
|
1929
1929
|
_: 3
|
1930
1930
|
}));
|
@@ -2026,7 +2026,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
2026
2026
|
})), f = () => {
|
2027
2027
|
a("click", l.modelValue);
|
2028
2028
|
}, g = async (p) => {
|
2029
|
-
p === "remove" ? await
|
2029
|
+
p === "remove" ? await De.confirm("确定删除吗?", "提示", {
|
2030
2030
|
type: "warning"
|
2031
2031
|
}).catch(() => !1) && a("action", {
|
2032
2032
|
name: p,
|
@@ -2057,7 +2057,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
2057
2057
|
align: "center"
|
2058
2058
|
}, {
|
2059
2059
|
default: y(() => [
|
2060
|
-
|
2060
|
+
Ve(p.$slots, "default", {}, () => [
|
2061
2061
|
p.icon ? (c(), w(n(ze), {
|
2062
2062
|
key: 0,
|
2063
2063
|
icon: p.icon
|
@@ -2088,13 +2088,13 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
2088
2088
|
}),
|
2089
2089
|
m(n(G), {
|
2090
2090
|
class: "v-item__wrapper",
|
2091
|
-
onClick: _[2] || (_[2] =
|
2091
|
+
onClick: _[2] || (_[2] = Re(() => {
|
2092
2092
|
}, ["stop"]))
|
2093
2093
|
}, {
|
2094
2094
|
default: y(() => [
|
2095
2095
|
m(n(G), {
|
2096
2096
|
class: "v-item__actions",
|
2097
|
-
onClick: _[1] || (_[1] =
|
2097
|
+
onClick: _[1] || (_[1] = Re(() => {
|
2098
2098
|
}, ["stop"]))
|
2099
2099
|
}, {
|
2100
2100
|
default: y(() => [
|
@@ -2115,7 +2115,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
2115
2115
|
class: "v-item__switch",
|
2116
2116
|
size: "small"
|
2117
2117
|
}, null, 8, ["modelValue"])) : D("", !0),
|
2118
|
-
|
2118
|
+
Ve(p.$slots, "status")
|
2119
2119
|
]),
|
2120
2120
|
_: 3
|
2121
2121
|
}),
|
@@ -2172,7 +2172,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
2172
2172
|
}, s = () => {
|
2173
2173
|
l("copy");
|
2174
2174
|
}, r = async () => {
|
2175
|
-
await
|
2175
|
+
await De.confirm("确认删除?", "提示", {
|
2176
2176
|
type: "warning"
|
2177
2177
|
}).catch(() => !1) && l("remove");
|
2178
2178
|
}, u = (p) => {
|
@@ -2197,7 +2197,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
2197
2197
|
align: "center"
|
2198
2198
|
}, {
|
2199
2199
|
default: y(() => [
|
2200
|
-
|
2200
|
+
Ve(p.$slots, "default", {}, () => [
|
2201
2201
|
A("span", vr, L(e.name), 1),
|
2202
2202
|
A("span", gr, L(e.title), 1)
|
2203
2203
|
])
|
@@ -2339,7 +2339,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
2339
2339
|
}, h = (S) => {
|
2340
2340
|
l("pick", S);
|
2341
2341
|
}, b = (S) => {
|
2342
|
-
s(S),
|
2342
|
+
s(S), Pe.success({
|
2343
2343
|
message: "已经复制到粘贴板"
|
2344
2344
|
});
|
2345
2345
|
};
|
@@ -2381,10 +2381,10 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
2381
2381
|
flex: !1
|
2382
2382
|
}, {
|
2383
2383
|
default: y(() => [
|
2384
|
-
|
2384
|
+
Ee(A("div", null, [
|
2385
2385
|
m(n(ye), {
|
2386
2386
|
modelValue: n(o),
|
2387
|
-
"onUpdate:modelValue": k[0] || (k[0] = (V) =>
|
2387
|
+
"onUpdate:modelValue": k[0] || (k[0] = (V) => $t(o) ? o.value = V : null),
|
2388
2388
|
size: "small",
|
2389
2389
|
clearable: "",
|
2390
2390
|
"prefix-icon": n(at),
|
@@ -2410,7 +2410,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
2410
2410
|
], 512), [
|
2411
2411
|
[Ne, u.value === "normal"]
|
2412
2412
|
]),
|
2413
|
-
|
2413
|
+
Ee(m(hr, {
|
2414
2414
|
context: e.context,
|
2415
2415
|
onCopy: b,
|
2416
2416
|
onPick: h
|
@@ -2492,7 +2492,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
2492
2492
|
"submit-method": g
|
2493
2493
|
}, {
|
2494
2494
|
default: y(() => [
|
2495
|
-
|
2495
|
+
Ve(S.$slots, "default")
|
2496
2496
|
]),
|
2497
2497
|
_: 3
|
2498
2498
|
}, 8, ["model", "rules"])
|
@@ -2509,6 +2509,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
2509
2509
|
}), br = { class: "v-slots-picker__sn" }, yr = /* @__PURE__ */ P({
|
2510
2510
|
__name: "slots",
|
2511
2511
|
props: {
|
2512
|
+
name: { default: "" },
|
2512
2513
|
slots: { default: () => [] }
|
2513
2514
|
},
|
2514
2515
|
emits: ["submit", "update:modelValue"],
|
@@ -2520,7 +2521,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
2520
2521
|
};
|
2521
2522
|
return (u, f) => (c(), w(n(Fe), ue({
|
2522
2523
|
class: "v-slots-picker",
|
2523
|
-
title:
|
2524
|
+
title: `选择插槽: ${e.name}`,
|
2524
2525
|
width: "600px",
|
2525
2526
|
height: o.value,
|
2526
2527
|
submit: "",
|
@@ -2529,10 +2530,10 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
2529
2530
|
}, u.$attrs), {
|
2530
2531
|
default: y(() => [
|
2531
2532
|
m(n(jn), {
|
2532
|
-
title:
|
2533
|
+
title: `${e.name} 组件支持多个插槽,请选择放置到其中一个`,
|
2533
2534
|
type: "warning",
|
2534
2535
|
closable: !1
|
2535
|
-
}),
|
2536
|
+
}, null, 8, ["title"]),
|
2536
2537
|
m(n(G), {
|
2537
2538
|
class: "v-slots-picker__content",
|
2538
2539
|
justify: "space-around",
|
@@ -2558,7 +2559,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
2558
2559
|
})
|
2559
2560
|
]),
|
2560
2561
|
_: 1
|
2561
|
-
}, 16, ["height"]));
|
2562
|
+
}, 16, ["title", "height"]));
|
2562
2563
|
}
|
2563
2564
|
}), ol = /* @__PURE__ */ P({
|
2564
2565
|
name: "Viewport",
|
@@ -2588,7 +2589,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
2588
2589
|
class: K(["v-viewport", e.value]),
|
2589
2590
|
style: ut(a.value)
|
2590
2591
|
}, [
|
2591
|
-
|
2592
|
+
Ve(o.$slots, "default")
|
2592
2593
|
], 6));
|
2593
2594
|
}
|
2594
2595
|
}), _r = /* @__PURE__ */ P({
|
@@ -2642,7 +2643,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
2642
2643
|
}
|
2643
2644
|
}, _ = (h, b, S) => S === "inner" ? !!b.data.dir : !0, d = () => {
|
2644
2645
|
t.value?.update({
|
2645
|
-
pages:
|
2646
|
+
pages: Tt(l)
|
2646
2647
|
});
|
2647
2648
|
};
|
2648
2649
|
return (h, b) => (c(), w(n(J), {
|
@@ -2664,7 +2665,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
2664
2665
|
default: y(({ data: S, node: k }) => [
|
2665
2666
|
m(n(ve), {
|
2666
2667
|
class: "v-pages-widget__item",
|
2667
|
-
icon: n(
|
2668
|
+
icon: n(Lt)[S.icon],
|
2668
2669
|
title: S.title,
|
2669
2670
|
subtitle: S.name,
|
2670
2671
|
"model-value": { data: S, node: k },
|
@@ -2946,7 +2947,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
2946
2947
|
key: 0,
|
2947
2948
|
description: "找不到符合条件的区块"
|
2948
2949
|
})),
|
2949
|
-
m(n(
|
2950
|
+
m(n(Ae), {
|
2950
2951
|
modelValue: d.value,
|
2951
2952
|
"onUpdate:modelValue": Y[1] || (Y[1] = (se) => d.value = se),
|
2952
2953
|
title: h.value,
|
@@ -2972,7 +2973,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
2972
2973
|
tip: "名称为英文驼峰格式",
|
2973
2974
|
rules: {
|
2974
2975
|
message: "名称格式错误",
|
2975
|
-
pattern: n(
|
2976
|
+
pattern: n(je)
|
2976
2977
|
},
|
2977
2978
|
onChange: Q
|
2978
2979
|
}, null, 8, ["rules"]),
|
@@ -3032,7 +3033,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
3032
3033
|
A("div", Cr, [
|
3033
3034
|
m(n(ye), {
|
3034
3035
|
modelValue: n(r),
|
3035
|
-
"onUpdate:modelValue": p[0] || (p[0] = (_) =>
|
3036
|
+
"onUpdate:modelValue": p[0] || (p[0] = (_) => $t(r) ? r.value = _ : null),
|
3036
3037
|
placeholder: "搜索组件",
|
3037
3038
|
clearable: "",
|
3038
3039
|
size: "small"
|
@@ -3072,7 +3073,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
3072
3073
|
key: 1,
|
3073
3074
|
items: n(l),
|
3074
3075
|
modelValue: n(a),
|
3075
|
-
"onUpdate:modelValue": p[2] || (p[2] = (_) =>
|
3076
|
+
"onUpdate:modelValue": p[2] || (p[2] = (_) => $t(a) ? a.value = _ : null)
|
3076
3077
|
}, {
|
3077
3078
|
default: y(() => [
|
3078
3079
|
A("div", Ar, [
|
@@ -3130,7 +3131,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
3130
3131
|
name: "OutlineWidget",
|
3131
3132
|
__name: "index",
|
3132
3133
|
setup(i) {
|
3133
|
-
const { engine: t, designer: e, selected: l } =
|
3134
|
+
const { engine: t, designer: e, selected: l } = xe(), { current: a } = me(), o = x([]), s = (I, T) => {
|
3134
3135
|
if (T === "slot") return [];
|
3135
3136
|
if (le(I))
|
3136
3137
|
return I.locked ? ["unlock"] : ["lock"];
|
@@ -3179,7 +3180,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
3179
3180
|
}
|
3180
3181
|
];
|
3181
3182
|
}, g = async () => {
|
3182
|
-
o.value = f(), l.value?.model && (await
|
3183
|
+
o.value = f(), l.value?.model && (await Ce(), e.value?.setSelected(l.value.model));
|
3183
3184
|
}, v = C(() => l.value?.model.id), p = (I) => {
|
3184
3185
|
const T = I.data;
|
3185
3186
|
if (T.type === "slot" || le(T.model) || T.model.locked || T.model.name === "template")
|
@@ -3219,7 +3220,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
3219
3220
|
N,
|
3220
3221
|
H
|
3221
3222
|
)) {
|
3222
|
-
e.value?.setDropping(null), g(),
|
3223
|
+
e.value?.setDropping(null), g(), Pe.warning({
|
3223
3224
|
message: `${Q.model.name}不能放置到该位置`
|
3224
3225
|
}), e.value?.setDragging(null);
|
3225
3226
|
return;
|
@@ -3391,7 +3392,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
3391
3392
|
name: "name",
|
3392
3393
|
label: "接口名称",
|
3393
3394
|
required: "",
|
3394
|
-
rules: { pattern: n(
|
3395
|
+
rules: { pattern: n(je), message: "名称格式不正确" }
|
3395
3396
|
}, null, 8, ["rules"]),
|
3396
3397
|
m(n($), {
|
3397
3398
|
name: "label",
|
@@ -3596,7 +3597,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
3596
3597
|
}
|
3597
3598
|
), q(l, async () => {
|
3598
3599
|
o.value?.formRef.validate(async (h) => {
|
3599
|
-
h || (await
|
3600
|
+
h || (await Ce(), l.value = "base");
|
3600
3601
|
});
|
3601
3602
|
});
|
3602
3603
|
const v = () => {
|
@@ -3703,7 +3704,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
3703
3704
|
submitMethod: _
|
3704
3705
|
}, {
|
3705
3706
|
default: y(() => [
|
3706
|
-
|
3707
|
+
Ee(m(Pr, { categories: h.categories }, null, 8, ["categories"]), [
|
3707
3708
|
[Ne, l.value === "base"]
|
3708
3709
|
]),
|
3709
3710
|
l.value === "settings" ? (c(), E("div", Rr, [
|
@@ -3898,7 +3899,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
3898
3899
|
onClick: (S) => p(b),
|
3899
3900
|
onAction: (S) => _(b, S)
|
3900
3901
|
}, null, 8, ["title", "subtitle", "actions", "switch", "modelValue", "onUpdate:modelValue", "onSwitch", "onClick", "onAction"]))), 128)),
|
3901
|
-
m(n(
|
3902
|
+
m(n(Ae), {
|
3902
3903
|
modelValue: l.value,
|
3903
3904
|
"onUpdate:modelValue": h[1] || (h[1] = (b) => l.value = b),
|
3904
3905
|
width: "600px",
|
@@ -3934,7 +3935,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
3934
3935
|
editor: "textarea",
|
3935
3936
|
props: { rows: 3 },
|
3936
3937
|
tip: "多个资源可以换行输入",
|
3937
|
-
onKeyup: h[0] || (h[0] = Ue(
|
3938
|
+
onKeyup: h[0] || (h[0] = Ue(Re(() => {
|
3938
3939
|
}, ["stop"]), ["enter"])),
|
3939
3940
|
required: ""
|
3940
3941
|
}),
|
@@ -4202,7 +4203,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
4202
4203
|
onPick: g
|
4203
4204
|
}, {
|
4204
4205
|
default: y(() => [
|
4205
|
-
|
4206
|
+
Ve(d.$slots, "fields", yn(_n({ model: o.value, isEdit: s.value, nameLabel: d.nameLabel, valueLabel: d.valueLabel })), () => [
|
4206
4207
|
m(n($), {
|
4207
4208
|
name: "name",
|
4208
4209
|
label: d.nameLabel,
|
@@ -4561,7 +4562,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
4561
4562
|
size: "small",
|
4562
4563
|
"label-position": "right",
|
4563
4564
|
"label-width": r.value,
|
4564
|
-
onKeydown: f[0] || (f[0] = Ue(
|
4565
|
+
onKeydown: f[0] || (f[0] = Ue(Re(() => {
|
4565
4566
|
}, ["prevent", "stop"]), ["enter"]))
|
4566
4567
|
}, {
|
4567
4568
|
default: y(() => [
|
@@ -4584,7 +4585,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
4584
4585
|
name: "PropertiesWidget",
|
4585
4586
|
__name: "index",
|
4586
4587
|
setup(i) {
|
4587
|
-
const { current: t, context: e } = me(), { selected: l } =
|
4588
|
+
const { current: t, context: e } = me(), { selected: l } = xe(), {
|
4588
4589
|
node: a,
|
4589
4590
|
commonProps: o,
|
4590
4591
|
change: s,
|
@@ -4642,7 +4643,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
4642
4643
|
onPlus: d,
|
4643
4644
|
onRemove: b
|
4644
4645
|
}, null, 8, ["current", "context", "node", "items", "onChange"])) : D("", !0),
|
4645
|
-
m(n(
|
4646
|
+
m(n(Ae), {
|
4646
4647
|
modelValue: p.value,
|
4647
4648
|
"onUpdate:modelValue": k[0] || (k[0] = (V) => p.value = V),
|
4648
4649
|
title: "新增自定义属性",
|
@@ -4659,7 +4660,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
4659
4660
|
required: "",
|
4660
4661
|
rules: {
|
4661
4662
|
message: "名称格式错误",
|
4662
|
-
pattern: n(
|
4663
|
+
pattern: n(je)
|
4663
4664
|
}
|
4664
4665
|
}, null, 8, ["rules"])
|
4665
4666
|
]),
|
@@ -4780,7 +4781,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
4780
4781
|
name: "EventsWidget",
|
4781
4782
|
__name: "index",
|
4782
4783
|
setup(i) {
|
4783
|
-
const { current: t, context: e } = me(), { selected: l } =
|
4784
|
+
const { current: t, context: e } = me(), { selected: l } = xe(), { mouseEventList: a, keyboardEventList: o, componentEventList: s } = ko(l), r = x({
|
4784
4785
|
name: "",
|
4785
4786
|
event: void 0
|
4786
4787
|
}), u = x(!1), f = (d) => {
|
@@ -4926,7 +4927,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
4926
4927
|
name: "DirectivesWidget",
|
4927
4928
|
__name: "index",
|
4928
4929
|
setup(i) {
|
4929
|
-
const { current: t, context: e } = me(), { selected: l } =
|
4930
|
+
const { current: t, context: e } = me(), { selected: l } = xe(), {
|
4930
4931
|
vIf: a,
|
4931
4932
|
vShow: o,
|
4932
4933
|
vBind: s,
|
@@ -4957,7 +4958,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
4957
4958
|
m(n(be), {
|
4958
4959
|
size: "small",
|
4959
4960
|
"label-width": "80px",
|
4960
|
-
onKeydown: V[0] || (V[0] = Ue(
|
4961
|
+
onKeydown: V[0] || (V[0] = Ue(Re(() => {
|
4961
4962
|
}, ["prevent", "stop"]), ["enter"]))
|
4962
4963
|
}, {
|
4963
4964
|
default: y(() => [
|
@@ -5013,7 +5014,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
5013
5014
|
m(n(be), {
|
5014
5015
|
size: "small",
|
5015
5016
|
"label-width": "80px",
|
5016
|
-
onKeydown: V[1] || (V[1] = Ue(
|
5017
|
+
onKeydown: V[1] || (V[1] = Ue(Re(() => {
|
5017
5018
|
}, ["prevent", "stop"]), ["enter"]))
|
5018
5019
|
}, {
|
5019
5020
|
default: y(() => [
|
@@ -5076,7 +5077,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
5076
5077
|
m(n(be), {
|
5077
5078
|
size: "small",
|
5078
5079
|
"label-width": "60px",
|
5079
|
-
onKeydown: V[2] || (V[2] = Ue(
|
5080
|
+
onKeydown: V[2] || (V[2] = Ue(Re(() => {
|
5080
5081
|
}, ["prevent", "stop"]), ["enter"]))
|
5081
5082
|
}, {
|
5082
5083
|
default: y(() => [
|
@@ -5129,7 +5130,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
5129
5130
|
m(n(be), {
|
5130
5131
|
size: "small",
|
5131
5132
|
"label-width": "60px",
|
5132
|
-
onKeydown: V[3] || (V[3] = Ue(
|
5133
|
+
onKeydown: V[3] || (V[3] = Ue(Re(() => {
|
5133
5134
|
}, ["prevent", "stop"]), ["enter"]))
|
5134
5135
|
}, {
|
5135
5136
|
default: y(() => [
|
@@ -5209,7 +5210,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
5209
5210
|
const r = s.default;
|
5210
5211
|
return r && !pe(r, t.context, !0) ? !1 : (t.current.setProp(s), !0);
|
5211
5212
|
};
|
5212
|
-
return (s, r) => (c(), w(n(
|
5213
|
+
return (s, r) => (c(), w(n(Ae), {
|
5213
5214
|
title: e.value,
|
5214
5215
|
width: "800px",
|
5215
5216
|
height: "500px",
|
@@ -5226,7 +5227,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
5226
5227
|
disabled: !!t.item,
|
5227
5228
|
rules: {
|
5228
5229
|
message: "名称格式错误",
|
5229
|
-
pattern: n(
|
5230
|
+
pattern: n(je)
|
5230
5231
|
}
|
5231
5232
|
}, null, 8, ["disabled", "rules"]),
|
5232
5233
|
m(n($), {
|
@@ -5271,7 +5272,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
5271
5272
|
},
|
5272
5273
|
setup(i) {
|
5273
5274
|
const t = i, e = C(() => t.item ? "编辑定义事件" : "新增定义事件"), l = x(t.item), a = async (o) => (t.item && t.current.removeEmit(t.item.name, !0), t.current.setEmit(o), !0);
|
5274
|
-
return (o, s) => (c(), w(n(
|
5275
|
+
return (o, s) => (c(), w(n(Ae), {
|
5275
5276
|
title: e.value,
|
5276
5277
|
width: "600px",
|
5277
5278
|
height: "200px",
|
@@ -5287,7 +5288,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
5287
5288
|
disabled: !!t.item,
|
5288
5289
|
rules: {
|
5289
5290
|
message: "名称格式错误",
|
5290
|
-
pattern: n(
|
5291
|
+
pattern: n(je)
|
5291
5292
|
}
|
5292
5293
|
}, null, 8, ["disabled", "rules"]),
|
5293
5294
|
m(n($), {
|
@@ -5323,7 +5324,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
5323
5324
|
},
|
5324
5325
|
setup(i) {
|
5325
5326
|
const t = i, e = C(() => t.item ? "编辑定义插槽" : "新增定义插槽"), l = x(t.item), a = async (o) => (t.item && t.current.removeSlot(t.item.name, !0), t.current.setSlot(o), !0);
|
5326
|
-
return (o, s) => (c(), w(n(
|
5327
|
+
return (o, s) => (c(), w(n(Ae), {
|
5327
5328
|
title: e.value,
|
5328
5329
|
width: "600px",
|
5329
5330
|
height: "200px",
|
@@ -5339,7 +5340,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
5339
5340
|
required: "",
|
5340
5341
|
rules: {
|
5341
5342
|
message: "名称格式错误",
|
5342
|
-
pattern: n(
|
5343
|
+
pattern: n(je)
|
5343
5344
|
}
|
5344
5345
|
}, null, 8, ["disabled", "rules"]),
|
5345
5346
|
m(n($), {
|
@@ -5387,7 +5388,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
5387
5388
|
const s = o.default;
|
5388
5389
|
return s && !pe(s, t.context, !0) ? !1 : (t.current.setInject(o), !0);
|
5389
5390
|
};
|
5390
|
-
return (o, s) => (c(), w(n(
|
5391
|
+
return (o, s) => (c(), w(n(Ae), {
|
5391
5392
|
title: e.value,
|
5392
5393
|
width: "800px",
|
5393
5394
|
height: "500px",
|
@@ -5404,7 +5405,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
5404
5405
|
disabled: !!t.item,
|
5405
5406
|
rules: {
|
5406
5407
|
message: "名称格式错误",
|
5407
|
-
pattern: n(
|
5408
|
+
pattern: n(je)
|
5408
5409
|
}
|
5409
5410
|
}, null, 8, ["disabled", "rules"]),
|
5410
5411
|
m(n($), {
|
@@ -5719,7 +5720,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
5719
5720
|
let T = t.context?.$apis[s.value.ref];
|
5720
5721
|
if (T)
|
5721
5722
|
return await T.apply(T, I);
|
5722
|
-
|
5723
|
+
Ie.warn(`API【${s.value.ref}】不存在`);
|
5723
5724
|
}
|
5724
5725
|
}, j = et(s.value.test, {
|
5725
5726
|
runApi: V
|
@@ -5729,11 +5730,11 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
5729
5730
|
const I = await j();
|
5730
5731
|
u.value = JSON.stringify(await R(I), null, 2);
|
5731
5732
|
} catch (I) {
|
5732
|
-
|
5733
|
+
Ie.error(I);
|
5733
5734
|
}
|
5734
5735
|
r.value = !1, f.value = !0;
|
5735
5736
|
};
|
5736
|
-
return (k, V) => (c(), w(n(
|
5737
|
+
return (k, V) => (c(), w(n(Ae), {
|
5737
5738
|
width: "1000px",
|
5738
5739
|
height: "700px",
|
5739
5740
|
title: v.value,
|
@@ -5789,7 +5790,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
5789
5790
|
disabled: !!t.item,
|
5790
5791
|
rules: {
|
5791
5792
|
message: "名称格式错误",
|
5792
|
-
pattern: n(
|
5793
|
+
pattern: n(je)
|
5793
5794
|
}
|
5794
5795
|
}, null, 8, ["disabled", "rules"]),
|
5795
5796
|
m(n($), {
|
@@ -6133,7 +6134,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
6133
6134
|
name: "StyleWidget",
|
6134
6135
|
__name: "JsonMode",
|
6135
6136
|
setup(i) {
|
6136
|
-
const { selected: t } =
|
6137
|
+
const { selected: t } = xe(), e = x(), l = C(() => {
|
6137
6138
|
const r = t.value?.model || null;
|
6138
6139
|
return le(r) ? null : r;
|
6139
6140
|
}), a = C(
|
@@ -7443,7 +7444,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
7443
7444
|
isStyleCodeMode: { type: Boolean }
|
7444
7445
|
},
|
7445
7446
|
setup(i) {
|
7446
|
-
const t = i, { selected: e } =
|
7447
|
+
const t = i, { selected: e } = xe(), l = C(() => {
|
7447
7448
|
const s = e.value?.model || null;
|
7448
7449
|
return le(s) ? null : s;
|
7449
7450
|
}), a = C(
|
@@ -7543,7 +7544,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
7543
7544
|
inheritAttrs: !1,
|
7544
7545
|
__name: "index",
|
7545
7546
|
setup(i) {
|
7546
|
-
const { selected: t, designer: e } =
|
7547
|
+
const { selected: t, designer: e } = xe(), l = C(() => (t.value?.path || []).slice(0).reverse()), a = (s) => {
|
7547
7548
|
e.value?.setSelected(s);
|
7548
7549
|
}, o = (s) => {
|
7549
7550
|
e.value?.setHover(s);
|
@@ -7840,7 +7841,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
7840
7841
|
const V = r?.getData()?.id;
|
7841
7842
|
return kt(p.value, (j) => j.userId === V ? "我的" : j.category);
|
7842
7843
|
}), d = C(() => Object.keys(_.value)), h = C(() => `(共 ${l.value.length} 个)`), b = async (V) => {
|
7843
|
-
await o() ? await s(V.id) : await
|
7844
|
+
await o() ? await s(V.id) : await De.confirm(
|
7844
7845
|
"使用模版需登录,您还没登录或已过期,请重新登录!",
|
7845
7846
|
"提示",
|
7846
7847
|
{
|
@@ -7849,13 +7850,13 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
7849
7850
|
}
|
7850
7851
|
).catch(() => !1) && a();
|
7851
7852
|
}, S = (V) => V.share ? !1 : V.userId === r?.getData()?.id, k = async (V) => {
|
7852
|
-
await
|
7853
|
+
await De.confirm("确定删除该模版?", "提示", {
|
7853
7854
|
type: "warning"
|
7854
7855
|
}).catch(() => !1) && (await g(V.id), u());
|
7855
7856
|
};
|
7856
7857
|
return t({
|
7857
7858
|
refreshTemplates: u
|
7858
|
-
}), (V, j) =>
|
7859
|
+
}), (V, j) => Ee((c(), w(n(J), {
|
7859
7860
|
class: "v-blocks-widget v-templates-widgets",
|
7860
7861
|
title: "模板",
|
7861
7862
|
subtitle: h.value,
|
@@ -7932,7 +7933,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
7932
7933
|
A("div", Du, [
|
7933
7934
|
m(n(te), {
|
7934
7935
|
class: "v-templates-widgets__download",
|
7935
|
-
icon: n(
|
7936
|
+
icon: n(Ft),
|
7936
7937
|
type: "primary",
|
7937
7938
|
round: "",
|
7938
7939
|
onClick: (O) => b(T)
|
@@ -8169,7 +8170,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
8169
8170
|
label: "帮助中心",
|
8170
8171
|
actions: [
|
8171
8172
|
{
|
8172
|
-
icon:
|
8173
|
+
icon: Rt(Gs),
|
8173
8174
|
type: "info",
|
8174
8175
|
name: "home"
|
8175
8176
|
}
|
@@ -8886,10 +8887,10 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
8886
8887
|
}
|
8887
8888
|
], Fu = [
|
8888
8889
|
{
|
8889
|
-
name:
|
8890
|
+
name: Bt,
|
8890
8891
|
version: "latest",
|
8891
8892
|
label: "内置",
|
8892
|
-
library:
|
8893
|
+
library: Bt,
|
8893
8894
|
order: 0,
|
8894
8895
|
categories: Bu,
|
8895
8896
|
components: zu
|
@@ -9257,7 +9258,7 @@ const ar = { class: "v-icon-setter" }, sr = { class: "v-icon-setter__content" },
|
|
9257
9258
|
setup(i, { emit: t }) {
|
9258
9259
|
const e = i, l = t, a = x([]), o = C(() => a.value.length < e.limit), s = (u) => u.type.includes("image") ? (Nl(u).then((f) => {
|
9259
9260
|
a.value = [{ name: u.name, url: f }];
|
9260
|
-
}), !1) : (
|
9261
|
+
}), !1) : (Pe.error("只能上传图片"), !1), r = () => {
|
9261
9262
|
a.value = [];
|
9262
9263
|
};
|
9263
9264
|
return q(
|
@@ -9543,7 +9544,7 @@ class rc {
|
|
9543
9544
|
set(t, e) {
|
9544
9545
|
const l = this.widgets[t];
|
9545
9546
|
if (!l) {
|
9546
|
-
|
9547
|
+
Ie.warn(`widget '${t}' is not found`);
|
9547
9548
|
return;
|
9548
9549
|
}
|
9549
9550
|
Ht(l, e), e.component && (l.component = e.component);
|
@@ -9655,7 +9656,7 @@ class cc {
|
|
9655
9656
|
set(t, e) {
|
9656
9657
|
const l = this.setters[t];
|
9657
9658
|
if (!l) {
|
9658
|
-
|
9659
|
+
Ie.warn(`setter '${t}' is not found`);
|
9659
9660
|
return;
|
9660
9661
|
}
|
9661
9662
|
Ht(l, e), e.component && (l.component = e.component);
|
@@ -9737,18 +9738,19 @@ class dc {
|
|
9737
9738
|
return t;
|
9738
9739
|
}
|
9739
9740
|
}
|
9740
|
-
function pc(i) {
|
9741
|
-
return new Promise((
|
9742
|
-
const
|
9743
|
-
|
9741
|
+
function pc(i, t) {
|
9742
|
+
return new Promise((e, l) => {
|
9743
|
+
const a = kn(yr, {
|
9744
|
+
name: i,
|
9745
|
+
slots: t,
|
9744
9746
|
onClose: () => {
|
9745
|
-
|
9747
|
+
a.unmount(), l(null);
|
9746
9748
|
},
|
9747
|
-
onSubmit: (
|
9748
|
-
|
9749
|
+
onSubmit: (o) => {
|
9750
|
+
a.unmount(), e(o);
|
9749
9751
|
}
|
9750
9752
|
});
|
9751
|
-
|
9753
|
+
a.mount(document.createElement("div"));
|
9752
9754
|
});
|
9753
9755
|
}
|
9754
9756
|
class mc {
|
@@ -9781,7 +9783,7 @@ class mc {
|
|
9781
9783
|
this.bind(this.onSelected, "onSelected"),
|
9782
9784
|
!0
|
9783
9785
|
), oe.on(
|
9784
|
-
|
9786
|
+
Ot,
|
9785
9787
|
this.bind(this.onActiveChange, "onActiveChange")
|
9786
9788
|
), oe.on(Ze, this.bind(this.onViewChange, "onViewChange")), q(
|
9787
9789
|
this.devtools.isOpen,
|
@@ -9808,7 +9810,7 @@ class mc {
|
|
9808
9810
|
"dragstart",
|
9809
9811
|
this.bind(this.onDragStart, "onDragStart")
|
9810
9812
|
), e.removeEventListener("dragend", this.bind(this.onDragEnd, "onDragEnd")), e.removeEventListener("drop", this.bind(this.onDrop, "onDrop")), e.removeEventListener("click", this.bind(this.onSelected, "onSelected")), oe.off(
|
9811
|
-
|
9813
|
+
Ot,
|
9812
9814
|
this.bind(this.onActiveChange, "onActiveChange")
|
9813
9815
|
), oe.off(
|
9814
9816
|
Ze,
|
@@ -9846,7 +9848,7 @@ class mc {
|
|
9846
9848
|
const { name: p, params: _ = [] } = g[0];
|
9847
9849
|
return p === "default" && !_.length ? void 0 : g[0];
|
9848
9850
|
}
|
9849
|
-
const v = await pc(g).catch(() => null);
|
9851
|
+
const v = await pc(t.name, g).catch(() => null);
|
9850
9852
|
if (!(v && v.name === "default" && (!v.params || v.params?.length === 0)))
|
9851
9853
|
return v;
|
9852
9854
|
}
|
@@ -9988,7 +9990,7 @@ class mc {
|
|
9988
9990
|
this.draggingNode = t;
|
9989
9991
|
}
|
9990
9992
|
async setHover(t) {
|
9991
|
-
if (await
|
9993
|
+
if (await Ce(), t) {
|
9992
9994
|
const e = this.getElmenetByModel(t);
|
9993
9995
|
if (!e) return;
|
9994
9996
|
const l = e.getBoundingClientRect(), a = le(t) ? [] : this.findPathByNode(t);
|
@@ -10003,7 +10005,7 @@ class mc {
|
|
10003
10005
|
this.hover.value = null;
|
10004
10006
|
}
|
10005
10007
|
async setSelected(t) {
|
10006
|
-
if (await
|
10008
|
+
if (await Ce(), t) {
|
10007
10009
|
const e = this.getElmenetByModel(t) || this.document?.createElement("span");
|
10008
10010
|
if (!e) return;
|
10009
10011
|
const l = e.getBoundingClientRect(), a = le(t) ? [] : this.findPathByNode(t);
|
@@ -10018,7 +10020,7 @@ class mc {
|
|
10018
10020
|
this.selected.value = null;
|
10019
10021
|
}
|
10020
10022
|
async setDropping(t, e = "inner") {
|
10021
|
-
if (await
|
10023
|
+
if (await Ce(), t) {
|
10022
10024
|
const l = this.getElmenetByModel(t);
|
10023
10025
|
if (!l) return;
|
10024
10026
|
const a = l.getBoundingClientRect(), o = le(t) ? [] : this.findPathByNode(t);
|
@@ -10107,7 +10109,7 @@ class vc {
|
|
10107
10109
|
} catch (d) {
|
10108
10110
|
re(d.message || "未知错误", "运行时错误"), console.error(d);
|
10109
10111
|
}
|
10110
|
-
this.context = p, oe.on(Ze, this.nodeChange), oe.on(
|
10112
|
+
this.context = p, oe.on(Ze, this.nodeChange), oe.on(zt, this.blockChange);
|
10111
10113
|
}
|
10112
10114
|
dispose() {
|
10113
10115
|
if (this.app) {
|
@@ -10117,7 +10119,7 @@ class vc {
|
|
10117
10119
|
const e = this.app._container;
|
10118
10120
|
e && e.parentNode && (e.parentNode.removeChild(e), this.app._container = null), this.app = null;
|
10119
10121
|
}
|
10120
|
-
this.dsl = null, this.context = null, this.file = null, oe.off(Ze, this.nodeChange), oe.off(
|
10122
|
+
this.dsl = null, this.context = null, this.file = null, oe.off(Ze, this.nodeChange), oe.off(zt, this.blockChange);
|
10121
10123
|
}
|
10122
10124
|
updateChild(t, e) {
|
10123
10125
|
const l = e.children || e.nodes || [];
|
@@ -10171,7 +10173,7 @@ class gc extends Fn {
|
|
10171
10173
|
setup(e, l) {
|
10172
10174
|
const a = e.contentWindow;
|
10173
10175
|
if (!a) {
|
10174
|
-
|
10176
|
+
Ie.warn("Simulator contentWindow is null");
|
10175
10177
|
return;
|
10176
10178
|
}
|
10177
10179
|
a.__simulator__ = this;
|
@@ -10256,7 +10258,7 @@ class gc extends Fn {
|
|
10256
10258
|
const _ = {}, { groups: d, componentMap: h } = f;
|
10257
10259
|
for (const V of d.value) {
|
10258
10260
|
const j = V.names || [];
|
10259
|
-
if (V.name ===
|
10261
|
+
if (V.name === Bt)
|
10260
10262
|
j.forEach((R) => {
|
10261
10263
|
const I = h.get(R), T = I?.package || "", O = Kl[T], Q = v[O];
|
10262
10264
|
Q && I && (_[R] = rn(I, Q));
|
@@ -10446,7 +10448,7 @@ class ld extends Fn {
|
|
10446
10448
|
}), this.bindEvents(), this.init(o), ht(this.render.bind(this)), wn(this.dispose.bind(this));
|
10447
10449
|
}
|
10448
10450
|
async init(e) {
|
10449
|
-
const l = await this.service.init(e).catch((a) => (
|
10451
|
+
const l = await this.service.init(e).catch((a) => (Ie.warn("VTJEngine service init fail.", a), null));
|
10450
10452
|
l && (l.dependencies = uc.merge(l.dependencies || []), this.project.value = new Xl(l), this.saveMaterials(), this.triggerReady());
|
10451
10453
|
}
|
10452
10454
|
render() {
|
@@ -10455,13 +10457,13 @@ class ld extends Fn {
|
|
10455
10457
|
const l = kn(hc);
|
10456
10458
|
this.options.install && l.use(this.options.install, this), l.provide(dl, wl(this)), l.mount(e), this.app = l;
|
10457
10459
|
} else
|
10458
|
-
|
10460
|
+
Ie.warn("VTJEngine constructor param [ container ] is undefined");
|
10459
10461
|
}
|
10460
10462
|
bindEvents() {
|
10461
|
-
oe.on(Ql, (e) => this.saveProject(e)), oe.on(Yl, (e) => this.saveBlockFile(e)), oe.on(Zl, (e) => this.saveBlockFile(e)), oe.on(ea, () => this.saveMaterials()), oe.on(
|
10463
|
+
oe.on(Ql, (e) => this.saveProject(e)), oe.on(Yl, (e) => this.saveBlockFile(e)), oe.on(Zl, (e) => this.saveBlockFile(e)), oe.on(ea, () => this.saveMaterials()), oe.on(Ot, (e) => this.activeFile(e)), oe.on(ta, () => this.publish()), oe.on(na, () => this.publishCurrent()), oe.on(zt, (e) => this.changeFile(e)), oe.on(Ze, () => this.changeCurrentFile()), oe.on(la, (e) => this.saveHistory(e)), oe.on(aa, (e) => this.loadHistory(e)), oe.on(sa, () => this.genSource());
|
10462
10464
|
}
|
10463
10465
|
async activeFile(e) {
|
10464
|
-
await
|
10466
|
+
await Ce();
|
10465
10467
|
const l = e.model, a = e.model.currentFile;
|
10466
10468
|
if (a) {
|
10467
10469
|
if (l.isPageFile(a) && a.raw)
|
@@ -10474,22 +10476,22 @@ class ld extends Fn {
|
|
10474
10476
|
this.updateCurrent(o), this.initHistory(o);
|
10475
10477
|
} else
|
10476
10478
|
this.updateCurrent(null);
|
10477
|
-
|
10479
|
+
Te(this.project);
|
10478
10480
|
}
|
10479
10481
|
async changeFile(e) {
|
10480
|
-
await
|
10482
|
+
await Ce();
|
10481
10483
|
const l = e.toDsl();
|
10482
|
-
this.service.saveFile(l, this.project.value?.toDsl()), this.updateCurrent(e), this.history.value?.add(l),
|
10484
|
+
this.service.saveFile(l, this.project.value?.toDsl()), this.updateCurrent(e), this.history.value?.add(l), Te(this.history);
|
10483
10485
|
}
|
10484
10486
|
changeCurrentFile() {
|
10485
|
-
this.saveCurrentFile(), this.current.value && (this.history.value?.add(this.current.value.toDsl()),
|
10487
|
+
this.saveCurrentFile(), this.current.value && (this.history.value?.add(this.current.value.toDsl()), Te(this.history));
|
10486
10488
|
}
|
10487
10489
|
async updateCurrent(e, l = !0) {
|
10488
|
-
this.current.value = e, await
|
10490
|
+
this.current.value = e, await Ce(), this.context.value = this.simulator.renderer?.context || null, this.isEmptyCurrent.value = this.current.value?.nodes.length === 0, this.changed.value = Symbol(), l && Te(this.context);
|
10489
10491
|
}
|
10490
10492
|
async saveProject(e) {
|
10491
10493
|
const a = e.model.toDsl();
|
10492
|
-
await this.service.saveProject(a),
|
10494
|
+
await this.service.saveProject(a), Te(this.project);
|
10493
10495
|
}
|
10494
10496
|
async saveBlockFile(e) {
|
10495
10497
|
const l = e.type, a = e.model, o = a.toDsl();
|
@@ -10512,7 +10514,7 @@ class ld extends Fn {
|
|
10512
10514
|
const { source: s, target: r } = e.data, u = await this.service.getFile(s.id, o);
|
10513
10515
|
u && (u.id = r.id, u.name = r.name, await this.service.saveFile(u, o));
|
10514
10516
|
}
|
10515
|
-
|
10517
|
+
Te(this.project), this.emitter.emit(It, e);
|
10516
10518
|
}
|
10517
10519
|
onSaveBlockFileFinish(e) {
|
10518
10520
|
const l = (a) => {
|
@@ -10521,7 +10523,7 @@ class ld extends Fn {
|
|
10521
10523
|
this.emitter.on(It, l);
|
10522
10524
|
}
|
10523
10525
|
async saveMaterials() {
|
10524
|
-
await
|
10526
|
+
await Ce(), this.simulator.ready(() => {
|
10525
10527
|
const e = this.project.value;
|
10526
10528
|
if (e) {
|
10527
10529
|
const l = this.assets.componentMap;
|
@@ -10558,7 +10560,7 @@ class ld extends Fn {
|
|
10558
10560
|
o
|
10559
10561
|
);
|
10560
10562
|
const s = a.toDsl();
|
10561
|
-
await this.service.saveHistory(s, o),
|
10563
|
+
await this.service.saveHistory(s, o), Te(this.history);
|
10562
10564
|
}
|
10563
10565
|
async loadHistory(e) {
|
10564
10566
|
const l = e.model, a = e.data, o = this.project.value?.toDsl(), s = await this.service.getHistoryItem(
|
@@ -10568,7 +10570,7 @@ class ld extends Fn {
|
|
10568
10570
|
);
|
10569
10571
|
if (s && s.dsl) {
|
10570
10572
|
const r = new sn(s.dsl);
|
10571
|
-
await this.updateCurrent(r), this.service.saveFile(s.dsl, o),
|
10573
|
+
await this.updateCurrent(r), this.service.saveFile(s.dsl, o), Te(this.history);
|
10572
10574
|
}
|
10573
10575
|
}
|
10574
10576
|
async publish() {
|
@@ -10619,9 +10621,9 @@ class ld extends Fn {
|
|
10619
10621
|
}
|
10620
10622
|
function ce() {
|
10621
10623
|
const i = Wt(dl, null);
|
10622
|
-
return i ||
|
10624
|
+
return i || Ie.error("VTJEngine is not exist"), i;
|
10623
10625
|
}
|
10624
|
-
const
|
10626
|
+
const $e = P({
|
10625
10627
|
name: "RegionWrapper",
|
10626
10628
|
props: {
|
10627
10629
|
region: {
|
@@ -10725,7 +10727,7 @@ const Re = P({
|
|
10725
10727
|
getWidget(i) {
|
10726
10728
|
const t = cl.get(i);
|
10727
10729
|
if (!t) {
|
10728
|
-
|
10730
|
+
Ie.warn(`widget [ ${i} ] is not exsit`);
|
10729
10731
|
return;
|
10730
10732
|
}
|
10731
10733
|
return this.getWidgets(t.region).find((l) => l.widget.name === i);
|
@@ -10783,7 +10785,7 @@ const Re = P({
|
|
10783
10785
|
let e;
|
10784
10786
|
if (typeof t == "string")
|
10785
10787
|
return e = this.getSetter(t), {
|
10786
|
-
component:
|
10788
|
+
component: Rt(e.component),
|
10787
10789
|
name: e.name,
|
10788
10790
|
label: t,
|
10789
10791
|
props: e.props || {}
|
@@ -10791,7 +10793,7 @@ const Re = P({
|
|
10791
10793
|
{
|
10792
10794
|
const l = t;
|
10793
10795
|
return e = this.getSetter(l.name), {
|
10794
|
-
component:
|
10796
|
+
component: Rt(l.component || e.component),
|
10795
10797
|
name: l.name,
|
10796
10798
|
label: l.label || l.name,
|
10797
10799
|
props: Object.assign(e.props || {}, l.props)
|
@@ -10911,18 +10913,18 @@ const Re = P({
|
|
10911
10913
|
height: k.headerHeight
|
10912
10914
|
}, {
|
10913
10915
|
default: y(() => [
|
10914
|
-
m(n(
|
10916
|
+
m(n($e), {
|
10915
10917
|
ref_key: "brand",
|
10916
10918
|
ref: u,
|
10917
10919
|
region: "Brand"
|
10918
10920
|
}, null, 512),
|
10919
|
-
m(n(
|
10921
|
+
m(n($e), {
|
10920
10922
|
ref_key: "toolbar",
|
10921
10923
|
ref: f,
|
10922
10924
|
region: "Toolbar",
|
10923
10925
|
preview: l.value
|
10924
10926
|
}, null, 8, ["preview"]),
|
10925
|
-
m(n(
|
10927
|
+
m(n($e), {
|
10926
10928
|
ref_key: "actions",
|
10927
10929
|
ref: g,
|
10928
10930
|
region: "Actions"
|
@@ -10932,7 +10934,7 @@ const Re = P({
|
|
10932
10934
|
}, 8, ["height"]),
|
10933
10935
|
m(n(tn), { class: "v-skeleton__wrapper" }, {
|
10934
10936
|
default: y(() => [
|
10935
|
-
l.value ? D("", !0) :
|
10937
|
+
l.value ? D("", !0) : Ee((c(), w(n(nn), {
|
10936
10938
|
key: 0,
|
10937
10939
|
width: e.leftWidth,
|
10938
10940
|
class: K(["v-skeleton__left", {
|
@@ -10940,7 +10942,7 @@ const Re = P({
|
|
10940
10942
|
}])
|
10941
10943
|
}, {
|
10942
10944
|
default: y(() => [
|
10943
|
-
m(n(
|
10945
|
+
m(n($e), {
|
10944
10946
|
ref_key: "apps",
|
10945
10947
|
ref: v,
|
10946
10948
|
region: "Apps"
|
@@ -10952,14 +10954,14 @@ const Re = P({
|
|
10952
10954
|
]),
|
10953
10955
|
m(n(Rl), { class: "v-skeleton__main" }, {
|
10954
10956
|
default: y(() => [
|
10955
|
-
l.value ? (c(), w(n(
|
10957
|
+
l.value ? (c(), w(n($e), {
|
10956
10958
|
key: 0,
|
10957
10959
|
ref_key: "preview",
|
10958
10960
|
ref: h,
|
10959
10961
|
region: "Preview",
|
10960
10962
|
preview: l.value
|
10961
10963
|
}, null, 8, ["preview"])) : D("", !0),
|
10962
|
-
|
10964
|
+
Ee(m(n($e), {
|
10963
10965
|
ref_key: "workspace",
|
10964
10966
|
ref: p,
|
10965
10967
|
region: "Workspace"
|
@@ -10969,13 +10971,13 @@ const Re = P({
|
|
10969
10971
|
]),
|
10970
10972
|
_: 1
|
10971
10973
|
}),
|
10972
|
-
l.value ? D("", !0) :
|
10974
|
+
l.value ? D("", !0) : Ee((c(), w(n(nn), {
|
10973
10975
|
key: 1,
|
10974
10976
|
width: e.rightWidth,
|
10975
10977
|
class: "v-skeleton__right"
|
10976
10978
|
}, {
|
10977
10979
|
default: y(() => [
|
10978
|
-
m(n(
|
10980
|
+
m(n($e), {
|
10979
10981
|
ref_key: "settings",
|
10980
10982
|
ref: _,
|
10981
10983
|
region: "Settings"
|
@@ -10995,7 +10997,7 @@ const Re = P({
|
|
10995
10997
|
height: k.footerHeight
|
10996
10998
|
}, {
|
10997
10999
|
default: y(() => [
|
10998
|
-
m(n(
|
11000
|
+
m(n($e), {
|
10999
11001
|
ref_key: "status",
|
11000
11002
|
ref: d,
|
11001
11003
|
region: "Status"
|
@@ -11392,7 +11394,7 @@ const Re = P({
|
|
11392
11394
|
region: {}
|
11393
11395
|
},
|
11394
11396
|
setup(i, { expose: t }) {
|
11395
|
-
const e = i, l = ce(), { current: a } = me(), { selected: o, isSelectBlock: s } =
|
11397
|
+
const e = i, l = ce(), { current: a } = me(), { selected: o, isSelectBlock: s } = xe(), r = C(
|
11396
11398
|
() => s.value ? ke.Block : ke.Node
|
11397
11399
|
), { widgets: u, widgetsRef: f } = Le(e.region, r), g = x(), v = x(!1), p = C(() => u.value.map((b) => ({
|
11398
11400
|
name: b.name,
|
@@ -11610,11 +11612,11 @@ export {
|
|
11610
11612
|
un as MOBILE_SIZE,
|
11611
11613
|
ao as MOUSE_EVENT_LIST,
|
11612
11614
|
nd as MicroApp,
|
11613
|
-
|
11615
|
+
je as NAME_REGEX,
|
11614
11616
|
cn as PAD_SIZE,
|
11615
11617
|
J as Panel,
|
11616
11618
|
co as RegionType,
|
11617
|
-
|
11619
|
+
$e as RegionWrapper,
|
11618
11620
|
vc as Renderer,
|
11619
11621
|
It as SAVE_BLOCK_FILE_FINISH,
|
11620
11622
|
Cc as SetterView,
|