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

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 (37) hide show
  1. package/dist/lib/browser/index.mjs +292 -9
  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 +294 -7
  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 +292 -9
  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 +141 -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/dist/types/tsconfig.tsbuildinfo +1 -1
  28. package/package.json +23 -10
  29. package/src/Preview.stories.tsx +145 -0
  30. package/src/PreviewPlugin.tsx +139 -12
  31. package/src/components/ContactCard.tsx +70 -0
  32. package/src/components/OrganizationCard.tsx +42 -0
  33. package/src/components/ProjectCard.tsx +24 -0
  34. package/src/components/index.ts +7 -0
  35. package/src/index.ts +2 -0
  36. package/src/translations.ts +15 -0
  37. package/src/types.ts +40 -0
@@ -9,14 +9,162 @@ var meta = {
9
9
  source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-preview"
10
10
  };
11
11
 
12
+ // packages/plugins/plugin-preview/src/types.ts
13
+ var popoverCard = "popover-consistent-width rounded-lg overflow-hidden";
14
+ var defaultCard = "";
15
+ var kanbanCardWithoutPoster = "pbs-[--rail-action]";
16
+ var previewTitle = "text-lg font-medium line-clamp-2";
17
+ var previewProse = "pli-3 mlb-3";
18
+ var previewChrome = "pli-1.5 mlb-1.5 [&_.dx-button]:pli-1.5 [&_.dx-button]:text-start [&_.dx-button]:is-full";
19
+
12
20
  // packages/plugins/plugin-preview/src/PreviewPlugin.tsx
13
- import { createIntent, Capabilities, contributes, Events, defineModule, definePlugin, LayoutAction } from "@dxos/app-framework";
21
+ import React4, { useCallback } from "react";
22
+ import { Capabilities, Events, LayoutAction, Surface, contributes, createIntent, createSurface, defineModule, definePlugin, useIntentDispatcher } from "@dxos/app-framework";
14
23
  import { addEventListener } from "@dxos/async";
15
24
  import { resolveRef } from "@dxos/client";
16
- import { parseId } from "@dxos/client/echo";
25
+ import { Filter, fullyQualifiedId, getSchema, getSpace, isEchoObject, parseId } from "@dxos/client/echo";
26
+ import { isInstanceOf } from "@dxos/echo-schema";
17
27
  import { DXN } from "@dxos/keys";
18
28
  import { log } from "@dxos/log";
