@tmagic/editor 1.2.0-beta.7 → 1.2.0-beta.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.
@@ -30,7 +30,7 @@
30
30
  const Gesto__default = /*#__PURE__*/_interopDefaultLegacy(Gesto);
31
31
  const KeyController__default = /*#__PURE__*/_interopDefaultLegacy(KeyController);
32
32
 
33
- const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
33
+ const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
34
34
  __name: "Code",
35
35
  props: {
36
36
  model: null,
@@ -60,7 +60,7 @@
60
60
  }
61
61
  });
62
62
 
63
- const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
63
+ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
64
64
  __name: "CodeLink",
65
65
  props: {
66
66
  config: null,
@@ -171,15 +171,15 @@
171
171
  return CodeSelectOp2;
172
172
  })(CodeSelectOp || {});
173
173
 
174
- const _hoisted_1$d = { class: "tool-bar" };
175
- const _hoisted_2$5 = /* @__PURE__ */ vue.createElementVNode("path", {
174
+ const _hoisted_1$e = { class: "tool-bar" };
175
+ const _hoisted_2$6 = /* @__PURE__ */ vue.createElementVNode("path", {
176
176
  fill: "currentColor",
177
177
  d: "m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414L23 12zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414L3.828 12z"
178
178
  }, null, -1);
179
179
  const _hoisted_3$3 = [
180
- _hoisted_2$5
180
+ _hoisted_2$6
181
181
  ];
182
- const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
182
+ const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
183
183
  __name: "CodeSelect",
184
184
  props: {
185
185
  config: null,
@@ -192,6 +192,7 @@
192
192
  setup(__props, { emit }) {
193
193
  const props = __props;
194
194
  const services = vue.inject("services");
195
+ const form = vue.inject("mForm");
195
196
  const selectConfig = vue.computed(() => {
196
197
  const defaultConfig = {
197
198
  multiple: true,
@@ -214,11 +215,12 @@
214
215
  });
215
216
  const fieldKey = vue.ref("");
216
217
  const multiple = vue.ref(true);
217
- const combineIds = vue.ref([]);
218
- let lastTagSnapshot = lodashEs.cloneDeep(props.model[props.name]) || [];
218
+ const lastTagSnapshot = vue.ref([]);
219
219
  vue.watchEffect(async () => {
220
+ if (!props.model[props.name])
221
+ return;
220
222
  const combineNames = await Promise.all(
221
- combineIds.value.map(async (id) => {
223
+ props.model[props.name].map(async (id) => {
222
224
  const { name = "" } = await services?.codeBlockService.getCodeContentById(id) || {};
223
225
  return name;
224
226
  })
@@ -229,7 +231,6 @@
229
231
  let codeIds = value;
230
232
  if (typeof value === "string") {
231
233
  multiple.value = false;
232
- lastTagSnapshot = [lastTagSnapshot];
233
234
  codeIds = value ? [value] : [];
234
235
  }
235
236
  await setCombineRelation(codeIds);
@@ -240,25 +241,20 @@
240
241
  let opFlag = CodeSelectOp.CHANGE;
241
242
  let diffValues = codeIds;
242
243
  if (multiple.value) {
243
- opFlag = codeIds.length < lastTagSnapshot.length ? CodeSelectOp.DELETE : CodeSelectOp.ADD;
244
- diffValues = lodashEs.xor(codeIds, lastTagSnapshot);
244
+ lastTagSnapshot.value = form?.initValues[props.name] || [];
245
+ opFlag = codeIds.length < lastTagSnapshot.value.length ? CodeSelectOp.DELETE : CodeSelectOp.ADD;
246
+ diffValues = lodashEs.xor(codeIds, lastTagSnapshot.value);
245
247
  }
246
248
  await services?.codeBlockService.setCombineRelation(id, diffValues, opFlag, props.prop);
247
- lastTagSnapshot = codeIds;
248
- await setCombineIds(codeIds);
249
- };
250
- const setCombineIds = async (codeIds) => {
251
- combineIds.value = codeIds;
252
- await services?.codeBlockService.setCombineIds(codeIds);
253
249
  };
254
250
  const viewHandler = async () => {
255
251
  if (props.model[props.name].length === 0) {
256
252
  design.tMagicMessage.error("\u8BF7\u5148\u7ED1\u5B9A\u4EE3\u7801\u5757");
257
253
  return;
258
254
  }
259
- await setCombineIds(props.model[props.name]);
255
+ await services?.codeBlockService.setCombineIds(props.model[props.name]);
260
256
  await services?.codeBlockService.setMode(CodeEditorMode.LIST);
261
- services?.codeBlockService.setCodeEditorContent(true, combineIds.value[0]);
257
+ services?.codeBlockService.setCodeEditorContent(true, props.model[props.name][0]);
262
258
  };
263
259
  return (_ctx, _cache) => {
264
260
  const _component_m_fields_select = vue.resolveComponent("m-fields-select");
@@ -278,7 +274,7 @@
278
274
  }, null, 8, ["config", "model", "prop", "name", "size"])
279
275
  ]),
280
276
  default: vue.withCtx(() => [
281
- vue.createElementVNode("div", _hoisted_1$d, [
277
+ vue.createElementVNode("div", _hoisted_1$e, [
282
278
  vue.createVNode(vue.unref(design.TMagicTooltip), {
283
279
  class: "tool-item",
284
280
  effect: "dark",
@@ -306,8 +302,8 @@
306
302
  }
307
303
  });
308
304
 
309
- const _hoisted_1$c = /* @__PURE__ */ vue.createTextVNode("\u53D6\u6D88");
310
- const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
305
+ const _hoisted_1$d = /* @__PURE__ */ vue.createTextVNode("\u53D6\u6D88");
306
+ const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
311
307
  __name: "UISelect",
312
308
  props: {
313
309
  config: null,
@@ -370,7 +366,7 @@
370
366
  style: { "padding": "0" }
371
367
  }, {
372
368
  default: vue.withCtx(() => [
373
- _hoisted_1$c
369
+ _hoisted_1$d
374
370
  ]),
375
371
  _: 1
376
372
  }, 8, ["icon"])
@@ -418,7 +414,7 @@
418
414
 
419
415
  const UISelect_vue_vue_type_style_index_0_lang = '';
420
416
 
421
- const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
417
+ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
422
418
  __name: "CodeEditor",
423
419
  props: {
424
420
  initValues: null,
@@ -548,8 +544,8 @@
548
544
  };
549
545
  const getConfig = (key) => $TMAGIC_EDITOR[key];
550
546
 
551
- const _hoisted_1$b = ["src"];
552
- const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
547
+ const _hoisted_1$c = ["src"];
548
+ const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
553
549
  __name: "Icon",
554
550
  props: {
555
551
  icon: null
@@ -569,7 +565,7 @@
569
565
  class: "magic-editor-icon"
570
566
  }, {
571
567
  default: vue.withCtx(() => [
572
- vue.createElementVNode("img", { src: __props.icon }, null, 8, _hoisted_1$b)
568
+ vue.createElementVNode("img", { src: __props.icon }, null, 8, _hoisted_1$c)
573
569
  ]),
574
570
  _: 1
575
571
  })) : typeof __props.icon === "string" ? (vue.openBlock(), vue.createElementBlock("i", {
@@ -2430,6 +2426,11 @@
2430
2426
  stage.on("sort", (ev) => {
2431
2427
  editorService.sort(ev.src, ev.dist);
2432
2428
  });
2429
+ stage.on("select-parent", () => {
2430
+ const parent = editorService.get("parent");
2431
+ editorService.select(parent);
2432
+ editorService.get("stage").select(parent.id);
2433
+ });
2433
2434
  stage.on("changeGuides", (e) => {
2434
2435
  uiService.set("showGuides", true);
2435
2436
  if (!root.value || !page.value)
@@ -2446,10 +2447,10 @@
2446
2447
  return stage;
2447
2448
  };
2448
2449
 
2449
- const _hoisted_1$a = { class: "m-editor-empty-panel" };
2450
- const _hoisted_2$4 = { class: "m-editor-empty-content" };
2450
+ const _hoisted_1$b = { class: "m-editor-empty-panel" };
2451
+ const _hoisted_2$5 = { class: "m-editor-empty-content" };
2451
2452
  const _hoisted_3$2 = /* @__PURE__ */ vue.createElementVNode("p", null, "\u65B0\u589E\u9875\u9762", -1);
2452
- const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
2453
+ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
2453
2454
  __name: "AddPageBox",
2454
2455
  setup(__props) {
2455
2456
  const services = vue.inject("services");
@@ -2463,14 +2464,14 @@
2463
2464
  });
2464
2465
  };
2465
2466
  return (_ctx, _cache) => {
2466
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
2467
- vue.createElementVNode("div", _hoisted_2$4, [
2467
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
2468
+ vue.createElementVNode("div", _hoisted_2$5, [
2468
2469
  vue.createElementVNode("div", {
2469
2470
  class: "m-editor-empty-button",
2470
2471
  onClick: clickHandler
2471
2472
  }, [
2472
2473
  vue.createElementVNode("div", null, [
2473
- vue.createVNode(_sfc_main$n, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
2474
+ vue.createVNode(_sfc_main$o, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
2474
2475
  ]),
2475
2476
  _hoisted_3$2
2476
2477
  ])
@@ -2480,7 +2481,7 @@
2480
2481
  }
2481
2482
  });
2482
2483
 
2483
- const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
2484
+ const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
2484
2485
  __name: "Resizer",
2485
2486
  emits: ["change"],
2486
2487
  setup(__props, { emit }) {
@@ -2513,7 +2514,7 @@
2513
2514
  }
2514
2515
  });
2515
2516
 
2516
- const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
2517
+ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
2517
2518
  __name: "Layout",
2518
2519
  props: {
2519
2520
  left: null,
@@ -2592,7 +2593,7 @@
2592
2593
  }, [
2593
2594
  vue.renderSlot(_ctx.$slots, "left")
2594
2595
  ], 6),
2595
- vue.createVNode(_sfc_main$l, { onChange: changeLeft })
2596
+ vue.createVNode(_sfc_main$m, { onChange: changeLeft })
2596
2597
  ], 64)) : vue.createCommentVNode("", true),
2597
2598
  vue.createElementVNode("div", {
2598
2599
  class: vue.normalizeClass(["m-editor-layout-center", __props.centerClass]),
@@ -2601,7 +2602,7 @@
2601
2602
  vue.renderSlot(_ctx.$slots, "center")
2602
2603
  ], 6),
2603
2604
  typeof props.right !== "undefined" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
2604
- vue.createVNode(_sfc_main$l, { onChange: changeRight }),
2605
+ vue.createVNode(_sfc_main$m, { onChange: changeRight }),
2605
2606
  vue.createElementVNode("div", {
2606
2607
  class: vue.normalizeClass(["m-editor-layout-right", __props.rightClass]),
2607
2608
  style: vue.normalizeStyle(`width: ${__props.right}px`)
@@ -2614,8 +2615,8 @@
2614
2615
  }
2615
2616
  });
2616
2617
 
2617
- const _hoisted_1$9 = { class: "m-editor" };
2618
- const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
2618
+ const _hoisted_1$a = { class: "m-editor" };
2619
+ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
2619
2620
  __name: "Framework",
2620
2621
  props: {
2621
2622
  codeOptions: { default: () => ({}) }
@@ -2682,7 +2683,7 @@
2682
2683
  };
2683
2684
  return (_ctx, _cache) => {
2684
2685
  const _component_magic_code_editor = vue.resolveComponent("magic-code-editor");
2685
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
2686
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
2686
2687
  vue.renderSlot(_ctx.$slots, "nav", { class: "m-editor-nav-menu" }),
2687
2688
  vue.unref(showSrc) ? (vue.openBlock(), vue.createBlock(_component_magic_code_editor, {
2688
2689
  key: 0,
@@ -2690,7 +2691,7 @@
2690
2691
  "init-values": vue.unref(root),
2691
2692
  options: __props.codeOptions,
2692
2693
  onSave: saveCode
2693
- }, null, 8, ["init-values", "options"])) : (vue.openBlock(), vue.createBlock(_sfc_main$k, {
2694
+ }, null, 8, ["init-values", "options"])) : (vue.openBlock(), vue.createBlock(_sfc_main$l, {
2694
2695
  key: 1,
2695
2696
  class: "m-editor-content",
2696
2697
  "left-class": "m-editor-framework-left",
@@ -2709,7 +2710,7 @@
2709
2710
  ]),
2710
2711
  center: vue.withCtx(() => [
2711
2712
  vue.unref(pageLength) > 0 ? vue.renderSlot(_ctx.$slots, "workspace", { key: 0 }) : vue.renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
2712
- vue.createVNode(_sfc_main$m)
2713
+ vue.createVNode(_sfc_main$n)
2713
2714
  ])
2714
2715
  ]),
2715
2716
  _: 2
@@ -2731,12 +2732,12 @@
2731
2732
  }
2732
2733
  });
2733
2734
 
2734
- const _hoisted_1$8 = {
2735
+ const _hoisted_1$9 = {
2735
2736
  key: 1,
2736
2737
  class: "menu-item-text"
2737
2738
  };
2738
- const _hoisted_2$3 = { class: "el-dropdown-link menubar-menu-button" };
2739
- const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
2739
+ const _hoisted_2$4 = { class: "el-dropdown-link menubar-menu-button" };
2740
+ const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
2740
2741
  __name: "ToolButton",
2741
2742
  props: {
2742
2743
  data: { default: () => ({
@@ -2812,7 +2813,7 @@
2812
2813
  __props.data.type === "divider" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDivider), {
2813
2814
  key: 0,
2814
2815
  direction: __props.data.direction || "vertical"
2815
- }, null, 8, ["direction"])) : __props.data.type === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, vue.toDisplayString(__props.data.text), 1)) : __props.data.type === "button" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
2816
+ }, null, 8, ["direction"])) : __props.data.type === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, vue.toDisplayString(__props.data.text), 1)) : __props.data.type === "button" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
2816
2817
  __props.data.tooltip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
