@dxos/plugin-template 0.8.4-main.f5c0578 → 0.8.4-main.fcc0d83b33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/lib/browser/index.mjs +48 -75
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/browser/translations.mjs +27 -0
  5. package/dist/lib/browser/translations.mjs.map +7 -0
  6. package/dist/lib/browser/types/index.mjs +16 -3
  7. package/dist/lib/browser/types/index.mjs.map +4 -4
  8. package/dist/types/src/TemplatePlugin.d.ts +2 -1
  9. package/dist/types/src/TemplatePlugin.d.ts.map +1 -1
  10. package/dist/types/src/capabilities/index.d.ts +2 -2
  11. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  12. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  13. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  14. package/dist/types/src/components/TemplatePanel/TemplatePanel.d.ts +6 -0
  15. package/dist/types/src/components/TemplatePanel/TemplatePanel.d.ts.map +1 -0
  16. package/dist/types/src/components/TemplatePanel/index.d.ts +2 -0
  17. package/dist/types/src/components/TemplatePanel/index.d.ts.map +1 -0
  18. package/dist/types/src/components/index.d.ts +1 -1
  19. package/dist/types/src/components/index.d.ts.map +1 -1
  20. package/dist/types/src/meta.d.ts +2 -2
  21. package/dist/types/src/meta.d.ts.map +1 -1
  22. package/dist/types/src/translations.d.ts +22 -13
  23. package/dist/types/src/translations.d.ts.map +1 -1
  24. package/dist/types/src/types/schema.d.ts +8 -23
  25. package/dist/types/src/types/schema.d.ts.map +1 -1
  26. package/dist/types/tsconfig.tsbuildinfo +1 -1
  27. package/package.json +45 -33
  28. package/src/TemplatePlugin.tsx +38 -54
  29. package/src/capabilities/index.ts +2 -3
  30. package/src/capabilities/react-surface.tsx +20 -15
  31. package/src/components/TemplatePanel/TemplatePanel.tsx +21 -0
  32. package/src/components/TemplatePanel/index.ts +5 -0
  33. package/src/components/index.ts +1 -1
  34. package/src/meta.ts +9 -3
  35. package/src/translations.ts +12 -10
  36. package/src/types/schema.ts +13 -18
  37. package/dist/lib/browser/chunk-LT6IO5CC.mjs +0 -43
  38. package/dist/lib/browser/chunk-LT6IO5CC.mjs.map +0 -7
  39. package/dist/lib/browser/intent-resolver-AILWDC74.mjs +0 -20
  40. package/dist/lib/browser/intent-resolver-AILWDC74.mjs.map +0 -7
  41. package/dist/lib/browser/react-surface-NRU2N7BS.mjs +0 -40
  42. package/dist/lib/browser/react-surface-NRU2N7BS.mjs.map +0 -7
  43. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  44. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  45. package/dist/types/src/components/TemplateContainer.d.ts +0 -7
  46. package/dist/types/src/components/TemplateContainer.d.ts.map +0 -1
  47. package/src/capabilities/intent-resolver.ts +0 -18
  48. package/src/components/TemplateContainer.tsx +0 -19
package/package.json CHANGED
@@ -1,19 +1,36 @@
1
1
  {
2
2
  "name": "@dxos/plugin-template",
3
- "version": "0.8.4-main.f5c0578",
3
+ "version": "0.8.4-main.fcc0d83b33",
4
4
  "description": "Template for new plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/dxos/dxos"
10
+ },
7
11
  "license": "MIT",
8
12
  "author": "DXOS.org",
9
13
  "sideEffects": true,
10
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
+ },
11
22
  "exports": {
12
23
  ".": {
13
24
  "source": "./src/index.ts",
14
25
  "types": "./dist/types/src/index.d.ts",
15
26
  "browser": "./dist/lib/browser/index.mjs"
16
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
+ },
17
34
  "./types": {
18
35
  "source": "./src/types/index.ts",
19
36
  "types": "./dist/types/src/types/index.d.ts",
@@ -21,47 +38,42 @@
21
38
  }
22
39
  },
