@dxos/plugin-preview 0.8.2-main.12df754 → 0.8.2-main.36232bc

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 (36) hide show
  1. package/dist/lib/browser/index.mjs +267 -6
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node/index.cjs +267 -4
  5. package/dist/lib/node/index.cjs.map +4 -4
  6. package/dist/lib/node/meta.json +1 -1
  7. package/dist/lib/node-esm/index.mjs +267 -6
  8. package/dist/lib/node-esm/index.mjs.map +4 -4
  9. package/dist/lib/node-esm/meta.json +1 -1
  10. package/dist/types/src/Preview.stories.d.ts +197 -0
  11. package/dist/types/src/Preview.stories.d.ts.map +1 -0
  12. package/dist/types/src/PreviewPlugin.d.ts.map +1 -1
  13. package/dist/types/src/components/ContactCard.d.ts +7 -0
  14. package/dist/types/src/components/ContactCard.d.ts.map +1 -0
  15. package/dist/types/src/components/OrganizationCard.d.ts +5 -0
  16. package/dist/types/src/components/OrganizationCard.d.ts.map +1 -0
  17. package/dist/types/src/components/ProjectCard.d.ts +5 -0
  18. package/dist/types/src/components/ProjectCard.d.ts.map +1 -0
  19. package/dist/types/src/components/index.d.ts +4 -0
  20. package/dist/types/src/components/index.d.ts.map +1 -0
  21. package/dist/types/src/index.d.ts +1 -0
  22. package/dist/types/src/index.d.ts.map +1 -1
  23. package/dist/types/src/translations.d.ts +9 -0
  24. package/dist/types/src/translations.d.ts.map +1 -0
  25. package/dist/types/src/types.d.ts +22 -0
  26. package/dist/types/src/types.d.ts.map +1 -0
  27. package/package.json +21 -10
  28. package/src/Preview.stories.tsx +139 -0
  29. package/src/PreviewPlugin.tsx +127 -9
  30. package/src/components/ContactCard.tsx +69 -0
  31. package/src/components/OrganizationCard.tsx +41 -0
  32. package/src/components/ProjectCard.tsx +20 -0
  33. package/src/components/index.ts +7 -0
  34. package/src/index.ts +2 -0
  35. package/src/translations.ts +15 -0
  36. package/src/types.ts +37 -0
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,21 +17,48 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
  var node_exports = {};
20
30
  __export(node_exports, {
21
31
  PREVIEW_PLUGIN: () => PREVIEW_PLUGIN,
22
32
  PreviewPlugin: () => PreviewPlugin,
23
- meta: () => meta
33
+ meta: () => meta,
34
+ previewCard: () => previewCard,
35
+ previewChrome: () => previewChrome,
36
+ previewProse: () => previewProse,
37
+ previewTitle: () => previewTitle
24
38
  });
25
39
  module.exports = __toCommonJS(node_exports);
40
+ var import_react = __toESM(require("react"));
26
41
  var import_app_framework = require("@dxos/app-framework");
27
42
  var import_async = require("@dxos/async");
28
43
  var import_client = require("@dxos/client");
29
44
  var import_echo = require("@dxos/client/echo");
45
+ var import_echo_schema = require("@dxos/echo-schema");
30
46
  var import_keys = require("@dxos/keys");
31
47
  var import_log = require("@dxos/log");
32
48
  var import_plugin_client = require("@dxos/plugin-client");
49
+ var import_react_ui = require("@dxos/react-ui");
50
+ var import_react_ui_form = require("@dxos/react-ui-form");
51
+ var import_react_ui_table = require("@dxos/react-ui-table");
52
+ var import_react_ui_theme = require("@dxos/react-ui-theme");
53
+ var import_schema = require("@dxos/schema");
54
+ var import_react2 = __toESM(require("react"));
55
+ var import_react_ui2 = require("@dxos/react-ui");
56
+ var import_react_ui_theme2 = require("@dxos/react-ui-theme");
57
+ var import_react3 = __toESM(require("react"));
58
+ var import_react_ui3 = require("@dxos/react-ui");
59
+ var import_react_ui_theme3 = require("@dxos/react-ui-theme");
60
+ var import_react4 = __toESM(require("react"));
61
+ var import_react_ui_theme4 = require("@dxos/react-ui-theme");
33
62
  var PREVIEW_PLUGIN = "dxos.org/plugin/preview";