19
- import { ClientCapabilities } from "@dxos/plugin-client";
29
+ import { ClientCapabilities, ClientEvents } from "@dxos/plugin-client";
30
+ import { useTranslation } from "@dxos/react-ui";
31
+ import { Form } from "@dxos/react-ui-form";
32
+ import { TableType } from "@dxos/react-ui-table";
33
+ import { descriptionMessage } from "@dxos/react-ui-theme";
34
+ import { DataType } from "@dxos/schema";
35
+
36
+ // packages/plugins/plugin-preview/src/components/ContactCard.tsx
37
+ import React, { Fragment } from "react";
38
+ import { Icon, Avatar, Button } from "@dxos/react-ui";
39
+ import { mx } from "@dxos/react-ui-theme";
40
+ var ContactCard = ({ children, classNames, role, subject: { fullName, image, organization, emails }, onOrgClick }) => {
41
+ const organizationName = organization && typeof organization === "object" ? organization.target?.name : organization;
42
+ return /* @__PURE__ */ React.createElement("div", {
43
+ role: "none",
44
+ className: mx(role === "popover" ? popoverCard : defaultCard, classNames)
45
+ }, /* @__PURE__ */ React.createElement(Avatar.Root, null, /* @__PURE__ */ React.createElement("div", {
46
+ role: "group",
47
+ className: mx(previewProse, "grid gap-3 grid-cols-[min-content_1fr]")
48
+ }, /* @__PURE__ */ React.createElement(Avatar.Content, {
49
+ imgSrc: image,
50
+ icon: "ph--user--regular",
51
+ size: 16,
52
+ hue: "neutral"
53
+ }), /* @__PURE__ */ React.createElement("div", {
54
+ role: "none",
55
+ className: "bs-min self-center"
56
+ }, /* @__PURE__ */ React.createElement(Avatar.Label, {
57
+ asChild: true
58
+ }, /* @__PURE__ */ React.createElement("h2", {
59
+ className: previewTitle
60
+ }, fullName))))), organizationName && /* @__PURE__ */ React.createElement("div", {
61
+ role: "none",
62
+ className: previewChrome
63
+ }, typeof organization === "object" && onOrgClick ? /* @__PURE__ */ React.createElement(Button, {
64
+ variant: "ghost",
65
+ classNames: "gap-2 text-start",
66
+ onClick: () => onOrgClick(organization.target)
67
+ }, /* @__PURE__ */ React.createElement(Icon, {
68
+ icon: "ph--buildings--regular",
69
+ size: 5,
70
+ classNames: "text-subdued"
71
+ }), /* @__PURE__ */ React.createElement("span", {
72
+ className: "min-is-0 flex-1 truncate"
73
+ }, organizationName), /* @__PURE__ */ React.createElement(Icon, {
74
+ icon: "ph--arrow-right--regular"
75
+ })) : /* @__PURE__ */ React.createElement("p", {
76
+ className: "dx-button gap-2",
77
+ "data-variant": "ghost"
78
+ }, /* @__PURE__ */ React.createElement(Icon, {
79
+ icon: "ph--buildings--regular",
80
+ size: 5,
81
+ classNames: "text-subdued"
82
+ }), /* @__PURE__ */ React.createElement("span", {
83
+ className: "min-is-0 flex-1 truncate"
84
+ }, organizationName))), /* @__PURE__ */ React.createElement("dl", {
85
+ className: mx(previewProse, "grid gap-2 grid-cols-[min-content_1fr] [&_dt]:text-subdued [&_dt]:pbs-0.5 [&_dd]:min-is-0")
86
+ }, emails?.length && emails.map(({ label, value }) => /* @__PURE__ */ React.createElement(Fragment, {
87
+ key: value
88
+ }, /* @__PURE__ */ React.createElement("dt", null, /* @__PURE__ */ React.createElement(Icon, {
89
+ icon: "ph--at--regular",
90
+ size: 5
91
+ })), /* @__PURE__ */ React.createElement("dd", {
92
+ key: value,
93
+ className: "break-words"
94
+ }, value)))), children);
95
+ };
96
+
97
+ // packages/plugins/plugin-preview/src/components/OrganizationCard.tsx
98
+ import React2 from "react";
99
+ import { Icon as Icon2 } from "@dxos/react-ui";
100
+ import { mx as mx2 } from "@dxos/react-ui-theme";
101
+ var OrganizationCard = ({ children, classNames, subject: { name, image, description, website }, role }) => {
102
+ return /* @__PURE__ */ React2.createElement("div", {
103
+ role: "none",
104
+ className: mx2(role === "popover" ? popoverCard : defaultCard, classNames)
105
+ }, image ? /* @__PURE__ */ React2.createElement("img", {
106
+ className: "aspect-video object-cover is-full bs-auto",
107
+ src: image,
108
+ alt: name
109
+ }) : /* @__PURE__ */ React2.createElement("div", {
110
+ role: "image",
111
+ className: "grid aspect-video place-items-center bg-input text-subdued"
112
+ }, /* @__PURE__ */ React2.createElement(Icon2, {
113
+ icon: "ph--building-office--regular",
114
+ size: 10
115
+ })), /* @__PURE__ */ React2.createElement("h2", {
116
+ className: mx2(previewTitle, previewProse)
117
+ }, name), description && /* @__PURE__ */ React2.createElement("p", {
118
+ className: mx2(previewProse, "line-clamp-2")
119
+ }, description), website && /* @__PURE__ */ React2.createElement("div", {
120
+ role: "none",
121
+ className: previewChrome
122
+ }, /* @__PURE__ */ React2.createElement("a", {
123
+ className: "dx-button dx-focus-ring gap-2",
124
+ href: website,
125
+ target: "_blank",
126
+ rel: "noreferrer"
127
+ }, /* @__PURE__ */ React2.createElement(Icon2, {
128
+ icon: "ph--link--regular",
129
+ size: 5,
130
+ classNames: "text-subdued"
131
+ }), /* @__PURE__ */ React2.createElement("span", {
132
+ className: "grow"
133
+ }, website), /* @__PURE__ */ React2.createElement(Icon2, {
134
+ icon: "ph--arrow-square-out--regular"
135
+ }))), children);
136
+ };
137
+
138
+ // packages/plugins/plugin-preview/src/components/ProjectCard.tsx
139
+ import React3 from "react";
140
+ import { mx as mx3 } from "@dxos/react-ui-theme";
141
+ var ProjectCard = ({ classNames, role, subject: { name, image, description } }) => {
142
+ return /* @__PURE__ */ React3.createElement("div", {
143
+ role: "none",
144
+ className: mx3(role === "popover" ? popoverCard : defaultCard, classNames)
145
+ }, image && /* @__PURE__ */ React3.createElement("img", {
146
+ className: "is-full bs-auto",
147
+ src: image,
148
+ alt: name
149
+ }), /* @__PURE__ */ React3.createElement("h2", {
150
+ className: mx3(previewTitle, "pli-3 mlb-3")
151
+ }, name), description && /* @__PURE__ */ React3.createElement("p", {
152
+ className: "pli-3 line-clamp-2 mlb-3"
153
+ }, description));
154
+ };
155
+
156
+ // packages/plugins/plugin-preview/src/translations.ts
157
+ var translations_default = [
158
+ {
159
+ "en-US": {
160
+ [PREVIEW_PLUGIN]: {
161
+ "unable to create preview message": "No preview"
162
+ }
163
+ }
164
+ }
165
+ ];
166
+
167
+ // packages/plugins/plugin-preview/src/PreviewPlugin.tsx
20
168
  var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-preview/src/PreviewPlugin.tsx";
