@oipage/cli 0.3.0 → 1.0.0-alpha.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.
Files changed (92) hide show
  1. package/.github/FUNDING.yml +11 -11
  2. package/AUTHORS.txt +6 -6
  3. package/CHANGELOG +76 -47
  4. package/LICENSE +20 -20
  5. package/README.md +204 -132
  6. package/bin/WebSocket/decodeWsFrame.js +43 -43
  7. package/bin/WebSocket/encodeWsFrame.js +28 -28
  8. package/bin/WebSocket/headersToJSON.js +26 -26
  9. package/bin/WebSocket/index.js +106 -106
  10. package/bin/data/mineTypes.json +108 -104
  11. package/bin/disk.js +42 -42
  12. package/bin/help.js +63 -55
  13. package/bin/intercept.js +15 -15
  14. package/bin/network.js +21 -21
  15. package/bin/notebook/data.js +185 -0
  16. package/bin/notebook/index.js +168 -9
  17. package/bin/proxy.js +82 -82
  18. package/bin/run +146 -146
  19. package/bin/serve.js +455 -318
  20. package/bin/template/404.html +184 -184
  21. package/bin/tools/deleteEmptyFolder.js +33 -33
  22. package/bin/tools/format.js +75 -75
  23. package/bin/tools/isBinary.js +83 -83
  24. package/bin/tools/moduleForm.js +548 -0
  25. package/bin/tools/network.js +42 -42
  26. package/bin/tools/openBrowser.js +34 -34
  27. package/bin/tools/resolve404.js +98 -98
  28. package/bin/tools/resolveImport.js +278 -97
  29. package/bin/tools/resolvePackage.js +412 -0
  30. package/bin/website-htmls/components/ui-select-file/index.html +8 -8
  31. package/bin/website-htmls/components/ui-select-file/index.js +42 -42
  32. package/bin/website-htmls/components/ui-select-file/index.scss +44 -44
  33. package/bin/website-htmls/dialogs/imageSize/index.html +54 -54
  34. package/bin/website-htmls/dialogs/imageSize/index.js +53 -53
  35. package/bin/website-htmls/dialogs/imageSize/index.scss +140 -140
  36. package/bin/website-htmls/dialogs/index.js +52 -52
  37. package/bin/website-htmls/images/addFile.svg +1 -1
  38. package/bin/website-htmls/images/img-to-pdf.svg +1 -1
  39. package/bin/website-htmls/index.html +17 -17
  40. package/bin/website-htmls/main.js +13 -13
  41. package/bin/website-htmls/pages/App/index.html +6 -6
  42. package/bin/website-htmls/pages/App/index.js +22 -22
  43. package/bin/website-htmls/pages/App/index.scss +43 -43
  44. package/bin/website-htmls/pages/appStore/index.html +7 -7
  45. package/bin/website-htmls/pages/appStore/index.js +19 -19
  46. package/bin/website-htmls/pages/appStore/index.scss +54 -54
  47. package/bin/website-htmls/pages/chart/index.html +8 -8
  48. package/bin/website-htmls/pages/chart/index.js +72 -72
  49. package/bin/website-htmls/pages/chart/index.scss +71 -71
  50. package/bin/website-htmls/pages/home/index.html +19 -19
  51. package/bin/website-htmls/pages/home/index.js +19 -19
  52. package/bin/website-htmls/pages/home/index.scss +87 -87
  53. package/bin/website-htmls/pages/image-editor/index.html +27 -27
  54. package/bin/website-htmls/pages/image-editor/index.js +106 -106
  55. package/bin/website-htmls/pages/image-editor/index.scss +69 -69
  56. package/bin/website-htmls/pages/img-to-pdf/index.html +3 -3
  57. package/bin/website-htmls/pages/img-to-pdf/index.js +44 -44
  58. package/bin/website-htmls/pages/img-to-pdf/index.scss +9 -9
  59. package/bin/website-htmls/pages/recorder-screen/index.html +15 -15
  60. package/bin/website-htmls/pages/recorder-screen/index.js +227 -227
  61. package/bin/website-htmls/pages/recorder-screen/index.scss +52 -52
  62. package/bin/website-htmls/router.config.js +29 -29
  63. package/bin/website-htmls/styles/common.css +44 -44
  64. package/bin/website-htmls/styles/normalize.css +94 -94
  65. package/bin/website-plugins/intercept/chart.js +33 -33
  66. package/bin/website-plugins/intercept/getPackage.js +17 -17
  67. package/bin/website-plugins/intercept/head.js +8 -8
  68. package/bin/website-plugins/intercept/index.js +4 -8
  69. package/bin/website-plugins/loader/index.js +11 -11
  70. package/bin/website-plugins/loader/oipage-html-loader.js +7 -7
  71. package/bin/website-plugins/loader/oipage-scss-loader.js +149 -149
  72. package/docs/css/base.css +122 -0
  73. package/docs/css/components.css +180 -0
  74. package/docs/css/layout.css +295 -0
  75. package/docs/css/responsive.css +49 -0
  76. package/docs/images/file-list.webp +0 -0
  77. package/docs/images/logo-topbar.svg +5 -0
  78. package/docs/images/logo.png +0 -0
  79. package/docs/images/logo.svg +6 -0
  80. package/docs/images/manual.webp +0 -0
  81. package/docs/images/terminal-serve.webp +0 -0
  82. package/docs/index.html +1392 -0
  83. package/docs/js/copy.js +37 -0
  84. package/docs/js/nav.js +111 -0
  85. package/docs/js/search.js +241 -0
  86. package/docs/js/theme.js +17 -0
  87. package/package.json +42 -42
  88. package/src/index.js +26 -29
  89. package/types/serve.d.ts +83 -83
  90. package/bin/website-plugins/intercept/oipage-vislite-intercept.js +0 -56
  91. package/bin/website-plugins/intercept/oipage-zipaper-intercept.js +0 -37
  92. package/docs/config.md +0 -107
