@dxos/plugin-template 0.8.4-main.69d29f4 → 0.8.4-main.6fa680abb7

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 (39) hide show
  1. package/dist/lib/browser/{chunk-HRH4SQLU.mjs → chunk-4GOY3DOO.mjs} +2 -2
  2. package/dist/lib/browser/{chunk-HRH4SQLU.mjs.map → chunk-4GOY3DOO.mjs.map} +1 -1
  3. package/dist/lib/browser/{chunk-TRYLFURO.mjs → chunk-N5OOI66W.mjs} +2 -2
  4. package/dist/lib/browser/{chunk-TRYLFURO.mjs.map → chunk-N5OOI66W.mjs.map} +1 -1
  5. package/dist/lib/browser/index.mjs +12 -11
  6. package/dist/lib/browser/index.mjs.map +3 -3
  7. package/dist/lib/browser/meta.json +1 -1
  8. package/dist/lib/browser/react-surface-X7Z6HT56.mjs +39 -0
  9. package/dist/lib/browser/react-surface-X7Z6HT56.mjs.map +7 -0
  10. package/dist/lib/browser/types/index.mjs +1 -1
  11. package/dist/types/src/TemplatePlugin.d.ts.map +1 -1
  12. package/dist/types/src/capabilities/react-surface/index.d.ts +1 -1
  13. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
  14. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +2 -2
  15. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
  16. package/dist/types/src/components/TemplatePanel/TemplatePanel.d.ts +6 -0
  17. package/dist/types/src/components/TemplatePanel/TemplatePanel.d.ts.map +1 -0
  18. package/dist/types/src/components/TemplatePanel/index.d.ts +2 -0
  19. package/dist/types/src/components/TemplatePanel/index.d.ts.map +1 -0
  20. package/dist/types/src/components/index.d.ts +1 -1
  21. package/dist/types/src/components/index.d.ts.map +1 -1
  22. package/dist/types/src/translations.d.ts +1 -0
  23. package/dist/types/src/translations.d.ts.map +1 -1
  24. package/dist/types/src/types/schema.d.ts +1 -1
  25. package/dist/types/tsconfig.tsbuildinfo +1 -1
  26. package/package.json +21 -20
  27. package/src/TemplatePlugin.tsx +6 -6
  28. package/src/capabilities/react-surface/react-surface.tsx +6 -5
  29. package/src/components/TemplatePanel/TemplatePanel.tsx +21 -0
  30. package/src/components/TemplatePanel/index.ts +5 -0
  31. package/src/components/index.ts +1 -1
  32. package/src/meta.ts +1 -1
  33. package/src/translations.ts +1 -0
  34. package/src/types/schema.ts +1 -1
  35. package/dist/lib/browser/react-surface-FXQGYDUN.mjs +0 -39
  36. package/dist/lib/browser/react-surface-FXQGYDUN.mjs.map +0 -7
  37. package/dist/types/src/components/TemplateContainer.d.ts +0 -6
  38. package/dist/types/src/components/TemplateContainer.d.ts.map +0 -1
  39. package/src/components/TemplateContainer.tsx +0 -21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-template",
3
- "version": "0.8.4-main.69d29f4",
3
+ "version": "0.8.4-main.6fa680abb7",
4
4
  "description": "Template for new plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -38,35 +38,36 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "@radix-ui/react-context": "1.1.1",
