corvée(dépendances) ajoute Carbon Fields
This commit is contained in:
parent
135cc65eed
commit
62368587e5
459 changed files with 72750 additions and 26 deletions
50
web/vendor/htmlburger/carbon-fields/packages/metaboxes/containers/widget/index.js
vendored
Normal file
50
web/vendor/htmlburger/carbon-fields/packages/metaboxes/containers/widget/index.js
vendored
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/**
|
||||
* External dependencies.
|
||||
*/
|
||||
import { select } from '@wordpress/data';
|
||||
import { addFilter } from '@wordpress/hooks';
|
||||
import { withEffects } from 'refract-callbag';
|
||||
|
||||
/**
|
||||
* Internal dependencies.
|
||||
*/
|
||||
import './style.scss';
|
||||
|
||||
/**
|
||||
* Carbon Fields dependencies.
|
||||
*/
|
||||
import { fromSelector } from '@carbon-fields/core';
|
||||
|
||||
/**
|
||||
* The function that controls the stream of side effects.
|
||||
*
|
||||
* @return {Object}
|
||||
*/
|
||||
function aperture() {
|
||||
return fromSelector( select( 'carbon-fields/metaboxes' ).isFieldUpdated );
|
||||
}
|
||||
|
||||
/**
|
||||
* The function that causes the side effects.
|
||||
*
|
||||
* @param {Object} props
|
||||
* @return {Function}
|
||||
*/
|
||||
function handler( props ) {
|
||||
return function( { action } ) {
|
||||
if ( ! action ) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { container } = props;
|
||||
const { payload } = action;
|
||||
|
||||
if ( container.fields.map( ( field ) => field.id ).indexOf( payload.fieldId ) >= 0 ) {
|
||||
const $carbonContainer = window.jQuery( `.container-${ container.id }` );
|
||||
|
||||
$carbonContainer.closest( '.widget-inside' ).trigger( 'change' );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
addFilter( 'carbon-fields.widget.classic', 'carbon-fields/metaboxes', withEffects( aperture, { handler } ) );
|
||||
31
web/vendor/htmlburger/carbon-fields/packages/metaboxes/containers/widget/style.scss
vendored
Normal file
31
web/vendor/htmlburger/carbon-fields/packages/metaboxes/containers/widget/style.scss
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/* ==========================================================================
|
||||
Widget
|
||||
========================================================================== */
|
||||
|
||||
.cf-container-widget {
|
||||
margin-bottom: 13px;
|
||||
|
||||
.cf-field {
|
||||
margin: 1em 0 0;
|
||||
padding: 0;
|
||||
border-width: 0;
|
||||
}
|
||||
|
||||
.cf-field + .cf-field {
|
||||
border-top-width: 0;
|
||||
}
|
||||
|
||||
.cf-complex__group-body {
|
||||
border-width: 1px 1px 1px 1px;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.cf-complex__group-body .cf-field {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.cf-complex__group-body .cf-field + .cf-field {
|
||||
border-width: 1px 0 0 0;
|
||||
padding-top: 1em;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue