@jvs-milkdown/crepe 1.2.0 → 1.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/lib/cjs/builder.js +55 -2
- package/lib/cjs/builder.js.map +1 -1
- package/lib/cjs/feature/block-edit/index.js +73 -5
- package/lib/cjs/feature/block-edit/index.js.map +1 -1
- package/lib/cjs/feature/code-mirror/index.js +65 -3
- package/lib/cjs/feature/code-mirror/index.js.map +1 -1
- package/lib/cjs/feature/cursor/index.js +55 -2
- package/lib/cjs/feature/cursor/index.js.map +1 -1
- package/lib/cjs/feature/image-block/index.js +76 -8
- package/lib/cjs/feature/image-block/index.js.map +1 -1
- package/lib/cjs/feature/latex/index.js +55 -2
- package/lib/cjs/feature/latex/index.js.map +1 -1
- package/lib/cjs/feature/link-tooltip/index.js +55 -2
- package/lib/cjs/feature/link-tooltip/index.js.map +1 -1
- package/lib/cjs/feature/list-item/index.js +55 -2
- package/lib/cjs/feature/list-item/index.js.map +1 -1
- package/lib/cjs/feature/placeholder/index.js +55 -2
- package/lib/cjs/feature/placeholder/index.js.map +1 -1
- package/lib/cjs/feature/table/index.js +55 -2
- package/lib/cjs/feature/table/index.js.map +1 -1
- package/lib/cjs/feature/toolbar/index.js +73 -5
- package/lib/cjs/feature/toolbar/index.js.map +1 -1
- package/lib/cjs/index.js +451 -30
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/builder.js +55 -2
- package/lib/esm/builder.js.map +1 -1
- package/lib/esm/feature/block-edit/index.js +73 -5
- package/lib/esm/feature/block-edit/index.js.map +1 -1
- package/lib/esm/feature/code-mirror/index.js +65 -3
- package/lib/esm/feature/code-mirror/index.js.map +1 -1
- package/lib/esm/feature/cursor/index.js +55 -2
- package/lib/esm/feature/cursor/index.js.map +1 -1
- package/lib/esm/feature/image-block/index.js +76 -8
- package/lib/esm/feature/image-block/index.js.map +1 -1
- package/lib/esm/feature/latex/index.js +55 -2
- package/lib/esm/feature/latex/index.js.map +1 -1
- package/lib/esm/feature/link-tooltip/index.js +55 -2
- package/lib/esm/feature/link-tooltip/index.js.map +1 -1
- package/lib/esm/feature/list-item/index.js +55 -2
- package/lib/esm/feature/list-item/index.js.map +1 -1
- package/lib/esm/feature/placeholder/index.js +55 -2
- package/lib/esm/feature/placeholder/index.js.map +1 -1
- package/lib/esm/feature/table/index.js +55 -2
- package/lib/esm/feature/table/index.js.map +1 -1
- package/lib/esm/feature/toolbar/index.js +73 -5
- package/lib/esm/feature/toolbar/index.js.map +1 -1
- package/lib/esm/index.js +452 -31
- package/lib/esm/index.js.map +1 -1
- package/lib/theme/common/code-mirror.css +13 -0
- package/lib/theme/common/image-block.css +321 -22
- package/lib/theme/common/reset.css +3 -0
- package/lib/theme/common/toolbar.css +27 -2
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/core/locale.ts +55 -0
- package/src/feature/block-edit/menu/config.ts +19 -3
- package/src/feature/code-mirror/index.ts +3 -0
- package/src/feature/fixed-toolbar/component.tsx +31 -2
- package/src/feature/fixed-toolbar/config.ts +18 -3
- package/src/feature/fixed-toolbar/document-header.tsx +8 -4
- package/src/feature/fixed-toolbar/index.ts +18 -1
- package/src/feature/fixed-toolbar/menu-bar.tsx +83 -2
- package/src/feature/fixed-toolbar/shortcut-help-modal.tsx +244 -0
- package/src/feature/fixed-toolbar/view-menu-state.ts +9 -0
- package/src/feature/image-block/index.ts +11 -1
- package/src/icons/border.ts +5 -0
- package/src/icons/close.ts +3 -0
- package/src/icons/crop.ts +6 -0
- package/src/icons/index.ts +5 -0
- package/src/icons/keyboard.ts +3 -0
- package/src/icons/word-wrap.ts +6 -0
- package/src/theme/common/code-mirror.css +13 -0
- package/src/theme/common/image-block.css +364 -23
- package/src/theme/common/reset.css +3 -0
- package/src/theme/common/toolbar.css +30 -2
|
@@ -17,6 +17,7 @@ var slash = require('@jvs-milkdown/kit/plugin/slash');
|
|
|
17
17
|
var imageBlock = require('@jvs-milkdown/kit/component/image-block');
|
|
18
18
|
var prose = require('@jvs-milkdown/kit/prose');
|
|
19
19
|
var commands = require('@jvs-milkdown/kit/prose/commands');
|
|
20
|
+
var schemaList = require('@jvs-milkdown/kit/prose/schema-list');
|
|
20
21
|
var katex = require('katex');
|
|
21
22
|
var linkTooltip = require('@jvs-milkdown/kit/component/link-tooltip');
|
|
22
23
|
var view = require('@jvs-milkdown/kit/prose/view');
|
|
@@ -45,12 +46,17 @@ const zhCN = {
|
|
|
45
46
|
"view.docBackground": "\u6587\u6863\u80CC\u666F\u8272",
|
|
46
47
|
"view.title": "\u663E\u793A\u6807\u9898",
|
|
47
48
|
"view.cover": "\u663E\u793A\u5C01\u9762",
|
|
49
|
+
"view.editorWidth": "\u5185\u5BB9\u5BBD\u5EA6",
|
|
50
|
+
"view.widthDefault": "\u9ED8\u8BA4",
|
|
51
|
+
"view.widthWide": "\u8F83\u5BBD",
|
|
52
|
+
"view.widthFull": "\u5168\u5BBD",
|
|
48
53
|
// code-mirror
|
|
49
54
|
"codeMirror.searchPlaceholder": "\u641C\u7D22\u8BED\u8A00",
|
|
50
55
|
"codeMirror.noResultText": "\u65E0\u7ED3\u679C",
|
|
51
56
|
"codeMirror.previewToggleOptionEdit": "\u7F16\u8F91",
|
|
52
57
|
"codeMirror.previewToggleOptionHide": "\u9690\u85CF",
|
|
53
58
|
"codeMirror.previewLabel": "\u9884\u89C8",
|
|
59
|
+
"codeMirror.wrapText": "\u81EA\u52A8\u6362\u884C",
|
|
54
60
|
// link-tooltip
|
|
55
61
|
"linkTooltip.pasteLink": "\u7C98\u8D34\u94FE\u63A5...",
|
|
56
62
|
// image-block
|
|
@@ -148,7 +154,29 @@ const zhCN = {
|
|
|
148
154
|
"latex.escToExit": "\u6309 ESC \u5B8C\u6210\u8F93\u5165",
|
|
149
155
|
"latex.helpDoc": "\u67E5\u770B\u5E2E\u52A9\u6587\u6863",
|
|
150
156
|
"latex.emptyPlaceholder": "\u6DFB\u52A0 LaTeX \u516C\u5F0F",
|
|
151
|
-
"latex.inputPlaceholder": "\u8BF7\u8F93\u5165\u516C\u5F0F"
|
|
157
|
+
"latex.inputPlaceholder": "\u8BF7\u8F93\u5165\u516C\u5F0F",
|
|
158
|
+
// shortcuts
|
|
159
|
+
"shortcuts.title": "\u952E\u76D8\u5FEB\u6377\u952E",
|
|
160
|
+
"shortcuts.formatting": "\u6587\u672C\u683C\u5F0F",
|
|
161
|
+
"shortcuts.bold": "\u52A0\u7C97",
|
|
162
|
+
"shortcuts.italic": "\u659C\u4F53",
|
|
163
|
+
"shortcuts.underline": "\u4E0B\u5212\u7EBF",
|
|
164
|
+
"shortcuts.strikethrough": "\u5220\u9664\u7EBF",
|
|
165
|
+
"shortcuts.inlineCode": "\u884C\u5185\u4EE3\u7801",
|
|
166
|
+
"shortcuts.highlight": "\u9AD8\u4EAE",
|
|
167
|
+
"shortcuts.paragraph": "\u6BB5\u843D",
|
|
168
|
+
"shortcuts.heading": "\u6807\u9898",
|
|
169
|
+
"shortcuts.block": "\u5757\u7EA7\u5143\u7D20",
|
|
170
|
+
"shortcuts.codeBlock": "\u4EE3\u7801\u5757",
|
|
171
|
+
"shortcuts.blockquote": "\u5F15\u7528",
|
|
172
|
+
"shortcuts.orderedList": "\u6709\u5E8F\u5217\u8868",
|
|
173
|
+
"shortcuts.bulletList": "\u65E0\u5E8F\u5217\u8868",
|
|
174
|
+
"shortcuts.indent": "\u589E\u52A0\u7F29\u8FDB",
|
|
175
|
+
"shortcuts.outdent": "\u51CF\u5C11\u7F29\u8FDB",
|
|
176
|
+
"shortcuts.hardBreak": "\u6362\u884C",
|
|
177
|
+
"shortcuts.history": "\u5386\u53F2\u8BB0\u5F55",
|
|
178
|
+
"shortcuts.undo": "\u64A4\u9500",
|
|
179
|
+
"shortcuts.redo": "\u91CD\u505A"
|
|
152
180
|
};
|
|
153
181
|
const enUS = {
|
|
154
182
|
"handle.add": "Add content",
|
|
@@ -169,11 +197,16 @@ const enUS = {
|
|
|
169
197
|
"view.docBackground": "Document Background",
|
|
170
198
|
"view.title": "Show Title",
|
|
171
199
|
"view.cover": "Show Cover",
|
|
200
|
+
"view.editorWidth": "Content Width",
|
|
201
|
+
"view.widthDefault": "Default",
|
|
202
|
+
"view.widthWide": "Wide",
|
|
203
|
+
"view.widthFull": "Full Width",
|
|
172
204
|
"codeMirror.searchPlaceholder": "Search language",
|
|
173
205
|
"codeMirror.noResultText": "No result",
|
|
174
206
|
"codeMirror.previewToggleOptionEdit": "Edit",
|
|
175
207
|
"codeMirror.previewToggleOptionHide": "Hide",
|
|
176
208
|
"codeMirror.previewLabel": "Preview",
|
|
209
|
+
"codeMirror.wrapText": "Wrap",
|
|
177
210
|
"linkTooltip.pasteLink": "Paste link...",
|
|
178
211
|
"imageBlock.inlineUploadButton": "Upload",
|
|
179
212
|
"imageBlock.inlineUploadPlaceholder": "or paste link",
|
|
@@ -263,7 +296,28 @@ const enUS = {
|
|
|
263
296
|
"latex.escToExit": "Press ESC to finish",
|
|
264
297
|
"latex.helpDoc": "Help Doc",
|
|
265
298
|
"latex.emptyPlaceholder": "Add LaTeX",
|
|
266
|
-
"latex.inputPlaceholder": "Please enter formula"
|
|
299
|
+
"latex.inputPlaceholder": "Please enter formula",
|
|
300
|
+
"shortcuts.title": "Keyboard Shortcuts",
|
|
301
|
+
"shortcuts.formatting": "Text Formatting",
|
|
302
|
+
"shortcuts.bold": "Bold",
|
|
303
|
+
"shortcuts.italic": "Italic",
|
|
304
|
+
"shortcuts.underline": "Underline",
|
|
305
|
+
"shortcuts.strikethrough": "Strikethrough",
|
|
306
|
+
"shortcuts.inlineCode": "Inline Code",
|
|
307
|
+
"shortcuts.highlight": "Highlight",
|
|
308
|
+
"shortcuts.paragraph": "Paragraph",
|
|
309
|
+
"shortcuts.heading": "Heading",
|
|
310
|
+
"shortcuts.block": "Block Elements",
|
|
311
|
+
"shortcuts.codeBlock": "Code Block",
|
|
312
|
+
"shortcuts.blockquote": "Blockquote",
|
|
313
|
+
"shortcuts.orderedList": "Ordered List",
|
|
314
|
+
"shortcuts.bulletList": "Bullet List",
|
|
315
|
+
"shortcuts.indent": "Indent",
|
|
316
|
+
"shortcuts.outdent": "Outdent",
|
|
317
|
+
"shortcuts.hardBreak": "Hard Break",
|
|
318
|
+
"shortcuts.history": "History",
|
|
319
|
+
"shortcuts.undo": "Undo",
|
|
320
|
+
"shortcuts.redo": "Redo"
|
|
267
321
|
};
|
|
268
322
|
const translationsCtx = ctx.createSlice(
|
|
269
323
|
{
|
|
@@ -1738,10 +1792,24 @@ function getGroups$1(filter, config, ctx) {
|
|
|
1738
1792
|
return;
|
|
1739
1793
|
}
|
|
1740
1794
|
convertHeadingToParagraphIfNeeded(ctx2);
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1795
|
+
const result = schemaList.wrapInList(bulletList)(view.state, (tr) => {
|
|
1796
|
+
tr.doc.nodesBetween(
|
|
1797
|
+
tr.mapping.map(from),
|
|
1798
|
+
tr.mapping.map(to),
|
|
1799
|
+
(node, pos) => {
|
|
1800
|
+
if (node.type === listItem) {
|
|
1801
|
+
tr.setNodeMarkup(pos, void 0, {
|
|
1802
|
+
...node.attrs,
|
|
1803
|
+
checked: false,
|
|
1804
|
+
listType: "bullet",
|
|
1805
|
+
label: "\u2022"
|
|
1806
|
+
});
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
);
|
|
1810
|
+
view.dispatch(tr);
|
|
1744
1811
|
});
|
|
1812
|
+
if (result) return;
|
|
1745
1813
|
}
|
|
1746
1814
|
});
|
|
1747
1815
|
}
|