@dxos/plugin-preview 0.8.4-main.f5c0578 → 0.8.4-main.fcc0d83b33

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 (93) hide show
  1. package/dist/lib/browser/index.mjs +33 -53
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/browser/translations.mjs +21 -0
  5. package/dist/lib/browser/translations.mjs.map +7 -0
  6. package/dist/lib/node-esm/index.mjs +33 -52
  7. package/dist/lib/node-esm/index.mjs.map +4 -4
  8. package/dist/lib/node-esm/meta.json +1 -1
  9. package/dist/lib/node-esm/translations.mjs +23 -0
  10. package/dist/lib/node-esm/translations.mjs.map +7 -0
  11. package/dist/types/src/PreviewPlugin.d.ts +2 -1
  12. package/dist/types/src/PreviewPlugin.d.ts.map +1 -1
  13. package/dist/types/src/capabilities/index.d.ts +3 -2
  14. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  15. package/dist/types/src/capabilities/preview-popover.d.ts +3 -2
  16. package/dist/types/src/capabilities/preview-popover.d.ts.map +1 -1
  17. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  18. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  19. package/dist/types/src/cards/ExpandoCard.d.ts +4 -0
  20. package/dist/types/src/cards/ExpandoCard.d.ts.map +1 -0
  21. package/dist/types/src/cards/FormCard.d.ts +7 -0
  22. package/dist/types/src/cards/FormCard.d.ts.map +1 -0
  23. package/dist/types/src/cards/JsonCard.d.ts +5 -0
  24. package/dist/types/src/cards/JsonCard.d.ts.map +1 -0
  25. package/dist/types/src/cards/OrganizationCard.d.ts +5 -0
  26. package/dist/types/src/cards/OrganizationCard.d.ts.map +1 -0
  27. package/dist/types/src/cards/PersonCard.d.ts +5 -0
  28. package/dist/types/src/cards/PersonCard.d.ts.map +1 -0
  29. package/dist/types/src/cards/ProjectCard.d.ts +5 -0
  30. package/dist/types/src/cards/ProjectCard.d.ts.map +1 -0
  31. package/dist/types/src/cards/TaskCard.d.ts +5 -0
  32. package/dist/types/src/cards/TaskCard.d.ts.map +1 -0
  33. package/dist/types/src/cards/index.d.ts +8 -0
  34. package/dist/types/src/cards/index.d.ts.map +1 -0
  35. package/dist/types/src/index.d.ts +0 -1
  36. package/dist/types/src/index.d.ts.map +1 -1
  37. package/dist/types/src/meta.d.ts +2 -3
  38. package/dist/types/src/meta.d.ts.map +1 -1
  39. package/dist/types/src/stories/Card.stories.d.ts +34 -46
  40. package/dist/types/src/stories/Card.stories.d.ts.map +1 -1
  41. package/dist/types/src/stories/testing.d.ts +17 -14
  42. package/dist/types/src/stories/testing.d.ts.map +1 -1
  43. package/dist/types/src/translations.d.ts +8 -3
  44. package/dist/types/src/translations.d.ts.map +1 -1
  45. package/dist/types/tsconfig.tsbuildinfo +1 -1
  46. package/package.json +56 -37
  47. package/src/PreviewPlugin.tsx +17 -29
  48. package/src/capabilities/index.ts +3 -3
  49. package/src/capabilities/preview-popover.ts +72 -50
  50. package/src/capabilities/react-surface.tsx +106 -151
  51. package/src/cards/ExpandoCard.tsx +76 -0
  52. package/src/cards/FormCard.tsx +48 -0
  53. package/src/cards/JsonCard.tsx +19 -0
  54. package/src/cards/OrganizationCard.tsx +29 -0
  55. package/src/cards/PersonCard.tsx +65 -0
  56. package/src/cards/ProjectCard.tsx +22 -0
  57. package/src/cards/TaskCard.tsx +44 -0
  58. package/src/cards/index.ts +11 -0
  59. package/src/index.ts +0 -1
  60. package/src/meta.ts +8 -5
  61. package/src/stories/Card.stories.tsx +96 -28
  62. package/src/stories/testing.tsx +66 -68
  63. package/src/translations.ts +8 -2
  64. package/dist/lib/browser/chunk-Z73ENKLE.mjs +0 -14
  65. package/dist/lib/browser/chunk-Z73ENKLE.mjs.map +0 -7
  66. package/dist/lib/browser/preview-popover-MAIBTJKJ.mjs +0 -69
  67. package/dist/lib/browser/preview-popover-MAIBTJKJ.mjs.map +0 -7
  68. package/dist/lib/browser/react-surface-H4RYYXVQ.mjs +0 -379
  69. package/dist/lib/browser/react-surface-H4RYYXVQ.mjs.map +0 -7
  70. package/dist/lib/node-esm/chunk-2ORSL4GJ.mjs +0 -16
  71. package/dist/lib/node-esm/chunk-2ORSL4GJ.mjs.map +0 -7
  72. package/dist/lib/node-esm/preview-popover-LZGHYW23.mjs +0 -71
  73. package/dist/lib/node-esm/preview-popover-LZGHYW23.mjs.map +0 -7
  74. package/dist/lib/node-esm/react-surface-4C44XCLH.mjs +0 -380
  75. package/dist/lib/node-esm/react-surface-4C44XCLH.mjs.map +0 -7
  76. package/dist/types/src/components/CardSubjectMenu.d.ts +0 -10
  77. package/dist/types/src/components/CardSubjectMenu.d.ts.map +0 -1
  78. package/dist/types/src/components/ContactCard.d.ts +0 -7
  79. package/dist/types/src/components/ContactCard.d.ts.map +0 -1
  80. package/dist/types/src/components/OrganizationCard.d.ts +0 -5
  81. package/dist/types/src/components/OrganizationCard.d.ts.map +0 -1
  82. package/dist/types/src/components/ProjectCard.d.ts +0 -5
  83. package/dist/types/src/components/ProjectCard.d.ts.map +0 -1
  84. package/dist/types/src/components/index.d.ts +0 -4
  85. package/dist/types/src/components/index.d.ts.map +0 -1
  86. package/dist/types/src/types.d.ts +0 -7
  87. package/dist/types/src/types.d.ts.map +0 -1
  88. package/src/components/CardSubjectMenu.tsx +0 -56
  89. package/src/components/ContactCard.tsx +0 -76
  90. package/src/components/OrganizationCard.tsx +0 -44
  91. package/src/components/ProjectCard.tsx +0 -27
  92. package/src/components/index.ts +0 -7
  93. package/src/types.ts +0 -11
