chayns-api 3.1.6 → 3.1.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.
@@ -225,6 +225,12 @@ Object.defineProperty(exports, "useValues", {
225
225
  return _useValues.useValues;
226
226
  }
227
227
  });
228
+ Object.defineProperty(exports, "useValuesWithOverrides", {
229
+ enumerable: true,
230
+ get: function () {
231
+ return _useValuesWithOverrides.useValuesWithOverrides;
232
+ }
233
+ });
228
234
  Object.defineProperty(exports, "useWindowMetrics", {
229
235
  enumerable: true,
230
236
  get: function () {
@@ -258,4 +264,5 @@ var _useCustomCallbackFunction = require("./useCustomCallbackFunction");
258
264
  var _useCustomFunction = require("./useCustomFunction");
259
265
  var _useStyleSettings = require("./useStyleSettings");
260
266
  var _useChaynsApiId = require("./useChaynsApiId");
261
- var _history = require("./history");
267
+ var _history = require("./history");
268
+ var _useValuesWithOverrides = require("./useValuesWithOverrides");
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useValuesWithOverrides = void 0;
7
+ var _reactCompilerRuntime = require("react-compiler-runtime");
8
+ var _react = require("react");
9
+ var _useValues = require("./useValues");
10
+ const useValuesWithOverrides = overrideFactory => {
11
+ const $ = (0, _reactCompilerRuntime.c)(6);
12
+ const base = (0, _useValues.useValues)();
13
+ let t0;
14
+ if ($[0] !== base || $[1] !== overrideFactory) {
15
+ t0 = overrideFactory(base);
16
+ $[0] = base;
17
+ $[1] = overrideFactory;
18
+ $[2] = t0;
19
+ } else {
20
+ t0 = $[2];
21
+ }
22
+ const overrides = t0;
23
+ let t1;
24
+ if ($[3] !== base || $[4] !== overrides) {
25
+ t1 = {
26
+ ...base,
27
+ ...overrides
28
+ };
29
+ $[3] = base;
30
+ $[4] = overrides;
31
+ $[5] = t1;
32
+ } else {
33
+ t1 = $[5];
34
+ }
35
+ return t1;
36
+ };
37
+ exports.useValuesWithOverrides = useValuesWithOverrides;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.selectType = exports.WeekDayType = exports.ToastType = exports.TappEvent = exports.SnapshotType = exports.SharingApp = exports.ScreenSize = exports.ScanQrCodeCodeType = exports.ScanQrCodeCameraTypes = exports.RuntimeEnviroment = exports.MediaType = exports.LoginState = exports.Language = exports.IconType = exports.IconStyle = exports.IOSFeedbackVibration = exports.Gender = exports.Font = exports.FloatingButtonPosition = exports.FloatingButtonAnimation = exports.Environment = exports.DialogType = exports.DialogSelectType = exports.DialogInputType = exports.DialogIconType = exports.DialogButtonType = exports.DialogAnimation = exports.DeviceOs = exports.DesignSettingsUpdateTappViewModes = exports.DesignSettingsUpdateSeasonTypes = exports.DesignSettingsUpdateGalleryAnimationTypes = exports.DesignSettingsUpdateCoverTypes = exports.DesignSettingsUpdateBackgroundType = exports.DateType = exports.ColorMode = exports.BrowserName = exports.AppName = exports.AppFlavor = exports.AccessMode = void 0;
6
+ exports.selectType = exports.WeekDayType = exports.ToastType = exports.TappEvent = exports.SnapshotType = exports.SharingApp = exports.ScreenSize = exports.ScanQrCodeCodeType = exports.ScanQrCodeCameraTypes = exports.RuntimeEnvironment = exports.RuntimeEnviroment = exports.MediaType = exports.LoginState = exports.Language = exports.IconType = exports.IconStyle = exports.IOSFeedbackVibration = exports.Gender = exports.Font = exports.FloatingButtonPosition = exports.FloatingButtonAnimation = exports.Environment = exports.DialogType = exports.DialogSelectType = exports.DialogInputType = exports.DialogIconType = exports.DialogButtonType = exports.DialogAnimation = exports.DeviceOs = exports.DesignSettingsUpdateTappViewModes = exports.DesignSettingsUpdateSeasonTypes = exports.DesignSettingsUpdateGalleryAnimationTypes = exports.DesignSettingsUpdateCoverTypes = exports.DesignSettingsUpdateBackgroundType = exports.DateType = exports.ColorMode = exports.BrowserName = exports.AppName = exports.AppFlavor = exports.AccessMode = void 0;
7
7
  let DateType = exports.DateType = function (DateType) {
8
8
  DateType[DateType["DATE"] = 0] = "DATE";
9
9
  DateType[DateType["TIME"] = 1] = "TIME";
@@ -223,17 +223,19 @@ let Language = exports.Language = function (Language) {
223
223
  Language["Ukrainian"] = "uk";
224
224
  return Language;
225
225
  }({});
226
- let RuntimeEnviroment = exports.RuntimeEnviroment = function (RuntimeEnviroment) {
227
- RuntimeEnviroment[RuntimeEnviroment["Unknown"] = 0] = "Unknown";
228
- RuntimeEnviroment[RuntimeEnviroment["ChaynsDe"] = 1] = "ChaynsDe";
229
- RuntimeEnviroment[RuntimeEnviroment["ChaynsWeb"] = 2] = "ChaynsWeb";
230
- RuntimeEnviroment[RuntimeEnviroment["ChaynsRuntime"] = 3] = "ChaynsRuntime";
231
- RuntimeEnviroment[RuntimeEnviroment["IntercomPlugin"] = 4] = "IntercomPlugin";
232
- RuntimeEnviroment[RuntimeEnviroment["PagemakerPlugin"] = 5] = "PagemakerPlugin";
233
- RuntimeEnviroment[RuntimeEnviroment["Dialog"] = 6] = "Dialog";
234
- RuntimeEnviroment[RuntimeEnviroment["App"] = 7] = "App";
235
- return RuntimeEnviroment;
236
- }({});
226
+ let RuntimeEnvironment = exports.RuntimeEnvironment = function (RuntimeEnvironment) {
227
+ RuntimeEnvironment[RuntimeEnvironment["Unknown"] = 0] = "Unknown";
228
+ RuntimeEnvironment[RuntimeEnvironment["ChaynsDe"] = 1] = "ChaynsDe";
229
+ RuntimeEnvironment[RuntimeEnvironment["ChaynsWeb"] = 2] = "ChaynsWeb";
230
+ RuntimeEnvironment[RuntimeEnvironment["ChaynsRuntime"] = 3] = "ChaynsRuntime";
231
+ RuntimeEnvironment[RuntimeEnvironment["IntercomPlugin"] = 4] = "IntercomPlugin";
232
+ RuntimeEnvironment[RuntimeEnvironment["PagemakerPlugin"] = 5] = "PagemakerPlugin";
233
+ RuntimeEnvironment[RuntimeEnvironment["Dialog"] = 6] = "Dialog";
234
+ RuntimeEnvironment[RuntimeEnvironment["App"] = 7] = "App";
235
+ RuntimeEnvironment[RuntimeEnvironment["RemotePlugin"] = 8] = "RemotePlugin";
236
+ return RuntimeEnvironment;
237
+ }({});
238
+ const RuntimeEnviroment = exports.RuntimeEnviroment = RuntimeEnvironment;
237
239
  let DeviceOs = exports.DeviceOs = function (DeviceOs) {
238
240
  DeviceOs["Unknown"] = "unknown";
239
241
  DeviceOs["Android"] = "android";
@@ -91,7 +91,7 @@ class AppWrapper {
91
91
  }),
92
92
  environment: {
93
93
  buildEnvironment: _IChaynsReact.Environment.Production,
94
- runtimeEnvironment: _IChaynsReact.RuntimeEnviroment.App
94
+ runtimeEnvironment: _IChaynsReact.RuntimeEnvironment.App
95
95
  },
96
96
  language: {
97
97
  site: AppInfo.Language || 'de',
@@ -19,4 +19,5 @@ export { useCustomCallbackFunction } from './useCustomCallbackFunction';
19
19
  export { useCustomFunction } from './useCustomFunction';
20
20
  export { useStyleSettings } from './useStyleSettings';
21
21
  export { useChaynsApiId } from './useChaynsApiId';
22
- export { useChaynsHistoryLayer, useChaynsHistoryRoute, useChaynsHistoryParams, useChaynsHistoryHash, useChaynsHistoryState, useChaynsHistoryNavigate, useChaynsHistoryBlock, useChaynsHistoryEvent, useChaynsHistoryChildLayer, useChaynsHistoryActiveChild } from './history';
22
+ export { useChaynsHistoryLayer, useChaynsHistoryRoute, useChaynsHistoryParams, useChaynsHistoryHash, useChaynsHistoryState, useChaynsHistoryNavigate, useChaynsHistoryBlock, useChaynsHistoryEvent, useChaynsHistoryChildLayer, useChaynsHistoryActiveChild } from './history';
23
+ export { useValuesWithOverrides } from './useValuesWithOverrides';
@@ -0,0 +1,30 @@
1
+ import { c as _c } from "react-compiler-runtime";
2
+ import { useMemo } from 'react';
3
+ import { useValues } from './useValues';
4
+ export const useValuesWithOverrides = overrideFactory => {
5
+ const $ = _c(6);
6
+ const base = useValues();
7
+ let t0;
8
+ if ($[0] !== base || $[1] !== overrideFactory) {
9
+ t0 = overrideFactory(base);
10
+ $[0] = base;
11
+ $[1] = overrideFactory;
12
+ $[2] = t0;
13
+ } else {
14
+ t0 = $[2];
15
+ }
16
+ const overrides = t0;
17
+ let t1;
18
+ if ($[3] !== base || $[4] !== overrides) {
19
+ t1 = {
20
+ ...base,
21
+ ...overrides
22
+ };
23
+ $[3] = base;
24
+ $[4] = overrides;
25
+ $[5] = t1;
26
+ } else {
27
+ t1 = $[5];
28
+ }
29
+ return t1;
30
+ };
@@ -217,17 +217,19 @@ export let Language = function (Language) {
217
217
  Language["Ukrainian"] = "uk";
218
218
  return Language;
219
219
  }({});
220
- export let RuntimeEnviroment = function (RuntimeEnviroment) {
221
- RuntimeEnviroment[RuntimeEnviroment["Unknown"] = 0] = "Unknown";
222
- RuntimeEnviroment[RuntimeEnviroment["ChaynsDe"] = 1] = "ChaynsDe";
223
- RuntimeEnviroment[RuntimeEnviroment["ChaynsWeb"] = 2] = "ChaynsWeb";
224
- RuntimeEnviroment[RuntimeEnviroment["ChaynsRuntime"] = 3] = "ChaynsRuntime";
225
- RuntimeEnviroment[RuntimeEnviroment["IntercomPlugin"] = 4] = "IntercomPlugin";
226
- RuntimeEnviroment[RuntimeEnviroment["PagemakerPlugin"] = 5] = "PagemakerPlugin";
227
- RuntimeEnviroment[RuntimeEnviroment["Dialog"] = 6] = "Dialog";
228
- RuntimeEnviroment[RuntimeEnviroment["App"] = 7] = "App";
229
- return RuntimeEnviroment;
230
- }({});
220
+ export let RuntimeEnvironment = function (RuntimeEnvironment) {
221
+ RuntimeEnvironment[RuntimeEnvironment["Unknown"] = 0] = "Unknown";
222
+ RuntimeEnvironment[RuntimeEnvironment["ChaynsDe"] = 1] = "ChaynsDe";
223
+ RuntimeEnvironment[RuntimeEnvironment["ChaynsWeb"] = 2] = "ChaynsWeb";
224
+ RuntimeEnvironment[RuntimeEnvironment["ChaynsRuntime"] = 3] = "ChaynsRuntime";
225
+ RuntimeEnvironment[RuntimeEnvironment["IntercomPlugin"] = 4] = "IntercomPlugin";
226
+ RuntimeEnvironment[RuntimeEnvironment["PagemakerPlugin"] = 5] = "PagemakerPlugin";
227
+ RuntimeEnvironment[RuntimeEnvironment["Dialog"] = 6] = "Dialog";
228
+ RuntimeEnvironment[RuntimeEnvironment["App"] = 7] = "App";
229
+ RuntimeEnvironment[RuntimeEnvironment["RemotePlugin"] = 8] = "RemotePlugin";
230
+ return RuntimeEnvironment;
231
+ }({});
232
+ export const RuntimeEnviroment = RuntimeEnvironment;
231
233
  export let DeviceOs = function (DeviceOs) {
232
234
  DeviceOs["Unknown"] = "unknown";
233
235
  DeviceOs["Android"] = "android";
@@ -8,7 +8,7 @@ import { DefaultLoginDialogOptions } from '../constants';
8
8
  import { DeviceLanguage } from '../constants/languages';
9
9
  import DialogHandler from '../handler/DialogHandler';
10
10
  import { addApiListener, dispatchApiEvent, removeApiListener } from '../utils/apiListener';
11
- import { AppName, DialogButtonType, DialogType, Environment, Font, Gender, IconType, LoginState, RuntimeEnviroment, TappEvent } from '../types/IChaynsReact';
11
+ import { AppName, DialogButtonType, DialogType, Environment, Font, Gender, IconType, LoginState, RuntimeEnvironment, TappEvent } from '../types/IChaynsReact';
12
12
  import invokeAppCall from '../utils/appCall';
13
13
  import { addAppStorageListener, clearAppStorage, isAppStorageAvailable, setAppStorageItem } from '../utils/appStorage';
14
14
  import getDeviceInfo, { getScreenSize } from '../utils/deviceHelper';
@@ -80,7 +80,7 @@ export class AppWrapper {
80
80
  }),
81
81
  environment: {
82
82
  buildEnvironment: Environment.Production,
83
- runtimeEnvironment: RuntimeEnviroment.App
83
+ runtimeEnvironment: RuntimeEnvironment.App
84
84
  },
85
85
  language: {
86
86
  site: AppInfo.Language || 'de',
@@ -253,7 +253,7 @@ export declare const getParameters: () => {
253
253
  export declare const getPages: () => import("../types/IChaynsReact").Page[];
254
254
  export declare const getEnvironment: () => {
255
255
  buildEnvironment: import("../types/IChaynsReact").Environment;
256
- runtimeEnvironment: import("../types/IChaynsReact").RuntimeEnviroment | string;
256
+ runtimeEnvironment: import("../types/IChaynsReact").RuntimeEnvironment | string;
257
257
  };
258
258
  export declare const getStyleSettings: () => import("../types/IChaynsReact").ChaynsStyleSettings | undefined;
259
259
  export declare const getDialogData: <T = any>() => T;
@@ -279,7 +279,7 @@ export declare const parameters: {
279
279
  export declare const pages: import("../types/IChaynsReact").Page[];
280
280
  export declare const environment: {
281
281
  buildEnvironment: import("../types/IChaynsReact").Environment;
282
- runtimeEnvironment: import("../types/IChaynsReact").RuntimeEnviroment | string;
282
+ runtimeEnvironment: import("../types/IChaynsReact").RuntimeEnvironment | string;
283
283
  };
284
284
  /**
285
285
  * Redirects the user to the given destination. On the server side a 307 or 308 (depending on the isPermanent flag) redirect response is generated. On the client side a window.location.href change is performed.
@@ -20,3 +20,4 @@ export { useCustomFunction } from './useCustomFunction';
20
20
  export { useStyleSettings } from './useStyleSettings';
21
21
  export { useChaynsApiId } from './useChaynsApiId';
22
22
  export { useChaynsHistoryLayer, useChaynsHistoryRoute, useChaynsHistoryParams, useChaynsHistoryHash, useChaynsHistoryState, useChaynsHistoryNavigate, useChaynsHistoryBlock, useChaynsHistoryEvent, useChaynsHistoryChildLayer, useChaynsHistoryActiveChild, type UseChaynsHistoryRouteResult, type UseChaynsHistoryActiveChildResult, type UseChaynsHistoryBlockOptions, } from './history';
23
+ export { useValuesWithOverrides } from './useValuesWithOverrides';
@@ -0,0 +1,2 @@
1
+ import { ChaynsReactValues } from '../types/IChaynsReact';
2
+ export declare const useValuesWithOverrides: (overrideFactory: (base: ChaynsReactValues) => Partial<ChaynsReactValues>) => ChaynsReactValues;
@@ -339,7 +339,7 @@ export interface ChaynsReactValues {
339
339
  };
340
340
  environment: {
341
341
  buildEnvironment: Environment;
342
- runtimeEnvironment: RuntimeEnviroment | string;
342
+ runtimeEnvironment: RuntimeEnvironment | string;
343
343
  };
344
344
  customData: any;
345
345
  dialog: {
@@ -921,7 +921,7 @@ export declare enum Language {
921
921
  Polish = "pl",
922
922
  Ukrainian = "uk"
923
923
  }
924
- export declare enum RuntimeEnviroment {
924
+ export declare enum RuntimeEnvironment {
925
925
  Unknown = 0,
926
926
  ChaynsDe = 1,
927
927
  ChaynsWeb = 2,// ?
@@ -929,8 +929,11 @@ export declare enum RuntimeEnviroment {
929
929
  IntercomPlugin = 4,
930
930
  PagemakerPlugin = 5,
931
931
  Dialog = 6,
932
- App = 7
932
+ App = 7,
933
+ /** Module Federation plugin with unspecified host */
934
+ RemotePlugin = 8
933
935
  }
936
+ export declare const RuntimeEnviroment: typeof RuntimeEnvironment;
934
937
  export declare enum DeviceOs {
935
938
  Unknown = "unknown",
936
939
  Android = "android",
@@ -90,7 +90,7 @@ declare class StaticChaynsApi implements ChaynsReactFunctions {
90
90
  getPages: () => import("../types/IChaynsReact").Page[];
91
91
  getEnvironment: () => {
92
92
  buildEnvironment: import("../types/IChaynsReact").Environment;
93
- runtimeEnvironment: import("../types/IChaynsReact").RuntimeEnviroment | string;
93
+ runtimeEnvironment: import("../types/IChaynsReact").RuntimeEnvironment | string;
94
94
  };
95
95
  getStyleSettings: () => import("../types/IChaynsReact").ChaynsStyleSettings | undefined;
96
96
  getCustomFunction: (key: string) => (...args: any[]) => Promise<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chayns-api",
3
- "version": "3.1.6",
3
+ "version": "3.1.7",
4
4
  "description": "new chayns api",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",