@antdv-next/x 1.0.2-beta.4 → 1.1.0
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/folder/DirectoryTree.d.ts +124 -0
- package/dist/folder/DirectoryTree.js +128 -0
- package/dist/folder/FilePreview.d.ts +125 -0
- package/dist/folder/FilePreview.js +170 -0
- package/dist/folder/Folder.d.ts +209 -0
- package/dist/folder/Folder.js +337 -0
- package/dist/folder/index.d.ts +3 -0
- package/dist/folder/index.js +5 -0
- package/dist/folder/interface.d.ts +78 -0
- package/dist/folder/interface.js +0 -0
- package/dist/folder/style/folder.d.ts +7 -0
- package/dist/folder/style/folder.js +89 -0
- package/dist/folder/style/index.d.ts +11 -0
- package/dist/folder/style/index.js +11 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/index.umd.js +741 -30
- package/dist/package.js +1 -1
- package/dist/theme/interface/components.d.ts +2 -3
- package/dist/x-provider/context.d.ts +2 -0
- package/dist/x-provider/hooks/use-x-provider-context.d.ts +2 -2
- package/es/{Serializer-D1JYN1kI.js → Serializer-y_SfSPKv.js} +4 -4
- package/es/{_basePickBy-DFHEGO2M.js → _basePickBy-Cy7KVmkk.js} +23 -23
- package/es/{_baseUniq-BlS7rXTs.js → _baseUniq-Ch3HuHeT.js} +83 -83
- package/es/antdv-next-x.esm.js +14799 -12318
- package/es/{arc-BuXEd18J.js → arc-caEkbRYF.js} +3 -3
- package/es/architecture-PBZL5I3N-DHfBr78A.js +3 -0
- package/es/{architectureDiagram-2XIMDMQ5-CmfsCwJk.js → architectureDiagram-2XIMDMQ5-B4BHdsAL.js} +9 -9
- package/es/{blockDiagram-WCTKOSBZ-lJAan65A.js → blockDiagram-WCTKOSBZ-nXanZ0sc.js} +12 -12
- package/es/{c4Diagram-IC4MRINW-B1c2x_1Q.js → c4Diagram-IC4MRINW-C-gVp6th.js} +6 -6
- package/es/channel-DoEe9DF9.js +5 -0
- package/es/{chunk-4BX2VUAB-J2N81Fpp.js → chunk-4BX2VUAB-fLFD6XW0.js} +2 -2
- package/es/{chunk-55IACEB6-DGtfGRgi.js → chunk-55IACEB6-OtyKJzCH.js} +2 -2
- package/es/{chunk-7E7YKBS2-CL2d4WAf.js → chunk-7E7YKBS2-C1dd36rm.js} +2 -2
- package/es/{chunk-7R4GIKGN-QT6IorJ_.js → chunk-7R4GIKGN-DuTRhdsf.js} +3 -3
- package/es/{chunk-C72U2L5F-OHTVpS-m.js → chunk-C72U2L5F-ClmZGhFC.js} +2 -2
- package/es/{chunk-EGIJ26TM-DyMPGYrB.js → chunk-EGIJ26TM-Bar_u1MN.js} +2 -2
- package/es/{chunk-FMBD7UC4-DCcRjunY.js → chunk-FMBD7UC4-C_uJ_JJA.js} +2 -2
- package/es/{chunk-GEFDOKGD-BWpC-zoH.js → chunk-GEFDOKGD-P7WhyrTU.js} +30 -30
- package/es/{chunk-GLR3WWYH-DiXcKb5Y.js → chunk-GLR3WWYH-BvazRgdo.js} +8 -8
- package/es/{chunk-HHEYEP7N-Cxc7E4dX.js → chunk-HHEYEP7N-rv5s5WD4.js} +3 -3
- package/es/{chunk-JSJVCQXG-D8_heHOp.js → chunk-JSJVCQXG-89HUGe9V.js} +4 -4
- package/es/{chunk-KX2RTZJC-D5cc4rj6.js → chunk-KX2RTZJC-pMHnNRQg.js} +3 -3
- package/es/{chunk-KYZI473N-BHJ3T5Zv.js → chunk-KYZI473N-DJmSs1gK.js} +8 -8
- package/es/{chunk-L3YUKLVL-7oGaUOdc.js → chunk-L3YUKLVL-Ck54qytQ.js} +2 -2
- package/es/{chunk-MX3YWQON-BxE-Aq9c.js → chunk-MX3YWQON-MkpK3uBD.js} +2 -2
- package/es/{chunk-NQ4KR5QH-EYQBXkqP.js → chunk-NQ4KR5QH-DGshodQv.js} +7 -7
- package/es/{chunk-O4XLMI2P-qjOoGpnx.js → chunk-O4XLMI2P-e-ZzDQwg.js} +11 -11
- package/es/{chunk-OZEHJAEY-D82nx27s.js → chunk-OZEHJAEY-DULNd43V.js} +2 -2
- package/es/{chunk-PQ6SQG4A-D3jtNCWN.js → chunk-PQ6SQG4A-CQ9Csv7s.js} +3 -3
- package/es/{chunk-PU5JKC2W-DdP8BS-S.js → chunk-PU5JKC2W-DkEFvrjH.js} +16 -16
- package/es/{chunk-QZHKN3VN-CW3cFN-h.js → chunk-QZHKN3VN-qww1plfw.js} +2 -2
- package/es/{chunk-R5LLSJPH-CreI2kO9.js → chunk-R5LLSJPH-BERXSDGJ.js} +2 -2
- package/es/{chunk-WL4C6EOR-BDbxJyGk.js → chunk-WL4C6EOR-C-d8WPS7.js} +9 -9
- package/es/{chunk-XIRO2GV7-S5KkbVnN.js → chunk-XIRO2GV7-CFHofxVB.js} +2 -2
- package/es/{chunk-XPW4576I-B0KVSHwE.js → chunk-XPW4576I-DgvoNZkW.js} +2 -2
- package/es/{chunk-XZSTWKYB-CucN1XvM.js → chunk-XZSTWKYB-k8_EXrSa.js} +93 -93
- package/es/{chunk-YBOYWFTD-CvaddD9G.js → chunk-YBOYWFTD-BUW4AzEX.js} +4 -4
- package/es/classDiagram-VBA2DB6C-DWTAs0Zm.js +29 -0
- package/es/classDiagram-v2-RAHNMMFH-CoxCdmrt.js +29 -0
- package/es/clone-BXDbKCDu.js +8 -0
- package/es/{cose-bilkent-S5V4N54A-B5OQuIhl.js → cose-bilkent-S5V4N54A-CnrS2OC1.js} +3 -3
- package/es/{cytoscape.esm-i2CZcWd-.js → cytoscape.esm-BY3wHcbp.js} +1 -1
- package/es/{dagre-5aGJFKmT.js → dagre-BJOzGlhW.js} +57 -57
- package/es/{dagre-KLK3FWXG-BI5QQMXo.js → dagre-KLK3FWXG-CFC0naVr.js} +16 -16
- package/es/{defaultLocale-bckJcYh1.js → defaultLocale-BaPFSbai.js} +12 -12
- package/es/{diagram-E7M64L7V-Dz62Vz_a.js → diagram-E7M64L7V-DxuJj8ZG.js} +32 -32
- package/es/{diagram-IFDJBPK2-9fjvFkSc.js → diagram-IFDJBPK2-BOpPZ6pu.js} +7 -7
- package/es/{diagram-P4PSJMXO-BlX6jFjZ.js → diagram-P4PSJMXO--ChDmcya.js} +7 -7
- package/es/{dist-BX_roQzC.js → dist-DltyvPj3.js} +1 -1
- package/es/{erDiagram-INFDFZHY-BcRXu8Cp.js → erDiagram-INFDFZHY-BA3m-v87.js} +14 -14
- package/es/{flowDiagram-PKNHOUZH-UeyfgU8z.js → flowDiagram-PKNHOUZH-BCq6k3kr.js} +17 -17
- package/es/{ganttDiagram-A5KZAMGK-txCzqgQ5.js → ganttDiagram-A5KZAMGK-DdMePS21.js} +28 -28
- package/es/gitGraph-HDMCJU4V-DbzpICZW.js +3 -0
- package/es/{gitGraphDiagram-K3NZZRJ6-DghWYaFU.js → gitGraphDiagram-K3NZZRJ6-CLbRwChG.js} +7 -7
- package/es/{graphlib-dRkI1OCL.js → graphlib-C7ysKz4u.js} +4 -4
- package/es/{html-B6UxjOv0.js → html-C2-_98S6.js} +1 -1
- package/es/html-JbFqcNgP.js +2 -0
- package/es/info-3K5VOQVL-CpUiQuel.js +3 -0
- package/es/{infoDiagram-LFFYTUFH-CA-vlAvP.js → infoDiagram-LFFYTUFH-DQAZ-vFk.js} +5 -5
- package/es/{init-B75p2clj.js → init-PAs0hR-b.js} +1 -1
- package/es/{isArrayLikeObject-jl2bjkAJ.js → isArrayLikeObject-y3HlYDaX.js} +80 -80
- package/es/{isEmpty-CmA-HYrg.js → isEmpty-2JxdWtc-.js} +3 -3
- package/es/{ishikawaDiagram-PHBUUO56-DjdpS9Lb.js → ishikawaDiagram-PHBUUO56-B0r2IgGz.js} +6 -6
- package/es/{journeyDiagram-4ABVD52K-CIJfC1fp.js → journeyDiagram-4ABVD52K-DnMUhOvg.js} +6 -6
- package/es/{kanban-definition-K7BYSVSG-CC2vwGck.js → kanban-definition-K7BYSVSG-Da5Y-nJy.js} +11 -11
- package/es/{katex-DCMiIo1z.js → katex-b-xdokOf.js} +1 -1
- package/es/{line-Cu9NTacD.js → line-h2iCTGsE.js} +4 -4
- package/es/{linear-C0rAYYmp.js → linear-Bv7XrZCH.js} +23 -23
- package/es/{math-CoDOuve-.js → math-DPzKeDKn.js} +1 -1
- package/es/{mermaid-parser.core-7Wn2L29P.js → mermaid-parser.core-kTgpNO7M.js} +16 -16
- package/es/{mermaid.core-Bvy_Q6Hu.js → mermaid.core-Db1VE3-f.js} +44 -44
- package/es/{mindmap-definition-YRQLILUH-BzTYDYmK.js → mindmap-definition-YRQLILUH-CYeqnCde.js} +16 -16
- package/es/{ordinal-F3U6aXtP.js → ordinal-D8PKtxfM.js} +3 -3
- package/es/packet-RMMSAZCW-UTFQ0FQx.js +3 -0
- package/es/{path-Dm3C8WEs.js → path-DZ-6AyWK.js} +3 -3
- package/es/pie-UPGHQEXC-CarAcBSi.js +3 -0
- package/es/{pieDiagram-SKSYHLDU-COvqE_C6.js → pieDiagram-SKSYHLDU-DAsfTGvY.js} +14 -14
- package/es/{quadrantDiagram-337W2JSQ-Dgv8ccjt.js → quadrantDiagram-337W2JSQ-CZLbmQS4.js} +4 -4
- package/es/radar-KQ55EAFF-NXK5PC9R.js +3 -0
- package/es/{requirementDiagram-Z7DCOOCP-B2NyhxO-.js → requirementDiagram-Z7DCOOCP-Cb_Ygnfe.js} +13 -13
- package/es/{rough.esm-BhGP2Udb.js → rough.esm-C_hJ3ICT.js} +1 -1
- package/es/{sankeyDiagram-WA2Y5GQK-BfnH_gpl.js → sankeyDiagram-WA2Y5GQK-DBe5YfW4.js} +18 -18
- package/es/{sequenceDiagram-2WXFIKYE-DXssVQOF.js → sequenceDiagram-2WXFIKYE-C_KUoojT.js} +8 -8
- package/es/{src-CUQ6oOYk.js → src-BukXhifV.js} +86 -86
- package/es/{stateDiagram-RAJIS63D-DvDLfupV.js → stateDiagram-RAJIS63D-boG6DyfW.js} +17 -17
- package/es/stateDiagram-v2-FVOUBMTO-DHCajhrN.js +27 -0
- package/es/{timeline-definition-YZTLITO2-ErcRjbZf.js → timeline-definition-YZTLITO2-pFt6rZ6S.js} +4 -4
- package/es/treemap-KZPCXAKY-Cj9QakFB.js +3 -0
- package/es/{vennDiagram-LZ73GAT5-CDTZUtc8.js → vennDiagram-LZ73GAT5-VaCO6k4H.js} +7 -7
- package/es/{vue-2aJw7p5p.js → vue-DTiWrQBM.js} +2 -2
- package/es/{vue-html-DEjI8X9t.js → vue-html-BG3Xflut.js} +1 -1
- package/es/{xychartDiagram-JWTSCODW-Y21jBOTg.js → xychartDiagram-JWTSCODW-xS5ybemA.js} +12 -12
- package/package.json +1 -1
- package/es/architecture-PBZL5I3N-D7tS55xM.js +0 -3
- package/es/channel-DFgF_2F7.js +0 -5
- package/es/classDiagram-VBA2DB6C-Co3LMmg8.js +0 -29
- package/es/classDiagram-v2-RAHNMMFH-BZscgdF2.js +0 -29
- package/es/clone-r3YukIBB.js +0 -8
- package/es/gitGraph-HDMCJU4V-CxsS0Qr1.js +0 -3
- package/es/html-Hb1oe8XT.js +0 -2
- package/es/info-3K5VOQVL-COqdvM99.js +0 -3
- package/es/packet-RMMSAZCW-2PTjWKLd.js +0 -3
- package/es/pie-UPGHQEXC-Du8-k-EA.js +0 -3
- package/es/radar-KQ55EAFF-jJOhyjxC.js +0 -3
- package/es/stateDiagram-v2-FVOUBMTO-DIXyaX9W.js +0 -27
- package/es/treemap-KZPCXAKY-CvZAIYVa.js +0 -3
package/dist/index.umd.js
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
shiki_dist_themes_vitesse_dark_mjs = __toESM(shiki_dist_themes_vitesse_dark_mjs);
|
|
49
49
|
shiki_dist_themes_vitesse_light_mjs = __toESM(shiki_dist_themes_vitesse_light_mjs);
|
|
50
50
|
//#region package.json
|
|
51
|
-
var version = "1.0
|
|
51
|
+
var version = "1.1.0";
|
|
52
52
|
//#endregion
|
|
53
53
|
//#region components/x-provider/context.ts
|
|
54
54
|
var XProviderContextKey = Symbol("antdv-next-x-provider-context");
|
|
@@ -527,8 +527,8 @@
|
|
|
527
527
|
}
|
|
528
528
|
} };
|
|
529
529
|
};
|
|
530
|
-
var prepareComponentToken$
|
|
531
|
-
var style_default$
|
|
530
|
+
var prepareComponentToken$14 = () => ({});
|
|
531
|
+
var style_default$14 = genStyleHooks("Actions", (token) => {
|
|
532
532
|
const compToken = (0, _antdv_next_cssinjs_cssinjs_utils.mergeToken)(token, {});
|
|
533
533
|
return [
|
|
534
534
|
genActionsStyle(compToken),
|
|
@@ -538,7 +538,7 @@
|
|
|
538
538
|
initFadeLeftMotion(compToken),
|
|
539
539
|
initFadeMotion(compToken)
|
|
540
540
|
];
|
|
541
|
-
}, prepareComponentToken$
|
|
541
|
+
}, prepareComponentToken$14);
|
|
542
542
|
//#endregion
|
|
543
543
|
//#region components/actions/Actions.tsx
|
|
544
544
|
function _isSlot$7(s) {
|
|
@@ -623,7 +623,7 @@
|
|
|
623
623
|
const slots = (0, vue.useSlots)();
|
|
624
624
|
const contextConfig = useXComponentConfig("actions");
|
|
625
625
|
const rootRef = (0, vue.ref)();
|
|
626
|
-
const [hashId, cssVarCls] = style_default$
|
|
626
|
+
const [hashId, cssVarCls] = style_default$14((0, vue.computed)(() => props.prefixCls));
|
|
627
627
|
const rootPrefixCls = (0, vue.computed)(() => configCtx.value.getPrefixCls());
|
|
628
628
|
const motionName = (0, vue.computed)(() => {
|
|
629
629
|
if (!props.fadeIn && !props.fadeInLeft) return "";
|
|
@@ -782,7 +782,7 @@
|
|
|
782
782
|
setup(props) {
|
|
783
783
|
const attrs = (0, vue.useAttrs)();
|
|
784
784
|
const slots = (0, vue.useSlots)();
|
|
785
|
-
const [hashId, cssVarCls] = style_default$
|
|
785
|
+
const [hashId, cssVarCls] = style_default$14((0, vue.computed)(() => props.prefixCls));
|
|
786
786
|
const itemCls = `${props.prefixCls}-button-item`;
|
|
787
787
|
const domAttrs = (0, vue.computed)(() => {
|
|
788
788
|
const { class: _class, style: _style, ...rest } = attrs;
|
|
@@ -952,7 +952,7 @@
|
|
|
952
952
|
setup(props) {
|
|
953
953
|
const attrs = (0, vue.useAttrs)();
|
|
954
954
|
const slots = (0, vue.useSlots)();
|
|
955
|
-
const [hashId, cssVarCls] = style_default$
|
|
955
|
+
const [hashId, cssVarCls] = style_default$14((0, vue.computed)(() => props.prefixCls));
|
|
956
956
|
const copyCls = `${props.prefixCls}-copy`;
|
|
957
957
|
const domAttrs = (0, vue.computed)(() => {
|
|
958
958
|
const { class: _class, style: _style, ...rest } = attrs;
|
|
@@ -1050,7 +1050,7 @@
|
|
|
1050
1050
|
},
|
|
1051
1051
|
setup(props) {
|
|
1052
1052
|
const attrs = (0, vue.useAttrs)();
|
|
1053
|
-
const [hashId, cssVarCls] = style_default$
|
|
1053
|
+
const [hashId, cssVarCls] = style_default$14((0, vue.computed)(() => props.prefixCls));
|
|
1054
1054
|
const feedbackCls = `${props.prefixCls}-feedback`;
|
|
1055
1055
|
const domAttrs = (0, vue.computed)(() => {
|
|
1056
1056
|
const { class: _class, style: _style, ...rest } = attrs;
|
|
@@ -1862,11 +1862,11 @@
|
|
|
1862
1862
|
} }
|
|
1863
1863
|
} };
|
|
1864
1864
|
};
|
|
1865
|
-
var prepareComponentToken$
|
|
1866
|
-
var style_default$
|
|
1865
|
+
var prepareComponentToken$13 = () => ({});
|
|
1866
|
+
var style_default$13 = genStyleHooks("FileCard", (token) => {
|
|
1867
1867
|
const fileCardToken = (0, _antdv_next_cssinjs_cssinjs_utils.mergeToken)(token, {});
|
|
1868
1868
|
return [genFileCardStyle(fileCardToken), genFileCardListStyle(fileCardToken)];
|
|
1869
|
-
}, prepareComponentToken$
|
|
1869
|
+
}, prepareComponentToken$13);
|
|
1870
1870
|
//#endregion
|
|
1871
1871
|
//#region components/file-card/FileCard.tsx
|
|
1872
1872
|
var IMAGE_EXT = [
|
|
@@ -2098,7 +2098,7 @@
|
|
|
2098
2098
|
const attrs = (0, vue.useAttrs)();
|
|
2099
2099
|
const configCtx = (0, antdv_next_config_provider_context.useConfig)();
|
|
2100
2100
|
const contextConfig = useXComponentConfig("fileCard");
|
|
2101
|
-
const [hashId, cssVarCls] = style_default$
|
|
2101
|
+
const [hashId, cssVarCls] = style_default$13((0, vue.computed)(() => props.prefixCls));
|
|
2102
2102
|
const domAttrs = (0, vue.computed)(() => {
|
|
2103
2103
|
const { class: _class, style: _style, ...rest } = attrs;
|
|
2104
2104
|
return rest;
|
|
@@ -2288,7 +2288,7 @@
|
|
|
2288
2288
|
},
|
|
2289
2289
|
setup(props, { attrs, slots }) {
|
|
2290
2290
|
const configCtx = (0, antdv_next_config_provider_context.useConfig)();
|
|
2291
|
-
const [hashId, cssVarCls] = style_default$
|
|
2291
|
+
const [hashId, cssVarCls] = style_default$13((0, vue.computed)(() => props.prefixCls));
|
|
2292
2292
|
const compCls = (0, vue.computed)(() => `${props.prefixCls}-list`);
|
|
2293
2293
|
const list = (0, vue.ref)([]);
|
|
2294
2294
|
(0, vue.watch)(() => props.items, (items) => {
|
|
@@ -2941,13 +2941,13 @@
|
|
|
2941
2941
|
}
|
|
2942
2942
|
} } };
|
|
2943
2943
|
};
|
|
2944
|
-
var prepareComponentToken$
|
|
2944
|
+
var prepareComponentToken$12 = (token) => {
|
|
2945
2945
|
return { colorBgPlaceholderHover: new _ant_design_fast_color.FastColor(token.colorBgContainer).setA(.85).toRgbString() };
|
|
2946
2946
|
};
|
|
2947
|
-
var style_default$
|
|
2947
|
+
var style_default$12 = genStyleHooks("Attachments", (token) => {
|
|
2948
2948
|
const compToken = (0, _antdv_next_cssinjs_cssinjs_utils.mergeToken)(token, {});
|
|
2949
2949
|
return [genAttachmentsStyle(compToken), genFileListStyle(compToken)];
|
|
2950
|
-
}, prepareComponentToken$
|
|
2950
|
+
}, prepareComponentToken$12);
|
|
2951
2951
|
//#endregion
|
|
2952
2952
|
//#region components/attachments/index.tsx
|
|
2953
2953
|
function _isSlot$4(s) {
|
|
@@ -3065,7 +3065,7 @@
|
|
|
3065
3065
|
const configCtx = (0, antdv_next_config_provider_context.useConfig)();
|
|
3066
3066
|
const contextConfig = useXComponentConfig("attachments");
|
|
3067
3067
|
const containerRef = (0, vue.ref)(null);
|
|
3068
|
-
const [hashId, cssVarCls] = style_default$
|
|
3068
|
+
const [hashId, cssVarCls] = style_default$12((0, vue.computed)(() => props.prefixCls));
|
|
3069
3069
|
const mergedClasses = (0, vue.computed)(() => ({
|
|
3070
3070
|
...contextConfig.value.classes,
|
|
3071
3071
|
...props.classes
|
|
@@ -3678,12 +3678,12 @@
|
|
|
3678
3678
|
};
|
|
3679
3679
|
//#endregion
|
|
3680
3680
|
//#region components/bubble/style/index.ts
|
|
3681
|
-
var prepareComponentToken$
|
|
3681
|
+
var prepareComponentToken$11 = () => ({
|
|
3682
3682
|
typingContent: "\"|\"",
|
|
3683
3683
|
typingAnimationName: "cursorBlink",
|
|
3684
3684
|
typingAnimationDuration: "0.8s"
|
|
3685
3685
|
});
|
|
3686
|
-
var style_default$
|
|
3686
|
+
var style_default$11 = genStyleHooks("Bubble", (token) => {
|
|
3687
3687
|
const bubbleToken = (0, _antdv_next_cssinjs_cssinjs_utils.mergeToken)(token, {});
|
|
3688
3688
|
return [
|
|
3689
3689
|
genBubbleStyle(bubbleToken),
|
|
@@ -3694,7 +3694,7 @@
|
|
|
3694
3694
|
genSystemBubbleStyle(bubbleToken),
|
|
3695
3695
|
genDividerBubbleStyle(bubbleToken)
|
|
3696
3696
|
];
|
|
3697
|
-
}, prepareComponentToken$
|
|
3697
|
+
}, prepareComponentToken$11);
|
|
3698
3698
|
//#endregion
|
|
3699
3699
|
//#region components/bubble/hooks/useTyping.ts
|
|
3700
3700
|
function getLcp(left, right) {
|
|
@@ -4048,7 +4048,7 @@
|
|
|
4048
4048
|
const attrs = (0, vue.useAttrs)();
|
|
4049
4049
|
const contextConfig = useXComponentConfig("bubble");
|
|
4050
4050
|
const rootRef = (0, vue.ref)();
|
|
4051
|
-
const [hashId, cssVarCls] = style_default$
|
|
4051
|
+
const [hashId, cssVarCls] = style_default$11((0, vue.computed)(() => props.prefixCls));
|
|
4052
4052
|
expose({ get nativeElement() {
|
|
4053
4053
|
return rootRef.value;
|
|
4054
4054
|
} });
|
|
@@ -4577,7 +4577,7 @@
|
|
|
4577
4577
|
const scrollBoxRef = (0, vue.ref)();
|
|
4578
4578
|
const scrollContentRef = (0, vue.ref)();
|
|
4579
4579
|
const bubbleRefs = /* @__PURE__ */ new Map();
|
|
4580
|
-
const [hashId, cssVarCls] = style_default$
|
|
4580
|
+
const [hashId, cssVarCls] = style_default$11((0, vue.computed)(() => props.prefixCls));
|
|
4581
4581
|
const { scrollTo: compatibleScrollTo } = useCompatibleScroll(scrollBoxRef, scrollContentRef);
|
|
4582
4582
|
const listPrefixCls = (0, vue.computed)(() => `${props.prefixCls}-list`);
|
|
4583
4583
|
const handleScroll = (event) => {
|
|
@@ -4928,13 +4928,13 @@
|
|
|
4928
4928
|
}
|
|
4929
4929
|
} };
|
|
4930
4930
|
};
|
|
4931
|
-
var prepareComponentToken$
|
|
4931
|
+
var prepareComponentToken$10 = () => ({
|
|
4932
4932
|
codeFontFamily: "'Fira Code', 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', 'Droid Sans Mono', 'Source Code Pro', monospace",
|
|
4933
4933
|
codeFontSize: 14
|
|
4934
4934
|
});
|
|
4935
|
-
var style_default$
|
|
4935
|
+
var style_default$10 = genStyleHooks("CodeHighlighter", (token) => {
|
|
4936
4936
|
return [genCodeHighlighterStyle((0, _antdv_next_cssinjs_cssinjs_utils.mergeToken)(token, {}))];
|
|
4937
|
-
}, prepareComponentToken$
|
|
4937
|
+
}, prepareComponentToken$10);
|
|
4938
4938
|
//#endregion
|
|
4939
4939
|
//#region components/code-highlighter/index.tsx
|
|
4940
4940
|
var code_highlighter_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
@@ -5015,7 +5015,7 @@
|
|
|
5015
5015
|
const attrs = (0, vue.useAttrs)();
|
|
5016
5016
|
const contextConfig = useXComponentConfig("codeHighlighter");
|
|
5017
5017
|
const rootRef = (0, vue.ref)();
|
|
5018
|
-
const [hashId, cssVarCls] = style_default$
|
|
5018
|
+
const [hashId, cssVarCls] = style_default$10((0, vue.computed)(() => props.prefixCls));
|
|
5019
5019
|
const copied = (0, vue.ref)(false);
|
|
5020
5020
|
const highlightedHtml = (0, vue.shallowRef)("");
|
|
5021
5021
|
const highlightCode = async () => {
|
|
@@ -6009,7 +6009,7 @@
|
|
|
6009
6009
|
[`${componentCls}-group-collapse-trigger-close`]: { transform: "rotate(0deg)" }
|
|
6010
6010
|
} };
|
|
6011
6011
|
};
|
|
6012
|
-
var prepareComponentToken$
|
|
6012
|
+
var prepareComponentToken$9 = (token) => {
|
|
6013
6013
|
const creationBgColor = new _ant_design_fast_color.FastColor(token.colorPrimary).setA(.15);
|
|
6014
6014
|
const creationBorderColor = new _ant_design_fast_color.FastColor(token.colorPrimary).setA(.22);
|
|
6015
6015
|
const creationHoverColor = new _ant_design_fast_color.FastColor(token.colorPrimary).setA(.25);
|
|
@@ -6021,10 +6021,10 @@
|
|
|
6021
6021
|
shortcutKeyTextColor: shortcutKeyTextColor.toRgbString()
|
|
6022
6022
|
};
|
|
6023
6023
|
};
|
|
6024
|
-
var style_default$
|
|
6024
|
+
var style_default$9 = genStyleHooks("Conversations", (token) => {
|
|
6025
6025
|
const compToken = (0, _antdv_next_cssinjs_cssinjs_utils.mergeToken)(token, {});
|
|
6026
6026
|
return [genConversationsStyle(compToken), genCollapseMotion(compToken)];
|
|
6027
|
-
}, prepareComponentToken$
|
|
6027
|
+
}, prepareComponentToken$9);
|
|
6028
6028
|
//#endregion
|
|
6029
6029
|
//#region components/conversations/index.tsx
|
|
6030
6030
|
function isTypingTarget(target) {
|
|
@@ -6138,7 +6138,7 @@
|
|
|
6138
6138
|
const attrs = (0, vue.useAttrs)();
|
|
6139
6139
|
const contextConfig = useXComponentConfig("conversations");
|
|
6140
6140
|
const rootRef = (0, vue.ref)();
|
|
6141
|
-
const [hashId, cssVarCls] = style_default$
|
|
6141
|
+
const [hashId, cssVarCls] = style_default$9((0, vue.computed)(() => props.prefixCls));
|
|
6142
6142
|
const mergedItems = (0, vue.computed)(() => props.items ?? []);
|
|
6143
6143
|
const { groupList, collapsibleOptions, keyList } = useGroupable((0, vue.computed)(() => props.groupable), mergedItems);
|
|
6144
6144
|
const innerActiveKey = (0, vue.ref)(props.defaultActiveKey);
|
|
@@ -6271,6 +6271,715 @@
|
|
|
6271
6271
|
});
|
|
6272
6272
|
ConversationsWithSub.Creation = Creation;
|
|
6273
6273
|
//#endregion
|
|
6274
|
+
//#region components/folder/DirectoryTree.tsx
|
|
6275
|
+
function isFolder(node) {
|
|
6276
|
+
return !!node.children && node.children.length > 0;
|
|
6277
|
+
}
|
|
6278
|
+
function buildPathSegments(node, parentSegments) {
|
|
6279
|
+
if (node.path === "/" && parentSegments.length === 0) return ["/"];
|
|
6280
|
+
return [...parentSegments, node.path].filter((seg) => seg !== "");
|
|
6281
|
+
}
|
|
6282
|
+
function getIcon(node, directoryIcons) {
|
|
6283
|
+
if (directoryIcons === false || directoryIcons === null) return null;
|
|
6284
|
+
if (isFolder(node)) {
|
|
6285
|
+
const icon = directoryIcons?.directory;
|
|
6286
|
+
if (typeof icon === "function") return icon();
|
|
6287
|
+
return icon ?? (0, vue.createVNode)(_antdv_next_icons.FolderOutlined, null, null);
|
|
6288
|
+
}
|
|
6289
|
+
const ext = node.path.toLowerCase().split(".").pop();
|
|
6290
|
+
if (ext) {
|
|
6291
|
+
const icon = directoryIcons?.[ext];
|
|
6292
|
+
if (icon) return typeof icon === "function" ? icon() : icon;
|
|
6293
|
+
}
|
|
6294
|
+
return (0, vue.createVNode)(_antdv_next_icons.FileOutlined, null, null);
|
|
6295
|
+
}
|
|
6296
|
+
function convertToTreeData(nodes, directoryIcons, parentSegments = []) {
|
|
6297
|
+
return nodes.map((node) => {
|
|
6298
|
+
const pathSegments = buildPathSegments(node, parentSegments);
|
|
6299
|
+
const fullPath = pathSegments.join("/").replace(/^\/+/, "");
|
|
6300
|
+
return {
|
|
6301
|
+
key: fullPath,
|
|
6302
|
+
path: fullPath,
|
|
6303
|
+
pathSegments,
|
|
6304
|
+
title: node.title,
|
|
6305
|
+
icon: getIcon(node, directoryIcons),
|
|
6306
|
+
isLeaf: !isFolder(node),
|
|
6307
|
+
content: node.content,
|
|
6308
|
+
children: node.children ? convertToTreeData(node.children, directoryIcons, pathSegments) : void 0
|
|
6309
|
+
};
|
|
6310
|
+
});
|
|
6311
|
+
}
|
|
6312
|
+
var FolderDirectoryTree = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
6313
|
+
name: "AxFolderDirectoryTree",
|
|
6314
|
+
props: {
|
|
6315
|
+
prefixCls: {
|
|
6316
|
+
type: String,
|
|
6317
|
+
required: true
|
|
6318
|
+
},
|
|
6319
|
+
treeData: {
|
|
6320
|
+
type: Array,
|
|
6321
|
+
default: () => []
|
|
6322
|
+
},
|
|
6323
|
+
directoryIcons: {
|
|
6324
|
+
type: [Boolean, Object],
|
|
6325
|
+
default: void 0
|
|
6326
|
+
},
|
|
6327
|
+
selectedKeys: {
|
|
6328
|
+
type: Array,
|
|
6329
|
+
default: () => []
|
|
6330
|
+
},
|
|
6331
|
+
expandedKeys: {
|
|
6332
|
+
type: Array,
|
|
6333
|
+
default: void 0
|
|
6334
|
+
},
|
|
6335
|
+
defaultExpandAll: {
|
|
6336
|
+
type: Boolean,
|
|
6337
|
+
default: true
|
|
6338
|
+
},
|
|
6339
|
+
showLine: {
|
|
6340
|
+
type: Boolean,
|
|
6341
|
+
default: false
|
|
6342
|
+
},
|
|
6343
|
+
classes: {
|
|
6344
|
+
type: Object,
|
|
6345
|
+
default: () => ({})
|
|
6346
|
+
},
|
|
6347
|
+
styles: {
|
|
6348
|
+
type: Object,
|
|
6349
|
+
default: () => ({})
|
|
6350
|
+
},
|
|
6351
|
+
directoryTitle: {
|
|
6352
|
+
type: [
|
|
6353
|
+
Boolean,
|
|
6354
|
+
String,
|
|
6355
|
+
Number,
|
|
6356
|
+
Object,
|
|
6357
|
+
Array,
|
|
6358
|
+
Function
|
|
6359
|
+
],
|
|
6360
|
+
default: void 0
|
|
6361
|
+
}
|
|
6362
|
+
},
|
|
6363
|
+
emits: {
|
|
6364
|
+
select: (_keys, _info) => true,
|
|
6365
|
+
expand: (_keys, _info) => true
|
|
6366
|
+
},
|
|
6367
|
+
setup(props, { emit }) {
|
|
6368
|
+
const treeDataConverted = (0, vue.computed)(() => convertToTreeData(props.treeData, props.directoryIcons));
|
|
6369
|
+
const titleNode = (0, vue.computed)(() => {
|
|
6370
|
+
const t = props.directoryTitle;
|
|
6371
|
+
if (t === false || t === null || t === void 0) return null;
|
|
6372
|
+
if (typeof t === "function") return t();
|
|
6373
|
+
return t;
|
|
6374
|
+
});
|
|
6375
|
+
return () => {
|
|
6376
|
+
const { prefixCls } = props;
|
|
6377
|
+
return (0, vue.createVNode)(vue.Fragment, null, [titleNode.value ? (0, vue.createVNode)("div", {
|
|
6378
|
+
"class": [`${prefixCls}-directory-tree-title`, props.classes?.directoryTitle],
|
|
6379
|
+
"style": props.styles?.directoryTitle
|
|
6380
|
+
}, [titleNode.value]) : null, (0, vue.createVNode)(antdv_next.DirectoryTree, {
|
|
6381
|
+
treeData: treeDataConverted.value,
|
|
6382
|
+
selectedKeys: props.selectedKeys,
|
|
6383
|
+
expandedKeys: props.expandedKeys,
|
|
6384
|
+
multiple: false,
|
|
6385
|
+
blockNode: true,
|
|
6386
|
+
showLine: props.showLine,
|
|
6387
|
+
defaultExpandAll: props.defaultExpandAll,
|
|
6388
|
+
class: [`${prefixCls}-directory-tree-content`, props.classes?.directoryTree],
|
|
6389
|
+
style: props.styles?.directoryTree,
|
|
6390
|
+
classes: { itemTitle: `${prefixCls}-directory-tree-item-title` },
|
|
6391
|
+
onSelect: (keys, info) => emit("select", keys, info),
|
|
6392
|
+
onExpand: (keys, info) => emit("expand", keys, info)
|
|
6393
|
+
}, null)]);
|
|
6394
|
+
};
|
|
6395
|
+
}
|
|
6396
|
+
});
|
|
6397
|
+
//#endregion
|
|
6398
|
+
//#region components/folder/style/folder.ts
|
|
6399
|
+
var genFolderStyle = (token) => {
|
|
6400
|
+
const { componentCls, antCls } = token;
|
|
6401
|
+
return { [componentCls]: {
|
|
6402
|
+
height: "100%",
|
|
6403
|
+
width: "100%",
|
|
6404
|
+
background: token.colorBgDirectory,
|
|
6405
|
+
[`${antCls}-tree-node-content-wrapper`]: { display: "flex" },
|
|
6406
|
+
[`${antCls}-tree-node-content-wrapper-open,${antCls}-tree-node-content-wrapper-close`]: { display: "flex" },
|
|
6407
|
+
[`${antCls}-tree-node-content-wrapper-normal`]: { display: "flex" },
|
|
6408
|
+
[`${antCls}-tree-list`]: {
|
|
6409
|
+
paddingInline: token.padding,
|
|
6410
|
+
paddingBlock: token.paddingXS
|
|
6411
|
+
},
|
|
6412
|
+
[`${antCls}-tree-switcher`]: {
|
|
6413
|
+
width: "10px",
|
|
6414
|
+
"&:before": {
|
|
6415
|
+
width: "10px",
|
|
6416
|
+
height: "10px"
|
|
6417
|
+
}
|
|
6418
|
+
},
|
|
6419
|
+
[`${antCls}-tree-node-content-wrapper`]: { paddingInline: 0 },
|
|
6420
|
+
[`${componentCls}-container`]: { height: "100%" },
|
|
6421
|
+
[`${componentCls}-directory-tree`]: {
|
|
6422
|
+
height: "100%",
|
|
6423
|
+
display: "flex",
|
|
6424
|
+
flexDirection: "column"
|
|
6425
|
+
},
|
|
6426
|
+
[`${componentCls}-directory-tree-title`]: {
|
|
6427
|
+
width: "100%",
|
|
6428
|
+
display: "flex",
|
|
6429
|
+
alignItems: "center"
|
|
6430
|
+
},
|
|
6431
|
+
[`${componentCls}-directory-tree-content`]: {
|
|
6432
|
+
width: "100%",
|
|
6433
|
+
background: "transparent",
|
|
6434
|
+
height: "100%",
|
|
6435
|
+
borderRadius: "unset",
|
|
6436
|
+
display: "flex",
|
|
6437
|
+
overflow: "auto"
|
|
6438
|
+
},
|
|
6439
|
+
[`&${componentCls}-rtl`]: { direction: "rtl" }
|
|
6440
|
+
} };
|
|
6441
|
+
};
|
|
6442
|
+
var genFilePreviewStyle = (token) => {
|
|
6443
|
+
const { componentCls } = token;
|
|
6444
|
+
return { [componentCls]: {
|
|
6445
|
+
[`${componentCls}-preview`]: {
|
|
6446
|
+
width: "100%",
|
|
6447
|
+
background: token.colorBgContainer,
|
|
6448
|
+
flex: 1,
|
|
6449
|
+
height: "100%",
|
|
6450
|
+
display: "flex",
|
|
6451
|
+
flexDirection: "column"
|
|
6452
|
+
},
|
|
6453
|
+
[`${componentCls}-preview-title-wrapper`]: {
|
|
6454
|
+
background: token.colorBgContainer,
|
|
6455
|
+
paddingInline: token.padding,
|
|
6456
|
+
paddingBlock: token.paddingXS,
|
|
6457
|
+
borderBottom: `1px solid ${token.colorBorderSecondary}`
|
|
6458
|
+
},
|
|
6459
|
+
[`${componentCls}-preview-title`]: {
|
|
6460
|
+
display: "flex",
|
|
6461
|
+
alignItems: "center",
|
|
6462
|
+
justifyContent: "space-between"
|
|
6463
|
+
},
|
|
6464
|
+
[`${componentCls}-preview-content`]: {
|
|
6465
|
+
overflow: "auto",
|
|
6466
|
+
flex: 1,
|
|
6467
|
+
background: token.colorBgContainer,
|
|
6468
|
+
paddingInline: token.padding,
|
|
6469
|
+
paddingBlock: token.paddingXS
|
|
6470
|
+
},
|
|
6471
|
+
[`${componentCls}-preview-loading-container`]: {
|
|
6472
|
+
display: "flex",
|
|
6473
|
+
justifyContent: "center",
|
|
6474
|
+
alignItems: "center",
|
|
6475
|
+
marginBlockStart: token.calc(token.marginLG).mul(3).equal()
|
|
6476
|
+
},
|
|
6477
|
+
[`${componentCls}-preview-empty-container`]: { marginBlockStart: token.calc(token.marginLG).mul(3).equal() },
|
|
6478
|
+
[`${componentCls}-directory-tree-item-title`]: {
|
|
6479
|
+
display: "flex",
|
|
6480
|
+
whiteSpace: "nowrap",
|
|
6481
|
+
paddingInlineEnd: token.padding
|
|
6482
|
+
}
|
|
6483
|
+
} };
|
|
6484
|
+
};
|
|
6485
|
+
//#endregion
|
|
6486
|
+
//#region components/folder/style/index.ts
|
|
6487
|
+
var prepareComponentToken$8 = (token) => ({ colorBgDirectory: token.colorFillTertiary });
|
|
6488
|
+
var style_default$8 = genStyleHooks("Folder", (token) => {
|
|
6489
|
+
const folderToken = (0, _antdv_next_cssinjs_cssinjs_utils.mergeToken)(token, {});
|
|
6490
|
+
return [genFolderStyle(folderToken), genFilePreviewStyle(folderToken)];
|
|
6491
|
+
}, prepareComponentToken$8);
|
|
6492
|
+
//#endregion
|
|
6493
|
+
//#region components/folder/FilePreview.tsx
|
|
6494
|
+
function getFileExtension(path = "") {
|
|
6495
|
+
const parts = path.split(".");
|
|
6496
|
+
return parts[parts.length - 1] || "";
|
|
6497
|
+
}
|
|
6498
|
+
function getLanguageFromExtension(ext) {
|
|
6499
|
+
return ext.toLowerCase() || "txt";
|
|
6500
|
+
}
|
|
6501
|
+
var FilePreview = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
6502
|
+
name: "AxFolderFilePreview",
|
|
6503
|
+
props: {
|
|
6504
|
+
prefixCls: {
|
|
6505
|
+
type: String,
|
|
6506
|
+
required: true
|
|
6507
|
+
},
|
|
6508
|
+
classes: {
|
|
6509
|
+
type: Object,
|
|
6510
|
+
default: () => ({})
|
|
6511
|
+
},
|
|
6512
|
+
styles: {
|
|
6513
|
+
type: Object,
|
|
6514
|
+
default: () => ({})
|
|
6515
|
+
},
|
|
6516
|
+
style: {
|
|
6517
|
+
type: Object,
|
|
6518
|
+
default: void 0
|
|
6519
|
+
},
|
|
6520
|
+
selectedFile: {
|
|
6521
|
+
type: Array,
|
|
6522
|
+
default: () => []
|
|
6523
|
+
},
|
|
6524
|
+
fileContent: {
|
|
6525
|
+
type: String,
|
|
6526
|
+
default: ""
|
|
6527
|
+
},
|
|
6528
|
+
loading: {
|
|
6529
|
+
type: Boolean,
|
|
6530
|
+
default: false
|
|
6531
|
+
},
|
|
6532
|
+
previewTitle: {
|
|
6533
|
+
type: [
|
|
6534
|
+
Boolean,
|
|
6535
|
+
String,
|
|
6536
|
+
Number,
|
|
6537
|
+
Object,
|
|
6538
|
+
Array,
|
|
6539
|
+
Function
|
|
6540
|
+
],
|
|
6541
|
+
default: void 0
|
|
6542
|
+
},
|
|
6543
|
+
previewRender: {
|
|
6544
|
+
type: [
|
|
6545
|
+
String,
|
|
6546
|
+
Number,
|
|
6547
|
+
Object,
|
|
6548
|
+
Array,
|
|
6549
|
+
Function
|
|
6550
|
+
],
|
|
6551
|
+
default: void 0
|
|
6552
|
+
},
|
|
6553
|
+
emptyRender: {
|
|
6554
|
+
type: [
|
|
6555
|
+
Boolean,
|
|
6556
|
+
String,
|
|
6557
|
+
Number,
|
|
6558
|
+
Object,
|
|
6559
|
+
Array,
|
|
6560
|
+
Function
|
|
6561
|
+
],
|
|
6562
|
+
default: void 0
|
|
6563
|
+
},
|
|
6564
|
+
getFileNode: {
|
|
6565
|
+
type: Function,
|
|
6566
|
+
default: void 0
|
|
6567
|
+
}
|
|
6568
|
+
},
|
|
6569
|
+
setup(props) {
|
|
6570
|
+
const [locale] = useLocale("Folder", localeValues$1.Folder);
|
|
6571
|
+
const contextConfig = useXComponentConfig("folder");
|
|
6572
|
+
const [hashId, cssVarCls] = style_default$8((0, vue.computed)(() => props.prefixCls));
|
|
6573
|
+
const previewCls = (0, vue.computed)(() => `${props.prefixCls}-preview`);
|
|
6574
|
+
const renderOriginContent = (fileContent, language) => (0, vue.createVNode)(code_highlighter_default, {
|
|
6575
|
+
"content": fileContent.replace(/\n$/, ""),
|
|
6576
|
+
"language": language,
|
|
6577
|
+
"showLanguage": false,
|
|
6578
|
+
"showLineNumbers": false,
|
|
6579
|
+
"showCopyButton": false,
|
|
6580
|
+
"style": {
|
|
6581
|
+
background: "transparent",
|
|
6582
|
+
border: 0,
|
|
6583
|
+
borderRadius: 0,
|
|
6584
|
+
padding: 0
|
|
6585
|
+
}
|
|
6586
|
+
}, null);
|
|
6587
|
+
const renderEmpty = () => {
|
|
6588
|
+
if (props.emptyRender === false || props.emptyRender === null) return null;
|
|
6589
|
+
const node = typeof props.emptyRender === "function" ? props.emptyRender() : props.emptyRender ?? (0, vue.createVNode)(antdv_next.Empty, {
|
|
6590
|
+
"image": antdv_next.Empty.PRESENTED_IMAGE_SIMPLE,
|
|
6591
|
+
"description": locale.value.selectFile
|
|
6592
|
+
}, null);
|
|
6593
|
+
return (0, vue.createVNode)("div", {
|
|
6594
|
+
"class": [`${previewCls.value}-empty-container`, props.classes?.previewRender],
|
|
6595
|
+
"style": props.styles?.previewRender
|
|
6596
|
+
}, [node]);
|
|
6597
|
+
};
|
|
6598
|
+
const renderContent = () => {
|
|
6599
|
+
if (props.loading) return (0, vue.createVNode)("div", {
|
|
6600
|
+
"class": [`${previewCls.value}-loading-container`, props.classes?.previewRender],
|
|
6601
|
+
"style": props.styles?.previewRender
|
|
6602
|
+
}, [(0, vue.createVNode)(antdv_next.Spin, null, null)]);
|
|
6603
|
+
if (!props.selectedFile || props.selectedFile.length === 0) return renderEmpty();
|
|
6604
|
+
const selected = props.selectedFile;
|
|
6605
|
+
const fileNode = props.getFileNode?.(selected);
|
|
6606
|
+
const title = fileNode?.title ?? selected[selected.length - 1];
|
|
6607
|
+
const fileName = selected[selected.length - 1];
|
|
6608
|
+
const language = getLanguageFromExtension(getFileExtension(fileName));
|
|
6609
|
+
let headerNode;
|
|
6610
|
+
if (props.previewTitle === false || props.previewTitle === null) headerNode = null;
|
|
6611
|
+
else if (props.previewTitle) headerNode = typeof props.previewTitle === "function" ? props.previewTitle({
|
|
6612
|
+
title,
|
|
6613
|
+
path: selected,
|
|
6614
|
+
content: props.fileContent ?? ""
|
|
6615
|
+
}) : props.previewTitle;
|
|
6616
|
+
else headerNode = (0, vue.createVNode)("div", { "class": `${previewCls.value}-title` }, [(0, vue.createVNode)("span", { "class": `${previewCls.value}-filename` }, [title]), (0, vue.createVNode)(XActionsCopy, {
|
|
6617
|
+
"text": props.fileContent ?? "",
|
|
6618
|
+
"class": `${previewCls.value}-copy`
|
|
6619
|
+
}, null)]);
|
|
6620
|
+
const originNode = renderOriginContent(props.fileContent ?? "", language);
|
|
6621
|
+
let contentNode;
|
|
6622
|
+
if (props.previewRender !== void 0 && props.previewRender !== null) if (typeof props.previewRender === "function") contentNode = props.previewRender({
|
|
6623
|
+
content: props.fileContent,
|
|
6624
|
+
path: selected,
|
|
6625
|
+
title: fileNode?.title,
|
|
6626
|
+
language
|
|
6627
|
+
}, { originNode });
|
|
6628
|
+
else contentNode = props.previewRender;
|
|
6629
|
+
else contentNode = originNode;
|
|
6630
|
+
return (0, vue.createVNode)(vue.Fragment, null, [headerNode && (0, vue.createVNode)("div", {
|
|
6631
|
+
"class": [`${previewCls.value}-title-wrapper`, props.classes?.previewTitle],
|
|
6632
|
+
"style": props.styles?.previewTitle
|
|
6633
|
+
}, [headerNode]), (0, vue.createVNode)("div", {
|
|
6634
|
+
"class": [`${previewCls.value}-content`, props.classes?.previewRender],
|
|
6635
|
+
"style": props.styles?.previewRender
|
|
6636
|
+
}, [contentNode])]);
|
|
6637
|
+
};
|
|
6638
|
+
return () => (0, vue.createVNode)("div", {
|
|
6639
|
+
"class": [
|
|
6640
|
+
`${previewCls.value}`,
|
|
6641
|
+
props.classes?.filePreview,
|
|
6642
|
+
hashId.value,
|
|
6643
|
+
cssVarCls.value
|
|
6644
|
+
],
|
|
6645
|
+
"style": [
|
|
6646
|
+
contextConfig.value.styles?.filePreview,
|
|
6647
|
+
props.styles?.filePreview,
|
|
6648
|
+
props.style
|
|
6649
|
+
]
|
|
6650
|
+
}, [renderContent()]);
|
|
6651
|
+
}
|
|
6652
|
+
});
|
|
6653
|
+
//#endregion
|
|
6654
|
+
//#region components/folder/Folder.tsx
|
|
6655
|
+
function findNode(nodes, segments, index = 0) {
|
|
6656
|
+
if (index >= segments.length) return void 0;
|
|
6657
|
+
const current = segments[index];
|
|
6658
|
+
for (const node of nodes) if (node.path === current) {
|
|
6659
|
+
if (index === segments.length - 1) return node;
|
|
6660
|
+
return node.children ? findNode(node.children, segments, index + 1) : void 0;
|
|
6661
|
+
}
|
|
6662
|
+
}
|
|
6663
|
+
function findNodeAndValidate(treeData, path, validateAsFile = false) {
|
|
6664
|
+
if (!path) return {
|
|
6665
|
+
node: void 0,
|
|
6666
|
+
isValid: false
|
|
6667
|
+
};
|
|
6668
|
+
const segments = Array.isArray(path) ? path.filter(Boolean) : path.split("/").filter(Boolean);
|
|
6669
|
+
if (segments.length === 0) return {
|
|
6670
|
+
node: void 0,
|
|
6671
|
+
isValid: false
|
|
6672
|
+
};
|
|
6673
|
+
const node = findNode(treeData, segments);
|
|
6674
|
+
return {
|
|
6675
|
+
node,
|
|
6676
|
+
isValid: validateAsFile ? !!node && (!node?.children || node.children.length === 0) : !!node
|
|
6677
|
+
};
|
|
6678
|
+
}
|
|
6679
|
+
//#endregion
|
|
6680
|
+
//#region components/folder/index.ts
|
|
6681
|
+
var folder_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
6682
|
+
name: "AxFolder",
|
|
6683
|
+
inheritAttrs: false,
|
|
6684
|
+
props: {
|
|
6685
|
+
prefixCls: {
|
|
6686
|
+
type: String,
|
|
6687
|
+
default: "antd-folder"
|
|
6688
|
+
},
|
|
6689
|
+
rootClass: {
|
|
6690
|
+
type: String,
|
|
6691
|
+
default: ""
|
|
6692
|
+
},
|
|
6693
|
+
class: {
|
|
6694
|
+
type: [
|
|
6695
|
+
String,
|
|
6696
|
+
Array,
|
|
6697
|
+
Object
|
|
6698
|
+
],
|
|
6699
|
+
default: void 0
|
|
6700
|
+
},
|
|
6701
|
+
style: {
|
|
6702
|
+
type: [
|
|
6703
|
+
String,
|
|
6704
|
+
Object,
|
|
6705
|
+
Array
|
|
6706
|
+
],
|
|
6707
|
+
default: void 0
|
|
6708
|
+
},
|
|
6709
|
+
classes: {
|
|
6710
|
+
type: Object,
|
|
6711
|
+
default: () => ({})
|
|
6712
|
+
},
|
|
6713
|
+
styles: {
|
|
6714
|
+
type: Object,
|
|
6715
|
+
default: () => ({})
|
|
6716
|
+
},
|
|
6717
|
+
treeData: {
|
|
6718
|
+
type: Array,
|
|
6719
|
+
default: () => []
|
|
6720
|
+
},
|
|
6721
|
+
directoryIcons: {
|
|
6722
|
+
type: [Boolean, Object],
|
|
6723
|
+
default: void 0
|
|
6724
|
+
},
|
|
6725
|
+
selectable: {
|
|
6726
|
+
type: Boolean,
|
|
6727
|
+
default: true
|
|
6728
|
+
},
|
|
6729
|
+
selectedFile: {
|
|
6730
|
+
type: Array,
|
|
6731
|
+
default: void 0
|
|
6732
|
+
},
|
|
6733
|
+
defaultSelectedFile: {
|
|
6734
|
+
type: Array,
|
|
6735
|
+
default: void 0
|
|
6736
|
+
},
|
|
6737
|
+
directoryTreeWith: {
|
|
6738
|
+
type: [Number, String],
|
|
6739
|
+
default: 278
|
|
6740
|
+
},
|
|
6741
|
+
emptyRender: {
|
|
6742
|
+
type: [
|
|
6743
|
+
Boolean,
|
|
6744
|
+
String,
|
|
6745
|
+
Number,
|
|
6746
|
+
Object,
|
|
6747
|
+
Array,
|
|
6748
|
+
Function
|
|
6749
|
+
],
|
|
6750
|
+
default: void 0
|
|
6751
|
+
},
|
|
6752
|
+
previewRender: {
|
|
6753
|
+
type: [
|
|
6754
|
+
String,
|
|
6755
|
+
Number,
|
|
6756
|
+
Object,
|
|
6757
|
+
Array,
|
|
6758
|
+
Function
|
|
6759
|
+
],
|
|
6760
|
+
default: void 0
|
|
6761
|
+
},
|
|
6762
|
+
defaultExpandedPaths: {
|
|
6763
|
+
type: Array,
|
|
6764
|
+
default: void 0
|
|
6765
|
+
},
|
|
6766
|
+
expandedPaths: {
|
|
6767
|
+
type: Array,
|
|
6768
|
+
default: void 0
|
|
6769
|
+
},
|
|
6770
|
+
defaultExpandAll: {
|
|
6771
|
+
type: Boolean,
|
|
6772
|
+
default: true
|
|
6773
|
+
},
|
|
6774
|
+
fileContentService: {
|
|
6775
|
+
type: Object,
|
|
6776
|
+
default: void 0
|
|
6777
|
+
},
|
|
6778
|
+
directoryTitle: {
|
|
6779
|
+
type: [
|
|
6780
|
+
Boolean,
|
|
6781
|
+
String,
|
|
6782
|
+
Number,
|
|
6783
|
+
Object,
|
|
6784
|
+
Array,
|
|
6785
|
+
Function
|
|
6786
|
+
],
|
|
6787
|
+
default: void 0
|
|
6788
|
+
},
|
|
6789
|
+
previewTitle: {
|
|
6790
|
+
type: [
|
|
6791
|
+
Boolean,
|
|
6792
|
+
String,
|
|
6793
|
+
Number,
|
|
6794
|
+
Object,
|
|
6795
|
+
Array,
|
|
6796
|
+
Function
|
|
6797
|
+
],
|
|
6798
|
+
default: void 0
|
|
6799
|
+
}
|
|
6800
|
+
},
|
|
6801
|
+
emits: {
|
|
6802
|
+
selectedFileChange: (_file) => true,
|
|
6803
|
+
fileClick: (_path, _content) => true,
|
|
6804
|
+
folderClick: (_path) => true,
|
|
6805
|
+
expandedPathsChange: (_paths) => true,
|
|
6806
|
+
"update:selectedFile": (_paths) => true,
|
|
6807
|
+
"update:expandedPaths": (_paths) => true
|
|
6808
|
+
},
|
|
6809
|
+
slots: Object,
|
|
6810
|
+
setup(props, { emit, expose, slots }) {
|
|
6811
|
+
const attrs = (0, vue.useAttrs)();
|
|
6812
|
+
const configCtx = (0, antdv_next_config_provider_context.useConfig)();
|
|
6813
|
+
const contextConfig = useXComponentConfig("folder");
|
|
6814
|
+
const [hashId, cssVarCls] = style_default$8((0, vue.computed)(() => props.prefixCls));
|
|
6815
|
+
const [locale] = useLocale("Folder", localeValues$1.Folder);
|
|
6816
|
+
const rootRef = (0, vue.ref)();
|
|
6817
|
+
const isValidSelectedFile = (filePath) => !!(filePath && filePath.length > 0 && findNodeAndValidate(props.treeData, filePath, true).isValid);
|
|
6818
|
+
const innerSelectedFile = (0, vue.ref)(isValidSelectedFile(props.defaultSelectedFile) ? props.defaultSelectedFile ?? [] : []);
|
|
6819
|
+
const mergedSelectedFile = (0, vue.computed)(() => props.selectedFile !== void 0 ? props.selectedFile : innerSelectedFile.value);
|
|
6820
|
+
const validSelectedFile = (0, vue.ref)(isValidSelectedFile(props.selectedFile ?? props.defaultSelectedFile));
|
|
6821
|
+
(0, vue.watch)(() => [
|
|
6822
|
+
props.selectedFile,
|
|
6823
|
+
props.defaultSelectedFile,
|
|
6824
|
+
props.treeData
|
|
6825
|
+
], () => {
|
|
6826
|
+
validSelectedFile.value = isValidSelectedFile(props.selectedFile ?? props.defaultSelectedFile ?? []);
|
|
6827
|
+
}, { deep: true });
|
|
6828
|
+
const innerExpandedPaths = (0, vue.ref)(props.defaultExpandedPaths);
|
|
6829
|
+
const mergedExpandedPaths = (0, vue.computed)(() => props.expandedPaths !== void 0 ? props.expandedPaths : innerExpandedPaths.value);
|
|
6830
|
+
const fileContent = (0, vue.ref)("");
|
|
6831
|
+
const loadingContent = (0, vue.ref)(false);
|
|
6832
|
+
const loadFileContent = async () => {
|
|
6833
|
+
if (!validSelectedFile.value || mergedSelectedFile.value.length === 0) {
|
|
6834
|
+
fileContent.value = "";
|
|
6835
|
+
loadingContent.value = false;
|
|
6836
|
+
return;
|
|
6837
|
+
}
|
|
6838
|
+
const filePath = mergedSelectedFile.value.join("/");
|
|
6839
|
+
const segments = filePath.split("/").filter((s) => s !== "");
|
|
6840
|
+
const { node } = findNodeAndValidate(props.treeData, segments);
|
|
6841
|
+
if (props.fileContentService) {
|
|
6842
|
+
loadingContent.value = true;
|
|
6843
|
+
try {
|
|
6844
|
+
fileContent.value = await props.fileContentService.loadFileContent(filePath);
|
|
6845
|
+
} catch (error) {
|
|
6846
|
+
fileContent.value = `// ${locale.value.loadError}: ${error instanceof Error ? error.message : "Unknown error"}`;
|
|
6847
|
+
} finally {
|
|
6848
|
+
loadingContent.value = false;
|
|
6849
|
+
}
|
|
6850
|
+
return;
|
|
6851
|
+
}
|
|
6852
|
+
if (node?.content) {
|
|
6853
|
+
fileContent.value = node.content;
|
|
6854
|
+
loadingContent.value = false;
|
|
6855
|
+
return;
|
|
6856
|
+
}
|
|
6857
|
+
fileContent.value = `// ${locale.value.noService}`;
|
|
6858
|
+
loadingContent.value = false;
|
|
6859
|
+
};
|
|
6860
|
+
(0, vue.watch)([
|
|
6861
|
+
validSelectedFile,
|
|
6862
|
+
mergedSelectedFile,
|
|
6863
|
+
() => props.treeData,
|
|
6864
|
+
() => props.fileContentService
|
|
6865
|
+
], () => {
|
|
6866
|
+
loadFileContent();
|
|
6867
|
+
}, {
|
|
6868
|
+
immediate: true,
|
|
6869
|
+
deep: true
|
|
6870
|
+
});
|
|
6871
|
+
const handleSelect = (keys, info) => {
|
|
6872
|
+
const nodes = Array.isArray(info?.selectedNodes) ? info.selectedNodes : info?.selectedNodes ? [info.selectedNodes] : [];
|
|
6873
|
+
if (nodes.some((node) => !node?.isLeaf)) {
|
|
6874
|
+
if (nodes.length === 1) emit("folderClick", nodes[0]?.path ?? "");
|
|
6875
|
+
return;
|
|
6876
|
+
}
|
|
6877
|
+
const pathArray = keys[0]?.split("/").filter(Boolean) ?? [];
|
|
6878
|
+
if (pathArray.length === 0) return;
|
|
6879
|
+
const selectedNode = nodes[0];
|
|
6880
|
+
const fileName = selectedNode?.title;
|
|
6881
|
+
const fileContentValue = selectedNode?.content;
|
|
6882
|
+
emit("selectedFileChange", {
|
|
6883
|
+
path: pathArray,
|
|
6884
|
+
title: fileName,
|
|
6885
|
+
content: fileContentValue
|
|
6886
|
+
});
|
|
6887
|
+
if (!(props.selectedFile !== void 0)) {
|
|
6888
|
+
validSelectedFile.value = true;
|
|
6889
|
+
innerSelectedFile.value = pathArray;
|
|
6890
|
+
emit("update:selectedFile", pathArray);
|
|
6891
|
+
}
|
|
6892
|
+
if (nodes.length === 1) {
|
|
6893
|
+
const node = nodes[0];
|
|
6894
|
+
emit("fileClick", node?.path ?? "", node?.content);
|
|
6895
|
+
}
|
|
6896
|
+
};
|
|
6897
|
+
const handleExpand = (keys) => {
|
|
6898
|
+
const newPaths = keys ?? [];
|
|
6899
|
+
if (props.expandedPaths === void 0) innerExpandedPaths.value = newPaths;
|
|
6900
|
+
emit("update:expandedPaths", newPaths);
|
|
6901
|
+
emit("expandedPathsChange", newPaths);
|
|
6902
|
+
};
|
|
6903
|
+
const domAttrs = (0, vue.computed)(() => {
|
|
6904
|
+
const { class: _c, style: _s, ...rest } = attrs;
|
|
6905
|
+
return rest;
|
|
6906
|
+
});
|
|
6907
|
+
expose({ get nativeElement() {
|
|
6908
|
+
return rootRef.value;
|
|
6909
|
+
} });
|
|
6910
|
+
const mergedDirectoryTitle = (0, vue.computed)(() => slots.directoryTitle ?? props.directoryTitle);
|
|
6911
|
+
const mergedPreviewTitle = (0, vue.computed)(() => slots.previewTitle ?? props.previewTitle);
|
|
6912
|
+
const mergedPreviewRender = (0, vue.computed)(() => {
|
|
6913
|
+
if (slots.previewRender) return (file, info) => slots.previewRender({
|
|
6914
|
+
file,
|
|
6915
|
+
originNode: info.originNode
|
|
6916
|
+
});
|
|
6917
|
+
return props.previewRender;
|
|
6918
|
+
});
|
|
6919
|
+
const mergedEmptyRender = (0, vue.computed)(() => slots.emptyRender ?? props.emptyRender);
|
|
6920
|
+
return () => {
|
|
6921
|
+
const prefixCls = props.prefixCls;
|
|
6922
|
+
return (0, vue.createVNode)("div", (0, vue.mergeProps)({ "ref": rootRef }, domAttrs.value, {
|
|
6923
|
+
"class": [
|
|
6924
|
+
prefixCls,
|
|
6925
|
+
contextConfig.value.classes?.root,
|
|
6926
|
+
props.rootClass,
|
|
6927
|
+
props.classes?.root,
|
|
6928
|
+
hashId.value,
|
|
6929
|
+
cssVarCls.value,
|
|
6930
|
+
attrs.class,
|
|
6931
|
+
props.class,
|
|
6932
|
+
{
|
|
6933
|
+
[`${prefixCls}-rtl`]: configCtx.value.direction === "rtl",
|
|
6934
|
+
[`${prefixCls}-selectable`]: props.selectable
|
|
6935
|
+
}
|
|
6936
|
+
],
|
|
6937
|
+
"style": [
|
|
6938
|
+
contextConfig.value.style,
|
|
6939
|
+
contextConfig.value.styles?.root,
|
|
6940
|
+
props.styles?.root,
|
|
6941
|
+
attrs.style,
|
|
6942
|
+
props.style
|
|
6943
|
+
]
|
|
6944
|
+
}), [(0, vue.createVNode)(antdv_next.Flex, { "class": `${prefixCls}-container` }, { default: () => [(0, vue.createVNode)(antdv_next.Splitter, null, { default: () => [(0, vue.createVNode)(antdv_next.SplitterPanel, { "defaultSize": props.directoryTreeWith }, { default: () => [(0, vue.createVNode)("div", {
|
|
6945
|
+
"class": [`${prefixCls}-directory-tree`, props.classes?.directoryTree],
|
|
6946
|
+
"style": [contextConfig.value.styles?.directoryTree, props.styles?.directoryTree]
|
|
6947
|
+
}, [(0, vue.createVNode)(FolderDirectoryTree, {
|
|
6948
|
+
"prefixCls": prefixCls,
|
|
6949
|
+
"directoryIcons": props.directoryIcons,
|
|
6950
|
+
"treeData": props.treeData,
|
|
6951
|
+
"selectedKeys": props.selectable && mergedSelectedFile.value && validSelectedFile.value ? [mergedSelectedFile.value.join("/")] : [],
|
|
6952
|
+
"classes": props.classes,
|
|
6953
|
+
"styles": props.styles,
|
|
6954
|
+
"expandedKeys": mergedExpandedPaths.value,
|
|
6955
|
+
"defaultExpandAll": props.defaultExpandAll,
|
|
6956
|
+
"directoryTitle": mergedDirectoryTitle.value,
|
|
6957
|
+
"onSelect": handleSelect,
|
|
6958
|
+
"onExpand": handleExpand
|
|
6959
|
+
}, null)])] }), (0, vue.createVNode)(antdv_next.SplitterPanel, null, { default: () => [(0, vue.createVNode)(FilePreview, {
|
|
6960
|
+
"prefixCls": prefixCls,
|
|
6961
|
+
"classes": props.classes,
|
|
6962
|
+
"styles": props.styles,
|
|
6963
|
+
"selectedFile": validSelectedFile.value ? mergedSelectedFile.value : [],
|
|
6964
|
+
"fileContent": fileContent.value,
|
|
6965
|
+
"loading": loadingContent.value,
|
|
6966
|
+
"previewTitle": mergedPreviewTitle.value,
|
|
6967
|
+
"previewRender": mergedPreviewRender.value,
|
|
6968
|
+
"emptyRender": mergedEmptyRender.value,
|
|
6969
|
+
"getFileNode": (path) => {
|
|
6970
|
+
if (!path || path.length === 0) return void 0;
|
|
6971
|
+
const { node } = findNodeAndValidate(props.treeData, path);
|
|
6972
|
+
return node ? {
|
|
6973
|
+
title: node.title,
|
|
6974
|
+
path: node.path,
|
|
6975
|
+
content: node.content
|
|
6976
|
+
} : void 0;
|
|
6977
|
+
}
|
|
6978
|
+
}, null)] })] })] })]);
|
|
6979
|
+
};
|
|
6980
|
+
}
|
|
6981
|
+
});
|
|
6982
|
+
//#endregion
|
|
6274
6983
|
//#region components/_utils/warning.ts
|
|
6275
6984
|
var warnedMessages = /* @__PURE__ */ new Set();
|
|
6276
6985
|
var warning = (valid, component, message) => {
|
|
@@ -11430,6 +12139,7 @@
|
|
|
11430
12139
|
XActionsItem,
|
|
11431
12140
|
FileCardWithSub,
|
|
11432
12141
|
XFileCardList,
|
|
12142
|
+
folder_default,
|
|
11433
12143
|
mermaid_default,
|
|
11434
12144
|
XAttachments,
|
|
11435
12145
|
Sender,
|
|
@@ -11465,6 +12175,7 @@
|
|
|
11465
12175
|
exports.ConversationsCreation = Creation;
|
|
11466
12176
|
exports.FileCard = FileCardWithSub;
|
|
11467
12177
|
exports.FileCardList = XFileCardList;
|
|
12178
|
+
exports.Folder = folder_default;
|
|
11468
12179
|
exports.Mermaid = mermaid_default;
|
|
11469
12180
|
exports.Notification = notification_default;
|
|
11470
12181
|
exports.Prompts = prompts_default;
|