adtec-core-package 3.1.9 → 3.2.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/.idea/codeStyles/Project.xml +61 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/.idea//345/211/215/347/253/257/346/240/270/345/277/203/345/214/205.iml +8 -0
- package/package.json +1 -1
- package/src/assets/style/index.less +42 -40
- package/src/assets/style/scrollbar-classic.less +105 -0
- package/src/assets/style/scrollbar-classic.scss +105 -0
- package/src/components/ElCardList.vue +7 -1
- package/src/components/Scrollbars/ElScrollbars.vue +10 -2
- package/src/components/editor-main/src/assets/styles/_variables.less +1 -1
- package/src/components/upload/DocxJsViewer.vue +2 -16
- package/src/components/upload/OfficePreview.vue +8 -0
- package/src/config/VxeTableConfig.ts +12 -6
- package/src/css/elementUI/common/var.scss +4 -4
- package/src/css/elementUI/mixins/mixins.scss +4 -28
- package/src/css/elementUI/scrollbar.scss +20 -5
- package/src/css/vxeTableUI/components/table.scss +35 -30
- package/src/utils/excelPreviewUtil.ts +5 -5
- package/src/utils/officePreviewUtil.ts +5 -16
- package/vite/umoCjsVirtual.ts +24 -2
- package/vite/umoIntegration.js +41 -3
- package/vite/umoIntegration.ts +26 -0
- package/.claude/skills/gitnexus/gitnexus-cli/SKILL.md +0 -83
- package/.claude/skills/gitnexus/gitnexus-debugging/SKILL.md +0 -89
- package/.claude/skills/gitnexus/gitnexus-exploring/SKILL.md +0 -78
- package/.claude/skills/gitnexus/gitnexus-guide/SKILL.md +0 -64
- package/.claude/skills/gitnexus/gitnexus-impact-analysis/SKILL.md +0 -97
- package/.claude/skills/gitnexus/gitnexus-refactoring/SKILL.md +0 -121
- package/.editorconfig +0 -6
- package/.prettierrc.json +0 -7
- package/.vscode/extensions.json +0 -8
- package/AGENTS.md +0 -43
- package/CLAUDE.md +0 -43
- package/adtec-core-package/adtec-core-package.css +0 -1
- package/adtec-core-package/adtec-core-package.js +0 -41216
- package/adtec-core-package/adtec-core-package.umd.cjs +0 -87
- package/adtec-core-package/favicon.ico +0 -0
- package/adtec-core-package-3.1.7.tgz +0 -0
- package/auto-imports.d.ts +0 -299
- package/env.d.ts +0 -1
- package/eslint.config.js +0 -56
- package/index.html +0 -13
- package/package/.editorconfig +0 -6
- package/package/adtec-core-package/adtec-core-package.css +0 -1
- package/package/adtec-core-package/adtec-core-package.js +0 -41216
- package/package/adtec-core-package/adtec-core-package.umd.cjs +0 -87
- package/package/adtec-core-package/favicon.ico +0 -0
- package/package/index.html +0 -13
- package/package/prebuilt/umo-editor/favicon.ico +0 -0
- package/package/prebuilt/umo-editor/umo-editor.css +0 -1
- package/package/public/favicon.ico +0 -0
- package/package/src/assets/base.css +0 -86
- package/package/src/assets/main.css +0 -35
- package/package/src/components/editor-main/src/extensions/bookmark.js +0 -110
- package/prebuilt/umo-editor/umo-editor.js.map +0 -1
- package/tsconfig.app.json +0 -12
- package/tsconfig.json +0 -11
- package/tsconfig.node.json +0 -18
- package/vite.config.ts +0 -46
- package/vite.config.umo.ts +0 -81
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
@use 'mixins/mixins' as *;
|
|
4
4
|
@use 'mixins/var' as *;
|
|
5
5
|
@use 'common/var' as *;
|
|
6
|
+
@use '../../assets/style/scrollbar-classic.scss' as classic;
|
|
6
7
|
|
|
7
8
|
@include b(scrollbar) {
|
|
8
9
|
@include set-component-css-var('scrollbar', $scrollbar);
|
|
@@ -16,6 +17,9 @@
|
|
|
16
17
|
@include e(wrap) {
|
|
17
18
|
overflow: auto;
|
|
18
19
|
height: 100%;
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
/* 预留滚动条槽位,避免 thumb 压在正文上 */
|
|
22
|
+
padding-right: calc(var(--el-scrollbar-size, 8px) + 4px);
|
|
19
23
|
|
|
20
24
|
@include m(hidden-default) {
|
|
21
25
|
scrollbar-width: none;
|
|
@@ -31,7 +35,7 @@
|
|
|
31
35
|
width: 0;
|
|
32
36
|
height: 0;
|
|
33
37
|
cursor: pointer;
|
|
34
|
-
border-radius:
|
|
38
|
+
border-radius: calc(var(--el-scrollbar-size, 8px) / 2);
|
|
35
39
|
background-color: var(
|
|
36
40
|
#{getCssVarName('scrollbar-bg-color')},
|
|
37
41
|
map.get($scrollbar, 'bg-color')
|
|
@@ -56,14 +60,17 @@
|
|
|
56
60
|
|
|
57
61
|
@include e(bar) {
|
|
58
62
|
position: absolute;
|
|
59
|
-
right:
|
|
63
|
+
right: 4px;
|
|
60
64
|
bottom: 2px;
|
|
61
65
|
z-index: 1;
|
|
62
|
-
border-radius:
|
|
66
|
+
border-radius: calc(var(--el-scrollbar-size, 8px) / 2);
|
|
67
|
+
opacity: 0;
|
|
68
|
+
transition: opacity getCssVar('transition-duration') ease-out;
|
|
63
69
|
|
|
64
70
|
@include when(vertical) {
|
|
65
|
-
width:
|
|
71
|
+
width: var(--el-scrollbar-size, 8px);
|
|
66
72
|
top: 2px;
|
|
73
|
+
background-color: rgba(0, 0, 0, 0.04);
|
|
67
74
|
|
|
68
75
|
> div {
|
|
69
76
|
width: 100%;
|
|
@@ -71,14 +78,22 @@
|
|
|
71
78
|
}
|
|
72
79
|
|
|
73
80
|
@include when(horizontal) {
|
|
74
|
-
height:
|
|
81
|
+
height: var(--el-scrollbar-size, 8px);
|
|
75
82
|
left: 2px;
|
|
83
|
+
background-color: rgba(0, 0, 0, 0.04);
|
|
76
84
|
|
|
77
85
|
> div {
|
|
78
86
|
height: 100%;
|
|
79
87
|
}
|
|
80
88
|
}
|
|
81
89
|
}
|
|
90
|
+
|
|
91
|
+
&:hover,
|
|
92
|
+
&:active {
|
|
93
|
+
@include e(bar) {
|
|
94
|
+
opacity: 1;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
82
97
|
}
|
|
83
98
|
|
|
84
99
|
.#{$namespace}-scrollbar-fade {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@use '../helpers/baseMixin.scss';
|
|
2
|
+
@use '../../../assets/style/scrollbar-classic.scss' as classic;
|
|
2
3
|
@use './icon.scss';
|
|
3
4
|
@use './table-module/all.scss';
|
|
4
5
|
|
|
@@ -50,11 +51,20 @@
|
|
|
50
51
|
.vxe-table--body-wrapper,
|
|
51
52
|
.vxe-table--footer-wrapper,
|
|
52
53
|
.vxe-table--fixed-left-body-wrapper,
|
|
53
|
-
.vxe-table--fixed-right-body-wrapper
|
|
54
|
+
.vxe-table--fixed-right-body-wrapper,
|
|
55
|
+
.vxe-table--fixed-left-wrapper,
|
|
56
|
+
.vxe-table--fixed-right-wrapper {
|
|
54
57
|
overflow: hidden;
|
|
55
58
|
outline: 0;
|
|
56
59
|
scrollbar-width: none;
|
|
60
|
+
-ms-overflow-style: none;
|
|
57
61
|
-webkit-overflow-scrolling: touch;
|
|
62
|
+
|
|
63
|
+
&::-webkit-scrollbar {
|
|
64
|
+
display: none;
|
|
65
|
+
width: 0;
|
|
66
|
+
height: 0;
|
|
67
|
+
}
|
|
58
68
|
}
|
|
59
69
|
.vxe-table--header-inner-wrapper,
|
|
60
70
|
.vxe-table--body-inner-wrapper,
|
|
@@ -65,8 +75,11 @@
|
|
|
65
75
|
scrollbar-width: none;
|
|
66
76
|
-ms-overflow-style: none;
|
|
67
77
|
-webkit-overflow-scrolling: touch;
|
|
78
|
+
|
|
68
79
|
&::-webkit-scrollbar {
|
|
69
80
|
display: none;
|
|
81
|
+
width: 0;
|
|
82
|
+
height: 0;
|
|
70
83
|
}
|
|
71
84
|
}
|
|
72
85
|
.vxe-table--header-inner-wrapper,
|
|
@@ -79,34 +92,16 @@
|
|
|
79
92
|
overflow-x: scroll;
|
|
80
93
|
}
|
|
81
94
|
|
|
82
|
-
/*
|
|
95
|
+
/* vxe 表格:hover 时仅在手柄上显示现代圆角滚动条(全局 index.less 已排除表格内部) */
|
|
83
96
|
.vxe-table--scroll-x-handle,
|
|
84
97
|
.vxe-table--scroll-y-handle {
|
|
85
|
-
scrollbar-
|
|
86
|
-
-ms-overflow-style: none;
|
|
87
|
-
&::-webkit-scrollbar {
|
|
88
|
-
width: 8px;
|
|
89
|
-
height: 8px;
|
|
90
|
-
background: transparent;
|
|
91
|
-
}
|
|
92
|
-
&::-webkit-scrollbar-thumb {
|
|
93
|
-
background: transparent;
|
|
94
|
-
border-radius: 4px;
|
|
95
|
-
}
|
|
96
|
-
&::-webkit-scrollbar-track {
|
|
97
|
-
background: transparent;
|
|
98
|
-
}
|
|
98
|
+
@include classic.adtec-scrollbar-hidden;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
.vxe-table:hover {
|
|
102
102
|
.vxe-table--scroll-x-handle,
|
|
103
103
|
.vxe-table--scroll-y-handle {
|
|
104
|
-
scrollbar-
|
|
105
|
-
scrollbar-color: #DDDEE0 transparent;
|
|
106
|
-
}
|
|
107
|
-
.vxe-table--scroll-x-handle::-webkit-scrollbar-thumb,
|
|
108
|
-
.vxe-table--scroll-y-handle::-webkit-scrollbar-thumb {
|
|
109
|
-
background: #DDDEE0;
|
|
104
|
+
@include classic.adtec-vxe-scrollbar-active;
|
|
110
105
|
}
|
|
111
106
|
}
|
|
112
107
|
|
|
@@ -604,10 +599,10 @@
|
|
|
604
599
|
}
|
|
605
600
|
}
|
|
606
601
|
.vxe-table--scroll-x-virtual {
|
|
607
|
-
height: 0
|
|
602
|
+
height: 0;
|
|
608
603
|
}
|
|
609
604
|
.vxe-table--scroll-y-virtual {
|
|
610
|
-
width:
|
|
605
|
+
width: 0;
|
|
611
606
|
}
|
|
612
607
|
.vxe-table--scroll-x-virtual,
|
|
613
608
|
.vxe-table--scroll-y-virtual {
|
|
@@ -635,10 +630,10 @@
|
|
|
635
630
|
.vxe-table--scroll-x-handle {
|
|
636
631
|
overflow-y: hidden;
|
|
637
632
|
overflow-x: scroll;
|
|
638
|
-
height: 8px;
|
|
633
|
+
height: var(--vxe-scrollbar-size, 8px);
|
|
639
634
|
}
|
|
640
635
|
.vxe-table--scroll-x-wrapper {
|
|
641
|
-
height:
|
|
636
|
+
height: 100%;
|
|
642
637
|
}
|
|
643
638
|
.vxe-table--scroll-y-handle,
|
|
644
639
|
.vxe-table--scroll-y-wrapper {
|
|
@@ -650,7 +645,7 @@
|
|
|
650
645
|
.vxe-table--scroll-y-handle {
|
|
651
646
|
overflow-y: scroll;
|
|
652
647
|
overflow-x: hidden;
|
|
653
|
-
width: 8px;
|
|
648
|
+
width: var(--vxe-scrollbar-size, 8px);
|
|
654
649
|
height: 100%;
|
|
655
650
|
}
|
|
656
651
|
.vxe-table--scroll-x-space {
|
|
@@ -925,10 +920,20 @@
|
|
|
925
920
|
border-collapse: separate;
|
|
926
921
|
table-layout: fixed;
|
|
927
922
|
}
|
|
928
|
-
.vxe-table--render-wrapper{
|
|
929
|
-
height:100%;
|
|
923
|
+
.vxe-table--render-wrapper {
|
|
924
|
+
height: 100%;
|
|
925
|
+
display: flex;
|
|
926
|
+
flex-direction: column;
|
|
927
|
+
overflow: hidden;
|
|
928
|
+
|
|
930
929
|
.vxe-table--layout-wrapper {
|
|
931
|
-
|
|
930
|
+
flex: 1;
|
|
931
|
+
min-height: 0;
|
|
932
|
+
height: auto;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
.vxe-table--scroll-x-virtual {
|
|
936
|
+
flex-shrink: 0;
|
|
932
937
|
}
|
|
933
938
|
}
|
|
934
939
|
&:not(.is--empty) {
|
|
@@ -51,6 +51,9 @@ type WorkbookStyles = {
|
|
|
51
51
|
CellXf?: Array<Record<string, unknown>>
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
/** xlsx-js-style 运行时附带 Styles,官方 WorkBook 类型未声明 */
|
|
55
|
+
type StyledWorkBook = XLSX.WorkBook & { Styles?: WorkbookStyles }
|
|
56
|
+
|
|
54
57
|
/** Excel 默认主题色(Office 2013+,含 accent / hyperlink) */
|
|
55
58
|
const EXCEL_THEME_COLORS: Record<number, string> = {
|
|
56
59
|
0: '#FFFFFF',
|
|
@@ -392,8 +395,8 @@ export const parseExcelWorkbook = async (src: Blob | ArrayBuffer): Promise<Excel
|
|
|
392
395
|
cellDates: true,
|
|
393
396
|
cellStyles: true,
|
|
394
397
|
...(isOleXls(buffer) ? {} : {}),
|
|
395
|
-
})
|
|
396
|
-
const styles = workbook.Styles
|
|
398
|
+
}) as StyledWorkBook
|
|
399
|
+
const styles = workbook.Styles
|
|
397
400
|
const styleIndexMaps = isZipXlsx(buffer)
|
|
398
401
|
? parseXlsxStyleIndexMaps(buffer, workbook.SheetNames.length)
|
|
399
402
|
: []
|
|
@@ -476,6 +479,3 @@ export const searchExcelSheets = (
|
|
|
476
479
|
})
|
|
477
480
|
return matches
|
|
478
481
|
}
|
|
479
|
-
|
|
480
|
-
export const cellKey = (sheetIndex: number, row: number, col: number) =>
|
|
481
|
-
`${sheetIndex}:${row}:${col}`
|
|
@@ -121,19 +121,8 @@ export const isLegacyDocFile = (type?: string, name?: string, fileUrl?: string)
|
|
|
121
121
|
export const isHeaderPreviewFile = (type?: string, name?: string, fileUrl?: string) =>
|
|
122
122
|
HEADER_PREVIEW_TYPES.has(toOfficePreviewType(type, name, fileUrl))
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
/** pdf.js 加载参数:CJK 预览需 cMap;缺嵌入字体时尝试系统字体 */
|
|
130
|
-
export const buildPdfJsLoadOptions = (data: ArrayBuffer) => {
|
|
131
|
-
const assetBase = pdfAssetBase()
|
|
132
|
-
return {
|
|
133
|
-
data,
|
|
134
|
-
useSystemFonts: true,
|
|
135
|
-
cMapUrl: `${assetBase}pdfjs/cmaps/`,
|
|
136
|
-
cMapPacked: true,
|
|
137
|
-
standardFontDataUrl: `${assetBase}pdfjs/standard_fonts/`,
|
|
138
|
-
}
|
|
139
|
-
}
|
|
124
|
+
/** pdf.js 加载参数:依赖 PDF 内嵌字体与浏览器系统字体 */
|
|
125
|
+
export const buildPdfJsLoadOptions = (data: ArrayBuffer) => ({
|
|
126
|
+
data,
|
|
127
|
+
useSystemFonts: true,
|
|
128
|
+
})
|
package/vite/umoCjsVirtual.ts
CHANGED
|
@@ -6,6 +6,12 @@ import { transformWithEsbuild } from 'vite'
|
|
|
6
6
|
import type { Plugin } from 'vite'
|
|
7
7
|
import { getProjectRoot } from './projectRoot'
|
|
8
8
|
|
|
9
|
+
const UMO_CJS_ENTRY_OVERRIDES: Record<string, string> = {
|
|
10
|
+
/** browser 字段会落到 min.js(无 ESM default);用完整 UMD 构建再转 ESM */
|
|
11
|
+
jszip: 'dist/jszip.js',
|
|
12
|
+
exceljs: 'dist/exceljs.js',
|
|
13
|
+
}
|
|
14
|
+
|
|
9
15
|
const UMO_CJS_SPECS = [
|
|
10
16
|
'dom-to-image-more',
|
|
11
17
|
'hotkeys-js',
|
|
@@ -15,6 +21,8 @@ const UMO_CJS_SPECS = [
|
|
|
15
21
|
'smooth-signature',
|
|
16
22
|
'pure-svg-code',
|
|
17
23
|
'nzh/cn',
|
|
24
|
+
'jszip',
|
|
25
|
+
'exceljs',
|
|
18
26
|
] as const
|
|
19
27
|
|
|
20
28
|
const UMO_CJS_NAMED_EXPORTS: Record<string, string[]> = {
|
|
@@ -37,8 +45,15 @@ function resolvePackageMain(pkgDir: string): string | null {
|
|
|
37
45
|
module?: string
|
|
38
46
|
}
|
|
39
47
|
const main = pkgJson.module || pkgJson.main || 'index.js'
|
|
40
|
-
const
|
|
41
|
-
|
|
48
|
+
const candidates = [
|
|
49
|
+
path.join(pkgDir, main),
|
|
50
|
+
path.join(pkgDir, `${main}.js`),
|
|
51
|
+
path.join(pkgDir, main, 'index.js'),
|
|
52
|
+
]
|
|
53
|
+
for (const entry of candidates) {
|
|
54
|
+
if (fs.existsSync(entry) && fs.statSync(entry).isFile()) return entry
|
|
55
|
+
}
|
|
56
|
+
return null
|
|
42
57
|
}
|
|
43
58
|
|
|
44
59
|
function findUmoPackageDir(pkgName: string): string | null {
|
|
@@ -63,6 +78,13 @@ function findUmoPackageEntryForSpec(spec: string): string | null {
|
|
|
63
78
|
if (!pkgDir) return null
|
|
64
79
|
|
|
65
80
|
if (subParts.length === 0) {
|
|
81
|
+
const override = UMO_CJS_ENTRY_OVERRIDES[pkgName]
|
|
82
|
+
if (override) {
|
|
83
|
+
const overridePath = path.join(pkgDir, override)
|
|
84
|
+
if (fs.existsSync(overridePath) && fs.statSync(overridePath).isFile()) {
|
|
85
|
+
return overridePath
|
|
86
|
+
}
|
|
87
|
+
}
|
|
66
88
|
return resolvePackageMain(pkgDir)
|
|
67
89
|
}
|
|
68
90
|
|
package/vite/umoIntegration.js
CHANGED
|
@@ -433,6 +433,11 @@ import path4 from "node:path";
|
|
|
433
433
|
import { createRequire as createRequire4 } from "node:module";
|
|
434
434
|
import { pathToFileURL } from "node:url";
|
|
435
435
|
import { transformWithEsbuild as transformWithEsbuild2 } from "vite";
|
|
436
|
+
var UMO_CJS_ENTRY_OVERRIDES = {
|
|
437
|
+
/** browser 字段会落到 min.js(无 ESM default);用完整 UMD 构建再转 ESM */
|
|
438
|
+
jszip: "dist/jszip.js",
|
|
439
|
+
exceljs: "dist/exceljs.js"
|
|
440
|
+
};
|
|
436
441
|
var UMO_CJS_SPECS = [
|
|
437
442
|
"dom-to-image-more",
|
|
438
443
|
"hotkeys-js",
|
|
@@ -441,7 +446,9 @@ var UMO_CJS_SPECS = [
|
|
|
441
446
|
"pretty-bytes",
|
|
442
447
|
"smooth-signature",
|
|
443
448
|
"pure-svg-code",
|
|
444
|
-
"nzh/cn"
|
|
449
|
+
"nzh/cn",
|
|
450
|
+
"jszip",
|
|
451
|
+
"exceljs"
|
|
445
452
|
];
|
|
446
453
|
var UMO_CJS_NAMED_EXPORTS = {
|
|
447
454
|
"file-saver": ["saveAs"],
|
|
@@ -456,8 +463,15 @@ function resolvePackageMain(pkgDir) {
|
|
|
456
463
|
if (!fs5.existsSync(pkgJsonPath)) return null;
|
|
457
464
|
const pkgJson = JSON.parse(fs5.readFileSync(pkgJsonPath, "utf-8"));
|
|
458
465
|
const main = pkgJson.module || pkgJson.main || "index.js";
|
|
459
|
-
const
|
|
460
|
-
|
|
466
|
+
const candidates = [
|
|
467
|
+
path4.join(pkgDir, main),
|
|
468
|
+
path4.join(pkgDir, `${main}.js`),
|
|
469
|
+
path4.join(pkgDir, main, "index.js")
|
|
470
|
+
];
|
|
471
|
+
for (const entry of candidates) {
|
|
472
|
+
if (fs5.existsSync(entry) && fs5.statSync(entry).isFile()) return entry;
|
|
473
|
+
}
|
|
474
|
+
return null;
|
|
461
475
|
}
|
|
462
476
|
function findUmoPackageDir(pkgName) {
|
|
463
477
|
const projectRoot2 = getProjectRoot();
|
|
@@ -476,6 +490,13 @@ function findUmoPackageEntryForSpec(spec) {
|
|
|
476
490
|
const pkgDir = findUmoPackageDir(pkgName);
|
|
477
491
|
if (!pkgDir) return null;
|
|
478
492
|
if (subParts.length === 0) {
|
|
493
|
+
const override = UMO_CJS_ENTRY_OVERRIDES[pkgName];
|
|
494
|
+
if (override) {
|
|
495
|
+
const overridePath = path4.join(pkgDir, override);
|
|
496
|
+
if (fs5.existsSync(overridePath) && fs5.statSync(overridePath).isFile()) {
|
|
497
|
+
return overridePath;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
479
500
|
return resolvePackageMain(pkgDir);
|
|
480
501
|
}
|
|
481
502
|
const sub = subParts.join("/");
|
|
@@ -620,12 +641,28 @@ function yjsPeerResolve() {
|
|
|
620
641
|
}
|
|
621
642
|
|
|
622
643
|
// vite/umoIntegration.ts
|
|
644
|
+
function docxPreviewViteFix() {
|
|
645
|
+
return {
|
|
646
|
+
name: "core-docx-preview-vite",
|
|
647
|
+
config() {
|
|
648
|
+
return {
|
|
649
|
+
optimizeDeps: {
|
|
650
|
+
exclude: ["docx-preview", "jszip", "exceljs"]
|
|
651
|
+
}
|
|
652
|
+
};
|
|
653
|
+
}
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
function coreOfficePreviewVitePlugins() {
|
|
657
|
+
return [createProjectRootPlugin(), umoCjsVirtual(), docxPreviewViteFix()];
|
|
658
|
+
}
|
|
623
659
|
function coreUmoVitePlugins() {
|
|
624
660
|
return [
|
|
625
661
|
createProjectRootPlugin(),
|
|
626
662
|
tiptapVueRendererFix(),
|
|
627
663
|
highlightJsLibVirtual(),
|
|
628
664
|
umoCjsVirtual(),
|
|
665
|
+
docxPreviewViteFix(),
|
|
629
666
|
tiptapUmoResolve(),
|
|
630
667
|
yjsPeerResolve()
|
|
631
668
|
];
|
|
@@ -653,6 +690,7 @@ function coreUmoManualChunk(id) {
|
|
|
653
690
|
return void 0;
|
|
654
691
|
}
|
|
655
692
|
export {
|
|
693
|
+
coreOfficePreviewVitePlugins,
|
|
656
694
|
coreUmoManualChunk,
|
|
657
695
|
coreUmoResolveConfig,
|
|
658
696
|
coreUmoVitePlugins,
|
package/vite/umoIntegration.ts
CHANGED
|
@@ -6,6 +6,31 @@ import { tiptapVueRendererFix } from './tiptapVueRendererFix'
|
|
|
6
6
|
import { umoCjsVirtual } from './umoCjsVirtual'
|
|
7
7
|
import { buildYjsPeerAliases, yjsPeerResolve } from './yjsPeerResolve'
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* docx-preview / exceljs 等 CJS 包在 Vite 浏览器解析会落到 *.min.js(无 default 导出)。
|
|
11
|
+
* 排除预构建,让 umoCjsVirtual 在 resolve 阶段接管。
|
|
12
|
+
*/
|
|
13
|
+
function docxPreviewViteFix(): Plugin {
|
|
14
|
+
return {
|
|
15
|
+
name: 'core-docx-preview-vite',
|
|
16
|
+
config() {
|
|
17
|
+
return {
|
|
18
|
+
optimizeDeps: {
|
|
19
|
+
exclude: ['docx-preview', 'jszip', 'exceljs'],
|
|
20
|
+
},
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 核心包 CJS 兼容(附件预览 docx-preview/jszip、表格导出 exceljs 等)在宿主 Vite 中的插件。
|
|
28
|
+
* 前端系统框架等未接入完整 Umo 插件链的宿主也应引入。
|
|
29
|
+
*/
|
|
30
|
+
export function coreOfficePreviewVitePlugins(): Plugin[] {
|
|
31
|
+
return [createProjectRootPlugin(), umoCjsVirtual(), docxPreviewViteFix()]
|
|
32
|
+
}
|
|
33
|
+
|
|
9
34
|
/**
|
|
10
35
|
* Umo 富文本(editor-main 源码)在宿主 Vite 中所需的全部构建插件。
|
|
11
36
|
* 必须放在 vue() 之前,且需配合 coreUmoResolveConfig()。
|
|
@@ -16,6 +41,7 @@ export function coreUmoVitePlugins(): Plugin[] {
|
|
|
16
41
|
tiptapVueRendererFix(),
|
|
17
42
|
highlightJsLibVirtual(),
|
|
18
43
|
umoCjsVirtual(),
|
|
44
|
+
docxPreviewViteFix(),
|
|
19
45
|
tiptapUmoResolve(),
|
|
20
46
|
yjsPeerResolve(),
|
|
21
47
|
]
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: gitnexus-cli
|
|
3
|
-
description: "Use when the user needs to run GitNexus CLI commands like analyze/index a repo, check status, clean the index, generate a wiki, or list indexed repos. Examples: \"Index this repo\", \"Reanalyze the codebase\", \"Generate a wiki\""
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# GitNexus CLI Commands
|
|
7
|
-
|
|
8
|
-
All commands work via `npx` — no global install required.
|
|
9
|
-
|
|
10
|
-
## Commands
|
|
11
|
-
|
|
12
|
-
### analyze — Build or refresh the index
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
npx gitnexus analyze
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
Run from the project root. This parses all source files, builds the knowledge graph, writes it to `.gitnexus/`, and generates CLAUDE.md / AGENTS.md context files.
|
|
19
|
-
|
|
20
|
-
| Flag | Effect |
|
|
21
|
-
| -------------- | ---------------------------------------------------------------- |
|
|
22
|
-
| `--force` | Force full re-index even if up to date |
|
|
23
|
-
| `--embeddings` | Enable embedding generation for semantic search (off by default) |
|
|
24
|
-
| `--drop-embeddings` | Drop existing embeddings on rebuild. By default, an `analyze` without `--embeddings` preserves them. |
|
|
25
|
-
|
|
26
|
-
**When to run:** First time in a project, after major code changes, or when `gitnexus://repo/{name}/context` reports the index is stale. In Claude Code, a PostToolUse hook detects staleness after `git commit` and `git merge` and notifies the agent to run `analyze` — the hook does not run analyze itself, to avoid blocking the agent for up to 120s and risking KuzuDB corruption on timeout.
|
|
27
|
-
|
|
28
|
-
### status — Check index freshness
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
npx gitnexus status
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Shows whether the current repo has a GitNexus index, when it was last updated, and symbol/relationship counts. Use this to check if re-indexing is needed.
|
|
35
|
-
|
|
36
|
-
### clean — Delete the index
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
npx gitnexus clean
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
Deletes the `.gitnexus/` directory and unregisters the repo from the global registry. Use before re-indexing if the index is corrupt or after removing GitNexus from a project.
|
|
43
|
-
|
|
44
|
-
| Flag | Effect |
|
|
45
|
-
| --------- | ------------------------------------------------- |
|
|
46
|
-
| `--force` | Skip confirmation prompt |
|
|
47
|
-
| `--all` | Clean all indexed repos, not just the current one |
|
|
48
|
-
|
|
49
|
-
### wiki — Generate documentation from the graph
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
npx gitnexus wiki
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
Generates repository documentation from the knowledge graph using an LLM. Requires an API key (saved to `~/.gitnexus/config.json` on first use).
|
|
56
|
-
|
|
57
|
-
| Flag | Effect |
|
|
58
|
-
| ------------------- | ----------------------------------------- |
|
|
59
|
-
| `--force` | Force full regeneration |
|
|
60
|
-
| `--model <model>` | LLM model (default: minimax/minimax-m2.5) |
|
|
61
|
-
| `--base-url <url>` | LLM API base URL |
|
|
62
|
-
| `--api-key <key>` | LLM API key |
|
|
63
|
-
| `--concurrency <n>` | Parallel LLM calls (default: 3) |
|
|
64
|
-
| `--gist` | Publish wiki as a public GitHub Gist |
|
|
65
|
-
|
|
66
|
-
### list — Show all indexed repos
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
npx gitnexus list
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Lists all repositories registered in `~/.gitnexus/registry.json`. The MCP `list_repos` tool provides the same information.
|
|
73
|
-
|
|
74
|
-
## After Indexing
|
|
75
|
-
|
|
76
|
-
1. **Read `gitnexus://repo/{name}/context`** to verify the index loaded
|
|
77
|
-
2. Use the other GitNexus skills (`exploring`, `debugging`, `impact-analysis`, `refactoring`) for your task
|
|
78
|
-
|
|
79
|
-
## Troubleshooting
|
|
80
|
-
|
|
81
|
-
- **"Not inside a git repository"**: Run from a directory inside a git repo
|
|
82
|
-
- **Index is stale after re-analyzing**: Restart Claude Code to reload the MCP server
|
|
83
|
-
- **Embeddings slow**: Omit `--embeddings` (it's off by default) or set `OPENAI_API_KEY` for faster API-based embedding
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: gitnexus-debugging
|
|
3
|
-
description: "Use when the user is debugging a bug, tracing an error, or asking why something fails. Examples: \"Why is X failing?\", \"Where does this error come from?\", \"Trace this bug\""
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Debugging with GitNexus
|
|
7
|
-
|
|
8
|
-
## When to Use
|
|
9
|
-
|
|
10
|
-
- "Why is this function failing?"
|
|
11
|
-
- "Trace where this error comes from"
|
|
12
|
-
- "Who calls this method?"
|
|
13
|
-
- "This endpoint returns 500"
|
|
14
|
-
- Investigating bugs, errors, or unexpected behavior
|
|
15
|
-
|
|
16
|
-
## Workflow
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
1. gitnexus_query({query: "<error or symptom>"}) → Find related execution flows
|
|
20
|
-
2. gitnexus_context({name: "<suspect>"}) → See callers/callees/processes
|
|
21
|
-
3. READ gitnexus://repo/{name}/process/{name} → Trace execution flow
|
|
22
|
-
4. gitnexus_cypher({query: "MATCH path..."}) → Custom traces if needed
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
> If "Index is stale" → run `npx gitnexus analyze` in terminal.
|
|
26
|
-
|
|
27
|
-
## Checklist
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
- [ ] Understand the symptom (error message, unexpected behavior)
|
|
31
|
-
- [ ] gitnexus_query for error text or related code
|
|
32
|
-
- [ ] Identify the suspect function from returned processes
|
|
33
|
-
- [ ] gitnexus_context to see callers and callees
|
|
34
|
-
- [ ] Trace execution flow via process resource if applicable
|
|
35
|
-
- [ ] gitnexus_cypher for custom call chain traces if needed
|
|
36
|
-
- [ ] Read source files to confirm root cause
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## Debugging Patterns
|
|
40
|
-
|
|
41
|
-
| Symptom | GitNexus Approach |
|
|
42
|
-
| -------------------- | ---------------------------------------------------------- |
|
|
43
|
-
| Error message | `gitnexus_query` for error text → `context` on throw sites |
|
|
44
|
-
| Wrong return value | `context` on the function → trace callees for data flow |
|
|
45
|
-
| Intermittent failure | `context` → look for external calls, async deps |
|
|
46
|
-
| Performance issue | `context` → find symbols with many callers (hot paths) |
|
|
47
|
-
| Recent regression | `detect_changes` to see what your changes affect |
|
|
48
|
-
|
|
49
|
-
## Tools
|
|
50
|
-
|
|
51
|
-
**gitnexus_query** — find code related to error:
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
gitnexus_query({query: "payment validation error"})
|
|
55
|
-
→ Processes: CheckoutFlow, ErrorHandling
|
|
56
|
-
→ Symbols: validatePayment, handlePaymentError, PaymentException
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
**gitnexus_context** — full context for a suspect:
|
|
60
|
-
|
|
61
|
-
```
|
|
62
|
-
gitnexus_context({name: "validatePayment"})
|
|
63
|
-
→ Incoming calls: processCheckout, webhookHandler
|
|
64
|
-
→ Outgoing calls: verifyCard, fetchRates (external API!)
|
|
65
|
-
→ Processes: CheckoutFlow (step 3/7)
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
**gitnexus_cypher** — custom call chain traces:
|
|
69
|
-
|
|
70
|
-
```cypher
|
|
71
|
-
MATCH path = (a)-[:CodeRelation {type: 'CALLS'}*1..2]->(b:Function {name: "validatePayment"})
|
|
72
|
-
RETURN [n IN nodes(path) | n.name] AS chain
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Example: "Payment endpoint returns 500 intermittently"
|
|
76
|
-
|
|
77
|
-
```
|
|
78
|
-
1. gitnexus_query({query: "payment error handling"})
|
|
79
|
-
→ Processes: CheckoutFlow, ErrorHandling
|
|
80
|
-
→ Symbols: validatePayment, handlePaymentError
|
|
81
|
-
|
|
82
|
-
2. gitnexus_context({name: "validatePayment"})
|
|
83
|
-
→ Outgoing calls: verifyCard, fetchRates (external API!)
|
|
84
|
-
|
|
85
|
-
3. READ gitnexus://repo/my-app/process/CheckoutFlow
|
|
86
|
-
→ Step 3: validatePayment → calls fetchRates (external)
|
|
87
|
-
|
|
88
|
-
4. Root cause: fetchRates calls external API without proper timeout
|
|
89
|
-
```
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: gitnexus-exploring
|
|
3
|
-
description: "Use when the user asks how code works, wants to understand architecture, trace execution flows, or explore unfamiliar parts of the codebase. Examples: \"How does X work?\", \"What calls this function?\", \"Show me the auth flow\""
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Exploring Codebases with GitNexus
|
|
7
|
-
|
|
8
|
-
## When to Use
|
|
9
|
-
|
|
10
|
-
- "How does authentication work?"
|
|
11
|
-
- "What's the project structure?"
|
|
12
|
-
- "Show me the main components"
|
|
13
|
-
- "Where is the database logic?"
|
|
14
|
-
- Understanding code you haven't seen before
|
|
15
|
-
|
|
16
|
-
## Workflow
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
1. READ gitnexus://repos → Discover indexed repos
|
|
20
|
-
2. READ gitnexus://repo/{name}/context → Codebase overview, check staleness
|
|
21
|
-
3. gitnexus_query({query: "<what you want to understand>"}) → Find related execution flows
|
|
22
|
-
4. gitnexus_context({name: "<symbol>"}) → Deep dive on specific symbol
|
|
23
|
-
5. READ gitnexus://repo/{name}/process/{name} → Trace full execution flow
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
> If step 2 says "Index is stale" → run `npx gitnexus analyze` in terminal.
|
|
27
|
-
|
|
28
|
-
## Checklist
|
|
29
|
-
|
|
30
|
-
```
|
|
31
|
-
- [ ] READ gitnexus://repo/{name}/context
|
|
32
|
-
- [ ] gitnexus_query for the concept you want to understand
|
|
33
|
-
- [ ] Review returned processes (execution flows)
|
|
34
|
-
- [ ] gitnexus_context on key symbols for callers/callees
|
|
35
|
-
- [ ] READ process resource for full execution traces
|
|
36
|
-
- [ ] Read source files for implementation details
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## Resources
|
|
40
|
-
|
|
41
|
-
| Resource | What you get |
|
|
42
|
-
| --------------------------------------- | ------------------------------------------------------- |
|
|
43
|
-
| `gitnexus://repo/{name}/context` | Stats, staleness warning (~150 tokens) |
|
|
44
|
-
| `gitnexus://repo/{name}/clusters` | All functional areas with cohesion scores (~300 tokens) |
|
|
45
|
-
| `gitnexus://repo/{name}/cluster/{name}` | Area members with file paths (~500 tokens) |
|
|
46
|
-
| `gitnexus://repo/{name}/process/{name}` | Step-by-step execution trace (~200 tokens) |
|
|
47
|
-
|
|
48
|
-
## Tools
|
|
49
|
-
|
|
50
|
-
**gitnexus_query** — find execution flows related to a concept:
|
|
51
|
-
|
|
52
|
-
```
|
|
53
|
-
gitnexus_query({query: "payment processing"})
|
|
54
|
-
→ Processes: CheckoutFlow, RefundFlow, WebhookHandler
|
|
55
|
-
→ Symbols grouped by flow with file locations
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
**gitnexus_context** — 360-degree view of a symbol:
|
|
59
|
-
|
|
60
|
-
```
|
|
61
|
-
gitnexus_context({name: "validateUser"})
|
|
62
|
-
→ Incoming calls: loginHandler, apiMiddleware
|
|
63
|
-
→ Outgoing calls: checkToken, getUserById
|
|
64
|
-
→ Processes: LoginFlow (step 2/5), TokenRefresh (step 1/3)
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## Example: "How does payment processing work?"
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
1. READ gitnexus://repo/my-app/context → 918 symbols, 45 processes
|
|
71
|
-
2. gitnexus_query({query: "payment processing"})
|
|
72
|
-
→ CheckoutFlow: processPayment → validateCard → chargeStripe
|
|
73
|
-
→ RefundFlow: initiateRefund → calculateRefund → processRefund
|
|
74
|
-
3. gitnexus_context({name: "processPayment"})
|
|
75
|
-
→ Incoming: checkoutHandler, webhookHandler
|
|
76
|
-
→ Outgoing: validateCard, chargeStripe, saveTransaction
|
|
77
|
-
4. Read src/payments/processor.ts for implementation details
|
|
78
|
-
```
|