23
40
  "types": "dist/types/src/index.d.ts",
24
- "typesVersions": {
25
- "*": {
26
- "types": [
27
- "dist/types/src/types/index.d.ts"
28
- ]
29
- }
30
- },
31
41
  "files": [
32
42
  "dist",
33
43
  "src"
34
44
  ],
35
45
  "dependencies": {
36
- "@preact-signals/safe-react": "^0.9.0",
37
- "@preact/signals-core": "^1.9.0",
38
- "effect": "3.17.7",
39
- "@dxos/app-framework": "0.8.4-main.f5c0578",
40
- "@dxos/async": "0.8.4-main.f5c0578",
41
- "@dxos/echo": "0.8.4-main.f5c0578",
42
- "@dxos/echo-schema": "0.8.4-main.f5c0578",
43
- "@dxos/plugin-client": "0.8.4-main.f5c0578",
44
- "@dxos/plugin-space": "0.8.4-main.f5c0578",
45
- "@dxos/plugin-graph": "0.8.4-main.f5c0578",
46
- "@dxos/react-client": "0.8.4-main.f5c0578",
47
- "@dxos/react-ui-stack": "0.8.4-main.f5c0578"
46
+ "@radix-ui/react-context": "1.1.1",
47
+ "effect": "3.20.0",
48
+ "@dxos/app-toolkit": "0.8.4-main.fcc0d83b33",
49
+ "@dxos/async": "0.8.4-main.fcc0d83b33",
50
+ "@dxos/app-framework": "0.8.4-main.fcc0d83b33",
51
+ "@dxos/plugin-client": "0.8.4-main.fcc0d83b33",
52
+ "@dxos/compute": "0.8.4-main.fcc0d83b33",
53
+ "@dxos/plugin-graph": "0.8.4-main.fcc0d83b33",
54
+ "@dxos/react-client": "0.8.4-main.fcc0d83b33",
55
+ "@dxos/plugin-space": "0.8.4-main.fcc0d83b33",
56
+ "@dxos/react-ui-mosaic": "0.8.4-main.fcc0d83b33",
57
+ "@dxos/echo": "0.8.4-main.fcc0d83b33",
58
+ "@dxos/util": "0.8.4-main.fcc0d83b33",
59
+ "@dxos/react-ui-stack": "0.8.4-main.fcc0d83b33"
48
60
  },
49
61
  "devDependencies": {
50
- "@types/react": "~18.2.0",
51
- "@types/react-dom": "~18.2.0",
52
- "react": "~18.2.0",
53
- "react-dom": "~18.2.0",
54
- "vite": "5.4.7",
55
- "@dxos/react-ui": "0.8.4-main.f5c0578",
56
- "@dxos/react-ui-theme": "0.8.4-main.f5c0578",
57
- "@dxos/storybook-utils": "0.8.4-main.f5c0578"
62
+ "@types/react": "~19.2.7",
63
+ "@types/react-dom": "~19.2.3",
64
+ "react": "~19.2.3",
65
+ "react-dom": "~19.2.3",
66
+ "vite": "^8.0.10",
67
+ "@dxos/storybook-utils": "0.8.4-main.fcc0d83b33",
68
+ "@dxos/react-ui": "0.8.4-main.fcc0d83b33",
69
+ "@dxos/ui-theme": "0.8.4-main.fcc0d83b33"
58
70
  },
59
71
  "peerDependencies": {
60
- "effect": "^3.13.3",
61
- "react": "~18.2.0",
62
- "react-dom": "~18.2.0",
63
- "@dxos/react-ui": "0.8.4-main.f5c0578",
64
- "@dxos/react-ui-theme": "0.8.4-main.f5c0578"
72
+ "effect": "3.20.0",
73
+ "react": "~19.2.3",
74
+ "react-dom": "~19.2.3",
75
+ "@dxos/ui-theme": "0.8.4-main.fcc0d83b33",
76
+ "@dxos/react-ui": "0.8.4-main.fcc0d83b33"
65
77
  },
