diff --git a/build/index.asset.php b/build/index.asset.php index a9ed522..797b1d1 100644 --- a/build/index.asset.php +++ b/build/index.asset.php @@ -1 +1 @@ - array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'd70148a610fb16d5fa51'); + array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '92ae1efb2b6dd584875c'); diff --git a/build/index.css b/build/index.css new file mode 100644 index 0000000..8afb0d8 --- /dev/null +++ b/build/index.css @@ -0,0 +1 @@ +.wp-block-tabor-dark-mode-toggle{--icon-size:16px}.wp-block-tabor-dark-mode-toggle.is-medium{--icon-size:18px}.wp-block-tabor-dark-mode-toggle.is-large{--icon-size:20px}.wp-block-tabor-dark-mode-toggle__label{align-items:center;display:flex;margin:0}.wp-block-tabor-dark-mode-toggle__input{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}.wp-block-tabor-dark-mode-toggle__track{align-items:center;border-radius:100px;cursor:pointer;display:flex;height:calc(var(--icon-size)*1.75);padding:0 calc(var(--icon-size)*.25);position:relative;transition:background-color var(--wp--custom--transition--duration,.2s) ease-out;width:calc(var(--icon-size)*2.5)}.wp-block-tabor-dark-mode-toggle__track:not(.has-background){background:var(--wp--preset--color--theme-3)}.wp-block-tabor-dark-mode-toggle__track:not(.has-background):hover{background-color:var(--wp--preset--color--theme-4);color:var(--wp--preset--color--theme-6)}.wp-block-tabor-dark-mode-toggle__selector{align-items:center;border-radius:100%;display:flex;height:calc(var(--icon-size)*1.25);justify-content:center;transition:transform var(--wp--custom--transition--duration,.2s) ease-out;width:calc(var(--icon-size)*1.25);will-change:transform}.wp-block-tabor-dark-mode-toggle__icon{backface-visibility:hidden;border-radius:100%;color:currentcolor;opacity:1;position:absolute}.wp-block-tabor-dark-mode-toggle__icon,.wp-block-tabor-dark-mode-toggle__icon svg{height:var(--icon-size);width:var(--icon-size)}.theme-dark .wp-block-tabor-dark-mode-toggle__input+.wp-block-tabor-dark-mode-toggle__track .wp-block-tabor-dark-mode-toggle__selector{transform:translateX(calc(var(--icon-size)*1.25))}.theme-dark .wp-block-tabor-dark-mode-toggle__icon--light,.wp-block-tabor-dark-mode-toggle__icon--dark{visibility:hidden}.theme-dark .wp-block-tabor-dark-mode-toggle__icon--dark{visibility:visible} diff --git a/build/index.js b/build/index.js index a41bd52..bb4b286 100644 --- a/build/index.js +++ b/build/index.js @@ -1,1026 +1,4 @@ -/******/ (() => { // webpackBootstrap -/******/ var __webpack_modules__ = ({ - -/***/ "./src/edit.js": -/*!*********************!*\ - !*** ./src/edit.js ***! - \*********************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ Edit) -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); -/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var _icons__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./icons */ "./src/icons.js"); - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - -/** - * The edit function describes the structure of your block in the context of the - * editor. This represents what the editor will render when the block is used. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit - */ -function Edit({ - attributes, - setAttributes -}) { - const { - className, - icon, - size - } = attributes; - const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps)({ - className: classnames__WEBPACK_IMPORTED_MODULE_1___default()({ - [`is-${size}`]: size - }) - }); - const colorProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.__experimentalUseColorProps)(attributes); - const borderProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.__experimentalUseBorderProps)(attributes); - const spacingProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.__experimentalGetSpacingClassesAndStyles)(attributes); - - // Dynamically determine which icon to use for each style. - const LightIcon = _icons__WEBPACK_IMPORTED_MODULE_6__.Icons[icon]?.light || _icons__WEBPACK_IMPORTED_MODULE_6__.Icons.filled?.light; - const DarkIcon = _icons__WEBPACK_IMPORTED_MODULE_6__.Icons[icon]?.dark || _icons__WEBPACK_IMPORTED_MODULE_6__.Icons.filled?.dark; - (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => { - // Map class names to icon attribute. - const styleToIcons = { - 'is-style-stroke': 'stroke', - 'is-style-circle': 'circle', - 'is-style-eye': 'eye' - }; - - // Find the first matching style and set the corresponding icon. - const iconString = Object.keys(styleToIcons).find(style => className?.includes(style)); - if (iconString) { - setAttributes({ - icon: styleToIcons[iconString] - }); - } else { - // Reset or handle the attribute when no styles are matched. - setAttributes({ - icon: undefined - }); - } - }, [className, setAttributes]); - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.InspectorControls, { - group: "styles" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.__experimentalToolsPanel, { - label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Size', 'dark-mode-toggle-block') - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.__experimentalToolsPanelItem, { - label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Size', 'dark-mode-toggle-block'), - isShownByDefault: true, - hasValue: () => !!size, - onDeselect: () => setAttributes({ - size: undefined - }) - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.__experimentalToggleGroupControl, { - label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Size', 'dark-mode-toggle-block'), - hideLabelFromVision: true, - value: size, - onChange: value => { - setAttributes({ - size: value - }); - }, - isBlock: true, - size: '__unstable-large', - __nextHasNoMarginBottom: true - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.__experimentalToggleGroupControlOption, { - value: "small" - /* translators: S stands for 'small' and is a size label. */, - label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('S', 'dark-mode-toggle-block'), - "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Small', 'dark-mode-toggle-block') - }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.__experimentalToggleGroupControlOption, { - value: "medium" - /* translators: M stands for 'medium' and is a size label. */, - label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('M', 'dark-mode-toggle-block'), - "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Medium', 'dark-mode-toggle-block') - }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.__experimentalToggleGroupControlOption, { - value: "large" - /* translators: M stands for 'medium' and is a size label. */, - label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('L', 'dark-mode-toggle-block'), - "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Large', 'dark-mode-toggle-block') - }))))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - ...blockProps - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Disabled, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("label", { - className: "wp-block-tabor-dark-mode-toggle__label", - htmlFor: "theme-toggle" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("input", { - type: "checkbox", - className: "wp-block-tabor-dark-mode-toggle__input", - id: "theme-toggle", - "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Toggle dark mode', 'dark-mode-toggle-block') - }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { - className: classnames__WEBPACK_IMPORTED_MODULE_1___default()(className, 'wp-block-tabor-dark-mode-toggle__track', colorProps.className, borderProps.className), - style: { - ...borderProps.style, - ...colorProps.style, - ...spacingProps.style - } - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { - className: "wp-block-tabor-dark-mode-toggle__selector", - style: { - ...colorProps.style.text - } - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { - className: "wp-block-tabor-dark-mode-toggle__icon wp-block-tabor-dark-mode-toggle__icon--light", - "aria-hidden": "true" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Icon, { - icon: LightIcon, - size: 16 - })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { - className: "wp-block-tabor-dark-mode-toggle__icon wp-block-tabor-dark-mode-toggle__icon--dark", - "aria-hidden": "true" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Icon, { - icon: DarkIcon, - size: 16 - })))))))); -} - -/***/ }), - -/***/ "./src/icons.js": -/*!**********************!*\ - !*** ./src/icons.js ***! - \**********************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ Icons: () => (/* binding */ Icons) -/* harmony export */ }); -/* harmony import */ var _icons_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./icons/index.js */ "./src/icons/index.js"); - -const Icons = { - filled: { - light: _icons_index_js__WEBPACK_IMPORTED_MODULE_0__.FilledLight, - dark: _icons_index_js__WEBPACK_IMPORTED_MODULE_0__.FilledDark - }, - stroke: { - light: _icons_index_js__WEBPACK_IMPORTED_MODULE_0__.StrokeLight, - dark: _icons_index_js__WEBPACK_IMPORTED_MODULE_0__.StrokeDark - }, - circle: { - light: _icons_index_js__WEBPACK_IMPORTED_MODULE_0__.CircleLight, - dark: _icons_index_js__WEBPACK_IMPORTED_MODULE_0__.CircleDark - }, - eye: { - light: _icons_index_js__WEBPACK_IMPORTED_MODULE_0__.EyeLight, - dark: _icons_index_js__WEBPACK_IMPORTED_MODULE_0__.EyeDark - } -}; - -/***/ }), - -/***/ "./src/icons/index.js": -/*!****************************!*\ - !*** ./src/icons/index.js ***! - \****************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ CircleDark: () => (/* reexport safe */ _library_circle_dark__WEBPACK_IMPORTED_MODULE_5__["default"]), -/* harmony export */ CircleLight: () => (/* reexport safe */ _library_circle_light__WEBPACK_IMPORTED_MODULE_4__["default"]), -/* harmony export */ EyeDark: () => (/* reexport safe */ _library_eye_dark__WEBPACK_IMPORTED_MODULE_7__["default"]), -/* harmony export */ EyeLight: () => (/* reexport safe */ _library_eye_light__WEBPACK_IMPORTED_MODULE_6__["default"]), -/* harmony export */ FilledDark: () => (/* reexport safe */ _library_filled_dark__WEBPACK_IMPORTED_MODULE_1__["default"]), -/* harmony export */ FilledLight: () => (/* reexport safe */ _library_filled_light__WEBPACK_IMPORTED_MODULE_0__["default"]), -/* harmony export */ StrokeDark: () => (/* reexport safe */ _library_stroke_dark__WEBPACK_IMPORTED_MODULE_3__["default"]), -/* harmony export */ StrokeLight: () => (/* reexport safe */ _library_stroke_light__WEBPACK_IMPORTED_MODULE_2__["default"]) -/* harmony export */ }); -/* harmony import */ var _library_filled_light__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./library/filled-light */ "./src/icons/library/filled-light.js"); -/* harmony import */ var _library_filled_dark__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./library/filled-dark */ "./src/icons/library/filled-dark.js"); -/* harmony import */ var _library_stroke_light__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./library/stroke-light */ "./src/icons/library/stroke-light.js"); -/* harmony import */ var _library_stroke_dark__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./library/stroke-dark */ "./src/icons/library/stroke-dark.js"); -/* harmony import */ var _library_circle_light__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./library/circle-light */ "./src/icons/library/circle-light.js"); -/* harmony import */ var _library_circle_dark__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./library/circle-dark */ "./src/icons/library/circle-dark.js"); -/* harmony import */ var _library_eye_light__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./library/eye-light */ "./src/icons/library/eye-light.js"); -/* harmony import */ var _library_eye_dark__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./library/eye-dark */ "./src/icons/library/eye-dark.js"); - - - - - - - - - -/***/ }), - -/***/ "./src/icons/library/circle-dark.js": -/*!******************************************!*\ - !*** ./src/icons/library/circle-dark.js ***! - \******************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); - -/** - * WordPress dependencies - */ - -const svg = (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SVG, { - xmlns: "http://www.w3.org/2000/svg", - width: "24", - height: "24", - fill: "none", - viewBox: "0 0 24 24" -}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Path, { - fill: "currentColor", - fillRule: "evenodd", - d: "M12 4a8 8 0 1 0 0 16V4ZM2 12C2 6.477 6.477 2 12 2c.375 0 .745.02 1.11.061C18.11 2.614 22 6.852 22 12s-3.89 9.386-8.89 9.939c-.365.04-.735.061-1.11.061-5.523 0-10-4.477-10-10Z", - clipRule: "evenodd" -})); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (svg); - -/***/ }), - -/***/ "./src/icons/library/circle-light.js": -/*!*******************************************!*\ - !*** ./src/icons/library/circle-light.js ***! - \*******************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); - -/** - * WordPress dependencies - */ - -const svg = (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SVG, { - xmlns: "http://www.w3.org/2000/svg", - width: "24", - height: "24", - fill: "none", - viewBox: "0 0 24 24" -}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Path, { - fill: "currentColor", - fillRule: "evenodd", - d: "M12 4a8 8 0 1 0 0 16V4ZM2 12C2 6.477 6.477 2 12 2c.375 0 .745.02 1.11.061C18.11 2.614 22 6.852 22 12s-3.89 9.386-8.89 9.939c-.365.04-.735.061-1.11.061-5.523 0-10-4.477-10-10Z", - clipRule: "evenodd" -})); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (svg); - -/***/ }), - -/***/ "./src/icons/library/eye-dark.js": -/*!***************************************!*\ - !*** ./src/icons/library/eye-dark.js ***! - \***************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); - -/** - * WordPress dependencies - */ - -const svg = (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SVG, { - xmlns: "http://www.w3.org/2000/svg", - width: "24", - height: "24", - fill: "none", - viewBox: "0 0 24 24" -}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Path, { - fill: "currentColor", - d: "M4.728 12.253a1 1 0 0 0-1.456 1.37c1.182 1.258 2.5 2.227 3.896 2.898l-1.024 1.694a1 1 0 0 0 1.712 1.034l1.214-2.01c.636.178 1.28.297 1.93.357V20a1 1 0 1 0 2 0v-2.404c.65-.06 1.294-.18 1.93-.356l1.214 2.01a1 1 0 1 0 1.712-1.035l-1.024-1.694c1.395-.671 2.714-1.64 3.896-2.898a1 1 0 1 0-1.457-1.37c-2.153 2.29-4.736 3.39-7.271 3.39s-5.118-1.1-7.272-3.39Z" -})); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (svg); - -/***/ }), - -/***/ "./src/icons/library/eye-light.js": -/*!****************************************!*\ - !*** ./src/icons/library/eye-light.js ***! - \****************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); - -/** - * WordPress dependencies - */ - -const svg = (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SVG, { - xmlns: "http://www.w3.org/2000/svg", - width: "24", - height: "24", - fill: "none", - viewBox: "0 0 24 24" -}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Path, { - fill: "currentColor", - fillRule: "evenodd", - d: "M12 6c-3.127 0-6.367 1.79-8.638 5.606a.77.77 0 0 0 0 .788C5.633 16.209 8.873 18 12 18s6.367-1.79 8.638-5.606a.77.77 0 0 0 0-.788C18.367 7.791 15.127 6 12 6Zm0-2c3.952 0 7.79 2.272 10.357 6.583a2.77 2.77 0 0 1 0 2.834C19.79 17.727 15.952 20 12 20c-3.952 0-7.79-2.272-10.357-6.583a2.77 2.77 0 0 1 0-2.834C4.21 6.273 8.048 4 12 4Zm0 6a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm-4 2a4 4 0 1 1 8 0 4 4 0 0 1-8 0Z", - clipRule: "evenodd" -})); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (svg); - -/***/ }), - -/***/ "./src/icons/library/filled-dark.js": -/*!******************************************!*\ - !*** ./src/icons/library/filled-dark.js ***! - \******************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); - -/** - * WordPress dependencies - */ - -const svg = (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SVG, { - xmlns: "http://www.w3.org/2000/svg", - width: "24", - height: "24", - fill: "none", - viewBox: "0 0 24 24" -}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Path, { - fill: "currentColor", - d: "M12.056 3.6a1 1 0 0 0-.908-1.564c-5.123.434-9.144 4.728-9.144 9.962 0 5.522 4.476 9.998 9.998 9.998 5.234 0 9.528-4.021 9.962-9.144a1 1 0 0 0-1.564-.908A6 6 0 0 1 12.055 3.6Z" -})); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (svg); - -/***/ }), - -/***/ "./src/icons/library/filled-light.js": -/*!*******************************************!*\ - !*** ./src/icons/library/filled-light.js ***! - \*******************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); - -/** - * WordPress dependencies - */ - -const svg = (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SVG, { - xmlns: "http://www.w3.org/2000/svg", - width: "24", - height: "24", - fill: "none", - viewBox: "0 0 24 24" -}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Path, { - fill: "currentColor", - d: "M13 2a1 1 0 1 0-2 0v1a1 1 0 1 0 2 0V2Zm0 19a1 1 0 1 0-2 0v1a1 1 0 1 0 2 0v-1Zm6.777-16.777a1 1 0 0 1 0 1.414l-.71.71a1 1 0 1 1-1.414-1.414l.71-.71a1 1 0 0 1 1.414 0ZM6.347 19.067a1 1 0 1 0-1.414-1.414l-.71.71a1 1 0 1 0 1.414 1.414l.71-.71ZM20 12a1 1 0 0 1 1-1h1a1 1 0 1 1 0 2h-1a1 1 0 0 1-1-1ZM2 11a1 1 0 1 0 0 2h1a1 1 0 1 0 0-2H2Zm15.653 6.653a1 1 0 0 1 1.414 0l.71.71a1 1 0 0 1-1.414 1.414l-.71-.71a1 1 0 0 1 0-1.414ZM5.637 4.223a1 1 0 1 0-1.414 1.414l.71.71a1 1 0 0 0 1.414-1.414l-.71-.71Zm2.12 3.534a6 6 0 1 1 8.486 8.486 6 6 0 0 1-8.486-8.486Z" -})); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (svg); - -/***/ }), - -/***/ "./src/icons/library/stroke-dark.js": -/*!******************************************!*\ - !*** ./src/icons/library/stroke-dark.js ***! - \******************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); - -/** - * WordPress dependencies - */ - -const svg = (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SVG, { - xmlns: "http://www.w3.org/2000/svg", - width: "24", - height: "24", - fill: "none", - viewBox: "0 0 24 24" -}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Path, { - fill: "currentColor", - fillRule: "evenodd", - d: "M12.097 2.53a1 1 0 0 1-.041 1.07 6 6 0 0 0 8.345 8.344 1 1 0 0 1 1.563.908c-.434 5.122-4.728 9.144-9.962 9.144-5.522 0-9.998-4.476-9.998-9.998 0-5.234 4.021-9.528 9.144-9.962a1 1 0 0 1 .949.494ZM9.424 4.424a7.998 7.998 0 1 0 10.152 10.152A8 8 0 0 1 9.424 4.424Z", - clipRule: "evenodd" -})); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (svg); - -/***/ }), - -/***/ "./src/icons/library/stroke-light.js": -/*!*******************************************!*\ - !*** ./src/icons/library/stroke-light.js ***! - \*******************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); - -/** - * WordPress dependencies - */ - -const svg = (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SVG, { - xmlns: "http://www.w3.org/2000/svg", - width: "24", - height: "24", - fill: "none", - viewBox: "0 0 24 24" -}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Path, { - fill: "currentColor", - fillRule: "evenodd", - d: "M12 1a1 1 0 0 1 1 1v1a1 1 0 1 1-2 0V2a1 1 0 0 1 1-1ZM4.223 4.223a1 1 0 0 1 1.414 0l.71.71a1 1 0 1 1-1.414 1.414l-.71-.71a1 1 0 0 1 0-1.414Zm15.554 0a1 1 0 0 1 0 1.414l-.71.71a1 1 0 0 1-1.414-1.414l.71-.71a1 1 0 0 1 1.414 0ZM9.172 9.172a4 4 0 1 0 5.656 5.656 4 4 0 0 0-5.656-5.656ZM7.757 7.757a6 6 0 1 1 8.486 8.486 6 6 0 0 1-8.486-8.486ZM1 12a1 1 0 0 1 1-1h1a1 1 0 1 1 0 2H2a1 1 0 0 1-1-1Zm19 0a1 1 0 0 1 1-1h1a1 1 0 1 1 0 2h-1a1 1 0 0 1-1-1ZM6.347 17.653a1 1 0 0 1 0 1.414l-.71.71a1 1 0 0 1-1.414-1.414l.71-.71a1 1 0 0 1 1.414 0Zm11.306 0a1 1 0 0 1 1.414 0l.71.71a1 1 0 0 1-1.414 1.414l-.71-.71a1 1 0 0 1 0-1.414ZM12 20a1 1 0 0 1 1 1v1a1 1 0 1 1-2 0v-1a1 1 0 0 1 1-1Z", - clipRule: "evenodd" -})); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (svg); - -/***/ }), - -/***/ "./src/index.js": -/*!**********************!*\ - !*** ./src/index.js ***! - \**********************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./style.scss */ "./src/style.scss"); -/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./edit */ "./src/edit.js"); -/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./block.json */ "./src/block.json"); -/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./save */ "./src/save.js"); - -/** - * Registers a new block provided a unique name and an object defining its behavior. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ - */ - - -/** - * WordPress dependencies - */ - - -/** - * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. - * All files containing `style` keyword are bundled together. The code used - * gets applied both to the front of your site and to the editor. - * - * @see https://www.npmjs.com/package/@wordpress/scripts#using-css - */ - - -/** - * Internal dependencies - */ - - - - -/** - * Every block starts by registering a new block type definition. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ - */ -(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_5__.name, { - icon: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.SVG, { - width: "24", - height: "24", - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Path, { - d: "M12.056 5.25626C12.2319 5.00102 12.2448 4.6672 12.0891 4.39911C11.9335 4.13101 11.6372 3.9767 11.3283 4.00287C7.22296 4.35074 4 7.79206 4 11.987C4 16.4125 7.58755 20 12.013 20C16.208 20 19.6495 16.777 19.9971 12.6714C20.0233 12.3625 19.869 12.0663 19.6009 11.9106C19.3328 11.755 18.999 11.768 18.7437 11.9439C17.9695 12.4776 17.0318 12.79 16.0186 12.79C13.3629 12.79 11.2099 10.637 11.2099 7.98124C11.2099 6.96821 11.5223 6.03055 12.056 5.25626Z", - fill: "currentColor" - })), - example: {}, - edit: _edit__WEBPACK_IMPORTED_MODULE_4__["default"], - save: _save__WEBPACK_IMPORTED_MODULE_6__["default"] -}); - -/***/ }), - -/***/ "./src/save.js": -/*!*********************!*\ - !*** ./src/save.js ***! - \*********************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ Save) -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); -/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./icons */ "./src/icons.js"); - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - -function Save({ - attributes -}) { - const { - className, - icon, - size - } = attributes; - const colorProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.__experimentalGetColorClassesAndStyles)(attributes); - const borderProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.__experimentalGetBorderClassesAndStyles)(attributes); - const spacingProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.__experimentalGetSpacingClassesAndStyles)(attributes); - - // Dynamically determine which icon to use for each style. - const LightIcon = _icons__WEBPACK_IMPORTED_MODULE_4__.Icons[icon]?.light || _icons__WEBPACK_IMPORTED_MODULE_4__.Icons.filled?.light; - const DarkIcon = _icons__WEBPACK_IMPORTED_MODULE_4__.Icons[icon]?.dark || _icons__WEBPACK_IMPORTED_MODULE_4__.Icons.filled?.dark; - const classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()(className, { - [`is-${size}`]: size - }); - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps.save({ - className: classes - }) - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("label", { - className: "wp-block-tabor-dark-mode-toggle__label", - htmlFor: "theme-toggle" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("input", { - type: "checkbox", - className: "wp-block-tabor-dark-mode-toggle__input", - id: "theme-toggle", - "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Toggle dark mode', 'dark-mode-toggle-block') - }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { - className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('wp-block-tabor-dark-mode-toggle__track', colorProps.className, borderProps.className), - style: { - ...borderProps.style, - ...colorProps.style, - ...spacingProps.style - } - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { - className: "wp-block-tabor-dark-mode-toggle__selector", - style: { - ...colorProps.style - } - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { - className: "wp-block-tabor-dark-mode-toggle__icon wp-block-tabor-dark-mode-toggle__icon--light", - "aria-hidden": "true" - }, LightIcon), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { - className: "wp-block-tabor-dark-mode-toggle__icon wp-block-tabor-dark-mode-toggle__icon--dark", - "aria-hidden": "true" - }, DarkIcon))))); -} - -/***/ }), - -/***/ "./src/style.scss": -/*!************************!*\ - !*** ./src/style.scss ***! - \************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -// extracted by mini-css-extract-plugin - - -/***/ }), - -/***/ "react": -/*!************************!*\ - !*** external "React" ***! - \************************/ -/***/ ((module) => { - -"use strict"; -module.exports = window["React"]; - -/***/ }), - -/***/ "@wordpress/block-editor": -/*!*************************************!*\ - !*** external ["wp","blockEditor"] ***! - \*************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = window["wp"]["blockEditor"]; - -/***/ }), - -/***/ "@wordpress/blocks": -/*!********************************!*\ - !*** external ["wp","blocks"] ***! - \********************************/ -/***/ ((module) => { - -"use strict"; -module.exports = window["wp"]["blocks"]; - -/***/ }), - -/***/ "@wordpress/components": -/*!************************************!*\ - !*** external ["wp","components"] ***! - \************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = window["wp"]["components"]; - -/***/ }), - -/***/ "@wordpress/element": -/*!*********************************!*\ - !*** external ["wp","element"] ***! - \*********************************/ -/***/ ((module) => { - -"use strict"; -module.exports = window["wp"]["element"]; - -/***/ }), - -/***/ "@wordpress/i18n": -/*!******************************!*\ - !*** external ["wp","i18n"] ***! - \******************************/ -/***/ ((module) => { - -"use strict"; -module.exports = window["wp"]["i18n"]; - -/***/ }), - -/***/ "./node_modules/classnames/index.js": -/*!******************************************!*\ - !*** ./node_modules/classnames/index.js ***! - \******************************************/ -/***/ ((module, exports) => { - -var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/ -/* global define */ - -(function () { - 'use strict'; - - var hasOwn = {}.hasOwnProperty; - - function classNames () { - var classes = ''; - - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - if (arg) { - classes = appendClass(classes, parseValue(arg)); - } - } - - return classes; - } - - function parseValue (arg) { - if (typeof arg === 'string' || typeof arg === 'number') { - return arg; - } - - if (typeof arg !== 'object') { - return ''; - } - - if (Array.isArray(arg)) { - return classNames.apply(null, arg); - } - - if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) { - return arg.toString(); - } - - var classes = ''; - - for (var key in arg) { - if (hasOwn.call(arg, key) && arg[key]) { - classes = appendClass(classes, key); - } - } - - return classes; - } - - function appendClass (value, newClass) { - if (!newClass) { - return value; - } - - if (value) { - return value + ' ' + newClass; - } - - return value + newClass; - } - - if ( true && module.exports) { - classNames.default = classNames; - module.exports = classNames; - } else if (true) { - // register as 'classnames', consistent with npm package name - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { - return classNames; - }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else {} -}()); - - -/***/ }), - -/***/ "./src/block.json": -/*!************************!*\ - !*** ./src/block.json ***! - \************************/ -/***/ ((module) => { - -"use strict"; -module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"tabor/dark-mode-toggle","version":"0.1.0","title":"Dark Mode Toggle","category":"design","description":"Allow visitors to switch between light and dark appearances.","supports":{"color":{"link":false,"text":true,"__experimentalSkipSerialization":true},"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true,"__experimentalSkipSerialization":true,"__experimentalDefaultControls":{"color":false,"radius":false,"style":false,"width":false}},"html":false,"__experimentalSelector":".wp-block-tabor-dark-mode-toggle__track"},"attributes":{"icon":{"type":"string"},"size":{"type":"string","default":"small"}},"styles":[{"name":"filled","label":"Filled","isDefault":true},{"name":"stroke","label":"Stroke"},{"name":"circle","label":"Circle"},{"name":"eye","label":"Eye"}],"textdomain":"appearance-toggle","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js"}'); - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = __webpack_modules__; -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/chunk loaded */ -/******/ (() => { -/******/ var deferred = []; -/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { -/******/ if(chunkIds) { -/******/ priority = priority || 0; -/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; -/******/ deferred[i] = [chunkIds, fn, priority]; -/******/ return; -/******/ } -/******/ var notFulfilled = Infinity; -/******/ for (var i = 0; i < deferred.length; i++) { -/******/ var [chunkIds, fn, priority] = deferred[i]; -/******/ var fulfilled = true; -/******/ for (var j = 0; j < chunkIds.length; j++) { -/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { -/******/ chunkIds.splice(j--, 1); -/******/ } else { -/******/ fulfilled = false; -/******/ if(priority < notFulfilled) notFulfilled = priority; -/******/ } -/******/ } -/******/ if(fulfilled) { -/******/ deferred.splice(i--, 1) -/******/ var r = fn(); -/******/ if (r !== undefined) result = r; -/******/ } -/******/ } -/******/ return result; -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/compat get default export */ -/******/ (() => { -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = (module) => { -/******/ var getter = module && module.__esModule ? -/******/ () => (module['default']) : -/******/ () => (module); -/******/ __webpack_require__.d(getter, { a: getter }); -/******/ return getter; -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/jsonp chunk loading */ -/******/ (() => { -/******/ // no baseURI -/******/ -/******/ // object to store loaded and loading chunks -/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched -/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded -/******/ var installedChunks = { -/******/ "index": 0, -/******/ "./style-index": 0 -/******/ }; -/******/ -/******/ // no chunk on demand loading -/******/ -/******/ // no prefetching -/******/ -/******/ // no preloaded -/******/ -/******/ // no HMR -/******/ -/******/ // no HMR manifest -/******/ -/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); -/******/ -/******/ // install a JSONP callback for chunk loading -/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { -/******/ var [chunkIds, moreModules, runtime] = data; -/******/ // add "moreModules" to the modules object, -/******/ // then flag all "chunkIds" as loaded and fire callback -/******/ var moduleId, chunkId, i = 0; -/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { -/******/ for(moduleId in moreModules) { -/******/ if(__webpack_require__.o(moreModules, moduleId)) { -/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; -/******/ } -/******/ } -/******/ if(runtime) var result = runtime(__webpack_require__); -/******/ } -/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); -/******/ for(;i < chunkIds.length; i++) { -/******/ chunkId = chunkIds[i]; -/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { -/******/ installedChunks[chunkId][0](); -/******/ } -/******/ installedChunks[chunkId] = 0; -/******/ } -/******/ return __webpack_require__.O(result); -/******/ } -/******/ -/******/ var chunkLoadingGlobal = globalThis["webpackChunktabor_dark_mode_toggle_block"] = globalThis["webpackChunktabor_dark_mode_toggle_block"] || []; -/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); -/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); -/******/ })(); -/******/ -/************************************************************************/ -/******/ -/******/ // startup -/******/ // Load entry module and return exports -/******/ // This entry module depends on other loaded chunks and execution need to be delayed -/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["./style-index"], () => (__webpack_require__("./src/index.js"))) -/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); -/******/ -/******/ })() -; -//# sourceMappingURL=index.js.map \ No newline at end of file +(()=>{var e={967:(e,l)=>{var t;!function(){"use strict";var a={}.hasOwnProperty;function o(){for(var e="",l=0;l{var l=e&&e.__esModule?()=>e.default:()=>e;return t.d(l,{a:l}),l},t.d=(e,l)=>{for(var a in l)t.o(l,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:l[a]})},t.o=(e,l)=>Object.prototype.hasOwnProperty.call(e,l),(()=>{"use strict";const e=window.React,l=window.wp.blocks,a=window.wp.components;var o=t(967),r=t.n(o);const n=window.wp.blockEditor,i=window.wp.element,c=window.wp.i18n,s={filled:{light:(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{fill:"currentColor",d:"M13 2a1 1 0 1 0-2 0v1a1 1 0 1 0 2 0V2Zm0 19a1 1 0 1 0-2 0v1a1 1 0 1 0 2 0v-1Zm6.777-16.777a1 1 0 0 1 0 1.414l-.71.71a1 1 0 1 1-1.414-1.414l.71-.71a1 1 0 0 1 1.414 0ZM6.347 19.067a1 1 0 1 0-1.414-1.414l-.71.71a1 1 0 1 0 1.414 1.414l.71-.71ZM20 12a1 1 0 0 1 1-1h1a1 1 0 1 1 0 2h-1a1 1 0 0 1-1-1ZM2 11a1 1 0 1 0 0 2h1a1 1 0 1 0 0-2H2Zm15.653 6.653a1 1 0 0 1 1.414 0l.71.71a1 1 0 0 1-1.414 1.414l-.71-.71a1 1 0 0 1 0-1.414ZM5.637 4.223a1 1 0 1 0-1.414 1.414l.71.71a1 1 0 0 0 1.414-1.414l-.71-.71Zm2.12 3.534a6 6 0 1 1 8.486 8.486 6 6 0 0 1-8.486-8.486Z"})),dark:(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{fill:"currentColor",d:"M12.056 3.6a1 1 0 0 0-.908-1.564c-5.123.434-9.144 4.728-9.144 9.962 0 5.522 4.476 9.998 9.998 9.998 5.234 0 9.528-4.021 9.962-9.144a1 1 0 0 0-1.564-.908A6 6 0 0 1 12.055 3.6Z"}))},stroke:{light:(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{fill:"currentColor",fillRule:"evenodd",d:"M12 1a1 1 0 0 1 1 1v1a1 1 0 1 1-2 0V2a1 1 0 0 1 1-1ZM4.223 4.223a1 1 0 0 1 1.414 0l.71.71a1 1 0 1 1-1.414 1.414l-.71-.71a1 1 0 0 1 0-1.414Zm15.554 0a1 1 0 0 1 0 1.414l-.71.71a1 1 0 0 1-1.414-1.414l.71-.71a1 1 0 0 1 1.414 0ZM9.172 9.172a4 4 0 1 0 5.656 5.656 4 4 0 0 0-5.656-5.656ZM7.757 7.757a6 6 0 1 1 8.486 8.486 6 6 0 0 1-8.486-8.486ZM1 12a1 1 0 0 1 1-1h1a1 1 0 1 1 0 2H2a1 1 0 0 1-1-1Zm19 0a1 1 0 0 1 1-1h1a1 1 0 1 1 0 2h-1a1 1 0 0 1-1-1ZM6.347 17.653a1 1 0 0 1 0 1.414l-.71.71a1 1 0 0 1-1.414-1.414l.71-.71a1 1 0 0 1 1.414 0Zm11.306 0a1 1 0 0 1 1.414 0l.71.71a1 1 0 0 1-1.414 1.414l-.71-.71a1 1 0 0 1 0-1.414ZM12 20a1 1 0 0 1 1 1v1a1 1 0 1 1-2 0v-1a1 1 0 0 1 1-1Z",clipRule:"evenodd"})),dark:(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{fill:"currentColor",fillRule:"evenodd",d:"M12.097 2.53a1 1 0 0 1-.041 1.07 6 6 0 0 0 8.345 8.344 1 1 0 0 1 1.563.908c-.434 5.122-4.728 9.144-9.962 9.144-5.522 0-9.998-4.476-9.998-9.998 0-5.234 4.021-9.528 9.144-9.962a1 1 0 0 1 .949.494ZM9.424 4.424a7.998 7.998 0 1 0 10.152 10.152A8 8 0 0 1 9.424 4.424Z",clipRule:"evenodd"}))},circle:{light:(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{fill:"currentColor",fillRule:"evenodd",d:"M12 4a8 8 0 1 0 0 16V4ZM2 12C2 6.477 6.477 2 12 2c.375 0 .745.02 1.11.061C18.11 2.614 22 6.852 22 12s-3.89 9.386-8.89 9.939c-.365.04-.735.061-1.11.061-5.523 0-10-4.477-10-10Z",clipRule:"evenodd"})),dark:(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{fill:"currentColor",fillRule:"evenodd",d:"M12 4a8 8 0 1 0 0 16V4ZM2 12C2 6.477 6.477 2 12 2c.375 0 .745.02 1.11.061C18.11 2.614 22 6.852 22 12s-3.89 9.386-8.89 9.939c-.365.04-.735.061-1.11.061-5.523 0-10-4.477-10-10Z",clipRule:"evenodd"}))},eye:{light:(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{fill:"currentColor",fillRule:"evenodd",d:"M12 6c-3.127 0-6.367 1.79-8.638 5.606a.77.77 0 0 0 0 .788C5.633 16.209 8.873 18 12 18s6.367-1.79 8.638-5.606a.77.77 0 0 0 0-.788C18.367 7.791 15.127 6 12 6Zm0-2c3.952 0 7.79 2.272 10.357 6.583a2.77 2.77 0 0 1 0 2.834C19.79 17.727 15.952 20 12 20c-3.952 0-7.79-2.272-10.357-6.583a2.77 2.77 0 0 1 0-2.834C4.21 6.273 8.048 4 12 4Zm0 6a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm-4 2a4 4 0 1 1 8 0 4 4 0 0 1-8 0Z",clipRule:"evenodd"})),dark:(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{fill:"currentColor",d:"M4.728 12.253a1 1 0 0 0-1.456 1.37c1.182 1.258 2.5 2.227 3.896 2.898l-1.024 1.694a1 1 0 0 0 1.712 1.034l1.214-2.01c.636.178 1.28.297 1.93.357V20a1 1 0 1 0 2 0v-2.404c.65-.06 1.294-.18 1.93-.356l1.214 2.01a1 1 0 1 0 1.712-1.035l-1.024-1.694c1.395-.671 2.714-1.64 3.896-2.898a1 1 0 1 0-1.457-1.37c-2.153 2.29-4.736 3.39-7.271 3.39s-5.118-1.1-7.272-3.39Z"}))}},d=JSON.parse('{"u2":"tabor/dark-mode-toggle"}');(0,l.registerBlockType)(d.u2,{icon:(0,e.createElement)(a.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)(a.Path,{d:"M12.056 5.25626C12.2319 5.00102 12.2448 4.6672 12.0891 4.39911C11.9335 4.13101 11.6372 3.9767 11.3283 4.00287C7.22296 4.35074 4 7.79206 4 11.987C4 16.4125 7.58755 20 12.013 20C16.208 20 19.6495 16.777 19.9971 12.6714C20.0233 12.3625 19.869 12.0663 19.6009 11.9106C19.3328 11.755 18.999 11.768 18.7437 11.9439C17.9695 12.4776 17.0318 12.79 16.0186 12.79C13.3629 12.79 11.2099 10.637 11.2099 7.98124C11.2099 6.96821 11.5223 6.03055 12.056 5.25626Z",fill:"currentColor"})),example:{},edit:function({attributes:l,setAttributes:t}){const{className:o,icon:d,size:m}=l,g=(0,n.useBlockProps)({className:r()({[`is-${m}`]:m})}),p=(0,n.__experimentalUseColorProps)(l),w=(0,n.__experimentalUseBorderProps)(l),_=(0,n.__experimentalGetSpacingClassesAndStyles)(l),u=s[d]?.light||s.filled?.light,k=s[d]?.dark||s.filled?.dark;return(0,i.useEffect)((()=>{const e={"is-style-stroke":"stroke","is-style-circle":"circle","is-style-eye":"eye"},l=Object.keys(e).find((e=>o?.includes(e)));t(l?{icon:e[l]}:{icon:void 0})}),[o,t]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(n.InspectorControls,{group:"styles"},(0,e.createElement)(a.__experimentalToolsPanel,{label:(0,c.__)("Size","dark-mode-toggle-block")},(0,e.createElement)(a.__experimentalToolsPanelItem,{label:(0,c.__)("Size","dark-mode-toggle-block"),isShownByDefault:!0,hasValue:()=>!!m,onDeselect:()=>t({size:void 0})},(0,e.createElement)(a.__experimentalToggleGroupControl,{label:(0,c.__)("Size","dark-mode-toggle-block"),hideLabelFromVision:!0,value:m,onChange:e=>{t({size:e})},isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0},(0,e.createElement)(a.__experimentalToggleGroupControlOption,{value:"small" +/* translators: S stands for 'small' and is a size label. */,label:(0,c.__)("S","dark-mode-toggle-block"),"aria-label":(0,c.__)("Small","dark-mode-toggle-block")}),(0,e.createElement)(a.__experimentalToggleGroupControlOption,{value:"medium" +/* translators: M stands for 'medium' and is a size label. */,label:(0,c.__)("M","dark-mode-toggle-block"),"aria-label":(0,c.__)("Medium","dark-mode-toggle-block")}),(0,e.createElement)(a.__experimentalToggleGroupControlOption,{value:"large" +/* translators: M stands for 'medium' and is a size label. */,label:(0,c.__)("L","dark-mode-toggle-block"),"aria-label":(0,c.__)("Large","dark-mode-toggle-block")}))))),(0,e.createElement)("div",{...g},(0,e.createElement)(a.Disabled,null,(0,e.createElement)("label",{className:"wp-block-tabor-dark-mode-toggle__label",htmlFor:"theme-toggle"},(0,e.createElement)("input",{type:"checkbox",className:"wp-block-tabor-dark-mode-toggle__input",id:"theme-toggle","aria-label":(0,c.__)("Toggle dark mode","dark-mode-toggle-block")}),(0,e.createElement)("span",{className:r()(o,"wp-block-tabor-dark-mode-toggle__track",p.className,w.className),style:{...w.style,...p.style,..._.style}},(0,e.createElement)("span",{className:"wp-block-tabor-dark-mode-toggle__selector",style:{...p.style.text}},(0,e.createElement)("span",{className:"wp-block-tabor-dark-mode-toggle__icon wp-block-tabor-dark-mode-toggle__icon--light","aria-hidden":"true"},(0,e.createElement)(a.Icon,{icon:u,size:16})),(0,e.createElement)("span",{className:"wp-block-tabor-dark-mode-toggle__icon wp-block-tabor-dark-mode-toggle__icon--dark","aria-hidden":"true"},(0,e.createElement)(a.Icon,{icon:k,size:16}))))))))},save:function({attributes:l}){const{className:t,icon:a,size:o}=l,i=(0,n.__experimentalGetColorClassesAndStyles)(l),d=(0,n.__experimentalGetBorderClassesAndStyles)(l),m=(0,n.__experimentalGetSpacingClassesAndStyles)(l),g=s[a]?.light||s.filled?.light,p=s[a]?.dark||s.filled?.dark,w=r()(t,{[`is-${o}`]:o});return(0,e.createElement)("div",{...n.useBlockProps.save({className:w})},(0,e.createElement)("label",{className:"wp-block-tabor-dark-mode-toggle__label",htmlFor:"theme-toggle"},(0,e.createElement)("input",{type:"checkbox",className:"wp-block-tabor-dark-mode-toggle__input",id:"theme-toggle","aria-label":(0,c.__)("Toggle dark mode","dark-mode-toggle-block")}),(0,e.createElement)("span",{className:r()("wp-block-tabor-dark-mode-toggle__track",i.className,d.className),style:{...d.style,...i.style,...m.style}},(0,e.createElement)("span",{className:"wp-block-tabor-dark-mode-toggle__selector",style:{...i.style}},(0,e.createElement)("span",{className:"wp-block-tabor-dark-mode-toggle__icon wp-block-tabor-dark-mode-toggle__icon--light","aria-hidden":"true"},g),(0,e.createElement)("span",{className:"wp-block-tabor-dark-mode-toggle__icon wp-block-tabor-dark-mode-toggle__icon--dark","aria-hidden":"true"},p)))))}})})()})(); \ No newline at end of file diff --git a/build/index.js.map b/build/index.js.map deleted file mode 100644 index 4bd0776..0000000 --- a/build/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACoC;;AAEpC;AACA;AACA;AAOiC;AAQF;AACgB;AACV;;AAErC;AACA;AACA;AACgC;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACe,SAASsB,IAAIA,CAAE;EAAEC,UAAU;EAAEC;AAAc,CAAC,EAAG;EAC7D,MAAM;IAAEC,SAAS;IAAEC,IAAI;IAAEC;EAAK,CAAC,GAAGJ,UAAU;EAC5C,MAAMK,UAAU,GAAG3B,sEAAa,CAAE;IACjCwB,SAAS,EAAEzB,iDAAU,CAAE;MACtB,CAAG,MAAM2B,IAAM,EAAC,GAAIA;IACrB,CAAE;EACH,CAAE,CAAC;EACH,MAAME,UAAU,GAAGzB,oFAAa,CAAEmB,UAAW,CAAC;EAC9C,MAAMO,WAAW,GAAGxB,qFAAc,CAAEiB,UAAW,CAAC;EAChD,MAAMQ,YAAY,GAAGvB,iGAAe,CAAEe,UAAW,CAAC;;EAElD;EACA,MAAMS,SAAS,GAAGX,yCAAK,CAAEK,IAAI,CAAE,EA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;AAER;;;;;;;;;;;;AClFA;;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,gBAAgB;;AAEhB;AACA;;AAEA,kBAAkB,sBAAsB;AACxC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK,KAA6B;AAClC;AACA;AACA,GAAG,SAAS,IAA4E;AACxF;AACA,EAAE,iCAAqB,EAAE,mCAAE;AAC3B;AACA,GAAG;AAAA,kGAAC;AACJ,GAAG,KAAK,EAEN;AACF,CAAC;;;;;;;;;;;;;;;;;;UC5ED;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;UAEA;UACA;;;;;WCzBA;WACA;WACA;WACA;WACA,+BAA+B,wCAAwC;WACvE;WACA;WACA;WACA;WACA,iBAAiB,qBAAqB;WACtC;WACA;WACA,kBAAkB,qBAAqB;WACvC;WACA;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;WC3BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;;;;;UEjDA;UACA;UACA;UACA;UACA","sources":["webpack://tabor-dark-mode-toggle-block/./src/edit.js","webpack://tabor-dark-mode-toggle-block/./src/icons.js","webpack://tabor-dark-mode-toggle-block/./src/icons/index.js","webpack://tabor-dark-mode-toggle-block/./src/icons/library/circle-dark.js","webpack://tabor-dark-mode-toggle-block/./src/icons/library/circle-light.js","webpack://tabor-dark-mode-toggle-block/./src/icons/library/eye-dark.js","webpack://tabor-dark-mode-toggle-block/./src/icons/library/eye-light.js","webpack://tabor-dark-mode-toggle-block/./src/icons/library/filled-dark.js","webpack://tabor-dark-mode-toggle-block/./src/icons/library/filled-light.js","webpack://tabor-dark-mode-toggle-block/./src/icons/library/stroke-dark.js","webpack://tabor-dark-mode-toggle-block/./src/icons/library/stroke-light.js","webpack://tabor-dark-mode-toggle-block/./src/index.js","webpack://tabor-dark-mode-toggle-block/./src/save.js","webpack://tabor-dark-mode-toggle-block/./src/style.scss","webpack://tabor-dark-mode-toggle-block/external window \"React\"","webpack://tabor-dark-mode-toggle-block/external window [\"wp\",\"blockEditor\"]","webpack://tabor-dark-mode-toggle-block/external window [\"wp\",\"blocks\"]","webpack://tabor-dark-mode-toggle-block/external window [\"wp\",\"components\"]","webpack://tabor-dark-mode-toggle-block/external window [\"wp\",\"element\"]","webpack://tabor-dark-mode-toggle-block/external window [\"wp\",\"i18n\"]","webpack://tabor-dark-mode-toggle-block/./node_modules/classnames/index.js","webpack://tabor-dark-mode-toggle-block/webpack/bootstrap","webpack://tabor-dark-mode-toggle-block/webpack/runtime/chunk loaded","webpack://tabor-dark-mode-toggle-block/webpack/runtime/compat get default export","webpack://tabor-dark-mode-toggle-block/webpack/runtime/define property getters","webpack://tabor-dark-mode-toggle-block/webpack/runtime/hasOwnProperty shorthand","webpack://tabor-dark-mode-toggle-block/webpack/runtime/make namespace object","webpack://tabor-dark-mode-toggle-block/webpack/runtime/jsonp chunk loading","webpack://tabor-dark-mode-toggle-block/webpack/before-startup","webpack://tabor-dark-mode-toggle-block/webpack/startup","webpack://tabor-dark-mode-toggle-block/webpack/after-startup"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseBlockProps,\n\tInspectorControls,\n\t__experimentalUseColorProps as useColorProps,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalGetSpacingClassesAndStyles as useSpacingProps,\n} from '@wordpress/block-editor';\nimport {\n\tDisabled,\n\tIcon,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { Icons } from './icons';\n\n/**\n * The edit function describes the structure of your block in the context of the\n * editor. This represents what the editor will render when the block is used.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit\n */\nexport default function Edit( { attributes, setAttributes } ) {\n\tconst { className, icon, size } = attributes;\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( {\n\t\t\t[ `is-${ size }` ]: size,\n\t\t} ),\n\t} );\n\tconst colorProps = useColorProps( attributes );\n\tconst borderProps = useBorderProps( attributes );\n\tconst spacingProps = useSpacingProps( attributes );\n\n\t// Dynamically determine which icon to use for each style.\n\tconst LightIcon = Icons[ icon ]?.light || Icons.filled?.light;\n\tconst DarkIcon = Icons[ icon ]?.dark || Icons.filled?.dark;\n\n\tuseEffect( () => {\n\t\t// Map class names to icon attribute.\n\t\tconst styleToIcons = {\n\t\t\t'is-style-stroke': 'stroke',\n\t\t\t'is-style-circle': 'circle',\n\t\t\t'is-style-eye': 'eye',\n\t\t};\n\n\t\t// Find the first matching style and set the corresponding icon.\n\t\tconst iconString = Object.keys( styleToIcons ).find( ( style ) =>\n\t\t\tclassName?.includes( style )\n\t\t);\n\n\t\tif ( iconString ) {\n\t\t\tsetAttributes( { icon: styleToIcons[ iconString ] } );\n\t\t} else {\n\t\t\t// Reset or handle the attribute when no styles are matched.\n\t\t\tsetAttributes( { icon: undefined } );\n\t\t}\n\t}, [ className, setAttributes ] );\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t !! size }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { size: undefined } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tsize: value,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t\tsize={ '__unstable-large' }\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\n\t);\n}\n","import * as Icon from './icons/index.js';\n\nexport const Icons = {\n\tfilled: {\n\t\tlight: Icon.FilledLight,\n\t\tdark: Icon.FilledDark,\n\t},\n\tstroke: {\n\t\tlight: Icon.StrokeLight,\n\t\tdark: Icon.StrokeDark,\n\t},\n\tcircle: {\n\t\tlight: Icon.CircleLight,\n\t\tdark: Icon.CircleDark,\n\t},\n\teye: {\n\t\tlight: Icon.EyeLight,\n\t\tdark: Icon.EyeDark,\n\t},\n};\n","export { default as FilledLight } from './library/filled-light';\nexport { default as FilledDark } from './library/filled-dark';\n\nexport { default as StrokeLight } from './library/stroke-light';\nexport { default as StrokeDark } from './library/stroke-dark';\n\nexport { default as CircleLight } from './library/circle-light';\nexport { default as CircleDark } from './library/circle-dark';\n\nexport { default as EyeLight } from './library/eye-light';\nexport { default as EyeDark } from './library/eye-dark';\n","/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/components';\n\nconst svg = (\n\t\n\t\t\n\t\n);\n\nexport default svg;\n","/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/components';\n\nconst svg = (\n\t\n\t\t\n\t\n);\n\nexport default svg;\n","/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/components';\n\nconst svg = (\n\t\n\t\t\n\t\n);\n\nexport default svg;\n","/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/components';\n\nconst svg = (\n\t\n\t\t\n\t\n);\n\nexport default svg;\n","/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/components';\n\nconst svg = (\n\t\n\t\t\n\t\n);\n\nexport default svg;\n","/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/components';\n\nconst svg = (\n\t\n\t\t\n\t\n);\n\nexport default svg;\n","/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/components';\n\nconst svg = (\n\t\n\t\t\n\t\n);\n\nexport default svg;\n","/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/components';\n\nconst svg = (\n\t\n\t\t\n\t\n);\n\nexport default svg;\n","/**\n * Registers a new block provided a unique name and an object defining its behavior.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/\n */\nimport { registerBlockType } from '@wordpress/blocks';\n\n/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/components';\n\n/**\n * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.\n * All files containing `style` keyword are bundled together. The code used\n * gets applied both to the front of your site and to the editor.\n *\n * @see https://www.npmjs.com/package/@wordpress/scripts#using-css\n */\nimport './style.scss';\n\n/**\n * Internal dependencies\n */\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\n/**\n * Every block starts by registering a new block type definition.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/\n */\nregisterBlockType( metadata.name, {\n\ticon: (\n\t\t\n\t\t\t\n\t\t\n\t),\n\texample: {},\n\tedit,\n\tsave,\n} );\n","/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseBlockProps,\n\t__experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles,\n\t__experimentalGetColorClassesAndStyles as getColorClassesAndStyles,\n\t__experimentalGetSpacingClassesAndStyles as getSpacingClassesAndStyles,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { Icons } from './icons';\n\nexport default function Save( { attributes } ) {\n\tconst { className, icon, size } = attributes;\n\tconst colorProps = getColorClassesAndStyles( attributes );\n\tconst borderProps = getBorderClassesAndStyles( attributes );\n\tconst spacingProps = getSpacingClassesAndStyles( attributes );\n\n\t// Dynamically determine which icon to use for each style.\n\tconst LightIcon = Icons[ icon ]?.light || Icons.filled?.light;\n\tconst DarkIcon = Icons[ icon ]?.dark || Icons.filled?.dark;\n\n\tconst classes = classnames( className, {\n\t\t[ `is-${ size }` ]: size,\n\t} );\n\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{ LightIcon }\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{ DarkIcon }\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t
\n\t);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"index\": 0,\n\t\"./style-index\": 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunktabor_dark_mode_toggle_block\"] = globalThis[\"webpackChunktabor_dark_mode_toggle_block\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"./style-index\"], () => (__webpack_require__(\"./src/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["classnames","useBlockProps","InspectorControls","__experimentalUseColorProps","useColorProps","__experimentalUseBorderProps","useBorderProps","__experimentalGetSpacingClassesAndStyles","useSpacingProps","Disabled","Icon","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","useEffect","__","Icons","Edit","attributes","setAttributes","className","icon","size","blockProps","colorProps","borderProps","spacingProps","LightIcon","light","filled","DarkIcon","dark","styleToIcons","iconString","Object","keys","find","style","includes","undefined","createElement","Fragment","group","label","isShownByDefault","hasValue","onDeselect","hideLabelFromVision","value","onChange","isBlock","__nextHasNoMarginBottom","htmlFor","type","id","text","FilledLight","FilledDark","stroke","StrokeLight","StrokeDark","circle","CircleLight","CircleDark","eye","EyeLight","EyeDark","default","Path","SVG","svg","xmlns","width","height","fill","viewBox","fillRule","d","clipRule","registerBlockType","edit","metadata","save","name","example","__experimentalGetBorderClassesAndStyles","getBorderClassesAndStyles","__experimentalGetColorClassesAndStyles","getColorClassesAndStyles","getSpacingClassesAndStyles","Save","classes"],"sourceRoot":""} \ No newline at end of file diff --git a/build/style-index.css b/build/style-index.css deleted file mode 100644 index a150d31..0000000 --- a/build/style-index.css +++ /dev/null @@ -1,88 +0,0 @@ -/*!***************************************************************************************************************************************************************************************************************************************!*\ - !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/style.scss ***! - \***************************************************************************************************************************************************************************************************************************************/ -.wp-block-tabor-dark-mode-toggle { - --icon-size: 16px; -} -.wp-block-tabor-dark-mode-toggle.is-medium { - --icon-size: 18px; -} -.wp-block-tabor-dark-mode-toggle.is-large { - --icon-size: 20px; -} - -.wp-block-tabor-dark-mode-toggle__label { - align-items: center; - display: flex; - margin: 0; -} - -.wp-block-tabor-dark-mode-toggle__input { - clip-path: inset(50%); - clip: rect(0 0 0 0); - height: 1px; - overflow: hidden; - position: absolute; - white-space: nowrap; - width: 1px; -} - -.wp-block-tabor-dark-mode-toggle__track { - align-items: center; - border-radius: 100px; - cursor: pointer; - display: flex; - height: calc(var(--icon-size) * 1.75); - padding: 0 calc(var(--icon-size) * 0.25); - position: relative; - transition: background-color var(--wp--custom--transition--duration, 200ms) ease-out; - width: calc(var(--icon-size) * 2.5); -} -.wp-block-tabor-dark-mode-toggle__track:not(.has-background) { - background: var(--wp--preset--color--theme-3); -} -.wp-block-tabor-dark-mode-toggle__track:not(.has-background):hover { - background-color: var(--wp--preset--color--theme-4); - color: var(--wp--preset--color--theme-6); -} - -.wp-block-tabor-dark-mode-toggle__selector { - align-items: center; - border-radius: 100%; - display: flex; - height: calc(var(--icon-size) * 1.25); - justify-content: center; - transition: transform var(--wp--custom--transition--duration, 200ms) ease-out; - width: calc(var(--icon-size) * 1.25); - will-change: transform; -} - -.wp-block-tabor-dark-mode-toggle__icon { - backface-visibility: hidden; - border-radius: 100%; - color: currentcolor; - opacity: 1; - position: absolute; -} -.wp-block-tabor-dark-mode-toggle__icon, -.wp-block-tabor-dark-mode-toggle__icon svg { - width: var(--icon-size); - height: var(--icon-size); -} - -.theme-dark .wp-block-tabor-dark-mode-toggle__input + .wp-block-tabor-dark-mode-toggle__track .wp-block-tabor-dark-mode-toggle__selector { - transform: translateX(calc(var(--icon-size) * 1.25)); -} - -.wp-block-tabor-dark-mode-toggle__icon--dark { - visibility: hidden; -} - -.theme-dark .wp-block-tabor-dark-mode-toggle__icon--light { - visibility: hidden; -} -.theme-dark .wp-block-tabor-dark-mode-toggle__icon--dark { - visibility: visible; -} - -/*# sourceMappingURL=style-index.css.map*/ \ No newline at end of file diff --git a/build/style-index.css.map b/build/style-index.css.map deleted file mode 100644 index a07e068..0000000 --- a/build/style-index.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"./style-index.css","mappings":";;;AAAA;EACC;AACD;AACC;EACC;AACF;AAEC;EACC;AAAF;;AAIA;EACC;EACA;EACA;AADD;;AAIA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;AADD;;AAIA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AADD;AAGC;EACC;AADF;AAIC;EACC;EACA;AAFF;;AAMA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAHD;;AAMA;EACC;EACA;EACA;EACA;EACA;AAHD;AAKC;;EAEC;EACA;AAHF;;AAOA;EACC;AAJD;;AAOA;EACC;AAJD;;AASC;EACC;AANF;AASC;EACC;AAPF,C","sources":["webpack://tabor-dark-mode-toggle-block/./src/style.scss"],"sourcesContent":[".wp-block-tabor-dark-mode-toggle {\n\t--icon-size: 16px;\n\n\t&.is-medium {\n\t\t--icon-size: 18px;\n\t}\n\n\t&.is-large {\n\t\t--icon-size: 20px;\n\t}\n}\n\n.wp-block-tabor-dark-mode-toggle__label {\n\talign-items: center;\n\tdisplay: flex;\n\tmargin: 0;\n}\n\n.wp-block-tabor-dark-mode-toggle__input {\n\tclip-path: inset(50%);\n\tclip: rect(0 0 0 0);\n\theight: 1px;\n\toverflow: hidden;\n\tposition: absolute;\n\twhite-space: nowrap;\n\twidth: 1px;\n}\n\n.wp-block-tabor-dark-mode-toggle__track {\n\talign-items: center;\n\tborder-radius: 100px;\n\tcursor: pointer;\n\tdisplay: flex;\n\theight: calc(var(--icon-size) * 1.75);\n\tpadding: 0 calc(var(--icon-size) * 0.25);\n\tposition: relative;\n\ttransition: background-color var(--wp--custom--transition--duration, 200ms) ease-out;\n\twidth: calc(var(--icon-size) * 2.5);\n\n\t&:not(.has-background) {\n\t\tbackground: var(--wp--preset--color--theme-3);\n\t}\n\n\t&:not(.has-background):hover {\n\t\tbackground-color: var(--wp--preset--color--theme-4);\n\t\tcolor: var(--wp--preset--color--theme-6);\n\t}\n}\n\n.wp-block-tabor-dark-mode-toggle__selector {\n\talign-items: center;\n\tborder-radius: 100%;\n\tdisplay: flex;\n\theight: calc(var(--icon-size) * 1.25);\n\tjustify-content: center;\n\ttransition: transform var(--wp--custom--transition--duration, 200ms) ease-out;\n\twidth: calc(var(--icon-size) * 1.25);\n\twill-change: transform;\n}\n\n.wp-block-tabor-dark-mode-toggle__icon {\n\tbackface-visibility: hidden;\n\tborder-radius: 100%;\n\tcolor: currentcolor;\n\topacity: 1;\n\tposition: absolute;\n\n\t&,\n\tsvg {\n\t\twidth: var(--icon-size);\n\t\theight: var(--icon-size);\n\t}\n}\n\n.theme-dark .wp-block-tabor-dark-mode-toggle__input + .wp-block-tabor-dark-mode-toggle__track .wp-block-tabor-dark-mode-toggle__selector {\n\ttransform: translateX(calc(var(--icon-size) * 1.25));\n}\n\n.wp-block-tabor-dark-mode-toggle__icon--dark {\n\tvisibility: hidden;\n}\n\n.theme-dark {\n\n\t.wp-block-tabor-dark-mode-toggle__icon--light {\n\t\tvisibility: hidden;\n\t}\n\n\t.wp-block-tabor-dark-mode-toggle__icon--dark {\n\t\tvisibility: visible;\n\t}\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/build/view.asset.php b/build/view.asset.php index 4615781..4875edf 100644 --- a/build/view.asset.php +++ b/build/view.asset.php @@ -1 +1 @@ - array(), 'version' => '88a721d8e5a23e107f69'); + array(), 'version' => 'e336af3a8e7aaef32702'); diff --git a/build/view.js b/build/view.js index 4526f01..ab7168f 100644 --- a/build/view.js +++ b/build/view.js @@ -1,21 +1 @@ -/******/ (() => { // webpackBootstrap -var __webpack_exports__ = {}; -/*!*********************!*\ - !*** ./src/view.js ***! - \*********************/ -// Cache the document element outside of the function to avoid repeated DOM queries. -const body = document.documentElement; -const darkModeToggle = document.querySelector('#theme-toggle'); -function toggleTheme() { - // Toggle the 'theme-dark' class. - body.classList.toggle('theme-dark'); - - // Update localStorage based on the presence of the class. - localStorage.setItem('darkMode', body.classList.contains('theme-dark') ? 'enabled' : 'disabled'); -} - -// Attach the event listener. -darkModeToggle.addEventListener('click', toggleTheme); -/******/ })() -; -//# sourceMappingURL=view.js.map \ No newline at end of file +(()=>{const e=document.documentElement;document.querySelector("#theme-toggle").addEventListener("click",(function(){e.classList.toggle("theme-dark"),localStorage.setItem("darkMode",e.classList.contains("theme-dark")?"enabled":"disabled")}))})(); \ No newline at end of file diff --git a/build/view.js.map b/build/view.js.map deleted file mode 100644 index 9d1617b..0000000 --- a/build/view.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"view.js","mappings":";;;;;AAAA;AACA,MAAMA,IAAI,GAAGC,QAAQ,CAACC,eAAe;AACrC,MAAMC,cAAc,GAAGF,QAAQ,CAACG,aAAa,CAAE,eAAgB,CAAC;AAEhE,SAASC,WAAWA,CAAA,EAAG;EACtB;EACAL,IAAI,CAACM,SAAS,CAACC,MAAM,CAAE,YAAa,CAAC;;EAErC;EACAC,YAAY,CAACC,OAAO,CACnB,UAAU,EACVT,IAAI,CAACM,SAAS,CAACI,QAAQ,CAAE,YAAa,CAAC,GAAG,SAAS,GAAG,UACvD,CAAC;AACF;;AAEA;AACAP,cAAc,CAACQ,gBAAgB,CAAE,OAAO,EAAEN,WAAY,CAAC,C","sources":["webpack://tabor-dark-mode-toggle-block/./src/view.js"],"sourcesContent":["// Cache the document element outside of the function to avoid repeated DOM queries.\nconst body = document.documentElement;\nconst darkModeToggle = document.querySelector( '#theme-toggle' );\n\nfunction toggleTheme() {\n\t// Toggle the 'theme-dark' class.\n\tbody.classList.toggle( 'theme-dark' );\n\n\t// Update localStorage based on the presence of the class.\n\tlocalStorage.setItem(\n\t\t'darkMode',\n\t\tbody.classList.contains( 'theme-dark' ) ? 'enabled' : 'disabled'\n\t);\n}\n\n// Attach the event listener.\ndarkModeToggle.addEventListener( 'click', toggleTheme );\n"],"names":["body","document","documentElement","darkModeToggle","querySelector","toggleTheme","classList","toggle","localStorage","setItem","contains","addEventListener"],"sourceRoot":""} \ No newline at end of file diff --git a/dark-mode-toggle-block.php b/dark-mode-toggle-block.php index 54d6994..1d457a8 100644 --- a/dark-mode-toggle-block.php +++ b/dark-mode-toggle-block.php @@ -1,4 +1,5 @@ ), example: {}, edit, - save, -} ); + save +}) diff --git a/src/style.scss b/src/index.scss similarity index 92% rename from src/style.scss rename to src/index.scss index 88cce19..abc5970 100644 --- a/src/style.scss +++ b/src/index.scss @@ -72,7 +72,7 @@ } } -.theme-dark .wp-block-tabor-dark-mode-toggle__input + .wp-block-tabor-dark-mode-toggle__track .wp-block-tabor-dark-mode-toggle__selector { +.theme-dark .wp-block-tabor-dark-mode-toggle__input+.wp-block-tabor-dark-mode-toggle__track .wp-block-tabor-dark-mode-toggle__selector { transform: translateX(calc(var(--icon-size) * 1.25)); } @@ -89,4 +89,4 @@ .wp-block-tabor-dark-mode-toggle__icon--dark { visibility: visible; } -} +} \ No newline at end of file