1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-04 10:19:24 +02:00

add inputmask

This commit is contained in:
DanieL 2022-09-21 13:51:50 -03:00
parent ab84f1e730
commit e07838c6c7
203 changed files with 29712 additions and 5216 deletions

View file

@ -1,5 +1,5 @@
/**
* TinyMCE version 6.1.2 (2022-07-29)
* TinyMCE version 6.2.0 (2022-09-08)
*/
(function () {
@ -164,11 +164,9 @@
r[i] = x;
};
const internalFilter = (obj, pred, onTrue, onFalse) => {
const r = {};
each(obj, (x, i) => {
(pred(x, i) ? onTrue : onFalse)(x, i);
});
return r;
};
const filter = (obj, pred) => {
const t = {};
@ -433,7 +431,8 @@
resolve(reader.result);
};
reader.onerror = () => {
reject(reader.error.message);
var _a;
reject((_a = reader.error) === null || _a === void 0 ? void 0 : _a.message);
};
reader.readAsDataURL(blob);
});
@ -470,16 +469,16 @@
}
};
const getAttrib = (image, name) => {
var _a;
if (image.hasAttribute(name)) {
return image.getAttribute(name);
return (_a = image.getAttribute(name)) !== null && _a !== void 0 ? _a : '';
} else {
return '';
}
};
const getStyle = (image, name) => image.style[name] ? image.style[name] : '';
const hasCaption = image => image.parentNode !== null && image.parentNode.nodeName === 'FIGURE';
const updateAttrib = (image, name, value) => {
if (value === '') {
if (value === '' || value === null) {
image.removeAttribute(name);
} else {
image.setAttribute(name, value);
@ -494,8 +493,10 @@
};
const removeFigure = image => {
const figureElm = image.parentNode;
DOM.insertAfter(image, figureElm);
DOM.remove(figureElm);
if (isNonNullable(figureElm)) {
DOM.insertAfter(image, figureElm);
DOM.remove(figureElm);
}
};
const toggleCaption = image => {
if (hasCaption(image)) {
@ -515,8 +516,9 @@
}
};
const setSize = (name, normalizeCss) => (image, name, value) => {
if (image.style[name]) {
image.style[name] = addPixelSuffix(value);
const styles = image.style;
if (styles[name]) {
styles[name] = addPixelSuffix(value);
normalizeStyle(image, normalizeCss);
} else {
updateAttrib(image, name, value);
@ -546,8 +548,11 @@
const setBorderStyle = (image, value) => {
image.style.borderStyle = value;
};
const getBorderStyle = image => getStyle(image, 'borderStyle');
const isFigure = elm => elm.nodeName === 'FIGURE';
const getBorderStyle = image => {
var _a;
return (_a = image.style.borderStyle) !== null && _a !== void 0 ? _a : '';
};
const isFigure = elm => isNonNullable(elm) && elm.nodeName === 'FIGURE';
const isImage = elm => elm.nodeName === 'IMG';
const getIsDecorative = image => DOM.getAttrib(image, 'alt').length === 0 && DOM.getAttrib(image, 'role') === 'presentation';
const getAlt = image => {
@ -573,6 +578,7 @@
isDecorative: false
});
const getStyleValue = (normalizeCss, data) => {
var _a;
const image = document.createElement('img');
updateAttrib(image, 'style', data.style);
if (getHspace(image) || data.hspace !== '') {
@ -587,7 +593,7 @@
if (getBorderStyle(image) || data.borderStyle !== '') {
setBorderStyle(image, data.borderStyle);
}
return normalizeCss(image.getAttribute('style'));
return normalizeCss((_a = image.getAttribute('style')) !== null && _a !== void 0 ? _a : '');
};
const create = (normalizeCss, data) => {
const image = document.createElement('img');
@ -618,12 +624,12 @@
hspace: getHspace(image),
vspace: getVspace(image),
border: getBorder(image),
borderStyle: getStyle(image, 'borderStyle'),
borderStyle: getBorderStyle(image),
isDecorative: getIsDecorative(image)
});
const updateProp = (image, oldData, newData, name, set) => {
if (newData[name] !== oldData[name]) {
set(image, name, newData[name]);
set(image, name, String(newData[name]));
}
};
const setAlt = (image, alt, isDecorative) => {
@ -687,11 +693,12 @@
return imgElm;
};
const splitTextBlock = (editor, figure) => {
var _a;
const dom = editor.dom;
const textBlockElements = filter(editor.schema.getTextBlockElements(), (_, parentElm) => !editor.schema.isValidChild(parentElm, 'figure'));
const textBlock = dom.getParent(figure.parentNode, node => hasNonNullableKey(textBlockElements, node.nodeName), editor.getBody());
if (textBlock) {
return dom.split(textBlock, figure);
return (_a = dom.split(textBlock, figure)) !== null && _a !== void 0 ? _a : figure;
} else {
return figure;
}
@ -731,15 +738,17 @@
};
const writeImageDataToSelection = (editor, data) => {
const image = getSelectedImage(editor);
write(css => normalizeCss$1(editor, css), data, image);
syncSrcAttr(editor, image);
if (isFigure(image.parentNode)) {
const figure = image.parentNode;
splitTextBlock(editor, figure);
editor.selection.select(image.parentNode);
} else {
editor.selection.select(image);
waitLoadImage(editor, data, image);
if (image) {
write(css => normalizeCss$1(editor, css), data, image);
syncSrcAttr(editor, image);
if (isFigure(image.parentNode)) {
const figure = image.parentNode;
splitTextBlock(editor, figure);
editor.selection.select(image.parentNode);
} else {
editor.selection.select(image);
waitLoadImage(editor, data, image);
}
}
};
const sanitizeImageData = (editor, data) => {
@ -935,7 +944,7 @@
const AdvTab = { makeTab: makeTab$2 };
const collect = editor => {
const urlListSanitizer = ListUtils.sanitizer(item => editor.convertURL(item.value || item.url, 'src'));
const urlListSanitizer = ListUtils.sanitizer(item => editor.convertURL(item.value || item.url || '', 'src'));
const futureImageList = new Promise(completer => {
createImageList(editor, imageList => {
completer(urlListSanitizer(imageList).map(items => flatten([
@ -1102,7 +1111,7 @@
});
const toImageData = (data, removeEmptyAlt) => ({
src: data.src.value,
alt: data.alt.length === 0 && removeEmptyAlt ? null : data.alt,
alt: (data.alt === null || data.alt.length === 0) && removeEmptyAlt ? null : data.alt,
title: data.title,
width: data.dimensions.width,
height: data.dimensions.height,
@ -1346,13 +1355,16 @@
}));
}
};
const createBlobCache = editor => (file, blobUri, dataUrl) => editor.editorUpload.blobCache.create({
blob: file,
blobUri,
name: file.name ? file.name.replace(/\.[^\.]+$/, '') : null,
filename: file.name,
base64: dataUrl.split(',')[1]
});
const createBlobCache = editor => (file, blobUri, dataUrl) => {
var _a;
return editor.editorUpload.blobCache.create({
blob: file,
blobUri,
name: (_a = file.name) === null || _a === void 0 ? void 0 : _a.replace(/\.[^\.]+$/, ''),
filename: file.name,
base64: dataUrl.split(',')[1]
});
};
const addToBlobCache = editor => blobInfo => {
editor.editorUpload.blobCache.add(blobInfo);
};
@ -1363,10 +1375,11 @@
const parseStyle = editor => cssText => editor.dom.parseStyle(cssText);
const serializeStyle = editor => (stylesArg, name) => editor.dom.serializeStyle(stylesArg, name);
const uploadImage = editor => blobInfo => global$1(editor).upload([blobInfo], false).then(results => {
var _a;
if (results.length === 0) {
return Promise.reject('Failed to upload image');
} else if (results[0].status === false) {
return Promise.reject(results[0].error.message);
return Promise.reject((_a = results[0].error) === null || _a === void 0 ? void 0 : _a.message);
} else {
return results[0];
}
@ -1421,7 +1434,7 @@
const hasImageClass = node => {
const className = node.attr('class');
return className && /\bimage\b/.test(className);
return isNonNullable(className) && /\bimage\b/.test(className);
};
const toggleContentEditableState = state => nodes => {
let i = nodes.length;