/
home
/
faureele
/
extra-til
/
wp-content
/
plugins
/
shortcode-for-current-date
/
dist
/
Upload File
HOME
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external [\"wp\",\"i18n\"]","webpack:///external [\"wp\",\"date\"]","webpack:///external [\"wp\",\"blocks\"]","webpack:///external [\"wp\",\"element\"]","webpack:///external [\"wp\",\"components\"]","webpack:///external [\"wp\",\"editor\"]","webpack:///./src/block/edit.js","webpack:///./src/block/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","wp","CurrentDateEdit","attributes","setAttributes","content","isSelected","useState","currentFormat","setCurrentFormat","format","title","__","label","onChange","newFormat","href","rel","target","registerBlockType","description","category","icon","type","source","selector","transforms","from","prefix","transform","createBlock","to","blocks","edit","save"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBs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,yBAAC,oBAAD,KACC,yBAAC,YAAD,CAAWG,MAAOC,aAAG,kBAAmB,+BACvC,yBAAC,cAAD,CACCC,MAAOD,aAAG,cAAe,8BACzB1B,MAAOsB,EACPM,SAdyB,SAAAC,GAC7BN,EAAiBM,GACjBX,EAAc,CAAEC,QAASK,iBAAOK,QAc7B,8CACW,IACV,8BACCC,KAAK,8EACLC,IAAI,sBACJC,OAAO,UAHR,gBAMK,IARN,kBAaF,qCAAOb,KCrCVc,4BAAkB,mCAAoC,CACpDR,MAAOC,aAAG,eAAgB,8BAC1BQ,YAAaR,aAAG,wBAAyB,8BACzCS,SAAU,SACVC,KAAM,eACNnB,WAAY,CACVE,QAAS,CACPkB,KAAM,SACNC,OAAQ,OACRC,SAAU,SAGdC,WAAY,CACVC,KAAM,CAAC,CACHJ,KAAM,SACNK,OAAQ,iBACRC,UAAW,WACT,OAAOC,sBAAY,uCAIzBC,GAAI,CACF,CACER,KAAM,QACNS,OAAQ,CAAC,kBACTH,UAAW,YAAe,IAAbxB,EAAa,EAAbA,QACX,OAAOyB,sBAAY,iBAAkB,CACnCzB,QAASA,QAMnB4B,OACAC,KAAM,YAAkB,IACd7B,EADc,EAAhBF,WACEE,QACR,OAAO,qCAAOA","file":"editor.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\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\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 8);\n","module.exports = wp[\"i18n\"];","module.exports = wp[\"date\"];","module.exports = wp[\"blocks\"];","module.exports = wp[\"element\"];","module.exports = wp[\"components\"];","module.exports = wp[\"editor\"];","import { useState, useEffect } from \"@wordpress/element\";\nimport { InspectorControls } from \"@wordpress/editor\";\nimport { __ } from \"@wordpress/i18n\";\nimport { format } from \"@wordpress/date\";\nimport { TextControl, PanelBody } from \"@wordpress/components\";\n\nconst CurrentDateEdit = ({ attributes, setAttributes, isSelected }) => {\n\tconst { content } = attributes;\n\t/* React Hooks */\n\tconst [selected, setSelected] = useState(false);\n\tconst [currentFormat, setCurrentFormat] = useState(\"jS F Y\");\n\n\t/* Methods */\n\tconst onChangeCurrentFormat = newFormat => {\n\t\tsetCurrentFormat(newFormat);\n\t\tsetAttributes({ content: format(newFormat) });\n\t};\n\n\t/* Setting content */\n\tsetAttributes({ content: format(currentFormat) });\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={__('Format Settings', 'shortcode-for-current-date')}>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tlabel={__(\"Date format\", \"shortcode-for-current-date\")}\n\t\t\t\t\t\tvalue={currentFormat}\n\t\t\t\t\t\tonChange={onChangeCurrentFormat}\n\t\t\t\t\t/>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tCheck the{\" \"}\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\thref=\"https://www.php.net/manual/en/datetime.formats.date.php\"\n\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tdate formats\n\t\t\t\t\t\t</a>{\" \"}\n\t\t\t\t\t\tyou can use.\n\t\t\t\t\t</p>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<span>{content}</span>\n\t\t</>\n\t);\n};\n\nexport default CurrentDateEdit;\n","import { registerBlockType, createBlock } from \"@wordpress/blocks\";\nimport { __ } from \"@wordpress/i18n\";\nimport { format } from \"@wordpress/date\";\nimport edit from \"./edit\";\n\nregisterBlockType('shortcode-for-current-date/block', {\n title: __('Current Date', 'shortcode-for-current-date'),\n description: __('Displays current date', 'shortcode-for-current-date'),\n category: 'common',\n icon: 'calendar-alt',\n attributes: {\n content: {\n type: 'string',\n source: 'html',\n selector: 'span',\n }\n },\n transforms: {\n from: [{\n type: 'prefix',\n prefix: '[current_date]',\n transform: () => {\n return createBlock('shortcode-for-current-date/block')\n }\n }\n ],\n to: [\n {\n type: 'block',\n blocks: ['core/paragraph'],\n transform: ({content}) => {\n return createBlock('core/paragraph', {\n content: content\n })\n }\n }\n ]\n },\n edit,\n save: ({attributes}) => {\n const { content } = attributes;\n return <span>{content}</span>\n }\n\n});\n"],"sourceRoot":""}