@antdv-next/x 1.1.2-beta.6 → 1.1.3-beta.1
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/bubble/BubbleList.js +3 -8
- package/dist/index.umd.js +27 -13
- package/dist/mermaid/Mermaid.d.ts +10 -1
- package/dist/mermaid/Mermaid.js +20 -1
- package/dist/mermaid/index.d.ts +1 -1
- package/dist/package.js +1 -1
- package/dist/x-provider/hooks/use-x-provider-context.d.ts +2 -2
- package/es/{Serializer-y_SfSPKv.js → Serializer-D1JYN1kI.js} +4 -4
- package/es/{_basePickBy-Cy7KVmkk.js → _basePickBy-DFHEGO2M.js} +23 -23
- package/es/{_baseUniq-Ch3HuHeT.js → _baseUniq-BlS7rXTs.js} +83 -83
- package/es/antdv-next-x.esm.js +7563 -7541
- package/es/{arc-caEkbRYF.js → arc-BuXEd18J.js} +3 -3
- package/es/architecture-PBZL5I3N-D7tS55xM.js +3 -0
- package/es/{architectureDiagram-2XIMDMQ5-B4BHdsAL.js → architectureDiagram-2XIMDMQ5-CmfsCwJk.js} +9 -9
- package/es/{blockDiagram-WCTKOSBZ-nXanZ0sc.js → blockDiagram-WCTKOSBZ-lJAan65A.js} +12 -12
- package/es/{c4Diagram-IC4MRINW-C-gVp6th.js → c4Diagram-IC4MRINW-B1c2x_1Q.js} +6 -6
- package/es/channel-DFgF_2F7.js +5 -0
- package/es/{chunk-4BX2VUAB-fLFD6XW0.js → chunk-4BX2VUAB-J2N81Fpp.js} +2 -2
- package/es/{chunk-55IACEB6-OtyKJzCH.js → chunk-55IACEB6-DGtfGRgi.js} +2 -2
- package/es/{chunk-7E7YKBS2-C1dd36rm.js → chunk-7E7YKBS2-CL2d4WAf.js} +2 -2
- package/es/{chunk-7R4GIKGN-DuTRhdsf.js → chunk-7R4GIKGN-QT6IorJ_.js} +3 -3
- package/es/{chunk-C72U2L5F-ClmZGhFC.js → chunk-C72U2L5F-OHTVpS-m.js} +2 -2
- package/es/{chunk-EGIJ26TM-Bar_u1MN.js → chunk-EGIJ26TM-DyMPGYrB.js} +2 -2
- package/es/{chunk-FMBD7UC4-C_uJ_JJA.js → chunk-FMBD7UC4-DCcRjunY.js} +2 -2
- package/es/{chunk-GEFDOKGD-P7WhyrTU.js → chunk-GEFDOKGD-BWpC-zoH.js} +30 -30
- package/es/{chunk-GLR3WWYH-BBFkZWLy.js → chunk-GLR3WWYH-DiXcKb5Y.js} +8 -8
- package/es/{chunk-HHEYEP7N-rv5s5WD4.js → chunk-HHEYEP7N-Cxc7E4dX.js} +3 -3
- package/es/{chunk-JSJVCQXG-89HUGe9V.js → chunk-JSJVCQXG-D8_heHOp.js} +4 -4
- package/es/{chunk-KX2RTZJC-pMHnNRQg.js → chunk-KX2RTZJC-D5cc4rj6.js} +3 -3
- package/es/{chunk-KYZI473N-DJmSs1gK.js → chunk-KYZI473N-BHJ3T5Zv.js} +8 -8
- package/es/{chunk-L3YUKLVL-Ck54qytQ.js → chunk-L3YUKLVL-7oGaUOdc.js} +2 -2
- package/es/{chunk-MX3YWQON-MkpK3uBD.js → chunk-MX3YWQON-BxE-Aq9c.js} +2 -2
- package/es/{chunk-NQ4KR5QH-I7cFzfZu.js → chunk-NQ4KR5QH-EYQBXkqP.js} +7 -7
- package/es/{chunk-O4XLMI2P-e-ZzDQwg.js → chunk-O4XLMI2P-qjOoGpnx.js} +11 -11
- package/es/{chunk-OZEHJAEY-DULNd43V.js → chunk-OZEHJAEY-D82nx27s.js} +2 -2
- package/es/{chunk-PQ6SQG4A-CQ9Csv7s.js → chunk-PQ6SQG4A-D3jtNCWN.js} +3 -3
- package/es/{chunk-PU5JKC2W-DkEFvrjH.js → chunk-PU5JKC2W-DdP8BS-S.js} +16 -16
- package/es/{chunk-QZHKN3VN-qww1plfw.js → chunk-QZHKN3VN-CW3cFN-h.js} +2 -2
- package/es/{chunk-R5LLSJPH-BERXSDGJ.js → chunk-R5LLSJPH-CreI2kO9.js} +2 -2
- package/es/{chunk-WL4C6EOR-B6HgoDzQ.js → chunk-WL4C6EOR-BDbxJyGk.js} +9 -9
- package/es/{chunk-XIRO2GV7-CFHofxVB.js → chunk-XIRO2GV7-S5KkbVnN.js} +2 -2
- package/es/{chunk-XPW4576I-DgvoNZkW.js → chunk-XPW4576I-B0KVSHwE.js} +2 -2
- package/es/{chunk-XZSTWKYB-k8_EXrSa.js → chunk-XZSTWKYB-CucN1XvM.js} +93 -93
- package/es/{chunk-YBOYWFTD-BUW4AzEX.js → chunk-YBOYWFTD-CvaddD9G.js} +4 -4
- package/es/classDiagram-VBA2DB6C-Co3LMmg8.js +29 -0
- package/es/classDiagram-v2-RAHNMMFH-BZscgdF2.js +29 -0
- package/es/clone-r3YukIBB.js +8 -0
- package/es/{cose-bilkent-S5V4N54A-DS-oTq56.js → cose-bilkent-S5V4N54A-B5OQuIhl.js} +3 -3
- package/es/{cytoscape.esm-BY3wHcbp.js → cytoscape.esm-i2CZcWd-.js} +1 -1
- package/es/{dagre-BJOzGlhW.js → dagre-5aGJFKmT.js} +57 -57
- package/es/{dagre-KLK3FWXG-CFC0naVr.js → dagre-KLK3FWXG-BI5QQMXo.js} +16 -16
- package/es/{defaultLocale-BaPFSbai.js → defaultLocale-bckJcYh1.js} +12 -12
- package/es/{diagram-E7M64L7V-DxuJj8ZG.js → diagram-E7M64L7V-Dz62Vz_a.js} +32 -32
- package/es/{diagram-IFDJBPK2-BOpPZ6pu.js → diagram-IFDJBPK2-9fjvFkSc.js} +7 -7
- package/es/{diagram-P4PSJMXO--ChDmcya.js → diagram-P4PSJMXO-BlX6jFjZ.js} +7 -7
- package/es/{dist-DltyvPj3.js → dist-BX_roQzC.js} +1 -1
- package/es/{erDiagram-INFDFZHY-TwqnRnWa.js → erDiagram-INFDFZHY-BcRXu8Cp.js} +14 -14
- package/es/{flowDiagram-PKNHOUZH-DOIW1Sy9.js → flowDiagram-PKNHOUZH-UeyfgU8z.js} +17 -17
- package/es/{ganttDiagram-A5KZAMGK-DdMePS21.js → ganttDiagram-A5KZAMGK-txCzqgQ5.js} +28 -28
- package/es/gitGraph-HDMCJU4V-CxsS0Qr1.js +3 -0
- package/es/{gitGraphDiagram-K3NZZRJ6-CLbRwChG.js → gitGraphDiagram-K3NZZRJ6-DghWYaFU.js} +7 -7
- package/es/{graphlib-C7ysKz4u.js → graphlib-dRkI1OCL.js} +4 -4
- package/es/{html-C2-_98S6.js → html-B6UxjOv0.js} +1 -1
- package/es/html-Hb1oe8XT.js +2 -0
- package/es/info-3K5VOQVL-COqdvM99.js +3 -0
- package/es/{infoDiagram-LFFYTUFH-DQAZ-vFk.js → infoDiagram-LFFYTUFH-CA-vlAvP.js} +5 -5
- package/es/{init-PAs0hR-b.js → init-B75p2clj.js} +1 -1
- package/es/{isArrayLikeObject-y3HlYDaX.js → isArrayLikeObject-jl2bjkAJ.js} +80 -80
- package/es/{isEmpty-2JxdWtc-.js → isEmpty-CmA-HYrg.js} +3 -3
- package/es/{ishikawaDiagram-PHBUUO56-B0r2IgGz.js → ishikawaDiagram-PHBUUO56-DjdpS9Lb.js} +6 -6
- package/es/{journeyDiagram-4ABVD52K-DnMUhOvg.js → journeyDiagram-4ABVD52K-CIJfC1fp.js} +6 -6
- package/es/{kanban-definition-K7BYSVSG-Da5Y-nJy.js → kanban-definition-K7BYSVSG-CC2vwGck.js} +11 -11
- package/es/{katex-b-xdokOf.js → katex-DCMiIo1z.js} +1 -1
- package/es/{line-h2iCTGsE.js → line-Cu9NTacD.js} +4 -4
- package/es/{linear-Bv7XrZCH.js → linear-C0rAYYmp.js} +23 -23
- package/es/{math-DPzKeDKn.js → math-CoDOuve-.js} +1 -1
- package/es/{mermaid-parser.core-kTgpNO7M.js → mermaid-parser.core-7Wn2L29P.js} +16 -16
- package/es/{mermaid.core-Cdr_0as6.js → mermaid.core-Bvy_Q6Hu.js} +44 -44
- package/es/{mindmap-definition-YRQLILUH-CtrmThyY.js → mindmap-definition-YRQLILUH-BzTYDYmK.js} +16 -16
- package/es/{ordinal-D8PKtxfM.js → ordinal-F3U6aXtP.js} +3 -3
- package/es/packet-RMMSAZCW-2PTjWKLd.js +3 -0
- package/es/{path-DZ-6AyWK.js → path-Dm3C8WEs.js} +3 -3
- package/es/pie-UPGHQEXC-Du8-k-EA.js +3 -0
- package/es/{pieDiagram-SKSYHLDU-DAsfTGvY.js → pieDiagram-SKSYHLDU-COvqE_C6.js} +14 -14
- package/es/{quadrantDiagram-337W2JSQ-CZLbmQS4.js → quadrantDiagram-337W2JSQ-Dgv8ccjt.js} +4 -4
- package/es/radar-KQ55EAFF-jJOhyjxC.js +3 -0
- package/es/{requirementDiagram-Z7DCOOCP-DwsKf6TC.js → requirementDiagram-Z7DCOOCP-B2NyhxO-.js} +13 -13
- package/es/{rough.esm-C_hJ3ICT.js → rough.esm-BhGP2Udb.js} +1 -1
- package/es/{sankeyDiagram-WA2Y5GQK-DBe5YfW4.js → sankeyDiagram-WA2Y5GQK-BfnH_gpl.js} +18 -18
- package/es/{sequenceDiagram-2WXFIKYE-C_KUoojT.js → sequenceDiagram-2WXFIKYE-DXssVQOF.js} +8 -8
- package/es/{src-BukXhifV.js → src-CUQ6oOYk.js} +86 -86
- package/es/{stateDiagram-RAJIS63D-Bjd_66hy.js → stateDiagram-RAJIS63D-DvDLfupV.js} +17 -17
- package/es/stateDiagram-v2-FVOUBMTO-DIXyaX9W.js +27 -0
- package/es/{timeline-definition-YZTLITO2-pFt6rZ6S.js → timeline-definition-YZTLITO2-ErcRjbZf.js} +4 -4
- package/es/treemap-KZPCXAKY-CvZAIYVa.js +3 -0
- package/es/{vennDiagram-LZ73GAT5-VaCO6k4H.js → vennDiagram-LZ73GAT5-CDTZUtc8.js} +7 -7
- package/es/{vue-DTiWrQBM.js → vue-2aJw7p5p.js} +2 -2
- package/es/{vue-html-BG3Xflut.js → vue-html-DEjI8X9t.js} +1 -1
- package/es/{xychartDiagram-JWTSCODW-xS5ybemA.js → xychartDiagram-JWTSCODW-Y21jBOTg.js} +12 -12
- package/package.json +8 -2
- package/es/architecture-PBZL5I3N-DHfBr78A.js +0 -3
- package/es/channel-DoEe9DF9.js +0 -5
- package/es/classDiagram-VBA2DB6C-CqK9jdgh.js +0 -29
- package/es/classDiagram-v2-RAHNMMFH-ZDIng8Gz.js +0 -29
- package/es/clone-BXDbKCDu.js +0 -8
- package/es/gitGraph-HDMCJU4V-DbzpICZW.js +0 -3
- package/es/html-JbFqcNgP.js +0 -2
- package/es/info-3K5VOQVL-CpUiQuel.js +0 -3
- package/es/packet-RMMSAZCW-UTFQ0FQx.js +0 -3
- package/es/pie-UPGHQEXC-CarAcBSi.js +0 -3
- package/es/radar-KQ55EAFF-NXK5PC9R.js +0 -3
- package/es/stateDiagram-v2-FVOUBMTO-BjIcGAyh.js +0 -27
- package/es/treemap-KZPCXAKY-Cj9QakFB.js +0 -3
|
@@ -4,15 +4,11 @@ import { XBubbleDivider } from "./Divider.js";
|
|
|
4
4
|
import { useCompatibleScroll } from "./hooks/useCompatibleScroll.js";
|
|
5
5
|
import { XBubbleSystem } from "./System.js";
|
|
6
6
|
import { computed, createVNode, defineComponent, mergeProps, ref } from "vue";
|
|
7
|
+
import { createElementRef } from "@v-c/util/dist/vnode";
|
|
7
8
|
//#region components/bubble/BubbleList.tsx
|
|
8
9
|
function roleCfgIsFunction(roleCfg) {
|
|
9
10
|
return typeof roleCfg === "function";
|
|
10
11
|
}
|
|
11
|
-
function pickBubbleRef(instance) {
|
|
12
|
-
if (!instance) return null;
|
|
13
|
-
if ("nativeElement" in instance) return instance.nativeElement ?? null;
|
|
14
|
-
return instance;
|
|
15
|
-
}
|
|
16
12
|
var bubbleSlotNames = [
|
|
17
13
|
"contentRender",
|
|
18
14
|
"loadingRender",
|
|
@@ -115,11 +111,10 @@ var XBubbleList = /* @__PURE__ */ defineComponent({
|
|
|
115
111
|
rest
|
|
116
112
|
};
|
|
117
113
|
});
|
|
118
|
-
const setBubbleRef = (key) => (
|
|
119
|
-
const element = pickBubbleRef(instance);
|
|
114
|
+
const setBubbleRef = (key) => createElementRef((element) => {
|
|
120
115
|
if (element) bubbleRefs.set(key, element);
|
|
121
116
|
else bubbleRefs.delete(key);
|
|
122
|
-
};
|
|
117
|
+
});
|
|
123
118
|
const scrollTo = ({ key, top, behavior = "smooth", block }) => {
|
|
124
119
|
const scrollBox = scrollBoxRef.value;
|
|
125
120
|
if (!scrollBox) return;
|
package/dist/index.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue"), require("antdv-next/config-provider/context"), require("antdv-next"), require("@antdv-next/icons"), require("@antdv-next/cssinjs"), require("@antdv-next/cssinjs/cssinjs-utils"), require("@ant-design/fast-color"), require("antdv-next/dist/theme/useToken"), require("@vueuse/core"), require("shiki/core"), require("shiki/dist/themes/vitesse-dark.mjs"), require("shiki/dist/themes/vitesse-light.mjs"), require("shiki/engine/javascript"), require("@v-c/util")) : typeof define === "function" && define.amd ? define([
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue"), require("antdv-next/config-provider/context"), require("antdv-next"), require("@antdv-next/icons"), require("@antdv-next/cssinjs"), require("@antdv-next/cssinjs/cssinjs-utils"), require("@ant-design/fast-color"), require("antdv-next/dist/theme/useToken"), require("@vueuse/core"), require("@v-c/util/dist/vnode"), require("shiki/core"), require("shiki/dist/themes/vitesse-dark.mjs"), require("shiki/dist/themes/vitesse-light.mjs"), require("shiki/engine/javascript"), require("@v-c/util")) : typeof define === "function" && define.amd ? define([
|
|
3
3
|
"exports",
|
|
4
4
|
"vue",
|
|
5
5
|
"antdv-next/config-provider/context",
|
|
@@ -10,13 +10,14 @@
|
|
|
10
10
|
"@ant-design/fast-color",
|
|
11
11
|
"antdv-next/dist/theme/useToken",
|
|
12
12
|
"@vueuse/core",
|
|
13
|
+
"@v-c/util/dist/vnode",
|
|
13
14
|
"shiki/core",
|
|
14
15
|
"shiki/dist/themes/vitesse-dark.mjs",
|
|
15
16
|
"shiki/dist/themes/vitesse-light.mjs",
|
|
16
17
|
"shiki/engine/javascript",
|
|
17
18
|
"@v-c/util"
|
|
18
|
-
], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.AntdComponents = {}, global.Vue, global.antdv_next_config_provider_context, global.antd, global.AntdIcons, global._antdv_next_cssinjs, global._antdv_next_cssinjs_cssinjs_utils, global._ant_design_fast_color, global.antdv_next_dist_theme_useToken, global._vueuse_core, global.shiki_core, global.shiki_dist_themes_vitesse_dark_mjs, global.shiki_dist_themes_vitesse_light_mjs, global.shiki_engine_javascript, global._v_c_util));
|
|
19
|
-
})(this, function(exports, vue, antdv_next_config_provider_context, antdv_next, _antdv_next_icons, _antdv_next_cssinjs, _antdv_next_cssinjs_cssinjs_utils, _ant_design_fast_color, antdv_next_dist_theme_useToken, _vueuse_core, shiki_core, shiki_dist_themes_vitesse_dark_mjs, shiki_dist_themes_vitesse_light_mjs, shiki_engine_javascript, _v_c_util) {
|
|
19
|
+
], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.AntdComponents = {}, global.Vue, global.antdv_next_config_provider_context, global.antd, global.AntdIcons, global._antdv_next_cssinjs, global._antdv_next_cssinjs_cssinjs_utils, global._ant_design_fast_color, global.antdv_next_dist_theme_useToken, global._vueuse_core, global._v_c_util_dist_vnode, global.shiki_core, global.shiki_dist_themes_vitesse_dark_mjs, global.shiki_dist_themes_vitesse_light_mjs, global.shiki_engine_javascript, global._v_c_util));
|
|
20
|
+
})(this, function(exports, vue, antdv_next_config_provider_context, antdv_next, _antdv_next_icons, _antdv_next_cssinjs, _antdv_next_cssinjs_cssinjs_utils, _ant_design_fast_color, antdv_next_dist_theme_useToken, _vueuse_core, _v_c_util_dist_vnode, shiki_core, shiki_dist_themes_vitesse_dark_mjs, shiki_dist_themes_vitesse_light_mjs, shiki_engine_javascript, _v_c_util) {
|
|
20
21
|
Object.defineProperties(exports, {
|
|
21
22
|
__esModule: { value: true },
|
|
22
23
|
[Symbol.toStringTag]: { value: "Module" }
|
|
@@ -48,7 +49,7 @@
|
|
|
48
49
|
shiki_dist_themes_vitesse_dark_mjs = __toESM(shiki_dist_themes_vitesse_dark_mjs);
|
|
49
50
|
shiki_dist_themes_vitesse_light_mjs = __toESM(shiki_dist_themes_vitesse_light_mjs);
|
|
50
51
|
//#region package.json
|
|
51
|
-
var version = "1.1.
|
|
52
|
+
var version = "1.1.3-beta.1";
|
|
52
53
|
//#endregion
|
|
53
54
|
//#region components/x-provider/context.ts
|
|
54
55
|
var XProviderContextKey = Symbol("antdv-next-x-provider-context");
|
|
@@ -4507,11 +4508,6 @@
|
|
|
4507
4508
|
function roleCfgIsFunction(roleCfg) {
|
|
4508
4509
|
return typeof roleCfg === "function";
|
|
4509
4510
|
}
|
|
4510
|
-
function pickBubbleRef(instance) {
|
|
4511
|
-
if (!instance) return null;
|
|
4512
|
-
if ("nativeElement" in instance) return instance.nativeElement ?? null;
|
|
4513
|
-
return instance;
|
|
4514
|
-
}
|
|
4515
4511
|
var bubbleSlotNames = [
|
|
4516
4512
|
"contentRender",
|
|
4517
4513
|
"loadingRender",
|
|
@@ -4614,11 +4610,10 @@
|
|
|
4614
4610
|
rest
|
|
4615
4611
|
};
|
|
4616
4612
|
});
|
|
4617
|
-
const setBubbleRef = (key) => (
|
|
4618
|
-
const element = pickBubbleRef(instance);
|
|
4613
|
+
const setBubbleRef = (key) => (0, _v_c_util_dist_vnode.createElementRef)((element) => {
|
|
4619
4614
|
if (element) bubbleRefs.set(key, element);
|
|
4620
4615
|
else bubbleRefs.delete(key);
|
|
4621
|
-
};
|
|
4616
|
+
});
|
|
4622
4617
|
const scrollTo = ({ key, top, behavior = "smooth", block }) => {
|
|
4623
4618
|
const scrollBox = scrollBoxRef.value;
|
|
4624
4619
|
if (!scrollBox) return;
|
|
@@ -7312,19 +7307,30 @@
|
|
|
7312
7307
|
isDragging.value = false;
|
|
7313
7308
|
}
|
|
7314
7309
|
function handleZoomIn() {
|
|
7310
|
+
if (mergedRenderType.value !== RenderType.Image) return;
|
|
7315
7311
|
scale.value = Math.min(scale.value + .2, 3);
|
|
7316
7312
|
}
|
|
7317
7313
|
function handleZoomOut() {
|
|
7314
|
+
if (mergedRenderType.value !== RenderType.Image) return;
|
|
7318
7315
|
scale.value = Math.max(scale.value - .2, .5);
|
|
7319
7316
|
}
|
|
7320
7317
|
function handleReset() {
|
|
7318
|
+
if (mergedRenderType.value !== RenderType.Image) return;
|
|
7321
7319
|
scale.value = 1;
|
|
7322
7320
|
position.value = {
|
|
7323
7321
|
x: 0,
|
|
7324
7322
|
y: 0
|
|
7325
7323
|
};
|
|
7326
7324
|
}
|
|
7325
|
+
async function handleCopy() {
|
|
7326
|
+
try {
|
|
7327
|
+
await navigator.clipboard.writeText(props.content);
|
|
7328
|
+
} catch (error) {
|
|
7329
|
+
warning(false, "Mermaid", `Copy failed: ${String(error)}`);
|
|
7330
|
+
}
|
|
7331
|
+
}
|
|
7327
7332
|
function handleDownload() {
|
|
7333
|
+
if (mergedRenderType.value !== RenderType.Image) return;
|
|
7328
7334
|
const svgElement = graphRef.value?.querySelector("svg");
|
|
7329
7335
|
if (!svgElement) return;
|
|
7330
7336
|
const svgString = new XMLSerializer().serializeToString(svgElement);
|
|
@@ -7384,7 +7390,15 @@
|
|
|
7384
7390
|
});
|
|
7385
7391
|
function renderHeader() {
|
|
7386
7392
|
if (props.header === null) return null;
|
|
7387
|
-
if (slots.header) return slots.header(
|
|
7393
|
+
if (slots.header) return slots.header({
|
|
7394
|
+
renderType: mergedRenderType.value,
|
|
7395
|
+
setRenderType: switchRenderType,
|
|
7396
|
+
zoomIn: handleZoomIn,
|
|
7397
|
+
zoomOut: handleZoomOut,
|
|
7398
|
+
resetZoom: handleReset,
|
|
7399
|
+
download: handleDownload,
|
|
7400
|
+
copy: handleCopy
|
|
7401
|
+
});
|
|
7388
7402
|
if (props.header !== void 0) return props.header;
|
|
7389
7403
|
return (0, vue.createVNode)("div", {
|
|
7390
7404
|
"class": [`${props.prefixCls}-header`, mergedClasses.value.header],
|
|
@@ -28,11 +28,20 @@ export interface MermaidProps extends Omit<HTMLAttributes, "content" | "class" |
|
|
|
28
28
|
export interface MermaidRef {
|
|
29
29
|
nativeElement: HTMLDivElement;
|
|
30
30
|
}
|
|
31
|
+
export interface MermaidHeaderSlotScope {
|
|
32
|
+
renderType: MermaidRenderType;
|
|
33
|
+
setRenderType: (type: MermaidRenderType) => void;
|
|
34
|
+
zoomIn: () => void;
|
|
35
|
+
zoomOut: () => void;
|
|
36
|
+
resetZoom: () => void;
|
|
37
|
+
download: () => void;
|
|
38
|
+
copy: () => Promise<void>;
|
|
39
|
+
}
|
|
31
40
|
export interface MermaidSlots {
|
|
32
41
|
/**
|
|
33
42
|
* 自定义头部区,优先级高于 `header` 属性
|
|
34
43
|
*/
|
|
35
|
-
header?: () => VNodeChild;
|
|
44
|
+
header?: (scope: MermaidHeaderSlotScope) => VNodeChild;
|
|
36
45
|
}
|
|
37
46
|
declare enum RenderType {
|
|
38
47
|
Code = "code",
|
package/dist/mermaid/Mermaid.js
CHANGED
|
@@ -228,19 +228,30 @@ var XMermaid = /* @__PURE__ */ defineComponent({
|
|
|
228
228
|
isDragging.value = false;
|
|
229
229
|
}
|
|
230
230
|
function handleZoomIn() {
|
|
231
|
+
if (mergedRenderType.value !== RenderType.Image) return;
|
|
231
232
|
scale.value = Math.min(scale.value + .2, 3);
|
|
232
233
|
}
|
|
233
234
|
function handleZoomOut() {
|
|
235
|
+
if (mergedRenderType.value !== RenderType.Image) return;
|
|
234
236
|
scale.value = Math.max(scale.value - .2, .5);
|
|
235
237
|
}
|
|
236
238
|
function handleReset() {
|
|
239
|
+
if (mergedRenderType.value !== RenderType.Image) return;
|
|
237
240
|
scale.value = 1;
|
|
238
241
|
position.value = {
|
|
239
242
|
x: 0,
|
|
240
243
|
y: 0
|
|
241
244
|
};
|
|
242
245
|
}
|
|
246
|
+
async function handleCopy() {
|
|
247
|
+
try {
|
|
248
|
+
await navigator.clipboard.writeText(props.content);
|
|
249
|
+
} catch (error) {
|
|
250
|
+
warning(false, "Mermaid", `Copy failed: ${String(error)}`);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
243
253
|
function handleDownload() {
|
|
254
|
+
if (mergedRenderType.value !== RenderType.Image) return;
|
|
244
255
|
const svgElement = graphRef.value?.querySelector("svg");
|
|
245
256
|
if (!svgElement) return;
|
|
246
257
|
const svgString = new XMLSerializer().serializeToString(svgElement);
|
|
@@ -300,7 +311,15 @@ var XMermaid = /* @__PURE__ */ defineComponent({
|
|
|
300
311
|
});
|
|
301
312
|
function renderHeader() {
|
|
302
313
|
if (props.header === null) return null;
|
|
303
|
-
if (slots.header) return slots.header(
|
|
314
|
+
if (slots.header) return slots.header({
|
|
315
|
+
renderType: mergedRenderType.value,
|
|
316
|
+
setRenderType: switchRenderType,
|
|
317
|
+
zoomIn: handleZoomIn,
|
|
318
|
+
zoomOut: handleZoomOut,
|
|
319
|
+
resetZoom: handleReset,
|
|
320
|
+
download: handleDownload,
|
|
321
|
+
copy: handleCopy
|
|
322
|
+
});
|
|
304
323
|
if (props.header !== void 0) return props.header;
|
|
305
324
|
return createVNode("div", {
|
|
306
325
|
"class": [`${props.prefixCls}-header`, mergedClasses.value.header],
|
package/dist/mermaid/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { default as Mermaid } from './Mermaid';
|
|
2
|
-
export type { MermaidActions, MermaidProps, MermaidRef, MermaidRenderType, MermaidSemanticType, MermaidSlots, } from './Mermaid';
|
|
2
|
+
export type { MermaidActions, MermaidHeaderSlotScope, MermaidProps, MermaidRef, MermaidRenderType, MermaidSemanticType, MermaidSlots, } from './Mermaid';
|
|
3
3
|
export default Mermaid;
|
package/dist/package.js
CHANGED
|
@@ -2,7 +2,7 @@ export declare const defaultPrefixCls = "ant";
|
|
|
2
2
|
export default function useXProviderContext(): {
|
|
3
3
|
theme: import('antdv-next').ThemeConfig | undefined;
|
|
4
4
|
getPrefixCls: (suffixCls?: string, customizePrefixCls?: string) => string;
|
|
5
|
-
direction: import('antdv-next/config-provider/context').DirectionType;
|
|
6
|
-
csp: import('antdv-next/config-provider/context').CSPConfig | undefined;
|
|
5
|
+
direction: import('antdv-next/dist/config-provider/context').DirectionType;
|
|
6
|
+
csp: import('antdv-next/dist/config-provider/context').CSPConfig | undefined;
|
|
7
7
|
iconPrefixCls: string;
|
|
8
8
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/stylis/src/Enum.js
|
|
1
|
+
//#region ../../node_modules/.pnpm/stylis@4.3.6/node_modules/stylis/src/Enum.js
|
|
2
2
|
var e = "-ms-", t = "-moz-", n = "-webkit-", r = "comm", i = "rule", a = "decl", o = "@import", s = "@namespace", c = "@keyframes", l = "@layer", u = Math.abs, d = String.fromCharCode, f = Object.assign;
|
|
3
3
|
function p(e, t) {
|
|
4
4
|
return v(e, 0) ^ 45 ? (((t << 2 ^ v(e, 0)) << 2 ^ v(e, 1)) << 2 ^ v(e, 2)) << 2 ^ v(e, 3) : 0;
|
|
@@ -39,7 +39,7 @@ function w(e, t) {
|
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
//#endregion
|
|
42
|
-
//#region ../../node_modules/stylis/src/Tokenizer.js
|
|
42
|
+
//#region ../../node_modules/.pnpm/stylis@4.3.6/node_modules/stylis/src/Tokenizer.js
|
|
43
43
|
var T = 1, E = 1, D = 0, O = 0, k = 0, A = "";
|
|
44
44
|
function j(e, t, n, r, i, a, o, s) {
|
|
45
45
|
return {
|
|
@@ -150,7 +150,7 @@ function J(e) {
|
|
|
150
150
|
return z(e, O);
|
|
151
151
|
}
|
|
152
152
|
//#endregion
|
|
153
|
-
//#region ../../node_modules/stylis/src/Parser.js
|
|
153
|
+
//#region ../../node_modules/.pnpm/stylis@4.3.6/node_modules/stylis/src/Parser.js
|
|
154
154
|
function Y(e) {
|
|
155
155
|
return H(X("", null, null, null, [""], e = V(e), 0, [0], e));
|
|
156
156
|
}
|
|
@@ -241,7 +241,7 @@ function Q(e, t, n, r, i) {
|
|
|
241
241
|
return j(e, t, n, a, y(e, 0, r), y(e, r + 1, -1), r, i);
|
|
242
242
|
}
|
|
243
243
|
//#endregion
|
|
244
|
-
//#region ../../node_modules/stylis/src/Serializer.js
|
|
244
|
+
//#region ../../node_modules/.pnpm/stylis@4.3.6/node_modules/stylis/src/Serializer.js
|
|
245
245
|
function $(e, t) {
|
|
246
246
|
for (var n = "", r = 0; r < e.length; r++) n += t(e[r], r, e, t) || "";
|
|
247
247
|
return n;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { A as e, B as t, C as n, E as r, H as i, M as a, U as o, V as s, k as c, p as l, w as u, z as d } from "./isArrayLikeObject-
|
|
2
|
-
import { A as f, C as p, D as m, M as h, N as g, S as _, T as v, f as y, h as b, u as x, w as S } from "./_baseUniq-
|
|
3
|
-
//#region ../../node_modules/lodash-es/_trimmedEndIndex.js
|
|
1
|
+
import { A as e, B as t, C as n, E as r, H as i, M as a, U as o, V as s, k as c, p as l, w as u, z as d } from "./isArrayLikeObject-jl2bjkAJ.js";
|
|
2
|
+
import { A as f, C as p, D as m, M as h, N as g, S as _, T as v, f as y, h as b, u as x, w as S } from "./_baseUniq-BlS7rXTs.js";
|
|
3
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_trimmedEndIndex.js
|
|
4
4
|
var C = /\s/;
|
|
5
5
|
function w(e) {
|
|
6
6
|
for (var t = e.length; t-- && C.test(e.charAt(t)););
|
|
7
7
|
return t;
|
|
8
8
|
}
|
|
9
9
|
//#endregion
|
|
10
|
-
//#region ../../node_modules/lodash-es/_baseTrim.js
|
|
10
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseTrim.js
|
|
11
11
|
var ee = /^\s+/;
|
|
12
12
|
function T(e) {
|
|
13
13
|
return e && e.slice(0, w(e) + 1).replace(ee, "");
|
|
14
14
|
}
|
|
15
15
|
//#endregion
|
|
16
|
-
//#region ../../node_modules/lodash-es/toNumber.js
|
|
16
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/toNumber.js
|
|
17
17
|
var E = NaN, D = /^[-+]0x[0-9a-f]+$/i, O = /^0b[01]+$/i, k = /^0o[0-7]+$/i, A = parseInt;
|
|
18
18
|
function j(e) {
|
|
19
19
|
if (typeof e == "number") return e;
|
|
@@ -28,24 +28,24 @@ function j(e) {
|
|
|
28
28
|
return r || k.test(e) ? A(e.slice(2), r ? 2 : 8) : D.test(e) ? E : +e;
|
|
29
29
|
}
|
|
30
30
|
//#endregion
|
|
31
|
-
//#region ../../node_modules/lodash-es/toFinite.js
|
|
31
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/toFinite.js
|
|
32
32
|
var M = Infinity, N = 17976931348623157e292;
|
|
33
33
|
function P(e) {
|
|
34
34
|
return e ? (e = j(e), e === M || e === -M ? (e < 0 ? -1 : 1) * N : e === e ? e : 0) : e === 0 ? e : 0;
|
|
35
35
|
}
|
|
36
36
|
//#endregion
|
|
37
|
-
//#region ../../node_modules/lodash-es/toInteger.js
|
|
37
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/toInteger.js
|
|
38
38
|
function F(e) {
|
|
39
39
|
var t = P(e), n = t % 1;
|
|
40
40
|
return t === t ? n ? t - n : t : 0;
|
|
41
41
|
}
|
|
42
42
|
//#endregion
|
|
43
|
-
//#region ../../node_modules/lodash-es/flatten.js
|
|
43
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/flatten.js
|
|
44
44
|
function I(e) {
|
|
45
45
|
return e != null && e.length ? _(e, 1) : [];
|
|
46
46
|
}
|
|
47
47
|
//#endregion
|
|
48
|
-
//#region ../../node_modules/lodash-es/defaults.js
|
|
48
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/defaults.js
|
|
49
49
|
var L = Object.prototype, R = L.hasOwnProperty, z = r(function(t, r) {
|
|
50
50
|
t = Object(t);
|
|
51
51
|
var i = -1, a = r.length, o = a > 2 ? r[2] : void 0;
|
|
@@ -56,13 +56,13 @@ var L = Object.prototype, R = L.hasOwnProperty, z = r(function(t, r) {
|
|
|
56
56
|
return t;
|
|
57
57
|
});
|
|
58
58
|
//#endregion
|
|
59
|
-
//#region ../../node_modules/lodash-es/last.js
|
|
59
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/last.js
|
|
60
60
|
function B(e) {
|
|
61
61
|
var t = e == null ? 0 : e.length;
|
|
62
62
|
return t ? e[t - 1] : void 0;
|
|
63
63
|
}
|
|
64
64
|
//#endregion
|
|
65
|
-
//#region ../../node_modules/lodash-es/_createFind.js
|
|
65
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_createFind.js
|
|
66
66
|
function V(e) {
|
|
67
67
|
return function(t, n, r) {
|
|
68
68
|
var i = Object(t);
|
|
@@ -77,7 +77,7 @@ function V(e) {
|
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
//#endregion
|
|
80
|
-
//#region ../../node_modules/lodash-es/findIndex.js
|
|
80
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/findIndex.js
|
|
81
81
|
var H = Math.max;
|
|
82
82
|
function U(e, t, n) {
|
|
83
83
|
var r = e == null ? 0 : e.length;
|
|
@@ -86,10 +86,10 @@ function U(e, t, n) {
|
|
|
86
86
|
return i < 0 && (i = H(r + i, 0)), f(e, y(t, 3), i);
|
|
87
87
|
}
|
|
88
88
|
//#endregion
|
|
89
|
-
//#region ../../node_modules/lodash-es/find.js
|
|
89
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/find.js
|
|
90
90
|
var W = V(U);
|
|
91
91
|
//#endregion
|
|
92
|
-
//#region ../../node_modules/lodash-es/_baseMap.js
|
|
92
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseMap.js
|
|
93
93
|
function G(e, t) {
|
|
94
94
|
var n = -1, r = u(e) ? Array(e.length) : [];
|
|
95
95
|
return x(e, function(e, i, a) {
|
|
@@ -97,34 +97,34 @@ function G(e, t) {
|
|
|
97
97
|
}), r;
|
|
98
98
|
}
|
|
99
99
|
//#endregion
|
|
100
|
-
//#region ../../node_modules/lodash-es/map.js
|
|
100
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/map.js
|
|
101
101
|
function K(e, t) {
|
|
102
102
|
return (s(e) ? h : G)(e, y(t, 3));
|
|
103
103
|
}
|
|
104
104
|
//#endregion
|
|
105
|
-
//#region ../../node_modules/lodash-es/_baseHas.js
|
|
105
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseHas.js
|
|
106
106
|
var q = Object.prototype.hasOwnProperty;
|
|
107
107
|
function J(e, t) {
|
|
108
108
|
return e != null && q.call(e, t);
|
|
109
109
|
}
|
|
110
110
|
//#endregion
|
|
111
|
-
//#region ../../node_modules/lodash-es/has.js
|
|
111
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/has.js
|
|
112
112
|
function Y(e, t) {
|
|
113
113
|
return e != null && b(e, t, J);
|
|
114
114
|
}
|
|
115
115
|
//#endregion
|
|
116
|
-
//#region ../../node_modules/lodash-es/isString.js
|
|
116
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isString.js
|
|
117
117
|
var X = "[object String]";
|
|
118
118
|
function Z(e) {
|
|
119
119
|
return typeof e == "string" || !s(e) && i(e) && o(e) == X;
|
|
120
120
|
}
|
|
121
121
|
//#endregion
|
|
122
|
-
//#region ../../node_modules/lodash-es/_baseLt.js
|
|
122
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseLt.js
|
|
123
123
|
function Q(e, t) {
|
|
124
124
|
return e < t;
|
|
125
125
|
}
|
|
126
126
|
//#endregion
|
|
127
|
-
//#region ../../node_modules/lodash-es/_baseExtremum.js
|
|
127
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseExtremum.js
|
|
128
128
|
function $(e, t, n) {
|
|
129
129
|
for (var r = -1, i = e.length; ++r < i;) {
|
|
130
130
|
var a = e[r], o = t(a);
|
|
@@ -133,12 +133,12 @@ function $(e, t, n) {
|
|
|
133
133
|
return c;
|
|
134
134
|
}
|
|
135
135
|
//#endregion
|
|
136
|
-
//#region ../../node_modules/lodash-es/min.js
|
|
136
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/min.js
|
|
137
137
|
function te(e) {
|
|
138
138
|
return e && e.length ? $(e, d, Q) : void 0;
|
|
139
139
|
}
|
|
140
140
|
//#endregion
|
|
141
|
-
//#region ../../node_modules/lodash-es/_baseSet.js
|
|
141
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseSet.js
|
|
142
142
|
function ne(e, n, r, i) {
|
|
143
143
|
if (!t(e)) return e;
|
|
144
144
|
n = v(n, e);
|
|
@@ -154,7 +154,7 @@ function ne(e, n, r, i) {
|
|
|
154
154
|
return e;
|
|
155
155
|
}
|
|
156
156
|
//#endregion
|
|
157
|
-
//#region ../../node_modules/lodash-es/_basePickBy.js
|
|
157
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_basePickBy.js
|
|
158
158
|
function re(e, t, n) {
|
|
159
159
|
for (var r = -1, i = t.length, a = {}; ++r < i;) {
|
|
160
160
|
var o = t[r], s = p(e, o);
|