@milkdown/vue 7.5.8 → 7.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/lib/editor.d.ts +3 -0
- package/lib/editor.d.ts.map +1 -0
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.es.js.map +1 -1
- package/lib/types.d.ts +1 -1
- package/lib/types.d.ts.map +1 -1
- package/lib/{useEditor.d.ts → use-editor.d.ts} +1 -1
- package/lib/use-editor.d.ts.map +1 -0
- package/lib/use-get-editor.d.ts +2 -0
- package/lib/use-get-editor.d.ts.map +1 -0
- package/lib/{useInstance.d.ts → use-instance.d.ts} +2 -2
- package/lib/use-instance.d.ts.map +1 -0
- package/package.json +4 -8
- package/src/{Editor.tsx → editor.tsx} +2 -2
- package/src/index.ts +3 -3
- package/src/types.ts +1 -1
- package/src/{useInstance.ts → use-instance.ts} +1 -1
- package/lib/Editor.d.ts +0 -3
- package/lib/Editor.d.ts.map +0 -1
- package/lib/useEditor.d.ts.map +0 -1
- package/lib/useGetEditor.d.ts +0 -2
- package/lib/useGetEditor.d.ts.map +0 -1
- package/lib/useInstance.d.ts.map +0 -1
- /package/src/{useEditor.ts → use-editor.ts} +0 -0
- /package/src/{useGetEditor.ts → use-get-editor.ts} +0 -0
package/lib/editor.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const Milkdown: import("vue").DefineComponent<{}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export declare const MilkdownProvider: import("vue").DefineComponent<{}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
3
|
+
//# sourceMappingURL=editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../src/editor.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,QAAQ,wTAOnB,CAAA;AAEF,eAAO,MAAM,gBAAgB,wTAiB3B,CAAA"}
|
package/lib/index.d.ts
CHANGED
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA"}
|
package/lib/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../src/consts.ts","../src/
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../src/consts.ts","../src/use-get-editor.ts","../src/editor.tsx","../src/use-editor.ts","../src/use-instance.ts"],"sourcesContent":["import type { InjectionKey } from 'vue'\nimport type { EditorInfoCtx } from './types'\n\nexport const editorInfoCtxKey: InjectionKey<EditorInfoCtx> =\n Symbol('editorInfoCtxKey')\n","import { inject, onMounted, onUnmounted } from 'vue'\n\nimport type { EditorInfoCtx } from './types'\nimport { editorInfoCtxKey } from './consts'\n\nexport function useGetEditor() {\n const {\n dom,\n loading,\n editor: editorRef,\n editorFactory: getEditor,\n } = inject(editorInfoCtxKey, {} as EditorInfoCtx)\n\n onMounted(() => {\n if (!dom.value) return\n\n const editor = getEditor.value!(dom.value)\n if (!editor) return\n\n loading.value = true\n editor\n .create()\n .then((editor) => {\n editorRef.value = editor\n })\n .finally(() => {\n loading.value = false\n })\n .catch(console.error)\n })\n onUnmounted(() => {\n editorRef.value?.destroy()\n })\n\n return dom\n}\n","import type { Editor } from '@milkdown/kit/core'\nimport type { Ref } from 'vue'\nimport { Fragment, defineComponent, h, provide, ref } from 'vue'\n\nimport type { GetEditor } from './types'\nimport { useGetEditor } from './use-get-editor'\nimport { editorInfoCtxKey } from './consts'\n\nh\nFragment\n\nexport const Milkdown = defineComponent({\n name: 'Milkdown',\n setup: () => {\n const domRef = useGetEditor()\n\n return () => <div data-milkdown-root ref={domRef} />\n },\n})\n\nexport const MilkdownProvider = defineComponent({\n name: 'MilkdownProvider',\n setup: (_, { slots }) => {\n const dom = ref<HTMLDivElement | null>(null)\n const editorFactory = ref<GetEditor | undefined>(undefined)\n const editor = ref<Editor | undefined>(undefined) as Ref<Editor | undefined>\n const loading = ref(true)\n\n provide(editorInfoCtxKey, {\n loading,\n dom,\n editor,\n editorFactory,\n })\n\n return () => <>{slots.default?.()}</>\n },\n})\n","import { inject } from 'vue'\nimport { editorInfoCtxKey } from './consts'\n\nimport type { GetEditor, UseEditorReturn } from './types'\n\nexport function useEditor(getEditor: GetEditor): UseEditorReturn {\n const { editorFactory, loading, editor } = inject(editorInfoCtxKey)!\n\n editorFactory.value = getEditor\n\n return {\n loading,\n get: () => editor.value,\n }\n}\n","import type { Editor } from '@milkdown/kit/core'\nimport type { Ref } from 'vue'\nimport { inject } from 'vue'\nimport { editorInfoCtxKey } from './consts'\n\nexport type Instance = [Ref<true>, () => undefined] | [Ref<false>, () => Editor]\n\nexport function useInstance(): Instance {\n const editorInfo = inject(editorInfoCtxKey)!\n\n return [editorInfo.loading, () => editorInfo.editor.value] as Instance\n}\n"],"names":["editorInfoCtxKey","useGetEditor","dom","loading","editorRef","getEditor","inject","onMounted","editor","onUnmounted","_a","Milkdown","defineComponent","name","setup","domRef","_createVNode","MilkdownProvider","_","slots","ref","editorFactory","undefined","provide","_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ACF,CAAC,GAEM,MAAA;;AAAAL,aAAAA,EAAAQ,GAAA,MAAA,EAASL,IAAAA,EAAMM,YAANN,gBAAAA,EAAAA,KAAAA,EAAiB,CAAI;AAAA;AAAA,EACvC;AACF,CAAC;AChCM,SAASO,EAAUrB,GAAuC;AAC/D,QAAM,EAAE,eAAAgB,GAAe,SAAAlB,GAAS,QAAAK,EAAO,IAAIF,EAAON,CAAgB;AAElE,SAAAqB,EAAc,QAAQhB,GAEf;AAAA,IACL,SAAAF;AAAA,IACA,KAAK,MAAMK,EAAO;AAAA,EACpB;AACF;ACPO,SAASmB,IAAwB;AAChC,QAAAC,IAAatB,EAAON,CAAgB;AAE1C,SAAO,CAAC4B,EAAW,SAAS,MAAMA,EAAW,OAAO,KAAK;AAC3D;"}
|
package/lib/types.d.ts
CHANGED
package/lib/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE9B,MAAM,MAAM,SAAS,GAAG,CAAC,SAAS,EAAE,cAAc,KAAK,MAAM,CAAA;AAE7D,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IAC/B,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC/B,aAAa,EAAE,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC,CAAA;IACzC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IACrB,GAAG,EAAE,MAAM,MAAM,GAAG,SAAS,CAAA;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-editor.d.ts","sourceRoot":"","sources":["../src/use-editor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEzD,wBAAgB,SAAS,CAAC,SAAS,EAAE,SAAS,GAAG,eAAe,CAS/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-get-editor.d.ts","sourceRoot":"","sources":["../src/use-get-editor.ts"],"names":[],"mappings":"AAKA,wBAAgB,YAAY,oEA8B3B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Editor } from '@milkdown/core';
|
|
1
|
+
import type { Editor } from '@milkdown/kit/core';
|
|
2
2
|
import type { Ref } from 'vue';
|
|
3
3
|
export type Instance = [Ref<true>, () => undefined] | [Ref<false>, () => Editor];
|
|
4
4
|
export declare function useInstance(): Instance;
|
|
5
|
-
//# sourceMappingURL=
|
|
5
|
+
//# sourceMappingURL=use-instance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-instance.d.ts","sourceRoot":"","sources":["../src/use-instance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAI9B,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,MAAM,CAAC,CAAA;AAEhF,wBAAgB,WAAW,IAAI,QAAQ,CAItC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milkdown/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.6.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -26,18 +26,14 @@
|
|
|
26
26
|
"src"
|
|
27
27
|
],
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@milkdown/core": "^7.2.0",
|
|
30
|
-
"@milkdown/prose": "^7.2.0",
|
|
31
29
|
"vue": "^3.0.0"
|
|
32
30
|
},
|
|
33
31
|
"dependencies": {
|
|
34
|
-
"tslib": "^2.
|
|
35
|
-
"@milkdown/
|
|
32
|
+
"tslib": "^2.8.1",
|
|
33
|
+
"@milkdown/kit": "7.6.0"
|
|
36
34
|
},
|
|
37
35
|
"devDependencies": {
|
|
38
|
-
"vue": "^3.3.4"
|
|
39
|
-
"@milkdown/prose": "7.5.8",
|
|
40
|
-
"@milkdown/core": "7.5.8"
|
|
36
|
+
"vue": "^3.3.4"
|
|
41
37
|
},
|
|
42
38
|
"nx": {
|
|
43
39
|
"targets": {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Editor } from '@milkdown/core'
|
|
1
|
+
import type { Editor } from '@milkdown/kit/core'
|
|
2
2
|
import type { Ref } from 'vue'
|
|
3
3
|
import { Fragment, defineComponent, h, provide, ref } from 'vue'
|
|
4
4
|
|
|
5
5
|
import type { GetEditor } from './types'
|
|
6
|
-
import { useGetEditor } from './
|
|
6
|
+
import { useGetEditor } from './use-get-editor'
|
|
7
7
|
import { editorInfoCtxKey } from './consts'
|
|
8
8
|
|
|
9
9
|
h
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './editor'
|
|
2
2
|
export * from './types'
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
3
|
+
export * from './use-editor'
|
|
4
|
+
export * from './use-instance'
|
package/src/types.ts
CHANGED
package/lib/Editor.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare const Milkdown: import("vue").DefineComponent<{}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
2
|
-
export declare const MilkdownProvider: import("vue").DefineComponent<{}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
3
|
-
//# sourceMappingURL=Editor.d.ts.map
|
package/lib/Editor.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Editor.d.ts","sourceRoot":"","sources":["../src/Editor.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,QAAQ,6UAOnB,CAAA;AAEF,eAAO,MAAM,gBAAgB,6UAiB3B,CAAA"}
|
package/lib/useEditor.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useEditor.d.ts","sourceRoot":"","sources":["../src/useEditor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEzD,wBAAgB,SAAS,CAAC,SAAS,EAAE,SAAS,GAAG,eAAe,CAS/D"}
|
package/lib/useGetEditor.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useGetEditor.d.ts","sourceRoot":"","sources":["../src/useGetEditor.ts"],"names":[],"mappings":"AAKA,wBAAgB,YAAY,6CA8B3B"}
|
package/lib/useInstance.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useInstance.d.ts","sourceRoot":"","sources":["../src/useInstance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAI9B,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,MAAM,CAAC,CAAA;AAEhF,wBAAgB,WAAW,IAAI,QAAQ,CAItC"}
|
|
File without changes
|
|
File without changes
|