@@ -1,71 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
-
3
- // src/capabilities/preview-popover.ts
4
- import { Capabilities, LayoutAction, contributes, createIntent } from "@dxos/app-framework";
5
- import { addEventListener } from "@dxos/async";
6
- import { resolveRef } from "@dxos/client";
7
- import { parseId } from "@dxos/client/echo";
8
- import { DXN } from "@dxos/keys";
9
- import { log } from "@dxos/log";
10
- import { ClientCapabilities } from "@dxos/plugin-client";
11
- var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-preview/src/capabilities/preview-popover.ts";
12
- var customEventOptions = {
13
- capture: true,
14
- passive: false
15
- };
16
- var handlePreviewLookup = async (client, defaultSpace, { ref, label }) => {
17
- try {
18
- const dxn = DXN.parse(ref);
19
- if (!dxn) {
20
- return null;
21
- }
22
- const object = await resolveRef(client, dxn, defaultSpace);
23
- return {
24
- label,
25
- object
26
- };
27
- } catch (err) {
28
- return null;
29
- }
30
- };
31
- var preview_popover_default = (context) => {
32
- const handleDxRefTagActivate = async ({ refId, label, trigger }) => {
33
- const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
34
- const client = context.getCapability(ClientCapabilities.Client);
35
- const [layout] = context.getCapabilities(Capabilities.Layout);
36
- const { spaceId } = parseId(layout.workspace);
37
- const space = (spaceId && client.spaces.get(spaceId)) ?? client.spaces.default;
38
- const result = await handlePreviewLookup(client, space, {
39
- ref: refId,
40
- label
41
- });
42
- if (!result) {
43
- return;
44
- }
45
- await dispatch(createIntent(LayoutAction.UpdatePopover, {
46
- part: "popover",
47
- subject: result.object,
48
- options: {
49
- state: true,
50
- variant: "virtual",
51
- anchor: trigger
52
- }
53
- }));
54
- };
55
- let cleanup;
56
- if (document.defaultView) {
57
- cleanup = addEventListener(document.defaultView, "dx-ref-tag-activate", handleDxRefTagActivate, customEventOptions);
58
- } else {
59
- log.warn("No default view found", void 0, {
60
- F: __dxlog_file,
61
- L: 70,
62
- S: void 0,
63
- C: (f, a) => f(...a)
64
- });
65
- }
66
- return contributes(Capabilities.Null, null, () => cleanup());
67
- };
68
- export {
69
- preview_popover_default as default
70
- };
71
- //# sourceMappingURL=preview-popover-LZGHYW23.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/preview-popover.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';\nimport { addEventListener } from '@dxos/async';\nimport { type Client, resolveRef } from '@dxos/client';\nimport { type Space, parseId } 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\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 try {\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 } catch (err) {\n return null;\n }\n};\n\nexport default (context: PluginContext) => {\n // TODO(wittjosiah): Factor out lookup handlers to other plugins to make not ECHO-specific.\n const handleDxRefTagActivate = async ({ refId, 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: refId, 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 let cleanup: () => void;\n if (document.defaultView) {\n cleanup = addEventListener(\n document.defaultView,\n 'dx-ref-tag-activate' as any,\n handleDxRefTagActivate,\n customEventOptions,\n );\n } else {\n log.warn('No default view found');\n }\n\n return contributes(Capabilities.Null, null, () => cleanup());\n};\n"],
5
- "mappings": ";;;AAIA,SAASA,cAAcC,cAAkCC,aAAaC,oBAAoB;AAC1F,SAASC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6C,SAASC,aACT,uBACA3B,wBACAb,kBAAAA;EAEJ,OAAO;AACLF,QAAI2C,KAAK,yBAAA,QAAA;;;;;;EACX;AAEA,SAAOjD,YAAYF,aAAaoD,MAAM,MAAM,MAAMJ,QAAAA,CAAAA;AACpD;",
6
- "names": ["Capabilities", "LayoutAction", "contributes", "createIntent", "addEventListener", "resolveRef", "parseId", "DXN", "log", "ClientCapabilities", "customEventOptions", "capture", "passive", "handlePreviewLookup", "client", "defaultSpace", "ref", "label", "dxn", "parse", "object", "err", "context", "handleDxRefTagActivate", "refId", "trigger", "dispatchPromise", "dispatch", "getCapability", "IntentDispatcher", "Client", "layout", "getCapabilities", "Layout", "spaceId", "workspace", "space", "spaces", "get", "default", "result", "UpdatePopover", "part", "subject", "options", "state", "variant", "anchor", "cleanup", "document", "defaultView", "warn", "Null"]
7
- }
@@ -1,380 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- PREVIEW_PLUGIN
4
- } from "./chunk-2ORSL4GJ.mjs";
5
-
6
- // src/capabilities/react-surface.tsx
7
- import { Effect } from "effect";
8
- import React5, { useCallback } from "react";
9
- import { Capabilities, LayoutAction, Surface, contributes, createIntent, createSurface, useIntentDispatcher } from "@dxos/app-framework";
10
- import { fullyQualifiedId, getSchema, getSpace } from "@dxos/client/echo";
11
- import { Filter, Obj } from "@dxos/echo";
12
- import { setValue } from "@dxos/echo-schema";
13
- import { AttentionAction } from "@dxos/plugin-attention/types";
14
- import { ATTENDABLE_PATH_SEPARATOR, DeckAction } from "@dxos/plugin-deck/types";
15
- import { useQuery, useSpace } from "@dxos/react-client/echo";
16
- import { useTranslation as useTranslation2 } from "@dxos/react-ui";
17
- import { Form } from "@dxos/react-ui-form";
18
- import { Card as Card4 } from "@dxos/react-ui-stack";
19
- import { TableView } from "@dxos/react-ui-table/types";
20
- import { descriptionMessage, mx as mx4 } from "@dxos/react-ui-theme";
21
- import { DataType } from "@dxos/schema";
22
-
23
- // src/components/ContactCard.tsx
24
- import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
25
- import React2, { Fragment } from "react";
26
- import { Avatar, Button, Icon } from "@dxos/react-ui";
27
- import { Card, cardHeading, cardText } from "@dxos/react-ui-stack";
28
- import { mx } from "@dxos/react-ui-theme";
29
-
30
- // src/components/CardSubjectMenu.tsx
31
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
32
- import { Rx } from "@effect-rx/rx-react";
33
- import React from "react";
34
- import { ACTION_TYPE } from "@dxos/app-graph";
35
- import { IconButton, useTranslation } from "@dxos/react-ui";
36
- import { DropdownMenu, MenuProvider, useMenuActions } from "@dxos/react-ui-menu";
37
- var useSubjectMenuGroupItems = (subject) => {
38
- const result = {
39
- edges: [],
40
- nodes: []
41
- };
42
- result.nodes.push({
43
- type: ACTION_TYPE,
44
- id: `${subject.id}/add-to-space`,
45
- data: () => console.log("[TO DO]", "add object to space", subject),
46
- properties: {
47
- label: [
48
- "add object to space label",
49
- {
50
- ns: "os"
51
- }
52
- ],
53
- icon: "ph--file-plus--regular"
54
- }
55
- });
56
- result.nodes.forEach(({ id: target }) => {
57
- result.edges.push({
58
- source: "root",
59
- target
60
- });
61
- });
62
- return useMenuActions(Rx.make(result));
63
- };
64
- var CardSubjectMenu = ({ subject, ...props }) => {
65
- var _effect = _useSignals();
66
- try {
67
- const { t } = useTranslation("os");
68
- const menuProps = useSubjectMenuGroupItems(subject);
69
- return /* @__PURE__ */ React.createElement(MenuProvider, menuProps, /* @__PURE__ */ React.createElement(DropdownMenu.Root, null, /* @__PURE__ */ React.createElement(DropdownMenu.Trigger, {
70
- asChild: true
71
- }, /* @__PURE__ */ React.createElement(IconButton, {
72
- iconOnly: true,
73
- variant: "ghost",
74
- icon: "ph--dots-three-vertical--bold",
75
- label: t("more options label"),
76
- ...props
77
- }))));
78
- } finally {
79
- _effect.f();
80
- }
81
- };
82
-
83
- // src/components/ContactCard.tsx
84
- var ContactCard = ({ children, subject, onOrgClick, role }) => {
85
- var _effect = _useSignals2();
86
- try {
87
- const { fullName, image, organization, emails } = subject;
88
- const organizationName = organization && typeof organization === "object" ? organization.target?.name : organization;
89
- return /* @__PURE__ */ React2.createElement(Card.SurfaceRoot, {
90
- role
91
- }, /* @__PURE__ */ React2.createElement(Avatar.Root, null, /* @__PURE__ */ React2.createElement(Card.Text, {
92
- role: "group",
93
- classNames: "grid gap-3 grid-cols-[min-content_1fr]"
94
- }, /* @__PURE__ */ React2.createElement(Avatar.Content, {
95
- imgSrc: image,
96
- icon: "ph--user--regular",
97
- size: 16,
98
- hue: "neutral"
99
- }), /* @__PURE__ */ React2.createElement("div", {
100
- role: "none",
101
- className: "bs-min self-center flex items-center"
102
- }, /* @__PURE__ */ React2.createElement(Avatar.Label, {
103
- asChild: true
104
- }, /* @__PURE__ */ React2.createElement("h2", {
105
- className: mx(cardHeading, "grow")
106
- }, fullName)), /* @__PURE__ */ React2.createElement(CardSubjectMenu, {
107
- subject
108
- })))), organizationName && /* @__PURE__ */ React2.createElement(Card.Chrome, null, typeof organization === "object" && onOrgClick ? /* @__PURE__ */ React2.createElement(Button, {
109
- variant: "ghost",
110
- classNames: "gap-2 text-start",
111
- onClick: () => onOrgClick(organization.target)
112
- }, /* @__PURE__ */ React2.createElement(Icon, {
113
- icon: "ph--buildings--regular",
114
- size: 5,
115
- classNames: "text-subdued"
116
- }), /* @__PURE__ */ React2.createElement("span", {
117
- className: "min-is-0 flex-1 truncate"
118
- }, organizationName), /* @__PURE__ */ React2.createElement(Icon, {
119
- icon: "ph--arrow-right--regular"
120
- })) : /* @__PURE__ */ React2.createElement("p", {
121
- className: "dx-button gap-2",
122
- "data-variant": "ghost"
123
- }, /* @__PURE__ */ React2.createElement(Icon, {
124
- icon: "ph--buildings--regular",
125
- size: 5,
126
- classNames: "text-subdued"
127
- }), /* @__PURE__ */ React2.createElement("span", {
128
- className: "min-is-0 flex-1 truncate"
129
- }, organizationName))), emails?.length && /* @__PURE__ */ React2.createElement("dl", {
130
- className: mx(cardText, "grid gap-2 grid-cols-[min-content_1fr] [&_dt]:text-subdued [&_dt]:pbs-0.5 [&_dd]:min-is-0")
131
- }, emails?.length && emails.map(({ label, value }) => /* @__PURE__ */ React2.createElement(Fragment, {
132
- key: value
133
- }, /* @__PURE__ */ React2.createElement("dt", null, /* @__PURE__ */ React2.createElement(Icon, {
134
- icon: "ph--at--regular",
135
- size: 5
136
- })), /* @__PURE__ */ React2.createElement("dd", {
137
- key: value,
138
- className: "break-words"
139
- }, value)))), children);
140
- } finally {
141
- _effect.f();
142
- }
143
- };
144
-
145
- // src/components/OrganizationCard.tsx
146
- import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
147
- import React3 from "react";
148
- import { Icon as Icon2 } from "@dxos/react-ui";
149
- import { Card as Card2, cardNoSpacing, cardSpacing } from "@dxos/react-ui-stack";
150
- import { mx as mx2 } from "@dxos/react-ui-theme";
151
- var OrganizationCard = ({ children, subject, role }) => {
152
- var _effect = _useSignals3();
153
- try {
154
- const { name, image, description, website } = subject;
155
- return /* @__PURE__ */ React3.createElement(Card2.SurfaceRoot, {
156
- role
157
- }, /* @__PURE__ */ React3.createElement(Card2.Poster, {
158
- alt: name,
159
- ...image ? {
160
- image
161
- } : {
162
- icon: "ph--building-office--regular"
163
- }
164
- }), /* @__PURE__ */ React3.createElement("div", {
165
- role: "none",
166
- className: mx2("flex items-center gap-2", cardSpacing)
167
- }, /* @__PURE__ */ React3.createElement(Card2.Heading, {
168
- classNames: cardNoSpacing
169
- }, name), /* @__PURE__ */ React3.createElement(CardSubjectMenu, {
170
- subject
171
- })), description && /* @__PURE__ */ React3.createElement(Card2.Text, {
172
- classNames: "line-clamp-2"
173
- }, description), website && /* @__PURE__ */ React3.createElement(Card2.Chrome, null, /* @__PURE__ */ React3.createElement("a", {
174
- className: "dx-button dx-focus-ring gap-2",
175
- "data-variant": "ghost",
176
- href: website,
177
- target: "_blank",
178
- rel: "noreferrer"
179
- }, /* @__PURE__ */ React3.createElement(Icon2, {
180
- icon: "ph--link--regular",
181
- size: 5,
182
- classNames: "text-subdued"
183
- }), /* @__PURE__ */ React3.createElement("span", {
184
- className: "grow"
185
- }, website), /* @__PURE__ */ React3.createElement(Icon2, {
186
- icon: "ph--arrow-square-out--regular"
187
- }))), children);
188
- } finally {
189
- _effect.f();
190
- }
191
- };
192
-
193
- // src/components/ProjectCard.tsx
194
- import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
195
- import React4 from "react";
196
- import { Card as Card3, cardNoSpacing as cardNoSpacing2, cardSpacing as cardSpacing2 } from "@dxos/react-ui-stack";
197
- import { mx as mx3 } from "@dxos/react-ui-theme";
198
- var ProjectCard = ({ subject, role }) => {
199
- var _effect = _useSignals4();
200
- try {
201
- const { name, image, description } = subject;
202
- return /* @__PURE__ */ React4.createElement(Card3.SurfaceRoot, {
203
- role
204
- }, image && /* @__PURE__ */ React4.createElement(Card3.Poster, {
205
- image,
206
- alt: name,
207
- aspect: "auto"
208
- }), /* @__PURE__ */ React4.createElement("div", {
209
- role: "none",
210
- className: mx3("flex items-center gap-2", cardSpacing2)
211
- }, /* @__PURE__ */ React4.createElement(Card3.Heading, {
212
- classNames: cardNoSpacing2
213
- }, name), /* @__PURE__ */ React4.createElement(CardSubjectMenu, {
214
- subject
215
- })), description && /* @__PURE__ */ React4.createElement(Card3.Text, {
216
- classNames: "line-clamp-2"
217
- }, description));
218
- } finally {
219
- _effect.f();
220
- }
221
- };
222
-
223
- // src/capabilities/react-surface.tsx
224
- var react_surface_default = () => contributes(Capabilities.ReactSurface, [
225
- //
226
- // Specific schema types.
227
- //
228
- createSurface({
229
- id: `${PREVIEW_PLUGIN}/schema-popover--contact`,
230
- role: [
231
- "card--popover",
232
- "card--intrinsic",
233
- "card--transclusion",
234
- "card--extrinsic",
235
- "card"
236
- ],
237
- filter: (data) => Obj.instanceOf(DataType.Person, data.subject),
238
- component: ({ data, role }) => {
239
- const { dispatch } = useIntentDispatcher();
240
- const space = getSpace(data.subject);
241
- const defaultSpace = useSpace();
242
- const currentSpaceOrgs = useQuery(space, Filter.type(DataType.Organization));
243
- const currentSpaceViews = useQuery(space, Filter.type(DataType.View));
244
- const defaultSpaceViews = useQuery(defaultSpace, Filter.type(DataType.View));
245
- const currentSpaceOrgTable = currentSpaceViews.find((view) => view.query.typename === DataType.Organization.typename && Obj.instanceOf(TableView, view.presentation.target));
246
- const defaultSpaceOrgTable = defaultSpaceViews.find((view) => view.query.typename === DataType.Organization.typename && Obj.instanceOf(TableView, view.presentation.target));
247
- const handleOrgClick = useCallback((org) => Effect.gen(function* () {
248
- const view = currentSpaceOrgs.includes(org) ? currentSpaceOrgTable : defaultSpaceOrgTable;
249
- yield* dispatch(createIntent(LayoutAction.UpdatePopover, {
250
- part: "popover",
251
- options: {
252
- state: false,
253
- anchorId: ""
254
- }
255
- }));
256
- if (view) {
257
- const id = fullyQualifiedId(view);
258
- yield* dispatch(createIntent(LayoutAction.Open, {
259
- part: "main",
260
- subject: [
261
- id
262
- ],
263
- options: {
264
- workspace: space?.id
265
- }
266
- }));
267
- yield* dispatch(createIntent(DeckAction.ChangeCompanion, {
268
- primary: id,
269
- companion: [
270
- id,
271
- "selected-objects"
272
- ].join(ATTENDABLE_PATH_SEPARATOR)
273
- }));
274
- yield* dispatch(createIntent(AttentionAction.Select, {
275
- contextId: id,
276
- selection: {
277
- mode: "multi",
278
- ids: [
279
- org.id
280
- ]
281
- }
282
- }));
283
- }
284
- }).pipe(Effect.runPromise), [
285
- dispatch,
286
- currentSpaceOrgs,
287
- currentSpaceOrgTable,
288
- defaultSpaceOrgTable
289
- ]);
290
- return /* @__PURE__ */ React5.createElement(ContactCard, {
291
- role,
292
- subject: data.subject,
293
- onOrgClick: handleOrgClick
294
- }, role === "card--popover" && /* @__PURE__ */ React5.createElement(Surface, {
295
- role: "related",
296
- data
297
- }));
298
- }
299
- }),
300
- createSurface({
301
- id: `${PREVIEW_PLUGIN}/schema-popover--organization`,
302
- role: [
303
- "card--popover",
304
- "card--intrinsic",
305
- "card--transclusion",
306
- "card--extrinsic",
307
- "card"
308
- ],
309
- filter: (data) => Obj.instanceOf(DataType.Organization, data.subject),
310
- component: ({ data, role }) => /* @__PURE__ */ React5.createElement(OrganizationCard, {
311
- role,
312
- subject: data.subject
313
- }, role === "card--popover" && /* @__PURE__ */ React5.createElement(Surface, {
314
- role: "related",
315
- data
316
- }))
317
- }),
318
- createSurface({
319
- id: `${PREVIEW_PLUGIN}/schema-popover--project`,
320
- role: [
321
- "card--popover",
322
- "card--intrinsic",
323
- "card--transclusion",
324
- "card--extrinsic",
325
- "card"
326
- ],
327
- filter: (data) => Obj.instanceOf(DataType.Project, data.subject),
328
- component: ({ data, role }) => /* @__PURE__ */ React5.createElement(ProjectCard, {
329
- subject: data.subject,
330
- role
331
- })
332
- }),
333
- //
334
- // Fallback for any object.
335
- //
336
- createSurface({
337
- id: `${PREVIEW_PLUGIN}/fallback-popover`,
338
- role: [
339
- "card--popover",
340
- "card--intrinsic",
341
- "card--transclusion",
342
- "card--extrinsic",
343
- "card"
344
- ],
345
- position: "fallback",
346
- filter: (data) => Obj.isObject(data.subject),
347
- component: ({ data, role }) => {
348
- const schema = getSchema(data.subject);
349
- const { t } = useTranslation2(PREVIEW_PLUGIN);
350
- if (!schema) {
351
- return /* @__PURE__ */ React5.createElement("p", {
352
- className: mx4(descriptionMessage)
353
- }, t("unable to create preview message"));
354
- }
355
- const handleSave = useCallback((values, { changed }) => {
356
- const changedPaths = Object.keys(changed).filter((path) => changed[path]);
357
- for (const path of changedPaths) {
358
- const value = values[path];
359
- setValue(data.subject, path, value);
360
- }
361
- }, []);
362
- return /* @__PURE__ */ React5.createElement(Card4.SurfaceRoot, {
363
- role
364
- }, /* @__PURE__ */ React5.createElement(Form, {
365
- schema,
366
- values: data.subject,
367
- readonly: role === "card--popover",
368
- onSave: handleSave,
369
- autoSave: true,
370
- ...role === "card--intrinsic" && {
371
- outerSpacing: "blockStart-0"
372
- }
373
- }));
374
- }
375
- })
376
- ]);
377
- export {
378
- react_surface_default as default
379
- };
380
- //# sourceMappingURL=react-surface-4C44XCLH.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/react-surface.tsx", "../../../src/components/ContactCard.tsx", "../../../src/components/CardSubjectMenu.tsx", "../../../src/components/OrganizationCard.tsx", "../../../src/components/ProjectCard.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Effect } from 'effect';\nimport React, { useCallback } from 'react';\n\nimport {\n Capabilities,\n LayoutAction,\n Surface,\n contributes,\n createIntent,\n createSurface,\n useIntentDispatcher,\n} from '@dxos/app-framework';\nimport { fullyQualifiedId, getSchema, getSpace } from '@dxos/client/echo';\nimport { Filter, Obj } from '@dxos/echo';\nimport { type JsonPath, setValue } from '@dxos/echo-schema';\nimport { AttentionAction } from '@dxos/plugin-attention/types';\nimport { ATTENDABLE_PATH_SEPARATOR, DeckAction } from '@dxos/plugin-deck/types';\nimport { useQuery, useSpace } from '@dxos/react-client/echo';\nimport { useTranslation } from '@dxos/react-ui';\nimport { Form } from '@dxos/react-ui-form';\nimport { Card } from '@dxos/react-ui-stack';\nimport { TableView } from '@dxos/react-ui-table/types';\nimport { descriptionMessage, mx } from '@dxos/react-ui-theme';\nimport { DataType } from '@dxos/schema';\n\nimport { ContactCard, OrganizationCard, ProjectCard } from '../components';\nimport { PREVIEW_PLUGIN } from '../meta';\n\nexport default () =>\n contributes(Capabilities.ReactSurface, [\n //\n // Specific schema types.\n //\n createSurface({\n id: `${PREVIEW_PLUGIN}/schema-popover--contact`,\n role: ['card--popover', 'card--intrinsic', 'card--transclusion', 'card--extrinsic', 'card'],\n filter: (data): data is { subject: DataType.Person } => Obj.instanceOf(DataType.Person, data.subject),\n component: ({ data, role }) => {\n const { dispatch } = useIntentDispatcher();\n const space = getSpace(data.subject);\n const defaultSpace = useSpace();\n\n const currentSpaceOrgs = useQuery(space, Filter.type(DataType.Organization));\n const currentSpaceViews = useQuery(space, Filter.type(DataType.View));\n const defaultSpaceViews = useQuery(defaultSpace, Filter.type(DataType.View));\n const currentSpaceOrgTable = currentSpaceViews.find(\n (view) =>\n view.query.typename === DataType.Organization.typename &&\n Obj.instanceOf(TableView, view.presentation.target),\n );\n const defaultSpaceOrgTable = defaultSpaceViews.find(\n (view) =>\n view.query.typename === DataType.Organization.typename &&\n Obj.instanceOf(TableView, view.presentation.target),\n );\n\n // TODO(wittjosiah): Generalized way of handling related objects navigation.\n const handleOrgClick = useCallback(\n (org: DataType.Organization) =>\n Effect.gen(function* () {\n const view = currentSpaceOrgs.includes(org) ? currentSpaceOrgTable : defaultSpaceOrgTable;\n yield* dispatch(\n createIntent(LayoutAction.UpdatePopover, {\n part: 'popover',\n options: {\n state: false,\n anchorId: '',\n },\n }),\n );\n if (view) {\n const id = fullyQualifiedId(view);\n yield* dispatch(\n createIntent(LayoutAction.Open, {\n part: 'main',\n subject: [id],\n options: { workspace: space?.id },\n }),\n );\n yield* dispatch(\n createIntent(DeckAction.ChangeCompanion, {\n primary: id,\n companion: [id, 'selected-objects'].join(ATTENDABLE_PATH_SEPARATOR),\n }),\n );\n yield* dispatch(\n createIntent(AttentionAction.Select, {\n contextId: id,\n selection: { mode: 'multi', ids: [org.id] },\n }),\n );\n }\n }).pipe(Effect.runPromise),\n [dispatch, currentSpaceOrgs, currentSpaceOrgTable, defaultSpaceOrgTable],\n );\n\n return (\n <ContactCard role={role} subject={data.subject} onOrgClick={handleOrgClick}>\n {role === 'card--popover' && <Surface role='related' data={data} />}\n </ContactCard>\n );\n },\n }),\n createSurface({\n id: `${PREVIEW_PLUGIN}/schema-popover--organization`,\n role: ['card--popover', 'card--intrinsic', 'card--transclusion', 'card--extrinsic', 'card'],\n filter: (data): data is { subject: DataType.Organization } => Obj.instanceOf(DataType.Organization, data.subject),\n component: ({ data, role }) => (\n <OrganizationCard role={role} subject={data.subject}>\n {role === 'card--popover' && <Surface role='related' data={data} />}\n </OrganizationCard>\n ),\n }),\n createSurface({\n id: `${PREVIEW_PLUGIN}/schema-popover--project`,\n role: ['card--popover', 'card--intrinsic', 'card--transclusion', 'card--extrinsic', 'card'],\n filter: (data): data is { subject: DataType.Project } => Obj.instanceOf(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: ['card--popover', 'card--intrinsic', 'card--transclusion', 'card--extrinsic', 'card'],\n position: 'fallback',\n filter: (data): data is { subject: Obj.Any } => Obj.isObject(data.subject),\n component: ({ data, role }) => {\n const schema = getSchema(data.subject);\n const { t } = useTranslation(PREVIEW_PLUGIN);\n if (!schema) {\n // TODO(burdon): Use Alert.\n return <p className={mx(descriptionMessage)}>{t('unable to create preview message')}</p>;\n }\n\n const handleSave = useCallback((values: any, { changed }: { changed: Record<string, boolean> }) => {\n const changedPaths = Object.keys(changed).filter((path) => changed[path]);\n for (const path of changedPaths) {\n const value = values[path];\n setValue(data.subject, path as JsonPath, value);\n }\n }, []);\n\n return (\n <Card.SurfaceRoot role={role}>\n <Form\n schema={schema}\n values={data.subject}\n readonly={role === 'card--popover'}\n onSave={handleSave}\n autoSave\n {...(role === 'card--intrinsic' && { outerSpacing: 'blockStart-0' })}\n />\n </Card.SurfaceRoot>\n );\n },\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { Fragment } from 'react';\n\nimport { Avatar, Button, Icon } from '@dxos/react-ui';\nimport { Card, cardHeading, cardText } from '@dxos/react-ui-stack';\nimport { mx } from '@dxos/react-ui-theme';\nimport { type DataType } from '@dxos/schema';\n\nimport { type PreviewProps } from '../types';\n\nimport { CardSubjectMenu } from './CardSubjectMenu';\n\nexport const ContactCard = ({\n children,\n subject,\n onOrgClick,\n role,\n}: PreviewProps<DataType.Person> & { onOrgClick?: (org: DataType.Organization) => void }) => {\n const { fullName, image, organization, emails } = subject;\n const organizationName = organization && typeof organization === 'object' ? organization.target?.name : organization;\n return (\n <Card.SurfaceRoot role={role}>\n <Avatar.Root>\n <Card.Text role='group' classNames='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 flex items-center'>\n <Avatar.Label asChild>\n <h2 className={mx(cardHeading, 'grow')}>{fullName}</h2>\n </Avatar.Label>\n <CardSubjectMenu subject={subject} />\n </div>\n </Card.Text>\n </Avatar.Root>\n {organizationName && (\n <Card.Chrome>\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 </Card.Chrome>\n )}\n {emails?.length && (\n <dl\n className={mx(\n cardText,\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 )}\n {children}\n </Card.SurfaceRoot>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport React from 'react';\n\n// import { useIntentDispatcher } from '@dxos/app-framework';\nimport { ACTION_TYPE } from '@dxos/app-graph';\nimport { type AnyEchoObject } from '@dxos/echo-schema';\nimport { IconButton, type IconButtonProps, useTranslation } from '@dxos/react-ui';\nimport { type ActionGraphProps, DropdownMenu, MenuProvider, useMenuActions } from '@dxos/react-ui-menu';\n\nconst useSubjectMenuGroupItems = (subject: AnyEchoObject) => {\n // const { dispatchPromise: dispatch } = useIntentDispatcher();\n const result: ActionGraphProps = { edges: [], nodes: [] };\n result.nodes.push({\n type: ACTION_TYPE,\n id: `${subject.id}/add-to-space`,\n data: () => console.log('[TO DO]', 'add object to space', subject),\n properties: {\n label: ['add object to space label', { ns: 'os' }],\n icon: 'ph--file-plus--regular',\n },\n });\n result.nodes.forEach(({ id: target }) => {\n result.edges.push({ source: 'root', target });\n });\n return useMenuActions(Rx.make(result));\n};\n\n/**\n * This is a generic menu for objects that tries to infer common actions.\n */\nexport const CardSubjectMenu = ({\n subject,\n ...props\n}: Omit<IconButtonProps, 'icon' | 'label'> & { subject: AnyEchoObject }) => {\n const { t } = useTranslation('os');\n const menuProps = useSubjectMenuGroupItems(subject);\n return (\n <MenuProvider {...menuProps}>\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <IconButton\n iconOnly\n variant='ghost'\n icon='ph--dots-three-vertical--bold'\n label={t('more options label')}\n {...props}\n />\n </DropdownMenu.Trigger>\n </DropdownMenu.Root>\n </MenuProvider>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Icon } from '@dxos/react-ui';\nimport { Card, cardNoSpacing, cardSpacing } from '@dxos/react-ui-stack';\nimport { mx } from '@dxos/react-ui-theme';\nimport { type DataType } from '@dxos/schema';\n\nimport { type PreviewProps } from '../types';\n\nimport { CardSubjectMenu } from './CardSubjectMenu';\n\nexport const OrganizationCard = ({ children, subject, role }: PreviewProps<DataType.Organization>) => {\n const { name, image, description, website } = subject;\n return (\n <Card.SurfaceRoot role={role}>\n <Card.Poster alt={name!} {...(image ? { image } : { icon: 'ph--building-office--regular' })} />\n <div role='none' className={mx('flex items-center gap-2', cardSpacing)}>\n <Card.Heading classNames={cardNoSpacing}>{name}</Card.Heading>\n <CardSubjectMenu subject={subject} />\n </div>\n {description && <Card.Text classNames='line-clamp-2'>{description}</Card.Text>}\n {website && (\n <Card.Chrome>\n <a\n className='dx-button dx-focus-ring gap-2'\n data-variant='ghost'\n href={website}\n target='_blank'\n rel='noreferrer'\n >\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 </Card.Chrome>\n )}\n {children}\n </Card.SurfaceRoot>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Card, cardNoSpacing, cardSpacing } from '@dxos/react-ui-stack';\nimport { mx } from '@dxos/react-ui-theme';\nimport { type DataType } from '@dxos/schema';\n\nimport { type PreviewProps } from '../types';\n\nimport { CardSubjectMenu } from './CardSubjectMenu';\n\nexport const ProjectCard = ({ subject, role }: PreviewProps<DataType.Project>) => {\n const { name, image, description } = subject;\n return (\n <Card.SurfaceRoot role={role}>\n {image && <Card.Poster image={image} alt={name} aspect='auto' />}\n <div role='none' className={mx('flex items-center gap-2', cardSpacing)}>\n <Card.Heading classNames={cardNoSpacing}>{name}</Card.Heading>\n <CardSubjectMenu subject={subject} />\n </div>\n {description && <Card.Text classNames='line-clamp-2'>{description}</Card.Text>}\n </Card.SurfaceRoot>\n );\n};\n"],
5
- "mappings": ";;;;;;AAIA,SAASA,cAAc;AACvB,OAAOC,UAASC,mBAAmB;AAEnC,SACEC,cACAC,cACAC,SACAC,aACAC,cACAC,eACAC,2BACK;AACP,SAASC,kBAAkBC,WAAWC,gBAAgB;AACtD,SAASC,QAAQC,WAAW;AAC5B,SAAwBC,gBAAgB;AACxC,SAASC,uBAAuB;AAChC,SAASC,2BAA2BC,kBAAkB;AACtD,SAASC,UAAUC,gBAAgB;AACnC,SAASC,kBAAAA,uBAAsB;AAC/B,SAASC,YAAY;AACrB,SAASC,QAAAA,aAAY;AACrB,SAASC,iBAAiB;AAC1B,SAASC,oBAAoBC,MAAAA,WAAU;AACvC,SAASC,gBAAgB;;;;ACvBzB,OAAOC,UAASC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AAWC,IAAGC,kBAAAA;WAAsBL,EAAE,kCAAA,CAAA;MAClD;AAEA,YAAMM,aAAa9C,YAAY,CAAC+C,QAAa,EAAEC,QAAO,MAAwC;AAC5F,cAAMC,eAAeC,OAAOC,KAAKH,OAAAA,EAAShF,OAAO,CAACoF,SAASJ,QAAQI,IAAAA,CAAK;AACxE,mBAAWA,QAAQH,cAAc;AAC/B,gBAAMI,QAAQN,OAAOK,IAAAA;AACrBE,mBAASrF,KAAKK,SAAS8E,MAAkBC,KAAAA;QAC3C;MACF,GAAG,CAAA,CAAE;AAEL,aACE,gBAAAxB,OAAA,cAAC0B,MAAKC,aAAW;QAACzF;SAChB,gBAAA8D,OAAA,cAAC4B,MAAAA;QACCnB;QACAS,QAAQ9E,KAAKK;QACboF,UAAU3F,SAAS;QACnB4F,QAAQb;QACRc,UAAAA;QACC,GAAI7F,SAAS,qBAAqB;UAAE8F,cAAc;QAAe;;IAI1E;EACF,CAAA;CACD;",
6
- "names": ["Effect", "React", "useCallback", "Capabilities", "LayoutAction", "Surface", "contributes", "createIntent", "createSurface", "useIntentDispatcher", "fullyQualifiedId", "getSchema", "getSpace", "Filter", "Obj", "setValue", "AttentionAction", "ATTENDABLE_PATH_SEPARATOR", "DeckAction", "useQuery", "useSpace", "useTranslation", "Form", "Card", "TableView", "descriptionMessage", "mx", "DataType", "React", "Fragment", "Avatar", "Button", "Icon", "Card", "cardHeading", "cardText", "mx", "Rx", "React", "ACTION_TYPE", "IconButton", "useTranslation", "DropdownMenu", "MenuProvider", "useMenuActions", "useSubjectMenuGroupItems", "subject", "result", "edges", "nodes", "push", "type", "ACTION_TYPE", "id", "data", "console", "log", "properties", "label", "ns", "icon", "forEach", "target", "source", "useMenuActions", "Rx", "make", "CardSubjectMenu", "props", "t", "useTranslation", "menuProps", "MenuProvider", "DropdownMenu", "Root", "Trigger", "asChild", "IconButton", "iconOnly", "variant", "ContactCard", "children", "subject", "onOrgClick", "role", "fullName", "image", "organization", "emails", "organizationName", "target", "name", "React", "Card", "SurfaceRoot", "Avatar", "Root", "Text", "classNames", "Content", "imgSrc", "icon", "size", "hue", "div", "className", "Label", "asChild", "h2", "mx", "cardHeading", "CardSubjectMenu", "Chrome", "Button", "variant", "onClick", "Icon", "span", "p", "data-variant", "length", "dl", "cardText", "map", "label", "value", "Fragment", "key", "dt", "dd", "React", "Icon", "Card", "cardNoSpacing", "cardSpacing", "mx", "OrganizationCard", "children", "subject", "role", "name", "image", "description", "website", "React", "Card", "SurfaceRoot", "Poster", "alt", "icon", "div", "className", "mx", "cardSpacing", "Heading", "classNames", "cardNoSpacing", "CardSubjectMenu", "Text", "Chrome", "a", "data-variant", "href", "target", "rel", "Icon", "size", "span", "React", "Card", "cardNoSpacing", "cardSpacing", "mx", "ProjectCard", "subject", "role", "name", "image", "description", "React", "Card", "SurfaceRoot", "Poster", "alt", "aspect", "div", "className", "mx", "cardSpacing", "Heading", "classNames", "cardNoSpacing", "CardSubjectMenu", "Text", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "PREVIEW_PLUGIN", "role", "filter", "data", "Obj", "instanceOf", "DataType", "Person", "subject", "component", "dispatch", "useIntentDispatcher", "space", "getSpace", "defaultSpace", "useSpace", "currentSpaceOrgs", "useQuery", "Filter", "type", "Organization", "currentSpaceViews", "View", "defaultSpaceViews", "currentSpaceOrgTable", "find", "view", "query", "typename", "TableView", "presentation", "target", "defaultSpaceOrgTable", "handleOrgClick", "useCallback", "org", "Effect", "gen", "includes", "createIntent", "LayoutAction", "UpdatePopover", "part", "options", "state", "anchorId", "fullyQualifiedId", "Open", "workspace", "DeckAction", "ChangeCompanion", "primary", "companion", "join", "ATTENDABLE_PATH_SEPARATOR", "AttentionAction", "Select", "contextId", "selection", "mode", "ids", "pipe", "runPromise", "React", "ContactCard", "onOrgClick", "Surface", "OrganizationCard", "Project", "ProjectCard", "position", "isObject", "schema", "getSchema", "t", "useTranslation", "p", "className", "mx", "descriptionMessage", "handleSave", "values", "changed", "changedPaths", "Object", "keys", "path", "value", "setValue", "Card", "SurfaceRoot", "Form", "readonly", "onSave", "autoSave", "outerSpacing"]
7
- }
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { type AnyEchoObject } from '@dxos/echo-schema';
3
- import { type IconButtonProps } from '@dxos/react-ui';
4
- /**
5
- * This is a generic menu for objects that tries to infer common actions.
6
- */
7
- export declare const CardSubjectMenu: ({ subject, ...props }: Omit<IconButtonProps, "icon" | "label"> & {
8
- subject: AnyEchoObject;
9
- }) => React.JSX.Element;
10
- //# sourceMappingURL=CardSubjectMenu.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CardSubjectMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/CardSubjectMenu.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAc,KAAK,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAqBlF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,uBAG7B,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG;IAAE,OAAO,EAAE,aAAa,CAAA;CAAE,sBAkBtE,CAAC"}
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { type DataType } from '@dxos/schema';
3
- import { type PreviewProps } from '../types';
4
- export declare const ContactCard: ({ children, subject, onOrgClick, role, }: PreviewProps<DataType.Person> & {
5
- onOrgClick?: (org: DataType.Organization) => void;
6
- }) => React.JSX.Element;
7
- //# sourceMappingURL=ContactCard.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContactCard.d.ts","sourceRoot":"","sources":["../../../../src/components/ContactCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7C,eAAO,MAAM,WAAW,GAAI,0CAKzB,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG;IAAE,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,CAAC,YAAY,KAAK,IAAI,CAAA;CAAE,sBAuDvF,CAAC"}
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { type DataType } from '@dxos/schema';
3
- import { type PreviewProps } from '../types';
4
- export declare const OrganizationCard: ({ children, subject, role }: PreviewProps<DataType.Organization>) => React.JSX.Element;
5
- //# sourceMappingURL=OrganizationCard.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OrganizationCard.d.ts","sourceRoot":"","sources":["../../../../src/components/OrganizationCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7C,eAAO,MAAM,gBAAgB,GAAI,6BAA6B,YAAY,CAAC,QAAQ,CAAC,YAAY,CAAC,sBA4BhG,CAAC"}
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { type DataType } from '@dxos/schema';
3
- import { type PreviewProps } from '../types';
4
- export declare const ProjectCard: ({ subject, role }: PreviewProps<DataType.Project>) => React.JSX.Element;
5
- //# sourceMappingURL=ProjectCard.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProjectCard.d.ts","sourceRoot":"","sources":["../../../../src/components/ProjectCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7C,eAAO,MAAM,WAAW,GAAI,mBAAmB,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,sBAY5E,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from './ContactCard';
2
- export * from './OrganizationCard';
3
- export * from './ProjectCard';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC"}
@@ -1,7 +0,0 @@
1
- import { type Schema } from 'effect';
2
- import { type PropsWithChildren } from 'react';
3
- export type PreviewProps<T extends Schema.Schema.Type<any>> = PropsWithChildren<{
4
- subject: T;
5
- role?: string;
6
- }>;
7
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,iBAAiB,CAAC;IAC9E,OAAO,EAAE,CAAC,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC,CAAC"}