@prosekit/web
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -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 @@ |
@@ -134,2 +134,3 @@ import { | ||
listboxValue.value = ""; | ||
query.value = ""; | ||
} | ||
@@ -231,5 +232,5 @@ }); | ||
createComputed, | ||
createSignal as createSignal2, | ||
createSignal as createSignal3, | ||
mapSignals, | ||
useEffect as useEffect3 | ||
useEffect as useEffect4 | ||
} from "@aria-ui/core"; | ||
@@ -243,2 +244,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 +273,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,10 +294,11 @@ queryContext.provide(host, query); | ||
usePresence(host, presence); | ||
useEffect3(host, () => { | ||
const firstRendering = useFirstRendering(host); | ||
useEffect4(host, () => { | ||
var _a; | ||
const queryValue = query.value; | ||
if (presence.peek()) { | ||
if (!firstRendering.peek()) { | ||
(_a = state.onQueryChange.peek()) == null ? void 0 : _a(queryValue); | ||
} | ||
}); | ||
useEffect3(host, () => { | ||
useEffect4(host, () => { | ||
var _a; | ||
@@ -293,3 +310,3 @@ const presenceValue = presence.value; | ||
function useAutocompleteExtension(host, editor, regex, reference, query, onDismiss, onSubmit) { | ||
useEffect3(host, () => { | ||
useEffect4(host, () => { | ||
const editorValue = editor.value; | ||
@@ -347,3 +364,3 @@ const regexValue = regex.value; | ||
function useEscapeKeydown(host, handler) { | ||
useEffect3(host, () => { | ||
useEffect4(host, () => { | ||
const handleKeyDown = (event) => { | ||
@@ -350,0 +367,0 @@ if (event.key !== "Escape") { |
{ | ||
"name": "@prosekit/web", | ||
"type": "module", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"private": false, | ||
@@ -77,5 +77,5 @@ "author": { | ||
"@prosekit/core": "^0.4.0", | ||
"@prosekit/extensions": "^0.4.2", | ||
"@prosekit/extensions": "^0.4.6", | ||
"@prosekit/pm": "^0.1.2", | ||
"@zag-js/dom-query": "^0.47.0" | ||
"@zag-js/dom-query": "^0.48.0" | ||
}, | ||
@@ -86,3 +86,3 @@ "devDependencies": { | ||
"typescript": "^5.4.5", | ||
"vitest": "^1.5.0" | ||
"vitest": "^1.5.2" | ||
}, | ||
@@ -89,0 +89,0 @@ "scripts": { |
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
66695
1811
+ Added@shikijs/core@1.24.4(transitive)
+ Added@shikijs/engine-javascript@1.24.4(transitive)
+ Added@shikijs/engine-oniguruma@1.24.4(transitive)
+ Added@shikijs/types@1.24.4(transitive)
+ Added@zag-js/dom-query@0.48.0(transitive)
+ Addedoniguruma-to-es@0.8.1(transitive)
+ Addedshiki@1.24.4(transitive)
- Removed@shikijs/core@1.24.3(transitive)
- Removed@shikijs/engine-javascript@1.24.3(transitive)
- Removed@shikijs/engine-oniguruma@1.24.3(transitive)
- Removed@shikijs/types@1.24.3(transitive)
- Removed@zag-js/dom-query@0.47.0(transitive)
- Removedoniguruma-to-es@0.8.0(transitive)
- Removedshiki@1.24.3(transitive)
Updated@prosekit/extensions@^0.4.6
Updated@zag-js/dom-query@^0.48.0