34
63
  var meta = {
35
64
  id: PREVIEW_PLUGIN,
@@ -37,6 +66,125 @@ var meta = {
37
66
  icon: "ph--eye--regular",
38
67
  source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-preview"
39
68
  };
69
+ var previewCard = "popover-max-width rounded-lg overflow-hidden";
70
+ var previewTitle = "text-lg font-medium line-clamp-2";
71
+ var previewProse = "pli-3 mlb-3";
72
+ var previewChrome = "pli-1.5 mlb-1.5 [&_.dx-button]:pli-1.5 [&_.dx-button]:text-start [&_.dx-button]:is-full";
73
+ var ContactCard = ({ children, classNames, subject: { fullName, image, organization, emails }, onOrgClick }) => {
74
+ const organizationName = organization && typeof organization === "object" ? organization.target?.name : organization;
75
+ return /* @__PURE__ */ import_react2.default.createElement("div", {
76
+ role: "none",
77
+ className: (0, import_react_ui_theme2.mx)(previewCard, classNames)
78
+ }, /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.Avatar.Root, null, /* @__PURE__ */ import_react2.default.createElement("div", {
79
+ role: "group",
80
+ className: (0, import_react_ui_theme2.mx)(previewProse, "grid gap-3 grid-cols-[min-content_1fr]")
81
+ }, /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.Avatar.Content, {
82
+ imgSrc: image,
83
+ icon: "ph--user--regular",
84
+ size: 16,
85
+ hue: "neutral"
86
+ }), /* @__PURE__ */ import_react2.default.createElement("div", {
87
+ role: "none",
88
+ className: "bs-min self-center"
89
+ }, /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.Avatar.Label, {
90
+ asChild: true
91
+ }, /* @__PURE__ */ import_react2.default.createElement("h2", {
92
+ className: previewTitle
93
+ }, fullName))))), organizationName && /* @__PURE__ */ import_react2.default.createElement("div", {
94
+ role: "none",
95
+ className: previewChrome
96
+ }, typeof organization === "object" && onOrgClick ? /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.Button, {
97
+ variant: "ghost",
98
+ classNames: "gap-2 text-start",
99
+ onClick: () => onOrgClick(organization.target)
100
+ }, /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.Icon, {
101
+ icon: "ph--buildings--regular",
102
+ size: 5,
103
+ classNames: "text-subdued"
104
+ }), /* @__PURE__ */ import_react2.default.createElement("span", {
105
+ className: "min-is-0 flex-1 truncate"
106
+ }, organizationName), /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.Icon, {
107
+ icon: "ph--arrow-right--regular"
108
+ })) : /* @__PURE__ */ import_react2.default.createElement("p", {
109
+ className: "dx-button gap-2",
110
+ "data-variant": "ghost"
111
+ }, /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.Icon, {
112
+ icon: "ph--buildings--regular",
113
+ size: 5,
114
+ classNames: "text-subdued"
115
+ }), /* @__PURE__ */ import_react2.default.createElement("span", {
116
+ className: "min-is-0 flex-1 truncate"
117
+ }, organizationName))), /* @__PURE__ */ import_react2.default.createElement("dl", {
118
+ className: (0, import_react_ui_theme2.mx)(previewProse, "grid gap-2 grid-cols-[min-content_1fr] [&_dt]:text-subdued [&_dt]:pbs-0.5 [&_dd]:min-is-0")
119
+ }, emails?.length && emails.map(({ label, value }) => /* @__PURE__ */ import_react2.default.createElement(import_react2.Fragment, {
120
+ key: value
121
+ }, /* @__PURE__ */ import_react2.default.createElement("dt", null, /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.Icon, {
122
+ icon: "ph--at--regular",
123
+ size: 5
124
+ })), /* @__PURE__ */ import_react2.default.createElement("dd", {
125
+ key: value,
126
+ className: "break-words"
127
+ }, value)))), children);
128
+ };
129
+ var OrganizationCard = ({ children, classNames, subject: { name, image, description, website } }) => {
130
+ return /* @__PURE__ */ import_react3.default.createElement("div", {
131
+ role: "none",
132
+ className: (0, import_react_ui_theme3.mx)(previewCard, classNames)
133
+ }, image ? /* @__PURE__ */ import_react3.default.createElement("img", {
134
+ className: "aspect-video object-cover is-full bs-auto",
135
+ src: image,
136
+ alt: name
137
+ }) : /* @__PURE__ */ import_react3.default.createElement("div", {
138
+ role: "image",
139
+ className: "grid aspect-video place-items-center bg-groupSurface text-subdued"
140
+ }, /* @__PURE__ */ import_react3.default.createElement(import_react_ui3.Icon, {
141
+ icon: "ph--building-office--regular",
142
+ size: 10
143
+ })), /* @__PURE__ */ import_react3.default.createElement("h2", {
144
+ className: (0, import_react_ui_theme3.mx)(previewTitle, previewProse)
145
+ }, name), description && /* @__PURE__ */ import_react3.default.createElement("p", {
146
+ className: (0, import_react_ui_theme3.mx)(previewProse, "line-clamp-2")
147
+ }, description), website && /* @__PURE__ */ import_react3.default.createElement("div", {
148
+ role: "none",
149
+ className: previewChrome
150
+ }, /* @__PURE__ */ import_react3.default.createElement("a", {
151
+ className: "dx-button dx-focus-ring gap-2",
152
+ href: website,
153
+ target: "_blank",
154
+ rel: "noreferrer"
155
+ }, /* @__PURE__ */ import_react3.default.createElement(import_react_ui3.Icon, {
156
+ icon: "ph--link--regular",
157
+ size: 5,
158
+ classNames: "text-subdued"
159
+ }), /* @__PURE__ */ import_react3.default.createElement("span", {
160
+ className: "grow"
161
+ }, website), /* @__PURE__ */ import_react3.default.createElement(import_react_ui3.Icon, {
162
+ icon: "ph--arrow-square-out--regular"
163
+ }))), children);
164
+ };
165
+ var ProjectCard = ({ classNames, subject: { name, image, description } }) => {
166
+ return /* @__PURE__ */ import_react4.default.createElement("div", {
167
+ role: "none",
168
+ className: (0, import_react_ui_theme4.mx)(previewCard, classNames)
169
+ }, image && /* @__PURE__ */ import_react4.default.createElement("img", {
170
+ className: "is-full bs-auto",
171
+ src: image,
172
+ alt: name
173
+ }), /* @__PURE__ */ import_react4.default.createElement("h2", {
174
+ className: (0, import_react_ui_theme4.mx)(previewTitle, "pli-3 mlb-3")
175
+ }, name), description && /* @__PURE__ */ import_react4.default.createElement("p", {
176
+ className: "pli-3 line-clamp-2 mlb-3"
177
+ }, description));
178
+ };
179
+ var translations_default = [
180
+ {
181
+ "en-US": {
182
+ [PREVIEW_PLUGIN]: {
183
+ "unable to create preview message": "No preview"
184
+ }
185
+ }
186
+ }
187
+ ];
40
188
  var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-preview/src/PreviewPlugin.tsx";
