zs_library 0.4.10 → 0.4.11
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/components/desktop/config.js +15 -0
- package/dist/components/desktop/context/config/context.js +14 -0
- package/dist/components/desktop/context/config/hooks.js +7 -0
- package/dist/components/desktop/context/state/context.js +221 -0
- package/dist/components/desktop/context/state/hooks.js +7 -0
- package/dist/components/desktop/context-menu/index.js +312 -0
- package/dist/components/desktop/index.js +40 -0
- package/dist/components/desktop/items/group-item.js +305 -0
- package/dist/components/desktop/items/modal/group-item-modal.js +158 -0
- package/dist/components/desktop/items/modal/info-modal.js +33 -0
- package/dist/components/desktop/items/sortable-item.js +120 -0
- package/dist/components/desktop/sortable.js +272 -0
- package/dist/components/desktop/style.js +18 -0
- package/dist/components/desktop/theme.js +32 -0
- package/dist/components/desktop/utils.js +15 -0
- package/dist/components/dock/dock-desktop.js +83 -0
- package/dist/components/dock/dock-mobile.js +69 -0
- package/dist/components/dock/index.js +24 -0
- package/dist/components/dock/utils.js +9 -0
- package/dist/components/editor/editor.js +199 -0
- package/dist/components/editor/extensions/drag-handle/clipboard-serializer.js +20 -0
- package/dist/components/editor/extensions/drag-handle/index.js +273 -0
- package/dist/components/editor/extensions.js +131 -0
- package/dist/components/editor/generative/ai-completion-command.js +59 -0
- package/dist/components/editor/generative/ai-selector-commands.js +78 -0
- package/dist/components/editor/generative/ai-selector.js +90 -0
- package/dist/components/editor/generative/drag-handle.js +70 -0
- package/dist/components/editor/generative/generative-dropdown-menu.js +55 -0
- package/dist/components/editor/generative/generative-menu-switch.js +59 -0
- package/dist/components/editor/image-upload.js +36 -0
- package/dist/components/editor/index.js +8 -0
- package/dist/components/editor/lib/colors.js +98 -0
- package/dist/components/editor/lib/content.js +8 -0
- package/dist/components/editor/lib/nodes.js +70 -0
- package/dist/components/editor/lib/url-utils.js +21 -0
- package/dist/components/editor/preview.js +12 -0
- package/dist/components/editor/selectors/color-selector.js +100 -0
- package/dist/components/editor/selectors/link-selector.js +82 -0
- package/dist/components/editor/selectors/math-selector.js +37 -0
- package/dist/components/editor/selectors/node-selector.js +56 -0
- package/dist/components/editor/selectors/text-buttons.js +75 -0
- package/dist/components/editor/slash-command.js +129 -0
- package/dist/components/editor/ui/button.js +44 -0
- package/dist/components/editor/ui/command.js +94 -0
- package/dist/components/editor/ui/dialog.js +68 -0
- package/dist/components/editor/ui/dropdown-menu.js +99 -0
- package/dist/components/editor/ui/icons/crazy-spinner.js +10 -0
- package/dist/components/editor/ui/popover.js +24 -0
- package/dist/components/editor/ui/scroll-area.js +39 -0
- package/dist/components/editor/ui/separator.js +25 -0
- package/dist/components/editor/ui/tooltip.js +25 -0
- package/dist/components/md-editor/editor.js +104 -0
- package/dist/components/md-editor/i18n/index.js +12 -0
- package/dist/components/md-editor/i18n/zh_CN.js +122 -0
- package/dist/components/md-editor/index.js +8 -0
- package/dist/components/md-editor/preview.js +81 -0
- package/dist/components/md-editor/style.js +267 -0
- package/dist/components/md-editor/utils.js +8 -0
- package/dist/i18n/index.js +23 -0
- package/dist/i18n/locales/en-US.js +30 -0
- package/dist/i18n/locales/zh-CN.js +30 -0
- package/dist/index.js +12 -10612
- package/dist/node_modules/.pnpm/@tiptap_pm@2.11.5/node_modules/@tiptap/pm/view/dist/index.js +3 -0
- package/package.json +6 -1
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import "./index.css";
|
|
2
|
+
import { css as t, cx as o } from "@emotion/css";
|
|
3
|
+
const a = t`
|
|
4
|
+
--accentBase: var(--tomato-1);
|
|
5
|
+
--accentBgSubtle: var(--tomato-2);
|
|
6
|
+
--accentBg: var(--tomato-3);
|
|
7
|
+
--accentBgHover: var(--tomato-4);
|
|
8
|
+
--accentBgActive: var(--tomato-5);
|
|
9
|
+
--accentLine: var(--tomato-6);
|
|
10
|
+
--accentBorder: var(--tomato-7);
|
|
11
|
+
--accentBorderHover: var(--tomato-8);
|
|
12
|
+
--accentSolid: var(--tomato-9);
|
|
13
|
+
--accentSolidHover: var(--tomato-10);
|
|
14
|
+
--accentText: var(--tomato-11);
|
|
15
|
+
--accentTextContrast: var(--tomato-12);
|
|
16
|
+
|
|
17
|
+
--baseBase: var(--mauve-1);
|
|
18
|
+
--baseBgSubtle: var(--mauve-2);
|
|
19
|
+
--baseBg: var(--mauve-3);
|
|
20
|
+
--baseBgHover: var(--mauve-4);
|
|
21
|
+
--baseBgActive: var(--mauve-5);
|
|
22
|
+
--baseLine: var(--mauve-6);
|
|
23
|
+
--baseBorder: var(--mauve-7);
|
|
24
|
+
--baseBorderHover: var(--mauve-8);
|
|
25
|
+
--baseSolid: var(--mauve-9);
|
|
26
|
+
--baseSolidHover: var(--mauve-10);
|
|
27
|
+
--baseText: var(--mauve-11);
|
|
28
|
+
--baseTextContrast: var(--mauve-12);
|
|
29
|
+
|
|
30
|
+
--admonitionTipBg: var(--cyan-4);
|
|
31
|
+
--admonitionTipBorder: var(--cyan-8);
|
|
32
|
+
|
|
33
|
+
--admonitionInfoBg: var(--grass-4);
|
|
34
|
+
--admonitionInfoBorder: var(--grass-8);
|
|
35
|
+
|
|
36
|
+
--admonitionCautionBg: var(--amber-4);
|
|
37
|
+
--admonitionCautionBorder: var(--amber-8);
|
|
38
|
+
|
|
39
|
+
--admonitionDangerBg: var(--red-4);
|
|
40
|
+
--admonitionDangerBorder: var(--red-8);
|
|
41
|
+
|
|
42
|
+
--admonitionNoteBg: var(--mauve-4);
|
|
43
|
+
--admonitionNoteBorder: var(--mauve-8);
|
|
44
|
+
|
|
45
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
46
|
+
Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
|
|
47
|
+
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
|
|
48
|
+
"Liberation Mono", "Courier New", monospace;
|
|
49
|
+
|
|
50
|
+
color: var(--baseText);
|
|
51
|
+
--basePageBg: #000000;
|
|
52
|
+
background-color: var(--basePageBg);
|
|
53
|
+
background-image: linear-gradient(
|
|
54
|
+
rgba(255, 255, 255, 0.05),
|
|
55
|
+
rgba(255, 255, 255, 0.05)
|
|
56
|
+
);
|
|
57
|
+
`, l = t`
|
|
58
|
+
[class*="_toolbarRoot"] {
|
|
59
|
+
flex-wrap: wrap;
|
|
60
|
+
transition: all 0.3s;
|
|
61
|
+
}
|
|
62
|
+
[class*="_codeMirrorWrapper"] {
|
|
63
|
+
padding: 0;
|
|
64
|
+
[class*="_codeMirrorToolbar"] {
|
|
65
|
+
position: static;
|
|
66
|
+
background-color: var(--bgColor-muted);
|
|
67
|
+
justify-content: flex-end;
|
|
68
|
+
[class*="_iconButton"] {
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
[class*="_tableEditor"] {
|
|
74
|
+
border-spacing: 0;
|
|
75
|
+
border-collapse: collapse;
|
|
76
|
+
width: 100%;
|
|
77
|
+
display: table;
|
|
78
|
+
th[data-tool-cell],
|
|
79
|
+
td[data-tool-cell] {
|
|
80
|
+
padding: 0;
|
|
81
|
+
border: none;
|
|
82
|
+
}
|
|
83
|
+
tr {
|
|
84
|
+
border-top: 0;
|
|
85
|
+
}
|
|
86
|
+
thead {
|
|
87
|
+
th {
|
|
88
|
+
padding: 0;
|
|
89
|
+
border: none;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
tfoot {
|
|
93
|
+
th {
|
|
94
|
+
padding: 0;
|
|
95
|
+
border: none;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
[class*="_addRowButton"],
|
|
99
|
+
[class*="_addColumnButton"],
|
|
100
|
+
[class*="_tableColumnEditorTrigger"],
|
|
101
|
+
[class*="_iconButton"] {
|
|
102
|
+
cursor: pointer;
|
|
103
|
+
transition: all 0.3s;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
ul {
|
|
107
|
+
[role="checkbox"] {
|
|
108
|
+
padding: 0 20px;
|
|
109
|
+
&::before {
|
|
110
|
+
width: 13px;
|
|
111
|
+
height: 13px;
|
|
112
|
+
top: 6px;
|
|
113
|
+
}
|
|
114
|
+
&::after {
|
|
115
|
+
top: 7px;
|
|
116
|
+
left: 4px;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
ul,
|
|
121
|
+
ol {
|
|
122
|
+
li {
|
|
123
|
+
margin-top: 4px;
|
|
124
|
+
margin-bottom: 0;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
`, n = o(
|
|
128
|
+
"markdown-body",
|
|
129
|
+
t`
|
|
130
|
+
p {
|
|
131
|
+
margin-bottom: 8px;
|
|
132
|
+
}
|
|
133
|
+
ul {
|
|
134
|
+
list-style: disc;
|
|
135
|
+
}
|
|
136
|
+
ol {
|
|
137
|
+
list-style: decimal;
|
|
138
|
+
}
|
|
139
|
+
table {
|
|
140
|
+
width: 100%;
|
|
141
|
+
display: table;
|
|
142
|
+
}
|
|
143
|
+
pre {
|
|
144
|
+
padding: 0;
|
|
145
|
+
> div {
|
|
146
|
+
margin: 0 !important;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
`
|
|
150
|
+
), s = t`
|
|
151
|
+
.markdown-body {
|
|
152
|
+
/* light */
|
|
153
|
+
color-scheme: light;
|
|
154
|
+
--focus-outlineColor: #0969da;
|
|
155
|
+
--fgColor-default: #1f2328;
|
|
156
|
+
--fgColor-muted: #59636e;
|
|
157
|
+
--fgColor-accent: #0969da;
|
|
158
|
+
--fgColor-success: #1a7f37;
|
|
159
|
+
--fgColor-attention: #9a6700;
|
|
160
|
+
--fgColor-danger: #d1242f;
|
|
161
|
+
--fgColor-done: #8250df;
|
|
162
|
+
--bgColor-default: #ffffff;
|
|
163
|
+
--bgColor-muted: #f6f8fa;
|
|
164
|
+
--bgColor-neutral-muted: #818b981f;
|
|
165
|
+
--bgColor-attention-muted: #fff8c5;
|
|
166
|
+
--borderColor-default: transparent;
|
|
167
|
+
--borderColor-muted: #d1d9e0b3;
|
|
168
|
+
--borderColor-neutral-muted: #d1d9e0b3;
|
|
169
|
+
--borderColor-accent-emphasis: #0969da;
|
|
170
|
+
--borderColor-success-emphasis: #1a7f37;
|
|
171
|
+
--borderColor-attention-emphasis: #9a6700;
|
|
172
|
+
--borderColor-danger-emphasis: #cf222e;
|
|
173
|
+
--borderColor-done-emphasis: #8250df;
|
|
174
|
+
--color-prettylights-syntax-comment: #59636e;
|
|
175
|
+
--color-prettylights-syntax-constant: #0550ae;
|
|
176
|
+
--color-prettylights-syntax-constant-other-reference-link: #0a3069;
|
|
177
|
+
--color-prettylights-syntax-entity: #6639ba;
|
|
178
|
+
--color-prettylights-syntax-storage-modifier-import: #1f2328;
|
|
179
|
+
--color-prettylights-syntax-entity-tag: #0550ae;
|
|
180
|
+
--color-prettylights-syntax-keyword: #cf222e;
|
|
181
|
+
--color-prettylights-syntax-string: #0a3069;
|
|
182
|
+
--color-prettylights-syntax-variable: #953800;
|
|
183
|
+
--color-prettylights-syntax-brackethighlighter-unmatched: #82071e;
|
|
184
|
+
--color-prettylights-syntax-brackethighlighter-angle: #59636e;
|
|
185
|
+
--color-prettylights-syntax-invalid-illegal-text: #f6f8fa;
|
|
186
|
+
--color-prettylights-syntax-invalid-illegal-bg: #82071e;
|
|
187
|
+
--color-prettylights-syntax-carriage-return-text: #f6f8fa;
|
|
188
|
+
--color-prettylights-syntax-carriage-return-bg: #cf222e;
|
|
189
|
+
--color-prettylights-syntax-string-regexp: #116329;
|
|
190
|
+
--color-prettylights-syntax-markup-list: #3b2300;
|
|
191
|
+
--color-prettylights-syntax-markup-heading: #0550ae;
|
|
192
|
+
--color-prettylights-syntax-markup-italic: #1f2328;
|
|
193
|
+
--color-prettylights-syntax-markup-bold: #1f2328;
|
|
194
|
+
--color-prettylights-syntax-markup-deleted-text: #82071e;
|
|
195
|
+
--color-prettylights-syntax-markup-deleted-bg: #ffebe9;
|
|
196
|
+
--color-prettylights-syntax-markup-inserted-text: #116329;
|
|
197
|
+
--color-prettylights-syntax-markup-inserted-bg: #dafbe1;
|
|
198
|
+
--color-prettylights-syntax-markup-changed-text: #953800;
|
|
199
|
+
--color-prettylights-syntax-markup-changed-bg: #ffd8b5;
|
|
200
|
+
--color-prettylights-syntax-markup-ignored-text: #d1d9e0;
|
|
201
|
+
--color-prettylights-syntax-markup-ignored-bg: #0550ae;
|
|
202
|
+
--color-prettylights-syntax-meta-diff-range: #8250df;
|
|
203
|
+
--color-prettylights-syntax-sublimelinter-gutter-mark: #818b98;
|
|
204
|
+
}
|
|
205
|
+
`, i = t`
|
|
206
|
+
.markdown-body {
|
|
207
|
+
/* dark */
|
|
208
|
+
color-scheme: dark;
|
|
209
|
+
--focus-outlineColor: #1f6feb;
|
|
210
|
+
--fgColor-default: #f0f6fc;
|
|
211
|
+
--fgColor-muted: #9198a1;
|
|
212
|
+
--fgColor-accent: #4493f8;
|
|
213
|
+
--fgColor-success: #3fb950;
|
|
214
|
+
--fgColor-attention: #d29922;
|
|
215
|
+
--fgColor-danger: #f85149;
|
|
216
|
+
--fgColor-done: #ab7df8;
|
|
217
|
+
--bgColor-default: transparent;
|
|
218
|
+
--bgColor-muted: #151b23;
|
|
219
|
+
--bgColor-neutral-muted: #656c7633;
|
|
220
|
+
--bgColor-attention-muted: #bb800926;
|
|
221
|
+
--borderColor-default: #3d444d;
|
|
222
|
+
--borderColor-muted: #3d444db3;
|
|
223
|
+
--borderColor-neutral-muted: #3d444db3;
|
|
224
|
+
--borderColor-accent-emphasis: #1f6feb;
|
|
225
|
+
--borderColor-success-emphasis: #238636;
|
|
226
|
+
--borderColor-attention-emphasis: #9e6a03;
|
|
227
|
+
--borderColor-danger-emphasis: #da3633;
|
|
228
|
+
--borderColor-done-emphasis: #8957e5;
|
|
229
|
+
--color-prettylights-syntax-comment: #9198a1;
|
|
230
|
+
--color-prettylights-syntax-constant: #79c0ff;
|
|
231
|
+
--color-prettylights-syntax-constant-other-reference-link: #a5d6ff;
|
|
232
|
+
--color-prettylights-syntax-entity: #d2a8ff;
|
|
233
|
+
--color-prettylights-syntax-storage-modifier-import: #f0f6fc;
|
|
234
|
+
--color-prettylights-syntax-entity-tag: #7ee787;
|
|
235
|
+
--color-prettylights-syntax-keyword: #ff7b72;
|
|
236
|
+
--color-prettylights-syntax-string: #a5d6ff;
|
|
237
|
+
--color-prettylights-syntax-variable: #ffa657;
|
|
238
|
+
--color-prettylights-syntax-brackethighlighter-unmatched: #f85149;
|
|
239
|
+
--color-prettylights-syntax-brackethighlighter-angle: #9198a1;
|
|
240
|
+
--color-prettylights-syntax-invalid-illegal-text: #f0f6fc;
|
|
241
|
+
--color-prettylights-syntax-invalid-illegal-bg: #8e1519;
|
|
242
|
+
--color-prettylights-syntax-carriage-return-text: #f0f6fc;
|
|
243
|
+
--color-prettylights-syntax-carriage-return-bg: #b62324;
|
|
244
|
+
--color-prettylights-syntax-string-regexp: #7ee787;
|
|
245
|
+
--color-prettylights-syntax-markup-list: #f2cc60;
|
|
246
|
+
--color-prettylights-syntax-markup-heading: #1f6feb;
|
|
247
|
+
--color-prettylights-syntax-markup-italic: #f0f6fc;
|
|
248
|
+
--color-prettylights-syntax-markup-bold: #f0f6fc;
|
|
249
|
+
--color-prettylights-syntax-markup-deleted-text: #ffdcd7;
|
|
250
|
+
--color-prettylights-syntax-markup-deleted-bg: #67060c;
|
|
251
|
+
--color-prettylights-syntax-markup-inserted-text: #aff5b4;
|
|
252
|
+
--color-prettylights-syntax-markup-inserted-bg: #033a16;
|
|
253
|
+
--color-prettylights-syntax-markup-changed-text: #ffdfb6;
|
|
254
|
+
--color-prettylights-syntax-markup-changed-bg: #5a1e02;
|
|
255
|
+
--color-prettylights-syntax-markup-ignored-text: #f0f6fc;
|
|
256
|
+
--color-prettylights-syntax-markup-ignored-bg: #1158c7;
|
|
257
|
+
--color-prettylights-syntax-meta-diff-range: #d2a8ff;
|
|
258
|
+
--color-prettylights-syntax-sublimelinter-gutter-mark: #3d444d;
|
|
259
|
+
}
|
|
260
|
+
`;
|
|
261
|
+
export {
|
|
262
|
+
i as githubMarkdownDarkStyle,
|
|
263
|
+
s as githubMarkdownLightStyle,
|
|
264
|
+
a as markdownEditorDarkStyle,
|
|
265
|
+
l as markdownEditorStyle,
|
|
266
|
+
n as markdownStyle
|
|
267
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./index.css";
|
|
2
|
+
const n = (e) => {
|
|
3
|
+
var t, r;
|
|
4
|
+
return e === "dark" ? !0 : e === "light" ? !1 : (t = document.documentElement.getAttribute("style")) != null && t.includes("color-scheme: dark;") ? !0 : (r = document.documentElement.getAttribute("style")) != null && r.includes("color-scheme: light;") ? !1 : window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
n as isDarkScheme
|
|
8
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import "./index.css";
|
|
2
|
+
import o from "i18next";
|
|
3
|
+
import { default as s } from "i18next";
|
|
4
|
+
import { initReactI18next as e } from "react-i18next";
|
|
5
|
+
import t from "./locales/zh-CN.js";
|
|
6
|
+
import r from "./locales/en-US.js";
|
|
7
|
+
const i = "common";
|
|
8
|
+
o.use(e).init({
|
|
9
|
+
resources: {
|
|
10
|
+
"zh-CN": t,
|
|
11
|
+
"en-US": r
|
|
12
|
+
},
|
|
13
|
+
lng: "zh-CN",
|
|
14
|
+
fallbackLng: "zh-CN",
|
|
15
|
+
defaultNS: i,
|
|
16
|
+
interpolation: {
|
|
17
|
+
escapeValue: !1
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
export {
|
|
21
|
+
s as default,
|
|
22
|
+
i as defaultNS
|
|
23
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import "./index.css";
|
|
2
|
+
const i = {
|
|
3
|
+
common: {
|
|
4
|
+
ok: "OK",
|
|
5
|
+
cancel: "Cancel",
|
|
6
|
+
confirm: "Confirm",
|
|
7
|
+
loading: "Loading...",
|
|
8
|
+
noData: "No Data",
|
|
9
|
+
edit: "Edit",
|
|
10
|
+
delete: "Delete",
|
|
11
|
+
save: "Save"
|
|
12
|
+
},
|
|
13
|
+
desktop: {
|
|
14
|
+
maximize: "Maximize",
|
|
15
|
+
minimize: "Minimize",
|
|
16
|
+
restore: "Restore",
|
|
17
|
+
close: "Close"
|
|
18
|
+
},
|
|
19
|
+
editor: {
|
|
20
|
+
placeholder: "Please enter content...",
|
|
21
|
+
bold: "Bold",
|
|
22
|
+
italic: "Italic",
|
|
23
|
+
code: "Code",
|
|
24
|
+
link: "Link",
|
|
25
|
+
image: "Image"
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
i as default
|
|
30
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import "./index.css";
|
|
2
|
+
const o = {
|
|
3
|
+
common: {
|
|
4
|
+
ok: "确定",
|
|
5
|
+
cancel: "取消",
|
|
6
|
+
confirm: "确认",
|
|
7
|
+
loading: "加载中...",
|
|
8
|
+
noData: "暂无数据",
|
|
9
|
+
edit: "编辑",
|
|
10
|
+
delete: "删除",
|
|
11
|
+
save: "保存"
|
|
12
|
+
},
|
|
13
|
+
desktop: {
|
|
14
|
+
maximize: "最大化",
|
|
15
|
+
minimize: "最小化",
|
|
16
|
+
restore: "还原",
|
|
17
|
+
close: "关闭"
|
|
18
|
+
},
|
|
19
|
+
editor: {
|
|
20
|
+
placeholder: "请输入内容...",
|
|
21
|
+
bold: "加粗",
|
|
22
|
+
italic: "斜体",
|
|
23
|
+
code: "代码",
|
|
24
|
+
link: "链接",
|
|
25
|
+
image: "图片"
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
o as default
|
|
30
|
+
};
|