chayns-api 2.6.0-beta.2 → 2.6.0-beta.3

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.
Files changed (77) hide show
  1. package/.github/workflows/publish.yml +7 -2
  2. package/dist/cjs/calls/dialogs/date.js +1 -1
  3. package/dist/cjs/calls/dialogs/iFrame.js +9 -6
  4. package/dist/cjs/calls/index.js +3 -1
  5. package/dist/cjs/components/ChaynsProvider.js +2 -3
  6. package/dist/cjs/components/withCompatMode.js +2 -2
  7. package/dist/cjs/components/withHydrationBoundary.js +1 -2
  8. package/dist/cjs/host/ChaynsHost.js +1 -2
  9. package/dist/cjs/host/iframe/HostIframe.js +1 -2
  10. package/dist/cjs/host/module/ModuleHost.js +1 -2
  11. package/dist/cjs/host/module/utils/loadComponent.js +1 -16
  12. package/dist/cjs/index.js +1 -2
  13. package/dist/cjs/plugins/TrustedDomainsPlugins.js +29 -0
  14. package/dist/cjs/plugins/index.js +8 -1
  15. package/dist/cjs/types/IChaynsReact.js +3 -7
  16. package/dist/cjs/types/global.d.js +1 -0
  17. package/dist/cjs/umd.index.js +1 -2
  18. package/dist/cjs/util/deviceHelper.js +17 -4
  19. package/dist/cjs/util/initModuleFederationSharing.js +2 -2
  20. package/dist/cjs/util/is.js +9 -4
  21. package/dist/cjs/util/transferNestedFunctions.js +1 -2
  22. package/dist/cjs/wrapper/AppWrapper.js +9 -3
  23. package/dist/cjs/wrapper/FrameWrapper.js +6 -3
  24. package/dist/cjs/wrapper/StaticChaynsApi.js +1 -3
  25. package/dist/esm/calls/dialogs/alert.js +1 -3
  26. package/dist/esm/calls/dialogs/communication.js +3 -6
  27. package/dist/esm/calls/dialogs/confirm.js +1 -4
  28. package/dist/esm/calls/dialogs/date.js +4 -8
  29. package/dist/esm/calls/dialogs/dropUpAlert.js +1 -2
  30. package/dist/esm/calls/dialogs/fileSelect.js +1 -2
  31. package/dist/esm/calls/dialogs/iFrame.js +11 -9
  32. package/dist/esm/calls/dialogs/input.js +1 -2
  33. package/dist/esm/calls/dialogs/mediaSelect.js +1 -2
  34. package/dist/esm/calls/dialogs/toast.js +1 -2
  35. package/dist/esm/calls/dialogs/utils/callback.js +1 -2
  36. package/dist/esm/calls/index.js +53 -156
  37. package/dist/esm/components/ChaynsProvider.js +18 -21
  38. package/dist/esm/components/WaitUntil.js +5 -6
  39. package/dist/esm/components/withCompatMode.js +1 -0
  40. package/dist/esm/components/withHydrationBoundary.js +5 -6
  41. package/dist/esm/handler/DialogHandler.js +1 -2
  42. package/dist/esm/hooks/geoLocationListener.js +5 -6
  43. package/dist/esm/hooks/scrollListener.js +12 -15
  44. package/dist/esm/hooks/usePages.js +16 -19
  45. package/dist/esm/hooks/windowMetricsListener.js +3 -4
  46. package/dist/esm/host/ChaynsHost.js +23 -24
  47. package/dist/esm/host/iframe/HostIframe.js +21 -22
  48. package/dist/esm/host/module/ModuleHost.js +24 -26
  49. package/dist/esm/host/module/utils/loadComponent.js +3 -21
  50. package/dist/esm/plugins/TrustedDomainsPlugins.js +25 -0
  51. package/dist/esm/plugins/index.js +2 -1
  52. package/dist/esm/types/IChaynsReact.js +2 -6
  53. package/dist/esm/types/global.d.js +0 -0
  54. package/dist/esm/util/appStorage.js +3 -6
  55. package/dist/esm/util/deviceHelper.js +20 -8
  56. package/dist/esm/util/initModuleFederationSharing.js +6 -7
  57. package/dist/esm/util/is.js +11 -8
  58. package/dist/esm/util/transferNestedFunctions.js +1 -2
  59. package/dist/esm/wrapper/AppWrapper.js +23 -26
  60. package/dist/esm/wrapper/FrameWrapper.js +14 -21
  61. package/dist/esm/wrapper/ModuleFederationWrapper.js +2 -5
  62. package/dist/esm/wrapper/StaticChaynsApi.js +2 -5
  63. package/dist/types/calls/dialogs/iFrame.d.ts +10 -4
  64. package/dist/types/calls/index.d.ts +2 -0
  65. package/dist/types/host/module/utils/loadComponent.d.ts +2 -1
  66. package/dist/types/plugins/SSRManifestPlugin.d.ts +2 -2
  67. package/dist/types/plugins/SequentialLoadPlugin.d.ts +2 -2
  68. package/dist/types/plugins/TrustedDomainsPlugins.d.ts +2 -0
  69. package/dist/types/plugins/index.d.ts +1 -0
  70. package/dist/types/types/IChaynsReact.d.ts +29 -12
  71. package/dist/types/util/is.d.ts +1 -0
  72. package/dist/types/wrapper/StaticChaynsApi.d.ts +68 -4
  73. package/eslint.config.mjs +3 -0
  74. package/package.json +32 -22
  75. package/{toolkit.config.js → toolkit.config.ts} +6 -3
  76. package/tsconfig.json +1 -0
  77. package/.eslintrc +0 -17
