@dxos/plugin-preview 0.9.0 → 0.9.1-staging.ee54ba693a
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/neutral/capabilities/index.mjs +2 -2
- package/dist/lib/neutral/chunk-SXDHWUBO.mjs +32 -0
- package/dist/lib/neutral/chunk-SXDHWUBO.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +1 -1
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/meta.mjs +1 -1
- package/dist/lib/neutral/plugin.mjs +1 -1
- package/dist/lib/neutral/{preview-popover-FLMYMFCH.mjs → preview-popover-EEQQJAH5.mjs} +16 -9
- package/dist/lib/neutral/preview-popover-EEQQJAH5.mjs.map +7 -0
- package/dist/lib/neutral/{react-surface-FE7E2JP7.mjs → react-surface-2CN3DRU6.mjs} +79 -65
- package/dist/lib/neutral/react-surface-2CN3DRU6.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +1 -1
- package/dist/lib/neutral/translations.mjs.map +3 -3
- package/dist/types/dx.config.d.ts +28 -0
- package/dist/types/dx.config.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +2 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/preview-popover.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/cards/FormCard.d.ts +2 -2
- package/dist/types/src/cards/FormCard.d.ts.map +1 -1
- package/dist/types/src/cards/JsonCard.d.ts.map +1 -1
- package/dist/types/src/cards/OrganizationCard.d.ts.map +1 -1
- package/dist/types/src/cards/PersonCard.d.ts.map +1 -1
- package/dist/types/src/cards/ProjectCard.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +32 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/stories/Card.stories.d.ts +4 -6
- package/dist/types/src/stories/Card.stories.d.ts.map +1 -1
- package/dist/types/src/stories/testing.d.ts +5 -5
- package/dist/types/src/stories/testing.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +21 -0
- package/package.json +32 -30
- package/src/PreviewPlugin.test.ts +1 -1
- package/src/capabilities/preview-popover.ts +15 -13
- package/src/capabilities/react-surface.tsx +23 -25
- package/src/cards/FormCard.tsx +18 -15
- package/src/cards/JsonCard.tsx +23 -8
- package/src/cards/OrganizationCard.tsx +1 -5
- package/src/cards/PersonCard.tsx +26 -21
- package/src/cards/ProjectCard.tsx +5 -1
- package/src/meta.ts +3 -14
- package/src/stories/Card.stories.tsx +16 -35
- package/src/stories/testing.tsx +7 -2
- package/src/translations.ts +1 -1
- package/dist/lib/neutral/chunk-QOM5APM7.mjs +0 -23
- package/dist/lib/neutral/chunk-QOM5APM7.mjs.map +0 -7
- package/dist/lib/neutral/preview-popover-FLMYMFCH.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-FE7E2JP7.mjs.map +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/capabilities/index.ts
|
|
2
2
|
import { Capability } from "@dxos/app-framework";
|
|
3
|
-
var PreviewPopover = Capability.lazy("PreviewPopover", () => import("../preview-popover-
|
|
4
|
-
var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-
|
|
3
|
+
var PreviewPopover = Capability.lazy("PreviewPopover", () => import("../preview-popover-EEQQJAH5.mjs"));
|
|
4
|
+
var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-2CN3DRU6.mjs"));
|
|
5
5
|
export {
|
|
6
6
|
PreviewPopover,
|
|
7
7
|
ReactSurface
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// src/meta.ts
|
|
2
|
+
import { Plugin } from "@dxos/app-framework";
|
|
3
|
+
|
|
4
|
+
// dx.config.ts
|
|
5
|
+
import { Config2 } from "@dxos/app-framework/config";
|
|
6
|
+
import { trim } from "@dxos/util";
|
|
7
|
+
var dx_config_default = Config2.make({
|
|
8
|
+
plugin: {
|
|
9
|
+
key: "org.dxos.plugin.preview",
|
|
10
|
+
name: "Preview",
|
|
11
|
+
author: "DXOS",
|
|
12
|
+
description: trim`
|
|
13
|
+
Rich preview panel for viewing object content without opening full editors.
|
|
14
|
+
Quick peek at documents, images, and data with inline rendering.
|
|
15
|
+
`,
|
|
16
|
+
icon: {
|
|
17
|
+
key: "ph--eye--regular"
|
|
18
|
+
},
|
|
19
|
+
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-preview",
|
|
20
|
+
tags: [
|
|
21
|
+
"system"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// src/meta.ts
|
|
27
|
+
var meta = Plugin.getMetaFromConfig(dx_config_default);
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
meta
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=chunk-SXDHWUBO.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts", "../../../dx.config.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport config from '../dx.config';\n\nexport const meta = Plugin.getMetaFromConfig(config);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Config2 } from '@dxos/app-framework/config';\nimport { trim } from '@dxos/util';\n\nexport default Config2.make({\n plugin: {\n key: 'org.dxos.plugin.preview',\n name: 'Preview',\n author: 'DXOS',\n description: trim`\n Rich preview panel for viewing object content without opening full editors.\n Quick peek at documents, images, and data with inline rendering.\n `,\n icon: { key: 'ph--eye--regular' },\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-preview',\n tags: ['system'],\n },\n});\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,cAAc;;;ACAvB,SAASC,eAAe;AACxB,SAASC,YAAY;AAErB,IAAA,oBAAeD,QAAQE,KAAK;EAC1BC,QAAQ;IACNC,KAAK;IACLC,MAAM;IACNC,QAAQ;IACRC,aAAaN;;;;IAIbO,MAAM;MAAEJ,KAAK;IAAmB;IAChCK,QAAQ;IACRC,MAAM;MAAC;;EACT;AACF,CAAA;;;ADZO,IAAMC,OAAOC,OAAOC,kBAAkBC,iBAAAA;",
|
|
6
|
+
"names": ["Plugin", "Config2", "trim", "make", "plugin", "key", "name", "author", "description", "icon", "source", "tags", "meta", "Plugin", "getMetaFromConfig", "config"]
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/meta.ts":{"bytes":2096,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":368,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/PreviewPlugin.tsx":{"bytes":3129,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true}],"format":"esm"},"src/PreviewPlugin.node.ts":{"bytes":1738,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/PreviewPlugin.workerd.ts":{"bytes":1742,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/preview-popover.ts":{"bytes":14777,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/cards/ExpandoCard.tsx":{"bytes":8147,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true}],"format":"esm"},"src/cards/FormCard.tsx":{"bytes":14994,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/cards/JsonCard.tsx":{"bytes":1589,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true}],"format":"esm"},"src/cards/OrganizationCard.tsx":{"bytes":2939,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/cards/PersonCard.tsx":{"bytes":7865,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/cards/ProjectCard.tsx":{"bytes":2313,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/cards/TaskCard.tsx":{"bytes":5515,"imports":[{"path":"effect/SchemaAST","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true}],"format":"esm"},"src/cards/index.ts":{"bytes":948,"imports":[{"path":"src/cards/ExpandoCard.tsx","kind":"import-statement","original":"./ExpandoCard"},{"path":"src/cards/FormCard.tsx","kind":"import-statement","original":"./FormCard"},{"path":"src/cards/JsonCard.tsx","kind":"import-statement","original":"./JsonCard"},{"path":"src/cards/OrganizationCard.tsx","kind":"import-statement","original":"./OrganizationCard"},{"path":"src/cards/PersonCard.tsx","kind":"import-statement","original":"./PersonCard"},{"path":"src/cards/ProjectCard.tsx","kind":"import-statement","original":"./ProjectCard"},{"path":"src/cards/TaskCard.tsx","kind":"import-statement","original":"./TaskCard"}],"format":"esm"},"src/capabilities/react-surface.tsx":{"bytes":18734,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"src/cards/index.ts","kind":"import-statement","original":"../cards"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":1152,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/preview-popover.ts","kind":"dynamic-import","original":"./preview-popover"},{"path":"src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/plugin.ts":{"bytes":860,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"#plugin","kind":"dynamic-import","external":true}],"format":"esm"},"src/testing.ts":{"bytes":665,"imports":[{"path":"src/PreviewPlugin.tsx","kind":"import-statement","original":"./PreviewPlugin"}],"format":"esm"},"src/translations.ts":{"bytes":1809,"imports":[{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/neutral/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":888},"dist/lib/neutral/translations.mjs":{"imports":[{"path":"#meta","kind":"import-statement","external":true}],"exports":["translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":408}},"bytes":500},"dist/lib/neutral/preview-popover-FLMYMFCH.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6763},"dist/lib/neutral/preview-popover-FLMYMFCH.mjs":{"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/preview-popover.ts","inputs":{"src/capabilities/preview-popover.ts":{"bytesInOutput":2951}},"bytes":3093},"dist/lib/neutral/react-surface-FE7E2JP7.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":31564},"dist/lib/neutral/react-surface-FE7E2JP7.mjs":{"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"effect/SchemaAST","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface.tsx","inputs":{"src/capabilities/react-surface.tsx":{"bytesInOutput":4659},"src/cards/ExpandoCard.tsx":{"bytesInOutput":1788},"src/cards/index.ts":{"bytesInOutput":0},"src/cards/FormCard.tsx":{"bytesInOutput":2991},"src/cards/JsonCard.tsx":{"bytesInOutput":419},"src/cards/OrganizationCard.tsx":{"bytesInOutput":724},"src/cards/PersonCard.tsx":{"bytesInOutput":2060},"src/cards/ProjectCard.tsx":{"bytesInOutput":514},"src/cards/TaskCard.tsx":{"bytesInOutput":1125}},"bytes":14661},"dist/lib/neutral/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-QOM5APM7.mjs","kind":"import-statement"}],"exports":["meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":101},"dist/lib/neutral/PreviewPlugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/PreviewPlugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-3SWUVHXJ.mjs","kind":"import-statement"}],"exports":["PreviewPlugin","default"],"entryPoint":"src/PreviewPlugin.tsx","inputs":{},"bytes":188},"dist/lib/neutral/PreviewPlugin.node.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":894},"dist/lib/neutral/PreviewPlugin.node.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"exports":["PreviewPlugin","default"],"entryPoint":"src/PreviewPlugin.node.ts","inputs":{"src/PreviewPlugin.node.ts":{"bytesInOutput":379}},"bytes":525},"dist/lib/neutral/PreviewPlugin.workerd.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":897},"dist/lib/neutral/PreviewPlugin.workerd.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"exports":["PreviewPlugin","default"],"entryPoint":"src/PreviewPlugin.workerd.ts","inputs":{"src/PreviewPlugin.workerd.ts":{"bytesInOutput":382}},"bytes":537},"dist/lib/neutral/capabilities/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":610},"dist/lib/neutral/capabilities/index.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/neutral/preview-popover-FLMYMFCH.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/react-surface-FE7E2JP7.mjs","kind":"dynamic-import"}],"exports":["PreviewPopover","ReactSurface"],"entryPoint":"src/capabilities/index.ts","inputs":{"src/capabilities/index.ts":{"bytesInOutput":254}},"bytes":363},"dist/lib/neutral/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/meta.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-QOM5APM7.mjs","kind":"import-statement"}],"exports":["meta"],"entryPoint":"src/meta.ts","inputs":{},"bytes":100},"dist/lib/neutral/plugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":443},"dist/lib/neutral/plugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-QOM5APM7.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#plugin","kind":"dynamic-import","external":true}],"exports":["PreviewPlugin"],"entryPoint":"src/plugin.ts","inputs":{"src/plugin.ts":{"bytesInOutput":110}},"bytes":239},"dist/lib/neutral/chunk-QOM5APM7.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1029},"dist/lib/neutral/chunk-QOM5APM7.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":543}},"bytes":622},"dist/lib/neutral/testing.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/testing.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-3SWUVHXJ.mjs","kind":"import-statement"}],"exports":["PreviewPlugin"],"entryPoint":"src/testing.ts","inputs":{"src/testing.ts":{"bytesInOutput":0}},"bytes":121},"dist/lib/neutral/chunk-3SWUVHXJ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1643},"dist/lib/neutral/chunk-3SWUVHXJ.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true}],"exports":["PreviewPlugin","PreviewPlugin_default"],"inputs":{"src/PreviewPlugin.tsx":{"bytesInOutput":727}},"bytes":850}}}
|
|
1
|
+
{"inputs":{"dx.config.ts":{"bytes":2107,"imports":[{"path":"@dxos/app-framework/config","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/meta.ts":{"bytes":799,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dx.config.ts","kind":"import-statement","original":"../dx.config"}],"format":"esm"},"src/index.ts":{"bytes":368,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/PreviewPlugin.tsx":{"bytes":3129,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true}],"format":"esm"},"src/PreviewPlugin.node.ts":{"bytes":1738,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/PreviewPlugin.workerd.ts":{"bytes":1742,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/preview-popover.ts":{"bytes":15525,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/cards/ExpandoCard.tsx":{"bytes":8147,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true}],"format":"esm"},"src/cards/FormCard.tsx":{"bytes":14845,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/cards/JsonCard.tsx":{"bytes":3779,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true}],"format":"esm"},"src/cards/OrganizationCard.tsx":{"bytes":2557,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/cards/PersonCard.tsx":{"bytes":8309,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/cards/ProjectCard.tsx":{"bytes":2488,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/cards/TaskCard.tsx":{"bytes":5515,"imports":[{"path":"effect/SchemaAST","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true}],"format":"esm"},"src/cards/index.ts":{"bytes":948,"imports":[{"path":"src/cards/ExpandoCard.tsx","kind":"import-statement","original":"./ExpandoCard"},{"path":"src/cards/FormCard.tsx","kind":"import-statement","original":"./FormCard"},{"path":"src/cards/JsonCard.tsx","kind":"import-statement","original":"./JsonCard"},{"path":"src/cards/OrganizationCard.tsx","kind":"import-statement","original":"./OrganizationCard"},{"path":"src/cards/PersonCard.tsx","kind":"import-statement","original":"./PersonCard"},{"path":"src/cards/ProjectCard.tsx","kind":"import-statement","original":"./ProjectCard"},{"path":"src/cards/TaskCard.tsx","kind":"import-statement","original":"./TaskCard"}],"format":"esm"},"src/capabilities/react-surface.tsx":{"bytes":19058,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/cards/index.ts","kind":"import-statement","original":"../cards"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":1152,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/preview-popover.ts","kind":"dynamic-import","original":"./preview-popover"},{"path":"src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/plugin.ts":{"bytes":860,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"#plugin","kind":"dynamic-import","external":true}],"format":"esm"},"src/testing.ts":{"bytes":665,"imports":[{"path":"src/PreviewPlugin.tsx","kind":"import-statement","original":"./PreviewPlugin"}],"format":"esm"},"src/translations.ts":{"bytes":1862,"imports":[{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/neutral/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":916},"dist/lib/neutral/translations.mjs":{"imports":[{"path":"#meta","kind":"import-statement","external":true}],"exports":["translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":417}},"bytes":509},"dist/lib/neutral/preview-popover-EEQQJAH5.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6936},"dist/lib/neutral/preview-popover-EEQQJAH5.mjs":{"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/preview-popover.ts","inputs":{"src/capabilities/preview-popover.ts":{"bytesInOutput":3080}},"bytes":3222},"dist/lib/neutral/react-surface-2CN3DRU6.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":32832},"dist/lib/neutral/react-surface-2CN3DRU6.mjs":{"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"effect/SchemaAST","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface.tsx","inputs":{"src/capabilities/react-surface.tsx":{"bytesInOutput":4783},"src/cards/ExpandoCard.tsx":{"bytesInOutput":1788},"src/cards/index.ts":{"bytesInOutput":0},"src/cards/FormCard.tsx":{"bytesInOutput":2769},"src/cards/JsonCard.tsx":{"bytesInOutput":948},"src/cards/OrganizationCard.tsx":{"bytesInOutput":615},"src/cards/PersonCard.tsx":{"bytesInOutput":2220},"src/cards/ProjectCard.tsx":{"bytesInOutput":569},"src/cards/TaskCard.tsx":{"bytesInOutput":1125}},"bytes":15198},"dist/lib/neutral/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-SXDHWUBO.mjs","kind":"import-statement"}],"exports":["meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":101},"dist/lib/neutral/PreviewPlugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/PreviewPlugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-3SWUVHXJ.mjs","kind":"import-statement"}],"exports":["PreviewPlugin","default"],"entryPoint":"src/PreviewPlugin.tsx","inputs":{},"bytes":188},"dist/lib/neutral/PreviewPlugin.node.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":894},"dist/lib/neutral/PreviewPlugin.node.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"exports":["PreviewPlugin","default"],"entryPoint":"src/PreviewPlugin.node.ts","inputs":{"src/PreviewPlugin.node.ts":{"bytesInOutput":379}},"bytes":525},"dist/lib/neutral/PreviewPlugin.workerd.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":897},"dist/lib/neutral/PreviewPlugin.workerd.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"exports":["PreviewPlugin","default"],"entryPoint":"src/PreviewPlugin.workerd.ts","inputs":{"src/PreviewPlugin.workerd.ts":{"bytesInOutput":382}},"bytes":537},"dist/lib/neutral/capabilities/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":610},"dist/lib/neutral/capabilities/index.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/neutral/preview-popover-EEQQJAH5.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/react-surface-2CN3DRU6.mjs","kind":"dynamic-import"}],"exports":["PreviewPopover","ReactSurface"],"entryPoint":"src/capabilities/index.ts","inputs":{"src/capabilities/index.ts":{"bytesInOutput":254}},"bytes":363},"dist/lib/neutral/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/meta.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-SXDHWUBO.mjs","kind":"import-statement"}],"exports":["meta"],"entryPoint":"src/meta.ts","inputs":{},"bytes":100},"dist/lib/neutral/plugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":443},"dist/lib/neutral/plugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-SXDHWUBO.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#plugin","kind":"dynamic-import","external":true}],"exports":["PreviewPlugin"],"entryPoint":"src/plugin.ts","inputs":{"src/plugin.ts":{"bytesInOutput":110}},"bytes":239},"dist/lib/neutral/chunk-SXDHWUBO.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1343},"dist/lib/neutral/chunk-SXDHWUBO.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/config","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":102},"dx.config.ts":{"bytesInOutput":576}},"bytes":790},"dist/lib/neutral/testing.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/testing.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-3SWUVHXJ.mjs","kind":"import-statement"}],"exports":["PreviewPlugin"],"entryPoint":"src/testing.ts","inputs":{"src/testing.ts":{"bytesInOutput":0}},"bytes":121},"dist/lib/neutral/chunk-3SWUVHXJ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1643},"dist/lib/neutral/chunk-3SWUVHXJ.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true}],"exports":["PreviewPlugin","PreviewPlugin_default"],"inputs":{"src/PreviewPlugin.tsx":{"bytesInOutput":727}},"bytes":850}}}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/capabilities/preview-popover.ts
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
4
|
-
import { AppCapabilities,
|
|
4
|
+
import { AppCapabilities, AppSpace, LayoutOperation, Paths } from "@dxos/app-toolkit";
|
|
5
5
|
import { addEventListener } from "@dxos/async";
|
|
6
6
|
import { Obj } from "@dxos/echo";
|
|
7
7
|
import { EID } from "@dxos/keys";
|
|
@@ -13,11 +13,18 @@ var customEventOptions = {
|
|
|
13
13
|
capture: true,
|
|
14
14
|
passive: false
|
|
15
15
|
};
|
|
16
|
-
var handlePreviewLookup = async (
|
|
16
|
+
var handlePreviewLookup = async (space, { dxn, label }) => {
|
|
17
|
+
const eid = EID.tryParse(dxn);
|
|
18
|
+
if (!eid) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
17
21
|
try {
|
|
18
|
-
const object = await
|
|
22
|
+
const object = await space.db.makeRef(eid).load();
|
|
23
|
+
const resolvedLabel = Obj.getLabel(object, {
|
|
24
|
+
fallback: "typename"
|
|
25
|
+
});
|
|
19
26
|
return {
|
|
20
|
-
label,
|
|
27
|
+
label: resolvedLabel ?? label,
|
|
21
28
|
object
|
|
22
29
|
};
|
|
23
30
|
} catch {
|
|
@@ -42,12 +49,12 @@ var preview_popover_default = Capability.makeModule(Effect.fnUntraced(function*
|
|
|
42
49
|
const client = capabilities.get(ClientCapabilities.Client);
|
|
43
50
|
const registry = capabilities.get(Capabilities.AtomRegistry);
|
|
44
51
|
const [layoutAtom] = capabilities.getAll(AppCapabilities.Layout);
|
|
45
|
-
const spaceId = layoutAtom && getSpaceIdFromPath(registry.get(layoutAtom).workspace);
|
|
46
|
-
const space = (spaceId && client.spaces.get(spaceId)) ?? getPersonalSpace(client);
|
|
52
|
+
const spaceId = layoutAtom && Paths.getSpaceIdFromPath(registry.get(layoutAtom).workspace);
|
|
53
|
+
const space = (spaceId && client.spaces.get(spaceId)) ?? AppSpace.getPersonalSpace(client);
|
|
47
54
|
if (!space) {
|
|
48
55
|
return;
|
|
49
56
|
}
|
|
50
|
-
const result = await handlePreviewLookup(
|
|
57
|
+
const result = await handlePreviewLookup(space, {
|
|
51
58
|
dxn,
|
|
52
59
|
label
|
|
53
60
|
});
|
|
@@ -84,11 +91,11 @@ var preview_popover_default = Capability.makeModule(Effect.fnUntraced(function*
|
|
|
84
91
|
if (document.defaultView) {
|
|
85
92
|
cleanup = addEventListener(document.defaultView, DX_ANCHOR_ACTIVATE, handleAnchorActivate, customEventOptions);
|
|
86
93
|
} else {
|
|
87
|
-
log.warn("no default view found", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L:
|
|
94
|
+
log.warn("no default view found", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 111, S: this });
|
|
88
95
|
}
|
|
89
96
|
return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => cleanup?.()));
|
|
90
97
|
}));
|
|
91
98
|
export {
|
|
92
99
|
preview_popover_default as default
|
|
93
100
|
};
|
|
94
|
-
//# sourceMappingURL=preview-popover-
|
|
101
|
+
//# sourceMappingURL=preview-popover-EEQQJAH5.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/preview-popover.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { AppCapabilities, AppSpace, LayoutOperation, Paths } from '@dxos/app-toolkit';\nimport { addEventListener } from '@dxos/async';\nimport { type Space } from '@dxos/client/echo';\nimport { Obj } from '@dxos/echo';\nimport { EID } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { ClientCapabilities } from '@dxos/plugin-client';\nimport { DX_ANCHOR_ACTIVATE, type DxAnchorActivate } from '@dxos/react-ui';\nimport { type PreviewLinkRef, type PreviewLinkTarget } from '@dxos/ui-types';\n\nconst customEventOptions = { capture: true, passive: false };\n\n// TODO(burdon): Factor out?\nconst handlePreviewLookup = async (space: Space, { dxn, label }: PreviewLinkRef): Promise<PreviewLinkTarget | null> => {\n const eid = EID.tryParse(dxn);\n if (!eid) {\n // dxn: type URIs and other non-EID refs cannot be resolved to an object.\n return null;\n }\n try {\n const object = await space.db.makeRef(eid).load();\n const resolvedLabel = Obj.getLabel(object as any, { fallback: 'typename' });\n return { label: resolvedLabel ?? label, object };\n } catch {\n return null;\n }\n};\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n // Get context for lazy capability access in callbacks.\n const capabilities = yield* Capability.Service;\n\n // TODO(wittjosiah): Factor out lookup handlers to other plugins to make not ECHO-specific.\n // Monotonic activation token: each invocation captures its own sequence; only the\n // most recent activation is allowed to commit popover state. Prevents a slow\n // open (async lookup) from clobbering a later close that fires while it's in flight.\n let activationSequence = 0;\n const handleAnchorActivate = async ({\n dxn,\n label,\n trigger,\n kind = 'card',\n title: titleProp,\n side,\n props,\n state,\n }: DxAnchorActivate) => {\n const sequence = ++activationSequence;\n const { invokePromise } = capabilities.get(Capabilities.OperationInvoker);\n\n // Explicit close: callers pass `state: false` on pointer-leave to dismiss\n // the popover. Operation schema requires anchor + kind, so use placeholders;\n // they're overwritten in ephemeral state but only `state` is read by the UI.\n if (state === false) {\n await invokePromise(LayoutOperation.UpdatePopover, {\n variant: 'virtual',\n anchor: trigger,\n kind: 'base',\n state: false,\n });\n return;\n }\n\n const client = capabilities.get(ClientCapabilities.Client);\n const registry = capabilities.get(Capabilities.AtomRegistry);\n // Layout is optional: in standalone harnesses (Storybook, tests) no plugin contributes\n // `AppCapabilities.Layout`, and `getAll` returns an empty array. Reading `registry.get(undefined)`\n // would crash inside Atom's identity check (`'~atom/Serializable' in undefined`). When layout\n // isn't available, fall through to the personal-space default.\n const [layoutAtom] = capabilities.getAll(AppCapabilities.Layout);\n const spaceId = layoutAtom && Paths.getSpaceIdFromPath(registry.get(layoutAtom).workspace);\n const space = (spaceId && client.spaces.get(spaceId)) ?? AppSpace.getPersonalSpace(client);\n if (!space) {\n return;\n }\n const result = await handlePreviewLookup(space, { dxn, label });\n if (!result) {\n return;\n }\n // A newer activation (open or close) arrived while the lookup was in flight; bail\n // out so we don't clobber the latest state.\n if (sequence !== activationSequence) {\n return;\n }\n\n const title = titleProp ?? Obj.getLabel(result.object, { fallback: 'typename' });\n\n await invokePromise(LayoutOperation.UpdatePopover, {\n subjectRef: dxn,\n subject: result.object,\n state: true,\n variant: 'virtual',\n anchor: trigger,\n ...(kind && { kind }),\n ...(title && { title }),\n ...(side && { side }),\n ...(props && { props }),\n });\n };\n\n let cleanup: () => void;\n if (document.defaultView) {\n cleanup = addEventListener(\n document.defaultView,\n DX_ANCHOR_ACTIVATE as any,\n handleAnchorActivate,\n customEventOptions,\n );\n } else {\n log.warn('no default view found');\n }\n\n return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => cleanup?.()));\n }),\n);\n"],
|
|
5
|
+
"mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,iBAAiBC,UAAUC,iBAAiBC,aAAa;AAClE,SAASC,wBAAwB;AAEjC,SAASC,WAAW;AACpB,SAASC,WAAW;AACpB,SAASC,WAAW;AACpB,SAASC,0BAA0B;AACnC,SAASC,0BAAiD;AAG1D,IAAA,eAAMC;IAAsCC,qBAAS;EAAM,SAAA;EAE3D,SAAA;AACA;IAEE,sBAAU,OAAA,OAAA,EAAA,KAAA,MAAA,MAAA;QACR,MAAA,IAAA,SAAA,GAAA;MACA,CAAA,KAAA;AAEE,WAAA;;MAEF;UAAoDC,SAAU,MAAA,MAAA,GAAA,QAAA,GAAA,EAAA,KAAA;AAAW,UAAA,gBAAA,IAAA,SAAA,QAAA;MACzE,UAAO;;WAAiCC;MAAO,OAAA,iBAAA;MAC/C;IACA;EACF,QAAA;AACF,WAAA;EAEA;;IAGI,0BAAMC,WAAe,WAAkBC,kBAAO,aAAA;AAG9C,QAAA,eAAA,OAAA,WAAA;MAcE,qBAAmBC;QACnB,uBAAuB,OAAGF,EAAAA,KAAaG,OAAInB,SAAAA,OAAaoB,QAAAA,OAAgB,WAAA,MAAA,OAAA,MAAA,MAAA;AAExE,UAAA,WAAA,EAAA;AACA,UAAA,EAAA,cAAA,IAAA,aAAA,IAAA,aAAA,gBAAA;kBAIIC,OAAS;YACTC,cAAQC,gBAAAA,eAAAA;QACRC,SAAM;QACNC,QAAO;QACT,MAAA;QACA,OAAA;MACF,CAAA;AAEA;IACA;AACA,UAAA,SAAA,aAAA,IAAA,mBAAA,MAAA;AACA,UAAA,WAAA,aAAA,IAAA,aAAA,YAAA;AAKA,UAAMC,CAAAA,UAASC,IAAAA,aAAkBC,OAAOT,gBAAiBhB,MAAAA;AACzD,UAAKuB,UAAO,cAAA,MAAA,mBAAA,SAAA,IAAA,UAAA,EAAA,SAAA;UACV,SAAA,WAAA,OAAA,OAAA,IAAA,OAAA,MAAA,SAAA,iBAAA,MAAA;AACF,QAAA,CAAA,OAAA;AACA;;UAAuDG,SAAAA,MAAAA,oBAAAA,OAAAA;MAAM;MACzD;;AAEJ,QAAA,CAAA,QAAA;AACA;IACA;AAGA,QAAA,aAAA,oBAAA;AAEA;;AAA8E,UAAA,QAAA,aAAA,IAAA,SAAA,OAAA,QAAA;MAE9E,UAAMC;;UAEJC,cAAgBhB,gBAAM,eAAA;MACtBU,YAAO;MACPJ,SAAS,OAAA;MACTC,OAAAA;MACA,SAAIE;cAAUA;MAAK,GAAC,QAAA;QAChBQ;;MAAiB,GAAC,SAAA;QAClBC;;MAAe,GAAC,QAAA;QAChBC;;MAAiB,GAAC,SAAA;QACxB;MACF;IAEIC,CAAAA;EACJ;MACEA;AAMF,MAAA,SAAO,aAAA;AACL1B,cAAS,iBAAA,SAAA,aAAA,oBAAA,sBAAA,kBAAA;EACX,OAAA;AAEA,QAAOR,KAAAA,yBAAuBD,QAAaoC,EAAAA,YAAY,YAAaC,GAAAA,cAAWF,GAAAA,KAAAA,GAAAA,KAAAA,CAAAA;EAEjF;;;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "AppCapabilities", "AppSpace", "LayoutOperation", "Paths", "addEventListener", "Obj", "EID", "log", "ClientCapabilities", "DX_ANCHOR_ACTIVATE", "customEventOptions", "passive", "fallback", "object", "capabilities", "Service", "activationSequence", "get", "OperationInvoker", "variant", "anchor", "trigger", "kind", "state", "space", "spaceId", "spaces", "label", "invokePromise", "subject", "title", "side", "props", "cleanup", "Null", "sync"]
|
|
7
|
+
}
|
|
@@ -8,6 +8,7 @@ import { Obj as Obj5, Type as Type3 } from "@dxos/echo";
|
|
|
8
8
|
import { Card as Card8 } from "@dxos/react-ui";
|
|
9
9
|
import { Expando } from "@dxos/schema";
|
|
10
10
|
import { Organization, Person, Pipeline, Task as Task2 } from "@dxos/types";
|
|
11
|
+
import { Position } from "@dxos/util";
|
|
11
12
|
|
|
12
13
|
// src/cards/ExpandoCard.tsx
|
|
13
14
|
import * as Schema from "effect/Schema";
|
|
@@ -72,15 +73,28 @@ import React2, { useCallback as useCallback2, useMemo as useMemo2 } from "react"
|
|
|
72
73
|
import { Obj as Obj2, Type } from "@dxos/echo";
|
|
73
74
|
import { useType } from "@dxos/echo-react";
|
|
74
75
|
import { SchemaEx as SchemaEx2 } from "@dxos/effect";
|
|
75
|
-
import { Card as Card2,
|
|
76
|
+
import { Card as Card2, useTranslation } from "@dxos/react-ui";
|
|
76
77
|
import { Form as Form2, getFormProperties, omitId } from "@dxos/react-ui-form";
|
|
77
78
|
import { meta } from "#meta";
|
|
78
79
|
var FormCard = ({ subject, projection, readonly = true, layout }) => {
|
|
79
|
-
const { t } = useTranslation(meta.
|
|
80
|
+
const { t } = useTranslation(meta.profile.key);
|
|
80
81
|
const resolvedLayout = layout ?? (readonly ? "static" : "compact");
|
|
81
82
|
const staticType = Obj2.getType(subject);
|
|
82
83
|
const db = Obj2.getDatabase(subject);
|
|
83
|
-
const
|
|
84
|
+
const fallbackTypeUri = useMemo2(() => {
|
|
85
|
+
if (staticType) {
|
|
86
|
+
return void 0;
|
|
87
|
+
}
|
|
88
|
+
try {
|
|
89
|
+
return Obj2.getTypeURI(subject);
|
|
90
|
+
} catch {
|
|
91
|
+
return void 0;
|
|
92
|
+
}
|
|
93
|
+
}, [
|
|
94
|
+
staticType,
|
|
95
|
+
subject
|
|
96
|
+
]);
|
|
97
|
+
const runtimeType = useType(db, fallbackTypeUri);
|
|
84
98
|
const schema = useMemo2(() => {
|
|
85
99
|
const resolvedType = runtimeType ?? staticType;
|
|
86
100
|
return resolvedType ? omitId(Type.getSchema(resolvedType)) : void 0;
|
|
@@ -134,26 +148,33 @@ var FormCard = ({ subject, projection, readonly = true, layout }) => {
|
|
|
134
148
|
layout: resolvedLayout,
|
|
135
149
|
autoSave: true,
|
|
136
150
|
onSave: handleSave
|
|
137
|
-
}, /* @__PURE__ */ React2.createElement(Form2.Viewport, null, /* @__PURE__ */ React2.createElement(Form2.Content, null, /* @__PURE__ */ React2.createElement(Form2.FieldSet, null))))
|
|
138
|
-
fullWidth: true
|
|
139
|
-
}, /* @__PURE__ */ React2.createElement("div", {
|
|
140
|
-
className: "pt-1"
|
|
141
|
-
}, /* @__PURE__ */ React2.createElement("div", {
|
|
142
|
-
"data-hue": hue,
|
|
143
|
-
className: "inline-flex items-center gap-1 dx-tag"
|
|
144
|
-
}, /* @__PURE__ */ React2.createElement(Icon, {
|
|
145
|
-
icon
|
|
146
|
-
}), /* @__PURE__ */ React2.createElement("span", null, Obj2.getTypename(subject))))));
|
|
151
|
+
}, /* @__PURE__ */ React2.createElement(Form2.Viewport, null, /* @__PURE__ */ React2.createElement(Form2.Content, null, /* @__PURE__ */ React2.createElement(Form2.FieldSet, null)))));
|
|
147
152
|
};
|
|
148
153
|
|
|
149
154
|
// src/cards/JsonCard.tsx
|
|
150
|
-
import React3 from "react";
|
|
151
|
-
import { Card as Card3 } from "@dxos/react-ui";
|
|
155
|
+
import React3, { useState } from "react";
|
|
156
|
+
import { Card as Card3, ToggleIconButton } from "@dxos/react-ui";
|
|
152
157
|
import { JsonHighlighter } from "@dxos/react-ui-syntax-highlighter";
|
|
153
158
|
var JsonCard = ({ data }) => {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
159
|
+
const [open, setOpen] = useState(false);
|
|
160
|
+
let collapsedLength = 0;
|
|
161
|
+
try {
|
|
162
|
+
collapsedLength = JSON.stringify(data)?.length ?? 0;
|
|
163
|
+
} catch {
|
|
164
|
+
}
|
|
165
|
+
return /* @__PURE__ */ React3.createElement(Card3.Row, null, /* @__PURE__ */ React3.createElement(Card3.Block, null, /* @__PURE__ */ React3.createElement(ToggleIconButton, {
|
|
166
|
+
variant: "ghost",
|
|
167
|
+
icon: "ph--caret-right--regular",
|
|
168
|
+
iconOnly: true,
|
|
169
|
+
active: open,
|
|
170
|
+
onClick: () => setOpen(!open),
|
|
171
|
+
label: "Toggle JSON"
|
|
172
|
+
})), open && /* @__PURE__ */ React3.createElement(JsonHighlighter, {
|
|
173
|
+
data,
|
|
174
|
+
classNames: "py-1.5 col-span-full text-xs overflow-auto"
|
|
175
|
+
}) || /* @__PURE__ */ React3.createElement(Card3.Text, {
|
|
176
|
+
variant: "description"
|
|
177
|
+
}, collapsedLength));
|
|
157
178
|
};
|
|
158
179
|
|
|
159
180
|
// src/cards/OrganizationCard.tsx
|
|
@@ -161,14 +182,9 @@ import React4 from "react";
|
|
|
161
182
|
import { Card as Card4 } from "@dxos/react-ui";
|
|
162
183
|
var OrganizationCard = ({ subject }) => {
|
|
163
184
|
const { name, image, description, website } = subject;
|
|
164
|
-
return /* @__PURE__ */ React4.createElement(Card4.Body, null, /* @__PURE__ */ React4.createElement(Card4.Poster, {
|
|
185
|
+
return /* @__PURE__ */ React4.createElement(Card4.Body, null, image && /* @__PURE__ */ React4.createElement(Card4.Poster, {
|
|
165
186
|
alt: name ?? "",
|
|
166
|
-
|
|
167
|
-
image
|
|
168
|
-
} : {
|
|
169
|
-
icon: "ph--building-office--regular"
|
|
170
|
-
},
|
|
171
|
-
classNames: !image && "opacity-50"
|
|
187
|
+
image
|
|
172
188
|
}), description && /* @__PURE__ */ React4.createElement(Card4.Row, null, /* @__PURE__ */ React4.createElement(Card4.Text, {
|
|
173
189
|
variant: "description"
|
|
174
190
|
}, description)), website && /* @__PURE__ */ React4.createElement(Card4.Link, {
|
|
@@ -181,11 +197,11 @@ var OrganizationCard = ({ subject }) => {
|
|
|
181
197
|
import * as Effect from "effect/Effect";
|
|
182
198
|
import React5, { useCallback as useCallback3 } from "react";
|
|
183
199
|
import { useOperationInvoker } from "@dxos/app-framework/ui";
|
|
184
|
-
import { LayoutOperation,
|
|
200
|
+
import { LayoutOperation, Paths } from "@dxos/app-toolkit";
|
|
185
201
|
import { Obj as Obj3 } from "@dxos/echo";
|
|
186
202
|
import { EffectEx } from "@dxos/effect";
|
|
187
203
|
import { Avatar } from "@dxos/react-ui";
|
|
188
|
-
import { Card as Card5 } from "@dxos/react-ui";
|
|
204
|
+
import { Card as Card5, Icon } from "@dxos/react-ui";
|
|
189
205
|
var PersonCard = ({ subject }) => {
|
|
190
206
|
const { invoke } = useOperationInvoker();
|
|
191
207
|
const { image, organization: { target: organization } = {}, emails = [] } = subject;
|
|
@@ -194,7 +210,7 @@ var PersonCard = ({ subject }) => {
|
|
|
194
210
|
return;
|
|
195
211
|
}
|
|
196
212
|
return Effect.gen(function* () {
|
|
197
|
-
const organizationPath = getObjectPathFromObject(organization);
|
|
213
|
+
const organizationPath = Paths.getObjectPathFromObject(organization);
|
|
198
214
|
const db = Obj3.getDatabase(organization);
|
|
199
215
|
yield* invoke(LayoutOperation.UpdatePopover, {
|
|
200
216
|
state: false,
|
|
@@ -204,32 +220,33 @@ var PersonCard = ({ subject }) => {
|
|
|
204
220
|
subject: [
|
|
205
221
|
organizationPath
|
|
206
222
|
],
|
|
207
|
-
workspace: db ? getSpacePath(db.spaceId) : void 0
|
|
223
|
+
workspace: db ? Paths.getSpacePath(db.spaceId) : void 0
|
|
208
224
|
});
|
|
209
225
|
}).pipe(EffectEx.runAndForwardErrors);
|
|
210
226
|
}, [
|
|
211
227
|
invoke,
|
|
212
228
|
organization
|
|
213
229
|
]);
|
|
214
|
-
return /* @__PURE__ */ React5.createElement(Card5.Body, null, /* @__PURE__ */ React5.createElement(Avatar.Root, null,
|
|
215
|
-
className: "py-1"
|
|
216
|
-
}, /* @__PURE__ */ React5.createElement(Avatar.Content, {
|
|
230
|
+
return /* @__PURE__ */ React5.createElement(Card5.Body, null, image && /* @__PURE__ */ React5.createElement(Card5.Row, null, /* @__PURE__ */ React5.createElement(Avatar.Root, null, /* @__PURE__ */ React5.createElement(Avatar.Content, {
|
|
217
231
|
imgSrc: image,
|
|
218
232
|
icon: "ph--user--regular",
|
|
219
233
|
size: 20,
|
|
220
|
-
classNames:
|
|
234
|
+
classNames: [
|
|
235
|
+
!image && "opacity-50"
|
|
236
|
+
],
|
|
221
237
|
hue: "neutral",
|
|
222
238
|
variant: "square"
|
|
223
|
-
})), organization?.name && /* @__PURE__ */ React5.createElement(Card5.Action, {
|
|
239
|
+
}))), organization?.name && /* @__PURE__ */ React5.createElement(Card5.Action, {
|
|
224
240
|
icon: "ph--buildings--regular",
|
|
225
241
|
label: organization.name,
|
|
226
242
|
onClick: handleOrganizationClick
|
|
227
|
-
}), emails.
|
|
228
|
-
key: value,
|
|
243
|
+
}), emails.length > 0 && /* @__PURE__ */ React5.createElement(Card5.Row, null, /* @__PURE__ */ React5.createElement(Card5.Block, null, /* @__PURE__ */ React5.createElement(Icon, {
|
|
229
244
|
icon: "ph--at--regular"
|
|
230
|
-
}, /* @__PURE__ */ React5.createElement(Card5.Text, {
|
|
245
|
+
})), /* @__PURE__ */ React5.createElement(Card5.Text, {
|
|
231
246
|
truncate: true,
|
|
232
|
-
className: "text-
|
|
247
|
+
className: "text-sky-text text-sm"
|
|
248
|
+
}, emails.map(({ value }) => /* @__PURE__ */ React5.createElement("div", {
|
|
249
|
+
key: value
|
|
233
250
|
}, value)))));
|
|
234
251
|
};
|
|
235
252
|
|
|
@@ -243,9 +260,9 @@ var ProjectCard = ({ subject }) => {
|
|
|
243
260
|
image,
|
|
244
261
|
alt: Obj4.getLabel(subject) ?? "",
|
|
245
262
|
aspect: "auto"
|
|
246
|
-
}), description && /* @__PURE__ */ React6.createElement(Card6.Text, {
|
|
263
|
+
}), description && /* @__PURE__ */ React6.createElement(Card6.Row, null, /* @__PURE__ */ React6.createElement(Card6.Text, {
|
|
247
264
|
variant: "description"
|
|
248
|
-
}, description));
|
|
265
|
+
}, description)));
|
|
249
266
|
};
|
|
250
267
|
|
|
251
268
|
// src/cards/TaskCard.tsx
|
|
@@ -279,8 +296,8 @@ var react_surface_default = Capability.makeModule(() => Effect2.succeed(Capabili
|
|
|
279
296
|
//
|
|
280
297
|
Surface.create({
|
|
281
298
|
id: "schemaPopoverContact",
|
|
282
|
-
position:
|
|
283
|
-
filter: AppSurface.object(AppSurface.
|
|
299
|
+
position: Position.first,
|
|
300
|
+
filter: AppSurface.object(AppSurface.CardContent, Person.Person),
|
|
284
301
|
component: ({ data, role }) => {
|
|
285
302
|
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(PersonCard, {
|
|
286
303
|
role,
|
|
@@ -294,8 +311,8 @@ var react_surface_default = Capability.makeModule(() => Effect2.succeed(Capabili
|
|
|
294
311
|
}),
|
|
295
312
|
Surface.create({
|
|
296
313
|
id: "schemaPopoverOrganization",
|
|
297
|
-
position:
|
|
298
|
-
filter: AppSurface.object(AppSurface.
|
|
314
|
+
position: Position.first,
|
|
315
|
+
filter: AppSurface.object(AppSurface.CardContent, Organization.Organization),
|
|
299
316
|
component: ({ data, role }) => {
|
|
300
317
|
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(OrganizationCard, {
|
|
301
318
|
role,
|
|
@@ -309,8 +326,8 @@ var react_surface_default = Capability.makeModule(() => Effect2.succeed(Capabili
|
|
|
309
326
|
}),
|
|
310
327
|
Surface.create({
|
|
311
328
|
id: "schemaPopoverProject",
|
|
312
|
-
position:
|
|
313
|
-
filter: AppSurface.object(AppSurface.
|
|
329
|
+
position: Position.first,
|
|
330
|
+
filter: AppSurface.object(AppSurface.CardContent, Pipeline.Pipeline),
|
|
314
331
|
component: ({ data, role }) => {
|
|
315
332
|
return /* @__PURE__ */ React8.createElement(ProjectCard, {
|
|
316
333
|
role,
|
|
@@ -320,8 +337,8 @@ var react_surface_default = Capability.makeModule(() => Effect2.succeed(Capabili
|
|
|
320
337
|
}),
|
|
321
338
|
Surface.create({
|
|
322
339
|
id: "schemaPopoverTask",
|
|
323
|
-
position:
|
|
324
|
-
filter: AppSurface.object(AppSurface.
|
|
340
|
+
position: Position.first,
|
|
341
|
+
filter: AppSurface.object(AppSurface.CardContent, Task2.Task),
|
|
325
342
|
component: ({ data, role }) => {
|
|
326
343
|
return /* @__PURE__ */ React8.createElement(TaskCard, {
|
|
327
344
|
role,
|
|
@@ -331,7 +348,7 @@ var react_surface_default = Capability.makeModule(() => Effect2.succeed(Capabili
|
|
|
331
348
|
}),
|
|
332
349
|
Surface.create({
|
|
333
350
|
id: "schemaPopoverExpando",
|
|
334
|
-
filter: AppSurface.object(AppSurface.
|
|
351
|
+
filter: AppSurface.object(AppSurface.CardContent, Expando.Expando),
|
|
335
352
|
component: ({ data, role }) => {
|
|
336
353
|
return /* @__PURE__ */ React8.createElement(ExpandoCard, {
|
|
337
354
|
role,
|
|
@@ -342,23 +359,22 @@ var react_surface_default = Capability.makeModule(() => Effect2.succeed(Capabili
|
|
|
342
359
|
}),
|
|
343
360
|
Surface.create({
|
|
344
361
|
id: "schemaPopoverDynamicType",
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
if (!Obj5.isObject(data.subject)) {
|
|
362
|
+
filter: AppSurface.subject(AppSurface.CardContent, (subject) => {
|
|
363
|
+
if (!Obj5.isObject(subject)) {
|
|
348
364
|
return false;
|
|
349
365
|
}
|
|
350
|
-
const type = Obj5.getType(
|
|
366
|
+
const type = Obj5.getType(subject);
|
|
351
367
|
if (type) {
|
|
352
368
|
return Type3.getDatabase(type) != null;
|
|
353
369
|
}
|
|
354
370
|
try {
|
|
355
|
-
const db = Obj5.getDatabase(
|
|
356
|
-
const typename = Obj5.getTypename(
|
|
371
|
+
const db = Obj5.getDatabase(subject);
|
|
372
|
+
const typename = Obj5.getTypename(subject);
|
|
357
373
|
return !!db && !!typename && db.graph.registry.list().filter(Type3.isType).some((t) => Type3.getTypename(t) === typename);
|
|
358
374
|
} catch {
|
|
359
375
|
return false;
|
|
360
376
|
}
|
|
361
|
-
},
|
|
377
|
+
}),
|
|
362
378
|
component: ({ data, role }) => {
|
|
363
379
|
return /* @__PURE__ */ React8.createElement(FormCard, {
|
|
364
380
|
role,
|
|
@@ -373,9 +389,8 @@ var react_surface_default = Capability.makeModule(() => Effect2.succeed(Capabili
|
|
|
373
389
|
//
|
|
374
390
|
Surface.create({
|
|
375
391
|
id: "fallbackPopover",
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
filter: (data) => Obj5.isObject(data.subject),
|
|
392
|
+
position: Position.last,
|
|
393
|
+
filter: AppSurface.subject(AppSurface.CardContent, Obj5.isObject),
|
|
379
394
|
component: ({ data, role }) => {
|
|
380
395
|
return /* @__PURE__ */ React8.createElement(FormCard, {
|
|
381
396
|
role,
|
|
@@ -386,9 +401,8 @@ var react_surface_default = Capability.makeModule(() => Effect2.succeed(Capabili
|
|
|
386
401
|
}),
|
|
387
402
|
Surface.create({
|
|
388
403
|
id: "fallbackJson",
|
|
389
|
-
|
|
390
|
-
position:
|
|
391
|
-
filter: (data) => true,
|
|
404
|
+
filter: Surface.makeFilter(AppSurface.CardContent),
|
|
405
|
+
position: Position.last,
|
|
392
406
|
component: ({ data }) => {
|
|
393
407
|
return /* @__PURE__ */ React8.createElement(JsonCard, {
|
|
394
408
|
data
|
|
@@ -397,7 +411,7 @@ var react_surface_default = Capability.makeModule(() => Effect2.succeed(Capabili
|
|
|
397
411
|
}),
|
|
398
412
|
Surface.create({
|
|
399
413
|
id: "section",
|
|
400
|
-
position:
|
|
414
|
+
position: Position.last,
|
|
401
415
|
filter: AppSurface.subject(AppSurface.Section, Obj5.isObject),
|
|
402
416
|
component: ({ data }) => {
|
|
403
417
|
return /* @__PURE__ */ React8.createElement("div", {
|
|
@@ -405,7 +419,7 @@ var react_surface_default = Capability.makeModule(() => Effect2.succeed(Capabili
|
|
|
405
419
|
}, /* @__PURE__ */ React8.createElement("div", {
|
|
406
420
|
className: "py-2 dx-card-min-width dx-card-max-width"
|
|
407
421
|
}, /* @__PURE__ */ React8.createElement(Card8.Root, null, /* @__PURE__ */ React8.createElement(Surface.Surface, {
|
|
408
|
-
type: AppSurface.
|
|
422
|
+
type: AppSurface.CardContent,
|
|
409
423
|
data,
|
|
410
424
|
limit: 1
|
|
411
425
|
}))));
|
|
@@ -415,4 +429,4 @@ var react_surface_default = Capability.makeModule(() => Effect2.succeed(Capabili
|
|
|
415
429
|
export {
|
|
416
430
|
react_surface_default as default
|
|
417
431
|
};
|
|
418
|
-
//# sourceMappingURL=react-surface-
|
|
432
|
+
//# sourceMappingURL=react-surface-2CN3DRU6.mjs.map
|