Edit File by line
/home/barbar84/www/wp-inclu.../js/dist
File: components.js
additionalProps = Object(objectWithoutProperties["a" /* default */])(_ref, ["className", "isSelected", "selectedIconProps", "tooltipText"]);
[21500] Fix | Delete
[21501] Fix | Delete
var optionButton = Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({
[21502] Fix | Delete
isPressed: isSelected,
[21503] Fix | Delete
className: classnames_default()(className, 'components-circular-option-picker__option')
[21504] Fix | Delete
}, additionalProps));
[21505] Fix | Delete
return Object(external_wp_element_["createElement"])("div", {
[21506] Fix | Delete
className: "components-circular-option-picker__option-wrapper"
[21507] Fix | Delete
}, tooltipText ? Object(external_wp_element_["createElement"])(build_module_tooltip["a" /* default */], {
[21508] Fix | Delete
text: tooltipText
[21509] Fix | Delete
}, optionButton) : optionButton, isSelected && Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], Object(esm_extends["a" /* default */])({
[21510] Fix | Delete
icon: check["a" /* default */]
[21511] Fix | Delete
}, selectedIconProps ? selectedIconProps : {})));
[21512] Fix | Delete
}
[21513] Fix | Delete
[21514] Fix | Delete
function DropdownLinkAction(_ref2) {
[21515] Fix | Delete
var buttonProps = _ref2.buttonProps,
[21516] Fix | Delete
className = _ref2.className,
[21517] Fix | Delete
dropdownProps = _ref2.dropdownProps,
[21518] Fix | Delete
linkText = _ref2.linkText;
[21519] Fix | Delete
return Object(external_wp_element_["createElement"])(Dropdown, Object(esm_extends["a" /* default */])({
[21520] Fix | Delete
className: classnames_default()('components-circular-option-picker__dropdown-link-action', className),
[21521] Fix | Delete
renderToggle: function renderToggle(_ref3) {
[21522] Fix | Delete
var isOpen = _ref3.isOpen,
[21523] Fix | Delete
onToggle = _ref3.onToggle;
[21524] Fix | Delete
return Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({
[21525] Fix | Delete
"aria-expanded": isOpen,
[21526] Fix | Delete
"aria-haspopup": "true",
[21527] Fix | Delete
onClick: onToggle,
[21528] Fix | Delete
isLink: true
[21529] Fix | Delete
}, buttonProps), linkText);
[21530] Fix | Delete
}
[21531] Fix | Delete
}, dropdownProps));
[21532] Fix | Delete
}
[21533] Fix | Delete
[21534] Fix | Delete
function ButtonAction(_ref4) {
[21535] Fix | Delete
var className = _ref4.className,
[21536] Fix | Delete
children = _ref4.children,
[21537] Fix | Delete
additionalProps = Object(objectWithoutProperties["a" /* default */])(_ref4, ["className", "children"]);
[21538] Fix | Delete
[21539] Fix | Delete
return Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({
[21540] Fix | Delete
className: classnames_default()('components-circular-option-picker__clear', className),
[21541] Fix | Delete
isSmall: true,
[21542] Fix | Delete
isSecondary: true
[21543] Fix | Delete
}, additionalProps), children);
[21544] Fix | Delete
}
[21545] Fix | Delete
[21546] Fix | Delete
function CircularOptionPicker(_ref5) {
[21547] Fix | Delete
var actions = _ref5.actions,
[21548] Fix | Delete
className = _ref5.className,
[21549] Fix | Delete
options = _ref5.options,
[21550] Fix | Delete
children = _ref5.children;
[21551] Fix | Delete
return Object(external_wp_element_["createElement"])("div", {
[21552] Fix | Delete
className: classnames_default()('components-circular-option-picker', className)
[21553] Fix | Delete
}, Object(external_wp_element_["createElement"])("div", {
[21554] Fix | Delete
className: "components-circular-option-picker__swatches"
[21555] Fix | Delete
}, options), children, actions && Object(external_wp_element_["createElement"])("div", {
[21556] Fix | Delete
className: "components-circular-option-picker__custom-clear-wrapper"
[21557] Fix | Delete
}, actions));
[21558] Fix | Delete
}
[21559] Fix | Delete
CircularOptionPicker.Option = Option;
[21560] Fix | Delete
CircularOptionPicker.ButtonAction = ButtonAction;
[21561] Fix | Delete
CircularOptionPicker.DropdownLinkAction = DropdownLinkAction;
[21562] Fix | Delete
[21563] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
[21564] Fix | Delete
var classCallCheck = __webpack_require__("1OyB");
[21565] Fix | Delete
[21566] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
[21567] Fix | Delete
var createClass = __webpack_require__("vuIU");
[21568] Fix | Delete
[21569] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
[21570] Fix | Delete
var assertThisInitialized = __webpack_require__("JX7q");
[21571] Fix | Delete
[21572] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
[21573] Fix | Delete
var inherits = __webpack_require__("Ji7U");
[21574] Fix | Delete
[21575] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
[21576] Fix | Delete
var possibleConstructorReturn = __webpack_require__("md7G");
[21577] Fix | Delete
[21578] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
[21579] Fix | Delete
var getPrototypeOf = __webpack_require__("foSv");
[21580] Fix | Delete
[21581] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/utils.js
[21582] Fix | Delete
/**
[21583] Fix | Delete
* Parts of this source were derived and modified from react-color,
[21584] Fix | Delete
* released under the MIT license.
[21585] Fix | Delete
*
[21586] Fix | Delete
* https://github.com/casesandberg/react-color/
[21587] Fix | Delete
*
[21588] Fix | Delete
* Copyright (c) 2015 Case Sandberg
[21589] Fix | Delete
*
[21590] Fix | Delete
* Permission is hereby granted, free of charge, to any person obtaining a copy
[21591] Fix | Delete
* of this software and associated documentation files (the "Software"), to deal
[21592] Fix | Delete
* in the Software without restriction, including without limitation the rights
[21593] Fix | Delete
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
[21594] Fix | Delete
* copies of the Software, and to permit persons to whom the Software is
[21595] Fix | Delete
* furnished to do so, subject to the following conditions:
[21596] Fix | Delete
*
[21597] Fix | Delete
* The above copyright notice and this permission notice shall be included in
[21598] Fix | Delete
* all copies or substantial portions of the Software.
[21599] Fix | Delete
*
[21600] Fix | Delete
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
[21601] Fix | Delete
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
[21602] Fix | Delete
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
[21603] Fix | Delete
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
[21604] Fix | Delete
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
[21605] Fix | Delete
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
[21606] Fix | Delete
* THE SOFTWARE.
[21607] Fix | Delete
*/
[21608] Fix | Delete
[21609] Fix | Delete
/**
[21610] Fix | Delete
* External dependencies
[21611] Fix | Delete
*/
[21612] Fix | Delete
[21613] Fix | Delete
[21614] Fix | Delete
/**
[21615] Fix | Delete
* Given a hex color, get all other color properties (rgb, alpha, etc).
[21616] Fix | Delete
*
[21617] Fix | Delete
* @param {Object|string} data A hex color string or an object with a hex property
[21618] Fix | Delete
* @param {string} oldHue A reference to the hue of the previous color, otherwise dragging the saturation to zero will reset the current hue to zero as well. See https://github.com/casesandberg/react-color/issues/29#issuecomment-132686909.
[21619] Fix | Delete
* @return {Object} An object of different color representations.
[21620] Fix | Delete
*/
[21621] Fix | Delete
[21622] Fix | Delete
function colorToState() {
[21623] Fix | Delete
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
[21624] Fix | Delete
var oldHue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
[21625] Fix | Delete
var color = data.hex ? tinycolor_default()(data.hex) : tinycolor_default()(data);
[21626] Fix | Delete
var hsl = color.toHsl();
[21627] Fix | Delete
hsl.h = Math.round(hsl.h);
[21628] Fix | Delete
hsl.s = Math.round(hsl.s * 100);
[21629] Fix | Delete
hsl.l = Math.round(hsl.l * 100);
[21630] Fix | Delete
var hsv = color.toHsv();
[21631] Fix | Delete
hsv.h = Math.round(hsv.h);
[21632] Fix | Delete
hsv.s = Math.round(hsv.s * 100);
[21633] Fix | Delete
hsv.v = Math.round(hsv.v * 100);
[21634] Fix | Delete
var rgb = color.toRgb();
[21635] Fix | Delete
var hex = color.toHex();
[21636] Fix | Delete
[21637] Fix | Delete
if (hsl.s === 0) {
[21638] Fix | Delete
hsl.h = oldHue || 0;
[21639] Fix | Delete
hsv.h = oldHue || 0;
[21640] Fix | Delete
}
[21641] Fix | Delete
[21642] Fix | Delete
var transparent = hex === '000000' && rgb.a === 0;
[21643] Fix | Delete
return {
[21644] Fix | Delete
color: color,
[21645] Fix | Delete
hex: transparent ? 'transparent' : "#".concat(hex),
[21646] Fix | Delete
hsl: hsl,
[21647] Fix | Delete
hsv: hsv,
[21648] Fix | Delete
oldHue: data.h || oldHue || hsl.h,
[21649] Fix | Delete
rgb: rgb,
[21650] Fix | Delete
source: data.source
[21651] Fix | Delete
};
[21652] Fix | Delete
}
[21653] Fix | Delete
/**
[21654] Fix | Delete
* Get the top/left offsets of a point in a container, also returns the container width/height.
[21655] Fix | Delete
*
[21656] Fix | Delete
* @param {Event} e Mouse or touch event with a location coordinate.
[21657] Fix | Delete
* @param {HTMLElement} container The container div, returned point is relative to this container.
[21658] Fix | Delete
* @return {Object} An object of the offset positions & container size.
[21659] Fix | Delete
*/
[21660] Fix | Delete
[21661] Fix | Delete
function getPointOffset(e, container) {
[21662] Fix | Delete
e.preventDefault();
[21663] Fix | Delete
[21664] Fix | Delete
var _container$getBoundin = container.getBoundingClientRect(),
[21665] Fix | Delete
containerLeft = _container$getBoundin.left,
[21666] Fix | Delete
containerTop = _container$getBoundin.top,
[21667] Fix | Delete
width = _container$getBoundin.width,
[21668] Fix | Delete
height = _container$getBoundin.height;
[21669] Fix | Delete
[21670] Fix | Delete
var x = typeof e.pageX === 'number' ? e.pageX : e.touches[0].pageX;
[21671] Fix | Delete
var y = typeof e.pageY === 'number' ? e.pageY : e.touches[0].pageY;
[21672] Fix | Delete
var left = x - (containerLeft + window.pageXOffset);
[21673] Fix | Delete
var top = y - (containerTop + window.pageYOffset);
[21674] Fix | Delete
[21675] Fix | Delete
if (left < 0) {
[21676] Fix | Delete
left = 0;
[21677] Fix | Delete
} else if (left > width) {
[21678] Fix | Delete
left = width;
[21679] Fix | Delete
} else if (top < 0) {
[21680] Fix | Delete
top = 0;
[21681] Fix | Delete
} else if (top > height) {
[21682] Fix | Delete
top = height;
[21683] Fix | Delete
}
[21684] Fix | Delete
[21685] Fix | Delete
return {
[21686] Fix | Delete
top: top,
[21687] Fix | Delete
left: left,
[21688] Fix | Delete
width: width,
[21689] Fix | Delete
height: height
[21690] Fix | Delete
};
[21691] Fix | Delete
}
[21692] Fix | Delete
/**
[21693] Fix | Delete
* Check if a string is a valid hex color code.
[21694] Fix | Delete
*
[21695] Fix | Delete
* @param {string} hex A possible hex color.
[21696] Fix | Delete
* @return {boolean} True if the color is a valid hex color.
[21697] Fix | Delete
*/
[21698] Fix | Delete
[21699] Fix | Delete
[21700] Fix | Delete
function isValidHex(hex) {
[21701] Fix | Delete
// disable hex4 and hex8
[21702] Fix | Delete
var lh = String(hex).charAt(0) === '#' ? 1 : 0;
[21703] Fix | Delete
return hex.length !== 4 + lh && hex.length < 7 + lh && tinycolor_default()(hex).isValid();
[21704] Fix | Delete
}
[21705] Fix | Delete
/**
[21706] Fix | Delete
* Check an object for any valid color properties.
[21707] Fix | Delete
*
[21708] Fix | Delete
* @param {Object} data A possible object representing a color.
[21709] Fix | Delete
* @return {Object|boolean} If a valid representation of color, returns the data object. Otherwise returns false.
[21710] Fix | Delete
*/
[21711] Fix | Delete
[21712] Fix | Delete
function simpleCheckForValidColor(data) {
[21713] Fix | Delete
var keysToCheck = ['r', 'g', 'b', 'a', 'h', 's', 'l', 'v'];
[21714] Fix | Delete
var checked = 0;
[21715] Fix | Delete
var passed = 0;
[21716] Fix | Delete
Object(external_lodash_["each"])(keysToCheck, function (letter) {
[21717] Fix | Delete
if (data[letter]) {
[21718] Fix | Delete
checked += 1;
[21719] Fix | Delete
[21720] Fix | Delete
if (!isNaN(data[letter])) {
[21721] Fix | Delete
passed += 1;
[21722] Fix | Delete
}
[21723] Fix | Delete
}
[21724] Fix | Delete
});
[21725] Fix | Delete
return checked === passed ? data : false;
[21726] Fix | Delete
}
[21727] Fix | Delete
/**
[21728] Fix | Delete
* Calculate the current alpha based on a mouse or touch event
[21729] Fix | Delete
*
[21730] Fix | Delete
* @param {Event} e A mouse or touch event on the alpha bar.
[21731] Fix | Delete
* @param {Object} props The current component props
[21732] Fix | Delete
* @param {HTMLElement} container The container div for the alpha bar graph.
[21733] Fix | Delete
* @return {Object|null} If the alpha value has changed, returns a new color object.
[21734] Fix | Delete
*/
[21735] Fix | Delete
[21736] Fix | Delete
function calculateAlphaChange(e, props, container) {
[21737] Fix | Delete
var _getPointOffset = getPointOffset(e, container),
[21738] Fix | Delete
left = _getPointOffset.left,
[21739] Fix | Delete
width = _getPointOffset.width;
[21740] Fix | Delete
[21741] Fix | Delete
var a = left < 0 ? 0 : Math.round(left * 100 / width) / 100;
[21742] Fix | Delete
[21743] Fix | Delete
if (props.hsl.a !== a) {
[21744] Fix | Delete
return {
[21745] Fix | Delete
h: props.hsl.h,
[21746] Fix | Delete
s: props.hsl.s,
[21747] Fix | Delete
l: props.hsl.l,
[21748] Fix | Delete
a: a,
[21749] Fix | Delete
source: 'rgb'
[21750] Fix | Delete
};
[21751] Fix | Delete
}
[21752] Fix | Delete
[21753] Fix | Delete
return null;
[21754] Fix | Delete
}
[21755] Fix | Delete
/**
[21756] Fix | Delete
* Calculate the current hue based on a mouse or touch event
[21757] Fix | Delete
*
[21758] Fix | Delete
* @param {Event} e A mouse or touch event on the hue bar.
[21759] Fix | Delete
* @param {Object} props The current component props
[21760] Fix | Delete
* @param {HTMLElement} container The container div for the hue bar graph.
[21761] Fix | Delete
* @return {Object|null} If the hue value has changed, returns a new color object.
[21762] Fix | Delete
*/
[21763] Fix | Delete
[21764] Fix | Delete
function calculateHueChange(e, props, container) {
[21765] Fix | Delete
var _getPointOffset2 = getPointOffset(e, container),
[21766] Fix | Delete
left = _getPointOffset2.left,
[21767] Fix | Delete
width = _getPointOffset2.width;
[21768] Fix | Delete
[21769] Fix | Delete
var percent = left * 100 / width;
[21770] Fix | Delete
var h = left >= width ? 359 : 360 * percent / 100;
[21771] Fix | Delete
[21772] Fix | Delete
if (props.hsl.h !== h) {
[21773] Fix | Delete
return {
[21774] Fix | Delete
h: h,
[21775] Fix | Delete
s: props.hsl.s,
[21776] Fix | Delete
l: props.hsl.l,
[21777] Fix | Delete
a: props.hsl.a,
[21778] Fix | Delete
source: 'rgb'
[21779] Fix | Delete
};
[21780] Fix | Delete
}
[21781] Fix | Delete
[21782] Fix | Delete
return null;
[21783] Fix | Delete
}
[21784] Fix | Delete
/**
[21785] Fix | Delete
* Calculate the current saturation & brightness based on a mouse or touch event
[21786] Fix | Delete
*
[21787] Fix | Delete
* @param {Event} e A mouse or touch event on the saturation graph.
[21788] Fix | Delete
* @param {Object} props The current component props
[21789] Fix | Delete
* @param {HTMLElement} container The container div for the 2D saturation graph.
[21790] Fix | Delete
* @return {Object} Returns a new color object.
[21791] Fix | Delete
*/
[21792] Fix | Delete
[21793] Fix | Delete
function calculateSaturationChange(e, props, container) {
[21794] Fix | Delete
var _getPointOffset3 = getPointOffset(e, container),
[21795] Fix | Delete
top = _getPointOffset3.top,
[21796] Fix | Delete
left = _getPointOffset3.left,
[21797] Fix | Delete
width = _getPointOffset3.width,
[21798] Fix | Delete
height = _getPointOffset3.height;
[21799] Fix | Delete
[21800] Fix | Delete
var saturation = left < 0 ? 0 : left * 100 / width;
[21801] Fix | Delete
var bright = top >= height ? 0 : -(top * 100 / height) + 100; // `v` values less than 1 are considered in the [0,1] range, causing unexpected behavior at the bottom
[21802] Fix | Delete
// of the chart. To fix this, we assume any value less than 1 should be 0 brightness.
[21803] Fix | Delete
[21804] Fix | Delete
if (bright < 1) {
[21805] Fix | Delete
bright = 0;
[21806] Fix | Delete
}
[21807] Fix | Delete
[21808] Fix | Delete
return {
[21809] Fix | Delete
h: props.hsl.h,
[21810] Fix | Delete
s: saturation,
[21811] Fix | Delete
v: bright,
[21812] Fix | Delete
a: props.hsl.a,
[21813] Fix | Delete
source: 'rgb'
[21814] Fix | Delete
};
[21815] Fix | Delete
}
[21816] Fix | Delete
[21817] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/keyboard-shortcuts/index.js
[21818] Fix | Delete
[21819] Fix | Delete
[21820] Fix | Delete
/**
[21821] Fix | Delete
* External dependencies
[21822] Fix | Delete
*/
[21823] Fix | Delete
[21824] Fix | Delete
/**
[21825] Fix | Delete
* WordPress dependencies
[21826] Fix | Delete
*/
[21827] Fix | Delete
[21828] Fix | Delete
[21829] Fix | Delete
[21830] Fix | Delete
[21831] Fix | Delete
function KeyboardShortcut(_ref) {
[21832] Fix | Delete
var target = _ref.target,
[21833] Fix | Delete
callback = _ref.callback,
[21834] Fix | Delete
shortcut = _ref.shortcut,
[21835] Fix | Delete
bindGlobal = _ref.bindGlobal,
[21836] Fix | Delete
eventName = _ref.eventName;
[21837] Fix | Delete
Object(external_wp_compose_["useKeyboardShortcut"])(shortcut, callback, {
[21838] Fix | Delete
bindGlobal: bindGlobal,
[21839] Fix | Delete
target: target,
[21840] Fix | Delete
eventName: eventName
[21841] Fix | Delete
});
[21842] Fix | Delete
return null;
[21843] Fix | Delete
}
[21844] Fix | Delete
[21845] Fix | Delete
function KeyboardShortcuts(_ref2) {
[21846] Fix | Delete
var children = _ref2.children,
[21847] Fix | Delete
shortcuts = _ref2.shortcuts,
[21848] Fix | Delete
bindGlobal = _ref2.bindGlobal,
[21849] Fix | Delete
eventName = _ref2.eventName;
[21850] Fix | Delete
var target = Object(external_wp_element_["useRef"])();
[21851] Fix | Delete
var element = Object(external_lodash_["map"])(shortcuts, function (callback, shortcut) {
[21852] Fix | Delete
return Object(external_wp_element_["createElement"])(KeyboardShortcut, {
[21853] Fix | Delete
key: shortcut,
[21854] Fix | Delete
shortcut: shortcut,
[21855] Fix | Delete
callback: callback,
[21856] Fix | Delete
bindGlobal: bindGlobal,
[21857] Fix | Delete
eventName: eventName,
[21858] Fix | Delete
target: target
[21859] Fix | Delete
});
[21860] Fix | Delete
}); // Render as non-visual if there are no children pressed. Keyboard
[21861] Fix | Delete
// events will be bound to the document instead.
[21862] Fix | Delete
[21863] Fix | Delete
if (!external_wp_element_["Children"].count(children)) {
[21864] Fix | Delete
return element;
[21865] Fix | Delete
}
[21866] Fix | Delete
[21867] Fix | Delete
return Object(external_wp_element_["createElement"])("div", {
[21868] Fix | Delete
ref: target
[21869] Fix | Delete
}, element, children);
[21870] Fix | Delete
}
[21871] Fix | Delete
[21872] Fix | Delete
/* harmony default export */ var keyboard_shortcuts = (KeyboardShortcuts);
[21873] Fix | Delete
[21874] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/alpha.js
[21875] Fix | Delete
[21876] Fix | Delete
[21877] Fix | Delete
[21878] Fix | Delete
[21879] Fix | Delete
[21880] Fix | Delete
[21881] Fix | Delete
[21882] Fix | Delete
[21883] Fix | Delete
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
[21884] Fix | Delete
[21885] Fix | Delete
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
[21886] Fix | Delete
[21887] Fix | Delete
/**
[21888] Fix | Delete
* Parts of this source were derived and modified from react-color,
[21889] Fix | Delete
* released under the MIT license.
[21890] Fix | Delete
*
[21891] Fix | Delete
* https://github.com/casesandberg/react-color/
[21892] Fix | Delete
*
[21893] Fix | Delete
* Copyright (c) 2015 Case Sandberg
[21894] Fix | Delete
*
[21895] Fix | Delete
* Permission is hereby granted, free of charge, to any person obtaining a copy
[21896] Fix | Delete
* of this software and associated documentation files (the "Software"), to deal
[21897] Fix | Delete
* in the Software without restriction, including without limitation the rights
[21898] Fix | Delete
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
[21899] Fix | Delete
* copies of the Software, and to permit persons to whom the Software is
[21900] Fix | Delete
* furnished to do so, subject to the following conditions:
[21901] Fix | Delete
*
[21902] Fix | Delete
* The above copyright notice and this permission notice shall be included in
[21903] Fix | Delete
* all copies or substantial portions of the Software.
[21904] Fix | Delete
*
[21905] Fix | Delete
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
[21906] Fix | Delete
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
[21907] Fix | Delete
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
[21908] Fix | Delete
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
[21909] Fix | Delete
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
[21910] Fix | Delete
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
[21911] Fix | Delete
* THE SOFTWARE.
[21912] Fix | Delete
*/
[21913] Fix | Delete
[21914] Fix | Delete
/**
[21915] Fix | Delete
* External dependencies
[21916] Fix | Delete
*/
[21917] Fix | Delete
[21918] Fix | Delete
/**
[21919] Fix | Delete
* WordPress dependencies
[21920] Fix | Delete
*/
[21921] Fix | Delete
[21922] Fix | Delete
[21923] Fix | Delete
[21924] Fix | Delete
[21925] Fix | Delete
[21926] Fix | Delete
/**
[21927] Fix | Delete
* Internal dependencies
[21928] Fix | Delete
*/
[21929] Fix | Delete
[21930] Fix | Delete
[21931] Fix | Delete
[21932] Fix | Delete
var alpha_Alpha = /*#__PURE__*/function (_Component) {
[21933] Fix | Delete
Object(inherits["a" /* default */])(Alpha, _Component);
[21934] Fix | Delete
[21935] Fix | Delete
var _super = _createSuper(Alpha);
[21936] Fix | Delete
[21937] Fix | Delete
function Alpha() {
[21938] Fix | Delete
var _this;
[21939] Fix | Delete
[21940] Fix | Delete
Object(classCallCheck["a" /* default */])(this, Alpha);
[21941] Fix | Delete
[21942] Fix | Delete
_this = _super.apply(this, arguments);
[21943] Fix | Delete
_this.container = Object(external_wp_element_["createRef"])();
[21944] Fix | Delete
_this.increase = _this.increase.bind(Object(assertThisInitialized["a" /* default */])(_this));
[21945] Fix | Delete
_this.decrease = _this.decrease.bind(Object(assertThisInitialized["a" /* default */])(_this));
[21946] Fix | Delete
_this.handleChange = _this.handleChange.bind(Object(assertThisInitialized["a" /* default */])(_this));
[21947] Fix | Delete
_this.handleMouseDown = _this.handleMouseDown.bind(Object(assertThisInitialized["a" /* default */])(_this));
[21948] Fix | Delete
_this.handleMouseUp = _this.handleMouseUp.bind(Object(assertThisInitialized["a" /* default */])(_this));
[21949] Fix | Delete
return _this;
[21950] Fix | Delete
}
[21951] Fix | Delete
[21952] Fix | Delete
Object(createClass["a" /* default */])(Alpha, [{
[21953] Fix | Delete
key: "componentWillUnmount",
[21954] Fix | Delete
value: function componentWillUnmount() {
[21955] Fix | Delete
this.unbindEventListeners();
[21956] Fix | Delete
}
[21957] Fix | Delete
}, {
[21958] Fix | Delete
key: "increase",
[21959] Fix | Delete
value: function increase() {
[21960] Fix | Delete
var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.01;
[21961] Fix | Delete
var _this$props = this.props,
[21962] Fix | Delete
hsl = _this$props.hsl,
[21963] Fix | Delete
_this$props$onChange = _this$props.onChange,
[21964] Fix | Delete
onChange = _this$props$onChange === void 0 ? external_lodash_["noop"] : _this$props$onChange;
[21965] Fix | Delete
amount = parseInt(amount * 100, 10);
[21966] Fix | Delete
var change = {
[21967] Fix | Delete
h: hsl.h,
[21968] Fix | Delete
s: hsl.s,
[21969] Fix | Delete
l: hsl.l,
[21970] Fix | Delete
a: (parseInt(hsl.a * 100, 10) + amount) / 100,
[21971] Fix | Delete
source: 'rgb'
[21972] Fix | Delete
};
[21973] Fix | Delete
onChange(change);
[21974] Fix | Delete
}
[21975] Fix | Delete
}, {
[21976] Fix | Delete
key: "decrease",
[21977] Fix | Delete
value: function decrease() {
[21978] Fix | Delete
var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.01;
[21979] Fix | Delete
var _this$props2 = this.props,
[21980] Fix | Delete
hsl = _this$props2.hsl,
[21981] Fix | Delete
_this$props2$onChange = _this$props2.onChange,
[21982] Fix | Delete
onChange = _this$props2$onChange === void 0 ? external_lodash_["noop"] : _this$props2$onChange;
[21983] Fix | Delete
var intValue = parseInt(hsl.a * 100, 10) - parseInt(amount * 100, 10);
[21984] Fix | Delete
var change = {
[21985] Fix | Delete
h: hsl.h,
[21986] Fix | Delete
s: hsl.s,
[21987] Fix | Delete
l: hsl.l,
[21988] Fix | Delete
a: hsl.a <= amount ? 0 : intValue / 100,
[21989] Fix | Delete
source: 'rgb'
[21990] Fix | Delete
};
[21991] Fix | Delete
onChange(change);
[21992] Fix | Delete
}
[21993] Fix | Delete
}, {
[21994] Fix | Delete
key: "handleChange",
[21995] Fix | Delete
value: function handleChange(e) {
[21996] Fix | Delete
var _this$props$onChange2 = this.props.onChange,
[21997] Fix | Delete
onChange = _this$props$onChange2 === void 0 ? external_lodash_["noop"] : _this$props$onChange2;
[21998] Fix | Delete
var change = calculateAlphaChange(e, this.props, this.container.current);
[21999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function