@dxos/plugin-preview 0.8.4-main.bc674ce → 0.8.4-main.c351d160a8

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 (56) hide show
  1. package/dist/lib/browser/{chunk-XLN6KTHK.mjs → chunk-KLQDOIFV.mjs} +2 -2
  2. package/dist/lib/browser/{chunk-XLN6KTHK.mjs.map → chunk-KLQDOIFV.mjs.map} +1 -1
  3. package/dist/lib/browser/index.mjs +10 -9
  4. package/dist/lib/browser/index.mjs.map +3 -3
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/{preview-popover-Y67LE6TV.mjs → preview-popover-X2ZJM5MK.mjs} +18 -15
  7. package/dist/lib/browser/preview-popover-X2ZJM5MK.mjs.map +7 -0
  8. package/dist/lib/browser/{react-surface-YCDD5VZC.mjs → react-surface-L57ORUAL.mjs} +56 -75
  9. package/dist/lib/browser/react-surface-L57ORUAL.mjs.map +7 -0
  10. package/dist/lib/node-esm/{chunk-2G4FUGDA.mjs → chunk-GFWHEHC5.mjs} +2 -2
  11. package/dist/lib/node-esm/{chunk-2G4FUGDA.mjs.map → chunk-GFWHEHC5.mjs.map} +1 -1
  12. package/dist/lib/node-esm/index.mjs +10 -9
  13. package/dist/lib/node-esm/index.mjs.map +3 -3
  14. package/dist/lib/node-esm/meta.json +1 -1
  15. package/dist/lib/node-esm/{preview-popover-BGV2P6UX.mjs → preview-popover-6FLDJHHB.mjs} +18 -15
  16. package/dist/lib/node-esm/preview-popover-6FLDJHHB.mjs.map +7 -0
  17. package/dist/lib/node-esm/{react-surface-MYZZR7AQ.mjs → react-surface-RIM4RITC.mjs} +56 -75
  18. package/dist/lib/node-esm/react-surface-RIM4RITC.mjs.map +7 -0
  19. package/dist/types/src/PreviewPlugin.d.ts.map +1 -1
  20. package/dist/types/src/capabilities/preview-popover/preview-popover.d.ts +1 -1
  21. package/dist/types/src/capabilities/preview-popover/preview-popover.d.ts.map +1 -1
  22. package/dist/types/src/capabilities/react-surface/index.d.ts +1 -1
  23. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
  24. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +2 -2
  25. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
  26. package/dist/types/src/cards/FormCard.d.ts +1 -1
  27. package/dist/types/src/cards/FormCard.d.ts.map +1 -1
  28. package/dist/types/src/cards/OrganizationCard.d.ts +1 -1
  29. package/dist/types/src/cards/OrganizationCard.d.ts.map +1 -1
  30. package/dist/types/src/cards/PersonCard.d.ts +1 -1
  31. package/dist/types/src/cards/PersonCard.d.ts.map +1 -1
  32. package/dist/types/src/cards/ProjectCard.d.ts +3 -3
  33. package/dist/types/src/cards/ProjectCard.d.ts.map +1 -1
  34. package/dist/types/src/cards/TaskCard.d.ts +1 -1
  35. package/dist/types/src/cards/TaskCard.d.ts.map +1 -1
  36. package/dist/types/src/stories/Card.stories.d.ts +4 -3
  37. package/dist/types/src/stories/Card.stories.d.ts.map +1 -1
  38. package/dist/types/src/stories/testing.d.ts +3 -3
  39. package/dist/types/src/stories/testing.d.ts.map +1 -1
  40. package/dist/types/tsconfig.tsbuildinfo +1 -1
  41. package/package.json +37 -36
  42. package/src/PreviewPlugin.tsx +6 -5
  43. package/src/capabilities/preview-popover/preview-popover.ts +26 -13
  44. package/src/capabilities/react-surface/react-surface.tsx +33 -23
  45. package/src/cards/FormCard.tsx +11 -26
  46. package/src/cards/OrganizationCard.tsx +2 -2
  47. package/src/cards/PersonCard.tsx +8 -8
  48. package/src/cards/ProjectCard.tsx +5 -5
  49. package/src/cards/TaskCard.tsx +3 -3
  50. package/src/meta.ts +1 -1
  51. package/src/stories/Card.stories.tsx +15 -7
  52. package/src/stories/testing.tsx +24 -17
  53. package/dist/lib/browser/preview-popover-Y67LE6TV.mjs.map +0 -7
  54. package/dist/lib/browser/react-surface-YCDD5VZC.mjs.map +0 -7
  55. package/dist/lib/node-esm/preview-popover-BGV2P6UX.mjs.map +0 -7
  56. package/dist/lib/node-esm/react-surface-MYZZR7AQ.mjs.map +0 -7
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'dxos.org/plugin/preview',\n name: 'Preview',\n description: trim`\n Rich preview panel for viewing object content without opening full editors.\n Quick peek at documents, images, and data with inline rendering.\n `,\n icon: 'ph--eye--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-preview',\n};\n"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.preview',\n name: 'Preview',\n description: trim`\n Rich preview panel for viewing object content without opening full editors.\n Quick peek at documents, images, and data with inline rendering.\n `,\n icon: 'ph--eye--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-preview',\n};\n"],
5
5
  "mappings": ";;;AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;EACNC,QAAQ;AACV;",
6
6
  "names": ["trim", "meta", "id", "name", "description", "trim", "icon", "source"]
7
7
  }
@@ -1,19 +1,20 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  meta
4
- } from "./chunk-2G4FUGDA.mjs";
4
+ } from "./chunk-GFWHEHC5.mjs";
5
5
 
6
6
  // src/PreviewPlugin.tsx
7
- import { Common, Plugin } from "@dxos/app-framework";
7
+ import { ActivationEvents, Plugin } from "@dxos/app-framework";
8
+ import { AppPlugin } from "@dxos/app-toolkit";
8
9
  import { Organization, Person } from "@dxos/types";
9
10
 
10
11
  // src/capabilities/preview-popover/index.ts
11
12
  import { Capability } from "@dxos/app-framework";
12
- var PreviewPopover = Capability.lazy("PreviewPopover", () => import("./preview-popover-BGV2P6UX.mjs"));
13
+ var PreviewPopover = Capability.lazy("PreviewPopover", () => import("./preview-popover-6FLDJHHB.mjs"));
13
14
 
14
15
  // src/capabilities/react-surface/index.ts
15
16
  import { Capability as Capability2 } from "@dxos/app-framework";
16
- var ReactSurface = Capability2.lazy("ReactSurface", () => import("./react-surface-MYZZR7AQ.mjs"));
17
+ var ReactSurface = Capability2.lazy("ReactSurface", () => import("./react-surface-RIM4RITC.mjs"));
17
18
 
18
19
  // src/translations.ts
