chayns-api 1.0.0 → 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.
Files changed (205) hide show
  1. package/dist/cjs/bootstrap.js +11 -0
  2. package/dist/cjs/calls/abstractApiListener.js +40 -0
  3. package/dist/cjs/calls/apiEventListener.js +40 -0
  4. package/dist/cjs/calls/dialogs/alert.js +2 -0
  5. package/dist/cjs/calls/dialogs/chaynsDialog.js +8 -2
  6. package/dist/cjs/calls/dialogs/close.js +2 -0
  7. package/dist/cjs/calls/dialogs/communication.js +16 -1
  8. package/dist/cjs/calls/dialogs/confirm.js +4 -0
  9. package/dist/cjs/calls/dialogs/date.js +53 -36
  10. package/dist/cjs/calls/dialogs/dropUpAlert.js +3 -0
  11. package/dist/cjs/calls/dialogs/fileSelect.js +10 -0
  12. package/dist/cjs/calls/dialogs/iFrame.js +8 -0
  13. package/dist/cjs/calls/dialogs/index.js +27 -0
  14. package/dist/cjs/calls/dialogs/input.js +6 -0
  15. package/dist/cjs/calls/dialogs/mediaSelect.js +7 -0
  16. package/dist/cjs/calls/dialogs/open.js +2 -0
  17. package/dist/cjs/calls/dialogs/select.js +9 -0
  18. package/dist/cjs/calls/dialogs/signature.js +5 -0
  19. package/dist/cjs/calls/dialogs/toast.js +3 -0
  20. package/dist/cjs/calls/dialogs/utils/callback.js +2 -0
  21. package/dist/cjs/calls/dialogs/utils/is.js +4 -0
  22. package/dist/cjs/calls/getUserInfo.js +11 -0
  23. package/dist/cjs/calls/index.js +155 -3
  24. package/dist/cjs/calls/sendMessage.js +26 -0
  25. package/dist/cjs/calls/setVisibilityChangeListener.js +1 -0
  26. package/dist/cjs/calls/visibilityChangeListener.js +12 -1
  27. package/dist/cjs/calls/windowMetricsListener.js +18 -0
  28. package/dist/cjs/components/App.js +32 -0
  29. package/dist/cjs/components/App.spec.js +16 -0
  30. package/dist/cjs/components/Button.js +32 -0
  31. package/dist/cjs/components/ChaynsContext.js +4 -2
  32. package/dist/cjs/components/ChaynsProvider.js +28 -6
  33. package/dist/cjs/components/ChaynsProviderExposed.js +16 -0
  34. package/dist/cjs/components/TestProvider.js +236 -0
  35. package/dist/cjs/components/Title.js +162 -0
  36. package/dist/cjs/components/WaitUntil.js +5 -0
  37. package/dist/cjs/components/withCompatMode.js +16 -1
  38. package/dist/cjs/functions/addApiListener.js +37 -0
  39. package/dist/cjs/functions/addGeoLocationListener.js +26 -0
  40. package/dist/cjs/functions/addScrollListener.js +26 -0
  41. package/dist/cjs/functions/addWindowMetricsListener.js +37 -0
  42. package/dist/cjs/helper/apiListenerHelper.js +9 -0
  43. package/dist/cjs/helper/cssLoader.js +28 -0
  44. package/dist/cjs/hooks/addGeoLocationListener.js +26 -0
  45. package/dist/cjs/hooks/addScrollListener.js +26 -0
  46. package/dist/cjs/hooks/addWindowMetricsListener.js +37 -0
  47. package/dist/cjs/hooks/geoLocation.js +48 -0
  48. package/dist/cjs/hooks/geoLocationListener.js +11 -2
  49. package/dist/cjs/hooks/index.js +16 -0
  50. package/dist/cjs/hooks/scrollListener.js +23 -4
  51. package/dist/cjs/hooks/useAccessToken.js +5 -0
  52. package/dist/cjs/hooks/useAddGeoLocationListener.js +26 -0
  53. package/dist/cjs/hooks/useAddScrollListener.js +48 -0
  54. package/dist/cjs/hooks/useAddWindowMetricsListener.js +45 -0
  55. package/dist/cjs/hooks/useAdddScrollListener.js +26 -0
  56. package/dist/cjs/hooks/useCurrentPage.js +4 -0
  57. package/dist/cjs/hooks/useCustomData.js +4 -0
  58. package/dist/cjs/hooks/useDevice.js +4 -0
  59. package/dist/cjs/hooks/useEnvironment.js +4 -0
  60. package/dist/cjs/hooks/useFunctions.js +4 -0
  61. package/dist/cjs/hooks/useIsAdminMode.js +5 -0
  62. package/dist/cjs/hooks/useLanguage.js +4 -0
  63. package/dist/cjs/hooks/usePages.js +12 -0
  64. package/dist/cjs/hooks/useParameters.js +4 -0
  65. package/dist/cjs/hooks/useSite.js +4 -0
  66. package/dist/cjs/hooks/useUser.js +4 -0
  67. package/dist/cjs/hooks/useValues.js +4 -0
  68. package/dist/cjs/hooks/windowMetrics.js +45 -0
  69. package/dist/cjs/hooks/windowMetricsListener.js +12 -2
  70. package/dist/cjs/host/ChaynsHost.js +12 -0
  71. package/dist/cjs/host/{module/PagemakerFrame.js → HostIframe.js} +75 -23
  72. package/dist/cjs/host/ModuleHost.js +11 -0
  73. package/dist/cjs/host/iframe/HostIframe.js +30 -23
  74. package/dist/cjs/host/iframe/utils/useUpdateData.js +3 -0
  75. package/dist/cjs/host/module/ModuleHost.js +13 -3
  76. package/dist/cjs/host/module/utils/loadComponent.js +18 -1
  77. package/dist/cjs/host/module/utils/useDynamicScript.js +18 -0
  78. package/dist/cjs/host/module/utils.js +25 -0
  79. package/dist/cjs/index.example.js +7 -0
  80. package/dist/cjs/index.js +19 -0
  81. package/dist/cjs/index2.js +64 -0
  82. package/dist/cjs/types/DynamicImport.d.js +5 -0
  83. package/dist/cjs/types/IChaynsReact.js +47 -0
  84. package/dist/cjs/types/chayns-components.d.js +1 -0
  85. package/dist/cjs/types/chayns-logger.d.js +1 -0
  86. package/dist/cjs/types/chayns.d.js +1 -0
  87. package/dist/cjs/types/tobit-websocket-service-client.d.js +1 -0
  88. package/dist/cjs/types/toolkit-types.d.js +1 -0
  89. package/dist/cjs/util/appCall.js +4 -1
  90. package/dist/cjs/util/deviceHelper.js +17 -2
  91. package/dist/cjs/util/heightHelper.js +9 -0
  92. package/dist/cjs/util/postIframeForm.js +5 -0
  93. package/dist/cjs/util/useFunctionsContext.js +16 -0
  94. package/dist/cjs/util/useIsAdminMode.js +18 -0
  95. package/dist/cjs/util/useUser.js +16 -0
  96. package/dist/cjs/wrapper/AppWrapper.js +144 -119
  97. package/dist/cjs/wrapper/FrameWrapper.js +248 -215
  98. package/dist/cjs/wrapper/ModuleFederationWrapper.js +27 -2
  99. package/dist/cjs/wrapper/SsrWrapper.js +8 -0
  100. package/dist/esm/bootstrap.js +4 -0
  101. package/dist/esm/calls/dialogs/alert.js +4 -4
  102. package/dist/esm/calls/dialogs/chaynsDialog.js +11 -7
  103. package/dist/esm/calls/dialogs/communication.js +26 -15
  104. package/dist/esm/calls/dialogs/confirm.js +8 -5
  105. package/dist/esm/calls/dialogs/date.js +94 -85
  106. package/dist/esm/calls/dialogs/dropUpAlert.js +1 -1
  107. package/dist/esm/calls/dialogs/fileSelect.js +62 -23
  108. package/dist/esm/calls/dialogs/iFrame.js +10 -7
  109. package/dist/esm/calls/dialogs/input.js +5 -2
  110. package/dist/esm/calls/dialogs/mediaSelect.js +55 -18
  111. package/dist/esm/calls/dialogs/open.js +2 -2
  112. package/dist/esm/calls/dialogs/select.js +9 -5
  113. package/dist/esm/calls/dialogs/signature.js +2 -0
  114. package/dist/esm/calls/dialogs/toast.js +11 -6
  115. package/dist/esm/calls/dialogs/utils/callback.js +5 -3
  116. package/dist/esm/calls/dialogs/utils/is.js +3 -1
  117. package/dist/esm/calls/getUserInfo.js +92 -32
  118. package/dist/esm/calls/index.js +276 -124
  119. package/dist/esm/calls/sendMessage.js +221 -91
  120. package/dist/esm/calls/visibilityChangeListener.js +15 -10
  121. package/dist/esm/components/App.js +35 -0
  122. package/dist/esm/components/App.spec.js +9 -0
  123. package/dist/esm/components/Button.js +34 -0
  124. package/dist/esm/components/ChaynsContext.js +3 -3
  125. package/dist/esm/components/ChaynsProvider.js +86 -45
  126. package/dist/esm/components/ChaynsProviderExposed.js +3 -0
  127. package/dist/esm/components/TestProvider.js +308 -0
  128. package/dist/esm/components/Title.js +210 -0
  129. package/dist/esm/components/WaitUntil.js +86 -21
  130. package/dist/esm/components/withCompatMode.js +77 -35
  131. package/dist/esm/helper/apiListenerHelper.js +15 -10
  132. package/dist/esm/helper/cssLoader.js +21 -0
  133. package/dist/esm/hooks/geoLocationListener.js +46 -20
  134. package/dist/esm/hooks/scrollListener.js +86 -50
  135. package/dist/esm/hooks/useAccessToken.js +28 -6
  136. package/dist/esm/hooks/useAddGeoLocationListener.js +18 -0
  137. package/dist/esm/hooks/useAddScrollListener.js +18 -0
  138. package/dist/esm/hooks/useAddWindowMetricsListener.js +18 -0
  139. package/dist/esm/hooks/useCurrentPage.js +6 -2
  140. package/dist/esm/hooks/useCustomData.js +6 -2
  141. package/dist/esm/hooks/useDevice.js +6 -1
  142. package/dist/esm/hooks/useEnvironment.js +6 -1
  143. package/dist/esm/hooks/useFunctions.js +5 -2
  144. package/dist/esm/hooks/useIsAdminMode.js +6 -2
  145. package/dist/esm/hooks/useLanguage.js +6 -1
  146. package/dist/esm/hooks/usePages.js +27 -14
  147. package/dist/esm/hooks/useParameters.js +6 -1
  148. package/dist/esm/hooks/useSite.js +6 -1
  149. package/dist/esm/hooks/useUser.js +6 -1
  150. package/dist/esm/hooks/useValues.js +5 -2
  151. package/dist/esm/hooks/windowMetricsListener.js +44 -18
  152. package/dist/esm/host/ChaynsHost.js +30 -21
  153. package/dist/esm/host/HostIframe.js +153 -0
  154. package/dist/esm/host/iframe/HostIframe.js +142 -86
  155. package/dist/esm/host/iframe/utils/useUpdateData.js +6 -4
  156. package/dist/esm/host/module/ModuleHost.js +49 -42
  157. package/dist/esm/host/module/utils/loadComponent.js +85 -47
  158. package/dist/esm/host/module/utils/useDynamicScript.js +74 -27
  159. package/dist/esm/index.example.js +1 -0
  160. package/dist/esm/index2.js +5 -0
  161. package/dist/esm/types/DynamicImport.d.js +1 -0
  162. package/dist/esm/types/IChaynsReact.js +61 -14
  163. package/dist/esm/types/chayns-components.d.js +0 -0
  164. package/dist/esm/types/chayns-logger.d.js +0 -0
  165. package/dist/esm/types/chayns.d.js +0 -0
  166. package/dist/esm/types/tobit-websocket-service-client.d.js +0 -0
  167. package/dist/esm/types/toolkit-types.d.js +0 -0
  168. package/dist/esm/util/appCall.js +4 -2
  169. package/dist/esm/util/deviceHelper.js +33 -11
  170. package/dist/esm/util/heightHelper.js +13 -10
  171. package/dist/esm/util/postIframeForm.js +57 -25
  172. package/dist/esm/util/useIsAdminMode.js +9 -0
  173. package/dist/esm/util/useUser.js +7 -0
  174. package/dist/esm/wrapper/AppWrapper.js +762 -179
  175. package/dist/esm/wrapper/FrameWrapper.js +1509 -258
  176. package/dist/esm/wrapper/ModuleFederationWrapper.js +284 -47
  177. package/dist/esm/wrapper/SsrWrapper.js +65 -19
  178. package/dist/types/bootstrap.d.ts +1 -0
  179. package/dist/types/calls/dialogs/confirm.d.ts +1 -1
  180. package/dist/types/calls/dialogs/date.d.ts +4 -4
  181. package/dist/types/calls/dialogs/dropUpAlert.d.ts +1 -1
  182. package/dist/types/calls/dialogs/fileSelect.d.ts +1 -1
  183. package/dist/types/calls/dialogs/iFrame.d.ts +1 -1
  184. package/dist/types/calls/dialogs/input.d.ts +1 -1
  185. package/dist/types/calls/dialogs/mediaSelect.d.ts +1 -1
  186. package/dist/types/calls/dialogs/signature.d.ts +1 -1
  187. package/dist/types/components/App.d.ts +5 -0
  188. package/dist/types/components/Button.d.ts +8 -0
  189. package/dist/types/components/ChaynsProvider.d.ts +1 -1
  190. package/dist/types/components/ChaynsProviderExposed.d.ts +13 -0
  191. package/dist/types/components/Title.d.ts +3 -0
  192. package/dist/types/components/WaitUntil.d.ts +1 -1
  193. package/dist/types/components/withCompatMode.d.ts +1 -1
  194. package/dist/types/hooks/useAccessToken.d.ts +1 -1
  195. package/dist/types/host/ChaynsHost.d.ts +2 -1
  196. package/dist/types/host/{module/PagemakerFrame.d.ts → HostIframe.d.ts} +5 -7
  197. package/dist/types/host/iframe/HostIframe.d.ts +1 -1
  198. package/dist/types/host/module/ModuleHost.d.ts +2 -2
  199. package/dist/types/index.example.d.ts +0 -0
  200. package/dist/types/types/IChaynsReact.d.ts +14 -14
  201. package/package.json +1 -1
  202. package/dist/cjs/calls/dialogs/utils/environment.js +0 -10
  203. package/dist/esm/calls/dialogs/utils/environment.js +0 -3
  204. package/dist/esm/host/module/PagemakerFrame.js +0 -97
  205. package/dist/types/calls/dialogs/utils/environment.d.ts +0 -3
