@dotcms/uve 0.0.1-beta.2 → 0.0.1-beta.4

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/index.cjs.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./src/public/index";
1
+ export * from "./src/index";
package/index.cjs.js CHANGED
@@ -31,28 +31,28 @@ var types = require('./types.cjs.js');
31
31
  * ```
32
32
  */
33
33
  function getUVEState() {
34
- if (typeof window === 'undefined' || window.parent === window || !window.location) {
35
- return;
36
- }
37
- const url = new URL(window.location.href);
38
- const possibleModes = Object.values(types.UVE_MODE);
39
- let mode = url.searchParams.get('mode') ?? types.UVE_MODE.EDIT;
40
- const languageId = url.searchParams.get('language_id');
41
- const persona = url.searchParams.get('personaId');
42
- const variantName = url.searchParams.get('variantName');
43
- const experimentId = url.searchParams.get('experimentId');
44
- const publishDate = url.searchParams.get('publishDate');
45
- if (!possibleModes.includes(mode)) {
46
- mode = types.UVE_MODE.EDIT;
47
- }
48
- return {
49
- mode,
50
- languageId,
51
- persona,
52
- variantName,
53
- experimentId,
54
- publishDate
55
- };
34
+ if (typeof window === 'undefined' || window.parent === window || !window.location) {
35
+ return;
36
+ }
37
+ const url = new URL(window.location.href);
38
+ const possibleModes = Object.values(types.UVE_MODE);
39
+ let mode = url.searchParams.get('mode') ?? types.UVE_MODE.EDIT;
40
+ const languageId = url.searchParams.get('language_id');
41
+ const persona = url.searchParams.get('personaId');
42
+ const variantName = url.searchParams.get('variantName');
43
+ const experimentId = url.searchParams.get('experimentId');
44
+ const publishDate = url.searchParams.get('publishDate');
45
+ if (!possibleModes.includes(mode)) {
46
+ mode = types.UVE_MODE.EDIT;
47
+ }
48
+ return {
49
+ mode,
50
+ languageId,
51
+ persona,
52
+ variantName,
53
+ experimentId,
54
+ publishDate
55
+ };
56
56
  }
57
57
 
58
58
  exports.getUVEState = getUVEState;
package/index.esm.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./src/public/index";
1
+ export * from "./src/index";
package/index.esm.js CHANGED
@@ -29,28 +29,28 @@ import { UVE_MODE } from './types.esm.js';
29
29
  * ```
30
30
  */
31
31
  function getUVEState() {
32
- if (typeof window === 'undefined' || window.parent === window || !window.location) {
33
- return;
34
- }
35
- const url = new URL(window.location.href);
36
- const possibleModes = Object.values(UVE_MODE);
37
- let mode = url.searchParams.get('mode') ?? UVE_MODE.EDIT;
38
- const languageId = url.searchParams.get('language_id');
39
- const persona = url.searchParams.get('personaId');
40
- const variantName = url.searchParams.get('variantName');
41
- const experimentId = url.searchParams.get('experimentId');
42
- const publishDate = url.searchParams.get('publishDate');
43
- if (!possibleModes.includes(mode)) {
44
- mode = UVE_MODE.EDIT;
45
- }
46
- return {
47
- mode,
48
- languageId,
49
- persona,
50
- variantName,
51
- experimentId,
52
- publishDate
53
- };
32
+ if (typeof window === 'undefined' || window.parent === window || !window.location) {
33
+ return;
34
+ }
35
+ const url = new URL(window.location.href);
36
+ const possibleModes = Object.values(UVE_MODE);
37
+ let mode = url.searchParams.get('mode') ?? UVE_MODE.EDIT;
38
+ const languageId = url.searchParams.get('language_id');
39
+ const persona = url.searchParams.get('personaId');
40
+ const variantName = url.searchParams.get('variantName');
41
+ const experimentId = url.searchParams.get('experimentId');
42
+ const publishDate = url.searchParams.get('publishDate');
43
+ if (!possibleModes.includes(mode)) {
44
+ mode = UVE_MODE.EDIT;
45
+ }
46
+ return {
47
+ mode,
48
+ languageId,
49
+ persona,
50
+ variantName,
51
+ experimentId,
52
+ publishDate
53
+ };
54
54
  }