@@ -1,150 +1,150 @@
1
- // 参考:https://github.com/zxl20070701/zxl20070701.github.io/blob/master/bin/loader/scss.js
2
- let toSelector = function (preSelectorArray, deep) {
3
- let selectors = preSelectorArray[0], i, j, k;
4
- for (i = 1; i < deep; i++) {
5
- let temp = [];
6
- for (j = 0; j < selectors.length; j++) {
7
- for (k = 0; k < preSelectorArray[i].length; k++) {
8
- temp.push(selectors[j] + preSelectorArray[i][k]);
9
- }
10
- }
11
- selectors = temp;
12
- }
13
- return "\n" + (selectors.join(',')) + "{\n";
14
- };
15
- let analyseBlock = function (source) {
16
- let i = -1, currentChar = null;
17
- let next = function () {
18
- currentChar = i++ < source.length - 1 ? source[i] : null;
19
- return currentChar;
20
- }
21
- let nextNValue = function (n) {
22
- return source.substring(i, n + i > source.length ? source.length : n + i);
23
- }
24
- let blocks = [];
25
- let currentBlock = "";
26
- next();
27
- while (true) {
28
- while (new RegExp("[\\x20\\t\\r\\n\\f]").test(currentChar)) {
29
- next();
30
- }
31
- if (currentChar == null) break;
32
- if (nextNValue(2) == '/*') {
33
-
34
- next();
35
- next();
36
- currentBlock = "/*";
37
-
38
- while (nextNValue(2) != '*/' && currentChar != null) {
39
- currentBlock += currentChar;
40
- next();
41
- }
42
- if (currentChar == null) {
43
- throw new Error('The comment is not closed.');
44
- }
45
- currentBlock += "*/";
46
- next();
47
- next();
48
- blocks.push({
49
- value: currentBlock,
50
- type: "comment-double"
51
- });
52
- }
53
- else if (nextNValue(2) == '//') {
54
- currentBlock = '';
55
-
56
- while (currentChar != '\n' && currentChar != null) {
57
- currentBlock += currentChar;
58
- next();
59
- }
60
-
61
- blocks.push({
62
- value: currentBlock,
63
- type: "comment-single"
64
- });
65
-
66
- }
67
- else if (currentChar == '}') {
68
-
69
- blocks.push({
70
- value: "}",
71
- type: "end"
72
- });
73
-
74
- next();
75
-
76
- }
77
- else {
78
-
79
- currentBlock = '';
80
- while (currentChar != '{' && currentChar != ';' && currentChar != null) {
81
- currentBlock += currentChar;
82
- next();
83
- }
84
- if (currentChar == null) {
85
- throw new Error('Statement or code block missing closure.');
86
- }
87
- blocks.push({
88
- value: currentBlock + currentChar,
89
- type: {
90
- '{': "begin",
91
- ';': 'statement'
92
- }[currentChar]
93
- });
94
- next();
95
- }
96
- }
97
- return blocks;
98
- };
99
- module.exports = function (source) {
100
- this.setFileType("application/javascript");
101
- let blocks = analyseBlock(source + "");
102
- let i, j, cssCode = "", preSelectorArray = [], deep = 0;
103
- for (i = 0; i < blocks.length; i++) {
104
- if (blocks[i].type == 'comment-double') {
105
- cssCode += blocks[i].value;
106
- }
107
- else if (blocks[i].type == 'comment-single') {
108
- cssCode += "\n/* " + blocks[i].value + " */\n";
109
- }
110
- else if (blocks[i].type == 'begin') {
111
- let preSplit = blocks[i].value.split(',');
112
- let preSelect = [];
113
- for (j = 0; j < preSplit.length; j++) {
114
- preSelect[j] = preSplit[j].replace(/\{$/, '').trim();
115
- if (/^&/.test(preSelect[j])) {
116
- preSelect[j] = preSelect[j].replace(/^&/, '');
117
- } else {
118
- preSelect[j] = " " + preSelect[j];
119
- }
120
- }
121
- preSelectorArray[deep] = preSelect;
122
- deep += 1;
123
- }
124
- else if (blocks[i].type == 'end') {
125
- deep -= 1;
126
- }
127
- else if (blocks[i].type == 'statement') {
128
- j = 1;
129
- let preType = blocks[i - j].type;
130
- while (['comment-double', 'comment-single'].indexOf(preType) > -1) {
131
- j += 1;
132
- preType = blocks[i - j].type;
133
- }
134
- if (['end', 'begin'].indexOf(preType) > -1) {
135
- cssCode += toSelector(preSelectorArray, deep);
136
- }
137
- cssCode += "\n" + blocks[i].value + "\n";
138
- j = 1;
139
- let nextType = blocks[i + j].type;
140
- while (['comment-double', 'comment-single'].indexOf(nextType) > -1) {
141
- j += 1;
142
- nextType = blocks[i + j].type;
143
- }
144
- if (['end', 'begin'].indexOf(nextType) > -1) {
145
- cssCode += "\n}\n";
146
- }
147
- }
148
- }
149
- return `export default ${JSON.stringify(cssCode)}`;
1
+ // 参考:https://github.com/zxl20070701/zxl20070701.github.io/blob/master/bin/loader/scss.js
2
+ let toSelector = function (preSelectorArray, deep) {
3
+ let selectors = preSelectorArray[0], i, j, k;
4
+ for (i = 1; i < deep; i++) {
5
+ let temp = [];
6
+ for (j = 0; j < selectors.length; j++) {
7
+ for (k = 0; k < preSelectorArray[i].length; k++) {
8
+ temp.push(selectors[j] + preSelectorArray[i][k]);
9
+ }
10
+ }
11
+ selectors = temp;
12
+ }
13
+ return "\n" + (selectors.join(',')) + "{\n";
14
+ };
15
+ let analyseBlock = function (source) {
16
+ let i = -1, currentChar = null;
17
+ let next = function () {
18
+ currentChar = i++ < source.length - 1 ? source[i] : null;
19
+ return currentChar;
20
+ }
21
+ let nextNValue = function (n) {
22
+ return source.substring(i, n + i > source.length ? source.length : n + i);
23
+ }
24
+ let blocks = [];
25
+ let currentBlock = "";
26
+ next();
27
+ while (true) {
28
+ while (new RegExp("[\\x20\\t\\r\\n\\f]").test(currentChar)) {
29
+ next();
30
+ }
31
+ if (currentChar == null) break;
32
+ if (nextNValue(2) == '/*') {
33
+
34
+ next();
35
+ next();
36
+ currentBlock = "/*";
37
+
38
+ while (nextNValue(2) != '*/' && currentChar != null) {
39
+ currentBlock += currentChar;
40
+ next();
41
+ }
42
+ if (currentChar == null) {
43
+ throw new Error('The comment is not closed.');
44
+ }
45
+ currentBlock += "*/";
46
+ next();
47
+ next();
48
+ blocks.push({
49
+ value: currentBlock,
50
+ type: "comment-double"
51
+ });
52
+ }
53
+ else if (nextNValue(2) == '//') {
54
+ currentBlock = '';
55
+
56
+ while (currentChar != '\n' && currentChar != null) {
57
+ currentBlock += currentChar;
58
+ next();
59
+ }
60
+
61
+ blocks.push({
62
+ value: currentBlock,
63
+ type: "comment-single"
64
+ });
65
+
66
+ }
67
+ else if (currentChar == '}') {
68
+
69
+ blocks.push({
70
+ value: "}",
71
+ type: "end"
72
+ });
73
+
74
+ next();
75
+
76
+ }
77
+ else {
78
+
79
+ currentBlock = '';
80
+ while (currentChar != '{' && currentChar != ';' && currentChar != null) {
81
+ currentBlock += currentChar;
82
+ next();
83
+ }
84
+ if (currentChar == null) {
85
+ throw new Error('Statement or code block missing closure.');
86
+ }
87
+ blocks.push({
88
+ value: currentBlock + currentChar,
89
+ type: {
90
+ '{': "begin",
91
+ ';': 'statement'
92
+ }[currentChar]
93
+ });
94
+ next();
95
+ }
96
+ }
97
+ return blocks;
98
+ };
99
+ module.exports = function (source) {
100
+ this.setFileType("application/javascript");
101
+ let blocks = analyseBlock(source + "");
102
+ let i, j, cssCode = "", preSelectorArray = [], deep = 0;
103
+ for (i = 0; i < blocks.length; i++) {
104
+ if (blocks[i].type == 'comment-double') {
105
+ cssCode += blocks[i].value;
106
+ }
107
+ else if (blocks[i].type == 'comment-single') {
108
+ cssCode += "\n/* " + blocks[i].value + " */\n";
109
+ }
110
+ else if (blocks[i].type == 'begin') {
111
+ let preSplit = blocks[i].value.split(',');
112
+ let preSelect = [];
113
+ for (j = 0; j < preSplit.length; j++) {
114
+ preSelect[j] = preSplit[j].replace(/\{$/, '').trim();
115
+ if (/^&/.test(preSelect[j])) {
116
+ preSelect[j] = preSelect[j].replace(/^&/, '');
117
+ } else {
118
+ preSelect[j] = " " + preSelect[j];
119
+ }
120
+ }
121
+ preSelectorArray[deep] = preSelect;
122
+ deep += 1;
123
+ }
124
+ else if (blocks[i].type == 'end') {
125
+ deep -= 1;
126
+ }
127
+ else if (blocks[i].type == 'statement') {
128
+ j = 1;
129
+ let preType = blocks[i - j].type;
130
+ while (['comment-double', 'comment-single'].indexOf(preType) > -1) {
131
+ j += 1;
132
+ preType = blocks[i - j].type;
133
+ }
134
+ if (['end', 'begin'].indexOf(preType) > -1) {
135
+ cssCode += toSelector(preSelectorArray, deep);
136
+ }
137
+ cssCode += "\n" + blocks[i].value + "\n";
138
+ j = 1;
139
+ let nextType = blocks[i + j].type;
140
+ while (['comment-double', 'comment-single'].indexOf(nextType) > -1) {
141
+ j += 1;
142
+ nextType = blocks[i + j].type;
143
+ }
144
+ if (['end', 'begin'].indexOf(nextType) > -1) {
145
+ cssCode += "\n}\n";
146
+ }
147
+ }
148
+ }
149
+ return `export default ${JSON.stringify(cssCode)}`;
150
150
  };
@@ -0,0 +1,122 @@
1
+ /* ============================================================
2
+ @oipage/cli 参考手册 —— 文档站版式(对齐 webpack 文档站观感)
3
+
4
+ base 层:reset / 颜色与尺寸变量 / 双主题 / 字体与基础排版。
5
+ 亮色为默认主题,深色作为可切换的备选;代码块配色跟随主题。
6
+ 后续文件按 base → layout → components → responsive 依次引入。
7
+ ============================================================ */
8
+ *, *::before, *::after { box-sizing: border-box; }
9
+ html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
10
+ @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
11
+
12
+ :root {
13
+ /* 亮色:默认 */
14
+ --bg: #ffffff;
15
+ --page: #f4f6f8;
16
+ --panel: #ffffff;
17
+ --line: #e4eaef;
18
+ --line-strong: #d3dce4;
19
+ --rule: #e9eef2;
20
+ --surface: #f7f9fb;
21
+ --surface-2: #f2f6f9;
22
+ --surface-3: #edf1f5;
23
+ --hover: #f6f9fb;
24
+ --text: #1d2b36;
25
+ --text-dim: #46596a;
26
+ --muted: #6d8292;
27
+ --faint: #8ea1af;
28
+ --ink: #10202b;
29
+ --accent: #1a6fd4;
30
+ --accent-soft: #eaf2fd;
31
+ --accent-wash: #eff6fd;
32
+ --accent-line: #b9d6f6;
33
+ --violet: #6a4ecb;
34
+ --warn: #a15c00;
35
+ --warn-wash: #fdf6e9;
36
+
37
+ /* 顶栏(深色石板,两种主题一致) */
38
+ --topbar: #2f3d45;
39
+ --topbar-2: #26333a;
40
+ --topbar-text: #eef3f6;
41
+ --topbar-dim: #b3c1c9;
42
+ --topbar-line: rgba(255, 255, 255, .16);
43
+
44
+ /* 代码块:亮色主题下是浅底深字 */
45
+ --code-bg: #f6f8fa;
46
+ --code-head: #eef2f6;
47
+ --code-border: #e1e7ee;
48
+ --code-text: #24292f;
49
+ --code-comment: #74808c;
50
+ --code-key: #0550ae;
51
+ --code-str: #0a3069;
52
+ --code-num: #953800;
53
+
54
+ --sidebar: 272px;
55
+ --topbar-h: 62px;
56
+ --tabs-h: 46px;
57
+ --measure: 46em;
58
+ }
59
+
60
+ html[data-theme="dark"] {
61
+ --bg: #0f1418;
62
+ --page: #0b0f13;
63
+ --panel: #0f1418;
64
+ --line: rgba(255, 255, 255, .10);
65
+ --line-strong: rgba(255, 255, 255, .18);
66
+ --rule: rgba(255, 255, 255, .13);
67
+ --surface: rgba(255, 255, 255, .025);
68
+ --surface-2: rgba(255, 255, 255, .045);
69
+ --surface-3: rgba(255, 255, 255, .07);
70
+ --hover: rgba(255, 255, 255, .022);
71
+ --text: #dde3ec;
72
+ --text-dim: #a7b1c2;
73
+ --muted: #7d8899;
74
+ --faint: #5f6b7d;
75
+ --ink: #f2f6fb;
76
+ --accent: #5aa9ff;
77
+ --accent-soft: rgba(90, 169, 255, .12);
78
+ --accent-wash: rgba(90, 169, 255, .06);
79
+ --accent-line: rgba(90, 169, 255, .38);
80
+ --violet: #9b86ff;
81
+ --warn: #ffb64d;
82
+ --warn-wash: rgba(255, 182, 77, .06);
83
+
84
+ --code-bg: #0f1319;
85
+ --code-head: #131922;
86
+ --code-border: rgba(255, 255, 255, .10);
87
+ --code-text: #cdd6e3;
88
+ --code-comment: #7b8698;
89
+ --code-key: #6cb2ff;
90
+ --code-str: #a895ff;
91
+ --code-num: #ffb64d;
92
+ color-scheme: dark;
93
+ }
94
+
95
+ html[data-theme="light"] { color-scheme: light; }
96
+
97
+ body {
98
+ margin: 0;
99
+ background: var(--bg);
100
+ color: var(--text);
101
+ font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", -apple-system, "Segoe UI", sans-serif;
102
+ font-size: 17px;
103
+ line-height: 1.9;
104
+ -webkit-font-smoothing: antialiased;
105
+ text-rendering: optimizeLegibility;
106
+ }
107
+
108
+ a { color: var(--accent); }
109
+
110
+ /* 老版背景层已不再需要,保留元素但不绘制,避免页面出现多余纹理 */
111
+ .backdrop { display: none; }
112
+
113
+ /* ---------- 通用等宽字体 ---------- */
114
+ .mono,
115
+ code,
116
+ .code pre,
117
+ .chip,
118
+ .facts .v,
119
+ .field .sig,
120
+ .search input {
121
+ font-family: "SFMono-Regular", Menlo, Consolas, "Courier New", monospace;
122
+ }
@@ -0,0 +1,180 @@
1
+ /* ============================================================
2
+ @oipage/cli 参考手册 · 章节标题、chip、提示框、代码块、表格、字段清单、正文与页脚
3
+ 版式对齐 webpack 文档站:大标题、宽松正文、淡蓝提示框、浅色代码块。
4
+ ============================================================ */
5
+
6
+ /* ---------- 章节 ---------- */
7
+ .sec { padding-top: 44px; scroll-margin-top: calc(var(--topbar-h) + var(--tabs-h) + 16px); }
8
+ .welcome + .sec { padding-top: 56px; }
9
+ .sec + .sec { border-top: 1px solid var(--rule); margin-top: 44px; }
10
+ .sec > h2 {
11
+ margin: 0;
12
+ font-size: 31px; line-height: 1.5; font-weight: 600;
13
+ color: var(--ink); letter-spacing: .3px;
14
+ }
15
+ .sec > h2 .path {
16
+ font-size: 27px; font-weight: 600; color: var(--ink);
17
+ letter-spacing: .2px;
18
+ }
19
+ .sec > h2 .path b { color: var(--muted); font-weight: 500; }
20
+ .sec > h2 .cmd { font-size: 28px; font-weight: 600; color: var(--ink); }
21
+ .sec-lede {
22
+ margin: 12px 0 0; max-width: var(--measure);
23
+ color: var(--text-dim); font-size: 17px; line-height: 1.9;
24
+ }
25
+ .sub-h {
26
+ margin: 30px 0 0; font-size: 16.5px; font-weight: 600; color: var(--ink);
27
+ padding-bottom: 6px; border-bottom: 1px solid var(--rule);
28
+ }
29
+
30
+ .chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
31
+ .chip {
32
+ display: inline-flex; align-items: baseline; gap: 6px;
33
+ padding: 3px 10px; border: 1px solid var(--line); border-radius: 5px;
34
+ font-size: 12.5px; color: var(--text-dim); background: var(--surface-2);
35
+ }
36
+ .chip u { text-decoration: none; color: var(--faint); font-size: 11.5px; }
37
+ .chip.is-default { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
38
+ .chip.is-default u { color: var(--accent); opacity: .75; }
39
+
40
+ /* ---------- 提示框:淡蓝底 + 左侧色条,自带「提示 / 注意」小标题 ---------- */
41
+ .note {
42
+ margin: 20px 0 0; max-width: var(--measure);
43
+ padding: 15px 20px 16px;
44
+ border: 1px solid var(--accent-line);
45
+ border-left: 4px solid var(--accent);
46
+ border-radius: 4px;
47
+ background: var(--accent-wash);
48
+ color: var(--text-dim); font-size: 16px; line-height: 1.85;
49
+ }
50
+ .note::before {
51
+ content: "提示";
52
+ display: block; margin-bottom: 4px;
53
+ font-size: 16px; font-weight: 600; color: var(--ink);
54
+ }
55
+ .note.warn { border-color: #ecd3a6; border-left-color: var(--warn); background: var(--warn-wash); }
56
+ .note.warn::before { content: "注意"; color: var(--warn); }
57
+ .note strong { color: var(--text); font-weight: 600; }
58
+
59
+ /* ---------- 版本徽标(1.0.0 新增 / 调整) ---------- */
60
+ .badge {
61
+ display: inline-block; margin-left: 12px;
62
+ padding: 1px 9px;
63
+ font-size: 11.5px; font-weight: 500; line-height: 20px;
64
+ letter-spacing: .02em;
65
+ border-radius: 999px; vertical-align: 3px;
66
+ white-space: nowrap;
67
+ }
68
+ .badge.new { color: #1a6fd4; background: var(--accent-soft); border: 1px solid var(--accent-line); }
69
+ html[data-theme="dark"] .badge.new { color: #8ec2ff; }
70
+ .badge.dep { color: var(--warn); background: var(--warn-wash); border: 1px solid #f0dcbc; }
71
+ html[data-theme="dark"] .badge.dep { border-color: rgba(255, 182, 77, .35); }
72
+
73
+ /* 废弃 / 变更说明(比提示框更"旧"一层) */
74
+ .dep-note {
75
+ margin: 22px 0 0;
76
+ padding: 12px 16px;
77
+ font-size: 14.5px; line-height: 1.85; color: var(--text-dim);
78
+ background: var(--warn-wash);
79
+ border-left: 3px solid #e2b66a;
80
+ border-radius: 0 4px 4px 0;
81
+ }
82
+ .dep-note strong { color: var(--ink); font-weight: 600; }
83
+
84
+ /* ---------- 代码块:跟随主题,亮色主题下浅底深字 ---------- */
85
+ .code {
86
+ margin: 20px 0 0;
87
+ border: 1px solid var(--code-border); border-radius: 6px;
88
+ background: var(--code-bg); overflow: hidden;
89
+ }
90
+ .code .head {
91
+ display: flex; align-items: center; justify-content: space-between; gap: 12px;
92
+ padding: 7px 12px 7px 14px;
93
+ border-bottom: 1px solid var(--code-border);
94
+ background: var(--code-head);
95
+ }
96
+ .code .file {
97
+ font-size: 12.5px; color: var(--code-comment); min-width: 0;
98
+ white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
99
+ }
100
+ .code .copy {
101
+ flex: 0 0 auto;
102
+ font-family: inherit; font-size: 11.5px;
103
+ color: var(--code-comment); background: transparent;
104
+ border: 1px solid var(--line-strong); border-radius: 4px;
105
+ padding: 3px 9px; cursor: pointer;
106
+ transition: color .15s, border-color .15s;
107
+ }
108
+ .code .copy:hover { color: var(--code-key); border-color: var(--code-key); }
109
+ .code .copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
110
+ .code pre {
111
+ margin: 0; padding: 16px 18px; overflow-x: auto;
112
+ font-size: 13.5px; line-height: 1.75; color: var(--code-text);
113
+ tab-size: 4;
114
+ }
115
+ .code pre b { color: var(--code-comment); font-weight: 400; } /* 注释 */
116
+ .code pre em { color: var(--code-key); font-style: normal; } /* 键名 / 命令 */
117
+ .code pre u { color: var(--code-str); text-decoration: none; } /* 字符串 */
118
+ .code pre s { color: var(--code-num); text-decoration: none; } /* 数字 / 布尔 */
119
+
120
+ /* ---------- 表格 ---------- */
121
+ .table-wrap {
122
+ margin: 20px 0 0;
123
+ border: 1px solid var(--line); border-radius: 6px;
124
+ overflow: hidden; background: var(--panel);
125
+ }
126
+ table { width: 100%; border-collapse: collapse; table-layout: fixed; }
127
+ thead th {
128
+ text-align: left; font-size: 12.5px; font-weight: 500; color: var(--muted);
129
+ padding: 10px 14px; background: var(--surface-2);
130
+ border-bottom: 1px solid var(--line);
131
+ }
132
+ tbody td {
133
+ padding: 11px 14px; font-size: 14.5px; color: var(--text-dim);
134
+ border-bottom: 1px solid var(--line); vertical-align: top;
135
+ word-break: break-word; line-height: 1.75;
136
+ }
137
+ tbody tr:last-child td { border-bottom: 0; }
138
+ tbody td:first-child { font-family: "SFMono-Regular", Menlo, Consolas, monospace; color: var(--text); font-size: 13.5px; }
139
+ tbody td a { color: var(--accent); text-decoration: none; }
140
+ tbody td a:hover { text-decoration: underline; }
141
+ tbody td.mono-cell { font-family: "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13.5px; }
142
+ tbody td code { font-size: 13px; color: var(--text-dim); background: var(--surface-3); padding: 1px 5px; border-radius: 3px; }
143
+ tbody tr:hover td { background: var(--hover); }
144
+
145
+ /* ---------- 字段清单 ---------- */
146
+ .fields { margin: 18px 0 0; border-top: 1px solid var(--line); }
147
+ .field { padding: 16px 0; border-bottom: 1px solid var(--line); }
148
+ .field .sig { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
149
+ .field .sig .n { font-size: 14.5px; color: var(--accent); font-weight: 600; }
150
+ .field .sig .t { font-size: 12.5px; color: var(--muted); }
151
+ .field .d { margin: 5px 0 0; max-width: var(--measure); font-size: 16px; color: var(--text-dim); }
152
+
153
+ .prose { max-width: var(--measure); }
154
+ .prose p { margin: 16px 0 0; color: var(--text-dim); font-size: 17px; }
155
+ .prose ul { margin: 14px 0 0; padding-left: 22px; color: var(--text-dim); font-size: 17px; }
156
+ .prose li { margin: 6px 0; }
157
+ .prose li::marker { color: var(--accent); }
158
+
159
+ /* ---------- 结尾 ---------- */
160
+ .end {
161
+ margin-top: 72px; padding-top: 22px; border-top: 1px solid var(--line);
162
+ display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
163
+ font-size: 13px; color: var(--muted);
164
+ }
165
+ .end .links { display: flex; gap: 18px; flex-wrap: wrap; }
166
+ .end a { color: var(--text-dim); text-decoration: none; }
167
+ .end a:hover { color: var(--accent); text-decoration: underline; }
168
+
169
+
170
+ /* ---------- 首页示意图 ---------- */
171
+ .diagram .dia-box { fill: var(--panel); stroke: var(--line-strong); stroke-width: 1.4; }
172
+ .diagram .dia-text { fill: var(--text); font-size: 14px; }
173
+ .diagram .dia-core { fill: var(--accent-soft); stroke: var(--accent-line); stroke-width: 1.6; }
174
+ .diagram .dia-title { fill: var(--accent); font-size: 16px; font-weight: 600; }
175
+ .diagram .dia-sub { fill: var(--muted); font-size: 12.5px; }
176
+ .diagram .dia-cap { fill: var(--faint); font-size: 13px; }
177
+ .diagram .dia-link { fill: none; stroke: var(--line-strong); stroke-width: 1.4; stroke-dasharray: 5 5; }
178
+ .diagram .dia-mark { fill: none; stroke: var(--line-strong); stroke-width: 1.6; }
179
+
180
+ /* ---------- 目录搜索结果 ---------- */