@@ -1,56 +1,293 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+
3
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+
5
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
+
7
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
8
+
9
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
10
+
11
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+
13
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
14
+
15
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
16
+
17
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18
+
19
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
20
+
21
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
22
+
1
23
  import { addVisibilityChangeListener, removeVisibilityChangeListener } from '../calls/visibilityChangeListener';
2
24
  import { addApiListener, dispatchApiEvent, removeApiListener } from '../helper/apiListenerHelper';
3
25
  import getUserInfo from '../calls/getUserInfo';
4
26
  import { sendMessageToGroup, sendMessageToPage, sendMessageToUser } from '../calls/sendMessage';
5
- export class ModuleFederationWrapper {
6
- constructor(values, functions) {
27
+ export var ModuleFederationWrapper = /*#__PURE__*/function () {
28
+ function ModuleFederationWrapper(values, functions) {
29
+ var _this = this;
30
+
31
+ _classCallCheck(this, ModuleFederationWrapper);
32
+
7
33
  this.values = values;
8
34
  this.functions = {};
9
- this.functions.addVisibilityChangeListener = async callback => addVisibilityChangeListener(callback);
10
- this.functions.removeVisibilityChangeListener = async id => removeVisibilityChangeListener(id);
11
- this.functions.getUserInfo = async query => getUserInfo(this, query);
12
- this.functions.sendMessageToGroup = async (groupId, object) => sendMessageToGroup(this, object, groupId);
13
- this.functions.sendMessageToPage = async object => sendMessageToPage(this, object);
14
- this.functions.sendMessageToUser = async (userId, object) => sendMessageToUser(this, object, userId);
15
- // make all functions async to be consistent with frame wrapper
16
- Object.entries(functions).forEach(_ref => {
17
- let [k, fn] = _ref;
18
- // eslint-disable-next-line
19
- this.functions[k] = async function () {
20
- return fn(...arguments);
35
+
36
+ this.functions.addVisibilityChangeListener = /*#__PURE__*/function () {
37
+ var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(callback) {
38
+ return regeneratorRuntime.wrap(function _callee$(_context) {
39
+ while (1) {
40
+ switch (_context.prev = _context.next) {
41
+ case 0:
42
+ return _context.abrupt("return", addVisibilityChangeListener(callback));
43
+
44
+ case 1:
45
+ case "end":
46
+ return _context.stop();
47
+ }
48
+ }
49
+ }, _callee);
50
+ }));
51
+
52
+ return function (_x) {
53
+ return _ref.apply(this, arguments);
54
+ };
55
+ }();
56
+
57
+ this.functions.removeVisibilityChangeListener = /*#__PURE__*/function () {
58
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(id) {
59
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
60
+ while (1) {
61
+ switch (_context2.prev = _context2.next) {
62
+ case 0:
63
+ return _context2.abrupt("return", removeVisibilityChangeListener(id));
64
+
65
+ case 1:
66
+ case "end":
67
+ return _context2.stop();
68
+ }
69
+ }
70
+ }, _callee2);
71
+ }));
72
+
73
+ return function (_x2) {
74
+ return _ref2.apply(this, arguments);
75
+ };
76
+ }();
77
+
78
+ this.functions.getUserInfo = /*#__PURE__*/function () {
79
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(query) {
80
+ return regeneratorRuntime.wrap(function _callee3$(_context3) {
81
+ while (1) {
82
+ switch (_context3.prev = _context3.next) {
83
+ case 0:
84
+ return _context3.abrupt("return", getUserInfo(_this, query));
85
+
86
+ case 1:
87
+ case "end":
88
+ return _context3.stop();
89
+ }
90
+ }
91
+ }, _callee3);
92
+ }));
93
+
94
+ return function (_x3) {
95
+ return _ref3.apply(this, arguments);
96
+ };
97
+ }();
98
+
99
+ this.functions.sendMessageToGroup = /*#__PURE__*/function () {
100
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(groupId, object) {
101
+ return regeneratorRuntime.wrap(function _callee4$(_context4) {
102
+ while (1) {
103
+ switch (_context4.prev = _context4.next) {
104
+ case 0:
105
+ return _context4.abrupt("return", sendMessageToGroup(_this, object, groupId));
106
+
107
+ case 1:
108
+ case "end":
109
+ return _context4.stop();
110
+ }
111
+ }
112
+ }, _callee4);
113
+ }));
114
+
115
+ return function (_x4, _x5) {
116
+ return _ref4.apply(this, arguments);
117
+ };
118
+ }();
119
+
120
+ this.functions.sendMessageToPage = /*#__PURE__*/function () {
121
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(object) {
122
+ return regeneratorRuntime.wrap(function _callee5$(_context5) {
123
+ while (1) {
124
+ switch (_context5.prev = _context5.next) {
125
+ case 0:
126
+ return _context5.abrupt("return", sendMessageToPage(_this, object));
127
+
128
+ case 1:
129
+ case "end":
130
+ return _context5.stop();
131
+ }
132
+ }
133
+ }, _callee5);
134
+ }));
135
+
136
+ return function (_x6) {
137
+ return _ref5.apply(this, arguments);
21
138
  };
