Plugin Directory

Changeset 3133477


Ignore:
Timestamp:
08/10/2024 11:51:42 AM (19 months ago)
Author:
tantive
Message:

bagfixed

Location:
tantive-set-background/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • tantive-set-background/trunk/build/index.asset.php

    r3028496 r3133477  
    1 <?php return array('dependencies' => array('wp-i18n'), 'version' => '11eb66be8996b3666ee4');
     1<?php return array('dependencies' => array('wp-compose', 'wp-i18n'), 'version' => '8ff84585b0f5a508fa63');
  • tantive-set-background/trunk/build/index.js

    r3028496 r3133477  
    1 (()=>{"use strict";var e,t={139:()=>{const e=window.wp.i18n,t=wp.compose.createHigherOrderComponent((function(t){return function(n){function a(e){let t=document.querySelector(".tsbMediaUploadBox"),a=document.querySelector(".tsbMediaImageBox");t.classList.add("tsbMediaIdSet"),t.classList.remove("tsbNoMediaIdSet"),a.classList.add("tsbMediaIdSet"),a.classList.remove("tsbNoMediaIdSet"),n.setAttributes({tsbBackgroundMediaId:e.id,tsbBackgroundMediaUrl:e.url})}function o(){n.setAttributes({tsbBackgroundMediaUrl:"",tsbBackgroundMediaId:""})}function s(){let e=document.querySelector(".tsbMediaUploadBox"),t=document.querySelector(".tsbMediaImageBox"),n=document.querySelector(".tsbButtonCancelChanging");e.classList.remove("tsbMediaIdSet"),e.classList.add("tsbNoMediaIdSet"),t.classList.remove("tsbMediaIdSet"),t.classList.add("tsbNoMediaIdSet"),n.classList.remove("tsbButtonCancelCahngingUnabalable"),n.classList.add("tsbButtonCancelCahngingAbalable")}function i(){let e=document.querySelector(".tsbMediaUploadBox"),t=document.querySelector(".tsbMediaImageBox");e.classList.add("tsbMediaIdSet"),e.classList.remove("tsbNoMediaIdSet"),t.classList.add("tsbMediaIdSet"),t.classList.remove("tsbNoMediaIdSet")}function r(e,t){const a={[e]:t};n.setAttributes(a)}function c(){return wp.element.createElement("div",{},wp.element.createElement("div",{className:n.attributes.tsbBackgroundMediaId?"tsbMediaIdSet tsbMediaUploadBox":"tsbNoMediaIdSet tsbMediaUploadBox"},wp.element.createElement(wp.blockEditor.MediaPlaceholder,n.attributes.tsbBackgroundMediaId?{value:n.attributes.tsbBackgroundMediaId,onSelect:a}:{onSelect:a}),wp.element.createElement(wp.components.ButtonGroup,{}),wp.element.createElement(wp.components.Button,{value:(0,e.__)("Cancel changing","tantive-set-background"),isSmall:!0,className:"tsbButtonCancelChanging tsbButtonCancelCahngingUnabalable",onClick:i},(0,e.__)("Cancel changing","tantive-set-background"))),wp.element.createElement("div",{className:n.attributes.tsbBackgroundMediaId?"tsbMediaIdSet tsbMediaImageBox":"tsbNoMediaIdSet tsbMediaImageBox"},wp.element.createElement("div",{},wp.element.createElement("img",{src:n.attributes.tsbBackgroundMediaUrl}),wp.element.createElement(wp.components.ButtonGroup,{},wp.element.createElement(wp.components.Button,{value:(0,e.__)("Change","tantive-set-background"),isSmall:!0,onClick:s},(0,e.__)("Change","tantive-set-background")),wp.element.createElement(wp.components.Button,{value:(0,e.__)("Delete","tantive-set-background"),isSmall:!0,onClick:o},(0,e.__)("Delete","tantive-set-background")))),wp.element.createElement(wp.components.PanelBody,{title:(0,e.__)("repeat","tantive-set-background"),initialOpen:!1},wp.element.createElement(wp.components.ButtonGroup,{},wp.element.createElement(wp.components.Button,{value:(0,e.__)("x-Direction","tantive-set-background"),isSmall:!0,isPressed:"repeat-x"==n.attributes.tsbBackgroundRepeat,onClick:()=>r("tsbBackgroundRepeat","repeat-x")},(0,e.__)("x-Direction","tantive-set-background")),wp.element.createElement(wp.components.Button,{value:(0,e.__)("y-Direction","tantive-set-background"),isSmall:!0,isPressed:"repeat-y"==n.attributes.tsbBackgroundRepeat,onClick:()=>r("tsbBackgroundRepeat","repeat-y")},(0,e.__)("y-Direction","tantive-set-background")),wp.element.createElement(wp.components.Button,{value:(0,e.__)("repeat","tantive-set-background"),isSmall:!0,isPressed:"repeat"==n.attributes.tsbBackgroundRepeat,onClick:()=>r("tsbBackgroundRepeat","repeat")},(0,e.__)("repeat","tantive-set-background")),wp.element.createElement(wp.components.Button,{value:(0,e.__)("no repeat","tantive-set-background"),isSmall:!0,isPressed:"no-repeat"==n.attributes.tsbBackgroundRepeat,onClick:()=>r("tsbBackgroundRepeat","no-repeat")},(0,e.__)("no repeat","tantive-set-background")),wp.element.createElement(wp.components.Button,{value:(0,e.__)("reset repeat","tantive-set-background"),isSmall:!0,onClick:()=>r("tsbBackgroundRepeat","")},(0,e.__)("reset","tantive-set-background")))),wp.element.createElement(wp.components.PanelBody,{title:(0,e.__)("attachment","tantive-set-background"),initialOpen:!1},wp.element.createElement(wp.components.ButtonGroup,{},wp.element.createElement(wp.components.Button,{value:(0,e.__)("scroll","tantive-set-background"),isSmall:!0,isPressed:"scroll"==n.attributes.tsbBackgroundAttachment,onClick:()=>r("tsbBackgroundAttachment","scroll")},(0,e.__)("scroll","tantive-set-background")),wp.element.createElement(wp.components.Button,{value:(0,e.__)("fixed","tantive-set-background"),isSmall:!0,isPressed:"fixed"==n.attributes.tsbBackgroundAttachment,onClick:()=>r("tsbBackgroundAttachment","fixed")},(0,e.__)("fixed","tantive-set-background")),wp.element.createElement(wp.components.Button,{value:(0,e.__)("local","tantive-set-background"),isSmall:!0,isPressed:"local"==n.attributes.tsbBackgroundAttachment,onClick:()=>r("tsbBackgroundAttachment","local")},(0,e.__)("local","tantive-set-background")),wp.element.createElement(wp.components.Button,{value:(0,e.__)("reset","tantive-set-background"),isSmall:!0,onClick:()=>r("tsbBackgroundAttachment","")},(0,e.__)("reset","tantive-set-background")))),wp.element.createElement(wp.components.PanelBody,{title:(0,e.__)("position-x","tantive-set-background"),initialOpen:!1},wp.element.createElement(wp.components.ButtonGroup,{},wp.element.createElement(wp.components.Button,{value:(0,e.__)("positionXCenter","tantive-set-background"),isSmall:!0,isPressed:"center"==n.attributes.tsbBackgroundPositionX,onClick:()=>r("tsbBackgroundPositionX","center")},(0,e.__)("center","tantive-set-background")),wp.element.createElement(wp.components.Button,{value:(0,e.__)("positionXLeft","tantive-set-background"),isSmall:!0,isPressed:"left"==n.attributes.tsbBackgroundPositionX,onClick:()=>r("tsbBackgroundPositionX","left")},(0,e.__)("left","tantive-set-background")),wp.element.createElement(wp.components.Button,{value:(0,e.__)("positionXRight","tantive-set-background"),isSmall:!0,isPressed:"right"==n.attributes.tsbBackgroundPositionX,onClick:()=>r("tsbBackgroundPositionX","right")},(0,e.__)("right","tantive-set-background")),wp.element.createElement(wp.components.Button,{value:(0,e.__)("reset","tantive-set-background"),isSmall:!0,onClick:()=>r("tsbBackgroundPositionX","")},(0,e.__)("reset","tantive-set-background")))),wp.element.createElement(wp.components.PanelBody,{title:(0,e.__)("position-y","tantive-set-background"),initialOpen:!1},wp.element.createElement(wp.components.ButtonGroup,{},wp.element.createElement(wp.components.Button,{value:(0,e.__)("positionYCenter","tantive-set-background"),isSmall:!0,isPressed:"center"==n.attributes.tsbBackgroundPositionY,onClick:()=>r("tsbBackgroundPositionY","center")},(0,e.__)("center","tantive-set-background")),wp.element.createElement(wp.components.Button,{value:(0,e.__)("positionYTop","tantive-set-background"),isSmall:!0,isPressed:"top"==n.attributes.tsbBackgroundPositionY,onClick:()=>r("tsbBackgroundPositionY","top")},(0,e.__)("top","tantive-set-background")),wp.element.createElement(wp.components.Button,{value:(0,e.__)("positionYbottom","tantive-set-background"),isSmall:!0,isPressed:"bottom"==n.attributes.tsbBackgroundPositionY,onClick:()=>r("tsbBackgroundPositionY","bottom")},(0,e.__)("bottom","tantive-set-background")),wp.element.createElement(wp.components.Button,{value:(0,e.__)("reset","tantive-set-background"),isSmall:!0,onClick:()=>r("tsbBackgroundPositionY","")},(0,e.__)("reset","tantive-set-background")))),wp.element.createElement(wp.components.PanelBody,{title:(0,e.__)("backgroundSize","tantive-set-background"),initialOpen:!1},wp.element.createElement(wp.components.ButtonGroup,{},wp.element.createElement(wp.components.Button,{value:(0,e.__)("auto","tantive-set-background"),isSmall:!0,isPressed:"auto"==n.attributes.tsbBackgroundSize,onClick:()=>r("tsbBackgroundSize","auto")},(0,e.__)("auto","tantive-set-background")),wp.element.createElement(wp.components.Button,{value:(0,e.__)("cover","tantive-set-background"),isSmall:!0,isPressed:"cover"==n.attributes.tsbBackgroundSize,onClick:()=>r("tsbBackgroundSize","cover")},(0,e.__)("cover","tantive-set-background")),wp.element.createElement(wp.components.Button,{value:(0,e.__)("contain","tantive-set-background"),isSmall:!0,isPressed:"contain"==n.attributes.tsbBackgroundSize,onClick:()=>r("tsbBackgroundSize","contain")},(0,e.__)("contain","tantive-set-background")),wp.element.createElement(wp.components.Button,{value:(0,e.__)("reset","tantive-set-background"),isSmall:!0,onClick:()=>r("tsbBackgroundSize","")},(0,e.__)("reset","tantive-set-background"))))))}const l=wp.element.createElement(wp.components.PanelBody,{title:(0,e.__)("Setting background","tantive-set-background"),initialOpen:!1},wp.element.createElement(wp.blockEditor.MediaUpload,{type:"image",value:n.attributes.tsbBackgroundMediaId,render:({open:e})=>c()}));return wp.element.createElement(wp.element.Fragment,{},wp.element.createElement(t,n),wp.element.createElement(wp.blockEditor.InspectorControls,{initialOpen:!1},l))}}),"setBackgroundControls");wp.hooks.addFilter("editor.BlockEdit","tantive-set-background/add-background",t),wp.hooks.addFilter("blocks.registerBlockType","tantive-set-background/add-background",(function(e,t){return e.attributes={...e.attributes,tsbBackgroundMediaUrl:{type:"string",default:""},tsbBackgroundMediaId:{type:"number",default:null},tsbBackgroundRepeat:{type:"string",default:""},tsbBackgroundAttachment:{type:"string",default:""},tsbBackgroundPositionX:{type:"string",default:""},tsbBackgroundPositionY:{type:"string",default:""},tsbBackgroundSize:{type:"string",default:""}},e})),wp.hooks.addFilter("blocks.getSaveContent.extraProps","tantive-set-background/add-background",(function(e,t,n){if(""!=n.tsbBackgroundMediaUrl){let t={"background-image":"url("+n.tsbBackgroundMediaUrl+")"};Object.assign(e,{style:{...e.style,...t}}),""!=n.tsbBackgroundRepeat&&(t={"background-repeat":n.tsbBackgroundRepeat},Object.assign(e,{style:{...e.style,...t}})),""!=n.tsbBackgroundAttachment&&(t={"background-attachment":n.tsbBackgroundAttachment},Object.assign(e,{style:{...e.style,...t}})),""!=n.tsbBackgroundPositionX&&(t={"background-position-x":n.tsbBackgroundPositionX},Object.assign(e,{style:{...e.style,...t}})),""!=n.tsbBackgroundPositionY&&(t={"background-position-y":n.tsbBackgroundPositionY},Object.assign(e,{style:{...e.style,...t}})),""!=n.tsbBackgroundSize&&(t={"background-size":n.tsbBackgroundSize},Object.assign(e,{style:{...e.style,...t}}))}return e}))}},n={};function a(e){var o=n[e];if(void 0!==o)return o.exports;var s=n[e]={exports:{}};return t[e](s,s.exports,a),s.exports}a.m=t,e=[],a.O=(t,n,o,s)=>{if(!n){var i=1/0;for(d=0;d<e.length;d++){for(var[n,o,s]=e[d],r=!0,c=0;c<n.length;c++)(!1&s||i>=s)&&Object.keys(a.O).every((e=>a.O[e](n[c])))?n.splice(c--,1):(r=!1,s<i&&(i=s));if(r){e.splice(d--,1);var l=o();void 0!==l&&(t=l)}}return t}s=s||0;for(var d=e.length;d>0&&e[d-1][2]>s;d--)e[d]=e[d-1];e[d]=[n,o,s]},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={826:0,431:0};a.O.j=t=>0===e[t];var t=(t,n)=>{var o,s,[i,r,c]=n,l=0;if(i.some((t=>0!==e[t]))){for(o in r)a.o(r,o)&&(a.m[o]=r[o]);if(c)var d=c(a)}for(t&&t(n);l<i.length;l++)s=i[l],a.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return a.O(d)},n=globalThis.webpackChunktantive_set_background=globalThis.webpackChunktantive_set_background||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var o=a.O(void 0,[431],(()=>a(139)));o=a.O(o)})();
     1/******/ (() => { // webpackBootstrap
     2/******/    "use strict";
     3/******/    var __webpack_modules__ = ({
     4
     5/***/ "./src/index.js":
     6/*!**********************!*\
     7  !*** ./src/index.js ***!
     8  \**********************/
     9/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
     10
     11__webpack_require__.r(__webpack_exports__);
     12/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./style.scss */ "./src/style.scss");
     13/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
     14/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
     15/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
     16/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__);
     17/**
     18 * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.
     19 * All files containing `style` keyword are bundled together. The code used
     20 * gets applied both to the front of your site and to the editor.
     21 *
     22 * @see https://www.npmjs.com/package/@wordpress/scripts#using-css
     23 */
     24
     25
     26
     27
     28/**
     29 * Internal dependencies
     30 */
     31
     32/**
     33 * Every block starts by registering a new block type definition.
     34 *
     35 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/
     36 */
     37
     38const setBackgroundControls = wp.compose.createHigherOrderComponent(function (BlockEdit) {
     39  return function (props) {
     40    function onSelectMedia(image) {
     41      let targetMediaUploadBox = document.querySelector('.tsbMediaUploadBox');
     42      let targetMediaImageBox = document.querySelector('.tsbMediaImageBox');
     43      targetMediaUploadBox.classList.add('tsbMediaIdSet');
     44      targetMediaUploadBox.classList.remove('tsbNoMediaIdSet');
     45      targetMediaImageBox.classList.add('tsbMediaIdSet');
     46      targetMediaImageBox.classList.remove('tsbNoMediaIdSet');
     47      props.setAttributes({
     48        tsbBackgroundMediaId: image.id,
     49        tsbBackgroundMediaUrl: image.url
     50      });
     51    }
     52    function deleteSelect() {
     53      props.setAttributes({
     54        tsbBackgroundMediaUrl: '',
     55        tsbBackgroundMediaId: ''
     56      });
     57    }
     58    function onChangeMedia() {
     59      let targetMediaUploadBox = document.querySelector('.tsbMediaUploadBox');
     60      let targetMediaImageBox = document.querySelector('.tsbMediaImageBox');
     61      let targetCancelButton = document.querySelector('.tsbButtonCancelChanging');
     62      targetMediaUploadBox.classList.remove('tsbMediaIdSet');
     63      targetMediaUploadBox.classList.add('tsbNoMediaIdSet');
     64      targetMediaImageBox.classList.remove('tsbMediaIdSet');
     65      targetMediaImageBox.classList.add('tsbNoMediaIdSet');
     66      targetCancelButton.classList.remove('tsbButtonCancelCahngingUnabalable');
     67      targetCancelButton.classList.add('tsbButtonCancelCahngingAbalable');
     68    }
     69    function onCancelChanging() {
     70      let targetMediaUploadBox = document.querySelector('.tsbMediaUploadBox');
     71      let targetMediaImageBox = document.querySelector('.tsbMediaImageBox');
     72      targetMediaUploadBox.classList.add('tsbMediaIdSet');
     73      targetMediaUploadBox.classList.remove('tsbNoMediaIdSet');
     74      targetMediaImageBox.classList.add('tsbMediaIdSet');
     75      targetMediaImageBox.classList.remove('tsbNoMediaIdSet');
     76    }
     77    function mediaPlaceHolderRender() {
     78      return wp.element.createElement('div', {
     79        className: props.attributes.tsbBackgroundMediaId ? 'tsbMediaIdSet tsbMediaUploadBox' : 'tsbNoMediaIdSet tsbMediaUploadBox'
     80      }, wp.element.createElement(wp.blockEditor.MediaPlaceholder, props.attributes.tsbBackgroundMediaId ? {
     81        value: props.attributes.tsbBackgroundMediaId,
     82        onSelect: onSelectMedia
     83      } : {
     84        onSelect: onSelectMedia
     85      }), wp.element.createElement(wp.components.ButtonGroup, {}), wp.element.createElement(wp.components.Button, {
     86        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cancel changing', 'tantive-set-background'),
     87        isSmall: true,
     88        className: 'tsbButtonCancelChanging tsbButtonCancelCahngingUnabalable',
     89        onClick: onCancelChanging
     90      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cancel changing', 'tantive-set-background')));
     91    }
     92    function backgroundAttributeBackgroundImageRender() {
     93      return wp.element.createElement('div', {}, wp.element.createElement('img', {
     94        src: props.attributes.tsbBackgroundMediaUrl
     95      }), wp.element.createElement(wp.components.ButtonGroup, {}, wp.element.createElement(wp.components.Button, {
     96        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Change', 'tantive-set-background'),
     97        isSmall: true,
     98        onClick: onChangeMedia
     99      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Change', 'tantive-set-background')), wp.element.createElement(wp.components.Button, {
     100        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Delete', 'tantive-set-background'),
     101        isSmall: true,
     102        onClick: deleteSelect
     103      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Delete', 'tantive-set-background'))));
     104    }
     105    function onClickBackgroundSetAttr(attr, value) {
     106      const dynamicAttribute = attr;
     107      const dynamicAttributes = {
     108        [attr]: value
     109      };
     110      props.setAttributes(dynamicAttributes);
     111    }
     112    function backgroundAttributeBackgroundRepeat() {
     113      return wp.element.createElement(wp.components.PanelBody, {
     114        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('repeat', 'tantive-set-background'),
     115        initialOpen: false
     116      }, wp.element.createElement(wp.components.ButtonGroup, {}, wp.element.createElement(wp.components.Button, {
     117        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('x-Direction', 'tantive-set-background'),
     118        isSmall: true,
     119        isPressed: props.attributes.tsbBackgroundRepeat == 'repeat-x',
     120        onClick: () => onClickBackgroundSetAttr('tsbBackgroundRepeat', 'repeat-x')
     121      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('x-Direction', 'tantive-set-background')), wp.element.createElement(wp.components.Button, {
     122        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('y-Direction', 'tantive-set-background'),
     123        isSmall: true,
     124        isPressed: props.attributes.tsbBackgroundRepeat == 'repeat-y',
     125        onClick: () => onClickBackgroundSetAttr('tsbBackgroundRepeat', 'repeat-y')
     126      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('y-Direction', 'tantive-set-background')), wp.element.createElement(wp.components.Button, {
     127        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('repeat', 'tantive-set-background'),
     128        isSmall: true,
     129        isPressed: props.attributes.tsbBackgroundRepeat == 'repeat',
     130        onClick: () => onClickBackgroundSetAttr('tsbBackgroundRepeat', 'repeat')
     131      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('repeat', 'tantive-set-background')), wp.element.createElement(wp.components.Button, {
     132        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('no repeat', 'tantive-set-background'),
     133        isSmall: true,
     134        isPressed: props.attributes.tsbBackgroundRepeat == 'no-repeat',
     135        onClick: () => onClickBackgroundSetAttr('tsbBackgroundRepeat', 'no-repeat')
     136      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('no repeat', 'tantive-set-background')), wp.element.createElement(wp.components.Button, {
     137        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('reset repeat', 'tantive-set-background'),
     138        isSmall: true,
     139        onClick: () => onClickBackgroundSetAttr('tsbBackgroundRepeat', '')
     140      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('reset', 'tantive-set-background'))));
     141    }
     142    function backgroundAttributeBackgroundAttachment() {
     143      return wp.element.createElement(wp.components.PanelBody, {
     144        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('attachment', 'tantive-set-background'),
     145        initialOpen: false
     146      }, wp.element.createElement(wp.components.ButtonGroup, {}, wp.element.createElement(wp.components.Button, {
     147        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('scroll', 'tantive-set-background'),
     148        isSmall: true,
     149        isPressed: props.attributes.tsbBackgroundAttachment == 'scroll',
     150        onClick: () => onClickBackgroundSetAttr('tsbBackgroundAttachment', 'scroll')
     151      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('scroll', 'tantive-set-background')), wp.element.createElement(wp.components.Button, {
     152        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('fixed', 'tantive-set-background'),
     153        isSmall: true,
     154        isPressed: props.attributes.tsbBackgroundAttachment == 'fixed',
     155        onClick: () => onClickBackgroundSetAttr('tsbBackgroundAttachment', 'fixed')
     156      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('fixed', 'tantive-set-background')), wp.element.createElement(wp.components.Button, {
     157        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('local', 'tantive-set-background'),
     158        isSmall: true,
     159        isPressed: props.attributes.tsbBackgroundAttachment == 'local',
     160        onClick: () => onClickBackgroundSetAttr('tsbBackgroundAttachment', 'local')
     161      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('local', 'tantive-set-background')), wp.element.createElement(wp.components.Button, {
     162        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('reset', 'tantive-set-background'),
     163        isSmall: true,
     164        onClick: () => onClickBackgroundSetAttr('tsbBackgroundAttachment', '')
     165      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('reset', 'tantive-set-background'))));
     166    }
     167    function backgruondAttributeBackgroundPositionX() {
     168      return wp.element.createElement(wp.components.PanelBody, {
     169        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('position-x', 'tantive-set-background'),
     170        initialOpen: false
     171      }, wp.element.createElement(wp.components.ButtonGroup, {}, wp.element.createElement(wp.components.Button, {
     172        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('positionXCenter', 'tantive-set-background'),
     173        isSmall: true,
     174        isPressed: props.attributes.tsbBackgroundPositionX == 'center',
     175        onClick: () => onClickBackgroundSetAttr('tsbBackgroundPositionX', 'center')
     176      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('center', 'tantive-set-background')), wp.element.createElement(wp.components.Button, {
     177        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('positionXLeft', 'tantive-set-background'),
     178        isSmall: true,
     179        isPressed: props.attributes.tsbBackgroundPositionX == 'left',
     180        onClick: () => onClickBackgroundSetAttr('tsbBackgroundPositionX', 'left')
     181      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('left', 'tantive-set-background')), wp.element.createElement(wp.components.Button, {
     182        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('positionXRight', 'tantive-set-background'),
     183        isSmall: true,
     184        isPressed: props.attributes.tsbBackgroundPositionX == 'right',
     185        onClick: () => onClickBackgroundSetAttr('tsbBackgroundPositionX', 'right')
     186      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('right', 'tantive-set-background')), wp.element.createElement(wp.components.Button, {
     187        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('reset', 'tantive-set-background'),
     188        isSmall: true,
     189        onClick: () => onClickBackgroundSetAttr('tsbBackgroundPositionX', '')
     190      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('reset', 'tantive-set-background'))));
     191    }
     192    function backgroundAttributeBackgroundPositionY() {
     193      return wp.element.createElement(wp.components.PanelBody, {
     194        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('position-y', 'tantive-set-background'),
     195        initialOpen: false
     196      }, wp.element.createElement(wp.components.ButtonGroup, {}, wp.element.createElement(wp.components.Button, {
     197        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('positionYCenter', 'tantive-set-background'),
     198        isSmall: true,
     199        isPressed: props.attributes.tsbBackgroundPositionY == 'center',
     200        onClick: () => onClickBackgroundSetAttr('tsbBackgroundPositionY', 'center')
     201      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('center', 'tantive-set-background')), wp.element.createElement(wp.components.Button, {
     202        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('positionYTop', 'tantive-set-background'),
     203        isSmall: true,
     204        isPressed: props.attributes.tsbBackgroundPositionY == 'top',
     205        onClick: () => onClickBackgroundSetAttr('tsbBackgroundPositionY', 'top')
     206      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('top', 'tantive-set-background')), wp.element.createElement(wp.components.Button, {
     207        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('positionYbottom', 'tantive-set-background'),
     208        isSmall: true,
     209        isPressed: props.attributes.tsbBackgroundPositionY == 'bottom',
     210        onClick: () => onClickBackgroundSetAttr('tsbBackgroundPositionY', 'bottom')
     211      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('bottom', 'tantive-set-background')), wp.element.createElement(wp.components.Button, {
     212        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('reset', 'tantive-set-background'),
     213        isSmall: true,
     214        onClick: () => onClickBackgroundSetAttr('tsbBackgroundPositionY', '')
     215      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('reset', 'tantive-set-background'))));
     216    }
     217    function backgroundAttributeBackgroundSize() {
     218      return wp.element.createElement(wp.components.PanelBody, {
     219        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('backgroundSize', 'tantive-set-background'),
     220        initialOpen: false
     221      }, wp.element.createElement(wp.components.ButtonGroup, {}, wp.element.createElement(wp.components.Button, {
     222        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('auto', 'tantive-set-background'),
     223        isSmall: true,
     224        isPressed: props.attributes.tsbBackgroundSize == 'auto',
     225        onClick: () => onClickBackgroundSetAttr('tsbBackgroundSize', 'auto')
     226      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('auto', 'tantive-set-background')), wp.element.createElement(wp.components.Button, {
     227        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('cover', 'tantive-set-background'),
     228        isSmall: true,
     229        isPressed: props.attributes.tsbBackgroundSize == 'cover',
     230        onClick: () => onClickBackgroundSetAttr('tsbBackgroundSize', 'cover')
     231      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('cover', 'tantive-set-background')), wp.element.createElement(wp.components.Button, {
     232        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('contain', 'tantive-set-background'),
     233        isSmall: true,
     234        isPressed: props.attributes.tsbBackgroundSize == 'contain',
     235        onClick: () => onClickBackgroundSetAttr('tsbBackgroundSize', 'contain')
     236      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('contain', 'tantive-set-background')), wp.element.createElement(wp.components.Button, {
     237        value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('reset', 'tantive-set-background'),
     238        isSmall: true,
     239        onClick: () => onClickBackgroundSetAttr('tsbBackgroundSize', '')
     240      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('reset', 'tantive-set-background'))));
     241    }
     242    function backgroundAttributesRender() {
     243      return wp.element.createElement('div', {
     244        className: props.attributes.tsbBackgroundMediaId ? 'tsbMediaIdSet tsbMediaImageBox' : 'tsbNoMediaIdSet tsbMediaImageBox'
     245      }, backgroundAttributeBackgroundImageRender(), backgroundAttributeBackgroundRepeat(), backgroundAttributeBackgroundAttachment(), backgruondAttributeBackgroundPositionX(), backgroundAttributeBackgroundPositionY(), backgroundAttributeBackgroundSize());
     246    }
     247    function mediaUploadRender() {
     248      return wp.element.createElement('div', {}, mediaPlaceHolderRender(), backgroundAttributesRender());
     249    }
     250    const controlBox = wp.element.createElement(wp.components.PanelBody, {
     251      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Setting background', 'tantive-set-background'),
     252      initialOpen: false
     253    }, wp.element.createElement(wp.blockEditor.MediaUpload, {
     254      type: 'image',
     255      value: props.attributes.tsbBackgroundMediaId,
     256      render: ({
     257        open
     258      }) => {
     259        return mediaUploadRender();
     260      }
     261    }));
     262    return wp.element.createElement(wp.element.Fragment, {}, wp.element.createElement(BlockEdit, props), wp.element.createElement(wp.blockEditor.InspectorControls, {
     263      initialOpen: false
     264    }, controlBox));
     265  };
     266}, 'setBackgroundControls');
     267wp.hooks.addFilter('editor.BlockEdit', 'tantive-set-background/add-background', setBackgroundControls);
     268function addAttribute(settings, name) {
     269  settings.attributes = {
     270    ...settings.attributes,
     271    tsbBackgroundMediaUrl: {
     272      type: 'string',
     273      default: ''
     274    },
     275    tsbBackgroundMediaId: {
     276      type: 'number',
     277      default: null
     278    },
     279    tsbBackgroundRepeat: {
     280      type: 'string',
     281      default: ''
     282    },
     283    tsbBackgroundAttachment: {
     284      type: 'string',
     285      default: ''
     286    },
     287    tsbBackgroundPositionX: {
     288      type: 'string',
     289      default: ''
     290    },
     291    tsbBackgroundPositionY: {
     292      type: 'string',
     293      default: ''
     294    },
     295    tsbBackgroundSize: {
     296      type: 'string',
     297      default: ''
     298    }
     299  };
     300  return settings;
     301}
     302wp.hooks.addFilter('blocks.registerBlockType', 'tantive-set-background/add-background', addAttribute);
     303function addBackgroundStyle(props, blockType, attributes) {
     304  if (attributes.tsbBackgroundMediaUrl != '') {
     305    let extraStyle = {
     306      'background-image': 'url(' + attributes.tsbBackgroundMediaUrl + ')'
     307    };
     308    Object.assign(props, {
     309      style: {
     310        ...props.style,
     311        ...extraStyle
     312      }
     313    });
     314    if (attributes.tsbBackgroundRepeat != '') {
     315      extraStyle = {
     316        'background-repeat': attributes.tsbBackgroundRepeat
     317      };
     318      Object.assign(props, {
     319        style: {
     320          ...props.style,
     321          ...extraStyle
     322        }
     323      });
     324    }
     325    if (attributes.tsbBackgroundAttachment != '') {
     326      extraStyle = {
     327        'background-attachment': attributes.tsbBackgroundAttachment
     328      };
     329      Object.assign(props, {
     330        style: {
     331          ...props.style,
     332          ...extraStyle
     333        }
     334      });
     335    }
     336    if (attributes.tsbBackgroundPositionX != '') {
     337      extraStyle = {
     338        'background-position-x': attributes.tsbBackgroundPositionX
     339      };
     340      Object.assign(props, {
     341        style: {
     342          ...props.style,
     343          ...extraStyle
     344        }
     345      });
     346    }
     347    if (attributes.tsbBackgroundPositionY != '') {
     348      extraStyle = {
     349        'background-position-y': attributes.tsbBackgroundPositionY
     350      };
     351      Object.assign(props, {
     352        style: {
     353          ...props.style,
     354          ...extraStyle
     355        }
     356      });
     357    }
     358    if (attributes.tsbBackgroundSize != '') {
     359      extraStyle = {
     360        'background-size': attributes.tsbBackgroundSize
     361      };
     362      Object.assign(props, {
     363        style: {
     364          ...props.style,
     365          ...extraStyle
     366        }
     367      });
     368    }
     369  }
     370  return props;
     371}
     372wp.hooks.addFilter('blocks.getSaveContent.extraProps', 'tantive-set-background/add-background', addBackgroundStyle);
     373
     374/***/ }),
     375
     376/***/ "./src/style.scss":
     377/*!************************!*\
     378  !*** ./src/style.scss ***!
     379  \************************/
     380/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
     381
     382__webpack_require__.r(__webpack_exports__);
     383// extracted by mini-css-extract-plugin
     384
     385
     386/***/ }),
     387
     388/***/ "@wordpress/compose":
     389/*!*********************************!*\
     390  !*** external ["wp","compose"] ***!
     391  \*********************************/
     392/***/ ((module) => {
     393
     394module.exports = window["wp"]["compose"];
     395
     396/***/ }),
     397
     398/***/ "@wordpress/i18n":
     399/*!******************************!*\
     400  !*** external ["wp","i18n"] ***!
     401  \******************************/
     402/***/ ((module) => {
     403
     404module.exports = window["wp"]["i18n"];
     405
     406/***/ })
     407
     408/******/    });
     409/************************************************************************/
     410/******/    // The module cache
     411/******/    var __webpack_module_cache__ = {};
     412/******/   
     413/******/    // The require function
     414/******/    function __webpack_require__(moduleId) {
     415/******/        // Check if module is in cache
     416/******/        var cachedModule = __webpack_module_cache__[moduleId];
     417/******/        if (cachedModule !== undefined) {
     418/******/            return cachedModule.exports;
     419/******/        }
     420/******/        // Create a new module (and put it into the cache)
     421/******/        var module = __webpack_module_cache__[moduleId] = {
     422/******/            // no module.id needed
     423/******/            // no module.loaded needed
     424/******/            exports: {}
     425/******/        };
     426/******/   
     427/******/        // Execute the module function
     428/******/        __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
     429/******/   
     430/******/        // Return the exports of the module
     431/******/        return module.exports;
     432/******/    }
     433/******/   
     434/******/    // expose the modules object (__webpack_modules__)
     435/******/    __webpack_require__.m = __webpack_modules__;
     436/******/   
     437/************************************************************************/
     438/******/    /* webpack/runtime/chunk loaded */
     439/******/    (() => {
     440/******/        var deferred = [];
     441/******/        __webpack_require__.O = (result, chunkIds, fn, priority) => {
     442/******/            if(chunkIds) {
     443/******/                priority = priority || 0;
     444/******/                for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
     445/******/                deferred[i] = [chunkIds, fn, priority];
     446/******/                return;
     447/******/            }
     448/******/            var notFulfilled = Infinity;
     449/******/            for (var i = 0; i < deferred.length; i++) {
     450/******/                var chunkIds = deferred[i][0];
     451/******/                var fn = deferred[i][1];
     452/******/                var priority = deferred[i][2];
     453/******/                var fulfilled = true;
     454/******/                for (var j = 0; j < chunkIds.length; j++) {
     455/******/                    if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
     456/******/                        chunkIds.splice(j--, 1);
     457/******/                    } else {
     458/******/                        fulfilled = false;
     459/******/                        if(priority < notFulfilled) notFulfilled = priority;
     460/******/                    }
     461/******/                }
     462/******/                if(fulfilled) {
     463/******/                    deferred.splice(i--, 1)
     464/******/                    var r = fn();
     465/******/                    if (r !== undefined) result = r;
     466/******/                }
     467/******/            }
     468/******/            return result;
     469/******/        };
     470/******/    })();
     471/******/   
     472/******/    /* webpack/runtime/compat get default export */
     473/******/    (() => {
     474/******/        // getDefaultExport function for compatibility with non-harmony modules
     475/******/        __webpack_require__.n = (module) => {
     476/******/            var getter = module && module.__esModule ?
     477/******/                () => (module['default']) :
     478/******/                () => (module);
     479/******/            __webpack_require__.d(getter, { a: getter });
     480/******/            return getter;
     481/******/        };
     482/******/    })();
     483/******/   
     484/******/    /* webpack/runtime/define property getters */
     485/******/    (() => {
     486/******/        // define getter functions for harmony exports
     487/******/        __webpack_require__.d = (exports, definition) => {
     488/******/            for(var key in definition) {
     489/******/                if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
     490/******/                    Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
     491/******/                }
     492/******/            }
     493/******/        };
     494/******/    })();
     495/******/   
     496/******/    /* webpack/runtime/hasOwnProperty shorthand */
     497/******/    (() => {
     498/******/        __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
     499/******/    })();
     500/******/   
     501/******/    /* webpack/runtime/make namespace object */
     502/******/    (() => {
     503/******/        // define __esModule on exports
     504/******/        __webpack_require__.r = (exports) => {
     505/******/            if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
     506/******/                Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
     507/******/            }
     508/******/            Object.defineProperty(exports, '__esModule', { value: true });
     509/******/        };
     510/******/    })();
     511/******/   
     512/******/    /* webpack/runtime/jsonp chunk loading */
     513/******/    (() => {
     514/******/        // no baseURI
     515/******/       
     516/******/        // object to store loaded and loading chunks
     517/******/        // undefined = chunk not loaded, null = chunk preloaded/prefetched
     518/******/        // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
     519/******/        var installedChunks = {
     520/******/            "index": 0,
     521/******/            "./style-index": 0
     522/******/        };
     523/******/       
     524/******/        // no chunk on demand loading
     525/******/       
     526/******/        // no prefetching
     527/******/       
     528/******/        // no preloaded
     529/******/       
     530/******/        // no HMR
     531/******/       
     532/******/        // no HMR manifest
     533/******/       
     534/******/        __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
     535/******/       
     536/******/        // install a JSONP callback for chunk loading
     537/******/        var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
     538/******/            var chunkIds = data[0];
     539/******/            var moreModules = data[1];
     540/******/            var runtime = data[2];
     541/******/            // add "moreModules" to the modules object,
     542/******/            // then flag all "chunkIds" as loaded and fire callback
     543/******/            var moduleId, chunkId, i = 0;
     544/******/            if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
     545/******/                for(moduleId in moreModules) {
     546/******/                    if(__webpack_require__.o(moreModules, moduleId)) {
     547/******/                        __webpack_require__.m[moduleId] = moreModules[moduleId];
     548/******/                    }
     549/******/                }
     550/******/                if(runtime) var result = runtime(__webpack_require__);
     551/******/            }
     552/******/            if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
     553/******/            for(;i < chunkIds.length; i++) {
     554/******/                chunkId = chunkIds[i];
     555/******/                if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
     556/******/                    installedChunks[chunkId][0]();
     557/******/                }
     558/******/                installedChunks[chunkId] = 0;
     559/******/            }
     560/******/            return __webpack_require__.O(result);
     561/******/        }
     562/******/       
     563/******/        var chunkLoadingGlobal = self["webpackChunktantive_set_background"] = self["webpackChunktantive_set_background"] || [];
     564/******/        chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
     565/******/        chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
     566/******/    })();
     567/******/   
     568/************************************************************************/
     569/******/   
     570/******/    // startup
     571/******/    // Load entry module and return exports
     572/******/    // This entry module depends on other loaded chunks and execution need to be delayed
     573/******/    var __webpack_exports__ = __webpack_require__.O(undefined, ["./style-index"], () => (__webpack_require__("./src/index.js")))
     574/******/    __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
     575/******/   
     576/******/ })()
     577;
     578//# sourceMappingURL=index.js.map
  • tantive-set-background/trunk/build/style-index.css

    r3028496 r3133477  
    1 .wp-block-create-block-tantive-set-background{background-color:#21759b;color:#fff;padding:2px}.tsbMediaUploadBox.tsbMediaIdSet{display:none}.tsbMediaImageBox.tsbMediaIdSet,.tsbMediaUploadBox.tsbNoMediaIdSet{display:block}.tsbButtonCancelChanging.tsbButtonCancelCahngingUnabalable,.tsbMediaImageBox.tsbNoMediaIdSet{display:none}.tsbButtonCancelChanging.tsbButtonCancelCahngingAbalable{display:block}
     1/*!***************************************************************************************************************************************************************************************************************************************!*\
     2  !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/style.scss ***!
     3  \***************************************************************************************************************************************************************************************************************************************/
     4/**
     5 * The following styles get applied both on the front of your site
     6 * and in the editor.
     7 *
     8 * Replace them with your own styles or remove the file completely.
     9 */
     10.wp-block-create-block-tantive-set-background {
     11  background-color: #21759b;
     12  color: #fff;
     13  padding: 2px;
     14}
     15
     16.tsbMediaUploadBox.tsbMediaIdSet {
     17  display: none;
     18}
     19
     20.tsbMediaUploadBox.tsbNoMediaIdSet {
     21  display: block;
     22}
     23
     24.tsbMediaImageBox.tsbMediaIdSet {
     25  display: block;
     26}
     27
     28.tsbMediaImageBox.tsbNoMediaIdSet {
     29  display: none;
     30}
     31
     32.tsbButtonCancelChanging.tsbButtonCancelCahngingUnabalable {
     33  display: none;
     34}
     35
     36.tsbButtonCancelChanging.tsbButtonCancelCahngingAbalable {
     37  display: block;
     38}
     39
     40/*# sourceMappingURL=style-index.css.map*/
  • tantive-set-background/trunk/build/view.asset.php

    r3028496 r3133477  
    1 <?php return array('dependencies' => array(), 'version' => '31d6cfe0d16ae931b73c');
     1<?php return array('dependencies' => array(), 'version' => 'ca717795b5fa89e82582');
  • tantive-set-background/trunk/build/view.js

    r3028496 r3133477  
     1/******/ (() => { // webpackBootstrap
     2var __webpack_exports__ = {};
     3/*!*********************!*\
     4  !*** ./src/view.js ***!
     5  \*********************/
     6/**
     7 * Use this file for JavaScript code that you want to run in the front-end
     8 * on posts/pages that contain this block.
     9 *
     10 * When this file is defined as the value of the `viewScript` property
     11 * in `block.json` it will be enqueued on the front end of the site.
     12 *
     13 * Example:
     14 *
     15 * ```js
     16 * {
     17 *   "viewScript": "file:./view.js"
     18 * }
     19 * ```
     20 *
     21 * If you're not making any changes to this file because your project doesn't need any
     22 * JavaScript running in the front-end, then you should delete this file and remove
     23 * the `viewScript` property from `block.json`.
     24 *
     25 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#view-script
     26 */
     27
     28/* eslint-disable no-console */
     29// console.log( 'Hello World! (from create-block-tantive-set-background block)' );
     30/* eslint-enable no-console */
     31/******/ })()
     32;
     33//# sourceMappingURL=view.js.map
  • tantive-set-background/trunk/readme.txt

    r3133425 r3133477  
    3434= 0.1.0 =
    3535* Release
    36 = 0.1.1 =
     36= 0.1.2 =
    3737* tested on wordpress 6.6.1
    3838
  • tantive-set-background/trunk/src/index.js

    r3028498 r3133477  
    99
    1010import { __ } from '@wordpress/i18n';
     11import { createHigherOrderComponent } from '@wordpress/compose';
    1112
    1213/**
  • tantive-set-background/trunk/tantive-set-background.php

    r3133425 r3133477  
    33 * Plugin Name:       Tantive Set Background
    44 * Description:       A plugin to allow background images to be set for all blocks.
    5  * Requires at least: 6.6.1
     5 * Requires at least: 6.1
    66 * Requires PHP:      7.0
    7  * Version:           0.1.1
     7 * Version:           0.1.2
    88 * Author:            The WordPress Contributors
    99 * License:           GPL-2.0-or-later
Note: See TracChangeset for help on using the changeset viewer.