66
78
  "publishConfig": {
67
79
  "access": "public"
@@ -2,59 +2,43 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Capabilities, Events, contributes, createIntent, defineModule, definePlugin } from '@dxos/app-framework';
6
- import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
7
- import { SpaceCapabilities } from '@dxos/plugin-space';
8
- import { defineObjectForm } from '@dxos/plugin-space/types';
5
+ import * as Effect from 'effect/Effect';
6
+ import * as Option from 'effect/Option';
9
7
 
10
- import { IntentResolver, ReactSurface } from './capabilities';
11
- import { meta } from './meta';
12
- import { translations } from './translations';
13
- import { Template } from './types';
8
+ import { Plugin } from '@dxos/app-framework';
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';
13
+ import { type CreateObject } from '@dxos/plugin-space/types';
14
14
 
15
- export const TemplatePlugin = () =>
16
- definePlugin(meta, [
17
- defineModule({
18
- id: `${meta.id}/module/translations`,
19
- activatesOn: Events.SetupTranslations,
20
- activate: () => contributes(Capabilities.Translations, translations),
21
- }),
22
- defineModule({
23
- id: `${meta.id}/module/metadata`,
24
- activatesOn: Events.SetupMetadata,
25
- activate: () =>
26
- contributes(Capabilities.Metadata, {
27
- id: Template.Data.typename,
28
- metadata: {
29
- icon: 'ph--asterisk--regular',
30
- },
31
- }),
32
- }),
33
- defineModule({
34
- id: `${meta.id}/module/object-form`,
35
- activatesOn: ClientEvents.SetupSchema,
36
- activate: () =>
37
- contributes(
38
- SpaceCapabilities.ObjectForm,
39
- defineObjectForm({
40
- objectSchema: Template.Data,
41
- getIntent: () => createIntent(Template.Create),
42
- }),
43
- ),
44
- }),
45
- defineModule({
46
- id: `${meta.id}/module/schema`,
47
- activatesOn: ClientEvents.SetupSchema,
48
- activate: () => contributes(ClientCapabilities.Schema, [Template.Data]),
49
- }),
50
- defineModule({
51
- id: `${meta.id}/module/react-surface`,
52
- activatesOn: Events.SetupReactSurface,
53
- activate: ReactSurface,
54
- }),
55
- defineModule({
56
- id: `${meta.id}/module/intent-resolver`,
57
- activatesOn: Events.SetupIntentResolver,
58
- activate: IntentResolver,
59
- }),
60
- ]);
15
+ import { ReactSurface } from '#capabilities';
16
+ import { meta } from '#meta';
17
+ import { translations } from '#translations';
18
+ import { Template } from '#types';
19
+
20
+ export const TemplatePlugin = Plugin.define(meta).pipe(
21
+ AppPlugin.addMetadataModule({
22
+ metadata: {
23
+ id: Template.Data.typename,
24
+ metadata: {
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,
37
+ },
38
+ },
39
+ }),
40
+ AppPlugin.addSchemaModule({ schema: [Template.Data] }),
41
+ AppPlugin.addSurfaceModule({ activate: ReactSurface }),
42
+ AppPlugin.addTranslationsModule({ translations }),
43
+ Plugin.make,
44
+ );
@@ -2,7 +2,6 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { lazy } from '@dxos/app-framework';
5
+ import { Capability } from '@dxos/app-framework';
6
6
 
7
- export const IntentResolver = lazy(() => import('./intent-resolver'));
8
- export const ReactSurface = lazy(() => import('./react-surface'));
7
+ export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
@@ -2,22 +2,27 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import * as Effect from 'effect/Effect';
5
6
  import React from 'react';
6
7
 
7
- import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
8
- import { Obj } from '@dxos/echo';
8
+ import { Capabilities, Capability } from '@dxos/app-framework';
9
+ import { Surface } from '@dxos/app-framework/ui';
10
+ import { AppSurface } from '@dxos/app-toolkit/ui';
9
11
 
