@hamak/ui-store-api 0.4.19 → 0.6.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,69 @@
1
+ /**
2
+ * Autosave Action Factory
3
+ *
4
+ * Factory for creating autosave actions.
5
+ */
6
+ import type { AnyAction } from 'redux';
7
+ import type { AutosaveConfig } from './autosave-types';
8
+ import { type SetAutosaveConfigAction, type ClearAutosaveConfigAction, type ChangeDetectedAction, type DebounceExpiredAction, type SaveStartedAction, type SaveSucceededAction, type SaveFailedAction, type RetryScheduledAction, type FlushPendingAction, type FlushAllPendingAction, type CancelPendingAction, type AutosaveAction } from './autosave-action-types';
9
+ /**
10
+ * Factory class for creating autosave actions
11
+ */
12
+ export declare class AutosaveActionFactory {
13
+ /**
14
+ * Set autosave configuration for a path
15
+ */
16
+ setConfig(path: string[], config: AutosaveConfig): SetAutosaveConfigAction;
17
+ /**
18
+ * Clear autosave configuration for a path (revert to inherited)
19
+ */
20
+ clearConfig(path: string[]): ClearAutosaveConfigAction;
21
+ /**
22
+ * Content change detected, debounce timer started
23
+ */
24
+ changeDetected(path: string[], detectedAt: number, scheduledFor: number, providerId: string): ChangeDetectedAction;
25
+ /**
26
+ * Debounce timer expired, ready to save
27
+ */
28
+ debounceExpired(path: string[]): DebounceExpiredAction;
29
+ /**
30
+ * Save operation started
31
+ */
32
+ saveStarted(path: string[], providerId: string): SaveStartedAction;
33
+ /**
34
+ * Save completed successfully
35
+ */
36
+ saveSucceeded(path: string[], timestamp?: number): SaveSucceededAction;
37
+ /**
38
+ * Save failed
39
+ */
40
+ saveFailed(path: string[], error: {
41
+ code: string;
42
+ message: string;
43
+ }, attempt?: number): SaveFailedAction;
44
+ /**
45
+ * Retry scheduled
46
+ */
47
+ retryScheduled(path: string[], retryAt: number, attempt: number): RetryScheduledAction;
48
+ /**
49
+ * Flush pending save immediately (cancels debounce)
50
+ */
51
+ flushPending(path: string[]): FlushPendingAction;
52
+ /**
53
+ * Flush all pending saves
54
+ */
55
+ flushAllPending(): FlushAllPendingAction;
56
+ /**
57
+ * Cancel pending save
58
+ */
59
+ cancelPending(path: string[]): CancelPendingAction;
60
+ /**
61
+ * Check if an action is an autosave action
62
+ */
63
+ isAutosaveAction(action: AnyAction): action is AutosaveAction;
64
+ }
65
+ /**
66
+ * Singleton instance of the autosave action factory
67
+ */
68
+ export declare const autosaveActions: AutosaveActionFactory;
69
+ //# sourceMappingURL=autosave-action-factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autosave-action-factory.d.ts","sourceRoot":"","sources":["../../src/autosave/autosave-action-factory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AAEjC;;GAEG;AACH,qBAAa,qBAAqB;IAKhC;;OAEG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,cAAc,GAAG,uBAAuB;IAO1E;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,yBAAyB;IAWtD;;OAEG;IACH,cAAc,CACZ,IAAI,EAAE,MAAM,EAAE,EACd,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,GACjB,oBAAoB;IAOvB;;OAEG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,qBAAqB;IAOtD;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,iBAAiB;IAOlE;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,mBAAmB;IAOtE;;OAEG;IACH,UAAU,CACR,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EACxC,OAAO,GAAE,MAAU,GAClB,gBAAgB;IAUnB;;OAEG;IACH,cAAc,CACZ,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,oBAAoB;IAWvB;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,kBAAkB;IAOhD;;OAEG;IACH,eAAe,IAAI,qBAAqB;IAMxC;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,mBAAmB;IAWlD;;OAEG;IACH,gBAAgB,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,IAAI,cAAc;CAM9D;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,uBAA8B,CAAC"}
@@ -0,0 +1,135 @@
1
+ /**
2
+ * Autosave Action Factory
3
+ *
4
+ * Factory for creating autosave actions.
5
+ */
6
+ import { AutosaveActionTypes, } from './autosave-action-types';
7
+ /**
8
+ * Factory class for creating autosave actions
9
+ */
10
+ export class AutosaveActionFactory {
11
+ // ─────────────────────────────────────────────────────────────────
12
+ // Configuration Actions
13
+ // ─────────────────────────────────────────────────────────────────
14
+ /**
15
+ * Set autosave configuration for a path
16
+ */
17
+ setConfig(path, config) {
18
+ return {
19
+ type: AutosaveActionTypes.SET_CONFIG,
20
+ payload: { path, config },
21
+ };
22
+ }
23
+ /**
24
+ * Clear autosave configuration for a path (revert to inherited)
25
+ */
26
+ clearConfig(path) {
27
+ return {
28
+ type: AutosaveActionTypes.CLEAR_CONFIG,
29
+ payload: { path },
30
+ };
31
+ }
32
+ // ─────────────────────────────────────────────────────────────────
33
+ // Lifecycle Actions (used internally by middleware)
34
+ // ─────────────────────────────────────────────────────────────────
35
+ /**
36
+ * Content change detected, debounce timer started
37
+ */
38
+ changeDetected(path, detectedAt, scheduledFor, providerId) {
39
+ return {
40
+ type: AutosaveActionTypes.CHANGE_DETECTED,
41
+ payload: { path, detectedAt, scheduledFor, providerId },
42
+ };
43
+ }
44
+ /**
45
+ * Debounce timer expired, ready to save
46
+ */
47
+ debounceExpired(path) {
48
+ return {
49
+ type: AutosaveActionTypes.DEBOUNCE_EXPIRED,
50
+ payload: { path },
51
+ };
52
+ }
53
+ /**
54
+ * Save operation started
55
+ */
56
+ saveStarted(path, providerId) {
57
+ return {
58
+ type: AutosaveActionTypes.SAVE_STARTED,
59
+ payload: { path, providerId },
60
+ };
61
+ }
62
+ /**
63
+ * Save completed successfully
64
+ */
65
+ saveSucceeded(path, timestamp) {
66
+ return {
67
+ type: AutosaveActionTypes.SAVE_SUCCEEDED,
68
+ payload: { path, timestamp: timestamp ?? Date.now() },
69
+ };
70
+ }
71
+ /**
72
+ * Save failed
73
+ */
74
+ saveFailed(path, error, attempt = 1) {
75
+ return {
76
+ type: AutosaveActionTypes.SAVE_FAILED,
77
+ payload: {
78
+ path,
79
+ error: { ...error, attempt },
80
+ },
81
+ };
82
+ }
83
+ /**
84
+ * Retry scheduled
85
+ */
86
+ retryScheduled(path, retryAt, attempt) {
87
+ return {
88
+ type: AutosaveActionTypes.RETRY_SCHEDULED,
89
+ payload: { path, retryAt, attempt },
90
+ };
91
+ }
92
+ // ─────────────────────────────────────────────────────────────────
93
+ // Manual Trigger Actions
94
+ // ─────────────────────────────────────────────────────────────────
95
+ /**
96
+ * Flush pending save immediately (cancels debounce)
97
+ */
98
+ flushPending(path) {
99
+ return {
100
+ type: AutosaveActionTypes.FLUSH_PENDING,
101
+ payload: { path },
102
+ };
103
+ }
104
+ /**
105
+ * Flush all pending saves
106
+ */
107
+ flushAllPending() {
108
+ return {
109
+ type: AutosaveActionTypes.FLUSH_ALL_PENDING,
110
+ };
111
+ }
112
+ /**
113
+ * Cancel pending save
114
+ */
115
+ cancelPending(path) {
116
+ return {
117
+ type: AutosaveActionTypes.CANCEL_PENDING,
118
+ payload: { path },
119
+ };
120
+ }
121
+ // ─────────────────────────────────────────────────────────────────
122
+ // Type Guards
123
+ // ─────────────────────────────────────────────────────────────────
124
+ /**
125
+ * Check if an action is an autosave action
126
+ */
127
+ isAutosaveAction(action) {
128
+ return (typeof action.type === 'string' &&
129
+ action.type.startsWith('@@autosave/'));
130
+ }
131
+ }
132
+ /**
133
+ * Singleton instance of the autosave action factory
134
+ */
135
+ export const autosaveActions = new AutosaveActionFactory();
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Autosave Action Types
3
+ *
4
+ * These actions orchestrate the autosave lifecycle but do NOT execute saves.
5
+ * Actual saves are performed by plugin providers using their own actions
6
+ * (e.g., PUT_REQUEST for remote-fs, UPDATE_ENTITY for remote-resource).
7
+ */
8
+ import type { AutosaveConfig, AutosaveError } from './autosave-types';
9
+ /**
10
+ * Autosave action type constants
11
+ */
12
+ export declare enum AutosaveActionTypes {
13
+ /** Set autosave configuration for a path */
14
+ SET_CONFIG = "@@autosave/SET_CONFIG",
15
+ /** Clear autosave configuration (revert to inherited) */
16
+ CLEAR_CONFIG = "@@autosave/CLEAR_CONFIG",
17
+ /** Content change detected, debounce timer started */
18
+ CHANGE_DETECTED = "@@autosave/CHANGE_DETECTED",
19
+ /** Debounce timer expired, save will be triggered */
20
+ DEBOUNCE_EXPIRED = "@@autosave/DEBOUNCE_EXPIRED",
21
+ /** Save operation started */
22
+ SAVE_STARTED = "@@autosave/SAVE_STARTED",
23
+ /** Save completed successfully */
24
+ SAVE_SUCCEEDED = "@@autosave/SAVE_SUCCEEDED",
25
+ /** Save failed */
26
+ SAVE_FAILED = "@@autosave/SAVE_FAILED",
27
+ /** Retry scheduled */
28
+ RETRY_SCHEDULED = "@@autosave/RETRY_SCHEDULED",
29
+ /** Flush pending save immediately (cancels debounce) */
30
+ FLUSH_PENDING = "@@autosave/FLUSH_PENDING",
31
+ /** Flush all pending saves */
32
+ FLUSH_ALL_PENDING = "@@autosave/FLUSH_ALL_PENDING",
33
+ /** Cancel pending save */
34
+ CANCEL_PENDING = "@@autosave/CANCEL_PENDING"
35
+ }
36
+ /** Set autosave configuration for a path */
37
+ export interface SetAutosaveConfigAction {
38
+ type: AutosaveActionTypes.SET_CONFIG;
39
+ payload: {
40
+ path: string[];
41
+ config: AutosaveConfig;
42
+ };
43
+ [key: string]: unknown;
44
+ }
45
+ /** Clear autosave configuration for a path */
46
+ export interface ClearAutosaveConfigAction {
47
+ type: AutosaveActionTypes.CLEAR_CONFIG;
48
+ payload: {
49
+ path: string[];
50
+ };
51
+ [key: string]: unknown;
52
+ }
53
+ /** Content change detected */
54
+ export interface ChangeDetectedAction {
55
+ type: AutosaveActionTypes.CHANGE_DETECTED;
56
+ payload: {
57
+ path: string[];
58
+ detectedAt: number;
59
+ scheduledFor: number;
60
+ providerId: string;
61
+ };
62
+ [key: string]: unknown;
63
+ }
64
+ /** Debounce timer expired */
65
+ export interface DebounceExpiredAction {
66
+ type: AutosaveActionTypes.DEBOUNCE_EXPIRED;
67
+ payload: {
68
+ path: string[];
69
+ };
70
+ [key: string]: unknown;
71
+ }
72
+ /** Save started */
73
+ export interface SaveStartedAction {
74
+ type: AutosaveActionTypes.SAVE_STARTED;
75
+ payload: {
76
+ path: string[];
77
+ providerId: string;
78
+ };
79
+ [key: string]: unknown;
80
+ }
81
+ /** Save succeeded */
82
+ export interface SaveSucceededAction {
83
+ type: AutosaveActionTypes.SAVE_SUCCEEDED;
84
+ payload: {
85
+ path: string[];
86
+ timestamp: number;
87
+ };
88
+ [key: string]: unknown;
89
+ }
90
+ /** Save failed */
91
+ export interface SaveFailedAction {
92
+ type: AutosaveActionTypes.SAVE_FAILED;
93
+ payload: {
94
+ path: string[];
95
+ error: AutosaveError;
96
+ };
97
+ [key: string]: unknown;
98
+ }
99
+ /** Retry scheduled */
100
+ export interface RetryScheduledAction {
101
+ type: AutosaveActionTypes.RETRY_SCHEDULED;
102
+ payload: {
103
+ path: string[];
104
+ retryAt: number;
105
+ attempt: number;
106
+ };
107
+ [key: string]: unknown;
108
+ }
109
+ /** Flush pending save */
110
+ export interface FlushPendingAction {
111
+ type: AutosaveActionTypes.FLUSH_PENDING;
112
+ payload: {
113
+ path: string[];
114
+ };
115
+ [key: string]: unknown;
116
+ }
117
+ /** Flush all pending saves */
118
+ export interface FlushAllPendingAction {
119
+ type: AutosaveActionTypes.FLUSH_ALL_PENDING;
120
+ [key: string]: unknown;
121
+ }
122
+ /** Cancel pending save */
123
+ export interface CancelPendingAction {
124
+ type: AutosaveActionTypes.CANCEL_PENDING;
125
+ payload: {
126
+ path: string[];
127
+ };
128
+ [key: string]: unknown;
129
+ }
130
+ /**
131
+ * Union type of all autosave actions
132
+ */
133
+ export type AutosaveAction = SetAutosaveConfigAction | ClearAutosaveConfigAction | ChangeDetectedAction | DebounceExpiredAction | SaveStartedAction | SaveSucceededAction | SaveFailedAction | RetryScheduledAction | FlushPendingAction | FlushAllPendingAction | CancelPendingAction;
134
+ //# sourceMappingURL=autosave-action-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autosave-action-types.d.ts","sourceRoot":"","sources":["../../src/autosave/autosave-action-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtE;;GAEG;AACH,oBAAY,mBAAmB;IAK7B,4CAA4C;IAC5C,UAAU,0BAA0B;IAEpC,yDAAyD;IACzD,YAAY,4BAA4B;IAMxC,sDAAsD;IACtD,eAAe,+BAA+B;IAE9C,qDAAqD;IACrD,gBAAgB,gCAAgC;IAEhD,6BAA6B;IA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G,OAAO,CAAC;CACxB;AAED,0BAA0B;AAC1B,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,mBAAmB,CAAC,cAAc,CAAC;IACzC,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,EAAE,CAAC;KAChB,CAAC;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GACtB,uBAAuB,GACvB,yBAAyB,GACzB,oBAAoB,GACpB,qBAAqB,GACrB,iBAAiB,GACjB,mBAAmB,GACnB,gBAAgB,GAChB,oBAAoB,GACpB,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Autosave Action Types
3
+ *
4
+ * These actions orchestrate the autosave lifecycle but do NOT execute saves.
5
+ * Actual saves are performed by plugin providers using their own actions
6
+ * (e.g., PUT_REQUEST for remote-fs, UPDATE_ENTITY for remote-resource).
7
+ */
8
+ /**
9
+ * Autosave action type constants
10
+ */
11
+ export var AutosaveActionTypes;
12
+ (function (AutosaveActionTypes) {
13
+ // ─────────────────────────────────────────────────────────────────
14
+ // Configuration Actions
15
+ // ─────────────────────────────────────────────────────────────────
16
+ /** Set autosave configuration for a path */
17
+ AutosaveActionTypes["SET_CONFIG"] = "@@autosave/SET_CONFIG";
18
+ /** Clear autosave configuration (revert to inherited) */
19
+ AutosaveActionTypes["CLEAR_CONFIG"] = "@@autosave/CLEAR_CONFIG";
20
+ // ─────────────────────────────────────────────────────────────────
21
+ // Lifecycle Actions (dispatched by middleware)
22
+ // ─────────────────────────────────────────────────────────────────
23
+ /** Content change detected, debounce timer started */
24
+ AutosaveActionTypes["CHANGE_DETECTED"] = "@@autosave/CHANGE_DETECTED";
25
+ /** Debounce timer expired, save will be triggered */
26
+ AutosaveActionTypes["DEBOUNCE_EXPIRED"] = "@@autosave/DEBOUNCE_EXPIRED";
27
+ /** Save operation started */
28
+ AutosaveActionTypes["SAVE_STARTED"] = "@@autosave/SAVE_STARTED";
29
+ /** Save completed successfully */
30
+ AutosaveActionTypes["SAVE_SUCCEEDED"] = "@@autosave/SAVE_SUCCEEDED";
31
+ /** Save failed */
32
+ AutosaveActionTypes["SAVE_FAILED"] = "@@autosave/SAVE_FAILED";
33
+ /** Retry scheduled */
34
+ AutosaveActionTypes["RETRY_SCHEDULED"] = "@@autosave/RETRY_SCHEDULED";
35
+ // ─────────────────────────────────────────────────────────────────
36
+ // Manual Trigger Actions
37
+ // ─────────────────────────────────────────────────────────────────
38
+ /** Flush pending save immediately (cancels debounce) */
39
+ AutosaveActionTypes["FLUSH_PENDING"] = "@@autosave/FLUSH_PENDING";
40
+ /** Flush all pending saves */
41
+ AutosaveActionTypes["FLUSH_ALL_PENDING"] = "@@autosave/FLUSH_ALL_PENDING";
42
+ /** Cancel pending save */
43
+ AutosaveActionTypes["CANCEL_PENDING"] = "@@autosave/CANCEL_PENDING";
44
+ })(AutosaveActionTypes || (AutosaveActionTypes = {}));
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Autosave Types
3
+ *
4
+ * Core types for the autosave feature. These are used by:
5
+ * - ui-store-impl: Core autosave middleware
6
+ * - Plugin providers: RemoteFs, Resource, Git autosave providers
7
+ */
8
+ /**
9
+ * Extension state key for autosave
10
+ * Used to store autosave state in FileSystemNode.state.extensionStates
11
+ */
12
+ export declare const AUTOSAVE_EXTENSION_KEY = "autosave";
13
+ /**
14
+ * Autosave configuration
15
+ *
16
+ * Can be set at multiple levels with inheritance:
17
+ * - File node extension state (highest priority)
18
+ * - Parent folder extension state
19
+ * - Plugin default config
20
+ * - Global default config (lowest priority)
21
+ */
22
+ export interface AutosaveConfig {
23
+ /** Enable/disable autosave */
24
+ enabled: boolean;
25
+ /** Debounce delay in milliseconds before triggering save. Default: 1500 */
26
+ debounceMs?: number;
27
+ /** Maximum wait time before forced save regardless of continued edits. Default: 10000 */
28
+ maxWaitMs?: number;
29
+ /** Save when file loses focus. Default: true */
30
+ saveOnBlur?: boolean;
31
+ /** Retry failed saves automatically. Default: true */
32
+ retryOnFailure?: boolean;
33
+ /** Maximum retry attempts before giving up. Default: 3 */
34
+ maxRetries?: number;
35
+ /** Inherit configuration from parent folder. Default: true */
36
+ inherit?: boolean;
37
+ }
38
+ /**
39
+ * Autosave status values
40
+ */
41
+ export type AutosaveStatus = 'idle' | 'pending' | 'saving' | 'error' | 'disabled';
42
+ /**
43
+ * Autosave error information
44
+ */
45
+ export interface AutosaveError {
46
+ /** Error code */
47
+ code: string;
48
+ /** Error message */
49
+ message: string;
50
+ /** Which retry attempt this error occurred on */
51
+ attempt: number;
52
+ }
53
+ /**
54
+ * Autosave extension state
55
+ *
56
+ * Stored in FileSystemNode.state.extensionStates[AUTOSAVE_EXTENSION_KEY]
57
+ */
58
+ export interface AutosaveExtensionState {
59
+ /** Explicit configuration on this node (undefined if inherited) */
60
+ config?: AutosaveConfig;
61
+ /** Computed: is autosave effectively enabled for this node? */
62
+ effectivelyEnabled: boolean;
63
+ /** Current autosave status */
64
+ status: AutosaveStatus;
65
+ /** Timestamp when content first became dirty (pending save) */
66
+ pendingSince?: number;
67
+ /** Timestamp of last save attempt */
68
+ lastSaveAttempt?: number;
69
+ /** Timestamp of last successful save */
70
+ lastSaveSuccess?: number;
71
+ /** Last save error (cleared on success) */
72
+ lastSaveError?: AutosaveError;
73
+ /** Current retry count (reset on success) */
74
+ retryCount?: number;
75
+ /** Provider ID that handles this node */
76
+ providerId?: string;
77
+ }
78
+ /**
79
+ * Default autosave configuration values
80
+ */
81
+ export declare const DEFAULT_AUTOSAVE_CONFIG: Required<AutosaveConfig>;
82
+ /**
83
+ * Create initial autosave extension state
84
+ */
85
+ export declare function createInitialAutosaveState(config?: AutosaveConfig, providerId?: string): AutosaveExtensionState;
86
+ //# sourceMappingURL=autosave-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autosave-types.d.ts","sourceRoot":"","sources":["../../src/autosave/autosave-types.ts"],"names":[],"mappings":"AA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C,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,cAAc,CAQ5D,CAAC;AAEF;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,CAAC,EAAE,cAAc,EACvB,UAAU,CAAC,EAAE,MAAM,GAClB,sBAAsB,CAOxB"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Autosave Types
3
+ *
4
+ * Core types for the autosave feature. These are used by:
5
+ * - ui-store-impl: Core autosave middleware
6
+ * - Plugin providers: RemoteFs, Resource, Git autosave providers
7
+ */
8
+ /**
9
+ * Extension state key for autosave
10
+ * Used to store autosave state in FileSystemNode.state.extensionStates
11
+ */
12
+ export const AUTOSAVE_EXTENSION_KEY = 'autosave';
13
+ /**
14
+ * Default autosave configuration values
15
+ */
16
+ export const DEFAULT_AUTOSAVE_CONFIG = {
17
+ enabled: false,
18
+ debounceMs: 1500,
19
+ maxWaitMs: 10000,
20
+ saveOnBlur: true,
21
+ retryOnFailure: true,
22
+ maxRetries: 3,
23
+ inherit: true,
24
+ };
25
+ /**
26
+ * Create initial autosave extension state
27
+ */
28
+ export function createInitialAutosaveState(config, providerId) {
29
+ return {
30
+ config,
31
+ effectivelyEnabled: config?.enabled ?? false,
32
+ status: config?.enabled === false ? 'disabled' : 'idle',
33
+ providerId,
34
+ };
35
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Autosave Module
3
+ *
4
+ * Public API for autosave functionality.
5
+ */
6
+ export * from './autosave-types';
7
+ export * from './autosave-action-types';
8
+ export * from './autosave-action-factory';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/autosave/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Autosave Module
3
+ *
4
+ * Public API for autosave functionality.
5
+ */
6
+ export * from './autosave-types';
7
+ export * from './autosave-action-types';
8
+ export * from './autosave-action-factory';
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+ /**
3
+ * Autosave Action Factory
4
+ *
5
+ * Factory for creating autosave actions.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.autosaveActions = exports.AutosaveActionFactory = void 0;
9
+ const autosave_action_types_1 = require("./autosave-action-types");
10
+ /**
11
+ * Factory class for creating autosave actions
12
+ */
13
+ class AutosaveActionFactory {
14
+ // ─────────────────────────────────────────────────────────────────
15
+ // Configuration Actions
16
+ // ─────────────────────────────────────────────────────────────────
17
+ /**
18
+ * Set autosave configuration for a path
19
+ */
20
+ setConfig(path, config) {
21
+ return {
22
+ type: autosave_action_types_1.AutosaveActionTypes.SET_CONFIG,
23
+ payload: { path, config },
24
+ };
25
+ }
26
+ /**
27
+ * Clear autosave configuration for a path (revert to inherited)
28
+ */
29
+ clearConfig(path) {
30
+ return {
31
+ type: autosave_action_types_1.AutosaveActionTypes.CLEAR_CONFIG,
32
+ payload: { path },
33
+ };
34
+ }
35
+ // ─────────────────────────────────────────────────────────────────
36
+ // Lifecycle Actions (used internally by middleware)
37
+ // ─────────────────────────────────────────────────────────────────
38
+ /**
39
+ * Content change detected, debounce timer started
40
+ */
41
+ changeDetected(path, detectedAt, scheduledFor, providerId) {
42
+ return {
43
+ type: autosave_action_types_1.AutosaveActionTypes.CHANGE_DETECTED,
44
+ payload: { path, detectedAt, scheduledFor, providerId },
45
+ };
46
+ }
47
+ /**
48
+ * Debounce timer expired, ready to save
49
+ */
50
+ debounceExpired(path) {
51
+ return {
52
+ type: autosave_action_types_1.AutosaveActionTypes.DEBOUNCE_EXPIRED,
53
+ payload: { path },
54
+ };
55
+ }
56
+ /**
57
+ * Save operation started
58
+ */
59
+ saveStarted(path, providerId) {
60
+ return {
61
+ type: autosave_action_types_1.AutosaveActionTypes.SAVE_STARTED,
62
+ payload: { path, providerId },
63
+ };
64
+ }
65
+ /**
66
+ * Save completed successfully
67
+ */
68
+ saveSucceeded(path, timestamp) {
69
+ return {
70
+ type: autosave_action_types_1.AutosaveActionTypes.SAVE_SUCCEEDED,
71
+ payload: { path, timestamp: timestamp !== null && timestamp !== void 0 ? timestamp : Date.now() },
72
+ };
73
+ }
74
+ /**
75
+ * Save failed
76
+ */
77
+ saveFailed(path, error, attempt = 1) {
78
+ return {
79
+ type: autosave_action_types_1.AutosaveActionTypes.SAVE_FAILED,
80
+ payload: {
81
+ path,
82
+ error: Object.assign(Object.assign({}, error), { attempt }),
83
+ },
84
+ };
85
+ }
86
+ /**
87
+ * Retry scheduled
88
+ */
89
+ retryScheduled(path, retryAt, attempt) {
90
+ return {
91
+ type: autosave_action_types_1.AutosaveActionTypes.RETRY_SCHEDULED,
92
+ payload: { path, retryAt, attempt },
93
+ };
94
+ }
95
+ // ─────────────────────────────────────────────────────────────────
96
+ // Manual Trigger Actions
97
+ // ─────────────────────────────────────────────────────────────────
98
+ /**
99
+ * Flush pending save immediately (cancels debounce)
100
+ */
101
+ flushPending(path) {
102
+ return {
103
+ type: autosave_action_types_1.AutosaveActionTypes.FLUSH_PENDING,
104
+ payload: { path },
105
+ };
106
+ }
107
+ /**
108
+ * Flush all pending saves
109
+ */
110
+ flushAllPending() {
111
+ return {
112
+ type: autosave_action_types_1.AutosaveActionTypes.FLUSH_ALL_PENDING,
113
+ };
114
+ }
115
+ /**
116
+ * Cancel pending save
117
+ */
118
+ cancelPending(path) {
119
+ return {
120
+ type: autosave_action_types_1.AutosaveActionTypes.CANCEL_PENDING,
121
+ payload: { path },
122
+ };
123
+ }
124
+ // ─────────────────────────────────────────────────────────────────
125
+ // Type Guards
126
+ // ─────────────────────────────────────────────────────────────────
127
+ /**
128
+ * Check if an action is an autosave action
129
+ */
130
+ isAutosaveAction(action) {
131
+ return (typeof action.type === 'string' &&
132
+ action.type.startsWith('@@autosave/'));
133
+ }
134
+ }
135
+ exports.AutosaveActionFactory = AutosaveActionFactory;
136
+ /**
137
+ * Singleton instance of the autosave action factory
138
+ */
139
+ exports.autosaveActions = new AutosaveActionFactory();
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ /**
3
+ * Autosave Action Types
4
+ *
5
+ * These actions orchestrate the autosave lifecycle but do NOT execute saves.
6
+ * Actual saves are performed by plugin providers using their own actions
7
+ * (e.g., PUT_REQUEST for remote-fs, UPDATE_ENTITY for remote-resource).
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.AutosaveActionTypes = void 0;
11
+ /**
12
+ * Autosave action type constants
13
+ */
14
+ var AutosaveActionTypes;
15
+ (function (AutosaveActionTypes) {
16
+ // ─────────────────────────────────────────────────────────────────
17
+ // Configuration Actions
18
+ // ─────────────────────────────────────────────────────────────────
19
+ /** Set autosave configuration for a path */
20
+ AutosaveActionTypes["SET_CONFIG"] = "@@autosave/SET_CONFIG";
21
+ /** Clear autosave configuration (revert to inherited) */
22
+ AutosaveActionTypes["CLEAR_CONFIG"] = "@@autosave/CLEAR_CONFIG";
23
+ // ─────────────────────────────────────────────────────────────────
24
+ // Lifecycle Actions (dispatched by middleware)
25
+ // ─────────────────────────────────────────────────────────────────
26
+ /** Content change detected, debounce timer started */
27
+ AutosaveActionTypes["CHANGE_DETECTED"] = "@@autosave/CHANGE_DETECTED";
28
+ /** Debounce timer expired, save will be triggered */
29
+ AutosaveActionTypes["DEBOUNCE_EXPIRED"] = "@@autosave/DEBOUNCE_EXPIRED";
30
+ /** Save operation started */
31
+ AutosaveActionTypes["SAVE_STARTED"] = "@@autosave/SAVE_STARTED";
32
+ /** Save completed successfully */
33
+ AutosaveActionTypes["SAVE_SUCCEEDED"] = "@@autosave/SAVE_SUCCEEDED";
34
+ /** Save failed */
35
+ AutosaveActionTypes["SAVE_FAILED"] = "@@autosave/SAVE_FAILED";
36
+ /** Retry scheduled */
37
+ AutosaveActionTypes["RETRY_SCHEDULED"] = "@@autosave/RETRY_SCHEDULED";
38
+ // ─────────────────────────────────────────────────────────────────
39
+ // Manual Trigger Actions
40
+ // ─────────────────────────────────────────────────────────────────
41
+ /** Flush pending save immediately (cancels debounce) */
42
+ AutosaveActionTypes["FLUSH_PENDING"] = "@@autosave/FLUSH_PENDING";
43
+ /** Flush all pending saves */
44
+ AutosaveActionTypes["FLUSH_ALL_PENDING"] = "@@autosave/FLUSH_ALL_PENDING";
45
+ /** Cancel pending save */
46
+ AutosaveActionTypes["CANCEL_PENDING"] = "@@autosave/CANCEL_PENDING";
47
+ })(AutosaveActionTypes || (exports.AutosaveActionTypes = AutosaveActionTypes = {}));
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ /**
3
+ * Autosave Types
4
+ *
5
+ * Core types for the autosave feature. These are used by:
6
+ * - ui-store-impl: Core autosave middleware
7
+ * - Plugin providers: RemoteFs, Resource, Git autosave providers
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.createInitialAutosaveState = exports.DEFAULT_AUTOSAVE_CONFIG = exports.AUTOSAVE_EXTENSION_KEY = void 0;
11
+ /**
12
+ * Extension state key for autosave
13
+ * Used to store autosave state in FileSystemNode.state.extensionStates
14
+ */
15
+ exports.AUTOSAVE_EXTENSION_KEY = 'autosave';
16
+ /**
17
+ * Default autosave configuration values
18
+ */
19
+ exports.DEFAULT_AUTOSAVE_CONFIG = {
20
+ enabled: false,
21
+ debounceMs: 1500,
22
+ maxWaitMs: 10000,
23
+ saveOnBlur: true,
24
+ retryOnFailure: true,
25
+ maxRetries: 3,
26
+ inherit: true,
27
+ };
28
+ /**
29
+ * Create initial autosave extension state
30
+ */
31
+ function createInitialAutosaveState(config, providerId) {
32
+ var _a;
33
+ return {
34
+ config,
35
+ effectivelyEnabled: (_a = config === null || config === void 0 ? void 0 : config.enabled) !== null && _a !== void 0 ? _a : false,
36
+ status: (config === null || config === void 0 ? void 0 : config.enabled) === false ? 'disabled' : 'idle',
37
+ providerId,
38
+ };
39
+ }
40
+ exports.createInitialAutosaveState = createInitialAutosaveState;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ /**
3
+ * Autosave Module
4
+ *
5
+ * Public API for autosave functionality.
6
+ */
7
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ var desc = Object.getOwnPropertyDescriptor(m, k);
10
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
+ desc = { enumerable: true, get: function() { return m[k]; } };
12
+ }
13
+ Object.defineProperty(o, k2, desc);
14
+ }) : (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ o[k2] = m[k];
17
+ }));
18
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ __exportStar(require("./autosave-types"), exports);
23
+ __exportStar(require("./autosave-action-types"), exports);
24
+ __exportStar(require("./autosave-action-factory"), exports);
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * UI Store API
4
- * Public interfaces, types, and tokens for Redux state management
3
+ * @deprecated This package is deprecated. Please migrate to @hamak/ui-store/api
5
4
  */
