@dxos/plugin-template 0.8.3 → 0.8.4-main.3a94e84

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 (37) hide show
  1. package/dist/lib/browser/chunk-LT6IO5CC.mjs +43 -0
  2. package/dist/lib/browser/chunk-LT6IO5CC.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +19 -21
  4. package/dist/lib/browser/index.mjs.map +3 -3
  5. package/dist/lib/browser/{intent-resolver-THP6KTJU.mjs → intent-resolver-TZQ5RSMB.mjs} +6 -8
  6. package/dist/lib/browser/intent-resolver-TZQ5RSMB.mjs.map +7 -0
  7. package/dist/lib/browser/meta.json +1 -1
  8. package/dist/lib/browser/{react-surface-RRVJU3OV.mjs → react-surface-NRU2N7BS.mjs} +10 -9
  9. package/dist/lib/browser/react-surface-NRU2N7BS.mjs.map +7 -0
  10. package/dist/lib/browser/types/index.mjs +7 -0
  11. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  12. package/dist/types/src/meta.d.ts +0 -1
  13. package/dist/types/src/meta.d.ts.map +1 -1
  14. package/dist/types/src/translations.d.ts +15 -20
  15. package/dist/types/src/translations.d.ts.map +1 -1
  16. package/dist/types/src/types/index.d.ts +2 -0
  17. package/dist/types/src/types/index.d.ts.map +1 -0
  18. package/dist/types/src/types/schema.d.ts +27 -0
  19. package/dist/types/src/types/schema.d.ts.map +1 -0
  20. package/dist/types/tsconfig.tsbuildinfo +1 -1
  21. package/package.json +19 -21
  22. package/src/TemplatePlugin.tsx +6 -6
  23. package/src/capabilities/intent-resolver.ts +3 -4
  24. package/src/capabilities/react-surface.tsx +5 -5
  25. package/src/meta.ts +1 -3
  26. package/src/translations.ts +9 -7
  27. package/src/types/index.ts +5 -0
  28. package/src/types/schema.ts +31 -0
  29. package/dist/lib/browser/chunk-GMDXCSM2.mjs +0 -49
  30. package/dist/lib/browser/chunk-GMDXCSM2.mjs.map +0 -7
  31. package/dist/lib/browser/intent-resolver-THP6KTJU.mjs.map +0 -7
  32. package/dist/lib/browser/react-surface-RRVJU3OV.mjs.map +0 -7
  33. package/dist/lib/browser/types.mjs +0 -11
  34. package/dist/types/src/types.d.ts +0 -27
  35. package/dist/types/src/types.d.ts.map +0 -1
  36. package/src/types.ts +0 -36
  37. /package/dist/lib/browser/{types.mjs.map → types/index.mjs.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-template",
3
- "version": "0.8.3",
3
+ "version": "0.8.4-main.3a94e84",
4
4
  "description": "Template for new plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -14,15 +14,15 @@
14
14
  "browser": "./dist/lib/browser/index.mjs"
15
15
  },
16
16
  "./types": {
17
- "types": "./dist/types/src/types.d.ts",
18
- "browser": "./dist/lib/browser/types.mjs"
17
+ "types": "./dist/types/src/types/index.d.ts",
18
+ "browser": "./dist/lib/browser/types/index.mjs"
19
19
  }
20
20
  },
21
21
  "types": "dist/types/src/index.d.ts",
22
22
  "typesVersions": {
23
23
  "*": {
24
24
  "types": [
25
- "dist/types/src/types.d.ts"
25
+ "dist/types/src/types/index.d.ts"
26
26
  ]
27
27
  }
28
28
  },
@@ -33,35 +33,33 @@
33
33
  "dependencies": {
34
34
  "@preact-signals/safe-react": "^0.9.0",
35
35
  "@preact/signals-core": "^1.9.0",
36
- "effect": "3.14.21",
37
- "@dxos/app-framework": "0.8.3",
38
- "@dxos/echo-schema": "0.8.3",
39
- "@dxos/async": "0.8.3",
40
- "@dxos/plugin-client": "0.8.3",
41
- "@dxos/echo": "0.8.3",
42
- "@dxos/plugin-space": "0.8.3",
43
- "@dxos/plugin-graph": "0.8.3",
44
- "@dxos/react-client": "0.8.3",
45
- "@dxos/react-ui-stack": "0.8.3"
36
+ "effect": "3.17.0",
37
+ "@dxos/app-framework": "0.8.4-main.3a94e84",
38
+ "@dxos/async": "0.8.4-main.3a94e84",
39
+ "@dxos/echo": "0.8.4-main.3a94e84",
40
+ "@dxos/echo-schema": "0.8.4-main.3a94e84",
41
+ "@dxos/plugin-client": "0.8.4-main.3a94e84",
42
+ "@dxos/plugin-graph": "0.8.4-main.3a94e84",
43
+ "@dxos/plugin-space": "0.8.4-main.3a94e84",
44
+ "@dxos/react-client": "0.8.4-main.3a94e84",
45
+ "@dxos/react-ui-stack": "0.8.4-main.3a94e84"
46
46
  },