41
- "effect": "3.19.11",
42
- "@dxos/app-framework": "0.8.4-main.69d29f4",
43
- "@dxos/plugin-client": "0.8.4-main.69d29f4",
44
- "@dxos/echo": "0.8.4-main.69d29f4",
45
- "@dxos/operation": "0.8.4-main.69d29f4",
46
- "@dxos/plugin-graph": "0.8.4-main.69d29f4",
47
- "@dxos/plugin-space": "0.8.4-main.69d29f4",
48
- "@dxos/react-client": "0.8.4-main.69d29f4",
49
- "@dxos/async": "0.8.4-main.69d29f4",
50
- "@dxos/react-ui-stack": "0.8.4-main.69d29f4",
51
- "@dxos/util": "0.8.4-main.69d29f4",
52
- "@dxos/react-ui-mosaic": "0.8.4-main.69d29f4"
41
+ "effect": "3.19.16",
42
+ "@dxos/app-toolkit": "0.8.4-main.6fa680abb7",
43
+ "@dxos/app-framework": "0.8.4-main.6fa680abb7",
44
+ "@dxos/async": "0.8.4-main.6fa680abb7",
45
+ "@dxos/echo": "0.8.4-main.6fa680abb7",
46
+ "@dxos/plugin-space": "0.8.4-main.6fa680abb7",
47
+ "@dxos/operation": "0.8.4-main.6fa680abb7",
48
+ "@dxos/plugin-graph": "0.8.4-main.6fa680abb7",
49
+ "@dxos/plugin-client": "0.8.4-main.6fa680abb7",
50
+ "@dxos/react-ui-mosaic": "0.8.4-main.6fa680abb7",
51
+ "@dxos/react-client": "0.8.4-main.6fa680abb7",
52
+ "@dxos/react-ui-stack": "0.8.4-main.6fa680abb7",
53
+ "@dxos/util": "0.8.4-main.6fa680abb7"
53
54
  },
54
55
  "devDependencies": {
55
56
  "@types/react": "~19.2.7",
56
57
  "@types/react-dom": "~19.2.3",
57
58
  "react": "~19.2.3",
58
59
  "react-dom": "~19.2.3",
59
- "vite": "7.1.9",
60
- "@dxos/react-ui": "0.8.4-main.69d29f4",
61
- "@dxos/storybook-utils": "0.8.4-main.69d29f4",
62
- "@dxos/ui-theme": "0.8.4-main.69d29f4"
60
+ "vite": "^7.1.11",
61
+ "@dxos/react-ui": "0.8.4-main.6fa680abb7",
62
+ "@dxos/storybook-utils": "0.8.4-main.6fa680abb7",
63
+ "@dxos/ui-theme": "0.8.4-main.6fa680abb7"
63
64
  },
64
65
  "peerDependencies": {
65
- "effect": "3.19.11",
66
+ "effect": "3.19.16",
66
67
  "react": "~19.2.3",
67
68
  "react-dom": "~19.2.3",
68
- "@dxos/react-ui": "0.8.4-main.69d29f4",
69
- "@dxos/ui-theme": "0.8.4-main.69d29f4"
69
+ "@dxos/react-ui": "0.8.4-main.6fa680abb7",
70
+ "@dxos/ui-theme": "0.8.4-main.6fa680abb7"
70
71
  },
