| 1 |
/******/ (() => { // webpackBootstrap |
| 2 |
/******/ "use strict"; |
| 3 |
/******/ var __webpack_modules__ = ({ |
| 4 |
|
| 5 |
/***/ "../../assets/img/darkify-icon.svg": |
| 6 |
/*!*****************************************!*\ |
| 7 |
!*** ../../assets/img/darkify-icon.svg ***! |
| 8 |
\*****************************************/ |
| 9 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 10 |
|
| 11 |
__webpack_require__.r(__webpack_exports__); |
| 12 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 13 |
/* harmony export */ ReactComponent: () => (/* binding */ SvgDarkifyIcon), |
| 14 |
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 15 |
/* harmony export */ }); |
| 16 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 17 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 18 |
var _rect, _rect2, _path, _path2, _path3, _path4; |
| 19 |
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } |
| 20 |
|
| 21 |
var SvgDarkifyIcon = function SvgDarkifyIcon(props) { |
| 22 |
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({ |
| 23 |
xmlns: "http://www.w3.org/2000/svg", |
| 24 |
width: 256, |
| 25 |
height: 256, |
| 26 |
fill: "none" |
| 27 |
}, props), _rect || (_rect = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", { |
| 28 |
width: 256, |
| 29 |
height: 256, |
| 30 |
fill: "#121116", |
| 31 |
rx: 3 |
| 32 |
})), _rect2 || (_rect2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", { |
| 33 |
width: 256, |
| 34 |
height: 256, |
| 35 |
stroke: "#364154", |
| 36 |
rx: 3 |
| 37 |
})), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", { |
| 38 |
stroke: "#121116", |
| 39 |
d: "M58 58h140v140H58z" |
| 40 |
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", { |
| 41 |
fill: "#fff", |
| 42 |
d: "M128 58a5 5 0 0 1 5 5v10a5 5 0 0 1-10 0V63a5 5 0 0 1 5-5" |
| 43 |
})), _path3 || (_path3 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", { |
| 44 |
fill: "#fff", |
| 45 |
fillRule: "evenodd", |
| 46 |
d: "M128 168c-30.324 0-40.324-10-40-40 .325-30 9.676-40 40-40 30.325 0 40 10 40 40s-9.675 40-40 40", |
| 47 |
clipRule: "evenodd" |
| 48 |
})), _path4 || (_path4 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", { |
| 49 |
fill: "#fff", |
| 50 |
d: "M133 183a5 5 0 0 0-10 0v10a5 5 0 0 0 10 0zM198 128a5 5 0 0 1-5 5h-10a5 5 0 0 1 0-10h10a5 5 0 0 1 5 5M73 133a5 5 0 0 0 0-10H63a5 5 0 0 0 0 10zM74.465 74.465a5 5 0 0 1 7.07 0l7.072 7.07a5 5 0 0 1-7.071 7.072l-7.071-7.071a5 5 0 0 1 0-7.071M81.536 183.606a5.001 5.001 0 0 1-7.071-7.071l7.07-7.071a5 5 0 1 1 7.072 7.071zM183.606 74.465a5 5 0 0 0-7.071 0l-7.071 7.07a5 5 0 1 0 7.071 7.072l7.071-7.071a5 5 0 0 0 0-7.071M176.535 183.606a5.001 5.001 0 0 0 7.071-7.071l-7.071-7.071a5 5 0 0 0-7.071 0 5 5 0 0 0 0 7.071z" |
| 51 |
}))); |
| 52 |
};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1NSAxNjkuNDY0QzgzLjQ4ODIgMTY3LjUxMSA4Ni42NTQgMTY3LjUxMSA4OC42MDY2IDE2OS40NjRDOTAuNTU5MiAxNzEuNDE2IDkwLjU1OTIgMTc0LjU4MiA4OC42MDY2IDE3Ni41MzVMODEuNTM1NSAxODMuNjA2WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTE4My42MDYgNzQuNDY0NUMxODEuNjUzIDcyLjUxMTggMTc4LjQ4NyA3Mi41MTE4IDE3Ni41MzUgNzQuNDY0NUwxNjkuNDY0IDgxLjUzNTVDMTY3LjUxMSA4My40ODgyIDE2Ny41MTEgODYuNjU0IDE2OS40NjQgODguNjA2NkMxNzEuNDE2IDkwLjU1OTIgMTc0LjU4MiA5MC41NTkyIDE3Ni41MzUgODguNjA2NkwxODMuNjA2IDgxLjUzNTVDMTg1LjU1OCA3OS41ODI5IDE4NS41NTggNzYuNDE3MSAxODMuNjA2IDc0LjQ2NDVaIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBkPSJNMTc2LjUzNSAxODMuNjA2QzE3OC40ODcgMTg1LjU1OCAxODEuNjUzIDE4NS41NTggMTgzLjYwNiAxODMuNjA2QzE4NS41NTggMTgxLjY1MyAxODUuNTU4IDE3OC40ODcgMTgzLjYwNiAxNzYuNTM1TDE3Ni41MzUgMTY5LjQ2NEMxNzQuNTgyIDE2Ny41MTEgMTcxLjQxNiAxNjcuNTExIDE2OS40NjQgMTY5LjQ2NEMxNjcuNTExIDE3MS40MTYgMTY3LjUxMSAxNzQuNTgyIDE2OS40NjQgMTc2LjUzNUwxNzYuNTM1IDE4My42MDZaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K"); |
| 55 |
|
| 56 |
/***/ }), |
| 57 |
|
| 58 |
/***/ "./block.json": |
| 59 |
/*!********************!*\ |
| 60 |
!*** ./block.json ***! |
| 61 |
\********************/ |
| 62 |
/***/ ((module) => { |
| 63 |
|
| 64 |
module.exports = /*#__PURE__*/JSON.parse('{"apiVersion":2,"name":"darkify/switcher","title":"Dark Mode Switcher","category":"widgets","icon":"visibility","description":"Easily place a dark mode switch anywhere on your website. Fully customizable and powered by Darkify for a smooth light/dark experience.","textdomain":"darkify","editorScript":"file:./build/index.js","editorStyle":"file:./build/index.css","style":["theme-around","theme-classic","theme-orbit","theme-dual","theme-shift","theme-within"],"supports":{"styles":false,"html":false},"attributes":{"style":{"type":"string","default":"classic"},"size":{"type":"string","default":"1.0"},"custom_size":{"type":"number","default":100},"switch_bg_light":{"type":"string","default":"#121116"},"switch_bg_dark":{"type":"string","default":"#ffffff"},"light_icon_color":{"type":"string","default":"#ffffff"},"dark_icon_color":{"type":"string","default":"#121116"},"light_text_color":{"type":"string","default":"#121116"},"dark_text_color":{"type":"string","default":"#ffffff"},"border_width":{"type":"number","default":0},"border_light_color":{"type":"string","default":"#121116"},"border_dark_color":{"type":"string","default":"#ffffff"},"border_radius":{"type":"number","default":7},"alignment":{"type":"string","default":"left"},"preview":{"type":"boolean","default":false}},"example":{"attributes":{"preview":true}}}'); |
| 65 |
|
| 66 |
/***/ }), |
| 67 |
|
| 68 |
/***/ "./src/edit.js": |
| 69 |
/*!*********************!*\ |
| 70 |
!*** ./src/edit.js ***! |
| 71 |
\*********************/ |
| 72 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 73 |
|
| 74 |
__webpack_require__.r(__webpack_exports__); |
| 75 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 76 |
/* harmony export */ "default": () => (/* binding */ Edit) |
| 77 |
/* harmony export */ }); |
| 78 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 79 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); |
| 80 |
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); |
| 81 |
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); |
| 82 |
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); |
| 83 |
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); |
| 84 |
/* harmony import */ var _wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/server-side-render */ "@wordpress/server-side-render"); |
| 85 |
/* harmony import */ var _wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_3__); |
| 86 |
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss"); |
| 87 |
/* harmony import */ var _assets_img_darkify_icon_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../assets/img/darkify-icon.svg */ "../../assets/img/darkify-icon.svg"); |
| 88 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); |
| 89 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__); |
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
// Displays the PHP output in editor |
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
function Edit({ |
| 98 |
attributes, |
| 99 |
setAttributes |
| 100 |
}) { |
| 101 |
const { |
| 102 |
style, |
| 103 |
size, |
| 104 |
custom_size, |
| 105 |
switch_bg_light, |
| 106 |
switch_bg_dark, |
| 107 |
light_icon_color, |
| 108 |
dark_icon_color, |
| 109 |
light_text_color, |
| 110 |
dark_text_color, |
| 111 |
border_width, |
| 112 |
border_light_color, |
| 113 |
border_dark_color, |
| 114 |
border_radius, |
| 115 |
alignment, |
| 116 |
preview |
| 117 |
} = attributes; |
| 118 |
const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)(); |
| 119 |
const buttonStyle = [{ |
| 120 |
label: 'Classic', |
| 121 |
value: 'classic' |
| 122 |
}, { |
| 123 |
label: 'Expand', |
| 124 |
value: 'expand' |
| 125 |
}, { |
| 126 |
label: 'Inner Moon', |
| 127 |
value: 'inner-moon' |
| 128 |
}, { |
| 129 |
label: 'within', |
| 130 |
value: 'within' |
| 131 |
}, { |
| 132 |
label: 'Orbit', |
| 133 |
value: 'orbit' |
| 134 |
}, { |
| 135 |
label: 'Around', |
| 136 |
value: 'around' |
| 137 |
}, { |
| 138 |
label: 'Dark Side', |
| 139 |
value: 'dark-side' |
| 140 |
}, { |
| 141 |
label: 'Horizon', |
| 142 |
value: 'horizon' |
| 143 |
}, { |
| 144 |
label: 'Eclipse', |
| 145 |
value: 'eclipse' |
| 146 |
}, { |
| 147 |
label: 'Lightbulb', |
| 148 |
value: 'lightbulb' |
| 149 |
}, { |
| 150 |
label: 'Dark Inner', |
| 151 |
value: 'dark-inner' |
| 152 |
}, { |
| 153 |
label: 'Half Sun', |
| 154 |
value: 'half-sun' |
| 155 |
}, { |
| 156 |
label: 'Simple', |
| 157 |
value: 'simple' |
| 158 |
}, { |
| 159 |
label: 'Duality', |
| 160 |
value: 'duality' |
| 161 |
}, { |
| 162 |
label: 'Dual', |
| 163 |
value: 'dual' |
| 164 |
}, { |
| 165 |
label: 'Shift', |
| 166 |
value: 'shift' |
| 167 |
}]; |
| 168 |
if (preview) { |
| 169 |
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", { |
| 170 |
...blockProps, |
| 171 |
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("img", { |
| 172 |
src: `${_assets_img_darkify_icon_svg__WEBPACK_IMPORTED_MODULE_5__["default"]}`, |
| 173 |
alt: "Dark Mode Switcher", |
| 174 |
style: { |
| 175 |
width: '100%', |
| 176 |
height: 'auto' |
| 177 |
} |
| 178 |
}) |
| 179 |
}); |
| 180 |
} |
| 181 |
const ImageSelectControl = ({ |
| 182 |
options, |
| 183 |
value, |
| 184 |
onChange |
| 185 |
}) => { |
| 186 |
const baseUrl = `${darkify.dir_url}src/Admin/Framework/assets/images/`; |
| 187 |
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", { |
| 188 |
className: "darkify-image-select-control", |
| 189 |
children: options.map(opt => { |
| 190 |
const imageUrl = `${baseUrl}${opt.value}.svg`; |
| 191 |
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", { |
| 192 |
className: `darkify-image-option ${value === opt.value ? 'active' : ''}`, |
| 193 |
onClick: () => onChange(opt.value), |
| 194 |
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("img", { |
| 195 |
src: imageUrl, |
| 196 |
alt: opt.label |
| 197 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("span", { |
| 198 |
children: opt.label |
| 199 |
})] |
| 200 |
}, opt.value); |
| 201 |
}) |
| 202 |
}); |
| 203 |
}; |
| 204 |
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", { |
| 205 |
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)(), |
| 206 |
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.BlockControls, { |
| 207 |
group: "block", |
| 208 |
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.AlignmentControl, { |
| 209 |
value: alignment, |
| 210 |
onChange: nextAlign => { |
| 211 |
setAttributes({ |
| 212 |
alignment: nextAlign |
| 213 |
}); |
| 214 |
} |
| 215 |
}) |
| 216 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, { |
| 217 |
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { |
| 218 |
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Darkify Settings', 'darkify'), |
| 219 |
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { |
| 220 |
children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Switch Style', 'darkify') |
| 221 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(ImageSelectControl, { |
| 222 |
value: style, |
| 223 |
options: buttonStyle, |
| 224 |
onChange: val => setAttributes({ |
| 225 |
style: val |
| 226 |
}) |
| 227 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.SelectControl, { |
| 228 |
label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Switch Size', 'darkify'), |
| 229 |
value: size, |
| 230 |
options: [{ |
| 231 |
label: 'XS', |
| 232 |
value: '0.6' |
| 233 |
}, { |
| 234 |
label: 'S', |
| 235 |
value: '0.8' |
| 236 |
}, { |
| 237 |
label: 'M', |
| 238 |
value: '1.0' |
| 239 |
}, { |
| 240 |
label: 'L', |
| 241 |
value: '1.2' |
| 242 |
}, { |
| 243 |
label: 'XL', |
| 244 |
value: '1.4' |
| 245 |
}, { |
| 246 |
label: 'XXL', |
| 247 |
value: '1.6' |
| 248 |
}, { |
| 249 |
label: 'Custom', |
| 250 |
value: 'custom' |
| 251 |
}], |
| 252 |
onChange: val => setAttributes({ |
| 253 |
size: val |
| 254 |
}) |
| 255 |
}), size === 'custom' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.RangeControl, { |
| 256 |
label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Custom Size', 'darkify'), |
| 257 |
value: custom_size, |
| 258 |
onChange: val => setAttributes({ |
| 259 |
custom_size: val |
| 260 |
}), |
| 261 |
min: 40, |
| 262 |
max: 300 |
| 263 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { |
| 264 |
children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Light Mode Background', 'darkify') |
| 265 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ColorPalette, { |
| 266 |
value: switch_bg_light, |
| 267 |
onChange: val => setAttributes({ |
| 268 |
switch_bg_light: val |
| 269 |
}) |
| 270 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { |
| 271 |
children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Dark Mode Background', 'darkify') |
| 272 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ColorPalette, { |
| 273 |
value: switch_bg_dark, |
| 274 |
onChange: val => setAttributes({ |
| 275 |
switch_bg_dark: val |
| 276 |
}) |
| 277 |
}), style !== 'duality' && style !== 'shift' && style !== 'dual' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, { |
| 278 |
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { |
| 279 |
children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Light Mode Icon Color', 'darkify') |
| 280 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ColorPalette, { |
| 281 |
value: light_icon_color, |
| 282 |
onChange: val => setAttributes({ |
| 283 |
light_icon_color: val |
| 284 |
}) |
| 285 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { |
| 286 |
children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Dark Mode Icon Color', 'darkify') |
| 287 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ColorPalette, { |
| 288 |
value: dark_icon_color, |
| 289 |
onChange: val => setAttributes({ |
| 290 |
dark_icon_color: val |
| 291 |
}) |
| 292 |
})] |
| 293 |
}), style === 'dual' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, { |
| 294 |
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { |
| 295 |
children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Light Mode Text Color', 'darkify') |
| 296 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ColorPalette, { |
| 297 |
value: light_text_color, |
| 298 |
onChange: val => setAttributes({ |
| 299 |
light_text_color: val |
| 300 |
}) |
| 301 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { |
| 302 |
children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Dark Mode Text Color', 'darkify') |
| 303 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ColorPalette, { |
| 304 |
value: dark_text_color, |
| 305 |
onChange: val => setAttributes({ |
| 306 |
dark_text_color: val |
| 307 |
}) |
| 308 |
})] |
| 309 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.RangeControl, { |
| 310 |
label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Border Width', 'darkify'), |
| 311 |
value: border_width, |
| 312 |
onChange: val => setAttributes({ |
| 313 |
border_width: val |
| 314 |
}), |
| 315 |
min: 0, |
| 316 |
max: 20 |
| 317 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { |
| 318 |
children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Border Light Color', 'darkify') |
| 319 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ColorPalette, { |
| 320 |
value: border_light_color, |
| 321 |
onChange: val => setAttributes({ |
| 322 |
border_light_color: val |
| 323 |
}) |
| 324 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { |
| 325 |
children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Border Dark Color', 'darkify') |
| 326 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ColorPalette, { |
| 327 |
value: border_dark_color, |
| 328 |
onChange: val => setAttributes({ |
| 329 |
border_dark_color: val |
| 330 |
}) |
| 331 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.RangeControl, { |
| 332 |
label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Border Radius', 'darkify'), |
| 333 |
value: border_radius, |
| 334 |
onChange: val => setAttributes({ |
| 335 |
border_radius: val |
| 336 |
}), |
| 337 |
min: 0, |
| 338 |
max: 100 |
| 339 |
})] |
| 340 |
}) |
| 341 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)((_wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_3___default()), { |
| 342 |
block: "darkify/switcher", |
| 343 |
attributes: attributes |
| 344 |
})] |
| 345 |
}); |
| 346 |
} |
| 347 |
|
| 348 |
/***/ }), |
| 349 |
|
| 350 |
/***/ "./src/editor.scss": |
| 351 |
/*!*************************!*\ |
| 352 |
!*** ./src/editor.scss ***! |
| 353 |
\*************************/ |
| 354 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 355 |
|
| 356 |
__webpack_require__.r(__webpack_exports__); |
| 357 |
// extracted by mini-css-extract-plugin |
| 358 |
|
| 359 |
|
| 360 |
/***/ }), |
| 361 |
|
| 362 |
/***/ "./src/save.js": |
| 363 |
/*!*********************!*\ |
| 364 |
!*** ./src/save.js ***! |
| 365 |
\*********************/ |
| 366 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 367 |
|
| 368 |
__webpack_require__.r(__webpack_exports__); |
| 369 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 370 |
/* harmony export */ "default": () => (/* binding */ save) |
| 371 |
/* harmony export */ }); |
| 372 |
function save() { |
| 373 |
return null; |
| 374 |
} |
| 375 |
|
| 376 |
/***/ }), |
| 377 |
|
| 378 |
/***/ "@wordpress/block-editor": |
| 379 |
/*!*************************************!*\ |
| 380 |
!*** external ["wp","blockEditor"] ***! |
| 381 |
\*************************************/ |
| 382 |
/***/ ((module) => { |
| 383 |
|
| 384 |
module.exports = window["wp"]["blockEditor"]; |
| 385 |
|
| 386 |
/***/ }), |
| 387 |
|
| 388 |
/***/ "@wordpress/blocks": |
| 389 |
/*!********************************!*\ |
| 390 |
!*** external ["wp","blocks"] ***! |
| 391 |
\********************************/ |
| 392 |
/***/ ((module) => { |
| 393 |
|
| 394 |
module.exports = window["wp"]["blocks"]; |
| 395 |
|
| 396 |
/***/ }), |
| 397 |
|
| 398 |
/***/ "@wordpress/components": |
| 399 |
/*!************************************!*\ |
| 400 |
!*** external ["wp","components"] ***! |
| 401 |
\************************************/ |
| 402 |
/***/ ((module) => { |
| 403 |
|
| 404 |
module.exports = window["wp"]["components"]; |
| 405 |
|
| 406 |
/***/ }), |
| 407 |
|
| 408 |
/***/ "@wordpress/i18n": |
| 409 |
/*!******************************!*\ |
| 410 |
!*** external ["wp","i18n"] ***! |
| 411 |
\******************************/ |
| 412 |
/***/ ((module) => { |
| 413 |
|
| 414 |
module.exports = window["wp"]["i18n"]; |
| 415 |
|
| 416 |
/***/ }), |
| 417 |
|
| 418 |
/***/ "@wordpress/server-side-render": |
| 419 |
/*!******************************************!*\ |
| 420 |
!*** external ["wp","serverSideRender"] ***! |
| 421 |
\******************************************/ |
| 422 |
/***/ ((module) => { |
| 423 |
|
| 424 |
module.exports = window["wp"]["serverSideRender"]; |
| 425 |
|
| 426 |
/***/ }), |
| 427 |
|
| 428 |
/***/ "react": |
| 429 |
/*!************************!*\ |
| 430 |
!*** external "React" ***! |
| 431 |
\************************/ |
| 432 |
/***/ ((module) => { |
| 433 |
|
| 434 |
module.exports = window["React"]; |
| 435 |
|
| 436 |
/***/ }), |
| 437 |
|
| 438 |
/***/ "react/jsx-runtime": |
| 439 |
/*!**********************************!*\ |
| 440 |
!*** external "ReactJSXRuntime" ***! |
| 441 |
\**********************************/ |
| 442 |
/***/ ((module) => { |
| 443 |
|
| 444 |
module.exports = window["ReactJSXRuntime"]; |
| 445 |
|
| 446 |
/***/ }) |
| 447 |
|
| 448 |
/******/ }); |
| 449 |
/************************************************************************/ |
| 450 |
/******/ // The module cache |
| 451 |
/******/ var __webpack_module_cache__ = {}; |
| 452 |
/******/ |
| 453 |
/******/ // The require function |
| 454 |
/******/ function __webpack_require__(moduleId) { |
| 455 |
/******/ // Check if module is in cache |
| 456 |
/******/ var cachedModule = __webpack_module_cache__[moduleId]; |
| 457 |
/******/ if (cachedModule !== undefined) { |
| 458 |
/******/ return cachedModule.exports; |
| 459 |
/******/ } |
| 460 |
/******/ // Create a new module (and put it into the cache) |
| 461 |
/******/ var module = __webpack_module_cache__[moduleId] = { |
| 462 |
/******/ // no module.id needed |
| 463 |
/******/ // no module.loaded needed |
| 464 |
/******/ exports: {} |
| 465 |
/******/ }; |
| 466 |
/******/ |
| 467 |
/******/ // Execute the module function |
| 468 |
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
| 469 |
/******/ |
| 470 |
/******/ // Return the exports of the module |
| 471 |
/******/ return module.exports; |
| 472 |
/******/ } |
| 473 |
/******/ |
| 474 |
/************************************************************************/ |
| 475 |
/******/ /* webpack/runtime/compat get default export */ |
| 476 |
/******/ (() => { |
| 477 |
/******/ // getDefaultExport function for compatibility with non-harmony modules |
| 478 |
/******/ __webpack_require__.n = (module) => { |
| 479 |
/******/ var getter = module && module.__esModule ? |
| 480 |
/******/ () => (module['default']) : |
| 481 |
/******/ () => (module); |
| 482 |
/******/ __webpack_require__.d(getter, { a: getter }); |
| 483 |
/******/ return getter; |
| 484 |
/******/ }; |
| 485 |
/******/ })(); |
| 486 |
/******/ |
| 487 |
/******/ /* webpack/runtime/define property getters */ |
| 488 |
/******/ (() => { |
| 489 |
/******/ // define getter functions for harmony exports |
| 490 |
/******/ __webpack_require__.d = (exports, definition) => { |
| 491 |
/******/ for(var key in definition) { |
| 492 |
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
| 493 |
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
| 494 |
/******/ } |
| 495 |
/******/ } |
| 496 |
/******/ }; |
| 497 |
/******/ })(); |
| 498 |
/******/ |
| 499 |
/******/ /* webpack/runtime/hasOwnProperty shorthand */ |
| 500 |
/******/ (() => { |
| 501 |
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
| 502 |
/******/ })(); |
| 503 |
/******/ |
| 504 |
/******/ /* webpack/runtime/make namespace object */ |
| 505 |
/******/ (() => { |
| 506 |
/******/ // define __esModule on exports |
| 507 |
/******/ __webpack_require__.r = (exports) => { |
| 508 |
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
| 509 |
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
| 510 |
/******/ } |
| 511 |
/******/ Object.defineProperty(exports, '__esModule', { value: true }); |
| 512 |
/******/ }; |
| 513 |
/******/ })(); |
| 514 |
/******/ |
| 515 |
/************************************************************************/ |
| 516 |
var __webpack_exports__ = {}; |
| 517 |
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk. |
| 518 |
(() => { |
| 519 |
/*!**********************!*\ |
| 520 |
!*** ./src/index.js ***! |
| 521 |
\**********************/ |
| 522 |
__webpack_require__.r(__webpack_exports__); |
| 523 |
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); |
| 524 |
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); |
| 525 |
/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../block.json */ "./block.json"); |
| 526 |
/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/edit.js"); |
| 527 |
/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./save */ "./src/save.js"); |
| 528 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); |
| 529 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__); |
| 530 |
|
| 531 |
|
| 532 |
|
| 533 |
|
| 534 |
|
| 535 |
const DarkifyIcon = () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("svg", { |
| 536 |
width: "24", |
| 537 |
height: "24", |
| 538 |
viewBox: "0 0 44 44", |
| 539 |
xmlns: "http://www.w3.org/2000/svg", |
| 540 |
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("path", { |
| 541 |
d: "M23.5 1.5C23.5 0.671573 22.8284 0 22 0C21.1716 0 20.5 0.671573 20.5 1.5V4.5C20.5 5.32843 21.1716 6 22 6C22.8284 6 23.5 5.32843 23.5 4.5V1.5Z", |
| 542 |
fill: "currentColor" |
| 543 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("path", { |
| 544 |
d: "M34 22C34 28.6274 28.6274 34 22 34C15.3726 34 10 28.6274 10 22C10 15.3726 15.3726 10 22 10C28.6274 10 34 15.3726 34 22Z", |
| 545 |
fill: "currentColor" |
| 546 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("path", { |
| 547 |
d: "M22 38C22.8284 38 23.5 38.6716 23.5 39.5V42.5C23.5 43.3284 22.8284 44 22 44C21.1716 44 20.5 43.3284 20.5 42.5V39.5C20.5 38.6716 21.1716 38 22 38Z", |
| 548 |
fill: "currentColor" |
| 549 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("path", { |
| 550 |
d: "M10.6863 10.6863C10.1005 11.2721 9.15074 11.2721 8.56495 10.6863L6.44363 8.56498C5.85784 7.97919 5.85784 7.02945 6.44363 6.44366C7.02942 5.85787 7.97916 5.85787 8.56495 6.44366L10.6863 8.56498C11.2721 9.15077 11.2721 10.1005 10.6863 10.6863Z", |
| 551 |
fill: "currentColor" |
| 552 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("path", { |
| 553 |
d: "M35.435 37.5564C36.0208 38.1421 36.9705 38.1421 37.5563 37.5564C38.1421 36.9706 38.1421 36.0208 37.5563 35.435L35.435 33.3137C34.8492 32.7279 33.8995 32.7279 33.3137 33.3137C32.7279 33.8995 32.7279 34.8493 33.3137 35.435L35.435 37.5564Z", |
| 554 |
fill: "currentColor" |
| 555 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("path", { |
| 556 |
d: "M10.6863 33.3137C11.2721 33.8995 11.2721 34.8492 10.6863 35.435L8.56495 37.5563C7.97916 38.1421 7.02942 38.1421 6.44363 37.5563C5.85784 36.9706 5.85784 36.0208 6.44363 35.435L8.56495 33.3137C9.15074 32.7279 10.1005 32.7279 10.6863 33.3137Z", |
| 557 |
fill: "currentColor" |
| 558 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("path", { |
| 559 |
d: "M37.5563 8.56496C38.1421 7.97918 38.1421 7.02943 37.5563 6.44364C36.9705 5.85786 36.0208 5.85786 35.435 6.44364L33.3137 8.56496C32.7279 9.15075 32.7279 10.1005 33.3137 10.6863C33.8995 11.2721 34.8492 11.2721 35.435 10.6863L37.5563 8.56496Z", |
| 560 |
fill: "currentColor" |
| 561 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("path", { |
| 562 |
d: "M6 22C6 22.8284 5.32843 23.5 4.5 23.5H1.5C0.671573 23.5 0 22.8284 0 22C0 21.1716 0.671573 20.5 1.5 20.5H4.5C5.32843 20.5 6 21.1716 6 22Z", |
| 563 |
fill: "currentColor" |
| 564 |
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("path", { |
| 565 |
d: "M42.5 23.5C43.3284 23.5 44 22.8284 44 22C44 21.1716 43.3284 20.5 42.5 20.5H39.5C38.6716 20.5 38 21.1716 38 22C38 22.8284 38.6716 23.5 39.5 23.5H42.5Z", |
| 566 |
fill: "currentColor" |
| 567 |
})] |
| 568 |
}); |
| 569 |
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_1__.name, { |
| 570 |
title: _block_json__WEBPACK_IMPORTED_MODULE_1__.title, |
| 571 |
icon: DarkifyIcon, |
| 572 |
edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"], |
| 573 |
save: _save__WEBPACK_IMPORTED_MODULE_3__["default"] |
| 574 |
}); |
| 575 |
})(); |
| 576 |
|
| 577 |
/******/ })() |
| 578 |
; |
| 579 |
//# sourceMappingURL=index.js.map |