@dxos/plugin-preview 0.8.2-main.f081794 → 0.8.2-main.f11618f

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 +289 -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 +291 -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 +289 -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 +25 -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 +135 -9
  30. package/src/components/ContactCard.tsx +70 -0
  31. package/src/components/OrganizationCard.tsx +42 -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 +40 -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,50 @@ 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
+ defaultCard: () => defaultCard,
34
+ kanbanCardWithoutPoster: () => kanbanCardWithoutPoster,
35
+ meta: () => meta,
36
+ popoverCard: () => popoverCard,
37
+ previewChrome: () => previewChrome,
38
+ previewProse: () => previewProse,
39
+ previewTitle: () => previewTitle
24
40
  });
25
41
  module.exports = __toCommonJS(node_exports);
42
+ var import_react = __toESM(require("react"));
26
43
  var import_app_framework = require("@dxos/app-framework");
27
44
  var import_async = require("@dxos/async");
28
45
  var import_client = require("@dxos/client");
29
46
  var import_echo = require("@dxos/client/echo");
47
+ var import_echo_schema = require("@dxos/echo-schema");
30
48
  var import_keys = require("@dxos/keys");
31
49
  var import_log = require("@dxos/log");
32
50
  var import_plugin_client = require("@dxos/plugin-client");
51
+ var import_react_ui = require("@dxos/react-ui");
52
+ var import_react_ui_form = require("@dxos/react-ui-form");
53
+ var import_react_ui_table = require("@dxos/react-ui-table");
54
+ var import_react_ui_theme = require("@dxos/react-ui-theme");
55
+ var import_schema = require("@dxos/schema");
56
+ var import_react2 = __toESM(require("react"));
57
+ var import_react_ui2 = require("@dxos/react-ui");
58
+ var import_react_ui_theme2 = require("@dxos/react-ui-theme");
59
+ var import_react3 = __toESM(require("react"));
60
+ var import_react_ui3 = require("@dxos/react-ui");
61
+ var import_react_ui_theme3 = require("@dxos/react-ui-theme");
62
+ var import_react4 = __toESM(require("react"));
63
+ var import_react_ui_theme4 = require("@dxos/react-ui-theme");
33
64
  var PREVIEW_PLUGIN = "dxos.org/plugin/preview";
