@dxos/plugin-search 0.12.0-next-73daef452f1464b62efdbca75fb0067c1066f264 → 0.13.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/PLUGIN.mdl +58 -9
- package/dist/lib/capabilities.browser.mjs +24 -0
- package/dist/lib/capabilities.browser.mjs.map +1 -0
- package/dist/lib/capabilities.mjs +1 -3
- package/dist/lib/capabilities.mjs.map +1 -1
- package/dist/lib/capabilities.node.mjs.map +1 -1
- package/dist/lib/capabilities.tauri.mjs +24 -0
- package/dist/lib/capabilities.tauri.mjs.map +1 -0
- package/dist/lib/capabilities.workerd.mjs.map +1 -1
- package/dist/lib/chunk-PLUGIN.mjs +6 -0
- package/dist/lib/chunk-PLUGIN.mjs.map +1 -0
- package/dist/lib/chunk-SearchArticle.mjs +8 -8
- package/dist/lib/chunk-SearchArticle.mjs.map +1 -1
- package/dist/lib/chunk-SearchDialog.mjs +14 -9
- package/dist/lib/chunk-SearchDialog.mjs.map +1 -1
- package/dist/lib/chunk-app-graph-builder.mjs +15 -6
- package/dist/lib/chunk-app-graph-builder.mjs.map +1 -1
- package/dist/lib/chunk-open-search.mjs.map +1 -1
- package/dist/lib/chunk-react-surface.mjs +5 -4
- package/dist/lib/chunk-react-surface.mjs.map +1 -1
- package/dist/lib/chunk-rolldown-runtime.mjs +15 -1
- package/dist/lib/components.mjs +68 -60
- package/dist/lib/components.mjs.map +1 -1
- package/dist/lib/containers.mjs.map +1 -1
- package/dist/lib/hooks.mjs +6 -5
- package/dist/lib/hooks.mjs.map +1 -1
- package/dist/lib/index.mjs +2 -3
- package/dist/lib/meta.mjs +1 -0
- package/dist/lib/meta.mjs.map +1 -1
- package/dist/lib/ns/Hooks.mjs +10 -0
- package/dist/lib/ns/Hooks.mjs.map +1 -0
- package/dist/lib/operations.mjs.map +1 -1
- package/dist/lib/translations.mjs.map +1 -1
- package/dist/types/src/Hooks.d.ts +2 -0
- package/dist/types/src/Hooks.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/gen/browser.d.ts +6 -0
- package/dist/types/src/capabilities/gen/browser.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/node.d.ts.map +1 -1
- package/dist/types/src/capabilities/gen/tauri.d.ts +6 -0
- package/dist/types/src/capabilities/gen/tauri.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/workerd.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/components/SearchResultList/SearchResultList.d.ts.map +1 -1
- package/dist/types/src/components/SearchResultList/SearchResultList.stories.d.ts.map +1 -1
- package/dist/types/src/components/SearchResultList/index.d.ts +1 -1
- package/dist/types/src/components/SearchResultList/index.d.ts.map +1 -1
- package/dist/types/src/components/SearchResultStack/SearchResultStack.d.ts.map +1 -1
- package/dist/types/src/components/SearchResultStack/index.d.ts +1 -1
- package/dist/types/src/components/SearchResultStack/index.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/SearchArticle/SearchArticle.d.ts +1 -1
- package/dist/types/src/containers/SearchArticle/SearchArticle.d.ts.map +1 -1
- package/dist/types/src/containers/SearchArticle/index.d.ts +1 -1
- package/dist/types/src/containers/SearchArticle/index.d.ts.map +1 -1
- package/dist/types/src/containers/SearchDialog/SearchDialog.d.ts +1 -1
- package/dist/types/src/containers/SearchDialog/SearchDialog.d.ts.map +1 -1
- package/dist/types/src/containers/SearchDialog/SearchDialog.stories.d.ts.map +1 -1
- package/dist/types/src/containers/SearchDialog/index.d.ts +1 -1
- package/dist/types/src/containers/SearchDialog/index.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +7 -7
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useSearchResults.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/plugin.test.d.ts +2 -0
- package/dist/types/src/plugin.test.d.ts.map +1 -0
- package/dist/types/src/search/exa.d.ts.map +1 -1
- package/dist/types/src/search/index.d.ts +1 -1
- package/dist/types/src/search/index.d.ts.map +1 -1
- package/dist/types/src/testing.d.ts +1 -1
- package/dist/types/src/testing.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +2 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +3 -0
- package/package.json +58 -50
- package/src/Hooks.ts +7 -0
- package/src/capabilities/SearchSurfaces.tsx +3 -3
- package/src/capabilities/app-graph-builder.ts +17 -9
- package/src/capabilities/gen/browser.ts +32 -0
- package/src/capabilities/gen/node.ts +2 -2
- package/src/capabilities/gen/tauri.ts +32 -0
- package/src/capabilities/gen/workerd.ts +2 -2
- package/src/capabilities/index.ts +3 -3
- package/src/capabilities/react-surface.ts +4 -4
- package/src/components/SearchResultList/SearchResultList.stories.tsx +10 -8
- package/src/components/SearchResultList/SearchResultList.test.tsx +5 -5
- package/src/components/SearchResultList/SearchResultList.tsx +22 -31
- package/src/components/SearchResultList/index.ts +1 -1
- package/src/components/SearchResultStack/SearchResultStack.tsx +36 -39
- package/src/components/SearchResultStack/index.ts +1 -1
- package/src/components/index.ts +2 -2
- package/src/containers/SearchArticle/SearchArticle.stories.tsx +3 -3
- package/src/containers/SearchArticle/SearchArticle.tsx +14 -8
- package/src/containers/SearchArticle/index.ts +1 -1
- package/src/containers/SearchDialog/SearchDialog.stories.tsx +8 -9
- package/src/containers/SearchDialog/SearchDialog.tsx +21 -14
- package/src/containers/SearchDialog/index.ts +1 -1
- package/src/containers/index.ts +2 -2
- package/src/hooks/SearchContext.ts +1 -1
- package/src/hooks/index.ts +7 -7
- package/src/hooks/search-query.test.ts +1 -1
- package/src/hooks/search-query.ts +1 -1
- package/src/hooks/sync.test.ts +1 -1
- package/src/hooks/sync.ts +1 -1
- package/src/hooks/useGlobalSearch.tsx +2 -2
- package/src/hooks/useSearchResults.ts +17 -18
- package/src/hooks/useWebSearch.ts +2 -2
- package/src/index.ts +2 -3
- package/src/meta.ts +1 -1
- package/src/operations/index.ts +1 -1
- package/src/operations/open-search.ts +1 -1
- package/src/plugin.test.ts +73 -0
- package/src/search/exa.test.ts +1 -1
- package/src/search/exa.ts +4 -4
- package/src/search/index.ts +1 -1
- package/src/testing.ts +1 -1
- package/src/translations.ts +2 -2
- package/src/types/index.ts +2 -2
package/PLUGIN.mdl
CHANGED
|
@@ -17,9 +17,10 @@ Each extension is defined in the Appendix or resolved via its URI.
|
|
|
17
17
|
|-------------|--------------------------------|
|
|
18
18
|
| `type` | `org.dxos.mdl.type@1.0` |
|
|
19
19
|
| `feat` | `org.dxos.mdl.feat@1.0` |
|
|
20
|
-
| `
|
|
20
|
+
| `scenario` | `org.dxos.mdl.scenario@1.0` |
|
|
21
21
|
| `component` | `org.dxos.mdl.component@1.0` |
|
|
22
|
-
| `op` | `org.dxos.mdl.op@1.
|
|
22
|
+
| `op` | `org.dxos.mdl.op@1.1` |
|
|
23
|
+
| `test` | `org.dxos.mdl.test@1.0` |
|
|
23
24
|
|
|
24
25
|
## Types
|
|
25
26
|
|
|
@@ -103,6 +104,7 @@ component SearchArticle
|
|
|
103
104
|
|
|
104
105
|
```mdl
|
|
105
106
|
op OpenSearch
|
|
107
|
+
key: org.dxos.operation.search.open
|
|
106
108
|
desc: |
|
|
107
109
|
Opens the global SearchDialog by dispatching a LayoutOperation.UpdateDialog
|
|
108
110
|
event. No input parameters required; the dialog manages its own query state.
|
|
@@ -172,7 +174,7 @@ feat F-4: Mailbox Message Search
|
|
|
172
174
|
## Acceptance
|
|
173
175
|
|
|
174
176
|
```mdl
|
|
175
|
-
|
|
177
|
+
scenario T-1: OpenSearch operation opens dialog
|
|
176
178
|
given: user is in Composer with an active space
|
|
177
179
|
when: user triggers the OpenSearch operation (e.g. ⌘K)
|
|
178
180
|
then:
|
|
@@ -181,7 +183,7 @@ test T-1: OpenSearch operation opens dialog
|
|
|
181
183
|
```
|
|
182
184
|
|
|
183
185
|
```mdl
|
|
184
|
-
|
|
186
|
+
scenario T-2: Query returns matching objects
|
|
185
187
|
given: space contains a document with title "Meeting Notes"
|
|
186
188
|
when: user types "meeting" into SearchDialog
|
|
187
189
|
then:
|
|
@@ -191,21 +193,21 @@ test T-2: Query returns matching objects
|
|
|
191
193
|
```
|
|
192
194
|
|
|
193
195
|
```mdl
|
|
194
|
-
|
|
196
|
+
scenario T-3: Empty query shows no results
|
|
195
197
|
given: SearchDialog is open
|
|
196
198
|
when: user clears the query string
|
|
197
199
|
then: results list is empty; pending is false
|
|
198
200
|
```
|
|
199
201
|
|
|
200
202
|
```mdl
|
|
201
|
-
|
|
203
|
+
scenario T-4: GlobalFilter propagation
|
|
202
204
|
given: SearchContextProvider is mounted in the deck
|
|
203
205
|
when: user types "budget" in SearchArticle
|
|
204
206
|
then: all views using useGlobalFilteredObjects show only objects matching "budget"
|
|
205
207
|
```
|
|
206
208
|
|
|
207
209
|
```mdl
|
|
208
|
-
|
|
210
|
+
scenario T-5: Non-matching query shows empty state
|
|
209
211
|
given: space has no objects matching "xyzzy"
|
|
210
212
|
when: user types "xyzzy"
|
|
211
213
|
then:
|
|
@@ -215,6 +217,53 @@ test T-5: Non-matching query shows empty state
|
|
|
215
217
|
|
|
216
218
|
---
|
|
217
219
|
|
|
220
|
+
## QA
|
|
221
|
+
|
|
222
|
+
Executable tests. Each step carries a human instruction (`do`) and, where the step maps to an
|
|
223
|
+
invocable operation, an agent binding (`invoke`). Report failures by test and step number.
|
|
224
|
+
|
|
225
|
+
```mdl
|
|
226
|
+
test QA-1: Open search and find an object
|
|
227
|
+
desc: The core search round-trip — open the dialog, type a query, get a matching result.
|
|
228
|
+
actors: both
|
|
229
|
+
covers: [F-1.1, F-1.2, F-1.3, T-1, T-2]
|
|
230
|
+
status: unverified
|
|
231
|
+
given:
|
|
232
|
+
- an identity exists
|
|
233
|
+
- space: a space is open
|
|
234
|
+
- collection: a collection in that space, to create into
|
|
235
|
+
- doc: a Markdown document named "QA Search Target" exists in the collection (created via
|
|
236
|
+
plugin-markdown's [op:createDraft] and placed with `space.addObject`, per its own QA-1)
|
|
237
|
+
steps:
|
|
238
|
+
- name: Open the search dialog
|
|
239
|
+
do: Press ⌘K (or click the search icon).
|
|
240
|
+
invoke: [op:OpenSearch]
|
|
241
|
+
expect: SearchDialog is visible and the search input has focus
|
|
242
|
+
|
|
243
|
+
- name: Type a matching query
|
|
244
|
+
do: Type "QA Search Target" into the search input.
|
|
245
|
+
expect: a result row for "QA Search Target" appears, with matched field key "title" or "name"
|
|
246
|
+
and the value containing "QA Search Target"
|
|
247
|
+
note: |
|
|
248
|
+
No `invoke` — SearchDialog manages its own debounced (400 ms) query state internally; there
|
|
249
|
+
is no operation to type a query through. This step is human-only, which is why the test is
|
|
250
|
+
`actors: both` rather than `agent`.
|
|
251
|
+
|
|
252
|
+
- name: Select the result
|
|
253
|
+
do: Click the result row.
|
|
254
|
+
invoke: org.dxos.operation.appToolkit.open { subject: ["root/$given.space.id/content/collections/$given.doc.id"] }
|
|
255
|
+
expect: the editor opens "QA Search Target" and the dialog closes
|
|
256
|
+
note: |
|
|
257
|
+
The agent path approximates the click via direct navigation — SearchDialog's own
|
|
258
|
+
`selectResult` handler is internal UI state, not an operation.
|
|
259
|
+
after:
|
|
260
|
+
- name: Close the dialog if still open
|
|
261
|
+
do: Press Escape.
|
|
262
|
+
expect: SearchDialog is closed
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
218
267
|
## Appendix: Extension Definitions
|
|
219
268
|
|
|
220
269
|
Extension block types used in this document are defined below using
|
|
@@ -242,8 +291,8 @@ ext feat
|
|
|
242
291
|
```
|
|
243
292
|
|
|
244
293
|
```mdl
|
|
245
|
-
ext
|
|
246
|
-
uri: org.dxos.mdl.
|
|
294
|
+
ext scenario
|
|
295
|
+
uri: org.dxos.mdl.scenario@1.0
|
|
247
296
|
desc: An acceptance scenario expressed as given / when / then steps.
|
|
248
297
|
fields:
|
|
249
298
|
given?: Step | Step[]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { t as PLUGIN_default } from "./chunk-PLUGIN.mjs";
|
|
2
|
+
import * as ActivationEvents from "@dxos/app-framework/ActivationEvents";
|
|
3
|
+
import * as AppCapability from "@dxos/app-toolkit/AppCapability";
|
|
4
|
+
import { translations } from "#translations";
|
|
5
|
+
import { meta } from "#meta";
|
|
6
|
+
//#region src/capabilities/gen/browser.ts
|
|
7
|
+
var AppGraphBuilder = AppCapability.appGraphBuilder(() => import("./chunk-app-graph-builder.mjs"));
|
|
8
|
+
var OperationHandler = AppCapability.operationHandler(() => import("./chunk-operation-handler.mjs"), { activatesOn: ActivationEvents.Idle });
|
|
9
|
+
var PluginAsset = AppCapability.pluginAsset({
|
|
10
|
+
pluginId: meta.profile.key,
|
|
11
|
+
path: "PLUGIN.mdl",
|
|
12
|
+
content: PLUGIN_default,
|
|
13
|
+
mimeType: "application/x-mdl"
|
|
14
|
+
});
|
|
15
|
+
var ReactSurface = AppCapability.surface(() => import("./chunk-react-surface.mjs"), { roles: [
|
|
16
|
+
"org.dxos.role.deckCompanion.search",
|
|
17
|
+
"org.dxos.role.dialog",
|
|
18
|
+
"org.dxos.role.searchInput"
|
|
19
|
+
] });
|
|
20
|
+
var Translations = AppCapability.translations(translations);
|
|
21
|
+
//#endregion
|
|
22
|
+
export { AppGraphBuilder, OperationHandler, PluginAsset, ReactSurface, Translations };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=capabilities.browser.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.browser.mjs","names":[],"sources":["../../src/capabilities/gen/browser.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// GENERATED by dx-plugin — do not edit. Sliced from ../index.ts for the 'browser' condition.\n\nimport * as ActivationEvents from '@dxos/app-framework/ActivationEvents';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\n\nimport { meta } from '#meta';\nimport { translations } from '#translations';\n\nimport pluginSpec from '../../../PLUGIN.mdl?raw';\n\nexport const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('../app-graph-builder.ts'));\n\nexport const OperationHandler = AppCapability.operationHandler(() => import('../operation-handler.ts'), {\n activatesOn: ActivationEvents.Idle,\n});\n\nexport const PluginAsset = AppCapability.pluginAsset({\n pluginId: meta.profile.key,\n path: 'PLUGIN.mdl',\n content: pluginSpec,\n mimeType: 'application/x-mdl',\n});\n\nexport const ReactSurface = AppCapability.surface(() => import('../react-surface.ts'), {\n roles: ['org.dxos.role.deckCompanion.search', 'org.dxos.role.dialog', 'org.dxos.role.searchInput'],\n});\n\nexport const Translations = AppCapability.translations(translations);\n"],"mappings":";;;;;;AAcA,IAAa,kBAAkB,cAAc,sBAAsB,OAAO,gCAA0B;AAEpG,IAAa,mBAAmB,cAAc,uBAAuB,OAAO,kCAA4B,EACtG,aAAa,iBAAiB,KAChC,CAAC;AAED,IAAa,cAAc,cAAc,YAAY;CACnD,UAAU,KAAK,QAAQ;CACvB,MAAM;CACN,SAAS;CACT,UAAU;AACZ,CAAC;AAED,IAAa,eAAe,cAAc,cAAc,OAAO,8BAAwB,EACrF,OAAO;CAAC;CAAsC;CAAwB;AAA2B,EACnG,CAAC;AAED,IAAa,eAAe,cAAc,aAAa,YAAY"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
+
import { t as PLUGIN_default } from "./chunk-PLUGIN.mjs";
|
|
1
2
|
import * as ActivationEvents from "@dxos/app-framework/ActivationEvents";
|
|
2
3
|
import * as AppCapability from "@dxos/app-toolkit/AppCapability";
|
|
3
4
|
import { translations } from "#translations";
|
|
4
5
|
import { meta } from "#meta";
|
|
5
|
-
//#region PLUGIN.mdl?raw
|
|
6
|
-
var PLUGIN_default = "---\nid: org.dxos.plugin.search\nname: SearchPlugin\nversion: 0.1.0\n---\n\nA full-text search plugin for `DXOS` Composer that lets users locate objects within the\nactive space, ranked and highlighted against the space's FTS5 index. The same index also\nfilters messages in the mailbox.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\n```mdl\ntype SearchQuery\n fields:\n text: string # raw query string entered by the user\n spaceId?: string # optional scope; omit to search all spaces\n```\n\n```mdl\ntype MatchField\n fields:\n key: string # field name that matched (e.g. \"title\", \"body\")\n value: string # full field value containing the match\n```\n\n```mdl\ntype SearchResult\n fields:\n objectId: string # ECHO object DXN\n typeName: string # schema typename of the matched object\n fields: MatchField[] # list of fields where the query matched\n```\n\n## Components\n\n```mdl\ncomponent SearchDialog\n desc: |\n Modal command-palette style dialog invoked globally via the OpenSearch operation.\n Renders a search input at the top; results populate below in real time.\n props:\n space: Space # current active space to scope the search\n state:\n query: string # live query text\n results: SearchResult[] # objects matching the current query\n pending: boolean # true while debounced search is in-flight\n slots:\n empty?: ReactNode # shown when query is non-empty but results are empty\n actions:\n submitQuery(text: string)\n clearQuery()\n selectResult(result: SearchResult)\n emits:\n onSelect(result: SearchResult)\n layout: |\n ┌─────────────────────────────┐\n │ 🔍 [search input] │\n ├─────────────────────────────┤\n │ result row │\n │ result row │\n │ result row │\n │ [empty slot] │\n └─────────────────────────────┘\n```\n\n```mdl\ncomponent SearchArticle\n desc: |\n Inline search panel mounted in the deck companion (sidebar) and in the\n search-input role. Shares the same SearchContextProvider as SearchDialog\n so the active query filters objects across the whole Composer deck.\n props:\n space: Space\n state:\n query: string\n results: SearchResult[]\n actions:\n submitQuery(text: string)\n clearQuery()\n layout: |\n ┌─────────────────────────────┐\n │ [search input] │\n ├─────────────────────────────┤\n │ result list │\n └─────────────────────────────┘\n```\n\n## Operations\n\n```mdl\nop OpenSearch\n desc: |\n Opens the global SearchDialog by dispatching a LayoutOperation.UpdateDialog\n event. No input parameters required; the dialog manages its own query state.\n input: void\n output: void\n effects: [layout:dialog]\n note: Registered as SearchOperation.OpenSearch; triggered from the command palette.\n```\n\n## Features\n\n```mdl\nfeat F-1: Local Object Search\n\n req F-1.1: User can open SearchDialog from anywhere in Composer via the OpenSearch operation.\n\n req F-1.2:\n when: user types into the search input\n then: query is debounced (400 ms) then matched against all ECHO objects in the active space\n\n req F-1.3:\n when: an object's field value matches the query regex\n then: result entry shown with the object type, matched field key, and field value snippet\n\n req F-1.4:\n when: query is empty or cleared\n then: results list is empty; no search is executed\n```\n\n```mdl\nfeat F-2: Global Filter Integration\n\n req F-2.1:\n when: SearchContextProvider is mounted\n then: active query is propagated to GlobalFilterProvider so all views using\n useGlobalFilteredObjects automatically show only matching objects\n\n req F-2.2:\n when: query is cleared\n then: GlobalFilterProvider returns all objects unfiltered\n```\n\n```mdl\nfeat F-3: Deck Companion Search Panel\n\n req F-3.1:\n when: user opens the deck companion panel with role deck-companion--search\n then: SearchArticle is rendered scoped to the active Space\n\n req F-3.2:\n when: user types in SearchArticle\n then: results update in real time using the same debounced filter as SearchDialog\n```\n\n```mdl\nfeat F-4: Mailbox Message Search\n\n req F-4.1:\n when: user types a query in the mailbox search box\n then: messages are filtered against the same FTS5 index used by SearchDialog / SearchArticle\n\n req F-4.2:\n when: a message matches the query\n then: the matched text is highlighted in the message list\n```\n\n## Acceptance\n\n```mdl\ntest T-1: OpenSearch operation opens dialog\n given: user is in Composer with an active space\n when: user triggers the OpenSearch operation (e.g. ⌘K)\n then:\n - SearchDialog is visible\n - search input has focus\n```\n\n```mdl\ntest T-2: Query returns matching objects\n given: space contains a document with title \"Meeting Notes\"\n when: user types \"meeting\" into SearchDialog\n then:\n - result row for the document appears\n - matched field key is \"title\"\n - field value contains \"Meeting Notes\"\n```\n\n```mdl\ntest T-3: Empty query shows no results\n given: SearchDialog is open\n when: user clears the query string\n then: results list is empty; pending is false\n```\n\n```mdl\ntest T-4: GlobalFilter propagation\n given: SearchContextProvider is mounted in the deck\n when: user types \"budget\" in SearchArticle\n then: all views using useGlobalFilteredObjects show only objects matching \"budget\"\n```\n\n```mdl\ntest T-5: Non-matching query shows empty state\n given: space has no objects matching \"xyzzy\"\n when: user types \"xyzzy\"\n then:\n - results list is empty\n - empty slot is rendered\n```\n\n---\n\n## Appendix: Extension Definitions\n\nExtension block types used in this document are defined below using\nthe core `ext` primitive — the only construct the base language provides.\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap # name[?]: TypeExpr (# inline comment)\n literals?: UnionList # a | b | c\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self # feat blocks may contain feat blocks\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap # external inputs (immutable inside component)\n state?: FieldMap # internal reactive state\n slots?: FieldMap # named ReactNode injection points\n actions?: ActionMap # methods the component exposes or handles\n emits?: EventMap # events the component raises to its parent\n layout?: CodeBlock # ASCII sketch of visual structure (non-normative)\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap # named input parameters\n output?: TypeExpr # return type\n errors?: ErrorMap # name: Prose (when this error occurs)\n effects?: EffectList # echo:read | echo:write | http | fs | ...\n requires?: ServiceList # injected service dependencies\n note?: Prose # implementation guidance (non-normative)\n```\n";
|
|
7
|
-
//#endregion
|
|
8
6
|
//#region src/capabilities/index.ts
|
|
9
7
|
var AppGraphBuilder = AppCapability.appGraphBuilder(() => import("./chunk-app-graph-builder.mjs"));
|
|
10
8
|
var OperationHandler = AppCapability.operationHandler(() => import("./chunk-operation-handler.mjs"), { activatesOn: ActivationEvents.Idle });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.mjs","names":[],"sources":["../../src/capabilities/index.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as ActivationEvents from '@dxos/app-framework/ActivationEvents';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\n\nimport { meta } from '#meta';\nimport { translations } from '#translations';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../../PLUGIN.mdl?raw';\n\nexport const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('./app-graph-builder'));\nexport const OperationHandler = AppCapability.operationHandler(() => import('./operation-handler'), {\n activatesOn: ActivationEvents.Idle,\n});\nexport const PluginAsset = AppCapability.pluginAsset({\n pluginId: meta.profile.key,\n path: 'PLUGIN.mdl',\n content: pluginSpec,\n mimeType: 'application/x-mdl',\n});\nexport const ReactSurface = AppCapability.surface(() => import('./react-surface'), {\n roles: ['org.dxos.role.deckCompanion.search', 'org.dxos.role.dialog', 'org.dxos.role.searchInput'],\n});\nexport const Translations = AppCapability.translations(translations);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"capabilities.mjs","names":[],"sources":["../../src/capabilities/index.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as ActivationEvents from '@dxos/app-framework/ActivationEvents';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\n\nimport { meta } from '#meta';\nimport { translations } from '#translations';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../../PLUGIN.mdl?raw';\n\nexport const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('./app-graph-builder.ts'));\nexport const OperationHandler = AppCapability.operationHandler(() => import('./operation-handler.ts'), {\n activatesOn: ActivationEvents.Idle,\n});\nexport const PluginAsset = AppCapability.pluginAsset({\n pluginId: meta.profile.key,\n path: 'PLUGIN.mdl',\n content: pluginSpec,\n mimeType: 'application/x-mdl',\n});\nexport const ReactSurface = AppCapability.surface(() => import('./react-surface.ts'), {\n roles: ['org.dxos.role.deckCompanion.search', 'org.dxos.role.dialog', 'org.dxos.role.searchInput'],\n});\nexport const Translations = AppCapability.translations(translations);\n"],"mappings":";;;;;;AAaA,IAAa,kBAAkB,cAAc,sBAAsB,OAAO,gCAAyB;AACnG,IAAa,mBAAmB,cAAc,uBAAuB,OAAO,kCAA2B,EACrG,aAAa,iBAAiB,KAChC,CAAC;AACD,IAAa,cAAc,cAAc,YAAY;CACnD,UAAU,KAAK,QAAQ;CACvB,MAAM;CACN,SAAS;CACT,UAAU;AACZ,CAAC;AACD,IAAa,eAAe,cAAc,cAAc,OAAO,8BAAuB,EACpF,OAAO;CAAC;CAAsC;CAAwB;AAA2B,EACnG,CAAC;AACD,IAAa,eAAe,cAAc,aAAa,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.node.mjs","names":[],"sources":["../../src/capabilities/gen/node.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// GENERATED by dx-plugin — do not edit. Sliced from ../index.ts for the 'node' condition.\n\nimport * as ActivationEvents from '@dxos/app-framework/ActivationEvents';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\n\nimport { translations } from '#translations';\n\nexport const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('../app-graph-builder'));\n\nexport const OperationHandler = AppCapability.operationHandler(() => import('../operation-handler'), {\n activatesOn: ActivationEvents.Idle,\n});\n\nexport const Translations = AppCapability.translations(translations);\n\nexport const PluginAsset = undefined;\nexport const ReactSurface = undefined;\n"],"mappings":";;;;AAWA,IAAa,kBAAkB,cAAc,sBAAsB,OAAO,
|
|
1
|
+
{"version":3,"file":"capabilities.node.mjs","names":[],"sources":["../../src/capabilities/gen/node.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// GENERATED by dx-plugin — do not edit. Sliced from ../index.ts for the 'node' condition.\n\nimport * as ActivationEvents from '@dxos/app-framework/ActivationEvents';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\n\nimport { translations } from '#translations';\n\nexport const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('../app-graph-builder.ts'));\n\nexport const OperationHandler = AppCapability.operationHandler(() => import('../operation-handler.ts'), {\n activatesOn: ActivationEvents.Idle,\n});\n\nexport const Translations = AppCapability.translations(translations);\n\nexport const PluginAsset = undefined;\nexport const ReactSurface = undefined;\n"],"mappings":";;;;AAWA,IAAa,kBAAkB,cAAc,sBAAsB,OAAO,gCAA0B;AAEpG,IAAa,mBAAmB,cAAc,uBAAuB,OAAO,kCAA4B,EACtG,aAAa,iBAAiB,KAChC,CAAC;AAED,IAAa,eAAe,cAAc,aAAa,YAAY;AAEnE,IAAa,cAAc,KAAA;AAC3B,IAAa,eAAe,KAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { t as PLUGIN_default } from "./chunk-PLUGIN.mjs";
|
|
2
|
+
import * as ActivationEvents from "@dxos/app-framework/ActivationEvents";
|
|
3
|
+
import * as AppCapability from "@dxos/app-toolkit/AppCapability";
|
|
4
|
+
import { translations } from "#translations";
|
|
5
|
+
import { meta } from "#meta";
|
|
6
|
+
//#region src/capabilities/gen/tauri.ts
|
|
7
|
+
var AppGraphBuilder = AppCapability.appGraphBuilder(() => import("./chunk-app-graph-builder.mjs"));
|
|
8
|
+
var OperationHandler = AppCapability.operationHandler(() => import("./chunk-operation-handler.mjs"), { activatesOn: ActivationEvents.Idle });
|
|
9
|
+
var PluginAsset = AppCapability.pluginAsset({
|
|
10
|
+
pluginId: meta.profile.key,
|
|
11
|
+
path: "PLUGIN.mdl",
|
|
12
|
+
content: PLUGIN_default,
|
|
13
|
+
mimeType: "application/x-mdl"
|
|
14
|
+
});
|
|
15
|
+
var ReactSurface = AppCapability.surface(() => import("./chunk-react-surface.mjs"), { roles: [
|
|
16
|
+
"org.dxos.role.deckCompanion.search",
|
|
17
|
+
"org.dxos.role.dialog",
|
|
18
|
+
"org.dxos.role.searchInput"
|
|
19
|
+
] });
|
|
20
|
+
var Translations = AppCapability.translations(translations);
|
|
21
|
+
//#endregion
|
|
22
|
+
export { AppGraphBuilder, OperationHandler, PluginAsset, ReactSurface, Translations };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=capabilities.tauri.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.tauri.mjs","names":[],"sources":["../../src/capabilities/gen/tauri.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// GENERATED by dx-plugin — do not edit. Sliced from ../index.ts for the 'tauri' condition.\n\nimport * as ActivationEvents from '@dxos/app-framework/ActivationEvents';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\n\nimport { meta } from '#meta';\nimport { translations } from '#translations';\n\nimport pluginSpec from '../../../PLUGIN.mdl?raw';\n\nexport const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('../app-graph-builder.ts'));\n\nexport const OperationHandler = AppCapability.operationHandler(() => import('../operation-handler.ts'), {\n activatesOn: ActivationEvents.Idle,\n});\n\nexport const PluginAsset = AppCapability.pluginAsset({\n pluginId: meta.profile.key,\n path: 'PLUGIN.mdl',\n content: pluginSpec,\n mimeType: 'application/x-mdl',\n});\n\nexport const ReactSurface = AppCapability.surface(() => import('../react-surface.ts'), {\n roles: ['org.dxos.role.deckCompanion.search', 'org.dxos.role.dialog', 'org.dxos.role.searchInput'],\n});\n\nexport const Translations = AppCapability.translations(translations);\n"],"mappings":";;;;;;AAcA,IAAa,kBAAkB,cAAc,sBAAsB,OAAO,gCAA0B;AAEpG,IAAa,mBAAmB,cAAc,uBAAuB,OAAO,kCAA4B,EACtG,aAAa,iBAAiB,KAChC,CAAC;AAED,IAAa,cAAc,cAAc,YAAY;CACnD,UAAU,KAAK,QAAQ;CACvB,MAAM;CACN,SAAS;CACT,UAAU;AACZ,CAAC;AAED,IAAa,eAAe,cAAc,cAAc,OAAO,8BAAwB,EACrF,OAAO;CAAC;CAAsC;CAAwB;AAA2B,EACnG,CAAC;AAED,IAAa,eAAe,cAAc,aAAa,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.workerd.mjs","names":[],"sources":["../../src/capabilities/gen/workerd.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// GENERATED by dx-plugin — do not edit. Sliced from ../index.ts for the 'workerd' condition.\n\nimport * as ActivationEvents from '@dxos/app-framework/ActivationEvents';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\n\nimport { translations } from '#translations';\n\nexport const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('../app-graph-builder'));\n\nexport const OperationHandler = AppCapability.operationHandler(() => import('../operation-handler'), {\n activatesOn: ActivationEvents.Idle,\n});\n\nexport const Translations = AppCapability.translations(translations);\n\nexport const PluginAsset = undefined;\nexport const ReactSurface = undefined;\n"],"mappings":";;;;AAWA,IAAa,kBAAkB,cAAc,sBAAsB,OAAO,
|
|
1
|
+
{"version":3,"file":"capabilities.workerd.mjs","names":[],"sources":["../../src/capabilities/gen/workerd.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// GENERATED by dx-plugin — do not edit. Sliced from ../index.ts for the 'workerd' condition.\n\nimport * as ActivationEvents from '@dxos/app-framework/ActivationEvents';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\n\nimport { translations } from '#translations';\n\nexport const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('../app-graph-builder.ts'));\n\nexport const OperationHandler = AppCapability.operationHandler(() => import('../operation-handler.ts'), {\n activatesOn: ActivationEvents.Idle,\n});\n\nexport const Translations = AppCapability.translations(translations);\n\nexport const PluginAsset = undefined;\nexport const ReactSurface = undefined;\n"],"mappings":";;;;AAWA,IAAa,kBAAkB,cAAc,sBAAsB,OAAO,gCAA0B;AAEpG,IAAa,mBAAmB,cAAc,uBAAuB,OAAO,kCAA4B,EACtG,aAAa,iBAAiB,KAChC,CAAC;AAED,IAAa,eAAe,cAAc,aAAa,YAAY;AAEnE,IAAa,cAAc,KAAA;AAC3B,IAAa,eAAe,KAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region PLUGIN.mdl?raw
|
|
2
|
+
var PLUGIN_default = "---\nid: org.dxos.plugin.search\nname: SearchPlugin\nversion: 0.1.0\n---\n\nA full-text search plugin for `DXOS` Composer that lets users locate objects within the\nactive space, ranked and highlighted against the space's FTS5 index. The same index also\nfilters messages in the mailbox.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `scenario` | `org.dxos.mdl.scenario@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.1` |\n| `test` | `org.dxos.mdl.test@1.0` |\n\n## Types\n\n```mdl\ntype SearchQuery\n fields:\n text: string # raw query string entered by the user\n spaceId?: string # optional scope; omit to search all spaces\n```\n\n```mdl\ntype MatchField\n fields:\n key: string # field name that matched (e.g. \"title\", \"body\")\n value: string # full field value containing the match\n```\n\n```mdl\ntype SearchResult\n fields:\n objectId: string # ECHO object DXN\n typeName: string # schema typename of the matched object\n fields: MatchField[] # list of fields where the query matched\n```\n\n## Components\n\n```mdl\ncomponent SearchDialog\n desc: |\n Modal command-palette style dialog invoked globally via the OpenSearch operation.\n Renders a search input at the top; results populate below in real time.\n props:\n space: Space # current active space to scope the search\n state:\n query: string # live query text\n results: SearchResult[] # objects matching the current query\n pending: boolean # true while debounced search is in-flight\n slots:\n empty?: ReactNode # shown when query is non-empty but results are empty\n actions:\n submitQuery(text: string)\n clearQuery()\n selectResult(result: SearchResult)\n emits:\n onSelect(result: SearchResult)\n layout: |\n ┌─────────────────────────────┐\n │ 🔍 [search input] │\n ├─────────────────────────────┤\n │ result row │\n │ result row │\n │ result row │\n │ [empty slot] │\n └─────────────────────────────┘\n```\n\n```mdl\ncomponent SearchArticle\n desc: |\n Inline search panel mounted in the deck companion (sidebar) and in the\n search-input role. Shares the same SearchContextProvider as SearchDialog\n so the active query filters objects across the whole Composer deck.\n props:\n space: Space\n state:\n query: string\n results: SearchResult[]\n actions:\n submitQuery(text: string)\n clearQuery()\n layout: |\n ┌─────────────────────────────┐\n │ [search input] │\n ├─────────────────────────────┤\n │ result list │\n └─────────────────────────────┘\n```\n\n## Operations\n\n```mdl\nop OpenSearch\n key: org.dxos.operation.search.open\n desc: |\n Opens the global SearchDialog by dispatching a LayoutOperation.UpdateDialog\n event. No input parameters required; the dialog manages its own query state.\n input: void\n output: void\n effects: [layout:dialog]\n note: Registered as SearchOperation.OpenSearch; triggered from the command palette.\n```\n\n## Features\n\n```mdl\nfeat F-1: Local Object Search\n\n req F-1.1: User can open SearchDialog from anywhere in Composer via the OpenSearch operation.\n\n req F-1.2:\n when: user types into the search input\n then: query is debounced (400 ms) then matched against all ECHO objects in the active space\n\n req F-1.3:\n when: an object's field value matches the query regex\n then: result entry shown with the object type, matched field key, and field value snippet\n\n req F-1.4:\n when: query is empty or cleared\n then: results list is empty; no search is executed\n```\n\n```mdl\nfeat F-2: Global Filter Integration\n\n req F-2.1:\n when: SearchContextProvider is mounted\n then: active query is propagated to GlobalFilterProvider so all views using\n useGlobalFilteredObjects automatically show only matching objects\n\n req F-2.2:\n when: query is cleared\n then: GlobalFilterProvider returns all objects unfiltered\n```\n\n```mdl\nfeat F-3: Deck Companion Search Panel\n\n req F-3.1:\n when: user opens the deck companion panel with role deck-companion--search\n then: SearchArticle is rendered scoped to the active Space\n\n req F-3.2:\n when: user types in SearchArticle\n then: results update in real time using the same debounced filter as SearchDialog\n```\n\n```mdl\nfeat F-4: Mailbox Message Search\n\n req F-4.1:\n when: user types a query in the mailbox search box\n then: messages are filtered against the same FTS5 index used by SearchDialog / SearchArticle\n\n req F-4.2:\n when: a message matches the query\n then: the matched text is highlighted in the message list\n```\n\n## Acceptance\n\n```mdl\nscenario T-1: OpenSearch operation opens dialog\n given: user is in Composer with an active space\n when: user triggers the OpenSearch operation (e.g. ⌘K)\n then:\n - SearchDialog is visible\n - search input has focus\n```\n\n```mdl\nscenario T-2: Query returns matching objects\n given: space contains a document with title \"Meeting Notes\"\n when: user types \"meeting\" into SearchDialog\n then:\n - result row for the document appears\n - matched field key is \"title\"\n - field value contains \"Meeting Notes\"\n```\n\n```mdl\nscenario T-3: Empty query shows no results\n given: SearchDialog is open\n when: user clears the query string\n then: results list is empty; pending is false\n```\n\n```mdl\nscenario T-4: GlobalFilter propagation\n given: SearchContextProvider is mounted in the deck\n when: user types \"budget\" in SearchArticle\n then: all views using useGlobalFilteredObjects show only objects matching \"budget\"\n```\n\n```mdl\nscenario T-5: Non-matching query shows empty state\n given: space has no objects matching \"xyzzy\"\n when: user types \"xyzzy\"\n then:\n - results list is empty\n - empty slot is rendered\n```\n\n---\n\n## QA\n\nExecutable tests. Each step carries a human instruction (`do`) and, where the step maps to an\ninvocable operation, an agent binding (`invoke`). Report failures by test and step number.\n\n```mdl\ntest QA-1: Open search and find an object\n desc: The core search round-trip — open the dialog, type a query, get a matching result.\n actors: both\n covers: [F-1.1, F-1.2, F-1.3, T-1, T-2]\n status: unverified\n given:\n - an identity exists\n - space: a space is open\n - collection: a collection in that space, to create into\n - doc: a Markdown document named \"QA Search Target\" exists in the collection (created via\n plugin-markdown's [op:createDraft] and placed with `space.addObject`, per its own QA-1)\n steps:\n - name: Open the search dialog\n do: Press ⌘K (or click the search icon).\n invoke: [op:OpenSearch]\n expect: SearchDialog is visible and the search input has focus\n\n - name: Type a matching query\n do: Type \"QA Search Target\" into the search input.\n expect: a result row for \"QA Search Target\" appears, with matched field key \"title\" or \"name\"\n and the value containing \"QA Search Target\"\n note: |\n No `invoke` — SearchDialog manages its own debounced (400 ms) query state internally; there\n is no operation to type a query through. This step is human-only, which is why the test is\n `actors: both` rather than `agent`.\n\n - name: Select the result\n do: Click the result row.\n invoke: org.dxos.operation.appToolkit.open { subject: [\"root/$given.space.id/content/collections/$given.doc.id\"] }\n expect: the editor opens \"QA Search Target\" and the dialog closes\n note: |\n The agent path approximates the click via direct navigation — SearchDialog's own\n `selectResult` handler is internal UI state, not an operation.\n after:\n - name: Close the dialog if still open\n do: Press Escape.\n expect: SearchDialog is closed\n```\n\n---\n\n## Appendix: Extension Definitions\n\nExtension block types used in this document are defined below using\nthe core `ext` primitive — the only construct the base language provides.\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap # name[?]: TypeExpr (# inline comment)\n literals?: UnionList # a | b | c\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self # feat blocks may contain feat blocks\n```\n\n```mdl\next scenario\n uri: org.dxos.mdl.scenario@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap # external inputs (immutable inside component)\n state?: FieldMap # internal reactive state\n slots?: FieldMap # named ReactNode injection points\n actions?: ActionMap # methods the component exposes or handles\n emits?: EventMap # events the component raises to its parent\n layout?: CodeBlock # ASCII sketch of visual structure (non-normative)\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap # named input parameters\n output?: TypeExpr # return type\n errors?: ErrorMap # name: Prose (when this error occurs)\n effects?: EffectList # echo:read | echo:write | http | fs | ...\n requires?: ServiceList # injected service dependencies\n note?: Prose # implementation guidance (non-normative)\n```\n";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { PLUGIN_default as t };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=chunk-PLUGIN.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-PLUGIN.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { buildSearchQuery, toSearchResults, useGlobalSearch, useSearchableTypeUris } from "#hooks";
|
|
2
2
|
import { useCallback, useMemo, useState } from "react";
|
|
3
|
-
import { Panel, Toolbar } from "@dxos/react-ui";
|
|
4
3
|
import { SearchList } from "@dxos/react-ui-search";
|
|
5
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
5
|
import { Entity } from "@dxos/echo";
|
|
7
6
|
import { useQuery } from "@dxos/echo-react";
|
|
8
7
|
import { getHostPlatform, isTauri } from "@dxos/util";
|
|
8
|
+
import * as Icon from "@dxos/react-ui/Icon";
|
|
9
|
+
import * as Panel from "@dxos/react-ui/Panel";
|
|
10
|
+
import * as Toolbar from "@dxos/react-ui/Toolbar";
|
|
9
11
|
import { SearchResultStack } from "#components";
|
|
10
12
|
//#region src/containers/SearchArticle/SearchArticle.tsx
|
|
11
13
|
var SearchArticle = ({ space }) => {
|
|
@@ -22,18 +24,16 @@ var SearchArticle = ({ space }) => {
|
|
|
22
24
|
const autoFocus = !isTauri() || getHostPlatform() !== "ios";
|
|
23
25
|
return /* @__PURE__ */ jsx(SearchList.Root, {
|
|
24
26
|
onSearch: handleSearch,
|
|
25
|
-
children: /* @__PURE__ */ jsxs(Panel.Root, { children: [/* @__PURE__ */ jsx(Panel.
|
|
27
|
+
children: /* @__PURE__ */ jsxs(Panel.Root, { children: [/* @__PURE__ */ jsx(Panel.Header, { children: /* @__PURE__ */ jsx(Toolbar.Root, { children: /* @__PURE__ */ jsx(SearchList.Input, {
|
|
28
|
+
placeholder: "Search...",
|
|
29
|
+
autoFocus,
|
|
30
|
+
end: /* @__PURE__ */ jsx(Icon.Icon, { icon: "ph--magnifying-glass--regular" })
|
|
31
|
+
}) }) }), /* @__PURE__ */ jsx(Panel.Body, {
|
|
26
32
|
asChild: true,
|
|
27
33
|
children: /* @__PURE__ */ jsx(SearchResultStack, {
|
|
28
34
|
results: allResults,
|
|
29
35
|
query: query ?? ""
|
|
30
36
|
})
|
|
31
|
-
}), /* @__PURE__ */ jsx(Panel.Statusbar, {
|
|
32
|
-
asChild: true,
|
|
33
|
-
children: /* @__PURE__ */ jsx(Toolbar.Root, { children: /* @__PURE__ */ jsx(SearchList.Input, {
|
|
34
|
-
placeholder: "Search...",
|
|
35
|
-
autoFocus
|
|
36
|
-
}) })
|
|
37
37
|
})] })
|
|
38
38
|
});
|
|
39
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-SearchArticle.mjs","names":[],"sources":["../../src/containers/SearchArticle/SearchArticle.tsx"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport
|
|
1
|
+
{"version":3,"file":"chunk-SearchArticle.mjs","names":[],"sources":["../../src/containers/SearchArticle/SearchArticle.tsx"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport * as AppSurface from '@dxos/app-toolkit/AppSurface';\nimport { Entity } from '@dxos/echo';\nimport { useQuery } from '@dxos/echo-react';\nimport { SearchList } from '@dxos/react-ui-search';\nimport * as Icon from '@dxos/react-ui/Icon';\nimport * as Panel from '@dxos/react-ui/Panel';\nimport * as Toolbar from '@dxos/react-ui/Toolbar';\nimport { getHostPlatform, isTauri } from '@dxos/util';\n\nimport { SearchResultStack } from '#components';\nimport { buildSearchQuery, toSearchResults, useGlobalSearch, useSearchableTypeUris } from '#hooks';\n\nexport const SearchArticle = ({ space }: AppSurface.SpaceArticleProps) => {\n // TODO(burdon): Cross-space search — Milestone 2 (fan-out + merge).\n const [query, setQuery] = useState<string>();\n // Scope the FTS query to user-facing types so results match what the app can render.\n const typeUris = useSearchableTypeUris(space);\n const objects = useQuery(space.db, buildSearchQuery(query, typeUris));\n const { setMatch } = useGlobalSearch();\n const results = useMemo(() => (query ? toSearchResults(objects, query) : []), [objects, query]);\n const allResults = useMemo(() => results.filter(({ object }) => object && Entity.getLabel(object)), [results]);\n\n const handleSearch = useCallback(\n (text: string) => {\n setQuery(text);\n setMatch?.(text);\n },\n [setMatch],\n );\n\n const autoFocus = !isTauri() || getHostPlatform() !== 'ios';\n\n // TODO(burdon): Move current up/down without losing focus.\n return (\n <SearchList.Root onSearch={handleSearch}>\n <Panel.Root>\n <Panel.Header>\n <Toolbar.Root>\n <SearchList.Input\n placeholder='Search...'\n autoFocus={autoFocus}\n end={<Icon.Icon icon='ph--magnifying-glass--regular' />}\n />\n </Toolbar.Root>\n </Panel.Header>\n <Panel.Body asChild>\n <SearchResultStack results={allResults} query={query ?? ''} />\n </Panel.Body>\n </Panel.Root>\n </SearchList.Root>\n );\n};\n\nSearchArticle.displayName = 'SearchArticle';\n"],"mappings":";;;;;;;;;;;;AAkBA,IAAa,iBAAiB,EAAE,YAA0C;CAExE,MAAM,CAAC,OAAO,YAAY,SAAiB;CAE3C,MAAM,WAAW,sBAAsB,KAAK;CAC5C,MAAM,UAAU,SAAS,MAAM,IAAI,iBAAiB,OAAO,QAAQ,CAAC;CACpE,MAAM,EAAE,aAAa,gBAAgB;CACrC,MAAM,UAAU,cAAe,QAAQ,gBAAgB,SAAS,KAAK,IAAI,CAAC,GAAI,CAAC,SAAS,KAAK,CAAC;CAC9F,MAAM,aAAa,cAAc,QAAQ,QAAQ,EAAE,aAAa,UAAU,OAAO,SAAS,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;CAE7G,MAAM,eAAe,aAClB,SAAiB;EAChB,SAAS,IAAI;EACb,WAAW,IAAI;CACjB,GACA,CAAC,QAAQ,CACX;CAEA,MAAM,YAAY,CAAC,QAAQ,KAAK,gBAAgB,MAAM;CAGtD,OACE,oBAAC,WAAW,MAAZ;EAAiB,UAAU;EACzB,UAAA,qBAAC,MAAM,MAAP,EAAA,UAAA,CACE,oBAAC,MAAM,QAAP,EAAA,UACE,oBAAC,QAAQ,MAAT,EAAA,UACE,oBAAC,WAAW,OAAZ;GACE,aAAY;GACD;GACX,KAAK,oBAAC,KAAK,MAAN,EAAW,MAAK,gCAAiC,CAAA;EACvD,CAAA,EACW,CAAA,EACF,CAAA,GACd,oBAAC,MAAM,MAAP;GAAY,SAAA;GACV,UAAA,oBAAC,mBAAD;IAAmB,SAAS;IAAY,OAAO,SAAS;GAAK,CAAA;EACnD,CAAA,CACF,EAAA,CAAA;CACG,CAAA;AAErB;AAEA,cAAc,cAAc"}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { meta } from "#meta";
|
|
2
2
|
import { buildSearchQuery, toSearchResults, useGlobalSearch, useSearchableTypeUris } from "#hooks";
|
|
3
3
|
import { useCallback, useMemo, useState } from "react";
|
|
4
|
-
import { Dialog, useTranslation } from "@dxos/react-ui";
|
|
5
4
|
import { SearchList } from "@dxos/react-ui-search";
|
|
5
|
+
import * as UiHooks from "@dxos/react-ui/Hooks";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import
|
|
8
|
-
import { useLayout } from "@dxos/app-toolkit/ui";
|
|
7
|
+
import * as ToolkitHooks from "@dxos/app-toolkit/Hooks";
|
|
9
8
|
import { Entity, Obj } from "@dxos/echo";
|
|
10
9
|
import { useQuery } from "@dxos/echo-react";
|
|
11
10
|
import * as GraphPath from "@dxos/app-toolkit/GraphPath";
|
|
11
|
+
import * as Hooks from "@dxos/app-framework/Hooks";
|
|
12
12
|
import * as LayoutOperation from "@dxos/app-toolkit/LayoutOperation";
|
|
13
|
+
import * as Dialog from "@dxos/react-ui/Dialog";
|
|
14
|
+
import * as SystemButton from "@dxos/react-ui/SystemButton";
|
|
13
15
|
//#region src/containers/SearchDialog/SearchDialog.tsx
|
|
14
16
|
var SearchDialog = ({ space, pivotId: pivotIdProp }) => {
|
|
15
|
-
const { t } = useTranslation(meta.profile.key);
|
|
16
|
-
const { invokePromise } = useOperationInvoker();
|
|
17
|
+
const { t } = UiHooks.useTranslation(meta.profile.key);
|
|
18
|
+
const { invokePromise } = Hooks.useOperationInvoker();
|
|
17
19
|
const { setMatch } = useGlobalSearch();
|
|
18
|
-
const layout = useLayout();
|
|
20
|
+
const layout = ToolkitHooks.useLayout();
|
|
19
21
|
const pivotId = pivotIdProp ?? layout.active[layout.active.length - 1];
|
|
20
22
|
const [query, setQuery] = useState();
|
|
21
23
|
const typeUris = useSearchableTypeUris(space);
|
|
@@ -36,15 +38,18 @@ var SearchDialog = ({ space, pivotId: pivotIdProp }) => {
|
|
|
36
38
|
disposition: "add"
|
|
37
39
|
});
|
|
38
40
|
}, [pivotId, invokePromise]);
|
|
39
|
-
return /* @__PURE__ */ jsxs(Dialog.Content, { children: [/* @__PURE__ */ jsxs(Dialog.Header, { children: [/* @__PURE__ */ jsx(Dialog.Title, { children: t("search-dialog.title") }), /* @__PURE__ */ jsx(Dialog.
|
|
41
|
+
return /* @__PURE__ */ jsxs(Dialog.Content, { children: [/* @__PURE__ */ jsxs(Dialog.Header, { children: [/* @__PURE__ */ jsx(Dialog.Title, { children: t("search-dialog.title") }), /* @__PURE__ */ jsx(Dialog.CloseTrigger, {
|
|
40
42
|
asChild: true,
|
|
41
|
-
children: /* @__PURE__ */ jsx(
|
|
43
|
+
children: /* @__PURE__ */ jsx(SystemButton.Close, {})
|
|
42
44
|
})] }), /* @__PURE__ */ jsx(Dialog.Body, { children: /* @__PURE__ */ jsxs(SearchList.Root, {
|
|
43
45
|
onSearch: handleSearch,
|
|
46
|
+
resetSelectionOnChange: true,
|
|
44
47
|
children: [/* @__PURE__ */ jsx(SearchList.Input, {
|
|
45
48
|
classNames: "px-0",
|
|
46
49
|
autoFocus: true,
|
|
47
|
-
|
|
50
|
+
escapeBehavior: "dismiss",
|
|
51
|
+
placeholder: t("search.placeholder"),
|
|
52
|
+
[Dialog.DIALOG_AUTOFOCUS_ATTRIBUTE]: ""
|
|
48
53
|
}), /* @__PURE__ */ jsxs(SearchList.Viewport, {
|
|
49
54
|
classNames: "max-h-[24rem]",
|
|
50
55
|
children: [query && allResults.length === 0 && /* @__PURE__ */ jsx(SearchList.Empty, {}), allResults.map((result) => /* @__PURE__ */ jsx(SearchList.Item, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-SearchDialog.mjs","names":[],"sources":["../../src/containers/SearchDialog/SearchDialog.tsx"],"sourcesContent":["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport
|
|
1
|
+
{"version":3,"file":"chunk-SearchDialog.mjs","names":[],"sources":["../../src/containers/SearchDialog/SearchDialog.tsx"],"sourcesContent":["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport * as Hooks from '@dxos/app-framework/Hooks';\nimport type * as AppSurface from '@dxos/app-toolkit/AppSurface';\nimport * as GraphPath from '@dxos/app-toolkit/GraphPath';\nimport * as ToolkitHooks from '@dxos/app-toolkit/Hooks';\nimport * as LayoutOperation from '@dxos/app-toolkit/LayoutOperation';\nimport { Entity, Obj } from '@dxos/echo';\nimport { useQuery } from '@dxos/echo-react';\nimport { SearchList, type SearchResult } from '@dxos/react-ui-search';\nimport * as Dialog from '@dxos/react-ui/Dialog';\nimport * as UiHooks from '@dxos/react-ui/Hooks';\nimport * as SystemButton from '@dxos/react-ui/SystemButton';\n\nimport { buildSearchQuery, toSearchResults, useGlobalSearch, useSearchableTypeUris } from '#hooks';\nimport { meta } from '#meta';\n\nexport type SearchDialogProps = AppSurface.SpaceArticleProps<{\n pivotId?: string;\n}>;\n\nexport const SearchDialog = ({ space, pivotId: pivotIdProp }: SearchDialogProps) => {\n const { t } = UiHooks.useTranslation(meta.profile.key);\n const { invokePromise } = Hooks.useOperationInvoker();\n const { setMatch } = useGlobalSearch();\n const layout = ToolkitHooks.useLayout();\n const pivotId = pivotIdProp ?? layout.active[layout.active.length - 1];\n const [query, setQuery] = useState<string>();\n\n // Scope the FTS query to user-facing types so results match what the app can render.\n const typeUris = useSearchableTypeUris(space);\n const objects = useQuery(space?.db, buildSearchQuery(query, typeUris));\n const results = useMemo(() => (query ? toSearchResults(objects, query) : []), [objects, query]);\n const allResults = useMemo(() => results.filter(({ object }) => object && Entity.getLabel(object)), [results]);\n\n const handleSearch = useCallback(\n (text: string) => {\n setQuery(text);\n setMatch?.(text);\n },\n [setMatch],\n );\n\n const handleSelect = useCallback(\n async (result: SearchResult) => {\n if (!result.object || !Obj.isObject(result.object)) {\n return;\n }\n\n const qualifiedPath = GraphPath.getObjectPathFromObject(result.object);\n await invokePromise(LayoutOperation.UpdateDialog, { state: false });\n await invokePromise(LayoutOperation.Open, {\n subject: [qualifiedPath],\n pivotId,\n disposition: 'add',\n });\n },\n [pivotId, invokePromise],\n );\n\n return (\n <Dialog.Content>\n <Dialog.Header>\n <Dialog.Title>{t('search-dialog.title')}</Dialog.Title>\n <Dialog.CloseTrigger asChild>\n <SystemButton.Close />\n </Dialog.CloseTrigger>\n </Dialog.Header>\n <Dialog.Body>\n <SearchList.Root onSearch={handleSearch} resetSelectionOnChange>\n <SearchList.Input\n classNames='px-0'\n autoFocus\n escapeBehavior='dismiss'\n placeholder={t('search.placeholder')}\n {...{ [Dialog.DIALOG_AUTOFOCUS_ATTRIBUTE]: '' }}\n />\n <SearchList.Viewport classNames='max-h-[24rem]'>\n {query && allResults.length === 0 && <SearchList.Empty />}\n {allResults.map((result) => (\n <SearchList.Item\n key={result.id}\n classNames='flex gap-2 items-center'\n icon={result.icon}\n value={result.id}\n label={result.label ?? (result.object ? Entity.getLabel(result.object) : undefined) ?? result.id}\n onSelect={() => void handleSelect(result)}\n />\n ))}\n </SearchList.Viewport>\n </SearchList.Root>\n </Dialog.Body>\n </Dialog.Content>\n );\n};\n\nSearchDialog.displayName = 'SearchDialog';\n"],"mappings":";;;;;;;;;;;;;;;AAyBA,IAAa,gBAAgB,EAAE,OAAO,SAAS,kBAAqC;CAClF,MAAM,EAAE,MAAM,QAAQ,eAAe,KAAK,QAAQ,GAAG;CACrD,MAAM,EAAE,kBAAkB,MAAM,oBAAoB;CACpD,MAAM,EAAE,aAAa,gBAAgB;CACrC,MAAM,SAAS,aAAa,UAAU;CACtC,MAAM,UAAU,eAAe,OAAO,OAAO,OAAO,OAAO,SAAS;CACpE,MAAM,CAAC,OAAO,YAAY,SAAiB;CAG3C,MAAM,WAAW,sBAAsB,KAAK;CAC5C,MAAM,UAAU,SAAS,OAAO,IAAI,iBAAiB,OAAO,QAAQ,CAAC;CACrE,MAAM,UAAU,cAAe,QAAQ,gBAAgB,SAAS,KAAK,IAAI,CAAC,GAAI,CAAC,SAAS,KAAK,CAAC;CAC9F,MAAM,aAAa,cAAc,QAAQ,QAAQ,EAAE,aAAa,UAAU,OAAO,SAAS,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;CAE7G,MAAM,eAAe,aAClB,SAAiB;EAChB,SAAS,IAAI;EACb,WAAW,IAAI;CACjB,GACA,CAAC,QAAQ,CACX;CAEA,MAAM,eAAe,YACnB,OAAO,WAAyB;EAC9B,IAAI,CAAC,OAAO,UAAU,CAAC,IAAI,SAAS,OAAO,MAAM,GAC/C;EAGF,MAAM,gBAAgB,UAAU,wBAAwB,OAAO,MAAM;EACrE,MAAM,cAAc,gBAAgB,cAAc,EAAE,OAAO,MAAM,CAAC;EAClE,MAAM,cAAc,gBAAgB,MAAM;GACxC,SAAS,CAAC,aAAa;GACvB;GACA,aAAa;EACf,CAAC;CACH,GACA,CAAC,SAAS,aAAa,CACzB;CAEA,OACE,qBAAC,OAAO,SAAR,EAAA,UAAA,CACE,qBAAC,OAAO,QAAR,EAAA,UAAA,CACE,oBAAC,OAAO,OAAR,EAAA,UAAe,EAAE,qBAAqB,EAAgB,CAAA,GACtD,oBAAC,OAAO,cAAR;EAAqB,SAAA;EACnB,UAAA,oBAAC,aAAa,OAAd,CAAqB,CAAA;CACF,CAAA,CACR,EAAA,CAAA,GACf,oBAAC,OAAO,MAAR,EAAA,UACE,qBAAC,WAAW,MAAZ;EAAiB,UAAU;EAAc,wBAAA;EAAzC,UAAA,CACE,oBAAC,WAAW,OAAZ;GACE,YAAW;GACX,WAAA;GACA,gBAAe;GACf,aAAa,EAAE,oBAAoB;IAC5B,OAAO,6BAA6B;EAC5C,CAAA,GACD,qBAAC,WAAW,UAAZ;GAAqB,YAAW;GAAhC,UAAA,CACG,SAAS,WAAW,WAAW,KAAK,oBAAC,WAAW,OAAZ,CAAmB,CAAA,GACvD,WAAW,KAAK,WACf,oBAAC,WAAW,MAAZ;IAEE,YAAW;IACX,MAAM,OAAO;IACb,OAAO,OAAO;IACd,OAAO,OAAO,UAAU,OAAO,SAAS,OAAO,SAAS,OAAO,MAAM,IAAI,KAAA,MAAc,OAAO;IAC9F,gBAAgB,KAAK,aAAa,MAAM;GACzC,GANM,OAAO,EAMb,CACF,CACkB;EACN,CAAA,CAAA;CACN,CAAA,EAAA,CAAA,CACC,EAAA,CAAA;AAEpB;AAEA,aAAa,cAAc"}
|
|
@@ -2,6 +2,7 @@ import { meta } from "#meta";
|
|
|
2
2
|
import { SearchOperation } from "#types";
|
|
3
3
|
import * as Operation from "@dxos/compute/Operation";
|
|
4
4
|
import * as Effect from "effect/Effect";
|
|
5
|
+
import * as Atom from "effect/reactivity/Atom";
|
|
5
6
|
import * as Capability from "@dxos/app-framework/Capability";
|
|
6
7
|
import * as AppGraphBuilder from "@dxos/app-graph/AppGraphBuilder";
|
|
7
8
|
import * as AppCapabilities from "@dxos/app-toolkit/AppCapabilities";
|
|
@@ -13,24 +14,32 @@ import { Attention } from "@dxos/react-ui-attention/types";
|
|
|
13
14
|
//#region src/capabilities/app-graph-builder.ts
|
|
14
15
|
var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
15
16
|
const clientAtom = yield* Capability.atom(ClientCapabilities.Client);
|
|
17
|
+
const initializedClientAtom = Atom.make((get) => {
|
|
18
|
+
const [client] = get(clientAtom);
|
|
19
|
+
if (client && !client.initialized) {
|
|
20
|
+
client.waitUntilInitialized().then(() => get.setSelf(client));
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
return client;
|
|
24
|
+
});
|
|
16
25
|
const layoutCapabilityAtom = yield* Capability.atom(AppCapabilities.Layout);
|
|
17
26
|
const extensions = yield* Effect.all([AppGraphBuilder.createExtension({
|
|
18
27
|
id: "spaceSearch",
|
|
28
|
+
relation: AppNode.companion,
|
|
19
29
|
match: GraphNodeMatcher.whenRoot,
|
|
20
|
-
connector: (
|
|
21
|
-
const
|
|
22
|
-
if (!client) return [];
|
|
30
|
+
connector: (_node, get) => Effect.sync(() => {
|
|
31
|
+
const client = get(initializedClientAtom);
|
|
23
32
|
const [layoutAtom] = get(layoutCapabilityAtom);
|
|
24
33
|
const layout = layoutAtom ? get(layoutAtom) : void 0;
|
|
25
34
|
const spaceId = layout?.workspace ? GraphPath.getSpaceIdFromPath(layout.workspace) : void 0;
|
|
26
|
-
const space = spaceId ? client.spaces.get(spaceId) :
|
|
35
|
+
const space = client && spaceId ? client.spaces.get(spaceId) : void 0;
|
|
27
36
|
return [AppNode.makeDeckCompanion({
|
|
28
37
|
id: Attention.linkedSegment("search"),
|
|
29
38
|
label: ["search.label", { ns: meta.profile.key }],
|
|
30
39
|
icon: "ph--magnifying-glass--regular",
|
|
31
|
-
data: space
|
|
40
|
+
data: space ?? null
|
|
32
41
|
})];
|
|
33
|
-
})
|
|
42
|
+
})
|
|
34
43
|
}), AppGraphBuilder.createExtension({
|
|
35
44
|
id: "root",
|
|
36
45
|
match: GraphNodeMatcher.whenRoot,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-app-graph-builder.mjs","names":[],"sources":["../../src/capabilities/app-graph-builder.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppGraphBuilder from '@dxos/app-graph/AppGraphBuilder';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as AppNode from '@dxos/app-toolkit/AppNode';\nimport * as GraphPath from '@dxos/app-toolkit/GraphPath';\nimport * as Operation from '@dxos/compute/Operation';\nimport * as GraphNodeMatcher from '@dxos/graph/GraphNodeMatcher';\nimport * as ClientCapabilities from '@dxos/plugin-client/ClientCapabilities';\nimport { Attention } from '@dxos/react-ui-attention/types';\n\nimport { meta } from '#meta';\nimport { SearchOperation } from '#types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n // Reactive read: the connector may evaluate before the client module finishes\n // activating; the atom dependency re-evaluates it when the client lands.\n const clientAtom = yield* Capability.atom(ClientCapabilities.Client);\n // Layout is optional: in standalone harnesses (Storybook, tests) no plugin contributes\n // `AppCapabilities.Layout`; hoisting the atom lets the connector heal reactively if it lands.\n const layoutCapabilityAtom = yield* Capability.atom(AppCapabilities.Layout);\n const extensions = yield* Effect.all([\n AppGraphBuilder.createExtension({\n id: 'spaceSearch',\n match: GraphNodeMatcher.whenRoot,\n connector: (
|
|
1
|
+
{"version":3,"file":"chunk-app-graph-builder.mjs","names":[],"sources":["../../src/capabilities/app-graph-builder.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Atom from 'effect/reactivity/Atom';\n\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppGraphBuilder from '@dxos/app-graph/AppGraphBuilder';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as AppNode from '@dxos/app-toolkit/AppNode';\nimport * as GraphPath from '@dxos/app-toolkit/GraphPath';\nimport * as Operation from '@dxos/compute/Operation';\nimport * as GraphNodeMatcher from '@dxos/graph/GraphNodeMatcher';\nimport * as ClientCapabilities from '@dxos/plugin-client/ClientCapabilities';\nimport { Attention } from '@dxos/react-ui-attention/types';\n\nimport { meta } from '#meta';\nimport { SearchOperation } from '#types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n // Reactive read: the connector may evaluate before the client module finishes\n // activating; the atom dependency re-evaluates it when the client lands.\n const clientAtom = yield* Capability.atom(ClientCapabilities.Client);\n // TODO(wittjosiah): Factor out initialized atom?\n const initializedClientAtom = Atom.make((get) => {\n const [client] = get(clientAtom);\n if (client && !client.initialized) {\n void client.waitUntilInitialized().then(() => get.setSelf(client));\n return undefined;\n }\n return client;\n });\n // Layout is optional: in standalone harnesses (Storybook, tests) no plugin contributes\n // `AppCapabilities.Layout`; hoisting the atom lets the connector heal reactively if it lands.\n const layoutCapabilityAtom = yield* Capability.atom(AppCapabilities.Layout);\n const extensions = yield* Effect.all([\n AppGraphBuilder.createExtension({\n id: 'spaceSearch',\n relation: AppNode.companion,\n match: GraphNodeMatcher.whenRoot,\n connector: (_node, get) =>\n Effect.sync(() => {\n const client = get(initializedClientAtom);\n const [layoutAtom] = get(layoutCapabilityAtom);\n const layout = layoutAtom ? get(layoutAtom) : undefined;\n const spaceId = layout?.workspace ? GraphPath.getSpaceIdFromPath(layout.workspace) : undefined;\n const space = client && spaceId ? client.spaces.get(spaceId) : undefined;\n\n return [\n AppNode.makeDeckCompanion({\n id: Attention.linkedSegment('search'),\n label: ['search.label', { ns: meta.profile.key }],\n icon: 'ph--magnifying-glass--regular',\n data: space ?? null,\n }),\n ];\n }),\n }),\n AppGraphBuilder.createExtension({\n id: 'root',\n match: GraphNodeMatcher.whenRoot,\n actions: () =>\n Effect.succeed([\n {\n id: SearchOperation.OpenSearch.meta.key,\n data: Effect.fnUntraced(function* () {\n yield* Operation.invoke(SearchOperation.OpenSearch);\n return false;\n }),\n properties: {\n label: ['search-action.label', { ns: meta.profile.key }],\n icon: 'ph--magnifying-glass--regular',\n keyBinding: {\n macos: 'meta+k',\n windows: 'ctrl+k',\n },\n },\n },\n ]),\n }),\n ]);\n\n return Capability.contribute(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],"mappings":";;;;;;;;;;;;;;AAoBA,IAAA,4BAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAG7B,MAAM,aAAa,OAAO,WAAW,KAAK,mBAAmB,MAAM;CAEnE,MAAM,wBAAwB,KAAK,MAAM,QAAQ;EAC/C,MAAM,CAAC,UAAU,IAAI,UAAU;EAC/B,IAAI,UAAU,CAAC,OAAO,aAAa;GACjC,OAAY,qBAAqB,CAAC,CAAC,WAAW,IAAI,QAAQ,MAAM,CAAC;GACjE;EACF;EACA,OAAO;CACT,CAAC;CAGD,MAAM,uBAAuB,OAAO,WAAW,KAAK,gBAAgB,MAAM;CAC1E,MAAM,aAAa,OAAO,OAAO,IAAI,CACnC,gBAAgB,gBAAgB;EAC9B,IAAI;EACJ,UAAU,QAAQ;EAClB,OAAO,iBAAiB;EACxB,YAAY,OAAO,QACjB,OAAO,WAAW;GAChB,MAAM,SAAS,IAAI,qBAAqB;GACxC,MAAM,CAAC,cAAc,IAAI,oBAAoB;GAC7C,MAAM,SAAS,aAAa,IAAI,UAAU,IAAI,KAAA;GAC9C,MAAM,UAAU,QAAQ,YAAY,UAAU,mBAAmB,OAAO,SAAS,IAAI,KAAA;GACrF,MAAM,QAAQ,UAAU,UAAU,OAAO,OAAO,IAAI,OAAO,IAAI,KAAA;GAE/D,OAAO,CACL,QAAQ,kBAAkB;IACxB,IAAI,UAAU,cAAc,QAAQ;IACpC,OAAO,CAAC,gBAAgB,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC;IAChD,MAAM;IACN,MAAM,SAAS;GACjB,CAAC,CACH;EACF,CAAC;CACL,CAAC,GACD,gBAAgB,gBAAgB;EAC9B,IAAI;EACJ,OAAO,iBAAiB;EACxB,eACE,OAAO,QAAQ,CACb;GACE,IAAI,gBAAgB,WAAW,KAAK;GACpC,MAAM,OAAO,WAAW,aAAa;IACnC,OAAO,UAAU,OAAO,gBAAgB,UAAU;IAClD,OAAO;GACT,CAAC;GACD,YAAY;IACV,OAAO,CAAC,uBAAuB,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC;IACvD,MAAM;IACN,YAAY;KACV,OAAO;KACP,SAAS;IACX;GACF;EACF,CACF,CAAC;CACL,CAAC,CACH,CAAC;CAED,OAAO,WAAW,WAAW,gBAAgB,iBAAiB,UAAU;AAC1E,CAAC,CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-open-search.mjs","names":[],"sources":["../../src/operations/open-search.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as LayoutOperation from '@dxos/app-toolkit/LayoutOperation';\nimport * as Operation from '@dxos/compute/Operation';\n\nimport { SearchOperation } from '#types';\n\nimport { SEARCH_DIALOG } from '../constants';\n\nconst handler: Operation.WithHandler<typeof SearchOperation.OpenSearch> = SearchOperation.OpenSearch.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* () {\n yield* Operation.invoke(LayoutOperation.UpdateDialog, {\n subject: SEARCH_DIALOG,\n blockAlign: 'start',\n });\n }),\n ),\n);\n\nexport default handler;\n"],"mappings":";;;;;;AAaA,IAAM,UAAoE,gBAAgB,WAAW,KACnG,UAAU,YACR,OAAO,WAAW,aAAa;CAC7B,OAAO,UAAU,OAAO,gBAAgB,cAAc;EACpD,SAAS;EACT,YAAY;CACd,CAAC;AACH,CAAC,CACH,CACF"}
|
|
1
|
+
{"version":3,"file":"chunk-open-search.mjs","names":[],"sources":["../../src/operations/open-search.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as LayoutOperation from '@dxos/app-toolkit/LayoutOperation';\nimport * as Operation from '@dxos/compute/Operation';\n\nimport { SearchOperation } from '#types';\n\nimport { SEARCH_DIALOG } from '../constants.ts';\n\nconst handler: Operation.WithHandler<typeof SearchOperation.OpenSearch> = SearchOperation.OpenSearch.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* () {\n yield* Operation.invoke(LayoutOperation.UpdateDialog, {\n subject: SEARCH_DIALOG,\n blockAlign: 'start',\n });\n }),\n ),\n);\n\nexport default handler;\n"],"mappings":";;;;;;AAaA,IAAM,UAAoE,gBAAgB,WAAW,KACnG,UAAU,YACR,OAAO,WAAW,aAAa;CAC7B,OAAO,UAAU,OAAO,gBAAgB,cAAc;EACpD,SAAS;EACT,YAAY;CACd,CAAC;AACH,CAAC,CACH,CACF"}
|
|
@@ -2,8 +2,9 @@ import { t as SEARCH_DIALOG } from "./chunk-constants.mjs";
|
|
|
2
2
|
import { SearchContextProvider } from "#hooks";
|
|
3
3
|
import "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import * as Surface from "@dxos/app-framework/Surface";
|
|
6
|
+
import * as AppSurface from "@dxos/app-toolkit/AppSurface";
|
|
7
|
+
import * as Hooks from "@dxos/app-toolkit/Hooks";
|
|
7
8
|
import * as Effect from "effect/Effect";
|
|
8
9
|
import * as Capability from "@dxos/app-framework/Capability";
|
|
9
10
|
import * as Capabilities from "@dxos/app-framework/Capabilities";
|
|
@@ -12,7 +13,7 @@ import { SearchArticle, SearchDialog } from "#containers";
|
|
|
12
13
|
//#region src/capabilities/SearchSurfaces.tsx
|
|
13
14
|
/** Search is scoped to the active space, so each surface resolves it before mounting the provider. */
|
|
14
15
|
var SearchDialogSurface = ({ props }) => {
|
|
15
|
-
const space = useActiveSpace();
|
|
16
|
+
const space = Hooks.useActiveSpace();
|
|
16
17
|
if (!space) return null;
|
|
17
18
|
return /* @__PURE__ */ jsx(SearchContextProvider, { children: /* @__PURE__ */ jsx(SearchDialog, {
|
|
18
19
|
...props,
|
|
@@ -20,7 +21,7 @@ var SearchDialogSurface = ({ props }) => {
|
|
|
20
21
|
}) });
|
|
21
22
|
};
|
|
22
23
|
var SearchInputSurface = () => {
|
|
23
|
-
const space = useActiveSpace();
|
|
24
|
+
const space = Hooks.useActiveSpace();
|
|
24
25
|
if (!space) return null;
|
|
25
26
|
return /* @__PURE__ */ jsx(SearchContextProvider, { children: /* @__PURE__ */ jsx(SearchArticle, { space }) });
|
|
26
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-react-surface.mjs","names":[],"sources":["../../src/capabilities/SearchSurfaces.tsx","../../src/capabilities/react-surface.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type ComponentProps } from 'react';\n\nimport
|
|
1
|
+
{"version":3,"file":"chunk-react-surface.mjs","names":[],"sources":["../../src/capabilities/SearchSurfaces.tsx","../../src/capabilities/react-surface.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type ComponentProps } from 'react';\n\nimport * as Hooks from '@dxos/app-toolkit/Hooks';\nimport { type Space } from '@dxos/react-client/echo';\n\nimport { SearchArticle, SearchDialog } from '#containers';\nimport { SearchContextProvider } from '#hooks';\n\nexport type SearchDialogSurfaceProps = {\n props: ComponentProps<typeof SearchDialog>;\n};\n\n/** Search is scoped to the active space, so each surface resolves it before mounting the provider. */\nexport const SearchDialogSurface = ({ props }: SearchDialogSurfaceProps) => {\n const space = Hooks.useActiveSpace();\n if (!space) {\n return null;\n }\n\n return (\n <SearchContextProvider>\n <SearchDialog {...props} space={space} />\n </SearchContextProvider>\n );\n};\n\nexport const SearchInputSurface = () => {\n const space = Hooks.useActiveSpace();\n if (!space) {\n return null;\n }\n\n return (\n <SearchContextProvider>\n <SearchArticle space={space} />\n </SearchContextProvider>\n );\n};\n\nexport type SearchCompanionSurfaceProps = {\n space: Space;\n};\n\nexport const SearchCompanionSurface = ({ space }: SearchCompanionSurfaceProps) => {\n if (!space) {\n return null;\n }\n\n return (\n <SearchContextProvider>\n <SearchArticle space={space} />\n </SearchContextProvider>\n );\n};\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport { type ComponentProps } from 'react';\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as Surface from '@dxos/app-framework/Surface';\nimport * as AppSurface from '@dxos/app-toolkit/AppSurface';\nimport { isSpace } from '@dxos/react-client/echo';\n\nimport { type SearchDialog } from '#containers';\n\nimport { SEARCH_DIALOG } from '../constants.ts';\nimport { SearchCompanionSurface, SearchDialogSurface, SearchInputSurface } from './SearchSurfaces.tsx';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contribute(Capabilities.ReactSurface, [\n Surface.create({\n id: SEARCH_DIALOG,\n filter: AppSurface.component<ComponentProps<typeof SearchDialog>>(AppSurface.Dialog, SEARCH_DIALOG),\n component: SearchDialogSurface,\n props: ({ data: { props } }) => ({ props }),\n }),\n Surface.create({\n id: `${SEARCH_DIALOG}.searchInput`,\n filter: Surface.makeFilter(AppSurface.SearchInput),\n component: SearchInputSurface,\n }),\n Surface.create({\n id: `${SEARCH_DIALOG}.search`,\n filter: AppSurface.subject(AppSurface.deckCompanion('search'), isSpace),\n component: SearchCompanionSurface,\n props: ({ data: { subject } }) => ({ space: subject }),\n }),\n ]),\n ),\n);\n"],"mappings":";;;;;;;;;;;;;;AAiBA,IAAa,uBAAuB,EAAE,YAAsC;CAC1E,MAAM,QAAQ,MAAM,eAAe;CACnC,IAAI,CAAC,OACH,OAAO;CAGT,OACE,oBAAC,uBAAD,EAAA,UACE,oBAAC,cAAD;EAAc,GAAI;EAAc;CAAQ,CAAA,EACnB,CAAA;AAE3B;AAEA,IAAa,2BAA2B;CACtC,MAAM,QAAQ,MAAM,eAAe;CACnC,IAAI,CAAC,OACH,OAAO;CAGT,OACE,oBAAC,uBAAD,EAAA,UACE,oBAAC,eAAD,EAAsB,MAAQ,CAAA,EACT,CAAA;AAE3B;AAMA,IAAa,0BAA0B,EAAE,YAAyC;CAChF,IAAI,CAAC,OACH,OAAO;CAGT,OACE,oBAAC,uBAAD,EAAA,UACE,oBAAC,eAAD,EAAsB,MAAQ,CAAA,EACT,CAAA;AAE3B;;;ACvCA,IAAA,wBAAe,WAAW,iBACxB,OAAO,QACL,WAAW,WAAW,aAAa,cAAc;CAC/C,QAAQ,OAAO;EACb,IAAI;EACJ,QAAQ,WAAW,UAA+C,WAAW,QAAQ,aAAa;EAClG,WAAW;EACX,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM;CAC3C,CAAC;CACD,QAAQ,OAAO;EACb,IAAI,GAAG,cAAc;EACrB,QAAQ,QAAQ,WAAW,WAAW,WAAW;EACjD,WAAW;CACb,CAAC;CACD,QAAQ,OAAO;EACb,IAAI,GAAG,cAAc;EACrB,QAAQ,WAAW,QAAQ,WAAW,cAAc,QAAQ,GAAG,OAAO;EACtE,WAAW;EACX,QAAQ,EAAE,MAAM,EAAE,iBAAiB,EAAE,OAAO,QAAQ;CACtD,CAAC;AACH,CAAC,CACH,CACF"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
//#region \0rolldown/runtime.js
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
3
6
|
var __exportAll = (all, no_symbols) => {
|
|
4
7
|
let target = {};
|
|
5
8
|
for (var name in all) __defProp(target, name, {
|
|
@@ -9,5 +12,16 @@ var __exportAll = (all, no_symbols) => {
|
|
|
9
12
|
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
13
|
return target;
|
|
11
14
|
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
17
|
+
key = keys[i];
|
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
19
|
+
get: ((k) => from[k]).bind(null, key),
|
|
20
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
12
26
|
//#endregion
|
|
13
|
-
export { __exportAll as t };
|
|
27
|
+
export { __reExport as n, __exportAll as t };
|