diff --git a/assets/admin/course-pre-publish-panel/course-pre-publish-panel.js b/assets/admin/course-pre-publish-panel/course-pre-publish-panel.js index 1face149d0..f5efcd01b4 100644 --- a/assets/admin/course-pre-publish-panel/course-pre-publish-panel.js +++ b/assets/admin/course-pre-publish-panel/course-pre-publish-panel.js @@ -3,7 +3,8 @@ */ import { __ } from '@wordpress/i18n'; import { useEntityProp } from '@wordpress/core-data'; -import { PluginPrePublishPanel } from '@wordpress/edit-post'; +import { PluginPrePublishPanel as DeprecatedPluginPrePublishPanel } from '@wordpress/edit-post'; +import { PluginPrePublishPanel as NewPluginPrePublishPanel } from '@wordpress/editor'; import { ToggleControl } from '@wordpress/components'; /** @@ -11,6 +12,9 @@ import { ToggleControl } from '@wordpress/components'; */ import SenseiIcon from '../../icons/logo-tree.svg'; +const PluginPrePublishPanel = + NewPluginPrePublishPanel || DeprecatedPluginPrePublishPanel; + /** * Course pre-publish panel. */ diff --git a/assets/admin/editor-wizard/patterns-list.js b/assets/admin/editor-wizard/patterns-list.js index 6cc9449805..45b1ef22dc 100644 --- a/assets/admin/editor-wizard/patterns-list.js +++ b/assets/admin/editor-wizard/patterns-list.js @@ -137,7 +137,9 @@ const PatternsList = ( { onChoose } ) => { >
state, }; -export const store = createReduxStore( SENSEI_TOUR_STORE, { +export const SENSEI_TOUR_STORE = createStore( 'sensei/tour', { reducer: createReducerFromActionMap( reducers, DEFAULT_STATE ), actions, selectors, controls, } ); - -register( store ); diff --git a/assets/admin/tour/lesson-tour/steps.js b/assets/admin/tour/lesson-tour/steps.js index 516d649f30..989271986e 100644 --- a/assets/admin/tour/lesson-tour/steps.js +++ b/assets/admin/tour/lesson-tour/steps.js @@ -8,7 +8,6 @@ import { ExternalLink } from '@wordpress/components'; import { select, dispatch } from '@wordpress/data'; import { store as blockEditorStore } from '@wordpress/block-editor'; import { store as editPostStore } from '@wordpress/edit-post'; -import { store as editorStore } from '@wordpress/editor'; /** * Internal dependencies @@ -59,7 +58,7 @@ export const focusOnQuizBlock = () => { if ( ! quizBlock ) { return; } - dispatch( editorStore ).selectBlock( quizBlock.clientId ); + dispatch( blockEditorStore ).selectBlock( quizBlock.clientId ); }; export const focusOnQuestionBlock = () => { @@ -67,7 +66,7 @@ export const focusOnQuestionBlock = () => { if ( ! questionBlock ) { return; } - dispatch( editorStore ).selectBlock( questionBlock.clientId ); + dispatch( blockEditorStore ).selectBlock( questionBlock.clientId ); }; export const focusOnBooleanQuestionBlock = () => { @@ -75,7 +74,7 @@ export const focusOnBooleanQuestionBlock = () => { if ( ! questionBlock ) { return; } - dispatch( editorStore ).selectBlock( questionBlock.clientId ); + dispatch( blockEditorStore ).selectBlock( questionBlock.clientId ); }; export const ensureBooleanQuestionIsInEditor = () => { diff --git a/assets/blocks/course-actions-block/course-status-toolbar.js b/assets/blocks/course-actions-block/course-status-toolbar.js index 1ef444265a..17d60ad026 100644 --- a/assets/blocks/course-actions-block/course-status-toolbar.js +++ b/assets/blocks/course-actions-block/course-status-toolbar.js @@ -1,7 +1,7 @@ /** * WordPress dependencies */ -import { Toolbar } from '@wordpress/components'; +import { ToolbarGroup } from '@wordpress/components'; import { useContext } from '@wordpress/element'; /** @@ -41,14 +41,14 @@ const CourseStatusToolbar = ( { : setCourseStatus; return ( - + - + ); }; diff --git a/assets/blocks/course-outline/lesson-block/lesson-edit-toolbar.js b/assets/blocks/course-outline/lesson-block/lesson-edit-toolbar.js index 9fc5442536..7049c3cfe2 100644 --- a/assets/blocks/course-outline/lesson-block/lesson-edit-toolbar.js +++ b/assets/blocks/course-outline/lesson-block/lesson-edit-toolbar.js @@ -1,7 +1,13 @@ /** * WordPress dependencies */ -import { Button, Spinner, Toolbar, ToolbarItem } from '@wordpress/components'; +import { + Button, + Spinner, + ToolbarGroup, + ToolbarItem, +} from '@wordpress/components'; +import { forwardRef } from '@wordpress/element'; import { useDispatch, useSelect } from '@wordpress/data'; import { store as editPostStore } from '@wordpress/edit-post'; import { store as editorStore } from '@wordpress/editor'; @@ -19,14 +25,19 @@ const getLessonURL = ( lessonId ) => `post.php?post=${ lessonId }&action=edit`; * * @param {Object} props Component props. * @param {number} props.lessonId The lesson ID. + * @param {Object} forwardedRef The forwarded ref. */ -export const EditLessonLink = ( { lessonId } ) => ( - - { __( 'Edit lesson', 'sensei-lms' ) } - +export const EditLessonLink = forwardRef( + ( { lessonId, ...props }, forwardedRef ) => ( + + { __( 'Edit lesson', 'sensei-lms' ) } + + ) ); /** @@ -70,12 +81,18 @@ const LessonEditToolbar = ( { lessonId, lessonTitle } ) => { let toolbarItem = savePostLink; if ( lessonId ) { - toolbarItem = ; + toolbarItem = ( + + ); } else if ( isSavingPost || isSavingStructure || isSavingMetaBoxes ) { toolbarItem = savingPostIndicator; } - return { toolbarItem }; + return ( + + { toolbarItem } + + ); }; export default LessonEditToolbar; diff --git a/assets/blocks/course-outline/lesson-block/lesson-settings.js b/assets/blocks/course-outline/lesson-block/lesson-settings.js index 51da048122..43b9c9d1ee 100644 --- a/assets/blocks/course-outline/lesson-block/lesson-settings.js +++ b/assets/blocks/course-outline/lesson-block/lesson-settings.js @@ -51,6 +51,7 @@ const LessonSettings = ( { ) } { diff --git a/assets/blocks/course-outline/status-preview/status-store.js b/assets/blocks/course-outline/status-preview/status-store.js index e094942b12..807207e22a 100644 --- a/assets/blocks/course-outline/status-preview/status-store.js +++ b/assets/blocks/course-outline/status-preview/status-store.js @@ -1,14 +1,17 @@ /** * WordPress dependencies */ -import { select as selectData, registerStore } from '@wordpress/data'; +import { select as selectData } from '@wordpress/data'; /** * Internal dependencies */ import { Status } from './index'; import { select, controls } from '@wordpress/data-controls'; -import { createReducerFromActionMap } from '../../../shared/data/store-helpers'; +import { + createStore, + createReducerFromActionMap, +} from '../../../shared/data/store-helpers'; const DEFAULT_STATE = { completedLessons: [], @@ -311,9 +314,7 @@ const reducers = { DEFAULT: ( action, state ) => state, }; -export const COURSE_STATUS_STORE = 'sensei/course-status'; - -registerStore( COURSE_STATUS_STORE, { +export const COURSE_STATUS_STORE = createStore( 'sensei/course-status', { reducer: createReducerFromActionMap( reducers, DEFAULT_STATE ), actions, selectors, diff --git a/assets/blocks/course-progress-block/block.json b/assets/blocks/course-progress-block/block.json index 4d35c3ed74..8041b8ddf8 100644 --- a/assets/blocks/course-progress-block/block.json +++ b/assets/blocks/course-progress-block/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 2, "name": "sensei-lms/course-progress", "title": "Course Progress", "description": "Display the user's progress in the course. This block is only displayed if the user is enrolled.", diff --git a/assets/blocks/editor-components/toolbar-dropdown/index.js b/assets/blocks/editor-components/toolbar-dropdown/index.js index 39de0d01cf..063f7c96da 100644 --- a/assets/blocks/editor-components/toolbar-dropdown/index.js +++ b/assets/blocks/editor-components/toolbar-dropdown/index.js @@ -7,11 +7,9 @@ import classnames from 'classnames'; * WordPress dependencies */ import { - Button, - Dropdown, MenuGroup, MenuItem, - NavigableMenu, + ToolbarDropdownMenu, } from '@wordpress/components'; import { check } from '@wordpress/icons'; @@ -48,10 +46,10 @@ const ToolbarDropdown = ( { const selectedOption = options.find( ( option ) => value === option.value ); return ( - ( -
diff --git a/assets/blocks/quiz/question-block/question-grade-toolbar.js b/assets/blocks/quiz/question-block/question-grade-toolbar.js index 539130b6a2..f50be7517f 100644 --- a/assets/blocks/quiz/question-block/question-grade-toolbar.js +++ b/assets/blocks/quiz/question-block/question-grade-toolbar.js @@ -1,7 +1,7 @@ /** * WordPress dependencies */ -import { ToolbarGroup } from '@wordpress/components'; +import { ToolbarGroup, ToolbarItem } from '@wordpress/components'; /** * Internal dependencies */ @@ -18,7 +18,11 @@ export const QuestionGradeToolbar = ( { value, onChange } ) => { return ( <> - + ); diff --git a/assets/blocks/quiz/question-block/question-type-toolbar.js b/assets/blocks/quiz/question-block/question-type-toolbar.js index fab4f10f3e..09d9e42c85 100644 --- a/assets/blocks/quiz/question-block/question-type-toolbar.js +++ b/assets/blocks/quiz/question-block/question-type-toolbar.js @@ -1,7 +1,7 @@ /** * WordPress dependencies */ -import { Toolbar } from '@wordpress/components'; +import { ToolbarGroup } from '@wordpress/components'; import { applyFilters } from '@wordpress/hooks'; import { __ } from '@wordpress/i18n'; @@ -20,7 +20,7 @@ import ToolbarDropdown from '../../editor-components/toolbar-dropdown'; */ export const QuestionTypeToolbar = ( { value, onSelect, options } ) => { return ( - + { return props; } } /> - + ); }; diff --git a/assets/blocks/quiz/question-block/single-question.js b/assets/blocks/quiz/question-block/single-question.js index 57cfb6b0cb..4cdc155157 100644 --- a/assets/blocks/quiz/question-block/single-question.js +++ b/assets/blocks/quiz/question-block/single-question.js @@ -5,15 +5,24 @@ import { Notice } from '@wordpress/components'; import { useCallback } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; import { - PluginPostStatusInfo, - PluginPrePublishPanel, + PluginPostStatusInfo as DeprecatedPluginPostStatusInfo, + PluginPrePublishPanel as DeprecatedPluginPrePublishPanel, } from '@wordpress/edit-post'; +import { + PluginPostStatusInfo as NewPluginPostStatusInfo, + PluginPrePublishPanel as NewPluginPrePublishPanel, +} from '@wordpress/editor'; /** * Internal dependencies */ import { Effect, usePostSavingEffect } from '../../../shared/helpers/blocks'; +const PluginPostStatusInfo = + NewPluginPostStatusInfo || DeprecatedPluginPostStatusInfo; +const PluginPrePublishPanel = + NewPluginPrePublishPanel || DeprecatedPluginPrePublishPanel; + /** * Additional controls for a question block in the single question editor. * diff --git a/assets/blocks/quiz/quiz-block/pagination-settings.js b/assets/blocks/quiz/quiz-block/pagination-settings.js index 45f9d6960b..cf3956911a 100644 --- a/assets/blocks/quiz/quiz-block/pagination-settings.js +++ b/assets/blocks/quiz/quiz-block/pagination-settings.js @@ -6,7 +6,7 @@ import { PanelRow, ToggleControl, SelectControl, - Toolbar, + ToolbarItem, ToolbarGroup, } from '@wordpress/components'; import { __, _n } from '@wordpress/i18n'; @@ -171,17 +171,18 @@ export const PaginationToolbarSettings = ( { settings, updatePagination } ) => { return ( <> - + - + { paginationNumber !== null && ( - diff --git a/assets/blocks/quiz/quiz-block/quiz-validation.js b/assets/blocks/quiz/quiz-block/quiz-validation.js index 9d077ba0a1..80dd43862d 100644 --- a/assets/blocks/quiz/quiz-block/quiz-validation.js +++ b/assets/blocks/quiz/quiz-block/quiz-validation.js @@ -4,11 +4,16 @@ import { Notice } from '@wordpress/components'; import { useDispatch, useSelect } from '@wordpress/data'; import { - PluginPostStatusInfo, - PluginPrePublishPanel, + PluginPostStatusInfo as DeprecatedPluginPostStatusInfo, + PluginPrePublishPanel as DeprecatedPluginPrePublishPanel, } from '@wordpress/edit-post'; -import { useCallback } from '@wordpress/element'; +import { + PluginPostStatusInfo as NewPluginPostStatusInfo, + PluginPrePublishPanel as NewPluginPrePublishPanel, +} from '@wordpress/editor'; +import { useCallback, useMemo } from '@wordpress/element'; import { __, _n, sprintf } from '@wordpress/i18n'; +import { store as blockEditorStore } from '@wordpress/block-editor'; /** * Internal dependencies @@ -16,6 +21,54 @@ import { __, _n, sprintf } from '@wordpress/i18n'; import { BLOCK_META_STORE } from '../../../shared/blocks/block-metadata'; import { Effect, usePostSavingEffect } from '../../../shared/helpers/blocks'; +const PluginPostStatusInfo = + NewPluginPostStatusInfo || DeprecatedPluginPostStatusInfo; +const PluginPrePublishPanel = + NewPluginPrePublishPanel || DeprecatedPluginPrePublishPanel; + +/** + * Get incomplete questions for a quiz. + * + * @param {string} clientId + * @return {Object[]} Incomplete questions. + */ +const useIncompleteQuestions = ( clientId ) => { + const { questionBlocks } = useSelect( + ( select ) => ( { + questionBlocks: select( blockEditorStore ).getBlocks( clientId ), + } ), + [ clientId ] + ); + + const blockIds = useMemo( + () => questionBlocks.map( ( block ) => block.clientId ), + [ questionBlocks ] + ); + + const { errors } = useSelect( + ( select ) => ( { + errors: select( BLOCK_META_STORE ).getMultipleBlockMeta( + blockIds, + 'validationErrors' + ), + } ), + [ clientId, blockIds ] + ); + + const incompleteQuestions = useMemo( + () => + questionBlocks + .map( ( block ) => ( { + ...block, + errors: errors[ block.clientId ], + } ) ) + .filter( ( q ) => q.errors?.length ), + [ questionBlocks, errors ] + ); + + return incompleteQuestions; +}; + /** * Notice about incomplete questions in the quiz. * @@ -61,24 +114,7 @@ const IncompleteQuestionsNotice = ( { count, onClick } ) => ( * @param {Function} props.setMeta */ const QuizValidationResult = ( { clientId, setMeta } ) => { - const incompleteQuestions = useSelect( - ( select ) => { - const questionBlocks = select( 'core/block-editor' ).getBlocks( - clientId - ); - const errors = select( BLOCK_META_STORE ).getMultipleBlockMeta( - questionBlocks.map( ( block ) => block.clientId ), - 'validationErrors' - ); - return questionBlocks - .map( ( block ) => ( { - ...block, - errors: errors[ block.clientId ], - } ) ) - .filter( ( q ) => q.errors?.length ); - }, - [ clientId ] - ); + const incompleteQuestions = useIncompleteQuestions( clientId ); const toggleValidationErrors = useCallback( ( on = true ) => { @@ -87,7 +123,7 @@ const QuizValidationResult = ( { clientId, setMeta } ) => { [ setMeta ] ); - const { selectBlock } = useDispatch( 'core/block-editor' ); + const { selectBlock } = useDispatch( blockEditorStore ); const selectFirstIncompleteQuestionBlock = () => { if ( ! incompleteQuestions.length ) return; toggleValidationErrors( true ); diff --git a/assets/course-theme/blocks/register-template-blocks.js b/assets/course-theme/blocks/register-template-blocks.js index 2e85e931fd..81ea5761ba 100644 --- a/assets/course-theme/blocks/register-template-blocks.js +++ b/assets/course-theme/blocks/register-template-blocks.js @@ -36,8 +36,6 @@ export function registerTemplateBlocks( blocks ) { return; } - const isTemplate = - 'lesson' === postType && editPost.isEditingTemplate(); - toggleBlockRegistration( isTemplate ); + toggleBlockRegistration( false ); } ); } diff --git a/assets/extensions/store.js b/assets/extensions/store.js index 61267eb2c9..4394eee865 100644 --- a/assets/extensions/store.js +++ b/assets/extensions/store.js @@ -6,20 +6,17 @@ import { keyBy, merge, isEqual } from 'lodash'; /** * WordPress dependencies */ -import { - createReduxStore, - register, - select, - dispatch, - createRegistrySelector, -} from '@wordpress/data'; +import { select, dispatch, createRegistrySelector } from '@wordpress/data'; import { controls, apiFetch } from '@wordpress/data-controls'; import { __, sprintf } from '@wordpress/i18n'; /** * Internal dependencies */ -import { createReducerFromActionMap } from '../shared/data/store-helpers'; +import { + createStore, + createReducerFromActionMap, +} from '../shared/data/store-helpers'; import { logEvent } from '../shared/helpers/log-event'; import '../shared/data/api-fetch-preloaded-once'; @@ -357,12 +354,10 @@ const reducer = { DEFAULT: ( action, state ) => state, }; -export const EXTENSIONS_STORE = createReduxStore( 'sensei/extensions', { +export const EXTENSIONS_STORE = createStore( 'sensei/extensions', { reducer: createReducerFromActionMap( reducer, DEFAULT_STATE ), actions, selectors, resolvers, controls, } ); - -register( EXTENSIONS_STORE ); diff --git a/assets/js/admin/blocks-toggling-control.js b/assets/js/admin/blocks-toggling-control.js index 83df13213a..2af009abbf 100644 --- a/assets/js/admin/blocks-toggling-control.js +++ b/assets/js/admin/blocks-toggling-control.js @@ -3,6 +3,9 @@ */ import { select, dispatch } from '@wordpress/data'; import { __ } from '@wordpress/i18n'; +import { store as blockEditorStore } from '@wordpress/block-editor'; +import { store as editPostStore } from '@wordpress/edit-post'; +import { store as editorStore } from '@wordpress/editor'; /** * Internal dependencies @@ -39,9 +42,19 @@ const metaboxReplacements = { }; // WordPress data. -const blockEditorSelector = select( 'core/block-editor' ); -const editPostSelector = select( 'core/edit-post' ); -const editPostDispatcher = dispatch( 'core/edit-post' ); +const blockEditorSelector = select( blockEditorStore ); +const editorSelector = select( editorStore ); +const editorDispatcher = dispatch( editorStore ); +const editPostSelector = select( editPostStore ); +const editPostDispatcher = dispatch( editPostStore ); + +const isEditorPanelEnabled = editorSelector.isEditorPanelEnabled + ? editorSelector.isEditorPanelEnabled + : editPostSelector.isEditorPanelEnabled; + +const toggleEditorPanelEnabled = editorDispatcher.toggleEditorPanelEnabled + ? editorDispatcher.toggleEditorPanelEnabled + : editPostDispatcher.toggleEditorPanelEnabled; /** * Start blocks toggling control. @@ -86,11 +99,8 @@ export const startBlocksTogglingControl = ( postType ) => { Object.entries( metaboxReplacements[ postType ] ).forEach( ( [ metaboxName, blockDeps ] ) => { const enable = ! hasSomeBlocks( blockDeps ); - if ( - enable !== - editPostSelector.isEditorPanelEnabled( metaboxName ) - ) { - editPostDispatcher.toggleEditorPanelEnabled( metaboxName ); + if ( enable !== isEditorPanelEnabled( metaboxName ) ) { + toggleEditorPanelEnabled( metaboxName ); } } ); @@ -99,7 +109,7 @@ export const startBlocksTogglingControl = ( postType ) => { document .querySelectorAll( '#module_course_mb input' ) .forEach( ( input ) => { - input.disabled = ! editPostSelector.isEditorPanelEnabled( + input.disabled = ! isEditorPanelEnabled( 'meta-box-module_course_mb' ); } ); @@ -108,7 +118,7 @@ export const startBlocksTogglingControl = ( postType ) => { document .querySelectorAll( '#lesson-info input, #lesson-info select' ) .forEach( ( input ) => { - input.disabled = ! editPostSelector.isEditorPanelEnabled( + input.disabled = ! isEditorPanelEnabled( 'meta-box-lesson-info' ); } ); diff --git a/assets/js/admin/course-settings-plugin-sidebar.js b/assets/js/admin/course-settings-plugin-sidebar.js index b64b5c9805..e438cd77f6 100644 --- a/assets/js/admin/course-settings-plugin-sidebar.js +++ b/assets/js/admin/course-settings-plugin-sidebar.js @@ -3,10 +3,17 @@ */ import { applyFilters } from '@wordpress/hooks'; import { + store as editPostStore, + PluginDocumentSettingPanel as DeprecatedPluginDocumentSettingPanel, + PluginSidebar as DeprecatedPluginSidebar, + PluginSidebarMoreMenuItem as DeprecatedPluginSidebarMoreMenuItem, +} from '@wordpress/edit-post'; +import { + store as editorStore, PluginDocumentSettingPanel, PluginSidebar, PluginSidebarMoreMenuItem, -} from '@wordpress/edit-post'; +} from '@wordpress/editor'; import { __ } from '@wordpress/i18n'; import { dispatch, useSelect } from '@wordpress/data'; import { Slot } from '@wordpress/components'; @@ -21,6 +28,18 @@ import CourseVideoSidebar from './course-video-sidebar'; import CourseGeneralSidebar from './course-general-sidebar'; import SenseiIcon from '../../icons/logo-tree.svg'; +if ( ! PluginDocumentSettingPanel ) { + PluginDocumentSettingPanel = DeprecatedPluginDocumentSettingPanel; +} + +if ( ! PluginSidebar ) { + PluginSidebar = DeprecatedPluginSidebar; +} + +if ( ! PluginSidebarMoreMenuItem ) { + PluginSidebarMoreMenuItem = DeprecatedPluginSidebarMoreMenuItem; +} + export const pluginSidebarHandle = 'sensei-lms-course-settings-sidebar'; export const pluginDocumentHandle = 'sensei-lms-document-settings-sidebar'; @@ -73,17 +92,26 @@ export const CourseSidebar = () => { export const SenseiSettingsDocumentSidebar = () => { const isSenseiEditorPanelOpen = useSelect( ( select ) => { - return select( 'core/edit-post' ).isEditorPanelOpened( + const isEditorPanelOpened = select( editorStore ).isEditorPanelOpened + ? select( editorStore ).isEditorPanelOpened + : select( editPostStore ).isEditorPanelOpened; + + return isEditorPanelOpened( `${ pluginDocumentHandle }/${ pluginDocumentHandle }` ); } ); if ( isSenseiEditorPanelOpen ) { + const toggleEditorPanelOpened = dispatch( editorStore ) + .toggleEditorPanelOpened + ? dispatch( editorStore ).toggleEditorPanelOpened + : dispatch( editPostStore ).toggleEditorPanelOpened; + // when 'Course Settings' is clicked, isSenseiEditorPanelOpen returns true, so we open the 'Course Settings' // plugin sidebar and then close the 'Sensei Settings' panel which sets isSenseiEditorPanelOpen back to false. - dispatch( 'core/edit-post' ).openGeneralSidebar( + dispatch( editPostStore ).openGeneralSidebar( `${ pluginSidebarHandle }/${ pluginSidebarHandle }` ); - dispatch( 'core/edit-post' ).toggleEditorPanelOpened( + toggleEditorPanelOpened( `${ pluginDocumentHandle }/${ pluginDocumentHandle }` ); } diff --git a/assets/shared/blocks/block-metadata.js b/assets/shared/blocks/block-metadata.js index 33f485f862..6e023b646a 100644 --- a/assets/shared/blocks/block-metadata.js +++ b/assets/shared/blocks/block-metadata.js @@ -1,3 +1,9 @@ +/** + * External dependencies + */ +import { pick, mapValues } from 'lodash'; +import createSelector from 'rememo'; + /** * WordPress dependencies */ @@ -9,10 +15,7 @@ import { useContext, useMemo, } from '@wordpress/element'; -/** - * External dependencies - */ -import { pick, mapValues } from 'lodash'; + /** * Internal dependencies */ @@ -76,12 +79,15 @@ const store = { * @param {string} [key] Only return metadata for the given key. * @return {Object} Blocks metadata, indexed by block ID. */ - getMultipleBlockMeta: ( state, clientIds = [], key = null ) => { - const blocks = clientIds?.length - ? pick( state, clientIds ) - : { ...state }; - return key ? mapValues( blocks, key ) : blocks; - }, + getMultipleBlockMeta: createSelector( + ( state, clientIds = [], key = null ) => { + const blocks = clientIds?.length + ? pick( state, clientIds ) + : state; + return key ? mapValues( blocks, key ) : blocks; + }, + ( state ) => [ state ] + ), }, }; diff --git a/assets/shared/data/store-helpers.js b/assets/shared/data/store-helpers.js index ec496a9caa..063317294d 100644 --- a/assets/shared/data/store-helpers.js +++ b/assets/shared/data/store-helpers.js @@ -1,7 +1,12 @@ /** * WordPress dependencies */ -import { createReduxStore, register, registerStore } from '@wordpress/data'; +import { createReduxStore, register } from '@wordpress/data'; + +// We register the store in the global scope to avoid registering it multiple times. +// The reason to be in the global scope is that some times we have different built files using the same source. +window.senseiStores = window.senseiStores || []; +const { senseiStores } = window; /** * Compose an action creator with the given start, success and error actions. @@ -59,11 +64,12 @@ export const createReducerFromActionMap = ( reducers, defaultState ) => { * @return {string|Object} Store key. */ export const createStore = ( name, settings ) => { - if ( createReduxStore ) { - const store = createReduxStore( name, settings ); - register( store ); - return store; + if ( senseiStores[ name ] ) { + return senseiStores[ name ]; } - registerStore( name, settings ); - return name; + + const store = createReduxStore( name, settings ); + register( store ); + senseiStores[ name ] = store; + return store; }; diff --git a/package-lock.json b/package-lock.json index c366f0ed87..b89d00c6e0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,6 +42,7 @@ "memize": "1.1.0", "qrcode.react": "3.1.0", "react-animate-height": "2.0.23", + "rememo": "4.0.2", "terser-webpack-plugin": "5.3.1", "uuid": "7.0.3", "whatwg-fetch": "3.6.2" @@ -1891,11 +1892,6 @@ "react-with-styles": "^3.0.0 || ^4.0.0" } }, - "node_modules/@automattic/tour-kit/node_modules/rememo": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.2.tgz", - "integrity": "sha512-NVfSP9NstE3QPNs/TnegQY0vnJnstKQSpcrsI2kBTB3dB2PkdfKdTa+abbjMIDqpc63fE5LfjLgfMst0ULMFxQ==" - }, "node_modules/@automattic/tour-kit/node_modules/style-value-types": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/style-value-types/-/style-value-types-5.0.0.tgz", @@ -9820,9 +9816,9 @@ } }, "node_modules/@wordpress/block-editor/node_modules/@wordpress/blocks/node_modules/rememo": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.0.tgz", - "integrity": "sha512-6BAfg1Dqg6UteZBEH9k6EHHersM86/EcBOMtJV+h+xEn1GC3H+gAgJWpexWYAamAxD0qXNmIt50iS/zuZKnQag==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.2.tgz", + "integrity": "sha512-NVfSP9NstE3QPNs/TnegQY0vnJnstKQSpcrsI2kBTB3dB2PkdfKdTa+abbjMIDqpc63fE5LfjLgfMst0ULMFxQ==" }, "node_modules/@wordpress/block-editor/node_modules/@wordpress/components": { "version": "19.12.0", @@ -9975,9 +9971,9 @@ } }, "node_modules/@wordpress/block-editor/node_modules/@wordpress/keyboard-shortcuts/node_modules/rememo": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.0.tgz", - "integrity": "sha512-6BAfg1Dqg6UteZBEH9k6EHHersM86/EcBOMtJV+h+xEn1GC3H+gAgJWpexWYAamAxD0qXNmIt50iS/zuZKnQag==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.2.tgz", + "integrity": "sha512-NVfSP9NstE3QPNs/TnegQY0vnJnstKQSpcrsI2kBTB3dB2PkdfKdTa+abbjMIDqpc63fE5LfjLgfMst0ULMFxQ==" }, "node_modules/@wordpress/block-editor/node_modules/@wordpress/primitives": { "version": "3.8.0", @@ -10017,9 +10013,9 @@ } }, "node_modules/@wordpress/block-editor/node_modules/@wordpress/rich-text/node_modules/rememo": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.0.tgz", - "integrity": "sha512-6BAfg1Dqg6UteZBEH9k6EHHersM86/EcBOMtJV+h+xEn1GC3H+gAgJWpexWYAamAxD0qXNmIt50iS/zuZKnQag==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.2.tgz", + "integrity": "sha512-NVfSP9NstE3QPNs/TnegQY0vnJnstKQSpcrsI2kBTB3dB2PkdfKdTa+abbjMIDqpc63fE5LfjLgfMst0ULMFxQ==" }, "node_modules/@wordpress/block-editor/node_modules/framer-motion": { "version": "6.3.11", @@ -10118,6 +10114,11 @@ "react-with-styles": "^3.0.0 || ^4.0.0" } }, + "node_modules/@wordpress/block-editor/node_modules/rememo": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-3.0.0.tgz", + "integrity": "sha512-eWtut/7pqMRnSccbexb647iPjN7ir6Tmf4RG92ZVlykFEkHqGYy9tWnpHH3I+FS+WQ6lQ1i1iDgarYzGKgTcRQ==" + }, "node_modules/@wordpress/block-editor/node_modules/style-value-types": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/style-value-types/-/style-value-types-5.0.0.tgz", @@ -10338,6 +10339,11 @@ "node": ">=12" } }, + "node_modules/@wordpress/block-library/node_modules/rememo": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-3.0.0.tgz", + "integrity": "sha512-eWtut/7pqMRnSccbexb647iPjN7ir6Tmf4RG92ZVlykFEkHqGYy9tWnpHH3I+FS+WQ6lQ1i1iDgarYzGKgTcRQ==" + }, "node_modules/@wordpress/block-library/node_modules/uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -10428,6 +10434,11 @@ "node": ">=12" } }, + "node_modules/@wordpress/blocks/node_modules/rememo": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-3.0.0.tgz", + "integrity": "sha512-eWtut/7pqMRnSccbexb647iPjN7ir6Tmf4RG92ZVlykFEkHqGYy9tWnpHH3I+FS+WQ6lQ1i1iDgarYzGKgTcRQ==" + }, "node_modules/@wordpress/blocks/node_modules/uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -10508,6 +10519,11 @@ "node": ">=12" } }, + "node_modules/@wordpress/components/node_modules/rememo": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-3.0.0.tgz", + "integrity": "sha512-eWtut/7pqMRnSccbexb647iPjN7ir6Tmf4RG92ZVlykFEkHqGYy9tWnpHH3I+FS+WQ6lQ1i1iDgarYzGKgTcRQ==" + }, "node_modules/@wordpress/components/node_modules/uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -10635,6 +10651,11 @@ "node": ">=12" } }, + "node_modules/@wordpress/core-data/node_modules/rememo": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-3.0.0.tgz", + "integrity": "sha512-eWtut/7pqMRnSccbexb647iPjN7ir6Tmf4RG92ZVlykFEkHqGYy9tWnpHH3I+FS+WQ6lQ1i1iDgarYzGKgTcRQ==" + }, "node_modules/@wordpress/core-data/node_modules/uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -11112,6 +11133,11 @@ "node": ">=12" } }, + "node_modules/@wordpress/edit-post/node_modules/rememo": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-3.0.0.tgz", + "integrity": "sha512-eWtut/7pqMRnSccbexb647iPjN7ir6Tmf4RG92ZVlykFEkHqGYy9tWnpHH3I+FS+WQ6lQ1i1iDgarYzGKgTcRQ==" + }, "node_modules/@wordpress/edit-post/node_modules/uuid": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.0.tgz", @@ -11283,9 +11309,9 @@ } }, "node_modules/@wordpress/editor/node_modules/@wordpress/blocks/node_modules/rememo": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.0.tgz", - "integrity": "sha512-6BAfg1Dqg6UteZBEH9k6EHHersM86/EcBOMtJV+h+xEn1GC3H+gAgJWpexWYAamAxD0qXNmIt50iS/zuZKnQag==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.2.tgz", + "integrity": "sha512-NVfSP9NstE3QPNs/TnegQY0vnJnstKQSpcrsI2kBTB3dB2PkdfKdTa+abbjMIDqpc63fE5LfjLgfMst0ULMFxQ==" }, "node_modules/@wordpress/editor/node_modules/@wordpress/components": { "version": "19.12.0", @@ -11421,9 +11447,9 @@ } }, "node_modules/@wordpress/editor/node_modules/@wordpress/core-data/node_modules/rememo": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.0.tgz", - "integrity": "sha512-6BAfg1Dqg6UteZBEH9k6EHHersM86/EcBOMtJV+h+xEn1GC3H+gAgJWpexWYAamAxD0qXNmIt50iS/zuZKnQag==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.2.tgz", + "integrity": "sha512-NVfSP9NstE3QPNs/TnegQY0vnJnstKQSpcrsI2kBTB3dB2PkdfKdTa+abbjMIDqpc63fE5LfjLgfMst0ULMFxQ==" }, "node_modules/@wordpress/editor/node_modules/@wordpress/data": { "version": "6.10.0", @@ -11484,9 +11510,9 @@ } }, "node_modules/@wordpress/editor/node_modules/@wordpress/keyboard-shortcuts/node_modules/rememo": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.0.tgz", - "integrity": "sha512-6BAfg1Dqg6UteZBEH9k6EHHersM86/EcBOMtJV+h+xEn1GC3H+gAgJWpexWYAamAxD0qXNmIt50iS/zuZKnQag==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.2.tgz", + "integrity": "sha512-NVfSP9NstE3QPNs/TnegQY0vnJnstKQSpcrsI2kBTB3dB2PkdfKdTa+abbjMIDqpc63fE5LfjLgfMst0ULMFxQ==" }, "node_modules/@wordpress/editor/node_modules/@wordpress/media-utils": { "version": "3.6.0", @@ -11646,9 +11672,9 @@ } }, "node_modules/@wordpress/editor/node_modules/@wordpress/reusable-blocks/node_modules/rememo": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.0.tgz", - "integrity": "sha512-6BAfg1Dqg6UteZBEH9k6EHHersM86/EcBOMtJV+h+xEn1GC3H+gAgJWpexWYAamAxD0qXNmIt50iS/zuZKnQag==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.2.tgz", + "integrity": "sha512-NVfSP9NstE3QPNs/TnegQY0vnJnstKQSpcrsI2kBTB3dB2PkdfKdTa+abbjMIDqpc63fE5LfjLgfMst0ULMFxQ==" }, "node_modules/@wordpress/editor/node_modules/@wordpress/rich-text": { "version": "5.8.0", @@ -11675,9 +11701,9 @@ } }, "node_modules/@wordpress/editor/node_modules/@wordpress/rich-text/node_modules/rememo": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.0.tgz", - "integrity": "sha512-6BAfg1Dqg6UteZBEH9k6EHHersM86/EcBOMtJV+h+xEn1GC3H+gAgJWpexWYAamAxD0qXNmIt50iS/zuZKnQag==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.2.tgz", + "integrity": "sha512-NVfSP9NstE3QPNs/TnegQY0vnJnstKQSpcrsI2kBTB3dB2PkdfKdTa+abbjMIDqpc63fE5LfjLgfMst0ULMFxQ==" }, "node_modules/@wordpress/editor/node_modules/@wordpress/server-side-render": { "version": "3.8.0", @@ -11814,6 +11840,11 @@ "react-with-styles": "^3.0.0 || ^4.0.0" } }, + "node_modules/@wordpress/editor/node_modules/rememo": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-3.0.0.tgz", + "integrity": "sha512-eWtut/7pqMRnSccbexb647iPjN7ir6Tmf4RG92ZVlykFEkHqGYy9tWnpHH3I+FS+WQ6lQ1i1iDgarYzGKgTcRQ==" + }, "node_modules/@wordpress/editor/node_modules/style-value-types": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/style-value-types/-/style-value-types-5.0.0.tgz", @@ -12753,6 +12784,11 @@ "redux": "^4.1.0" } }, + "node_modules/@wordpress/keyboard-shortcuts/node_modules/rememo": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-3.0.0.tgz", + "integrity": "sha512-eWtut/7pqMRnSccbexb647iPjN7ir6Tmf4RG92ZVlykFEkHqGYy9tWnpHH3I+FS+WQ6lQ1i1iDgarYzGKgTcRQ==" + }, "node_modules/@wordpress/keycodes": { "version": "3.51.0", "resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-3.51.0.tgz", @@ -13206,6 +13242,11 @@ "node": ">=12" } }, + "node_modules/@wordpress/reusable-blocks/node_modules/rememo": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-3.0.0.tgz", + "integrity": "sha512-eWtut/7pqMRnSccbexb647iPjN7ir6Tmf4RG92ZVlykFEkHqGYy9tWnpHH3I+FS+WQ6lQ1i1iDgarYzGKgTcRQ==" + }, "node_modules/@wordpress/reusable-blocks/node_modules/uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -13262,6 +13303,11 @@ "redux": "^4.1.0" } }, + "node_modules/@wordpress/rich-text/node_modules/rememo": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-3.0.0.tgz", + "integrity": "sha512-eWtut/7pqMRnSccbexb647iPjN7ir6Tmf4RG92ZVlykFEkHqGYy9tWnpHH3I+FS+WQ6lQ1i1iDgarYzGKgTcRQ==" + }, "node_modules/@wordpress/scripts": { "version": "22.4.2", "resolved": "https://registry.npmjs.org/@wordpress/scripts/-/scripts-22.4.2.tgz", @@ -15772,6 +15818,11 @@ "node": ">=12" } }, + "node_modules/@wordpress/server-side-render/node_modules/rememo": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-3.0.0.tgz", + "integrity": "sha512-eWtut/7pqMRnSccbexb647iPjN7ir6Tmf4RG92ZVlykFEkHqGYy9tWnpHH3I+FS+WQ6lQ1i1iDgarYzGKgTcRQ==" + }, "node_modules/@wordpress/server-side-render/node_modules/uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -36668,8 +36719,9 @@ } }, "node_modules/rememo": { - "version": "3.0.0", - "license": "MIT" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.2.tgz", + "integrity": "sha512-NVfSP9NstE3QPNs/TnegQY0vnJnstKQSpcrsI2kBTB3dB2PkdfKdTa+abbjMIDqpc63fE5LfjLgfMst0ULMFxQ==" }, "node_modules/remove-accents": { "version": "0.4.4", @@ -42983,11 +43035,6 @@ "global-cache": "^1.2.1" } }, - "rememo": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.2.tgz", - "integrity": "sha512-NVfSP9NstE3QPNs/TnegQY0vnJnstKQSpcrsI2kBTB3dB2PkdfKdTa+abbjMIDqpc63fE5LfjLgfMst0ULMFxQ==" - }, "style-value-types": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/style-value-types/-/style-value-types-5.0.0.tgz", @@ -48736,9 +48783,9 @@ }, "dependencies": { "rememo": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.0.tgz", - "integrity": "sha512-6BAfg1Dqg6UteZBEH9k6EHHersM86/EcBOMtJV+h+xEn1GC3H+gAgJWpexWYAamAxD0qXNmIt50iS/zuZKnQag==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.2.tgz", + "integrity": "sha512-NVfSP9NstE3QPNs/TnegQY0vnJnstKQSpcrsI2kBTB3dB2PkdfKdTa+abbjMIDqpc63fE5LfjLgfMst0ULMFxQ==" } } }, @@ -48864,9 +48911,9 @@ }, "dependencies": { "rememo": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.0.tgz", - "integrity": "sha512-6BAfg1Dqg6UteZBEH9k6EHHersM86/EcBOMtJV+h+xEn1GC3H+gAgJWpexWYAamAxD0qXNmIt50iS/zuZKnQag==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.2.tgz", + "integrity": "sha512-NVfSP9NstE3QPNs/TnegQY0vnJnstKQSpcrsI2kBTB3dB2PkdfKdTa+abbjMIDqpc63fE5LfjLgfMst0ULMFxQ==" } } }, @@ -48899,9 +48946,9 @@ }, "dependencies": { "rememo": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.0.tgz", - "integrity": "sha512-6BAfg1Dqg6UteZBEH9k6EHHersM86/EcBOMtJV+h+xEn1GC3H+gAgJWpexWYAamAxD0qXNmIt50iS/zuZKnQag==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.2.tgz", + "integrity": "sha512-NVfSP9NstE3QPNs/TnegQY0vnJnstKQSpcrsI2kBTB3dB2PkdfKdTa+abbjMIDqpc63fE5LfjLgfMst0ULMFxQ==" } } }, @@ -48980,6 +49027,11 @@ "global-cache": "^1.2.1" } }, + "rememo": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-3.0.0.tgz", + "integrity": "sha512-eWtut/7pqMRnSccbexb647iPjN7ir6Tmf4RG92ZVlykFEkHqGYy9tWnpHH3I+FS+WQ6lQ1i1iDgarYzGKgTcRQ==" + }, "style-value-types": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/style-value-types/-/style-value-types-5.0.0.tgz", @@ -49180,6 +49232,11 @@ "@wordpress/primitives": "^2.2.0" } }, + "rememo": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-3.0.0.tgz", + "integrity": "sha512-eWtut/7pqMRnSccbexb647iPjN7ir6Tmf4RG92ZVlykFEkHqGYy9tWnpHH3I+FS+WQ6lQ1i1iDgarYzGKgTcRQ==" + }, "uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -49254,6 +49311,11 @@ "@wordpress/primitives": "^2.2.0" } }, + "rememo": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-3.0.0.tgz", + "integrity": "sha512-eWtut/7pqMRnSccbexb647iPjN7ir6Tmf4RG92ZVlykFEkHqGYy9tWnpHH3I+FS+WQ6lQ1i1iDgarYzGKgTcRQ==" + }, "uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -49321,6 +49383,11 @@ "@wordpress/primitives": "^2.2.0" } }, + "rememo": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-3.0.0.tgz", + "integrity": "sha512-eWtut/7pqMRnSccbexb647iPjN7ir6Tmf4RG92ZVlykFEkHqGYy9tWnpHH3I+FS+WQ6lQ1i1iDgarYzGKgTcRQ==" + }, "uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -49429,6 +49496,11 @@ "@wordpress/primitives": "^2.2.0" } }, + "rememo": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-3.0.0.tgz", + "integrity": "sha512-eWtut/7pqMRnSccbexb647iPjN7ir6Tmf4RG92ZVlykFEkHqGYy9tWnpHH3I+FS+WQ6lQ1i1iDgarYzGKgTcRQ==" + }, "uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -49830,6 +49902,11 @@ "@wordpress/primitives": "^2.2.0" } }, + "rememo": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-3.0.0.tgz", + "integrity": "sha512-eWtut/7pqMRnSccbexb647iPjN7ir6Tmf4RG92ZVlykFEkHqGYy9tWnpHH3I+FS+WQ6lQ1i1iDgarYzGKgTcRQ==" + }, "uuid": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.0.tgz", @@ -49980,9 +50057,9 @@ }, "dependencies": { "rememo": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.0.tgz", - "integrity": "sha512-6BAfg1Dqg6UteZBEH9k6EHHersM86/EcBOMtJV+h+xEn1GC3H+gAgJWpexWYAamAxD0qXNmIt50iS/zuZKnQag==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.2.tgz", + "integrity": "sha512-NVfSP9NstE3QPNs/TnegQY0vnJnstKQSpcrsI2kBTB3dB2PkdfKdTa+abbjMIDqpc63fE5LfjLgfMst0ULMFxQ==" } } }, @@ -50097,9 +50174,9 @@ } }, "rememo": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.0.tgz", - "integrity": "sha512-6BAfg1Dqg6UteZBEH9k6EHHersM86/EcBOMtJV+h+xEn1GC3H+gAgJWpexWYAamAxD0qXNmIt50iS/zuZKnQag==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.2.tgz", + "integrity": "sha512-NVfSP9NstE3QPNs/TnegQY0vnJnstKQSpcrsI2kBTB3dB2PkdfKdTa+abbjMIDqpc63fE5LfjLgfMst0ULMFxQ==" } } }, @@ -50147,9 +50224,9 @@ }, "dependencies": { "rememo": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.0.tgz", - "integrity": "sha512-6BAfg1Dqg6UteZBEH9k6EHHersM86/EcBOMtJV+h+xEn1GC3H+gAgJWpexWYAamAxD0qXNmIt50iS/zuZKnQag==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.2.tgz", + "integrity": "sha512-NVfSP9NstE3QPNs/TnegQY0vnJnstKQSpcrsI2kBTB3dB2PkdfKdTa+abbjMIDqpc63fE5LfjLgfMst0ULMFxQ==" } } }, @@ -50281,9 +50358,9 @@ } }, "rememo": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.0.tgz", - "integrity": "sha512-6BAfg1Dqg6UteZBEH9k6EHHersM86/EcBOMtJV+h+xEn1GC3H+gAgJWpexWYAamAxD0qXNmIt50iS/zuZKnQag==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.2.tgz", + "integrity": "sha512-NVfSP9NstE3QPNs/TnegQY0vnJnstKQSpcrsI2kBTB3dB2PkdfKdTa+abbjMIDqpc63fE5LfjLgfMst0ULMFxQ==" } } }, @@ -50306,9 +50383,9 @@ }, "dependencies": { "rememo": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.0.tgz", - "integrity": "sha512-6BAfg1Dqg6UteZBEH9k6EHHersM86/EcBOMtJV+h+xEn1GC3H+gAgJWpexWYAamAxD0qXNmIt50iS/zuZKnQag==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.2.tgz", + "integrity": "sha512-NVfSP9NstE3QPNs/TnegQY0vnJnstKQSpcrsI2kBTB3dB2PkdfKdTa+abbjMIDqpc63fE5LfjLgfMst0ULMFxQ==" } } }, @@ -50417,6 +50494,11 @@ "global-cache": "^1.2.1" } }, + "rememo": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-3.0.0.tgz", + "integrity": "sha512-eWtut/7pqMRnSccbexb647iPjN7ir6Tmf4RG92ZVlykFEkHqGYy9tWnpHH3I+FS+WQ6lQ1i1iDgarYzGKgTcRQ==" + }, "style-value-types": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/style-value-types/-/style-value-types-5.0.0.tgz", @@ -51134,6 +51216,11 @@ "turbo-combine-reducers": "^1.0.2", "use-memo-one": "^1.1.1" } + }, + "rememo": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-3.0.0.tgz", + "integrity": "sha512-eWtut/7pqMRnSccbexb647iPjN7ir6Tmf4RG92ZVlykFEkHqGYy9tWnpHH3I+FS+WQ6lQ1i1iDgarYzGKgTcRQ==" } } }, @@ -51503,6 +51590,11 @@ "@wordpress/primitives": "^2.2.0" } }, + "rememo": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-3.0.0.tgz", + "integrity": "sha512-eWtut/7pqMRnSccbexb647iPjN7ir6Tmf4RG92ZVlykFEkHqGYy9tWnpHH3I+FS+WQ6lQ1i1iDgarYzGKgTcRQ==" + }, "uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -51548,6 +51640,11 @@ "turbo-combine-reducers": "^1.0.2", "use-memo-one": "^1.1.1" } + }, + "rememo": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-3.0.0.tgz", + "integrity": "sha512-eWtut/7pqMRnSccbexb647iPjN7ir6Tmf4RG92ZVlykFEkHqGYy9tWnpHH3I+FS+WQ6lQ1i1iDgarYzGKgTcRQ==" } } }, @@ -53312,6 +53409,11 @@ "@wordpress/primitives": "^2.2.0" } }, + "rememo": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-3.0.0.tgz", + "integrity": "sha512-eWtut/7pqMRnSccbexb647iPjN7ir6Tmf4RG92ZVlykFEkHqGYy9tWnpHH3I+FS+WQ6lQ1i1iDgarYzGKgTcRQ==" + }, "uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -68316,7 +68418,9 @@ } }, "rememo": { - "version": "3.0.0" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/rememo/-/rememo-4.0.2.tgz", + "integrity": "sha512-NVfSP9NstE3QPNs/TnegQY0vnJnstKQSpcrsI2kBTB3dB2PkdfKdTa+abbjMIDqpc63fE5LfjLgfMst0ULMFxQ==" }, "remove-accents": { "version": "0.4.4", diff --git a/package.json b/package.json index 228b9b93f6..fe0578677f 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "memize": "1.1.0", "qrcode.react": "3.1.0", "react-animate-height": "2.0.23", + "rememo": "4.0.2", "terser-webpack-plugin": "5.3.1", "uuid": "7.0.3", "whatwg-fetch": "3.6.2" @@ -176,4 +177,4 @@ "woorelease": { "wp_org_slug": "sensei-lms" } -} \ No newline at end of file +}