@prosekit/web
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -97,3 +97,2 @@ import { | ||
createSignal, | ||
mapSignals, | ||
useEffect as useEffect2 | ||
@@ -108,20 +107,23 @@ } from "@aria-ui/core"; | ||
function useAutocompleteList(element, props) { | ||
const state = mapSignals(assignProps(defaultAutocompleteListProps, props)); | ||
const fullProps = assignProps(defaultAutocompleteListProps, props); | ||
const editor = createSignal(fullProps.editor); | ||
const open = openContext.consume(element); | ||
const query = queryContext.consume(element); | ||
const onSubmit = onSubmitContext.consume(element); | ||
const onKeydownHandlerAdd = useKeyboardHandler(element, open, state.editor); | ||
const onKeydownHandlerAdd = useKeyboardHandler(element, open, editor); | ||
const onValueChange = (value) => { | ||
var _a; | ||
if (value) { | ||
(_a = onSubmit.peek()) == null ? void 0 : _a(); | ||
} | ||
}; | ||
const { | ||
query: listboxQuery, | ||
value: listboxValue, | ||
filter, | ||
autoFocus | ||
} = useListbox(element, { | ||
onKeydownHandlerAdd, | ||
// This function will be called before `onSubmit()`. | ||
onValueChange: (value) => { | ||
var _a; | ||
if (value) { | ||
(_a = onSubmit.value) == null ? void 0 : _a.call(onSubmit); | ||
} | ||
} | ||
onValueChange, | ||
filter: fullProps.filter | ||
}); | ||
@@ -157,3 +159,3 @@ useEffect2(element, () => { | ||
}); | ||
return state; | ||
return { editor, filter }; | ||
} | ||
@@ -232,3 +234,3 @@ function useKeyboardHandler(element, open, editor) { | ||
createSignal as createSignal2, | ||
mapSignals as mapSignals2, | ||
mapSignals, | ||
useEffect as useEffect3 | ||
@@ -250,3 +252,3 @@ } from "@aria-ui/core"; | ||
function useAutocompletePopover(host, props) { | ||
const state = mapSignals2(assignProps2(defaultAutocompletePopoverProps, props)); | ||
const state = mapSignals(assignProps2(defaultAutocompletePopoverProps, props)); | ||
useAutocompletePopoverState(host, state); | ||
@@ -253,0 +255,0 @@ return state; |
{ | ||
"name": "@prosekit/web", | ||
"type": "module", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"private": false, | ||
@@ -6,0 +6,0 @@ "author": { |
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
66169
1794