pixelize-design-library 2.4.2-beta.64 → 2.4.2-beta.66
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/CHANGELOG.md +520 -21
- package/COMPONENT-GOTCHAS.md +187 -95
- package/DESIGN-GUIDE.md +54 -10
- package/README.md +37 -3
- package/dist/Components/Accordion/Accordion.js +11 -8
- package/dist/Components/Accordion/AccordionProps.d.ts +4 -0
- package/dist/Components/Accordion/accordionColors.js +1 -2
- package/dist/Components/Apexcharts/ApexLineChart/ApexLineChart.js +1 -0
- package/dist/Components/Apexcharts/ApexLineChart/ApexLineChartProps.d.ts +2 -2
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChart.d.ts +1 -1
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChart.js +6 -5
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChartProps.d.ts +3 -1
- package/dist/Components/Apexcharts/ApexPieChart/pieImageTexture.d.ts +2 -0
- package/dist/Components/Apexcharts/ApexPieChart/pieImageTexture.js +13 -0
- package/dist/Components/AppSwitcher/AppSwitcher.js +6 -3
- package/dist/Components/AppSwitcher/AppSwitcherProps.d.ts +3 -1
- package/dist/Components/AppSwitcher/AppSwitcherProps.js +18 -11
- package/dist/Components/AppSwitcher/pixelizeSuite.d.ts +24 -0
- package/dist/Components/AppSwitcher/pixelizeSuite.js +71 -0
- package/dist/Components/AppearanceSettings/AppearanceSettings.js +3 -3
- package/dist/Components/AppearanceSettings/AppearanceSettingsProps.d.ts +2 -2
- package/dist/Components/Avatar/avatarColorway.d.ts +2 -2
- package/dist/Components/Avatar/avatarColorway.js +7 -6
- package/dist/Components/Breadcrumbs/BreadcrumbsProps.d.ts +1 -1
- package/dist/Components/Button/Button.styles.js +5 -2
- package/dist/Components/Button/ButtonProps.d.ts +2 -4
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +3 -1
- package/dist/Components/CalendarGrid/CalendarGrid.js +5 -3
- package/dist/Components/CalendarGrid/CalendarGridProps.d.ts +1 -1
- package/dist/Components/Card/Card.d.ts +1 -0
- package/dist/Components/Card/Card.js +1 -0
- package/dist/Components/Checkbox/Checkbox.styles.js +3 -1
- package/dist/Components/CheckoutKit/selectable.d.ts +3 -1
- package/dist/Components/CheckoutKit/selectable.js +10 -7
- package/dist/Components/CheckoutKit/tonalHover.d.ts +2 -0
- package/dist/Components/CheckoutKit/tonalHover.js +6 -0
- package/dist/Components/ChoiceCard/ChoiceCard.d.ts +1 -1
- package/dist/Components/ChoiceCard/ChoiceCard.js +2 -1
- package/dist/Components/ChoiceCard/ChoiceCardProps.d.ts +6 -0
- package/dist/Components/Common/FieldMessage.d.ts +1 -0
- package/dist/Components/Common/FormLabel.d.ts +1 -1
- package/dist/Components/Common/FormLabel.js +4 -3
- package/dist/Components/Common/HelperText.d.ts +2 -2
- package/dist/Components/Common/HelperText.js +1 -2
- package/dist/Components/Common/activationKey.d.ts +5 -0
- package/dist/Components/Common/activationKey.js +12 -0
- package/dist/Components/Common/dataAttributes.d.ts +4 -0
- package/dist/Components/Common/fieldMessageStyles.js +2 -1
- package/dist/Components/Common/findSlot.d.ts +2 -0
- package/dist/Components/Common/findSlot.js +24 -0
- package/dist/Components/Common/surfaceFocusRing.d.ts +1 -0
- package/dist/Components/Common/surfaceFocusRing.js +7 -0
- package/dist/Components/ConfirmDialog/ConfirmDialog.js +17 -5
- package/dist/Components/ConfirmDialog/ConfirmDialogProps.d.ts +38 -10
- package/dist/Components/CopyButton/CopyButton.d.ts +4 -1
- package/dist/Components/CopyButton/CopyButton.js +5 -8
- package/dist/Components/CouponField/CouponField.js +5 -2
- package/dist/Components/CustomModulesTable/CustomModulesTable.js +3 -1
- package/dist/Components/DatePicker/CalendarPanel.d.ts +1 -0
- package/dist/Components/DatePicker/CalendarPanel.js +3 -1
- package/dist/Components/DatePicker/DatePicker.js +24 -26
- package/dist/Components/DatePicker/DatePickerProps.d.ts +8 -0
- package/dist/Components/DatePicker/PickerPortal.js +1 -1
- package/dist/Components/DatePicker/RangeDatePicker.d.ts +7 -0
- package/dist/Components/DatePicker/RangeDatePicker.js +10 -29
- package/dist/Components/DatePicker/SingleDatePicker.js +5 -21
- package/dist/Components/DatePicker/TimeOnlyPicker.js +2 -20
- package/dist/Components/DescriptionList/DescriptionList.js +1 -1
- package/dist/Components/DetailSections/DetailSections.js +2 -1
- package/dist/Components/Divider/Divider.d.ts +3 -3
- package/dist/Components/Divider/Divider.js +3 -3
- package/dist/Components/Drawer/Drawer.d.ts +3 -1
- package/dist/Components/Drawer/Drawer.js +28 -26
- package/dist/Components/Drawer/DrawerProps.d.ts +4 -0
- package/dist/Components/Dropdown/DropDown.js +6 -21
- package/dist/Components/Editor/Editor.js +6 -2
- package/dist/Components/Editor/EditorProps.d.ts +17 -1
- package/dist/Components/Editor/editorLabels.js +1 -0
- package/dist/Components/Editor/editorTokenStyles.d.ts +8 -0
- package/dist/Components/Editor/editorTokenStyles.js +9 -1
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.d.ts +1 -1
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +9 -2
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtpProps.d.ts +15 -1
- package/dist/Components/EmptyState/EmptyStateProps.d.ts +21 -0
- package/dist/Components/EmptyState/FilteredEmptyState.d.ts +5 -0
- package/dist/Components/EmptyState/FilteredEmptyState.js +23 -0
- package/dist/Components/FieldSelectModal/FieldSelectModal.d.ts +1 -0
- package/dist/Components/FilePreview/FilePreview.js +7 -3
- package/dist/Components/FilePreview/FilePreviewProps.d.ts +2 -1
- package/dist/Components/FileUpload/FileUpload.js +8 -9
- package/dist/Components/FileUpload/FileUploadProps.d.ts +2 -2
- package/dist/Components/FileUploader/FileUploader.js +5 -6
- package/dist/Components/FilterSidebar/FilterSidebar.d.ts +7 -9
- package/dist/Components/FilterSidebar/FilterSidebar.js +90 -233
- package/dist/Components/FilterSidebar/OptionsSection.d.ts +14 -0
- package/dist/Components/FilterSidebar/OptionsSection.js +46 -0
- package/dist/Components/FilterSidebar/RangeSection.d.ts +17 -0
- package/dist/Components/FilterSidebar/RangeSection.js +80 -0
- package/dist/Components/FilterSidebar/SectionHeader.d.ts +13 -0
- package/dist/Components/FilterSidebar/SectionHeader.js +29 -0
- package/dist/Components/FilterSidebar/useStableCallback.d.ts +1 -0
- package/dist/Components/FilterSidebar/useStableCallback.js +12 -0
- package/dist/Components/Form/FormWrapper.d.ts +7 -7
- package/dist/Components/Form/FormWrapper.js +5 -3
- package/dist/Components/FormDrawer/FormDrawer.d.ts +1 -1
- package/dist/Components/FormDrawer/FormDrawer.js +3 -3
- package/dist/Components/FormDrawer/FormDrawerProps.d.ts +2 -0
- package/dist/Components/FormField/FormField.js +1 -1
- package/dist/Components/Header/Header.js +1 -1
- package/dist/Components/Header/HeaderActions.js +4 -2
- package/dist/Components/IconButton/IconButtonProps.d.ts +2 -1
- package/dist/Components/Input/TextInput.js +2 -2
- package/dist/Components/Input/TextInputProps.d.ts +3 -1
- package/dist/Components/KanbanBoard/AccountCard.js +1 -1
- package/dist/Components/KanbanBoard/KanbanBoard.d.ts +1 -1
- package/dist/Components/KanbanBoard/KanbanBoard.js +11 -7
- package/dist/Components/LauncherTrigger/LauncherTrigger.js +1 -1
- package/dist/Components/LazyWrapper/LazyWrapper.d.ts +2 -1
- package/dist/Components/LazyWrapper/LazyWrapper.js +1 -1
- package/dist/Components/MediaViewer/MediaViewer.js +4 -3
- package/dist/Components/MediaViewer/components/MediaAudioPlayer.js +5 -1
- package/dist/Components/MediaViewer/components/MediaImageViewer.js +19 -8
- package/dist/Components/MediaViewer/components/MediaScrubber.js +7 -2
- package/dist/Components/MediaViewer/components/MediaVideoPlayer.js +3 -1
- package/dist/Components/MediaViewer/components/ViewerIconButton.js +3 -1
- package/dist/Components/MediaViewer/hooks/useFileViewer.d.ts +1 -0
- package/dist/Components/MediaViewer/mediaItems.d.ts +1 -0
- package/dist/Components/MediaViewer/mediaItems.js +5 -0
- package/dist/Components/Modal/Modal.d.ts +1 -0
- package/dist/Components/Modal/Modal.js +7 -25
- package/dist/Components/Modal/dialogNaming.d.ts +8 -0
- package/dist/Components/Modal/dialogNaming.js +21 -0
- package/dist/Components/Modal/warnDroppedSlotChildren.d.ts +1 -1
- package/dist/Components/Modal/warnDroppedSlotChildren.js +7 -3
- package/dist/Components/NavLauncher/LauncherTabs.js +4 -3
- package/dist/Components/NavLauncher/NavLauncher.d.ts +1 -1
- package/dist/Components/NavLauncher/NavLauncher.js +288 -56
- package/dist/Components/NavLauncher/NavLauncherProps.d.ts +83 -5
- package/dist/Components/NavLauncher/ScopeBar.d.ts +14 -0
- package/dist/Components/NavLauncher/ScopeBar.js +139 -0
- package/dist/Components/NavLauncher/engine/distance.d.ts +4 -0
- package/dist/Components/NavLauncher/engine/distance.js +41 -0
- package/dist/Components/NavLauncher/engine/engine.d.ts +84 -0
- package/dist/Components/NavLauncher/engine/engine.js +472 -0
- package/dist/Components/NavLauncher/engine/fold.d.ts +15 -0
- package/dist/Components/NavLauncher/engine/fold.js +84 -0
- package/dist/Components/NavLauncher/engine/index.d.ts +21 -0
- package/dist/Components/NavLauncher/engine/index.js +17 -0
- package/dist/Components/NavLauncher/launcherParts.d.ts +14 -0
- package/dist/Components/NavLauncher/launcherParts.js +51 -13
- package/dist/Components/NavLauncher/match.d.ts +13 -2
- package/dist/Components/NavLauncher/match.js +26 -12
- package/dist/Components/NavLauncher/searchLayout.d.ts +61 -0
- package/dist/Components/NavLauncher/searchLayout.js +110 -0
- package/dist/Components/NavLauncher/spotlight.d.ts +39 -0
- package/dist/Components/NavLauncher/spotlight.js +202 -0
- package/dist/Components/NavLauncher/spotlightParts.d.ts +53 -0
- package/dist/Components/NavLauncher/spotlightParts.js +121 -0
- package/dist/Components/NavLauncher/useCopiedFlash.d.ts +6 -0
- package/dist/Components/NavLauncher/useCopiedFlash.js +21 -0
- package/dist/Components/NavigationBar/NavigationBar.js +6 -5
- package/dist/Components/NoteTextArea/NoteTextArea.js +12 -17
- package/dist/Components/NoteTextArea/NoteTextAreaProps.d.ts +5 -3
- package/dist/Components/Notification/Notification.js +19 -21
- package/dist/Components/Notification/NotificationProps.d.ts +1 -1
- package/dist/Components/NotificationBell/notificationHelpers.d.ts +16 -1
- package/dist/Components/NotificationBell/notificationHelpers.js +13 -7
- package/dist/Components/OffersList/OffersList.js +4 -2
- package/dist/Components/OptionChip/OptionChip.js +3 -2
- package/dist/Components/OptionChip/optionInk.js +4 -2
- package/dist/Components/OrderStatusTimeline/OrderStatusTimeline.js +2 -1
- package/dist/Components/OrgSwitcher/OrgSwitcher.js +13 -6
- package/dist/Components/OrgSwitcher/OrgSwitcherProps.d.ts +1 -1
- package/dist/Components/OrganizationDetails/OrganizationDetails.js +4 -7
- package/dist/Components/OrganizationDetails/OrganizationDetailsProps.d.ts +4 -2
- package/dist/Components/PdfViewer/PdfViewer.d.ts +1 -0
- package/dist/Components/PlanBadge/PlanBadgeProps.d.ts +1 -1
- package/dist/Components/PlanPill/PlanPill.js +4 -2
- package/dist/Components/PlanPill/PlanPillProps.d.ts +1 -1
- package/dist/Components/ProductCard/ProductCardAction.js +2 -1
- package/dist/Components/ProductCard/ProductCardSwatches.js +2 -1
- package/dist/Components/ProductDetails/ProductDetails.js +2 -1
- package/dist/Components/ProfileCard/ProfileCard.d.ts +1 -0
- package/dist/Components/ProfileCard/ProfileCard.js +12 -26
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +4 -2
- package/dist/Components/ProgressBar/ProgressBar.js +2 -1
- package/dist/Components/QuantityStepper/QuantityStepper.js +5 -2
- package/dist/Components/QueryState/QueryStateBoundary.d.ts +1 -1
- package/dist/Components/QueryState/QueryStateBoundary.js +5 -1
- package/dist/Components/QueryState/QueryStateProps.d.ts +6 -2
- package/dist/Components/RadioButton/RadioButton.js +2 -3
- package/dist/Components/RolesPermission/RolesPermission.js +12 -8
- package/dist/Components/ScrollToTop/ScrollToTop.d.ts +1 -0
- package/dist/Components/ScrollbarBox/ScrollbarBox.d.ts +4 -1
- package/dist/Components/ScrollbarBox/ScrollbarBox.js +10 -4
- package/dist/Components/SearchSelect/SearchSelect.d.ts +1 -1
- package/dist/Components/SearchSelect/SearchSelect.js +8 -5
- package/dist/Components/SearchSelect/SearchSelectProps.d.ts +3 -3
- package/dist/Components/SegmentedControl/SegmentedControl.d.ts +1 -1
- package/dist/Components/SegmentedControl/SegmentedControl.js +1 -1
- package/dist/Components/Select/Select.js +6 -0
- package/dist/Components/Select/SelectNative.d.ts +16 -0
- package/dist/Components/Select/SelectPopup.js +170 -63
- package/dist/Components/Select/SelectProps.d.ts +30 -2
- package/dist/Components/Select/groupedWindow.d.ts +21 -0
- package/dist/Components/Select/groupedWindow.js +50 -0
- package/dist/Components/SelectSearch/SelectSearch.d.ts +1 -1
- package/dist/Components/SelectSearch/SelectSearch.js +48 -38
- package/dist/Components/SelectSearch/SelectSearchProps.d.ts +3 -3
- package/dist/Components/SelectV2/SelectV2.d.ts +1 -1
- package/dist/Components/SelectV2/SelectV2.js +1 -1
- package/dist/Components/SelectV2/SelectV2Props.d.ts +3 -3
- package/dist/Components/SideBar/SecondaryBar.js +3 -2
- package/dist/Components/SideBar/components/MenuItemBox.js +3 -2
- package/dist/Components/SideBar/components/MenuItems.js +1 -1
- package/dist/Components/SideBar/components/OtherApps.js +2 -2
- package/dist/Components/SideBar/components/PinnedSection.js +1 -1
- package/dist/Components/SideBar/sidebarScale.d.ts +2 -2
- package/dist/Components/SideBar/sidebarScale.js +2 -2
- package/dist/Components/SignInActivityTable/SignInActivityTable.js +7 -2
- package/dist/Components/SignInActivityTable/SignInActivityTableProps.d.ts +1 -1
- package/dist/Components/SignInActivityTable/scrollRegionRing.d.ts +10 -0
- package/dist/Components/SignInActivityTable/scrollRegionRing.js +14 -0
- package/dist/Components/Skeletons/SkeletonProps.d.ts +5 -1
- package/dist/Components/Slider/Slider.d.ts +2 -0
- package/dist/Components/Slider/Slider.js +5 -4
- package/dist/Components/StageProgress/StageItem.js +2 -1
- package/dist/Components/StageProgress/StageProgress.js +8 -2
- package/dist/Components/StageProgress/StageProgressProps.d.ts +2 -0
- package/dist/Components/StageProgress/StepperStage.js +2 -1
- package/dist/Components/StickyBuyBar/StickyBuyBar.js +2 -1
- package/dist/Components/Table/Table.js +5 -3
- package/dist/Components/Table/components/HeaderActions.js +5 -3
- package/dist/Components/Table/components/TableBody.js +13 -8
- package/dist/Components/Table/components/TableGroupRow.js +2 -1
- package/dist/Components/Table/components/TableHeader.js +17 -21
- package/dist/Components/Table/components/TableLoading.js +8 -2
- package/dist/Components/Table/components/rowDetail.js +3 -2
- package/dist/Components/Table/filters/ActiveFilters.js +6 -3
- package/dist/Components/Table/filters/CompactSelect.js +2 -1
- package/dist/Components/Table/filters/FilterDatePicker.d.ts +6 -0
- package/dist/Components/Table/filters/FilterDatePicker.js +61 -0
- package/dist/Components/Table/filters/LeftFilterPane.d.ts +1 -0
- package/dist/Components/Table/filters/LeftFilterPane.js +14 -6
- package/dist/Components/Table/hooks/useTable.js +11 -7
- package/dist/Components/Table/settings/ManageColumns.js +4 -3
- package/dist/Components/Table/settings/TableSettings.js +4 -4
- package/dist/Components/Tabs/Tabs.d.ts +1 -0
- package/dist/Components/Tabs/Tabs.js +1 -0
- package/dist/Components/Tabs/components/CountBadge.d.ts +1 -0
- package/dist/Components/Tabs/components/TabList.d.ts +1 -0
- package/dist/Components/Tabs/components/TabList.js +1 -0
- package/dist/Components/Tabs/components/TabPanel.d.ts +1 -0
- package/dist/Components/Tabs/components/TabPanel.js +1 -0
- package/dist/Components/Tabs/tabStyles.js +4 -2
- package/dist/Components/Tag/Tag.js +5 -4
- package/dist/Components/Tag/Tag.styles.js +5 -4
- package/dist/Components/Tag/TagProps.d.ts +4 -1
- package/dist/Components/Tag/tagDot.js +10 -3
- package/dist/Components/TagInput/TagInput.js +6 -5
- package/dist/Components/TagInput/TagInputProps.d.ts +15 -0
- package/dist/Components/TagInput/tagEntries.d.ts +7 -1
- package/dist/Components/TagInput/tagEntries.js +18 -5
- package/dist/Components/TimePicker/TimePicker.js +7 -3
- package/dist/Components/TimePicker/TimePickerProps.d.ts +2 -0
- package/dist/Components/Timeline/Timeline.js +13 -9
- package/dist/Components/Toaster/Toaster.js +2 -1
- package/dist/Components/Toggle/TableToggle.d.ts +1 -1
- package/dist/Components/Toggle/TableToggle.js +1 -1
- package/dist/Components/UpgradeButton/UpgradeButton.js +3 -2
- package/dist/Components/UpgradeButton/UpgradeButtonProps.d.ts +1 -1
- package/dist/Components/UserDetails/UserDetails.js +5 -7
- package/dist/Components/WishlistToggle/WishlistToggle.js +2 -1
- package/dist/Components/WizardDialog/WizardDialog.d.ts +1 -1
- package/dist/Components/WizardDialog/WizardDialog.js +15 -3
- package/dist/Components/WizardDialog/WizardDialogProps.d.ts +5 -3
- package/dist/Components/WorkspaceWindow/WorkspaceTrayPreview.js +11 -1
- package/dist/Components/WorkspaceWindow/WorkspaceWindow.js +6 -3
- package/dist/Components/WorkspaceWindow/WorkspaceWindowProps.d.ts +16 -15
- package/dist/Hooks/useOutsideMouseDown.d.ts +11 -0
- package/dist/Hooks/useOutsideMouseDown.js +30 -0
- package/dist/Hooks/usePreferences.js +30 -12
- package/dist/Hooks/useScrollableRegion.d.ts +17 -0
- package/dist/Hooks/useScrollableRegion.js +36 -0
- package/dist/Hooks/useSidebarPrefs.d.ts +1 -0
- package/dist/Theme/chakra/Menu.styles.d.ts +4 -0
- package/dist/Theme/chakra/Menu.styles.js +6 -0
- package/dist/Theme/chakra/componentStyles.d.ts +4 -0
- package/dist/Theme/chakra/componentStyles.js +1 -1
- package/dist/Theme/chakra/createBrandTheme.d.ts +1 -0
- package/dist/Theme/chakra/focusRing.styles.d.ts +1 -1
- package/dist/Theme/chakra/focusRing.styles.js +3 -3
- package/dist/Theme/chakra/paletteFromTheme.d.ts +2 -1
- package/dist/Theme/chakra/paletteFromTheme.js +18 -4
- package/dist/Theme/chakra/ringShadow.d.ts +3 -0
- package/dist/Theme/chakra/ringShadow.js +7 -0
- package/dist/Theme/provider/PixelizeThemeProvider.d.ts +1 -0
- package/dist/Theme/provider/ThemeSwitcher.d.ts +1 -0
- package/dist/Theme/provider/ThemeSwitcher.js +1 -1
- package/dist/Theme/testing/testPalette.d.ts +1 -0
- package/dist/Theme/tokens/builders/buildDarkPalette.d.ts +2 -1
- package/dist/Theme/tokens/builders/buildDarkPalette.js +5 -5
- package/dist/Theme/tokens/builders/filledSurface.js +3 -2
- package/dist/Theme/tokens/builders/focusRing.js +4 -1
- package/dist/Theme/tokens/builders/paletteScale.d.ts +2 -0
- package/dist/Theme/tokens/builders/paletteScale.js +10 -0
- package/dist/Theme/tokens/types.d.ts +1 -0
- package/dist/Utils/accountHandoff.d.ts +3 -0
- package/dist/Utils/price.d.ts +1 -0
- package/dist/Utils/tabular.d.ts +30 -0
- package/dist/Utils/tabular.js +61 -0
- package/dist/esm/Components/Accordion/Accordion.js +11 -8
- package/dist/esm/Components/Accordion/accordionColors.js +2 -3
- package/dist/esm/Components/Apexcharts/ApexLineChart/ApexLineChart.js +2 -1
- package/dist/esm/Components/Apexcharts/ApexPieChart/ApexPieChart.js +6 -5
- package/dist/esm/Components/Apexcharts/ApexPieChart/pieImageTexture.js +10 -0
- package/dist/esm/Components/AppSwitcher/AppSwitcher.js +6 -3
- package/dist/esm/Components/AppSwitcher/AppSwitcherProps.js +18 -11
- package/dist/esm/Components/AppSwitcher/pixelizeSuite.js +67 -0
- package/dist/esm/Components/AppearanceSettings/AppearanceSettings.js +3 -3
- package/dist/esm/Components/Avatar/avatarColorway.js +4 -4
- package/dist/esm/Components/Button/Button.styles.js +5 -2
- package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.js +3 -1
- package/dist/esm/Components/CalendarGrid/CalendarGrid.js +5 -3
- package/dist/esm/Components/Card/Card.js +1 -0
- package/dist/esm/Components/Checkbox/Checkbox.styles.js +3 -1
- package/dist/esm/Components/CheckoutKit/selectable.js +10 -7
- package/dist/esm/Components/CheckoutKit/tonalHover.js +2 -0
- package/dist/esm/Components/ChoiceCard/ChoiceCard.js +2 -1
- package/dist/esm/Components/Common/FormLabel.js +4 -3
- package/dist/esm/Components/Common/HelperText.js +1 -2
- package/dist/esm/Components/Common/activationKey.js +7 -0
- package/dist/esm/Components/Common/fieldMessageStyles.js +2 -1
- package/dist/esm/Components/Common/findSlot.js +17 -0
- package/dist/esm/Components/Common/surfaceFocusRing.js +3 -0
- package/dist/esm/Components/ConfirmDialog/ConfirmDialog.js +18 -6
- package/dist/esm/Components/CopyButton/CopyButton.js +5 -8
- package/dist/esm/Components/CouponField/CouponField.js +5 -2
- package/dist/esm/Components/CustomModulesTable/CustomModulesTable.js +3 -1
- package/dist/esm/Components/DatePicker/CalendarPanel.js +3 -1
- package/dist/esm/Components/DatePicker/DatePicker.js +25 -27
- package/dist/esm/Components/DatePicker/PickerPortal.js +2 -2
- package/dist/esm/Components/DatePicker/RangeDatePicker.js +10 -29
- package/dist/esm/Components/DatePicker/SingleDatePicker.js +5 -21
- package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +2 -20
- package/dist/esm/Components/DescriptionList/DescriptionList.js +1 -1
- package/dist/esm/Components/DetailSections/DetailSections.js +2 -1
- package/dist/esm/Components/Divider/Divider.js +3 -3
- package/dist/esm/Components/Drawer/Drawer.js +24 -19
- package/dist/esm/Components/Dropdown/DropDown.js +7 -22
- package/dist/esm/Components/Editor/Editor.js +7 -3
- package/dist/esm/Components/Editor/editorLabels.js +1 -0
- package/dist/esm/Components/Editor/editorTokenStyles.js +7 -0
- package/dist/esm/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +8 -4
- package/dist/esm/Components/EmptyState/FilteredEmptyState.js +18 -0
- package/dist/esm/Components/FilePreview/FilePreview.js +8 -4
- package/dist/esm/Components/FileUpload/FileUpload.js +8 -9
- package/dist/esm/Components/FileUploader/FileUploader.js +6 -7
- package/dist/esm/Components/FilterSidebar/FilterSidebar.js +94 -237
- package/dist/esm/Components/FilterSidebar/OptionsSection.js +41 -0
- package/dist/esm/Components/FilterSidebar/RangeSection.js +78 -0
- package/dist/esm/Components/FilterSidebar/SectionHeader.js +23 -0
- package/dist/esm/Components/FilterSidebar/useStableCallback.js +8 -0
- package/dist/esm/Components/Form/FormWrapper.js +5 -3
- package/dist/esm/Components/FormDrawer/FormDrawer.js +3 -3
- package/dist/esm/Components/FormField/FormField.js +1 -1
- package/dist/esm/Components/Header/Header.js +1 -1
- package/dist/esm/Components/Header/HeaderActions.js +6 -4
- package/dist/esm/Components/Input/TextInput.js +2 -2
- package/dist/esm/Components/KanbanBoard/AccountCard.js +1 -1
- package/dist/esm/Components/KanbanBoard/KanbanActions/KanbanActions.js +2 -2
- package/dist/esm/Components/KanbanBoard/KanbanBoard.js +11 -7
- package/dist/esm/Components/LauncherTrigger/LauncherTrigger.js +1 -1
- package/dist/esm/Components/LazyWrapper/LazyWrapper.js +1 -1
- package/dist/esm/Components/MediaViewer/MediaViewer.js +5 -4
- package/dist/esm/Components/MediaViewer/components/MediaAudioPlayer.js +5 -1
- package/dist/esm/Components/MediaViewer/components/MediaImageViewer.js +19 -8
- package/dist/esm/Components/MediaViewer/components/MediaScrubber.js +7 -2
- package/dist/esm/Components/MediaViewer/components/MediaVideoPlayer.js +3 -1
- package/dist/esm/Components/MediaViewer/components/ViewerIconButton.js +3 -1
- package/dist/esm/Components/MediaViewer/mediaItems.js +4 -0
- package/dist/esm/Components/Modal/Modal.js +2 -17
- package/dist/esm/Components/Modal/dialogNaming.js +18 -0
- package/dist/esm/Components/Modal/warnDroppedSlotChildren.js +7 -3
- package/dist/esm/Components/NavLauncher/LauncherTabs.js +4 -3
- package/dist/esm/Components/NavLauncher/NavLauncher.js +291 -59
- package/dist/esm/Components/NavLauncher/ScopeBar.js +136 -0
- package/dist/esm/Components/NavLauncher/engine/distance.js +37 -0
- package/dist/esm/Components/NavLauncher/engine/engine.js +459 -0
- package/dist/esm/Components/NavLauncher/engine/fold.js +75 -0
- package/dist/esm/Components/NavLauncher/engine/index.js +14 -0
- package/dist/esm/Components/NavLauncher/launcherParts.js +46 -10
- package/dist/esm/Components/NavLauncher/match.js +25 -12
- package/dist/esm/Components/NavLauncher/searchLayout.js +101 -0
- package/dist/esm/Components/NavLauncher/spotlight.js +194 -0
- package/dist/esm/Components/NavLauncher/spotlightParts.js +108 -0
- package/dist/esm/Components/NavLauncher/useCopiedFlash.js +17 -0
- package/dist/esm/Components/NavigationBar/NavigationBar.js +6 -5
- package/dist/esm/Components/NoteTextArea/NoteTextArea.js +12 -17
- package/dist/esm/Components/Notification/Notification.js +20 -22
- package/dist/esm/Components/NotificationBell/notificationHelpers.js +12 -6
- package/dist/esm/Components/OffersList/OffersList.js +4 -2
- package/dist/esm/Components/OptionChip/OptionChip.js +3 -2
- package/dist/esm/Components/OptionChip/optionInk.js +4 -2
- package/dist/esm/Components/OrderStatusTimeline/OrderStatusTimeline.js +2 -1
- package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +14 -7
- package/dist/esm/Components/OrganizationDetails/OrganizationDetails.js +5 -8
- package/dist/esm/Components/PlanPill/PlanPill.js +4 -2
- package/dist/esm/Components/ProductCard/ProductCardAction.js +2 -1
- package/dist/esm/Components/ProductCard/ProductCardSwatches.js +2 -1
- package/dist/esm/Components/ProductDetails/ProductDetails.js +2 -1
- package/dist/esm/Components/ProfileCard/ProfileCard.js +6 -17
- package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +4 -2
- package/dist/esm/Components/ProgressBar/ProgressBar.js +2 -1
- package/dist/esm/Components/QuantityStepper/QuantityStepper.js +5 -2
- package/dist/esm/Components/QueryState/QueryStateBoundary.js +5 -1
- package/dist/esm/Components/RadioButton/RadioButton.js +2 -3
- package/dist/esm/Components/RolesPermission/RolesPermission.js +12 -8
- package/dist/esm/Components/ScrollbarBox/ScrollbarBox.js +9 -3
- package/dist/esm/Components/SearchSelect/SearchSelect.js +8 -5
- package/dist/esm/Components/SegmentedControl/SegmentedControl.js +1 -1
- package/dist/esm/Components/Select/Select.js +6 -0
- package/dist/esm/Components/Select/SelectPopup.js +171 -64
- package/dist/esm/Components/Select/groupedWindow.js +44 -0
- package/dist/esm/Components/SelectSearch/SelectSearch.js +49 -39
- package/dist/esm/Components/SelectV2/SelectV2.js +1 -1
- package/dist/esm/Components/SideBar/SecondaryBar.js +3 -2
- package/dist/esm/Components/SideBar/components/MenuItemBox.js +3 -2
- package/dist/esm/Components/SideBar/components/MenuItems.js +1 -1
- package/dist/esm/Components/SideBar/components/OtherApps.js +2 -2
- package/dist/esm/Components/SideBar/components/PinnedSection.js +1 -1
- package/dist/esm/Components/SideBar/sidebarScale.js +2 -2
- package/dist/esm/Components/SignInActivityTable/SignInActivityTable.js +8 -3
- package/dist/esm/Components/SignInActivityTable/scrollRegionRing.js +9 -0
- package/dist/esm/Components/Slider/Slider.js +6 -5
- package/dist/esm/Components/StageProgress/StageItem.js +2 -1
- package/dist/esm/Components/StageProgress/StageProgress.js +8 -2
- package/dist/esm/Components/StageProgress/StepperStage.js +2 -1
- package/dist/esm/Components/StickyBuyBar/StickyBuyBar.js +2 -1
- package/dist/esm/Components/Table/Table.js +8 -6
- package/dist/esm/Components/Table/components/HeaderActions.js +7 -5
- package/dist/esm/Components/Table/components/TableBody.js +13 -8
- package/dist/esm/Components/Table/components/TableGroupRow.js +2 -1
- package/dist/esm/Components/Table/components/TableHeader.js +19 -23
- package/dist/esm/Components/Table/components/TableLoading.js +6 -3
- package/dist/esm/Components/Table/components/rowDetail.js +3 -2
- package/dist/esm/Components/Table/filters/ActiveFilters.js +8 -5
- package/dist/esm/Components/Table/filters/CompactSelect.js +2 -1
- package/dist/esm/Components/Table/filters/FilterDatePicker.js +20 -0
- package/dist/esm/Components/Table/filters/LeftFilterPane.js +14 -6
- package/dist/esm/Components/Table/hooks/useTable.js +11 -7
- package/dist/esm/Components/Table/settings/ManageColumns.js +4 -3
- package/dist/esm/Components/Table/settings/TableSettings.js +4 -4
- package/dist/esm/Components/Tabs/Tabs.js +1 -0
- package/dist/esm/Components/Tabs/components/TabList.js +1 -0
- package/dist/esm/Components/Tabs/components/TabPanel.js +1 -0
- package/dist/esm/Components/Tabs/tabStyles.js +5 -3
- package/dist/esm/Components/Tag/Tag.js +5 -4
- package/dist/esm/Components/Tag/Tag.styles.js +5 -4
- package/dist/esm/Components/Tag/tagDot.js +10 -3
- package/dist/esm/Components/TagInput/TagInput.js +8 -7
- package/dist/esm/Components/TagInput/tagEntries.js +16 -4
- package/dist/esm/Components/TimePicker/TimePicker.js +7 -3
- package/dist/esm/Components/Timeline/Timeline.js +14 -10
- package/dist/esm/Components/Toaster/Toaster.js +2 -1
- package/dist/esm/Components/Toggle/TableToggle.js +1 -1
- package/dist/esm/Components/UpgradeButton/UpgradeButton.js +3 -2
- package/dist/esm/Components/UserDetails/UserDetails.js +5 -7
- package/dist/esm/Components/WishlistToggle/WishlistToggle.js +2 -1
- package/dist/esm/Components/WizardDialog/WizardDialog.js +15 -3
- package/dist/esm/Components/WorkspaceWindow/WorkspaceTrayPreview.js +12 -2
- package/dist/esm/Components/WorkspaceWindow/WorkspaceWindow.js +7 -4
- package/dist/esm/Hooks/useOutsideMouseDown.js +26 -0
- package/dist/esm/Hooks/usePreferences.js +30 -12
- package/dist/esm/Hooks/useScrollableRegion.js +33 -0
- package/dist/esm/Theme/chakra/Menu.styles.js +6 -0
- package/dist/esm/Theme/chakra/componentStyles.js +1 -1
- package/dist/esm/Theme/chakra/focusRing.styles.js +3 -3
- package/dist/esm/Theme/chakra/paletteFromTheme.js +16 -3
- package/dist/esm/Theme/chakra/ringShadow.js +3 -0
- package/dist/esm/Theme/provider/ThemeSwitcher.js +1 -1
- package/dist/esm/Theme/tokens/builders/buildDarkPalette.js +5 -5
- package/dist/esm/Theme/tokens/builders/filledSurface.js +3 -2
- package/dist/esm/Theme/tokens/builders/focusRing.js +4 -1
- package/dist/esm/Theme/tokens/builders/paletteScale.js +6 -0
- package/dist/esm/Utils/tabular.js +56 -0
- package/dist/esm/index.js +18 -25
- package/dist/index.d.ts +59 -5
- package/dist/index.js +36 -29
- package/package.json +3 -1
- package/dist/Components/Buttons/Buttons.d.ts +0 -3
- package/dist/Components/Buttons/Buttons.js +0 -9
- package/dist/Components/Buttons/ButtonsProps.d.ts +0 -12
- package/dist/Components/Common/ErrorComponent.d.ts +0 -7
- package/dist/Components/Common/ErrorComponent.js +0 -16
- package/dist/Components/Common/FormattedDescription.d.ts +0 -7
- package/dist/Components/Common/FormattedDescription.js +0 -62
- package/dist/Components/Common/Label.d.ts +0 -9
- package/dist/Components/Common/Label.js +0 -12
- package/dist/Components/Input/Input/Input.d.ts +0 -4
- package/dist/Components/Input/Input/Input.js +0 -75
- package/dist/Components/Input/Input/InputProps.d.ts +0 -24
- package/dist/Components/Input/Input/InputProps.js +0 -2
- package/dist/Components/ProductCard/productCardFixtures.d.ts +0 -7
- package/dist/Components/ProductCard/productCardFixtures.js +0 -61
- package/dist/esm/Components/Buttons/Buttons.js +0 -4
- package/dist/esm/Components/Common/ErrorComponent.js +0 -14
- package/dist/esm/Components/Common/FormattedDescription.js +0 -60
- package/dist/esm/Components/Common/Label.js +0 -10
- package/dist/esm/Components/Input/Input/Input.js +0 -37
- package/dist/esm/Components/Input/Input/InputProps.js +0 -1
- package/dist/esm/Components/ProductCard/productCardFixtures.js +0 -58
- package/dist/esm/services/feedback.js +0 -15
- package/dist/services/feedback.d.ts +0 -12
- package/dist/services/feedback.js +0 -18
- /package/dist/Components/{Buttons/ButtonsProps.js → Common/dataAttributes.js} +0 -0
- /package/dist/esm/Components/{Buttons/ButtonsProps.js → Common/dataAttributes.js} +0 -0
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tokenize = exports.splitWords = exports.foldText = exports.editDistance = exports.usageBoosts = exports.highlightRanges = exports.matchesQuery = exports.createMatcher = exports.searchDocuments = exports.searchIndex = exports.createSearchIndex = void 0;
|
|
4
|
+
const distance_1 = require("./distance");
|
|
5
|
+
Object.defineProperty(exports, "editDistance", { enumerable: true, get: function () { return distance_1.editDistance; } });
|
|
6
|
+
const fold_1 = require("./fold");
|
|
7
|
+
Object.defineProperty(exports, "foldText", { enumerable: true, get: function () { return fold_1.foldText; } });
|
|
8
|
+
Object.defineProperty(exports, "splitWords", { enumerable: true, get: function () { return fold_1.splitWords; } });
|
|
9
|
+
Object.defineProperty(exports, "tokenize", { enumerable: true, get: function () { return fold_1.tokenize; } });
|
|
10
|
+
const KIND_SCORE = {
|
|
11
|
+
exact: 100,
|
|
12
|
+
prefix: 88,
|
|
13
|
+
word: 78,
|
|
14
|
+
"word-prefix": 68,
|
|
15
|
+
initialism: 60,
|
|
16
|
+
substring: 46,
|
|
17
|
+
fuzzy: 34,
|
|
18
|
+
subsequence: 16,
|
|
19
|
+
};
|
|
20
|
+
const COMPLETENESS = 6;
|
|
21
|
+
const SYNONYM_FACTOR = 0.92;
|
|
22
|
+
const STEM_PENALTY = 1;
|
|
23
|
+
const MAX_ALTERNATIVES = 12;
|
|
24
|
+
const UNBOUNDED_SLACK = 32;
|
|
25
|
+
// NOTE: code points, not a literal; see ANUSVARA in fold.ts.
|
|
26
|
+
const TAMIL_FINAL_MA = String.fromCodePoint(0x0bae, 0x0bcd);
|
|
27
|
+
const WORD_RE = /[\p{L}\p{N}\p{M}]+/gu;
|
|
28
|
+
const charBit = (code) => {
|
|
29
|
+
if (code >= 97 && code <= 122)
|
|
30
|
+
return 1 << (code - 97);
|
|
31
|
+
return code >= 48 && code <= 57 ? 1 << 26 : 1 << (27 + (code % 4));
|
|
32
|
+
};
|
|
33
|
+
const maskOf = (text) => {
|
|
34
|
+
let mask = 0;
|
|
35
|
+
for (let i = 0; i < text.length; i += 1)
|
|
36
|
+
mask |= charBit(text.charCodeAt(i));
|
|
37
|
+
return mask;
|
|
38
|
+
};
|
|
39
|
+
const missingChars = (token, field) => {
|
|
40
|
+
let rest = token & ~field;
|
|
41
|
+
let count = 0;
|
|
42
|
+
for (; rest; count += 1)
|
|
43
|
+
rest &= rest - 1;
|
|
44
|
+
return count;
|
|
45
|
+
};
|
|
46
|
+
const maxEdits = (size) => (size >= 8 ? 2 : 1);
|
|
47
|
+
const writtenSize = (text, marked) => marked ? (0, fold_1.letters)(text).length : text.length;
|
|
48
|
+
const indexField = ({ name, text, weight = 1, }) => {
|
|
49
|
+
var _a;
|
|
50
|
+
const folded = (0, fold_1.foldText)(text).trim();
|
|
51
|
+
const words = [];
|
|
52
|
+
const starts = [];
|
|
53
|
+
for (const match of folded.matchAll(WORD_RE)) {
|
|
54
|
+
words.push(match[0]);
|
|
55
|
+
starts.push((_a = match.index) !== null && _a !== void 0 ? _a : 0);
|
|
56
|
+
}
|
|
57
|
+
const letterWords = (0, fold_1.hasMarks)(folded) ? words.map(fold_1.letters) : null;
|
|
58
|
+
return {
|
|
59
|
+
name,
|
|
60
|
+
text,
|
|
61
|
+
weight,
|
|
62
|
+
folded,
|
|
63
|
+
compact: words.join(""),
|
|
64
|
+
words,
|
|
65
|
+
starts,
|
|
66
|
+
initials: (letterWords !== null && letterWords !== void 0 ? letterWords : words).map((w) => w[0]).join(""),
|
|
67
|
+
mask: maskOf(folded),
|
|
68
|
+
letterWords,
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
const createSearchIndex = (documents) => {
|
|
72
|
+
const indexed = documents.map((doc, index) => {
|
|
73
|
+
const fields = doc.fields.filter((f) => f.text).map(indexField);
|
|
74
|
+
return {
|
|
75
|
+
id: doc.id,
|
|
76
|
+
index,
|
|
77
|
+
fields,
|
|
78
|
+
mask: fields.reduce((mask, f) => mask | f.mask, 0),
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
return { size: indexed.length, documents: indexed };
|
|
82
|
+
};
|
|
83
|
+
exports.createSearchIndex = createSearchIndex;
|
|
84
|
+
const startsLikely = (token, word) => word[0][0] === token[0][0] || (word[0] === token[1] && word[1] === token[0]);
|
|
85
|
+
const fuzzyScore = (token, words) => {
|
|
86
|
+
const max = maxEdits(token.length);
|
|
87
|
+
let best = 0;
|
|
88
|
+
for (let w = 0; w < words.length; w += 1) {
|
|
89
|
+
const word = words[w];
|
|
90
|
+
if (!startsLikely(token, word))
|
|
91
|
+
continue;
|
|
92
|
+
if (Math.abs(word.length - token.length) <= max) {
|
|
93
|
+
const d = (0, distance_1.editDistance)(token, word, max);
|
|
94
|
+
if (d <= max)
|
|
95
|
+
best = Math.max(best, KIND_SCORE.fuzzy - 8 * (d - 1));
|
|
96
|
+
}
|
|
97
|
+
if (token.length < 5 || best >= KIND_SCORE.fuzzy)
|
|
98
|
+
continue;
|
|
99
|
+
for (let len = token.length - 1; len <= token.length + 1; len += 1) {
|
|
100
|
+
if (len >= word.length)
|
|
101
|
+
break;
|
|
102
|
+
const d = (0, distance_1.editDistance)(token, word.slice(0, len), max);
|
|
103
|
+
if (d <= max)
|
|
104
|
+
best = Math.max(best, KIND_SCORE.fuzzy - 4 - 8 * (d - 1));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return best;
|
|
108
|
+
};
|
|
109
|
+
const subsequenceOf = (need, have) => {
|
|
110
|
+
if (have.length <= need.length || have[0] !== need[0])
|
|
111
|
+
return null;
|
|
112
|
+
const positions = [0];
|
|
113
|
+
for (let i = 1, at = 1; i < need.length; i += 1) {
|
|
114
|
+
const next = have.indexOf(need[i], at);
|
|
115
|
+
if (next < 0)
|
|
116
|
+
return null;
|
|
117
|
+
positions.push(next);
|
|
118
|
+
at = next + 1;
|
|
119
|
+
}
|
|
120
|
+
return positions;
|
|
121
|
+
};
|
|
122
|
+
const offsetIn = (have, index) => typeof have === "string" ? index : have.slice(0, index).join("").length;
|
|
123
|
+
const subsequenceAt = (token, words, starts, marked) => {
|
|
124
|
+
const need = marked ? (0, fold_1.letters)(token) : token;
|
|
125
|
+
for (let k = 0; k < words.length; k += 1) {
|
|
126
|
+
const have = marked ? (0, fold_1.letters)(words[k]) : words[k];
|
|
127
|
+
const positions = subsequenceOf(need, have);
|
|
128
|
+
if (positions)
|
|
129
|
+
return positions.map((p) => starts[k] + offsetIn(have, p));
|
|
130
|
+
}
|
|
131
|
+
return null;
|
|
132
|
+
};
|
|
133
|
+
const fuzzyOnly = (token, field, floor) => {
|
|
134
|
+
var _a, _b;
|
|
135
|
+
if (KIND_SCORE.fuzzy < floor)
|
|
136
|
+
return null;
|
|
137
|
+
const score = fuzzyScore((_a = token.letters) !== null && _a !== void 0 ? _a : token.text, (_b = field.letterWords) !== null && _b !== void 0 ? _b : field.words);
|
|
138
|
+
return score > 0 ? { kind: "fuzzy", base: score } : null;
|
|
139
|
+
};
|
|
140
|
+
const matchToken = (tokenInfo, field, floor) => {
|
|
141
|
+
var _a, _b;
|
|
142
|
+
const { text: token, mask, edits, slack } = tokenInfo;
|
|
143
|
+
const missing = missingChars(mask, field.mask);
|
|
144
|
+
if (missing > 0)
|
|
145
|
+
return missing <= slack ? fuzzyOnly(tokenInfo, field, floor) : null;
|
|
146
|
+
const ratio = (COMPLETENESS * token.length) / Math.max(field.folded.length, token.length);
|
|
147
|
+
if (field.folded === token)
|
|
148
|
+
return { kind: "exact", base: KIND_SCORE.exact + COMPLETENESS };
|
|
149
|
+
if (field.folded.startsWith(token))
|
|
150
|
+
return { kind: "prefix", base: KIND_SCORE.prefix + ratio };
|
|
151
|
+
if (KIND_SCORE.word + COMPLETENESS < floor)
|
|
152
|
+
return null;
|
|
153
|
+
let isWordPrefix = false;
|
|
154
|
+
const { words } = field;
|
|
155
|
+
for (let w = 0; w < words.length; w += 1) {
|
|
156
|
+
if (words[w] === token)
|
|
157
|
+
return { kind: "word", base: KIND_SCORE.word + ratio };
|
|
158
|
+
if (words[w].startsWith(token))
|
|
159
|
+
isWordPrefix = true;
|
|
160
|
+
}
|
|
161
|
+
if (isWordPrefix)
|
|
162
|
+
return { kind: "word-prefix", base: KIND_SCORE["word-prefix"] + ratio };
|
|
163
|
+
if (token.length < 2 || KIND_SCORE.initialism < floor)
|
|
164
|
+
return null;
|
|
165
|
+
if (field.words.length >= 2 && field.initials.startsWith(token)) {
|
|
166
|
+
return { kind: "initialism", base: KIND_SCORE.initialism };
|
|
167
|
+
}
|
|
168
|
+
if (field.folded.includes(token) || field.compact.includes(token)) {
|
|
169
|
+
return { kind: "substring", base: KIND_SCORE.substring };
|
|
170
|
+
}
|
|
171
|
+
if (tokenInfo.exact)
|
|
172
|
+
return null;
|
|
173
|
+
if (edits > 0) {
|
|
174
|
+
const match = fuzzyOnly(tokenInfo, field, floor);
|
|
175
|
+
if (match)
|
|
176
|
+
return match;
|
|
177
|
+
}
|
|
178
|
+
if (KIND_SCORE.subsequence < floor)
|
|
179
|
+
return null;
|
|
180
|
+
const need = (_a = tokenInfo.letters) !== null && _a !== void 0 ? _a : token;
|
|
181
|
+
const lists = (_b = field.letterWords) !== null && _b !== void 0 ? _b : field.words;
|
|
182
|
+
return lists.some((have) => subsequenceOf(need, have))
|
|
183
|
+
? { kind: "subsequence", base: KIND_SCORE.subsequence }
|
|
184
|
+
: null;
|
|
185
|
+
};
|
|
186
|
+
const reachable = (token, doc) => missingChars(token.mask, doc.mask) <= token.slack ||
|
|
187
|
+
(token.stem !== null && missingChars(token.stem.mask, doc.mask) === 0);
|
|
188
|
+
const scoreTokens = (doc, alt) => {
|
|
189
|
+
const { tokens } = alt;
|
|
190
|
+
const { fields } = doc;
|
|
191
|
+
for (let t = 0; t < tokens.length; t += 1) {
|
|
192
|
+
if (!reachable(tokens[t], doc))
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
let total = 0;
|
|
196
|
+
const matches = [];
|
|
197
|
+
for (let t = 0; t < tokens.length; t += 1) {
|
|
198
|
+
const token = tokens[t];
|
|
199
|
+
let best = 0;
|
|
200
|
+
let found = null;
|
|
201
|
+
for (let f = 0; f < fields.length; f += 1) {
|
|
202
|
+
const field = fields[f];
|
|
203
|
+
for (let form = token, penalty = 0; form; form = form.stem, penalty = STEM_PENALTY) {
|
|
204
|
+
const match = matchToken(form, field, best / field.weight + penalty);
|
|
205
|
+
if (!match)
|
|
206
|
+
continue;
|
|
207
|
+
const score = (match.base - penalty) * field.weight;
|
|
208
|
+
if (score > best) {
|
|
209
|
+
best = score;
|
|
210
|
+
found = {
|
|
211
|
+
token: token.text,
|
|
212
|
+
field: field.name,
|
|
213
|
+
text: field.text,
|
|
214
|
+
kind: match.kind,
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
if (!found)
|
|
220
|
+
return null;
|
|
221
|
+
total += best;
|
|
222
|
+
matches.push(found);
|
|
223
|
+
}
|
|
224
|
+
let score = total / tokens.length;
|
|
225
|
+
if (tokens.length > 1) {
|
|
226
|
+
const { phrase } = alt;
|
|
227
|
+
for (let f = 0; f < fields.length; f += 1) {
|
|
228
|
+
const field = fields[f];
|
|
229
|
+
if (field.weight < 1)
|
|
230
|
+
continue;
|
|
231
|
+
if (field.folded === phrase)
|
|
232
|
+
score += 20;
|
|
233
|
+
else if (field.folded.startsWith(phrase))
|
|
234
|
+
score += 10;
|
|
235
|
+
else if (field.folded.includes(phrase))
|
|
236
|
+
score += 5;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return { score, matches };
|
|
240
|
+
};
|
|
241
|
+
const compiled = new WeakMap();
|
|
242
|
+
const synonymGroups = (synonyms) => {
|
|
243
|
+
const cached = compiled.get(synonyms);
|
|
244
|
+
if (cached)
|
|
245
|
+
return cached;
|
|
246
|
+
const groups = Object.entries(synonyms).map(([term, phrases]) => [term, ...phrases].map(fold_1.tokenize).filter((tokens) => tokens.length > 0));
|
|
247
|
+
compiled.set(synonyms, groups);
|
|
248
|
+
return groups;
|
|
249
|
+
};
|
|
250
|
+
const findRun = (tokens, run) => {
|
|
251
|
+
for (let at = 0; at + run.length <= tokens.length; at += 1) {
|
|
252
|
+
if (run.every((t, i) => tokens[at + i] === t))
|
|
253
|
+
return at;
|
|
254
|
+
}
|
|
255
|
+
return -1;
|
|
256
|
+
};
|
|
257
|
+
const alternatives = (tokens, synonyms) => {
|
|
258
|
+
const out = [{ tokens }];
|
|
259
|
+
if (!synonyms || tokens.length === 0)
|
|
260
|
+
return out;
|
|
261
|
+
const seen = new Set([tokens.join(" ")]);
|
|
262
|
+
for (const group of synonymGroups(synonyms)) {
|
|
263
|
+
for (const member of group) {
|
|
264
|
+
const at = findRun(tokens, member);
|
|
265
|
+
if (at < 0)
|
|
266
|
+
continue;
|
|
267
|
+
for (const other of group) {
|
|
268
|
+
if (other === member)
|
|
269
|
+
continue;
|
|
270
|
+
const next = [
|
|
271
|
+
...tokens.slice(0, at),
|
|
272
|
+
...other,
|
|
273
|
+
...tokens.slice(at + member.length),
|
|
274
|
+
];
|
|
275
|
+
const key = next.join(" ");
|
|
276
|
+
if (seen.has(key))
|
|
277
|
+
continue;
|
|
278
|
+
seen.add(key);
|
|
279
|
+
out.push({ tokens: Array.from(new Set(next)), via: other.join(" ") });
|
|
280
|
+
if (out.length >= MAX_ALTERNATIVES)
|
|
281
|
+
return out;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return out;
|
|
286
|
+
};
|
|
287
|
+
const stemOf = (text) => text.endsWith(TAMIL_FINAL_MA) && (0, fold_1.letters)(text).length > 2
|
|
288
|
+
? text.slice(0, -TAMIL_FINAL_MA.length)
|
|
289
|
+
: null;
|
|
290
|
+
const toToken = (text, fuzzy) => {
|
|
291
|
+
const written = (0, fold_1.hasMarks)(text) ? (0, fold_1.letters)(text) : null;
|
|
292
|
+
const size = written ? written.length : text.length;
|
|
293
|
+
const edits = fuzzy && size >= 4 ? maxEdits(size) : 0;
|
|
294
|
+
const stem = stemOf(text);
|
|
295
|
+
return {
|
|
296
|
+
text,
|
|
297
|
+
mask: maskOf(text),
|
|
298
|
+
edits,
|
|
299
|
+
slack: written && edits > 0 ? UNBOUNDED_SLACK : edits,
|
|
300
|
+
letters: written,
|
|
301
|
+
exact: false,
|
|
302
|
+
stem: stem === null
|
|
303
|
+
? null
|
|
304
|
+
: {
|
|
305
|
+
text: stem,
|
|
306
|
+
mask: maskOf(stem),
|
|
307
|
+
edits: 0,
|
|
308
|
+
slack: 0,
|
|
309
|
+
letters: null,
|
|
310
|
+
exact: true,
|
|
311
|
+
stem: null,
|
|
312
|
+
},
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
const compileQuery = (tokens, options) => alternatives(tokens, options.synonyms).map(({ tokens: words, via }) => ({
|
|
316
|
+
tokens: words.map((text) => toToken(text, options.fuzzy !== false)),
|
|
317
|
+
phrase: words.join(" "),
|
|
318
|
+
via,
|
|
319
|
+
}));
|
|
320
|
+
const searchIndex = (index, query, options = {}) => {
|
|
321
|
+
var _a, _b, _c;
|
|
322
|
+
const tokens = (0, fold_1.tokenize)(query);
|
|
323
|
+
if (tokens.length === 0)
|
|
324
|
+
return [];
|
|
325
|
+
const alts = compileQuery(tokens, options);
|
|
326
|
+
const hits = [];
|
|
327
|
+
const { documents } = index;
|
|
328
|
+
for (let d = 0; d < documents.length; d += 1) {
|
|
329
|
+
const doc = documents[d];
|
|
330
|
+
let best = null;
|
|
331
|
+
for (let a = 0; a < alts.length; a += 1) {
|
|
332
|
+
const alt = alts[a];
|
|
333
|
+
const result = scoreTokens(doc, alt);
|
|
334
|
+
if (!result)
|
|
335
|
+
continue;
|
|
336
|
+
const score = alt.via ? result.score * SYNONYM_FACTOR : result.score;
|
|
337
|
+
if (!best || score > best.score) {
|
|
338
|
+
best = {
|
|
339
|
+
id: doc.id,
|
|
340
|
+
index: doc.index,
|
|
341
|
+
score,
|
|
342
|
+
matches: result.matches,
|
|
343
|
+
synonym: alt.via,
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
if (!best)
|
|
348
|
+
continue;
|
|
349
|
+
best.score += (_b = (_a = options.boosts) === null || _a === void 0 ? void 0 : _a[doc.id]) !== null && _b !== void 0 ? _b : 0;
|
|
350
|
+
hits.push(best);
|
|
351
|
+
}
|
|
352
|
+
hits.sort((a, b) => b.score - a.score || a.index - b.index);
|
|
353
|
+
const floor = hits.length ? hits[0].score * ((_c = options.relativeCutoff) !== null && _c !== void 0 ? _c : 0) : 0;
|
|
354
|
+
const kept = floor > 0 ? hits.filter((hit) => hit.score >= floor) : hits;
|
|
355
|
+
return options.limit === undefined ? kept : kept.slice(0, options.limit);
|
|
356
|
+
};
|
|
357
|
+
exports.searchIndex = searchIndex;
|
|
358
|
+
const searchDocuments = (documents, query, options) => (0, exports.searchIndex)((0, exports.createSearchIndex)(documents), query, options);
|
|
359
|
+
exports.searchDocuments = searchDocuments;
|
|
360
|
+
/** Compiles `query` once; every query word must hit some text of the row. */
|
|
361
|
+
const createMatcher = (query, options = {}) => {
|
|
362
|
+
const tokens = (0, fold_1.tokenize)(query);
|
|
363
|
+
if (tokens.length === 0)
|
|
364
|
+
return () => true;
|
|
365
|
+
const alts = compileQuery(tokens, options);
|
|
366
|
+
return (...texts) => {
|
|
367
|
+
const fields = texts
|
|
368
|
+
.filter((text) => Boolean(text))
|
|
369
|
+
.map((text) => indexField({ name: "text", text }));
|
|
370
|
+
const doc = {
|
|
371
|
+
id: "",
|
|
372
|
+
index: 0,
|
|
373
|
+
fields,
|
|
374
|
+
mask: fields.reduce((mask, f) => mask | f.mask, 0),
|
|
375
|
+
};
|
|
376
|
+
return alts.some((alt) => scoreTokens(doc, alt) !== null);
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
exports.createMatcher = createMatcher;
|
|
380
|
+
/** One-off form of `createMatcher`: does `query` match the row made of `texts`? */
|
|
381
|
+
const matchesQuery = (query, ...texts) => (0, exports.createMatcher)(query)(...texts);
|
|
382
|
+
exports.matchesQuery = matchesQuery;
|
|
383
|
+
const markEnd = (text, end) => {
|
|
384
|
+
let at = end;
|
|
385
|
+
while (at < text.length && /\p{M}/u.test(text[at]))
|
|
386
|
+
at += 1;
|
|
387
|
+
return at;
|
|
388
|
+
};
|
|
389
|
+
const tokenRanges = (token, folded, words, starts, fuzzy) => {
|
|
390
|
+
var _a;
|
|
391
|
+
const ranges = [];
|
|
392
|
+
if (token.length >= 2) {
|
|
393
|
+
for (let at = folded.indexOf(token); at !== -1; at = folded.indexOf(token, at + token.length)) {
|
|
394
|
+
ranges.push([at, at + token.length]);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
else {
|
|
398
|
+
words.forEach((word, i) => {
|
|
399
|
+
if (word.startsWith(token))
|
|
400
|
+
ranges.push([starts[i], starts[i] + 1]);
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
if (ranges.length || token.length < 2)
|
|
404
|
+
return ranges;
|
|
405
|
+
const marked = (0, fold_1.hasMarks)(token) || (0, fold_1.hasMarks)(folded);
|
|
406
|
+
const firsts = words.map((w) => (marked ? (0, fold_1.letters)(w)[0] : w[0]));
|
|
407
|
+
if (words.length >= 2 && firsts.join("").startsWith(token)) {
|
|
408
|
+
return Array.from(marked ? (0, fold_1.letters)(token) : token, (_, i) => [starts[i], starts[i] + firsts[i].length]);
|
|
409
|
+
}
|
|
410
|
+
if (fuzzy && writtenSize(token, marked) >= 4) {
|
|
411
|
+
words.forEach((word, i) => {
|
|
412
|
+
if (fuzzyScore(marked ? (0, fold_1.letters)(token) : token, [
|
|
413
|
+
marked ? (0, fold_1.letters)(word) : word,
|
|
414
|
+
]) > 0)
|
|
415
|
+
ranges.push([starts[i], starts[i] + word.length]);
|
|
416
|
+
});
|
|
417
|
+
if (ranges.length)
|
|
418
|
+
return ranges;
|
|
419
|
+
}
|
|
420
|
+
return ((_a = subsequenceAt(token, words, starts, marked)) !== null && _a !== void 0 ? _a : []).map((p) => [p, p + 1]);
|
|
421
|
+
};
|
|
422
|
+
/** Character ranges of `text` a query matched, in original-text offsets, merged and sorted. */
|
|
423
|
+
const highlightRanges = (text, query, options = {}) => {
|
|
424
|
+
var _a;
|
|
425
|
+
const tokens = Array.from(new Set(alternatives((0, fold_1.tokenize)(query), options.synonyms)
|
|
426
|
+
.flatMap((a) => a.tokens)
|
|
427
|
+
.flatMap((token) => {
|
|
428
|
+
const stem = stemOf(token);
|
|
429
|
+
return stem ? [token, stem] : [token];
|
|
430
|
+
})));
|
|
431
|
+
if (tokens.length === 0 || !text)
|
|
432
|
+
return [];
|
|
433
|
+
const { folded, map } = (0, fold_1.foldWithMap)(text);
|
|
434
|
+
const words = [];
|
|
435
|
+
const starts = [];
|
|
436
|
+
for (const match of folded.matchAll(WORD_RE)) {
|
|
437
|
+
words.push(match[0]);
|
|
438
|
+
starts.push((_a = match.index) !== null && _a !== void 0 ? _a : 0);
|
|
439
|
+
}
|
|
440
|
+
const ranges = tokens
|
|
441
|
+
.flatMap((token) => tokenRanges(token, folded, words, starts, options.fuzzy !== false))
|
|
442
|
+
.sort((a, b) => a[0] - b[0]);
|
|
443
|
+
const merged = [];
|
|
444
|
+
for (const [start, end] of ranges) {
|
|
445
|
+
const last = merged[merged.length - 1];
|
|
446
|
+
if (last && start <= last[1])
|
|
447
|
+
last[1] = Math.max(last[1], end);
|
|
448
|
+
else
|
|
449
|
+
merged.push([start, end]);
|
|
450
|
+
}
|
|
451
|
+
return merged.map(([start, end]) => {
|
|
452
|
+
var _a;
|
|
453
|
+
const lastChar = map[end - 1];
|
|
454
|
+
const width = ((_a = text.codePointAt(lastChar)) !== null && _a !== void 0 ? _a : 0) > 0xffff ? 2 : 1;
|
|
455
|
+
return [map[start], markEnd(text, lastChar + width)];
|
|
456
|
+
});
|
|
457
|
+
};
|
|
458
|
+
exports.highlightRanges = highlightRanges;
|
|
459
|
+
/** Additive ranking points from usage: pinned flat, frequent and recent decaying by position. */
|
|
460
|
+
const usageBoosts = (usage) => {
|
|
461
|
+
const out = {};
|
|
462
|
+
const add = (ids, weight, decays) => ids === null || ids === void 0 ? void 0 : ids.forEach((id, i) => {
|
|
463
|
+
var _a;
|
|
464
|
+
const factor = decays ? Math.max(0.25, 1 - i / ids.length) : 1;
|
|
465
|
+
out[id] = ((_a = out[id]) !== null && _a !== void 0 ? _a : 0) + weight * factor;
|
|
466
|
+
});
|
|
467
|
+
add(usage.pinnedIds, 3, false);
|
|
468
|
+
add(usage.frequentIds, 4, true);
|
|
469
|
+
add(usage.recentIds, 2, true);
|
|
470
|
+
return out;
|
|
471
|
+
};
|
|
472
|
+
exports.usageBoosts = usageBoosts;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Case- and accent-insensitive form used for every comparison: "Crème Brûlée" -> "creme brulee". */
|
|
2
|
+
export declare const foldText: (text: string) => string;
|
|
3
|
+
export declare const splitWords: (folded: string) => string[];
|
|
4
|
+
/** Folded, de-duplicated query tokens in typing order. */
|
|
5
|
+
export declare const tokenize: (query: string) => string[];
|
|
6
|
+
/** True when folded text carries combining marks, so its written letters span several characters. */
|
|
7
|
+
export declare const hasMarks: (folded: string) => boolean;
|
|
8
|
+
/** Written letters: a base with its marks; a Devanagari conjunct counts as one. */
|
|
9
|
+
export declare const letters: (word: string) => string[];
|
|
10
|
+
/** Folded text plus each folded index's position in the original text. */
|
|
11
|
+
export type FoldedText = {
|
|
12
|
+
folded: string;
|
|
13
|
+
map: number[];
|
|
14
|
+
};
|
|
15
|
+
export declare const foldWithMap: (text: string) => FoldedText;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.foldWithMap = exports.letters = exports.hasMarks = exports.tokenize = exports.splitWords = exports.foldText = void 0;
|
|
4
|
+
// Accents, nukta and joiners fold away; vowel signs and viramas belong to the letter.
|
|
5
|
+
const OPTIONAL_MARKS =
|
|
6
|
+
// eslint-disable-next-line no-misleading-character-class -- each mark is removed on its own
|
|
7
|
+
/[\u0300-\u036f\u0591-\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06ed\u093c\u1ab0-\u1aff\u1dc0-\u1dff\u200c\u200d\u20d0-\u20ff\ufe20-\ufe2f]/g;
|
|
8
|
+
const CHANDRABINDU = /\u0901/g;
|
|
9
|
+
// NOTE: built from code points; minified Indic literals trip consumers' locale-data budget gates.
|
|
10
|
+
const ANUSVARA = String.fromCodePoint(0x0902);
|
|
11
|
+
const MARK = /\p{M}/u;
|
|
12
|
+
const SEPARATOR = /[^\p{L}\p{N}\p{M}]+/u;
|
|
13
|
+
const SPECIAL = {
|
|
14
|
+
ß: "ss",
|
|
15
|
+
æ: "ae",
|
|
16
|
+
œ: "oe",
|
|
17
|
+
ø: "o",
|
|
18
|
+
ł: "l",
|
|
19
|
+
đ: "d",
|
|
20
|
+
ı: "i",
|
|
21
|
+
};
|
|
22
|
+
const SPECIAL_RE = /[ßæœøłđı]/g;
|
|
23
|
+
const DEVANAGARI_VIRAMA = 0x094d;
|
|
24
|
+
/** Case- and accent-insensitive form used for every comparison: "Crème Brûlée" -> "creme brulee". */
|
|
25
|
+
const foldText = (text) => text
|
|
26
|
+
.normalize("NFKD")
|
|
27
|
+
.replace(OPTIONAL_MARKS, "")
|
|
28
|
+
.replace(CHANDRABINDU, ANUSVARA)
|
|
29
|
+
.toLowerCase()
|
|
30
|
+
.replace(SPECIAL_RE, (ch) => SPECIAL[ch]);
|
|
31
|
+
exports.foldText = foldText;
|
|
32
|
+
const splitWords = (folded) => folded.split(SEPARATOR).filter(Boolean);
|
|
33
|
+
exports.splitWords = splitWords;
|
|
34
|
+
/** Folded, de-duplicated query tokens in typing order. */
|
|
35
|
+
const tokenize = (query) => Array.from(new Set((0, exports.splitWords)((0, exports.foldText)(query))));
|
|
36
|
+
exports.tokenize = tokenize;
|
|
37
|
+
/** True when folded text carries combining marks, so its written letters span several characters. */
|
|
38
|
+
const hasMarks = (folded) => MARK.test(folded);
|
|
39
|
+
exports.hasMarks = hasMarks;
|
|
40
|
+
const isDevanagariConsonant = (code) => (code >= 0x0915 && code <= 0x0939) || (code >= 0x0978 && code <= 0x097f);
|
|
41
|
+
const markCodes = new Map();
|
|
42
|
+
const isMarkCode = (code, char) => {
|
|
43
|
+
if (code < 0x0300)
|
|
44
|
+
return false;
|
|
45
|
+
let known = markCodes.get(code);
|
|
46
|
+
if (known === undefined) {
|
|
47
|
+
known = MARK.test(char);
|
|
48
|
+
markCodes.set(code, known);
|
|
49
|
+
}
|
|
50
|
+
return known;
|
|
51
|
+
};
|
|
52
|
+
/** Written letters: a base with its marks; a Devanagari conjunct counts as one. */
|
|
53
|
+
const letters = (word) => {
|
|
54
|
+
var _a;
|
|
55
|
+
const out = [];
|
|
56
|
+
let previous = 0;
|
|
57
|
+
for (const char of word) {
|
|
58
|
+
const code = (_a = char.codePointAt(0)) !== null && _a !== void 0 ? _a : 0;
|
|
59
|
+
const joins = isMarkCode(code, char) ||
|
|
60
|
+
(previous === DEVANAGARI_VIRAMA && isDevanagariConsonant(code));
|
|
61
|
+
if (joins && out.length > 0)
|
|
62
|
+
out[out.length - 1] += char;
|
|
63
|
+
else
|
|
64
|
+
out.push(char);
|
|
65
|
+
previous = code;
|
|
66
|
+
}
|
|
67
|
+
return out;
|
|
68
|
+
};
|
|
69
|
+
exports.letters = letters;
|
|
70
|
+
const foldWithMap = (text) => {
|
|
71
|
+
let folded = "";
|
|
72
|
+
const map = [];
|
|
73
|
+
let at = 0;
|
|
74
|
+
for (const char of text) {
|
|
75
|
+
const piece = (0, exports.foldText)(char);
|
|
76
|
+
for (let i = 0; i < piece.length; i += 1)
|
|
77
|
+
map.push(at);
|
|
78
|
+
folded += piece;
|
|
79
|
+
at += char.length;
|
|
80
|
+
}
|
|
81
|
+
map.push(text.length);
|
|
82
|
+
return { folded, map };
|
|
83
|
+
};
|
|
84
|
+
exports.foldWithMap = foldWithMap;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type { LauncherMatchKind, LauncherMatcher, LauncherSearchDocument, LauncherSearchField, LauncherSearchHit, LauncherSearchIndex, LauncherSearchOptions, LauncherSynonyms, LauncherTokenMatch, } from "./engine";
|
|
2
|
+
/** Framework-free ranked search used by NavLauncher; reusable by any list, picker or palette. */
|
|
3
|
+
export declare const LauncherSearchEngine: Readonly<{
|
|
4
|
+
createIndex: (documents: readonly import("./engine").LauncherSearchDocument[]) => import("./engine").LauncherSearchIndex;
|
|
5
|
+
search: (index: import("./engine").LauncherSearchIndex, query: string, options?: import("./engine").LauncherSearchOptions) => import("./engine").LauncherSearchHit[];
|
|
6
|
+
searchDocuments: (documents: readonly import("./engine").LauncherSearchDocument[], query: string, options?: import("./engine").LauncherSearchOptions) => import("./engine").LauncherSearchHit[];
|
|
7
|
+
createMatcher: (query: string, options?: {
|
|
8
|
+
fuzzy?: boolean | undefined;
|
|
9
|
+
synonyms?: import("./engine").LauncherSynonyms | undefined;
|
|
10
|
+
}) => import("./engine").LauncherMatcher;
|
|
11
|
+
matches: (query: string, ...texts: ReadonlyArray<string | null | undefined>) => boolean;
|
|
12
|
+
highlightRanges: (text: string, query: string, options?: Pick<import("./engine").LauncherSearchOptions, "synonyms" | "fuzzy">) => Array<[number, number]>;
|
|
13
|
+
usageBoosts: (usage: {
|
|
14
|
+
pinnedIds?: readonly string[];
|
|
15
|
+
frequentIds?: readonly string[];
|
|
16
|
+
recentIds?: readonly string[];
|
|
17
|
+
}) => Record<string, number>;
|
|
18
|
+
foldText: (text: string) => string;
|
|
19
|
+
tokenize: (query: string) => string[];
|
|
20
|
+
editDistance: (a: import("./distance").Sequence, b: import("./distance").Sequence, max: number) => number;
|
|
21
|
+
}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LauncherSearchEngine = void 0;
|
|
4
|
+
const engine_1 = require("./engine");
|
|
5
|
+
/** Framework-free ranked search used by NavLauncher; reusable by any list, picker or palette. */
|
|
6
|
+
exports.LauncherSearchEngine = Object.freeze({
|
|
7
|
+
createIndex: engine_1.createSearchIndex,
|
|
8
|
+
search: engine_1.searchIndex,
|
|
9
|
+
searchDocuments: engine_1.searchDocuments,
|
|
10
|
+
createMatcher: engine_1.createMatcher,
|
|
11
|
+
matches: engine_1.matchesQuery,
|
|
12
|
+
highlightRanges: engine_1.highlightRanges,
|
|
13
|
+
usageBoosts: engine_1.usageBoosts,
|
|
14
|
+
foldText: engine_1.foldText,
|
|
15
|
+
tokenize: engine_1.tokenize,
|
|
16
|
+
editDistance: engine_1.editDistance,
|
|
17
|
+
});
|
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
import { type ElementType, type FocusEvent, type KeyboardEvent, type MouseEvent, type ReactNode } from "react";
|
|
2
2
|
import type { PaletteProps } from "../../Theme/tokens/types";
|
|
3
3
|
import type { AppOption } from "../AppSwitcher/AppSwitcherProps";
|
|
4
|
+
import { type HighlightOptions } from "./match";
|
|
4
5
|
import type { LauncherLabels, LauncherModule, LauncherScreen } from "./NavLauncherProps";
|
|
5
6
|
export declare const ITEM_SELECTOR = "[data-launcher-item]";
|
|
6
7
|
export declare const TouchDensity: import("react").Provider<boolean>;
|
|
7
8
|
export declare const useTouchDensity: () => boolean;
|
|
9
|
+
type RulePlane = "raised" | "recess";
|
|
10
|
+
export declare const RulePlaneProvider: import("react").Provider<RulePlane>;
|
|
11
|
+
export declare const copyHint: (base: string, copied: string, isCopied: boolean) => {
|
|
12
|
+
text: string;
|
|
13
|
+
reserve: string;
|
|
14
|
+
isAccent: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare function HintLabel({ text, reserve, isAccent, }: {
|
|
17
|
+
text: string;
|
|
18
|
+
reserve: string;
|
|
19
|
+
isAccent?: boolean;
|
|
20
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
21
|
export declare const isPlainClick: (event: MouseEvent) => boolean;
|
|
9
22
|
export type LinkCtx = {
|
|
10
23
|
linkAs: ElementType;
|
|
@@ -100,6 +113,7 @@ type RowIconProps = {
|
|
|
100
113
|
mt?: string;
|
|
101
114
|
};
|
|
102
115
|
export declare function RowIcon({ icon: Icon, size, stroke, mt }: RowIconProps): import("react/jsx-runtime").JSX.Element | null;
|
|
116
|
+
export declare const HighlightOptionsProvider: import("react").Provider<HighlightOptions | undefined>;
|
|
103
117
|
export declare function Highlight({ text, query }: {
|
|
104
118
|
text: string;
|
|
105
119
|
query: string;
|