diygw-designer 1.3.0 → 1.3.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/diygw-designer/miniapp.d.ts +3 -1
- package/dist/miniapp-designer/src/MiniProgramDesigner.vue.cjs +1 -1
- package/dist/miniapp-designer/src/MiniProgramDesigner.vue.js +20 -15
- package/dist/miniapp-designer/src/miniappDesignerProps.d.ts +6 -0
- package/dist/miniapp.cjs +1 -1
- package/dist/miniapp.js +7 -6
- package/package.json +1 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { default as MiniProgramDesigner } from '../miniapp-designer/src/MiniProgramDesigner.vue';
|
|
2
|
+
export { MiniProgramDesigner };
|
|
3
|
+
export default MiniProgramDesigner;
|
|
2
4
|
export type { MiniProgramDesignerProps } from '../miniapp-designer/src/miniappDesignerProps';
|
|
3
5
|
export { pageTreeNamespaceForProjectId, sanitizePageStorageNamespacePart, } from '../miniapp-designer/src/pageStorageNamespace';
|
|
4
6
|
export { setupMiniProgramDesigner } from '../miniapp-designer/src/setupMiniProgramDesigner';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const r=require("vue");;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */const
|
|
1
|
+
"use strict";const r=require("vue");;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */const u=require("../../manager/src/pluginManager.cjs");require("jsep");require("@vueuse/core");require("../../hooks/src/store/index.cjs");;/* empty css */require("vue-draggable-plus");;/* empty css */require("element-plus");;/* empty css */;/* empty css */;/* empty css */const i=require("../../ui-kit/panel-ui/src/activitybars/pageManager/storage.cjs");require("../../ui-kit/panel-ui/src/activitybars/pageManager/pageDraftBootstrap.cjs");require("../../core/src/components/builder/hooks/usePageDataSources.cjs");const d=require("../../core/src/components/designer/src/designer.vue.cjs"),f=require("../../ui/elementPlus/src/index.cjs"),S=require("./pageStorageNamespace.cjs"),q=require("./setupMiniProgramDesigner.cjs"),h={key:0},P=r.defineComponent({__name:"MiniProgramDesigner",props:{multiPage:{type:Boolean,default:!0},projectId:{},pageStorageHttp:{},pageStorageNamespace:{},syncProjectKeyFromUrl:{type:Boolean,default:!0},initialPageSchema:{},title:{default:"小程序设计页面"},headerPrefix:{},onSaveSchema:{}},emits:["save"],setup(o,{emit:s}){var c;const e=o,n=r.computed(()=>e.headerPrefix===void 0?"小程序":e.headerPrefix);e.pageStorageHttp?i.configurePageStorage({adapter:i.createHttpStorageAdapter(e.pageStorageHttp)}):e.pageStorageNamespace?i.configurePageStorage({namespace:e.pageStorageNamespace}):(c=e.projectId)!=null&&c.trim()?i.configurePageStorage({namespace:S.pageTreeNamespaceForProjectId(e.projectId)}):e.syncProjectKeyFromUrl&&i.syncPageStorageNamespaceFromLocation(),f.setupElementPlus(u.pluginManager);const{defaultSchema:g}=q.setupMiniProgramDesigner(u.pluginManager),p=r.computed(()=>{var t;const a=e.initialPageSchema;return(t=a==null?void 0:a.schemas)!=null&&t.length?JSON.parse(JSON.stringify(a)):{schemas:[JSON.parse(JSON.stringify(g))]}}),l=s;async function m(a){var t;await i.flushPageStorage(),await((t=e.onSaveSchema)==null?void 0:t.call(e,a)),l("save",a)}return(a,t)=>(r.openBlock(),r.createBlock(r.unref(d),{"canvas-mode":"mobile","form-mode":"","lock-default-schema-edit":"","default-schema":p.value,"enable-page-manager":o.multiPage,title:o.title,onSave:m},{"header-prefix":r.withCtx(()=>[r.renderSlot(a.$slots,"header-prefix",{},()=>[n.value?(r.openBlock(),r.createElementBlock("div",h,r.toDisplayString(n.value),1)):r.createCommentVNode("",!0)])]),_:3},8,["default-schema","enable-page-manager","title"]))}});module.exports=P;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as u, computed as p, createBlock as S, openBlock as n, unref as h, withCtx as P, renderSlot as v, createElementBlock as y, createCommentVNode as
|
|
1
|
+
import { defineComponent as u, computed as p, createBlock as S, openBlock as n, unref as h, withCtx as P, renderSlot as v, createElementBlock as y, createCommentVNode as N, toDisplayString as x } from "vue";
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
@@ -22,7 +22,7 @@ import B from "../../core/src/components/designer/src/designer.vue.js";
|
|
|
22
22
|
import { setupElementPlus as F } from "../../ui/elementPlus/src/index.js";
|
|
23
23
|
import { pageTreeNamespaceForProjectId as H } from "./pageStorageNamespace.js";
|
|
24
24
|
import { setupMiniProgramDesigner as I } from "./setupMiniProgramDesigner.js";
|
|
25
|
-
const
|
|
25
|
+
const J = { key: 0 }, te = /* @__PURE__ */ u({
|
|
26
26
|
__name: "MiniProgramDesigner",
|
|
27
27
|
props: {
|
|
28
28
|
multiPage: { type: Boolean, default: !0 },
|
|
@@ -30,40 +30,45 @@ const b = { key: 0 }, te = /* @__PURE__ */ u({
|
|
|
30
30
|
pageStorageHttp: {},
|
|
31
31
|
pageStorageNamespace: {},
|
|
32
32
|
syncProjectKeyFromUrl: { type: Boolean, default: !0 },
|
|
33
|
+
initialPageSchema: {},
|
|
33
34
|
title: { default: "小程序设计页面" },
|
|
34
35
|
headerPrefix: {},
|
|
35
36
|
onSaveSchema: {}
|
|
36
37
|
},
|
|
37
38
|
emits: ["save"],
|
|
38
|
-
setup(
|
|
39
|
-
var
|
|
40
|
-
const e =
|
|
39
|
+
setup(r, { emit: s }) {
|
|
40
|
+
var m;
|
|
41
|
+
const e = r, i = p(
|
|
41
42
|
() => e.headerPrefix === void 0 ? "小程序" : e.headerPrefix
|
|
42
43
|
);
|
|
43
44
|
e.pageStorageHttp ? o({
|
|
44
45
|
adapter: j(e.pageStorageHttp)
|
|
45
|
-
}) : e.pageStorageNamespace ? o({ namespace: e.pageStorageNamespace }) : (
|
|
46
|
+
}) : e.pageStorageNamespace ? o({ namespace: e.pageStorageNamespace }) : (m = e.projectId) != null && m.trim() ? o({
|
|
46
47
|
namespace: H(e.projectId)
|
|
47
48
|
}) : e.syncProjectKeyFromUrl && _(), F(c);
|
|
48
|
-
const { defaultSchema: l } = I(c), g = p(() =>
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
const { defaultSchema: l } = I(c), g = p(() => {
|
|
50
|
+
var a;
|
|
51
|
+
const t = e.initialPageSchema;
|
|
52
|
+
return (a = t == null ? void 0 : t.schemas) != null && a.length ? JSON.parse(JSON.stringify(t)) : {
|
|
53
|
+
schemas: [JSON.parse(JSON.stringify(l))]
|
|
54
|
+
};
|
|
55
|
+
}), f = s;
|
|
51
56
|
async function d(t) {
|
|
52
|
-
var
|
|
53
|
-
await k(), await ((
|
|
57
|
+
var a;
|
|
58
|
+
await k(), await ((a = e.onSaveSchema) == null ? void 0 : a.call(e, t)), f("save", t);
|
|
54
59
|
}
|
|
55
|
-
return (t,
|
|
60
|
+
return (t, a) => (n(), S(h(B), {
|
|
56
61
|
"canvas-mode": "mobile",
|
|
57
62
|
"form-mode": "",
|
|
58
63
|
"lock-default-schema-edit": "",
|
|
59
64
|
"default-schema": g.value,
|
|
60
|
-
"enable-page-manager":
|
|
61
|
-
title:
|
|
65
|
+
"enable-page-manager": r.multiPage,
|
|
66
|
+
title: r.title,
|
|
62
67
|
onSave: d
|
|
63
68
|
}, {
|
|
64
69
|
"header-prefix": P(() => [
|
|
65
70
|
v(t.$slots, "header-prefix", {}, () => [
|
|
66
|
-
|
|
71
|
+
i.value ? (n(), y("div", J, x(i.value), 1)) : N("", !0)
|
|
67
72
|
])
|
|
68
73
|
]),
|
|
69
74
|
_: 3
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PageHttpStorageConfig } from '../../ui-kit/panel-ui/src/index';
|
|
2
|
+
import { PageSchema } from '../../types/src/index';
|
|
2
3
|
export interface MiniProgramDesignerProps {
|
|
3
4
|
/**
|
|
4
5
|
* 是否显示左侧「页面」多页管理。单页场景请设为 `false`(一个 projectId 对应画布上「当前这一页」)。
|
|
@@ -25,6 +26,11 @@ export interface MiniProgramDesignerProps {
|
|
|
25
26
|
* @default true
|
|
26
27
|
*/
|
|
27
28
|
syncProjectKeyFromUrl?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* 进入设计器时的初始页面数据(例如从业务接口加载的已发布 schema)。
|
|
31
|
+
* 不传则使用小程序默认根节点模板。
|
|
32
|
+
*/
|
|
33
|
+
initialPageSchema?: PageSchema;
|
|
28
34
|
/** 设计器标题 */
|
|
29
35
|
title?: string;
|
|
30
36
|
/**
|
package/dist/miniapp.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */const e=require("./miniapp-designer/src/MiniProgramDesigner.vue.cjs"),r=require("./miniapp-designer/src/pageStorageNamespace.cjs"),a=require("./miniapp-designer/src/setupMiniProgramDesigner.cjs");exports.MiniProgramDesigner=e;exports.default=e;exports.pageTreeNamespaceForProjectId=r.pageTreeNamespaceForProjectId;exports.sanitizePageStorageNamespacePart=r.sanitizePageStorageNamespacePart;exports.setupMiniProgramDesigner=a.setupMiniProgramDesigner;
|
package/dist/miniapp.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import
|
|
3
|
-
import { pageTreeNamespaceForProjectId as
|
|
4
|
-
import { setupMiniProgramDesigner as
|
|
2
|
+
import a from "./miniapp-designer/src/MiniProgramDesigner.vue.js";
|
|
3
|
+
import { pageTreeNamespaceForProjectId as t, sanitizePageStorageNamespacePart as m } from "./miniapp-designer/src/pageStorageNamespace.js";
|
|
4
|
+
import { setupMiniProgramDesigner as s } from "./miniapp-designer/src/setupMiniProgramDesigner.js";
|
|
5
5
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
a as MiniProgramDesigner,
|
|
7
|
+
a as default,
|
|
8
|
+
t as pageTreeNamespaceForProjectId,
|
|
8
9
|
m as sanitizePageStorageNamespacePart,
|
|
9
|
-
|
|
10
|
+
s as setupMiniProgramDesigner
|
|
10
11
|
};
|