139
+ }();
140
+
141
+ this.functions.sendMessageToUser = /*#__PURE__*/function () {
142
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(userId, object) {
143
+ return regeneratorRuntime.wrap(function _callee6$(_context6) {
144
+ while (1) {
145
+ switch (_context6.prev = _context6.next) {
146
+ case 0:
147
+ return _context6.abrupt("return", sendMessageToUser(_this, object, userId));
148
+
149
+ case 1:
150
+ case "end":
151
+ return _context6.stop();
152
+ }
153
+ }
154
+ }, _callee6);
155
+ }));
156
+
157
+ return function (_x7, _x8) {
158
+ return _ref6.apply(this, arguments);
159
+ };
160
+ }(); // make all functions async to be consistent with frame wrapper
161
+
162
+
163
+ Object.entries(functions).forEach(function (_ref7) {
164
+ var _ref8 = _slicedToArray(_ref7, 2),
165
+ k = _ref8[0],
166
+ fn = _ref8[1];
167
+
168
+ // eslint-disable-next-line
169
+ _this.functions[k] = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7() {
170
+ var _args7 = arguments;
171
+ return regeneratorRuntime.wrap(function _callee7$(_context7) {
172
+ while (1) {
173
+ switch (_context7.prev = _context7.next) {
174
+ case 0:
175
+ return _context7.abrupt("return", fn.apply(void 0, _args7));
176
+
177
+ case 1:
178
+ case "end":
179
+ return _context7.stop();
180
+ }
181
+ }
182
+ }, _callee7);
183
+ }));
22
184
  });
