@blocknote/core 0.48.1 → 0.50.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/dist/blocknote.cjs +1 -1
- package/dist/blocknote.js +3 -3
- package/dist/{blocks-BEvIOzln.cjs → blocks-BFnTypT-.cjs} +3 -3
- package/dist/blocks-BFnTypT-.cjs.map +1 -0
- package/dist/{blocks-DYl7UTS4.js → blocks-UU7EM-QM.js} +601 -570
- package/dist/blocks-UU7EM-QM.js.map +1 -0
- package/dist/blocks.cjs +1 -1
- package/dist/blocks.js +1 -1
- package/dist/comments.cjs +1 -1
- package/dist/comments.cjs.map +1 -1
- package/dist/comments.js +19 -16
- package/dist/comments.js.map +1 -1
- package/dist/{en-QsSI16s5.js → en-B9hMApn4.js} +4 -2
- package/dist/en-B9hMApn4.js.map +1 -0
- package/dist/{en-C4ykW581.cjs → en-Cj5r8sW_.cjs} +2 -2
- package/dist/en-Cj5r8sW_.cjs.map +1 -0
- package/dist/extensions-CYsFi5Is.cjs +2 -0
- package/dist/extensions-CYsFi5Is.cjs.map +1 -0
- package/dist/{extensions-3nf9PPhA.js → extensions-CkLT--Nc.js} +244 -250
- package/dist/extensions-CkLT--Nc.js.map +1 -0
- package/dist/extensions.cjs +1 -1
- package/dist/extensions.js +2 -2
- package/dist/locales.cjs +1 -1
- package/dist/locales.cjs.map +1 -1
- package/dist/locales.js +67 -23
- package/dist/locales.js.map +1 -1
- package/dist/src-DsJ6yzs9.cjs +5 -0
- package/dist/src-DsJ6yzs9.cjs.map +1 -0
- package/dist/{src-Hjv1f5lc.js → src-SVFpMAWE.js} +754 -366
- package/dist/src-SVFpMAWE.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/dist/yjs.cjs +1 -1
- package/dist/yjs.js +1 -1
- package/package.json +6 -8
- package/src/api/clipboard/toClipboard/copyExtension.ts +21 -16
- package/src/blocks/ListItem/NumberedListItem/IndexingPlugin.test.ts +14 -1
- package/src/blocks/Quote/block.ts +9 -0
- package/src/blocks/Table/TableExtension.ts +38 -9
- package/src/blocks/Table/block.ts +26 -0
- package/src/blocks/defaultBlocks.ts +34 -1
- package/src/comments/extension.ts +35 -11
- package/src/comments/threadstore/yjs/YjsThreadStore.test.ts +3 -2
- package/src/comments/threadstore/yjs/YjsThreadStore.ts +4 -4
- package/src/editor/Block.css +14 -18
- package/src/editor/BlockNoteEditor.ts +84 -5
- package/src/editor/editor.css +5 -0
- package/src/editor/managers/ExtensionManager/extensions.ts +8 -27
- package/src/editor/managers/StyleManager.ts +90 -10
- package/src/extensions/FormattingToolbar/FormattingToolbar.ts +23 -16
- package/src/extensions/LinkToolbar/LinkToolbar.ts +30 -75
- package/src/extensions/Placeholder/Placeholder.ts +2 -2
- package/src/extensions/SideMenu/SideMenu.ts +2 -2
- package/src/extensions/TableHandles/TableHandles.ts +2 -0
- package/src/extensions/tiptap-extensions/Link/helpers/autolink.ts +179 -0
- package/src/extensions/tiptap-extensions/Link/helpers/clickHandler.ts +82 -0
- package/src/extensions/tiptap-extensions/Link/helpers/linkDetector.ts +414 -0
- package/src/extensions/tiptap-extensions/Link/helpers/pasteHandler.ts +53 -0
- package/src/extensions/tiptap-extensions/Link/helpers/tlds.ts +7 -0
- package/src/extensions/tiptap-extensions/Link/helpers/whitespace.ts +13 -0
- package/src/extensions/tiptap-extensions/Link/index.ts +2 -0
- package/src/extensions/tiptap-extensions/Link/link.test.ts +941 -0
- package/src/extensions/tiptap-extensions/Link/link.ts +238 -0
- package/src/extensions/tiptap-extensions/UniqueID/UniqueID.ts +3 -5
- package/src/i18n/locales/ar.ts +3 -1
- package/src/i18n/locales/de.ts +3 -1
- package/src/i18n/locales/en.ts +3 -1
- package/src/i18n/locales/es.ts +3 -1
- package/src/i18n/locales/fa.ts +3 -1
- package/src/i18n/locales/fr.ts +3 -1
- package/src/i18n/locales/he.ts +3 -1
- package/src/i18n/locales/hr.ts +3 -1
- package/src/i18n/locales/is.ts +3 -1
- package/src/i18n/locales/it.ts +3 -1
- package/src/i18n/locales/ja.ts +3 -1
- package/src/i18n/locales/ko.ts +3 -1
- package/src/i18n/locales/nl.ts +3 -1
- package/src/i18n/locales/no.ts +3 -1
- package/src/i18n/locales/pl.ts +3 -1
- package/src/i18n/locales/pt.ts +3 -1
- package/src/i18n/locales/ru.ts +3 -1
- package/src/i18n/locales/sk.ts +3 -1
- package/src/i18n/locales/uk.ts +3 -1
- package/src/i18n/locales/uz.ts +3 -1
- package/src/i18n/locales/vi.ts +3 -1
- package/src/i18n/locales/zh-tw.ts +3 -1
- package/src/i18n/locales/zh.ts +3 -1
- package/src/schema/inlineContent/types.ts +1 -1
- package/types/src/comments/extension.d.ts +2 -1
- package/types/src/editor/BlockNoteEditor.d.ts +69 -3
- package/types/src/editor/managers/StyleManager.d.ts +22 -0
- package/types/src/extensions/LinkToolbar/LinkToolbar.d.ts +28 -7
- package/types/src/extensions/tiptap-extensions/Link/helpers/autolink.d.ts +13 -0
- package/types/src/extensions/tiptap-extensions/Link/helpers/clickHandler.d.ts +12 -0
- package/types/src/extensions/tiptap-extensions/Link/helpers/linkDetector.d.ts +32 -0
- package/types/src/extensions/tiptap-extensions/Link/helpers/pasteHandler.d.ts +12 -0
- package/types/src/extensions/tiptap-extensions/Link/helpers/tlds.d.ts +1 -0
- package/types/src/extensions/tiptap-extensions/Link/helpers/whitespace.d.ts +4 -0
- package/types/src/extensions/tiptap-extensions/Link/index.d.ts +2 -0
- package/types/src/extensions/tiptap-extensions/Link/link.d.ts +25 -0
- package/types/src/extensions/tiptap-extensions/Link/link.test.d.ts +1 -0
- package/types/src/i18n/locales/en.d.ts +2 -0
- package/types/src/i18n/locales/fa.d.ts +2 -0
- package/types/src/i18n/locales/sk.d.ts +2 -0
- package/types/src/schema/inlineContent/types.d.ts +1 -2
- package/dist/blocks-BEvIOzln.cjs.map +0 -1
- package/dist/blocks-DYl7UTS4.js.map +0 -1
- package/dist/en-C4ykW581.cjs.map +0 -1
- package/dist/en-QsSI16s5.js.map +0 -1
- package/dist/extensions-3nf9PPhA.js.map +0 -1
- package/dist/extensions-D9y6evn6.cjs +0 -2
- package/dist/extensions-D9y6evn6.cjs.map +0 -1
- package/dist/src-BKJH7Jla.cjs +0 -5
- package/dist/src-BKJH7Jla.cjs.map +0 -1
- package/dist/src-Hjv1f5lc.js.map +0 -1
package/src/i18n/locales/uz.ts
CHANGED
|
@@ -294,7 +294,7 @@ export const uz: Dictionary = {
|
|
|
294
294
|
text_title: "Matn",
|
|
295
295
|
background_title: "Fon",
|
|
296
296
|
colors: {
|
|
297
|
-
default: "
|
|
297
|
+
default: "Avtomatik",
|
|
298
298
|
gray: "Kulrang",
|
|
299
299
|
brown: "Jigarrang",
|
|
300
300
|
red: "Qizil",
|
|
@@ -417,9 +417,11 @@ export const uz: Dictionary = {
|
|
|
417
417
|
edited: "tahrirlangan",
|
|
418
418
|
save_button_text: "Saqlash",
|
|
419
419
|
cancel_button_text: "Bekor qilish",
|
|
420
|
+
deleted_reference_text: "Asl tarkib o‘chirildi",
|
|
420
421
|
actions: {
|
|
421
422
|
add_reaction: "Reaksiya qo‘shish",
|
|
422
423
|
resolve: "Hal qilish",
|
|
424
|
+
reopen: "Qayta ochish",
|
|
423
425
|
edit_comment: "Izohni tahrirlash",
|
|
424
426
|
delete_comment: "Izohni o‘chirish",
|
|
425
427
|
more_actions: "Boshqa amallar",
|
package/src/i18n/locales/vi.ts
CHANGED
|
@@ -228,7 +228,7 @@ export const vi: Dictionary = {
|
|
|
228
228
|
text_title: "Văn bản",
|
|
229
229
|
background_title: "Nền",
|
|
230
230
|
colors: {
|
|
231
|
-
default: "
|
|
231
|
+
default: "Tự động",
|
|
232
232
|
gray: "Xám",
|
|
233
233
|
brown: "Nâu",
|
|
234
234
|
red: "Đỏ",
|
|
@@ -383,9 +383,11 @@ export const vi: Dictionary = {
|
|
|
383
383
|
edited: "đã chỉnh sửa",
|
|
384
384
|
save_button_text: "Lưu",
|
|
385
385
|
cancel_button_text: "Hủy",
|
|
386
|
+
deleted_reference_text: "Nội dung gốc đã bị xóa",
|
|
386
387
|
actions: {
|
|
387
388
|
add_reaction: "Thêm phản ứng",
|
|
388
389
|
resolve: "Giải quyết",
|
|
390
|
+
reopen: "Mở lại",
|
|
389
391
|
edit_comment: "Chỉnh sửa bình luận",
|
|
390
392
|
delete_comment: "Xóa bình luận",
|
|
391
393
|
more_actions: "Thêm hành động",
|
|
@@ -270,7 +270,7 @@ export const zhTW: Dictionary = {
|
|
|
270
270
|
text_title: "文字",
|
|
271
271
|
background_title: "背景色",
|
|
272
272
|
colors: {
|
|
273
|
-
default: "
|
|
273
|
+
default: "自動",
|
|
274
274
|
gray: "灰色",
|
|
275
275
|
brown: "棕色",
|
|
276
276
|
red: "紅色",
|
|
@@ -425,9 +425,11 @@ export const zhTW: Dictionary = {
|
|
|
425
425
|
edited: "已編輯",
|
|
426
426
|
save_button_text: "儲存",
|
|
427
427
|
cancel_button_text: "取消",
|
|
428
|
+
deleted_reference_text: "原始內容已刪除",
|
|
428
429
|
actions: {
|
|
429
430
|
add_reaction: "新增回應",
|
|
430
431
|
resolve: "解決",
|
|
432
|
+
reopen: "重新開啟",
|
|
431
433
|
edit_comment: "編輯評論",
|
|
432
434
|
delete_comment: "刪除評論",
|
|
433
435
|
more_actions: "更多操作",
|
package/src/i18n/locales/zh.ts
CHANGED
|
@@ -270,7 +270,7 @@ export const zh: Dictionary = {
|
|
|
270
270
|
text_title: "文本",
|
|
271
271
|
background_title: "背景色",
|
|
272
272
|
colors: {
|
|
273
|
-
default: "
|
|
273
|
+
default: "自动",
|
|
274
274
|
gray: "灰色",
|
|
275
275
|
brown: "棕色",
|
|
276
276
|
red: "红色",
|
|
@@ -425,9 +425,11 @@ export const zh: Dictionary = {
|
|
|
425
425
|
edited: "已编辑",
|
|
426
426
|
save_button_text: "保存",
|
|
427
427
|
cancel_button_text: "取消",
|
|
428
|
+
deleted_reference_text: "原始内容已删除",
|
|
428
429
|
actions: {
|
|
429
430
|
add_reaction: "添加反应",
|
|
430
431
|
resolve: "解决",
|
|
432
|
+
reopen: "重新打开",
|
|
431
433
|
edit_comment: "编辑评论",
|
|
432
434
|
delete_comment: "删除评论",
|
|
433
435
|
more_actions: "更多操作",
|
|
@@ -145,7 +145,7 @@ export type InlineContent<
|
|
|
145
145
|
T extends StyleSchema,
|
|
146
146
|
> = InlineContentFromConfig<I[keyof I], T>;
|
|
147
147
|
|
|
148
|
-
type PartialInlineContentElement<
|
|
148
|
+
export type PartialInlineContentElement<
|
|
149
149
|
I extends InlineContentSchema,
|
|
150
150
|
T extends StyleSchema,
|
|
151
151
|
> = PartialInlineContentFromConfig<I[keyof I], T>;
|
|
@@ -50,6 +50,8 @@ export declare const CommentsExtension: (options: {
|
|
|
50
50
|
to: number;
|
|
51
51
|
}>;
|
|
52
52
|
}>;
|
|
53
|
+
readonly runsBefore: readonly ["link"];
|
|
54
|
+
readonly tiptapExtensions: readonly [import("@tiptap/core").Mark<any, any>];
|
|
53
55
|
readonly prosemirrorPlugins: readonly [Plugin<CommentsPluginState>];
|
|
54
56
|
readonly threadStore: ThreadStore;
|
|
55
57
|
readonly mount: () => () => void;
|
|
@@ -65,6 +67,5 @@ export declare const CommentsExtension: (options: {
|
|
|
65
67
|
}) => Promise<void>;
|
|
66
68
|
readonly userStore: UserStore<User>;
|
|
67
69
|
readonly commentEditorSchema: CustomBlockNoteSchema<any, any, any> | undefined;
|
|
68
|
-
readonly tiptapExtensions: readonly [import("@tiptap/core").Mark<any, any>];
|
|
69
70
|
}>;
|
|
70
71
|
export {};
|
|
@@ -76,6 +76,50 @@ export interface BlockNoteEditorOptions<BSchema extends BlockSchema, ISchema ext
|
|
|
76
76
|
* @remarks `PartialBlock[]`
|
|
77
77
|
*/
|
|
78
78
|
initialContent?: PartialBlock<NoInfer<BSchema>, NoInfer<ISchema>, NoInfer<SSchema>>[];
|
|
79
|
+
/**
|
|
80
|
+
* Options for configuring how links behave in the editor.
|
|
81
|
+
*/
|
|
82
|
+
links?: {
|
|
83
|
+
/**
|
|
84
|
+
* HTML attributes to add to rendered link elements.
|
|
85
|
+
*
|
|
86
|
+
* @default {}
|
|
87
|
+
* @example { class: "my-link-class", target: "_blank" }
|
|
88
|
+
*/
|
|
89
|
+
HTMLAttributes?: Record<string, any>;
|
|
90
|
+
/**
|
|
91
|
+
* Custom handler invoked when a link is clicked. If left `undefined`,
|
|
92
|
+
* links are opened in a new window on click. If provided, the default
|
|
93
|
+
* open-on-click behavior is disabled and this function is called instead.
|
|
94
|
+
*
|
|
95
|
+
* Return `false` to let ProseMirror continue handling the click event.
|
|
96
|
+
* Returning `true` or nothing (the default) marks the event as handled.
|
|
97
|
+
*/
|
|
98
|
+
onClick?: (event: MouseEvent, editor: BlockNoteEditor<any, any, any>) => boolean | void;
|
|
99
|
+
/**
|
|
100
|
+
* Callback that decides whether a given `href` is a valid link. Applied at
|
|
101
|
+
* every gate where a link enters the document: HTML import, HTML export,
|
|
102
|
+
* paste, and autolink. Useful for supporting additional URI schemes (e.g.
|
|
103
|
+
* `vscode:`, `myapp:`) or tightening the default allowlist.
|
|
104
|
+
*
|
|
105
|
+
* Defaults to `isAllowedUri`, which allows
|
|
106
|
+
* `http|https|ftp|ftps|mailto|tel|callto|sms|cid|xmpp`. Import
|
|
107
|
+
* `isAllowedUri` from `@blocknote/core` to layer on top of the default.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```ts
|
|
111
|
+
* import { isAllowedUri } from "@blocknote/core";
|
|
112
|
+
*
|
|
113
|
+
* BlockNoteEditor.create({
|
|
114
|
+
* links: {
|
|
115
|
+
* isValidLink: (href) =>
|
|
116
|
+
* isAllowedUri(href) || href.startsWith("myapp:"),
|
|
117
|
+
* },
|
|
118
|
+
* });
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
isValidLink?: (href: string) => boolean;
|
|
122
|
+
};
|
|
79
123
|
/**
|
|
80
124
|
* @deprecated, provide placeholders via dictionary instead
|
|
81
125
|
* @internal
|
|
@@ -381,7 +425,7 @@ export declare class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockS
|
|
|
381
425
|
*/
|
|
382
426
|
isWithinEditor: (element: Element) => boolean;
|
|
383
427
|
isFocused(): boolean;
|
|
384
|
-
|
|
428
|
+
headless: boolean;
|
|
385
429
|
/**
|
|
386
430
|
* Focus on the editor
|
|
387
431
|
*/
|
|
@@ -598,6 +642,28 @@ export declare class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockS
|
|
|
598
642
|
* @param text The text to display the link with.
|
|
599
643
|
*/
|
|
600
644
|
createLink(url: string, text?: string): void;
|
|
645
|
+
/**
|
|
646
|
+
* Find the link mark and its range at the given position.
|
|
647
|
+
* Returns undefined if there is no link at that position.
|
|
648
|
+
*/
|
|
649
|
+
getLinkMarkAtPos(pos: number): {
|
|
650
|
+
href: string;
|
|
651
|
+
from: number;
|
|
652
|
+
to: number;
|
|
653
|
+
text: string;
|
|
654
|
+
} | undefined;
|
|
655
|
+
/**
|
|
656
|
+
* Updates the link at the given position with a new URL and text.
|
|
657
|
+
* @param url The new link URL.
|
|
658
|
+
* @param text The new text to display.
|
|
659
|
+
* @param position The position inside the link to edit. Defaults to the current selection anchor.
|
|
660
|
+
*/
|
|
661
|
+
editLink(url: string, text: string, position?: number): void;
|
|
662
|
+
/**
|
|
663
|
+
* Removes the link at the given position, keeping the text.
|
|
664
|
+
* @param position The position inside the link to remove. Defaults to the current selection anchor.
|
|
665
|
+
*/
|
|
666
|
+
deleteLink(position?: number): void;
|
|
601
667
|
/**
|
|
602
668
|
* Checks if the block containing the text cursor can be nested.
|
|
603
669
|
*/
|
|
@@ -701,7 +767,7 @@ export declare class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockS
|
|
|
701
767
|
*/
|
|
702
768
|
onMount(callback: (ctx: {
|
|
703
769
|
editor: BlockNoteEditor<BSchema, ISchema, SSchema>;
|
|
704
|
-
}) => void):
|
|
770
|
+
}) => void): import("./managers/EventManager.js").Unsubscribe;
|
|
705
771
|
/**
|
|
706
772
|
* A callback function that runs when the editor has been unmounted.
|
|
707
773
|
*
|
|
@@ -712,7 +778,7 @@ export declare class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockS
|
|
|
712
778
|
*/
|
|
713
779
|
onUnmount(callback: (ctx: {
|
|
714
780
|
editor: BlockNoteEditor<BSchema, ISchema, SSchema>;
|
|
715
|
-
}) => void):
|
|
781
|
+
}) => void): import("./managers/EventManager.js").Unsubscribe;
|
|
716
782
|
/**
|
|
717
783
|
* Gets the bounding box of the current selection.
|
|
718
784
|
* @returns The bounding box of the current selection.
|
|
@@ -35,6 +35,16 @@ export declare class StyleManager<BSchema extends BlockSchema = DefaultBlockSche
|
|
|
35
35
|
* Gets the currently selected text.
|
|
36
36
|
*/
|
|
37
37
|
getSelectedText(): string;
|
|
38
|
+
/**
|
|
39
|
+
* Find the link mark and its range at the given position.
|
|
40
|
+
* Returns undefined if there is no link at that position.
|
|
41
|
+
*/
|
|
42
|
+
getLinkMarkAtPos(pos: number): {
|
|
43
|
+
href: string;
|
|
44
|
+
from: number;
|
|
45
|
+
to: number;
|
|
46
|
+
text: string;
|
|
47
|
+
} | undefined;
|
|
38
48
|
/**
|
|
39
49
|
* Gets the URL of the last link in the current selection, or `undefined` if there are no links in the selection.
|
|
40
50
|
*/
|
|
@@ -45,4 +55,16 @@ export declare class StyleManager<BSchema extends BlockSchema = DefaultBlockSche
|
|
|
45
55
|
* @param text The text to display the link with.
|
|
46
56
|
*/
|
|
47
57
|
createLink(url: string, text?: string): void;
|
|
58
|
+
/**
|
|
59
|
+
* Updates the link at the given position with a new URL and text.
|
|
60
|
+
* @param url The new link URL.
|
|
61
|
+
* @param text The new text to display.
|
|
62
|
+
* @param position The position inside the link to edit. Defaults to the current selection anchor.
|
|
63
|
+
*/
|
|
64
|
+
editLink(url: string, text: string, position?: number): void;
|
|
65
|
+
/**
|
|
66
|
+
* Removes the link at the given position, keeping the text.
|
|
67
|
+
* @param position The position inside the link to remove. Defaults to the current selection anchor.
|
|
68
|
+
*/
|
|
69
|
+
deleteLink(position?: number): void;
|
|
48
70
|
}
|
|
@@ -1,21 +1,42 @@
|
|
|
1
1
|
export declare const LinkToolbarExtension: (options?: any) => import("../../index.js").ExtensionFactoryInstance<{
|
|
2
2
|
readonly key: "linkToolbar";
|
|
3
3
|
readonly getLinkAtSelection: () => {
|
|
4
|
-
range:
|
|
5
|
-
|
|
4
|
+
range: {
|
|
5
|
+
from: number;
|
|
6
|
+
to: number;
|
|
7
|
+
};
|
|
8
|
+
mark: {
|
|
9
|
+
attrs: {
|
|
10
|
+
href: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
6
13
|
readonly text: string;
|
|
7
14
|
readonly position: DOMRect;
|
|
8
15
|
} | undefined;
|
|
9
16
|
readonly getLinkElementAtPos: (pos: number) => HTMLAnchorElement | null;
|
|
10
|
-
readonly getMarkAtPos: (pos: number,
|
|
11
|
-
range:
|
|
12
|
-
|
|
17
|
+
readonly getMarkAtPos: (pos: number, _markType: string) => {
|
|
18
|
+
range: {
|
|
19
|
+
from: number;
|
|
20
|
+
to: number;
|
|
21
|
+
};
|
|
22
|
+
mark: {
|
|
23
|
+
attrs: {
|
|
24
|
+
href: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
13
27
|
readonly text: string;
|
|
14
28
|
readonly position: DOMRect;
|
|
15
29
|
} | undefined;
|
|
16
30
|
readonly getLinkAtElement: (element: HTMLElement) => {
|
|
17
|
-
range:
|
|
18
|
-
|
|
31
|
+
range: {
|
|
32
|
+
from: number;
|
|
33
|
+
to: number;
|
|
34
|
+
};
|
|
35
|
+
mark: {
|
|
36
|
+
attrs: {
|
|
37
|
+
href: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
19
40
|
readonly text: string;
|
|
20
41
|
readonly position: DOMRect;
|
|
21
42
|
} | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { MarkType } from "@tiptap/pm/model";
|
|
2
|
+
import { Plugin } from "@tiptap/pm/state";
|
|
3
|
+
type AutolinkOptions = {
|
|
4
|
+
type: MarkType;
|
|
5
|
+
defaultProtocol: string;
|
|
6
|
+
validate: (url: string) => boolean;
|
|
7
|
+
shouldAutoLink: (url: string) => boolean;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Plugin that automatically adds link marks when typing URLs.
|
|
11
|
+
*/
|
|
12
|
+
export declare function autolink(options: AutolinkOptions): Plugin;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/core";
|
|
2
|
+
import type { MarkType } from "@tiptap/pm/model";
|
|
3
|
+
import { Plugin } from "@tiptap/pm/state";
|
|
4
|
+
import type { BlockNoteEditor } from "../../../../editor/BlockNoteEditor.js";
|
|
5
|
+
type ClickHandlerOptions = {
|
|
6
|
+
type: MarkType;
|
|
7
|
+
tiptapEditor: Editor;
|
|
8
|
+
editor?: BlockNoteEditor<any, any, any>;
|
|
9
|
+
onClick?: (event: MouseEvent, editor: BlockNoteEditor<any, any, any>) => boolean | void;
|
|
10
|
+
};
|
|
11
|
+
export declare function clickHandler(options: ClickHandlerOptions): Plugin;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight URL detection module replacing linkifyjs.
|
|
3
|
+
*
|
|
4
|
+
* Provides two functions:
|
|
5
|
+
* - findLinks(): find all URLs/emails in arbitrary text (replaces linkifyjs find())
|
|
6
|
+
* - tokenizeLink(): tokenize a single word for autolink validation (replaces linkifyjs tokenize())
|
|
7
|
+
*/
|
|
8
|
+
export interface LinkMatch {
|
|
9
|
+
type: string;
|
|
10
|
+
value: string;
|
|
11
|
+
isLink: boolean;
|
|
12
|
+
href: string;
|
|
13
|
+
start: number;
|
|
14
|
+
end: number;
|
|
15
|
+
}
|
|
16
|
+
export interface FindOptions {
|
|
17
|
+
defaultProtocol?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Find all URLs and email addresses in the given text.
|
|
21
|
+
* Drop-in replacement for linkifyjs find().
|
|
22
|
+
*/
|
|
23
|
+
export declare function findLinks(text: string, options?: FindOptions): LinkMatch[];
|
|
24
|
+
/**
|
|
25
|
+
* Tokenize a single word for autolink validation.
|
|
26
|
+
* Drop-in replacement for: tokenize(word).map(t => t.toObject(defaultProtocol))
|
|
27
|
+
*
|
|
28
|
+
* Returns an array of LinkMatch tokens. The autolink code checks:
|
|
29
|
+
* - 1 token with isLink=true → valid single link
|
|
30
|
+
* - 3 tokens with middle isLink=true and outer brackets → valid wrapped link
|
|
31
|
+
*/
|
|
32
|
+
export declare function tokenizeLink(text: string, defaultProtocol?: string): LinkMatch[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/core";
|
|
2
|
+
import type { MarkType } from "@tiptap/pm/model";
|
|
3
|
+
import { Plugin } from "@tiptap/pm/state";
|
|
4
|
+
type PasteHandlerOptions = {
|
|
5
|
+
editor: Editor;
|
|
6
|
+
defaultProtocol: string;
|
|
7
|
+
type: MarkType;
|
|
8
|
+
shouldAutoLink?: (url: string) => boolean;
|
|
9
|
+
isValidLink: (href: string) => boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare function pasteHandler(options: PasteHandlerOptions): Plugin;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ENCODED_TLDS = "aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const UNICODE_WHITESPACE_PATTERN = "[\0- \u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]";
|
|
2
|
+
export declare const UNICODE_WHITESPACE_REGEX: RegExp;
|
|
3
|
+
export declare const UNICODE_WHITESPACE_REGEX_END: RegExp;
|
|
4
|
+
export declare const UNICODE_WHITESPACE_REGEX_GLOBAL: RegExp;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Mark } from "@tiptap/core";
|
|
2
|
+
import type { BlockNoteEditor } from "../../../editor/BlockNoteEditor.js";
|
|
3
|
+
export declare function isAllowedUri(uri: string | undefined): boolean;
|
|
4
|
+
export type LinkOptions = {
|
|
5
|
+
HTMLAttributes: Record<string, any>;
|
|
6
|
+
editor?: BlockNoteEditor<any, any, any>;
|
|
7
|
+
onClick?: (event: MouseEvent, editor: BlockNoteEditor<any, any, any>) => boolean | void;
|
|
8
|
+
isValidLink: (href: string) => boolean;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* BlockNote Link mark extension.
|
|
12
|
+
*/
|
|
13
|
+
export declare const Link: Mark<LinkOptions, any>;
|
|
14
|
+
type LinkExtensionOptions = {
|
|
15
|
+
HTMLAttributes?: Record<string, any>;
|
|
16
|
+
onClick?: (event: MouseEvent, editor: BlockNoteEditor<any, any, any>) => boolean | void;
|
|
17
|
+
isValidLink?: (href: string) => boolean;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* BlockNote extension wrapping the {@link Link} TipTap mark. Wrapping the mark
|
|
21
|
+
* lets other extensions order their click handlers relative to the link click
|
|
22
|
+
* handler via `runsBefore: ["link"]`.
|
|
23
|
+
*/
|
|
24
|
+
export declare const LinkExtension: (options: LinkExtensionOptions) => import("../../../index.js").ExtensionFactoryInstance<import("../../../index.js").Extension<any, string>>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -299,9 +299,11 @@ export declare const en: {
|
|
|
299
299
|
edited: string;
|
|
300
300
|
save_button_text: string;
|
|
301
301
|
cancel_button_text: string;
|
|
302
|
+
deleted_reference_text: string;
|
|
302
303
|
actions: {
|
|
303
304
|
add_reaction: string;
|
|
304
305
|
resolve: string;
|
|
306
|
+
reopen: string;
|
|
305
307
|
edit_comment: string;
|
|
306
308
|
delete_comment: string;
|
|
307
309
|
more_actions: string;
|
|
@@ -299,9 +299,11 @@ export declare const fa: {
|
|
|
299
299
|
edited: string;
|
|
300
300
|
save_button_text: string;
|
|
301
301
|
cancel_button_text: string;
|
|
302
|
+
deleted_reference_text: string;
|
|
302
303
|
actions: {
|
|
303
304
|
add_reaction: string;
|
|
304
305
|
resolve: string;
|
|
306
|
+
reopen: string;
|
|
305
307
|
edit_comment: string;
|
|
306
308
|
delete_comment: string;
|
|
307
309
|
more_actions: string;
|
|
@@ -334,9 +334,11 @@ export declare const sk: {
|
|
|
334
334
|
edited: string;
|
|
335
335
|
save_button_text: string;
|
|
336
336
|
cancel_button_text: string;
|
|
337
|
+
deleted_reference_text: string;
|
|
337
338
|
actions: {
|
|
338
339
|
add_reaction: string;
|
|
339
340
|
resolve: string;
|
|
341
|
+
reopen: string;
|
|
340
342
|
edit_comment: string;
|
|
341
343
|
delete_comment: string;
|
|
342
344
|
more_actions: string;
|
|
@@ -73,9 +73,8 @@ export type PartialLink<T extends StyleSchema> = Omit<Link<T>, "content"> & {
|
|
|
73
73
|
content: string | Link<T>["content"];
|
|
74
74
|
};
|
|
75
75
|
export type InlineContent<I extends InlineContentSchema, T extends StyleSchema> = InlineContentFromConfig<I[keyof I], T>;
|
|
76
|
-
type PartialInlineContentElement<I extends InlineContentSchema, T extends StyleSchema> = PartialInlineContentFromConfig<I[keyof I], T>;
|
|
76
|
+
export type PartialInlineContentElement<I extends InlineContentSchema, T extends StyleSchema> = PartialInlineContentFromConfig<I[keyof I], T>;
|
|
77
77
|
export type PartialInlineContent<I extends InlineContentSchema, T extends StyleSchema> = PartialInlineContentElement<I, T>[] | string;
|
|
78
78
|
export declare function isLinkInlineContent<T extends StyleSchema>(content: InlineContent<any, T>): content is Link<T>;
|
|
79
79
|
export declare function isPartialLinkInlineContent<T extends StyleSchema>(content: PartialInlineContentElement<any, T>): content is PartialLink<T>;
|
|
80
80
|
export declare function isStyledTextInlineContent<T extends StyleSchema>(content: PartialInlineContentElement<any, T>): content is StyledText<T>;
|
|
81
|
-
export {};
|