zt-react-milkdown 0.1.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/README.md +149 -0
- package/dist/commands-CDrea4WB.cjs +1 -0
- package/dist/commands-DoqeX5uJ.js +36 -0
- package/dist/debounce-Bqj_3iJs.cjs +1 -0
- package/dist/debounce-Cuk3VGPr.js +118 -0
- package/dist/dist-BCCSKc3M.cjs +5 -0
- package/dist/dist-C0PSMrs7.cjs +37 -0
- package/dist/dist-CPVooDwj.cjs +2 -0
- package/dist/dist-CxZn1qUo.js +1584 -0
- package/dist/dist-Cxaq2crg.js +409 -0
- package/dist/dist-DaM7GJv6.js +3499 -0
- package/dist/dist-Dhukmh4L.js +7562 -0
- package/dist/dist-mOpTMw1E.cjs +1 -0
- package/dist/floating-ui.dom-CKbcbmJV.js +883 -0
- package/dist/floating-ui.dom-VaZZ2gzS.cjs +1 -0
- package/dist/index.browser-5LtNN9G9.cjs +1 -0
- package/dist/index.browser-D2DmEB8o.js +26 -0
- package/dist/index.cjs +393 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +43325 -0
- package/dist/lib-38nxOnTd.cjs +4 -0
- package/dist/lib-8Tr6mAln.cjs +1 -0
- package/dist/lib-B0rHJ9lJ.js +28 -0
- package/dist/lib-BJgvZywM.cjs +3 -0
- package/dist/lib-BNOSyYeU.cjs +3 -0
- package/dist/lib-C5AzmhNY.cjs +5 -0
- package/dist/lib-C8xOD1Bp.cjs +1 -0
- package/dist/lib-CCUU16r8.js +1081 -0
- package/dist/lib-CK9MEMX-.js +73 -0
- package/dist/lib-D4HMdvmK.cjs +1 -0
- package/dist/lib-DWZA8C0h.cjs +1 -0
- package/dist/lib-Dbe-cVjv.js +367 -0
- package/dist/lib-DkE7Uq2b.js +1886 -0
- package/dist/lib-DzK_kn7a.js +21 -0
- package/dist/lib-IahjxPWM.cjs +3 -0
- package/dist/lib-m8lKZKxK.js +80 -0
- package/dist/lib-r5eNG0sa.js +754 -0
- package/dist/lib-wmHesNI0.js +2223 -0
- package/dist/rolldown-runtime-CerMd-t8.cjs +1 -0
- package/dist/rolldown-runtime-DnwLefa7.js +23 -0
- package/dist/schema-list-DSdBEAWW.js +171 -0
- package/dist/schema-list-bL8FNes5.cjs +1 -0
- package/dist/src/components/ui/button.d.ts +16 -0
- package/dist/src/components/ui/button.d.ts.map +1 -0
- package/dist/src/components/ui/dialog.d.ts +36 -0
- package/dist/src/components/ui/dialog.d.ts.map +1 -0
- package/dist/src/components/ui/popover.d.ts +14 -0
- package/dist/src/components/ui/popover.d.ts.map +1 -0
- package/dist/src/core/commands.d.ts +7 -0
- package/dist/src/core/commands.d.ts.map +1 -0
- package/dist/src/core/createEditor.d.ts +6 -0
- package/dist/src/core/createEditor.d.ts.map +1 -0
- package/dist/src/core/schema.d.ts +8 -0
- package/dist/src/core/schema.d.ts.map +1 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/lib/editor-overlay-position.d.ts +83 -0
- package/dist/src/lib/editor-overlay-position.d.ts.map +1 -0
- package/dist/src/lib/global-scroll-listener.d.ts +9 -0
- package/dist/src/lib/global-scroll-listener.d.ts.map +1 -0
- package/dist/src/lib/utils.d.ts +6 -0
- package/dist/src/lib/utils.d.ts.map +1 -0
- package/dist/src/local/en-US.d.ts +6 -0
- package/dist/src/local/en-US.d.ts.map +1 -0
- package/dist/src/local/i18n.d.ts +10 -0
- package/dist/src/local/i18n.d.ts.map +1 -0
- package/dist/src/local/zh-CN.d.ts +6 -0
- package/dist/src/local/zh-CN.d.ts.map +1 -0
- package/dist/src/plugins/custom/blockquote/blockquote-backspace-lift.d.ts +5 -0
- package/dist/src/plugins/custom/blockquote/blockquote-backspace-lift.d.ts.map +1 -0
- package/dist/src/plugins/custom/blockquote/index.d.ts +3 -0
- package/dist/src/plugins/custom/blockquote/index.d.ts.map +1 -0
- package/dist/src/plugins/custom/code-block/code-block-editable.d.ts +7 -0
- package/dist/src/plugins/custom/code-block/code-block-editable.d.ts.map +1 -0
- package/dist/src/plugins/custom/code-block/code-block-language-picker.d.ts +7 -0
- package/dist/src/plugins/custom/code-block/code-block-language-picker.d.ts.map +1 -0
- package/dist/src/plugins/custom/code-block/code-block-mod-a-select.d.ts +5 -0
- package/dist/src/plugins/custom/code-block/code-block-mod-a-select.d.ts.map +1 -0
- package/dist/src/plugins/custom/code-block/code-block-prism.d.ts +5 -0
- package/dist/src/plugins/custom/code-block/code-block-prism.d.ts.map +1 -0
- package/dist/src/plugins/custom/code-block/index.d.ts +9 -0
- package/dist/src/plugins/custom/code-block/index.d.ts.map +1 -0
- package/dist/src/plugins/custom/cursor/drop-cursor.d.ts +5 -0
- package/dist/src/plugins/custom/cursor/drop-cursor.d.ts.map +1 -0
- package/dist/src/plugins/custom/cursor/gap-cursor.d.ts +5 -0
- package/dist/src/plugins/custom/cursor/gap-cursor.d.ts.map +1 -0
- package/dist/src/plugins/custom/cursor/index.d.ts +5 -0
- package/dist/src/plugins/custom/cursor/index.d.ts.map +1 -0
- package/dist/src/plugins/custom/image/image-editable.d.ts +7 -0
- package/dist/src/plugins/custom/image/image-editable.d.ts.map +1 -0
- package/dist/src/plugins/custom/image/image-resizable-schema.d.ts +41 -0
- package/dist/src/plugins/custom/image/image-resizable-schema.d.ts.map +1 -0
- package/dist/src/plugins/custom/image/image-upload-dialog/ImageUploadDialog.d.ts +31 -0
- package/dist/src/plugins/custom/image/image-upload-dialog/ImageUploadDialog.d.ts.map +1 -0
- package/dist/src/plugins/custom/image/image-upload-dialog/index.d.ts +20 -0
- package/dist/src/plugins/custom/image/image-upload-dialog/index.d.ts.map +1 -0
- package/dist/src/plugins/custom/image/index.d.ts +7 -0
- package/dist/src/plugins/custom/image/index.d.ts.map +1 -0
- package/dist/src/plugins/custom/indent/index.d.ts +3 -0
- package/dist/src/plugins/custom/indent/index.d.ts.map +1 -0
- package/dist/src/plugins/custom/indent/tab-space-indent.d.ts +5 -0
- package/dist/src/plugins/custom/indent/tab-space-indent.d.ts.map +1 -0
- package/dist/src/plugins/custom/list/index.d.ts +3 -0
- package/dist/src/plugins/custom/list/index.d.ts.map +1 -0
- package/dist/src/plugins/custom/list/task-list-toggle.d.ts +5 -0
- package/dist/src/plugins/custom/list/task-list-toggle.d.ts.map +1 -0
- package/dist/src/plugins/custom/math/index.d.ts +7 -0
- package/dist/src/plugins/custom/math/index.d.ts.map +1 -0
- package/dist/src/plugins/custom/math/math-backspace-entry.d.ts +5 -0
- package/dist/src/plugins/custom/math/math-backspace-entry.d.ts.map +1 -0
- package/dist/src/plugins/custom/math/math-block-editable.d.ts +7 -0
- package/dist/src/plugins/custom/math/math-block-editable.d.ts.map +1 -0
- package/dist/src/plugins/custom/math/math-plugin.d.ts +47 -0
- package/dist/src/plugins/custom/math/math-plugin.d.ts.map +1 -0
- package/dist/src/plugins/custom/selection-tooltip/constants.d.ts +7 -0
- package/dist/src/plugins/custom/selection-tooltip/constants.d.ts.map +1 -0
- package/dist/src/plugins/custom/selection-tooltip/index.d.ts +7 -0
- package/dist/src/plugins/custom/selection-tooltip/index.d.ts.map +1 -0
- package/dist/src/plugins/custom/selection-tooltip/mark-logic.d.ts +25 -0
- package/dist/src/plugins/custom/selection-tooltip/mark-logic.d.ts.map +1 -0
- package/dist/src/plugins/custom/selection-tooltip/tooltip-view.d.ts +21 -0
- package/dist/src/plugins/custom/selection-tooltip/tooltip-view.d.ts.map +1 -0
- package/dist/src/plugins/custom/selection-tooltip/types.d.ts +58 -0
- package/dist/src/plugins/custom/selection-tooltip/types.d.ts.map +1 -0
- package/dist/src/plugins/custom/slash-menu/index.d.ts +9 -0
- package/dist/src/plugins/custom/slash-menu/index.d.ts.map +1 -0
- package/dist/src/plugins/custom/slash-menu/slash-menu-commands.d.ts +6 -0
- package/dist/src/plugins/custom/slash-menu/slash-menu-commands.d.ts.map +1 -0
- package/dist/src/plugins/custom/slash-menu/slash-menu-logic.d.ts +23 -0
- package/dist/src/plugins/custom/slash-menu/slash-menu-logic.d.ts.map +1 -0
- package/dist/src/plugins/custom/slash-menu/slash-menu-view.d.ts +50 -0
- package/dist/src/plugins/custom/slash-menu/slash-menu-view.d.ts.map +1 -0
- package/dist/src/plugins/custom/slash-menu/slash-menu.d.ts +15 -0
- package/dist/src/plugins/custom/slash-menu/slash-menu.d.ts.map +1 -0
- package/dist/src/plugins/custom/table/index.d.ts +13 -0
- package/dist/src/plugins/custom/table/index.d.ts.map +1 -0
- package/dist/src/plugins/custom/table/table-arrow-entry.d.ts +5 -0
- package/dist/src/plugins/custom/table/table-arrow-entry.d.ts.map +1 -0
- package/dist/src/plugins/custom/table/table-deletion-actions.d.ts +10 -0
- package/dist/src/plugins/custom/table/table-deletion-actions.d.ts.map +1 -0
- package/dist/src/plugins/custom/table/table-focus-actions.d.ts +7 -0
- package/dist/src/plugins/custom/table/table-focus-actions.d.ts.map +1 -0
- package/dist/src/plugins/custom/table/table-more-actions.d.ts +37 -0
- package/dist/src/plugins/custom/table/table-more-actions.d.ts.map +1 -0
- package/dist/src/plugins/custom/table/table-row-insertion.d.ts +35 -0
- package/dist/src/plugins/custom/table/table-row-insertion.d.ts.map +1 -0
- package/dist/src/plugins/custom/table/table-selection.d.ts +30 -0
- package/dist/src/plugins/custom/table/table-selection.d.ts.map +1 -0
- package/dist/src/plugins/preset-common.d.ts +56 -0
- package/dist/src/plugins/preset-common.d.ts.map +1 -0
- package/dist/src/react/components/MilkdownEditor.d.ts +7 -0
- package/dist/src/react/components/MilkdownEditor.d.ts.map +1 -0
- package/dist/src/react/components/index.d.ts +2 -0
- package/dist/src/react/components/index.d.ts.map +1 -0
- package/dist/src/react/context/EditorContext.d.ts +16 -0
- package/dist/src/react/context/EditorContext.d.ts.map +1 -0
- package/dist/src/react/hooks/useCloseOnGlobalScroll.d.ts +5 -0
- package/dist/src/react/hooks/useCloseOnGlobalScroll.d.ts.map +1 -0
- package/dist/src/react/hooks/useControlledState.d.ts +9 -0
- package/dist/src/react/hooks/useControlledState.d.ts.map +1 -0
- package/dist/src/react/hooks/useMilkdownEditor.d.ts +35 -0
- package/dist/src/react/hooks/useMilkdownEditor.d.ts.map +1 -0
- package/dist/src/types/editor.d.ts +233 -0
- package/dist/src/types/editor.d.ts.map +1 -0
- package/dist/src/types/plugin.d.ts +10 -0
- package/dist/src/types/plugin.d.ts.map +1 -0
- package/dist/src/utils/guard.d.ts +5 -0
- package/dist/src/utils/guard.d.ts.map +1 -0
- package/dist/src/utils/markdown.d.ts +9 -0
- package/dist/src/utils/markdown.d.ts.map +1 -0
- package/dist/state-CHAiIqOA.cjs +1 -0
- package/dist/state-DNxqltZl.js +16 -0
- package/dist/style.css +3 -0
- package/package.json +89 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-editable.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/image/image-editable.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAwB,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAyahE;;GAEG;AACH,eAAO,MAAM,2BAA2B,GACtC,WAAU,kBAA4C,KACrD,mBAaF,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { imageSchema } from '@milkdown/preset-commonmark';
|
|
2
|
+
import { GetNodeSchema } from '@milkdown/utils';
|
|
3
|
+
/**
|
|
4
|
+
* 图片宽度百分比最小值。
|
|
5
|
+
*/
|
|
6
|
+
export declare const IMAGE_WIDTH_MIN_PERCENT = 10;
|
|
7
|
+
/**
|
|
8
|
+
* 图片宽度百分比最大值。
|
|
9
|
+
*/
|
|
10
|
+
export declare const IMAGE_WIDTH_MAX_PERCENT = 100;
|
|
11
|
+
/**
|
|
12
|
+
* 图片 schema 配置上下文。
|
|
13
|
+
*/
|
|
14
|
+
interface ImageSchemaConfigContext {
|
|
15
|
+
/** 读取 schema 配置。 */
|
|
16
|
+
get: (key: typeof imageSchema.key) => GetNodeSchema;
|
|
17
|
+
/** 写入 schema 配置。 */
|
|
18
|
+
set: (key: typeof imageSchema.key, value: GetNodeSchema) => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 限制图片宽度百分比范围。
|
|
22
|
+
*/
|
|
23
|
+
export declare const clampImageWidthPercent: (widthPercent: number) => number;
|
|
24
|
+
/**
|
|
25
|
+
* 转换图片宽度 style 文本。
|
|
26
|
+
*/
|
|
27
|
+
export declare const formatImageWidthStyle: (widthPercent: number) => string;
|
|
28
|
+
/**
|
|
29
|
+
* 解析图片宽度百分比。
|
|
30
|
+
*/
|
|
31
|
+
export declare const parseImageWidthPercent: (style: unknown) => number | null;
|
|
32
|
+
/**
|
|
33
|
+
* 规范化图片宽度 style。
|
|
34
|
+
*/
|
|
35
|
+
export declare const normalizeImageWidthStyle: (style: unknown) => string;
|
|
36
|
+
/**
|
|
37
|
+
* 配置支持尺寸调整的图片 schema。
|
|
38
|
+
*/
|
|
39
|
+
export declare const configureImageResizableSchema: (ctx: ImageSchemaConfigContext) => void;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=image-resizable-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-resizable-schema.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/image/image-resizable-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAQ3C;;GAEG;AACH,UAAU,wBAAwB;IAChC,oBAAoB;IACpB,GAAG,EAAE,CAAC,GAAG,EAAE,OAAO,WAAW,CAAC,GAAG,KAAK,aAAa,CAAC;IACpD,oBAAoB;IACpB,GAAG,EAAE,CAAC,GAAG,EAAE,OAAO,WAAW,CAAC,GAAG,EAAE,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;CAClE;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,GAAI,cAAc,MAAM,KAAG,MAE7D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,cAAc,MAAM,KAAG,MAE5D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,GAAI,OAAO,OAAO,KAAG,MAAM,GAAG,IAkBhE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,GAAI,OAAO,OAAO,KAAG,MAQzD,CAAC;AAiIF;;GAEG;AACH,eAAO,MAAM,6BAA6B,GAAI,KAAK,wBAAwB,KAAG,IAI7E,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { EditorI18nMessages, ImageUploadConfig } from '../../../../types/editor';
|
|
2
|
+
/**
|
|
3
|
+
* 定义图片插入确认参数。
|
|
4
|
+
*/
|
|
5
|
+
interface ImageConfirmPayload {
|
|
6
|
+
/** 图片地址。 */
|
|
7
|
+
src: string;
|
|
8
|
+
/** 图片替代文本。 */
|
|
9
|
+
alt: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 定义图片上传弹窗属性。
|
|
13
|
+
*/
|
|
14
|
+
interface ImageUploadDialogProps {
|
|
15
|
+
/** 编辑器文案。 */
|
|
16
|
+
messages: EditorI18nMessages;
|
|
17
|
+
/** 弹窗 Portal 挂载容器。 */
|
|
18
|
+
portalContainer: HTMLElement;
|
|
19
|
+
/** 图片上传配置。 */
|
|
20
|
+
imageUpload?: ImageUploadConfig;
|
|
21
|
+
/** 确认插入回调。 */
|
|
22
|
+
onConfirm: (payload: ImageConfirmPayload) => void;
|
|
23
|
+
/** 取消关闭回调。 */
|
|
24
|
+
onCancel: () => void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 渲染图片上传弹窗。
|
|
28
|
+
*/
|
|
29
|
+
export declare const ImageUploadDialog: ({ messages, portalContainer, imageUpload, onConfirm, onCancel }: ImageUploadDialogProps) => JSX.Element;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=ImageUploadDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageUploadDialog.d.ts","sourceRoot":"","sources":["../../../../../../src/plugins/custom/image/image-upload-dialog/ImageUploadDialog.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAOtF;;GAEG;AACH,UAAU,mBAAmB;IAC3B,YAAY;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,UAAU,sBAAsB;IAC9B,aAAa;IACb,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,sBAAsB;IACtB,eAAe,EAAE,WAAW,CAAC;IAC7B,cAAc;IACd,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,cAAc;IACd,SAAS,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAClD,cAAc;IACd,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAsDD;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,iEAM/B,sBAAsB,KAAG,GAAG,CAAC,OA2Y/B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { EditorI18nMessages, ImageUploadConfig } from '../../../../types/editor';
|
|
2
|
+
/**
|
|
3
|
+
* 定义图片上传弹窗参数。
|
|
4
|
+
*/
|
|
5
|
+
interface ImageUploadDialogOptions {
|
|
6
|
+
/** 编辑器内部浮层 Portal 容器。 */
|
|
7
|
+
portalContainer: HTMLElement;
|
|
8
|
+
/** 当前编辑器视图。 */
|
|
9
|
+
view: any;
|
|
10
|
+
/** 编辑器文案。 */
|
|
11
|
+
messages: EditorI18nMessages;
|
|
12
|
+
/** 图片上传配置。 */
|
|
13
|
+
imageUpload?: ImageUploadConfig;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 创建图片上传弹窗。
|
|
17
|
+
*/
|
|
18
|
+
export declare const showImageUploadDialog: (options: ImageUploadDialogOptions) => void;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/plugins/custom/image/image-upload-dialog/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAetF;;GAEG;AACH,UAAU,wBAAwB;IAChC,yBAAyB;IACzB,eAAe,EAAE,WAAW,CAAC;IAC7B,eAAe;IACf,IAAI,EAAE,GAAG,CAAC;IACV,aAAa;IACb,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,cAAc;IACd,WAAW,CAAC,EAAE,iBAAiB,CAAC;CACjC;AAmBD;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,SAAS,wBAAwB,KAAG,IAwCzE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/image/index.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,cAAc,kBAAkB,CAAC;AACjC,wBAAwB;AACxB,cAAc,0BAA0B,CAAC;AACzC,mBAAmB;AACnB,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/indent/index.ts"],"names":[],"mappings":"AAAA,uBAAuB;AACvB,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tab-space-indent.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/indent/tab-space-indent.ts"],"names":[],"mappings":"AA0HA;;GAEG;AACH,eAAO,MAAM,oBAAoB,kCA+B/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/list/index.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAClB,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-list-toggle.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/list/task-list-toggle.ts"],"names":[],"mappings":"AA8EA;;GAEG;AACH,eAAO,MAAM,cAAc,kCA+BzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/math/index.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,cAAc,wBAAwB,CAAC;AACvC,0BAA0B;AAC1B,cAAc,uBAAuB,CAAC;AACtC,2BAA2B;AAC3B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"math-backspace-entry.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/math/math-backspace-entry.ts"],"names":[],"mappings":"AA+FA;;GAEG;AACH,eAAO,MAAM,wBAAwB,kCAanC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NodeViewConstructor } from '@milkdown/prose/view';
|
|
2
|
+
import { EditorI18nMessages } from '../../../types/editor';
|
|
3
|
+
/**
|
|
4
|
+
* 创建 math_block 的 NodeView 构造器。
|
|
5
|
+
*/
|
|
6
|
+
export declare const createMathBlockEditableNodeView: (messages?: EditorI18nMessages) => NodeViewConstructor;
|
|
7
|
+
//# sourceMappingURL=math-block-editable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"math-block-editable.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/math/math-block-editable.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAwB,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAmiBhE;;GAEG;AACH,eAAO,MAAM,+BAA+B,GAC1C,WAAU,kBAA4C,KACrD,mBAYF,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { MilkdownPlugin } from '@milkdown/ctx';
|
|
2
|
+
import { KatexOptions } from 'katex';
|
|
3
|
+
/**
|
|
4
|
+
* 行内公式节点类型名。
|
|
5
|
+
*/
|
|
6
|
+
export declare const MATH_INLINE_NODE_NAME = "math_inline";
|
|
7
|
+
/**
|
|
8
|
+
* 块级公式节点类型名。
|
|
9
|
+
*/
|
|
10
|
+
export declare const MATH_BLOCK_NODE_NAME = "math_block";
|
|
11
|
+
/**
|
|
12
|
+
* 行内公式自动输入规则。
|
|
13
|
+
*/
|
|
14
|
+
export declare const MATH_INLINE_INPUT_RULE_REGEX: RegExp;
|
|
15
|
+
/**
|
|
16
|
+
* 块级公式自动输入规则。
|
|
17
|
+
*/
|
|
18
|
+
export declare const MATH_BLOCK_INPUT_RULE_REGEX: RegExp;
|
|
19
|
+
/**
|
|
20
|
+
* remark-math 插件包装器。
|
|
21
|
+
*/
|
|
22
|
+
export declare const remarkMathPlugin: import('@milkdown/utils').$Remark<"remarkMath", undefined>;
|
|
23
|
+
/**
|
|
24
|
+
* katex 配置上下文。
|
|
25
|
+
*/
|
|
26
|
+
export declare const katexOptionsCtx: import('@milkdown/utils').$Ctx<KatexOptions, "katexOptions">;
|
|
27
|
+
/**
|
|
28
|
+
* 行内公式节点 schema。
|
|
29
|
+
*/
|
|
30
|
+
export declare const mathInlineSchema: import('@milkdown/utils').$NodeSchema<"math_inline">;
|
|
31
|
+
/**
|
|
32
|
+
* 块级公式节点 schema。
|
|
33
|
+
*/
|
|
34
|
+
export declare const mathBlockSchema: import('@milkdown/utils').$NodeSchema<"math_block">;
|
|
35
|
+
/**
|
|
36
|
+
* 行内公式输入规则插件。
|
|
37
|
+
*/
|
|
38
|
+
export declare const mathInlineInputRule: import('@milkdown/utils').$InputRule;
|
|
39
|
+
/**
|
|
40
|
+
* 块级公式输入规则插件。
|
|
41
|
+
*/
|
|
42
|
+
export declare const mathBlockInputRule: import('@milkdown/utils').$InputRule;
|
|
43
|
+
/**
|
|
44
|
+
* 数学插件聚合导出。
|
|
45
|
+
*/
|
|
46
|
+
export declare const math: MilkdownPlugin[];
|
|
47
|
+
//# sourceMappingURL=math-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"math-plugin.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/math/math-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAKpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C;;GAEG;AACH,eAAO,MAAM,qBAAqB,gBAAgB,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,oBAAoB,eAAe,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,4BAA4B,QAAyB,CAAC;AAEnE;;GAEG;AACH,eAAO,MAAM,2BAA2B,QAAa,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,gBAAgB,4DAE3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe,8DAAyD,CAAC;AAEtF;;GAEG;AACH,eAAO,MAAM,gBAAgB,sDA+C3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe,qDAyD1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB,sCAQ9B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB,sCAiB7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,IAAI,EAAE,cAAc,EAOzB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EditorI18nMessages } from '../../../types/editor';
|
|
2
|
+
import { SelectionTooltipItem } from './types';
|
|
3
|
+
export declare const SELECTION_TOOLTIP_ID = "zt-md-selection-tooltip";
|
|
4
|
+
export declare const resolveSelectionTooltipItems: (messages: EditorI18nMessages) => SelectionTooltipItem[];
|
|
5
|
+
export declare const SELECTION_TOOLTIP_ICON_SIZE = 14;
|
|
6
|
+
export declare const SELECTION_TOOLTIP_ICON_STROKE_WIDTH = 2;
|
|
7
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/selection-tooltip/constants.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAGpD,eAAO,MAAM,oBAAoB,4BAA4B,CAAC;AAG9D,eAAO,MAAM,4BAA4B,GAAI,UAAU,kBAAkB,KAAG,oBAAoB,EAkB/F,CAAC;AAGF,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAG9C,eAAO,MAAM,mCAAmC,IAAI,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { $prose } from '@milkdown/utils';
|
|
2
|
+
import { EditorI18nMessages } from '../../../types/editor';
|
|
3
|
+
/**
|
|
4
|
+
* 创建选区 tooltip 菜单插件。
|
|
5
|
+
*/
|
|
6
|
+
export declare const createSelectionTooltipPlugin: (portalContainer: HTMLElement, messages: EditorI18nMessages) => ReturnType<typeof $prose>;
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/selection-tooltip/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AA6HhE;;GAEG;AACH,eAAO,MAAM,4BAA4B,GACvC,iBAAiB,WAAW,EAC5B,UAAU,kBAAkB,KAC3B,UAAU,CAAC,OAAO,MAAM,CAO1B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { MarkType } from '@milkdown/prose/model';
|
|
2
|
+
import { EditorState } from '@milkdown/prose/state';
|
|
3
|
+
import { EditorView } from '@milkdown/prose/view';
|
|
4
|
+
import { MarkCommandContext, SelectionTooltipCommand } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* 判断编辑器视图是否可编辑。
|
|
7
|
+
*/
|
|
8
|
+
export declare const isEditorViewEditable: (view: EditorView) => boolean;
|
|
9
|
+
/**
|
|
10
|
+
* 从 schema 中按候选名解析 mark 类型。
|
|
11
|
+
*/
|
|
12
|
+
export declare const resolveMarkType: (view: EditorView, markNames: string[]) => MarkType | null;
|
|
13
|
+
/**
|
|
14
|
+
* 判断选区内是否包含目标 mark。
|
|
15
|
+
*/
|
|
16
|
+
export declare const isMarkActive: (state: EditorState, markType: MarkType) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* 读取选区内已有链接地址。
|
|
19
|
+
*/
|
|
20
|
+
export declare const resolveSelectedLinkHref: (state: EditorState, linkType: MarkType) => string;
|
|
21
|
+
/**
|
|
22
|
+
* 按命令类型执行菜单动作。
|
|
23
|
+
*/
|
|
24
|
+
export declare const runSelectionTooltipCommand: (command: SelectionTooltipCommand, context: MarkCommandContext) => void;
|
|
25
|
+
//# sourceMappingURL=mark-logic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mark-logic.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/selection-tooltip/mark-logic.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,MAAM,UAAU,KAAG,OAMvD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,UAAU,EAAE,WAAW,MAAM,EAAE,KAAG,QAAQ,GAAG,IAOlF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,WAAW,EAAE,UAAU,QAAQ,KAAG,OAKrE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAAI,OAAO,WAAW,EAAE,UAAU,QAAQ,KAAG,MAkBhF,CAAC;AAmBF;;GAEG;AACH,eAAO,MAAM,0BAA0B,GACrC,SAAS,uBAAuB,EAChC,SAAS,kBAAkB,KAC1B,IAWF,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EditorView } from '@milkdown/prose/view';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { Root } from 'react-dom/client';
|
|
4
|
+
import { LinkPopoverControlProps, SelectionTooltipItem } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* 创建选区菜单 DOM。
|
|
7
|
+
*/
|
|
8
|
+
export declare const createSelectionTooltipElement: (view: EditorView, items: SelectionTooltipItem[], getCurrentView: () => EditorView | null, toggleLinkPopover: (view: EditorView) => void, iconRoots: Root[]) => HTMLDivElement;
|
|
9
|
+
/**
|
|
10
|
+
* 链接编辑 Popover 控件。
|
|
11
|
+
*/
|
|
12
|
+
export declare const LinkPopoverControl: (props: LinkPopoverControlProps) => ReactElement;
|
|
13
|
+
/**
|
|
14
|
+
* 刷新菜单按钮激活态。
|
|
15
|
+
*/
|
|
16
|
+
export declare const updateSelectionTooltipActiveState: (tooltip: HTMLElement, view: EditorView, items: SelectionTooltipItem[]) => void;
|
|
17
|
+
/**
|
|
18
|
+
* 创建 tooltip 展示判断函数。
|
|
19
|
+
*/
|
|
20
|
+
export declare const createSelectionTooltipShouldShow: (tooltip: HTMLElement, isPinned: () => boolean) => ((view: EditorView) => boolean);
|
|
21
|
+
//# sourceMappingURL=tooltip-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip-view.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/selection-tooltip/tooltip-view.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAkF,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1H,OAAO,EAAc,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAezD,OAAO,KAAK,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAqD7E;;GAEG;AACH,eAAO,MAAM,6BAA6B,GACxC,MAAM,UAAU,EAChB,OAAO,oBAAoB,EAAE,EAC7B,gBAAgB,MAAM,UAAU,GAAG,IAAI,EACvC,mBAAmB,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,EAC7C,WAAW,IAAI,EAAE,KAChB,cAoBF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,uBAAuB,KAAG,YA4MnE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iCAAiC,GAC5C,SAAS,WAAW,EACpB,MAAM,UAAU,EAChB,OAAO,oBAAoB,EAAE,KAC5B,IAgBF,CAAC;AAuBF;;GAEG;AACH,eAAO,MAAM,gCAAgC,GAC3C,SAAS,WAAW,EACpB,UAAU,MAAM,OAAO,KACtB,CAAC,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAuBhC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { MarkType } from '@milkdown/prose/model';
|
|
2
|
+
import { EditorView } from '@milkdown/prose/view';
|
|
3
|
+
import { Bold } from 'lucide-react';
|
|
4
|
+
import { EditorI18nMessages } from '../../../types/editor';
|
|
5
|
+
/**
|
|
6
|
+
* 选区菜单图标组件类型。
|
|
7
|
+
*/
|
|
8
|
+
export type SelectionTooltipIcon = typeof Bold;
|
|
9
|
+
/**
|
|
10
|
+
* 选区菜单命令键名。
|
|
11
|
+
*/
|
|
12
|
+
export type SelectionTooltipCommand = 'strong' | 'em' | 'strike' | 'inlineCode' | 'link';
|
|
13
|
+
/**
|
|
14
|
+
* 选区菜单项配置。
|
|
15
|
+
*/
|
|
16
|
+
export interface SelectionTooltipItem {
|
|
17
|
+
/** 命令键名。 */
|
|
18
|
+
command: SelectionTooltipCommand;
|
|
19
|
+
/** 按钮图标组件。 */
|
|
20
|
+
icon: SelectionTooltipIcon;
|
|
21
|
+
/** 无障碍标题。 */
|
|
22
|
+
title: string;
|
|
23
|
+
/** schema mark 候选名。 */
|
|
24
|
+
markNames: string[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* mark 命令上下文。
|
|
28
|
+
*/
|
|
29
|
+
export interface MarkCommandContext {
|
|
30
|
+
/** 编辑器视图。 */
|
|
31
|
+
view: EditorView;
|
|
32
|
+
/** mark 类型。 */
|
|
33
|
+
markType: MarkType;
|
|
34
|
+
/** 切换链接编辑器展开状态。 */
|
|
35
|
+
toggleLinkPopover: (view: EditorView) => void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 链接编辑 Popover 组件属性。
|
|
39
|
+
*/
|
|
40
|
+
export interface LinkPopoverControlProps {
|
|
41
|
+
/** 编辑器视图引用读取函数。 */
|
|
42
|
+
getCurrentView: () => EditorView | null;
|
|
43
|
+
/** Popover Portal 挂载容器。 */
|
|
44
|
+
portalContainer: HTMLElement;
|
|
45
|
+
/** 链接按钮图标尺寸。 */
|
|
46
|
+
iconSize: number;
|
|
47
|
+
/** 链接按钮图标线宽。 */
|
|
48
|
+
iconStrokeWidth: number;
|
|
49
|
+
/** 触发器按钮元素引用。 */
|
|
50
|
+
triggerRef: (element: HTMLButtonElement | null) => void;
|
|
51
|
+
/** 链接弹层展开状态。 */
|
|
52
|
+
open: boolean;
|
|
53
|
+
/** 链接弹层开关回调。 */
|
|
54
|
+
onOpenChange: (nextOpen: boolean) => void;
|
|
55
|
+
/** 编辑器文案。 */
|
|
56
|
+
messages: EditorI18nMessages;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/selection-tooltip/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,OAAO,IAAI,CAAC;AAE/C;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,IAAI,GAAG,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC;AAEzF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,YAAY;IACZ,OAAO,EAAE,uBAAuB,CAAC;IACjC,cAAc;IACd,IAAI,EAAE,oBAAoB,CAAC;IAC3B,aAAa;IACb,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,aAAa;IACb,IAAI,EAAE,UAAU,CAAC;IACjB,eAAe;IACf,QAAQ,EAAE,QAAQ,CAAC;IACnB,mBAAmB;IACnB,iBAAiB,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;CAC/C;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,mBAAmB;IACnB,cAAc,EAAE,MAAM,UAAU,GAAG,IAAI,CAAC;IACxC,2BAA2B;IAC3B,eAAe,EAAE,WAAW,CAAC;IAC7B,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB;IACjB,UAAU,EAAE,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,gBAAgB;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,gBAAgB;IAChB,YAAY,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,aAAa;IACb,QAAQ,EAAE,kBAAkB,CAAC;CAC9B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** slash 菜单命令执行导出。 */
|
|
2
|
+
export * from './slash-menu-commands';
|
|
3
|
+
/** slash 菜单状态与匹配逻辑导出。 */
|
|
4
|
+
export * from './slash-menu-logic';
|
|
5
|
+
/** slash 菜单视图控制器导出。 */
|
|
6
|
+
export * from './slash-menu-view';
|
|
7
|
+
/** slash 菜单主插件导出。 */
|
|
8
|
+
export * from './slash-menu';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/slash-menu/index.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,cAAc,uBAAuB,CAAC;AACtC,yBAAyB;AACzB,cAAc,oBAAoB,CAAC;AACnC,uBAAuB;AACvB,cAAc,mBAAmB,CAAC;AAClC,qBAAqB;AACrB,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slash-menu-commands.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/slash-menu/slash-menu-commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAsN9D;;GAEG;AACH,eAAO,MAAM,eAAe,GAAU,MAAM,GAAG,EAAE,SAAS,gBAAgB,KAAG,OAAO,CAAC,OAAO,CAoM3F,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { EditorLocale, SlashMenuConfig, SlashMenuItem } from '../../../types/editor';
|
|
2
|
+
/**
|
|
3
|
+
* slash 菜单当前状态。
|
|
4
|
+
*/
|
|
5
|
+
export interface SlashMenuState {
|
|
6
|
+
/** 当前过滤后的菜单项。 */
|
|
7
|
+
visibleItems: SlashMenuItem[];
|
|
8
|
+
/** 当前是否应显示菜单。 */
|
|
9
|
+
shouldShow: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 构建最终菜单项配置。
|
|
13
|
+
*/
|
|
14
|
+
export declare const resolveSlashMenuItems: (config?: SlashMenuConfig, locale?: EditorLocale) => SlashMenuItem[];
|
|
15
|
+
/**
|
|
16
|
+
* 计算当前菜单状态。
|
|
17
|
+
*/
|
|
18
|
+
export declare const resolveMenuState: (view: any, items: SlashMenuItem[]) => SlashMenuState;
|
|
19
|
+
/**
|
|
20
|
+
* 删除当前光标所在文本块中最后一个 slash 查询词。
|
|
21
|
+
*/
|
|
22
|
+
export declare const removeSlashQueryAtCursor: (view: any) => boolean;
|
|
23
|
+
//# sourceMappingURL=slash-menu-logic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slash-menu-logic.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/slash-menu/slash-menu-logic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE1F;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,iBAAiB;IACjB,YAAY,EAAE,aAAa,EAAE,CAAC;IAC9B,iBAAiB;IACjB,UAAU,EAAE,OAAO,CAAC;CACrB;AA8CD;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,SAAS,eAAe,EAAE,SAAQ,YAAsB,KAAG,aAAa,EAM7G,CAAC;AAwFF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,GAAG,EAAE,OAAO,aAAa,EAAE,KAAG,cAQpE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,GAAI,MAAM,GAAG,KAAG,OA2BpD,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { SlashMenuItem } from '../../../types/editor';
|
|
2
|
+
import { OverlayPlacement } from '../../../lib/editor-overlay-position';
|
|
3
|
+
/**
|
|
4
|
+
* slash 菜单展开方向。
|
|
5
|
+
*/
|
|
6
|
+
type SlashMenuPlacement = OverlayPlacement;
|
|
7
|
+
/**
|
|
8
|
+
* slash 菜单定位上下文(第一段:内容坐标计算所需输入)。
|
|
9
|
+
*/
|
|
10
|
+
interface SlashMenuPositionContext {
|
|
11
|
+
/** 编辑器滚动容器。 */
|
|
12
|
+
editorWrapper: HTMLElement;
|
|
13
|
+
/** 光标顶部在编辑器内容坐标系中的位置。 */
|
|
14
|
+
anchorTopInContent: number;
|
|
15
|
+
/** 光标底部在编辑器内容坐标系中的位置。 */
|
|
16
|
+
anchorBottomInContent: number;
|
|
17
|
+
/** 光标左侧在编辑器内容坐标系中的位置。 */
|
|
18
|
+
anchorLeftInContent: number;
|
|
19
|
+
/** 菜单展开方向(在输入更新时决策)。 */
|
|
20
|
+
placement: SlashMenuPlacement;
|
|
21
|
+
/** 主轴偏移(与光标的垂直间距)。 */
|
|
22
|
+
offsetY: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* slash 菜单视图控制器。
|
|
26
|
+
*/
|
|
27
|
+
export interface SlashMenuViewController {
|
|
28
|
+
/** 菜单容器节点。 */
|
|
29
|
+
menu: HTMLDivElement;
|
|
30
|
+
/** 当前菜单是否可见。 */
|
|
31
|
+
isVisible: () => boolean;
|
|
32
|
+
/** 切换菜单显隐。 */
|
|
33
|
+
setVisible: (visible: boolean, updatePosition?: () => void) => void;
|
|
34
|
+
/** 渲染菜单项(输入不变时跳过)。 */
|
|
35
|
+
renderIfNeeded: (items: SlashMenuItem[], activeIndex: number) => void;
|
|
36
|
+
/** 将当前高亮菜单项滚动到可视区域内。 */
|
|
37
|
+
scrollActiveItemIntoView: (onAfterScroll?: () => void) => void;
|
|
38
|
+
/** 更新菜单定位上下文(不会立即强制显示)。 */
|
|
39
|
+
updatePositionContext: (context: SlashMenuPositionContext | null) => void;
|
|
40
|
+
/** 按当前上下文刷新定位。 */
|
|
41
|
+
updatePosition: () => void;
|
|
42
|
+
/** 销毁控制器并清理全局监听。 */
|
|
43
|
+
destroy: () => void;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 创建 slash 菜单视图控制器。
|
|
47
|
+
*/
|
|
48
|
+
export declare const createSlashMenuViewController: (portalContainer: HTMLElement) => SlashMenuViewController;
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=slash-menu-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slash-menu-view.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/slash-menu/slash-menu-view.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAuB3D,OAAO,EAAsD,KAAK,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAEjI;;GAEG;AACH,KAAK,kBAAkB,GAAG,gBAAgB,CAAC;AA6B3C;;GAEG;AACH,UAAU,wBAAwB;IAChC,eAAe;IACf,aAAa,EAAE,WAAW,CAAC;IAC3B,yBAAyB;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,yBAAyB;IACzB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,yBAAyB;IACzB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,wBAAwB;IACxB,SAAS,EAAE,kBAAkB,CAAC;IAC9B,sBAAsB;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,cAAc;IACd,IAAI,EAAE,cAAc,CAAC;IACrB,gBAAgB;IAChB,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,cAAc;IACd,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,CAAC,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IACpE,sBAAsB;IACtB,cAAc,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACtE,wBAAwB;IACxB,wBAAwB,EAAE,CAAC,aAAa,CAAC,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IAC/D,2BAA2B;IAC3B,qBAAqB,EAAE,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1E,kBAAkB;IAClB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,oBAAoB;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAyDD;;GAEG;AACH,eAAO,MAAM,6BAA6B,GAAI,iBAAiB,WAAW,KAAG,uBAyK5E,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EditorI18nMessages, EditorLocale, ImageUploadConfig, SlashMenuConfig } from '../../../types/editor';
|
|
2
|
+
/**
|
|
3
|
+
* slash 插件初始化结果。
|
|
4
|
+
*/
|
|
5
|
+
export interface SlashPluginSetup {
|
|
6
|
+
/** slash 插件实例列表(可包含 spec + plugin)。 */
|
|
7
|
+
plugins: unknown[];
|
|
8
|
+
/** slash 上下文配置器。 */
|
|
9
|
+
config: ((ctx: unknown) => void) | null;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 创建 slash 菜单插件。
|
|
13
|
+
*/
|
|
14
|
+
export declare const createSlashMenuPlugin: (portalContainer: HTMLElement, config?: SlashMenuConfig, messages?: EditorI18nMessages, imageUpload?: ImageUploadConfig, locale?: EditorLocale) => Promise<SlashPluginSetup>;
|
|
15
|
+
//# sourceMappingURL=slash-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slash-menu.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/slash-menu/slash-menu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAiB,MAAM,uBAAuB,CAAC;AAOjI;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uCAAuC;IACvC,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,oBAAoB;IACpB,MAAM,EAAE,CAAC,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;CACzC;AAyED;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAChC,iBAAiB,WAAW,EAC5B,SAAS,eAAe,EACxB,WAAW,kBAAkB,EAC7B,cAAc,iBAAiB,EAC/B,SAAQ,YAAsB,KAC7B,OAAO,CAAC,gBAAgB,CAsO1B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** 表格方向键进入插件导出。 */
|
|
2
|
+
export * from './table-arrow-entry';
|
|
3
|
+
/** 表格删除动作导出。 */
|
|
4
|
+
export * from './table-deletion-actions';
|
|
5
|
+
/** 表格聚焦操作插件导出。 */
|
|
6
|
+
export * from './table-focus-actions';
|
|
7
|
+
/** 表格更多操作组件导出。 */
|
|
8
|
+
export * from './table-more-actions';
|
|
9
|
+
/** 表格行列插入与删除动作导出。 */
|
|
10
|
+
export * from './table-row-insertion';
|
|
11
|
+
/** 表格选区解析工具导出。 */
|
|
12
|
+
export * from './table-selection';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/table/index.ts"],"names":[],"mappings":"AAAA,mBAAmB;AACnB,cAAc,qBAAqB,CAAC;AACpC,gBAAgB;AAChB,cAAc,0BAA0B,CAAC;AACzC,kBAAkB;AAClB,cAAc,uBAAuB,CAAC;AACtC,kBAAkB;AAClB,cAAc,sBAAsB,CAAC;AACrC,qBAAqB;AACrB,cAAc,uBAAuB,CAAC;AACtC,kBAAkB;AAClB,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-arrow-entry.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/table/table-arrow-entry.ts"],"names":[],"mappings":"AAoJA;;GAEG;AACH,eAAO,MAAM,qBAAqB,kCAahC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EditorView } from '@milkdown/prose/view';
|
|
2
|
+
/**
|
|
3
|
+
* 删除当前普通表格行。
|
|
4
|
+
*/
|
|
5
|
+
export declare const deleteFocusedTableRow: (view: EditorView) => void;
|
|
6
|
+
/**
|
|
7
|
+
* 删除当前表格列。
|
|
8
|
+
*/
|
|
9
|
+
export declare const deleteFocusedTableColumn: (view: EditorView) => void;
|
|
10
|
+
//# sourceMappingURL=table-deletion-actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-deletion-actions.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/table/table-deletion-actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIvD;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,MAAM,UAAU,KAAG,IAQxD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,GAAI,MAAM,UAAU,KAAG,IAQ3D,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { $prose } from '@milkdown/utils';
|
|
2
|
+
import { EditorI18nMessages } from '../../../types/editor';
|
|
3
|
+
/**
|
|
4
|
+
* 表格聚焦操作插件:聚焦表格时显示删除按钮。
|
|
5
|
+
*/
|
|
6
|
+
export declare const createTableFocusActionsPlugin: (portalContainer: HTMLElement, messages?: EditorI18nMessages) => ReturnType<typeof $prose>;
|
|
7
|
+
//# sourceMappingURL=table-focus-actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-focus-actions.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/table/table-focus-actions.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAsgBhE;;GAEG;AACH,eAAO,MAAM,6BAA6B,GAAI,iBAAiB,WAAW,EAAE,WAAW,kBAAkB,KAAG,UAAU,CAAC,OAAO,MAAM,CASnI,CAAC"}
|