@hamak/ui-shell-spi 0.4.6 → 0.4.16
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/package.json +5 -2
- package/.turbo/turbo-build.log +0 -1
- package/CHANGELOG.md +0 -41
- package/project.json +0 -24
- package/src/guards/NavigationGuard.ts +0 -26
- package/src/guards/index.ts +0 -6
- package/src/hooks/ShellHooks.ts +0 -48
- package/src/hooks/index.ts +0 -6
- package/src/index.ts +0 -26
- package/src/providers/IRouterStrategy.ts +0 -41
- package/src/providers/IStorageProvider.ts +0 -31
- package/src/providers/ITemplateProvider.ts +0 -41
- package/src/providers/IThemeProvider.ts +0 -28
- package/src/providers/index.ts +0 -9
- package/src/slots/LayoutSlotProvider.ts +0 -37
- package/src/slots/TemplateSlot.ts +0 -40
- package/src/slots/index.ts +0 -7
- package/tsconfig.es2015.json +0 -24
- package/tsconfig.json +0 -20
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hamak/ui-shell-spi",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.16",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "UI Shell SPI - Service Provider Interfaces for UI shell",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
9
|
"sideEffects": false,
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
10
13
|
"repository": {
|
|
11
14
|
"type": "git",
|
|
12
15
|
"url": "https://github.com/amah/app-framework.git",
|
|
@@ -32,7 +35,7 @@
|
|
|
32
35
|
}
|
|
33
36
|
},
|
|
34
37
|
"dependencies": {
|
|
35
|
-
"@hamak/ui-shell-api": "
|
|
38
|
+
"@hamak/ui-shell-api": "*"
|
|
36
39
|
},
|
|
37
40
|
"devDependencies": {
|
|
38
41
|
"typescript": "~5.4.0"
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
$ tsc -p tsconfig.json && tsc -p tsconfig.es2015.json
|
package/CHANGELOG.md
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
## 0.4.0 (2025-11-10)
|
|
2
|
-
|
|
3
|
-
### 🚀 Features
|
|
4
|
-
|
|
5
|
-
- implement notification plugin with UI and backend components ([c19ffcf](https://github.com/amah/app-framework/commit/c19ffcf))
|
|
6
|
-
- add ES2015 build support and fix TypeScript config for logging packages ([be5e45e](https://github.com/amah/app-framework/commit/be5e45e))
|
|
7
|
-
- complete logging system build and add optional console interception ([f390bc6](https://github.com/amah/app-framework/commit/f390bc6))
|
|
8
|
-
- implement core pluggable logging system (Phase 1) ([2abdc1a](https://github.com/amah/app-framework/commit/2abdc1a))
|
|
9
|
-
|
|
10
|
-
### 🩹 Fixes
|
|
11
|
-
|
|
12
|
-
- add notification packages to workspaces ([97a234d](https://github.com/amah/app-framework/commit/97a234d))
|
|
13
|
-
|
|
14
|
-
### ❤️ Thank You
|
|
15
|
-
|
|
16
|
-
- Amah
|
|
17
|
-
- Claude
|
|
18
|
-
|
|
19
|
-
## 0.3.0 (2025-11-06)
|
|
20
|
-
|
|
21
|
-
### 🚀 Features
|
|
22
|
-
|
|
23
|
-
- migrate from Turbo to Nx 22 with comprehensive monorepo setup ([e63801e](https://github.com/amah/app-framework/commit/e63801e))
|
|
24
|
-
- add Nx Release for automated dependency management ([01d474f](https://github.com/amah/app-framework/commit/01d474f))
|
|
25
|
-
- migrate from Turbo to Nx 22 monorepo orchestration ([d374271](https://github.com/amah/app-framework/commit/d374271))
|
|
26
|
-
- add configurable main padding and resizable sidebar to DashboardLayout ([c1d25bf](https://github.com/amah/app-framework/commit/c1d25bf))
|
|
27
|
-
- add debug logging and version management system ([ea514fc](https://github.com/amah/app-framework/commit/ea514fc))
|
|
28
|
-
- **ui-store:** add STORE_EXTENSIONS_TOKEN for DI-based middleware/reducer registration ([e855bdd](https://github.com/amah/app-framework/commit/e855bdd))
|
|
29
|
-
- Rename package scope from @amk to @hamak and configure npm publishing ([b6040b5](https://github.com/amah/app-framework/commit/b6040b5))
|
|
30
|
-
- Add hybrid local/CI-CD development workflow with bun link ([d09f528](https://github.com/amah/app-framework/commit/d09f528))
|
|
31
|
-
- Add Turborepo for intelligent build orchestration and fix test type errors ([ba41db8](https://github.com/amah/app-framework/commit/ba41db8))
|
|
32
|
-
- Add Redux store integration with ui-store package and demo ([e5aafa8](https://github.com/amah/app-framework/commit/e5aafa8))
|
|
33
|
-
|
|
34
|
-
### 🩹 Fixes
|
|
35
|
-
|
|
36
|
-
- move git config to top-level release.git in nx.json ([1bb2187](https://github.com/amah/app-framework/commit/1bb2187))
|
|
37
|
-
|
|
38
|
-
### ❤️ Thank You
|
|
39
|
-
|
|
40
|
-
- Amah
|
|
41
|
-
- Claude
|
package/project.json
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@hamak/ui-shell-spi",
|
|
3
|
-
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
-
"sourceRoot": "packages/ui-shell/ui-shell-spi/src",
|
|
5
|
-
"projectType": "library",
|
|
6
|
-
"targets": {
|
|
7
|
-
"build": {
|
|
8
|
-
"executor": "nx:run-commands",
|
|
9
|
-
"outputs": ["{projectRoot}/dist"],
|
|
10
|
-
"options": {
|
|
11
|
-
"command": "tsc -p tsconfig.json && tsc -p tsconfig.es2015.json",
|
|
12
|
-
"cwd": "{projectRoot}"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"clean": {
|
|
16
|
-
"executor": "nx:run-commands",
|
|
17
|
-
"options": {
|
|
18
|
-
"command": "rm -rf dist",
|
|
19
|
-
"cwd": "{projectRoot}"
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
"tags": ["type:library", "scope:ui-shell"]
|
|
24
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Navigation Guard
|
|
3
|
-
* Interface for route navigation guards
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type { RouteConfig } from '@hamak/ui-shell-api';
|
|
7
|
-
|
|
8
|
-
export type NavigationGuard = (
|
|
9
|
-
to: RouteConfig,
|
|
10
|
-
from: RouteConfig | null
|
|
11
|
-
) => boolean | Promise<boolean>;
|
|
12
|
-
|
|
13
|
-
export interface NavigationGuardContext {
|
|
14
|
-
/** Route being navigated to */
|
|
15
|
-
to: RouteConfig;
|
|
16
|
-
/** Route being navigated from */
|
|
17
|
-
from: RouteConfig | null;
|
|
18
|
-
/** Abort navigation */
|
|
19
|
-
abort: () => void;
|
|
20
|
-
/** Redirect to another route */
|
|
21
|
-
redirect: (path: string) => void;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export type AdvancedNavigationGuard = (
|
|
25
|
-
context: NavigationGuardContext
|
|
26
|
-
) => void | Promise<void>;
|
package/src/guards/index.ts
DELETED
package/src/hooks/ShellHooks.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shell Hooks
|
|
3
|
-
* Lifecycle hooks for shell customization
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type { ShellConfig, ShellContext } from '@hamak/ui-shell-api';
|
|
7
|
-
|
|
8
|
-
export interface ShellLifecycleHooks {
|
|
9
|
-
/**
|
|
10
|
-
* Called before shell initialization
|
|
11
|
-
*/
|
|
12
|
-
beforeInit?(config: ShellConfig): void | Promise<void>;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Called after shell initialization
|
|
16
|
-
*/
|
|
17
|
-
afterInit?(context: ShellContext): void | Promise<void>;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Called before theme change
|
|
21
|
-
*/
|
|
22
|
-
beforeThemeChange?(oldTheme: string, newTheme: string): boolean | Promise<boolean>;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Called after theme change
|
|
26
|
-
*/
|
|
27
|
-
afterThemeChange?(theme: string): void | Promise<void>;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Called before feature toggle
|
|
31
|
-
*/
|
|
32
|
-
beforeFeatureToggle?(key: string, oldValue: any, newValue: any): boolean | Promise<boolean>;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Called after feature toggle
|
|
36
|
-
*/
|
|
37
|
-
afterFeatureToggle?(key: string, value: any): void | Promise<void>;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Called before shell destroy
|
|
41
|
-
*/
|
|
42
|
-
beforeDestroy?(): void | Promise<void>;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Called after shell destroy
|
|
46
|
-
*/
|
|
47
|
-
afterDestroy?(): void | Promise<void>;
|
|
48
|
-
}
|
package/src/hooks/index.ts
DELETED
package/src/index.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* UI Shell SPI (Service Provider Interface)
|
|
3
|
-
* Extension points and provider interfaces for UI Shell customization
|
|
4
|
-
*
|
|
5
|
-
* Implement these interfaces to customize shell behavior:
|
|
6
|
-
* - Storage providers (localStorage, cookies, etc.)
|
|
7
|
-
* - Theme providers (CSS vars, styled-components, etc.)
|
|
8
|
-
* - Router strategies (history, hash, memory)
|
|
9
|
-
* - Layout templates
|
|
10
|
-
* - Navigation guards
|
|
11
|
-
* - Lifecycle hooks
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
export const version = '0.2.2';
|
|
15
|
-
|
|
16
|
-
// Export all providers
|
|
17
|
-
export * from './providers';
|
|
18
|
-
|
|
19
|
-
// Export all guards
|
|
20
|
-
export * from './guards';
|
|
21
|
-
|
|
22
|
-
// Export all hooks
|
|
23
|
-
export * from './hooks';
|
|
24
|
-
|
|
25
|
-
// Export all slots
|
|
26
|
-
export * from './slots';
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Router Strategy Interface
|
|
3
|
-
* Abstraction for routing strategies (history, hash, memory)
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export interface IRouterStrategy {
|
|
7
|
-
/**
|
|
8
|
-
* Push a new entry to the history stack
|
|
9
|
-
*/
|
|
10
|
-
push(path: string): void;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Replace the current entry in the history stack
|
|
14
|
-
*/
|
|
15
|
-
replace(path: string): void;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Go back in history
|
|
19
|
-
*/
|
|
20
|
-
back(): void;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Go forward in history
|
|
24
|
-
*/
|
|
25
|
-
forward(): void;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Get the current path
|
|
29
|
-
*/
|
|
30
|
-
getCurrentPath(): string;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Listen for navigation changes
|
|
34
|
-
*/
|
|
35
|
-
listen(callback: (path: string) => void): () => void;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Clean up resources
|
|
39
|
-
*/
|
|
40
|
-
destroy(): void;
|
|
41
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Storage Provider Interface
|
|
3
|
-
* Abstraction for storage mechanisms (localStorage, sessionStorage, cookies, etc.)
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export interface IStorageProvider {
|
|
7
|
-
/**
|
|
8
|
-
* Get an item from storage
|
|
9
|
-
*/
|
|
10
|
-
getItem(key: string): string | null;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Set an item in storage
|
|
14
|
-
*/
|
|
15
|
-
setItem(key: string, value: string): void;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Remove an item from storage
|
|
19
|
-
*/
|
|
20
|
-
removeItem(key: string): void;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Clear all items from storage
|
|
24
|
-
*/
|
|
25
|
-
clear?(): void;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Check if storage is available
|
|
29
|
-
*/
|
|
30
|
-
isAvailable(): boolean;
|
|
31
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Template Provider Interface
|
|
3
|
-
* Extension point for custom layout templates
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type { LayoutSlot } from '@hamak/ui-shell-api';
|
|
7
|
-
|
|
8
|
-
export interface TemplateOptions {
|
|
9
|
-
/** Template name/identifier */
|
|
10
|
-
name: string;
|
|
11
|
-
/** Template metadata */
|
|
12
|
-
meta?: Record<string, any>;
|
|
13
|
-
/** Responsive breakpoints configuration */
|
|
14
|
-
responsive?: {
|
|
15
|
-
mobile?: Record<string, any>;
|
|
16
|
-
tablet?: Record<string, any>;
|
|
17
|
-
desktop?: Record<string, any>;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface ITemplateProvider {
|
|
22
|
-
/**
|
|
23
|
-
* Get template name
|
|
24
|
-
*/
|
|
25
|
-
getName(): string;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Get available slot areas for this template
|
|
29
|
-
*/
|
|
30
|
-
getSlotAreas(): string[];
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Render a slot area
|
|
34
|
-
*/
|
|
35
|
-
renderSlot(area: string, slots: LayoutSlot[]): any;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Get template configuration
|
|
39
|
-
*/
|
|
40
|
-
getConfig(): TemplateOptions;
|
|
41
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Theme Provider Interface
|
|
3
|
-
* Abstraction for theme application strategies (CSS variables, styled-components, etc.)
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type { ThemeMode, ThemeConfig } from '@hamak/ui-shell-api';
|
|
7
|
-
|
|
8
|
-
export interface IThemeProvider {
|
|
9
|
-
/**
|
|
10
|
-
* Apply theme to the UI
|
|
11
|
-
*/
|
|
12
|
-
applyTheme(mode: ThemeMode, config: ThemeConfig): void;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Get system theme preference
|
|
16
|
-
*/
|
|
17
|
-
getSystemPreference(): 'light' | 'dark';
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Listen for system theme changes
|
|
21
|
-
*/
|
|
22
|
-
onSystemThemeChange(callback: (theme: 'light' | 'dark') => void): () => void;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Clean up resources
|
|
26
|
-
*/
|
|
27
|
-
destroy(): void;
|
|
28
|
-
}
|
package/src/providers/index.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Layout Slot Provider
|
|
3
|
-
* Interface for dynamic layout slot registration
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type { LayoutSlot, LayoutArea } from '@hamak/ui-shell-api';
|
|
7
|
-
|
|
8
|
-
export interface AreaOptions {
|
|
9
|
-
/** Area name */
|
|
10
|
-
name: string;
|
|
11
|
-
/** Display order */
|
|
12
|
-
order?: number;
|
|
13
|
-
/** Area metadata */
|
|
14
|
-
meta?: Record<string, any>;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface ILayoutSlotProvider {
|
|
18
|
-
/**
|
|
19
|
-
* Register a new layout area dynamically
|
|
20
|
-
*/
|
|
21
|
-
registerArea(name: string, options?: AreaOptions): () => void;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Unregister a layout area
|
|
25
|
-
*/
|
|
26
|
-
unregisterArea(name: string): void;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Get all registered areas
|
|
30
|
-
*/
|
|
31
|
-
getRegisteredAreas(): string[];
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Check if an area is registered
|
|
35
|
-
*/
|
|
36
|
-
isAreaRegistered(name: string): boolean;
|
|
37
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Template Slot
|
|
3
|
-
* Extension point for template customization
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type { LayoutSlot } from '@hamak/ui-shell-api';
|
|
7
|
-
|
|
8
|
-
export interface TemplateSlotRenderer {
|
|
9
|
-
/**
|
|
10
|
-
* Render function for slot content
|
|
11
|
-
*/
|
|
12
|
-
render(slot: LayoutSlot): any;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Check if this renderer can handle the slot
|
|
16
|
-
*/
|
|
17
|
-
canRender(slot: LayoutSlot): boolean;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Renderer priority (higher = rendered first)
|
|
21
|
-
*/
|
|
22
|
-
priority?: number;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface TemplateSlotExtension {
|
|
26
|
-
/**
|
|
27
|
-
* Register a custom slot renderer
|
|
28
|
-
*/
|
|
29
|
-
registerRenderer(renderer: TemplateSlotRenderer): () => void;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Get all registered renderers
|
|
33
|
-
*/
|
|
34
|
-
getRenderers(): TemplateSlotRenderer[];
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Find appropriate renderer for a slot
|
|
38
|
-
*/
|
|
39
|
-
findRenderer(slot: LayoutSlot): TemplateSlotRenderer | null;
|
|
40
|
-
}
|
package/src/slots/index.ts
DELETED
package/tsconfig.es2015.json
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"target": "ES2015",
|
|
5
|
-
"lib": [
|
|
6
|
-
"ES2015",
|
|
7
|
-
"DOM",
|
|
8
|
-
"DOM.Iterable"
|
|
9
|
-
],
|
|
10
|
-
"outDir": "dist/es2015",
|
|
11
|
-
"declaration": false,
|
|
12
|
-
"declarationMap": false,
|
|
13
|
-
"sourceMap": false,
|
|
14
|
-
"downlevelIteration": true,
|
|
15
|
-
"composite": false
|
|
16
|
-
},
|
|
17
|
-
"include": [
|
|
18
|
-
"src/**/*"
|
|
19
|
-
],
|
|
20
|
-
"exclude": [
|
|
21
|
-
"node_modules",
|
|
22
|
-
"dist"
|
|
23
|
-
]
|
|
24
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "ES2022",
|
|
5
|
-
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"declarationMap": true,
|
|
8
|
-
"outDir": "dist",
|
|
9
|
-
"rootDir": "src",
|
|
10
|
-
"strict": true,
|
|
11
|
-
"esModuleInterop": true,
|
|
12
|
-
"skipLibCheck": true,
|
|
13
|
-
"forceConsistentCasingInFileNames": true,
|
|
14
|
-
"moduleResolution": "bundler",
|
|
15
|
-
"resolveJsonModule": true,
|
|
16
|
-
"allowSyntheticDefaultImports": true
|
|
17
|
-
},
|
|
18
|
-
"include": ["src/**/*"],
|
|
19
|
-
"exclude": ["node_modules", "dist"]
|
|
20
|
-
}
|