47
47
  "devDependencies": {
48
- "@phosphor-icons/react": "^2.1.5",
49
48
  "@types/react": "~18.2.0",
50
49
  "@types/react-dom": "~18.2.0",
51
50
  "react": "~18.2.0",
52
51
  "react-dom": "~18.2.0",
53
52
  "vite": "5.4.7",
54
- "@dxos/react-ui-theme": "0.8.3",
55
- "@dxos/react-ui": "0.8.3",
56
- "@dxos/storybook-utils": "0.8.3"
53
+ "@dxos/react-ui-theme": "0.8.4-main.3a94e84",
54
+ "@dxos/storybook-utils": "0.8.4-main.3a94e84",
55
+ "@dxos/react-ui": "0.8.4-main.3a94e84"
57
56
  },
58
57
  "peerDependencies": {
59
- "@phosphor-icons/react": "^2.1.5",
60
58
  "effect": "^3.13.3",
61
59
  "react": "~18.2.0",
62
60
  "react-dom": "~18.2.0",
63
- "@dxos/react-ui-theme": "0.8.3",
64
- "@dxos/react-ui": "0.8.3"
61
+ "@dxos/react-ui-theme": "0.8.4-main.3a94e84",
62
+ "@dxos/react-ui": "0.8.4-main.3a94e84"
65
63
  },