21
169
  var customEventOptions = {
22
170
  capture: true,
@@ -35,13 +183,28 @@ var handlePreviewLookup = async (client, defaultSpace, { ref, label }) => {
35
183
  };
36
184
  var PreviewPlugin = () => definePlugin(meta, [
37
185
  defineModule({
38
- id: `${meta.id}/module/preview-popoevr`,
186
+ id: `${meta.id}/module/translations`,
187
+ activatesOn: Events.SetupTranslations,
188
+ activate: () => contributes(Capabilities.Translations, translations_default)
189
+ }),
190
+ defineModule({
191
+ id: `${meta.id}/module/schema`,
192
+ activatesOn: ClientEvents.SetupSchema,
193
+ activate: () => [
194
+ contributes(ClientCapabilities.Schema, [
195
+ DataType.Person,
196
+ DataType.Organization
197
+ ])
198
+ ]
199
+ }),
200
+ defineModule({
201
+ id: `${meta.id}/module/preview-popover`,
39
202
  activatesOn: Events.Startup,
40
203
  activate: (context) => {
41
204
  const handleDxRefTagActivate = async ({ ref, label, trigger }) => {
42
- const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
43
- const client = context.requestCapability(ClientCapabilities.Client);
44
- const [layout] = context.requestCapabilities(Capabilities.Layout);
205
+ const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
206
+ const client = context.getCapability(ClientCapabilities.Client);
207
+ const [layout] = context.getCapabilities(Capabilities.Layout);
45
208
  const { spaceId } = parseId(layout.workspace);
46
209
  const space = (spaceId && client.spaces.get(spaceId)) ?? client.spaces.default;
47
210
  const result = await handlePreviewLookup(client, space, {
@@ -64,7 +227,7 @@ var PreviewPlugin = () => definePlugin(meta, [
64
227
  if (!document.defaultView) {
65
228
  log.warn("No default view found", void 0, {
66
229
  F: __dxlog_file,
67
- L: 74,
230
+ L: 106,
68
231
  S: void 0,
69
232
  C: (f, a) => f(...a)
70
233
  });
@@ -73,11 +236,131 @@ var PreviewPlugin = () => definePlugin(meta, [
73
236
  const cleanup = addEventListener(document.defaultView, "dx-ref-tag-activate", handleDxRefTagActivate, customEventOptions);
74
237
  return contributes(Capabilities.Null, null, () => cleanup());
75
238
  }
239
+ }),
240
+ defineModule({
241
+ id: `${meta.id}/module/react-surface`,
242
+ activatesOn: Events.SetupReactSurface,
243
+ activate: () => (
244
+ // TODO(wittjosiah): Factor out to lazy capabilities like other plugins.
245
+ contributes(Capabilities.ReactSurface, [
246
+ //
247
+ // Specific schema types.
248
+ //
249
+ createSurface({
250
+ id: `${PREVIEW_PLUGIN}/schema-popover`,
251
+ role: [
252
+ "popover",
253
+ "card--kanban"
254
+ ],
255
+ filter: (data) => isInstanceOf(DataType.Person, data.subject),
256
+ component: ({ data, role }) => {
257
+ const { dispatchPromise: dispatch } = useIntentDispatcher();
258
+ const handleOrgClick = useCallback(async (org) => {
259
+ const space = getSpace(org);
260
+ const tablesQuery = await space?.db.query(Filter.type(TableType)).run();
261
+ const currentSpaceOrgTable = tablesQuery?.objects.find((table) => {
262
+ return table.view?.target?.query?.typename === DataType.Organization.typename;
263
+ });
264
+ await dispatch(createIntent(LayoutAction.UpdatePopover, {
265
+ part: "popover",
266
+ options: {
267
+ state: false,
268
+ anchorId: ""
269
+ }
270
+ }));
271
+ if (currentSpaceOrgTable) {
272
+ return dispatch(createIntent(LayoutAction.Open, {
273
+ part: "main",
274
+ subject: [
275
+ fullyQualifiedId(currentSpaceOrgTable)
276
+ ],
277
+ options: {
278
+ workspace: space?.id
279
+ }
280
+ }));
281
+ }
282
+ }, [
283
+ dispatch
284
+ ]);
285
+ return /* @__PURE__ */ React4.createElement(ContactCard, {
286
+ subject: data.subject,
287
+ onOrgClick: handleOrgClick,
288
+ role
289
+ }, role === "popover" && /* @__PURE__ */ React4.createElement(Surface, {
290
+ role: "related",
291
+ data
292
+ }));
293
+ }
294
+ }),
295
+ createSurface({
296
+ id: `${PREVIEW_PLUGIN}/schema-popover`,
297
+ role: [
298
+ "popover",
299
+ "card--kanban"
300
+ ],
301
+ filter: (data) => isInstanceOf(DataType.Organization, data.subject),
302
+ component: ({ data, role }) => /* @__PURE__ */ React4.createElement(OrganizationCard, {
303
+ subject: data.subject,
304
+ role
305
+ }, role === "popover" && /* @__PURE__ */ React4.createElement(Surface, {
306
+ role: "related",
307
+ data
308
+ }))
309
+ }),
310
+ createSurface({
311
+ id: `${PREVIEW_PLUGIN}/schema-popover`,
312
+ role: [
313
+ "popover",
314
+ "card--kanban"
315
+ ],
316
+ filter: (data) => isInstanceOf(DataType.Project, data.subject),
317
+ component: ({ data, role }) => /* @__PURE__ */ React4.createElement(ProjectCard, {
318
+ subject: data.subject,
319
+ role
320
+ })
321
+ }),
322
+ //
323
+ // Fallback for any object.
324
+ //
325
+ createSurface({
326
+ id: `${PREVIEW_PLUGIN}/fallback-popover`,
327
+ role: [
328
+ "popover",
329
+ "card--kanban"
330
+ ],
331
+ position: "fallback",
332
+ filter: (data) => isEchoObject(data.subject),
333
+ component: ({ data, role }) => {
334
+ const schema = getSchema(data.subject);
335
+ const { t } = useTranslation(PREVIEW_PLUGIN);
336
+ if (!schema) {
337
+ return /* @__PURE__ */ React4.createElement("p", {
338
+ className: descriptionMessage
339
+ }, t("unable to create preview message"));
340
+ }
341
+ return /* @__PURE__ */ React4.createElement(Form, {
342
+ schema,
343
+ values: data.subject,
344
+ readonly: role === "popover",
345
+ ...role === "card--kanban" && {
346
+ classNames: kanbanCardWithoutPoster
347
+ }
348
+ });
349
+ }
350
+ })
351
+ ])
352
+ )
76
353
  })
77
354
  ]);
78
355
  export {
79
356
  PREVIEW_PLUGIN,
80
357
  PreviewPlugin,
81
- meta
358
+ defaultCard,
359
+ kanbanCardWithoutPoster,
360
+ meta,
361
+ popoverCard,
362
+ previewChrome,
363
+ previewProse,
364
+ previewTitle
82
365
  };
83
366
  //# sourceMappingURL=index.mjs.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": ";;;AAMO,IAAMA,iBAAiB;AAEvB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,M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AAO/B;UAChBqC,SAAS;YACPC,OAAO;YACPC,SAAS;YACTC,QAAQ3B;UACV;QACF,CAAA,CAAA;MAEJ;AAEA,UAAI,CAAC4B,SAASC,aAAa;AACzBC,YAAIC,KAAK,yBAAA,QAAA;;;;;;AACT,eAAO,CAAA;MACT;AAEA,YAAMC,UAAUC,iBACdL,SAASC,aACT,uBACA9B,wBACAvB,kBAAAA;AAEF,aAAO0D,YAAY9B,aAAa+B,MAAM,MAAM,MAAMH,QAAAA,CAAAA;IACpD;EACF,CAAA;CACD;",
6
- "names": ["PREVIEW_PLUGIN", "meta", "id", "name", "icon", "source", "createIntent", "Capabilities", "contributes", "Events", "defineModule", "definePlugin", "LayoutAction", "addEventListener", "resolveRef", "parseId", "DXN", "log", "ClientCapabilities", "customEventOptions", "capture", "passive", "handlePreviewLookup", "client", "defaultSpace", "ref", "label", "dxn", "DXN", "parse", "object", "resolveRef", "PreviewPlugin", "definePlugin", "meta", "defineModule", "id", "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 AnyLiveObject,\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 { DataType } 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, [DataType.Person, DataType.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.getCapability(Capabilities.IntentDispatcher);\n const client = context.getCapability(ClientCapabilities.Client);\n const [layout] = context.getCapabilities(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: DataType.Person } => isInstanceOf(DataType.Person, data.subject),\n component: ({ data, role }) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const handleOrgClick = useCallback(\n async (org: DataType.Organization) => {\n const space = getSpace(org);\n const tablesQuery = await space?.db.query(Filter.type(TableType)).run();\n const currentSpaceOrgTable = tablesQuery?.objects.find((table) => {\n return table.view?.target?.query?.typename === DataType.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: DataType.Organization } =>\n isInstanceOf(DataType.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: DataType.Project } => isInstanceOf(DataType.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: AnyLiveObject<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={role === 'popover'}\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 DataType } 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<DataType.Person> & { onOrgClick?: (org: DataType.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 DataType } 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<DataType.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 DataType } from '@dxos/schema';\n\nimport { type PreviewProps, popoverCard, previewTitle, defaultCard } from '../types';\n\nexport const ProjectCard = ({\n classNames,\n role,\n subject: { name, image, description },\n}: PreviewProps<DataType.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": ";;;AAMO,IAAMA,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;;;ACnC7B,OAAOC,UAASC,mBAAmB;AAEnC,SACEC,cACAC,QACAC,cACAC,SACAC,aACAC,cACAC,eACAC,cACAC,cACAC,2BACK;AACP,SAASC,wBAAwB;AACjC,SAAsBC,kBAAkB;AACxC,SACEC,QACAC,kBACAC,WACAC,UACAC,cACAC,eAGK;AACP,SAASC,oBAAoB;AAC7B,SAASC,WAAW;AAEpB,SAASC,WAAW;AACpB,SAASC,oBAAoBC,oBAAoB;AACjD,SAASC,sBAAsB;AAE/B,SAASC,Y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A;OACD;;EACL,CAAA;CACD;",
6
+ "names": ["PREVIEW_PLUGIN", "meta", "id", "name", "icon", "source", "popoverCard", "defaultCard", "kanbanCardWithoutPoster", "previewTitle", "previewProse", "previewChrome", "React", "useCallback", "Capabilities", "Events", "LayoutAction", "Surface", "contributes", "createIntent", "createSurface", "defineModule", "definePlugin", "useIntentDispatcher", "addEventListener", "resolveRef", "Filter", "fullyQualifiedId", "getSchema", "getSpace", "isEchoObject", "parseId", "isInstanceOf", "DXN", "log", "ClientCapabilities", "ClientEvents", "useTranslation", "Form", "TableType", "descriptionMessage", "DataType", "React", "Fragment", "Icon", "Avatar", "Button", "mx", "ContactCard", "children", "classNames", "role", "subject", "fullName", "image", "organization", "emails", "onOrgClick", "organizationName", "target", "name", "div", "className", "mx", "popoverCard", "defaultCard", "Avatar", "Root", "previewProse", "Content", "imgSrc", "icon", "size", "hue", "Label", "asChild", "h2", "previewTitle", "previewChrome", "Button", "variant", "onClick", "Icon", "span", "p", "data-variant", "dl", "length", "map", "label", "value", "Fragment", "key", "dt", "dd", "React", "Icon", "mx", "OrganizationCard", "children", "classNames", "subject", "name", "image", "description", "website", "role", "React", "div", "className", "mx", "popoverCard", "defaultCard", "img", "src", "alt", "Icon", "icon", "size", "h2", "previewTitle", "previewProse", "p", "previewChrome", "a", "href", "target", "rel", "span", "React", "mx", "ProjectCard", "classNames", "role", "subject", "name", "image", "description", "React", "div", "className", "mx", "popoverCard", "defaultCard", "img", "src", "alt", "h2", "previewTitle", "p", "PREVIEW_PLUGIN", "customEventOptions", "capture", "passive", "handlePreviewLookup", "client", "defaultSpace", "ref", "label", "dxn", "DXN", "parse", "object", "resolveRef", "PreviewPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "ClientEvents", "SetupSchema", "ClientCapabilities", "Schema", "DataType", "Person", "Organization", "Startup", "context", "handleDxRefTagActivate", "trigger", "dispatchPromise", "dispatch", "getCapability", "IntentDispatcher", "Client", "layout", "getCapabilities", "Layout", "spaceId", "parseId", "workspace", "space", "spaces", "get", "default", "result", "createIntent", "LayoutAction", "UpdatePopover", "part", "subject", "options", "state", "variant", "anchor", "document", "defaultView", "log", "warn", "cleanup", "addEventListener", "Null", "SetupReactSurface", "ReactSurface", "createSurface", "PREVIEW_PLUGIN", "role", "filter", "data", "isInstanceOf", "component", "useIntentDispatcher", "handleOrgClick", "useCallback", "org", "getSpace", "tablesQuery", "db", "query", "Filter", "type", "TableType", "run", "currentSpaceOrgTable", "objects", "find", "table", "view", "target", "typename", "anchorId", "Open", "fullyQualifiedId", "React", "ContactCard", "onOrgClick", "Surface", "OrganizationCard", "Project", "ProjectCard", "position", "isEchoObject", "schema", "getSchema", "t", "useTranslation", "p", "className", "descriptionMessage", "Form", "values", "readonly", "classNames", "kanbanCardWithoutPoster"]
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-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5717},"packages/plugins/plugin-preview/dist/lib/node-esm/index.mjs":{"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":2810}}}
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":5727,"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":2969,"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":29117,"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-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":25368},"packages/plugins/plugin-preview/dist/lib/node-esm/index.mjs":{"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":7176},"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":13655}}}
@@ -0,0 +1,141 @@
1
+ import '@dxos-theme';
2
+ import { type Meta } from '@storybook/react';
3
+ import React, { type FC } from 'react';
4
+ import { DataType } from '@dxos/schema';
5
+ type StoryProps = {
6
+ Component: FC<{
7
+ subject: any;
8
+ }>;
9
+ icon: string;
10
+ subject: any;
11
+ };
12
+ declare const meta: Meta<StoryProps>;
13
+ export default meta;
14
+ export declare const ContactWithImage: {
15
+ args: {
16
+ Component: ({ children, classNames, role, subject: { fullName, image, organization, emails }, onOrgClick, }: import("./types").PreviewProps<DataType.Person> & {
17
+ onOrgClick?: (org: DataType.Organization) => void;
18
+ }) => React.JSX.Element;
19
+ icon: string;
20
+ subject: Omit<{
21
+ readonly id: string;
22
+ fullName?: string | undefined;
23
+ preferredName?: string | undefined;
24
+ nickname?: string | undefined;
25
+ image?: string | undefined;
26
+ organization?: import("@dxos/echo-schema").Ref<{
27
+ readonly id: string;
28
+ description?: string | undefined;
29
+ name?: string | undefined;
30
+ status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
31
+ image?: string | undefined;
32
+ website?: string | undefined;
33
+ }> | undefined;
34
+ jobTitle?: string | undefined;
35
+ department?: string | undefined;
36
+ notes?: string | undefined;
37
+ emails?: {
38
+ readonly label?: string | undefined;
39
+ readonly value: string;
40
+ }[] | undefined;
41
+ identities?: {
42
+ readonly label?: string | undefined;
43
+ readonly value: string;
44
+ }[] | undefined;
45
+ phoneNumbers?: {
46
+ readonly label?: string | undefined;
47
+ readonly value: string;
48
+ }[] | undefined;
49
+ addresses?: {
50
+ readonly label?: string | undefined;
51
+ readonly value: {
52
+ readonly street?: string | undefined;
53
+ readonly extended?: string | undefined;
54
+ readonly locality?: string | undefined;
55
+ readonly region?: string | undefined;
56
+ readonly postalCode?: string | undefined;
57
+ readonly postOfficeBoxNumber?: string | undefined;
58
+ readonly country?: string | undefined;
59
+ };
60
+ }[] | undefined;
61
+ urls?: {
62
+ readonly label?: string | undefined;
63
+ readonly value: string;
64
+ }[] | undefined;
65
+ birthday?: string | undefined;
66
+ fields?: {
67
+ readonly label: string;
68
+ readonly value: string;
69
+ readonly category?: string | undefined;
70
+ }[] | undefined;
71
+ }, "id"> & {
72
+ id?: string;
73
+ } & {
74
+ id: string;
75
+ };
76
+ role: string;
77
+ };
78
+ };
79
+ export declare const ContactNoImage: {
80
+ args: {
81
+ Component: ({ children, classNames, role, subject: { fullName, image, organization, emails }, onOrgClick, }: import("./types").PreviewProps<DataType.Person> & {
82
+ onOrgClick?: (org: DataType.Organization) => void;
83
+ }) => React.JSX.Element;
84
+ icon: string;
85
+ subject: any;
86
+ role: string;
87
+ };
88
+ };
89
+ export declare const OrganizationWithImage: {
90
+ args: {
91
+ Component: ({ children, classNames, subject: { name, image, description, website }, role, }: import("./types").PreviewProps<DataType.Organization>) => React.JSX.Element;
92
+ icon: string;
93
+ subject: Omit<{
94
+ readonly id: string;
95
+ image?: string | undefined;
96
+ status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
97
+ name?: string | undefined;
98
+ description?: string | undefined;
99
+ website?: string | undefined;
100
+ }, "id"> & {
101
+ id?: string;
102
+ } & {
103
+ id: string;
104
+ };
105
+ role: string;
106
+ };
107
+ };
108
+ export declare const OrganizationNoImage: {
109
+ args: {
110
+ Component: ({ children, classNames, subject: { name, image, description, website }, role, }: import("./types").PreviewProps<DataType.Organization>) => React.JSX.Element;
111
+ icon: string;
112
+ subject: any;
113
+ role: string;
114
+ };
115
+ };
116
+ export declare const ProjectWithImage: {
117
+ args: {
118
+ Component: ({ classNames, role, subject: { name, image, description }, }: import("./types").PreviewProps<DataType.Project>) => React.JSX.Element;
119
+ icon: string;
120
+ subject: Omit<{
121
+ readonly id: string;
122
+ image?: string | undefined;
123
+ name: string;
124
+ description?: string | undefined;
125
+ }, "id"> & {
126
+ id?: string;
127
+ } & {
128
+ id: string;
129
+ };
130
+ role: string;
131
+ };
132
+ };
133
+ export declare const ProjectNoImage: {
134
+ args: {
135
+ Component: ({ classNames, role, subject: { name, image, description }, }: import("./types").PreviewProps<DataType.Project>) => React.JSX.Element;
136
+ icon: string;
137
+ subject: any;
138
+ role: string;
139
+ };
140
+ };
141
+ //# sourceMappingURL=Preview.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Preview.stories.d.ts","sourceRoot":"","sources":["../../../src/Preview.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAMvC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAQxC,KAAK,UAAU,GAAG;IAChB,SAAS,EAAE,EAAE,CAAC;QAAE,OAAO,EAAE,GAAG,CAAA;KAAE,CAAC,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,GAAG,CAAC;CACd,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAAU,CAoB1B,CAAC;AAEF,eAAe,IAAI,CAAC;AA2CpB,eAAO,MAAM,gBAAgB;;;sBA3ElB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkFX,CAAC;AAEF,eAAO,MAAM,cAAc;;;sBApFhB,CAAC;;;;;;CA2FX,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;CAOjC,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;CAO/B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;CAO5B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;CAO1B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"PreviewPlugin.d.ts","sourceRoot":"","sources":["../../../src/PreviewPlugin.tsx"],"names":[],"mappings":"AAyCA,eAAO,MAAM,aAAa,4CA6CtB,CAAC"}
1
+ {"version":3,"file":"PreviewPlugin.d.ts","sourceRoot":"","sources":["../../../src/PreviewPlugin.tsx"],"names":[],"mappings":"AA+DA,eAAO,MAAM,aAAa,4CAsJtB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { type DataType } from '@dxos/schema';
3
+ import { type PreviewProps } from '../types';
4
+ export declare const ContactCard: ({ children, classNames, role, subject: { fullName, image, organization, emails }, onOrgClick, }: PreviewProps<DataType.Person> & {
5
+ onOrgClick?: (org: DataType.Organization) => void;
6
+ }) => React.JSX.Element;
7
+ //# sourceMappingURL=ContactCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContactCard.d.ts","sourceRoot":"","sources":["../../../../src/components/ContactCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,KAAK,YAAY,EAAuE,MAAM,UAAU,CAAC;AAElH,eAAO,MAAM,WAAW,GAAI,iGAMzB,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG;IAAE,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,CAAC,YAAY,KAAK,IAAI,CAAA;CAAE,sBAmDvF,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { type DataType } from '@dxos/schema';
3
+ import { type PreviewProps } from '../types';
4
+ export declare const OrganizationCard: ({ children, classNames, subject: { name, image, description, website }, role, }: PreviewProps<DataType.Organization>) => React.JSX.Element;
5
+ //# sourceMappingURL=OrganizationCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrganizationCard.d.ts","sourceRoot":"","sources":["../../../../src/components/OrganizationCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,KAAK,YAAY,EAAuE,MAAM,UAAU,CAAC;AAElH,eAAO,MAAM,gBAAgB,GAAI,iFAK9B,YAAY,CAAC,QAAQ,CAAC,YAAY,CAAC,sBAwBrC,CAAC"}