@dxos/plugin-search 0.8.4-main.72ec0f3 → 0.8.4-main.7996785055

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.
Files changed (163) hide show
  1. package/README.md +0 -1
  2. package/dist/lib/browser/SearchDialog-DVLB2VC2.mjs +84 -0
  3. package/dist/lib/browser/SearchDialog-DVLB2VC2.mjs.map +7 -0
  4. package/dist/lib/browser/SearchMain-25GWFGDM.mjs +92 -0
  5. package/dist/lib/browser/SearchMain-25GWFGDM.mjs.map +7 -0
  6. package/dist/lib/browser/app-graph-builder-GTD4XFXW.mjs +79 -0
  7. package/dist/lib/browser/app-graph-builder-GTD4XFXW.mjs.map +7 -0
  8. package/dist/lib/browser/{chunk-ZEP4O5SU.mjs → chunk-CMFZ7CJK.mjs} +49 -58
  9. package/dist/lib/browser/chunk-CMFZ7CJK.mjs.map +7 -0
  10. package/dist/lib/browser/chunk-OGXI46DO.mjs +27 -0
  11. package/dist/lib/browser/chunk-OGXI46DO.mjs.map +7 -0
  12. package/dist/lib/browser/chunk-RX3VHGKJ.mjs +8 -0
  13. package/dist/lib/browser/chunk-RX3VHGKJ.mjs.map +7 -0
  14. package/dist/lib/browser/{chunk-GN2FSWTM.mjs → chunk-VZK2I4SR.mjs} +10 -3
  15. package/dist/lib/browser/chunk-VZK2I4SR.mjs.map +7 -0
  16. package/dist/lib/browser/chunk-W4E6FT6J.mjs +11 -0
  17. package/dist/lib/browser/chunk-W4E6FT6J.mjs.map +7 -0
  18. package/dist/lib/browser/index.mjs +47 -56
  19. package/dist/lib/browser/index.mjs.map +4 -4
  20. package/dist/lib/browser/meta.json +1 -1
  21. package/dist/lib/browser/open-search-HJI2ZI7N.mjs +23 -0
  22. package/dist/lib/browser/open-search-HJI2ZI7N.mjs.map +7 -0
  23. package/dist/lib/browser/operation-handler-GY2ZUYKH.mjs +16 -0
  24. package/dist/lib/browser/operation-handler-GY2ZUYKH.mjs.map +7 -0
  25. package/dist/lib/browser/react-surface-Y5BHTAJX.mjs +58 -0
  26. package/dist/lib/browser/react-surface-Y5BHTAJX.mjs.map +7 -0
  27. package/dist/types/src/SearchPlugin.d.ts +2 -1
  28. package/dist/types/src/SearchPlugin.d.ts.map +1 -1
  29. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  30. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  31. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  32. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  33. package/dist/types/src/capabilities/index.d.ts +3 -3
  34. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  35. package/dist/types/src/capabilities/operation-handler/index.d.ts +4 -0
  36. package/dist/types/src/capabilities/operation-handler/index.d.ts.map +1 -0
  37. package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts +6 -0
  38. package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +1 -0
  39. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  40. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  41. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  42. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  43. package/dist/types/src/components/index.d.ts +0 -3
  44. package/dist/types/src/components/index.d.ts.map +1 -1
  45. package/dist/types/src/constants.d.ts +2 -0
  46. package/dist/types/src/constants.d.ts.map +1 -0
  47. package/dist/types/src/containers/SearchDialog/SearchDialog.d.ts +6 -0
  48. package/dist/types/src/containers/SearchDialog/SearchDialog.d.ts.map +1 -0
  49. package/dist/types/src/containers/SearchDialog/SearchDialog.stories.d.ts +35 -0
  50. package/dist/types/src/containers/SearchDialog/SearchDialog.stories.d.ts.map +1 -0
  51. package/dist/types/src/containers/SearchDialog/index.d.ts +3 -0
  52. package/dist/types/src/containers/SearchDialog/index.d.ts.map +1 -0
  53. package/dist/types/src/containers/SearchMain/SearchMain.d.ts.map +1 -0
  54. package/dist/types/src/containers/SearchMain/index.d.ts +3 -0
  55. package/dist/types/src/containers/SearchMain/index.d.ts.map +1 -0
  56. package/dist/types/src/containers/index.d.ts +5 -0
  57. package/dist/types/src/containers/index.d.ts.map +1 -0
  58. package/dist/types/src/hooks/sync.d.ts +3 -2
  59. package/dist/types/src/hooks/sync.d.ts.map +1 -1
  60. package/dist/types/src/hooks/useGlobalSearch.d.ts +7 -3
  61. package/dist/types/src/hooks/useGlobalSearch.d.ts.map +1 -1
  62. package/dist/types/src/hooks/useSearchResults.d.ts +3 -2
  63. package/dist/types/src/hooks/useSearchResults.d.ts.map +1 -1
  64. package/dist/types/src/hooks/useWebSearch.d.ts +6 -3
  65. package/dist/types/src/hooks/useWebSearch.d.ts.map +1 -1
  66. package/dist/types/src/meta.d.ts +2 -2
  67. package/dist/types/src/meta.d.ts.map +1 -1
  68. package/dist/types/src/operations/definitions.d.ts +3 -0
  69. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  70. package/dist/types/src/operations/index.d.ts +4 -0
  71. package/dist/types/src/operations/index.d.ts.map +1 -0
  72. package/dist/types/src/operations/open-search.d.ts +5 -0
  73. package/dist/types/src/operations/open-search.d.ts.map +1 -0
  74. package/dist/types/src/search/exa.d.ts +3 -1
  75. package/dist/types/src/search/exa.d.ts.map +1 -1
  76. package/dist/types/src/translations.d.ts +7 -1
  77. package/dist/types/src/translations.d.ts.map +1 -1
  78. package/dist/types/src/types/index.d.ts +0 -1
  79. package/dist/types/src/types/index.d.ts.map +1 -1
  80. package/dist/types/src/types/search.d.ts +3 -7
  81. package/dist/types/src/types/search.d.ts.map +1 -1
  82. package/dist/types/tsconfig.tsbuildinfo +1 -1
  83. package/package.json +56 -47
  84. package/src/SearchPlugin.tsx +25 -42
  85. package/src/capabilities/app-graph-builder/app-graph-builder.ts +70 -0
  86. package/src/capabilities/app-graph-builder/index.ts +7 -0
  87. package/src/capabilities/index.ts +3 -5
  88. package/src/capabilities/operation-handler/index.ts +11 -0
  89. package/src/capabilities/operation-handler/operation-handler.ts +16 -0
  90. package/src/capabilities/react-surface/index.ts +7 -0
  91. package/src/capabilities/react-surface/react-surface.tsx +62 -0
  92. package/src/components/index.ts +0 -4
  93. package/src/constants.ts +7 -0
  94. package/src/containers/SearchDialog/SearchDialog.stories.tsx +53 -0
  95. package/src/containers/SearchDialog/SearchDialog.tsx +104 -0
  96. package/src/containers/SearchDialog/index.ts +6 -0
  97. package/src/containers/SearchMain/SearchMain.tsx +92 -0
  98. package/src/containers/SearchMain/index.ts +7 -0
  99. package/src/containers/index.ts +10 -0
  100. package/src/hooks/sync.test.ts +6 -4
  101. package/src/hooks/sync.ts +22 -27
  102. package/src/hooks/useGlobalSearch.tsx +31 -12
  103. package/src/hooks/useSearchResults.ts +5 -2
  104. package/src/hooks/useWebSearch.ts +20 -9
  105. package/src/meta.ts +4 -4
  106. package/src/operations/definitions.ts +17 -0
  107. package/src/operations/index.ts +9 -0
  108. package/src/operations/open-search.ts +25 -0
  109. package/src/search/exa.test.ts +7 -7
  110. package/src/search/exa.ts +4 -3
  111. package/src/translations.ts +3 -1
  112. package/src/types/command-score.d.ts +16 -0
  113. package/src/types/index.ts +0 -1
  114. package/src/types/search.ts +3 -9
  115. package/dist/lib/browser/app-graph-builder-HQR6P4C7.mjs +0 -78
  116. package/dist/lib/browser/app-graph-builder-HQR6P4C7.mjs.map +0 -7
  117. package/dist/lib/browser/chunk-GN2FSWTM.mjs.map +0 -7
  118. package/dist/lib/browser/chunk-TCVYYI44.mjs +0 -21
  119. package/dist/lib/browser/chunk-TCVYYI44.mjs.map +0 -7
  120. package/dist/lib/browser/chunk-ZEP4O5SU.mjs.map +0 -7
  121. package/dist/lib/browser/intent-resolver-UYQA6UUQ.mjs +0 -22
  122. package/dist/lib/browser/intent-resolver-UYQA6UUQ.mjs.map +0 -7
  123. package/dist/lib/browser/react-surface-H5CKQVII.mjs +0 -307
  124. package/dist/lib/browser/react-surface-H5CKQVII.mjs.map +0 -7
  125. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  126. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  127. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  128. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  129. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  130. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  131. package/dist/types/src/components/Search.stories.d.ts +0 -16
  132. package/dist/types/src/components/Search.stories.d.ts.map +0 -1
  133. package/dist/types/src/components/SearchDialog.d.ts +0 -7
  134. package/dist/types/src/components/SearchDialog.d.ts.map +0 -1
  135. package/dist/types/src/components/SearchMain.d.ts.map +0 -1
  136. package/dist/types/src/components/SearchResults/SearchResults.d.ts +0 -20
  137. package/dist/types/src/components/SearchResults/SearchResults.d.ts.map +0 -1
  138. package/dist/types/src/components/SearchResults/SearchResults.stories.d.ts +0 -16
  139. package/dist/types/src/components/SearchResults/SearchResults.stories.d.ts.map +0 -1
  140. package/dist/types/src/components/SearchResults/index.d.ts +0 -2
  141. package/dist/types/src/components/SearchResults/index.d.ts.map +0 -1
  142. package/dist/types/src/components/Searchbar/Searchbar.d.ts +0 -10
  143. package/dist/types/src/components/Searchbar/Searchbar.d.ts.map +0 -1
  144. package/dist/types/src/components/Searchbar/Searchbar.stories.d.ts +0 -13
  145. package/dist/types/src/components/Searchbar/Searchbar.stories.d.ts.map +0 -1
  146. package/dist/types/src/components/Searchbar/index.d.ts +0 -2
  147. package/dist/types/src/components/Searchbar/index.d.ts.map +0 -1
  148. package/dist/types/src/types/action.d.ts +0 -13
  149. package/dist/types/src/types/action.d.ts.map +0 -1
  150. package/src/capabilities/app-graph-builder.ts +0 -80
  151. package/src/capabilities/intent-resolver.ts +0 -18
  152. package/src/capabilities/react-surface.tsx +0 -56
  153. package/src/components/Search.stories.tsx +0 -64
  154. package/src/components/SearchDialog.tsx +0 -136
  155. package/src/components/SearchMain.tsx +0 -62
  156. package/src/components/SearchResults/SearchResults.stories.tsx +0 -59
  157. package/src/components/SearchResults/SearchResults.tsx +0 -83
  158. package/src/components/SearchResults/index.ts +0 -5
  159. package/src/components/Searchbar/Searchbar.stories.tsx +0 -28
  160. package/src/components/Searchbar/Searchbar.tsx +0 -48
  161. package/src/components/Searchbar/index.ts +0 -5
  162. package/src/types/action.tsx +0 -16
  163. /package/dist/types/src/{components → containers/SearchMain}/SearchMain.d.ts +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-surface.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAA8B,MAAM,qBAAqB,CAAC;;AAO/E,wBA0CK"}