23
- this.functions.addWindowMetricsListener = async callback => {
24
- const {
25
- id,
26
- shouldInitialize
27
- } = addApiListener('windowMetrics', callback);
28
- if (shouldInitialize) {
29
- void functions.addWindowMetricsListener(value => dispatchApiEvent('windowMetrics', value));
30
- }
31
- return id;
32
- };
33
- this.functions.removeWindowMetricsListener = async id => {
34
- const shouldRemove = removeApiListener('windowMetrics', id);
35
- if (shouldRemove) {
36
- void functions.removeWindowMetricsListener(id);
37
- }
38
- };
39
- }
40
- async init() {
41
- return undefined;
42
- }
43
- addDataListener(cb) {
44
- const listener = ev => ev.detail && cb(ev.detail);
45
- document.addEventListener('chayns_api_data', listener);
46
- return () => {
47
- document.removeEventListener('chayns_api_data', listener);
48
- };
49
- }
50
- getSSRData() {
51
- return null;
52
- }
53
- getInitialData() {
54
- return this.values;
185
+
186
+ this.functions.addWindowMetricsListener = /*#__PURE__*/function () {
187
+ var _ref10 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(callback) {
188
+ var _addApiListener, id, shouldInitialize;
189
+
190
+ return regeneratorRuntime.wrap(function _callee8$(_context8) {
191
+ while (1) {
192
+ switch (_context8.prev = _context8.next) {
193
+ case 0:
194
+ _addApiListener = addApiListener('windowMetrics', callback), id = _addApiListener.id, shouldInitialize = _addApiListener.shouldInitialize;
195
+
196
+ if (shouldInitialize) {
197
+ void functions.addWindowMetricsListener(function (value) {
198
+ return dispatchApiEvent('windowMetrics', value);
199
+ });
200
+ }
201
+
202
+ return _context8.abrupt("return", id);
203
+
204
+ case 3:
205
+ case "end":
206
+ return _context8.stop();
207
+ }
208
+ }
209
+ }, _callee8);
210
+ }));
211
+
212
+ return function (_x9) {
213
+ return _ref10.apply(this, arguments);
214
+ };
215
+ }();
216
+
217
+ this.functions.removeWindowMetricsListener = /*#__PURE__*/function () {
218
+ var _ref11 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9(id) {
219
+ var shouldRemove;
220
+ return regeneratorRuntime.wrap(function _callee9$(_context9) {
221
+ while (1) {
222
+ switch (_context9.prev = _context9.next) {
223
+ case 0:
224
+ shouldRemove = removeApiListener('windowMetrics', id);
225
+
226
+ if (shouldRemove) {
227
+ void functions.removeWindowMetricsListener(id);
228
+ }
229
+
230
+ case 2:
231
+ case "end":
232
+ return _context9.stop();
233
+ }
234
+ }
235
+ }, _callee9);
236
+ }));
237
+
238
+ return function (_x10) {
239
+ return _ref11.apply(this, arguments);
240
+ };
241
+ }();
55
242
  }
