@dotcms/uve 0.0.1-beta.26 → 0.0.1-beta.28
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.js +1 -0
- package/index.esm.js +1 -1
- package/internal.esm.js +1 -1
- package/package.json +1 -1
- package/public.cjs.js +30 -0
- package/public.esm.js +30 -1
- package/src/lib/editor/public.d.ts +17 -1
package/index.cjs.js
CHANGED
|
@@ -8,6 +8,7 @@ require('@dotcms/types/internal');
|
|
|
8
8
|
|
|
9
9
|
exports.createUVESubscription = _public.createUVESubscription;
|
|
10
10
|
exports.editContentlet = _public.editContentlet;
|
|
11
|
+
exports.enableBlockEditorInline = _public.enableBlockEditorInline;
|
|
11
12
|
exports.getUVEState = _public.getUVEState;
|
|
12
13
|
exports.initInlineEditing = _public.initInlineEditing;
|
|
13
14
|
exports.initUVE = _public.initUVE;
|
package/index.esm.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { c as createUVESubscription, e as editContentlet, g as getUVEState, i as initInlineEditing,
|
|
1
|
+
export { c as createUVESubscription, e as editContentlet, a as enableBlockEditorInline, g as getUVEState, i as initInlineEditing, b as initUVE, r as reorderMenu, s as sendMessageToUVE } from './public.esm.js';
|
|
2
2
|
import '@dotcms/types';
|
|
3
3
|
import '@dotcms/types/internal';
|
package/internal.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { C as CUSTOM_NO_COMPONENT, D as DEVELOPMENT_MODE,
|
|
1
|
+
export { C as CUSTOM_NO_COMPONENT, D as DEVELOPMENT_MODE, h as EMPTY_CONTAINER_STYLE_ANGULAR, f as EMPTY_CONTAINER_STYLE_REACT, E as END_CLASS, P as PRODUCTION_MODE, S as START_CLASS, _ as __UVE_EVENTS__, d as __UVE_EVENT_ERROR_FALLBACK__, q as combineClasses, p as computeScrollIsInBottom, n as findDotCMSElement, o as findDotCMSVTLData, m as getClosestDotCMSContainerData, t as getColumnPositionClasses, v as getContainersData, w as getContentletsInContainer, l as getDotCMSContainerData, k as getDotCMSContentletsBound, j as getDotCMSPageBounds, x as getDotContainerAttributes, u as getDotContentletAttributes, z as isValidBlocks, y as setBounds } from './public.esm.js';
|
|
2
2
|
import '@dotcms/types';
|
|
3
3
|
import '@dotcms/types/internal';
|
|
4
4
|
|
package/package.json
CHANGED
package/public.cjs.js
CHANGED
|
@@ -1005,6 +1005,35 @@ function initInlineEditing(type, data) {
|
|
|
1005
1005
|
}
|
|
1006
1006
|
});
|
|
1007
1007
|
}
|
|
1008
|
+
/**
|
|
1009
|
+
* Initializes the block editor inline editing for a contentlet field.
|
|
1010
|
+
*
|
|
1011
|
+
* @example
|
|
1012
|
+
* ```html
|
|
1013
|
+
* <div onclick="enableBlockEditorInline(contentlet, 'MY_BLOCK_EDITOR_FIELD_VARIABLE')">
|
|
1014
|
+
* ${My Content}
|
|
1015
|
+
* </div>
|
|
1016
|
+
* ```
|
|
1017
|
+
*
|
|
1018
|
+
* @export
|
|
1019
|
+
* @param {DotCMSBasicContentlet} contentlet
|
|
1020
|
+
* @param {string} fieldName
|
|
1021
|
+
* @return {*} {void}
|
|
1022
|
+
*/
|
|
1023
|
+
function enableBlockEditorInline(contentlet, fieldName) {
|
|
1024
|
+
if (!contentlet?.[fieldName]) {
|
|
1025
|
+
console.error(`Contentlet ${contentlet?.identifier} does not have field ${fieldName}`);
|
|
1026
|
+
return;
|
|
1027
|
+
}
|
|
1028
|
+
const data = {
|
|
1029
|
+
fieldName,
|
|
1030
|
+
inode: contentlet.inode,
|
|
1031
|
+
language: contentlet.languageId,
|
|
1032
|
+
contentType: contentlet.contentType,
|
|
1033
|
+
content: contentlet[fieldName]
|
|
1034
|
+
};
|
|
1035
|
+
initInlineEditing('BLOCK_EDITOR', data);
|
|
1036
|
+
}
|
|
1008
1037
|
/**
|
|
1009
1038
|
* Initializes the Universal Visual Editor (UVE) with required handlers and event listeners.
|
|
1010
1039
|
*
|
|
@@ -1060,6 +1089,7 @@ exports.combineClasses = combineClasses;
|
|
|
1060
1089
|
exports.computeScrollIsInBottom = computeScrollIsInBottom;
|
|
1061
1090
|
exports.createUVESubscription = createUVESubscription;
|
|
1062
1091
|
exports.editContentlet = editContentlet;
|
|
1092
|
+
exports.enableBlockEditorInline = enableBlockEditorInline;
|
|
1063
1093
|
exports.findDotCMSElement = findDotCMSElement;
|
|
1064
1094
|
exports.findDotCMSVTLData = findDotCMSVTLData;
|
|
1065
1095
|
exports.getClosestDotCMSContainerData = getClosestDotCMSContainerData;
|
package/public.esm.js
CHANGED
|
@@ -1003,6 +1003,35 @@ function initInlineEditing(type, data) {
|
|
|
1003
1003
|
}
|
|
1004
1004
|
});
|
|
1005
1005
|
}
|
|
1006
|
+
/**
|
|
1007
|
+
* Initializes the block editor inline editing for a contentlet field.
|
|
1008
|
+
*
|
|
1009
|
+
* @example
|
|
1010
|
+
* ```html
|
|
1011
|
+
* <div onclick="enableBlockEditorInline(contentlet, 'MY_BLOCK_EDITOR_FIELD_VARIABLE')">
|
|
1012
|
+
* ${My Content}
|
|
1013
|
+
* </div>
|
|
1014
|
+
* ```
|
|
1015
|
+
*
|
|
1016
|
+
* @export
|
|
1017
|
+
* @param {DotCMSBasicContentlet} contentlet
|
|
1018
|
+
* @param {string} fieldName
|
|
1019
|
+
* @return {*} {void}
|
|
1020
|
+
*/
|
|
1021
|
+
function enableBlockEditorInline(contentlet, fieldName) {
|
|
1022
|
+
if (!contentlet?.[fieldName]) {
|
|
1023
|
+
console.error(`Contentlet ${contentlet?.identifier} does not have field ${fieldName}`);
|
|
1024
|
+
return;
|
|
1025
|
+
}
|
|
1026
|
+
const data = {
|
|
1027
|
+
fieldName,
|
|
1028
|
+
inode: contentlet.inode,
|
|
1029
|
+
language: contentlet.languageId,
|
|
1030
|
+
contentType: contentlet.contentType,
|
|
1031
|
+
content: contentlet[fieldName]
|
|
1032
|
+
};
|
|
1033
|
+
initInlineEditing('BLOCK_EDITOR', data);
|
|
1034
|
+
}
|
|
1006
1035
|
/**
|
|
1007
1036
|
* Initializes the Universal Visual Editor (UVE) with required handlers and event listeners.
|
|
1008
1037
|
*
|
|
@@ -1045,4 +1074,4 @@ function initUVE(config = {}) {
|
|
|
1045
1074
|
};
|
|
1046
1075
|
}
|
|
1047
1076
|
|
|
1048
|
-
export { CUSTOM_NO_COMPONENT as C, DEVELOPMENT_MODE as D, END_CLASS as E, PRODUCTION_MODE as P, START_CLASS as S, __UVE_EVENTS__ as _,
|
|
1077
|
+
export { CUSTOM_NO_COMPONENT as C, DEVELOPMENT_MODE as D, END_CLASS as E, PRODUCTION_MODE as P, START_CLASS as S, __UVE_EVENTS__ as _, enableBlockEditorInline as a, initUVE as b, createUVESubscription as c, __UVE_EVENT_ERROR_FALLBACK__ as d, editContentlet as e, EMPTY_CONTAINER_STYLE_REACT as f, getUVEState as g, EMPTY_CONTAINER_STYLE_ANGULAR as h, initInlineEditing as i, getDotCMSPageBounds as j, getDotCMSContentletsBound as k, getDotCMSContainerData as l, getClosestDotCMSContainerData as m, findDotCMSElement as n, findDotCMSVTLData as o, computeScrollIsInBottom as p, combineClasses as q, reorderMenu as r, sendMessageToUVE as s, getColumnPositionClasses as t, getDotContentletAttributes as u, getContainersData as v, getContentletsInContainer as w, getDotContainerAttributes as x, setBounds as y, isValidBlocks as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Contentlet, DotCMSUVEConfig, DotCMSInlineEditingPayload, DotCMSInlineEditingType } from '@dotcms/types';
|
|
1
|
+
import { Contentlet, DotCMSUVEConfig, DotCMSInlineEditingPayload, DotCMSInlineEditingType, DotCMSBasicContentlet } from '@dotcms/types';
|
|
2
2
|
import { DotCMSReorderMenuConfig, DotCMSUVEMessage } from '@dotcms/types/internal';
|
|
3
3
|
/**
|
|
4
4
|
* Post message to dotcms page editor
|
|
@@ -35,6 +35,22 @@ export declare function reorderMenu(config?: DotCMSReorderMenuConfig): void;
|
|
|
35
35
|
* ```
|
|
36
36
|
*/
|
|
37
37
|
export declare function initInlineEditing(type: DotCMSInlineEditingType, data?: DotCMSInlineEditingPayload): void;
|
|
38
|
+
/**
|
|
39
|
+
* Initializes the block editor inline editing for a contentlet field.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```html
|
|
43
|
+
* <div onclick="enableBlockEditorInline(contentlet, 'MY_BLOCK_EDITOR_FIELD_VARIABLE')">
|
|
44
|
+
* ${My Content}
|
|
45
|
+
* </div>
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @export
|
|
49
|
+
* @param {DotCMSBasicContentlet} contentlet
|
|
50
|
+
* @param {string} fieldName
|
|
51
|
+
* @return {*} {void}
|
|
52
|
+
*/
|
|
53
|
+
export declare function enableBlockEditorInline(contentlet: DotCMSBasicContentlet, fieldName: string): void;
|
|
38
54
|
/**
|
|
39
55
|
* Initializes the Universal Visual Editor (UVE) with required handlers and event listeners.
|
|
40
56
|
*
|