@prosekit/react 0.8.0-beta.10 → 0.8.0-beta.12

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.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","../src/components/autocomplete/index.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerAutocompleteEmptyElement, type AutocompleteEmptyElement } from '@prosekit/web/autocomplete';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from 'react';\n\n/** Props for the {@link AutocompleteEmpty} React component. */\nexport interface AutocompleteEmptyProps {}\n\nfunction AutocompleteEmptyComponent(props: AutocompleteEmptyProps, forwardedRef: ForwardedRef<AutocompleteEmptyElement>) {\n registerAutocompleteEmptyElement();\n\n const elementRef = useRef<AutocompleteEmptyElement>(null);\n\n const { ...restProps } = props;\n\n const mergedRef = useCallback(\n (element: AutocompleteEmptyElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-autocomplete-empty', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-autocomplete-empty` custom element. */\nexport const AutocompleteEmpty: ForwardRefExoticComponent<AutocompleteEmptyProps & HTMLAttributes<AutocompleteEmptyElement> & RefAttributes<AutocompleteEmptyElement>> = /* @__PURE__ */ forwardRef(AutocompleteEmptyComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerAutocompleteItemElement, type AutocompleteItemElement, type AutocompleteItemProps as AutocompleteItemElementProps, type AutocompleteItemEvents } from '@prosekit/web/autocomplete';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link AutocompleteItem} React 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\nfunction AutocompleteItemComponent(props: AutocompleteItemProps, forwardedRef: ForwardedRef<AutocompleteItemElement>) {\n registerAutocompleteItemElement();\n\n const elementRef = useRef<AutocompleteItemElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { disabled: p0, value: p1, onSelect: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { disabled: p0, value: p1 });\n handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['select'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: AutocompleteItemElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-autocomplete-item', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-autocomplete-item` custom element. */\nexport const AutocompleteItem: ForwardRefExoticComponent<AutocompleteItemProps & Omit<HTMLAttributes<AutocompleteItemElement>, 'onSelect'> & RefAttributes<AutocompleteItemElement>> = /* @__PURE__ */ forwardRef(AutocompleteItemComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerAutocompletePopupElement, type AutocompletePopupElement, type AutocompletePopupEvents } from '@prosekit/web/autocomplete';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link AutocompletePopup} React 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\nfunction AutocompletePopupComponent(props: AutocompletePopupProps, forwardedRef: ForwardedRef<AutocompletePopupElement>) {\n registerAutocompletePopupElement();\n\n const elementRef = useRef<AutocompletePopupElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { onValueChange: e0, onValuesChange: e1, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n handlersRef.current = [e0, e1] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['valueChange', 'valuesChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: AutocompletePopupElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-autocomplete-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-autocomplete-popup` custom element. */\nexport const AutocompletePopup: ForwardRefExoticComponent<AutocompletePopupProps & HTMLAttributes<AutocompletePopupElement> & RefAttributes<AutocompletePopupElement>> = /* @__PURE__ */ forwardRef(AutocompletePopupComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerAutocompletePositionerElement, type AutocompletePositionerElement, type AutocompletePositionerProps as AutocompletePositionerElementProps } from '@prosekit/web/autocomplete';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link AutocompletePositioner} React 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\nfunction AutocompletePositionerComponent(props: AutocompletePositionerProps, forwardedRef: ForwardedRef<AutocompletePositionerElement>) {\n registerAutocompletePositionerElement();\n\n const elementRef = useRef<AutocompletePositionerElement>(null);\n\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\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\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 const mergedRef = useCallback(\n (element: AutocompletePositionerElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-autocomplete-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-autocomplete-positioner` custom element. */\nexport const AutocompletePositioner: ForwardRefExoticComponent<AutocompletePositionerProps & HTMLAttributes<AutocompletePositionerElement> & RefAttributes<AutocompletePositionerElement>> = /* @__PURE__ */ forwardRef(AutocompletePositionerComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerAutocompleteRootElement, type AutocompleteRootElement, type AutocompleteRootProps as AutocompleteRootElementProps, type AutocompleteRootEvents } from '@prosekit/web/autocomplete';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\nimport { useEditorContext } from '../../contexts/editor-context.ts';\n\n/** Props for the {@link AutocompleteRoot} React 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\nfunction AutocompleteRootComponent(props: AutocompleteRootProps, forwardedRef: ForwardedRef<AutocompleteRootElement>) {\n registerAutocompleteRootElement();\n\n const elementRef = useRef<AutocompleteRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const p1Fallback = useEditorContext();\n\n const { anchor: p0, editor: p1, filter: p2, regex: p3, onOpenChange: e0, onQueryChange: e1, onValueChange: e2, onValuesChange: e3, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { anchor: p0, editor: p1 ?? p1Fallback, filter: p2, regex: p3 });\n handlersRef.current = [e0, e1, e2, e3] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\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 handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: AutocompleteRootElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-autocomplete-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-autocomplete-root` custom element. */\nexport const AutocompleteRoot: ForwardRefExoticComponent<AutocompleteRootProps & HTMLAttributes<AutocompleteRootElement> & RefAttributes<AutocompleteRootElement>> = /* @__PURE__ */ forwardRef(AutocompleteRootComponent);\n","/**\n\n@module\n\n## Anatomy\n\n```jsx\nimport {\n AutocompleteEmpty,\n AutocompleteItem,\n AutocompletePopup,\n AutocompletePositioner,\n AutocompleteRoot,\n} from 'prosekit/react/autocomplete'\n\n<AutocompleteRoot>\n <AutocompletePositioner>\n <AutocompletePopup>\n <AutocompleteItem>...</AutocompleteItem>\n <AutocompleteEmpty>...</AutocompleteEmpty>\n </AutocompletePopup>\n </AutocompletePositioner>\n</AutocompleteRoot>\n```\n*/\n\n'use client'\n\nexport * from './index.gen.ts'\n"],"mappings":";;;;AAQA,SAAS,2BAA2B,OAA+B,cAAsD;CACvH,iCAAiC;CAEjC,MAAM,aAAa,OAAiC,IAAI;CAExD,MAAM,EAAE,GAAG,cAAc;CAEzB,MAAM,YAAY,aACf,YAA6C;EAC5C,WAAW,UAAU;EACrB,IAAI,OAAO,iBAAiB,YAC1B,aAAa,OAAO;OACf,IAAI,cACT,aAAa,UAAU;CAE3B,GACA,CAAC,YAAY,CACf;CAEA,OAAO,cAAc,+BAA+B;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;CAAK,CAAC;AACtH;;AAGA,MAAa,oBAA4K,2BAAW,0BAA0B;ACN9N,SAAS,0BAA0B,OAA8B,cAAqD;CACpH,gCAAgC;CAEhC,MAAM,aAAa,OAAgC,IAAI;CACvD,MAAM,cAAc,OAAoD,CAAC,CAAC;CAE1E,MAAM,EAAE,UAAU,IAAI,OAAO,IAAI,UAAU,IAAI,GAAG,cAAc;CAEhE,sBAAsB;EACpB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,OAAO,OAAO,SAAS;GAAE,UAAU;GAAI,OAAO;EAAG,CAAC;EAClD,YAAY,UAAU,CAAC,EAAE;CAC3B,CAAC;CAED,sBAAsB;EACpB,MAAM,UAAU,WAAW;EAC3B,IAAI,CA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AAM,aAAa,iBAAiB;CAEpC,MAAM,EAAE,QAAQ,IAAI,QAAQ,IAAI,QAAQ,IAAI,OAAO,IAAI,cAAc,IAAI,eAAe,IAAI,eAAe,IAAI,gBAAgB,IAAI,GAAG,cAAc;CAEpJ,sBAAsB;EACpB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,OAAO,OAAO,SAAS;GAAE,QAAQ;GAAI,QAAQ,MAAM;GAAY,QAAQ;GAAI,OAAO;EAAG,CAAC;EACtF,YAAY,UAAU;GAAC;GAAI;GAAI;GAAI;EAAE;CACvC,CAAC;CAED,sBAAsB;EACpB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,MAAM,KAAK,IAAI,gBAAgB;EAC/B,KAAK,MAAM,CAAC,OAAO,cAAc;GAAC;GAAc;GAAe;GAAe;EAAc,EAAE,QAAQ,GACpG,QAAQ,iBACN,YACC,UAAiB;GAChB,YAAY,QAAQ,SAAS,KAAK;EACpC,GACA,EAAE,QAAQ,GAAG,OAAO,CACtB;EAEF,aAAa,GAAG,MAAM;CACxB,GAAG,CAAC,CAAC;CAEL,MAAM,YAAY,aACf,YAA4C;EAC3C,WAAW,UAAU;EACrB,IAAI,OAAO,iBAAiB,YAC1B,aAAa,OAAO;OACf,IAAI,cACT,aAAa,UAAU;CAE3B,GACA,CAAC,YAAY,CACf;CAEA,OAAO,cAAc,8BAA8B;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;CAAK,CAAC;AACrH;;AAGA,MAAa,mBAAwK,2BAAW,yBAAyB"}
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","../src/components/autocomplete/index.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerAutocompleteEmptyElement, type AutocompleteEmptyElement } from '@prosekit/web/autocomplete';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from 'react';\n\n/** Props for the {@link AutocompleteEmpty} React component. */\nexport interface AutocompleteEmptyProps {}\n\nfunction AutocompleteEmptyComponent(props: AutocompleteEmptyProps, forwardedRef: ForwardedRef<AutocompleteEmptyElement>) {\n registerAutocompleteEmptyElement();\n\n const elementRef = useRef<AutocompleteEmptyElement>(null);\n\n const { ...restProps } = props;\n\n const mergedRef = useCallback(\n (element: AutocompleteEmptyElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-autocomplete-empty', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-autocomplete-empty` custom element. */\nexport const AutocompleteEmpty: ForwardRefExoticComponent<AutocompleteEmptyProps & HTMLAttributes<AutocompleteEmptyElement> & RefAttributes<AutocompleteEmptyElement>> = /* @__PURE__ */ forwardRef(AutocompleteEmptyComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerAutocompleteItemElement, type AutocompleteItemElement, type AutocompleteItemProps as AutocompleteItemElementProps, type AutocompleteItemEvents } from '@prosekit/web/autocomplete';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link AutocompleteItem} React 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\nfunction AutocompleteItemComponent(props: AutocompleteItemProps, forwardedRef: ForwardedRef<AutocompleteItemElement>) {\n registerAutocompleteItemElement();\n\n const elementRef = useRef<AutocompleteItemElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { disabled: p0, value: p1, onSelect: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { disabled: p0, value: p1 });\n handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['select'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: AutocompleteItemElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-autocomplete-item', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-autocomplete-item` custom element. */\nexport const AutocompleteItem: ForwardRefExoticComponent<AutocompleteItemProps & Omit<HTMLAttributes<AutocompleteItemElement>, 'onSelect'> & RefAttributes<AutocompleteItemElement>> = /* @__PURE__ */ forwardRef(AutocompleteItemComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerAutocompletePopupElement, type AutocompletePopupElement, type AutocompletePopupEvents } from '@prosekit/web/autocomplete';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link AutocompletePopup} React 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\nfunction AutocompletePopupComponent(props: AutocompletePopupProps, forwardedRef: ForwardedRef<AutocompletePopupElement>) {\n registerAutocompletePopupElement();\n\n const elementRef = useRef<AutocompletePopupElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { onValueChange: e0, onValuesChange: e1, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n handlersRef.current = [e0, e1] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['valueChange', 'valuesChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: AutocompletePopupElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-autocomplete-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-autocomplete-popup` custom element. */\nexport const AutocompletePopup: ForwardRefExoticComponent<AutocompletePopupProps & HTMLAttributes<AutocompletePopupElement> & RefAttributes<AutocompletePopupElement>> = /* @__PURE__ */ forwardRef(AutocompletePopupComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerAutocompletePositionerElement, type AutocompletePositionerElement, type AutocompletePositionerProps as AutocompletePositionerElementProps } from '@prosekit/web/autocomplete';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link AutocompletePositioner} React 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\nfunction AutocompletePositionerComponent(props: AutocompletePositionerProps, forwardedRef: ForwardedRef<AutocompletePositionerElement>) {\n registerAutocompletePositionerElement();\n\n const elementRef = useRef<AutocompletePositionerElement>(null);\n\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\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\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 const mergedRef = useCallback(\n (element: AutocompletePositionerElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-autocomplete-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-autocomplete-positioner` custom element. */\nexport const AutocompletePositioner: ForwardRefExoticComponent<AutocompletePositionerProps & HTMLAttributes<AutocompletePositionerElement> & RefAttributes<AutocompletePositionerElement>> = /* @__PURE__ */ forwardRef(AutocompletePositionerComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerAutocompleteRootElement, type AutocompleteRootElement, type AutocompleteRootProps as AutocompleteRootElementProps, type AutocompleteRootEvents } from '@prosekit/web/autocomplete';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\nimport { useEditorContext } from '../../contexts/editor-context.ts';\n\n/** Props for the {@link AutocompleteRoot} React 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\nfunction AutocompleteRootComponent(props: AutocompleteRootProps, forwardedRef: ForwardedRef<AutocompleteRootElement>) {\n registerAutocompleteRootElement();\n\n const elementRef = useRef<AutocompleteRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const p1Fallback = useEditorContext();\n\n const { anchor: p0, editor: p1, filter: p2, regex: p3, onOpenChange: e0, onQueryChange: e1, onValueChange: e2, onValuesChange: e3, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { anchor: p0, editor: p1 ?? p1Fallback, filter: p2, regex: p3 });\n handlersRef.current = [e0, e1, e2, e3] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\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 handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: AutocompleteRootElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-autocomplete-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-autocomplete-root` custom element. */\nexport const AutocompleteRoot: ForwardRefExoticComponent<AutocompleteRootProps & HTMLAttributes<AutocompleteRootElement> & RefAttributes<AutocompleteRootElement>> = /* @__PURE__ */ forwardRef(AutocompleteRootComponent);\n","/**\n\n@module\n\n## Anatomy\n\n```jsx\nimport {\n AutocompleteEmpty,\n AutocompleteItem,\n AutocompletePopup,\n AutocompletePositioner,\n AutocompleteRoot,\n} from 'prosekit/react/autocomplete'\n\n<AutocompleteRoot>\n <AutocompletePositioner>\n <AutocompletePopup>\n <AutocompleteItem>...</AutocompleteItem>\n <AutocompleteEmpty>...</AutocompleteEmpty>\n </AutocompletePopup>\n </AutocompletePositioner>\n</AutocompleteRoot>\n```\n*/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C;CAED,sBAAsB;EACpB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,MAAM,KAAK,IAAI,gBAAgB;EAC/B,KAAK,MAAM,CAAC,OAAO,cAAc;GAAC;GAAc;GAAe;GAAe;EAAc,CAAC,CAAC,QAAQ,GACpG,QAAQ,iBACN,YACC,UAAiB;GAChB,YAAY,QAAQ,MAAM,GAAG,KAAK;EACpC,GACA,EAAE,QAAQ,GAAG,OAAO,CACtB;EAEF,aAAa,GAAG,MAAM;CACxB,GAAG,CAAC,CAAC;CAEL,MAAM,YAAY,aACf,YAA4C;EAC3C,WAAW,UAAU;EACrB,IAAI,OAAO,iBAAiB,YAC1B,aAAa,OAAO;OACf,IAAI,cACT,aAAa,UAAU;CAE3B,GACA,CAAC,YAAY,CACf;CAEA,OAAO,cAAc,8BAA8B;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;CAAK,CAAC;AACrH;;AAGA,MAAa,mBAAwK,2BAAW,yBAAyB"}
@@ -1 +1 @@
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","../src/components/block-handle/index.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerBlockHandleAddElement, type BlockHandleAddElement, type BlockHandleAddProps as BlockHandleAddElementProps } from '@prosekit/web/block-handle';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\nimport { useEditorContext } from '../../contexts/editor-context.ts';\n\n/** Props for the {@link BlockHandleAdd} React component. */\nexport interface BlockHandleAddProps {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: BlockHandleAddElementProps['editor'];\n}\n\nfunction BlockHandleAddComponent(props: BlockHandleAddProps, forwardedRef: ForwardedRef<BlockHandleAddElement>) {\n registerBlockHandleAddElement();\n\n const elementRef = useRef<BlockHandleAddElement>(null);\n\n const p0Fallback = useEditorContext();\n\n const { editor: p0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { editor: p0 ?? p0Fallback });\n });\n\n const mergedRef = useCallback(\n (element: BlockHandleAddElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-block-handle-add', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-block-handle-add` custom element. */\nexport const BlockHandleAdd: ForwardRefExoticComponent<BlockHandleAddProps & HTMLAttributes<BlockHandleAddElement> & RefAttributes<BlockHandleAddElement>> = /* @__PURE__ */ forwardRef(BlockHandleAddComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerBlockHandleDraggableElement, type BlockHandleDraggableElement, type BlockHandleDraggableProps as BlockHandleDraggableElementProps } from '@prosekit/web/block-handle';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\nimport { useEditorContext } from '../../contexts/editor-context.ts';\n\n/** Props for the {@link BlockHandleDraggable} React component. */\nexport interface BlockHandleDraggableProps {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: BlockHandleDraggableElementProps['editor'];\n}\n\nfunction BlockHandleDraggableComponent(props: BlockHandleDraggableProps, forwardedRef: ForwardedRef<BlockHandleDraggableElement>) {\n registerBlockHandleDraggableElement();\n\n const elementRef = useRef<BlockHandleDraggableElement>(null);\n\n const p0Fallback = useEditorContext();\n\n const { editor: p0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { editor: p0 ?? p0Fallback });\n });\n\n const mergedRef = useCallback(\n (element: BlockHandleDraggableElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-block-handle-draggable', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-block-handle-draggable` custom element. */\nexport const BlockHandleDraggable: ForwardRefExoticComponent<BlockHandleDraggableProps & HTMLAttributes<BlockHandleDraggableElement> & RefAttributes<BlockHandleDraggableElement>> = /* @__PURE__ */ forwardRef(BlockHandleDraggableComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerBlockHandlePopupElement, type BlockHandlePopupElement } from '@prosekit/web/block-handle';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from 'react';\n\n/** Props for the {@link BlockHandlePopup} React component. */\nexport interface BlockHandlePopupProps {}\n\nfunction BlockHandlePopupComponent(props: BlockHandlePopupProps, forwardedRef: ForwardedRef<BlockHandlePopupElement>) {\n registerBlockHandlePopupElement();\n\n const elementRef = useRef<BlockHandlePopupElement>(null);\n\n const { ...restProps } = props;\n\n const mergedRef = useCallback(\n (element: BlockHandlePopupElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-block-handle-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-block-handle-popup` custom element. */\nexport const BlockHandlePopup: ForwardRefExoticComponent<BlockHandlePopupProps & HTMLAttributes<BlockHandlePopupElement> & RefAttributes<BlockHandlePopupElement>> = /* @__PURE__ */ forwardRef(BlockHandlePopupComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerBlockHandlePositionerElement, type BlockHandlePositionerElement, type BlockHandlePositionerProps as BlockHandlePositionerElementProps } from '@prosekit/web/block-handle';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link BlockHandlePositioner} React 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\nfunction BlockHandlePositionerComponent(props: BlockHandlePositionerProps, forwardedRef: ForwardedRef<BlockHandlePositionerElement>) {\n registerBlockHandlePositionerElement();\n\n const elementRef = useRef<BlockHandlePositionerElement>(null);\n\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\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\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 const mergedRef = useCallback(\n (element: BlockHandlePositionerElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-block-handle-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-block-handle-positioner` custom element. */\nexport const BlockHandlePositioner: ForwardRefExoticComponent<BlockHandlePositionerProps & HTMLAttributes<BlockHandlePositionerElement> & RefAttributes<BlockHandlePositionerElement>> = /* @__PURE__ */ forwardRef(BlockHandlePositionerComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerBlockHandleRootElement, type BlockHandleRootElement, type BlockHandleRootProps as BlockHandleRootElementProps, type BlockHandleRootEvents } from '@prosekit/web/block-handle';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\nimport { useEditorContext } from '../../contexts/editor-context.ts';\n\n/** Props for the {@link BlockHandleRoot} React 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\nfunction BlockHandleRootComponent(props: BlockHandleRootProps, forwardedRef: ForwardedRef<BlockHandleRootElement>) {\n registerBlockHandleRootElement();\n\n const elementRef = useRef<BlockHandleRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const p0Fallback = useEditorContext();\n\n const { editor: p0, onStateChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { editor: p0 ?? p0Fallback });\n handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['stateChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: BlockHandleRootElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-block-handle-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-block-handle-root` custom element. */\nexport const BlockHandleRoot: ForwardRefExoticComponent<BlockHandleRootProps & HTMLAttributes<BlockHandleRootElement> & RefAttributes<BlockHandleRootElement>> = /* @__PURE__ */ forwardRef(BlockHandleRootComponent);\n","/**\n\n@module\n\n## Anatomy\n\n```jsx\nimport {\n BlockHandleAdd,\n BlockHandleDraggable,\n BlockHandlePopup,\n BlockHandlePositioner,\n BlockHandleRoot,\n} from 'prosekit/react/block-handle'\n\n<BlockHandleRoot>\n <BlockHandlePositioner>\n <BlockHandlePopup>\n <BlockHandleAdd>...</BlockHandleAdd>\n <BlockHandleDraggable>...</BlockHandleDraggable>\n </BlockHandlePopup>\n </BlockHandlePositioner>\n</BlockHandleRoot>\n```\n*/\n\n'use client'\n\nexport * from './index.gen.ts'\n"],"mappings":";;;;AAkBA,SAAS,wBAAwB,OAA4B,cAAmD;CAC9G,8BAA8B;CAE9B,MAAM,aAAa,OAA8B,IAAI;CAErD,MAAM,aAAa,iBAAiB;CAEpC,MAAM,EAAE,QAAQ,IAAI,GAAG,cAAc;CAErC,sBAAs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e,IAAI,GAAG,cAAc;CAExD,sBAAsB;EACpB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,OAAO,OAAO,SAAS,EAAE,QAAQ,MAAM,WAAW,CAAC;EACnD,YAAY,UAAU,CAAC,EAAE;CAC3B,CAAC;CAED,sBAAsB;EACpB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,MAAM,KAAK,IAAI,gBAAgB;EAC/B,KAAK,MAAM,CAAC,OAAO,cAAc,CAAC,aAAa,EAAE,QAAQ,GACvD,QAAQ,iBACN,YACC,UAAiB;GAChB,YAAY,QAAQ,SAAS,KAAK;EACpC,GACA,EAAE,QAAQ,GAAG,OAAO,CACtB;EAEF,aAAa,GAAG,MAAM;CACxB,GAAG,CAAC,CAAC;CAEL,MAAM,YAAY,aACf,YAA2C;EAC1C,WAAW,UAAU;EACrB,IAAI,OAAO,iBAAiB,YAC1B,aAAa,OAAO;OACf,IAAI,cACT,aAAa,UAAU;CAE3B,GACA,CAAC,YAAY,CACf;CAEA,OAAO,cAAc,8BAA8B;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;CAAK,CAAC;AACrH;;AAGA,MAAa,kBAAoK,2BAAW,wBAAwB"}
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","../src/components/block-handle/index.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerBlockHandleAddElement, type BlockHandleAddElement, type BlockHandleAddProps as BlockHandleAddElementProps } from '@prosekit/web/block-handle';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\nimport { useEditorContext } from '../../contexts/editor-context.ts';\n\n/** Props for the {@link BlockHandleAdd} React component. */\nexport interface BlockHandleAddProps {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: BlockHandleAddElementProps['editor'];\n}\n\nfunction BlockHandleAddComponent(props: BlockHandleAddProps, forwardedRef: ForwardedRef<BlockHandleAddElement>) {\n registerBlockHandleAddElement();\n\n const elementRef = useRef<BlockHandleAddElement>(null);\n\n const p0Fallback = useEditorContext();\n\n const { editor: p0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { editor: p0 ?? p0Fallback });\n });\n\n const mergedRef = useCallback(\n (element: BlockHandleAddElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-block-handle-add', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-block-handle-add` custom element. */\nexport const BlockHandleAdd: ForwardRefExoticComponent<BlockHandleAddProps & HTMLAttributes<BlockHandleAddElement> & RefAttributes<BlockHandleAddElement>> = /* @__PURE__ */ forwardRef(BlockHandleAddComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerBlockHandleDraggableElement, type BlockHandleDraggableElement, type BlockHandleDraggableProps as BlockHandleDraggableElementProps } from '@prosekit/web/block-handle';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\nimport { useEditorContext } from '../../contexts/editor-context.ts';\n\n/** Props for the {@link BlockHandleDraggable} React component. */\nexport interface BlockHandleDraggableProps {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: BlockHandleDraggableElementProps['editor'];\n}\n\nfunction BlockHandleDraggableComponent(props: BlockHandleDraggableProps, forwardedRef: ForwardedRef<BlockHandleDraggableElement>) {\n registerBlockHandleDraggableElement();\n\n const elementRef = useRef<BlockHandleDraggableElement>(null);\n\n const p0Fallback = useEditorContext();\n\n const { editor: p0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { editor: p0 ?? p0Fallback });\n });\n\n const mergedRef = useCallback(\n (element: BlockHandleDraggableElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-block-handle-draggable', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-block-handle-draggable` custom element. */\nexport const BlockHandleDraggable: ForwardRefExoticComponent<BlockHandleDraggableProps & HTMLAttributes<BlockHandleDraggableElement> & RefAttributes<BlockHandleDraggableElement>> = /* @__PURE__ */ forwardRef(BlockHandleDraggableComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerBlockHandlePopupElement, type BlockHandlePopupElement } from '@prosekit/web/block-handle';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from 'react';\n\n/** Props for the {@link BlockHandlePopup} React component. */\nexport interface BlockHandlePopupProps {}\n\nfunction BlockHandlePopupComponent(props: BlockHandlePopupProps, forwardedRef: ForwardedRef<BlockHandlePopupElement>) {\n registerBlockHandlePopupElement();\n\n const elementRef = useRef<BlockHandlePopupElement>(null);\n\n const { ...restProps } = props;\n\n const mergedRef = useCallback(\n (element: BlockHandlePopupElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-block-handle-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-block-handle-popup` custom element. */\nexport const BlockHandlePopup: ForwardRefExoticComponent<BlockHandlePopupProps & HTMLAttributes<BlockHandlePopupElement> & RefAttributes<BlockHandlePopupElement>> = /* @__PURE__ */ forwardRef(BlockHandlePopupComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerBlockHandlePositionerElement, type BlockHandlePositionerElement, type BlockHandlePositionerProps as BlockHandlePositionerElementProps } from '@prosekit/web/block-handle';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link BlockHandlePositioner} React 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\nfunction BlockHandlePositionerComponent(props: BlockHandlePositionerProps, forwardedRef: ForwardedRef<BlockHandlePositionerElement>) {\n registerBlockHandlePositionerElement();\n\n const elementRef = useRef<BlockHandlePositionerElement>(null);\n\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\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\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 const mergedRef = useCallback(\n (element: BlockHandlePositionerElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-block-handle-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-block-handle-positioner` custom element. */\nexport const BlockHandlePositioner: ForwardRefExoticComponent<BlockHandlePositionerProps & HTMLAttributes<BlockHandlePositionerElement> & RefAttributes<BlockHandlePositionerElement>> = /* @__PURE__ */ forwardRef(BlockHandlePositionerComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerBlockHandleRootElement, type BlockHandleRootElement, type BlockHandleRootProps as BlockHandleRootElementProps, type BlockHandleRootEvents } from '@prosekit/web/block-handle';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\nimport { useEditorContext } from '../../contexts/editor-context.ts';\n\n/** Props for the {@link BlockHandleRoot} React 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\nfunction BlockHandleRootComponent(props: BlockHandleRootProps, forwardedRef: ForwardedRef<BlockHandleRootElement>) {\n registerBlockHandleRootElement();\n\n const elementRef = useRef<BlockHandleRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const p0Fallback = useEditorContext();\n\n const { editor: p0, onStateChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { editor: p0 ?? p0Fallback });\n handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['stateChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: BlockHandleRootElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-block-handle-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-block-handle-root` custom element. */\nexport const BlockHandleRoot: ForwardRefExoticComponent<BlockHandleRootProps & HTMLAttributes<BlockHandleRootElement> & RefAttributes<BlockHandleRootElement>> = /* @__PURE__ */ forwardRef(BlockHandleRootComponent);\n","/**\n\n@module\n\n## Anatomy\n\n```jsx\nimport {\n BlockHandleAdd,\n BlockHandleDraggable,\n BlockHandlePopup,\n BlockHandlePositioner,\n BlockHandleRoot,\n} from 'prosekit/react/block-handle'\n\n<BlockHandleRoot>\n <BlockHandlePositioner>\n <BlockHandlePopup>\n <BlockHandleAdd>...</BlockHandleAdd>\n <BlockHandleDraggable>...</BlockHandleDraggable>\n </BlockHandlePopup>\n </BlockHandlePositioner>\n</BlockHandleRoot>\n```\n*/\n\n'use client'\n\nexport * from './index.gen.ts'\n"],"mappings":";;;;AAkBA,SAAS,wBAAwB,OAA4B,cA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B;CAE/B,MAAM,aAAa,OAA+B,IAAI;CACtD,MAAM,cAAc,OAAoD,CAAC,CAAC;CAE1E,MAAM,aAAa,iBAAiB;CAEpC,MAAM,EAAE,QAAQ,IAAI,eAAe,IAAI,GAAG,cAAc;CAExD,sBAAsB;EACpB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,OAAO,OAAO,SAAS,EAAE,QAAQ,MAAM,WAAW,CAAC;EACnD,YAAY,UAAU,CAAC,EAAE;CAC3B,CAAC;CAED,sBAAsB;EACpB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,MAAM,KAAK,IAAI,gBAAgB;EAC/B,KAAK,MAAM,CAAC,OAAO,cAAc,CAAC,aAAa,CAAC,CAAC,QAAQ,GACvD,QAAQ,iBACN,YACC,UAAiB;GAChB,YAAY,QAAQ,MAAM,GAAG,KAAK;EACpC,GACA,EAAE,QAAQ,GAAG,OAAO,CACtB;EAEF,aAAa,GAAG,MAAM;CACxB,GAAG,CAAC,CAAC;CAEL,MAAM,YAAY,aACf,YAA2C;EAC1C,WAAW,UAAU;EACrB,IAAI,OAAO,iBAAiB,YAC1B,aAAa,OAAO;OACf,IAAI,cACT,aAAa,UAAU;CAE3B,GACA,CAAC,YAAY,CACf;CAEA,OAAO,cAAc,8BAA8B;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;CAAK,CAAC;AACrH;;AAGA,MAAa,kBAAoK,2BAAW,wBAAwB"}
@@ -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","../src/components/inline-popover/index.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerInlinePopoverPopupElement, type InlinePopoverPopupElement } from '@prosekit/web/inline-popover';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from 'react';\n\n/** Props for the {@link InlinePopoverPopup} React component. */\nexport interface InlinePopoverPopupProps {}\n\nfunction InlinePopoverPopupComponent(props: InlinePopoverPopupProps, forwardedRef: ForwardedRef<InlinePopoverPopupElement>) {\n registerInlinePopoverPopupElement();\n\n const elementRef = useRef<InlinePopoverPopupElement>(null);\n\n const { ...restProps } = props;\n\n const mergedRef = useCallback(\n (element: InlinePopoverPopupElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-inline-popover-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-inline-popover-popup` custom element. */\nexport const InlinePopoverPopup: ForwardRefExoticComponent<InlinePopoverPopupProps & HTMLAttributes<InlinePopoverPopupElement> & RefAttributes<InlinePopoverPopupElement>> = /* @__PURE__ */ forwardRef(InlinePopoverPopupComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerInlinePopoverPositionerElement, type InlinePopoverPositionerElement, type InlinePopoverPositionerProps as InlinePopoverPositionerElementProps } from '@prosekit/web/inline-popover';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link InlinePopoverPositioner} React 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\nfunction InlinePopoverPositionerComponent(props: InlinePopoverPositionerProps, forwardedRef: ForwardedRef<InlinePopoverPositionerElement>) {\n registerInlinePopoverPositionerElement();\n\n const elementRef = useRef<InlinePopoverPositionerElement>(null);\n\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\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\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 const mergedRef = useCallback(\n (element: InlinePopoverPositionerElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-inline-popover-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-inline-popover-positioner` custom element. */\nexport const InlinePopoverPositioner: ForwardRefExoticComponent<InlinePopoverPositionerProps & HTMLAttributes<InlinePopoverPositionerElement> & RefAttributes<InlinePopoverPositionerElement>> = /* @__PURE__ */ forwardRef(InlinePopoverPositionerComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerInlinePopoverRootElement, type InlinePopoverRootElement, type InlinePopoverRootProps as InlinePopoverRootElementProps, type InlinePopoverRootEvents } from '@prosekit/web/inline-popover';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\nimport { useEditorContext } from '../../contexts/editor-context.ts';\n\n/** Props for the {@link InlinePopoverRoot} React 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 * The reference to position the popover against. This can be a DOM element, a\n * Floating UI virtual element, or a function that returns either of them.\n *\n * When set, the popover is anchored to this reference instead of the current\n * text selection, and the text selection no longer drives the open state, so\n * control it with the `open` property.\n *\n * @default null\n */\n anchor?: InlinePopoverRootElementProps['anchor'];\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\nfunction InlinePopoverRootComponent(props: InlinePopoverRootProps, forwardedRef: ForwardedRef<InlinePopoverRootElement>) {\n registerInlinePopoverRootElement();\n\n const elementRef = useRef<InlinePopoverRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const p4Fallback = useEditorContext();\n\n const { anchor: p0, defaultOpen: p1, disabled: p2, dismissOnEscape: p3, editor: p4, open: p5, onOpenChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { anchor: p0, defaultOpen: p1, disabled: p2, dismissOnEscape: p3, editor: p4 ?? p4Fallback, open: p5 });\n handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['openChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: InlinePopoverRootElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-inline-popover-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-inline-popover-root` custom element. */\nexport const InlinePopoverRoot: ForwardRefExoticComponent<InlinePopoverRootProps & HTMLAttributes<InlinePopoverRootElement> & RefAttributes<InlinePopoverRootElement>> = /* @__PURE__ */ forwardRef(InlinePopoverRootComponent);\n","/**\n\n@module\n\n## Anatomy\n\n```jsx\nimport {\n InlinePopoverPopup,\n InlinePopoverPositioner,\n InlinePopoverRoot,\n} from 'prosekit/react/inline-popover'\n\n<InlinePopoverRoot>\n <InlinePopoverPositioner>\n <InlinePopoverPopup>...</InlinePopoverPopup>\n </InlinePopoverPositioner>\n</InlinePopoverRoot>\n```\n*/\n\n'use client'\n\nexport * from './index.gen.ts'\n"],"mappings":";;;;AAQA,SAAS,4BAA4B,OAAgC,cAAuD;CAC1H,kCAAkC;CAElC,MAAM,aAAa,OAAkC,IAAI;CAEzD,MAA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CAAgC;AC7G5P,SAAS,2BAA2B,OAA+B,cAAsD;CACvH,iCAAiC;CAEjC,MAAM,aAAa,OAAiC,IAAI;CACxD,MAAM,cAAc,OAAoD,CAAC,CAAC;CAE1E,MAAM,aAAa,iBAAiB;CAEpC,MAAM,EAAE,QAAQ,IAAI,aAAa,IAAI,UAAU,IAAI,iBAAiB,IAAI,QAAQ,IAAI,MAAM,IAAI,cAAc,IAAI,GAAG,cAAc;CAEjI,sBAAsB;EACpB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,OAAO,OAAO,SAAS;GAAE,QAAQ;GAAI,aAAa;GAAI,UAAU;GAAI,iBAAiB;GAAI,QAAQ,MAAM;GAAY,MAAM;EAAG,CAAC;EAC7H,YAAY,UAAU,CAAC,EAAE;CAC3B,CAAC;CAED,sBAAsB;EACpB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,MAAM,KAAK,IAAI,gBAAgB;EAC/B,KAAK,MAAM,CAAC,OAAO,cAAc,CAAC,YAAY,EAAE,QAAQ,GACtD,QAAQ,iBACN,YACC,UAAiB;GAChB,YAAY,QAAQ,SAAS,KAAK;EACpC,GACA,EAAE,QAAQ,GAAG,OAAO,CACtB;EAEF,aAAa,GAAG,MAAM;CACxB,GAAG,CAAC,CAAC;CAEL,MAAM,YAAY,aACf,YAA6C;EAC5C,WAAW,UAAU;EACrB,IAAI,OAAO,iBAAiB,YAC1B,aAAa,OAAO;OACf,IAAI,cACT,aAAa,UAAU;CAE3B,GACA,CAAC,YAAY,CACf;CAEA,OAAO,cAAc,gCAAgC;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;CAAK,CAAC;AACvH;;AAGA,MAAa,oBAA4K,2BAAW,0BAA0B"}
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","../src/components/inline-popover/index.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerInlinePopoverPopupElement, type InlinePopoverPopupElement } from '@prosekit/web/inline-popover';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from 'react';\n\n/** Props for the {@link InlinePopoverPopup} React component. */\nexport interface InlinePopoverPopupProps {}\n\nfunction InlinePopoverPopupComponent(props: InlinePopoverPopupProps, forwardedRef: ForwardedRef<InlinePopoverPopupElement>) {\n registerInlinePopoverPopupElement();\n\n const elementRef = useRef<InlinePopoverPopupElement>(null);\n\n const { ...restProps } = props;\n\n const mergedRef = useCallback(\n (element: InlinePopoverPopupElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-inline-popover-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-inline-popover-popup` custom element. */\nexport const InlinePopoverPopup: ForwardRefExoticComponent<InlinePopoverPopupProps & HTMLAttributes<InlinePopoverPopupElement> & RefAttributes<InlinePopoverPopupElement>> = /* @__PURE__ */ forwardRef(InlinePopoverPopupComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerInlinePopoverPositionerElement, type InlinePopoverPositionerElement, type InlinePopoverPositionerProps as InlinePopoverPositionerElementProps } from '@prosekit/web/inline-popover';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link InlinePopoverPositioner} React 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\nfunction InlinePopoverPositionerComponent(props: InlinePopoverPositionerProps, forwardedRef: ForwardedRef<InlinePopoverPositionerElement>) {\n registerInlinePopoverPositionerElement();\n\n const elementRef = useRef<InlinePopoverPositionerElement>(null);\n\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\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\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 const mergedRef = useCallback(\n (element: InlinePopoverPositionerElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-inline-popover-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-inline-popover-positioner` custom element. */\nexport const InlinePopoverPositioner: ForwardRefExoticComponent<InlinePopoverPositionerProps & HTMLAttributes<InlinePopoverPositionerElement> & RefAttributes<InlinePopoverPositionerElement>> = /* @__PURE__ */ forwardRef(InlinePopoverPositionerComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerInlinePopoverRootElement, type InlinePopoverRootElement, type InlinePopoverRootProps as InlinePopoverRootElementProps, type InlinePopoverRootEvents } from '@prosekit/web/inline-popover';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\nimport { useEditorContext } from '../../contexts/editor-context.ts';\n\n/** Props for the {@link InlinePopoverRoot} React 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 * The reference to position the popover against. This can be a DOM element, a\n * Floating UI virtual element, or a function that returns either of them.\n *\n * When set, the popover is anchored to this reference instead of the current\n * text selection, and the text selection no longer drives the open state, so\n * control it with the `open` property.\n *\n * @default null\n */\n anchor?: InlinePopoverRootElementProps['anchor'];\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\nfunction InlinePopoverRootComponent(props: InlinePopoverRootProps, forwardedRef: ForwardedRef<InlinePopoverRootElement>) {\n registerInlinePopoverRootElement();\n\n const elementRef = useRef<InlinePopoverRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const p4Fallback = useEditorContext();\n\n const { anchor: p0, defaultOpen: p1, disabled: p2, dismissOnEscape: p3, editor: p4, open: p5, onOpenChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { anchor: p0, defaultOpen: p1, disabled: p2, dismissOnEscape: p3, editor: p4 ?? p4Fallback, open: p5 });\n handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['openChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: InlinePopoverRootElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-inline-popover-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-inline-popover-root` custom element. */\nexport const InlinePopoverRoot: ForwardRefExoticComponent<InlinePopoverRootProps & HTMLAttributes<InlinePopoverRootElement> & RefAttributes<InlinePopoverRootElement>> = /* @__PURE__ */ forwardRef(InlinePopoverRootComponent);\n","/**\n\n@module\n\n## Anatomy\n\n```jsx\nimport {\n InlinePopoverPopup,\n InlinePopoverPositioner,\n InlinePopoverRoot,\n} from 'prosekit/react/inline-popover'\n\n<InlinePopoverRoot>\n <InlinePopoverPositioner>\n <InlinePopoverPopup>...</InlinePopoverPopup>\n </InlinePopoverPositioner>\n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a,oBAA4K,2BAAW,0BAA0B"}
package/dist/menu.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"menu.js","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","../src/components/menu/index.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerMenuItemElement, type MenuItemElement, type MenuItemProps as MenuItemElementProps, type MenuItemEvents } from '@prosekit/web/menu';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link MenuItem} React component. */\nexport interface MenuItemProps {\n /**\n * The unique value for this menu item.\n *\n * @default \"\"\n */\n value?: MenuItemElementProps['value'];\n /**\n * Whether this menu item is disabled.\n *\n * @default false\n */\n disabled?: MenuItemElementProps['disabled'];\n /**\n * Whether to close the menu when the item is pressed.\n *\n * @default true\n */\n closeOnSelect?: MenuItemElementProps['closeOnSelect'];\n /** Emitted when the the item is selected. */\n onSelect?: (event: MenuItemEvents['select']) => void;\n}\n\nfunction MenuItemComponent(props: MenuItemProps, forwardedRef: ForwardedRef<MenuItemElement>) {\n registerMenuItemElement();\n\n const elementRef = useRef<MenuItemElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { closeOnSelect: p0, disabled: p1, value: p2, onSelect: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { closeOnSelect: p0, disabled: p1, value: p2 });\n handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['select'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: MenuItemElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-menu-item', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-menu-item` custom element. */\nexport const MenuItem: ForwardRefExoticComponent<MenuItemProps & Omit<HTMLAttributes<MenuItemElement>, 'onSelect'> & RefAttributes<MenuItemElement>> = /* @__PURE__ */ forwardRef(MenuItemComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerMenuPopupElement, type MenuPopupElement, type MenuPopupProps as MenuPopupElementProps } from '@prosekit/web/menu';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link MenuPopup} React component. */\nexport interface MenuPopupProps {\n /**\n * By default, the MenuPopup element will listen for keydown events.\n * You can pass a different element to listen for keydown events.\n *\n * @default null\n */\n eventTarget?: MenuPopupElementProps['eventTarget'];\n}\n\nfunction MenuPopupComponent(props: MenuPopupProps, forwardedRef: ForwardedRef<MenuPopupElement>) {\n registerMenuPopupElement();\n\n const elementRef = useRef<MenuPopupElement>(null);\n\n const { eventTarget: p0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { eventTarget: p0 });\n });\n\n const mergedRef = useCallback(\n (element: MenuPopupElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-menu-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-menu-popup` custom element. */\nexport const MenuPopup: ForwardRefExoticComponent<MenuPopupProps & HTMLAttributes<MenuPopupElement> & RefAttributes<MenuPopupElement>> = /* @__PURE__ */ forwardRef(MenuPopupComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerMenuPositionerElement, type MenuPositionerElement, type MenuPositionerProps as MenuPositionerElementProps } from '@prosekit/web/menu';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link MenuPositioner} React component. */\nexport interface MenuPositionerProps {\n /**\n * The initial placement of the floating element\n *\n * @default \"bottom-start\"\n */\n placement?: MenuPositionerElementProps['placement'];\n /**\n * The strategy to use for positioning\n *\n * @default \"absolute\"\n */\n strategy?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['hoist'];\n /**\n * The distance between the reference and floating element.\n *\n * @default 6\n */\n offset?: MenuPositionerElementProps['offset'];\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?: MenuPositionerElementProps['flip'];\n /**\n * Whether the floating element should shift to keep it in view.\n *\n * @default true\n */\n shift?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['sameHeight'];\n /**\n * Whether to improve positioning for inline reference elements that span over\n * multiple lines.\n *\n * @default false\n */\n inline?: MenuPositionerElementProps['inline'];\n /**\n * Whether to hide the floating element when the reference element or the\n * floating element is fully clipped.\n *\n * @default false\n */\n hide?: MenuPositionerElementProps['hide'];\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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['altBoundary'];\n}\n\nfunction MenuPositionerComponent(props: MenuPositionerProps, forwardedRef: ForwardedRef<MenuPositionerElement>) {\n registerMenuPositionerElement();\n\n const elementRef = useRef<MenuPositionerElement>(null);\n\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\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\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 const mergedRef = useCallback(\n (element: MenuPositionerElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-menu-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-menu-positioner` custom element. */\nexport const MenuPositioner: ForwardRefExoticComponent<MenuPositionerProps & HTMLAttributes<MenuPositionerElement> & RefAttributes<MenuPositionerElement>> = /* @__PURE__ */ forwardRef(MenuPositionerComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerMenuRootElement, type MenuRootElement, type MenuRootProps as MenuRootElementProps, type MenuRootEvents } from '@prosekit/web/menu';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link MenuRoot} React component. */\nexport interface MenuRootProps {\n /**\n * Whether the overlay is initially open.\n * @default false\n */\n defaultOpen?: MenuRootElementProps['defaultOpen'];\n /**\n * Whether the overlay is currently open.\n * @default null\n */\n open?: MenuRootElementProps['open'];\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: MenuRootElementProps['disabled'];\n /** Emitted when the menu is opened or closed. */\n onOpenChange?: (event: MenuRootEvents['openChange']) => void;\n}\n\nfunction MenuRootComponent(props: MenuRootProps, forwardedRef: ForwardedRef<MenuRootElement>) {\n registerMenuRootElement();\n\n const elementRef = useRef<MenuRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { defaultOpen: p0, disabled: p1, open: p2, onOpenChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { defaultOpen: p0, disabled: p1, open: p2 });\n handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['openChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: MenuRootElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-menu-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-menu-root` custom element. */\nexport const MenuRoot: ForwardRefExoticComponent<MenuRootProps & HTMLAttributes<MenuRootElement> & RefAttributes<MenuRootElement>> = /* @__PURE__ */ forwardRef(MenuRootComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerMenuSubmenuRootElement, type MenuSubmenuRootElement, type MenuSubmenuRootProps as MenuSubmenuRootElementProps, type MenuSubmenuRootEvents } from '@prosekit/web/menu';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link MenuSubmenuRoot} React component. */\nexport interface MenuSubmenuRootProps {\n /**\n * Whether the overlay is initially open.\n * @default false\n */\n defaultOpen?: MenuSubmenuRootElementProps['defaultOpen'];\n /**\n * Whether the overlay is currently open.\n * @default null\n */\n open?: MenuSubmenuRootElementProps['open'];\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: MenuSubmenuRootElementProps['disabled'];\n /** Emitted when the submenu is opened or closed. */\n onOpenChange?: (event: MenuSubmenuRootEvents['openChange']) => void;\n}\n\nfunction MenuSubmenuRootComponent(props: MenuSubmenuRootProps, forwardedRef: ForwardedRef<MenuSubmenuRootElement>) {\n registerMenuSubmenuRootElement();\n\n const elementRef = useRef<MenuSubmenuRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { defaultOpen: p0, disabled: p1, open: p2, onOpenChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { defaultOpen: p0, disabled: p1, open: p2 });\n handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['openChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: MenuSubmenuRootElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-menu-submenu-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-menu-submenu-root` custom element. */\nexport const MenuSubmenuRoot: ForwardRefExoticComponent<MenuSubmenuRootProps & HTMLAttributes<MenuSubmenuRootElement> & RefAttributes<MenuSubmenuRootElement>> = /* @__PURE__ */ forwardRef(MenuSubmenuRootComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerMenuSubmenuTriggerElement, type MenuSubmenuTriggerElement, type MenuSubmenuTriggerProps as MenuSubmenuTriggerElementProps } from '@prosekit/web/menu';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link MenuSubmenuTrigger} React component. */\nexport interface MenuSubmenuTriggerProps {\n /**\n * The unique value for this submenu trigger in the parent menu.\n *\n * @default \"\"\n */\n value?: MenuSubmenuTriggerElementProps['value'];\n /**\n * Whether this submenu trigger is disabled.\n *\n * @default false\n */\n disabled?: MenuSubmenuTriggerElementProps['disabled'];\n}\n\nfunction MenuSubmenuTriggerComponent(props: MenuSubmenuTriggerProps, forwardedRef: ForwardedRef<MenuSubmenuTriggerElement>) {\n registerMenuSubmenuTriggerElement();\n\n const elementRef = useRef<MenuSubmenuTriggerElement>(null);\n\n const { disabled: p0, value: p1, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { disabled: p0, value: p1 });\n });\n\n const mergedRef = useCallback(\n (element: MenuSubmenuTriggerElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-menu-submenu-trigger', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-menu-submenu-trigger` custom element. */\nexport const MenuSubmenuTrigger: ForwardRefExoticComponent<MenuSubmenuTriggerProps & HTMLAttributes<MenuSubmenuTriggerElement> & RefAttributes<MenuSubmenuTriggerElement>> = /* @__PURE__ */ forwardRef(MenuSubmenuTriggerComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerMenuTriggerElement, type MenuTriggerElement, type MenuTriggerProps as MenuTriggerElementProps, type MenuTriggerEvents } from '@prosekit/web/menu';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link MenuTrigger} React component. */\nexport interface MenuTriggerProps {\n /**\n * Whether the component should ignore user interaction.\n *\n * @default false\n */\n disabled?: MenuTriggerElementProps['disabled'];\n /** Emitted when the menu is opened or closed. */\n onOpenChange?: (event: MenuTriggerEvents['openChange']) => void;\n}\n\nfunction MenuTriggerComponent(props: MenuTriggerProps, forwardedRef: ForwardedRef<MenuTriggerElement>) {\n registerMenuTriggerElement();\n\n const elementRef = useRef<MenuTriggerElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { disabled: p0, onOpenChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { disabled: p0 });\n handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['openChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: MenuTriggerElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-menu-trigger', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-menu-trigger` custom element. */\nexport const MenuTrigger: ForwardRefExoticComponent<MenuTriggerProps & HTMLAttributes<MenuTriggerElement> & RefAttributes<MenuTriggerElement>> = /* @__PURE__ */ forwardRef(MenuTriggerComponent);\n","/**\n\n@module\n\n## Anatomy\n\n```jsx\nimport {\n MenuItem,\n MenuPopup,\n MenuPositioner,\n MenuRoot,\n MenuSubmenuRoot,\n MenuSubmenuTrigger,\n MenuTrigger,\n} from 'prosekit/react/menu'\n\n<MenuRoot>\n <MenuTrigger>...</MenuTrigger>\n <MenuPositioner>\n <MenuPopup>\n <MenuItem>...</MenuItem>\n <MenuSubmenuRoot>\n <MenuSubmenuTrigger>...</MenuSubmenuTrigger>\n <MenuPositioner>\n <MenuPopup>\n <MenuItem>...</MenuItem>\n </MenuPopup>\n </MenuPositioner>\n </MenuSubmenuRoot>\n </MenuPopup>\n </MenuPositioner>\n</MenuRoot>\n```\n*/\n\n'use client'\n\nexport * from './index.gen.ts'\n"],"mappings":";;;AA6BA,SAAS,kBAAkB,OAAsB,cAA6C;CAC5F,wBAAwB;CAExB,MAAM,aAAa,OAAwB,IAAI;CAC/C,MAAM,cAAc,OAAoD,CAAC,CAAC;CAE1E,MAAM,EAAE,eAAe,IAAI,UAAU,IAAI,OAAO,IAAI,UAAU,IAAI,GAAG,cAAc;CAEnF,sBAAsB;EACpB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,OAAO,OAAO,SAAS;GAAE,eAAe;GAAI,UAAU;GAAI,OAAO;EAAG,CAAC;EACrE,YAAY,UAAU,CAAC,EAAE;CAC3B,CAAC;CAED,sBAAsB;EACpB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,MAAM,KAAK,IAAI,gBAAgB;EAC/B,KAAK,MAAM,CAAC,OAAO,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAClD,QAAQ,iBACN,YACC,UAAiB;GAChB,YAAY,QAAQ,SAAS,KAAK;EACpC,GACA,EAAE,QAAQ,GAAG,OAAO,CACtB;EAEF,aAAa,GAAG,MAAM;CACxB,GAAG,CAAC,CAAC;CAEL,MAAM,YAAY,aACf,YAAoC;EACnC,WAAW,UAAU;EACrB,IAAI,OAAO,iBAAiB,YAC1B,aAAa,OAAO;OACf,IAAI,cACT,aAAa,UAAU;CAE3B,GACA,CAA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AK,CAAC;AAChH;;AAGA,MAAa,cAAoJ,2BAAW,oBAAoB"}
1
+ {"version":3,"file":"menu.js","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","../src/components/menu/index.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerMenuItemElement, type MenuItemElement, type MenuItemProps as MenuItemElementProps, type MenuItemEvents } from '@prosekit/web/menu';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link MenuItem} React component. */\nexport interface MenuItemProps {\n /**\n * The unique value for this menu item.\n *\n * @default \"\"\n */\n value?: MenuItemElementProps['value'];\n /**\n * Whether this menu item is disabled.\n *\n * @default false\n */\n disabled?: MenuItemElementProps['disabled'];\n /**\n * Whether to close the menu when the item is pressed.\n *\n * @default true\n */\n closeOnSelect?: MenuItemElementProps['closeOnSelect'];\n /** Emitted when the the item is selected. */\n onSelect?: (event: MenuItemEvents['select']) => void;\n}\n\nfunction MenuItemComponent(props: MenuItemProps, forwardedRef: ForwardedRef<MenuItemElement>) {\n registerMenuItemElement();\n\n const elementRef = useRef<MenuItemElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { closeOnSelect: p0, disabled: p1, value: p2, onSelect: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { closeOnSelect: p0, disabled: p1, value: p2 });\n handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['select'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: MenuItemElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-menu-item', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-menu-item` custom element. */\nexport const MenuItem: ForwardRefExoticComponent<MenuItemProps & Omit<HTMLAttributes<MenuItemElement>, 'onSelect'> & RefAttributes<MenuItemElement>> = /* @__PURE__ */ forwardRef(MenuItemComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerMenuPopupElement, type MenuPopupElement, type MenuPopupProps as MenuPopupElementProps } from '@prosekit/web/menu';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link MenuPopup} React component. */\nexport interface MenuPopupProps {\n /**\n * By default, the MenuPopup element will listen for keydown events.\n * You can pass a different element to listen for keydown events.\n *\n * @default null\n */\n eventTarget?: MenuPopupElementProps['eventTarget'];\n}\n\nfunction MenuPopupComponent(props: MenuPopupProps, forwardedRef: ForwardedRef<MenuPopupElement>) {\n registerMenuPopupElement();\n\n const elementRef = useRef<MenuPopupElement>(null);\n\n const { eventTarget: p0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { eventTarget: p0 });\n });\n\n const mergedRef = useCallback(\n (element: MenuPopupElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-menu-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-menu-popup` custom element. */\nexport const MenuPopup: ForwardRefExoticComponent<MenuPopupProps & HTMLAttributes<MenuPopupElement> & RefAttributes<MenuPopupElement>> = /* @__PURE__ */ forwardRef(MenuPopupComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerMenuPositionerElement, type MenuPositionerElement, type MenuPositionerProps as MenuPositionerElementProps } from '@prosekit/web/menu';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link MenuPositioner} React component. */\nexport interface MenuPositionerProps {\n /**\n * The initial placement of the floating element\n *\n * @default \"bottom-start\"\n */\n placement?: MenuPositionerElementProps['placement'];\n /**\n * The strategy to use for positioning\n *\n * @default \"absolute\"\n */\n strategy?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['hoist'];\n /**\n * The distance between the reference and floating element.\n *\n * @default 6\n */\n offset?: MenuPositionerElementProps['offset'];\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?: MenuPositionerElementProps['flip'];\n /**\n * Whether the floating element should shift to keep it in view.\n *\n * @default true\n */\n shift?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['sameHeight'];\n /**\n * Whether to improve positioning for inline reference elements that span over\n * multiple lines.\n *\n * @default false\n */\n inline?: MenuPositionerElementProps['inline'];\n /**\n * Whether to hide the floating element when the reference element or the\n * floating element is fully clipped.\n *\n * @default false\n */\n hide?: MenuPositionerElementProps['hide'];\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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['altBoundary'];\n}\n\nfunction MenuPositionerComponent(props: MenuPositionerProps, forwardedRef: ForwardedRef<MenuPositionerElement>) {\n registerMenuPositionerElement();\n\n const elementRef = useRef<MenuPositionerElement>(null);\n\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\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\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 const mergedRef = useCallback(\n (element: MenuPositionerElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-menu-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-menu-positioner` custom element. */\nexport const MenuPositioner: ForwardRefExoticComponent<MenuPositionerProps & HTMLAttributes<MenuPositionerElement> & RefAttributes<MenuPositionerElement>> = /* @__PURE__ */ forwardRef(MenuPositionerComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerMenuRootElement, type MenuRootElement, type MenuRootProps as MenuRootElementProps, type MenuRootEvents } from '@prosekit/web/menu';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link MenuRoot} React component. */\nexport interface MenuRootProps {\n /**\n * Whether the overlay is initially open.\n * @default false\n */\n defaultOpen?: MenuRootElementProps['defaultOpen'];\n /**\n * Whether the overlay is currently open.\n * @default null\n */\n open?: MenuRootElementProps['open'];\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: MenuRootElementProps['disabled'];\n /** Emitted when the menu is opened or closed. */\n onOpenChange?: (event: MenuRootEvents['openChange']) => void;\n}\n\nfunction MenuRootComponent(props: MenuRootProps, forwardedRef: ForwardedRef<MenuRootElement>) {\n registerMenuRootElement();\n\n const elementRef = useRef<MenuRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { defaultOpen: p0, disabled: p1, open: p2, onOpenChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { defaultOpen: p0, disabled: p1, open: p2 });\n handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['openChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: MenuRootElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-menu-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-menu-root` custom element. */\nexport const MenuRoot: ForwardRefExoticComponent<MenuRootProps & HTMLAttributes<MenuRootElement> & RefAttributes<MenuRootElement>> = /* @__PURE__ */ forwardRef(MenuRootComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerMenuSubmenuRootElement, type MenuSubmenuRootElement, type MenuSubmenuRootProps as MenuSubmenuRootElementProps, type MenuSubmenuRootEvents } from '@prosekit/web/menu';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link MenuSubmenuRoot} React component. */\nexport interface MenuSubmenuRootProps {\n /**\n * Whether the overlay is initially open.\n * @default false\n */\n defaultOpen?: MenuSubmenuRootElementProps['defaultOpen'];\n /**\n * Whether the overlay is currently open.\n * @default null\n */\n open?: MenuSubmenuRootElementProps['open'];\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: MenuSubmenuRootElementProps['disabled'];\n /** Emitted when the submenu is opened or closed. */\n onOpenChange?: (event: MenuSubmenuRootEvents['openChange']) => void;\n}\n\nfunction MenuSubmenuRootComponent(props: MenuSubmenuRootProps, forwardedRef: ForwardedRef<MenuSubmenuRootElement>) {\n registerMenuSubmenuRootElement();\n\n const elementRef = useRef<MenuSubmenuRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { defaultOpen: p0, disabled: p1, open: p2, onOpenChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { defaultOpen: p0, disabled: p1, open: p2 });\n handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['openChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: MenuSubmenuRootElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-menu-submenu-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-menu-submenu-root` custom element. */\nexport const MenuSubmenuRoot: ForwardRefExoticComponent<MenuSubmenuRootProps & HTMLAttributes<MenuSubmenuRootElement> & RefAttributes<MenuSubmenuRootElement>> = /* @__PURE__ */ forwardRef(MenuSubmenuRootComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerMenuSubmenuTriggerElement, type MenuSubmenuTriggerElement, type MenuSubmenuTriggerProps as MenuSubmenuTriggerElementProps } from '@prosekit/web/menu';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link MenuSubmenuTrigger} React component. */\nexport interface MenuSubmenuTriggerProps {\n /**\n * The unique value for this submenu trigger in the parent menu.\n *\n * @default \"\"\n */\n value?: MenuSubmenuTriggerElementProps['value'];\n /**\n * Whether this submenu trigger is disabled.\n *\n * @default false\n */\n disabled?: MenuSubmenuTriggerElementProps['disabled'];\n}\n\nfunction MenuSubmenuTriggerComponent(props: MenuSubmenuTriggerProps, forwardedRef: ForwardedRef<MenuSubmenuTriggerElement>) {\n registerMenuSubmenuTriggerElement();\n\n const elementRef = useRef<MenuSubmenuTriggerElement>(null);\n\n const { disabled: p0, value: p1, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { disabled: p0, value: p1 });\n });\n\n const mergedRef = useCallback(\n (element: MenuSubmenuTriggerElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-menu-submenu-trigger', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-menu-submenu-trigger` custom element. */\nexport const MenuSubmenuTrigger: ForwardRefExoticComponent<MenuSubmenuTriggerProps & HTMLAttributes<MenuSubmenuTriggerElement> & RefAttributes<MenuSubmenuTriggerElement>> = /* @__PURE__ */ forwardRef(MenuSubmenuTriggerComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerMenuTriggerElement, type MenuTriggerElement, type MenuTriggerProps as MenuTriggerElementProps, type MenuTriggerEvents } from '@prosekit/web/menu';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link MenuTrigger} React component. */\nexport interface MenuTriggerProps {\n /**\n * Whether the component should ignore user interaction.\n *\n * @default false\n */\n disabled?: MenuTriggerElementProps['disabled'];\n /** Emitted when the menu is opened or closed. */\n onOpenChange?: (event: MenuTriggerEvents['openChange']) => void;\n}\n\nfunction MenuTriggerComponent(props: MenuTriggerProps, forwardedRef: ForwardedRef<MenuTriggerElement>) {\n registerMenuTriggerElement();\n\n const elementRef = useRef<MenuTriggerElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { disabled: p0, onOpenChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { disabled: p0 });\n handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['openChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: MenuTriggerElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-menu-trigger', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-menu-trigger` custom element. */\nexport const MenuTrigger: ForwardRefExoticComponent<MenuTriggerProps & HTMLAttributes<MenuTriggerElement> & RefAttributes<MenuTriggerElement>> = /* @__PURE__ */ forwardRef(MenuTriggerComponent);\n","/**\n\n@module\n\n## Anatomy\n\n```jsx\nimport {\n MenuItem,\n MenuPopup,\n MenuPositioner,\n MenuRoot,\n MenuSubmenuRoot,\n MenuSubmenuTrigger,\n MenuTrigger,\n} from 'prosekit/react/menu'\n\n<MenuRoot>\n <MenuTrigger>...</MenuTrigger>\n <MenuPositioner>\n <MenuPopup>\n <MenuItem>...</MenuItem>\n <MenuSubmenuRoot>\n <MenuSubmenuTrigger>...</MenuSubmenuTrigger>\n <MenuPositioner>\n <MenuPopup>\n <MenuItem>...</MenuItem>\n </MenuPopup>\n </MenuPositioner>\n </MenuSubmenuRoot>\n </MenuPopup>\n </MenuPositioner>\n</MenuRoot>\n```\n*/\n\n'use client'\n\nexport * from './index.gen.ts'\n"],"mappings":";;;AA6BA,SAAS,kBAAkB,OAAsB,cAA6C;CAC5F,wBAAwB;CAExB,MAAM,aAAa,OAAwB,IAAI;CAC/C,MAAM,cAAc,OAAoD,CAAC,CAAC;CAE1E,MAAM,EAAE,eAAe,IAAI,UAAU,IAAI,OAAO,IAAI,UAAU,IAAI,GAAG,cAAc;CAEnF,sBAAsB;EACpB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,OAAO,OAAO,SAAS;GAAE,eAAe;GAAI,UAAU;GAAI,OAAO;EAAG,CAAC;EACrE,YAAY,UAAU,CAAC,EAAE;CAC3B,CAAC;CAED,sBAAsB;EACpB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,MAAM,KAAK,IAAI,gBAAgB;EAC/B,KAAK,MAAM,CAAC,OAAO,cAAc,CAAC,QAAQ,CAAC,CAAC,QAAQ,GAClD,QAAQ,iBACN,YACC,UAAiB;GAChB,YAAY,QAAQ,MAAM,GAAG,KAAK;EACpC,GACA,EAAE,QAAQ,GAAG,OAAO,CACtB;EAEF,aAAa,GAAG,MAAM;CACxB,GAAG,CAAC,CAAC;CAEL,MAAM,YAAY,aACf,YAAoC;EACnC,WAAW,UAAU;EACrB,IAAI,OAAO,iBAAiB,YAC1B,aAAa,OAAO;OACf,IAAI,cACT,aAAa,UAAU;CAE3B,GACA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EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;CAAK,CAAC;AAChH;;AAGA,MAAa,cAAoJ,2BAAW,oBAAoB"}
@@ -1 +1 @@
1
- {"version":3,"file":"popover.js","names":[],"sources":["../src/components/popover/popover-popup.gen.ts","../src/components/popover/popover-positioner.gen.ts","../src/components/popover/popover-root.gen.ts","../src/components/popover/popover-trigger.gen.ts","../src/components/popover/index.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerPopoverPopupElement, type PopoverPopupElement } from '@prosekit/web/popover';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from 'react';\n\n/** Props for the {@link PopoverPopup} React component. */\nexport interface PopoverPopupProps {}\n\nfunction PopoverPopupComponent(props: PopoverPopupProps, forwardedRef: ForwardedRef<PopoverPopupElement>) {\n registerPopoverPopupElement();\n\n const elementRef = useRef<PopoverPopupElement>(null);\n\n const { ...restProps } = props;\n\n const mergedRef = useCallback(\n (element: PopoverPopupElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-popover-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-popover-popup` custom element. */\nexport const PopoverPopup: ForwardRefExoticComponent<PopoverPopupProps & HTMLAttributes<PopoverPopupElement> & RefAttributes<PopoverPopupElement>> = /* @__PURE__ */ forwardRef(PopoverPopupComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerPopoverPositionerElement, type PopoverPositionerElement, type PopoverPositionerProps as PopoverPositionerElementProps } from '@prosekit/web/popover';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link PopoverPositioner} React component. */\nexport interface PopoverPositionerProps {\n /**\n * The strategy to use for positioning\n *\n * @default \"absolute\"\n */\n strategy?: PopoverPositionerElementProps['strategy'];\n /**\n * The initial placement of the floating element\n *\n * @default \"top\"\n */\n placement?: PopoverPositionerElementProps['placement'];\n /**\n * Options to activate auto-update listeners\n *\n * @see https://floating-ui.com/docs/autoUpdate\n *\n * @default true\n */\n autoUpdate?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['hoist'];\n /**\n * The distance between the reference and floating element.\n *\n * @default 6\n */\n offset?: PopoverPositionerElementProps['offset'];\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?: PopoverPositionerElementProps['flip'];\n /**\n * Whether the floating element should shift to keep it in view.\n *\n * @default true\n */\n shift?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['sameHeight'];\n /**\n * Whether to improve positioning for inline reference elements that span over\n * multiple lines.\n *\n * @default false\n */\n inline?: PopoverPositionerElementProps['inline'];\n /**\n * Whether to hide the floating element when the reference element or the\n * floating element is fully clipped.\n *\n * @default false\n */\n hide?: PopoverPositionerElementProps['hide'];\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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['altBoundary'];\n}\n\nfunction PopoverPositionerComponent(props: PopoverPositionerProps, forwardedRef: ForwardedRef<PopoverPositionerElement>) {\n registerPopoverPositionerElement();\n\n const elementRef = useRef<PopoverPositionerElement>(null);\n\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\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\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 const mergedRef = useCallback(\n (element: PopoverPositionerElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-popover-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-popover-positioner` custom element. */\nexport const PopoverPositioner: ForwardRefExoticComponent<PopoverPositionerProps & HTMLAttributes<PopoverPositionerElement> & RefAttributes<PopoverPositionerElement>> = /* @__PURE__ */ forwardRef(PopoverPositionerComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerPopoverRootElement, type PopoverRootElement, type PopoverRootProps as PopoverRootElementProps, type PopoverRootEvents } from '@prosekit/web/popover';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link PopoverRoot} React component. */\nexport interface PopoverRootProps {\n /**\n * Whether the popover should be modal.\n * When true, the popover will trap focus and prevent interaction with the rest of the page.\n *\n * @default false\n */\n modal?: PopoverRootElementProps['modal'];\n /**\n * Whether the overlay is initially open.\n * @default false\n */\n defaultOpen?: PopoverRootElementProps['defaultOpen'];\n /**\n * Whether the overlay is currently open.\n * @default null\n */\n open?: PopoverRootElementProps['open'];\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: PopoverRootElementProps['disabled'];\n /** Emitted when the popover is opened or closed. */\n onOpenChange?: (event: PopoverRootEvents['openChange']) => void;\n}\n\nfunction PopoverRootComponent(props: PopoverRootProps, forwardedRef: ForwardedRef<PopoverRootElement>) {\n registerPopoverRootElement();\n\n const elementRef = useRef<PopoverRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { defaultOpen: p0, disabled: p1, modal: p2, open: p3, onOpenChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { defaultOpen: p0, disabled: p1, modal: p2, open: p3 });\n handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['openChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: PopoverRootElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-popover-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-popover-root` custom element. */\nexport const PopoverRoot: ForwardRefExoticComponent<PopoverRootProps & HTMLAttributes<PopoverRootElement> & RefAttributes<PopoverRootElement>> = /* @__PURE__ */ forwardRef(PopoverRootComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerPopoverTriggerElement, type PopoverTriggerElement, type PopoverTriggerProps as PopoverTriggerElementProps, type PopoverTriggerEvents } from '@prosekit/web/popover';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link PopoverTrigger} React component. */\nexport interface PopoverTriggerProps {\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: PopoverTriggerElementProps['disabled'];\n /**\n * Whether the popover should also open when the trigger is hovered.\n * @default false\n */\n openOnHover?: PopoverTriggerElementProps['openOnHover'];\n /**\n * The delay in milliseconds before opening the popover when hovering.\n * Only applies when `openOnHover` is true.\n * @default 300\n */\n delay?: PopoverTriggerElementProps['delay'];\n /**\n * The delay in milliseconds before closing the popover when hover ends.\n * Only applies when `openOnHover` is true.\n * @default 0\n */\n closeDelay?: PopoverTriggerElementProps['closeDelay'];\n /** Emitted when the popover is opened or closed. */\n onOpenChange?: (event: PopoverTriggerEvents['openChange']) => void;\n}\n\nfunction PopoverTriggerComponent(props: PopoverTriggerProps, forwardedRef: ForwardedRef<PopoverTriggerElement>) {\n registerPopoverTriggerElement();\n\n const elementRef = useRef<PopoverTriggerElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { closeDelay: p0, delay: p1, disabled: p2, openOnHover: p3, onOpenChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { closeDelay: p0, delay: p1, disabled: p2, openOnHover: p3 });\n handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['openChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: PopoverTriggerElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-popover-trigger', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-popover-trigger` custom element. */\nexport const PopoverTrigger: ForwardRefExoticComponent<PopoverTriggerProps & HTMLAttributes<PopoverTriggerElement> & RefAttributes<PopoverTriggerElement>> = /* @__PURE__ */ forwardRef(PopoverTriggerComponent);\n","/**\n\n@module\n\n## Anatomy\n\n```jsx\nimport {\n PopoverPopup,\n PopoverPositioner,\n PopoverRoot,\n PopoverTrigger,\n} from 'prosekit/react/popover'\n\n<PopoverRoot>\n <PopoverTrigger>...</PopoverTrigger>\n <PopoverPositioner>\n <PopoverPopup>...</PopoverPopup>\n </PopoverPositioner>\n</Popover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MAAM,cAAc,OAAoD,CAAC,CAAC;CAE1E,MAAM,EAAE,YAAY,IAAI,OAAO,IAAI,UAAU,IAAI,aAAa,IAAI,cAAc,IAAI,GAAG,cAAc;CAErG,sBAAsB;EACpB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,OAAO,OAAO,SAAS;GAAE,YAAY;GAAI,OAAO;GAAI,UAAU;GAAI,aAAa;EAAG,CAAC;EACnF,YAAY,UAAU,CAAC,EAAE;CAC3B,CAAC;CAED,sBAAsB;EACpB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,MAAM,KAAK,IAAI,gBAAgB;EAC/B,KAAK,MAAM,CAAC,OAAO,cAAc,CAAC,YAAY,EAAE,QAAQ,GACtD,QAAQ,iBACN,YACC,UAAiB;GAChB,YAAY,QAAQ,SAAS,KAAK;EACpC,GACA,EAAE,QAAQ,GAAG,OAAO,CACtB;EAEF,aAAa,GAAG,MAAM;CACxB,GAAG,CAAC,CAAC;CAEL,MAAM,YAAY,aACf,YAA0C;EACzC,WAAW,UAAU;EACrB,IAAI,OAAO,iBAAiB,YAC1B,aAAa,OAAO;OACf,IAAI,cACT,aAAa,UAAU;CAE3B,GACA,CAAC,YAAY,CACf;CAEA,OAAO,cAAc,4BAA4B;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;CAAK,CAAC;AACnH;;AAGA,MAAa,iBAAgK,2BAAW,uBAAuB"}
1
+ {"version":3,"file":"popover.js","names":[],"sources":["../src/components/popover/popover-popup.gen.ts","../src/components/popover/popover-positioner.gen.ts","../src/components/popover/popover-root.gen.ts","../src/components/popover/popover-trigger.gen.ts","../src/components/popover/index.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerPopoverPopupElement, type PopoverPopupElement } from '@prosekit/web/popover';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from 'react';\n\n/** Props for the {@link PopoverPopup} React component. */\nexport interface PopoverPopupProps {}\n\nfunction PopoverPopupComponent(props: PopoverPopupProps, forwardedRef: ForwardedRef<PopoverPopupElement>) {\n registerPopoverPopupElement();\n\n const elementRef = useRef<PopoverPopupElement>(null);\n\n const { ...restProps } = props;\n\n const mergedRef = useCallback(\n (element: PopoverPopupElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-popover-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-popover-popup` custom element. */\nexport const PopoverPopup: ForwardRefExoticComponent<PopoverPopupProps & HTMLAttributes<PopoverPopupElement> & RefAttributes<PopoverPopupElement>> = /* @__PURE__ */ forwardRef(PopoverPopupComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerPopoverPositionerElement, type PopoverPositionerElement, type PopoverPositionerProps as PopoverPositionerElementProps } from '@prosekit/web/popover';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link PopoverPositioner} React component. */\nexport interface PopoverPositionerProps {\n /**\n * The strategy to use for positioning\n *\n * @default \"absolute\"\n */\n strategy?: PopoverPositionerElementProps['strategy'];\n /**\n * The initial placement of the floating element\n *\n * @default \"top\"\n */\n placement?: PopoverPositionerElementProps['placement'];\n /**\n * Options to activate auto-update listeners\n *\n * @see https://floating-ui.com/docs/autoUpdate\n *\n * @default true\n */\n autoUpdate?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['hoist'];\n /**\n * The distance between the reference and floating element.\n *\n * @default 6\n */\n offset?: PopoverPositionerElementProps['offset'];\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?: PopoverPositionerElementProps['flip'];\n /**\n * Whether the floating element should shift to keep it in view.\n *\n * @default true\n */\n shift?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['sameHeight'];\n /**\n * Whether to improve positioning for inline reference elements that span over\n * multiple lines.\n *\n * @default false\n */\n inline?: PopoverPositionerElementProps['inline'];\n /**\n * Whether to hide the floating element when the reference element or the\n * floating element is fully clipped.\n *\n * @default false\n */\n hide?: PopoverPositionerElementProps['hide'];\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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['altBoundary'];\n}\n\nfunction PopoverPositionerComponent(props: PopoverPositionerProps, forwardedRef: ForwardedRef<PopoverPositionerElement>) {\n registerPopoverPositionerElement();\n\n const elementRef = useRef<PopoverPositionerElement>(null);\n\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\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\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 const mergedRef = useCallback(\n (element: PopoverPositionerElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-popover-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-popover-positioner` custom element. */\nexport const PopoverPositioner: ForwardRefExoticComponent<PopoverPositionerProps & HTMLAttributes<PopoverPositionerElement> & RefAttributes<PopoverPositionerElement>> = /* @__PURE__ */ forwardRef(PopoverPositionerComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerPopoverRootElement, type PopoverRootElement, type PopoverRootProps as PopoverRootElementProps, type PopoverRootEvents } from '@prosekit/web/popover';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link PopoverRoot} React component. */\nexport interface PopoverRootProps {\n /**\n * Whether the popover should be modal.\n * When true, the popover will trap focus and prevent interaction with the rest of the page.\n *\n * @default false\n */\n modal?: PopoverRootElementProps['modal'];\n /**\n * Whether the overlay is initially open.\n * @default false\n */\n defaultOpen?: PopoverRootElementProps['defaultOpen'];\n /**\n * Whether the overlay is currently open.\n * @default null\n */\n open?: PopoverRootElementProps['open'];\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: PopoverRootElementProps['disabled'];\n /** Emitted when the popover is opened or closed. */\n onOpenChange?: (event: PopoverRootEvents['openChange']) => void;\n}\n\nfunction PopoverRootComponent(props: PopoverRootProps, forwardedRef: ForwardedRef<PopoverRootElement>) {\n registerPopoverRootElement();\n\n const elementRef = useRef<PopoverRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { defaultOpen: p0, disabled: p1, modal: p2, open: p3, onOpenChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { defaultOpen: p0, disabled: p1, modal: p2, open: p3 });\n handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['openChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: PopoverRootElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-popover-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-popover-root` custom element. */\nexport const PopoverRoot: ForwardRefExoticComponent<PopoverRootProps & HTMLAttributes<PopoverRootElement> & RefAttributes<PopoverRootElement>> = /* @__PURE__ */ forwardRef(PopoverRootComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerPopoverTriggerElement, type PopoverTriggerElement, type PopoverTriggerProps as PopoverTriggerElementProps, type PopoverTriggerEvents } from '@prosekit/web/popover';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link PopoverTrigger} React component. */\nexport interface PopoverTriggerProps {\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: PopoverTriggerElementProps['disabled'];\n /**\n * Whether the popover should also open when the trigger is hovered.\n * @default false\n */\n openOnHover?: PopoverTriggerElementProps['openOnHover'];\n /**\n * The delay in milliseconds before opening the popover when hovering.\n * Only applies when `openOnHover` is true.\n * @default 300\n */\n delay?: PopoverTriggerElementProps['delay'];\n /**\n * The delay in milliseconds before closing the popover when hover ends.\n * Only applies when `openOnHover` is true.\n * @default 0\n */\n closeDelay?: PopoverTriggerElementProps['closeDelay'];\n /** Emitted when the popover is opened or closed. */\n onOpenChange?: (event: PopoverTriggerEvents['openChange']) => void;\n}\n\nfunction PopoverTriggerComponent(props: PopoverTriggerProps, forwardedRef: ForwardedRef<PopoverTriggerElement>) {\n registerPopoverTriggerElement();\n\n const elementRef = useRef<PopoverTriggerElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { closeDelay: p0, delay: p1, disabled: p2, openOnHover: p3, onOpenChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { closeDelay: p0, delay: p1, disabled: p2, openOnHover: p3 });\n handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['openChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: PopoverTriggerElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-popover-trigger', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-popover-trigger` custom element. */\nexport const PopoverTrigger: ForwardRefExoticComponent<PopoverTriggerProps & HTMLAttributes<PopoverTriggerElement> & RefAttributes<PopoverTriggerElement>> = /* @__PURE__ */ forwardRef(PopoverTriggerComponent);\n","/**\n\n@module\n\n## Anatomy\n\n```jsx\nimport {\n PopoverPopup,\n PopoverPositioner,\n PopoverRoot,\n PopoverTrigger,\n} from 'prosekit/react/popover'\n\n<PopoverRoot>\n <PopoverTrigger>...</PopoverTrigger>\n <PopoverPositioner>\n <PopoverPopup>...</PopoverPopup>\n </PopoverPositioner>\n</PopoverRoot>\n```\n*/\n\n'use client'\n\nexport * from './index.gen.ts'\n"],"mappings":";;;AAQA,SAAS,sBAAsB,OAA0B,cAAiD;CACxG,4BAA4B;CAE5B,MAAM,aAAa,OAA4B,IAAI;CAEnD,MAAM,EAAE,GAAG,cAAc;CAEzB,MAAM,YAAY,aACf,YAAwC;EACvC,WAAW,UAAU;EACrB,IAAI,OAAO,iBAAiB,YAC1B,aAAa,OAAO;OACf,IAAI,cACT,aAAa,UAAU;CAE3B,GACA,CAAC,YAAY,CACf;CAEA,OAAO,cAAc,0BAA0B;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;CAAK,CAAC;AACjH;;AAGA,MAAa,eAAwJ,2BAAW,qBAAqB;ACy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AO,cAAc,CAAC,YAAY,CAAC,CAAC,QAAQ,GACtD,QAAQ,iBACN,YACC,UAAiB;GAChB,YAAY,QAAQ,MAAM,GAAG,KAAK;EACpC,GACA,EAAE,QAAQ,GAAG,OAAO,CACtB;EAEF,aAAa,GAAG,MAAM;CACxB,GAAG,CAAC,CAAC;CAEL,MAAM,YAAY,aACf,YAA0C;EACzC,WAAW,UAAU;EACrB,IAAI,OAAO,iBAAiB,YAC1B,aAAa,OAAO;OACf,IAAI,cACT,aAAa,UAAU;CAE3B,GACA,CAAC,YAAY,CACf;CAEA,OAAO,cAAc,4BAA4B;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;CAAK,CAAC;AACnH;;AAGA,MAAa,iBAAgK,2BAAW,uBAAuB"}
@@ -1 +1 @@
1
- {"version":3,"file":"resizable.js","names":[],"sources":["../src/components/resizable/resizable-root.gen.ts","../src/components/resizable/resizable-handle.gen.ts","../src/components/resizable/index.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerResizableRootElement, type ResizableRootElement, type ResizableRootProps as ResizableRootElementProps, type ResizableRootEvents } from '@prosekit/web/resizable';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link ResizableRoot} React component. */\nexport interface ResizableRootProps {\n /**\n * The width of the resizable element.\n *\n * @default null\n */\n width?: ResizableRootElementProps['width'];\n /**\n * The height of the resizable element.\n *\n * @default null\n */\n height?: ResizableRootElementProps['height'];\n /**\n * The aspect ratio of the resizable element.\n *\n * @default null\n */\n aspectRatio?: ResizableRootElementProps['aspectRatio'];\n /** Emitted when a resize operation starts. */\n onResizeStart?: (event: ResizableRootEvents['resizeStart']) => void;\n /** Emitted when a resize operation ends. */\n onResizeEnd?: (event: ResizableRootEvents['resizeEnd']) => void;\n}\n\nfunction ResizableRootComponent(props: ResizableRootProps, forwardedRef: ForwardedRef<ResizableRootElement>) {\n registerResizableRootElement();\n\n const elementRef = useRef<ResizableRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { aspectRatio: p0, height: p1, width: p2, onResizeEnd: e0, onResizeStart: e1, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { aspectRatio: p0, height: p1, width: p2 });\n handlersRef.current = [e0, e1] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['resizeEnd', 'resizeStart'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: ResizableRootElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-resizable-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-resizable-root` custom element. */\nexport const ResizableRoot: ForwardRefExoticComponent<ResizableRootProps & HTMLAttributes<ResizableRootElement> & RefAttributes<ResizableRootElement>> = /* @__PURE__ */ forwardRef(ResizableRootComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerResizableHandleElement, type ResizableHandleElement, type ResizableHandleProps as ResizableHandleElementProps } from '@prosekit/web/resizable';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link ResizableHandle} React component. */\nexport interface ResizableHandleProps {\n /**\n * The position of the handle.\n *\n * @default \"bottom-right\"\n */\n position?: ResizableHandleElementProps['position'];\n}\n\nfunction ResizableHandleComponent(props: ResizableHandleProps, forwardedRef: ForwardedRef<ResizableHandleElement>) {\n registerResizableHandleElement();\n\n const elementRef = useRef<ResizableHandleElement>(null);\n\n const { position: p0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { position: p0 });\n });\n\n const mergedRef = useCallback(\n (element: ResizableHandleElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-resizable-handle', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-resizable-handle` custom element. */\nexport const ResizableHandle: ForwardRefExoticComponent<ResizableHandleProps & HTMLAttributes<ResizableHandleElement> & RefAttributes<ResizableHandleElement>> = /* @__PURE__ */ forwardRef(ResizableHandleComponent);\n","/**\n\n@module\n\n## Anatomy\n\n```jsx\nimport {\n ResizableHandle,\n ResizableRoot,\n} from 'prosekit/react/resizable'\n\n<ResizableRoot>\n <img src=\"...\" />\n <ResizableHandle>...</ResizableHandle>\n</ResizableRoot>\n```\n*/\n\n'use client'\n\nexport * from './index.gen.ts'\n"],"mappings":";;;AA+BA,SAAS,uBAAuB,OAA2B,cAAkD;CAC3G,6BAA6B;CAE7B,MAAM,aAAa,OAA6B,IAAI;CACpD,MAAM,cAAc,OAAoD,CAAC,CAAC;CAE1E,MAAM,EAAE,aAAa,IAAI,QAAQ,IAAI,OAAO,IAAI,aAAa,IAAI,eAAe,IAAI,GAAG,cAAc;CAErG,sBAAsB;EACpB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,OAAO,OAAO,SAAS;GAAE,aAAa;GAAI,QAAQ;GAAI,OAAO;EAAG,CAAC;EACjE,YAAY,UAAU,CAAC,IAAI,EAAE;CAC/B,CAAC;CAED,sBAAsB;EACpB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,MAAM,KAAK,IAAI,gBAAgB;EAC/B,KAAK,MAAM,CAAC,OAAO,cAAc,CAAC,aAAa,aAAa,EAAE,QAAQ,GACpE,QAAQ,iBACN,YACC,UAAiB;GAChB,YAAY,QAAQ,SAAS,KAAK;EACpC,GACA,EAAE,QAAQ,GAAG,OAAO,CACtB;EAEF,aAAa,GAAG,MAAM;CACxB,GAAG,CAAC,CAAC;CAEL,MAAM,YAAY,aACf,YAAyC;EACxC,WAAW,UAAU;EACrB,IAAI,OAAO,iBAAiB,YAC1B,aAAa,OAAO;OACf,IAAI,cACT,aAAa,UAAU;CAE3B,GACA,CAAC,YAAY,CACf;CAEA,OAAO,cAAc,2BAA2B;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;CAAK,CAAC;AAClH;;AAGA,MAAa,gBAA4J,2BAAW,sBAAsB;AC/D1M,SAAS,yBAAyB,OAA6B,cAAoD;CACjH,+BAA+B;CAE/B,MAAM,aAAa,OAA+B,IAAI;CAEtD,MAAM,EAAE,UAAU,IAAI,GAAG,cAAc;CAEvC,sBAAsB;EACpB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,OAAO,OAAO,SAAS,EAAE,UAAU,GAAG,CAAC;CACzC,CAAC;CAED,MAAM,YAAY,aACf,YAA2C;EAC1C,WAAW,UAAU;EACrB,IAAI,OAAO,iBAAiB,YAC1B,aAAa,OAAO;OACf,IAAI,cACT,aAAa,UAAU;CAE3B,GACA,CAAC,YAAY,CACf;CAEA,OAAO,cAAc,6BAA6B;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;CAAK,CAAC;AACpH;;AAGA,MAAa,kBAAoK,2BAAW,wBAAwB"}
1
+ {"version":3,"file":"resizable.js","names":[],"sources":["../src/components/resizable/resizable-root.gen.ts","../src/components/resizable/resizable-handle.gen.ts","../src/components/resizable/index.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerResizableRootElement, type ResizableRootElement, type ResizableRootProps as ResizableRootElementProps, type ResizableRootEvents } from '@prosekit/web/resizable';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link ResizableRoot} React component. */\nexport interface ResizableRootProps {\n /**\n * The width of the resizable element.\n *\n * @default null\n */\n width?: ResizableRootElementProps['width'];\n /**\n * The height of the resizable element.\n *\n * @default null\n */\n height?: ResizableRootElementProps['height'];\n /**\n * The aspect ratio of the resizable element.\n *\n * @default null\n */\n aspectRatio?: ResizableRootElementProps['aspectRatio'];\n /** Emitted when a resize operation starts. */\n onResizeStart?: (event: ResizableRootEvents['resizeStart']) => void;\n /** Emitted when a resize operation ends. */\n onResizeEnd?: (event: ResizableRootEvents['resizeEnd']) => void;\n}\n\nfunction ResizableRootComponent(props: ResizableRootProps, forwardedRef: ForwardedRef<ResizableRootElement>) {\n registerResizableRootElement();\n\n const elementRef = useRef<ResizableRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { aspectRatio: p0, height: p1, width: p2, onResizeEnd: e0, onResizeStart: e1, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { aspectRatio: p0, height: p1, width: p2 });\n handlersRef.current = [e0, e1] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['resizeEnd', 'resizeStart'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: ResizableRootElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-resizable-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-resizable-root` custom element. */\nexport const ResizableRoot: ForwardRefExoticComponent<ResizableRootProps & HTMLAttributes<ResizableRootElement> & RefAttributes<ResizableRootElement>> = /* @__PURE__ */ forwardRef(ResizableRootComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerResizableHandleElement, type ResizableHandleElement, type ResizableHandleProps as ResizableHandleElementProps } from '@prosekit/web/resizable';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link ResizableHandle} React component. */\nexport interface ResizableHandleProps {\n /**\n * The position of the handle.\n *\n * @default \"bottom-right\"\n */\n position?: ResizableHandleElementProps['position'];\n}\n\nfunction ResizableHandleComponent(props: ResizableHandleProps, forwardedRef: ForwardedRef<ResizableHandleElement>) {\n registerResizableHandleElement();\n\n const elementRef = useRef<ResizableHandleElement>(null);\n\n const { position: p0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { position: p0 });\n });\n\n const mergedRef = useCallback(\n (element: ResizableHandleElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-resizable-handle', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-resizable-handle` custom element. */\nexport const ResizableHandle: ForwardRefExoticComponent<ResizableHandleProps & HTMLAttributes<ResizableHandleElement> & RefAttributes<ResizableHandleElement>> = /* @__PURE__ */ forwardRef(ResizableHandleComponent);\n","/**\n\n@module\n\n## Anatomy\n\n```jsx\nimport {\n ResizableHandle,\n ResizableRoot,\n} from 'prosekit/react/resizable'\n\n<ResizableRoot>\n <img src=\"...\" />\n <ResizableHandle>...</ResizableHandle>\n</ResizableRoot>\n```\n*/\n\n'use client'\n\nexport * from './index.gen.ts'\n"],"mappings":";;;AA+BA,SAAS,uBAAuB,OAA2B,cAAkD;CAC3G,6BAA6B;CAE7B,MAAM,aAAa,OAA6B,IAAI;CACpD,MAAM,cAAc,OAAoD,CAAC,CAAC;CAE1E,MAAM,EAAE,aAAa,IAAI,QAAQ,IAAI,OAAO,IAAI,aAAa,IAAI,eAAe,IAAI,GAAG,cAAc;CAErG,sBAAsB;EACpB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,OAAO,OAAO,SAAS;GAAE,aAAa;GAAI,QAAQ;GAAI,OAAO;EAAG,CAAC;EACjE,YAAY,UAAU,CAAC,IAAI,EAAE;CAC/B,CAAC;CAED,sBAAsB;EACpB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,MAAM,KAAK,IAAI,gBAAgB;EAC/B,KAAK,MAAM,CAAC,OAAO,cAAc,CAAC,aAAa,aAAa,CAAC,CAAC,QAAQ,GACpE,QAAQ,iBACN,YACC,UAAiB;GAChB,YAAY,QAAQ,MAAM,GAAG,KAAK;EACpC,GACA,EAAE,QAAQ,GAAG,OAAO,CACtB;EAEF,aAAa,GAAG,MAAM;CACxB,GAAG,CAAC,CAAC;CAEL,MAAM,YAAY,aACf,YAAyC;EACxC,WAAW,UAAU;EACrB,IAAI,OAAO,iBAAiB,YAC1B,aAAa,OAAO;OACf,IAAI,cACT,aAAa,UAAU;CAE3B,GACA,CAAC,YAAY,CACf;CAEA,OAAO,cAAc,2BAA2B;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;CAAK,CAAC;AAClH;;AAGA,MAAa,gBAA4J,2BAAW,sBAAsB;AC/D1M,SAAS,yBAAyB,OAA6B,cAAoD;CACjH,+BAA+B;CAE/B,MAAM,aAAa,OAA+B,IAAI;CAEtD,MAAM,EAAE,UAAU,IAAI,GAAG,cAAc;CAEvC,sBAAsB;EACpB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,OAAO,OAAO,SAAS,EAAE,UAAU,GAAG,CAAC;CACzC,CAAC;CAED,MAAM,YAAY,aACf,YAA2C;EAC1C,WAAW,UAAU;EACrB,IAAI,OAAO,iBAAiB,YAC1B,aAAa,OAAO;OACf,IAAI,cACT,aAAa,UAAU;CAE3B,GACA,CAAC,YAAY,CACf;CAEA,OAAO,cAAc,6BAA6B;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;CAAK,CAAC;AACpH;;AAGA,MAAa,kBAAoK,2BAAW,wBAAwB"}
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.js","names":[],"sources":["../src/components/tooltip/tooltip-popup.gen.ts","../src/components/tooltip/tooltip-positioner.gen.ts","../src/components/tooltip/tooltip-root.gen.ts","../src/components/tooltip/tooltip-trigger.gen.ts","../src/components/tooltip/index.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerTooltipPopupElement, type TooltipPopupElement } from '@prosekit/web/tooltip';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from 'react';\n\n/** Props for the {@link TooltipPopup} React component. */\nexport interface TooltipPopupProps {}\n\nfunction TooltipPopupComponent(props: TooltipPopupProps, forwardedRef: ForwardedRef<TooltipPopupElement>) {\n registerTooltipPopupElement();\n\n const elementRef = useRef<TooltipPopupElement>(null);\n\n const { ...restProps } = props;\n\n const mergedRef = useCallback(\n (element: TooltipPopupElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-tooltip-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-tooltip-popup` custom element. */\nexport const TooltipPopup: ForwardRefExoticComponent<TooltipPopupProps & HTMLAttributes<TooltipPopupElement> & RefAttributes<TooltipPopupElement>> = /* @__PURE__ */ forwardRef(TooltipPopupComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerTooltipPositionerElement, type TooltipPositionerElement, type TooltipPositionerProps as TooltipPositionerElementProps } from '@prosekit/web/tooltip';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link TooltipPositioner} React component. */\nexport interface TooltipPositionerProps {\n /**\n * The strategy to use for positioning\n *\n * @default \"absolute\"\n */\n strategy?: TooltipPositionerElementProps['strategy'];\n /**\n * The initial placement of the floating element\n *\n * @default \"top\"\n */\n placement?: TooltipPositionerElementProps['placement'];\n /**\n * Options to activate auto-update listeners\n *\n * @see https://floating-ui.com/docs/autoUpdate\n *\n * @default true\n */\n autoUpdate?: TooltipPositionerElementProps['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?: TooltipPositionerElementProps['hoist'];\n /**\n * The distance between the reference and floating element.\n *\n * @default 6\n */\n offset?: TooltipPositionerElementProps['offset'];\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?: TooltipPositionerElementProps['flip'];\n /**\n * Whether the floating element should shift to keep it in view.\n *\n * @default true\n */\n shift?: TooltipPositionerElementProps['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?: TooltipPositionerElementProps['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?: TooltipPositionerElementProps['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?: TooltipPositionerElementProps['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?: TooltipPositionerElementProps['sameHeight'];\n /**\n * Whether to improve positioning for inline reference elements that span over\n * multiple lines.\n *\n * @default false\n */\n inline?: TooltipPositionerElementProps['inline'];\n /**\n * Whether to hide the floating element when the reference element or the\n * floating element is fully clipped.\n *\n * @default false\n */\n hide?: TooltipPositionerElementProps['hide'];\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?: TooltipPositionerElementProps['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?: TooltipPositionerElementProps['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?: TooltipPositionerElementProps['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?: TooltipPositionerElementProps['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?: TooltipPositionerElementProps['altBoundary'];\n}\n\nfunction TooltipPositionerComponent(props: TooltipPositionerProps, forwardedRef: ForwardedRef<TooltipPositionerElement>) {\n registerTooltipPositionerElement();\n\n const elementRef = useRef<TooltipPositionerElement>(null);\n\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\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\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 const mergedRef = useCallback(\n (element: TooltipPositionerElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-tooltip-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-tooltip-positioner` custom element. */\nexport const TooltipPositioner: ForwardRefExoticComponent<TooltipPositionerProps & HTMLAttributes<TooltipPositionerElement> & RefAttributes<TooltipPositionerElement>> = /* @__PURE__ */ forwardRef(TooltipPositionerComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerTooltipRootElement, type TooltipRootElement, type TooltipRootProps as TooltipRootElementProps, type TooltipRootEvents } from '@prosekit/web/tooltip';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link TooltipRoot} React component. */\nexport interface TooltipRootProps {\n /**\n * Whether the overlay is initially open.\n * @default false\n */\n defaultOpen?: TooltipRootElementProps['defaultOpen'];\n /**\n * Whether the overlay is currently open.\n * @default null\n */\n open?: TooltipRootElementProps['open'];\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: TooltipRootElementProps['disabled'];\n /** Emitted when the tooltip is opened or closed. */\n onOpenChange?: (event: TooltipRootEvents['openChange']) => void;\n}\n\nfunction TooltipRootComponent(props: TooltipRootProps, forwardedRef: ForwardedRef<TooltipRootElement>) {\n registerTooltipRootElement();\n\n const elementRef = useRef<TooltipRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { defaultOpen: p0, disabled: p1, open: p2, onOpenChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { defaultOpen: p0, disabled: p1, open: p2 });\n handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['openChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: TooltipRootElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-tooltip-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-tooltip-root` custom element. */\nexport const TooltipRoot: ForwardRefExoticComponent<TooltipRootProps & HTMLAttributes<TooltipRootElement> & RefAttributes<TooltipRootElement>> = /* @__PURE__ */ forwardRef(TooltipRootComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerTooltipTriggerElement, type TooltipTriggerElement, type TooltipTriggerProps as TooltipTriggerElementProps } from '@prosekit/web/tooltip';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link TooltipTrigger} React component. */\nexport interface TooltipTriggerProps {\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: TooltipTriggerElementProps['disabled'];\n /**\n * The delay in milliseconds before opening the tooltip on hover.\n * @default 600\n */\n openDelay?: TooltipTriggerElementProps['openDelay'];\n /**\n * The delay in milliseconds before closing the tooltip when hover/focus ends.\n * @default 0\n */\n closeDelay?: TooltipTriggerElementProps['closeDelay'];\n}\n\nfunction TooltipTriggerComponent(props: TooltipTriggerProps, forwardedRef: ForwardedRef<TooltipTriggerElement>) {\n registerTooltipTriggerElement();\n\n const elementRef = useRef<TooltipTriggerElement>(null);\n\n const { closeDelay: p0, disabled: p1, openDelay: p2, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { closeDelay: p0, disabled: p1, openDelay: p2 });\n });\n\n const mergedRef = useCallback(\n (element: TooltipTriggerElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-tooltip-trigger', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-tooltip-trigger` custom element. */\nexport const TooltipTrigger: ForwardRefExoticComponent<TooltipTriggerProps & HTMLAttributes<TooltipTriggerElement> & RefAttributes<TooltipTriggerElement>> = /* @__PURE__ */ forwardRef(TooltipTriggerComponent);\n","/**\n\n@module\n\n## Anatomy\n\n```jsx\nimport {\n TooltipPopup,\n TooltipPositioner,\n TooltipRoot,\n TooltipTrigger,\n} from 'prosekit/react/tooltip'\n\n<TooltipRoot>\n <TooltipTrigger>...</TooltipTrigger>\n <TooltipPositioner>\n <TooltipPopup>...</TooltipPopup>\n </TooltipPositioner>\n</TooltipRoot>\n```\n*/\n\n'use client'\n\nexport * from './index.gen.ts'\n"],"mappings":";;;AAQA,SAAS,sBAAsB,OAA0B,cAAiD;CACxG,4BAA4B;CAE5B,MAAM,aAAa,OAA4B,IAAI;CAEnD,MAAM,EAAE,GAAG,cAAc;CAEzB,MAAM,YAAY,aACf,YAAwC;EAC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YAA0C;EACzC,WAAW,UAAU;EACrB,IAAI,OAAO,iBAAiB,YAC1B,aAAa,OAAO;OACf,IAAI,cACT,aAAa,UAAU;CAE3B,GACA,CAAC,YAAY,CACf;CAEA,OAAO,cAAc,4BAA4B;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;CAAK,CAAC;AACnH;;AAGA,MAAa,iBAAgK,2BAAW,uBAAuB"}
1
+ {"version":3,"file":"tooltip.js","names":[],"sources":["../src/components/tooltip/tooltip-popup.gen.ts","../src/components/tooltip/tooltip-positioner.gen.ts","../src/components/tooltip/tooltip-root.gen.ts","../src/components/tooltip/tooltip-trigger.gen.ts","../src/components/tooltip/index.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerTooltipPopupElement, type TooltipPopupElement } from '@prosekit/web/tooltip';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from 'react';\n\n/** Props for the {@link TooltipPopup} React component. */\nexport interface TooltipPopupProps {}\n\nfunction TooltipPopupComponent(props: TooltipPopupProps, forwardedRef: ForwardedRef<TooltipPopupElement>) {\n registerTooltipPopupElement();\n\n const elementRef = useRef<TooltipPopupElement>(null);\n\n const { ...restProps } = props;\n\n const mergedRef = useCallback(\n (element: TooltipPopupElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-tooltip-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-tooltip-popup` custom element. */\nexport const TooltipPopup: ForwardRefExoticComponent<TooltipPopupProps & HTMLAttributes<TooltipPopupElement> & RefAttributes<TooltipPopupElement>> = /* @__PURE__ */ forwardRef(TooltipPopupComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerTooltipPositionerElement, type TooltipPositionerElement, type TooltipPositionerProps as TooltipPositionerElementProps } from '@prosekit/web/tooltip';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link TooltipPositioner} React component. */\nexport interface TooltipPositionerProps {\n /**\n * The strategy to use for positioning\n *\n * @default \"absolute\"\n */\n strategy?: TooltipPositionerElementProps['strategy'];\n /**\n * The initial placement of the floating element\n *\n * @default \"top\"\n */\n placement?: TooltipPositionerElementProps['placement'];\n /**\n * Options to activate auto-update listeners\n *\n * @see https://floating-ui.com/docs/autoUpdate\n *\n * @default true\n */\n autoUpdate?: TooltipPositionerElementProps['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?: TooltipPositionerElementProps['hoist'];\n /**\n * The distance between the reference and floating element.\n *\n * @default 6\n */\n offset?: TooltipPositionerElementProps['offset'];\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?: TooltipPositionerElementProps['flip'];\n /**\n * Whether the floating element should shift to keep it in view.\n *\n * @default true\n */\n shift?: TooltipPositionerElementProps['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?: TooltipPositionerElementProps['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?: TooltipPositionerElementProps['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?: TooltipPositionerElementProps['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?: TooltipPositionerElementProps['sameHeight'];\n /**\n * Whether to improve positioning for inline reference elements that span over\n * multiple lines.\n *\n * @default false\n */\n inline?: TooltipPositionerElementProps['inline'];\n /**\n * Whether to hide the floating element when the reference element or the\n * floating element is fully clipped.\n *\n * @default false\n */\n hide?: TooltipPositionerElementProps['hide'];\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?: TooltipPositionerElementProps['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?: TooltipPositionerElementProps['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?: TooltipPositionerElementProps['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?: TooltipPositionerElementProps['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?: TooltipPositionerElementProps['altBoundary'];\n}\n\nfunction TooltipPositionerComponent(props: TooltipPositionerProps, forwardedRef: ForwardedRef<TooltipPositionerElement>) {\n registerTooltipPositionerElement();\n\n const elementRef = useRef<TooltipPositionerElement>(null);\n\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\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\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 const mergedRef = useCallback(\n (element: TooltipPositionerElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-tooltip-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-tooltip-positioner` custom element. */\nexport const TooltipPositioner: ForwardRefExoticComponent<TooltipPositionerProps & HTMLAttributes<TooltipPositionerElement> & RefAttributes<TooltipPositionerElement>> = /* @__PURE__ */ forwardRef(TooltipPositionerComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerTooltipRootElement, type TooltipRootElement, type TooltipRootProps as TooltipRootElementProps, type TooltipRootEvents } from '@prosekit/web/tooltip';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link TooltipRoot} React component. */\nexport interface TooltipRootProps {\n /**\n * Whether the overlay is initially open.\n * @default false\n */\n defaultOpen?: TooltipRootElementProps['defaultOpen'];\n /**\n * Whether the overlay is currently open.\n * @default null\n */\n open?: TooltipRootElementProps['open'];\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: TooltipRootElementProps['disabled'];\n /** Emitted when the tooltip is opened or closed. */\n onOpenChange?: (event: TooltipRootEvents['openChange']) => void;\n}\n\nfunction TooltipRootComponent(props: TooltipRootProps, forwardedRef: ForwardedRef<TooltipRootElement>) {\n registerTooltipRootElement();\n\n const elementRef = useRef<TooltipRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { defaultOpen: p0, disabled: p1, open: p2, onOpenChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { defaultOpen: p0, disabled: p1, open: p2 });\n handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['openChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: TooltipRootElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-tooltip-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-tooltip-root` custom element. */\nexport const TooltipRoot: ForwardRefExoticComponent<TooltipRootProps & HTMLAttributes<TooltipRootElement> & RefAttributes<TooltipRootElement>> = /* @__PURE__ */ forwardRef(TooltipRootComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerTooltipTriggerElement, type TooltipTriggerElement, type TooltipTriggerProps as TooltipTriggerElementProps } from '@prosekit/web/tooltip';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/** Props for the {@link TooltipTrigger} React component. */\nexport interface TooltipTriggerProps {\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: TooltipTriggerElementProps['disabled'];\n /**\n * The delay in milliseconds before opening the tooltip on hover.\n * @default 600\n */\n openDelay?: TooltipTriggerElementProps['openDelay'];\n /**\n * The delay in milliseconds before closing the tooltip when hover/focus ends.\n * @default 0\n */\n closeDelay?: TooltipTriggerElementProps['closeDelay'];\n}\n\nfunction TooltipTriggerComponent(props: TooltipTriggerProps, forwardedRef: ForwardedRef<TooltipTriggerElement>) {\n registerTooltipTriggerElement();\n\n const elementRef = useRef<TooltipTriggerElement>(null);\n\n const { closeDelay: p0, disabled: p1, openDelay: p2, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { closeDelay: p0, disabled: p1, openDelay: p2 });\n });\n\n const mergedRef = useCallback(\n (element: TooltipTriggerElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-tooltip-trigger', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-tooltip-trigger` custom element. */\nexport const TooltipTrigger: ForwardRefExoticComponent<TooltipTriggerProps & HTMLAttributes<TooltipTriggerElement> & RefAttributes<TooltipTriggerElement>> = /* @__PURE__ */ forwardRef(TooltipTriggerComponent);\n","/**\n\n@module\n\n## Anatomy\n\n```jsx\nimport {\n TooltipPopup,\n TooltipPositioner,\n TooltipRoot,\n TooltipTrigger,\n} from 'prosekit/react/tooltip'\n\n<TooltipRoot>\n <TooltipTrigger>...</TooltipTrigger>\n <TooltipPositioner>\n <TooltipPopup>...</TooltipPopup>\n </TooltipPositioner>\n</TooltipRoot>\n```\n*/\n\n'use client'\n\nexport * from './index.gen.ts'\n"],"mappings":";;;AAQA,SAAS,sBAAsB,OAA0B,cAAiD;CACxG,4BAA4B;CAE5B,MAAM,aAAa,OAA4B,IAAI;CAEnD,MAAM,EAAE,GAAG,cAAc;CAEzB,MAAM,YAAY,aACf,YAAwC;EACvC,WAAW,UAAU;EACrB,IAAI,OAAO,iBAAiB,YAC1B,aAAa,OAAO;OACf,IAAI,cACT,aAAa,UAAU;CAE3B,GACA,CAAC,YAAY,CACf;CAEA,OAAO,cAAc,0BAA0B;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;CAAK,CA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AAW,0BAA0B;CAAK,CAAC;AACnH;;AAGA,MAAa,iBAAgK,2BAAW,uBAAuB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prosekit/react",
3
3
  "type": "module",
4
- "version": "0.8.0-beta.10",
4
+ "version": "0.8.0-beta.12",
5
5
  "private": false,
6
6
  "description": "React components and utilities for ProseKit",
7
7
  "author": {
@@ -75,8 +75,8 @@
75
75
  "@prosemirror-adapter/core": "^0.5.3",
76
76
  "@prosemirror-adapter/react": "^0.5.3",
77
77
  "@prosekit/core": "^0.13.0-beta.3",
78
- "@prosekit/pm": "^0.1.19-beta.0",
79
- "@prosekit/web": "^0.9.0-beta.10"
78
+ "@prosekit/web": "^0.9.0-beta.12",
79
+ "@prosekit/pm": "^0.1.19-beta.0"
80
80
  },
81
81
  "peerDependencies": {
82
82
  "react": ">= 18.2.0",
@@ -100,9 +100,9 @@
100
100
  "vitest": "^4.1.8",
101
101
  "vitest-browser-react": "^2.2.0",
102
102
  "@prosekit/config-ts": "0.0.0",
103
- "@prosekit/config-tsdown": "0.0.0",
103
+ "@prosekit/testing": "0.0.0",
104
104
  "@prosekit/config-vitest": "0.0.0",
105
- "@prosekit/testing": "0.0.0"
105
+ "@prosekit/config-tsdown": "0.0.0"
106
106
  },
107
107
  "scripts": {
108
108
  "build:tsc": "tsc -b tsconfig.json",