@dxos/plugin-preview 0.8.4-main.2e9d522 → 0.8.4-main.3eb6e50203

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 (115) hide show
  1. package/dist/lib/browser/chunk-XLN6KTHK.mjs +17 -0
  2. package/dist/lib/browser/chunk-XLN6KTHK.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +33 -38
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/preview-popover-5YUZCO2D.mjs +82 -0
  7. package/dist/lib/browser/preview-popover-5YUZCO2D.mjs.map +7 -0
  8. package/dist/lib/browser/react-surface-W3FAIVY7.mjs +251 -0
  9. package/dist/lib/browser/react-surface-W3FAIVY7.mjs.map +7 -0
  10. package/dist/lib/node-esm/chunk-2G4FUGDA.mjs +19 -0
  11. package/dist/lib/node-esm/chunk-2G4FUGDA.mjs.map +7 -0
  12. package/dist/lib/node-esm/index.mjs +33 -38
  13. package/dist/lib/node-esm/index.mjs.map +4 -4
  14. package/dist/lib/node-esm/meta.json +1 -1
  15. package/dist/lib/node-esm/preview-popover-7QRYVL73.mjs +84 -0
  16. package/dist/lib/node-esm/preview-popover-7QRYVL73.mjs.map +7 -0
  17. package/dist/lib/node-esm/react-surface-IO5DHYZB.mjs +252 -0
  18. package/dist/lib/node-esm/react-surface-IO5DHYZB.mjs.map +7 -0
  19. package/dist/types/src/PreviewPlugin.d.ts +2 -1
  20. package/dist/types/src/PreviewPlugin.d.ts.map +1 -1
  21. package/dist/types/src/capabilities/index.d.ts +2 -2
  22. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  23. package/dist/types/src/capabilities/preview-popover/index.d.ts +3 -0
  24. package/dist/types/src/capabilities/preview-popover/index.d.ts.map +1 -0
  25. package/dist/types/src/capabilities/preview-popover/preview-popover.d.ts +5 -0
  26. package/dist/types/src/capabilities/preview-popover/preview-popover.d.ts.map +1 -0
  27. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  28. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  29. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  30. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  31. package/dist/types/src/cards/FormCard.d.ts +7 -0
  32. package/dist/types/src/cards/FormCard.d.ts.map +1 -0
  33. package/dist/types/src/cards/OrganizationCard.d.ts +5 -0
  34. package/dist/types/src/cards/OrganizationCard.d.ts.map +1 -0
  35. package/dist/types/src/cards/PersonCard.d.ts +5 -0
  36. package/dist/types/src/cards/PersonCard.d.ts.map +1 -0
  37. package/dist/types/src/cards/ProjectCard.d.ts +5 -0
  38. package/dist/types/src/cards/ProjectCard.d.ts.map +1 -0
  39. package/dist/types/src/cards/TaskCard.d.ts +5 -0
  40. package/dist/types/src/cards/TaskCard.d.ts.map +1 -0
  41. package/dist/types/src/cards/index.d.ts +6 -0
  42. package/dist/types/src/cards/index.d.ts.map +1 -0
  43. package/dist/types/src/index.d.ts +0 -1
  44. package/dist/types/src/index.d.ts.map +1 -1
  45. package/dist/types/src/meta.d.ts +2 -3
  46. package/dist/types/src/meta.d.ts.map +1 -1
  47. package/dist/types/src/stories/Card.stories.d.ts +32 -0
  48. package/dist/types/src/stories/Card.stories.d.ts.map +1 -0
  49. package/dist/types/src/stories/testing.d.ts +19 -0
  50. package/dist/types/src/stories/testing.d.ts.map +1 -0
  51. package/dist/types/src/translations.d.ts +6 -0
  52. package/dist/types/src/translations.d.ts.map +1 -1
  53. package/dist/types/tsconfig.tsbuildinfo +1 -1
  54. package/package.json +46 -31
  55. package/src/PreviewPlugin.tsx +14 -26
  56. package/src/capabilities/index.ts +2 -4
  57. package/src/capabilities/preview-popover/index.ts +7 -0
  58. package/src/capabilities/preview-popover/preview-popover.ts +90 -0
  59. package/src/capabilities/react-surface/index.ts +7 -0
  60. package/src/capabilities/react-surface/react-surface.tsx +97 -0
  61. package/src/cards/FormCard.tsx +56 -0
  62. package/src/cards/OrganizationCard.tsx +29 -0
  63. package/src/cards/PersonCard.tsx +47 -0
  64. package/src/cards/ProjectCard.tsx +22 -0
  65. package/src/cards/TaskCard.tsx +40 -0
  66. package/src/{components → cards}/index.ts +3 -1
  67. package/src/index.ts +0 -1
  68. package/src/meta.ts +8 -5
  69. package/src/stories/Card.stories.tsx +76 -0
  70. package/src/stories/testing.tsx +84 -0
  71. package/src/translations.ts +6 -0
  72. package/dist/lib/browser/chunk-Z73ENKLE.mjs +0 -14
  73. package/dist/lib/browser/chunk-Z73ENKLE.mjs.map +0 -7
  74. package/dist/lib/browser/preview-popover-2UCEZUQW.mjs +0 -69
  75. package/dist/lib/browser/preview-popover-2UCEZUQW.mjs.map +0 -7
  76. package/dist/lib/browser/react-surface-CZMUEWPV.mjs +0 -303
  77. package/dist/lib/browser/react-surface-CZMUEWPV.mjs.map +0 -7
  78. package/dist/lib/node-esm/chunk-2ORSL4GJ.mjs +0 -16
  79. package/dist/lib/node-esm/chunk-2ORSL4GJ.mjs.map +0 -7
  80. package/dist/lib/node-esm/preview-popover-OSHWR2YE.mjs +0 -71
  81. package/dist/lib/node-esm/preview-popover-OSHWR2YE.mjs.map +0 -7
  82. package/dist/lib/node-esm/react-surface-IPZBISWS.mjs +0 -304
  83. package/dist/lib/node-esm/react-surface-IPZBISWS.mjs.map +0 -7
  84. package/dist/types/src/capabilities/preview-popover.d.ts +0 -4
  85. package/dist/types/src/capabilities/preview-popover.d.ts.map +0 -1
  86. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  87. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  88. package/dist/types/src/components/ContactCard.d.ts +0 -7
  89. package/dist/types/src/components/ContactCard.d.ts.map +0 -1
  90. package/dist/types/src/components/OrganizationCard.d.ts +0 -5
  91. package/dist/types/src/components/OrganizationCard.d.ts.map +0 -1
  92. package/dist/types/src/components/ProjectCard.d.ts +0 -5
  93. package/dist/types/src/components/ProjectCard.d.ts.map +0 -1
  94. package/dist/types/src/components/index.d.ts +0 -4
  95. package/dist/types/src/components/index.d.ts.map +0 -1
  96. package/dist/types/src/testing/ExtrinsicPreviews.stories.d.ts +0 -35
  97. package/dist/types/src/testing/ExtrinsicPreviews.stories.d.ts.map +0 -1
  98. package/dist/types/src/testing/IntrinsicPreviews.stories.d.ts +0 -35
  99. package/dist/types/src/testing/IntrinsicPreviews.stories.d.ts.map +0 -1
  100. package/dist/types/src/testing/PopoverPreviews.stories.d.ts +0 -35
  101. package/dist/types/src/testing/PopoverPreviews.stories.d.ts.map +0 -1
  102. package/dist/types/src/testing/util.d.ts +0 -80
  103. package/dist/types/src/testing/util.d.ts.map +0 -1
  104. package/dist/types/src/types.d.ts +0 -6
  105. package/dist/types/src/types.d.ts.map +0 -1
  106. package/src/capabilities/preview-popover.ts +0 -74
  107. package/src/capabilities/react-surface.tsx +0 -163
  108. package/src/components/ContactCard.tsx +0 -70
  109. package/src/components/OrganizationCard.tsx +0 -41
  110. package/src/components/ProjectCard.tsx +0 -20
  111. package/src/testing/ExtrinsicPreviews.stories.tsx +0 -55
  112. package/src/testing/IntrinsicPreviews.stories.tsx +0 -55
  113. package/src/testing/PopoverPreviews.stories.tsx +0 -55
  114. package/src/testing/util.tsx +0 -79
  115. package/src/types.ts +0 -11
