Making WordPress.org

Changeset 13621


Ignore:
Timestamp:
04/30/2024 05:32:22 AM (5 months ago)
Author:
adamwood
Message:

Learn: Sync with git WordPress/learn@9e81c21

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/locale-notice.asset.php

    r12130 r13621  
    1 <?php return array('dependencies' => array(), 'version' => '75158a71213280929fbc');
     1<?php return array('dependencies' => array(), 'version' => '6ab2c759f5f19a11f996');
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/locale-notice.js

    r12130 r13621  
    1 !function(e,o,i){"use strict";const c=e.WPOrgLearnLocaleNotice||{},n=o.extend(c,{$notice:o(),init(){n.$notice=o(".wporg-learn-locale-notice"),n.$notice.on("click",".wporg-learn-locale-notice-dismiss",(function(e){e.preventDefault(),n.dismissNotice()}))},dismissNotice(){n.$notice.fadeTo(100,0,(function(){n.$notice.slideUp(100,(function(){n.$notice.remove()}))})),i.set("wporg-learn-locale-notice-dismissed",!0,n.cookie.expires,n.cookie.cpath,n.cookie.domain,n.cookie.secure)}});o(document).ready((function(){n.init()}))}(window,jQuery,wpCookies);
     1!function(e,o,i){"use strict";const n=e.WPOrgLearnLocaleNotice||{},c=o.extend(n,{$notice:o(),init:function(){c.$notice=o(".wporg-learn-locale-notice"),c.$notice.on("click",".wporg-learn-locale-notice-dismiss",(function(e){e.preventDefault(),c.dismissNotice()}))},dismissNotice:function(){c.$notice.fadeTo(100,0,(function(){c.$notice.slideUp(100,(function(){c.$notice.remove()}))})),i.set("wporg-learn-locale-notice-dismissed",!0,c.cookie.expires,c.cookie.cpath,c.cookie.domain,c.cookie.secure)}});o(document).ready((function(){c.init()}))}(window,jQuery,wpCookies);
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/constants.js

    r12096 r13621  
    55
    66export const errors = {
    7     BLOCK_SIDEBAR_TYPE_INCOMPATIBLE: __(
    8         'Error: This block is not compatible with this sidebar.',
    9         'wporg-learn'
    10     ),
    11     BLOCK_POST_TYPE_INCOMPATIBLE: __(
    12         'Error: This block is not compatible with this post type.',
    13         'wporg-learn'
    14     ),
     7    BLOCK_SIDEBAR_TYPE_INCOMPATIBLE: __( 'Error: This block is not compatible with this sidebar.', 'wporg-learn' ),
     8    BLOCK_POST_TYPE_INCOMPATIBLE: __( 'Error: This block is not compatible with this post type.', 'wporg-learn' ),
    159};
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/course-data/src/edit.js

    r12289 r13621  
    55import { Placeholder } from '@wordpress/components';
    66
    7 import { useIsBlockInSidebar, useGetCurrentPostType } from '../../hooks';
     7import { useGetCurrentPostType, useIsBlockInSidebar } from '../../hooks';
    88import { getBlockPlaceholderMessage } from '../../utils';
    99
     
    1313        useGetCurrentPostType(),
    1414        useIsBlockInSidebar( clientId, 'wporg-learn-courses' ),
    15         __(
    16             'This will be dynamically populated based on the current course data.',
    17             'wporg-learn'
    18         )
     15        __( 'This will be dynamically populated based on the current course data.', 'wporg-learn' )
    1916    );
    2017
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/course-data/src/index.js

    r12289 r13621  
    4444     * It will be shown in the Block Tab in the Settings Sidebar.
    4545     */
    46     description: __(
    47         'Show average learner details for the course.',
    48         'wporg-learn'
    49     ),
     46    description: __( 'Show average learner details for the course.', 'wporg-learn' ),
    5047
    5148    /**
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/expiration-date/index.js

    r13587 r13621  
    22 * WordPress dependencies
    33 */
    4 import {
    5     Button,
    6     DateTimePicker,
    7     Dropdown,
    8     PanelRow,
    9 } from '@wordpress/components';
     4import { Button, DateTimePicker, Dropdown, PanelRow } from '@wordpress/components';
    105import { useDispatch, useSelect } from '@wordpress/data';
    116// eslint-disable-next-line @wordpress/no-unsafe-wp-apis -- Experimental is OK.
    12 import { format, __experimentalGetSettings } from '@wordpress/date';
     7import { __experimentalGetSettings, format } from '@wordpress/date';
    138import { PluginPostStatusInfo } from '@wordpress/edit-post';
    14 import { useState, useRef } from '@wordpress/element';
     9import { useRef, useState } from '@wordpress/element';
    1510import { __ } from '@wordpress/i18n';
    1611import { registerPlugin } from '@wordpress/plugins';
     
    1914    const settings = __experimentalGetSettings();
    2015    return date
    21         ? format(
    22                 `${ settings.formats.date } ${ settings.formats.time }`,
    23                 date
    24           )
     16        ? format( `${ settings.formats.date } ${ settings.formats.time }`, date )
    2517        : __( 'No expiration date', 'wporg-learn' );
    2618}
    2719
    2820const ExpirationDate = () => {
    29     const postMetaData = useSelect(
    30         ( select ) =>
    31             select( 'core/editor' ).getEditedPostAttribute( 'meta' ) || {}
    32     );
     21    const postMetaData = useSelect( ( select ) => select( 'core/editor' ).getEditedPostAttribute( 'meta' ) || {} );
    3322    const { editPost } = useDispatch( 'core/editor' );
    3423    const [ expDate, setExpDate ] = useState( postMetaData?.expiration_date );
     
    7867                                        } );
    7968
    80                                         const { ownerDocument } =
    81                                             pickerRef.current;
     69                                        const { ownerDocument } = pickerRef.current;
    8270                                        ownerDocument.activeElement.blur();
    8371                                    } }
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/form.js

    r10376 r13621  
    11const jQuery = window.jQuery || {};
    22
     3// eslint-disable-next-line id-length
    34( ( $ ) => {
    45    const checkOther = document.querySelectorAll( '.checkbox-and-text' );
     
    89            text = container.querySelector( 'input[type="text"]' );
    910
    10         text.addEventListener(
    11             'input',
    12             ( event ) => ( checkbox.checked = !! event.target.value )
    13         );
     11        text.addEventListener( 'input', ( event ) => ( checkbox.checked = !! event.target.value ) );
    1412
    1513        checkbox.addEventListener( 'change', ( event ) => {
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/hooks/use-is-block-in-sidebar.js

    r13587 r13621  
    66export const useIsBlockInSidebar = ( clientId, sidebarName ) => {
    77    return useSelect( ( select ) => {
    8         const { getBlockAttributes, getBlockName, getBlockParents } =
    9             select( 'core/block-editor' );
     8        const { getBlockAttributes, getBlockName, getBlockParents } = select( 'core/block-editor' );
    109        const parents = getBlockParents( clientId );
    1110        return parents.some( ( parent ) => {
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/language-meta/index.js

    r12174 r13621  
    1515
    1616const LanguageMeta = () => {
    17     const postMetaData = useSelect(
    18         ( select ) =>
    19             select( 'core/editor' ).getEditedPostAttribute( 'meta' ) || {}
    20     );
     17    const postMetaData = useSelect( ( select ) => select( 'core/editor' ).getEditedPostAttribute( 'meta' ) || {} );
    2118    const { editPost } = useDispatch( 'core/editor' );
    2219    const [ language, setLanguage ] = useState( postMetaData?.language );
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/lesson-plan-actions/src/edit.js

    r12096 r13621  
    55import { Placeholder } from '@wordpress/components';
    66
    7 import { useIsBlockInSidebar, useGetCurrentPostType } from '../../hooks';
     7import { useGetCurrentPostType, useIsBlockInSidebar } from '../../hooks';
    88import { getBlockPlaceholderMessage } from '../../utils';
    99
     
    1313        useGetCurrentPostType(),
    1414        useIsBlockInSidebar( clientId, 'wporg-learn-lesson-plans' ),
    15         __(
    16             'This will be dynamically populated based on media attached to the Lesson Plan.',
    17             'wporg-learn'
    18         )
     15        __( 'This will be dynamically populated based on media attached to the Lesson Plan.', 'wporg-learn' )
    1916    );
    2017
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/lesson-plan-actions/src/index.js

    r12096 r13621  
    4444     * It will be shown in the Block Tab in the Settings Sidebar.
    4545     */
    46     description: __(
    47         'Show actions for the Lesson Plan, depending on post media.',
    48         'wporg-learn'
    49     ),
     46    description: __( 'Show actions for the Lesson Plan, depending on post media.', 'wporg-learn' ),
    5047
    5148    /**
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/lesson-plan-details/src/edit.js

    r12096 r13621  
    55import { Placeholder } from '@wordpress/components';
    66
    7 import { useIsBlockInSidebar, useGetCurrentPostType } from '../../hooks';
     7import { useGetCurrentPostType, useIsBlockInSidebar } from '../../hooks';
    88import { getBlockPlaceholderMessage } from '../../utils';
    99
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/lesson-plan-details/src/index.js

    r12096 r13621  
    4444     * It will be shown in the Block Tab in the Settings Sidebar.
    4545     */
    46     description: __(
    47         'Show details about the Lesson Plan, pulled from post meta.',
    48         'wporg-learn'
    49     ),
     46    description: __( 'Show details about the Lesson Plan, pulled from post meta.', 'wporg-learn' ),
    5047
    5148    /**
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/locale-notice.js

    r10880 r13621  
    11/* global jQuery, wpCookies */
     2// eslint-disable-next-line id-length
    23( function ( window, $, wpCookies ) {
    34    'use strict';
     
    89        $notice: $(),
    910
    10         init() {
     11        init: function () {
    1112            app.$notice = $( '.wporg-learn-locale-notice' );
    1213
    13             app.$notice.on(
    14                 'click',
    15                 '.wporg-learn-locale-notice-dismiss',
    16                 function ( event ) {
    17                     event.preventDefault();
    18                     app.dismissNotice();
    19                 }
    20             );
     14            app.$notice.on( 'click', '.wporg-learn-locale-notice-dismiss', function ( event ) {
     15                event.preventDefault();
     16                app.dismissNotice();
     17            } );
    2118        },
    2219
    23         dismissNotice() {
     20        dismissNotice: function () {
    2421            app.$notice.fadeTo( 100, 0, function () {
    2522                app.$notice.slideUp( 100, function () {
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/utils.js

    r12096 r13621  
    11import { errors } from './constants';
    22
    3 export const getBlockPlaceholderMessage = (
    4     blockPostType,
    5     currentPostType,
    6     isBlockInSidebar,
    7     defaultMessage
    8 ) => {
     3export const getBlockPlaceholderMessage = ( blockPostType, currentPostType, isBlockInSidebar, defaultMessage ) => {
    94    if ( currentPostType === null ) {
    105        if ( ! isBlockInSidebar ) {
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/workshop-application-form/src/edit.js

    r10376 r13621  
    99        <Placeholder
    1010            label={ __( 'Workshop Application Form', 'wporg-learn' ) }
    11             instructions={ __(
    12                 'This will render a form on the front end.',
    13                 'wporg-learn'
    14             ) }
     11            instructions={ __( 'This will render a form on the front end.', 'wporg-learn' ) }
    1512        />
    1613    );
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/workshop-application-form/src/index.js

    r10376 r13621  
    1212registerBlockType( 'wporg-learn/workshop-application-form', {
    1313    title: __( 'Workshop Application Form', 'wporg-learn' ),
    14     description: __(
    15         'Render a form for applying to present a workshop.',
    16         'wporg-learn'
    17     ),
     14    description: __( 'Render a form for applying to present a workshop.', 'wporg-learn' ),
    1815    category: 'widgets',
    1916    icon: 'forms',
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/workshop-details/src/edit.js

    r12096 r13621  
    55import { Placeholder } from '@wordpress/components';
    66
    7 import { useIsBlockInSidebar, useGetCurrentPostType } from '../../hooks';
     7import { useGetCurrentPostType, useIsBlockInSidebar } from '../../hooks';
    88import { getBlockPlaceholderMessage } from '../../utils';
    99
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/workshop-details/src/index.js

    r10169 r13621  
    4343     * It will be shown in the Block Tab in the Settings Sidebar.
    4444     */
    45     description: __(
    46         'Show details about the workshop, pulled from post meta.',
    47         'wporg-learn'
    48     ),
     45    description: __( 'Show details about the workshop, pulled from post meta.', 'wporg-learn' ),
    4946
    5047    /**
Note: See TracChangeset for help on using the changeset viewer.