@akinon/app-client 0.1.4 → 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/README.md +0 -3
- package/dist/app-client-provider.d.ts +17 -0
- package/dist/app-client-provider.d.ts.map +1 -0
- package/dist/index.cjs +1 -303
- package/dist/index.d.ts +1 -98
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +358 -30765
- package/package.json +6 -7
- package/dist/components/button.d.ts +0 -4
- package/dist/components/button.d.ts.map +0 -1
- package/dist/components/card.d.ts +0 -4
- package/dist/components/card.d.ts.map +0 -1
- package/dist/components/checkbox.d.ts +0 -1
- package/dist/components/checkbox.d.ts.map +0 -1
- package/dist/components/collapse.d.ts +0 -1
- package/dist/components/collapse.d.ts.map +0 -1
- package/dist/components/divider.d.ts +0 -1
- package/dist/components/divider.d.ts.map +0 -1
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/input.d.ts +0 -1
- package/dist/components/input.d.ts.map +0 -1
- package/dist/components/radio.d.ts +0 -1
- package/dist/components/radio.d.ts.map +0 -1
- package/dist/components/select.d.ts +0 -1
- package/dist/components/select.d.ts.map +0 -1
- package/dist/components/spin.d.ts +0 -1
- package/dist/components/spin.d.ts.map +0 -1
- package/dist/components/switch.d.ts +0 -1
- package/dist/components/switch.d.ts.map +0 -1
- package/dist/components/table.d.ts +0 -1
- package/dist/components/table.d.ts.map +0 -1
- package/dist/components/typography.d.ts +0 -1
- package/dist/components/typography.d.ts.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,99 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export type HandshakeCallMapFunctions = {
|
|
4
|
-
[K in keyof HandshakeCallMap]: (data: HandshakeCallMap[K]) => void;
|
|
5
|
-
};
|
|
6
|
-
export interface ClientApi {
|
|
7
|
-
model: ParentModel;
|
|
8
|
-
/**
|
|
9
|
-
* Emits an event to the parent
|
|
10
|
-
*
|
|
11
|
-
* @param name the name of the event
|
|
12
|
-
* @param data event data
|
|
13
|
-
*/
|
|
14
|
-
emit: <Name extends keyof HandshakeEmitMap>(name: Name, data: HandshakeEmitMap[Name]) => void;
|
|
15
|
-
}
|
|
16
|
-
type AppState = {
|
|
17
|
-
appId: string;
|
|
18
|
-
appConfig: AppConfig | null;
|
|
19
|
-
clientApi: ClientApi | null;
|
|
20
|
-
currentAction: ConfirmActionEvent | null;
|
|
21
|
-
customPath?: string | null;
|
|
22
|
-
};
|
|
23
|
-
export type StateAction = {
|
|
24
|
-
type: 'RESET';
|
|
25
|
-
} | {
|
|
26
|
-
type: 'SET_APP_CONFIG';
|
|
27
|
-
payload: AppConfig;
|
|
28
|
-
} | {
|
|
29
|
-
type: 'SET_CLIENT_API';
|
|
30
|
-
payload: ClientApi;
|
|
31
|
-
} | {
|
|
32
|
-
type: 'SET_CURRENT_ACTION';
|
|
33
|
-
payload: ConfirmActionEvent;
|
|
34
|
-
} | {
|
|
35
|
-
type: 'OPEN_RICH_MODAL';
|
|
36
|
-
payload: {
|
|
37
|
-
path: string;
|
|
38
|
-
};
|
|
39
|
-
} | {
|
|
40
|
-
type: 'SET_CURRENT_ACTION';
|
|
41
|
-
payload: ConfirmActionEvent;
|
|
42
|
-
};
|
|
43
|
-
export type Actions = {
|
|
44
|
-
reset: () => void;
|
|
45
|
-
setAppConfig: (payload: AppConfig) => void;
|
|
46
|
-
setClientApi: (payload: ClientApi) => void;
|
|
47
|
-
confirmAction: (payload: ConfirmActionEvent) => void;
|
|
48
|
-
navigate: (payload: HandshakeEmitMap['navigateViaChild']) => void;
|
|
49
|
-
notify: (payload: HandshakeEmitMap['notify']) => void;
|
|
50
|
-
message: (payload: HandshakeEmitMap['message']) => void;
|
|
51
|
-
openRichModal: (payload: HandshakeEmitMap['openRichModal']) => void;
|
|
52
|
-
};
|
|
53
|
-
interface AppWideContextType {
|
|
54
|
-
state: AppState;
|
|
55
|
-
actions: Actions;
|
|
56
|
-
}
|
|
57
|
-
export interface AppClientConfig {
|
|
58
|
-
/**
|
|
59
|
-
* Whether or not the application is running in development mode.
|
|
60
|
-
*/
|
|
61
|
-
isDev?: boolean;
|
|
62
|
-
/**
|
|
63
|
-
* The type of the application.
|
|
64
|
-
* This is determined how the application is displayed in the Omnitron.
|
|
65
|
-
*/
|
|
66
|
-
appType?: RegisteredApp['appType'];
|
|
67
|
-
/**
|
|
68
|
-
* The id of the placeholder element that will be replaced by the application.
|
|
69
|
-
* This only works for plugin type clients.
|
|
70
|
-
*/
|
|
71
|
-
placeholderId?: string;
|
|
72
|
-
/**
|
|
73
|
-
* If set to `true`, AppClient will detect when your application is loaded
|
|
74
|
-
* outside of the Omnitron and will redirect you to the Omnitron instance
|
|
75
|
-
* that embeds your application.
|
|
76
|
-
*/
|
|
77
|
-
forceRedirect?: boolean;
|
|
78
|
-
/**
|
|
79
|
-
* The height of the application.
|
|
80
|
-
* This is used to set the height of the iframe that embeds your application.
|
|
81
|
-
* TODO: We don't need this. Remove it.
|
|
82
|
-
*/
|
|
83
|
-
height?: string;
|
|
84
|
-
/**
|
|
85
|
-
* Declare pages of the client that will be displayed in the navbar of the shell.
|
|
86
|
-
*/
|
|
87
|
-
pages?: Page[];
|
|
88
|
-
}
|
|
89
|
-
export interface AppClientProviderProps {
|
|
90
|
-
/**
|
|
91
|
-
* The configuration for the AppClient.
|
|
92
|
-
*/
|
|
93
|
-
config: AppClientConfig;
|
|
94
|
-
children: React.ReactNode;
|
|
95
|
-
}
|
|
96
|
-
export declare const AppClientProvider: (props: AppClientProviderProps) => React.JSX.Element;
|
|
97
|
-
export declare const useAppClient: () => AppWideContextType;
|
|
98
|
-
export * from './components';
|
|
1
|
+
export * from './app-client-provider';
|
|
99
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|