@dxos/plugin-preview 0.8.4-main.ead640a → 0.8.4-main.effb148878

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 (129) hide show
  1. package/LICENSE +102 -5
  2. package/dist/lib/neutral/PreviewPlugin.mjs +9 -0
  3. package/dist/lib/neutral/PreviewPlugin.mjs.map +7 -0
  4. package/dist/lib/neutral/PreviewPlugin.node.mjs +17 -0
  5. package/dist/lib/neutral/PreviewPlugin.node.mjs.map +7 -0
  6. package/dist/lib/neutral/PreviewPlugin.workerd.mjs +17 -0
  7. package/dist/lib/neutral/PreviewPlugin.workerd.mjs.map +7 -0
  8. package/dist/lib/neutral/capabilities/index.mjs +9 -0
  9. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  10. package/dist/lib/neutral/chunk-3SWUVHXJ.mjs +28 -0
  11. package/dist/lib/neutral/chunk-3SWUVHXJ.mjs.map +7 -0
  12. package/dist/lib/neutral/chunk-XD3EYTHF.mjs +21 -0
  13. package/dist/lib/neutral/chunk-XD3EYTHF.mjs.map +7 -0
  14. package/dist/lib/neutral/index.mjs +7 -0
  15. package/dist/lib/neutral/index.mjs.map +7 -0
  16. package/dist/lib/neutral/meta.json +1 -0
  17. package/dist/lib/neutral/meta.mjs +7 -0
  18. package/dist/lib/neutral/meta.mjs.map +7 -0
  19. package/dist/lib/neutral/plugin.mjs +11 -0
  20. package/dist/lib/neutral/plugin.mjs.map +7 -0
  21. package/dist/lib/neutral/preview-popover-F33UBSBM.mjs +80 -0
  22. package/dist/lib/neutral/preview-popover-F33UBSBM.mjs.map +7 -0
  23. package/dist/lib/neutral/react-surface-3UPRCM4X.mjs +408 -0
  24. package/dist/lib/neutral/react-surface-3UPRCM4X.mjs.map +7 -0
  25. package/dist/lib/neutral/testing.mjs +7 -0
  26. package/dist/lib/neutral/testing.mjs.map +7 -0
  27. package/dist/lib/neutral/translations.mjs +21 -0
  28. package/dist/lib/neutral/translations.mjs.map +7 -0
  29. package/dist/types/src/PreviewPlugin.d.ts +3 -1
  30. package/dist/types/src/PreviewPlugin.d.ts.map +1 -1
  31. package/dist/types/src/PreviewPlugin.node.d.ts +4 -0
  32. package/dist/types/src/PreviewPlugin.node.d.ts.map +1 -0
  33. package/dist/types/src/PreviewPlugin.test.d.ts +2 -0
  34. package/dist/types/src/PreviewPlugin.test.d.ts.map +1 -0
  35. package/dist/types/src/PreviewPlugin.workerd.d.ts +4 -0
  36. package/dist/types/src/PreviewPlugin.workerd.d.ts.map +1 -0
  37. package/dist/types/src/capabilities/index.d.ts +3 -2
  38. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  39. package/dist/types/src/capabilities/preview-popover.d.ts +3 -2
  40. package/dist/types/src/capabilities/preview-popover.d.ts.map +1 -1
  41. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  42. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  43. package/dist/types/src/cards/ExpandoCard.d.ts +4 -0
  44. package/dist/types/src/cards/ExpandoCard.d.ts.map +1 -0
  45. package/dist/types/src/cards/FormCard.d.ts +17 -0
  46. package/dist/types/src/cards/FormCard.d.ts.map +1 -0
  47. package/dist/types/src/cards/JsonCard.d.ts +5 -0
  48. package/dist/types/src/cards/JsonCard.d.ts.map +1 -0
  49. package/dist/types/src/cards/OrganizationCard.d.ts +3 -3
  50. package/dist/types/src/cards/OrganizationCard.d.ts.map +1 -1
  51. package/dist/types/src/cards/PersonCard.d.ts +5 -0
  52. package/dist/types/src/cards/PersonCard.d.ts.map +1 -0
  53. package/dist/types/src/cards/ProjectCard.d.ts +3 -3
  54. package/dist/types/src/cards/ProjectCard.d.ts.map +1 -1
  55. package/dist/types/src/cards/TaskCard.d.ts +3 -3
  56. package/dist/types/src/cards/TaskCard.d.ts.map +1 -1
  57. package/dist/types/src/cards/index.d.ts +4 -1
  58. package/dist/types/src/cards/index.d.ts.map +1 -1
  59. package/dist/types/src/index.d.ts +0 -2
  60. package/dist/types/src/index.d.ts.map +1 -1
  61. package/dist/types/src/meta.d.ts +2 -2
  62. package/dist/types/src/meta.d.ts.map +1 -1
  63. package/dist/types/src/plugin.d.ts +3 -0
  64. package/dist/types/src/plugin.d.ts.map +1 -0
  65. package/dist/types/src/stories/Card.stories.d.ts +42 -14
  66. package/dist/types/src/stories/Card.stories.d.ts.map +1 -1
  67. package/dist/types/src/stories/testing.d.ts +52 -12
  68. package/dist/types/src/stories/testing.d.ts.map +1 -1
  69. package/dist/types/src/testing.d.ts +2 -0
  70. package/dist/types/src/testing.d.ts.map +1 -0
  71. package/dist/types/src/translations.d.ts +8 -9
  72. package/dist/types/src/translations.d.ts.map +1 -1
  73. package/dist/types/tsconfig.tsbuildinfo +1 -1
  74. package/package.json +92 -39
  75. package/src/PreviewPlugin.node.ts +16 -0
  76. package/src/PreviewPlugin.test.ts +25 -0
  77. package/src/PreviewPlugin.tsx +17 -26
  78. package/src/PreviewPlugin.workerd.ts +16 -0
  79. package/src/capabilities/index.ts +3 -3
  80. package/src/capabilities/preview-popover.ts +69 -42
  81. package/src/capabilities/react-surface.tsx +132 -120
  82. package/src/cards/ExpandoCard.tsx +76 -0
  83. package/src/cards/FormCard.tsx +115 -0
  84. package/src/cards/JsonCard.tsx +19 -0
  85. package/src/cards/OrganizationCard.tsx +17 -13
  86. package/src/cards/PersonCard.tsx +65 -0
  87. package/src/cards/ProjectCard.tsx +9 -11
  88. package/src/cards/TaskCard.tsx +27 -28
  89. package/src/cards/index.ts +4 -1
  90. package/src/index.ts +0 -3
  91. package/src/meta.ts +10 -3
  92. package/src/plugin.ts +9 -0
  93. package/src/stories/Card.stories.tsx +139 -24
  94. package/src/stories/testing.tsx +117 -77
  95. package/src/testing.ts +7 -0
  96. package/src/translations.ts +8 -8
  97. package/dist/lib/browser/chunk-XKCIQK3C.mjs +0 -12
  98. package/dist/lib/browser/chunk-XKCIQK3C.mjs.map +0 -7
  99. package/dist/lib/browser/index.mjs +0 -64
  100. package/dist/lib/browser/index.mjs.map +0 -7
  101. package/dist/lib/browser/meta.json +0 -1
  102. package/dist/lib/browser/preview-popover-RKHENTFP.mjs +0 -65
  103. package/dist/lib/browser/preview-popover-RKHENTFP.mjs.map +0 -7
  104. package/dist/lib/browser/react-surface-CPGRW3OV.mjs +0 -493
  105. package/dist/lib/browser/react-surface-CPGRW3OV.mjs.map +0 -7
  106. package/dist/lib/node-esm/chunk-L3IZVX56.mjs +0 -14
  107. package/dist/lib/node-esm/chunk-L3IZVX56.mjs.map +0 -7
  108. package/dist/lib/node-esm/index.mjs +0 -65
  109. package/dist/lib/node-esm/index.mjs.map +0 -7
  110. package/dist/lib/node-esm/meta.json +0 -1
  111. package/dist/lib/node-esm/preview-popover-TZKX67EY.mjs +0 -67
  112. package/dist/lib/node-esm/preview-popover-TZKX67EY.mjs.map +0 -7
  113. package/dist/lib/node-esm/react-surface-XJKNWCPR.mjs +0 -494
  114. package/dist/lib/node-esm/react-surface-XJKNWCPR.mjs.map +0 -7
  115. package/dist/types/src/cards/ContactCard.d.ts +0 -5
  116. package/dist/types/src/cards/ContactCard.d.ts.map +0 -1
  117. package/dist/types/src/components/CardComponents.d.ts +0 -16
  118. package/dist/types/src/components/CardComponents.d.ts.map +0 -1
  119. package/dist/types/src/components/CardSubjectMenu.d.ts +0 -8
  120. package/dist/types/src/components/CardSubjectMenu.d.ts.map +0 -1
  121. package/dist/types/src/components/index.d.ts +0 -3
  122. package/dist/types/src/components/index.d.ts.map +0 -1
  123. package/dist/types/src/types.d.ts +0 -10
  124. package/dist/types/src/types.d.ts.map +0 -1
  125. package/src/cards/ContactCard.tsx +0 -58
  126. package/src/components/CardComponents.tsx +0 -67
  127. package/src/components/CardSubjectMenu.tsx +0 -91
  128. package/src/components/index.ts +0 -6
  129. package/src/types.ts +0 -15
