| Current Path : /home/x/b/o/xbodynamge/namtation/wp-content/ |
| Current File : /home/x/b/o/xbodynamge/namtation/wp-content/index.js.tar |
plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/src/blocks/structural/pricing/index.js 0000644 00000005017 15111630506 0037202 0 ustar 00 home/xbodynamge/namtation/wp-content /**
* WordPress dependencies
*/
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
const { InnerBlocks } = wp.editor;
/**
* Internal dependencies
*/
import { pricingIcon } from '../../../helpers/icons.js';
registerBlockType( 'themeisle-blocks/pricing', {
title: __( 'Pricing' ),
description: __( 'Pricing tables are a critical part in showcasing your services, prices and overall offerings.' ),
icon: pricingIcon,
category: 'themeisle-blocks',
keywords: [
'pricing',
'table',
'money'
],
edit: props => {
const TEMPLATE = [
[ 'themeisle-blocks/advanced-heading', {
content: __( 'Basic' ),
align: 'center',
tag: 'h5'
} ],
[ 'themeisle-blocks/advanced-heading', {
content: __( '$9.99' ),
align: 'center',
tag: 'h3',
fontSize: 36,
fontFamily: 'Roboto Slab',
fontVariant: 'normal'
} ],
[ 'themeisle-blocks/advanced-heading', {
content: __( 'Per Month' ),
align: 'center',
tag: 'p',
fontSize: 12,
marginBottom: 0
} ],
[ 'core/separator', {} ],
[ 'themeisle-blocks/advanced-heading', {
content: __( 'First Feature' ),
align: 'center',
tag: 'p',
fontSize: 12,
marginBottom: 0
} ],
[ 'core/separator', {} ],
[ 'themeisle-blocks/advanced-heading', {
content: __( 'Second Feature' ),
align: 'center',
tag: 'p',
fontSize: 12,
marginBottom: 0
} ],
[ 'core/separator', {} ],
[ 'themeisle-blocks/advanced-heading', {
content: __( 'Last Feature' ),
align: 'center',
tag: 'p',
fontSize: 12,
marginBottom: 0
} ],
[ 'core/separator', {} ],
[ 'themeisle-blocks/button-group', {
align: 'center',
buttons: 1,
data: [ {
text: __( 'Buy Now' ),
newTab: false,
color: '#ffffff',
background: '#32373c',
hoverColor: '#ffffff',
hoverBackground: '#444a50',
borderSize: 0,
borderRadius: 3,
boxShadow: false,
boxShadowColorOpacity: 50,
boxShadowBlur: 5,
boxShadowSpread: 1,
boxShadowHorizontal: 0,
boxShadowVertical: 0,
hoverBoxShadowColorOpacity: 50,
hoverBoxShadowBlur: 5,
hoverBoxShadowSpread: 1,
hoverBoxShadowHorizontal: 0,
hoverBoxShadowVertical: 0,
iconType: 'none',
paddingTopBottom: 12,
paddingLeftRight: 24
} ]
} ]
];
return [
<div className={ props.className } >
<InnerBlocks
template={ TEMPLATE }
/>
</div>
];
},
save: props => {
return (
<div className={ props.className } >
<InnerBlocks.Content/>
</div>
);
}
});
wp-content/plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/src/blocks/posts/index.js 0000644 00000002771 15112353076 0034520 0 ustar 00 home/xbodynamge/namtation /**
* WordPress dependencies
*/
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
/**
* Internal dependencies
*/
import './style.scss';
import './editor.scss';
import { postsIcon } from '../../helpers/icons.js';
import Editor from './components/Editor.js';
registerBlockType( 'themeisle-blocks/posts-grid', {
title: __( 'Posts' ),
description: __( 'Display a list of your most recent posts in a beautiful layout.' ),
icon: postsIcon,
category: 'themeisle-blocks',
keywords: [
'posts',
'grid',
'news'
],
attributes: {
style: {
type: 'string',
default: 'grid'
},
columns: {
type: 'number',
default: 3
},
template: {
type: 'array',
default: [
'category',
'title',
'meta',
'description'
]
},
categories: {
type: 'string'
},
postsToShow: {
type: 'number',
default: 5
},
order: {
type: 'string',
default: 'desc'
},
orderBy: {
type: 'string',
default: 'date'
},
imageSize: {
type: 'string',
default: 'full'
},
displayFeaturedImage: {
type: 'boolean',
default: true
},
displayCategory: {
type: 'boolean',
default: true
},
displayTitle: {
type: 'boolean',
default: true
},
displayMeta: {
type: 'boolean',
default: true
},
displayDescription: {
type: 'boolean',
default: true
},
excerptLength: {
type: 'number',
default: 100
}
},
supports: {
align: [ 'wide', 'full' ],
html: false
},
edit: Editor,
save: () => {
return null;
}
});
themeisle-companion/vendor/codeinwp/gutenberg-blocks/src/blocks/deprecated/pricing-table/index.js 0000644 00000000202 15112635251 0040637 0 ustar 00 home/xbodynamge/lebauwcentre/wp-content/plugins /**
* Pricing Table Block
*/
import './style.scss';
import './editor.scss';
import './pricing-table';
import './pricing-block';
plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/src/blocks/google-map/index.js 0000644 00000002550 15112675514 0035376 0 ustar 00 home/xbodynamge/namtation/wp-content /**
* WordPress dependencies
*/
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
/**
* Internal dependencies
*/
import './style.scss';
import './editor.scss';
import { mapIcon } from '../../helpers/icons.js';
import Editor from './components/Editor.js';
registerBlockType( 'themeisle-blocks/google-map', {
title: __( 'Google Map' ),
description: __( 'Display a Google Map on your website with Google Map block.' ),
icon: mapIcon,
category: 'themeisle-blocks',
keywords: [
'map',
'google',
'orbitfox'
],
attributes: {
id: {
type: 'string'
},
location: {
type: 'string',
default: 'La Sagrada Familia, Barcelona, Spain'
},
latitude: {
type: 'string'
},
longitude: {
type: 'string'
},
type: {
type: 'string',
default: 'roadmap'
},
zoom: {
type: 'number',
default: 15
},
height: {
type: 'number',
default: 400
},
draggable: {
type: 'boolean',
default: true
},
mapTypeControl: {
type: 'boolean',
default: true
},
zoomControl: {
type: 'boolean',
default: true
},
fullscreenControl: {
type: 'boolean',
default: true
},
streetViewControl: {
type: 'boolean',
default: true
},
markers: {
type: 'array',
default: []
}
},
supports: {
align: [ 'wide', 'full' ],
html: false
},
edit: Editor,
save: () => {
return null;
}
});
wp-content/plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/notice/index.js 0000604 00000004643 15112760024 0034724 0 ustar 00 home/xbodynamge/crosstraining /**
* WordPress dependencies...
*/
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
const { RichText } = wp.editor;
const { Notice } = wp.components;
/**
* Internal dependencies
*/
import './style.scss';
import './editor.scss';
registerBlockType( 'themeisle-blocks/notice', {
title: __( 'Notice' ),
description: __( 'Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.' ),
icon: 'info',
category: 'themeisle-blocks',
keywords: [
'notice',
'info'
],
attributes: {
content: {
type: 'array',
source: 'children',
selector: 'p.components-notice__content'
}
},
supports: {
align: [ 'wide', 'full' ]
},
styles: [
{ name: 'sucess', label: __( 'Success' ), isDefault: true },
{ name: 'info', label: __( 'Info' ) },
{ name: 'warning', label: __( 'Warning' ) },
{ name: 'error', label: __( 'Error' ) }
],
edit: props => {
let status = 'success';
if ( props.attributes.className && props.attributes.className.includes( 'is-style-info' ) ) {
status = '';
} else if ( props.attributes.className && props.attributes.className.includes( 'is-style-warning' ) ) {
status = 'warning';
} else if ( props.attributes.className && props.attributes.className.includes( 'is-style-error' ) ) {
status = 'error';
}
return (
<Notice
className={ props.className }
isDismissible={ false }
status={ status }
>
<RichText
tagName="p"
placeholder={ __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.' ) }
value={ props.attributes.content }
className="components-notice__content"
onChange={ content => props.setAttributes({ content }) }
keepPlaceholderOnFocus="true"
/>
</Notice>
);
},
save: props => {
let status = 'success';
if ( props.attributes.className && props.attributes.className.includes( 'is-style-info' ) ) {
status = '';
} else if ( props.attributes.className && props.attributes.className.includes( 'is-style-warning' ) ) {
status = 'warning';
} else if ( props.attributes.className && props.attributes.className.includes( 'is-style-error' ) ) {
status = 'error';
}
return (
<Notice
className="themeisle-block-notice"
isDismissible={ false }
status={ status }
>
<RichText.Content
tagName="p"
className="components-notice__content"
value={ props.attributes.content }
/>
</Notice>
);
}
});
plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/sharing-icons/index.js 0000604 00000005223 15112760115 0036203 0 ustar 00 home/xbodynamge/crosstraining/wp-content /**
* WordPress dependencies...
*/
import classnames from 'classnames';
const { __ } = wp.i18n;
const {
registerBlockType
} = wp.blocks;
const {
BlockControls
} = wp.editor;
const {
Toolbar,
Button,
Tooltip
} = wp.components;
/**
* Internal dependencies
*/
import './style.scss';
import './editor.scss';
import socialList from './social_list';
import SocialIcons from './icons';
registerBlockType( 'themeisle-blocks/sharing-icons', {
title: __( 'Sharing Icons' ),
description: __( 'Share buttons for your website visitors to share content on any social sharing service.' ),
icon: 'networking',
category: 'themeisle-blocks',
keywords: [
'social media',
'sharing',
'icons'
],
attributes: {
facebook: {
type: 'boolean',
default: true
},
twitter: {
type: 'boolean',
default: true
},
googleplus: {
type: 'boolean',
default: true
},
linkedin: {
type: 'boolean',
default: true
},
pinterest: {
type: 'boolean',
default: false
},
tumblr: {
type: 'boolean',
default: false
},
reddit: {
type: 'boolean',
default: false
}
},
supports: {
html: true,
align: [ 'left', 'center', 'right' ]
},
styles: [
{ name: 'default', label: __( 'Regular' ), isDefault: true },
{ name: 'icons', label: __( 'Icons Only' ) }
],
edit: props => {
const toggleIcons = ( item ) => {
props.setAttributes({ [ item ]: ! props.attributes[item] });
};
return [
<BlockControls key="toolbar-controls">
<Toolbar
className='components-toolbar'
>
{ Object.keys( socialList ).map( ( item, i ) => {
let prop = props.attributes[item];
return (
<Tooltip text={ __( `Display ${ socialList[item].label }` ) }>
<Button
className={ classnames(
'components-icon-button',
'components-toolbar__control',
{ 'is-active': prop },
) }
onClick={ ( e ) => toggleIcons( item ) }
>
<SocialIcons icon={ item }/>
</Button>
</Tooltip>
);
}) }
</Toolbar>
</BlockControls>,
<div
className={ classnames(
props.className,
{ 'has-label': ( props.attributes.className ? ! props.attributes.className.includes( 'is-style-icons' ) : true ) },
) }
>
{ Object.keys( socialList ).map( ( item, i ) => {
if ( true === props.attributes[item]) {
return (
<a className={ `social-icon is-${item}` }><i class={ `fab fa-${socialList[item].icon}` }></i>{ ( props.attributes.className ? ! props.attributes.className.includes( 'is-style-icons' ) : true ) && socialList[item].label }</a>
);
}
}) }
</div>
];
},
save: () => {
return null;
}
});
dev/wp-content/plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/store/index.js 0000644 00000001434 15113667503 0031223 0 ustar 00 home/xbodynamge const {
data,
apiRequest
} = wp;
const {
registerStore,
dispatch
} = data;
const DEFAULT_STATE = {};
registerStore( 'themeisle-gutenberg/blocks', {
reducer( state = DEFAULT_STATE, action ) {
switch ( action.type ) {
case 'GET_ICONS_LIST':
return {
iconsList: action.data
};
}
return state;
},
actions: {
setFaIconsList( data ) {
return {
type: 'GET_ICONS_LIST',
data: data
};
}
},
selectors: {
getFaIconsList( data ) {
if ( 'undefined' !== typeof data.iconsList ) {
return data.iconsList;
}
}
},
resolvers: {
async getFaIconsList() {
let result = [];
result = await apiRequest({ path: 'themeisle-gutenberg-blocks/v1/get_icons_list' });
dispatch( 'themeisle-gutenberg/blocks' ).setFaIconsList( result );
}
}
});
wp-content/plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/plugin-card/index.js 0000644 00000016073 15114070556 0033553 0 ustar 00 home/xbodynamge/dev /**
* WordPress dependencies...
*/
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
const {
Placeholder,
Dashicon,
TextControl,
Spinner,
Button,
Toolbar,
Tooltip
} = wp.components;
const {
compose,
withState
} = wp.compose;
const { BlockControls } = wp.editor;
const { withSelect } = wp.data;
const { ENTER } = wp.keycodes;
const starRating = stars => {
const rating = Math.floor( stars / 10 ) / 2;
const fullStars = Math.floor( rating );
const halfStars = Math.ceil( rating - fullStars );
const emptyStars = 5 - fullStars - halfStars;
const ratings = '<span class="star-full"></span>'.repeat( fullStars ) + '<span class="star-half"></span>'.repeat( halfStars ) + '<span class="star-empty"></span>'.repeat( emptyStars );
return ratings;
};
const unescapeHTML = value => {
const htmlNode = document.createElement( 'div' );
htmlNode.innerHTML = value;
if ( htmlNode.innerText !== undefined ) {
return htmlNode.innerText;
}
return htmlNode.textContent;
};
/**
* Internal dependencies
*/
import './editor.scss';
import './style.scss';
registerBlockType( 'themeisle-blocks/plugin-cards', {
title: __( 'Plugin Card' ),
description: __( 'Plugin Card block lets you display plugins data in your blog posts.' ),
icon: 'admin-plugins',
category: 'themeisle-blocks',
keywords: [
'plugin',
'card',
'orbitfox'
],
attributes: {
slug: {
type: 'string'
},
pluginIcon: {
type: 'string'
},
pluginName: {
type: 'string'
},
pluginAuthor: {
type: 'string'
},
pluginRating: {
type: 'number'
},
pluginDescription: {
type: 'string'
},
pluginInstalls: {
type: 'number'
},
pluginVersion: {
type: 'string'
},
pluginTested: {
type: 'string'
},
pluginLink: {
type: 'string'
}
},
supports: {
html: false,
align: [ 'left', 'center', 'right' ]
},
edit: compose([
withSelect( ( select, props ) => {
return {
props
};
}),
withState({
status: 0,
results: {}
})
])( ({ props, className, status, results, setState }) => {
const changeSlug = ( value ) => {
props.setAttributes({ slug: value });
};
const searchPlugins = ( search ) => {
setState({ status: 1 });
wp.apiFetch({ path: `themeisle-gutenberg-blocks/v1/get_plugins?search='${ encodeURIComponent( search ) }` }).then( payload => {
const data = payload.data.plugins;
setState({
status: 0,
results: data
});
});
};
const selectPlugin = ( data ) => {
let icon;
if ( data.icons.svg ) {
icon = data.icons.svg;
} if ( data.icons['2x']) {
icon = data.icons['2x'];
} if ( data.icons['1x']) {
icon = data.icons['1x'];
} if ( data.icons.default ) {
icon = data.icons.default;
}
props.setAttributes({
slug: data.slug,
pluginIcon: icon,
pluginName: data.name,
pluginAuthor: data.author,
pluginRating: data.rating,
pluginDescription: data.short_description,
pluginInstalls: data.active_installs,
pluginVersion: data.version,
pluginTested: data.tested,
pluginLink: data.download_link
});
setState({
results: {}
});
};
return [
( props.attributes.pluginName ) && (
<BlockControls key="toolbar-controls">
<Toolbar
className='components-toolbar'
>
<Tooltip text={ __( 'Edit Plugin Card' ) }>
<Button
className="components-icon-button components-toolbar__control edit-plugin-card"
onClick={ () => {
props.setAttributes({
pluginIcon: '',
pluginName: '',
pluginAuthor: '',
pluginRating: '',
pluginDescription: '',
pluginInstalls: '',
pluginVersion: '',
pluginTested: '',
pluginLink: ''
});
} }
>
<Dashicon icon="edit" />
</Button>
</Tooltip>
</Toolbar>
</BlockControls>
),
<div className={ `${ className }` }>
{ ( props.attributes.pluginName ) ?
<div class="themeisle-plugin-card">
<div class="card-header">
<div class="card-main">
<div class="card-logo">
<img src={ props.attributes.pluginIcon } alt={ unescapeHTML( props.attributes.pluginName ) } title={ unescapeHTML( props.attributes.pluginName ) }/>
</div>
<div class="card-info">
<h4>{ unescapeHTML( props.attributes.pluginName ) }</h4>
<h5 dangerouslySetInnerHTML={ { __html: _.unescape( props.attributes.pluginAuthor ) } }></h5>
</div>
<div class={ 'card-ratings' } dangerouslySetInnerHTML={ { __html: _.unescape( starRating( props.attributes.pluginRating ) ) } }></div>
</div>
</div>
<div class="card-details">
<div class="card-description">{ unescapeHTML( props.attributes.pluginDescription ) }</div>
<div class="card-stats">
<h5>{__( 'Plugin Stats' ) }</h5>
<div class="card-stats-list">
<div class="card-stat">
<span class="card-text-large">{ props.attributes.pluginInstalls.toLocaleString() }+</span>
{ __( 'active installs' ) }
</div>
<div class="card-stat">
<span class="card-text-large">{ props.attributes.pluginVersion }</span>
{ __( 'version' ) }
</div>
<div class="card-stat">
<span class="card-text-large">{ props.attributes.pluginTested }</span>
{ __( 'tested up to' ) }
</div>
</div>
</div>
</div>
<div class="card-download">
<a href={ props.attributes.pluginLink }>{ __( 'Download' ) }</a>
</div>
</div> :
<Placeholder
icon="admin-plugins"
label={ __( 'Plugin Card' ) }
>
<div className="search-plugin-field">
<Dashicon icon="search" />
{ 1 === status && (
<Spinner/>
) }
<TextControl
type="text"
placeholder={ __( 'Search for plugin…' ) }
value={ props.attributes.slug }
onChange={ changeSlug }
onKeyDown={ ( event ) => {
if ( event.keyCode === ENTER ) {
searchPlugins( event.target.value );
}
}}
/>
{ results && (
<div className="plugin-card-search-results">
<div>
{ Object.keys( results ).map( ( i, j ) => {
const pluginData = results[i];
let icon;
if ( pluginData.icons.svg ) {
icon = pluginData.icons.svg;
} if ( pluginData.icons['2x']) {
icon = pluginData.icons['2x'];
} if ( pluginData.icons['1x']) {
icon = pluginData.icons['1x'];
} if ( pluginData.icons.default ) {
icon = pluginData.icons.default;
}
return (
<div className="plugin-card-list-item" key={i} onClick={ ( e ) => {
e.preventDefault();
selectPlugin( pluginData );
} }>
<img src={ icon } />
<span dangerouslySetInnerHTML={ { __html: _.unescape( pluginData.name ) } }></span>
</div>
);
}) }
</div>
</div>
) }
</div>
</Placeholder>
}
</div>
];
}),
save: () => {
return null;
}
});
wp-content/plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/google-map/index.js 0000644 00000012736 15114071073 0033372 0 ustar 00 home/xbodynamge/dev /**
* WordPress dependencies...
*/
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
const {
Button,
PanelBody,
Placeholder,
RangeControl,
SelectControl,
Spinner,
TextControl
} = wp.components;
const {
compose,
withState
} = wp.compose;
const { withSelect } = wp.data;
const { InspectorControls } = wp.editor;
/**
* Internal dependencies
*/
import './editor.scss';
registerBlockType( 'themeisle-blocks/google-map', {
title: __( 'Google Map' ),
description: __( 'Display a Google Map on your website with Google Map block.' ),
icon: 'admin-site',
category: 'themeisle-blocks',
keywords: [
'map',
'google',
'orbitfox'
],
attributes: {
location: {
type: 'string'
},
type: {
type: 'string',
default: 'roadmap'
},
zoom: {
type: 'number',
default: 10
},
height: {
type: 'string',
default: '400px'
}
},
supports: {
html: false
},
edit: compose([
withSelect( ( select, props ) => {
return {
props
};
}),
withState({
api: '',
isAPILoaded: false,
isAPISaved: false,
isSaving: false
})
])( ({ props, className, api, isAPILoaded, isAPISaved, isSaving, setState }) => {
let settings;
wp.api.loadPromise.then( () => {
settings = new wp.api.models.Settings();
});
if ( false === isAPILoaded ) {
settings.fetch().then( response => {
setState({
api: response.themeisle_google_map_block_api_key,
isAPILoaded: true
});
if ( '' !== response.themeisle_google_map_block_api_key ) {
setState({
isAPISaved: true
});
}
});
}
const changeAPI = ( value ) => {
setState({
api: value
});
};
const saveAPIKey = () => {
setState({
isSaving: true
});
const model = new wp.api.models.Settings({
// eslint-disable-next-line camelcase
themeisle_google_map_block_api_key: api
});
model.save().then( response => {
settings.fetch();
setState({
isSaving: false,
isAPISaved: true
});
});
};
const changeLocation = ( value ) => {
props.setAttributes({ location: value });
};
const changeMapType = ( value ) => {
props.setAttributes({ type: value });
};
const changeZoom = ( value ) => {
props.setAttributes({ zoom: value });
};
const changeHeight = ( value ) => {
props.setAttributes({ height: value });
};
if ( ! isAPILoaded ) {
return (
<Placeholder>
<Spinner></Spinner>
{ __( 'Loading…' ) }
</Placeholder>
);
}
if ( ! isAPISaved ) {
return (
<div className={ className }>
<Placeholder
icon="admin-site"
label={ __( 'Google Maps' ) }
instructions={ __( 'A Google Maps API key is required, please enter one below.' ) }
>
<TextControl
type="text"
placeholder={ __( 'Google Maps API Key' ) }
value={ api }
className="components-placeholder__input"
onChange={ changeAPI }
/>
<Button
isLarge
type="submit"
onClick={ saveAPIKey }
isBusy={ isSaving }
disabled={ '' === api}
>
{ __( 'Save API Key' ) }
</Button>
<div class="components-placeholder__instructions">
{ __( 'Need an API key? Get one' ) }
<a target="_blank" href="https://console.developers.google.com/flows/enableapi?apiid=maps_backend,static_maps_backend,maps_embed_backend&keyType=CLIENT_SIDE&reusekey=true">
{ __( ' here.' ) }
</a>
</div>
</Placeholder>
</div>
);
}
return [
<InspectorControls>
<PanelBody
title={ __( 'Map Settings' ) }
>
<SelectControl
label={ __( 'Map Type' ) }
value={ props.attributes.type }
options={ [
{ label: __( 'Road Map' ), value: 'roadmap' },
{ label: __( 'Satellite View' ), value: 'satellite' }
] }
onChange={ changeMapType }
/>
<RangeControl
label={ __( 'Map Zoom Level' ) }
value={ props.attributes.zoom }
onChange={ changeZoom }
min={ 0 }
max={ 21 }
/>
<TextControl
label={ __( 'Map Height' ) }
type="text"
value={ props.attributes.height }
onChange={ changeHeight }
/>
</PanelBody>
<PanelBody
title={ __( 'Global Settings' ) }
initialOpen={ false }
>
<TextControl
label={ __( 'Google Maps API Key' ) }
type="text"
placeholder={ __( 'Google Maps API Key' ) }
value={ api }
className="components-placeholder__input"
onChange={ changeAPI }
help={ __( 'Changing the API key effects all Google Map Embed blocks.' ) }
/>
<Button
isLarge
type="submit"
onClick={ saveAPIKey }
isBusy={ isSaving }
disabled={ '' === api}
>
{ __( 'Save API Key' ) }
</Button>
</PanelBody>
</InspectorControls>,
<TextControl
type="text"
placeholder={ __( 'Enter a location…' ) }
value={ props.attributes.location }
onChange={ changeLocation }
/>,
( props.attributes.location ) && (
<div className={ `${ className } interactive` }>
<div className="map" >
<iframe
width="100%"
height="100%"
frameBorder="0"
style={ {
border: 0,
height: props.attributes.height
} }
src={ `https://www.google.com/maps/embed/v1/place?key=${ api }&q=${ props.attributes.location }&maptype=${ props.attributes.type }&zoom=${ props.attributes.zoom }` }
allowFullScreen={ true }>
>
</iframe>
</div>
</div>
)
];
}),
save: () => {
return null;
}
});
crosstraining/wp-content/plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/store/index.js0000604 00000001434 15114236103 0033313 0 ustar 00 home/xbodynamge const {
data,
apiRequest
} = wp;
const {
registerStore,
dispatch
} = data;
const DEFAULT_STATE = {};
registerStore( 'themeisle-gutenberg/blocks', {
reducer( state = DEFAULT_STATE, action ) {
switch ( action.type ) {
case 'GET_ICONS_LIST':
return {
iconsList: action.data
};
}
return state;
},
actions: {
setFaIconsList( data ) {
return {
type: 'GET_ICONS_LIST',
data: data
};
}
},
selectors: {
getFaIconsList( data ) {
if ( 'undefined' !== typeof data.iconsList ) {
return data.iconsList;
}
}
},
resolvers: {
async getFaIconsList() {
let result = [];
result = await apiRequest({ path: 'themeisle-gutenberg-blocks/v1/get_icons_list' });
dispatch( 'themeisle-gutenberg/blocks' ).setFaIconsList( result );
}
}
});
dev/wp-content/plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/notice/index.js 0000644 00000004643 15114356774 0032640 0 ustar 00 home/xbodynamge /**
* WordPress dependencies...
*/
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
const { RichText } = wp.editor;
const { Notice } = wp.components;
/**
* Internal dependencies
*/
import './style.scss';
import './editor.scss';
registerBlockType( 'themeisle-blocks/notice', {
title: __( 'Notice' ),
description: __( 'Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.' ),
icon: 'info',
category: 'themeisle-blocks',
keywords: [
'notice',
'info'
],
attributes: {
content: {
type: 'array',
source: 'children',
selector: 'p.components-notice__content'
}
},
supports: {
align: [ 'wide', 'full' ]
},
styles: [
{ name: 'sucess', label: __( 'Success' ), isDefault: true },
{ name: 'info', label: __( 'Info' ) },
{ name: 'warning', label: __( 'Warning' ) },
{ name: 'error', label: __( 'Error' ) }
],
edit: props => {
let status = 'success';
if ( props.attributes.className && props.attributes.className.includes( 'is-style-info' ) ) {
status = '';
} else if ( props.attributes.className && props.attributes.className.includes( 'is-style-warning' ) ) {
status = 'warning';
} else if ( props.attributes.className && props.attributes.className.includes( 'is-style-error' ) ) {
status = 'error';
}
return (
<Notice
className={ props.className }
isDismissible={ false }
status={ status }
>
<RichText
tagName="p"
placeholder={ __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.' ) }
value={ props.attributes.content }
className="components-notice__content"
onChange={ content => props.setAttributes({ content }) }
keepPlaceholderOnFocus="true"
/>
</Notice>
);
},
save: props => {
let status = 'success';
if ( props.attributes.className && props.attributes.className.includes( 'is-style-info' ) ) {
status = '';
} else if ( props.attributes.className && props.attributes.className.includes( 'is-style-warning' ) ) {
status = 'warning';
} else if ( props.attributes.className && props.attributes.className.includes( 'is-style-error' ) ) {
status = 'error';
}
return (
<Notice
className="themeisle-block-notice"
isDismissible={ false }
status={ status }
>
<RichText.Content
tagName="p"
className="components-notice__content"
value={ props.attributes.content }
/>
</Notice>
);
}
});
dev/wp-content/plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/services/index.js0000644 00000000176 15114357575 0033177 0 ustar 00 home/xbodynamge /**
* Services Block
*/
import './style.scss';
import './editor.scss';
import './services-block';
import './service-block';
wp-content/plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/testimonials/index.js0000644 00000000212 15114357645 0034054 0 ustar 00 home/xbodynamge/dev /**
* Testimonials Block
*/
import './style.scss';
import './editor.scss';
import './testimonials-area';
import './testimonials-block';
plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/sharing-icons/index.js 0000644 00000005223 15114411453 0034100 0 ustar 00 home/xbodynamge/dev/wp-content /**
* WordPress dependencies...
*/
import classnames from 'classnames';
const { __ } = wp.i18n;
const {
registerBlockType
} = wp.blocks;
const {
BlockControls
} = wp.editor;
const {
Toolbar,
Button,
Tooltip
} = wp.components;
/**
* Internal dependencies
*/
import './style.scss';
import './editor.scss';
import socialList from './social_list';
import SocialIcons from './icons';
registerBlockType( 'themeisle-blocks/sharing-icons', {
title: __( 'Sharing Icons' ),
description: __( 'Share buttons for your website visitors to share content on any social sharing service.' ),
icon: 'networking',
category: 'themeisle-blocks',
keywords: [
'social media',
'sharing',
'icons'
],
attributes: {
facebook: {
type: 'boolean',
default: true
},
twitter: {
type: 'boolean',
default: true
},
googleplus: {
type: 'boolean',
default: true
},
linkedin: {
type: 'boolean',
default: true
},
pinterest: {
type: 'boolean',
default: false
},
tumblr: {
type: 'boolean',
default: false
},
reddit: {
type: 'boolean',
default: false
}
},
supports: {
html: true,
align: [ 'left', 'center', 'right' ]
},
styles: [
{ name: 'default', label: __( 'Regular' ), isDefault: true },
{ name: 'icons', label: __( 'Icons Only' ) }
],
edit: props => {
const toggleIcons = ( item ) => {
props.setAttributes({ [ item ]: ! props.attributes[item] });
};
return [
<BlockControls key="toolbar-controls">
<Toolbar
className='components-toolbar'
>
{ Object.keys( socialList ).map( ( item, i ) => {
let prop = props.attributes[item];
return (
<Tooltip text={ __( `Display ${ socialList[item].label }` ) }>
<Button
className={ classnames(
'components-icon-button',
'components-toolbar__control',
{ 'is-active': prop },
) }
onClick={ ( e ) => toggleIcons( item ) }
>
<SocialIcons icon={ item }/>
</Button>
</Tooltip>
);
}) }
</Toolbar>
</BlockControls>,
<div
className={ classnames(
props.className,
{ 'has-label': ( props.attributes.className ? ! props.attributes.className.includes( 'is-style-icons' ) : true ) },
) }
>
{ Object.keys( socialList ).map( ( item, i ) => {
if ( true === props.attributes[item]) {
return (
<a className={ `social-icon is-${item}` }><i class={ `fab fa-${socialList[item].icon}` }></i>{ ( props.attributes.className ? ! props.attributes.className.includes( 'is-style-icons' ) : true ) && socialList[item].label }</a>
);
}
}) }
</div>
];
},
save: () => {
return null;
}
});
plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/pricing-table/index.js 0000644 00000000202 15114413653 0034050 0 ustar 00 home/xbodynamge/dev/wp-content /**
* Pricing Table Block
*/
import './style.scss';
import './editor.scss';
import './pricing-table';
import './pricing-block';
plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/src/components/sizing-control/index.js 0000644 00000007154 15114540031 0037716 0 ustar 00 home/xbodynamge/lebauwcentre/wp-content /**
* External dependencies
*/
import classnames from 'classnames';
/**
* WordPress dependencies
*/
const { __ } = wp.i18n;
const {
Dropdown,
IconButton,
RangeControl
} = wp.components;
const { withInstanceId } = wp.compose;
const { Component } = wp.element;
/**
* Internal dependencies
*/
import './editor.scss';
class SizingControl extends Component {
constructor() {
super( ...arguments );
}
render() {
const id = `inspector-sizing-control-${ this.props.instanceId }`;
if ( this.props.options && 1 > this.props.options.length ) {
return __( 'Please specify more options.' );
}
return (
<div
id={ id }
className="wp-block-themeisle-blocks-sizing-control"
>
<div className="components-base-control__field">
{ this.props.label && (
<label
className="components-base-control__label"
htmlFor={ id }
>
{ this.props.label }
</label>
) }
<div
className={ classnames(
'wp-block-themeisle-blocks-sizing-control-wrapper',
{ 'linking': this.props.type }
) }
>
{ this.props.options.map( ( i, n ) => {
return (
<div className="wp-block-themeisle-blocks-sizing-control-item">
{ i.disabled ? (
<input
type="number"
disabled={ i.disabled }
className="wp-block-themeisle-blocks-sizing-control-item-input"
id={ `wp-block-themeisle-blocks-sizing-control-item-input-${ n }` }
/>
) : (
<Dropdown
position="top center"
focusOnMount={ false }
renderToggle={ ({ isOpen, onToggle }) => (
<input
type="number"
className="wp-block-themeisle-blocks-sizing-control-item-input"
id={ `wp-block-themeisle-blocks-sizing-control-item-input-${ n }` }
value={ i.value }
min={ this.props.min }
max={ this.props.max }
onFocus={ onToggle }
onFocusOut={ onToggle }
onChange={ e => this.props.onChange( i.type, parseInt( e.target.value ) ) }
/>
) }
renderContent={ ({ onToggle }) => (
<div className="wp-block-themeisle-blocks-sizing-control-overlay">
<RangeControl
value={ i.value }
initialPosition={ i.value }
beforeIcon="minus"
afterIcon="plus"
min={ this.props.min }
max={ this.props.max }
onChange={ e => this.props.onChange( i.type, e ) }
/>
</div>
) }
/>
)}
{ i.label && (
<label
className="wp-block-themeisle-blocks-sizing-control-item-label"
htmlFor={ `wp-block-themeisle-blocks-sizing-control-item-input-${ n }` }
>
{ i.label }
</label>
) }
</div>
);
}) }
{ this.props.type && (
<div
className={ classnames(
'wp-block-themeisle-blocks-sizing-control-item',
'toggle-linking',
{ 'is-linked': 'linked' === this.props.type }
) }
>
<IconButton
icon={ 'linked' === this.props.type ? 'admin-links' : 'editor-unlink' }
tooltip={ 'linked' === this.props.type ? __( 'Unlink Values' ) : __( 'Link Values' ) }
className="wp-block-themeisle-blocks-sizing-control-item-input"
onClick={ () => this.props.changeType( 'linked' === this.props.type ? 'unlinked' : 'linked' ) }
/>
</div>
) }
</div>
</div>
</div>
);
}
}
export default withInstanceId( SizingControl );
plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/accordion-box/index.js 0000604 00000000207 15114544043 0036165 0 ustar 00 home/xbodynamge/crosstraining/wp-content /**
* Accordion Block
*/
import './style.scss';
import './editor.scss';
import './accordion-area.js';
import './accordion-block.js';
wp-content/plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/about-author/index.js0000604 00000003612 15114564313 0036055 0 ustar 00 home/xbodynamge/crosstraining /**
* WordPress dependencies...
*/
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
const {
compose,
withState
} = wp.compose;
const { Spinner } = wp.components;
const { withSelect } = wp.data;
/**
* Internal dependencies
*/
import './editor.scss';
import './style.scss';
registerBlockType( 'themeisle-blocks/about-author', {
title: __( 'About Author' ),
description: __( 'About Author block is the easiest way to add a author bio below your posts.' ),
icon: 'admin-users',
category: 'themeisle-blocks',
keywords: [
'about',
'author',
'profile'
],
attributes: {
id: {
type: 'number'
}
},
supports: {
html: false
},
edit: compose([
withSelect( ( select, props ) => {
return {
postAuthor: select( 'core/editor' ).getEditedPostAttribute( 'author' ),
authors: select( 'core' ).getAuthors(),
props
};
}),
withState({
status: 0,
authorDetails: {}
})
])( ({ postAuthor, authors, status, authorDetails, setState, props, className }) => {
if ( 0 === status && postAuthor && authors && postAuthor !== props.attributes.id ) {
authors.find( ( o ) => {
if ( o.id === postAuthor ) {
props.setAttributes({ id: o.id });
setState({
authorDetails: o,
status: 1
});
return o.id === postAuthor;
}
});
}
return (
( 1 === status && postAuthor && authors ) ? (
<section className={ className }>
<div className="themeisle-author-image">
<img className="author-image" src={ authorDetails.avatar_urls[ '96' ] } alt={ authorDetails.name }/>
</div>
<div className="themeisle-author-data">
<h4>{ authorDetails.name }</h4>
<p>{ authorDetails.description }</p>
</div>
</section>
) : (
<div key="loading" className="wp-block-embed is-loading">
<Spinner />
<p>{ __( 'Loading…' ) }</p>
</div>
)
);
}),
save: () => {
return null;
}
});
wp-content/plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/chart/index.js 0000604 00000001523 15114567364 0034554 0 ustar 00 home/xbodynamge/crosstraining /**
* External dependencies
*/
import Editor from './Editor.js';
/**
* WordPress dependencies.
*/
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
/**
* Internal dependencies
*/
import './editor.scss';
registerBlockType( 'themeisle-blocks/chart-pie', {
title: __( 'Pie Chart' ),
description: __( 'Display a beautiful Pie Chart on your blog post with Pie Chart block.' ),
icon: 'chart-pie',
category: 'themeisle-blocks',
keywords: [
__( 'pie' ),
__( 'chart' ),
__( 'orbitfox' )
],
attributes: {
data: {
type: 'string',
default: '[["Label","Data"],["Dogs",40],["Cats",30],["Racoons",20],["Monkeys",10]]'
},
options: {
type: 'object',
default: {
title: 'Animals',
is3D: true
}
},
id: {
type: 'string',
default: ''
}
},
edit: Editor,
save: () => {
return null;
}
});
plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/src/blocks/deprecated/services/index.js0000644 00000000176 15114632431 0037753 0 ustar 00 home/xbodynamge/lebauwcentre/wp-content /**
* Services Block
*/
import './style.scss';
import './editor.scss';
import './services-block';
import './service-block';
plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/src/blocks/deprecated/chart/index.js 0000644 00000001567 15114632466 0037246 0 ustar 00 home/xbodynamge/lebauwcentre/wp-content /**
* External dependencies
*/
import Editor from './Editor.js';
/**
* WordPress dependencies.
*/
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
/**
* Internal dependencies
*/
import './editor.scss';
registerBlockType( 'themeisle-blocks/chart-pie', {
title: __( 'Pie Chart' ),
description: __( 'Display a beautiful Pie Chart on your blog post with Pie Chart block.' ),
icon: 'chart-pie',
category: 'themeisle-blocks',
keywords: [
__( 'pie' ),
__( 'chart' ),
__( 'orbitfox' )
],
attributes: {
data: {
type: 'string',
default: '[["Label","Data"],["Dogs",40],["Cats",30],["Racoons",20],["Monkeys",10]]'
},
options: {
type: 'object',
default: {
title: 'Animals',
is3D: true
}
},
id: {
type: 'string',
default: ''
}
},
supports: {
inserter: false
},
edit: Editor,
save: () => {
return null;
}
});
plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/src/blocks/advanced-heading/index.js 0000644 00000100101 15114632557 0037170 0 ustar 00 home/xbodynamge/lebauwcentre/wp-content /**
* External dependencies
*/
import classnames from 'classnames';
import hexToRgba from 'hex-rgba';
import GoogleFontLoader from 'react-google-font-loader';
/**
* WordPress dependencies.
*/
const { __ } = wp.i18n;
const {
createBlock,
registerBlockType
} = wp.blocks;
const {
Button,
Dashicon,
Dropdown,
DropdownMenu,
IconButton,
PanelBody,
RangeControl,
SVG,
ToggleControl,
Toolbar
} = wp.components;
const {
compose,
withState
} = wp.compose;
const { withSelect } = wp.data;
const {
AlignmentToolbar,
BlockControls,
ColorPalette,
InspectorControls,
RichText
} = wp.editor;
const { Fragment } = wp.element;
const { withViewportMatch } = wp.viewport;
/**
* Internal dependencies
*/
import './editor.scss';
import './style.scss';
import './registerHeadingHighlight.js';
import { headingIcon } from '../../helpers/icons.js';
import GoogleFontsControl from '../../components/google-fonts-control/index.js';
import ControlPanelControl from '../../components/control-panel-control/index.js';
import ResponsiveControl from '../../components/responsive-control/index.js';
import SizingControl from '../../components/sizing-control/index.js';
registerBlockType( 'themeisle-blocks/advanced-heading', {
title: __( 'Advanced Heading' ),
description: __( 'Advanced Heading gives a spin to editor\'s Heading block with much needed customization options.' ),
icon: headingIcon,
category: 'themeisle-blocks',
keywords: [
__( 'heading' ),
__( 'title' ),
__( 'advanced heading' )
],
attributes: {
id: {
type: 'string'
},
content: {
type: 'string',
source: 'html',
selector: 'h1,h2,h3,h4,h5,h6,div,p,span',
default: ''
},
tag: {
default: 'h2',
type: 'string'
},
align: {
type: 'string'
},
alignTablet: {
type: 'string'
},
alignMobile: {
type: 'string'
},
headingColor: {
type: 'string',
default: '#000000'
},
highlightColor: {
type: 'string'
},
highlightBackground: {
type: 'string'
},
fontSize: {
type: 'number'
},
fontSizeTablet: {
type: 'number'
},
fontSizeMobile: {
type: 'number'
},
fontFamily: {
type: 'string'
},
fontVariant: {
type: 'string'
},
fontStyle: {
type: 'string',
default: 'normal'
},
textTransform: {
type: 'string',
default: 'none'
},
lineHeight: {
type: 'number'
},
letterSpacing: {
type: 'number'
},
textShadow: {
type: 'boolean',
default: false
},
textShadowColor: {
type: 'string',
default: '#000000'
},
textShadowColorOpacity: {
type: 'number',
default: 50
},
textShadowBlur: {
type: 'number',
default: 5
},
textShadowHorizontal: {
type: 'number',
default: 0
},
textShadowVertical: {
type: 'number',
default: 0
},
paddingType: {
type: 'string',
default: 'linked'
},
paddingTypeTablet: {
type: 'string',
default: 'linked'
},
paddingTypeMobile: {
type: 'string',
default: 'linked'
},
padding: {
type: 'number',
default: 0
},
paddingTablet: {
type: 'number',
default: 0
},
paddingMobile: {
type: 'number',
default: 0
},
paddingTop: {
type: 'number',
default: 0
},
paddingTopTablet: {
type: 'number',
default: 0
},
paddingTopMobile: {
type: 'number',
default: 0
},
paddingRight: {
type: 'number',
default: 0
},
paddingRightTablet: {
type: 'number',
default: 0
},
paddingRightMobile: {
type: 'number',
default: 0
},
paddingBottom: {
type: 'number',
default: 0
},
paddingBottomTablet: {
type: 'number',
default: 0
},
paddingBottomMobile: {
type: 'number',
default: 0
},
paddingLeft: {
type: 'number',
default: 0
},
paddingLeftTablet: {
type: 'number',
default: 0
},
paddingLeftMobile: {
type: 'number',
default: 0
},
marginType: {
type: 'string',
default: 'unlinked'
},
marginTypeTablet: {
type: 'string',
default: 'unlinked'
},
marginTypeMobile: {
type: 'string',
default: 'unlinked'
},
margin: {
type: 'number',
default: 0
},
marginTablet: {
type: 'number',
default: 0
},
marginMobile: {
type: 'number',
default: 0
},
marginTop: {
type: 'number',
default: 0
},
marginTopTablet: {
type: 'number',
default: 0
},
marginTopMobile: {
type: 'number',
default: 0
},
marginBottom: {
type: 'number',
default: 25
},
marginBottomTablet: {
type: 'number',
default: 25
},
marginBottomMobile: {
type: 'number',
default: 20
}
},
transforms: {
from: [
{
type: 'block',
blocks: [ 'core/heading' ],
transform: ({ content }) => {
return createBlock( 'themeisle-blocks/advanced-heading', {
content
});
}
},
{
type: 'block',
blocks: [ 'core/paragraph' ],
transform: ({ content }) => {
return createBlock( 'themeisle-blocks/advanced-heading', {
content
});
}
}
],
to: [
{
type: 'block',
blocks: [ 'core/paragraph' ],
transform: ({ content }) => {
return createBlock( 'core/paragraph', {
content
});
}
}
]
},
edit: compose([
withSelect( ( select, props ) => {
return {
props
};
}),
withState({
tab: 'style',
fontSizeViewType: 'desktop',
alignmentViewType: 'desktop',
paddingViewType: 'desktop',
marginViewType: 'desktop'
}),
withViewportMatch({
isLarger: '>= large',
isLarge: '<= large',
isSmall: '>= small',
isSmaller: '<= small'
})
])( ({
tab,
fontSizeViewType,
alignmentViewType,
paddingViewType,
marginViewType,
setState,
isLarger,
isLarge,
isSmall,
isSmaller,
props
}) => {
const {
id,
content,
tag,
align,
alignTablet,
alignMobile,
headingColor,
highlightColor,
highlightBackground,
fontSize,
fontSizeTablet,
fontSizeMobile,
fontFamily,
fontVariant,
fontStyle,
textTransform,
lineHeight,
letterSpacing,
textShadow,
textShadowColor,
textShadowColorOpacity,
textShadowBlur,
textShadowHorizontal,
textShadowVertical,
paddingType,
paddingTypeTablet,
paddingTypeMobile,
padding,
paddingTablet,
paddingMobile,
paddingTop,
paddingTopTablet,
paddingTopMobile,
paddingRight,
paddingRightTablet,
paddingRightMobile,
paddingBottom,
paddingBottomTablet,
paddingBottomMobile,
paddingLeft,
paddingLeftTablet,
paddingLeftMobile,
marginType,
marginTypeTablet,
marginTypeMobile,
margin,
marginTablet,
marginMobile,
marginTop,
marginTopTablet,
marginTopMobile,
marginBottom,
marginBottomTablet,
marginBottomMobile
} = props.attributes;
if ( id === undefined || id.substr( id.length - 8 ) !== props.clientId.substr( 0, 8 ) ) {
const instanceId = `wp-block-themeisle-blocks-advanced-heading-${ props.clientId.substr( 0, 8 ) }`;
props.setAttributes({ id: instanceId });
}
const isDesktop = ( isLarger && ! isLarge && isSmall && ! isSmaller );
const isTablet = ( ! isLarger && ! isLarge && isSmall && ! isSmaller );
const isMobile = ( ! isLarger && ! isLarge && ! isSmall && ! isSmaller );
const changeFontSizeViewType = value => {
setState({ fontSizeViewType: value });
};
const changeAlignmentViewType = value => {
setState({ alignmentViewType: value });
};
const changePaddingViewType = value => {
setState({ paddingViewType: value });
};
const changeMarginViewType = value => {
setState({ marginViewType: value });
};
const changeContent = value => {
props.setAttributes({ content: value });
};
const changeTag = value => {
props.setAttributes({ tag: value });
};
const getTagIcon = value => {
if ( 'h1' === value ) {
return <SVG style={ { width: '25px', height: '20px' } }><text style={ { fontSize: '12px' } } x="0" y="15">H1</text></SVG>;
}
if ( 'h2' === value ) {
return <SVG style={ { width: '25px', height: '20px' } }><text style={ { fontSize: '12px' } } x="0" y="15">H2</text></SVG>;
}
if ( 'h3' === value ) {
return <SVG style={ { width: '25px', height: '20px' } }><text style={ { fontSize: '12px' } } x="0" y="15">H3</text></SVG>;
}
if ( 'h4' === value ) {
return <SVG style={ { width: '25px', height: '20px' } }><text style={ { fontSize: '12px' } } x="0" y="15">H4</text></SVG>;
}
if ( 'h5' === value ) {
return <SVG style={ { width: '25px', height: '20px' } }><text style={ { fontSize: '12px' } } x="0" y="15">H5</text></SVG>;
}
if ( 'h6' === value ) {
return <SVG style={ { width: '25px', height: '20px' } }><text style={ { fontSize: '12px' } } x="0" y="15">H6</text></SVG>;
}
if ( 'div' === value ) {
return <SVG style={ { width: '25px', height: '20px' } }><text style={ { fontSize: '12px' } } x="0" y="15">DIV</text></SVG>;
}
if ( 'p' === value ) {
return <SVG style={ { width: '25px', height: '20px' } }><text x="0" y="15">P</text></SVG>;
}
if ( 'span' === value ) {
return <SVG style={ { width: '25px', height: '20px' } }><text style={ { fontSize: '12px' } } x="0" y="15">SPAN</text></SVG>;
}
};
const changeHeadingColor = value => {
props.setAttributes({ headingColor: value });
};
const changeHighlightColor = value => {
props.setAttributes({ highlightColor: value });
};
const changeHighlightBackground = value => {
props.setAttributes({ highlightBackground: value });
};
const changeFontSize = value => {
if ( 'desktop' === fontSizeViewType ) {
props.setAttributes({ fontSize: value });
}
if ( 'tablet' === fontSizeViewType ) {
props.setAttributes({ fontSizeTablet: value });
}
if ( 'mobile' === fontSizeViewType ) {
props.setAttributes({ fontSizeMobile: value });
}
};
let getFontSize = () => {
let value;
if ( 'desktop' === fontSizeViewType ) {
value = fontSize;
}
if ( 'tablet' === fontSizeViewType ) {
value = fontSizeTablet;
}
if ( 'mobile' === fontSizeViewType ) {
value = fontSizeMobile;
}
return value;
};
getFontSize = getFontSize();
const changeAlignment = value => {
if ( 'desktop' === alignmentViewType ) {
props.setAttributes({ align: value });
}
if ( 'tablet' === alignmentViewType ) {
props.setAttributes({ alignTablet: value });
}
if ( 'mobile' === alignmentViewType ) {
props.setAttributes({ alignMobile: value });
}
};
let getAlignment = () => {
let value;
if ( 'desktop' === alignmentViewType ) {
value = align;
}
if ( 'tablet' === alignmentViewType ) {
value = alignTablet;
}
if ( 'mobile' === alignmentViewType ) {
value = alignMobile;
}
return value;
};
getAlignment = getAlignment();
const changeFontFamily = value => {
props.setAttributes({
fontFamily: value,
fontVariant: 'normal',
fontStyle: 'normal'
});
};
const changeFontVariant = value => {
props.setAttributes({ fontVariant: value });
};
const changeFontStyle = value => {
props.setAttributes({ fontStyle: value });
};
const changeTextTransform = value => {
props.setAttributes({ textTransform: value });
};
const changeLineHeight = value => {
props.setAttributes({ lineHeight: value });
};
const changeLetterSpacing = value => {
props.setAttributes({ letterSpacing: value });
};
const changeTextShadowColor = value => {
props.setAttributes({ textShadowColor: value });
};
const changeTextShadow = value => {
props.setAttributes({ textShadow: value });
};
const changeTextShadowColorOpacity = value => {
props.setAttributes({ textShadowColorOpacity: value });
};
const changeTextShadowBlur = value => {
props.setAttributes({ textShadowBlur: value });
};
const changeTextShadowHorizontal = value => {
props.setAttributes({ textShadowHorizontal: value });
};
const changeTextShadowVertical = value => {
props.setAttributes({ textShadowVertical: value });
};
const getPadding = type => {
let value;
if ( 'top' == type ) {
if ( 'desktop' === paddingViewType ) {
value = 'linked' === paddingType ? padding : paddingTop;
}
if ( 'tablet' === paddingViewType ) {
value = 'linked' === paddingTypeTablet ? paddingTablet : paddingTopTablet;
}
if ( 'mobile' === paddingViewType ) {
value = 'linked' === paddingTypeMobile ? paddingMobile : paddingTopMobile;
}
}
if ( 'right' == type ) {
if ( 'desktop' === paddingViewType ) {
value = 'linked' === paddingType ? padding : paddingRight;
}
if ( 'tablet' === paddingViewType ) {
value = 'linked' === paddingTypeTablet ? paddingTablet : paddingRightTablet;
}
if ( 'mobile' === paddingViewType ) {
value = 'linked' === paddingTypeMobile ? paddingMobile : paddingRightMobile;
}
}
if ( 'bottom' == type ) {
if ( 'desktop' === paddingViewType ) {
value = 'linked' === paddingType ? padding : paddingBottom;
}
if ( 'tablet' === paddingViewType ) {
value = 'linked' === paddingTypeTablet ? paddingTablet : paddingBottomTablet;
}
if ( 'mobile' === paddingViewType ) {
value = 'linked' === paddingTypeMobile ? paddingMobile : paddingBottomMobile;
}
}
if ( 'left' == type ) {
if ( 'desktop' === paddingViewType ) {
value = 'linked' === paddingType ? padding : paddingLeft;
}
if ( 'tablet' === paddingViewType ) {
value = 'linked' === paddingTypeTablet ? paddingTablet : paddingLeftTablet;
}
if ( 'mobile' === paddingViewType ) {
value = 'linked' === paddingTypeMobile ? paddingMobile : paddingLeftMobile;
}
}
return value;
};
const desktopPaddingType = {
top: 'paddingTop',
right: 'paddingRight',
bottom: 'paddingBottom',
left: 'paddingLeft'
};
const tabletPaddingType = {
top: 'paddingTopTablet',
right: 'paddingRightTablet',
bottom: 'paddingBottomTablet',
left: 'paddingLeftTablet'
};
const mobilePaddingType = {
top: 'paddingTopMobile',
right: 'paddingRightMobile',
bottom: 'paddingBottomMobile',
left: 'paddingLeftMobile'
};
const changePadding = ( type, value ) => {
if ( 'desktop' === paddingViewType ) {
if ( 'linked' === paddingType ) {
props.setAttributes({ padding: value });
} else {
props.setAttributes({ [desktopPaddingType[type]]: value });
}
}
if ( 'tablet' === paddingViewType ) {
if ( 'linked' === paddingTypeTablet ) {
props.setAttributes({ paddingTablet: value });
} else {
props.setAttributes({ [tabletPaddingType[type]]: value });
}
}
if ( 'mobile' === paddingViewType ) {
if ( 'linked' === paddingTypeMobile ) {
props.setAttributes({ paddingMobile: value });
} else {
props.setAttributes({ [mobilePaddingType[type]]: value });
}
}
};
const changePaddingType = value => {
if ( 'desktop' === paddingViewType ) {
props.setAttributes({ paddingType: value });
}
if ( 'tablet' === paddingViewType ) {
props.setAttributes({ paddingTypeTablet: value });
}
if ( 'mobile' === paddingViewType ) {
props.setAttributes({ paddingTypeMobile: value });
}
};
let getPaddingType = () => {
let value;
if ( 'desktop' === paddingViewType ) {
value = paddingType;
}
if ( 'tablet' === paddingViewType ) {
value = paddingTypeTablet;
}
if ( 'mobile' === paddingViewType ) {
value = paddingTypeMobile;
}
return value;
};
getPaddingType = getPaddingType();
const getMargin = type => {
let value;
if ( 'top' == type ) {
if ( 'desktop' === marginViewType ) {
value = 'linked' === marginType ? margin : marginTop;
}
if ( 'tablet' === marginViewType ) {
value = 'linked' === marginTypeTablet ? marginTablet : marginTopTablet;
}
if ( 'mobile' === marginViewType ) {
value = 'linked' === marginTypeMobile ? marginMobile : marginTopMobile;
}
}
if ( 'bottom' == type ) {
if ( 'desktop' === marginViewType ) {
value = 'linked' === marginType ? margin : marginBottom;
}
if ( 'tablet' === marginViewType ) {
value = 'linked' === marginTypeTablet ? marginTablet : marginBottomTablet;
}
if ( 'mobile' === marginViewType ) {
value = 'linked' === marginTypeMobile ? marginMobile : marginBottomMobile;
}
}
return value;
};
const desktopMarginType = {
top: 'marginTop',
bottom: 'marginBottom'
};
const tabletMarginType = {
top: 'marginTopTablet',
bottom: 'marginBottomTablet'
};
const mobileMarginType = {
top: 'marginTopMobile',
bottom: 'marginBottomMobile'
};
const changeMargin = ( type, value ) => {
if ( 'desktop' === marginViewType ) {
if ( 'linked' === marginType ) {
props.setAttributes({ margin: value });
} else {
props.setAttributes({ [desktopMarginType[type]]: value });
}
}
if ( 'tablet' === marginViewType ) {
if ( 'linked' === marginTypeTablet ) {
props.setAttributes({ marginTablet: value });
} else {
props.setAttributes({ [tabletMarginType[type]]: value });
}
}
if ( 'mobile' === marginViewType ) {
if ( 'linked' === marginTypeMobile ) {
props.setAttributes({ marginMobile: value });
} else {
props.setAttributes({ [mobileMarginType[type]]: value });
}
}
};
const changeMarginType = value => {
if ( 'desktop' === marginViewType ) {
props.setAttributes({ marginType: value });
}
if ( 'tablet' === marginViewType ) {
props.setAttributes({ marginTypeTablet: value });
}
if ( 'mobile' === marginViewType ) {
props.setAttributes({ marginTypeMobile: value });
}
};
let getMarginType = () => {
let value;
if ( 'desktop' === marginViewType ) {
value = marginType;
}
if ( 'tablet' === marginViewType ) {
value = marginTypeTablet;
}
if ( 'mobile' === marginViewType ) {
value = marginTypeMobile;
}
return value;
};
getMarginType = getMarginType();
let fontSizeStyle, stylesheet, textShadowStyle;
if ( isDesktop ) {
fontSizeStyle = {
fontSize: `${ fontSize }px`
};
stylesheet = {
textAlign: align,
paddingTop: 'linked' === paddingType ? `${ padding }px` : `${ paddingTop }px`,
paddingRight: 'linked' === paddingType ? `${ padding }px` : `${ paddingRight }px`,
paddingBottom: 'linked' === paddingType ? `${ padding }px` : `${ paddingBottom }px`,
paddingLeft: 'linked' === paddingType ? `${ padding }px` : `${ paddingLeft }px`,
marginTop: 'linked' === marginType ? `${ margin }px` : `${ marginTop }px`,
marginBottom: 'linked' === marginType ? `${ margin }px` : `${ marginBottom }px`
};
}
if ( isTablet ) {
fontSizeStyle = {
fontSize: `${ fontSizeTablet }px`
};
stylesheet = {
textAlign: alignTablet,
paddingTop: 'linked' === paddingTypeTablet ? `${ paddingTablet }px` : `${ paddingTopTablet }px`,
paddingRight: 'linked' === paddingTypeTablet ? `${ paddingTablet }px` : `${ paddingRightTablet }px`,
paddingBottom: 'linked' === paddingTypeTablet ? `${ paddingTablet }px` : `${ paddingBottomTablet }px`,
paddingLeft: 'linked' === paddingTypeTablet ? `${ paddingTablet }px` : `${ paddingLeftTablet }px`,
marginTop: 'linked' === marginTypeTablet ? `${ marginTablet }px` : `${ marginTopTablet }px`,
marginBottom: 'linked' === marginTypeTablet ? `${ marginTablet }px` : `${ marginBottomTablet }px`
};
}
if ( isMobile ) {
fontSizeStyle = {
fontSize: `${ fontSizeMobile }px`
};
stylesheet = {
textAlign: alignMobile,
paddingTop: 'linked' === paddingTypeMobile ? `${ paddingMobile }px` : `${ paddingTopMobile }px`,
paddingRight: 'linked' === paddingTypeMobile ? `${ paddingMobile }px` : `${ paddingRightMobile }px`,
paddingBottom: 'linked' === paddingTypeMobile ? `${ paddingMobile }px` : `${ paddingBottomMobile }px`,
paddingLeft: 'linked' === paddingTypeMobile ? `${ paddingMobile }px` : `${ paddingLeftMobile }px`,
marginTop: 'linked' === marginTypeMobile ? `${ marginMobile }px` : `${ marginTopMobile }px`,
marginBottom: 'linked' === marginTypeMobile ? `${ marginMobile }px` : `${ marginBottomMobile }px`
};
}
if ( textShadow ) {
textShadowStyle = {
textShadow: `${ textShadowHorizontal }px ${ textShadowVertical }px ${ textShadowBlur }px ${ hexToRgba( ( textShadowColor ? textShadowColor : '#000000' ), textShadowColorOpacity ) }`
};
}
const style = {
color: headingColor,
...fontSizeStyle,
fontFamily: fontFamily ? fontFamily : 'inherit',
fontWeight: 'regular' === fontVariant ? 'normal' : fontVariant,
fontStyle: fontStyle,
textTransform: textTransform,
lineHeight: lineHeight && `${ lineHeight }px`,
letterSpacing: letterSpacing && `${ letterSpacing }px`,
...stylesheet,
...textShadowStyle
};
return (
<Fragment>
<style>
{ `.${ id } mark {
color: ${ highlightColor };
background: ${ highlightBackground };
}` }
</style>
{ fontFamily && (
<GoogleFontLoader fonts={ [ {
font: fontFamily,
weights: fontVariant && [ `${fontVariant + ( 'italic' === fontStyle ? ':i' : '' ) }` ]
} ] } />
) }
<BlockControls>
<DropdownMenu
icon={ getTagIcon( tag ) }
label={ __( 'Select tag' ) }
className="components-toolbar"
controls={ [
{
title: __( 'Heading 1' ),
icon: getTagIcon( 'h1' ),
onClick: () => changeTag( 'h1' )
},
{
title: __( 'Heading 2' ),
icon: getTagIcon( 'h2' ),
onClick: () => changeTag( 'h2' )
},
{
title: __( 'Heading 3' ),
icon: getTagIcon( 'h3' ),
onClick: () => changeTag( 'h3' )
},
{
title: __( 'Heading 4' ),
icon: getTagIcon( 'h4' ),
onClick: () => changeTag( 'h4' )
},
{
title: __( 'Heading 5' ),
icon: getTagIcon( 'h5' ),
onClick: () => changeTag( 'h5' )
},
{
title: __( 'Heading 6' ),
icon: getTagIcon( 'h6' ),
onClick: () => changeTag( 'h6' )
},
{
title: __( 'Division' ),
icon: getTagIcon( 'div' ),
onClick: () => changeTag( 'div' )
},
{
title: __( 'Paragraph' ),
icon: getTagIcon( 'p' ),
onClick: () => changeTag( 'p' )
},
{
title: __( 'Span Tag' ),
icon: getTagIcon( 'span' ),
onClick: () => changeTag( 'span' )
}
] }
/>
<Toolbar
className="wp-themesiel-blocks-advanced-heading-components-toolbar"
>
<Dropdown
contentClassName="wp-themesiel-blocks-advanced-heading-popover-content"
position="bottom center"
renderToggle={ ({ isOpen, onToggle }) => (
<IconButton
className="components-dropdown-menu__toggle"
icon={ 'editor-textcolor' }
onClick={ onToggle }
aria-haspopup="true"
aria-expanded={ isOpen }
label={ __( 'Typography Settings' ) }
tooltip={ __( 'Typography Settings' ) }
>
<span className="components-dropdown-menu__indicator" />
</IconButton>
) }
renderContent={ () => (
<Fragment>
<GoogleFontsControl
label={ __( 'Font Family' ) }
value={ fontFamily }
onChangeFontFamily={ changeFontFamily }
isSelect={ true }
valueVariant={ fontVariant }
onChangeFontVariant={ changeFontVariant }
valueStyle={ fontStyle }
onChangeFontStyle={ changeFontStyle }
valueTransform={ textTransform }
onChangeTextTransform={ changeTextTransform }
/>
<RangeControl
label={ __( 'Line Height' ) }
value={ lineHeight }
onChange={ changeLineHeight }
min={ 0 }
max={ 200 }
/>
<RangeControl
label={ __( 'Letter Spacing' ) }
value={ letterSpacing }
onChange={ changeLetterSpacing }
min={ -50 }
max={ 100 }
/>
</Fragment>
) }
/>
</Toolbar>
</BlockControls>
<InspectorControls>
<PanelBody className="wp-block-themeisle-blocks-advanced-heading-header-panel">
<Button
className={ classnames(
'header-tab',
{ 'is-selected': 'style' === tab }
) }
onClick={ () => setState({ tab: 'style' }) }
>
<span
>
<Dashicon icon="admin-customizer"/>
{ __( 'Style' ) }
</span>
</Button>
<Button
className={ classnames(
'header-tab',
{ 'is-selected': 'advanced' === tab }
) }
onClick={ () => setState({ tab: 'advanced' }) }
>
<span
>
<Dashicon icon="admin-generic"/>
{ __( 'Advanced' ) }
</span>
</Button>
</PanelBody>
{ 'style' === tab && (
<Fragment>
<PanelBody
title={ __( 'General Settings' ) }
>
<Fragment>
<p>{ __( 'Heading Color' ) }</p>
<ColorPalette
label={ 'Heading Color' }
value={ headingColor }
onChange={ changeHeadingColor }
/>
</Fragment>
<ResponsiveControl
label={ 'Font Size' }
view={ fontSizeViewType }
changeViewType={ changeFontSizeViewType }
>
<RangeControl
value={ getFontSize || '' }
onChange={ changeFontSize }
min={ 1 }
max={ 500 }
/>
</ResponsiveControl>
<ResponsiveControl
label={ 'Alignment' }
view={ alignmentViewType }
changeViewType={ changeAlignmentViewType }
>
<AlignmentToolbar
value={ getAlignment }
onChange={ changeAlignment }
/>
</ResponsiveControl>
</PanelBody>
<PanelBody
title={ __( 'Typography Settings' ) }
initialOpen={ false }
>
<GoogleFontsControl
label={ __( 'Font Family' ) }
value={ fontFamily }
onChangeFontFamily={ changeFontFamily }
valueVariant={ fontVariant }
onChangeFontVariant={ changeFontVariant }
valueStyle={ fontStyle }
onChangeFontStyle={ changeFontStyle }
valueTransform={ textTransform }
onChangeTextTransform={ changeTextTransform }
/>
<RangeControl
label={ __( 'Line Height' ) }
value={ lineHeight }
onChange={ changeLineHeight }
min={ 0 }
max={ 200 }
/>
<RangeControl
label={ __( 'Letter Spacing' ) }
value={ letterSpacing }
onChange={ changeLetterSpacing }
min={ -50 }
max={ 100 }
/>
<ToggleControl
label={ 'Shadow Properties' }
checked={ textShadow }
onChange={ changeTextShadow }
/>
{ textShadow && (
<Fragment>
<Fragment>
<p>{ __( 'Color' ) }</p>
<ColorPalette
label={ __( 'Color' ) }
value={ textShadowColor }
onChange={ changeTextShadowColor }
/>
</Fragment>
<ControlPanelControl
label={ 'Shadow Properties' }
>
<RangeControl
label={ __( 'Opacity' ) }
value={ textShadowColorOpacity }
onChange={ changeTextShadowColorOpacity }
min={ 0 }
max={ 100 }
/>
<RangeControl
label={ __( 'Blur' ) }
value={ textShadowBlur }
onChange={ changeTextShadowBlur }
min={ 0 }
max={ 100 }
/>
<RangeControl
label={ __( 'Horizontal' ) }
value={ textShadowHorizontal }
onChange={ changeTextShadowHorizontal }
min={ -100 }
max={ 100 }
/>
<RangeControl
label={ __( 'Vertical' ) }
value={ textShadowVertical }
onChange={ changeTextShadowVertical }
min={ -100 }
max={ 100 }
/>
</ControlPanelControl>
</Fragment>
) }
</PanelBody>
</Fragment>
) || 'advanced' === tab && (
<Fragment>
<PanelBody
title={ __( 'Highlight Color' ) }
>
<Fragment>
<p>{ __( 'Highlight Color' ) }</p>
<ColorPalette
label={ 'Highlight Color' }
value={ highlightColor }
onChange={ changeHighlightColor }
/>
</Fragment>
<Fragment>
<p>{ __( 'Highlight Background' ) }</p>
<ColorPalette
label={ 'Highlight Background' }
value={ highlightBackground }
onChange={ changeHighlightBackground }
/>
</Fragment>
</PanelBody>
<PanelBody
title={ __( 'Padding & Margin' ) }
initialOpen={ false }
>
<ResponsiveControl
label={ 'Padding' }
view={ paddingViewType }
changeViewType={ changePaddingViewType }
>
<SizingControl
type={ getPaddingType }
min={ 0 }
max={ 500 }
changeType={ changePaddingType }
onChange={ changePadding }
options={ [
{
label: __( 'Top' ),
type: 'top',
value: getPadding( 'top' )
},
{
label: __( 'Right' ),
type: 'right',
value: getPadding( 'right' )
},
{
label: __( 'Bottom' ),
type: 'bottom',
value: getPadding( 'bottom' )
},
{
label: __( 'Left' ),
type: 'left',
value: getPadding( 'left' )
}
] }
/>
</ResponsiveControl>
<ResponsiveControl
label={ 'Margin' }
view={ marginViewType }
changeViewType={ changeMarginViewType }
>
<SizingControl
type={ getMarginType }
min={ -500 }
max={ 500 }
changeType={ changeMarginType }
onChange={ changeMargin }
options={ [
{
label: __( 'Top' ),
type: 'top',
value: getMargin( 'top' )
},
{
label: __( 'Right' ),
disabled: true
},
{
label: __( 'Bottom' ),
type: 'bottom',
value: getMargin( 'bottom' )
},
{
label: __( 'Left' ),
disabled: true
}
] }
/>
</ResponsiveControl>
</PanelBody>
</Fragment>
) }
</InspectorControls>
<RichText
identifier="content"
className={ classnames(
id,
props.className
) }
value={ content }
placeholder={ __( 'Write heading…' ) }
tagName={ tag }
formattingControls={ [ 'bold', 'italic', 'link', 'strikethrough', 'mark' ] }
onMerge={ props.mergeBlocks }
unstableOnSplit={
props.insertBlocksAfter ?
( before, after, ...blocks ) => {
props.setAttributes({ content: before });
props.insertBlocksAfter([
...blocks,
createBlock( 'core/paragraph', { content: after })
]);
} :
undefined
}
onRemove={ () => props.onReplace([]) }
style={ style }
onChange={ changeContent }
/>
</Fragment>
);
}),
save: props => {
const {
id,
content,
tag,
headingColor,
fontFamily,
fontVariant,
fontStyle,
textTransform,
lineHeight,
letterSpacing,
textShadow,
textShadowColor,
textShadowColorOpacity,
textShadowBlur,
textShadowHorizontal,
textShadowVertical
} = props.attributes;
let textShadowStyle;
if ( textShadow ) {
textShadowStyle = {
textShadow: `${ textShadowHorizontal }px ${ textShadowVertical }px ${ textShadowBlur }px ${ hexToRgba( ( textShadowColor ? textShadowColor : '#000000' ), textShadowColorOpacity ) }`
};
}
const style = {
color: headingColor,
fontFamily: fontFamily,
fontWeight: 'regular' === fontVariant ? 'normal' : fontVariant,
fontStyle: fontStyle,
textTransform: textTransform,
lineHeight: lineHeight && `${ lineHeight }px`,
letterSpacing: letterSpacing && `${ letterSpacing }px`,
...textShadowStyle
};
return (
<RichText.Content
tagName={ tag }
value={ content }
id={ id }
className={ classnames(
id,
props.className
) }
style={ style }
/>
);
}
});
plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/src/blocks/deprecated/notice/index.js 0000644 00000004663 15114633001 0037410 0 ustar 00 home/xbodynamge/lebauwcentre/wp-content /**
* WordPress dependencies
*/
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
const { RichText } = wp.editor;
const { Notice } = wp.components;
/**
* Internal dependencies
*/
import './style.scss';
import './editor.scss';
registerBlockType( 'themeisle-blocks/notice', {
title: __( 'Notice' ),
description: __( 'Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.' ),
icon: 'info',
category: 'themeisle-blocks',
keywords: [
'notice',
'info'
],
attributes: {
content: {
type: 'array',
source: 'children',
selector: 'p.components-notice__content'
}
},
supports: {
align: [ 'wide', 'full' ],
inserter: false
},
styles: [
{ name: 'sucess', label: __( 'Success' ), isDefault: true },
{ name: 'info', label: __( 'Info' ) },
{ name: 'warning', label: __( 'Warning' ) },
{ name: 'error', label: __( 'Error' ) }
],
edit: props => {
let status = 'success';
if ( props.attributes.className && props.attributes.className.includes( 'is-style-info' ) ) {
status = '';
} else if ( props.attributes.className && props.attributes.className.includes( 'is-style-warning' ) ) {
status = 'warning';
} else if ( props.attributes.className && props.attributes.className.includes( 'is-style-error' ) ) {
status = 'error';
}
return (
<Notice
className={ props.className }
isDismissible={ false }
status={ status }
>
<RichText
tagName="p"
placeholder={ __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.' ) }
value={ props.attributes.content }
className="components-notice__content"
onChange={ content => props.setAttributes({ content }) }
keepPlaceholderOnFocus="true"
/>
</Notice>
);
},
save: props => {
let status = 'success';
if ( props.attributes.className && props.attributes.className.includes( 'is-style-info' ) ) {
status = '';
} else if ( props.attributes.className && props.attributes.className.includes( 'is-style-warning' ) ) {
status = 'warning';
} else if ( props.attributes.className && props.attributes.className.includes( 'is-style-error' ) ) {
status = 'error';
}
return (
<Notice
className="themeisle-block-notice"
isDismissible={ false }
status={ status }
>
<RichText.Content
tagName="p"
className="components-notice__content"
value={ props.attributes.content }
/>
</Notice>
);
}
});
plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/src/blocks/deprecated/index.js 0000644 00000000400 15114633002 0036111 0 ustar 00 home/xbodynamge/lebauwcentre/wp-content /**
* Blocks to be deprecated.
*/
import './accordion-box/index.js';
import './chart/index.js';
import './notice/index.js';
import './pricing-table/index.js';
import './services/index.js';
import './testimonials/index.js';
import './tweetable/index.js';
wp-content/plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/post-grid/index.js 0000604 00000020051 15115063315 0035344 0 ustar 00 home/xbodynamge/crosstraining /**
* External dependencies
*/
import classnames from 'classnames';
import Thumbnail from './Thumbnail.js';
/**
* WordPress dependencies...
*/
const { isUndefined, pickBy } = lodash;
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
const {
Button,
Dashicon,
PanelBody,
QueryControls,
RangeControl,
Spinner,
TextControl,
ToggleControl,
Toolbar,
Tooltip
} = wp.components;
const { withSelect } = wp.data;
const {
BlockControls,
InspectorControls
} = wp.editor;
const unescapeHTML = value => {
const htmlNode = document.createElement( 'div' );
htmlNode.innerHTML = value;
if ( htmlNode.innerText !== undefined ) {
return htmlNode.innerText;
}
return htmlNode.textContent;
};
const formatDate = date => {
const monthNames = [
__( 'January' ), __( 'February' ), __( 'March' ),
__( 'April' ), __( 'May' ), __( 'June' ), __( 'July' ),
__( 'August' ), __( 'September' ), __( 'October' ),
__( 'November' ), __( 'December' )
];
const weekNames = [
__( 'Sunday' ), __( 'Monday' ), __( 'Tuesday' ), __( 'Wednesday' ),
__( 'Thursday' ), __( 'Friday' ), __( 'Saturday' )
];
date = new Date( date );
const day = date.getDate();
const monthIndex = date.getMonth();
const year = date.getFullYear();
return day + ' ' + monthNames[monthIndex] + ', ' + year;
};
import './style.scss';
import './editor.scss';
registerBlockType( 'themeisle-blocks/posts-grid', {
title: __( 'Posts Grid' ),
description: __( 'Display a list of your most recent posts in a beautiful grid.' ),
icon: 'screenoptions',
category: 'themeisle-blocks',
keywords: [
'posts',
'grid',
'orbitfox'
],
attributes: {
grid: {
type: 'boolean',
default: false
},
columns: {
type: 'number',
default: 3
},
categories: {
type: 'string'
},
postsToShow: {
type: 'number',
default: 5
},
order: {
type: 'string',
default: 'desc'
},
orderBy: {
type: 'string',
default: 'date'
},
displayFeaturedImage: {
type: 'boolean',
default: true
},
displayCategory: {
type: 'boolean',
default: true
},
displayDate: {
type: 'boolean',
default: true
},
displayAuthor: {
type: 'boolean',
default: true
},
excerptLength: {
type: 'number',
default: 200
}
},
edit: withSelect( ( select, props ) => {
const { categories, order, orderBy, postsToShow } = props.attributes;
const latestPostsQuery = pickBy({
categories,
order,
orderby: orderBy,
per_page: postsToShow // eslint-disable-line camelcase
}, ( value ) => ! isUndefined( value ) );
return {
posts: select( 'core' ).getEntityRecords( 'postType', 'post', latestPostsQuery ),
// eslint-disable-next-line camelcase
categoriesList: select( 'core' ).getEntityRecords( 'taxonomy', 'category', { per_page: 100 }),
authors: select( 'core' ).getAuthors(),
props
};
})( ({ posts, categoriesList, authors, className, setAttributes, props }) => {
if ( ! posts ) {
return (
<p className={ className } >
<Spinner />
{ __( 'Loading Posts' ) }
</p>
);
}
if ( 0 === posts.length ) {
return <p>{ __( 'No Posts' ) }</p>;
}
const {
grid,
columns,
order,
orderBy,
categories,
postsToShow,
displayFeaturedImage,
displayCategory,
displayDate,
displayAuthor,
excerptLength
} = props.attributes;
const toggleLayout = () => {
props.setAttributes({ grid: ! grid });
};
const changeColumns = value => {
props.setAttributes({ columns: value});
};
const toggleFeaturedImage = () => {
props.setAttributes({ displayFeaturedImage: ! displayFeaturedImage });
};
const toggleDisplayCategory = () => {
props.setAttributes({ displayCategory: ! displayCategory });
};
const toggleDisplayDate = () => {
props.setAttributes({ displayDate: ! displayDate });
};
const toggleDisplayAuthor = () => {
props.setAttributes({ displayAuthor: ! displayAuthor });
};
const onExcerptLength = value => {
props.setAttributes({ excerptLength: value });
};
return [
<BlockControls key="toolbar-controls">
<Toolbar
className='components-toolbar'
>
<Tooltip text={ __( 'List Layout' ) }>
<Button
className={ classnames(
'components-icon-button',
'components-toolbar__control',
{ 'is-active': ! grid },
) }
onClick={ toggleLayout }
>
<Dashicon icon="list-view" />
</Button>
</Tooltip>
<Tooltip text={ __( 'Grid Layout' ) }>
<Button
className={ classnames(
'components-icon-button',
'components-toolbar__control',
{ 'is-active': grid },
) }
onClick={ toggleLayout }
>
<Dashicon icon="grid-view" />
</Button>
</Tooltip>
</Toolbar>
</BlockControls>,
<InspectorControls>
<PanelBody
title={ __( 'Posts Grid Settings' ) }
>
{ ( grid ) && (
<RangeControl
label={ __( 'Columns' ) }
value={ columns }
onChange={ changeColumns}
min={ 1 }
max={ 5 }
>
</RangeControl>
) }
<QueryControls
{ ...{ order, orderBy } }
numberOfItems={ postsToShow }
categoriesList={ categoriesList }
selectedCategoryId={ categories }
onOrderChange={ ( value ) => setAttributes({ order: value }) }
onOrderByChange={ ( value ) => setAttributes({ orderBy: value }) }
onCategoryChange={ ( value ) => setAttributes({ categories: '' !== value ? value : undefined }) }
onNumberOfItemsChange={ ( value ) => setAttributes({ postsToShow: value }) }
/>
<ToggleControl
label={ __( 'Display Featured Image?' ) }
checked={ displayFeaturedImage }
onChange={ toggleFeaturedImage }
/>
<ToggleControl
label={ __( 'Display Post Category?' ) }
checked={ displayCategory }
onChange={ toggleDisplayCategory }
/>
<ToggleControl
label={ __( 'Display Post Date?' ) }
checked={ displayDate }
onChange={ toggleDisplayDate }
/>
<ToggleControl
label={ __( 'Display Post Author?' ) }
checked={ displayAuthor }
onChange={ toggleDisplayAuthor }
/>
<TextControl
label={ __( 'Description Character Limit' ) }
type="number"
value={ excerptLength }
onChange={ onExcerptLength }
/>
</PanelBody>
</InspectorControls>,
<div className={ classnames(
className,
{ 'is-grid': grid },
) }>
{ posts.map( post => {
let category, author;
if ( categoriesList ) {
category = categoriesList.find( item => item.id === post.categories[0]);
}
if ( authors ) {
author = authors.find( item => item.id === post.author );
}
return (
<div className={ `grid-post grid-${ columns }` }>
<div className="grid-post-row">
{ ( 0 !== post.featured_media && displayFeaturedImage ) &&
<div className="grid-image-area" >
<Thumbnail id={ post.featured_media } link={ post.link } />
</div>
}
<div className={ `grid-content-area ${ ! displayFeaturedImage && 'full' }` }>
{ ( displayCategory && categoriesList ) && (
<h6 className="grid-content-category">
<a href={ category.link }>{ category.name }</a>
</h6>
) }
<h3 className="grid-content-title">
<a href={ post.link }>
{ post.title.rendered }
</a>
</h3>
{ ( displayDate || displayAuthor ) && (
<p className="grid-content-meta">
{ ( displayDate ) && [
__( 'on ' ),
<time datetime={ post.date }>{ formatDate( post.date ) }</time>,
' '
] }
{ ( displayAuthor && authors ) && [
__( 'by ' ),
<a href={ author.link }>{ author.name }</a>
] }
</p>
) }
{ ( 0 < excerptLength ) && (
<p className="grid-content-excerpt">
{ unescapeHTML( post.excerpt.rendered ).substring( 0, excerptLength ) + '…' }
</p>
) }
</div>
</div>
</div>
);
}) }
</div>
];
}),
save: () => {
return null;
}
});
wp-content/plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/services/index.js 0000604 00000000176 15115063613 0035266 0 ustar 00 home/xbodynamge/crosstraining /**
* Services Block
*/
import './style.scss';
import './editor.scss';
import './services-block';
import './service-block';
wp-content/plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/plugin-card/index.js 0000604 00000016073 15115064253 0035654 0 ustar 00 home/xbodynamge/crosstraining /**
* WordPress dependencies...
*/
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
const {
Placeholder,
Dashicon,
TextControl,
Spinner,
Button,
Toolbar,
Tooltip
} = wp.components;
const {
compose,
withState
} = wp.compose;
const { BlockControls } = wp.editor;
const { withSelect } = wp.data;
const { ENTER } = wp.keycodes;
const starRating = stars => {
const rating = Math.floor( stars / 10 ) / 2;
const fullStars = Math.floor( rating );
const halfStars = Math.ceil( rating - fullStars );
const emptyStars = 5 - fullStars - halfStars;
const ratings = '<span class="star-full"></span>'.repeat( fullStars ) + '<span class="star-half"></span>'.repeat( halfStars ) + '<span class="star-empty"></span>'.repeat( emptyStars );
return ratings;
};
const unescapeHTML = value => {
const htmlNode = document.createElement( 'div' );
htmlNode.innerHTML = value;
if ( htmlNode.innerText !== undefined ) {
return htmlNode.innerText;
}
return htmlNode.textContent;
};
/**
* Internal dependencies
*/
import './editor.scss';
import './style.scss';
registerBlockType( 'themeisle-blocks/plugin-cards', {
title: __( 'Plugin Card' ),
description: __( 'Plugin Card block lets you display plugins data in your blog posts.' ),
icon: 'admin-plugins',
category: 'themeisle-blocks',
keywords: [
'plugin',
'card',
'orbitfox'
],
attributes: {
slug: {
type: 'string'
},
pluginIcon: {
type: 'string'
},
pluginName: {
type: 'string'
},
pluginAuthor: {
type: 'string'
},
pluginRating: {
type: 'number'
},
pluginDescription: {
type: 'string'
},
pluginInstalls: {
type: 'number'
},
pluginVersion: {
type: 'string'
},
pluginTested: {
type: 'string'
},
pluginLink: {
type: 'string'
}
},
supports: {
html: false,
align: [ 'left', 'center', 'right' ]
},
edit: compose([
withSelect( ( select, props ) => {
return {
props
};
}),
withState({
status: 0,
results: {}
})
])( ({ props, className, status, results, setState }) => {
const changeSlug = ( value ) => {
props.setAttributes({ slug: value });
};
const searchPlugins = ( search ) => {
setState({ status: 1 });
wp.apiFetch({ path: `themeisle-gutenberg-blocks/v1/get_plugins?search='${ encodeURIComponent( search ) }` }).then( payload => {
const data = payload.data.plugins;
setState({
status: 0,
results: data
});
});
};
const selectPlugin = ( data ) => {
let icon;
if ( data.icons.svg ) {
icon = data.icons.svg;
} if ( data.icons['2x']) {
icon = data.icons['2x'];
} if ( data.icons['1x']) {
icon = data.icons['1x'];
} if ( data.icons.default ) {
icon = data.icons.default;
}
props.setAttributes({
slug: data.slug,
pluginIcon: icon,
pluginName: data.name,
pluginAuthor: data.author,
pluginRating: data.rating,
pluginDescription: data.short_description,
pluginInstalls: data.active_installs,
pluginVersion: data.version,
pluginTested: data.tested,
pluginLink: data.download_link
});
setState({
results: {}
});
};
return [
( props.attributes.pluginName ) && (
<BlockControls key="toolbar-controls">
<Toolbar
className='components-toolbar'
>
<Tooltip text={ __( 'Edit Plugin Card' ) }>
<Button
className="components-icon-button components-toolbar__control edit-plugin-card"
onClick={ () => {
props.setAttributes({
pluginIcon: '',
pluginName: '',
pluginAuthor: '',
pluginRating: '',
pluginDescription: '',
pluginInstalls: '',
pluginVersion: '',
pluginTested: '',
pluginLink: ''
});
} }
>
<Dashicon icon="edit" />
</Button>
</Tooltip>
</Toolbar>
</BlockControls>
),
<div className={ `${ className }` }>
{ ( props.attributes.pluginName ) ?
<div class="themeisle-plugin-card">
<div class="card-header">
<div class="card-main">
<div class="card-logo">
<img src={ props.attributes.pluginIcon } alt={ unescapeHTML( props.attributes.pluginName ) } title={ unescapeHTML( props.attributes.pluginName ) }/>
</div>
<div class="card-info">
<h4>{ unescapeHTML( props.attributes.pluginName ) }</h4>
<h5 dangerouslySetInnerHTML={ { __html: _.unescape( props.attributes.pluginAuthor ) } }></h5>
</div>
<div class={ 'card-ratings' } dangerouslySetInnerHTML={ { __html: _.unescape( starRating( props.attributes.pluginRating ) ) } }></div>
</div>
</div>
<div class="card-details">
<div class="card-description">{ unescapeHTML( props.attributes.pluginDescription ) }</div>
<div class="card-stats">
<h5>{__( 'Plugin Stats' ) }</h5>
<div class="card-stats-list">
<div class="card-stat">
<span class="card-text-large">{ props.attributes.pluginInstalls.toLocaleString() }+</span>
{ __( 'active installs' ) }
</div>
<div class="card-stat">
<span class="card-text-large">{ props.attributes.pluginVersion }</span>
{ __( 'version' ) }
</div>
<div class="card-stat">
<span class="card-text-large">{ props.attributes.pluginTested }</span>
{ __( 'tested up to' ) }
</div>
</div>
</div>
</div>
<div class="card-download">
<a href={ props.attributes.pluginLink }>{ __( 'Download' ) }</a>
</div>
</div> :
<Placeholder
icon="admin-plugins"
label={ __( 'Plugin Card' ) }
>
<div className="search-plugin-field">
<Dashicon icon="search" />
{ 1 === status && (
<Spinner/>
) }
<TextControl
type="text"
placeholder={ __( 'Search for plugin…' ) }
value={ props.attributes.slug }
onChange={ changeSlug }
onKeyDown={ ( event ) => {
if ( event.keyCode === ENTER ) {
searchPlugins( event.target.value );
}
}}
/>
{ results && (
<div className="plugin-card-search-results">
<div>
{ Object.keys( results ).map( ( i, j ) => {
const pluginData = results[i];
let icon;
if ( pluginData.icons.svg ) {
icon = pluginData.icons.svg;
} if ( pluginData.icons['2x']) {
icon = pluginData.icons['2x'];
} if ( pluginData.icons['1x']) {
icon = pluginData.icons['1x'];
} if ( pluginData.icons.default ) {
icon = pluginData.icons.default;
}
return (
<div className="plugin-card-list-item" key={i} onClick={ ( e ) => {
e.preventDefault();
selectPlugin( pluginData );
} }>
<img src={ icon } />
<span dangerouslySetInnerHTML={ { __html: _.unescape( pluginData.name ) } }></span>
</div>
);
}) }
</div>
</div>
) }
</div>
</Placeholder>
}
</div>
];
}),
save: () => {
return null;
}
});
plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/accordion-box/index.js 0000644 00000000207 15115072006 0034056 0 ustar 00 home/xbodynamge/dev/wp-content /**
* Accordion Block
*/
import './style.scss';
import './editor.scss';
import './accordion-area.js';
import './accordion-block.js';
wp-content/plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/tweetable/index.js 0000644 00000011444 15115072043 0033311 0 ustar 00 home/xbodynamge/dev /**
* WordPress dependencies.
*/
const { __ } = wp.i18n;
const { get } = lodash;
const {
registerBlockType,
createBlock
} = wp.blocks;
const {
Toolbar,
TextControl
} = wp.components;
const { BlockControls } = wp.editor;
const { withSelect } = wp.data;
const { RichText } = wp.editor;
/**
* Internal dependencies
*/
import './editor.scss';
import './style.scss';
registerBlockType( 'themeisle-blocks/tweetable', {
title: __( 'Click To Tweet' ),
description: __( 'Click to Tweet allows visitors to easily share your content on Twitter.' ),
icon: 'twitter',
category: 'themeisle-blocks',
keywords: [
__( 'twitter' ),
__( 'tweet' ),
__( 'orbitfox' )
],
attributes: {
quote: {
type: 'string',
source: 'children',
selector: 'p',
default: []
},
permalink: {
type: 'url'
},
via: {
type: 'string'
},
buttonText: {
type: 'string',
default: __( 'Click to Tweet' )
}
},
transforms: {
from: [
{
type: 'block',
blocks: [ 'core/paragraph' ],
transform: ({ content }) => {
return createBlock( 'themeisle-blocks/tweetable', { quote: content });
}
},
{
type: 'block',
blocks: [ 'core/quote' ],
transform: ({ value, citation }) => {
if ( ( ! value || ! value.length ) && ! citation ) {
return createBlock( 'themeisle-blocks/tweetable' );
}
return ( value || []).map( item => createBlock( 'themeisle-blocks/tweetable', {
quote: [ get( item, 'children.props.children', '' ) ]
}) ).concat( citation ? createBlock( 'core/paragraph', {
content: citation
}) : []);
}
},
{
type: 'block',
blocks: [ 'core/pullquote' ],
transform: ({ value, citation }) => {
if ( ( ! value || ! value.length ) && ! citation ) {
return createBlock( 'themeisle-blocks/tweetable' );
}
return ( value || []).map( item => createBlock( 'themeisle-blocks/tweetable', {
quote: [ get( item, 'children.props.children', '' ) ]
}) ).concat( citation ? createBlock( 'core/paragraph', {
quote: citation
}) : []);
}
}
],
to: [
{
type: 'block',
blocks: [ 'core/paragraph' ],
transform: ({ content, quote }) => {
if ( ! quote || ! quote.length ) {
return createBlock( 'core/paragraph' );
}
return ( quote || []).map( item => createBlock( 'core/paragraph', {
content: quote
}) );
}
},
{
type: 'block',
blocks: [ 'core/quote' ],
transform: ({ quote }) => {
return createBlock( 'core/quote', {
value: [
{ children: <p key="1">{ quote }</p> }
]
});
}
},
{
type: 'block',
blocks: [ 'core/pullquote' ],
transform: ({ quote }) => {
return createBlock( 'core/pullquote', {
value: [
{ children: <p key="1">{ quote }</p> }
]
});
}
}
]
},
edit: withSelect( ( select, props ) => {
const { getPermalink } = select( 'core/editor' );
if ( props.attributes.permalink === undefined ) {
props.setAttributes({ permalink: getPermalink() });
}
return {
permalink: getPermalink(),
props
};
})( ({ props, className }) => {
const onChangeQuote = ( value ) => {
props.setAttributes({ quote: value });
};
const onChangeButton = ( value ) => {
props.setAttributes({ buttonText: value });
};
const onChangeVia = ( value ) => {
props.setAttributes({ via: value });
};
return [
<BlockControls key="controls">
<Toolbar>
<i className="fas fa-at tweetable-icon"></i>
<TextControl
type="text"
placeholder="Username"
className="tweetable-controls"
value={ props.attributes.via }
onChange={ onChangeVia }
/>
</Toolbar>
</BlockControls>,
<blockquote className={ className }>
<RichText
tagName="p"
multiline="false"
placeholder={ __( 'What should we tweet?' ) }
value={ props.attributes.quote }
formattingControls={ [] }
onChange={ onChangeQuote }
keepPlaceholderOnFocus
/>
<RichText
tagName="span"
placeholder={ __( 'Tweet this!' ) }
className="tweetbutton"
value={ props.attributes.buttonText ? props.attributes.buttonText : __( 'Tweet this!' ) }
formattingControls={ [] }
onChange={ onChangeButton }
keepPlaceholderOnFocus
/>
</blockquote>
];
}),
save: props => {
const viaUrl = props.attributes.via ? `&via=${ props.attributes.via }` : '';
const tweetUrl = `http://twitter.com/share?&text=${ encodeURIComponent( props.attributes.quote ) }&url=${ props.attributes.permalink }${ viaUrl }`;
return (
<blockquote>
<RichText.Content
tagName="p"
value={ props.attributes.quote }
/>
<RichText.Content
tagName="a"
className="tweetbutton"
href={ tweetUrl }
value={ props.attributes.buttonText }
target="_blank"
/>
</blockquote>
);
}
});
dev/wp-content/plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/chart/index.js 0000644 00000001523 15115072564 0032443 0 ustar 00 home/xbodynamge /**
* External dependencies
*/
import Editor from './Editor.js';
/**
* WordPress dependencies.
*/
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
/**
* Internal dependencies
*/
import './editor.scss';
registerBlockType( 'themeisle-blocks/chart-pie', {
title: __( 'Pie Chart' ),
description: __( 'Display a beautiful Pie Chart on your blog post with Pie Chart block.' ),
icon: 'chart-pie',
category: 'themeisle-blocks',
keywords: [
__( 'pie' ),
__( 'chart' ),
__( 'orbitfox' )
],
attributes: {
data: {
type: 'string',
default: '[["Label","Data"],["Dogs",40],["Cats",30],["Racoons",20],["Monkeys",10]]'
},
options: {
type: 'object',
default: {
title: 'Animals',
is3D: true
}
},
id: {
type: 'string',
default: ''
}
},
edit: Editor,
save: () => {
return null;
}
});
wp-content/plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/testimonials/index.js0000604 00000000212 15115140657 0036151 0 ustar 00 home/xbodynamge/crosstraining /**
* Testimonials Block
*/
import './style.scss';
import './editor.scss';
import './testimonials-area';
import './testimonials-block';
wp-content/plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/google-map/index.js 0000604 00000012736 15115140777 0035506 0 ustar 00 home/xbodynamge/crosstraining /**
* WordPress dependencies...
*/
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
const {
Button,
PanelBody,
Placeholder,
RangeControl,
SelectControl,
Spinner,
TextControl
} = wp.components;
const {
compose,
withState
} = wp.compose;
const { withSelect } = wp.data;
const { InspectorControls } = wp.editor;
/**
* Internal dependencies
*/
import './editor.scss';
registerBlockType( 'themeisle-blocks/google-map', {
title: __( 'Google Map' ),
description: __( 'Display a Google Map on your website with Google Map block.' ),
icon: 'admin-site',
category: 'themeisle-blocks',
keywords: [
'map',
'google',
'orbitfox'
],
attributes: {
location: {
type: 'string'
},
type: {
type: 'string',
default: 'roadmap'
},
zoom: {
type: 'number',
default: 10
},
height: {
type: 'string',
default: '400px'
}
},
supports: {
html: false
},
edit: compose([
withSelect( ( select, props ) => {
return {
props
};
}),
withState({
api: '',
isAPILoaded: false,
isAPISaved: false,
isSaving: false
})
])( ({ props, className, api, isAPILoaded, isAPISaved, isSaving, setState }) => {
let settings;
wp.api.loadPromise.then( () => {
settings = new wp.api.models.Settings();
});
if ( false === isAPILoaded ) {
settings.fetch().then( response => {
setState({
api: response.themeisle_google_map_block_api_key,
isAPILoaded: true
});
if ( '' !== response.themeisle_google_map_block_api_key ) {
setState({
isAPISaved: true
});
}
});
}
const changeAPI = ( value ) => {
setState({
api: value
});
};
const saveAPIKey = () => {
setState({
isSaving: true
});
const model = new wp.api.models.Settings({
// eslint-disable-next-line camelcase
themeisle_google_map_block_api_key: api
});
model.save().then( response => {
settings.fetch();
setState({
isSaving: false,
isAPISaved: true
});
});
};
const changeLocation = ( value ) => {
props.setAttributes({ location: value });
};
const changeMapType = ( value ) => {
props.setAttributes({ type: value });
};
const changeZoom = ( value ) => {
props.setAttributes({ zoom: value });
};
const changeHeight = ( value ) => {
props.setAttributes({ height: value });
};
if ( ! isAPILoaded ) {
return (
<Placeholder>
<Spinner></Spinner>
{ __( 'Loading…' ) }
</Placeholder>
);
}
if ( ! isAPISaved ) {
return (
<div className={ className }>
<Placeholder
icon="admin-site"
label={ __( 'Google Maps' ) }
instructions={ __( 'A Google Maps API key is required, please enter one below.' ) }
>
<TextControl
type="text"
placeholder={ __( 'Google Maps API Key' ) }
value={ api }
className="components-placeholder__input"
onChange={ changeAPI }
/>
<Button
isLarge
type="submit"
onClick={ saveAPIKey }
isBusy={ isSaving }
disabled={ '' === api}
>
{ __( 'Save API Key' ) }
</Button>
<div class="components-placeholder__instructions">
{ __( 'Need an API key? Get one' ) }
<a target="_blank" href="https://console.developers.google.com/flows/enableapi?apiid=maps_backend,static_maps_backend,maps_embed_backend&keyType=CLIENT_SIDE&reusekey=true">
{ __( ' here.' ) }
</a>
</div>
</Placeholder>
</div>
);
}
return [
<InspectorControls>
<PanelBody
title={ __( 'Map Settings' ) }
>
<SelectControl
label={ __( 'Map Type' ) }
value={ props.attributes.type }
options={ [
{ label: __( 'Road Map' ), value: 'roadmap' },
{ label: __( 'Satellite View' ), value: 'satellite' }
] }
onChange={ changeMapType }
/>
<RangeControl
label={ __( 'Map Zoom Level' ) }
value={ props.attributes.zoom }
onChange={ changeZoom }
min={ 0 }
max={ 21 }
/>
<TextControl
label={ __( 'Map Height' ) }
type="text"
value={ props.attributes.height }
onChange={ changeHeight }
/>
</PanelBody>
<PanelBody
title={ __( 'Global Settings' ) }
initialOpen={ false }
>
<TextControl
label={ __( 'Google Maps API Key' ) }
type="text"
placeholder={ __( 'Google Maps API Key' ) }
value={ api }
className="components-placeholder__input"
onChange={ changeAPI }
help={ __( 'Changing the API key effects all Google Map Embed blocks.' ) }
/>
<Button
isLarge
type="submit"
onClick={ saveAPIKey }
isBusy={ isSaving }
disabled={ '' === api}
>
{ __( 'Save API Key' ) }
</Button>
</PanelBody>
</InspectorControls>,
<TextControl
type="text"
placeholder={ __( 'Enter a location…' ) }
value={ props.attributes.location }
onChange={ changeLocation }
/>,
( props.attributes.location ) && (
<div className={ `${ className } interactive` }>
<div className="map" >
<iframe
width="100%"
height="100%"
frameBorder="0"
style={ {
border: 0,
height: props.attributes.height
} }
src={ `https://www.google.com/maps/embed/v1/place?key=${ api }&q=${ props.attributes.location }&maptype=${ props.attributes.type }&zoom=${ props.attributes.zoom }` }
allowFullScreen={ true }>
>
</iframe>
</div>
</div>
)
];
}),
save: () => {
return null;
}
});
themeisle-companion/vendor/codeinwp/gutenberg-blocks/src/components/google-fonts-control/index.js 0000644 00000013454 15115141064 0041022 0 ustar 00 home/xbodynamge/lebauwcentre/wp-content/plugins /**
* External dependencies
*/
import classnames from 'classnames';
/**
* WordPress dependencies
*/
const {
startCase,
toLower
} = lodash;
const { __ } = wp.i18n;
const { withInstanceId } = wp.compose;
const {
Button,
BaseControl,
Dropdown,
MenuGroup,
MenuItem,
SelectControl,
TextControl
} = wp.components;
const { Component } = wp.element;
/**
* Internal dependencies
*/
import './editor.scss';
class GoogleFontsControl extends Component {
constructor() {
super( ...arguments );
this.state = {
fonts: null,
font: [],
variants: null,
search: ''
};
}
async componentDidMount() {
await fetch( 'https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyClGdkPJ1BvgLOol5JAkQY4Mv2lkLYu00k' )
.then( blob => blob.json() )
.then( data => {
this.setState({ fonts: data.items });
if ( this.props.value ) {
data.items.find( i => {
if ( this.props.value === i.family ) {
const variants = ( i.variants )
.filter( o => false === o.includes( 'italic' ) )
.map( o => {
return o = {
'label': startCase( toLower( o ) ),
'value': o
};
});
return this.setState({ variants });
}
});
}
});
}
render() {
const id = `inspector-google-fonts-control-${ this.props.instanceId }`;
return (
<div className="wp-block-themeisle-blocks-google-fonts-control" >
<BaseControl
label={ this.props.label }
id={ id }
>
{( null !== this.state.fonts ) ? (
( this.props.isSelect ) ? (
<SelectControl
value={ this.props.value || '' }
id={ id }
options={ [
{
label: __( 'Default' ),
value: ''
},
...this.state.fonts.map( i => {
return i = {
label: i.family,
value: i.family
};
})
] }
onChange={ e => {
this.props.onChangeFontFamily( e );
this.props.onChangeFontVariant( 'regular' );
const font = this.state.fonts.find( i => e === i.family );
const variants = ( font.variants )
.filter( o => false === o.includes( 'italic' ) )
.map( o => {
return o = {
'label': startCase( toLower( o ) ),
'value': o
};
});
this.setState({
font,
variants
});
} }
/>
) : (
<Dropdown
contentClassName="wp-block-themeisle-blocks-google-fonts-popover"
position="bottom center"
renderToggle={ ({ isOpen, onToggle }) => (
<Button
isLarge
className="wp-block-themeisle-blocks-google-fonts-button"
id={ id }
onClick={ onToggle }
aria-expanded={ isOpen }
>
{ this.props.value ? this.props.value : __( 'Select Font Family' ) }
</Button>
) }
renderContent={ ({ onToggle }) => (
<MenuGroup label={ __( 'Google Fonts' ) }>
<TextControl
value={ this.state.search }
onChange={ e => this.setState({ search: e }) }
/>
<div className="components-popover__items">
<MenuItem
onClick={ () => {
onToggle();
this.props.onChangeFontFamily( '' );
this.setState({
font: [],
variants: [],
search: ''
});
}}
>
{ __( 'Default' ) }
</MenuItem>
{ ( this.state.fonts ).map( i => {
if ( ! this.state.search || i.family.toLowerCase().includes( this.state.search.toLowerCase() ) ) {
return (
<MenuItem
className={ classnames(
{ 'is-selected': ( i.family === this.props.value ) }
) }
onClick={ () => {
onToggle();
this.props.onChangeFontFamily( i.family );
this.props.onChangeFontVariant( 'regular' );
const variants = ( i.variants )
.filter( o => false === o.includes( 'italic' ) )
.map( o => {
return o = {
'label': startCase( toLower( o ) ),
'value': o
};
});
this.setState({
font: i,
variants,
search: ''
});
}}
>
{ i.family }
</MenuItem>
);
}
}) }
</div>
</MenuGroup>
) }
/>
)
) : (
__( 'Loading…' )
) }
</BaseControl>
{ this.state.variants && (
<SelectControl
label={ __( 'Font Width' ) }
value={ this.props.valueVariant || 'regular' }
options={ this.state.variants }
onChange={ this.props.onChangeFontVariant }
/>
) }
<SelectControl
label={ __( 'Font Style' ) }
value={ this.props.valueStyle }
options={ [
{
label: __( 'Regular' ),
value: 'normal'
},
{
label: __( 'Italic' ),
value: 'italic'
}
] }
onChange={ this.props.onChangeFontStyle }
/>
{ ! this.props.disableTransform && (
<SelectControl
label={ __( 'Font Transform' ) }
value={ this.props.valueTransform }
options={ [
{
label: __( 'Default' ),
value: 'none'
},
{
label: __( 'Uppercase' ),
value: 'uppercase'
},
{
label: __( 'Lowercase' ),
value: 'lowercase'
},
{
label: __( 'Capitalize' ),
value: 'capitalize'
}
] }
onChange={ this.props.onChangeTextTransform }
/>
) }
</div>
);
}
}
export default withInstanceId( GoogleFontsControl );
wp-content/plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/tweetable/index.js 0000604 00000011444 15115141301 0035406 0 ustar 00 home/xbodynamge/crosstraining /**
* WordPress dependencies.
*/
const { __ } = wp.i18n;
const { get } = lodash;
const {
registerBlockType,
createBlock
} = wp.blocks;
const {
Toolbar,
TextControl
} = wp.components;
const { BlockControls } = wp.editor;
const { withSelect } = wp.data;
const { RichText } = wp.editor;
/**
* Internal dependencies
*/
import './editor.scss';
import './style.scss';
registerBlockType( 'themeisle-blocks/tweetable', {
title: __( 'Click To Tweet' ),
description: __( 'Click to Tweet allows visitors to easily share your content on Twitter.' ),
icon: 'twitter',
category: 'themeisle-blocks',
keywords: [
__( 'twitter' ),
__( 'tweet' ),
__( 'orbitfox' )
],
attributes: {
quote: {
type: 'string',
source: 'children',
selector: 'p',
default: []
},
permalink: {
type: 'url'
},
via: {
type: 'string'
},
buttonText: {
type: 'string',
default: __( 'Click to Tweet' )
}
},
transforms: {
from: [
{
type: 'block',
blocks: [ 'core/paragraph' ],
transform: ({ content }) => {
return createBlock( 'themeisle-blocks/tweetable', { quote: content });
}
},
{
type: 'block',
blocks: [ 'core/quote' ],
transform: ({ value, citation }) => {
if ( ( ! value || ! value.length ) && ! citation ) {
return createBlock( 'themeisle-blocks/tweetable' );
}
return ( value || []).map( item => createBlock( 'themeisle-blocks/tweetable', {
quote: [ get( item, 'children.props.children', '' ) ]
}) ).concat( citation ? createBlock( 'core/paragraph', {
content: citation
}) : []);
}
},
{
type: 'block',
blocks: [ 'core/pullquote' ],
transform: ({ value, citation }) => {
if ( ( ! value || ! value.length ) && ! citation ) {
return createBlock( 'themeisle-blocks/tweetable' );
}
return ( value || []).map( item => createBlock( 'themeisle-blocks/tweetable', {
quote: [ get( item, 'children.props.children', '' ) ]
}) ).concat( citation ? createBlock( 'core/paragraph', {
quote: citation
}) : []);
}
}
],
to: [
{
type: 'block',
blocks: [ 'core/paragraph' ],
transform: ({ content, quote }) => {
if ( ! quote || ! quote.length ) {
return createBlock( 'core/paragraph' );
}
return ( quote || []).map( item => createBlock( 'core/paragraph', {
content: quote
}) );
}
},
{
type: 'block',
blocks: [ 'core/quote' ],
transform: ({ quote }) => {
return createBlock( 'core/quote', {
value: [
{ children: <p key="1">{ quote }</p> }
]
});
}
},
{
type: 'block',
blocks: [ 'core/pullquote' ],
transform: ({ quote }) => {
return createBlock( 'core/pullquote', {
value: [
{ children: <p key="1">{ quote }</p> }
]
});
}
}
]
},
edit: withSelect( ( select, props ) => {
const { getPermalink } = select( 'core/editor' );
if ( props.attributes.permalink === undefined ) {
props.setAttributes({ permalink: getPermalink() });
}
return {
permalink: getPermalink(),
props
};
})( ({ props, className }) => {
const onChangeQuote = ( value ) => {
props.setAttributes({ quote: value });
};
const onChangeButton = ( value ) => {
props.setAttributes({ buttonText: value });
};
const onChangeVia = ( value ) => {
props.setAttributes({ via: value });
};
return [
<BlockControls key="controls">
<Toolbar>
<i className="fas fa-at tweetable-icon"></i>
<TextControl
type="text"
placeholder="Username"
className="tweetable-controls"
value={ props.attributes.via }
onChange={ onChangeVia }
/>
</Toolbar>
</BlockControls>,
<blockquote className={ className }>
<RichText
tagName="p"
multiline="false"
placeholder={ __( 'What should we tweet?' ) }
value={ props.attributes.quote }
formattingControls={ [] }
onChange={ onChangeQuote }
keepPlaceholderOnFocus
/>
<RichText
tagName="span"
placeholder={ __( 'Tweet this!' ) }
className="tweetbutton"
value={ props.attributes.buttonText ? props.attributes.buttonText : __( 'Tweet this!' ) }
formattingControls={ [] }
onChange={ onChangeButton }
keepPlaceholderOnFocus
/>
</blockquote>
];
}),
save: props => {
const viaUrl = props.attributes.via ? `&via=${ props.attributes.via }` : '';
const tweetUrl = `http://twitter.com/share?&text=${ encodeURIComponent( props.attributes.quote ) }&url=${ props.attributes.permalink }${ viaUrl }`;
return (
<blockquote>
<RichText.Content
tagName="p"
value={ props.attributes.quote }
/>
<RichText.Content
tagName="a"
className="tweetbutton"
href={ tweetUrl }
value={ props.attributes.buttonText }
target="_blank"
/>
</blockquote>
);
}
});
wp-content/plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/about-author/index.js0000644 00000003612 15115332753 0033754 0 ustar 00 home/xbodynamge/dev /**
* WordPress dependencies...
*/
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
const {
compose,
withState
} = wp.compose;
const { Spinner } = wp.components;
const { withSelect } = wp.data;
/**
* Internal dependencies
*/
import './editor.scss';
import './style.scss';
registerBlockType( 'themeisle-blocks/about-author', {
title: __( 'About Author' ),
description: __( 'About Author block is the easiest way to add a author bio below your posts.' ),
icon: 'admin-users',
category: 'themeisle-blocks',
keywords: [
'about',
'author',
'profile'
],
attributes: {
id: {
type: 'number'
}
},
supports: {
html: false
},
edit: compose([
withSelect( ( select, props ) => {
return {
postAuthor: select( 'core/editor' ).getEditedPostAttribute( 'author' ),
authors: select( 'core' ).getAuthors(),
props
};
}),
withState({
status: 0,
authorDetails: {}
})
])( ({ postAuthor, authors, status, authorDetails, setState, props, className }) => {
if ( 0 === status && postAuthor && authors && postAuthor !== props.attributes.id ) {
authors.find( ( o ) => {
if ( o.id === postAuthor ) {
props.setAttributes({ id: o.id });
setState({
authorDetails: o,
status: 1
});
return o.id === postAuthor;
}
});
}
return (
( 1 === status && postAuthor && authors ) ? (
<section className={ className }>
<div className="themeisle-author-image">
<img className="author-image" src={ authorDetails.avatar_urls[ '96' ] } alt={ authorDetails.name }/>
</div>
<div className="themeisle-author-data">
<h4>{ authorDetails.name }</h4>
<p>{ authorDetails.description }</p>
</div>
</section>
) : (
<div key="loading" className="wp-block-embed is-loading">
<Spinner />
<p>{ __( 'Loading…' ) }</p>
</div>
)
);
}),
save: () => {
return null;
}
});
plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/font-awesome-icons/index.js 0000644 00000020626 15115333005 0035052 0 ustar 00 home/xbodynamge/dev/wp-content /**
* External dependencies...
*/
import classnames from 'classnames';
import Autosuggest from 'react-autosuggest';
/**
* WordPress dependencies...
*/
const { __ } = wp.i18n;
const {
registerBlockType
} = wp.blocks;
const {
PanelBody,
Spinner,
Placeholder,
RangeControl
} = wp.components;
const {
compose,
withState
} = wp.compose;
const { withSelect } = wp.data;
const {
ContrastChecker,
InspectorControls,
PanelColorSettings
} = wp.editor;
/**
* Internal dependencies
*/
import './style.scss';
import './editor.scss';
registerBlockType( 'themeisle-blocks/font-awesome-icons', {
title: __( 'Font Awesome Icons' ),
description: __( 'Share buttons for your website visitors to share content on any social sharing service.' ),
icon: 'smiley',
category: 'themeisle-blocks',
keywords: [
'font awesome',
'dashicons',
'icons'
],
attributes: {
prefix: {
type: 'string',
default: 'fab'
},
icon: {
type: 'string',
default: 'themeisle'
},
fontSize: {
type: 'number',
default: 16
},
padding: {
type: 'number',
default: 5
},
margin: {
type: 'number',
default: 5
},
backgroundColor: {
type: 'string'
},
textColor: {
type: 'string'
},
borderColor: {
type: 'string'
},
borderSize: {
type: 'number',
default: 0
},
borderRadius: {
type: 'number',
default: 0
}
},
supports: {
align: [ 'left', 'center', 'right' ]
},
edit: compose([
withSelect( ( select, props ) => {
const iconsList = select( 'themeisle-gutenberg/blocks' ).getFaIconsList();
return {
iconsList,
props
};
}),
withState({
suggestions: []
})
])( ({ iconsList, suggestions, setState, props }) => {
const getSuggestions = value => {
const inputValue = value.trim().toLowerCase();
const inputLength = inputValue.length;
return 0 === inputLength ? [] : iconsList.filter( icon =>
icon.name.toLowerCase().slice( 0, inputLength ) === inputValue
);
};
const getSuggestionValue = suggestion => suggestion;
const renderSuggestion = suggestion => {
return (
<div
className={ classnames(
'icon-select',
{ 'selected': ( suggestion.name === props.attributes.icon && suggestion.prefix === props.attributes.prefix ) },
) }
>
<i className={ `${ suggestion.prefix } fa-fw fa-${ suggestion.name }` }></i>
{ suggestion.name }
</div>
);
};
const renderSuggestionsContainer = ({ containerProps, children, query }) => {
return (
<div { ... containerProps }>
{ children }
</div>
);
};
const onSuggestionsFetchRequested = ({ value }) => {
setState({
suggestions: getSuggestions( value )
});
};
const onSuggestionsClearRequested = () => {
setState({
suggestions: []
});
};
const inputProps = {
placeholder: __( 'Start typing, like themeisle…' ),
value: props.attributes.icon,
onChange: ( event, { newValue }) => {
if ( 'object' === typeof newValue ) {
props.setAttributes({
icon: newValue.name,
prefix: newValue.prefix
});
} else {
props.setAttributes({ icon: newValue });
}
}
};
const changeFontSize = ( value ) => {
props.setAttributes({ fontSize: value });
};
const changePadding = ( value ) => {
props.setAttributes({ padding: value });
};
const changeMargin = ( value ) => {
props.setAttributes({ margin: value });
};
const changeBackgroundColor = ( value ) => {
props.setAttributes({ backgroundColor: value });
};
const changeTextColor = ( value ) => {
props.setAttributes({ textColor: value });
};
const changeBorderColor = ( value ) => {
props.setAttributes({ borderColor: value });
};
const changeBorderSize = ( value ) => {
props.setAttributes({ borderSize: value });
};
const changeBorderRadius = ( value ) => {
props.setAttributes({ borderRadius: value });
};
const iconStyle = {
borderRadius: props.attributes.borderRadius + '%',
fontSize: props.attributes.fontSize + 'px',
padding: props.attributes.padding + 'px'
};
const containerStyle = {
color: props.attributes.textColor,
backgroundColor: props.attributes.backgroundColor,
borderColor: props.attributes.borderColor,
borderRadius: props.attributes.borderRadius + '%',
borderStyle: 'solid',
borderWidth: props.attributes.borderSize + 'px',
display: 'inline-block',
margin: props.attributes.margin + 'px'
};
return [
<InspectorControls>
<PanelBody
title={ __( 'Icon Settings' ) }
>
{ iconsList !== undefined && 0 < iconsList.length ?
<div
className="font-awesome-auto-complete"
>
<label>
<i className={ `${ props.attributes.prefix } fa-${ props.attributes.icon }` }></i>
</label>
<Autosuggest
suggestions={ suggestions }
onSuggestionsFetchRequested={ onSuggestionsFetchRequested }
onSuggestionsClearRequested={ onSuggestionsClearRequested }
getSuggestionValue={ getSuggestionValue }
renderSuggestion={ renderSuggestion }
renderSuggestionsContainer={ renderSuggestionsContainer }
inputProps={ inputProps }
/>
</div> :
<Placeholder>
<Spinner />
</Placeholder>
}
</PanelBody>
<PanelBody
title={ __( 'Icon Sizes' ) }
className="blocks-font-size"
initialOpen={ false }
>
<RangeControl
label={ __( 'Text Size' ) }
value={ props.attributes.fontSize || '' }
initialPosition={ 16 }
onChange={ changeFontSize }
min={ 12 }
max={ 140 }
beforeIcon="editor-textcolor"
afterIcon="editor-textcolor"
/>
<RangeControl
label={ __( 'Inner Space' ) }
value={ props.attributes.padding || '' }
initialPosition={ 5 }
onChange={ changePadding }
min={ 0 }
max={ 100 }
beforeIcon="minus"
afterIcon="plus"
/>
<RangeControl
label={ __( 'Outer Space' ) }
value={ props.attributes.margin || '' }
initialPosition={ 5 }
onChange={ changeMargin }
min={ 0 }
max={ 100 }
beforeIcon="minus"
afterIcon="plus"
/>
</PanelBody>
<PanelColorSettings
title={ __( 'Color Settings' ) }
initialOpen={ false }
colorSettings={ [
{
value: props.attributes.backgroundColor,
onChange: changeBackgroundColor,
label: __( 'Background Color' )
},
{
value: props.attributes.textColor,
onChange: changeTextColor,
label: __( 'Text Color' )
},
{
value: props.attributes.borderColor,
onChange: changeBorderColor,
label: __( 'Border Color' )
}
] }
>
<ContrastChecker
{ ...{
textColor: props.attributes.textColor,
backgroundColor: props.attributes.backgroundColor
} }
/>
</PanelColorSettings>
<PanelBody
title={ __( 'Border Settings' ) }
initialOpen={ false }
>
<RangeControl
label={ __( 'Border Size' ) }
value={ props.attributes.borderSize }
onChange={ changeBorderSize }
min={ 0 }
max={ 120 }
beforeIcon="minus"
afterIcon="plus"
/>
<RangeControl
label={ __( 'Border Radius' ) }
value={ props.attributes.borderRadius }
onChange={ changeBorderRadius }
min={ 0 }
max={ 100 }
beforeIcon="grid-view"
afterIcon="marker"
/>
</PanelBody>
</InspectorControls>,
<p className={ props.className } >
<span
className={ `${ props.className }-container` }
style={ containerStyle }
>
<i
className={ `${ props.attributes.prefix } fa-${ props.attributes.icon }` }
style={ iconStyle }
>
</i>
</span>
</p>
];
}),
save: props => {
const iconStyle = {
borderRadius: props.attributes.borderRadius + '%',
fontSize: props.attributes.fontSize + 'px',
padding: props.attributes.padding + 'px'
};
const containerStyle = {
color: props.attributes.textColor,
backgroundColor: props.attributes.backgroundColor,
borderColor: props.attributes.borderColor,
borderRadius: props.attributes.borderRadius + '%',
borderStyle: 'solid',
borderWidth: props.attributes.borderSize + 'px',
display: 'inline-block',
margin: props.attributes.margin + 'px'
};
return (
<p>
<span style={ containerStyle } >
<i
className={ `${ props.attributes.prefix } fa-${ props.attributes.icon }` }
style={ iconStyle }
>
</i>
</span>
</p>
);
}
});
wp-content/plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/post-grid/index.js 0000644 00000020051 15115757037 0033254 0 ustar 00 home/xbodynamge/dev /**
* External dependencies
*/
import classnames from 'classnames';
import Thumbnail from './Thumbnail.js';
/**
* WordPress dependencies...
*/
const { isUndefined, pickBy } = lodash;
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
const {
Button,
Dashicon,
PanelBody,
QueryControls,
RangeControl,
Spinner,
TextControl,
ToggleControl,
Toolbar,
Tooltip
} = wp.components;
const { withSelect } = wp.data;
const {
BlockControls,
InspectorControls
} = wp.editor;
const unescapeHTML = value => {
const htmlNode = document.createElement( 'div' );
htmlNode.innerHTML = value;
if ( htmlNode.innerText !== undefined ) {
return htmlNode.innerText;
}
return htmlNode.textContent;
};
const formatDate = date => {
const monthNames = [
__( 'January' ), __( 'February' ), __( 'March' ),
__( 'April' ), __( 'May' ), __( 'June' ), __( 'July' ),
__( 'August' ), __( 'September' ), __( 'October' ),
__( 'November' ), __( 'December' )
];
const weekNames = [
__( 'Sunday' ), __( 'Monday' ), __( 'Tuesday' ), __( 'Wednesday' ),
__( 'Thursday' ), __( 'Friday' ), __( 'Saturday' )
];
date = new Date( date );
const day = date.getDate();
const monthIndex = date.getMonth();
const year = date.getFullYear();
return day + ' ' + monthNames[monthIndex] + ', ' + year;
};
import './style.scss';
import './editor.scss';
registerBlockType( 'themeisle-blocks/posts-grid', {
title: __( 'Posts Grid' ),
description: __( 'Display a list of your most recent posts in a beautiful grid.' ),
icon: 'screenoptions',
category: 'themeisle-blocks',
keywords: [
'posts',
'grid',
'orbitfox'
],
attributes: {
grid: {
type: 'boolean',
default: false
},
columns: {
type: 'number',
default: 3
},
categories: {
type: 'string'
},
postsToShow: {
type: 'number',
default: 5
},
order: {
type: 'string',
default: 'desc'
},
orderBy: {
type: 'string',
default: 'date'
},
displayFeaturedImage: {
type: 'boolean',
default: true
},
displayCategory: {
type: 'boolean',
default: true
},
displayDate: {
type: 'boolean',
default: true
},
displayAuthor: {
type: 'boolean',
default: true
},
excerptLength: {
type: 'number',
default: 200
}
},
edit: withSelect( ( select, props ) => {
const { categories, order, orderBy, postsToShow } = props.attributes;
const latestPostsQuery = pickBy({
categories,
order,
orderby: orderBy,
per_page: postsToShow // eslint-disable-line camelcase
}, ( value ) => ! isUndefined( value ) );
return {
posts: select( 'core' ).getEntityRecords( 'postType', 'post', latestPostsQuery ),
// eslint-disable-next-line camelcase
categoriesList: select( 'core' ).getEntityRecords( 'taxonomy', 'category', { per_page: 100 }),
authors: select( 'core' ).getAuthors(),
props
};
})( ({ posts, categoriesList, authors, className, setAttributes, props }) => {
if ( ! posts ) {
return (
<p className={ className } >
<Spinner />
{ __( 'Loading Posts' ) }
</p>
);
}
if ( 0 === posts.length ) {
return <p>{ __( 'No Posts' ) }</p>;
}
const {
grid,
columns,
order,
orderBy,
categories,
postsToShow,
displayFeaturedImage,
displayCategory,
displayDate,
displayAuthor,
excerptLength
} = props.attributes;
const toggleLayout = () => {
props.setAttributes({ grid: ! grid });
};
const changeColumns = value => {
props.setAttributes({ columns: value});
};
const toggleFeaturedImage = () => {
props.setAttributes({ displayFeaturedImage: ! displayFeaturedImage });
};
const toggleDisplayCategory = () => {
props.setAttributes({ displayCategory: ! displayCategory });
};
const toggleDisplayDate = () => {
props.setAttributes({ displayDate: ! displayDate });
};
const toggleDisplayAuthor = () => {
props.setAttributes({ displayAuthor: ! displayAuthor });
};
const onExcerptLength = value => {
props.setAttributes({ excerptLength: value });
};
return [
<BlockControls key="toolbar-controls">
<Toolbar
className='components-toolbar'
>
<Tooltip text={ __( 'List Layout' ) }>
<Button
className={ classnames(
'components-icon-button',
'components-toolbar__control',
{ 'is-active': ! grid },
) }
onClick={ toggleLayout }
>
<Dashicon icon="list-view" />
</Button>
</Tooltip>
<Tooltip text={ __( 'Grid Layout' ) }>
<Button
className={ classnames(
'components-icon-button',
'components-toolbar__control',
{ 'is-active': grid },
) }
onClick={ toggleLayout }
>
<Dashicon icon="grid-view" />
</Button>
</Tooltip>
</Toolbar>
</BlockControls>,
<InspectorControls>
<PanelBody
title={ __( 'Posts Grid Settings' ) }
>
{ ( grid ) && (
<RangeControl
label={ __( 'Columns' ) }
value={ columns }
onChange={ changeColumns}
min={ 1 }
max={ 5 }
>
</RangeControl>
) }
<QueryControls
{ ...{ order, orderBy } }
numberOfItems={ postsToShow }
categoriesList={ categoriesList }
selectedCategoryId={ categories }
onOrderChange={ ( value ) => setAttributes({ order: value }) }
onOrderByChange={ ( value ) => setAttributes({ orderBy: value }) }
onCategoryChange={ ( value ) => setAttributes({ categories: '' !== value ? value : undefined }) }
onNumberOfItemsChange={ ( value ) => setAttributes({ postsToShow: value }) }
/>
<ToggleControl
label={ __( 'Display Featured Image?' ) }
checked={ displayFeaturedImage }
onChange={ toggleFeaturedImage }
/>
<ToggleControl
label={ __( 'Display Post Category?' ) }
checked={ displayCategory }
onChange={ toggleDisplayCategory }
/>
<ToggleControl
label={ __( 'Display Post Date?' ) }
checked={ displayDate }
onChange={ toggleDisplayDate }
/>
<ToggleControl
label={ __( 'Display Post Author?' ) }
checked={ displayAuthor }
onChange={ toggleDisplayAuthor }
/>
<TextControl
label={ __( 'Description Character Limit' ) }
type="number"
value={ excerptLength }
onChange={ onExcerptLength }
/>
</PanelBody>
</InspectorControls>,
<div className={ classnames(
className,
{ 'is-grid': grid },
) }>
{ posts.map( post => {
let category, author;
if ( categoriesList ) {
category = categoriesList.find( item => item.id === post.categories[0]);
}
if ( authors ) {
author = authors.find( item => item.id === post.author );
}
return (
<div className={ `grid-post grid-${ columns }` }>
<div className="grid-post-row">
{ ( 0 !== post.featured_media && displayFeaturedImage ) &&
<div className="grid-image-area" >
<Thumbnail id={ post.featured_media } link={ post.link } />
</div>
}
<div className={ `grid-content-area ${ ! displayFeaturedImage && 'full' }` }>
{ ( displayCategory && categoriesList ) && (
<h6 className="grid-content-category">
<a href={ category.link }>{ category.name }</a>
</h6>
) }
<h3 className="grid-content-title">
<a href={ post.link }>
{ post.title.rendered }
</a>
</h3>
{ ( displayDate || displayAuthor ) && (
<p className="grid-content-meta">
{ ( displayDate ) && [
__( 'on ' ),
<time datetime={ post.date }>{ formatDate( post.date ) }</time>,
' '
] }
{ ( displayAuthor && authors ) && [
__( 'by ' ),
<a href={ author.link }>{ author.name }</a>
] }
</p>
) }
{ ( 0 < excerptLength ) && (
<p className="grid-content-excerpt">
{ unescapeHTML( post.excerpt.rendered ).substring( 0, excerptLength ) + '…' }
</p>
) }
</div>
</div>
</div>
);
}) }
</div>
];
}),
save: () => {
return null;
}
});
plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/src/blocks/about-author/index.js 0000644 00000003715 15115757433 0035771 0 ustar 00 home/xbodynamge/namtation/wp-content /**
* WordPress dependencies
*/
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
const {
compose,
withState
} = wp.compose;
const { Spinner } = wp.components;
const { withSelect } = wp.data;
/**
* Internal dependencies
*/
import './editor.scss';
import './style.scss';
import { authorIcon } from '../../helpers/icons.js';
registerBlockType( 'themeisle-blocks/about-author', {
title: __( 'About Author' ),
description: __( 'About Author block is the easiest way to add a author bio below your posts.' ),
icon: authorIcon,
category: 'themeisle-blocks',
keywords: [
'about',
'author',
'profile'
],
attributes: {
id: {
type: 'number'
}
},
supports: {
html: false
},
edit: compose([
withSelect( ( select, props ) => {
return {
postAuthor: select( 'core/editor' ).getEditedPostAttribute( 'author' ),
authors: select( 'core' ).getAuthors(),
props
};
}),
withState({
status: 0,
authorDetails: {}
})
])( ({ postAuthor, authors, status, authorDetails, setState, props, className }) => {
if ( 0 === status && postAuthor && authors ) {
authors.find( ( o ) => {
if ( o.id === postAuthor ) {
if ( postAuthor !== props.attributes.id ) {
props.setAttributes({ id: o.id });
}
setState({
authorDetails: o,
status: 1
});
return o.id === postAuthor;
}
});
}
return (
( 1 === status && postAuthor && authors ) ? (
<section className={ className }>
<div className="themeisle-author-image">
<img className="author-image" src={ authorDetails.avatar_urls[ '96' ] } alt={ authorDetails.name }/>
</div>
<div className="themeisle-author-data">
<h4>{ authorDetails.name }</h4>
<p>{ authorDetails.description }</p>
</div>
</section>
) : (
<div key="loading" className="wp-block-embed is-loading">
<Spinner />
<p>{ __( 'Loading…' ) }</p>
</div>
)
);
}),
save: () => {
return null;
}
});