@prosekit/solid 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 extends JSX.HTMLAttributes<InlinePopoverP
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 extends JSX.HTMLAttributes<InlinePopoverP
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-solid-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":";;;;;;;;;UAaiB,uBAAA,SAAgC,GAAA,CAAI,cAAA,CAAe,yBAAA;;AAOpE;;;;cAAa,kBAAA,EAAoB,SAAA,CAAU,uBAAA;;;;;;;;UCN1B,4BAAA,SAAqC,GAAA,CAAI,cAAA,CAAe,8BAAA;EDDoB;;AAO7F;;;ECAE,SAAA,GAAY,8BAAA;EDAoD;;;;ACNlE;EAYE,MAAA,GAAS,8BAAA;;;;;;;EAOT,IAAA,GAAO,8BAAA;EAoBW;;;;;;EAblB,OAAA,GAAU,8BAAA;EA+DE;;;;;;EAxDZ,MAAA,GAAS,8BAAA;EAjC6D;;;;;EAuCtE,eAAA,GAAkB,8BAAA;EAjCN;;;;;EAuCZ,QAAA,GAAW,8BAAA;EAnBD;;;;;;;EA2BV,UAAA,GAAa,8BAAA;EAAA;;;;;;EAOb,KAAA,GAAQ,8BAAA;EAsBR;;;;;;;;EAbA,IAAA,GAAO,8BAAA;EAyCQ;;;;;EAnCf,KAAA,GAAQ,8BAAA;EAmDyC;AAQnD;;;;;EApDE,WAAA,GAAc,8BAAA;;;AChFhB;;;;EDuFE,SAAA,GAAY,8BAAA;ECzEE;;;;;;EDgFd,UAAA,GAAa,8BAAA;EC9FmD;;;;;;EDqGhE,QAAA,GAAW,8BAAA;ECvFG;;;;;;ED8Fd,YAAA,GAAe,8BAAA;EC3Ef;;;;;AAQF;;ED2EE,cAAA,GAAiB,8BAAA;EC3Ea;;;;;;;EDmF9B,WAAA,GAAc,8BAAA;AAAA;;;;;;cAQH,uBAAA,EAAyB,SAAA,CAAU,4BAAA;;;;;;;;UCpI/B,sBAAA,SAA+B,GAAA,CAAI,cAAA,CAAe,wBAAA;EFH0B;;AAO7F;;;;EEGE,MAAA,GAAS,wBAAA;;;;ADTX;;;ECgBE,WAAA,GAAc,wBAAA;EDVF;;;;;;ECiBZ,eAAA,GAAkB,wBAAA;ED8BL;;;;ECzBb,IAAA,GAAO,wBAAA;ED6DK;;;;ECxDZ,QAAA,GAAW,wBAAA;ED6FG;EC3Fd,YAAA,IAAgB,KAAA,EAAO,uBAAA;AAAA;;;;;;cAQZ,iBAAA,EAAmB,SAAA,CAAU,sBAAA"}
1
+ {"version":3,"file":"prosekit-solid-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":";;;;;;;;;UAaiB,uBAAA,SAAgC,GAAA,CAAI,cAAA,CAAe,yBAAA;;AAOpE;;;;cAAa,kBAAA,EAAoB,SAAA,CAAU,uBAAA;;;;;;;;UCN1B,4BAAA,SAAqC,GAAA,CAAI,cAAA,CAAe,8BAAA;EDDoB;;AAO7F;;;ECAE,SAAA,GAAY,8BAAA;EDAoD;;;;ACNlE;EAYE,MAAA,GAAS,8BAAA;;;;;;;EAOT,IAAA,GAAO,8BAAA;EAqBE;;;;;;EAdT,KAAA,GAAQ,8BAAA;EA+DI;;;;;;EAxDZ,OAAA,GAAU,8BAAA;EAjC4D;;;;;;EAwCtE,MAAA,GAAS,8BAAA;EA5BT;;;;;EAkCA,eAAA,GAAkB,8BAAA;EAblB;;;;;EAmBA,QAAA,GAAW,8BAAA;EAAX;;;;;;;EAQA,UAAA,GAAa,8BAAA;EAsBb;;;;;;;;EAbA,IAAA,GAAO,8BAAA;EAyCQ;;;;;EAnCf,KAAA,GAAQ,8BAAA;EAmDyC;AAQnD;;;;;EApDE,WAAA,GAAc,8BAAA;;;AChFhB;;;;EDuFE,SAAA,GAAY,8BAAA;ECzEE;;;;;;EDgFd,UAAA,GAAa,8BAAA;EC9FmD;;;;;;EDqGhE,QAAA,GAAW,8BAAA;ECvFG;;;;;;ED8Fd,YAAA,GAAe,8BAAA;EC3Ef;;;;;AAQF;;ED2EE,cAAA,GAAiB,8BAAA;EC3Ea;;;;;;;EDmF9B,WAAA,GAAc,8BAAA;AAAA;;;;;;cAQH,uBAAA,EAAyB,SAAA,CAAU,4BAAA;;;;;;;;UCpI/B,sBAAA,SAA+B,GAAA,CAAI,cAAA,CAAe,wBAAA;EFH0B;;AAO7F;;;;EEGE,MAAA,GAAS,wBAAA;;;;ADTX;;;ECgBE,WAAA,GAAc,wBAAA;EDVF;;;;;;ECiBZ,eAAA,GAAkB,wBAAA;ED6BP;;;;ECxBX,IAAA,GAAO,wBAAA;ED6DK;;;;ECxDZ,QAAA,GAAW,wBAAA;ED6FG;EC3Fd,YAAA,IAAgB,KAAA,EAAO,uBAAA;AAAA;;;;;;cAQZ,iBAAA,EAAmB,SAAA,CAAU,sBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-solid-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, type InlinePopoverPopupElement } from '@prosekit/web/inline-popover';\nimport type { Component, JSX } from 'solid-js';\nimport h from 'solid-js/h';\n\n/**\n * Props for the {@link InlinePopoverPopup} Solid component.\n *\n * @public\n */\nexport interface InlinePopoverPopupProps extends JSX.HTMLAttributes<InlinePopoverPopupElement> {}\n\n/**\n * A Solid component that renders an `prosekit-inline-popover-popup` custom element.\n *\n * @public\n */\nexport const InlinePopoverPopup: Component<InlinePopoverPopupProps> = (props): any => {\n registerInlinePopoverPopupElement();\n\n const restProps = props;\n\n return () => h('prosekit-inline-popover-popup', restProps);\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 InlinePopoverPositionerElement, type InlinePopoverPositionerProps as InlinePopoverPositionerElementProps } from '@prosekit/web/inline-popover';\nimport { createEffect, createSignal, mergeProps, splitProps } from 'solid-js';\nimport type { Component, JSX } from 'solid-js';\nimport h from 'solid-js/h';\n\n/**\n * Props for the {@link InlinePopoverPositioner} Solid component.\n *\n * @public\n */\nexport interface InlinePopoverPositionerProps extends JSX.HTMLAttributes<InlinePopoverPositionerElement> {\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 Solid component that renders an `prosekit-inline-popover-positioner` custom element.\n *\n * @public\n */\nexport const InlinePopoverPositioner: Component<InlinePopoverPositionerProps> = (props): any => {\n registerInlinePopoverPositionerElement();\n\n const [getElement, setElement] = createSignal<InlinePopoverPositionerElement | null>(null);\n\n const [elementProps, restProps] = splitProps(props, ['altBoundary', 'autoUpdate', 'boundary', 'elementContext', 'fitViewport', 'flip', 'hide', 'hoist', 'inline', 'offset', 'overflowPadding', 'overlap', 'placement', 'rootBoundary', 'sameHeight', 'sameWidth', 'shift', 'strategy']);\n\n createEffect(() => {\n const element = getElement();\n if (!element) return;\n\n Object.assign(element, {\n altBoundary: elementProps.altBoundary,\n autoUpdate: elementProps.autoUpdate,\n boundary: elementProps.boundary,\n elementContext: elementProps.elementContext,\n fitViewport: elementProps.fitViewport,\n flip: elementProps.flip,\n hide: elementProps.hide,\n hoist: elementProps.hoist,\n inline: elementProps.inline,\n offset: elementProps.offset,\n overflowPadding: elementProps.overflowPadding,\n overlap: elementProps.overlap,\n placement: elementProps.placement,\n rootBoundary: elementProps.rootBoundary,\n sameHeight: elementProps.sameHeight,\n sameWidth: elementProps.sameWidth,\n shift: elementProps.shift,\n strategy: elementProps.strategy,\n });\n });\n\n return () =>\n h(\n 'prosekit-inline-popover-positioner',\n mergeProps(restProps, {\n ref: (el: InlinePopoverPositionerElement | null) => {\n setElement(el);\n },\n }),\n );\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 InlinePopoverRootElement, type InlinePopoverRootEvents, type InlinePopoverRootProps as InlinePopoverRootElementProps } from '@prosekit/web/inline-popover';\nimport { createEffect, createSignal, mergeProps, splitProps } from 'solid-js';\nimport type { Component, JSX } from 'solid-js';\nimport h from 'solid-js/h';\n\nimport { useEditorContext } from '../../contexts/editor-context.ts';\n\n/**\n * Props for the {@link InlinePopoverRoot} Solid component.\n *\n * @public\n */\nexport interface InlinePopoverRootProps extends JSX.HTMLAttributes<InlinePopoverRootElement> {\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 Solid component that renders an `prosekit-inline-popover-root` custom element.\n *\n * @public\n */\nexport const InlinePopoverRoot: Component<InlinePopoverRootProps> = (props): any => {\n registerInlinePopoverRootElement();\n\n const [getElement, setElement] = createSignal<InlinePopoverRootElement | null>(null);\n const handlers: Array<((event: any) => void) | undefined> = [];\n\n const [elementProps, eventHandlers, restProps] = splitProps(props, ['defaultOpen', 'disabled', 'dismissOnEscape', 'editor', 'open'], ['onOpenChange']);\n\n const p3Fallback = useEditorContext();\n\n createEffect(() => {\n const element = getElement();\n if (!element) return;\n\n Object.assign(element, { defaultOpen: elementProps.defaultOpen, disabled: elementProps.disabled, dismissOnEscape: elementProps.dismissOnEscape, editor: elementProps.editor ?? p3Fallback, open: elementProps.open });\n\n handlers.length = 0;\n handlers.push(eventHandlers.onOpenChange);\n });\n\n createEffect(() => {\n const element = getElement();\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) => {\n handlers[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n });\n\n return () =>\n h(\n 'prosekit-inline-popover-root',\n mergeProps(restProps, {\n ref: (el: InlinePopoverRootElement | null) => {\n setElement(el);\n },\n }),\n );\n};\n\nexport type { InlinePopoverRootEvents };\n"],"mappings":";;;;;;;;;;;;;AAoBA,MAAa,sBAA0D,UAAe;AACpF,oCAAmC;CAEnC,MAAM,YAAY;AAElB,cAAa,EAAE,iCAAiC,UAAU;;;;;;;;;;;;AC2H5D,MAAa,2BAAoE,UAAe;AAC9F,yCAAwC;CAExC,MAAM,CAAC,YAAY,cAAc,aAAoD,KAAK;CAE1F,MAAM,CAAC,cAAc,aAAa,WAAW,OAAO;EAAC;EAAe;EAAc;EAAY;EAAkB;EAAe;EAAQ;EAAQ;EAAS;EAAU;EAAU;EAAmB;EAAW;EAAa;EAAgB;EAAc;EAAa;EAAS;EAAW,CAAC;AAEvR,oBAAmB;EACjB,MAAM,UAAU,YAAY;AAC5B,MAAI,CAAC,QAAS;AAEd,SAAO,OAAO,SAAS;GACrB,aAAa,aAAa;GAC1B,YAAY,aAAa;GACzB,UAAU,aAAa;GACvB,gBAAgB,aAAa;GAC7B,aAAa,aAAa;GAC1B,MAAM,aAAa;GACnB,MAAM,aAAa;GACnB,OAAO,aAAa;GACpB,QAAQ,aAAa;GACrB,QAAQ,aAAa;GACrB,iBAAiB,aAAa;GAC9B,SAAS,aAAa;GACtB,WAAW,aAAa;GACxB,cAAc,aAAa;GAC3B,YAAY,aAAa;GACzB,WAAW,aAAa;GACxB,OAAO,aAAa;GACpB,UAAU,aAAa;GACxB,CAAC;GACF;AAEF,cACE,EACE,sCACA,WAAW,WAAW,EACpB,MAAM,OAA8C;AAClD,aAAW,GAAG;IAEjB,CAAC,CACH;;;;;;;;;;;;ACpIL,MAAa,qBAAwD,UAAe;AAClF,mCAAkC;CAElC,MAAM,CAAC,YAAY,cAAc,aAA8C,KAAK;CACpF,MAAM,WAAsD,EAAE;CAE9D,MAAM,CAAC,cAAc,eAAe,aAAa,WAAW,OAAO;EAAC;EAAe;EAAY;EAAmB;EAAU;EAAO,EAAE,CAAC,eAAe,CAAC;CAEtJ,MAAM,aAAa,kBAAkB;AAErC,oBAAmB;EACjB,MAAM,UAAU,YAAY;AAC5B,MAAI,CAAC,QAAS;AAEd,SAAO,OAAO,SAAS;GAAE,aAAa,aAAa;GAAa,UAAU,aAAa;GAAU,iBAAiB,aAAa;GAAiB,QAAQ,aAAa,UAAU;GAAY,MAAM,aAAa;GAAM,CAAC;AAErN,WAAS,SAAS;AAClB,WAAS,KAAK,cAAc,aAAa;GACzC;AAEF,oBAAmB;EACjB,MAAM,UAAU,YAAY;AAC5B,MAAI,CAAC,QAAS;EAEd,MAAM,KAAK,IAAI,iBAAiB;AAChC,OAAK,MAAM,CAAC,OAAO,cAAc,CAAC,aAAa,CAAC,SAAS,CACvD,SAAQ,iBACN,YACC,UAAU;AACT,YAAS,SAAS,MAAM;KAE1B,EAAE,QAAQ,GAAG,QAAQ,CACtB;AAEH,eAAa,GAAG,OAAO;GACvB;AAEF,cACE,EACE,gCACA,WAAW,WAAW,EACpB,MAAM,OAAwC;AAC5C,aAAW,GAAG;IAEjB,CAAC,CACH"}
1
+ {"version":3,"file":"prosekit-solid-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, type InlinePopoverPopupElement } from '@prosekit/web/inline-popover';\nimport type { Component, JSX } from 'solid-js';\nimport h from 'solid-js/h';\n\n/**\n * Props for the {@link InlinePopoverPopup} Solid component.\n *\n * @public\n */\nexport interface InlinePopoverPopupProps extends JSX.HTMLAttributes<InlinePopoverPopupElement> {}\n\n/**\n * A Solid component that renders an `prosekit-inline-popover-popup` custom element.\n *\n * @public\n */\nexport const InlinePopoverPopup: Component<InlinePopoverPopupProps> = (props): any => {\n registerInlinePopoverPopupElement();\n\n const restProps = props;\n\n return () => h('prosekit-inline-popover-popup', restProps);\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 InlinePopoverPositionerElement, type InlinePopoverPositionerProps as InlinePopoverPositionerElementProps } from '@prosekit/web/inline-popover';\nimport { createEffect, createSignal, mergeProps, splitProps } from 'solid-js';\nimport type { Component, JSX } from 'solid-js';\nimport h from 'solid-js/h';\n\n/**\n * Props for the {@link InlinePopoverPositioner} Solid component.\n *\n * @public\n */\nexport interface InlinePopoverPositionerProps extends JSX.HTMLAttributes<InlinePopoverPositionerElement> {\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 Solid component that renders an `prosekit-inline-popover-positioner` custom element.\n *\n * @public\n */\nexport const InlinePopoverPositioner: Component<InlinePopoverPositionerProps> = (props): any => {\n registerInlinePopoverPositionerElement();\n\n const [getElement, setElement] = createSignal<InlinePopoverPositionerElement | null>(null);\n\n const [elementProps, restProps] = splitProps(props, ['altBoundary', 'autoUpdate', 'boundary', 'elementContext', 'fitViewport', 'flip', 'hide', 'hoist', 'inline', 'offset', 'overflowPadding', 'overlap', 'placement', 'rootBoundary', 'sameHeight', 'sameWidth', 'shift', 'strategy']);\n\n createEffect(() => {\n const element = getElement();\n if (!element) return;\n\n Object.assign(element, {\n altBoundary: elementProps.altBoundary,\n autoUpdate: elementProps.autoUpdate,\n boundary: elementProps.boundary,\n elementContext: elementProps.elementContext,\n fitViewport: elementProps.fitViewport,\n flip: elementProps.flip,\n hide: elementProps.hide,\n hoist: elementProps.hoist,\n inline: elementProps.inline,\n offset: elementProps.offset,\n overflowPadding: elementProps.overflowPadding,\n overlap: elementProps.overlap,\n placement: elementProps.placement,\n rootBoundary: elementProps.rootBoundary,\n sameHeight: elementProps.sameHeight,\n sameWidth: elementProps.sameWidth,\n shift: elementProps.shift,\n strategy: elementProps.strategy,\n });\n });\n\n return () =>\n h(\n 'prosekit-inline-popover-positioner',\n mergeProps(restProps, {\n ref: (el: InlinePopoverPositionerElement | null) => {\n setElement(el);\n },\n }),\n );\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 InlinePopoverRootElement, type InlinePopoverRootEvents, type InlinePopoverRootProps as InlinePopoverRootElementProps } from '@prosekit/web/inline-popover';\nimport { createEffect, createSignal, mergeProps, splitProps } from 'solid-js';\nimport type { Component, JSX } from 'solid-js';\nimport h from 'solid-js/h';\n\nimport { useEditorContext } from '../../contexts/editor-context.ts';\n\n/**\n * Props for the {@link InlinePopoverRoot} Solid component.\n *\n * @public\n */\nexport interface InlinePopoverRootProps extends JSX.HTMLAttributes<InlinePopoverRootElement> {\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 Solid component that renders an `prosekit-inline-popover-root` custom element.\n *\n * @public\n */\nexport const InlinePopoverRoot: Component<InlinePopoverRootProps> = (props): any => {\n registerInlinePopoverRootElement();\n\n const [getElement, setElement] = createSignal<InlinePopoverRootElement | null>(null);\n const handlers: Array<((event: any) => void) | undefined> = [];\n\n const [elementProps, eventHandlers, restProps] = splitProps(props, ['defaultOpen', 'disabled', 'dismissOnEscape', 'editor', 'open'], ['onOpenChange']);\n\n const p3Fallback = useEditorContext();\n\n createEffect(() => {\n const element = getElement();\n if (!element) return;\n\n Object.assign(element, { defaultOpen: elementProps.defaultOpen, disabled: elementProps.disabled, dismissOnEscape: elementProps.dismissOnEscape, editor: elementProps.editor ?? p3Fallback, open: elementProps.open });\n\n handlers.length = 0;\n handlers.push(eventHandlers.onOpenChange);\n });\n\n createEffect(() => {\n const element = getElement();\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) => {\n handlers[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n });\n\n return () =>\n h(\n 'prosekit-inline-popover-root',\n mergeProps(restProps, {\n ref: (el: InlinePopoverRootElement | null) => {\n setElement(el);\n },\n }),\n );\n};\n\nexport type { InlinePopoverRootEvents };\n"],"mappings":";;;;;;;;;;;;;AAoBA,MAAa,sBAA0D,UAAe;AACpF,oCAAmC;CAEnC,MAAM,YAAY;AAElB,cAAa,EAAE,iCAAiC,UAAU;;;;;;;;;;;;AC2H5D,MAAa,2BAAoE,UAAe;AAC9F,yCAAwC;CAExC,MAAM,CAAC,YAAY,cAAc,aAAoD,KAAK;CAE1F,MAAM,CAAC,cAAc,aAAa,WAAW,OAAO;EAAC;EAAe;EAAc;EAAY;EAAkB;EAAe;EAAQ;EAAQ;EAAS;EAAU;EAAU;EAAmB;EAAW;EAAa;EAAgB;EAAc;EAAa;EAAS;EAAW,CAAC;AAEvR,oBAAmB;EACjB,MAAM,UAAU,YAAY;AAC5B,MAAI,CAAC,QAAS;AAEd,SAAO,OAAO,SAAS;GACrB,aAAa,aAAa;GAC1B,YAAY,aAAa;GACzB,UAAU,aAAa;GACvB,gBAAgB,aAAa;GAC7B,aAAa,aAAa;GAC1B,MAAM,aAAa;GACnB,MAAM,aAAa;GACnB,OAAO,aAAa;GACpB,QAAQ,aAAa;GACrB,QAAQ,aAAa;GACrB,iBAAiB,aAAa;GAC9B,SAAS,aAAa;GACtB,WAAW,aAAa;GACxB,cAAc,aAAa;GAC3B,YAAY,aAAa;GACzB,WAAW,aAAa;GACxB,OAAO,aAAa;GACpB,UAAU,aAAa;GACxB,CAAC;GACF;AAEF,cACE,EACE,sCACA,WAAW,WAAW,EACpB,MAAM,OAA8C;AAClD,aAAW,GAAG;IAEjB,CAAC,CACH;;;;;;;;;;;;ACpIL,MAAa,qBAAwD,UAAe;AAClF,mCAAkC;CAElC,MAAM,CAAC,YAAY,cAAc,aAA8C,KAAK;CACpF,MAAM,WAAsD,EAAE;CAE9D,MAAM,CAAC,cAAc,eAAe,aAAa,WAAW,OAAO;EAAC;EAAe;EAAY;EAAmB;EAAU;EAAO,EAAE,CAAC,eAAe,CAAC;CAEtJ,MAAM,aAAa,kBAAkB;AAErC,oBAAmB;EACjB,MAAM,UAAU,YAAY;AAC5B,MAAI,CAAC,QAAS;AAEd,SAAO,OAAO,SAAS;GAAE,aAAa,aAAa;GAAa,UAAU,aAAa;GAAU,iBAAiB,aAAa;GAAiB,QAAQ,aAAa,UAAU;GAAY,MAAM,aAAa;GAAM,CAAC;AAErN,WAAS,SAAS;AAClB,WAAS,KAAK,cAAc,aAAa;GACzC;AAEF,oBAAmB;EACjB,MAAM,UAAU,YAAY;AAC5B,MAAI,CAAC,QAAS;EAEd,MAAM,KAAK,IAAI,iBAAiB;AAChC,OAAK,MAAM,CAAC,OAAO,cAAc,CAAC,aAAa,CAAC,SAAS,CACvD,SAAQ,iBACN,YACC,UAAU;AACT,YAAS,SAAS,MAAM;KAE1B,EAAE,QAAQ,GAAG,QAAQ,CACtB;AAEH,eAAa,GAAG,OAAO;GACvB;AAEF,cACE,EACE,gCACA,WAAW,WAAW,EACpB,MAAM,OAAwC;AAC5C,aAAW,GAAG;IAEjB,CAAC,CACH"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prosekit/solid",
3
3
  "type": "module",
