suneditor 3.1.1 → 3.1.3
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 +1 -1
- package/dist/suneditor-contents.min.css +1 -1
- package/dist/suneditor.min.css +1 -1
- package/dist/suneditor.min.js +1 -1
- package/package.json +10 -7
- package/src/assets/design/size.css +2 -1
- package/src/assets/suneditor.css +75 -23
- package/src/core/editor.js +1 -0
- package/src/core/event/actions/index.js +2 -1
- package/src/core/event/effects/keydown.registry.js +3 -1
- package/src/core/event/effects/ruleHelpers.js +30 -1
- package/src/core/event/handlers/handler_ww_dragDrop.js +20 -0
- package/src/core/event/rules/keydown.rule.arrow.js +22 -16
- package/src/core/event/rules/keydown.rule.backspace.js +18 -5
- package/src/core/event/rules/keydown.rule.delete.js +7 -5
- package/src/core/event/rules/keydown.rule.enter.js +33 -3
- package/src/core/logic/panel/menu.js +4 -0
- package/src/core/logic/shell/ui.js +52 -3
- package/src/core/schema/options.js +1 -1
- package/src/core/section/constructor.js +44 -13
- package/src/core/section/documentType.js +55 -29
- package/src/modules/contract/Browser.js +3 -0
- package/src/modules/contract/Controller.js +3 -0
- package/src/modules/contract/Figure.js +23 -4
- package/src/modules/contract/Modal.js +2 -0
- package/src/plugins/dropdown/table/services/table.style.js +21 -12
- package/types/core/event/actions/index.d.ts +1 -1
- package/types/core/event/effects/keydown.registry.d.ts +1 -1
- package/types/core/event/effects/ruleHelpers.d.ts +12 -0
- package/types/core/logic/shell/ui.d.ts +2 -2
- package/types/core/schema/options.d.ts +2 -2
- package/types/core/section/documentType.d.ts +17 -1
|
@@ -42,7 +42,7 @@ declare const _default: {
|
|
|
42
42
|
/** @action enterFormatInsertBrNode */
|
|
43
43
|
'enter.format.insertBrNode': ({ ports }: EffectContext_keydown, { wSelection }: any) => void;
|
|
44
44
|
/** @action enterFormatBreakAtEdge */
|
|
45
|
-
'enter.format.breakAtEdge': ({ ports, ctx }: EffectContext_keydown, { formatEl, selectionNode, formatStartEdge, formatEndEdge }: any) => void;
|
|
45
|
+
'enter.format.breakAtEdge': ({ ports, ctx }: EffectContext_keydown, { formatEl, selectionNode, formatStartEdge, formatEndEdge, bidiSwapped }: any) => void;
|
|
46
46
|
/** @action enterFormatBreakWithSelection */
|
|
47
47
|
'enter.format.breakWithSelection': ({ ports, ctx }: EffectContext_keydown, { formatEl, range, formatStartEdge, formatEndEdge }: any) => void;
|
|
48
48
|
/** @action enterFormatBreakAtCursor */
|
|
@@ -34,3 +34,15 @@ export function isUneditableNode(ports: EventPorts, range: Range, isFront: boole
|
|
|
34
34
|
* @returns {void}
|
|
35
35
|
*/
|
|
36
36
|
export function setDefaultLine(ports: EventPorts, lineTagName: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* @description Detects if a detected logical edge is incorrect due to bidi text direction mismatch in RTL mode.
|
|
39
|
+
* When LTR text (numbers, Latin) is inside an RTL line, the browser may place the caret at offset 0
|
|
40
|
+
* for the visual end or offset=length for the visual start. This function compares the caret's visual
|
|
41
|
+
* position against the content boundaries to detect such mismatches.
|
|
42
|
+
* @param {Range} range - The current collapsed range
|
|
43
|
+
* @param {HTMLElement} formatEl - The format/line element
|
|
44
|
+
* @param {'front'|'end'} detectedEdge - The edge detected by logical offset check
|
|
45
|
+
* @param {Document} doc - The document object
|
|
46
|
+
* @returns {boolean} true if the detected edge doesn't match the visual position (bidi mismatch)
|
|
47
|
+
*/
|
|
48
|
+
export function isRtlBidiMismatch(range: Range, formatEl: HTMLElement, detectedEdge: 'front' | 'end', doc: Document): boolean;
|
|
@@ -51,9 +51,9 @@ declare class UIManager {
|
|
|
51
51
|
setTheme(theme: string): void;
|
|
52
52
|
/**
|
|
53
53
|
* @description Set direction to `rtl` or `ltr`.
|
|
54
|
-
* @param {
|
|
54
|
+
* @param {"rtl"|"ltr"} dir `rtl` or `ltr`
|
|
55
55
|
*/
|
|
56
|
-
setDir(dir:
|
|
56
|
+
setDir(dir: 'rtl' | 'ltr'): void;
|
|
57
57
|
/**
|
|
58
58
|
* @description Switch to or off `ReadOnly` mode.
|
|
59
59
|
* @param {boolean} value `readOnly` boolean value.
|
|
@@ -309,7 +309,7 @@ export namespace DEFAULTS {
|
|
|
309
309
|
* attributeWhitelist: {
|
|
310
310
|
* a: 'href|target',
|
|
311
311
|
* img: 'src|alt',
|
|
312
|
-
* '*': 'id|data
|
|
312
|
+
* '*': 'id|data-[^\s]+'
|
|
313
313
|
* }
|
|
314
314
|
* }
|
|
315
315
|
* ```
|
|
@@ -1055,7 +1055,7 @@ export type EditorBaseOptions = {
|
|
|
1055
1055
|
* attributeWhitelist: {
|
|
1056
1056
|
* a: 'href|target',
|
|
1057
1057
|
* img: 'src|alt',
|
|
1058
|
-
* '*': 'id|data
|
|
1058
|
+
* '*': 'id|data-[^\s]+'
|
|
1059
1059
|
* }
|
|
1060
1060
|
* }
|
|
1061
1061
|
* ```
|
|
@@ -30,9 +30,19 @@ declare class DocumentType {
|
|
|
30
30
|
* @param {number} t - The initial top position value to be adjusted.
|
|
31
31
|
* @param {HTMLCollection} chr - The elements array in the current (main) page.
|
|
32
32
|
* @param {HTMLCollection} mChr - The elements array in the mirrored page.
|
|
33
|
+
* @param {Array.<{number: number, top: number, isBreak?: boolean}>} [pages] - The pages array containing page break info.
|
|
33
34
|
* @returns {number|null} The adjusted top value.
|
|
34
35
|
*/
|
|
35
|
-
_calcPageBreakTop(
|
|
36
|
+
_calcPageBreakTop(
|
|
37
|
+
t: number,
|
|
38
|
+
chr: HTMLCollection,
|
|
39
|
+
mChr: HTMLCollection,
|
|
40
|
+
pages?: Array<{
|
|
41
|
+
number: number;
|
|
42
|
+
top: number;
|
|
43
|
+
isBreak?: boolean;
|
|
44
|
+
}>,
|
|
45
|
+
): number | null;
|
|
36
46
|
/**
|
|
37
47
|
* @internal
|
|
38
48
|
* @description Initializes the cache for document elements.
|
|
@@ -44,6 +54,7 @@ declare class DocumentType {
|
|
|
44
54
|
* @description Retrieves the element at a given position.
|
|
45
55
|
* @param {number} pageTop - The vertical position to check.
|
|
46
56
|
* @param {HTMLCollection} mChr - List of mirrored elements.
|
|
57
|
+
* @param {Array.<{number: number, top: number, isBreak?: boolean}>} [pages] - The pages array containing page break info for skipping break elements.
|
|
47
58
|
* @returns {{ci: number, cm: number, ch: number}} The closest element and its related data.
|
|
48
59
|
* - ci: The index of the closest element.
|
|
49
60
|
* - cm: The distance between the top of the closest element and the given position.
|
|
@@ -52,6 +63,11 @@ declare class DocumentType {
|
|
|
52
63
|
_getElementAtPosition(
|
|
53
64
|
pageTop: number,
|
|
54
65
|
mChr: HTMLCollection,
|
|
66
|
+
pages?: Array<{
|
|
67
|
+
number: number;
|
|
68
|
+
top: number;
|
|
69
|
+
isBreak?: boolean;
|
|
70
|
+
}>,
|
|
55
71
|
): {
|
|
56
72
|
ci: number;
|
|
57
73
|
cm: number;
|