@@ -0,0 +1,252 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ meta
4
+ } from "./chunk-2G4FUGDA.mjs";
5
+
6
+ // src/capabilities/react-surface/react-surface.tsx
7
+ import * as Effect from "effect/Effect";
8
+ import React6 from "react";
9
+ import { Capabilities, Capability } from "@dxos/app-framework";
10
+ import { Surface } from "@dxos/app-framework/ui";
11
+ import { Obj as Obj3 } from "@dxos/echo";
12
+ import { Card as Card5 } from "@dxos/react-ui-mosaic";
13
+ import { Organization, Person, Pipeline, Task as Task2 } from "@dxos/types";
14
+
15
+ // src/cards/FormCard.tsx
16
+ import React, { useCallback } from "react";
17
+ import { useOperationInvoker } from "@dxos/app-framework/ui";
18
+ import { LayoutOperation } from "@dxos/app-toolkit";
19
+ import { Obj } from "@dxos/echo";
20
+ import { splitJsonPath } from "@dxos/effect";
21
+ import { useTranslation } from "@dxos/react-ui";
22
+ import { Form, omitId } from "@dxos/react-ui-form";
23
+ import { descriptionMessage, mx } from "@dxos/ui-theme";
24
+ var FormCard = ({ subject, projection }) => {
25
+ const { t } = useTranslation(meta.id);
26
+ const { invokePromise } = useOperationInvoker();
27
+ const schema = Obj.getSchema(subject);
28
+ const label = Obj.getLabel(subject) ?? Obj.getTypename(subject) ?? t("unable to create preview message");
29
+ const handleNavigate = useCallback(async () => {
30
+ await invokePromise(LayoutOperation.UpdatePopover, {
31
+ state: false,
32
+ anchorId: ""
33
+ });
34
+ await invokePromise(LayoutOperation.Open, {
35
+ subject: [
36
+ Obj.getDXN(subject).toString()
37
+ ]
38
+ });
39
+ }, [
40
+ invokePromise,
41
+ subject
42
+ ]);
43
+ const handleSave = useCallback((values, { changed }) => {
44
+ const paths = Object.keys(changed).filter((path) => changed[path]);
45
+ Obj.change(subject, () => {
46
+ for (const path of paths) {
47
+ const value = values[path];
48
+ const parts = splitJsonPath(path);
49
+ Obj.setValue(subject, parts, value);
50
+ }
51
+ });
52
+ }, []);
53
+ if (!schema) {
54
+ return /* @__PURE__ */ React.createElement("p", {
55
+ className: mx(descriptionMessage)
56
+ }, t("unable to create preview message"));
57
+ }
58
+ return /* @__PURE__ */ React.createElement(Form.Root, {
59
+ schema: omitId(schema),
60
+ projection,
61
+ values: subject,
62
+ autoSave: true,
63
+ onSave: handleSave
64
+ }, /* @__PURE__ */ React.createElement(Form.Viewport, null, /* @__PURE__ */ React.createElement(Form.Content, null, /* @__PURE__ */ React.createElement(Form.FieldSet, null))));
65
+ };
66
+
67
+ // src/cards/OrganizationCard.tsx
68
+ import React2 from "react";
69
+ import { Card } from "@dxos/react-ui-mosaic";
70
+ var OrganizationCard = ({ subject }) => {
71
+ const { image, description, website } = subject;
72
+ return /* @__PURE__ */ React2.createElement(Card.Content, null, /* @__PURE__ */ React2.createElement(Card.Poster, {
73
+ alt: name ?? "",
74
+ ...image ? {
75
+ image
76
+ } : {
77
+ icon: "ph--building-office--regular"
78
+ },
79
+ classNames: !image && "opacity-50"
80
+ }), description && /* @__PURE__ */ React2.createElement(Card.Row, null, /* @__PURE__ */ React2.createElement(Card.Text, {
81
+ variant: "description"
82
+ }, description)), website && /* @__PURE__ */ React2.createElement(Card.Link, {
83
+ label: website,
84
+ href: website
85
+ }));
86
+ };
87
+
88
+ // src/cards/PersonCard.tsx
89
+ import React3 from "react";
90
+ import { Avatar } from "@dxos/react-ui";
91
+ import { Card as Card2 } from "@dxos/react-ui-mosaic";
92
+ var PersonCard = ({ subject }) => {
93
+ const { image, organization: { target: organization } = {}, emails = [] } = subject;
94
+ return /* @__PURE__ */ React3.createElement(Avatar.Root, null, /* @__PURE__ */ React3.createElement(Card2.Content, null, image && /* @__PURE__ */ React3.createElement(Card2.Row, {
95
+ className: "plb-1"
96
+ }, /* @__PURE__ */ React3.createElement(Avatar.Content, {
97
+ imgSrc: image,
98
+ icon: "ph--user--regular",
99
+ size: 16,
100
+ classNames: !image && "opacity-50",
101
+ hue: "neutral",
102
+ variant: "square"
103
+ })), organization?.name && /* @__PURE__ */ React3.createElement(Card2.Action, {
104
+ icon: "ph--buildings--regular",
105
+ label: organization.name
106
+ }), emails.map(({ value }) => /* @__PURE__ */ React3.createElement(Card2.Row, {
107
+ key: value,
108
+ icon: "ph--at--regular"
109
+ }, /* @__PURE__ */ React3.createElement(Card2.Text, {
110
+ truncate: true,
111
+ className: "text-primaryText"
112
+ }, value)))));
113
+ };
114
+
115
+ // src/cards/ProjectCard.tsx
116
+ import React4 from "react";
117
+ import { Obj as Obj2 } from "@dxos/echo";
118
+ import { Card as Card3 } from "@dxos/react-ui-mosaic";
119
+ var ProjectCard = ({ subject }) => {
120
+ const { name: name2, image, description } = subject;
121
+ return /* @__PURE__ */ React4.createElement(Card3.Content, null, image && /* @__PURE__ */ React4.createElement(Card3.Poster, {
122
+ image,
123
+ alt: Obj2.getLabel(subject) ?? "",
124
+ aspect: "auto"
125
+ }), description && /* @__PURE__ */ React4.createElement(Card3.Text, {
126
+ variant: "description"
127
+ }, description));
128
+ };
129
+
130
+ // src/cards/TaskCard.tsx
131
+ import * as SchemaAST from "effect/SchemaAST";
132
+ import React5 from "react";
133
+ import { PropertyMetaAnnotationId } from "@dxos/echo/internal";
134
+ import { Card as Card4 } from "@dxos/react-ui-mosaic";
135
+ import { Task } from "@dxos/types";
136
+ var TaskCard = ({ subject }) => {
137
+ const { title, status } = subject;
138
+ const statusOption = getActiveStatusOption(status);
139
+ return /* @__PURE__ */ React5.createElement(Card4.Content, null, /* @__PURE__ */ React5.createElement(Card4.Heading, {
140
+ classNames: "min-is-0 flex-1 truncate"
141
+ }, title), statusOption && /* @__PURE__ */ React5.createElement("span", {
142
+ className: "dx-tag",
143
+ "data-hue": statusOption.color
144
+ }, statusOption.title));
145
+ };
146
+ var getActiveStatusOption = (status) => {
147
+ const properties = SchemaAST.getPropertySignatures(Task.Task.ast);
148
+ const statusProperty = properties.find((p) => p.name === "status");
149
+ const statusMeta = SchemaAST.getAnnotation(PropertyMetaAnnotationId)(
150
+ // TODO(thure): Typescript asserts `.type` doesn’t have `.types`, but in runtime it does.
151
+ statusProperty.type.types[0]
152
+ );
153
+ const options = statusMeta.value.singleSelect.options;
154
+ return options.find(({ id }) => id === status);
155
+ };
156
+
157
+ // src/capabilities/react-surface/react-surface.tsx
158
+ var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactSurface, [
159
+ //
160
+ // Specific schema types.
161
+ // TODO(burdon): Create helpers and factor out.
162
+ //
163
+ Surface.create({
164
+ id: `${meta.id}/schema-popover--contact`,
165
+ role: "card--content",
166
+ position: "hoist",
167
+ filter: (data) => Obj3.instanceOf(Person.Person, data.subject),
168
+ component: ({ data, role }) => {
169
+ return /* @__PURE__ */ React6.createElement(PersonCard, {
170
+ role,
171
+ subject: data.subject
172
+ });
173
+ }
174
+ }),
175
+ Surface.create({
176
+ id: `${meta.id}/schema-popover--organization`,
177
+ role: "card--content",
178
+ position: "hoist",
179
+ filter: (data) => Obj3.instanceOf(Organization.Organization, data.subject),
180
+ component: ({ data, role }) => {
181
+ return /* @__PURE__ */ React6.createElement(OrganizationCard, {
182
+ role,
183
+ subject: data.subject
184
+ });
185
+ }
186
+ }),
187
+ Surface.create({
188
+ id: `${meta.id}/schema-popover--project`,
189
+ role: "card--content",
190
+ position: "hoist",
191
+ filter: (data) => Obj3.instanceOf(Pipeline.Pipeline, data.subject),
192
+ component: ({ data, role }) => {
193
+ return /* @__PURE__ */ React6.createElement(ProjectCard, {
194
+ role,
195
+ subject: data.subject
196
+ });
197
+ }
198
+ }),
199
+ Surface.create({
200
+ id: `${meta.id}/schema-popover--task`,
201
+ role: "card--content",
202
+ position: "hoist",
203
+ filter: (data) => Obj3.instanceOf(Task2.Task, data.subject),
204
+ component: ({ data, role }) => {
205
+ return /* @__PURE__ */ React6.createElement(TaskCard, {
206
+ role,
207
+ subject: data.subject
208
+ });
209
+ }
210
+ }),
211
+ //
212
+ // Fallback for any object.
213
+ //
214
+ Surface.create({
215
+ id: `${meta.id}/fallback-popover`,
216
+ role: "card--content",
217
+ position: "fallback",
218
+ filter: (data) => Obj3.isObject(data.subject),
219
+ component: ({ data, role }) => {
220
+ return /* @__PURE__ */ React6.createElement(FormCard, {
221
+ role,
222
+ subject: data.subject,
223
+ projection: data.projection
224
+ });
225
+ }
226
+ }),
227
+ Surface.create({
228
+ id: `${meta.id}/section`,
229
+ role: [
230
+ "section"
231
+ ],
232
+ position: "fallback",
233
+ filter: (data) => Obj3.isObject(data.subject),
234
+ component: ({ data }) => {
235
+ return /* @__PURE__ */ React6.createElement("div", {
236
+ role: "none",
237
+ className: "flex is-full justify-center"
238
+ }, /* @__PURE__ */ React6.createElement("div", {
239
+ role: "none",
240
+ className: "pbs-2 pbe-2 card-min-width card-max-width"
241
+ }, /* @__PURE__ */ React6.createElement(Card5.Root, null, /* @__PURE__ */ React6.createElement(Surface.Surface, {
242
+ role: "card--content",
243
+ data,
244
+ limit: 1
245
+ }))));
246
+ }
247
+ })
248
+ ])));
249
+ export {
250
+ react_surface_default as default
251
+ };
252
+ //# sourceMappingURL=react-surface-IO5DHYZB.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/react-surface/react-surface.tsx", "../../../src/cards/FormCard.tsx", "../../../src/cards/OrganizationCard.tsx", "../../../src/cards/PersonCard.tsx", "../../../src/cards/ProjectCard.tsx", "../../../src/cards/TaskCard.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface } from '@dxos/app-framework/ui';\nimport { Obj } from '@dxos/echo';\nimport { Card } from '@dxos/react-ui-mosaic';\nimport { type ProjectionModel } from '@dxos/schema';\nimport { Organization, Person, Pipeline, Task } from '@dxos/types';\n\nimport { FormCard, OrganizationCard, PersonCard, ProjectCard, TaskCard } from '../../cards';\nimport { meta } from '../../meta';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactSurface, [\n //\n // Specific schema types.\n // TODO(burdon): Create helpers and factor out.\n //\n\n Surface.create<{ subject: Person.Person }>({\n id: `${meta.id}/schema-popover--contact`,\n role: 'card--content',\n position: 'hoist',\n filter: (data): data is { subject: Person.Person } => Obj.instanceOf(Person.Person, data.subject),\n component: ({ data, role }) => {\n return <PersonCard role={role} subject={data.subject} />;\n },\n }),\n Surface.create({\n id: `${meta.id}/schema-popover--organization`,\n role: 'card--content',\n position: 'hoist',\n filter: (data): data is { subject: Organization.Organization } =>\n Obj.instanceOf(Organization.Organization, data.subject),\n component: ({ data, role }) => {\n return <OrganizationCard role={role} subject={data.subject} />;\n },\n }),\n Surface.create({\n id: `${meta.id}/schema-popover--project`,\n role: 'card--content',\n position: 'hoist',\n filter: (data): data is { subject: Pipeline.Pipeline } => Obj.instanceOf(Pipeline.Pipeline, data.subject),\n component: ({ data, role }) => {\n return <ProjectCard role={role} subject={data.subject} />;\n },\n }),\n Surface.create({\n id: `${meta.id}/schema-popover--task`,\n role: 'card--content',\n position: 'hoist',\n filter: (data): data is { subject: Task.Task } => Obj.instanceOf(Task.Task, data.subject),\n component: ({ data, role }) => {\n return <TaskCard role={role} subject={data.subject} />;\n },\n }),\n\n //\n // Fallback for any object.\n //\n\n Surface.create({\n id: `${meta.id}/fallback-popover`,\n role: 'card--content',\n position: 'fallback',\n filter: (data): data is { subject: Obj.Unknown; projection?: ProjectionModel } => Obj.isObject(data.subject),\n component: ({ data, role }) => {\n return <FormCard role={role} subject={data.subject} projection={data.projection} />;\n },\n }),\n\n Surface.create({\n id: `${meta.id}/section`,\n role: ['section'],\n position: 'fallback',\n filter: (data): data is { subject: Obj.Unknown } => Obj.isObject(data.subject),\n component: ({ data }) => {\n return (\n <div role='none' className='flex is-full justify-center'>\n <div role='none' className='pbs-2 pbe-2 card-min-width card-max-width'>\n <Card.Root>\n <Surface.Surface role='card--content' data={data} limit={1} />\n </Card.Root>\n </div>\n </div>\n );\n },\n }),\n ]),\n ),\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { useOperationInvoker } from '@dxos/app-framework/ui';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';\nimport { Obj } from '@dxos/echo';\nimport { type JsonPath, splitJsonPath } from '@dxos/effect';\nimport { useTranslation } from '@dxos/react-ui';\nimport { Form, omitId } from '@dxos/react-ui-form';\nimport { type ProjectionModel } from '@dxos/schema';\nimport { descriptionMessage, mx } from '@dxos/ui-theme';\n\nimport { meta } from '../meta';\n\nexport const FormCard = ({ subject, projection }: SurfaceComponentProps & { projection?: ProjectionModel }) => {\n const { t } = useTranslation(meta.id);\n const { invokePromise } = useOperationInvoker();\n const schema = Obj.getSchema(subject);\n const label = Obj.getLabel(subject) ?? Obj.getTypename(subject) ?? t('unable to create preview message');\n\n const handleNavigate = useCallback(async () => {\n await invokePromise(LayoutOperation.UpdatePopover, { state: false, anchorId: '' });\n await invokePromise(LayoutOperation.Open, { subject: [Obj.getDXN(subject).toString()] });\n }, [invokePromise, subject]);\n\n const handleSave = useCallback((values: any, { changed }: { changed: Record<string, boolean> }) => {\n const paths = Object.keys(changed).filter((path) => changed[path]);\n Obj.change(subject, () => {\n for (const path of paths) {\n const value = values[path];\n const parts = splitJsonPath(path as JsonPath);\n Obj.setValue(subject, parts, value);\n }\n });\n }, []);\n\n if (!schema) {\n // TODO(burdon): Use Alert.\n return <p className={mx(descriptionMessage)}>{t('unable to create preview message')}</p>;\n }\n\n return (\n <Form.Root schema={omitId(schema)} projection={projection} values={subject} autoSave onSave={handleSave}>\n {/* TODO(burdon): Scrolling issue. Need fixed height. */}\n <Form.Viewport>\n <Form.Content>\n <Form.FieldSet />\n </Form.Content>\n </Form.Viewport>\n </Form.Root>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';\nimport { Card } from '@dxos/react-ui-mosaic';\nimport { type Organization } from '@dxos/types';\n\nexport const OrganizationCard = ({ subject }: SurfaceComponentProps<Organization.Organization>) => {\n const { image, description, website } = subject;\n\n return (\n <Card.Content>\n <Card.Poster\n alt={name ?? ''}\n {...(image ? { image } : { icon: 'ph--building-office--regular' })}\n classNames={!image && 'opacity-50'}\n />\n {description && (\n <Card.Row>\n <Card.Text variant='description'>{description}</Card.Text>\n </Card.Row>\n )}\n {website && <Card.Link label={website} href={website} />}\n </Card.Content>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';\nimport { Avatar } from '@dxos/react-ui';\nimport { Card } from '@dxos/react-ui-mosaic';\nimport { type Person } from '@dxos/types';\n\nexport const PersonCard = ({ subject }: SurfaceComponentProps<Person.Person>) => {\n const { image, organization: { target: organization } = {}, emails = [] } = subject;\n\n return (\n <Avatar.Root>\n <Card.Content>\n {image && (\n <Card.Row className='plb-1'>\n <Avatar.Content\n imgSrc={image}\n icon='ph--user--regular'\n size={16}\n classNames={!image && 'opacity-50'}\n hue='neutral'\n variant='square'\n />\n </Card.Row>\n )}\n {organization?.name && (\n <Card.Action\n icon='ph--buildings--regular'\n label={organization.name}\n // onClick={onSelect ? () => onSelect(organization) : undefined}\n />\n )}\n {emails.map(({ value }) => (\n <Card.Row key={value} icon='ph--at--regular'>\n <Card.Text truncate className='text-primaryText'>\n {value}\n </Card.Text>\n </Card.Row>\n ))}\n </Card.Content>\n </Avatar.Root>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';\nimport { Obj } from '@dxos/echo';\nimport { Card } from '@dxos/react-ui-mosaic';\nimport { type Pipeline } from '@dxos/types';\n\nexport const ProjectCard = ({ subject }: SurfaceComponentProps<Pipeline.Pipeline>) => {\n const { name, image, description } = subject;\n\n return (\n <Card.Content>\n {image && <Card.Poster image={image} alt={Obj.getLabel(subject) ?? ''} aspect='auto' />}\n {/* <CardHeader label={name} subject={subject} db={db} /> */}\n {description && <Card.Text variant='description'>{description}</Card.Text>}\n </Card.Content>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as SchemaAST from 'effect/SchemaAST';\nimport React from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';\nimport { type PropertyMetaAnnotation, PropertyMetaAnnotationId } from '@dxos/echo/internal';\nimport { Card } from '@dxos/react-ui-mosaic';\nimport { Task } from '@dxos/types';\n\nexport const TaskCard = ({ subject }: SurfaceComponentProps<Task.Task>) => {\n const { title, status } = subject;\n const statusOption = getActiveStatusOption(status);\n\n return (\n <Card.Content>\n <Card.Heading classNames='min-is-0 flex-1 truncate'>{title}</Card.Heading>\n {statusOption && (\n <span className='dx-tag' data-hue={statusOption.color}>\n {statusOption.title}\n </span>\n )}\n </Card.Content>\n );\n};\n\n// TODO(thure): Should this move upstream as a helper? Is there an easier way to get options?\nconst getActiveStatusOption = (status?: string) => {\n const properties = SchemaAST.getPropertySignatures(Task.Task.ast);\n const statusProperty = properties.find((p) => p.name === 'status');\n const statusMeta = SchemaAST.getAnnotation<PropertyMetaAnnotation>(PropertyMetaAnnotationId)(\n // TODO(thure): Typescript asserts `.type` doesn’t have `.types`, but in runtime it does.\n (statusProperty!.type as any).types[0],\n );\n const options = // TODO(thure): Typescript asserts `statusMeta` doesn’t have `.value`, but in runtime it does.\n (statusMeta as any).value.singleSelect.options as { id: string; title: string; color: string }[];\n return options.find(({ id }) => id === status);\n};\n"],
5
+ "mappings": ";;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,YAAW;AAElB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,eAAe;AACxB,SAASC,OAAAA,YAAW;AACpB,SAASC,QAAAA,aAAY;AAErB,SAASC,cAAcC,QAAQC,UAAUC,QAAAA,aAAY;;;ACRrD,OAAOC,SAASC,mBAAmB;AAEnC,SAASC,2BAA2B;AACpC,SAASC,uBAAuB;AAEhC,SAASC,WAAW;AACpB,SAAwBC,qBAAqB;AAC7C,SAASC,sBAAsB;AAC/B,SAASC,MAAMC,cAAc;AAE7B,SAASC,oBAAoBC,UAAU;AAIhC,IAAMC,WAAW,CAAC,EAAEC,SAASC,WAAU,MAA4D;AACxG,QAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AACpC,QAAM,EAAEC,cAAa,IAAKC,oBAAAA;AAC1B,QAAMC,SAASC,IAAIC,UAAUV,OAAAA;AAC7B,QAAMW,QAAQF,IAAIG,SAASZ,OAAAA,KAAYS,IAAII,YAAYb,OAAAA,KAAYE,EAAE,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CAAC,EAAEL,MAAMH,KAAI,MAAE;AACxB,aAAO,gBAAAS,OAAA,cAACS,UAAAA;QAASlB;QAAYO,SAASJ,KAAKI;QAASY,YAAYhB,KAAKgB;;IACvE;EACF,CAAA;EAEAvB,QAAQC,OAAO;IACbC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;MAAC;;IACPC,UAAU;IACVC,QAAQ,CAACC,SAA2CC,KAAIa,SAASd,KAAKI,OAAO;IAC7EC,WAAW,CAAC,EAAEL,KAAI,MAAE;AAClB,aACE,gBAAAM,OAAA,cAACW,OAAAA;QAAIpB,MAAK;QAAOqB,WAAU;SACzB,gBAAAZ,OAAA,cAACW,OAAAA;QAAIpB,MAAK;QAAOqB,WAAU;SACzB,gBAAAZ,OAAA,cAACa,MAAKC,MAAI,MACR,gBAAAd,OAAA,cAACb,QAAQA,SAAO;QAACI,MAAK;QAAgBG;QAAYqB,OAAO;;IAKnE;EACF,CAAA;CACD,CAAA,CAAA;",
6
+ "names": ["Effect", "React", "Capabilities", "Capability", "Surface", "Obj", "Card", "Organization", "Person", "Pipeline", "Task", "React", "useCallback", "useOperationInvoker", "LayoutOperation", "Obj", "splitJsonPath", "useTranslation", "Form", "omitId", "descriptionMessage", "mx", "FormCard", "subject", "projection", "t", "useTranslation", "meta", "id", "invokePromise", "useOperationInvoker", "schema", "Obj", "getSchema", "label", "getLabel", "getTypename", "handleNavigate", "useCallback", "LayoutOperation", "UpdatePopover", "state", "anchorId", "Open", "getDXN", "toString", "handleSave", "values", "changed", "paths", "Object", "keys", "filter", "path", "change", "value", "parts", "splitJsonPath", "setValue", "p", "className", "mx", "descriptionMessage", "Form", "Root", "omitId", "autoSave", "onSave", "Viewport", "Content", "FieldSet", "React", "Card", "OrganizationCard", "subject", "image", "description", "website", "React", "Card", "Content", "Poster", "alt", "name", "icon", "classNames", "Row", "Text", "variant", "Link", "label", "href", "React", "Avatar", "Card", "PersonCard", "subject", "image", "organization", "target", "emails", "React", "Avatar", "Root", "Card", "Content", "Row", "className", "imgSrc", "icon", "size", "classNames", "hue", "variant", "name", "Action", "label", "map", "value", "key", "Text", "truncate", "React", "Obj", "Card", "ProjectCard", "subject", "name", "image", "description", "React", "Card", "Content", "Poster", "alt", "Obj", "getLabel", "aspect", "Text", "variant", "SchemaAST", "React", "PropertyMetaAnnotationId", "Card", "Task", "TaskCard", "subject", "title", "status", "statusOption", "getActiveStatusOption", "React", "Card", "Content", "Heading", "classNames", "span", "className", "data-hue", "color", "properties", "getPropertySignatures", "Task", "ast", "statusProperty", "find", "p", "name", "statusMeta", "getAnnotation", "PropertyMetaAnnotationId", "type", "types", "options", "value", "singleSelect", "id", "Capability", "makeModule", "succeed", "contributes", "Capabilities", "ReactSurface", "Surface", "create", "id", "meta", "role", "position", "filter", "data", "Obj", "instanceOf", "Person", "subject", "component", "React", "PersonCard", "Organization", "OrganizationCard", "Pipeline", "ProjectCard", "Task", "TaskCard", "isObject", "FormCard", "projection", "div", "className", "Card", "Root", "limit"]
7
+ }
@@ -1,2 +1,3 @@
1
- export declare const PreviewPlugin: () => import("@dxos/app-framework").Plugin;
1
+ import { Plugin } from '@dxos/app-framework';
2
+ export declare const PreviewPlugin: Plugin.PluginFactory<void>;
2
3
  //# sourceMappingURL=PreviewPlugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PreviewPlugin.d.ts","sourceRoot":"","sources":["../../../src/PreviewPlugin.tsx"],"names":[],"mappings":"AAYA,eAAO,MAAM,aAAa,4CAsBtB,CAAC"}
