@dxos/plugin-template 0.8.4-main.4a85c3132b → 0.8.4-main.51f1e5ca51
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 +33 -38
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/translations.mjs +27 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- 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.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 +22 -14
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +34 -28
- package/src/TemplatePlugin.tsx +20 -8
- package/src/capabilities/index.ts +3 -1
- package/src/capabilities/react-surface.tsx +28 -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-2ZHO2EXN.mjs +0 -39
- package/dist/lib/browser/react-surface-2ZHO2EXN.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.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 -30
- package/src/components/TemplateContainer.tsx +0 -23
- /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
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.51f1e5ca51",
|
|
4
4
|
"description": "Template for new plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -12,12 +12,25 @@
|
|
|
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
|
+
"#translations": "./src/translations.ts",
|
|
20
|
+
"#types": "./src/types/index.ts"
|
|
21
|
+
},
|
|
15
22
|
"exports": {
|
|
16
23
|
".": {
|
|
17
24
|
"source": "./src/index.ts",
|
|
18
25
|
"types": "./dist/types/src/index.d.ts",
|
|
19
26
|
"browser": "./dist/lib/browser/index.mjs"
|
|
20
27
|
},
|
|
28
|
+
"./translations": {
|
|
29
|
+
"source": "./src/translations.ts",
|
|
30
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
31
|
+
"browser": "./dist/lib/browser/translations.mjs",
|
|
32
|
+
"node": "./dist/lib/node-esm/translations.mjs"
|
|
33
|
+
},
|
|
21
34
|
"./types": {
|
|
22
35
|
"source": "./src/types/index.ts",
|
|
23
36
|
"types": "./dist/types/src/types/index.d.ts",
|
|
@@ -25,49 +38,42 @@
|
|
|
25
38
|
}
|
|
26
39
|
},
|
|
27
40
|
"types": "dist/types/src/index.d.ts",
|
|
28
|
-
"typesVersions": {
|
|
29
|
-
"*": {
|
|
30
|
-
"types": [
|
|
31
|
-
"dist/types/src/types/index.d.ts"
|
|
32
|
-
]
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
41
|
"files": [
|
|
36
42
|
"dist",
|
|
37
43
|
"src"
|
|
38
44
|
],
|
|
39
45
|
"dependencies": {
|
|
40
46
|
"@radix-ui/react-context": "1.1.1",
|
|
41
|
-
"effect": "3.
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/plugin-space": "0.8.4-main.
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/react-ui-
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
47
|
+
"effect": "3.20.0",
|
|
48
|
+
"@dxos/compute": "0.8.4-main.51f1e5ca51",
|
|
49
|
+
"@dxos/echo": "0.8.4-main.51f1e5ca51",
|
|
50
|
+
"@dxos/plugin-graph": "0.8.4-main.51f1e5ca51",
|
|
51
|
+
"@dxos/react-client": "0.8.4-main.51f1e5ca51",
|
|
52
|
+
"@dxos/plugin-client": "0.8.4-main.51f1e5ca51",
|
|
53
|
+
"@dxos/plugin-space": "0.8.4-main.51f1e5ca51",
|
|
54
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.51f1e5ca51",
|
|
55
|
+
"@dxos/app-framework": "0.8.4-main.51f1e5ca51",
|
|
56
|
+
"@dxos/react-ui-stack": "0.8.4-main.51f1e5ca51",
|
|
57
|
+
"@dxos/util": "0.8.4-main.51f1e5ca51",
|
|
58
|
+
"@dxos/app-toolkit": "0.8.4-main.51f1e5ca51",
|
|
59
|
+
"@dxos/async": "0.8.4-main.51f1e5ca51"
|
|
54
60
|
},
|
|
55
61
|
"devDependencies": {
|
|
56
62
|
"@types/react": "~19.2.7",
|
|
57
63
|
"@types/react-dom": "~19.2.3",
|
|
58
64
|
"react": "~19.2.3",
|
|
59
65
|
"react-dom": "~19.2.3",
|
|
60
|
-
"vite": "^
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
66
|
+
"vite": "^8.0.10",
|
|
67
|
+
"@dxos/storybook-utils": "0.8.4-main.51f1e5ca51",
|
|
68
|
+
"@dxos/ui-theme": "0.8.4-main.51f1e5ca51",
|
|
69
|
+
"@dxos/react-ui": "0.8.4-main.51f1e5ca51"
|
|
64
70
|
},
|
|
65
71
|
"peerDependencies": {
|
|
66
|
-
"effect": "3.
|
|
72
|
+
"effect": "3.20.0",
|
|
67
73
|
"react": "~19.2.3",
|
|
68
74
|
"react-dom": "~19.2.3",
|
|
69
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
70
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
75
|
+
"@dxos/ui-theme": "0.8.4-main.51f1e5ca51",
|
|
76
|
+
"@dxos/react-ui": "0.8.4-main.51f1e5ca51"
|
|
71
77
|
},
|
|
72
78
|
"publishConfig": {
|
|
73
79
|
"access": "public"
|
package/src/TemplatePlugin.tsx
CHANGED
|
@@ -3,25 +3,37 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Option from 'effect/Option';
|
|
6
7
|
|
|
7
8
|
import { Plugin } from '@dxos/app-framework';
|
|
8
9
|
import { AppPlugin } from '@dxos/app-toolkit';
|
|
10
|
+
import { Operation } from '@dxos/compute';
|
|
11
|
+
import { Annotation } from '@dxos/echo';
|
|
12
|
+
import { SpaceOperation } from '@dxos/plugin-space/operations';
|
|
9
13
|
import { type CreateObject } from '@dxos/plugin-space/types';
|
|
10
14
|
|
|
11
|
-
import { ReactSurface } from '
|
|
12
|
-
import { meta } from '
|
|
13
|
-
import { translations } from '
|
|
14
|
-
import { Template } from '
|
|
15
|
+
import { ReactSurface } from '#capabilities';
|
|
16
|
+
import { meta } from '#meta';
|
|
17
|
+
import { translations } from '#translations';
|
|
18
|
+
import { Template } from '#types';
|
|
15
19
|
|
|
16
20
|
export const TemplatePlugin = Plugin.define(meta).pipe(
|
|
17
21
|
AppPlugin.addMetadataModule({
|
|
18
22
|
metadata: {
|
|
19
23
|
id: Template.Data.typename,
|
|
20
24
|
metadata: {
|
|
21
|
-
icon:
|
|
22
|
-
iconHue: '
|
|
23
|
-
createObject: ((props
|
|
24
|
-
|
|
25
|
+
icon: Annotation.IconAnnotation.get(Template.Data).pipe(Option.getOrThrow).icon,
|
|
26
|
+
iconHue: Annotation.IconAnnotation.get(Template.Data).pipe(Option.getOrThrow).hue ?? 'white',
|
|
27
|
+
createObject: ((props, options) =>
|
|
28
|
+
Effect.gen(function* () {
|
|
29
|
+
const object = Template.make(props);
|
|
30
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
31
|
+
object,
|
|
32
|
+
target: options.target,
|
|
33
|
+
hidden: true,
|
|
34
|
+
targetNodeId: options.targetNodeId,
|
|
35
|
+
});
|
|
36
|
+
})) satisfies CreateObject,
|
|
25
37
|
},
|
|
26
38
|
},
|
|
27
39
|
}),
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
filter: AppSurface.object(AppSurface.Article, Template.Data),
|
|
22
|
+
component: ({ data, role }) => (
|
|
23
|
+
<TemplatePanel role={role} subject={data.subject} attendableId={data.attendableId} />
|
|
24
|
+
),
|
|
25
|
+
}),
|
|
26
|
+
),
|
|
27
|
+
),
|
|
28
|
+
);
|
|
@@ -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 { Capabilities, Capability } from "@dxos/app-framework";
|
|
12
|
-
import { Surface } from "@dxos/app-framework/ui";
|
|
13
|
-
import { Obj as Obj2 } from "@dxos/echo";
|
|
14
|
-
|
|
15
|
-
// src/components/TemplateContainer.tsx
|
|
16
|
-
import React from "react";
|
|
17
|
-
import { Obj } from "@dxos/echo";
|
|
18
|
-
import { Panel } from "@dxos/react-ui";
|
|
19
|
-
var TemplateContainer = ({ role, subject: object }) => {
|
|
20
|
-
return /* @__PURE__ */ React.createElement(Panel.Root, {
|
|
21
|
-
role,
|
|
22
|
-
className: "dx-article"
|
|
23
|
-
}, /* @__PURE__ */ React.createElement(Panel.Content, null, /* @__PURE__ */ React.createElement(Panel.Content, null, /* @__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(Capabilities.ReactSurface, Surface.create({
|
|
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-2ZHO2EXN.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 { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface } from '@dxos/app-framework/ui';\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 Capabilities.ReactSurface,\n Surface.create({\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-toolkit/ui';\nimport { Obj } from '@dxos/echo';\nimport { Panel } from '@dxos/react-ui';\n\nexport type TemplateContainerProps = SurfaceComponentProps<Obj.Unknown>;\n\nexport const TemplateContainer = ({ role, subject: object }: TemplateContainerProps) => {\n return (\n <Panel.Root role={role} className='dx-article'>\n <Panel.Content>\n <Panel.Content>\n <span>{Obj.getDXN(object).toString()}</span>\n </Panel.Content>\n </Panel.Content>\n </Panel.Root>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,YAAW;AAElB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,eAAe;AACxB,SAASC,OAAAA,YAAW;;;ACLpB,OAAOC,WAAW;AAGlB,SAASC,WAAW;AACpB,SAASC,aAAa;AAIf,IAAMC,oBAAoB,CAAC,EAAEC,MAAMC,SAASC,OAAM,MAA0B;AACjF,SACE,sBAAA,cAACC,MAAMC,MAAI;IAACJ;IAAYK,WAAU;KAChC,sBAAA,cAACF,MAAMG,SAAO,MACZ,sBAAA,cAACH,MAAMG,SAAO,MACZ,sBAAA,cAACC,QAAAA,MAAMC,IAAIC,OAAOP,MAAAA,EAAQQ,SAAQ,CAAA,CAAA,CAAA,CAAA;AAK5C;;;ADPA,IAAA,wBAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YACTC,aAAaC,cACbC,QAAQC,OAAO;EACbC,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", "Capabilities", "Capability", "Surface", "Obj", "React", "Obj", "Panel", "TemplateContainer", "role", "subject", "object", "Panel", "Root", "className", "Content", "span", "Obj", "getDXN", "toString", "Capability", "makeModule", "succeed", "contributes", "Capabilities", "ReactSurface", "Surface", "create", "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,iJAAmE,CAAC"}
|
|
@@ -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,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;;AAQ/D,wBAcE"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
|
|
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,sBAAsB,CAAC;AAClE,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,sBAUlF,CAAC"}
|
|
@@ -1,30 +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 { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
-
import { Surface } from '@dxos/app-framework/ui';
|
|
10
|
-
import { Obj } from '@dxos/echo';
|
|
11
|
-
|
|
12
|
-
import { TemplateContainer } from '../../components';
|
|
13
|
-
import { meta } from '../../meta';
|
|
14
|
-
import { Template } from '../../types';
|
|
15
|
-
|
|
16
|
-
export default Capability.makeModule(() =>
|
|
17
|
-
Effect.succeed(
|
|
18
|
-
Capability.contributes(
|
|
19
|
-
Capabilities.ReactSurface,
|
|
20
|
-
Surface.create({
|
|
21
|
-
id: meta.id,
|
|
22
|
-
role: 'article',
|
|
23
|
-
filter: (data): data is { subject: Obj.Unknown } => Obj.instanceOf(Template.Data, data.subject),
|
|
24
|
-
component: ({ data, role }: { data: { subject: Obj.Unknown }; role: string }) => (
|
|
25
|
-
<TemplateContainer role={role} subject={data.subject} />
|
|
26
|
-
),
|
|
27
|
-
}),
|
|
28
|
-
),
|
|
29
|
-
),
|
|
30
|
-
);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
|
|
8
|
-
import { Obj } from '@dxos/echo';
|
|
9
|
-
import { Panel } from '@dxos/react-ui';
|
|
10
|
-
|
|
11
|
-
export type TemplateContainerProps = SurfaceComponentProps<Obj.Unknown>;
|
|
12
|
-
|
|
13
|
-
export const TemplateContainer = ({ role, subject: object }: TemplateContainerProps) => {
|
|
14
|
-
return (
|
|
15
|
-
<Panel.Root role={role} className='dx-article'>
|
|
16
|
-
<Panel.Content>
|
|
17
|
-
<Panel.Content>
|
|
18
|
-
<span>{Obj.getDXN(object).toString()}</span>
|
|
19
|
-
</Panel.Content>
|
|
20
|
-
</Panel.Content>
|
|
21
|
-
</Panel.Root>
|
|
22
|
-
);
|
|
23
|
-
};
|
/package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts}
RENAMED
|
File without changes
|