66
64
  "publishConfig": {
67
65
  "access": "public"
@@ -9,8 +9,8 @@ import { defineObjectForm } from '@dxos/plugin-space/types';
9
9
 
10
10
  import { ReactSurface, IntentResolver } from './capabilities';
11
11
  import { meta } from './meta';
12
- import translations from './translations';
13
- import { TemplateAction, TemplateType } from './types';
12
+ import { translations } from './translations';
13
+ import { Template } from './types';
14
14
 
15
15
  export const TemplatePlugin = () =>
16
16
  definePlugin(meta, [
@@ -24,7 +24,7 @@ export const TemplatePlugin = () =>
24
24
  activatesOn: Events.SetupMetadata,
25
25
  activate: () =>
26
26
  contributes(Capabilities.Metadata, {
27
- id: TemplateType.typename,
27
+ id: Template.Data.typename,
28
28
  metadata: {
29
29
  icon: 'ph--asterisk--regular',
30
30
  },
@@ -37,15 +37,15 @@ export const TemplatePlugin = () =>
37
37
  contributes(
38
38
  SpaceCapabilities.ObjectForm,
39
39
  defineObjectForm({
40
- objectSchema: TemplateType,
41
- getIntent: () => createIntent(TemplateAction.Create),
40
+ objectSchema: Template.Data,
41
+ getIntent: () => createIntent(Template.Create),
42
42
  }),
43
43
  ),
44
44
  }),
45
45
  defineModule({
46
46
  id: `${meta.id}/module/schema`,
47
47
  activatesOn: ClientEvents.SetupSchema,
48
- activate: () => contributes(ClientCapabilities.Schema, [TemplateType]),
48
+ activate: () => contributes(ClientCapabilities.Schema, [Template.Data]),
49
49
  }),
50
50
  defineModule({
51
51
  id: `${meta.id}/module/react-surface`,
@@ -3,17 +3,16 @@
3
3
  //
4
4
 
5
5
  import { contributes, Capabilities, createResolver } from '@dxos/app-framework';
6
- import { Obj } from '@dxos/echo';
7
6
 
8
- import { TemplateAction, TemplateType } from '../types';
7
+ import { Template } from '../types';
9
8
 
10
9
  export default () =>
11
10
  contributes(
12
11
  Capabilities.IntentResolver,
13
12
  createResolver({
14
- intent: TemplateAction.Create,
13
+ intent: Template.Create,
15
14
  resolve: ({ name }) => ({
16
- data: { object: Obj.make(TemplateType, { name }) },
15
+ data: { object: Template.make({ name }) },
17
16
  }),
18
17
  }),
19
18
  );
@@ -5,19 +5,19 @@
5
5
  import React from 'react';
6
6
 
7
7
  import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
8
- import { type Obj } from '@dxos/echo';
8
+ import { Obj } from '@dxos/echo';
9
9
 
10
10
  import { TemplateContainer } from '../components';
11
- import { TEMPLATE_PLUGIN } from '../meta';
12
- import { isObject } from '../types';
11
+ import { meta } from '../meta';
12
+ import { Template } from '../types';
13
13
 
14
14
  export default () =>
15
15
  contributes(
16
16
  Capabilities.ReactSurface,
17
17
  createSurface({
18
- id: TEMPLATE_PLUGIN,
18
+ id: meta.id,
19
19
  role: 'article',
20
- filter: (data): data is { subject: Obj.Any } => isObject(data.subject),
20
+ filter: (data): data is { subject: Obj.Any } => Obj.instanceOf(Template.Data, data.subject),
21
21
  component: ({ data, role }) => <TemplateContainer role={role} object={data.subject} />,
22
22
  }),
23
23
  );
package/src/meta.ts CHANGED
@@ -4,10 +4,8 @@
4
4
 
5
5
  import { type PluginMeta } from '@dxos/app-framework';
6
6
 
7
- export const TEMPLATE_PLUGIN = 'dxos.org/plugin/template';
8
-
9
7
  export const meta: PluginMeta = {
10
- id: TEMPLATE_PLUGIN,
8
+ id: 'dxos.org/plugin/template',
11
9
  name: 'Template',
12
10
  icon: 'ph--asterisk--regular',
13
11
  source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-template',
@@ -2,24 +2,26 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Type } from '@dxos/echo';
5
+ import { type Resource } from '@dxos/react-ui';
6
6
 
7
- import { TEMPLATE_PLUGIN } from './meta';
8
- import { TemplateType } from './types';
7
+ import { meta } from './meta';
8
+ import { Template } from './types';
9
9
 
10
- export default [
10
+ export const translations = [
11
11
  {
12
12
  'en-US': {
13
- [Type.getTypename(TemplateType)]: {
13
+ [Template.Data.typename]: {
14
14
  'typename label': 'Template',
15
15
  'typename label_zero': 'Templates',
16
16
  'typename label_one': 'Template',
17
17
  'typename label_other': 'Templates',
18
18
  'object name placeholder': 'New template',
19
+ 'rename object label': 'Rename template',
20
+ 'delete object label': 'Delete template',
19
21
  },
20
- [TEMPLATE_PLUGIN]: {
22
+ [meta.id]: {
21
23
  'plugin name': 'Template',
22
24
  },
23
25
  },
24
26
  },
25
- ];
27
+ ] as const satisfies Resource[];
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * from './schema';
@@ -0,0 +1,31 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { Schema } from 'effect';
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';
12
+
13
+ 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),
17
+ }),
18
+ output: Schema.Struct({
19
+ object: ReactiveObjectSchema,
20
+ }),
21
+ }) {}
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
+ }) {}
29
+
30
+ export const make = (props: Partial<Data>) => Obj.make(Data, props);
31
+ }
@@ -1,49 +0,0 @@
1
- // packages/plugins/plugin-template/src/types.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
- // packages/plugins/plugin-template/src/meta.ts
8
- var TEMPLATE_PLUGIN = "dxos.org/plugin/template";
9
- var meta = {
10
- id: TEMPLATE_PLUGIN,
11
- name: "Template",
12
- icon: "ph--asterisk--regular",
13
- source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-template"
14
- };
15
-
16
- // packages/plugins/plugin-template/src/types.ts
17
- (function(TemplateAction2) {
18
- const TEMPLATE_ACTION = `${TEMPLATE_PLUGIN}/action`;
19
- class Create extends Schema.TaggedClass()(`${TEMPLATE_ACTION}/create`, {
20
- input: Schema.Struct({
21
- name: Schema.optional(Schema.String)
22
- }),
23
- output: Schema.Struct({
24
- object: ReactiveObjectSchema
25
- })
26
- }) {
27
- }
28
- TemplateAction2.Create = Create;
29
- })(TemplateAction || (TemplateAction = {}));
30
- var isObject = (object) => {
31
- return Obj.isObject(object) && object.type === "template";
32
- };
33
- var TemplateType = class extends TypedObject({
34
- typename: "dxos.org/type/Template",
35
- version: "0.1.0"
36
- })({
37
- name: Schema.optional(Schema.String)
38
- }) {
39
- };
40
- var TemplateAction;
41
-
42
- export {
43
- TEMPLATE_PLUGIN,
44
- meta,
45
- isObject,
46
- TemplateType,
47
- TemplateAction
48
- };
49
- //# sourceMappingURL=chunk-GMDXCSM2.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types.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 { TEMPLATE_PLUGIN } from './meta';\n\nexport namespace TemplateAction {\n const TEMPLATE_ACTION = `${TEMPLATE_PLUGIN}/action`;\n\n export class Create extends Schema.TaggedClass<Create>()(`${TEMPLATE_ACTION}/create`, {\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n }),\n output: Schema.Struct({\n object: ReactiveObjectSchema,\n }),\n }) {}\n}\n\nexport const isObject = (object: unknown): object is Obj.Any => {\n // TODO(dmaretskyi): Can this be Obj.instanceOf(TemplateType)?\n return Obj.isObject(object) && (object as any).type === 'template';\n};\n\nexport class TemplateType extends TypedObject({\n typename: 'dxos.org/type/Template',\n version: '0.1.0',\n})({\n name: Schema.optional(Schema.String),\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const TEMPLATE_PLUGIN = 'dxos.org/plugin/template';\n\nexport const meta: PluginMeta = {\n id: TEMPLATE_PLUGIN,\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,kBAAkB;AAExB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;EACNC,MAAM;EACNC,QAAQ;AACV;;;UDDiBC,iBAAAA;AACf,QAAMC,kBAAkB,GAAGC,eAAAA;EAEpB,MAAMC,eAAeC,OAAOC,YAAW,EAAW,GAAGJ,eAAAA,WAA0B;IACpFK,OAAOF,OAAOG,OAAO;MACnBC,MAAMJ,OAAOK,SAASL,OAAOM,MAAM;IACrC,CAAA;IACAC,QAAQP,OAAOG,OAAO;MACpBK,QAAQC;IACV,CAAA;EACF,CAAA,EAAA;EAAI;kBAPSV,SAAAA;AAQf,GAXiBH,mBAAAA,iBAAAA,CAAAA,EAAAA;AAaV,IAAMc,WAAW,CAACF,WAAAA;AAEvB,SAAOG,IAAID,SAASF,MAAAA,KAAYA,OAAeI,SAAS;AAC1D;AAEO,IAAMC,eAAN,cAA2BC,YAAY;EAC5CC,UAAU;EACVC,SAAS;AACX,CAAA,EAAG;EACDZ,MAAMJ,OAAOK,SAASL,OAAOM,MAAM;AACrC,CAAA,EAAA;AAAI;;",
6
- "names": ["Schema", "Obj", "TypedObject", "ReactiveObjectSchema", "TEMPLATE_PLUGIN", "meta", "id", "name", "icon", "source", "TemplateAction", "TEMPLATE_ACTION", "TEMPLATE_PLUGIN", "Create", "Schema", "TaggedClass", "input", "Struct", "name", "optional", "String", "output", "object", "ReactiveObjectSchema", "isObject", "Obj", "type", "TemplateType", "TypedObject", "typename", "version"]
7
- }
@@ -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 { contributes, Capabilities, createResolver } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\n\nimport { TemplateAction, TemplateType } from '../types';\n\nexport default () =>\n contributes(\n Capabilities.IntentResolver,\n createResolver({\n intent: TemplateAction.Create,\n resolve: ({ name }) => ({\n data: { object: Obj.make(TemplateType, { name }) },\n }),\n }),\n );\n"],
5
- "mappings": ";;;;;;AAIA,SAASA,aAAaC,cAAcC,sBAAsB;AAC1D,SAASC,WAAW;AAIpB,IAAA,0BAAe,MACbC,YACEC,aAAaC,gBACbC,eAAe;EACbC,QAAQC,eAAeC;EACvBC,SAAS,CAAC,EAAEC,KAAI,OAAQ;IACtBC,MAAM;MAAEC,QAAQC,IAAIC,KAAKC,cAAc;QAAEL;MAAK,CAAA;IAAG;EACnD;AACF,CAAA,CAAA;",
6
- "names": ["contributes", "Capabilities", "createResolver", "Obj", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "TemplateAction", "Create", "resolve", "name", "data", "object", "Obj", "make", "TemplateType"]
7
- }
@@ -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 { type Obj } from '@dxos/echo';\n\nimport { TemplateContainer } from '../components';\nimport { TEMPLATE_PLUGIN } from '../meta';\nimport { isObject } from '../types';\n\nexport default () =>\n contributes(\n Capabilities.ReactSurface,\n createSurface({\n id: TEMPLATE_PLUGIN,\n role: 'article',\n filter: (data): data is { subject: Obj.Any } => isObject(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;;;;ACFzD,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;EACJC,MAAM;EACNC,QAAQ,CAACC,SAAuCC,SAASD,KAAKE,OAAO;EACrEC,WAAW,CAAC,EAAEH,MAAMF,KAAI,MAAO,gBAAAM,OAAA,cAACC,mBAAAA;IAAkBP;IAAYQ,QAAQN,KAAKE;;AAC7E,CAAA,CAAA;",
6
- "names": ["React", "Capabilities", "contributes", "createSurface", "React", "fullyQualifiedId", "StackItem", "TemplateContainer", "object", "StackItem", "Content", "pre", "className", "span", "fullyQualifiedId", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "TEMPLATE_PLUGIN", "role", "filter", "data", "isObject", "subject", "component", "React", "TemplateContainer", "object"]
7
- }
@@ -1,11 +0,0 @@
1
- import {
2
- TemplateAction,
3
- TemplateType,
4
- isObject
5
- } from "./chunk-GMDXCSM2.mjs";
6
- export {
7
- TemplateAction,
8
- TemplateType,
9
- isObject
10
- };
11
- //# sourceMappingURL=types.mjs.map
@@ -1,27 +0,0 @@
1
- import { Schema } from 'effect';
2
- import { Obj } from '@dxos/echo';
3
- export declare namespace TemplateAction {
4
- const Create_base: Schema.TaggedClass<Create, "dxos.org/plugin/template/action/create", {
5
- readonly _tag: Schema.tag<"dxos.org/plugin/template/action/create">;
6
- } & {
7
- input: Schema.Struct<{
8
- name: Schema.optional<typeof Schema.String>;
9
- }>;
10
- output: Schema.Struct<{
11
- object: Schema.Schema<any, any, never>;
12
- }>;
13
- }>;
14
- export class Create extends Create_base {
15
- }
16
- export {};
17
- }
18
- export declare const isObject: (object: unknown) => object is Obj.Any;
19
- declare const TemplateType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("@dxos/echo-schema").TypedObjectFields<{
20
- name: Schema.optional<typeof Schema.String>;
21
- }, import("@dxos/echo-schema").TypedObjectOptions>, Schema.Struct.Encoded<{
22
- name: Schema.optional<typeof Schema.String>;
23
- }>>;
24
- export declare class TemplateType extends TemplateType_base {
25
- }
26
- export {};
27
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAMjC,yBAAiB,cAAc,CAAC;;;;;;;;;;;IAG9B,MAAM,OAAO,MAAO,SAAQ,WAO1B;KAAG;;CACN;AAED,eAAO,MAAM,QAAQ,GAAI,QAAQ,OAAO,KAAG,MAAM,IAAI,GAAG,CAAC,GAGxD,CAAC;;;;;;AAEF,qBAAa,YAAa,SAAQ,iBAKhC;CAAG"}
package/src/types.ts DELETED
@@ -1,36 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import { Schema } from 'effect';
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 { TEMPLATE_PLUGIN } from './meta';
12
-
13
- export namespace TemplateAction {
14
- const TEMPLATE_ACTION = `${TEMPLATE_PLUGIN}/action`;
15
-
16
- export class Create extends Schema.TaggedClass<Create>()(`${TEMPLATE_ACTION}/create`, {
17
- input: Schema.Struct({
18
- name: Schema.optional(Schema.String),
19
- }),
20
- output: Schema.Struct({
21
- object: ReactiveObjectSchema,
22
- }),
23
- }) {}
24
- }
25
-
26
- export const isObject = (object: unknown): object is Obj.Any => {
27
- // TODO(dmaretskyi): Can this be Obj.instanceOf(TemplateType)?
28
- return Obj.isObject(object) && (object as any).type === 'template';
29
- };
30
-
31
- export class TemplateType extends TypedObject({
32
- typename: 'dxos.org/type/Template',
33
- version: '0.1.0',
34
- })({
35
- name: Schema.optional(Schema.String),
36
- }) {}