1
+ {"version":3,"file":"PreviewPlugin.d.ts","sourceRoot":"","sources":["../../../src/PreviewPlugin.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAoB,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAQ/D,eAAO,MAAM,aAAa,4BAUzB,CAAC"}
@@ -1,3 +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[]>>;
1
+ export * from './preview-popover';
2
+ export * from './react-surface';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAIA,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Capability } from '@dxos/app-framework';
2
+ export declare const PreviewPopover: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<null>>, Error>;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/preview-popover/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,cAAc,8FAAuE,CAAC"}
@@ -0,0 +1,5 @@
1
+ import * as Effect from 'effect/Effect';
2
+ import { Capability } from '@dxos/app-framework';
3
+ declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<null>>, never, Capability.Service>;
4
+ export default _default;
5
+ //# sourceMappingURL=preview-popover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-popover.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/preview-popover/preview-popover.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAgB,UAAU,EAAE,MAAM,qBAAqB,CAAC;;AA2B/D,wBAwDE"}
@@ -0,0 +1,3 @@
1
+ import { Capability } from '@dxos/app-framework';
2
+ export declare const ReactSurface: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<import("@dxos/app-framework/Capabilities").ReactSurface>>, Error>;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/react-surface/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,YAAY,iJAAmE,CAAC"}
@@ -0,0 +1,5 @@
1
+ import * as Effect from 'effect/Effect';
2
+ import { Capabilities, Capability } from '@dxos/app-framework';
3
+ declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<Capabilities.ReactSurface>>, never, never>;
4
+ export default _default;
5
+ //# sourceMappingURL=react-surface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/react-surface/react-surface.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;;AAU/D,wBA+EE"}
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
3
+ import { type ProjectionModel } from '@dxos/schema';
4
+ export declare const FormCard: ({ subject, projection }: SurfaceComponentProps & {
5
+ projection?: ProjectionModel;
6
+ }) => React.JSX.Element;
7
+ //# sourceMappingURL=FormCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormCard.d.ts","sourceRoot":"","sources":["../../../../src/cards/FormCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAKlE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAKpD,eAAO,MAAM,QAAQ,GAAI,yBAAyB,qBAAqB,GAAG;IAAE,UAAU,CAAC,EAAE,eAAe,CAAA;CAAE,sBAqCzG,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
3
+ import { type Organization } from '@dxos/types';
4
+ export declare const OrganizationCard: ({ subject }: SurfaceComponentProps<Organization.Organization>) => React.JSX.Element;
5
+ //# sourceMappingURL=OrganizationCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrganizationCard.d.ts","sourceRoot":"","sources":["../../../../src/cards/OrganizationCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,gBAAgB,GAAI,aAAa,qBAAqB,CAAC,YAAY,CAAC,YAAY,CAAC,sBAkB7F,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
3
+ import { type Person } from '@dxos/types';
4
+ export declare const PersonCard: ({ subject }: SurfaceComponentProps<Person.Person>) => React.JSX.Element;
5
+ //# sourceMappingURL=PersonCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PersonCard.d.ts","sourceRoot":"","sources":["../../../../src/cards/PersonCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAGlE,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,eAAO,MAAM,UAAU,GAAI,aAAa,qBAAqB,CAAC,MAAM,CAAC,MAAM,CAAC,sBAmC3E,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
3
+ import { type Pipeline } from '@dxos/types';
4
+ export declare const ProjectCard: ({ subject }: SurfaceComponentProps<Pipeline.Pipeline>) => React.JSX.Element;
5
+ //# sourceMappingURL=ProjectCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProjectCard.d.ts","sourceRoot":"","sources":["../../../../src/cards/ProjectCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAGlE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,eAAO,MAAM,WAAW,GAAI,aAAa,qBAAqB,CAAC,QAAQ,CAAC,QAAQ,CAAC,sBAUhF,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
3
+ import { Task } from '@dxos/types';
4
+ export declare const TaskCard: ({ subject }: SurfaceComponentProps<Task.Task>) => React.JSX.Element;
5
+ //# sourceMappingURL=TaskCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TaskCard.d.ts","sourceRoot":"","sources":["../../../../src/cards/TaskCard.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAGlE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,eAAO,MAAM,QAAQ,GAAI,aAAa,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,sBAcrE,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './FormCard';
2
+ export * from './OrganizationCard';
3
+ export * from './PersonCard';
4
+ export * from './ProjectCard';
5
+ export * from './TaskCard';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cards/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC"}
@@ -1,4 +1,3 @@
1
1
  export * from './meta';
