markloom 0.5.1 → 0.6.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.
- package/PACKAGES.md +26 -0
- package/README.md +20 -2
- package/collab.md +42 -7
- package/dist/ai/index.cjs +4 -4
- package/dist/ai/index.d.cts +5 -4
- package/dist/ai/index.d.ts +5 -4
- package/dist/ai/index.js +3 -3
- package/dist/ai/theme.css +66 -102
- package/dist/{chunk-VXM7Q6P5.cjs → chunk-ACFYBYZJ.cjs} +2604 -966
- package/dist/chunk-CGYCJORO.js +759 -0
- package/dist/chunk-EADZKEU4.cjs +498 -0
- package/dist/chunk-EJSFZHGT.js +24 -0
- package/dist/{chunk-YIFOGP2D.cjs → chunk-I5VK4U7J.cjs} +103 -60
- package/dist/{chunk-ZMTLSFLO.js → chunk-KYZJIOOL.js} +2138 -500
- package/dist/chunk-QEVME6ZU.cjs +759 -0
- package/dist/{chunk-MFYF2A6U.js → chunk-SNFF6X45.js} +51 -1
- package/dist/{chunk-FCH7LZFI.js → chunk-TB2OY3D4.js} +50 -7
- package/dist/{chunk-4TMHVNL6.cjs → chunk-TWD5T4YC.cjs} +155 -105
- package/dist/{chunk-JS527FDV.cjs → chunk-U3JZDFL4.cjs} +49 -9
- package/dist/{chunk-RLTHVQNQ.js → chunk-VSBIMMI7.js} +45 -5
- package/dist/chunk-YBAT343I.js +498 -0
- package/dist/chunk-ZKQSQSSM.cjs +24 -0
- package/dist/{client-ZRZj2nkq.d.cts → client-CLYq17SW.d.ts} +63 -7
- package/dist/{client-6KiH4kGK.d.ts → client-DAth8pPq.d.cts} +63 -7
- package/dist/collab/index.cjs +16 -4
- package/dist/collab/index.d.cts +19 -6
- package/dist/collab/index.d.ts +19 -6
- package/dist/collab/index.js +18 -6
- package/dist/{controller-BNuuUM3E.d.ts → controller-6AJ36G52.d.ts} +99 -7
- package/dist/{controller-DQITsFhy.d.cts → controller-BIOO_XKJ.d.cts} +99 -7
- package/dist/index.cjs +57 -7
- package/dist/index.d.cts +18 -5
- package/dist/index.d.ts +18 -5
- package/dist/index.js +54 -4
- package/dist/io/index.cjs +1413 -0
- package/dist/io/index.d.cts +33 -0
- package/dist/io/index.d.ts +33 -0
- package/dist/io/index.js +1413 -0
- package/dist/react/index.cjs +8 -8
- package/dist/react/index.d.cts +5 -4
- package/dist/react/index.d.ts +5 -4
- package/dist/react/index.js +7 -7
- package/dist/{rebase-batch-8rL_aXEE.d.ts → rebase-batch-DlerAcFN.d.ts} +11 -9
- package/dist/{rebase-batch-bYnBJpRO.d.cts → rebase-batch-PjENQ742.d.cts} +11 -9
- package/dist/suggest-Bk4zLzuv.d.ts +120 -0
- package/dist/suggest-BkGGiPKA.d.cts +120 -0
- package/dist/types-COUweEav.d.cts +30 -0
- package/dist/types-COUweEav.d.ts +30 -0
- package/dist/versions-9mG1epfB.d.cts +51 -0
- package/dist/versions-Bubyo4pt.d.ts +51 -0
- package/dist/view/index.cjs +56 -12
- package/dist/view/index.d.cts +203 -11
- package/dist/view/index.d.ts +203 -11
- package/dist/view/index.js +52 -8
- package/dist/view/theme.css +1829 -1587
- package/io.md +38 -0
- package/package.json +21 -5
- package/dist/chunk-4JSJAHTB.js +0 -255
- package/dist/chunk-ALZ3A5CS.cjs +0 -255
- package/dist/chunk-GQ2HHRGI.cjs +0 -16
- package/dist/chunk-LA5SBCGQ.js +0 -16
- package/dist/chunk-LEYAQNJA.js +0 -220
- package/dist/chunk-YXQDCW4Y.cjs +0 -220
- package/dist/comments-DlExS6f-.d.cts +0 -43
- package/dist/comments-PhnR7Gkn.d.ts +0 -43
- package/dist/step-BrvHIK7O.d.cts +0 -65
- package/dist/step-BrvHIK7O.d.ts +0 -65
package/dist/view/index.d.ts
CHANGED
|
@@ -1,22 +1,95 @@
|
|
|
1
|
-
import { N as NodeView, l as Extension } from '../controller-
|
|
2
|
-
export { e as AiWriteMode, f as AiWriteSession, m as AtomSelectCtx, B as BlockInputRule, n as BlockKind, o as BlockRenderCtx, p as BlockRenderer, C as CALLOUT_VARIANTS, q as CalloutVariant, D as DecorationFactory, r as DecorationHost, k as Editor, E as EditorOptions, I as InputResult, t as InputRuleCtx, u as Intent, K as KeymapCommand, v as KeymapCtx, w as KeymapResult, x as MentionCandidate, y as MentionHost, z as MentionMenu, F as MentionPopovers, G as MentionPopoversHost, H as MentionProfile, J as NodeViewCtx, P as PasteRule, R as RenderOpts, L as Resolved, S as SlashCommand, T as TextStylePatch, O as atomIsSelected, h as blockPlainText, Q as blockTransform, U as calloutVariantFromQuery, V as caret, W as chord, X as cycleCalloutVariant, Y as defaultBlockRenderers, Z as defaultBlockTag, _ as defaultMarkTag, $ as diffSpan, j as focusBlockId, a0 as indentItem, a1 as isAtom, a2 as isOpaque, a3 as leafText, a4 as lineBoundaryBack, a5 as lineBoundaryFwd, a6 as mapInput, a7 as mapPaste, a8 as mapPasteBlocks, a9 as marksAtCaret, aa as mergeTextStyleAttrs, ab as outdentItem, ac as
|
|
3
|
-
import { E as ElementNode,
|
|
4
|
-
import {
|
|
1
|
+
import { N as NodeView, l as Extension } from '../controller-6AJ36G52.js';
|
|
2
|
+
export { e as AiWriteMode, f as AiWriteSession, m as AtomSelectCtx, B as BlockInputRule, n as BlockKind, o as BlockRenderCtx, p as BlockRenderer, C as CALLOUT_VARIANTS, q as CalloutVariant, D as DecorationFactory, r as DecorationHost, k as Editor, E as EditorOptions, I as InputResult, t as InputRuleCtx, u as Intent, K as KeymapCommand, v as KeymapCtx, w as KeymapResult, x as MentionCandidate, y as MentionHost, z as MentionMenu, F as MentionPopovers, G as MentionPopoversHost, H as MentionProfile, J as NodeViewCtx, P as PasteRule, R as RenderOpts, L as Resolved, S as SlashCommand, T as TextStylePatch, O as atomIsSelected, h as blockPlainText, Q as blockTransform, U as calloutVariantFromQuery, V as caret, W as chord, X as cycleCalloutVariant, Y as defaultBlockRenderers, Z as defaultBlockTag, _ as defaultMarkTag, $ as diffSpan, j as focusBlockId, a0 as indentItem, a1 as isAtom, a2 as isOpaque, a3 as leafText, a4 as lineBoundaryBack, a5 as lineBoundaryFwd, a6 as mapInput, a7 as mapPaste, a8 as mapPasteBlocks, a9 as marksAtCaret, aa as mergeTextStyleAttrs, ab as outdentItem, ac as projectDoc, ad as renderCode, ae as renderDoc, af as renderEmbed, ag as renderHr, ah as renderImage, ai as renderTable, aj as renderToHtml, ak as resolve, al as safeCssValue, am as serializeBlock, an as serializeSelection, ao as setAlign, ap as setCalloutVariant, aq as setTextStyle, s as startAiWrite, ar as textStyleCss, as as toggleMark, at as toggleMarkList, au as twitchChannel, av as wordBoundaryBack, aw as wordBoundaryFwd, ax as wrapList, ay as youtubeId } from '../controller-6AJ36G52.js';
|
|
3
|
+
import { E as ElementNode, S as Selection, a as Position, N as Node } from '../types-COUweEav.js';
|
|
4
|
+
import { S as Step, a as DocVersion } from '../versions-Bubyo4pt.js';
|
|
5
|
+
import { C as CommentAuthor, c as CommentThread, b as CommentRenderState, T as TextMatch, e as SuggestAuthor, g as SuggestKind } from '../suggest-Bk4zLzuv.js';
|
|
5
6
|
import 'preact';
|
|
6
|
-
import '../client-
|
|
7
|
+
import '../client-CLYq17SW.js';
|
|
7
8
|
|
|
8
9
|
declare function shikiCodeView(highlight: (code: string, lang?: string) => string, langs?: () => string[]): NodeView;
|
|
9
10
|
|
|
10
11
|
declare function rootEl(root: HTMLElement): HTMLElement;
|
|
12
|
+
declare function docExtent(doc: ElementNode): Selection | null;
|
|
13
|
+
declare function selectionCovers(sel: Selection, extent: Selection): boolean;
|
|
11
14
|
declare function pointToDom(root: HTMLElement, doc: ElementNode, pos: Position): {
|
|
12
15
|
node: Node;
|
|
13
16
|
offset: number;
|
|
14
17
|
} | null;
|
|
15
18
|
declare function domToPoint(root: HTMLElement, doc: ElementNode, container: globalThis.Node, domOffset: number): Position | null;
|
|
16
19
|
declare function readSelection(root: HTMLElement, doc: ElementNode): Selection | null;
|
|
17
|
-
declare function writeSelection(root: HTMLElement, doc: ElementNode, selection: Selection
|
|
20
|
+
declare function writeSelection(root: HTMLElement, doc: ElementNode, selection: Selection, opts?: {
|
|
21
|
+
scroll?: boolean;
|
|
22
|
+
}): void;
|
|
18
23
|
declare function elementChildren(el: HTMLElement): HTMLElement[];
|
|
19
24
|
|
|
25
|
+
type PasteContext = {
|
|
26
|
+
inCode: boolean;
|
|
27
|
+
selCollapsed: boolean;
|
|
28
|
+
emptyTopPara: boolean;
|
|
29
|
+
};
|
|
30
|
+
type PasteClipboard = {
|
|
31
|
+
plain: string;
|
|
32
|
+
html: string;
|
|
33
|
+
imageFile: File | null;
|
|
34
|
+
};
|
|
35
|
+
/** 互斥 plan。resolve 产出其一,editor 只 apply。 */
|
|
36
|
+
type PastePlan = {
|
|
37
|
+
kind: 'noop';
|
|
38
|
+
} | {
|
|
39
|
+
kind: 'literal';
|
|
40
|
+
text: string;
|
|
41
|
+
} | {
|
|
42
|
+
kind: 'image-file';
|
|
43
|
+
file: File;
|
|
44
|
+
} | {
|
|
45
|
+
kind: 'image-url';
|
|
46
|
+
url: string;
|
|
47
|
+
} | {
|
|
48
|
+
kind: 'link-mark';
|
|
49
|
+
url: string;
|
|
50
|
+
} | {
|
|
51
|
+
kind: 'embed';
|
|
52
|
+
embedKind: 'youtube' | 'twitch';
|
|
53
|
+
url: string;
|
|
54
|
+
} | {
|
|
55
|
+
kind: 'blocks';
|
|
56
|
+
blocks: ElementNode[];
|
|
57
|
+
} | {
|
|
58
|
+
kind: 'markdown';
|
|
59
|
+
text: string;
|
|
60
|
+
};
|
|
61
|
+
/** 格式探测:命中返 Plan,未命中返 null(交给下一优先级)。 */
|
|
62
|
+
type PasteFormat = (ctx: PasteContext, clip: PasteClipboard) => PastePlan | null;
|
|
63
|
+
|
|
64
|
+
/** DataTransfer → 统一载荷。测试可直构造 PasteClipboard。 */
|
|
65
|
+
declare function clipboardFromDataTransfer(dt: DataTransfer | null | undefined): PasteClipboard;
|
|
66
|
+
/** 剪贴板第一个 image/* 文件。 */
|
|
67
|
+
declare function imageFileFrom(dt: DataTransfer | null | undefined): File | null;
|
|
68
|
+
|
|
69
|
+
declare const tryLiteral: PasteFormat;
|
|
70
|
+
/** 无 plain 时从 html 抽可见文本,不塞标签。 */
|
|
71
|
+
declare function htmlToPlainText(html: string): string;
|
|
72
|
+
|
|
73
|
+
declare const tryImageFile: PasteFormat;
|
|
74
|
+
declare const tryImageUrl: PasteFormat;
|
|
75
|
+
/**
|
|
76
|
+
* text/html 整体就是一个 <img>(无旁路文本)→ src。
|
|
77
|
+
* 带文字的富图文返 null,走 blocks。
|
|
78
|
+
*/
|
|
79
|
+
declare function soloImgSrcFromHtml(html: string | undefined): string | null;
|
|
80
|
+
|
|
81
|
+
declare const tryLinkMark: PasteFormat;
|
|
82
|
+
/** trim 后无空白,http(s):// 起头。词法扫。 */
|
|
83
|
+
declare function isBareUrl(s: string): boolean;
|
|
84
|
+
|
|
85
|
+
declare const tryEmbed: PasteFormat;
|
|
86
|
+
|
|
87
|
+
declare const tryHtmlBlocks: PasteFormat;
|
|
88
|
+
|
|
89
|
+
declare const tryMarkdown: PasteFormat;
|
|
90
|
+
|
|
91
|
+
declare function resolvePaste(ctx: PasteContext, clip: PasteClipboard): PastePlan;
|
|
92
|
+
|
|
20
93
|
declare function markloomKit(): Extension[];
|
|
21
94
|
|
|
22
95
|
declare const boldMark: Extension;
|
|
@@ -48,6 +121,8 @@ declare const invisibleCharacters: Extension;
|
|
|
48
121
|
|
|
49
122
|
declare const comments: Extension;
|
|
50
123
|
|
|
124
|
+
declare const suggest: Extension;
|
|
125
|
+
|
|
51
126
|
declare const textAlign: Extension;
|
|
52
127
|
|
|
53
128
|
interface CommentPanelHost {
|
|
@@ -106,16 +181,32 @@ interface AskInputOpts {
|
|
|
106
181
|
/** 返回错误文案则拦确认;返回 null 放行 */
|
|
107
182
|
validate?: (value: string) => string | null;
|
|
108
183
|
}
|
|
109
|
-
interface
|
|
184
|
+
interface AskPopoverOpts {
|
|
110
185
|
/** 锚点选区/按钮 rect;可传函数在定位时再取 */
|
|
111
186
|
anchor: DOMRect | (() => DOMRect);
|
|
112
187
|
placeholder?: string;
|
|
113
188
|
defaultValue?: string;
|
|
114
189
|
confirmLabel?: string;
|
|
190
|
+
ariaLabel?: string;
|
|
191
|
+
multiline?: boolean;
|
|
192
|
+
/** 等宽字体(公式) */
|
|
193
|
+
mono?: boolean;
|
|
194
|
+
/** 输入区宽(px),默认 280 / multiline 320 */
|
|
195
|
+
width?: number;
|
|
196
|
+
rows?: number;
|
|
197
|
+
validate?: (value: string) => string | null;
|
|
198
|
+
/** 确认前变换(链接补协议) */
|
|
199
|
+
normalize?: (value: string) => string;
|
|
200
|
+
/** 允许空串确认;默认 false */
|
|
201
|
+
allowEmpty?: boolean;
|
|
115
202
|
}
|
|
203
|
+
/** @deprecated 用 AskPopoverOpts;保留别名 */
|
|
204
|
+
type AskLinkPopoverOpts = Pick<AskPopoverOpts, 'anchor' | 'placeholder' | 'defaultValue' | 'confirmLabel'>;
|
|
116
205
|
declare function askInput(opts: AskInputOpts): Promise<string | null>;
|
|
117
206
|
/** 无协议时补 https://;空串原样返回 */
|
|
118
207
|
declare function normalizeLinkUrl(raw: string): string;
|
|
208
|
+
declare function askPopover(opts: AskPopoverOpts): Promise<string | null>;
|
|
209
|
+
/** 链接专用:补协议 + 单行 */
|
|
119
210
|
declare function askLinkPopover(opts: AskLinkPopoverOpts): Promise<string | null>;
|
|
120
211
|
/** 测试/销毁:关掉当前弹层 */
|
|
121
212
|
declare function closeAskInput(): void;
|
|
@@ -135,23 +226,124 @@ interface TocPanelHost {
|
|
|
135
226
|
}
|
|
136
227
|
declare class TocPanel {
|
|
137
228
|
private host;
|
|
229
|
+
private shell;
|
|
138
230
|
private rail;
|
|
139
231
|
private open;
|
|
140
232
|
private activeId;
|
|
141
233
|
private entries;
|
|
142
234
|
private scrollRoot;
|
|
235
|
+
private parentEl;
|
|
236
|
+
private fill;
|
|
237
|
+
private padEl;
|
|
238
|
+
/** 判定线:滚动容器顶 + 偏移;jump / sync 共用 */
|
|
239
|
+
private markOffset;
|
|
143
240
|
constructor(host: TocPanelHost);
|
|
144
241
|
destroy(): void;
|
|
145
242
|
setOpen(open: boolean): void;
|
|
146
|
-
private setPadOpen;
|
|
147
243
|
private onRedraw;
|
|
148
|
-
private refresh;
|
|
149
244
|
private onScroll;
|
|
150
|
-
|
|
245
|
+
private onResize;
|
|
246
|
+
private refresh;
|
|
247
|
+
/** 留白挂在滚动容器上(在全部子节点之后),避免夹在正文与页脚/prev-next 之间 */
|
|
248
|
+
private padTarget;
|
|
249
|
+
/**
|
|
250
|
+
* 文末可滚空间:让最后一个标题也能对齐顶线。
|
|
251
|
+
* 有了它,慢滚 / 点末项都走同一套「越过顶线」规则,无需触底特判。
|
|
252
|
+
*/
|
|
253
|
+
private ensureEndScrollRoom;
|
|
254
|
+
private clearEndScrollRoom;
|
|
151
255
|
private syncActive;
|
|
152
256
|
private headingEl;
|
|
153
257
|
private jump;
|
|
258
|
+
/**
|
|
259
|
+
* 长目录时 TOC 自身是滚轴:正文 scroll-spy 换了 active,
|
|
260
|
+
* 若该项在目录视口外则只滚 TOC 容器,不带动正文。
|
|
261
|
+
*/
|
|
262
|
+
private revealActiveInRail;
|
|
263
|
+
private paint;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
type SearchBarHost = {
|
|
267
|
+
root: HTMLElement;
|
|
268
|
+
doc: () => ElementNode;
|
|
269
|
+
dispatch: (steps: Step[], selectionAfter?: Selection) => void;
|
|
270
|
+
readonly: () => boolean;
|
|
271
|
+
focusMatch: (m: TextMatch) => void;
|
|
272
|
+
};
|
|
273
|
+
declare class SearchBar {
|
|
274
|
+
private host;
|
|
275
|
+
private el;
|
|
276
|
+
private open_;
|
|
277
|
+
private q;
|
|
278
|
+
private r;
|
|
279
|
+
private caseSensitive;
|
|
280
|
+
private hits;
|
|
281
|
+
private idx;
|
|
282
|
+
constructor(host: SearchBarHost);
|
|
283
|
+
open(): void;
|
|
284
|
+
close(): void;
|
|
285
|
+
get isOpen(): boolean;
|
|
286
|
+
destroy(): void;
|
|
287
|
+
rescan(): void;
|
|
288
|
+
private refresh;
|
|
289
|
+
private go;
|
|
290
|
+
private doReplaceOne;
|
|
291
|
+
private doReplaceAll;
|
|
292
|
+
private paint;
|
|
293
|
+
private onBarKey;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
type VersionsPanelHost = {
|
|
297
|
+
root: HTMLElement;
|
|
298
|
+
doc: () => ElementNode;
|
|
299
|
+
list: () => DocVersion[];
|
|
300
|
+
save: (name?: string) => DocVersion;
|
|
301
|
+
restore: (id: string) => boolean;
|
|
302
|
+
remove: (id: string) => boolean;
|
|
303
|
+
readonly: () => boolean;
|
|
304
|
+
};
|
|
305
|
+
declare class VersionsPanel {
|
|
306
|
+
private host;
|
|
307
|
+
private el;
|
|
308
|
+
private open;
|
|
309
|
+
private onRedraw;
|
|
310
|
+
constructor(host: VersionsPanelHost);
|
|
311
|
+
destroy(): void;
|
|
312
|
+
show(): void;
|
|
313
|
+
hide(): void;
|
|
314
|
+
toggle(): void;
|
|
315
|
+
private onKey;
|
|
316
|
+
private paint;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
type SuggestBarHost = {
|
|
320
|
+
root: HTMLElement;
|
|
321
|
+
doc: () => ElementNode;
|
|
322
|
+
dispatch: (steps: Step[], selectionAfter?: Selection) => void;
|
|
323
|
+
markSel: () => Selection | null;
|
|
324
|
+
author: () => SuggestAuthor;
|
|
325
|
+
newId: () => string;
|
|
326
|
+
readonly: () => boolean;
|
|
327
|
+
tracking: () => boolean;
|
|
328
|
+
setTracking: (on: boolean) => void;
|
|
329
|
+
};
|
|
330
|
+
declare class SuggestBar {
|
|
331
|
+
private host;
|
|
332
|
+
private el;
|
|
333
|
+
private open;
|
|
334
|
+
private onRedraw;
|
|
335
|
+
constructor(host: SuggestBarHost);
|
|
336
|
+
destroy(): void;
|
|
337
|
+
show(): void;
|
|
338
|
+
hide(): void;
|
|
339
|
+
toggle(): void;
|
|
340
|
+
rescan(): void;
|
|
341
|
+
/** 选区标建议(insert|delete) */
|
|
342
|
+
markSelection(kind: SuggestKind): boolean;
|
|
343
|
+
accept(id: string): void;
|
|
344
|
+
reject(id: string): void;
|
|
345
|
+
private onKey;
|
|
154
346
|
private paint;
|
|
155
347
|
}
|
|
156
348
|
|
|
157
|
-
export { type AskInputOpts, type AskLinkPopoverOpts, CommentPanel, type CommentPanelHost, Extension, NodeView, TocPanel, type TocPanelHost, askInput, askLinkPopover, blockExtensions, boldMark, bubbleMenu, closeAskInput, codeBlock, codeControls, codeMark, comments, decorationExtensions, domToPoint, dragHandle, elementChildren, embedBlock, emoji, highlightMark, history, hrBlock, imageBlock, inputRules, invisibleCharacters, italicMark, linkMark, markExtensions, markloomKit, mentionMenu, normalizeLinkUrl, pointToDom, readSelection, rootEl, shikiCodeView, slashMenu, strikeMark, subscriptMark, superscriptMark, tableBlock, textAlign, textStyleMark, typography, underlineMark, writeSelection };
|
|
349
|
+
export { type AskInputOpts, type AskLinkPopoverOpts, type AskPopoverOpts, CommentPanel, type CommentPanelHost, Extension, NodeView, type PasteClipboard, type PasteContext, type PasteFormat, type PastePlan, SearchBar, type SearchBarHost, SuggestBar, type SuggestBarHost, TocPanel, type TocPanelHost, VersionsPanel, type VersionsPanelHost, askInput, askLinkPopover, askPopover, blockExtensions, boldMark, bubbleMenu, clipboardFromDataTransfer, closeAskInput, codeBlock, codeControls, codeMark, comments, decorationExtensions, docExtent, domToPoint, dragHandle, elementChildren, embedBlock, emoji, highlightMark, history, hrBlock, htmlToPlainText, imageBlock, imageFileFrom, inputRules, invisibleCharacters, isBareUrl, italicMark, linkMark, markExtensions, markloomKit, mentionMenu, normalizeLinkUrl, pointToDom, readSelection, resolvePaste, rootEl, selectionCovers, shikiCodeView, slashMenu, soloImgSrcFromHtml, strikeMark, subscriptMark, suggest, superscriptMark, tableBlock, textAlign, textStyleMark, tryEmbed, tryHtmlBlocks, tryImageFile, tryImageUrl, tryLinkMark, tryLiteral, tryMarkdown, typography, underlineMark, writeSelection };
|
package/dist/view/index.js
CHANGED
|
@@ -4,9 +4,13 @@ import {
|
|
|
4
4
|
Editor,
|
|
5
5
|
MentionMenu,
|
|
6
6
|
MentionPopovers,
|
|
7
|
+
SearchBar,
|
|
8
|
+
SuggestBar,
|
|
7
9
|
TocPanel,
|
|
10
|
+
VersionsPanel,
|
|
8
11
|
askInput,
|
|
9
12
|
askLinkPopover,
|
|
13
|
+
askPopover,
|
|
10
14
|
atomIsSelected,
|
|
11
15
|
blockExtensions,
|
|
12
16
|
blockTransform,
|
|
@@ -15,6 +19,7 @@ import {
|
|
|
15
19
|
calloutVariantFromQuery,
|
|
16
20
|
caret,
|
|
17
21
|
chord,
|
|
22
|
+
clipboardFromDataTransfer,
|
|
18
23
|
closeAskInput,
|
|
19
24
|
codeBlock,
|
|
20
25
|
codeControls,
|
|
@@ -30,10 +35,13 @@ import {
|
|
|
30
35
|
highlightMark,
|
|
31
36
|
history,
|
|
32
37
|
hrBlock,
|
|
38
|
+
htmlToPlainText,
|
|
33
39
|
imageBlock,
|
|
40
|
+
imageFileFrom,
|
|
34
41
|
indentItem,
|
|
35
42
|
inputRules,
|
|
36
43
|
isAtom,
|
|
44
|
+
isBareUrl,
|
|
37
45
|
isOpaque,
|
|
38
46
|
italicMark,
|
|
39
47
|
leafText,
|
|
@@ -50,6 +58,7 @@ import {
|
|
|
50
58
|
mergeTextStyleAttrs,
|
|
51
59
|
normalizeLinkUrl,
|
|
52
60
|
outdentItem,
|
|
61
|
+
projectDoc,
|
|
53
62
|
renderCode,
|
|
54
63
|
renderDoc,
|
|
55
64
|
renderEmbed,
|
|
@@ -58,14 +67,18 @@ import {
|
|
|
58
67
|
renderTable,
|
|
59
68
|
renderToHtml,
|
|
60
69
|
resolve,
|
|
70
|
+
resolvePaste,
|
|
61
71
|
safeCssValue,
|
|
72
|
+
serializeBlock,
|
|
62
73
|
serializeSelection,
|
|
63
74
|
setAlign,
|
|
64
75
|
setCalloutVariant,
|
|
65
76
|
setTextStyle,
|
|
66
77
|
slashMenu,
|
|
78
|
+
soloImgSrcFromHtml,
|
|
67
79
|
strikeMark,
|
|
68
80
|
subscriptMark,
|
|
81
|
+
suggest,
|
|
69
82
|
superscriptMark,
|
|
70
83
|
tableBlock,
|
|
71
84
|
textAlign,
|
|
@@ -73,29 +86,38 @@ import {
|
|
|
73
86
|
textStyleMark,
|
|
74
87
|
toggleMark,
|
|
75
88
|
toggleMarkList,
|
|
89
|
+
tryEmbed,
|
|
90
|
+
tryHtmlBlocks,
|
|
91
|
+
tryImageFile,
|
|
92
|
+
tryImageUrl,
|
|
93
|
+
tryLinkMark,
|
|
94
|
+
tryLiteral,
|
|
95
|
+
tryMarkdown,
|
|
76
96
|
twitchChannel,
|
|
77
97
|
underlineMark,
|
|
78
98
|
wordBoundaryBack,
|
|
79
99
|
wordBoundaryFwd,
|
|
80
100
|
wrapList,
|
|
81
101
|
youtubeId
|
|
82
|
-
} from "../chunk-
|
|
83
|
-
import "../chunk-
|
|
102
|
+
} from "../chunk-KYZJIOOL.js";
|
|
103
|
+
import "../chunk-CGYCJORO.js";
|
|
84
104
|
import {
|
|
85
105
|
blockPlainText,
|
|
106
|
+
docExtent,
|
|
86
107
|
domToPoint,
|
|
87
108
|
elementChildren,
|
|
88
109
|
focusBlockId,
|
|
89
110
|
pointToDom,
|
|
90
111
|
readSelection,
|
|
91
112
|
rootEl,
|
|
113
|
+
selectionCovers,
|
|
92
114
|
startAiWrite,
|
|
93
115
|
writeSelection
|
|
94
|
-
} from "../chunk-
|
|
95
|
-
import "../chunk-
|
|
96
|
-
import "../chunk-
|
|
97
|
-
import "../chunk-
|
|
98
|
-
import "../chunk-
|
|
116
|
+
} from "../chunk-TB2OY3D4.js";
|
|
117
|
+
import "../chunk-SNFF6X45.js";
|
|
118
|
+
import "../chunk-YBAT343I.js";
|
|
119
|
+
import "../chunk-VSBIMMI7.js";
|
|
120
|
+
import "../chunk-EJSFZHGT.js";
|
|
99
121
|
|
|
100
122
|
// src/view/shiki-code-view.ts
|
|
101
123
|
import { h } from "preact";
|
|
@@ -112,7 +134,7 @@ function shikiCodeView(highlight, langs) {
|
|
|
112
134
|
"dangerouslySetInnerHTML": { __html: anchorEmptyLines(highlight(ctx.text, lang)) }
|
|
113
135
|
});
|
|
114
136
|
const copy = h("button", { "key": "copy", "data-copy": "", "type": "button", "contentEditable": "false", "tabIndex": -1, "aria-label": "\u590D\u5236\u4EE3\u7801" });
|
|
115
|
-
const langBtn = h("button", { "key": "lang", "data-code-lang": "", "type": "button", "contentEditable": "false", "tabIndex": -1 }, lang || "\u7EAF\u6587\u672C");
|
|
137
|
+
const langBtn = ctx.editable === false ? null : h("button", { "key": "lang", "data-code-lang": "", "type": "button", "contentEditable": "false", "tabIndex": -1 }, lang || "\u7EAF\u6587\u672C");
|
|
116
138
|
return h("div", { "key": ctx.key, "data-block-id": ctx.node.id ?? "", "data-code-block": "" }, [langBtn, copy, leaf]);
|
|
117
139
|
}
|
|
118
140
|
};
|
|
@@ -279,9 +301,13 @@ export {
|
|
|
279
301
|
Editor,
|
|
280
302
|
MentionMenu,
|
|
281
303
|
MentionPopovers,
|
|
304
|
+
SearchBar,
|
|
305
|
+
SuggestBar,
|
|
282
306
|
TocPanel,
|
|
307
|
+
VersionsPanel,
|
|
283
308
|
askInput,
|
|
284
309
|
askLinkPopover,
|
|
310
|
+
askPopover,
|
|
285
311
|
atomIsSelected,
|
|
286
312
|
blockExtensions,
|
|
287
313
|
blockPlainText,
|
|
@@ -291,6 +317,7 @@ export {
|
|
|
291
317
|
calloutVariantFromQuery,
|
|
292
318
|
caret,
|
|
293
319
|
chord,
|
|
320
|
+
clipboardFromDataTransfer,
|
|
294
321
|
closeAskInput,
|
|
295
322
|
codeBlock,
|
|
296
323
|
codeControls,
|
|
@@ -302,6 +329,7 @@ export {
|
|
|
302
329
|
defaultBlockTag,
|
|
303
330
|
defaultMarkTag,
|
|
304
331
|
diffSpan,
|
|
332
|
+
docExtent,
|
|
305
333
|
domToPoint,
|
|
306
334
|
dragHandle,
|
|
307
335
|
elementChildren,
|
|
@@ -311,11 +339,14 @@ export {
|
|
|
311
339
|
highlightMark,
|
|
312
340
|
history,
|
|
313
341
|
hrBlock,
|
|
342
|
+
htmlToPlainText,
|
|
314
343
|
imageBlock,
|
|
344
|
+
imageFileFrom,
|
|
315
345
|
indentItem,
|
|
316
346
|
inputRules,
|
|
317
347
|
invisibleCharacters,
|
|
318
348
|
isAtom,
|
|
349
|
+
isBareUrl,
|
|
319
350
|
isOpaque,
|
|
320
351
|
italicMark,
|
|
321
352
|
leafText,
|
|
@@ -333,6 +364,7 @@ export {
|
|
|
333
364
|
normalizeLinkUrl,
|
|
334
365
|
outdentItem,
|
|
335
366
|
pointToDom,
|
|
367
|
+
projectDoc,
|
|
336
368
|
readSelection,
|
|
337
369
|
renderCode,
|
|
338
370
|
renderDoc,
|
|
@@ -342,17 +374,22 @@ export {
|
|
|
342
374
|
renderTable,
|
|
343
375
|
renderToHtml,
|
|
344
376
|
resolve,
|
|
377
|
+
resolvePaste,
|
|
345
378
|
rootEl,
|
|
346
379
|
safeCssValue,
|
|
380
|
+
selectionCovers,
|
|
381
|
+
serializeBlock,
|
|
347
382
|
serializeSelection,
|
|
348
383
|
setAlign,
|
|
349
384
|
setCalloutVariant,
|
|
350
385
|
setTextStyle,
|
|
351
386
|
shikiCodeView,
|
|
352
387
|
slashMenu,
|
|
388
|
+
soloImgSrcFromHtml,
|
|
353
389
|
startAiWrite,
|
|
354
390
|
strikeMark,
|
|
355
391
|
subscriptMark,
|
|
392
|
+
suggest,
|
|
356
393
|
superscriptMark,
|
|
357
394
|
tableBlock,
|
|
358
395
|
textAlign,
|
|
@@ -360,6 +397,13 @@ export {
|
|
|
360
397
|
textStyleMark,
|
|
361
398
|
toggleMark,
|
|
362
399
|
toggleMarkList,
|
|
400
|
+
tryEmbed,
|
|
401
|
+
tryHtmlBlocks,
|
|
402
|
+
tryImageFile,
|
|
403
|
+
tryImageUrl,
|
|
404
|
+
tryLinkMark,
|
|
405
|
+
tryLiteral,
|
|
406
|
+
tryMarkdown,
|
|
363
407
|
twitchChannel,
|
|
364
408
|
typography,
|
|
365
409
|
underlineMark,
|