chayns-api 1.0.58 → 1.1.0-1
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/.babelrc +30 -30
- package/.eslintrc +17 -17
- package/.github/workflows/deploy_docs.yml +28 -28
- package/.github/workflows/publish.yml +21 -21
- package/LICENSE +21 -21
- package/README.md +54 -54
- package/dist/cjs/calls/dialogs/date.js +34 -34
- package/dist/cjs/calls/index.js +106 -106
- package/dist/cjs/calls/sendMessage.js +8 -8
- package/dist/cjs/calls/visibilityChangeListener.js +4 -4
- 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/hooks/geoLocationListener.js +4 -4
- package/dist/cjs/hooks/scrollListener.js +8 -8
- package/dist/cjs/hooks/useAccessToken.js +3 -3
- package/dist/cjs/hooks/useCurrentPage.js +2 -2
- package/dist/cjs/hooks/useCustomData.js +2 -2
- package/dist/cjs/hooks/useDevice.js +2 -2
- package/dist/cjs/hooks/useDialogState.js +4 -4
- package/dist/cjs/hooks/useEnvironment.js +2 -2
- package/dist/cjs/hooks/useFunctions.js +2 -2
- package/dist/cjs/hooks/useIsAdminMode.js +2 -2
- package/dist/cjs/hooks/useLanguage.js +2 -2
- package/dist/cjs/hooks/usePages.js +4 -4
- package/dist/cjs/hooks/useParameters.js +2 -2
- package/dist/cjs/hooks/useSite.js +2 -2
- package/dist/cjs/hooks/useUser.js +2 -2
- package/dist/cjs/hooks/useValues.js +2 -2
- package/dist/cjs/hooks/windowMetricsListener.js +4 -4
- package/dist/cjs/host/module/ModuleHost.js +3 -19
- package/dist/cjs/host/module/utils/loadComponent.js +46 -53
- package/dist/cjs/host/module/utils/useDynamicScript.js +6 -4
- package/dist/cjs/index.js +20 -0
- package/dist/cjs/types/IChaynsReact.js +4 -4
- package/dist/esm/calls/dialogs/date.js +34 -34
- package/dist/esm/calls/index.js +106 -106
- package/dist/esm/calls/sendMessage.js +8 -8
- package/dist/esm/calls/visibilityChangeListener.js +4 -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/hooks/geoLocationListener.js +4 -4
- package/dist/esm/hooks/scrollListener.js +8 -8
- package/dist/esm/hooks/useAccessToken.js +3 -3
- package/dist/esm/hooks/useCurrentPage.js +2 -2
- package/dist/esm/hooks/useCustomData.js +2 -2
- package/dist/esm/hooks/useDevice.js +2 -2
- package/dist/esm/hooks/useDialogState.js +4 -4
- package/dist/esm/hooks/useEnvironment.js +2 -2
- package/dist/esm/hooks/useFunctions.js +2 -2
- package/dist/esm/hooks/useIsAdminMode.js +2 -2
- package/dist/esm/hooks/useLanguage.js +2 -2
- package/dist/esm/hooks/usePages.js +4 -4
- package/dist/esm/hooks/useParameters.js +2 -2
- package/dist/esm/hooks/useSite.js +2 -2
- package/dist/esm/hooks/useUser.js +2 -2
- package/dist/esm/hooks/useValues.js +2 -2
- package/dist/esm/hooks/windowMetricsListener.js +4 -4
- package/dist/esm/host/module/ModuleHost.js +3 -19
- package/dist/esm/host/module/utils/loadComponent.js +46 -53
- package/dist/esm/index.js +2 -0
- package/dist/esm/types/IChaynsReact.js +4 -4
- package/dist/types/calls/dialogs/alert.d.ts +1 -1
- package/dist/types/calls/dialogs/chaynsDialog.d.ts +24 -24
- package/dist/types/calls/dialogs/close.d.ts +1 -1
- package/dist/types/calls/dialogs/communication.d.ts +3 -3
- package/dist/types/calls/dialogs/confirm.d.ts +13 -13
- package/dist/types/calls/dialogs/date.d.ts +96 -96
- package/dist/types/calls/dialogs/dropUpAlert.d.ts +5 -5
- package/dist/types/calls/dialogs/fileSelect.d.ts +16 -16
- package/dist/types/calls/dialogs/iFrame.d.ts +10 -10
- package/dist/types/calls/dialogs/index.d.ts +14 -14
- package/dist/types/calls/dialogs/input.d.ts +15 -15
- package/dist/types/calls/dialogs/mediaSelect.d.ts +8 -8
- package/dist/types/calls/dialogs/open.d.ts +1 -1
- package/dist/types/calls/dialogs/select.d.ts +6 -6
- package/dist/types/calls/dialogs/signature.d.ts +7 -7
- package/dist/types/calls/dialogs/toast.d.ts +1 -1
- package/dist/types/calls/dialogs/utils/callback.d.ts +1 -1
- package/dist/types/calls/dialogs/utils/is.d.ts +4 -4
- package/dist/types/calls/getUserInfo.d.ts +9 -9
- package/dist/types/calls/index.d.ts +251 -255
- package/dist/types/calls/sendMessage.d.ts +13 -13
- package/dist/types/calls/visibilityChangeListener.d.ts +9 -9
- package/dist/types/components/AppDialogWrapper.d.ts +5 -5
- package/dist/types/components/ChaynsContext.d.ts +3 -3
- package/dist/types/components/ChaynsProvider.d.ts +11 -11
- package/dist/types/components/ErrorBoundary.d.ts +13 -13
- package/dist/types/components/WaitUntil.d.ts +7 -7
- package/dist/types/components/moduleWrapper.d.ts +4 -4
- package/dist/types/components/withCompatMode.d.ts +13 -13
- 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 +18 -18
- package/dist/types/helper/apiListenerHelper.d.ts +6 -6
- package/dist/types/hooks/geoLocationListener.d.ts +18 -18
- package/dist/types/hooks/index.d.ts +17 -17
- package/dist/types/hooks/scrollListener.d.ts +28 -28
- package/dist/types/hooks/useAccessToken.d.ts +6 -6
- package/dist/types/hooks/useCurrentPage.d.ts +4 -4
- package/dist/types/hooks/useCustomData.d.ts +4 -4
- package/dist/types/hooks/useDevice.d.ts +5 -5
- package/dist/types/hooks/useDialogState.d.ts +9 -9
- package/dist/types/hooks/useEnvironment.d.ts +5 -5
- package/dist/types/hooks/useFunctions.d.ts +5 -5
- package/dist/types/hooks/useIsAdminMode.d.ts +4 -4
- package/dist/types/hooks/useLanguage.d.ts +5 -5
- package/dist/types/hooks/usePages.d.ts +18 -18
- package/dist/types/hooks/useParameters.d.ts +5 -5
- package/dist/types/hooks/useSite.d.ts +5 -5
- package/dist/types/hooks/useUser.d.ts +5 -5
- package/dist/types/hooks/useValues.d.ts +5 -5
- package/dist/types/hooks/windowMetricsListener.d.ts +11 -11
- package/dist/types/host/ChaynsHost.d.ts +30 -30
- package/dist/types/host/iframe/HostIframe.d.ts +26 -26
- package/dist/types/host/iframe/utils/useUpdateData.d.ts +3 -3
- package/dist/types/host/module/ModuleHost.d.ts +27 -27
- package/dist/types/host/module/utils/loadComponent.d.ts +1 -1
- package/dist/types/host/module/utils/useDynamicScript.d.ts +9 -9
- package/dist/types/index.d.ts +21 -19
- package/dist/types/types/IChaynsReact.d.ts +816 -816
- package/dist/types/types/dialog.d.ts +41 -41
- package/dist/types/util/appCall.d.ts +2 -2
- package/dist/types/util/deviceHelper.d.ts +7 -7
- package/dist/types/util/heightHelper.d.ts +1 -1
- package/dist/types/util/postIframeForm.d.ts +1 -1
- package/dist/types/util/transferNestedFunctions.d.ts +1 -1
- package/dist/types/util/url.d.ts +1 -1
- package/dist/types/wrapper/AppWrapper.d.ts +22 -22
- package/dist/types/wrapper/FrameWrapper.d.ts +15 -15
- package/dist/types/wrapper/ModuleFederationWrapper.d.ts +10 -10
- package/dist/types/wrapper/SsrWrapper.d.ts +11 -11
- package/dist/types/wrapper/StaticChaynsApi.d.ts +9 -9
- package/package.json +79 -78
- package/toolkit.config.js +20 -20
- package/tsconfig.json +56 -56
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useEnvironment = void 0;
|
|
7
7
|
var _useContextSelector = require("use-context-selector");
|
|
8
8
|
var _ChaynsContext = require("../components/ChaynsContext");
|
|
9
|
-
/**
|
|
10
|
-
* @category Hooks
|
|
9
|
+
/**
|
|
10
|
+
* @category Hooks
|
|
11
11
|
*/
|
|
12
12
|
const useEnvironment = () => (0, _useContextSelector.useContextSelector)(_ChaynsContext.ChaynsContext, v => v === null || v === void 0 ? void 0 : v.environment);
|
|
13
13
|
exports.useEnvironment = useEnvironment;
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useFunctions = void 0;
|
|
7
7
|
var _useContextSelector = require("use-context-selector");
|
|
8
8
|
var _ChaynsContext = require("../components/ChaynsContext");
|
|
9
|
-
/**
|
|
10
|
-
* @category Hooks
|
|
9
|
+
/**
|
|
10
|
+
* @category Hooks
|
|
11
11
|
*/
|
|
12
12
|
const useFunctions = () => {
|
|
13
13
|
const t = (0, _useContextSelector.useContextSelector)(_ChaynsContext.ChaynsFunctionsContext, f => f || {});
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useIsAdminMode = void 0;
|
|
7
7
|
var _useContextSelector2 = require("use-context-selector");
|
|
8
8
|
var _ChaynsContext = require("../components/ChaynsContext");
|
|
9
|
-
/**
|
|
10
|
-
* @category Hooks
|
|
9
|
+
/**
|
|
10
|
+
* @category Hooks
|
|
11
11
|
*/
|
|
12
12
|
const useIsAdminMode = () => {
|
|
13
13
|
var _useContextSelector;
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useLanguage = void 0;
|
|
7
7
|
var _useContextSelector = require("use-context-selector");
|
|
8
8
|
var _ChaynsContext = require("../components/ChaynsContext");
|
|
9
|
-
/**
|
|
10
|
-
* @category Hooks
|
|
9
|
+
/**
|
|
10
|
+
* @category Hooks
|
|
11
11
|
*/
|
|
12
12
|
const useLanguage = () => (0, _useContextSelector.useContextSelector)(_ChaynsContext.ChaynsContext, v => v === null || v === void 0 ? void 0 : v.language);
|
|
13
13
|
exports.useLanguage = useLanguage;
|
|
@@ -7,8 +7,8 @@ exports.usePages = exports.usePage = exports.getPage = void 0;
|
|
|
7
7
|
var _useContextSelector = require("use-context-selector");
|
|
8
8
|
var _ChaynsContext = require("../components/ChaynsContext");
|
|
9
9
|
var _moduleWrapper = require("../components/moduleWrapper");
|
|
10
|
-
/**
|
|
11
|
-
* @category Hooks
|
|
10
|
+
/**
|
|
11
|
+
* @category Hooks
|
|
12
12
|
*/
|
|
13
13
|
const usePages = ({
|
|
14
14
|
siteId
|
|
@@ -21,8 +21,8 @@ const usePages = ({
|
|
|
21
21
|
}
|
|
22
22
|
return pages;
|
|
23
23
|
};
|
|
24
|
-
/**
|
|
25
|
-
* @category Hooks
|
|
24
|
+
/**
|
|
25
|
+
* @category Hooks
|
|
26
26
|
*/
|
|
27
27
|
exports.usePages = usePages;
|
|
28
28
|
const usePage = ({
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useParameters = void 0;
|
|
7
7
|
var _useContextSelector = require("use-context-selector");
|
|
8
8
|
var _ChaynsContext = require("../components/ChaynsContext");
|
|
9
|
-
/**
|
|
10
|
-
* @category Hooks
|
|
9
|
+
/**
|
|
10
|
+
* @category Hooks
|
|
11
11
|
*/
|
|
12
12
|
const useParameters = () => (0, _useContextSelector.useContextSelector)(_ChaynsContext.ChaynsContext, v => (v === null || v === void 0 ? void 0 : v.parameters) || []);
|
|
13
13
|
exports.useParameters = useParameters;
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useSite = void 0;
|
|
7
7
|
var _useContextSelector = require("use-context-selector");
|
|
8
8
|
var _ChaynsContext = require("../components/ChaynsContext");
|
|
9
|
-
/**
|
|
10
|
-
* @category Hooks
|
|
9
|
+
/**
|
|
10
|
+
* @category Hooks
|
|
11
11
|
*/
|
|
12
12
|
const useSite = () => (0, _useContextSelector.useContextSelector)(_ChaynsContext.ChaynsContext, v => v === null || v === void 0 ? void 0 : v.site);
|
|
13
13
|
exports.useSite = useSite;
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useUser = void 0;
|
|
7
7
|
var _useContextSelector = require("use-context-selector");
|
|
8
8
|
var _ChaynsContext = require("../components/ChaynsContext");
|
|
9
|
-
/**
|
|
10
|
-
* @category Hooks
|
|
9
|
+
/**
|
|
10
|
+
* @category Hooks
|
|
11
11
|
*/
|
|
12
12
|
const useUser = () => (0, _useContextSelector.useContextSelector)(_ChaynsContext.ChaynsContext, v => (v === null || v === void 0 ? void 0 : v.user) || {});
|
|
13
13
|
exports.useUser = useUser;
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useValues = void 0;
|
|
7
7
|
var _useContextSelector = require("use-context-selector");
|
|
8
8
|
var _ChaynsContext = require("../components/ChaynsContext");
|
|
9
|
-
/**
|
|
10
|
-
* @category Hooks
|
|
9
|
+
/**
|
|
10
|
+
* @category Hooks
|
|
11
11
|
*/
|
|
12
12
|
const useValues = () => {
|
|
13
13
|
const t = (0, _useContextSelector.useContextSelector)(_ChaynsContext.ChaynsContext, v => v || {});
|
|
@@ -8,8 +8,8 @@ var _useContextSelector = require("use-context-selector");
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _ChaynsContext = require("../components/ChaynsContext");
|
|
10
10
|
var _IChaynsReact = require("../types/IChaynsReact");
|
|
11
|
-
/**
|
|
12
|
-
* @category Hooks
|
|
11
|
+
/**
|
|
12
|
+
* @category Hooks
|
|
13
13
|
*/
|
|
14
14
|
const useWindowMetricsListener = () => {
|
|
15
15
|
const addListener = (0, _useContextSelector.useContextSelector)(_ChaynsContext.ChaynsFunctionsContext, v => v.addWindowMetricsListener);
|
|
@@ -24,8 +24,8 @@ const useWindowMetricsListener = () => {
|
|
|
24
24
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
25
25
|
}, []);
|
|
26
26
|
};
|
|
27
|
-
/**
|
|
28
|
-
* @category Hooks
|
|
27
|
+
/**
|
|
28
|
+
* @category Hooks
|
|
29
29
|
*/
|
|
30
30
|
exports.useWindowMetricsListener = useWindowMetricsListener;
|
|
31
31
|
const useWindowMetrics = ({
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _useDynamicScript = _interopRequireDefault(require("./utils/useDynamicScript"));
|
|
9
8
|
var _loadComponent = _interopRequireDefault(require("./utils/loadComponent"));
|
|
10
9
|
var _url = require("../../util/url");
|
|
11
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -16,25 +15,10 @@ const System = ({
|
|
|
16
15
|
fallback,
|
|
17
16
|
...props
|
|
18
17
|
}) => {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
failed
|
|
22
|
-
} = (0, _useDynamicScript.default)({
|
|
23
|
-
url: system === null || system === void 0 ? void 0 : system.url,
|
|
24
|
-
scope: system === null || system === void 0 ? void 0 : system.scope
|
|
25
|
-
});
|
|
26
|
-
const Component = (0, _react.useMemo)(() => {
|
|
27
|
-
// maybe return waitcursor instead
|
|
28
|
-
if (!system || !ready || failed) {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
return /*#__PURE__*/_react.default.lazy((0, _loadComponent.default)(system.scope, system.module, system.url, undefined, system.preventSingleton));
|
|
32
|
-
|
|
33
|
-
/* eslint-disable react-hooks/exhaustive-deps */
|
|
34
|
-
}, [system === null || system === void 0 ? void 0 : system.scope, ready, system === null || system === void 0 ? void 0 : system.url]);
|
|
35
|
-
return Component ? /*#__PURE__*/_react.default.createElement(_react.default.Suspense, {
|
|
18
|
+
const Component = (0, _react.useMemo)(() => (0, _loadComponent.default)(system.scope, system.module, system.url, undefined, system.preventSingleton), [system.scope, system.module, system.url, system.preventSingleton]);
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Suspense, {
|
|
36
20
|
fallback: fallback || ''
|
|
37
|
-
}, /*#__PURE__*/_react.default.createElement(Component, props))
|
|
21
|
+
}, /*#__PURE__*/_react.default.createElement(Component, props));
|
|
38
22
|
};
|
|
39
23
|
const ModuleHost = ({
|
|
40
24
|
system,
|
|
@@ -6,60 +6,53 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = loadComponent;
|
|
7
7
|
var _semver = _interopRequireDefault(require("semver"));
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var
|
|
9
|
+
var _runtime = require("@module-federation/runtime");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
let instances = {};
|
|
11
|
+
const registeredScopes = {};
|
|
12
|
+
const dynamicMap = {};
|
|
15
13
|
function loadComponent(scope, module, url, skipCompatMode = false, preventSingleton = false) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
14
|
+
if (skipCompatMode) {
|
|
15
|
+
console.warn('[chayns-api] skipCompatMode-option is deprecated and is set automatically now');
|
|
16
|
+
}
|
|
17
|
+
if (registeredScopes[scope] !== url || preventSingleton) {
|
|
18
|
+
(0, _runtime.registerRemotes)([{
|
|
19
|
+
name: scope,
|
|
20
|
+
entry: url,
|
|
21
|
+
alias: scope
|
|
22
|
+
}], {
|
|
23
|
+
force: scope in registeredScopes
|
|
24
|
+
});
|
|
25
|
+
registeredScopes[scope] = url;
|
|
26
|
+
dynamicMap[scope] = {};
|
|
27
|
+
}
|
|
28
|
+
if (!(module in dynamicMap[scope])) {
|
|
29
|
+
const path = `${scope}/${module.replace(/^\.\//, '')}`;
|
|
30
|
+
dynamicMap[scope][module] = /*#__PURE__*/_react.default.lazy(() => {
|
|
31
|
+
return (0, _runtime.loadRemote)(path).then(Module => {
|
|
32
|
+
// semantically equals skipCompatMode
|
|
33
|
+
if (typeof Module.default === 'function') {
|
|
34
|
+
return Module;
|
|
35
|
+
}
|
|
36
|
+
const hostVersion = _semver.default.minVersion(_react.default.version);
|
|
37
|
+
const {
|
|
38
|
+
requiredVersion,
|
|
39
|
+
environment
|
|
40
|
+
} = Module.default;
|
|
41
|
+
// @ts-expect-error
|
|
42
|
+
const webpackShareScopes = __webpack_share_scopes__.default;
|
|
43
|
+
const matchReactVersion = requiredVersion && _semver.default.satisfies(hostVersion, requiredVersion) && !Object.keys(webpackShareScopes.react).some(version => {
|
|
44
|
+
return _semver.default.gt(version, hostVersion) && _semver.default.satisfies(version, requiredVersion) || scope === webpackShareScopes.react[version].from.split('-').join('_');
|
|
45
|
+
});
|
|
46
|
+
if (!matchReactVersion || environment !== 'production' || process.env.NODE_ENV === 'development') {
|
|
47
|
+
return {
|
|
48
|
+
default: Module.default.CompatComponent
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
default: Module.default.Component
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
55
|
});
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
default: Module.default.CompatComponent
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
return {
|
|
62
|
-
default: Module.default.Component
|
|
63
|
-
};
|
|
64
|
-
};
|
|
56
|
+
}
|
|
57
|
+
return dynamicMap[scope][module];
|
|
65
58
|
}
|
|
@@ -7,9 +7,10 @@ exports.semaphore = exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _semaphoreAsyncAwait = _interopRequireDefault(require("semaphore-async-await"));
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
function _getRequireWildcardCache(
|
|
11
|
-
function _interopRequireWildcard(
|
|
12
|
-
const semaphore =
|
|
10
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
+
const semaphore = {};
|
|
13
|
+
exports.semaphore = semaphore;
|
|
13
14
|
const useDynamicScript = args => {
|
|
14
15
|
const [ready, setReady] = _react.default.useState(false);
|
|
15
16
|
const [failed, setFailed] = _react.default.useState(false);
|
|
@@ -56,4 +57,5 @@ const useDynamicScript = args => {
|
|
|
56
57
|
failed
|
|
57
58
|
};
|
|
58
59
|
};
|
|
59
|
-
var _default =
|
|
60
|
+
var _default = useDynamicScript;
|
|
61
|
+
exports.default = _default;
|
package/dist/cjs/index.js
CHANGED
|
@@ -10,6 +10,7 @@ var _exportNames = {
|
|
|
10
10
|
getClientDeviceInfo: true,
|
|
11
11
|
ChaynsHost: true,
|
|
12
12
|
withCompatMode: true,
|
|
13
|
+
withHydrationBoundary: true,
|
|
13
14
|
StaticChaynsApi: true,
|
|
14
15
|
DialogHandler: true,
|
|
15
16
|
dialog: true
|
|
@@ -63,6 +64,12 @@ Object.defineProperty(exports, "withCompatMode", {
|
|
|
63
64
|
return _withCompatMode.withCompatMode;
|
|
64
65
|
}
|
|
65
66
|
});
|
|
67
|
+
Object.defineProperty(exports, "withHydrationBoundary", {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function () {
|
|
70
|
+
return _withHydrationBoundary.default;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
66
73
|
require("./util/transferNestedFunctions");
|
|
67
74
|
var _ChaynsProvider = _interopRequireDefault(require("./components/ChaynsProvider"));
|
|
68
75
|
var _deviceHelper = _interopRequireWildcard(require("./util/deviceHelper"));
|
|
@@ -127,6 +134,19 @@ Object.keys(_IChaynsReact).forEach(function (key) {
|
|
|
127
134
|
}
|
|
128
135
|
});
|
|
129
136
|
});
|
|
137
|
+
var _constants = require("./constants");
|
|
138
|
+
Object.keys(_constants).forEach(function (key) {
|
|
139
|
+
if (key === "default" || key === "__esModule") return;
|
|
140
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
141
|
+
if (key in exports && exports[key] === _constants[key]) return;
|
|
142
|
+
Object.defineProperty(exports, key, {
|
|
143
|
+
enumerable: true,
|
|
144
|
+
get: function () {
|
|
145
|
+
return _constants[key];
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
var _withHydrationBoundary = _interopRequireDefault(require("./components/withHydrationBoundary"));
|
|
130
150
|
var _StaticChaynsApi = _interopRequireDefault(require("./wrapper/StaticChaynsApi"));
|
|
131
151
|
var _DialogHandler = _interopRequireDefault(require("./handler/DialogHandler"));
|
|
132
152
|
var _dialog = _interopRequireWildcard(require("./calls/dialogs/index"));
|
|
@@ -45,11 +45,11 @@ let ScreenSize = exports.ScreenSize = /*#__PURE__*/function (ScreenSize) {
|
|
|
45
45
|
ScreenSize[ScreenSize["XL"] = 4] = "XL";
|
|
46
46
|
return ScreenSize;
|
|
47
47
|
}({});
|
|
48
|
-
/**
|
|
49
|
-
* @ignore
|
|
48
|
+
/**
|
|
49
|
+
* @ignore
|
|
50
50
|
*/
|
|
51
|
-
/**
|
|
52
|
-
* @ignore
|
|
51
|
+
/**
|
|
52
|
+
* @ignore
|
|
53
53
|
*/
|
|
54
54
|
let AccessMode = exports.AccessMode = /*#__PURE__*/function (AccessMode) {
|
|
55
55
|
AccessMode[AccessMode["public"] = 0] = "public";
|
|
@@ -3,32 +3,32 @@ import { isDate, isNumber, isObject } from './utils/is';
|
|
|
3
3
|
import { open } from './open';
|
|
4
4
|
import { getDevice } from "../index";
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
* The config object for date dialog
|
|
8
|
-
* @typedef {Object} dateConfig
|
|
9
|
-
* @property {Date} preSelect - The date object which should be preselected.
|
|
10
|
-
* @property {Date} minDate - The min date which you could select.
|
|
11
|
-
* @property {Date} maxDate - The max date which you could select.
|
|
12
|
-
* @property {dateDialogType} dateType - The type of dialog you want to display.
|
|
13
|
-
* @property {number} minuteIntervall - The interval for special minutes, possible are 2, 3, 4, 5, 6, 12, 15, 20, 30. Default is 1.
|
|
14
|
-
* @property {string} message - The message that is displayed above the date dialog, only in apps supported
|
|
15
|
-
* @property {string} title - The title that is displayed above the message, only in apps supported
|
|
6
|
+
/**
|
|
7
|
+
* The config object for date dialog
|
|
8
|
+
* @typedef {Object} dateConfig
|
|
9
|
+
* @property {Date} preSelect - The date object which should be preselected.
|
|
10
|
+
* @property {Date} minDate - The min date which you could select.
|
|
11
|
+
* @property {Date} maxDate - The max date which you could select.
|
|
12
|
+
* @property {dateDialogType} dateType - The type of dialog you want to display.
|
|
13
|
+
* @property {number} minuteIntervall - The interval for special minutes, possible are 2, 3, 4, 5, 6, 12, 15, 20, 30. Default is 1.
|
|
14
|
+
* @property {string} message - The message that is displayed above the date dialog, only in apps supported
|
|
15
|
+
* @property {string} title - The title that is displayed above the message, only in apps supported
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
/**
|
|
19
|
-
* This call will open a date select dialog.
|
|
20
|
-
* <div>Call: 30</div>
|
|
21
|
-
* @param {dateConfig} config - Define the configuration of this call
|
|
22
|
-
* @return {Promise} contains a timestamp as result
|
|
23
|
-
* @example chayns.dialog.date({
|
|
24
|
-
* 'dateType': chayns.dialog.dateType.DATE_TIME,
|
|
25
|
-
* 'preSelect': new Date(2018, 6, 14, 0, 0, 0),
|
|
26
|
-
* 'minDate': new Date(2018, 6, 1, 15, 0, 0),
|
|
27
|
-
* 'maxDate': new Date(2019, 6, 1, 0, 23, 0),
|
|
28
|
-
* 'minuteInterval': 15
|
|
29
|
-
* ).then(function (data) {
|
|
30
|
-
* console.log(data);
|
|
31
|
-
* });
|
|
18
|
+
/**
|
|
19
|
+
* This call will open a date select dialog.
|
|
20
|
+
* <div>Call: 30</div>
|
|
21
|
+
* @param {dateConfig} config - Define the configuration of this call
|
|
22
|
+
* @return {Promise} contains a timestamp as result
|
|
23
|
+
* @example chayns.dialog.date({
|
|
24
|
+
* 'dateType': chayns.dialog.dateType.DATE_TIME,
|
|
25
|
+
* 'preSelect': new Date(2018, 6, 14, 0, 0, 0),
|
|
26
|
+
* 'minDate': new Date(2018, 6, 1, 15, 0, 0),
|
|
27
|
+
* 'maxDate': new Date(2019, 6, 1, 0, 23, 0),
|
|
28
|
+
* 'minuteInterval': 15
|
|
29
|
+
* ).then(function (data) {
|
|
30
|
+
* console.log(data);
|
|
31
|
+
* });
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
34
|
export function date() {
|
|
@@ -165,18 +165,18 @@ export function advancedDate() {
|
|
|
165
165
|
});
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
/**
|
|
169
|
-
* @typedef {number} dateDialogType
|
|
168
|
+
/**
|
|
169
|
+
* @typedef {number} dateDialogType
|
|
170
170
|
*/
|
|
171
171
|
|
|
172
|
-
/**
|
|
173
|
-
* Enum for date dialog
|
|
174
|
-
* <div>DATE will open a dialog where you can select a special day</div>
|
|
175
|
-
* <div>TIME will open a dialog where you can only select a special time</div>
|
|
176
|
-
* <div>DATE_TIME will open a dialog where you can select a special time on a special day</div>
|
|
177
|
-
* @readonly
|
|
178
|
-
* @enum {dateDialogType}
|
|
179
|
-
* @type {{DATE: number, TIME: number, DATE_TIME: number}}
|
|
172
|
+
/**
|
|
173
|
+
* Enum for date dialog
|
|
174
|
+
* <div>DATE will open a dialog where you can select a special day</div>
|
|
175
|
+
* <div>TIME will open a dialog where you can only select a special time</div>
|
|
176
|
+
* <div>DATE_TIME will open a dialog where you can select a special time on a special day</div>
|
|
177
|
+
* @readonly
|
|
178
|
+
* @enum {dateDialogType}
|
|
179
|
+
* @type {{DATE: number, TIME: number, DATE_TIME: number}}
|
|
180
180
|
*/
|
|
181
181
|
export const dateType = {
|
|
182
182
|
'DATE': 1,
|