chayns-api 1.1.0-3 → 1.1.0-4
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/cjs/calls/dialogs/chaynsDialog.js +3 -6
- package/dist/cjs/calls/dialogs/date.js +29 -2
- package/dist/cjs/calls/dialogs/fileSelect.js +1 -2
- package/dist/cjs/calls/dialogs/input.js +2 -3
- package/dist/cjs/calls/dialogs/select.js +2 -3
- package/dist/cjs/calls/getUserInfo.js +1 -2
- package/dist/cjs/calls/index.js +93 -82
- package/dist/cjs/components/AppDialogWrapper.js +7 -7
- package/dist/cjs/components/ChaynsContext.js +2 -4
- package/dist/cjs/components/ChaynsProvider.js +10 -13
- package/dist/cjs/components/ErrorBoundary.js +31 -0
- package/dist/cjs/components/moduleWrapper.js +9 -0
- package/dist/cjs/components/withCompatMode.js +8 -7
- package/dist/cjs/components/withHydrationBoundary.js +57 -0
- package/dist/cjs/constants/hydrationContext.js +16 -0
- package/dist/cjs/constants/index.js +16 -0
- package/dist/cjs/handler/DialogHandler.js +4 -2
- package/dist/cjs/hooks/useAccessToken.js +1 -0
- package/dist/cjs/hooks/useDialogState.js +2 -2
- package/dist/cjs/hooks/usePages.js +2 -2
- package/dist/cjs/host/ChaynsHost.js +1 -2
- package/dist/cjs/host/iframe/HostIframe.js +4 -6
- package/dist/cjs/host/iframe/utils/useUpdateData.js +1 -2
- package/dist/cjs/host/module/ModuleHost.js +8 -24
- package/dist/cjs/host/module/utils/loadComponent.js +58 -51
- package/dist/cjs/index.js +48 -5
- package/dist/cjs/types/IChaynsReact.js +140 -107
- package/dist/cjs/util/appCall.js +3 -4
- package/dist/cjs/util/deviceHelper.js +18 -13
- package/dist/cjs/util/transferNestedFunctions.js +36 -0
- package/dist/cjs/wrapper/AppWrapper.js +69 -11
- package/dist/cjs/wrapper/FrameWrapper.js +16 -5
- package/dist/cjs/wrapper/StaticChaynsApi.js +22 -0
- package/dist/esm/calls/index.js +22 -1
- package/dist/esm/components/AppDialogWrapper.js +4 -3
- package/dist/esm/components/ChaynsProvider.js +6 -7
- package/dist/esm/components/ErrorBoundary.js +23 -0
- package/dist/esm/components/moduleWrapper.js +3 -0
- package/dist/esm/components/withCompatMode.js +5 -4
- package/dist/esm/components/withHydrationBoundary.js +50 -0
- package/dist/esm/constants/hydrationContext.js +10 -0
- package/dist/esm/constants/index.js +1 -0
- package/dist/esm/handler/DialogHandler.js +6 -4
- package/dist/esm/hooks/useAccessToken.js +1 -0
- package/dist/esm/hooks/useDialogState.js +2 -2
- package/dist/esm/hooks/usePages.js +1 -1
- package/dist/esm/host/iframe/HostIframe.js +1 -2
- package/dist/esm/host/module/ModuleHost.js +5 -20
- package/dist/esm/host/module/utils/loadComponent.js +58 -50
- package/dist/esm/index.js +6 -1
- package/dist/esm/types/IChaynsReact.js +142 -87
- package/dist/esm/util/appCall.js +2 -2
- package/dist/esm/util/deviceHelper.js +17 -11
- package/dist/esm/util/transferNestedFunctions.js +32 -0
- package/dist/esm/wrapper/AppWrapper.js +70 -11
- package/dist/esm/wrapper/FrameWrapper.js +16 -5
- package/dist/esm/wrapper/StaticChaynsApi.js +20 -0
- package/dist/types/calls/index.d.ts +19 -5
- package/dist/types/components/AppDialogWrapper.d.ts +2 -2
- package/dist/types/components/ChaynsProvider.d.ts +1 -4
- package/dist/types/components/ErrorBoundary.d.ts +13 -0
- package/dist/types/components/moduleWrapper.d.ts +4 -0
- package/dist/types/components/withHydrationBoundary.d.ts +16 -0
- package/dist/types/constants/hydrationContext.d.ts +8 -0
- package/dist/types/constants/index.d.ts +1 -0
- package/dist/types/handler/DialogHandler.d.ts +0 -1
- package/dist/types/hooks/useAccessToken.d.ts +1 -0
- package/dist/types/host/module/ModuleHost.d.ts +1 -0
- package/dist/types/host/module/utils/loadComponent.d.ts +1 -1
- package/dist/types/index.d.ts +6 -1
- package/dist/types/types/IChaynsReact.d.ts +136 -28
- package/dist/types/util/deviceHelper.d.ts +2 -2
- package/dist/types/util/transferNestedFunctions.d.ts +1 -0
- package/dist/types/wrapper/StaticChaynsApi.d.ts +9 -0
- package/package.json +25 -21
- package/toolkit.config.js +20 -0
|
@@ -5,13 +5,67 @@ export type DialogButton = {
|
|
|
5
5
|
type: DialogButtonType;
|
|
6
6
|
text: string;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export declare enum DateType {
|
|
9
|
+
DATE = 0,
|
|
10
|
+
TIME = 1,
|
|
11
|
+
DATE_TIME = 2
|
|
12
|
+
}
|
|
13
|
+
export interface DialogDate {
|
|
14
|
+
type: DialogType.DATE;
|
|
15
|
+
minDate: Date;
|
|
16
|
+
maxDate: Date;
|
|
17
|
+
minDuration?: number;
|
|
18
|
+
minuteInterval?: number;
|
|
19
|
+
preselect?: Date;
|
|
20
|
+
dateType?: DateType;
|
|
21
|
+
multiselect?: boolean;
|
|
22
|
+
monthSelect?: boolean;
|
|
23
|
+
yearSelect?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare enum ToastType {
|
|
26
|
+
NEUTRAL = 1,
|
|
27
|
+
SUCCESS = 2,
|
|
28
|
+
WARNING = 3,
|
|
29
|
+
ERROR = 4
|
|
30
|
+
}
|
|
31
|
+
export interface DialogToast {
|
|
32
|
+
type: DialogType.TOAST;
|
|
33
|
+
icon?: string;
|
|
34
|
+
showDurationBar?: boolean;
|
|
35
|
+
duration?: number;
|
|
36
|
+
linkText?: string;
|
|
37
|
+
onLinkClick?: () => void;
|
|
38
|
+
permanent?: boolean;
|
|
39
|
+
showCloseIcon?: boolean;
|
|
40
|
+
toastType?: ToastType;
|
|
41
|
+
}
|
|
42
|
+
export interface DialogFileSelect {
|
|
43
|
+
type: DialogType.FILE_SELECT;
|
|
44
|
+
multiselect?: boolean;
|
|
45
|
+
contentType?: Array<string> | string;
|
|
46
|
+
exclude?: Array<string> | string;
|
|
47
|
+
directory?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface DialogConfirm {
|
|
50
|
+
type: DialogType.CONFIRM;
|
|
51
|
+
}
|
|
52
|
+
export interface DialogAlert {
|
|
53
|
+
type: DialogType.ALERT;
|
|
54
|
+
}
|
|
55
|
+
export interface BaseDialog {
|
|
9
56
|
text?: string;
|
|
10
57
|
buttons?: DialogButton[];
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
58
|
+
width?: string | number;
|
|
59
|
+
animation?: {
|
|
60
|
+
type: DialogAnimation;
|
|
61
|
+
config?: any;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export type Dialog = BaseDialog & (DialogAlert | DialogConfirm | DialogInput | DialogModule | DialogIFrame | DialogSelect | DialogDate | DialogToast | DialogFileSelect | DialogSignature);
|
|
65
|
+
export interface DialogSignature {
|
|
66
|
+
type: DialogType.SIGNATURE;
|
|
67
|
+
}
|
|
68
|
+
export interface DialogModule {
|
|
15
69
|
type: DialogType.MODULE;
|
|
16
70
|
system: {
|
|
17
71
|
url: string;
|
|
@@ -19,27 +73,48 @@ export type DialogModule = {
|
|
|
19
73
|
scope: string;
|
|
20
74
|
};
|
|
21
75
|
dialogInput: object;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export type DialogIFrame = {
|
|
76
|
+
}
|
|
77
|
+
export interface DialogIFrame {
|
|
25
78
|
type: DialogType.IFRAME;
|
|
26
79
|
url: string;
|
|
27
80
|
dialogInput: object;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
81
|
+
}
|
|
82
|
+
export declare enum DialogInputType {
|
|
83
|
+
NUMBER = "number",
|
|
84
|
+
PASSWORD = "password",
|
|
85
|
+
TELEPHONE = "tel",
|
|
86
|
+
TEXT = "text",
|
|
87
|
+
TEXTAREA = "textarea"
|
|
88
|
+
}
|
|
89
|
+
export interface DialogInput {
|
|
31
90
|
type: DialogType.INPUT;
|
|
32
91
|
placeholder: string;
|
|
92
|
+
inputType: DialogInputType;
|
|
93
|
+
defaultValue?: string;
|
|
94
|
+
formatter?: (input: string) => string;
|
|
95
|
+
}
|
|
96
|
+
export declare enum DialogSelectType {
|
|
97
|
+
DEFAULT = 0,
|
|
98
|
+
ICON = 1,
|
|
99
|
+
IMAGE = 2
|
|
100
|
+
}
|
|
101
|
+
export type DialogSelectListItemType = {
|
|
102
|
+
id: number;
|
|
103
|
+
name: string;
|
|
104
|
+
disabled?: boolean;
|
|
105
|
+
isSelected?: boolean;
|
|
106
|
+
url?: string;
|
|
107
|
+
className?: string;
|
|
33
108
|
};
|
|
34
|
-
export
|
|
109
|
+
export interface DialogSelect {
|
|
35
110
|
type: DialogType.SELECT;
|
|
36
|
-
list:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
111
|
+
list: DialogSelectListItemType[];
|
|
112
|
+
multiselect?: boolean;
|
|
113
|
+
quickfind?: boolean;
|
|
114
|
+
selectType?: DialogSelectType;
|
|
115
|
+
preventCloseOnClick?: boolean;
|
|
116
|
+
selectAllCheckbox?: string;
|
|
117
|
+
}
|
|
43
118
|
export declare enum DialogButtonType {
|
|
44
119
|
OK = 1,
|
|
45
120
|
CANCEL = -1,
|
|
@@ -104,9 +179,7 @@ export type DialogHookResult = {
|
|
|
104
179
|
addDataListener: ChaynsReactFunctions["addDialogHostEventListener"];
|
|
105
180
|
};
|
|
106
181
|
export type DialogDataHookResult = {
|
|
107
|
-
|
|
108
|
-
[key: string | symbol]: object;
|
|
109
|
-
};
|
|
182
|
+
[key: string | symbol]: object;
|
|
110
183
|
};
|
|
111
184
|
/**
|
|
112
185
|
* @ignore
|
|
@@ -131,7 +204,7 @@ export interface ChaynsReactValues {
|
|
|
131
204
|
* keys are in lower case
|
|
132
205
|
*/
|
|
133
206
|
parameters: {
|
|
134
|
-
[key: string | symbol]: string;
|
|
207
|
+
[key: string | symbol]: string | string[];
|
|
135
208
|
};
|
|
136
209
|
environment: {
|
|
137
210
|
buildEnvironment: Environment;
|
|
@@ -155,6 +228,7 @@ export interface ChaynsReactFunctions {
|
|
|
155
228
|
throttle?: number;
|
|
156
229
|
}, callback: (result: ScrollListenerResult) => void) => Promise<number>;
|
|
157
230
|
addVisibilityChangeListener: (callback: (result: VisibilityChangeListenerResult) => void) => Promise<number>;
|
|
231
|
+
addToolbarChangeListener: (callback: (result: ToolbarChangeListenerResult) => void) => Promise<number>;
|
|
158
232
|
addWindowMetricsListener: (callback: (result: WindowMetricsListenerResult) => void) => Promise<number>;
|
|
159
233
|
customCallbackFunction: (type: string, data: unknown) => Promise<unknown>;
|
|
160
234
|
getAvailableSharingServices: () => Promise<AvailableSharingServices>;
|
|
@@ -174,11 +248,13 @@ export interface ChaynsReactFunctions {
|
|
|
174
248
|
openImage: (value: OpenImage) => Promise<void>;
|
|
175
249
|
openUrl: (value: OpenUrl) => Promise<void>;
|
|
176
250
|
openVideo: (value: OpenVideo) => Promise<void>;
|
|
251
|
+
openMedia: (value: OpenMedia) => Promise<void>;
|
|
177
252
|
refreshData: (value: RefreshData) => Promise<void>;
|
|
178
253
|
refreshAccessToken: () => Promise<void>;
|
|
179
254
|
removeGeoLocationListener: (value: number) => Promise<void>;
|
|
180
255
|
removeScrollListener: (value: number) => Promise<void>;
|
|
181
256
|
removeVisibilityChangeListener: (value: number) => Promise<void>;
|
|
257
|
+
removeToolbarChangeListener: (value: number) => Promise<void>;
|
|
182
258
|
removeWindowMetricsListener: (value: number) => Promise<void>;
|
|
183
259
|
selectPage: (value: SelectPage) => Promise<void>;
|
|
184
260
|
scrollToY: (position: number, duration: number) => Promise<void>;
|
|
@@ -202,7 +278,7 @@ export interface ChaynsReactFunctions {
|
|
|
202
278
|
createDialog: (config: Dialog) => DialogHandler;
|
|
203
279
|
openDialog: (value: any, callback: (data: any) => any) => Promise<any>;
|
|
204
280
|
closeDialog: (dialogId: number) => Promise<void>;
|
|
205
|
-
setDialogResult: (result: any) => Promise<void>;
|
|
281
|
+
setDialogResult: (buttonType: DialogButtonType, result: any) => Promise<void>;
|
|
206
282
|
dispatchEventToDialogClient: (dialogId: number, data: object) => Promise<void>;
|
|
207
283
|
addDialogClientEventListener: (dialogId: number, callback: (data: object) => void) => Promise<number>;
|
|
208
284
|
removeDialogClientEventListener: (dialogId: number, id: number) => Promise<void>;
|
|
@@ -430,7 +506,7 @@ export type UserInfoQuery = {
|
|
|
430
506
|
personId?: string;
|
|
431
507
|
userId: number;
|
|
432
508
|
};
|
|
433
|
-
type OpenImageItem = {
|
|
509
|
+
export type OpenImageItem = {
|
|
434
510
|
url: string;
|
|
435
511
|
title?: string;
|
|
436
512
|
description?: string;
|
|
@@ -512,10 +588,11 @@ export interface RefreshScrollEnabled {
|
|
|
512
588
|
isEnabled: boolean;
|
|
513
589
|
}
|
|
514
590
|
export interface GeoLocation {
|
|
515
|
-
accuracy: number | null;
|
|
516
591
|
latitude: number;
|
|
517
592
|
longitude: number;
|
|
518
593
|
speed: number;
|
|
594
|
+
accuracy: number | null;
|
|
595
|
+
isAccurate: boolean | null;
|
|
519
596
|
code: number;
|
|
520
597
|
}
|
|
521
598
|
export type DataChangeValue = {
|
|
@@ -553,6 +630,10 @@ export interface VisibilityChangeListenerResult {
|
|
|
553
630
|
isVisible: boolean;
|
|
554
631
|
tappEvent: TappEvent;
|
|
555
632
|
}
|
|
633
|
+
export interface ToolbarChangeListenerResult {
|
|
634
|
+
isVisible: boolean;
|
|
635
|
+
toolbarHeight: number;
|
|
636
|
+
}
|
|
556
637
|
export interface ScrollListenerResult {
|
|
557
638
|
scrollX: number | null;
|
|
558
639
|
scrollY: number | null;
|
|
@@ -633,7 +714,10 @@ export declare enum AppName {
|
|
|
633
714
|
Chayns = 2,
|
|
634
715
|
Location = 3,
|
|
635
716
|
Intercom = 4,
|
|
636
|
-
ChaynsLauncher = 5
|
|
717
|
+
ChaynsLauncher = 5,
|
|
718
|
+
TobitChat = 6,
|
|
719
|
+
Sidekick = 7,
|
|
720
|
+
Team = 8
|
|
637
721
|
}
|
|
638
722
|
export declare enum BrowserName {
|
|
639
723
|
Unknown = "unknown",
|
|
@@ -703,6 +787,30 @@ export declare enum DialogType {
|
|
|
703
787
|
MODULE = "module",
|
|
704
788
|
INPUT = "input",
|
|
705
789
|
SELECT = "select",
|
|
706
|
-
TOAST = "toast"
|
|
790
|
+
TOAST = "toast",
|
|
791
|
+
SIGNATURE = "signature"
|
|
792
|
+
}
|
|
793
|
+
export declare enum MediaType {
|
|
794
|
+
IMAGE = "image",
|
|
795
|
+
VIDEO = "video"
|
|
796
|
+
}
|
|
797
|
+
export type OpenMediaItem = {
|
|
798
|
+
url: string;
|
|
799
|
+
title?: string;
|
|
800
|
+
description?: string;
|
|
801
|
+
preventCache?: boolean;
|
|
802
|
+
mediaType: MediaType;
|
|
803
|
+
};
|
|
804
|
+
export type OpenMedia = {
|
|
805
|
+
items: [OpenMediaItem, ...OpenMediaItem[]];
|
|
806
|
+
startIndex?: number;
|
|
807
|
+
};
|
|
808
|
+
export declare enum DialogAnimation {
|
|
809
|
+
CONFETTI = "confetti"
|
|
810
|
+
}
|
|
811
|
+
export declare enum DialogIconType {
|
|
812
|
+
SuccessIcon = "%%DialogSuccessIcon%%",
|
|
813
|
+
WarningIcon = "%%DialogWarningIcon%%",
|
|
814
|
+
ErrorIcon = "%%DialogErrorIcon%%"
|
|
707
815
|
}
|
|
708
816
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChaynsApiDevice, ScreenSize } from '../types/IChaynsReact';
|
|
2
2
|
declare const getDeviceInfo: (userAgent: string, acceptHeader: string) => ChaynsApiDevice;
|
|
3
3
|
export declare const getClientDeviceInfo: () => {
|
|
4
|
-
isTouch:
|
|
4
|
+
isTouch: boolean;
|
|
5
5
|
};
|
|
6
|
-
export declare const getScreenSize: (width: any
|
|
6
|
+
export declare const getScreenSize: (width: any) => ScreenSize;
|
|
7
7
|
export default getDeviceInfo;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DataChangeCallback } from '../types/IChaynsReact';
|
|
2
|
+
declare class StaticChaynsApi {
|
|
3
|
+
ready: Promise<void>;
|
|
4
|
+
addDataListener: (cb: DataChangeCallback) => () => void;
|
|
5
|
+
private _wrapper;
|
|
6
|
+
constructor();
|
|
7
|
+
getSite: () => any;
|
|
8
|
+
}
|
|
9
|
+
export default StaticChaynsApi;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chayns-api",
|
|
3
|
-
"version": "1.1.0-
|
|
3
|
+
"version": "1.1.0-4",
|
|
4
4
|
"description": "new chayns api",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
],
|
|
13
13
|
"scripts": {
|
|
14
14
|
"start": "npm run dev",
|
|
15
|
+
"build:umd": "chayns-toolkit build",
|
|
15
16
|
"build:cjs": "cross-env NODE_ENV=cjs babel src --out-dir dist/cjs --extensions=.ts,.tsx",
|
|
16
17
|
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --extensions=.ts,.tsx",
|
|
17
18
|
"build-docs": "npm i && cd website && npm i && npm run build",
|
|
@@ -34,42 +35,45 @@
|
|
|
34
35
|
"extends": "@chayns-toolkit"
|
|
35
36
|
},
|
|
36
37
|
"dependencies": {
|
|
37
|
-
"@
|
|
38
|
+
"@module-federation/runtime": "^0.1.6",
|
|
39
|
+
"@types/semver": "^7.5.8",
|
|
38
40
|
"comlink": "4.3.1",
|
|
39
41
|
"detect-browser": "^5.2.1",
|
|
40
42
|
"htmlescape": "^1.1.1",
|
|
41
43
|
"lodash.throttle": "^4.1.1",
|
|
42
44
|
"prop-types": "^15.7.2",
|
|
43
|
-
"scheduler": "^0.
|
|
45
|
+
"scheduler": "^0.23.0",
|
|
44
46
|
"semaphore-async-await": "^1.5.1",
|
|
45
|
-
"semver": "^7.
|
|
46
|
-
"use-context-selector": "^1.
|
|
47
|
+
"semver": "^7.6.0",
|
|
48
|
+
"use-context-selector": "^1.4.4",
|
|
49
|
+
"util": "^0.12.5"
|
|
47
50
|
},
|
|
48
51
|
"devDependencies": {
|
|
49
|
-
"@babel/cli": "^7.
|
|
50
|
-
"@babel/core": "^7.
|
|
51
|
-
"@babel/preset-env": "^7.
|
|
52
|
-
"@babel/preset-react": "^7.
|
|
53
|
-
"@babel/preset-typescript": "^7.
|
|
52
|
+
"@babel/cli": "^7.24.1",
|
|
53
|
+
"@babel/core": "^7.24.4",
|
|
54
|
+
"@babel/preset-env": "^7.24.4",
|
|
55
|
+
"@babel/preset-react": "^7.24.1",
|
|
56
|
+
"@babel/preset-typescript": "^7.24.1",
|
|
54
57
|
"@chayns-toolkit/eslint-config": "^2.0.0",
|
|
55
58
|
"@testing-library/react": "^12.1.2",
|
|
56
|
-
"@types/htmlescape": "^1.1.
|
|
57
|
-
"@types/lodash.throttle": "^4.1.
|
|
58
|
-
"@types/prop-types": "^15.7.
|
|
59
|
-
"@types/react": "^18.
|
|
60
|
-
"@types/react-dom": "^18.
|
|
61
|
-
"@typescript-eslint/parser": "^
|
|
62
|
-
"
|
|
59
|
+
"@types/htmlescape": "^1.1.3",
|
|
60
|
+
"@types/lodash.throttle": "^4.1.9",
|
|
61
|
+
"@types/prop-types": "^15.7.12",
|
|
62
|
+
"@types/react": "^18.2.78",
|
|
63
|
+
"@types/react-dom": "^18.2.25",
|
|
64
|
+
"@typescript-eslint/parser": "^7.6.0",
|
|
65
|
+
"chayns-toolkit": "^2.0.9",
|
|
66
|
+
"concurrently": "^8.2.2",
|
|
63
67
|
"cross-env": "^7.0.3",
|
|
64
68
|
"postcss-prefix-selector": "^1.13.0",
|
|
65
|
-
"prettier": "^2.5
|
|
66
|
-
"prettier-plugin-packagejson": "^2.
|
|
69
|
+
"prettier": "^3.2.5",
|
|
70
|
+
"prettier-plugin-packagejson": "^2.5.0",
|
|
67
71
|
"react": "^17.0.2",
|
|
68
72
|
"react-dom": "^17.0.2",
|
|
69
73
|
"typescript": "^4.9.5"
|
|
70
74
|
},
|
|
71
75
|
"peerDependencies": {
|
|
72
|
-
"react": "^16.8 || ^17.0.1",
|
|
73
|
-
"react-dom": "^16.8 || ^17.0.1"
|
|
76
|
+
"react": "^16.8 || ^17.0.1 || ^18.0.0",
|
|
77
|
+
"react-dom": "^16.8 || ^17.0.1 || ^18.0.0"
|
|
74
78
|
}
|
|
75
79
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
development: {
|
|
5
|
+
host: "0.0.0.0",
|
|
6
|
+
port: 8081,
|
|
7
|
+
},
|
|
8
|
+
output: {
|
|
9
|
+
singleBundle: true,
|
|
10
|
+
filename: 'chayns-api.js',
|
|
11
|
+
path: path.resolve(__dirname, 'dist'),
|
|
12
|
+
},
|
|
13
|
+
webpack(config) {
|
|
14
|
+
config.output.library = {
|
|
15
|
+
name: 'ChaynsApi',
|
|
16
|
+
type: 'umd',
|
|
17
|
+
}
|
|
18
|
+
return config;
|
|
19
|
+
}
|
|
20
|
+
};
|