55
55
 
56
56
  export { getUVEState };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotcms/uve",
3
- "version": "0.0.1-beta.2",
3
+ "version": "0.0.1-beta.4",
4
4
  "description": "Official JavaScript library for interacting with Universal Visual Editor (UVE)",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,12 +13,6 @@
13
13
  "UVE",
14
14
  "Universal Visual Editor"
15
15
  ],
16
- "author": "dotcms <dev@dotcms.com>",
17
- "license": "MIT",
18
- "bugs": {
19
- "url": "https://github.com/dotCMS/core/issues"
20
- },
21
- "homepage": "https://github.com/dotCMS/core/tree/main/core-web/libs/sdk/client/README.md",
22
16
  "exports": {
23
17
  "./package.json": "./package.json",
24
18
  ".": {
@@ -34,6 +28,22 @@
34
28
  "default": "./types.cjs.js"
35
29
  }
36
30
  },
31
+ "typesVersions": {
32
+ "*": {
33
+ ".": [
34
+ "./src/index.d.ts"
35
+ ],
36
+ "types": [
37
+ "./src/types.d.ts"
38
+ ]
39
+ }
40
+ },
41
+ "author": "dotcms <dev@dotcms.com>",
42
+ "license": "MIT",
43
+ "bugs": {
44
+ "url": "https://github.com/dotCMS/core/issues"
45
+ },
46
+ "homepage": "https://github.com/dotCMS/core/tree/main/core-web/libs/sdk/uve/README.md",
37
47
  "module": "./index.esm.js",
38
48
  "main": "./index.cjs.js",
39
49
  "types": "./index.esm.d.ts"
package/src/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import { getUVEState } from './lib/utils';
2
+ export { getUVEState };
package/src/types.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import { UVE_MODE, UVEState } from './lib/types';
2
+ export { UVE_MODE, UVEState };
package/types.cjs.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./src/public/types";
1
+ export * from "./src/types";
package/types.cjs.js CHANGED
@@ -11,8 +11,8 @@
11
11
  */
12
12
  exports.UVE_MODE = void 0;
13
13
  (function (UVE_MODE) {
14
- UVE_MODE["EDIT"] = "EDIT_MODE";
15
- UVE_MODE["PREVIEW"] = "PREVIEW_MODE";
16
- UVE_MODE["LIVE"] = "LIVE";
17
- UVE_MODE["UNKNOWN"] = "UNKNOWN";
14
+ UVE_MODE["EDIT"] = "EDIT_MODE";
15
+ UVE_MODE["PREVIEW"] = "PREVIEW_MODE";
16
+ UVE_MODE["LIVE"] = "LIVE";
17
+ UVE_MODE["UNKNOWN"] = "UNKNOWN";
18
18
  })(exports.UVE_MODE || (exports.UVE_MODE = {}));
package/types.esm.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./src/public/types";
1
+ export * from "./src/types";
package/types.esm.js CHANGED
@@ -9,10 +9,10 @@
9
9
  */
10
10
  var UVE_MODE;
11
11
  (function (UVE_MODE) {
12
- UVE_MODE["EDIT"] = "EDIT_MODE";
13
- UVE_MODE["PREVIEW"] = "PREVIEW_MODE";
14
- UVE_MODE["LIVE"] = "LIVE";
15
- UVE_MODE["UNKNOWN"] = "UNKNOWN";
12
+ UVE_MODE["EDIT"] = "EDIT_MODE";
13
+ UVE_MODE["PREVIEW"] = "PREVIEW_MODE";
14
+ UVE_MODE["LIVE"] = "LIVE";
15
+ UVE_MODE["UNKNOWN"] = "UNKNOWN";
16
16
  })(UVE_MODE || (UVE_MODE = {}));
17
17
 
18
18
  export { UVE_MODE };
@@ -1,2 +0,0 @@
1
- import { getUVEState } from '../lib/utils';
2
- export { getUVEState };
@@ -1,2 +0,0 @@
1
- import { UVE_MODE, UVEState } from '../lib/types';
2
- export { UVE_MODE, UVEState };