@dxos/plugin-preview 0.8.2-main.f11618f → 0.8.2-staging.42af850
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.
- package/dist/lib/browser/chunk-B2VK6GFP.mjs +28 -0
- package/dist/lib/browser/chunk-B2VK6GFP.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +20 -312
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/preview-popover-S3OY3CFZ.mjs +65 -0
- package/dist/lib/browser/preview-popover-S3OY3CFZ.mjs.map +7 -0
- package/dist/lib/browser/react-surface-XDHP6EN7.mjs +285 -0
- package/dist/lib/browser/react-surface-XDHP6EN7.mjs.map +7 -0
- package/dist/lib/node/chunk-VFSOM2B4.cjs +55 -0
- package/dist/lib/node/chunk-VFSOM2B4.cjs.map +7 -0
- package/dist/lib/node/index.cjs +22 -316
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/preview-popover-GPBOHU5E.cjs +84 -0
- package/dist/lib/node/preview-popover-GPBOHU5E.cjs.map +7 -0
- package/dist/lib/node/react-surface-CPAQ7ZYR.cjs +297 -0
- package/dist/lib/node/react-surface-CPAQ7ZYR.cjs.map +7 -0
- package/dist/lib/node-esm/chunk-PYKIS3N7.mjs +30 -0
- package/dist/lib/node-esm/chunk-PYKIS3N7.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +20 -313
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/preview-popover-EQAEYYDT.mjs +67 -0
- package/dist/lib/node-esm/preview-popover-EQAEYYDT.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-QJRHN4PN.mjs +286 -0
- package/dist/lib/node-esm/react-surface-QJRHN4PN.mjs.map +7 -0
- package/dist/types/src/Preview.stories.d.ts +22 -78
- package/dist/types/src/Preview.stories.d.ts.map +1 -1
- package/dist/types/src/PreviewPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +3 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/preview-popover.d.ts +4 -0
- package/dist/types/src/capabilities/preview-popover.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +4 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/ContactCard.d.ts +3 -3
- package/dist/types/src/components/ContactCard.d.ts.map +1 -1
- package/dist/types/src/components/OrganizationCard.d.ts +2 -2
- package/dist/types/src/components/OrganizationCard.d.ts.map +1 -1
- package/dist/types/src/components/ProjectCard.d.ts +2 -2
- package/dist/types/src/components/ProjectCard.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +1 -1
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +23 -20
- package/src/Preview.stories.tsx +11 -5
- package/src/PreviewPlugin.tsx +7 -185
- package/src/capabilities/index.ts +8 -0
- package/src/capabilities/preview-popover.ts +65 -0
- package/src/capabilities/react-surface.tsx +126 -0
- package/src/components/ContactCard.tsx +2 -2
- package/src/components/OrganizationCard.tsx +10 -4
- package/src/components/ProjectCard.tsx +6 -2
- package/src/types.ts +1 -1
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
PREVIEW_PLUGIN,
|
|
4
|
+
defaultCard,
|
|
5
|
+
kanbanCardWithoutPoster,
|
|
6
|
+
popoverCard,
|
|
7
|
+
previewChrome,
|
|
8
|
+
previewProse,
|
|
9
|
+
previewTitle
|
|
10
|
+
} from "./chunk-PYKIS3N7.mjs";
|
|
11
|
+
|
|
12
|
+
// packages/plugins/plugin-preview/src/capabilities/react-surface.tsx
|
|
13
|
+
import React4, { useCallback } from "react";
|
|
14
|
+
import { Capabilities, LayoutAction, Surface, contributes, createIntent, createSurface, useIntentDispatcher } from "@dxos/app-framework";
|
|
15
|
+
import { Filter, fullyQualifiedId, getSchema, getSpace, isEchoObject } from "@dxos/client/echo";
|
|
16
|
+
import { isInstanceOf, setValue } from "@dxos/echo-schema";
|
|
17
|
+
import { useTranslation } from "@dxos/react-ui";
|
|
18
|
+
import { Form } from "@dxos/react-ui-form";
|
|
19
|
+
import { TableType } from "@dxos/react-ui-table";
|
|
20
|
+
import { descriptionMessage } from "@dxos/react-ui-theme";
|
|
21
|
+
import { DataType } from "@dxos/schema";
|
|
22
|
+
|
|
23
|
+
// packages/plugins/plugin-preview/src/components/ContactCard.tsx
|
|
24
|
+
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
25
|
+
import React, { Fragment } from "react";
|
|
26
|
+
import { Icon, Avatar, Button } from "@dxos/react-ui";
|
|
27
|
+
import { mx } from "@dxos/react-ui-theme";
|
|
28
|
+
var ContactCard = ({ children, classNames, role, subject: { fullName, image, organization, emails }, onOrgClick }) => {
|
|
29
|
+
var _effect = _useSignals();
|
|
30
|
+
try {
|
|
31
|
+
const organizationName = organization && typeof organization === "object" ? organization.target?.name : organization;
|
|
32
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
33
|
+
role: "none",
|
|
34
|
+
className: mx(role === "popover" ? popoverCard : defaultCard, classNames)
|
|
35
|
+
}, /* @__PURE__ */ React.createElement(Avatar.Root, null, /* @__PURE__ */ React.createElement("div", {
|
|
36
|
+
role: "group",
|
|
37
|
+
className: mx(previewProse, "grid gap-3 grid-cols-[min-content_1fr]")
|
|
38
|
+
}, /* @__PURE__ */ React.createElement(Avatar.Content, {
|
|
39
|
+
imgSrc: image,
|
|
40
|
+
icon: "ph--user--regular",
|
|
41
|
+
size: 16,
|
|
42
|
+
hue: "neutral"
|
|
43
|
+
}), /* @__PURE__ */ React.createElement("div", {
|
|
44
|
+
role: "none",
|
|
45
|
+
className: "bs-min self-center"
|
|
46
|
+
}, /* @__PURE__ */ React.createElement(Avatar.Label, {
|
|
47
|
+
asChild: true
|
|
48
|
+
}, /* @__PURE__ */ React.createElement("h2", {
|
|
49
|
+
className: previewTitle
|
|
50
|
+
}, fullName))))), organizationName && /* @__PURE__ */ React.createElement("div", {
|
|
51
|
+
role: "none",
|
|
52
|
+
className: previewChrome
|
|
53
|
+
}, typeof organization === "object" && onOrgClick ? /* @__PURE__ */ React.createElement(Button, {
|
|
54
|
+
variant: "ghost",
|
|
55
|
+
classNames: "gap-2 text-start",
|
|
56
|
+
onClick: () => onOrgClick(organization.target)
|
|
57
|
+
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
58
|
+
icon: "ph--buildings--regular",
|
|
59
|
+
size: 5,
|
|
60
|
+
classNames: "text-subdued"
|
|
61
|
+
}), /* @__PURE__ */ React.createElement("span", {
|
|
62
|
+
className: "min-is-0 flex-1 truncate"
|
|
63
|
+
}, organizationName), /* @__PURE__ */ React.createElement(Icon, {
|
|
64
|
+
icon: "ph--arrow-right--regular"
|
|
65
|
+
})) : /* @__PURE__ */ React.createElement("p", {
|
|
66
|
+
className: "dx-button gap-2",
|
|
67
|
+
"data-variant": "ghost"
|
|
68
|
+
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
69
|
+
icon: "ph--buildings--regular",
|
|
70
|
+
size: 5,
|
|
71
|
+
classNames: "text-subdued"
|
|
72
|
+
}), /* @__PURE__ */ React.createElement("span", {
|
|
73
|
+
className: "min-is-0 flex-1 truncate"
|
|
74
|
+
}, organizationName))), /* @__PURE__ */ React.createElement("dl", {
|
|
75
|
+
className: mx(previewProse, "grid gap-2 grid-cols-[min-content_1fr] [&_dt]:text-subdued [&_dt]:pbs-0.5 [&_dd]:min-is-0")
|
|
76
|
+
}, emails?.length && emails.map(({ label, value }) => /* @__PURE__ */ React.createElement(Fragment, {
|
|
77
|
+
key: value
|
|
78
|
+
}, /* @__PURE__ */ React.createElement("dt", null, /* @__PURE__ */ React.createElement(Icon, {
|
|
79
|
+
icon: "ph--at--regular",
|
|
80
|
+
size: 5
|
|
81
|
+
})), /* @__PURE__ */ React.createElement("dd", {
|
|
82
|
+
key: value,
|
|
83
|
+
className: "break-words"
|
|
84
|
+
}, value)))), children);
|
|
85
|
+
} finally {
|
|
86
|
+
_effect.f();
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// packages/plugins/plugin-preview/src/components/OrganizationCard.tsx
|
|
91
|
+
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
92
|
+
import React2 from "react";
|
|
93
|
+
import { Icon as Icon2 } from "@dxos/react-ui";
|
|
94
|
+
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
95
|
+
var OrganizationCard = ({ children, classNames, subject: { name, image, description, website }, role }) => {
|
|
96
|
+
var _effect = _useSignals2();
|
|
97
|
+
try {
|
|
98
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
99
|
+
role: "none",
|
|
100
|
+
className: mx2(role === "popover" ? popoverCard : defaultCard, classNames)
|
|
101
|
+
}, image ? /* @__PURE__ */ React2.createElement("img", {
|
|
102
|
+
className: "aspect-video object-cover is-full bs-auto",
|
|
103
|
+
src: image,
|
|
104
|
+
alt: name
|
|
105
|
+
}) : /* @__PURE__ */ React2.createElement("div", {
|
|
106
|
+
role: "image",
|
|
107
|
+
className: "grid aspect-video place-items-center bg-inputSurface text-subdued"
|
|
108
|
+
}, /* @__PURE__ */ React2.createElement(Icon2, {
|
|
109
|
+
icon: "ph--building-office--regular",
|
|
110
|
+
size: 10
|
|
111
|
+
})), /* @__PURE__ */ React2.createElement("h2", {
|
|
112
|
+
className: mx2(previewTitle, previewProse)
|
|
113
|
+
}, name), description && /* @__PURE__ */ React2.createElement("p", {
|
|
114
|
+
className: mx2(previewProse, "line-clamp-2")
|
|
115
|
+
}, description), website && /* @__PURE__ */ React2.createElement("div", {
|
|
116
|
+
role: "none",
|
|
117
|
+
className: previewChrome
|
|
118
|
+
}, /* @__PURE__ */ React2.createElement("a", {
|
|
119
|
+
className: "dx-button dx-focus-ring gap-2",
|
|
120
|
+
"data-variant": "ghost",
|
|
121
|
+
href: website,
|
|
122
|
+
target: "_blank",
|
|
123
|
+
rel: "noreferrer"
|
|
124
|
+
}, /* @__PURE__ */ React2.createElement(Icon2, {
|
|
125
|
+
icon: "ph--link--regular",
|
|
126
|
+
size: 5,
|
|
127
|
+
classNames: "text-subdued"
|
|
128
|
+
}), /* @__PURE__ */ React2.createElement("span", {
|
|
129
|
+
className: "grow"
|
|
130
|
+
}, website), /* @__PURE__ */ React2.createElement(Icon2, {
|
|
131
|
+
icon: "ph--arrow-square-out--regular"
|
|
132
|
+
}))), children);
|
|
133
|
+
} finally {
|
|
134
|
+
_effect.f();
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
// packages/plugins/plugin-preview/src/components/ProjectCard.tsx
|
|
139
|
+
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
140
|
+
import React3 from "react";
|
|
141
|
+
import { mx as mx3 } from "@dxos/react-ui-theme";
|
|
142
|
+
var ProjectCard = ({ classNames, role, subject: { name, image, description } }) => {
|
|
143
|
+
var _effect = _useSignals3();
|
|
144
|
+
try {
|
|
145
|
+
return /* @__PURE__ */ React3.createElement("div", {
|
|
146
|
+
role: "none",
|
|
147
|
+
className: mx3(role === "popover" ? popoverCard : defaultCard, classNames)
|
|
148
|
+
}, image && /* @__PURE__ */ React3.createElement("img", {
|
|
149
|
+
className: "is-full bs-auto",
|
|
150
|
+
src: image,
|
|
151
|
+
alt: name
|
|
152
|
+
}), /* @__PURE__ */ React3.createElement("h2", {
|
|
153
|
+
className: mx3(previewTitle, "pli-3 mlb-3")
|
|
154
|
+
}, name), description && /* @__PURE__ */ React3.createElement("p", {
|
|
155
|
+
className: "pli-3 line-clamp-2 mlb-3"
|
|
156
|
+
}, description));
|
|
157
|
+
} finally {
|
|
158
|
+
_effect.f();
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
// packages/plugins/plugin-preview/src/capabilities/react-surface.tsx
|
|
163
|
+
var react_surface_default = () => contributes(Capabilities.ReactSurface, [
|
|
164
|
+
//
|
|
165
|
+
// Specific schema types.
|
|
166
|
+
//
|
|
167
|
+
createSurface({
|
|
168
|
+
id: `${PREVIEW_PLUGIN}/schema-popover--contact`,
|
|
169
|
+
role: [
|
|
170
|
+
"popover",
|
|
171
|
+
"card--kanban",
|
|
172
|
+
"card"
|
|
173
|
+
],
|
|
174
|
+
filter: (data) => isInstanceOf(DataType.Person, data.subject),
|
|
175
|
+
component: ({ data, role }) => {
|
|
176
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
177
|
+
const handleOrgClick = useCallback(async (org) => {
|
|
178
|
+
const space = getSpace(org);
|
|
179
|
+
const tablesQuery = await space?.db.query(Filter.type(TableType)).run();
|
|
180
|
+
const currentSpaceOrgTable = tablesQuery?.objects.find((table) => {
|
|
181
|
+
return table.view?.target?.query?.typename === DataType.Organization.typename;
|
|
182
|
+
});
|
|
183
|
+
await dispatch(createIntent(LayoutAction.UpdatePopover, {
|
|
184
|
+
part: "popover",
|
|
185
|
+
options: {
|
|
186
|
+
state: false,
|
|
187
|
+
anchorId: ""
|
|
188
|
+
}
|
|
189
|
+
}));
|
|
190
|
+
if (currentSpaceOrgTable) {
|
|
191
|
+
return dispatch(createIntent(LayoutAction.Open, {
|
|
192
|
+
part: "main",
|
|
193
|
+
subject: [
|
|
194
|
+
fullyQualifiedId(currentSpaceOrgTable)
|
|
195
|
+
],
|
|
196
|
+
options: {
|
|
197
|
+
workspace: space?.id
|
|
198
|
+
}
|
|
199
|
+
}));
|
|
200
|
+
}
|
|
201
|
+
}, [
|
|
202
|
+
dispatch
|
|
203
|
+
]);
|
|
204
|
+
return /* @__PURE__ */ React4.createElement(ContactCard, {
|
|
205
|
+
subject: data.subject,
|
|
206
|
+
onOrgClick: handleOrgClick,
|
|
207
|
+
role
|
|
208
|
+
}, role === "popover" && /* @__PURE__ */ React4.createElement(Surface, {
|
|
209
|
+
role: "related",
|
|
210
|
+
data
|
|
211
|
+
}));
|
|
212
|
+
}
|
|
213
|
+
}),
|
|
214
|
+
createSurface({
|
|
215
|
+
id: `${PREVIEW_PLUGIN}/schema-popover--organization`,
|
|
216
|
+
role: [
|
|
217
|
+
"popover",
|
|
218
|
+
"card--kanban",
|
|
219
|
+
"card"
|
|
220
|
+
],
|
|
221
|
+
filter: (data) => isInstanceOf(DataType.Organization, data.subject),
|
|
222
|
+
component: ({ data, role }) => /* @__PURE__ */ React4.createElement(OrganizationCard, {
|
|
223
|
+
subject: data.subject,
|
|
224
|
+
role
|
|
225
|
+
}, role === "popover" && /* @__PURE__ */ React4.createElement(Surface, {
|
|
226
|
+
role: "related",
|
|
227
|
+
data
|
|
228
|
+
}))
|
|
229
|
+
}),
|
|
230
|
+
createSurface({
|
|
231
|
+
id: `${PREVIEW_PLUGIN}/schema-popover--project`,
|
|
232
|
+
role: [
|
|
233
|
+
"popover",
|
|
234
|
+
"card--kanban",
|
|
235
|
+
"card"
|
|
236
|
+
],
|
|
237
|
+
filter: (data) => isInstanceOf(DataType.Project, data.subject),
|
|
238
|
+
component: ({ data, role }) => /* @__PURE__ */ React4.createElement(ProjectCard, {
|
|
239
|
+
subject: data.subject,
|
|
240
|
+
role
|
|
241
|
+
})
|
|
242
|
+
}),
|
|
243
|
+
//
|
|
244
|
+
// Fallback for any object.
|
|
245
|
+
//
|
|
246
|
+
createSurface({
|
|
247
|
+
id: `${PREVIEW_PLUGIN}/fallback-popover`,
|
|
248
|
+
role: [
|
|
249
|
+
"popover",
|
|
250
|
+
"card--kanban",
|
|
251
|
+
"card"
|
|
252
|
+
],
|
|
253
|
+
position: "fallback",
|
|
254
|
+
filter: (data) => isEchoObject(data.subject),
|
|
255
|
+
component: ({ data, role }) => {
|
|
256
|
+
const schema = getSchema(data.subject);
|
|
257
|
+
const { t } = useTranslation(PREVIEW_PLUGIN);
|
|
258
|
+
if (!schema) {
|
|
259
|
+
return /* @__PURE__ */ React4.createElement("p", {
|
|
260
|
+
className: descriptionMessage
|
|
261
|
+
}, t("unable to create preview message"));
|
|
262
|
+
}
|
|
263
|
+
const handleSave = useCallback((values, { changed }) => {
|
|
264
|
+
const changedPaths = Object.keys(changed).filter((path) => changed[path]);
|
|
265
|
+
for (const path of changedPaths) {
|
|
266
|
+
const value = values[path];
|
|
267
|
+
setValue(data.subject, path, value);
|
|
268
|
+
}
|
|
269
|
+
}, []);
|
|
270
|
+
return /* @__PURE__ */ React4.createElement(Form, {
|
|
271
|
+
schema,
|
|
272
|
+
values: data.subject,
|
|
273
|
+
readonly: role === "popover",
|
|
274
|
+
onSave: handleSave,
|
|
275
|
+
autoSave: true,
|
|
276
|
+
...role === "card--kanban" && {
|
|
277
|
+
classNames: kanbanCardWithoutPoster
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
})
|
|
282
|
+
]);
|
|
283
|
+
export {
|
|
284
|
+
react_surface_default as default
|
|
285
|
+
};
|
|
286
|
+
//# sourceMappingURL=react-surface-QJRHN4PN.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/react-surface.tsx", "../../../src/components/ContactCard.tsx", "../../../src/components/OrganizationCard.tsx", "../../../src/components/ProjectCard.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\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 { Filter, fullyQualifiedId, getSchema, getSpace, isEchoObject, type AnyLiveObject } from '@dxos/client/echo';\nimport { isInstanceOf, type JsonPath, setValue } from '@dxos/echo-schema';\nimport { useTranslation } from '@dxos/react-ui';\nimport { Form } from '@dxos/react-ui-form';\nimport { TableType } from '@dxos/react-ui-table';\nimport { descriptionMessage } from '@dxos/react-ui-theme';\nimport { DataType } from '@dxos/schema';\n\nimport { ContactCard, OrganizationCard, ProjectCard } from '../components';\nimport { PREVIEW_PLUGIN } from '../meta';\nimport { kanbanCardWithoutPoster } from '../types';\n\nexport default () =>\n contributes(Capabilities.ReactSurface, [\n //\n // Specific schema types.\n //\n createSurface({\n id: `${PREVIEW_PLUGIN}/schema-popover--contact`,\n role: ['popover', 'card--kanban', 'card'],\n filter: (data): data is { subject: DataType.Person } => isInstanceOf(DataType.Person, data.subject),\n component: ({ data, role }) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const handleOrgClick = useCallback(\n async (org: DataType.Organization) => {\n const space = getSpace(org);\n const tablesQuery = await space?.db.query(Filter.type(TableType)).run();\n const currentSpaceOrgTable = tablesQuery?.objects.find((table) => {\n return table.view?.target?.query?.typename === DataType.Organization.typename;\n });\n await dispatch(\n createIntent(LayoutAction.UpdatePopover, {\n part: 'popover',\n options: {\n state: false,\n anchorId: '',\n },\n }),\n );\n if (currentSpaceOrgTable) {\n return dispatch(\n createIntent(LayoutAction.Open, {\n part: 'main',\n subject: [fullyQualifiedId(currentSpaceOrgTable)],\n options: { workspace: space?.id },\n }),\n );\n }\n },\n [dispatch],\n );\n return (\n <ContactCard subject={data.subject} onOrgClick={handleOrgClick} role={role}>\n {role === 'popover' && <Surface role='related' data={data} />}\n </ContactCard>\n );\n },\n }),\n createSurface({\n id: `${PREVIEW_PLUGIN}/schema-popover--organization`,\n role: ['popover', 'card--kanban', 'card'],\n filter: (data): data is { subject: DataType.Organization } => isInstanceOf(DataType.Organization, data.subject),\n component: ({ data, role }) => (\n <OrganizationCard subject={data.subject} role={role}>\n {role === 'popover' && <Surface role='related' data={data} />}\n </OrganizationCard>\n ),\n }),\n createSurface({\n id: `${PREVIEW_PLUGIN}/schema-popover--project`,\n role: ['popover', 'card--kanban', 'card'],\n filter: (data): data is { subject: DataType.Project } => isInstanceOf(DataType.Project, data.subject),\n component: ({ data, role }) => <ProjectCard subject={data.subject} role={role} />,\n }),\n\n //\n // Fallback for any object.\n //\n createSurface({\n id: `${PREVIEW_PLUGIN}/fallback-popover`,\n role: ['popover', 'card--kanban', 'card'],\n position: 'fallback',\n filter: (data): data is { subject: AnyLiveObject<any> } => isEchoObject(data.subject),\n component: ({ data, role }) => {\n const schema = getSchema(data.subject);\n const { t } = useTranslation(PREVIEW_PLUGIN);\n if (!schema) {\n return <p className={descriptionMessage}>{t('unable to create preview message')}</p>;\n }\n\n 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 <Form\n schema={schema}\n values={data.subject}\n readonly={role === 'popover'}\n onSave={handleSave}\n autoSave\n {...(role === 'card--kanban' && { classNames: kanbanCardWithoutPoster })}\n />\n );\n },\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { Fragment } from 'react';\n\nimport { Icon, Avatar, Button } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-ui-theme';\nimport { type DataType } from '@dxos/schema';\n\nimport { type PreviewProps, popoverCard, previewTitle, previewProse, previewChrome, defaultCard } from '../types';\n\nexport const ContactCard = ({\n children,\n classNames,\n role,\n subject: { fullName, image, organization, emails },\n onOrgClick,\n}: PreviewProps<DataType.Person> & { onOrgClick?: (org: DataType.Organization) => void }) => {\n const organizationName = organization && typeof organization === 'object' ? organization.target?.name : organization;\n return (\n <div role='none' className={mx(role === 'popover' ? popoverCard : defaultCard, classNames)}>\n <Avatar.Root>\n <div role='group' className={mx(previewProse, 'grid gap-3 grid-cols-[min-content_1fr]')}>\n <Avatar.Content imgSrc={image} icon='ph--user--regular' size={16} hue='neutral' />\n <div role='none' className='bs-min self-center'>\n <Avatar.Label asChild>\n <h2 className={previewTitle}>{fullName}</h2>\n </Avatar.Label>\n </div>\n </div>\n </Avatar.Root>\n {organizationName && (\n <div role='none' className={previewChrome}>\n {typeof organization === 'object' && onOrgClick ? (\n <Button variant='ghost' classNames='gap-2 text-start' onClick={() => onOrgClick(organization.target!)}>\n <Icon icon='ph--buildings--regular' size={5} classNames='text-subdued' />\n <span className='min-is-0 flex-1 truncate'>{organizationName}</span>\n <Icon icon='ph--arrow-right--regular' />\n </Button>\n ) : (\n <p className='dx-button gap-2' data-variant='ghost'>\n <Icon icon='ph--buildings--regular' size={5} classNames='text-subdued' />\n <span className='min-is-0 flex-1 truncate'>{organizationName}</span>\n </p>\n )}\n </div>\n )}\n <dl\n className={mx(\n previewProse,\n 'grid gap-2 grid-cols-[min-content_1fr] [&_dt]:text-subdued [&_dt]:pbs-0.5 [&_dd]:min-is-0',\n )}\n >\n {emails?.length &&\n emails.map(({ label, value }) => (\n <Fragment key={value}>\n <dt>\n <Icon icon='ph--at--regular' size={5} />\n </dt>\n <dd key={value} className='break-words'>\n {value}\n </dd>\n </Fragment>\n ))}\n </dl>\n {children}\n </div>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Icon } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-ui-theme';\nimport { type DataType } from '@dxos/schema';\n\nimport { type PreviewProps, popoverCard, previewTitle, previewProse, previewChrome, defaultCard } from '../types';\n\nexport const OrganizationCard = ({\n children,\n classNames,\n subject: { name, image, description, website },\n role,\n}: PreviewProps<DataType.Organization>) => {\n return (\n <div role='none' className={mx(role === 'popover' ? popoverCard : defaultCard, classNames)}>\n {image ? (\n <img className='aspect-video object-cover is-full bs-auto' src={image} alt={name} />\n ) : (\n <div role='image' className='grid aspect-video place-items-center bg-inputSurface 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\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 </div>\n )}\n {children}\n </div>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { mx } from '@dxos/react-ui-theme';\nimport { type DataType } from '@dxos/schema';\n\nimport { type PreviewProps, popoverCard, previewTitle, defaultCard } from '../types';\n\nexport const ProjectCard = ({\n classNames,\n role,\n subject: { name, image, description },\n}: PreviewProps<DataType.Project>) => {\n return (\n <div role='none' className={mx(role === 'popover' ? popoverCard : defaultCard, classNames)}>\n {image && <img className='is-full bs-auto' src={image} alt={name} />}\n <h2 className={mx(previewTitle, 'pli-3 mlb-3')}>{name}</h2>\n {description && <p className='pli-3 line-clamp-2 mlb-3'>{description}</p>}\n </div>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAIA,OAAOA,UAASC,mBAAmB;AAEnC,SACEC,cACAC,cACAC,SACAC,aACAC,cACAC,eACAC,2BACK;AACP,SAASC,QAAQC,kBAAkBC,WAAWC,UAAUC,oBAAwC;AAChG,SAASC,cAA6BC,gBAAgB;AACtD,SAASC,sBAAsB;AAC/B,SAASC,YAAY;AACrB,SAASC,iBAAiB;AAC1B,SAASC,0BAA0B;AACnC,SAASC,gBAAgB;;;;ACjBzB,OAAOC,SAASC,gBAAgB;AAEhC,SAASC,MAAMC,QAAQC,cAAc;AACrC,SAASC,UAAU;AAKZ,IAAMC,cAAc,CAAC,EAC1BC,UACAC,YACAC,MACAC,SAAS,EAAEC,UAAUC,OAAOC,cAAcC,OAAM,GAChDC,WAAU,MAC4E;;;AACtF,UAAMC,mBAAmBH,gBAAgB,OAAOA,iBAAiB,WAAWA,aAAaI,QAAQC,OAAOL;AACxG,WACE,sBAAA,cAACM,OAAAA;MAAIV,MAAK;MAAOW,WAAWC,GAAGZ,SAAS,YAAYa,c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AAA,cAACa,KAAAA;UAAEC,WAAWC;WAAqBJ,EAAE,kCAAA,CAAA;MAC9C;AAEA,YAAMK,aAAa7C,YAAY,CAAC8C,QAAa,EAAEC,QAAO,MAAwC;AAC5F,cAAMC,eAAeC,OAAOC,KAAKH,OAAAA,EAAS1D,OAAO,CAAC8D,SAASJ,QAAQI,IAAAA,CAAK;AACxE,mBAAWA,QAAQH,cAAc;AAC/B,gBAAMI,QAAQN,OAAOK,IAAAA;AACrBE,mBAAS/D,KAAKI,SAASyD,MAAkBC,KAAAA;QAC3C;MACF,GAAG,CAAA,CAAE;AAEL,aACE,gBAAAvB,OAAA,cAACyB,MAAAA;QACChB;QACAQ,QAAQxD,KAAKI;QACb6D,UAAUnE,SAAS;QACnBoE,QAAQX;QACRY,UAAAA;QACC,GAAIrE,SAAS,kBAAkB;UAAEsE,YAAYC;QAAwB;;IAG5E;EACF,CAAA;CACD;",
|
|
6
|
+
"names": ["React", "useCallback", "Capabilities", "LayoutAction", "Surface", "contributes", "createIntent", "createSurface", "useIntentDispatcher", "Filter", "fullyQualifiedId", "getSchema", "getSpace", "isEchoObject", "isInstanceOf", "setValue", "useTranslation", "Form", "TableType", "descriptionMessage", "DataType", "React", "Fragment", "Icon", "Avatar", "Button", "mx", "ContactCard", "children", "classNames", "role", "subject", "fullName", "image", "organization", "emails", "onOrgClick", "organizationName", "target", "name", "div", "className", "mx", "popoverCard", "defaultCard", "Avatar", "Root", "previewProse", "Content", "imgSrc", "icon", "size", "hue", "Label", "asChild", "h2", "previewTitle", "previewChrome", "Button", "variant", "onClick", "Icon", "span", "p", "data-variant", "dl", "length", "map", "label", "value", "Fragment", "key", "dt", "dd", "React", "Icon", "mx", "OrganizationCard", "children", "classNames", "subject", "name", "image", "description", "website", "role", "React", "div", "className", "mx", "popoverCard", "defaultCard", "img", "src", "alt", "Icon", "icon", "size", "h2", "previewTitle", "previewProse", "p", "previewChrome", "a", "data-variant", "href", "target", "rel", "span", "React", "mx", "ProjectCard", "classNames", "role", "subject", "name", "image", "description", "React", "div", "className", "mx", "popoverCard", "defaultCard", "img", "src", "alt", "h2", "previewTitle", "p", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "PREVIEW_PLUGIN", "role", "filter", "data", "isInstanceOf", "DataType", "Person", "subject", "component", "dispatchPromise", "dispatch", "useIntentDispatcher", "handleOrgClick", "useCallback", "org", "space", "getSpace", "tablesQuery", "db", "query", "Filter", "type", "TableType", "run", "currentSpaceOrgTable", "objects", "find", "table", "view", "target", "typename", "Organization", "createIntent", "LayoutAction", "UpdatePopover", "part", "options", "state", "anchorId", "Open", "fullyQualifiedId", "workspace", "React", "ContactCard", "onOrgClick", "Surface", "OrganizationCard", "Project", "ProjectCard", "position", "isEchoObject", "schema", "getSchema", "t", "useTranslation", "p", "className", "descriptionMessage", "handleSave", "values", "changed", "changedPaths", "Object", "keys", "path", "value", "setValue", "Form", "readonly", "onSave", "autoSave", "classNames", "kanbanCardWithoutPoster"]
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@dxos-theme';
|
|
2
2
|
import { type Meta } from '@storybook/react';
|
|
3
3
|
import React, { type FC } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { DataType } from '@dxos/schema';
|
|
5
5
|
type StoryProps = {
|
|
6
6
|
Component: FC<{
|
|
7
7
|
subject: any;
|
|
@@ -13,12 +13,17 @@ declare const meta: Meta<StoryProps>;
|
|
|
13
13
|
export default meta;
|
|
14
14
|
export declare const ContactWithImage: {
|
|
15
15
|
args: {
|
|
16
|
-
Component: ({ children, classNames, role, subject: { fullName, image, organization, emails }, onOrgClick, }: import("./types").PreviewProps<
|
|
17
|
-
onOrgClick?: (org: Organization) => void;
|
|
16
|
+
Component: ({ children, classNames, role, subject: { fullName, image, organization, emails }, onOrgClick, }: import("./types").PreviewProps<DataType.Person> & {
|
|
17
|
+
onOrgClick?: (org: DataType.Organization) => void;
|
|
18
18
|
}) => React.JSX.Element;
|
|
19
19
|
icon: string;
|
|
20
20
|
subject: Omit<{
|
|
21
21
|
readonly id: string;
|
|
22
|
+
fields?: {
|
|
23
|
+
readonly label: string;
|
|
24
|
+
readonly category?: string | undefined;
|
|
25
|
+
readonly value: string;
|
|
26
|
+
}[] | undefined;
|
|
22
27
|
fullName?: string | undefined;
|
|
23
28
|
preferredName?: string | undefined;
|
|
24
29
|
nickname?: string | undefined;
|
|
@@ -62,118 +67,55 @@ export declare const ContactWithImage: {
|
|
|
62
67
|
readonly label?: string | undefined;
|
|
63
68
|
readonly value: string;
|
|
64
69
|
}[] | 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;
|
|
70
|
+
birthday?: string | undefined;
|
|
133
71
|
}, "id"> & {
|
|
134
72
|
id?: string;
|
|
135
73
|
} & {
|
|
136
74
|
id: string;
|
|
137
75
|
};
|
|
76
|
+
role: string;
|
|
138
77
|
};
|
|
139
78
|
};
|
|
140
79
|
export declare const ContactNoImage: {
|
|
141
80
|
args: {
|
|
142
|
-
Component: ({ children, classNames, role, subject: { fullName, image, organization, emails }, onOrgClick, }: import("./types").PreviewProps<
|
|
143
|
-
onOrgClick?: (org: Organization) => void;
|
|
81
|
+
Component: ({ children, classNames, role, subject: { fullName, image, organization, emails }, onOrgClick, }: import("./types").PreviewProps<DataType.Person> & {
|
|
82
|
+
onOrgClick?: (org: DataType.Organization) => void;
|
|
144
83
|
}) => React.JSX.Element;
|
|
145
84
|
icon: string;
|
|
146
85
|
subject: any;
|
|
86
|
+
role: string;
|
|
147
87
|
};
|
|
148
88
|
};
|
|
149
89
|
export declare const OrganizationWithImage: {
|
|
150
90
|
args: {
|
|
151
|
-
Component: ({ children, classNames, subject: { name, image, description, website }, role, }: import("./types").PreviewProps<Organization>) => React.JSX.Element;
|
|
91
|
+
Component: ({ children, classNames, subject: { name, image, description, website }, role, }: import("./types").PreviewProps<DataType.Organization>) => React.JSX.Element;
|
|
152
92
|
icon: string;
|
|
153
93
|
subject: Omit<{
|
|
154
94
|
readonly id: string;
|
|
155
95
|
image?: string | undefined;
|
|
96
|
+
status?: "active" | "prospect" | "qualified" | "commit" | "reject" | undefined;
|
|
156
97
|
name?: string | undefined;
|
|
157
98
|
description?: string | undefined;
|
|
158
|
-
status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
|
|
159
99
|
website?: string | undefined;
|
|
160
100
|
}, "id"> & {
|
|
161
101
|
id?: string;
|
|
162
102
|
} & {
|
|
163
103
|
id: string;
|
|
164
104
|
};
|
|
105
|
+
role: string;
|
|
165
106
|
};
|
|
166
107
|
};
|
|
167
108
|
export declare const OrganizationNoImage: {
|
|
168
109
|
args: {
|
|
169
|
-
Component: ({ children, classNames, subject: { name, image, description, website }, role, }: import("./types").PreviewProps<Organization>) => React.JSX.Element;
|
|
110
|
+
Component: ({ children, classNames, subject: { name, image, description, website }, role, }: import("./types").PreviewProps<DataType.Organization>) => React.JSX.Element;
|
|
170
111
|
icon: string;
|
|
171
112
|
subject: any;
|
|
113
|
+
role: string;
|
|
172
114
|
};
|
|
173
115
|
};
|
|
174
116
|
export declare const ProjectWithImage: {
|
|
175
117
|
args: {
|
|
176
|
-
Component: ({ classNames, role, subject: { name, image, description } }: import("./types").PreviewProps<Project>) => React.JSX.Element;
|
|
118
|
+
Component: ({ classNames, role, subject: { name, image, description }, }: import("./types").PreviewProps<DataType.Project>) => React.JSX.Element;
|
|
177
119
|
icon: string;
|
|
178
120
|
subject: Omit<{
|
|
179
121
|
readonly id: string;
|
|
@@ -185,13 +127,15 @@ export declare const ProjectWithImage: {
|
|
|
185
127
|
} & {
|
|
186
128
|
id: string;
|
|
187
129
|
};
|
|
130
|
+
role: string;
|
|
188
131
|
};
|
|
189
132
|
};
|
|
190
133
|
export declare const ProjectNoImage: {
|
|
191
134
|
args: {
|
|
192
|
-
Component: ({ classNames, role, subject: { name, image, description } }: import("./types").PreviewProps<Project>) => React.JSX.Element;
|
|
135
|
+
Component: ({ classNames, role, subject: { name, image, description }, }: import("./types").PreviewProps<DataType.Project>) => React.JSX.Element;
|
|
193
136
|
icon: string;
|
|
194
137
|
subject: any;
|
|
138
|
+
role: string;
|
|
195
139
|
};
|
|
196
140
|
};
|
|
197
141
|
//# sourceMappingURL=Preview.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Preview.stories.d.ts","sourceRoot":"","sources":["../../../src/Preview.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAMvC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Preview.stories.d.ts","sourceRoot":"","sources":["../../../src/Preview.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAMvC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAQxC,KAAK,UAAU,GAAG;IAChB,SAAS,EAAE,EAAE,CAAC;QAAE,OAAO,EAAE,GAAG,CAAA;KAAE,CAAC,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,GAAG,CAAC;CACd,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAAU,CAoB1B,CAAC;AAEF,eAAe,IAAI,CAAC;AA2CpB,eAAO,MAAM,gBAAgB;;;sBA3ElB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkFX,CAAC;AAEF,eAAO,MAAM,cAAc;;;sBApFhB,CAAC;;;;;;CA2FX,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;CAOjC,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;CAO/B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;CAO5B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;CAO1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreviewPlugin.d.ts","sourceRoot":"","sources":["../../../src/PreviewPlugin.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PreviewPlugin.d.ts","sourceRoot":"","sources":["../../../src/PreviewPlugin.tsx"],"names":[],"mappings":"AAYA,eAAO,MAAM,aAAa,4CAsBtB,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const PreviewPopover: (props?: import("@dxos/app-framework").PluginContext | undefined) => Promise<() => Promise<import("@dxos/app-framework").Capability<null> | import("@dxos/app-framework").AnyCapability[]>>;
|
|
2
|
+
export declare const ReactSurface: (props?: unknown) => Promise<() => Promise<import("@dxos/app-framework").Capability<import("@dxos/app-framework").Capabilities.ReactSurface> | import("@dxos/app-framework").AnyCapability[]>>;
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,6LAA0C,CAAC;AACtE,eAAO,MAAM,YAAY,gMAAwC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-popover.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/preview-popover.ts"],"names":[],"mappings":"AAIA,OAAO,EAAyD,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;yBA0BhG,SAAS,aAAa;AAAtC,wBAkCE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-surface.tsx"],"names":[],"mappings":"AAMA,OAAO,EACL,YAAY,EAOb,MAAM,qBAAqB,CAAC;;AAa7B,wBAkGK"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type
|
|
2
|
+
import { type DataType } from '@dxos/schema';
|
|
3
3
|
import { type PreviewProps } from '../types';
|
|
4
|
-
export declare const ContactCard: ({ children, classNames, role, subject: { fullName, image, organization, emails }, onOrgClick, }: PreviewProps<
|
|
5
|
-
onOrgClick?: (org: Organization) => void;
|
|
4
|
+
export declare const ContactCard: ({ children, classNames, role, subject: { fullName, image, organization, emails }, onOrgClick, }: PreviewProps<DataType.Person> & {
|
|
5
|
+
onOrgClick?: (org: DataType.Organization) => void;
|
|
6
6
|
}) => React.JSX.Element;
|
|
7
7
|
//# sourceMappingURL=ContactCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContactCard.d.ts","sourceRoot":"","sources":["../../../../src/components/ContactCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"ContactCard.d.ts","sourceRoot":"","sources":["../../../../src/components/ContactCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,KAAK,YAAY,EAAuE,MAAM,UAAU,CAAC;AAElH,eAAO,MAAM,WAAW,GAAI,iGAMzB,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG;IAAE,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,CAAC,YAAY,KAAK,IAAI,CAAA;CAAE,sBAmDvF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type
|
|
2
|
+
import { type DataType } from '@dxos/schema';
|
|
3
3
|
import { type PreviewProps } from '../types';
|
|
4
|
-
export declare const OrganizationCard: ({ children, classNames, subject: { name, image, description, website }, role, }: PreviewProps<Organization>) => React.JSX.Element;
|
|
4
|
+
export declare const OrganizationCard: ({ children, classNames, subject: { name, image, description, website }, role, }: PreviewProps<DataType.Organization>) => React.JSX.Element;
|
|
5
5
|
//# sourceMappingURL=OrganizationCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrganizationCard.d.ts","sourceRoot":"","sources":["../../../../src/components/OrganizationCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"OrganizationCard.d.ts","sourceRoot":"","sources":["../../../../src/components/OrganizationCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,KAAK,YAAY,EAAuE,MAAM,UAAU,CAAC;AAElH,eAAO,MAAM,gBAAgB,GAAI,iFAK9B,YAAY,CAAC,QAAQ,CAAC,YAAY,CAAC,sBA8BrC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type
|
|
2
|
+
import { type DataType } from '@dxos/schema';
|
|
3
3
|
import { type PreviewProps } from '../types';
|
|
4
|
-
export declare const ProjectCard: ({ classNames, role, subject: { name, image, description } }: PreviewProps<Project>) => React.JSX.Element;
|
|
4
|
+
export declare const ProjectCard: ({ classNames, role, subject: { name, image, description }, }: PreviewProps<DataType.Project>) => React.JSX.Element;
|
|
5
5
|
//# sourceMappingURL=ProjectCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectCard.d.ts","sourceRoot":"","sources":["../../../../src/components/ProjectCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"ProjectCard.d.ts","sourceRoot":"","sources":["../../../../src/components/ProjectCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,KAAK,YAAY,EAA0C,MAAM,UAAU,CAAC;AAErF,eAAO,MAAM,WAAW,GAAI,8DAIzB,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,sBAQhC,CAAC"}
|
|
@@ -16,7 +16,7 @@ export type PreviewProps<T extends object> = PropsWithChildren<ThemedClassName<{
|
|
|
16
16
|
* </Card.Body>
|
|
17
17
|
* </Card.Root>
|
|
18
18
|
*/
|
|
19
|
-
export declare const popoverCard = "popover-
|
|
19
|
+
export declare const popoverCard = "popover-card-width rounded-lg overflow-hidden";
|
|
20
20
|
export declare const defaultCard = "";
|
|
21
21
|
export declare const kanbanCardWithoutPoster = "pbs-[--rail-action]";
|
|
22
22
|
export declare const previewTitle = "text-lg font-medium line-clamp-2";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,IAAI,iBAAiB,CAC5D,eAAe,CAAC;IACd,OAAO,EAAE,CAAC,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CACH,CAAC;AAQF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,IAAI,iBAAiB,CAC5D,eAAe,CAAC;IACd,OAAO,EAAE,CAAC,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CACH,CAAC;AAQF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,kDAAkD,CAAC;AAC3E,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,eAAO,MAAM,uBAAuB,wBAAwB,CAAC;AAC7D,eAAO,MAAM,YAAY,qCAAqC,CAAC;AAC/D,eAAO,MAAM,YAAY,gBAAgB,CAAC;AAC1C,eAAO,MAAM,aAAa,4FAA4F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"5.
|
|
1
|
+
{"version":"5.8.3"}
|