chayns-api 2.1.11 → 2.1.12
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/index.js +21 -0
- package/dist/cjs/hooks/context.js +5 -21
- package/dist/cjs/umd.index.js +89 -0
- package/dist/cjs/wrapper/AppWrapper.js +1 -0
- package/dist/esm/calls/index.js +21 -0
- package/dist/esm/hooks/context.js +5 -18
- package/dist/esm/index.js +0 -1
- package/dist/esm/umd.index.js +9 -0
- package/dist/esm/wrapper/AppWrapper.js +1 -0
- package/dist/types/hooks/context.d.ts +3 -4
- package/dist/types/host/ChaynsHost.d.ts +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/types/IChaynsReact.d.ts +5 -3
- package/dist/types/umd.index.d.ts +8 -0
- package/dist/types/wrapper/StaticChaynsApi.d.ts +0 -1
- package/package.json +3 -2
- package/toolkit.config.js +18 -11
package/dist/cjs/calls/index.js
CHANGED
|
@@ -124,6 +124,9 @@ exports.getCustomFunction = getCustomFunction;
|
|
|
124
124
|
const user = exports.user = new Proxy({}, {
|
|
125
125
|
get: (target, prop) => {
|
|
126
126
|
var _moduleWrapper$curren;
|
|
127
|
+
if (prop === '$$typeof') {
|
|
128
|
+
return 'object';
|
|
129
|
+
}
|
|
127
130
|
console.warn('Deprecated user import');
|
|
128
131
|
return (_moduleWrapper$curren = _moduleWrapper.moduleWrapper.current.values.user) === null || _moduleWrapper$curren === void 0 ? void 0 : _moduleWrapper$curren[prop];
|
|
129
132
|
}
|
|
@@ -131,6 +134,9 @@ const user = exports.user = new Proxy({}, {
|
|
|
131
134
|
const site = exports.site = new Proxy({}, {
|
|
132
135
|
get: (target, prop) => {
|
|
133
136
|
var _moduleWrapper$curren2;
|
|
137
|
+
if (prop === '$$typeof') {
|
|
138
|
+
return 'object';
|
|
139
|
+
}
|
|
134
140
|
console.warn('Deprecated site import');
|
|
135
141
|
return (_moduleWrapper$curren2 = _moduleWrapper.moduleWrapper.current.values.site) === null || _moduleWrapper$curren2 === void 0 ? void 0 : _moduleWrapper$curren2[prop];
|
|
136
142
|
}
|
|
@@ -138,6 +144,9 @@ const site = exports.site = new Proxy({}, {
|
|
|
138
144
|
const device = exports.device = new Proxy({}, {
|
|
139
145
|
get: (target, prop) => {
|
|
140
146
|
var _moduleWrapper$curren3;
|
|
147
|
+
if (prop === '$$typeof') {
|
|
148
|
+
return 'object';
|
|
149
|
+
}
|
|
141
150
|
console.warn('Deprecated device import');
|
|
142
151
|
return (_moduleWrapper$curren3 = _moduleWrapper.moduleWrapper.current.values.device) === null || _moduleWrapper$curren3 === void 0 ? void 0 : _moduleWrapper$curren3[prop];
|
|
143
152
|
}
|
|
@@ -145,6 +154,9 @@ const device = exports.device = new Proxy({}, {
|
|
|
145
154
|
const language = exports.language = new Proxy({}, {
|
|
146
155
|
get: (target, prop) => {
|
|
147
156
|
var _moduleWrapper$curren4;
|
|
157
|
+
if (prop === '$$typeof') {
|
|
158
|
+
return 'object';
|
|
159
|
+
}
|
|
148
160
|
console.warn('Deprecated language import');
|
|
149
161
|
return (_moduleWrapper$curren4 = _moduleWrapper.moduleWrapper.current.values.language) === null || _moduleWrapper$curren4 === void 0 ? void 0 : _moduleWrapper$curren4[prop];
|
|
150
162
|
}
|
|
@@ -152,6 +164,9 @@ const language = exports.language = new Proxy({}, {
|
|
|
152
164
|
const parameters = exports.parameters = new Proxy({}, {
|
|
153
165
|
get: (target, prop) => {
|
|
154
166
|
var _moduleWrapper$curren5;
|
|
167
|
+
if (prop === '$$typeof') {
|
|
168
|
+
return 'object';
|
|
169
|
+
}
|
|
155
170
|
console.warn('Deprecated parameters import');
|
|
156
171
|
return (_moduleWrapper$curren5 = _moduleWrapper.moduleWrapper.current.values.parameters) === null || _moduleWrapper$curren5 === void 0 ? void 0 : _moduleWrapper$curren5[prop];
|
|
157
172
|
}
|
|
@@ -159,6 +174,9 @@ const parameters = exports.parameters = new Proxy({}, {
|
|
|
159
174
|
const pages = exports.pages = new Proxy({}, {
|
|
160
175
|
get: (target, prop) => {
|
|
161
176
|
var _moduleWrapper$curren6;
|
|
177
|
+
if (prop === '$$typeof') {
|
|
178
|
+
return 'object';
|
|
179
|
+
}
|
|
162
180
|
console.warn('Deprecated pages import');
|
|
163
181
|
return (_moduleWrapper$curren6 = _moduleWrapper.moduleWrapper.current.values.pages) === null || _moduleWrapper$curren6 === void 0 ? void 0 : _moduleWrapper$curren6[prop];
|
|
164
182
|
}
|
|
@@ -166,6 +184,9 @@ const pages = exports.pages = new Proxy({}, {
|
|
|
166
184
|
const environment = exports.environment = new Proxy({}, {
|
|
167
185
|
get: (target, prop) => {
|
|
168
186
|
var _moduleWrapper$curren7;
|
|
187
|
+
if (prop === '$$typeof') {
|
|
188
|
+
return 'object';
|
|
189
|
+
}
|
|
169
190
|
console.warn('Deprecated environment import');
|
|
170
191
|
return (_moduleWrapper$curren7 = _moduleWrapper.moduleWrapper.current.values.environment) === null || _moduleWrapper$curren7 === void 0 ? void 0 : _moduleWrapper$curren7[prop];
|
|
171
192
|
}
|
|
@@ -7,30 +7,14 @@ exports.useValuesSelector = exports.useFunctionsSelector = exports.useCustomFunc
|
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _shim = require("use-sync-external-store/shim");
|
|
9
9
|
var _ChaynsContext = require("../components/ChaynsContext");
|
|
10
|
-
const
|
|
10
|
+
const useChaynsSelector = key => selector => {
|
|
11
11
|
const store = (0, _react.useContext)(_ChaynsContext.ChaynsContext);
|
|
12
12
|
if (!store) {
|
|
13
13
|
throw new Error('Could not find chayns context. Did you forget to add ChaynsProvider?');
|
|
14
14
|
}
|
|
15
|
-
const getSnapshot = () => selector(store
|
|
15
|
+
const getSnapshot = () => selector(store[key]);
|
|
16
16
|
return (0, _shim.useSyncExternalStore)(store.subscribe, getSnapshot, getSnapshot);
|
|
17
17
|
};
|
|
18
|
-
exports.useValuesSelector =
|
|
19
|
-
const useFunctionsSelector =
|
|
20
|
-
|
|
21
|
-
if (!store) {
|
|
22
|
-
throw new Error('Could not find chayns context. Did you forget to add ChaynsProvider?');
|
|
23
|
-
}
|
|
24
|
-
const getSnapshot = () => selector(store.functions);
|
|
25
|
-
return (0, _shim.useSyncExternalStore)(store.subscribe, getSnapshot, getSnapshot);
|
|
26
|
-
};
|
|
27
|
-
exports.useFunctionsSelector = useFunctionsSelector;
|
|
28
|
-
const useCustomFunctionsSelector = selector => {
|
|
29
|
-
const store = (0, _react.useContext)(_ChaynsContext.ChaynsContext);
|
|
30
|
-
if (!store) {
|
|
31
|
-
throw new Error('Could not find chayns context. Did you forget to add ChaynsProvider?');
|
|
32
|
-
}
|
|
33
|
-
const getSnapshot = () => selector(store.customFunctions);
|
|
34
|
-
return (0, _shim.useSyncExternalStore)(store.subscribe, getSnapshot, getSnapshot);
|
|
35
|
-
};
|
|
36
|
-
exports.useCustomFunctionsSelector = useCustomFunctionsSelector;
|
|
18
|
+
const useValuesSelector = exports.useValuesSelector = useChaynsSelector('values');
|
|
19
|
+
const useFunctionsSelector = exports.useFunctionsSelector = useChaynsSelector('functions');
|
|
20
|
+
const useCustomFunctionsSelector = exports.useCustomFunctionsSelector = useChaynsSelector('customFunctions');
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
getDeviceInfo: true,
|
|
8
|
+
getScreenSize: true,
|
|
9
|
+
getClientDeviceInfo: true,
|
|
10
|
+
StaticChaynsApi: true,
|
|
11
|
+
DialogHandler: true,
|
|
12
|
+
dialog: true
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "DialogHandler", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () {
|
|
17
|
+
return _DialogHandler.default;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "StaticChaynsApi", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () {
|
|
23
|
+
return _StaticChaynsApi.default;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
exports.dialog = void 0;
|
|
27
|
+
Object.defineProperty(exports, "getClientDeviceInfo", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () {
|
|
30
|
+
return _deviceHelper.getClientDeviceInfo;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(exports, "getDeviceInfo", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function () {
|
|
36
|
+
return _deviceHelper.default;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(exports, "getScreenSize", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () {
|
|
42
|
+
return _deviceHelper.getScreenSize;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
require("./util/transferNestedFunctions");
|
|
46
|
+
var _deviceHelper = _interopRequireWildcard(require("./util/deviceHelper"));
|
|
47
|
+
var _calls = require("./calls");
|
|
48
|
+
Object.keys(_calls).forEach(function (key) {
|
|
49
|
+
if (key === "default" || key === "__esModule") return;
|
|
50
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
51
|
+
if (key in exports && exports[key] === _calls[key]) return;
|
|
52
|
+
Object.defineProperty(exports, key, {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: function () {
|
|
55
|
+
return _calls[key];
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
var _IChaynsReact = require("./types/IChaynsReact");
|
|
60
|
+
Object.keys(_IChaynsReact).forEach(function (key) {
|
|
61
|
+
if (key === "default" || key === "__esModule") return;
|
|
62
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
63
|
+
if (key in exports && exports[key] === _IChaynsReact[key]) return;
|
|
64
|
+
Object.defineProperty(exports, key, {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function () {
|
|
67
|
+
return _IChaynsReact[key];
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
var _is = require("./util/is");
|
|
72
|
+
Object.keys(_is).forEach(function (key) {
|
|
73
|
+
if (key === "default" || key === "__esModule") return;
|
|
74
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
75
|
+
if (key in exports && exports[key] === _is[key]) return;
|
|
76
|
+
Object.defineProperty(exports, key, {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function () {
|
|
79
|
+
return _is[key];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
var _StaticChaynsApi = _interopRequireDefault(require("./wrapper/StaticChaynsApi"));
|
|
84
|
+
var _DialogHandler = _interopRequireDefault(require("./handler/DialogHandler"));
|
|
85
|
+
var _dialog = _interopRequireWildcard(require("./calls/dialogs/index"));
|
|
86
|
+
exports.dialog = _dialog;
|
|
87
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
88
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
89
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
package/dist/esm/calls/index.js
CHANGED
|
@@ -154,6 +154,9 @@ export const getCustomFunction = key => moduleWrapper.current.customFunctions[ke
|
|
|
154
154
|
export const user = new Proxy({}, {
|
|
155
155
|
get: (target, prop) => {
|
|
156
156
|
var _moduleWrapper$curren;
|
|
157
|
+
if (prop === '$$typeof') {
|
|
158
|
+
return 'object';
|
|
159
|
+
}
|
|
157
160
|
console.warn('Deprecated user import');
|
|
158
161
|
return (_moduleWrapper$curren = moduleWrapper.current.values.user) === null || _moduleWrapper$curren === void 0 ? void 0 : _moduleWrapper$curren[prop];
|
|
159
162
|
}
|
|
@@ -161,6 +164,9 @@ export const user = new Proxy({}, {
|
|
|
161
164
|
export const site = new Proxy({}, {
|
|
162
165
|
get: (target, prop) => {
|
|
163
166
|
var _moduleWrapper$curren2;
|
|
167
|
+
if (prop === '$$typeof') {
|
|
168
|
+
return 'object';
|
|
169
|
+
}
|
|
164
170
|
console.warn('Deprecated site import');
|
|
165
171
|
return (_moduleWrapper$curren2 = moduleWrapper.current.values.site) === null || _moduleWrapper$curren2 === void 0 ? void 0 : _moduleWrapper$curren2[prop];
|
|
166
172
|
}
|
|
@@ -168,6 +174,9 @@ export const site = new Proxy({}, {
|
|
|
168
174
|
export const device = new Proxy({}, {
|
|
169
175
|
get: (target, prop) => {
|
|
170
176
|
var _moduleWrapper$curren3;
|
|
177
|
+
if (prop === '$$typeof') {
|
|
178
|
+
return 'object';
|
|
179
|
+
}
|
|
171
180
|
console.warn('Deprecated device import');
|
|
172
181
|
return (_moduleWrapper$curren3 = moduleWrapper.current.values.device) === null || _moduleWrapper$curren3 === void 0 ? void 0 : _moduleWrapper$curren3[prop];
|
|
173
182
|
}
|
|
@@ -175,6 +184,9 @@ export const device = new Proxy({}, {
|
|
|
175
184
|
export const language = new Proxy({}, {
|
|
176
185
|
get: (target, prop) => {
|
|
177
186
|
var _moduleWrapper$curren4;
|
|
187
|
+
if (prop === '$$typeof') {
|
|
188
|
+
return 'object';
|
|
189
|
+
}
|
|
178
190
|
console.warn('Deprecated language import');
|
|
179
191
|
return (_moduleWrapper$curren4 = moduleWrapper.current.values.language) === null || _moduleWrapper$curren4 === void 0 ? void 0 : _moduleWrapper$curren4[prop];
|
|
180
192
|
}
|
|
@@ -182,6 +194,9 @@ export const language = new Proxy({}, {
|
|
|
182
194
|
export const parameters = new Proxy({}, {
|
|
183
195
|
get: (target, prop) => {
|
|
184
196
|
var _moduleWrapper$curren5;
|
|
197
|
+
if (prop === '$$typeof') {
|
|
198
|
+
return 'object';
|
|
199
|
+
}
|
|
185
200
|
console.warn('Deprecated parameters import');
|
|
186
201
|
return (_moduleWrapper$curren5 = moduleWrapper.current.values.parameters) === null || _moduleWrapper$curren5 === void 0 ? void 0 : _moduleWrapper$curren5[prop];
|
|
187
202
|
}
|
|
@@ -189,6 +204,9 @@ export const parameters = new Proxy({}, {
|
|
|
189
204
|
export const pages = new Proxy({}, {
|
|
190
205
|
get: (target, prop) => {
|
|
191
206
|
var _moduleWrapper$curren6;
|
|
207
|
+
if (prop === '$$typeof') {
|
|
208
|
+
return 'object';
|
|
209
|
+
}
|
|
192
210
|
console.warn('Deprecated pages import');
|
|
193
211
|
return (_moduleWrapper$curren6 = moduleWrapper.current.values.pages) === null || _moduleWrapper$curren6 === void 0 ? void 0 : _moduleWrapper$curren6[prop];
|
|
194
212
|
}
|
|
@@ -196,6 +214,9 @@ export const pages = new Proxy({}, {
|
|
|
196
214
|
export const environment = new Proxy({}, {
|
|
197
215
|
get: (target, prop) => {
|
|
198
216
|
var _moduleWrapper$curren7;
|
|
217
|
+
if (prop === '$$typeof') {
|
|
218
|
+
return 'object';
|
|
219
|
+
}
|
|
199
220
|
console.warn('Deprecated environment import');
|
|
200
221
|
return (_moduleWrapper$curren7 = moduleWrapper.current.values.environment) === null || _moduleWrapper$curren7 === void 0 ? void 0 : _moduleWrapper$curren7[prop];
|
|
201
222
|
}
|
|
@@ -1,27 +1,14 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
2
|
import { useSyncExternalStore } from 'use-sync-external-store/shim';
|
|
3
3
|
import { ChaynsContext } from '../components/ChaynsContext';
|
|
4
|
-
|
|
4
|
+
const useChaynsSelector = key => selector => {
|
|
5
5
|
const store = useContext(ChaynsContext);
|
|
6
6
|
if (!store) {
|
|
7
7
|
throw new Error('Could not find chayns context. Did you forget to add ChaynsProvider?');
|
|
8
8
|
}
|
|
9
|
-
const getSnapshot = () => selector(store
|
|
9
|
+
const getSnapshot = () => selector(store[key]);
|
|
10
10
|
return useSyncExternalStore(store.subscribe, getSnapshot, getSnapshot);
|
|
11
11
|
};
|
|
12
|
-
export const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
throw new Error('Could not find chayns context. Did you forget to add ChaynsProvider?');
|
|
16
|
-
}
|
|
17
|
-
const getSnapshot = () => selector(store.functions);
|
|
18
|
-
return useSyncExternalStore(store.subscribe, getSnapshot, getSnapshot);
|
|
19
|
-
};
|
|
20
|
-
export const useCustomFunctionsSelector = selector => {
|
|
21
|
-
const store = useContext(ChaynsContext);
|
|
22
|
-
if (!store) {
|
|
23
|
-
throw new Error('Could not find chayns context. Did you forget to add ChaynsProvider?');
|
|
24
|
-
}
|
|
25
|
-
const getSnapshot = () => selector(store.customFunctions);
|
|
26
|
-
return useSyncExternalStore(store.subscribe, getSnapshot, getSnapshot);
|
|
27
|
-
};
|
|
12
|
+
export const useValuesSelector = useChaynsSelector('values');
|
|
13
|
+
export const useFunctionsSelector = useChaynsSelector('functions');
|
|
14
|
+
export const useCustomFunctionsSelector = useChaynsSelector('customFunctions');
|
package/dist/esm/index.js
CHANGED
|
@@ -16,6 +16,5 @@ export { default as loadComponent, loadModule } from './host/module/utils/loadCo
|
|
|
16
16
|
export { default as DialogHandler } from './handler/DialogHandler';
|
|
17
17
|
import * as _dialog from './calls/dialogs/index';
|
|
18
18
|
export { _dialog as dialog };
|
|
19
|
-
export * from './types/IChaynsReact';
|
|
20
19
|
export * from './util/initModuleFederationSharing';
|
|
21
20
|
export * from './util/bindChaynsApi';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import './util/transferNestedFunctions';
|
|
2
|
+
export { default as getDeviceInfo, getScreenSize, getClientDeviceInfo } from './util/deviceHelper';
|
|
3
|
+
export * from './calls';
|
|
4
|
+
export * from './types/IChaynsReact';
|
|
5
|
+
export * from './util/is';
|
|
6
|
+
export { default as StaticChaynsApi } from './wrapper/StaticChaynsApi';
|
|
7
|
+
export { default as DialogHandler } from './handler/DialogHandler';
|
|
8
|
+
import * as _dialog from './calls/dialogs/index';
|
|
9
|
+
export { _dialog as dialog };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const useCustomFunctionsSelector: <Result>(selector: (value: IChaynsReact["customFunctions"]) => Result) => Result;
|
|
1
|
+
export declare const useValuesSelector: <Result>(selector: (value: import("../types/IChaynsReact").ChaynsReactValues) => Result) => Result;
|
|
2
|
+
export declare const useFunctionsSelector: <Result>(selector: (value: import("../types/IChaynsReact").ChaynsReactFunctions) => Result) => Result;
|
|
3
|
+
export declare const useCustomFunctionsSelector: <Result>(selector: (value: import("../types/IChaynsReact").ChaynsReactCustomFunctions) => Result) => Result;
|
|
@@ -2,7 +2,7 @@ import React, { FC } from 'react';
|
|
|
2
2
|
import { TypeSystem } from './module/ModuleHost';
|
|
3
3
|
import { ChaynsApiDevice, ChaynsApiSite, ChaynsApiUser, ChaynsReactFunctions, ChaynsReactValues, IChaynsReact, Page } from '../types/IChaynsReact';
|
|
4
4
|
type ChaynsHostType = {
|
|
5
|
-
type:
|
|
5
|
+
type: `${'client' | 'server'}-${'iframe' | 'module'}`;
|
|
6
6
|
iFrameProps?: {
|
|
7
7
|
[key: string]: unknown;
|
|
8
8
|
name: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -15,6 +15,5 @@ export { default as StaticChaynsApi } from './wrapper/StaticChaynsApi';
|
|
|
15
15
|
export { default as loadComponent, loadModule } from './host/module/utils/loadComponent';
|
|
16
16
|
export { default as DialogHandler } from './handler/DialogHandler';
|
|
17
17
|
export * as dialog from './calls/dialogs/index';
|
|
18
|
-
export * from './types/IChaynsReact';
|
|
19
18
|
export * from './util/initModuleFederationSharing';
|
|
20
19
|
export * from './util/bindChaynsApi';
|
|
@@ -165,6 +165,7 @@ export type ChaynsApiUser = {
|
|
|
165
165
|
uacGroups?: UacGroup[];
|
|
166
166
|
userId?: number;
|
|
167
167
|
personId?: string;
|
|
168
|
+
isAnonymous?: boolean;
|
|
168
169
|
};
|
|
169
170
|
export type ChaynsApiSite = {
|
|
170
171
|
id: string;
|
|
@@ -358,6 +359,9 @@ export interface ChaynsReactFunctions {
|
|
|
358
359
|
removeDialogHostEventListener: (id: number) => Promise<void>;
|
|
359
360
|
addAnonymousAccount: () => Promise<AnonymousAccountResult>;
|
|
360
361
|
}
|
|
362
|
+
export type ChaynsReactCustomFunctions = {
|
|
363
|
+
[key: string]: <A extends Array<any>, O>(...args: A) => Promise<O>;
|
|
364
|
+
};
|
|
361
365
|
export type DialogResult = {
|
|
362
366
|
open: () => Promise<any>;
|
|
363
367
|
close: (buttonType: DialogButtonType, data: any) => Promise<void>;
|
|
@@ -553,9 +557,7 @@ interface DesignSettingsUpdateItem {
|
|
|
553
557
|
export interface IChaynsReact {
|
|
554
558
|
values: ChaynsReactValues;
|
|
555
559
|
functions: ChaynsReactFunctions;
|
|
556
|
-
customFunctions:
|
|
557
|
-
[key: string]: <A extends Array<any>, O>(...args: A) => Promise<O>;
|
|
558
|
-
};
|
|
560
|
+
customFunctions: ChaynsReactCustomFunctions;
|
|
559
561
|
addDataListener: (cb: DataChangeCallback) => CleanupCallback;
|
|
560
562
|
getSSRData: () => ChaynsReactValues | null;
|
|
561
563
|
init: () => Promise<void>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import './util/transferNestedFunctions';
|
|
2
|
+
export { default as getDeviceInfo, getScreenSize, getClientDeviceInfo } from './util/deviceHelper';
|
|
3
|
+
export * from './calls';
|
|
4
|
+
export * from './types/IChaynsReact';
|
|
5
|
+
export * from './util/is';
|
|
6
|
+
export { default as StaticChaynsApi } from './wrapper/StaticChaynsApi';
|
|
7
|
+
export { default as DialogHandler } from './handler/DialogHandler';
|
|
8
|
+
export * as dialog from './calls/dialogs/index';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chayns-api",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.12",
|
|
4
4
|
"description": "new chayns api",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"@babel/preset-react": "^7.26.3",
|
|
58
58
|
"@babel/preset-typescript": "^7.26.0",
|
|
59
59
|
"@chayns-toolkit/eslint-config": "^2.0.0",
|
|
60
|
+
"@rsbuild/plugin-umd": "^1.0.4",
|
|
60
61
|
"@types/htmlescape": "^1.1.3",
|
|
61
62
|
"@types/lodash.throttle": "^4.1.9",
|
|
62
63
|
"@types/prop-types": "^15.7.12",
|
|
@@ -65,7 +66,7 @@
|
|
|
65
66
|
"@types/ua-parser-js": "^0.7.39",
|
|
66
67
|
"@types/use-sync-external-store": "^0.0.6",
|
|
67
68
|
"@typescript-eslint/parser": "^7.6.0",
|
|
68
|
-
"chayns-toolkit": "^
|
|
69
|
+
"chayns-toolkit": "^3.1.3",
|
|
69
70
|
"concurrently": "^9.1.2",
|
|
70
71
|
"cross-env": "^7.0.3",
|
|
71
72
|
"prettier": "^3.4.2",
|
package/toolkit.config.js
CHANGED
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
const
|
|
1
|
+
const { buildToolkitConfig } = require('chayns-toolkit');
|
|
2
|
+
const { pluginUmd } = require('@rsbuild/plugin-umd');
|
|
2
3
|
|
|
3
|
-
module.exports = {
|
|
4
|
+
module.exports = buildToolkitConfig({
|
|
4
5
|
development: {
|
|
5
|
-
host:
|
|
6
|
+
host: '0.0.0.0',
|
|
6
7
|
port: 8081,
|
|
7
8
|
},
|
|
8
9
|
output: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
filename: {
|
|
11
|
+
js: '[name].js',
|
|
12
|
+
},
|
|
13
|
+
entryPoints: {
|
|
14
|
+
['chayns-api']: {
|
|
15
|
+
pathIndex: './src/umd.index.js',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
path: 'dist',
|
|
12
19
|
},
|
|
13
20
|
webpack(config) {
|
|
14
|
-
config.
|
|
21
|
+
config.plugins.push(pluginUmd({
|
|
15
22
|
name: 'ChaynsApi',
|
|
16
|
-
|
|
17
|
-
|
|
23
|
+
}));
|
|
24
|
+
config.output.sourceMap = false;
|
|
18
25
|
return config;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
26
|
+
},
|
|
27
|
+
});
|