Edit File by line
/home/barbar84/www/wp-inclu.../js/dist
File: components.js
}, {
[22500] Fix | Delete
key: "handleChange",
[22501] Fix | Delete
value: function handleChange(value) {
[22502] Fix | Delete
var _this$props2 = this.props,
[22503] Fix | Delete
valueKey = _this$props2.valueKey,
[22504] Fix | Delete
onChange = _this$props2.onChange,
[22505] Fix | Delete
source = _this$props2.source;
[22506] Fix | Delete
[22507] Fix | Delete
if (value.length > 4 && isValidHex(value)) {
[22508] Fix | Delete
onChange({
[22509] Fix | Delete
source: source,
[22510] Fix | Delete
state: 'commit',
[22511] Fix | Delete
value: value,
[22512] Fix | Delete
valueKey: valueKey
[22513] Fix | Delete
});
[22514] Fix | Delete
} else {
[22515] Fix | Delete
onChange({
[22516] Fix | Delete
source: source,
[22517] Fix | Delete
state: 'draft',
[22518] Fix | Delete
value: value,
[22519] Fix | Delete
valueKey: valueKey
[22520] Fix | Delete
});
[22521] Fix | Delete
}
[22522] Fix | Delete
}
[22523] Fix | Delete
}, {
[22524] Fix | Delete
key: "handleKeyDown",
[22525] Fix | Delete
value: function handleKeyDown(_ref) {
[22526] Fix | Delete
var keyCode = _ref.keyCode;
[22527] Fix | Delete
[22528] Fix | Delete
if (keyCode !== external_wp_keycodes_["ENTER"] && keyCode !== external_wp_keycodes_["UP"] && keyCode !== external_wp_keycodes_["DOWN"]) {
[22529] Fix | Delete
return;
[22530] Fix | Delete
}
[22531] Fix | Delete
[22532] Fix | Delete
var _this$props3 = this.props,
[22533] Fix | Delete
value = _this$props3.value,
[22534] Fix | Delete
valueKey = _this$props3.valueKey,
[22535] Fix | Delete
onChange = _this$props3.onChange,
[22536] Fix | Delete
source = _this$props3.source;
[22537] Fix | Delete
onChange({
[22538] Fix | Delete
source: source,
[22539] Fix | Delete
state: 'commit',
[22540] Fix | Delete
value: value,
[22541] Fix | Delete
valueKey: valueKey
[22542] Fix | Delete
});
[22543] Fix | Delete
}
[22544] Fix | Delete
}, {
[22545] Fix | Delete
key: "render",
[22546] Fix | Delete
value: function render() {
[22547] Fix | Delete
var _this2 = this;
[22548] Fix | Delete
[22549] Fix | Delete
var _this$props4 = this.props,
[22550] Fix | Delete
label = _this$props4.label,
[22551] Fix | Delete
value = _this$props4.value,
[22552] Fix | Delete
props = Object(objectWithoutProperties["a" /* default */])(_this$props4, ["label", "value"]);
[22553] Fix | Delete
[22554] Fix | Delete
return Object(external_wp_element_["createElement"])(text_control, Object(esm_extends["a" /* default */])({
[22555] Fix | Delete
className: "components-color-picker__inputs-field",
[22556] Fix | Delete
label: label,
[22557] Fix | Delete
value: value,
[22558] Fix | Delete
onChange: function onChange(newValue) {
[22559] Fix | Delete
return _this2.handleChange(newValue);
[22560] Fix | Delete
},
[22561] Fix | Delete
onBlur: this.handleBlur,
[22562] Fix | Delete
onKeyDown: this.handleKeyDown
[22563] Fix | Delete
}, Object(external_lodash_["omit"])(props, ['onChange', 'valueKey', 'source'])));
[22564] Fix | Delete
}
[22565] Fix | Delete
}]);
[22566] Fix | Delete
[22567] Fix | Delete
return Input;
[22568] Fix | Delete
}(external_wp_element_["Component"]);
[22569] Fix | Delete
var PureButton = Object(external_wp_compose_["pure"])(build_module_button["a" /* default */]);
[22570] Fix | Delete
var inputs_Inputs = /*#__PURE__*/function (_Component2) {
[22571] Fix | Delete
Object(inherits["a" /* default */])(Inputs, _Component2);
[22572] Fix | Delete
[22573] Fix | Delete
var _super2 = inputs_createSuper(Inputs);
[22574] Fix | Delete
[22575] Fix | Delete
function Inputs(_ref2) {
[22576] Fix | Delete
var _this3;
[22577] Fix | Delete
[22578] Fix | Delete
var hsl = _ref2.hsl;
[22579] Fix | Delete
[22580] Fix | Delete
Object(classCallCheck["a" /* default */])(this, Inputs);
[22581] Fix | Delete
[22582] Fix | Delete
_this3 = _super2.apply(this, arguments);
[22583] Fix | Delete
var view = hsl.a === 1 ? 'hex' : 'rgb';
[22584] Fix | Delete
_this3.state = {
[22585] Fix | Delete
view: view
[22586] Fix | Delete
};
[22587] Fix | Delete
_this3.toggleViews = _this3.toggleViews.bind(Object(assertThisInitialized["a" /* default */])(_this3));
[22588] Fix | Delete
_this3.resetDraftValues = _this3.resetDraftValues.bind(Object(assertThisInitialized["a" /* default */])(_this3));
[22589] Fix | Delete
_this3.handleChange = _this3.handleChange.bind(Object(assertThisInitialized["a" /* default */])(_this3));
[22590] Fix | Delete
_this3.normalizeValue = _this3.normalizeValue.bind(Object(assertThisInitialized["a" /* default */])(_this3));
[22591] Fix | Delete
return _this3;
[22592] Fix | Delete
}
[22593] Fix | Delete
[22594] Fix | Delete
Object(createClass["a" /* default */])(Inputs, [{
[22595] Fix | Delete
key: "toggleViews",
[22596] Fix | Delete
value: function toggleViews() {
[22597] Fix | Delete
if (this.state.view === 'hex') {
[22598] Fix | Delete
this.setState({
[22599] Fix | Delete
view: 'rgb'
[22600] Fix | Delete
}, this.resetDraftValues);
[22601] Fix | Delete
Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["__"])('RGB mode active'));
[22602] Fix | Delete
} else if (this.state.view === 'rgb') {
[22603] Fix | Delete
this.setState({
[22604] Fix | Delete
view: 'hsl'
[22605] Fix | Delete
}, this.resetDraftValues);
[22606] Fix | Delete
Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["__"])('Hue/saturation/lightness mode active'));
[22607] Fix | Delete
} else if (this.state.view === 'hsl') {
[22608] Fix | Delete
if (this.props.hsl.a === 1) {
[22609] Fix | Delete
this.setState({
[22610] Fix | Delete
view: 'hex'
[22611] Fix | Delete
}, this.resetDraftValues);
[22612] Fix | Delete
Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["__"])('Hex color mode active'));
[22613] Fix | Delete
} else {
[22614] Fix | Delete
this.setState({
[22615] Fix | Delete
view: 'rgb'
[22616] Fix | Delete
}, this.resetDraftValues);
[22617] Fix | Delete
Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["__"])('RGB mode active'));
[22618] Fix | Delete
}
[22619] Fix | Delete
}
[22620] Fix | Delete
}
[22621] Fix | Delete
}, {
[22622] Fix | Delete
key: "resetDraftValues",
[22623] Fix | Delete
value: function resetDraftValues() {
[22624] Fix | Delete
return this.props.onChange({
[22625] Fix | Delete
state: 'reset'
[22626] Fix | Delete
});
[22627] Fix | Delete
}
[22628] Fix | Delete
}, {
[22629] Fix | Delete
key: "normalizeValue",
[22630] Fix | Delete
value: function normalizeValue(valueKey, value) {
[22631] Fix | Delete
if (valueKey !== 'a') {
[22632] Fix | Delete
return value;
[22633] Fix | Delete
}
[22634] Fix | Delete
[22635] Fix | Delete
if (value < 0) {
[22636] Fix | Delete
return 0;
[22637] Fix | Delete
} else if (value > 1) {
[22638] Fix | Delete
return 1;
[22639] Fix | Delete
}
[22640] Fix | Delete
[22641] Fix | Delete
return Math.round(value * 100) / 100;
[22642] Fix | Delete
}
[22643] Fix | Delete
}, {
[22644] Fix | Delete
key: "handleChange",
[22645] Fix | Delete
value: function handleChange(_ref3) {
[22646] Fix | Delete
var source = _ref3.source,
[22647] Fix | Delete
state = _ref3.state,
[22648] Fix | Delete
value = _ref3.value,
[22649] Fix | Delete
valueKey = _ref3.valueKey;
[22650] Fix | Delete
this.props.onChange({
[22651] Fix | Delete
source: source,
[22652] Fix | Delete
state: state,
[22653] Fix | Delete
valueKey: valueKey,
[22654] Fix | Delete
value: this.normalizeValue(valueKey, value)
[22655] Fix | Delete
});
[22656] Fix | Delete
}
[22657] Fix | Delete
}, {
[22658] Fix | Delete
key: "renderFields",
[22659] Fix | Delete
value: function renderFields() {
[22660] Fix | Delete
var _this$props$disableAl = this.props.disableAlpha,
[22661] Fix | Delete
disableAlpha = _this$props$disableAl === void 0 ? false : _this$props$disableAl;
[22662] Fix | Delete
[22663] Fix | Delete
if (this.state.view === 'hex') {
[22664] Fix | Delete
return Object(external_wp_element_["createElement"])("div", {
[22665] Fix | Delete
className: "components-color-picker__inputs-fields"
[22666] Fix | Delete
}, Object(external_wp_element_["createElement"])(inputs_Input, {
[22667] Fix | Delete
source: this.state.view,
[22668] Fix | Delete
label: Object(external_wp_i18n_["__"])('Color value in hexadecimal'),
[22669] Fix | Delete
valueKey: "hex",
[22670] Fix | Delete
value: this.props.hex,
[22671] Fix | Delete
onChange: this.handleChange
[22672] Fix | Delete
}));
[22673] Fix | Delete
} else if (this.state.view === 'rgb') {
[22674] Fix | Delete
var legend = disableAlpha ? Object(external_wp_i18n_["__"])('Color value in RGB') : Object(external_wp_i18n_["__"])('Color value in RGBA');
[22675] Fix | Delete
return Object(external_wp_element_["createElement"])("fieldset", null, Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], {
[22676] Fix | Delete
as: "legend"
[22677] Fix | Delete
}, legend), Object(external_wp_element_["createElement"])("div", {
[22678] Fix | Delete
className: "components-color-picker__inputs-fields"
[22679] Fix | Delete
}, Object(external_wp_element_["createElement"])(inputs_Input, {
[22680] Fix | Delete
source: this.state.view,
[22681] Fix | Delete
label: "r",
[22682] Fix | Delete
valueKey: "r",
[22683] Fix | Delete
value: this.props.rgb.r,
[22684] Fix | Delete
onChange: this.handleChange,
[22685] Fix | Delete
type: "number",
[22686] Fix | Delete
min: "0",
[22687] Fix | Delete
max: "255"
[22688] Fix | Delete
}), Object(external_wp_element_["createElement"])(inputs_Input, {
[22689] Fix | Delete
source: this.state.view,
[22690] Fix | Delete
label: "g",
[22691] Fix | Delete
valueKey: "g",
[22692] Fix | Delete
value: this.props.rgb.g,
[22693] Fix | Delete
onChange: this.handleChange,
[22694] Fix | Delete
type: "number",
[22695] Fix | Delete
min: "0",
[22696] Fix | Delete
max: "255"
[22697] Fix | Delete
}), Object(external_wp_element_["createElement"])(inputs_Input, {
[22698] Fix | Delete
source: this.state.view,
[22699] Fix | Delete
label: "b",
[22700] Fix | Delete
valueKey: "b",
[22701] Fix | Delete
value: this.props.rgb.b,
[22702] Fix | Delete
onChange: this.handleChange,
[22703] Fix | Delete
type: "number",
[22704] Fix | Delete
min: "0",
[22705] Fix | Delete
max: "255"
[22706] Fix | Delete
}), disableAlpha ? null : Object(external_wp_element_["createElement"])(inputs_Input, {
[22707] Fix | Delete
source: this.state.view,
[22708] Fix | Delete
label: "a",
[22709] Fix | Delete
valueKey: "a",
[22710] Fix | Delete
value: this.props.rgb.a,
[22711] Fix | Delete
onChange: this.handleChange,
[22712] Fix | Delete
type: "number",
[22713] Fix | Delete
min: "0",
[22714] Fix | Delete
max: "1",
[22715] Fix | Delete
step: "0.01"
[22716] Fix | Delete
})));
[22717] Fix | Delete
} else if (this.state.view === 'hsl') {
[22718] Fix | Delete
var _legend = disableAlpha ? Object(external_wp_i18n_["__"])('Color value in HSL') : Object(external_wp_i18n_["__"])('Color value in HSLA');
[22719] Fix | Delete
[22720] Fix | Delete
return Object(external_wp_element_["createElement"])("fieldset", null, Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], {
[22721] Fix | Delete
as: "legend"
[22722] Fix | Delete
}, _legend), Object(external_wp_element_["createElement"])("div", {
[22723] Fix | Delete
className: "components-color-picker__inputs-fields"
[22724] Fix | Delete
}, Object(external_wp_element_["createElement"])(inputs_Input, {
[22725] Fix | Delete
source: this.state.view,
[22726] Fix | Delete
label: "h",
[22727] Fix | Delete
valueKey: "h",
[22728] Fix | Delete
value: this.props.hsl.h,
[22729] Fix | Delete
onChange: this.handleChange,
[22730] Fix | Delete
type: "number",
[22731] Fix | Delete
min: "0",
[22732] Fix | Delete
max: "359"
[22733] Fix | Delete
}), Object(external_wp_element_["createElement"])(inputs_Input, {
[22734] Fix | Delete
source: this.state.view,
[22735] Fix | Delete
label: "s",
[22736] Fix | Delete
valueKey: "s",
[22737] Fix | Delete
value: this.props.hsl.s,
[22738] Fix | Delete
onChange: this.handleChange,
[22739] Fix | Delete
type: "number",
[22740] Fix | Delete
min: "0",
[22741] Fix | Delete
max: "100"
[22742] Fix | Delete
}), Object(external_wp_element_["createElement"])(inputs_Input, {
[22743] Fix | Delete
source: this.state.view,
[22744] Fix | Delete
label: "l",
[22745] Fix | Delete
valueKey: "l",
[22746] Fix | Delete
value: this.props.hsl.l,
[22747] Fix | Delete
onChange: this.handleChange,
[22748] Fix | Delete
type: "number",
[22749] Fix | Delete
min: "0",
[22750] Fix | Delete
max: "100"
[22751] Fix | Delete
}), disableAlpha ? null : Object(external_wp_element_["createElement"])(inputs_Input, {
[22752] Fix | Delete
source: this.state.view,
[22753] Fix | Delete
label: "a",
[22754] Fix | Delete
valueKey: "a",
[22755] Fix | Delete
value: this.props.hsl.a,
[22756] Fix | Delete
onChange: this.handleChange,
[22757] Fix | Delete
type: "number",
[22758] Fix | Delete
min: "0",
[22759] Fix | Delete
max: "1",
[22760] Fix | Delete
step: "0.05"
[22761] Fix | Delete
})));
[22762] Fix | Delete
}
[22763] Fix | Delete
}
[22764] Fix | Delete
}, {
[22765] Fix | Delete
key: "render",
[22766] Fix | Delete
value: function render() {
[22767] Fix | Delete
return Object(external_wp_element_["createElement"])("div", {
[22768] Fix | Delete
className: "components-color-picker__inputs-wrapper"
[22769] Fix | Delete
}, this.renderFields(), Object(external_wp_element_["createElement"])("div", {
[22770] Fix | Delete
className: "components-color-picker__inputs-toggle-wrapper"
[22771] Fix | Delete
}, Object(external_wp_element_["createElement"])(PureButton, {
[22772] Fix | Delete
className: "components-color-picker__inputs-toggle",
[22773] Fix | Delete
icon: chevron_down["a" /* default */],
[22774] Fix | Delete
label: Object(external_wp_i18n_["__"])('Change color format'),
[22775] Fix | Delete
onClick: this.toggleViews
[22776] Fix | Delete
})));
[22777] Fix | Delete
}
[22778] Fix | Delete
}], [{
[22779] Fix | Delete
key: "getDerivedStateFromProps",
[22780] Fix | Delete
value: function getDerivedStateFromProps(props, state) {
[22781] Fix | Delete
if (props.hsl.a !== 1 && state.view === 'hex') {
[22782] Fix | Delete
return {
[22783] Fix | Delete
view: 'rgb'
[22784] Fix | Delete
};
[22785] Fix | Delete
}
[22786] Fix | Delete
[22787] Fix | Delete
return null;
[22788] Fix | Delete
}
[22789] Fix | Delete
}]);
[22790] Fix | Delete
[22791] Fix | Delete
return Inputs;
[22792] Fix | Delete
}(external_wp_element_["Component"]);
[22793] Fix | Delete
/* harmony default export */ var inputs = (inputs_Inputs);
[22794] Fix | Delete
[22795] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/saturation.js
[22796] Fix | Delete
[22797] Fix | Delete
[22798] Fix | Delete
[22799] Fix | Delete
[22800] Fix | Delete
[22801] Fix | Delete
[22802] Fix | Delete
[22803] Fix | Delete
[22804] Fix | Delete
function saturation_createSuper(Derived) { var hasNativeReflectConstruct = saturation_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); }; }
[22805] Fix | Delete
[22806] Fix | Delete
function saturation_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; } }
[22807] Fix | Delete
[22808] Fix | Delete
/**
[22809] Fix | Delete
* Parts of this source were derived and modified from react-color,
[22810] Fix | Delete
* released under the MIT license.
[22811] Fix | Delete
*
[22812] Fix | Delete
* https://github.com/casesandberg/react-color/
[22813] Fix | Delete
*
[22814] Fix | Delete
* Copyright (c) 2015 Case Sandberg
[22815] Fix | Delete
*
[22816] Fix | Delete
* Permission is hereby granted, free of charge, to any person obtaining a copy
[22817] Fix | Delete
* of this software and associated documentation files (the "Software"), to deal
[22818] Fix | Delete
* in the Software without restriction, including without limitation the rights
[22819] Fix | Delete
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
[22820] Fix | Delete
* copies of the Software, and to permit persons to whom the Software is
[22821] Fix | Delete
* furnished to do so, subject to the following conditions:
[22822] Fix | Delete
*
[22823] Fix | Delete
* The above copyright notice and this permission notice shall be included in
[22824] Fix | Delete
* all copies or substantial portions of the Software.
[22825] Fix | Delete
*
[22826] Fix | Delete
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
[22827] Fix | Delete
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
[22828] Fix | Delete
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
[22829] Fix | Delete
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
[22830] Fix | Delete
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
[22831] Fix | Delete
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
[22832] Fix | Delete
* THE SOFTWARE.
[22833] Fix | Delete
*/
[22834] Fix | Delete
[22835] Fix | Delete
/**
[22836] Fix | Delete
* External dependencies
[22837] Fix | Delete
*/
[22838] Fix | Delete
[22839] Fix | Delete
/**
[22840] Fix | Delete
* WordPress dependencies
[22841] Fix | Delete
*/
[22842] Fix | Delete
[22843] Fix | Delete
[22844] Fix | Delete
[22845] Fix | Delete
[22846] Fix | Delete
[22847] Fix | Delete
/**
[22848] Fix | Delete
* Internal dependencies
[22849] Fix | Delete
*/
[22850] Fix | Delete
[22851] Fix | Delete
[22852] Fix | Delete
[22853] Fix | Delete
[22854] Fix | Delete
[22855] Fix | Delete
var saturation_Saturation = /*#__PURE__*/function (_Component) {
[22856] Fix | Delete
Object(inherits["a" /* default */])(Saturation, _Component);
[22857] Fix | Delete
[22858] Fix | Delete
var _super = saturation_createSuper(Saturation);
[22859] Fix | Delete
[22860] Fix | Delete
function Saturation(props) {
[22861] Fix | Delete
var _this;
[22862] Fix | Delete
[22863] Fix | Delete
Object(classCallCheck["a" /* default */])(this, Saturation);
[22864] Fix | Delete
[22865] Fix | Delete
_this = _super.call(this, props);
[22866] Fix | Delete
_this.throttle = Object(external_lodash_["throttle"])(function (fn, data, e) {
[22867] Fix | Delete
fn(data, e);
[22868] Fix | Delete
}, 50);
[22869] Fix | Delete
_this.container = Object(external_wp_element_["createRef"])();
[22870] Fix | Delete
_this.saturate = _this.saturate.bind(Object(assertThisInitialized["a" /* default */])(_this));
[22871] Fix | Delete
_this.brighten = _this.brighten.bind(Object(assertThisInitialized["a" /* default */])(_this));
[22872] Fix | Delete
_this.handleChange = _this.handleChange.bind(Object(assertThisInitialized["a" /* default */])(_this));
[22873] Fix | Delete
_this.handleMouseDown = _this.handleMouseDown.bind(Object(assertThisInitialized["a" /* default */])(_this));
[22874] Fix | Delete
_this.handleMouseUp = _this.handleMouseUp.bind(Object(assertThisInitialized["a" /* default */])(_this));
[22875] Fix | Delete
return _this;
[22876] Fix | Delete
}
[22877] Fix | Delete
[22878] Fix | Delete
Object(createClass["a" /* default */])(Saturation, [{
[22879] Fix | Delete
key: "componentWillUnmount",
[22880] Fix | Delete
value: function componentWillUnmount() {
[22881] Fix | Delete
this.throttle.cancel();
[22882] Fix | Delete
this.unbindEventListeners();
[22883] Fix | Delete
}
[22884] Fix | Delete
}, {
[22885] Fix | Delete
key: "saturate",
[22886] Fix | Delete
value: function saturate() {
[22887] Fix | Delete
var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.01;
[22888] Fix | Delete
var _this$props = this.props,
[22889] Fix | Delete
hsv = _this$props.hsv,
[22890] Fix | Delete
_this$props$onChange = _this$props.onChange,
[22891] Fix | Delete
onChange = _this$props$onChange === void 0 ? external_lodash_["noop"] : _this$props$onChange;
[22892] Fix | Delete
var intSaturation = Object(external_lodash_["clamp"])(hsv.s + Math.round(amount * 100), 0, 100);
[22893] Fix | Delete
var change = {
[22894] Fix | Delete
h: hsv.h,
[22895] Fix | Delete
s: intSaturation,
[22896] Fix | Delete
v: hsv.v,
[22897] Fix | Delete
a: hsv.a,
[22898] Fix | Delete
source: 'rgb'
[22899] Fix | Delete
};
[22900] Fix | Delete
onChange(change);
[22901] Fix | Delete
}
[22902] Fix | Delete
}, {
[22903] Fix | Delete
key: "brighten",
[22904] Fix | Delete
value: function brighten() {
[22905] Fix | Delete
var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.01;
[22906] Fix | Delete
var _this$props2 = this.props,
[22907] Fix | Delete
hsv = _this$props2.hsv,
[22908] Fix | Delete
_this$props2$onChange = _this$props2.onChange,
[22909] Fix | Delete
onChange = _this$props2$onChange === void 0 ? external_lodash_["noop"] : _this$props2$onChange;
[22910] Fix | Delete
var intValue = Object(external_lodash_["clamp"])(hsv.v + Math.round(amount * 100), 0, 100);
[22911] Fix | Delete
var change = {
[22912] Fix | Delete
h: hsv.h,
[22913] Fix | Delete
s: hsv.s,
[22914] Fix | Delete
v: intValue,
[22915] Fix | Delete
a: hsv.a,
[22916] Fix | Delete
source: 'rgb'
[22917] Fix | Delete
};
[22918] Fix | Delete
onChange(change);
[22919] Fix | Delete
}
[22920] Fix | Delete
}, {
[22921] Fix | Delete
key: "handleChange",
[22922] Fix | Delete
value: function handleChange(e) {
[22923] Fix | Delete
var _this$props$onChange2 = this.props.onChange,
[22924] Fix | Delete
onChange = _this$props$onChange2 === void 0 ? external_lodash_["noop"] : _this$props$onChange2;
[22925] Fix | Delete
var change = calculateSaturationChange(e, this.props, this.container.current);
[22926] Fix | Delete
this.throttle(onChange, change, e);
[22927] Fix | Delete
}
[22928] Fix | Delete
}, {
[22929] Fix | Delete
key: "handleMouseDown",
[22930] Fix | Delete
value: function handleMouseDown(e) {
[22931] Fix | Delete
this.handleChange(e);
[22932] Fix | Delete
window.addEventListener('mousemove', this.handleChange);
[22933] Fix | Delete
window.addEventListener('mouseup', this.handleMouseUp);
[22934] Fix | Delete
}
[22935] Fix | Delete
}, {
[22936] Fix | Delete
key: "handleMouseUp",
[22937] Fix | Delete
value: function handleMouseUp() {
[22938] Fix | Delete
this.unbindEventListeners();
[22939] Fix | Delete
}
[22940] Fix | Delete
}, {
[22941] Fix | Delete
key: "preventKeyEvents",
[22942] Fix | Delete
value: function preventKeyEvents(event) {
[22943] Fix | Delete
if (event.keyCode === external_wp_keycodes_["TAB"]) {
[22944] Fix | Delete
return;
[22945] Fix | Delete
}
[22946] Fix | Delete
[22947] Fix | Delete
event.preventDefault();
[22948] Fix | Delete
}
[22949] Fix | Delete
}, {
[22950] Fix | Delete
key: "unbindEventListeners",
[22951] Fix | Delete
value: function unbindEventListeners() {
[22952] Fix | Delete
window.removeEventListener('mousemove', this.handleChange);
[22953] Fix | Delete
window.removeEventListener('mouseup', this.handleMouseUp);
[22954] Fix | Delete
}
[22955] Fix | Delete
}, {
[22956] Fix | Delete
key: "render",
[22957] Fix | Delete
value: function render() {
[22958] Fix | Delete
var _this2 = this;
[22959] Fix | Delete
[22960] Fix | Delete
var _this$props3 = this.props,
[22961] Fix | Delete
hsv = _this$props3.hsv,
[22962] Fix | Delete
hsl = _this$props3.hsl,
[22963] Fix | Delete
instanceId = _this$props3.instanceId;
[22964] Fix | Delete
var pointerLocation = {
[22965] Fix | Delete
top: "".concat(-hsv.v + 100, "%"),
[22966] Fix | Delete
left: "".concat(hsv.s, "%")
[22967] Fix | Delete
};
[22968] Fix | Delete
var shortcuts = {
[22969] Fix | Delete
up: function up() {
[22970] Fix | Delete
return _this2.brighten();
[22971] Fix | Delete
},
[22972] Fix | Delete
'shift+up': function shiftUp() {
[22973] Fix | Delete
return _this2.brighten(0.1);
[22974] Fix | Delete
},
[22975] Fix | Delete
pageup: function pageup() {
[22976] Fix | Delete
return _this2.brighten(1);
[22977] Fix | Delete
},
[22978] Fix | Delete
down: function down() {
[22979] Fix | Delete
return _this2.brighten(-0.01);
[22980] Fix | Delete
},
[22981] Fix | Delete
'shift+down': function shiftDown() {
[22982] Fix | Delete
return _this2.brighten(-0.1);
[22983] Fix | Delete
},
[22984] Fix | Delete
pagedown: function pagedown() {
[22985] Fix | Delete
return _this2.brighten(-1);
[22986] Fix | Delete
},
[22987] Fix | Delete
right: function right() {
[22988] Fix | Delete
return _this2.saturate();
[22989] Fix | Delete
},
[22990] Fix | Delete
'shift+right': function shiftRight() {
[22991] Fix | Delete
return _this2.saturate(0.1);
[22992] Fix | Delete
},
[22993] Fix | Delete
end: function end() {
[22994] Fix | Delete
return _this2.saturate(1);
[22995] Fix | Delete
},
[22996] Fix | Delete
left: function left() {
[22997] Fix | Delete
return _this2.saturate(-0.01);
[22998] Fix | Delete
},
[22999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function