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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/lib/browser/index.mjs +267 -6
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node/index.cjs +267 -4
  5. package/dist/lib/node/index.cjs.map +4 -4
  6. package/dist/lib/node/meta.json +1 -1
  7. package/dist/lib/node-esm/index.mjs +267 -6
  8. package/dist/lib/node-esm/index.mjs.map +4 -4
  9. package/dist/lib/node-esm/meta.json +1 -1
  10. package/dist/types/src/Preview.stories.d.ts +197 -0
  11. package/dist/types/src/Preview.stories.d.ts.map +1 -0
  12. package/dist/types/src/PreviewPlugin.d.ts.map +1 -1
  13. package/dist/types/src/components/ContactCard.d.ts +7 -0
  14. package/dist/types/src/components/ContactCard.d.ts.map +1 -0
  15. package/dist/types/src/components/OrganizationCard.d.ts +5 -0
  16. package/dist/types/src/components/OrganizationCard.d.ts.map +1 -0
  17. package/dist/types/src/components/ProjectCard.d.ts +5 -0
  18. package/dist/types/src/components/ProjectCard.d.ts.map +1 -0
  19. package/dist/types/src/components/index.d.ts +4 -0
  20. package/dist/types/src/components/index.d.ts.map +1 -0
  21. package/dist/types/src/index.d.ts +1 -0
  22. package/dist/types/src/index.d.ts.map +1 -1
  23. package/dist/types/src/translations.d.ts +9 -0
  24. package/dist/types/src/translations.d.ts.map +1 -0
  25. package/dist/types/src/types.d.ts +22 -0
  26. package/dist/types/src/types.d.ts.map +1 -0
  27. package/package.json +21 -10
  28. package/src/Preview.stories.tsx +139 -0
  29. package/src/PreviewPlugin.tsx +127 -9
  30. package/src/components/ContactCard.tsx +69 -0
  31. package/src/components/OrganizationCard.tsx +41 -0
  32. package/src/components/ProjectCard.tsx +20 -0
  33. package/src/components/index.ts +7 -0
  34. package/src/index.ts +2 -0
  35. package/src/translations.ts +15 -0
  36. package/src/types.ts +37 -0
@@ -9,14 +9,160 @@ 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 previewCard = "popover-max-width rounded-lg overflow-hidden";
14
+ var previewTitle = "text-lg font-medium line-clamp-2";
15
+ var previewProse = "pli-3 mlb-3";
16
+ var previewChrome = "pli-1.5 mlb-1.5 [&_.dx-button]:pli-1.5 [&_.dx-button]:text-start [&_.dx-button]:is-full";
17
+
12
18
  // packages/plugins/plugin-preview/src/PreviewPlugin.tsx
13
- import { createIntent, Capabilities, contributes, Events, defineModule, definePlugin, LayoutAction } from "@dxos/app-framework";
19
+ import React4, { useCallback } from "react";
20
+ import { Capabilities, Events, LayoutAction, Surface, contributes, createIntent, createSurface, defineModule, definePlugin, useIntentDispatcher } from "@dxos/app-framework";
14
21
  import { addEventListener } from "@dxos/async";
15
22
  import { resolveRef } from "@dxos/client";
16
- import { parseId } from "@dxos/client/echo";
23
+ import { Filter, fullyQualifiedId, getSchema, getSpace, isEchoObject, parseId } from "@dxos/client/echo";
24
+ import { isInstanceOf } from "@dxos/echo-schema";
17
25
  import { DXN } from "@dxos/keys";
18
26
  import { log } from "@dxos/log";
