Natural Language Sync Widget #256
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TLDR
Adds natural language search widget for automatic UI state synchronization and proper module exports for widgets.
Change summary
Added Features:
New Widget in
src/widgets/naturalLanguageSync.js:connectNaturalLanguageSync(): Connector function that handles natural language UI state synchronization logicnaturalLanguageSync(): Headless widget that automatically applies natural language search results to InstantSearch UI stateWidget Export System:
widgets.js: Main export file for all widgets at package rootsrc/widgets/index.js: Internal widget aggregation filesrc/TypesenseInstantsearchAdapter.jsto re-export widgets for easy accessCode Changes:
In
package.json:/widgetsentry pointwidgets.jsandwidgets.d.ts^2.1.0-8to^2.1.0-13In
src/widgets/index.d.ts:NaturalLanguageUiState,NaturalLanguageSearchResults, and widget parameter typesTest Coverage:
test/natural_language_search.test.js:Documentation and Examples:
In
test/support/testground/natural_language_search.html:In
test/support/testground/src/natural_language_search.js:Build System Updates:
test/support/testground/package.json:The natural language search widget automatically detects when search results contain parsed natural language data and applies the corresponding UI state changes to InstantSearch widgets without requiring manual intervention from developers.