mirror of
https://github.com/tabler/tabler.git
synced 2026-08-21 18:34:30 +04:00
Release 1.0.0-beta18
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
+5
-5
File diff suppressed because one or more lines are too long
+5
-5
File diff suppressed because one or more lines are too long
+840
-571
File diff suppressed because it is too large
Load Diff
+5
-5
File diff suppressed because one or more lines are too long
+228
-228
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* Bootstrap v5.3.0-alpha1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Bootstrap v5.3.0-alpha3 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
@@ -11,7 +11,55 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/index.js
|
||||
* Bootstrap dom/data.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const elementMap = new Map();
|
||||
const Data = {
|
||||
set(element, key, instance) {
|
||||
if (!elementMap.has(element)) {
|
||||
elementMap.set(element, new Map());
|
||||
}
|
||||
const instanceMap = elementMap.get(element);
|
||||
|
||||
// make it clear we only want one instance per element
|
||||
// can be removed later when multiple key/instances are fine to be used
|
||||
if (!instanceMap.has(key) && instanceMap.size !== 0) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
|
||||
return;
|
||||
}
|
||||
instanceMap.set(key, instance);
|
||||
},
|
||||
get(element, key) {
|
||||
if (elementMap.has(element)) {
|
||||
return elementMap.get(element).get(key) || null;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
remove(element, key) {
|
||||
if (!elementMap.has(element)) {
|
||||
return;
|
||||
}
|
||||
const instanceMap = elementMap.get(element);
|
||||
instanceMap.delete(key);
|
||||
|
||||
// free up element references if there are no instances left for an element
|
||||
if (instanceMap.size === 0) {
|
||||
elementMap.delete(element);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -258,7 +306,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): dom/event-handler.js
|
||||
* Bootstrap dom/event-handler.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -328,7 +376,7 @@
|
||||
}
|
||||
function normalizeParameters(originalTypeEvent, handler, delegationFunction) {
|
||||
const isDelegated = typeof handler === 'string';
|
||||
// todo: tooltip passes `false` instead of selector, so we need to check
|
||||
// TODO: tooltip passes `false` instead of selector, so we need to check
|
||||
const callable = isDelegated ? delegationFunction : handler || delegationFunction;
|
||||
let typeEvent = getTypeEvent(originalTypeEvent);
|
||||
if (!nativeEvents.has(typeEvent)) {
|
||||
@@ -445,11 +493,10 @@
|
||||
nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
|
||||
defaultPrevented = jQueryEvent.isDefaultPrevented();
|
||||
}
|
||||
let evt = new Event(event, {
|
||||
const evt = hydrateObj(new Event(event, {
|
||||
bubbles,
|
||||
cancelable: true
|
||||
});
|
||||
evt = hydrateObj(evt, args);
|
||||
}), args);
|
||||
if (defaultPrevented) {
|
||||
evt.preventDefault();
|
||||
}
|
||||
@@ -480,55 +527,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): dom/data.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const elementMap = new Map();
|
||||
const Data = {
|
||||
set(element, key, instance) {
|
||||
if (!elementMap.has(element)) {
|
||||
elementMap.set(element, new Map());
|
||||
}
|
||||
const instanceMap = elementMap.get(element);
|
||||
|
||||
// make it clear we only want one instance per element
|
||||
// can be removed later when multiple key/instances are fine to be used
|
||||
if (!instanceMap.has(key) && instanceMap.size !== 0) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
|
||||
return;
|
||||
}
|
||||
instanceMap.set(key, instance);
|
||||
},
|
||||
get(element, key) {
|
||||
if (elementMap.has(element)) {
|
||||
return elementMap.get(element).get(key) || null;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
remove(element, key) {
|
||||
if (!elementMap.has(element)) {
|
||||
return;
|
||||
}
|
||||
const instanceMap = elementMap.get(element);
|
||||
instanceMap.delete(key);
|
||||
|
||||
// free up element references if there are no instances left for an element
|
||||
if (instanceMap.size === 0) {
|
||||
elementMap.delete(element);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): dom/manipulator.js
|
||||
* Bootstrap dom/manipulator.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -585,7 +584,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/config.js
|
||||
* Bootstrap util/config.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -637,7 +636,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): base-component.js
|
||||
* Bootstrap base-component.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -646,7 +645,7 @@
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const VERSION = '5.3.0-alpha1';
|
||||
const VERSION = '5.3.0-alpha2';
|
||||
|
||||
/**
|
||||
* Class definition
|
||||
@@ -705,7 +704,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): dom/selector-engine.js
|
||||
* Bootstrap dom/selector-engine.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -793,7 +792,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/component-functions.js
|
||||
* Bootstrap util/component-functions.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -817,7 +816,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): alert.js
|
||||
* Bootstrap alert.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -891,7 +890,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): button.js
|
||||
* Bootstrap button.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -954,7 +953,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/swipe.js
|
||||
* Bootstrap util/swipe.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1073,7 +1072,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): carousel.js
|
||||
* Bootstrap carousel.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1333,7 +1332,7 @@
|
||||
}
|
||||
if (!activeElement || !nextElement) {
|
||||
// Some weirdness is happening, so we bail
|
||||
// todo: change tests that use empty divs to avoid this check
|
||||
// TODO: change tests that use empty divs to avoid this check
|
||||
return;
|
||||
}
|
||||
const isCycling = Boolean(this._interval);
|
||||
@@ -1445,7 +1444,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): collapse.js
|
||||
* Bootstrap collapse.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1839,7 +1838,7 @@
|
||||
function getUAString() {
|
||||
var uaData = navigator.userAgentData;
|
||||
|
||||
if (uaData != null && uaData.brands) {
|
||||
if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
|
||||
return uaData.brands.map(function (item) {
|
||||
return item.brand + "/" + item.version;
|
||||
}).join(' ');
|
||||
@@ -2158,10 +2157,9 @@
|
||||
// Zooming can change the DPR, but it seems to report a value that will
|
||||
// cleanly divide the values into the appropriate subpixels.
|
||||
|
||||
function roundOffsetsByDPR(_ref) {
|
||||
function roundOffsetsByDPR(_ref, win) {
|
||||
var x = _ref.x,
|
||||
y = _ref.y;
|
||||
var win = window;
|
||||
var dpr = win.devicePixelRatio || 1;
|
||||
return {
|
||||
x: round(x * dpr) / dpr || 0,
|
||||
@@ -2244,7 +2242,7 @@
|
||||
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
||||
x: x,
|
||||
y: y
|
||||
}) : {
|
||||
}, getWindow(popper)) : {
|
||||
x: x,
|
||||
y: y
|
||||
};
|
||||
@@ -3482,49 +3480,49 @@
|
||||
|
||||
const Popper = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
||||
__proto__: null,
|
||||
popperGenerator,
|
||||
detectOverflow,
|
||||
createPopperBase: createPopper$2,
|
||||
createPopper,
|
||||
createPopperLite: createPopper$1,
|
||||
top,
|
||||
bottom,
|
||||
right,
|
||||
left,
|
||||
auto,
|
||||
basePlacements,
|
||||
start,
|
||||
end,
|
||||
clippingParents,
|
||||
viewport,
|
||||
popper,
|
||||
reference,
|
||||
variationPlacements,
|
||||
placements,
|
||||
beforeRead,
|
||||
read,
|
||||
afterRead,
|
||||
beforeMain,
|
||||
main,
|
||||
afterMain,
|
||||
beforeWrite,
|
||||
write,
|
||||
afterRead,
|
||||
afterWrite,
|
||||
modifierPhases,
|
||||
applyStyles: applyStyles$1,
|
||||
arrow: arrow$1,
|
||||
auto,
|
||||
basePlacements,
|
||||
beforeMain,
|
||||
beforeRead,
|
||||
beforeWrite,
|
||||
bottom,
|
||||
clippingParents,
|
||||
computeStyles: computeStyles$1,
|
||||
createPopper,
|
||||
createPopperBase: createPopper$2,
|
||||
createPopperLite: createPopper$1,
|
||||
detectOverflow,
|
||||
end,
|
||||
eventListeners,
|
||||
flip: flip$1,
|
||||
hide: hide$1,
|
||||
left,
|
||||
main,
|
||||
modifierPhases,
|
||||
offset: offset$1,
|
||||
placements,
|
||||
popper,
|
||||
popperGenerator,
|
||||
popperOffsets: popperOffsets$1,
|
||||
preventOverflow: preventOverflow$1
|
||||
preventOverflow: preventOverflow$1,
|
||||
read,
|
||||
reference,
|
||||
right,
|
||||
start,
|
||||
top,
|
||||
variationPlacements,
|
||||
viewport,
|
||||
write
|
||||
}, Symbol.toStringTag, { value: 'Module' }));
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): dropdown.js
|
||||
* Bootstrap dropdown.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -3596,7 +3594,7 @@
|
||||
super(element, config);
|
||||
this._popper = null;
|
||||
this._parent = this._element.parentNode; // dropdown wrapper
|
||||
// todo: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
|
||||
// TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
|
||||
this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, this._parent);
|
||||
this._inNavbar = this._detectNavbar();
|
||||
}
|
||||
@@ -3770,7 +3768,7 @@
|
||||
|
||||
// Disable Popper if we have a static display or Dropdown is in Navbar
|
||||
if (this._inNavbar || this._config.display === 'static') {
|
||||
Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // todo:v6 remove
|
||||
Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // TODO: v6 remove
|
||||
defaultBsPopperConfig.modifiers = [{
|
||||
name: 'applyStyles',
|
||||
enabled: false
|
||||
@@ -3852,7 +3850,7 @@
|
||||
}
|
||||
event.preventDefault();
|
||||
|
||||
// todo: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
|
||||
// TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
|
||||
const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$3, event.delegateTarget.parentNode);
|
||||
const instance = Dropdown.getOrCreateInstance(getToggleButton);
|
||||
if (isUpOrDownEvent) {
|
||||
@@ -3891,104 +3889,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/scrollBar.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
|
||||
const SELECTOR_STICKY_CONTENT = '.sticky-top';
|
||||
const PROPERTY_PADDING = 'padding-right';
|
||||
const PROPERTY_MARGIN = 'margin-right';
|
||||
|
||||
/**
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
class ScrollBarHelper {
|
||||
constructor() {
|
||||
this._element = document.body;
|
||||
}
|
||||
|
||||
// Public
|
||||
getWidth() {
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
|
||||
const documentWidth = document.documentElement.clientWidth;
|
||||
return Math.abs(window.innerWidth - documentWidth);
|
||||
}
|
||||
hide() {
|
||||
const width = this.getWidth();
|
||||
this._disableOverFlow();
|
||||
// give padding to element to balance the hidden scrollbar width
|
||||
this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
|
||||
// trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
|
||||
this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
|
||||
this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);
|
||||
}
|
||||
reset() {
|
||||
this._resetElementAttributes(this._element, 'overflow');
|
||||
this._resetElementAttributes(this._element, PROPERTY_PADDING);
|
||||
this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);
|
||||
this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);
|
||||
}
|
||||
isOverflowing() {
|
||||
return this.getWidth() > 0;
|
||||
}
|
||||
|
||||
// Private
|
||||
_disableOverFlow() {
|
||||
this._saveInitialAttribute(this._element, 'overflow');
|
||||
this._element.style.overflow = 'hidden';
|
||||
}
|
||||
_setElementAttributes(selector, styleProperty, callback) {
|
||||
const scrollbarWidth = this.getWidth();
|
||||
const manipulationCallBack = element => {
|
||||
if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
|
||||
return;
|
||||
}
|
||||
this._saveInitialAttribute(element, styleProperty);
|
||||
const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);
|
||||
element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);
|
||||
};
|
||||
this._applyManipulationCallback(selector, manipulationCallBack);
|
||||
}
|
||||
_saveInitialAttribute(element, styleProperty) {
|
||||
const actualValue = element.style.getPropertyValue(styleProperty);
|
||||
if (actualValue) {
|
||||
Manipulator.setDataAttribute(element, styleProperty, actualValue);
|
||||
}
|
||||
}
|
||||
_resetElementAttributes(selector, styleProperty) {
|
||||
const manipulationCallBack = element => {
|
||||
const value = Manipulator.getDataAttribute(element, styleProperty);
|
||||
// We only want to remove the property if the value is `null`; the value can also be zero
|
||||
if (value === null) {
|
||||
element.style.removeProperty(styleProperty);
|
||||
return;
|
||||
}
|
||||
Manipulator.removeDataAttribute(element, styleProperty);
|
||||
element.style.setProperty(styleProperty, value);
|
||||
};
|
||||
this._applyManipulationCallback(selector, manipulationCallBack);
|
||||
}
|
||||
_applyManipulationCallback(selector, callBack) {
|
||||
if (isElement$1(selector)) {
|
||||
callBack(selector);
|
||||
return;
|
||||
}
|
||||
for (const sel of SelectorEngine.find(selector, this._element)) {
|
||||
callBack(sel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/backdrop.js
|
||||
* Bootstrap util/backdrop.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -4112,7 +4013,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/focustrap.js
|
||||
* Bootstrap util/focustrap.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -4210,7 +4111,104 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): modal.js
|
||||
* Bootstrap util/scrollBar.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
|
||||
const SELECTOR_STICKY_CONTENT = '.sticky-top';
|
||||
const PROPERTY_PADDING = 'padding-right';
|
||||
const PROPERTY_MARGIN = 'margin-right';
|
||||
|
||||
/**
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
class ScrollBarHelper {
|
||||
constructor() {
|
||||
this._element = document.body;
|
||||
}
|
||||
|
||||
// Public
|
||||
getWidth() {
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
|
||||
const documentWidth = document.documentElement.clientWidth;
|
||||
return Math.abs(window.innerWidth - documentWidth);
|
||||
}
|
||||
hide() {
|
||||
const width = this.getWidth();
|
||||
this._disableOverFlow();
|
||||
// give padding to element to balance the hidden scrollbar width
|
||||
this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
|
||||
// trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
|
||||
this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
|
||||
this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);
|
||||
}
|
||||
reset() {
|
||||
this._resetElementAttributes(this._element, 'overflow');
|
||||
this._resetElementAttributes(this._element, PROPERTY_PADDING);
|
||||
this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);
|
||||
this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);
|
||||
}
|
||||
isOverflowing() {
|
||||
return this.getWidth() > 0;
|
||||
}
|
||||
|
||||
// Private
|
||||
_disableOverFlow() {
|
||||
this._saveInitialAttribute(this._element, 'overflow');
|
||||
this._element.style.overflow = 'hidden';
|
||||
}
|
||||
_setElementAttributes(selector, styleProperty, callback) {
|
||||
const scrollbarWidth = this.getWidth();
|
||||
const manipulationCallBack = element => {
|
||||
if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
|
||||
return;
|
||||
}
|
||||
this._saveInitialAttribute(element, styleProperty);
|
||||
const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);
|
||||
element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);
|
||||
};
|
||||
this._applyManipulationCallback(selector, manipulationCallBack);
|
||||
}
|
||||
_saveInitialAttribute(element, styleProperty) {
|
||||
const actualValue = element.style.getPropertyValue(styleProperty);
|
||||
if (actualValue) {
|
||||
Manipulator.setDataAttribute(element, styleProperty, actualValue);
|
||||
}
|
||||
}
|
||||
_resetElementAttributes(selector, styleProperty) {
|
||||
const manipulationCallBack = element => {
|
||||
const value = Manipulator.getDataAttribute(element, styleProperty);
|
||||
// We only want to remove the property if the value is `null`; the value can also be zero
|
||||
if (value === null) {
|
||||
element.style.removeProperty(styleProperty);
|
||||
return;
|
||||
}
|
||||
Manipulator.removeDataAttribute(element, styleProperty);
|
||||
element.style.setProperty(styleProperty, value);
|
||||
};
|
||||
this._applyManipulationCallback(selector, manipulationCallBack);
|
||||
}
|
||||
_applyManipulationCallback(selector, callBack) {
|
||||
if (isElement$1(selector)) {
|
||||
callBack(selector);
|
||||
return;
|
||||
}
|
||||
for (const sel of SelectorEngine.find(selector, this._element)) {
|
||||
callBack(sel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap modal.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -4316,9 +4314,8 @@
|
||||
this._queueCallback(() => this._hideModal(), this._element, this._isAnimated());
|
||||
}
|
||||
dispose() {
|
||||
for (const htmlElement of [window, this._dialog]) {
|
||||
EventHandler.off(htmlElement, EVENT_KEY$4);
|
||||
}
|
||||
EventHandler.off(window, EVENT_KEY$4);
|
||||
EventHandler.off(this._dialog, EVENT_KEY$4);
|
||||
this._backdrop.dispose();
|
||||
this._focustrap.deactivate();
|
||||
super.dispose();
|
||||
@@ -4373,7 +4370,6 @@
|
||||
return;
|
||||
}
|
||||
if (this._config.keyboard) {
|
||||
event.preventDefault();
|
||||
this.hide();
|
||||
return;
|
||||
}
|
||||
@@ -4516,7 +4512,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): offcanvas.js
|
||||
* Bootstrap offcanvas.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -4674,11 +4670,11 @@
|
||||
if (event.key !== ESCAPE_KEY) {
|
||||
return;
|
||||
}
|
||||
if (!this._config.keyboard) {
|
||||
EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
|
||||
if (this._config.keyboard) {
|
||||
this.hide();
|
||||
return;
|
||||
}
|
||||
this.hide();
|
||||
EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -4746,13 +4742,12 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/sanitizer.js
|
||||
* Bootstrap util/sanitizer.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
|
||||
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
|
||||
|
||||
/**
|
||||
* A pattern that recognizes a commonly useful subset of URLs that are safe.
|
||||
@@ -4779,6 +4774,9 @@
|
||||
// Check if a regular expression validates the attribute.
|
||||
return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName));
|
||||
};
|
||||
|
||||
// js-docs-start allow-list
|
||||
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
|
||||
const DefaultAllowlist = {
|
||||
// Global attributes allowed on any supplied element below.
|
||||
'*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
|
||||
@@ -4812,6 +4810,8 @@
|
||||
u: [],
|
||||
ul: []
|
||||
};
|
||||
// js-docs-end allow-list
|
||||
|
||||
function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
|
||||
if (!unsafeHtml.length) {
|
||||
return unsafeHtml;
|
||||
@@ -4841,7 +4841,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/template-factory.js
|
||||
* Bootstrap util/template-factory.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -4976,7 +4976,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): tooltip.js
|
||||
* Bootstrap tooltip.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -5023,7 +5023,7 @@
|
||||
delay: 0,
|
||||
fallbackPlacements: ['top', 'right', 'bottom', 'left'],
|
||||
html: false,
|
||||
offset: [0, 0],
|
||||
offset: [0, 6],
|
||||
placement: 'top',
|
||||
popperConfig: null,
|
||||
sanitize: true,
|
||||
@@ -5136,7 +5136,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
// todo v6 remove this OR make it optional
|
||||
// TODO: v6 remove this or make it optional
|
||||
this._disposePopper();
|
||||
const tip = this._getTipElement();
|
||||
this._element.setAttribute('aria-describedby', tip.getAttribute('id'));
|
||||
@@ -5222,12 +5222,12 @@
|
||||
_createTipElement(content) {
|
||||
const tip = this._getTemplateFactory(content).toHtml();
|
||||
|
||||
// todo: remove this check on v6
|
||||
// TODO: remove this check in v6
|
||||
if (!tip) {
|
||||
return null;
|
||||
}
|
||||
tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2);
|
||||
// todo: on v6 the following can be achieved with CSS only
|
||||
// TODO: v6 the following can be achieved with CSS only
|
||||
tip.classList.add(`bs-${this.constructor.NAME}-auto`);
|
||||
const tipId = getUID(this.constructor.NAME).toString();
|
||||
tip.setAttribute('id', tipId);
|
||||
@@ -5487,7 +5487,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): popover.js
|
||||
* Bootstrap popover.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -5567,7 +5567,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): scrollspy.js
|
||||
* Bootstrap scrollspy.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -5826,7 +5826,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): tab.js
|
||||
* Bootstrap tab.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -5859,7 +5859,7 @@
|
||||
const SELECTOR_TAB_PANEL = '.list-group, .nav, [role="tablist"]';
|
||||
const SELECTOR_OUTER = '.nav-item, .list-group-item';
|
||||
const SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role="tab"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`;
|
||||
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]'; // todo:v6: could be only `tab`
|
||||
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]'; // TODO: could only be `tab` in v6
|
||||
const SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`;
|
||||
const SELECTOR_DATA_TOGGLE_ACTIVE = `.${CLASS_NAME_ACTIVE}[data-bs-toggle="tab"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="pill"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="list"]`;
|
||||
|
||||
@@ -5873,7 +5873,7 @@
|
||||
this._parent = this._element.closest(SELECTOR_TAB_PANEL);
|
||||
if (!this._parent) {
|
||||
return;
|
||||
// todo: should Throw exception on v6
|
||||
// TODO: should throw exception in v6
|
||||
// throw new TypeError(`${element.outerHTML} has not a valid parent ${SELECTOR_INNER_ELEM}`)
|
||||
}
|
||||
|
||||
@@ -6005,7 +6005,7 @@
|
||||
}
|
||||
this._setAttributeIfNotExists(target, 'role', 'tabpanel');
|
||||
if (child.id) {
|
||||
this._setAttributeIfNotExists(target, 'aria-labelledby', `#${child.id}`);
|
||||
this._setAttributeIfNotExists(target, 'aria-labelledby', `${child.id}`);
|
||||
}
|
||||
}
|
||||
_toggleDropDown(element, open) {
|
||||
@@ -6087,7 +6087,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): toast.js
|
||||
* Bootstrap toast.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -6270,7 +6270,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): index.umd.js
|
||||
* Bootstrap index.umd.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+196
-195
@@ -1,13 +1,61 @@
|
||||
/*!
|
||||
* Bootstrap v5.3.0-alpha1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Bootstrap v5.3.0-alpha3 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
import * as Popper from '@popperjs/core';
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/index.js
|
||||
* Bootstrap dom/data.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const elementMap = new Map();
|
||||
const Data = {
|
||||
set(element, key, instance) {
|
||||
if (!elementMap.has(element)) {
|
||||
elementMap.set(element, new Map());
|
||||
}
|
||||
const instanceMap = elementMap.get(element);
|
||||
|
||||
// make it clear we only want one instance per element
|
||||
// can be removed later when multiple key/instances are fine to be used
|
||||
if (!instanceMap.has(key) && instanceMap.size !== 0) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
|
||||
return;
|
||||
}
|
||||
instanceMap.set(key, instance);
|
||||
},
|
||||
get(element, key) {
|
||||
if (elementMap.has(element)) {
|
||||
return elementMap.get(element).get(key) || null;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
remove(element, key) {
|
||||
if (!elementMap.has(element)) {
|
||||
return;
|
||||
}
|
||||
const instanceMap = elementMap.get(element);
|
||||
instanceMap.delete(key);
|
||||
|
||||
// free up element references if there are no instances left for an element
|
||||
if (instanceMap.size === 0) {
|
||||
elementMap.delete(element);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -254,7 +302,7 @@ const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): dom/event-handler.js
|
||||
* Bootstrap dom/event-handler.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -324,7 +372,7 @@ function findHandler(events, callable, delegationSelector = null) {
|
||||
}
|
||||
function normalizeParameters(originalTypeEvent, handler, delegationFunction) {
|
||||
const isDelegated = typeof handler === 'string';
|
||||
// todo: tooltip passes `false` instead of selector, so we need to check
|
||||
// TODO: tooltip passes `false` instead of selector, so we need to check
|
||||
const callable = isDelegated ? delegationFunction : handler || delegationFunction;
|
||||
let typeEvent = getTypeEvent(originalTypeEvent);
|
||||
if (!nativeEvents.has(typeEvent)) {
|
||||
@@ -441,11 +489,10 @@ const EventHandler = {
|
||||
nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
|
||||
defaultPrevented = jQueryEvent.isDefaultPrevented();
|
||||
}
|
||||
let evt = new Event(event, {
|
||||
const evt = hydrateObj(new Event(event, {
|
||||
bubbles,
|
||||
cancelable: true
|
||||
});
|
||||
evt = hydrateObj(evt, args);
|
||||
}), args);
|
||||
if (defaultPrevented) {
|
||||
evt.preventDefault();
|
||||
}
|
||||
@@ -476,55 +523,7 @@ function hydrateObj(obj, meta = {}) {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): dom/data.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const elementMap = new Map();
|
||||
const Data = {
|
||||
set(element, key, instance) {
|
||||
if (!elementMap.has(element)) {
|
||||
elementMap.set(element, new Map());
|
||||
}
|
||||
const instanceMap = elementMap.get(element);
|
||||
|
||||
// make it clear we only want one instance per element
|
||||
// can be removed later when multiple key/instances are fine to be used
|
||||
if (!instanceMap.has(key) && instanceMap.size !== 0) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
|
||||
return;
|
||||
}
|
||||
instanceMap.set(key, instance);
|
||||
},
|
||||
get(element, key) {
|
||||
if (elementMap.has(element)) {
|
||||
return elementMap.get(element).get(key) || null;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
remove(element, key) {
|
||||
if (!elementMap.has(element)) {
|
||||
return;
|
||||
}
|
||||
const instanceMap = elementMap.get(element);
|
||||
instanceMap.delete(key);
|
||||
|
||||
// free up element references if there are no instances left for an element
|
||||
if (instanceMap.size === 0) {
|
||||
elementMap.delete(element);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): dom/manipulator.js
|
||||
* Bootstrap dom/manipulator.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -581,7 +580,7 @@ const Manipulator = {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/config.js
|
||||
* Bootstrap util/config.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -633,7 +632,7 @@ class Config {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): base-component.js
|
||||
* Bootstrap base-component.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -642,7 +641,7 @@ class Config {
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const VERSION = '5.3.0-alpha1';
|
||||
const VERSION = '5.3.0-alpha2';
|
||||
|
||||
/**
|
||||
* Class definition
|
||||
@@ -701,7 +700,7 @@ class BaseComponent extends Config {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): dom/selector-engine.js
|
||||
* Bootstrap dom/selector-engine.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -789,7 +788,7 @@ const SelectorEngine = {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/component-functions.js
|
||||
* Bootstrap util/component-functions.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -813,7 +812,7 @@ const enableDismissTrigger = (component, method = 'hide') => {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): alert.js
|
||||
* Bootstrap alert.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -887,7 +886,7 @@ defineJQueryPlugin(Alert);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): button.js
|
||||
* Bootstrap button.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -950,7 +949,7 @@ defineJQueryPlugin(Button);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/swipe.js
|
||||
* Bootstrap util/swipe.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1069,7 +1068,7 @@ class Swipe extends Config {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): carousel.js
|
||||
* Bootstrap carousel.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1329,7 +1328,7 @@ class Carousel extends BaseComponent {
|
||||
}
|
||||
if (!activeElement || !nextElement) {
|
||||
// Some weirdness is happening, so we bail
|
||||
// todo: change tests that use empty divs to avoid this check
|
||||
// TODO: change tests that use empty divs to avoid this check
|
||||
return;
|
||||
}
|
||||
const isCycling = Boolean(this._interval);
|
||||
@@ -1441,7 +1440,7 @@ defineJQueryPlugin(Carousel);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): collapse.js
|
||||
* Bootstrap collapse.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1674,7 +1673,7 @@ defineJQueryPlugin(Collapse);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): dropdown.js
|
||||
* Bootstrap dropdown.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1746,7 +1745,7 @@ class Dropdown extends BaseComponent {
|
||||
super(element, config);
|
||||
this._popper = null;
|
||||
this._parent = this._element.parentNode; // dropdown wrapper
|
||||
// todo: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
|
||||
// TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
|
||||
this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, this._parent);
|
||||
this._inNavbar = this._detectNavbar();
|
||||
}
|
||||
@@ -1920,7 +1919,7 @@ class Dropdown extends BaseComponent {
|
||||
|
||||
// Disable Popper if we have a static display or Dropdown is in Navbar
|
||||
if (this._inNavbar || this._config.display === 'static') {
|
||||
Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // todo:v6 remove
|
||||
Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // TODO: v6 remove
|
||||
defaultBsPopperConfig.modifiers = [{
|
||||
name: 'applyStyles',
|
||||
enabled: false
|
||||
@@ -2002,7 +2001,7 @@ class Dropdown extends BaseComponent {
|
||||
}
|
||||
event.preventDefault();
|
||||
|
||||
// todo: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
|
||||
// TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
|
||||
const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$3, event.delegateTarget.parentNode);
|
||||
const instance = Dropdown.getOrCreateInstance(getToggleButton);
|
||||
if (isUpOrDownEvent) {
|
||||
@@ -2041,104 +2040,7 @@ defineJQueryPlugin(Dropdown);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/scrollBar.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
|
||||
const SELECTOR_STICKY_CONTENT = '.sticky-top';
|
||||
const PROPERTY_PADDING = 'padding-right';
|
||||
const PROPERTY_MARGIN = 'margin-right';
|
||||
|
||||
/**
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
class ScrollBarHelper {
|
||||
constructor() {
|
||||
this._element = document.body;
|
||||
}
|
||||
|
||||
// Public
|
||||
getWidth() {
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
|
||||
const documentWidth = document.documentElement.clientWidth;
|
||||
return Math.abs(window.innerWidth - documentWidth);
|
||||
}
|
||||
hide() {
|
||||
const width = this.getWidth();
|
||||
this._disableOverFlow();
|
||||
// give padding to element to balance the hidden scrollbar width
|
||||
this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
|
||||
// trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
|
||||
this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
|
||||
this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);
|
||||
}
|
||||
reset() {
|
||||
this._resetElementAttributes(this._element, 'overflow');
|
||||
this._resetElementAttributes(this._element, PROPERTY_PADDING);
|
||||
this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);
|
||||
this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);
|
||||
}
|
||||
isOverflowing() {
|
||||
return this.getWidth() > 0;
|
||||
}
|
||||
|
||||
// Private
|
||||
_disableOverFlow() {
|
||||
this._saveInitialAttribute(this._element, 'overflow');
|
||||
this._element.style.overflow = 'hidden';
|
||||
}
|
||||
_setElementAttributes(selector, styleProperty, callback) {
|
||||
const scrollbarWidth = this.getWidth();
|
||||
const manipulationCallBack = element => {
|
||||
if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
|
||||
return;
|
||||
}
|
||||
this._saveInitialAttribute(element, styleProperty);
|
||||
const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);
|
||||
element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);
|
||||
};
|
||||
this._applyManipulationCallback(selector, manipulationCallBack);
|
||||
}
|
||||
_saveInitialAttribute(element, styleProperty) {
|
||||
const actualValue = element.style.getPropertyValue(styleProperty);
|
||||
if (actualValue) {
|
||||
Manipulator.setDataAttribute(element, styleProperty, actualValue);
|
||||
}
|
||||
}
|
||||
_resetElementAttributes(selector, styleProperty) {
|
||||
const manipulationCallBack = element => {
|
||||
const value = Manipulator.getDataAttribute(element, styleProperty);
|
||||
// We only want to remove the property if the value is `null`; the value can also be zero
|
||||
if (value === null) {
|
||||
element.style.removeProperty(styleProperty);
|
||||
return;
|
||||
}
|
||||
Manipulator.removeDataAttribute(element, styleProperty);
|
||||
element.style.setProperty(styleProperty, value);
|
||||
};
|
||||
this._applyManipulationCallback(selector, manipulationCallBack);
|
||||
}
|
||||
_applyManipulationCallback(selector, callBack) {
|
||||
if (isElement(selector)) {
|
||||
callBack(selector);
|
||||
return;
|
||||
}
|
||||
for (const sel of SelectorEngine.find(selector, this._element)) {
|
||||
callBack(sel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/backdrop.js
|
||||
* Bootstrap util/backdrop.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2262,7 +2164,7 @@ class Backdrop extends Config {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/focustrap.js
|
||||
* Bootstrap util/focustrap.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2360,7 +2262,104 @@ class FocusTrap extends Config {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): modal.js
|
||||
* Bootstrap util/scrollBar.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
|
||||
const SELECTOR_STICKY_CONTENT = '.sticky-top';
|
||||
const PROPERTY_PADDING = 'padding-right';
|
||||
const PROPERTY_MARGIN = 'margin-right';
|
||||
|
||||
/**
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
class ScrollBarHelper {
|
||||
constructor() {
|
||||
this._element = document.body;
|
||||
}
|
||||
|
||||
// Public
|
||||
getWidth() {
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
|
||||
const documentWidth = document.documentElement.clientWidth;
|
||||
return Math.abs(window.innerWidth - documentWidth);
|
||||
}
|
||||
hide() {
|
||||
const width = this.getWidth();
|
||||
this._disableOverFlow();
|
||||
// give padding to element to balance the hidden scrollbar width
|
||||
this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
|
||||
// trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
|
||||
this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
|
||||
this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);
|
||||
}
|
||||
reset() {
|
||||
this._resetElementAttributes(this._element, 'overflow');
|
||||
this._resetElementAttributes(this._element, PROPERTY_PADDING);
|
||||
this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);
|
||||
this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);
|
||||
}
|
||||
isOverflowing() {
|
||||
return this.getWidth() > 0;
|
||||
}
|
||||
|
||||
// Private
|
||||
_disableOverFlow() {
|
||||
this._saveInitialAttribute(this._element, 'overflow');
|
||||
this._element.style.overflow = 'hidden';
|
||||
}
|
||||
_setElementAttributes(selector, styleProperty, callback) {
|
||||
const scrollbarWidth = this.getWidth();
|
||||
const manipulationCallBack = element => {
|
||||
if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
|
||||
return;
|
||||
}
|
||||
this._saveInitialAttribute(element, styleProperty);
|
||||
const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);
|
||||
element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);
|
||||
};
|
||||
this._applyManipulationCallback(selector, manipulationCallBack);
|
||||
}
|
||||
_saveInitialAttribute(element, styleProperty) {
|
||||
const actualValue = element.style.getPropertyValue(styleProperty);
|
||||
if (actualValue) {
|
||||
Manipulator.setDataAttribute(element, styleProperty, actualValue);
|
||||
}
|
||||
}
|
||||
_resetElementAttributes(selector, styleProperty) {
|
||||
const manipulationCallBack = element => {
|
||||
const value = Manipulator.getDataAttribute(element, styleProperty);
|
||||
// We only want to remove the property if the value is `null`; the value can also be zero
|
||||
if (value === null) {
|
||||
element.style.removeProperty(styleProperty);
|
||||
return;
|
||||
}
|
||||
Manipulator.removeDataAttribute(element, styleProperty);
|
||||
element.style.setProperty(styleProperty, value);
|
||||
};
|
||||
this._applyManipulationCallback(selector, manipulationCallBack);
|
||||
}
|
||||
_applyManipulationCallback(selector, callBack) {
|
||||
if (isElement(selector)) {
|
||||
callBack(selector);
|
||||
return;
|
||||
}
|
||||
for (const sel of SelectorEngine.find(selector, this._element)) {
|
||||
callBack(sel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap modal.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2466,9 +2465,8 @@ class Modal extends BaseComponent {
|
||||
this._queueCallback(() => this._hideModal(), this._element, this._isAnimated());
|
||||
}
|
||||
dispose() {
|
||||
for (const htmlElement of [window, this._dialog]) {
|
||||
EventHandler.off(htmlElement, EVENT_KEY$4);
|
||||
}
|
||||
EventHandler.off(window, EVENT_KEY$4);
|
||||
EventHandler.off(this._dialog, EVENT_KEY$4);
|
||||
this._backdrop.dispose();
|
||||
this._focustrap.deactivate();
|
||||
super.dispose();
|
||||
@@ -2523,7 +2521,6 @@ class Modal extends BaseComponent {
|
||||
return;
|
||||
}
|
||||
if (this._config.keyboard) {
|
||||
event.preventDefault();
|
||||
this.hide();
|
||||
return;
|
||||
}
|
||||
@@ -2666,7 +2663,7 @@ defineJQueryPlugin(Modal);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): offcanvas.js
|
||||
* Bootstrap offcanvas.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2824,11 +2821,11 @@ class Offcanvas extends BaseComponent {
|
||||
if (event.key !== ESCAPE_KEY) {
|
||||
return;
|
||||
}
|
||||
if (!this._config.keyboard) {
|
||||
EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
|
||||
if (this._config.keyboard) {
|
||||
this.hide();
|
||||
return;
|
||||
}
|
||||
this.hide();
|
||||
EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2896,13 +2893,12 @@ defineJQueryPlugin(Offcanvas);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/sanitizer.js
|
||||
* Bootstrap util/sanitizer.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
|
||||
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
|
||||
|
||||
/**
|
||||
* A pattern that recognizes a commonly useful subset of URLs that are safe.
|
||||
@@ -2929,6 +2925,9 @@ const allowedAttribute = (attribute, allowedAttributeList) => {
|
||||
// Check if a regular expression validates the attribute.
|
||||
return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName));
|
||||
};
|
||||
|
||||
// js-docs-start allow-list
|
||||
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
|
||||
const DefaultAllowlist = {
|
||||
// Global attributes allowed on any supplied element below.
|
||||
'*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
|
||||
@@ -2962,6 +2961,8 @@ const DefaultAllowlist = {
|
||||
u: [],
|
||||
ul: []
|
||||
};
|
||||
// js-docs-end allow-list
|
||||
|
||||
function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
|
||||
if (!unsafeHtml.length) {
|
||||
return unsafeHtml;
|
||||
@@ -2991,7 +2992,7 @@ function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/template-factory.js
|
||||
* Bootstrap util/template-factory.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -3126,7 +3127,7 @@ class TemplateFactory extends Config {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): tooltip.js
|
||||
* Bootstrap tooltip.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -3173,7 +3174,7 @@ const Default$3 = {
|
||||
delay: 0,
|
||||
fallbackPlacements: ['top', 'right', 'bottom', 'left'],
|
||||
html: false,
|
||||
offset: [0, 0],
|
||||
offset: [0, 6],
|
||||
placement: 'top',
|
||||
popperConfig: null,
|
||||
sanitize: true,
|
||||
@@ -3286,7 +3287,7 @@ class Tooltip extends BaseComponent {
|
||||
return;
|
||||
}
|
||||
|
||||
// todo v6 remove this OR make it optional
|
||||
// TODO: v6 remove this or make it optional
|
||||
this._disposePopper();
|
||||
const tip = this._getTipElement();
|
||||
this._element.setAttribute('aria-describedby', tip.getAttribute('id'));
|
||||
@@ -3372,12 +3373,12 @@ class Tooltip extends BaseComponent {
|
||||
_createTipElement(content) {
|
||||
const tip = this._getTemplateFactory(content).toHtml();
|
||||
|
||||
// todo: remove this check on v6
|
||||
// TODO: remove this check in v6
|
||||
if (!tip) {
|
||||
return null;
|
||||
}
|
||||
tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2);
|
||||
// todo: on v6 the following can be achieved with CSS only
|
||||
// TODO: v6 the following can be achieved with CSS only
|
||||
tip.classList.add(`bs-${this.constructor.NAME}-auto`);
|
||||
const tipId = getUID(this.constructor.NAME).toString();
|
||||
tip.setAttribute('id', tipId);
|
||||
@@ -3637,7 +3638,7 @@ defineJQueryPlugin(Tooltip);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): popover.js
|
||||
* Bootstrap popover.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -3717,7 +3718,7 @@ defineJQueryPlugin(Popover);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): scrollspy.js
|
||||
* Bootstrap scrollspy.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -3976,7 +3977,7 @@ defineJQueryPlugin(ScrollSpy);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): tab.js
|
||||
* Bootstrap tab.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -4009,7 +4010,7 @@ const NOT_SELECTOR_DROPDOWN_TOGGLE = ':not(.dropdown-toggle)';
|
||||
const SELECTOR_TAB_PANEL = '.list-group, .nav, [role="tablist"]';
|
||||
const SELECTOR_OUTER = '.nav-item, .list-group-item';
|
||||
const SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role="tab"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`;
|
||||
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]'; // todo:v6: could be only `tab`
|
||||
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]'; // TODO: could only be `tab` in v6
|
||||
const SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`;
|
||||
const SELECTOR_DATA_TOGGLE_ACTIVE = `.${CLASS_NAME_ACTIVE}[data-bs-toggle="tab"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="pill"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="list"]`;
|
||||
|
||||
@@ -4023,7 +4024,7 @@ class Tab extends BaseComponent {
|
||||
this._parent = this._element.closest(SELECTOR_TAB_PANEL);
|
||||
if (!this._parent) {
|
||||
return;
|
||||
// todo: should Throw exception on v6
|
||||
// TODO: should throw exception in v6
|
||||
// throw new TypeError(`${element.outerHTML} has not a valid parent ${SELECTOR_INNER_ELEM}`)
|
||||
}
|
||||
|
||||
@@ -4155,7 +4156,7 @@ class Tab extends BaseComponent {
|
||||
}
|
||||
this._setAttributeIfNotExists(target, 'role', 'tabpanel');
|
||||
if (child.id) {
|
||||
this._setAttributeIfNotExists(target, 'aria-labelledby', `#${child.id}`);
|
||||
this._setAttributeIfNotExists(target, 'aria-labelledby', `${child.id}`);
|
||||
}
|
||||
}
|
||||
_toggleDropDown(element, open) {
|
||||
@@ -4237,7 +4238,7 @@ defineJQueryPlugin(Tab);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): toast.js
|
||||
* Bootstrap toast.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+3
-3
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+197
-196
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* Bootstrap v5.3.0-alpha1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Bootstrap v5.3.0-alpha3 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
@@ -30,7 +30,55 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/index.js
|
||||
* Bootstrap dom/data.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const elementMap = new Map();
|
||||
const Data = {
|
||||
set(element, key, instance) {
|
||||
if (!elementMap.has(element)) {
|
||||
elementMap.set(element, new Map());
|
||||
}
|
||||
const instanceMap = elementMap.get(element);
|
||||
|
||||
// make it clear we only want one instance per element
|
||||
// can be removed later when multiple key/instances are fine to be used
|
||||
if (!instanceMap.has(key) && instanceMap.size !== 0) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
|
||||
return;
|
||||
}
|
||||
instanceMap.set(key, instance);
|
||||
},
|
||||
get(element, key) {
|
||||
if (elementMap.has(element)) {
|
||||
return elementMap.get(element).get(key) || null;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
remove(element, key) {
|
||||
if (!elementMap.has(element)) {
|
||||
return;
|
||||
}
|
||||
const instanceMap = elementMap.get(element);
|
||||
instanceMap.delete(key);
|
||||
|
||||
// free up element references if there are no instances left for an element
|
||||
if (instanceMap.size === 0) {
|
||||
elementMap.delete(element);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -277,7 +325,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): dom/event-handler.js
|
||||
* Bootstrap dom/event-handler.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -347,7 +395,7 @@
|
||||
}
|
||||
function normalizeParameters(originalTypeEvent, handler, delegationFunction) {
|
||||
const isDelegated = typeof handler === 'string';
|
||||
// todo: tooltip passes `false` instead of selector, so we need to check
|
||||
// TODO: tooltip passes `false` instead of selector, so we need to check
|
||||
const callable = isDelegated ? delegationFunction : handler || delegationFunction;
|
||||
let typeEvent = getTypeEvent(originalTypeEvent);
|
||||
if (!nativeEvents.has(typeEvent)) {
|
||||
@@ -464,11 +512,10 @@
|
||||
nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
|
||||
defaultPrevented = jQueryEvent.isDefaultPrevented();
|
||||
}
|
||||
let evt = new Event(event, {
|
||||
const evt = hydrateObj(new Event(event, {
|
||||
bubbles,
|
||||
cancelable: true
|
||||
});
|
||||
evt = hydrateObj(evt, args);
|
||||
}), args);
|
||||
if (defaultPrevented) {
|
||||
evt.preventDefault();
|
||||
}
|
||||
@@ -499,55 +546,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): dom/data.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const elementMap = new Map();
|
||||
const Data = {
|
||||
set(element, key, instance) {
|
||||
if (!elementMap.has(element)) {
|
||||
elementMap.set(element, new Map());
|
||||
}
|
||||
const instanceMap = elementMap.get(element);
|
||||
|
||||
// make it clear we only want one instance per element
|
||||
// can be removed later when multiple key/instances are fine to be used
|
||||
if (!instanceMap.has(key) && instanceMap.size !== 0) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
|
||||
return;
|
||||
}
|
||||
instanceMap.set(key, instance);
|
||||
},
|
||||
get(element, key) {
|
||||
if (elementMap.has(element)) {
|
||||
return elementMap.get(element).get(key) || null;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
remove(element, key) {
|
||||
if (!elementMap.has(element)) {
|
||||
return;
|
||||
}
|
||||
const instanceMap = elementMap.get(element);
|
||||
instanceMap.delete(key);
|
||||
|
||||
// free up element references if there are no instances left for an element
|
||||
if (instanceMap.size === 0) {
|
||||
elementMap.delete(element);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): dom/manipulator.js
|
||||
* Bootstrap dom/manipulator.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -604,7 +603,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/config.js
|
||||
* Bootstrap util/config.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -656,7 +655,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): base-component.js
|
||||
* Bootstrap base-component.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -665,7 +664,7 @@
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const VERSION = '5.3.0-alpha1';
|
||||
const VERSION = '5.3.0-alpha2';
|
||||
|
||||
/**
|
||||
* Class definition
|
||||
@@ -724,7 +723,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): dom/selector-engine.js
|
||||
* Bootstrap dom/selector-engine.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -812,7 +811,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/component-functions.js
|
||||
* Bootstrap util/component-functions.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -836,7 +835,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): alert.js
|
||||
* Bootstrap alert.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -910,7 +909,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): button.js
|
||||
* Bootstrap button.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -973,7 +972,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/swipe.js
|
||||
* Bootstrap util/swipe.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1092,7 +1091,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): carousel.js
|
||||
* Bootstrap carousel.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1352,7 +1351,7 @@
|
||||
}
|
||||
if (!activeElement || !nextElement) {
|
||||
// Some weirdness is happening, so we bail
|
||||
// todo: change tests that use empty divs to avoid this check
|
||||
// TODO: change tests that use empty divs to avoid this check
|
||||
return;
|
||||
}
|
||||
const isCycling = Boolean(this._interval);
|
||||
@@ -1464,7 +1463,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): collapse.js
|
||||
* Bootstrap collapse.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1697,7 +1696,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): dropdown.js
|
||||
* Bootstrap dropdown.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1769,7 +1768,7 @@
|
||||
super(element, config);
|
||||
this._popper = null;
|
||||
this._parent = this._element.parentNode; // dropdown wrapper
|
||||
// todo: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
|
||||
// TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
|
||||
this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, this._parent);
|
||||
this._inNavbar = this._detectNavbar();
|
||||
}
|
||||
@@ -1943,7 +1942,7 @@
|
||||
|
||||
// Disable Popper if we have a static display or Dropdown is in Navbar
|
||||
if (this._inNavbar || this._config.display === 'static') {
|
||||
Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // todo:v6 remove
|
||||
Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // TODO: v6 remove
|
||||
defaultBsPopperConfig.modifiers = [{
|
||||
name: 'applyStyles',
|
||||
enabled: false
|
||||
@@ -2025,7 +2024,7 @@
|
||||
}
|
||||
event.preventDefault();
|
||||
|
||||
// todo: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
|
||||
// TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
|
||||
const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$3, event.delegateTarget.parentNode);
|
||||
const instance = Dropdown.getOrCreateInstance(getToggleButton);
|
||||
if (isUpOrDownEvent) {
|
||||
@@ -2064,104 +2063,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/scrollBar.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
|
||||
const SELECTOR_STICKY_CONTENT = '.sticky-top';
|
||||
const PROPERTY_PADDING = 'padding-right';
|
||||
const PROPERTY_MARGIN = 'margin-right';
|
||||
|
||||
/**
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
class ScrollBarHelper {
|
||||
constructor() {
|
||||
this._element = document.body;
|
||||
}
|
||||
|
||||
// Public
|
||||
getWidth() {
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
|
||||
const documentWidth = document.documentElement.clientWidth;
|
||||
return Math.abs(window.innerWidth - documentWidth);
|
||||
}
|
||||
hide() {
|
||||
const width = this.getWidth();
|
||||
this._disableOverFlow();
|
||||
// give padding to element to balance the hidden scrollbar width
|
||||
this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
|
||||
// trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
|
||||
this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
|
||||
this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);
|
||||
}
|
||||
reset() {
|
||||
this._resetElementAttributes(this._element, 'overflow');
|
||||
this._resetElementAttributes(this._element, PROPERTY_PADDING);
|
||||
this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);
|
||||
this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);
|
||||
}
|
||||
isOverflowing() {
|
||||
return this.getWidth() > 0;
|
||||
}
|
||||
|
||||
// Private
|
||||
_disableOverFlow() {
|
||||
this._saveInitialAttribute(this._element, 'overflow');
|
||||
this._element.style.overflow = 'hidden';
|
||||
}
|
||||
_setElementAttributes(selector, styleProperty, callback) {
|
||||
const scrollbarWidth = this.getWidth();
|
||||
const manipulationCallBack = element => {
|
||||
if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
|
||||
return;
|
||||
}
|
||||
this._saveInitialAttribute(element, styleProperty);
|
||||
const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);
|
||||
element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);
|
||||
};
|
||||
this._applyManipulationCallback(selector, manipulationCallBack);
|
||||
}
|
||||
_saveInitialAttribute(element, styleProperty) {
|
||||
const actualValue = element.style.getPropertyValue(styleProperty);
|
||||
if (actualValue) {
|
||||
Manipulator.setDataAttribute(element, styleProperty, actualValue);
|
||||
}
|
||||
}
|
||||
_resetElementAttributes(selector, styleProperty) {
|
||||
const manipulationCallBack = element => {
|
||||
const value = Manipulator.getDataAttribute(element, styleProperty);
|
||||
// We only want to remove the property if the value is `null`; the value can also be zero
|
||||
if (value === null) {
|
||||
element.style.removeProperty(styleProperty);
|
||||
return;
|
||||
}
|
||||
Manipulator.removeDataAttribute(element, styleProperty);
|
||||
element.style.setProperty(styleProperty, value);
|
||||
};
|
||||
this._applyManipulationCallback(selector, manipulationCallBack);
|
||||
}
|
||||
_applyManipulationCallback(selector, callBack) {
|
||||
if (isElement(selector)) {
|
||||
callBack(selector);
|
||||
return;
|
||||
}
|
||||
for (const sel of SelectorEngine.find(selector, this._element)) {
|
||||
callBack(sel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/backdrop.js
|
||||
* Bootstrap util/backdrop.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2285,7 +2187,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/focustrap.js
|
||||
* Bootstrap util/focustrap.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2383,7 +2285,104 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): modal.js
|
||||
* Bootstrap util/scrollBar.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
|
||||
const SELECTOR_STICKY_CONTENT = '.sticky-top';
|
||||
const PROPERTY_PADDING = 'padding-right';
|
||||
const PROPERTY_MARGIN = 'margin-right';
|
||||
|
||||
/**
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
class ScrollBarHelper {
|
||||
constructor() {
|
||||
this._element = document.body;
|
||||
}
|
||||
|
||||
// Public
|
||||
getWidth() {
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
|
||||
const documentWidth = document.documentElement.clientWidth;
|
||||
return Math.abs(window.innerWidth - documentWidth);
|
||||
}
|
||||
hide() {
|
||||
const width = this.getWidth();
|
||||
this._disableOverFlow();
|
||||
// give padding to element to balance the hidden scrollbar width
|
||||
this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
|
||||
// trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
|
||||
this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
|
||||
this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);
|
||||
}
|
||||
reset() {
|
||||
this._resetElementAttributes(this._element, 'overflow');
|
||||
this._resetElementAttributes(this._element, PROPERTY_PADDING);
|
||||
this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);
|
||||
this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);
|
||||
}
|
||||
isOverflowing() {
|
||||
return this.getWidth() > 0;
|
||||
}
|
||||
|
||||
// Private
|
||||
_disableOverFlow() {
|
||||
this._saveInitialAttribute(this._element, 'overflow');
|
||||
this._element.style.overflow = 'hidden';
|
||||
}
|
||||
_setElementAttributes(selector, styleProperty, callback) {
|
||||
const scrollbarWidth = this.getWidth();
|
||||
const manipulationCallBack = element => {
|
||||
if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
|
||||
return;
|
||||
}
|
||||
this._saveInitialAttribute(element, styleProperty);
|
||||
const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);
|
||||
element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);
|
||||
};
|
||||
this._applyManipulationCallback(selector, manipulationCallBack);
|
||||
}
|
||||
_saveInitialAttribute(element, styleProperty) {
|
||||
const actualValue = element.style.getPropertyValue(styleProperty);
|
||||
if (actualValue) {
|
||||
Manipulator.setDataAttribute(element, styleProperty, actualValue);
|
||||
}
|
||||
}
|
||||
_resetElementAttributes(selector, styleProperty) {
|
||||
const manipulationCallBack = element => {
|
||||
const value = Manipulator.getDataAttribute(element, styleProperty);
|
||||
// We only want to remove the property if the value is `null`; the value can also be zero
|
||||
if (value === null) {
|
||||
element.style.removeProperty(styleProperty);
|
||||
return;
|
||||
}
|
||||
Manipulator.removeDataAttribute(element, styleProperty);
|
||||
element.style.setProperty(styleProperty, value);
|
||||
};
|
||||
this._applyManipulationCallback(selector, manipulationCallBack);
|
||||
}
|
||||
_applyManipulationCallback(selector, callBack) {
|
||||
if (isElement(selector)) {
|
||||
callBack(selector);
|
||||
return;
|
||||
}
|
||||
for (const sel of SelectorEngine.find(selector, this._element)) {
|
||||
callBack(sel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap modal.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2489,9 +2488,8 @@
|
||||
this._queueCallback(() => this._hideModal(), this._element, this._isAnimated());
|
||||
}
|
||||
dispose() {
|
||||
for (const htmlElement of [window, this._dialog]) {
|
||||
EventHandler.off(htmlElement, EVENT_KEY$4);
|
||||
}
|
||||
EventHandler.off(window, EVENT_KEY$4);
|
||||
EventHandler.off(this._dialog, EVENT_KEY$4);
|
||||
this._backdrop.dispose();
|
||||
this._focustrap.deactivate();
|
||||
super.dispose();
|
||||
@@ -2546,7 +2544,6 @@
|
||||
return;
|
||||
}
|
||||
if (this._config.keyboard) {
|
||||
event.preventDefault();
|
||||
this.hide();
|
||||
return;
|
||||
}
|
||||
@@ -2689,7 +2686,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): offcanvas.js
|
||||
* Bootstrap offcanvas.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2847,11 +2844,11 @@
|
||||
if (event.key !== ESCAPE_KEY) {
|
||||
return;
|
||||
}
|
||||
if (!this._config.keyboard) {
|
||||
EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
|
||||
if (this._config.keyboard) {
|
||||
this.hide();
|
||||
return;
|
||||
}
|
||||
this.hide();
|
||||
EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2919,13 +2916,12 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/sanitizer.js
|
||||
* Bootstrap util/sanitizer.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
|
||||
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
|
||||
|
||||
/**
|
||||
* A pattern that recognizes a commonly useful subset of URLs that are safe.
|
||||
@@ -2952,6 +2948,9 @@
|
||||
// Check if a regular expression validates the attribute.
|
||||
return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName));
|
||||
};
|
||||
|
||||
// js-docs-start allow-list
|
||||
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
|
||||
const DefaultAllowlist = {
|
||||
// Global attributes allowed on any supplied element below.
|
||||
'*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
|
||||
@@ -2985,6 +2984,8 @@
|
||||
u: [],
|
||||
ul: []
|
||||
};
|
||||
// js-docs-end allow-list
|
||||
|
||||
function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
|
||||
if (!unsafeHtml.length) {
|
||||
return unsafeHtml;
|
||||
@@ -3014,7 +3015,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): util/template-factory.js
|
||||
* Bootstrap util/template-factory.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -3149,7 +3150,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): tooltip.js
|
||||
* Bootstrap tooltip.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -3196,7 +3197,7 @@
|
||||
delay: 0,
|
||||
fallbackPlacements: ['top', 'right', 'bottom', 'left'],
|
||||
html: false,
|
||||
offset: [0, 0],
|
||||
offset: [0, 6],
|
||||
placement: 'top',
|
||||
popperConfig: null,
|
||||
sanitize: true,
|
||||
@@ -3309,7 +3310,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
// todo v6 remove this OR make it optional
|
||||
// TODO: v6 remove this or make it optional
|
||||
this._disposePopper();
|
||||
const tip = this._getTipElement();
|
||||
this._element.setAttribute('aria-describedby', tip.getAttribute('id'));
|
||||
@@ -3395,12 +3396,12 @@
|
||||
_createTipElement(content) {
|
||||
const tip = this._getTemplateFactory(content).toHtml();
|
||||
|
||||
// todo: remove this check on v6
|
||||
// TODO: remove this check in v6
|
||||
if (!tip) {
|
||||
return null;
|
||||
}
|
||||
tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2);
|
||||
// todo: on v6 the following can be achieved with CSS only
|
||||
// TODO: v6 the following can be achieved with CSS only
|
||||
tip.classList.add(`bs-${this.constructor.NAME}-auto`);
|
||||
const tipId = getUID(this.constructor.NAME).toString();
|
||||
tip.setAttribute('id', tipId);
|
||||
@@ -3660,7 +3661,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): popover.js
|
||||
* Bootstrap popover.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -3740,7 +3741,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): scrollspy.js
|
||||
* Bootstrap scrollspy.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -3999,7 +4000,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): tab.js
|
||||
* Bootstrap tab.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -4032,7 +4033,7 @@
|
||||
const SELECTOR_TAB_PANEL = '.list-group, .nav, [role="tablist"]';
|
||||
const SELECTOR_OUTER = '.nav-item, .list-group-item';
|
||||
const SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role="tab"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`;
|
||||
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]'; // todo:v6: could be only `tab`
|
||||
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]'; // TODO: could only be `tab` in v6
|
||||
const SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`;
|
||||
const SELECTOR_DATA_TOGGLE_ACTIVE = `.${CLASS_NAME_ACTIVE}[data-bs-toggle="tab"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="pill"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="list"]`;
|
||||
|
||||
@@ -4046,7 +4047,7 @@
|
||||
this._parent = this._element.closest(SELECTOR_TAB_PANEL);
|
||||
if (!this._parent) {
|
||||
return;
|
||||
// todo: should Throw exception on v6
|
||||
// TODO: should throw exception in v6
|
||||
// throw new TypeError(`${element.outerHTML} has not a valid parent ${SELECTOR_INNER_ELEM}`)
|
||||
}
|
||||
|
||||
@@ -4178,7 +4179,7 @@
|
||||
}
|
||||
this._setAttributeIfNotExists(target, 'role', 'tabpanel');
|
||||
if (child.id) {
|
||||
this._setAttributeIfNotExists(target, 'aria-labelledby', `#${child.id}`);
|
||||
this._setAttributeIfNotExists(target, 'aria-labelledby', `${child.id}`);
|
||||
}
|
||||
}
|
||||
_toggleDropDown(element, open) {
|
||||
@@ -4260,7 +4261,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): toast.js
|
||||
* Bootstrap toast.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -4443,7 +4444,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.3.0-alpha1): index.umd.js
|
||||
* Bootstrap index.umd.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+3
-3
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+8
-3
@@ -3,6 +3,7 @@ export interface CountUpOptions {
|
||||
decimalPlaces?: number;
|
||||
duration?: number;
|
||||
useGrouping?: boolean;
|
||||
useIndianSeparators?: boolean;
|
||||
useEasing?: boolean;
|
||||
smartEasingThreshold?: number;
|
||||
smartEasingAmount?: number;
|
||||
@@ -16,22 +17,26 @@ export interface CountUpOptions {
|
||||
enableScrollSpy?: boolean;
|
||||
scrollSpyDelay?: number;
|
||||
scrollSpyOnce?: boolean;
|
||||
onCompleteCallback?: () => any;
|
||||
plugin?: CountUpPlugin;
|
||||
}
|
||||
export declare interface CountUpPlugin {
|
||||
render(elem: HTMLElement, formatted: string): void;
|
||||
}
|
||||
export declare class CountUp {
|
||||
private endVal;
|
||||
options?: CountUpOptions;
|
||||
version: string;
|
||||
private defaults;
|
||||
private el;
|
||||
private rAF;
|
||||
private startTime;
|
||||
private remaining;
|
||||
private finalEndVal;
|
||||
private useEasing;
|
||||
private countDown;
|
||||
el: HTMLElement | HTMLInputElement;
|
||||
formattingFn: (num: number) => string;
|
||||
easingFn?: (t: number, b: number, c: number, d: number) => number;
|
||||
callback: (args?: any) => any;
|
||||
error: string;
|
||||
startVal: number;
|
||||
duration: number;
|
||||
@@ -44,7 +49,7 @@ export declare class CountUp {
|
||||
* Smart easing works by breaking the animation into 2 parts, the second part being the
|
||||
* smartEasingAmount and first part being the total amount minus the smartEasingAmount. It works
|
||||
* by disabling easing for the first part and enabling it on the second part. It is used if
|
||||
* usingEasing is true and the total animation amount exceeds the smartEasingThreshold.
|
||||
* useEasing is true and the total animation amount exceeds the smartEasingThreshold.
|
||||
*/
|
||||
private determineDirectionAndSmartEasing;
|
||||
start(callback?: (args?: any) => any): void;
|
||||
|
||||
+26
-8
@@ -15,13 +15,14 @@ var CountUp = /** @class */ (function () {
|
||||
var _this = this;
|
||||
this.endVal = endVal;
|
||||
this.options = options;
|
||||
this.version = '2.3.2';
|
||||
this.version = '2.6.2';
|
||||
this.defaults = {
|
||||
startVal: 0,
|
||||
decimalPlaces: 0,
|
||||
duration: 2,
|
||||
useEasing: true,
|
||||
useGrouping: true,
|
||||
useIndianSeparators: false,
|
||||
smartEasingThreshold: 999,
|
||||
smartEasingAmount: 333,
|
||||
separator: ',',
|
||||
@@ -73,8 +74,8 @@ var CountUp = /** @class */ (function () {
|
||||
_this.update(_this.finalEndVal);
|
||||
}
|
||||
else {
|
||||
if (_this.callback) {
|
||||
_this.callback();
|
||||
if (_this.options.onCompleteCallback) {
|
||||
_this.options.onCompleteCallback();
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -89,10 +90,16 @@ var CountUp = /** @class */ (function () {
|
||||
x2 = x.length > 1 ? _this.options.decimal + x[1] : '';
|
||||
if (_this.options.useGrouping) {
|
||||
x3 = '';
|
||||
var factor = 3, j = 0;
|
||||
for (var i = 0, len = x1.length; i < len; ++i) {
|
||||
if (i !== 0 && (i % 3) === 0) {
|
||||
if (_this.options.useIndianSeparators && i === 4) {
|
||||
factor = 2;
|
||||
j = 1;
|
||||
}
|
||||
if (i !== 0 && (j % factor) === 0) {
|
||||
x3 = _this.options.separator + x3;
|
||||
}
|
||||
j++;
|
||||
x3 = x1[len - i - 1] + x3;
|
||||
}
|
||||
x1 = x3;
|
||||
@@ -151,6 +158,7 @@ var CountUp = /** @class */ (function () {
|
||||
return;
|
||||
var bottomOfScroll = window.innerHeight + window.scrollY;
|
||||
var rect = self.el.getBoundingClientRect();
|
||||
var topOfEl = rect.top + window.pageYOffset;
|
||||
var bottomOfEl = rect.top + rect.height + window.pageYOffset;
|
||||
if (bottomOfEl < bottomOfScroll && bottomOfEl > window.scrollY && self.paused) {
|
||||
// in view
|
||||
@@ -159,8 +167,9 @@ var CountUp = /** @class */ (function () {
|
||||
if (self.options.scrollSpyOnce)
|
||||
self.once = true;
|
||||
}
|
||||
else if (window.scrollY > bottomOfEl && !self.paused) {
|
||||
// scrolled past
|
||||
else if ((window.scrollY > bottomOfEl || topOfEl > bottomOfScroll) &&
|
||||
!self.paused) {
|
||||
// out of view
|
||||
self.reset();
|
||||
}
|
||||
};
|
||||
@@ -168,7 +177,7 @@ var CountUp = /** @class */ (function () {
|
||||
* Smart easing works by breaking the animation into 2 parts, the second part being the
|
||||
* smartEasingAmount and first part being the total amount minus the smartEasingAmount. It works
|
||||
* by disabling easing for the first part and enabling it on the second part. It is used if
|
||||
* usingEasing is true and the total animation amount exceeds the smartEasingThreshold.
|
||||
* useEasing is true and the total animation amount exceeds the smartEasingThreshold.
|
||||
*/
|
||||
CountUp.prototype.determineDirectionAndSmartEasing = function () {
|
||||
var end = (this.finalEndVal) ? this.finalEndVal : this.endVal;
|
||||
@@ -197,7 +206,9 @@ var CountUp = /** @class */ (function () {
|
||||
if (this.error) {
|
||||
return;
|
||||
}
|
||||
this.callback = callback;
|
||||
if (callback) {
|
||||
this.options.onCompleteCallback = callback;
|
||||
}
|
||||
if (this.duration > 0) {
|
||||
this.determineDirectionAndSmartEasing();
|
||||
this.paused = false;
|
||||
@@ -247,7 +258,14 @@ var CountUp = /** @class */ (function () {
|
||||
this.rAF = requestAnimationFrame(this.count);
|
||||
};
|
||||
CountUp.prototype.printValue = function (val) {
|
||||
var _a;
|
||||
if (!this.el)
|
||||
return;
|
||||
var result = this.formattingFn(val);
|
||||
if ((_a = this.options.plugin) === null || _a === void 0 ? void 0 : _a.render) {
|
||||
this.options.plugin.render(this.el, result);
|
||||
return;
|
||||
}
|
||||
if (this.el.tagName === 'INPUT') {
|
||||
var input = this.el;
|
||||
input.value = result;
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-293
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,26 @@
|
||||
// make sure requestAnimationFrame and cancelAnimationFrame are defined
|
||||
// polyfill for browsers without native support
|
||||
// by Opera engineer Erik Möller
|
||||
(function () {
|
||||
var lastTime = 0;
|
||||
var vendors = ['webkit', 'moz', 'ms', 'o'];
|
||||
for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
|
||||
window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
|
||||
window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] ||
|
||||
window[vendors[x] + 'CancelRequestAnimationFrame'];
|
||||
}
|
||||
if (!window.requestAnimationFrame) {
|
||||
window.requestAnimationFrame = function (callback) {
|
||||
var currTime = new Date().getTime();
|
||||
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
|
||||
var id = window.setTimeout(function () { return callback(currTime + timeToCall); }, timeToCall);
|
||||
lastTime = currTime + timeToCall;
|
||||
return id;
|
||||
};
|
||||
}
|
||||
if (!window.cancelAnimationFrame) {
|
||||
window.cancelAnimationFrame = function (id) {
|
||||
clearTimeout(id);
|
||||
};
|
||||
}
|
||||
})();
|
||||
Vendored
+48
-42
@@ -1,54 +1,60 @@
|
||||
# Fullscreen Lightbox Basic
|
||||
# Vanilla JavaScript Fullscreen Lightbox Basic
|
||||
|
||||
## Description
|
||||
Modern and easy plugin for displaying images and videos in clean overlaying box.
|
||||
Display single source or create beautiful gallery with powerful lightbox.
|
||||
A vanilla JavaScript plug-in without production dependencies for displaying images, videos, or, through custom sources, anything you want in a clean overlying box.
|
||||
The project's website: https://fslightbox.com.
|
||||
|
||||
Website: https://fslightbox.com
|
||||
|
||||
### No jQuery and other dependencies.
|
||||
|
||||
## Basic usage
|
||||
|
||||
### Installation
|
||||
|
||||
```
|
||||
npm install fslightbox
|
||||
```
|
||||
|
||||
### Example
|
||||
|
||||
In your application .js file:
|
||||
```javascript
|
||||
require('fslightbox');
|
||||
```
|
||||
|
||||
In HTML file
|
||||
## Installation
|
||||
### Through an archive downloaded from the website.
|
||||
Just before the end of the <body> tag:
|
||||
```html
|
||||
<a data-fslightbox="gallery" href="https://i.imgur.com/fsyrScY.jpg">
|
||||
Open first slide (image)
|
||||
</a>
|
||||
<a data-fslightbox="gallery" href="https://www.youtube.com/watch?v=xshEZzpS4CQ">
|
||||
Open second slide (YouTube)
|
||||
</a>
|
||||
<a data-fslightbox="gallery" href="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4">
|
||||
Open third slide (HTML video)
|
||||
</a>
|
||||
<a data-fslightbox="gallery" href="#vimeo">
|
||||
Open fourth slide (custom source)
|
||||
</a>
|
||||
<iframe id="vimeo" src="https://player.vimeo.com/video/22439234" width="1920px" height="1080px"
|
||||
frameBorder="0" allow="autoplay; fullscreen" allowFullScreen />
|
||||
|
||||
<script src="fslightbox.js"></script>
|
||||
```
|
||||
### Or, through a package manager.
|
||||
```
|
||||
npm install fslightbox
|
||||
```
|
||||
And import it in your project's JavaScript file, for example through the Node.js "require" function:
|
||||
```
|
||||
require("fslightbox")
|
||||
```
|
||||
|
||||
|
||||
## Demo
|
||||
Available at: https://fslightbox.com/javascript
|
||||
## Basic usage
|
||||
```html
|
||||
<a data-fslightbox="gallery" href="https://i.imgur.com/fsyrScY.jpg">
|
||||
Open the first slide (an image)
|
||||
</a>
|
||||
<a
|
||||
data-fslightbox="gallery"
|
||||
href="https://www.youtube.com/watch?v=xshEZzpS4CQ"
|
||||
>
|
||||
Open the second slide (a YouTube video)
|
||||
</a>
|
||||
<a
|
||||
data-fslightbox="gallery"
|
||||
href="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
|
||||
>
|
||||
Open the third slide (an HTML video)
|
||||
</a>
|
||||
<a data-fslightbox="gallery" href="#vimeo">
|
||||
Open the fourth slide (a Vimeo video—a custom source)
|
||||
</a>
|
||||
<iframe
|
||||
id="vimeo"
|
||||
src="https://player.vimeo.com/video/22439234"
|
||||
width="1920px"
|
||||
height="1080px"
|
||||
frameBorder="0"
|
||||
allow="autoplay; fullscreen"
|
||||
allowFullScreen
|
||||
></iframe>
|
||||
```
|
||||
|
||||
## Documentation
|
||||
Available at: https://fslightbox.com/javascript/documentation
|
||||
Available at: https://fslightbox.com/javascript/documentation.
|
||||
|
||||
## Demo
|
||||
Available at: https://fslightbox.com/javascript.
|
||||
|
||||
## Browser Compatibility
|
||||
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
-1
@@ -1 +0,0 @@
|
||||
import "babel-polyfill";
|
||||
+10
-44
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "fslightbox",
|
||||
"version": "3.3.1",
|
||||
"description": "Modern and easy plugin for displaying images and videos in clean overlaying box. Display single source or create beautiful gallery with powerful lightbox.",
|
||||
"version": "3.4.1",
|
||||
"description": "An easy to use vanilla JavaScript plug-in without production dependencies for displaying images, videos, or, through custom sources, anything you want in a clean overlying box.",
|
||||
"author": "Bantha Apps Piotr Zdziarski",
|
||||
"license": "MIT",
|
||||
"homepage": "https://fslightbox.com",
|
||||
@@ -10,61 +10,27 @@
|
||||
},
|
||||
"main": "index.js",
|
||||
"keywords": [
|
||||
"lightbox",
|
||||
"slide gallery",
|
||||
"image lightbox",
|
||||
"slider",
|
||||
"carousel"
|
||||
"fslightbox",
|
||||
"vanilla javascript fslightbox",
|
||||
"vanilla js fslightbox",
|
||||
"vanilla javascript lightbox",
|
||||
"vanilla js lightbox",
|
||||
"lightbox"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/banthagroup/fslightbox"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jest",
|
||||
"production": "webpack --mode production --config webpack.prod.config.js --display-modules && gulp",
|
||||
"watch": "webpack-dev-server --mode development --host 0.0.0.0",
|
||||
"cypress": "concurrently --kill-others \"webpack-dev-server --config ./webpack.cypress.config.js --mode development\" \"node ./node_modules/.bin/cypress open\""
|
||||
},
|
||||
"jest": {
|
||||
"setupFiles": [
|
||||
"./jest-setup.js"
|
||||
],
|
||||
"verbose": true,
|
||||
"testPathIgnorePatterns": [
|
||||
"/node_modules/",
|
||||
"/demo/",
|
||||
"/dist/",
|
||||
"/tests/cypress/"
|
||||
],
|
||||
"collectCoverage": false
|
||||
"w": "webpack-dev-server --host 0.0.0.0",
|
||||
"p": "webpack --config webpack.prod.config.js && cp index.js fslightbox.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.4.4",
|
||||
"@babel/preset-env": "^7.4.4",
|
||||
"@babel/register": "^7.4.4",
|
||||
"babel-jest": "^24.7.1",
|
||||
"babel-loader": "^8.0.5",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"browser-sync": "^2.26.7",
|
||||
"concurrently": "^6.2.0",
|
||||
"copy-webpack-plugin": "^5.0.3",
|
||||
"core-js": "^3.0.1",
|
||||
"css-loader": "^2.1.0",
|
||||
"cypress": "^7.5.0",
|
||||
"dotenv": "^10.0.0",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-clean-css": "^4.2.0",
|
||||
"gulp-rename": "^1.4.0",
|
||||
"gulp-sass": "^4.0.2",
|
||||
"html-loader": "^0.5.5",
|
||||
"html-webpack-plugin": "^3.2.0",
|
||||
"jest": "^24.7.1",
|
||||
"node-sass": "^4.12.0",
|
||||
"prop-types": "^15.6.2",
|
||||
"sass-loader": "^7.1.0",
|
||||
"style-loader": "^0.23.1",
|
||||
"uglifyjs-webpack-plugin": "^2.1.1",
|
||||
"webpack": "^4.30.0",
|
||||
"webpack-cli": "^3.3.1",
|
||||
"webpack-dev-server": "^3.3.1"
|
||||
|
||||
+522
-862
File diff suppressed because it is too large
Load Diff
+1
-1
File diff suppressed because one or more lines are too long
@@ -134,6 +134,8 @@ export interface API {
|
||||
set: (input: number | string | (number | string)[], fireSetEvent?: boolean, exactInput?: boolean) => void;
|
||||
setHandle: (handleNumber: number, value: number | string, fireSetEvent?: boolean, exactInput?: boolean) => void;
|
||||
reset: (fireSetEvent?: boolean) => void;
|
||||
disable: (handleNumber?: number) => void;
|
||||
enable: (handleNumber?: number) => void;
|
||||
options: Options;
|
||||
updateOptions: (optionsToUpdate: UpdatableOptions, fireSetEvent: boolean) => void;
|
||||
target: HTMLElement;
|
||||
|
||||
+28
@@ -959,6 +959,7 @@
|
||||
else if (handleNumber === options.handles - 1) {
|
||||
addClass(handle, options.cssClasses.handleUpper);
|
||||
}
|
||||
origin.handle = handle;
|
||||
return origin;
|
||||
}
|
||||
// Insert nodes for connect elements
|
||||
@@ -1022,6 +1023,31 @@
|
||||
var handleOrigin = scope_Handles[handleNumber];
|
||||
return handleOrigin.hasAttribute("disabled");
|
||||
}
|
||||
function disable(handleNumber) {
|
||||
if (handleNumber !== null && handleNumber !== undefined) {
|
||||
scope_Handles[handleNumber].setAttribute("disabled", "");
|
||||
scope_Handles[handleNumber].handle.removeAttribute("tabindex");
|
||||
}
|
||||
else {
|
||||
scope_Target.setAttribute("disabled", "");
|
||||
scope_Handles.forEach(function (handle) {
|
||||
handle.handle.removeAttribute("tabindex");
|
||||
});
|
||||
}
|
||||
}
|
||||
function enable(handleNumber) {
|
||||
if (handleNumber !== null && handleNumber !== undefined) {
|
||||
scope_Handles[handleNumber].removeAttribute("disabled");
|
||||
scope_Handles[handleNumber].handle.setAttribute("tabindex", "0");
|
||||
}
|
||||
else {
|
||||
scope_Target.removeAttribute("disabled");
|
||||
scope_Handles.forEach(function (handle) {
|
||||
handle.removeAttribute("disabled");
|
||||
handle.handle.setAttribute("tabindex", "0");
|
||||
});
|
||||
}
|
||||
}
|
||||
function removeTooltips() {
|
||||
if (scope_Tooltips) {
|
||||
removeEvent("update" + INTERNAL_EVENT_NS.tooltips);
|
||||
@@ -2199,6 +2225,8 @@
|
||||
set: valueSet,
|
||||
setHandle: valueSetHandle,
|
||||
reset: valueReset,
|
||||
disable: disable,
|
||||
enable: enable,
|
||||
// Exposed for unit testing, don't use this in your application.
|
||||
__moveHandles: function (upward, proposal, handleNumbers) {
|
||||
moveHandles(upward, proposal, scope_Locations, handleNumbers);
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+28
@@ -954,6 +954,7 @@ function scope(target, options, originalOptions) {
|
||||
else if (handleNumber === options.handles - 1) {
|
||||
addClass(handle, options.cssClasses.handleUpper);
|
||||
}
|
||||
origin.handle = handle;
|
||||
return origin;
|
||||
}
|
||||
// Insert nodes for connect elements
|
||||
@@ -1017,6 +1018,31 @@ function scope(target, options, originalOptions) {
|
||||
var handleOrigin = scope_Handles[handleNumber];
|
||||
return handleOrigin.hasAttribute("disabled");
|
||||
}
|
||||
function disable(handleNumber) {
|
||||
if (handleNumber !== null && handleNumber !== undefined) {
|
||||
scope_Handles[handleNumber].setAttribute("disabled", "");
|
||||
scope_Handles[handleNumber].handle.removeAttribute("tabindex");
|
||||
}
|
||||
else {
|
||||
scope_Target.setAttribute("disabled", "");
|
||||
scope_Handles.forEach(function (handle) {
|
||||
handle.handle.removeAttribute("tabindex");
|
||||
});
|
||||
}
|
||||
}
|
||||
function enable(handleNumber) {
|
||||
if (handleNumber !== null && handleNumber !== undefined) {
|
||||
scope_Handles[handleNumber].removeAttribute("disabled");
|
||||
scope_Handles[handleNumber].handle.setAttribute("tabindex", "0");
|
||||
}
|
||||
else {
|
||||
scope_Target.removeAttribute("disabled");
|
||||
scope_Handles.forEach(function (handle) {
|
||||
handle.removeAttribute("disabled");
|
||||
handle.handle.setAttribute("tabindex", "0");
|
||||
});
|
||||
}
|
||||
}
|
||||
function removeTooltips() {
|
||||
if (scope_Tooltips) {
|
||||
removeEvent("update" + INTERNAL_EVENT_NS.tooltips);
|
||||
@@ -2194,6 +2220,8 @@ function scope(target, options, originalOptions) {
|
||||
set: valueSet,
|
||||
setHandle: valueSetHandle,
|
||||
reset: valueReset,
|
||||
disable: disable,
|
||||
enable: enable,
|
||||
// Exposed for unit testing, don't use this in your application.
|
||||
__moveHandles: function (upward, proposal, handleNumbers) {
|
||||
moveHandles(upward, proposal, scope_Locations, handleNumbers);
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+289
-229
File diff suppressed because it is too large
Load Diff
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+289
-229
File diff suppressed because it is too large
Load Diff
+289
-229
File diff suppressed because it is too large
Load Diff
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+289
-229
File diff suppressed because it is too large
Load Diff
Vendored
+112
@@ -6,6 +6,117 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## Unreleased
|
||||
|
||||
## 6.4.2 - 2023-04-26
|
||||
|
||||
### Fixed
|
||||
- The editor would display a notification error when it fails to retirieve a blob image uri. #TINY-9604
|
||||
- Menu buttons would have the Tabstopping behaviour in toolbar. #TINY-9723
|
||||
- The `urlinput` dialog component would not open the typeahead dropdown when the input value was reset to an empty string. #TINY-9717
|
||||
- Redial would in some situations cause select elements not to have an initial value selected when they should have. #TINY-9679
|
||||
- Fixed the mouse pointer style from a text cursor to a default arrow pointer when hovering over the tree dialog component items. #TINY-9692
|
||||
- Enabled variant of togglable `tox-button` and `tox-button--secondary` now supports `hover`/`active`/`focus`/`disabled` states. #TINY-9713
|
||||
- Setting an invalid unit in the `fontsizeinput` would change it do the default value instead of reverting it back to the previous valid value. #TINY-9754
|
||||
- Selection was not correctly scrolled horizontally into view when using the `selection.scrollIntoView` API. #TINY-9747
|
||||
- Context toolbars displayed the incorrect status for the `advlist` plugin buttons. #TINY-9680
|
||||
- The image would not be inserted when using the `quickimage` button on Chrome. #TINY-9769
|
||||
|
||||
## 6.4.1 - 2023-03-29
|
||||
|
||||
### Fixed
|
||||
- The `fontsizeinput` increase and decrease size buttons now work on TinyMCE mobile. #TINY-9725
|
||||
- The TinyMCE editor toolbar is now accessible for all screen widths; it no longer collapses into an inaccessible vertical line when the screen is scrolled horizontally. #TINY-9646
|
||||
- Reverted the changes made, in TinyMCE 6.4.0, to UI button colors in focus, active, and enabled states. #TINY-9176
|
||||
|
||||
## 6.4.0 - 2023-03-15
|
||||
|
||||
### Added
|
||||
- New `tree` component that can be used in dialog body panel. #TINY-9532
|
||||
- `renderUI` property in the `Theme` type can now return a `Promise<RenderResult>` instead of `RenderResult`. #TINY-9556
|
||||
- New `isEditable` API to `editor.selection` that returns true or false if the current selection is editable. #TINY-9462
|
||||
- New `isEditable` API to `editor.dom` that returns true or false if the specified node is editable. #TINY-9462
|
||||
- New `setText` and `setIcon` methods added to menu button and toolbar button API. #TINY-9268
|
||||
- New `highlight_on_focus` option which enables highlighting the content area on focus. #TINY-9277
|
||||
- New `fontsizeinput` toolbar item which allows the user to set the size via input and also increase and decrease it with `+` and `-` buttons. #TINY-9429
|
||||
- Added `skipFocus` option to the `ToggleToolbarDrawer` command to preserve focus. #TINY-9337
|
||||
- New `font_size_input_default_unit` option allows entry of numbers without a unit in `fontsizeinput`. They are then parsed as the set unit. If `font_size_input_default_unit` is not set the default is `pt`. #TINY-9585
|
||||
- New `group` and `togglebutton` in view. #TINY-9523
|
||||
- New `togglebutton` in dialog footer buttons. #TINY-9523
|
||||
- Added `toggleFullscreen` to dialog API. #TINY-9528
|
||||
- New `text-size-increase` and `text-size-decrease` icons. #TINY-9530
|
||||
- New `xss_sanitization` option to allow disabling of XSS sanitization. #TINY-9600
|
||||
- Added the top right close button of modal dialogs to the tabbing order. The 'x' button in these dialogs can now be accessed using keyboard navigation. #TINY-9520
|
||||
- New `ui_mode` option for editor in scrollable containers support. #TINY-9414
|
||||
- The sidebar element now has the accessibility role `region` when visible and the accessibility role `presentation` when hidden. #TINY-9517
|
||||
- The `tox-custom-editor` class now has a border highlight when it is selected. #TINY-9673
|
||||
- An element could be dropped onto the decendants of an element with a `contenteditable="false"` attribute. #TINY-9364
|
||||
- Checkmark did not show in menu color swatches. #TINY-9395
|
||||
- Add support for navigating inside the tree component using arrow keys and shift key. #TINY-9614
|
||||
|
||||
### Improved
|
||||
- Direct invalid child text nodes of list elements are now wrapped in list item elements. #TINY-4818
|
||||
- Templates are now be parsed before preview and insertion to make preview consistent with inserted template content and prevent XSS. #TINY-9244
|
||||
- Pressing backspace on an empty line now preserves formatting on the previous empty line. #TINY-9454
|
||||
- Pressing enter inside the `inputfontsize` input field now moves focus back into the editor content. #TINY-9598
|
||||
- Drag and drop events for elements with a `contenteditable="false"` attribute now includes target element details. #TINY-9599
|
||||
- Updated focus, active, and enabled colors of UI buttons for improved contrast against the UI color. #TINY-9176
|
||||
|
||||
### Changed
|
||||
- The `link` plugins context menu items no longer appears for links that include elements with a `contenteditable="false"` attribute. #TINY-9491
|
||||
- The formatting of elements with a `contenteditable="false"` attribute are no longer cloned to new cells when new table rows are created. #TINY-9449
|
||||
- Changed the color of `@dialog-table-border-color`, and added right padding to the first cell of dialog table. #TINY-9380
|
||||
|
||||
### Fixed
|
||||
- Sometimes the editor would finish initializing before the silver theme would have finished loading. #TINY-9556
|
||||
- The `searchreplace` modal closed incorrectly when clicking outside of the alert that pops up when no match is found. #TINY-9443
|
||||
- The text color or background color picker toolbar buttons did not update when the text color or background color was changed using the equivalent commands in the Format menu. #TINY-9439
|
||||
- The `onSetup` api function would not run when defining custom group toolbar button. #TINY-9496
|
||||
- The foreground and background menu icons would not properly update to display the last used color. #TINY-9497
|
||||
- Added new `setIconFill` function to `NestedMenuItemInstanceApi`. #TINY-9497
|
||||
- Pasting links to text would sometimes not generate the correct undo stack in Safari. #TINY-9489
|
||||
- Toolbar split buttons in `advlist` plugin now show the correct state when the cursor is in a checklist. #TINY-5167
|
||||
- Dragging transparent elements into transparent block elements could produce invalid nesting of transparents. #TINY-9231
|
||||
- The `editor.insertContent` API would insert contents inside elements with a `contenteditable="false"` attribute if the selection was inside the element. #TINY-9462
|
||||
- Closing a dialog would scroll down the document in Safari. #TINY-9148
|
||||
- Inline headers would not work in some situations when the editor was moved too far right horizontally. #TINY-8977
|
||||
- Quick toolbars were incorrectly rendered during the dragging of elements with a `contenteditable="false"` attribute. #TINY-9305
|
||||
- Selection of images, horizontal rules, tables or elements with a `contenteditable="false"` attribute was possible if they were within an element with a `contenteditable="false"` attribute. #TINY-9473
|
||||
- Ranged deletion of formatted text using selection or a keyboard shortcut would sometimes cause Blink- and Webkit-based browsers to insert interpreted tags upon typing. This could result in inconsistent tags. #TINY-9302
|
||||
- Visual characters were rendered inside elements with a `contenteditable="false"` attribute. #TINY-9474
|
||||
- Lists with an element with a `contenteditable="false"` attribute as their root were incorrectly editable using list API commands, toolbar buttons and menu items. #TINY-9458
|
||||
- Color picker dialog would not update the preview color if the hex input value was prefixed with the `#` character. #TINY-9457
|
||||
- Table cell selection was possible even if the element being selected was within an element with a `contenteditable="false"` attribute. #TINY-9459
|
||||
- Table commands were modifying tables that were within an element with a `contenteditable="false"` attribute. #TINY-9459
|
||||
- Fake carets were rendered for elements with a `contenteditable="false"` attribute and for tables within an element with a `contenteditable="false"` attribute. #TINY-9459
|
||||
- Textareas with scrollbars in dialogs would not render rounded corners correctly on some browsers. #TINY-9331
|
||||
- It was possible to open links inside the editor if the editor root was an element with a `contenteditable="false"` attribute. #TINY-9470
|
||||
- Inline boundary was rendered for boundary elements that had a `contenteditable="false"` attribute. #TINY-9471
|
||||
- Clicking on a disabled split button will no longer call the `onAction` callback. #TINY-9504
|
||||
- The *Edit Link* dialog incorrectly retrieved the URL value when opened immediately after the link insertion. #TINY-7993
|
||||
- The `ForwardDelete` and `Delete` editor commands were deleting content within elements with a `contenteditable="false"` attribute. #TINY-9477
|
||||
- The Backspace and Forward Delete keys were deleting content within elements with a `contenteditable="false"` attribute. #TINY-9477
|
||||
- Inserting newlines inside an editable element that was inside an element with a `contenteditable="false"` attribute root would sometimes try to split the editable element. #TINY-9461
|
||||
- Creating a list in a table cell when the caret is in front of an anchor element would not properly include the anchor in the list. #TINY-6853
|
||||
- Dragging and dropping elements with a `contenteditable="false"` attribute on table borders would remove the element on drop. #TINY-9021
|
||||
- Elements with a `contenteditable="false"` attribute would be removed when dragged and dropped within a root element with a `contenteditable="false"` attribute. #TINY-9558
|
||||
- Formatting could be applied or removed to list items with a `contenteditable="false"` attribute that were inside an element with a `contenteditable="false"` attribute. #TINY-9563
|
||||
- Annotation were not removed if the annotation was deleted immediately after being created. #TINY-9399
|
||||
- Inserting a link for a selection from quickbars did not preserve formatting. #TINY-9593
|
||||
- Inline dialog position was not correct when the editor was not inline and was contained in a `fixed` or `absolute` positioned element. #TINY-9554
|
||||
- Sticky toolbars did not fade transition when undocking in classic iframe mode. #TINY-9408
|
||||
- Inserting elements that were not valid within the closest editing host would incorrectly split the editing host. #TINY-9595
|
||||
- The `color_cols` option was not respected in the `forecolor` or `backcolor` color swatches. #TINY-9560
|
||||
- Drag and dropping the last element with a `contenteditable="false"` attribute out of its parent block would not properly pad the parent block element. #TINY-9606
|
||||
- Applying heading formats from `text_patterns` produced an invisible space before a word. #TINY-9603
|
||||
- Opening color swatches caused the browser tab to crash when `color_cols` or other column option was set to 0. #TINY-9649
|
||||
- Opening a menu button in the footer of a dialog after a redial threw an error. #TINY-9686
|
||||
- After closing a view, the `more...` toolbar button disappeared if the editor had `toolbar_mode: 'sliding'` and the toolbar was opened. #TINY-9419
|
||||
- Inline dialogs would open partially off screen when the toolbar had a small width. #TINY-9588
|
||||
|
||||
## 6.3.2 - 2023-02-22
|
||||
|
||||
### Fixed
|
||||
- Removed a workaround for ensuring stylesheets are loaded in an outdated version of webkit. #TINY-9433
|
||||
|
||||
## 6.3.1 - 2022-12-06
|
||||
|
||||
### Fixed
|
||||
@@ -54,6 +165,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- A newline could not be inserted when the selection was restored from a bookmark after an inline element with a `contenteditable="false"` attribute. #TINY-9194
|
||||
- The global `tinymce.dom.styleSheetLoader` was not affected by the `content_css_cors` option. #TINY-6037
|
||||
- The caret was moved to the previous line when a text pattern executed a `mceInsertContent` command on Enter key when running on Firefox. #TINY-9193
|
||||
- The `autoresize` plugin used to cause infinite resize when `content_css` is set to `document`. #TINY-8872
|
||||
|
||||
## 6.2.0 - 2022-09-08
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tinymce/tinymce",
|
||||
"version": "6.3.1",
|
||||
"version": "6.4.2",
|
||||
"description": "Web based JavaScript HTML WYSIWYG editor control.",
|
||||
"license": [
|
||||
"MIT-only"
|
||||
|
||||
@@ -96,6 +96,7 @@ tinymce.IconManager.add('default', {
|
||||
'list-num-upper-roman': '<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 17v-1.2h1.3V17H15Zm0 10v-1.2h1.3V27H15Zm0 10v-1.2h1.3V37H15Z"/><path fill-rule="nonzero" d="M12 20h1.5v7H12zM12 30h1.5v7H12zM9 20h1.5v7H9zM9 30h1.5v7H9zM6 30h1.5v7H6zM12 10h1.5v7H12z"/></g></svg>',
|
||||
'lock': '<svg width="24" height="24"><path d="M16.3 11c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H8V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h.3ZM10 8v3h4V8a1 1 0 0 0-.3-.7A1 1 0 0 0 13 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7Z" fill-rule="evenodd"/></svg>',
|
||||
'ltr': '<svg width="24" height="24"><path d="M11 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 7.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L11 5ZM4.4 16.2 6.2 15l-1.8-1.2a1 1 0 0 1 1.2-1.6l3 2a1 1 0 0 1 0 1.6l-3 2a1 1 0 1 1-1.2-1.6Z" fill-rule="evenodd"/></svg>',
|
||||
'minus': '<svg width="24" height="24"><path d="M19 11a1 1 0 0 1 .1 2H5a1 1 0 0 1-.1-2H19Z"/></svg>',
|
||||
'more-drawer': '<svg width="24" height="24"><path d="M6 10a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Zm12 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Zm-6 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Z" fill-rule="nonzero"/></svg>',
|
||||
'new-document': '<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h10a2 2 0 0 0 2-2V7.6L14.4 3ZM17 19H7V5h6v4h4v10Z" fill-rule="nonzero"/></svg>',
|
||||
'new-tab': '<svg width="24" height="24"><path d="m15 13 2-2v8H5V7h8l-2 2H7v8h8v-4Zm4-8v5.5l-2-2-5.6 5.5H10v-1.4L15.5 7l-2-2H19Z" fill-rule="evenodd"/></svg>',
|
||||
@@ -161,9 +162,12 @@ tinymce.IconManager.add('default', {
|
||||
'table-split-cells': '<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM8 15.5H5V18h3v-2.5Zm11-5h-9V18h9v-7.5Zm-2.5 1 1 1-2 2 2 2-1 1-2-2-2 2-1-1 2-2-2-2 1-1 2 2 2-2Zm-8.5-1H5v3h3v-3ZM19 6h-4v2.5h4V6ZM8 6H5v2.5h3V6Zm5 0h-3v2.5h3V6Z"/></svg>',
|
||||
'table-top-header': '<svg width="24" height="24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 11H5v3h6v-3Zm8 0h-6v3h6v-3Zm0-5h-6v3h6v-3ZM5 13h6v-3H5v3Z"/></svg>',
|
||||
'table': '<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM5 14v4h6v-4H5Zm14 0h-6v4h6v-4Zm0-6h-6v4h6V8ZM5 12h6V8H5v4Z"/></svg>',
|
||||
'template-add': '<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M9 12v4H5a2 2 0 0 0-2 2v3h9.3a6 6 0 0 1-.3-2H5v-1h7a6 6 0 0 1 .8-2H11v-5l-.8-.6a3 3 0 1 1 3.6 0l-.8.6v4.7a6 6 0 0 1 2-1.9V12a5 5 0 1 0-6 0Z"/><path d="M18 15c.5 0 1 .4 1 .9V18h2a1 1 0 0 1 .1 2H19v2a1 1 0 0 1-2 .1V20h-2a1 1 0 0 1-.1-2H17v-2c0-.6.4-1 1-1Z"/></svg>',
|
||||
'template': '<svg width="24" height="24"><path d="M19 19v-1H5v1h14ZM9 16v-4a5 5 0 1 1 6 0v4h4a2 2 0 0 1 2 2v3H3v-3c0-1.1.9-2 2-2h4Zm4 0v-5l.8-.6a3 3 0 1 0-3.6 0l.8.6v5h2Z" fill-rule="nonzero"/></svg>',
|
||||
'temporary-placeholder': '<svg width="24" height="24"><g fill-rule="evenodd"><path d="M9 7.6V6h2.5V4.5a.5.5 0 1 1 1 0V6H15v1.6a8 8 0 1 1-6 0Zm-2.6 5.3a.5.5 0 0 0 .3.6c.3 0 .6 0 .6-.3l.1-.2a5 5 0 0 1 3.3-2.8c.3-.1.4-.4.4-.6-.1-.3-.4-.5-.6-.4a6 6 0 0 0-4.1 3.7Z"/><circle cx="14" cy="4" r="1"/><circle cx="12" cy="2" r="1"/><circle cx="10" cy="4" r="1"/></g></svg>',
|
||||
'text-color': '<svg width="24" height="24"><g fill-rule="evenodd"><path id="tox-icon-text-color__color" d="M3 18h18v3H3z"/><path d="M8.7 16h-.8a.5.5 0 0 1-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 0 1-.5.6h-.8a.5.5 0 0 1-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4Zm2.6-7.6-.6 2a.5.5 0 0 0 .5.6h1.6a.5.5 0 0 0 .5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4Z"/></g></svg>',
|
||||
'text-size-decrease': '<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M14 5a1 1 0 1 1 0 2h-4v11a1 1 0 1 1-2 0V7H4a1 1 0 0 1 0-2h10ZM14 12a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-6Z"/></svg>',
|
||||
'text-size-increase': '<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M14 5a1 1 0 1 1 0 2h-4v11a1 1 0 1 1-2 0V7H4a1 1 0 0 1 0-2h10ZM17 9a1 1 0 0 0-1 1v2h-2a1 1 0 1 0 0 2h2v2a1 1 0 1 0 2 0v-2h2a1 1 0 1 0 0-2h-2v-2c0-.6-.4-1-1-1Z"/></svg>',
|
||||
'toc': '<svg width="24" height="24"><path d="M5 5c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 1 1 0-2Zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 1 1 0-2Zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2Zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2Zm0-4c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 1 1 0-2Zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2Zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',
|
||||
'translate': '<svg width="24" height="24"><path d="m12.7 14.3-.3.7-.4.7-2.2-2.2-3.1 3c-.3.4-.8.4-1 0a.7.7 0 0 1 0-1l3.1-3A12.4 12.4 0 0 1 6.7 9H8a10.1 10.1 0 0 0 1.7 2.4c.5-.5 1-1.1 1.4-1.8l.9-2H4.7a.7.7 0 1 1 0-1.5h4.4v-.7c0-.4.3-.8.7-.8.4 0 .7.4.7.8v.7H15c.4 0 .8.3.8.7 0 .4-.4.8-.8.8h-1.4a12.3 12.3 0 0 1-1 2.4 13.5 13.5 0 0 1-1.7 2.3l1.9 1.8Zm4.3-3 2.7 7.3a.5.5 0 0 1-.4.7 1 1 0 0 1-1-.7l-.6-1.5h-3.4l-.6 1.5a1 1 0 0 1-1 .7.5.5 0 0 1-.4-.7l2.7-7.4a1 1 0 0 1 2 0Zm-2.2 4.4h2.4L16 12.5l-1.2 3.2Z" fill-rule="evenodd"/></svg>',
|
||||
'typography': '<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M17 5a1 1 0 1 1 0 2h-4v11a1 1 0 1 1-2 0V7H7a1 1 0 0 1 0-2h10Z"/><path d="m17.5 14 .8-1.7 1.7-.8-1.7-.8-.8-1.7-.8 1.7-1.7.8 1.7.8.8 1.7ZM7 14l1 2 2 1-2 1-1 2-1-2-2-1 2-1 1-2Z"/></svg>',
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+79
-23
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -383,7 +383,39 @@
|
||||
return true;
|
||||
};
|
||||
|
||||
typeof window !== 'undefined' ? window : Function('return this;')();
|
||||
const Global = typeof window !== 'undefined' ? window : Function('return this;')();
|
||||
|
||||
const path = (parts, scope) => {
|
||||
let o = scope !== undefined && scope !== null ? scope : Global;
|
||||
for (let i = 0; i < parts.length && o !== undefined && o !== null; ++i) {
|
||||
o = o[parts[i]];
|
||||
}
|
||||
return o;
|
||||
};
|
||||
const resolve$2 = (p, scope) => {
|
||||
const parts = p.split('.');
|
||||
return path(parts, scope);
|
||||
};
|
||||
|
||||
const unsafe = (name, scope) => {
|
||||
return resolve$2(name, scope);
|
||||
};
|
||||
const getOrDie = (name, scope) => {
|
||||
const actual = unsafe(name, scope);
|
||||
if (actual === undefined || actual === null) {
|
||||
throw new Error(name + ' not available on this browser');
|
||||
}
|
||||
return actual;
|
||||
};
|
||||
|
||||
const getPrototypeOf = Object.getPrototypeOf;
|
||||
const sandHTMLElement = scope => {
|
||||
return getOrDie('HTMLElement', scope);
|
||||
};
|
||||
const isPrototypeOf = x => {
|
||||
const scope = resolve$2('ownerDocument.defaultView', x);
|
||||
return isObject(x) && (sandHTMLElement(scope).prototype.isPrototypeOf(x) || /^HTML\w*Element$/.test(getPrototypeOf(x).constructor.name));
|
||||
};
|
||||
|
||||
const COMMENT = 8;
|
||||
const DOCUMENT = 9;
|
||||
@@ -398,6 +430,7 @@
|
||||
const type = element => element.dom.nodeType;
|
||||
const isType = t => element => type(element) === t;
|
||||
const isComment = element => type(element) === COMMENT || name(element) === '#comment';
|
||||
const isHTMLElement = element => isElement(element) && isPrototypeOf(element.dom);
|
||||
const isElement = isType(ELEMENT);
|
||||
const isText = isType(TEXT);
|
||||
const isDocument = isType(DOCUMENT);
|
||||
@@ -2173,13 +2206,14 @@
|
||||
|
||||
const getEnd = element => name(element) === 'img' ? 1 : getOption(element).fold(() => children$2(element).length, v => v.length);
|
||||
const isTextNodeWithCursorPosition = el => getOption(el).filter(text => text.trim().length !== 0 || text.indexOf(nbsp) > -1).isSome();
|
||||
const isContentEditableFalse = elem => isHTMLElement(elem) && get$b(elem, 'contenteditable') === 'false';
|
||||
const elementsWithCursorPosition = [
|
||||
'img',
|
||||
'br'
|
||||
];
|
||||
const isCursorPosition = elem => {
|
||||
const hasCursorPosition = isTextNodeWithCursorPosition(elem);
|
||||
return hasCursorPosition || contains$2(elementsWithCursorPosition, name(elem));
|
||||
return hasCursorPosition || contains$2(elementsWithCursorPosition, name(elem)) || isContentEditableFalse(elem);
|
||||
};
|
||||
|
||||
const first = element => descendant$1(element, isCursorPosition);
|
||||
@@ -2245,7 +2279,6 @@
|
||||
});
|
||||
return foldr(parents, (last, parent) => {
|
||||
const clonedFormat = shallow(parent);
|
||||
remove$7(clonedFormat, 'contenteditable');
|
||||
append$1(last, clonedFormat);
|
||||
return clonedFormat;
|
||||
}, newCell);
|
||||
@@ -2323,6 +2356,16 @@
|
||||
};
|
||||
const fromDom = nodes => map$1(nodes, SugarElement.fromDom);
|
||||
|
||||
const closest = target => closest$1(target, '[contenteditable]');
|
||||
const isEditable$1 = (element, assumeEditable = false) => {
|
||||
if (inBody(element)) {
|
||||
return element.dom.isContentEditable;
|
||||
} else {
|
||||
return closest(element).fold(constant(assumeEditable), editable => getRaw(editable) === 'true');
|
||||
}
|
||||
};
|
||||
const getRaw = element => element.dom.contentEditable;
|
||||
|
||||
const getBody = editor => SugarElement.fromDom(editor.getBody());
|
||||
const getIsRoot = editor => element => eq$1(element, getBody(editor));
|
||||
const removeDataStyle = table => {
|
||||
@@ -2341,6 +2384,7 @@
|
||||
};
|
||||
const isPercentage$1 = value => /^(\d+(\.\d+)?)%$/.test(value);
|
||||
const isPixel = value => /^(\d+(\.\d+)?)px$/.test(value);
|
||||
const isInEditableContext$1 = cell => closest$2(cell, isTag('table')).exists(isEditable$1);
|
||||
|
||||
const inSelection = (bounds, detail) => {
|
||||
const leftEdge = detail.column;
|
||||
@@ -3152,16 +3196,6 @@
|
||||
fallback
|
||||
};
|
||||
|
||||
const closest = target => closest$1(target, '[contenteditable]');
|
||||
const isEditable$1 = (element, assumeEditable = false) => {
|
||||
if (inBody(element)) {
|
||||
return element.dom.isContentEditable;
|
||||
} else {
|
||||
return closest(element).fold(constant(assumeEditable), editable => getRaw(editable) === 'true');
|
||||
}
|
||||
};
|
||||
const getRaw = element => element.dom.contentEditable;
|
||||
|
||||
const setIfNot = (element, property, value, ignore) => {
|
||||
if (value === ignore) {
|
||||
remove$7(element, property);
|
||||
@@ -5290,8 +5324,8 @@
|
||||
const getColumns = () => getData(tableTypeColumn);
|
||||
const clearColumns = () => clearData(tableTypeColumn);
|
||||
|
||||
const getSelectionStartCellOrCaption = editor => getSelectionCellOrCaption(getSelectionStart(editor), getIsRoot(editor));
|
||||
const getSelectionStartCell = editor => getSelectionCell(getSelectionStart(editor), getIsRoot(editor));
|
||||
const getSelectionStartCellOrCaption = editor => getSelectionCellOrCaption(getSelectionStart(editor), getIsRoot(editor)).filter(isInEditableContext$1);
|
||||
const getSelectionStartCell = editor => getSelectionCell(getSelectionStart(editor), getIsRoot(editor)).filter(isInEditableContext$1);
|
||||
const registerCommands = (editor, actions) => {
|
||||
const isRoot = getIsRoot(editor);
|
||||
const eraseTable = () => getSelectionStartCellOrCaption(editor).each(cellOrCaption => {
|
||||
@@ -5438,7 +5472,7 @@
|
||||
if (!isObject(args)) {
|
||||
return;
|
||||
}
|
||||
const cells = getCellsFromSelection(editor);
|
||||
const cells = filter$2(getCellsFromSelection(editor), isInEditableContext$1);
|
||||
if (cells.length === 0) {
|
||||
return;
|
||||
}
|
||||
@@ -6259,6 +6293,7 @@
|
||||
};
|
||||
|
||||
const findCell = (target, isRoot) => closest$1(target, 'td,th', isRoot);
|
||||
const isInEditableContext = cell => parentElement(cell).exists(isEditable$1);
|
||||
const MouseSelection = (bridge, container, isRoot, annotations) => {
|
||||
const cursor = value();
|
||||
const clearstate = cursor.clear;
|
||||
@@ -6286,7 +6321,7 @@
|
||||
};
|
||||
const mousedown = event => {
|
||||
annotations.clear(container);
|
||||
findCell(event.target, isRoot).each(cursor.set);
|
||||
findCell(event.target, isRoot).filter(isInEditableContext).each(cursor.set);
|
||||
};
|
||||
const mouseover = event => {
|
||||
applySelection(event);
|
||||
@@ -6628,6 +6663,8 @@
|
||||
mouseup: handlers.mouseup
|
||||
};
|
||||
};
|
||||
const isEditableNode = node => closest$2(node, isHTMLElement).exists(isEditable$1);
|
||||
const isEditableSelection = (start, finish) => isEditableNode(start) || isEditableNode(finish);
|
||||
const keyboard = (win, container, isRoot, annotations) => {
|
||||
const bridge = WindowBridge(win);
|
||||
const clearToNavigate = () => {
|
||||
@@ -6642,7 +6679,9 @@
|
||||
if (isNavigation(keycode) && !shiftKey) {
|
||||
annotations.clearBeforeUpdate(container);
|
||||
}
|
||||
if (isDown(keycode) && shiftKey) {
|
||||
if (isNavigation(keycode) && shiftKey && !isEditableSelection(start, finish)) {
|
||||
return Optional.none;
|
||||
} else if (isDown(keycode) && shiftKey) {
|
||||
return curry(select, bridge, container, isRoot, down, finish, start, annotations.selectRange);
|
||||
} else if (isUp(keycode) && shiftKey) {
|
||||
return curry(select, bridge, container, isRoot, up, finish, start, annotations.selectRange);
|
||||
@@ -6671,7 +6710,9 @@
|
||||
});
|
||||
};
|
||||
};
|
||||
if (isDown(keycode) && shiftKey) {
|
||||
if (isNavigation(keycode) && shiftKey && !isEditableSelection(start, finish)) {
|
||||
return Optional.none;
|
||||
} else if (isDown(keycode) && shiftKey) {
|
||||
return update$1([rc(+1, 0)]);
|
||||
} else if (isUp(keycode) && shiftKey) {
|
||||
return update$1([rc(-1, 0)]);
|
||||
@@ -6701,7 +6742,7 @@
|
||||
if (!shiftKey) {
|
||||
return Optional.none();
|
||||
}
|
||||
if (isNavigation(keycode)) {
|
||||
if (isNavigation(keycode) && isEditableSelection(start, finish)) {
|
||||
return sync(container, isRoot, start, soffset, finish, foffset, annotations.selectRange);
|
||||
} else {
|
||||
return Optional.none();
|
||||
@@ -7335,6 +7376,7 @@
|
||||
const off = () => {
|
||||
active = false;
|
||||
};
|
||||
const isActive = () => active;
|
||||
const runIfActive = f => {
|
||||
return (...args) => {
|
||||
if (active) {
|
||||
@@ -7356,6 +7398,7 @@
|
||||
go,
|
||||
on,
|
||||
off,
|
||||
isActive,
|
||||
destroy,
|
||||
events: events.registry
|
||||
};
|
||||
@@ -7679,8 +7722,10 @@
|
||||
destroy(wire);
|
||||
}
|
||||
}, table => {
|
||||
hoverTable = Optional.some(table);
|
||||
refresh(wire, table);
|
||||
if (resizing.isActive()) {
|
||||
hoverTable = Optional.some(table);
|
||||
refresh(wire, table);
|
||||
}
|
||||
});
|
||||
});
|
||||
const destroy$1 = () => {
|
||||
@@ -7933,6 +7978,17 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
editor.on('dragstart dragend', e => {
|
||||
tableResize.on(resize => {
|
||||
if (e.type === 'dragstart') {
|
||||
resize.hideBars();
|
||||
resize.off();
|
||||
} else {
|
||||
resize.on();
|
||||
resize.showBars();
|
||||
}
|
||||
});
|
||||
});
|
||||
editor.on('remove', () => {
|
||||
destroy();
|
||||
});
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tinymce",
|
||||
"version": "6.3.1",
|
||||
"version": "6.4.2",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/tinymce/tinymce.git",
|
||||
|
||||
+34
-28
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -134,54 +134,60 @@
|
||||
}
|
||||
Optional.singletonNone = new Optional(false);
|
||||
|
||||
const findUntil = (xs, pred, until) => {
|
||||
for (let i = 0, len = xs.length; i < len; i++) {
|
||||
const x = xs[i];
|
||||
if (pred(x, i)) {
|
||||
return Optional.some(x);
|
||||
} else if (until(x, i)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return Optional.none();
|
||||
};
|
||||
|
||||
const isCustomList = list => /\btox\-/.test(list.className);
|
||||
const isChildOfBody = (editor, elm) => {
|
||||
return editor.dom.isChildOf(elm, editor.getBody());
|
||||
};
|
||||
const isTableCellNode = node => {
|
||||
return isNonNullable(node) && /^(TH|TD)$/.test(node.nodeName);
|
||||
};
|
||||
const isListNode = editor => node => {
|
||||
return isNonNullable(node) && /^(OL|UL|DL)$/.test(node.nodeName) && isChildOfBody(editor, node);
|
||||
};
|
||||
const matchNodeNames = regex => node => isNonNullable(node) && regex.test(node.nodeName);
|
||||
const isListNode = matchNodeNames(/^(OL|UL|DL)$/);
|
||||
const isTableCellNode = matchNodeNames(/^(TH|TD)$/);
|
||||
const inList = (editor, parents, nodeName) => findUntil(parents, parent => isListNode(parent) && !isCustomList(parent), isTableCellNode).exists(list => list.nodeName === nodeName && isChildOfBody(editor, list));
|
||||
const getSelectedStyleType = editor => {
|
||||
const listElm = editor.dom.getParent(editor.selection.getNode(), 'ol,ul');
|
||||
const style = editor.dom.getStyle(listElm, 'listStyleType');
|
||||
return Optional.from(style);
|
||||
};
|
||||
const isWithinNonEditable = (editor, element) => element !== null && editor.dom.getContentEditableParent(element) === 'false';
|
||||
const isWithinNonEditable = (editor, element) => element !== null && !editor.dom.isEditable(element);
|
||||
const isWithinNonEditableList = (editor, element) => {
|
||||
const parentList = editor.dom.getParent(element, 'ol,ul,dl');
|
||||
return isWithinNonEditable(editor, parentList);
|
||||
};
|
||||
|
||||
const findIndex = (list, predicate) => {
|
||||
for (let index = 0; index < list.length; index++) {
|
||||
const element = list[index];
|
||||
if (predicate(element)) {
|
||||
return index;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
const setNodeChangeHandler = (editor, nodeChangeHandler) => {
|
||||
const initialNode = editor.selection.getNode();
|
||||
nodeChangeHandler({
|
||||
parents: editor.dom.getParents(initialNode),
|
||||
element: initialNode
|
||||
});
|
||||
editor.on('NodeChange', nodeChangeHandler);
|
||||
return () => editor.off('NodeChange', nodeChangeHandler);
|
||||
};
|
||||
|
||||
const styleValueToText = styleValue => {
|
||||
return styleValue.replace(/\-/g, ' ').replace(/\b\w/g, chr => {
|
||||
return chr.toUpperCase();
|
||||
});
|
||||
};
|
||||
const normalizeStyleValue = styleValue => isNullable(styleValue) || styleValue === 'default' ? '' : styleValue;
|
||||
const isWithinList = (editor, e, nodeName) => {
|
||||
const tableCellIndex = findIndex(e.parents, isTableCellNode);
|
||||
const parents = tableCellIndex !== -1 ? e.parents.slice(0, tableCellIndex) : e.parents;
|
||||
const lists = global.grep(parents, isListNode(editor));
|
||||
return lists.length > 0 && lists[0].nodeName === nodeName;
|
||||
};
|
||||
const makeSetupHandler = (editor, nodeName) => api => {
|
||||
const nodeChangeHandler = e => {
|
||||
api.setActive(isWithinList(editor, e, nodeName));
|
||||
api.setEnabled(!isWithinNonEditableList(editor, e.element));
|
||||
const updateButtonState = (editor, parents) => {
|
||||
const element = editor.selection.getStart(true);
|
||||
api.setActive(inList(editor, parents, nodeName));
|
||||
api.setEnabled(!isWithinNonEditableList(editor, element));
|
||||
};
|
||||
editor.on('NodeChange', nodeChangeHandler);
|
||||
return () => editor.off('NodeChange', nodeChangeHandler);
|
||||
const nodeChangeHandler = e => updateButtonState(editor, e.parents);
|
||||
return setNodeChangeHandler(editor, nodeChangeHandler);
|
||||
};
|
||||
const addSplitButton = (editor, id, tooltip, cmd, nodeName, styles) => {
|
||||
editor.ui.registry.addSplitButton(id, {
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(t,e,r)=>{const s="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(s,!1,!1===r?null:{"list-style-type":r})},r=t=>e=>e.options.get(t),s=r("advlist_number_styles"),n=r("advlist_bullet_styles"),l=t=>null==t,i=t=>!l(t);var o=tinymce.util.Tools.resolve("tinymce.util.Tools");class a{constructor(t,e){this.tag=t,this.value=e}static some(t){return new a(!0,t)}static none(){return a.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?a.some(t(this.value)):a.none()}bind(t){return this.tag?t(this.value):a.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:a.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")}static from(t){return i(t)?a.some(t):a.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}a.singletonNone=new a(!1);const u=t=>i(t)&&/^(TH|TD)$/.test(t.nodeName),d=t=>l(t)||"default"===t?"":t,g=(t,e)=>r=>{const s=s=>{r.setActive(((t,e,r)=>{const s=((t,e)=>{for(let r=0;r<t.length;r++)if(e(t[r]))return r;return-1})(e.parents,u),n=-1!==s?e.parents.slice(0,s):e.parents,l=o.grep(n,(t=>e=>i(e)&&/^(OL|UL|DL)$/.test(e.nodeName)&&((t,e)=>t.dom.isChildOf(e,t.getBody()))(t,e))(t));return l.length>0&&l[0].nodeName===r})(t,s,e)),r.setEnabled(!((t,e)=>{const r=t.dom.getParent(e,"ol,ul,dl");return((t,e)=>null!==e&&"false"===t.dom.getContentEditableParent(e))(t,r)})(t,s.element))};return t.on("NodeChange",s),()=>t.off("NodeChange",s)},h=(t,r,s,n,l,i)=>{i.length>1?((t,r,s,n,l,i)=>{t.ui.registry.addSplitButton(r,{tooltip:s,icon:"OL"===l?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:t=>{t(o.map(i,(t=>{const e="OL"===l?"num":"bull",r="disc"===t||"decimal"===t?"default":t,s=d(t),n=(t=>t.replace(/\-/g," ").replace(/\b\w/g,(t=>t.toUpperCase())))(t);return{type:"choiceitem",value:s,icon:"list-"+e+"-"+r,text:n}})))},onAction:()=>t.execCommand(n),onItemAction:(r,s)=>{e(t,l,s)},select:e=>{const r=(t=>{const e=t.dom.getParent(t.selection.getNode(),"ol,ul"),r=t.dom.getStyle(e,"listStyleType");return a.from(r)})(t);return r.map((t=>e===t)).getOr(!1)},onSetup:g(t,l)})})(t,r,s,n,l,i):((t,r,s,n,l,i)=>{t.ui.registry.addToggleButton(r,{active:!1,tooltip:s,icon:"OL"===l?"ordered-list":"unordered-list",onSetup:g(t,l),onAction:()=>t.queryCommandState(n)||""===i?t.execCommand(n):e(t,l,i)})})(t,r,s,n,l,d(i[0]))};t.add("advlist",(t=>{t.hasPlugin("lists")?((t=>{const e=t.options.register;e("advlist_number_styles",{processor:"string[]",default:"default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman".split(",")}),e("advlist_bullet_styles",{processor:"string[]",default:"default,circle,square".split(",")})})(t),(t=>{h(t,"numlist","Numbered list","InsertOrderedList","OL",s(t)),h(t,"bullist","Bullet list","InsertUnorderedList","UL",n(t))})(t),(t=>{t.addCommand("ApplyUnorderedListStyle",((r,s)=>{e(t,"UL",s["list-style-type"])})),t.addCommand("ApplyOrderedListStyle",((r,s)=>{e(t,"OL",s["list-style-type"])}))})(t)):console.error("Please use the Lists plugin together with the Advanced List plugin.")}))}();
|
||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(t,e,s)=>{const r="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(r,!1,!1===s?null:{"list-style-type":s})},s=t=>e=>e.options.get(t),r=s("advlist_number_styles"),n=s("advlist_bullet_styles"),l=t=>null==t,i=t=>!l(t);var o=tinymce.util.Tools.resolve("tinymce.util.Tools");class a{constructor(t,e){this.tag=t,this.value=e}static some(t){return new a(!0,t)}static none(){return a.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?a.some(t(this.value)):a.none()}bind(t){return this.tag?t(this.value):a.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:a.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")}static from(t){return i(t)?a.some(t):a.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}a.singletonNone=new a(!1);const u=t=>e=>i(e)&&t.test(e.nodeName),d=u(/^(OL|UL|DL)$/),g=u(/^(TH|TD)$/),c=t=>l(t)||"default"===t?"":t,h=(t,e)=>s=>((t,e)=>{const s=t.selection.getNode();return e({parents:t.dom.getParents(s),element:s}),t.on("NodeChange",e),()=>t.off("NodeChange",e)})(t,(r=>((t,r)=>{const n=t.selection.getStart(!0);s.setActive(((t,e,s)=>((t,e,s)=>{for(let e=0,n=t.length;e<n;e++){const n=t[e];if(d(r=n)&&!/\btox\-/.test(r.className))return a.some(n);if(s(n,e))break}var r;return a.none()})(e,0,g).exists((e=>e.nodeName===s&&((t,e)=>t.dom.isChildOf(e,t.getBody()))(t,e))))(t,r,e)),s.setEnabled(!((t,e)=>{const s=t.dom.getParent(e,"ol,ul,dl");return((t,e)=>null!==e&&!t.dom.isEditable(e))(t,s)})(t,n))})(t,r.parents))),m=(t,s,r,n,l,i)=>{i.length>1?((t,s,r,n,l,i)=>{t.ui.registry.addSplitButton(s,{tooltip:r,icon:"OL"===l?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:t=>{t(o.map(i,(t=>{const e="OL"===l?"num":"bull",s="disc"===t||"decimal"===t?"default":t,r=c(t),n=(t=>t.replace(/\-/g," ").replace(/\b\w/g,(t=>t.toUpperCase())))(t);return{type:"choiceitem",value:r,icon:"list-"+e+"-"+s,text:n}})))},onAction:()=>t.execCommand(n),onItemAction:(s,r)=>{e(t,l,r)},select:e=>{const s=(t=>{const e=t.dom.getParent(t.selection.getNode(),"ol,ul"),s=t.dom.getStyle(e,"listStyleType");return a.from(s)})(t);return s.map((t=>e===t)).getOr(!1)},onSetup:h(t,l)})})(t,s,r,n,l,i):((t,s,r,n,l,i)=>{t.ui.registry.addToggleButton(s,{active:!1,tooltip:r,icon:"OL"===l?"ordered-list":"unordered-list",onSetup:h(t,l),onAction:()=>t.queryCommandState(n)||""===i?t.execCommand(n):e(t,l,i)})})(t,s,r,n,l,c(i[0]))};t.add("advlist",(t=>{t.hasPlugin("lists")?((t=>{const e=t.options.register;e("advlist_number_styles",{processor:"string[]",default:"default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman".split(",")}),e("advlist_bullet_styles",{processor:"string[]",default:"default,circle,square".split(",")})})(t),(t=>{m(t,"numlist","Numbered list","InsertOrderedList","OL",r(t)),m(t,"bullist","Bullet list","InsertUnorderedList","UL",n(t))})(t),(t=>{t.addCommand("ApplyUnorderedListStyle",((s,r)=>{e(t,"UL",r["list-style-type"])})),t.addCommand("ApplyOrderedListStyle",((s,r)=>{e(t,"OL",r["list-style-type"])}))})(t)):console.error("Please use the Lists plugin together with the Advanced List plugin.")}))}();
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),o=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=("allow_html_in_named_anchor",e=>e.options.get("allow_html_in_named_anchor"));const a="a:not([href])",r=e=>!e,i=e=>e.getAttribute("id")||e.getAttribute("name")||"",l=e=>(e=>"a"===e.nodeName.toLowerCase())(e)&&!e.getAttribute("href")&&""!==i(e),s=e=>e.dom.getParent(e.selection.getStart(),a),d=(e,a)=>{const r=s(e);r?((e,t,o)=>{o.removeAttribute("name"),o.id=t,e.addVisual(),e.undoManager.add()})(e,a,r):((e,a)=>{e.undoManager.transact((()=>{n(e)||e.selection.collapse(!0),e.selection.isCollapsed()?e.insertContent(e.dom.createHTML("a",{id:a})):((e=>{const n=e.dom;t(n).walk(e.selection.getRng(),(e=>{o.each(e,(e=>{var t;l(t=e)&&!t.firstChild&&n.remove(e,!1)}))}))})(e),e.formatter.remove("namedAnchor",void 0,void 0,!0),e.formatter.apply("namedAnchor",{value:a}),e.addVisual())}))})(e,a),e.focus()},c=e=>(e=>r(e.attr("href"))&&!r(e.attr("id")||e.attr("name")))(e)&&!e.firstChild,m=e=>t=>{for(let o=0;o<t.length;o++){const n=t[o];c(n)&&n.attr("contenteditable",e)}};e.add("anchor",(e=>{(e=>{(0,e.options.register)("allow_html_in_named_anchor",{processor:"boolean",default:!1})})(e),(e=>{e.on("PreInit",(()=>{e.parser.addNodeFilter("a",m("false")),e.serializer.addNodeFilter("a",m(null))}))})(e),(e=>{e.addCommand("mceAnchor",(()=>{(e=>{const t=(e=>{const t=s(e);return t?i(t):""})(e);e.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:t=>{((e,t)=>/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)?(d(e,t),!0):(e.windowManager.alert("ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),!1))(e,t.getData().id)&&t.close()}})})(e)}))})(e),(e=>{const t=()=>e.execCommand("mceAnchor");e.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:t,onSetup:t=>e.selection.selectorChangedWithUnbind("a:not([href])",t.setActive).unbind}),e.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:t})})(e),e.on("PreInit",(()=>{(e=>{e.formatter.register("namedAnchor",{inline:"a",selector:a,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:(e,t,o)=>l(e)})})(e)}))}))}();
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>t.options.get(e),n=t("autolink_pattern"),o=t("link_default_target"),r=t("link_default_protocol"),a=t("allow_unsafe_link_target"),s=("string",e=>"string"===(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=o=e,(r=String).prototype.isPrototypeOf(n)||(null===(a=o.constructor)||void 0===a?void 0:a.name)===r.name)?"string":t;var n,o,r,a})(e));const l=(void 0,e=>undefined===e);const i=e=>!(e=>null==e)(e),c=Object.hasOwnProperty,d=e=>"\ufeff"===e;var u=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker");const f=e=>/^[(\[{ \u00a0]$/.test(e),g=(e,t,n)=>{for(let o=t-1;o>=0;o--){const t=e.charAt(o);if(!d(t)&&n(t))return o}return-1},m=(e,t)=>{var o;const a=e.schema.getVoidElements(),s=n(e),{dom:i,selection:d}=e;if(null!==i.getParent(d.getNode(),"a[href]"))return null;const m=d.getRng(),k=u(i,(e=>{return i.isBlock(e)||(t=a,n=e.nodeName.toLowerCase(),c.call(t,n))||"false"===i.getContentEditable(e);var t,n})),{container:p,offset:y}=((e,t)=>{let n=e,o=t;for(;1===n.nodeType&&n.childNodes[o];)n=n.childNodes[o],o=3===n.nodeType?n.data.length:n.childNodes.length;return{container:n,offset:o}})(m.endContainer,m.endOffset),h=null!==(o=i.getParent(p,i.isBlock))&&void 0!==o?o:i.getRoot(),w=k.backwards(p,y+t,((e,t)=>{const n=e.data,o=g(n,t,(r=f,e=>!r(e)));var r,a;return-1===o||(a=n[o],/[?!,.;:]/.test(a))?o:o+1}),h);if(!w)return null;let v=w.container;const _=k.backwards(w.container,w.offset,((e,t)=>{v=e;const n=g(e.data,t,f);return-1===n?n:n+1}),h),A=i.createRng();_?A.setStart(_.container,_.offset):A.setStart(v,0),A.setEnd(w.container,w.offset);const C=A.toString().replace(/\uFEFF/g,"").match(s);if(C){let t=C[0];return $="www.",(b=t).length>=$.length&&b.substr(0,0+$.length)===$?t=r(e)+"://"+t:((e,t,n=0,o)=>{const r=e.indexOf(t,n);return-1!==r&&(!!l(o)||r+t.length<=o)})(t,"@")&&!(e=>/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(e))(t)&&(t="mailto:"+t),{rng:A,url:t}}var b,$;return null},k=(e,t)=>{const{dom:n,selection:r}=e,{rng:l,url:i}=t,c=r.getBookmark();r.setRng(l);const d="createlink",u={command:d,ui:!1,value:i};if(!e.dispatch("BeforeExecCommand",u).isDefaultPrevented()){e.getDoc().execCommand(d,!1,i),e.dispatch("ExecCommand",u);const t=o(e);if(s(t)){const o=r.getNode();n.setAttrib(o,"target",t),"_blank"!==t||a(e)||n.setAttrib(o,"rel","noopener")}}r.moveToBookmark(c),e.nodeChanged()},p=e=>{const t=m(e,-1);i(t)&&k(e,t)},y=p;e.add("autolink",(e=>{(e=>{const t=e.options.register;t("autolink_pattern",{processor:"regexp",default:new RegExp("^"+/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g.source+"$","i")}),t("link_default_target",{processor:"string"}),t("link_default_protocol",{processor:"string",default:"https"})})(e),(e=>{e.on("keydown",(t=>{13!==t.keyCode||t.isDefaultPrevented()||(e=>{const t=m(e,0);i(t)&&k(e,t)})(e)})),e.on("keyup",(t=>{32===t.keyCode?p(e):(48===t.keyCode&&t.shiftKey||221===t.keyCode)&&y(e)}))})(e)}))}();
|
||||
+46
-11
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -21,6 +21,12 @@
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
const constant = value => {
|
||||
return () => {
|
||||
return value;
|
||||
};
|
||||
};
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.Env');
|
||||
|
||||
const fireResizeEditor = editor => editor.dispatch('ResizeEditor');
|
||||
@@ -65,7 +71,7 @@
|
||||
return false;
|
||||
}
|
||||
};
|
||||
const resize = (editor, oldSize, trigger) => {
|
||||
const resize = (editor, oldSize, trigger, getExtraMarginBottom) => {
|
||||
var _a;
|
||||
const dom = editor.dom;
|
||||
const doc = editor.getDoc();
|
||||
@@ -77,7 +83,7 @@
|
||||
return;
|
||||
}
|
||||
const docEle = doc.documentElement;
|
||||
const resizeBottomMargin = getAutoResizeBottomMargin(editor);
|
||||
const resizeBottomMargin = getExtraMarginBottom ? getExtraMarginBottom() : getAutoResizeOverflowPadding(editor);
|
||||
const minHeight = (_a = getMinHeight(editor)) !== null && _a !== void 0 ? _a : editor.getElement().offsetHeight;
|
||||
let resizeHeight = minHeight;
|
||||
const marginTop = parseCssValueToInt(dom, docEle, 'margin-top', true);
|
||||
@@ -112,23 +118,52 @@
|
||||
editor.selection.scrollIntoView();
|
||||
}
|
||||
if ((global.browser.isSafari() || global.browser.isChromium()) && deltaSize < 0) {
|
||||
resize(editor, oldSize, trigger);
|
||||
resize(editor, oldSize, trigger, getExtraMarginBottom);
|
||||
}
|
||||
}
|
||||
};
|
||||
const setup = (editor, oldSize) => {
|
||||
editor.on('init', () => {
|
||||
let getExtraMarginBottom = () => getAutoResizeBottomMargin(editor);
|
||||
let resizeCounter;
|
||||
let sizeAfterFirstResize;
|
||||
editor.on('init', e => {
|
||||
resizeCounter = 0;
|
||||
const overflowPadding = getAutoResizeOverflowPadding(editor);
|
||||
const dom = editor.dom;
|
||||
dom.setStyles(editor.getDoc().documentElement, { height: 'auto' });
|
||||
dom.setStyles(editor.getBody(), {
|
||||
'paddingLeft': overflowPadding,
|
||||
'paddingRight': overflowPadding,
|
||||
'min-height': 0
|
||||
});
|
||||
if (global.browser.isEdge() || global.browser.isIE()) {
|
||||
dom.setStyles(editor.getBody(), {
|
||||
'paddingLeft': overflowPadding,
|
||||
'paddingRight': overflowPadding,
|
||||
'min-height': 0
|
||||
});
|
||||
} else {
|
||||
dom.setStyles(editor.getBody(), {
|
||||
paddingLeft: overflowPadding,
|
||||
paddingRight: overflowPadding
|
||||
});
|
||||
}
|
||||
resize(editor, oldSize, e, getExtraMarginBottom);
|
||||
resizeCounter += 1;
|
||||
});
|
||||
editor.on('NodeChange SetContent keyup FullscreenStateChanged ResizeContent', e => {
|
||||
resize(editor, oldSize, e);
|
||||
if (resizeCounter === 1) {
|
||||
sizeAfterFirstResize = editor.getContainer().offsetHeight;
|
||||
resize(editor, oldSize, e, getExtraMarginBottom);
|
||||
resizeCounter += 1;
|
||||
} else if (resizeCounter === 2) {
|
||||
const isLooping = sizeAfterFirstResize < editor.getContainer().offsetHeight;
|
||||
if (isLooping) {
|
||||
const dom = editor.dom;
|
||||
const doc = editor.getDoc();
|
||||
dom.setStyles(doc.documentElement, { 'min-height': 0 });
|
||||
dom.setStyles(editor.getBody(), { 'min-height': 'inherit' });
|
||||
}
|
||||
getExtraMarginBottom = isLooping ? constant(0) : getExtraMarginBottom;
|
||||
resizeCounter += 1;
|
||||
} else {
|
||||
resize(editor, oldSize, e, getExtraMarginBottom);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env");const o=e=>t=>t.options.get(e),n=o("min_height"),s=o("max_height"),i=o("autoresize_overflow_padding"),r=o("autoresize_bottom_margin"),l=(e,t)=>{const o=e.getBody();o&&(o.style.overflowY=t?"":"hidden",t||(o.scrollTop=0))},a=(e,t,o,n)=>{var s;const i=parseInt(null!==(s=e.getStyle(t,o,n))&&void 0!==s?s:"",10);return isNaN(i)?0:i},g=(e,o,i)=>{var c;const u=e.dom,d=e.getDoc();if(!d)return;if((e=>e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen())(e))return void l(e,!0);const f=d.documentElement,m=r(e),p=null!==(c=n(e))&&void 0!==c?c:e.getElement().offsetHeight;let h=p;const v=a(u,f,"margin-top",!0),y=a(u,f,"margin-bottom",!0);let C=f.offsetHeight+v+y+m;C<0&&(C=0);const S=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;C+S>p&&(h=C+S);const z=s(e);if(z&&h>z?(h=z,l(e,!0)):l(e,!1),h!==o.get()){const n=h-o.get();if(u.setStyle(e.getContainer(),"height",h+"px"),o.set(h),(e=>{e.dispatch("ResizeEditor")})(e),t.browser.isSafari()&&(t.os.isMacOS()||t.os.isiOS())){const t=e.getWin();t.scrollTo(t.pageXOffset,t.pageYOffset)}e.hasFocus()&&(e=>{if("setcontent"===(null==e?void 0:e.type.toLowerCase())){const t=e;return!0===t.selection||!0===t.paste}return!1})(i)&&e.selection.scrollIntoView(),(t.browser.isSafari()||t.browser.isChromium())&&n<0&&g(e,o,i)}};e.add("autoresize",(e=>{if((e=>{const t=e.options.register;t("autoresize_overflow_padding",{processor:"number",default:1}),t("autoresize_bottom_margin",{processor:"number",default:50})})(e),e.options.isSet("resize")||e.options.set("resize",!1),!e.inline){const t=(e=>{let t=0;return{get:()=>t,set:e=>{t=e}}})();((e,t)=>{e.addCommand("mceAutoResize",(()=>{g(e,t)}))})(e,t),((e,t)=>{e.on("init",(()=>{const t=i(e),o=e.dom;o.setStyles(e.getDoc().documentElement,{height:"auto"}),o.setStyles(e.getBody(),{paddingLeft:t,paddingRight:t,"min-height":0})})),e.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",(o=>{g(e,t,o)}))})(e,t)}}))}();
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env");const o=e=>t=>t.options.get(e),s=o("min_height"),i=o("max_height"),n=o("autoresize_overflow_padding"),r=o("autoresize_bottom_margin"),l=(e,t)=>{const o=e.getBody();o&&(o.style.overflowY=t?"":"hidden",t||(o.scrollTop=0))},g=(e,t,o,s)=>{var i;const n=parseInt(null!==(i=e.getStyle(t,o,s))&&void 0!==i?i:"",10);return isNaN(n)?0:n},a=(e,o,r,c)=>{var d;const f=e.dom,u=e.getDoc();if(!u)return;if((e=>e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen())(e))return void l(e,!0);const m=u.documentElement,h=c?c():n(e),p=null!==(d=s(e))&&void 0!==d?d:e.getElement().offsetHeight;let y=p;const S=g(f,m,"margin-top",!0),v=g(f,m,"margin-bottom",!0);let C=m.offsetHeight+S+v+h;C<0&&(C=0);const b=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;C+b>p&&(y=C+b);const w=i(e);if(w&&y>w?(y=w,l(e,!0)):l(e,!1),y!==o.get()){const s=y-o.get();if(f.setStyle(e.getContainer(),"height",y+"px"),o.set(y),(e=>{e.dispatch("ResizeEditor")})(e),t.browser.isSafari()&&(t.os.isMacOS()||t.os.isiOS())){const t=e.getWin();t.scrollTo(t.pageXOffset,t.pageYOffset)}e.hasFocus()&&(e=>{if("setcontent"===(null==e?void 0:e.type.toLowerCase())){const t=e;return!0===t.selection||!0===t.paste}return!1})(r)&&e.selection.scrollIntoView(),(t.browser.isSafari()||t.browser.isChromium())&&s<0&&a(e,o,r,c)}};e.add("autoresize",(e=>{if((e=>{const t=e.options.register;t("autoresize_overflow_padding",{processor:"number",default:1}),t("autoresize_bottom_margin",{processor:"number",default:50})})(e),e.options.isSet("resize")||e.options.set("resize",!1),!e.inline){const o=(e=>{let t=0;return{get:()=>t,set:e=>{t=e}}})();((e,t)=>{e.addCommand("mceAutoResize",(()=>{a(e,t)}))})(e,o),((e,o)=>{let s,i,l=()=>r(e);e.on("init",(i=>{s=0;const r=n(e),g=e.dom;g.setStyles(e.getDoc().documentElement,{height:"auto"}),t.browser.isEdge()||t.browser.isIE()?g.setStyles(e.getBody(),{paddingLeft:r,paddingRight:r,"min-height":0}):g.setStyles(e.getBody(),{paddingLeft:r,paddingRight:r}),a(e,o,i,l),s+=1})),e.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",(t=>{if(1===s)i=e.getContainer().offsetHeight,a(e,o,t,l),s+=1;else if(2===s){const t=i<e.getContainer().offsetHeight;if(t){const t=e.dom,o=e.getDoc();t.setStyles(o.documentElement,{"min-height":0}),t.setStyles(e.getBody(),{"min-height":"inherit"})}l=t?(0,()=>0):l,s+=1}else a(e,o,t,l)}))})(e,o)}}))}();
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=("string",t=>"string"===(t=>{const e=typeof t;return null===t?"null":"object"===e&&Array.isArray(t)?"array":"object"===e&&(r=o=t,(a=String).prototype.isPrototypeOf(r)||(null===(s=o.constructor)||void 0===s?void 0:s.name)===a.name)?"string":e;var r,o,a,s})(t));const r=(void 0,t=>undefined===t);var o=tinymce.util.Tools.resolve("tinymce.util.Delay"),a=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),s=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=t=>{const e=/^(\d+)([ms]?)$/.exec(t);return(e&&e[2]?{s:1e3,m:6e4}[e[2]]:1)*parseInt(t,10)},i=t=>e=>e.options.get(t),u=i("autosave_ask_before_unload"),l=i("autosave_restore_when_empty"),c=i("autosave_interval"),d=i("autosave_retention"),m=t=>{const e=document.location;return t.options.get("autosave_prefix").replace(/{path}/g,e.pathname).replace(/{query}/g,e.search).replace(/{hash}/g,e.hash).replace(/{id}/g,t.id)},v=(t,e)=>{if(r(e))return t.dom.isEmpty(t.getBody());{const r=s.trim(e);if(""===r)return!0;{const e=(new DOMParser).parseFromString(r,"text/html");return t.dom.isEmpty(e)}}},f=t=>{var e;const r=parseInt(null!==(e=a.getItem(m(t)+"time"))&&void 0!==e?e:"0",10)||0;return!((new Date).getTime()-r>d(t)&&(p(t,!1),1))},p=(t,e)=>{const r=m(t);a.removeItem(r+"draft"),a.removeItem(r+"time"),!1!==e&&(t=>{t.dispatch("RemoveDraft")})(t)},g=t=>{const e=m(t);!v(t)&&t.isDirty()&&(a.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),a.setItem(e+"time",(new Date).getTime().toString()),(t=>{t.dispatch("StoreDraft")})(t))},y=t=>{var e;const r=m(t);f(t)&&(t.setContent(null!==(e=a.getItem(r+"draft"))&&void 0!==e?e:"",{format:"raw"}),(t=>{t.dispatch("RestoreDraft")})(t))};var D=tinymce.util.Tools.resolve("tinymce.EditorManager");const h=t=>e=>{e.setEnabled(f(t));const r=()=>e.setEnabled(f(t));return t.on("StoreDraft RestoreDraft RemoveDraft",r),()=>t.off("StoreDraft RestoreDraft RemoveDraft",r)};t.add("autosave",(t=>((t=>{const r=t.options.register,o=t=>{const r=e(t);return r?{value:n(t),valid:r}:{valid:!1,message:"Must be a string."}};r("autosave_ask_before_unload",{processor:"boolean",default:!0}),r("autosave_prefix",{processor:"string",default:"tinymce-autosave-{path}{query}{hash}-{id}-"}),r("autosave_restore_when_empty",{processor:"boolean",default:!1}),r("autosave_interval",{processor:o,default:"30s"}),r("autosave_retention",{processor:o,default:"20m"})})(t),(t=>{t.editorManager.on("BeforeUnload",(t=>{let e;s.each(D.get(),(t=>{t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&u(t)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))})),e&&(t.preventDefault(),t.returnValue=e)}))})(t),(t=>{(t=>{const e=c(t);o.setEditorInterval(t,(()=>{g(t)}),e)})(t);const e=()=>{(t=>{t.undoManager.transact((()=>{y(t),p(t)})),t.focus()})(t)};t.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:e,onSetup:h(t)}),t.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:e,onSetup:h(t)})})(t),t.on("init",(()=>{l(t)&&t.dom.isEmpty(t.getBody())&&y(t)})),(t=>({hasDraft:()=>f(t),storeDraft:()=>g(t),restoreDraft:()=>y(t),removeDraft:e=>p(t,e),isEmpty:e=>v(t,e)}))(t))))}();
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("code",(e=>((e=>{e.addCommand("mceCodeEditor",(()=>{(e=>{const o=(e=>e.getContent({source_view:!0}))(e);e.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:o},onSubmit:o=>{((e,o)=>{e.focus(),e.undoManager.transact((()=>{e.setContent(o)})),e.selection.setCursorLocation(),e.nodeChanged()})(e,o.getData().code),o.close()}})})(e)}))})(e),(e=>{const o=()=>e.execCommand("mceCodeEditor");e.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:o}),e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:o})})(e),{})))}();
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=t=>e=>typeof e===t,o=t=>"string"===(t=>{const e=typeof t;return null===t?"null":"object"===e&&Array.isArray(t)?"array":"object"===e&&(o=r=t,(n=String).prototype.isPrototypeOf(o)||(null===(i=r.constructor)||void 0===i?void 0:i.name)===n.name)?"string":e;var o,r,n,i})(t),r=e("boolean"),n=t=>!(t=>null==t)(t),i=e("function"),s=e("number"),l=(!1,()=>false);class a{constructor(t,e){this.tag=t,this.value=e}static some(t){return new a(!0,t)}static none(){return a.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?a.some(t(this.value)):a.none()}bind(t){return this.tag?t(this.value):a.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:a.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")}static from(t){return n(t)?a.some(t):a.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}a.singletonNone=new a(!1);const u=(t,e)=>{for(let o=0,r=t.length;o<r;o++)e(t[o],o)},c=t=>{if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},d=c,h=(t,e)=>{const o=t.dom;if(1!==o.nodeType)return!1;{const t=o;if(void 0!==t.matches)return t.matches(e);if(void 0!==t.msMatchesSelector)return t.msMatchesSelector(e);if(void 0!==t.webkitMatchesSelector)return t.webkitMatchesSelector(e);if(void 0!==t.mozMatchesSelector)return t.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}};"undefined"!=typeof window?window:Function("return this;")();const m=t=>e=>(t=>t.dom.nodeType)(e)===t,g=m(1),f=m(3),v=m(9),p=m(11),y=(t,e)=>{t.dom.removeAttribute(e)},w=i(Element.prototype.attachShadow)&&i(Node.prototype.getRootNode)?t=>d(t.dom.getRootNode()):t=>v(t)?t:d(t.dom.ownerDocument),N=t=>d(t.dom.host),b=t=>{const e=f(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;const o=e.ownerDocument;return(t=>{const e=w(t);return p(o=e)&&n(o.dom.host)?a.some(e):a.none();var o})(d(e)).fold((()=>o.body.contains(e)),(r=b,i=N,t=>r(i(t))));var r,i},S=t=>"rtl"===((t,e)=>{const o=t.dom,r=window.getComputedStyle(o).getPropertyValue(e);return""!==r||b(t)?r:((t,e)=>(t=>void 0!==t.style&&i(t.style.getPropertyValue))(t)?t.style.getPropertyValue(e):"")(o,e)})(t,"direction")?"rtl":"ltr",A=(t,e)=>((t,o)=>((t,e)=>{const o=[];for(let r=0,n=t.length;r<n;r++){const n=t[r];e(n,r)&&o.push(n)}return o})(((t,e)=>{const o=t.length,r=new Array(o);for(let n=0;n<o;n++){const o=t[n];r[n]=e(o,n)}return r})(t.dom.childNodes,d),(t=>h(t,e))))(t),T=("li",t=>g(t)&&"li"===t.dom.nodeName.toLowerCase());const C=(t,e)=>{const n=t.selection.getSelectedBlocks();n.length>0&&(u(n,(t=>{const n=d(t),c=T(n),m=((t,e)=>{return(e?(o=t,r="ol,ul",((t,e,o)=>{let n=t.dom;const s=i(o)?o:l;for(;n.parentNode;){n=n.parentNode;const t=d(n);if(h(t,r))return a.some(t);if(s(t))break}return a.none()})(o,0,n)):a.some(t)).getOr(t);var o,r,n})(n,c);var f;(f=m,(t=>a.from(t.dom.parentNode).map(d))(f).filter(g)).each((t=>{if(S(t)!==e?((t,e,n)=>{((t,e,n)=>{if(!(o(n)||r(n)||s(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")})(t.dom,e,n)})(m,"dir",e):S(m)!==e&&y(m,"dir"),c){const t=A(m,"li[dir]");u(t,(t=>y(t,"dir")))}}))})),t.nodeChanged())},D=(t,e)=>o=>{const r=t=>{const r=d(t.element);o.setActive(S(r)===e)};return t.on("NodeChange",r),()=>t.off("NodeChange",r)};t.add("directionality",(t=>{(t=>{t.addCommand("mceDirectionLTR",(()=>{C(t,"ltr")})),t.addCommand("mceDirectionRTL",(()=>{C(t,"rtl")}))})(t),(t=>{t.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:()=>t.execCommand("mceDirectionLTR"),onSetup:D(t,"ltr")}),t.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:()=>t.execCommand("mceDirectionRTL"),onSetup:D(t,"rtl")})})(t)}))}();
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+12
-4
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -627,6 +627,12 @@
|
||||
name: 'Advanced Tables',
|
||||
type: 'premium'
|
||||
},
|
||||
{
|
||||
key: 'advtemplate',
|
||||
name: 'Advanced Templates',
|
||||
type: 'premium',
|
||||
slug: 'advanced-templates'
|
||||
},
|
||||
{
|
||||
key: 'casechange',
|
||||
name: 'Case Change',
|
||||
@@ -650,7 +656,8 @@
|
||||
{
|
||||
key: 'typography',
|
||||
name: 'Advanced Typography',
|
||||
type: 'premium'
|
||||
type: 'premium',
|
||||
slug: 'advanced-typography'
|
||||
},
|
||||
{
|
||||
key: 'mediaembed',
|
||||
@@ -671,7 +678,8 @@
|
||||
{
|
||||
key: 'inlinecss',
|
||||
name: 'Inline CSS',
|
||||
type: 'premium'
|
||||
type: 'premium',
|
||||
slug: 'inline-css'
|
||||
},
|
||||
{
|
||||
key: 'linkchecker',
|
||||
@@ -901,7 +909,7 @@
|
||||
};
|
||||
editor.windowManager.open({
|
||||
title: 'Help',
|
||||
size: 'medium',
|
||||
size: 'normal',
|
||||
body,
|
||||
buttons: [{
|
||||
type: 'cancel',
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(s=r=e,(o=String).prototype.isPrototypeOf(s)||(null===(n=r.constructor)||void 0===n?void 0:n.name)===o.name)?"string":t;var s,r,o,n})(t)===e,s=t("string"),r=t("object"),o=t("array"),n=("function",e=>"function"==typeof e);var c=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),i=tinymce.util.Tools.resolve("tinymce.EditorManager"),l=tinymce.util.Tools.resolve("tinymce.Env"),a=tinymce.util.Tools.resolve("tinymce.util.Tools");const p=e=>t=>t.options.get(e),u=p("importcss_merge_classes"),m=p("importcss_exclusive"),f=p("importcss_selector_converter"),y=p("importcss_selector_filter"),d=p("importcss_groups"),h=p("importcss_append"),_=p("importcss_file_filter"),g=p("skin"),v=p("skin_url"),b=Array.prototype.push,x=/^\.(?:ephox|tiny-pageembed|mce)(?:[.-]+\w+)+$/,T=e=>s(e)?t=>-1!==t.indexOf(e):e instanceof RegExp?t=>e.test(t):e,S=(e,t)=>{let s={};const r=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(t);if(!r)return;const o=r[1],n=r[2].substr(1).split(".").join(" "),c=a.makeMap("a,img");return r[1]?(s={title:t},e.schema.getTextBlockElements()[o]?s.block=o:e.schema.getBlockElements()[o]||c[o.toLowerCase()]?s.selector=o:s.inline=o):r[2]&&(s={inline:"span",title:t.substr(1),classes:n}),u(e)?s.classes=n:s.attributes={class:n},s},k=(e,t)=>null===t||m(e),w=e=>{e.on("init",(()=>{const t=(()=>{const e=[],t=[],s={};return{addItemToGroup:(e,r)=>{s[e]?s[e].push(r):(t.push(e),s[e]=[r])},addItem:t=>{e.push(t)},toFormats:()=>{return(r=t,n=e=>{const t=s[e];return 0===t.length?[]:[{title:e,items:t}]},(e=>{const t=[];for(let s=0,r=e.length;s<r;++s){if(!o(e[s]))throw new Error("Arr.flatten item "+s+" was not an array, input: "+e);b.apply(t,e[s])}return t})(((e,t)=>{const s=e.length,r=new Array(s);for(let o=0;o<s;o++){const s=e[o];r[o]=t(s,o)}return r})(r,n))).concat(e);var r,n}}})(),r={},n=T(y(e)),p=(e=>a.map(e,(e=>a.extend({},e,{original:e,selectors:{},filter:T(e.filter)}))))(d(e)),u=(t,s)=>{if(((e,t,s,r)=>!(k(e,s)?t in r:t in s.selectors))(e,t,s,r)){((e,t,s,r)=>{k(e,s)?r[t]=!0:s.selectors[t]=!0})(e,t,s,r);const o=((e,t,s,r)=>{let o;const n=f(e);return o=r&&r.selector_converter?r.selector_converter:n||(()=>S(e,s)),o.call(t,s,r)})(e,e.plugins.importcss,t,s);if(o){const t=o.name||c.DOM.uniqueId();return e.formatter.register(t,o),{title:o.title,format:t}}}return null};a.each(((e,t,r)=>{const o=[],n={},c=(t,n)=>{let p,u=t.href;if(u=(e=>{const t=l.cacheSuffix;return s(e)&&(e=e.replace("?"+t,"").replace("&"+t,"")),e})(u),u&&(!r||r(u,n))&&!((e,t)=>{const s=g(e);if(s){const r=v(e),o=r?e.documentBaseURI.toAbsolute(r):i.baseURL+"/skins/ui/"+s,n=i.baseURL+"/skins/content/";return t===o+"/content"+(e.inline?".inline":"")+".min.css"||-1!==t.indexOf(n)}return!1})(e,u)){a.each(t.imports,(e=>{c(e,!0)}));try{p=t.cssRules||t.rules}catch(e){}a.each(p,(e=>{e.styleSheet?c(e.styleSheet,!0):e.selectorText&&a.each(e.selectorText.split(","),(e=>{o.push(a.trim(e))}))}))}};a.each(e.contentCSS,(e=>{n[e]=!0})),r||(r=(e,t)=>t||n[e]);try{a.each(t.styleSheets,(e=>{c(e)}))}catch(e){}return o})(e,e.getDoc(),T(_(e))),(e=>{if(!x.test(e)&&(!n||n(e))){const s=((e,t)=>a.grep(e,(e=>!e.filter||e.filter(t))))(p,e);if(s.length>0)a.each(s,(s=>{const r=u(e,s);r&&t.addItemToGroup(s.title,r)}));else{const s=u(e,null);s&&t.addItem(s)}}}));const m=t.toFormats();e.dispatch("addStyleModifications",{items:m,replace:!h(e)})}))};e.add("importcss",(e=>((e=>{const t=e.options.register,o=e=>s(e)||n(e)||r(e);t("importcss_merge_classes",{processor:"boolean",default:!0}),t("importcss_exclusive",{processor:"boolean",default:!0}),t("importcss_selector_converter",{processor:"function"}),t("importcss_selector_filter",{processor:o}),t("importcss_file_filter",{processor:o}),t("importcss_groups",{processor:"object[]"}),t("importcss_append",{processor:"boolean",default:!1})})(e),w(e),(e=>({convertSelectorToFormat:t=>S(e,t)}))(e))))}();
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>t.options.get(e),a=t("insertdatetime_dateformat"),r=t("insertdatetime_timeformat"),n=t("insertdatetime_formats"),s=t("insertdatetime_element"),i="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),o="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),l="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),m="January February March April May June July August September October November December".split(" "),c=(e,t)=>{if((e=""+e).length<t)for(let a=0;a<t-e.length;a++)e="0"+e;return e},d=(e,t,a=new Date)=>(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+a.getFullYear())).replace("%y",""+a.getYear())).replace("%m",c(a.getMonth()+1,2))).replace("%d",c(a.getDate(),2))).replace("%H",""+c(a.getHours(),2))).replace("%M",""+c(a.getMinutes(),2))).replace("%S",""+c(a.getSeconds(),2))).replace("%I",""+((a.getHours()+11)%12+1))).replace("%p",a.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(m[a.getMonth()]))).replace("%b",""+e.translate(l[a.getMonth()]))).replace("%A",""+e.translate(o[a.getDay()]))).replace("%a",""+e.translate(i[a.getDay()]))).replace("%%","%"),u=(e,t)=>{if(s(e)){const a=d(e,t);let r;r=/%[HMSIp]/.test(t)?d(e,"%Y-%m-%dT%H:%M"):d(e,"%Y-%m-%d");const n=e.dom.getParent(e.selection.getStart(),"time");n?((e,t,a,r)=>{const n=e.dom.create("time",{datetime:a},r);e.dom.replace(n,t),e.selection.select(n,!0),e.selection.collapse(!1)})(e,n,r,a):e.insertContent('<time datetime="'+r+'">'+a+"</time>")}else e.insertContent(d(e,t))};var p=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("insertdatetime",(e=>{(e=>{const t=e.options.register;t("insertdatetime_dateformat",{processor:"string",default:e.translate("%Y-%m-%d")}),t("insertdatetime_timeformat",{processor:"string",default:e.translate("%H:%M:%S")}),t("insertdatetime_formats",{processor:"string[]",default:["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"]}),t("insertdatetime_element",{processor:"boolean",default:!1})})(e),(e=>{e.addCommand("mceInsertDate",((t,r)=>{u(e,null!=r?r:a(e))})),e.addCommand("mceInsertTime",((t,a)=>{u(e,null!=a?a:r(e))}))})(e),(e=>{const t=n(e),a=(e=>{let t=e;return{get:()=>t,set:e=>{t=e}}})((e=>{const t=n(e);return t.length>0?t[0]:r(e)})(e)),s=t=>e.execCommand("mceInsertDate",!1,t);e.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:e=>e===a.get(),fetch:a=>{a(p.map(t,(t=>({type:"choiceitem",text:d(e,t),value:t}))))},onAction:e=>{s(a.get())},onItemAction:(e,t)=>{a.set(t),s(t)}});const i=e=>()=>{a.set(e),s(e)};e.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:()=>p.map(t,(t=>({type:"menuitem",text:d(e,t),onAction:i(t)})))})})(e)}))}();
|
||||
+21
-7
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -407,7 +407,7 @@
|
||||
};
|
||||
const trimCaretContainers = text => text.replace(/\uFEFF/g, '');
|
||||
const getAnchorElement = (editor, selectedElm) => {
|
||||
selectedElm = selectedElm || editor.selection.getNode();
|
||||
selectedElm = selectedElm || getLinksInSelection(editor.selection.getRng())[0] || editor.selection.getNode();
|
||||
if (isImageFigure(selectedElm)) {
|
||||
return Optional.from(editor.dom.select('a[href]', selectedElm)[0]);
|
||||
} else {
|
||||
@@ -419,8 +419,10 @@
|
||||
const text = anchorElm.fold(() => selection.getContent({ format: 'text' }), anchorElm => anchorElm.innerText || anchorElm.textContent || '');
|
||||
return trimCaretContainers(text);
|
||||
};
|
||||
const hasLinks = elements => global$4.grep(elements, isLink).length > 0;
|
||||
const hasLinksInSelection = rng => collectNodesInRange(rng, isLink).length > 0;
|
||||
const getLinksInSelection = rng => collectNodesInRange(rng, isLink);
|
||||
const getLinks$1 = elements => global$4.grep(elements, isLink);
|
||||
const hasLinks = elements => getLinks$1(elements).length > 0;
|
||||
const hasLinksInSelection = rng => getLinksInSelection(rng).length > 0;
|
||||
const isOnlyTextSelected = editor => {
|
||||
const inlineTextElements = editor.schema.getTextInlineElements();
|
||||
const isElement = elm => elm.nodeType === 1 && !isAnchor(elm) && !has(inlineTextElements, elm.nodeName.toLowerCase());
|
||||
@@ -1046,8 +1048,12 @@
|
||||
updateState();
|
||||
return toggleState(editor, updateState);
|
||||
};
|
||||
const hasExactlyOneLinkInSelection = editor => {
|
||||
const links = editor.selection.isCollapsed() ? getLinks$1(editor.dom.getParents(editor.selection.getStart())) : getLinksInSelection(editor.selection.getRng());
|
||||
return links.length === 1;
|
||||
};
|
||||
const toggleEnabledState = editor => api => {
|
||||
const updateState = () => api.setEnabled(isInAnchor(editor, editor.selection.getNode()));
|
||||
const updateState = () => api.setEnabled(hasExactlyOneLinkInSelection(editor));
|
||||
updateState();
|
||||
return toggleState(editor, updateState);
|
||||
};
|
||||
@@ -1107,7 +1113,15 @@
|
||||
const setupContextMenu = editor => {
|
||||
const inLink = 'link unlink openlink';
|
||||
const noLink = 'link';
|
||||
editor.ui.registry.addContextMenu('link', { update: element => hasLinks(editor.dom.getParents(element, 'a')) ? inLink : noLink });
|
||||
editor.ui.registry.addContextMenu('link', {
|
||||
update: element => {
|
||||
const isEditable = editor.dom.isEditable(element);
|
||||
if (!isEditable) {
|
||||
return '';
|
||||
}
|
||||
return hasLinks(editor.dom.getParents(element, 'a')) ? inLink : noLink;
|
||||
}
|
||||
});
|
||||
};
|
||||
const setupContextToolbars = editor => {
|
||||
const collapseSelectionToEnd = editor => {
|
||||
@@ -1123,7 +1137,7 @@
|
||||
const onlyText = isOnlyTextSelected(editor);
|
||||
if (anchor.isNone() && onlyText) {
|
||||
const text = getAnchorText(editor.selection, anchor);
|
||||
return Optional.some(text.length > 0 ? text : value);
|
||||
return someIf(text.length === 0, value);
|
||||
} else {
|
||||
return Optional.none();
|
||||
}
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
+132
-50
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var global$6 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
var global$7 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
const hasProto = (v, constructor, predicate) => {
|
||||
var _a;
|
||||
@@ -423,11 +423,11 @@
|
||||
}
|
||||
};
|
||||
|
||||
var global$5 = tinymce.util.Tools.resolve('tinymce.dom.RangeUtils');
|
||||
var global$6 = tinymce.util.Tools.resolve('tinymce.dom.RangeUtils');
|
||||
|
||||
var global$4 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker');
|
||||
var global$5 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker');
|
||||
|
||||
var global$3 = tinymce.util.Tools.resolve('tinymce.util.VK');
|
||||
var global$4 = tinymce.util.Tools.resolve('tinymce.util.VK');
|
||||
|
||||
const fromDom = nodes => map(nodes, SugarElement.fromDom);
|
||||
|
||||
@@ -490,13 +490,13 @@
|
||||
return nu;
|
||||
};
|
||||
|
||||
var global$2 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
||||
var global$3 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
const matchNodeName = name => node => isNonNullable(node) && node.nodeName.toLowerCase() === name;
|
||||
const matchNodeNames = regex => node => isNonNullable(node) && regex.test(node.nodeName);
|
||||
const isTextNode = node => isNonNullable(node) && node.nodeType === 3;
|
||||
const isTextNode$1 = node => isNonNullable(node) && node.nodeType === 3;
|
||||
const isElement = node => isNonNullable(node) && node.nodeType === 1;
|
||||
const isListNode = matchNodeNames(/^(OL|UL|DL)$/);
|
||||
const isOlUlNode = matchNodeNames(/^(OL|UL)$/);
|
||||
@@ -511,13 +511,14 @@
|
||||
};
|
||||
const isTextBlock = (editor, node) => isNonNullable(node) && node.nodeName in editor.schema.getTextBlockElements();
|
||||
const isBlock = (node, blockElements) => isNonNullable(node) && node.nodeName in blockElements;
|
||||
const isVoid = (editor, node) => isNonNullable(node) && node.nodeName in editor.schema.getVoidElements();
|
||||
const isBogusBr = (dom, node) => {
|
||||
if (!isBr(node)) {
|
||||
return false;
|
||||
}
|
||||
return dom.isBlock(node.nextSibling) && !isBr(node.previousSibling);
|
||||
};
|
||||
const isEmpty$1 = (dom, elm, keepBookmarks) => {
|
||||
const isEmpty$2 = (dom, elm, keepBookmarks) => {
|
||||
const empty = dom.isEmpty(elm);
|
||||
if (keepBookmarks && dom.select('span[data-mce-type=bookmark]', elm).length > 0) {
|
||||
return false;
|
||||
@@ -573,12 +574,12 @@
|
||||
return fragment;
|
||||
};
|
||||
|
||||
const DOM$2 = global$2.DOM;
|
||||
const DOM$2 = global$3.DOM;
|
||||
const splitList = (editor, list, li) => {
|
||||
const removeAndKeepBookmarks = targetNode => {
|
||||
const parent = targetNode.parentNode;
|
||||
if (parent) {
|
||||
global$1.each(bookmarks, node => {
|
||||
global$2.each(bookmarks, node => {
|
||||
parent.insertBefore(node, li.parentNode);
|
||||
});
|
||||
}
|
||||
@@ -601,11 +602,11 @@
|
||||
}
|
||||
DOM$2.insertAfter(newBlock, list);
|
||||
const parent = li.parentElement;
|
||||
if (parent && isEmpty$1(editor.dom, parent)) {
|
||||
if (parent && isEmpty$2(editor.dom, parent)) {
|
||||
removeAndKeepBookmarks(parent);
|
||||
}
|
||||
DOM$2.remove(li);
|
||||
if (isEmpty$1(editor.dom, list)) {
|
||||
if (isEmpty$2(editor.dom, list)) {
|
||||
DOM$2.remove(list);
|
||||
}
|
||||
};
|
||||
@@ -633,24 +634,24 @@
|
||||
};
|
||||
|
||||
const getNormalizedPoint = (container, offset) => {
|
||||
if (isTextNode(container)) {
|
||||
if (isTextNode$1(container)) {
|
||||
return {
|
||||
container,
|
||||
offset
|
||||
};
|
||||
}
|
||||
const node = global$5.getNode(container, offset);
|
||||
if (isTextNode(node)) {
|
||||
const node = global$6.getNode(container, offset);
|
||||
if (isTextNode$1(node)) {
|
||||
return {
|
||||
container: node,
|
||||
offset: offset >= container.childNodes.length ? node.data.length : 0
|
||||
};
|
||||
} else if (node.previousSibling && isTextNode(node.previousSibling)) {
|
||||
} else if (node.previousSibling && isTextNode$1(node.previousSibling)) {
|
||||
return {
|
||||
container: node.previousSibling,
|
||||
offset: node.previousSibling.data.length
|
||||
};
|
||||
} else if (node.nextSibling && isTextNode(node.nextSibling)) {
|
||||
} else if (node.nextSibling && isTextNode$1(node.nextSibling)) {
|
||||
return {
|
||||
container: node.nextSibling,
|
||||
offset: 0
|
||||
@@ -694,7 +695,7 @@
|
||||
}
|
||||
};
|
||||
const findParentListItemsNodes = (editor, elms) => {
|
||||
const listItemsElms = global$1.map(elms, elm => {
|
||||
const listItemsElms = global$2.map(elms, elm => {
|
||||
const parentLi = editor.dom.getParent(elm, 'li,dd,dt', getClosestListHost(editor, elm));
|
||||
return parentLi ? parentLi : elm;
|
||||
});
|
||||
@@ -735,7 +736,7 @@
|
||||
|
||||
const isCustomList = list => /\btox\-/.test(list.className);
|
||||
const inList = (parents, listName) => findUntil(parents, isListNode, isTableCellNode).exists(list => list.nodeName === listName && !isCustomList(list));
|
||||
const isWithinNonEditable = (editor, element) => element !== null && editor.dom.getContentEditableParent(element) === 'false';
|
||||
const isWithinNonEditable = (editor, element) => element !== null && !editor.dom.isEditable(element);
|
||||
const selectionIsWithinNonEditableList = editor => {
|
||||
const parentList = getParentList(editor);
|
||||
return isWithinNonEditable(editor, parentList);
|
||||
@@ -744,6 +745,7 @@
|
||||
const parentList = editor.dom.getParent(element, 'ol,ul,dl');
|
||||
return isWithinNonEditable(editor, parentList);
|
||||
};
|
||||
const hasNonEditableBlocksSelected = editor => exists(editor.selection.getSelectedBlocks(), not(editor.dom.isEditable));
|
||||
const setNodeChangeHandler = (editor, nodeChangeHandler) => {
|
||||
const initialNode = editor.selection.getNode();
|
||||
nodeChangeHandler({
|
||||
@@ -771,7 +773,7 @@
|
||||
const blank = r => s => s.replace(r, '');
|
||||
const trim = blank(/^\s+|\s+$/g);
|
||||
const isNotEmpty = s => s.length > 0;
|
||||
const isEmpty = s => !isNotEmpty(s);
|
||||
const isEmpty$1 = s => !isNotEmpty(s);
|
||||
|
||||
const isSupported = dom => dom.style !== undefined && isFunction(dom.style.getPropertyValue);
|
||||
|
||||
@@ -1024,9 +1026,12 @@
|
||||
const outdentListSelection = editor => handleIndentation(editor, 'Outdent');
|
||||
const flattenListSelection = editor => handleIndentation(editor, 'Flatten');
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.dom.BookmarkManager');
|
||||
const zeroWidth = '\uFEFF';
|
||||
const isZwsp = char => char === zeroWidth;
|
||||
|
||||
const DOM$1 = global$2.DOM;
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.BookmarkManager');
|
||||
|
||||
const DOM$1 = global$3.DOM;
|
||||
const createBookmark = rng => {
|
||||
const bookmark = {};
|
||||
const setupEndPoint = start => {
|
||||
@@ -1116,13 +1121,13 @@
|
||||
dom.setStyle(el, 'list-style-type', type);
|
||||
};
|
||||
const setAttribs = (elm, attrs) => {
|
||||
global$1.each(attrs, (value, key) => {
|
||||
global$2.each(attrs, (value, key) => {
|
||||
elm.setAttribute(key, value);
|
||||
});
|
||||
};
|
||||
const updateListAttrs = (dom, el, detail) => {
|
||||
setAttribs(el, detail['list-attributes']);
|
||||
global$1.each(dom.select('li', el), li => {
|
||||
global$2.each(dom.select('li', el), li => {
|
||||
setAttribs(li, detail['list-item-attributes']);
|
||||
});
|
||||
};
|
||||
@@ -1131,8 +1136,9 @@
|
||||
updateListAttrs(dom, el, detail);
|
||||
};
|
||||
const removeStyles = (dom, element, styles) => {
|
||||
global$1.each(styles, style => dom.setStyle(element, style, ''));
|
||||
global$2.each(styles, style => dom.setStyle(element, style, ''));
|
||||
};
|
||||
const isInline = (editor, node) => isNonNullable(node) && !isBlock(node, editor.schema.getBlockElements());
|
||||
const getEndPointNode = (editor, rng, start, root) => {
|
||||
let container = rng[start ? 'startContainer' : 'endContainer'];
|
||||
const offset = rng[start ? 'startOffset' : 'endOffset'];
|
||||
@@ -1142,6 +1148,42 @@
|
||||
if (!start && isBr(container.nextSibling)) {
|
||||
container = container.nextSibling;
|
||||
}
|
||||
const findBetterContainer = (container, forward) => {
|
||||
var _a;
|
||||
const walker = new global$5(container, root);
|
||||
const dir = forward ? 'next' : 'prev';
|
||||
let node;
|
||||
while (node = walker[dir]()) {
|
||||
if (!(isVoid(editor, node) || isZwsp(node.textContent) || ((_a = node.textContent) === null || _a === void 0 ? void 0 : _a.length) === 0)) {
|
||||
return Optional.some(node);
|
||||
}
|
||||
}
|
||||
return Optional.none();
|
||||
};
|
||||
if (start && isTextNode$1(container)) {
|
||||
if (isZwsp(container.textContent)) {
|
||||
container = findBetterContainer(container, false).getOr(container);
|
||||
} else {
|
||||
if (container.parentNode !== null && isInline(editor, container.parentNode)) {
|
||||
container = container.parentNode;
|
||||
}
|
||||
while (container.previousSibling !== null && (isInline(editor, container.previousSibling) || isTextNode$1(container.previousSibling))) {
|
||||
container = container.previousSibling;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!start && isTextNode$1(container)) {
|
||||
if (isZwsp(container.textContent)) {
|
||||
container = findBetterContainer(container, true).getOr(container);
|
||||
} else {
|
||||
if (container.parentNode !== null && isInline(editor, container.parentNode)) {
|
||||
container = container.parentNode;
|
||||
}
|
||||
while (container.nextSibling !== null && (isInline(editor, container.nextSibling) || isTextNode$1(container.nextSibling))) {
|
||||
container = container.nextSibling;
|
||||
}
|
||||
}
|
||||
}
|
||||
while (container.parentNode !== root) {
|
||||
const parent = container.parentNode;
|
||||
if (isTextBlock(editor, container)) {
|
||||
@@ -1167,7 +1209,7 @@
|
||||
break;
|
||||
}
|
||||
}
|
||||
global$1.each(siblings, node => {
|
||||
global$2.each(siblings, node => {
|
||||
var _a;
|
||||
if (isTextBlock(editor, node)) {
|
||||
textBlocks.push(node);
|
||||
@@ -1182,7 +1224,7 @@
|
||||
return;
|
||||
}
|
||||
const nextSibling = node.nextSibling;
|
||||
if (global.isBookmarkNode(node)) {
|
||||
if (global$1.isBookmarkNode(node)) {
|
||||
if (isListNode(nextSibling) || isTextBlock(editor, nextSibling) || !nextSibling && node.parentNode === root) {
|
||||
block = null;
|
||||
return;
|
||||
@@ -1217,7 +1259,7 @@
|
||||
}
|
||||
const bookmark = createBookmark(rng);
|
||||
const selectedTextBlocks = getSelectedTextBlocks(editor, rng, root);
|
||||
global$1.each(selectedTextBlocks, block => {
|
||||
global$2.each(selectedTextBlocks, block => {
|
||||
let listBlock;
|
||||
const sibling = block.previousSibling;
|
||||
const parent = block.parentNode;
|
||||
@@ -1304,7 +1346,7 @@
|
||||
parentList,
|
||||
...lists
|
||||
] : lists;
|
||||
global$1.each(allLists, elm => {
|
||||
global$2.each(allLists, elm => {
|
||||
updateList$1(editor, elm, listName, detail);
|
||||
});
|
||||
editor.selection.setRng(resolveBookmark(bookmark));
|
||||
@@ -1336,7 +1378,7 @@
|
||||
};
|
||||
const toggleList = (editor, listName, _detail) => {
|
||||
const parentList = getParentList(editor);
|
||||
if (isWithinNonEditableList(editor, parentList)) {
|
||||
if (isWithinNonEditableList(editor, parentList) || hasNonEditableBlocksSelected(editor)) {
|
||||
return;
|
||||
}
|
||||
const selectedSubLists = getSelectedSubLists(editor);
|
||||
@@ -1348,14 +1390,14 @@
|
||||
}
|
||||
};
|
||||
|
||||
const DOM = global$2.DOM;
|
||||
const DOM = global$3.DOM;
|
||||
const normalizeList = (dom, list) => {
|
||||
const parentNode = list.parentElement;
|
||||
if (parentNode && parentNode.nodeName === 'LI' && parentNode.firstChild === list) {
|
||||
const sibling = parentNode.previousSibling;
|
||||
if (sibling && sibling.nodeName === 'LI') {
|
||||
sibling.appendChild(list);
|
||||
if (isEmpty$1(dom, parentNode)) {
|
||||
if (isEmpty$2(dom, parentNode)) {
|
||||
DOM.remove(parentNode);
|
||||
}
|
||||
} else {
|
||||
@@ -1370,8 +1412,8 @@
|
||||
}
|
||||
};
|
||||
const normalizeLists = (dom, element) => {
|
||||
const lists = global$1.grep(dom.select('ol,ul', element));
|
||||
global$1.each(lists, list => {
|
||||
const lists = global$2.grep(dom.select('ol,ul', element));
|
||||
global$2.each(lists, list => {
|
||||
normalizeList(dom, list);
|
||||
});
|
||||
};
|
||||
@@ -1379,14 +1421,14 @@
|
||||
const findNextCaretContainer = (editor, rng, isForward, root) => {
|
||||
let node = rng.startContainer;
|
||||
const offset = rng.startOffset;
|
||||
if (isTextNode(node) && (isForward ? offset < node.data.length : offset > 0)) {
|
||||
if (isTextNode$1(node) && (isForward ? offset < node.data.length : offset > 0)) {
|
||||
return node;
|
||||
}
|
||||
const nonEmptyBlocks = editor.schema.getNonEmptyElements();
|
||||
if (isElement(node)) {
|
||||
node = global$5.getNode(node, offset);
|
||||
node = global$6.getNode(node, offset);
|
||||
}
|
||||
const walker = new global$4(node, root);
|
||||
const walker = new global$5(node, root);
|
||||
if (isForward) {
|
||||
if (isBogusBr(editor.dom, node)) {
|
||||
walker.next();
|
||||
@@ -1400,7 +1442,7 @@
|
||||
if (nonEmptyBlocks[node.nodeName]) {
|
||||
return node;
|
||||
}
|
||||
if (isTextNode(node) && node.data.length > 0) {
|
||||
if (isTextNode$1(node) && node.data.length > 0) {
|
||||
return node;
|
||||
}
|
||||
}
|
||||
@@ -1419,7 +1461,7 @@
|
||||
let node;
|
||||
const targetElm = hasOnlyOneBlockChild(dom, toElm) ? toElm.firstChild : toElm;
|
||||
unwrapSingleBlockChild(dom, fromElm);
|
||||
if (!isEmpty$1(dom, fromElm, true)) {
|
||||
if (!isEmpty$2(dom, fromElm, true)) {
|
||||
while (node = fromElm.firstChild) {
|
||||
targetElm.appendChild(node);
|
||||
}
|
||||
@@ -1443,7 +1485,7 @@
|
||||
if (node && isBr(node) && fromElm.hasChildNodes()) {
|
||||
dom.remove(node);
|
||||
}
|
||||
if (isEmpty$1(dom, toElm, true)) {
|
||||
if (isEmpty$2(dom, toElm, true)) {
|
||||
empty(SugarElement.fromDom(toElm));
|
||||
}
|
||||
moveChildren(dom, fromElm, toElm);
|
||||
@@ -1454,7 +1496,7 @@
|
||||
const nestedLists = contains$1 ? dom.getParents(fromElm, isListNode, toElm) : [];
|
||||
dom.remove(fromElm);
|
||||
each$1(nestedLists, list => {
|
||||
if (isEmpty$1(dom, list) && list !== dom.getRoot()) {
|
||||
if (isEmpty$2(dom, list) && list !== dom.getRoot()) {
|
||||
dom.remove(list);
|
||||
}
|
||||
});
|
||||
@@ -1487,7 +1529,7 @@
|
||||
const li = dom.getParent(selection.getStart(), 'LI', root);
|
||||
if (li) {
|
||||
const ul = li.parentElement;
|
||||
if (ul === editor.getBody() && isEmpty$1(dom, ul)) {
|
||||
if (ul === editor.getBody() && isEmpty$2(dom, ul)) {
|
||||
return true;
|
||||
}
|
||||
const rng = normalizeRange(selection.getRng());
|
||||
@@ -1577,7 +1619,7 @@
|
||||
const selection = editor.selection;
|
||||
return !isWithinNonEditableList(editor, selection.getNode()) && (selection.isCollapsed() ? backspaceDeleteCaret(editor, isForward) : backspaceDeleteRange(editor));
|
||||
};
|
||||
const setup$1 = editor => {
|
||||
const setup$2 = editor => {
|
||||
editor.on('ExecCommand', e => {
|
||||
const cmd = e.command.toLowerCase();
|
||||
if ((cmd === 'delete' || cmd === 'forwarddelete') && hasListSelection(editor)) {
|
||||
@@ -1585,11 +1627,11 @@
|
||||
}
|
||||
});
|
||||
editor.on('keydown', e => {
|
||||
if (e.keyCode === global$3.BACKSPACE) {
|
||||
if (e.keyCode === global$4.BACKSPACE) {
|
||||
if (backspaceDelete(editor, false)) {
|
||||
e.preventDefault();
|
||||
}
|
||||
} else if (e.keyCode === global$3.DELETE) {
|
||||
} else if (e.keyCode === global$4.DELETE) {
|
||||
if (backspaceDelete(editor, true)) {
|
||||
e.preventDefault();
|
||||
}
|
||||
@@ -1648,7 +1690,7 @@
|
||||
return 0;
|
||||
} else if (isLowercase(start)) {
|
||||
return 1;
|
||||
} else if (isEmpty(start)) {
|
||||
} else if (isEmpty$1(start)) {
|
||||
return 3;
|
||||
} else {
|
||||
return 4;
|
||||
@@ -1780,9 +1822,48 @@
|
||||
editor.addQueryStateHandler('InsertDefinitionList', queryListCommandState(editor, 'DL'));
|
||||
};
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.html.Node');
|
||||
|
||||
const isTextNode = node => node.type === 3;
|
||||
const isEmpty = nodeBuffer => nodeBuffer.length === 0;
|
||||
const wrapInvalidChildren = list => {
|
||||
const insertListItem = (buffer, refNode) => {
|
||||
const li = global.create('li');
|
||||
each$1(buffer, node => li.append(node));
|
||||
if (refNode) {
|
||||
list.insert(li, refNode, true);
|
||||
} else {
|
||||
list.append(li);
|
||||
}
|
||||
};
|
||||
const reducer = (buffer, node) => {
|
||||
if (isTextNode(node)) {
|
||||
return [
|
||||
...buffer,
|
||||
node
|
||||
];
|
||||
} else if (!isEmpty(buffer) && !isTextNode(node)) {
|
||||
insertListItem(buffer, node);
|
||||
return [];
|
||||
} else {
|
||||
return buffer;
|
||||
}
|
||||
};
|
||||
const restBuffer = foldl(list.children(), reducer, []);
|
||||
if (!isEmpty(restBuffer)) {
|
||||
insertListItem(restBuffer);
|
||||
}
|
||||
};
|
||||
const setup$1 = editor => {
|
||||
editor.on('PreInit', () => {
|
||||
const {parser} = editor;
|
||||
parser.addNodeFilter('ul,ol', nodes => each$1(nodes, wrapInvalidChildren));
|
||||
});
|
||||
};
|
||||
|
||||
const setupTabKey = editor => {
|
||||
editor.on('keydown', e => {
|
||||
if (e.keyCode !== global$3.TAB || global$3.metaKeyPressed(e)) {
|
||||
if (e.keyCode !== global$4.TAB || global$4.metaKeyPressed(e)) {
|
||||
return;
|
||||
}
|
||||
editor.undoManager.transact(() => {
|
||||
@@ -1796,7 +1877,7 @@
|
||||
if (shouldIndentOnTab(editor)) {
|
||||
setupTabKey(editor);
|
||||
}
|
||||
setup$1(editor);
|
||||
setup$2(editor);
|
||||
};
|
||||
|
||||
const setupToggleButtonHandler = (editor, listName) => api => {
|
||||
@@ -1847,8 +1928,9 @@
|
||||
};
|
||||
|
||||
var Plugin = () => {
|
||||
global$6.add('lists', editor => {
|
||||
global$7.add('lists', editor => {
|
||||
register$3(editor);
|
||||
setup$1(editor);
|
||||
if (!editor.hasPlugin('rtc', true)) {
|
||||
setup(editor);
|
||||
register$2(editor);
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
+7
-2
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -1051,8 +1051,13 @@
|
||||
};
|
||||
|
||||
const parseAndSanitize = (editor, context, html) => {
|
||||
const getEditorOption = editor.options.get;
|
||||
const sanitize = getEditorOption('xss_sanitization');
|
||||
const validate = shouldFilterHtml(editor);
|
||||
return Parser(editor.schema, { validate }).parse(html, { context });
|
||||
return Parser(editor.schema, {
|
||||
sanitize,
|
||||
validate
|
||||
}).parse(html, { context });
|
||||
};
|
||||
|
||||
const setup$1 = editor => {
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=n=>e=>typeof e===n,a=e("boolean"),o=e("number"),t=n=>e=>e.options.get(n),i=t("nonbreaking_force_tab"),r=t("nonbreaking_wrap"),s=(n,e)=>{let a="";for(let o=0;o<e;o++)a+=n;return a},c=(n,e)=>{const a=r(n)||n.plugins.visualchars?`<span class="${(n=>!!n.plugins.visualchars&&n.plugins.visualchars.isEnabled())(n)?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap"}" contenteditable="false">${s(" ",e)}</span>`:s(" ",e);n.undoManager.transact((()=>n.insertContent(a)))};var l=tinymce.util.Tools.resolve("tinymce.util.VK");n.add("nonbreaking",(n=>{(n=>{const e=n.options.register;e("nonbreaking_force_tab",{processor:n=>a(n)?{value:n?3:0,valid:!0}:o(n)?{value:n,valid:!0}:{valid:!1,message:"Must be a boolean or number."},default:!1}),e("nonbreaking_wrap",{processor:"boolean",default:!0})})(n),(n=>{n.addCommand("mceNonBreaking",(()=>{c(n,1)}))})(n),(n=>{const e=()=>n.execCommand("mceNonBreaking");n.ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:e}),n.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:e})})(n),(n=>{const e=i(n);e>0&&n.on("keydown",(a=>{if(a.keyCode===l.TAB&&!a.isDefaultPrevented()){if(a.shiftKey)return;a.preventDefault(),a.stopImmediatePropagation(),c(n,e)}}))})(n)}))}();
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.Env");const t=e=>a=>a.options.get(e),r=t("pagebreak_separator"),n=t("pagebreak_split_block"),o="mce-pagebreak",s=e=>{const t=`<img src="${a.transparentSrc}" class="mce-pagebreak" data-mce-resize="false" data-mce-placeholder />`;return e?`<p>${t}</p>`:t};e.add("pagebreak",(e=>{(e=>{const a=e.options.register;a("pagebreak_separator",{processor:"string",default:"\x3c!-- pagebreak --\x3e"}),a("pagebreak_split_block",{processor:"boolean",default:!1})})(e),(e=>{e.addCommand("mcePageBreak",(()=>{e.insertContent(s(n(e)))}))})(e),(e=>{const a=()=>e.execCommand("mcePageBreak");e.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:a}),e.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:a})})(e),(e=>{const a=r(e),t=()=>n(e),c=new RegExp(a.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,(e=>"\\"+e)),"gi");e.on("BeforeSetContent",(e=>{e.content=e.content.replace(c,s(t()))})),e.on("PreInit",(()=>{e.serializer.addNodeFilter("img",(r=>{let n,s,c=r.length;for(;c--;)if(n=r[c],s=n.attr("class"),s&&-1!==s.indexOf(o)){const r=n.parent;if(r&&e.schema.getBlockElements()[r.name]&&t()){r.type=3,r.value=a,r.raw=!0,n.remove();continue}n.type=3,n.value=a,n.raw=!0}}))}))})(e),(e=>{e.on("ResolveName",(a=>{"IMG"===a.target.nodeName&&e.dom.hasClass(a.target,o)&&(a.name="pagebreak")}))})(e)}))}();
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),o=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=e=>t=>t.options.get(e),i=n("content_style"),s=n("content_css_cors"),c=n("body_class"),r=n("body_id");e.add("preview",(e=>{(e=>{e.addCommand("mcePreview",(()=>{(e=>{const n=(e=>{var n;let l="";const a=e.dom.encode,d=null!==(n=i(e))&&void 0!==n?n:"";l+='<base href="'+a(e.documentBaseURI.getURI())+'">';const m=s(e)?' crossorigin="anonymous"':"";o.each(e.contentCSS,(t=>{l+='<link type="text/css" rel="stylesheet" href="'+a(e.documentBaseURI.toAbsolute(t))+'"'+m+">"})),d&&(l+='<style type="text/css">'+d+"</style>");const y=r(e),u=c(e),v='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(t.os.isMacOS()||t.os.isiOS()?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",p=e.getBody().dir,w=p?' dir="'+a(p)+'"':"";return"<!DOCTYPE html><html><head>"+l+'</head><body id="'+a(y)+'" class="mce-content-body '+a(u)+'"'+w+">"+e.getContent()+v+"</body></html>"})(e);e.windowManager.open({title:"Preview",size:"large",body:{type:"panel",items:[{name:"preview",type:"iframe",sandboxed:!0,transparent:!1}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{preview:n}}).focus("close")})(e)}))})(e),(e=>{const t=()=>e.execCommand("mcePreview");e.ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:t}),e.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:t})})(e)}))}();
|
||||
+22
-14
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var global$2 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
const hasProto = (v, constructor, predicate) => {
|
||||
var _a;
|
||||
@@ -111,11 +111,10 @@
|
||||
});
|
||||
};
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.util.Delay');
|
||||
|
||||
const pickFile = editor => new Promise(resolve => {
|
||||
let resolved = false;
|
||||
const fileInput = document.createElement('input');
|
||||
fileInput.type = 'file';
|
||||
fileInput.accept = 'image/*';
|
||||
@@ -124,20 +123,29 @@
|
||||
fileInput.style.top = '0';
|
||||
fileInput.style.opacity = '0.001';
|
||||
document.body.appendChild(fileInput);
|
||||
const changeHandler = e => {
|
||||
resolve(Array.prototype.slice.call(e.target.files));
|
||||
const resolveFileInput = value => {
|
||||
var _a;
|
||||
if (!resolved) {
|
||||
(_a = fileInput.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(fileInput);
|
||||
resolved = true;
|
||||
resolve(value);
|
||||
}
|
||||
};
|
||||
const changeHandler = e => {
|
||||
resolveFileInput(Array.prototype.slice.call(e.target.files));
|
||||
};
|
||||
fileInput.addEventListener('input', changeHandler);
|
||||
fileInput.addEventListener('change', changeHandler);
|
||||
const cancelHandler = e => {
|
||||
const cleanup = () => {
|
||||
var _a;
|
||||
resolve([]);
|
||||
(_a = fileInput.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(fileInput);
|
||||
resolveFileInput([]);
|
||||
};
|
||||
if (global$1.os.isAndroid() && e.type !== 'remove') {
|
||||
global.setEditorTimeout(editor, cleanup, 0);
|
||||
} else {
|
||||
cleanup();
|
||||
if (!resolved) {
|
||||
if (e.type === 'focusin') {
|
||||
global.setEditorTimeout(editor, cleanup, 1000);
|
||||
} else {
|
||||
cleanup();
|
||||
}
|
||||
}
|
||||
editor.off('focusin remove', cancelHandler);
|
||||
};
|
||||
@@ -416,7 +424,7 @@
|
||||
};
|
||||
|
||||
var Plugin = () => {
|
||||
global$2.add('quickbars', editor => {
|
||||
global$1.add('quickbars', editor => {
|
||||
register(editor);
|
||||
setupButtons(editor);
|
||||
addToEditor$1(editor);
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.1 (2022-12-06)
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
*/
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const n=("function",e=>"function"==typeof e);var o=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),t=tinymce.util.Tools.resolve("tinymce.util.Tools");const a=e=>n=>n.options.get(e),c=a("save_enablewhendirty"),i=a("save_onsavecallback"),s=a("save_oncancelcallback"),r=(e,n)=>{e.notificationManager.open({text:n,type:"error"})},l=e=>n=>{const o=()=>{n.setEnabled(!c(e)||e.isDirty())};return o(),e.on("NodeChange dirty",o),()=>e.off("NodeChange dirty",o)};e.add("save",(e=>{(e=>{const n=e.options.register;n("save_enablewhendirty",{processor:"boolean",default:!0}),n("save_onsavecallback",{processor:"function"}),n("save_oncancelcallback",{processor:"function"})})(e),(e=>{e.ui.registry.addButton("save",{icon:"save",tooltip:"Save",enabled:!1,onAction:()=>e.execCommand("mceSave"),onSetup:l(e)}),e.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",enabled:!1,onAction:()=>e.execCommand("mceCancel"),onSetup:l(e)}),e.addShortcut("Meta+S","","mceSave")})(e),(e=>{e.addCommand("mceSave",(()=>{(e=>{const t=o.DOM.getParent(e.id,"form");if(c(e)&&!e.isDirty())return;e.save();const a=i(e);if(n(a))return a.call(e,e),void e.nodeChanged();t?(e.setDirty(!1),t.onsubmit&&!t.onsubmit()||("function"==typeof t.submit?t.submit():r(e,"Error: Form submit field collision.")),e.nodeChanged()):r(e,"Error: No form element found.")})(e)})),e.addCommand("mceCancel",(()=>{(e=>{const o=t.trim(e.startContent),a=s(e);n(a)?a.call(e,e):e.resetContent(o)})(e)}))})(e)}))}();
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user