Browse Source

Rename hero unit to page section.

pull/46/head
Ned Zimmerman 8 years ago
parent
commit
a0d5861046
No known key found for this signature in database
GPG Key ID: FF56334A013120CA
  1. 16
      assets/scripts/blocks/page-section/block.js
  2. 0
      assets/styles/blocks/page-section/editor.scss
  3. 6
      dist/mix-manifest.json
  4. 2
      dist/scripts/aldine.js
  5. 2
      dist/scripts/blocks/hero-unit/block.js
  6. 1
      dist/scripts/blocks/page-section/block.js
  7. 0
      dist/styles/blocks/page-section/editor.css
  8. 4
      inc/actions/namespace.php
  9. 36
      webpack.mix.js

16
assets/scripts/blocks/hero-unit/block.js → assets/scripts/blocks/page-section/block.js

@ -2,8 +2,8 @@
( function ( blocks, i18n, element, _ ) {
let el = element.createElement;
wp.blocks.registerBlockType( 'aldine/hero-unit', {
title: i18n.__( 'Hero Unit', 'pressbooks-aldine' ),
wp.blocks.registerBlockType( 'aldine/page-section', {
title: i18n.__( 'Page Section', 'pressbooks-aldine' ),
icon: 'flag',
@ -33,7 +33,7 @@
{ className: props.className },
el( blocks.Editable, {
tagName: 'h2',
className: 'hero__title',
className: 'page-section__title',
inline: false,
placeholder: i18n.__(
'About Pressbooks',
@ -52,7 +52,7 @@
} ),
el( blocks.Editable, {
tagName: 'p',
className: 'hero__content',
className: 'page-section__content',
inline: false,
placeholder: i18n.__(
'Kogi ennui ugh plaid, hella neutra kitsch cloud bread next level twee taiyaki. Live-edge paleo fixie whatever farm-to-table snackwave, meditation fam man braid next level viral. Four loko waistcoat mustache cloud bread activated charcoal food truck pabst roof party ugh kitsch raw denim edison bulb man braid 8-bit try-hard. Activated charcoal put a bird on it tilde meggings farm-to-table coloring book. Before they sold out four dollar toast stumptown actually.',
@ -71,7 +71,7 @@
} ),
el(
'p',
{ classname: 'hero__cta' },
{ classname: 'page-section__cta' },
el( blocks.Editable, {
tagName: 'a',
className: 'call-to-action',
@ -99,17 +99,17 @@
{ className: props.className },
el(
'h2',
{ className: 'hero__title' },
{ className: 'page-section__title' },
attributes.title
),
el(
'p',
{ className: 'hero__content' },
{ className: 'page-section__content' },
attributes.content
),
el(
'p',
{ classname: 'hero__cta' },
{ classname: 'page-section__cta' },
el( 'a', { classname: 'call-to-action' }, attributes.cta )
)
);

0
assets/styles/blocks/hero-unit/editor.scss → assets/styles/blocks/page-section/editor.scss

6
dist/mix-manifest.json vendored

@ -1,8 +1,8 @@
{
"/scripts/aldine.js": "/scripts/aldine.js?id=28a2ebcb9ae510032b59",
"/scripts/aldine.js": "/scripts/aldine.js?id=23474d19014434f02b3f",
"/styles/aldine.css": "/styles/aldine.css?id=00b0c10d93f464c01cc5",
"/styles/editor.css": "/styles/editor.css?id=10e3f4b144847aa8d75e",
"/styles/blocks/hero-unit/editor.css": "/styles/blocks/hero-unit/editor.css?id=d41d8cd98f00b204e980",
"/styles/blocks/page-section/editor.css": "/styles/blocks/page-section/editor.css?id=d41d8cd98f00b204e980",
"/scripts/customizer.js": "/scripts/customizer.js?id=decf119933e3b2d4b210",
"/scripts/blocks/hero-unit/block.js": "/scripts/blocks/hero-unit/block.js?id=68feac0df91f56d02826"
"/scripts/blocks/page-section/block.js": "/scripts/blocks/page-section/block.js?id=28da8f65e0922aad6041"
}

2
dist/scripts/aldine.js vendored

File diff suppressed because one or more lines are too long

2
dist/scripts/blocks/hero-unit/block.js vendored

@ -1 +1 @@
!function(e){var t={};function a(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=t,a.d=function(e,t,o){a.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=2)}({2:function(e,t,a){e.exports=a("wSxJ")},wSxJ:function(e,t){var a,o,n,l,c;a=window.wp.blocks,o=window.wp.i18n,n=window.wp.element,l=window._,c=n.createElement,wp.blocks.registerBlockType("aldine/hero-unit",{title:o.__("Hero Unit","pressbooks-aldine"),icon:"flag",category:"layout",attributes:{title:{type:"array",source:"children",selector:"h2"},content:{type:"array",source:"children",selector:"p"}},edit:function(e){var t=e.focus?e.focus.editable||"title":null,n=e.attributes;return c("div",{className:e.className},c(a.Editable,{tagName:"h2",className:"hero__title",inline:!1,placeholder:o.__("About Pressbooks","pressbooks-aldine"),value:n.title,onChange:function(t){e.setAttributes({title:t})},focus:"title"===t?focus:null,onFocus:function(t){e.setFocus(l.extend({},t,{editable:"title"}))}}),c(a.Editable,{tagName:"p",className:"hero__content",inline:!1,placeholder:o.__("Kogi ennui ugh plaid, hella neutra kitsch cloud bread next level twee taiyaki. Live-edge paleo fixie whatever farm-to-table snackwave, meditation fam man braid next level viral. Four loko waistcoat mustache cloud bread activated charcoal food truck pabst roof party ugh kitsch raw denim edison bulb man braid 8-bit try-hard. Activated charcoal put a bird on it tilde meggings farm-to-table coloring book. Before they sold out four dollar toast stumptown actually.","pressbooks-gutenberg"),value:n.content,onChange:function(t){e.setAttributes({content:t})},focus:"content"===t?focus:null,onFocus:function(t){e.setFocus(l.extend({},t,{editable:"content"}))}}),c("p",{classname:"hero__cta"},c(a.Editable,{tagName:"a",className:"call-to-action",inline:!1,placeholder:o.__("Learn More","pressbooks-aldine"),value:n.cta,onChange:function(t){e.setAttributes({cta:t})},focus:"cta"===t?focus:null,onFocus:function(t){e.setFocus(l.extend({},t,{editable:"cta"}))}})))},save:function(e){var t=e.attributes;return c("div",{className:e.className},c("h2",{className:"hero__title"},t.title),c("p",{className:"hero__content"},t.content),c("p",{classname:"hero__cta"},c("a",{classname:"call-to-action"},t.cta)))}})}});
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}({2:function(e,t,r){!function(){throw new Error('Cannot find module "/Users/ned/Projects/pressbooks/development/pressbooks.test/site/web/app/themes/pressbooks-aldine/assets/scripts/blocks/hero-unit/block.js"')}()}});

1
dist/scripts/blocks/page-section/block.js vendored

@ -0,0 +1 @@
!function(e){var t={};function a(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=t,a.d=function(e,t,o){a.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=2)}({2:function(e,t,a){e.exports=a("plbo")},plbo:function(e,t){var a,o,n,c,l;a=window.wp.blocks,o=window.wp.i18n,n=window.wp.element,c=window._,l=n.createElement,wp.blocks.registerBlockType("aldine/page-section",{title:o.__("Page Section","pressbooks-aldine"),icon:"flag",category:"layout",attributes:{title:{type:"array",source:"children",selector:"h2"},content:{type:"array",source:"children",selector:"p"}},edit:function(e){var t=e.focus?e.focus.editable||"title":null,n=e.attributes;return l("div",{className:e.className},l(a.Editable,{tagName:"h2",className:"page-section__title",inline:!1,placeholder:o.__("About Pressbooks","pressbooks-aldine"),value:n.title,onChange:function(t){e.setAttributes({title:t})},focus:"title"===t?focus:null,onFocus:function(t){e.setFocus(c.extend({},t,{editable:"title"}))}}),l(a.Editable,{tagName:"p",className:"page-section__content",inline:!1,placeholder:o.__("Kogi ennui ugh plaid, hella neutra kitsch cloud bread next level twee taiyaki. Live-edge paleo fixie whatever farm-to-table snackwave, meditation fam man braid next level viral. Four loko waistcoat mustache cloud bread activated charcoal food truck pabst roof party ugh kitsch raw denim edison bulb man braid 8-bit try-hard. Activated charcoal put a bird on it tilde meggings farm-to-table coloring book. Before they sold out four dollar toast stumptown actually.","pressbooks-gutenberg"),value:n.content,onChange:function(t){e.setAttributes({content:t})},focus:"content"===t?focus:null,onFocus:function(t){e.setFocus(c.extend({},t,{editable:"content"}))}}),l("p",{classname:"page-section__cta"},l(a.Editable,{tagName:"a",className:"call-to-action",inline:!1,placeholder:o.__("Learn More","pressbooks-aldine"),value:n.cta,onChange:function(t){e.setAttributes({cta:t})},focus:"cta"===t?focus:null,onFocus:function(t){e.setFocus(c.extend({},t,{editable:"cta"}))}})))},save:function(e){var t=e.attributes;return l("div",{className:e.className},l("h2",{className:"page-section__title"},t.title),l("p",{className:"page-section__content"},t.content),l("p",{classname:"page-section__cta"},l("a",{classname:"call-to-action"},t.cta)))}})}});

0
dist/styles/blocks/page-section/editor.css vendored

4
inc/actions/namespace.php

@ -210,12 +210,12 @@ function enqueue_block_editor_assets() {
$assets = new Assets( 'pressbooks-aldine', 'theme' );
$assets->setSrcDirectory( 'assets' )->setDistDirectory( 'dist' );
wp_enqueue_script( 'aldine/hero-unit-block', $assets->getPath( 'scripts/blocks/hero-unit/block.js' ), [
wp_enqueue_script( 'aldine/page-section-block', $assets->getPath( 'scripts/blocks/page-section/block.js' ), [
'wp-blocks',
'wp-i18n',
'wp-element',
], null );
wp_enqueue_style( 'aldine/hero-unit-block', $assets->getPath( 'scripts/blocks/hero-unit/block.css' ), [
wp_enqueue_style( 'aldine/page-section-block', $assets->getPath( 'scripts/blocks/page-section/block.css' ), [
'wp-blocks',
], null );
}

36
webpack.mix.js

@ -1,4 +1,4 @@
let mix = require('laravel-mix');
let mix = require( 'laravel-mix' );
/*
|--------------------------------------------------------------------------
@ -16,14 +16,14 @@ const partials = 'partials';
const assets = 'assets';
const dist = 'dist';
mix.setPublicPath(dist);
mix.setResourceRoot('../');
mix.setPublicPath( dist );
mix.setResourceRoot( '../' );
// BrowserSync
mix.browserSync({
host: 'localhost',
mix.browserSync( {
host: 'localhost',
proxy: 'https://pressbooks.test',
port: 3100,
port: 3100,
files: [
'*.php',
`${inc}/**/*.php`,
@ -31,14 +31,14 @@ mix.browserSync({
`${dist}/**/*.css`,
`${dist}/**/*.js`,
],
});
} );
// Sass
mix.sass( `${assets}/styles/aldine.scss`, `${dist}/styles/aldine.css` );
mix.sass( `${assets}/styles/editor.scss`, `${dist}/styles/editor.css` );
mix.sass(
`${assets}/styles/blocks/hero-unit/editor.scss`,
`${dist}/styles/blocks/hero-unit/editor.css`
`${assets}/styles/blocks/page-section/editor.scss`,
`${dist}/styles/blocks/page-section/editor.css`
);
// Javascript
@ -48,34 +48,34 @@ mix
.js( `${assets}/scripts/aldine.js`, `${dist}/scripts` )
.js( `${assets}/scripts/customizer.js`, `${dist}/scripts` )
.js(
`${assets}/scripts/blocks/hero-unit/block.js`,
`${dist}/scripts/blocks/hero-unit`
`${assets}/scripts/blocks/page-section/block.js`,
`${dist}/scripts/blocks/page-section`
);
// Assets
mix
.copy(`${assets}/fonts`, `${dist}/fonts`, false)
.copy(`${assets}/images`, `${dist}/images`, false);
.copy( `${assets}/fonts`, `${dist}/fonts`, false )
.copy( `${assets}/images`, `${dist}/images`, false );
// Options
mix.options({ processCssUrls: false });
mix.options( { processCssUrls: false } );
// Source maps when not in production.
if (!mix.inProduction()) {
if ( ! mix.inProduction() ) {
mix.sourceMaps();
}
// Hash and version files in production.
if (mix.inProduction()) {
if ( mix.inProduction() ) {
mix.version();
}
// Add Isotope support.
mix.webpackConfig({
mix.webpackConfig( {
resolve: {
alias: {
masonry: 'masonry-layout',
isotope: 'isotope-layout',
},
},
});
} );

Loading…
Cancel
Save