@dxos/plugin-template 0.8.4-main.72ec0f3 → 0.8.4-main.74a063c4e0

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 (54) hide show
  1. package/dist/lib/browser/index.mjs +62 -65
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/browser/types/index.mjs +16 -3
  5. package/dist/lib/browser/types/index.mjs.map +4 -4
  6. package/dist/types/src/TemplatePlugin.d.ts +2 -1
  7. package/dist/types/src/TemplatePlugin.d.ts.map +1 -1
  8. package/dist/types/src/capabilities/index.d.ts +2 -2
  9. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  10. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  11. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  12. package/dist/types/src/components/TemplatePanel/TemplatePanel.d.ts +6 -0
  13. package/dist/types/src/components/TemplatePanel/TemplatePanel.d.ts.map +1 -0
  14. package/dist/types/src/components/TemplatePanel/index.d.ts +2 -0
  15. package/dist/types/src/components/TemplatePanel/index.d.ts.map +1 -0
  16. package/dist/types/src/components/index.d.ts +1 -2
  17. package/dist/types/src/components/index.d.ts.map +1 -1
  18. package/dist/types/src/meta.d.ts +2 -2
  19. package/dist/types/src/meta.d.ts.map +1 -1
  20. package/dist/types/src/translations.d.ts +12 -10
  21. package/dist/types/src/translations.d.ts.map +1 -1
  22. package/dist/types/src/types/schema.d.ts +7 -22
  23. package/dist/types/src/types/schema.d.ts.map +1 -1
  24. package/dist/types/tsconfig.tsbuildinfo +1 -1
  25. package/package.json +38 -27
  26. package/src/TemplatePlugin.tsx +37 -52
  27. package/src/capabilities/index.ts +2 -3
  28. package/src/capabilities/react-surface.tsx +21 -15
  29. package/src/components/TemplatePanel/TemplatePanel.tsx +21 -0
  30. package/src/components/{Example → TemplatePanel}/index.ts +1 -1
  31. package/src/components/index.ts +1 -2
  32. package/src/meta.ts +3 -3
  33. package/src/translations.ts +12 -10
  34. package/src/types/schema.ts +12 -17
  35. package/dist/lib/browser/chunk-6T47OUOE.mjs +0 -49
  36. package/dist/lib/browser/chunk-6T47OUOE.mjs.map +0 -7
  37. package/dist/lib/browser/intent-resolver-4BJJ7NBA.mjs +0 -20
  38. package/dist/lib/browser/intent-resolver-4BJJ7NBA.mjs.map +0 -7
  39. package/dist/lib/browser/react-surface-DOUPO3F4.mjs +0 -68
  40. package/dist/lib/browser/react-surface-DOUPO3F4.mjs.map +0 -7
  41. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  42. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  43. package/dist/types/src/components/Example/Example.d.ts +0 -16
  44. package/dist/types/src/components/Example/Example.d.ts.map +0 -1
  45. package/dist/types/src/components/Example/Example.stories.d.ts +0 -19
  46. package/dist/types/src/components/Example/Example.stories.d.ts.map +0 -1
  47. package/dist/types/src/components/Example/index.d.ts +0 -2
  48. package/dist/types/src/components/Example/index.d.ts.map +0 -1
  49. package/dist/types/src/components/TemplateContainer.d.ts +0 -7
  50. package/dist/types/src/components/TemplateContainer.d.ts.map +0 -1
  51. package/src/capabilities/intent-resolver.ts +0 -18
  52. package/src/components/Example/Example.stories.tsx +0 -32
  53. package/src/components/Example/Example.tsx +0 -54
  54. package/src/components/TemplateContainer.tsx +0 -18