4
- "version": "0.7.0-beta.2",
4
+ "version": "0.7.0-beta.3",
5
5
  "private": false,
6
6
  "description": "Solid components and utilities for ProseKit",
7
7
  "author": {
@@ -76,7 +76,7 @@
76
76
  "@prosemirror-adapter/solid": "^0.5.3",
77
77
  "@prosekit/core": "^0.12.0-beta.0",
78
78
  "@prosekit/pm": "^0.1.15",
79
- "@prosekit/web": "^0.8.0-beta.1"
79
+ "@prosekit/web": "^0.8.0-beta.2"
80
80
  },
81
81
  "peerDependencies": {
82
82
  "solid-js": ">= 1.7.0"
@@ -93,10 +93,10 @@
93
93
  "vite-plugin-solid": "^2.11.12",
94
94
  "vitest": "^4.1.4",
95
95
  "vitest-browser-solid": "^1.0.1",
96
- "@prosekit/config-ts": "0.0.0",
97
96
  "@prosekit/config-tsdown": "0.0.0",
98
- "@prosekit/testing": "0.0.0",
99
- "@prosekit/config-vitest": "0.0.0"
97
+ "@prosekit/config-ts": "0.0.0",
98
+ "@prosekit/config-vitest": "0.0.0",
99
+ "@prosekit/testing": "0.0.0"
100
100
  },
