@dxos/plugin-template 0.8.3-staging.0fa589b → 0.8.4-main.84f28bd

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 (27) hide show
  1. package/dist/lib/browser/{chunk-GMDXCSM2.mjs → chunk-FARPQI2D.mjs} +4 -4
  2. package/dist/lib/browser/index.mjs +11 -12
  3. package/dist/lib/browser/index.mjs.map +3 -3
  4. package/dist/lib/browser/{intent-resolver-THP6KTJU.mjs → intent-resolver-AYJTEW6K.mjs} +3 -3
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/{react-surface-RRVJU3OV.mjs → react-surface-H7UCIT3M.mjs} +5 -5
  7. package/dist/lib/browser/types.mjs +1 -1
  8. package/dist/lib/node-esm/chunk-B3O6VLCP.mjs +51 -0
  9. package/dist/lib/node-esm/chunk-B3O6VLCP.mjs.map +7 -0
  10. package/dist/lib/node-esm/index.mjs +86 -0
  11. package/dist/lib/node-esm/index.mjs.map +7 -0
  12. package/dist/lib/node-esm/intent-resolver-KY2OPU2S.mjs +23 -0
  13. package/dist/lib/node-esm/intent-resolver-KY2OPU2S.mjs.map +7 -0
  14. package/dist/lib/node-esm/meta.json +1 -0
  15. package/dist/lib/node-esm/react-surface-VJDBNR3U.mjs +40 -0
  16. package/dist/lib/node-esm/react-surface-VJDBNR3U.mjs.map +7 -0
  17. package/dist/lib/node-esm/types.mjs +12 -0
  18. package/dist/lib/node-esm/types.mjs.map +7 -0
  19. package/dist/types/src/translations.d.ts +13 -20
  20. package/dist/types/src/translations.d.ts.map +1 -1
  21. package/dist/types/tsconfig.tsbuildinfo +1 -1
  22. package/package.json +16 -18
  23. package/src/TemplatePlugin.tsx +1 -1
  24. package/src/translations.ts +6 -6
  25. /package/dist/lib/browser/{chunk-GMDXCSM2.mjs.map → chunk-FARPQI2D.mjs.map} +0 -0
  26. /package/dist/lib/browser/{intent-resolver-THP6KTJU.mjs.map → intent-resolver-AYJTEW6K.mjs.map} +0 -0
  27. /package/dist/lib/browser/{react-surface-RRVJU3OV.mjs.map → react-surface-H7UCIT3M.mjs.map} +0 -0
@@ -1,10 +1,10 @@
1
- // packages/plugins/plugin-template/src/types.ts
1
+ // src/types.ts
2
2
  import { Schema } from "effect";
3
3
  import { Obj } from "@dxos/echo";
4
4
  import { TypedObject } from "@dxos/echo-schema";
5
5
  import { ReactiveObjectSchema } from "@dxos/react-client/echo";
6
6
 
7
- // packages/plugins/plugin-template/src/meta.ts
7
+ // src/meta.ts
8
8
  var TEMPLATE_PLUGIN = "dxos.org/plugin/template";