34
65
  var meta = {
35
66
  id: PREVIEW_PLUGIN,
@@ -37,6 +68,127 @@ var meta = {
37
68
  icon: "ph--eye--regular",
38
69
  source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-preview"
39
70
  };
71
+ var popoverCard = "popover-consistent-width rounded-lg overflow-hidden";
72
+ var defaultCard = "";
73
+ var kanbanCardWithoutPoster = "pbs-[--rail-action]";
74
+ var previewTitle = "text-lg font-medium line-clamp-2";
75
+ var previewProse = "pli-3 mlb-3";
76
+ var previewChrome = "pli-1.5 mlb-1.5 [&_.dx-button]:pli-1.5 [&_.dx-button]:text-start [&_.dx-button]:is-full";
77
+ var ContactCard = ({ children, classNames, role, subject: { fullName, image, organization, emails }, onOrgClick }) => {
78
+ const organizationName = organization && typeof organization === "object" ? organization.target?.name : organization;
79
+ return /* @__PURE__ */ import_react2.default.createElement("div", {
80
+ role: "none",
81
+ className: (0, import_react_ui_theme2.mx)(role === "popover" ? popoverCard : defaultCard, classNames)
82
+ }, /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.Avatar.Root, null, /* @__PURE__ */ import_react2.default.createElement("div", {
83
+ role: "group",
84
+ className: (0, import_react_ui_theme2.mx)(previewProse, "grid gap-3 grid-cols-[min-content_1fr]")
85
+ }, /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.Avatar.Content, {
86
+ imgSrc: image,
87
+ icon: "ph--user--regular",
88
+ size: 16,
89
+ hue: "neutral"
90
+ }), /* @__PURE__ */ import_react2.default.createElement("div", {
91
+ role: "none",
92
+ className: "bs-min self-center"
93
+ }, /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.Avatar.Label, {
94
+ asChild: true
95
+ }, /* @__PURE__ */ import_react2.default.createElement("h2", {
96
+ className: previewTitle
97
+ }, fullName))))), organizationName && /* @__PURE__ */ import_react2.default.createElement("div", {
98
+ role: "none",
99
+ className: previewChrome
100
+ }, typeof organization === "object" && onOrgClick ? /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.Button, {
101
+ variant: "ghost",
102
+ classNames: "gap-2 text-start",
103
+ onClick: () => onOrgClick(organization.target)
104
+ }, /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.Icon, {
105
+ icon: "ph--buildings--regular",
106
+ size: 5,
107
+ classNames: "text-subdued"
108
+ }), /* @__PURE__ */ import_react2.default.createElement("span", {
109
+ className: "min-is-0 flex-1 truncate"
110
+ }, organizationName), /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.Icon, {
111
+ icon: "ph--arrow-right--regular"
112
+ })) : /* @__PURE__ */ import_react2.default.createElement("p", {
113
+ className: "dx-button gap-2",
114
+ "data-variant": "ghost"
115
+ }, /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.Icon, {
116
+ icon: "ph--buildings--regular",
117
+ size: 5,
118
+ classNames: "text-subdued"
119
+ }), /* @__PURE__ */ import_react2.default.createElement("span", {
120
+ className: "min-is-0 flex-1 truncate"
121
+ }, organizationName))), /* @__PURE__ */ import_react2.default.createElement("dl", {
122
+ 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")
123
+ }, emails?.length && emails.map(({ label, value }) => /* @__PURE__ */ import_react2.default.createElement(import_react2.Fragment, {
124
+ key: value
125
+ }, /* @__PURE__ */ import_react2.default.createElement("dt", null, /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.Icon, {
126
+ icon: "ph--at--regular",
127
+ size: 5
128
+ })), /* @__PURE__ */ import_react2.default.createElement("dd", {
129
+ key: value,
130
+ className: "break-words"
131
+ }, value)))), children);
132
+ };
133
+ var OrganizationCard = ({ children, classNames, subject: { name, image, description, website }, role }) => {
134
+ return /* @__PURE__ */ import_react3.default.createElement("div", {
135
+ role: "none",
136
+ className: (0, import_react_ui_theme3.mx)(role === "popover" ? popoverCard : defaultCard, classNames)
137
+ }, image ? /* @__PURE__ */ import_react3.default.createElement("img", {
138
+ className: "aspect-video object-cover is-full bs-auto",
139
+ src: image,
140
+ alt: name
141
+ }) : /* @__PURE__ */ import_react3.default.createElement("div", {
142
+ role: "image",
143
+ className: "grid aspect-video place-items-center bg-input text-subdued"
144
+ }, /* @__PURE__ */ import_react3.default.createElement(import_react_ui3.Icon, {
145
+ icon: "ph--building-office--regular",
146
+ size: 10
147
+ })), /* @__PURE__ */ import_react3.default.createElement("h2", {
148
+ className: (0, import_react_ui_theme3.mx)(previewTitle, previewProse)
149
+ }, name), description && /* @__PURE__ */ import_react3.default.createElement("p", {
150
+ className: (0, import_react_ui_theme3.mx)(previewProse, "line-clamp-2")
151
+ }, description), website && /* @__PURE__ */ import_react3.default.createElement("div", {
152
+ role: "none",
153
+ className: previewChrome
154
+ }, /* @__PURE__ */ import_react3.default.createElement("a", {
155
+ className: "dx-button dx-focus-ring gap-2",
156
+ href: website,
157
+ target: "_blank",
158
+ rel: "noreferrer"
159
+ }, /* @__PURE__ */ import_react3.default.createElement(import_react_ui3.Icon, {
160
+ icon: "ph--link--regular",
161
+ size: 5,
162
+ classNames: "text-subdued"
163
+ }), /* @__PURE__ */ import_react3.default.createElement("span", {
164
+ className: "grow"
165
+ }, website), /* @__PURE__ */ import_react3.default.createElement(import_react_ui3.Icon, {
166
+ icon: "ph--arrow-square-out--regular"
167
+ }))), children);
168
+ };
169
+ var ProjectCard = ({ classNames, role, subject: { name, image, description } }) => {
170
+ return /* @__PURE__ */ import_react4.default.createElement("div", {
171
+ role: "none",
172
+ className: (0, import_react_ui_theme4.mx)(role === "popover" ? popoverCard : defaultCard, classNames)
173
+ }, image && /* @__PURE__ */ import_react4.default.createElement("img", {
174
+ className: "is-full bs-auto",
175
+ src: image,
176
+ alt: name
177
+ }), /* @__PURE__ */ import_react4.default.createElement("h2", {
178
+ className: (0, import_react_ui_theme4.mx)(previewTitle, "pli-3 mlb-3")
179
+ }, name), description && /* @__PURE__ */ import_react4.default.createElement("p", {
180
+ className: "pli-3 line-clamp-2 mlb-3"
181
+ }, description));
182
+ };
183
+ var translations_default = [
184
+ {
185
+ "en-US": {
186
+ [PREVIEW_PLUGIN]: {
187
+ "unable to create preview message": "No preview"
188
+ }
189
+ }
190
+ }
191
+ ];
40
192
  var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-preview/src/PreviewPlugin.tsx";
