@kosdev-code/kos-ui-sdk 2.1.33 → 2.1.34
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/core/core/decorators/index.d.ts +1 -0
- package/core/core/decorators/index.d.ts.map +1 -1
- package/core/core/decorators/kos-multiple-future-aware.d.ts +12 -2
- package/core/core/decorators/kos-multiple-future-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-service-request-helpers.d.ts +58 -0
- package/core/core/decorators/kos-service-request-helpers.d.ts.map +1 -0
- package/core/core/decorators/kos-service-request.d.ts +54 -8
- package/core/core/decorators/kos-service-request.d.ts.map +1 -1
- package/core/core/decorators/kos-view-model.d.ts +162 -0
- package/core/core/decorators/kos-view-model.d.ts.map +1 -0
- package/core/core/decorators/kosModel.d.ts.map +1 -1
- package/core/core/decorators/propKeys.d.ts +3 -0
- package/core/core/decorators/propKeys.d.ts.map +1 -1
- package/core/core/extension/extension-manager.d.ts +13 -3
- package/core/core/extension/extension-manager.d.ts.map +1 -1
- package/core/core/kosCore.d.ts.map +1 -1
- package/core/core/kosModel.d.ts +1 -0
- package/core/core/kosModel.d.ts.map +1 -1
- package/core/core/model/kos-service-request-manager.d.ts.map +1 -1
- package/core/core/transport/base-message-transport.d.ts +22 -2
- package/core/core/transport/base-message-transport.d.ts.map +1 -1
- package/core/core/transport/webSocketTransport.d.ts +1 -6
- package/core/core/transport/webSocketTransport.d.ts.map +1 -1
- package/core/util/ancestor-path-visitor.d.ts +58 -0
- package/core/util/ancestor-path-visitor.d.ts.map +1 -0
- package/core/util/container-utils.d.ts +167 -21
- package/core/util/container-utils.d.ts.map +1 -1
- package/core/util/index.d.ts +1 -0
- package/core/util/index.d.ts.map +1 -1
- package/core/util/kos-config-init.d.ts +1 -0
- package/core/util/kos-config-init.d.ts.map +1 -1
- package/core/util/kos-fetch.d.ts.map +1 -1
- package/core/util/kos-service-request.d.ts +1 -1
- package/core/util/kos-service-request.d.ts.map +1 -1
- package/core/util/observable-proxy-map.d.ts.map +1 -1
- package/core/util/service-factory.d.ts +14 -11
- package/core/util/service-factory.d.ts.map +1 -1
- package/index.cjs +75 -75
- package/index.cjs.map +1 -1
- package/index.js +5576 -5085
- package/index.js.map +1 -1
- package/models/models/future/future-aware.d.ts.map +1 -1
- package/models/models/future/future-types.d.ts +4 -4
- package/models/models/future/future-types.d.ts.map +1 -1
- package/models/models/kos-expression-evaluator/index.d.ts +1 -1
- package/models/models/kos-expression-evaluator/index.d.ts.map +1 -1
- package/models/models/kos-expression-evaluator/kos-expression-evaluator-model.d.ts.map +1 -1
- package/models/models/translation/translation-model.d.ts.map +1 -1
- package/models/models/trouble/index.d.ts +2 -1
- package/models/models/trouble/index.d.ts.map +1 -1
- package/models/models/trouble/services/trouble-services.d.ts +3 -2
- package/models/models/trouble/services/trouble-services.d.ts.map +1 -1
- package/models/utils/client.d.ts +8 -8
- package/models/utils/extension-manager.d.ts +49 -13
- package/models/utils/extension-manager.d.ts.map +1 -1
- package/models/utils/service.d.ts +8 -8
- package/models/utils/services/kos/1.6.5/service.d.ts +8 -8
- package/models/utils/services/kos/1.8.1/service.d.ts +8 -8
- package/models/utils/services/kos/daily/service.d.ts +8 -8
- package/models/utils/services/vfs/1.6.5/service.d.ts +8 -8
- package/models/utils/services/vfs/1.8.1/service.d.ts +8 -8
- package/models/utils/services/vfs/daily/service.d.ts +8 -8
- package/package.json +2 -2
- package/ui/hooks/index.d.ts +1 -0
- package/ui/hooks/index.d.ts.map +1 -1
- package/ui/hooks/view-model/index.d.ts +2 -0
- package/ui/hooks/view-model/index.d.ts.map +1 -0
- package/ui/hooks/view-model/use-view-model.d.ts +80 -0
- package/ui/hooks/view-model/use-view-model.d.ts.map +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kosdev-code/kos-ui-sdk",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.34",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.cjs",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"kos": {
|
|
38
38
|
"build": {
|
|
39
|
-
"gitHash": "
|
|
39
|
+
"gitHash": "009439d0e2ae59f61a2144470b35aa46cfc002ed"
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
}
|
package/ui/hooks/index.d.ts
CHANGED
|
@@ -27,5 +27,6 @@ export * from './use-press-gesture';
|
|
|
27
27
|
export * from './use-project-reloading';
|
|
28
28
|
export * from './use-region-time-props';
|
|
29
29
|
export * from './use-time-props';
|
|
30
|
+
export * from './view-model';
|
|
30
31
|
export * from './with-project-reload';
|
|
31
32
|
//# sourceMappingURL=index.d.ts.map
|
package/ui/hooks/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-ui-sdk/src/ui/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AACtD,cAAc,YAAY,CAAC;AAC3B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,OAAO,CAAC;AACtB,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC9D,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;A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C7B,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/ui/hooks/view-model/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* Configuration options for the useViewModel hook.
|
|
4
|
+
*/
|
|
5
|
+
export interface UseViewModelOptions {
|
|
6
|
+
/**
|
|
7
|
+
* When true, calls the ViewModel's dispose() method on unmount
|
|
8
|
+
* and when dependencies change causing recreation.
|
|
9
|
+
* Default: true (if dispose method exists)
|
|
10
|
+
*/
|
|
11
|
+
disposeOnUnmount?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Result returned by useViewModel when the ViewModel implements IKosViewModelReady.
|
|
15
|
+
*/
|
|
16
|
+
export interface UseViewModelResult<T> {
|
|
17
|
+
/** The ViewModel instance */
|
|
18
|
+
viewModel: T;
|
|
19
|
+
/** Whether the ViewModel's ready() hook has completed */
|
|
20
|
+
ready: boolean;
|
|
21
|
+
/** Error from the ready() hook, if any */
|
|
22
|
+
error: Error | undefined;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* React hook for creating and managing ViewModel instances.
|
|
26
|
+
*
|
|
27
|
+
* The hook:
|
|
28
|
+
* - Creates the ViewModel using the provided factory function
|
|
29
|
+
* - Calls ready() if the ViewModel implements IKosViewModelReady
|
|
30
|
+
* - Automatically calls dispose() on unmount (if the method exists)
|
|
31
|
+
* - Re-creates the ViewModel when dependencies change
|
|
32
|
+
* - Disposes the previous ViewModel when recreating
|
|
33
|
+
*
|
|
34
|
+
* @param factory - Function that creates the ViewModel instance
|
|
35
|
+
* @param deps - Dependency array (similar to useEffect/useMemo)
|
|
36
|
+
* @param options - Optional configuration
|
|
37
|
+
* @returns UseViewModelResult with viewModel, ready state, and error
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* // Basic usage (no ready hook)
|
|
42
|
+
* function Counter() {
|
|
43
|
+
* const { viewModel: vm, ready } = useViewModel(() => new CounterViewModel(), []);
|
|
44
|
+
*
|
|
45
|
+
* return (
|
|
46
|
+
* <div>
|
|
47
|
+
* <span>{vm.count}</span>
|
|
48
|
+
* <button onClick={() => vm.increment()}>+</button>
|
|
49
|
+
* </div>
|
|
50
|
+
* );
|
|
51
|
+
* }
|
|
52
|
+
*
|
|
53
|
+
* // With ready hook for async initialization
|
|
54
|
+
* function OrderSummary({ orderId }: Props) {
|
|
55
|
+
* const { model: order } = useKosModel<IOrderModel>({ modelId: orderId });
|
|
56
|
+
* const { model: inventory } = useKosModel<IInventoryModel>({ modelId: 'inventory' });
|
|
57
|
+
*
|
|
58
|
+
* const { viewModel: vm, ready, error } = useViewModel(
|
|
59
|
+
* () => new OrderSummaryViewModel(order!, inventory!),
|
|
60
|
+
* [order, inventory]
|
|
61
|
+
* );
|
|
62
|
+
*
|
|
63
|
+
* if (error) return <ErrorDisplay error={error} />;
|
|
64
|
+
* if (!ready) return <Loading />;
|
|
65
|
+
*
|
|
66
|
+
* return <div>Total: ${vm.total}</div>;
|
|
67
|
+
* }
|
|
68
|
+
*
|
|
69
|
+
* // Disable auto-disposal
|
|
70
|
+
* const { viewModel: vm } = useViewModel(
|
|
71
|
+
* () => new MyViewModel(),
|
|
72
|
+
* [],
|
|
73
|
+
* { disposeOnUnmount: false }
|
|
74
|
+
* );
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* @category KOS React Hook
|
|
78
|
+
*/
|
|
79
|
+
export declare function useViewModel<T>(factory: () => T, deps: React.DependencyList, options?: UseViewModelOptions): UseViewModelResult<T>;
|
|
80
|
+
//# sourceMappingURL=use-view-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-view-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/ui/hooks/view-model/use-view-model.ts"],"names":[],"mappings":";AAMA;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACnC,6BAA6B;IAC7B,SAAS,EAAE,CAAC,CAAC;IACb,yDAAyD;IACzD,KAAK,EAAE,OAAO,CAAC;IACf,0CAA0C;IAC1C,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,OAAO,EAAE,MAAM,CAAC,EAChB,IAAI,EAAE,KAAK,CAAC,cAAc,EAC1B,OAAO,GAAE,mBAAwB,GAChC,kBAAkB,CAAC,CAAC,CAAC,CAoFvB"}
|