101
101
  "publishConfig": {
102
102
  "dev": {}
@@ -32,6 +32,13 @@ export interface InlinePopoverPositionerProps extends JSX.HTMLAttributes<InlineP
32
32
  * @default true
33
33
  */
34
34
  hide?: InlinePopoverPositionerElementProps['hide'];
35
+ /**
36
+ * Whether to use the browser [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)
37
+ * to place the floating element on top of other page content.
38
+ *
39
+ * @default false
40
+ */
41
+ hoist?: InlinePopoverPositionerElementProps['hoist'];
35
42
  /**
36
43
  * Whether the floating element can overlap the reference element to keep it
37
44
  * in view.
@@ -66,13 +73,6 @@ export interface InlinePopoverPositionerProps extends JSX.HTMLAttributes<InlineP
66
73
  * @default true
67
74
  */
68
75
  autoUpdate?: InlinePopoverPositionerElementProps['autoUpdate'];
69
- /**
70
- * Whether to use the browser Popover API to place the floating element on
71
- * top of other page content.
72
- *
73
- * @default true
74
- */
75
- hoist?: InlinePopoverPositionerElementProps['hoist'];
76
76
  /**
77
77
  * Whether to flip the `placement` in order to keep it in view when the
78
78
  * preferred placement(s) will overflow the clipping boundary. You can also