71
72
  "publishConfig": {
72
73
  "access": "public"
@@ -4,7 +4,8 @@
4
4
 
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
- import { Common, Plugin } from '@dxos/app-framework';
7
+ import { Plugin } from '@dxos/app-framework';
8
+ import { AppPlugin } from '@dxos/app-toolkit';
8
9
  import { type CreateObject } from '@dxos/plugin-space/types';
9
10
 
10
11
  import { ReactSurface } from './capabilities';
@@ -13,19 +14,18 @@ import { translations } from './translations';
13
14
  import { Template } from './types';
14
15
 
15
16
  export const TemplatePlugin = Plugin.define(meta).pipe(
16
- Common.Plugin.addTranslationsModule({ translations }),
17
- Common.Plugin.addMetadataModule({
17
+ AppPlugin.addMetadataModule({
18
18
  metadata: {
19
19
  id: Template.Data.typename,
20
20
  metadata: {
21
21
  icon: 'ph--asterisk--regular',
22
22
  iconHue: 'sky',
23
23
  createObject: ((props) => Effect.sync(() => Template.make(props))) satisfies CreateObject,
24
- addToCollectionOnCreate: true,
25
24
  },
26
25
  },
27
26
  }),
28
- Common.Plugin.addSchemaModule({ schema: [Template.Data] }),
29
- Common.Plugin.addSurfaceModule({ activate: ReactSurface }),
27
+ AppPlugin.addSchemaModule({ schema: [Template.Data] }),
28
+ AppPlugin.addSurfaceModule({ activate: ReactSurface }),
29
+ AppPlugin.addTranslationsModule({ translations }),
30
30
  Plugin.make,
31
31
  );
@@ -5,23 +5,24 @@
5
5
  import * as Effect from 'effect/Effect';
6
6
  import React from 'react';
7
7
 
8
- import { Capability, Common } from '@dxos/app-framework';
8
+ import { Capabilities, Capability } from '@dxos/app-framework';
9
+ import { Surface } from '@dxos/app-framework/ui';
9
10
  import { Obj } from '@dxos/echo';
10
11
 
11
- import { TemplateContainer } from '../../components';
12
+ import { TemplatePanel } from '../../components';
12
13
  import { meta } from '../../meta';
13
14
  import { Template } from '../../types';
14
15
 
15
16
  export default Capability.makeModule(() =>
16
17
  Effect.succeed(
17
18
  Capability.contributes(
18
- Common.Capability.ReactSurface,
19
- Common.createSurface({
19
+ Capabilities.ReactSurface,
20
+ Surface.create({
20
21
  id: meta.id,
21
22
  role: 'article',
22
23
  filter: (data): data is { subject: Obj.Unknown } => Obj.instanceOf(Template.Data, data.subject),
23
24
  component: ({ data, role }: { data: { subject: Obj.Unknown }; role: string }) => (
24
- <TemplateContainer role={role} subject={data.subject} />
25
+ <TemplatePanel role={role} subject={data.subject} />
25
26
  ),
26
27
  }),
27
28
  ),
@@ -0,0 +1,21 @@
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 TemplatePanelProps = SurfaceComponentProps<Obj.Unknown>;
12
+
13
+ export const TemplatePanel = ({ role, subject: object }: TemplatePanelProps) => {
14
+ return (
15
+ <Panel.Root role={role} className='dx-article'>
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
@@ -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.org/plugin/template',
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.
@@ -16,6 +16,7 @@ export const translations = [
16
16
  'typename label_one': 'Template',
17
17
  'typename label_other': 'Templates',
18
18
  'object name placeholder': 'New template',
19
+ 'add object label': 'Add template',
19
20
  'rename object label': 'Rename template',
20
21
  'delete object label': 'Delete template',
21
22
  'object deleted label': 'Template deleted',
@@ -11,7 +11,7 @@ export namespace Template {
11
11
  name: Schema.optional(Schema.String),
12
12
  }).pipe(
13
13
  Type.object({
14
- typename: 'dxos.org/type/Data',
14
+ typename: 'org.dxos.type.data',
15
15
  version: '0.1.0',
16
16
  }),
17
17
  );
@@ -1,39 +0,0 @@
1
- import {
2
- meta
3
- } from "./chunk-TRYLFURO.mjs";
4
- import {
5
- Template
6
- } from "./chunk-HRH4SQLU.mjs";
7
-
8
- // src/capabilities/react-surface/react-surface.tsx
9
- import * as Effect from "effect/Effect";
10
- import React2 from "react";
11
- import { Capability, Common } from "@dxos/app-framework";
12
- import { Obj as Obj2 } from "@dxos/echo";
13
-
14
- // src/components/TemplateContainer.tsx
15
- import React from "react";
16
- import { Obj } from "@dxos/echo";
17
- import { Layout } from "@dxos/react-ui-mosaic";
18
- var TemplateContainer = ({ role, subject: object }) => {
19
- return /* @__PURE__ */ React.createElement(Layout.Main, {
20
- role
21
- }, /* @__PURE__ */ React.createElement("pre", {
22
- className: "m-4 p-2 ring"
23
- }, /* @__PURE__ */ React.createElement("span", null, Obj.getDXN(object).toString())));
24
- };
25
-
26
- // src/capabilities/react-surface/react-surface.tsx
27
- var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Common.Capability.ReactSurface, Common.createSurface({
28
- id: meta.id,
29
- role: "article",
30
- filter: (data) => Obj2.instanceOf(Template.Data, data.subject),
31
- component: ({ data, role }) => /* @__PURE__ */ React2.createElement(TemplateContainer, {
32
- role,
33
- subject: data.subject
34
- })
35
- }))));
36
- export {
37
- react_surface_default as default
38
- };
39
- //# sourceMappingURL=react-surface-FXQGYDUN.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/react-surface/react-surface.tsx", "../../../src/components/TemplateContainer.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capability, Common } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\n\nimport { TemplateContainer } from '../../components';\nimport { meta } from '../../meta';\nimport { Template } from '../../types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(\n Common.Capability.ReactSurface,\n Common.createSurface({\n id: meta.id,\n role: 'article',\n filter: (data): data is { subject: Obj.Unknown } => Obj.instanceOf(Template.Data, data.subject),\n component: ({ data, role }: { data: { subject: Obj.Unknown }; role: string }) => (\n <TemplateContainer role={role} subject={data.subject} />\n ),\n }),\n ),\n ),\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-framework/react';\nimport { Obj } from '@dxos/echo';\nimport { Layout } from '@dxos/react-ui-mosaic';\n\nexport type TemplateContainerProps = SurfaceComponentProps<Obj.Unknown>;\n\nexport const TemplateContainer = ({ role, subject: object }: TemplateContainerProps) => {\n return (\n <Layout.Main role={role}>\n <pre className='m-4 p-2 ring'>\n <span>{Obj.getDXN(object).toString()}</span>\n </pre>\n </Layout.Main>\n );\n};\n"],
5
- "mappings": ";;;;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,YAAW;AAElB,SAASC,YAAYC,cAAc;AACnC,SAASC,OAAAA,YAAW;;;ACJpB,OAAOC,WAAW;AAGlB,SAASC,WAAW;AACpB,SAASC,cAAc;AAIhB,IAAMC,oBAAoB,CAAC,EAAEC,MAAMC,SAASC,OAAM,MAA0B;AACjF,SACE,sBAAA,cAACC,OAAOC,MAAI;IAACJ;KACX,sBAAA,cAACK,OAAAA;IAAIC,WAAU;KACb,sBAAA,cAACC,QAAAA,MAAMC,IAAIC,OAAOP,MAAAA,EAAQQ,SAAQ,CAAA,CAAA,CAAA;AAI1C;;;ADNA,IAAA,wBAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YACTC,OAAOJ,WAAWK,cAClBD,OAAOE,cAAc;EACnBC,IAAIC,KAAKD;EACTE,MAAM;EACNC,QAAQ,CAACC,SAA2CC,KAAIC,WAAWC,SAASC,MAAMJ,KAAKK,OAAO;EAC9FC,WAAW,CAAC,EAAEN,MAAMF,KAAI,MACtB,gBAAAS,OAAA,cAACC,mBAAAA;IAAkBV;IAAYO,SAASL,KAAKK;;AAEjD,CAAA,CAAA,CAAA,CAAA;",
6
- "names": ["Effect", "React", "Capability", "Common", "Obj", "React", "Obj", "Layout", "TemplateContainer", "role", "subject", "object", "Layout", "Main", "pre", "className", "span", "Obj", "getDXN", "toString", "Capability", "makeModule", "succeed", "contributes", "Common", "ReactSurface", "createSurface", "id", "meta", "role", "filter", "data", "Obj", "instanceOf", "Template", "Data", "subject", "component", "React", "TemplateContainer"]
7
- }
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import { type SurfaceComponentProps } from '@dxos/app-framework/react';
3
- import { Obj } from '@dxos/echo';
4
- export type TemplateContainerProps = SurfaceComponentProps<Obj.Unknown>;
5
- export declare const TemplateContainer: ({ role, subject: object }: TemplateContainerProps) => React.JSX.Element;
6
- //# sourceMappingURL=TemplateContainer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TemplateContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/TemplateContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGjC,MAAM,MAAM,sBAAsB,GAAG,qBAAqB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAExE,eAAO,MAAM,iBAAiB,GAAI,2BAA2B,sBAAsB,sBAQlF,CAAC"}
@@ -1,21 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React from 'react';
6
-
7
- import { type SurfaceComponentProps } from '@dxos/app-framework/react';
8
- import { Obj } from '@dxos/echo';
9
- import { Layout } from '@dxos/react-ui-mosaic';
10
-
11
- export type TemplateContainerProps = SurfaceComponentProps<Obj.Unknown>;
12
-
13
- export const TemplateContainer = ({ role, subject: object }: TemplateContainerProps) => {
14
- return (
15
- <Layout.Main role={role}>
16
- <pre className='m-4 p-2 ring'>
17
- <span>{Obj.getDXN(object).toString()}</span>
18
- </pre>
19
- </Layout.Main>
20
- );
21
- };