2
- export type * from './types';
3
2
  export * from './PreviewPlugin';
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC;AACvB,mBAAmB,SAAS,CAAC;AAE7B,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC;AAEvB,cAAc,iBAAiB,CAAC"}
@@ -1,4 +1,3 @@
1
- import { type PluginMeta } from '@dxos/app-framework';
2
- export declare const PREVIEW_PLUGIN = "dxos.org/plugin/preview";
3
- export declare const meta: PluginMeta;
1
+ import { type Plugin } from '@dxos/app-framework';
2
+ export declare const meta: Plugin.Meta;
4
3
  //# sourceMappingURL=meta.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,eAAO,MAAM,cAAc,4BAA4B,CAAC;AAExD,eAAO,MAAM,IAAI,EAAE,UAKlB,CAAC"}
1
+ {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGlD,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,IASzB,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { type StoryObj } from '@storybook/react-vite';
2
+ import { type Organization, type Person, type Pipeline, type Task } from '@dxos/types';
3
+ import { DefaultStory } from './testing';
4
+ declare const meta: {
5
+ title: string;
6
+ render: <T extends import("@dxos/echo/Obj").Any>({ Component, createObject, image }: import("./testing").DefaultStoryProps<T>) => import("react").JSX.Element;
7
+ decorators: import("@storybook/react").Decorator[];
8
+ parameters: {
9
+ translations: [{
10
+ readonly 'en-US': {
11
+ readonly [meta.id]: {
12
+ readonly 'unable to create preview message': "No preview";
13
+ readonly 'todo label': "To do";
14
+ readonly 'in-progress label': "In progress";
15
+ readonly 'done label': "Done";
16
+ readonly 'open object label': "Open";
17
+ readonly 'add object to space label': "Add to space";
18
+ readonly 'more options label': "More options";
19
+ };
20
+ };
21
+ }];
22
+ layout: string;
23
+ };
24
+ tags: string[];
25
+ };
26
+ export default meta;
27
+ export declare const _Form: StoryObj<typeof DefaultStory<Person.Person>>;
28
+ export declare const _Person: StoryObj<typeof DefaultStory<Person.Person>>;
29
+ export declare const _Organization: StoryObj<typeof DefaultStory<Organization.Organization>>;
30
+ export declare const _Project: StoryObj<typeof DefaultStory<Pipeline.Pipeline>>;
31
+ export declare const _Task: StoryObj<typeof DefaultStory<Task.Task>>;
32
+ //# sourceMappingURL=Card.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Card.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Card.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAMjE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,MAAM,EAAE,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAKvF,OAAO,EAAE,YAAY,EAA+D,MAAM,WAAW,CAAC;AAItG,QAAA,MAAM,IAAI;;;;;;;yBAboD,CACzD,IAAI,CAAC,EAAE,CAAC;;;;;;;;;;;;;;CA0BwB,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,KAAK,EAAE,QAAQ,CAAC,OAAO,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAM9D,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,OAAO,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAMhE,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,OAAO,YAAY,CAAC,YAAY,CAAC,YAAY,CAAC,CAMlF,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,OAAO,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAMrE,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,QAAQ,CAAC,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAM1D,CAAC"}
@@ -0,0 +1,19 @@
1
+ import React, { type FC } from 'react';
2
+ import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
3
+ import { Obj } from '@dxos/echo';
4
+ import { Organization, Person, Pipeline, Task } from '@dxos/types';
5
+ export type DefaultStoryProps<T extends Obj.Any> = {
6
+ Component: FC<SurfaceComponentProps<T>>;
7
+ createObject: () => T;
8
+ image?: boolean;
9
+ };
10
+ export declare const DefaultStory: <T extends Obj.Any>({ Component, createObject, image }: DefaultStoryProps<T>) => React.JSX.Element;
11
+ export declare const omitImage: ({ image: _, ...rest }: any) => any;
12
+ /**
13
+ * Factory functions for creating test objects at render time.
14
+ */
15
+ export declare const createOrganization: () => Organization.Organization;
16
+ export declare const createPerson: () => Person.Person;
17
+ export declare const createProject: () => Pipeline.Pipeline;
18
+ export declare const createTask: () => Task.Task;
19
+ //# sourceMappingURL=testing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/stories/testing.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,EAAW,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,GAAG,EAAO,MAAM,YAAY,CAAC;AAItC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnE,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,GAAG,CAAC,GAAG,IAAI;IACjD,SAAS,EAAE,EAAE,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC;IACxC,YAAY,EAAE,MAAM,CAAC,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,GAAG,CAAC,GAAG,EAAE,oCAAoC,iBAAiB,CAAC,CAAC,CAAC,sBAqBvG,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,uBAAuB,GAAG,QAAS,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,kBAAkB,QAAO,YAAY,CAAC,YAO/C,CAAC;AAEL,eAAO,MAAM,YAAY,QAAO,MAAM,CAAC,MAatC,CAAC;AAEF,eAAO,MAAM,aAAa,QAAO,QAAQ,CAAC,QAMtC,CAAC;AAEL,eAAO,MAAM,UAAU,QAAO,IAAI,CAAC,IAI/B,CAAC"}
@@ -3,6 +3,12 @@ export declare const translations: [{
3
3
  readonly 'en-US': {
4
4
  readonly [meta.id]: {
5
5
  readonly 'unable to create preview message': "No preview";
6
+ readonly 'todo label': "To do";
7
+ readonly 'in-progress label': "In progress";
8
+ readonly 'done label': "Done";
9
+ readonly 'open object label': "Open";
10
+ readonly 'add object to space label': "Add to space";
11
+ readonly 'more options label': "More options";
6
12
  };
7
13
  };
8
14
  }];
@@ -1 +1 @@
1
- {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,eAAO,MAAM,YAAY;;QAGnB,SAAA,CAAC,IAAI,CAAC,EAAE,CAAC;;UAER;;EAGwB,CAAC"}
1
+ {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,eAAO,MAAM,YAAY;;QAGnB,SAAA,CAAC,IAAI,CAAC,EAAE,CAAC;;;;;;;;UAQR;;EAGwB,CAAC"}