41
189
  var customEventOptions = {
42
190
  capture: true,
@@ -55,7 +203,22 @@ var handlePreviewLookup = async (client, defaultSpace, { ref, label }) => {
55
203
  };
56
204
  var PreviewPlugin = () => (0, import_app_framework.definePlugin)(meta, [
57
205
  (0, import_app_framework.defineModule)({
58
- id: `${meta.id}/module/preview-popoevr`,
206
+ id: `${meta.id}/module/translations`,
207
+ activatesOn: import_app_framework.Events.SetupTranslations,
208
+ activate: () => (0, import_app_framework.contributes)(import_app_framework.Capabilities.Translations, translations_default)
209
+ }),
210
+ (0, import_app_framework.defineModule)({
211
+ id: `${meta.id}/module/schema`,
212
+ activatesOn: import_plugin_client.ClientEvents.SetupSchema,
213
+ activate: () => [
214
+ (0, import_app_framework.contributes)(import_plugin_client.ClientCapabilities.Schema, [
215
+ import_schema.Contact,
216
+ import_schema.Organization
217
+ ])
218
+ ]
219
+ }),
220
+ (0, import_app_framework.defineModule)({
221
+ id: `${meta.id}/module/preview-popover`,
59
222
  activatesOn: import_app_framework.Events.Startup,
60
223
  activate: (context) => {
61
224
  const handleDxRefTagActivate = async ({ ref, label, trigger }) => {
@@ -84,7 +247,7 @@ var PreviewPlugin = () => (0, import_app_framework.definePlugin)(meta, [
84
247
  if (!document.defaultView) {
85
248
  import_log.log.warn("No default view found", void 0, {
86
249
  F: __dxlog_file,
87
- L: 74,
250
+ L: 105,
88
251
  S: void 0,
89
252
  C: (f, a) => f(...a)
90
253
  });
@@ -93,12 +256,112 @@ var PreviewPlugin = () => (0, import_app_framework.definePlugin)(meta, [
93
256
  const cleanup = (0, import_async.addEventListener)(document.defaultView, "dx-ref-tag-activate", handleDxRefTagActivate, customEventOptions);
94
257
  return (0, import_app_framework.contributes)(import_app_framework.Capabilities.Null, null, () => cleanup());
95
258
  }
259
+ }),
260
+ (0, import_app_framework.defineModule)({
261
+ id: `${meta.id}/module/react-surface`,
262
+ activatesOn: import_app_framework.Events.SetupReactSurface,
263
+ activate: () => (
264
+ // TODO(wittjosiah): Factor out to lazy capabilities like other plugins.
265
+ (0, import_app_framework.contributes)(import_app_framework.Capabilities.ReactSurface, [
266
+ //
267
+ // Specific schema types.
268
+ //
269
+ (0, import_app_framework.createSurface)({
270
+ id: `${PREVIEW_PLUGIN}/schema-popover`,
271
+ role: "popover",
272
+ filter: (data) => (0, import_echo_schema.isInstanceOf)(import_schema.Contact, data.subject),
273
+ component: ({ data }) => {
274
+ const { dispatchPromise: dispatch } = (0, import_app_framework.useIntentDispatcher)();
275
+ const handleOrgClick = (0, import_react.useCallback)(async (org) => {
276
+ const space = (0, import_echo.getSpace)(org);
277
+ const tablesQuery = await space?.db.query(import_echo.Filter.schema(import_react_ui_table.TableType)).run();
278
+ const currentSpaceOrgTable = tablesQuery?.objects.find((table) => {
279
+ return table.view?.target?.query?.typename === import_schema.Organization.typename;
280
+ });
281
+ await dispatch((0, import_app_framework.createIntent)(import_app_framework.LayoutAction.UpdatePopover, {
282
+ part: "popover",
283
+ options: {
284
+ state: false,
285
+ anchorId: ""
286
+ }
287
+ }));
288
+ if (currentSpaceOrgTable) {
289
+ return dispatch((0, import_app_framework.createIntent)(import_app_framework.LayoutAction.Open, {
290
+ part: "main",
291
+ subject: [
292
+ (0, import_echo.fullyQualifiedId)(currentSpaceOrgTable)
293
+ ],
294
+ options: {
295
+ workspace: space?.id
296
+ }
297
+ }));
298
+ }
299
+ }, [
300
+ dispatch
301
+ ]);
302
+ return /* @__PURE__ */ import_react.default.createElement(ContactCard, {
303
+ subject: data.subject,
304
+ onOrgClick: handleOrgClick
305
+ }, /* @__PURE__ */ import_react.default.createElement(import_app_framework.Surface, {
306
+ role: "related",
307
+ data
308
+ }));
309
+ }
310
+ }),
311
+ (0, import_app_framework.createSurface)({
312
+ id: `${PREVIEW_PLUGIN}/schema-popover`,
313
+ role: "popover",
314
+ filter: (data) => (0, import_echo_schema.isInstanceOf)(import_schema.Organization, data.subject),
315
+ component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(OrganizationCard, {
316
+ subject: data.subject
317
+ }, /* @__PURE__ */ import_react.default.createElement(import_app_framework.Surface, {
318
+ role: "related",
319
+ data
320
+ }))
321
+ }),
322
+ (0, import_app_framework.createSurface)({
323
+ id: `${PREVIEW_PLUGIN}/schema-popover`,
324
+ role: "popover",
325
+ filter: (data) => (0, import_echo_schema.isInstanceOf)(import_schema.Project, data.subject),
326
+ component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(ProjectCard, {
327
+ subject: data.subject
328
+ })
329
+ }),
330
+ //
331
+ // Fallback for any object.
332
+ //
333
+ (0, import_app_framework.createSurface)({
334
+ id: `${PREVIEW_PLUGIN}/fallback-popover`,
335
+ role: "popover",
336
+ position: "fallback",
337
+ filter: (data) => (0, import_echo.isEchoObject)(data.subject),
338
+ component: ({ data }) => {
339
+ const schema = (0, import_echo.getSchema)(data.subject);
340
+ const { t } = (0, import_react_ui.useTranslation)(PREVIEW_PLUGIN);
341
+ if (!schema) {
342
+ return /* @__PURE__ */ import_react.default.createElement("p", {
343
+ className: import_react_ui_theme.descriptionMessage
344
+ }, t("unable to create preview message"));
345
+ }
346
+ return /* @__PURE__ */ import_react.default.createElement(import_react_ui_form.Form, {
347
+ schema,
348
+ values: data.subject,
349
+ readonly: true
350
+ });
351
+ }
352
+ })
353
+ ])
354
+ )
96
355
  })
97
356
  ]);
98
357
  // Annotate the CommonJS export names for ESM import in node:
99
358
  0 && (module.exports = {
100
359
  PREVIEW_PLUGIN,
101
360
  PreviewPlugin,
102
- meta
361
+ meta,
362
+ previewCard,
363
+ previewChrome,
364
+ previewProse,
365
+ previewTitle
103
366
  });
104
367
  //# sourceMappingURL=index.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/meta.ts", "../../../src/PreviewPlugin.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const PREVIEW_PLUGIN = 'dxos.org/plugin/preview';\n\nexport const meta: PluginMeta = {\n id: PREVIEW_PLUGIN,\n name: 'Preview',\n icon: 'ph--eye--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-preview',\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport {\n createIntent,\n Capabilities,\n contributes,\n Events,\n defineModule,\n definePlugin,\n LayoutAction,\n} from '@dxos/app-framework';\nimport { addEventListener } from '@dxos/async';\nimport { type Client } from '@dxos/client';\nimport { resolveRef } from '@dxos/client';\nimport { parseId, type Space } from '@dxos/client/echo';\nimport { DXN } from '@dxos/keys';\nimport { type DxRefTagActivate } from '@dxos/lit-ui';\nimport { log } from '@dxos/log';\nimport { ClientCapabilities } from '@dxos/plugin-client';\nimport { type PreviewLinkRef, type PreviewLinkTarget } from '@dxos/react-ui-editor';\n\nimport { meta } from './meta';\n\nconst customEventOptions = { capture: true, passive: false };\n\nconst handlePreviewLookup = async (\n client: Client,\n defaultSpace: Space,\n { ref, label }: PreviewLinkRef,\n): Promise<PreviewLinkTarget | null> => {\n const dxn = DXN.parse(ref);\n if (!dxn) {\n return null;\n }\n\n const object = await resolveRef(client, dxn, defaultSpace);\n return { label, object };\n};\n\nexport const PreviewPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/preview-popoevr`,\n activatesOn: Events.Startup,\n activate: (context) => {\n // TODO(wittjosiah): Factor out lookup handlers to other plugins to make not ECHO-specific.\n const handleDxRefTagActivate = async ({ ref, label, trigger }: DxRefTagActivate) => {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n const client = context.requestCapability(ClientCapabilities.Client);\n const [layout] = context.requestCapabilities(Capabilities.Layout);\n const { spaceId } = parseId(layout.workspace);\n const space = (spaceId && client.spaces.get(spaceId)) ?? client.spaces.default;\n const result = await handlePreviewLookup(client, space, { ref, label });\n if (!result) {\n return;\n }\n\n await dispatch(\n createIntent(LayoutAction.UpdatePopover, {\n part: 'popover',\n subject: result.object,\n options: {\n state: true,\n variant: 'virtual',\n anchor: trigger,\n },\n }),\n );\n };\n\n if (!document.defaultView) {\n log.warn('No default view found');\n return [];\n }\n\n const cleanup = addEventListener(\n document.defaultView,\n 'dx-ref-tag-activate',\n handleDxRefTagActivate,\n customEventOptions,\n );\n return contributes(Capabilities.Null, null, () => cleanup());\n },\n }),\n ]);\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;ACIA,2BAQO;AACP,mBAAiC;AAEjC,oBAA2B;AAC3B,kBAAoC;AACpC,kBAAoB;AAEpB,iBAAoB;AACpB,2BAAmC;ADd5B,IAAMA,iBAAiB;AAEvB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;EACNC,MAAM;EACNC,QAAQ;AACV;;ACYA,IAAMC,qBAAqB;EAAEC,SAAS;EAAMC,SAAS;AAAM;AAE3D,IAAMC,sBAAsB,OAC1BC,QACAC,cACA,EAAEC,KAAKC,MAAK,MAAkB;AAE9B,QAAMC,MAAMC,gBAAIC,MAAMJ,GAAAA;AACtB,MAAI,CAACE,KAAK;AACR,WAAO;EACT;AAEA,QAAMG,SAAS,UAAMC,0BAAWR,QAAQI,KAAKH,YAAAA;AAC7C,SAAO;IAAEE;IAAOI;EAAO;AACzB;AAEO,IAAME,gBAAgB,UAC3BC,mCAAanB,MAAM;MACjBoB,mCAAa;IACXnB,IAAI,GAAGD,KAAKC,EAAE;IACdoB,aAAaC,4BAAOC;IACpBC,UAAU,CAACC,YAAAA;AAET,YAAMC,yBAAyB,OAAO,EAAEf,KAAKC,OAAOe,QAAO,MAAoB;AAC7E,cAAM,EAAEC,iBAAiBC,SAAQ,IAAKJ,QAAQK,kBAAkBC,kCAAaC,gBAAgB;AAC7F,cAAMvB,SAASgB,QAAQK,kBAAkBG,wCAAmBC,MAAM;AAClE,cAAM,CAACC,MAAAA,IAAUV,QAAQW,oBAAoBL,kCAAaM,MAAM;AAChE,cAAM,EAAEC,QAAO,QAAKC,qBAAQJ,OAAOK,SAAS;AAC5C,cAAMC,SAASH,WAAW7B,OAAOiC,OAAOC,IAAIL,OAAAA,MAAa7B,OAAOiC,OAAOE;AACvE,cAAMC,SAAS,MAAMrC,oBAAoBC,QAAQgC,OAAO;UAAE9B;UAAKC;QAAM,CAAA;AACrE,YAAI,CAACiC,QAAQ;AACX;QACF;AAEA,cAAMhB,aACJiB,mCAAaC,kCAAaC,eAAe;UACvCC,MAAM;UACNC,SAASL,OAAO7B;UAChBmC,SAAS;YACPC,OAAO;YACPC,SAAS;YACTC,QAAQ3B;UACV;QACF,CAAA,CAAA;MAEJ;AAEA,UAAI,CAAC4B,SAASC,aAAa;AACzBC,uBAAIC,KAAK,yBAAA,QAAA;;;;;;AACT,eAAO,CAAA;MACT;AAEA,YAAMC,cAAUC,+BACdL,SAASC,aACT,uBACA9B,wBACArB,kBAAAA;AAEF,iBAAOwD,kCAAY9B,kCAAa+B,MAAM,MAAM,MAAMH,QAAAA,CAAAA;IACpD;EACF,CAAA;CACD;",
6
- "names": ["PREVIEW_PLUGIN", "meta", "id", "name", "icon", "source", "customEventOptions", "capture", "passive", "handlePreviewLookup", "client", "defaultSpace", "ref", "label", "dxn", "DXN", "parse", "object", "resolveRef", "PreviewPlugin", "definePlugin", "defineModule", "activatesOn", "Events", "Startup", "activate", "context", "handleDxRefTagActivate", "trigger", "dispatchPromise", "dispatch", "requestCapability", "Capabilities", "IntentDispatcher", "ClientCapabilities", "Client", "layout", "requestCapabilities", "Layout", "spaceId", "parseId", "workspace", "space", "spaces", "get", "default", "result", "createIntent", "LayoutAction", "UpdatePopover", "part", "subject", "options", "state", "variant", "anchor", "document", "defaultView", "log", "warn", "cleanup", "addEventListener", "contributes", "Null"]
3
+ "sources": ["../../../src/meta.ts", "../../../src/types.ts", "../../../src/PreviewPlugin.tsx", "../../../src/components/ContactCard.tsx", "../../../src/components/OrganizationCard.tsx", "../../../src/components/ProjectCard.tsx", "../../../src/translations.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const PREVIEW_PLUGIN = 'dxos.org/plugin/preview';\n\nexport const meta: PluginMeta = {\n id: PREVIEW_PLUGIN,\n name: 'Preview',\n icon: 'ph--eye--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-preview',\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type PropsWithChildren } from 'react';\n\nimport { type ThemedClassName } from '@dxos/react-ui';\n\n// TODO(burdon): Better place for these defs?\nexport type PreviewProps<T extends object> = PropsWithChildren<\n ThemedClassName<{\n subject: T;\n }>\n>;\n\n// TODO(burdon): Update react-ui-card (to use grid) and re-use here.\n// - See https://dxos-storybook.pages.dev/?path=/story/ui-react-ui-card-card--draggable\n// - Standardize Header, actions, image, body, etc.\n// - Support different grid layouts (e.g., image to the side, on top, etc.)\n// - Should co-exist naturally with react-ui-form (e.g., as main content).\n// - Considerations for drag-and-drop.\n/**\n * <Card.Root>\n * <Card.Header>\n * <Card.Title>\n * <Card.Action>\n * </Card.Header>\n * <Card.Body>\n * <Card.Image>\n * <Form />\n * </Card.Body>\n * </Card.Root>\n */\nexport const previewCard = 'popover-max-width rounded-lg overflow-hidden';\nexport const previewTitle = 'text-lg font-medium line-clamp-2';\nexport const previewProse = 'pli-3 mlb-3';\nexport const previewChrome = 'pli-1.5 mlb-1.5 [&_.dx-button]:pli-1.5 [&_.dx-button]:text-start [&_.dx-button]:is-full';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport {\n Capabilities,\n Events,\n LayoutAction,\n Surface,\n contributes,\n createIntent,\n createSurface,\n defineModule,\n definePlugin,\n useIntentDispatcher,\n} from '@dxos/app-framework';\nimport { addEventListener } from '@dxos/async';\nimport { type Client, resolveRef } from '@dxos/client';\nimport {\n Filter,\n fullyQualifiedId,\n getSchema,\n getSpace,\n isEchoObject,\n parseId,\n type ReactiveEchoObject,\n type Space,\n} from '@dxos/client/echo';\nimport { isInstanceOf } from '@dxos/echo-schema';\nimport { DXN } from '@dxos/keys';\nimport { type DxRefTagActivate } from '@dxos/lit-ui';\nimport { log } from '@dxos/log';\nimport { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';\nimport { useTranslation } from '@dxos/react-ui';\nimport { type PreviewLinkRef, type PreviewLinkTarget } from '@dxos/react-ui-editor';\nimport { Form } from '@dxos/react-ui-form';\nimport { TableType } from '@dxos/react-ui-table';\nimport { descriptionMessage } from '@dxos/react-ui-theme';\nimport { Contact, Organization, Project } from '@dxos/schema';\n\nimport { ContactCard, OrganizationCard, ProjectCard } from './components';\nimport { meta, PREVIEW_PLUGIN } from './meta';\nimport translations from './translations';\n\nconst customEventOptions = { capture: true, passive: false };\n\nconst handlePreviewLookup = async (\n client: Client,\n defaultSpace: Space,\n { ref, label }: PreviewLinkRef,\n): Promise<PreviewLinkTarget | null> => {\n const dxn = DXN.parse(ref);\n if (!dxn) {\n return null;\n }\n\n const object = await resolveRef(client, dxn, defaultSpace);\n return { label, object };\n};\n\nexport const PreviewPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () => [contributes(ClientCapabilities.Schema, [Contact, Organization])],\n }),\n defineModule({\n id: `${meta.id}/module/preview-popover`,\n activatesOn: Events.Startup,\n activate: (context) => {\n // TODO(wittjosiah): Factor out lookup handlers to other plugins to make not ECHO-specific.\n const handleDxRefTagActivate = async ({ ref, label, trigger }: DxRefTagActivate) => {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n const client = context.requestCapability(ClientCapabilities.Client);\n const [layout] = context.requestCapabilities(Capabilities.Layout);\n const { spaceId } = parseId(layout.workspace);\n const space = (spaceId && client.spaces.get(spaceId)) ?? client.spaces.default;\n const result = await handlePreviewLookup(client, space, { ref, label });\n if (!result) {\n return;\n }\n\n await dispatch(\n createIntent(LayoutAction.UpdatePopover, {\n part: 'popover',\n subject: result.object,\n options: {\n state: true,\n variant: 'virtual',\n anchor: trigger,\n },\n }),\n );\n };\n\n if (!document.defaultView) {\n log.warn('No default view found');\n return [];\n }\n\n const cleanup = addEventListener(\n document.defaultView,\n 'dx-ref-tag-activate',\n handleDxRefTagActivate,\n customEventOptions,\n );\n return contributes(Capabilities.Null, null, () => cleanup());\n },\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: () =>\n // TODO(wittjosiah): Factor out to lazy capabilities like other plugins.\n contributes(Capabilities.ReactSurface, [\n //\n // Specific schema types.\n //\n createSurface({\n id: `${PREVIEW_PLUGIN}/schema-popover`,\n role: 'popover',\n filter: (data): data is { subject: Contact } => isInstanceOf(Contact, data.subject),\n component: ({ data }) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const handleOrgClick = useCallback(\n async (org: Organization) => {\n const space = getSpace(org);\n const tablesQuery = await space?.db.query(Filter.schema(TableType)).run();\n const currentSpaceOrgTable = tablesQuery?.objects.find((table) => {\n return table.view?.target?.query?.typename === Organization.typename;\n });\n await dispatch(\n createIntent(LayoutAction.UpdatePopover, {\n part: 'popover',\n options: {\n state: false,\n anchorId: '',\n },\n }),\n );\n if (currentSpaceOrgTable) {\n return dispatch(\n createIntent(LayoutAction.Open, {\n part: 'main',\n subject: [fullyQualifiedId(currentSpaceOrgTable)],\n options: { workspace: space?.id },\n }),\n );\n }\n },\n [dispatch],\n );\n return (\n <ContactCard subject={data.subject} onOrgClick={handleOrgClick}>\n <Surface role='related' data={data} />\n </ContactCard>\n );\n },\n }),\n createSurface({\n id: `${PREVIEW_PLUGIN}/schema-popover`,\n role: 'popover',\n filter: (data): data is { subject: Organization } => isInstanceOf(Organization, data.subject),\n component: ({ data }) => (\n <OrganizationCard subject={data.subject}>\n <Surface role='related' data={data} />\n </OrganizationCard>\n ),\n }),\n createSurface({\n id: `${PREVIEW_PLUGIN}/schema-popover`,\n role: 'popover',\n filter: (data): data is { subject: Project } => isInstanceOf(Project, data.subject),\n component: ({ data }) => <ProjectCard subject={data.subject} />,\n }),\n\n //\n // Fallback for any object.\n //\n createSurface({\n id: `${PREVIEW_PLUGIN}/fallback-popover`,\n role: 'popover',\n position: 'fallback',\n filter: (data): data is { subject: ReactiveEchoObject<any> } => isEchoObject(data.subject),\n component: ({ data }) => {\n const schema = getSchema(data.subject);\n const { t } = useTranslation(PREVIEW_PLUGIN);\n if (!schema) {\n return <p className={descriptionMessage}>{t('unable to create preview message')}</p>;\n }\n\n return <Form schema={schema} values={data.subject} readonly />;\n },\n }),\n ]),\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { Fragment } from 'react';\n\nimport { Icon, Avatar, Button } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-ui-theme';\nimport { type Contact, type Organization } from '@dxos/schema';\n\nimport { type PreviewProps, previewCard, previewTitle, previewProse, previewChrome } from '../types';\n\nexport const ContactCard = ({\n children,\n classNames,\n subject: { fullName, image, organization, emails },\n onOrgClick,\n}: PreviewProps<Contact> & { onOrgClick?: (org: Organization) => void }) => {\n const organizationName = organization && typeof organization === 'object' ? organization.target?.name : organization;\n return (\n <div role='none' className={mx(previewCard, classNames)}>\n <Avatar.Root>\n <div role='group' className={mx(previewProse, 'grid gap-3 grid-cols-[min-content_1fr]')}>\n <Avatar.Content imgSrc={image} icon='ph--user--regular' size={16} hue='neutral' />\n <div role='none' className='bs-min self-center'>\n <Avatar.Label asChild>\n <h2 className={previewTitle}>{fullName}</h2>\n </Avatar.Label>\n </div>\n </div>\n </Avatar.Root>\n {organizationName && (\n <div role='none' className={previewChrome}>\n {typeof organization === 'object' && onOrgClick ? (\n <Button variant='ghost' classNames='gap-2 text-start' onClick={() => onOrgClick(organization.target!)}>\n <Icon icon='ph--buildings--regular' size={5} classNames='text-subdued' />\n <span className='min-is-0 flex-1 truncate'>{organizationName}</span>\n <Icon icon='ph--arrow-right--regular' />\n </Button>\n ) : (\n <p className='dx-button gap-2' data-variant='ghost'>\n <Icon icon='ph--buildings--regular' size={5} classNames='text-subdued' />\n <span className='min-is-0 flex-1 truncate'>{organizationName}</span>\n </p>\n )}\n </div>\n )}\n <dl\n className={mx(\n previewProse,\n 'grid gap-2 grid-cols-[min-content_1fr] [&_dt]:text-subdued [&_dt]:pbs-0.5 [&_dd]:min-is-0',\n )}\n >\n {emails?.length &&\n emails.map(({ label, value }) => (\n <Fragment key={value}>\n <dt>\n <Icon icon='ph--at--regular' size={5} />\n </dt>\n <dd key={value} className='break-words'>\n {value}\n </dd>\n </Fragment>\n ))}\n </dl>\n {children}\n </div>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Icon } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-ui-theme';\nimport { type Organization } from '@dxos/schema';\n\nimport { type PreviewProps, previewCard, previewTitle, previewProse, previewChrome } from '../types';\n\nexport const OrganizationCard = ({\n children,\n classNames,\n subject: { name, image, description, website },\n}: PreviewProps<Organization>) => {\n return (\n <div role='none' className={mx(previewCard, classNames)}>\n {image ? (\n <img className='aspect-video object-cover is-full bs-auto' src={image} alt={name} />\n ) : (\n <div role='image' className='grid aspect-video place-items-center bg-groupSurface text-subdued'>\n <Icon icon='ph--building-office--regular' size={10} />\n </div>\n )}\n <h2 className={mx(previewTitle, previewProse)}>{name}</h2>\n {description && <p className={mx(previewProse, 'line-clamp-2')}>{description}</p>}\n {website && (\n <div role='none' className={previewChrome}>\n <a className='dx-button dx-focus-ring gap-2' href={website} target='_blank' rel='noreferrer'>\n <Icon icon='ph--link--regular' size={5} classNames='text-subdued' />\n <span className='grow'>{website}</span>\n <Icon icon='ph--arrow-square-out--regular' />\n </a>\n </div>\n )}\n {children}\n </div>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { mx } from '@dxos/react-ui-theme';\nimport { type Project } from '@dxos/schema';\n\nimport { type PreviewProps, previewCard, previewTitle } from '../types';\n\nexport const ProjectCard = ({ classNames, subject: { name, image, description } }: PreviewProps<Project>) => {\n return (\n <div role='none' className={mx(previewCard, classNames)}>\n {image && <img className='is-full bs-auto' src={image} alt={name} />}\n <h2 className={mx(previewTitle, 'pli-3 mlb-3')}>{name}</h2>\n {description && <p className='pli-3 line-clamp-2 mlb-3'>{description}</p>}\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { PREVIEW_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [PREVIEW_PLUGIN]: {\n 'unable to create preview message': 'No preview',\n },\n },\n },\n];\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEIA,mBAAmC;AAEnC,2BAWO;AACP,mBAAiC;AACjC,oBAAwC;AACxC,kBASO;AACP,yBAA6B;AAC7B,kBAAoB;AAEpB,iBAAoB;AACpB,2BAAiD;AACjD,sBAA+B;AAE/B,2BAAqB;AACrB,4BAA0B;AAC1B,4BAAmC;AACnC,oBAA+C;ACpC/C,IAAAA,gBAAgC;AAEhC,IAAAC,m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AqBF,EAAE,kCAAA,CAAA;YAC9C;AAEA,mBAAOxI,6BAAAA,QAAA,cAAC2I,2BAAAA;cAAKpB;cAAgBqB,QAAQjC,KAAKnH;cAASqJ,UAAAA;;UACrD;QACF,CAAA;OACD;;EACL,CAAA;CACD;",
6
+ "names": ["import_react", "import_react_ui", "import_react_ui_theme", "PREVIEW_PLUGIN", "meta", "id", "name", "icon", "source", "previewCard", "previewTitle", "previewProse", "previewChrome", "ContactCard", "children", "classNames", "subject", "fullName", "image", "organization", "emails", "onOrgClick", "organizationName", "target", "React", "div", "role", "className", "mx", "Avatar", "Root", "Content", "imgSrc", "size", "hue", "Label", "asChild", "h2", "Button", "variant", "onClick", "Icon", "span", "p", "data-variant", "dl", "length", "map", "label", "value", "Fragment", "key", "dt", "dd", "OrganizationCard", "description", "website", "img", "src", "alt", "a", "href", "rel", "ProjectCard", "customEventOptions", "capture", "passive", "handlePreviewLookup", "client", "defaultSpace", "ref", "dxn", "DXN", "parse", "object", "resolveRef", "PreviewPlugin", "definePlugin", "defineModule", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "ClientEvents", "SetupSchema", "ClientCapabilities", "Schema", "Contact", "Organization", "Startup", "context", "handleDxRefTagActivate", "trigger", "dispatchPromise", "dispatch", "requestCapability", "IntentDispatcher", "Client", "layout", "requestCapabilities", "Layout", "spaceId", "parseId", "workspace", "space", "spaces", "get", "default", "result", "createIntent", "LayoutAction", "UpdatePopover", "part", "options", "state", "anchor", "document", "defaultView", "log", "warn", "cleanup", "addEventListener", "Null", "SetupReactSurface", "ReactSurface", "createSurface", "filter", "data", "isInstanceOf", "component", "useIntentDispatcher", "handleOrgClick", "useCallback", "org", "getSpace", "tablesQuery", "db", "query", "Filter", "schema", "TableType", "run", "currentSpaceOrgTable", "objects", "find", "table", "view", "typename", "anchorId", "Open", "fullyQualifiedId", "Surface", "Project", "position", "isEchoObject", "getSchema", "t", "useTranslation", "descriptionMessage", "Form", "values", "readonly"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"packages/plugins/plugin-preview/src/meta.ts":{"bytes":1296,"imports":[],"format":"esm"},"packages/plugins/plugin-preview/src/PreviewPlugin.tsx":{"bytes":10087,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","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":"packages/plugins/plugin-preview/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-preview/src/index.ts":{"bytes":596,"imports":[{"path":"packages/plugins/plugin-preview/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-preview/src/PreviewPlugin.tsx","kind":"import-statement","original":"./PreviewPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-preview/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5715},"packages/plugins/plugin-preview/dist/lib/node/index.cjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","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}],"exports":["PREVIEW_PLUGIN","PreviewPlugin","meta"],"entryPoint":"packages/plugins/plugin-preview/src/index.ts","inputs":{"packages/plugins/plugin-preview/src/meta.ts":{"bytesInOutput":216},"packages/plugins/plugin-preview/src/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-preview/src/PreviewPlugin.tsx":{"bytesInOutput":2307}},"bytes":2717}}}
1
+ {"inputs":{"packages/plugins/plugin-preview/src/meta.ts":{"bytes":1296,"imports":[],"format":"esm"},"packages/plugins/plugin-preview/src/types.ts":{"bytes":3274,"imports":[],"format":"esm"},"packages/plugins/plugin-preview/src/components/ContactCard.tsx":{"bytes":9227,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-preview/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-preview/src/components/OrganizationCard.tsx":{"bytes":5532,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-preview/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-preview/src/components/ProjectCard.tsx":{"bytes":2743,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-preview/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-preview/src/components/index.ts":{"bytes":732,"imports":[{"path":"packages/plugins/plugin-preview/src/components/ContactCard.tsx","kind":"import-statement","original":"./ContactCard"},{"path":"packages/plugins/plugin-preview/src/components/OrganizationCard.tsx","kind":"import-statement","original":"./OrganizationCard"},{"path":"packages/plugins/plugin-preview/src/components/ProjectCard.tsx","kind":"import-statement","original":"./ProjectCard"}],"format":"esm"},"packages/plugins/plugin-preview/src/translations.ts":{"bytes":1091,"imports":[{"path":"packages/plugins/plugin-preview/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-preview/src/PreviewPlugin.tsx":{"bytes":27057,"imports":[{"path":"react","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","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","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},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"@dxos/react-ui-table","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-preview/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-preview/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-preview/src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/plugins/plugin-preview/src/index.ts":{"bytes":681,"imports":[{"path":"packages/plugins/plugin-preview/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-preview/src/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/plugin-preview/src/PreviewPlugin.tsx","kind":"import-statement","original":"./PreviewPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-preview/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":24136},"packages/plugins/plugin-preview/dist/lib/node/index.cjs":{"imports":[{"path":"react","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","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","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},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"@dxos/react-ui-table","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/schema","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-theme","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-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["PREVIEW_PLUGIN","PreviewPlugin","meta","previewCard","previewChrome","previewProse","previewTitle"],"entryPoint":"packages/plugins/plugin-preview/src/index.ts","inputs":{"packages/plugins/plugin-preview/src/meta.ts":{"bytesInOutput":216},"packages/plugins/plugin-preview/src/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-preview/src/types.ts":{"bytesInOutput":266},"packages/plugins/plugin-preview/src/PreviewPlugin.tsx":{"bytesInOutput":6691},"packages/plugins/plugin-preview/src/components/ContactCard.tsx":{"bytesInOutput":2668},"packages/plugins/plugin-preview/src/components/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-preview/src/components/OrganizationCard.tsx":{"bytesInOutput":1584},"packages/plugins/plugin-preview/src/components/ProjectCard.tsx":{"bytesInOutput":633},"packages/plugins/plugin-preview/src/translations.ts":{"bytesInOutput":152}},"bytes":12837}}}