41
193
  var customEventOptions = {
42
194
  capture: true,
@@ -55,7 +207,22 @@ var handlePreviewLookup = async (client, defaultSpace, { ref, label }) => {
55
207
  };
56
208
  var PreviewPlugin = () => (0, import_app_framework.definePlugin)(meta, [
57
209
  (0, import_app_framework.defineModule)({
58
- id: `${meta.id}/module/preview-popoevr`,
210
+ id: `${meta.id}/module/translations`,
211
+ activatesOn: import_app_framework.Events.SetupTranslations,
212
+ activate: () => (0, import_app_framework.contributes)(import_app_framework.Capabilities.Translations, translations_default)
213
+ }),
214
+ (0, import_app_framework.defineModule)({
215
+ id: `${meta.id}/module/schema`,
216
+ activatesOn: import_plugin_client.ClientEvents.SetupSchema,
217
+ activate: () => [
218
+ (0, import_app_framework.contributes)(import_plugin_client.ClientCapabilities.Schema, [
219
+ import_schema.Contact,
220
+ import_schema.Organization
221
+ ])
222
+ ]
223
+ }),
224
+ (0, import_app_framework.defineModule)({
225
+ id: `${meta.id}/module/preview-popover`,
59
226
  activatesOn: import_app_framework.Events.Startup,
60
227
  activate: (context) => {
61
228
  const handleDxRefTagActivate = async ({ ref, label, trigger }) => {
@@ -84,7 +251,7 @@ var PreviewPlugin = () => (0, import_app_framework.definePlugin)(meta, [
84
251
  if (!document.defaultView) {
85
252
  import_log.log.warn("No default view found", void 0, {
86
253
  F: __dxlog_file,
87
- L: 74,
254
+ L: 106,
88
255
  S: void 0,
89
256
  C: (f, a) => f(...a)
90
257
  });
@@ -93,12 +260,132 @@ var PreviewPlugin = () => (0, import_app_framework.definePlugin)(meta, [
93
260
  const cleanup = (0, import_async.addEventListener)(document.defaultView, "dx-ref-tag-activate", handleDxRefTagActivate, customEventOptions);
94
261
  return (0, import_app_framework.contributes)(import_app_framework.Capabilities.Null, null, () => cleanup());
95
262
  }
263
+ }),
264
+ (0, import_app_framework.defineModule)({
265
+ id: `${meta.id}/module/react-surface`,
266
+ activatesOn: import_app_framework.Events.SetupReactSurface,
267
+ activate: () => (
268
+ // TODO(wittjosiah): Factor out to lazy capabilities like other plugins.
269
+ (0, import_app_framework.contributes)(import_app_framework.Capabilities.ReactSurface, [
270
+ //
271
+ // Specific schema types.
272
+ //
273
+ (0, import_app_framework.createSurface)({
274
+ id: `${PREVIEW_PLUGIN}/schema-popover`,
275
+ role: [
276
+ "popover",
277
+ "card--kanban"
278
+ ],
279
+ filter: (data) => (0, import_echo_schema.isInstanceOf)(import_schema.Contact, data.subject),
280
+ component: ({ data, role }) => {
281
+ const { dispatchPromise: dispatch } = (0, import_app_framework.useIntentDispatcher)();
282
+ const handleOrgClick = (0, import_react.useCallback)(async (org) => {
283
+ const space = (0, import_echo.getSpace)(org);
284
+ const tablesQuery = await space?.db.query(import_echo.Filter.schema(import_react_ui_table.TableType)).run();
285
+ const currentSpaceOrgTable = tablesQuery?.objects.find((table) => {
286
+ return table.view?.target?.query?.typename === import_schema.Organization.typename;
287
+ });
288
+ await dispatch((0, import_app_framework.createIntent)(import_app_framework.LayoutAction.UpdatePopover, {
289
+ part: "popover",
290
+ options: {
291
+ state: false,
292
+ anchorId: ""
293
+ }
294
+ }));
295
+ if (currentSpaceOrgTable) {
296
+ return dispatch((0, import_app_framework.createIntent)(import_app_framework.LayoutAction.Open, {
297
+ part: "main",
298
+ subject: [
299
+ (0, import_echo.fullyQualifiedId)(currentSpaceOrgTable)
300
+ ],
301
+ options: {
302
+ workspace: space?.id
303
+ }
304
+ }));
305
+ }
306
+ }, [
307
+ dispatch
308
+ ]);
309
+ return /* @__PURE__ */ import_react.default.createElement(ContactCard, {
310
+ subject: data.subject,
311
+ onOrgClick: handleOrgClick,
312
+ role
313
+ }, role === "popover" && /* @__PURE__ */ import_react.default.createElement(import_app_framework.Surface, {
314
+ role: "related",
315
+ data
316
+ }));
317
+ }
318
+ }),
319
+ (0, import_app_framework.createSurface)({
320
+ id: `${PREVIEW_PLUGIN}/schema-popover`,
321
+ role: [
322
+ "popover",
323
+ "card--kanban"
324
+ ],
325
+ filter: (data) => (0, import_echo_schema.isInstanceOf)(import_schema.Organization, data.subject),
326
+ component: ({ data, role }) => /* @__PURE__ */ import_react.default.createElement(OrganizationCard, {
327
+ subject: data.subject,
328
+ role
329
+ }, role === "popover" && /* @__PURE__ */ import_react.default.createElement(import_app_framework.Surface, {
330
+ role: "related",
331
+ data
332
+ }))
333
+ }),
334
+ (0, import_app_framework.createSurface)({
335
+ id: `${PREVIEW_PLUGIN}/schema-popover`,
336
+ role: [
337
+ "popover",
338
+ "card--kanban"
339
+ ],
340
+ filter: (data) => (0, import_echo_schema.isInstanceOf)(import_schema.Project, data.subject),
341
+ component: ({ data, role }) => /* @__PURE__ */ import_react.default.createElement(ProjectCard, {
342
+ subject: data.subject,
343
+ role
344
+ })
345
+ }),
346
+ //
347
+ // Fallback for any object.
348
+ //
349
+ (0, import_app_framework.createSurface)({
350
+ id: `${PREVIEW_PLUGIN}/fallback-popover`,
351
+ role: [
352
+ "popover",
353
+ "card--kanban"
354
+ ],
355
+ position: "fallback",
356
+ filter: (data) => (0, import_echo.isEchoObject)(data.subject),
357
+ component: ({ data, role }) => {
358
+ const schema = (0, import_echo.getSchema)(data.subject);
359
+ const { t } = (0, import_react_ui.useTranslation)(PREVIEW_PLUGIN);
360
+ if (!schema) {
361
+ return /* @__PURE__ */ import_react.default.createElement("p", {
362
+ className: import_react_ui_theme.descriptionMessage
363
+ }, t("unable to create preview message"));
364
+ }
365
+ return /* @__PURE__ */ import_react.default.createElement(import_react_ui_form.Form, {
366
+ schema,
367
+ values: data.subject,
368
+ readonly: true,
369
+ ...role === "card--kanban" && {
370
+ classNames: kanbanCardWithoutPoster
371
+ }
372
+ });
373
+ }
374
+ })
375
+ ])
376
+ )
96
377
  })
97
378
  ]);
98
379
  // Annotate the CommonJS export names for ESM import in node:
99
380
  0 && (module.exports = {
100
381
  PREVIEW_PLUGIN,
101
382
  PreviewPlugin,
102
- meta
383
+ defaultCard,
384
+ kanbanCardWithoutPoster,
385
+ meta,
386
+ popoverCard,
387
+ previewChrome,
388
+ previewProse,
389
+ previewTitle
103
390
  });
104
391
  //# 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;AAE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PC,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 role: string;\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 popoverCard = 'popover-consistent-width rounded-lg overflow-hidden';\nexport const defaultCard = '';\nexport const kanbanCardWithoutPoster = 'pbs-[--rail-action]';\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';\nimport { kanbanCardWithoutPoster } from './types';\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', 'card--kanban'],\n filter: (data): data is { subject: Contact } => isInstanceOf(Contact, data.subject),\n component: ({ data, role }) => {\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} role={role}>\n {role === 'popover' && <Surface role='related' data={data} />}\n </ContactCard>\n );\n },\n }),\n createSurface({\n id: `${PREVIEW_PLUGIN}/schema-popover`,\n role: ['popover', 'card--kanban'],\n filter: (data): data is { subject: Organization } => isInstanceOf(Organization, data.subject),\n component: ({ data, role }) => (\n <OrganizationCard subject={data.subject} role={role}>\n {role === 'popover' && <Surface role='related' data={data} />}\n </OrganizationCard>\n ),\n }),\n createSurface({\n id: `${PREVIEW_PLUGIN}/schema-popover`,\n role: ['popover', 'card--kanban'],\n filter: (data): data is { subject: Project } => isInstanceOf(Project, data.subject),\n component: ({ data, role }) => <ProjectCard subject={data.subject} role={role} />,\n }),\n\n //\n // Fallback for any object.\n //\n createSurface({\n id: `${PREVIEW_PLUGIN}/fallback-popover`,\n role: ['popover', 'card--kanban'],\n position: 'fallback',\n filter: (data): data is { subject: ReactiveEchoObject<any> } => isEchoObject(data.subject),\n component: ({ data, role }) => {\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 (\n <Form\n schema={schema}\n values={data.subject}\n readonly\n {...(role === 'card--kanban' && { classNames: kanbanCardWithoutPoster })}\n />\n );\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, popoverCard, previewTitle, previewProse, previewChrome, defaultCard } from '../types';\n\nexport const ContactCard = ({\n children,\n classNames,\n role,\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(role === 'popover' ? popoverCard : defaultCard, 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, popoverCard, previewTitle, previewProse, previewChrome, defaultCard } from '../types';\n\nexport const OrganizationCard = ({\n children,\n classNames,\n subject: { name, image, description, website },\n role,\n}: PreviewProps<Organization>) => {\n return (\n <div role='none' className={mx(role === 'popover' ? popoverCard : defaultCard, 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-input 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, popoverCard, previewTitle, defaultCard } from '../types';\n\nexport const ProjectCard = ({ classNames, role, subject: { name, image, description } }: PreviewProps<Project>) => {\n return (\n <div role='none' className={mx(role === 'popover' ? popoverCard : defaultCard, 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,mBAAqC;AACrC,IAAAC,yBAAmB;ACHnB,IAAAF,gBAAkB;AAElB,IAAAC,mBAAqB;AACrB,IAAAC,yBAAmB;ACHnB,IAAAF,gBAAkB;AAElB,IAAAE,yBAAmB;ALAZ,IAAMC,iBAAiB;AAEvB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;EACNC,MAAM;EACNC,QAAQ;AACV;ACqBO,IAAMC,cAAc;AACpB,IAAMC,cAAc;AACpB,IAAMC,0BAA0B;AAChC,IAAMC,eAAe;AACrB,IAAMC,eAAe;AACrB,IAAMC,gBAAgB;AE3BtB,IAAMC,cAAc,CAAC,EAC1BC,UACAC,YACAC,MACAC,SAAS,EAAEC,UAAUC,OAAOC,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5E;QACF,CAAA;OACD;;EACL,CAAA;CACD;",
6
+ "names": ["import_react", "import_react_ui", "import_react_ui_theme", "PREVIEW_PLUGIN", "meta", "id", "name", "icon", "source", "popoverCard", "defaultCard", "kanbanCardWithoutPoster", "previewTitle", "previewProse", "previewChrome", "ContactCard", "children", "classNames", "role", "subject", "fullName", "image", "organization", "emails", "onOrgClick", "organizationName", "target", "React", "div", "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":3670,"imports":[],"format":"esm"},"packages/plugins/plugin-preview/src/components/ContactCard.tsx":{"bytes":9429,"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":5719,"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":2941,"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":28903,"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"},{"path":"packages/plugins/plugin-preview/src/types.ts","kind":"import-statement","original":"./types"}],"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":25248},"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","defaultCard","kanbanCardWithoutPoster","meta","popoverCard","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":348},"packages/plugins/plugin-preview/src/PreviewPlugin.tsx":{"bytesInOutput":7146},"packages/plugins/plugin-preview/src/components/ContactCard.tsx":{"bytesInOutput":2709},"packages/plugins/plugin-preview/src/components/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-preview/src/components/OrganizationCard.tsx":{"bytesInOutput":1618},"packages/plugins/plugin-preview/src/components/ProjectCard.tsx":{"bytesInOutput":674},"packages/plugins/plugin-preview/src/translations.ts":{"bytesInOutput":152}},"bytes":13532}}}