6
5
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
6
  if (k2 === undefined) k2 = k;
@@ -18,7 +17,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
17
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
18
  };
20
19
  Object.defineProperty(exports, "__esModule", { value: true });
21
- __exportStar(require("./types"), exports);
22
- __exportStar(require("./api"), exports);
23
- __exportStar(require("./tokens"), exports);
24
- __exportStar(require("./fs"), exports);
20
+ console.warn('[@hamak/ui-store-api] This package is deprecated. Please migrate to @hamak/ui-store/api');
21
+ __exportStar(require("@hamak/ui-store/api"), exports);
@@ -4,8 +4,10 @@
4
4
  * Used for service resolution in the microkernel
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.STORE_EXTENSIONS_TOKEN = exports.REDUCER_REGISTRY_TOKEN = exports.MIDDLEWARE_REGISTRY_TOKEN = exports.STORE_MANAGER_TOKEN = void 0;
7
+ exports.AUTOSAVE_REGISTRY_TOKEN = exports.STORE_EXTENSIONS_TOKEN = exports.REDUCER_REGISTRY_TOKEN = exports.MIDDLEWARE_REGISTRY_TOKEN = exports.STORE_MANAGER_TOKEN = void 0;
8
8
  exports.STORE_MANAGER_TOKEN = Symbol('StoreManager');
