Changeset 2568526
- Timestamp:
- 07/20/2021 08:04:50 PM (5 years ago)
- Location:
- content-visibility-date-and-time
- Files:
-
- 10 edited
- 1 copied
-
tags/0.1.2 (copied) (copied from content-visibility-date-and-time/trunk)
-
tags/0.1.2/build/index.asset.php (modified) (1 diff)
-
tags/0.1.2/build/index.js (modified) (3 diffs)
-
tags/0.1.2/build/index.js.map (modified) (1 diff)
-
tags/0.1.2/content-visibility-date-and-time.php (modified) (1 diff)
-
tags/0.1.2/readme.txt (modified) (2 diffs)
-
trunk/build/index.asset.php (modified) (1 diff)
-
trunk/build/index.js (modified) (3 diffs)
-
trunk/build/index.js.map (modified) (1 diff)
-
trunk/content-visibility-date-and-time.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
content-visibility-date-and-time/tags/0.1.2/build/index.asset.php
r2480205 r2568526 1 <?php return array('dependencies' => array('wp-components', 'wp-date', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-polyfill'), 'version' => ' 93beba9afc27a10204639581b88eeb2b');1 <?php return array('dependencies' => array('wp-components', 'wp-date', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-polyfill'), 'version' => '5eaadffda77e9529b231cfc32d084c54'); -
content-visibility-date-and-time/tags/0.1.2/build/index.js
r2480205 r2568526 543 543 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 544 544 /* harmony import */ var _content_visibility_date_time_controls__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./content-visibility-date-time-controls */ "./src/controls/content-visibility-date-time-controls.js"); 545 /* harmony import */ var _helpers_has_rules__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/has-rules */ "./src/helpers/has-rules.js"); 546 545 547 546 548 … … 552 554 attributes = _ref.attributes; 553 555 var rules = attributes.contentVisibilityRules; 556 var hasRulesClass = Object(_helpers_has_rules__WEBPACK_IMPORTED_MODULE_4__["default"])(attributes, 'dateTime') ? ' has-active-rules' : ''; 554 557 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["PanelBody"], { 555 558 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Date and Time', 'content-visibility-date-time'), 556 559 initialOpen: false, 557 className: "content-visibility-control-panel block-visibility-date-time-controls" 560 className: "content-visibility-control-panel block-visibility-date-time-controls" + hasRulesClass 558 561 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["PanelRow"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_content_visibility_date_time_controls__WEBPACK_IMPORTED_MODULE_3__["ContentVisibilityDateTimeControls"], { 559 562 rules: rules, … … 656 659 /***/ }), 657 660 661 /***/ "./src/helpers/has-rules.js": 662 /*!**********************************!*\ 663 !*** ./src/helpers/has-rules.js ***! 664 \**********************************/ 665 /*! exports provided: default */ 666 /***/ (function(module, __webpack_exports__, __webpack_require__) { 667 668 "use strict"; 669 __webpack_require__.r(__webpack_exports__); 670 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks"); 671 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__); 672 673 /** 674 * Determine if the passed block props contain rules of the passed type. 675 * 676 * @param {object} props The currently selected block's props. 677 * @param {string} type The type of the rules i.e. userAuthenticated or specialPage (or ones from add-ons). 678 * 679 * @return {bool} true if the passed props contain non-empty rules of the passed type. False otherwise. 680 */ 681 682 function hasRules(props, type) { 683 if (!props.contentVisibilityRules) { 684 return false; 685 } 686 687 if (!props.contentVisibilityRules[type]) { 688 return false; 689 } // Default to false. Passed through a filter later. 690 691 692 var hasRules = false; 693 694 switch (type) { 695 case 'dateTime': 696 if (props.contentVisibilityRules[type] && props.contentVisibilityRules[type]['start'] && Object.keys(props.contentVisibilityRules[type]['start']).length !== 0) { 697 hasRules = true; 698 } 699 700 if (props.contentVisibilityRules[type] && props.contentVisibilityRules[type]['end'] && Object.keys(props.contentVisibilityRules[type]['end']).length !== 0) { 701 hasRules = true; 702 } 703 704 break; 705 706 default: 707 break; 708 } 709 710 return Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__["applyFilters"])('content-visibility-has-rules', hasRules, props, type); 711 } // end hasRules() 712 713 714 /* harmony default export */ __webpack_exports__["default"] = (hasRules); 715 716 /***/ }), 717 658 718 /***/ "./src/index.js": 659 719 /*!**********************!*\ -
content-visibility-date-and-time/tags/0.1.2/build/index.js.map
r2480205 r2568526 1 {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/@babel/runtime/helpers/arrayLikeToArray.js","webpack:///./node_modules/@babel/runtime/helpers/arrayWithHoles.js","webpack:///./node_modules/@babel/runtime/helpers/defineProperty.js","webpack:///./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","webpack:///./node_modules/@babel/runtime/helpers/nonIterableRest.js","webpack:///./node_modules/@babel/runtime/helpers/slicedToArray.js","webpack:///./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","webpack:///./src/controls/content-visibility-date-time-controls.js","webpack:///./src/controls/content-visibility-date-time-panel-body.js","webpack:///./src/controls/content-visibility-date-time.js","webpack:///./src/editor.scss","webpack:///./src/ index.js","webpack:///external {\"this\":[\"wp\",\"components\"]}","webpack:///external {\"this\":[\"wp\",\"date\"]}","webpack:///external {\"this\":[\"wp\",\"element\"]}","webpack:///external {\"this\":[\"wp\",\"hooks\"]}","webpack:///external {\"this\":[\"wp\",\"i18n\"]}","webpack:///external {\"this\":[\"wp\",\"plugins\"]}"],"names":["ContentVisibilityDateTimeControls","rules","setAttributes","attributes","useState","openDatePopupForStart","setOpenDatePopupForStart","openDatePopupForEnd","setOpenDatePopupForEnd","clearDateAndTime","startOrEnd","contentVisibilityRules","dateTime","ScheduleStartDateTime","start","date","ScheduleEndDateTime","end","ClearCurrentDateTimeIcon","ContentVisibilityScheduleControls","dateI18n","__","bind","contentVisibility","ContentVisibilityDateTimePanelBodyControl","ContentVisibilityDateTimeControl","data","rulesEnabled","contentVisibilityRulesEnabled","hasOwnProperty","ContentVisibilityDateTimeFill","fillProps","registerPlugin","render","addFilter","registerDateTimeContentVisibilityRule","defaultRules"],"mappings":";;;;;;;;;;;;;;;;QAAA;QACA;QACA;QACA;QACA;;QAEA;QACA;QACA;QACA,QAAQ,oBAAoB;QAC5B;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA,iBAAiB,4BAA4B;QAC7C;QACA;QACA,kBAAkB,2BAA2B;QAC7C;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;;QAEA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH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ACxB,aAAhE;AAAgF,gBAAU,EAAGwB,IAAI,CAACvB;AAAlG,MAAV,CADJ;AAGH;;AAED,SACI,yEAAC,gFAAD;AAA2C,iBAAa,EAAGuB,IAAI,CAACxB,aAAhE;AAAgF,cAAU,EAAGwB,IAAI,CAACvB;AAAlG,IADJ;AAIH;AAED;AACA;AACA;AACA;AACA;AACA;;AACA,SAAS2B,6BAAT,GAAyC;AACrC,SACI,yEAAC,0DAAD;AAAM,QAAI,EAAC;AAAX,KAEQ,UAAEC,SAAF,EAAiB;AACb,WACI,yEAAC,gCAAD;AAAkC,mBAAa,EAAGA,SAAS,CAAC7B,aAA5D;AAA4E,gBAAU,EAAG6B,SAAS,CAAC5B;AAAnG,MADJ;AAGH,GANT,CADJ;AAYH,C,CAED;;;AACA6B,yEAAc,CAAE,sCAAF,EAA0C;AAAEC,QAAM,EAAEH;AAAV,CAA1C,CAAd,C,CAGA;;AACAI,kEAAS,CAAE,iDAAF,EAAqD,qDAArD,EAA4GC,qCAA5G,CAAT;;AAEA,SAASA,qCAAT,CAAgDC,YAAhD,EAA+D;AAE3DA,cAAY,CAACxB,QAAb,GAAwB;AACpBE,SAAK,EAAE,EADa;AAEpBG,OAAG,EAAE;AAFe,GAAxB;AAKA,SAAOmB,YAAP;AAEH,C;;;;;;;;;;;AC7DD,uC;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;;;;;;;;;;;;ACDA,aAAa,2CAA2C,EAAE,I;;;;;;;;;;;ACA1D,aAAa,qCAAqC,EAAE,I;;;;;;;;;;;ACApD,aAAa,wCAAwC,EAAE,I;;;;;;;;;;;ACAvD,aAAa,sCAAsC,EAAE,I;;;;;;;;;;;ACArD,aAAa,qCAAqC,EAAE,I;;;;;;;;;;;ACApD,aAAa,wCAAwC,EAAE,I","file":"index.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t\"index\": 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([\"./src/index.js\",\"style-index\"]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nmodule.exports = _arrayLikeToArray;","function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nmodule.exports = _arrayWithHoles;","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","function _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nmodule.exports = _iterableToArrayLimit;","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableRest;","var arrayWithHoles = require(\"./arrayWithHoles\");\n\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray\");\n\nvar nonIterableRest = require(\"./nonIterableRest\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;","var arrayLikeToArray = require(\"./arrayLikeToArray\");\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\n\nmodule.exports = _unsupportedIterableToArray;","import { DateTimePicker, Popover, Button, Icon } from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { dateI18n } from '@wordpress/date';\nimport { __ } from '@wordpress/i18n';\n\n\nexport const ContentVisibilityDateTimeControls = ({ rules, setAttributes, attributes }) => {\n\n const [ openDatePopupForStart, setOpenDatePopupForStart ] = useState( false );\n const [ openDatePopupForEnd, setOpenDatePopupForEnd ] = useState( false );\n\n /**\n * Clear the date and time - resets to not having a value.\n *\n * @param {*} startOrEnd Are we resetting the start or end date.\n * @param {*} rules The current ruleset for this block.\n */\n const clearDateAndTime = ( startOrEnd, rules ) => {\n\n setAttributes( {\n contentVisibilityRules: {\n ...rules,\n dateTime: {\n ...rules.dateTime,\n [startOrEnd]: {}\n }\n },\n } );\n\n };\n\n /**\n * DateTimePicker for the Start date/time.\n */\n const ScheduleStartDateTime = () => (\n <DateTimePicker\n currentDate={rules.dateTime.start}\n onChange={(date) => {\n\n setAttributes( {\n contentVisibilityRules: {\n ...rules,\n dateTime: {\n ...rules.dateTime,\n 'start': date\n }\n },\n });\n\n setOpenDatePopupForStart( false );\n\n } }\n is12Hour={false}\n />\n );\n\n /**\n * DateTimePicker for the End date/time.\n */\n const ScheduleEndDateTime = () => (\n <DateTimePicker\n currentDate={rules.dateTime.end}\n onChange={ (date) => {\n setAttributes({\n contentVisibilityRules: {\n ...rules,\n dateTime: {\n ...rules.dateTime,\n 'end': date\n }\n },\n });\n\n setOpenDatePopupForEnd( false );\n\n } }\n is12Hour={false}\n />\n );\n\n const ClearCurrentDateTimeIcon = () => (\n <Icon\n icon={ () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"feather feather-x-circle\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><line x1=\"15\" y1=\"9\" x2=\"9\" y2=\"15\"></line><line x1=\"9\" y1=\"9\" x2=\"15\" y2=\"15\"></line></svg>\n ) }\n />\n );\n\n /**\n * Output the Scheduling controls\n */\n const ContentVisibilityScheduleControls = () => (\n\n <div className=\"content-visibility-schedule-controls\">\n\n <div className=\"components-dropdown\">\n <Button isLink={true} className=\"content-visibility-set-date-time\" icon=\"calendar-alt\" onClick={ () => setOpenDatePopupForStart( ! openDatePopupForStart ) }>\n { ( rules.dateTime.start && typeof rules.dateTime.start === 'string' ) ? dateI18n( 'D M j Y, G:i', rules.dateTime.start ) : __( \"Set Start Date/Time\" ) }\n </Button>\n {openDatePopupForStart && (\n <Popover position=\"middle left\" className=\"content-visibility-picker-popover content-visibility-picker-popover-start\" onClose={setOpenDatePopupForStart.bind( null, false )}>\n <ScheduleStartDateTime />\n </Popover>\n )}\n\n { ( rules.dateTime.start && typeof rules.dateTime.start === 'string' ) && (\n <Button isLink={true} label=\"Clear date and time\" className=\"content-visibility-clear-date-time\" onClick={() => { clearDateAndTime('start', rules); }}>\n <ClearCurrentDateTimeIcon />\n </Button>\n ) }\n \n </div>\n\n <div className=\"components-dropdown\">\n <Button isLink={true} className=\"content-visibility-set-date-time\" icon=\"calendar-alt\" onClick={ () => setOpenDatePopupForEnd( ! openDatePopupForEnd ) }>\n { ( rules.dateTime.end && typeof rules.dateTime.end === 'string' ) ? dateI18n( 'D M j Y, G:i', rules.dateTime.end ) : __( \"Set End Date/Time\" ) }\n </Button>\n {openDatePopupForEnd && (\n <Popover position=\"middle left\" className=\"content-visibility-picker-popover content-visibility-picker-popover-end\" onClose={ setOpenDatePopupForEnd.bind( null, false ) }>\n <ScheduleEndDateTime />\n </Popover>\n )}\n\n { ( rules.dateTime.end && typeof rules.dateTime.end === 'string' ) && (\n <Button isLink={true} label=\"Clear date and time\" className=\"content-visibility-clear-date-time\" onClick={() => { clearDateAndTime('end', rules); }}>\n <ClearCurrentDateTimeIcon />\n </Button>\n ) }\n </div>\n\n <p className=\"date-time-help-intro content-visibility-help-text\">{ __( 'Set start and/or end dates for when this block will be ' + attributes.contentVisibility + '. Not selecting either date will mean this block is ' + attributes.contentVisibility + ' at all times.' ) }</p>\n\n </div>\n );\n\n return (\n <ContentVisibilityScheduleControls />\n );\n\n};\n","import { PanelBody, PanelRow } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nimport { ContentVisibilityDateTimeControls } from './content-visibility-date-time-controls';\n\n\nfunction ContentVisibilityDateTimePanelBodyControl( { setAttributes, attributes } ) {\n\n let rules = attributes.contentVisibilityRules;\n\n return (\n <PanelBody\n title={ __( 'Date and Time', 'content-visibility-date-time' ) }\n initialOpen={ false }\n className=\"content-visibility-control-panel block-visibility-date-time-controls\"\n >\n <PanelRow>\n <ContentVisibilityDateTimeControls rules={ rules } setAttributes={ setAttributes } attributes={ attributes } />\n </PanelRow>\n </PanelBody>\n );\n\n}\n\nexport default ContentVisibilityDateTimePanelBodyControl;","import { Fill, Disabled } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addFilter } from '@wordpress/hooks';\n\nimport ContentVisibilityDateTimePanelBodyControl from './content-visibility-date-time-panel-body';\n\nexport function ContentVisibilityDateTimeControl( data ) {\n\n let rulesEnabled = data.attributes.contentVisibilityRules.contentVisibilityRulesEnabled;\n let contentVisibility = data.attributes.hasOwnProperty( 'contentVisibility' );\n\n if ( ! rulesEnabled || ! contentVisibility ) {\n return (\n <Disabled><ContentVisibilityDateTimePanelBodyControl setAttributes={ data.setAttributes } attributes={ data.attributes } /></Disabled>\n );\n }\n\n return (\n <ContentVisibilityDateTimePanelBodyControl setAttributes={ data.setAttributes } attributes={ data.attributes } />\n );\n\n}\n\n/**\n * Render the <ContentVisibilityDateTimeControl> component by adding\n * it to the block-visibility-extra-controls Fill.\n *\n * @return {Object} A Fill component wrapping the ContentVisibilityDateTimeControl component.\n */\nfunction ContentVisibilityDateTimeFill() {\n return (\n <Fill name=\"content-visibility-extra-controls\">\n {\n ( fillProps ) => {\n return (\n <ContentVisibilityDateTimeControl setAttributes={ fillProps.setAttributes } attributes={ fillProps.attributes } />\n )\n }\n }\n </Fill>\n );\n\n}\n\n// Add our component to the Slot provided by BlockVisibilityControls\nregisterPlugin( 'content-visibility-03-date-time-fill', { render: ContentVisibilityDateTimeFill } );\n\n\n// Register our visibility rule with the main plugin\naddFilter( 'contentVisibility.defaultContentVisibilityRules', 'content-visibility-date-time/block-visibility-rules', registerDateTimeContentVisibilityRule );\n\nfunction registerDateTimeContentVisibilityRule( defaultRules ) {\n\n defaultRules.dateTime = {\n start: {},\n end: {}\n };\n\n return defaultRules;\n\n}\n","// extracted by mini-css-extract-plugin","import './editor.scss';\nimport './style.scss';\n\nimport ContentVisibilityDateTimeControl from './controls/content-visibility-date-time';","(function() { module.exports = this[\"wp\"][\"components\"]; }());","(function() { module.exports = this[\"wp\"][\"date\"]; }());","(function() { module.exports = this[\"wp\"][\"element\"]; }());","(function() { module.exports = this[\"wp\"][\"hooks\"]; }());","(function() { module.exports = this[\"wp\"][\"i18n\"]; }());","(function() { module.exports = this[\"wp\"][\"plugins\"]; }());"],"sourceRoot":""}1 {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/@babel/runtime/helpers/arrayLikeToArray.js","webpack:///./node_modules/@babel/runtime/helpers/arrayWithHoles.js","webpack:///./node_modules/@babel/runtime/helpers/defineProperty.js","webpack:///./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","webpack:///./node_modules/@babel/runtime/helpers/nonIterableRest.js","webpack:///./node_modules/@babel/runtime/helpers/slicedToArray.js","webpack:///./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","webpack:///./src/controls/content-visibility-date-time-controls.js","webpack:///./src/controls/content-visibility-date-time-panel-body.js","webpack:///./src/controls/content-visibility-date-time.js","webpack:///./src/editor.scss","webpack:///./src/helpers/has-rules.js","webpack:///./src/index.js","webpack:///external {\"this\":[\"wp\",\"components\"]}","webpack:///external {\"this\":[\"wp\",\"date\"]}","webpack:///external {\"this\":[\"wp\",\"element\"]}","webpack:///external {\"this\":[\"wp\",\"hooks\"]}","webpack:///external {\"this\":[\"wp\",\"i18n\"]}","webpack:///external {\"this\":[\"wp\",\"plugins\"]}"],"names":["ContentVisibilityDateTimeControls","rules","setAttributes","attributes","useState","openDatePopupForStart","setOpenDatePopupForStart","openDatePopupForEnd","setOpenDatePopupForEnd","clearDateAndTime","startOrEnd","contentVisibilityRules","dateTime","ScheduleStartDateTime","start","date","ScheduleEndDateTime","end","ClearCurrentDateTimeIcon","ContentVisibilityScheduleControls","dateI18n","__","bind","contentVisibility","ContentVisibilityDateTimePanelBodyControl","hasRulesClass","hasRules","ContentVisibilityDateTimeControl","data","rulesEnabled","contentVisibilityRulesEnabled","hasOwnProperty","ContentVisibilityDateTimeFill","fillProps","registerPlugin","render","addFilter","registerDateTimeContentVisibilityRule","defaultRules","props","type","Object","keys","length","applyFilters"],"mappings":";;;;;;;;;;;;;;;;QAAA;QACA;QACA;QACA;QACA;;QAEA;QACA;QACA;QACA,QAAQ,oBAAoB;QAC5B;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA,iBAAiB,4BAA4B;QAC7C;QACA;QACA,kBAAkB,2BAA2B;QAC7C;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;;QAEA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;QAEA;QACA;QACA;QACA;QACA,gBAAgB,uBAAuB;QACvC;;;QAGA;QACA;QACA;QACA;;;;;;;;;;;;ACvJA;AACA;;AAEA,wCAAwC,SAAS;AACjD;AACA;;AAEA;AACA;;AAEA,mC;;;;;;;;;;;ACVA;AACA;AACA;;AAEA,iC;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,K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AC5B,sBAAN,CAA6B6B,IAA7B,EAAmC,OAAnC,CAAb,EAA2DG,MAA3D,KAAsE,CAAhK,EAAoK;AAChKjB,gBAAQ,GAAG,IAAX;AACH;;AAED,UAAKa,KAAK,CAAC5B,sBAAN,CAA6B6B,IAA7B,KAAsCD,KAAK,CAAC5B,sBAAN,CAA6B6B,IAA7B,EAAmC,KAAnC,CAAtC,IAAmFC,MAAM,CAACC,IAAP,CAAaH,KAAK,CAAC5B,sBAAN,CAA6B6B,IAA7B,EAAmC,KAAnC,CAAb,EAAyDG,MAAzD,KAAoE,CAA5J,EAAgK;AAC5JjB,gBAAQ,GAAG,IAAX;AACH;;AAED;;AAEJ;AACI;AAfR;;AAkBA,SAAOkB,qEAAY,CAAE,8BAAF,EAAkClB,QAAlC,EAA4Ca,KAA5C,EAAmDC,IAAnD,CAAnB;AAEH,C,CAAA;;;AAEcd,uEAAf,E;;;;;;;;;;;;AC7CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;;;;;;;;;;;;ACDA,aAAa,2CAA2C,EAAE,I;;;;;;;;;;;ACA1D,aAAa,qCAAqC,EAAE,I;;;;;;;;;;;ACApD,aAAa,wCAAwC,EAAE,I;;;;;;;;;;;ACAvD,aAAa,sCAAsC,EAAE,I;;;;;;;;;;;ACArD,aAAa,qCAAqC,EAAE,I;;;;;;;;;;;ACApD,aAAa,wCAAwC,EAAE,I","file":"index.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t\"index\": 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([\"./src/index.js\",\"style-index\"]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nmodule.exports = _arrayLikeToArray;","function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nmodule.exports = _arrayWithHoles;","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","function _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nmodule.exports = _iterableToArrayLimit;","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableRest;","var arrayWithHoles = require(\"./arrayWithHoles\");\n\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray\");\n\nvar nonIterableRest = require(\"./nonIterableRest\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;","var arrayLikeToArray = require(\"./arrayLikeToArray\");\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\n\nmodule.exports = _unsupportedIterableToArray;","import { DateTimePicker, Popover, Button, Icon } from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { dateI18n } from '@wordpress/date';\nimport { __ } from '@wordpress/i18n';\n\n\nexport const ContentVisibilityDateTimeControls = ({ rules, setAttributes, attributes }) => {\n\n const [ openDatePopupForStart, setOpenDatePopupForStart ] = useState( false );\n const [ openDatePopupForEnd, setOpenDatePopupForEnd ] = useState( false );\n\n /**\n * Clear the date and time - resets to not having a value.\n *\n * @param {*} startOrEnd Are we resetting the start or end date.\n * @param {*} rules The current ruleset for this block.\n */\n const clearDateAndTime = ( startOrEnd, rules ) => {\n\n setAttributes( {\n contentVisibilityRules: {\n ...rules,\n dateTime: {\n ...rules.dateTime,\n [startOrEnd]: {}\n }\n },\n } );\n\n };\n\n /**\n * DateTimePicker for the Start date/time.\n */\n const ScheduleStartDateTime = () => (\n <DateTimePicker\n currentDate={rules.dateTime.start}\n onChange={(date) => {\n\n setAttributes( {\n contentVisibilityRules: {\n ...rules,\n dateTime: {\n ...rules.dateTime,\n 'start': date\n }\n },\n });\n\n setOpenDatePopupForStart( false );\n\n } }\n is12Hour={false}\n />\n );\n\n /**\n * DateTimePicker for the End date/time.\n */\n const ScheduleEndDateTime = () => (\n <DateTimePicker\n currentDate={rules.dateTime.end}\n onChange={ (date) => {\n setAttributes({\n contentVisibilityRules: {\n ...rules,\n dateTime: {\n ...rules.dateTime,\n 'end': date\n }\n },\n });\n\n setOpenDatePopupForEnd( false );\n\n } }\n is12Hour={false}\n />\n );\n\n const ClearCurrentDateTimeIcon = () => (\n <Icon\n icon={ () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"feather feather-x-circle\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><line x1=\"15\" y1=\"9\" x2=\"9\" y2=\"15\"></line><line x1=\"9\" y1=\"9\" x2=\"15\" y2=\"15\"></line></svg>\n ) }\n />\n );\n\n /**\n * Output the Scheduling controls\n */\n const ContentVisibilityScheduleControls = () => (\n\n <div className=\"content-visibility-schedule-controls\">\n\n <div className=\"components-dropdown\">\n <Button isLink={true} className=\"content-visibility-set-date-time\" icon=\"calendar-alt\" onClick={ () => setOpenDatePopupForStart( ! openDatePopupForStart ) }>\n { ( rules.dateTime.start && typeof rules.dateTime.start === 'string' ) ? dateI18n( 'D M j Y, G:i', rules.dateTime.start ) : __( \"Set Start Date/Time\" ) }\n </Button>\n {openDatePopupForStart && (\n <Popover position=\"middle left\" className=\"content-visibility-picker-popover content-visibility-picker-popover-start\" onClose={setOpenDatePopupForStart.bind( null, false )}>\n <ScheduleStartDateTime />\n </Popover>\n )}\n\n { ( rules.dateTime.start && typeof rules.dateTime.start === 'string' ) && (\n <Button isLink={true} label=\"Clear date and time\" className=\"content-visibility-clear-date-time\" onClick={() => { clearDateAndTime('start', rules); }}>\n <ClearCurrentDateTimeIcon />\n </Button>\n ) }\n \n </div>\n\n <div className=\"components-dropdown\">\n <Button isLink={true} className=\"content-visibility-set-date-time\" icon=\"calendar-alt\" onClick={ () => setOpenDatePopupForEnd( ! openDatePopupForEnd ) }>\n { ( rules.dateTime.end && typeof rules.dateTime.end === 'string' ) ? dateI18n( 'D M j Y, G:i', rules.dateTime.end ) : __( \"Set End Date/Time\" ) }\n </Button>\n {openDatePopupForEnd && (\n <Popover position=\"middle left\" className=\"content-visibility-picker-popover content-visibility-picker-popover-end\" onClose={ setOpenDatePopupForEnd.bind( null, false ) }>\n <ScheduleEndDateTime />\n </Popover>\n )}\n\n { ( rules.dateTime.end && typeof rules.dateTime.end === 'string' ) && (\n <Button isLink={true} label=\"Clear date and time\" className=\"content-visibility-clear-date-time\" onClick={() => { clearDateAndTime('end', rules); }}>\n <ClearCurrentDateTimeIcon />\n </Button>\n ) }\n </div>\n\n <p className=\"date-time-help-intro content-visibility-help-text\">{ __( 'Set start and/or end dates for when this block will be ' + attributes.contentVisibility + '. Not selecting either date will mean this block is ' + attributes.contentVisibility + ' at all times.' ) }</p>\n\n </div>\n );\n\n return (\n <ContentVisibilityScheduleControls />\n );\n\n};\n","import { PanelBody, PanelRow } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nimport { ContentVisibilityDateTimeControls } from './content-visibility-date-time-controls';\n\nimport hasRules from '../helpers/has-rules';\n\n\nfunction ContentVisibilityDateTimePanelBodyControl( { setAttributes, attributes } ) {\n\n let rules = attributes.contentVisibilityRules;\n let hasRulesClass = ( hasRules( attributes, 'dateTime' ) ) ? ' has-active-rules' : '';\n\n return (\n <PanelBody\n title={ __( 'Date and Time', 'content-visibility-date-time' ) }\n initialOpen={ false }\n className={\"content-visibility-control-panel block-visibility-date-time-controls\" + hasRulesClass }\n >\n <PanelRow>\n <ContentVisibilityDateTimeControls rules={ rules } setAttributes={ setAttributes } attributes={ attributes } />\n </PanelRow>\n </PanelBody>\n );\n\n}\n\nexport default ContentVisibilityDateTimePanelBodyControl;","import { Fill, Disabled } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addFilter } from '@wordpress/hooks';\n\nimport ContentVisibilityDateTimePanelBodyControl from './content-visibility-date-time-panel-body';\n\nexport function ContentVisibilityDateTimeControl( data ) {\n\n let rulesEnabled = data.attributes.contentVisibilityRules.contentVisibilityRulesEnabled;\n let contentVisibility = data.attributes.hasOwnProperty( 'contentVisibility' );\n\n if ( ! rulesEnabled || ! contentVisibility ) {\n return (\n <Disabled><ContentVisibilityDateTimePanelBodyControl setAttributes={ data.setAttributes } attributes={ data.attributes } /></Disabled>\n );\n }\n\n return (\n <ContentVisibilityDateTimePanelBodyControl setAttributes={ data.setAttributes } attributes={ data.attributes } />\n );\n\n}\n\n/**\n * Render the <ContentVisibilityDateTimeControl> component by adding\n * it to the block-visibility-extra-controls Fill.\n *\n * @return {Object} A Fill component wrapping the ContentVisibilityDateTimeControl component.\n */\nfunction ContentVisibilityDateTimeFill() {\n return (\n <Fill name=\"content-visibility-extra-controls\">\n {\n ( fillProps ) => {\n return (\n <ContentVisibilityDateTimeControl setAttributes={ fillProps.setAttributes } attributes={ fillProps.attributes } />\n )\n }\n }\n </Fill>\n );\n\n}\n\n// Add our component to the Slot provided by BlockVisibilityControls\nregisterPlugin( 'content-visibility-03-date-time-fill', { render: ContentVisibilityDateTimeFill } );\n\n\n// Register our visibility rule with the main plugin\naddFilter( 'contentVisibility.defaultContentVisibilityRules', 'content-visibility-date-time/block-visibility-rules', registerDateTimeContentVisibilityRule );\n\nfunction registerDateTimeContentVisibilityRule( defaultRules ) {\n\n defaultRules.dateTime = {\n start: {},\n end: {}\n };\n\n return defaultRules;\n\n}\n","// extracted by mini-css-extract-plugin","import { applyFilters } from '@wordpress/hooks';\n\n/**\n * Determine if the passed block props contain rules of the passed type.\n *\n * @param {object} props The currently selected block's props.\n * @param {string} type The type of the rules i.e. userAuthenticated or specialPage (or ones from add-ons).\n *\n * @return {bool} true if the passed props contain non-empty rules of the passed type. False otherwise.\n */\n function hasRules( props, type ) {\n\n if ( ! props.contentVisibilityRules ) {\n return false;\n }\n\n if ( ! props.contentVisibilityRules[type] ) {\n return false;\n }\n\n // Default to false. Passed through a filter later.\n let hasRules = false;\n\n switch ( type ) {\n \n case 'dateTime':\n\n if ( props.contentVisibilityRules[type] && props.contentVisibilityRules[type]['start'] && Object.keys( props.contentVisibilityRules[type]['start'] ).length !== 0 ) {\n hasRules = true;\n }\n\n if ( props.contentVisibilityRules[type] && props.contentVisibilityRules[type]['end'] && Object.keys( props.contentVisibilityRules[type]['end'] ).length !== 0 ) {\n hasRules = true;\n }\n\n break;\n\n default:\n break;\n }\n\n return applyFilters( 'content-visibility-has-rules', hasRules, props, type );\n\n}// end hasRules()\n\nexport default hasRules;","import './editor.scss';\nimport './style.scss';\n\nimport ContentVisibilityDateTimeControl from './controls/content-visibility-date-time';","(function() { module.exports = this[\"wp\"][\"components\"]; }());","(function() { module.exports = this[\"wp\"][\"date\"]; }());","(function() { module.exports = this[\"wp\"][\"element\"]; }());","(function() { module.exports = this[\"wp\"][\"hooks\"]; }());","(function() { module.exports = this[\"wp\"][\"i18n\"]; }());","(function() { module.exports = this[\"wp\"][\"plugins\"]; }());"],"sourceRoot":""} -
content-visibility-date-and-time/tags/0.1.2/content-visibility-date-and-time.php
r2510973 r2568526 12 12 * Plugin URI: https://richardtape.com/content-visibility/ 13 13 * Description: [Content Visibility Add-On] Schedule showing or hiding specific content blocks. 14 * Version: 0.1. 114 * Version: 0.1.2 15 15 * Author: Richard Tape 16 16 * Author URI: https://richardtape.com -
content-visibility-date-and-time/tags/0.1.2/readme.txt
r2510973 r2568526 2 2 Contributors: iamfriendly 3 3 Donate link: https://girlswhocode.com/ 4 Tags: block, content, visibility, date, time, contentvisibility4 Tags: contentvisibility, block, content, visibility, date, time 5 5 Requires at least: 5.0 6 Tested up to: 5. 7.07 Stable tag: 0.1. 16 Tested up to: 5.8.0 7 Stable tag: 0.1.2 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 35 35 == Changelog == 36 36 37 = 0.1.2 = 38 * Added indicator to show when Date/Time rules are present for a block to make it easier to see when a block has rules. 39 * WP 5.8.0 compatibility. 40 37 41 = 0.1.1 = 38 42 * Updated tags to make addons more finadable from the core plugin. -
content-visibility-date-and-time/trunk/build/index.asset.php
r2480205 r2568526 1 <?php return array('dependencies' => array('wp-components', 'wp-date', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-polyfill'), 'version' => ' 93beba9afc27a10204639581b88eeb2b');1 <?php return array('dependencies' => array('wp-components', 'wp-date', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-polyfill'), 'version' => '5eaadffda77e9529b231cfc32d084c54'); -
content-visibility-date-and-time/trunk/build/index.js
r2480205 r2568526 543 543 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 544 544 /* harmony import */ var _content_visibility_date_time_controls__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./content-visibility-date-time-controls */ "./src/controls/content-visibility-date-time-controls.js"); 545 /* harmony import */ var _helpers_has_rules__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/has-rules */ "./src/helpers/has-rules.js"); 546 545 547 546 548 … … 552 554 attributes = _ref.attributes; 553 555 var rules = attributes.contentVisibilityRules; 556 var hasRulesClass = Object(_helpers_has_rules__WEBPACK_IMPORTED_MODULE_4__["default"])(attributes, 'dateTime') ? ' has-active-rules' : ''; 554 557 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["PanelBody"], { 555 558 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Date and Time', 'content-visibility-date-time'), 556 559 initialOpen: false, 557 className: "content-visibility-control-panel block-visibility-date-time-controls" 560 className: "content-visibility-control-panel block-visibility-date-time-controls" + hasRulesClass 558 561 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["PanelRow"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_content_visibility_date_time_controls__WEBPACK_IMPORTED_MODULE_3__["ContentVisibilityDateTimeControls"], { 559 562 rules: rules, … … 656 659 /***/ }), 657 660 661 /***/ "./src/helpers/has-rules.js": 662 /*!**********************************!*\ 663 !*** ./src/helpers/has-rules.js ***! 664 \**********************************/ 665 /*! exports provided: default */ 666 /***/ (function(module, __webpack_exports__, __webpack_require__) { 667 668 "use strict"; 669 __webpack_require__.r(__webpack_exports__); 670 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks"); 671 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__); 672 673 /** 674 * Determine if the passed block props contain rules of the passed type. 675 * 676 * @param {object} props The currently selected block's props. 677 * @param {string} type The type of the rules i.e. userAuthenticated or specialPage (or ones from add-ons). 678 * 679 * @return {bool} true if the passed props contain non-empty rules of the passed type. False otherwise. 680 */ 681 682 function hasRules(props, type) { 683 if (!props.contentVisibilityRules) { 684 return false; 685 } 686 687 if (!props.contentVisibilityRules[type]) { 688 return false; 689 } // Default to false. Passed through a filter later. 690 691 692 var hasRules = false; 693 694 switch (type) { 695 case 'dateTime': 696 if (props.contentVisibilityRules[type] && props.contentVisibilityRules[type]['start'] && Object.keys(props.contentVisibilityRules[type]['start']).length !== 0) { 697 hasRules = true; 698 } 699 700 if (props.contentVisibilityRules[type] && props.contentVisibilityRules[type]['end'] && Object.keys(props.contentVisibilityRules[type]['end']).length !== 0) { 701 hasRules = true; 702 } 703 704 break; 705 706 default: 707 break; 708 } 709 710 return Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__["applyFilters"])('content-visibility-has-rules', hasRules, props, type); 711 } // end hasRules() 712 713 714 /* harmony default export */ __webpack_exports__["default"] = (hasRules); 715 716 /***/ }), 717 658 718 /***/ "./src/index.js": 659 719 /*!**********************!*\ -
content-visibility-date-and-time/trunk/build/index.js.map
r2480205 r2568526 1 {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/@babel/runtime/helpers/arrayLikeToArray.js","webpack:///./node_modules/@babel/runtime/helpers/arrayWithHoles.js","webpack:///./node_modules/@babel/runtime/helpers/defineProperty.js","webpack:///./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","webpack:///./node_modules/@babel/runtime/helpers/nonIterableRest.js","webpack:///./node_modules/@babel/runtime/helpers/slicedToArray.js","webpack:///./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","webpack:///./src/controls/content-visibility-date-time-controls.js","webpack:///./src/controls/content-visibility-date-time-panel-body.js","webpack:///./src/controls/content-visibility-date-time.js","webpack:///./src/editor.scss","webpack:///./src/ index.js","webpack:///external {\"this\":[\"wp\",\"components\"]}","webpack:///external {\"this\":[\"wp\",\"date\"]}","webpack:///external {\"this\":[\"wp\",\"element\"]}","webpack:///external {\"this\":[\"wp\",\"hooks\"]}","webpack:///external {\"this\":[\"wp\",\"i18n\"]}","webpack:///external {\"this\":[\"wp\",\"plugins\"]}"],"names":["ContentVisibilityDateTimeControls","rules","setAttributes","attributes","useState","openDatePopupForStart","setOpenDatePopupForStart","openDatePopupForEnd","setOpenDatePopupForEnd","clearDateAndTime","startOrEnd","contentVisibilityRules","dateTime","ScheduleStartDateTime","start","date","ScheduleEndDateTime","end","ClearCurrentDateTimeIcon","ContentVisibilityScheduleControls","dateI18n","__","bind","contentVisibility","ContentVisibilityDateTimePanelBodyControl","ContentVisibilityDateTimeControl","data","rulesEnabled","contentVisibilityRulesEnabled","hasOwnProperty","ContentVisibilityDateTimeFill","fillProps","registerPlugin","render","addFilter","registerDateTimeContentVisibilityRule","defaultRules"],"mappings":";;;;;;;;;;;;;;;;QAAA;QACA;QACA;QACA;QACA;;QAEA;QACA;QACA;QACA,QAAQ,oBAAoB;QAC5B;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA,iBAAiB,4BAA4B;QAC7C;QACA;QACA,kBAAkB,2BAA2B;QAC7C;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;;QAEA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;QAEA;QACA;QACA;QACA;QACA,gBAAgB,uBAAuB;QACvC;;;QAGA;QACA;QACA;QACA;;;;;;;;;;;;ACvJA;AACA;;AAEA,wCAAwC,SAAS;AACjD;AACA;;AAEA;AACA;;AAEA,mC;;;;;;;;;;;ACVA;AACA;AACA;;AAEA,iC;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;;AAEA;AACA;;AAEA,iC;;;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6CAA6C,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,mBAAa,EAAGA,SAAS,CAAC7B,aAA5D;AAA4E,gBAAU,EAAG6B,SAAS,CAAC5B;AAAnG,MADJ;AAGH,GANT,CADJ;AAYH,C,CAED;;;AACA6B,yEAAc,CAAE,sCAAF,EAA0C;AAAEC,QAAM,EAAEH;AAAV,CAA1C,CAAd,C,CAGA;;AACAI,kEAAS,CAAE,iDAAF,EAAqD,qDAArD,EAA4GC,qCAA5G,CAAT;;AAEA,SAASA,qCAAT,CAAgDC,YAAhD,EAA+D;AAE3DA,cAAY,CAACxB,QAAb,GAAwB;AACpBE,SAAK,EAAE,EADa;AAEpBG,OAAG,EAAE;AAFe,GAAxB;AAKA,SAAOmB,YAAP;AAEH,C;;;;;;;;;;;AC7DD,uC;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;;;;;;;;;;;;ACDA,aAAa,2CAA2C,EAAE,I;;;;;;;;;;;ACA1D,aAAa,qCAAqC,EAAE,I;;;;;;;;;;;ACApD,aAAa,wCAAwC,EAAE,I;;;;;;;;;;;ACAvD,aAAa,sCAAsC,EAAE,I;;;;;;;;;;;ACArD,aAAa,qCAAqC,EAAE,I;;;;;;;;;;;ACApD,aAAa,wCAAwC,EAAE,I","file":"index.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t\"index\": 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([\"./src/index.js\",\"style-index\"]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nmodule.exports = _arrayLikeToArray;","function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nmodule.exports = _arrayWithHoles;","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","function _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nmodule.exports = _iterableToArrayLimit;","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableRest;","var arrayWithHoles = require(\"./arrayWithHoles\");\n\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray\");\n\nvar nonIterableRest = require(\"./nonIterableRest\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;","var arrayLikeToArray = require(\"./arrayLikeToArray\");\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\n\nmodule.exports = _unsupportedIterableToArray;","import { DateTimePicker, Popover, Button, Icon } from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { dateI18n } from '@wordpress/date';\nimport { __ } from '@wordpress/i18n';\n\n\nexport const ContentVisibilityDateTimeControls = ({ rules, setAttributes, attributes }) => {\n\n const [ openDatePopupForStart, setOpenDatePopupForStart ] = useState( false );\n const [ openDatePopupForEnd, setOpenDatePopupForEnd ] = useState( false );\n\n /**\n * Clear the date and time - resets to not having a value.\n *\n * @param {*} startOrEnd Are we resetting the start or end date.\n * @param {*} rules The current ruleset for this block.\n */\n const clearDateAndTime = ( startOrEnd, rules ) => {\n\n setAttributes( {\n contentVisibilityRules: {\n ...rules,\n dateTime: {\n ...rules.dateTime,\n [startOrEnd]: {}\n }\n },\n } );\n\n };\n\n /**\n * DateTimePicker for the Start date/time.\n */\n const ScheduleStartDateTime = () => (\n <DateTimePicker\n currentDate={rules.dateTime.start}\n onChange={(date) => {\n\n setAttributes( {\n contentVisibilityRules: {\n ...rules,\n dateTime: {\n ...rules.dateTime,\n 'start': date\n }\n },\n });\n\n setOpenDatePopupForStart( false );\n\n } }\n is12Hour={false}\n />\n );\n\n /**\n * DateTimePicker for the End date/time.\n */\n const ScheduleEndDateTime = () => (\n <DateTimePicker\n currentDate={rules.dateTime.end}\n onChange={ (date) => {\n setAttributes({\n contentVisibilityRules: {\n ...rules,\n dateTime: {\n ...rules.dateTime,\n 'end': date\n }\n },\n });\n\n setOpenDatePopupForEnd( false );\n\n } }\n is12Hour={false}\n />\n );\n\n const ClearCurrentDateTimeIcon = () => (\n <Icon\n icon={ () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"feather feather-x-circle\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><line x1=\"15\" y1=\"9\" x2=\"9\" y2=\"15\"></line><line x1=\"9\" y1=\"9\" x2=\"15\" y2=\"15\"></line></svg>\n ) }\n />\n );\n\n /**\n * Output the Scheduling controls\n */\n const ContentVisibilityScheduleControls = () => (\n\n <div className=\"content-visibility-schedule-controls\">\n\n <div className=\"components-dropdown\">\n <Button isLink={true} className=\"content-visibility-set-date-time\" icon=\"calendar-alt\" onClick={ () => setOpenDatePopupForStart( ! openDatePopupForStart ) }>\n { ( rules.dateTime.start && typeof rules.dateTime.start === 'string' ) ? dateI18n( 'D M j Y, G:i', rules.dateTime.start ) : __( \"Set Start Date/Time\" ) }\n </Button>\n {openDatePopupForStart && (\n <Popover position=\"middle left\" className=\"content-visibility-picker-popover content-visibility-picker-popover-start\" onClose={setOpenDatePopupForStart.bind( null, false )}>\n <ScheduleStartDateTime />\n </Popover>\n )}\n\n { ( rules.dateTime.start && typeof rules.dateTime.start === 'string' ) && (\n <Button isLink={true} label=\"Clear date and time\" className=\"content-visibility-clear-date-time\" onClick={() => { clearDateAndTime('start', rules); }}>\n <ClearCurrentDateTimeIcon />\n </Button>\n ) }\n \n </div>\n\n <div className=\"components-dropdown\">\n <Button isLink={true} className=\"content-visibility-set-date-time\" icon=\"calendar-alt\" onClick={ () => setOpenDatePopupForEnd( ! openDatePopupForEnd ) }>\n { ( rules.dateTime.end && typeof rules.dateTime.end === 'string' ) ? dateI18n( 'D M j Y, G:i', rules.dateTime.end ) : __( \"Set End Date/Time\" ) }\n </Button>\n {openDatePopupForEnd && (\n <Popover position=\"middle left\" className=\"content-visibility-picker-popover content-visibility-picker-popover-end\" onClose={ setOpenDatePopupForEnd.bind( null, false ) }>\n <ScheduleEndDateTime />\n </Popover>\n )}\n\n { ( rules.dateTime.end && typeof rules.dateTime.end === 'string' ) && (\n <Button isLink={true} label=\"Clear date and time\" className=\"content-visibility-clear-date-time\" onClick={() => { clearDateAndTime('end', rules); }}>\n <ClearCurrentDateTimeIcon />\n </Button>\n ) }\n </div>\n\n <p className=\"date-time-help-intro content-visibility-help-text\">{ __( 'Set start and/or end dates for when this block will be ' + attributes.contentVisibility + '. Not selecting either date will mean this block is ' + attributes.contentVisibility + ' at all times.' ) }</p>\n\n </div>\n );\n\n return (\n <ContentVisibilityScheduleControls />\n );\n\n};\n","import { PanelBody, PanelRow } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nimport { ContentVisibilityDateTimeControls } from './content-visibility-date-time-controls';\n\n\nfunction ContentVisibilityDateTimePanelBodyControl( { setAttributes, attributes } ) {\n\n let rules = attributes.contentVisibilityRules;\n\n return (\n <PanelBody\n title={ __( 'Date and Time', 'content-visibility-date-time' ) }\n initialOpen={ false }\n className=\"content-visibility-control-panel block-visibility-date-time-controls\"\n >\n <PanelRow>\n <ContentVisibilityDateTimeControls rules={ rules } setAttributes={ setAttributes } attributes={ attributes } />\n </PanelRow>\n </PanelBody>\n );\n\n}\n\nexport default ContentVisibilityDateTimePanelBodyControl;","import { Fill, Disabled } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addFilter } from '@wordpress/hooks';\n\nimport ContentVisibilityDateTimePanelBodyControl from './content-visibility-date-time-panel-body';\n\nexport function ContentVisibilityDateTimeControl( data ) {\n\n let rulesEnabled = data.attributes.contentVisibilityRules.contentVisibilityRulesEnabled;\n let contentVisibility = data.attributes.hasOwnProperty( 'contentVisibility' );\n\n if ( ! rulesEnabled || ! contentVisibility ) {\n return (\n <Disabled><ContentVisibilityDateTimePanelBodyControl setAttributes={ data.setAttributes } attributes={ data.attributes } /></Disabled>\n );\n }\n\n return (\n <ContentVisibilityDateTimePanelBodyControl setAttributes={ data.setAttributes } attributes={ data.attributes } />\n );\n\n}\n\n/**\n * Render the <ContentVisibilityDateTimeControl> component by adding\n * it to the block-visibility-extra-controls Fill.\n *\n * @return {Object} A Fill component wrapping the ContentVisibilityDateTimeControl component.\n */\nfunction ContentVisibilityDateTimeFill() {\n return (\n <Fill name=\"content-visibility-extra-controls\">\n {\n ( fillProps ) => {\n return (\n <ContentVisibilityDateTimeControl setAttributes={ fillProps.setAttributes } attributes={ fillProps.attributes } />\n )\n }\n }\n </Fill>\n );\n\n}\n\n// Add our component to the Slot provided by BlockVisibilityControls\nregisterPlugin( 'content-visibility-03-date-time-fill', { render: ContentVisibilityDateTimeFill } );\n\n\n// Register our visibility rule with the main plugin\naddFilter( 'contentVisibility.defaultContentVisibilityRules', 'content-visibility-date-time/block-visibility-rules', registerDateTimeContentVisibilityRule );\n\nfunction registerDateTimeContentVisibilityRule( defaultRules ) {\n\n defaultRules.dateTime = {\n start: {},\n end: {}\n };\n\n return defaultRules;\n\n}\n","// extracted by mini-css-extract-plugin","import './editor.scss';\nimport './style.scss';\n\nimport ContentVisibilityDateTimeControl from './controls/content-visibility-date-time';","(function() { module.exports = this[\"wp\"][\"components\"]; }());","(function() { module.exports = this[\"wp\"][\"date\"]; }());","(function() { module.exports = this[\"wp\"][\"element\"]; }());","(function() { module.exports = this[\"wp\"][\"hooks\"]; }());","(function() { module.exports = this[\"wp\"][\"i18n\"]; }());","(function() { module.exports = this[\"wp\"][\"plugins\"]; }());"],"sourceRoot":""}1 {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/@babel/runtime/helpers/arrayLikeToArray.js","webpack:///./node_modules/@babel/runtime/helpers/arrayWithHoles.js","webpack:///./node_modules/@babel/runtime/helpers/defineProperty.js","webpack:///./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","webpack:///./node_modules/@babel/runtime/helpers/nonIterableRest.js","webpack:///./node_modules/@babel/runtime/helpers/slicedToArray.js","webpack:///./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","webpack:///./src/controls/content-visibility-date-time-controls.js","webpack:///./src/controls/content-visibility-date-time-panel-body.js","webpack:///./src/controls/content-visibility-date-time.js","webpack:///./src/editor.scss","webpack:///./src/helpers/has-rules.js","webpack:///./src/index.js","webpack:///external {\"this\":[\"wp\",\"components\"]}","webpack:///external {\"this\":[\"wp\",\"date\"]}","webpack:///external {\"this\":[\"wp\",\"element\"]}","webpack:///external {\"this\":[\"wp\",\"hooks\"]}","webpack:///external {\"this\":[\"wp\",\"i18n\"]}","webpack:///external {\"this\":[\"wp\",\"plugins\"]}"],"names":["ContentVisibilityDateTimeControls","rules","setAttributes","attributes","useState","openDatePopupForStart","setOpenDatePopupForStart","openDatePopupForEnd","setOpenDatePopupForEnd","clearDateAndTime","startOrEnd","contentVisibilityRules","dateTime","ScheduleStartDateTime","start","date","ScheduleEndDateTime","end","ClearCurrentDateTimeIcon","ContentVisibilityScheduleControls","dateI18n","__","bind","contentVisibility","ContentVisibilityDateTimePanelBodyControl","hasRulesClass","hasRules","ContentVisibilityDateTimeControl","data","rulesEnabled","contentVisibilityRulesEnabled","hasOwnProperty","ContentVisibilityDateTimeFill","fillProps","registerPlugin","render","addFilter","registerDateTimeContentVisibilityRule","defaultRules","props","type","Object","keys","length","applyFilters"],"mappings":";;;;;;;;;;;;;;;;QAAA;QACA;QACA;QACA;QACA;;QAEA;QACA;QACA;QACA,QAAQ,oBAAoB;QAC5B;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA,iBAAiB,4BAA4B;QAC7C;QACA;QACA,kBAAkB,2BAA2B;QAC7C;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;;QAEA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;QAEA;QACA;QACA;QACA;QACA,gBAAgB,uBAAuB;QACvC;;;QAGA;QACA;QACA;QACA;;;;;;;;;;;;ACvJA;AACA;;AAEA,wCAAwC,SAAS;AACjD;AACA;;AAEA;AACA;;AAEA,mC;;;;;;;;;;;ACVA;AACA;AACA;;AAEA,iC;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;;AAEA;AACA;;AAEA,iC;;;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6CAA6C,+BAA+B;AAC5E;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA,uC;;;;;;;;;;;AC3BA;AACA;AACA;;AAEA,kC;;;;;;;;;;;ACJA,qBAAqB,mBAAO,CAAC,iFAAkB;;AAE/C,2BAA2B,mBAAO,CAAC,6FAAwB;;AAE3D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5J,EAAgK;AAC5JjB,gBAAQ,GAAG,IAAX;AACH;;AAED;;AAEJ;AACI;AAfR;;AAkBA,SAAOkB,qEAAY,CAAE,8BAAF,EAAkClB,QAAlC,EAA4Ca,KAA5C,EAAmDC,IAAnD,CAAnB;AAEH,C,CAAA;;;AAEcd,uEAAf,E;;;;;;;;;;;;AC7CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;;;;;;;;;;;;ACDA,aAAa,2CAA2C,EAAE,I;;;;;;;;;;;ACA1D,aAAa,qCAAqC,EAAE,I;;;;;;;;;;;ACApD,aAAa,wCAAwC,EAAE,I;;;;;;;;;;;ACAvD,aAAa,sCAAsC,EAAE,I;;;;;;;;;;;ACArD,aAAa,qCAAqC,EAAE,I;;;;;;;;;;;ACApD,aAAa,wCAAwC,EAAE,I","file":"index.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t\"index\": 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([\"./src/index.js\",\"style-index\"]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nmodule.exports = _arrayLikeToArray;","function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nmodule.exports = _arrayWithHoles;","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","function _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nmodule.exports = _iterableToArrayLimit;","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableRest;","var arrayWithHoles = require(\"./arrayWithHoles\");\n\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray\");\n\nvar nonIterableRest = require(\"./nonIterableRest\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;","var arrayLikeToArray = require(\"./arrayLikeToArray\");\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\n\nmodule.exports = _unsupportedIterableToArray;","import { DateTimePicker, Popover, Button, Icon } from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { dateI18n } from '@wordpress/date';\nimport { __ } from '@wordpress/i18n';\n\n\nexport const ContentVisibilityDateTimeControls = ({ rules, setAttributes, attributes }) => {\n\n const [ openDatePopupForStart, setOpenDatePopupForStart ] = useState( false );\n const [ openDatePopupForEnd, setOpenDatePopupForEnd ] = useState( false );\n\n /**\n * Clear the date and time - resets to not having a value.\n *\n * @param {*} startOrEnd Are we resetting the start or end date.\n * @param {*} rules The current ruleset for this block.\n */\n const clearDateAndTime = ( startOrEnd, rules ) => {\n\n setAttributes( {\n contentVisibilityRules: {\n ...rules,\n dateTime: {\n ...rules.dateTime,\n [startOrEnd]: {}\n }\n },\n } );\n\n };\n\n /**\n * DateTimePicker for the Start date/time.\n */\n const ScheduleStartDateTime = () => (\n <DateTimePicker\n currentDate={rules.dateTime.start}\n onChange={(date) => {\n\n setAttributes( {\n contentVisibilityRules: {\n ...rules,\n dateTime: {\n ...rules.dateTime,\n 'start': date\n }\n },\n });\n\n setOpenDatePopupForStart( false );\n\n } }\n is12Hour={false}\n />\n );\n\n /**\n * DateTimePicker for the End date/time.\n */\n const ScheduleEndDateTime = () => (\n <DateTimePicker\n currentDate={rules.dateTime.end}\n onChange={ (date) => {\n setAttributes({\n contentVisibilityRules: {\n ...rules,\n dateTime: {\n ...rules.dateTime,\n 'end': date\n }\n },\n });\n\n setOpenDatePopupForEnd( false );\n\n } }\n is12Hour={false}\n />\n );\n\n const ClearCurrentDateTimeIcon = () => (\n <Icon\n icon={ () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"feather feather-x-circle\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><line x1=\"15\" y1=\"9\" x2=\"9\" y2=\"15\"></line><line x1=\"9\" y1=\"9\" x2=\"15\" y2=\"15\"></line></svg>\n ) }\n />\n );\n\n /**\n * Output the Scheduling controls\n */\n const ContentVisibilityScheduleControls = () => (\n\n <div className=\"content-visibility-schedule-controls\">\n\n <div className=\"components-dropdown\">\n <Button isLink={true} className=\"content-visibility-set-date-time\" icon=\"calendar-alt\" onClick={ () => setOpenDatePopupForStart( ! openDatePopupForStart ) }>\n { ( rules.dateTime.start && typeof rules.dateTime.start === 'string' ) ? dateI18n( 'D M j Y, G:i', rules.dateTime.start ) : __( \"Set Start Date/Time\" ) }\n </Button>\n {openDatePopupForStart && (\n <Popover position=\"middle left\" className=\"content-visibility-picker-popover content-visibility-picker-popover-start\" onClose={setOpenDatePopupForStart.bind( null, false )}>\n <ScheduleStartDateTime />\n </Popover>\n )}\n\n { ( rules.dateTime.start && typeof rules.dateTime.start === 'string' ) && (\n <Button isLink={true} label=\"Clear date and time\" className=\"content-visibility-clear-date-time\" onClick={() => { clearDateAndTime('start', rules); }}>\n <ClearCurrentDateTimeIcon />\n </Button>\n ) }\n \n </div>\n\n <div className=\"components-dropdown\">\n <Button isLink={true} className=\"content-visibility-set-date-time\" icon=\"calendar-alt\" onClick={ () => setOpenDatePopupForEnd( ! openDatePopupForEnd ) }>\n { ( rules.dateTime.end && typeof rules.dateTime.end === 'string' ) ? dateI18n( 'D M j Y, G:i', rules.dateTime.end ) : __( \"Set End Date/Time\" ) }\n </Button>\n {openDatePopupForEnd && (\n <Popover position=\"middle left\" className=\"content-visibility-picker-popover content-visibility-picker-popover-end\" onClose={ setOpenDatePopupForEnd.bind( null, false ) }>\n <ScheduleEndDateTime />\n </Popover>\n )}\n\n { ( rules.dateTime.end && typeof rules.dateTime.end === 'string' ) && (\n <Button isLink={true} label=\"Clear date and time\" className=\"content-visibility-clear-date-time\" onClick={() => { clearDateAndTime('end', rules); }}>\n <ClearCurrentDateTimeIcon />\n </Button>\n ) }\n </div>\n\n <p className=\"date-time-help-intro content-visibility-help-text\">{ __( 'Set start and/or end dates for when this block will be ' + attributes.contentVisibility + '. Not selecting either date will mean this block is ' + attributes.contentVisibility + ' at all times.' ) }</p>\n\n </div>\n );\n\n return (\n <ContentVisibilityScheduleControls />\n );\n\n};\n","import { PanelBody, PanelRow } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nimport { ContentVisibilityDateTimeControls } from './content-visibility-date-time-controls';\n\nimport hasRules from '../helpers/has-rules';\n\n\nfunction ContentVisibilityDateTimePanelBodyControl( { setAttributes, attributes } ) {\n\n let rules = attributes.contentVisibilityRules;\n let hasRulesClass = ( hasRules( attributes, 'dateTime' ) ) ? ' has-active-rules' : '';\n\n return (\n <PanelBody\n title={ __( 'Date and Time', 'content-visibility-date-time' ) }\n initialOpen={ false }\n className={\"content-visibility-control-panel block-visibility-date-time-controls\" + hasRulesClass }\n >\n <PanelRow>\n <ContentVisibilityDateTimeControls rules={ rules } setAttributes={ setAttributes } attributes={ attributes } />\n </PanelRow>\n </PanelBody>\n );\n\n}\n\nexport default ContentVisibilityDateTimePanelBodyControl;","import { Fill, Disabled } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addFilter } from '@wordpress/hooks';\n\nimport ContentVisibilityDateTimePanelBodyControl from './content-visibility-date-time-panel-body';\n\nexport function ContentVisibilityDateTimeControl( data ) {\n\n let rulesEnabled = data.attributes.contentVisibilityRules.contentVisibilityRulesEnabled;\n let contentVisibility = data.attributes.hasOwnProperty( 'contentVisibility' );\n\n if ( ! rulesEnabled || ! contentVisibility ) {\n return (\n <Disabled><ContentVisibilityDateTimePanelBodyControl setAttributes={ data.setAttributes } attributes={ data.attributes } /></Disabled>\n );\n }\n\n return (\n <ContentVisibilityDateTimePanelBodyControl setAttributes={ data.setAttributes } attributes={ data.attributes } />\n );\n\n}\n\n/**\n * Render the <ContentVisibilityDateTimeControl> component by adding\n * it to the block-visibility-extra-controls Fill.\n *\n * @return {Object} A Fill component wrapping the ContentVisibilityDateTimeControl component.\n */\nfunction ContentVisibilityDateTimeFill() {\n return (\n <Fill name=\"content-visibility-extra-controls\">\n {\n ( fillProps ) => {\n return (\n <ContentVisibilityDateTimeControl setAttributes={ fillProps.setAttributes } attributes={ fillProps.attributes } />\n )\n }\n }\n </Fill>\n );\n\n}\n\n// Add our component to the Slot provided by BlockVisibilityControls\nregisterPlugin( 'content-visibility-03-date-time-fill', { render: ContentVisibilityDateTimeFill } );\n\n\n// Register our visibility rule with the main plugin\naddFilter( 'contentVisibility.defaultContentVisibilityRules', 'content-visibility-date-time/block-visibility-rules', registerDateTimeContentVisibilityRule );\n\nfunction registerDateTimeContentVisibilityRule( defaultRules ) {\n\n defaultRules.dateTime = {\n start: {},\n end: {}\n };\n\n return defaultRules;\n\n}\n","// extracted by mini-css-extract-plugin","import { applyFilters } from '@wordpress/hooks';\n\n/**\n * Determine if the passed block props contain rules of the passed type.\n *\n * @param {object} props The currently selected block's props.\n * @param {string} type The type of the rules i.e. userAuthenticated or specialPage (or ones from add-ons).\n *\n * @return {bool} true if the passed props contain non-empty rules of the passed type. False otherwise.\n */\n function hasRules( props, type ) {\n\n if ( ! props.contentVisibilityRules ) {\n return false;\n }\n\n if ( ! props.contentVisibilityRules[type] ) {\n return false;\n }\n\n // Default to false. Passed through a filter later.\n let hasRules = false;\n\n switch ( type ) {\n \n case 'dateTime':\n\n if ( props.contentVisibilityRules[type] && props.contentVisibilityRules[type]['start'] && Object.keys( props.contentVisibilityRules[type]['start'] ).length !== 0 ) {\n hasRules = true;\n }\n\n if ( props.contentVisibilityRules[type] && props.contentVisibilityRules[type]['end'] && Object.keys( props.contentVisibilityRules[type]['end'] ).length !== 0 ) {\n hasRules = true;\n }\n\n break;\n\n default:\n break;\n }\n\n return applyFilters( 'content-visibility-has-rules', hasRules, props, type );\n\n}// end hasRules()\n\nexport default hasRules;","import './editor.scss';\nimport './style.scss';\n\nimport ContentVisibilityDateTimeControl from './controls/content-visibility-date-time';","(function() { module.exports = this[\"wp\"][\"components\"]; }());","(function() { module.exports = this[\"wp\"][\"date\"]; }());","(function() { module.exports = this[\"wp\"][\"element\"]; }());","(function() { module.exports = this[\"wp\"][\"hooks\"]; }());","(function() { module.exports = this[\"wp\"][\"i18n\"]; }());","(function() { module.exports = this[\"wp\"][\"plugins\"]; }());"],"sourceRoot":""} -
content-visibility-date-and-time/trunk/content-visibility-date-and-time.php
r2510973 r2568526 12 12 * Plugin URI: https://richardtape.com/content-visibility/ 13 13 * Description: [Content Visibility Add-On] Schedule showing or hiding specific content blocks. 14 * Version: 0.1. 114 * Version: 0.1.2 15 15 * Author: Richard Tape 16 16 * Author URI: https://richardtape.com -
content-visibility-date-and-time/trunk/readme.txt
r2510973 r2568526 2 2 Contributors: iamfriendly 3 3 Donate link: https://girlswhocode.com/ 4 Tags: block, content, visibility, date, time, contentvisibility4 Tags: contentvisibility, block, content, visibility, date, time 5 5 Requires at least: 5.0 6 Tested up to: 5. 7.07 Stable tag: 0.1. 16 Tested up to: 5.8.0 7 Stable tag: 0.1.2 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 35 35 == Changelog == 36 36 37 = 0.1.2 = 38 * Added indicator to show when Date/Time rules are present for a block to make it easier to see when a block has rules. 39 * WP 5.8.0 compatibility. 40 37 41 = 0.1.1 = 38 42 * Updated tags to make addons more finadable from the core plugin.
Note: See TracChangeset
for help on using the changeset viewer.