19
- import { ClientCapabilities } from "@dxos/plugin-client";
27
+ import { ClientCapabilities, ClientEvents } from "@dxos/plugin-client";
28
+ import { useTranslation } from "@dxos/react-ui";
29
+ import { Form } from "@dxos/react-ui-form";
30
+ import { TableType } from "@dxos/react-ui-table";
31
+ import { descriptionMessage } from "@dxos/react-ui-theme";
32
+ import { Contact, Organization, Project } from "@dxos/schema";
33
+
34
+ // packages/plugins/plugin-preview/src/components/ContactCard.tsx
35
+ import React, { Fragment } from "react";
36
+ import { Icon, Avatar, Button } from "@dxos/react-ui";
37
+ import { mx } from "@dxos/react-ui-theme";
38
+ var ContactCard = ({ children, classNames, subject: { fullName, image, organization, emails }, onOrgClick }) => {
39
+ const organizationName = organization && typeof organization === "object" ? organization.target?.name : organization;
40
+ return /* @__PURE__ */ React.createElement("div", {
41
+ role: "none",
42
+ className: mx(previewCard, classNames)
43
+ }, /* @__PURE__ */ React.createElement(Avatar.Root, null, /* @__PURE__ */ React.createElement("div", {
44
+ role: "group",
45
+ className: mx(previewProse, "grid gap-3 grid-cols-[min-content_1fr]")
46
+ }, /* @__PURE__ */ React.createElement(Avatar.Content, {
47
+ imgSrc: image,
48
+ icon: "ph--user--regular",
49
+ size: 16,
50
+ hue: "neutral"
51
+ }), /* @__PURE__ */ React.createElement("div", {
52
+ role: "none",
53
+ className: "bs-min self-center"
54
+ }, /* @__PURE__ */ React.createElement(Avatar.Label, {
55
+ asChild: true
56
+ }, /* @__PURE__ */ React.createElement("h2", {
57
+ className: previewTitle
58
+ }, fullName))))), organizationName && /* @__PURE__ */ React.createElement("div", {
59
+ role: "none",
60
+ className: previewChrome
61
+ }, typeof organization === "object" && onOrgClick ? /* @__PURE__ */ React.createElement(Button, {
62
+ variant: "ghost",
63
+ classNames: "gap-2 text-start",
64
+ onClick: () => onOrgClick(organization.target)
65
+ }, /* @__PURE__ */ React.createElement(Icon, {
66
+ icon: "ph--buildings--regular",
67
+ size: 5,
68
+ classNames: "text-subdued"
69
+ }), /* @__PURE__ */ React.createElement("span", {
70
+ className: "min-is-0 flex-1 truncate"
71
+ }, organizationName), /* @__PURE__ */ React.createElement(Icon, {
72
+ icon: "ph--arrow-right--regular"
73
+ })) : /* @__PURE__ */ React.createElement("p", {
74
+ className: "dx-button gap-2",
75
+ "data-variant": "ghost"
76
+ }, /* @__PURE__ */ React.createElement(Icon, {
77
+ icon: "ph--buildings--regular",
78
+ size: 5,
79
+ classNames: "text-subdued"
80
+ }), /* @__PURE__ */ React.createElement("span", {
81
+ className: "min-is-0 flex-1 truncate"
82
+ }, organizationName))), /* @__PURE__ */ React.createElement("dl", {
83
+ className: mx(previewProse, "grid gap-2 grid-cols-[min-content_1fr] [&_dt]:text-subdued [&_dt]:pbs-0.5 [&_dd]:min-is-0")
84
+ }, emails?.length && emails.map(({ label, value }) => /* @__PURE__ */ React.createElement(Fragment, {
85
+ key: value
86
+ }, /* @__PURE__ */ React.createElement("dt", null, /* @__PURE__ */ React.createElement(Icon, {
87
+ icon: "ph--at--regular",
88
+ size: 5
89
+ })), /* @__PURE__ */ React.createElement("dd", {
90
+ key: value,
91
+ className: "break-words"
92
+ }, value)))), children);
93
+ };
94
+
95
+ // packages/plugins/plugin-preview/src/components/OrganizationCard.tsx
96
+ import React2 from "react";
97
+ import { Icon as Icon2 } from "@dxos/react-ui";
98
+ import { mx as mx2 } from "@dxos/react-ui-theme";
99
+ var OrganizationCard = ({ children, classNames, subject: { name, image, description, website } }) => {
100
+ return /* @__PURE__ */ React2.createElement("div", {
101
+ role: "none",
102
+ className: mx2(previewCard, classNames)
103
+ }, image ? /* @__PURE__ */ React2.createElement("img", {
104
+ className: "aspect-video object-cover is-full bs-auto",
105
+ src: image,
106
+ alt: name
107
+ }) : /* @__PURE__ */ React2.createElement("div", {
108
+ role: "image",
109
+ className: "grid aspect-video place-items-center bg-groupSurface text-subdued"
110
+ }, /* @__PURE__ */ React2.createElement(Icon2, {
111
+ icon: "ph--building-office--regular",
112
+ size: 10
113
+ })), /* @__PURE__ */ React2.createElement("h2", {
114
+ className: mx2(previewTitle, previewProse)
115
+ }, name), description && /* @__PURE__ */ React2.createElement("p", {
116
+ className: mx2(previewProse, "line-clamp-2")
117
+ }, description), website && /* @__PURE__ */ React2.createElement("div", {
118
+ role: "none",
119
+ className: previewChrome
120
+ }, /* @__PURE__ */ React2.createElement("a", {
121
+ className: "dx-button dx-focus-ring gap-2",
122
+ href: website,
123
+ target: "_blank",
124
+ rel: "noreferrer"
125
+ }, /* @__PURE__ */ React2.createElement(Icon2, {
126
+ icon: "ph--link--regular",
127
+ size: 5,
128
+ classNames: "text-subdued"
129
+ }), /* @__PURE__ */ React2.createElement("span", {
130
+ className: "grow"
131
+ }, website), /* @__PURE__ */ React2.createElement(Icon2, {
132
+ icon: "ph--arrow-square-out--regular"
133
+ }))), children);
134
+ };
135
+
136
+ // packages/plugins/plugin-preview/src/components/ProjectCard.tsx
137
+ import React3 from "react";
138
+ import { mx as mx3 } from "@dxos/react-ui-theme";
139
+ var ProjectCard = ({ classNames, subject: { name, image, description } }) => {
140
+ return /* @__PURE__ */ React3.createElement("div", {
141
+ role: "none",
142
+ className: mx3(previewCard, classNames)
143
+ }, image && /* @__PURE__ */ React3.createElement("img", {
144
+ className: "is-full bs-auto",
145
+ src: image,
146
+ alt: name
147
+ }), /* @__PURE__ */ React3.createElement("h2", {
148
+ className: mx3(previewTitle, "pli-3 mlb-3")
149
+ }, name), description && /* @__PURE__ */ React3.createElement("p", {
150
+ className: "pli-3 line-clamp-2 mlb-3"
151
+ }, description));
152
+ };
153
+
154
+ // packages/plugins/plugin-preview/src/translations.ts
155
+ var translations_default = [
156
+ {
157
+ "en-US": {
158
+ [PREVIEW_PLUGIN]: {
159
+ "unable to create preview message": "No preview"
160
+ }
161
+ }
162
+ }
163
+ ];
164
+
165
+ // packages/plugins/plugin-preview/src/PreviewPlugin.tsx
20
166
  var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-preview/src/PreviewPlugin.tsx";
