Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
250 changes: 125 additions & 125 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
"@types/node": "^24.7.1",
"@types/styled-components": "^5.1.26",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^8.58.0",
"@typescript-eslint/parser": "^8.58.0",
"@typescript-eslint/eslint-plugin": "^8.63.0",
"@typescript-eslint/parser": "^8.63.0",
"@web-stories-wp/e2e-tests": "*",
"@web-stories-wp/eslint-import-resolver": "*",
"@web-stories-wp/jest-amp": "*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function getInitialStyleFromKeyframes(keyframes: Keyframes) {
if (Array.isArray(value)) {
initialStyle[`--initial-${key}`] = value[0] as CSSProperty;
} else {
initialStyle[`--initial-${key}`] = value as CSSProperty;
initialStyle[`--initial-${key}`] = value;
}
}
});
Expand Down
7 changes: 1 addition & 6 deletions packages/commander/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,10 @@
let newVersion: string | null = version || currentVersion;

if (increment) {
newVersion = semverInc(
currentVersion,
increment,
undefined,
preid
) as string;
newVersion = semverInc(currentVersion, increment, undefined, preid);
}

updateVersionNumbers(pluginFilePath, newVersion, nightly);

Check failure on line 90 in packages/commander/src/index.ts

View workflow job for this annotation

GitHub Actions / Lint

Argument of type 'string | null' is not assignable to parameter of type 'string'.
const constantVersion = getCurrentVersionNumber(pluginFilePath, true);

