@klauswuestefeld/jux-web 2024.2.7-1 → 2024.2.7-2

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/jux-web.js CHANGED
@@ -158,6 +158,7 @@ var juxWeb = (function (exports) {
158
158
  const endpoint = ((_a = window === null || window === void 0 ? void 0 : window.store) === null || _a === void 0 ? void 0 : _a.magicLinkRequestEndpoint) || 'magic-link-request';
159
159
  return getBackendUrl() + endpoint + '?email=';
160
160
  };
161
+ // TODO: use jux-events to call commands and queries inside jux-web library
161
162
  const handleJuxEvents = (ev) => {
162
163
  const { method, endpoint, onResult, params, onError } = ev;
163
164
  const onJsonResponse = (res) => onResult ? onResult(res) : null;
@@ -14262,10 +14263,6 @@ var juxWeb = (function (exports) {
14262
14263
  Array.from(clientApp.children).forEach(el => el.remove());
14263
14264
  clientApp.appendChild(page);
14264
14265
  };
14265
- const setJuxEventHandler = () => {
14266
- document.removeEventListener('jux-event', handleJuxEvents);
14267
- document.addEventListener('jux-event', handleJuxEvents);
14268
- };
14269
14266
  const initSession = (clientApp, supportedLoginTypes, onUserLogin, backgroundImage, fetchUserBackendUrl, magicLinkRequestEndpoint, magicLinkAuthEndpoint) => {
14270
14267
  // if (startNewDemo()) {
14271
14268
  // initDemo(setBackendToken, onAuthentication);
@@ -14282,8 +14279,6 @@ var juxWeb = (function (exports) {
14282
14279
  window.store.magicLinkRequestEndpoint = magicLinkRequestEndpoint;
14283
14280
  // @ts-ignore
14284
14281
  window.store.magicLinkAuthEndpoint = magicLinkAuthEndpoint;
14285
- // TODO: use jux-events to call commands and queries
14286
- setJuxEventHandler();
14287
14282
  const signInToken = extractTokenFromWindowLocation('sign-in') || extractTokenFromWindowLocation('magic-link');
14288
14283
  if (signInToken) {
14289
14284
  const onOpenMagicLink = () => {
@@ -14585,6 +14580,7 @@ var juxWeb = (function (exports) {
14585
14580
  exports.chosenLanguage = chosenLanguage;
14586
14581
  exports.command = command;
14587
14582
  exports.getTranslation = getTranslation;
14583
+ exports.handleJuxEvents = handleJuxEvents;
14588
14584
  exports.handleMagicLinkRequest = handleMagicLinkRequest;
14589
14585
  exports.initLanguage = initLanguage;
14590
14586
  exports.initSession = initSession;
package/dist/main.d.ts CHANGED
@@ -2,7 +2,7 @@ export { chosenLanguage, reloadWithLanguageOverride, initLanguage, getTranslatio
2
2
  export { loginButton } from './login/login-button';
3
3
  export { loginPage } from './login/login-page';
4
4
  export { handleMagicLinkRequest, initSession, onMicrosoftSignIn } from './login/session';
5
- export { requestMagicLink } from './api-client';
5
+ export { handleJuxEvents, requestMagicLink } from './api-client';
6
6
  export { magicLinkModal } from './login/magic-link-modal';
7
7
  export { command, query } from './jux/jux-event';
8
8
  declare global {
package/dist/main.esm.js CHANGED
@@ -157,6 +157,7 @@ const getMagicAuthReqUrl = () => {
157
157
  const endpoint = ((_a = window === null || window === void 0 ? void 0 : window.store) === null || _a === void 0 ? void 0 : _a.magicLinkRequestEndpoint) || 'magic-link-request';
158
158
  return getBackendUrl() + endpoint + '?email=';
159
159
  };
160
+ // TODO: use jux-events to call commands and queries inside jux-web library
160
161
  const handleJuxEvents = (ev) => {
161
162
  const { method, endpoint, onResult, params, onError } = ev;
162
163
  const onJsonResponse = (res) => onResult ? onResult(res) : null;
@@ -942,10 +943,6 @@ const displayPage = (clientApp, page) => {
942
943
  Array.from(clientApp.children).forEach(el => el.remove());
943
944
  clientApp.appendChild(page);
944
945
  };
945
- const setJuxEventHandler = () => {
946
- document.removeEventListener('jux-event', handleJuxEvents);
947
- document.addEventListener('jux-event', handleJuxEvents);
948
- };
949
946
  const initSession = (clientApp, supportedLoginTypes, onUserLogin, backgroundImage, fetchUserBackendUrl, magicLinkRequestEndpoint, magicLinkAuthEndpoint) => {
950
947
  // if (startNewDemo()) {
951
948
  // initDemo(setBackendToken, onAuthentication);
@@ -962,8 +959,6 @@ const initSession = (clientApp, supportedLoginTypes, onUserLogin, backgroundImag
962
959
  window.store.magicLinkRequestEndpoint = magicLinkRequestEndpoint;
963
960
  // @ts-ignore
964
961
  window.store.magicLinkAuthEndpoint = magicLinkAuthEndpoint;
965
- // TODO: use jux-events to call commands and queries
966
- setJuxEventHandler();
967
962
  const signInToken = extractTokenFromWindowLocation('sign-in') || extractTokenFromWindowLocation('magic-link');
968
963
  if (signInToken) {
969
964
  const onOpenMagicLink = () => {
@@ -1262,4 +1257,4 @@ const command = (element, endpoint, onResult, params, onError) => {
1262
1257
  element.dispatchEvent(new JuxEvent('POST', endpoint, onResult, params, onError));
1263
1258
  };
1264
1259
 
1265
- export { chosenLanguage, command, getTranslation, handleMagicLinkRequest, initLanguage, initSession, loginButton, loginPage, magicLinkModal, onMicrosoftSignIn, query, reloadWithLanguageOverride, requestMagicLink };
1260
+ export { chosenLanguage, command, getTranslation, handleJuxEvents, handleMagicLinkRequest, initLanguage, initSession, loginButton, loginPage, magicLinkModal, onMicrosoftSignIn, query, reloadWithLanguageOverride, requestMagicLink };
package/dist/main.js CHANGED
@@ -181,6 +181,7 @@ const getMagicAuthReqUrl = () => {
181
181
  const endpoint = ((_a = window === null || window === void 0 ? void 0 : window.store) === null || _a === void 0 ? void 0 : _a.magicLinkRequestEndpoint) || 'magic-link-request';
182
182
  return getBackendUrl() + endpoint + '?email=';
183
183
  };
184
+ // TODO: use jux-events to call commands and queries inside jux-web library
184
185
  const handleJuxEvents = (ev) => {
185
186
  const { method, endpoint, onResult, params, onError } = ev;
186
187
  const onJsonResponse = (res) => onResult ? onResult(res) : null;
@@ -966,10 +967,6 @@ const displayPage = (clientApp, page) => {
966
967
  Array.from(clientApp.children).forEach(el => el.remove());
967
968
  clientApp.appendChild(page);
968
969
  };
969
- const setJuxEventHandler = () => {
970
- document.removeEventListener('jux-event', handleJuxEvents);
971
- document.addEventListener('jux-event', handleJuxEvents);
972
- };
973
970
  const initSession = (clientApp, supportedLoginTypes, onUserLogin, backgroundImage, fetchUserBackendUrl, magicLinkRequestEndpoint, magicLinkAuthEndpoint) => {
974
971
  // if (startNewDemo()) {
975
972
  // initDemo(setBackendToken, onAuthentication);
@@ -986,8 +983,6 @@ const initSession = (clientApp, supportedLoginTypes, onUserLogin, backgroundImag
986
983
  window.store.magicLinkRequestEndpoint = magicLinkRequestEndpoint;
987
984
  // @ts-ignore
988
985
  window.store.magicLinkAuthEndpoint = magicLinkAuthEndpoint;
989
- // TODO: use jux-events to call commands and queries
990
- setJuxEventHandler();
991
986
  const signInToken = extractTokenFromWindowLocation('sign-in') || extractTokenFromWindowLocation('magic-link');
992
987
  if (signInToken) {
993
988
  const onOpenMagicLink = () => {
@@ -1289,6 +1284,7 @@ const command = (element, endpoint, onResult, params, onError) => {
1289
1284
  exports.chosenLanguage = chosenLanguage;
1290
1285
  exports.command = command;
1291
1286
  exports.getTranslation = getTranslation;
1287
+ exports.handleJuxEvents = handleJuxEvents;
1292
1288
  exports.handleMagicLinkRequest = handleMagicLinkRequest;
1293
1289
  exports.initLanguage = initLanguage;
1294
1290
  exports.initSession = initSession;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@klauswuestefeld/jux-web",
3
- "version": "2024.2.7-1",
3
+ "version": "2024.2.7-2",
4
4
  "author": "Jux.House",
5
5
  "license": "Copyrighted",
6
6
  "description": "",