@dxos/plugin-crx 0.0.0
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.
- package/LICENSE +105 -0
- package/PLUGIN.mdl +599 -0
- package/README.md +25 -0
- package/dist/lib/CrxCapabilities.mjs +21 -0
- package/dist/lib/CrxCapabilities.mjs.map +1 -0
- package/dist/lib/CrxEvents.mjs +15 -0
- package/dist/lib/CrxEvents.mjs.map +1 -0
- package/dist/lib/CrxOperation.mjs +50 -0
- package/dist/lib/CrxOperation.mjs.map +1 -0
- package/dist/lib/CrxPlugin.mjs +16 -0
- package/dist/lib/CrxPlugin.mjs.map +1 -0
- package/dist/lib/PageAction.mjs +35 -0
- package/dist/lib/PageAction.mjs.map +1 -0
- package/dist/lib/Settings.mjs +84 -0
- package/dist/lib/Settings.mjs.map +1 -0
- package/dist/lib/capabilities.mjs +41 -0
- package/dist/lib/capabilities.mjs.map +1 -0
- package/dist/lib/capabilities.node.mjs +32 -0
- package/dist/lib/capabilities.node.mjs.map +1 -0
- package/dist/lib/capabilities.workerd.mjs +32 -0
- package/dist/lib/capabilities.workerd.mjs.map +1 -0
- package/dist/lib/chunk-add-note-from-snapshot.mjs +15 -0
- package/dist/lib/chunk-add-note-from-snapshot.mjs.map +1 -0
- package/dist/lib/chunk-add-organization-from-snapshot.mjs +15 -0
- package/dist/lib/chunk-add-organization-from-snapshot.mjs.map +1 -0
- package/dist/lib/chunk-add-person-from-snapshot.mjs +15 -0
- package/dist/lib/chunk-add-person-from-snapshot.mjs.map +1 -0
- package/dist/lib/chunk-install-page-actions.mjs +284 -0
- package/dist/lib/chunk-install-page-actions.mjs.map +1 -0
- package/dist/lib/chunk-mapping.mjs +81 -0
- package/dist/lib/chunk-mapping.mjs.map +1 -0
- package/dist/lib/chunk-operation-handler.mjs +12 -0
- package/dist/lib/chunk-operation-handler.mjs.map +1 -0
- package/dist/lib/chunk-page-action-provider.mjs +41 -0
- package/dist/lib/chunk-page-action-provider.mjs.map +1 -0
- package/dist/lib/chunk-react-surface.mjs +18 -0
- package/dist/lib/chunk-react-surface.mjs.map +1 -0
- package/dist/lib/chunk-rolldown-runtime.mjs +13 -0
- package/dist/lib/chunk-settings.mjs +28 -0
- package/dist/lib/chunk-settings.mjs.map +1 -0
- package/dist/lib/containers.mjs +80 -0
- package/dist/lib/containers.mjs.map +1 -0
- package/dist/lib/index.mjs +4 -0
- package/dist/lib/meta.mjs +34 -0
- package/dist/lib/meta.mjs.map +1 -0
- package/dist/lib/operations.mjs +13 -0
- package/dist/lib/operations.mjs.map +1 -0
- package/dist/lib/plugin.mjs +9 -0
- package/dist/lib/plugin.mjs.map +1 -0
- package/dist/lib/translations.mjs +22 -0
- package/dist/lib/translations.mjs.map +1 -0
- package/dist/lib/types.mjs +6 -0
- package/dist/lib/util.mjs +63 -0
- package/dist/lib/util.mjs.map +1 -0
- package/dist/types/dx.config.d.ts +28 -0
- package/dist/types/dx.config.d.ts.map +1 -0
- package/dist/types/src/CrxPlugin.d.ts +37 -0
- package/dist/types/src/CrxPlugin.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/node.d.ts +9 -0
- package/dist/types/src/capabilities/gen/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/workerd.d.ts +9 -0
- package/dist/types/src/capabilities/gen/workerd.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +9 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/install-page-actions.d.ts +5 -0
- package/dist/types/src/capabilities/install-page-actions.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +5 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/page-action-provider.d.ts +5 -0
- package/dist/types/src/capabilities/page-action-provider.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings.d.ts +10 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/containers/CrxSettings/CrxSettings.d.ts +10 -0
- package/dist/types/src/containers/CrxSettings/CrxSettings.d.ts.map +1 -0
- package/dist/types/src/containers/CrxSettings/CrxSettings.stories.d.ts +25 -0
- package/dist/types/src/containers/CrxSettings/CrxSettings.stories.d.ts.map +1 -0
- package/dist/types/src/containers/CrxSettings/index.d.ts +2 -0
- package/dist/types/src/containers/CrxSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +2 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +4 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/mapping.d.ts +24 -0
- package/dist/types/src/mapping.d.ts.map +1 -0
- package/dist/types/src/mapping.test.d.ts +2 -0
- package/dist/types/src/mapping.test.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +33 -0
- package/dist/types/src/meta.d.ts.map +1 -0
- package/dist/types/src/operations/add-note-from-snapshot.d.ts +5 -0
- package/dist/types/src/operations/add-note-from-snapshot.d.ts.map +1 -0
- package/dist/types/src/operations/add-organization-from-snapshot.d.ts +5 -0
- package/dist/types/src/operations/add-organization-from-snapshot.d.ts.map +1 -0
- package/dist/types/src/operations/add-person-from-snapshot.d.ts +5 -0
- package/dist/types/src/operations/add-person-from-snapshot.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/page-actions.d.ts +39 -0
- package/dist/types/src/page-actions.d.ts.map +1 -0
- package/dist/types/src/page-actions.test.d.ts +2 -0
- package/dist/types/src/page-actions.test.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/stories/Testbench.stories.d.ts +8 -0
- package/dist/types/src/stories/Testbench.stories.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +22 -0
- package/dist/types/src/translations.d.ts.map +1 -0
- package/dist/types/src/types/CrxCapabilities.d.ts +12 -0
- package/dist/types/src/types/CrxCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/CrxEvents.d.ts +8 -0
- package/dist/types/src/types/CrxEvents.d.ts.map +1 -0
- package/dist/types/src/types/CrxOperation.d.ts +108 -0
- package/dist/types/src/types/CrxOperation.d.ts.map +1 -0
- package/dist/types/src/types/PageAction.d.ts +153 -0
- package/dist/types/src/types/PageAction.d.ts.map +1 -0
- package/dist/types/src/types/Settings.d.ts +25 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/Settings.test.d.ts +2 -0
- package/dist/types/src/types/Settings.test.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +6 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/util/index.d.ts +2 -0
- package/dist/types/src/util/index.d.ts.map +1 -0
- package/dist/types/src/util/pingExtension.d.ts +15 -0
- package/dist/types/src/util/pingExtension.d.ts.map +1 -0
- package/dist/types/src/util/pingExtension.test.d.ts +2 -0
- package/dist/types/src/util/pingExtension.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/dx.config.ts +32 -0
- package/package.json +162 -0
- package/src/CrxPlugin.ts +15 -0
- package/src/capabilities/gen/node.ts +43 -0
- package/src/capabilities/gen/workerd.ts +43 -0
- package/src/capabilities/index.ts +47 -0
- package/src/capabilities/install-page-actions.ts +64 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/page-action-provider.ts +47 -0
- package/src/capabilities/react-surface.ts +26 -0
- package/src/capabilities/settings.ts +36 -0
- package/src/containers/CrxSettings/CrxSettings.stories.tsx +99 -0
- package/src/containers/CrxSettings/CrxSettings.tsx +100 -0
- package/src/containers/CrxSettings/index.ts +5 -0
- package/src/containers/index.ts +5 -0
- package/src/index.ts +7 -0
- package/src/mapping.test.ts +87 -0
- package/src/mapping.ts +101 -0
- package/src/meta.ts +9 -0
- package/src/operations/add-note-from-snapshot.ts +24 -0
- package/src/operations/add-organization-from-snapshot.ts +29 -0
- package/src/operations/add-person-from-snapshot.ts +29 -0
- package/src/operations/index.ts +16 -0
- package/src/page-actions.test.ts +164 -0
- package/src/page-actions.ts +171 -0
- package/src/plugin.tsx +29 -0
- package/src/stories/Testbench.stories.tsx +45 -0
- package/src/translations.ts +31 -0
- package/src/types/CrxCapabilities.ts +26 -0
- package/src/types/CrxEvents.ts +16 -0
- package/src/types/CrxOperation.ts +54 -0
- package/src/types/PageAction.ts +57 -0
- package/src/types/Settings.test.ts +30 -0
- package/src/types/Settings.ts +101 -0
- package/src/types/index.ts +9 -0
- package/src/util/index.ts +5 -0
- package/src/util/pingExtension.test.ts +69 -0
- package/src/util/pingExtension.ts +83 -0
- package/src/vite-env.d.ts +10 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as Plugin from "@dxos/app-framework/Plugin";
|
|
2
|
+
import { Config2 } from "@dxos/app-framework/config";
|
|
3
|
+
import { trim } from "@dxos/util";
|
|
4
|
+
//#region dx.config.ts
|
|
5
|
+
var dx_config_default = Config2.make({ plugin: {
|
|
6
|
+
key: "org.dxos.plugin.crx",
|
|
7
|
+
name: "Browser Extension",
|
|
8
|
+
author: "DXOS",
|
|
9
|
+
description: trim`
|
|
10
|
+
Capture content from any web page into your workspace with the Composer browser extension.
|
|
11
|
+
Highlight a section of a page and save it as a contact, an organization, or a bookmark —
|
|
12
|
+
the page's title, images, and details are picked up automatically, so a profile page
|
|
13
|
+
becomes a ready-made Person card and an article becomes a note with its source and text already filled in.
|
|
14
|
+
|
|
15
|
+
Saved items land in your active space alongside everything else you're working on,
|
|
16
|
+
complete with a link back to the original page.
|
|
17
|
+
|
|
18
|
+
Install the browser extension from the [Chrome Web Store](https://chromewebstore.google.com/detail/composer/ahkmmpagcinoehpnmdhoiohmmbikhnmj?pli=1).
|
|
19
|
+
`,
|
|
20
|
+
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-crx",
|
|
21
|
+
icon: {
|
|
22
|
+
key: "ph--puzzle-piece--regular",
|
|
23
|
+
hue: "orange"
|
|
24
|
+
},
|
|
25
|
+
spec: "PLUGIN.mdl",
|
|
26
|
+
tags: ["labs"]
|
|
27
|
+
} });
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/meta.ts
|
|
30
|
+
var meta = Plugin.getMetaFromConfig(dx_config_default);
|
|
31
|
+
//#endregion
|
|
32
|
+
export { meta };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=meta.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.mjs","names":[],"sources":["../../dx.config.ts","../../src/meta.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Config2 } from '@dxos/app-framework/config';\nimport { trim } from '@dxos/util';\n\nexport default Config2.make({\n plugin: {\n key: 'org.dxos.plugin.crx',\n name: 'Browser Extension',\n author: 'DXOS',\n description: trim`\n Capture content from any web page into your workspace with the Composer browser extension.\n Highlight a section of a page and save it as a contact, an organization, or a bookmark —\n the page's title, images, and details are picked up automatically, so a profile page\n becomes a ready-made Person card and an article becomes a note with its source and text already filled in.\n\n Saved items land in your active space alongside everything else you're working on,\n complete with a link back to the original page.\n\n Install the browser extension from the [Chrome Web Store](https://chromewebstore.google.com/detail/composer/ahkmmpagcinoehpnmdhoiohmmbikhnmj?pli=1).\n `,\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-crx',\n icon: { key: 'ph--puzzle-piece--regular', hue: 'orange' },\n // screenshots: [\n // { dark: 'https://raw.githubusercontent.com/dxos/dxos/refs/heads/main/packages/plugins/plugin-crx/assets/images/' },\n // ],\n spec: 'PLUGIN.mdl',\n tags: ['labs'],\n },\n});\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Plugin from '@dxos/app-framework/Plugin';\n\nimport config from '../dx.config.ts';\n\nexport const meta = Plugin.getMetaFromConfig(config);\n"],"mappings":";;;;AAOA,IAAA,oBAAe,QAAQ,KAAK,EAC1B,QAAQ;CACN,KAAK;CACL,MAAM;CACN,QAAQ;CACR,aAAa,IAAI;;;;;;;;;;;CAWjB,QAAQ;CACR,MAAM;EAAE,KAAK;EAA6B,KAAK;CAAS;CAIxD,MAAM;CACN,MAAM,CAAC,MAAM;AACf,EACF,CAAC;;;ACvBD,IAAa,OAAO,OAAO,kBAAkB,iBAAM"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CrxOperation } from "#types";
|
|
2
|
+
import * as Operation from "@dxos/compute/Operation";
|
|
3
|
+
import * as OperationHandlerSet from "@dxos/compute/OperationHandlerSet";
|
|
4
|
+
//#region src/operations/index.ts
|
|
5
|
+
var CrxOperationHandlerSet = OperationHandlerSet.lazy([
|
|
6
|
+
CrxOperation.AddPersonFromSnapshot.pipe(Operation.lazyHandler(() => import("./chunk-add-person-from-snapshot.mjs"))),
|
|
7
|
+
CrxOperation.AddOrganizationFromSnapshot.pipe(Operation.lazyHandler(() => import("./chunk-add-organization-from-snapshot.mjs"))),
|
|
8
|
+
CrxOperation.AddNoteFromSnapshot.pipe(Operation.lazyHandler(() => import("./chunk-add-note-from-snapshot.mjs")))
|
|
9
|
+
]);
|
|
10
|
+
//#endregion
|
|
11
|
+
export { CrxOperationHandlerSet };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=operations.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.mjs","names":[],"sources":["../../src/operations/index.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Operation from '@dxos/compute/Operation';\nimport * as OperationHandlerSet from '@dxos/compute/OperationHandlerSet';\n\nimport { CrxOperation } from '#types';\n\nexport const CrxOperationHandlerSet = OperationHandlerSet.lazy([\n CrxOperation.AddPersonFromSnapshot.pipe(Operation.lazyHandler(() => import('./add-person-from-snapshot.ts'))),\n CrxOperation.AddOrganizationFromSnapshot.pipe(\n Operation.lazyHandler(() => import('./add-organization-from-snapshot.ts')),\n ),\n CrxOperation.AddNoteFromSnapshot.pipe(Operation.lazyHandler(() => import('./add-note-from-snapshot.ts'))),\n]);\n"],"mappings":";;;;AASA,IAAa,yBAAyB,oBAAoB,KAAK;CAC7D,aAAa,sBAAsB,KAAK,UAAU,kBAAkB,OAAO,uCAAgC,CAAC;CAC5G,aAAa,4BAA4B,KACvC,UAAU,kBAAkB,OAAO,6CAAsC,CAC3E;CACA,aAAa,oBAAoB,KAAK,UAAU,kBAAkB,OAAO,qCAA8B,CAAC;AAC1G,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { meta } from "#meta";
|
|
2
|
+
import * as Plugin from "@dxos/app-framework/Plugin";
|
|
3
|
+
import { CrxSettings, InstallPageActions, OperationHandler, PageActionProvider, PluginAsset, ReactSurface, Translations } from "#capabilities";
|
|
4
|
+
//#region src/plugin.tsx
|
|
5
|
+
var CrxPlugin = Plugin.define(meta).pipe(Plugin.addModule(CrxSettings), Plugin.addModule(InstallPageActions), Plugin.addModule(OperationHandler), Plugin.addModule(PageActionProvider), Plugin.addModule(PluginAsset), Plugin.addModule(ReactSurface), Plugin.addModule(Translations), Plugin.make);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { CrxPlugin, CrxPlugin as default };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=plugin.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.mjs","names":[],"sources":["../../src/plugin.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Plugin from '@dxos/app-framework/Plugin';\n\nimport {\n CrxSettings,\n InstallPageActions,\n OperationHandler,\n PageActionProvider,\n PluginAsset,\n ReactSurface,\n Translations,\n} from '#capabilities';\nimport { meta } from '#meta';\n\nexport const CrxPlugin = Plugin.define(meta).pipe(\n Plugin.addModule(CrxSettings),\n Plugin.addModule(InstallPageActions),\n Plugin.addModule(OperationHandler),\n Plugin.addModule(PageActionProvider),\n Plugin.addModule(PluginAsset),\n Plugin.addModule(ReactSurface),\n Plugin.addModule(Translations),\n Plugin.make,\n);\n\nexport default CrxPlugin;\n"],"mappings":";;;;AAiBA,IAAa,YAAY,OAAO,OAAO,IAAI,CAAC,CAAC,KAC3C,OAAO,UAAU,WAAW,GAC5B,OAAO,UAAU,kBAAkB,GACnC,OAAO,UAAU,gBAAgB,GACjC,OAAO,UAAU,kBAAkB,GACnC,OAAO,UAAU,WAAW,GAC5B,OAAO,UAAU,YAAY,GAC7B,OAAO,UAAU,YAAY,GAC7B,OAAO,IACT"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { meta } from "#meta";
|
|
2
|
+
//#region src/translations.ts
|
|
3
|
+
var translations = [{ "en-US": { [meta.profile.key]: {
|
|
4
|
+
"plugin.name": "Browser Extension",
|
|
5
|
+
"settings.description": "Install the browser extension from the [Chrome Web Store](https://chromewebstore.google.com/detail/composer/ahkmmpagcinoehpnmdhoiohmmbikhnmj?pli=1).",
|
|
6
|
+
"test.title": "Connection",
|
|
7
|
+
"test.button.label": "Test connection",
|
|
8
|
+
"test.pending.message": "Contacting extension…",
|
|
9
|
+
"test.connected.message": "Connected to {{name}} v{{version}}.",
|
|
10
|
+
"toast.error.invalidPayload.message": "Unrecognized payload.",
|
|
11
|
+
"toast.error.unsupportedVersion.message": "Unsupported version — update Composer.",
|
|
12
|
+
"toast.error.disabled.message": "Extension actions are disabled in settings.",
|
|
13
|
+
"toast.error.noSpace.message": "Open a space first.",
|
|
14
|
+
"toast.page-action.success.title": "Action complete",
|
|
15
|
+
"toast.page-action.error.title": "Action failed",
|
|
16
|
+
"toast.error.unknownAction.message": "Unknown action — update Composer or the extension.",
|
|
17
|
+
"toast.error.operationFailed.message": "The action failed to run."
|
|
18
|
+
} } }];
|
|
19
|
+
//#endregion
|
|
20
|
+
export { translations };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=translations.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translations.mjs","names":[],"sources":["../../src/translations.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from '#meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.profile.key]: {\n 'plugin.name': 'Browser Extension',\n 'settings.description':\n 'Install the browser extension from the [Chrome Web Store](https://chromewebstore.google.com/detail/composer/ahkmmpagcinoehpnmdhoiohmmbikhnmj?pli=1).',\n 'test.title': 'Connection',\n 'test.button.label': 'Test connection',\n 'test.pending.message': 'Contacting extension…',\n 'test.connected.message': 'Connected to {{name}} v{{version}}.',\n 'toast.error.invalidPayload.message': 'Unrecognized payload.',\n 'toast.error.unsupportedVersion.message': 'Unsupported version — update Composer.',\n 'toast.error.disabled.message': 'Extension actions are disabled in settings.',\n 'toast.error.noSpace.message': 'Open a space first.',\n 'toast.page-action.success.title': 'Action complete',\n 'toast.page-action.error.title': 'Action failed',\n 'toast.error.unknownAction.message': 'Unknown action — update Composer or the extension.',\n 'toast.error.operationFailed.message': 'The action failed to run.',\n },\n },\n },\n] as const satisfies Resource[];\n"],"mappings":";;AAQA,IAAa,eAAe,CAC1B,EACE,SAAS,GACN,KAAK,QAAQ,MAAM;CAClB,eAAe;CACf,wBACE;CACF,cAAc;CACd,qBAAqB;CACrB,wBAAwB;CACxB,0BAA0B;CAC1B,sCAAsC;CACtC,0CAA0C;CAC1C,gCAAgC;CAChC,+BAA+B;CAC/B,mCAAmC;CACnC,iCAAiC;CACjC,qCAAqC;CACrC,uCAAuC;AACzC,EACF,EACF,CACF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { t as CrxCapabilities_exports } from "./CrxCapabilities.mjs";
|
|
2
|
+
import { t as CrxEvents_exports } from "./CrxEvents.mjs";
|
|
3
|
+
import { t as PageAction_exports } from "./PageAction.mjs";
|
|
4
|
+
import { t as CrxOperation_exports } from "./CrxOperation.mjs";
|
|
5
|
+
import { t as Settings_exports } from "./Settings.mjs";
|
|
6
|
+
export { CrxCapabilities_exports as CrxCapabilities, CrxEvents_exports as CrxEvents, CrxOperation_exports as CrxOperation, PageAction_exports as PageAction, Settings_exports as Settings };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Proxy } from "@dxos/crx-protocol";
|
|
2
|
+
//#region src/util/pingExtension.ts
|
|
3
|
+
/**
|
|
4
|
+
* Page side of the composer-crx extension's ping contract — a health-check round-trip that proves
|
|
5
|
+
* the page → content-script → background messaging path and reports the extension's identity.
|
|
6
|
+
*
|
|
7
|
+
* The event names and wire shapes are the shared `@dxos/crx-protocol` `Proxy` protocol (the single
|
|
8
|
+
* source of truth, consumed by both the plugin and the extension).
|
|
9
|
+
*/
|
|
10
|
+
var DEFAULT_PING_TIMEOUT_MS = 4e3;
|
|
11
|
+
var isRecord = (value) => typeof value === "object" && value !== null;
|
|
12
|
+
var counter = 0;
|
|
13
|
+
var nextId = () => globalThis.crypto?.randomUUID?.() ?? `ping-${counter += 1}`;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the composer-crx extension's relay is installed on this page (set via a `documentElement`
|
|
16
|
+
* dataset marker once the relay is listening).
|
|
17
|
+
*/
|
|
18
|
+
var isExtensionAvailable = () => typeof document !== "undefined" && document.documentElement?.dataset[Proxy.RENDER_READY_DATASET_KEY] === "1";
|
|
19
|
+
/**
|
|
20
|
+
* Ping the composer-crx extension and resolve with its identity. Rejects if the extension is not
|
|
21
|
+
* detected, rejects the request, or does not ack within the timeout.
|
|
22
|
+
*/
|
|
23
|
+
var pingExtension = (timeoutMs = DEFAULT_PING_TIMEOUT_MS) => new Promise((resolve, reject) => {
|
|
24
|
+
if (typeof window === "undefined" || !isExtensionAvailable()) {
|
|
25
|
+
reject(/* @__PURE__ */ new Error("Extension not detected"));
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const id = nextId();
|
|
29
|
+
let settled = false;
|
|
30
|
+
const cleanup = () => {
|
|
31
|
+
window.removeEventListener(Proxy.PING_ACK_EVENT, onAck);
|
|
32
|
+
clearTimeout(timer);
|
|
33
|
+
};
|
|
34
|
+
const onAck = (event) => {
|
|
35
|
+
const detail = "detail" in event ? event.detail : void 0;
|
|
36
|
+
if (!isRecord(detail) || detail.id !== id || settled) return;
|
|
37
|
+
settled = true;
|
|
38
|
+
cleanup();
|
|
39
|
+
if (detail.ok === true && typeof detail.extensionVersion === "string" && typeof detail.extensionName === "string") resolve({
|
|
40
|
+
extensionVersion: detail.extensionVersion,
|
|
41
|
+
extensionName: detail.extensionName
|
|
42
|
+
});
|
|
43
|
+
else {
|
|
44
|
+
const error = typeof detail.error === "string" ? detail.error : "unknown";
|
|
45
|
+
reject(/* @__PURE__ */ new Error(`Extension ping failed: ${error}`));
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const timer = setTimeout(() => {
|
|
49
|
+
if (settled) return;
|
|
50
|
+
settled = true;
|
|
51
|
+
cleanup();
|
|
52
|
+
reject(/* @__PURE__ */ new Error(`Extension did not respond within ${timeoutMs}ms`));
|
|
53
|
+
}, timeoutMs);
|
|
54
|
+
window.addEventListener(Proxy.PING_ACK_EVENT, onAck);
|
|
55
|
+
window.dispatchEvent(new CustomEvent(Proxy.PING_EVENT, { detail: {
|
|
56
|
+
version: 1,
|
|
57
|
+
id
|
|
58
|
+
} }));
|
|
59
|
+
});
|
|
60
|
+
//#endregion
|
|
61
|
+
export { isExtensionAvailable, pingExtension };
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=util.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.mjs","names":[],"sources":["../../src/util/pingExtension.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Proxy } from '@dxos/crx-protocol';\n\n/**\n * Page side of the composer-crx extension's ping contract — a health-check round-trip that proves\n * the page → content-script → background messaging path and reports the extension's identity.\n *\n * The event names and wire shapes are the shared `@dxos/crx-protocol` `Proxy` protocol (the single\n * source of truth, consumed by both the plugin and the extension).\n */\n\nconst DEFAULT_PING_TIMEOUT_MS = 4_000;\n\nexport type ExtensionInfo = {\n extensionVersion: string;\n extensionName: string;\n};\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => typeof value === 'object' && value !== null;\n\nlet counter = 0;\nconst nextId = (): string => globalThis.crypto?.randomUUID?.() ?? `ping-${(counter += 1)}`;\n\n/**\n * Whether the composer-crx extension's relay is installed on this page (set via a `documentElement`\n * dataset marker once the relay is listening).\n */\nexport const isExtensionAvailable = (): boolean =>\n typeof document !== 'undefined' && document.documentElement?.dataset[Proxy.RENDER_READY_DATASET_KEY] === '1';\n\n/**\n * Ping the composer-crx extension and resolve with its identity. Rejects if the extension is not\n * detected, rejects the request, or does not ack within the timeout.\n */\nexport const pingExtension = (timeoutMs: number = DEFAULT_PING_TIMEOUT_MS): Promise<ExtensionInfo> =>\n new Promise<ExtensionInfo>((resolve, reject) => {\n if (typeof window === 'undefined' || !isExtensionAvailable()) {\n reject(new Error('Extension not detected'));\n return;\n }\n\n const id = nextId();\n let settled = false;\n\n const cleanup = () => {\n window.removeEventListener(Proxy.PING_ACK_EVENT, onAck);\n clearTimeout(timer);\n };\n\n const onAck = (event: Event) => {\n const detail = 'detail' in event ? event.detail : undefined;\n if (!isRecord(detail) || detail.id !== id || settled) {\n return;\n }\n settled = true;\n cleanup();\n if (\n detail.ok === true &&\n typeof detail.extensionVersion === 'string' &&\n typeof detail.extensionName === 'string'\n ) {\n resolve({ extensionVersion: detail.extensionVersion, extensionName: detail.extensionName });\n } else {\n const error = typeof detail.error === 'string' ? detail.error : 'unknown';\n reject(new Error(`Extension ping failed: ${error}`));\n }\n };\n\n const timer = setTimeout(() => {\n if (settled) {\n return;\n }\n settled = true;\n cleanup();\n reject(new Error(`Extension did not respond within ${timeoutMs}ms`));\n }, timeoutMs);\n\n window.addEventListener(Proxy.PING_ACK_EVENT, onAck);\n window.dispatchEvent(new CustomEvent(Proxy.PING_EVENT, { detail: { version: 1, id } }));\n });\n"],"mappings":";;;;;;;;;AAcA,IAAM,0BAA0B;AAOhC,IAAM,YAAY,UAAqD,OAAO,UAAU,YAAY,UAAU;AAE9G,IAAI,UAAU;AACd,IAAM,eAAuB,WAAW,QAAQ,aAAa,KAAK,QAAS,WAAW;;;;;AAMtF,IAAa,6BACX,OAAO,aAAa,eAAe,SAAS,iBAAiB,QAAQ,MAAM,8BAA8B;;;;;AAM3G,IAAa,iBAAiB,YAAoB,4BAChD,IAAI,SAAwB,SAAS,WAAW;CAC9C,IAAI,OAAO,WAAW,eAAe,CAAC,qBAAqB,GAAG;EAC5D,uBAAO,IAAI,MAAM,wBAAwB,CAAC;EAC1C;CACF;CAEA,MAAM,KAAK,OAAO;CAClB,IAAI,UAAU;CAEd,MAAM,gBAAgB;EACpB,OAAO,oBAAoB,MAAM,gBAAgB,KAAK;EACtD,aAAa,KAAK;CACpB;CAEA,MAAM,SAAS,UAAiB;EAC9B,MAAM,SAAS,YAAY,QAAQ,MAAM,SAAS,KAAA;EAClD,IAAI,CAAC,SAAS,MAAM,KAAK,OAAO,OAAO,MAAM,SAC3C;EAEF,UAAU;EACV,QAAQ;EACR,IACE,OAAO,OAAO,QACd,OAAO,OAAO,qBAAqB,YACnC,OAAO,OAAO,kBAAkB,UAEhC,QAAQ;GAAE,kBAAkB,OAAO;GAAkB,eAAe,OAAO;EAAc,CAAC;OACrF;GACL,MAAM,QAAQ,OAAO,OAAO,UAAU,WAAW,OAAO,QAAQ;GAChE,uBAAO,IAAI,MAAM,0BAA0B,OAAO,CAAC;EACrD;CACF;CAEA,MAAM,QAAQ,iBAAiB;EAC7B,IAAI,SACF;EAEF,UAAU;EACV,QAAQ;EACR,uBAAO,IAAI,MAAM,oCAAoC,UAAU,GAAG,CAAC;CACrE,GAAG,SAAS;CAEZ,OAAO,iBAAiB,MAAM,gBAAgB,KAAK;CACnD,OAAO,cAAc,IAAI,YAAY,MAAM,YAAY,EAAE,QAAQ;EAAE,SAAS;EAAG;CAAG,EAAE,CAAC,CAAC;AACxF,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
readonly plugin: {
|
|
3
|
+
readonly key: string;
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly description?: string | undefined;
|
|
6
|
+
readonly author?: string | undefined;
|
|
7
|
+
readonly homePage?: string | undefined;
|
|
8
|
+
readonly source?: string | undefined;
|
|
9
|
+
readonly screenshots?: readonly {
|
|
10
|
+
readonly light?: string | undefined;
|
|
11
|
+
readonly dark?: string | undefined;
|
|
12
|
+
}[] | undefined;
|
|
13
|
+
readonly tags?: readonly string[] | undefined;
|
|
14
|
+
readonly icon?: {
|
|
15
|
+
readonly key: string;
|
|
16
|
+
readonly hue?: string | undefined;
|
|
17
|
+
} | undefined;
|
|
18
|
+
readonly spec?: string | undefined;
|
|
19
|
+
readonly dependsOn?: readonly string[] | undefined;
|
|
20
|
+
};
|
|
21
|
+
readonly publish?: {
|
|
22
|
+
readonly buildCommand?: string | undefined;
|
|
23
|
+
readonly outputDirectory?: string | undefined;
|
|
24
|
+
readonly assetBaseUrl?: string | undefined;
|
|
25
|
+
} | undefined;
|
|
26
|
+
};
|
|
27
|
+
export default _default;
|
|
28
|
+
//# sourceMappingURL=dx.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dx.config.d.ts","sourceRoot":"","sources":["../../dx.config.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as Plugin from '@dxos/app-framework/Plugin';
|
|
2
|
+
/** Plugin metadata, available without loading the plugin body. */
|
|
3
|
+
export declare const meta: {
|
|
4
|
+
readonly profile: {
|
|
5
|
+
readonly key: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly description?: string | undefined;
|
|
8
|
+
readonly homePage?: string | undefined;
|
|
9
|
+
readonly source?: string | undefined;
|
|
10
|
+
readonly tags?: readonly string[] | undefined;
|
|
11
|
+
readonly screenshots?: readonly {
|
|
12
|
+
readonly light?: string | undefined;
|
|
13
|
+
readonly dark?: string | undefined;
|
|
14
|
+
}[] | undefined;
|
|
15
|
+
readonly icon?: {
|
|
16
|
+
readonly key: string;
|
|
17
|
+
readonly hue?: string | undefined;
|
|
18
|
+
} | undefined;
|
|
19
|
+
readonly dependsOn?: readonly string[] | undefined;
|
|
20
|
+
readonly spec?: string | undefined;
|
|
21
|
+
readonly createdAt?: string | undefined;
|
|
22
|
+
readonly author?: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
readonly release?: {
|
|
25
|
+
readonly version: string;
|
|
26
|
+
readonly moduleUrl: string;
|
|
27
|
+
readonly dependencies?: {
|
|
28
|
+
readonly [x: string]: string;
|
|
29
|
+
} | undefined;
|
|
30
|
+
readonly pluginKey?: string | undefined;
|
|
31
|
+
readonly manifestHash?: string | undefined;
|
|
32
|
+
readonly createdAt?: string | undefined;
|
|
33
|
+
} | undefined;
|
|
34
|
+
};
|
|
35
|
+
/** Constructs the plugin; the body loads on first enable. */
|
|
36
|
+
export declare const make: Plugin.PluginFactory<void>;
|
|
37
|
+
//# sourceMappingURL=CrxPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CrxPlugin.d.ts","sourceRoot":"","sources":["../../../src/CrxPlugin.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AAIrD,kEAAkE;AAClE,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAa,CAAC;AAE/B,6DAA6D;AAC7D,eAAO,MAAM,IAAI,4BAA6C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as Capability from '@dxos/app-framework/Capability';
|
|
2
|
+
export declare const CrxSettings: Capability.Module<void>;
|
|
3
|
+
export declare const InstallPageActions: Capability.Module<void>;
|
|
4
|
+
export declare const OperationHandler: Capability.Module<void>;
|
|
5
|
+
export declare const PageActionProvider: Capability.Module<void>;
|
|
6
|
+
export declare const Translations: Capability.Module<void>;
|
|
7
|
+
export declare const PluginAsset: undefined;
|
|
8
|
+
export declare const ReactSurface: undefined;
|
|
9
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/gen/node.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,UAAU,MAAM,gCAAgC,CAAC;AAM7D,eAAO,MAAM,WAAW,yBAGtB,CAAC;AAEH,eAAO,MAAM,kBAAkB,yBAQ9B,CAAC;AAEF,eAAO,MAAM,gBAAgB,yBAE3B,CAAC;AAEH,eAAO,MAAM,kBAAkB,yBAI9B,CAAC;AAEF,eAAO,MAAM,YAAY,yBAA2C,CAAC;AAErE,eAAO,MAAM,WAAW,WAAY,CAAC;AACrC,eAAO,MAAM,YAAY,WAAY,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as Capability from '@dxos/app-framework/Capability';
|
|
2
|
+
export declare const CrxSettings: Capability.Module<void>;
|
|
3
|
+
export declare const InstallPageActions: Capability.Module<void>;
|
|
4
|
+
export declare const OperationHandler: Capability.Module<void>;
|
|
5
|
+
export declare const PageActionProvider: Capability.Module<void>;
|
|
6
|
+
export declare const Translations: Capability.Module<void>;
|
|
7
|
+
export declare const PluginAsset: undefined;
|
|
8
|
+
export declare const ReactSurface: undefined;
|
|
9
|
+
//# sourceMappingURL=workerd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workerd.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/gen/workerd.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,UAAU,MAAM,gCAAgC,CAAC;AAM7D,eAAO,MAAM,WAAW,yBAGtB,CAAC;AAEH,eAAO,MAAM,kBAAkB,yBAQ9B,CAAC;AAEF,eAAO,MAAM,gBAAgB,yBAE3B,CAAC;AAEH,eAAO,MAAM,kBAAkB,yBAI9B,CAAC;AAEF,eAAO,MAAM,YAAY,yBAA2C,CAAC;AAErE,eAAO,MAAM,WAAW,WAAY,CAAC;AACrC,eAAO,MAAM,YAAY,WAAY,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as Capability from '@dxos/app-framework/Capability';
|
|
2
|
+
export declare const CrxSettings: Capability.Module<void>;
|
|
3
|
+
export declare const InstallPageActions: Capability.Module<void>;
|
|
4
|
+
export declare const OperationHandler: Capability.Module<void>;
|
|
5
|
+
export declare const PageActionProvider: Capability.Module<void>;
|
|
6
|
+
export declare const PluginAsset: Capability.Module<void>;
|
|
7
|
+
export declare const ReactSurface: Capability.Module<void>;
|
|
8
|
+
export declare const Translations: Capability.Module<void>;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,UAAU,MAAM,gCAAgC,CAAC;AAU7D,eAAO,MAAM,WAAW,yBAGtB,CAAC;AACH,eAAO,MAAM,kBAAkB,yBAQ9B,CAAC;AACF,eAAO,MAAM,gBAAgB,yBAE3B,CAAC;AACH,eAAO,MAAM,kBAAkB,yBAI9B,CAAC;AACF,eAAO,MAAM,WAAW,yBAKtB,CAAC;AACH,eAAO,MAAM,YAAY,yBAEvB,CAAC;AACH,eAAO,MAAM,YAAY,yBAA2C,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import * as Capability from '@dxos/app-framework/Capability';
|
|
3
|
+
declare const _default: (props: void) => Effect.Effect<never[], never, Capability.CapabilityIdentifier<"org.dxos.app-framework.capability.atomRegistry", "single"> | Capability.CapabilityIdentifier<"org.dxos.app-framework.capability.operationInvoker", "single"> | Capability.CapabilityIdentifier<`${string}.capability.settings`, "single"> | import("effect/Scope").Scope | Capability.Service>;
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=install-page-actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-page-actions.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/install-page-actions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,KAAK,UAAU,MAAM,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import * as Capability from '@dxos/app-framework/Capability';
|
|
3
|
+
declare const _default: (props: void) => Effect.Effect<Capability.Contribution<Capability.CapabilityIdentifier<"org.dxos.app-framework.capability.operationHandler", "multi">>, never, import("effect/Scope").Scope>;
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=operation-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-handler.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/operation-handler.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,KAAK,UAAU,MAAM,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import * as Capability from '@dxos/app-framework/Capability';
|
|
3
|
+
declare const _default: (props: void) => Effect.Effect<Capability.Contribution<Capability.CapabilityIdentifier<`${string}.capability.pageAction`, "multi">>, never, import("effect/Scope").Scope>;
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=page-action-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-action-provider.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/page-action-provider.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,UAAU,MAAM,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import * as Capability from '@dxos/app-framework/Capability';
|
|
3
|
+
declare const _default: (props: void) => Effect.Effect<Capability.Contribution<Capability.CapabilityIdentifier<"org.dxos.app-framework.capability.reactSurface", "multi">>, never, import("effect/Scope").Scope>;
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=react-surface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-surface.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,KAAK,UAAU,MAAM,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import * as Capability from '@dxos/app-framework/Capability';
|
|
3
|
+
/**
|
|
4
|
+
* Contributes the Settings atom both under the plugin-scoped capability (so
|
|
5
|
+
* other plugins can read it) and under `AppCapabilities.Settings` (so the
|
|
6
|
+
* standard settings panel surfaces it).
|
|
7
|
+
*/
|
|
8
|
+
declare const _default: (props: void) => Effect.Effect<(Capability.Contribution<Capability.CapabilityIdentifier<"org.dxos.app-framework.capability.settings", "multi">> | Capability.Contribution<Capability.CapabilityIdentifier<`${string}.capability.settings`, "single">>)[], never, import("effect/Scope").Scope>;
|
|
9
|
+
export default _default;
|
|
10
|
+
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/settings.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,UAAU,MAAM,gCAAgC,CAAC;AAO7D;;;;GAIG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
3
|
+
export type CrxSettingsProps = AppSurface.SettingsData<{
|
|
4
|
+
readonly?: boolean;
|
|
5
|
+
}>;
|
|
6
|
+
export declare function CrxSettings({ subject, readonly }: CrxSettingsProps): React.JSX.Element;
|
|
7
|
+
export declare namespace CrxSettings {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=CrxSettings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CrxSettings.d.ts","sourceRoot":"","sources":["../../../../../src/containers/CrxSettings/CrxSettings.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAGrD,OAAO,EAAE,KAAK,UAAU,EAAiB,MAAM,sBAAsB,CAAC;AAetE,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,YAAY,CAAC;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;oCAMnD,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,gBAAgB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Settings } from '#types';
|
|
4
|
+
declare const DefaultStory: ({ initial, readonly }: {
|
|
5
|
+
initial?: Settings.Settings;
|
|
6
|
+
readonly?: boolean;
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
|
+
declare const meta: Meta<typeof DefaultStory>;
|
|
9
|
+
export default meta;
|
|
10
|
+
type Story = StoryObj<typeof meta>;
|
|
11
|
+
export declare const Default: Story;
|
|
12
|
+
export declare const Readonly: Story;
|
|
13
|
+
/**
|
|
14
|
+
* No fake relay — the connection test talks to the real composer-crx extension. For development:
|
|
15
|
+
* load the dev extension (`moon run composer-crx:build`, load unpacked from `out/composer-crx`),
|
|
16
|
+
* then add this storybook's origin (e.g. `http://localhost:9009/*`) to the extension's Composer
|
|
17
|
+
* URLs in its options page so the content relay installs here.
|
|
18
|
+
*
|
|
19
|
+
* NOTE: The extension's content script runs only in the top frame,
|
|
20
|
+
* so the story must be opened OUTSIDE the storybook manager's preview iframe:
|
|
21
|
+
* `http://localhost:9009/iframe.html?id=plugins-plugin-crx-crxsettings--live`.
|
|
22
|
+
* Without that setup the test reports "Extension not detected".
|
|
23
|
+
*/
|
|
24
|
+
export declare const Live: Story;
|
|
25
|
+
//# sourceMappingURL=CrxSettings.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CrxSettings.stories.d.ts","sourceRoot":"","sources":["../../../../../src/containers/CrxSettings/CrxSettings.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAkB,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjF,OAAO,KAA6B,MAAM,OAAO,CAAC;AAQlD,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAoClC,QAAA,MAAM,YAAY,0BAA2B;IAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,sBAW/F,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CAOnC,CAAC;eAEa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAKtB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,IAAI,EAAE,KAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/containers/CrxSettings/index.ts"],"names":[],"mappings":"AAIA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/containers/index.ts"],"names":[],"mappings":"AAIA,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as Markdown from '@dxos/plugin-markdown/Markdown';
|
|
2
|
+
import { Organization, Person } from '@dxos/types';
|
|
3
|
+
import { PageAction } from '#types';
|
|
4
|
+
/**
|
|
5
|
+
* Best-effort mapping from an incoming page snapshot to a Person.
|
|
6
|
+
* Every field is optional on the schema, so an empty name is acceptable.
|
|
7
|
+
*/
|
|
8
|
+
export declare const toPerson: (snapshot: PageAction.Snapshot) => import("@dxos/echo/Obj").OfShape<Person.Person & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object>>;
|
|
9
|
+
/**
|
|
10
|
+
* Best-effort mapping from an incoming page snapshot to an Organization.
|
|
11
|
+
*/
|
|
12
|
+
export declare const toOrganization: (snapshot: PageAction.Snapshot) => import("@dxos/echo/Obj").OfShape<Organization.Organization & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object>>;
|
|
13
|
+
/**
|
|
14
|
+
* Best-effort mapping from an incoming page snapshot to a Markdown document.
|
|
15
|
+
*
|
|
16
|
+
* Builds a small prelude (title + source link + date) followed by the
|
|
17
|
+
* picked subtree's rendered text. We deliberately don't attempt HTML →
|
|
18
|
+
* Markdown conversion here — the picker's `innerText` already preserves
|
|
19
|
+
* paragraph structure, and a full converter belongs in the pipeline
|
|
20
|
+
* (where a future agent stage can take over) rather than baked into the
|
|
21
|
+
* receiver.
|
|
22
|
+
*/
|
|
23
|
+
export declare const toNote: (snapshot: PageAction.Snapshot) => import("@dxos/echo/Obj").OfShape<Markdown.Document & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object>>;
|
|
24
|
+
//# sourceMappingURL=mapping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../../../src/mapping.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,QAAQ,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AA6BpC;;;GAGG;AACH,eAAO,MAAM,QAAQ,aAAc,UAAU,CAAC,QAAQ,0IAcrD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,aAAc,UAAU,CAAC,QAAQ,sJAS3D,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM,aAAc,UAAU,CAAC,QAAQ,8IAoBnD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapping.test.d.ts","sourceRoot":"","sources":["../../../src/mapping.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const meta: {
|
|
2
|
+
readonly profile: {
|
|
3
|
+
readonly key: string;
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly description?: string | undefined;
|
|
6
|
+
readonly homePage?: string | undefined;
|
|
7
|
+
readonly source?: string | undefined;
|
|
8
|
+
readonly tags?: readonly string[] | undefined;
|
|
9
|
+
readonly screenshots?: readonly {
|
|
10
|
+
readonly light?: string | undefined;
|
|
11
|
+
readonly dark?: string | undefined;
|
|
12
|
+
}[] | undefined;
|
|
13
|
+
readonly icon?: {
|
|
14
|
+
readonly key: string;
|
|
15
|
+
readonly hue?: string | undefined;
|
|
16
|
+
} | undefined;
|
|
17
|
+
readonly dependsOn?: readonly string[] | undefined;
|
|
18
|
+
readonly spec?: string | undefined;
|
|
19
|
+
readonly createdAt?: string | undefined;
|
|
20
|
+
readonly author?: string | undefined;
|
|
21
|
+
};
|
|
22
|
+
readonly release?: {
|
|
23
|
+
readonly version: string;
|
|
24
|
+
readonly moduleUrl: string;
|
|
25
|
+
readonly dependencies?: {
|
|
26
|
+
readonly [x: string]: string;
|
|
27
|
+
} | undefined;
|
|
28
|
+
readonly pluginKey?: string | undefined;
|
|
29
|
+
readonly manifestHash?: string | undefined;
|
|
30
|
+
readonly createdAt?: string | undefined;
|
|
31
|
+
} | undefined;
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAmC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-note-from-snapshot.d.ts","sourceRoot":"","sources":["../../../../src/operations/add-note-from-snapshot.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,SAAS,MAAM,yBAAyB,CAAC;AAGrD,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAItC,QAAA,MAAM,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,OAAO,YAAY,CAAC,mBAAmB,CAQ3E,CAAC;eAEa,OAAO"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as Operation from '@dxos/compute/Operation';
|
|
2
|
+
import { CrxOperation } from '#types';
|
|
3
|
+
declare const handler: Operation.WithHandler<typeof CrxOperation.AddOrganizationFromSnapshot>;
|
|
4
|
+
export default handler;
|
|
5
|
+
//# sourceMappingURL=add-organization-from-snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-organization-from-snapshot.d.ts","sourceRoot":"","sources":["../../../../src/operations/add-organization-from-snapshot.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,SAAS,MAAM,yBAAyB,CAAC;AAGrD,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAItC,QAAA,MAAM,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,OAAO,YAAY,CAAC,2BAA2B,CAajF,CAAC;eAEW,OAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-person-from-snapshot.d.ts","sourceRoot":"","sources":["../../../../src/operations/add-person-from-snapshot.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,SAAS,MAAM,yBAAyB,CAAC;AAGrD,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAItC,QAAA,MAAM,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,OAAO,YAAY,CAAC,qBAAqB,CAa3E,CAAC;eAEW,OAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/operations/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,mBAAmB,MAAM,mCAAmC,CAAC;AAIzE,eAAO,MAAM,sBAAsB,yCAMjC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as Capabilities from '@dxos/app-framework/Capabilities';
|
|
2
|
+
import type * as CapabilityManager from '@dxos/app-framework/CapabilityManager';
|
|
3
|
+
import { type Database } from '@dxos/echo';
|
|
4
|
+
import { type SpaceId } from '@dxos/keys';
|
|
5
|
+
import { PageAction, Settings } from '#types';
|
|
6
|
+
/**
|
|
7
|
+
* Dependencies for the invoke handler, injected so the handler can be
|
|
8
|
+
* unit-tested without a capability manager (the capability module wires the
|
|
9
|
+
* real implementations).
|
|
10
|
+
*/
|
|
11
|
+
export type InvokeDeps = {
|
|
12
|
+
getActions: () => PageAction.PageAction[];
|
|
13
|
+
getSettings: () => Settings.Settings;
|
|
14
|
+
getTarget: () => Database.Database | undefined;
|
|
15
|
+
invoke: (operation: PageAction.PageAction['operation'], input: unknown) => Promise<{
|
|
16
|
+
data?: {
|
|
17
|
+
id?: string;
|
|
18
|
+
};
|
|
19
|
+
error?: unknown;
|
|
20
|
+
}>;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Answer a registry-list request with the currently contributed actions as
|
|
24
|
+
* serializable descriptors.
|
|
25
|
+
*/
|
|
26
|
+
export declare const handleListEvent: (detail: unknown, getActions: () => PageAction.PageAction[]) => PageAction.ListAck;
|
|
27
|
+
/**
|
|
28
|
+
* Handle a single invoke request. Two-pass decode (loose envelope, then
|
|
29
|
+
* strict payload) so newer versions yield `unsupportedVersion` rather than
|
|
30
|
+
* the generic `invalidPayload`.
|
|
31
|
+
*/
|
|
32
|
+
export declare const handleInvokeEvent: (detail: unknown, deps: InvokeDeps) => Promise<PageAction.InvokeAck>;
|
|
33
|
+
/**
|
|
34
|
+
* Attach the page-actions window event listeners. Returns a disposer.
|
|
35
|
+
* Actions are resolved per-event via `getAll` so late-activating plugins are
|
|
36
|
+
* always included.
|
|
37
|
+
*/
|
|
38
|
+
export declare const installPageActionListeners: (capabilities: CapabilityManager.CapabilityManager, invoker: Capabilities.OperationInvoker, onResult?: (ack: PageAction.InvokeAck, label?: string, spaceId?: SpaceId) => void) => (() => void);
|
|
39
|
+
//# sourceMappingURL=page-actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-actions.d.ts","sourceRoot":"","sources":["../../../src/page-actions.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,YAAY,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,KAAK,iBAAiB,MAAM,uCAAuC,CAAC;AAEhF,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAI1C,OAAO,EAAmB,UAAU,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAE/D;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,UAAU,EAAE,MAAM,UAAU,CAAC,UAAU,EAAE,CAAC;IAC1C,WAAW,EAAE,MAAM,QAAQ,CAAC,QAAQ,CAAC;IACrC,SAAS,EAAE,MAAM,QAAQ,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC/C,MAAM,EAAE,CACN,SAAS,EAAE,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,EAC7C,KAAK,EAAE,OAAO,KACX,OAAO,CAAC;QAAE,IAAI,CAAC,EAAE;YAAE,EAAE,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CAC3D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,WAAY,OAAO,cAAc,MAAM,UAAU,CAAC,UAAU,EAAE,KAAG,UAAU,CAAC,OAevG,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,WAAkB,OAAO,QAAQ,UAAU,KAAG,OAAO,CAAC,UAAU,CAAC,SAAS,CAmDvG,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,iBACvB,iBAAiB,CAAC,iBAAiB,WACxC,YAAY,CAAC,gBAAgB,aAC3B,CAAC,GAAG,EAAE,UAAU,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,KAChF,CAAC,MAAM,IAAI,CAkDb,CAAC"}
|