@dxos/plugin-template 0.8.4-main.937b3ca → 0.8.4-main.9be5663bfe
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/index.mjs +53 -32
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/types/index.mjs +16 -3
- package/dist/lib/browser/types/index.mjs.map +4 -4
- package/dist/types/src/TemplatePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +2 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/TemplatePanel/TemplatePanel.d.ts +6 -0
- package/dist/types/src/components/TemplatePanel/TemplatePanel.d.ts.map +1 -0
- package/dist/types/src/components/TemplatePanel/index.d.ts +2 -0
- package/dist/types/src/components/TemplatePanel/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +12 -11
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +1 -1
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +27 -20
- package/src/TemplatePlugin.tsx +26 -12
- package/src/capabilities/index.ts +3 -1
- package/src/capabilities/react-surface.tsx +29 -0
- package/src/components/TemplatePanel/TemplatePanel.tsx +21 -0
- package/src/components/TemplatePanel/index.ts +5 -0
- package/src/components/index.ts +1 -1
- package/src/meta.ts +1 -1
- package/src/translations.ts +12 -11
- package/src/types/schema.ts +6 -2
- package/dist/lib/browser/chunk-HRH4SQLU.mjs +0 -18
- package/dist/lib/browser/chunk-HRH4SQLU.mjs.map +0 -7
- package/dist/lib/browser/chunk-TRYLFURO.mjs +0 -18
- package/dist/lib/browser/chunk-TRYLFURO.mjs.map +0 -7
- package/dist/lib/browser/react-surface-FXQGYDUN.mjs +0 -39
- package/dist/lib/browser/react-surface-FXQGYDUN.mjs.map +0 -7
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/components/TemplateContainer.d.ts +0 -6
- package/dist/types/src/components/TemplateContainer.d.ts.map +0 -1
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -29
- package/src/components/TemplateContainer.tsx +0 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-template",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.9be5663bfe",
|
|
4
4
|
"description": "Template for new plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -12,6 +12,12 @@
|
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#capabilities": "./src/capabilities/index.ts",
|
|
17
|
+
"#components": "./src/components/index.ts",
|
|
18
|
+
"#meta": "./src/meta.ts",
|
|
19
|
+
"#types": "./src/types/index.ts"
|
|
20
|
+
},
|
|
15
21
|
"exports": {
|
|
16
22
|
".": {
|
|
17
23
|
"source": "./src/index.ts",
|
|
@@ -38,35 +44,36 @@
|
|
|
38
44
|
],
|
|
39
45
|
"dependencies": {
|
|
40
46
|
"@radix-ui/react-context": "1.1.1",
|
|
41
|
-
"effect": "3.
|
|
42
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/plugin-space": "0.8.4-main.
|
|
49
|
-
"@dxos/react-client": "0.8.4-main.
|
|
50
|
-
"@dxos/react-ui-
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
47
|
+
"effect": "3.20.0",
|
|
48
|
+
"@dxos/app-framework": "0.8.4-main.9be5663bfe",
|
|
49
|
+
"@dxos/app-toolkit": "0.8.4-main.9be5663bfe",
|
|
50
|
+
"@dxos/plugin-client": "0.8.4-main.9be5663bfe",
|
|
51
|
+
"@dxos/async": "0.8.4-main.9be5663bfe",
|
|
52
|
+
"@dxos/plugin-graph": "0.8.4-main.9be5663bfe",
|
|
53
|
+
"@dxos/echo": "0.8.4-main.9be5663bfe",
|
|
54
|
+
"@dxos/plugin-space": "0.8.4-main.9be5663bfe",
|
|
55
|
+
"@dxos/react-client": "0.8.4-main.9be5663bfe",
|
|
56
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.9be5663bfe",
|
|
57
|
+
"@dxos/util": "0.8.4-main.9be5663bfe",
|
|
58
|
+
"@dxos/react-ui-stack": "0.8.4-main.9be5663bfe",
|
|
59
|
+
"@dxos/operation": "0.8.4-main.9be5663bfe"
|
|
53
60
|
},
|
|
54
61
|
"devDependencies": {
|
|
55
62
|
"@types/react": "~19.2.7",
|
|
56
63
|
"@types/react-dom": "~19.2.3",
|
|
57
64
|
"react": "~19.2.3",
|
|
58
65
|
"react-dom": "~19.2.3",
|
|
59
|
-
"vite": "7.1.
|
|
60
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
66
|
+
"vite": "^7.1.11",
|
|
67
|
+
"@dxos/react-ui": "0.8.4-main.9be5663bfe",
|
|
68
|
+
"@dxos/storybook-utils": "0.8.4-main.9be5663bfe",
|
|
69
|
+
"@dxos/ui-theme": "0.8.4-main.9be5663bfe"
|
|
63
70
|
},
|
|
64
71
|
"peerDependencies": {
|
|
65
|
-
"effect": "3.
|
|
72
|
+
"effect": "3.20.0",
|
|
66
73
|
"react": "~19.2.3",
|
|
67
74
|
"react-dom": "~19.2.3",
|
|
68
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
69
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
75
|
+
"@dxos/react-ui": "0.8.4-main.9be5663bfe",
|
|
76
|
+
"@dxos/ui-theme": "0.8.4-main.9be5663bfe"
|
|
70
77
|
},
|
|
71
78
|
"publishConfig": {
|
|
72
79
|
"access": "public"
|
package/src/TemplatePlugin.tsx
CHANGED
|
@@ -3,29 +3,43 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Option from 'effect/Option';
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
+
import { Plugin } from '@dxos/app-framework';
|
|
9
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
10
|
+
import { Annotation } from '@dxos/echo';
|
|
11
|
+
import { Operation } from '@dxos/operation';
|
|
12
|
+
import { SpaceOperation } from '@dxos/plugin-space/operations';
|
|
8
13
|
import { type CreateObject } from '@dxos/plugin-space/types';
|
|
9
14
|
|
|
10
|
-
import { ReactSurface } from '
|
|
11
|
-
import { meta } from '
|
|
15
|
+
import { ReactSurface } from '#capabilities';
|
|
16
|
+
import { meta } from '#meta';
|
|
17
|
+
import { Template } from '#types';
|
|
18
|
+
|
|
12
19
|
import { translations } from './translations';
|
|
13
|
-
import { Template } from './types';
|
|
14
20
|
|
|
15
21
|
export const TemplatePlugin = Plugin.define(meta).pipe(
|
|
16
|
-
|
|
17
|
-
Common.Plugin.addMetadataModule({
|
|
22
|
+
AppPlugin.addMetadataModule({
|
|
18
23
|
metadata: {
|
|
19
24
|
id: Template.Data.typename,
|
|
20
25
|
metadata: {
|
|
21
|
-
icon:
|
|
22
|
-
iconHue: '
|
|
23
|
-
createObject: ((props
|
|
24
|
-
|
|
26
|
+
icon: Annotation.IconAnnotation.get(Template.Data).pipe(Option.getOrThrow).icon,
|
|
27
|
+
iconHue: Annotation.IconAnnotation.get(Template.Data).pipe(Option.getOrThrow).hue ?? 'white',
|
|
28
|
+
createObject: ((props, options) =>
|
|
29
|
+
Effect.gen(function* () {
|
|
30
|
+
const object = Template.make(props);
|
|
31
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
32
|
+
object,
|
|
33
|
+
target: options.target,
|
|
34
|
+
hidden: true,
|
|
35
|
+
targetNodeId: options.targetNodeId,
|
|
36
|
+
});
|
|
37
|
+
})) satisfies CreateObject,
|
|
25
38
|
},
|
|
26
39
|
},
|
|
27
40
|
}),
|
|
28
|
-
|
|
29
|
-
|
|
41
|
+
AppPlugin.addSchemaModule({ schema: [Template.Data] }),
|
|
42
|
+
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
43
|
+
AppPlugin.addTranslationsModule({ translations }),
|
|
30
44
|
Plugin.make,
|
|
31
45
|
);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
10
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
11
|
+
|
|
12
|
+
import { TemplatePanel } from '#components';
|
|
13
|
+
import { Template } from '#types';
|
|
14
|
+
|
|
15
|
+
export default Capability.makeModule(() =>
|
|
16
|
+
Effect.succeed(
|
|
17
|
+
Capability.contributes(
|
|
18
|
+
Capabilities.ReactSurface,
|
|
19
|
+
Surface.create({
|
|
20
|
+
id: 'root',
|
|
21
|
+
role: 'article',
|
|
22
|
+
filter: AppSurface.objectArticle(Template.Data),
|
|
23
|
+
component: ({ data, role }) => (
|
|
24
|
+
<TemplatePanel role={role} subject={data.subject} attendableId={data.attendableId} />
|
|
25
|
+
),
|
|
26
|
+
}),
|
|
27
|
+
),
|
|
28
|
+
),
|
|
29
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { Obj } from '@dxos/echo';
|
|
9
|
+
import { Panel } from '@dxos/react-ui';
|
|
10
|
+
|
|
11
|
+
export type TemplatePanelProps = AppSurface.ObjectArticleProps<Obj.Unknown>;
|
|
12
|
+
|
|
13
|
+
export const TemplatePanel = ({ role, subject: object, attendableId: _attendableId }: TemplatePanelProps) => {
|
|
14
|
+
return (
|
|
15
|
+
<Panel.Root role={role} className='dx-document'>
|
|
16
|
+
<Panel.Content>
|
|
17
|
+
<span>{Obj.getDXN(object).toString()}</span>
|
|
18
|
+
</Panel.Content>
|
|
19
|
+
</Panel.Root>
|
|
20
|
+
);
|
|
21
|
+
};
|
package/src/components/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { type Plugin } from '@dxos/app-framework';
|
|
|
6
6
|
import { trim } from '@dxos/util';
|
|
7
7
|
|
|
8
8
|
export const meta: Plugin.Meta = {
|
|
9
|
-
id: 'dxos.
|
|
9
|
+
id: 'org.dxos.plugin.template',
|
|
10
10
|
name: 'Template',
|
|
11
11
|
description: trim`
|
|
12
12
|
Create reusable templates for documents, tables, and other objects.
|
package/src/translations.ts
CHANGED
|
@@ -4,24 +4,25 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Resource } from '@dxos/react-ui';
|
|
6
6
|
|
|
7
|
-
import { meta } from '
|
|
8
|
-
import { Template } from '
|
|
7
|
+
import { meta } from '#meta';
|
|
8
|
+
import { Template } from '#types';
|
|
9
9
|
|
|
10
10
|
export const translations = [
|
|
11
11
|
{
|
|
12
12
|
'en-US': {
|
|
13
13
|
[Template.Data.typename]: {
|
|
14
|
-
'typename
|
|
15
|
-
'typename
|
|
16
|
-
'typename
|
|
17
|
-
'typename
|
|
18
|
-
'object
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'object
|
|
14
|
+
'typename.label': 'Template',
|
|
15
|
+
'typename.label_zero': 'Templates',
|
|
16
|
+
'typename.label_one': 'Template',
|
|
17
|
+
'typename.label_other': 'Templates',
|
|
18
|
+
'object-name.placeholder': 'New template',
|
|
19
|
+
'add-object.label': 'Add template',
|
|
20
|
+
'rename-object.label': 'Rename template',
|
|
21
|
+
'delete-object.label': 'Delete template',
|
|
22
|
+
'object-deleted.label': 'Template deleted',
|
|
22
23
|
},
|
|
23
24
|
[meta.id]: {
|
|
24
|
-
'plugin
|
|
25
|
+
'plugin.name': 'Template',
|
|
25
26
|
},
|
|
26
27
|
},
|
|
27
28
|
},
|
package/src/types/schema.ts
CHANGED
|
@@ -4,16 +4,20 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import { Obj, Type } from '@dxos/echo';
|
|
7
|
+
import { Annotation, Obj, Type } from '@dxos/echo';
|
|
8
8
|
|
|
9
9
|
export namespace Template {
|
|
10
10
|
export const Data = Schema.Struct({
|
|
11
11
|
name: Schema.optional(Schema.String),
|
|
12
12
|
}).pipe(
|
|
13
13
|
Type.object({
|
|
14
|
-
typename: 'dxos.
|
|
14
|
+
typename: 'org.dxos.type.data',
|
|
15
15
|
version: '0.1.0',
|
|
16
16
|
}),
|
|
17
|
+
Annotation.IconAnnotation.set({
|
|
18
|
+
icon: 'ph--asterisk--regular',
|
|
19
|
+
hue: 'sky',
|
|
20
|
+
}),
|
|
17
21
|
);
|
|
18
22
|
|
|
19
23
|
export type Data = Schema.Schema.Type<typeof Data>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// src/types/schema.ts
|
|
2
|
-
import * as Schema from "effect/Schema";
|
|
3
|
-
import { Obj, Type } from "@dxos/echo";
|
|
4
|
-
(function(Template2) {
|
|
5
|
-
Template2.Data = Schema.Struct({
|
|
6
|
-
name: Schema.optional(Schema.String)
|
|
7
|
-
}).pipe(Type.object({
|
|
8
|
-
typename: "dxos.org/type/Data",
|
|
9
|
-
version: "0.1.0"
|
|
10
|
-
}));
|
|
11
|
-
Template2.make = (props) => Obj.make(Template2.Data, props);
|
|
12
|
-
})(Template || (Template = {}));
|
|
13
|
-
var Template;
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
Template
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=chunk-HRH4SQLU.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/schema.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Obj, Type } from '@dxos/echo';\n\nexport namespace Template {\n export const Data = Schema.Struct({\n name: Schema.optional(Schema.String),\n }).pipe(\n Type.object({\n typename: 'dxos.org/type/Data',\n version: '0.1.0',\n }),\n );\n\n export type Data = Schema.Schema.Type<typeof Data>;\n\n export const make = (props: Partial<Data>) => Obj.make(Data, props);\n}\n"],
|
|
5
|
-
"mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,KAAKC,YAAY;UAETC,WAAAA;YACFC,OAAcC,cAAO;IAChCC,MAAaC,gBAAgBC,aAAM;EACrC,CAAA,EAAGC,KACDC,KAAKC,OAAO;IACVC,UAAU;IACVC,SAAS;EACX,CAAA,CAAA;YAKWC,OAAO,CAACC,UAAyBC,IAAIF,KAAIX,UAACC,MAAMW,KAAAA;AAC/D,GAbiBZ,aAAAA,WAAAA,CAAAA,EAAAA;;",
|
|
6
|
-
"names": ["Schema", "Obj", "Type", "Template", "Data", "Struct", "name", "optional", "String", "pipe", "Type", "object", "typename", "version", "make", "props", "Obj"]
|
|
7
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// src/meta.ts
|
|
2
|
-
import { trim } from "@dxos/util";
|
|
3
|
-
var meta = {
|
|
4
|
-
id: "dxos.org/plugin/template",
|
|
5
|
-
name: "Template",
|
|
6
|
-
description: trim`
|
|
7
|
-
Create reusable templates for documents, tables, and other objects.
|
|
8
|
-
Define structured patterns that can be quickly instantiated with pre-configured content and settings.
|
|
9
|
-
`,
|
|
10
|
-
icon: "ph--asterisk--regular",
|
|
11
|
-
iconHue: "sky",
|
|
12
|
-
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-template"
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
meta
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=chunk-TRYLFURO.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'dxos.org/plugin/template',\n name: 'Template',\n description: trim`\n Create reusable templates for documents, tables, and other objects.\n Define structured patterns that can be quickly instantiated with pre-configured content and settings.\n `,\n icon: 'ph--asterisk--regular',\n iconHue: 'sky',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-template',\n};\n"],
|
|
5
|
-
"mappings": ";AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;EACNC,SAAS;EACTC,QAAQ;AACV;",
|
|
6
|
-
"names": ["trim", "meta", "id", "name", "description", "trim", "icon", "iconHue", "source"]
|
|
7
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
meta
|
|
3
|
-
} from "./chunk-TRYLFURO.mjs";
|
|
4
|
-
import {
|
|
5
|
-
Template
|
|
6
|
-
} from "./chunk-HRH4SQLU.mjs";
|
|
7
|
-
|
|
8
|
-
// src/capabilities/react-surface/react-surface.tsx
|
|
9
|
-
import * as Effect from "effect/Effect";
|
|
10
|
-
import React2 from "react";
|
|
11
|
-
import { Capability, Common } from "@dxos/app-framework";
|
|
12
|
-
import { Obj as Obj2 } from "@dxos/echo";
|
|
13
|
-
|
|
14
|
-
// src/components/TemplateContainer.tsx
|
|
15
|
-
import React from "react";
|
|
16
|
-
import { Obj } from "@dxos/echo";
|
|
17
|
-
import { Layout } from "@dxos/react-ui-mosaic";
|
|
18
|
-
var TemplateContainer = ({ role, subject: object }) => {
|
|
19
|
-
return /* @__PURE__ */ React.createElement(Layout.Main, {
|
|
20
|
-
role
|
|
21
|
-
}, /* @__PURE__ */ React.createElement("pre", {
|
|
22
|
-
className: "m-4 p-2 ring"
|
|
23
|
-
}, /* @__PURE__ */ React.createElement("span", null, Obj.getDXN(object).toString())));
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
// src/capabilities/react-surface/react-surface.tsx
|
|
27
|
-
var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Common.Capability.ReactSurface, Common.createSurface({
|
|
28
|
-
id: meta.id,
|
|
29
|
-
role: "article",
|
|
30
|
-
filter: (data) => Obj2.instanceOf(Template.Data, data.subject),
|
|
31
|
-
component: ({ data, role }) => /* @__PURE__ */ React2.createElement(TemplateContainer, {
|
|
32
|
-
role,
|
|
33
|
-
subject: data.subject
|
|
34
|
-
})
|
|
35
|
-
}))));
|
|
36
|
-
export {
|
|
37
|
-
react_surface_default as default
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=react-surface-FXQGYDUN.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface/react-surface.tsx", "../../../src/components/TemplateContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capability, Common } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\n\nimport { TemplateContainer } from '../../components';\nimport { meta } from '../../meta';\nimport { Template } from '../../types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(\n Common.Capability.ReactSurface,\n Common.createSurface({\n id: meta.id,\n role: 'article',\n filter: (data): data is { subject: Obj.Unknown } => Obj.instanceOf(Template.Data, data.subject),\n component: ({ data, role }: { data: { subject: Obj.Unknown }; role: string }) => (\n <TemplateContainer role={role} subject={data.subject} />\n ),\n }),\n ),\n ),\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-framework/react';\nimport { Obj } from '@dxos/echo';\nimport { Layout } from '@dxos/react-ui-mosaic';\n\nexport type TemplateContainerProps = SurfaceComponentProps<Obj.Unknown>;\n\nexport const TemplateContainer = ({ role, subject: object }: TemplateContainerProps) => {\n return (\n <Layout.Main role={role}>\n <pre className='m-4 p-2 ring'>\n <span>{Obj.getDXN(object).toString()}</span>\n </pre>\n </Layout.Main>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,YAAW;AAElB,SAASC,YAAYC,cAAc;AACnC,SAASC,OAAAA,YAAW;;;ACJpB,OAAOC,WAAW;AAGlB,SAASC,WAAW;AACpB,SAASC,cAAc;AAIhB,IAAMC,oBAAoB,CAAC,EAAEC,MAAMC,SAASC,OAAM,MAA0B;AACjF,SACE,sBAAA,cAACC,OAAOC,MAAI;IAACJ;KACX,sBAAA,cAACK,OAAAA;IAAIC,WAAU;KACb,sBAAA,cAACC,QAAAA,MAAMC,IAAIC,OAAOP,MAAAA,EAAQQ,SAAQ,CAAA,CAAA,CAAA;AAI1C;;;ADNA,IAAA,wBAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YACTC,OAAOJ,WAAWK,cAClBD,OAAOE,cAAc;EACnBC,IAAIC,KAAKD;EACTE,MAAM;EACNC,QAAQ,CAACC,SAA2CC,KAAIC,WAAWC,SAASC,MAAMJ,KAAKK,OAAO;EAC9FC,WAAW,CAAC,EAAEN,MAAMF,KAAI,MACtB,gBAAAS,OAAA,cAACC,mBAAAA;IAAkBV;IAAYO,SAASL,KAAKK;;AAEjD,CAAA,CAAA,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "React", "Capability", "Common", "Obj", "React", "Obj", "Layout", "TemplateContainer", "role", "subject", "object", "Layout", "Main", "pre", "className", "span", "Obj", "getDXN", "toString", "Capability", "makeModule", "succeed", "contributes", "Common", "ReactSurface", "createSurface", "id", "meta", "role", "filter", "data", "Obj", "instanceOf", "Template", "Data", "subject", "component", "React", "TemplateContainer"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
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,sJAAmE,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import * as Effect from 'effect/Effect';
|
|
2
|
-
import { Capability, Common } from '@dxos/app-framework';
|
|
3
|
-
declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<Common.Capability.ReactSurface>>, never, never>;
|
|
4
|
-
export default _default;
|
|
5
|
-
//# sourceMappingURL=react-surface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,UAAU,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;;AAOzD,wBAcE"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type SurfaceComponentProps } from '@dxos/app-framework/react';
|
|
3
|
-
import { Obj } from '@dxos/echo';
|
|
4
|
-
export type TemplateContainerProps = SurfaceComponentProps<Obj.Unknown>;
|
|
5
|
-
export declare const TemplateContainer: ({ role, subject: object }: TemplateContainerProps) => React.JSX.Element;
|
|
6
|
-
//# sourceMappingURL=TemplateContainer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/TemplateContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGjC,MAAM,MAAM,sBAAsB,GAAG,qBAAqB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAExE,eAAO,MAAM,iBAAiB,GAAI,2BAA2B,sBAAsB,sBAQlF,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
|
|
8
|
-
import { Capability, Common } from '@dxos/app-framework';
|
|
9
|
-
import { Obj } from '@dxos/echo';
|
|
10
|
-
|
|
11
|
-
import { TemplateContainer } from '../../components';
|
|
12
|
-
import { meta } from '../../meta';
|
|
13
|
-
import { Template } from '../../types';
|
|
14
|
-
|
|
15
|
-
export default Capability.makeModule(() =>
|
|
16
|
-
Effect.succeed(
|
|
17
|
-
Capability.contributes(
|
|
18
|
-
Common.Capability.ReactSurface,
|
|
19
|
-
Common.createSurface({
|
|
20
|
-
id: meta.id,
|
|
21
|
-
role: 'article',
|
|
22
|
-
filter: (data): data is { subject: Obj.Unknown } => Obj.instanceOf(Template.Data, data.subject),
|
|
23
|
-
component: ({ data, role }: { data: { subject: Obj.Unknown }; role: string }) => (
|
|
24
|
-
<TemplateContainer role={role} subject={data.subject} />
|
|
25
|
-
),
|
|
26
|
-
}),
|
|
27
|
-
),
|
|
28
|
-
),
|
|
29
|
-
);
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { type SurfaceComponentProps } from '@dxos/app-framework/react';
|
|
8
|
-
import { Obj } from '@dxos/echo';
|
|
9
|
-
import { Layout } from '@dxos/react-ui-mosaic';
|
|
10
|
-
|
|
11
|
-
export type TemplateContainerProps = SurfaceComponentProps<Obj.Unknown>;
|
|
12
|
-
|
|
13
|
-
export const TemplateContainer = ({ role, subject: object }: TemplateContainerProps) => {
|
|
14
|
-
return (
|
|
15
|
-
<Layout.Main role={role}>
|
|
16
|
-
<pre className='m-4 p-2 ring'>
|
|
17
|
-
<span>{Obj.getDXN(object).toString()}</span>
|
|
18
|
-
</pre>
|
|
19
|
-
</Layout.Main>
|
|
20
|
-
);
|
|
21
|
-
};
|