@@ -1,16 +0,0 @@
1
- import { type Decorator, type StoryObj } from '@storybook/react-vite';
2
- import React from 'react';
3
- import { type SearchbarProps } from './Searchbar';
4
- type StoryProps = SearchbarProps & {
5
- objects?: any[];
6
- };
7
- export declare const Default: Story;
8
- declare const meta: {
9
- title: string;
10
- component: ({ classNames, variant, placeholder, value, onChange, onSubmit }: SearchbarProps) => React.JSX.Element;
11
- render: ({ objects, ...props }: StoryProps) => React.JSX.Element;
12
- decorators: Decorator[];
13
- };
14
- export default meta;
15
- type Story = StoryObj<typeof meta>;
16
- //# sourceMappingURL=Search.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Search.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Search.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,KAAmB,MAAM,OAAO,CAAC;AAOxC,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAK7D,KAAK,UAAU,GAAG,cAAc,GAAG;IACjC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;CACjB,CAAC;AAyBF,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC;AAEF,QAAA,MAAM,IAAI;;;oCAjCmC,UAAU;;CAsCrB,CAAC;AAEnC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC"}
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- export declare const SEARCH_DIALOG: string;
3
- export type SearchDialogProps = {
4
- pivotId: string;
5
- };
6
- export declare const SearchDialog: ({ pivotId }: SearchDialogProps) => React.JSX.Element;
7
- //# sourceMappingURL=SearchDialog.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SearchDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/SearchDialog.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAejE,eAAO,MAAM,aAAa,QAA4B,CAAC;AAuBvD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,aAAa,iBAAiB,sBAwF1D,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SearchMain.d.ts","sourceRoot":"","sources":["../../../../src/components/SearchMain.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAU,KAAK,KAAK,EAAY,MAAM,yBAAyB,CAAC;AAWvE,eAAO,MAAM,UAAU,GAAI,WAAW;IAAE,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,sBA2CtD,CAAC"}
@@ -1,20 +0,0 @@
1
- import React, { type FC } from 'react';
2
- import { type SearchResult } from '../../types';
3
- export type SearchResultsProps = {
4
- items: SearchResult[];
5
- match?: RegExp;
6
- selected?: string;
7
- onSelect?: (id: string) => void;
8
- };
9
- export declare const SearchResults: ({ items }: SearchResultsProps) => React.JSX.Element;
10
- export type SearchItemProps = SearchResult & {
11
- selected: boolean;
12
- } & Pick<SearchResultsProps, 'onSelect'>;
13
- export declare const SearchItem: React.ForwardRefExoticComponent<SearchResult & {
14
- selected: boolean;
15
- } & Pick<SearchResultsProps, "onSelect"> & React.RefAttributes<HTMLDivElement>>;
16
- export declare const Snippet: FC<{
17
- text: string;
18
- match?: RegExp;
19
- }>;
20
- //# sourceMappingURL=SearchResults.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SearchResults.d.ts","sourceRoot":"","sources":["../../../../../src/components/SearchResults/SearchResults.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,EAAc,MAAM,OAAO,CAAC;AAOnD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,CAAC;AAIF,eAAO,MAAM,aAAa,GAAI,WAAW,kBAAkB,sBAe1D,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;AAE1G,eAAO,MAAM,UAAU;cAFkC,OAAO;+EAgB9D,CAAC;AAEH,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAyBxD,CAAC"}
@@ -1,16 +0,0 @@
1
- import { type StoryObj } from '@storybook/react-vite';
2
- import React from 'react';
3
- import { type SearchResultsProps } from './SearchResults';
4
- declare const meta: {
5
- title: string;
6
- component: ({ items }: SearchResultsProps) => React.JSX.Element;
7
- render: (props: SearchResultsProps) => React.JSX.Element;
8
- decorators: import("@storybook/react").Decorator[];
9
- parameters: {
10
- layout: string;
11
- };
12
- };
13
- export default meta;
14
- type Story = StoryObj<typeof meta>;
15
- export declare const Default: Story;
16
- //# sourceMappingURL=SearchResults.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SearchResults.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/SearchResults/SearchResults.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAmB,MAAM,OAAO,CAAC;AAQxC,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AA0BzE,QAAA,MAAM,IAAI;;;oBAtBmB,kBAAkB;;;;;CA8BT,CAAC;AAEvC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './SearchResults';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/SearchResults/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC"}
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { type TextInputProps, type ThemedClassName } from '@dxos/react-ui';
3
- export type SearchbarProps = ThemedClassName<Pick<TextInputProps, 'variant' | 'placeholder'> & {
4
- delay?: number;
5
- value?: string;
6
- onChange?: (text?: string) => void;
7
- onSubmit?: (text?: string) => void;
8
- }>;
9
- export declare const Searchbar: ({ classNames, variant, placeholder, value, onChange, onSubmit }: SearchbarProps) => React.JSX.Element;
10
- //# sourceMappingURL=Searchbar.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Searchbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/Searchbar/Searchbar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAS,KAAK,cAAc,EAAE,KAAK,eAAe,EAA+B,MAAM,gBAAgB,CAAC;AAE/G,MAAM,MAAM,cAAc,GAAG,eAAe,CAC1C,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,aAAa,CAAC,GAAG;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CACF,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,iEAAiE,cAAc,sBA8BxG,CAAC"}
@@ -1,13 +0,0 @@
1
- import { type StoryObj } from '@storybook/react-vite';
2
- declare const meta: {
3
- title: string;
4
- component: ({ classNames, variant, placeholder, value, onChange, onSubmit }: import("./Searchbar").SearchbarProps) => import("react").JSX.Element;
5
- decorators: import("@storybook/react").Decorator[];
6
- parameters: {
7
- layout: string;
8
- };
9
- };
10
- export default meta;
11
- type Story = StoryObj<typeof meta>;
12
- export declare const Default: Story;
13
- //# sourceMappingURL=Searchbar.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Searchbar.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Searchbar/Searchbar.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAMjE,QAAA,MAAM,IAAI;;;;;;;CAOwB,CAAC;AAEnC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './Searchbar';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Searchbar/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC"}
@@ -1,13 +0,0 @@
1
- import * as Schema from 'effect/Schema';
2
- export declare namespace SearchAction {
3
- const OpenSearch_base: Schema.TaggedClass<OpenSearch, `${string}/open-search`, {
4
- readonly _tag: Schema.tag<`${string}/open-search`>;
5
- } & {
6
- input: typeof Schema.Void;
7
- output: typeof Schema.Void;
8
- }>;
9
- export class OpenSearch extends OpenSearch_base {
10
- }
11
- export {};
12
- }
13
- //# sourceMappingURL=action.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../src/types/action.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,yBAAiB,YAAY,CAAC;;;;;;;IAG5B,MAAM,OAAO,UAAW,SAAQ,eAG9B;KAAG;;CACN"}
@@ -1,80 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Atom } from '@effect-atom/atom-react';
6
- import * as Function from 'effect/Function';
7
- import * as Option from 'effect/Option';
8
-
9
- import { Capabilities, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
10
- import { ClientCapabilities } from '@dxos/plugin-client';
11
- import { ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
12
- import { ROOT_ID, atomFromSignal, createExtension } from '@dxos/plugin-graph';
13
- import { parseId } from '@dxos/react-client/echo';
14
-
15
- import { meta } from '../meta';
16
- import { SearchAction } from '../types';
17
-
18
- export default (context: PluginContext) =>
19
- contributes(Capabilities.AppGraphBuilder, [
20
- createExtension({
21
- id: `${meta.id}/space-search`,
22
- connector: (node) =>
23
- Atom.make((get) =>
24
- Function.pipe(
25
- get(node),
26
- Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
27
- Option.map((node) => {
28
- const workspace = get(atomFromSignal(() => context.getCapability(Capabilities.Layout).workspace));
29
- const client = context.getCapability(ClientCapabilities.Client);
30
- const { spaceId } = parseId(workspace);
31
- const space = spaceId ? client.spaces.get(spaceId) : null;
32
-
33
- return [
34
- {
35
- id: [node.id, 'search'].join(ATTENDABLE_PATH_SEPARATOR),
36
- type: DECK_COMPANION_TYPE,
37
- data: space,
38
- properties: {
39
- label: ['search label', { ns: meta.id }],
40
- icon: 'ph--magnifying-glass--regular',
41
- disposition: 'hidden',
42
- },
43
- },
44
- ];
45
- }),
46
- Option.getOrElse(() => []),
47
- ),
48
- ),
49
- }),
50
- createExtension({
51
- id: meta.id,
52
- actions: (node) =>
53
- Atom.make((get) =>
54
- Function.pipe(
55
- get(node),
56
- Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
57
- Option.map(() => {
58
- return [
59
- {
60
- id: SearchAction.OpenSearch._tag,
61
- data: async () => {
62
- const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
63
- await dispatch(createIntent(SearchAction.OpenSearch));
64
- },
65
- properties: {
66
- label: ['search action label', { ns: meta.id }],
67
- icon: 'ph--magnifying-glass--regular',
68
- keyBinding: {
69
- macos: 'shift+meta+f',
70
- windows: 'shift+alt+f',
71
- },
72
- },
73
- },
74
- ];
75
- }),
76
- Option.getOrElse(() => []),
77
- ),
78
- ),
79
- }),
80
- ]);
@@ -1,18 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Capabilities, LayoutAction, contributes, createIntent, createResolver } from '@dxos/app-framework';
6
-
7
- import { SearchAction } from '../types';
8
-
9
- export default () =>
10
- contributes(
11
- Capabilities.IntentResolver,
12
- createResolver({
13
- intent: SearchAction.OpenSearch,
14
- resolve: () => ({
15
- intents: [createIntent(LayoutAction.UpdateComplementary, { part: 'complementary', subject: 'search' })],
16
- }),
17
- }),
18
- );
@@ -1,56 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import React from 'react';
6
-
7
- import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
8
- import { useActiveSpace } from '@dxos/plugin-space';
9
- import { type Space, isSpace } from '@dxos/react-client/echo';
10
-
11
- import { SEARCH_DIALOG, SearchDialog, type SearchDialogProps, SearchMain } from '../components';
12
- import { SearchContextProvider } from '../hooks';
13
-
14
- export default () =>
15
- contributes(Capabilities.ReactSurface, [
16
- createSurface({
17
- id: SEARCH_DIALOG,
18
- role: 'dialog',
19
- filter: (data): data is { props: SearchDialogProps } => data.component === SEARCH_DIALOG,
20
- component: ({ data }) => (
21
- <SearchContextProvider>
22
- <SearchDialog {...data.props} />
23
- </SearchContextProvider>
24
- ),
25
- }),
26
- createSurface({
27
- id: `${SEARCH_DIALOG}/search-input`,
28
- role: 'search-input',
29
- component: () => {
30
- const space = useActiveSpace();
31
-
32
- return (
33
- <SearchContextProvider>
34
- <SearchMain space={space} />
35
- </SearchContextProvider>
36
- );
37
- },
38
- }),
39
- createSurface({
40
- id: `${SEARCH_DIALOG}/search`,
41
- role: 'deck-companion--search',
42
- filter: (data): data is { subject: Space } => isSpace(data.subject),
43
- component: ({ data }) => {
44
- const space = data.subject;
45
- if (!space) {
46
- return null;
47
- }
48
-
49
- return (
50
- <SearchContextProvider>
51
- <SearchMain space={space} />
52
- </SearchContextProvider>
53
- );
54
- },
55
- }),
56
- ]);
@@ -1,64 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import { type Decorator, type Meta, type StoryObj } from '@storybook/react-vite';
6
- import React, { useState } from 'react';
7
-
8
- import { faker } from '@dxos/random';
9
- import { withLayout, withTheme } from '@dxos/react-ui/testing';
10
-
11
- import { SearchContextProvider, useGlobalSearch, useGlobalSearchResults } from '../hooks';
12
-
13
- import { Searchbar, type SearchbarProps } from './Searchbar';
14
- import { SearchResults } from './SearchResults';
15
-
16
- faker.seed(1);
17
-
18
- type StoryProps = SearchbarProps & {
19
- objects?: any[];
20
- };
21
-
22
- const DefaultStory = ({ objects, ...props }: StoryProps) => {
23
- const [selected, setSelected] = useState<string>();
24
- const { setMatch } = useGlobalSearch();
25
- const filteredItems = useGlobalSearchResults(objects);
26
-
27
- return (
28
- <div className='flex grow justify-center overflow-hidden'>
29
- <div className='flex flex-col is-[300px] m-4 overflow-hidden'>
30
- <Searchbar variant='subdued' placeholder='Enter regular expression...' onChange={setMatch} {...props} />
31
- <SearchResults items={filteredItems} selected={selected} onSelect={setSelected} />
32
- </div>
33
- </div>
34
- );
35
- };
36
-
37
- const withSearchContext = (): Decorator => {
38
- return (Story) => (
39
- <SearchContextProvider>
40
- <Story />
41
- </SearchContextProvider>
42
- );
43
- };
44
-
45
- export const Default: Story = {
46
- args: {
47
- objects: Array.from({ length: 8 }).map(() => ({
48
- id: faker.string.uuid(),
49
- label: faker.lorem.sentence(4).replace(/\./g, ''),
50
- content: faker.lorem.sentences(3),
51
- })),
52
- },
53
- };
54
-
55
- const meta = {
56
- title: 'plugins/plugin-search/Search',
57
- component: Searchbar,
58
- render: DefaultStory,
59
- decorators: [withTheme, withLayout({ container: 'column' }), withSearchContext()],
60
- } satisfies Meta<typeof Searchbar>;
61
-
62
- export default meta;
63
-
64
- type Story = StoryObj<typeof meta>;
@@ -1,136 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import * as Option from 'effect/Option';
6
- import React, { forwardRef, useCallback, useState } from 'react';
7
-
8
- import { LayoutAction, createIntent } from '@dxos/app-framework';
9
- import { useAppGraph, useIntentDispatcher, useLayout } from '@dxos/app-framework/react';
10
- import { Obj } from '@dxos/echo';
11
- import { type Node } from '@dxos/plugin-graph';
12
- import { useClient } from '@dxos/react-client';
13
- import { Filter, useQuery } from '@dxos/react-client/echo';
14
- import { Button, Dialog, Icon, toLocalizedString, useTranslation } from '@dxos/react-ui';
15
- import { SearchList, type SearchListItemProps } from '@dxos/react-ui-searchlist';
16
- import { descriptionText, mx } from '@dxos/react-ui-theme';
17
-
18
- import { useSearchResults } from '../hooks';
19
- import { meta } from '../meta';
20
-
21
- export const SEARCH_DIALOG = `${meta.id}/SearchDialog`;
22
-
23
- type SearchListResultProps = {
24
- node: Node;
25
- } & Pick<SearchListItemProps, 'onSelect'>;
26
-
27
- const SearchListResult = forwardRef<HTMLDivElement, SearchListResultProps>(({ node, onSelect }, forwardedRef) => {
28
- const { t } = useTranslation(meta.id);
29
- const label = toLocalizedString(node?.properties.label ?? 'never', t);
30
- return (
31
- <SearchList.Item
32
- value={label}
33
- key={node!.id}
34
- classNames='flex gap-2 items-center pli-2'
35
- onSelect={() => onSelect?.(node!.id)}
36
- ref={forwardedRef}
37
- >
38
- <Icon size={5} icon={node?.properties.icon} />
39
- <span className='is-0 grow truncate'>{label}</span>
40
- </SearchList.Item>
41
- );
42
- });
43
-
44
- export type SearchDialogProps = {
45
- pivotId: string;
46
- };
47
-
48
- export const SearchDialog = ({ pivotId }: SearchDialogProps) => {
49
- const { t } = useTranslation(meta.id);
50
- const { graph } = useAppGraph();
51
- const layout = useLayout();
52
- const closed = (Array.isArray(layout.inactive) ? layout.inactive : [layout.inactive])
53
- .map((id) => graph?.getNode(id))
54
- .filter(Boolean);
55
- const [queryString, setQueryString] = useState('');
56
- const client = useClient();
57
- const dangerouslyLoadAllObjects = useQuery(client.spaces, Filter.everything());
58
- const [pending, results] = useSearchResults(queryString, dangerouslyLoadAllObjects);
59
- const resultObjects = Array.from(results.keys());
60
- const { dispatchPromise: dispatch } = useIntentDispatcher();
61
-
62
- const handleSelect = useCallback(
63
- async (nodeId: string) => {
64
- await dispatch(
65
- createIntent(LayoutAction.UpdateDialog, {
66
- part: 'dialog',
67
- options: { state: false },
68
- }),
69
- );
70
-
71
- // If node is already present in the active parts, scroll to it and close the dialog.
72
- const index = layout.active.findIndex((id) => id === nodeId);
73
- if (index !== -1) {
74
- await dispatch(
75
- createIntent(LayoutAction.ScrollIntoView, {
76
- part: 'current',
77
- subject: nodeId,
78
- }),
79
- );
80
- } else {
81
- await dispatch(
82
- createIntent(LayoutAction.Open, {
83
- part: 'main',
84
- subject: [nodeId],
85
- options: {
86
- pivotId,
87
- positioning: 'end',
88
- },
89
- }),
90
- );
91
- }
92
- },
93
- [pivotId, dispatch, layout],
94
- );
95
-
96
- return (
97
- <Dialog.Content classNames={['md:max-is-[24rem] overflow-hidden mbs-12']}>
98
- <Dialog.Title>{t('search dialog title')}</Dialog.Title>
99
- <SearchList.Root label={t('search placeholder')} classNames='flex flex-col grow overflow-hidden my-2'>
100
- <SearchList.Input
101
- value={queryString}
102
- onValueChange={(nextValue) => {
103
- setQueryString(nextValue);
104
- }}
105
- placeholder={t('search placeholder')}
106
- classNames='pli-1 my-2'
107
- />
108
- <SearchList.Content classNames='max-bs-[24rem] overflow-auto'>
109
- {queryString.length > 0 ? (
110
- resultObjects.length > 0 ? (
111
- resultObjects
112
- .map((object) => graph.getNode(Obj.getDXN(object).toString()))
113
- .filter(Option.isSome)
114
- .map((node) => <SearchListResult key={node.value.id} node={node.value} onSelect={handleSelect} />)
115
- ) : (
116
- <p className='pli-1'>{t(pending ? 'pending results message' : 'empty results message')}</p>
117
- )
118
- ) : (
119
- <>
120
- {closed.length > 0 && <h2 className={mx('mlb-1', descriptionText)}>{t('recently closed heading')}</h2>}
121
- {closed.filter(Option.isSome).map((node) => (
122
- <SearchListResult key={node.value.id} node={node.value} onSelect={handleSelect} />
123
- ))}
124
- </>
125
- )}
126
- </SearchList.Content>
127
- </SearchList.Root>
128
-
129
- <Dialog.Close asChild>
130
- <Button variant='primary' classNames='mbs-2'>
131
- {t('close label', { ns: 'os' })}
132
- </Button>
133
- </Dialog.Close>
134
- </Dialog.Content>
135
- );
136
- };
@@ -1,62 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React, { useState } from 'react';
6
-
7
- import { useClient } from '@dxos/react-client';
8
- import { Filter, type Space, useQuery } from '@dxos/react-client/echo';
9
- import { useTranslation } from '@dxos/react-ui';
10
- import { Stack, StackItem } from '@dxos/react-ui-stack';
11
- import { activeSurface, mx } from '@dxos/react-ui-theme';
12
-
13
- import { useGlobalSearch, useGlobalSearchResults, useWebSearch } from '../hooks';
14
- import { meta } from '../meta';
15
-
16
- import { Searchbar } from './Searchbar';
17
- import { SearchResults } from './SearchResults';
18
-
19
- export const SearchMain = ({ space }: { space?: Space }) => {
20
- const { t } = useTranslation(meta.id);
21
- const client = useClient();
22
- const { setMatch } = useGlobalSearch();
23
- const [query, setQuery] = useState<string>();
24
- // TODO(burdon): Option to search across spaces.
25
- const allSpaces = false;
26
- const objects = useQuery(allSpaces ? client.spaces : space, Filter.everything());
27
- const results = useGlobalSearchResults(objects);
28
-
29
- const { runSearch, results: webResults } = useWebSearch({ query });
30
-
31
- // TODO(burdon): Activate and/or filter current main (set context).
32
- const [selected, setSelected] = useState<string>();
33
- const handleSelect = (id: string) => {
34
- setSelected((selected) => (selected === id ? undefined : id));
35
- };
36
-
37
- const allResults = [...results, ...webResults];
38
-
39
- return (
40
- <Stack orientation='vertical' size='contain' itemsCount={1} rail={false} classNames={['bs-full', activeSurface]}>
41
- <StackItem.Root item={{ id: 'search' }} role='article'>
42
- <StackItem.Content toolbar>
43
- <Searchbar
44
- classNames='pli-2'
45
- placeholder={t('search placeholder')}
46
- delay={300}
47
- onChange={(text) => {
48
- setQuery(text);
49
- setMatch?.(text);
50
- }}
51
- onSubmit={runSearch}
52
- />
53
- {allResults.length > 0 && (
54
- <div className={mx('flex flex-col bs-full overflow-hidden')}>
55
- <SearchResults items={allResults} selected={selected} onSelect={handleSelect} />
56
- </div>
57
- )}
58
- </StackItem.Content>
59
- </StackItem.Root>
60
- </Stack>
61
- );
62
- };
@@ -1,59 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import { type Meta, type StoryObj } from '@storybook/react-vite';
6
- import React, { useState } from 'react';
7
-
8
- import { withPluginManager } from '@dxos/app-framework/testing';
9
- import { faker } from '@dxos/random';
10
- import { withTheme } from '@dxos/react-ui/testing';
11
-
12
- import { filterObjectsSync } from '../../hooks';
13
-
14
- import { SearchResults, type SearchResultsProps } from './SearchResults';
15
-
16
- faker.seed(1);
17
-
18
- const DefaultStory = (props: SearchResultsProps) => {
19
- const [selected, setSelected] = useState<string>();
20
-
21
- return (
22
- <div className='flex grow justify-center overflow-hidden'>
23
- <div className='flex is-[300px] m-4 overflow-hidden'>
24
- <SearchResults {...props} selected={selected} onSelect={setSelected} />
25
- </div>
26
- </div>
27
- );
28
- };
29
-
30
- const word = 'hello';
31
-
32
- const objects = Array.from({ length: 100 }).map((_, i) => ({
33
- id: faker.string.uuid(),
34
- name: faker.lorem.sentence(4),
35
- content: faker.lorem.sentence() + ` ${word} ` + faker.lorem.sentence(),
36
- }));
37
-
38
- const match = new RegExp(word, 'i');
39
-
40
- const meta = {
41
- title: 'plugins/plugin-search/SearchResults',
42
- component: SearchResults,
43
- render: DefaultStory,
44
- decorators: [withTheme, withPluginManager({ plugins: [] })],
45
- parameters: {
46
- layout: 'fullscreen',
47
- },
48
- } satisfies Meta<typeof SearchResults>;
49
-
50
- export default meta;
51
-
52
- type Story = StoryObj<typeof meta>;
53
-
54
- export const Default: Story = {
55
- args: {
56
- items: filterObjectsSync(objects, match),
57
- match,
58
- },
59
- };