2817
2818
  key: 0,
2818
2819
  effect: "dark",
@@ -2826,7 +2827,7 @@
2826
2827
  disabled: vue.unref(disabled)
2827
2828
  }, {
2828
2829
  default: vue.withCtx(() => [
2829
- __props.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$n, {
2830
+ __props.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$o, {
2830
2831
  key: 0,
2831
2832
  icon: __props.data.icon
2832
2833
  }, null, 8, ["icon"])) : vue.createCommentVNode("", true),
@@ -2843,7 +2844,7 @@
2843
2844
  disabled: vue.unref(disabled)
2844
2845
  }, {
2845
2846
  default: vue.withCtx(() => [
2846
- __props.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$n, {
2847
+ __props.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$o, {
2847
2848
  key: 0,
2848
2849
  icon: __props.data.icon
2849
2850
  }, null, 8, ["icon"])) : vue.createCommentVNode("", true),
@@ -2876,7 +2877,7 @@
2876
2877
  })) : vue.createCommentVNode("", true)
2877
2878
  ]),
2878
2879
  default: vue.withCtx(() => [
2879
- vue.createElementVNode("span", _hoisted_2$3, [
2880
+ vue.createElementVNode("span", _hoisted_2$4, [
2880
2881
  vue.createTextVNode(vue.toDisplayString(__props.data.text), 1),
2881
2882
  vue.createVNode(vue.unref(design.TMagicIcon), { class: "el-icon--right" }, {
2882
2883
  default: vue.withCtx(() => [
@@ -2893,7 +2894,7 @@
2893
2894
  }
2894
2895
  });
2895
2896
 
2896
- const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
2897
+ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
2897
2898
  __name: "NavMenu",
2898
2899
  props: {
2899
2900
  data: { default: () => ({}) },
@@ -3049,7 +3050,7 @@
3049
3050
  style: vue.normalizeStyle(`width: ${vue.unref(columnWidth)?.[key]}px`)
3050
3051
  }, [
3051
3052
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(buttons)[key], (item, index) => {
3052
- return vue.openBlock(), vue.createBlock(_sfc_main$i, {
3053
+ return vue.openBlock(), vue.createBlock(_sfc_main$j, {
3053
3054
  data: item,
3054
3055
  key: index
3055
3056
  }, null, 8, ["data"]);
@@ -3061,8 +3062,8 @@
3061
3062
  }
3062
3063
  });
3063
3064
 
3064
- const _hoisted_1$7 = { class: "m-editor-props-panel" };
3065
- const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
3065
+ const _hoisted_1$8 = { class: "m-editor-props-panel" };
3066
+ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
3066
3067
  __name: "PropsPanel",
3067
3068
  emits: ["mounted"],
3068
3069
  setup(__props, { expose, emit }) {
@@ -3106,7 +3107,7 @@
3106
3107
  expose({ submit });
3107
3108
  return (_ctx, _cache) => {
3108
3109
  const _component_m_form = vue.resolveComponent("m-form");
3109
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [
3110
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
3110
3111
  vue.renderSlot(_ctx.$slots, "props-panel-header"),
3111
3112
  vue.createVNode(_component_m_form, {
3112
3113
  ref_key: "configForm",
@@ -3123,8 +3124,8 @@
3123
3124
  }
3124
3125
  });
3125
3126
 
3126
- const _hoisted_1$6 = ["id"];
3127
- const _hoisted_2$2 = { class: "list-item" };
3127
+ const _hoisted_1$7 = ["id"];
3128
+ const _hoisted_2$3 = { class: "list-item" };
3128
3129
  const _hoisted_3$1 = { class: "code-name" };
3129
3130
  const _hoisted_4$1 = { class: "code-name-wrapper" };
3130
3131
  const _hoisted_5$1 = /* @__PURE__ */ vue.createElementVNode("div", { class: "code-name-label" }, "\u4EE3\u7801\u5757\u540D\u79F0", -1);
@@ -3140,7 +3141,7 @@
3140
3141
  class: "m-editor-content-bottom"
3141
3142
  };
3142
3143
  const _hoisted_11 = /* @__PURE__ */ vue.createTextVNode("\u5173\u95ED");
3143
- const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
3144
+ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
3144
3145
  __name: "CodeBlockEditor",
3145
3146
  setup(__props) {
3146
3147
  const services = vue.inject("services");
@@ -3212,7 +3213,7 @@
3212
3213
  "append-to-body": true
3213
3214
  }, {
3214
3215
  default: vue.withCtx(() => [
3215
- vue.createVNode(_sfc_main$k, {
3216
+ vue.createVNode(_sfc_main$l, {
3216
3217
  left: left.value,
3217
3218
  "onUpdate:left": _cache[1] || (_cache[1] = ($event) => left.value = $event),
3218
3219
  "min-left": 45,
@@ -3241,7 +3242,7 @@
3241
3242
  ]),
3242
3243
  default: vue.withCtx(() => [
3243
3244
  vue.createElementVNode("div", _hoisted_6$1, [
3244
- codeConfig.value ? (vue.openBlock(), vue.createBlock(_sfc_main$o, {
3245
+ codeConfig.value ? (vue.openBlock(), vue.createBlock(_sfc_main$p, {
3245
3246
  key: 0,
3246
3247
  ref_key: "codeEditor",
3247
3248
  ref: codeEditor,
@@ -3314,10 +3315,10 @@
3314
3315
  id: data.id,
3315
3316
  class: "list-container"
3316
3317
  }, [
3317
- vue.createElementVNode("div", _hoisted_2$2, [
3318
+ vue.createElementVNode("div", _hoisted_2$3, [
3318
3319
  vue.createElementVNode("div", _hoisted_3$1, vue.toDisplayString(data.name) + "\uFF08" + vue.toDisplayString(data.id) + "\uFF09", 1)
3319
3320
  ])
3320
- ], 8, _hoisted_1$6)
3321
+ ], 8, _hoisted_1$7)
3321
3322
  ]),
3322
3323
  _: 1
3323
3324
  }, 8, ["data", "current-node-key"])) : vue.createCommentVNode("", true)
@@ -3331,8 +3332,8 @@
3331
3332
  }
3332
3333
  });
3333
3334
 
3334
- const _hoisted_1$5 = { class: "m-editor-code-block-list" };
3335
- const _hoisted_2$1 = { class: "code-header-wrapper" };
3335
+ const _hoisted_1$6 = { class: "m-editor-code-block-list" };
3336
+ const _hoisted_2$2 = { class: "code-header-wrapper" };
3336
3337
  const _hoisted_3 = /* @__PURE__ */ vue.createTextVNode("\u65B0\u589E");
3337
3338
  const _hoisted_4 = ["id"];
3338
3339
  const _hoisted_5 = { class: "list-item" };
@@ -3353,7 +3354,7 @@
3353
3354
  d: "M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"
3354
3355
  })
3355
3356
  ], -1);
3356
- const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
3357
+ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
3357
3358
  __name: "CodeBlockList",
3358
3359
  props: {
3359
3360
  customError: null
@@ -3481,9 +3482,9 @@
3481
3482
  stage?.select(compId);
3482
3483
  };
3483
3484
  return (_ctx, _cache) => {
3484
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [
3485
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
3485
3486
  vue.renderSlot(_ctx.$slots, "code-block-panel-header", {}, () => [
3486
- vue.createElementVNode("div", _hoisted_2$1, [
3487
+ vue.createElementVNode("div", _hoisted_2$2, [
3487
3488
  vue.createVNode(vue.unref(design.TMagicInput), {
3488
3489
  class: vue.normalizeClass([vue.unref(editable) ? "code-filter-input" : "code-filter-input-no-btn"]),
3489
3490
  size: "small",
@@ -3532,7 +3533,7 @@
3532
3533
  placement: "bottom"
3533
3534
  }, {
3534
3535
  default: vue.withCtx(() => [
3535
- vue.createVNode(_sfc_main$n, {
3536
+ vue.createVNode(_sfc_main$o, {
3536
3537
  icon: vue.unref(editable) ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
3537
3538
  class: "edit-icon",
3538
3539
  onClick: vue.withModifiers(($event) => editCode(`${data.id}`), ["stop"])
@@ -3547,7 +3548,7 @@
3547
3548
  placement: "bottom"
3548
3549
  }, {
3549
3550
  default: vue.withCtx(() => [
3550
- vue.createVNode(_sfc_main$n, {
3551
+ vue.createVNode(_sfc_main$o, {
3551
3552
  icon: vue.unref(iconsVue.Link),
3552
3553
  class: "edit-icon",
3553
3554
  onClick: vue.withModifiers(($event) => toggleCombineRelation(data), ["stop"])
@@ -3562,7 +3563,7 @@
3562
3563
  placement: "bottom"
3563
3564
  }, {
3564
3565
  default: vue.withCtx(() => [
3565
- vue.createVNode(_sfc_main$n, {
3566
+ vue.createVNode(_sfc_main$o, {
3566
3567
  icon: vue.unref(iconsVue.Close),
3567
3568
  class: "edit-icon",
3568
3569
  onClick: vue.withModifiers(($event) => deleteCode(`${data.id}`), ["stop"])
@@ -3597,7 +3598,7 @@
3597
3598
  ]),
3598
3599
  _: 3
3599
3600
  }, 8, ["data"])) : vue.createCommentVNode("", true),
3600
- vue.createVNode(_sfc_main$f, null, {
3601
+ vue.createVNode(_sfc_main$g, null, {
3601
3602
  "code-block-edit-panel-header": vue.withCtx(({ id }) => [
3602
3603
  vue.renderSlot(_ctx.$slots, "code-block-edit-panel-header", { id })
3603
3604
  ]),
@@ -3608,8 +3609,8 @@
3608
3609
  }
3609
3610
  });
3610
3611
 
3611
- const _hoisted_1$4 = ["onClick", "onDragstart"];
3612
- const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
3612
+ const _hoisted_1$5 = ["onClick", "onDragstart"];
3613
+ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
3613
3614
  __name: "ComponentListPanel",
3614
3615
  setup(__props) {
3615
3616
  const searchText = vue.ref("");
@@ -3699,7 +3700,7 @@
3699
3700
  name: `${index}`
3700
3701
  }, {
3701
3702
  title: vue.withCtx(() => [
3702
- vue.createVNode(_sfc_main$n, { icon: vue.unref(iconsVue.Grid) }, null, 8, ["icon"]),
3703
+ vue.createVNode(_sfc_main$o, { icon: vue.unref(iconsVue.Grid) }, null, 8, ["icon"]),
3703
3704
  vue.createTextVNode(vue.toDisplayString(group.title), 1)
3704
3705
  ]),
3705
3706
  default: vue.withCtx(() => [
@@ -3714,7 +3715,7 @@
3714
3715
  onDrag: dragHandler
3715
3716
  }, [
3716
3717
  vue.renderSlot(_ctx.$slots, "component-list-item", { component: item }, () => [
3717
- vue.createVNode(_sfc_main$n, {
3718
+ vue.createVNode(_sfc_main$o, {
3718
3719
  icon: item.icon
3719
3720
  }, null, 8, ["icon"]),
3720
3721
  vue.createVNode(vue.unref(design.TMagicTooltip), {
@@ -3728,7 +3729,7 @@
3728
3729
  _: 2
3729
3730
  }, 1032, ["content"])
3730
3731
  ])
3731
- ], 40, _hoisted_1$4);
3732
+ ], 40, _hoisted_1$5);
3732
3733
  }), 128))
3733
3734
  ]),
3734
3735
  _: 2
@@ -3745,7 +3746,7 @@
3745
3746
  }
3746
3747
  });
3747
3748
 
3748
- const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
3749
+ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
3749
3750
  __name: "ContentMenu",
3750
3751
  props: {
3751
3752
  menuData: { default: () => [] },
@@ -3825,7 +3826,7 @@
3825
3826
  });
3826
3827
  return (_ctx, _cache) => {
3827
3828
  const _component_content_menu = vue.resolveComponent("content-menu", true);
3828
- return __props.menuData.length && visible.value ? (vue.openBlock(), vue.createElementBlock("div", {
3829
+ return __props.menuData.length ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
3829
3830
  key: 0,
3830
3831
  class: "magic-editor-content-menu",
3831
3832
  ref_key: "menu",
@@ -3834,7 +3835,7 @@
3834
3835
  }, [
3835
3836
  vue.createElementVNode("div", null, [
3836
3837
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.menuData, (item, index) => {
3837
- return vue.openBlock(), vue.createBlock(_sfc_main$i, {
3838
+ return vue.openBlock(), vue.createBlock(_sfc_main$j, {
3838
3839
  "event-type": "mouseup",
3839
3840
  data: item,
3840
3841
  key: index,
@@ -3853,12 +3854,14 @@
3853
3854
  onHide: hide
3854
3855
  }, null, 8, ["menu-data"])
3855
3856
  ]))
3856
- ], 4)) : vue.createCommentVNode("", true);
3857
+ ], 4)), [
3858
+ [vue.vShow, visible.value]
3859
+ ]) : vue.createCommentVNode("", true);
3857
3860
  };
3858
3861
  }
3859
3862
  });
3860
3863
 
3861
- const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
3864
+ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
3862
3865
  __name: "LayerMenu",
3863
3866
  setup(__props, { expose }) {
3864
3867
  const services = vue.inject("services");
@@ -3946,7 +3949,7 @@
3946
3949
  show
3947
3950
  });
3948
3951
  return (_ctx, _cache) => {
3949
- return vue.openBlock(), vue.createBlock(_sfc_main$c, {
3952
+ return vue.openBlock(), vue.createBlock(_sfc_main$d, {
3950
3953
  "menu-data": vue.unref(menuData),
3951
3954
  ref_key: "menu",
3952
3955
  ref: menu,
@@ -3956,8 +3959,8 @@
3956
3959
  }
3957
3960
  });
3958
3961
 
3959
- const _hoisted_1$3 = ["id", "onMouseenter"];
3960
- const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
3962
+ const _hoisted_1$4 = ["id", "onMouseenter"];
3963
+ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
3961
3964
  __name: "LayerPanel",
3962
3965
  setup(__props) {
3963
3966
  const throttleTime = 150;
@@ -4240,12 +4243,12 @@
4240
4243
  }, () => [
4241
4244
  vue.createElementVNode("span", null, vue.toDisplayString(`${data.name} (${data.id})`), 1)
4242
4245
  ])
4243
- ], 42, _hoisted_1$3)
4246
+ ], 42, _hoisted_1$4)
4244
4247
  ]),
4245
4248
  _: 3
4246
4249
  }, 8, ["default-expanded-keys", "data", "show-checkbox"])) : vue.createCommentVNode("", true),
4247
4250
  (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
4248
- vue.createVNode(_sfc_main$b, {
4251
+ vue.createVNode(_sfc_main$c, {
4249
4252
  ref_key: "menu",
4250
4253
  ref: menu
4251
4254
  }, null, 512)
@@ -4257,11 +4260,11 @@
4257
4260
  }
4258
4261
  });
4259
4262
 
4260
- const _hoisted_1$2 = {
4263
+ const _hoisted_1$3 = {
4261
4264
  key: 1,
4262
4265
  class: "magic-editor-tab-panel-title"
4263
4266
  };
4264
- const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
4267
+ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
4265
4268
  __name: "TabPane",
4266
4269
  props: {
4267
4270
  data: null
@@ -4278,7 +4281,7 @@
4278
4281
  type: "component",
4279
4282
  icon: iconsVue.Coin,
4280
4283
  text: "\u7EC4\u4EF6",
4281
- component: _sfc_main$d,
4284
+ component: _sfc_main$e,
4282
4285
  slots: {}
4283
4286
  };
4284
4287
  case "layer":
@@ -4286,7 +4289,7 @@
4286
4289
  type: "component",
4287
4290
  icon: iconsVue.Files,
4288
4291
  text: "\u5DF2\u9009\u7EC4\u4EF6",
4289
- component: _sfc_main$a,
4292
+ component: _sfc_main$b,
4290
4293
  slots: {}
4291
4294
  };
4292
4295
  case "code-block":
@@ -4294,7 +4297,7 @@
4294
4297
  type: "component",
4295
4298
  icon: iconsVue.EditPen,
4296
4299
  text: "\u4EE3\u7801\u7F16\u8F91",
4297
- component: _sfc_main$e,
4300
+ component: _sfc_main$f,
4298
4301
  slots: {}
4299
4302
  };
4300
4303
  default:
@@ -4310,11 +4313,11 @@
4310
4313
  (vue.openBlock(), vue.createElementBlock("div", {
4311
4314
  key: vue.unref(config).text
4312
4315
  }, [
4313
- vue.unref(config).icon ? (vue.openBlock(), vue.createBlock(_sfc_main$n, {
4316
+ vue.unref(config).icon ? (vue.openBlock(), vue.createBlock(_sfc_main$o, {
4314
4317
  key: 0,
4315
4318
  icon: vue.unref(config).icon
4316
4319
  }, null, 8, ["icon"])) : vue.createCommentVNode("", true),
4317
- vue.unref(config).text ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, vue.toDisplayString(vue.unref(config).text), 1)) : vue.createCommentVNode("", true)
4320
+ vue.unref(config).text ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, vue.toDisplayString(vue.unref(config).text), 1)) : vue.createCommentVNode("", true)
4318
4321
  ]))
4319
4322
  ]),
4320
4323
  default: vue.withCtx(() => [
@@ -4390,7 +4393,7 @@
4390
4393
  }
4391
4394
  });
4392
4395
 
4393
- const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
4396
+ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
4394
4397
  __name: "Sidebar",
4395
4398
  props: {
4396
4399
  data: { default: () => ({ type: "tabs", status: "\u7EC4\u4EF6", items: ["component-list", "layer", "code-block"] }) }
@@ -4418,7 +4421,7 @@
4418
4421
  }, {
4419
4422
  default: vue.withCtx(() => [
4420
4423
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.data.items, (item, index) => {
4421
- return vue.openBlock(), vue.createBlock(_sfc_main$9, {
4424
+ return vue.openBlock(), vue.createBlock(_sfc_main$a, {
4422
4425
  key: index,
4423
4426
  data: item
4424
4427
  }, vue.createSlots({ _: 2 }, [
@@ -4479,6 +4482,48 @@
4479
4482
  }
4480
4483
  });
4481
4484
 
4485
+ const _hoisted_1$2 = {
4486
+ key: 0,
4487
+ class: "m-editor-breadcrumb"
4488
+ };
4489
+ const _hoisted_2$1 = { key: 0 };
4490
+ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
4491
+ __name: "Breadcrumb",
4492
+ setup(__props) {
4493
+ const services = vue.inject("services");
4494
+ const editorService = services?.editorService;
4495
+ const node = vue.computed(() => editorService?.get("node"));
4496
+ const nodes = vue.computed(() => editorService?.get("nodes") || []);
4497
+ const root = vue.computed(() => editorService?.get("root"));
4498
+ const path = vue.computed(() => utils.getNodePath(node.value?.id || "", root.value?.items || []));
4499
+ const select = async (node2) => {
4500
+ await editorService?.select(node2);
4501
+ editorService?.get("stage")?.select(node2.id);
4502
+ };
4503
+ return (_ctx, _cache) => {
4504
+ return vue.unref(nodes).length === 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
4505
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(path), (item, index) => {
4506
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
4507
+ key: item.id
4508
+ }, [
4509
+ vue.createVNode(vue.unref(design.TMagicButton), {
4510
+ text: "",
4511
+ disabled: item.id === vue.unref(node)?.id,
4512
+ onClick: ($event) => select(item)
4513
+ }, {
4514
+ default: vue.withCtx(() => [
4515
+ vue.createTextVNode(vue.toDisplayString(item.name), 1)
4516
+ ]),
4517
+ _: 2
4518
+ }, 1032, ["disabled", "onClick"]),
4519
+ index < vue.unref(path).length - 1 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$1, "/")) : vue.createCommentVNode("", true)
4520
+ ], 64);
4521
+ }), 128))
4522
+ ])) : vue.createCommentVNode("", true);
4523
+ };
4524
+ }
4525
+ });
4526
+
4482
4527
  const _hoisted_1$1 = {
4483
4528
  key: 1,
4484
4529
  style: { "width": "21px" }
@@ -4565,14 +4610,14 @@
4565
4610
  class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
4566
4611
  onClick: addPage
4567
4612
  }, [
4568
- vue.createVNode(_sfc_main$n, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
4613
+ vue.createVNode(_sfc_main$o, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
4569
4614
  ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1)),
4570
4615
  canScroll.value ? (vue.openBlock(), vue.createElementBlock("div", {
4571
4616
  key: 2,
4572
4617
  class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
4573
4618
  onClick: _cache[0] || (_cache[0] = ($event) => scroll("left"))
4574
4619
  }, [
4575
- vue.createVNode(_sfc_main$n, { icon: vue.unref(iconsVue.ArrowLeftBold) }, null, 8, ["icon"])
4620
+ vue.createVNode(_sfc_main$o, { icon: vue.unref(iconsVue.ArrowLeftBold) }, null, 8, ["icon"])
4576
4621
  ])) : vue.createCommentVNode("", true),
4577
4622
  vue.unref(pageLength) ? (vue.openBlock(), vue.createElementBlock("div", {
4578
4623
  key: 3,
@@ -4588,7 +4633,7 @@
4588
4633
  class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
4589
4634
  onClick: _cache[1] || (_cache[1] = ($event) => scroll("right"))
4590
4635
  }, [
4591
- vue.createVNode(_sfc_main$n, { icon: vue.unref(iconsVue.ArrowRightBold) }, null, 8, ["icon"])
4636
+ vue.createVNode(_sfc_main$o, { icon: vue.unref(iconsVue.ArrowRightBold) }, null, 8, ["icon"])
4592
4637
  ])) : vue.createCommentVNode("", true)
4593
4638
  ], 512);