@@ -26,11 +26,8 @@ export class ModuleFederationWrapper {
26
26
  this.functions.sendMessageToGroup = async (groupId, object) => sendMessageToGroup(this, object, groupId);
27
27
  this.functions.sendMessageToPage = async object => sendMessageToPage(this, object);
28
28
  this.functions.sendMessageToUser = async (userId, object) => sendMessageToUser(this, object, userId);
29
- Object.entries(functions).forEach(_ref => {
30
- let [k, fn] = _ref;
31
- this.functions[k] = async function () {
32
- return fn(...arguments);
33
- };
29
+ Object.entries(functions).forEach(([k, fn]) => {
30
+ this.functions[k] = async (...args) => fn(...args);
34
31
  });
35
32
  if (customFunctions) {
36
33
  this.customFunctions = customFunctions;
@@ -6,7 +6,7 @@ import { AppFlavor } from '../types/IChaynsReact';
6
6
  import getDeviceInfo from '../util/deviceHelper';
7
7
  import { AppWrapper } from './AppWrapper';
8
8
  import { FrameWrapper } from './FrameWrapper';
9
- import { ModuleFederationWrapper } from "./ModuleFederationWrapper";
9
+ import { ModuleFederationWrapper } from './ModuleFederationWrapper';
10
10
  class StaticChaynsApi {
11
11
  constructor(values, functions) {
12
12
  var _deviceInfo$app;
@@ -34,10 +34,7 @@ class StaticChaynsApi {
34
34
  this._wrapper = wrapper;
35
35
  this.ready = wrapper.init();
36
36
  this.addDataListener = wrapper.addDataListener;
37
- Object.entries(wrapper.functions).forEach(_ref => {
38
- let [k, v] = _ref;
39
- this[k] = v;
40
- });
37
+ Object.assign(this, wrapper.functions);
41
38
  }
42
39
  }
43
40
  export default StaticChaynsApi;
@@ -1,10 +1,16 @@
1
1
  import { DialogButtonOld } from "../../types/dialog";
2
- type iFrameDialog = {
2
+ type IFrameDialog = {
3
3
  buttons?: DialogButtonOld[];
4
- callType?: number;
5
- tappIframeName?: string;
6
4
  url: string;
5
+ input?: object;
6
+ seamless?: boolean;
7
+ transparent?: boolean;
8
+ waitCursor?: boolean;
9
+ maxHeight?: string;
10
+ width?: number;
11
+ fullHeight?: boolean;
12
+ customTransitionTimeout?: number;
7
13
  };
8
- export declare function iFrame(dialog?: iFrameDialog): Promise<unknown>;
14
+ export declare function iFrame(dialog?: IFrameDialog): Promise<unknown>;
9
15
  export declare function _chaynsCallResponder(obj: any): void;
10
16
  export {};
@@ -65,6 +65,8 @@ export declare const getWindowMetrics: (...args: Parameters<ChaynsReactFunctions
65
65
  /** @internal */
66
66
  export declare const invokeCall: (...args: Parameters<ChaynsReactFunctions["invokeCall"]>) => Promise<any>;
67
67
  /** @internal */
68
+ export declare const invokePaymentCall: (...args: Parameters<ChaynsReactFunctions["invokePaymentCall"]>) => Promise<unknown>;
69
+ /** @internal */
68
70
  export declare const invokeDialogCall: (...args: Parameters<ChaynsReactFunctions["invokeDialogCall"]>) => Promise<any>;
69
71
  /**
70
72
  * This method will show a login dialog where the user has the opportunity to log in.
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  export declare const loadModule: (scope: string, module: string, url: string, preventSingleton?: boolean) => any;
2
- declare const loadComponent: (scope: string, module: string, url: string, skipCompatMode?: boolean, preventSingleton?: boolean) => any;
3
+ declare const loadComponent: (scope: string, module: string, url: string, skipCompatMode?: boolean, preventSingleton?: boolean) => React.LazyExoticComponent<React.ComponentType<any>>;
3
4
  export default loadComponent;
@@ -1,5 +1,5 @@
1
- import type { FederationRuntimePlugin } from '@module-federation/enhanced/runtime';
1
+ import type { ModuleFederationRuntimePlugin } from '@module-federation/enhanced/runtime';
2
2
  /**
3
3
  * Adds SSR metadata and resolves public path when using manifest
4
4
  */
5
- export declare const SSRManifestPlugin: () => FederationRuntimePlugin;
5
+ export declare const SSRManifestPlugin: () => ModuleFederationRuntimePlugin;
@@ -1,5 +1,5 @@
1
- import type { FederationRuntimePlugin } from '@module-federation/enhanced/runtime';
1
+ import type { ModuleFederationRuntimePlugin } from '@module-federation/enhanced/runtime';
2
2
  /**
3
3
  * Plugin to prevent parallel loading of shared dependencies
4
4
  */
5
- export declare const SequentialLoadPlugin: () => FederationRuntimePlugin;
5
+ export declare const SequentialLoadPlugin: () => ModuleFederationRuntimePlugin;
@@ -0,0 +1,2 @@
1
+ import { ModuleFederationRuntimePlugin } from '@module-federation/enhanced/runtime';
2
+ export declare const TrustedDomainsPlugin: (trustedDomains?: string[]) => ModuleFederationRuntimePlugin;
@@ -1 +1,2 @@
1
1
  export { SSRManifestPlugin } from './SSRManifestPlugin';
2
+ export { TrustedDomainsPlugin } from './TrustedDomainsPlugins';
@@ -259,7 +259,8 @@ export declare enum ScreenSize {
259
259
  }
260
260
  export declare enum AppFlavor {
261
261
  None = "none",
262
- Chayns = "chayns"
262
+ Chayns = "chayns",
263
+ Electron = "electron"
263
264
  }
264
265
  export type ChaynsApiDevice = {
265
266
  app?: {
@@ -372,6 +373,7 @@ export interface ChaynsReactFunctions {
372
373
  getScrollPosition: () => Promise<ScrollListenerResult>;
373
374
  getWindowMetrics: () => Promise<WindowMetricsListenerResult>;
374
375
  invokeCall: (value: InvokeCall, callback?: (result: any) => void) => Promise<any>;
376
+ invokePaymentCall: <T>(value: InvokeCall, callback?: (result: T) => void) => Promise<T>;
375
377
  invokeDialogCall: (value: InvokeCall, callback?: (result: any) => void) => Promise<any>;
376
378
  login: (value?: Login, callback?: (result: boolean) => void, closeCallback?: () => void) => Promise<LoginResult>;
377
379
  logout: () => Promise<void>;
@@ -612,14 +614,11 @@ export interface DesignSettingsUpdateCover {
612
614
  type: DesignSettingsUpdateCoverTypes;
613
615
  urls: string[];
614
616
  }
615
- export declare enum DesignSettingsUpdateColorSchemeMode {
616
- Normal = 0,
617
- Dark = 1,
618
- Bright = 2
619
- }
620
617
  export interface DesignSettingsUpdateColorScheme {
621
618
  color: string;
622
- mode: DesignSettingsUpdateColorSchemeMode;
619
+ /** @deprecated use colorMode instead */
620
+ mode: ColorMode;
621
+ colorMode: ColorMode;
623
622
  }
624
623
  export interface DesignSettingsUpdateGlobalSettings {
625
624
  useChatHead?: boolean;
@@ -701,11 +700,28 @@ export declare enum LoginState {
701
700
  SUCCESS = 4
702
701
  }
703
702
  export interface LoginResult {
703
+ /** @deprecated Check buttonType instead **/
704
704
  loginState: LoginState;
705
- }
706
- export interface Login {
707
- ignoreAuthenticated: boolean;
708
- }
705
+ buttonType: DialogButtonType;
706
+ token?: string;
707
+ confirmationToken?: string;
708
+ authCode?: string;
709
+ redirectUri?: string;
710
+ }
711
+ export type Login = BaseDialog & DialogModule<{
712
+ preventLogin?: boolean;
713
+ restore?: number;
714
+ tokenType?: number;
715
+ /**
716
+ * SiteId for which site the token should be generated.
717
+ * @warning Only works when tokenLocationId is defined too
718
+ **/
719
+ tokenSiteId?: string;
720
+ /**
721
+ * @warning Only works when tokenSiteId is defined too
722
+ */
723
+ tokenLocationId?: number;
724
+ }>;
709
725
  export interface InvokeCall {
710
726
  action: number;
711
727
  value?: object;
@@ -906,7 +922,8 @@ export declare enum AppName {
906
922
  Sidekick = 7,
907
923
  Team = 8,
908
924
  CityApp = 9,
909
- ElectronChayns = 10
925
+ ElectronChayns = 10,
926
+ ElectronTeam = 11
910
927
  }
911
928
  export declare enum BrowserName {
912
929
  Unknown = "unknown",
@@ -3,3 +3,4 @@ export declare const isAppCallSupported: ({ minAndroidVersion, minIOSVersion }:
3
3
  minAndroidVersion?: number | undefined;
4
4
  minIOSVersion?: number | undefined;
5
5
  }) => boolean;
6
+ export declare const isElectron: () => boolean;
@@ -1,9 +1,73 @@
1
- import { DataChangeCallback } from '../types/IChaynsReact';
2
- declare class StaticChaynsApi {
1
+ import { ChaynsReactFunctions, ChaynsReactValues, DataChangeCallback } from '../types/IChaynsReact';
2
+ declare class StaticChaynsApi implements ChaynsReactFunctions {
3
+ addGeoLocationListener: ChaynsReactFunctions['addGeoLocationListener'];
4
+ addScrollListener: ChaynsReactFunctions['addScrollListener'];
5
+ addVisibilityChangeListener: ChaynsReactFunctions['addVisibilityChangeListener'];
6
+ addToolbarChangeListener: ChaynsReactFunctions['addToolbarChangeListener'];
7
+ addWindowMetricsListener: ChaynsReactFunctions['addWindowMetricsListener'];
8
+ customCallbackFunction: ChaynsReactFunctions['customCallbackFunction'];
9
+ getAvailableSharingServices: ChaynsReactFunctions['getAvailableSharingServices'];
10
+ getAccessToken: ChaynsReactFunctions['getAccessToken'];
11
+ getCustomCookie: ChaynsReactFunctions['getCustomCookie'];
12
+ getGeoLocation: ChaynsReactFunctions['getGeoLocation'];
13
+ getUserInfo: ChaynsReactFunctions['getUserInfo'];
14
+ getScrollPosition: ChaynsReactFunctions['getScrollPosition'];
15
+ getWindowMetrics: ChaynsReactFunctions['getWindowMetrics'];
16
+ invokeCall: ChaynsReactFunctions['invokeCall'];
17
+ invokePaymentCall: ChaynsReactFunctions['invokePaymentCall'];
18
+ invokeDialogCall: ChaynsReactFunctions['invokeDialogCall'];
19
+ login: ChaynsReactFunctions['login'];
20
+ logout: ChaynsReactFunctions['logout'];
21
+ navigateBack: ChaynsReactFunctions['navigateBack'];
22
+ openImage: ChaynsReactFunctions['openImage'];
23
+ openUrl: ChaynsReactFunctions['openUrl'];
24
+ openVideo: ChaynsReactFunctions['openVideo'];
25
+ openMedia: ChaynsReactFunctions['openMedia'];
26
+ refreshData: ChaynsReactFunctions['refreshData'];
27
+ refreshAccessToken: ChaynsReactFunctions['refreshAccessToken'];
28
+ removeGeoLocationListener: ChaynsReactFunctions['removeGeoLocationListener'];
29
+ removeScrollListener: ChaynsReactFunctions['removeScrollListener'];
30
+ removeVisibilityChangeListener: ChaynsReactFunctions['removeVisibilityChangeListener'];
31
+ removeToolbarChangeListener: ChaynsReactFunctions['removeToolbarChangeListener'];
32
+ removeWindowMetricsListener: ChaynsReactFunctions['removeWindowMetricsListener'];
33
+ selectPage: ChaynsReactFunctions['selectPage'];
34
+ scrollToY: ChaynsReactFunctions['scrollToY'];
35
+ sendMessageToGroup: ChaynsReactFunctions['sendMessageToGroup'];
36
+ sendMessageToPage: ChaynsReactFunctions['sendMessageToPage'];
37
+ sendMessageToUser: ChaynsReactFunctions['sendMessageToUser'];
38
+ setAdminMode: ChaynsReactFunctions['setAdminMode'];
39
+ setCustomCookie: ChaynsReactFunctions['setCustomCookie'];
40
+ setDisplayTimeout: ChaynsReactFunctions['setDisplayTimeout'];
41
+ setFloatingButton: ChaynsReactFunctions['setFloatingButton'];
42
+ setHeight: ChaynsReactFunctions['setHeight'];
43
+ setRefreshScrollEnabled: ChaynsReactFunctions['setRefreshScrollEnabled'];
44
+ setScanQrCode: ChaynsReactFunctions['setScanQrCode'];
45
+ setTempDesignSettings: ChaynsReactFunctions['setTempDesignSettings'];
46
+ setWaitCursor: ChaynsReactFunctions['setWaitCursor'];
47
+ storageGetItem: ChaynsReactFunctions['storageGetItem'];
48
+ storageRemoveItem: ChaynsReactFunctions['storageRemoveItem'];
49
+ storageSetItem: ChaynsReactFunctions['storageSetItem'];
50
+ vibrate: ChaynsReactFunctions['vibrate'];
51
+ scrollByY: ChaynsReactFunctions['scrollByY'];
52
+ setOverlay: ChaynsReactFunctions['setOverlay'];
53
+ createDialog: ChaynsReactFunctions['createDialog'];
54
+ openDialog: ChaynsReactFunctions['openDialog'];
55
+ closeDialog: ChaynsReactFunctions['closeDialog'];
56
+ setDialogResult: ChaynsReactFunctions['setDialogResult'];
57
+ dispatchEventToDialogClient: ChaynsReactFunctions['dispatchEventToDialogClient'];
58
+ addDialogClientEventListener: ChaynsReactFunctions['addDialogClientEventListener'];
59
+ removeDialogClientEventListener: ChaynsReactFunctions['removeDialogClientEventListener'];
60
+ dispatchEventToDialogHost: ChaynsReactFunctions['dispatchEventToDialogHost'];
61
+ addDialogHostEventListener: ChaynsReactFunctions['addDialogHostEventListener'];
62
+ removeDialogHostEventListener: ChaynsReactFunctions['removeDialogHostEventListener'];
63
+ addAnonymousAccount: ChaynsReactFunctions['addAnonymousAccount'];
64
+ addAccessTokenChangeListener: ChaynsReactFunctions['addAccessTokenChangeListener'];
65
+ removeAccessTokenChangeListener: ChaynsReactFunctions['removeAccessTokenChangeListener'];
66
+ redirect: ChaynsReactFunctions['redirect'];
3
67
  ready: Promise<void>;
4
68
  addDataListener: (cb: DataChangeCallback) => () => void;
5
69
  private _wrapper;
6
- constructor(values: any, functions: any);
70
+ constructor(values?: ChaynsReactValues, functions?: ChaynsReactFunctions);
7
71
  getUser: () => import("../types/IChaynsReact").ChaynsApiUser | undefined;
8
72
  getSite: () => import("../types/IChaynsReact").ChaynsApiSite;
9
73
  getCurrentPage: () => {
@@ -30,6 +94,6 @@ declare class StaticChaynsApi {
30
94
  };
31
95
  getStyleSettings: () => import("../types/IChaynsReact").ChaynsStyleSettings | undefined;
32
96
  getCustomFunction: (key: string) => (...args: any[]) => Promise<any>;
33
- getDialogInput: () => any;
97
+ getDialogInput: <T>() => T;
34
98
  }
35
99
  export default StaticChaynsApi;
@@ -0,0 +1,3 @@
1
+ import config from '@chayns-toolkit/eslint-config';
2
+
3
+ export default config;
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "chayns-api",
3
- "version": "2.6.0-beta.2",
3
+ "version": "2.6.0-beta.3",
4
4
  "description": "new chayns api",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
7
7
  "types": "dist/types/index.d.ts",
8
+ "repository": {
9
+ "url": "git+https://github.com/TobitSoftware/chayns-api.git"
10
+ },
8
11
  "exports": {
9
12
  ".": {
10
13
  "types": "./dist/types/index.d.ts",
@@ -13,6 +16,9 @@
13
16
  "default": "./dist/esm/index.js"
14
17
  }
15
18
  },
19
+ "sideEffects": [
20
+ "**/utils/transferNestedFunctions.*"
21
+ ],
16
22
  "keywords": [
17
23
  "chayns",
18
24
  "chayns-toolkit",
@@ -44,40 +50,44 @@
44
50
  "extends": "@chayns-toolkit"
45
51
  },
46
52
  "dependencies": {
47
- "@module-federation/enhanced": "^0.10.0",
53
+ "@module-federation/enhanced": "^0.21.6",
48
54
  "comlink": "4.3.1",
49
55
  "htmlescape": "^1.1.1",
50
56
  "lodash.throttle": "^4.1.1",
51
- "ua-parser-js": "^1.0.40",
52
- "use-sync-external-store": "^1.4.0"
57
+ "ua-parser-js": "^1.0.41",
58
+ "use-sync-external-store": "^1.6.0"
53
59
  },
54
60
  "devDependencies": {
55
- "@babel/cli": "^7.26.4",
56
- "@babel/core": "^7.26.9",
57
- "@babel/preset-env": "^7.26.9",
58
- "@babel/preset-react": "^7.26.3",
59
- "@babel/preset-typescript": "^7.26.0",
60
- "@chayns-toolkit/eslint-config": "^2.0.0",
61
- "@rsbuild/plugin-umd": "^1.0.4",
61
+ "@babel/cli": "^7.28.3",
62
+ "@babel/core": "^7.28.5",
63
+ "@babel/preset-env": "^7.28.5",
64
+ "@babel/preset-react": "^7.28.5",
65
+ "@babel/preset-typescript": "^7.28.5",
66
+ "@chayns-toolkit/eslint-config": "^3.0.2",
67
+ "@rsbuild/plugin-umd": "^1.0.5",
62
68
  "@types/htmlescape": "^1.1.3",
63
69
  "@types/lodash.throttle": "^4.1.9",
64
- "@types/prop-types": "^15.7.14",
65
- "@types/react": "^18.3.18",
66
- "@types/react-dom": "^18.3.5",
70
+ "@types/prop-types": "^15.7.15",
71
+ "@types/react": "^18.3.27",
72
+ "@types/react-dom": "^18.3.7",
67
73
  "@types/ua-parser-js": "^0.7.39",
68
- "@types/use-sync-external-store": "^0.0.6",
69
- "@typescript-eslint/parser": "^7.6.0",
70
- "chayns-toolkit": "^3.2.6",
71
- "concurrently": "^9.1.2",
72
- "cross-env": "^7.0.3",
73
- "prettier": "^3.5.3",
74
- "prettier-plugin-packagejson": "^2.5.10",
74
+ "@types/use-sync-external-store": "^1.5.0",
75
+ "chayns-toolkit": "^3.3.6",
76
+ "concurrently": "^9.2.1",
77
+ "cross-env": "^10.1.0",
78
+ "prettier": "^3.7.4",
79
+ "prettier-plugin-packagejson": "^2.5.20",
75
80
  "react": "^18.3.1",
76
81
  "react-dom": "^18.3.1",
77
- "typescript": "^5.8.2"
82
+ "typescript": "^5.9.3"
78
83
  },
79
84
  "peerDependencies": {
80
85
  "react": "^16.8 || ^17.0.1 || ^18.0.0 || ^19.0.0",
81
86
  "react-dom": "^16.8 || ^17.0.1 || ^18.0.0 || ^19.0.0"
87
+ },
88
+ "overrides": {
89
+ "chayns-toolkit": {
90
+ "@module-federation/enhanced": "^0.21.6"
91
+ }
82
92
  }
83
93
  }
@@ -1,7 +1,8 @@
1
- const { buildToolkitConfig } = require('chayns-toolkit');
2
- const { pluginUmd } = require('@rsbuild/plugin-umd');
1
+ /* eslint-disable no-param-reassign,import/no-extraneous-dependencies */
2
+ import { buildToolkitConfig } from 'chayns-toolkit';
3
+ import { pluginUmd } from '@rsbuild/plugin-umd';
3
4
 
4
- module.exports = buildToolkitConfig({
5
+ export default buildToolkitConfig({
5
6
  development: {
6
7
  host: '0.0.0.0',
7
8
  port: 8081,
@@ -18,9 +19,11 @@ module.exports = buildToolkitConfig({
18
19
  path: 'dist',
19
20
  },
20
21
  webpack(config) {
22
+ config.plugins ??= [];
21
23
  config.plugins.push(pluginUmd({
22
24
  name: 'ChaynsApi',
23
25
  }));
26
+ config.output ??= {};
24
27
  config.output.sourceMap = false;
25
28
  return config;
26
29
  },
package/tsconfig.json CHANGED
@@ -52,5 +52,6 @@
52
52
  // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
53
53
  // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
54
54
  },
55
+ "include": ["src"],
55
56
  "exclude": ["node_modules", "**/*.spec.ts", "**/*.spec.tsx", "dist"]
56
57
  }
package/.eslintrc DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "extends": "@chayns-toolkit",
3
- "rules": {
4
- "no-void": "off",
5
- "react/function-component-definition": [
6
- "error",
7
- {
8
- "namedComponents": "arrow-function",
9
- "unnamedComponents": "arrow-function"
10
- }
11
- ],
12
- "@typescript-eslint/require-await": "off",
13
- "@typescript-eslint/no-explicit-any": "off",
14
- "class-methods-use-this": "off",
15
- "react/jsx-props-no-spreading": "off"
16
- }
17
- }