@progress/kendo-editor-common
Advanced tools
Comparing version 1.11.7 to 1.11.8-dev.202411010906
@@ -5,2 +5,3 @@ import { DOMParser as ProseMirrorDOMParser } from 'prosemirror-model'; | ||
import { DOMSerializer } from './DOMSerializer'; | ||
import { setStyleAttr } from './utils'; | ||
var blockWrappers = [ | ||
@@ -143,8 +144,2 @@ 'div', 'ol', 'ul', 'li', 'table', 'tbody', 'thead', 'tfoot', 'caption', 'td', 'th', 'p', | ||
}; | ||
var applyStyle = function (styleString, element) { | ||
return styleString.split(';').filter(function (s) { return s.trim() !== ''; }).forEach(function (s) { | ||
var parts = s.split(':'); | ||
element.style[parts[0].trim()] = parts[1].trim(); | ||
}); | ||
}; | ||
var restoreStyleAttr = function (container) { | ||
@@ -154,3 +149,3 @@ Array.from(container.querySelectorAll('[' + styleAttr + ']')).forEach(function (element) { | ||
element.removeAttribute(styleAttr); | ||
applyStyle(styleString, element); | ||
setStyleAttr(element, styleString); | ||
}); | ||
@@ -157,0 +152,0 @@ }; |
@@ -276,3 +276,3 @@ import { __assign } from "tslib"; | ||
}; | ||
var setStyleAttr = function (element, styleString) { | ||
export var setStyleAttr = function (element, styleString) { | ||
var styles = parseStyle(styleString); | ||
@@ -279,0 +279,0 @@ for (var style in styles) { |
@@ -5,2 +5,3 @@ import { DOMParser as ProseMirrorDOMParser } from 'prosemirror-model'; | ||
import { DOMSerializer } from './DOMSerializer'; | ||
import { setStyleAttr } from './utils'; | ||
const blockWrappers = [ | ||
@@ -142,6 +143,2 @@ 'div', 'ol', 'ul', 'li', 'table', 'tbody', 'thead', 'tfoot', 'caption', 'td', 'th', 'p', | ||
}; | ||
const applyStyle = (styleString, element) => styleString.split(';').filter(s => s.trim() !== '').forEach(s => { | ||
const parts = s.split(':'); | ||
element.style[parts[0].trim()] = parts[1].trim(); | ||
}); | ||
const restoreStyleAttr = (container) => { | ||
@@ -151,3 +148,3 @@ Array.from(container.querySelectorAll('[' + styleAttr + ']')).forEach((element) => { | ||
element.removeAttribute(styleAttr); | ||
applyStyle(styleString, element); | ||
setStyleAttr(element, styleString); | ||
}); | ||
@@ -154,0 +151,0 @@ }; |
@@ -270,3 +270,3 @@ import { Node, Fragment } from 'prosemirror-model'; | ||
}; | ||
const setStyleAttr = (element, styleString) => { | ||
export const setStyleAttr = (element, styleString) => { | ||
const styles = parseStyle(styleString); | ||
@@ -273,0 +273,0 @@ for (const style in styles) { |
@@ -8,2 +8,3 @@ "use strict"; | ||
var DOMSerializer_1 = require("./DOMSerializer"); | ||
var utils_1 = require("./utils"); | ||
var blockWrappers = [ | ||
@@ -147,8 +148,2 @@ 'div', 'ol', 'ul', 'li', 'table', 'tbody', 'thead', 'tfoot', 'caption', 'td', 'th', 'p', | ||
}; | ||
var applyStyle = function (styleString, element) { | ||
return styleString.split(';').filter(function (s) { return s.trim() !== ''; }).forEach(function (s) { | ||
var parts = s.split(':'); | ||
element.style[parts[0].trim()] = parts[1].trim(); | ||
}); | ||
}; | ||
var restoreStyleAttr = function (container) { | ||
@@ -158,3 +153,3 @@ Array.from(container.querySelectorAll('[' + styleAttr + ']')).forEach(function (element) { | ||
element.removeAttribute(styleAttr); | ||
applyStyle(styleString, element); | ||
(0, utils_1.setStyleAttr)(element, styleString); | ||
}); | ||
@@ -161,0 +156,0 @@ }; |
@@ -68,2 +68,3 @@ import { Node, NodeType, ParseOptions, Schema, ResolvedPos } from 'prosemirror-model'; | ||
export declare const applyStyle: (styleText: string | null, styleType: string, styleValue: string) => string; | ||
export declare const setStyleAttr: (element: HTMLElement, styleString: string) => void; | ||
export declare const setAttribute: (node: HTMLElement, attrName: string, value?: string) => void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.setAttribute = exports.applyStyle = exports.parseStyle = exports.expandToWordWrap = exports.expandSelection = exports.shallowEqual = exports.indentHtml = exports.selectedLineTextOnly = exports.getNodeFromSelection = exports.getSelectionText = exports.hasSameMarkup = exports.insertNode = exports.parentNode = exports.findNthParentNodeOfType = exports.canInsert = exports.setNodeStyle = exports.changeStylesString = void 0; | ||
exports.setAttribute = exports.setStyleAttr = exports.applyStyle = exports.parseStyle = exports.expandToWordWrap = exports.expandSelection = exports.shallowEqual = exports.indentHtml = exports.selectedLineTextOnly = exports.getNodeFromSelection = exports.getSelectionText = exports.hasSameMarkup = exports.insertNode = exports.parentNode = exports.findNthParentNodeOfType = exports.canInsert = exports.setNodeStyle = exports.changeStylesString = void 0; | ||
var tslib_1 = require("tslib"); | ||
@@ -303,2 +303,3 @@ var prosemirror_model_1 = require("prosemirror-model"); | ||
}; | ||
exports.setStyleAttr = setStyleAttr; | ||
var setAttribute = function (node, attrName, value) { | ||
@@ -309,3 +310,3 @@ var current = node.getAttribute(attrName); | ||
node.removeAttribute(attrName); | ||
setStyleAttr(node, value); | ||
(0, exports.setStyleAttr)(node, value); | ||
} | ||
@@ -312,0 +313,0 @@ else { |
{ | ||
"name": "@progress/kendo-editor-common", | ||
"description": "Kendo UI TypeScript package exporting functions for Editor component", | ||
"version": "1.11.7", | ||
"version": "1.11.8-dev.202411010906", | ||
"keywords": [ | ||
@@ -25,3 +25,3 @@ "Kendo UI" | ||
"dependencies": { | ||
"@progress/kendo-common": "^1.0.1", | ||
"@progress/kendo-common": "^1.0.2", | ||
"prosemirror-commands": "1.6.2", | ||
@@ -28,0 +28,0 @@ "prosemirror-dropcursor": "1.8.1", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1564980
14908
3