9
9
  var meta = {
10
10
  id: TEMPLATE_PLUGIN,
@@ -13,7 +13,7 @@ var meta = {
13
13
  source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-template"
14
14
  };
15
15
 
16
- // packages/plugins/plugin-template/src/types.ts
16
+ // src/types.ts
17
17
  (function(TemplateAction2) {
18
18
  const TEMPLATE_ACTION = `${TEMPLATE_PLUGIN}/action`;
19
19
  class Create extends Schema.TaggedClass()(`${TEMPLATE_ACTION}/create`, {
@@ -46,4 +46,4 @@ export {
46
46
  TemplateType,
47
47
  TemplateAction
48
48
  };
49
- //# sourceMappingURL=chunk-GMDXCSM2.mjs.map
49
+ //# sourceMappingURL=chunk-FARPQI2D.mjs.map
@@ -3,44 +3,43 @@ import {
3
3
  TemplateAction,
4
4
  TemplateType,
5
5
  meta
6
- } from "./chunk-GMDXCSM2.mjs";
6
+ } from "./chunk-FARPQI2D.mjs";
7
7
 
8
- // packages/plugins/plugin-template/src/TemplatePlugin.tsx
8
+ // src/TemplatePlugin.tsx
9
9
  import { createIntent, Capabilities, contributes, Events, defineModule, definePlugin } from "@dxos/app-framework";
10
10
  import { ClientCapabilities, ClientEvents } from "@dxos/plugin-client";
11
11
  import { SpaceCapabilities } from "@dxos/plugin-space";
12
12
  import { defineObjectForm } from "@dxos/plugin-space/types";
13
13
 
14
- // packages/plugins/plugin-template/src/capabilities/index.ts
14
+ // src/capabilities/index.ts
15
15
  import { lazy } from "@dxos/app-framework";
16
- var IntentResolver = lazy(() => import("./intent-resolver-THP6KTJU.mjs"));
17
- var ReactSurface = lazy(() => import("./react-surface-RRVJU3OV.mjs"));
16
+ var IntentResolver = lazy(() => import("./intent-resolver-AYJTEW6K.mjs"));
17
+ var ReactSurface = lazy(() => import("./react-surface-H7UCIT3M.mjs"));
18
18
 
19
- // packages/plugins/plugin-template/src/translations.ts
20
- import { Type } from "@dxos/echo";
21
- var translations_default = [
19
+ // src/translations.ts
20
+ var translations = [
22
21
  {
23
22
  "en-US": {
24
- [Type.getTypename(TemplateType)]: {
23
+ [TemplateType.typename]: {
25
24
  "typename label": "Template",
26
25
  "typename label_zero": "Templates",
27
26
  "typename label_one": "Template",
28
27
  "typename label_other": "Templates",
29
28
  "object name placeholder": "New template"
30
29
  },
31
- [TEMPLATE_PLUGIN]: {
30
+ [meta.id]: {
32
31
  "plugin name": "Template"
33
32
  }
34
33
  }
35
34
  }
36
35
  ];
37
36
 
38
- // packages/plugins/plugin-template/src/TemplatePlugin.tsx
37
+ // src/TemplatePlugin.tsx
39
38
  var TemplatePlugin = () => definePlugin(meta, [
40
39
  defineModule({
41
40
  id: `${meta.id}/module/translations`,
42
41
  activatesOn: Events.SetupTranslations,
43
- activate: () => contributes(Capabilities.Translations, translations_default)
42
+ activate: () => contributes(Capabilities.Translations, translations)
44
43
  }),
45
44
  defineModule({
46
45
  id: `${meta.id}/module/metadata`,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/TemplatePlugin.tsx", "../../../src/capabilities/index.ts", "../../../src/translations.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { createIntent, Capabilities, contributes, Events, defineModule, definePlugin } from '@dxos/app-framework';\nimport { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';\nimport { SpaceCapabilities } from '@dxos/plugin-space';\nimport { defineObjectForm } from '@dxos/plugin-space/types';\n\nimport { ReactSurface, IntentResolver } from './capabilities';\nimport { meta } from './meta';\nimport translations from './translations';\nimport { TemplateAction, TemplateType } from './types';\n\nexport const TemplatePlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/metadata`,\n activatesOn: Events.SetupMetadata,\n activate: () =>\n contributes(Capabilities.Metadata, {\n id: TemplateType.typename,\n metadata: {\n icon: 'ph--asterisk--regular',\n },\n }),\n }),\n defineModule({\n id: `${meta.id}/module/object-form`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () =>\n contributes(\n SpaceCapabilities.ObjectForm,\n defineObjectForm({\n objectSchema: TemplateType,\n getIntent: () => createIntent(TemplateAction.Create),\n }),\n ),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () => contributes(ClientCapabilities.Schema, [TemplateType]),\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: ReactSurface,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\n activate: IntentResolver,\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const IntentResolver = lazy(() => import('./intent-resolver'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Type } from '@dxos/echo';\n\nimport { TEMPLATE_PLUGIN } from './meta';\nimport { TemplateType } from './types';\n\nexport default [\n {\n 'en-US': {\n [Type.getTypename(TemplateType)]: {\n 'typename label': 'Template',\n 'typename label_zero': 'Templates',\n 'typename label_one': 'Template',\n 'typename label_other': 'Templates',\n 'object name placeholder': 'New template',\n },\n [TEMPLATE_PLUGIN]: {\n 'plugin name': 'Template',\n },\n },\n },\n];\n"],
5
- "mappings": ";;;;;;;;AAIA,SAASA,cAAcC,cAAcC,aAAaC,QAAQC,cAAcC,oBAAoB;AAC5F,SAASC,oBAAoBC,oBAAoB;AACjD,SAASC,yBAAyB;AAClC,SAASC,wBAAwB;;;ACHjC,SAASC,YAAY;AAEd,IAAMC,iBAAiBC,KAAK,MAAM,OAAO,gCAAA,CAAA;AACzC,IAAMC,eAAeD,KAAK,MAAM,OAAO,8BAAA,CAAA;;;ACH9C,SAASE,YAAY;AAKrB,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACC,KAAKC,YAAYC,YAAAA,CAAAA,GAAgB;QAChC,kBAAkB;QAClB,uBAAuB;QACvB,sBAAsB;QACtB,wBAAwB;QACxB,2BAA2B;MAC7B;MACA,CAACC,eAAAA,GAAkB;QACjB,eAAe;MACjB;IACF;EACF;;;;AFTK,IAAMC,iBAAiB,MAC5BC,aAAaC,MAAM;EACjBC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,UAAU,MAAMC,YAAYC,aAAaC,cAAcC,oBAAAA;EACzD,CAAA;EACAT,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOO;IACpBL,UAAU,MACRC,YAAYC,aAAaI,UAAU;MACjCV,IAAIW,aAAaC;MACjBC,UAAU;QACRC,MAAM;MACR;IACF,CAAA;EACJ,CAAA;EACAf,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAac,aAAaC;IAC1BZ,UAAU,MACRC,YACEY,kBAAkBC,YAClBC,iBAAiB;MACfC,cAAcT;MACdU,WAAW,MAAMC,aAAaC,eAAeC,MAAM;IACrD,CAAA,CAAA;EAEN,CAAA;EACAzB,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAac,aAAaC;IAC1BZ,UAAU,MAAMC,YAAYoB,mBAAmBC,QAAQ;MAACf;KAAa;EACvE,CAAA;EACAZ,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOyB;IACpBvB,UAAUwB;EACZ,CAAA;EACA7B,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAO2B;IACpBzB,UAAU0B;EACZ,CAAA;CACD;",
6
- "names": ["createIntent", "Capabilities", "contributes", "Events", "defineModule", "definePlugin", "ClientCapabilities", "ClientEvents", "SpaceCapabilities", "defineObjectForm", "lazy", "IntentResolver", "lazy", "ReactSurface", "Type", "Type", "getTypename", "TemplateType", "TEMPLATE_PLUGIN", "TemplatePlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "SetupMetadata", "Metadata", "TemplateType", "typename", "metadata", "icon", "ClientEvents", "SetupSchema", "SpaceCapabilities", "ObjectForm", "defineObjectForm", "objectSchema", "getIntent", "createIntent", "TemplateAction", "Create", "ClientCapabilities", "Schema", "SetupReactSurface", "ReactSurface", "SetupIntentResolver", "IntentResolver"]
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { createIntent, Capabilities, contributes, Events, defineModule, definePlugin } from '@dxos/app-framework';\nimport { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';\nimport { SpaceCapabilities } from '@dxos/plugin-space';\nimport { defineObjectForm } from '@dxos/plugin-space/types';\n\nimport { ReactSurface, IntentResolver } from './capabilities';\nimport { meta } from './meta';\nimport { translations } from './translations';\nimport { TemplateAction, TemplateType } from './types';\n\nexport const TemplatePlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/metadata`,\n activatesOn: Events.SetupMetadata,\n activate: () =>\n contributes(Capabilities.Metadata, {\n id: TemplateType.typename,\n metadata: {\n icon: 'ph--asterisk--regular',\n },\n }),\n }),\n defineModule({\n id: `${meta.id}/module/object-form`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () =>\n contributes(\n SpaceCapabilities.ObjectForm,\n defineObjectForm({\n objectSchema: TemplateType,\n getIntent: () => createIntent(TemplateAction.Create),\n }),\n ),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () => contributes(ClientCapabilities.Schema, [TemplateType]),\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: ReactSurface,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\n activate: IntentResolver,\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const IntentResolver = lazy(() => import('./intent-resolver'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from './meta';\nimport { TemplateType } from './types';\n\nexport const translations = [\n {\n 'en-US': {\n [TemplateType.typename]: {\n 'typename label': 'Template',\n 'typename label_zero': 'Templates',\n 'typename label_one': 'Template',\n 'typename label_other': 'Templates',\n 'object name placeholder': 'New template',\n },\n [meta.id]: {\n 'plugin name': 'Template',\n },\n },\n },\n] as const satisfies Resource[];\n"],
5
+ "mappings": ";;;;;;;;AAIA,SAASA,cAAcC,cAAcC,aAAaC,QAAQC,cAAcC,oBAAoB;AAC5F,SAASC,oBAAoBC,oBAAoB;AACjD,SAASC,yBAAyB;AAClC,SAASC,wBAAwB;;;ACHjC,SAASC,YAAY;AAEd,IAAMC,iBAAiBC,KAAK,MAAM,OAAO,gCAAA,CAAA;AACzC,IAAMC,eAAeD,KAAK,MAAM,OAAO,8BAAA,CAAA;;;ACEvC,IAAME,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,aAAaC,QAAQ,GAAG;QACvB,kBAAkB;QAClB,uBAAuB;QACvB,sBAAsB;QACtB,wBAAwB;QACxB,2BAA2B;MAC7B;MACA,CAACC,KAAKC,EAAE,GAAG;QACT,eAAe;MACjB;IACF;EACF;;;;AFTK,IAAMC,iBAAiB,MAC5BC,aAAaC,MAAM;EACjBC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,UAAU,MAAMC,YAAYC,aAAaC,cAAcC,YAAAA;EACzD,CAAA;EACAT,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOO;IACpBL,UAAU,MACRC,YAAYC,aAAaI,UAAU;MACjCV,IAAIW,aAAaC;MACjBC,UAAU;QACRC,MAAM;MACR;IACF,CAAA;EACJ,CAAA;EACAf,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAac,aAAaC;IAC1BZ,UAAU,MACRC,YACEY,kBAAkBC,YAClBC,iBAAiB;MACfC,cAAcT;MACdU,WAAW,MAAMC,aAAaC,eAAeC,MAAM;IACrD,CAAA,CAAA;EAEN,CAAA;EACAzB,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAac,aAAaC;IAC1BZ,UAAU,MAAMC,YAAYoB,mBAAmBC,QAAQ;MAACf;KAAa;EACvE,CAAA;EACAZ,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOyB;IACpBvB,UAAUwB;EACZ,CAAA;EACA7B,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAO2B;IACpBzB,UAAU0B;EACZ,CAAA;CACD;",
6
+ "names": ["createIntent", "Capabilities", "contributes", "Events", "defineModule", "definePlugin", "ClientCapabilities", "ClientEvents", "SpaceCapabilities", "defineObjectForm", "lazy", "IntentResolver", "lazy", "ReactSurface", "translations", "TemplateType", "typename", "meta", "id", "TemplatePlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "SetupMetadata", "Metadata", "TemplateType", "typename", "metadata", "icon", "ClientEvents", "SetupSchema", "SpaceCapabilities", "ObjectForm", "defineObjectForm", "objectSchema", "getIntent", "createIntent", "TemplateAction", "Create", "ClientCapabilities", "Schema", "SetupReactSurface", "ReactSurface", "SetupIntentResolver", "IntentResolver"]
7
7
  }
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  TemplateAction,
3
3
  TemplateType
4
- } from "./chunk-GMDXCSM2.mjs";
4
+ } from "./chunk-FARPQI2D.mjs";
5
5
 
6
- // packages/plugins/plugin-template/src/capabilities/intent-resolver.ts
6
+ // src/capabilities/intent-resolver.ts
7
7
  import { contributes, Capabilities, createResolver } from "@dxos/app-framework";
8
8
  import { Obj } from "@dxos/echo";
9
9
  var intent_resolver_default = () => contributes(Capabilities.IntentResolver, createResolver({
@@ -19,4 +19,4 @@ var intent_resolver_default = () => contributes(Capabilities.IntentResolver, cre
19
19
  export {
20
20
  intent_resolver_default as default
21
21
  };
22
- //# sourceMappingURL=intent-resolver-THP6KTJU.mjs.map
22
+ //# sourceMappingURL=intent-resolver-AYJTEW6K.mjs.map
@@ -1 +1 @@
1
- {"inputs":{"packages/plugins/plugin-template/src/meta.ts":{"bytes":1283,"imports":[],"format":"esm"},"packages/plugins/plugin-template/src/types.ts":{"bytes":3854,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-template/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-template/src/capabilities/intent-resolver.ts":{"bytes":2136,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-template/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-template/src/components/TemplateContainer.tsx":{"bytes":2058,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-template/src/components/index.ts":{"bytes":508,"imports":[{"path":"packages/plugins/plugin-template/src/components/TemplateContainer.tsx","kind":"import-statement","original":"./TemplateContainer"}],"format":"esm"},"packages/plugins/plugin-template/src/capabilities/react-surface.tsx":{"bytes":2591,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-template/src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"packages/plugins/plugin-template/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-template/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-template/src/capabilities/index.ts":{"bytes":1051,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-template/src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"packages/plugins/plugin-template/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/plugin-template/src/translations.ts":{"bytes":2148,"imports":[{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-template/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-template/src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-template/src/TemplatePlugin.tsx":{"bytes":7433,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-template/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-template/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-template/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-template/src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-template/src/index.ts":{"bytes":570,"imports":[{"path":"packages/plugins/plugin-template/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-template/src/TemplatePlugin.tsx","kind":"import-statement","original":"./TemplatePlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-template/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5030},"packages/plugins/plugin-template/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-template/dist/lib/browser/chunk-GMDXCSM2.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-template/dist/lib/browser/intent-resolver-THP6KTJU.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-template/dist/lib/browser/react-surface-RRVJU3OV.mjs","kind":"dynamic-import"},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["TEMPLATE_PLUGIN","TemplatePlugin","meta"],"entryPoint":"packages/plugins/plugin-template/src/index.ts","inputs":{"packages/plugins/plugin-template/src/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-template/src/TemplatePlugin.tsx":{"bytesInOutput":1561},"packages/plugins/plugin-template/src/capabilities/index.ts":{"bytesInOutput":190},"packages/plugins/plugin-template/src/translations.ts":{"bytesInOutput":435}},"bytes":2617},"packages/plugins/plugin-template/dist/lib/browser/types.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-template/dist/lib/browser/types.mjs":{"imports":[{"path":"packages/plugins/plugin-template/dist/lib/browser/chunk-GMDXCSM2.mjs","kind":"import-statement"}],"exports":["TemplateAction","TemplateType","isObject"],"entryPoint":"packages/plugins/plugin-template/src/types.ts","inputs":{},"bytes":177},"packages/plugins/plugin-template/dist/lib/browser/intent-resolver-THP6KTJU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1071},"packages/plugins/plugin-template/dist/lib/browser/intent-resolver-THP6KTJU.mjs":{"imports":[{"path":"packages/plugins/plugin-template/dist/lib/browser/chunk-GMDXCSM2.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-template/src/capabilities/intent-resolver.ts","inputs":{"packages/plugins/plugin-template/src/capabilities/intent-resolver.ts":{"bytesInOutput":359}},"bytes":608},"packages/plugins/plugin-template/dist/lib/browser/react-surface-RRVJU3OV.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2236},"packages/plugins/plugin-template/dist/lib/browser/react-surface-RRVJU3OV.mjs":{"imports":[{"path":"packages/plugins/plugin-template/dist/lib/browser/chunk-GMDXCSM2.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-template/src/capabilities/react-surface.tsx","inputs":{"packages/plugins/plugin-template/src/capabilities/react-surface.tsx":{"bytesInOutput":419},"packages/plugins/plugin-template/src/components/TemplateContainer.tsx":{"bytesInOutput":572},"packages/plugins/plugin-template/src/components/index.ts":{"bytesInOutput":0}},"bytes":1378},"packages/plugins/plugin-template/dist/lib/browser/chunk-GMDXCSM2.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2537},"packages/plugins/plugin-template/dist/lib/browser/chunk-GMDXCSM2.mjs":{"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["TEMPLATE_PLUGIN","TemplateAction","TemplateType","isObject","meta"],"inputs":{"packages/plugins/plugin-template/src/types.ts":{"bytesInOutput":847},"packages/plugins/plugin-template/src/meta.ts":{"bytesInOutput":226}},"bytes":1350}}}
1
+ {"inputs":{"src/meta.ts":{"bytes":1270,"imports":[],"format":"esm"},"src/types.ts":{"bytes":3841,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/capabilities/intent-resolver.ts":{"bytes":2123,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/components/TemplateContainer.tsx":{"bytes":2045,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true}],"format":"esm"},"src/components/index.ts":{"bytes":495,"imports":[{"path":"src/components/TemplateContainer.tsx","kind":"import-statement","original":"./TemplateContainer"}],"format":"esm"},"src/capabilities/react-surface.tsx":{"bytes":2578,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":1038,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/translations.ts":{"bytes":2105,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/TemplatePlugin.tsx":{"bytes":7432,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/index.ts":{"bytes":557,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/TemplatePlugin.tsx","kind":"import-statement","original":"./TemplatePlugin"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5026},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-FARPQI2D.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/intent-resolver-AYJTEW6K.mjs","kind":"dynamic-import"},{"path":"dist/lib/browser/react-surface-H7UCIT3M.mjs","kind":"dynamic-import"}],"exports":["TEMPLATE_PLUGIN","TemplatePlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/TemplatePlugin.tsx":{"bytesInOutput":1553},"src/capabilities/index.ts":{"bytesInOutput":190},"src/translations.ts":{"bytesInOutput":375}},"bytes":2417},"dist/lib/browser/types.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/types.mjs":{"imports":[{"path":"dist/lib/browser/chunk-FARPQI2D.mjs","kind":"import-statement"}],"exports":["TemplateAction","TemplateType","isObject"],"entryPoint":"src/types.ts","inputs":{},"bytes":177},"dist/lib/browser/intent-resolver-AYJTEW6K.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1071},"dist/lib/browser/intent-resolver-AYJTEW6K.mjs":{"imports":[{"path":"dist/lib/browser/chunk-FARPQI2D.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/intent-resolver.ts","inputs":{"src/capabilities/intent-resolver.ts":{"bytesInOutput":359}},"bytes":575},"dist/lib/browser/react-surface-H7UCIT3M.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2236},"dist/lib/browser/react-surface-H7UCIT3M.mjs":{"imports":[{"path":"dist/lib/browser/chunk-FARPQI2D.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface.tsx","inputs":{"src/capabilities/react-surface.tsx":{"bytesInOutput":419},"src/components/TemplateContainer.tsx":{"bytesInOutput":572},"src/components/index.ts":{"bytesInOutput":0}},"bytes":1279},"dist/lib/browser/chunk-FARPQI2D.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2537},"dist/lib/browser/chunk-FARPQI2D.mjs":{"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["TEMPLATE_PLUGIN","TemplateAction","TemplateType","isObject","meta"],"inputs":{"src/types.ts":{"bytesInOutput":847},"src/meta.ts":{"bytesInOutput":226}},"bytes":1251}}}
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  TEMPLATE_PLUGIN,
3
3
  isObject
4
- } from "./chunk-GMDXCSM2.mjs";
4
+ } from "./chunk-FARPQI2D.mjs";
5
5
 
6
- // packages/plugins/plugin-template/src/capabilities/react-surface.tsx
6
+ // src/capabilities/react-surface.tsx
7
7
  import React2 from "react";
8
8
  import { Capabilities, contributes, createSurface } from "@dxos/app-framework";
9
9
 
10
- // packages/plugins/plugin-template/src/components/TemplateContainer.tsx
10
+ // src/components/TemplateContainer.tsx
11
11
  import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
12
12
  import React from "react";
13
13
  import { fullyQualifiedId } from "@dxos/react-client/echo";
@@ -23,7 +23,7 @@ var TemplateContainer = ({ object }) => {
23
23
  }
24
24
  };
25
25
 
26
- // packages/plugins/plugin-template/src/capabilities/react-surface.tsx
26
+ // src/capabilities/react-surface.tsx
27
27
  var react_surface_default = () => contributes(Capabilities.ReactSurface, createSurface({
28
28
  id: TEMPLATE_PLUGIN,
29
29
  role: "article",
@@ -36,4 +36,4 @@ var react_surface_default = () => contributes(Capabilities.ReactSurface, createS
36
36
  export {
37
37
  react_surface_default as default
38
38
  };
39
- //# sourceMappingURL=react-surface-RRVJU3OV.mjs.map
39
+ //# sourceMappingURL=react-surface-H7UCIT3M.mjs.map
@@ -2,7 +2,7 @@ import {
2
2
  TemplateAction,
3
3
  TemplateType,
4
4
  isObject
5
- } from "./chunk-GMDXCSM2.mjs";
5
+ } from "./chunk-FARPQI2D.mjs";
6
6
  export {
7
7
  TemplateAction,
8
8
  TemplateType,
@@ -0,0 +1,51 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+
3
+ // src/types.ts
4
+ import { Schema } from "effect";
5
+ import { Obj } from "@dxos/echo";
6
+ import { TypedObject } from "@dxos/echo-schema";
7
+ import { ReactiveObjectSchema } from "@dxos/react-client/echo";
8
+
9
+ // src/meta.ts
10
+ var TEMPLATE_PLUGIN = "dxos.org/plugin/template";
11
+ var meta = {
12
+ id: TEMPLATE_PLUGIN,
13
+ name: "Template",
14
+ icon: "ph--asterisk--regular",
15
+ source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-template"
16
+ };
17
+
18
+ // src/types.ts
19
+ (function(TemplateAction2) {
20
+ const TEMPLATE_ACTION = `${TEMPLATE_PLUGIN}/action`;
21
+ class Create extends Schema.TaggedClass()(`${TEMPLATE_ACTION}/create`, {
22
+ input: Schema.Struct({
23
+ name: Schema.optional(Schema.String)
24
+ }),
25
+ output: Schema.Struct({
26
+ object: ReactiveObjectSchema
27
+ })
28
+ }) {
29
+ }
30
+ TemplateAction2.Create = Create;
31
+ })(TemplateAction || (TemplateAction = {}));
32
+ var isObject = (object) => {
33
+ return Obj.isObject(object) && object.type === "template";
34
+ };
35
+ var TemplateType = class extends TypedObject({
36
+ typename: "dxos.org/type/Template",
37
+ version: "0.1.0"
38
+ })({
39
+ name: Schema.optional(Schema.String)
40
+ }) {
41
+ };
42
+ var TemplateAction;
43
+
44
+ export {
45
+ TEMPLATE_PLUGIN,
46
+ meta,
47
+ isObject,
48
+ TemplateType,
49
+ TemplateAction
50
+ };
51
+ //# sourceMappingURL=chunk-B3O6VLCP.mjs.map
@@ -0,0 +1,7 @@
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
+ }
@@ -0,0 +1,86 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ TEMPLATE_PLUGIN,
4
+ TemplateAction,
5
+ TemplateType,
6
+ meta
7
+ } from "./chunk-B3O6VLCP.mjs";
8
+
9
+ // src/TemplatePlugin.tsx
10
+ import { createIntent, Capabilities, contributes, Events, defineModule, definePlugin } from "@dxos/app-framework";
11
+ import { ClientCapabilities, ClientEvents } from "@dxos/plugin-client";
12
+ import { SpaceCapabilities } from "@dxos/plugin-space";
13
+ import { defineObjectForm } from "@dxos/plugin-space/types";
14
+
15
+ // src/capabilities/index.ts
16
+ import { lazy } from "@dxos/app-framework";
17
+ var IntentResolver = lazy(() => import("./intent-resolver-KY2OPU2S.mjs"));
18
+ var ReactSurface = lazy(() => import("./react-surface-VJDBNR3U.mjs"));
19
+
20
+ // src/translations.ts
21
+ var translations = [
22
+ {
23
+ "en-US": {
24
+ [TemplateType.typename]: {
25
+ "typename label": "Template",
26
+ "typename label_zero": "Templates",
27
+ "typename label_one": "Template",
28
+ "typename label_other": "Templates",
29
+ "object name placeholder": "New template"
30
+ },
31
+ [meta.id]: {
32
+ "plugin name": "Template"
33
+ }
34
+ }
35
+ }
36
+ ];
37
+
38
+ // src/TemplatePlugin.tsx
39
+ var TemplatePlugin = () => definePlugin(meta, [
40
+ defineModule({
41
+ id: `${meta.id}/module/translations`,
42
+ activatesOn: Events.SetupTranslations,
43
+ activate: () => contributes(Capabilities.Translations, translations)
44
+ }),
45
+ defineModule({
46
+ id: `${meta.id}/module/metadata`,
47
+ activatesOn: Events.SetupMetadata,
48
+ activate: () => contributes(Capabilities.Metadata, {
49
+ id: TemplateType.typename,
50
+ metadata: {
51
+ icon: "ph--asterisk--regular"
52
+ }
53
+ })
54
+ }),
55
+ defineModule({
56
+ id: `${meta.id}/module/object-form`,
57
+ activatesOn: ClientEvents.SetupSchema,
58
+ activate: () => contributes(SpaceCapabilities.ObjectForm, defineObjectForm({
59
+ objectSchema: TemplateType,
60
+ getIntent: () => createIntent(TemplateAction.Create)
61
+ }))
62
+ }),
63
+ defineModule({
64
+ id: `${meta.id}/module/schema`,
65
+ activatesOn: ClientEvents.SetupSchema,
66
+ activate: () => contributes(ClientCapabilities.Schema, [
67
+ TemplateType
68
+ ])
69
+ }),
70
+ defineModule({
71
+ id: `${meta.id}/module/react-surface`,
72
+ activatesOn: Events.SetupReactSurface,
73
+ activate: ReactSurface
74
+ }),
75
+ defineModule({
76
+ id: `${meta.id}/module/intent-resolver`,
77
+ activatesOn: Events.SetupIntentResolver,
78
+ activate: IntentResolver
79
+ })
80
+ ]);
81
+ export {
82
+ TEMPLATE_PLUGIN,
83
+ TemplatePlugin,
84
+ meta
85
+ };
86
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/TemplatePlugin.tsx", "../../../src/capabilities/index.ts", "../../../src/translations.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { createIntent, Capabilities, contributes, Events, defineModule, definePlugin } from '@dxos/app-framework';\nimport { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';\nimport { SpaceCapabilities } from '@dxos/plugin-space';\nimport { defineObjectForm } from '@dxos/plugin-space/types';\n\nimport { ReactSurface, IntentResolver } from './capabilities';\nimport { meta } from './meta';\nimport { translations } from './translations';\nimport { TemplateAction, TemplateType } from './types';\n\nexport const TemplatePlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/metadata`,\n activatesOn: Events.SetupMetadata,\n activate: () =>\n contributes(Capabilities.Metadata, {\n id: TemplateType.typename,\n metadata: {\n icon: 'ph--asterisk--regular',\n },\n }),\n }),\n defineModule({\n id: `${meta.id}/module/object-form`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () =>\n contributes(\n SpaceCapabilities.ObjectForm,\n defineObjectForm({\n objectSchema: TemplateType,\n getIntent: () => createIntent(TemplateAction.Create),\n }),\n ),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () => contributes(ClientCapabilities.Schema, [TemplateType]),\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: ReactSurface,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\n activate: IntentResolver,\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const IntentResolver = lazy(() => import('./intent-resolver'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from './meta';\nimport { TemplateType } from './types';\n\nexport const translations = [\n {\n 'en-US': {\n [TemplateType.typename]: {\n 'typename label': 'Template',\n 'typename label_zero': 'Templates',\n 'typename label_one': 'Template',\n 'typename label_other': 'Templates',\n 'object name placeholder': 'New template',\n },\n [meta.id]: {\n 'plugin name': 'Template',\n },\n },\n },\n] as const satisfies Resource[];\n"],
5
+ "mappings": ";;;;;;;;;AAIA,SAASA,cAAcC,cAAcC,aAAaC,QAAQC,cAAcC,oBAAoB;AAC5F,SAASC,oBAAoBC,oBAAoB;AACjD,SAASC,yBAAyB;AAClC,SAASC,wBAAwB;;;ACHjC,SAASC,YAAY;AAEd,IAAMC,iBAAiBC,KAAK,MAAM,OAAO,gCAAA,CAAA;AACzC,IAAMC,eAAeD,KAAK,MAAM,OAAO,8BAAA,CAAA;;;ACEvC,IAAME,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,aAAaC,QAAQ,GAAG;QACvB,kBAAkB;QAClB,uBAAuB;QACvB,sBAAsB;QACtB,wBAAwB;QACxB,2BAA2B;MAC7B;MACA,CAACC,KAAKC,EAAE,GAAG;QACT,eAAe;MACjB;IACF;EACF;;;;AFTK,IAAMC,iBAAiB,MAC5BC,aAAaC,MAAM;EACjBC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,UAAU,MAAMC,YAAYC,aAAaC,cAAcC,YAAAA;EACzD,CAAA;EACAT,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOO;IACpBL,UAAU,MACRC,YAAYC,aAAaI,UAAU;MACjCV,IAAIW,aAAaC;MACjBC,UAAU;QACRC,MAAM;MACR;IACF,CAAA;EACJ,CAAA;EACAf,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAac,aAAaC;IAC1BZ,UAAU,MACRC,YACEY,kBAAkBC,YAClBC,iBAAiB;MACfC,cAAcT;MACdU,WAAW,MAAMC,aAAaC,eAAeC,MAAM;IACrD,CAAA,CAAA;EAEN,CAAA;EACAzB,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAac,aAAaC;IAC1BZ,UAAU,MAAMC,YAAYoB,mBAAmBC,QAAQ;MAACf;KAAa;EACvE,CAAA;EACAZ,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOyB;IACpBvB,UAAUwB;EACZ,CAAA;EACA7B,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAO2B;IACpBzB,UAAU0B;EACZ,CAAA;CACD;",
6
+ "names": ["createIntent", "Capabilities", "contributes", "Events", "defineModule", "definePlugin", "ClientCapabilities", "ClientEvents", "SpaceCapabilities", "defineObjectForm", "lazy", "IntentResolver", "lazy", "ReactSurface", "translations", "TemplateType", "typename", "meta", "id", "TemplatePlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "SetupMetadata", "Metadata", "TemplateType", "typename", "metadata", "icon", "ClientEvents", "SetupSchema", "SpaceCapabilities", "ObjectForm", "defineObjectForm", "objectSchema", "getIntent", "createIntent", "TemplateAction", "Create", "ClientCapabilities", "Schema", "SetupReactSurface", "ReactSurface", "SetupIntentResolver", "IntentResolver"]
7
+ }
@@ -0,0 +1,23 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ TemplateAction,
4
+ TemplateType
5
+ } from "./chunk-B3O6VLCP.mjs";
6
+
7
+ // src/capabilities/intent-resolver.ts
8
+ import { contributes, Capabilities, createResolver } from "@dxos/app-framework";
9
+ import { Obj } from "@dxos/echo";
10
+ var intent_resolver_default = () => contributes(Capabilities.IntentResolver, createResolver({
11
+ intent: TemplateAction.Create,
12
+ resolve: ({ name }) => ({
13
+ data: {
14
+ object: Obj.make(TemplateType, {
15
+ name
16
+ })
17
+ }
18
+ })
19
+ }));
20
+ export {
21
+ intent_resolver_default as default
22
+ };
23
+ //# sourceMappingURL=intent-resolver-KY2OPU2S.mjs.map
@@ -0,0 +1,7 @@
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
+ }
@@ -0,0 +1 @@
1
+ {"inputs":{"src/meta.ts":{"bytes":1270,"imports":[],"format":"esm"},"src/types.ts":{"bytes":3841,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/capabilities/intent-resolver.ts":{"bytes":2123,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/components/TemplateContainer.tsx":{"bytes":2045,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true}],"format":"esm"},"src/components/index.ts":{"bytes":495,"imports":[{"path":"src/components/TemplateContainer.tsx","kind":"import-statement","original":"./TemplateContainer"}],"format":"esm"},"src/capabilities/react-surface.tsx":{"bytes":2578,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":1038,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/translations.ts":{"bytes":2105,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/TemplatePlugin.tsx":{"bytes":7432,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/index.ts":{"bytes":557,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/TemplatePlugin.tsx","kind":"import-statement","original":"./TemplatePlugin"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5027},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-B3O6VLCP.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/node-esm/intent-resolver-KY2OPU2S.mjs","kind":"dynamic-import"},{"path":"dist/lib/node-esm/react-surface-VJDBNR3U.mjs","kind":"dynamic-import"}],"exports":["TEMPLATE_PLUGIN","TemplatePlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/TemplatePlugin.tsx":{"bytesInOutput":1553},"src/capabilities/index.ts":{"bytesInOutput":190},"src/translations.ts":{"bytesInOutput":375}},"bytes":2509},"dist/lib/node-esm/types.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/types.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-B3O6VLCP.mjs","kind":"import-statement"}],"exports":["TemplateAction","TemplateType","isObject"],"entryPoint":"src/types.ts","inputs":{},"bytes":269},"dist/lib/node-esm/intent-resolver-KY2OPU2S.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1072},"dist/lib/node-esm/intent-resolver-KY2OPU2S.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-B3O6VLCP.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/intent-resolver.ts","inputs":{"src/capabilities/intent-resolver.ts":{"bytesInOutput":359}},"bytes":667},"dist/lib/node-esm/react-surface-VJDBNR3U.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2237},"dist/lib/node-esm/react-surface-VJDBNR3U.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-B3O6VLCP.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface.tsx","inputs":{"src/capabilities/react-surface.tsx":{"bytesInOutput":419},"src/components/TemplateContainer.tsx":{"bytesInOutput":572},"src/components/index.ts":{"bytesInOutput":0}},"bytes":1371},"dist/lib/node-esm/chunk-B3O6VLCP.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2539},"dist/lib/node-esm/chunk-B3O6VLCP.mjs":{"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["TEMPLATE_PLUGIN","TemplateAction","TemplateType","isObject","meta"],"inputs":{"src/types.ts":{"bytesInOutput":847},"src/meta.ts":{"bytesInOutput":226}},"bytes":1344}}}
@@ -0,0 +1,40 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ TEMPLATE_PLUGIN,
4
+ isObject
5
+ } from "./chunk-B3O6VLCP.mjs";
6
+
7
+ // src/capabilities/react-surface.tsx
8
+ import React2 from "react";
9
+ import { Capabilities, contributes, createSurface } from "@dxos/app-framework";
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: TEMPLATE_PLUGIN,
30
+ role: "article",
31
+ filter: (data) => isObject(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-VJDBNR3U.mjs.map
@@ -0,0 +1,7 @@
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
+ }
@@ -0,0 +1,12 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ TemplateAction,
4
+ TemplateType,
5
+ isObject
6
+ } from "./chunk-B3O6VLCP.mjs";
7
+ export {
8
+ TemplateAction,
9
+ TemplateType,
10
+ isObject
11
+ };
12
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,24 +1,17 @@
1
- declare const _default: {
2
- 'en-US': {
3
- [x: string]: {
4
- 'typename label': string;
5
- 'typename label_zero': string;
6
- 'typename label_one': string;
7
- 'typename label_other': string;
8
- 'object name placeholder': string;
9
- 'plugin name'?: undefined;
10
- } | {
11
- 'plugin name': string;
12
- 'typename label'?: undefined;
13
- 'typename label_zero'?: undefined;
14
- 'typename label_one'?: undefined;
15
- 'typename label_other'?: undefined;
16
- 'object name placeholder'?: undefined;
1
+ import { meta } from './meta';
2
+ import { TemplateType } from './types';
3
+ export declare const translations: [{
4
+ readonly 'en-US': {
5
+ readonly [TemplateType.typename]: {
6
+ readonly 'typename label': "Template";
7
+ readonly 'typename label_zero': "Templates";
8
+ readonly 'typename label_one': "Template";
9
+ readonly 'typename label_other': "Templates";
10
+ readonly 'object name placeholder': "New template";
17
11
  };
18
- "dxos.org/plugin/template": {
19
- 'plugin name': string;
12
+ readonly [meta.id]: {
13
+ readonly 'plugin name': "Template";
20
14
  };
21
15
  };
22
- }[];
23
- export default _default;
16
+ }];
24
17
  //# sourceMappingURL=translations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AASA,wBAeE"}
1
+ {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,eAAO,MAAM,YAAY;;QAGnB,SAAA,CAAC,YAAY,CAAC,QAAQ,CAAC;;;;;;UAMtB;QACD,SAAA,CAAC,IAAI,CAAC,EAAE,CAAC;;UAER;;EAGwB,CAAC"}