21
167
  var customEventOptions = {
22
168
  capture: true,
@@ -35,7 +181,22 @@ var handlePreviewLookup = async (client, defaultSpace, { ref, label }) => {
35
181
  };
36
182
  var PreviewPlugin = () => definePlugin(meta, [
37
183
  defineModule({
38
- id: `${meta.id}/module/preview-popoevr`,
184
+ id: `${meta.id}/module/translations`,
185
+ activatesOn: Events.SetupTranslations,
186
+ activate: () => contributes(Capabilities.Translations, translations_default)
187
+ }),
188
+ defineModule({
189
+ id: `${meta.id}/module/schema`,
190
+ activatesOn: ClientEvents.SetupSchema,
191
+ activate: () => [
192
+ contributes(ClientCapabilities.Schema, [
193
+ Contact,
194
+ Organization
195
+ ])
196
+ ]
197
+ }),
198
+ defineModule({
199
+ id: `${meta.id}/module/preview-popover`,
39
200
  activatesOn: Events.Startup,
40
201
  activate: (context) => {
41
202
  const handleDxRefTagActivate = async ({ ref, label, trigger }) => {
@@ -64,7 +225,7 @@ var PreviewPlugin = () => definePlugin(meta, [
64
225
  if (!document.defaultView) {
65
226
  log.warn("No default view found", void 0, {
66
227
  F: __dxlog_file,
67
- L: 74,
228
+ L: 105,
68
229
  S: void 0,
69
230
  C: (f, a) => f(...a)
70
231
  });
@@ -73,11 +234,111 @@ var PreviewPlugin = () => definePlugin(meta, [
73
234
  const cleanup = addEventListener(document.defaultView, "dx-ref-tag-activate", handleDxRefTagActivate, customEventOptions);
74
235
  return contributes(Capabilities.Null, null, () => cleanup());
75
236
  }
237
+ }),
238
+ defineModule({
239
+ id: `${meta.id}/module/react-surface`,
240
+ activatesOn: Events.SetupReactSurface,
241
+ activate: () => (
242
+ // TODO(wittjosiah): Factor out to lazy capabilities like other plugins.
243
+ contributes(Capabilities.ReactSurface, [
244
+ //
245
+ // Specific schema types.
246
+ //
247
+ createSurface({
248
+ id: `${PREVIEW_PLUGIN}/schema-popover`,
249
+ role: "popover",
250
+ filter: (data) => isInstanceOf(Contact, data.subject),
251
+ component: ({ data }) => {
252
+ const { dispatchPromise: dispatch } = useIntentDispatcher();
253
+ const handleOrgClick = useCallback(async (org) => {
254
+ const space = getSpace(org);
255
+ const tablesQuery = await space?.db.query(Filter.schema(TableType)).run();
256
+ const currentSpaceOrgTable = tablesQuery?.objects.find((table) => {
257
+ return table.view?.target?.query?.typename === Organization.typename;
258
+ });
259
+ await dispatch(createIntent(LayoutAction.UpdatePopover, {
260
+ part: "popover",
261
+ options: {
262
+ state: false,
263
+ anchorId: ""
264
+ }
265
+ }));
266
+ if (currentSpaceOrgTable) {
267
+ return dispatch(createIntent(LayoutAction.Open, {
268
+ part: "main",
269
+ subject: [
270
+ fullyQualifiedId(currentSpaceOrgTable)
271
+ ],
272
+ options: {
273
+ workspace: space?.id
274
+ }
275
+ }));
276
+ }
277
+ }, [
278
+ dispatch
279
+ ]);
280
+ return /* @__PURE__ */ React4.createElement(ContactCard, {
281
+ subject: data.subject,
282
+ onOrgClick: handleOrgClick
283
+ }, /* @__PURE__ */ React4.createElement(Surface, {
284
+ role: "related",
285
+ data
286
+ }));
287
+ }
288
+ }),
289
+ createSurface({
290
+ id: `${PREVIEW_PLUGIN}/schema-popover`,
291
+ role: "popover",
292
+ filter: (data) => isInstanceOf(Organization, data.subject),
293
+ component: ({ data }) => /* @__PURE__ */ React4.createElement(OrganizationCard, {
294
+ subject: data.subject
295
+ }, /* @__PURE__ */ React4.createElement(Surface, {
296
+ role: "related",
297
+ data
298
+ }))
299
+ }),
300
+ createSurface({
301
+ id: `${PREVIEW_PLUGIN}/schema-popover`,
302
+ role: "popover",
303
+ filter: (data) => isInstanceOf(Project, data.subject),
304
+ component: ({ data }) => /* @__PURE__ */ React4.createElement(ProjectCard, {
305
+ subject: data.subject
306
+ })
307
+ }),
308
+ //
309
+ // Fallback for any object.
310
+ //
311
+ createSurface({
312
+ id: `${PREVIEW_PLUGIN}/fallback-popover`,
313
+ role: "popover",
314
+ position: "fallback",
315
+ filter: (data) => isEchoObject(data.subject),
316
+ component: ({ data }) => {
317
+ const schema = getSchema(data.subject);
318
+ const { t } = useTranslation(PREVIEW_PLUGIN);
319
+ if (!schema) {
320
+ return /* @__PURE__ */ React4.createElement("p", {
321
+ className: descriptionMessage
322
+ }, t("unable to create preview message"));
323
+ }
324
+ return /* @__PURE__ */ React4.createElement(Form, {
325
+ schema,
326
+ values: data.subject,
327
+ readonly: true
328
+ });
329
+ }
330
+ })
331
+ ])
332
+ )
76
333
  })
77
334
  ]);
78
335
  export {
79
336
  PREVIEW_PLUGIN,
80
337
  PreviewPlugin,
81
- meta
338
+ meta,
339
+ previewCard,
340
+ previewChrome,
341
+ previewProse,
342
+ previewTitle
82
343
  };
83
344
  //# 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,MAAM;EACNC,MAAM;EACNC,QAAQ;AACV;;;ACTA,SACEC,cACAC,cACAC,aACAC,QACAC,cACAC,cACAC,oBACK;AACP,SAASC,wBAAwB;AAEjC,SAASC,kBAAkB;AAC3B,SAASC,eAA2B;AACpC,SAASC,WAAW;AAEpB,SAASC,WAAW;AACpB,SAASC,0BAA0B;;AAKnC,IAAMC,qBAAqB;EAAEC,SAAS;EAAMC,SAAS;AAAM;AAE3D,IAAMC,sBAAsB,OAC1BC,QACAC,cACA,EAAEC,KAAKC,MAAK,MAAkB;AAE9B,QAAMC,MAAMC,IAAIC,MAAMJ,GAAAA;AACtB,MAAI,CAACE,KAAK;AACR,WAAO;EACT;AAEA,QAAMG,SAAS,MAAMC,WAAWR,QAAQI,KAAKH,YAAAA;AAC7C,SAAO;IAAEE;IAAOI;EAAO;AACzB;AAEO,IAAME,gBAAgB,MAC3BC,aAAaC,MAAM;EACjBC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,UAAU,CAACC,YAAAA;AAET,YAAMC,yBAAyB,OAAO,EAAEjB,KAAKC,OAAOiB,QAAO,MAAoB;AAC7E,cAAM,EAAEC,iBAAiBC,SAAQ,IAAKJ,QAAQK,kBAAkBC,aAAaC,gBAAgB;AAC7F,cAAMzB,SAASkB,QAAQK,kBAAkBG,mBAAmBC,MAAM;AAClE,cAAM,CAACC,MAAAA,IAAUV,QAAQW,oBAAoBL,aAAaM,MAAM;AAChE,cAAM,EAAEC,QAAO,IAAKC,QAAQJ,OAAOK,SAAS;AAC5C,cAAMC,SAASH,WAAW/B,OAAOmC,OAAOC,IAAIL,OAAAA,MAAa/B,OAAOmC,OAAOE;AACvE,cAAMC,SAAS,MAAMvC,oBAAoBC,QAAQkC,OAAO;UAAEhC;UAAKC;QAAM,CAAA;AACrE,YAAI,CAACmC,QAAQ;AACX;QACF;AAEA,cAAMhB,SACJiB,aAAaC,aAAaC,eAAe;UACvCC,MAAM;UACNC,SAASL,OAAO/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 }>\n>;\n\n// TODO(burdon): Update react-ui-card (to use grid) and re-use here.\n// - See https://dxos-storybook.pages.dev/?path=/story/ui-react-ui-card-card--draggable\n// - Standardize Header, actions, image, body, etc.\n// - Support different grid layouts (e.g., image to the side, on top, etc.)\n// - Should co-exist naturally with react-ui-form (e.g., as main content).\n// - Considerations for drag-and-drop.\n/**\n * <Card.Root>\n * <Card.Header>\n * <Card.Title>\n * <Card.Action>\n * </Card.Header>\n * <Card.Body>\n * <Card.Image>\n * <Form />\n * </Card.Body>\n * </Card.Root>\n */\nexport const previewCard = 'popover-max-width rounded-lg overflow-hidden';\nexport const previewTitle = 'text-lg font-medium line-clamp-2';\nexport const previewProse = 'pli-3 mlb-3';\nexport const previewChrome = 'pli-1.5 mlb-1.5 [&_.dx-button]:pli-1.5 [&_.dx-button]:text-start [&_.dx-button]:is-full';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport {\n Capabilities,\n Events,\n LayoutAction,\n Surface,\n contributes,\n createIntent,\n createSurface,\n defineModule,\n definePlugin,\n useIntentDispatcher,\n} from '@dxos/app-framework';\nimport { addEventListener } from '@dxos/async';\nimport { type Client, resolveRef } from '@dxos/client';\nimport {\n Filter,\n fullyQualifiedId,\n getSchema,\n getSpace,\n isEchoObject,\n parseId,\n type ReactiveEchoObject,\n type Space,\n} from '@dxos/client/echo';\nimport { isInstanceOf } from '@dxos/echo-schema';\nimport { DXN } from '@dxos/keys';\nimport { type DxRefTagActivate } from '@dxos/lit-ui';\nimport { log } from '@dxos/log';\nimport { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';\nimport { useTranslation } from '@dxos/react-ui';\nimport { type PreviewLinkRef, type PreviewLinkTarget } from '@dxos/react-ui-editor';\nimport { Form } from '@dxos/react-ui-form';\nimport { TableType } from '@dxos/react-ui-table';\nimport { descriptionMessage } from '@dxos/react-ui-theme';\nimport { Contact, Organization, Project } from '@dxos/schema';\n\nimport { ContactCard, OrganizationCard, ProjectCard } from './components';\nimport { meta, PREVIEW_PLUGIN } from './meta';\nimport translations from './translations';\n\nconst customEventOptions = { capture: true, passive: false };\n\nconst handlePreviewLookup = async (\n client: Client,\n defaultSpace: Space,\n { ref, label }: PreviewLinkRef,\n): Promise<PreviewLinkTarget | null> => {\n const dxn = DXN.parse(ref);\n if (!dxn) {\n return null;\n }\n\n const object = await resolveRef(client, dxn, defaultSpace);\n return { label, object };\n};\n\nexport const PreviewPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () => [contributes(ClientCapabilities.Schema, [Contact, Organization])],\n }),\n defineModule({\n id: `${meta.id}/module/preview-popover`,\n activatesOn: Events.Startup,\n activate: (context) => {\n // TODO(wittjosiah): Factor out lookup handlers to other plugins to make not ECHO-specific.\n const handleDxRefTagActivate = async ({ ref, label, trigger }: DxRefTagActivate) => {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n const client = context.requestCapability(ClientCapabilities.Client);\n const [layout] = context.requestCapabilities(Capabilities.Layout);\n const { spaceId } = parseId(layout.workspace);\n const space = (spaceId && client.spaces.get(spaceId)) ?? client.spaces.default;\n const result = await handlePreviewLookup(client, space, { ref, label });\n if (!result) {\n return;\n }\n\n await dispatch(\n createIntent(LayoutAction.UpdatePopover, {\n part: 'popover',\n subject: result.object,\n options: {\n state: true,\n variant: 'virtual',\n anchor: trigger,\n },\n }),\n );\n };\n\n if (!document.defaultView) {\n log.warn('No default view found');\n return [];\n }\n\n const cleanup = addEventListener(\n document.defaultView,\n 'dx-ref-tag-activate',\n handleDxRefTagActivate,\n customEventOptions,\n );\n return contributes(Capabilities.Null, null, () => cleanup());\n },\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: () =>\n // TODO(wittjosiah): Factor out to lazy capabilities like other plugins.\n contributes(Capabilities.ReactSurface, [\n //\n // Specific schema types.\n //\n createSurface({\n id: `${PREVIEW_PLUGIN}/schema-popover`,\n role: 'popover',\n filter: (data): data is { subject: Contact } => isInstanceOf(Contact, data.subject),\n component: ({ data }) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const handleOrgClick = useCallback(\n async (org: Organization) => {\n const space = getSpace(org);\n const tablesQuery = await space?.db.query(Filter.schema(TableType)).run();\n const currentSpaceOrgTable = tablesQuery?.objects.find((table) => {\n return table.view?.target?.query?.typename === Organization.typename;\n });\n await dispatch(\n createIntent(LayoutAction.UpdatePopover, {\n part: 'popover',\n options: {\n state: false,\n anchorId: '',\n },\n }),\n );\n if (currentSpaceOrgTable) {\n return dispatch(\n createIntent(LayoutAction.Open, {\n part: 'main',\n subject: [fullyQualifiedId(currentSpaceOrgTable)],\n options: { workspace: space?.id },\n }),\n );\n }\n },\n [dispatch],\n );\n return (\n <ContactCard subject={data.subject} onOrgClick={handleOrgClick}>\n <Surface role='related' data={data} />\n </ContactCard>\n );\n },\n }),\n createSurface({\n id: `${PREVIEW_PLUGIN}/schema-popover`,\n role: 'popover',\n filter: (data): data is { subject: Organization } => isInstanceOf(Organization, data.subject),\n component: ({ data }) => (\n <OrganizationCard subject={data.subject}>\n <Surface role='related' data={data} />\n </OrganizationCard>\n ),\n }),\n createSurface({\n id: `${PREVIEW_PLUGIN}/schema-popover`,\n role: 'popover',\n filter: (data): data is { subject: Project } => isInstanceOf(Project, data.subject),\n component: ({ data }) => <ProjectCard subject={data.subject} />,\n }),\n\n //\n // Fallback for any object.\n //\n createSurface({\n id: `${PREVIEW_PLUGIN}/fallback-popover`,\n role: 'popover',\n position: 'fallback',\n filter: (data): data is { subject: ReactiveEchoObject<any> } => isEchoObject(data.subject),\n component: ({ data }) => {\n const schema = getSchema(data.subject);\n const { t } = useTranslation(PREVIEW_PLUGIN);\n if (!schema) {\n return <p className={descriptionMessage}>{t('unable to create preview message')}</p>;\n }\n\n return <Form schema={schema} values={data.subject} readonly />;\n },\n }),\n ]),\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { Fragment } from 'react';\n\nimport { Icon, Avatar, Button } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-ui-theme';\nimport { type Contact, type Organization } from '@dxos/schema';\n\nimport { type PreviewProps, previewCard, previewTitle, previewProse, previewChrome } from '../types';\n\nexport const ContactCard = ({\n children,\n classNames,\n subject: { fullName, image, organization, emails },\n onOrgClick,\n}: PreviewProps<Contact> & { onOrgClick?: (org: Organization) => void }) => {\n const organizationName = organization && typeof organization === 'object' ? organization.target?.name : organization;\n return (\n <div role='none' className={mx(previewCard, classNames)}>\n <Avatar.Root>\n <div role='group' className={mx(previewProse, 'grid gap-3 grid-cols-[min-content_1fr]')}>\n <Avatar.Content imgSrc={image} icon='ph--user--regular' size={16} hue='neutral' />\n <div role='none' className='bs-min self-center'>\n <Avatar.Label asChild>\n <h2 className={previewTitle}>{fullName}</h2>\n </Avatar.Label>\n </div>\n </div>\n </Avatar.Root>\n {organizationName && (\n <div role='none' className={previewChrome}>\n {typeof organization === 'object' && onOrgClick ? (\n <Button variant='ghost' classNames='gap-2 text-start' onClick={() => onOrgClick(organization.target!)}>\n <Icon icon='ph--buildings--regular' size={5} classNames='text-subdued' />\n <span className='min-is-0 flex-1 truncate'>{organizationName}</span>\n <Icon icon='ph--arrow-right--regular' />\n </Button>\n ) : (\n <p className='dx-button gap-2' data-variant='ghost'>\n <Icon icon='ph--buildings--regular' size={5} classNames='text-subdued' />\n <span className='min-is-0 flex-1 truncate'>{organizationName}</span>\n </p>\n )}\n </div>\n )}\n <dl\n className={mx(\n previewProse,\n 'grid gap-2 grid-cols-[min-content_1fr] [&_dt]:text-subdued [&_dt]:pbs-0.5 [&_dd]:min-is-0',\n )}\n >\n {emails?.length &&\n emails.map(({ label, value }) => (\n <Fragment key={value}>\n <dt>\n <Icon icon='ph--at--regular' size={5} />\n </dt>\n <dd key={value} className='break-words'>\n {value}\n </dd>\n </Fragment>\n ))}\n </dl>\n {children}\n </div>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Icon } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-ui-theme';\nimport { type Organization } from '@dxos/schema';\n\nimport { type PreviewProps, previewCard, previewTitle, previewProse, previewChrome } from '../types';\n\nexport const OrganizationCard = ({\n children,\n classNames,\n subject: { name, image, description, website },\n}: PreviewProps<Organization>) => {\n return (\n <div role='none' className={mx(previewCard, classNames)}>\n {image ? (\n <img className='aspect-video object-cover is-full bs-auto' src={image} alt={name} />\n ) : (\n <div role='image' className='grid aspect-video place-items-center bg-groupSurface text-subdued'>\n <Icon icon='ph--building-office--regular' size={10} />\n </div>\n )}\n <h2 className={mx(previewTitle, previewProse)}>{name}</h2>\n {description && <p className={mx(previewProse, 'line-clamp-2')}>{description}</p>}\n {website && (\n <div role='none' className={previewChrome}>\n <a className='dx-button dx-focus-ring gap-2' href={website} target='_blank' rel='noreferrer'>\n <Icon icon='ph--link--regular' size={5} classNames='text-subdued' />\n <span className='grow'>{website}</span>\n <Icon icon='ph--arrow-square-out--regular' />\n </a>\n </div>\n )}\n {children}\n </div>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { mx } from '@dxos/react-ui-theme';\nimport { type Project } from '@dxos/schema';\n\nimport { type PreviewProps, previewCard, previewTitle } from '../types';\n\nexport const ProjectCard = ({ classNames, subject: { name, image, description } }: PreviewProps<Project>) => {\n return (\n <div role='none' className={mx(previewCard, classNames)}>\n {image && <img className='is-full bs-auto' src={image} alt={name} />}\n <h2 className={mx(previewTitle, 'pli-3 mlb-3')}>{name}</h2>\n {description && <p className='pli-3 line-clamp-2 mlb-3'>{description}</p>}\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { PREVIEW_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [PREVIEW_PLUGIN]: {\n 'unable to create preview message': 'No preview',\n },\n },\n },\n];\n"],
5
+ "mappings": ";;;AAMO,IAAMA,iBAAiB;AAEvB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;EACNC,MAAM;EACNC,QAAQ;AACV;;;ACoBO,IAAMC,cAAc;AACpB,IAAMC,eAAe;AACrB,IAAMC,eAAe;AACrB,IAAMC,gBAAgB;;;AChC7B,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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Q,CAACC,SAA4CC,aAAa5C,cAAc2C,KAAKlB,OAAO;UAC5FoB,WAAW,CAAC,EAAEF,KAAI,MAChB,gBAAAyB,OAAA,cAACI,kBAAAA;YAAiB/C,SAASkB,KAAKlB;aAC9B,gBAAA2C,OAAA,cAACG,SAAAA;YAAQ9B,MAAK;YAAUE;;QAG9B,CAAA;QACAJ,cAAc;UACZrD,IAAI,GAAGsD,cAAAA;UACPC,MAAM;UACNC,QAAQ,CAACC,SAAuCC,aAAa6B,SAAS9B,KAAKlB,OAAO;UAClFoB,WAAW,CAAC,EAAEF,KAAI,MAAO,gBAAAyB,OAAA,cAACM,aAAAA;YAAYjD,SAASkB,KAAKlB;;QACtD,CAAA;;;;QAKAc,cAAc;UACZrD,IAAI,GAAGsD,cAAAA;UACPC,MAAM;UACNkC,UAAU;UACVjC,QAAQ,CAACC,SAAuDiC,aAAajC,KAAKlB,OAAO;UACzFoB,WAAW,CAAC,EAAEF,KAAI,MAAE;AAClB,kBAAMY,SAASsB,UAAUlC,KAAKlB,OAAO;AACrC,kBAAM,EAAEqD,EAAC,IAAKC,eAAevC,cAAAA;AAC7B,gBAAI,CAACe,QAAQ;AACX,qBAAO,gBAAAa,OAAA,cAACY,KAAAA;gBAAEC,WAAWC;iBAAqBJ,EAAE,kCAAA,CAAA;YAC9C;AAEA,mBAAO,gBAAAV,OAAA,cAACe,MAAAA;cAAK5B;cAAgB6B,QAAQzC,KAAKlB;cAAS4D,UAAAA;;UACrD;QACF,CAAA;OACD;;EACL,CAAA;CACD;",
6
+ "names": ["PREVIEW_PLUGIN", "meta", "id", "name", "icon", "source", "previewCard", "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", "Contact", "Organization", "Project", "React", "Fragment", "Icon", "Avatar", "Button", "mx", "ContactCard", "children", "classNames", "subject", "fullName", "image", "organization", "emails", "onOrgClick", "organizationName", "target", "name", "div", "role", "className", "mx", "previewCard", "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", "React", "div", "role", "className", "mx", "previewCard", "img", "src", "alt", "Icon", "icon", "size", "h2", "previewTitle", "previewProse", "p", "previewChrome", "a", "href", "target", "rel", "span", "React", "mx", "ProjectCard", "classNames", "subject", "name", "image", "description", "React", "div", "role", "className", "mx", "previewCard", "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", "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", "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", "schema", "TableType", "run", "currentSpaceOrgTable", "objects", "find", "table", "view", "target", "typename", "anchorId", "Open", "fullyQualifiedId", "React", "ContactCard", "onOrgClick", "Surface", "OrganizationCard", "Project", "ProjectCard", "position", "isEchoObject", "getSchema", "t", "useTranslation", "p", "className", "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-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":3274,"imports":[],"format":"esm"},"packages/plugins/plugin-preview/src/components/ContactCard.tsx":{"bytes":9227,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-preview/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-preview/src/components/OrganizationCard.tsx":{"bytes":5532,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-preview/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-preview/src/components/ProjectCard.tsx":{"bytes":2743,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-preview/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-preview/src/components/index.ts":{"bytes":732,"imports":[{"path":"packages/plugins/plugin-preview/src/components/ContactCard.tsx","kind":"import-statement","original":"./ContactCard"},{"path":"packages/plugins/plugin-preview/src/components/OrganizationCard.tsx","kind":"import-statement","original":"./OrganizationCard"},{"path":"packages/plugins/plugin-preview/src/components/ProjectCard.tsx","kind":"import-statement","original":"./ProjectCard"}],"format":"esm"},"packages/plugins/plugin-preview/src/translations.ts":{"bytes":1091,"imports":[{"path":"packages/plugins/plugin-preview/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-preview/src/PreviewPlugin.tsx":{"bytes":27057,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"@dxos/react-ui-table","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-preview/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-preview/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-preview/src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/plugins/plugin-preview/src/index.ts":{"bytes":681,"imports":[{"path":"packages/plugins/plugin-preview/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-preview/src/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/plugin-preview/src/PreviewPlugin.tsx","kind":"import-statement","original":"./PreviewPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-preview/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":24138},"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","meta","previewCard","previewChrome","previewProse","previewTitle"],"entryPoint":"packages/plugins/plugin-preview/src/index.ts","inputs":{"packages/plugins/plugin-preview/src/meta.ts":{"bytesInOutput":216},"packages/plugins/plugin-preview/src/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-preview/src/types.ts":{"bytesInOutput":266},"packages/plugins/plugin-preview/src/PreviewPlugin.tsx":{"bytesInOutput":6691},"packages/plugins/plugin-preview/src/components/ContactCard.tsx":{"bytesInOutput":2668},"packages/plugins/plugin-preview/src/components/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-preview/src/components/OrganizationCard.tsx":{"bytesInOutput":1584},"packages/plugins/plugin-preview/src/components/ProjectCard.tsx":{"bytesInOutput":633},"packages/plugins/plugin-preview/src/translations.ts":{"bytesInOutput":152}},"bytes":12930}}}
@@ -0,0 +1,197 @@
1
+ import '@dxos-theme';
2
+ import { type Meta } from '@storybook/react';
3
+ import React, { type FC } from 'react';
4
+ import { Contact, Organization, Project } 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, subject: { fullName, image, organization, emails }, onOrgClick, }: import("./types").PreviewProps<Contact> & {
17
+ onOrgClick?: (org: 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?: "first" | "second" | "third" | "fourth" | 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?: {
66
+ toString: () => string;
67
+ toDateString: () => string;
68
+ toTimeString: () => string;
69
+ toLocaleString: {
70
+ (): string;
71
+ (locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
72
+ (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
73
+ };
74
+ toLocaleDateString: {
75
+ (): string;
76
+ (locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
77
+ (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
78
+ };
79
+ toLocaleTimeString: {
80
+ (): string;
81
+ (locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
82
+ (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
83
+ };
84
+ valueOf: () => number;
85
+ getTime: () => number;
86
+ getFullYear: () => number;
87
+ getUTCFullYear: () => number;
88
+ getMonth: () => number;
89
+ getUTCMonth: () => number;
90
+ getDate: () => number;
91
+ getUTCDate: () => number;
92
+ getDay: () => number;
93
+ getUTCDay: () => number;
94
+ getHours: () => number;
95
+ getUTCHours: () => number;
96
+ getMinutes: () => number;
97
+ getUTCMinutes: () => number;
98
+ getSeconds: () => number;
99
+ getUTCSeconds: () => number;
100
+ getMilliseconds: () => number;
101
+ getUTCMilliseconds: () => number;
102
+ getTimezoneOffset: () => number;
103
+ setTime: (time: number) => number;
104
+ setMilliseconds: (ms: number) => number;
105
+ setUTCMilliseconds: (ms: number) => number;
106
+ setSeconds: (sec: number, ms?: number) => number;
107
+ setUTCSeconds: (sec: number, ms?: number) => number;
108
+ setMinutes: (min: number, sec?: number, ms?: number) => number;
109
+ setUTCMinutes: (min: number, sec?: number, ms?: number) => number;
110
+ setHours: (hours: number, min?: number, sec?: number, ms?: number) => number;
111
+ setUTCHours: (hours: number, min?: number, sec?: number, ms?: number) => number;
112
+ setDate: (date: number) => number;
113
+ setUTCDate: (date: number) => number;
114
+ setMonth: (month: number, date?: number) => number;
115
+ setUTCMonth: (month: number, date?: number) => number;
116
+ setFullYear: (year: number, month?: number, date?: number) => number;
117
+ setUTCFullYear: (year: number, month?: number, date?: number) => number;
118
+ toUTCString: () => string;
119
+ toISOString: () => string;
120
+ toJSON: (key?: any) => string;
121
+ [Symbol.toPrimitive]: {
122
+ (hint: "default"): string;
123
+ (hint: "string"): string;
124
+ (hint: "number"): number;
125
+ (hint: string): string | number;
126
+ };
127
+ } | undefined;
128
+ fields?: {
129
+ readonly label: string;
130
+ readonly value: string;
131
+ readonly category?: string | undefined;
132
+ }[] | undefined;
133
+ }, "id"> & {
134
+ id?: string;
135
+ } & {
136
+ id: string;
137
+ };
138
+ };
139
+ };
140
+ export declare const ContactNoImage: {
141
+ args: {
142
+ Component: ({ children, classNames, subject: { fullName, image, organization, emails }, onOrgClick, }: import("./types").PreviewProps<Contact> & {
143
+ onOrgClick?: (org: Organization) => void;
144
+ }) => React.JSX.Element;
145
+ icon: string;
146
+ subject: any;
147
+ };
148
+ };
149
+ export declare const OrganizationWithImage: {
150
+ args: {
151
+ Component: ({ children, classNames, subject: { name, image, description, website }, }: import("./types").PreviewProps<Organization>) => React.JSX.Element;
152
+ icon: string;
153
+ subject: Omit<{
154
+ readonly id: string;
155
+ image?: string | undefined;
156
+ name?: string | undefined;
157
+ description?: string | undefined;
158
+ status?: "first" | "second" | "third" | "fourth" | undefined;
159
+ website?: string | undefined;
160
+ }, "id"> & {
161
+ id?: string;
162
+ } & {
163
+ id: string;
164
+ };
165
+ };
166
+ };
167
+ export declare const OrganizationNoImage: {
168
+ args: {
169
+ Component: ({ children, classNames, subject: { name, image, description, website }, }: import("./types").PreviewProps<Organization>) => React.JSX.Element;
170
+ icon: string;
171
+ subject: any;
172
+ };
173
+ };
174
+ export declare const ProjectWithImage: {
175
+ args: {
176
+ Component: ({ classNames, subject: { name, image, description } }: import("./types").PreviewProps<Project>) => React.JSX.Element;
177
+ icon: string;
178
+ subject: Omit<{
179
+ readonly id: string;
180
+ image?: string | undefined;
181
+ name: string;
182
+ description?: string | undefined;
183
+ }, "id"> & {
184
+ id?: string;
185
+ } & {
186
+ id: string;
187
+ };
188
+ };
189
+ };
190
+ export declare const ProjectNoImage: {
191
+ args: {
192
+ Component: ({ classNames, subject: { name, image, description } }: import("./types").PreviewProps<Project>) => React.JSX.Element;
193
+ icon: string;
194
+ subject: any;
195
+ };
196
+ };
197
+ //# sourceMappingURL=Preview.stories.d.ts.map
@@ -0,0 +1 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CAM1B,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":"AA8DA,eAAO,MAAM,aAAa,4CA8ItB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { type Contact, type Organization } from '@dxos/schema';
3
+ import { type PreviewProps } from '../types';
4
+ export declare const ContactCard: ({ children, classNames, subject: { fullName, image, organization, emails }, onOrgClick, }: PreviewProps<Contact> & {
5
+ onOrgClick?: (org: Organization) => void;
6
+ }) => React.JSX.Element;
7
+ //# sourceMappingURL=ContactCard.d.ts.map