@synnaxlabs/pluto 0.21.9 → 0.23.0
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/dist/Animated-DPIV1IH6.js +19 -0
- package/dist/Animated-DjcnDVGC.cjs +1 -0
- package/dist/Keyboard-BLHHROrq.js +13 -0
- package/dist/Keyboard-CJLEUbYu.cjs +1 -0
- package/dist/LinePlot-C9MVJErC.js +10771 -0
- package/dist/LinePlot-DkAUE5Nq.cjs +68 -0
- package/dist/Link-BsqVxj6V.js +10 -0
- package/dist/Link-C3NUk5cp.cjs +1 -0
- package/dist/List-BbB1S5Vo.cjs +1 -0
- package/dist/List-DPugi06W.js +22 -0
- package/dist/Pack-CBNcamuh.cjs +1 -0
- package/dist/Pack-mkZBsSIU.js +125 -0
- package/dist/Toggle-BBGPiXIA.cjs +188 -0
- package/dist/Toggle-W4K3cLf7.js +43751 -0
- package/dist/Video-C2EYBKLN.js +14 -0
- package/dist/Video-Kb-c-N69.cjs +1 -0
- package/dist/aggregator-BZJAV5yZ.js +11109 -0
- package/dist/aggregator-DueF6Q-Z.cjs +45 -0
- package/dist/align.cjs +1 -5
- package/dist/align.js +2 -3
- package/dist/button.cjs +1 -5
- package/dist/button.js +1 -2
- package/dist/color.cjs +1 -5
- package/dist/color.js +1 -2
- package/dist/css-DZx3bWkH.cjs +1 -0
- package/dist/css-TXuXKs3A.js +1364 -0
- package/dist/css.cjs +1 -9
- package/dist/css.js +6 -7
- package/dist/dropdown.cjs +1 -5
- package/dist/dropdown.js +2 -3
- package/dist/ether.cjs +1 -84
- package/dist/ether.js +72 -77
- package/dist/external-0w2SHXg_.js +13 -0
- package/dist/external-B-CtJFCn.js +96 -0
- package/dist/external-B39SmpRo.js +201 -0
- package/dist/external-BB2SaR1o.js +14 -0
- package/dist/external-BKWizK6o.cjs +1 -0
- package/dist/external-BbnWD0Pc.js +66 -0
- package/dist/external-BphNoXuB.js +92 -0
- package/dist/external-CduvGaPN.js +1183 -0
- package/dist/external-CsPOXIEm.cjs +1 -0
- package/dist/external-CyiLaYmg.js +322 -0
- package/dist/external-CztU6wom.cjs +1 -0
- package/dist/external-D1NnASGa.cjs +1 -0
- package/dist/external-DjjMU4Z6.cjs +1 -0
- package/dist/external-DlCoToEB.cjs +1 -0
- package/dist/external-DrS33VU5.cjs +1 -0
- package/dist/external-DsNtnR-y.cjs +1 -0
- package/dist/external-TNsi3_BK.js +111 -0
- package/dist/external-WGyRiKbb.js +129 -0
- package/dist/external-WzX6JA2j.cjs +1 -0
- package/dist/external-XoJlPNFB.js +22 -0
- package/dist/external-fg-pJfZR.js +260 -0
- package/dist/external-mlV4Onnq.cjs +1 -0
- package/dist/external-vZfda3xX.cjs +1 -0
- package/dist/external-vgqH7hLg.cjs +1 -0
- package/dist/header.cjs +1 -5
- package/dist/header.js +2 -3
- package/dist/index.cjs +1 -8534
- package/dist/index.js +5918 -7439
- package/dist/input.cjs +1 -5
- package/dist/input.js +2 -3
- package/dist/jsx-runtime-DqxPLdyS.js +623 -0
- package/dist/jsx-runtime-fmb_vB8K.cjs +25 -0
- package/dist/list.cjs +1 -5
- package/dist/list.js +2 -3
- package/dist/menu.cjs +1 -5
- package/dist/menu.js +2 -3
- package/dist/src/accordion/Accordion.d.ts.map +1 -1
- package/dist/src/aether/aether/aether.d.ts +1 -1
- package/dist/src/aether/aether/aether.d.ts.map +1 -1
- package/dist/src/aether/main.d.ts +1 -1
- package/dist/src/aether/main.d.ts.map +1 -1
- package/dist/src/aether/main.spec.d.ts.map +1 -1
- package/dist/src/aether/test/test.d.ts.map +1 -1
- package/dist/src/alamos/Provider.d.ts +1 -1
- package/dist/src/alamos/Provider.d.ts.map +1 -1
- package/dist/src/alamos/aether/alamos.d.ts +6 -6
- package/dist/src/align/Center.d.ts.map +1 -1
- package/dist/src/align/Pack.d.ts.map +1 -1
- package/dist/src/align/Space.d.ts +1 -1
- package/dist/src/align/Space.d.ts.map +1 -1
- package/dist/src/align/external.d.ts +2 -2
- package/dist/src/align/external.d.ts.map +1 -1
- package/dist/src/button/Button.d.ts +1 -1
- package/dist/src/button/Button.d.ts.map +1 -1
- package/dist/src/button/Icon.d.ts.map +1 -1
- package/dist/src/button/Toggle.d.ts.map +1 -1
- package/dist/src/caret/Animated.d.ts +9 -0
- package/dist/src/caret/Animated.d.ts.map +1 -0
- package/dist/src/caret/index.d.ts +2 -0
- package/dist/src/caret/index.d.ts.map +1 -0
- package/dist/src/channel/AliasProvider.d.ts +1 -1
- package/dist/src/channel/AliasProvider.d.ts.map +1 -1
- package/dist/src/channel/LinePlot.d.ts +1 -1
- package/dist/src/channel/LinePlot.d.ts.map +1 -1
- package/dist/src/channel/Select.d.ts +1 -1
- package/dist/src/channel/Select.d.ts.map +1 -1
- package/dist/src/channel/external.d.ts +1 -1
- package/dist/src/channel/external.d.ts.map +1 -1
- package/dist/src/color/Picker/Picker.d.ts.map +1 -1
- package/dist/src/color/Swatch/Swatch.d.ts +1 -1
- package/dist/src/color/Swatch/Swatch.d.ts.map +1 -1
- package/dist/src/color/core/color.d.ts.map +1 -1
- package/dist/src/color/external.d.ts +1 -1
- package/dist/src/color/external.d.ts.map +1 -1
- package/dist/src/css/bem.d.ts.map +1 -1
- package/dist/src/css/css.d.ts +2 -1
- package/dist/src/css/css.d.ts.map +1 -1
- package/dist/src/css/index.d.ts +2 -2
- package/dist/src/css/index.d.ts.map +1 -1
- package/dist/src/cursor/cursor.d.ts +1 -1
- package/dist/src/cursor/cursor.d.ts.map +1 -1
- package/dist/src/divider/Divider.d.ts +1 -1
- package/dist/src/divider/Divider.d.ts.map +1 -1
- package/dist/src/dropdown/Dropdown.d.ts +1 -1
- package/dist/src/dropdown/Dropdown.d.ts.map +1 -1
- package/dist/src/ether.d.ts +6 -6
- package/dist/src/ether.d.ts.map +1 -1
- package/dist/src/form/Form.d.ts +6 -6
- package/dist/src/form/Form.d.ts.map +1 -1
- package/dist/src/hardware/device/Select.d.ts +1 -1
- package/dist/src/hardware/device/Select.d.ts.map +1 -1
- package/dist/src/haul/Haul.d.ts +17 -5
- package/dist/src/haul/Haul.d.ts.map +1 -1
- package/dist/src/header/Actions.d.ts.map +1 -1
- package/dist/src/header/Header.d.ts.map +1 -1
- package/dist/src/hooks/index.d.ts +4 -4
- package/dist/src/hooks/index.d.ts.map +1 -1
- package/dist/src/hooks/ref.d.ts +1 -1
- package/dist/src/hooks/ref.d.ts.map +1 -1
- package/dist/src/hooks/useClickOutside.d.ts.map +1 -1
- package/dist/src/hooks/useCursorDrag/useCursorDrag.d.ts +1 -1
- package/dist/src/hooks/useCursorDrag/useCursorDrag.d.ts.map +1 -1
- package/dist/src/hooks/useCursorDrag/useVirtualCursorDragWebKit.d.ts.map +1 -1
- package/dist/src/hooks/useCursorDrag/useVirtualCursorDragWebView.d.ts.map +1 -1
- package/dist/src/hooks/useDebouncedCallback.d.ts.map +1 -1
- package/dist/src/hooks/useFilter.d.ts +1 -1
- package/dist/src/hooks/useFilter.d.ts.map +1 -1
- package/dist/src/hooks/useResize.d.ts +1 -1
- package/dist/src/hooks/useResize.d.ts.map +1 -1
- package/dist/src/hooks/useTransforms.d.ts.map +1 -1
- package/dist/src/hooks/useUniqueKey.d.ts.map +1 -1
- package/dist/src/index.d.ts +23 -22
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/input/Date.d.ts.map +1 -1
- package/dist/src/input/DateTime.d.ts.map +1 -1
- package/dist/src/input/DragButton.d.ts +1 -1
- package/dist/src/input/DragButton.d.ts.map +1 -1
- package/dist/src/input/HelpText.d.ts.map +1 -1
- package/dist/src/input/Item.d.ts.map +1 -1
- package/dist/src/input/Label.d.ts.map +1 -1
- package/dist/src/input/Numeric.d.ts.map +1 -1
- package/dist/src/input/Switch.d.ts.map +1 -1
- package/dist/src/input/Text.d.ts.map +1 -1
- package/dist/src/input/TextArea.d.ts.map +1 -1
- package/dist/src/input/Time.d.ts.map +1 -1
- package/dist/src/input/external.d.ts +4 -4
- package/dist/src/input/external.d.ts.map +1 -1
- package/dist/src/input/types.d.ts +1 -1
- package/dist/src/input/types.d.ts.map +1 -1
- package/dist/src/list/Column.d.ts +1 -1
- package/dist/src/list/Column.d.ts.map +1 -1
- package/dist/src/list/Core.d.ts +1 -1
- package/dist/src/list/Core.d.ts.map +1 -1
- package/dist/src/list/Data.d.ts +1 -1
- package/dist/src/list/Data.d.ts.map +1 -1
- package/dist/src/list/Filter.d.ts +1 -1
- package/dist/src/list/Filter.d.ts.map +1 -1
- package/dist/src/list/Hover.d.ts +1 -1
- package/dist/src/list/Hover.d.ts.map +1 -1
- package/dist/src/list/Infinite.d.ts.map +1 -1
- package/dist/src/list/Item.d.ts +3 -3
- package/dist/src/list/Item.d.ts.map +1 -1
- package/dist/src/list/List.d.ts +1 -1
- package/dist/src/list/List.d.ts.map +1 -1
- package/dist/src/list/Search.d.ts +1 -1
- package/dist/src/list/Search.d.ts.map +1 -1
- package/dist/src/list/Selector.d.ts +2 -2
- package/dist/src/list/Selector.d.ts.map +1 -1
- package/dist/src/list/external.d.ts +4 -4
- package/dist/src/list/external.d.ts.map +1 -1
- package/dist/src/list/useSelect.d.ts +18 -12
- package/dist/src/list/useSelect.d.ts.map +1 -1
- package/dist/src/memo/index.d.ts +1 -1
- package/dist/src/memo/index.d.ts.map +1 -1
- package/dist/src/memo/useMemoCompare.d.ts +1 -1
- package/dist/src/memo/useMemoCompare.d.ts.map +1 -1
- package/dist/src/menu/ContextMenu.d.ts +20 -13
- package/dist/src/menu/ContextMenu.d.ts.map +1 -1
- package/dist/src/menu/Item.d.ts.map +1 -1
- package/dist/src/menu/external.d.ts +1 -1
- package/dist/src/menu/external.d.ts.map +1 -1
- package/dist/src/mock/MockGLBufferController.d.ts.map +1 -1
- package/dist/src/mosaic/Mosaic.d.ts +2 -1
- package/dist/src/mosaic/Mosaic.d.ts.map +1 -1
- package/dist/src/mosaic/use.d.ts.map +1 -1
- package/dist/src/nav/Bar.d.ts +1 -1
- package/dist/src/nav/Bar.d.ts.map +1 -1
- package/dist/src/nav/Drawer.d.ts.map +1 -1
- package/dist/src/nav/external.d.ts +1 -1
- package/dist/src/nav/external.d.ts.map +1 -1
- package/dist/src/note/Note.d.ts.map +1 -1
- package/dist/src/note/index.d.ts.map +1 -1
- package/dist/src/os/Controls/Controls.d.ts +1 -1
- package/dist/src/os/Controls/Controls.d.ts.map +1 -1
- package/dist/src/os/Controls/Mac.d.ts.map +1 -1
- package/dist/src/os/Controls/Windows.d.ts.map +1 -1
- package/dist/src/os/Controls/index.d.ts +1 -1
- package/dist/src/os/Controls/index.d.ts.map +1 -1
- package/dist/src/os/use.d.ts +1 -1
- package/dist/src/os/use.d.ts.map +1 -1
- package/dist/src/pluto/Pluto.d.ts.map +1 -1
- package/dist/src/portal/Portal.d.ts.map +1 -1
- package/dist/src/portal/index.d.ts.map +1 -1
- package/dist/src/progress/Progress.d.ts.map +1 -1
- package/dist/src/ranger/SelectLabel.d.ts +1 -1
- package/dist/src/ranger/SelectLabel.d.ts.map +1 -1
- package/dist/src/ranger/TimeRangeChip.d.ts +1 -1
- package/dist/src/ranger/TimeRangeChip.d.ts.map +1 -1
- package/dist/src/ranger/external.d.ts +1 -1
- package/dist/src/ranger/external.d.ts.map +1 -1
- package/dist/src/resize/Core.d.ts +1 -1
- package/dist/src/resize/Core.d.ts.map +1 -1
- package/dist/src/resize/Multiple.d.ts +1 -1
- package/dist/src/resize/Multiple.d.ts.map +1 -1
- package/dist/src/resize/Single.d.ts +1 -1
- package/dist/src/resize/Single.d.ts.map +1 -1
- package/dist/src/select/Button.d.ts +1 -1
- package/dist/src/select/Button.d.ts.map +1 -1
- package/dist/src/select/ClearButton.d.ts.map +1 -1
- package/dist/src/select/DataType.d.ts.map +1 -1
- package/dist/src/select/Direction.d.ts +3 -3
- package/dist/src/select/Direction.d.ts.map +1 -1
- package/dist/src/select/List.d.ts +4 -4
- package/dist/src/select/List.d.ts.map +1 -1
- package/dist/src/select/Multiple.d.ts +1 -1
- package/dist/src/select/Multiple.d.ts.map +1 -1
- package/dist/src/select/Select.spec.d.ts.map +1 -1
- package/dist/src/select/Single.d.ts +2 -2
- package/dist/src/select/Single.d.ts.map +1 -1
- package/dist/src/select/external.d.ts +3 -3
- package/dist/src/select/external.d.ts.map +1 -1
- package/dist/src/state/state.d.ts +1 -1
- package/dist/src/state/state.d.ts.map +1 -1
- package/dist/src/status/Aggregator.d.ts +1 -1
- package/dist/src/status/Aggregator.d.ts.map +1 -1
- package/dist/src/status/Circle.d.ts +1 -1
- package/dist/src/status/Circle.d.ts.map +1 -1
- package/dist/src/status/Notification.d.ts +1 -1
- package/dist/src/status/Notification.d.ts.map +1 -1
- package/dist/src/status/Text.d.ts.map +1 -1
- package/dist/src/status/aether/aggregator.d.ts +12 -60
- package/dist/src/status/aether/aggregator.d.ts.map +1 -1
- package/dist/src/status/aether/external.d.ts +1 -1
- package/dist/src/status/aether/external.d.ts.map +1 -1
- package/dist/src/status/aether/types.d.ts +3 -15
- package/dist/src/status/aether/types.d.ts.map +1 -1
- package/dist/src/status/external.d.ts +1 -1
- package/dist/src/status/external.d.ts.map +1 -1
- package/dist/src/steps/Steps.d.ts.map +1 -1
- package/dist/src/synnax/Provider.d.ts +1 -1
- package/dist/src/synnax/Provider.d.ts.map +1 -1
- package/dist/src/synnax/aether/provider.d.ts +24 -24
- package/dist/src/tabs/Selector.d.ts +3 -1
- package/dist/src/tabs/Selector.d.ts.map +1 -1
- package/dist/src/tabs/Tabs.d.ts +2 -1
- package/dist/src/tabs/Tabs.d.ts.map +1 -1
- package/dist/src/tag/Tag.d.ts +1 -1
- package/dist/src/tag/Tag.d.ts.map +1 -1
- package/dist/src/telem/aether/convertSeries.d.ts +1 -1
- package/dist/src/telem/aether/convertSeries.d.ts.map +1 -1
- package/dist/src/telem/aether/external.d.ts +5 -5
- package/dist/src/telem/aether/external.d.ts.map +1 -1
- package/dist/src/telem/aether/noop.d.ts +1 -1
- package/dist/src/telem/aether/noop.d.ts.map +1 -1
- package/dist/src/telem/aether/pipeline.d.ts +21 -13
- package/dist/src/telem/aether/pipeline.d.ts.map +1 -1
- package/dist/src/telem/aether/remote.d.ts +34 -296
- package/dist/src/telem/aether/remote.d.ts.map +1 -1
- package/dist/src/telem/aether/static.d.ts +12 -10
- package/dist/src/telem/aether/static.d.ts.map +1 -1
- package/dist/src/telem/aether/telem.d.ts +99 -48
- package/dist/src/telem/aether/telem.d.ts.map +1 -1
- package/dist/src/telem/aether/transformers.d.ts +4 -4
- package/dist/src/telem/aether/transformers.d.ts.map +1 -1
- package/dist/src/telem/client/cache/cache.d.ts +2 -2
- package/dist/src/telem/client/cache/cache.d.ts.map +1 -1
- package/dist/src/telem/client/cache/dynamic.d.ts +1 -1
- package/dist/src/telem/client/cache/dynamic.d.ts.map +1 -1
- package/dist/src/telem/client/cache/static.d.ts +1 -1
- package/dist/src/telem/client/cache/static.d.ts.map +1 -1
- package/dist/src/telem/client/cache/unary.d.ts +1 -1
- package/dist/src/telem/client/cache/unary.d.ts.map +1 -1
- package/dist/src/telem/client/external.d.ts +1 -1
- package/dist/src/telem/client/external.d.ts.map +1 -1
- package/dist/src/telem/client/reader.d.ts +2 -2
- package/dist/src/telem/client/reader.d.ts.map +1 -1
- package/dist/src/telem/client/streamer.d.ts +1 -0
- package/dist/src/telem/client/streamer.d.ts.map +1 -1
- package/dist/src/telem/client/types.d.ts +1 -1
- package/dist/src/telem/client/types.d.ts.map +1 -1
- package/dist/src/telem/control/Chip.d.ts.map +1 -1
- package/dist/src/telem/control/Controller.d.ts +1 -1
- package/dist/src/telem/control/Controller.d.ts.map +1 -1
- package/dist/src/telem/control/Indicator.d.ts.map +1 -1
- package/dist/src/telem/control/Legend.d.ts.map +1 -1
- package/dist/src/telem/control/StateProvider.d.ts.map +1 -1
- package/dist/src/telem/control/aether/chip.d.ts +52 -84
- package/dist/src/telem/control/aether/chip.d.ts.map +1 -1
- package/dist/src/telem/control/aether/controller.d.ts +4 -4
- package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
- package/dist/src/telem/control/aether/external.d.ts +3 -3
- package/dist/src/telem/control/aether/external.d.ts.map +1 -1
- package/dist/src/telem/control/aether/indicator.d.ts +46 -78
- package/dist/src/telem/control/aether/indicator.d.ts.map +1 -1
- package/dist/src/telem/control/aether/legend.d.ts +33 -96
- package/dist/src/telem/control/aether/legend.d.ts.map +1 -1
- package/dist/src/telem/control/aether/state.d.ts +15 -29
- package/dist/src/telem/control/aether/state.d.ts.map +1 -1
- package/dist/src/telem/control/external.d.ts +3 -3
- package/dist/src/telem/control/external.d.ts.map +1 -1
- package/dist/src/telem/test/index.d.ts.map +1 -1
- package/dist/src/telem/test/mock.d.ts +2 -2
- package/dist/src/telem/test/mock.d.ts.map +1 -1
- package/dist/src/text/DateTime.d.ts +1 -1
- package/dist/src/text/DateTime.d.ts.map +1 -1
- package/dist/src/text/Editable.d.ts +1 -1
- package/dist/src/text/Editable.d.ts.map +1 -1
- package/dist/src/text/Keyboard.d.ts.map +1 -1
- package/dist/src/text/Link.d.ts.map +1 -1
- package/dist/src/text/Text.d.ts.map +1 -1
- package/dist/src/text/WithIcon.d.ts +1 -1
- package/dist/src/text/WithIcon.d.ts.map +1 -1
- package/dist/src/text/core/types.d.ts.map +1 -1
- package/dist/src/text/external.d.ts +3 -3
- package/dist/src/text/external.d.ts.map +1 -1
- package/dist/src/text/symbols.d.ts.map +1 -1
- package/dist/src/theming/Provider.d.ts +1 -1
- package/dist/src/theming/Provider.d.ts.map +1 -1
- package/dist/src/theming/aether/external.d.ts +1 -1
- package/dist/src/theming/aether/external.d.ts.map +1 -1
- package/dist/src/theming/aether/provider.d.ts.map +1 -1
- package/dist/src/theming/core/theme.d.ts +1220 -24196
- package/dist/src/theming/core/theme.d.ts.map +1 -1
- package/dist/src/theming/external.d.ts +1 -1
- package/dist/src/theming/external.d.ts.map +1 -1
- package/dist/src/tooltip/Config.d.ts +1 -1
- package/dist/src/tooltip/Config.d.ts.map +1 -1
- package/dist/src/tooltip/Dialog.d.ts +1 -1
- package/dist/src/tooltip/Dialog.d.ts.map +1 -1
- package/dist/src/tooltip/external.d.ts +1 -1
- package/dist/src/tooltip/wrap.d.ts.map +1 -1
- package/dist/src/tree/Tree.d.ts +10 -9
- package/dist/src/tree/Tree.d.ts.map +1 -1
- package/dist/src/tree/core.d.ts +8 -0
- package/dist/src/tree/core.d.ts.map +1 -1
- package/dist/src/tree/external.d.ts +1 -1
- package/dist/src/triggers/Provider.d.ts +2 -2
- package/dist/src/triggers/Provider.d.ts.map +1 -1
- package/dist/src/triggers/Text.d.ts.map +1 -1
- package/dist/src/triggers/external.d.ts +2 -2
- package/dist/src/triggers/external.d.ts.map +1 -1
- package/dist/src/triggers/hooks.d.ts +1 -1
- package/dist/src/triggers/hooks.d.ts.map +1 -1
- package/dist/src/triggers/useDrag.d.ts +1 -1
- package/dist/src/triggers/useDrag.d.ts.map +1 -1
- package/dist/src/util/children.d.ts.map +1 -1
- package/dist/src/video/Video.d.ts.map +1 -1
- package/dist/src/viewport/Mask.d.ts.map +1 -1
- package/dist/src/viewport/SelectMode.d.ts.map +1 -1
- package/dist/src/viewport/external.d.ts +1 -1
- package/dist/src/viewport/external.d.ts.map +1 -1
- package/dist/src/viewport/use.d.ts +2 -2
- package/dist/src/viewport/use.d.ts.map +1 -1
- package/dist/src/vis/axis/axis.d.ts +8 -38
- package/dist/src/vis/axis/axis.d.ts.map +1 -1
- package/dist/src/vis/axis/canvas.d.ts +1 -1
- package/dist/src/vis/axis/canvas.d.ts.map +1 -1
- package/dist/src/vis/axis/ticks.d.ts +1 -1
- package/dist/src/vis/button/aether/button.d.ts +14 -6
- package/dist/src/vis/button/aether/button.d.ts.map +1 -1
- package/dist/src/vis/button/use.d.ts.map +1 -1
- package/dist/src/vis/canvas/Canvas.d.ts +2 -2
- package/dist/src/vis/canvas/Canvas.d.ts.map +1 -1
- package/dist/src/vis/diagram/Diagram.d.ts +1 -1
- package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
- package/dist/src/vis/diagram/aether/Diagram.d.ts +6 -42
- package/dist/src/vis/diagram/aether/Diagram.d.ts.map +1 -1
- package/dist/src/vis/diagram/align.d.ts.map +1 -1
- package/dist/src/vis/diagram/edge/Edge.d.ts +2 -2
- package/dist/src/vis/diagram/edge/Edge.d.ts.map +1 -1
- package/dist/src/vis/diagram/edge/connector/connector.d.ts +1 -1
- package/dist/src/vis/diagram/edge/connector/connector.d.ts.map +1 -1
- package/dist/src/vis/diagram/external.d.ts +2 -2
- package/dist/src/vis/diagram/external.d.ts.map +1 -1
- package/dist/src/vis/diagram/util.d.ts +1 -1
- package/dist/src/vis/diagram/util.d.ts.map +1 -1
- package/dist/src/vis/draw2d/canvas.d.ts +1 -1
- package/dist/src/vis/draw2d/canvas.d.ts.map +1 -1
- package/dist/src/vis/draw2d/index.d.ts +1 -1
- package/dist/src/vis/draw2d/index.d.ts.map +1 -1
- package/dist/src/vis/eraser/use.d.ts +1 -1
- package/dist/src/vis/eraser/use.d.ts.map +1 -1
- package/dist/src/vis/legend/Container.d.ts +1 -1
- package/dist/src/vis/legend/Container.d.ts.map +1 -1
- package/dist/src/vis/line/Line.d.ts.map +1 -1
- package/dist/src/vis/line/aether/line.d.ts +17 -25
- package/dist/src/vis/line/aether/line.d.ts.map +1 -1
- package/dist/src/vis/lineplot/Axis.d.ts +2 -3
- package/dist/src/vis/lineplot/Axis.d.ts.map +1 -1
- package/dist/src/vis/lineplot/Legend.d.ts.map +1 -1
- package/dist/src/vis/lineplot/LinePlot.d.ts +1 -1
- package/dist/src/vis/lineplot/LinePlot.d.ts.map +1 -1
- package/dist/src/vis/lineplot/Viewport.d.ts.map +1 -1
- package/dist/src/vis/lineplot/aether/LinePlot.d.ts +4 -28
- package/dist/src/vis/lineplot/aether/LinePlot.d.ts.map +1 -1
- package/dist/src/vis/lineplot/aether/XAxis.d.ts +9 -15
- package/dist/src/vis/lineplot/aether/XAxis.d.ts.map +1 -1
- package/dist/src/vis/lineplot/aether/YAxis.d.ts +13 -17
- package/dist/src/vis/lineplot/aether/YAxis.d.ts.map +1 -1
- package/dist/src/vis/lineplot/aether/axis.d.ts +5 -8
- package/dist/src/vis/lineplot/aether/axis.d.ts.map +1 -1
- package/dist/src/vis/lineplot/aether/grid.d.ts.map +1 -1
- package/dist/src/vis/lineplot/external.d.ts +2 -2
- package/dist/src/vis/lineplot/external.d.ts.map +1 -1
- package/dist/src/vis/lineplot/range/Annotation.d.ts +1 -1
- package/dist/src/vis/lineplot/range/Annotation.d.ts.map +1 -1
- package/dist/src/vis/lineplot/range/Provider.d.ts +1 -1
- package/dist/src/vis/lineplot/range/Provider.d.ts.map +1 -1
- package/dist/src/vis/lineplot/range/aether/annotation.d.ts +7 -59
- package/dist/src/vis/lineplot/range/aether/annotation.d.ts.map +1 -1
- package/dist/src/vis/lineplot/range/aether/external.d.ts +1 -1
- package/dist/src/vis/lineplot/range/aether/external.d.ts.map +1 -1
- package/dist/src/vis/lineplot/range/aether/index.d.ts.map +1 -1
- package/dist/src/vis/lineplot/range/aether/provider.d.ts +70 -550
- package/dist/src/vis/lineplot/range/aether/provider.d.ts.map +1 -1
- package/dist/src/vis/lineplot/range/external.d.ts.map +1 -1
- package/dist/src/vis/lineplot/range/index.d.ts.map +1 -1
- package/dist/src/vis/lineplot/tooltip/Tooltip.d.ts.map +1 -1
- package/dist/src/vis/lineplot/tooltip/aether/tooltip.d.ts +6 -6
- package/dist/src/vis/lineplot/tooltip/aether/tooltip.d.ts.map +1 -1
- package/dist/src/vis/measure/Measure.d.ts.map +1 -1
- package/dist/src/vis/measure/aether/measure.d.ts +4 -12
- package/dist/src/vis/measure/aether/measure.d.ts.map +1 -1
- package/dist/src/vis/render/context.d.ts +1 -1
- package/dist/src/vis/render/context.d.ts.map +1 -1
- package/dist/src/vis/render/external.d.ts +1 -1
- package/dist/src/vis/render/external.d.ts.map +1 -1
- package/dist/src/vis/render/util.d.ts.map +1 -1
- package/dist/src/vis/rule/Rule.d.ts.map +1 -1
- package/dist/src/vis/rule/aether/aether.d.ts +4 -36
- package/dist/src/vis/rule/aether/aether.d.ts.map +1 -1
- package/dist/src/vis/schematic/Forms.d.ts.map +1 -1
- package/dist/src/vis/schematic/Labeled.d.ts.map +1 -1
- package/dist/src/vis/schematic/SelectOrientation.d.ts +1 -1
- package/dist/src/vis/schematic/SelectOrientation.d.ts.map +1 -1
- package/dist/src/vis/schematic/Symbols.d.ts +1 -1
- package/dist/src/vis/schematic/Symbols.d.ts.map +1 -1
- package/dist/src/vis/schematic/external.d.ts +1 -1
- package/dist/src/vis/schematic/external.d.ts.map +1 -1
- package/dist/src/vis/schematic/primitives/Primitives.d.ts +3 -3
- package/dist/src/vis/schematic/primitives/Primitives.d.ts.map +1 -1
- package/dist/src/vis/schematic/registry.d.ts.map +1 -1
- package/dist/src/vis/toggle/aether/toggle.d.ts +36 -20
- package/dist/src/vis/toggle/aether/toggle.d.ts.map +1 -1
- package/dist/src/vis/toggle/use.d.ts.map +1 -1
- package/dist/src/vis/value/aether/value.d.ts +42 -30
- package/dist/src/vis/value/aether/value.d.ts.map +1 -1
- package/dist/src/vis/value/use.d.ts +11 -6
- package/dist/src/vis/value/use.d.ts.map +1 -1
- package/dist/src/worker/Context.d.ts +1 -1
- package/dist/src/worker/Context.d.ts.map +1 -1
- package/dist/style.css +1 -3372
- package/dist/tabs.cjs +1 -5
- package/dist/tabs.js +2 -3
- package/dist/text.cjs +1 -6
- package/dist/text.js +3 -4
- package/dist/theming.cjs +1 -6
- package/dist/theming.js +3 -4
- package/dist/tree.cjs +1 -5
- package/dist/tree.js +2 -3
- package/dist/triggers.cjs +1 -5
- package/dist/triggers.js +2 -3
- package/dist/units-BsHX82D_.cjs +1 -0
- package/dist/units-DechjShe.js +8 -0
- package/dist/video.cjs +1 -5
- package/dist/video.js +2 -3
- package/package.json +15 -24
- package/dist/Center-BK9Rcaa0.js +0 -149
- package/dist/Center-BK9Rcaa0.js.map +0 -1
- package/dist/Center-Cc_rR5pQ.cjs +0 -148
- package/dist/Center-Cc_rR5pQ.cjs.map +0 -1
- package/dist/Keyboard-Byx8rGZt.cjs +0 -13
- package/dist/Keyboard-Byx8rGZt.cjs.map +0 -1
- package/dist/Keyboard-D31SwhYT.js +0 -14
- package/dist/Keyboard-D31SwhYT.js.map +0 -1
- package/dist/LinePlot-Bnb8Ufob.cjs +0 -14337
- package/dist/LinePlot-Bnb8Ufob.cjs.map +0 -1
- package/dist/LinePlot-KYwy1D7H.js +0 -14341
- package/dist/LinePlot-KYwy1D7H.js.map +0 -1
- package/dist/Link-Bq38h1dw.cjs +0 -12
- package/dist/Link-Bq38h1dw.cjs.map +0 -1
- package/dist/Link-DQKdkwWL.js +0 -13
- package/dist/Link-DQKdkwWL.js.map +0 -1
- package/dist/List-BmP_se57.js +0 -27
- package/dist/List-BmP_se57.js.map +0 -1
- package/dist/List-BnB-C5vQ.cjs +0 -26
- package/dist/List-BnB-C5vQ.cjs.map +0 -1
- package/dist/Toggle-D3iCEbO1.cjs +0 -59480
- package/dist/Toggle-D3iCEbO1.cjs.map +0 -1
- package/dist/Toggle-bT5RpwfA.js +0 -59465
- package/dist/Toggle-bT5RpwfA.js.map +0 -1
- package/dist/Video-B4sma9fk.cjs +0 -14
- package/dist/Video-B4sma9fk.cjs.map +0 -1
- package/dist/Video-Cp6XjjOK.js +0 -15
- package/dist/Video-Cp6XjjOK.js.map +0 -1
- package/dist/aggregator-B8fg7W2s.js +0 -19640
- package/dist/aggregator-B8fg7W2s.js.map +0 -1
- package/dist/aggregator-Bh2Kyzkg.cjs +0 -19639
- package/dist/aggregator-Bh2Kyzkg.cjs.map +0 -1
- package/dist/align.cjs.map +0 -1
- package/dist/align.js.map +0 -1
- package/dist/button.cjs.map +0 -1
- package/dist/button.js.map +0 -1
- package/dist/color-CjdRh-aN.js +0 -10
- package/dist/color-CjdRh-aN.js.map +0 -1
- package/dist/color-DBNbbjJy.cjs +0 -9
- package/dist/color-DBNbbjJy.cjs.map +0 -1
- package/dist/color.cjs.map +0 -1
- package/dist/color.js.map +0 -1
- package/dist/css-Ci8WUD5E.cjs +0 -4234
- package/dist/css-Ci8WUD5E.cjs.map +0 -1
- package/dist/css-DKKmdhSr.js +0 -4235
- package/dist/css-DKKmdhSr.js.map +0 -1
- package/dist/css.cjs.map +0 -1
- package/dist/css.js.map +0 -1
- package/dist/dropdown.cjs.map +0 -1
- package/dist/dropdown.js.map +0 -1
- package/dist/ether.cjs.map +0 -1
- package/dist/ether.js.map +0 -1
- package/dist/external-9_cqFQy3.cjs +0 -121
- package/dist/external-9_cqFQy3.cjs.map +0 -1
- package/dist/external-B-zN2e5z.cjs +0 -1507
- package/dist/external-B-zN2e5z.cjs.map +0 -1
- package/dist/external-BM82B8W2.js +0 -122
- package/dist/external-BM82B8W2.js.map +0 -1
- package/dist/external-BYqTC99W.js +0 -23
- package/dist/external-BYqTC99W.js.map +0 -1
- package/dist/external-BfZYUV3z.js +0 -157
- package/dist/external-BfZYUV3z.js.map +0 -1
- package/dist/external-BpqCp_M1.js +0 -15
- package/dist/external-BpqCp_M1.js.map +0 -1
- package/dist/external-BrW40HJx.js +0 -1508
- package/dist/external-BrW40HJx.js.map +0 -1
- package/dist/external-CAOQcoqL.js +0 -287
- package/dist/external-CAOQcoqL.js.map +0 -1
- package/dist/external-CIVsFXOp.cjs +0 -14
- package/dist/external-CIVsFXOp.cjs.map +0 -1
- package/dist/external-CnNdgPsB.js +0 -122
- package/dist/external-CnNdgPsB.js.map +0 -1
- package/dist/external-CwjCCHPi.js +0 -372
- package/dist/external-CwjCCHPi.js.map +0 -1
- package/dist/external-DNHMAfGi.js +0 -108
- package/dist/external-DNHMAfGi.js.map +0 -1
- package/dist/external-DVQ2SRoH.cjs +0 -121
- package/dist/external-DVQ2SRoH.cjs.map +0 -1
- package/dist/external-D_yXh8rn.cjs +0 -156
- package/dist/external-D_yXh8rn.cjs.map +0 -1
- package/dist/external-Df0D1YYb.cjs +0 -371
- package/dist/external-Df0D1YYb.cjs.map +0 -1
- package/dist/external-DhPBdJpR.cjs +0 -22
- package/dist/external-DhPBdJpR.cjs.map +0 -1
- package/dist/external-DhiN6pEk.cjs +0 -77
- package/dist/external-DhiN6pEk.cjs.map +0 -1
- package/dist/external-DjYXzP7v.cjs +0 -219
- package/dist/external-DjYXzP7v.cjs.map +0 -1
- package/dist/external-FWIwgLzc.js +0 -220
- package/dist/external-FWIwgLzc.js.map +0 -1
- package/dist/external-Iv2mRce8.cjs +0 -286
- package/dist/external-Iv2mRce8.cjs.map +0 -1
- package/dist/external-P6zP6dBA.cjs +0 -13
- package/dist/external-P6zP6dBA.cjs.map +0 -1
- package/dist/external-d-vI8EHK.cjs +0 -107
- package/dist/external-d-vI8EHK.cjs.map +0 -1
- package/dist/external-giUMrk8w.js +0 -78
- package/dist/external-giUMrk8w.js.map +0 -1
- package/dist/external-zG96smqq.js +0 -14
- package/dist/external-zG96smqq.js.map +0 -1
- package/dist/header.cjs.map +0 -1
- package/dist/header.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/input.cjs.map +0 -1
- package/dist/input.js.map +0 -1
- package/dist/jsx-runtime-B3vWrP5x.cjs +0 -941
- package/dist/jsx-runtime-B3vWrP5x.cjs.map +0 -1
- package/dist/jsx-runtime-mMz73N64.js +0 -942
- package/dist/jsx-runtime-mMz73N64.js.map +0 -1
- package/dist/list.cjs.map +0 -1
- package/dist/list.js.map +0 -1
- package/dist/menu.cjs.map +0 -1
- package/dist/menu.js.map +0 -1
- package/dist/tabs.cjs.map +0 -1
- package/dist/tabs.js.map +0 -1
- package/dist/text.cjs.map +0 -1
- package/dist/text.js.map +0 -1
- package/dist/theming.cjs.map +0 -1
- package/dist/theming.js.map +0 -1
- package/dist/tree.cjs.map +0 -1
- package/dist/tree.js.map +0 -1
- package/dist/triggers.cjs.map +0 -1
- package/dist/triggers.js.map +0 -1
- package/dist/video.cjs.map +0 -1
- package/dist/video.js.map +0 -1
|
@@ -1,1507 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const Toggle = require("./Toggle-D3iCEbO1.cjs");
|
|
3
|
-
const jsxRuntime = require("./jsx-runtime-B3vWrP5x.cjs");
|
|
4
|
-
const React = require("react");
|
|
5
|
-
const aggregator = require("./aggregator-Bh2Kyzkg.cjs");
|
|
6
|
-
require("./css-Ci8WUD5E.cjs");
|
|
7
|
-
require("./Center-Cc_rR5pQ.cjs");
|
|
8
|
-
const List = require("./List-BnB-C5vQ.cjs");
|
|
9
|
-
function isArray(value) {
|
|
10
|
-
return !Array.isArray ? getTag(value) === "[object Array]" : Array.isArray(value);
|
|
11
|
-
}
|
|
12
|
-
const INFINITY = 1 / 0;
|
|
13
|
-
function baseToString(value) {
|
|
14
|
-
if (typeof value == "string") {
|
|
15
|
-
return value;
|
|
16
|
-
}
|
|
17
|
-
let result = value + "";
|
|
18
|
-
return result == "0" && 1 / value == -INFINITY ? "-0" : result;
|
|
19
|
-
}
|
|
20
|
-
function toString(value) {
|
|
21
|
-
return value == null ? "" : baseToString(value);
|
|
22
|
-
}
|
|
23
|
-
function isString(value) {
|
|
24
|
-
return typeof value === "string";
|
|
25
|
-
}
|
|
26
|
-
function isNumber(value) {
|
|
27
|
-
return typeof value === "number";
|
|
28
|
-
}
|
|
29
|
-
function isBoolean(value) {
|
|
30
|
-
return value === true || value === false || isObjectLike(value) && getTag(value) == "[object Boolean]";
|
|
31
|
-
}
|
|
32
|
-
function isObject(value) {
|
|
33
|
-
return typeof value === "object";
|
|
34
|
-
}
|
|
35
|
-
function isObjectLike(value) {
|
|
36
|
-
return isObject(value) && value !== null;
|
|
37
|
-
}
|
|
38
|
-
function isDefined(value) {
|
|
39
|
-
return value !== void 0 && value !== null;
|
|
40
|
-
}
|
|
41
|
-
function isBlank(value) {
|
|
42
|
-
return !value.trim().length;
|
|
43
|
-
}
|
|
44
|
-
function getTag(value) {
|
|
45
|
-
return value == null ? value === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(value);
|
|
46
|
-
}
|
|
47
|
-
const EXTENDED_SEARCH_UNAVAILABLE = "Extended search is not available";
|
|
48
|
-
const INCORRECT_INDEX_TYPE = "Incorrect 'index' type";
|
|
49
|
-
const LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = (key) => `Invalid value for key ${key}`;
|
|
50
|
-
const PATTERN_LENGTH_TOO_LARGE = (max) => `Pattern length exceeds max of ${max}.`;
|
|
51
|
-
const MISSING_KEY_PROPERTY = (name) => `Missing ${name} property in key`;
|
|
52
|
-
const INVALID_KEY_WEIGHT_VALUE = (key) => `Property 'weight' in key '${key}' must be a positive integer`;
|
|
53
|
-
const hasOwn = Object.prototype.hasOwnProperty;
|
|
54
|
-
class KeyStore {
|
|
55
|
-
constructor(keys) {
|
|
56
|
-
this._keys = [];
|
|
57
|
-
this._keyMap = {};
|
|
58
|
-
let totalWeight = 0;
|
|
59
|
-
keys.forEach((key) => {
|
|
60
|
-
let obj = createKey(key);
|
|
61
|
-
this._keys.push(obj);
|
|
62
|
-
this._keyMap[obj.id] = obj;
|
|
63
|
-
totalWeight += obj.weight;
|
|
64
|
-
});
|
|
65
|
-
this._keys.forEach((key) => {
|
|
66
|
-
key.weight /= totalWeight;
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
get(keyId) {
|
|
70
|
-
return this._keyMap[keyId];
|
|
71
|
-
}
|
|
72
|
-
keys() {
|
|
73
|
-
return this._keys;
|
|
74
|
-
}
|
|
75
|
-
toJSON() {
|
|
76
|
-
return JSON.stringify(this._keys);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
function createKey(key) {
|
|
80
|
-
let path = null;
|
|
81
|
-
let id = null;
|
|
82
|
-
let src = null;
|
|
83
|
-
let weight = 1;
|
|
84
|
-
let getFn = null;
|
|
85
|
-
if (isString(key) || isArray(key)) {
|
|
86
|
-
src = key;
|
|
87
|
-
path = createKeyPath(key);
|
|
88
|
-
id = createKeyId(key);
|
|
89
|
-
} else {
|
|
90
|
-
if (!hasOwn.call(key, "name")) {
|
|
91
|
-
throw new Error(MISSING_KEY_PROPERTY("name"));
|
|
92
|
-
}
|
|
93
|
-
const name = key.name;
|
|
94
|
-
src = name;
|
|
95
|
-
if (hasOwn.call(key, "weight")) {
|
|
96
|
-
weight = key.weight;
|
|
97
|
-
if (weight <= 0) {
|
|
98
|
-
throw new Error(INVALID_KEY_WEIGHT_VALUE(name));
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
path = createKeyPath(name);
|
|
102
|
-
id = createKeyId(name);
|
|
103
|
-
getFn = key.getFn;
|
|
104
|
-
}
|
|
105
|
-
return { path, id, weight, src, getFn };
|
|
106
|
-
}
|
|
107
|
-
function createKeyPath(key) {
|
|
108
|
-
return isArray(key) ? key : key.split(".");
|
|
109
|
-
}
|
|
110
|
-
function createKeyId(key) {
|
|
111
|
-
return isArray(key) ? key.join(".") : key;
|
|
112
|
-
}
|
|
113
|
-
function get(obj, path) {
|
|
114
|
-
let list = [];
|
|
115
|
-
let arr = false;
|
|
116
|
-
const deepGet = (obj2, path2, index) => {
|
|
117
|
-
if (!isDefined(obj2)) {
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
if (!path2[index]) {
|
|
121
|
-
list.push(obj2);
|
|
122
|
-
} else {
|
|
123
|
-
let key = path2[index];
|
|
124
|
-
const value = obj2[key];
|
|
125
|
-
if (!isDefined(value)) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
if (index === path2.length - 1 && (isString(value) || isNumber(value) || isBoolean(value))) {
|
|
129
|
-
list.push(toString(value));
|
|
130
|
-
} else if (isArray(value)) {
|
|
131
|
-
arr = true;
|
|
132
|
-
for (let i2 = 0, len = value.length; i2 < len; i2 += 1) {
|
|
133
|
-
deepGet(value[i2], path2, index + 1);
|
|
134
|
-
}
|
|
135
|
-
} else if (path2.length) {
|
|
136
|
-
deepGet(value, path2, index + 1);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
deepGet(obj, isString(path) ? path.split(".") : path, 0);
|
|
141
|
-
return arr ? list : list[0];
|
|
142
|
-
}
|
|
143
|
-
const MatchOptions = {
|
|
144
|
-
// Whether the matches should be included in the result set. When `true`, each record in the result
|
|
145
|
-
// set will include the indices of the matched characters.
|
|
146
|
-
// These can consequently be used for highlighting purposes.
|
|
147
|
-
includeMatches: false,
|
|
148
|
-
// When `true`, the matching function will continue to the end of a search pattern even if
|
|
149
|
-
// a perfect match has already been located in the string.
|
|
150
|
-
findAllMatches: false,
|
|
151
|
-
// Minimum number of characters that must be matched before a result is considered a match
|
|
152
|
-
minMatchCharLength: 1
|
|
153
|
-
};
|
|
154
|
-
const BasicOptions = {
|
|
155
|
-
// When `true`, the algorithm continues searching to the end of the input even if a perfect
|
|
156
|
-
// match is found before the end of the same input.
|
|
157
|
-
isCaseSensitive: false,
|
|
158
|
-
// When true, the matching function will continue to the end of a search pattern even if
|
|
159
|
-
includeScore: false,
|
|
160
|
-
// List of properties that will be searched. This also supports nested properties.
|
|
161
|
-
keys: [],
|
|
162
|
-
// Whether to sort the result list, by score
|
|
163
|
-
shouldSort: true,
|
|
164
|
-
// Default sort function: sort by ascending score, ascending index
|
|
165
|
-
sortFn: (a2, b) => a2.score === b.score ? a2.idx < b.idx ? -1 : 1 : a2.score < b.score ? -1 : 1
|
|
166
|
-
};
|
|
167
|
-
const FuzzyOptions = {
|
|
168
|
-
// Approximately where in the text is the pattern expected to be found?
|
|
169
|
-
location: 0,
|
|
170
|
-
// At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
|
|
171
|
-
// (of both letters and location), a threshold of '1.0' would match anything.
|
|
172
|
-
threshold: 0.6,
|
|
173
|
-
// Determines how close the match must be to the fuzzy location (specified above).
|
|
174
|
-
// An exact letter match which is 'distance' characters away from the fuzzy location
|
|
175
|
-
// would score as a complete mismatch. A distance of '0' requires the match be at
|
|
176
|
-
// the exact location specified, a threshold of '1000' would require a perfect match
|
|
177
|
-
// to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
|
|
178
|
-
distance: 100
|
|
179
|
-
};
|
|
180
|
-
const AdvancedOptions = {
|
|
181
|
-
// When `true`, it enables the use of unix-like search commands
|
|
182
|
-
useExtendedSearch: false,
|
|
183
|
-
// The get function to use when fetching an object's properties.
|
|
184
|
-
// The default will search nested paths *ie foo.bar.baz*
|
|
185
|
-
getFn: get,
|
|
186
|
-
// When `true`, search will ignore `location` and `distance`, so it won't matter
|
|
187
|
-
// where in the string the pattern appears.
|
|
188
|
-
// More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score
|
|
189
|
-
ignoreLocation: false,
|
|
190
|
-
// When `true`, the calculation for the relevance score (used for sorting) will
|
|
191
|
-
// ignore the field-length norm.
|
|
192
|
-
// More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm
|
|
193
|
-
ignoreFieldNorm: false,
|
|
194
|
-
// The weight to determine how much field length norm effects scoring.
|
|
195
|
-
fieldNormWeight: 1
|
|
196
|
-
};
|
|
197
|
-
var Config = {
|
|
198
|
-
...BasicOptions,
|
|
199
|
-
...MatchOptions,
|
|
200
|
-
...FuzzyOptions,
|
|
201
|
-
...AdvancedOptions
|
|
202
|
-
};
|
|
203
|
-
const SPACE = /[^ ]+/g;
|
|
204
|
-
function norm(weight = 1, mantissa = 3) {
|
|
205
|
-
const cache = /* @__PURE__ */ new Map();
|
|
206
|
-
const m = Math.pow(10, mantissa);
|
|
207
|
-
return {
|
|
208
|
-
get(value) {
|
|
209
|
-
const numTokens = value.match(SPACE).length;
|
|
210
|
-
if (cache.has(numTokens)) {
|
|
211
|
-
return cache.get(numTokens);
|
|
212
|
-
}
|
|
213
|
-
const norm2 = 1 / Math.pow(numTokens, 0.5 * weight);
|
|
214
|
-
const n2 = parseFloat(Math.round(norm2 * m) / m);
|
|
215
|
-
cache.set(numTokens, n2);
|
|
216
|
-
return n2;
|
|
217
|
-
},
|
|
218
|
-
clear() {
|
|
219
|
-
cache.clear();
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
class FuseIndex {
|
|
224
|
-
constructor({
|
|
225
|
-
getFn = Config.getFn,
|
|
226
|
-
fieldNormWeight = Config.fieldNormWeight
|
|
227
|
-
} = {}) {
|
|
228
|
-
this.norm = norm(fieldNormWeight, 3);
|
|
229
|
-
this.getFn = getFn;
|
|
230
|
-
this.isCreated = false;
|
|
231
|
-
this.setIndexRecords();
|
|
232
|
-
}
|
|
233
|
-
setSources(docs = []) {
|
|
234
|
-
this.docs = docs;
|
|
235
|
-
}
|
|
236
|
-
setIndexRecords(records = []) {
|
|
237
|
-
this.records = records;
|
|
238
|
-
}
|
|
239
|
-
setKeys(keys = []) {
|
|
240
|
-
this.keys = keys;
|
|
241
|
-
this._keysMap = {};
|
|
242
|
-
keys.forEach((key, idx) => {
|
|
243
|
-
this._keysMap[key.id] = idx;
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
create() {
|
|
247
|
-
if (this.isCreated || !this.docs.length) {
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
this.isCreated = true;
|
|
251
|
-
if (isString(this.docs[0])) {
|
|
252
|
-
this.docs.forEach((doc, docIndex) => {
|
|
253
|
-
this._addString(doc, docIndex);
|
|
254
|
-
});
|
|
255
|
-
} else {
|
|
256
|
-
this.docs.forEach((doc, docIndex) => {
|
|
257
|
-
this._addObject(doc, docIndex);
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
this.norm.clear();
|
|
261
|
-
}
|
|
262
|
-
// Adds a doc to the end of the index
|
|
263
|
-
add(doc) {
|
|
264
|
-
const idx = this.size();
|
|
265
|
-
if (isString(doc)) {
|
|
266
|
-
this._addString(doc, idx);
|
|
267
|
-
} else {
|
|
268
|
-
this._addObject(doc, idx);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
// Removes the doc at the specified index of the index
|
|
272
|
-
removeAt(idx) {
|
|
273
|
-
this.records.splice(idx, 1);
|
|
274
|
-
for (let i2 = idx, len = this.size(); i2 < len; i2 += 1) {
|
|
275
|
-
this.records[i2].i -= 1;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
getValueForItemAtKeyId(item, keyId) {
|
|
279
|
-
return item[this._keysMap[keyId]];
|
|
280
|
-
}
|
|
281
|
-
size() {
|
|
282
|
-
return this.records.length;
|
|
283
|
-
}
|
|
284
|
-
_addString(doc, docIndex) {
|
|
285
|
-
if (!isDefined(doc) || isBlank(doc)) {
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
let record = {
|
|
289
|
-
v: doc,
|
|
290
|
-
i: docIndex,
|
|
291
|
-
n: this.norm.get(doc)
|
|
292
|
-
};
|
|
293
|
-
this.records.push(record);
|
|
294
|
-
}
|
|
295
|
-
_addObject(doc, docIndex) {
|
|
296
|
-
let record = { i: docIndex, $: {} };
|
|
297
|
-
this.keys.forEach((key, keyIndex) => {
|
|
298
|
-
let value = key.getFn ? key.getFn(doc) : this.getFn(doc, key.path);
|
|
299
|
-
if (!isDefined(value)) {
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
302
|
-
if (isArray(value)) {
|
|
303
|
-
let subRecords = [];
|
|
304
|
-
const stack = [{ nestedArrIndex: -1, value }];
|
|
305
|
-
while (stack.length) {
|
|
306
|
-
const { nestedArrIndex, value: value2 } = stack.pop();
|
|
307
|
-
if (!isDefined(value2)) {
|
|
308
|
-
continue;
|
|
309
|
-
}
|
|
310
|
-
if (isString(value2) && !isBlank(value2)) {
|
|
311
|
-
let subRecord = {
|
|
312
|
-
v: value2,
|
|
313
|
-
i: nestedArrIndex,
|
|
314
|
-
n: this.norm.get(value2)
|
|
315
|
-
};
|
|
316
|
-
subRecords.push(subRecord);
|
|
317
|
-
} else if (isArray(value2)) {
|
|
318
|
-
value2.forEach((item, k) => {
|
|
319
|
-
stack.push({
|
|
320
|
-
nestedArrIndex: k,
|
|
321
|
-
value: item
|
|
322
|
-
});
|
|
323
|
-
});
|
|
324
|
-
} else
|
|
325
|
-
;
|
|
326
|
-
}
|
|
327
|
-
record.$[keyIndex] = subRecords;
|
|
328
|
-
} else if (isString(value) && !isBlank(value)) {
|
|
329
|
-
let subRecord = {
|
|
330
|
-
v: value,
|
|
331
|
-
n: this.norm.get(value)
|
|
332
|
-
};
|
|
333
|
-
record.$[keyIndex] = subRecord;
|
|
334
|
-
}
|
|
335
|
-
});
|
|
336
|
-
this.records.push(record);
|
|
337
|
-
}
|
|
338
|
-
toJSON() {
|
|
339
|
-
return {
|
|
340
|
-
keys: this.keys,
|
|
341
|
-
records: this.records
|
|
342
|
-
};
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
function createIndex(keys, docs, { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}) {
|
|
346
|
-
const myIndex = new FuseIndex({ getFn, fieldNormWeight });
|
|
347
|
-
myIndex.setKeys(keys.map(createKey));
|
|
348
|
-
myIndex.setSources(docs);
|
|
349
|
-
myIndex.create();
|
|
350
|
-
return myIndex;
|
|
351
|
-
}
|
|
352
|
-
function parseIndex(data, { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}) {
|
|
353
|
-
const { keys, records } = data;
|
|
354
|
-
const myIndex = new FuseIndex({ getFn, fieldNormWeight });
|
|
355
|
-
myIndex.setKeys(keys);
|
|
356
|
-
myIndex.setIndexRecords(records);
|
|
357
|
-
return myIndex;
|
|
358
|
-
}
|
|
359
|
-
function computeScore$1(pattern, {
|
|
360
|
-
errors = 0,
|
|
361
|
-
currentLocation = 0,
|
|
362
|
-
expectedLocation = 0,
|
|
363
|
-
distance = Config.distance,
|
|
364
|
-
ignoreLocation = Config.ignoreLocation
|
|
365
|
-
} = {}) {
|
|
366
|
-
const accuracy = errors / pattern.length;
|
|
367
|
-
if (ignoreLocation) {
|
|
368
|
-
return accuracy;
|
|
369
|
-
}
|
|
370
|
-
const proximity = Math.abs(expectedLocation - currentLocation);
|
|
371
|
-
if (!distance) {
|
|
372
|
-
return proximity ? 1 : accuracy;
|
|
373
|
-
}
|
|
374
|
-
return accuracy + proximity / distance;
|
|
375
|
-
}
|
|
376
|
-
function convertMaskToIndices(matchmask = [], minMatchCharLength = Config.minMatchCharLength) {
|
|
377
|
-
let indices = [];
|
|
378
|
-
let start = -1;
|
|
379
|
-
let end = -1;
|
|
380
|
-
let i2 = 0;
|
|
381
|
-
for (let len = matchmask.length; i2 < len; i2 += 1) {
|
|
382
|
-
let match = matchmask[i2];
|
|
383
|
-
if (match && start === -1) {
|
|
384
|
-
start = i2;
|
|
385
|
-
} else if (!match && start !== -1) {
|
|
386
|
-
end = i2 - 1;
|
|
387
|
-
if (end - start + 1 >= minMatchCharLength) {
|
|
388
|
-
indices.push([start, end]);
|
|
389
|
-
}
|
|
390
|
-
start = -1;
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
if (matchmask[i2 - 1] && i2 - start >= minMatchCharLength) {
|
|
394
|
-
indices.push([start, i2 - 1]);
|
|
395
|
-
}
|
|
396
|
-
return indices;
|
|
397
|
-
}
|
|
398
|
-
const MAX_BITS = 32;
|
|
399
|
-
function search(text, pattern, patternAlphabet, {
|
|
400
|
-
location = Config.location,
|
|
401
|
-
distance = Config.distance,
|
|
402
|
-
threshold = Config.threshold,
|
|
403
|
-
findAllMatches = Config.findAllMatches,
|
|
404
|
-
minMatchCharLength = Config.minMatchCharLength,
|
|
405
|
-
includeMatches = Config.includeMatches,
|
|
406
|
-
ignoreLocation = Config.ignoreLocation
|
|
407
|
-
} = {}) {
|
|
408
|
-
if (pattern.length > MAX_BITS) {
|
|
409
|
-
throw new Error(PATTERN_LENGTH_TOO_LARGE(MAX_BITS));
|
|
410
|
-
}
|
|
411
|
-
const patternLen = pattern.length;
|
|
412
|
-
const textLen = text.length;
|
|
413
|
-
const expectedLocation = Math.max(0, Math.min(location, textLen));
|
|
414
|
-
let currentThreshold = threshold;
|
|
415
|
-
let bestLocation = expectedLocation;
|
|
416
|
-
const computeMatches = minMatchCharLength > 1 || includeMatches;
|
|
417
|
-
const matchMask = computeMatches ? Array(textLen) : [];
|
|
418
|
-
let index;
|
|
419
|
-
while ((index = text.indexOf(pattern, bestLocation)) > -1) {
|
|
420
|
-
let score = computeScore$1(pattern, {
|
|
421
|
-
currentLocation: index,
|
|
422
|
-
expectedLocation,
|
|
423
|
-
distance,
|
|
424
|
-
ignoreLocation
|
|
425
|
-
});
|
|
426
|
-
currentThreshold = Math.min(score, currentThreshold);
|
|
427
|
-
bestLocation = index + patternLen;
|
|
428
|
-
if (computeMatches) {
|
|
429
|
-
let i2 = 0;
|
|
430
|
-
while (i2 < patternLen) {
|
|
431
|
-
matchMask[index + i2] = 1;
|
|
432
|
-
i2 += 1;
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
bestLocation = -1;
|
|
437
|
-
let lastBitArr = [];
|
|
438
|
-
let finalScore = 1;
|
|
439
|
-
let binMax = patternLen + textLen;
|
|
440
|
-
const mask = 1 << patternLen - 1;
|
|
441
|
-
for (let i2 = 0; i2 < patternLen; i2 += 1) {
|
|
442
|
-
let binMin = 0;
|
|
443
|
-
let binMid = binMax;
|
|
444
|
-
while (binMin < binMid) {
|
|
445
|
-
const score2 = computeScore$1(pattern, {
|
|
446
|
-
errors: i2,
|
|
447
|
-
currentLocation: expectedLocation + binMid,
|
|
448
|
-
expectedLocation,
|
|
449
|
-
distance,
|
|
450
|
-
ignoreLocation
|
|
451
|
-
});
|
|
452
|
-
if (score2 <= currentThreshold) {
|
|
453
|
-
binMin = binMid;
|
|
454
|
-
} else {
|
|
455
|
-
binMax = binMid;
|
|
456
|
-
}
|
|
457
|
-
binMid = Math.floor((binMax - binMin) / 2 + binMin);
|
|
458
|
-
}
|
|
459
|
-
binMax = binMid;
|
|
460
|
-
let start = Math.max(1, expectedLocation - binMid + 1);
|
|
461
|
-
let finish = findAllMatches ? textLen : Math.min(expectedLocation + binMid, textLen) + patternLen;
|
|
462
|
-
let bitArr = Array(finish + 2);
|
|
463
|
-
bitArr[finish + 1] = (1 << i2) - 1;
|
|
464
|
-
for (let j = finish; j >= start; j -= 1) {
|
|
465
|
-
let currentLocation = j - 1;
|
|
466
|
-
let charMatch = patternAlphabet[text.charAt(currentLocation)];
|
|
467
|
-
if (computeMatches) {
|
|
468
|
-
matchMask[currentLocation] = +!!charMatch;
|
|
469
|
-
}
|
|
470
|
-
bitArr[j] = (bitArr[j + 1] << 1 | 1) & charMatch;
|
|
471
|
-
if (i2) {
|
|
472
|
-
bitArr[j] |= (lastBitArr[j + 1] | lastBitArr[j]) << 1 | 1 | lastBitArr[j + 1];
|
|
473
|
-
}
|
|
474
|
-
if (bitArr[j] & mask) {
|
|
475
|
-
finalScore = computeScore$1(pattern, {
|
|
476
|
-
errors: i2,
|
|
477
|
-
currentLocation,
|
|
478
|
-
expectedLocation,
|
|
479
|
-
distance,
|
|
480
|
-
ignoreLocation
|
|
481
|
-
});
|
|
482
|
-
if (finalScore <= currentThreshold) {
|
|
483
|
-
currentThreshold = finalScore;
|
|
484
|
-
bestLocation = currentLocation;
|
|
485
|
-
if (bestLocation <= expectedLocation) {
|
|
486
|
-
break;
|
|
487
|
-
}
|
|
488
|
-
start = Math.max(1, 2 * expectedLocation - bestLocation);
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
const score = computeScore$1(pattern, {
|
|
493
|
-
errors: i2 + 1,
|
|
494
|
-
currentLocation: expectedLocation,
|
|
495
|
-
expectedLocation,
|
|
496
|
-
distance,
|
|
497
|
-
ignoreLocation
|
|
498
|
-
});
|
|
499
|
-
if (score > currentThreshold) {
|
|
500
|
-
break;
|
|
501
|
-
}
|
|
502
|
-
lastBitArr = bitArr;
|
|
503
|
-
}
|
|
504
|
-
const result = {
|
|
505
|
-
isMatch: bestLocation >= 0,
|
|
506
|
-
// Count exact matches (those with a score of 0) to be "almost" exact
|
|
507
|
-
score: Math.max(1e-3, finalScore)
|
|
508
|
-
};
|
|
509
|
-
if (computeMatches) {
|
|
510
|
-
const indices = convertMaskToIndices(matchMask, minMatchCharLength);
|
|
511
|
-
if (!indices.length) {
|
|
512
|
-
result.isMatch = false;
|
|
513
|
-
} else if (includeMatches) {
|
|
514
|
-
result.indices = indices;
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
return result;
|
|
518
|
-
}
|
|
519
|
-
function createPatternAlphabet(pattern) {
|
|
520
|
-
let mask = {};
|
|
521
|
-
for (let i2 = 0, len = pattern.length; i2 < len; i2 += 1) {
|
|
522
|
-
const char = pattern.charAt(i2);
|
|
523
|
-
mask[char] = (mask[char] || 0) | 1 << len - i2 - 1;
|
|
524
|
-
}
|
|
525
|
-
return mask;
|
|
526
|
-
}
|
|
527
|
-
class BitapSearch {
|
|
528
|
-
constructor(pattern, {
|
|
529
|
-
location = Config.location,
|
|
530
|
-
threshold = Config.threshold,
|
|
531
|
-
distance = Config.distance,
|
|
532
|
-
includeMatches = Config.includeMatches,
|
|
533
|
-
findAllMatches = Config.findAllMatches,
|
|
534
|
-
minMatchCharLength = Config.minMatchCharLength,
|
|
535
|
-
isCaseSensitive = Config.isCaseSensitive,
|
|
536
|
-
ignoreLocation = Config.ignoreLocation
|
|
537
|
-
} = {}) {
|
|
538
|
-
this.options = {
|
|
539
|
-
location,
|
|
540
|
-
threshold,
|
|
541
|
-
distance,
|
|
542
|
-
includeMatches,
|
|
543
|
-
findAllMatches,
|
|
544
|
-
minMatchCharLength,
|
|
545
|
-
isCaseSensitive,
|
|
546
|
-
ignoreLocation
|
|
547
|
-
};
|
|
548
|
-
this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();
|
|
549
|
-
this.chunks = [];
|
|
550
|
-
if (!this.pattern.length) {
|
|
551
|
-
return;
|
|
552
|
-
}
|
|
553
|
-
const addChunk = (pattern2, startIndex) => {
|
|
554
|
-
this.chunks.push({
|
|
555
|
-
pattern: pattern2,
|
|
556
|
-
alphabet: createPatternAlphabet(pattern2),
|
|
557
|
-
startIndex
|
|
558
|
-
});
|
|
559
|
-
};
|
|
560
|
-
const len = this.pattern.length;
|
|
561
|
-
if (len > MAX_BITS) {
|
|
562
|
-
let i2 = 0;
|
|
563
|
-
const remainder = len % MAX_BITS;
|
|
564
|
-
const end = len - remainder;
|
|
565
|
-
while (i2 < end) {
|
|
566
|
-
addChunk(this.pattern.substr(i2, MAX_BITS), i2);
|
|
567
|
-
i2 += MAX_BITS;
|
|
568
|
-
}
|
|
569
|
-
if (remainder) {
|
|
570
|
-
const startIndex = len - MAX_BITS;
|
|
571
|
-
addChunk(this.pattern.substr(startIndex), startIndex);
|
|
572
|
-
}
|
|
573
|
-
} else {
|
|
574
|
-
addChunk(this.pattern, 0);
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
searchIn(text) {
|
|
578
|
-
const { isCaseSensitive, includeMatches } = this.options;
|
|
579
|
-
if (!isCaseSensitive) {
|
|
580
|
-
text = text.toLowerCase();
|
|
581
|
-
}
|
|
582
|
-
if (this.pattern === text) {
|
|
583
|
-
let result2 = {
|
|
584
|
-
isMatch: true,
|
|
585
|
-
score: 0
|
|
586
|
-
};
|
|
587
|
-
if (includeMatches) {
|
|
588
|
-
result2.indices = [[0, text.length - 1]];
|
|
589
|
-
}
|
|
590
|
-
return result2;
|
|
591
|
-
}
|
|
592
|
-
const {
|
|
593
|
-
location,
|
|
594
|
-
distance,
|
|
595
|
-
threshold,
|
|
596
|
-
findAllMatches,
|
|
597
|
-
minMatchCharLength,
|
|
598
|
-
ignoreLocation
|
|
599
|
-
} = this.options;
|
|
600
|
-
let allIndices = [];
|
|
601
|
-
let totalScore = 0;
|
|
602
|
-
let hasMatches = false;
|
|
603
|
-
this.chunks.forEach(({ pattern, alphabet, startIndex }) => {
|
|
604
|
-
const { isMatch, score, indices } = search(text, pattern, alphabet, {
|
|
605
|
-
location: location + startIndex,
|
|
606
|
-
distance,
|
|
607
|
-
threshold,
|
|
608
|
-
findAllMatches,
|
|
609
|
-
minMatchCharLength,
|
|
610
|
-
includeMatches,
|
|
611
|
-
ignoreLocation
|
|
612
|
-
});
|
|
613
|
-
if (isMatch) {
|
|
614
|
-
hasMatches = true;
|
|
615
|
-
}
|
|
616
|
-
totalScore += score;
|
|
617
|
-
if (isMatch && indices) {
|
|
618
|
-
allIndices = [...allIndices, ...indices];
|
|
619
|
-
}
|
|
620
|
-
});
|
|
621
|
-
let result = {
|
|
622
|
-
isMatch: hasMatches,
|
|
623
|
-
score: hasMatches ? totalScore / this.chunks.length : 1
|
|
624
|
-
};
|
|
625
|
-
if (hasMatches && includeMatches) {
|
|
626
|
-
result.indices = allIndices;
|
|
627
|
-
}
|
|
628
|
-
return result;
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
class BaseMatch {
|
|
632
|
-
constructor(pattern) {
|
|
633
|
-
this.pattern = pattern;
|
|
634
|
-
}
|
|
635
|
-
static isMultiMatch(pattern) {
|
|
636
|
-
return getMatch(pattern, this.multiRegex);
|
|
637
|
-
}
|
|
638
|
-
static isSingleMatch(pattern) {
|
|
639
|
-
return getMatch(pattern, this.singleRegex);
|
|
640
|
-
}
|
|
641
|
-
search() {
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
function getMatch(pattern, exp) {
|
|
645
|
-
const matches = pattern.match(exp);
|
|
646
|
-
return matches ? matches[1] : null;
|
|
647
|
-
}
|
|
648
|
-
class ExactMatch extends BaseMatch {
|
|
649
|
-
constructor(pattern) {
|
|
650
|
-
super(pattern);
|
|
651
|
-
}
|
|
652
|
-
static get type() {
|
|
653
|
-
return "exact";
|
|
654
|
-
}
|
|
655
|
-
static get multiRegex() {
|
|
656
|
-
return /^="(.*)"$/;
|
|
657
|
-
}
|
|
658
|
-
static get singleRegex() {
|
|
659
|
-
return /^=(.*)$/;
|
|
660
|
-
}
|
|
661
|
-
search(text) {
|
|
662
|
-
const isMatch = text === this.pattern;
|
|
663
|
-
return {
|
|
664
|
-
isMatch,
|
|
665
|
-
score: isMatch ? 0 : 1,
|
|
666
|
-
indices: [0, this.pattern.length - 1]
|
|
667
|
-
};
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
class InverseExactMatch extends BaseMatch {
|
|
671
|
-
constructor(pattern) {
|
|
672
|
-
super(pattern);
|
|
673
|
-
}
|
|
674
|
-
static get type() {
|
|
675
|
-
return "inverse-exact";
|
|
676
|
-
}
|
|
677
|
-
static get multiRegex() {
|
|
678
|
-
return /^!"(.*)"$/;
|
|
679
|
-
}
|
|
680
|
-
static get singleRegex() {
|
|
681
|
-
return /^!(.*)$/;
|
|
682
|
-
}
|
|
683
|
-
search(text) {
|
|
684
|
-
const index = text.indexOf(this.pattern);
|
|
685
|
-
const isMatch = index === -1;
|
|
686
|
-
return {
|
|
687
|
-
isMatch,
|
|
688
|
-
score: isMatch ? 0 : 1,
|
|
689
|
-
indices: [0, text.length - 1]
|
|
690
|
-
};
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
class PrefixExactMatch extends BaseMatch {
|
|
694
|
-
constructor(pattern) {
|
|
695
|
-
super(pattern);
|
|
696
|
-
}
|
|
697
|
-
static get type() {
|
|
698
|
-
return "prefix-exact";
|
|
699
|
-
}
|
|
700
|
-
static get multiRegex() {
|
|
701
|
-
return /^\^"(.*)"$/;
|
|
702
|
-
}
|
|
703
|
-
static get singleRegex() {
|
|
704
|
-
return /^\^(.*)$/;
|
|
705
|
-
}
|
|
706
|
-
search(text) {
|
|
707
|
-
const isMatch = text.startsWith(this.pattern);
|
|
708
|
-
return {
|
|
709
|
-
isMatch,
|
|
710
|
-
score: isMatch ? 0 : 1,
|
|
711
|
-
indices: [0, this.pattern.length - 1]
|
|
712
|
-
};
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
class InversePrefixExactMatch extends BaseMatch {
|
|
716
|
-
constructor(pattern) {
|
|
717
|
-
super(pattern);
|
|
718
|
-
}
|
|
719
|
-
static get type() {
|
|
720
|
-
return "inverse-prefix-exact";
|
|
721
|
-
}
|
|
722
|
-
static get multiRegex() {
|
|
723
|
-
return /^!\^"(.*)"$/;
|
|
724
|
-
}
|
|
725
|
-
static get singleRegex() {
|
|
726
|
-
return /^!\^(.*)$/;
|
|
727
|
-
}
|
|
728
|
-
search(text) {
|
|
729
|
-
const isMatch = !text.startsWith(this.pattern);
|
|
730
|
-
return {
|
|
731
|
-
isMatch,
|
|
732
|
-
score: isMatch ? 0 : 1,
|
|
733
|
-
indices: [0, text.length - 1]
|
|
734
|
-
};
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
class SuffixExactMatch extends BaseMatch {
|
|
738
|
-
constructor(pattern) {
|
|
739
|
-
super(pattern);
|
|
740
|
-
}
|
|
741
|
-
static get type() {
|
|
742
|
-
return "suffix-exact";
|
|
743
|
-
}
|
|
744
|
-
static get multiRegex() {
|
|
745
|
-
return /^"(.*)"\$$/;
|
|
746
|
-
}
|
|
747
|
-
static get singleRegex() {
|
|
748
|
-
return /^(.*)\$$/;
|
|
749
|
-
}
|
|
750
|
-
search(text) {
|
|
751
|
-
const isMatch = text.endsWith(this.pattern);
|
|
752
|
-
return {
|
|
753
|
-
isMatch,
|
|
754
|
-
score: isMatch ? 0 : 1,
|
|
755
|
-
indices: [text.length - this.pattern.length, text.length - 1]
|
|
756
|
-
};
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
class InverseSuffixExactMatch extends BaseMatch {
|
|
760
|
-
constructor(pattern) {
|
|
761
|
-
super(pattern);
|
|
762
|
-
}
|
|
763
|
-
static get type() {
|
|
764
|
-
return "inverse-suffix-exact";
|
|
765
|
-
}
|
|
766
|
-
static get multiRegex() {
|
|
767
|
-
return /^!"(.*)"\$$/;
|
|
768
|
-
}
|
|
769
|
-
static get singleRegex() {
|
|
770
|
-
return /^!(.*)\$$/;
|
|
771
|
-
}
|
|
772
|
-
search(text) {
|
|
773
|
-
const isMatch = !text.endsWith(this.pattern);
|
|
774
|
-
return {
|
|
775
|
-
isMatch,
|
|
776
|
-
score: isMatch ? 0 : 1,
|
|
777
|
-
indices: [0, text.length - 1]
|
|
778
|
-
};
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
class FuzzyMatch extends BaseMatch {
|
|
782
|
-
constructor(pattern, {
|
|
783
|
-
location = Config.location,
|
|
784
|
-
threshold = Config.threshold,
|
|
785
|
-
distance = Config.distance,
|
|
786
|
-
includeMatches = Config.includeMatches,
|
|
787
|
-
findAllMatches = Config.findAllMatches,
|
|
788
|
-
minMatchCharLength = Config.minMatchCharLength,
|
|
789
|
-
isCaseSensitive = Config.isCaseSensitive,
|
|
790
|
-
ignoreLocation = Config.ignoreLocation
|
|
791
|
-
} = {}) {
|
|
792
|
-
super(pattern);
|
|
793
|
-
this._bitapSearch = new BitapSearch(pattern, {
|
|
794
|
-
location,
|
|
795
|
-
threshold,
|
|
796
|
-
distance,
|
|
797
|
-
includeMatches,
|
|
798
|
-
findAllMatches,
|
|
799
|
-
minMatchCharLength,
|
|
800
|
-
isCaseSensitive,
|
|
801
|
-
ignoreLocation
|
|
802
|
-
});
|
|
803
|
-
}
|
|
804
|
-
static get type() {
|
|
805
|
-
return "fuzzy";
|
|
806
|
-
}
|
|
807
|
-
static get multiRegex() {
|
|
808
|
-
return /^"(.*)"$/;
|
|
809
|
-
}
|
|
810
|
-
static get singleRegex() {
|
|
811
|
-
return /^(.*)$/;
|
|
812
|
-
}
|
|
813
|
-
search(text) {
|
|
814
|
-
return this._bitapSearch.searchIn(text);
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
class IncludeMatch extends BaseMatch {
|
|
818
|
-
constructor(pattern) {
|
|
819
|
-
super(pattern);
|
|
820
|
-
}
|
|
821
|
-
static get type() {
|
|
822
|
-
return "include";
|
|
823
|
-
}
|
|
824
|
-
static get multiRegex() {
|
|
825
|
-
return /^'"(.*)"$/;
|
|
826
|
-
}
|
|
827
|
-
static get singleRegex() {
|
|
828
|
-
return /^'(.*)$/;
|
|
829
|
-
}
|
|
830
|
-
search(text) {
|
|
831
|
-
let location = 0;
|
|
832
|
-
let index;
|
|
833
|
-
const indices = [];
|
|
834
|
-
const patternLen = this.pattern.length;
|
|
835
|
-
while ((index = text.indexOf(this.pattern, location)) > -1) {
|
|
836
|
-
location = index + patternLen;
|
|
837
|
-
indices.push([index, location - 1]);
|
|
838
|
-
}
|
|
839
|
-
const isMatch = !!indices.length;
|
|
840
|
-
return {
|
|
841
|
-
isMatch,
|
|
842
|
-
score: isMatch ? 0 : 1,
|
|
843
|
-
indices
|
|
844
|
-
};
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
const searchers = [
|
|
848
|
-
ExactMatch,
|
|
849
|
-
IncludeMatch,
|
|
850
|
-
PrefixExactMatch,
|
|
851
|
-
InversePrefixExactMatch,
|
|
852
|
-
InverseSuffixExactMatch,
|
|
853
|
-
SuffixExactMatch,
|
|
854
|
-
InverseExactMatch,
|
|
855
|
-
FuzzyMatch
|
|
856
|
-
];
|
|
857
|
-
const searchersLen = searchers.length;
|
|
858
|
-
const SPACE_RE = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;
|
|
859
|
-
const OR_TOKEN = "|";
|
|
860
|
-
function parseQuery(pattern, options = {}) {
|
|
861
|
-
return pattern.split(OR_TOKEN).map((item) => {
|
|
862
|
-
let query = item.trim().split(SPACE_RE).filter((item2) => item2 && !!item2.trim());
|
|
863
|
-
let results = [];
|
|
864
|
-
for (let i2 = 0, len = query.length; i2 < len; i2 += 1) {
|
|
865
|
-
const queryItem = query[i2];
|
|
866
|
-
let found = false;
|
|
867
|
-
let idx = -1;
|
|
868
|
-
while (!found && ++idx < searchersLen) {
|
|
869
|
-
const searcher = searchers[idx];
|
|
870
|
-
let token = searcher.isMultiMatch(queryItem);
|
|
871
|
-
if (token) {
|
|
872
|
-
results.push(new searcher(token, options));
|
|
873
|
-
found = true;
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
|
-
if (found) {
|
|
877
|
-
continue;
|
|
878
|
-
}
|
|
879
|
-
idx = -1;
|
|
880
|
-
while (++idx < searchersLen) {
|
|
881
|
-
const searcher = searchers[idx];
|
|
882
|
-
let token = searcher.isSingleMatch(queryItem);
|
|
883
|
-
if (token) {
|
|
884
|
-
results.push(new searcher(token, options));
|
|
885
|
-
break;
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
return results;
|
|
890
|
-
});
|
|
891
|
-
}
|
|
892
|
-
const MultiMatchSet = /* @__PURE__ */ new Set([FuzzyMatch.type, IncludeMatch.type]);
|
|
893
|
-
class ExtendedSearch {
|
|
894
|
-
constructor(pattern, {
|
|
895
|
-
isCaseSensitive = Config.isCaseSensitive,
|
|
896
|
-
includeMatches = Config.includeMatches,
|
|
897
|
-
minMatchCharLength = Config.minMatchCharLength,
|
|
898
|
-
ignoreLocation = Config.ignoreLocation,
|
|
899
|
-
findAllMatches = Config.findAllMatches,
|
|
900
|
-
location = Config.location,
|
|
901
|
-
threshold = Config.threshold,
|
|
902
|
-
distance = Config.distance
|
|
903
|
-
} = {}) {
|
|
904
|
-
this.query = null;
|
|
905
|
-
this.options = {
|
|
906
|
-
isCaseSensitive,
|
|
907
|
-
includeMatches,
|
|
908
|
-
minMatchCharLength,
|
|
909
|
-
findAllMatches,
|
|
910
|
-
ignoreLocation,
|
|
911
|
-
location,
|
|
912
|
-
threshold,
|
|
913
|
-
distance
|
|
914
|
-
};
|
|
915
|
-
this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();
|
|
916
|
-
this.query = parseQuery(this.pattern, this.options);
|
|
917
|
-
}
|
|
918
|
-
static condition(_, options) {
|
|
919
|
-
return options.useExtendedSearch;
|
|
920
|
-
}
|
|
921
|
-
searchIn(text) {
|
|
922
|
-
const query = this.query;
|
|
923
|
-
if (!query) {
|
|
924
|
-
return {
|
|
925
|
-
isMatch: false,
|
|
926
|
-
score: 1
|
|
927
|
-
};
|
|
928
|
-
}
|
|
929
|
-
const { includeMatches, isCaseSensitive } = this.options;
|
|
930
|
-
text = isCaseSensitive ? text : text.toLowerCase();
|
|
931
|
-
let numMatches = 0;
|
|
932
|
-
let allIndices = [];
|
|
933
|
-
let totalScore = 0;
|
|
934
|
-
for (let i2 = 0, qLen = query.length; i2 < qLen; i2 += 1) {
|
|
935
|
-
const searchers2 = query[i2];
|
|
936
|
-
allIndices.length = 0;
|
|
937
|
-
numMatches = 0;
|
|
938
|
-
for (let j = 0, pLen = searchers2.length; j < pLen; j += 1) {
|
|
939
|
-
const searcher = searchers2[j];
|
|
940
|
-
const { isMatch, indices, score } = searcher.search(text);
|
|
941
|
-
if (isMatch) {
|
|
942
|
-
numMatches += 1;
|
|
943
|
-
totalScore += score;
|
|
944
|
-
if (includeMatches) {
|
|
945
|
-
const type = searcher.constructor.type;
|
|
946
|
-
if (MultiMatchSet.has(type)) {
|
|
947
|
-
allIndices = [...allIndices, ...indices];
|
|
948
|
-
} else {
|
|
949
|
-
allIndices.push(indices);
|
|
950
|
-
}
|
|
951
|
-
}
|
|
952
|
-
} else {
|
|
953
|
-
totalScore = 0;
|
|
954
|
-
numMatches = 0;
|
|
955
|
-
allIndices.length = 0;
|
|
956
|
-
break;
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
if (numMatches) {
|
|
960
|
-
let result = {
|
|
961
|
-
isMatch: true,
|
|
962
|
-
score: totalScore / numMatches
|
|
963
|
-
};
|
|
964
|
-
if (includeMatches) {
|
|
965
|
-
result.indices = allIndices;
|
|
966
|
-
}
|
|
967
|
-
return result;
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
return {
|
|
971
|
-
isMatch: false,
|
|
972
|
-
score: 1
|
|
973
|
-
};
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
const registeredSearchers = [];
|
|
977
|
-
function register(...args) {
|
|
978
|
-
registeredSearchers.push(...args);
|
|
979
|
-
}
|
|
980
|
-
function createSearcher(pattern, options) {
|
|
981
|
-
for (let i2 = 0, len = registeredSearchers.length; i2 < len; i2 += 1) {
|
|
982
|
-
let searcherClass = registeredSearchers[i2];
|
|
983
|
-
if (searcherClass.condition(pattern, options)) {
|
|
984
|
-
return new searcherClass(pattern, options);
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
return new BitapSearch(pattern, options);
|
|
988
|
-
}
|
|
989
|
-
const LogicalOperator = {
|
|
990
|
-
AND: "$and",
|
|
991
|
-
OR: "$or"
|
|
992
|
-
};
|
|
993
|
-
const KeyType = {
|
|
994
|
-
PATH: "$path",
|
|
995
|
-
PATTERN: "$val"
|
|
996
|
-
};
|
|
997
|
-
const isExpression = (query) => !!(query[LogicalOperator.AND] || query[LogicalOperator.OR]);
|
|
998
|
-
const isPath = (query) => !!query[KeyType.PATH];
|
|
999
|
-
const isLeaf = (query) => !isArray(query) && isObject(query) && !isExpression(query);
|
|
1000
|
-
const convertToExplicit = (query) => ({
|
|
1001
|
-
[LogicalOperator.AND]: Object.keys(query).map((key) => ({
|
|
1002
|
-
[key]: query[key]
|
|
1003
|
-
}))
|
|
1004
|
-
});
|
|
1005
|
-
function parse(query, options, { auto = true } = {}) {
|
|
1006
|
-
const next = (query2) => {
|
|
1007
|
-
let keys = Object.keys(query2);
|
|
1008
|
-
const isQueryPath = isPath(query2);
|
|
1009
|
-
if (!isQueryPath && keys.length > 1 && !isExpression(query2)) {
|
|
1010
|
-
return next(convertToExplicit(query2));
|
|
1011
|
-
}
|
|
1012
|
-
if (isLeaf(query2)) {
|
|
1013
|
-
const key = isQueryPath ? query2[KeyType.PATH] : keys[0];
|
|
1014
|
-
const pattern = isQueryPath ? query2[KeyType.PATTERN] : query2[key];
|
|
1015
|
-
if (!isString(pattern)) {
|
|
1016
|
-
throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key));
|
|
1017
|
-
}
|
|
1018
|
-
const obj = {
|
|
1019
|
-
keyId: createKeyId(key),
|
|
1020
|
-
pattern
|
|
1021
|
-
};
|
|
1022
|
-
if (auto) {
|
|
1023
|
-
obj.searcher = createSearcher(pattern, options);
|
|
1024
|
-
}
|
|
1025
|
-
return obj;
|
|
1026
|
-
}
|
|
1027
|
-
let node = {
|
|
1028
|
-
children: [],
|
|
1029
|
-
operator: keys[0]
|
|
1030
|
-
};
|
|
1031
|
-
keys.forEach((key) => {
|
|
1032
|
-
const value = query2[key];
|
|
1033
|
-
if (isArray(value)) {
|
|
1034
|
-
value.forEach((item) => {
|
|
1035
|
-
node.children.push(next(item));
|
|
1036
|
-
});
|
|
1037
|
-
}
|
|
1038
|
-
});
|
|
1039
|
-
return node;
|
|
1040
|
-
};
|
|
1041
|
-
if (!isExpression(query)) {
|
|
1042
|
-
query = convertToExplicit(query);
|
|
1043
|
-
}
|
|
1044
|
-
return next(query);
|
|
1045
|
-
}
|
|
1046
|
-
function computeScore(results, { ignoreFieldNorm = Config.ignoreFieldNorm }) {
|
|
1047
|
-
results.forEach((result) => {
|
|
1048
|
-
let totalScore = 1;
|
|
1049
|
-
result.matches.forEach(({ key, norm: norm2, score }) => {
|
|
1050
|
-
const weight = key ? key.weight : null;
|
|
1051
|
-
totalScore *= Math.pow(
|
|
1052
|
-
score === 0 && weight ? Number.EPSILON : score,
|
|
1053
|
-
(weight || 1) * (ignoreFieldNorm ? 1 : norm2)
|
|
1054
|
-
);
|
|
1055
|
-
});
|
|
1056
|
-
result.score = totalScore;
|
|
1057
|
-
});
|
|
1058
|
-
}
|
|
1059
|
-
function transformMatches(result, data) {
|
|
1060
|
-
const matches = result.matches;
|
|
1061
|
-
data.matches = [];
|
|
1062
|
-
if (!isDefined(matches)) {
|
|
1063
|
-
return;
|
|
1064
|
-
}
|
|
1065
|
-
matches.forEach((match) => {
|
|
1066
|
-
if (!isDefined(match.indices) || !match.indices.length) {
|
|
1067
|
-
return;
|
|
1068
|
-
}
|
|
1069
|
-
const { indices, value } = match;
|
|
1070
|
-
let obj = {
|
|
1071
|
-
indices,
|
|
1072
|
-
value
|
|
1073
|
-
};
|
|
1074
|
-
if (match.key) {
|
|
1075
|
-
obj.key = match.key.src;
|
|
1076
|
-
}
|
|
1077
|
-
if (match.idx > -1) {
|
|
1078
|
-
obj.refIndex = match.idx;
|
|
1079
|
-
}
|
|
1080
|
-
data.matches.push(obj);
|
|
1081
|
-
});
|
|
1082
|
-
}
|
|
1083
|
-
function transformScore(result, data) {
|
|
1084
|
-
data.score = result.score;
|
|
1085
|
-
}
|
|
1086
|
-
function format(results, docs, {
|
|
1087
|
-
includeMatches = Config.includeMatches,
|
|
1088
|
-
includeScore = Config.includeScore
|
|
1089
|
-
} = {}) {
|
|
1090
|
-
const transformers = [];
|
|
1091
|
-
if (includeMatches)
|
|
1092
|
-
transformers.push(transformMatches);
|
|
1093
|
-
if (includeScore)
|
|
1094
|
-
transformers.push(transformScore);
|
|
1095
|
-
return results.map((result) => {
|
|
1096
|
-
const { idx } = result;
|
|
1097
|
-
const data = {
|
|
1098
|
-
item: docs[idx],
|
|
1099
|
-
refIndex: idx
|
|
1100
|
-
};
|
|
1101
|
-
if (transformers.length) {
|
|
1102
|
-
transformers.forEach((transformer) => {
|
|
1103
|
-
transformer(result, data);
|
|
1104
|
-
});
|
|
1105
|
-
}
|
|
1106
|
-
return data;
|
|
1107
|
-
});
|
|
1108
|
-
}
|
|
1109
|
-
class Fuse {
|
|
1110
|
-
constructor(docs, options = {}, index) {
|
|
1111
|
-
this.options = { ...Config, ...options };
|
|
1112
|
-
if (this.options.useExtendedSearch && false) {
|
|
1113
|
-
throw new Error(EXTENDED_SEARCH_UNAVAILABLE);
|
|
1114
|
-
}
|
|
1115
|
-
this._keyStore = new KeyStore(this.options.keys);
|
|
1116
|
-
this.setCollection(docs, index);
|
|
1117
|
-
}
|
|
1118
|
-
setCollection(docs, index) {
|
|
1119
|
-
this._docs = docs;
|
|
1120
|
-
if (index && !(index instanceof FuseIndex)) {
|
|
1121
|
-
throw new Error(INCORRECT_INDEX_TYPE);
|
|
1122
|
-
}
|
|
1123
|
-
this._myIndex = index || createIndex(this.options.keys, this._docs, {
|
|
1124
|
-
getFn: this.options.getFn,
|
|
1125
|
-
fieldNormWeight: this.options.fieldNormWeight
|
|
1126
|
-
});
|
|
1127
|
-
}
|
|
1128
|
-
add(doc) {
|
|
1129
|
-
if (!isDefined(doc)) {
|
|
1130
|
-
return;
|
|
1131
|
-
}
|
|
1132
|
-
this._docs.push(doc);
|
|
1133
|
-
this._myIndex.add(doc);
|
|
1134
|
-
}
|
|
1135
|
-
remove(predicate = () => false) {
|
|
1136
|
-
const results = [];
|
|
1137
|
-
for (let i2 = 0, len = this._docs.length; i2 < len; i2 += 1) {
|
|
1138
|
-
const doc = this._docs[i2];
|
|
1139
|
-
if (predicate(doc, i2)) {
|
|
1140
|
-
this.removeAt(i2);
|
|
1141
|
-
i2 -= 1;
|
|
1142
|
-
len -= 1;
|
|
1143
|
-
results.push(doc);
|
|
1144
|
-
}
|
|
1145
|
-
}
|
|
1146
|
-
return results;
|
|
1147
|
-
}
|
|
1148
|
-
removeAt(idx) {
|
|
1149
|
-
this._docs.splice(idx, 1);
|
|
1150
|
-
this._myIndex.removeAt(idx);
|
|
1151
|
-
}
|
|
1152
|
-
getIndex() {
|
|
1153
|
-
return this._myIndex;
|
|
1154
|
-
}
|
|
1155
|
-
search(query, { limit = -1 } = {}) {
|
|
1156
|
-
const {
|
|
1157
|
-
includeMatches,
|
|
1158
|
-
includeScore,
|
|
1159
|
-
shouldSort,
|
|
1160
|
-
sortFn,
|
|
1161
|
-
ignoreFieldNorm
|
|
1162
|
-
} = this.options;
|
|
1163
|
-
let results = isString(query) ? isString(this._docs[0]) ? this._searchStringList(query) : this._searchObjectList(query) : this._searchLogical(query);
|
|
1164
|
-
computeScore(results, { ignoreFieldNorm });
|
|
1165
|
-
if (shouldSort) {
|
|
1166
|
-
results.sort(sortFn);
|
|
1167
|
-
}
|
|
1168
|
-
if (isNumber(limit) && limit > -1) {
|
|
1169
|
-
results = results.slice(0, limit);
|
|
1170
|
-
}
|
|
1171
|
-
return format(results, this._docs, {
|
|
1172
|
-
includeMatches,
|
|
1173
|
-
includeScore
|
|
1174
|
-
});
|
|
1175
|
-
}
|
|
1176
|
-
_searchStringList(query) {
|
|
1177
|
-
const searcher = createSearcher(query, this.options);
|
|
1178
|
-
const { records } = this._myIndex;
|
|
1179
|
-
const results = [];
|
|
1180
|
-
records.forEach(({ v: text, i: idx, n: norm2 }) => {
|
|
1181
|
-
if (!isDefined(text)) {
|
|
1182
|
-
return;
|
|
1183
|
-
}
|
|
1184
|
-
const { isMatch, score, indices } = searcher.searchIn(text);
|
|
1185
|
-
if (isMatch) {
|
|
1186
|
-
results.push({
|
|
1187
|
-
item: text,
|
|
1188
|
-
idx,
|
|
1189
|
-
matches: [{ score, value: text, norm: norm2, indices }]
|
|
1190
|
-
});
|
|
1191
|
-
}
|
|
1192
|
-
});
|
|
1193
|
-
return results;
|
|
1194
|
-
}
|
|
1195
|
-
_searchLogical(query) {
|
|
1196
|
-
const expression = parse(query, this.options);
|
|
1197
|
-
const evaluate = (node, item, idx) => {
|
|
1198
|
-
if (!node.children) {
|
|
1199
|
-
const { keyId, searcher } = node;
|
|
1200
|
-
const matches = this._findMatches({
|
|
1201
|
-
key: this._keyStore.get(keyId),
|
|
1202
|
-
value: this._myIndex.getValueForItemAtKeyId(item, keyId),
|
|
1203
|
-
searcher
|
|
1204
|
-
});
|
|
1205
|
-
if (matches && matches.length) {
|
|
1206
|
-
return [
|
|
1207
|
-
{
|
|
1208
|
-
idx,
|
|
1209
|
-
item,
|
|
1210
|
-
matches
|
|
1211
|
-
}
|
|
1212
|
-
];
|
|
1213
|
-
}
|
|
1214
|
-
return [];
|
|
1215
|
-
}
|
|
1216
|
-
const res = [];
|
|
1217
|
-
for (let i2 = 0, len = node.children.length; i2 < len; i2 += 1) {
|
|
1218
|
-
const child = node.children[i2];
|
|
1219
|
-
const result = evaluate(child, item, idx);
|
|
1220
|
-
if (result.length) {
|
|
1221
|
-
res.push(...result);
|
|
1222
|
-
} else if (node.operator === LogicalOperator.AND) {
|
|
1223
|
-
return [];
|
|
1224
|
-
}
|
|
1225
|
-
}
|
|
1226
|
-
return res;
|
|
1227
|
-
};
|
|
1228
|
-
const records = this._myIndex.records;
|
|
1229
|
-
const resultMap = {};
|
|
1230
|
-
const results = [];
|
|
1231
|
-
records.forEach(({ $: item, i: idx }) => {
|
|
1232
|
-
if (isDefined(item)) {
|
|
1233
|
-
let expResults = evaluate(expression, item, idx);
|
|
1234
|
-
if (expResults.length) {
|
|
1235
|
-
if (!resultMap[idx]) {
|
|
1236
|
-
resultMap[idx] = { idx, item, matches: [] };
|
|
1237
|
-
results.push(resultMap[idx]);
|
|
1238
|
-
}
|
|
1239
|
-
expResults.forEach(({ matches }) => {
|
|
1240
|
-
resultMap[idx].matches.push(...matches);
|
|
1241
|
-
});
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
});
|
|
1245
|
-
return results;
|
|
1246
|
-
}
|
|
1247
|
-
_searchObjectList(query) {
|
|
1248
|
-
const searcher = createSearcher(query, this.options);
|
|
1249
|
-
const { keys, records } = this._myIndex;
|
|
1250
|
-
const results = [];
|
|
1251
|
-
records.forEach(({ $: item, i: idx }) => {
|
|
1252
|
-
if (!isDefined(item)) {
|
|
1253
|
-
return;
|
|
1254
|
-
}
|
|
1255
|
-
let matches = [];
|
|
1256
|
-
keys.forEach((key, keyIndex) => {
|
|
1257
|
-
matches.push(
|
|
1258
|
-
...this._findMatches({
|
|
1259
|
-
key,
|
|
1260
|
-
value: item[keyIndex],
|
|
1261
|
-
searcher
|
|
1262
|
-
})
|
|
1263
|
-
);
|
|
1264
|
-
});
|
|
1265
|
-
if (matches.length) {
|
|
1266
|
-
results.push({
|
|
1267
|
-
idx,
|
|
1268
|
-
item,
|
|
1269
|
-
matches
|
|
1270
|
-
});
|
|
1271
|
-
}
|
|
1272
|
-
});
|
|
1273
|
-
return results;
|
|
1274
|
-
}
|
|
1275
|
-
_findMatches({ key, value, searcher }) {
|
|
1276
|
-
if (!isDefined(value)) {
|
|
1277
|
-
return [];
|
|
1278
|
-
}
|
|
1279
|
-
let matches = [];
|
|
1280
|
-
if (isArray(value)) {
|
|
1281
|
-
value.forEach(({ v: text, i: idx, n: norm2 }) => {
|
|
1282
|
-
if (!isDefined(text)) {
|
|
1283
|
-
return;
|
|
1284
|
-
}
|
|
1285
|
-
const { isMatch, score, indices } = searcher.searchIn(text);
|
|
1286
|
-
if (isMatch) {
|
|
1287
|
-
matches.push({
|
|
1288
|
-
score,
|
|
1289
|
-
key,
|
|
1290
|
-
value: text,
|
|
1291
|
-
idx,
|
|
1292
|
-
norm: norm2,
|
|
1293
|
-
indices
|
|
1294
|
-
});
|
|
1295
|
-
}
|
|
1296
|
-
});
|
|
1297
|
-
} else {
|
|
1298
|
-
const { v: text, n: norm2 } = value;
|
|
1299
|
-
const { isMatch, score, indices } = searcher.searchIn(text);
|
|
1300
|
-
if (isMatch) {
|
|
1301
|
-
matches.push({ score, key, value: text, norm: norm2, indices });
|
|
1302
|
-
}
|
|
1303
|
-
}
|
|
1304
|
-
return matches;
|
|
1305
|
-
}
|
|
1306
|
-
}
|
|
1307
|
-
Fuse.version = "7.0.0";
|
|
1308
|
-
Fuse.createIndex = createIndex;
|
|
1309
|
-
Fuse.parseIndex = parseIndex;
|
|
1310
|
-
Fuse.config = Config;
|
|
1311
|
-
{
|
|
1312
|
-
Fuse.parseQuery = parse;
|
|
1313
|
-
}
|
|
1314
|
-
{
|
|
1315
|
-
register(ExtendedSearch);
|
|
1316
|
-
}
|
|
1317
|
-
const e = Symbol(), t = Symbol(), r = Symbol();
|
|
1318
|
-
let n$1 = (e2, t2) => new Proxy(e2, t2);
|
|
1319
|
-
const o = Object.getPrototypeOf, s$1 = /* @__PURE__ */ new WeakMap(), c$1 = (e2) => e2 && (s$1.has(e2) ? s$1.get(e2) : o(e2) === Object.prototype || o(e2) === Array.prototype), l = (e2) => "object" == typeof e2 && null !== e2, a$1 = /* @__PURE__ */ new WeakMap(), f = (e2) => e2[r] || e2, i = (s2, l2, p2) => {
|
|
1320
|
-
if (!c$1(s2))
|
|
1321
|
-
return s2;
|
|
1322
|
-
const y2 = f(s2), u2 = ((e2) => Object.isFrozen(e2) || Object.values(Object.getOwnPropertyDescriptors(e2)).some((e3) => !e3.writable))(y2);
|
|
1323
|
-
let g2 = p2 && p2.get(y2);
|
|
1324
|
-
return g2 && g2[1].f === u2 || (g2 = ((n2, o2) => {
|
|
1325
|
-
const s3 = { f: o2 };
|
|
1326
|
-
let c2 = false;
|
|
1327
|
-
const l3 = (t2, r2) => {
|
|
1328
|
-
if (!c2) {
|
|
1329
|
-
let o3 = s3.a.get(n2);
|
|
1330
|
-
o3 || (o3 = /* @__PURE__ */ new Set(), s3.a.set(n2, o3)), r2 && o3.has(e) || o3.add(t2);
|
|
1331
|
-
}
|
|
1332
|
-
}, a2 = { get: (e2, t2) => t2 === r ? n2 : (l3(t2), i(e2[t2], s3.a, s3.c)), has: (e2, r2) => r2 === t ? (c2 = true, s3.a.delete(n2), true) : (l3(r2), r2 in e2), getOwnPropertyDescriptor: (e2, t2) => (l3(t2, true), Object.getOwnPropertyDescriptor(e2, t2)), ownKeys: (t2) => (l3(e), Reflect.ownKeys(t2)) };
|
|
1333
|
-
return o2 && (a2.set = a2.deleteProperty = () => false), [a2, s3];
|
|
1334
|
-
})(y2, u2), g2[1].p = n$1(u2 ? ((e2) => {
|
|
1335
|
-
let t2 = a$1.get(e2);
|
|
1336
|
-
if (!t2) {
|
|
1337
|
-
if (Array.isArray(e2))
|
|
1338
|
-
t2 = Array.from(e2);
|
|
1339
|
-
else {
|
|
1340
|
-
const r2 = Object.getOwnPropertyDescriptors(e2);
|
|
1341
|
-
Object.values(r2).forEach((e3) => {
|
|
1342
|
-
e3.configurable = true;
|
|
1343
|
-
}), t2 = Object.create(o(e2), r2);
|
|
1344
|
-
}
|
|
1345
|
-
a$1.set(e2, t2);
|
|
1346
|
-
}
|
|
1347
|
-
return t2;
|
|
1348
|
-
})(y2) : y2, g2[0]), p2 && p2.set(y2, g2)), g2[1].a = l2, g2[1].c = p2, g2[1].p;
|
|
1349
|
-
}, p = (e2, t2) => {
|
|
1350
|
-
const r2 = Reflect.ownKeys(e2), n2 = Reflect.ownKeys(t2);
|
|
1351
|
-
return r2.length !== n2.length || r2.some((e3, t3) => e3 !== n2[t3]);
|
|
1352
|
-
}, y = (t2, r2, n2, o2) => {
|
|
1353
|
-
if (Object.is(t2, r2))
|
|
1354
|
-
return false;
|
|
1355
|
-
if (!l(t2) || !l(r2))
|
|
1356
|
-
return true;
|
|
1357
|
-
const s2 = n2.get(f(t2));
|
|
1358
|
-
if (!s2)
|
|
1359
|
-
return true;
|
|
1360
|
-
if (o2) {
|
|
1361
|
-
const e2 = o2.get(t2);
|
|
1362
|
-
if (e2 && e2.n === r2)
|
|
1363
|
-
return e2.g;
|
|
1364
|
-
o2.set(t2, { n: r2, g: false });
|
|
1365
|
-
}
|
|
1366
|
-
let c2 = null;
|
|
1367
|
-
for (const l2 of s2) {
|
|
1368
|
-
const s3 = l2 === e ? p(t2, r2) : y(t2[l2], r2[l2], n2, o2);
|
|
1369
|
-
if (true !== s3 && false !== s3 || (c2 = s3), c2)
|
|
1370
|
-
break;
|
|
1371
|
-
}
|
|
1372
|
-
return null === c2 && (c2 = true), o2 && o2.set(t2, { n: r2, g: c2 }), c2;
|
|
1373
|
-
}, u = (e2) => !!c$1(e2) && t in e2, g = (e2) => c$1(e2) && e2[r] || null;
|
|
1374
|
-
const n = (e2) => "object" == typeof e2 && null !== e2, a = (t2, r2) => {
|
|
1375
|
-
if (!n(t2))
|
|
1376
|
-
return t2;
|
|
1377
|
-
const c2 = g(t2);
|
|
1378
|
-
return null !== c2 ? (u(t2), c2) : (r2.has(t2) || (r2.add(t2), Object.entries(t2).forEach(([e2, o2]) => {
|
|
1379
|
-
const n2 = a(o2, r2);
|
|
1380
|
-
Object.is(n2, o2) || (t2[e2] = n2);
|
|
1381
|
-
})), t2);
|
|
1382
|
-
}, c = (t2, r2, o2) => {
|
|
1383
|
-
if (!n(t2) || !n(r2))
|
|
1384
|
-
return;
|
|
1385
|
-
const a2 = o2.get(g(r2) || r2);
|
|
1386
|
-
a2 && a2.forEach((e2) => {
|
|
1387
|
-
c(t2[e2], r2[e2], o2);
|
|
1388
|
-
});
|
|
1389
|
-
}, s = (o2, n2) => {
|
|
1390
|
-
var s2;
|
|
1391
|
-
let p2 = 0;
|
|
1392
|
-
const f2 = null != (s2 = null == n2 ? void 0 : n2.size) ? s2 : 1, l2 = [], u2 = /* @__PURE__ */ new WeakMap(), i$1 = /* @__PURE__ */ new WeakMap();
|
|
1393
|
-
return (n3) => {
|
|
1394
|
-
const s3 = g(n3) || n3, k = u2.get(s3);
|
|
1395
|
-
if (k)
|
|
1396
|
-
return c(n3, k.o, k.a), k.r;
|
|
1397
|
-
for (let e2 = 0; e2 < f2; e2 += 1) {
|
|
1398
|
-
const r2 = l2[(p2 + e2) % f2];
|
|
1399
|
-
if (!r2)
|
|
1400
|
-
break;
|
|
1401
|
-
if (!y(r2.o, n3, r2.a, /* @__PURE__ */ new WeakMap()))
|
|
1402
|
-
return u2.set(s3, r2), c(n3, r2.o, r2.a), r2.r;
|
|
1403
|
-
}
|
|
1404
|
-
const d = /* @__PURE__ */ new WeakMap(), w = i(n3, d, i$1), b = a(o2(w), /* @__PURE__ */ new Set());
|
|
1405
|
-
c(n3, n3, d);
|
|
1406
|
-
const m = { o: n3, r: b, a: d };
|
|
1407
|
-
return p2 = (p2 - 1 + f2) % f2, l2[p2] = m, u2.set(s3, m), b;
|
|
1408
|
-
};
|
|
1409
|
-
};
|
|
1410
|
-
const proxyMemo = (fn, opts) => {
|
|
1411
|
-
if (aggregator.w$1.RUNTIME === "browser")
|
|
1412
|
-
return s(fn, opts);
|
|
1413
|
-
return fn;
|
|
1414
|
-
};
|
|
1415
|
-
const defaultOpts = {
|
|
1416
|
-
threshold: 0.3
|
|
1417
|
-
};
|
|
1418
|
-
const fuseFilter = (opts) => (data) => {
|
|
1419
|
-
const fuse = new Fuse(data, {
|
|
1420
|
-
keys: Object.keys(data[0]),
|
|
1421
|
-
...defaultOpts,
|
|
1422
|
-
...opts
|
|
1423
|
-
});
|
|
1424
|
-
return {
|
|
1425
|
-
type: "fuse",
|
|
1426
|
-
page: (page, perPage) => data.slice(page * perPage, (page + 1) * perPage),
|
|
1427
|
-
search: (term) => fuse.search(term).map(({ item }) => item),
|
|
1428
|
-
retrieve: (keys) => data.filter((item) => keys.includes(item.key))
|
|
1429
|
-
};
|
|
1430
|
-
};
|
|
1431
|
-
const defaultFilter = fuseFilter();
|
|
1432
|
-
const createFilterTransform = ({
|
|
1433
|
-
term,
|
|
1434
|
-
searcher = defaultFilter
|
|
1435
|
-
}) => proxyMemo(({ data }) => {
|
|
1436
|
-
if (typeof searcher === "function") {
|
|
1437
|
-
if (term.length === 0 || (data == null ? void 0 : data.length) === 0)
|
|
1438
|
-
return { data, transformed: false };
|
|
1439
|
-
return { data: searcher(data).search(term), transformed: true };
|
|
1440
|
-
}
|
|
1441
|
-
return { data: searcher.search(term), transformed: true };
|
|
1442
|
-
});
|
|
1443
|
-
const useFilter = ({
|
|
1444
|
-
debounce = 250,
|
|
1445
|
-
value,
|
|
1446
|
-
onChange,
|
|
1447
|
-
transformBefore
|
|
1448
|
-
}) => {
|
|
1449
|
-
const [internalValue, setInternalValue] = aggregator.usePurePassthrough({
|
|
1450
|
-
onChange,
|
|
1451
|
-
value,
|
|
1452
|
-
initial: ""
|
|
1453
|
-
});
|
|
1454
|
-
const { setTransform, deleteTransform } = Toggle.useDataUtilContext();
|
|
1455
|
-
const debounced = Toggle.useDebouncedCallback(setTransform, debounce, []);
|
|
1456
|
-
const handleChange = React.useCallback(
|
|
1457
|
-
(term) => {
|
|
1458
|
-
setInternalValue(term);
|
|
1459
|
-
if (term.length === 0)
|
|
1460
|
-
deleteTransform("filter");
|
|
1461
|
-
else {
|
|
1462
|
-
if (transformBefore != null)
|
|
1463
|
-
term = transformBefore(term);
|
|
1464
|
-
debounced("filter", createFilterTransform({ term }));
|
|
1465
|
-
}
|
|
1466
|
-
},
|
|
1467
|
-
[setInternalValue, transformBefore]
|
|
1468
|
-
);
|
|
1469
|
-
return { value: internalValue, onChange: handleChange };
|
|
1470
|
-
};
|
|
1471
|
-
const Filter = ({
|
|
1472
|
-
children = (props2) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(Toggle.Text$1, { ...props2 }),
|
|
1473
|
-
...props
|
|
1474
|
-
}) => children(useFilter(props));
|
|
1475
|
-
const external = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1476
|
-
__proto__: null,
|
|
1477
|
-
Column: Toggle.Column,
|
|
1478
|
-
ColumnContext: Toggle.ColumnContext,
|
|
1479
|
-
Core: Toggle.Core,
|
|
1480
|
-
DataProvider: Toggle.DataProvider,
|
|
1481
|
-
Filter,
|
|
1482
|
-
Hover: Toggle.Hover,
|
|
1483
|
-
ItemFrame: Toggle.ItemFrame,
|
|
1484
|
-
List: List.List,
|
|
1485
|
-
Search: Toggle.Search,
|
|
1486
|
-
Selector: Toggle.Selector,
|
|
1487
|
-
selectValueIsZero: Toggle.selectValueIsZero,
|
|
1488
|
-
useDataContext: Toggle.useDataContext,
|
|
1489
|
-
useDataUtilContext: Toggle.useDataUtilContext,
|
|
1490
|
-
useFilter,
|
|
1491
|
-
useGetTransformedData: Toggle.useGetTransformedData,
|
|
1492
|
-
useHoverContext: Toggle.useHoverContext,
|
|
1493
|
-
useSearch: Toggle.useSearch,
|
|
1494
|
-
useSelect: Toggle.useSelect,
|
|
1495
|
-
useSelection: Toggle.useSelection,
|
|
1496
|
-
useSelectionContext: Toggle.useSelectionContext,
|
|
1497
|
-
useSelectionUtils: Toggle.useSelectionUtils,
|
|
1498
|
-
useSetSourceData: Toggle.useSetSourceData,
|
|
1499
|
-
useSourceData: Toggle.useSourceData,
|
|
1500
|
-
useTransformedData: Toggle.useTransformedData
|
|
1501
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
1502
|
-
exports.Filter = Filter;
|
|
1503
|
-
exports.createFilterTransform = createFilterTransform;
|
|
1504
|
-
exports.external = external;
|
|
1505
|
-
exports.fuseFilter = fuseFilter;
|
|
1506
|
-
exports.proxyMemo = proxyMemo;
|
|
1507
|
-
//# sourceMappingURL=external-B-zN2e5z.cjs.map
|