9
9
  exports.MIDDLEWARE_REGISTRY_TOKEN = Symbol('MiddlewareRegistry');
10
10
  exports.REDUCER_REGISTRY_TOKEN = Symbol('ReducerRegistry');
11
11
  exports.STORE_EXTENSIONS_TOKEN = Symbol('StoreExtensions');
12
+ // Autosave tokens
13
+ exports.AUTOSAVE_REGISTRY_TOKEN = Symbol('AutosaveRegistry');
@@ -16,6 +16,7 @@ export interface FileSystemNodeAction extends Action {
16
16
  export interface FileSystemNodeActionParams {
17
17
  override?: boolean;
18
18
  contentIsPresent?: boolean;
19
+ extensionStates?: Record<string, unknown>;
19
20
  }
20
21
  /**
21
22
  * Filesystem manager interface - manages Redux state for virtual filesystem
@@ -1 +1 @@
1
- {"version":3,"file":"filesystem-manager.contract.d.ts","sourceRoot":"","sources":["../../../src/fs/contracts/filesystem-manager.contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAA2B,eAAe,EAAQ,MAAM,qBAAqB,CAAC;AACrG,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,MAAM;IAClD,OAAO,EAAE,GAAG,CAAA;CACb;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,eAAe,IAAI,eAAe,CAAC;IAEnC;;OAEG;IACH,UAAU,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,KAAK,eAAe,CAAC;IAE1E;;OAEG;IACH,cAAc,CAAC,CAAC,EACd,kBAAkB,EAAE,QAAQ,CAAC,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,EAC5D,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GACtB,QAAQ,CAAC,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC,CAAC;CAC5C"}
1
+ {"version":3,"file":"filesystem-manager.contract.d.ts","sourceRoot":"","sources":["../../../src/fs/contracts/filesystem-manager.contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAA2B,eAAe,EAAQ,MAAM,qBAAqB,CAAC;AACrG,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,MAAM;IAClD,OAAO,EAAE,GAAG,CAAA;CACb;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,eAAe,IAAI,eAAe,CAAC;IAEnC;;OAEG;IACH,UAAU,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,KAAK,eAAe,CAAC;IAE1E;;OAEG;IACH,cAAc,CAAC,CAAC,EACd,kBAAkB,EAAE,QAAQ,CAAC,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,EAC5D,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GACtB,QAAQ,CAAC,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC,CAAC;CAC5C"}
package/dist/index.d.ts CHANGED
@@ -1,9 +1,5 @@
1
1
  /**
2
- * UI Store API
3
- * Public interfaces, types, and tokens for Redux state management
2
+ * @deprecated This package is deprecated. Please migrate to @hamak/ui-store/api
4
3
  */
5
- export * from './types';
6
- export * from './api';
7
- export * from './tokens';
8
- export * from './fs';
4
+ export * from '@hamak/ui-store/api';
9
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,cAAc,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -1,8 +1,5 @@
1
1
  /**
2
- * UI Store API
3
- * Public interfaces, types, and tokens for Redux state management
2
+ * @deprecated This package is deprecated. Please migrate to @hamak/ui-store/api
4
3
  */
5
- export * from './types';
6
- export * from './api';
7
- export * from './tokens';
8
- export * from './fs';
4
+ console.warn('[@hamak/ui-store-api] This package is deprecated. Please migrate to @hamak/ui-store/api');
5
+ export * from '@hamak/ui-store/api';
@@ -6,4 +6,5 @@ export declare const STORE_MANAGER_TOKEN: unique symbol;
6
6
  export declare const MIDDLEWARE_REGISTRY_TOKEN: unique symbol;
7
7
  export declare const REDUCER_REGISTRY_TOKEN: unique symbol;
8
8
  export declare const STORE_EXTENSIONS_TOKEN: unique symbol;
9
+ export declare const AUTOSAVE_REGISTRY_TOKEN: unique symbol;
9
10
  //# sourceMappingURL=service-tokens.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"service-tokens.d.ts","sourceRoot":"","sources":["../../src/tokens/service-tokens.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,mBAAmB,eAAyB,CAAC;AAC1D,eAAO,MAAM,yBAAyB,eAA+B,CAAC;AACtE,eAAO,MAAM,sBAAsB,eAA4B,CAAC;AAChE,eAAO,MAAM,sBAAsB,eAA4B,CAAC"}
1
+ {"version":3,"file":"service-tokens.d.ts","sourceRoot":"","sources":["../../src/tokens/service-tokens.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,mBAAmB,eAAyB,CAAC;AAC1D,eAAO,MAAM,yBAAyB,eAA+B,CAAC;AACtE,eAAO,MAAM,sBAAsB,eAA4B,CAAC;AAChE,eAAO,MAAM,sBAAsB,eAA4B,CAAC;AAGhE,eAAO,MAAM,uBAAuB,eAA6B,CAAC"}
@@ -6,3 +6,5 @@ export const STORE_MANAGER_TOKEN = Symbol('StoreManager');
6
6
  export const MIDDLEWARE_REGISTRY_TOKEN = Symbol('MiddlewareRegistry');
7
7
  export const REDUCER_REGISTRY_TOKEN = Symbol('ReducerRegistry');
8
8
  export const STORE_EXTENSIONS_TOKEN = Symbol('StoreExtensions');
9
+ // Autosave tokens
10
+ export const AUTOSAVE_REGISTRY_TOKEN = Symbol('AutosaveRegistry');
@@ -7,11 +7,20 @@ import type { MiddlewareRegistration } from './middleware-types';
7
7
  * Middleware contribution matches registry entries
8
8
  */
9
9
  export type StoreMiddlewareExtension = MiddlewareRegistration;
10
+ /**
11
+ * Factory function for creating middleware with access to fileSystemAdapter
12
+ */
13
+ export type MiddlewareFactory = (fileSystemAdapter: any) => StoreMiddlewareExtension[];
10
14
  /**
11
15
  * Extension payload that mirrors store plugin config
12
16
  */
13
17
  export interface StorePluginExtensions {
14
18
  middleware?: StoreMiddlewareExtension[];
19
+ /**
20
+ * Factory function for creating middleware that needs the fileSystemAdapter.
21
+ * Called during plugin initialization after the adapter is created.
22
+ */
23
+ middlewareFactory?: MiddlewareFactory;
15
24
  reducers?: Record<string, Reducer>;
16
25
  }
17
26
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"extension-types.d.ts","sourceRoot":"","sources":["../../src/types/extension-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,UAAU,CAAC,EAAE,wBAAwB,EAAE,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,qBAAqB,GAAG,IAAI,CAAC;CACnE"}
1
+ {"version":3,"file":"extension-types.d.ts","sourceRoot":"","sources":["../../src/types/extension-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,iBAAiB,EAAE,GAAG,KAAK,wBAAwB,EAAE,CAAC;AAEvF;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,UAAU,CAAC,EAAE,wBAAwB,EAAE,CAAC;IACxC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,qBAAqB,GAAG,IAAI,CAAC;CACnE"}
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@hamak/ui-store-api",
3
- "version": "0.4.19",
3
+ "version": "0.6.0",
4
4
  "private": false,
5
5
  "type": "module",
6
- "description": "UI Store API - Redux store interfaces and contracts",
6
+ "description": "DEPRECATED: Use @hamak/ui-store/api instead",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
9
9
  "sideEffects": false,
@@ -18,30 +18,22 @@
18
18
  "publishConfig": {
19
19
  "access": "public"
20
20
  },
21
+ "deprecated": "Use @hamak/ui-store/api instead",
21
22
  "scripts": {
22
- "build": "tsc -p tsconfig.json && tsc -p tsconfig.es2015.json",
23
- "clean": "rm -rf dist",
24
- "test": "vitest run",
25
- "test:watch": "vitest"
23
+ "build": "tsc -p tsconfig.json",
24
+ "clean": "rm -rf dist"
26
25
  },
27
26
  "exports": {
28
27
  ".": {
29
28
  "types": "./dist/index.d.ts",
30
29
  "import": "./dist/index.js",
31
- "require": "./dist/es2015/index.js",
32
30
  "default": "./dist/index.js"
33
- },
34
- "./es2015": {
35
- "require": "./dist/es2015/index.js",
36
- "default": "./dist/es2015/index.js"
37
31
  }
38
32
  },
39
33
  "dependencies": {
40
- "@hamak/shared-utils": "*",
41
- "redux": "^5.0.1"
34
+ "@hamak/ui-store": "*"
42
35
  },
43
36
  "devDependencies": {
44
- "typescript": "~5.4.0",
45
- "vitest": "^2.0.0"
37
+ "typescript": "~5.4.0"
46
38
  }
47
39
  }