@tmagic/editor 1.3.8 → 1.3.9
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/tmagic-editor.js +19 -9
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +19 -10
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +12 -11
- package/src/layouts/CodeEditor.vue +1 -1
- package/src/services/editor.ts +13 -5
- package/src/services/props.ts +9 -4
- package/src/utils/monaco-editor.ts +8 -0
- package/types/layouts/CodeEditor.vue.d.ts +1 -1
- package/types/utils/monaco-editor.d.ts +2 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('@element-plus/icons-vue'), require('lodash-es'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'vue', '@element-plus/icons-vue', 'lodash-es', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicEditor = {}, global.Vue, global.iconsVue, global.lodashEs, global.
|
|
5
|
-
})(this, (function (exports, vue, iconsVue, lodashEs,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('@element-plus/icons-vue'), require('lodash-es'), require('serialize-javascript'), require('@tmagic/design'), require('emmet-monaco-es'), require('monaco-editor'), require('@tmagic/schema'), require('@tmagic/form'), require('@tmagic/table'), require('@tmagic/utils'), require('gesto'), require('moveable'), require('@tmagic/dep'), require('@tmagic/stage'), require('events'), require('@tmagic/core'), require('keycon')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'vue', '@element-plus/icons-vue', 'lodash-es', 'serialize-javascript', '@tmagic/design', 'emmet-monaco-es', 'monaco-editor', '@tmagic/schema', '@tmagic/form', '@tmagic/table', '@tmagic/utils', 'gesto', 'moveable', '@tmagic/dep', '@tmagic/stage', 'events', '@tmagic/core', 'keycon'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicEditor = {}, global.Vue, global.iconsVue, global.lodashEs, global.serialize, global.design, global.emmetMonacoEs, global.monaco, global.schema, global.form, global.table, global.utils, global.Gesto, global.Moveable, global.dep, global.StageCore, global.events, global.core, global.KeyController));
|
|
5
|
+
})(this, (function (exports, vue, iconsVue, lodashEs, serialize, design, emmetMonacoEs, monaco, schema, form, table, utils, Gesto, Moveable, dep, StageCore, events, core, KeyController) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespaceDefault(e) {
|
|
8
8
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
|
|
@@ -29,6 +29,9 @@
|
|
|
29
29
|
};
|
|
30
30
|
const getConfig = (key) => $TMAGIC_EDITOR[key];
|
|
31
31
|
|
|
32
|
+
emmetMonacoEs.emmetHTML(monaco__namespace);
|
|
33
|
+
emmetMonacoEs.emmetCSS(monaco__namespace, ["css", "scss"]);
|
|
34
|
+
|
|
32
35
|
const _hoisted_1$t = {
|
|
33
36
|
class: /* @__PURE__ */ vue.normalizeClass(`magic-code-editor`)
|
|
34
37
|
};
|
|
@@ -2259,11 +2262,11 @@
|
|
|
2259
2262
|
if (!targetConfig)
|
|
2260
2263
|
return;
|
|
2261
2264
|
target.deps[config.id]?.keys?.forEach((fullKey) => {
|
|
2262
|
-
const relateOriginId =
|
|
2265
|
+
const relateOriginId = utils.getValueByKeyPath(fullKey, config);
|
|
2263
2266
|
const relateTargetId = relateIdMap[relateOriginId];
|
|
2264
2267
|
if (!relateTargetId)
|
|
2265
2268
|
return;
|
|
2266
|
-
|
|
2269
|
+
utils.setValueByKeyPath(fullKey, relateTargetId, targetConfig);
|
|
2267
2270
|
});
|
|
2268
2271
|
});
|
|
2269
2272
|
}
|
|
@@ -2903,14 +2906,19 @@
|
|
|
2903
2906
|
const index = brothers.findIndex((item) => `${item.id}` === `${node?.id}`);
|
|
2904
2907
|
const layout = await this.getLayout(parent, node);
|
|
2905
2908
|
const isRelative = layout === Layout.RELATIVE;
|
|
2906
|
-
|
|
2909
|
+
let offsetIndex;
|
|
2907
2910
|
if (offset === LayerOffset.TOP) {
|
|
2908
|
-
|
|
2911
|
+
offsetIndex = isRelative ? 0 : brothers.length;
|
|
2909
2912
|
} else if (offset === LayerOffset.BOTTOM) {
|
|
2910
|
-
|
|
2913
|
+
offsetIndex = isRelative ? brothers.length : 0;
|
|
2911
2914
|
} else {
|
|
2912
|
-
|
|
2915
|
+
offsetIndex = index + (isRelative ? -offset : offset);
|
|
2913
2916
|
}
|
|
2917
|
+
if (offsetIndex > 0 && offsetIndex > brothers.length || offsetIndex < 0) {
|
|
2918
|
+
return;
|
|
2919
|
+
}
|
|
2920
|
+
brothers.splice(index, 1);
|
|
2921
|
+
brothers.splice(offsetIndex, 0, node);
|
|
2914
2922
|
const grandparent = this.getParentById(parent.id);
|
|
2915
2923
|
this.get("stage")?.update({
|
|
2916
2924
|
config: lodashEs.cloneDeep(vue.toRaw(parent)),
|
|
@@ -2919,6 +2927,7 @@
|
|
|
2919
2927
|
});
|
|
2920
2928
|
this.addModifiedNodeId(parent.id);
|
|
2921
2929
|
this.pushHistoryState();
|
|
2930
|
+
this.emit("move-layer", offset);
|
|
2922
2931
|
}
|
|
2923
2932
|
/**
|
|
2924
2933
|
* 移动到指定容器中
|