@akinon/app-shared 0.2.2 → 0.3.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.
- package/dist/events.d.ts +2 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -1
- package/dist/sha256.d.ts +13 -0
- package/dist/sha256.d.ts.map +1 -0
- package/dist/types.d.ts +17 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/events.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,IAAK,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h={},o=async t=>{const s=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(JSON.stringify(t))),n=[],a=new DataView(s);for(let e=0;e<a.byteLength;e+=4)n.push(("00000000"+a.getUint32(e).toString(16)).slice(-8));return n.join("")},i=async t=>(await o(t)).slice(0,7);exports.EVENTS=h;exports.getShortSha256=i;exports.hashValue=o;
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
const c = {}, o = async (t) => {
|
|
2
|
+
const n = await crypto.subtle.digest(
|
|
3
|
+
"SHA-256",
|
|
4
|
+
new TextEncoder().encode(JSON.stringify(t))
|
|
5
|
+
), s = [], a = new DataView(n);
|
|
6
|
+
for (let e = 0; e < a.byteLength; e += 4)
|
|
7
|
+
s.push(("00000000" + a.getUint32(e).toString(16)).slice(-8));
|
|
8
|
+
return s.join("");
|
|
9
|
+
}, h = async (t) => (await o(t)).slice(0, 7);
|
|
10
|
+
export {
|
|
11
|
+
c as EVENTS,
|
|
12
|
+
h as getShortSha256,
|
|
13
|
+
o as hashValue
|
|
14
|
+
};
|
package/dist/sha256.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param val
|
|
4
|
+
* @returns
|
|
5
|
+
*/
|
|
6
|
+
export declare const hashValue: (val: any) => Promise<string>;
|
|
7
|
+
/**
|
|
8
|
+
* Returns the first 7 chars of hashed value. Sohuld be unique.
|
|
9
|
+
*
|
|
10
|
+
* @param val - Any object or value to hash with SHA256.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getShortSha256: (val: any) => Promise<string>;
|
|
13
|
+
//# sourceMappingURL=sha256.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sha256.d.ts","sourceRoot":"","sources":["../src/sha256.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,SAAS,QAAe,GAAG,oBAYvC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,QAAe,GAAG,oBAG5C,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -53,11 +53,15 @@ export interface ApplicationConfig {
|
|
|
53
53
|
*
|
|
54
54
|
* @typedef {Object} FullpageApplicationConfig
|
|
55
55
|
* @extends ApplicationConfig
|
|
56
|
-
* @property {
|
|
57
|
-
*
|
|
56
|
+
* @property {ApplicationNavigation} [navigation] - Navigation object for the
|
|
57
|
+
* client itself. Provides a way for main applications to trigger navigation on
|
|
58
|
+
* fullpage applications.
|
|
59
|
+
* @property {Page[]} [menu] - List of menu items that should be handled by
|
|
60
|
+
* shell applications.
|
|
58
61
|
*/
|
|
59
62
|
export interface FullpageApplicationConfig extends ApplicationConfig {
|
|
60
|
-
|
|
63
|
+
navigation?: ApplicationNavigation;
|
|
64
|
+
menu: Page[];
|
|
61
65
|
}
|
|
62
66
|
/**
|
|
63
67
|
* Configuration settings for plugin applications, which are smaller applications or widgets
|
|
@@ -75,7 +79,7 @@ export interface FullpageApplicationConfig extends ApplicationConfig {
|
|
|
75
79
|
* the host environment.
|
|
76
80
|
*/
|
|
77
81
|
export interface PluginApplicationConfig extends ApplicationConfig {
|
|
78
|
-
placeholderId: string;
|
|
82
|
+
placeholderId: string | string[];
|
|
79
83
|
}
|
|
80
84
|
/**
|
|
81
85
|
* A flexible data structure for storing application data, with string keys and any type of value.
|
|
@@ -110,6 +114,15 @@ export interface ApplicationActions {
|
|
|
110
114
|
export interface ApplicationNavigation {
|
|
111
115
|
navigate: (url: string) => void;
|
|
112
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Defines the structure of an application's parameters.
|
|
119
|
+
* @typedef {Object} ApplicationParams
|
|
120
|
+
* @property {string} [key] - The key of the parameter.
|
|
121
|
+
* @property {string | number | boolean | string[] | number[]} [value] - The value of the parameter.
|
|
122
|
+
*/
|
|
123
|
+
export interface ApplicationParams {
|
|
124
|
+
[key: string]: string | number | boolean | string[] | number[];
|
|
125
|
+
}
|
|
113
126
|
/**
|
|
114
127
|
* Represents a custom event with flexible data structure for storing event-specific data.
|
|
115
128
|
* @typedef {Object} CustomDataEvent
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEtD;;;;;;;;GAQ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EAAE,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAE9B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IAEjC,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IACrE,SAAS,CAAC,EAAE,CACV,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,KAC1D,IAAI,CAAC;IACV,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAE5D,OAAO,EAAE;QAGP,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;KACxC,CAAC;CACH;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;CAChE;AAED;;;GAGG;AAEH,MAAM,MAAM,eAAe,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/app-shared",
|
|
3
3
|
"description": "Shared utilities and helper functions for app-shell and app-client packages.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"dependencies": {},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"clean-package": "2.2.0",
|
|
15
|
+
"eslint-config-custom": "0.1.0",
|
|
15
16
|
"@akinon/vite-config": "^0.1.1",
|
|
16
|
-
"tsconfig": "0.0.0"
|
|
17
|
-
"eslint-config-custom": "0.1.0"
|
|
17
|
+
"tsconfig": "0.0.0"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {},
|
|
20
20
|
"clean-package": "../../clean-package.config.json",
|