@forgeax/app-shell 0.1.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.
@@ -0,0 +1,19 @@
1
+ import { ContributionDeclaration } from '@forgeax/extension-contracts';
2
+
3
+ type ShellSlot = 'dock' | 'window' | 'panel';
4
+ interface ShellContribution {
5
+ id: string;
6
+ slot: ShellSlot;
7
+ title: string;
8
+ contribution: ContributionDeclaration;
9
+ }
10
+ declare class AppShellRegistry {
11
+ #private;
12
+ register(contribution: ShellContribution): void;
13
+ list(slot?: ShellSlot): readonly ShellContribution[];
14
+ }
15
+ declare function createShellContribution(input: Omit<ShellContribution, 'contribution'> & {
16
+ contribution: ContributionDeclaration;
17
+ }): ShellContribution;
18
+
19
+ export { AppShellRegistry, type ShellContribution, type ShellSlot, createShellContribution };
package/dist/index.js ADDED
@@ -0,0 +1,22 @@
1
+ // src/index.ts
2
+ var AppShellRegistry = class {
3
+ #contributions = /* @__PURE__ */ new Map();
4
+ register(contribution) {
5
+ if (this.#contributions.has(contribution.id)) {
6
+ throw new Error(`Duplicate shell contribution: ${contribution.id}`);
7
+ }
8
+ this.#contributions.set(contribution.id, contribution);
9
+ }
10
+ list(slot) {
11
+ const values = [...this.#contributions.values()];
12
+ return slot ? values.filter((item) => item.slot === slot) : values;
13
+ }
14
+ };
15
+ function createShellContribution(input) {
16
+ return { ...input };
17
+ }
18
+ export {
19
+ AppShellRegistry,
20
+ createShellContribution
21
+ };
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { ContributionDeclaration } from '@forgeax/extension-contracts';\n\nexport type ShellSlot = 'dock' | 'window' | 'panel';\n\nexport interface ShellContribution {\n id: string;\n slot: ShellSlot;\n title: string;\n contribution: ContributionDeclaration;\n}\n\nexport class AppShellRegistry {\n #contributions = new Map<string, ShellContribution>();\n\n register(contribution: ShellContribution): void {\n if (this.#contributions.has(contribution.id)) {\n throw new Error(`Duplicate shell contribution: ${contribution.id}`);\n }\n this.#contributions.set(contribution.id, contribution);\n }\n\n list(slot?: ShellSlot): readonly ShellContribution[] {\n const values = [...this.#contributions.values()];\n return slot ? values.filter((item) => item.slot === slot) : values;\n }\n}\n\nexport function createShellContribution(input: Omit<ShellContribution, 'contribution'> & { contribution: ContributionDeclaration }): ShellContribution {\n return { ...input };\n}\n"],"mappings":";AAWO,IAAM,mBAAN,MAAuB;AAAA,EAC5B,iBAAiB,oBAAI,IAA+B;AAAA,EAEpD,SAAS,cAAuC;AAC9C,QAAI,KAAK,eAAe,IAAI,aAAa,EAAE,GAAG;AAC5C,YAAM,IAAI,MAAM,iCAAiC,aAAa,EAAE,EAAE;AAAA,IACpE;AACA,SAAK,eAAe,IAAI,aAAa,IAAI,YAAY;AAAA,EACvD;AAAA,EAEA,KAAK,MAAgD;AACnD,UAAM,SAAS,CAAC,GAAG,KAAK,eAAe,OAAO,CAAC;AAC/C,WAAO,OAAO,OAAO,OAAO,CAAC,SAAS,KAAK,SAAS,IAAI,IAAI;AAAA,EAC9D;AACF;AAEO,SAAS,wBAAwB,OAA+G;AACrJ,SAAO,EAAE,GAAG,MAAM;AACpB;","names":[]}
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@forgeax/app-shell",
3
+ "version": "0.1.0",
4
+ "description": "Generic dock, panel, and window composition primitives",
5
+ "license": "Apache-2.0",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "files": ["dist"],
9
+ "main": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js"
15
+ }
16
+ },
17
+ "scripts": {
18
+ "typecheck": "tsc --noEmit --target ES2022 --module ESNext --moduleResolution bundler --strict --skipLibCheck --verbatimModuleSyntax src/*.ts",
19
+ "test": "bun test test/*.test.ts",
20
+ "build": "tsup src/index.ts --format esm --dts --outDir dist"
21
+ },
22
+ "dependencies": {
23
+ "@forgeax/extension-contracts": "^0.1.0"
24
+ }
25
+ }