19
20
  var translations = [
@@ -33,19 +34,19 @@ var translations = [
33
34
  ];
34
35
 
35
36
  // src/PreviewPlugin.tsx
36
- var PreviewPlugin = Plugin.define(meta).pipe(Common.Plugin.addTranslationsModule({
37
- translations
38
- }), Common.Plugin.addSchemaModule({
37
+ var PreviewPlugin = Plugin.define(meta).pipe(AppPlugin.addSchemaModule({
39
38
  schema: [
40
39
  Person.Person,
41
40
  Organization.Organization
42
41
  ],
43
42
  id: "schema"
44
- }), Common.Plugin.addSurfaceModule({
43
+ }), AppPlugin.addSurfaceModule({
45
44
  activate: ReactSurface
45
+ }), AppPlugin.addTranslationsModule({
46
+ translations
46
47
  }), Plugin.addModule({
47
48
  id: "preview-popover",
48
- activatesOn: Common.ActivationEvent.Startup,
49
+ activatesOn: ActivationEvents.Startup,
49
50
  activate: PreviewPopover
50
51
  }), Plugin.make);
51
52
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/PreviewPlugin.tsx", "../../../src/capabilities/preview-popover/index.ts", "../../../src/capabilities/react-surface/index.ts", "../../../src/translations.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Common, Plugin } from '@dxos/app-framework';\nimport { Organization, Person } from '@dxos/types';\n\nimport { PreviewPopover, ReactSurface } from './capabilities';\nimport { meta } from './meta';\nimport { translations } from './translations';\n\nexport const PreviewPlugin = Plugin.define(meta).pipe(\n Common.Plugin.addTranslationsModule({ translations }),\n Common.Plugin.addSchemaModule({ schema: [Person.Person, Organization.Organization], id: 'schema' }),\n Common.Plugin.addSurfaceModule({ activate: ReactSurface }),\n Plugin.addModule({\n id: 'preview-popover',\n activatesOn: Common.ActivationEvent.Startup,\n activate: PreviewPopover,\n }),\n Plugin.make,\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const PreviewPopover = Capability.lazy('PreviewPopover', () => import('./preview-popover'));\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from './meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\n 'unable to create preview message': 'No preview',\n 'todo label': 'To do',\n 'in-progress label': 'In progress',\n 'done label': 'Done',\n 'open object label': 'Open',\n 'add object to space label': 'Add to space',\n 'more options label': 'More options',\n },\n },\n },\n] as const satisfies Resource[];\n"],
5
- "mappings": ";;;;;;AAIA,SAASA,QAAQC,cAAc;AAC/B,SAASC,cAAcC,cAAc;;;ACDrC,SAASC,kBAAkB;AAEpB,IAAMC,iBAAiBC,WAAWC,KAAK,kBAAkB,MAAM,OAAO,gCAAA,CAAA;;;ACF7E,SAASC,cAAAA,mBAAkB;AAEpB,IAAMC,eAAeC,YAAWC,KAAK,gBAAgB,MAAM,OAAO,8BAAA,CAAA;;;ACElE,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,KAAKC,EAAE,GAAG;QACT,oCAAoC;QACpC,cAAc;QACd,qBAAqB;QACrB,cAAc;QACd,qBAAqB;QACrB,6BAA6B;QAC7B,sBAAsB;MACxB;IACF;EACF;;;;AHVK,IAAMC,gBAAgBC,OAAOC,OAAOC,IAAAA,EAAMC,KAC/CC,OAAOJ,OAAOK,sBAAsB;EAAEC;AAAa,CAAA,GACnDF,OAAOJ,OAAOO,gBAAgB;EAAEC,QAAQ;IAACC,OAAOA;IAAQC,aAAaA;;EAAeC,IAAI;AAAS,CAAA,GACjGP,OAAOJ,OAAOY,iBAAiB;EAAEC,UAAUC;AAAa,CAAA,GACxDd,OAAOe,UAAU;EACfJ,IAAI;EACJK,aAAaZ,OAAOa,gBAAgBC;EACpCL,UAAUM;AACZ,CAAA,GACAnB,OAAOoB,IAAI;",
6
- "names": ["Common", "Plugin", "Organization", "Person", "Capability", "PreviewPopover", "Capability", "lazy", "Capability", "ReactSurface", "Capability", "lazy", "translations", "meta", "id", "PreviewPlugin", "Plugin", "define", "meta", "pipe", "Common", "addTranslationsModule", "translations", "addSchemaModule", "schema", "Person", "Organization", "id", "addSurfaceModule", "activate", "ReactSurface", "addModule", "activatesOn", "ActivationEvent", "Startup", "PreviewPopover", "make"]
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { ActivationEvents, Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\nimport { Organization, Person } from '@dxos/types';\n\nimport { PreviewPopover, ReactSurface } from './capabilities';\nimport { meta } from './meta';\nimport { translations } from './translations';\n\nexport const PreviewPlugin = Plugin.define(meta).pipe(\n AppPlugin.addSchemaModule({ schema: [Person.Person, Organization.Organization], id: 'schema' }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.addModule({\n id: 'preview-popover',\n activatesOn: ActivationEvents.Startup,\n activate: PreviewPopover,\n }),\n Plugin.make,\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const PreviewPopover = Capability.lazy('PreviewPopover', () => import('./preview-popover'));\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from './meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\n 'unable to create preview message': 'No preview',\n 'todo label': 'To do',\n 'in-progress label': 'In progress',\n 'done label': 'Done',\n 'open object label': 'Open',\n 'add object to space label': 'Add to space',\n 'more options label': 'More options',\n },\n },\n },\n] as const satisfies Resource[];\n"],
5
+ "mappings": ";;;;;;AAIA,SAASA,kBAAkBC,cAAc;AACzC,SAASC,iBAAiB;AAC1B,SAASC,cAAcC,cAAc;;;ACFrC,SAASC,kBAAkB;AAEpB,IAAMC,iBAAiBC,WAAWC,KAAK,kBAAkB,MAAM,OAAO,gCAAA,CAAA;;;ACF7E,SAASC,cAAAA,mBAAkB;AAEpB,IAAMC,eAAeC,YAAWC,KAAK,gBAAgB,MAAM,OAAO,8BAAA,CAAA;;;ACElE,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,KAAKC,EAAE,GAAG;QACT,oCAAoC;QACpC,cAAc;QACd,qBAAqB;QACrB,cAAc;QACd,qBAAqB;QACrB,6BAA6B;QAC7B,sBAAsB;MACxB;IACF;EACF;;;;AHTK,IAAMC,gBAAgBC,OAAOC,OAAOC,IAAAA,EAAMC,KAC/CC,UAAUC,gBAAgB;EAAEC,QAAQ;IAACC,OAAOA;IAAQC,aAAaA;;EAAeC,IAAI;AAAS,CAAA,GAC7FL,UAAUM,iBAAiB;EAAEC,UAAUC;AAAa,CAAA,GACpDR,UAAUS,sBAAsB;EAAEC;AAAa,CAAA,GAC/Cd,OAAOe,UAAU;EACfN,IAAI;EACJO,aAAaC,iBAAiBC;EAC9BP,UAAUQ;AACZ,CAAA,GACAnB,OAAOoB,IAAI;",
6
+ "names": ["ActivationEvents", "Plugin", "AppPlugin", "Organization", "Person", "Capability", "PreviewPopover", "Capability", "lazy", "Capability", "ReactSurface", "Capability", "lazy", "translations", "meta", "id", "PreviewPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addSchemaModule", "schema", "Person", "Organization", "id", "addSurfaceModule", "activate", "ReactSurface", "addTranslationsModule", "translations", "addModule", "activatesOn", "ActivationEvents", "Startup", "PreviewPopover", "make"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"src/meta.ts":{"bytes":1673,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/preview-popover/preview-popover.ts":{"bytes":9968,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/preview-popover/index.ts":{"bytes":935,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/preview-popover/preview-popover.ts","kind":"dynamic-import","original":"./preview-popover"}],"format":"esm"},"src/cards/FormCard.tsx":{"bytes":9151,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"src/cards/OrganizationCard.tsx":{"bytes":3059,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true}],"format":"esm"},"src/cards/PersonCard.tsx":{"bytes":4498,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true}],"format":"esm"},"src/cards/ProjectCard.tsx":{"bytes":2488,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true}],"format":"esm"},"src/cards/TaskCard.tsx":{"bytes":5358,"imports":[{"path":"effect/SchemaAST","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true}],"format":"esm"},"src/cards/index.ts":{"bytes":853,"imports":[{"path":"src/cards/FormCard.tsx","kind":"import-statement","original":"./FormCard"},{"path":"src/cards/OrganizationCard.tsx","kind":"import-statement","original":"./OrganizationCard"},{"path":"src/cards/PersonCard.tsx","kind":"import-statement","original":"./PersonCard"},{"path":"src/cards/ProjectCard.tsx","kind":"import-statement","original":"./ProjectCard"},{"path":"src/cards/TaskCard.tsx","kind":"import-statement","original":"./TaskCard"}],"format":"esm"},"src/capabilities/react-surface/react-surface.tsx":{"bytes":12562,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"src/cards/index.ts","kind":"import-statement","original":"../../cards"},{"path":"src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"src/capabilities/react-surface/index.ts":{"bytes":911,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/react-surface/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":595,"imports":[{"path":"src/capabilities/preview-popover/index.ts","kind":"import-statement","original":"./preview-popover"},{"path":"src/capabilities/react-surface/index.ts","kind":"import-statement","original":"./react-surface"}],"format":"esm"},"src/translations.ts":{"bytes":1903,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/PreviewPlugin.tsx":{"bytes":3100,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"src/index.ts":{"bytes":555,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/PreviewPlugin.tsx","kind":"import-statement","original":"./PreviewPlugin"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3117},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-2G4FUGDA.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/node-esm/preview-popover-BGV2P6UX.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/node-esm/react-surface-MYZZR7AQ.mjs","kind":"dynamic-import"}],"exports":["PreviewPlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/PreviewPlugin.tsx":{"bytesInOutput":523},"src/capabilities/preview-popover/index.ts":{"bytesInOutput":154},"src/capabilities/index.ts":{"bytesInOutput":0},"src/capabilities/react-surface/index.ts":{"bytesInOutput":164},"src/translations.ts":{"bytesInOutput":378}},"bytes":1595},"dist/lib/node-esm/preview-popover-BGV2P6UX.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5139},"dist/lib/node-esm/preview-popover-BGV2P6UX.mjs":{"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/preview-popover/preview-popover.ts","inputs":{"src/capabilities/preview-popover/preview-popover.ts":{"bytesInOutput":2393}},"bytes":2644},"dist/lib/node-esm/react-surface-MYZZR7AQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":19020},"dist/lib/node-esm/react-surface-MYZZR7AQ.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-2G4FUGDA.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"effect/SchemaAST","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface/react-surface.tsx","inputs":{"src/capabilities/react-surface/react-surface.tsx":{"bytesInOutput":3111},"src/cards/FormCard.tsx":{"bytesInOutput":2355},"src/cards/index.ts":{"bytesInOutput":0},"src/cards/OrganizationCard.tsx":{"bytesInOutput":728},"src/cards/PersonCard.tsx":{"bytesInOutput":1061},"src/cards/ProjectCard.tsx":{"bytesInOutput":537},"src/cards/TaskCard.tsx":{"bytesInOutput":1182}},"bytes":9466},"dist/lib/node-esm/chunk-2G4FUGDA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":802},"dist/lib/node-esm/chunk-2G4FUGDA.mjs":{"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":389}},"bytes":561}}}
1
+ {"inputs":{"src/meta.ts":{"bytes":1673,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/preview-popover/preview-popover.ts":{"bytes":10664,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/preview-popover/index.ts":{"bytes":935,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/preview-popover/preview-popover.ts","kind":"dynamic-import","original":"./preview-popover"}],"format":"esm"},"src/cards/FormCard.tsx":{"bytes":6024,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"src/cards/OrganizationCard.tsx":{"bytes":3036,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/cards/PersonCard.tsx":{"bytes":4475,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/cards/ProjectCard.tsx":{"bytes":2431,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/cards/TaskCard.tsx":{"bytes":5334,"imports":[{"path":"effect/SchemaAST","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true}],"format":"esm"},"src/cards/index.ts":{"bytes":853,"imports":[{"path":"src/cards/FormCard.tsx","kind":"import-statement","original":"./FormCard"},{"path":"src/cards/OrganizationCard.tsx","kind":"import-statement","original":"./OrganizationCard"},{"path":"src/cards/PersonCard.tsx","kind":"import-statement","original":"./PersonCard"},{"path":"src/cards/ProjectCard.tsx","kind":"import-statement","original":"./ProjectCard"},{"path":"src/cards/TaskCard.tsx","kind":"import-statement","original":"./TaskCard"}],"format":"esm"},"src/capabilities/react-surface/react-surface.tsx":{"bytes":13487,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"src/cards/index.ts","kind":"import-statement","original":"../../cards"},{"path":"src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"src/capabilities/react-surface/index.ts":{"bytes":911,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/react-surface/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":595,"imports":[{"path":"src/capabilities/preview-popover/index.ts","kind":"import-statement","original":"./preview-popover"},{"path":"src/capabilities/react-surface/index.ts","kind":"import-statement","original":"./react-surface"}],"format":"esm"},"src/translations.ts":{"bytes":1903,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/PreviewPlugin.tsx":{"bytes":3183,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"src/index.ts":{"bytes":555,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/PreviewPlugin.tsx","kind":"import-statement","original":"./PreviewPlugin"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3181},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-GFWHEHC5.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/node-esm/preview-popover-6FLDJHHB.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/node-esm/react-surface-RIM4RITC.mjs","kind":"dynamic-import"}],"exports":["PreviewPlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/PreviewPlugin.tsx":{"bytesInOutput":562},"src/capabilities/preview-popover/index.ts":{"bytesInOutput":154},"src/capabilities/index.ts":{"bytesInOutput":0},"src/capabilities/react-surface/index.ts":{"bytesInOutput":164},"src/translations.ts":{"bytesInOutput":378}},"bytes":1634},"dist/lib/node-esm/preview-popover-6FLDJHHB.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5546},"dist/lib/node-esm/preview-popover-6FLDJHHB.mjs":{"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/preview-popover/preview-popover.ts","inputs":{"src/capabilities/preview-popover/preview-popover.ts":{"bytesInOutput":2555}},"bytes":2806},"dist/lib/node-esm/react-surface-RIM4RITC.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":17770},"dist/lib/node-esm/react-surface-RIM4RITC.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-GFWHEHC5.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"effect/SchemaAST","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface/react-surface.tsx","inputs":{"src/capabilities/react-surface/react-surface.tsx":{"bytesInOutput":3428},"src/cards/FormCard.tsx":{"bytesInOutput":1416},"src/cards/index.ts":{"bytesInOutput":0},"src/cards/OrganizationCard.tsx":{"bytesInOutput":721},"src/cards/PersonCard.tsx":{"bytesInOutput":1054},"src/cards/ProjectCard.tsx":{"bytesInOutput":517},"src/cards/TaskCard.tsx":{"bytesInOutput":1174}},"bytes":8802},"dist/lib/node-esm/chunk-GFWHEHC5.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":802},"dist/lib/node-esm/chunk-GFWHEHC5.mjs":{"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":389}},"bytes":561}}}
@@ -2,9 +2,10 @@ import { createRequire } from 'node:module';const require = createRequire(import
2
2
 
3
3
  // src/capabilities/preview-popover/preview-popover.ts
4
4
  import * as Effect from "effect/Effect";
5
- import { Capability, Common } from "@dxos/app-framework";
5
+ import { Capabilities, Capability } from "@dxos/app-framework";
6
+ import { AppCapabilities, LayoutOperation, getSpaceIdFromPath } from "@dxos/app-toolkit";
6
7
  import { addEventListener } from "@dxos/async";
7
- import { parseId } from "@dxos/client/echo";
8
+ import { Obj } from "@dxos/echo";
8
9
  import { DXN } from "@dxos/keys";
9
10
  import { log } from "@dxos/log";
10
11
  import { ClientCapabilities } from "@dxos/plugin-client";
@@ -14,9 +15,9 @@ var customEventOptions = {
14
15
  capture: true,
15
16
  passive: false
16
17
  };
17
- var handlePreviewLookup = async (client, defaultSpace, { ref, label }) => {
18
+ var handlePreviewLookup = async (client, defaultSpace, { dxn, label }) => {
18
19
  try {
19
- const object = await defaultSpace.db.makeRef(DXN.parse(ref)).load();
20
+ const object = await defaultSpace.db.makeRef(DXN.parse(dxn)).load();
20
21
  return {
21
22
  label,
22
23
  object
@@ -27,22 +28,24 @@ var handlePreviewLookup = async (client, defaultSpace, { ref, label }) => {
27
28
  };
28
29
  var preview_popover_default = Capability.makeModule(Effect.fnUntraced(function* () {
29
30
  const capabilities = yield* Capability.Service;
30
- const handleAnchorActivate = async ({ refId, label, trigger, kind, title, side, props }) => {
31
- const { invokePromise } = capabilities.get(Common.Capability.OperationInvoker);
31
+ const handleAnchorActivate = async ({ dxn, label, trigger, kind = "card", title: titleProp, side, props }) => {
32
+ const { invokePromise } = capabilities.get(Capabilities.OperationInvoker);
32
33
  const client = capabilities.get(ClientCapabilities.Client);
33
- const registry = capabilities.get(Common.Capability.AtomRegistry);
34
- const [layoutAtom] = capabilities.getAll(Common.Capability.Layout);
34
+ const registry = capabilities.get(Capabilities.AtomRegistry);
35
+ const [layoutAtom] = capabilities.getAll(AppCapabilities.Layout);
35
36
  const layout = registry.get(layoutAtom);
36
- const { spaceId } = parseId(layout.workspace);
37
+ const spaceId = getSpaceIdFromPath(layout.workspace);
37
38
  const space = (spaceId && client.spaces.get(spaceId)) ?? client.spaces.default;
38
39
  const result = await handlePreviewLookup(client, space, {
39
- ref: refId,
40
+ dxn,
40
41
  label
41
42
  });
42
43
  if (!result) {
43
44
  return;
44
45
  }
45
- await invokePromise(Common.LayoutOperation.UpdatePopover, {
46
+ const title = titleProp ?? Obj.getLabel(result.object);
47
+ await invokePromise(LayoutOperation.UpdatePopover, {
48
+ subjectRef: dxn,
46
49
  subject: result.object,
47
50
  state: true,
48
51
  variant: "virtual",
@@ -65,16 +68,16 @@ var preview_popover_default = Capability.makeModule(Effect.fnUntraced(function*
65
68
  if (document.defaultView) {
66
69
  cleanup = addEventListener(document.defaultView, DX_ANCHOR_ACTIVATE, handleAnchorActivate, customEventOptions);
67
70
  } else {
68
- log.warn("No default view found", void 0, {
71
+ log.warn("no default view found", void 0, {
69
72
  F: __dxlog_file,
70
- L: 72,
73
+ L: 85,
71
74
  S: this,
72
75
  C: (f, a) => f(...a)
73
76
  });
74
77
  }
75
- return Capability.contributes(Common.Capability.Null, null, () => Effect.sync(() => cleanup?.()));
78
+ return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => cleanup?.()));
76
79
  }));
77
80
  export {
78
81
  preview_popover_default as default
79
82
  };
80
- //# sourceMappingURL=preview-popover-BGV2P6UX.mjs.map
83
+ //# sourceMappingURL=preview-popover-6FLDJHHB.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/preview-popover/preview-popover.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { AppCapabilities, LayoutOperation, getSpaceIdFromPath } from '@dxos/app-toolkit';\nimport { addEventListener } from '@dxos/async';\nimport { type Client } from '@dxos/client';\nimport { type Space } from '@dxos/client/echo';\nimport { Obj } from '@dxos/echo';\nimport { DXN } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { ClientCapabilities } from '@dxos/plugin-client';\nimport { DX_ANCHOR_ACTIVATE, type DxAnchorActivate } from '@dxos/react-ui';\nimport { type PreviewLinkRef, type PreviewLinkTarget } from '@dxos/ui-editor';\n\nconst customEventOptions = { capture: true, passive: false };\n\nconst handlePreviewLookup = async (\n client: Client,\n defaultSpace: Space,\n { dxn, label }: PreviewLinkRef,\n): Promise<PreviewLinkTarget | null> => {\n try {\n const object = await defaultSpace.db.makeRef(DXN.parse(dxn)).load();\n return { label, object };\n } catch {\n return null;\n }\n};\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n // Get context for lazy capability access in callbacks.\n const capabilities = yield* Capability.Service;\n\n // TODO(wittjosiah): Factor out lookup handlers to other plugins to make not ECHO-specific.\n const handleAnchorActivate = async ({\n dxn,\n label,\n trigger,\n kind = 'card',\n title: titleProp,\n side,\n props,\n }: DxAnchorActivate) => {\n const { invokePromise } = capabilities.get(Capabilities.OperationInvoker);\n const client = capabilities.get(ClientCapabilities.Client);\n const registry = capabilities.get(Capabilities.AtomRegistry);\n const [layoutAtom] = capabilities.getAll(AppCapabilities.Layout);\n const layout = registry.get(layoutAtom);\n const spaceId = getSpaceIdFromPath(layout.workspace);\n const space = (spaceId && client.spaces.get(spaceId)) ?? client.spaces.default;\n const result = await handlePreviewLookup(client, space, { dxn, label });\n if (!result) {\n return;\n }\n\n const title = titleProp ?? Obj.getLabel(result.object);\n\n await invokePromise(LayoutOperation.UpdatePopover, {\n subjectRef: dxn,\n subject: result.object,\n state: true,\n variant: 'virtual',\n anchor: trigger,\n ...(kind && { kind }),\n ...(title && { title }),\n ...(side && { side }),\n ...(props && { props }),\n });\n };\n\n let cleanup: () => void;\n if (document.defaultView) {\n cleanup = addEventListener(\n document.defaultView,\n DX_ANCHOR_ACTIVATE as any,\n handleAnchorActivate,\n customEventOptions,\n );\n } else {\n log.warn('no default view found');\n }\n\n return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => cleanup?.()));\n }),\n);\n"],
5
+ "mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,iBAAiBC,iBAAiBC,0BAA0B;AACrE,SAASC,wBAAwB;AAGjC,SAASC,WAAW;AACpB,SAASC,WAAW;AACpB,SAASC,WAAW;AACpB,SAASC,0BAA0B;AACnC,SAASC,0BAAiD;;AAG1D,IAAMC,qBAAqB;EAAEC,SAAS;EAAMC,SAAS;AAAM;AAE3D,IAAMC,sBAAsB,OAC1BC,QACAC,cACA,EAAEC,KAAKC,MAAK,MAAkB;AAE9B,MAAI;AACF,UAAMC,SAAS,MAAMH,aAAaI,GAAGC,QAAQd,IAAIe,MAAML,GAAAA,CAAAA,EAAMM,KAAI;AACjE,WAAO;MAAEL;MAAOC;IAAO;EACzB,QAAQ;AACN,WAAO;EACT;AACF;AAEA,IAAA,0BAAelB,WAAWuB,WACjBC,kBAAW,aAAA;AAEhB,QAAMC,eAAe,OAAOzB,WAAW0B;AAGvC,QAAMC,uBAAuB,OAAO,EAClCX,KACAC,OACAW,SACAC,OAAO,QACPC,OAAOC,WACPC,MACAC,MAAK,MACY;AACjB,UAAM,EAAEC,cAAa,IAAKT,aAAaU,IAAIpC,aAAaqC,gBAAgB;AACxE,UAAMtB,SAASW,aAAaU,IAAI3B,mBAAmB6B,MAAM;AACzD,UAAMC,WAAWb,aAAaU,IAAIpC,aAAawC,YAAY;AAC3D,UAAM,CAACC,UAAAA,IAAcf,aAAagB,OAAOxC,gBAAgByC,MAAM;AAC/D,UAAMC,SAASL,SAASH,IAAIK,UAAAA;AAC5B,UAAMI,UAAUzC,mBAAmBwC,OAAOE,SAAS;AACnD,UAAMC,SAASF,WAAW9B,OAAOiC,OAAOZ,IAAIS,OAAAA,MAAa9B,OAAOiC,OAAOC;AACvE,UAAMC,SAAS,MAAMpC,oBAAoBC,QAAQgC,OAAO;MAAE9B;MAAKC;IAAM,CAAA;AACrE,QAAI,CAACgC,QAAQ;AACX;IACF;AAEA,UAAMnB,QAAQC,aAAa1B,IAAI6C,SAASD,OAAO/B,MAAM;AAErD,UAAMgB,cAAchC,gBAAgBiD,eAAe;MACjDC,YAAYpC;MACZqC,SAASJ,OAAO/B;MAChBoC,OAAO;MACPC,SAAS;MACTC,QAAQ5B;MACR,GAAIC,QAAQ;QAAEA;MAAK;MACnB,GAAIC,SAAS;QAAEA;MAAM;MACrB,GAAIE,QAAQ;QAAEA;MAAK;MACnB,GAAIC,SAAS;QAAEA;MAAM;IACvB,CAAA;EACF;AAEA,MAAIwB;AACJ,MAAIC,SAASC,aAAa;AACxBF,cAAUrD,iBACRsD,SAASC,aACTlD,oBACAkB,sBACAjB,kBAAAA;EAEJ,OAAO;AACLH,QAAIqD,KAAK,yBAAA,QAAA;;;;;;EACX;AAEA,SAAO5D,WAAW6D,YAAY9D,aAAa+D,MAAM,MAAM,MAAaC,YAAK,MAAMN,UAAAA,CAAAA,CAAAA;AACjF,CAAA,CAAA;",
6
+ "names": ["Effect", "Capabilities", "Capability", "AppCapabilities", "LayoutOperation", "getSpaceIdFromPath", "addEventListener", "Obj", "DXN", "log", "ClientCapabilities", "DX_ANCHOR_ACTIVATE", "customEventOptions", "capture", "passive", "handlePreviewLookup", "client", "defaultSpace", "dxn", "label", "object", "db", "makeRef", "parse", "load", "makeModule", "fnUntraced", "capabilities", "Service", "handleAnchorActivate", "trigger", "kind", "title", "titleProp", "side", "props", "invokePromise", "get", "OperationInvoker", "Client", "registry", "AtomRegistry", "layoutAtom", "getAll", "Layout", "layout", "spaceId", "workspace", "space", "spaces", "default", "result", "getLabel", "UpdatePopover", "subjectRef", "subject", "state", "variant", "anchor", "cleanup", "document", "defaultView", "warn", "contributes", "Null", "sync"]
7
+ }
@@ -1,50 +1,30 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  meta
4
- } from "./chunk-2G4FUGDA.mjs";
4
+ } from "./chunk-GFWHEHC5.mjs";
5
5
 
6
6
  // src/capabilities/react-surface/react-surface.tsx
7
7
  import * as Effect from "effect/Effect";
8
8
  import React6 from "react";
9
- import { Capability, Common as Common2 } from "@dxos/app-framework";
10
- import { Surface } from "@dxos/app-framework/react";
9
+ import { Capabilities, Capability } from "@dxos/app-framework";
10
+ import { Surface } from "@dxos/app-framework/ui";
11
11
  import { Obj as Obj3 } from "@dxos/echo";
12
- import { Card as Card6 } from "@dxos/react-ui-mosaic";
13
- import { Organization, Person, Project, Task as Task2 } from "@dxos/types";
12
+ import { Card as Card6 } from "@dxos/react-ui";
13
+ import { Organization, Person, Pipeline, Task as Task2 } from "@dxos/types";
14
14
 
15
15
  // src/cards/FormCard.tsx
16
- import React, { useCallback } from "react";
17
- import { Common } from "@dxos/app-framework";
18
- import { useOperationInvoker } from "@dxos/app-framework/react";
16
+ import React, { useCallback, useMemo } from "react";
19
17
  import { Obj } from "@dxos/echo";
20
18
  import { splitJsonPath } from "@dxos/effect";
21
- import { IconButton, useTranslation } from "@dxos/react-ui";
19
+ import { Card, useTranslation } from "@dxos/react-ui";
22
20
  import { Form, omitId } from "@dxos/react-ui-form";
23
- import { Card } from "@dxos/react-ui-mosaic";
24
21
  import { descriptionMessage, mx } from "@dxos/ui-theme";
25
22
  var FormCard = ({ subject, projection }) => {
26
- const { invokePromise } = useOperationInvoker();
27
- const schema = Obj.getSchema(subject);
28
23
  const { t } = useTranslation(meta.id);
29
- const handleNavigate = useCallback(async () => {
30
- await invokePromise(Common.LayoutOperation.UpdatePopover, {
31
- state: false,
32
- anchorId: ""
33
- });
34
- await invokePromise(Common.LayoutOperation.Open, {
35
- subject: [
36
- Obj.getDXN(subject).toString()
37
- ]
38
- });
39
- }, [
40
- invokePromise,
41
- subject
24
+ const echoSchema = Obj.getSchema(subject);
25
+ const schema = useMemo(() => echoSchema && omitId(echoSchema), [
26
+ echoSchema
42
27
  ]);
43
- if (!schema) {
44
- return /* @__PURE__ */ React.createElement("p", {
45
- className: mx(descriptionMessage)
46
- }, t("unable to create preview message"));
47
- }
48
28
  const handleSave = useCallback((values, { changed }) => {
49
29
  const paths = Object.keys(changed).filter((path) => changed[path]);
50
30
  Obj.change(subject, () => {
@@ -55,20 +35,13 @@ var FormCard = ({ subject, projection }) => {
55
35
  }
56
36
  });
57
37
  }, []);
58
- const label = Obj.getLabel(subject) ?? Obj.getTypename(subject) ?? t("unable to create preview message");
59
- return /* @__PURE__ */ React.createElement(Card.Root, {
60
- id: subject.id
61
- }, /* @__PURE__ */ React.createElement(Card.Heading, {
62
- classNames: "flex items-center"
63
- }, label, /* @__PURE__ */ React.createElement("span", {
64
- className: "grow"
65
- }), /* @__PURE__ */ React.createElement(IconButton, {
66
- iconOnly: true,
67
- icon: "ph--arrow-right--regular",
68
- label: t("open object label"),
69
- onClick: handleNavigate
70
- })), /* @__PURE__ */ React.createElement(Form.Root, {
71
- schema: omitId(schema),
38
+ if (!schema) {
39
+ return /* @__PURE__ */ React.createElement("p", {
40
+ className: mx(descriptionMessage)
41
+ }, t("unable to create preview message"));
42
+ }
43
+ return /* @__PURE__ */ React.createElement(Card.Content, null, /* @__PURE__ */ React.createElement(Form.Root, {
44
+ schema,
72
45
  projection,
73
46
  values: subject,
74
47
  autoSave: true,
@@ -78,7 +51,7 @@ var FormCard = ({ subject, projection }) => {
78
51
 
79
52
  // src/cards/OrganizationCard.tsx
80
53
  import React2 from "react";
81
- import { Card as Card2 } from "@dxos/react-ui-mosaic";
54
+ import { Card as Card2 } from "@dxos/react-ui";
82
55
  var OrganizationCard = ({ subject }) => {
83
56
  const { image, description, website } = subject;
84
57
  return /* @__PURE__ */ React2.createElement(Card2.Content, null, /* @__PURE__ */ React2.createElement(Card2.Poster, {
@@ -100,11 +73,11 @@ var OrganizationCard = ({ subject }) => {
100
73
  // src/cards/PersonCard.tsx
101
74
  import React3 from "react";
102
75
  import { Avatar } from "@dxos/react-ui";
103
- import { Card as Card3 } from "@dxos/react-ui-mosaic";
76
+ import { Card as Card3 } from "@dxos/react-ui";
104
77
  var PersonCard = ({ subject }) => {
105
78
  const { image, organization: { target: organization } = {}, emails = [] } = subject;
106
- return /* @__PURE__ */ React3.createElement(Avatar.Root, null, /* @__PURE__ */ React3.createElement(Card3.Content, null, image && /* @__PURE__ */ React3.createElement(Card3.Row, {
107
- className: "plb-1"
79
+ return /* @__PURE__ */ React3.createElement(Card3.Content, null, /* @__PURE__ */ React3.createElement(Avatar.Root, null, image && /* @__PURE__ */ React3.createElement(Card3.Row, {
80
+ className: "py-1"
108
81
  }, /* @__PURE__ */ React3.createElement(Avatar.Content, {
109
82
  imgSrc: image,
110
83
  icon: "ph--user--regular",
@@ -120,16 +93,16 @@ var PersonCard = ({ subject }) => {
120
93
  icon: "ph--at--regular"
121
94
  }, /* @__PURE__ */ React3.createElement(Card3.Text, {
122
95
  truncate: true,
123
- className: "text-primaryText"
96
+ className: "text-primary-text"
124
97
  }, value)))));
125
98
  };
126
99
 
127
100
  // src/cards/ProjectCard.tsx
128
101
  import React4 from "react";
129
102
  import { Obj as Obj2 } from "@dxos/echo";
130
- import { Card as Card4 } from "@dxos/react-ui-mosaic";
103
+ import { Card as Card4 } from "@dxos/react-ui";
131
104
  var ProjectCard = ({ subject }) => {
132
- const { name: name2, image, description } = subject;
105
+ const { image, description } = subject;
133
106
  return /* @__PURE__ */ React4.createElement(Card4.Content, null, image && /* @__PURE__ */ React4.createElement(Card4.Poster, {
134
107
  image,
135
108
  alt: Obj2.getLabel(subject) ?? "",
@@ -143,13 +116,13 @@ var ProjectCard = ({ subject }) => {
143
116
  import * as SchemaAST from "effect/SchemaAST";
144
117
  import React5 from "react";
145
118
  import { PropertyMetaAnnotationId } from "@dxos/echo/internal";
146
- import { Card as Card5 } from "@dxos/react-ui-mosaic";
119
+ import { Card as Card5 } from "@dxos/react-ui";
147
120
  import { Task } from "@dxos/types";
148
121
  var TaskCard = ({ subject }) => {
149
122
  const { title, status } = subject;
150
123
  const statusOption = getActiveStatusOption(status);
151
124
  return /* @__PURE__ */ React5.createElement(Card5.Content, null, /* @__PURE__ */ React5.createElement(Card5.Heading, {
152
- classNames: "min-is-0 flex-1 truncate"
125
+ classNames: "min-w-0 flex-1 truncate"
153
126
  }, title), statusOption && /* @__PURE__ */ React5.createElement("span", {
154
127
  className: "dx-tag",
155
128
  "data-hue": statusOption.color
@@ -167,40 +140,48 @@ var getActiveStatusOption = (status) => {
167
140
  };
168
141
 
169
142
  // src/capabilities/react-surface/react-surface.tsx
170
- var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Common2.Capability.ReactSurface, [
143
+ var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactSurface, [
171
144
  //
172
145
  // Specific schema types.
173
146
  // TODO(burdon): Create helpers and factor out.
174
147
  //
175
- Common2.createSurface({
176
- id: `${meta.id}/schema-popover--contact`,
148
+ Surface.create({
149
+ id: `${meta.id}.schema-popover--contact`,
177
150
  role: "card--content",
178
151
  position: "hoist",
179
152
  filter: (data) => Obj3.instanceOf(Person.Person, data.subject),
180
153
  component: ({ data, role }) => {
181
- return /* @__PURE__ */ React6.createElement(PersonCard, {
154
+ return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(PersonCard, {
182
155
  role,
183
156
  subject: data.subject
184
- });
157
+ }), /* @__PURE__ */ React6.createElement(Surface.Surface, {
158
+ role: "related",
159
+ data,
160
+ limit: 1
161
+ }));
185
162
  }
186
163
  }),
187
- Common2.createSurface({
188
- id: `${meta.id}/schema-popover--organization`,
164
+ Surface.create({
165
+ id: `${meta.id}.schema-popover--organization`,
189
166
  role: "card--content",
190
167
  position: "hoist",
191
168
  filter: (data) => Obj3.instanceOf(Organization.Organization, data.subject),
192
169
  component: ({ data, role }) => {
193
- return /* @__PURE__ */ React6.createElement(OrganizationCard, {
170
+ return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(OrganizationCard, {
194
171
  role,
195
172
  subject: data.subject
196
- });
173
+ }), /* @__PURE__ */ React6.createElement(Surface.Surface, {
174
+ role: "related",
175
+ data,
176
+ limit: 1
177
+ }));
197
178
  }
198
179
  }),
199
- Common2.createSurface({
200
- id: `${meta.id}/schema-popover--project`,
180
+ Surface.create({
181
+ id: `${meta.id}.schema-popover--project`,
201
182
  role: "card--content",
202
183
  position: "hoist",
203
- filter: (data) => Obj3.instanceOf(Project.Project, data.subject),
184
+ filter: (data) => Obj3.instanceOf(Pipeline.Pipeline, data.subject),
204
185
  component: ({ data, role }) => {
205
186
  return /* @__PURE__ */ React6.createElement(ProjectCard, {
206
187
  role,
@@ -208,8 +189,8 @@ var react_surface_default = Capability.makeModule(() => Effect.succeed(Capabilit
208
189
  });
209
190
  }
210
191
  }),
211
- Common2.createSurface({
212
- id: `${meta.id}/schema-popover--task`,
192
+ Surface.create({
193
+ id: `${meta.id}.schema-popover--task`,
213
194
  role: "card--content",
214
195
  position: "hoist",
215
196
  filter: (data) => Obj3.instanceOf(Task2.Task, data.subject),
@@ -223,8 +204,8 @@ var react_surface_default = Capability.makeModule(() => Effect.succeed(Capabilit
223
204
  //
224
205
  // Fallback for any object.
225
206
  //
226
- Common2.createSurface({
227
- id: `${meta.id}/fallback-popover`,
207
+ Surface.create({
208
+ id: `${meta.id}.fallback-popover`,
228
209
  role: "card--content",
229
210
  position: "fallback",
230
211
  filter: (data) => Obj3.isObject(data.subject),
@@ -236,8 +217,8 @@ var react_surface_default = Capability.makeModule(() => Effect.succeed(Capabilit
236
217
  });
237
218
  }
238
219
  }),
239
- Common2.createSurface({
240
- id: `${meta.id}/section`,
220
+ Surface.create({
221
+ id: `${meta.id}.section`,
241
222
  role: [
242
223
  "section"
243
224
  ],
@@ -246,11 +227,11 @@ var react_surface_default = Capability.makeModule(() => Effect.succeed(Capabilit
246
227
  component: ({ data }) => {
247
228
  return /* @__PURE__ */ React6.createElement("div", {
248
229
  role: "none",
249
- className: "flex is-full justify-center"
230
+ className: "flex w-full justify-center"
250
231
  }, /* @__PURE__ */ React6.createElement("div", {
251
232
  role: "none",
252
- className: "pbs-2 pbe-2 card-min-width card-max-width"
253
- }, /* @__PURE__ */ React6.createElement(Card6.Root, null, /* @__PURE__ */ React6.createElement(Surface, {
233
+ className: "pt-2 pb-2 dx-card-min-width dx-card-max-width"
234
+ }, /* @__PURE__ */ React6.createElement(Card6.Root, null, /* @__PURE__ */ React6.createElement(Surface.Surface, {
254
235
  role: "card--content",
255
236
  data,
256
237
  limit: 1
@@ -261,4 +242,4 @@ var react_surface_default = Capability.makeModule(() => Effect.succeed(Capabilit
261
242
  export {
262
243
  react_surface_default as default
263
244
  };
264
- //# sourceMappingURL=react-surface-MYZZR7AQ.mjs.map
245
+ //# sourceMappingURL=react-surface-RIM4RITC.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/react-surface/react-surface.tsx", "../../../src/cards/FormCard.tsx", "../../../src/cards/OrganizationCard.tsx", "../../../src/cards/PersonCard.tsx", "../../../src/cards/ProjectCard.tsx", "../../../src/cards/TaskCard.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface } from '@dxos/app-framework/ui';\nimport { Obj } from '@dxos/echo';\nimport { Card } from '@dxos/react-ui';\nimport { type ProjectionModel } from '@dxos/schema';\nimport { Organization, Person, Pipeline, Task } from '@dxos/types';\n\nimport { FormCard, OrganizationCard, PersonCard, ProjectCard, TaskCard } from '../../cards';\nimport { meta } from '../../meta';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactSurface, [\n //\n // Specific schema types.\n // TODO(burdon): Create helpers and factor out.\n //\n\n Surface.create<{ subject: Person.Person }>({\n id: `${meta.id}.schema-popover--contact`,\n role: 'card--content',\n position: 'hoist',\n filter: (data): data is { subject: Person.Person } => Obj.instanceOf(Person.Person, data.subject),\n component: ({ data, role }) => {\n return (\n <>\n <PersonCard role={role} subject={data.subject} />\n <Surface.Surface role='related' data={data} limit={1} />\n </>\n );\n },\n }),\n Surface.create({\n id: `${meta.id}.schema-popover--organization`,\n role: 'card--content',\n position: 'hoist',\n filter: (data): data is { subject: Organization.Organization } =>\n Obj.instanceOf(Organization.Organization, data.subject),\n component: ({ data, role }) => {\n return (\n <>\n <OrganizationCard role={role} subject={data.subject} />\n <Surface.Surface role='related' data={data} limit={1} />\n </>\n );\n },\n }),\n Surface.create({\n id: `${meta.id}.schema-popover--project`,\n role: 'card--content',\n position: 'hoist',\n filter: (data): data is { subject: Pipeline.Pipeline } => Obj.instanceOf(Pipeline.Pipeline, data.subject),\n component: ({ data, role }) => {\n return <ProjectCard role={role} subject={data.subject} />;\n },\n }),\n Surface.create({\n id: `${meta.id}.schema-popover--task`,\n role: 'card--content',\n position: 'hoist',\n filter: (data): data is { subject: Task.Task } => Obj.instanceOf(Task.Task, data.subject),\n component: ({ data, role }) => {\n return <TaskCard role={role} subject={data.subject} />;\n },\n }),\n\n //\n // Fallback for any object.\n //\n\n Surface.create({\n id: `${meta.id}.fallback-popover`,\n role: 'card--content',\n position: 'fallback',\n filter: (data): data is { subject: Obj.Unknown; projection?: ProjectionModel } => Obj.isObject(data.subject),\n component: ({ data, role }) => {\n return <FormCard role={role} subject={data.subject} projection={data.projection} />;\n },\n }),\n\n Surface.create({\n id: `${meta.id}.section`,\n role: ['section'],\n position: 'fallback',\n filter: (data): data is { subject: Obj.Unknown } => Obj.isObject(data.subject),\n component: ({ data }) => {\n return (\n <div role='none' className='flex w-full justify-center'>\n <div role='none' className='pt-2 pb-2 dx-card-min-width dx-card-max-width'>\n <Card.Root>\n <Surface.Surface role='card--content' data={data} limit={1} />\n </Card.Root>\n </div>\n </div>\n );\n },\n }),\n ]),\n ),\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useMemo } from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';\nimport { Obj } from '@dxos/echo';\nimport { type JsonPath, splitJsonPath } from '@dxos/effect';\nimport { Card, useTranslation } from '@dxos/react-ui';\nimport { Form, omitId } from '@dxos/react-ui-form';\nimport { type ProjectionModel } from '@dxos/schema';\nimport { descriptionMessage, mx } from '@dxos/ui-theme';\n\nimport { meta } from '../meta';\n\nexport const FormCard = ({ subject, projection }: SurfaceComponentProps & { projection?: ProjectionModel }) => {\n const { t } = useTranslation(meta.id);\n const echoSchema = Obj.getSchema(subject);\n const schema = useMemo(() => echoSchema && omitId(echoSchema), [echoSchema]);\n\n const handleSave = useCallback((values: any, { changed }: { changed: Record<string, boolean> }) => {\n const paths = Object.keys(changed).filter((path) => changed[path]);\n Obj.change(subject, () => {\n for (const path of paths) {\n const value = values[path];\n const parts = splitJsonPath(path as JsonPath);\n Obj.setValue(subject, parts, value);\n }\n });\n }, []);\n\n if (!schema) {\n return <p className={mx(descriptionMessage)}>{t('unable to create preview message')}</p>;\n }\n\n return (\n <Card.Content>\n <Form.Root schema={schema} projection={projection} values={subject} autoSave onSave={handleSave}>\n <Form.Viewport>\n <Form.Content>\n <Form.FieldSet />\n </Form.Content>\n </Form.Viewport>\n </Form.Root>\n </Card.Content>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';\nimport { Card } from '@dxos/react-ui';\nimport { type Organization } from '@dxos/types';\n\nexport const OrganizationCard = ({ subject }: SurfaceComponentProps<Organization.Organization>) => {\n const { image, description, website } = subject;\n\n return (\n <Card.Content>\n <Card.Poster\n alt={name ?? ''}\n {...(image ? { image } : { icon: 'ph--building-office--regular' })}\n classNames={!image && 'opacity-50'}\n />\n {description && (\n <Card.Row>\n <Card.Text variant='description'>{description}</Card.Text>\n </Card.Row>\n )}\n {website && <Card.Link label={website} href={website} />}\n </Card.Content>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';\nimport { Avatar } from '@dxos/react-ui';\nimport { Card } from '@dxos/react-ui';\nimport { type Person } from '@dxos/types';\n\nexport const PersonCard = ({ subject }: SurfaceComponentProps<Person.Person>) => {\n const { image, organization: { target: organization } = {}, emails = [] } = subject;\n\n return (\n <Card.Content>\n <Avatar.Root>\n {image && (\n <Card.Row className='py-1'>\n <Avatar.Content\n imgSrc={image}\n icon='ph--user--regular'\n size={16}\n classNames={!image && 'opacity-50'}\n hue='neutral'\n variant='square'\n />\n </Card.Row>\n )}\n {organization?.name && (\n <Card.Action\n icon='ph--buildings--regular'\n label={organization.name}\n // onClick={onSelect ? () => onSelect(organization) : undefined}\n />\n )}\n {emails.map(({ value }) => (\n <Card.Row key={value} icon='ph--at--regular'>\n <Card.Text truncate className='text-primary-text'>\n {value}\n </Card.Text>\n </Card.Row>\n ))}\n </Avatar.Root>\n </Card.Content>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';\nimport { Obj } from '@dxos/echo';\nimport { Card } from '@dxos/react-ui';\nimport { type Pipeline } from '@dxos/types';\n\nexport const ProjectCard = ({ subject }: SurfaceComponentProps<Pipeline.Pipeline>) => {\n const { image, description } = subject;\n\n return (\n <Card.Content>\n {image && <Card.Poster image={image} alt={Obj.getLabel(subject) ?? ''} aspect='auto' />}\n {/* <CardHeader label={name} subject={subject} db={db} /> */}\n {description && <Card.Text variant='description'>{description}</Card.Text>}\n </Card.Content>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as SchemaAST from 'effect/SchemaAST';\nimport React from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';\nimport { type PropertyMetaAnnotation, PropertyMetaAnnotationId } from '@dxos/echo/internal';\nimport { Card } from '@dxos/react-ui';\nimport { Task } from '@dxos/types';\n\nexport const TaskCard = ({ subject }: SurfaceComponentProps<Task.Task>) => {\n const { title, status } = subject;\n const statusOption = getActiveStatusOption(status);\n\n return (\n <Card.Content>\n <Card.Heading classNames='min-w-0 flex-1 truncate'>{title}</Card.Heading>\n {statusOption && (\n <span className='dx-tag' data-hue={statusOption.color}>\n {statusOption.title}\n </span>\n )}\n </Card.Content>\n );\n};\n\n// TODO(thure): Should this move upstream as a helper? Is there an easier way to get options?\nconst getActiveStatusOption = (status?: string) => {\n const properties = SchemaAST.getPropertySignatures(Task.Task.ast);\n const statusProperty = properties.find((p) => p.name === 'status');\n const statusMeta = SchemaAST.getAnnotation<PropertyMetaAnnotation>(PropertyMetaAnnotationId)(\n // TODO(thure): Typescript asserts `.type` doesn’t have `.types`, but in runtime it does.\n (statusProperty!.type as any).types[0],\n );\n const options = // TODO(thure): Typescript asserts `statusMeta` doesn’t have `.value`, but in runtime it does.\n (statusMeta as any).value.singleSelect.options as { id: string; title: string; color: string }[];\n return options.find(({ id }) => id === status);\n};\n"],
5
+ "mappings": ";;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,YAAW;AAElB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,eAAe;AACxB,SAASC,OAAAA,YAAW;AACpB,SAASC,QAAAA,aAAY;AAErB,SAASC,cAAcC,QAAQC,UAAUC,QAAAA,aAAY;;;ACRrD,OAAOC,SAASC,aAAaC,eAAe;AAG5C,SAASC,WAAW;AACpB,SAAwBC,qBAAqB;AAC7C,SAASC,MAAMC,sBAAsB;AACrC,SAASC,MAAMC,cAAc;AAE7B,SAASC,oBAAoBC,UAAU;AAIhC,IAAMC,WAAW,CAAC,EAAEC,SAASC,WAAU,MAA4D;AACx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OAAO;IACbC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,UAAU;IACVC,QAAQ,CAACC,SAAyEC,KAAIc,SAASf,KAAKI,OAAO;IAC3GC,WAAW,CAAC,EAAEL,MAAMH,KAAI,MAAE;AACxB,aAAO,gBAAAS,OAAA,cAACU,UAAAA;QAASnB;QAAYO,SAASJ,KAAKI;QAASa,YAAYjB,KAAKiB;;IACvE;EACF,CAAA;EAEAxB,QAAQC,OAAO;IACbC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;MAAC;;IACPC,UAAU;IACVC,QAAQ,CAACC,SAA2CC,KAAIc,SAASf,KAAKI,OAAO;IAC7EC,WAAW,CAAC,EAAEL,KAAI,MAAE;AAClB,aACE,gBAAAM,OAAA,cAACY,OAAAA;QAAIrB,MAAK;QAAOsB,WAAU;SACzB,gBAAAb,OAAA,cAACY,OAAAA;QAAIrB,MAAK;QAAOsB,WAAU;SACzB,gBAAAb,OAAA,cAACc,MAAKC,MAAI,MACR,gBAAAf,OAAA,cAACb,QAAQA,SAAO;QAACI,MAAK;QAAgBG;QAAYQ,OAAO;;IAKnE;EACF,CAAA;CACD,CAAA,CAAA;",
6
+ "names": ["Effect", "React", "Capabilities", "Capability", "Surface", "Obj", "Card", "Organization", "Person", "Pipeline", "Task", "React", "useCallback", "useMemo", "Obj", "splitJsonPath", "Card", "useTranslation", "Form", "omitId", "descriptionMessage", "mx", "FormCard", "subject", "projection", "t", "useTranslation", "meta", "id", "echoSchema", "Obj", "getSchema", "schema", "useMemo", "omitId", "handleSave", "useCallback", "values", "changed", "paths", "Object", "keys", "filter", "path", "change", "value", "parts", "splitJsonPath", "setValue", "p", "className", "mx", "descriptionMessage", "Card", "Content", "Form", "Root", "autoSave", "onSave", "Viewport", "FieldSet", "React", "Card", "OrganizationCard", "subject", "image", "description", "website", "React", "Card", "Content", "Poster", "alt", "name", "icon", "classNames", "Row", "Text", "variant", "Link", "label", "href", "React", "Avatar", "Card", "PersonCard", "subject", "image", "organization", "target", "emails", "React", "Card", "Content", "Avatar", "Root", "Row", "className", "imgSrc", "icon", "size", "classNames", "hue", "variant", "name", "Action", "label", "map", "value", "key", "Text", "truncate", "React", "Obj", "Card", "ProjectCard", "subject", "image", "description", "React", "Card", "Content", "Poster", "alt", "Obj", "getLabel", "aspect", "Text", "variant", "SchemaAST", "React", "PropertyMetaAnnotationId", "Card", "Task", "TaskCard", "subject", "title", "status", "statusOption", "getActiveStatusOption", "React", "Card", "Content", "Heading", "classNames", "span", "className", "data-hue", "color", "properties", "getPropertySignatures", "Task", "ast", "statusProperty", "find", "p", "name", "statusMeta", "getAnnotation", "PropertyMetaAnnotationId", "type", "types", "options", "value", "singleSelect", "id", "Capability", "makeModule", "succeed", "contributes", "Capabilities", "ReactSurface", "Surface", "create", "id", "meta", "role", "position", "filter", "data", "Obj", "instanceOf", "Person", "subject", "component", "React", "PersonCard", "limit", "Organization", "OrganizationCard", "Pipeline", "ProjectCard", "Task", "TaskCard", "isObject", "FormCard", "projection", "div", "className", "Card", "Root"]
7
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"PreviewPlugin.d.ts","sourceRoot":"","sources":["../../../src/PreviewPlugin.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAU,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAOrD,eAAO,MAAM,aAAa,4BAUzB,CAAC"}
1
+ {"version":3,"file":"PreviewPlugin.d.ts","sourceRoot":"","sources":["../../../src/PreviewPlugin.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAoB,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAQ/D,eAAO,MAAM,aAAa,4BAUzB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import * as Effect from 'effect/Effect';
2
2
  import { Capability } from '@dxos/app-framework';
3
- declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<null>>, never, Capability.Service>;
3
+ declare const _default: (props: void) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<null>>, never, Capability.Service>;
4
4
  export default _default;
5
5
  //# sourceMappingURL=preview-popover.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"preview-popover.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/preview-popover/preview-popover.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAU,MAAM,qBAAqB,CAAC;;AAyBzD,wBA6CE"}
1
+ {"version":3,"file":"preview-popover.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/preview-popover/preview-popover.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAgB,UAAU,EAAE,MAAM,qBAAqB,CAAC;;AA2B/D,wBAwDE"}
@@ -1,3 +1,3 @@
1
1
  import { Capability } from '@dxos/app-framework';
2
- export declare const ReactSurface: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<import("@dxos/app-framework/Common").Capability.ReactSurface>>, Error>;
2
+ export declare const ReactSurface: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<import("@dxos/app-framework/Capabilities").ReactSurface>>, Error>;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/react-surface/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,YAAY,sJAAmE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/react-surface/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,YAAY,iJAAmE,CAAC"}