@douyinfe/semi-foundation 2.70.0-alpha.2 → 2.70.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/chat/foundation.ts +17 -2
  2. package/datePicker/yearAndMonthFoundation.ts +29 -9
  3. package/lib/cjs/chat/foundation.d.ts +4 -0
  4. package/lib/cjs/chat/foundation.js +12 -1
  5. package/lib/cjs/datePicker/yearAndMonthFoundation.js +39 -8
  6. package/lib/cjs/markdownRender/foundation.d.ts +1 -0
  7. package/lib/cjs/markdownRender/foundation.js +9 -4
  8. package/lib/cjs/overflowList/constants.d.ts +1 -1
  9. package/lib/cjs/resizable/foundation.d.ts +2 -4
  10. package/lib/cjs/resizable/group/index.d.ts +6 -3
  11. package/lib/cjs/resizable/group/index.js +90 -23
  12. package/lib/cjs/resizable/resizable.css +86 -0
  13. package/lib/cjs/resizable/resizable.scss +100 -3
  14. package/lib/cjs/resizable/single/index.d.ts +1 -1
  15. package/lib/cjs/resizable/single/index.js +2 -2
  16. package/lib/cjs/resizable/types.d.ts +41 -0
  17. package/lib/cjs/resizable/types.js +12 -0
  18. package/lib/cjs/resizable/utils.js +5 -5
  19. package/lib/cjs/resizable/variables.scss +8 -0
  20. package/lib/cjs/table/table.css +2 -1
  21. package/lib/cjs/table/table.scss +2 -1
  22. package/lib/cjs/transfer/transfer.css +1 -0
  23. package/lib/cjs/transfer/transfer.scss +1 -0
  24. package/lib/cjs/tree/treeUtil.d.ts +1 -1
  25. package/lib/cjs/treeSelect/treeSelect.css +3 -1
  26. package/lib/cjs/treeSelect/treeSelect.scss +4 -1
  27. package/lib/es/chat/foundation.d.ts +4 -0
  28. package/lib/es/chat/foundation.js +12 -1
  29. package/lib/es/datePicker/yearAndMonthFoundation.js +39 -8
  30. package/lib/es/markdownRender/foundation.d.ts +1 -0
  31. package/lib/es/markdownRender/foundation.js +9 -4
  32. package/lib/es/overflowList/constants.d.ts +1 -1
  33. package/lib/es/resizable/foundation.d.ts +2 -4
  34. package/lib/es/resizable/foundation.js +2 -4
  35. package/lib/es/resizable/group/index.d.ts +6 -3
  36. package/lib/es/resizable/group/index.js +90 -23
  37. package/lib/es/resizable/resizable.css +86 -0
  38. package/lib/es/resizable/resizable.scss +100 -3
  39. package/lib/es/resizable/single/index.d.ts +1 -1
  40. package/lib/es/resizable/single/index.js +1 -1
  41. package/lib/es/resizable/types.d.ts +41 -0
  42. package/lib/es/resizable/types.js +6 -0
  43. package/lib/es/resizable/utils.js +5 -5
  44. package/lib/es/resizable/variables.scss +8 -0
  45. package/lib/es/table/table.css +2 -1
  46. package/lib/es/table/table.scss +2 -1
  47. package/lib/es/transfer/transfer.css +1 -0
  48. package/lib/es/transfer/transfer.scss +1 -0
  49. package/lib/es/tree/treeUtil.d.ts +1 -1
  50. package/lib/es/treeSelect/treeSelect.css +3 -1
  51. package/lib/es/treeSelect/treeSelect.scss +4 -1
  52. package/markdownRender/foundation.ts +13 -7
  53. package/package.json +3 -5
  54. package/resizable/foundation.ts +3 -19
  55. package/resizable/group/index.ts +92 -29
  56. package/resizable/resizable.scss +100 -3
  57. package/resizable/single/index.ts +1 -1
  58. package/resizable/{singleConstants.ts → types.ts} +0 -65
  59. package/resizable/utils.ts +7 -6
  60. package/resizable/variables.scss +8 -0
  61. package/table/table.scss +2 -1
  62. package/transfer/transfer.scss +1 -0
  63. package/treeSelect/treeSelect.scss +4 -1
  64. package/tsconfig.json +1 -1
  65. package/jsonViewer/constants.ts +0 -7
  66. package/jsonViewer/foundation.ts +0 -67
  67. package/jsonViewer/jsonViewer.scss +0 -152
  68. package/jsonViewer/script/build.js +0 -51
  69. package/jsonViewer/variables.scss +0 -27
  70. package/lib/cjs/jsonViewer/constants.d.ts +0 -4
  71. package/lib/cjs/jsonViewer/constants.js +0 -10
  72. package/lib/cjs/jsonViewer/foundation.d.ts +0 -21
  73. package/lib/cjs/jsonViewer/foundation.js +0 -78
  74. package/lib/cjs/jsonViewer/jsonViewer.css +0 -136
  75. package/lib/cjs/jsonViewer/jsonViewer.scss +0 -152
  76. package/lib/cjs/jsonViewer/variables.scss +0 -27
  77. package/lib/cjs/resizable/groupConstants.d.ts +0 -16
  78. package/lib/cjs/resizable/groupConstants.js +0 -25
  79. package/lib/cjs/resizable/singleConstants.d.ts +0 -105
  80. package/lib/cjs/resizable/singleConstants.js +0 -67
  81. package/lib/es/jsonViewer/constants.d.ts +0 -4
  82. package/lib/es/jsonViewer/constants.js +0 -5
  83. package/lib/es/jsonViewer/foundation.d.ts +0 -21
  84. package/lib/es/jsonViewer/foundation.js +0 -60
  85. package/lib/es/jsonViewer/jsonViewer.css +0 -136
  86. package/lib/es/jsonViewer/jsonViewer.scss +0 -152
  87. package/lib/es/jsonViewer/variables.scss +0 -27
  88. package/lib/es/resizable/groupConstants.d.ts +0 -16
  89. package/lib/es/resizable/groupConstants.js +0 -19
  90. package/lib/es/resizable/singleConstants.d.ts +0 -105
  91. package/lib/es/resizable/singleConstants.js +0 -61
  92. package/resizable/groupConstants.ts +0 -25
