@prosekit/vue 0.5.1 → 0.6.1
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/{create-component-C3NIgDxm.js → create-component-c9woOlZn.js} +3 -3
- package/dist/{create-component-C3NIgDxm.js.map → create-component-c9woOlZn.js.map} +1 -1
- package/dist/{create-emits-QrQextXf.d.ts → create-emits-DKn_hT7W.d.ts} +2 -2
- package/dist/create-emits-DKn_hT7W.d.ts.map +1 -0
- package/dist/{editor-context-DKYvJpUt.js → editor-context-VOfdNrFa.js} +2 -2
- package/dist/{editor-context-DKYvJpUt.js.map → editor-context-VOfdNrFa.js.map} +1 -1
- package/dist/prosekit-vue-autocomplete.d.ts +1 -1
- package/dist/prosekit-vue-autocomplete.d.ts.map +1 -1
- package/dist/prosekit-vue-autocomplete.js +2 -2
- package/dist/prosekit-vue-block-handle.d.ts +1 -1
- package/dist/prosekit-vue-block-handle.d.ts.map +1 -1
- package/dist/prosekit-vue-block-handle.js +2 -2
- package/dist/prosekit-vue-drop-indicator.d.ts +1 -1
- package/dist/prosekit-vue-drop-indicator.d.ts.map +1 -1
- package/dist/prosekit-vue-drop-indicator.js +2 -2
- package/dist/prosekit-vue-inline-popover.d.ts +1 -1
- package/dist/prosekit-vue-inline-popover.d.ts.map +1 -1
- package/dist/prosekit-vue-inline-popover.js +2 -2
- package/dist/prosekit-vue-popover.d.ts +1 -1
- package/dist/prosekit-vue-popover.d.ts.map +1 -1
- package/dist/prosekit-vue-popover.js +2 -2
- package/dist/prosekit-vue-resizable.d.ts +1 -1
- package/dist/prosekit-vue-resizable.d.ts.map +1 -1
- package/dist/prosekit-vue-resizable.js +2 -2
- package/dist/prosekit-vue-table-handle.d.ts +1 -1
- package/dist/prosekit-vue-table-handle.d.ts.map +1 -1
- package/dist/prosekit-vue-table-handle.js +2 -2
- package/dist/prosekit-vue-tooltip.d.ts +1 -1
- package/dist/prosekit-vue-tooltip.d.ts.map +1 -1
- package/dist/prosekit-vue-tooltip.js +2 -2
- package/dist/prosekit-vue.d.ts +31 -10
- package/dist/prosekit-vue.d.ts.map +1 -1
- package/dist/prosekit-vue.js +38 -26
- package/dist/prosekit-vue.js.map +1 -1
- package/package.json +12 -12
- package/src/hooks/use-editor-derived-value.ts +51 -0
- package/src/hooks/use-extension.ts +1 -1
- package/src/index.ts +4 -0
- package/dist/create-emits-QrQextXf.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEditorContext } from "./editor-context-
|
|
1
|
+
import { n as useEditorContext } from "./editor-context-VOfdNrFa.js";
|
|
2
2
|
import { defineComponent, h, onMounted, ref, watchEffect } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/create-component.ts
|
|
@@ -42,5 +42,5 @@ function createComponent(tagName, displayName, propNames, eventNames) {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
//#endregion
|
|
45
|
-
export { createComponent };
|
|
46
|
-
//# sourceMappingURL=create-component-
|
|
45
|
+
export { createComponent as t };
|
|
46
|
+
//# sourceMappingURL=create-component-c9woOlZn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-component-
|
|
1
|
+
{"version":3,"file":"create-component-c9woOlZn.js","names":["eventHandlers: Record<string, (event: Event) => void>","properties: Record<string, unknown>"],"sources":["../src/components/create-component.ts"],"sourcesContent":["import {\n defineComponent,\n h,\n onMounted,\n ref,\n watchEffect,\n type DefineSetupFnComponent,\n type EmitsOptions,\n type HTMLAttributes,\n} from 'vue'\n\nimport { useEditorContext } from '../injection/editor-context'\n\nexport function createComponent<\n Props extends { [PropName in keyof Props]: unknown },\n Emits extends EmitsOptions,\n>(\n tagName: string,\n displayName: string,\n propNames: string[],\n eventNames: string[],\n): DefineSetupFnComponent<Partial<Props> & HTMLAttributes, Emits> {\n const hasEditor = propNames.includes('editor')\n\n const Component = defineComponent<any, any>(\n (props: Record<string, unknown>, { slots, emit }) => {\n const editor = useEditorContext()\n\n const mounted = ref(false)\n\n onMounted(() => {\n mounted.value = true\n })\n\n const elementRef = ref<HTMLElement | null>(null)\n\n watchEffect((onCleanup) => {\n const element = elementRef.value\n if (!element) return\n\n const eventHandlers: Record<string, (event: Event) => void> = {}\n for (const eventName of eventNames) {\n const extractDetail = eventName.endsWith('Change')\n eventHandlers[eventName] = (event: Event) => {\n emit(\n eventName,\n extractDetail ? (event as CustomEvent).detail : event,\n )\n }\n }\n\n for (const [eventName, handler] of Object.entries(eventHandlers)) {\n element.addEventListener(eventName, handler)\n }\n\n onCleanup(() => {\n for (const [eventName, handler] of Object.entries(eventHandlers)) {\n element.removeEventListener(eventName, handler)\n }\n })\n })\n\n return () => {\n const properties: Record<string, unknown> = {}\n\n for (const [key, value] of Object.entries(props)) {\n if (value !== undefined && !key.startsWith('.')) {\n properties[propNames.includes(key) ? '.' + key : key] = value\n }\n }\n\n // Try to add the editor prop if it's missing.\n if (hasEditor && editor && !properties['editor']) {\n properties.editor = editor\n }\n\n // Ensure web components work after SSR hydration.\n properties.key = mounted.value ? 1 : 0\n\n properties.ref = elementRef\n\n return h(tagName, properties, slots.default?.())\n }\n },\n {\n name: displayName,\n props: propNames,\n emits: eventNames,\n },\n )\n\n return Component\n}\n"],"mappings":";;;;AAaA,SAAgB,gBAId,SACA,aACA,WACA,YACgE;CAChE,MAAM,YAAY,UAAU,SAAS,SAAS;AAqE9C,QAnEkB,iBACf,OAAgC,EAAE,OAAO,WAAW;EACnD,MAAM,SAAS,kBAAkB;EAEjC,MAAM,UAAU,IAAI,MAAM;AAE1B,kBAAgB;AACd,WAAQ,QAAQ;IAChB;EAEF,MAAM,aAAa,IAAwB,KAAK;AAEhD,eAAa,cAAc;GACzB,MAAM,UAAU,WAAW;AAC3B,OAAI,CAAC,QAAS;GAEd,MAAMA,gBAAwD,EAAE;AAChE,QAAK,MAAM,aAAa,YAAY;IAClC,MAAM,gBAAgB,UAAU,SAAS,SAAS;AAClD,kBAAc,cAAc,UAAiB;AAC3C,UACE,WACA,gBAAiB,MAAsB,SAAS,MACjD;;;AAIL,QAAK,MAAM,CAAC,WAAW,YAAY,OAAO,QAAQ,cAAc,CAC9D,SAAQ,iBAAiB,WAAW,QAAQ;AAG9C,mBAAgB;AACd,SAAK,MAAM,CAAC,WAAW,YAAY,OAAO,QAAQ,cAAc,CAC9D,SAAQ,oBAAoB,WAAW,QAAQ;KAEjD;IACF;AAEF,eAAa;GACX,MAAMC,aAAsC,EAAE;AAE9C,QAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,CAC9C,KAAI,UAAU,UAAa,CAAC,IAAI,WAAW,IAAI,CAC7C,YAAW,UAAU,SAAS,IAAI,GAAG,MAAM,MAAM,OAAO;AAK5D,OAAI,aAAa,UAAU,CAAC,WAAW,UACrC,YAAW,SAAS;AAItB,cAAW,MAAM,QAAQ,QAAQ,IAAI;AAErC,cAAW,MAAM;AAEjB,UAAO,EAAE,SAAS,YAAY,MAAM,WAAW,CAAC;;IAGpD;EACE,MAAM;EACN,OAAO;EACP,OAAO;EACR,CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/components/create-emits.d.ts
|
|
2
2
|
type CreateEmits<Events extends { [EventName in keyof Events]: CustomEvent }> = { [EventName in keyof Events]: (event: EventName extends `${string}Change` ? Events[EventName]['detail'] : Events[EventName]) => void };
|
|
3
3
|
//#endregion
|
|
4
|
-
export { CreateEmits };
|
|
5
|
-
//# sourceMappingURL=create-emits-
|
|
4
|
+
export { CreateEmits as t };
|
|
5
|
+
//# sourceMappingURL=create-emits-DKn_hT7W.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-emits-DKn_hT7W.d.ts","names":[],"sources":["../src/components/create-emits.ts"],"sourcesContent":[],"mappings":";KAAY,2CAAW,MACgB,MADhB,GACyB,WADzB,EACgB,CAAA,GAAA,gBAAS,MAE1B,MAF0B,GAAA,CAAA,KAAA,EAGrC,SAHqC,SAAA,GAAA,MAAA,QAAA,GAGC,MAHD,CAGQ,SAHR,CAAA,CAAA,QAAA,CAAA,GAIxC,MAJwC,CAIjC,SAJiC,CAAA,EAAA,GAAA,IAAA,EAE1B"}
|
|
@@ -16,5 +16,5 @@ function useEditorContext() {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
//#endregion
|
|
19
|
-
export {
|
|
20
|
-
//# sourceMappingURL=editor-context-
|
|
19
|
+
export { useEditorContext as n, provideEditor as t };
|
|
20
|
+
//# sourceMappingURL=editor-context-VOfdNrFa.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-context-
|
|
1
|
+
{"version":3,"file":"editor-context-VOfdNrFa.js","names":[],"sources":["../src/injection/editor-context.ts"],"sourcesContent":["import type {\n Editor,\n Extension,\n} from '@prosekit/core'\nimport {\n inject,\n provide,\n type InjectionKey,\n} from 'vue'\n\nconst symbol = Symbol('prosekit-vue-editor-context') as InjectionKey<Editor>\n\n/**\n * @internal\n */\nexport function provideEditor(editor: Editor): void {\n provide(symbol, editor)\n}\n\n/**\n * @internal\n */\nexport function useEditorContext<E extends Extension>(): Editor<E> | undefined {\n return inject(symbol, undefined)\n}\n"],"mappings":";;;AAUA,MAAM,SAAS,OAAO,8BAA8B;;;;AAKpD,SAAgB,cAAc,QAAsB;AAClD,SAAQ,QAAQ,OAAO;;;;;AAMzB,SAAgB,mBAA+D;AAC7E,QAAO,OAAO,QAAQ,OAAU"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateEmits } from "./create-emits-
|
|
1
|
+
import { t as CreateEmits } from "./create-emits-DKn_hT7W.js";
|
|
2
2
|
import { DefineSetupFnComponent, HTMLAttributes } from "vue";
|
|
3
3
|
import { AutocompleteEmptyEvents, AutocompleteEmptyProps as AutocompleteEmptyProps$1, AutocompleteItemEvents, AutocompleteItemProps as AutocompleteItemProps$1, AutocompleteListEvents, AutocompleteListProps as AutocompleteListProps$1, AutocompletePopoverEvents, AutocompletePopoverProps as AutocompletePopoverProps$1 } from "@prosekit/web/autocomplete";
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-vue-autocomplete.d.ts","names":[],"sources":["../src/components/autocomplete/autocomplete-empty.gen.ts","../src/components/autocomplete/autocomplete-item.gen.ts","../src/components/autocomplete/autocomplete-list.gen.ts","../src/components/autocomplete/autocomplete-popover.gen.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAcA;
|
|
1
|
+
{"version":3,"file":"prosekit-vue-autocomplete.d.ts","names":[],"sources":["../src/components/autocomplete/autocomplete-empty.gen.ts","../src/components/autocomplete/autocomplete-item.gen.ts","../src/components/autocomplete/autocomplete-list.gen.ts","../src/components/autocomplete/autocomplete-popover.gen.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAcA;AAKiB,UALA,sBAAA,SAA+B,OAKY,CALJ,wBAKI,CAAA,CAAA,CAE5D;;;;AAAgC,UAFf,sBAAA,SAA+B,WAEhB,CAF4B,uBAE5B,CAAA,CAAA;cAAnB,mBAAmB,uBAC9B,yBAAyB,gBACzB;;;;;AATF;AAKiB,UCLA,qBAAA,SAA8B,ODKa,CCLL,uBDKK,CAAA,CAAA,CAE5D;;;;AAAgC,UCFf,qBAAA,SAA8B,WDEf,CCF2B,sBDE3B,CAAA,CAAA;cCAnB,kBAAkB,uBAC7B,wBAAwB,gBACxB;;;;;ADTF;AAKiB,UELA,qBAAA,SAA8B,OFKa,CELL,uBFKK,CAAA,CAAA,CAE5D;;;;AAAgC,UEFf,qBAAA,SAA8B,WFEf,CEF2B,sBFE3B,CAAA,CAAA;cEAnB,kBAAkB,uBAC7B,wBAAwB,gBACxB;;;;;AFTF;AAKiB,UGLA,wBAAA,SAAiC,OHKU,CGLF,0BHKE,CAAA,CAAA,CAE5D;;;;AAAgC,UGFf,wBAAA,SAAiC,WHElB,CGF8B,yBHE9B,CAAA,CAAA;cGAnB,qBAAqB,uBAChC,2BAA2B,gBAC3B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./editor-context-
|
|
2
|
-
import { createComponent } from "./create-component-
|
|
1
|
+
import "./editor-context-VOfdNrFa.js";
|
|
2
|
+
import { t as createComponent } from "./create-component-c9woOlZn.js";
|
|
3
3
|
import { autocompleteEmptyEvents, autocompleteEmptyProps, autocompleteItemEvents, autocompleteItemProps, autocompleteListEvents, autocompleteListProps, autocompletePopoverEvents, autocompletePopoverProps } from "@prosekit/web/autocomplete";
|
|
4
4
|
|
|
5
5
|
//#region src/components/autocomplete/autocomplete-empty.gen.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateEmits } from "./create-emits-
|
|
1
|
+
import { t as CreateEmits } from "./create-emits-DKn_hT7W.js";
|
|
2
2
|
import { DefineSetupFnComponent, HTMLAttributes } from "vue";
|
|
3
3
|
import { BlockHandleAddEvents, BlockHandleAddProps as BlockHandleAddProps$1, BlockHandleDraggableEvents, BlockHandleDraggableProps as BlockHandleDraggableProps$1, BlockHandlePopoverEvents, BlockHandlePopoverProps as BlockHandlePopoverProps$1 } from "@prosekit/web/block-handle";
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-vue-block-handle.d.ts","names":[],"sources":["../src/components/block-handle/block-handle-add.gen.ts","../src/components/block-handle/block-handle-draggable.gen.ts","../src/components/block-handle/block-handle-popover.gen.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAcA;
|
|
1
|
+
{"version":3,"file":"prosekit-vue-block-handle.d.ts","names":[],"sources":["../src/components/block-handle/block-handle-add.gen.ts","../src/components/block-handle/block-handle-draggable.gen.ts","../src/components/block-handle/block-handle-popover.gen.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAcA;AAKiB,UALA,mBAAA,SAA4B,OAKY,CALJ,qBAKI,CAAZ,CAAA,CAE7C;;;;AAA6B,UAFZ,mBAAA,SAA4B,WAEhB,CAF4B,oBAE5B,CAAA,CAAA;cAAhB,gBAAgB,uBAC3B,sBAAsB,gBACtB;;;;;AATF;AAKiB,UCLA,yBAAA,SAAkC,ODKM,CCLE,2BDKd,CAAA,CAAA,CAE7C;;;;AAA6B,UCFZ,yBAAA,SAAkC,WDEtB,CCFkC,0BDElC,CAAA,CAAA;cCAhB,sBAAsB,uBACjC,4BAA4B,gBAC5B;;;;;ADTF;AAKiB,UELA,uBAAA,SAAgC,OFKQ,CELA,yBFKZ,CAAA,CAAA,CAE7C;;;;AAA6B,UEFZ,uBAAA,SAAgC,WFEpB,CEFgC,wBFEhC,CAAA,CAAA;cEAhB,oBAAoB,uBAC/B,0BAA0B,gBAC1B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./editor-context-
|
|
2
|
-
import { createComponent } from "./create-component-
|
|
1
|
+
import "./editor-context-VOfdNrFa.js";
|
|
2
|
+
import { t as createComponent } from "./create-component-c9woOlZn.js";
|
|
3
3
|
import { blockHandleAddEvents, blockHandleAddProps, blockHandleDraggableEvents, blockHandleDraggableProps, blockHandlePopoverEvents, blockHandlePopoverProps } from "@prosekit/web/block-handle";
|
|
4
4
|
|
|
5
5
|
//#region src/components/block-handle/block-handle-add.gen.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateEmits } from "./create-emits-
|
|
1
|
+
import { t as CreateEmits } from "./create-emits-DKn_hT7W.js";
|
|
2
2
|
import { DefineSetupFnComponent, HTMLAttributes } from "vue";
|
|
3
3
|
import { DropIndicatorEvents, DropIndicatorProps as DropIndicatorProps$1 } from "@prosekit/web/drop-indicator";
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-vue-drop-indicator.d.ts","names":[],"sources":["../src/components/drop-indicator/drop-indicator.gen.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAcA;
|
|
1
|
+
{"version":3,"file":"prosekit-vue-drop-indicator.d.ts","names":[],"sources":["../src/components/drop-indicator/drop-indicator.gen.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAcA;AAKiB,UALA,kBAAA,SAA2B,OAKY,CALJ,oBAKI,CAAZ,CAAA,CAE5C;;;;AAA4B,UAFX,kBAAA,SAA2B,WAEhB,CAF4B,mBAE5B,CAAA,CAAA;cAAf,eAAe,uBAC1B,qBAAqB,gBACrB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./editor-context-
|
|
2
|
-
import { createComponent } from "./create-component-
|
|
1
|
+
import "./editor-context-VOfdNrFa.js";
|
|
2
|
+
import { t as createComponent } from "./create-component-c9woOlZn.js";
|
|
3
3
|
import { dropIndicatorEvents, dropIndicatorProps } from "@prosekit/web/drop-indicator";
|
|
4
4
|
|
|
5
5
|
//#region src/components/drop-indicator/drop-indicator.gen.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateEmits } from "./create-emits-
|
|
1
|
+
import { t as CreateEmits } from "./create-emits-DKn_hT7W.js";
|
|
2
2
|
import { DefineSetupFnComponent, HTMLAttributes } from "vue";
|
|
3
3
|
import { InlinePopoverEvents, InlinePopoverProps as InlinePopoverProps$1 } from "@prosekit/web/inline-popover";
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-vue-inline-popover.d.ts","names":[],"sources":["../src/components/inline-popover/inline-popover.gen.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAcA;
|
|
1
|
+
{"version":3,"file":"prosekit-vue-inline-popover.d.ts","names":[],"sources":["../src/components/inline-popover/inline-popover.gen.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAcA;AAKiB,UALA,kBAAA,SAA2B,OAKY,CALJ,oBAKI,CAAZ,CAAA,CAE5C;;;;AAA4B,UAFX,kBAAA,SAA2B,WAEhB,CAF4B,mBAE5B,CAAA,CAAA;cAAf,eAAe,uBAC1B,qBAAqB,gBACrB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./editor-context-
|
|
2
|
-
import { createComponent } from "./create-component-
|
|
1
|
+
import "./editor-context-VOfdNrFa.js";
|
|
2
|
+
import { t as createComponent } from "./create-component-c9woOlZn.js";
|
|
3
3
|
import { inlinePopoverEvents, inlinePopoverProps } from "@prosekit/web/inline-popover";
|
|
4
4
|
|
|
5
5
|
//#region src/components/inline-popover/inline-popover.gen.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateEmits } from "./create-emits-
|
|
1
|
+
import { t as CreateEmits } from "./create-emits-DKn_hT7W.js";
|
|
2
2
|
import { DefineSetupFnComponent, HTMLAttributes } from "vue";
|
|
3
3
|
import { PopoverContentEvents, PopoverContentProps as PopoverContentProps$1, PopoverRootEvents, PopoverRootProps as PopoverRootProps$1, PopoverTriggerEvents, PopoverTriggerProps as PopoverTriggerProps$1 } from "@prosekit/web/popover";
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-vue-popover.d.ts","names":[],"sources":["../src/components/popover/popover-content.gen.ts","../src/components/popover/popover-root.gen.ts","../src/components/popover/popover-trigger.gen.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAcA;
|
|
1
|
+
{"version":3,"file":"prosekit-vue-popover.d.ts","names":[],"sources":["../src/components/popover/popover-content.gen.ts","../src/components/popover/popover-root.gen.ts","../src/components/popover/popover-trigger.gen.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAcA;AAKiB,UALA,mBAAA,SAA4B,OAKY,CALJ,qBAKI,CAAA,CAAZ,CAE7C;;;;AAA6B,UAFZ,mBAAA,SAA4B,WAEhB,CAF4B,oBAE5B,CAAA,CAAA;cAAhB,gBAAgB,uBAC3B,sBAAsB,gBACtB;;;;;AATF;AAKiB,UCLA,gBAAA,SAAyB,ODKe,CCLP,kBDKO,CAAA,CAAA,CAEzD;;;;AAA6B,UCFZ,gBAAA,SAAyB,WDEb,CCFyB,iBDEzB,CAAA,CAAA;cCAhB,aAAa,uBACxB,mBAAmB,gBACnB;;;;;ADTF;AAKiB,UELA,mBAAA,SAA4B,OFKY,CELJ,qBFKI,CAAA,CAAZ,CAE7C;;;;AAA6B,UEFZ,mBAAA,SAA4B,WFEhB,CEF4B,oBFE5B,CAAA,CAAA;cEAhB,gBAAgB,uBAC3B,sBAAsB,gBACtB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./editor-context-
|
|
2
|
-
import { createComponent } from "./create-component-
|
|
1
|
+
import "./editor-context-VOfdNrFa.js";
|
|
2
|
+
import { t as createComponent } from "./create-component-c9woOlZn.js";
|
|
3
3
|
import { popoverContentEvents, popoverContentProps, popoverRootEvents, popoverRootProps, popoverTriggerEvents, popoverTriggerProps } from "@prosekit/web/popover";
|
|
4
4
|
|
|
5
5
|
//#region src/components/popover/popover-content.gen.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateEmits } from "./create-emits-
|
|
1
|
+
import { t as CreateEmits } from "./create-emits-DKn_hT7W.js";
|
|
2
2
|
import { DefineSetupFnComponent, HTMLAttributes } from "vue";
|
|
3
3
|
import { ResizableHandleEvents, ResizableHandleProps as ResizableHandleProps$1, ResizableRootEvents, ResizableRootProps as ResizableRootProps$1 } from "@prosekit/web/resizable";
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-vue-resizable.d.ts","names":[],"sources":["../src/components/resizable/resizable-handle.gen.ts","../src/components/resizable/resizable-root.gen.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAcA;
|
|
1
|
+
{"version":3,"file":"prosekit-vue-resizable.d.ts","names":[],"sources":["../src/components/resizable/resizable-handle.gen.ts","../src/components/resizable/resizable-root.gen.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAcA;AAKiB,UALA,oBAAA,SAA6B,OAKY,CALJ,sBAKI,CAAA,CAAA,CAE1D;;;;AAA8B,UAFb,oBAAA,SAA6B,WAEhB,CAF4B,qBAE5B,CAAA,CAAA;cAAjB,iBAAiB,uBAC5B,uBAAuB,gBACvB;;;;;AATF;AAKiB,UCLA,kBAAA,SAA2B,ODKc,CCLN,oBDKM,CAAA,CAAA,CAE1D;;;;AAA8B,UCFb,kBAAA,SAA2B,WDEd,CCF0B,mBDE1B,CAAA,CAAA;cCAjB,eAAe,uBAC1B,qBAAqB,gBACrB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./editor-context-
|
|
2
|
-
import { createComponent } from "./create-component-
|
|
1
|
+
import "./editor-context-VOfdNrFa.js";
|
|
2
|
+
import { t as createComponent } from "./create-component-c9woOlZn.js";
|
|
3
3
|
import { resizableHandleEvents, resizableHandleProps, resizableRootEvents, resizableRootProps } from "@prosekit/web/resizable";
|
|
4
4
|
|
|
5
5
|
//#region src/components/resizable/resizable-handle.gen.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateEmits } from "./create-emits-
|
|
1
|
+
import { t as CreateEmits } from "./create-emits-DKn_hT7W.js";
|
|
2
2
|
import { DefineSetupFnComponent, HTMLAttributes } from "vue";
|
|
3
3
|
import { TableHandleColumnRootEvents, TableHandleColumnRootProps as TableHandleColumnRootProps$1, TableHandleColumnTriggerEvents, TableHandleColumnTriggerProps as TableHandleColumnTriggerProps$1, TableHandleDragPreviewEvents, TableHandleDragPreviewProps as TableHandleDragPreviewProps$1, TableHandleDropIndicatorEvents, TableHandleDropIndicatorProps as TableHandleDropIndicatorProps$1, TableHandlePopoverContentEvents, TableHandlePopoverContentProps as TableHandlePopoverContentProps$1, TableHandlePopoverItemEvents, TableHandlePopoverItemProps as TableHandlePopoverItemProps$1, TableHandleRootEvents, TableHandleRootProps as TableHandleRootProps$1, TableHandleRowRootEvents, TableHandleRowRootProps as TableHandleRowRootProps$1, TableHandleRowTriggerEvents, TableHandleRowTriggerProps as TableHandleRowTriggerProps$1 } from "@prosekit/web/table-handle";
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-vue-table-handle.d.ts","names":[],"sources":["../src/components/table-handle/table-handle-column-root.gen.ts","../src/components/table-handle/table-handle-column-trigger.gen.ts","../src/components/table-handle/table-handle-drag-preview.gen.ts","../src/components/table-handle/table-handle-drop-indicator.gen.ts","../src/components/table-handle/table-handle-popover-content.gen.ts","../src/components/table-handle/table-handle-popover-item.gen.ts","../src/components/table-handle/table-handle-root.gen.ts","../src/components/table-handle/table-handle-row-root.gen.ts","../src/components/table-handle/table-handle-row-trigger.gen.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAcA;
|
|
1
|
+
{"version":3,"file":"prosekit-vue-table-handle.d.ts","names":[],"sources":["../src/components/table-handle/table-handle-column-root.gen.ts","../src/components/table-handle/table-handle-column-trigger.gen.ts","../src/components/table-handle/table-handle-drag-preview.gen.ts","../src/components/table-handle/table-handle-drop-indicator.gen.ts","../src/components/table-handle/table-handle-popover-content.gen.ts","../src/components/table-handle/table-handle-popover-item.gen.ts","../src/components/table-handle/table-handle-root.gen.ts","../src/components/table-handle/table-handle-row-root.gen.ts","../src/components/table-handle/table-handle-row-trigger.gen.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAcA;AAKiB,UALA,0BAAA,SAAmC,OAKY,CALJ,4BAKI,CAAA,CAAA,CAEhE;;;;AAAoC,UAFnB,0BAAA,SAAmC,WAEhB,CAF4B,2BAE5B,CAAA,CAAA;cAAvB,uBAAuB,uBAClC,6BAA6B,gBAC7B;;;;;AATF;AAKiB,UCLA,6BAAA,SAAsC,ODKS,CCLD,+BDKC,CAAA,CAAA,CAEhE;;;;AAAoC,UCFnB,6BAAA,SAAsC,WDEnB,CCF+B,8BDE/B,CAAA,CAAA;cCAvB,0BAA0B,uBACrC,gCAAgC,gBAChC;;;;;ADTF;AAKiB,UELA,2BAAA,SAAoC,OFKW,CELH,6BFKG,CAAA,CAAA,CAEhE;;;;AAAoC,UEFnB,2BAAA,SAAoC,WFEjB,CEF6B,4BFE7B,CAAA,CAAA;cEAvB,wBAAwB,uBACnC,8BAA8B,gBAC9B;;;;;AFTF;AAKiB,UGLA,6BAAA,SAAsC,OHKS,CGLD,+BHKC,CAAA,CAAA,CAEhE;;;;AAAoC,UGFnB,6BAAA,SAAsC,WHEnB,CGF+B,8BHE/B,CAAA,CAAA;cGAvB,0BAA0B,uBACrC,gCAAgC,gBAChC;;;;;AHTF;AAKiB,UILA,8BAAA,SAAuC,OJKQ,CILA,gCJKA,CAAA,CAAA,CAEhE;;;;AAAoC,UIFnB,8BAAA,SAAuC,WJEpB,CIFgC,+BJEhC,CAAA,CAAA;cIAvB,2BAA2B,uBACtC,iCAAiC,gBACjC;;;;;AJTF;AAKiB,UKLA,2BAAA,SAAoC,OLKW,CKLH,6BLKG,CAAA,CAAA,CAEhE;;;;AAAoC,UKFnB,2BAAA,SAAoC,WLEjB,CKF6B,4BLE7B,CAAA,CAAA;cKAvB,wBAAwB,uBACnC,8BAA8B,gBAC9B;;;;;ALTF;AAKiB,UMLA,oBAAA,SAA6B,ONKkB,CMLV,sBNKU,CAAA,CAAA,CAEhE;;;;AAAoC,UMFnB,oBAAA,SAA6B,WNEV,CMFsB,qBNEtB,CAAA,CAAA;cMAvB,iBAAiB,uBAC5B,uBAAuB,gBACvB;;;;;ANTF;AAKiB,UOLA,uBAAA,SAAgC,OPKe,COLP,yBPKO,CAAA,CAAA,CAEhE;;;;AAAoC,UOFnB,uBAAA,SAAgC,WPEb,COFyB,wBPEzB,CAAA,CAAA;cOAvB,oBAAoB,uBAC/B,0BAA0B,gBAC1B;;;;;APTF;AAKiB,UQLA,0BAAA,SAAmC,ORKY,CQLJ,4BRKI,CAAA,CAAA,CAEhE;;;;AAAoC,UQFnB,0BAAA,SAAmC,WREhB,CQF4B,2BRE5B,CAAA,CAAA;cQAvB,uBAAuB,uBAClC,6BAA6B,gBAC7B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./editor-context-
|
|
2
|
-
import { createComponent } from "./create-component-
|
|
1
|
+
import "./editor-context-VOfdNrFa.js";
|
|
2
|
+
import { t as createComponent } from "./create-component-c9woOlZn.js";
|
|
3
3
|
import { tableHandleColumnRootEvents, tableHandleColumnRootProps, tableHandleColumnTriggerEvents, tableHandleColumnTriggerProps, tableHandleDragPreviewEvents, tableHandleDragPreviewProps, tableHandleDropIndicatorEvents, tableHandleDropIndicatorProps, tableHandlePopoverContentEvents, tableHandlePopoverContentProps, tableHandlePopoverItemEvents, tableHandlePopoverItemProps, tableHandleRootEvents, tableHandleRootProps, tableHandleRowRootEvents, tableHandleRowRootProps, tableHandleRowTriggerEvents, tableHandleRowTriggerProps } from "@prosekit/web/table-handle";
|
|
4
4
|
|
|
5
5
|
//#region src/components/table-handle/table-handle-column-root.gen.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateEmits } from "./create-emits-
|
|
1
|
+
import { t as CreateEmits } from "./create-emits-DKn_hT7W.js";
|
|
2
2
|
import { DefineSetupFnComponent, HTMLAttributes } from "vue";
|
|
3
3
|
import { TooltipContentEvents, TooltipContentProps as TooltipContentProps$1, TooltipRootEvents, TooltipRootProps as TooltipRootProps$1, TooltipTriggerEvents, TooltipTriggerProps as TooltipTriggerProps$1 } from "@prosekit/web/tooltip";
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-vue-tooltip.d.ts","names":[],"sources":["../src/components/tooltip/tooltip-content.gen.ts","../src/components/tooltip/tooltip-root.gen.ts","../src/components/tooltip/tooltip-trigger.gen.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAcA;
|
|
1
|
+
{"version":3,"file":"prosekit-vue-tooltip.d.ts","names":[],"sources":["../src/components/tooltip/tooltip-content.gen.ts","../src/components/tooltip/tooltip-root.gen.ts","../src/components/tooltip/tooltip-trigger.gen.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAcA;AAKiB,UALA,mBAAA,SAA4B,OAKY,CALJ,qBAKI,CAAA,CAAZ,CAE7C;;;;AAA6B,UAFZ,mBAAA,SAA4B,WAEhB,CAF4B,oBAE5B,CAAA,CAAA;cAAhB,gBAAgB,uBAC3B,sBAAsB,gBACtB;;;;;AATF;AAKiB,UCLA,gBAAA,SAAyB,ODKe,CCLP,kBDKO,CAAA,CAAA,CAEzD;;;;AAA6B,UCFZ,gBAAA,SAAyB,WDEb,CCFyB,iBDEzB,CAAA,CAAA;cCAhB,aAAa,uBACxB,mBAAmB,gBACnB;;;;;ADTF;AAKiB,UELA,mBAAA,SAA4B,OFKY,CELJ,qBFKI,CAAA,CAAZ,CAE7C;;;;AAA6B,UEFZ,mBAAA,SAA4B,WFEhB,CEF4B,oBFE5B,CAAA,CAAA;cEAhB,gBAAgB,uBAC3B,sBAAsB,gBACtB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./editor-context-
|
|
2
|
-
import { createComponent } from "./create-component-
|
|
1
|
+
import "./editor-context-VOfdNrFa.js";
|
|
2
|
+
import { t as createComponent } from "./create-component-c9woOlZn.js";
|
|
3
3
|
import { tooltipContentEvents, tooltipContentProps, tooltipRootEvents, tooltipRootProps, tooltipTriggerEvents, tooltipTriggerProps } from "@prosekit/web/tooltip";
|
|
4
4
|
|
|
5
5
|
//#region src/components/tooltip/tooltip-content.gen.ts
|
package/dist/prosekit-vue.d.ts
CHANGED
|
@@ -36,10 +36,6 @@ interface VueMarkViewOptions extends CoreMarkViewUserOptions<VueMarkViewComponen
|
|
|
36
36
|
*/
|
|
37
37
|
name: string;
|
|
38
38
|
}
|
|
39
|
-
/**
|
|
40
|
-
* @internal
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
39
|
/**
|
|
44
40
|
* Defines a mark view using a Vue component.
|
|
45
41
|
*
|
|
@@ -67,10 +63,6 @@ interface VueNodeViewOptions extends CoreNodeViewUserOptions<VueNodeViewComponen
|
|
|
67
63
|
*/
|
|
68
64
|
name: string;
|
|
69
65
|
}
|
|
70
|
-
/**
|
|
71
|
-
* @internal
|
|
72
|
-
*/
|
|
73
|
-
|
|
74
66
|
/**
|
|
75
67
|
* Defines a node view using a Vue component.
|
|
76
68
|
*
|
|
@@ -82,7 +74,7 @@ declare function defineVueNodeView(options: VueNodeViewOptions): Extension;
|
|
|
82
74
|
interface UseExtensionOptions {
|
|
83
75
|
/**
|
|
84
76
|
* The editor to add the extension to. If not provided, it will use the
|
|
85
|
-
* editor from the nearest
|
|
77
|
+
* editor from the nearest `<ProseKit>` component.
|
|
86
78
|
*/
|
|
87
79
|
editor?: MaybeRefOrGetter<Editor>;
|
|
88
80
|
/**
|
|
@@ -126,6 +118,35 @@ declare function useEditor<E extends Extension = any>(options?: {
|
|
|
126
118
|
update?: boolean;
|
|
127
119
|
}): ShallowRef<Editor<E>>;
|
|
128
120
|
//#endregion
|
|
121
|
+
//#region src/hooks/use-editor-derived-value.d.ts
|
|
122
|
+
interface UseEditorDerivedOptions<E extends Extension = any> {
|
|
123
|
+
/**
|
|
124
|
+
* The editor to add the extension to. If not provided, it will use the
|
|
125
|
+
* editor from the nearest `<ProseKit>` component.
|
|
126
|
+
*/
|
|
127
|
+
editor?: MaybeRefOrGetter<Editor<E>>;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Runs a function to derive a value from the editor instance after editor state
|
|
131
|
+
* changes.
|
|
132
|
+
*
|
|
133
|
+
* This is useful when you need to render something based on the editor state,
|
|
134
|
+
* for example, whether the selected text is wrapped in an italic mark.
|
|
135
|
+
*
|
|
136
|
+
* It returns a shallow ref of the derived value that updates whenever the editor
|
|
137
|
+
* state changes.
|
|
138
|
+
*
|
|
139
|
+
* @public
|
|
140
|
+
*/
|
|
141
|
+
declare function useEditorDerivedValue<E extends Extension, Derived>(
|
|
142
|
+
/**
|
|
143
|
+
* A function that receives the editor instance and returns a derived value.
|
|
144
|
+
*
|
|
145
|
+
* It will be called whenever the editor's document state changes, or when it
|
|
146
|
+
* mounts.
|
|
147
|
+
*/
|
|
148
|
+
derive: (editor: Editor<E>) => Derived, options?: UseEditorDerivedOptions<E>): ShallowRef<Derived>;
|
|
149
|
+
//#endregion
|
|
129
150
|
//#region src/hooks/use-keymap.d.ts
|
|
130
151
|
declare function useKeymap(keymap: MaybeRefOrGetter<Keymap>, options?: UseExtensionOptions): void;
|
|
131
152
|
//#endregion
|
|
@@ -137,5 +158,5 @@ declare function useKeymap(keymap: MaybeRefOrGetter<Keymap>, options?: UseExtens
|
|
|
137
158
|
*/
|
|
138
159
|
declare function useStateUpdate(handler: (state: EditorState) => void, options?: UseExtensionOptions): void;
|
|
139
160
|
//#endregion
|
|
140
|
-
export { ProseKit, type ProseKitProps, type UseExtensionOptions, type VueMarkViewComponent, type VueMarkViewOptions, type VueMarkViewProps, type VueNodeViewComponent, type VueNodeViewOptions, type VueNodeViewProps, defineVueMarkView, defineVueNodeView, useDocChange, useEditor, useExtension, useKeymap, useStateUpdate };
|
|
161
|
+
export { ProseKit, type ProseKitProps, type UseEditorDerivedOptions, type UseExtensionOptions, type VueMarkViewComponent, type VueMarkViewOptions, type VueMarkViewProps, type VueNodeViewComponent, type VueNodeViewOptions, type VueNodeViewProps, defineVueMarkView, defineVueNodeView, useDocChange, useEditor, useEditorDerivedValue, useExtension, useKeymap, useStateUpdate };
|
|
141
162
|
//# sourceMappingURL=prosekit-vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-vue.d.ts","names":[],"sources":["../src/components/prosekit.ts","../src/extensions/vue-mark-view.ts","../src/extensions/vue-node-view.ts","../src/hooks/use-extension.ts","../src/hooks/use-doc-change.ts","../src/hooks/use-editor.ts","../src/hooks/use-keymap.ts","../src/hooks/use-state-update.ts"],"sourcesContent":[],"mappings":";;;;;;;;UAaiB,aAAA;UACP;;;;;AADV;AASA;
|
|
1
|
+
{"version":3,"file":"prosekit-vue.d.ts","names":[],"sources":["../src/components/prosekit.ts","../src/extensions/vue-mark-view.ts","../src/extensions/vue-node-view.ts","../src/hooks/use-extension.ts","../src/hooks/use-doc-change.ts","../src/hooks/use-editor.ts","../src/hooks/use-editor-derived-value.ts","../src/hooks/use-keymap.ts","../src/hooks/use-state-update.ts"],"sourcesContent":[],"mappings":";;;;;;;;UAaiB,aAAA;UACP;;;;;AADV;AASA;cAAa,UAAU,uBAAuB;;;;;;UCI7B,gBAAA,SAAyB,iBDb1C;AASA;;;KCSY,oBAAA,GAAuB,gBAAgB;AALnD;AAKA;AAOA;AAqCA;;UArCiB,kBAAA,SAA2B,wBAAwB;;ACZpE;AAKA;EAOiB,IAAA,EAAA,MAAA;AAqCjB;;;;;AC/CA;AAK8B,iBF0Cd,iBAAA,CE1Cc,OAAA,EF0Ca,kBE1Cb,CAAA,EF0CkC,SE1ClC;;;;;;UDPb,gBAAA,SAAyB,iBFb1C;AASA;;;KESY,oBAAA,GAAuB,gBAAgB;ADLnD;AAKA;AAOA;AAqCA;;UCrCiB,kBAAA,SAA2B,wBAAwB;;AAZpE;AAKA;EAOiB,IAAA,EAAA,MAAA;AAqCjB;;;;;AC/CA;AAK8B,iBD0Cd,iBAAA,CC1Cc,OAAA,ED0Ca,kBC1Cb,CAAA,ED0CkC,SC1ClC;;;UAvBb,mBAAA;;;;;WAKN,iBAAiB;EHFX;AASjB;;aGFa;;AFMb;AAKA;AAOA;AAqCA;;iBE/CgB,YAAA;;ADFhB;AAKA;AAOA;AAqCA,SAAgB,EC1CH,gBD0CoB,CC1CH,SD0Ca,GAAA,IAAA,CAAA,EAAA,OAA8B,CAA9B,ECzC/B,mBDyC6D,CAAA,EAAA,IAAA;;;;;;;;iBE9DzD,YAAA,gBACC,oCACL;;;;;;;;iBCQI,oBAAoB,wBJepC;EDzBiB;AASjB;;;;ACIA;EAKY,MAAA,CAAA,EAAA,OAAA;AAOZ,CAAA,CAAA,EIPI,UJOa,CIPF,MJOE,CIPK,CJOL,CAAA,CAAmB;;;UKxBnB,kCAAkC;;;;;WAKxC,iBAAiB,OAAO;ANNnC;AASA;;;;ACIA;AAKA;AAOA;AAqCA;;;;ACjDA;AAKY,iBIGI,qBJHmC,CAAA,UIGH,SJHb,EAAA,OAAe,CAAA;AAOlD;AAqCA;;;;ACjEA;MAK4B,EAAA,CAAA,MAAA,EG0BT,MH1BS,CG0BF,CH1BE,CAAA,EAAA,GG0BK,OH1BL,EAAA,OAAA,CAAA,EG2BhB,uBH3BgB,CG2BQ,CH3BR,CAAA,CAAA,EG4BzB,UH5ByB,CG4Bd,OH5Bc,CAAA;;;iBIAZ,SAAA,SACN,iBAAiB,mBACf;;;;;;;;iBCJI,cAAA,kBACG,gCACP"}
|
package/dist/prosekit-vue.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as useEditorContext, t as provideEditor } from "./editor-context-VOfdNrFa.js";
|
|
2
2
|
import { ProsemirrorAdapterProvider, useMarkViewContext, useMarkViewFactory, useNodeViewContext, useNodeViewFactory } from "@prosemirror-adapter/vue";
|
|
3
3
|
import { computed, defineComponent, h, onMounted, onUnmounted, shallowRef, toValue, triggerRef, watchPostEffect } from "vue";
|
|
4
4
|
import { EditorNotFoundError, ProseKitError, defineDocChangeHandler, defineKeymap, defineMarkViewComponent, defineMarkViewFactory, defineMountHandler, defineNodeViewComponent, defineNodeViewFactory, defineUpdateHandler, union, withPriority } from "@prosekit/core";
|
|
@@ -58,10 +58,9 @@ const VueMarkViewsConsumer = /* @__PURE__ */ defineComponent({
|
|
|
58
58
|
name: "VueMarkViewsConsumer",
|
|
59
59
|
setup: () => {
|
|
60
60
|
const markViewFactory = useMarkViewFactory();
|
|
61
|
-
|
|
61
|
+
useExtension(computed(() => {
|
|
62
62
|
return defineVueMarkViewFactory(markViewFactory);
|
|
63
|
-
});
|
|
64
|
-
useExtension(extension);
|
|
63
|
+
}));
|
|
65
64
|
return () => null;
|
|
66
65
|
}
|
|
67
66
|
});
|
|
@@ -72,14 +71,13 @@ const VueMarkViewsConsumer = /* @__PURE__ */ defineComponent({
|
|
|
72
71
|
*/
|
|
73
72
|
function defineVueMarkView(options) {
|
|
74
73
|
const { name, component,...userOptions } = options;
|
|
75
|
-
const args = {
|
|
76
|
-
...userOptions,
|
|
77
|
-
component: withMarkViewProps(component)
|
|
78
|
-
};
|
|
79
74
|
return defineMarkViewComponent({
|
|
80
75
|
group: "vue",
|
|
81
76
|
name,
|
|
82
|
-
args
|
|
77
|
+
args: {
|
|
78
|
+
...userOptions,
|
|
79
|
+
component: withMarkViewProps(component)
|
|
80
|
+
}
|
|
83
81
|
});
|
|
84
82
|
}
|
|
85
83
|
function defineVueMarkViewFactory(factory) {
|
|
@@ -107,10 +105,9 @@ const VueNodeViewsConsumer = /* @__PURE__ */ defineComponent({
|
|
|
107
105
|
name: "VueNodeViewsConsumer",
|
|
108
106
|
setup: () => {
|
|
109
107
|
const nodeViewFactory = useNodeViewFactory();
|
|
110
|
-
|
|
108
|
+
useExtension(computed(() => {
|
|
111
109
|
return defineVueNodeViewFactory(nodeViewFactory);
|
|
112
|
-
});
|
|
113
|
-
useExtension(extension);
|
|
110
|
+
}));
|
|
114
111
|
return () => null;
|
|
115
112
|
}
|
|
116
113
|
});
|
|
@@ -121,14 +118,13 @@ const VueNodeViewsConsumer = /* @__PURE__ */ defineComponent({
|
|
|
121
118
|
*/
|
|
122
119
|
function defineVueNodeView(options) {
|
|
123
120
|
const { name, component,...userOptions } = options;
|
|
124
|
-
const args = {
|
|
125
|
-
...userOptions,
|
|
126
|
-
component: withNodeViewProps(component)
|
|
127
|
-
};
|
|
128
121
|
return defineNodeViewComponent({
|
|
129
122
|
group: "vue",
|
|
130
123
|
name,
|
|
131
|
-
args
|
|
124
|
+
args: {
|
|
125
|
+
...userOptions,
|
|
126
|
+
component: withNodeViewProps(component)
|
|
127
|
+
}
|
|
132
128
|
});
|
|
133
129
|
}
|
|
134
130
|
function defineVueNodeViewFactory(factory) {
|
|
@@ -171,8 +167,7 @@ const ProseKit = defineComponent({
|
|
|
171
167
|
* @public
|
|
172
168
|
*/
|
|
173
169
|
function useDocChange(handler, options) {
|
|
174
|
-
|
|
175
|
-
useExtension(extension, options);
|
|
170
|
+
useExtension(defineDocChangeHandler((view) => handler(view.state.doc)), options);
|
|
176
171
|
}
|
|
177
172
|
|
|
178
173
|
//#endregion
|
|
@@ -190,17 +185,35 @@ function useEditor(options) {
|
|
|
190
185
|
if (update) onMounted(() => {
|
|
191
186
|
const forceUpdate = () => triggerRef(editorRef);
|
|
192
187
|
const extension = union(defineMountHandler(forceUpdate), defineUpdateHandler(forceUpdate));
|
|
193
|
-
|
|
194
|
-
onUnmounted(dispose);
|
|
188
|
+
onUnmounted(editor.use(extension));
|
|
195
189
|
});
|
|
196
190
|
return editorRef;
|
|
197
191
|
}
|
|
198
192
|
|
|
193
|
+
//#endregion
|
|
194
|
+
//#region src/hooks/use-editor-derived-value.ts
|
|
195
|
+
/**
|
|
196
|
+
* Runs a function to derive a value from the editor instance after editor state
|
|
197
|
+
* changes.
|
|
198
|
+
*
|
|
199
|
+
* This is useful when you need to render something based on the editor state,
|
|
200
|
+
* for example, whether the selected text is wrapped in an italic mark.
|
|
201
|
+
*
|
|
202
|
+
* It returns a shallow ref of the derived value that updates whenever the editor
|
|
203
|
+
* state changes.
|
|
204
|
+
*
|
|
205
|
+
* @public
|
|
206
|
+
*/
|
|
207
|
+
function useEditorDerivedValue(derive, options) {
|
|
208
|
+
const initialEditor = options?.editor;
|
|
209
|
+
const editorAccessor = initialEditor ? computed(() => toValue(initialEditor)) : useEditor({ update: true });
|
|
210
|
+
return computed(() => derive(toValue(editorAccessor)));
|
|
211
|
+
}
|
|
212
|
+
|
|
199
213
|
//#endregion
|
|
200
214
|
//#region src/hooks/use-keymap.ts
|
|
201
215
|
function useKeymap(keymap, options) {
|
|
202
|
-
|
|
203
|
-
useExtension(extension, options);
|
|
216
|
+
useExtension(computed(() => defineKeymap(toValue(keymap))), options);
|
|
204
217
|
}
|
|
205
218
|
|
|
206
219
|
//#endregion
|
|
@@ -211,10 +224,9 @@ function useKeymap(keymap, options) {
|
|
|
211
224
|
* @public
|
|
212
225
|
*/
|
|
213
226
|
function useStateUpdate(handler, options) {
|
|
214
|
-
|
|
215
|
-
useExtension(extension, options);
|
|
227
|
+
useExtension(defineUpdateHandler((view) => handler(view.state)), options);
|
|
216
228
|
}
|
|
217
229
|
|
|
218
230
|
//#endregion
|
|
219
|
-
export { ProseKit, defineVueMarkView, defineVueNodeView, useDocChange, useEditor, useExtension, useKeymap, useStateUpdate };
|
|
231
|
+
export { ProseKit, defineVueMarkView, defineVueNodeView, useDocChange, useEditor, useEditorDerivedValue, useExtension, useKeymap, useStateUpdate };
|
|
220
232
|
//# sourceMappingURL=prosekit-vue.js.map
|
package/dist/prosekit-vue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-vue.js","names":["props: Readonly<VueMarkViewProps>","VueMarkViewsConsumer: DefineComponent","markViewFactory: MarkViewFactory","args: VueMarkViewUserOptions","props: Readonly<VueNodeViewProps>","VueNodeViewsConsumer: DefineComponent","nodeViewFactory: NodeViewFactory","args: VueNodeViewUserOptions","ProseKit: DefineSetupFnComponent<ProseKitProps>"],"sources":["../src/hooks/use-editor-extension.ts","../src/hooks/use-priority-extension.ts","../src/hooks/use-extension.ts","../src/extensions/vue-mark-view.ts","../src/extensions/vue-node-view.ts","../src/components/prosekit.ts","../src/hooks/use-doc-change.ts","../src/hooks/use-editor.ts","../src/hooks/use-keymap.ts","../src/hooks/use-state-update.ts"],"sourcesContent":["import {\n EditorNotFoundError,\n type Editor,\n type Extension,\n} from '@prosekit/core'\nimport {\n toValue,\n watchPostEffect,\n type MaybeRefOrGetter,\n} from 'vue'\n\nimport { useEditorContext } from '../injection/editor-context'\n\n/**\n * @internal\n */\nexport function useEditorExtension(\n editorRef: MaybeRefOrGetter<Editor> | null | undefined,\n extensionRef: MaybeRefOrGetter<Extension | null> | null,\n): void {\n const editorContext = useEditorContext()\n\n watchPostEffect((onCleanup) => {\n const editor = toValue(editorRef) || toValue(editorContext)\n const extension = toValue(extensionRef)\n\n if (!editor) {\n throw new EditorNotFoundError()\n }\n if (extension) {\n onCleanup(editor.use(extension))\n }\n })\n}\n","import {\n withPriority,\n type Extension,\n type Priority,\n} from '@prosekit/core'\nimport {\n computed,\n toValue,\n type ComputedRef,\n type MaybeRefOrGetter,\n} from 'vue'\n\n/**\n * @internal\n */\nexport function usePriorityExtension<T extends Extension = Extension>(\n extension: MaybeRefOrGetter<T | null>,\n priority: Priority | null | undefined,\n): ComputedRef<T | null> {\n return computed(() => {\n const ext = toValue(extension)\n return ext && priority ? withPriority(ext, priority) : ext\n })\n}\n","import type {\n Editor,\n Extension,\n Priority,\n} from '@prosekit/core'\nimport type { MaybeRefOrGetter } from 'vue'\n\nimport { useEditorExtension } from './use-editor-extension'\nimport { usePriorityExtension } from './use-priority-extension'\n\nexport interface UseExtensionOptions {\n /**\n * The editor to add the extension to. If not provided, it will use the\n * editor from the nearest `ProseKit` component.\n */\n editor?: MaybeRefOrGetter<Editor>\n\n /**\n * Optional priority to add the extension with.\n */\n priority?: Priority\n}\n\n/**\n * Add an extension to the editor.\n *\n * @public\n */\nexport function useExtension(\n /**\n * The ref to an extension to add to the editor. If it changes, the previous\n * extension will be removed and the new one (if not null) will be added.\n */\n extension: MaybeRefOrGetter<Extension | null>,\n options?: UseExtensionOptions,\n): void {\n useEditorExtension(\n options?.editor,\n usePriorityExtension(extension, options?.priority),\n )\n}\n","import {\n defineMarkViewComponent,\n defineMarkViewFactory,\n type Extension,\n} from '@prosekit/core'\nimport type { MarkViewConstructor } from '@prosekit/pm/view'\nimport type { CoreMarkViewUserOptions } from '@prosemirror-adapter/core'\nimport {\n useMarkViewContext,\n useMarkViewFactory,\n type MarkViewContext,\n type MarkViewFactory,\n type VueMarkViewUserOptions,\n} from '@prosemirror-adapter/vue'\nimport {\n computed,\n defineComponent,\n h,\n type DefineComponent,\n} from 'vue'\n\nimport { useExtension } from '../hooks/use-extension'\n\n/**\n * @public\n */\nexport interface VueMarkViewProps extends MarkViewContext {}\n\n/**\n * @public\n */\nexport type VueMarkViewComponent = DefineComponent<VueMarkViewProps, any, any>\n\n/**\n * Options for {@link defineVueMarkView}.\n *\n * @public\n */\nexport interface VueMarkViewOptions extends CoreMarkViewUserOptions<VueMarkViewComponent> {\n /**\n * The name of the mark type.\n */\n name: string\n}\n\nfunction withMarkViewProps(component: VueMarkViewComponent) {\n return defineComponent({\n name: 'MarkViewPropsWrapper',\n setup: () => {\n const props: Readonly<VueMarkViewProps> = useMarkViewContext()\n return () => h(component, props)\n },\n })\n}\n\n/**\n * @internal\n */\nexport const VueMarkViewsConsumer: DefineComponent = /* @__PURE__ */ defineComponent({\n name: 'VueMarkViewsConsumer',\n setup: () => {\n const markViewFactory: MarkViewFactory = useMarkViewFactory()\n const extension = computed(() => {\n return defineVueMarkViewFactory(markViewFactory)\n })\n useExtension(extension)\n return (): null => null\n },\n})\n\n/**\n * Defines a mark view using a Vue component.\n *\n * @public\n */\nexport function defineVueMarkView(options: VueMarkViewOptions): Extension {\n const { name, component, ...userOptions } = options\n\n const args: VueMarkViewUserOptions = {\n ...userOptions,\n component: withMarkViewProps(component),\n }\n\n return defineMarkViewComponent<VueMarkViewUserOptions>({\n group: 'vue',\n name,\n args,\n })\n}\n\nfunction defineVueMarkViewFactory(\n factory: (options: VueMarkViewUserOptions) => MarkViewConstructor,\n) {\n return defineMarkViewFactory<VueMarkViewUserOptions>({\n group: 'vue',\n factory,\n })\n}\n","import {\n defineNodeViewComponent,\n defineNodeViewFactory,\n type Extension,\n} from '@prosekit/core'\nimport type { NodeViewConstructor } from '@prosekit/pm/view'\nimport type { CoreNodeViewUserOptions } from '@prosemirror-adapter/core'\nimport {\n useNodeViewContext,\n useNodeViewFactory,\n type NodeViewContext,\n type NodeViewFactory,\n type VueNodeViewUserOptions,\n} from '@prosemirror-adapter/vue'\nimport {\n computed,\n defineComponent,\n h,\n type DefineComponent,\n} from 'vue'\n\nimport { useExtension } from '../hooks/use-extension'\n\n/**\n * @public\n */\nexport interface VueNodeViewProps extends NodeViewContext {}\n\n/**\n * @public\n */\nexport type VueNodeViewComponent = DefineComponent<VueNodeViewProps, any, any>\n\n/**\n * Options for {@link defineVueNodeView}.\n *\n * @public\n */\nexport interface VueNodeViewOptions extends CoreNodeViewUserOptions<VueNodeViewComponent> {\n /**\n * The name of the node type.\n */\n name: string\n}\n\nfunction withNodeViewProps(component: VueNodeViewComponent) {\n return defineComponent({\n name: 'NodeViewPropsWrapper',\n setup: () => {\n const props: Readonly<VueNodeViewProps> = useNodeViewContext()\n return () => h(component, props)\n },\n })\n}\n\n/**\n * @internal\n */\nexport const VueNodeViewsConsumer: DefineComponent = /* @__PURE__ */ defineComponent({\n name: 'VueNodeViewsConsumer',\n setup: () => {\n const nodeViewFactory: NodeViewFactory = useNodeViewFactory()\n const extension = computed(() => {\n return defineVueNodeViewFactory(nodeViewFactory)\n })\n useExtension(extension)\n return (): null => null\n },\n})\n\n/**\n * Defines a node view using a Vue component.\n *\n * @public\n */\nexport function defineVueNodeView(options: VueNodeViewOptions): Extension {\n const { name, component, ...userOptions } = options\n\n const args: VueNodeViewUserOptions = {\n ...userOptions,\n component: withNodeViewProps(component),\n }\n\n return defineNodeViewComponent<VueNodeViewUserOptions>({\n group: 'vue',\n name,\n args,\n })\n}\n\nfunction defineVueNodeViewFactory(\n factory: (options: VueNodeViewUserOptions) => NodeViewConstructor,\n) {\n return defineNodeViewFactory<VueNodeViewUserOptions>({\n group: 'vue',\n factory,\n })\n}\n","import type { Editor } from '@prosekit/core'\nimport { ProsemirrorAdapterProvider } from '@prosemirror-adapter/vue'\nimport {\n defineComponent,\n h,\n type DefineSetupFnComponent,\n type PropType,\n} from 'vue'\n\nimport { VueMarkViewsConsumer } from '../extensions/vue-mark-view'\nimport { VueNodeViewsConsumer } from '../extensions/vue-node-view'\nimport { provideEditor } from '../injection/editor-context'\n\nexport interface ProseKitProps {\n editor: Editor\n}\n\n/**\n * The root component for a ProseKit editor.\n *\n * @public\n */\nexport const ProseKit: DefineSetupFnComponent<ProseKitProps> = defineComponent<ProseKitProps>({\n name: 'ProseKit',\n props: { editor: { type: Object as PropType<Editor>, required: true } },\n setup: (props, { slots }) => {\n provideEditor(props.editor)\n return () => {\n return h(ProsemirrorAdapterProvider, null, () => [\n h(VueNodeViewsConsumer),\n h(VueMarkViewsConsumer),\n slots.default?.(),\n ])\n }\n },\n})\n","import { defineDocChangeHandler } from '@prosekit/core'\nimport type { ProseMirrorNode } from '@prosekit/pm/model'\n\nimport {\n useExtension,\n type UseExtensionOptions,\n} from './use-extension'\n\n/**\n * Calls the given handler whenever the editor document changes.\n *\n * @public\n */\nexport function useDocChange(\n handler: (doc: ProseMirrorNode) => void,\n options?: UseExtensionOptions,\n): void {\n const extension = defineDocChangeHandler((view) => handler(view.state.doc))\n useExtension(extension, options)\n}\n","import {\n defineMountHandler,\n defineUpdateHandler,\n ProseKitError,\n union,\n type Editor,\n type Extension,\n} from '@prosekit/core'\nimport {\n onMounted,\n onUnmounted,\n shallowRef,\n triggerRef,\n type ShallowRef,\n} from 'vue'\n\nimport { useEditorContext } from '../injection/editor-context'\n\n/**\n * Retrieves the editor instance from the nearest ProseKit component.\n *\n * @public\n */\nexport function useEditor<E extends Extension = any>(options?: {\n /**\n * Whether to update the component when the editor is mounted or editor state\n * is updated.\n *\n * @default false\n */\n update?: boolean\n}): ShallowRef<Editor<E>> {\n const update = options?.update ?? false\n\n const editor = useEditorContext<E>()\n if (!editor) {\n throw new ProseKitError(\n 'useEditor must be used within the ProseKit component',\n )\n }\n\n const editorRef = shallowRef<Editor<E>>(editor)\n\n if (update) {\n onMounted(() => {\n const forceUpdate = () => triggerRef(editorRef)\n const extension = union(\n defineMountHandler(forceUpdate),\n defineUpdateHandler(forceUpdate),\n )\n const dispose = editor.use(extension)\n onUnmounted(dispose)\n })\n }\n\n return editorRef\n}\n","import {\n defineKeymap,\n type Keymap,\n} from '@prosekit/core'\nimport {\n computed,\n toValue,\n type MaybeRefOrGetter,\n} from 'vue'\n\nimport {\n useExtension,\n type UseExtensionOptions,\n} from './use-extension'\n\nexport function useKeymap(\n keymap: MaybeRefOrGetter<Keymap>,\n options?: UseExtensionOptions,\n): void {\n const extension = computed(() => defineKeymap(toValue(keymap)))\n useExtension(extension, options)\n}\n","import { defineUpdateHandler } from '@prosekit/core'\nimport type { EditorState } from '@prosekit/pm/state'\n\nimport {\n useExtension,\n type UseExtensionOptions,\n} from './use-extension'\n\n/**\n * Calls the given handler whenever the editor state changes.\n *\n * @public\n */\nexport function useStateUpdate(\n handler: (state: EditorState) => void,\n options?: UseExtensionOptions,\n): void {\n const extension = defineUpdateHandler((view) => handler(view.state))\n useExtension(extension, options)\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"prosekit-vue.js","names":["props: Readonly<VueMarkViewProps>","VueMarkViewsConsumer: DefineComponent","markViewFactory: MarkViewFactory","props: Readonly<VueNodeViewProps>","VueNodeViewsConsumer: DefineComponent","nodeViewFactory: NodeViewFactory","ProseKit: DefineSetupFnComponent<ProseKitProps>","editorAccessor: Ref<Editor<E>>"],"sources":["../src/hooks/use-editor-extension.ts","../src/hooks/use-priority-extension.ts","../src/hooks/use-extension.ts","../src/extensions/vue-mark-view.ts","../src/extensions/vue-node-view.ts","../src/components/prosekit.ts","../src/hooks/use-doc-change.ts","../src/hooks/use-editor.ts","../src/hooks/use-editor-derived-value.ts","../src/hooks/use-keymap.ts","../src/hooks/use-state-update.ts"],"sourcesContent":["import {\n EditorNotFoundError,\n type Editor,\n type Extension,\n} from '@prosekit/core'\nimport {\n toValue,\n watchPostEffect,\n type MaybeRefOrGetter,\n} from 'vue'\n\nimport { useEditorContext } from '../injection/editor-context'\n\n/**\n * @internal\n */\nexport function useEditorExtension(\n editorRef: MaybeRefOrGetter<Editor> | null | undefined,\n extensionRef: MaybeRefOrGetter<Extension | null> | null,\n): void {\n const editorContext = useEditorContext()\n\n watchPostEffect((onCleanup) => {\n const editor = toValue(editorRef) || toValue(editorContext)\n const extension = toValue(extensionRef)\n\n if (!editor) {\n throw new EditorNotFoundError()\n }\n if (extension) {\n onCleanup(editor.use(extension))\n }\n })\n}\n","import {\n withPriority,\n type Extension,\n type Priority,\n} from '@prosekit/core'\nimport {\n computed,\n toValue,\n type ComputedRef,\n type MaybeRefOrGetter,\n} from 'vue'\n\n/**\n * @internal\n */\nexport function usePriorityExtension<T extends Extension = Extension>(\n extension: MaybeRefOrGetter<T | null>,\n priority: Priority | null | undefined,\n): ComputedRef<T | null> {\n return computed(() => {\n const ext = toValue(extension)\n return ext && priority ? withPriority(ext, priority) : ext\n })\n}\n","import type {\n Editor,\n Extension,\n Priority,\n} from '@prosekit/core'\nimport type { MaybeRefOrGetter } from 'vue'\n\nimport { useEditorExtension } from './use-editor-extension'\nimport { usePriorityExtension } from './use-priority-extension'\n\nexport interface UseExtensionOptions {\n /**\n * The editor to add the extension to. If not provided, it will use the\n * editor from the nearest `<ProseKit>` component.\n */\n editor?: MaybeRefOrGetter<Editor>\n\n /**\n * Optional priority to add the extension with.\n */\n priority?: Priority\n}\n\n/**\n * Add an extension to the editor.\n *\n * @public\n */\nexport function useExtension(\n /**\n * The ref to an extension to add to the editor. If it changes, the previous\n * extension will be removed and the new one (if not null) will be added.\n */\n extension: MaybeRefOrGetter<Extension | null>,\n options?: UseExtensionOptions,\n): void {\n useEditorExtension(\n options?.editor,\n usePriorityExtension(extension, options?.priority),\n )\n}\n","import {\n defineMarkViewComponent,\n defineMarkViewFactory,\n type Extension,\n} from '@prosekit/core'\nimport type { MarkViewConstructor } from '@prosekit/pm/view'\nimport type { CoreMarkViewUserOptions } from '@prosemirror-adapter/core'\nimport {\n useMarkViewContext,\n useMarkViewFactory,\n type MarkViewContext,\n type MarkViewFactory,\n type VueMarkViewUserOptions,\n} from '@prosemirror-adapter/vue'\nimport {\n computed,\n defineComponent,\n h,\n type DefineComponent,\n} from 'vue'\n\nimport { useExtension } from '../hooks/use-extension'\n\n/**\n * @public\n */\nexport interface VueMarkViewProps extends MarkViewContext {}\n\n/**\n * @public\n */\nexport type VueMarkViewComponent = DefineComponent<VueMarkViewProps, any, any>\n\n/**\n * Options for {@link defineVueMarkView}.\n *\n * @public\n */\nexport interface VueMarkViewOptions extends CoreMarkViewUserOptions<VueMarkViewComponent> {\n /**\n * The name of the mark type.\n */\n name: string\n}\n\nfunction withMarkViewProps(component: VueMarkViewComponent) {\n return defineComponent({\n name: 'MarkViewPropsWrapper',\n setup: () => {\n const props: Readonly<VueMarkViewProps> = useMarkViewContext()\n return () => h(component, props)\n },\n })\n}\n\n/**\n * @internal\n */\nexport const VueMarkViewsConsumer: DefineComponent = /* @__PURE__ */ defineComponent({\n name: 'VueMarkViewsConsumer',\n setup: () => {\n const markViewFactory: MarkViewFactory = useMarkViewFactory()\n const extension = computed(() => {\n return defineVueMarkViewFactory(markViewFactory)\n })\n useExtension(extension)\n return (): null => null\n },\n})\n\n/**\n * Defines a mark view using a Vue component.\n *\n * @public\n */\nexport function defineVueMarkView(options: VueMarkViewOptions): Extension {\n const { name, component, ...userOptions } = options\n\n const args: VueMarkViewUserOptions = {\n ...userOptions,\n component: withMarkViewProps(component),\n }\n\n return defineMarkViewComponent<VueMarkViewUserOptions>({\n group: 'vue',\n name,\n args,\n })\n}\n\nfunction defineVueMarkViewFactory(\n factory: (options: VueMarkViewUserOptions) => MarkViewConstructor,\n) {\n return defineMarkViewFactory<VueMarkViewUserOptions>({\n group: 'vue',\n factory,\n })\n}\n","import {\n defineNodeViewComponent,\n defineNodeViewFactory,\n type Extension,\n} from '@prosekit/core'\nimport type { NodeViewConstructor } from '@prosekit/pm/view'\nimport type { CoreNodeViewUserOptions } from '@prosemirror-adapter/core'\nimport {\n useNodeViewContext,\n useNodeViewFactory,\n type NodeViewContext,\n type NodeViewFactory,\n type VueNodeViewUserOptions,\n} from '@prosemirror-adapter/vue'\nimport {\n computed,\n defineComponent,\n h,\n type DefineComponent,\n} from 'vue'\n\nimport { useExtension } from '../hooks/use-extension'\n\n/**\n * @public\n */\nexport interface VueNodeViewProps extends NodeViewContext {}\n\n/**\n * @public\n */\nexport type VueNodeViewComponent = DefineComponent<VueNodeViewProps, any, any>\n\n/**\n * Options for {@link defineVueNodeView}.\n *\n * @public\n */\nexport interface VueNodeViewOptions extends CoreNodeViewUserOptions<VueNodeViewComponent> {\n /**\n * The name of the node type.\n */\n name: string\n}\n\nfunction withNodeViewProps(component: VueNodeViewComponent) {\n return defineComponent({\n name: 'NodeViewPropsWrapper',\n setup: () => {\n const props: Readonly<VueNodeViewProps> = useNodeViewContext()\n return () => h(component, props)\n },\n })\n}\n\n/**\n * @internal\n */\nexport const VueNodeViewsConsumer: DefineComponent = /* @__PURE__ */ defineComponent({\n name: 'VueNodeViewsConsumer',\n setup: () => {\n const nodeViewFactory: NodeViewFactory = useNodeViewFactory()\n const extension = computed(() => {\n return defineVueNodeViewFactory(nodeViewFactory)\n })\n useExtension(extension)\n return (): null => null\n },\n})\n\n/**\n * Defines a node view using a Vue component.\n *\n * @public\n */\nexport function defineVueNodeView(options: VueNodeViewOptions): Extension {\n const { name, component, ...userOptions } = options\n\n const args: VueNodeViewUserOptions = {\n ...userOptions,\n component: withNodeViewProps(component),\n }\n\n return defineNodeViewComponent<VueNodeViewUserOptions>({\n group: 'vue',\n name,\n args,\n })\n}\n\nfunction defineVueNodeViewFactory(\n factory: (options: VueNodeViewUserOptions) => NodeViewConstructor,\n) {\n return defineNodeViewFactory<VueNodeViewUserOptions>({\n group: 'vue',\n factory,\n })\n}\n","import type { Editor } from '@prosekit/core'\nimport { ProsemirrorAdapterProvider } from '@prosemirror-adapter/vue'\nimport {\n defineComponent,\n h,\n type DefineSetupFnComponent,\n type PropType,\n} from 'vue'\n\nimport { VueMarkViewsConsumer } from '../extensions/vue-mark-view'\nimport { VueNodeViewsConsumer } from '../extensions/vue-node-view'\nimport { provideEditor } from '../injection/editor-context'\n\nexport interface ProseKitProps {\n editor: Editor\n}\n\n/**\n * The root component for a ProseKit editor.\n *\n * @public\n */\nexport const ProseKit: DefineSetupFnComponent<ProseKitProps> = defineComponent<ProseKitProps>({\n name: 'ProseKit',\n props: { editor: { type: Object as PropType<Editor>, required: true } },\n setup: (props, { slots }) => {\n provideEditor(props.editor)\n return () => {\n return h(ProsemirrorAdapterProvider, null, () => [\n h(VueNodeViewsConsumer),\n h(VueMarkViewsConsumer),\n slots.default?.(),\n ])\n }\n },\n})\n","import { defineDocChangeHandler } from '@prosekit/core'\nimport type { ProseMirrorNode } from '@prosekit/pm/model'\n\nimport {\n useExtension,\n type UseExtensionOptions,\n} from './use-extension'\n\n/**\n * Calls the given handler whenever the editor document changes.\n *\n * @public\n */\nexport function useDocChange(\n handler: (doc: ProseMirrorNode) => void,\n options?: UseExtensionOptions,\n): void {\n const extension = defineDocChangeHandler((view) => handler(view.state.doc))\n useExtension(extension, options)\n}\n","import {\n defineMountHandler,\n defineUpdateHandler,\n ProseKitError,\n union,\n type Editor,\n type Extension,\n} from '@prosekit/core'\nimport {\n onMounted,\n onUnmounted,\n shallowRef,\n triggerRef,\n type ShallowRef,\n} from 'vue'\n\nimport { useEditorContext } from '../injection/editor-context'\n\n/**\n * Retrieves the editor instance from the nearest ProseKit component.\n *\n * @public\n */\nexport function useEditor<E extends Extension = any>(options?: {\n /**\n * Whether to update the component when the editor is mounted or editor state\n * is updated.\n *\n * @default false\n */\n update?: boolean\n}): ShallowRef<Editor<E>> {\n const update = options?.update ?? false\n\n const editor = useEditorContext<E>()\n if (!editor) {\n throw new ProseKitError(\n 'useEditor must be used within the ProseKit component',\n )\n }\n\n const editorRef = shallowRef<Editor<E>>(editor)\n\n if (update) {\n onMounted(() => {\n const forceUpdate = () => triggerRef(editorRef)\n const extension = union(\n defineMountHandler(forceUpdate),\n defineUpdateHandler(forceUpdate),\n )\n const dispose = editor.use(extension)\n onUnmounted(dispose)\n })\n }\n\n return editorRef\n}\n","import type {\n Editor,\n Extension,\n} from '@prosekit/core'\nimport {\n computed,\n toValue,\n type MaybeRefOrGetter,\n type Ref,\n type ShallowRef,\n} from 'vue'\n\nimport { useEditor } from './use-editor'\n\nexport interface UseEditorDerivedOptions<E extends Extension = any> {\n /**\n * The editor to add the extension to. If not provided, it will use the\n * editor from the nearest `<ProseKit>` component.\n */\n editor?: MaybeRefOrGetter<Editor<E>>\n}\n\n/**\n * Runs a function to derive a value from the editor instance after editor state\n * changes.\n *\n * This is useful when you need to render something based on the editor state,\n * for example, whether the selected text is wrapped in an italic mark.\n *\n * It returns a shallow ref of the derived value that updates whenever the editor\n * state changes.\n *\n * @public\n */\nexport function useEditorDerivedValue<E extends Extension, Derived>(\n /**\n * A function that receives the editor instance and returns a derived value.\n *\n * It will be called whenever the editor's document state changes, or when it\n * mounts.\n */\n derive: (editor: Editor<E>) => Derived,\n options?: UseEditorDerivedOptions<E>,\n): ShallowRef<Derived> {\n const initialEditor = options?.editor\n const editorAccessor: Ref<Editor<E>> = initialEditor\n ? computed(() => toValue(initialEditor))\n : useEditor<E>({ update: true })\n\n return computed(() => derive(toValue(editorAccessor)))\n}\n","import {\n defineKeymap,\n type Keymap,\n} from '@prosekit/core'\nimport {\n computed,\n toValue,\n type MaybeRefOrGetter,\n} from 'vue'\n\nimport {\n useExtension,\n type UseExtensionOptions,\n} from './use-extension'\n\nexport function useKeymap(\n keymap: MaybeRefOrGetter<Keymap>,\n options?: UseExtensionOptions,\n): void {\n const extension = computed(() => defineKeymap(toValue(keymap)))\n useExtension(extension, options)\n}\n","import { defineUpdateHandler } from '@prosekit/core'\nimport type { EditorState } from '@prosekit/pm/state'\n\nimport {\n useExtension,\n type UseExtensionOptions,\n} from './use-extension'\n\n/**\n * Calls the given handler whenever the editor state changes.\n *\n * @public\n */\nexport function useStateUpdate(\n handler: (state: EditorState) => void,\n options?: UseExtensionOptions,\n): void {\n const extension = defineUpdateHandler((view) => handler(view.state))\n useExtension(extension, options)\n}\n"],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosekit/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.1",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Vue components and utilities for ProseKit",
|
|
7
7
|
"author": {
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
"src"
|
|
69
69
|
],
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@prosemirror-adapter/core": "^0.4.
|
|
72
|
-
"@prosemirror-adapter/vue": "^0.4.
|
|
73
|
-
"@prosekit/core": "^0.8.
|
|
74
|
-
"@prosekit/pm": "^0.1.
|
|
75
|
-
"@prosekit/web": "^0.7.
|
|
71
|
+
"@prosemirror-adapter/core": "^0.4.6",
|
|
72
|
+
"@prosemirror-adapter/vue": "^0.4.6",
|
|
73
|
+
"@prosekit/core": "^0.8.6",
|
|
74
|
+
"@prosekit/pm": "^0.1.14",
|
|
75
|
+
"@prosekit/web": "^0.7.6"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"vue": ">= 3.0.0"
|
|
@@ -85,12 +85,12 @@
|
|
|
85
85
|
"devDependencies": {
|
|
86
86
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
87
87
|
"@vue/test-utils": "^2.4.6",
|
|
88
|
-
"tsdown": "^0.
|
|
89
|
-
"typescript": "~5.9.
|
|
90
|
-
"vitest": "^
|
|
91
|
-
"vue": "^3.5.
|
|
92
|
-
"@prosekit/config-
|
|
93
|
-
"@prosekit/config-
|
|
88
|
+
"tsdown": "^0.16.2",
|
|
89
|
+
"typescript": "~5.9.3",
|
|
90
|
+
"vitest": "^4.0.8",
|
|
91
|
+
"vue": "^3.5.24",
|
|
92
|
+
"@prosekit/config-tsdown": "0.0.0",
|
|
93
|
+
"@prosekit/config-vitest": "0.0.0"
|
|
94
94
|
},
|
|
95
95
|
"publishConfig": {
|
|
96
96
|
"dev": {}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Editor,
|
|
3
|
+
Extension,
|
|
4
|
+
} from '@prosekit/core'
|
|
5
|
+
import {
|
|
6
|
+
computed,
|
|
7
|
+
toValue,
|
|
8
|
+
type MaybeRefOrGetter,
|
|
9
|
+
type Ref,
|
|
10
|
+
type ShallowRef,
|
|
11
|
+
} from 'vue'
|
|
12
|
+
|
|
13
|
+
import { useEditor } from './use-editor'
|
|
14
|
+
|
|
15
|
+
export interface UseEditorDerivedOptions<E extends Extension = any> {
|
|
16
|
+
/**
|
|
17
|
+
* The editor to add the extension to. If not provided, it will use the
|
|
18
|
+
* editor from the nearest `<ProseKit>` component.
|
|
19
|
+
*/
|
|
20
|
+
editor?: MaybeRefOrGetter<Editor<E>>
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Runs a function to derive a value from the editor instance after editor state
|
|
25
|
+
* changes.
|
|
26
|
+
*
|
|
27
|
+
* This is useful when you need to render something based on the editor state,
|
|
28
|
+
* for example, whether the selected text is wrapped in an italic mark.
|
|
29
|
+
*
|
|
30
|
+
* It returns a shallow ref of the derived value that updates whenever the editor
|
|
31
|
+
* state changes.
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export function useEditorDerivedValue<E extends Extension, Derived>(
|
|
36
|
+
/**
|
|
37
|
+
* A function that receives the editor instance and returns a derived value.
|
|
38
|
+
*
|
|
39
|
+
* It will be called whenever the editor's document state changes, or when it
|
|
40
|
+
* mounts.
|
|
41
|
+
*/
|
|
42
|
+
derive: (editor: Editor<E>) => Derived,
|
|
43
|
+
options?: UseEditorDerivedOptions<E>,
|
|
44
|
+
): ShallowRef<Derived> {
|
|
45
|
+
const initialEditor = options?.editor
|
|
46
|
+
const editorAccessor: Ref<Editor<E>> = initialEditor
|
|
47
|
+
? computed(() => toValue(initialEditor))
|
|
48
|
+
: useEditor<E>({ update: true })
|
|
49
|
+
|
|
50
|
+
return computed(() => derive(toValue(editorAccessor)))
|
|
51
|
+
}
|
|
@@ -11,7 +11,7 @@ import { usePriorityExtension } from './use-priority-extension'
|
|
|
11
11
|
export interface UseExtensionOptions {
|
|
12
12
|
/**
|
|
13
13
|
* The editor to add the extension to. If not provided, it will use the
|
|
14
|
-
* editor from the nearest
|
|
14
|
+
* editor from the nearest `<ProseKit>` component.
|
|
15
15
|
*/
|
|
16
16
|
editor?: MaybeRefOrGetter<Editor>
|
|
17
17
|
|
package/src/index.ts
CHANGED
|
@@ -16,6 +16,10 @@ export {
|
|
|
16
16
|
} from './extensions/vue-node-view'
|
|
17
17
|
export { useDocChange } from './hooks/use-doc-change'
|
|
18
18
|
export { useEditor } from './hooks/use-editor'
|
|
19
|
+
export {
|
|
20
|
+
useEditorDerivedValue,
|
|
21
|
+
type UseEditorDerivedOptions,
|
|
22
|
+
} from './hooks/use-editor-derived-value'
|
|
19
23
|
export {
|
|
20
24
|
useExtension,
|
|
21
25
|
type UseExtensionOptions,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-emits-QrQextXf.d.ts","names":[],"sources":["../src/components/create-emits.ts"],"sourcesContent":[],"mappings":";KAAY,2CAAW,MACgB,MADhB,GACyB,WADzB,EAAA,CAAA,GAAA,gBACgB,MAEjB,MAFiB,GAAA,CAAA,KAAA,EAG5B,SAH4B,SAAA,GAAA,MAAA,QAAA,GAGU,MAHV,CAGiB,SAHjB,CAAA,CAAA,QAAA,CAAA,GAI/B,MAJ+B,CAIxB,SAJwB,CAAA,EAAA,GAAA,IAAA"}
|