@dotcms/uve 0.0.1-beta.2 → 0.0.1-beta.21
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/README.md +321 -4
- package/index.cjs.d.ts +1 -1
- package/index.cjs.js +10 -54
- package/index.cjs2.js +1151 -0
- package/index.esm.d.ts +1 -1
- package/index.esm.js +2 -56
- package/index.esm2.js +1119 -0
- package/internal.cjs.d.ts +1 -0
- package/internal.cjs.default.js +1 -0
- package/internal.cjs.js +39 -0
- package/internal.cjs.mjs +2 -0
- package/internal.esm.d.ts +1 -0
- package/internal.esm.js +2 -0
- package/package.json +26 -7
- package/src/index.d.ts +2 -0
- package/src/internal/constants.d.ts +76 -0
- package/src/internal/events.d.ts +66 -0
- package/src/internal/index.d.ts +1 -0
- package/src/internal.d.ts +6 -0
- package/src/lib/{utils.d.ts → core/core.utils.d.ts} +20 -1
- package/src/lib/dom/dom.utils.d.ts +206 -0
- package/src/lib/editor/internal.d.ts +23 -0
- package/src/lib/editor/public.d.ts +62 -0
- package/src/lib/types/block-editor-renderer/internal.d.ts +46 -0
- package/src/lib/types/block-editor-renderer/public.d.ts +38 -0
- package/src/lib/types/editor/internal.d.ts +119 -0
- package/src/lib/types/editor/public.d.ts +271 -0
- package/src/lib/types/events/internal.d.ts +34 -0
- package/src/lib/types/events/public.d.ts +18 -0
- package/src/lib/types/page/public.d.ts +485 -0
- package/src/script/sdk-editor.d.ts +6 -0
- package/src/script/utils.d.ts +53 -0
- package/src/types.d.ts +4 -0
- package/types.cjs.d.ts +1 -1
- package/types.cjs.js +97 -4
- package/types.esm.d.ts +1 -1
- package/types.esm.js +98 -5
- package/src/lib/types.d.ts +0 -33
- package/src/public/index.d.ts +0 -2
- package/src/public/types.d.ts +0 -2
package/index.esm.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./src/
|
|
1
|
+
export * from "./src/index";
|
package/index.esm.js
CHANGED
|
@@ -1,56 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Gets the current state of the Universal Visual Editor (UVE).
|
|
5
|
-
*
|
|
6
|
-
* This function checks if the code is running inside the DotCMS Universal Visual Editor
|
|
7
|
-
* and returns information about its current state, including the editor mode.
|
|
8
|
-
*
|
|
9
|
-
* @export
|
|
10
|
-
* @return {UVEState | undefined} Returns the UVE state object if running inside the editor,
|
|
11
|
-
* undefined otherwise.
|
|
12
|
-
*
|
|
13
|
-
* The state includes:
|
|
14
|
-
* - mode: The current editor mode (preview, edit, live)
|
|
15
|
-
* - languageId: The language ID of the current page setted on the UVE
|
|
16
|
-
* - persona: The persona of the current page setted on the UVE
|
|
17
|
-
* - variantName: The name of the current variant
|
|
18
|
-
* - experimentId: The ID of the current experiment
|
|
19
|
-
* - publishDate: The publish date of the current page setted on the UVE
|
|
20
|
-
*
|
|
21
|
-
* @note The absence of any of these properties means that the value is the default one.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```ts
|
|
25
|
-
* const editorState = getUVEState();
|
|
26
|
-
* if (editorState?.mode === 'edit') {
|
|
27
|
-
* // Enable editing features
|
|
28
|
-
* }
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
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
|
-
};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export { getUVEState };
|
|
1
|
+
export { u as createUVESubscription, w as editContentlet, t as getUVEState, y as initInlineEditing, z as initUVE, x as reorderMenu, v as sendMessageToUVE } from './index.esm2.js';
|
|
2
|
+
import './types.esm.js';
|