@actdim/dynstruct 1.0.3 → 1.0.7
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/dist/appDomain/appContracts.d.ts +10 -8
- package/dist/appDomain/appContracts.d.ts.map +1 -1
- package/dist/appDomain/appContracts.es.js +10 -8
- package/dist/appDomain/appContracts.es.js.map +1 -1
- package/dist/appDomain/security/securityContracts.d.ts +3 -3
- package/dist/appDomain/security/securityContracts.d.ts.map +1 -1
- package/dist/appDomain/security/securityContracts.es.js.map +1 -1
- package/dist/appDomain/security/securityProvider.d.ts +2 -2
- package/dist/appDomain/security/securityProvider.es.js.map +1 -1
- package/dist/componentModel/DynamicContent.d.ts +14 -0
- package/dist/componentModel/DynamicContent.d.ts.map +1 -0
- package/dist/componentModel/DynamicContent.es.js +14 -0
- package/dist/componentModel/DynamicContent.es.js.map +1 -0
- package/dist/componentModel/adapters.d.ts +13 -0
- package/dist/componentModel/adapters.d.ts.map +1 -0
- package/dist/componentModel/adapters.es.js +30 -0
- package/dist/componentModel/adapters.es.js.map +1 -0
- package/dist/componentModel/componentContext.d.ts +8 -0
- package/dist/componentModel/componentContext.d.ts.map +1 -0
- package/dist/componentModel/componentContext.es.js +77 -0
- package/dist/componentModel/componentContext.es.js.map +1 -0
- package/dist/componentModel/componentModel.d.ts +67 -49
- package/dist/componentModel/componentModel.d.ts.map +1 -1
- package/dist/componentModel/componentModel.es.js +253 -164
- package/dist/componentModel/componentModel.es.js.map +1 -1
- package/dist/componentModel/contracts.d.ts +22 -0
- package/dist/componentModel/contracts.d.ts.map +1 -0
- package/dist/componentModel/contracts.es.js +2 -0
- package/dist/componentModel/contracts.es.js.map +1 -0
- package/dist/componentModel/scope.d.ts +3 -6
- package/dist/componentModel/scope.d.ts.map +1 -1
- package/dist/componentModel/scope.es.js +2 -2
- package/dist/componentModel/scope.es.js.map +1 -1
- package/dist/net/client.es.js.map +1 -1
- package/dist/services/NavService.d.ts +16 -0
- package/dist/services/NavService.d.ts.map +1 -0
- package/dist/services/NavService.es.js +64 -0
- package/dist/services/NavService.es.js.map +1 -0
- package/dist/services/ServiceProvider.d.ts +6 -0
- package/dist/services/ServiceProvider.d.ts.map +1 -0
- package/dist/services/ServiceProvider.es.js +17 -0
- package/dist/services/ServiceProvider.es.js.map +1 -0
- package/dist/services/StorageService.d.ts +15 -0
- package/dist/services/StorageService.d.ts.map +1 -0
- package/dist/services/StorageService.es.js +55 -0
- package/dist/services/StorageService.es.js.map +1 -0
- package/package.json +4 -5
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { getFC as i, useComponent as l } from "../componentModel/componentModel.es.js";
|
|
2
|
+
import { PersistentStore as y } from "@actdim/utico/store/persistentStore";
|
|
3
|
+
const m = (s) => {
|
|
4
|
+
let t, o;
|
|
5
|
+
async function c() {
|
|
6
|
+
a = await y.openAsync(o.name);
|
|
7
|
+
}
|
|
8
|
+
let a, r;
|
|
9
|
+
const n = new Promise((e) => {
|
|
10
|
+
r = e;
|
|
11
|
+
});
|
|
12
|
+
return t = l({
|
|
13
|
+
props: {
|
|
14
|
+
name: ""
|
|
15
|
+
},
|
|
16
|
+
msgBroker: {
|
|
17
|
+
provide: {
|
|
18
|
+
"APP-KV-STORE-GET": {
|
|
19
|
+
in: {
|
|
20
|
+
callback: async (e) => (await n, (await a.getAsync(e.payload.key))?.data.value)
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"APP-KV-STORE-SET": {
|
|
24
|
+
in: {
|
|
25
|
+
callback: async (e) => {
|
|
26
|
+
await n, await a.setAsync(
|
|
27
|
+
{
|
|
28
|
+
key: e.payload.key
|
|
29
|
+
},
|
|
30
|
+
e.payload.value
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"APP-KV-STORE-REMOVE": {
|
|
36
|
+
in: {
|
|
37
|
+
callback: async (e) => {
|
|
38
|
+
await n, await a.deleteAsync(e.payload.key);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
events: {
|
|
45
|
+
onChangeName: () => {
|
|
46
|
+
c();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}, s), o = t.model, c().then(() => r()), t;
|
|
50
|
+
}, u = i(m);
|
|
51
|
+
export {
|
|
52
|
+
u as StorageServiceFC,
|
|
53
|
+
m as useStorageService
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=StorageService.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorageService.es.js","sources":["../../src/services/StorageService.tsx"],"sourcesContent":["import {\r\n ComponentParams,\r\n ComponentStruct,\r\n getFC,\r\n useComponent,\r\n Component,\r\n ComponentModel,\r\n} from '@/componentModel/componentModel';\r\nimport { PersistentStore } from '@actdim/utico/store/persistentStore';\r\nimport { BaseAppMsgChannels, BaseAppMsgStruct, useBaseAppContext } from '@/appDomain/appContracts';\r\nimport type { ComponentDef } from '@/componentModel/componentModel';\r\n\r\ntype Struct = ComponentStruct<\r\n BaseAppMsgStruct,\r\n {\r\n props: {\r\n name?: string;\r\n };\r\n msgScope: {\r\n provide: BaseAppMsgChannels<\r\n 'APP-KV-STORE-GET' | 'APP-KV-STORE-SET' | 'APP-KV-STORE-REMOVE'\r\n >;\r\n };\r\n }\r\n>;\r\n\r\nexport const useStorageService = (params: ComponentParams<Struct>) => {\r\n let c: Component<Struct>;\r\n let m: ComponentModel<Struct>;\r\n\r\n async function _updateStoreAsync() {\r\n store = await PersistentStore.openAsync(m.name);\r\n }\r\n\r\n let store: PersistentStore;\r\n let ready: () => void;\r\n const init = new Promise<void>((res) => {\r\n ready = res;\r\n });\r\n\r\n const def: ComponentDef<Struct> = {\r\n props: {\r\n name: '',\r\n },\r\n msgBroker: {\r\n provide: {\r\n 'APP-KV-STORE-GET': {\r\n in: {\r\n callback: async (msg) => {\r\n await init;\r\n const item = await store.getAsync(msg.payload.key);\r\n return item?.data.value;\r\n },\r\n },\r\n },\r\n 'APP-KV-STORE-SET': {\r\n in: {\r\n callback: async (msg) => {\r\n await init;\r\n await store.setAsync(\r\n {\r\n key: msg.payload.key,\r\n },\r\n msg.payload.value,\r\n );\r\n },\r\n },\r\n },\r\n 'APP-KV-STORE-REMOVE': {\r\n in: {\r\n callback: async (msg) => {\r\n await init;\r\n await store.deleteAsync(msg.payload.key);\r\n },\r\n },\r\n },\r\n },\r\n },\r\n events: {\r\n onChangeName: () => {\r\n _updateStoreAsync();\r\n },\r\n },\r\n };\r\n\r\n c = useComponent(def, params);\r\n m = c.model;\r\n _updateStoreAsync().then(() => ready());\r\n return c;\r\n};\r\n\r\nexport type StorageServiceStruct = Struct;\r\nexport const StorageServiceFC = getFC(useStorageService);\r\n"],"names":["useStorageService","params","c","m","_updateStoreAsync","store","PersistentStore","ready","init","res","useComponent","msg","StorageServiceFC","getFC"],"mappings":";;AA0BO,MAAMA,IAAoB,CAACC,MAAoC;AAClE,MAAIC,GACAC;AAEJ,iBAAeC,IAAoB;AAC/B,IAAAC,IAAQ,MAAMC,EAAgB,UAAUH,EAAE,IAAI;AAAA,EAClD;AAEA,MAAIE,GACAE;AACJ,QAAMC,IAAO,IAAI,QAAc,CAACC,MAAQ;AACpC,IAAAF,IAAQE;AAAA,EACZ,CAAC;AA+CD,SAAAP,IAAIQ,EA7C8B;AAAA,IAC9B,OAAO;AAAA,MACH,MAAM;AAAA,IAAA;AAAA,IAEV,WAAW;AAAA,MACP,SAAS;AAAA,QACL,oBAAoB;AAAA,UAChB,IAAI;AAAA,YACA,UAAU,OAAOC,OACb,MAAMH,IACO,MAAMH,EAAM,SAASM,EAAI,QAAQ,GAAG,IACpC,KAAK;AAAA,UACtB;AAAA,QACJ;AAAA,QAEJ,oBAAoB;AAAA,UAChB,IAAI;AAAA,YACA,UAAU,OAAOA,MAAQ;AACrB,oBAAMH,GACN,MAAMH,EAAM;AAAA,gBACR;AAAA,kBACI,KAAKM,EAAI,QAAQ;AAAA,gBAAA;AAAA,gBAErBA,EAAI,QAAQ;AAAA,cAAA;AAAA,YAEpB;AAAA,UAAA;AAAA,QACJ;AAAA,QAEJ,uBAAuB;AAAA,UACnB,IAAI;AAAA,YACA,UAAU,OAAOA,MAAQ;AACrB,oBAAMH,GACN,MAAMH,EAAM,YAAYM,EAAI,QAAQ,GAAG;AAAA,YAC3C;AAAA,UAAA;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,IAEJ,QAAQ;AAAA,MACJ,cAAc,MAAM;AAChB,QAAAP,EAAA;AAAA,MACJ;AAAA,IAAA;AAAA,EACJ,GAGkBH,CAAM,GAC5BE,IAAID,EAAE,OACNE,IAAoB,KAAK,MAAMG,GAAO,GAC/BL;AACX,GAGaU,IAAmBC,EAAMb,CAAiB;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@actdim/dynstruct",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "A type-safe component system for large-scale apps: explicit dependencies, message bus communication, and structure-first, declarative design",
|
|
5
5
|
"author": "Pavel Borodaev",
|
|
6
6
|
"license": "Proprietary",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"sideEffects": false,
|
|
52
52
|
"sideEffects?": [],
|
|
53
|
+
"packageManager": "pnpm@10.21.0",
|
|
53
54
|
"scripts": {
|
|
54
55
|
"test": "npx vitest --config=vitest.node.config.ts --no-cache",
|
|
55
56
|
"test:w": "npx vitest --config=vitest.node.config.ts --watch",
|
|
@@ -69,15 +70,13 @@
|
|
|
69
70
|
"build-storybook": "storybook build"
|
|
70
71
|
},
|
|
71
72
|
"peerDependencies": {
|
|
72
|
-
"@actdim/msgmesh": "^1.
|
|
73
|
-
"@actdim/utico": "^1.0.
|
|
74
|
-
"dexie": "^4.2.0",
|
|
73
|
+
"@actdim/msgmesh": "^1.1.7",
|
|
74
|
+
"@actdim/utico": "^1.0.6",
|
|
75
75
|
"http-status": "^2.1.0",
|
|
76
76
|
"jwt-decode": "^4.0.0",
|
|
77
77
|
"mobx": "^6.15.0",
|
|
78
78
|
"mobx-react-lite": "^4.1.1",
|
|
79
79
|
"mobx-utils": "^6.1.1",
|
|
80
|
-
"moment": "^2.30.1",
|
|
81
80
|
"path-to-regexp": "^8.3.0",
|
|
82
81
|
"react": "^19.2.0",
|
|
83
82
|
"react-dom": "^19.2.0",
|