@grandaniel/vue-markdown-editor 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/MarkdownEditor/Composable/useReflectiveState.d.ts +3 -3
- package/dist/components/MarkdownEditor/Composable/useTextSelectionMenu.d.ts +29 -0
- package/dist/components/MarkdownEditor/ContextMenu/MarkdownEditorContextMenu.vue.d.ts +3 -2
- package/dist/components/MarkdownEditor/ContextMenu/MarkdownEditorTextSelectionContextMenu.vue.d.ts +1 -18
- package/dist/components/MarkdownEditor/MarkdownEditor.vue.d.ts +2 -2
- package/dist/components/MarkdownEditor/MarkdownEditorFocusControls.vue.d.ts +9 -0
- package/dist/components/MarkdownEditor/Modules/MarkdownModuleList.vue.d.ts +11 -1
- package/dist/vue-markdown-editor.css +1 -1
- package/dist/vue-markdown-editor.mjs +4292 -4309
- package/package.json +7 -2
|
@@ -3,7 +3,9 @@ import { type ModelRef, type Ref } from "vue";
|
|
|
3
3
|
import type MarkdownModuleTextState from "../Modules/MarkdownModuleTextState";
|
|
4
4
|
import type { TextishEmitFunction } from "../Types/TextishEmits";
|
|
5
5
|
declare function markdownToHtml(markdown: string): string;
|
|
6
|
-
declare function
|
|
6
|
+
declare function htmlToMarkdown(html: string): string;
|
|
7
|
+
export { markdownToHtml, htmlToMarkdown };
|
|
8
|
+
export default function useReflectiveState<T extends MarkdownModuleTextState>(options: {
|
|
7
9
|
modelRef: ModelRef<T>;
|
|
8
10
|
emit: TextishEmitFunction;
|
|
9
11
|
editorRef?: Ref<InstanceType<typeof EditorContent> | undefined>;
|
|
@@ -16,5 +18,3 @@ declare function useReflectiveState<T extends MarkdownModuleTextState>(options:
|
|
|
16
18
|
focus: () => void;
|
|
17
19
|
};
|
|
18
20
|
};
|
|
19
|
-
export { markdownToHtml };
|
|
20
|
-
export default useReflectiveState;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ref } from "vue";
|
|
2
|
+
export interface TextSelectionActiveStates {
|
|
3
|
+
bold: boolean;
|
|
4
|
+
italic: boolean;
|
|
5
|
+
underline: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface TextSelectionMenuState {
|
|
8
|
+
isVisible: ReturnType<typeof ref<boolean>>;
|
|
9
|
+
anchorX: ReturnType<typeof ref<number>>;
|
|
10
|
+
anchorY: ReturnType<typeof ref<number>>;
|
|
11
|
+
activeStates: ReturnType<typeof ref<TextSelectionActiveStates>>;
|
|
12
|
+
hide: () => void;
|
|
13
|
+
}
|
|
14
|
+
declare function useTextSelectionMenu(): {
|
|
15
|
+
isVisible: import("vue").Ref<boolean, boolean>;
|
|
16
|
+
anchorX: import("vue").Ref<number, number>;
|
|
17
|
+
anchorY: import("vue").Ref<number, number>;
|
|
18
|
+
activeStates: import("vue").Ref<{
|
|
19
|
+
bold: boolean;
|
|
20
|
+
italic: boolean;
|
|
21
|
+
underline: boolean;
|
|
22
|
+
}, TextSelectionActiveStates | {
|
|
23
|
+
bold: boolean;
|
|
24
|
+
italic: boolean;
|
|
25
|
+
underline: boolean;
|
|
26
|
+
}>;
|
|
27
|
+
hide: () => void;
|
|
28
|
+
};
|
|
29
|
+
export default useTextSelectionMenu;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
x: number;
|
|
3
3
|
y: number;
|
|
4
|
+
placement?: "above" | "below";
|
|
4
5
|
};
|
|
5
|
-
declare var
|
|
6
|
+
declare var __VLS_7: {};
|
|
6
7
|
type __VLS_Slots = {} & {
|
|
7
|
-
default?: (props: typeof
|
|
8
|
+
default?: (props: typeof __VLS_7) => any;
|
|
8
9
|
};
|
|
9
10
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
11
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
package/dist/components/MarkdownEditor/ContextMenu/MarkdownEditorTextSelectionContextMenu.vue.d.ts
CHANGED
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
x: number;
|
|
3
|
-
y: number;
|
|
4
|
-
isActive: {
|
|
5
|
-
bold: boolean;
|
|
6
|
-
italic: boolean;
|
|
7
|
-
underline: boolean;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
-
"toggle-bold": () => any;
|
|
12
|
-
"toggle-italic": () => any;
|
|
13
|
-
"toggle-underline": () => any;
|
|
14
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
|
-
"onToggle-bold"?: (() => any) | undefined;
|
|
16
|
-
"onToggle-italic"?: (() => any) | undefined;
|
|
17
|
-
"onToggle-underline"?: (() => any) | undefined;
|
|
18
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
19
2
|
declare const _default: typeof __VLS_export;
|
|
20
3
|
export default _default;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type PropType } from "vue";
|
|
2
2
|
import type { MarkdownEditorInstance } from "./Composable/useMarkdownEditor";
|
|
3
3
|
import type { MarkdownAstNode } from "./Types/MarkdownAstNode";
|
|
4
|
-
declare var
|
|
4
|
+
declare var __VLS_23: {};
|
|
5
5
|
type __VLS_Slots = {} & {
|
|
6
|
-
'after-controls'?: (props: typeof
|
|
6
|
+
'after-controls'?: (props: typeof __VLS_23) => any;
|
|
7
7
|
};
|
|
8
8
|
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
9
9
|
editor: {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
2
|
+
delete: () => any;
|
|
3
|
+
add: () => any;
|
|
4
|
+
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
5
|
+
onDelete?: (() => any) | undefined;
|
|
6
|
+
onAdd?: (() => any) | undefined;
|
|
7
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import MarkdownModuleListState from "./MarkdownModuleListState";
|
|
2
|
+
type __VLS_ModelProps = {
|
|
3
|
+
modelValue: MarkdownModuleListState;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {
|
|
6
|
+
focus(): void;
|
|
7
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
"update:modelValue": (value: MarkdownModuleListState) => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
10
|
+
"onUpdate:modelValue"?: ((value: MarkdownModuleListState) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
2
12
|
declare const _default: typeof __VLS_export;
|
|
3
13
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
[data-v-aa7529af],[data-v-0d04047d]{background:0 0;border:none;outline:none}.markdown-editor-modal-overlay[data-v-3e773d7f]{z-index:9999;background:#00000080;justify-content:center;align-items:center;padding:1rem;display:flex;position:fixed;inset:0}.markdown-editor-modal[data-v-3e773d7f]{background:#fff;border-radius:.75rem;flex-direction:column;width:100%;max-width:32rem;max-height:90vh;display:flex;box-shadow:0 20px 25px -5px #0000001a,0 10px 10px -5px #0000000a}.markdown-editor-modal-header[data-v-3e773d7f]{border-bottom:1px solid #e5e7eb;justify-content:space-between;align-items:center;padding:1.25rem 1.5rem;display:flex}.markdown-editor-modal-title[data-v-3e773d7f]{color:#111827;margin:0;font-size:1.125rem;font-weight:600}.markdown-editor-modal-close[data-v-3e773d7f]{color:#6b7280;cursor:pointer;background:0 0;border:none;border-radius:.375rem;justify-content:center;align-items:center;width:2rem;height:2rem;padding:0;font-size:1.75rem;line-height:1;transition:all .15s;display:flex}.markdown-editor-modal-close[data-v-3e773d7f]:hover{color:#111827;background:#f3f4f6}.markdown-editor-modal-body[data-v-3e773d7f]{flex:1;padding:1.5rem;overflow-y:auto}.markdown-editor-modal-footer[data-v-3e773d7f]{border-top:1px solid #e5e7eb;justify-content:flex-end;gap:.75rem;padding:1.25rem 1.5rem;display:flex}.markdown-editor-modal-button[data-v-3e773d7f]{cursor:pointer;border:none;border-radius:.5rem;padding:.625rem 1.25rem;font-size:.875rem;font-weight:500;transition:all .15s}.markdown-editor-modal-button[data-v-3e773d7f]:active{transform:scale(.98)}.markdown-editor-modal-button-secondary[data-v-3e773d7f]{color:#374151;background:#f3f4f6}.markdown-editor-modal-button-secondary[data-v-3e773d7f]:hover{background:#e5e7eb}.markdown-editor-modal-button-primary[data-v-3e773d7f]{color:#fff;background:#3b82f6}.markdown-editor-modal-button-primary[data-v-3e773d7f]:hover{background:#2563eb}.markdown-module-image[data-v-a762fc53]{cursor:pointer;text-align:center;position:relative}.markdown-module-image img[data-v-a762fc53]{max-width:100%;height:auto}.markdown-module-image span[data-v-a762fc53]{color:#6b7280;margin-top:.25rem;font-size:.875rem;display:block}.markdown-module-image-form[data-v-a762fc53]{flex-direction:column;gap:1.25rem;display:flex}.markdown-module-image-form-field[data-v-a762fc53]{flex-direction:column;gap:.5rem;display:flex}.markdown-module-image-form-field label[data-v-a762fc53]{color:#374151;font-size:.875rem;font-weight:500}.markdown-module-image-form-field input[data-v-a762fc53]{color:#111827;background:#fff;border:1px solid #d1d5db;border-radius:.5rem;padding:.625rem .875rem;font-size:.875rem;transition:all .15s}.markdown-module-image-form-field input[data-v-a762fc53]:focus{border-color:#3b82f6;outline:none;box-shadow:0 0 0 3px #3b82f61a}.markdown-module-image-form-field input[data-v-a762fc53]::placeholder{color:#9ca3af}[data-v-a762fc53]{background:0 0;border:none;outline:none}.markdown-editor-module[data-v-
|
|
1
|
+
.markdown-editor-context-menu[data-v-05f519e0]{z-index:1000;background:#fff;border:1px solid #e5e7eb;border-radius:.5rem;gap:.25rem;padding:.25rem;display:flex;position:fixed;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.markdown-editor-context-menu-inline-item[data-v-4e53d049]{cursor:pointer;color:#374151;background:0 0;border:none;border-radius:.375rem;justify-content:center;align-items:center;min-width:2rem;min-height:2rem;padding:.5rem;font-size:.875rem;font-weight:500;transition:all .15s;display:flex}.markdown-editor-context-menu-inline-item[data-v-4e53d049]:hover{background:#f3f4f6}.markdown-editor-context-menu-inline-item.is-active[data-v-4e53d049]{color:#1e40af;background:#dbeafe}.markdown-editor-context-menu-inline-item[data-v-4e53d049]:active{transform:scale(.95)}.markdown-editor-focus-controls[data-v-ce3a9e83]{flex-direction:row;align-items:center;height:100%;display:flex}.markdown-editor-focus-controls .drag-handle[data-v-ce3a9e83]{cursor:grab;-webkit-user-select:none;user-select:none;opacity:.4;padding:0 .2rem;font-size:1rem;line-height:1}.markdown-editor-focus-controls .drag-handle[data-v-ce3a9e83]:active{cursor:grabbing}.markdown-editor-focus-controls .focus-control-btn[data-v-ce3a9e83]{cursor:pointer;opacity:.6;background:0 0;border:none;border-radius:3px;justify-content:center;align-items:center;width:1.4rem;height:1.4rem;padding:0;font-size:.75rem;line-height:1;transition:opacity .1s,background .1s;display:inline-flex}.markdown-editor-focus-controls .focus-control-btn[data-v-ce3a9e83]:hover{opacity:1;background:#00000012}[data-v-aa7529af],[data-v-0d04047d]{background:0 0;border:none;outline:none}.markdown-editor-modal-overlay[data-v-3e773d7f]{z-index:9999;background:#00000080;justify-content:center;align-items:center;padding:1rem;display:flex;position:fixed;inset:0}.markdown-editor-modal[data-v-3e773d7f]{background:#fff;border-radius:.75rem;flex-direction:column;width:100%;max-width:32rem;max-height:90vh;display:flex;box-shadow:0 20px 25px -5px #0000001a,0 10px 10px -5px #0000000a}.markdown-editor-modal-header[data-v-3e773d7f]{border-bottom:1px solid #e5e7eb;justify-content:space-between;align-items:center;padding:1.25rem 1.5rem;display:flex}.markdown-editor-modal-title[data-v-3e773d7f]{color:#111827;margin:0;font-size:1.125rem;font-weight:600}.markdown-editor-modal-close[data-v-3e773d7f]{color:#6b7280;cursor:pointer;background:0 0;border:none;border-radius:.375rem;justify-content:center;align-items:center;width:2rem;height:2rem;padding:0;font-size:1.75rem;line-height:1;transition:all .15s;display:flex}.markdown-editor-modal-close[data-v-3e773d7f]:hover{color:#111827;background:#f3f4f6}.markdown-editor-modal-body[data-v-3e773d7f]{flex:1;padding:1.5rem;overflow-y:auto}.markdown-editor-modal-footer[data-v-3e773d7f]{border-top:1px solid #e5e7eb;justify-content:flex-end;gap:.75rem;padding:1.25rem 1.5rem;display:flex}.markdown-editor-modal-button[data-v-3e773d7f]{cursor:pointer;border:none;border-radius:.5rem;padding:.625rem 1.25rem;font-size:.875rem;font-weight:500;transition:all .15s}.markdown-editor-modal-button[data-v-3e773d7f]:active{transform:scale(.98)}.markdown-editor-modal-button-secondary[data-v-3e773d7f]{color:#374151;background:#f3f4f6}.markdown-editor-modal-button-secondary[data-v-3e773d7f]:hover{background:#e5e7eb}.markdown-editor-modal-button-primary[data-v-3e773d7f]{color:#fff;background:#3b82f6}.markdown-editor-modal-button-primary[data-v-3e773d7f]:hover{background:#2563eb}.markdown-module-image[data-v-a762fc53]{cursor:pointer;text-align:center;position:relative}.markdown-module-image img[data-v-a762fc53]{max-width:100%;height:auto}.markdown-module-image span[data-v-a762fc53]{color:#6b7280;margin-top:.25rem;font-size:.875rem;display:block}.markdown-module-image-form[data-v-a762fc53]{flex-direction:column;gap:1.25rem;display:flex}.markdown-module-image-form-field[data-v-a762fc53]{flex-direction:column;gap:.5rem;display:flex}.markdown-module-image-form-field label[data-v-a762fc53]{color:#374151;font-size:.875rem;font-weight:500}.markdown-module-image-form-field input[data-v-a762fc53]{color:#111827;background:#fff;border:1px solid #d1d5db;border-radius:.5rem;padding:.625rem .875rem;font-size:.875rem;transition:all .15s}.markdown-module-image-form-field input[data-v-a762fc53]:focus{border-color:#3b82f6;outline:none;box-shadow:0 0 0 3px #3b82f61a}.markdown-module-image-form-field input[data-v-a762fc53]::placeholder{color:#9ca3af}[data-v-a762fc53]{background:0 0;border:none;outline:none}[data-v-4cf48f83] .tiptap ul{margin:0;padding-left:1.5rem}.markdown-editor-module[data-v-965b9a8c]{flex-direction:row;display:flex}.markdown-editor-module[data-v-965b9a8c] .tiptap{outline:none}.markdown-editor-module .markdown-editor-module-content[data-v-965b9a8c]{outline:none;width:100%}.markdown-editor-module .markdown-editor-module-controls[data-v-965b9a8c]{visibility:hidden;min-width:5rem;max-width:5rem}.markdown-editor-module[data-v-965b9a8c]:hover{background:#9e95950d}.markdown-editor-module:hover .markdown-editor-module-controls[data-v-965b9a8c],.markdown-editor-module.is-focused .markdown-editor-module-controls[data-v-965b9a8c]{visibility:visible}.markdown-editor-module .markdown-editor-module-content-focused[data-v-965b9a8c]{background-color:#9e95950d}.markdown-editor[data-v-700c129f]{padding-left:6rem}.markdown-editor[data-v-700c129f] p{margin:.5rem 0}.markdown-editor[data-v-700c129f] strong,.markdown-editor[data-v-700c129f] b{font-weight:700}.markdown-editor[data-v-700c129f] em,.markdown-editor[data-v-700c129f] i{font-style:italic}.markdown-editor[data-v-700c129f] code{color:green;background:#7f7f7f26;border-radius:3px;padding:.1em .3em;font-family:monospace;font-size:.9em}.markdown-editor[data-v-700c129f] h1{margin:0;font-size:2em}.markdown-editor[data-v-700c129f] h2{margin:0;font-size:1.5em}.markdown-editor[data-v-700c129f] h3{margin:0;font-size:1.17em}
|
|
2
2
|
/*$vite$:1*/
|