@prosekit/preact 0.8.0-beta.19 → 0.8.0-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/autocomplete.d.ts +8 -0
- package/dist/autocomplete.d.ts.map +1 -1
- package/dist/autocomplete.js +4 -3
- package/dist/autocomplete.js.map +1 -1
- package/dist/block-handle.d.ts.map +1 -1
- package/dist/drop-indicator.d.ts.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/inline-popover.d.ts.map +1 -1
- package/dist/menu.d.ts.map +1 -1
- package/dist/popover.d.ts.map +1 -1
- package/dist/resizable.d.ts.map +1 -1
- package/dist/table-handle.d.ts.map +1 -1
- package/dist/tooltip.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/components/autocomplete/autocomplete-root.gen.ts +10 -2
- package/src/extensions/preact-node-view.spec.ts +4 -4
package/dist/autocomplete.d.ts
CHANGED
|
@@ -189,6 +189,14 @@ interface AutocompleteRootProps {
|
|
|
189
189
|
* @default null
|
|
190
190
|
*/
|
|
191
191
|
anchor?: AutocompleteRootProps$1['anchor'];
|
|
192
|
+
/**
|
|
193
|
+
* Whether the autocomplete match should follow the text cursor when it
|
|
194
|
+
* moves without editing, growing and shrinking the query as the cursor
|
|
195
|
+
* moves over existing text (for example with arrow keys).
|
|
196
|
+
*
|
|
197
|
+
* @default false
|
|
198
|
+
*/
|
|
199
|
+
followCursor?: AutocompleteRootProps$1['followCursor'];
|
|
192
200
|
/** Fired when the open state changes. */
|
|
193
201
|
onOpenChange?: (event: AutocompleteRootEvents['openChange']) => void;
|
|
194
202
|
/** Fired when the query changes. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.d.ts","names":[],"sources":["../src/components/autocomplete/autocomplete-empty.gen.ts","../src/components/autocomplete/autocomplete-item.gen.ts","../src/components/autocomplete/autocomplete-popup.gen.ts","../src/components/autocomplete/autocomplete-positioner.gen.ts","../src/components/autocomplete/autocomplete-root.gen.ts"],"mappings":";;;;UAQiB
|
|
1
|
+
{"version":3,"file":"autocomplete.d.ts","names":[],"sources":["../src/components/autocomplete/autocomplete-empty.gen.ts","../src/components/autocomplete/autocomplete-item.gen.ts","../src/components/autocomplete/autocomplete-popup.gen.ts","../src/components/autocomplete/autocomplete-positioner.gen.ts","../src/components/autocomplete/autocomplete-root.gen.ts"],"mappings":";;;;UAQiB;;cAyBJ,mBAAmB,0BAA0B,yBAAyB,eAAe,4BAA4B,cAAc;;UCzB3H;;;;;;;;EAQf,QAAQ;;;;;;EAMR,WAAW;;EAEX,YAAY,OAAO;;;cAkDR,kBAAkB,0BAA0B,wBAAwB,KAAK,eAAe,wCAAwC,cAAc;;UClE1I;;;;;EAKf,iBAAiB,OAAO;;;;;EAKxB,kBAAkB,OAAO;;;cAiDd,mBAAmB,0BAA0B,yBAAyB,eAAe,4BAA4B,cAAc;;UC3D3H;;;;;;EAMf,YAAY;;;;;;EAMZ,SAAS;;;;;;;EAOT,OAAO;;EAEP,SAAS;;EAET,QAAQ;;EAER,cAAc;;EAEd,WAAW;;EAEX,kBAAkB;;;;;;EAMlB,WAAW;;;;;;;;EAQX,aAAa;;;;;;;;;EASb,OAAO;;;;;;EAMP,QAAQ;;;;;;;EAOR,UAAU;;;;;;;EAOV,YAAY;;;;;;;EAOZ,aAAa;;;;;;;EAOb,eAAe;;;;;;;;EAQf,iBAAiB;;;;;;;;EAQjB,cAAc;;;cAgCH,wBAAwB,0BAA0B,8BAA8B,eAAe,iCAAiC,cAAc;;UCpI1I;;;;;;;EAOf,SAAS;;;;;;EAMT,QAAQ;;;;;;;EAOR,SAAS;;;;;;;;;;EAUT,eAAe;;;;;;;;;EASf,SAAS;;;;;;;;EAQT,eAAe;;EAEf,gBAAgB,OAAO;;EAEvB,iBAAiB,OAAO;;;;;EAKxB,iBAAiB,OAAO;;;;;EAKxB,kBAAkB,OAAO;;;cAoDd,kBAAkB,0BAA0B,wBAAwB,eAAe,2BAA2B,cAAc"}
|
package/dist/autocomplete.js
CHANGED
|
@@ -133,7 +133,7 @@ function AutocompleteRootComponent(props, forwardedRef) {
|
|
|
133
133
|
const elementRef = useRef(null);
|
|
134
134
|
const handlersRef = useRef([]);
|
|
135
135
|
const p1Fallback = useEditorContext();
|
|
136
|
-
const { anchor: p0, editor: p1, filter: p2,
|
|
136
|
+
const { anchor: p0, editor: p1, filter: p2, followCursor: p3, queryBuilder: p4, regex: p5, onOpenChange: e0, onQueryChange: e1, onValueChange: e2, onValuesChange: e3, ...restProps } = props;
|
|
137
137
|
useLayoutEffect(() => {
|
|
138
138
|
const element = elementRef.current;
|
|
139
139
|
if (!element) return;
|
|
@@ -141,8 +141,9 @@ function AutocompleteRootComponent(props, forwardedRef) {
|
|
|
141
141
|
anchor: p0,
|
|
142
142
|
editor: p1 ?? p1Fallback,
|
|
143
143
|
filter: p2,
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
followCursor: p3,
|
|
145
|
+
queryBuilder: p4,
|
|
146
|
+
regex: p5
|
|
146
147
|
});
|
|
147
148
|
handlersRef.current = [
|
|
148
149
|
e0,
|
package/dist/autocomplete.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.js","names":[],"sources":["../src/components/autocomplete/autocomplete-empty.gen.ts","../src/components/autocomplete/autocomplete-item.gen.ts","../src/components/autocomplete/autocomplete-popup.gen.ts","../src/components/autocomplete/autocomplete-positioner.gen.ts","../src/components/autocomplete/autocomplete-root.gen.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerAutocompleteEmptyElement, type AutocompleteEmptyElement } from '@prosekit/web/autocomplete';\nimport { createElement, type HTMLAttributes, type Ref } from 'preact';\nimport { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';\nimport { useCallback, useRef } from 'preact/hooks';\n\n/** Props for the {@link AutocompleteEmpty} Preact component. */\nexport interface AutocompleteEmptyProps {}\n\nfunction AutocompleteEmptyComponent(props: AutocompleteEmptyProps, forwardedRef: Ref<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 Preact 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, type HTMLAttributes, type Ref } from 'preact';\nimport { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';\nimport { useCallback, useRef, useLayoutEffect } from 'preact/hooks';\n\n/** Props for the {@link AutocompleteItem} Preact 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: Ref<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 Preact 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, type HTMLAttributes, type Ref } from 'preact';\nimport { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';\nimport { useCallback, useRef, useLayoutEffect } from 'preact/hooks';\n\n/** Props for the {@link AutocompletePopup} Preact 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: Ref<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 Preact 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, type HTMLAttributes, type Ref } from 'preact';\nimport { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';\nimport { useCallback, useRef, useLayoutEffect } from 'preact/hooks';\n\n/** Props for the {@link AutocompletePositioner} Preact 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: Ref<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 Preact 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, type HTMLAttributes, type Ref } from 'preact';\nimport { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';\nimport { useCallback, useRef, useLayoutEffect } from 'preact/hooks';\n\nimport { useEditorContext } from '../../contexts/editor-context.ts';\n\n/** Props for the {@link AutocompleteRoot} Preact 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 * Builds the query string from the regex match found before the cursor. The\n * query is exposed via the `queryChange` event and used by the built-in item\n * filter. The default builder lowercases the match and strips punctuation.\n * Provide a custom builder to control the query, for example to preserve the\n * casing and punctuation the user typed.\n *\n * @default defaultQueryBuilder\n */\n queryBuilder?: AutocompleteRootElementProps['queryBuilder'];\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: Ref<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, queryBuilder: p3, regex: p4, 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, queryBuilder: p3, regex: p4 });\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 Preact component that renders an `prosekit-autocomplete-root` custom element. */\nexport const AutocompleteRoot: ForwardRefExoticComponent<AutocompleteRootProps & HTMLAttributes<AutocompleteRootElement> & RefAttributes<AutocompleteRootElement>> = /* @__PURE__ */ forwardRef(AutocompleteRootComponent);\n"],"mappings":";;;;;AAUA,SAAS,2BAA2B,OAA+B,cAA6C;CAC9G,iCAAiC;CAEjC,MAAM,aAAa,OAAiC,IAAI;CAExD,MAAM,EAAE,GAAG,cAAc;CAEzB,MAAM,YAAY,aAC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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
|
+
{"version":3,"file":"autocomplete.js","names":[],"sources":["../src/components/autocomplete/autocomplete-empty.gen.ts","../src/components/autocomplete/autocomplete-item.gen.ts","../src/components/autocomplete/autocomplete-popup.gen.ts","../src/components/autocomplete/autocomplete-positioner.gen.ts","../src/components/autocomplete/autocomplete-root.gen.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerAutocompleteEmptyElement, type AutocompleteEmptyElement } from '@prosekit/web/autocomplete';\nimport { createElement, type HTMLAttributes, type Ref } from 'preact';\nimport { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';\nimport { useCallback, useRef } from 'preact/hooks';\n\n/** Props for the {@link AutocompleteEmpty} Preact component. */\nexport interface AutocompleteEmptyProps {}\n\nfunction AutocompleteEmptyComponent(props: AutocompleteEmptyProps, forwardedRef: Ref<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 Preact 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, type HTMLAttributes, type Ref } from 'preact';\nimport { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';\nimport { useCallback, useRef, useLayoutEffect } from 'preact/hooks';\n\n/** Props for the {@link AutocompleteItem} Preact 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: Ref<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 Preact 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, type HTMLAttributes, type Ref } from 'preact';\nimport { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';\nimport { useCallback, useRef, useLayoutEffect } from 'preact/hooks';\n\n/** Props for the {@link AutocompletePopup} Preact 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: Ref<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 Preact 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, type HTMLAttributes, type Ref } from 'preact';\nimport { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';\nimport { useCallback, useRef, useLayoutEffect } from 'preact/hooks';\n\n/** Props for the {@link AutocompletePositioner} Preact 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: Ref<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 Preact 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, type HTMLAttributes, type Ref } from 'preact';\nimport { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';\nimport { useCallback, useRef, useLayoutEffect } from 'preact/hooks';\n\nimport { useEditorContext } from '../../contexts/editor-context.ts';\n\n/** Props for the {@link AutocompleteRoot} Preact 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 * Builds the query string from the regex match found before the cursor. The\n * query is exposed via the `queryChange` event and used by the built-in item\n * filter. The default builder lowercases the match and strips punctuation.\n * Provide a custom builder to control the query, for example to preserve the\n * casing and punctuation the user typed.\n *\n * @default defaultQueryBuilder\n */\n queryBuilder?: AutocompleteRootElementProps['queryBuilder'];\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 /**\n * Whether the autocomplete match should follow the text cursor when it\n * moves without editing, growing and shrinking the query as the cursor\n * moves over existing text (for example with arrow keys).\n *\n * @default false\n */\n followCursor?: AutocompleteRootElementProps['followCursor'];\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: Ref<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, followCursor: p3, queryBuilder: p4, regex: p5, 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, followCursor: p3, queryBuilder: p4, regex: p5 });\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 Preact component that renders an `prosekit-autocomplete-root` custom element. */\nexport const AutocompleteRoot: ForwardRefExoticComponent<AutocompleteRootProps & HTMLAttributes<AutocompleteRootElement> & RefAttributes<AutocompleteRootElement>> = /* @__PURE__ */ forwardRef(AutocompleteRootComponent);\n"],"mappings":";;;;;AAUA,SAAS,2BAA2B,OAA+B,cAA6C;CAC9G,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,O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E,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.d.ts","names":[],"sources":["../src/components/block-handle/block-handle-add.gen.ts","../src/components/block-handle/block-handle-draggable.gen.ts","../src/components/block-handle/block-handle-popup.gen.ts","../src/components/block-handle/block-handle-positioner.gen.ts","../src/components/block-handle/block-handle-root.gen.ts"],"mappings":";;;;UAUiB,
|
|
1
|
+
{"version":3,"file":"block-handle.d.ts","names":[],"sources":["../src/components/block-handle/block-handle-add.gen.ts","../src/components/block-handle/block-handle-draggable.gen.ts","../src/components/block-handle/block-handle-popup.gen.ts","../src/components/block-handle/block-handle-positioner.gen.ts","../src/components/block-handle/block-handle-root.gen.ts"],"mappings":";;;;UAUiB;;;;;;;EAOf,SAAS;;;cAkCE,gBAAgB,0BAA0B,sBAAsB,eAAe,yBAAyB,cAAc;;UCzClH;;;;;;;EAOf,SAAS;;;cAkCE,sBAAsB,0BAA0B,4BAA4B,eAAe,+BAA+B,cAAc;;UC3CpI;;cAyBJ,kBAAkB,0BAA0B,wBAAwB,eAAe,2BAA2B,cAAc;;UCzBxH;;;;;;EAMf,YAAY;;;;;;;EAOZ,QAAQ;;;;;EAKR,OAAO;;;;;EAKP,QAAQ;;;;;EAKR,OAAO;;;;;;EAMP,WAAW;;;;;;;;EAQX,aAAa;;;;;;EAMb,SAAS;;;;;;;EAOT,UAAU;;;;;;;EAOV,cAAc;;;;;;;EAOd,YAAY;;;;;;;EAOZ,aAAa;;;;;;;EAOb,SAAS;;;;;;;EAOT,WAAW;;;;;;;EAOX,eAAe;;;;;;;EAOf,kBAAkB;;;;;;;;EAQlB,iBAAiB;;;;;;;;EAQjB,cAAc;;;cAgCH,uBAAuB,0BAA0B,6BAA6B,eAAe,gCAAgC,cAAc;;UCtJvI;;;;;;;EAOf,SAAS;;EAET,iBAAiB,OAAO;;;cAoDb,iBAAiB,0BAA0B,uBAAuB,eAAe,0BAA0B,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drop-indicator.d.ts","names":[],"sources":["../src/components/drop-indicator/drop-indicator.gen.ts"],"mappings":";;;;UAUiB,
|
|
1
|
+
{"version":3,"file":"drop-indicator.d.ts","names":[],"sources":["../src/components/drop-indicator/drop-indicator.gen.ts"],"mappings":";;;;UAUiB;;;;;;;EAOf,SAAS;;;;;;EAMT,QAAQ;;;cAkCG,eAAe,0BAA0B,qBAAqB,eAAe,wBAAwB,cAAc"}
|
package/dist/index.d.ts
CHANGED
|
@@ -61,7 +61,6 @@ declare function useExtension(
|
|
|
61
61
|
* The extension to add to the editor. If it changes, the previous
|
|
62
62
|
* extension will be removed and the new one (if not null) will be added.
|
|
63
63
|
*/
|
|
64
|
-
|
|
65
64
|
extension: Extension | null, options?: UseExtensionOptions): void;
|
|
66
65
|
/**
|
|
67
66
|
* Calls the given handler whenever the editor document changes.
|
|
@@ -92,7 +91,6 @@ declare function useEditorDerivedValue<E extends Extension, Derived>(
|
|
|
92
91
|
*
|
|
93
92
|
* This function should be memoized.
|
|
94
93
|
*/
|
|
95
|
-
|
|
96
94
|
derive: (editor: Editor<E>) => Derived, options?: UseEditorDerivedOptions<E>): Derived;
|
|
97
95
|
/**
|
|
98
96
|
* Retrieves the editor instance from the nearest ProseKit component.
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/components/prosekit.ts","../src/extensions/preact-mark-view.ts","../src/extensions/preact-node-view.ts","../src/hooks/use-extension.ts","../src/hooks/use-doc-change.ts","../src/hooks/use-editor-derived-value.ts","../src/hooks/use-editor.ts","../src/hooks/use-keymap.ts","../src/hooks/use-state-update.ts","../src/types.ts"],"mappings":";;;;;;UAOiB
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/components/prosekit.ts","../src/extensions/preact-mark-view.ts","../src/extensions/preact-node-view.ts","../src/hooks/use-extension.ts","../src/hooks/use-doc-change.ts","../src/hooks/use-editor-derived-value.ts","../src/hooks/use-editor.ts","../src/hooks/use-keymap.ts","../src/hooks/use-state-update.ts","../src/types.ts"],"mappings":";;;;;;UAOiB;EACf,QAAQ;EACR,WAAW;;;;;cAMA,UAAU,cAAc;UCJpB,4BAA4B;KAEjC,0BAA0B,cAAc;;;;UAKnC,8BAA8B,wBAAwB;;;;EAIrE;;;;;iBA+Bc,qBAAqB,SAAS,wBAAwB;UC1CrD,4BAA4B;KAEjC,0BAA0B,cAAc;;;;UAKnC,8BAA8B,wBAAwB;;;;EAIrE;;;;;iBA+Bc,qBAAqB,SAAS,wBAAwB;UC9CrD;;;;;EAKf,SAAS;;;;EAKT,WAAW;;;;;iBAMG,aAKd;;;;;AAAA,WAAW,kBACX,UAAU;;;;iBCnBI,aACd,UAAU,KAAK,0BACf,UAAU;UCNK,wBAAwB,UAAU;;;;;EAKjD,SAAS,OAAO;;;;;;;;;;;iBAYF,sBAAsB,UAAU,WAAW,SASzD;;;;;;;;;AAAA,SAAS,QAAQ,OAAO,OAAO,SAC/B,UAAU,wBAAwB,KACjC;;;;iBC1Ba,UAAU,UAAU,iBAAiB;;;;;;;EAOnD;IACE,OAAO;iBCXK,UAAU,QAAQ,QAAQ,UAAU;;;;iBCKpC,eACd,UAAU,OAAO,sBACjB,UAAU;;;;KCPA,eAAe,eAAe;EACxC;EACA;;;;;KAMU,kBAAkB,eAAe;EAC3C,WAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-popover.d.ts","names":[],"sources":["../src/components/inline-popover/inline-popover-popup.gen.ts","../src/components/inline-popover/inline-popover-positioner.gen.ts","../src/components/inline-popover/inline-popover-root.gen.ts"],"mappings":";;;;UAQiB
|
|
1
|
+
{"version":3,"file":"inline-popover.d.ts","names":[],"sources":["../src/components/inline-popover/inline-popover-popup.gen.ts","../src/components/inline-popover/inline-popover-positioner.gen.ts","../src/components/inline-popover/inline-popover-root.gen.ts"],"mappings":";;;;UAQiB;;cAyBJ,oBAAoB,0BAA0B,0BAA0B,eAAe,6BAA6B,cAAc;;UCzB9H;;;;;;EAMf,YAAY;;;;;;EAMZ,SAAS;;;;;;;EAOT,OAAO;;;;;;;EAOP,QAAQ;;;;;;;EAOR,UAAU;;;;;;;EAOV,SAAS;;;;;;EAMT,kBAAkB;;;;;;EAMlB,WAAW;;;;;;;;EAQX,aAAa;;;;;;;;;EASb,OAAO;;;;;;EAMP,QAAQ;;;;;;;EAOR,cAAc;;;;;;;EAOd,YAAY;;;;;;;EAOZ,aAAa;;;;;;;EAOb,WAAW;;;;;;;EAOX,eAAe;;;;;;;;EAQf,iBAAiB;;;;;;;;EAQjB,cAAc;;;cAgCH,yBAAyB,0BAA0B,+BAA+B,eAAe,kCAAkC,cAAc;;UC5J7I;;;;;;;EAOf,SAAS;;;;;;;EAOT,cAAc;;;;;;;EAOd,kBAAkB;;;;;;;;;;;EAWlB,SAAS;;;;;EAKT,OAAO;;;;;EAKP,WAAW;;EAEX,gBAAgB,OAAO;;;cAoDZ,mBAAmB,0BAA0B,yBAAyB,eAAe,4BAA4B,cAAc"}
|
package/dist/menu.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.d.ts","names":[],"sources":["../src/components/menu/menu-item.gen.ts","../src/components/menu/menu-popup.gen.ts","../src/components/menu/menu-positioner.gen.ts","../src/components/menu/menu-root.gen.ts","../src/components/menu/menu-submenu-root.gen.ts","../src/components/menu/menu-submenu-trigger.gen.ts","../src/components/menu/menu-trigger.gen.ts"],"mappings":";;;;UAQiB,
|
|
1
|
+
{"version":3,"file":"menu.d.ts","names":[],"sources":["../src/components/menu/menu-item.gen.ts","../src/components/menu/menu-popup.gen.ts","../src/components/menu/menu-positioner.gen.ts","../src/components/menu/menu-root.gen.ts","../src/components/menu/menu-submenu-root.gen.ts","../src/components/menu/menu-submenu-trigger.gen.ts","../src/components/menu/menu-trigger.gen.ts"],"mappings":";;;;UAQiB;;;;;;EAMf,QAAQ;;;;;;EAMR,WAAW;;;;;;EAMX,gBAAgB;;EAEhB,YAAY,OAAO;;;cAkDR,UAAU,0BAA0B,gBAAgB,KAAK,eAAe,gCAAgC,cAAc;;UCtElH;;;;;;;EAOf,cAAc;;;cAgCH,WAAW,0BAA0B,iBAAiB,eAAe,oBAAoB,cAAc;;UCvCnG;;;;;;EAMf,YAAY;;;;;;EAMZ,WAAW;;;;;;;;EAQX,aAAa;;;;;;;EAOb,QAAQ;;;;;;EAMR,SAAS;;;;;;;;;EAST,OAAO;;;;;;EAMP,QAAQ;;;;;;;EAOR,UAAU;;;;;;;EAOV,cAAc;;;;;;;EAOd,YAAY;;;;;;;EAOZ,aAAa;;;;;;;EAOb,SAAS;;;;;;;EAOT,OAAO;;;;;;;EAOP,WAAW;;;;;;;EAOX,eAAe;;;;;;;EAOf,kBAAkB;;;;;;;;EAQlB,iBAAiB;;;;;;;;EAQjB,cAAc;;;cAgCH,gBAAgB,0BAA0B,sBAAsB,eAAe,yBAAyB,cAAc;;UC/JlH;;;;;EAKf,cAAc;;;;;EAKd,OAAO;;;;;EAKP,WAAW;;EAEX,gBAAgB,OAAO;;;cAkDZ,UAAU,0BAA0B,gBAAgB,eAAe,mBAAmB,cAAc;;UCnEhG;;;;;EAKf,cAAc;;;;;EAKd,OAAO;;;;;EAKP,WAAW;;EAEX,gBAAgB,OAAO;;;cAkDZ,iBAAiB,0BAA0B,uBAAuB,eAAe,0BAA0B,cAAc;;UCnErH;;;;;;EAMf,QAAQ;;;;;;EAMR,WAAW;;;cAgCA,oBAAoB,0BAA0B,0BAA0B,eAAe,6BAA6B,cAAc;;UC5C9H;;;;;;EAMf,WAAW;;EAEX,gBAAgB,OAAO;;;cAkDZ,aAAa,0BAA0B,mBAAmB,eAAe,sBAAsB,cAAc"}
|
package/dist/popover.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.ts","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"],"mappings":";;;;UAQiB
|
|
1
|
+
{"version":3,"file":"popover.d.ts","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"],"mappings":";;;;UAQiB;;cAyBJ,cAAc,0BAA0B,oBAAoB,eAAe,uBAAuB,cAAc;;UCzB5G;;;;;;EAMf,WAAW;;;;;;EAMX,YAAY;;;;;;;;EAQZ,aAAa;;;;;;;EAOb,QAAQ;;;;;;EAMR,SAAS;;;;;;;;;EAST,OAAO;;;;;;EAMP,QAAQ;;;;;;;EAOR,UAAU;;;;;;;EAOV,cAAc;;;;;;;EAOd,YAAY;;;;;;;EAOZ,aAAa;;;;;;;EAOb,SAAS;;;;;;;EAOT,OAAO;;;;;;;EAOP,WAAW;;;;;;;EAOX,eAAe;;;;;;;EAOf,kBAAkB;;;;;;;;EAQlB,iBAAiB;;;;;;;;EAQjB,cAAc;;;cAgCH,mBAAmB,0BAA0B,yBAAyB,eAAe,4BAA4B,cAAc;;UC/J3H;;;;;;;EAOf,QAAQ;;;;;EAKR,cAAc;;;;;EAKd,OAAO;;;;;EAKP,WAAW;;EAEX,gBAAgB,OAAO;;;cAkDZ,aAAa,0BAA0B,mBAAmB,eAAe,sBAAsB,cAAc;;UC1EzG;;;;;EAKf,WAAW;;;;;EAKX,cAAc;;;;;;EAMd,QAAQ;;;;;;EAMR,aAAa;;EAEb,gBAAgB,OAAO;;;cAkDZ,gBAAgB,0BAA0B,sBAAsB,eAAe,yBAAyB,cAAc"}
|
package/dist/resizable.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resizable.d.ts","names":[],"sources":["../src/components/resizable/resizable-root.gen.ts","../src/components/resizable/resizable-handle.gen.ts"],"mappings":";;;;UAQiB,
|
|
1
|
+
{"version":3,"file":"resizable.d.ts","names":[],"sources":["../src/components/resizable/resizable-root.gen.ts","../src/components/resizable/resizable-handle.gen.ts"],"mappings":";;;;UAQiB;;;;;;EAMf,QAAQ;;;;;;EAMR,SAAS;;;;;;EAMT,cAAc;;EAEd,iBAAiB,OAAO;;EAExB,eAAe,OAAO;;;cAkDX,eAAe,0BAA0B,qBAAqB,eAAe,wBAAwB,cAAc;;UCxE/G;;;;;;EAMf,WAAW;;;cAgCA,iBAAiB,0BAA0B,uBAAuB,eAAe,0BAA0B,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-handle.d.ts","names":[],"sources":["../src/components/table-handle/table-handle-column-popup.gen.ts","../src/components/table-handle/table-handle-column-positioner.gen.ts","../src/components/table-handle/table-handle-column-menu-root.gen.ts","../src/components/table-handle/table-handle-column-menu-trigger.gen.ts","../src/components/table-handle/table-handle-drag-preview.gen.ts","../src/components/table-handle/table-handle-drop-indicator.gen.ts","../src/components/table-handle/table-handle-root.gen.ts","../src/components/table-handle/table-handle-row-popup.gen.ts","../src/components/table-handle/table-handle-row-positioner.gen.ts","../src/components/table-handle/table-handle-row-menu-root.gen.ts","../src/components/table-handle/table-handle-row-menu-trigger.gen.ts"],"mappings":";;;;UAQiB
|
|
1
|
+
{"version":3,"file":"table-handle.d.ts","names":[],"sources":["../src/components/table-handle/table-handle-column-popup.gen.ts","../src/components/table-handle/table-handle-column-positioner.gen.ts","../src/components/table-handle/table-handle-column-menu-root.gen.ts","../src/components/table-handle/table-handle-column-menu-trigger.gen.ts","../src/components/table-handle/table-handle-drag-preview.gen.ts","../src/components/table-handle/table-handle-drop-indicator.gen.ts","../src/components/table-handle/table-handle-root.gen.ts","../src/components/table-handle/table-handle-row-popup.gen.ts","../src/components/table-handle/table-handle-row-positioner.gen.ts","../src/components/table-handle/table-handle-row-menu-root.gen.ts","../src/components/table-handle/table-handle-row-menu-trigger.gen.ts"],"mappings":";;;;UAQiB;;cAyBJ,wBAAwB,0BAA0B,8BAA8B,eAAe,iCAAiC,cAAc;;UCvB1I;;;;;;EAMf,YAAY;;;;;;EAMZ,WAAW;;;;;;;;EAQX,aAAa;;;;;;;EAOb,QAAQ;;;;;EAKR,SAAS;;;;;EAKT,OAAO;;;;;EAKP,QAAQ;;;;;;;EAOR,UAAU;;;;;;;EAOV,cAAc;;;;;;;EAOd,YAAY;;;;;;;EAOZ,aAAa;;;;;;;EAOb,SAAS;;;;;EAKT,OAAO;;;;;;;EAOP,WAAW;;;;;;;EAOX,eAAe;;;;;;;EAOf,kBAAkB;;;;;;;;EAQlB,iBAAiB;;;;;;;;EAQjB,cAAc;;;;;;;EAOd,SAAS;;;cAsDE,6BAA6B,0BAA0B,mCAAmC,eAAe,sCAAsC,cAAc;;UCtLzJ;;;;;EAKf,cAAc;;;;;EAKd,OAAO;;;;;EAKP,WAAW;;;cAgCA,2BAA2B,0BAA0B,iCAAiC,eAAe,oCAAoC,cAAc;;UC7CnJ;;;;;EAKf,SAAS;;;cAkCE,8BAA8B,0BAA0B,oCAAoC,eAAe,uCAAuC,cAAc;;UCvC5J;;;;;EAKf,SAAS;;;cAkCE,wBAAwB,0BAA0B,8BAA8B,eAAe,iCAAiC,cAAc;;UCvC1I;;;;;EAKf,SAAS;;;cAkCE,0BAA0B,0BAA0B,gCAAgC,eAAe,mCAAmC,cAAc;;UCvChJ;;;;;;;EAOf,SAAS;;;cAkCE,iBAAiB,0BAA0B,uBAAuB,eAAe,0BAA0B,cAAc;;UC3CrH;;cAyBJ,qBAAqB,0BAA0B,2BAA2B,eAAe,8BAA8B,cAAc;;UCvBjI;;;;;;EAMf,YAAY;;;;;;EAMZ,WAAW;;;;;;;;EAQX,aAAa;;;;;;;EAOb,QAAQ;;;;;EAKR,SAAS;;;;;EAKT,OAAO;;;;;EAKP,QAAQ;;;;;;;EAOR,UAAU;;;;;;;EAOV,cAAc;;;;;;;EAOd,YAAY;;;;;;;EAOZ,aAAa;;;;;;;EAOb,SAAS;;;;;EAKT,OAAO;;;;;;;EAOP,WAAW;;;;;;;EAOX,eAAe;;;;;;;EAOf,kBAAkB;;;;;;;;EAQlB,iBAAiB;;;;;;;;EAQjB,cAAc;;;;;;;EAOd,SAAS;;;cAsDE,0BAA0B,0BAA0B,gCAAgC,eAAe,mCAAmC,cAAc;;UCtLhJ;;;;;EAKf,cAAc;;;;;EAKd,OAAO;;;;;EAKP,WAAW;;;cAgCA,wBAAwB,0BAA0B,8BAA8B,eAAe,iCAAiC,cAAc;;UC7C1I;;;;;EAKf,SAAS;;;cAkCE,2BAA2B,0BAA0B,iCAAiC,eAAe,oCAAoC,cAAc"}
|
package/dist/tooltip.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","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"],"mappings":";;;;UAQiB
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","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"],"mappings":";;;;UAQiB;;cAyBJ,cAAc,0BAA0B,oBAAoB,eAAe,uBAAuB,cAAc;;UCzB5G;;;;;;EAMf,WAAW;;;;;;EAMX,YAAY;;;;;;;;EAQZ,aAAa;;;;;;;EAOb,QAAQ;;;;;;EAMR,SAAS;;;;;;;;;EAST,OAAO;;;;;;EAMP,QAAQ;;;;;;;EAOR,UAAU;;;;;;;EAOV,cAAc;;;;;;;EAOd,YAAY;;;;;;;EAOZ,aAAa;;;;;;;EAOb,SAAS;;;;;;;EAOT,OAAO;;;;;;;EAOP,WAAW;;;;;;;EAOX,eAAe;;;;;;;EAOf,kBAAkB;;;;;;;;EAQlB,iBAAiB;;;;;;;;EAQjB,cAAc;;;cAgCH,mBAAmB,0BAA0B,yBAAyB,eAAe,4BAA4B,cAAc;;UC/J3H;;;;;EAKf,cAAc;;;;;EAKd,OAAO;;;;;EAKP,WAAW;;EAEX,gBAAgB,OAAO;;;cAkDZ,aAAa,0BAA0B,mBAAmB,eAAe,sBAAsB,cAAc;;UCnEzG;;;;;EAKf,WAAW;;;;;EAKX,YAAY;;;;;EAKZ,aAAa;;;cAgCF,gBAAgB,0BAA0B,sBAAsB,eAAe,yBAAyB,cAAc"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosekit/preact",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.8.0-beta.
|
|
4
|
+
"version": "0.8.0-beta.20",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Preact components and utilities for ProseKit",
|
|
7
7
|
"author": {
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"dependencies": {
|
|
75
75
|
"@prosemirror-adapter/core": "^0.5.3",
|
|
76
76
|
"@prosemirror-adapter/preact": "^0.5.3",
|
|
77
|
-
"@prosekit/pm": "^0.1.19-beta.2",
|
|
78
77
|
"@prosekit/core": "^0.13.0-beta.5",
|
|
79
|
-
"@prosekit/web": "^0.9.0-beta.
|
|
78
|
+
"@prosekit/web": "^0.9.0-beta.20",
|
|
79
|
+
"@prosekit/pm": "^0.1.19-beta.2"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"preact": ">= 10.11.0"
|
|
@@ -87,15 +87,15 @@
|
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
|
-
"preact": "^10.29.
|
|
91
|
-
"tsdown": "^0.22.
|
|
90
|
+
"preact": "^10.29.7",
|
|
91
|
+
"tsdown": "^0.22.4",
|
|
92
92
|
"typescript": "~6.0.3",
|
|
93
|
-
"vitest": "^4.1.
|
|
93
|
+
"vitest": "^4.1.10",
|
|
94
94
|
"vitest-browser-preact": "^1.0.0",
|
|
95
95
|
"@prosekit/config-ts": "0.0.0",
|
|
96
96
|
"@prosekit/config-tsdown": "0.0.0",
|
|
97
|
-
"@prosekit/
|
|
98
|
-
"@prosekit/
|
|
97
|
+
"@prosekit/config-vitest": "0.0.0",
|
|
98
|
+
"@prosekit/testing": "0.0.0"
|
|
99
99
|
},
|
|
100
100
|
"scripts": {
|
|
101
101
|
"build:tsc": "tsc -b tsconfig.json",
|
|
@@ -48,6 +48,14 @@ export interface AutocompleteRootProps {
|
|
|
48
48
|
* @default null
|
|
49
49
|
*/
|
|
50
50
|
anchor?: AutocompleteRootElementProps['anchor'];
|
|
51
|
+
/**
|
|
52
|
+
* Whether the autocomplete match should follow the text cursor when it
|
|
53
|
+
* moves without editing, growing and shrinking the query as the cursor
|
|
54
|
+
* moves over existing text (for example with arrow keys).
|
|
55
|
+
*
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
followCursor?: AutocompleteRootElementProps['followCursor'];
|
|
51
59
|
/** Fired when the open state changes. */
|
|
52
60
|
onOpenChange?: (event: AutocompleteRootEvents['openChange']) => void;
|
|
53
61
|
/** Fired when the query changes. */
|
|
@@ -72,12 +80,12 @@ function AutocompleteRootComponent(props: AutocompleteRootProps, forwardedRef: R
|
|
|
72
80
|
|
|
73
81
|
const p1Fallback = useEditorContext();
|
|
74
82
|
|
|
75
|
-
const { anchor: p0, editor: p1, filter: p2,
|
|
83
|
+
const { anchor: p0, editor: p1, filter: p2, followCursor: p3, queryBuilder: p4, regex: p5, onOpenChange: e0, onQueryChange: e1, onValueChange: e2, onValuesChange: e3, ...restProps } = props;
|
|
76
84
|
|
|
77
85
|
useLayoutEffect(() => {
|
|
78
86
|
const element = elementRef.current as Record<string, unknown> | null;
|
|
79
87
|
if (!element) return;
|
|
80
|
-
Object.assign(element, { anchor: p0, editor: p1 ?? p1Fallback, filter: p2,
|
|
88
|
+
Object.assign(element, { anchor: p0, editor: p1 ?? p1Fallback, filter: p2, followCursor: p3, queryBuilder: p4, regex: p5 });
|
|
81
89
|
handlersRef.current = [e0, e1, e2, e3] as Array<((event: Event) => void) | undefined>;
|
|
82
90
|
});
|
|
83
91
|
|
|
@@ -97,12 +97,12 @@ describe('PreactNodeView', () => {
|
|
|
97
97
|
|
|
98
98
|
const urls = new Set<string>()
|
|
99
99
|
const check = () => {
|
|
100
|
-
imageRefresh.elements()
|
|
100
|
+
for (const element of imageRefresh.elements()) {
|
|
101
101
|
const url = element.getAttribute('data-url')
|
|
102
102
|
if (url) {
|
|
103
103
|
urls.add(url)
|
|
104
104
|
}
|
|
105
|
-
}
|
|
105
|
+
}
|
|
106
106
|
return urls.size >= 5
|
|
107
107
|
}
|
|
108
108
|
|
|
@@ -129,12 +129,12 @@ describe('PreactNodeView', () => {
|
|
|
129
129
|
|
|
130
130
|
const urls = new Set<string>()
|
|
131
131
|
const check = () => {
|
|
132
|
-
imageRefresh.elements()
|
|
132
|
+
for (const element of imageRefresh.elements()) {
|
|
133
133
|
const url = element.getAttribute('data-url')
|
|
134
134
|
if (url) {
|
|
135
135
|
urls.add(url)
|
|
136
136
|
}
|
|
137
|
-
}
|
|
137
|
+
}
|
|
138
138
|
return urls.size >= 15
|
|
139
139
|
}
|
|
140
140
|
|