10
- import { TemplateContainer } from '../components';
11
- import { meta } from '../meta';
12
- import { Template } from '../types';
12
+ import { TemplatePanel } from '#components';
13
+ import { Template } from '#types';
13
14
 
14
- export default () =>
15
- contributes(
16
- Capabilities.ReactSurface,
17
- createSurface({
18
- id: meta.id,
19
- role: 'article',
20
- filter: (data): data is { subject: Obj.Any } => Obj.instanceOf(Template.Data, data.subject),
21
- component: ({ data, role }) => <TemplateContainer role={role} object={data.subject} />,
22
- }),
23
- );
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
+ };
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ export * from './TemplatePanel';
@@ -2,4 +2,4 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- export * from './TemplateContainer';
5
+ export * from './TemplatePanel';
package/src/meta.ts CHANGED
@@ -2,11 +2,17 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type PluginMeta } from '@dxos/app-framework';
5
+ import { type Plugin } from '@dxos/app-framework';
6
+ import { trim } from '@dxos/util';
6
7
 
7
- export const meta: PluginMeta = {
8
- id: 'dxos.org/plugin/template',
8
+ export const meta: Plugin.Meta = {
9
+ id: 'org.dxos.plugin.template',
9
10
  name: 'Template',
11
+ description: trim`
12
+ Create reusable templates for documents, tables, and other objects.
13
+ Define structured patterns that can be quickly instantiated with pre-configured content and settings.
14
+ `,
10
15
  icon: 'ph--asterisk--regular',
16
+ iconHue: 'sky',
11
17
  source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-template',
12
18
  };
@@ -4,23 +4,25 @@
4
4
 
5
5
  import { type Resource } from '@dxos/react-ui';
6
6
 
7
- import { meta } from './meta';
8
- import { Template } from './types';
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 label': 'Template',
15
- 'typename label_zero': 'Templates',
16
- 'typename label_one': 'Template',
17
- 'typename label_other': 'Templates',
18
- 'object name placeholder': 'New template',
19
- 'rename object label': 'Rename template',
20
- 'delete object label': 'Delete template',
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',
21
23
  },
22
24
  [meta.id]: {
23
- 'plugin name': 'Template',
25
+ 'plugin.name': 'Template',
24
26
  },
25
27
  },
26
28
  },
@@ -2,30 +2,25 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
5
+ import * as Schema from 'effect/Schema';
6
6
 
7
- import { Obj } from '@dxos/echo';
8
- import { TypedObject } from '@dxos/echo-schema';
9
- import { ReactiveObjectSchema } from '@dxos/react-client/echo';
10
-
11
- import { meta } from '../meta';
7
+ import { Annotation, Obj, Type } from '@dxos/echo';
12
8
 