4594
4639
  };
@@ -4657,7 +4702,7 @@
4657
4702
  default: vue.withCtx(() => [
4658
4703
  vue.createElementVNode("div", null, [
4659
4704
  vue.renderSlot(_ctx.$slots, "page-bar-popover", { page: item }, () => [
4660
- vue.createVNode(_sfc_main$i, {
4705
+ vue.createVNode(_sfc_main$j, {
4661
4706
  data: {
4662
4707
  type: "button",
4663
4708
  text: "\u590D\u5236",
@@ -4665,7 +4710,7 @@
4665
4710
  handler: () => copy(item)
4666
4711
  }
4667
4712
  }, null, 8, ["data"]),
4668
- vue.createVNode(_sfc_main$i, {
4713
+ vue.createVNode(_sfc_main$j, {
4669
4714
  data: {
4670
4715
  type: "button",
4671
4716
  text: "\u5220\u9664",
@@ -5131,7 +5176,7 @@
5131
5176
  };
5132
5177
  expose({ show });
5133
5178
  return (_ctx, _cache) => {
5134
- return vue.openBlock(), vue.createBlock(_sfc_main$c, {
5179
+ return vue.openBlock(), vue.createBlock(_sfc_main$d, {
5135
5180
  "menu-data": menuData,
5136
5181
  ref_key: "menu",
5137
5182
  ref: menu
@@ -5396,6 +5441,7 @@
5396
5441
  ref_key: "workspace",
5397
5442
  ref: workspace
5398
5443
  }, [
5444
+ vue.createVNode(_sfc_main$8),
5399
5445
  vue.renderSlot(_ctx.$slots, "stage", {}, () => [
5400
5446
  (vue.openBlock(), vue.createBlock(_sfc_main$2, {
5401
5447
  key: vue.unref(page)?.id
@@ -5439,11 +5485,11 @@
5439
5485
  const _sfc_main = vue.defineComponent({
5440
5486
  name: "m-editor",
5441
5487
  components: {
5442
- NavMenu: _sfc_main$h,
5443
- Sidebar: _sfc_main$8,
5488
+ NavMenu: _sfc_main$i,
5489
+ Sidebar: _sfc_main$9,
5444
5490
  Workspace: _sfc_main$1,
5445
- PropsPanel: _sfc_main$g,
5446
- Framework: _sfc_main$j
5491
+ PropsPanel: _sfc_main$h,
5492
+ Framework: _sfc_main$k
5447
5493
  },
5448
5494
  props: {
5449
5495
  modelValue: {
@@ -5739,34 +5785,34 @@
5739
5785
  app.config.globalProperties.$TMAGIC_EDITOR = option;
5740
5786
  setConfig(option);
5741
5787
  app.component(Editor.name, Editor);
5742
- app.component("m-fields-ui-select", _sfc_main$p);
5743
- app.component("m-fields-code-link", _sfc_main$r);
5744
- app.component("m-fields-vs-code", _sfc_main$s);
5745
- app.component("magic-code-editor", _sfc_main$o);
5746
- app.component("m-fields-code-select", _sfc_main$q);
5788
+ app.component("m-fields-ui-select", _sfc_main$q);
5789
+ app.component("m-fields-code-link", _sfc_main$s);
5790
+ app.component("m-fields-vs-code", _sfc_main$t);
5791
+ app.component("magic-code-editor", _sfc_main$p);
5792
+ app.component("m-fields-code-select", _sfc_main$r);
5747
5793
  }
5748
5794
  };
5749
5795
 
5750
5796
  exports.COPY_STORAGE_KEY = COPY_STORAGE_KEY;
5751
- exports.CodeBlockList = _sfc_main$e;
5797
+ exports.CodeBlockList = _sfc_main$f;
5752
5798
  exports.CodeDeleteErrorType = CodeDeleteErrorType;
5753
5799
  exports.CodeEditorMode = CodeEditorMode;
5754
- exports.CodeSelect = _sfc_main$q;
5800
+ exports.CodeSelect = _sfc_main$r;
5755
5801
  exports.CodeSelectOp = CodeSelectOp;
5756
5802
  exports.ColumnLayout = ColumnLayout;
5757
- exports.ComponentListPanel = _sfc_main$d;
5758
- exports.ContentMenu = _sfc_main$c;
5803
+ exports.ComponentListPanel = _sfc_main$e;
5804
+ exports.ContentMenu = _sfc_main$d;
5759
5805
  exports.Fixed2Other = Fixed2Other;
5760
5806
  exports.H_GUIDE_LINE_STORAGE_KEY = H_GUIDE_LINE_STORAGE_KEY;
5761
- exports.Icon = _sfc_main$n;
5807
+ exports.Icon = _sfc_main$o;
5762
5808
  exports.Keys = Keys;
5763
5809
  exports.LayerOffset = LayerOffset;
5764
- exports.LayerPanel = _sfc_main$a;
5810
+ exports.LayerPanel = _sfc_main$b;
5765
5811
  exports.Layout = Layout;
5766
- exports.PropsPanel = _sfc_main$g;
5767
- exports.TMagicCodeEditor = _sfc_main$o;
5812
+ exports.PropsPanel = _sfc_main$h;
5813
+ exports.TMagicCodeEditor = _sfc_main$p;
5768
5814
  exports.TMagicEditor = Editor;
5769
- exports.ToolButton = _sfc_main$i;
5815
+ exports.ToolButton = _sfc_main$j;
5770
5816
  exports.V_GUIDE_LINE_STORAGE_KEY = V_GUIDE_LINE_STORAGE_KEY;
5771
5817
  exports.change2Fixed = change2Fixed;
5772
5818
  exports.codeBlockService = codeBlockService;