first commit

This commit is contained in:
CHIEFSOFT\ameye
2023-11-30 13:20:54 -05:00
commit e9e5c0546c
5833 changed files with 1801865 additions and 0 deletions
@@ -0,0 +1,81 @@
/**
* All of the CSS for your public-facing functionality should be
* included in this file.
*/
/**
* Environment for all styles (variables, additions, etc).
*/
/*--------------------------------------------------------------*/
/*--------------------------------------------------------------*/
.has-drop-cap {
--cnvs-drop-cap-color: black;
--cnvs-drop-cap-font-size: 2.5rem;
--cnvs-drop-cap-dark-background: black;
--cnvs-drop-cap-dark-color: #fff;
--cnvs-drop-cap-light-background: #f8f9fa;
--cnvs-drop-cap-light-color: inherit;
--cnvs-drop-cap-bordered-width: 1px;
--cnvs-drop-cap-bordered-color: #dee2e6;
}
.is-style-cnvs-paragraph-callout {
--cnvs-callout-font-size: 1.25rem;
--cnvs-callout-font-weight: 600;
}
/*--------------------------------------------------------------*/
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-simple:not(:focus):after,
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-bordered:not(:focus):after,
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-border-right:not(:focus):after,
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-bg-light:not(:focus):after,
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-bg-dark:not(:focus):after {
content: "";
display: table;
clear: both;
padding-top: 14px;
}
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-simple:not(:focus):first-letter,
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-bordered:not(:focus):first-letter,
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-border-right:not(:focus):first-letter,
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-bg-light:not(:focus):first-letter,
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-bg-dark:not(:focus):first-letter {
display: block;
float: right;
margin-top: 0.5rem;
margin-left: 2rem;
margin-bottom: 1rem;
color: var(--cnvs-drop-cap-color);
font-size: var(--cnvs-drop-cap-font-size);
line-height: 1;
text-align: center;
}
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-bg-dark:not(:focus):first-letter {
padding: 0.5rem 1rem;
background: var(--cnvs-drop-cap-dark-background);
color: var(--cnvs-drop-cap-dark-color);
}
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-bg-light:not(:focus):first-letter {
padding: 0.5rem 1rem;
background: var(--cnvs-drop-cap-light-background);
color: var(--cnvs-drop-cap-light-color);
}
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-bordered:not(:focus):first-letter {
margin-top: 0.25rem;
padding: 0.5rem 1rem;
border: var(--cnvs-drop-cap-bordered-width) solid var(--cnvs-drop-cap-bordered-color);
}
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-border-right:not(:focus):first-letter {
padding-left: 2rem;
border-left: var(--cnvs-drop-cap-bordered-width) solid var(--cnvs-drop-cap-bordered-color);
border-radius: 0;
}
.editor-styles-wrapper .is-style-cnvs-paragraph-callout {
font-size: var(--cnvs-callout-font-size);
font-weight: var(--cnvs-callout-font-weight);
}
@@ -0,0 +1,81 @@
/**
* All of the CSS for your public-facing functionality should be
* included in this file.
*/
/**
* Environment for all styles (variables, additions, etc).
*/
/*--------------------------------------------------------------*/
/*--------------------------------------------------------------*/
.has-drop-cap {
--cnvs-drop-cap-color: black;
--cnvs-drop-cap-font-size: 2.5rem;
--cnvs-drop-cap-dark-background: black;
--cnvs-drop-cap-dark-color: #fff;
--cnvs-drop-cap-light-background: #f8f9fa;
--cnvs-drop-cap-light-color: inherit;
--cnvs-drop-cap-bordered-width: 1px;
--cnvs-drop-cap-bordered-color: #dee2e6;
}
.is-style-cnvs-paragraph-callout {
--cnvs-callout-font-size: 1.25rem;
--cnvs-callout-font-weight: 600;
}
/*--------------------------------------------------------------*/
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-simple:not(:focus):after,
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-bordered:not(:focus):after,
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-border-right:not(:focus):after,
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-bg-light:not(:focus):after,
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-bg-dark:not(:focus):after {
content: "";
display: table;
clear: both;
padding-top: 14px;
}
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-simple:not(:focus):first-letter,
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-bordered:not(:focus):first-letter,
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-border-right:not(:focus):first-letter,
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-bg-light:not(:focus):first-letter,
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-bg-dark:not(:focus):first-letter {
display: block;
float: left;
margin-top: 0.5rem;
margin-right: 2rem;
margin-bottom: 1rem;
color: var(--cnvs-drop-cap-color);
font-size: var(--cnvs-drop-cap-font-size);
line-height: 1;
text-align: center;
}
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-bg-dark:not(:focus):first-letter {
padding: 0.5rem 1rem;
background: var(--cnvs-drop-cap-dark-background);
color: var(--cnvs-drop-cap-dark-color);
}
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-bg-light:not(:focus):first-letter {
padding: 0.5rem 1rem;
background: var(--cnvs-drop-cap-light-background);
color: var(--cnvs-drop-cap-light-color);
}
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-bordered:not(:focus):first-letter {
margin-top: 0.25rem;
padding: 0.5rem 1rem;
border: var(--cnvs-drop-cap-bordered-width) solid var(--cnvs-drop-cap-bordered-color);
}
.editor-styles-wrapper .has-drop-cap.is-cnvs-dropcap-border-right:not(:focus):first-letter {
padding-right: 2rem;
border-right: var(--cnvs-drop-cap-bordered-width) solid var(--cnvs-drop-cap-bordered-color);
border-radius: 0;
}
.editor-styles-wrapper .is-style-cnvs-paragraph-callout {
font-size: var(--cnvs-callout-font-size);
font-weight: var(--cnvs-callout-font-weight);
}
@@ -0,0 +1,96 @@
/**
* All of the CSS for your public-facing functionality should be
* included in this file.
*/
/**
* Environment for all styles (variables, additions, etc).
*/
/*--------------------------------------------------------------*/
/*--------------------------------------------------------------*/
.has-drop-cap {
--cnvs-drop-cap-color: black;
--cnvs-drop-cap-font-size: 2.5rem;
--cnvs-drop-cap-dark-background: black;
--cnvs-drop-cap-dark-color: #fff;
--cnvs-drop-cap-light-background: #f8f9fa;
--cnvs-drop-cap-light-color: inherit;
--cnvs-drop-cap-bordered-width: 1px;
--cnvs-drop-cap-bordered-color: #dee2e6;
}
.is-style-cnvs-paragraph-callout {
--cnvs-callout-font-size: 1.25rem;
--cnvs-callout-font-weight: 600;
}
/*--------------------------------------------------------------*/
.content .has-drop-cap.is-cnvs-dropcap-simple:after,
.content .has-drop-cap.is-cnvs-dropcap-bordered:after,
.content .has-drop-cap.is-cnvs-dropcap-border-right:after,
.content .has-drop-cap.is-cnvs-dropcap-bg-light:after,
.content .has-drop-cap.is-cnvs-dropcap-bg-dark:after,
.entry-content .has-drop-cap.is-cnvs-dropcap-simple:after,
.entry-content .has-drop-cap.is-cnvs-dropcap-bordered:after,
.entry-content .has-drop-cap.is-cnvs-dropcap-border-right:after,
.entry-content .has-drop-cap.is-cnvs-dropcap-bg-light:after,
.entry-content .has-drop-cap.is-cnvs-dropcap-bg-dark:after {
content: "";
display: table;
clear: both;
padding-top: 14px;
}
.content .has-drop-cap.is-cnvs-dropcap-simple:first-letter,
.content .has-drop-cap.is-cnvs-dropcap-bordered:first-letter,
.content .has-drop-cap.is-cnvs-dropcap-border-right:first-letter,
.content .has-drop-cap.is-cnvs-dropcap-bg-light:first-letter,
.content .has-drop-cap.is-cnvs-dropcap-bg-dark:first-letter,
.entry-content .has-drop-cap.is-cnvs-dropcap-simple:first-letter,
.entry-content .has-drop-cap.is-cnvs-dropcap-bordered:first-letter,
.entry-content .has-drop-cap.is-cnvs-dropcap-border-right:first-letter,
.entry-content .has-drop-cap.is-cnvs-dropcap-bg-light:first-letter,
.entry-content .has-drop-cap.is-cnvs-dropcap-bg-dark:first-letter {
display: block;
float: right;
margin-top: 0.5rem;
margin-left: 2rem;
margin-bottom: 1rem;
color: var(--cnvs-drop-cap-color);
font-size: var(--cnvs-drop-cap-font-size);
line-height: 1;
text-align: center;
}
.content .has-drop-cap.is-cnvs-dropcap-bg-dark:first-letter,
.entry-content .has-drop-cap.is-cnvs-dropcap-bg-dark:first-letter {
padding: 0.5rem 1rem;
background: var(--cnvs-drop-cap-dark-background);
color: var(--cnvs-drop-cap-dark-color);
}
.content .has-drop-cap.is-cnvs-dropcap-bg-light:first-letter,
.entry-content .has-drop-cap.is-cnvs-dropcap-bg-light:first-letter {
padding: 0.5rem 1rem;
background: var(--cnvs-drop-cap-light-background);
color: var(--cnvs-drop-cap-light-color);
}
.content .has-drop-cap.is-cnvs-dropcap-bordered:first-letter,
.entry-content .has-drop-cap.is-cnvs-dropcap-bordered:first-letter {
margin-top: 0.25rem;
padding: 0.5rem 1rem;
border: var(--cnvs-drop-cap-bordered-width) solid var(--cnvs-drop-cap-bordered-color);
}
.content .has-drop-cap.is-cnvs-dropcap-border-right:first-letter,
.entry-content .has-drop-cap.is-cnvs-dropcap-border-right:first-letter {
padding-left: 2rem;
border-left: var(--cnvs-drop-cap-bordered-width) solid var(--cnvs-drop-cap-bordered-color);
border-radius: 0;
}
.content .is-style-cnvs-paragraph-callout,
.entry-content .is-style-cnvs-paragraph-callout {
font-size: var(--cnvs-callout-font-size);
font-weight: var(--cnvs-callout-font-weight);
}
@@ -0,0 +1,96 @@
/**
* All of the CSS for your public-facing functionality should be
* included in this file.
*/
/**
* Environment for all styles (variables, additions, etc).
*/
/*--------------------------------------------------------------*/
/*--------------------------------------------------------------*/
.has-drop-cap {
--cnvs-drop-cap-color: black;
--cnvs-drop-cap-font-size: 2.5rem;
--cnvs-drop-cap-dark-background: black;
--cnvs-drop-cap-dark-color: #fff;
--cnvs-drop-cap-light-background: #f8f9fa;
--cnvs-drop-cap-light-color: inherit;
--cnvs-drop-cap-bordered-width: 1px;
--cnvs-drop-cap-bordered-color: #dee2e6;
}
.is-style-cnvs-paragraph-callout {
--cnvs-callout-font-size: 1.25rem;
--cnvs-callout-font-weight: 600;
}
/*--------------------------------------------------------------*/
.content .has-drop-cap.is-cnvs-dropcap-simple:after,
.content .has-drop-cap.is-cnvs-dropcap-bordered:after,
.content .has-drop-cap.is-cnvs-dropcap-border-right:after,
.content .has-drop-cap.is-cnvs-dropcap-bg-light:after,
.content .has-drop-cap.is-cnvs-dropcap-bg-dark:after,
.entry-content .has-drop-cap.is-cnvs-dropcap-simple:after,
.entry-content .has-drop-cap.is-cnvs-dropcap-bordered:after,
.entry-content .has-drop-cap.is-cnvs-dropcap-border-right:after,
.entry-content .has-drop-cap.is-cnvs-dropcap-bg-light:after,
.entry-content .has-drop-cap.is-cnvs-dropcap-bg-dark:after {
content: "";
display: table;
clear: both;
padding-top: 14px;
}
.content .has-drop-cap.is-cnvs-dropcap-simple:first-letter,
.content .has-drop-cap.is-cnvs-dropcap-bordered:first-letter,
.content .has-drop-cap.is-cnvs-dropcap-border-right:first-letter,
.content .has-drop-cap.is-cnvs-dropcap-bg-light:first-letter,
.content .has-drop-cap.is-cnvs-dropcap-bg-dark:first-letter,
.entry-content .has-drop-cap.is-cnvs-dropcap-simple:first-letter,
.entry-content .has-drop-cap.is-cnvs-dropcap-bordered:first-letter,
.entry-content .has-drop-cap.is-cnvs-dropcap-border-right:first-letter,
.entry-content .has-drop-cap.is-cnvs-dropcap-bg-light:first-letter,
.entry-content .has-drop-cap.is-cnvs-dropcap-bg-dark:first-letter {
display: block;
float: left;
margin-top: 0.5rem;
margin-right: 2rem;
margin-bottom: 1rem;
color: var(--cnvs-drop-cap-color);
font-size: var(--cnvs-drop-cap-font-size);
line-height: 1;
text-align: center;
}
.content .has-drop-cap.is-cnvs-dropcap-bg-dark:first-letter,
.entry-content .has-drop-cap.is-cnvs-dropcap-bg-dark:first-letter {
padding: 0.5rem 1rem;
background: var(--cnvs-drop-cap-dark-background);
color: var(--cnvs-drop-cap-dark-color);
}
.content .has-drop-cap.is-cnvs-dropcap-bg-light:first-letter,
.entry-content .has-drop-cap.is-cnvs-dropcap-bg-light:first-letter {
padding: 0.5rem 1rem;
background: var(--cnvs-drop-cap-light-background);
color: var(--cnvs-drop-cap-light-color);
}
.content .has-drop-cap.is-cnvs-dropcap-bordered:first-letter,
.entry-content .has-drop-cap.is-cnvs-dropcap-bordered:first-letter {
margin-top: 0.25rem;
padding: 0.5rem 1rem;
border: var(--cnvs-drop-cap-bordered-width) solid var(--cnvs-drop-cap-bordered-color);
}
.content .has-drop-cap.is-cnvs-dropcap-border-right:first-letter,
.entry-content .has-drop-cap.is-cnvs-dropcap-border-right:first-letter {
padding-right: 2rem;
border-right: var(--cnvs-drop-cap-bordered-width) solid var(--cnvs-drop-cap-bordered-color);
border-radius: 0;
}
.content .is-style-cnvs-paragraph-callout,
.entry-content .is-style-cnvs-paragraph-callout {
font-size: var(--cnvs-callout-font-size);
font-weight: var(--cnvs-callout-font-weight);
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,173 @@
/**
* Internal dependencies
*/
import {
replaceClass,
getActiveClass,
} from '../../../gutenberg/utils/classes-replacer';
/**
* WordPress dependencies
*/
const {
__,
} = wp.i18n;
const {
registerBlockStyle,
} = wp.blocks;
const {
Component,
Fragment,
} = wp.element;
const {
PanelBody,
SelectControl,
} = wp.components;
const {
InspectorControls,
} = wp.blockEditor;
const {
addFilter,
} = wp.hooks;
const {
createHigherOrderComponent,
} = wp.compose;
const {
withDispatch,
} = wp.data;
registerBlockStyle( 'core/paragraph', {
name: 'cnvs-paragraph-callout',
label: __( 'Callout' ),
} );
/**
* Override the default edit UI to include a new block inspector control for
* assigning the custom styles if needed.
*
* @param {function|Component} BlockEdit Original component.
*
* @return {string} Wrapped component.
*/
const paragraphWithCanvasDropcap = createHigherOrderComponent( ( BlockEdit ) => {
class NewEdit extends Component {
constructor() {
super( ...arguments );
this.activeClasses = '';
this.getDropcapStyle = this.getDropcapStyle.bind( this );
this.updateDropcapStyle = this.updateDropcapStyle.bind( this );
}
/**
* Get dropcap style from classname on the block.
*
* @return {String}
*/
getDropcapStyle() {
const {
attributes,
} = this.props;
return getActiveClass( attributes.className, 'is-cnvs-dropcap' );
}
/**
* Update dropcap classname on the block.
*
* @param {String} dropcapName name of dropcap style
* @memberof NewEdit
*/
updateDropcapStyle( dropcapName ) {
const {
attributes,
onChangeClassName,
} = this.props;
const updatedClassName = replaceClass( attributes.className, 'is-cnvs-dropcap', dropcapName );
onChangeClassName( updatedClassName );
}
render() {
if ( 'core/paragraph' !== this.props.name ) {
return <BlockEdit { ...this.props } />;
}
const {
attributes,
} = this.props;
if ( attributes.dropCap ) {
let dropcapStyle = this.getDropcapStyle();
if ( dropcapStyle ) {
dropcapStyle = dropcapStyle.replace( /^is-cnvs-dropcap-/, '' );
}
return (
<Fragment>
<BlockEdit { ...this.props } />
<InspectorControls>
<PanelBody
title={ __( 'Dropcap Style' ) }
>
<SelectControl
value={ dropcapStyle }
options={ [
{
label: __( 'Default' ),
value: '',
}, {
label: __( 'Simple' ),
value: 'simple',
}, {
label: __( 'Bordered' ),
value: 'bordered',
}, {
label: __( 'Border Right' ),
value: 'border-right',
}, {
label: __( 'Background Light' ),
value: 'bg-light',
}, {
label: __( 'Background Dark' ),
value: 'bg-dark',
},
] }
onChange={ ( val ) => {
this.updateDropcapStyle( val );
} }
/>
</PanelBody>
</InspectorControls>
</Fragment>
);
}
return <BlockEdit { ...this.props } />;
}
}
return withDispatch( ( dispatch, { clientId } ) => {
return {
onChangeClassName( newClassName ) {
dispatch( 'core/block-editor' ).updateBlockAttributes( clientId, {
className: newClassName,
} );
},
};
} )( NewEdit );
}, 'paragraphWithCanvasDropcap' );
addFilter( 'editor.BlockEdit', 'canvas/paragraph/dropcap', paragraphWithCanvasDropcap );