Skip to content

Commit

Permalink
Merge branch 'main' into new-rule
Browse files Browse the repository at this point in the history
# Conflicts:
#	packages/story-editor/src/components/mediaRecording/provider.js
  • Loading branch information
spacedmonkey committed Jul 4, 2022
2 parents 1453124 + 417843a commit 35e9968
Show file tree
Hide file tree
Showing 9 changed files with 276 additions and 219 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@
"packages/tinymce-button/**/*.js"
],
"rules":{
"@wordpress/data-no-store-string-literals": "error",
"no-restricted-imports": [
"error",
{
Expand Down
474 changes: 262 additions & 212 deletions package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { menuItemStyles } from './styles';
const StyledButton = styled(BaseButton)`
${menuItemStyles};
width: 100%;
width: auto;
${({ isHorizontal, isIconMenu, forcePadding, theme }) => {
const hasHeight = isHorizontal; // In a horizontal menu, all buttons are 32px high
Expand Down
2 changes: 2 additions & 0 deletions packages/stories-block/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@
"@wordpress/blocks": "^11.10.0",
"@wordpress/components": "^19.13.0",
"@wordpress/compose": "^5.9.0",
"@wordpress/core-data": "^4.10.0",
"@wordpress/data": "^6.11.0",
"@wordpress/date": "^4.11.0",
"@wordpress/element": "^4.9.0",
"@wordpress/i18n": "^4.11.0",
"@wordpress/icons": "^9.2.0",
"@wordpress/notices": "^3.12.0",
"@wordpress/url": "^3.12.0",
"@wordpress/viewport": "^4.9.0",
"classnames": "^2.3.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import * as compose from '@wordpress/compose';
import { withViewportMatch } from '@wordpress/viewport';
import { useDispatch, useSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';
import { store as blockEditorStore } from '@wordpress/block-editor';

/**
* Internal dependencies
Expand Down Expand Up @@ -195,15 +196,15 @@ function StoryEmbedEdit({
}, []);

const { isRTL, maxWidth } = useSelect((select) => {
const { getSettings } = select('core/block-editor');
const { getSettings } = select(blockEditorStore);
const settings = getSettings();
return {
isRTL: settings.isRTL,
maxWidth: settings.maxWidth,
};
}, []);

const { toggleSelection } = useDispatch('core/block-editor');
const { toggleSelection } = useDispatch(blockEditorStore);

if (showLoadingIndicator) {
return <EmbedLoadinng />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { useEffect } from '@wordpress/element';
import apiFetch from '@wordpress/api-fetch';
import { addQueryArgs } from '@wordpress/url';
import { useDispatch } from '@wordpress/data';
import { store as noticesStore } from '@wordpress/notices';

/**
* Internal dependencies
Expand All @@ -47,7 +48,7 @@ function FetchSelectedStories({
setSelectedStories,
setIsFetching,
}) {
const { createErrorNotice } = useDispatch('core/notices');
const { createErrorNotice } = useDispatch(noticesStore);

const fetchStories = async () => {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
} from '@wordpress/components';
import { useSelect } from '@wordpress/data';
import { useDebounce } from '@wordpress/compose';
import { store as coreStore } from '@wordpress/core-data';

/**
* Internal dependencies
Expand Down Expand Up @@ -139,7 +140,7 @@ function SelectStories({
search: authorKeyword,
};

const { getAuthors } = select('core');
const { getAuthors } = select(coreStore);

return {
// Not using `getUsers()` because it requires `list_users` capability.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { useState, useEffect, useCallback } from '@wordpress/element';
import apiFetch from '@wordpress/api-fetch';
import { useDispatch } from '@wordpress/data';
import { addQueryArgs } from '@wordpress/url';
import { store as noticesStore } from '@wordpress/notices';

/**
* Internal dependencies
Expand All @@ -49,7 +50,7 @@ function StoryPicker({
setIsSortingStories = () => {},
maxNumOfStories,
}) {
const { createErrorNotice } = useDispatch('core/notices');
const { createErrorNotice } = useDispatch(noticesStore);

const [localSelectedStories, setLocalSelectedStories] =
useState(selectedStories);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function MediaRecordingProvider({ children }) {
trackError('media_recording_capture', e.message);
showSnackbar({
message: __(
'There was an error taking a photo. Please try again.',
'There was an error recording a video. Please try again.',
'web-stories'
),
dismissable: true,
Expand Down

0 comments on commit 35e9968

Please sign in to comment.