56
- }
243
+
244
+ _createClass(ModuleFederationWrapper, [{
245
+ key: "init",
246
+ value: function () {
247
+ var _init = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10() {
248
+ return regeneratorRuntime.wrap(function _callee10$(_context10) {
249
+ while (1) {
250
+ switch (_context10.prev = _context10.next) {
251
+ case 0:
252
+ return _context10.abrupt("return", undefined);
253
+
254
+ case 1:
255
+ case "end":
256
+ return _context10.stop();
257
+ }
258
+ }
259
+ }, _callee10);
260
+ }));
261
+
262
+ function init() {
263
+ return _init.apply(this, arguments);
264
+ }
265
+
266
+ return init;
267
+ }()
268
+ }, {
269
+ key: "addDataListener",
270
+ value: function addDataListener(cb) {
271
+ var listener = function listener(ev) {
272
+ return ev.detail && cb(ev.detail);
273
+ };
274
+
275
+ document.addEventListener('chayns_api_data', listener);
276
+ return function () {
277
+ document.removeEventListener('chayns_api_data', listener);
278
+ };
279
+ }
280
+ }, {
281
+ key: "getSSRData",
282
+ value: function getSSRData() {
283
+ return null;
284
+ }
285
+ }, {
286
+ key: "getInitialData",
287
+ value: function getInitialData() {
288
+ return this.values;
289
+ }
290
+ }]);
291
+
292
+ return ModuleFederationWrapper;
293
+ }();
@@ -1,23 +1,69 @@
1
- export class SsrWrapper {
2
- constructor(values, functions) {
1
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
2
+
3
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
4
+
5
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6
+
7
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
8
+
9
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
10
+
11
+ export var SsrWrapper = /*#__PURE__*/function () {
12
+ function SsrWrapper(values, functions) {
13
+ _classCallCheck(this, SsrWrapper);
14
+
3
15
  this.initialData = values;
4
16
  this.values = values;
5
17
  this.functions = functions;
6
18
  }
7
- async init() {
8
- return undefined;
9
- }
10
- addDataListener(cb) {
11
- const listener = ev => ev.detail && cb(ev.detail);
12
- document.addEventListener('chayns_api_data', listener);
13
- return () => {
14
- document.removeEventListener('chayns_api_data', listener);
15
- };
16
- }
17
- getSSRData() {
18
- return this.initialData;
19
- }
20
- getInitialData() {
21
- return this.values;
22
- }
23
- }
19
+
20
+ _createClass(SsrWrapper, [{
21
+ key: "init",
22
+ value: function () {
23
+ var _init = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
24
+ return regeneratorRuntime.wrap(function _callee$(_context) {
25
+ while (1) {
26
+ switch (_context.prev = _context.next) {
27
+ case 0:
28
+ return _context.abrupt("return", undefined);
29
+
30
+ case 1:
31
+ case "end":
32
+ return _context.stop();
33
+ }
34
+ }
35
+ }, _callee);
36
+ }));
37
+
38
+ function init() {
39
+ return _init.apply(this, arguments);
40
+ }
41
+
42
+ return init;
43
+ }()
44
+ }, {
45
+ key: "addDataListener",
46
+ value: function addDataListener(cb) {
47
+ var listener = function listener(ev) {
48
+ return ev.detail && cb(ev.detail);
49
+ };
50
+
51
+ document.addEventListener('chayns_api_data', listener);
52
+ return function () {
53
+ document.removeEventListener('chayns_api_data', listener);
54
+ };
55
+ }
56
+ }, {
57
+ key: "getSSRData",
58
+ value: function getSSRData() {
59
+ return this.initialData;
60
+ }
61
+ }, {
62
+ key: "getInitialData",
63
+ value: function getInitialData() {
64
+ return this.values;
65
+ }
66
+ }]);
67
+
68
+ return SsrWrapper;
69
+ }();
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { DialogButton } from "../../types/dialog";
2
- type Confirm = {
2
+ declare type Confirm = {
3
3
  headline?: string;
4
4
  text?: string;
5
5
  buttons?: DialogButton[] | {
@@ -25,7 +25,7 @@ import { DialogButton, DialogTextBlock, IntervalItem, WeekDayIntervalObject } fr
25
25
  * console.log(data);
26
26
  * });
27
27
  */
28
- type DateConfig = {
28
+ declare type DateConfig = {
29
29
  title?: string;
30
30
  message?: string;
31
31
  buttons?: DialogButton[];
@@ -48,12 +48,12 @@ type DateConfig = {
48
48
  autoSelectDate?: boolean;
49
49
  };
50
50
  export declare function date(config?: DateConfig): Promise<any>;
51
- type preSelectObj = {
51
+ declare type preSelectObj = {
52
52
  start?: number | undefined | Date;
53
53
  end?: number | undefined | Date;
54
54
  };
55
- type preSelect = preSelectObj | Date | undefined | number | number[];
56
- type AdvancedDateConfig = {
55
+ declare type preSelect = preSelectObj | Date | undefined | number | number[];
56
+ declare type AdvancedDateConfig = {
57
57
  title?: string;
58
58
  message?: string;
59
59
  buttons?: DialogButton[];
@@ -1,4 +1,4 @@
1
- type DropUpAlert = {
1
+ declare type DropUpAlert = {
2
2
  callType?: number;
3
3
  };
4
4
  export declare function dropUpAlert(dialog?: DropUpAlert): Promise<unknown>;
@@ -5,7 +5,7 @@ export declare const fileType: {
5
5
  AUDIO: string;
6
6
  DOCUMENT: string[];
7
7
  };
8
- type FileSelectInput = {
8
+ declare type FileSelectInput = {
9
9
  buttons?: DialogButton[];
10
10
  callType?: number;
11
11
  multiselect?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { DialogButton } from "../../types/dialog";
2
- type iFrameDialog = {
2
+ declare type iFrameDialog = {
3
3
  buttons?: DialogButton[];
4
4
  callType?: number;
5
5
  tappIframeName?: string;
@@ -1,5 +1,5 @@
1
1
  import { DialogButton } from "../../types/dialog";
2
- type InputDialog = {
2
+ declare type InputDialog = {
3
3
  buttons?: DialogButton[];
4
4
  callType?: number;
5
5
  formatter?: string;
@@ -1,5 +1,5 @@
1
1
  import { DialogButton } from "../../types/dialog";
2
- type MediaSelectInput = {
2
+ declare type MediaSelectInput = {
3
3
  buttons?: DialogButton[];
4
4
  callType?: number;
5
5
  chaynsToken?: string;
@@ -1,5 +1,5 @@
1
1
  import { DialogButton } from "../../types/dialog";
2
- type SignatureInput = {
2
+ declare type SignatureInput = {
3
3
  buttons?: DialogButton[];
4
4
  callType?: number;
5
5
  };
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { InferProps } from 'prop-types';
3
+ declare const propTypes: {};
4
+ declare const App: React.FunctionComponent<InferProps<typeof propTypes>>;
5
+ export default App;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ declare const _default: {
3
+ Component: React.ComponentType<any>;
4
+ CompatComponent: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
5
+ requiredVersion: string;
6
+ environment: string | undefined;
7
+ };
8
+ export default _default;
@@ -3,7 +3,7 @@ import { ChaynsReactFunctions, ChaynsReactValues, IChaynsReact } from '../types/
3
3
  export declare const moduleWrapper: {
4
4
  current: IChaynsReact;
5
5
  };
6
- type ChaynsProviderProps = {
6
+ declare type ChaynsProviderProps = {
7
7
  data?: ChaynsReactValues;
8
8
  functions?: ChaynsReactFunctions;
9
9
  renderedByServer?: boolean;
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ Component: import("react").ComponentType<{
4
+ data?: import("..").ChaynsReactValues | undefined;
5
+ functions?: import("..").ChaynsReactFunctions | undefined;
6
+ isSSR?: boolean | undefined;
7
+ isModule?: boolean | undefined;
8
+ }>;
9
+ CompatComponent: import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>;
10
+ requiredVersion: any;
11
+ environment: string | undefined;
12
+ };
13
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const _default: React.MemoExoticComponent<() => JSX.Element>;
3
+ export default _default;
@@ -1,5 +1,5 @@
1
1
  import { FC, ReactNode } from "react";
2
- type TaskList = (TaskList | Promise<unknown> | (() => Promise<unknown>))[];
2
+ declare type TaskList = (TaskList | Promise<unknown> | (() => Promise<unknown>))[];
3
3
  export declare const WaitUntil: FC<{
4
4
  tasks: TaskList;
5
5
  loadingComponent?: ReactNode;
@@ -1,5 +1,5 @@
1
1
  import React, { RefObject } from 'react';
2
- type Props = {
2
+ declare type Props = {
3
3
  innerRef?: RefObject<unknown>;
4
4
  } & object;
5
5
  export declare const withCompatMode: <P extends Props>(Component: React.ComponentType<P>) => {
@@ -2,4 +2,4 @@ import { AccessToken } from "../types/IChaynsReact";
2
2
  /**
3
3
  * @category Hooks
4
4
  */
5
- export declare const useAccessToken: (accessToken?: AccessToken) => string | undefined;
5
+ export declare const useAccessToken: (accessToken?: AccessToken | undefined) => string | undefined;
@@ -1,7 +1,7 @@
1
1
  import React, { FC } from 'react';
2
2
  import { TypeSystem } from './module/ModuleHost';
3
3
  import { ChaynsApiDevice, ChaynsApiSite, ChaynsApiUser, ChaynsReactFunctions, ChaynsReactValues, Page } from '../types/IChaynsReact';
4
- type ChaynsHostType = {
4
+ declare type ChaynsHostType = {
5
5
  type: string;
6
6
  iFrameProps: {
7
7
  [key: string]: unknown;
@@ -10,6 +10,7 @@ type ChaynsHostType = {
10
10
  functions: ChaynsReactFunctions;
11
11
  src: string;
12
12
  iFrameRef: React.MutableRefObject<HTMLIFrameElement | null> | undefined;
13
+ loadingComponent?: JSX.Element;
13
14
  children?: JSX.Element;
14
15
  system: TypeSystem;
15
16
  pages: Page[];
@@ -1,10 +1,11 @@
1
1
  import React, { FC } from 'react';
2
- import { ChaynsApiDevice, ChaynsApiSite, ChaynsApiUser, ChaynsReactFunctions, ChaynsReactValues, Page } from '../../types/IChaynsReact';
3
- declare type PagemakerFrameProps = {
2
+ import { ChaynsApiDevice, ChaynsApiSite, ChaynsApiUser, ChaynsReactFunctions, ChaynsReactValues, Page } from '../types/IChaynsReact';
3
+ declare type HostIframeProps = {
4
4
  iFrameProps: {
5
5
  [key: string]: unknown;
6
6
  name: string;
7
7
  };
8
+ src: string;
8
9
  postForm?: boolean;
9
10
  iFrameRef: React.MutableRefObject<HTMLIFrameElement | null> | undefined;
10
11
  pages: Page[];
@@ -14,9 +15,6 @@ declare type PagemakerFrameProps = {
14
15
  currentPage: ChaynsReactValues["currentPage"];
15
16
  functions: ChaynsReactFunctions;
16
17
  device: ChaynsApiDevice;
17
- language: ChaynsReactValues["language"];
18
- parameters: ChaynsReactValues["parameters"];
19
- environment: ChaynsReactValues["environment"];
20
18
  };
21
- declare const PagemakerFrame: FC<PagemakerFrameProps>;
22
- export default PagemakerFrame;
19
+ declare const HostIframe: FC<HostIframeProps>;
20
+ export default HostIframe;
@@ -1,6 +1,6 @@
1
1
  import React, { FC } from 'react';
2
2
  import { ChaynsApiDevice, ChaynsApiSite, ChaynsApiUser, ChaynsReactFunctions, ChaynsReactValues, Page } from '../../types/IChaynsReact';
3
- type HostIframeProps = {
3
+ declare type HostIframeProps = {
4
4
  iFrameProps: {
5
5
  [key: string]: unknown;
6
6
  name: string;
@@ -1,11 +1,11 @@
1
1
  import { FC } from 'react';
2
2
  import { ChaynsApiDevice, ChaynsApiSite, ChaynsApiUser, ChaynsReactFunctions, ChaynsReactValues, Page } from '../../types/IChaynsReact';
3
- export type TypeSystem = {
3
+ export declare type TypeSystem = {
4
4
  scope: string;
5
5
  url: string;
6
6
  module: string;
7
7
  };
8
- type ModulePropTypes = {
8
+ declare type ModulePropTypes = {
9
9
  system: TypeSystem;
10
10
  functions: ChaynsReactFunctions;
11
11
  pages: Page[];
File without changes