chayns-api 2.6.17 → 2.6.19

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.
@@ -2,6 +2,8 @@ name: Deploy Docs to GitHub Pages
2
2
 
3
3
  on:
4
4
  push:
5
+ branches:
6
+ - main
5
7
  paths:
6
8
  - "website/**"
7
9
  workflow_dispatch:
@@ -13,7 +13,7 @@ permissions:
13
13
  env:
14
14
  TAG: >-
15
15
  ${{ contains(github.ref_name, 'alpha') && 'alpha' || (contains(github.ref_name, '-') &&
16
- 'beta' || 'latest') }}
16
+ 'beta' || 'legacy') }}
17
17
 
18
18
  jobs:
19
19
  build:
@@ -26,6 +26,6 @@ jobs:
26
26
  registry-url: https://registry.npmjs.org/
27
27
  # Ensure npm 11.5.1 or later is installed
28
28
  - name: Update npm
29
- run: npm install -g npm@latest
29
+ run: npm install -g npm@^11.5.1
30
30
  - run: npm install
31
31
  - run: npm publish --tag ${{ env.TAG }}
@@ -42,9 +42,9 @@ const ChaynsProvider = ({
42
42
  isModule,
43
43
  chaynsApiId
44
44
  }) => {
45
- var _ref, _crypto, _customWrapper$curren, _customWrapper$curren2;
45
+ var _ref, _crypto, _crypto$randomUUID, _customWrapper$curren, _customWrapper$curren2;
46
46
  const customWrapper = (0, _react.useRef)(null);
47
- const idRef = (0, _react.useRef)((_ref = chaynsApiId !== null && chaynsApiId !== void 0 ? chaynsApiId : (_crypto = crypto) === null || _crypto === void 0 ? void 0 : _crypto.randomUUID()) !== null && _ref !== void 0 ? _ref : Math.random().toString());
47
+ const idRef = (0, _react.useRef)((_ref = chaynsApiId !== null && chaynsApiId !== void 0 ? chaynsApiId : (_crypto = crypto) === null || _crypto === void 0 || (_crypto$randomUUID = _crypto.randomUUID) === null || _crypto$randomUUID === void 0 ? void 0 : _crypto$randomUUID.call(_crypto)) !== null && _ref !== void 0 ? _ref : Math.random().toString());
48
48
  if (!customWrapper.current) {
49
49
  if (isModule) {
50
50
  if (data && functions) {
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.initModuleFederationSharing = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _reactDom = _interopRequireDefault(require("react-dom"));
9
+ var _server = _interopRequireDefault(require("react-dom/server"));
9
10
  var _SequentialLoadPlugin = require("../plugins/SequentialLoadPlugin");
10
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
12
12
  let ReactDOMClient;
13
13
  try {
14
14
  ReactDOMClient = require('react-dom/client');
@@ -39,10 +39,7 @@ const initModuleFederationSharing = ({
39
39
  'react-dom/server': {
40
40
  version: _react.default.version,
41
41
  scope: 'chayns-api',
42
- get: async () => {
43
- const module = await Promise.resolve().then(() => _interopRequireWildcard(require('react-dom/server')));
44
- return () => module;
45
- }
42
+ lib: () => _server.default
46
43
  }
47
44
  };
48
45
  if (ReactDOMClient) {
@@ -623,8 +623,8 @@ class AppWrapper {
623
623
  return new _DialogHandler.default(config, this.functions.openDialog, this.functions.closeDialog, this.functions.dispatchEventToDialogClient, this.functions.addDialogClientEventListener);
624
624
  },
625
625
  openDialog: async (config, callback) => {
626
- var _this$values$device;
627
- const currentDialogId = crypto.randomUUID();
626
+ var _crypto$randomUUID, _crypto, _crypto$randomUUID2, _this$values$device;
627
+ const currentDialogId = (_crypto$randomUUID = (_crypto = crypto) === null || _crypto === void 0 || (_crypto$randomUUID2 = _crypto.randomUUID) === null || _crypto$randomUUID2 === void 0 ? void 0 : _crypto$randomUUID2.call(_crypto)) !== null && _crypto$randomUUID !== void 0 ? _crypto$randomUUID : `${Date.now()}-${Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)}`;
628
628
  this.nextDialogEventId = 0;
629
629
  let isSupported = (0, _is.isAppCallSupported)({
630
630
  minAndroidVersion: 7137,
@@ -34,9 +34,9 @@ const ChaynsProvider = ({
34
34
  isModule,
35
35
  chaynsApiId
36
36
  }) => {
37
- var _ref, _crypto, _customWrapper$curren, _customWrapper$curren2;
37
+ var _ref, _crypto, _crypto$randomUUID, _customWrapper$curren, _customWrapper$curren2;
38
38
  const customWrapper = useRef(null);
39
- const idRef = useRef((_ref = chaynsApiId !== null && chaynsApiId !== void 0 ? chaynsApiId : (_crypto = crypto) === null || _crypto === void 0 ? void 0 : _crypto.randomUUID()) !== null && _ref !== void 0 ? _ref : Math.random().toString());
39
+ const idRef = useRef((_ref = chaynsApiId !== null && chaynsApiId !== void 0 ? chaynsApiId : (_crypto = crypto) === null || _crypto === void 0 || (_crypto$randomUUID = _crypto.randomUUID) === null || _crypto$randomUUID === void 0 ? void 0 : _crypto$randomUUID.call(_crypto)) !== null && _ref !== void 0 ? _ref : Math.random().toString());
40
40
  if (!customWrapper.current) {
41
41
  if (isModule) {
42
42
  if (data && functions) {
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import ReactDOM from 'react-dom';
3
+ import ReactDOMServer from 'react-dom/server';
3
4
  import { SequentialLoadPlugin } from '../plugins/SequentialLoadPlugin';
4
5
  let ReactDOMClient;
5
6
  try {
@@ -31,10 +32,7 @@ export const initModuleFederationSharing = ({
31
32
  'react-dom/server': {
32
33
  version: React.version,
33
34
  scope: 'chayns-api',
34
- get: async () => {
35
- const module = await import('react-dom/server');
36
- return () => module;
37
- }
35
+ lib: () => ReactDOMServer
38
36
  }
39
37
  };
40
38
  if (ReactDOMClient) {
@@ -585,8 +585,8 @@ export class AppWrapper {
585
585
  return new DialogHandler(config, this.functions.openDialog, this.functions.closeDialog, this.functions.dispatchEventToDialogClient, this.functions.addDialogClientEventListener);
586
586
  },
587
587
  openDialog: async (config, callback) => {
588
- var _this$values$device;
589
- const currentDialogId = crypto.randomUUID();
588
+ var _crypto$randomUUID, _crypto, _crypto$randomUUID2, _this$values$device;
589
+ const currentDialogId = (_crypto$randomUUID = (_crypto = crypto) === null || _crypto === void 0 || (_crypto$randomUUID2 = _crypto.randomUUID) === null || _crypto$randomUUID2 === void 0 ? void 0 : _crypto$randomUUID2.call(_crypto)) !== null && _crypto$randomUUID !== void 0 ? _crypto$randomUUID : `${Date.now()}-${Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)}`;
590
590
  this.nextDialogEventId = 0;
591
591
  let isSupported = isAppCallSupported({
592
592
  minAndroidVersion: 7137,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chayns-api",
3
- "version": "2.6.17",
3
+ "version": "2.6.19",
4
4
  "description": "new chayns api",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",