package/package.json CHANGED
@@ -1,13 +1,23 @@
1
1
  {
2
2
  "name": "@dxos/plugin-template",
3
- "version": "0.8.4-main.72ec0f3",
3
+ "version": "0.8.4-main.74a063c4e0",
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
+ "#types": "./src/types/index.ts"
20
+ },
11
21
  "exports": {
12
22
  ".": {
13
23
  "source": "./src/index.ts",
@@ -33,36 +43,37 @@
33
43
  "src"
34
44
  ],
35
45
  "dependencies": {
36
- "@preact-signals/safe-react": "^0.9.0",
37
- "@preact/signals-core": "^1.12.1",
38
- "@radix-ui/react-context": "^1.1.1",
39
- "effect": "3.18.3",
40
- "@dxos/app-framework": "0.8.4-main.72ec0f3",
41
- "@dxos/echo": "0.8.4-main.72ec0f3",
42
- "@dxos/plugin-client": "0.8.4-main.72ec0f3",
43
- "@dxos/async": "0.8.4-main.72ec0f3",
44
- "@dxos/plugin-graph": "0.8.4-main.72ec0f3",
45
- "@dxos/plugin-space": "0.8.4-main.72ec0f3",
46
- "@dxos/react-ui-stack": "0.8.4-main.72ec0f3",
47
- "@dxos/react-client": "0.8.4-main.72ec0f3",
48
- "@dxos/util": "0.8.4-main.72ec0f3"
46
+ "@radix-ui/react-context": "1.1.1",
47
+ "effect": "3.20.0",
48
+ "@dxos/app-framework": "0.8.4-main.74a063c4e0",
49
+ "@dxos/app-toolkit": "0.8.4-main.74a063c4e0",
50
+ "@dxos/operation": "0.8.4-main.74a063c4e0",
51
+ "@dxos/echo": "0.8.4-main.74a063c4e0",
52
+ "@dxos/async": "0.8.4-main.74a063c4e0",
53
+ "@dxos/plugin-client": "0.8.4-main.74a063c4e0",
54
+ "@dxos/plugin-graph": "0.8.4-main.74a063c4e0",
55
+ "@dxos/react-client": "0.8.4-main.74a063c4e0",
56
+ "@dxos/react-ui-stack": "0.8.4-main.74a063c4e0",
57
+ "@dxos/react-ui-mosaic": "0.8.4-main.74a063c4e0",
58
+ "@dxos/util": "0.8.4-main.74a063c4e0",
59
+ "@dxos/plugin-space": "0.8.4-main.74a063c4e0"
49
60
  },
50
61
  "devDependencies": {
51
- "@types/react": "~19.2.2",
52
- "@types/react-dom": "~19.2.2",
53
- "react": "~19.2.0",
54
- "react-dom": "~19.2.0",
55
- "vite": "7.1.9",
56
- "@dxos/react-ui": "0.8.4-main.72ec0f3",
57
- "@dxos/react-ui-theme": "0.8.4-main.72ec0f3",
58
- "@dxos/storybook-utils": "0.8.4-main.72ec0f3"
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": "^7.1.11",
67
+ "@dxos/storybook-utils": "0.8.4-main.74a063c4e0",
68
+ "@dxos/ui-theme": "0.8.4-main.74a063c4e0",
69
+ "@dxos/react-ui": "0.8.4-main.74a063c4e0"
59
70
  },
60
71
  "peerDependencies": {
61
- "effect": "^3.13.3",
62
- "react": "^19.0.0",
63
- "react-dom": "^19.0.0",
64
- "@dxos/react-ui": "0.8.4-main.72ec0f3",
65
- "@dxos/react-ui-theme": "0.8.4-main.72ec0f3"
72
+ "effect": "3.20.0",
73
+ "react": "~19.2.3",
74
+ "react-dom": "~19.2.3",
75
+ "@dxos/react-ui": "0.8.4-main.74a063c4e0",
76
+ "@dxos/ui-theme": "0.8.4-main.74a063c4e0"
66
77
  },
67
78
  "publishConfig": {
68
79
  "access": "public"
@@ -2,59 +2,44 @@
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';
7
+
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';
13
+ import { type CreateObject } from '@dxos/plugin-space/types';
14
+
15
+ import { ReactSurface } from '#capabilities';
16
+ import { meta } from '#meta';
17
+ import { Template } from '#types';
9
18
 
10
- import { IntentResolver, ReactSurface } from './capabilities';
11
- import { meta } from './meta';
12
19
  import { translations } from './translations';
13
- import { Template } from './types';
14
20
 
15
- export const TemplatePlugin = definePlugin(meta, () => [
16
- defineModule({
17
- id: `${meta.id}/module/translations`,
18
- activatesOn: Events.SetupTranslations,
19
- activate: () => contributes(Capabilities.Translations, translations),
20
- }),
21
- defineModule({
22
- id: `${meta.id}/module/metadata`,
23
- activatesOn: Events.SetupMetadata,
24
- activate: () =>
25
- contributes(Capabilities.Metadata, {
26
- id: Template.Data.typename,
27
- metadata: {
28
- icon: 'ph--asterisk--regular',
29
- iconHue: 'sky',
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,
21
+ export const TemplatePlugin = Plugin.define(meta).pipe(
22
+ AppPlugin.addMetadataModule({
23
+ metadata: {
24
+ id: Template.Data.typename,
25
+ metadata: {
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,
38
+ },
39
+ },
59
40
  }),
60
- ]);
41
+ AppPlugin.addSchemaModule({ schema: [Template.Data] }),
42
+ AppPlugin.addSurfaceModule({ activate: ReactSurface }),
43
+ AppPlugin.addTranslationsModule({ translations }),
44
+ Plugin.make,
45
+ );
@@ -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,28 @@
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
+ 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
+ };
@@ -2,4 +2,4 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- export * from './Example';
5
+ export * from './TemplatePanel';
@@ -2,5 +2,4 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- export * from './Example';
6
- export * from './TemplateContainer';
5
+ export * from './TemplatePanel';
package/src/meta.ts CHANGED
@@ -2,11 +2,11 @@
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
6
  import { trim } from '@dxos/util';
7
7
 
8
- export const meta: PluginMeta = {
9
- id: 'dxos.org/plugin/template',
8
+ export const meta: Plugin.Meta = {
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.
@@ -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
  },
@@ -4,28 +4,23 @@
4
4
 
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
- import { Obj } from '@dxos/echo';
8
- import { TypedObject } from '@dxos/echo/internal';
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,49 +0,0 @@
1
- // src/types/schema.ts
2
- import * as Schema from "effect/Schema";
3
- import { Obj } from "@dxos/echo";
4
- import { TypedObject } from "@dxos/echo/internal";
5
- import { ReactiveObjectSchema } from "@dxos/react-client/echo";
6
-
7
- // src/meta.ts
8
- import { trim } from "@dxos/util";
9
- var meta = {
10
- id: "dxos.org/plugin/template",
11
- name: "Template",
12
- description: trim`
13
- Create reusable templates for documents, tables, and other objects.
14
- Define structured patterns that can be quickly instantiated with pre-configured content and settings.
15
- `,
16
- icon: "ph--asterisk--regular",
17
- iconHue: "sky",
18
- source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-template"
19
- };
20
-
21
- // src/types/schema.ts
22
- (function(Template2) {
23
- class Create extends Schema.TaggedClass()(`${meta.id}/action/create`, {
24
- input: Schema.Struct({
25
- name: Schema.optional(Schema.String)
26
- }),
27
- output: Schema.Struct({
28
- object: ReactiveObjectSchema
29
- })
30
- }) {
31
- }
32
- Template2.Create = Create;
33
- class Data extends TypedObject({
34
- typename: "dxos.org/type/Data",
35
- version: "0.1.0"
36
- })({
37
- name: Schema.optional(Schema.String)
38
- }) {
39
- }
40
- Template2.Data = Data;
41
- Template2.make = (props) => Obj.make(Data, props);
42
- })(Template || (Template = {}));
43
- var Template;
44
-
45
- export {
46
- meta,
47
- Template
48
- };
49
- //# sourceMappingURL=chunk-6T47OUOE.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 * as Schema from 'effect/Schema';\n\nimport { Obj } from '@dxos/echo';\nimport { TypedObject } from '@dxos/echo/internal';\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';\nimport { trim } from '@dxos/util';\n\nexport const meta: PluginMeta = {\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": ";AAIA,YAAYA,YAAY;AAExB,SAASC,WAAW;AACpB,SAASC,mBAAmB;AAC5B,SAASC,4BAA4B;;;ACHrC,SAASC,YAAY;AAEd,IAAMC,OAAmB;EAC9BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;EACNC,SAAS;EACTC,QAAQ;AACV;;;UDLiBC,WAAAA;EACR,MAAMC,eAAsBC,mBAAW,EAAW,GAAGC,KAAKC,EAAE,kBAAkB;IACnFC,OAAcC,cAAO;MACnBC,MAAaC,gBAAgBC,aAAM;IACrC,CAAA;IACAC,QAAeJ,cAAO;MACpBK,QAAQC;IACV,CAAA;EACF,CAAA,EAAA;EAAI;YAPSX,SAAAA;EASN,MAAMY,aAAaC,YAAY;IACpCC,UAAU;IACVC,SAAS;EACX,CAAA,EAAG;IACDT,MAAaC,gBAAgBC,aAAM;EACrC,CAAA,EAAA;EAAI;YALSI,OAAAA;YAOAI,OAAO,CAACC,UAAyBC,IAAIF,KAAKJ,MAAMK,KAAAA;AAC/D,GAlBiBlB,aAAAA,WAAAA,CAAAA,EAAAA;;",
6
- "names": ["Schema", "Obj", "TypedObject", "ReactiveObjectSchema", "trim", "meta", "id", "name", "description", "trim", "icon", "iconHue", "source", "Template", "Create", "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-6T47OUOE.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-4BJJ7NBA.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,2BAAe,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,68 +0,0 @@
1
- import {
2
- Template,
3
- meta
4
- } from "./chunk-6T47OUOE.mjs";
5
-
6
- // src/capabilities/react-surface.tsx
7
- import React3 from "react";
8
- import { Capabilities, contributes, createSurface } from "@dxos/app-framework";
9
- import { Obj as Obj2 } from "@dxos/echo";
10
-
11
- // src/components/Example/Example.tsx
12
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
13
- import { createContext } from "@radix-ui/react-context";
14
- import React from "react";
15
- import { mx } from "@dxos/react-ui-theme";
16
- var [ExampleContextProvider, useExampleContext] = createContext("Example");
17
- var ExampleRoot = ({ children }) => {
18
- var _effect = _useSignals();
19
- try {
20
- return /* @__PURE__ */ React.createElement(ExampleContextProvider, null, children);
21
- } finally {
22
- _effect.f();
23
- }
24
- };
25
- ExampleRoot.displayName = "Example.Root";
26
- var ExampleContent = ({ classNames }) => {
27
- var _effect = _useSignals();
28
- try {
29
- const context = useExampleContext(ExampleContent.displayName);
30
- return /* @__PURE__ */ React.createElement("div", {
31
- className: mx(classNames)
32
- }, JSON.stringify(context));
33
- } finally {
34
- _effect.f();
35
- }
36
- };
37
- ExampleContent.displayName = "Example.Content";
38
-
39
- // src/components/TemplateContainer.tsx
40
- import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
41
- import React2 from "react";
42
- import { Obj } from "@dxos/echo";
43
- import { StackItem } from "@dxos/react-ui-stack";
44
- var TemplateContainer = ({ object }) => {
45
- var _effect = _useSignals2();
46
- try {
47
- return /* @__PURE__ */ React2.createElement(StackItem.Content, null, /* @__PURE__ */ React2.createElement("pre", {
48
- className: "m-4 p-2 ring"
49
- }, /* @__PURE__ */ React2.createElement("span", null, Obj.getDXN(object).toString())));
50
- } finally {
51
- _effect.f();
52
- }
53
- };
54
-
55
- // src/capabilities/react-surface.tsx
56
- var react_surface_default = (() => contributes(Capabilities.ReactSurface, createSurface({
57
- id: meta.id,
58
- role: "article",
59
- filter: (data) => Obj2.instanceOf(Template.Data, data.subject),
60
- component: ({ data, role }) => /* @__PURE__ */ React3.createElement(TemplateContainer, {
61
- role,
62
- object: data.subject
63
- })
64
- })));
65
- export {
66
- react_surface_default as default
67
- };
68
- //# sourceMappingURL=react-surface-DOUPO3F4.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/react-surface.tsx", "../../../src/components/Example/Example.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 2025 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type PropsWithChildren } from 'react';\n\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-ui-theme';\n\n//\n// Context\n//\n\ntype ExampleContextValue = {};\n\nconst [ExampleContextProvider, useExampleContext] = createContext<ExampleContextValue>('Example');\n\n//\n// Root\n//\n\ntype ExampleRootProps = PropsWithChildren;\n\nconst ExampleRoot = ({ children }: ExampleRootProps) => {\n return <ExampleContextProvider>{children}</ExampleContextProvider>;\n};\n\nExampleRoot.displayName = 'Example.Root';\n\n//\n// Content\n//\n\ntype ExampleContentProps = ThemedClassName<{}>;\n\nconst ExampleContent = ({ classNames }: ExampleContentProps) => {\n const context = useExampleContext(ExampleContent.displayName);\n return <div className={mx(classNames)}>{JSON.stringify(context)}</div>;\n};\n\nExampleContent.displayName = 'Example.Content';\n\n//\n// Example\n// https://www.radix-ui.com/primitives/docs/guides/composition\n//\n\nexport const Example = {\n Root: ExampleRoot,\n Content: ExampleContent,\n};\n\nexport type { ExampleRootProps, ExampleContentProps };\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Obj } from '@dxos/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>{Obj.getDXN(object).toString()}</span>\n </pre>\n </StackItem.Content>\n );\n};\n"],
5
- "mappings": ";;;;;;AAIA,OAAOA,YAAW;AAElB,SAASC,cAAcC,aAAaC,qBAAqB;AACzD,SAASC,OAAAA,YAAW;;;;ACHpB,SAASC,qBAAqB;AAC9B,OAAOC,WAAuC;AAG9C,SAASC,UAAU;AAQnB,IAAM,CAACC,wBAAwBC,iBAAAA,IAAqBC,cAAmC,SAAA;AAQvF,IAAMC,cAAc,CAAC,EAAEC,SAAQ,MAAoB;;;AACjD,WAAO,sBAAA,cAACJ,wBAAAA,MAAwBI,QAAAA;;;;AAClC;AAEAD,YAAYE,cAAc;AAQ1B,IAAMC,iBAAiB,CAAC,EAAEC,WAAU,MAAuB;;;AACzD,UAAMC,UAAUP,kBAAkBK,eAAeD,WAAW;AAC5D,WAAO,sBAAA,cAACI,OAAAA;MAAIC,WAAWC,GAAGJ,UAAAA;OAAcK,KAAKC,UAAUL,OAAAA,CAAAA;;;;AACzD;AAEAF,eAAeD,cAAc;;;;ACrC7B,OAAOS,YAAW;AAElB,SAASC,WAAW;AACpB,SAASC,iBAAiB;AAEnB,IAAMC,oBAAoB,CAAC,EAAEC,OAAM,MAAqC;;;AAC7E,WACE,gBAAAC,OAAA,cAACC,UAAUC,SAAO,MAChB,gBAAAF,OAAA,cAACG,OAAAA;MAAIC,WAAU;OACb,gBAAAJ,OAAA,cAACK,QAAAA,MAAMC,IAAIC,OAAOR,MAAAA,EAAQS,SAAQ,CAAA,CAAA,CAAA;;;;AAI1C;;;AFJA,IAAA,yBAAe,MACbC,YACEC,aAAaC,cACbC,cAAc;EACZC,IAAIC,KAAKD;EACTE,MAAM;EACNC,QAAQ,CAACC,SAAuCC,KAAIC,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", "createContext", "React", "mx", "ExampleContextProvider", "useExampleContext", "createContext", "ExampleRoot", "children", "displayName", "ExampleContent", "classNames", "context", "div", "className", "mx", "JSON", "stringify", "React", "Obj", "StackItem", "TemplateContainer", "object", "React", "StackItem", "Content", "pre", "className", "span", "Obj", "getDXN", "toString", "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<import("@dxos/app-framework").InterfaceDef<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,16 +0,0 @@
1
- import React, { type PropsWithChildren } from 'react';
2
- import { type ThemedClassName } from '@dxos/react-ui';
3
- type ExampleRootProps = PropsWithChildren;
4
- type ExampleContentProps = ThemedClassName<{}>;
5
- export declare const Example: {
6
- Root: {
7
- ({ children }: ExampleRootProps): React.JSX.Element;
8
- displayName: string;
9
- };
10
- Content: {
11
- ({ classNames }: ExampleContentProps): React.JSX.Element;
12
- displayName: string;
13
- };
14
- };
15
- export type { ExampleRootProps, ExampleContentProps };
16
- //# sourceMappingURL=Example.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Example.d.ts","sourceRoot":"","sources":["../../../../../src/components/Example/Example.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAetD,KAAK,gBAAgB,GAAG,iBAAiB,CAAC;AAY1C,KAAK,mBAAmB,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC;AAc/C,eAAO,MAAM,OAAO;;uBAxBe,gBAAgB;;;;yBAYX,mBAAmB;;;CAe1D,CAAC;AAEF,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,CAAC"}
@@ -1,19 +0,0 @@
1
- import { type StoryObj } from '@storybook/react-vite';
2
- import React from 'react';
3
- import { type ExampleRootProps } from './Example';
4
- declare const meta: {
5
- title: string;
6
- component: {
7
- ({ children }: ExampleRootProps): React.JSX.Element;
8
- displayName: string;
9
- };
10
- render: (props: ExampleRootProps) => React.JSX.Element;
11
- decorators: import("@storybook/react").Decorator[];
12
- parameters: {
13
- layout: string;
14
- };
15
- };
16
- export default meta;
17
- type Story = StoryObj<typeof meta>;
18
- export declare const Default: Story;
19
- //# sourceMappingURL=Example.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Example.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Example/Example.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAW,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAM3D,QAAA,MAAM,IAAI;;;;;;oBAJmB,gBAAgB;;;;;CAYR,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './Example';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Example/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC"}
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { 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,GAAG,EAAE,MAAM,YAAY,CAAC;AAGjC,eAAO,MAAM,iBAAiB,GAAI,YAAY;IAAE,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,sBAQ9E,CAAC"}