@dotcms/uve 0.0.1-beta.9 → 1.0.0
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 +586 -4
- package/index.cjs.js +13 -82
- package/index.esm.js +3 -83
- package/internal.cjs.js +87 -60
- package/internal.esm.js +61 -59
- package/package.json +4 -10
- package/public.cjs.js +1132 -0
- package/public.esm.js +1098 -0
- package/src/index.d.ts +2 -1
- package/src/internal/constants.d.ts +61 -3
- package/src/internal/events.d.ts +66 -0
- package/src/internal/index.d.ts +1 -0
- package/src/internal/tinymce.config.d.ts +45 -0
- package/src/internal.d.ts +2 -2
- package/src/lib/{utils.d.ts → core/core.utils.d.ts} +11 -7
- package/src/lib/dom/dom.utils.d.ts +205 -0
- package/src/lib/editor/internal.d.ts +23 -0
- package/src/lib/editor/public.d.ts +86 -0
- package/src/script/sdk-editor.d.ts +6 -0
- package/src/script/utils.d.ts +53 -0
- package/src/lib/types/editor/internal.d.ts +0 -44
- package/src/lib/types/editor/public.d.ts +0 -138
- package/src/lib/types/events/internal.d.ts +0 -32
- package/src/lib/types/events/public.d.ts +0 -18
- package/src/types.d.ts +0 -2
- package/types.cjs.d.ts +0 -1
- package/types.cjs.default.js +0 -1
- package/types.cjs.js +0 -84
- package/types.cjs.mjs +0 -2
- package/types.esm.d.ts +0 -1
- package/types.esm.js +0 -84
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents the state of the Universal Visual Editor (UVE)
|
|
3
|
-
* @interface
|
|
4
|
-
* @property {UVE_MODE} mode - The current mode of operation for UVE (EDIT, PREVIEW, LIVE, or UNKNOWN)
|
|
5
|
-
* @property {string | null} persona - The selected persona for content personalization
|
|
6
|
-
* @property {string | null} variantName - The name of the current content variant
|
|
7
|
-
* @property {string | null} experimentId - The identifier for the current A/B testing experiment
|
|
8
|
-
* @property {string | null} publishDate - The scheduled publish date for content
|
|
9
|
-
* @property {string | null} languageId - The identifier for the current language selection
|
|
10
|
-
*/
|
|
11
|
-
export interface UVEState {
|
|
12
|
-
mode: UVE_MODE;
|
|
13
|
-
persona: string | null;
|
|
14
|
-
variantName: string | null;
|
|
15
|
-
experimentId: string | null;
|
|
16
|
-
publishDate: string | null;
|
|
17
|
-
languageId: string | null;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Possible modes of UVE (Universal Visual Editor)
|
|
21
|
-
* @enum {string}
|
|
22
|
-
*
|
|
23
|
-
* @property {string} LIVE - Shows published and future content
|
|
24
|
-
* @property {string} PREVIEW - Shows published and working content
|
|
25
|
-
* @property {string} EDIT - Enables content editing functionality in UVE
|
|
26
|
-
* @property {string} UNKNOWN - Error state, UVE should not remain in this mode
|
|
27
|
-
*/
|
|
28
|
-
export declare enum UVE_MODE {
|
|
29
|
-
EDIT = "EDIT_MODE",
|
|
30
|
-
PREVIEW = "PREVIEW_MODE",
|
|
31
|
-
LIVE = "LIVE",
|
|
32
|
-
UNKNOWN = "UNKNOWN"
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Callback function for UVE events
|
|
36
|
-
* @callback UVECallback
|
|
37
|
-
* @param {unknown} payload - The payload of the event
|
|
38
|
-
*/
|
|
39
|
-
export type UVECallback = (payload: unknown) => void;
|
|
40
|
-
/**
|
|
41
|
-
* Unsubscribe function for UVE events
|
|
42
|
-
* @callback UnsubscribeUVE
|
|
43
|
-
*/
|
|
44
|
-
export type UnsubscribeUVE = () => void;
|
|
45
|
-
/**
|
|
46
|
-
* UVESubscription type
|
|
47
|
-
* @typedef {Object} UVESubscription
|
|
48
|
-
* @property {UnsubscribeUVE} unsubscribe - The unsubscribe function for the UVE event
|
|
49
|
-
* @property {string} event - The event name
|
|
50
|
-
*/
|
|
51
|
-
export type UVESubscription = {
|
|
52
|
-
unsubscribe: UnsubscribeUVE;
|
|
53
|
-
event: string;
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* UVE event type
|
|
57
|
-
* @typedef {function} UVEEvent
|
|
58
|
-
*/
|
|
59
|
-
export type UVEEvent = (callback: UVECallback) => UVESubscription;
|
|
60
|
-
/**
|
|
61
|
-
* Configuration type for DotCMS Editor
|
|
62
|
-
* @typedef {Object} DotCMSEditoConfig
|
|
63
|
-
* @property {Object} [params] - Parameters for Page API configuration
|
|
64
|
-
* @property {number} [params.depth] - The depth level for fetching page data
|
|
65
|
-
* @property {string} [query] - GraphQL query string for data fetching
|
|
66
|
-
*/
|
|
67
|
-
export type DotCMSEditorConfig = {
|
|
68
|
-
params: {
|
|
69
|
-
depth: number;
|
|
70
|
-
};
|
|
71
|
-
} | {
|
|
72
|
-
query: string;
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* Actions send to the dotcms editor
|
|
76
|
-
*
|
|
77
|
-
* @export
|
|
78
|
-
* @enum {number}
|
|
79
|
-
*/
|
|
80
|
-
export declare enum DotCMSUVEAction {
|
|
81
|
-
/**
|
|
82
|
-
* Tell the dotcms editor that page change
|
|
83
|
-
*/
|
|
84
|
-
NAVIGATION_UPDATE = "set-url",
|
|
85
|
-
/**
|
|
86
|
-
* Send the element position of the rows, columnsm containers and contentlets
|
|
87
|
-
*/
|
|
88
|
-
SET_BOUNDS = "set-bounds",
|
|
89
|
-
/**
|
|
90
|
-
* Send the information of the hovered contentlet
|
|
91
|
-
*/
|
|
92
|
-
SET_CONTENTLET = "set-contentlet",
|
|
93
|
-
/**
|
|
94
|
-
* Tell the editor that the page is being scrolled
|
|
95
|
-
*/
|
|
96
|
-
IFRAME_SCROLL = "scroll",
|
|
97
|
-
/**
|
|
98
|
-
* Tell the editor that the page has stopped scrolling
|
|
99
|
-
*/
|
|
100
|
-
IFRAME_SCROLL_END = "scroll-end",
|
|
101
|
-
/**
|
|
102
|
-
* Ping the editor to see if the page is inside the editor
|
|
103
|
-
*/
|
|
104
|
-
PING_EDITOR = "ping-editor",
|
|
105
|
-
/**
|
|
106
|
-
* Tell the editor to init the inline editing editor.
|
|
107
|
-
*/
|
|
108
|
-
INIT_INLINE_EDITING = "init-inline-editing",
|
|
109
|
-
/**
|
|
110
|
-
* Tell the editor to open the Copy-contentlet dialog
|
|
111
|
-
* To copy a content and then edit it inline.
|
|
112
|
-
*/
|
|
113
|
-
COPY_CONTENTLET_INLINE_EDITING = "copy-contentlet-inline-editing",
|
|
114
|
-
/**
|
|
115
|
-
* Tell the editor to save inline edited contentlet
|
|
116
|
-
*/
|
|
117
|
-
UPDATE_CONTENTLET_INLINE_EDITING = "update-contentlet-inline-editing",
|
|
118
|
-
/**
|
|
119
|
-
* Tell the editor to trigger a menu reorder
|
|
120
|
-
*/
|
|
121
|
-
REORDER_MENU = "reorder-menu",
|
|
122
|
-
/**
|
|
123
|
-
* Tell the editor to send the page info to iframe
|
|
124
|
-
*/
|
|
125
|
-
GET_PAGE_DATA = "get-page-data",
|
|
126
|
-
/**
|
|
127
|
-
* Tell the editor an user send a graphql query
|
|
128
|
-
*/
|
|
129
|
-
CLIENT_READY = "client-ready",
|
|
130
|
-
/**
|
|
131
|
-
* Tell the editor to edit a contentlet
|
|
132
|
-
*/
|
|
133
|
-
EDIT_CONTENTLET = "edit-contentlet",
|
|
134
|
-
/**
|
|
135
|
-
* Tell the editor to do nothing
|
|
136
|
-
*/
|
|
137
|
-
NOOP = "noop"
|
|
138
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Actions received from the dotcms editor
|
|
3
|
-
*
|
|
4
|
-
* @export
|
|
5
|
-
* @enum {number}
|
|
6
|
-
*/
|
|
7
|
-
export declare enum __DOTCMS_UVE_EVENT__ {
|
|
8
|
-
/**
|
|
9
|
-
* Request to page to reload
|
|
10
|
-
*/
|
|
11
|
-
UVE_RELOAD_PAGE = "uve-reload-page",
|
|
12
|
-
/**
|
|
13
|
-
* Request the bounds for the elements
|
|
14
|
-
*/
|
|
15
|
-
UVE_REQUEST_BOUNDS = "uve-request-bounds",
|
|
16
|
-
/**
|
|
17
|
-
* Received pong from the editor
|
|
18
|
-
*/
|
|
19
|
-
UVE_EDITOR_PONG = "uve-editor-pong",
|
|
20
|
-
/**
|
|
21
|
-
* Received scroll event trigger from the editor
|
|
22
|
-
*/
|
|
23
|
-
UVE_SCROLL_INSIDE_IFRAME = "uve-scroll-inside-iframe",
|
|
24
|
-
/**
|
|
25
|
-
* Set the page data
|
|
26
|
-
*/
|
|
27
|
-
UVE_SET_PAGE_DATA = "uve-set-page-data",
|
|
28
|
-
/**
|
|
29
|
-
* Copy contentlet inline editing success
|
|
30
|
-
*/
|
|
31
|
-
UVE_COPY_CONTENTLET_INLINE_EDITING_SUCCESS = "uve-copy-contentlet-inline-editing-success"
|
|
32
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export type DotCMSInlineEditingType = 'BLOCK_EDITOR' | 'WYSIWYG';
|
|
2
|
-
/**
|
|
3
|
-
* Interface representing the data needed for inline editing in DotCMS
|
|
4
|
-
*
|
|
5
|
-
* @interface DotCMSInlineEditorData
|
|
6
|
-
* @property {string} inode - The inode identifier of the content being edited
|
|
7
|
-
* @property {number} language - The language ID of the content
|
|
8
|
-
* @property {string} contentType - The content type identifier
|
|
9
|
-
* @property {string} fieldName - The name of the field being edited
|
|
10
|
-
* @property {Record<string, unknown>} content - The content data as key-value pairs
|
|
11
|
-
*/
|
|
12
|
-
export interface DotCMSInlineEditingPayload {
|
|
13
|
-
inode: string;
|
|
14
|
-
language: number;
|
|
15
|
-
contentType: string;
|
|
16
|
-
fieldName: string;
|
|
17
|
-
content: Record<string, unknown>;
|
|
18
|
-
}
|
package/src/types.d.ts
DELETED
package/types.cjs.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./src/types";
|
package/types.cjs.default.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
exports._default = require('./types.cjs.js').default;
|
package/types.cjs.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Possible modes of UVE (Universal Visual Editor)
|
|
5
|
-
* @enum {string}
|
|
6
|
-
*
|
|
7
|
-
* @property {string} LIVE - Shows published and future content
|
|
8
|
-
* @property {string} PREVIEW - Shows published and working content
|
|
9
|
-
* @property {string} EDIT - Enables content editing functionality in UVE
|
|
10
|
-
* @property {string} UNKNOWN - Error state, UVE should not remain in this mode
|
|
11
|
-
*/
|
|
12
|
-
exports.UVE_MODE = void 0;
|
|
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";
|
|
18
|
-
})(exports.UVE_MODE || (exports.UVE_MODE = {}));
|
|
19
|
-
/**
|
|
20
|
-
* Actions send to the dotcms editor
|
|
21
|
-
*
|
|
22
|
-
* @export
|
|
23
|
-
* @enum {number}
|
|
24
|
-
*/
|
|
25
|
-
exports.DotCMSUVEAction = void 0;
|
|
26
|
-
(function (DotCMSUVEAction) {
|
|
27
|
-
/**
|
|
28
|
-
* Tell the dotcms editor that page change
|
|
29
|
-
*/
|
|
30
|
-
DotCMSUVEAction["NAVIGATION_UPDATE"] = "set-url";
|
|
31
|
-
/**
|
|
32
|
-
* Send the element position of the rows, columnsm containers and contentlets
|
|
33
|
-
*/
|
|
34
|
-
DotCMSUVEAction["SET_BOUNDS"] = "set-bounds";
|
|
35
|
-
/**
|
|
36
|
-
* Send the information of the hovered contentlet
|
|
37
|
-
*/
|
|
38
|
-
DotCMSUVEAction["SET_CONTENTLET"] = "set-contentlet";
|
|
39
|
-
/**
|
|
40
|
-
* Tell the editor that the page is being scrolled
|
|
41
|
-
*/
|
|
42
|
-
DotCMSUVEAction["IFRAME_SCROLL"] = "scroll";
|
|
43
|
-
/**
|
|
44
|
-
* Tell the editor that the page has stopped scrolling
|
|
45
|
-
*/
|
|
46
|
-
DotCMSUVEAction["IFRAME_SCROLL_END"] = "scroll-end";
|
|
47
|
-
/**
|
|
48
|
-
* Ping the editor to see if the page is inside the editor
|
|
49
|
-
*/
|
|
50
|
-
DotCMSUVEAction["PING_EDITOR"] = "ping-editor";
|
|
51
|
-
/**
|
|
52
|
-
* Tell the editor to init the inline editing editor.
|
|
53
|
-
*/
|
|
54
|
-
DotCMSUVEAction["INIT_INLINE_EDITING"] = "init-inline-editing";
|
|
55
|
-
/**
|
|
56
|
-
* Tell the editor to open the Copy-contentlet dialog
|
|
57
|
-
* To copy a content and then edit it inline.
|
|
58
|
-
*/
|
|
59
|
-
DotCMSUVEAction["COPY_CONTENTLET_INLINE_EDITING"] = "copy-contentlet-inline-editing";
|
|
60
|
-
/**
|
|
61
|
-
* Tell the editor to save inline edited contentlet
|
|
62
|
-
*/
|
|
63
|
-
DotCMSUVEAction["UPDATE_CONTENTLET_INLINE_EDITING"] = "update-contentlet-inline-editing";
|
|
64
|
-
/**
|
|
65
|
-
* Tell the editor to trigger a menu reorder
|
|
66
|
-
*/
|
|
67
|
-
DotCMSUVEAction["REORDER_MENU"] = "reorder-menu";
|
|
68
|
-
/**
|
|
69
|
-
* Tell the editor to send the page info to iframe
|
|
70
|
-
*/
|
|
71
|
-
DotCMSUVEAction["GET_PAGE_DATA"] = "get-page-data";
|
|
72
|
-
/**
|
|
73
|
-
* Tell the editor an user send a graphql query
|
|
74
|
-
*/
|
|
75
|
-
DotCMSUVEAction["CLIENT_READY"] = "client-ready";
|
|
76
|
-
/**
|
|
77
|
-
* Tell the editor to edit a contentlet
|
|
78
|
-
*/
|
|
79
|
-
DotCMSUVEAction["EDIT_CONTENTLET"] = "edit-contentlet";
|
|
80
|
-
/**
|
|
81
|
-
* Tell the editor to do nothing
|
|
82
|
-
*/
|
|
83
|
-
DotCMSUVEAction["NOOP"] = "noop";
|
|
84
|
-
})(exports.DotCMSUVEAction || (exports.DotCMSUVEAction = {}));
|
package/types.cjs.mjs
DELETED
package/types.esm.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./src/types";
|
package/types.esm.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Possible modes of UVE (Universal Visual Editor)
|
|
3
|
-
* @enum {string}
|
|
4
|
-
*
|
|
5
|
-
* @property {string} LIVE - Shows published and future content
|
|
6
|
-
* @property {string} PREVIEW - Shows published and working content
|
|
7
|
-
* @property {string} EDIT - Enables content editing functionality in UVE
|
|
8
|
-
* @property {string} UNKNOWN - Error state, UVE should not remain in this mode
|
|
9
|
-
*/
|
|
10
|
-
var UVE_MODE;
|
|
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";
|
|
16
|
-
})(UVE_MODE || (UVE_MODE = {}));
|
|
17
|
-
/**
|
|
18
|
-
* Actions send to the dotcms editor
|
|
19
|
-
*
|
|
20
|
-
* @export
|
|
21
|
-
* @enum {number}
|
|
22
|
-
*/
|
|
23
|
-
var DotCMSUVEAction;
|
|
24
|
-
(function (DotCMSUVEAction) {
|
|
25
|
-
/**
|
|
26
|
-
* Tell the dotcms editor that page change
|
|
27
|
-
*/
|
|
28
|
-
DotCMSUVEAction["NAVIGATION_UPDATE"] = "set-url";
|
|
29
|
-
/**
|
|
30
|
-
* Send the element position of the rows, columnsm containers and contentlets
|
|
31
|
-
*/
|
|
32
|
-
DotCMSUVEAction["SET_BOUNDS"] = "set-bounds";
|
|
33
|
-
/**
|
|
34
|
-
* Send the information of the hovered contentlet
|
|
35
|
-
*/
|
|
36
|
-
DotCMSUVEAction["SET_CONTENTLET"] = "set-contentlet";
|
|
37
|
-
/**
|
|
38
|
-
* Tell the editor that the page is being scrolled
|
|
39
|
-
*/
|
|
40
|
-
DotCMSUVEAction["IFRAME_SCROLL"] = "scroll";
|
|
41
|
-
/**
|
|
42
|
-
* Tell the editor that the page has stopped scrolling
|
|
43
|
-
*/
|
|
44
|
-
DotCMSUVEAction["IFRAME_SCROLL_END"] = "scroll-end";
|
|
45
|
-
/**
|
|
46
|
-
* Ping the editor to see if the page is inside the editor
|
|
47
|
-
*/
|
|
48
|
-
DotCMSUVEAction["PING_EDITOR"] = "ping-editor";
|
|
49
|
-
/**
|
|
50
|
-
* Tell the editor to init the inline editing editor.
|
|
51
|
-
*/
|
|
52
|
-
DotCMSUVEAction["INIT_INLINE_EDITING"] = "init-inline-editing";
|
|
53
|
-
/**
|
|
54
|
-
* Tell the editor to open the Copy-contentlet dialog
|
|
55
|
-
* To copy a content and then edit it inline.
|
|
56
|
-
*/
|
|
57
|
-
DotCMSUVEAction["COPY_CONTENTLET_INLINE_EDITING"] = "copy-contentlet-inline-editing";
|
|
58
|
-
/**
|
|
59
|
-
* Tell the editor to save inline edited contentlet
|
|
60
|
-
*/
|
|
61
|
-
DotCMSUVEAction["UPDATE_CONTENTLET_INLINE_EDITING"] = "update-contentlet-inline-editing";
|
|
62
|
-
/**
|
|
63
|
-
* Tell the editor to trigger a menu reorder
|
|
64
|
-
*/
|
|
65
|
-
DotCMSUVEAction["REORDER_MENU"] = "reorder-menu";
|
|
66
|
-
/**
|
|
67
|
-
* Tell the editor to send the page info to iframe
|
|
68
|
-
*/
|
|
69
|
-
DotCMSUVEAction["GET_PAGE_DATA"] = "get-page-data";
|
|
70
|
-
/**
|
|
71
|
-
* Tell the editor an user send a graphql query
|
|
72
|
-
*/
|
|
73
|
-
DotCMSUVEAction["CLIENT_READY"] = "client-ready";
|
|
74
|
-
/**
|
|
75
|
-
* Tell the editor to edit a contentlet
|
|
76
|
-
*/
|
|
77
|
-
DotCMSUVEAction["EDIT_CONTENTLET"] = "edit-contentlet";
|
|
78
|
-
/**
|
|
79
|
-
* Tell the editor to do nothing
|
|
80
|
-
*/
|
|
81
|
-
DotCMSUVEAction["NOOP"] = "noop";
|
|
82
|
-
})(DotCMSUVEAction || (DotCMSUVEAction = {}));
|
|
83
|
-
|
|
84
|
-
export { DotCMSUVEAction, UVE_MODE };
|