package/LICENSE CHANGED
@@ -1,8 +1,105 @@
1
- MIT License
2
- Copyright (c) 2022 DXOS
1
+ # Functional Source License, Version 1.1, ALv2 Future License
3
2
 
4
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3
+ ## Abbreviation
5
4
 
6
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
5
+ FSL-1.1-Apache-2.0
7
6
 
8
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7
+ ## Notice
8
+
9
+ Copyright 2026 DXOS
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly display
28
+ and redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or
34
+ service that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software
39
+ that exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee
52
+ using the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to
59
+ the infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software,
68
+ you must include a copy of or a link to these Terms and Conditions and not
69
+ remove any copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
+ PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
+
77
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
79
+ EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
+
81
+ ### Trademarks
82
+
83
+ Except for displaying the License Details and identifying us as the origin of
84
+ the Software, you have no right under these Terms and Conditions to use our
85
+ trademarks, trade names, service marks or product names.
86
+
87
+ ## Grant of Future License
88
+
89
+ We hereby irrevocably grant you an additional license to use the Software under
90
+ the Apache License, Version 2.0 that is effective on the second anniversary of
91
+ the date we make the Software available. On or after that date, you may use the
92
+ Software under the Apache License, Version 2.0, in which case the following
93
+ will apply:
94
+
95
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
96
+ this file except in compliance with the License.
97
+
98
+ You may obtain a copy of the License at
99
+
100
+ http://www.apache.org/licenses/LICENSE-2.0
101
+
102
+ Unless required by applicable law or agreed to in writing, software distributed
103
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
104
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
105
+ specific language governing permissions and limitations under the License.
@@ -0,0 +1,9 @@
1
+ import {
2
+ PreviewPlugin,
3
+ PreviewPlugin_default
4
+ } from "./chunk-3SWUVHXJ.mjs";
5
+ export {
6
+ PreviewPlugin,
7
+ PreviewPlugin_default as default
8
+ };
9
+ //# sourceMappingURL=PreviewPlugin.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,17 @@
1
+ // src/PreviewPlugin.node.ts
2
+ import { Plugin } from "@dxos/app-framework";
3
+ import { AppPlugin } from "@dxos/app-toolkit";
4
+ import { Organization, Person } from "@dxos/types";
5
+ import { meta } from "#meta";
6
+ var PreviewPlugin = Plugin.define(meta).pipe(AppPlugin.addSchemaModule({
7
+ schema: [
8
+ Person.Person,
9
+ Organization.Organization
10
+ ]
11
+ }), Plugin.make);
12
+ var PreviewPlugin_node_default = PreviewPlugin;
13
+ export {
14
+ PreviewPlugin,
15
+ PreviewPlugin_node_default as default
16
+ };
17
+ //# sourceMappingURL=PreviewPlugin.node.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/PreviewPlugin.node.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\nimport { Organization, Person } from '@dxos/types';\n\nimport { meta } from '#meta';\n\nexport const PreviewPlugin = Plugin.define(meta).pipe(\n AppPlugin.addSchemaModule({ schema: [Person.Person, Organization.Organization] }),\n Plugin.make,\n);\n\nexport default PreviewPlugin;\n"],
5
+ "mappings": ";AAIA,SAASA,cAAc;AACvB,SAASC,iBAAiB;AAC1B,SAASC,cAAcC,cAAc;AAErC,SAASC,YAAY;AAEd,IAAMC,gBAAgBL,OAAOM,OAAOF,IAAAA,EAAMG,KAC/CN,UAAUO,gBAAgB;EAAEC,QAAQ;IAACN,OAAOA;IAAQD,aAAaA;;AAAc,CAAA,GAC/EF,OAAOU,IAAI;AAGb,IAAA,6BAAeL;",
6
+ "names": ["Plugin", "AppPlugin", "Organization", "Person", "meta", "PreviewPlugin", "define", "pipe", "addSchemaModule", "schema", "make"]
7
+ }
@@ -0,0 +1,17 @@
1
+ // src/PreviewPlugin.workerd.ts
2
+ import { Plugin } from "@dxos/app-framework";
3
+ import { AppPlugin } from "@dxos/app-toolkit";
4
+ import { Organization, Person } from "@dxos/types";
5
+ import { meta } from "#meta";
6
+ var PreviewPlugin = Plugin.define(meta).pipe(AppPlugin.addSchemaModule({
7
+ schema: [
8
+ Person.Person,
9
+ Organization.Organization
10
+ ]
11
+ }), Plugin.make);
12
+ var PreviewPlugin_workerd_default = PreviewPlugin;
13
+ export {
14
+ PreviewPlugin,
15
+ PreviewPlugin_workerd_default as default
16
+ };
17
+ //# sourceMappingURL=PreviewPlugin.workerd.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/PreviewPlugin.workerd.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\nimport { Organization, Person } from '@dxos/types';\n\nimport { meta } from '#meta';\n\nexport const PreviewPlugin = Plugin.define(meta).pipe(\n AppPlugin.addSchemaModule({ schema: [Person.Person, Organization.Organization] }),\n Plugin.make,\n);\n\nexport default PreviewPlugin;\n"],
5
+ "mappings": ";AAIA,SAASA,cAAc;AACvB,SAASC,iBAAiB;AAC1B,SAASC,cAAcC,cAAc;AAErC,SAASC,YAAY;AAEd,IAAMC,gBAAgBL,OAAOM,OAAOF,IAAAA,EAAMG,KAC/CN,UAAUO,gBAAgB;EAAEC,QAAQ;IAACN,OAAOA;IAAQD,aAAaA;;AAAc,CAAA,GAC/EF,OAAOU,IAAI;AAGb,IAAA,gCAAeL;",
6
+ "names": ["Plugin", "AppPlugin", "Organization", "Person", "meta", "PreviewPlugin", "define", "pipe", "addSchemaModule", "schema", "make"]
7
+ }
@@ -0,0 +1,9 @@
1
+ // src/capabilities/index.ts
2
+ import { Capability } from "@dxos/app-framework";
3
+ var PreviewPopover = Capability.lazy("PreviewPopover", () => import("../preview-popover-F33UBSBM.mjs"));
4
+ var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-3UPRCM4X.mjs"));
5
+ export {
6
+ PreviewPopover,
7
+ ReactSurface
8
+ };
9
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/capabilities/index.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const PreviewPopover = Capability.lazy('PreviewPopover', () => import('./preview-popover'));\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\n"],
5
+ "mappings": ";AAIA,SAASA,kBAAkB;AAEpB,IAAMC,iBAAiBD,WAAWE,KAAK,kBAAkB,MAAM,OAAO,iCAAA,CAAA;AACtE,IAAMC,eAAeH,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;",
6
+ "names": ["Capability", "PreviewPopover", "lazy", "ReactSurface"]
7
+ }
@@ -0,0 +1,28 @@
1
+ // src/PreviewPlugin.tsx
2
+ import { ActivationEvents, Plugin } from "@dxos/app-framework";
3
+ import { AppPlugin } from "@dxos/app-toolkit";
4
+ import { Organization, Person } from "@dxos/types";
5
+ import { PreviewPopover, ReactSurface } from "#capabilities";
6
+ import { meta } from "#meta";
7
+ import { translations } from "#translations";
8
+ var PreviewPlugin = Plugin.define(meta).pipe(AppPlugin.addSchemaModule({
9
+ schema: [
10
+ Person.Person,
11
+ Organization.Organization
12
+ ]
13
+ }), AppPlugin.addSurfaceModule({
14
+ activate: ReactSurface
15
+ }), AppPlugin.addTranslationsModule({
16
+ translations
17
+ }), Plugin.addModule({
18
+ id: "preview-popover",
19
+ activatesOn: ActivationEvents.Startup,
20
+ activate: PreviewPopover
21
+ }), Plugin.make);
22
+ var PreviewPlugin_default = PreviewPlugin;
23
+
24
+ export {
25
+ PreviewPlugin,
26
+ PreviewPlugin_default
27
+ };
28
+ //# sourceMappingURL=chunk-3SWUVHXJ.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/PreviewPlugin.tsx"],
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] }),\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\nexport default PreviewPlugin;\n"],
5
+ "mappings": ";AAIA,SAASA,kBAAkBC,cAAc;AACzC,SAASC,iBAAiB;AAC1B,SAASC,cAAcC,cAAc;AAErC,SAASC,gBAAgBC,oBAAoB;AAC7C,SAASC,YAAY;AACrB,SAASC,oBAAoB;AAEtB,IAAMC,gBAAgBR,OAAOS,OAAOH,IAAAA,EAAMI,KAC/CT,UAAUU,gBAAgB;EAAEC,QAAQ;IAACT,OAAOA;IAAQD,aAAaA;;AAAc,CAAA,GAC/ED,UAAUY,iBAAiB;EAAEC,UAAUT;AAAa,CAAA,GACpDJ,UAAUc,sBAAsB;EAAER;AAAa,CAAA,GAC/CP,OAAOgB,UAAU;EACfC,IAAI;EACJC,aAAanB,iBAAiBoB;EAC9BL,UAAUV;AACZ,CAAA,GACAJ,OAAOoB,IAAI;AAGb,IAAA,wBAAeZ;",
6
+ "names": ["ActivationEvents", "Plugin", "AppPlugin", "Organization", "Person", "PreviewPopover", "ReactSurface", "meta", "translations", "PreviewPlugin", "define", "pipe", "addSchemaModule", "schema", "addSurfaceModule", "activate", "addTranslationsModule", "addModule", "id", "activatesOn", "Startup", "make"]
7
+ }
@@ -0,0 +1,21 @@
1
+ // src/meta.ts
2
+ import { trim } from "@dxos/util";
3
+ var meta = {
4
+ id: "org.dxos.plugin.preview",
5
+ name: "Preview",
6
+ author: "DXOS",
7
+ description: trim`
8
+ Rich preview panel for viewing object content without opening full editors.
9
+ Quick peek at documents, images, and data with inline rendering.
10
+ `,
11
+ icon: "ph--eye--regular",
12
+ source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-preview",
13
+ tags: [
14
+ "system"
15
+ ]
16
+ };
17
+
18
+ export {
19
+ meta
20
+ };
21
+ //# sourceMappingURL=chunk-XD3EYTHF.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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: 'org.dxos.plugin.preview',\n name: 'Preview',\n author: 'DXOS',\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 tags: ['system'],\n};\n"],
5
+ "mappings": ";AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,QAAQ;EACRC,aAAaL;;;;EAIbM,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;AACT;",
6
+ "names": ["trim", "meta", "id", "name", "author", "description", "icon", "source", "tags"]
7
+ }
@@ -0,0 +1,7 @@
1
+ import {
2
+ meta
3
+ } from "./chunk-XD3EYTHF.mjs";
4
+ export {
5
+ meta
6
+ };
7
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ {"inputs":{"src/meta.ts":{"bytes":1764,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":368,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/PreviewPlugin.tsx":{"bytes":3129,"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":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true}],"format":"esm"},"src/PreviewPlugin.node.ts":{"bytes":1738,"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":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/PreviewPlugin.workerd.ts":{"bytes":1742,"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":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/preview-popover.ts":{"bytes":11821,"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/cards/ExpandoCard.tsx":{"bytes":8119,"imports":[{"path":"effect/Schema","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}],"format":"esm"},"src/cards/FormCard.tsx":{"bytes":13269,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","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":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/cards/JsonCard.tsx":{"bytes":1589,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true}],"format":"esm"},"src/cards/OrganizationCard.tsx":{"bytes":2939,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/cards/PersonCard.tsx":{"bytes":7835,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","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","kind":"import-statement","external":true}],"format":"esm"},"src/cards/ProjectCard.tsx":{"bytes":2313,"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":5515,"imports":[{"path":"effect/SchemaAST","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","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":948,"imports":[{"path":"src/cards/ExpandoCard.tsx","kind":"import-statement","original":"./ExpandoCard"},{"path":"src/cards/FormCard.tsx","kind":"import-statement","original":"./FormCard"},{"path":"src/cards/JsonCard.tsx","kind":"import-statement","original":"./JsonCard"},{"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.tsx":{"bytes":18529,"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/app-toolkit/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/schema","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"src/cards/index.ts","kind":"import-statement","original":"../cards"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":1152,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/preview-popover.ts","kind":"dynamic-import","original":"./preview-popover"},{"path":"src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/plugin.ts":{"bytes":860,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"#plugin","kind":"dynamic-import","external":true}],"format":"esm"},"src/testing.ts":{"bytes":665,"imports":[{"path":"src/PreviewPlugin.tsx","kind":"import-statement","original":"./PreviewPlugin"}],"format":"esm"},"src/translations.ts":{"bytes":1809,"imports":[{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/neutral/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":888},"dist/lib/neutral/translations.mjs":{"imports":[{"path":"#meta","kind":"import-statement","external":true}],"exports":["translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":408}},"bytes":500},"dist/lib/neutral/preview-popover-F33UBSBM.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5563},"dist/lib/neutral/preview-popover-F33UBSBM.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.ts","inputs":{"src/capabilities/preview-popover.ts":{"bytesInOutput":2603}},"bytes":2745},"dist/lib/neutral/react-surface-3UPRCM4X.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":30453},"dist/lib/neutral/react-surface-3UPRCM4X.mjs":{"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/app-toolkit/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/schema","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"effect/Schema","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":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","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":"#meta","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-syntax-highlighter","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","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","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","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.tsx","inputs":{"src/capabilities/react-surface.tsx":{"bytesInOutput":4664},"src/cards/ExpandoCard.tsx":{"bytesInOutput":1784},"src/cards/index.ts":{"bytesInOutput":0},"src/cards/FormCard.tsx":{"bytesInOutput":2484},"src/cards/JsonCard.tsx":{"bytesInOutput":419},"src/cards/OrganizationCard.tsx":{"bytesInOutput":724},"src/cards/PersonCard.tsx":{"bytesInOutput":2062},"src/cards/ProjectCard.tsx":{"bytesInOutput":514},"src/cards/TaskCard.tsx":{"bytesInOutput":1125}},"bytes":14157},"dist/lib/neutral/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-XD3EYTHF.mjs","kind":"import-statement"}],"exports":["meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":101},"dist/lib/neutral/PreviewPlugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/PreviewPlugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-3SWUVHXJ.mjs","kind":"import-statement"}],"exports":["PreviewPlugin","default"],"entryPoint":"src/PreviewPlugin.tsx","inputs":{},"bytes":188},"dist/lib/neutral/PreviewPlugin.node.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":894},"dist/lib/neutral/PreviewPlugin.node.mjs":{"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":"#meta","kind":"import-statement","external":true}],"exports":["PreviewPlugin","default"],"entryPoint":"src/PreviewPlugin.node.ts","inputs":{"src/PreviewPlugin.node.ts":{"bytesInOutput":379}},"bytes":525},"dist/lib/neutral/PreviewPlugin.workerd.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":897},"dist/lib/neutral/PreviewPlugin.workerd.mjs":{"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":"#meta","kind":"import-statement","external":true}],"exports":["PreviewPlugin","default"],"entryPoint":"src/PreviewPlugin.workerd.ts","inputs":{"src/PreviewPlugin.workerd.ts":{"bytesInOutput":382}},"bytes":537},"dist/lib/neutral/capabilities/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":610},"dist/lib/neutral/capabilities/index.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/neutral/preview-popover-F33UBSBM.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/react-surface-3UPRCM4X.mjs","kind":"dynamic-import"}],"exports":["PreviewPopover","ReactSurface"],"entryPoint":"src/capabilities/index.ts","inputs":{"src/capabilities/index.ts":{"bytesInOutput":254}},"bytes":363},"dist/lib/neutral/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/meta.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-XD3EYTHF.mjs","kind":"import-statement"}],"exports":["meta"],"entryPoint":"src/meta.ts","inputs":{},"bytes":100},"dist/lib/neutral/plugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":443},"dist/lib/neutral/plugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-XD3EYTHF.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#plugin","kind":"dynamic-import","external":true}],"exports":["PreviewPlugin"],"entryPoint":"src/plugin.ts","inputs":{"src/plugin.ts":{"bytesInOutput":110}},"bytes":239},"dist/lib/neutral/chunk-XD3EYTHF.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":878},"dist/lib/neutral/chunk-XD3EYTHF.mjs":{"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":435}},"bytes":514},"dist/lib/neutral/testing.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/testing.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-3SWUVHXJ.mjs","kind":"import-statement"}],"exports":["PreviewPlugin"],"entryPoint":"src/testing.ts","inputs":{"src/testing.ts":{"bytesInOutput":0}},"bytes":121},"dist/lib/neutral/chunk-3SWUVHXJ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1643},"dist/lib/neutral/chunk-3SWUVHXJ.mjs":{"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":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true}],"exports":["PreviewPlugin","PreviewPlugin_default"],"inputs":{"src/PreviewPlugin.tsx":{"bytesInOutput":727}},"bytes":850}}}
@@ -0,0 +1,7 @@
1
+ import {
2
+ meta
3
+ } from "./chunk-XD3EYTHF.mjs";
4
+ export {
5
+ meta
6
+ };
7
+ //# sourceMappingURL=meta.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,11 @@
1
+ import {
2
+ meta
3
+ } from "./chunk-XD3EYTHF.mjs";
4
+
5
+ // src/plugin.ts
6
+ import { Plugin } from "@dxos/app-framework";
7
+ var PreviewPlugin = Plugin.lazy(meta, () => import("#plugin"));
8
+ export {
9
+ PreviewPlugin
10
+ };
11
+ //# sourceMappingURL=plugin.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/plugin.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport { meta } from './meta';\n\nexport const PreviewPlugin = Plugin.lazy(meta, () => import('#plugin'));\n"],
5
+ "mappings": ";;;;;AAIA,SAASA,cAAc;AAIhB,IAAMC,gBAAgBC,OAAOC,KAAKC,MAAM,MAAM,OAAO,SAAA,CAAA;",
6
+ "names": ["Plugin", "PreviewPlugin", "Plugin", "lazy", "meta"]
7
+ }
@@ -0,0 +1,80 @@
1
+ // src/capabilities/preview-popover.ts
2
+ import * as Effect from "effect/Effect";
3
+ import { Capabilities, Capability } from "@dxos/app-framework";
4
+ import { AppCapabilities, LayoutOperation, getPersonalSpace, getSpaceIdFromPath } from "@dxos/app-toolkit";
5
+ import { addEventListener } from "@dxos/async";
6
+ import { Obj } from "@dxos/echo";
7
+ import { EchoURI } from "@dxos/keys";
8
+ import { log } from "@dxos/log";
9
+ import { ClientCapabilities } from "@dxos/plugin-client";
10
+ import { DX_ANCHOR_ACTIVATE } from "@dxos/react-ui";
11
+ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-preview/src/capabilities/preview-popover.ts";
12
+ var customEventOptions = {
13
+ capture: true,
14
+ passive: false
15
+ };
16
+ var handlePreviewLookup = async (client, defaultSpace, { dxn, label }) => {
17
+ try {
18
+ const object = await defaultSpace.db.makeRef(EchoURI.parse(dxn)).load();
19
+ return {
20
+ label,
21
+ object
22
+ };
23
+ } catch {
24
+ return null;
25
+ }
26
+ };
27
+ var preview_popover_default = Capability.makeModule(Effect.fnUntraced(function* () {
28
+ const capabilities = yield* Capability.Service;
29
+ const handleAnchorActivate = async ({ dxn, label, trigger, kind = "card", title: titleProp, side, props }) => {
30
+ const { invokePromise } = capabilities.get(Capabilities.OperationInvoker);
31
+ const client = capabilities.get(ClientCapabilities.Client);
32
+ const registry = capabilities.get(Capabilities.AtomRegistry);
33
+ const [layoutAtom] = capabilities.getAll(AppCapabilities.Layout);
34
+ const spaceId = layoutAtom && getSpaceIdFromPath(registry.get(layoutAtom).workspace);
35
+ const space = (spaceId && client.spaces.get(spaceId)) ?? getPersonalSpace(client);
36
+ if (!space) {
37
+ return;
38
+ }
39
+ const result = await handlePreviewLookup(client, space, {
40
+ dxn,
41
+ label
42
+ });
43
+ if (!result) {
44
+ return;
45
+ }
46
+ const title = titleProp ?? Obj.getLabel(result.object, {
47
+ fallback: "typename"
48
+ });
49
+ await invokePromise(LayoutOperation.UpdatePopover, {
50
+ subjectRef: dxn,
51
+ subject: result.object,
52
+ state: true,
53
+ variant: "virtual",
54
+ anchor: trigger,
55
+ ...kind && {
56
+ kind
57
+ },
58
+ ...title && {
59
+ title
60
+ },
61
+ ...side && {
62
+ side
63
+ },
64
+ ...props && {
65
+ props
66
+ }
67
+ });
68
+ };
69
+ let cleanup;
70
+ if (document.defaultView) {
71
+ cleanup = addEventListener(document.defaultView, DX_ANCHOR_ACTIVATE, handleAnchorActivate, customEventOptions);
72
+ } else {
73
+ log.warn("no default view found", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 80, S: this });
74
+ }
75
+ return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => cleanup?.()));
76
+ }));
77
+ export {
78
+ preview_popover_default as default
79
+ };
80
+ //# sourceMappingURL=preview-popover-F33UBSBM.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/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, getPersonalSpace, 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 { EchoURI } 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(EchoURI.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 // Layout is optional: in standalone harnesses (Storybook, tests) no plugin contributes\n // `AppCapabilities.Layout`, and `getAll` returns an empty array. Reading `registry.get(undefined)`\n // would crash inside Atom's identity check (`'~atom/Serializable' in undefined`). When layout\n // isn't available, fall through to the personal-space default.\n const [layoutAtom] = capabilities.getAll(AppCapabilities.Layout);\n const spaceId = layoutAtom && getSpaceIdFromPath(registry.get(layoutAtom).workspace);\n const space = (spaceId && client.spaces.get(spaceId)) ?? getPersonalSpace(client);\n if (!space) {\n return;\n }\n const result = await handlePreviewLookup(client, space, { dxn, label });\n if (!result) {\n return;\n }\n\n const title = titleProp ?? Obj.getLabel(result.object, { fallback: 'typename' });\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,kBAAkBC,0BAA0B;AACvF,SAASC,wBAAwB;AAGjC,SAASC,WAAW;AACpB,SAASC,eAAe;AACxB,SAASC,WAAW;AACpB,SAASC,0BAA0B;AACnC,SAASC,0BAAiD;AAG1D,IAAA,eAAMC;IAAsCC,qBAAS;EAAM,SAAA;EAE3D,SAAMC;;0BAMa,OAAMC,QAAaC,cAAWR,EAAAA,KAAQS,MAAMC,MAAMC;MACjE;UAASC,SAAAA,MAAAA,aAAAA,GAAAA,QAAAA,QAAAA,MAAAA,GAAAA,CAAAA,EAAAA,KAAAA;WAAOC;MAAO;MACvB;IACA;EACF,QAAA;AACF,WAAA;EAEA;;IAGI,0BAAMC,WAAe,WAAkBC,kBAAO,aAAA;AAG9C,QAAMC,eAAAA,OAAAA,WACJN;QASA,uBAAeI,OAAiBZ,EAAAA,KAAAA,OAAAA,SAAmBe,OAAM,QAAA,OAAA,WAAA,MAAA,MAAA,MAAA;AACzD,UAAMC,EAAAA,cAAWJ,IAAAA,aAAiBtB,IAAAA,aAAa2B,gBAAY;AAC3D,UAAA,SAAA,aAAA,IAAA,mBAAA,MAAA;AACA,UAAA,WAAA,aAAA,IAAA,aAAA,YAAA;AAKA,UAAMC,CAAAA,UAASC,IAAAA,aAAkBC,OAAOC,gBAAiB3B,MAAAA;AACzD,UAAKwB,UAAO,cAAA,mBAAA,SAAA,IAAA,UAAA,EAAA,SAAA;UACV,SAAA,WAAA,OAAA,OAAA,IAAA,OAAA,MAAA,iBAAA,MAAA;AACF,QAAA,CAAA,OAAA;AACA;;UAA+DR,SAAAA,MAAAA,oBAAAA,QAAAA,OAAAA;MAAM;MACjE;;AAEJ,QAAA,CAAA,QAAA;AAEA;;AAA8E,UAAA,QAAA,aAAA,IAAA,SAAA,OAAA,QAAA;MAE9E,UAAMY;;UAEJC,cAAgBZ,gBAAM,eAAA;MACtBa,YAAO;MACPC,SAAS,OAAA;MACTC,OAAAA;MACA,SAAIC;cAAUA;MAAK,GAAC,QAAA;QAChBC;;MAAiB,GAAC,SAAA;QAClBC;;MAAe,GAAC,QAAA;QAChBC;;MAAiB,GAAC,SAAA;QACxB;MACF;IAEIC,CAAAA;EACJ;MACEA;AAMF,MAAA,SAAO,aAAA;AACLhC,cAAS,iBAAA,SAAA,aAAA,oBAAA,sBAAA,kBAAA;EACX,OAAA;AAEA,QAAOR,KAAAA,yBAAuBD,QAAa0C,EAAAA,YAAY,YAAaC,GAAAA,cAAWF,GAAAA,IAAAA,GAAAA,KAAAA,CAAAA;EAEjF;;;",
6
+ "names": ["Effect", "Capabilities", "Capability", "AppCapabilities", "LayoutOperation", "getPersonalSpace", "getSpaceIdFromPath", "addEventListener", "Obj", "EchoURI", "log", "ClientCapabilities", "DX_ANCHOR_ACTIVATE", "customEventOptions", "passive", "handlePreviewLookup", "defaultSpace", "db", "parse", "dxn", "load", "label", "object", "capabilities", "Service", "handleAnchorActivate", "Client", "registry", "AtomRegistry", "space", "spaceId", "spaces", "get", "invokePromise", "subject", "state", "variant", "anchor", "kind", "title", "side", "props", "cleanup", "Null", "sync"]
7
+ }