@@ -1,152 +0,0 @@
1
- @import './variables.scss';
2
-
3
- $module: #{$prefix}-json-viewer;
4
-
5
- .#{$module} {
6
- &-background {
7
- background-color: $color-json-viewer-background;
8
- }
9
-
10
- &-string-key {
11
- color: $color-json-viewer-key;
12
- }
13
-
14
- &-string-value {
15
- color: $color-json-viewer-value;
16
- }
17
-
18
- &-keyword {
19
- color: $color-json-viewer-keyword;
20
- }
21
-
22
- &-number {
23
- color: $color-json-viewer-number;
24
- }
25
-
26
- &-delimiter-comma {
27
- color: $color-json-viewer-delimiter-comma;
28
- }
29
-
30
- @each $type, $colors in $semi-json-viewer-delimiter-colors {
31
- @each $level, $color in $colors {
32
- &-delimiter-#{$type}-#{$level} {
33
- color: $color;
34
- }
35
- }
36
- }
37
-
38
- &-search-result {
39
- background-color: $semi-json-viewer-search-result-background;
40
- }
41
-
42
- &-current-search-result {
43
- background-color: $semi-json-viewer-current-search-result-background !important;
44
- }
45
-
46
- &-folding-icon {
47
- opacity: 0.7;
48
- transition: opacity 0.8s;
49
- color: $semi-json-viewer-folding-icon-color;
50
- }
51
-
52
- &-view-line {
53
- font-family: Menlo, Firecode, Monaco, 'Courier New', monospace;
54
- font-weight: normal;
55
- font-size: 12px;
56
- font-feature-settings: 'liga' 0, 'calt' 0;
57
- font-variation-settings: normal;
58
- letter-spacing: 0px;
59
- color: #237893;
60
- }
61
-
62
- &-line-number {
63
- font-family: Menlo, Firecode, Monaco, 'Courier New', monospace;
64
- font-weight: normal;
65
- font-size: 12px;
66
- font-feature-settings: 'liga' 0, 'calt' 0;
67
- font-variation-settings: normal;
68
- letter-spacing: 0px;
69
- color: $semi-json-viewer-line-number-color;
70
- text-align: center;
71
- width: 50px;
72
- }
73
-
74
- &-line-number-container {
75
- scrollbar-width: none; /* 隐藏滚动条(Firefox) */
76
- -ms-overflow-style: none; /* 隐藏滚动条(IE 和 Edge) */
77
- }
78
-
79
- &-line-number-container::-webkit-scrollbar {
80
- display: none; /* 隐藏滚动条(Webkit 浏览器) */
81
- }
82
-
83
- &-search-bar-container {
84
- width: 440px;
85
- border: 1px solid var(--semi-color-border);
86
- border-radius: var(--semi-border-radius-small);
87
- display: flex;
88
- flex-direction: column;
89
- padding: 8px;
90
- gap: 8px;
91
- }
92
-
93
-
94
- &-replace-bar,
95
- &-search-bar {
96
- display: flex;
97
- align-items: flex-start;
98
- gap: 8px;
99
- }
100
-
101
- &-search-options {
102
- display: flex;
103
- align-items: center;
104
- justify-content: center;
105
- list-style: none;
106
- padding-inline-start: 0;
107
- margin-block-start: 0;
108
- margin-block-end: 0;
109
- }
110
-
111
- &-search-options-item {
112
- min-width: 32px;
113
- height: 32px;
114
- display: flex;
115
- align-items: center;
116
- justify-content: center;
117
- cursor: pointer;
118
- margin: 0 4px;
119
- border-radius: var(--semi-border-radius-small);
120
- }
121
-
122
- &-search-options-item:hover {
123
- background-color: var(--semi-color-default);
124
- }
125
-
126
- &-search-options-item-active {
127
- color: var(--semi-color-primary);
128
- background-color: var(--semi-color-primary-light-default);
129
- }
130
-
131
- &-complete-suggestions-container {
132
- border-radius: var(--semi-border-radius-medium);
133
- background-color: var(--semi-color-bg-3);
134
- box-shadow: var(--semi-shadow-elevated);
135
- z-index: 1000;
136
- min-width: 200px;
137
- max-width: 400px;
138
- list-style: none;
139
- padding: 4px 0;
140
- }
141
-
142
- &-complete-container {
143
- position: absolute;
144
- z-index: 1000;
145
- }
146
-
147
- &-complete-suggestions-item {
148
- padding: 8px 16px;
149
- color: var(--semi-color-text-0);
150
- cursor: pointer;
151
- }
152
- }
@@ -1,51 +0,0 @@
1
- const esbuild = require('esbuild');
2
- const path = require('path');
3
- const fs = require('fs');
4
-
5
-
6
-
7
-
8
- const compileWorker = async ()=>{
9
- const workerEntry = path.join(__dirname, "..", "core/src/worker/json.worker.ts");
10
-
11
- const result = await esbuild.build({
12
- entryPoints: [workerEntry],
13
- bundle: true,
14
- write: false,
15
- });
16
- return result.outputFiles[0].text;
17
- };
18
-
19
-
20
- const buildMain = async ()=>{
21
- const mainEntry = path.join(__dirname, "..", "core/src/index.ts");
22
-
23
- const result = await esbuild.build({
24
- entryPoints: [mainEntry],
25
- bundle: true,
26
- packages: 'external',
27
- write: false,
28
- format: 'esm'
29
- });
30
- return result.outputFiles[0].text;
31
-
32
- };
33
-
34
-
35
-
36
- const compile = async ()=>{
37
- const workerRaw = await compileWorker();
38
-
39
- const mainRaw = await buildMain();
40
-
41
- const finalRaw = mainRaw.replaceAll("%WORKER_RAW%", encodeURIComponent(workerRaw));
42
-
43
- const saveDir = path.join(__dirname, "..", "core/lib");
44
-
45
- if (!fs.existsSync(saveDir)) {
46
- fs.mkdirSync(saveDir);
47
- }
48
- fs.writeFileSync(path.join(saveDir, "index.js"), finalRaw, 'utf8');
49
- };
50
-
51
- compile();
@@ -1,27 +0,0 @@
1
- $color-json-viewer-background: var(--semi-color-default); // JSON背景颜色
2
- $color-json-viewer-key: rgba(var(--semi-red-5), 1); // JSON key 颜色
3
- $color-json-viewer-value: rgba(var(--semi-blue-5), 1);
4
- $color-json-viewer-number: rgba(var(--semi-green-5), 1); // JSON number 颜色
5
- $color-json-viewer-keyword: rgba(var(--semi-blue-5), 1); // JSON keyword 颜色
6
- $color-json-viewer-delimiter-comma: rgba(var(--semi-blue-6), 1); // JSON delimiter comma 颜色
7
-
8
- $semi-json-viewer-delimiter-colors: (
9
- bracket: (
10
- 0: rgba(var(--semi-blue-7), 1), // 括号层级 0 颜色
11
- 1: rgba(var(--semi-green-7), 1), // 括号层级 1 颜色
12
- 2: rgba(var(--semi-orange-7), 1), // 括号层级 2 颜色
13
- ),
14
- array: (
15
- 0: rgba(var(--semi-blue-7), 1), // 数组层级 0 颜色
16
- 1: rgba(var(--semi-green-7), 1), // 数组层级 1 颜色
17
- 2: rgba(var(--semi-orange-7), 1), // 数组层级 2 颜色
18
- )
19
- );
20
-
21
- $semi-json-viewer-search-result-background: rgba(var(--semi-green-2), 1); // JSON search result background 颜色
22
- $semi-json-viewer-current-search-result-background: rgba(var(--semi-yellow-4), 1); // JSON current search result background 颜色
23
-
24
- $semi-json-viewer-folding-icon-color: rgba(var(--semi-blue-7), 1); // JSON folding icon 颜色
25
-
26
-
27
- $semi-json-viewer-line-number-color: rgba(var(--semi-grey-5), 1); // JSON line number 颜色
@@ -1,4 +0,0 @@
1
- declare const cssClasses: {
2
- readonly PREFIX: "semi-json-viewer";
3
- };
4
- export { cssClasses };
@@ -1,10 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.cssClasses = void 0;
7
- var _constants = require("../base/constants");
8
- const cssClasses = exports.cssClasses = {
9
- PREFIX: `${_constants.BASE_CLASS_PREFIX}-json-viewer`
10
- };
@@ -1,21 +0,0 @@
1
- export * from '@douyinfe/semi-json-viewer-core';
2
- import { JsonViewer } from '@douyinfe/semi-json-viewer-core';
3
- import BaseFoundation, { DefaultAdapter } from '../base/foundation';
4
- export interface JsonViewerAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
5
- getJsonViewerRef: () => HTMLElement;
6
- onValueChange: (value: string) => void;
7
- onValueHover: (value: string, el: HTMLElement) => HTMLElement | undefined;
8
- }
9
- declare class JsonViewerFoundation extends BaseFoundation<JsonViewerAdapter> {
10
- constructor(adapter: JsonViewerAdapter);
11
- jsonViewer: JsonViewer | null;
12
- init(): void;
13
- onValueChange(value: string): void;
14
- onValueHover(value: string, el: HTMLElement): HTMLElement | undefined;
15
- search(searchText: string): void;
16
- prevSearch(): void;
17
- nextSearch(): void;
18
- replace(replaceText: string): void;
19
- replaceAll(replaceText: string): void;
20
- }
21
- export default JsonViewerFoundation;
@@ -1,78 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _exportNames = {};
7
- exports.default = void 0;
8
- var _semiJsonViewerCore = require("@douyinfe/semi-json-viewer-core");
9
- Object.keys(_semiJsonViewerCore).forEach(function (key) {
10
- if (key === "default" || key === "__esModule") return;
11
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
12
- if (key in exports && exports[key] === _semiJsonViewerCore[key]) return;
13
- Object.defineProperty(exports, key, {
14
- enumerable: true,
15
- get: function () {
16
- return _semiJsonViewerCore[key];
17
- }
18
- });
19
- });
20
- var _foundation = _interopRequireDefault(require("../base/foundation"));
21
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
22
- class JsonViewerFoundation extends _foundation.default {
23
- constructor(adapter) {
24
- super(Object.assign(Object.assign({}, JsonViewerFoundation), adapter));
25
- this.jsonViewer = null;
26
- }
27
- init() {
28
- const props = this.getProps();
29
- const jsonViewerRef = this._adapter.getJsonViewerRef();
30
- this.jsonViewer = new _semiJsonViewerCore.JsonViewer(jsonViewerRef, props.value, props.options);
31
- this.jsonViewer.layout();
32
- this.jsonViewer.emitter.on('contentChanged', e => {
33
- var _a;
34
- this.onValueChange((_a = this.jsonViewer) === null || _a === void 0 ? void 0 : _a.getModel().getValue());
35
- });
36
- this.jsonViewer.emitter.on('hoverNode', e => {
37
- const el = this.onValueHover(e.value, e.target);
38
- if (el) {
39
- this.jsonViewer.emitter.emit('renderHoverNode', {
40
- el
41
- });
42
- }
43
- });
44
- }
45
- onValueChange(value) {
46
- this._adapter.onValueChange(value);
47
- }
48
- onValueHover(value, el) {
49
- return this._adapter.onValueHover(value, el);
50
- }
51
- search(searchText) {
52
- var _a;
53
- const state = this.getState('searchOptions');
54
- const {
55
- caseSensitive,
56
- wholeWord,
57
- regex
58
- } = state;
59
- (_a = this.jsonViewer) === null || _a === void 0 ? void 0 : _a.getSearchWidget().search(searchText, caseSensitive, wholeWord, regex);
60
- }
61
- prevSearch() {
62
- var _a;
63
- (_a = this.jsonViewer) === null || _a === void 0 ? void 0 : _a.getSearchWidget().navigateResults(-1);
64
- }
65
- nextSearch() {
66
- var _a;
67
- (_a = this.jsonViewer) === null || _a === void 0 ? void 0 : _a.getSearchWidget().navigateResults(1);
68
- }
69
- replace(replaceText) {
70
- var _a;
71
- (_a = this.jsonViewer) === null || _a === void 0 ? void 0 : _a.getSearchWidget().replace(replaceText);
72
- }
73
- replaceAll(replaceText) {
74
- var _a;
75
- (_a = this.jsonViewer) === null || _a === void 0 ? void 0 : _a.getSearchWidget().replaceAll(replaceText);
76
- }
77
- }
78
- var _default = exports.default = JsonViewerFoundation;
@@ -1,136 +0,0 @@
1
- /* shadow */
2
- /* sizing */
3
- /* spacing */
4
- .semi-json-viewer-background {
5
- background-color: var(--semi-color-default);
6
- }
7
- .semi-json-viewer-string-key {
8
- color: rgba(var(--semi-red-5), 1);
9
- }
10
- .semi-json-viewer-string-value {
11
- color: rgba(var(--semi-blue-5), 1);
12
- }
13
- .semi-json-viewer-keyword {
14
- color: rgba(var(--semi-blue-5), 1);
15
- }
16
- .semi-json-viewer-number {
17
- color: rgba(var(--semi-green-5), 1);
18
- }
19
- .semi-json-viewer-delimiter-comma {
20
- color: rgba(var(--semi-blue-6), 1);
21
- }
22
- .semi-json-viewer-delimiter-bracket-0 {
23
- color: rgba(var(--semi-blue-7), 1);
24
- }
25
- .semi-json-viewer-delimiter-bracket-1 {
26
- color: rgba(var(--semi-green-7), 1);
27
- }
28
- .semi-json-viewer-delimiter-bracket-2 {
29
- color: rgba(var(--semi-orange-7), 1);
30
- }
31
- .semi-json-viewer-delimiter-array-0 {
32
- color: rgba(var(--semi-blue-7), 1);
33
- }
34
- .semi-json-viewer-delimiter-array-1 {
35
- color: rgba(var(--semi-green-7), 1);
36
- }
37
- .semi-json-viewer-delimiter-array-2 {
38
- color: rgba(var(--semi-orange-7), 1);
39
- }
40
- .semi-json-viewer-search-result {
41
- background-color: rgba(var(--semi-green-2), 1);
42
- }
43
- .semi-json-viewer-current-search-result {
44
- background-color: rgba(var(--semi-yellow-4), 1) !important;
45
- }
46
- .semi-json-viewer-folding-icon {
47
- opacity: 0.7;
48
- transition: opacity 0.8s;
49
- color: rgba(var(--semi-blue-7), 1);
50
- }
51
- .semi-json-viewer-view-line {
52
- font-family: Menlo, Firecode, Monaco, "Courier New", monospace;
53
- font-weight: normal;
54
- font-size: 12px;
55
- font-feature-settings: "liga" 0, "calt" 0;
56
- font-variation-settings: normal;
57
- letter-spacing: 0px;
58
- color: #237893;
59
- }
60
- .semi-json-viewer-line-number {
61
- font-family: Menlo, Firecode, Monaco, "Courier New", monospace;
62
- font-weight: normal;
63
- font-size: 12px;
64
- font-feature-settings: "liga" 0, "calt" 0;
65
- font-variation-settings: normal;
66
- letter-spacing: 0px;
67
- color: rgba(var(--semi-grey-5), 1);
68
- text-align: center;
69
- width: 50px;
70
- }
71
- .semi-json-viewer-line-number-container {
72
- scrollbar-width: none; /* 隐藏滚动条(Firefox) */
73
- -ms-overflow-style: none; /* 隐藏滚动条(IE 和 Edge) */
74
- }
75
- .semi-json-viewer-line-number-container::-webkit-scrollbar {
76
- display: none; /* 隐藏滚动条(Webkit 浏览器) */
77
- }
78
- .semi-json-viewer-search-bar-container {
79
- width: 440px;
80
- border: 1px solid var(--semi-color-border);
81
- border-radius: var(--semi-border-radius-small);
82
- display: flex;
83
- flex-direction: column;
84
- padding: 8px;
85
- gap: 8px;
86
- }
87
- .semi-json-viewer-replace-bar, .semi-json-viewer-search-bar {
88
- display: flex;
89
- align-items: flex-start;
90
- gap: 8px;
91
- }
92
- .semi-json-viewer-search-options {
93
- display: flex;
94
- align-items: center;
95
- justify-content: center;
96
- list-style: none;
97
- padding-inline-start: 0;
98
- margin-block-start: 0;
99
- margin-block-end: 0;
100
- }
101
- .semi-json-viewer-search-options-item {
102
- min-width: 32px;
103
- height: 32px;
104
- display: flex;
105
- align-items: center;
106
- justify-content: center;
107
- cursor: pointer;
108
- margin: 0 4px;
109
- border-radius: var(--semi-border-radius-small);
110
- }
111
- .semi-json-viewer-search-options-item:hover {
112
- background-color: var(--semi-color-default);
113
- }
114
- .semi-json-viewer-search-options-item-active {
115
- color: var(--semi-color-primary);
116
- background-color: var(--semi-color-primary-light-default);
117
- }
118
- .semi-json-viewer-complete-suggestions-container {
119
- border-radius: var(--semi-border-radius-medium);
120
- background-color: var(--semi-color-bg-3);
121
- box-shadow: var(--semi-shadow-elevated);
122
- z-index: 1000;
123
- min-width: 200px;
124
- max-width: 400px;
125
- list-style: none;
126
- padding: 4px 0;
127
- }
128
- .semi-json-viewer-complete-container {
129
- position: absolute;
130
- z-index: 1000;
131
- }
132
- .semi-json-viewer-complete-suggestions-item {
133
- padding: 8px 16px;
134
- color: var(--semi-color-text-0);
135
- cursor: pointer;
136
- }
@@ -1,152 +0,0 @@
1
- @import './variables.scss';
2
-
3
- $module: #{$prefix}-json-viewer;
4
-
5
- .#{$module} {
6
- &-background {
7
- background-color: $color-json-viewer-background;
8
- }
9
-
10
- &-string-key {
11
- color: $color-json-viewer-key;
12
- }
13
-
14
- &-string-value {
15
- color: $color-json-viewer-value;
16
- }
17
-
18
- &-keyword {
19
- color: $color-json-viewer-keyword;
20
- }
21
-
22
- &-number {
23
- color: $color-json-viewer-number;
24
- }
25
-
26
- &-delimiter-comma {
27
- color: $color-json-viewer-delimiter-comma;
28
- }
29
-
30
- @each $type, $colors in $semi-json-viewer-delimiter-colors {
31
- @each $level, $color in $colors {
32
- &-delimiter-#{$type}-#{$level} {
33
- color: $color;
34
- }
35
- }
36
- }
37
-
38
- &-search-result {
39
- background-color: $semi-json-viewer-search-result-background;
40
- }
41
-
42
- &-current-search-result {
43
- background-color: $semi-json-viewer-current-search-result-background !important;
44
- }
45
-
46
- &-folding-icon {
47
- opacity: 0.7;
48
- transition: opacity 0.8s;
49
- color: $semi-json-viewer-folding-icon-color;
50
- }
51
-
52
- &-view-line {
53
- font-family: Menlo, Firecode, Monaco, 'Courier New', monospace;
54
- font-weight: normal;
55
- font-size: 12px;
56
- font-feature-settings: 'liga' 0, 'calt' 0;
57
- font-variation-settings: normal;
58
- letter-spacing: 0px;
59
- color: #237893;
60
- }
61
-
62
- &-line-number {
63
- font-family: Menlo, Firecode, Monaco, 'Courier New', monospace;
64
- font-weight: normal;
65
- font-size: 12px;
66
- font-feature-settings: 'liga' 0, 'calt' 0;
67
- font-variation-settings: normal;
68
- letter-spacing: 0px;
69
- color: $semi-json-viewer-line-number-color;
70
- text-align: center;
71
- width: 50px;
72
- }
73
-
74
- &-line-number-container {
75
- scrollbar-width: none; /* 隐藏滚动条(Firefox) */
76
- -ms-overflow-style: none; /* 隐藏滚动条(IE 和 Edge) */
77
- }
78
-
79
- &-line-number-container::-webkit-scrollbar {
80
- display: none; /* 隐藏滚动条(Webkit 浏览器) */
81
- }
82
-
83
- &-search-bar-container {
84
- width: 440px;
85
- border: 1px solid var(--semi-color-border);
86
- border-radius: var(--semi-border-radius-small);
87
- display: flex;
88
- flex-direction: column;
89
- padding: 8px;
90
- gap: 8px;
91
- }
92
-
93
-
94
- &-replace-bar,
95
- &-search-bar {
96
- display: flex;
97
- align-items: flex-start;
98
- gap: 8px;
99
- }
100
-
101
- &-search-options {
102
- display: flex;
103
- align-items: center;
104
- justify-content: center;
105
- list-style: none;
106
- padding-inline-start: 0;
107
- margin-block-start: 0;
108
- margin-block-end: 0;
109
- }
110
-
111
- &-search-options-item {
112
- min-width: 32px;
113
- height: 32px;
114
- display: flex;
115
- align-items: center;
116
- justify-content: center;
117
- cursor: pointer;
118
- margin: 0 4px;
119
- border-radius: var(--semi-border-radius-small);
120
- }
121
-
122
- &-search-options-item:hover {
123
- background-color: var(--semi-color-default);
124
- }
125
-
126
- &-search-options-item-active {
127
- color: var(--semi-color-primary);
128
- background-color: var(--semi-color-primary-light-default);
129
- }
130
-
131
- &-complete-suggestions-container {
132
- border-radius: var(--semi-border-radius-medium);
133
- background-color: var(--semi-color-bg-3);
134
- box-shadow: var(--semi-shadow-elevated);
135
- z-index: 1000;
136
- min-width: 200px;
137
- max-width: 400px;
138
- list-style: none;
139
- padding: 4px 0;
140
- }
141
-
142
- &-complete-container {
143
- position: absolute;
144
- z-index: 1000;
145
- }
146
-
147
- &-complete-suggestions-item {
148
- padding: 8px 16px;
149
- color: var(--semi-color-text-0);
150
- cursor: pointer;
151
- }
152
- }
@@ -1,27 +0,0 @@
1
- $color-json-viewer-background: var(--semi-color-default); // JSON背景颜色
2
- $color-json-viewer-key: rgba(var(--semi-red-5), 1); // JSON key 颜色
3
- $color-json-viewer-value: rgba(var(--semi-blue-5), 1);
4
- $color-json-viewer-number: rgba(var(--semi-green-5), 1); // JSON number 颜色
5
- $color-json-viewer-keyword: rgba(var(--semi-blue-5), 1); // JSON keyword 颜色
6
- $color-json-viewer-delimiter-comma: rgba(var(--semi-blue-6), 1); // JSON delimiter comma 颜色
7
-
8
- $semi-json-viewer-delimiter-colors: (
9
- bracket: (
10
- 0: rgba(var(--semi-blue-7), 1), // 括号层级 0 颜色
11
- 1: rgba(var(--semi-green-7), 1), // 括号层级 1 颜色
12
- 2: rgba(var(--semi-orange-7), 1), // 括号层级 2 颜色
13
- ),
14
- array: (
15
- 0: rgba(var(--semi-blue-7), 1), // 数组层级 0 颜色
16
- 1: rgba(var(--semi-green-7), 1), // 数组层级 1 颜色
17
- 2: rgba(var(--semi-orange-7), 1), // 数组层级 2 颜色
18
- )
19
- );
20
-
21
- $semi-json-viewer-search-result-background: rgba(var(--semi-green-2), 1); // JSON search result background 颜色
22
- $semi-json-viewer-current-search-result-background: rgba(var(--semi-yellow-4), 1); // JSON current search result background 颜色
23
-
24
- $semi-json-viewer-folding-icon-color: rgba(var(--semi-blue-7), 1); // JSON folding icon 颜色
25
-
26
-
27
- $semi-json-viewer-line-number-color: rgba(var(--semi-grey-5), 1); // JSON line number 颜色
@@ -1,16 +0,0 @@
1
- export declare const directionStyles: {
2
- readonly horizontal: {
3
- readonly width: "8px";
4
- readonly flexShrink: 0;
5
- readonly height: "100%";
6
- readonly margin: "0";
7
- readonly cursor: "col-resize";
8
- };
9
- readonly vertical: {
10
- readonly width: "100%";
11
- readonly height: "8px";
12
- readonly flexShrink: 0;
13
- readonly margin: "0";
14
- readonly cursor: "row-resize";
15
- };
16
- };