@prosekit/vue 0.7.0-beta.2 → 0.7.0-beta.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.
|
@@ -41,6 +41,13 @@ interface InlinePopoverPositionerProps {
|
|
|
41
41
|
* @default true
|
|
42
42
|
*/
|
|
43
43
|
hide?: InlinePopoverPositionerProps$1['hide'];
|
|
44
|
+
/**
|
|
45
|
+
* Whether to use the browser [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)
|
|
46
|
+
* to place the floating element on top of other page content.
|
|
47
|
+
*
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
hoist?: InlinePopoverPositionerProps$1['hoist'];
|
|
44
51
|
/**
|
|
45
52
|
* Whether the floating element can overlap the reference element to keep it
|
|
46
53
|
* in view.
|
|
@@ -75,13 +82,6 @@ interface InlinePopoverPositionerProps {
|
|
|
75
82
|
* @default true
|
|
76
83
|
*/
|
|
77
84
|
autoUpdate?: InlinePopoverPositionerProps$1['autoUpdate'];
|
|
78
|
-
/**
|
|
79
|
-
* Whether to use the browser Popover API to place the floating element on
|
|
80
|
-
* top of other page content.
|
|
81
|
-
*
|
|
82
|
-
* @default true
|
|
83
|
-
*/
|
|
84
|
-
hoist?: InlinePopoverPositionerProps$1['hoist'];
|
|
85
85
|
/**
|
|
86
86
|
* Whether to flip the `placement` in order to keep it in view when the
|
|
87
87
|
* preferred placement(s) will overflow the clipping boundary. You can also
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-vue-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":";;;;AAYA;;;;;AAAA,UAAiB,uBAAA;;;;;;cAOJ,kBAAA,EAAoB,sBAAA,CAAuB,uBAAA,GAA0B,cAAA;;;;;;;AAAlF;UCPiB,4BAAA;;;;;;EAMf,SAAA,GAAY,8BAAA;EDCmB;;;;;ECK/B,MAAA,GAAS,8BAAA;;;AAZX;;;;EAmBE,IAAA,GAAO,8BAAA;EAAA;;;;;;EAOP,OAAA,GAAU,8BAAA;
|
|
1
|
+
{"version":3,"file":"prosekit-vue-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":";;;;AAYA;;;;;AAAA,UAAiB,uBAAA;;;;;;cAOJ,kBAAA,EAAoB,sBAAA,CAAuB,uBAAA,GAA0B,cAAA;;;;;;;AAAlF;UCPiB,4BAAA;;;;;;EAMf,SAAA,GAAY,8BAAA;EDCmB;;;;;ECK/B,MAAA,GAAS,8BAAA;;;AAZX;;;;EAmBE,IAAA,GAAO,8BAAA;EAAA;;;;;;EAOP,KAAA,GAAQ,8BAAA;EA2CD;;;;;;EApCP,OAAA,GAAU,8BAAA;EAqFO;;;;;;EA9EjB,MAAA,GAAS,8BAAA;EA5BA;;;;;EAkCT,eAAA,GAAkB,8BAAA;EAbR;;;;;EAmBV,QAAA,GAAW,8BAAA;EAAA;;;;;;;EAQX,UAAA,GAAa,8BAAA;EAsBC;;;;;;;;EAbd,IAAA,GAAO,8BAAA;EAiDP;;;;;EA3CA,KAAA,GAAQ,8BAAA;EA2DG;;;;;;EApDX,WAAA,GAAc,8BAAA;EAoD4C;;;;;;EA7C1D,SAAA,GAAY,8BAAA;;;ACvFd;;;;ED8FE,UAAA,GAAa,8BAAA;ECzEK;;;;;;EDgFlB,QAAA,GAAW,8BAAA;EC9FF;;;;;;EDqGT,YAAA,GAAe,8BAAA;EC7Ef;;;;;;;EDqFA,cAAA,GAAiB,8BAAA;ECzBlB;;;;;;;EDiCC,WAAA,GAAc,8BAAA;AAAA;;;;;;cAQH,uBAAA,EAAyB,sBAAA,CAAuB,4BAAA,GAA+B,cAAA;;;;;;;AD/H5F;UELiB,sBAAA;;;;;;;EAOf,MAAA,GAAS,wBAAA;EFF6C;;;;;;EEStD,WAAA,GAAc,wBAAA;EDhBC;;;;;;ECuBf,eAAA,GAAkB,wBAAA;EDUR;;;;ECLV,IAAA,GAAO,wBAAA;EDyCA;;;;ECpCP,QAAA,GAAW,wBAAA;EDsEA;ECpEX,YAAA,IAAgB,KAAA,EAAO,uBAAA;AAAA;;;;;;cAQZ,iBAAA,EAAmB,sBAAA,CAAuB,sBAAA,GAAyB,cAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-vue-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":["/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerInlinePopoverPopupElement } from '@prosekit/web/inline-popover';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes } from 'vue';\n\n/**\n * Props for the {@link InlinePopoverPopup} Vue component.\n *\n * @public\n */\nexport interface InlinePopoverPopupProps {}\n\n/**\n * A Vue component that renders an `prosekit-inline-popover-popup` custom element.\n *\n * @public\n */\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","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\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/**\n * Props for the {@link InlinePopoverPositioner} Vue component.\n *\n * @public\n */\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 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 use the browser Popover API to place the floating element on\n * top of other page content.\n *\n * @default true\n */\n hoist?: InlinePopoverPositionerElementProps['hoist'];\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/**\n * A Vue component that renders an `prosekit-inline-popover-positioner` custom element.\n *\n * @public\n */\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","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\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/**\n * Props for the {@link InlinePopoverRoot} Vue component.\n *\n * @public\n */\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 /** */\n onOpenChange?: (event: InlinePopoverRootEvents['openChange']) => void;\n}\n\n/**\n * A Vue component that renders an `prosekit-inline-popover-root` custom element.\n *\n * @public\n */\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\nexport type { InlinePopoverRootEvents };\n"],"mappings":";;;;;;;;;;;;AAmBA,MAAa,qBAAuG,iCACjH,OAAO,EAAE,YAAY;AACpB,oCAAmC;AAEnC,cAAa;AACX,SAAO,EAAE,iCAAiC,OAAO,MAAM,WAAW,CAAC;;GAGvE,EAAE,OAAO,EAAE,EAAE,CACd;;;;;;;;;;;ACsHD,MAAa,0BAAiH,iCAC3H,OAAO,EAAE,YAAY;AACpB,yCAAwC;CAExC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AqG,iCAC/G,OAAO,EAAE,YAAY;AACpB,mCAAkC;CAElC,MAAM,aAAa,WAA+B,KAAK;CAEvD,MAAM,aAAa,kBAAkB;CAErC,MAAM,gBAAgB,eAAe;EACnC,MAAM,EAAE,aAAa,IAAI,UAAU,IAAI,iBAAiB,IAAI,QAAQ,IAAI,MAAM,IAAI,cAAc,IAAI,GAAG,cAAc;AACrH,SAAO,CAAC;GAAC;GAAI;GAAI;GAAI;GAAI;GAAI;GAAG,EAAE,UAAU;GAC5C;CAEF,MAAM,WAAsD,EAAE;AAE9D,mBAAkB;EAChB,MAAM,UAAU,WAAW;AAC3B,MAAI,CAAC,QAAS;EAEd,MAAM,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,MAAM,cAAc,MAAM;AAErD,SAAO,OAAO,SAAS;GAAE,aAAa;GAAI,UAAU;GAAI,iBAAiB;GAAI,QAAQ,MAAM;GAAY,MAAM;GAAI,CAAC;AAElH,WAAS,SAAS;AAClB,WAAS,KAAK,GAAG;GACjB;AAEF,mBAAkB;EAChB,MAAM,UAAU,WAAW;AAC3B,MAAI,CAAC,QAAS;EAEd,MAAM,KAAK,IAAI,iBAAiB;AAChC,OAAK,MAAM,CAAC,OAAO,cAAc,CAAC,aAAa,CAAC,SAAS,CACvD,SAAQ,iBACN,YACC,UAAiB;AAChB,YAAS,SAAS,MAAM;KAE1B,EAAE,QAAQ,GAAG,QAAQ,CACtB;AAEH,eAAa,GAAG,OAAO;GACvB;AAEF,cAAa;EACX,MAAM,YAAY,cAAc,MAAM;AACtC,SAAO,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":"prosekit-vue-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":["/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerInlinePopoverPopupElement } from '@prosekit/web/inline-popover';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes } from 'vue';\n\n/**\n * Props for the {@link InlinePopoverPopup} Vue component.\n *\n * @public\n */\nexport interface InlinePopoverPopupProps {}\n\n/**\n * A Vue component that renders an `prosekit-inline-popover-popup` custom element.\n *\n * @public\n */\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","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\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/**\n * Props for the {@link InlinePopoverPositioner} Vue component.\n *\n * @public\n */\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/**\n * A Vue component that renders an `prosekit-inline-popover-positioner` custom element.\n *\n * @public\n */\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","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\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/**\n * Props for the {@link InlinePopoverRoot} Vue component.\n *\n * @public\n */\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 /** */\n onOpenChange?: (event: InlinePopoverRootEvents['openChange']) => void;\n}\n\n/**\n * A Vue component that renders an `prosekit-inline-popover-root` custom element.\n *\n * @public\n */\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\nexport type { InlinePopoverRootEvents };\n"],"mappings":";;;;;;;;;;;;AAmBA,MAAa,qBAAuG,iCACjH,OAAO,EAAE,YAAY;AACpB,oCAAmC;AAEnC,cAAa;AACX,SAAO,EAAE,iCAAiC,OAAO,MAAM,WAAW,CAAC;;GAGvE,EAAE,OAAO,EAAE,EAAE,CACd;;;;;;;;;;;ACsHD,MAAa,0BAAiH,iCAC3H,OAAO,EAAE,YAAY;AACpB,yCAAwC;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;AACvS,SAAO,CAAC;GAAC;GAAI;GAAI;GAAI;GAAI;GAAI;GAAI;GAAI;GAAI;GAAI;GAAI;GAAK;GAAK;G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;EAEd,MAAM,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,MAAM,cAAc,MAAM;AAErD,SAAO,OAAO,SAAS;GAAE,aAAa;GAAI,UAAU;GAAI,iBAAiB;GAAI,QAAQ,MAAM;GAAY,MAAM;GAAI,CAAC;AAElH,WAAS,SAAS;AAClB,WAAS,KAAK,GAAG;GACjB;AAEF,mBAAkB;EAChB,MAAM,UAAU,WAAW;AAC3B,MAAI,CAAC,QAAS;EAEd,MAAM,KAAK,IAAI,iBAAiB;AAChC,OAAK,MAAM,CAAC,OAAO,cAAc,CAAC,aAAa,CAAC,SAAS,CACvD,SAAQ,iBACN,YACC,UAAiB;AAChB,YAAS,SAAS,MAAM;KAE1B,EAAE,QAAQ,GAAG,QAAQ,CACtB;AAEH,eAAa,GAAG,OAAO;GACvB;AAEF,cAAa;EACX,MAAM,YAAY,cAAc,MAAM;AACtC,SAAO,EAAE,gCAAgC;GAAE,GAAG;GAAW,KAAK;GAAY,EAAE,MAAM,WAAW,CAAC;;GAGlG,EAAE,OAAO;CAAC;CAAe;CAAY;CAAmB;CAAU;CAAQ;CAAe,EAAE,CAC5F"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosekit/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.7.0-beta.
|
|
4
|
+
"version": "0.7.0-beta.3",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Vue components and utilities for ProseKit",
|
|
7
7
|
"author": {
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"dependencies": {
|
|
75
75
|
"@prosemirror-adapter/core": "^0.5.3",
|
|
76
76
|
"@prosemirror-adapter/vue": "^0.5.3",
|
|
77
|
+
"@prosekit/core": "^0.12.0-beta.0",
|
|
77
78
|
"@prosekit/pm": "^0.1.15",
|
|
78
|
-
"@prosekit/web": "^0.8.0-beta.
|
|
79
|
-
"@prosekit/core": "^0.12.0-beta.0"
|
|
79
|
+
"@prosekit/web": "^0.8.0-beta.2"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"vue": ">= 3.0.0"
|
|
@@ -30,6 +30,13 @@ export interface InlinePopoverPositionerProps {
|
|
|
30
30
|
* @default true
|
|
31
31
|
*/
|
|
32
32
|
hide?: InlinePopoverPositionerElementProps['hide'];
|
|
33
|
+
/**
|
|
34
|
+
* Whether to use the browser [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)
|
|
35
|
+
* to place the floating element on top of other page content.
|
|
36
|
+
*
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
hoist?: InlinePopoverPositionerElementProps['hoist'];
|
|
33
40
|
/**
|
|
34
41
|
* Whether the floating element can overlap the reference element to keep it
|
|
35
42
|
* in view.
|
|
@@ -64,13 +71,6 @@ export interface InlinePopoverPositionerProps {
|
|
|
64
71
|
* @default true
|
|
65
72
|
*/
|
|
66
73
|
autoUpdate?: InlinePopoverPositionerElementProps['autoUpdate'];
|
|
67
|
-
/**
|
|
68
|
-
* Whether to use the browser Popover API to place the floating element on
|
|
69
|
-
* top of other page content.
|
|
70
|
-
*
|
|
71
|
-
* @default true
|
|
72
|
-
*/
|
|
73
|
-
hoist?: InlinePopoverPositionerElementProps['hoist'];
|
|
74
74
|
/**
|
|
75
75
|
* Whether to flip the `placement` in order to keep it in view when the
|
|
76
76
|
* preferred placement(s) will overflow the clipping boundary. You can also
|