@onehat/ui 0.2.22 → 0.2.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onehat/ui",
3
- "version": "0.2.22",
3
+ "version": "0.2.23",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -22,7 +22,6 @@
22
22
  "@ckeditor/ckeditor5-react": "^5.0.6",
23
23
  "@onehat/data": "^1.13.6",
24
24
  "@hookform/resolvers": "^2.9.11",
25
- "browser-or-node": "^2.1.1",
26
25
  "ckeditor5-custom-build": "file:ckeditor5",
27
26
  "js-cookie": "^3.0.1",
28
27
  "native-base": "^3.4.25",
@@ -1,4 +1,4 @@
1
- import { isBrowser, isNode, isWebWorker, isJsDom, isDeno } from "browser-or-node";
1
+ import { isBrowser, isNode, isWebWorker, } from '../Functions/PlatformDetector.js';
2
2
 
3
3
 
4
4
  export const UI_MODE_WEB = 'Web';
@@ -0,0 +1,29 @@
1
+ // Taken from https://github.com/flexdinesh/browser-or-node/blob/master/src/index.js
2
+
3
+ const isBrowser =
4
+ typeof window !== "undefined" && typeof window.document !== "undefined";
5
+
6
+ const isNode =
7
+ typeof process !== "undefined" &&
8
+ process.versions != null &&
9
+ process.versions.node != null;
10
+
11
+ const isWebWorker =
12
+ typeof self === "object" &&
13
+ self.constructor &&
14
+ self.constructor.name === "DedicatedWorkerGlobalScope";
15
+
16
+ /**
17
+ * @see https://github.com/jsdom/jsdom/releases/tag/12.0.0
18
+ * @see https://github.com/jsdom/jsdom/issues/1537
19
+ */
20
+ const isJsDom =
21
+ (typeof window !== "undefined" && window.name === "nodejs") ||
22
+ (typeof navigator !== "undefined" &&
23
+ (navigator.userAgent?.includes("Node.js") ||
24
+ navigator.userAgent?.includes("jsdom")));
25
+
26
+ const isDeno =
27
+ typeof Deno !== "undefined" && Deno.version?.deno;
28
+
29
+ export { isBrowser, isWebWorker, isNode, isJsDom, isDeno };
@@ -2,7 +2,7 @@ import UiGlobals from '../UiGlobals.js';
2
2
  import CKEditor from '../Components/Form/Field/CKEditor/CKEditor.js';
3
3
  import Datetime from '../PlatformImports/Web/Datetime.js';
4
4
  import Draggable from '../PlatformImports/Web/Draggable.js';
5
- import File from './Form/Field/File.js';
5
+ import File from '../Components/Form/Field/File.js';
6
6
  import _ from 'lodash';
7
7
 
8
8
  export default function registerWebComponents() {