@prosekit/web
Advanced tools
Comparing version 0.0.0-next-20240429132423 to 0.0.0-next-20240429132915
@@ -661,2 +661,4 @@ import { BaseElement } from '@aria-ui/core'; | ||
export declare function useFirstRendering(host: ConnectableElement): ReadonlySignal<boolean>; | ||
export declare function useInlinePopover(host: ConnectableElement, props?: Partial<InlinePopoverProps>): SignalState<Readonly<InlinePopoverProps>>; | ||
@@ -663,0 +665,0 @@ |
@@ -231,5 +231,5 @@ import { | ||
createComputed, | ||
createSignal as createSignal2, | ||
createSignal as createSignal3, | ||
mapSignals, | ||
useEffect as useEffect3 | ||
useEffect as useEffect4 | ||
} from "@aria-ui/core"; | ||
@@ -243,2 +243,17 @@ import { useOverlayPositionerState } from "@aria-ui/overlay"; | ||
// src/hooks/use-first-rendering.ts | ||
import { | ||
createSignal as createSignal2, | ||
useEffect as useEffect3 | ||
} from "@aria-ui/core"; | ||
function useFirstRendering(host) { | ||
const firstRendering = createSignal2(true); | ||
useEffect3(host, () => { | ||
requestAnimationFrame(() => { | ||
firstRendering.value = false; | ||
}); | ||
}); | ||
return firstRendering; | ||
} | ||
// src/components/autocomplete/autocomplete-popover/helpers.ts | ||
@@ -257,6 +272,6 @@ function defaultQueryBuilder(match) { | ||
const { editor, regex, ...overlayState } = state; | ||
const reference = createSignal2(null); | ||
const query = createSignal2(""); | ||
const onDismiss = createSignal2(null); | ||
const onSubmit = createSignal2(null); | ||
const reference = createSignal3(null); | ||
const query = createSignal3(""); | ||
const onDismiss = createSignal3(null); | ||
const onSubmit = createSignal3(null); | ||
const presence = createComputed(() => !!reference.value); | ||
@@ -278,12 +293,11 @@ queryContext.provide(host, query); | ||
usePresence(host, presence); | ||
let firstRender = true; | ||
useEffect3(host, () => { | ||
const firstRendering = useFirstRendering(host); | ||
useEffect4(host, () => { | ||
var _a; | ||
const queryValue = query.value; | ||
if (!firstRender) { | ||
if (!firstRendering.peek()) { | ||
(_a = state.onQueryChange.peek()) == null ? void 0 : _a(queryValue); | ||
} | ||
firstRender = false; | ||
}); | ||
useEffect3(host, () => { | ||
useEffect4(host, () => { | ||
var _a; | ||
@@ -295,3 +309,3 @@ const presenceValue = presence.value; | ||
function useAutocompleteExtension(host, editor, regex, reference, query, onDismiss, onSubmit) { | ||
useEffect3(host, () => { | ||
useEffect4(host, () => { | ||
const editorValue = editor.value; | ||
@@ -349,3 +363,3 @@ const regexValue = regex.value; | ||
function useEscapeKeydown(host, handler) { | ||
useEffect3(host, () => { | ||
useEffect4(host, () => { | ||
const handleKeyDown = (event) => { | ||
@@ -352,0 +366,0 @@ if (event.key !== "Escape") { |
{ | ||
"name": "@prosekit/web", | ||
"type": "module", | ||
"version": "0.0.0-next-20240429132423", | ||
"version": "0.0.0-next-20240429132915", | ||
"private": false, | ||
@@ -76,5 +76,5 @@ "author": { | ||
"@floating-ui/dom": "^1.6.3", | ||
"@prosekit/core": "0.0.0-next-20240429132423", | ||
"@prosekit/extensions": "0.0.0-next-20240429132423", | ||
"@prosekit/pm": "0.0.0-next-20240429132423", | ||
"@prosekit/core": "0.0.0-next-20240429132915", | ||
"@prosekit/extensions": "0.0.0-next-20240429132915", | ||
"@prosekit/pm": "0.0.0-next-20240429132915", | ||
"@zag-js/dom-query": "^0.48.0" | ||
@@ -81,0 +81,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
66772
1811
+ Added@prosekit/core@0.0.0-next-20240429132915(transitive)
+ Added@prosekit/extensions@0.0.0-next-20240429132915(transitive)
+ Added@prosekit/pm@0.0.0-next-20240429132915(transitive)
- Removed@prosekit/core@0.0.0-next-20240429132423(transitive)
- Removed@prosekit/extensions@0.0.0-next-20240429132423(transitive)
- Removed@prosekit/pm@0.0.0-next-20240429132423(transitive)