Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
arielk authored Nov 8, 2023
2 parents dee3b81 + 95066d9 commit 0dec996
Show file tree
Hide file tree
Showing 36 changed files with 4,691 additions and 4,356 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
assets/lib/**/*.js
assets/js/*.js
assets/js/
**/*.min.js
**/node_modules/**
**/vendor/**
Expand Down
2 changes: 1 addition & 1 deletion assets/dev/js/editor/controls/base-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ ControlBaseDataView = ControlBaseView.extend( {
/**
* Get the responsive parent view if exists.
*
* @return {ControlBaseDataView|null} responsive parent view if exists
* @return {ControlBaseDataView|undefined} responsive parent view if exists
*/
getResponsiveParentView() {
const parent = this.model.get( 'parent' );
Expand Down
8 changes: 4 additions & 4 deletions assets/dev/js/editor/elements/views/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ BaseElementView = BaseContainer.extend( {
*
* This filter allows adding new context menu groups to elements.
*
* @param array customGroups - An array of group objects.
* @param string elementType - The current element type.
* @param array customGroups - An array of group objects.
* @param string elementType - The current element type.
*/
customGroups = elementor.hooks.applyFilters( 'elements/context-menu/groups', customGroups, this.options.model.get( 'elType' ) );

Expand Down Expand Up @@ -296,7 +296,7 @@ BaseElementView = BaseContainer.extend( {
*
* @since 3.5.0
*
* @param array editButtons An array of buttons.
* @param array editButtons An array of buttons.
*/
editButtons = elementor.hooks.applyFilters( `elements/edit-buttons`, editButtons );

Expand All @@ -309,7 +309,7 @@ BaseElementView = BaseContainer.extend( {
*
* @since 3.5.0
*
* @param array editButtons An array of buttons.
* @param array editButtons An array of buttons.
*/
editButtons = elementor.hooks.applyFilters( `elements/edit-buttons/${ elementType }`, editButtons );
}
Expand Down
2 changes: 1 addition & 1 deletion assets/dev/js/editor/utils/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ module.exports = {
* @param {*} attributes - default {} - attributes to attach to rendered html tag
* @param {string} tag - default i - html tag to render
* @param {*} returnType - default value - retrun type
* @return {string|boolean|*} result
* @return {string|undefined|*} result
*/
renderIcon( view, icon, attributes = {}, tag = 'i', returnType = 'value' ) {
if ( ! icon || ! icon.library ) {
Expand Down
2 changes: 1 addition & 1 deletion assets/dev/js/editor/utils/localized-value-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default class LocalizedValueStore {
* English values will be returned as is
* Paste will return an empty value
*
* @param event - the incoming event
* @param event - the incoming event
* @return string
*/

Expand Down
2 changes: 1 addition & 1 deletion core/common/modules/finder/categories/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function get_id() {
public function get_category_items( array $options = [] ) {
return [
'saved-templates' => [
'title' => esc_html_x( 'Saved Templates', 'Template Library', 'elementor' ),
'title' => esc_html__( 'Saved Templates', 'elementor' ),
'icon' => 'library-save',
'url' => Source_Local::get_admin_url(),
'keywords' => [ 'template', 'section', 'page', 'library' ],
Expand Down
18 changes: 9 additions & 9 deletions includes/controls/groups/flex-container.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ protected function init_fields() {
'default' => '',
'options' => [
'flex-start' => [
'title' => esc_html_x( 'Start', 'Flex Container Control', 'elementor' ),
'title' => esc_html__( 'Start', 'elementor' ),
'icon' => 'eicon-flex eicon-justify-start-h',
],
'center' => [
'title' => esc_html_x( 'Center', 'Flex Container Control', 'elementor' ),
'title' => esc_html__( 'Center', 'elementor' ),
'icon' => 'eicon-flex eicon-justify-center-h',
],
'flex-end' => [
'title' => esc_html_x( 'End', 'Flex Container Control', 'elementor' ),
'title' => esc_html__( 'End', 'elementor' ),
'icon' => 'eicon-flex eicon-justify-end-h',
],
'space-between' => [
Expand Down Expand Up @@ -130,15 +130,15 @@ protected function init_fields() {
'default' => '',
'options' => [
'flex-start' => [
'title' => esc_html_x( 'Start', 'Flex Container Control', 'elementor' ),
'title' => esc_html__( 'Start', 'elementor' ),
'icon' => 'eicon-flex eicon-align-start-v',
],
'center' => [
'title' => esc_html_x( 'Center', 'Flex Container Control', 'elementor' ),
'title' => esc_html__( 'Center', 'elementor' ),
'icon' => 'eicon-flex eicon-align-center-v',
],
'flex-end' => [
'title' => esc_html_x( 'End', 'Flex Container Control', 'elementor' ),
'title' => esc_html__( 'End', 'elementor' ),
'icon' => 'eicon-flex eicon-align-end-v',
],
'stretch' => [
Expand Down Expand Up @@ -180,15 +180,15 @@ protected function init_fields() {
];

$fields['wrap'] = [
'label' => esc_html_x( 'Wrap', 'Flex Container Control', 'elementor' ),
'label' => esc_html__( 'Wrap', 'elementor' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'nowrap' => [
'title' => esc_html_x( 'No Wrap', 'Flex Container Control', 'elementor' ),
'title' => esc_html__( 'No Wrap', 'elementor' ),
'icon' => 'eicon-flex eicon-nowrap',
],
'wrap' => [
'title' => esc_html_x( 'Wrap', 'Flex Container Control', 'elementor' ),
'title' => esc_html__( 'Wrap', 'elementor' ),
'icon' => 'eicon-flex eicon-wrap',
],
],
Expand Down
10 changes: 5 additions & 5 deletions includes/controls/groups/flex-item.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ protected function init_fields() {
'type' => Controls_Manager::CHOOSE,
'options' => [
'flex-start' => [
'title' => esc_html_x( 'Start', 'Flex Item Control', 'elementor' ),
'title' => esc_html__( 'Start', 'elementor' ),
'icon' => 'eicon-flex eicon-align-start-v',
],
'center' => [
'title' => esc_html_x( 'Center', 'Flex Item Control', 'elementor' ),
'title' => esc_html__( 'Center', 'elementor' ),
'icon' => 'eicon-flex eicon-align-center-v',
],
'flex-end' => [
'title' => esc_html_x( 'End', 'Flex Item Control', 'elementor' ),
'title' => esc_html__( 'End', 'elementor' ),
'icon' => 'eicon-flex eicon-align-end-v',
],
'stretch' => [
Expand All @@ -91,11 +91,11 @@ protected function init_fields() {
'default' => '',
'options' => [
'start' => [
'title' => esc_html_x( 'Start', 'Flex Item Control', 'elementor' ),
'title' => esc_html__( 'Start', 'elementor' ),
'icon' => 'eicon-flex eicon-order-start',
],
'end' => [
'title' => esc_html_x( 'End', 'Flex Item Control', 'elementor' ),
'title' => esc_html__( 'End', 'elementor' ),
'icon' => 'eicon-flex eicon-order-end',
],
'custom' => [
Expand Down
24 changes: 12 additions & 12 deletions includes/controls/groups/grid-container.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ protected function init_fields() {
'type' => Controls_Manager::CHOOSE,
'options' => [
'start' => [
'title' => esc_html_x( 'Start', 'Grid Container Control', 'elementor' ),
'title' => esc_html__( 'Start', 'elementor' ),
'icon' => 'eicon-align-' . $icon_start . '-h',
],
'center' => [
'title' => esc_html_x( 'Center', 'Grid Container Control', 'elementor' ),
'title' => esc_html__( 'Center', 'elementor' ),
'icon' => 'eicon-align-center-h',
],
'end' => [
'title' => esc_html_x( 'End', 'Grid Container Control', 'elementor' ),
'title' => esc_html__( 'End', 'elementor' ),
'icon' => 'eicon-align-' . $icon_end . '-h',
],
'stretch' => [
Expand All @@ -160,15 +160,15 @@ protected function init_fields() {
'type' => Controls_Manager::CHOOSE,
'options' => [
'start' => [
'title' => esc_html_x( 'Start', 'Grid Container Control', 'elementor' ),
'title' => esc_html__( 'Start', 'elementor' ),
'icon' => 'eicon-align-start-v',
],
'center' => [
'title' => esc_html_x( 'Center', 'Grid Container Control', 'elementor' ),
'title' => esc_html__( 'Center', 'elementor' ),
'icon' => 'eicon-align-center-v',
],
'end' => [
'title' => esc_html_x( 'End', 'Grid Container Control', 'elementor' ),
'title' => esc_html__( 'End', 'elementor' ),
'icon' => 'eicon-align-end-v',
],
'stretch' => [
Expand All @@ -189,15 +189,15 @@ protected function init_fields() {
'default' => '',
'options' => [
'start' => [
'title' => esc_html_x( 'Start', 'Grid Container Control', 'elementor' ),
'title' => esc_html__( 'Start', 'elementor' ),
'icon' => 'eicon-justify-start-h',
],
'center' => [
'title' => esc_html_x( 'Middle', 'Grid Container Control', 'elementor' ),
'title' => esc_html__( 'Middle', 'elementor' ),
'icon' => 'eicon-justify-center-h',
],
'end' => [
'title' => esc_html_x( 'End', 'Grid Container Control', 'elementor' ),
'title' => esc_html__( 'End', 'elementor' ),
'icon' => 'eicon-justify-end-h',
],
'space-between' => [
Expand Down Expand Up @@ -229,15 +229,15 @@ protected function init_fields() {
'default' => '',
'options' => [
'start' => [
'title' => esc_html_x( 'Start', 'Grid Container Control', 'elementor' ),
'title' => esc_html__( 'Start', 'elementor' ),
'icon' => 'eicon-justify-start-v',
],
'center' => [
'title' => esc_html_x( 'Middle', 'Grid Container Control', 'elementor' ),
'title' => esc_html__( 'Middle', 'elementor' ),
'icon' => 'eicon-justify-center-v',
],
'end' => [
'title' => esc_html_x( 'End', 'Grid Container Control', 'elementor' ),
'title' => esc_html__( 'End', 'elementor' ),
'icon' => 'eicon-justify-end-v',
],
'space-between' => [
Expand Down
10 changes: 5 additions & 5 deletions includes/controls/groups/typography.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ protected function init_fields() {
'800' => '800 ' . esc_html_x( '(Extra Bold)', 'Typography Control', 'elementor' ),
'900' => '900 ' . esc_html_x( '(Black)', 'Typography Control', 'elementor' ),
'' => esc_html__( 'Default', 'elementor' ),
'normal' => esc_html_x( 'Normal', 'Typography Control', 'elementor' ),
'bold' => esc_html_x( 'Bold', 'Typography Control', 'elementor' ),
'normal' => esc_html__( 'Normal', 'elementor' ),
'bold' => esc_html__( 'Bold', 'elementor' ),
],
];

Expand All @@ -157,7 +157,7 @@ protected function init_fields() {
'uppercase' => esc_html_x( 'Uppercase', 'Typography Control', 'elementor' ),
'lowercase' => esc_html_x( 'Lowercase', 'Typography Control', 'elementor' ),
'capitalize' => esc_html_x( 'Capitalize', 'Typography Control', 'elementor' ),
'none' => esc_html_x( 'Normal', 'Typography Control', 'elementor' ),
'none' => esc_html__( 'Normal', 'elementor' ),
],
];

Expand All @@ -167,7 +167,7 @@ protected function init_fields() {
'default' => '',
'options' => [
'' => esc_html__( 'Default', 'elementor' ),
'normal' => esc_html_x( 'Normal', 'Typography Control', 'elementor' ),
'normal' => esc_html__( 'Normal', 'elementor' ),
'italic' => esc_html_x( 'Italic', 'Typography Control', 'elementor' ),
'oblique' => esc_html_x( 'Oblique', 'Typography Control', 'elementor' ),
],
Expand All @@ -182,7 +182,7 @@ protected function init_fields() {
'underline' => esc_html_x( 'Underline', 'Typography Control', 'elementor' ),
'overline' => esc_html_x( 'Overline', 'Typography Control', 'elementor' ),
'line-through' => esc_html_x( 'Line Through', 'Typography Control', 'elementor' ),
'none' => esc_html_x( 'None', 'Typography Control', 'elementor' ),
'none' => esc_html__( 'None', 'elementor' ),
],
];

Expand Down
2 changes: 1 addition & 1 deletion includes/controls/select2.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function content_template() {
var selected = ( -1 !== value.indexOf( option_value ) ) ? 'selected' : '';
}
#>
<option {{ selected }} value="{{ option_value }}">{{{ option_title }}}</option>
<option {{ selected }} value="{{ _.escape( option_value ) }}">{{{ _.escape( option_title ) }}}</option>
<# } ); #>
</select>
</div>
Expand Down
2 changes: 1 addition & 1 deletion includes/elements/container.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ protected function get_flex_control_options( $is_container_grid_active ) {
'selector' => '{{WRAPPER}}',
'fields_options' => [
'gap' => [
'label' => esc_html_x( 'Gaps', 'Flex Container Control', 'elementor' ),
'label' => esc_html__( 'Gaps', 'elementor' ),
'device_args' => [
Breakpoints_Manager::BREAKPOINT_KEY_DESKTOP => [
// Use the default gap from the kit as a placeholder.
Expand Down
20 changes: 10 additions & 10 deletions includes/template-library/sources/local.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,16 +233,16 @@ public function register_data() {
$labels = [
'name' => $name,
'singular_name' => esc_html_x( 'Template', 'Template Library', 'elementor' ),
'add_new' => esc_html_x( 'Add New', 'Template Library', 'elementor' ),
'add_new_item' => esc_html_x( 'Add New Template', 'Template Library', 'elementor' ),
'edit_item' => esc_html_x( 'Edit Template', 'Template Library', 'elementor' ),
'new_item' => esc_html_x( 'New Template', 'Template Library', 'elementor' ),
'all_items' => esc_html_x( 'All Templates', 'Template Library', 'elementor' ),
'view_item' => esc_html_x( 'View Template', 'Template Library', 'elementor' ),
'search_items' => esc_html_x( 'Search Template', 'Template Library', 'elementor' ),
'not_found' => esc_html_x( 'No Templates found', 'Template Library', 'elementor' ),
'not_found_in_trash' => esc_html_x( 'No Templates found in Trash', 'Template Library', 'elementor' ),
'parent_item_colon' => '',
'add_new' => esc_html__( 'Add New Template', 'elementor' ),
'add_new_item' => esc_html__( 'Add New Template', 'elementor' ),
'edit_item' => esc_html__( 'Edit Template', 'elementor' ),
'new_item' => esc_html__( 'New Template', 'elementor' ),
'all_items' => esc_html__( 'All Templates', 'elementor' ),
'view_item' => esc_html__( 'View Template', 'elementor' ),
'search_items' => esc_html__( 'Search Template', 'elementor' ),
'not_found' => esc_html__( 'No Templates found', 'elementor' ),
'not_found_in_trash' => esc_html__( 'No Templates found in Trash', 'elementor' ),
'parent_item_colon' => esc_html__( 'Parent Template:', 'elementor' ),
'menu_name' => esc_html_x( 'Templates', 'Template Library', 'elementor' ),
];

Expand Down
6 changes: 6 additions & 0 deletions modules/ai/assets/js/editor/ai-layout-behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ export default class AiLayoutBehavior extends Marionette.Behavior {
renderLayoutApp( {
at: this.view.getOption( 'at' ),
onInsert: this.onInsert.bind( this ),
onRenderApp: ( args ) => {
args.previewContainer.init();
},
onGenerate: ( args ) => {
args.previewContainer.reset();
},
} );
}

Expand Down
15 changes: 14 additions & 1 deletion modules/ai/assets/js/editor/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,20 @@ export const getImagePromptEnhanced = ( prompt ) => request( 'ai_get_image_promp

export const uploadImage = ( image ) => request( 'ai_upload_image', { ...image } );

export const generateLayout = ( prompt, variationType, prevGeneratedIds, signal ) => request( 'ai_generate_layout', { prompt, variationType, prevGeneratedIds }, true, signal );
/**
* @typedef {Object} AttachmentPropType - See ./types/attachment.js
* @typedef {Object} requestBody
* @property {string} prompt - Prompt to generate the layout from.
* @property {0|1|2} [variationType] - Type of the layout to generate (actually it's a position).
* @property {string[]} [prevGeneratedIds] - Previously generated ids for exclusion on regeneration.
* @property {AttachmentPropType[]} [attachments] - Attachments to use for the generation. currently only `json` type is supported - a container JSON to generate variations from.
*/

/**
* @param {requestBody} requestBody
* @param {AbortSignal} [signal]
*/
export const generateLayout = ( requestBody, signal ) => request( 'ai_generate_layout', requestBody, true, signal );

export const getLayoutPromptEnhanced = ( prompt ) => request( 'ai_get_layout_prompt_enhancer', { prompt } );

Expand Down
Loading

0 comments on commit 0dec996

Please sign in to comment.