console.log(
Expand Down
4 changes: 2 additions & 2 deletions packages/design-system/src/components/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ type Props = PropsWithChildren<{
isToggled?: boolean;
}>;

const Button = forwardRef(function Button(
const Button = forwardRef(function ButtonRender(
{
size = ButtonSize.Medium,
type = ButtonType.Plain,
Expand Down Expand Up @@ -328,7 +328,7 @@ const Button = forwardRef(function Button(
}
});

const ButtonAsLink = forwardRef(function ButtonAsLink(
const ButtonAsLink = forwardRef(function ButtonAsLinkRender(
{
size = ButtonSize.Medium,
type = ButtonType.Plain,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export interface MenuButtonProps extends ComponentPropsWithoutRef<
/**
* A styled button for use in the context menu.
*/
const Button = forwardRef(function Button(
const Button = forwardRef(function ButtonRender(
{
id,
onBlur,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export interface MenuItemProps extends ComponentPropsWithoutRef<
className?: string;
}

const MenuItem = forwardRef(function MenuItem(
const MenuItem = forwardRef(function MenuItemRender(
{
label,
shortcut,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const Container = styled.div`
flex-grow: 1;
`;

const Datalist = forwardRef(function Datalist<O extends AbstractOption>(
const Datalist = forwardRef(function DatalistRender<O extends AbstractOption>(
{
onChange,
disabled = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const Input = styled.input.attrs({

const MAX_INPUT_SIZE = 35;

const SearchInput = forwardRef(function SearchInput(
const SearchInput = forwardRef(function SearchInputRender(
{
isExpanded,
onClose,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import DropDownSelect from './select';
import useDropDown from './useDropDown';
import type { DropDownProps } from './types';

const DropDown = forwardRef(function DropDown(
const DropDown = forwardRef(function DropDownRender(
{
ariaLabel,
disabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import useNumericInput from './useNumericInput';
import Input from './input';
import type { NumericInputProps } from './types';

const NumericInput = forwardRef(function NumericInput(
const NumericInput = forwardRef(function NumericInputRender(
{
allowEmpty,
isFloat,
Expand Down
6 changes: 1 addition & 5 deletions packages/design-system/src/components/keyboard/keyboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,7 @@ function useKeyEffectInternal(
const mousetrap = getOrCreateMousetrap(
nodeEl as HTMLElementWithMouseTrap
);
const handler = createKeyHandler(
nodeEl as HTMLElement,
keySpec,
batchingCallback
);
const handler = createKeyHandler(nodeEl, keySpec, batchingCallback);
mousetrap.bind(keySpec.key, handler, type);
return () => {
mousetrap.unbind(keySpec.key, type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ interface MediaInputProps extends Omit<
value: string;
}

const MediaInput = forwardRef(function MediaInput(
const MediaInput = forwardRef(function MediaInputRender(
{
className,
onBlur,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const ActiveIcon = styled(CheckmarkSmall)`
transform: translateY(-50%);
`;

const DefaultListItem = forwardRef(function DefaultListItem(
const DefaultListItem = forwardRef(function DefaultListItemRender(
{ option, isSelected, ...rest }: DefaultListItemProps,
ref: ForwardedRef<HTMLLIElement>
) {
Expand Down
2 changes: 1 addition & 1 deletion packages/design-system/src/components/pill/pill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ interface PillProps extends ComponentPropsWithoutRef<'button'> {
pillStyleOverride?: string;
}

const Pill = forwardRef(function Pill(
const Pill = forwardRef(function PillRender(
{
children,
isActive,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
},
};
}
return page as PageV39;
return page;

Check failure on line 111 in packages/migration/src/migrations/v0039_backgroundAudioFormatting.ts

View workflow job for this annotation

GitHub Actions / Lint

Type 'PageV38' is not assignable to type 'PageV39'.
}

export default backgroundAudioFormatting;
4 changes: 2 additions & 2 deletions packages/output/src/utils/test/getPreloadResources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ describe('getPreloadResources', () => {
elements: [
{ ...VIDEO_ELEMENT, isBackground: true } as BackgroundableElement,
],
} as Page,
},
];
const result = getPreloadResources(pages);
expect(result).toStrictEqual([
Expand All @@ -151,7 +151,7 @@ describe('getPreloadResources', () => {
elements: [
{ ...IMAGE_ELEMENT, isBackground: true } as BackgroundableElement,
],
} as Page,
},
];
const result = getPreloadResources(pages);
expect(result).toStrictEqual([
Expand Down
5 changes: 2 additions & 3 deletions packages/output/src/utils/test/getUsedAmpExtensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*/
import { ElementType } from '@googleforcreators/elements';
import type {
BackgroundAudio,
Page,
ProductElement,
VideoElement,
Expand Down Expand Up @@ -160,7 +159,7 @@ describe('getUsedAmpExtensions', () => {
],
} as VideoElement,
],
} as Page,
},
];

const actual = getUsedAmpExtensions(pages);
Expand Down Expand Up @@ -193,7 +192,7 @@ describe('getUsedAmpExtensions', () => {
kind: 'captions',
},
],
} as BackgroundAudio,
},
elements: [],
},
];
Expand Down
5 changes: 3 additions & 2 deletions packages/rich-text/src/getPastedBlocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ type ConvertFromHTMLReturn = {
entityMap: Record<string, unknown>;
};
function getPastedBlocks(html: string, existingStyles: string[] = []) {
const { contentBlocks, entityMap } = convertFromHTML(
const converted: ConvertFromHTMLReturn = convertFromHTML(
html,
undefined /* This has to be undefined to trigger default argument */,
RENDER_MAP
) as ConvertFromHTMLReturn;
);
const { contentBlocks, entityMap } = converted;
const pastedContentState = ContentState.createFromBlockArray(
contentBlocks,
entityMap
Expand Down
16 changes: 9 additions & 7 deletions packages/stories-block/src/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,16 @@ function runWithViewTransition(f: () => void) {
}
}

const initialState: State = {
lightboxElement: null,
player: null,
stories: [],
instanceId: null,
currentLocation: null,
};

const { state, actions } = store('web-stories-block', {
state: {
lightboxElement: null,
player: null,
stories: [],
instanceId: null,
currentLocation: null,
} as State,
state: initialState,
actions: {
storyContentReady: (
storyObject: StoryDef,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ interface PageWithDepsProps {
containerHeight: number;
}
const PageWithDependencies = forwardRef<HTMLDivElement, PageWithDepsProps>(
function PageWithDependencies(
function PageWithDependenciesRender(
{
page,
width,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import type { Page, Story } from '@googleforcreators/elements';
* Internal dependencies
*/
import getSessionStorageKey from '../../../utils/getSessionStorageKey';
import type { ReducerState, Capabilities, Restore } from '../../../types';
import type { Capabilities, Restore } from '../../../types';

interface UseLocalAutoSaveProps {
restore: Restore;
Expand Down Expand Up @@ -54,7 +54,7 @@ function useLocalAutoSave({
selection: [],
capabilities,
...existingAutoSave,
} as Partial<ReducerState>);
});
}, [restore, storyId, pages, capabilities, isNew]);

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* External dependencies
*/
import { produce } from 'immer';
import { elementIs, type Element } from '@googleforcreators/elements';
import { elementIs } from '@googleforcreators/elements';

/**
* Internal dependencies
Expand Down Expand Up @@ -102,11 +102,7 @@ export const setBackgroundElement = (

// Reorder elements and set element opacity to 100% because backgrounds
// cannot be transparent.
page.elements = moveArrayElement(
page.elements,
currentPosition,
0
) as unknown as Element[];
page.elements = moveArrayElement(page.elements, currentPosition, 0);
page.elements.forEach((element) => {
// Set isBackground for the element.
if (element.id === elementId && elementIs.backgroundable(element)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/story-editor/src/app/uploader/useUploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function useUploader() {
/**
* Validates a file for upload.
*
* @throws Throws an error if file doesn't meet requirements.
* @throws {Error} Throws an error if file doesn't meet requirements.
* @param {Object} args
* @param {Object} args.file File object.
* @param {boolean} args.canTranscodeFile Whether file can be transcoded by consumer.
Expand Down
2 changes: 1 addition & 1 deletion packages/story-editor/src/utils/getMediaBaseColor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async function extractColorFromImage(img: HTMLImageElement): Promise<string> {
if (err instanceof Error) {
void trackError('image_base_color', err.message);
}
reject(err as Error);
reject(err instanceof Error ? err : new Error(String(err)));
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions packages/templates/scripts/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
* External dependencies
*/
import fs from 'fs';
import puppeteer from 'puppeteer';
import { launch } from 'puppeteer';

const screenshotsPath = `build/template-posters/`;

fs.mkdirSync(screenshotsPath, { recursive: true });

(async () => {
const browser = await puppeteer.launch({
const browser = await launch({
defaultViewport: null,
headless: true,
args: [`--window-size=1600,854`],
Expand Down
2 changes: 1 addition & 1 deletion packages/templates/src/getTemplates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* External dependencies
*/
import { getTimeTracker } from '@googleforcreators/tracking';
import { DATA_VERSION, migrate } from '@googleforcreators/migration';

Check failure on line 21 in packages/templates/src/getTemplates.ts

View workflow job for this annotation

GitHub Actions / Lint

Cannot find module '@googleforcreators/migration' or its corresponding type declarations.
import type {
MediaElement,
Element,
Expand Down Expand Up @@ -97,7 +97,7 @@
return {
...(migrate(template, template.version) as unknown as Template),
version: DATA_VERSION,
} as Template;
};
}

async function getTemplates(imageBaseUrl: string) {
Expand Down
4 changes: 2 additions & 2 deletions packages/text-sets/scripts/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
* External dependencies
*/
import fs from 'fs';
import puppeteer from 'puppeteer';
import { launch } from 'puppeteer';

const screenshotsPath = `build/text-sets/`;
fs.mkdirSync(screenshotsPath, { recursive: true });

(async () => {
const browser = await puppeteer.launch({
const browser = await launch({
defaultViewport: null,
headless: true,
args: [`--window-size=1600,800`],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
* control-specific data, to be fed to the imgAreaSelect plugin in
* wp.media.view.Cropper.
*
* @param {window.wp.media.model.Attachment} attachment Attachment object.
* @param {window.wp.media.controller.Cropper} controller wp.media controller object.
* @param {Object} attachment Attachment object.
* @param {Object} controller wp.media controller object.
* @return {Object} Options
*/
const calculateImageSelectOptions = (attachment, controller) => {
Expand Down
Loading