13
9
  export namespace Template {
14
- export class Create extends Schema.TaggedClass<Create>()(`${meta.id}/action/create`, {
15
- input: Schema.Struct({
16
- name: Schema.optional(Schema.String),
10
+ export const Data = Schema.Struct({
11
+ name: Schema.optional(Schema.String),
12
+ }).pipe(
13
+ Type.object({
14
+ typename: 'org.dxos.type.data',
15
+ version: '0.1.0',
17
16
  }),
18
- output: Schema.Struct({
19
- object: ReactiveObjectSchema,
17
+ Annotation.IconAnnotation.set({
18
+ icon: 'ph--asterisk--regular',
19
+ hue: 'sky',
20
20
  }),
21
- }) {}
21
+ );
22
22
 
23
- export class Data extends TypedObject({
24
- typename: 'dxos.org/type/Data',
25
- version: '0.1.0',
26
- })({
27
- name: Schema.optional(Schema.String),
28
- }) {}
23
+ export type Data = Schema.Schema.Type<typeof Data>;
29
24
 
30
25
  export const make = (props: Partial<Data>) => Obj.make(Data, props);
31
26
  }
@@ -1,43 +0,0 @@
1
- // src/types/schema.ts
2
- import { Schema } from "effect";
3
- import { Obj } from "@dxos/echo";
4
- import { TypedObject } from "@dxos/echo-schema";
5
- import { ReactiveObjectSchema } from "@dxos/react-client/echo";
6
-
7
- // src/meta.ts
8
- var meta = {
9
- id: "dxos.org/plugin/template",
10
- name: "Template",
11
- icon: "ph--asterisk--regular",
12
- source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-template"
13
- };
14
-
15
- // src/types/schema.ts
16
- (function(Template2) {
17
- class Create extends Schema.TaggedClass()(`${meta.id}/action/create`, {
18
- input: Schema.Struct({
19
- name: Schema.optional(Schema.String)
20
- }),
21
- output: Schema.Struct({
22
- object: ReactiveObjectSchema
23
- })
24
- }) {
25
- }
26
- Template2.Create = Create;
27
- class Data extends TypedObject({
28
- typename: "dxos.org/type/Data",
29
- version: "0.1.0"
30
- })({
31
- name: Schema.optional(Schema.String)
32
- }) {
33
- }
34
- Template2.Data = Data;
35
- Template2.make = (props) => Obj.make(Data, props);
36
- })(Template || (Template = {}));
37
- var Template;
38
-
39
- export {
40
- meta,
41
- Template
42
- };
43
- //# sourceMappingURL=chunk-LT6IO5CC.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/schema.ts", "../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Obj } from '@dxos/echo';\nimport { TypedObject } from '@dxos/echo-schema';\nimport { ReactiveObjectSchema } from '@dxos/react-client/echo';\n\nimport { meta } from '../meta';\n\nexport namespace Template {\n export class Create extends Schema.TaggedClass<Create>()(`${meta.id}/action/create`, {\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n }),\n output: Schema.Struct({\n object: ReactiveObjectSchema,\n }),\n }) {}\n\n export class Data extends TypedObject({\n typename: 'dxos.org/type/Data',\n version: '0.1.0',\n })({\n name: Schema.optional(Schema.String),\n }) {}\n\n export const make = (props: Partial<Data>) => Obj.make(Data, props);\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const meta: PluginMeta = {\n id: 'dxos.org/plugin/template',\n name: 'Template',\n icon: 'ph--asterisk--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-template',\n};\n"],
5
- "mappings": ";AAIA,SAASA,cAAc;AAEvB,SAASC,WAAW;AACpB,SAASC,mBAAmB;AAC5B,SAASC,4BAA4B;;;ACF9B,IAAMC,OAAmB;EAC9BC,IAAI;EACJC,MAAM;EACNC,MAAM;EACNC,QAAQ;AACV;;;UDCiBC,WAAAA;EACR,MAAMC,eAAeC,OAAOC,YAAW,EAAW,GAAGC,KAAKC,EAAE,kBAAkB;IACnFC,OAAOJ,OAAOK,OAAO;MACnBC,MAAMN,OAAOO,SAASP,OAAOQ,MAAM;IACrC,CAAA;IACAC,QAAQT,OAAOK,OAAO;MACpBK,QAAQC;IACV,CAAA;EACF,CAAA,EAAA;EAAI;YAPSZ,SAAAA;EASN,MAAMa,aAAaC,YAAY;IACpCC,UAAU;IACVC,SAAS;EACX,CAAA,EAAG;IACDT,MAAMN,OAAOO,SAASP,OAAOQ,MAAM;EACrC,CAAA,EAAA;EAAI;YALSI,OAAAA;YAOAI,OAAO,CAACC,UAAyBC,IAAIF,KAAKJ,MAAMK,KAAAA;AAC/D,GAlBiBnB,aAAAA,WAAAA,CAAAA,EAAAA;;",
6
- "names": ["Schema", "Obj", "TypedObject", "ReactiveObjectSchema", "meta", "id", "name", "icon", "source", "Template", "Create", "Schema", "TaggedClass", "meta", "id", "input", "Struct", "name", "optional", "String", "output", "object", "ReactiveObjectSchema", "Data", "TypedObject", "typename", "version", "make", "props", "Obj"]
7
- }
@@ -1,20 +0,0 @@
1
- import {
2
- Template
3
- } from "./chunk-LT6IO5CC.mjs";
4
-
5
- // src/capabilities/intent-resolver.ts
6
- import { Capabilities, contributes, createResolver } from "@dxos/app-framework";
7
- var intent_resolver_default = () => contributes(Capabilities.IntentResolver, createResolver({
8
- intent: Template.Create,
9
- resolve: ({ name }) => ({
10
- data: {
11
- object: Template.make({
12
- name
13
- })
14
- }
15
- })
16
- }));
17
- export {
18
- intent_resolver_default as default
19
- };
20
- //# sourceMappingURL=intent-resolver-AILWDC74.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/intent-resolver.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, createResolver } from '@dxos/app-framework';\n\nimport { Template } from '../types';\n\nexport default () =>\n contributes(\n Capabilities.IntentResolver,\n createResolver({\n intent: Template.Create,\n resolve: ({ name }) => ({\n data: { object: Template.make({ name }) },\n }),\n }),\n );\n"],
5
- "mappings": ";;;;;AAIA,SAASA,cAAcC,aAAaC,sBAAsB;AAI1D,IAAA,0BAAe,MACbC,YACEC,aAAaC,gBACbC,eAAe;EACbC,QAAQC,SAASC;EACjBC,SAAS,CAAC,EAAEC,KAAI,OAAQ;IACtBC,MAAM;MAAEC,QAAQL,SAASM,KAAK;QAAEH;MAAK,CAAA;IAAG;EAC1C;AACF,CAAA,CAAA;",
6
- "names": ["Capabilities", "contributes", "createResolver", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "Template", "Create", "resolve", "name", "data", "object", "make"]
7
- }
@@ -1,40 +0,0 @@
1
- import {
2
- Template,
3
- meta
4
- } from "./chunk-LT6IO5CC.mjs";
5
-
6
- // src/capabilities/react-surface.tsx
7
- import React2 from "react";
8
- import { Capabilities, contributes, createSurface } from "@dxos/app-framework";
9
- import { Obj } from "@dxos/echo";
10
-
11
- // src/components/TemplateContainer.tsx
12
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
13
- import React from "react";
14
- import { fullyQualifiedId } from "@dxos/react-client/echo";
15
- import { StackItem } from "@dxos/react-ui-stack";
16
- var TemplateContainer = ({ object }) => {
17
- var _effect = _useSignals();
18
- try {
19
- return /* @__PURE__ */ React.createElement(StackItem.Content, null, /* @__PURE__ */ React.createElement("pre", {
20
- className: "m-4 p-2 ring"
21
- }, /* @__PURE__ */ React.createElement("span", null, fullyQualifiedId(object))));
22
- } finally {
23
- _effect.f();
24
- }
25
- };
26
-
27
- // src/capabilities/react-surface.tsx
28
- var react_surface_default = () => contributes(Capabilities.ReactSurface, createSurface({
29
- id: meta.id,
30
- role: "article",
31
- filter: (data) => Obj.instanceOf(Template.Data, data.subject),
32
- component: ({ data, role }) => /* @__PURE__ */ React2.createElement(TemplateContainer, {
33
- role,
34
- object: data.subject
35
- })
36
- }));
37
- export {
38
- react_surface_default as default
39
- };
40
- //# sourceMappingURL=react-surface-NRU2N7BS.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/react-surface.tsx", "../../../src/components/TemplateContainer.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Capabilities, contributes, createSurface } 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 () =>\n contributes(\n Capabilities.ReactSurface,\n createSurface({\n id: meta.id,\n role: 'article',\n filter: (data): data is { subject: Obj.Any } => Obj.instanceOf(Template.Data, data.subject),\n component: ({ data, role }) => <TemplateContainer role={role} object={data.subject} />,\n }),\n );\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type Obj } from '@dxos/echo';\nimport { fullyQualifiedId } from '@dxos/react-client/echo';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nexport const TemplateContainer = ({ object }: { object: Obj.Any; role: string }) => {\n return (\n <StackItem.Content>\n <pre className='m-4 p-2 ring'>\n <span>{fullyQualifiedId(object)}</span>\n </pre>\n </StackItem.Content>\n );\n};\n"],
5
- "mappings": ";;;;;;AAIA,OAAOA,YAAW;AAElB,SAASC,cAAcC,aAAaC,qBAAqB;AACzD,SAASC,WAAW;;;;ACHpB,OAAOC,WAAW;AAGlB,SAASC,wBAAwB;AACjC,SAASC,iBAAiB;AAEnB,IAAMC,oBAAoB,CAAC,EAAEC,OAAM,MAAqC;;;AAC7E,WACE,sBAAA,cAACC,UAAUC,SAAO,MAChB,sBAAA,cAACC,OAAAA;MAAIC,WAAU;OACb,sBAAA,cAACC,QAAAA,MAAMC,iBAAiBN,MAAAA,CAAAA,CAAAA,CAAAA;;;;AAIhC;;;ADLA,IAAA,wBAAe,MACbO,YACEC,aAAaC,cACbC,cAAc;EACZC,IAAIC,KAAKD;EACTE,MAAM;EACNC,QAAQ,CAACC,SAAuCC,IAAIC,WAAWC,SAASC,MAAMJ,KAAKK,OAAO;EAC1FC,WAAW,CAAC,EAAEN,MAAMF,KAAI,MAAO,gBAAAS,OAAA,cAACC,mBAAAA;IAAkBV;IAAYW,QAAQT,KAAKK;;AAC7E,CAAA,CAAA;",
6
- "names": ["React", "Capabilities", "contributes", "createSurface", "Obj", "React", "fullyQualifiedId", "StackItem", "TemplateContainer", "object", "StackItem", "Content", "pre", "className", "span", "fullyQualifiedId", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "meta", "role", "filter", "data", "Obj", "instanceOf", "Template", "Data", "subject", "component", "React", "TemplateContainer", "object"]
7
- }
@@ -1,4 +0,0 @@
1
- import { Capabilities } from '@dxos/app-framework';
2
- declare const _default: () => import("@dxos/app-framework").Capability<Capabilities.IntentResolver>;
3
- export default _default;
4
- //# sourceMappingURL=intent-resolver.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intent-resolver.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/intent-resolver.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAA+B,MAAM,qBAAqB,CAAC;;AAIhF,wBASI"}
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { type Obj } from '@dxos/echo';
3
- export declare const TemplateContainer: ({ object }: {
4
- object: Obj.Any;
5
- role: string;
6
- }) => React.JSX.Element;
7
- //# 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,GAAG,EAAE,MAAM,YAAY,CAAC;AAItC,eAAO,MAAM,iBAAiB,GAAI,YAAY;IAAE,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,sBAQ9E,CAAC"}
@@ -1,18 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Capabilities, contributes, createResolver } from '@dxos/app-framework';
6
-
7
- import { Template } from '../types';
8
-
9
- export default () =>
10
- contributes(
11
- Capabilities.IntentResolver,
12
- createResolver({
13
- intent: Template.Create,
14
- resolve: ({ name }) => ({
15
- data: { object: Template.make({ name }) },
16
- }),
17
- }),
18
- );
@@ -1,19 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React from 'react';
6
-
7
- import { type Obj } from '@dxos/echo';
8
- import { fullyQualifiedId } from '@dxos/react-client/echo';
9
- import { StackItem } from '@dxos/react-ui-stack';
10
-
11
- export const TemplateContainer = ({ object }: { object: Obj.Any; role: string }) => {
12
- return (
13
- <StackItem.Content>
14
- <pre className='m-4 p-2 ring'>
15
- <span>{fullyQualifiedId(object)}</span>
16
- </pre>
17
- </StackItem.Content>
18
- );
19
- };