Skip to content

Commit 2c9930a

Browse files
committed
chore: regenerate package-lock and re-fix prettier
1 parent 64b53fe commit 2c9930a

File tree

10 files changed

+177
-201
lines changed

10 files changed

+177
-201
lines changed

package-lock.json

Lines changed: 145 additions & 148 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"dev": "docusaurus start",
1717
"swizzle": "docusaurus swizzle",
1818
"check-types": "tsc",
19+
"test": "npm run prettier && npm run eslint && npm run check-types",
1920
"write-heading-ids": "docusaurus write-heading-ids",
2021
"write-translations": "docusaurus write-translations"
2122
},

src/components/camera/CameraProvider.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import { produce } from 'immer';
2-
import type { ReactNode} from 'react';
2+
import type { ReactNode } from 'react';
33
import React, { useEffect, useMemo, useReducer } from 'react';
44

5-
import type {
6-
CameraAction,
7-
CameraContext,
8-
CameraState} from './cameraContext';
5+
import type { CameraAction, CameraContext, CameraState } from './cameraContext';
96
import {
107
cameraContext,
118
defaultCameraState,

src/components/camera/cameraContext.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
import type {
2-
Dispatch,
3-
RefObject} from 'react';
4-
import {
5-
createContext,
6-
useContext,
7-
useEffect,
8-
} from 'react';
1+
import type { Dispatch, RefObject } from 'react';
2+
import { createContext, useContext, useEffect } from 'react';
93

104
export interface CameraState {
115
cameras: MediaDeviceInfo[];

src/demo/components/image/ExpandableImages.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import type { Image, Mask} from 'image-js';
1+
import type { Image, Mask } from 'image-js';
22
import { writeCanvas } from 'image-js';
3-
import type {
4-
Dispatch,
5-
SetStateAction} from 'react';
3+
import type { Dispatch, SetStateAction } from 'react';
64
import React, {
75
createContext,
86
useCallback,

src/demo/components/providers/ImageDemoProvider.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ import {
44
demoDispatchContext,
55
demoStateContext,
66
} from '../../contexts/demo/demoContext';
7-
import type {
8-
DemoInitialConfig} from '../../contexts/demo/demoReducer';
9-
import {
10-
useDemoReducer,
11-
} from '../../contexts/demo/demoReducer';
7+
import type { DemoInitialConfig } from '../../contexts/demo/demoReducer';
8+
import { useDemoReducer } from '../../contexts/demo/demoReducer';
129

1310
export default function ImageDemoProvider(props: {
1411
children: React.ReactNode;

src/demo/components/providers/ImportImageProvider.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
import type { ReactNode} from 'react';
1+
import type { ReactNode } from 'react';
22
import React, { useMemo, useReducer } from 'react';
33

44
import { defaultImages, defaultMasks } from '../../contexts/demo/defaultImages';
5-
import type {
6-
ImageDemoInputOption} from '../../contexts/importImage/importImageContext';
7-
import {
8-
imageContext
9-
} from '../../contexts/importImage/importImageContext';
5+
import type { ImageDemoInputOption } from '../../contexts/importImage/importImageContext';
6+
import { imageContext } from '../../contexts/importImage/importImageContext';
107

118
export function ImportImageProvider(props: { children: ReactNode }) {
129
const [options, addOptions] = useReducer(

src/demo/components/toolbar/ImageDemoToolbar.tsx

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@ import { RxCodesandboxLogo } from 'react-icons/rx';
88

99
import { useDemoStateContext } from '../../contexts/demo/demoContext';
1010
import { useSelectImage } from '../../contexts/demo/dispatchHelpers';
11-
import type {
12-
ImageDemoInputOption} from '../../contexts/importImage/importImageContext';
13-
import {
14-
useImportImageContext,
15-
} from '../../contexts/importImage/importImageContext';
11+
import type { ImageDemoInputOption } from '../../contexts/importImage/importImageContext';
12+
import { useImportImageContext } from '../../contexts/importImage/importImageContext';
1613
import AddonButton from '../addons/AddonButton';
1714
import { ImageInputButton } from '../addons/ImageInputButton';
1815
import CameraImageButton from '../snapshot/CameraImageButton';
@@ -44,24 +41,22 @@ export default function ImageDemoToolbar() {
4441
{isMask ? null : <CameraStreamButton />}
4542
<ImageInputButton
4643
onImages={(images) => {
47-
const newOptions: ImageDemoInputOption[] = images.map(
48-
(image) => {
49-
if (isMask) {
50-
const mask = imageToMask(image.image);
51-
return {
52-
type: 'mask',
53-
value: `${image.file.name} (mask)`,
54-
mask,
55-
};
56-
} else {
57-
return {
58-
type: 'image',
59-
value: image.file.name,
60-
image: image.image,
61-
};
62-
}
63-
},
64-
);
44+
const newOptions: ImageDemoInputOption[] = images.map((image) => {
45+
if (isMask) {
46+
const mask = imageToMask(image.image);
47+
return {
48+
type: 'mask',
49+
value: `${image.file.name} (mask)`,
50+
mask,
51+
};
52+
} else {
53+
return {
54+
type: 'image',
55+
value: image.file.name,
56+
image: image.image,
57+
};
58+
}
59+
});
6560
addOptions(newOptions);
6661
if (newOptions.length) {
6762
selectImage(newOptions[newOptions.length - 1]);

src/demo/contexts/demo/demoContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useImportImageContext } from '@site/src/demo/contexts/importImage/importImageContext';
2-
import type { Dispatch} from 'react';
2+
import type { Dispatch } from 'react';
33
import { createContext, useContext, useMemo } from 'react';
44

55
import type { DemoAction, DemoState } from './demoReducer';

src/demo/contexts/importImage/importImageContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Image, Mask } from 'image-js';
2-
import type { DispatchWithoutAction} from 'react';
2+
import type { DispatchWithoutAction } from 'react';
33
import { createContext, useContext } from 'react';
44

55
export interface UrlOption {

0 commit comments

Comments
 (0)