@prosekit/vue 0.7.1 → 0.7.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete.d.ts","names":[],"sources":["../src/components/autocomplete/autocomplete-empty.gen.ts","../src/components/autocomplete/autocomplete-item.gen.ts","../src/components/autocomplete/autocomplete-popup.gen.ts","../src/components/autocomplete/autocomplete-positioner.gen.ts","../src/components/autocomplete/autocomplete-root.gen.ts"],"mappings":";;;UAMiB,sBAAA;;cAGJ,iBAAA,EAAmB,sBAAA,CAAuB,sBAAA,GAAyB,cAAA;;UCH/D,qBAAA;EDAsB;;;;AAGvC;;;ECKE,KAAA,GAAQ,uBAAA;EDLsE;;;;;ECW9E,QAAA,GAAW,uBAAA;EDXmE;ECa9E,QAAA,IAAY,KAAA,EAAO,sBAAA;AAAA;;cAIR,gBAAA,EAAkB,sBAAA,CAAuB,qBAAA,GAAwB,cAAA;;UCpB7D,sBAAA;EFAsB;;;;EEKrC,aAAA,IAAiB,KAAA,EAAO,uBAAA;EFOzB;;;;EEFC,cAAA,IAAkB,KAAA,EAAO,uBAAA;AAAA;;cAId,iBAAA,EAAmB,sBAAA,CAAuB,sBAAA,GAAyB,cAAA;;UCd/D,2BAAA;EHAsB;;;;AAGvC;EGGE,SAAA,GAAY,6BAAA;;;;;;EAMZ,MAAA,GAAS,6BAAA;EHTqB;;;;;;EGgB9B,IAAA,GAAO,6BAAA;EFnB6B;EEqBpC,MAAA,GAAS,6BAAA;EFbD;EEeR,KAAA,GAAQ,6BAAA;EFPW;EESnB,WAAA,GAAc,6BAAA;EFT2B;EEWzC,QAAA,GAAW,6BAAA;EFnBH;EEqBR,eAAA,GAAkB,6BAAA;EFfP;;;;;EEqBX,QAAA,GAAW,6BAAA;EFfA;;;;;;;EEuBX,UAAA,GAAa,6BAAA;EFvBgB;;;;;;ACpB/B;;ECoDE,IAAA,GAAO,6BAAA;ED1CyC;;;;;ECgDhD,KAAA,GAAQ,6BAAA;EDhDU;;;AAIpB;;;ECmDE,OAAA,GAAU,6BAAA;EDnDoE;;;;;;EC0D9E,SAAA,GAAY,6BAAA;ED1DgF;;;ACd9F;;;EA+EE,UAAA,GAAa,6BAAA;EAnEJ;;;;;;EA0ET,YAAA,GAAe,6BAAA;EAnDJ;;;;;;;EA2DX,cAAA,GAAiB,6BAAA;EAAA;;;;;;;EAQjB,WAAA,GAAc,6BAAA;AAAA;;cAIH,sBAAA,EAAwB,sBAAA,CAAuB,2BAAA,GAA8B,cAAA;;UCxGzE,qBAAA;EJFsB;;;;AAGvC;;EIME,MAAA,GAAS,uBAAA;EJN4C;;;;;EIYrD,KAAA,GAAQ,uBAAA;EJZ6C;;;;;ACHvD;EGsBE,MAAA,GAAS,uBAAA;;;;;;;;;EAST,MAAA,GAAS,uBAAA;EHjBE;EGmBX,YAAA,IAAgB,KAAA,EAAO,sBAAA;EHjBJ;EGmBnB,aAAA,IAAiB,KAAA,EAAO,sBAAA;EHnB2B;;AAIrD;;EGoBE,aAAA,IAAiB,KAAA,EAAO,sBAAA;EHpB4B;;;;EGyBpD,cAAA,IAAkB,KAAA,EAAO,sBAAA;AAAA;;cAId,gBAAA,EAAkB,sBAAA,CAAuB,qBAAA,GAAwB,cAAA"}
1
+ {"version":3,"file":"autocomplete.d.ts","names":[],"sources":["../src/components/autocomplete/autocomplete-empty.gen.ts","../src/components/autocomplete/autocomplete-item.gen.ts","../src/components/autocomplete/autocomplete-popup.gen.ts","../src/components/autocomplete/autocomplete-positioner.gen.ts","../src/components/autocomplete/autocomplete-root.gen.ts"],"mappings":";;;UAMiB,sBAAA;;cAGJ,iBAAA,EAAmB,sBAAA,CAAuB,sBAAA,GAAyB,cAAA;;UCH/D,qBAAA;EDAsB;;;AAAA;AAGvC;;;ECKE,KAAA,GAAQ,uBAAA;EDLsE;;;;;ECW9E,QAAA,GAAW,uBAAA;EDXmE;ECa9E,QAAA,IAAY,KAAA,EAAO,sBAAA;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;;;EAST,MAAA,GAAS,uBAAA;EHjBE;EGmBX,YAAA,IAAgB,KAAA,EAAO,sBAAA;EHjBJ;EGmBnB,aAAA,IAAiB,KAAA,EAAO,sBAAA;EHnB2B;AAAA;AAIrD;;EGoBE,aAAA,IAAiB,KAAA,EAAO,sBAAA;EHpB4B;;;;EGyBpD,cAAA,IAAkB,KAAA,EAAO,sBAAA;AAAA;;cAId,gBAAA,EAAkB,sBAAA,CAAuB,qBAAA,GAAwB,cAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete.js","names":[],"sources":["../src/components/autocomplete/autocomplete-empty.gen.ts","../src/components/autocomplete/autocomplete-item.gen.ts","../src/components/autocomplete/autocomplete-popup.gen.ts","../src/components/autocomplete/autocomplete-positioner.gen.ts","../src/components/autocomplete/autocomplete-root.gen.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerAutocompleteEmptyElement } from '@prosekit/web/autocomplete';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes } from 'vue';\n\n/** Props for the {@link AutocompleteEmpty} Vue component. */\nexport interface AutocompleteEmptyProps {}\n\n/** A Vue component that renders an `prosekit-autocomplete-empty` custom element. */\nexport const AutocompleteEmpty: DefineSetupFnComponent<AutocompleteEmptyProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<AutocompleteEmptyProps & HTMLAttributes>(\n (props, { slots }) => {\n registerAutocompleteEmptyElement();\n\n return () => {\n return h('prosekit-autocomplete-empty', props, slots.default?.());\n };\n },\n { props: [] },\n);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerAutocompleteItemElement, type AutocompleteItemEvents, type AutocompleteItemProps as AutocompleteItemElementProps } from '@prosekit/web/autocomplete';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\n/** Props for the {@link AutocompleteItem} Vue component. */\nexport interface AutocompleteItemProps {\n /**\n * The value of the item, which will be matched against the query.\n *\n * If not provided, the value is the item's text content.\n *\n * @default \"\"\n */\n value?: AutocompleteItemElementProps['value'];\n /**\n * Whether this option is disabled.\n *\n * @default false\n */\n disabled?: AutocompleteItemElementProps['disabled'];\n /** Emitted when the the item is selected. */\n onSelect?: (event: AutocompleteItemEvents['select']) => void;\n}\n\n/** A Vue component that renders an `prosekit-autocomplete-item` custom element. */\nexport const AutocompleteItem: DefineSetupFnComponent<AutocompleteItemProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<AutocompleteItemProps & HTMLAttributes>(\n (props, { slots }) => {\n registerAutocompleteItemElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const splittedProps = computed(() => {\n const { disabled: p0, value: p1, onSelect: e0, ...restProps } = props;\n return [[p0, p1, e0], restProps] as const;\n });\n\n const handlers: Array<((event: any) => void) | undefined> = [];\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [p0, p1, e0] = splittedProps.value[0];\n\n Object.assign(element, { disabled: p0, value: p1 });\n\n handlers.length = 0;\n handlers.push(e0);\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const ac = new AbortController();\n for (const [index, eventName] of ['select'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlers[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-autocomplete-item', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['disabled', 'value', 'onSelect'] },\n);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerAutocompletePopupElement, type AutocompletePopupEvents } from '@prosekit/web/autocomplete';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\n/** Props for the {@link AutocompletePopup} Vue component. */\nexport interface AutocompletePopupProps {\n /**\n * Emitted when the selected value changes. Only available when multiple is\n * false.\n */\n onValueChange?: (event: AutocompletePopupEvents['valueChange']) => void;\n /**\n * Emitted when the selected values change. Only available when multiple is\n * true.\n */\n onValuesChange?: (event: AutocompletePopupEvents['valuesChange']) => void;\n}\n\n/** A Vue component that renders an `prosekit-autocomplete-popup` custom element. */\nexport const AutocompletePopup: DefineSetupFnComponent<AutocompletePopupProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<AutocompletePopupProps & HTMLAttributes>(\n (props, { slots }) => {\n registerAutocompletePopupElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const splittedProps = computed(() => {\n const { onValueChange: e0, onValuesChange: e1, ...restProps } = props;\n return [[e0, e1], restProps] as const;\n });\n\n const handlers: Array<((event: any) => void) | undefined> = [];\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [e0, e1] = splittedProps.value[0];\n\n handlers.length = 0;\n handlers.push(e0);\n handlers.push(e1);\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const ac = new AbortController();\n for (const [index, eventName] of ['valueChange', 'valuesChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlers[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-autocomplete-popup', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['onValueChange', 'onValuesChange'] },\n);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerAutocompletePositionerElement, type AutocompletePositionerProps as AutocompletePositionerElementProps } from '@prosekit/web/autocomplete';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\n/** Props for the {@link AutocompletePositioner} Vue component. */\nexport interface AutocompletePositionerProps {\n /**\n * The placement of the popover, relative to the text cursor.\n *\n * @default \"bottom-start\"\n */\n placement?: AutocompletePositionerElementProps['placement'];\n /**\n * The distance between the popover and the text selection.\n *\n * @default { mainAxis: 8, crossAxis: -4 }\n */\n offset?: AutocompletePositionerElementProps['offset'];\n /**\n * Whether to hide the floating element when the reference element or the\n * floating element is fully clipped.\n *\n * @default true\n */\n hide?: AutocompletePositionerElementProps['hide'];\n /** @default true */\n inline?: AutocompletePositionerElementProps['inline'];\n /** @default true */\n hoist?: AutocompletePositionerElementProps['hoist'];\n /** @default true */\n fitViewport?: AutocompletePositionerElementProps['fitViewport'];\n /** @default \"The body element\" */\n boundary?: AutocompletePositionerElementProps['boundary'];\n /** @default 8 */\n overflowPadding?: AutocompletePositionerElementProps['overflowPadding'];\n /**\n * The strategy to use for positioning\n *\n * @default \"absolute\"\n */\n strategy?: AutocompletePositionerElementProps['strategy'];\n /**\n * Options to activate auto-update listeners\n *\n * @see https://floating-ui.com/docs/autoUpdate\n *\n * @default true\n */\n autoUpdate?: AutocompletePositionerElementProps['autoUpdate'];\n /**\n * Whether to flip the `placement` in order to keep it in view when the\n * preferred placement(s) will overflow the clipping boundary. You can also\n * provide an array of placements to try sequentially if the preferred\n * `placement` does not fit.\n *\n * @default true\n */\n flip?: AutocompletePositionerElementProps['flip'];\n /**\n * Whether the floating element should shift to keep it in view.\n *\n * @default true\n */\n shift?: AutocompletePositionerElementProps['shift'];\n /**\n * Whether the floating element can overlap the reference element to keep it\n * in view.\n *\n * @default false\n */\n overlap?: AutocompletePositionerElementProps['overlap'];\n /**\n * Whether to constrain the floating element's width so that it matches the\n * reference element.\n *\n * @default false\n */\n sameWidth?: AutocompletePositionerElementProps['sameWidth'];\n /**\n * Whether to constrain the floating element's height so that it matches the\n * reference element.\n *\n * @default false\n */\n sameHeight?: AutocompletePositionerElementProps['sameHeight'];\n /**\n * Describes the root boundary that the element will be checked for overflow relative to.\n * Please see https://floating-ui.com/docs/detectoverflow#rootboundary for more information.\n *\n * @default 'viewport'\n */\n rootBoundary?: AutocompletePositionerElementProps['rootBoundary'];\n /**\n * The element that will be used to check for overflow. Please see\n * https://floating-ui.com/docs/detectoverflow#elementcontext for more\n * information.\n *\n * @default 'floating'\n */\n elementContext?: AutocompletePositionerElementProps['elementContext'];\n /**\n * Whether to check the alternate elementContext's boundary. Please see\n * https://floating-ui.com/docs/detectoverflow#altboundary for more\n * information.\n *\n * @default false\n */\n altBoundary?: AutocompletePositionerElementProps['altBoundary'];\n}\n\n/** A Vue component that renders an `prosekit-autocomplete-positioner` custom element. */\nexport const AutocompletePositioner: DefineSetupFnComponent<AutocompletePositionerProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<AutocompletePositionerProps & HTMLAttributes>(\n (props, { slots }) => {\n registerAutocompletePositionerElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const splittedProps = computed(() => {\n const { altBoundary: p0, autoUpdate: p1, boundary: p2, elementContext: p3, fitViewport: p4, flip: p5, hide: p6, hoist: p7, inline: p8, offset: p9, overflowPadding: p10, overlap: p11, placement: p12, rootBoundary: p13, sameHeight: p14, sameWidth: p15, shift: p16, strategy: p17, ...restProps } = props;\n return [[p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17], restProps] as const;\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17] = splittedProps.value[0];\n\n Object.assign(element, { altBoundary: p0, autoUpdate: p1, boundary: p2, elementContext: p3, fitViewport: p4, flip: p5, hide: p6, hoist: p7, inline: p8, offset: p9, overflowPadding: p10, overlap: p11, placement: p12, rootBoundary: p13, sameHeight: p14, sameWidth: p15, shift: p16, strategy: p17 });\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-autocomplete-positioner', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['altBoundary', 'autoUpdate', 'boundary', 'elementContext', 'fitViewport', 'flip', 'hide', 'hoist', 'inline', 'offset', 'overflowPadding', 'overlap', 'placement', 'rootBoundary', 'sameHeight', 'sameWidth', 'shift', 'strategy'] },\n);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerAutocompleteRootElement, type AutocompleteRootEvents, type AutocompleteRootProps as AutocompleteRootElementProps } from '@prosekit/web/autocomplete';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\nimport { useEditorContext } from '../../injection/editor-context.ts';\n\n/** Props for the {@link AutocompleteRoot} Vue component. */\nexport interface AutocompleteRootProps {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: AutocompleteRootElementProps['editor'];\n /**\n * The regular expression to match the query text to autocomplete.\n *\n * @default null\n */\n regex?: AutocompleteRootElementProps['regex'];\n /**\n * The filter function to determine if an item should be shown in the\n * listbox.\n *\n * @default defaultItemFilter\n */\n filter?: AutocompleteRootElementProps['filter'];\n /**\n * The reference to position the popup against. This can be a DOM element, a\n * Floating UI virtual element, or a function that returns either of them.\n * By default, the popup will be positioned against the text content that\n * triggers the autocomplete.\n *\n * @default null\n */\n anchor?: AutocompleteRootElementProps['anchor'];\n /** Fired when the open state changes. */\n onOpenChange?: (event: AutocompleteRootEvents['openChange']) => void;\n /** Fired when the query changes. */\n onQueryChange?: (event: AutocompleteRootEvents['queryChange']) => void;\n /**\n * Emitted when the selected value changes. Only available when multiple is\n * false.\n */\n onValueChange?: (event: AutocompleteRootEvents['valueChange']) => void;\n /**\n * Emitted when the selected values change. Only available when multiple is\n * true.\n */\n onValuesChange?: (event: AutocompleteRootEvents['valuesChange']) => void;\n}\n\n/** A Vue component that renders an `prosekit-autocomplete-root` custom element. */\nexport const AutocompleteRoot: DefineSetupFnComponent<AutocompleteRootProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<AutocompleteRootProps & HTMLAttributes>(\n (props, { slots }) => {\n registerAutocompleteRootElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const p1Fallback = useEditorContext();\n\n const splittedProps = computed(() => {\n const { anchor: p0, editor: p1, filter: p2, regex: p3, onOpenChange: e0, onQueryChange: e1, onValueChange: e2, onValuesChange: e3, ...restProps } = props;\n return [[p0, p1, p2, p3, e0, e1, e2, e3], restProps] as const;\n });\n\n const handlers: Array<((event: any) => void) | undefined> = [];\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [p0, p1, p2, p3, e0, e1, e2, e3] = splittedProps.value[0];\n\n Object.assign(element, { anchor: p0, editor: p1 ?? p1Fallback, filter: p2, regex: p3 });\n\n handlers.length = 0;\n handlers.push(e0);\n handlers.push(e1);\n handlers.push(e2);\n handlers.push(e3);\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const ac = new AbortController();\n for (const [index, eventName] of ['openChange', 'queryChange', 'valueChange', 'valuesChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlers[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-autocomplete-root', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['anchor', 'editor', 'filter', 'regex', 'onOpenChange', 'onQueryChange', 'onValueChange', 'onValuesChange'] },\n);\n"],"mappings":";;;;AASA,MAAa,oBAAqG,iCAC/G,OAAO,EAAE,YAAY;CACpB,kCAAkC;CAElC,aAAa;EACX,OAAO,EAAE,+BAA+B,OAAO,MAAM,WAAW,CAAC;;GAGrE,EAAE,OAAO,EAAE,EAAE,CACd;;ACQD,MAAa,mBAAmG,iCAC7G,OAAO,EAAE,YAAY;CACpB,iCAAiC;CAEjC,MAAM,aAAa,WAA+B,KAAK;CAEvD,MAAM,gBAAgB,eAAe;EACnC,MAAM,EAAE,UAAU,IAAI,OAAO,IAAI,UAAU,IAAI,GAAG,cAAc;EAChE,OAAO,CAAC;GAAC;GAAI;GAAI;GAAG,EAAE,UAAU;GAChC;CAEF,MAAM,WAAsD,EAAE;CAE9D,kBAAkB;EACh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AAC,OAAO,cAAc;GAAC;GAAc;GAAe;GAAe;GAAe,CAAC,SAAS,EACrG,QAAQ,iBACN,YACC,UAAiB;GAChB,SAAS,SAAS,MAAM;KAE1B,EAAE,QAAQ,GAAG,QAAQ,CACtB;EAEH,aAAa,GAAG,OAAO;GACvB;CAEF,aAAa;EACX,MAAM,YAAY,cAAc,MAAM;EACtC,OAAO,EAAE,8BAA8B;GAAE,GAAG;GAAW,KAAK;GAAY,EAAE,MAAM,WAAW,CAAC;;GAGhG,EAAE,OAAO;CAAC;CAAU;CAAU;CAAU;CAAS;CAAgB;CAAiB;CAAiB;CAAiB,EAAE,CACvH"}
1
+ {"version":3,"file":"autocomplete.js","names":[],"sources":["../src/components/autocomplete/autocomplete-empty.gen.ts","../src/components/autocomplete/autocomplete-item.gen.ts","../src/components/autocomplete/autocomplete-popup.gen.ts","../src/components/autocomplete/autocomplete-positioner.gen.ts","../src/components/autocomplete/autocomplete-root.gen.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerAutocompleteEmptyElement } from '@prosekit/web/autocomplete';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes } from 'vue';\n\n/** Props for the {@link AutocompleteEmpty} Vue component. */\nexport interface AutocompleteEmptyProps {}\n\n/** A Vue component that renders an `prosekit-autocomplete-empty` custom element. */\nexport const AutocompleteEmpty: DefineSetupFnComponent<AutocompleteEmptyProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<AutocompleteEmptyProps & HTMLAttributes>(\n (props, { slots }) => {\n registerAutocompleteEmptyElement();\n\n return () => {\n return h('prosekit-autocomplete-empty', props, slots.default?.());\n };\n },\n { props: [] },\n);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerAutocompleteItemElement, type AutocompleteItemEvents, type AutocompleteItemProps as AutocompleteItemElementProps } from '@prosekit/web/autocomplete';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\n/** Props for the {@link AutocompleteItem} Vue component. */\nexport interface AutocompleteItemProps {\n /**\n * The value of the item, which will be matched against the query.\n *\n * If not provided, the value is the item's text content.\n *\n * @default \"\"\n */\n value?: AutocompleteItemElementProps['value'];\n /**\n * Whether this option is disabled.\n *\n * @default false\n */\n disabled?: AutocompleteItemElementProps['disabled'];\n /** Emitted when the the item is selected. */\n onSelect?: (event: AutocompleteItemEvents['select']) => void;\n}\n\n/** A Vue component that renders an `prosekit-autocomplete-item` custom element. */\nexport const AutocompleteItem: DefineSetupFnComponent<AutocompleteItemProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<AutocompleteItemProps & HTMLAttributes>(\n (props, { slots }) => {\n registerAutocompleteItemElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const splittedProps = computed(() => {\n const { disabled: p0, value: p1, onSelect: e0, ...restProps } = props;\n return [[p0, p1, e0], restProps] as const;\n });\n\n const handlers: Array<((event: any) => void) | undefined> = [];\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [p0, p1, e0] = splittedProps.value[0];\n\n Object.assign(element, { disabled: p0, value: p1 });\n\n handlers.length = 0;\n handlers.push(e0);\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const ac = new AbortController();\n for (const [index, eventName] of ['select'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlers[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-autocomplete-item', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['disabled', 'value', 'onSelect'] },\n);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerAutocompletePopupElement, type AutocompletePopupEvents } from '@prosekit/web/autocomplete';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\n/** Props for the {@link AutocompletePopup} Vue component. */\nexport interface AutocompletePopupProps {\n /**\n * Emitted when the selected value changes. Only available when multiple is\n * false.\n */\n onValueChange?: (event: AutocompletePopupEvents['valueChange']) => void;\n /**\n * Emitted when the selected values change. Only available when multiple is\n * true.\n */\n onValuesChange?: (event: AutocompletePopupEvents['valuesChange']) => void;\n}\n\n/** A Vue component that renders an `prosekit-autocomplete-popup` custom element. */\nexport const AutocompletePopup: DefineSetupFnComponent<AutocompletePopupProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<AutocompletePopupProps & HTMLAttributes>(\n (props, { slots }) => {\n registerAutocompletePopupElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const splittedProps = computed(() => {\n const { onValueChange: e0, onValuesChange: e1, ...restProps } = props;\n return [[e0, e1], restProps] as const;\n });\n\n const handlers: Array<((event: any) => void) | undefined> = [];\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [e0, e1] = splittedProps.value[0];\n\n handlers.length = 0;\n handlers.push(e0);\n handlers.push(e1);\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const ac = new AbortController();\n for (const [index, eventName] of ['valueChange', 'valuesChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlers[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-autocomplete-popup', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['onValueChange', 'onValuesChange'] },\n);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerAutocompletePositionerElement, type AutocompletePositionerProps as AutocompletePositionerElementProps } from '@prosekit/web/autocomplete';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\n/** Props for the {@link AutocompletePositioner} Vue component. */\nexport interface AutocompletePositionerProps {\n /**\n * The placement of the popover, relative to the text cursor.\n *\n * @default \"bottom-start\"\n */\n placement?: AutocompletePositionerElementProps['placement'];\n /**\n * The distance between the popover and the text selection.\n *\n * @default { mainAxis: 8, crossAxis: -4 }\n */\n offset?: AutocompletePositionerElementProps['offset'];\n /**\n * Whether to hide the floating element when the reference element or the\n * floating element is fully clipped.\n *\n * @default true\n */\n hide?: AutocompletePositionerElementProps['hide'];\n /** @default true */\n inline?: AutocompletePositionerElementProps['inline'];\n /** @default true */\n hoist?: AutocompletePositionerElementProps['hoist'];\n /** @default true */\n fitViewport?: AutocompletePositionerElementProps['fitViewport'];\n /** @default \"The body element\" */\n boundary?: AutocompletePositionerElementProps['boundary'];\n /** @default 8 */\n overflowPadding?: AutocompletePositionerElementProps['overflowPadding'];\n /**\n * The strategy to use for positioning\n *\n * @default \"absolute\"\n */\n strategy?: AutocompletePositionerElementProps['strategy'];\n /**\n * Options to activate auto-update listeners\n *\n * @see https://floating-ui.com/docs/autoUpdate\n *\n * @default true\n */\n autoUpdate?: AutocompletePositionerElementProps['autoUpdate'];\n /**\n * Whether to flip the `placement` in order to keep it in view when the\n * preferred placement(s) will overflow the clipping boundary. You can also\n * provide an array of placements to try sequentially if the preferred\n * `placement` does not fit.\n *\n * @default true\n */\n flip?: AutocompletePositionerElementProps['flip'];\n /**\n * Whether the floating element should shift to keep it in view.\n *\n * @default true\n */\n shift?: AutocompletePositionerElementProps['shift'];\n /**\n * Whether the floating element can overlap the reference element to keep it\n * in view.\n *\n * @default false\n */\n overlap?: AutocompletePositionerElementProps['overlap'];\n /**\n * Whether to constrain the floating element's width so that it matches the\n * reference element.\n *\n * @default false\n */\n sameWidth?: AutocompletePositionerElementProps['sameWidth'];\n /**\n * Whether to constrain the floating element's height so that it matches the\n * reference element.\n *\n * @default false\n */\n sameHeight?: AutocompletePositionerElementProps['sameHeight'];\n /**\n * Describes the root boundary that the element will be checked for overflow relative to.\n * Please see https://floating-ui.com/docs/detectoverflow#rootboundary for more information.\n *\n * @default 'viewport'\n */\n rootBoundary?: AutocompletePositionerElementProps['rootBoundary'];\n /**\n * The element that will be used to check for overflow. Please see\n * https://floating-ui.com/docs/detectoverflow#elementcontext for more\n * information.\n *\n * @default 'floating'\n */\n elementContext?: AutocompletePositionerElementProps['elementContext'];\n /**\n * Whether to check the alternate elementContext's boundary. Please see\n * https://floating-ui.com/docs/detectoverflow#altboundary for more\n * information.\n *\n * @default false\n */\n altBoundary?: AutocompletePositionerElementProps['altBoundary'];\n}\n\n/** A Vue component that renders an `prosekit-autocomplete-positioner` custom element. */\nexport const AutocompletePositioner: DefineSetupFnComponent<AutocompletePositionerProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<AutocompletePositionerProps & HTMLAttributes>(\n (props, { slots }) => {\n registerAutocompletePositionerElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const splittedProps = computed(() => {\n const { altBoundary: p0, autoUpdate: p1, boundary: p2, elementContext: p3, fitViewport: p4, flip: p5, hide: p6, hoist: p7, inline: p8, offset: p9, overflowPadding: p10, overlap: p11, placement: p12, rootBoundary: p13, sameHeight: p14, sameWidth: p15, shift: p16, strategy: p17, ...restProps } = props;\n return [[p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17], restProps] as const;\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17] = splittedProps.value[0];\n\n Object.assign(element, { altBoundary: p0, autoUpdate: p1, boundary: p2, elementContext: p3, fitViewport: p4, flip: p5, hide: p6, hoist: p7, inline: p8, offset: p9, overflowPadding: p10, overlap: p11, placement: p12, rootBoundary: p13, sameHeight: p14, sameWidth: p15, shift: p16, strategy: p17 });\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-autocomplete-positioner', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['altBoundary', 'autoUpdate', 'boundary', 'elementContext', 'fitViewport', 'flip', 'hide', 'hoist', 'inline', 'offset', 'overflowPadding', 'overlap', 'placement', 'rootBoundary', 'sameHeight', 'sameWidth', 'shift', 'strategy'] },\n);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerAutocompleteRootElement, type AutocompleteRootEvents, type AutocompleteRootProps as AutocompleteRootElementProps } from '@prosekit/web/autocomplete';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\nimport { useEditorContext } from '../../injection/editor-context.ts';\n\n/** Props for the {@link AutocompleteRoot} Vue component. */\nexport interface AutocompleteRootProps {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: AutocompleteRootElementProps['editor'];\n /**\n * The regular expression to match the query text to autocomplete.\n *\n * @default null\n */\n regex?: AutocompleteRootElementProps['regex'];\n /**\n * The filter function to determine if an item should be shown in the\n * listbox.\n *\n * @default defaultItemFilter\n */\n filter?: AutocompleteRootElementProps['filter'];\n /**\n * The reference to position the popup against. This can be a DOM element, a\n * Floating UI virtual element, or a function that returns either of them.\n * By default, the popup will be positioned against the text content that\n * triggers the autocomplete.\n *\n * @default null\n */\n anchor?: AutocompleteRootElementProps['anchor'];\n /** Fired when the open state changes. */\n onOpenChange?: (event: AutocompleteRootEvents['openChange']) => void;\n /** Fired when the query changes. */\n onQueryChange?: (event: AutocompleteRootEvents['queryChange']) => void;\n /**\n * Emitted when the selected value changes. Only available when multiple is\n * false.\n */\n onValueChange?: (event: AutocompleteRootEvents['valueChange']) => void;\n /**\n * Emitted when the selected values change. Only available when multiple is\n * true.\n */\n onValuesChange?: (event: AutocompleteRootEvents['valuesChange']) => void;\n}\n\n/** A Vue component that renders an `prosekit-autocomplete-root` custom element. */\nexport const AutocompleteRoot: DefineSetupFnComponent<AutocompleteRootProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<AutocompleteRootProps & HTMLAttributes>(\n (props, { slots }) => {\n registerAutocompleteRootElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const p1Fallback = useEditorContext();\n\n const splittedProps = computed(() => {\n const { anchor: p0, editor: p1, filter: p2, regex: p3, onOpenChange: e0, onQueryChange: e1, onValueChange: e2, onValuesChange: e3, ...restProps } = props;\n return [[p0, p1, p2, p3, e0, e1, e2, e3], restProps] as const;\n });\n\n const handlers: Array<((event: any) => void) | undefined> = [];\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [p0, p1, p2, p3, e0, e1, e2, e3] = splittedProps.value[0];\n\n Object.assign(element, { anchor: p0, editor: p1 ?? p1Fallback, filter: p2, regex: p3 });\n\n handlers.length = 0;\n handlers.push(e0);\n handlers.push(e1);\n handlers.push(e2);\n handlers.push(e3);\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const ac = new AbortController();\n for (const [index, eventName] of ['openChange', 'queryChange', 'valueChange', 'valuesChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlers[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-autocomplete-root', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['anchor', 'editor', 'filter', 'regex', 'onOpenChange', 'onQueryChange', 'onValueChange', 'onValuesChange'] },\n);\n"],"mappings":";;;;AASA,MAAa,oBAAqG,iCAC/G,OAAO,EAAE,YAAY;CACpB,iCAAiC;CAEjC,aAAa;EACX,OAAO,EAAE,+BAA+B,OAAO,MAAM,UAAU,CAAC;CAClE;AACF,GACA,EAAE,OAAO,CAAC,EAAE,CACd;;ACQA,MAAa,mBAAmG,iCAC7G,OAAO,EAAE,YAAY;CACpB,gCAAgC;CAEhC,MAAM,aAAa,WAA+B,IAAI;CAEtD,MAAM,gBAAgB,eAAe;EACnC,MAAM,EAAE,UAAU,IAAI,OAAO,IAAI,UAAU,IAAI,GAAG,cAAc;EAChE,OAAO,C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;EAChB,SAAS,KAAK,EAAE;EAChB,SAAS,KAAK,EAAE;CAClB,CAAC;CAED,kBAAkB;EAChB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EAEd,MAAM,KAAK,IAAI,gBAAgB;EAC/B,KAAK,MAAM,CAAC,OAAO,cAAc;GAAC;GAAc;GAAe;GAAe;EAAc,EAAE,QAAQ,GACpG,QAAQ,iBACN,YACC,UAAiB;GAChB,SAAS,SAAS,KAAK;EACzB,GACA,EAAE,QAAQ,GAAG,OAAO,CACtB;EAEF,aAAa,GAAG,MAAM;CACxB,CAAC;CAED,aAAa;EACX,MAAM,YAAY,cAAc,MAAM;EACtC,OAAO,EAAE,8BAA8B;GAAE,GAAG;GAAW,KAAK;EAAW,GAAG,MAAM,UAAU,CAAC;CAC7F;AACF,GACA,EAAE,OAAO;CAAC;CAAU;CAAU;CAAU;CAAS;CAAgB;CAAiB;CAAiB;AAAgB,EAAE,CACvH"}
@@ -1 +1 @@
1
- {"version":3,"file":"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-popup.gen.ts","../src/components/block-handle/block-handle-positioner.gen.ts","../src/components/block-handle/block-handle-root.gen.ts"],"mappings":";;;UAQiB,mBAAA;EAAmB;;;;AAWpC;;EAJE,MAAA,GAAS,qBAAA;AAAA;;cAIE,cAAA,EAAgB,sBAAA,CAAuB,mBAAA,GAAsB,cAAA;;UCXzD,yBAAA;EDAmB;;;;AAWpC;;ECJE,MAAA,GAAS,2BAAA;AAAA;;cAIE,oBAAA,EAAsB,sBAAA,CAAuB,yBAAA,GAA4B,cAAA;;UCbrE,qBAAA;;cAGJ,gBAAA,EAAkB,sBAAA,CAAuB,qBAAA,GAAwB,cAAA;;UCH7D,0BAAA;EHEmB;;;;AAWpC;EGPE,SAAA,GAAY,4BAAA;;;;;;;EAOZ,KAAA,GAAQ,4BAAA;EHA0C;;;;EGKlD,IAAA,GAAO,4BAAA;EFhBQ;;;;EEqBf,KAAA,GAAQ,4BAAA;EFVG;;;;EEeX,IAAA,GAAO,4BAAA;EFf0B;;;;;EEqBjC,QAAA,GAAW,4BAAA;EFrBuF;;;ACbpG;;;;EC0CE,UAAA,GAAa,4BAAA;EDvCF;;;;;EC6CX,MAAA,GAAS,4BAAA;ED7C0C;;;;;;ECoDnD,OAAA,GAAU,4BAAA;;AAvDZ;;;;;EA8DE,WAAA,GAAc,4BAAA;EAvCN;;;;;;EA8CR,SAAA,GAAY,4BAAA;EAAA;;;;;;EAOZ,UAAA,GAAa,4BAAA;EA4CC;;;;;;EArCd,MAAA,GAAS,4BAAA;EAjET;;;;;;EAwEA,QAAA,GAAW,4BAAA;EAxDA;;;;;;EA+DX,YAAA,GAAe,4BAAA;EAnCf;;;;;;EA0CA,eAAA,GAAkB,4BAAA;EArBT;;;;;;;EA6BT,cAAA,GAAiB,4BAAA;EAAA;;;;;AAYnB;;EAJE,WAAA,GAAc,4BAAA;AAAA;;cAIH,qBAAA,EAAuB,sBAAA,CAAuB,0BAAA,GAA6B,cAAA;;UC1HvE,oBAAA;EJAmB;;;;AAWpC;;EIJE,MAAA,GAAS,sBAAA;EJIyC;EIFlD,aAAA,IAAiB,KAAA,EAAO,qBAAA;AAAA;;cAIb,eAAA,EAAiB,sBAAA,CAAuB,oBAAA,GAAuB,cAAA"}
1
+ {"version":3,"file":"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-popup.gen.ts","../src/components/block-handle/block-handle-positioner.gen.ts","../src/components/block-handle/block-handle-root.gen.ts"],"mappings":";;;UAQiB,mBAAA;EAAmB;;;AAOC;AAIrC;;EAJE,MAAA,GAAS,qBAA0B;AAAA;;cAIxB,cAAA,EAAgB,sBAAA,CAAuB,mBAAA,GAAsB,cAAA;;UCXzD,yBAAA;EDAmB;;;AAOC;AAIrC;;ECJE,MAAA,G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components/block-handle/block-handle-draggable.gen.ts","../src/components/block-handle/block-handle-popup.gen.ts","../src/components/block-handle/block-handle-positioner.gen.ts","../src/components/block-handle/block-handle-root.gen.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerBlockHandleAddElement, type BlockHandleAddProps as BlockHandleAddElementProps } from '@prosekit/web/block-handle';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\nimport { useEditorContext } from '../../injection/editor-context.ts';\n\n/** Props for the {@link BlockHandleAdd} Vue component. */\nexport interface BlockHandleAddProps {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: BlockHandleAddElementProps['editor'];\n}\n\n/** A Vue component that renders an `prosekit-block-handle-add` custom element. */\nexport const BlockHandleAdd: DefineSetupFnComponent<BlockHandleAddProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<BlockHandleAddProps & HTMLAttributes>(\n (props, { slots }) => {\n registerBlockHandleAddElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const p0Fallback = useEditorContext();\n\n const splittedProps = computed(() => {\n const { editor: p0, ...restProps } = props;\n return [[p0], restProps] as const;\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [p0] = splittedProps.value[0];\n\n Object.assign(element, { editor: p0 ?? p0Fallback });\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-block-handle-add', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['editor'] },\n);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerBlockHandleDraggableElement, type BlockHandleDraggableProps as BlockHandleDraggableElementProps } from '@prosekit/web/block-handle';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\nimport { useEditorContext } from '../../injection/editor-context.ts';\n\n/** Props for the {@link BlockHandleDraggable} Vue component. */\nexport interface BlockHandleDraggableProps {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: BlockHandleDraggableElementProps['editor'];\n}\n\n/** A Vue component that renders an `prosekit-block-handle-draggable` custom element. */\nexport const BlockHandleDraggable: DefineSetupFnComponent<BlockHandleDraggableProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<BlockHandleDraggableProps & HTMLAttributes>(\n (props, { slots }) => {\n registerBlockHandleDraggableElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const p0Fallback = useEditorContext();\n\n const splittedProps = computed(() => {\n const { editor: p0, ...restProps } = props;\n return [[p0], restProps] as const;\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [p0] = splittedProps.value[0];\n\n Object.assign(element, { editor: p0 ?? p0Fallback });\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-block-handle-draggable', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['editor'] },\n);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerBlockHandlePopupElement } from '@prosekit/web/block-handle';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes } from 'vue';\n\n/** Props for the {@link BlockHandlePopup} Vue component. */\nexport interface BlockHandlePopupProps {}\n\n/** A Vue component that renders an `prosekit-block-handle-popup` custom element. */\nexport const BlockHandlePopup: DefineSetupFnComponent<BlockHandlePopupProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<BlockHandlePopupProps & HTMLAttributes>(\n (props, { slots }) => {\n registerBlockHandlePopupElement();\n\n return () => {\n return h('prosekit-block-handle-popup', props, slots.default?.());\n };\n },\n { props: [] },\n);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerBlockHandlePositionerElement, type BlockHandlePositionerProps as BlockHandlePositionerElementProps } from '@prosekit/web/block-handle';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\n/** Props for the {@link BlockHandlePositioner} Vue component. */\nexport interface BlockHandlePositionerProps {\n /**\n * The placement of the popover, relative to the hovered block.\n *\n * @default \"left\"\n */\n placement?: BlockHandlePositionerElementProps['placement'];\n /**\n * Whether to use the browser [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)\n * to place the floating element on top of other page content.\n *\n * @default false\n */\n hoist?: BlockHandlePositionerElementProps['hoist'];\n /**\n * @default false\n * @hidden\n */\n flip?: BlockHandlePositionerElementProps['flip'];\n /**\n * @default false\n * @hidden\n */\n shift?: BlockHandlePositionerElementProps['shift'];\n /**\n * @default true\n * @hidden\n */\n hide?: BlockHandlePositionerElementProps['hide'];\n /**\n * The strategy to use for positioning\n *\n * @default \"absolute\"\n */\n strategy?: BlockHandlePositionerElementProps['strategy'];\n /**\n * Options to activate auto-update listeners\n *\n * @see https://floating-ui.com/docs/autoUpdate\n *\n * @default true\n */\n autoUpdate?: BlockHandlePositionerElementProps['autoUpdate'];\n /**\n * The distance between the reference and floating element.\n *\n * @default 6\n */\n offset?: BlockHandlePositionerElementProps['offset'];\n /**\n * Whether the floating element can overlap the reference element to keep it\n * in view.\n *\n * @default false\n */\n overlap?: BlockHandlePositionerElementProps['overlap'];\n /**\n * Whether to constrain the floating element's width and height to not exceed\n * the viewport.\n *\n * @default false\n */\n fitViewport?: BlockHandlePositionerElementProps['fitViewport'];\n /**\n * Whether to constrain the floating element's width so that it matches the\n * reference element.\n *\n * @default false\n */\n sameWidth?: BlockHandlePositionerElementProps['sameWidth'];\n /**\n * Whether to constrain the floating element's height so that it matches the\n * reference element.\n *\n * @default false\n */\n sameHeight?: BlockHandlePositionerElementProps['sameHeight'];\n /**\n * Whether to improve positioning for inline reference elements that span over\n * multiple lines.\n *\n * @default false\n */\n inline?: BlockHandlePositionerElementProps['inline'];\n /**\n * Describes the clipping element(s) or area that overflow will be checked relative to.\n * Please see https://floating-ui.com/docs/detectoverflow#boundary for more information.\n *\n * @default 'clippingAncestors'\n */\n boundary?: BlockHandlePositionerElementProps['boundary'];\n /**\n * Describes the root boundary that the element will be checked for overflow relative to.\n * Please see https://floating-ui.com/docs/detectoverflow#rootboundary for more information.\n *\n * @default 'viewport'\n */\n rootBoundary?: BlockHandlePositionerElementProps['rootBoundary'];\n /**\n * Describes the virtual padding around the boundary to check for overflow.\n * Please see https://floating-ui.com/docs/detectoverflow#padding for more information.\n *\n * @default 4\n */\n overflowPadding?: BlockHandlePositionerElementProps['overflowPadding'];\n /**\n * The element that will be used to check for overflow. Please see\n * https://floating-ui.com/docs/detectoverflow#elementcontext for more\n * information.\n *\n * @default 'floating'\n */\n elementContext?: BlockHandlePositionerElementProps['elementContext'];\n /**\n * Whether to check the alternate elementContext's boundary. Please see\n * https://floating-ui.com/docs/detectoverflow#altboundary for more\n * information.\n *\n * @default false\n */\n altBoundary?: BlockHandlePositionerElementProps['altBoundary'];\n}\n\n/** A Vue component that renders an `prosekit-block-handle-positioner` custom element. */\nexport const BlockHandlePositioner: DefineSetupFnComponent<BlockHandlePositionerProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<BlockHandlePositionerProps & HTMLAttributes>(\n (props, { slots }) => {\n registerBlockHandlePositionerElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const splittedProps = computed(() => {\n const { altBoundary: p0, autoUpdate: p1, boundary: p2, elementContext: p3, fitViewport: p4, flip: p5, hide: p6, hoist: p7, inline: p8, offset: p9, overflowPadding: p10, overlap: p11, placement: p12, rootBoundary: p13, sameHeight: p14, sameWidth: p15, shift: p16, strategy: p17, ...restProps } = props;\n return [[p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17], restProps] as const;\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17] = splittedProps.value[0];\n\n Object.assign(element, { altBoundary: p0, autoUpdate: p1, boundary: p2, elementContext: p3, fitViewport: p4, flip: p5, hide: p6, hoist: p7, inline: p8, offset: p9, overflowPadding: p10, overlap: p11, placement: p12, rootBoundary: p13, sameHeight: p14, sameWidth: p15, shift: p16, strategy: p17 });\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-block-handle-positioner', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['altBoundary', 'autoUpdate', 'boundary', 'elementContext', 'fitViewport', 'flip', 'hide', 'hoist', 'inline', 'offset', 'overflowPadding', 'overlap', 'placement', 'rootBoundary', 'sameHeight', 'sameWidth', 'shift', 'strategy'] },\n);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerBlockHandleRootElement, type BlockHandleRootEvents, type BlockHandleRootProps as BlockHandleRootElementProps } from '@prosekit/web/block-handle';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\nimport { useEditorContext } from '../../injection/editor-context.ts';\n\n/** Props for the {@link BlockHandleRoot} Vue component. */\nexport interface BlockHandleRootProps {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: BlockHandleRootElementProps['editor'];\n /** Fired when the hovered block changes. */\n onStateChange?: (event: BlockHandleRootEvents['stateChange']) => void;\n}\n\n/** A Vue component that renders an `prosekit-block-handle-root` custom element. */\nexport const BlockHandleRoot: DefineSetupFnComponent<BlockHandleRootProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<BlockHandleRootProps & HTMLAttributes>(\n (props, { slots }) => {\n registerBlockHandleRootElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const p0Fallback = useEditorContext();\n\n const splittedProps = computed(() => {\n const { editor: p0, onStateChange: e0, ...restProps } = props;\n return [[p0, e0], restProps] as const;\n });\n\n const handlers: Array<((event: any) => void) | undefined> = [];\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [p0, e0] = splittedProps.value[0];\n\n Object.assign(element, { editor: p0 ?? p0Fallback });\n\n handlers.length = 0;\n handlers.push(e0);\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const ac = new AbortController();\n for (const [index, eventName] of ['stateChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlers[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-block-handle-root', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['editor', 'onStateChange'] },\n);\n"],"mappings":";;;;AAmBA,MAAa,iBAA+F,iCACzG,OAAO,EAAE,YAAY;CACpB,+BAA+B;CAE/B,MAAM,aAAa,WAA+B,KAAK;CAEvD,MAAM,aAAa,kBAAkB;CAErC,MAAM,gBAAgB,eAAe;EACnC,MAAM,EAAE,QAAQ,IAAI,GAAG,cAAc;EACrC,OAAO,CAAC,CAAC,GAAG,EAAE,UAAU;GACxB;CAEF,kBAAkB;EAChB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EAEd,MAAM,CAAC,MAAM,cAAc,MAAM;EAEjC,OAAO,OAAO,SAAS,EAAE,QAAQ,MAAM,YAAY,CAAC;GACpD;CAEF,aAAa;EACX,MAAM,YAAY,cAAc,MAAM;EACtC,OAAO,EAAE,6BAA6B;GAAE,GAAG;GAAW,KAAK;GAAY,EAAE,MAAM,WAAW,CAAC;;GAG/F,EAAE,OAAO,CAAC,SAAS,EAAE,CACtB;;AC5BD,MAAa,uBAA2G,iCACrH,OAAO,EAAE,YAAY;CACpB,qCAAqC;CAErC,MAAM,aAAa,WAA+B,KAAK;CAEvD,MAAM,aAAa,kBAAkB;CAErC,MAAM,gBAAgB,eAAe;EACnC,MAAM,EAAE,QAAQ,IAAI,GAAG,cAAc;EACrC,OAAO,CAAC,CAAC,GAAG,EAAE,UAAU;GACxB;CAEF,kBAAkB;EAChB,MAAM,UAAU,WAAW;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Q,CACtB;EAEH,aAAa,GAAG,OAAO;GACvB;CAEF,aAAa;EACX,MAAM,YAAY,cAAc,MAAM;EACtC,OAAO,EAAE,8BAA8B;GAAE,GAAG;GAAW,KAAK;GAAY,EAAE,MAAM,WAAW,CAAC;;GAGhG,EAAE,OAAO,CAAC,UAAU,gBAAgB,EAAE,CACvC"}
1
+ {"version":3,"file":"block-handle.js","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-popup.gen.ts","../src/components/block-handle/block-handle-positioner.gen.ts","../src/components/block-handle/block-handle-root.gen.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerBlockHandleAddElement, type BlockHandleAddProps as BlockHandleAddElementProps } from '@prosekit/web/block-handle';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\nimport { useEditorContext } from '../../injection/editor-context.ts';\n\n/** Props for the {@link BlockHandleAdd} Vue component. */\nexport interface BlockHandleAddProps {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: BlockHandleAddElementProps['editor'];\n}\n\n/** A Vue component that renders an `prosekit-block-handle-add` custom element. */\nexport const BlockHandleAdd: DefineSetupFnComponent<BlockHandleAddProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<BlockHandleAddProps & HTMLAttributes>(\n (props, { slots }) => {\n registerBlockHandleAddElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const p0Fallback = useEditorContext();\n\n const splittedProps = computed(() => {\n const { editor: p0, ...restProps } = props;\n return [[p0], restProps] as const;\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [p0] = splittedProps.value[0];\n\n Object.assign(element, { editor: p0 ?? p0Fallback });\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-block-handle-add', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['editor'] },\n);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerBlockHandleDraggableElement, type BlockHandleDraggableProps as BlockHandleDraggableElementProps } from '@prosekit/web/block-handle';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\nimport { useEditorContext } from '../../injection/editor-context.ts';\n\n/** Props for the {@link BlockHandleDraggable} Vue component. */\nexport interface BlockHandleDraggableProps {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: BlockHandleDraggableElementProps['editor'];\n}\n\n/** A Vue component that renders an `prosekit-block-handle-draggable` custom element. */\nexport const BlockHandleDraggable: DefineSetupFnComponent<BlockHandleDraggableProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<BlockHandleDraggableProps & HTMLAttributes>(\n (props, { slots }) => {\n registerBlockHandleDraggableElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const p0Fallback = useEditorContext();\n\n const splittedProps = computed(() => {\n const { editor: p0, ...restProps } = props;\n return [[p0], restProps] as const;\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [p0] = splittedProps.value[0];\n\n Object.assign(element, { editor: p0 ?? p0Fallback });\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-block-handle-draggable', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['editor'] },\n);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerBlockHandlePopupElement } from '@prosekit/web/block-handle';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes } from 'vue';\n\n/** Props for the {@link BlockHandlePopup} Vue component. */\nexport interface BlockHandlePopupProps {}\n\n/** A Vue component that renders an `prosekit-block-handle-popup` custom element. */\nexport const BlockHandlePopup: DefineSetupFnComponent<BlockHandlePopupProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<BlockHandlePopupProps & HTMLAttributes>(\n (props, { slots }) => {\n registerBlockHandlePopupElement();\n\n return () => {\n return h('prosekit-block-handle-popup', props, slots.default?.());\n };\n },\n { props: [] },\n);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerBlockHandlePositionerElement, type BlockHandlePositionerProps as BlockHandlePositionerElementProps } from '@prosekit/web/block-handle';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\n/** Props for the {@link BlockHandlePositioner} Vue component. */\nexport interface BlockHandlePositionerProps {\n /**\n * The placement of the popover, relative to the hovered block.\n *\n * @default \"left\"\n */\n placement?: BlockHandlePositionerElementProps['placement'];\n /**\n * Whether to use the browser [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)\n * to place the floating element on top of other page content.\n *\n * @default false\n */\n hoist?: BlockHandlePositionerElementProps['hoist'];\n /**\n * @default false\n * @hidden\n */\n flip?: BlockHandlePositionerElementProps['flip'];\n /**\n * @default false\n * @hidden\n */\n shift?: BlockHandlePositionerElementProps['shift'];\n /**\n * @default true\n * @hidden\n */\n hide?: BlockHandlePositionerElementProps['hide'];\n /**\n * The strategy to use for positioning\n *\n * @default \"absolute\"\n */\n strategy?: BlockHandlePositionerElementProps['strategy'];\n /**\n * Options to activate auto-update listeners\n *\n * @see https://floating-ui.com/docs/autoUpdate\n *\n * @default true\n */\n autoUpdate?: BlockHandlePositionerElementProps['autoUpdate'];\n /**\n * The distance between the reference and floating element.\n *\n * @default 6\n */\n offset?: BlockHandlePositionerElementProps['offset'];\n /**\n * Whether the floating element can overlap the reference element to keep it\n * in view.\n *\n * @default false\n */\n overlap?: BlockHandlePositionerElementProps['overlap'];\n /**\n * Whether to constrain the floating element's width and height to not exceed\n * the viewport.\n *\n * @default false\n */\n fitViewport?: BlockHandlePositionerElementProps['fitViewport'];\n /**\n * Whether to constrain the floating element's width so that it matches the\n * reference element.\n *\n * @default false\n */\n sameWidth?: BlockHandlePositionerElementProps['sameWidth'];\n /**\n * Whether to constrain the floating element's height so that it matches the\n * reference element.\n *\n * @default false\n */\n sameHeight?: BlockHandlePositionerElementProps['sameHeight'];\n /**\n * Whether to improve positioning for inline reference elements that span over\n * multiple lines.\n *\n * @default false\n */\n inline?: BlockHandlePositionerElementProps['inline'];\n /**\n * Describes the clipping element(s) or area that overflow will be checked relative to.\n * Please see https://floating-ui.com/docs/detectoverflow#boundary for more information.\n *\n * @default 'clippingAncestors'\n */\n boundary?: BlockHandlePositionerElementProps['boundary'];\n /**\n * Describes the root boundary that the element will be checked for overflow relative to.\n * Please see https://floating-ui.com/docs/detectoverflow#rootboundary for more information.\n *\n * @default 'viewport'\n */\n rootBoundary?: BlockHandlePositionerElementProps['rootBoundary'];\n /**\n * Describes the virtual padding around the boundary to check for overflow.\n * Please see https://floating-ui.com/docs/detectoverflow#padding for more information.\n *\n * @default 4\n */\n overflowPadding?: BlockHandlePositionerElementProps['overflowPadding'];\n /**\n * The element that will be used to check for overflow. Please see\n * https://floating-ui.com/docs/detectoverflow#elementcontext for more\n * information.\n *\n * @default 'floating'\n */\n elementContext?: BlockHandlePositionerElementProps['elementContext'];\n /**\n * Whether to check the alternate elementContext's boundary. Please see\n * https://floating-ui.com/docs/detectoverflow#altboundary for more\n * information.\n *\n * @default false\n */\n altBoundary?: BlockHandlePositionerElementProps['altBoundary'];\n}\n\n/** A Vue component that renders an `prosekit-block-handle-positioner` custom element. */\nexport const BlockHandlePositioner: DefineSetupFnComponent<BlockHandlePositionerProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<BlockHandlePositionerProps & HTMLAttributes>(\n (props, { slots }) => {\n registerBlockHandlePositionerElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const splittedProps = computed(() => {\n const { altBoundary: p0, autoUpdate: p1, boundary: p2, elementContext: p3, fitViewport: p4, flip: p5, hide: p6, hoist: p7, inline: p8, offset: p9, overflowPadding: p10, overlap: p11, placement: p12, rootBoundary: p13, sameHeight: p14, sameWidth: p15, shift: p16, strategy: p17, ...restProps } = props;\n return [[p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17], restProps] as const;\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17] = splittedProps.value[0];\n\n Object.assign(element, { altBoundary: p0, autoUpdate: p1, boundary: p2, elementContext: p3, fitViewport: p4, flip: p5, hide: p6, hoist: p7, inline: p8, offset: p9, overflowPadding: p10, overlap: p11, placement: p12, rootBoundary: p13, sameHeight: p14, sameWidth: p15, shift: p16, strategy: p17 });\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-block-handle-positioner', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['altBoundary', 'autoUpdate', 'boundary', 'elementContext', 'fitViewport', 'flip', 'hide', 'hoist', 'inline', 'offset', 'overflowPadding', 'overlap', 'placement', 'rootBoundary', 'sameHeight', 'sameWidth', 'shift', 'strategy'] },\n);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerBlockHandleRootElement, type BlockHandleRootEvents, type BlockHandleRootProps as BlockHandleRootElementProps } from '@prosekit/web/block-handle';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\nimport { useEditorContext } from '../../injection/editor-context.ts';\n\n/** Props for the {@link BlockHandleRoot} Vue component. */\nexport interface BlockHandleRootProps {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: BlockHandleRootElementProps['editor'];\n /** Fired when the hovered block changes. */\n onStateChange?: (event: BlockHandleRootEvents['stateChange']) => void;\n}\n\n/** A Vue component that renders an `prosekit-block-handle-root` custom element. */\nexport const BlockHandleRoot: DefineSetupFnComponent<BlockHandleRootProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<BlockHandleRootProps & HTMLAttributes>(\n (props, { slots }) => {\n registerBlockHandleRootElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const p0Fallback = useEditorContext();\n\n const splittedProps = computed(() => {\n const { editor: p0, onStateChange: e0, ...restProps } = props;\n return [[p0, e0], restProps] as const;\n });\n\n const handlers: Array<((event: any) => void) | undefined> = [];\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [p0, e0] = splittedProps.value[0];\n\n Object.assign(element, { editor: p0 ?? p0Fallback });\n\n handlers.length = 0;\n handlers.push(e0);\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const ac = new AbortController();\n for (const [index, eventName] of ['stateChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlers[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-block-handle-root', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['editor', 'onStateChange'] },\n);\n"],"mappings":";;;;AAmBA,MAAa,iBAA+F,iCACzG,OAAO,EAAE,YAAY;CACpB,8BAA8B;CAE9B,MAAM,aAAa,WAA+B,IAAI;CAEtD,MAAM,aAAa,iBAAiB;CAEpC,MAAM,gBAAgB,eAAe;EACnC,MAAM,EAAE,QAAQ,IAAI,GAAG,cAAc;EACrC,OAAO,CAAC,CAAC,EAAE,GAAG,SAAS;CACzB,CAAC;CAED,kBAAkB;EAChB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EAEd,MAAM,CAAC,MAAM,cAAc,MAAM;EAEjC,OAAO,OAAO,SAAS,EAAE,QAAQ,MAAM,WAAW,CAAC;CACrD,CAAC;CAED,aAAa;EACX,MAAM,YAAY,cAAc,MAAM;EACtC,OAAO,EAAE,6BAA6B;GAAE,GAAG;GAAW,KAAK;EAAW,GAAG,MAAM,UAAU,CAAC;CAC5F;AACF,GACA,EAAE,OAAO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c,MAAM;EAErC,OAAO,OAAO,SAAS,EAAE,QAAQ,MAAM,WAAW,CAAC;EAEnD,SAAS,SAAS;EAClB,SAAS,KAAK,EAAE;CAClB,CAAC;CAED,kBAAkB;EAChB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EAEd,MAAM,KAAK,IAAI,gBAAgB;EAC/B,KAAK,MAAM,CAAC,OAAO,cAAc,CAAC,aAAa,EAAE,QAAQ,GACvD,QAAQ,iBACN,YACC,UAAiB;GAChB,SAAS,SAAS,KAAK;EACzB,GACA,EAAE,QAAQ,GAAG,OAAO,CACtB;EAEF,aAAa,GAAG,MAAM;CACxB,CAAC;CAED,aAAa;EACX,MAAM,YAAY,cAAc,MAAM;EACtC,OAAO,EAAE,8BAA8B;GAAE,GAAG;GAAW,KAAK;EAAW,GAAG,MAAM,UAAU,CAAC;CAC7F;AACF,GACA,EAAE,OAAO,CAAC,UAAU,eAAe,EAAE,CACvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"drop-indicator.d.ts","names":[],"sources":["../src/components/drop-indicator/drop-indicator.gen.ts"],"mappings":";;;UAQiB,kBAAA;EAAkB;;;;;;EAOjC,MAAA,GAAS,oBAAA;EAMwB;;AAInC;;;EAJE,KAAA,GAAQ,oBAAA;AAAA;;cAIG,aAAA,EAAe,sBAAA,CAAuB,kBAAA,GAAqB,cAAA"}
1
+ {"version":3,"file":"drop-indicator.d.ts","names":[],"sources":["../src/components/drop-indicator/drop-indicator.gen.ts"],"mappings":";;;UAQiB,kBAAA;EAAkB;;;;;;EAOjC,MAAA,GAAS,oBAAA;EAMwB;AAAA;AAInC;;;EAJE,KAAA,GAAQ,oBAAyB;AAAA;;cAItB,aAAA,EAAe,sBAAA,CAAuB,kBAAA,GAAqB,cAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"drop-indicator.js","names":[],"sources":["../src/components/drop-indicator/drop-indicator.gen.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerDropIndicatorElement, type DropIndicatorProps as DropIndicatorElementProps } from '@prosekit/web/drop-indicator';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\nimport { useEditorContext } from '../../injection/editor-context.ts';\n\n/** Props for the {@link DropIndicator} Vue component. */\nexport interface DropIndicatorProps {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: DropIndicatorElementProps['editor'];\n /**\n * The line width in pixels.\n *\n * @default 2\n */\n width?: DropIndicatorElementProps['width'];\n}\n\n/** A Vue component that renders an `prosekit-drop-indicator` custom element. */\nexport const DropIndicator: DefineSetupFnComponent<DropIndicatorProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<DropIndicatorProps & HTMLAttributes>(\n (props, { slots }) => {\n registerDropIndicatorElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const p0Fallback = useEditorContext();\n\n const splittedProps = computed(() => {\n const { editor: p0, width: p1, ...restProps } = props;\n return [[p0, p1], restProps] as const;\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [p0, p1] = splittedProps.value[0];\n\n Object.assign(element, { editor: p0 ?? p0Fallback, width: p1 });\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-drop-indicator', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['editor', 'width'] },\n);\n"],"mappings":";;;;AAyBA,MAAa,gBAA6F,iCACvG,OAAO,EAAE,YAAY;CACpB,8BAA8B;CAE9B,MAAM,aAAa,WAA+B,KAAK;CAEvD,MAAM,aAAa,kBAAkB;CAErC,MAAM,gBAAgB,eAAe;EACnC,MAAM,EAAE,QAAQ,IAAI,OAAO,IAAI,GAAG,cAAc;EAChD,OAAO,CAAC,CAAC,IAAI,GAAG,EAAE,UAAU;GAC5B;CAEF,kBAAkB;EAChB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EAEd,MAAM,CAAC,IAAI,MAAM,cAAc,MAAM;EAErC,OAAO,OAAO,SAAS;GAAE,QAAQ,MAAM;GAAY,OAAO;GAAI,CAAC;GAC/D;CAEF,aAAa;EACX,MAAM,YAAY,cAAc,MAAM;EACtC,OAAO,EAAE,2BAA2B;GAAE,GAAG;GAAW,KAAK;GAAY,EAAE,MAAM,WAAW,CAAC;;GAG7F,EAAE,OAAO,CAAC,UAAU,QAAQ,EAAE,CAC/B"}
1
+ {"version":3,"file":"drop-indicator.js","names":[],"sources":["../src/components/drop-indicator/drop-indicator.gen.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerDropIndicatorElement, type DropIndicatorProps as DropIndicatorElementProps } from '@prosekit/web/drop-indicator';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\nimport { useEditorContext } from '../../injection/editor-context.ts';\n\n/** Props for the {@link DropIndicator} Vue component. */\nexport interface DropIndicatorProps {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: DropIndicatorElementProps['editor'];\n /**\n * The line width in pixels.\n *\n * @default 2\n */\n width?: DropIndicatorElementProps['width'];\n}\n\n/** A Vue component that renders an `prosekit-drop-indicator` custom element. */\nexport const DropIndicator: DefineSetupFnComponent<DropIndicatorProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<DropIndicatorProps & HTMLAttributes>(\n (props, { slots }) => {\n registerDropIndicatorElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const p0Fallback = useEditorContext();\n\n const splittedProps = computed(() => {\n const { editor: p0, width: p1, ...restProps } = props;\n return [[p0, p1], restProps] as const;\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [p0, p1] = splittedProps.value[0];\n\n Object.assign(element, { editor: p0 ?? p0Fallback, width: p1 });\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-drop-indicator', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['editor', 'width'] },\n);\n"],"mappings":";;;;AAyBA,MAAa,gBAA6F,iCACvG,OAAO,EAAE,YAAY;CACpB,6BAA6B;CAE7B,MAAM,aAAa,WAA+B,IAAI;CAEtD,MAAM,aAAa,iBAAiB;CAEpC,MAAM,gBAAgB,eAAe;EACnC,MAAM,EAAE,QAAQ,IAAI,OAAO,IAAI,GAAG,cAAc;EAChD,OAAO,CAAC,CAAC,IAAI,EAAE,GAAG,SAAS;CAC7B,CAAC;CAED,kBAAkB;EAChB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EAEd,MAAM,CAAC,IAAI,MAAM,cAAc,MAAM;EAErC,OAAO,OAAO,SAAS;GAAE,QAAQ,MAAM;GAAY,OAAO;EAAG,CAAC;CAChE,CAAC;CAED,aAAa;EACX,MAAM,YAAY,cAAc,MAAM;EACtC,OAAO,EAAE,2BAA2B;GAAE,GAAG;GAAW,KAAK;EAAW,GAAG,MAAM,UAAU,CAAC;CAC1F;AACF,GACA,EAAE,OAAO,CAAC,UAAU,OAAO,EAAE,CAC/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"editor-context.js","names":[],"sources":["../src/injection/editor-context.ts"],"sourcesContent":["import type { Editor, Extension } from '@prosekit/core'\nimport { inject, provide, type InjectionKey } 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":";AAGA,MAAM,SAAS,OAAO,8BAA8B;;;;AAKpD,SAAgB,cAAc,QAAsB;CAClD,QAAQ,QAAQ,OAAO;;;;;AAMzB,SAAgB,mBAA+D;CAC7E,OAAO,OAAO,QAAQ,KAAA,EAAU"}
1
+ {"version":3,"file":"editor-context.js","names":[],"sources":["../src/injection/editor-context.ts"],"sourcesContent":["import type { Editor, Extension } from '@prosekit/core'\nimport { inject, provide, type InjectionKey } 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":";AAGA,MAAM,SAAS,OAAO,6BAA6B;;;;AAKnD,SAAgB,cAAc,QAAsB;CAClD,QAAQ,QAAQ,MAAM;AACxB;;;;AAKA,SAAgB,mBAA+D;CAC7E,OAAO,OAAO,QAAQ,KAAA,CAAS;AACjC"}
package/dist/index.d.ts CHANGED
@@ -9,22 +9,12 @@ interface ProseKitProps {
9
9
  }
10
10
  /**
11
11
  * The root component for a ProseKit editor.
12
- *
13
- * @public
14
12
  */
15
13
  declare const ProseKit: DefineSetupFnComponent<ProseKitProps>;
16
- /**
17
- * @public
18
- */
19
14
  interface VueMarkViewProps extends MarkViewContext {}
20
- /**
21
- * @public
22
- */
23
15
  type VueMarkViewComponent = DefineComponent<VueMarkViewProps, any, any>;
24
16
  /**
25
17
  * Options for {@link defineVueMarkView}.
26
- *
27
- * @public
28
18
  */
29
19
  interface VueMarkViewOptions extends CoreMarkViewUserOptions<VueMarkViewComponent> {
30
20
  /**
@@ -34,22 +24,12 @@ interface VueMarkViewOptions extends CoreMarkViewUserOptions<VueMarkViewComponen
34
24
  }
35
25
  /**
36
26
  * Defines a mark view using a Vue component.
37
- *
38
- * @public
39
27
  */
40
28
  declare function defineVueMarkView(options: VueMarkViewOptions): Extension;
41
- /**
42
- * @public
43
- */
44
29
  interface VueNodeViewProps extends NodeViewContext {}
45
- /**
46
- * @public
47
- */
48
30
  type VueNodeViewComponent = DefineComponent<VueNodeViewProps, any, any>;
49
31
  /**
50
32
  * Options for {@link defineVueNodeView}.
51
- *
52
- * @public
53
33
  */
54
34
  interface VueNodeViewOptions extends CoreNodeViewUserOptions<VueNodeViewComponent> {
55
35
  /**
@@ -59,8 +39,6 @@ interface VueNodeViewOptions extends CoreNodeViewUserOptions<VueNodeViewComponen
59
39
  }
60
40
  /**
61
41
  * Defines a node view using a Vue component.
62
- *
63
- * @public
64
42
  */
65
43
  declare function defineVueNodeView(options: VueNodeViewOptions): Extension;
66
44
  interface UseExtensionOptions {
@@ -76,8 +54,6 @@ interface UseExtensionOptions {
76
54
  }
77
55
  /**
78
56
  * Add an extension to the editor.
79
- *
80
- * @public
81
57
  */
82
58
  declare function useExtension(
83
59
  /**
@@ -88,8 +64,6 @@ declare function useExtension(
88
64
  extension: MaybeRefOrGetter<Extension | null>, options?: UseExtensionOptions): void;
89
65
  /**
90
66
  * Calls the given handler whenever the editor document changes.
91
- *
92
- * @public
93
67
  */
94
68
  declare function useDocChange(handler: (doc: ProseMirrorNode) => void, options?: UseExtensionOptions): void;
95
69
  interface UseEditorDerivedOptions<E extends Extension = any> {
@@ -108,8 +82,6 @@ interface UseEditorDerivedOptions<E extends Extension = any> {
108
82
  *
109
83
  * It returns a shallow ref of the derived value that updates whenever the editor
110
84
  * state changes.
111
- *
112
- * @public
113
85
  */
114
86
  declare function useEditorDerivedValue<E extends Extension, Derived>(
115
87
  /**
@@ -122,8 +94,6 @@ declare function useEditorDerivedValue<E extends Extension, Derived>(
122
94
  derive: (editor: Editor<E>) => Derived, options?: UseEditorDerivedOptions<E>): ShallowRef<Derived>;
123
95
  /**
124
96
  * Retrieves the editor instance from the nearest ProseKit component.
125
- *
126
- * @public
127
97
  */
128
98
  declare function useEditor<E extends Extension = any>(options?: {
129
99
  /**
@@ -137,8 +107,6 @@ declare function useEditor<E extends Extension = any>(options?: {
137
107
  declare function useKeymap(keymap: MaybeRefOrGetter<Keymap>, options?: UseExtensionOptions): void;
138
108
  /**
139
109
  * Calls the given handler whenever the editor state changes.
140
- *
141
- * @public
142
110
  */
143
111
  declare function useStateUpdate(handler: (state: EditorState) => void, options?: UseExtensionOptions): void;
144
112
  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 };
@@ -1 +1 @@
1
- {"version":3,"file":"index.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-derived-value.ts","../src/hooks/use-editor.ts","../src/hooks/use-keymap.ts","../src/hooks/use-state-update.ts"],"mappings":";;;;;;UAOiB,aAAA;EACf,MAAA,EAAQ,MAAA;AAAA;;;AADV;;;cASa,QAAA,EAAU,sBAAA,CAAuB,aAAA;;;;UCF7B,gBAAA,SAAyB,eAAA;;;;KAK9B,oBAAA,GAAuB,eAAA,CAAgB,gBAAA;;;;;;UAOlC,kBAAA,SAA2B,uBAAA,CAAwB,oBAAA;EAZlC;;;EAgBhC,IAAA;AAAA;AAJF;;;;;AAAA,iBA2CgB,iBAAA,CAAkB,OAAA,EAAS,kBAAA,GAAqB,SAAA;;;;UCvD/C,gBAAA,SAAyB,eAAA;;;;KAK9B,oBAAA,GAAuB,eAAA,CAAgB,gBAAA;;;;;;UAOlC,kBAAA,SAA2B,uBAAA,CAAwB,oBAAA;EDZlC;;;ECgBhC,IAAA;AAAA;ADJF;;;;;AAAA,iBC2CgB,iBAAA,CAAkB,OAAA,EAAS,kBAAA,GAAqB,SAAA;AAAA,UC/D/C,mBAAA;;;;;EAKf,MAAA,GAAS,gBAAA,CAAiB,MAAA;EHJE;;;EGS5B,QAAA,GAAW,QAAA;AAAA;;;;;;iBAQG,YAAA;;;;;;AAKd,SAAA,EAAW,gBAAA,CAAiB,SAAA,UAC5B,OAAA,GAAU,mBAAA;;;;;;iBCpBI,YAAA,CACd,OAAA,GAAU,GAAA,EAAK,eAAA,WACf,OAAA,GAAU,mBAAA;AAAA,UCPK,uBAAA,WAAkC,SAAA;;;;;EAKjD,MAAA,GAAS,gBAAA,CAAiB,MAAA,CAAO,CAAA;AAAA;;;;ALMnC;;;;;;ACFA;;;iBIWgB,qBAAA,WAAgC,SAAA,UAAA;;AJNhD;;;;;;AIaE,MAAA,GAAS,MAAA,EAAQ,MAAA,CAAO,CAAA,MAAO,OAAA,EAC/B,OAAA,GAAU,uBAAA,CAAwB,CAAA,IACjC,UAAA,CAAW,OAAA;;;;;;iBCxBE,SAAA,WAAoB,SAAA,OAAA,CAAiB,OAAA;ENHvB;;;;AAS9B;;EMCE,MAAA;AAAA,IACE,UAAA,CAAW,MAAA,CAAO,CAAA;AAAA,iBCbN,SAAA,CACd,MAAA,EAAQ,gBAAA,CAAiB,MAAA,GACzB,OAAA,GAAU,mBAAA;;;;;;iBCGI,cAAA,CACd,OAAA,GAAU,KAAA,EAAO,WAAA,WACjB,OAAA,GAAU,mBAAA"}
1
+ {"version":3,"file":"index.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-derived-value.ts","../src/hooks/use-editor.ts","../src/hooks/use-keymap.ts","../src/hooks/use-state-update.ts"],"mappings":";;;;;;UAOiB,aAAA;EACf,MAAA,EAAQ,MAAM;AAAA;;;AADhB;cAOa,QAAA,EAAU,sBAAsB,CAAC,aAAA;AAAA,UCH7B,gBAAA,SAAyB,eAAe;AAAA,KAE7C,oBAAA,GAAuB,eAAe,CAAC,gBAAA;ADNnD;;;AAAA,UCWiB,kBAAA,SAA2B,uBAAuB,CAAC,oBAAA;EDVpD;AAMhB;;ECQE,IAAA;AAAA;;;AAXuD;iBAgDzC,iBAAA,CAAkB,OAAA,EAAS,kBAAA,GAAqB,SAAS;AAAA,UChDxD,gBAAA,SAAyB,eAAe;AAAA,KAE7C,oBAAA,GAAuB,eAAe,CAAC,gBAAA;AFNnD;;;AAAA,UEWiB,kBAAA,SAA2B,uBAAuB,CAAC,oBAAA;EFVpD;AAMhB;;EEQE,IAAA;AAAA;;;ADXuD;iBCgDzC,iBAAA,CAAkB,OAAA,EAAS,kBAAA,GAAqB,SAAS;AAAA,UCrDxD,mBAAA;;;;;EAKf,MAAA,GAAS,gBAAA,CAAiB,MAAA;EHJE;;;EGS5B,QAAA,GAAW,QAAA;AAAA;;;;iBAMG,YAAA;;AFXhB;;;;AEgBE,SAAA,EAAW,gBAAA,CAAiB,SAAA,UAC5B,OAAA,GAAU,mBAAA;;;;iBCpBI,YAAA,CACd,OAAA,GAAU,GAAA,EAAK,eAAA,WACf,OAAA,GAAU,mBAAmB;AAAA,UCLd,uBAAA,WAAkC,SAAA;;;;;EAKjD,MAAA,GAAS,gBAAA,CAAiB,MAAA,CAAO,CAAA;AAAA;;;ALFnB;AAMhB;;;;AAA2D;;ACH3D;iBIYgB,qBAAA,WAAgC,SAAA,UAAA;;;AJZS;AAEzD;;;;AIiBE,MAAA,GAAS,MAAA,EAAQ,MAAA,CAAO,CAAA,MAAO,OAAA,EAC/B,OAAA,GAAU,uBAAA,CAAwB,CAAA,IACjC,UAAA,CAAW,OAAA;;;;iBCxBE,SAAA,WAAoB,SAAA,OAAA,CAAiB,OAAA;;ANDrD;;;;AACgB;EMOd,MAAA;AAAA,IACE,UAAA,CAAW,MAAA,CAAO,CAAA;AAAA,iBCXN,SAAA,CACd,MAAA,EAAQ,gBAAA,CAAiB,MAAA,GACzB,OAAA,GAAU,mBAAA;;;;iBCCI,cAAA,CACd,OAAA,GAAU,KAAA,EAAO,WAAA,WACjB,OAAA,GAAU,mBAAmB"}
package/dist/index.js CHANGED
@@ -34,8 +34,6 @@ function defineVueMarkViewFactory(renderVueRenderer, removeVueRenderer) {
34
34
  }
35
35
  /**
36
36
  * Defines a mark view using a Vue component.
37
- *
38
- * @public
39
37
  */
40
38
  function defineVueMarkView(options) {
41
39
  return defineMarkViewComponent({
@@ -76,8 +74,6 @@ function defineVueNodeViewFactory(renderVueRenderer, removeVueRenderer) {
76
74
  }
77
75
  /**
78
76
  * Defines a node view using a Vue component.
79
- *
80
- * @public
81
77
  */
82
78
  function defineVueNodeView(options) {
83
79
  return defineNodeViewComponent({
@@ -115,8 +111,6 @@ const ViewRenderer = defineComponent({
115
111
  });
116
112
  /**
117
113
  * The root component for a ProseKit editor.
118
- *
119
- * @public
120
114
  */
121
115
  const ProseKit = defineComponent({
122
116
  name: "ProseKit",
@@ -140,24 +134,18 @@ function usePriorityExtension(extension, priority) {
140
134
  }
141
135
  /**
142
136
  * Add an extension to the editor.
143
- *
144
- * @public
145
137
  */
146
138
  function useExtension(extension, options) {
147
139
  useEditorExtension(options?.editor, usePriorityExtension(extension, options?.priority));
148
140
  }
149
141
  /**
150
142
  * Calls the given handler whenever the editor document changes.
151
- *
152
- * @public
153
143
  */
154
144
  function useDocChange(handler, options) {
155
145
  useExtension(defineDocChangeHandler((view) => handler(view.state.doc)), options);
156
146
  }
157
147
  /**
158
148
  * Retrieves the editor instance from the nearest ProseKit component.
159
- *
160
- * @public
161
149
  */
162
150
  function useEditor(options) {
163
151
  const update = options?.update ?? false;
@@ -182,8 +170,6 @@ function useEditor(options) {
182
170
  *
183
171
  * It returns a shallow ref of the derived value that updates whenever the editor
184
172
  * state changes.
185
- *
186
- * @public
187
173
  */
188
174
  function useEditorDerivedValue(derive, options) {
189
175
  const initialEditor = options?.editor;
@@ -195,8 +181,6 @@ function useKeymap(keymap, options) {
195
181
  }
196
182
  /**
197
183
  * Calls the given handler whenever the editor state changes.
198
- *
199
- * @public
200
184
  */
201
185
  function useStateUpdate(handler, options) {
202
186
  useExtension(defineUpdateHandler((view) => handler(view.state)), options);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/extensions/vue-mark-view.ts","../src/extensions/vue-node-view.ts","../src/hooks/use-editor-extension.ts","../src/components/view-renderer.ts","../src/components/prosekit.ts","../src/hooks/use-priority-extension.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":["import { defineMarkViewComponent, defineMarkViewFactory, type Extension } from '@prosekit/core'\nimport type { CoreMarkViewUserOptions } from '@prosemirror-adapter/core'\nimport {\n AbstractVueMarkView,\n buildVueMarkViewCreator,\n type MarkViewContext,\n type VueRendererComponent,\n type VueRendererResult,\n} from '@prosemirror-adapter/vue'\nimport { defineComponent, h, markRaw, Teleport, type DefineComponent } from 'vue'\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\nclass ProseKitVueMarkView extends AbstractVueMarkView<VueMarkViewComponent> {\n render = (): VueRendererComponent => {\n const UserComponent = this.component\n const render = () => {\n const props = this.context\n return h(Teleport, { key: this.key, to: this.dom }, [h(UserComponent, props)])\n }\n const RendererComponent: VueRendererComponent = defineComponent({\n name: 'ProsemirrorMarkView',\n setup: () => {\n return render\n },\n })\n return markRaw(RendererComponent)\n }\n}\n\n/**\n * @internal\n */\nexport function defineVueMarkViewFactory(\n renderVueRenderer: VueRendererResult['renderVueRenderer'],\n removeVueRenderer: VueRendererResult['removeVueRenderer'],\n): Extension {\n const factory = buildVueMarkViewCreator(renderVueRenderer, removeVueRenderer, ProseKitVueMarkView)\n return defineMarkViewFactory<VueMarkViewOptions>({\n group: 'vue',\n factory,\n })\n}\n\n/**\n * Defines a mark view using a Vue component.\n *\n * @public\n */\nexport function defineVueMarkView(options: VueMarkViewOptions): Extension {\n return defineMarkViewComponent<VueMarkViewOptions>({\n group: 'vue',\n name: options.name,\n args: options,\n })\n}\n","import { defineNodeViewComponent, defineNodeViewFactory, type Extension } from '@prosekit/core'\nimport type { CoreNodeViewUserOptions } from '@prosemirror-adapter/core'\nimport {\n AbstractVueNodeView,\n buildVueNodeViewCreator,\n type NodeViewContext,\n type VueRendererComponent,\n type VueRendererResult,\n} from '@prosemirror-adapter/vue'\nimport { defineComponent, h, markRaw, Teleport, type DefineComponent } from 'vue'\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\nclass ProseKitVueNodeView extends AbstractVueNodeView<VueNodeViewComponent> {\n render = (): VueRendererComponent => {\n const UserComponent = this.component\n const render = () => {\n const props = this.context\n return h(Teleport, { key: this.key, to: this.dom }, [h(UserComponent, props)])\n }\n const RendererComponent: VueRendererComponent = defineComponent({\n name: 'ProsemirrorNodeView',\n setup: () => {\n return render\n },\n })\n return markRaw(RendererComponent)\n }\n}\n\n/**\n * @internal\n */\nexport function defineVueNodeViewFactory(\n renderVueRenderer: VueRendererResult['renderVueRenderer'],\n removeVueRenderer: VueRendererResult['removeVueRenderer'],\n): Extension {\n const factory = buildVueNodeViewCreator(renderVueRenderer, removeVueRenderer, ProseKitVueNodeView)\n return defineNodeViewFactory<VueNodeViewOptions>({\n group: 'vue',\n factory,\n })\n}\n\n/**\n * Defines a node view using a Vue component.\n *\n * @public\n */\nexport function defineVueNodeView(options: VueNodeViewOptions): Extension {\n return defineNodeViewComponent<VueNodeViewOptions>({\n group: 'vue',\n name: options.name,\n args: options,\n })\n}\n","import { EditorNotFoundError, type Editor, type Extension } from '@prosekit/core'\nimport { toValue, watchPostEffect, type MaybeRefOrGetter } from 'vue'\n\nimport { useEditorContext } from '../injection/editor-context.ts'\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 { union, type Editor } from '@prosekit/core'\nimport { useVueRenderer } from '@prosemirror-adapter/vue'\nimport { defineComponent, type DefineSetupFnComponent, type PropType } from 'vue'\n\nimport { defineVueMarkViewFactory } from '../extensions/vue-mark-view.ts'\nimport { defineVueNodeViewFactory } from '../extensions/vue-node-view.ts'\nimport { useEditorExtension } from '../hooks/use-editor-extension.ts'\n\n/**\n * @internal\n */\ninterface ViewRendererProps {\n editor: Editor\n}\n\n/**\n * @internal\n */\nexport const ViewRenderer: DefineSetupFnComponent<ViewRendererProps> = defineComponent<ViewRendererProps>({\n name: 'ViewRenderer',\n props: { editor: { type: Object as PropType<Editor>, required: true } },\n setup: (props, { slots }) => {\n const { renderVueRenderer, removeVueRenderer, render } = useVueRenderer()\n\n const extension = union([\n defineVueMarkViewFactory(renderVueRenderer, removeVueRenderer),\n defineVueNodeViewFactory(renderVueRenderer, removeVueRenderer),\n ])\n\n useEditorExtension(() => props.editor, extension)\n\n return () => [slots.default?.(), render()]\n },\n})\n","import type { Editor } from '@prosekit/core'\nimport { defineComponent, h, type DefineSetupFnComponent, type PropType } from 'vue'\n\nimport { provideEditor } from '../injection/editor-context.ts'\n\nimport { ViewRenderer } from './view-renderer.ts'\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 h(\n ViewRenderer,\n { editor: props.editor },\n () => slots.default?.(),\n )\n },\n})\n","import { withPriority, type Extension, type Priority } from '@prosekit/core'\nimport { computed, toValue, type ComputedRef, type MaybeRefOrGetter } 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 { Editor, Extension, Priority } from '@prosekit/core'\nimport type { MaybeRefOrGetter } from 'vue'\n\nimport { useEditorExtension } from './use-editor-extension.ts'\nimport { usePriorityExtension } from './use-priority-extension.ts'\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 { defineDocChangeHandler } from '@prosekit/core'\nimport type { ProseMirrorNode } from '@prosekit/pm/model'\n\nimport { useExtension, type UseExtensionOptions } from './use-extension.ts'\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 { defineMountHandler, defineUpdateHandler, ProseKitError, union, type Editor, type Extension } from '@prosekit/core'\nimport { onMounted, onUnmounted, shallowRef, triggerRef, type ShallowRef } from 'vue'\n\nimport { useEditorContext } from '../injection/editor-context.ts'\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 const forceUpdate = () => triggerRef(editorRef)\n onMounted(() => {\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 { Editor, Extension } from '@prosekit/core'\nimport { computed, toValue, type MaybeRefOrGetter, type Ref, type ShallowRef } from 'vue'\n\nimport { useEditor } from './use-editor.ts'\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 { defineKeymap, type Keymap } from '@prosekit/core'\nimport { computed, toValue, type MaybeRefOrGetter } from 'vue'\n\nimport { useExtension, type UseExtensionOptions } from './use-extension.ts'\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 { useExtension, type UseExtensionOptions } from './use-extension.ts'\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":";;;;AAiCA,IAAM,sBAAN,cAAkC,oBAA0C;;;sBACrC;GACnC,MAAM,gBAAgB,KAAK;GAC3B,MAAM,eAAe;IACnB,MAAM,QAAQ,KAAK;IACnB,OAAO,EAAE,UAAU;KAAE,KAAK,KAAK;KAAK,IAAI,KAAK;KAAK,EAAE,CAAC,EAAE,eAAe,MAAM,CAAC,CAAC;;GAQhF,OAAO,QANyC,gBAAgB;IAC9D,MAAM;IACN,aAAa;KACX,OAAO;;IAEV,CAC+B,CAAC;;;;;;;AAOrC,SAAgB,yBACd,mBACA,mBACW;CAEX,OAAO,sBAA0C;EAC/C,OAAO;EACP,SAHc,wBAAwB,mBAAmB,mBAAmB,oBAGrE;EACR,CAAC;;;;;;;AAQJ,SAAgB,kBAAkB,SAAwC;CACxE,OAAO,wBAA4C;EACjD,OAAO;EACP,MAAM,QAAQ;EACd,MAAM;EACP,CAAC;;ACzCJ,IAAM,sBAAN,cAAkC,oBAA0C;;;sBACrC;GACnC,MAAM,gBAAgB,KAAK;GAC3B,MAAM,eAAe;IACnB,MAAM,QAAQ,KAAK;IACnB,OAAO,EAAE,UAAU;KAAE,KAAK,KAAK;KAAK,IAAI,KAAK;KAAK,EAAE,CAAC,EAAE,eAAe,MAAM,CA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AAgB,qBACd,WACA,UACuB;CACvB,OAAO,eAAe;EACpB,MAAM,MAAM,QAAQ,UAAU;EAC9B,OAAO,OAAO,WAAW,aAAa,KAAK,SAAS,GAAG;GACvD;;;;;;;ACWJ,SAAgB,aAKd,WACA,SACM;CACN,mBACE,SAAS,QACT,qBAAqB,WAAW,SAAS,SAAS,CACnD;;;;;;;ACzBH,SAAgB,aACd,SACA,SACM;CAEN,aADkB,wBAAwB,SAAS,QAAQ,KAAK,MAAM,IAAI,CACpD,EAAE,QAAQ;;;;;;;ACLlC,SAAgB,UAAqC,SAQ3B;CACxB,MAAM,SAAS,SAAS,UAAU;CAElC,MAAM,SAAS,kBAAqB;CACpC,IAAI,CAAC,QACH,MAAM,IAAI,cACR,uDACD;CAGH,MAAM,YAAY,WAAsB,OAAO;CAE/C,IAAI,QAAQ;EACV,MAAM,oBAAoB,WAAW,UAAU;EAC/C,gBAAgB;GACd,MAAM,YAAY,MAChB,mBAAmB,YAAY,EAC/B,oBAAoB,YAAY,CACjC;GAED,YADgB,OAAO,IAAI,UACR,CAAC;IACpB;;CAGJ,OAAO;;;;;;;;;;;;;;ACjBT,SAAgB,sBAOd,QACA,SACqB;CACrB,MAAM,gBAAgB,SAAS;CAC/B,MAAM,iBAAiC,gBACnC,eAAe,QAAQ,cAAc,CAAC,GACtC,UAAa,EAAE,QAAQ,MAAM,CAAC;CAElC,OAAO,eAAe,OAAO,QAAQ,eAAe,CAAC,CAAC;;ACnCxD,SAAgB,UACd,QACA,SACM;CAEN,aADkB,eAAe,aAAa,QAAQ,OAAO,CAAC,CACxC,EAAE,QAAQ;;;;;;;ACAlC,SAAgB,eACd,SACA,SACM;CAEN,aADkB,qBAAqB,SAAS,QAAQ,KAAK,MAAM,CAC7C,EAAE,QAAQ"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/extensions/vue-mark-view.ts","../src/extensions/vue-node-view.ts","../src/hooks/use-editor-extension.ts","../src/components/view-renderer.ts","../src/components/prosekit.ts","../src/hooks/use-priority-extension.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":["import { defineMarkViewComponent, defineMarkViewFactory, type Extension } from '@prosekit/core'\nimport type { CoreMarkViewUserOptions } from '@prosemirror-adapter/core'\nimport {\n AbstractVueMarkView,\n buildVueMarkViewCreator,\n type MarkViewContext,\n type VueRendererComponent,\n type VueRendererResult,\n} from '@prosemirror-adapter/vue'\nimport { defineComponent, h, markRaw, Teleport, type DefineComponent } from 'vue'\n\nexport interface VueMarkViewProps extends MarkViewContext {}\n\nexport type VueMarkViewComponent = DefineComponent<VueMarkViewProps, any, any>\n\n/**\n * Options for {@link defineVueMarkView}.\n */\nexport interface VueMarkViewOptions extends CoreMarkViewUserOptions<VueMarkViewComponent> {\n /**\n * The name of the mark type.\n */\n name: string\n}\n\nclass ProseKitVueMarkView extends AbstractVueMarkView<VueMarkViewComponent> {\n render = (): VueRendererComponent => {\n const UserComponent = this.component\n const render = () => {\n const props = this.context\n return h(Teleport, { key: this.key, to: this.dom }, [h(UserComponent, props)])\n }\n const RendererComponent: VueRendererComponent = defineComponent({\n name: 'ProsemirrorMarkView',\n setup: () => {\n return render\n },\n })\n return markRaw(RendererComponent)\n }\n}\n\n/**\n * @internal\n */\nexport function defineVueMarkViewFactory(\n renderVueRenderer: VueRendererResult['renderVueRenderer'],\n removeVueRenderer: VueRendererResult['removeVueRenderer'],\n): Extension {\n const factory = buildVueMarkViewCreator(renderVueRenderer, removeVueRenderer, ProseKitVueMarkView)\n return defineMarkViewFactory<VueMarkViewOptions>({\n group: 'vue',\n factory,\n })\n}\n\n/**\n * Defines a mark view using a Vue component.\n */\nexport function defineVueMarkView(options: VueMarkViewOptions): Extension {\n return defineMarkViewComponent<VueMarkViewOptions>({\n group: 'vue',\n name: options.name,\n args: options,\n })\n}\n","import { defineNodeViewComponent, defineNodeViewFactory, type Extension } from '@prosekit/core'\nimport type { CoreNodeViewUserOptions } from '@prosemirror-adapter/core'\nimport {\n AbstractVueNodeView,\n buildVueNodeViewCreator,\n type NodeViewContext,\n type VueRendererComponent,\n type VueRendererResult,\n} from '@prosemirror-adapter/vue'\nimport { defineComponent, h, markRaw, Teleport, type DefineComponent } from 'vue'\n\nexport interface VueNodeViewProps extends NodeViewContext {}\n\nexport type VueNodeViewComponent = DefineComponent<VueNodeViewProps, any, any>\n\n/**\n * Options for {@link defineVueNodeView}.\n */\nexport interface VueNodeViewOptions extends CoreNodeViewUserOptions<VueNodeViewComponent> {\n /**\n * The name of the node type.\n */\n name: string\n}\n\nclass ProseKitVueNodeView extends AbstractVueNodeView<VueNodeViewComponent> {\n render = (): VueRendererComponent => {\n const UserComponent = this.component\n const render = () => {\n const props = this.context\n return h(Teleport, { key: this.key, to: this.dom }, [h(UserComponent, props)])\n }\n const RendererComponent: VueRendererComponent = defineComponent({\n name: 'ProsemirrorNodeView',\n setup: () => {\n return render\n },\n })\n return markRaw(RendererComponent)\n }\n}\n\n/**\n * @internal\n */\nexport function defineVueNodeViewFactory(\n renderVueRenderer: VueRendererResult['renderVueRenderer'],\n removeVueRenderer: VueRendererResult['removeVueRenderer'],\n): Extension {\n const factory = buildVueNodeViewCreator(renderVueRenderer, removeVueRenderer, ProseKitVueNodeView)\n return defineNodeViewFactory<VueNodeViewOptions>({\n group: 'vue',\n factory,\n })\n}\n\n/**\n * Defines a node view using a Vue component.\n */\nexport function defineVueNodeView(options: VueNodeViewOptions): Extension {\n return defineNodeViewComponent<VueNodeViewOptions>({\n group: 'vue',\n name: options.name,\n args: options,\n })\n}\n","import { EditorNotFoundError, type Editor, type Extension } from '@prosekit/core'\nimport { toValue, watchPostEffect, type MaybeRefOrGetter } from 'vue'\n\nimport { useEditorContext } from '../injection/editor-context.ts'\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 { union, type Editor } from '@prosekit/core'\nimport { useVueRenderer } from '@prosemirror-adapter/vue'\nimport { defineComponent, type DefineSetupFnComponent, type PropType } from 'vue'\n\nimport { defineVueMarkViewFactory } from '../extensions/vue-mark-view.ts'\nimport { defineVueNodeViewFactory } from '../extensions/vue-node-view.ts'\nimport { useEditorExtension } from '../hooks/use-editor-extension.ts'\n\n/**\n * @internal\n */\ninterface ViewRendererProps {\n editor: Editor\n}\n\n/**\n * @internal\n */\nexport const ViewRenderer: DefineSetupFnComponent<ViewRendererProps> = defineComponent<ViewRendererProps>({\n name: 'ViewRenderer',\n props: { editor: { type: Object as PropType<Editor>, required: true } },\n setup: (props, { slots }) => {\n const { renderVueRenderer, removeVueRenderer, render } = useVueRenderer()\n\n const extension = union([\n defineVueMarkViewFactory(renderVueRenderer, removeVueRenderer),\n defineVueNodeViewFactory(renderVueRenderer, removeVueRenderer),\n ])\n\n useEditorExtension(() => props.editor, extension)\n\n return () => [slots.default?.(), render()]\n },\n})\n","import type { Editor } from '@prosekit/core'\nimport { defineComponent, h, type DefineSetupFnComponent, type PropType } from 'vue'\n\nimport { provideEditor } from '../injection/editor-context.ts'\n\nimport { ViewRenderer } from './view-renderer.ts'\n\nexport interface ProseKitProps {\n editor: Editor\n}\n\n/**\n * The root component for a ProseKit editor.\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 h(\n ViewRenderer,\n { editor: props.editor },\n () => slots.default?.(),\n )\n },\n})\n","import { withPriority, type Extension, type Priority } from '@prosekit/core'\nimport { computed, toValue, type ComputedRef, type MaybeRefOrGetter } 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 { Editor, Extension, Priority } from '@prosekit/core'\nimport type { MaybeRefOrGetter } from 'vue'\n\nimport { useEditorExtension } from './use-editor-extension.ts'\nimport { usePriorityExtension } from './use-priority-extension.ts'\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 */\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 { defineDocChangeHandler } from '@prosekit/core'\nimport type { ProseMirrorNode } from '@prosekit/pm/model'\n\nimport { useExtension, type UseExtensionOptions } from './use-extension.ts'\n\n/**\n * Calls the given handler whenever the editor document changes.\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 { defineMountHandler, defineUpdateHandler, ProseKitError, union, type Editor, type Extension } from '@prosekit/core'\nimport { onMounted, onUnmounted, shallowRef, triggerRef, type ShallowRef } from 'vue'\n\nimport { useEditorContext } from '../injection/editor-context.ts'\n\n/**\n * Retrieves the editor instance from the nearest ProseKit component.\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 const forceUpdate = () => triggerRef(editorRef)\n onMounted(() => {\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 { Editor, Extension } from '@prosekit/core'\nimport { computed, toValue, type MaybeRefOrGetter, type Ref, type ShallowRef } from 'vue'\n\nimport { useEditor } from './use-editor.ts'\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 */\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 { defineKeymap, type Keymap } from '@prosekit/core'\nimport { computed, toValue, type MaybeRefOrGetter } from 'vue'\n\nimport { useExtension, type UseExtensionOptions } from './use-extension.ts'\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 { useExtension, type UseExtensionOptions } from './use-extension.ts'\n\n/**\n * Calls the given handler whenever the editor state changes.\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":";;;;AAyBA,IAAM,sBAAN,cAAkC,oBAA0C;;;sBACrC;GACnC,MAAM,gBAAgB,KAAK;GAC3B,MAAM,eAAe;IACnB,MAAM,QAAQ,KAAK;IACnB,OAAO,EAAE,UAAU;KAAE,KAAK,KAAK;KAAK,IAAI,KAAK;IAAI,GAAG,CAAC,EAAE,eAAe,KAAK,CAAC,CAAC;GAC/E;GAOA,OAAO,QANyC,gBAAgB;IAC9D,MAAM;IACN,aAAa;KACX,OAAO;IACT;GACF,CAC+B,CAAC;EAClC;;AACF;;;;AAKA,SAAgB,yBACd,mBACA,mBACW;CAEX,OAAO,sBAA0C;EAC/C,OAAO;EACP,SAHc,wBAAwB,mBAAmB,mBAAmB,mBAGtE;CACR,CAAC;AACH;;;;AAKA,SAAgB,kBAAkB,SAAwC;CACxE,OAAO,wBAA4C;EACjD,OAAO;EACP,MAAM,QAAQ;EACd,MAAM;CACR,CAAC;AACH;ACxCA,IAAM,sBAAN,cAAkC,oBAA0C;;;sBACrC;GACnC,MAAM,gBAAgB,KAAK;GAC3B,MAAM,eAAe;IACnB,MAAM,QAAQ,KAAK;IACnB,OAAO,EAAE,UAAU;KAAE,KAAK,KAAK;KAAK,IAAI,KAAK;IAAI,GAAG,CAAC,EAAE,eAAe,KAAK,CAAC,CAAC;GAC/E;GAOA,OAAO,QANyC,gBAAgB;IAC9D,MAAM;IACN,aAAa;KACX,OAAO;IACT;GACF,CAC+B,CAAC;EAClC;;AACF;;;;AAKA,SAAgB,yBACd,mBACA,mBACW;CAEX,OAAO,sBAA0C;EAC/C,O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,SAAgB,aAKd,WACA,SACM;CACN,mBACE,SAAS,QACT,qBAAqB,WAAW,SAAS,QAAQ,CACnD;AACF;;;;AC1BA,SAAgB,aACd,SACA,SACM;CAEN,aADkB,wBAAwB,SAAS,QAAQ,KAAK,MAAM,GAAG,CACpD,GAAG,OAAO;AACjC;;;;ACNA,SAAgB,UAAqC,SAQ3B;CACxB,MAAM,SAAS,SAAS,UAAU;CAElC,MAAM,SAAS,iBAAoB;CACnC,IAAI,CAAC,QACH,MAAM,IAAI,cACR,sDACF;CAGF,MAAM,YAAY,WAAsB,MAAM;CAE9C,IAAI,QAAQ;EACV,MAAM,oBAAoB,WAAW,SAAS;EAC9C,gBAAgB;GACd,MAAM,YAAY,MAChB,mBAAmB,WAAW,GAC9B,oBAAoB,WAAW,CACjC;GAEA,YADgB,OAAO,IAAI,SACT,CAAC;EACrB,CAAC;CACH;CAEA,OAAO;AACT;;;;;;;;;;;AClBA,SAAgB,sBAOd,QACA,SACqB;CACrB,MAAM,gBAAgB,SAAS;CAC/B,MAAM,iBAAiC,gBACnC,eAAe,QAAQ,aAAa,CAAC,IACrC,UAAa,EAAE,QAAQ,KAAK,CAAC;CAEjC,OAAO,eAAe,OAAO,QAAQ,cAAc,CAAC,CAAC;AACvD;AClCA,SAAgB,UACd,QACA,SACM;CAEN,aADkB,eAAe,aAAa,QAAQ,MAAM,CAAC,CACxC,GAAG,OAAO;AACjC;;;;ACHA,SAAgB,eACd,SACA,SACM;CAEN,aADkB,qBAAqB,SAAS,QAAQ,KAAK,KAAK,CAC7C,GAAG,OAAO;AACjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"inline-popover.d.ts","names":[],"sources":["../src/components/inline-popover/inline-popover-popup.gen.ts","../src/components/inline-popover/inline-popover-positioner.gen.ts","../src/components/inline-popover/inline-popover-root.gen.ts"],"mappings":";;;UAMiB,uBAAA;;cAGJ,kBAAA,EAAoB,sBAAA,CAAuB,uBAAA,GAA0B,cAAA;;UCHjE,4BAAA;EDAuB;;;;AAGxC;ECGE,SAAA,GAAY,8BAAA;;;;;;EAMZ,MAAA,GAAS,8BAAA;EDTsB;;;;;;ECgB/B,IAAA,GAAO,8BAAA;EAnBoC;;;;;;EA0B3C,KAAA,GAAQ,8BAAA;EAcC;;;;;;EAPT,OAAA,GAAU,8BAAA;EAwDE;;;;;;EAjDZ,MAAA,GAAS,8BAAA;EAsFwC;;;;;EAhFjD,eAAA,GAAkB,8BAAA;EA3BX;;;;;EAiCP,QAAA,GAAW,8BAAA;EAZF;;;;;;;EAoBT,UAAA,GAAa,8BAAA;EASN;;;;;;;;EAAP,IAAA,GAAO,8BAAA;EAkCP;;;;;EA5BA,KAAA,GAAQ,8BAAA;EAmDR;;;;AAIF;;EAhDE,WAAA,GAAc,8BAAA;EAgD6C;;;;;;EAzC3D,SAAA,GAAY,8BAAA;EAyC8E;;;;AChI5F;;ED8FE,UAAA,GAAa,8BAAA;ECvFJ;;;;;;ED8FT,QAAA,GAAW,8BAAA;ECpEmC;;;;;;ED2E9C,YAAA,GAAe,8BAAA;EClFf;;;;;;;ED0FA,cAAA,GAAiB,8BAAA;ECnF2C;AAI9D;;;;;;EDuFE,WAAA,GAAc,8BAAA;AAAA;;cAIH,uBAAA,EAAyB,sBAAA,CAAuB,4BAAA,GAA+B,cAAA;;UChI3E,sBAAA;EFFuB;;;;AAGxC;;EEME,MAAA,GAAS,wBAAA;EFN6C;;;;;;EEatD,WAAA,GAAc,wBAAA;EFbkE;;;;ACHlF;;ECuBE,eAAA,GAAkB,wBAAA;EDjBN;;;;ECsBZ,IAAA,GAAO,wBAAA;EDYE;;;;ECPT,QAAA,GAAW,wBAAA;ED0CH;ECxCR,YAAA,IAAgB,KAAA,EAAO,uBAAA;AAAA;;cAIZ,iBAAA,EAAmB,sBAAA,CAAuB,sBAAA,GAAyB,cAAA"}
1
+ {"version":3,"file":"inline-popover.d.ts","names":[],"sources":["../src/components/inline-popover/inline-popover-popup.gen.ts","../src/components/inline-popover/inline-popover-positioner.gen.ts","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AA;;cAIZ,iBAAA,EAAmB,sBAAA,CAAuB,sBAAA,GAAyB,cAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"inline-popover.js","names":[],"sources":["../src/components/inline-popover/inline-popover-popup.gen.ts","../src/components/inline-popover/inline-popover-positioner.gen.ts","../src/components/inline-popover/inline-popover-root.gen.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerInlinePopoverPopupElement } from '@prosekit/web/inline-popover';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes } from 'vue';\n\n/** Props for the {@link InlinePopoverPopup} Vue component. */\nexport interface InlinePopoverPopupProps {}\n\n/** A Vue component that renders an `prosekit-inline-popover-popup` custom element. */\nexport const InlinePopoverPopup: DefineSetupFnComponent<InlinePopoverPopupProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<InlinePopoverPopupProps & HTMLAttributes>(\n (props, { slots }) => {\n registerInlinePopoverPopupElement();\n\n return () => {\n return h('prosekit-inline-popover-popup', props, slots.default?.());\n };\n },\n { props: [] },\n);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerInlinePopoverPositionerElement, type InlinePopoverPositionerProps as InlinePopoverPositionerElementProps } from '@prosekit/web/inline-popover';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\n/** Props for the {@link InlinePopoverPositioner} Vue component. */\nexport interface InlinePopoverPositionerProps {\n /**\n * The initial placement of the floating element\n *\n * @default \"top\"\n */\n placement?: InlinePopoverPositionerElementProps['placement'];\n /**\n * The distance between the reference and floating element.\n *\n * @default 12\n */\n offset?: InlinePopoverPositionerElementProps['offset'];\n /**\n * Whether to hide the floating element when the reference element or the\n * floating element is fully clipped.\n *\n * @default true\n */\n hide?: InlinePopoverPositionerElementProps['hide'];\n /**\n * Whether to use the browser [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)\n * to place the floating element on top of other page content.\n *\n * @default false\n */\n hoist?: InlinePopoverPositionerElementProps['hoist'];\n /**\n * Whether the floating element can overlap the reference element to keep it\n * in view.\n *\n * @default true\n */\n overlap?: InlinePopoverPositionerElementProps['overlap'];\n /**\n * Whether to improve positioning for inline reference elements that span over\n * multiple lines.\n *\n * @default true\n */\n inline?: InlinePopoverPositionerElementProps['inline'];\n /**\n * Describes the virtual padding around the boundary to check for overflow.\n *\n * @default 8\n */\n overflowPadding?: InlinePopoverPositionerElementProps['overflowPadding'];\n /**\n * The strategy to use for positioning\n *\n * @default \"absolute\"\n */\n strategy?: InlinePopoverPositionerElementProps['strategy'];\n /**\n * Options to activate auto-update listeners\n *\n * @see https://floating-ui.com/docs/autoUpdate\n *\n * @default true\n */\n autoUpdate?: InlinePopoverPositionerElementProps['autoUpdate'];\n /**\n * Whether to flip the `placement` in order to keep it in view when the\n * preferred placement(s) will overflow the clipping boundary. You can also\n * provide an array of placements to try sequentially if the preferred\n * `placement` does not fit.\n *\n * @default true\n */\n flip?: InlinePopoverPositionerElementProps['flip'];\n /**\n * Whether the floating element should shift to keep it in view.\n *\n * @default true\n */\n shift?: InlinePopoverPositionerElementProps['shift'];\n /**\n * Whether to constrain the floating element's width and height to not exceed\n * the viewport.\n *\n * @default false\n */\n fitViewport?: InlinePopoverPositionerElementProps['fitViewport'];\n /**\n * Whether to constrain the floating element's width so that it matches the\n * reference element.\n *\n * @default false\n */\n sameWidth?: InlinePopoverPositionerElementProps['sameWidth'];\n /**\n * Whether to constrain the floating element's height so that it matches the\n * reference element.\n *\n * @default false\n */\n sameHeight?: InlinePopoverPositionerElementProps['sameHeight'];\n /**\n * Describes the clipping element(s) or area that overflow will be checked relative to.\n * Please see https://floating-ui.com/docs/detectoverflow#boundary for more information.\n *\n * @default 'clippingAncestors'\n */\n boundary?: InlinePopoverPositionerElementProps['boundary'];\n /**\n * Describes the root boundary that the element will be checked for overflow relative to.\n * Please see https://floating-ui.com/docs/detectoverflow#rootboundary for more information.\n *\n * @default 'viewport'\n */\n rootBoundary?: InlinePopoverPositionerElementProps['rootBoundary'];\n /**\n * The element that will be used to check for overflow. Please see\n * https://floating-ui.com/docs/detectoverflow#elementcontext for more\n * information.\n *\n * @default 'floating'\n */\n elementContext?: InlinePopoverPositionerElementProps['elementContext'];\n /**\n * Whether to check the alternate elementContext's boundary. Please see\n * https://floating-ui.com/docs/detectoverflow#altboundary for more\n * information.\n *\n * @default false\n */\n altBoundary?: InlinePopoverPositionerElementProps['altBoundary'];\n}\n\n/** A Vue component that renders an `prosekit-inline-popover-positioner` custom element. */\nexport const InlinePopoverPositioner: DefineSetupFnComponent<InlinePopoverPositionerProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<InlinePopoverPositionerProps & HTMLAttributes>(\n (props, { slots }) => {\n registerInlinePopoverPositionerElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const splittedProps = computed(() => {\n const { altBoundary: p0, autoUpdate: p1, boundary: p2, elementContext: p3, fitViewport: p4, flip: p5, hide: p6, hoist: p7, inline: p8, offset: p9, overflowPadding: p10, overlap: p11, placement: p12, rootBoundary: p13, sameHeight: p14, sameWidth: p15, shift: p16, strategy: p17, ...restProps } = props;\n return [[p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17], restProps] as const;\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17] = splittedProps.value[0];\n\n Object.assign(element, { altBoundary: p0, autoUpdate: p1, boundary: p2, elementContext: p3, fitViewport: p4, flip: p5, hide: p6, hoist: p7, inline: p8, offset: p9, overflowPadding: p10, overlap: p11, placement: p12, rootBoundary: p13, sameHeight: p14, sameWidth: p15, shift: p16, strategy: p17 });\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-inline-popover-positioner', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['altBoundary', 'autoUpdate', 'boundary', 'elementContext', 'fitViewport', 'flip', 'hide', 'hoist', 'inline', 'offset', 'overflowPadding', 'overlap', 'placement', 'rootBoundary', 'sameHeight', 'sameWidth', 'shift', 'strategy'] },\n);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerInlinePopoverRootElement, type InlinePopoverRootEvents, type InlinePopoverRootProps as InlinePopoverRootElementProps } from '@prosekit/web/inline-popover';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\nimport { useEditorContext } from '../../injection/editor-context.ts';\n\n/** Props for the {@link InlinePopoverRoot} Vue component. */\nexport interface InlinePopoverRootProps {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: InlinePopoverRootElementProps['editor'];\n /**\n * Whether the popover is open by default when some inline content is\n * selected.\n *\n * @default true\n */\n defaultOpen?: InlinePopoverRootElementProps['defaultOpen'];\n /**\n * Whether the inline popover should be dismissed when the editor receives an\n * Escape key press.\n *\n * @default true\n */\n dismissOnEscape?: InlinePopoverRootElementProps['dismissOnEscape'];\n /**\n * Whether the overlay is currently open.\n * @default null\n */\n open?: InlinePopoverRootElementProps['open'];\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: InlinePopoverRootElementProps['disabled'];\n /** Emitted when the open state of the popover changes. */\n onOpenChange?: (event: InlinePopoverRootEvents['openChange']) => void;\n}\n\n/** A Vue component that renders an `prosekit-inline-popover-root` custom element. */\nexport const InlinePopoverRoot: DefineSetupFnComponent<InlinePopoverRootProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<InlinePopoverRootProps & HTMLAttributes>(\n (props, { slots }) => {\n registerInlinePopoverRootElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const p3Fallback = useEditorContext();\n\n const splittedProps = computed(() => {\n const { defaultOpen: p0, disabled: p1, dismissOnEscape: p2, editor: p3, open: p4, onOpenChange: e0, ...restProps } = props;\n return [[p0, p1, p2, p3, p4, e0], restProps] as const;\n });\n\n const handlers: Array<((event: any) => void) | undefined> = [];\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [p0, p1, p2, p3, p4, e0] = splittedProps.value[0];\n\n Object.assign(element, { defaultOpen: p0, disabled: p1, dismissOnEscape: p2, editor: p3 ?? p3Fallback, open: p4 });\n\n handlers.length = 0;\n handlers.push(e0);\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const ac = new AbortController();\n for (const [index, eventName] of ['openChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlers[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-inline-popover-root', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['defaultOpen', 'disabled', 'dismissOnEscape', 'editor', 'open', 'onOpenChange'] },\n);\n"],"mappings":";;;;AASA,MAAa,qBAAuG,iCACjH,OAAO,EAAE,YAAY;CACpB,mCAAmC;CAEnC,aAAa;EACX,OAAO,EAAE,iCAAiC,OAAO,MAAM,WAAW,CAAC;;GAGvE,EAAE,OAAO,EAAE,EAAE,CACd;;ACsHD,MAAa,0BAAiH,iCAC3H,OAAO,EAAE,YAAY;CACpB,wCAAwC;CAExC,MAAM,aAAa,WAA+B,KAAK;CAEvD,MAAM,gBAAgB,eAAe;EACnC,MAAM,EAAE,aAAa,IAAI,YAAY,IAAI,UAAU,IAAI,gBAAgB,IAAI,aAAa,IAAI,MAAM,IAAI,MAAM,IAAI,OAAO,IAAI,QAAQ,IAAI,QAAQ,IAAI,iBAAiB,KAAK,SAAS,KAAK,WAAW,KAAK,cAAc,KAAK,YAAY,KAAK,WAAW,KAAK,OAAO,KAAK,UAAU,KAAK,GAAG,cAAc;EACvS,OAAO,CAAC;GAAC;GAAI;GAAI;GAAI;GAAI;GAAI;GAAI;GAAI;GAAI;GAAI;G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C,SAAS;EAEd,MAAM,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,MAAM,cAAc,MAAM;EAErD,OAAO,OAAO,SAAS;GAAE,aAAa;GAAI,UAAU;GAAI,iBAAiB;GAAI,QAAQ,MAAM;GAAY,MAAM;GAAI,CAAC;EAElH,SAAS,SAAS;EAClB,SAAS,KAAK,GAAG;GACjB;CAEF,kBAAkB;EAChB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EAEd,MAAM,KAAK,IAAI,iBAAiB;EAChC,KAAK,MAAM,CAAC,OAAO,cAAc,CAAC,aAAa,CAAC,SAAS,EACvD,QAAQ,iBACN,YACC,UAAiB;GAChB,SAAS,SAAS,MAAM;KAE1B,EAAE,QAAQ,GAAG,QAAQ,CACtB;EAEH,aAAa,GAAG,OAAO;GACvB;CAEF,aAAa;EACX,MAAM,YAAY,cAAc,MAAM;EACtC,OAAO,EAAE,gCAAgC;GAAE,GAAG;GAAW,KAAK;GAAY,EAAE,MAAM,WAAW,CAAC;;GAGlG,EAAE,OAAO;CAAC;CAAe;CAAY;CAAmB;CAAU;CAAQ;CAAe,EAAE,CAC5F"}
1
+ {"version":3,"file":"inline-popover.js","names":[],"sources":["../src/components/inline-popover/inline-popover-popup.gen.ts","../src/components/inline-popover/inline-popover-positioner.gen.ts","../src/components/inline-popover/inline-popover-root.gen.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerInlinePopoverPopupElement } from '@prosekit/web/inline-popover';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes } from 'vue';\n\n/** Props for the {@link InlinePopoverPopup} Vue component. */\nexport interface InlinePopoverPopupProps {}\n\n/** A Vue component that renders an `prosekit-inline-popover-popup` custom element. */\nexport const InlinePopoverPopup: DefineSetupFnComponent<InlinePopoverPopupProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<InlinePopoverPopupProps & HTMLAttributes>(\n (props, { slots }) => {\n registerInlinePopoverPopupElement();\n\n return () => {\n return h('prosekit-inline-popover-popup', props, slots.default?.());\n };\n },\n { props: [] },\n);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerInlinePopoverPositionerElement, type InlinePopoverPositionerProps as InlinePopoverPositionerElementProps } from '@prosekit/web/inline-popover';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\n/** Props for the {@link InlinePopoverPositioner} Vue component. */\nexport interface InlinePopoverPositionerProps {\n /**\n * The initial placement of the floating element\n *\n * @default \"top\"\n */\n placement?: InlinePopoverPositionerElementProps['placement'];\n /**\n * The distance between the reference and floating element.\n *\n * @default 12\n */\n offset?: InlinePopoverPositionerElementProps['offset'];\n /**\n * Whether to hide the floating element when the reference element or the\n * floating element is fully clipped.\n *\n * @default true\n */\n hide?: InlinePopoverPositionerElementProps['hide'];\n /**\n * Whether to use the browser [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)\n * to place the floating element on top of other page content.\n *\n * @default false\n */\n hoist?: InlinePopoverPositionerElementProps['hoist'];\n /**\n * Whether the floating element can overlap the reference element to keep it\n * in view.\n *\n * @default true\n */\n overlap?: InlinePopoverPositionerElementProps['overlap'];\n /**\n * Whether to improve positioning for inline reference elements that span over\n * multiple lines.\n *\n * @default true\n */\n inline?: InlinePopoverPositionerElementProps['inline'];\n /**\n * Describes the virtual padding around the boundary to check for overflow.\n *\n * @default 8\n */\n overflowPadding?: InlinePopoverPositionerElementProps['overflowPadding'];\n /**\n * The strategy to use for positioning\n *\n * @default \"absolute\"\n */\n strategy?: InlinePopoverPositionerElementProps['strategy'];\n /**\n * Options to activate auto-update listeners\n *\n * @see https://floating-ui.com/docs/autoUpdate\n *\n * @default true\n */\n autoUpdate?: InlinePopoverPositionerElementProps['autoUpdate'];\n /**\n * Whether to flip the `placement` in order to keep it in view when the\n * preferred placement(s) will overflow the clipping boundary. You can also\n * provide an array of placements to try sequentially if the preferred\n * `placement` does not fit.\n *\n * @default true\n */\n flip?: InlinePopoverPositionerElementProps['flip'];\n /**\n * Whether the floating element should shift to keep it in view.\n *\n * @default true\n */\n shift?: InlinePopoverPositionerElementProps['shift'];\n /**\n * Whether to constrain the floating element's width and height to not exceed\n * the viewport.\n *\n * @default false\n */\n fitViewport?: InlinePopoverPositionerElementProps['fitViewport'];\n /**\n * Whether to constrain the floating element's width so that it matches the\n * reference element.\n *\n * @default false\n */\n sameWidth?: InlinePopoverPositionerElementProps['sameWidth'];\n /**\n * Whether to constrain the floating element's height so that it matches the\n * reference element.\n *\n * @default false\n */\n sameHeight?: InlinePopoverPositionerElementProps['sameHeight'];\n /**\n * Describes the clipping element(s) or area that overflow will be checked relative to.\n * Please see https://floating-ui.com/docs/detectoverflow#boundary for more information.\n *\n * @default 'clippingAncestors'\n */\n boundary?: InlinePopoverPositionerElementProps['boundary'];\n /**\n * Describes the root boundary that the element will be checked for overflow relative to.\n * Please see https://floating-ui.com/docs/detectoverflow#rootboundary for more information.\n *\n * @default 'viewport'\n */\n rootBoundary?: InlinePopoverPositionerElementProps['rootBoundary'];\n /**\n * The element that will be used to check for overflow. Please see\n * https://floating-ui.com/docs/detectoverflow#elementcontext for more\n * information.\n *\n * @default 'floating'\n */\n elementContext?: InlinePopoverPositionerElementProps['elementContext'];\n /**\n * Whether to check the alternate elementContext's boundary. Please see\n * https://floating-ui.com/docs/detectoverflow#altboundary for more\n * information.\n *\n * @default false\n */\n altBoundary?: InlinePopoverPositionerElementProps['altBoundary'];\n}\n\n/** A Vue component that renders an `prosekit-inline-popover-positioner` custom element. */\nexport const InlinePopoverPositioner: DefineSetupFnComponent<InlinePopoverPositionerProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<InlinePopoverPositionerProps & HTMLAttributes>(\n (props, { slots }) => {\n registerInlinePopoverPositionerElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const splittedProps = computed(() => {\n const { altBoundary: p0, autoUpdate: p1, boundary: p2, elementContext: p3, fitViewport: p4, flip: p5, hide: p6, hoist: p7, inline: p8, offset: p9, overflowPadding: p10, overlap: p11, placement: p12, rootBoundary: p13, sameHeight: p14, sameWidth: p15, shift: p16, strategy: p17, ...restProps } = props;\n return [[p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17], restProps] as const;\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17] = splittedProps.value[0];\n\n Object.assign(element, { altBoundary: p0, autoUpdate: p1, boundary: p2, elementContext: p3, fitViewport: p4, flip: p5, hide: p6, hoist: p7, inline: p8, offset: p9, overflowPadding: p10, overlap: p11, placement: p12, rootBoundary: p13, sameHeight: p14, sameWidth: p15, shift: p16, strategy: p17 });\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-inline-popover-positioner', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['altBoundary', 'autoUpdate', 'boundary', 'elementContext', 'fitViewport', 'flip', 'hide', 'hoist', 'inline', 'offset', 'overflowPadding', 'overlap', 'placement', 'rootBoundary', 'sameHeight', 'sameWidth', 'shift', 'strategy'] },\n);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerInlinePopoverRootElement, type InlinePopoverRootEvents, type InlinePopoverRootProps as InlinePopoverRootElementProps } from '@prosekit/web/inline-popover';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\nimport { useEditorContext } from '../../injection/editor-context.ts';\n\n/** Props for the {@link InlinePopoverRoot} Vue component. */\nexport interface InlinePopoverRootProps {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: InlinePopoverRootElementProps['editor'];\n /**\n * Whether the popover is open by default when some inline content is\n * selected.\n *\n * @default true\n */\n defaultOpen?: InlinePopoverRootElementProps['defaultOpen'];\n /**\n * Whether the inline popover should be dismissed when the editor receives an\n * Escape key press.\n *\n * @default true\n */\n dismissOnEscape?: InlinePopoverRootElementProps['dismissOnEscape'];\n /**\n * Whether the overlay is currently open.\n * @default null\n */\n open?: InlinePopoverRootElementProps['open'];\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: InlinePopoverRootElementProps['disabled'];\n /** Emitted when the open state of the popover changes. */\n onOpenChange?: (event: InlinePopoverRootEvents['openChange']) => void;\n}\n\n/** A Vue component that renders an `prosekit-inline-popover-root` custom element. */\nexport const InlinePopoverRoot: DefineSetupFnComponent<InlinePopoverRootProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<InlinePopoverRootProps & HTMLAttributes>(\n (props, { slots }) => {\n registerInlinePopoverRootElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const p3Fallback = useEditorContext();\n\n const splittedProps = computed(() => {\n const { defaultOpen: p0, disabled: p1, dismissOnEscape: p2, editor: p3, open: p4, onOpenChange: e0, ...restProps } = props;\n return [[p0, p1, p2, p3, p4, e0], restProps] as const;\n });\n\n const handlers: Array<((event: any) => void) | undefined> = [];\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [p0, p1, p2, p3, p4, e0] = splittedProps.value[0];\n\n Object.assign(element, { defaultOpen: p0, disabled: p1, dismissOnEscape: p2, editor: p3 ?? p3Fallback, open: p4 });\n\n handlers.length = 0;\n handlers.push(e0);\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const ac = new AbortController();\n for (const [index, eventName] of ['openChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlers[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-inline-popover-root', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['defaultOpen', 'disabled', 'dismissOnEscape', 'editor', 'open', 'onOpenChange']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;EACtC,OAAO,EAAE,gCAAgC;GAAE,GAAG;GAAW,KAAK;EAAW,GAAG,MAAM,UAAU,CAAC;CAC/F;AACF,GACA,EAAE,OAAO;CAAC;CAAe;CAAY;CAAmB;CAAU;CAAQ;AAAc,EAAE,CAC5F"}
@@ -1 +1 @@
1
- {"version":3,"file":"menu.d.ts","names":[],"sources":["../src/components/menu/menu-item.gen.ts","../src/components/menu/menu-popup.gen.ts","../src/components/menu/menu-positioner.gen.ts","../src/components/menu/menu-root.gen.ts","../src/components/menu/menu-submenu-root.gen.ts","../src/components/menu/menu-submenu-trigger.gen.ts","../src/components/menu/menu-trigger.gen.ts"],"mappings":";;;UAMiB,aAAA;EAAa;;;;;EAM5B,KAAA,GAAQ,eAAA;EAcyB;;;;;EARjC,QAAA,GAAW,eAAA;EAMX;;;;;EAAA,aAAA,GAAgB,eAAA;EAE2B;EAA3C,QAAA,IAAY,KAAA,EAAO,cAAA;AAAA;;cAIR,QAAA,EAAU,sBAAA,CAAuB,aAAA,GAAgB,cAAA;;UCxB7C,cAAA;EDAa;;;;;;ECO5B,WAAA,GAAc,gBAAA;AAAA;;cAIH,SAAA,EAAW,sBAAA,CAAuB,cAAA,GAAiB,cAAA;;UCX/C,mBAAA;EFAa;;;;;EEM5B,SAAA,GAAY,qBAAA;EFcqB;;;;;EERjC,QAAA,GAAW,qBAAA;EFMX;;;;;;;EEEA,UAAA,GAAa,qBAAA;EFoDd;;;;;;EE7CC,KAAA,GAAQ,qBAAA;EFHa;;;;;EESrB,MAAA,GAAS,qBAAA;EDjCM;;;;;AAWjB;;;EC+BE,IAAA,GAAO,qBAAA;ED/BuD;;;;;ECqC9D,KAAA,GAAQ,qBAAA;EDrCsD;;;;ACXhE;;EAuDE,OAAA,GAAU,qBAAA;EAjDE;;;;;;EAwDZ,WAAA,GAAc,qBAAA;EAPJ;;;;;;EAcV,SAAA,GAAY,qBAAA;EAmCG;;;;;;EA5Bf,UAAA,GAAa,qBAAA;EAtED;;;;;;EA6EZ,MAAA,GAAS,qBAAA;EAlDT;;;;;;EAyDA,IAAA,GAAO,qBAAA;EAnCG;;;;;;EA0CV,QAAA,GAAW,qBAAA;EAdX;;;;;;EAqBA,YAAA,GAAe,qBAAA;EAAA;;;;;;EAOf,eAAA,GAAkB,qBAAA;EAgBsB;;AAI1C;;;;;EAZE,cAAA,GAAiB,qBAAA;EAYgC;;;;;;;EAJjD,WAAA,GAAc,qBAAA;AAAA;;cAIH,cAAA,EAAgB,sBAAA,CAAuB,mBAAA,GAAsB,cAAA;;UCnIzD,aAAA;EHAa;;;;EGK5B,WAAA,GAAc,eAAA;EHeK;;;;EGVnB,IAAA,GAAO,eAAA;EHEP;;;;EGGA,QAAA,GAAW,eAAA;EHKQ;EGHnB,YAAA,IAAgB,KAAA,EAAO,cAAA;AAAA;;cAIZ,QAAA,EAAU,sBAAA,CAAuB,aAAA,GAAgB,cAAA;;UCrB7C,oBAAA;EJAa;;;;EIK5B,WAAA,GAAc,sBAAA;EJeK;;;;EIVnB,IAAA,GAAO,sBAAA;EJEP;;;;EIGA,QAAA,GAAW,sBAAA;EJKQ;EIHnB,YAAA,IAAgB,KAAA,EAAO,qBAAA;AAAA;;cAIZ,eAAA,EAAiB,sBAAA,CAAuB,oBAAA,GAAuB,cAAA;;UCrB3D,uBAAA;ELAa;;;;;EKM5B,KAAA,GAAQ,yBAAA;ELcyB;;;;;EKRjC,QAAA,GAAW,yBAAA;AAAA;;cAIA,kBAAA,EAAoB,sBAAA,CAAuB,uBAAA,GAA0B,cAAA;;UChBjE,gBAAA;ENAa;;;;;EMM5B,QAAA,GAAW,kBAAA;ENcsB;EMZjC,YAAA,IAAgB,KAAA,EAAO,iBAAA;AAAA;;cAIZ,WAAA,EAAa,sBAAA,CAAuB,gBAAA,GAAmB,cAAA"}
1
+ {"version":3,"file":"menu.d.ts","names":[],"sources":["../src/components/menu/menu-item.gen.ts","../src/components/menu/menu-popup.gen.ts","../src/components/menu/menu-positioner.gen.ts","../src/components/menu/menu-root.g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