From fa8d7641e03f97e82d00e4aff21da53b69568ae5 Mon Sep 17 00:00:00 2001 From: Murderlon Date: Tue, 3 Mar 2026 12:01:12 +0100 Subject: [PATCH 1/4] Import Preact from @uppy/utils to guarantee a single version --- packages/@uppy/audio/package.json | 3 +-- packages/@uppy/audio/src/PermissionsScreen.tsx | 2 +- packages/@uppy/audio/src/RecordingScreen.tsx | 2 +- packages/@uppy/box/package.json | 3 +-- packages/@uppy/box/src/Box.tsx | 2 +- packages/@uppy/components/migrate.mjs | 6 +++--- packages/@uppy/components/package.json | 2 +- packages/@uppy/components/src/Dropzone.tsx | 2 +- packages/@uppy/components/src/FilesGrid.tsx | 4 ++-- packages/@uppy/components/src/FilesList.tsx | 4 ++-- packages/@uppy/components/src/Thumbnail.tsx | 2 +- packages/@uppy/compressor/package.json | 1 - packages/@uppy/core/package.json | 3 +-- packages/@uppy/core/src/UIPlugin.ts | 2 +- packages/@uppy/core/src/Uppy.ts | 2 +- packages/@uppy/dashboard/package.json | 1 - packages/@uppy/dashboard/src/Dashboard.tsx | 2 +- packages/@uppy/dashboard/src/components/AddFiles.tsx | 2 +- packages/@uppy/dashboard/src/components/Dashboard.tsx | 2 +- .../dashboard/src/components/FileCard/RenderMetaFields.tsx | 2 +- packages/@uppy/dashboard/src/components/FileCard/index.tsx | 2 +- .../src/components/FileItem/FileProgress/index.tsx | 2 +- packages/@uppy/dashboard/src/components/FileItem/index.tsx | 2 +- packages/@uppy/dashboard/src/components/FileList.tsx | 2 +- packages/@uppy/dashboard/src/components/Informer/FadeIn.tsx | 2 +- .../@uppy/dashboard/src/components/Informer/Informer.tsx | 2 +- .../dashboard/src/components/Informer/TransitionGroup.ts | 2 +- .../@uppy/dashboard/src/components/PickerPanelContent.tsx | 2 +- packages/@uppy/dashboard/src/components/Slide.tsx | 4 ++-- .../@uppy/dashboard/src/components/StatusBar/StatusBar.tsx | 4 ++-- packages/@uppy/drag-drop/package.json | 3 +-- packages/@uppy/drag-drop/src/DragDrop.tsx | 2 +- packages/@uppy/dropbox/package.json | 3 +-- packages/@uppy/dropbox/src/Dropbox.tsx | 2 +- packages/@uppy/facebook/package.json | 3 +-- packages/@uppy/facebook/src/Facebook.tsx | 2 +- packages/@uppy/google-drive-picker/package.json | 3 +-- packages/@uppy/google-drive/package.json | 3 +-- packages/@uppy/google-drive/src/GoogleDrive.tsx | 2 +- packages/@uppy/google-photos-picker/package.json | 3 +-- packages/@uppy/image-editor/package.json | 3 +-- packages/@uppy/image-editor/src/Editor.tsx | 2 +- packages/@uppy/image-generator/package.json | 3 +-- packages/@uppy/image-generator/src/index.tsx | 2 +- packages/@uppy/instagram/package.json | 3 +-- packages/@uppy/instagram/src/Instagram.tsx | 2 +- packages/@uppy/onedrive/package.json | 3 +-- packages/@uppy/onedrive/src/OneDrive.tsx | 2 +- packages/@uppy/provider-views/package.json | 3 +-- packages/@uppy/provider-views/src/Breadcrumbs.tsx | 2 +- packages/@uppy/provider-views/src/Browser.tsx | 2 +- packages/@uppy/provider-views/src/FooterActions.tsx | 2 +- .../provider-views/src/GooglePicker/GooglePickerView.tsx | 2 +- .../@uppy/provider-views/src/GooglePicker/googlePicker.ts | 2 +- .../@uppy/provider-views/src/Item/components/GridItem.tsx | 2 +- .../@uppy/provider-views/src/Item/components/ItemIcon.tsx | 2 +- .../@uppy/provider-views/src/Item/components/ListItem.tsx | 2 +- packages/@uppy/provider-views/src/Item/index.tsx | 2 +- packages/@uppy/provider-views/src/ProviderView/AuthView.tsx | 4 ++-- packages/@uppy/provider-views/src/ProviderView/Header.tsx | 2 +- .../@uppy/provider-views/src/ProviderView/ProviderView.tsx | 2 +- packages/@uppy/provider-views/src/ProviderView/User.tsx | 2 +- .../src/SearchProviderView/SearchProviderView.tsx | 2 +- packages/@uppy/provider-views/src/SearchView.tsx | 2 +- packages/@uppy/provider-views/src/useSearchForm.ts | 2 +- packages/@uppy/react/package.json | 2 +- packages/@uppy/react/src/headless/generated/Dropzone.tsx | 2 +- packages/@uppy/react/src/headless/generated/FilesGrid.tsx | 2 +- packages/@uppy/react/src/headless/generated/FilesList.tsx | 2 +- .../@uppy/react/src/headless/generated/ProviderIcon.tsx | 2 +- packages/@uppy/react/src/headless/generated/Thumbnail.tsx | 2 +- .../@uppy/react/src/headless/generated/UploadButton.tsx | 2 +- packages/@uppy/screen-capture/package.json | 3 +-- packages/@uppy/screen-capture/src/DiscardButton.tsx | 2 +- packages/@uppy/screen-capture/src/RecordButton.tsx | 2 +- packages/@uppy/screen-capture/src/RecorderScreen.tsx | 2 +- packages/@uppy/screen-capture/src/ScreenCapture.tsx | 2 +- packages/@uppy/screen-capture/src/StopWatch.tsx | 2 +- packages/@uppy/screen-capture/src/SubmitButton.tsx | 2 +- packages/@uppy/status-bar/package.json | 3 +-- packages/@uppy/status-bar/src/StatusBar.tsx | 2 +- packages/@uppy/svelte/package.json | 2 +- .../src/lib/components/headless/generated/Dropzone.svelte | 2 +- .../src/lib/components/headless/generated/FilesGrid.svelte | 2 +- .../src/lib/components/headless/generated/FilesList.svelte | 2 +- .../lib/components/headless/generated/ProviderIcon.svelte | 2 +- .../src/lib/components/headless/generated/Thumbnail.svelte | 2 +- .../lib/components/headless/generated/UploadButton.svelte | 2 +- packages/@uppy/unsplash/package.json | 3 +-- packages/@uppy/unsplash/src/Unsplash.tsx | 2 +- packages/@uppy/url/package.json | 3 +-- packages/@uppy/url/src/Url.tsx | 2 +- packages/@uppy/url/src/UrlUI.tsx | 2 +- packages/@uppy/utils/package.json | 2 ++ packages/@uppy/utils/src/preact/hooks.ts | 2 ++ packages/@uppy/utils/src/preact/index.ts | 2 ++ packages/@uppy/vue/package.json | 2 +- packages/@uppy/vue/src/headless/generated/Dropzone.ts | 2 +- packages/@uppy/vue/src/headless/generated/FilesGrid.ts | 2 +- packages/@uppy/vue/src/headless/generated/FilesList.ts | 2 +- packages/@uppy/vue/src/headless/generated/ProviderIcon.ts | 2 +- packages/@uppy/vue/src/headless/generated/Thumbnail.ts | 2 +- packages/@uppy/vue/src/headless/generated/UploadButton.ts | 2 +- packages/@uppy/webcam/package.json | 3 +-- packages/@uppy/webcam/src/CameraIcon.tsx | 2 +- packages/@uppy/webcam/src/CameraScreen.tsx | 2 +- packages/@uppy/webcam/src/PermissionsScreen.tsx | 2 +- packages/@uppy/webcam/src/VideoSourceSelect.tsx | 2 +- packages/@uppy/webcam/src/Webcam.tsx | 2 +- packages/@uppy/webdav/package.json | 3 +-- packages/@uppy/webdav/src/Webdav.tsx | 4 ++-- packages/@uppy/zoom/package.json | 3 +-- packages/@uppy/zoom/src/Zoom.tsx | 2 +- 113 files changed, 122 insertions(+), 139 deletions(-) create mode 100644 packages/@uppy/utils/src/preact/hooks.ts create mode 100644 packages/@uppy/utils/src/preact/index.ts diff --git a/packages/@uppy/audio/package.json b/packages/@uppy/audio/package.json index ee87bfaf1c..5f3cd09faf 100644 --- a/packages/@uppy/audio/package.json +++ b/packages/@uppy/audio/package.json @@ -40,8 +40,7 @@ "./package.json": "./package.json" }, "dependencies": { - "@uppy/utils": "workspace:^", - "preact": "^10.26.10" + "@uppy/utils": "workspace:^" }, "devDependencies": { "cssnano": "^7.0.7", diff --git a/packages/@uppy/audio/src/PermissionsScreen.tsx b/packages/@uppy/audio/src/PermissionsScreen.tsx index 9bc876dbd2..d76c84f4d8 100644 --- a/packages/@uppy/audio/src/PermissionsScreen.tsx +++ b/packages/@uppy/audio/src/PermissionsScreen.tsx @@ -1,5 +1,5 @@ import type { I18n } from '@uppy/utils' -import type { h } from 'preact' +import type { h } from '@uppy/utils/preact' interface PermissionsScreenProps { icon: () => h.JSX.Element | null diff --git a/packages/@uppy/audio/src/RecordingScreen.tsx b/packages/@uppy/audio/src/RecordingScreen.tsx index b9f5cdcfc1..7b6b80b7bd 100644 --- a/packages/@uppy/audio/src/RecordingScreen.tsx +++ b/packages/@uppy/audio/src/RecordingScreen.tsx @@ -1,5 +1,5 @@ import type { I18n } from '@uppy/utils' -import { useEffect, useRef } from 'preact/hooks' +import { useEffect, useRef } from '@uppy/utils/preact/hooks' import AudioSourceSelect, { type AudioSourceSelectProps, } from './AudioSourceSelect.js' diff --git a/packages/@uppy/box/package.json b/packages/@uppy/box/package.json index 07130fab36..0622a7bad5 100644 --- a/packages/@uppy/box/package.json +++ b/packages/@uppy/box/package.json @@ -36,8 +36,7 @@ "dependencies": { "@uppy/companion-client": "workspace:^", "@uppy/provider-views": "workspace:^", - "@uppy/utils": "workspace:^", - "preact": "^10.26.10" + "@uppy/utils": "workspace:^" }, "peerDependencies": { "@uppy/core": "workspace:^" diff --git a/packages/@uppy/box/src/Box.tsx b/packages/@uppy/box/src/Box.tsx index 590ebc3e1e..ac11b1280c 100644 --- a/packages/@uppy/box/src/Box.tsx +++ b/packages/@uppy/box/src/Box.tsx @@ -17,7 +17,7 @@ import { ProviderViews } from '@uppy/provider-views' import type { LocaleStrings } from '@uppy/utils' // biome-ignore lint/style/useImportType: h is not a type -import { type ComponentChild, h } from 'preact' +import { type ComponentChild, h } from '@uppy/utils/preact' import packageJson from '../package.json' with { type: 'json' } import locale from './locale.js' diff --git a/packages/@uppy/components/migrate.mjs b/packages/@uppy/components/migrate.mjs index 7f79361d44..33863cb0ab 100644 --- a/packages/@uppy/components/migrate.mjs +++ b/packages/@uppy/components/migrate.mjs @@ -64,7 +64,7 @@ import { %%ComponentName%% as %%PreactComponentName%%, type %%PropsTypeName%%, } from '@uppy/components' -import { h as preactH, render as preactRender } from 'preact' +import { h as preactH, render as preactRender } from '@uppy/utils/preact' import { useContext, useEffect, useRef } from 'react' import { UppyContext } from '../UppyContextProvider.js' @@ -96,7 +96,7 @@ import { %%ComponentName%% as %%PreactComponentName%%, type %%PropsTypeName%%, } from '@uppy/components' -import { h as preactH, render as preactRender } from 'preact' +import { h as preactH, render as preactRender } from '@uppy/utils/preact' import { useUppyContext } from '../useUppyContext.js' export default defineComponent({ @@ -149,7 +149,7 @@ const SVELTE_TEMPLATE = `\ type %%PropsTypeName%%, type UppyContext, } from '@uppy/components' - import { h as preactH, render as preactRender } from 'preact' + import { h as preactH, render as preactRender } from '@uppy/utils/preact' import { UppyContextKey } from '../UppyContextProvider.svelte' const props: Omit<%%PropsTypeName%%, 'ctx'> = $props() diff --git a/packages/@uppy/components/package.json b/packages/@uppy/components/package.json index 7e2aeb8804..ab56a18605 100644 --- a/packages/@uppy/components/package.json +++ b/packages/@uppy/components/package.json @@ -41,9 +41,9 @@ "./package.json": "./package.json" }, "dependencies": { + "@uppy/utils": "workspace:^", "clsx": "^2.1.1", "dequal": "^2.0.3", - "preact": "^10.26.10", "pretty-bytes": "^6.1.1" }, "devDependencies": { diff --git a/packages/@uppy/components/src/Dropzone.tsx b/packages/@uppy/components/src/Dropzone.tsx index 4649b50d8e..127d8f5ce5 100644 --- a/packages/@uppy/components/src/Dropzone.tsx +++ b/packages/@uppy/components/src/Dropzone.tsx @@ -1,5 +1,5 @@ import { clsx } from 'clsx' -import { useMemo } from 'preact/hooks' +import { useMemo } from '@uppy/utils/preact/hooks' import { createDropzone } from './hooks/dropzone.js' import type { NonNullableUppyContext, UppyContext } from './types.js' diff --git a/packages/@uppy/components/src/FilesGrid.tsx b/packages/@uppy/components/src/FilesGrid.tsx index a820dbc63c..41b26fd5bf 100644 --- a/packages/@uppy/components/src/FilesGrid.tsx +++ b/packages/@uppy/components/src/FilesGrid.tsx @@ -1,7 +1,7 @@ import type { Body, Meta, UppyEventMap, UppyFile } from '@uppy/core' import { clsx } from 'clsx' -import { Fragment } from 'preact' -import { useEffect, useState } from 'preact/hooks' +import { Fragment } from '@uppy/utils/preact' +import { useEffect, useState } from '@uppy/utils/preact/hooks' import prettyBytes from 'pretty-bytes' import { Thumbnail } from './index.js' import type { UppyContext } from './types.js' diff --git a/packages/@uppy/components/src/FilesList.tsx b/packages/@uppy/components/src/FilesList.tsx index b1c84c2eed..79a62dc98e 100644 --- a/packages/@uppy/components/src/FilesList.tsx +++ b/packages/@uppy/components/src/FilesList.tsx @@ -1,7 +1,7 @@ import type { Body, Meta, UppyEventMap, UppyFile } from '@uppy/core' import { clsx } from 'clsx' -import { Fragment } from 'preact' -import { useEffect, useState } from 'preact/hooks' +import { Fragment } from '@uppy/utils/preact' +import { useEffect, useState } from '@uppy/utils/preact/hooks' import prettyBytes from 'pretty-bytes' import { Thumbnail, type UppyContext } from './index.js' diff --git a/packages/@uppy/components/src/Thumbnail.tsx b/packages/@uppy/components/src/Thumbnail.tsx index 1a282b498d..7eb98b58d8 100644 --- a/packages/@uppy/components/src/Thumbnail.tsx +++ b/packages/@uppy/components/src/Thumbnail.tsx @@ -1,5 +1,5 @@ import type { Body, Meta, UppyFile } from '@uppy/core' -import { useEffect, useMemo } from 'preact/hooks' +import { useEffect, useMemo } from '@uppy/utils/preact/hooks' import type { UppyContext } from './types.js' export type ThumbnailProps = { diff --git a/packages/@uppy/compressor/package.json b/packages/@uppy/compressor/package.json index fdace0da51..77aabfc542 100644 --- a/packages/@uppy/compressor/package.json +++ b/packages/@uppy/compressor/package.json @@ -34,7 +34,6 @@ "@transloadit/prettier-bytes": "^0.3.4", "@uppy/utils": "workspace:^", "compressorjs": "^1.2.1", - "preact": "^10.26.10", "promise-queue": "^2.2.5" }, "peerDependencies": { diff --git a/packages/@uppy/core/package.json b/packages/@uppy/core/package.json index 1a16f55484..dda1752a85 100644 --- a/packages/@uppy/core/package.json +++ b/packages/@uppy/core/package.json @@ -47,8 +47,7 @@ "lodash": "^4.17.23", "mime-match": "^1.0.2", "namespace-emitter": "^2.0.1", - "nanoid": "^5.0.9", - "preact": "^10.26.10" + "nanoid": "^5.0.9" }, "devDependencies": { "@types/deep-freeze": "^0", diff --git a/packages/@uppy/core/src/UIPlugin.ts b/packages/@uppy/core/src/UIPlugin.ts index c7e6478d4e..3bcec939a7 100644 --- a/packages/@uppy/core/src/UIPlugin.ts +++ b/packages/@uppy/core/src/UIPlugin.ts @@ -1,6 +1,6 @@ import type { Body, Meta } from '@uppy/utils' import { findDOMElement, getTextDirection } from '@uppy/utils' -import { render } from 'preact' +import { render } from '@uppy/utils/preact' import type { PluginOpts } from './BasePlugin.js' import BasePlugin from './BasePlugin.js' import type { State } from './Uppy.js' diff --git a/packages/@uppy/core/src/Uppy.ts b/packages/@uppy/core/src/Uppy.ts index 6f13065b25..108f9540b8 100644 --- a/packages/@uppy/core/src/Uppy.ts +++ b/packages/@uppy/core/src/Uppy.ts @@ -28,7 +28,7 @@ import throttle from 'lodash/throttle.js' // @ts-ignore untyped import ee from 'namespace-emitter' import { nanoid } from 'nanoid/non-secure' -import type { h } from 'preact' +import type { h } from '@uppy/utils/preact' import packageJson from '../package.json' with { type: 'json' } import type BasePlugin from './BasePlugin.js' import getFileName from './getFileName.js' diff --git a/packages/@uppy/dashboard/package.json b/packages/@uppy/dashboard/package.json index ce3c0a1aba..fba9be437d 100644 --- a/packages/@uppy/dashboard/package.json +++ b/packages/@uppy/dashboard/package.json @@ -51,7 +51,6 @@ "classnames": "^2.2.6", "lodash": "^4.17.23", "nanoid": "^5.0.9", - "preact": "^10.26.10", "shallow-equal": "^3.0.0" }, "devDependencies": { diff --git a/packages/@uppy/dashboard/src/Dashboard.tsx b/packages/@uppy/dashboard/src/Dashboard.tsx index cdde90d3f3..b8fb75cd06 100644 --- a/packages/@uppy/dashboard/src/Dashboard.tsx +++ b/packages/@uppy/dashboard/src/Dashboard.tsx @@ -15,7 +15,7 @@ import ThumbnailGenerator from '@uppy/thumbnail-generator' import type { LocaleStrings } from '@uppy/utils' import { findAllDOMElements, getDroppedFiles, toArray } from '@uppy/utils' import { nanoid } from 'nanoid/non-secure' -import type { ComponentChild, h, VNode } from 'preact' +import type { ComponentChild, h, VNode } from '@uppy/utils/preact' import packageJson from '../package.json' with { type: 'json' } import DashboardUI from './components/Dashboard.js' import locale from './locale.js' diff --git a/packages/@uppy/dashboard/src/components/AddFiles.tsx b/packages/@uppy/dashboard/src/components/AddFiles.tsx index bbfd6ac950..0fc8fb5cdd 100644 --- a/packages/@uppy/dashboard/src/components/AddFiles.tsx +++ b/packages/@uppy/dashboard/src/components/AddFiles.tsx @@ -1,5 +1,5 @@ import type { I18n, Translator } from '@uppy/utils' -import { Component, type ComponentChild, Fragment, type h } from 'preact' +import { Component, type ComponentChild, Fragment, type h } from '@uppy/utils/preact' import type { DashboardState, TargetWithRender } from '../Dashboard.js' interface AddFilesProps { diff --git a/packages/@uppy/dashboard/src/components/Dashboard.tsx b/packages/@uppy/dashboard/src/components/Dashboard.tsx index 10456c9243..360a7171c5 100644 --- a/packages/@uppy/dashboard/src/components/Dashboard.tsx +++ b/packages/@uppy/dashboard/src/components/Dashboard.tsx @@ -10,7 +10,7 @@ import type { import type { I18n, Translator } from '@uppy/utils' import { isDragDropSupported } from '@uppy/utils' import classNames from 'classnames' -import type { h } from 'preact' +import type { h } from '@uppy/utils/preact' import type { DashboardState, TargetWithRender } from '../Dashboard.js' import AddFiles from './AddFiles.js' import AddFilesPanel from './AddFilesPanel.js' diff --git a/packages/@uppy/dashboard/src/components/FileCard/RenderMetaFields.tsx b/packages/@uppy/dashboard/src/components/FileCard/RenderMetaFields.tsx index 19a4d8b1ef..ea033ae985 100644 --- a/packages/@uppy/dashboard/src/components/FileCard/RenderMetaFields.tsx +++ b/packages/@uppy/dashboard/src/components/FileCard/RenderMetaFields.tsx @@ -1,4 +1,4 @@ -import { h } from 'preact' +import { h } from '@uppy/utils/preact' type $TSFixMe = any diff --git a/packages/@uppy/dashboard/src/components/FileCard/index.tsx b/packages/@uppy/dashboard/src/components/FileCard/index.tsx index ca88cf2b32..9889bf5b90 100644 --- a/packages/@uppy/dashboard/src/components/FileCard/index.tsx +++ b/packages/@uppy/dashboard/src/components/FileCard/index.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames' import { nanoid } from 'nanoid/non-secure' -import { useCallback, useEffect, useRef, useState } from 'preact/hooks' +import { useCallback, useEffect, useRef, useState } from '@uppy/utils/preact/hooks' import getFileTypeIcon from '../../utils/getFileTypeIcon.js' import ignoreEvent from '../../utils/ignoreEvent.js' import FilePreview from '../FilePreview.js' diff --git a/packages/@uppy/dashboard/src/components/FileItem/FileProgress/index.tsx b/packages/@uppy/dashboard/src/components/FileItem/FileProgress/index.tsx index 2a74fc1c77..72fa88b719 100644 --- a/packages/@uppy/dashboard/src/components/FileItem/FileProgress/index.tsx +++ b/packages/@uppy/dashboard/src/components/FileItem/FileProgress/index.tsx @@ -1,6 +1,6 @@ import type { Body, Meta, State, Uppy, UppyFile } from '@uppy/core' import type { I18n } from '@uppy/utils' -import type { ComponentChild } from 'preact' +import type { ComponentChild } from '@uppy/utils/preact' interface Props { uppy: Uppy diff --git a/packages/@uppy/dashboard/src/components/FileItem/index.tsx b/packages/@uppy/dashboard/src/components/FileItem/index.tsx index 9088d32c0e..abbb94d9be 100644 --- a/packages/@uppy/dashboard/src/components/FileItem/index.tsx +++ b/packages/@uppy/dashboard/src/components/FileItem/index.tsx @@ -3,7 +3,7 @@ import type { Body, Meta, State, UppyFile } from '@uppy/core' import type { I18n } from '@uppy/utils' import classNames from 'classnames' // biome-ignore lint/style/useImportType: h is not a type -import { Component, type ComponentChild, h } from 'preact' +import { Component, type ComponentChild, h } from '@uppy/utils/preact' import { shallowEqualObjects } from 'shallow-equal' import type { DashboardState } from '../../Dashboard.js' import Buttons from './Buttons/index.js' diff --git a/packages/@uppy/dashboard/src/components/FileList.tsx b/packages/@uppy/dashboard/src/components/FileList.tsx index 6c291976e8..afd46fc09b 100644 --- a/packages/@uppy/dashboard/src/components/FileList.tsx +++ b/packages/@uppy/dashboard/src/components/FileList.tsx @@ -2,7 +2,7 @@ import type { Body, Meta, State, Uppy, UppyFile } from '@uppy/core' import type { I18n } from '@uppy/utils' // @ts-ignore untyped import { VirtualList } from '@uppy/utils' -import { useMemo } from 'preact/hooks' +import { useMemo } from '@uppy/utils/preact/hooks' import type { DashboardState } from '../Dashboard.js' import FileItem from './FileItem/index.js' diff --git a/packages/@uppy/dashboard/src/components/Informer/FadeIn.tsx b/packages/@uppy/dashboard/src/components/Informer/FadeIn.tsx index d97cc413ee..70555db153 100644 --- a/packages/@uppy/dashboard/src/components/Informer/FadeIn.tsx +++ b/packages/@uppy/dashboard/src/components/Informer/FadeIn.tsx @@ -1,4 +1,4 @@ -import { Component, type ComponentChild, createRef } from 'preact' +import { Component, type ComponentChild, createRef } from '@uppy/utils/preact' const TRANSITION_MS = 300 diff --git a/packages/@uppy/dashboard/src/components/Informer/Informer.tsx b/packages/@uppy/dashboard/src/components/Informer/Informer.tsx index 089dfe0b03..14e3467f58 100644 --- a/packages/@uppy/dashboard/src/components/Informer/Informer.tsx +++ b/packages/@uppy/dashboard/src/components/Informer/Informer.tsx @@ -1,5 +1,5 @@ import type { UIPluginOptions, Uppy } from '@uppy/core' -import { Component, type ComponentChild } from 'preact' +import { Component, type ComponentChild } from '@uppy/utils/preact' import FadeIn from './FadeIn.js' import TransitionGroup from './TransitionGroup.js' diff --git a/packages/@uppy/dashboard/src/components/Informer/TransitionGroup.ts b/packages/@uppy/dashboard/src/components/Informer/TransitionGroup.ts index 8169dc63db..d9073aa67e 100644 --- a/packages/@uppy/dashboard/src/components/Informer/TransitionGroup.ts +++ b/packages/@uppy/dashboard/src/components/Informer/TransitionGroup.ts @@ -4,7 +4,7 @@ * @source https://github.com/developit/preact-transition-group */ -import { Component, cloneElement, h, toChildArray } from 'preact' +import { Component, cloneElement, h, toChildArray } from '@uppy/utils/preact' function assign(obj, props) { return Object.assign(obj, props) diff --git a/packages/@uppy/dashboard/src/components/PickerPanelContent.tsx b/packages/@uppy/dashboard/src/components/PickerPanelContent.tsx index 7c9206fb35..33e9986346 100644 --- a/packages/@uppy/dashboard/src/components/PickerPanelContent.tsx +++ b/packages/@uppy/dashboard/src/components/PickerPanelContent.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames' -import { useRef } from 'preact/hooks' +import { useRef } from '@uppy/utils/preact/hooks' import ignoreEvent from '../utils/ignoreEvent.js' type $TSFixMe = any diff --git a/packages/@uppy/dashboard/src/components/Slide.tsx b/packages/@uppy/dashboard/src/components/Slide.tsx index 378df32d99..f3590bedfd 100644 --- a/packages/@uppy/dashboard/src/components/Slide.tsx +++ b/packages/@uppy/dashboard/src/components/Slide.tsx @@ -4,8 +4,8 @@ import { cloneElement, toChildArray, type VNode, -} from 'preact' -import { useCallback, useEffect, useRef, useState } from 'preact/hooks' +} from '@uppy/utils/preact' +import { useCallback, useEffect, useRef, useState } from '@uppy/utils/preact/hooks' const transitionName = 'uppy-transition-slideDownUp' const duration = 250 diff --git a/packages/@uppy/dashboard/src/components/StatusBar/StatusBar.tsx b/packages/@uppy/dashboard/src/components/StatusBar/StatusBar.tsx index 6f87315ccf..c9b7aa65f2 100644 --- a/packages/@uppy/dashboard/src/components/StatusBar/StatusBar.tsx +++ b/packages/@uppy/dashboard/src/components/StatusBar/StatusBar.tsx @@ -1,8 +1,8 @@ import type { Body, Meta, State, Uppy, UppyFile } from '@uppy/core' import type { I18n } from '@uppy/utils' import { emaFilter } from '@uppy/utils' -import type { ComponentChild } from 'preact' -import { Component } from 'preact' +import type { ComponentChild } from '@uppy/utils/preact' +import { Component } from '@uppy/utils/preact' import statusBarStates from './StatusBarStates.js' import StatusBarUI, { type StatusBarUIProps } from './StatusBarUI.js' diff --git a/packages/@uppy/drag-drop/package.json b/packages/@uppy/drag-drop/package.json index 1a5adfe09b..91fbf3482a 100644 --- a/packages/@uppy/drag-drop/package.json +++ b/packages/@uppy/drag-drop/package.json @@ -45,8 +45,7 @@ "./package.json": "./package.json" }, "dependencies": { - "@uppy/utils": "workspace:^", - "preact": "^10.26.10" + "@uppy/utils": "workspace:^" }, "peerDependencies": { "@uppy/core": "workspace:^" diff --git a/packages/@uppy/drag-drop/src/DragDrop.tsx b/packages/@uppy/drag-drop/src/DragDrop.tsx index 8987f64fdd..d3e6b2db2c 100644 --- a/packages/@uppy/drag-drop/src/DragDrop.tsx +++ b/packages/@uppy/drag-drop/src/DragDrop.tsx @@ -8,7 +8,7 @@ import type { import { UIPlugin } from '@uppy/core' import type { LocaleStrings } from '@uppy/utils' import { getDroppedFiles, isDragDropSupported, toArray } from '@uppy/utils' -import type { ComponentChild, h } from 'preact' +import type { ComponentChild, h } from '@uppy/utils/preact' import packageJson from '../package.json' with { type: 'json' } import locale from './locale.js' diff --git a/packages/@uppy/dropbox/package.json b/packages/@uppy/dropbox/package.json index a4a150e794..ef9c1507fc 100644 --- a/packages/@uppy/dropbox/package.json +++ b/packages/@uppy/dropbox/package.json @@ -36,8 +36,7 @@ "dependencies": { "@uppy/companion-client": "workspace:^", "@uppy/provider-views": "workspace:^", - "@uppy/utils": "workspace:^", - "preact": "^10.26.10" + "@uppy/utils": "workspace:^" }, "peerDependencies": { "@uppy/core": "workspace:^" diff --git a/packages/@uppy/dropbox/src/Dropbox.tsx b/packages/@uppy/dropbox/src/Dropbox.tsx index e536d09e3f..fff1f1d619 100644 --- a/packages/@uppy/dropbox/src/Dropbox.tsx +++ b/packages/@uppy/dropbox/src/Dropbox.tsx @@ -17,7 +17,7 @@ import { ProviderViews } from '@uppy/provider-views' import type { LocaleStrings } from '@uppy/utils' // biome-ignore lint/style/useImportType: h is not a type -import { type ComponentChild, h } from 'preact' +import { type ComponentChild, h } from '@uppy/utils/preact' import packageJson from '../package.json' with { type: 'json' } import locale from './locale.js' diff --git a/packages/@uppy/facebook/package.json b/packages/@uppy/facebook/package.json index e2faf82e9b..1e6a73a342 100644 --- a/packages/@uppy/facebook/package.json +++ b/packages/@uppy/facebook/package.json @@ -36,8 +36,7 @@ "dependencies": { "@uppy/companion-client": "workspace:^", "@uppy/provider-views": "workspace:^", - "@uppy/utils": "workspace:^", - "preact": "^10.26.10" + "@uppy/utils": "workspace:^" }, "peerDependencies": { "@uppy/core": "workspace:^" diff --git a/packages/@uppy/facebook/src/Facebook.tsx b/packages/@uppy/facebook/src/Facebook.tsx index 7032db1e41..d8c16a9c72 100644 --- a/packages/@uppy/facebook/src/Facebook.tsx +++ b/packages/@uppy/facebook/src/Facebook.tsx @@ -17,7 +17,7 @@ import { ProviderViews } from '@uppy/provider-views' import type { LocaleStrings } from '@uppy/utils' // biome-ignore lint/style/useImportType: h is not a type -import { type ComponentChild, h } from 'preact' +import { type ComponentChild, h } from '@uppy/utils/preact' import packageJson from '../package.json' with { type: 'json' } import locale from './locale.js' diff --git a/packages/@uppy/google-drive-picker/package.json b/packages/@uppy/google-drive-picker/package.json index b1c0bf9717..f29d4e4051 100644 --- a/packages/@uppy/google-drive-picker/package.json +++ b/packages/@uppy/google-drive-picker/package.json @@ -38,8 +38,7 @@ "dependencies": { "@uppy/companion-client": "workspace:^", "@uppy/provider-views": "workspace:^", - "@uppy/utils": "workspace:^", - "preact": "^10.26.10" + "@uppy/utils": "workspace:^" }, "peerDependencies": { "@uppy/core": "workspace:^" diff --git a/packages/@uppy/google-drive/package.json b/packages/@uppy/google-drive/package.json index ae3ffebeb8..29dba8fb98 100644 --- a/packages/@uppy/google-drive/package.json +++ b/packages/@uppy/google-drive/package.json @@ -37,8 +37,7 @@ "dependencies": { "@uppy/companion-client": "workspace:^", "@uppy/provider-views": "workspace:^", - "@uppy/utils": "workspace:^", - "preact": "^10.26.10" + "@uppy/utils": "workspace:^" }, "peerDependencies": { "@uppy/core": "workspace:^" diff --git a/packages/@uppy/google-drive/src/GoogleDrive.tsx b/packages/@uppy/google-drive/src/GoogleDrive.tsx index 1d43160ba0..f6ec31b12e 100644 --- a/packages/@uppy/google-drive/src/GoogleDrive.tsx +++ b/packages/@uppy/google-drive/src/GoogleDrive.tsx @@ -17,7 +17,7 @@ import type { ProviderViews } from '@uppy/provider-views' import type { LocaleStrings } from '@uppy/utils' // biome-ignore lint/style/useImportType: h is not a type -import { type ComponentChild, h } from 'preact' +import { type ComponentChild, h } from '@uppy/utils/preact' import packageJson from '../package.json' with { type: 'json' } import DriveProviderViews from './DriveProviderViews.js' import locale from './locale.js' diff --git a/packages/@uppy/google-photos-picker/package.json b/packages/@uppy/google-photos-picker/package.json index 77a870f3f8..1baec65c43 100644 --- a/packages/@uppy/google-photos-picker/package.json +++ b/packages/@uppy/google-photos-picker/package.json @@ -38,8 +38,7 @@ "dependencies": { "@uppy/companion-client": "workspace:^", "@uppy/provider-views": "workspace:^", - "@uppy/utils": "workspace:^", - "preact": "^10.26.10" + "@uppy/utils": "workspace:^" }, "peerDependencies": { "@uppy/core": "workspace:^" diff --git a/packages/@uppy/image-editor/package.json b/packages/@uppy/image-editor/package.json index 978d9e3d18..5b719740e5 100644 --- a/packages/@uppy/image-editor/package.json +++ b/packages/@uppy/image-editor/package.json @@ -47,8 +47,7 @@ }, "dependencies": { "@uppy/utils": "workspace:^", - "cropperjs": "^1.6.2", - "preact": "^10.26.10" + "cropperjs": "^1.6.2" }, "peerDependencies": { "@uppy/core": "workspace:^" diff --git a/packages/@uppy/image-editor/src/Editor.tsx b/packages/@uppy/image-editor/src/Editor.tsx index fd449b2e97..4c72485f0a 100644 --- a/packages/@uppy/image-editor/src/Editor.tsx +++ b/packages/@uppy/image-editor/src/Editor.tsx @@ -1,6 +1,6 @@ import type { Body, Meta } from '@uppy/core' import type { I18n, LocalUppyFile } from '@uppy/utils' -import { Component } from 'preact' +import { Component } from '@uppy/utils/preact' import type ImageEditor from './ImageEditor.js' import type { AspectRatio } from './ImageEditor.js' diff --git a/packages/@uppy/image-generator/package.json b/packages/@uppy/image-generator/package.json index c853b1163d..dbf90691c0 100644 --- a/packages/@uppy/image-generator/package.json +++ b/packages/@uppy/image-generator/package.json @@ -41,8 +41,7 @@ "dependencies": { "@uppy/provider-views": "workspace:^", "@uppy/transloadit": "workspace:^", - "@uppy/utils": "workspace:^", - "preact": "^10.26.10" + "@uppy/utils": "workspace:^" }, "devDependencies": { "@uppy/core": "workspace:^", diff --git a/packages/@uppy/image-generator/src/index.tsx b/packages/@uppy/image-generator/src/index.tsx index 8fc002e328..06e8a47ebb 100644 --- a/packages/@uppy/image-generator/src/index.tsx +++ b/packages/@uppy/image-generator/src/index.tsx @@ -8,7 +8,7 @@ import { type OptionsWithRestructuredFields, } from '@uppy/transloadit' import { RateLimitedQueue } from '@uppy/utils' -import type { h } from 'preact' +import type { h } from '@uppy/utils/preact' import locale from './locale.js' export interface ImageGeneratorOptions extends UIPluginOptions { diff --git a/packages/@uppy/instagram/package.json b/packages/@uppy/instagram/package.json index 2bf6927a04..405486cbf2 100644 --- a/packages/@uppy/instagram/package.json +++ b/packages/@uppy/instagram/package.json @@ -39,8 +39,7 @@ "dependencies": { "@uppy/companion-client": "workspace:^", "@uppy/provider-views": "workspace:^", - "@uppy/utils": "workspace:^", - "preact": "^10.26.10" + "@uppy/utils": "workspace:^" }, "peerDependencies": { "@uppy/core": "workspace:^" diff --git a/packages/@uppy/instagram/src/Instagram.tsx b/packages/@uppy/instagram/src/Instagram.tsx index 9f56b0379a..78accf6a2a 100644 --- a/packages/@uppy/instagram/src/Instagram.tsx +++ b/packages/@uppy/instagram/src/Instagram.tsx @@ -17,7 +17,7 @@ import { ProviderViews } from '@uppy/provider-views' import type { LocaleStrings } from '@uppy/utils' // biome-ignore lint/style/useImportType: h is not a type -import { type ComponentChild, h } from 'preact' +import { type ComponentChild, h } from '@uppy/utils/preact' import packageJson from '../package.json' with { type: 'json' } import locale from './locale.js' diff --git a/packages/@uppy/onedrive/package.json b/packages/@uppy/onedrive/package.json index 0496bd776b..ff28a1b63d 100644 --- a/packages/@uppy/onedrive/package.json +++ b/packages/@uppy/onedrive/package.json @@ -36,8 +36,7 @@ "dependencies": { "@uppy/companion-client": "workspace:^", "@uppy/provider-views": "workspace:^", - "@uppy/utils": "workspace:^", - "preact": "^10.26.10" + "@uppy/utils": "workspace:^" }, "peerDependencies": { "@uppy/core": "workspace:^" diff --git a/packages/@uppy/onedrive/src/OneDrive.tsx b/packages/@uppy/onedrive/src/OneDrive.tsx index 9a47c812dc..5029e15c3c 100644 --- a/packages/@uppy/onedrive/src/OneDrive.tsx +++ b/packages/@uppy/onedrive/src/OneDrive.tsx @@ -17,7 +17,7 @@ import { ProviderViews } from '@uppy/provider-views' import type { LocaleStrings } from '@uppy/utils' // biome-ignore lint/style/useImportType: h is not a type -import { type ComponentChild, h } from 'preact' +import { type ComponentChild, h } from '@uppy/utils/preact' import packageJson from '../package.json' with { type: 'json' } import locale from './locale.js' diff --git a/packages/@uppy/provider-views/package.json b/packages/@uppy/provider-views/package.json index 4d3c3abee5..fa08681889 100644 --- a/packages/@uppy/provider-views/package.json +++ b/packages/@uppy/provider-views/package.json @@ -44,8 +44,7 @@ "classnames": "^2.2.6", "lodash": "^4.17.23", "nanoid": "^5.0.9", - "p-queue": "^8.0.0", - "preact": "^10.26.10" + "p-queue": "^8.0.0" }, "devDependencies": { "@types/gapi": "^0.0.47", diff --git a/packages/@uppy/provider-views/src/Breadcrumbs.tsx b/packages/@uppy/provider-views/src/Breadcrumbs.tsx index 831ed0438d..039b26ec9f 100644 --- a/packages/@uppy/provider-views/src/Breadcrumbs.tsx +++ b/packages/@uppy/provider-views/src/Breadcrumbs.tsx @@ -1,5 +1,5 @@ import type { Body, Meta, PartialTreeFolder } from '@uppy/core' -import { Fragment, type h } from 'preact' +import { Fragment, type h } from '@uppy/utils/preact' import type ProviderView from './ProviderView/index.js' type BreadcrumbsProps = { diff --git a/packages/@uppy/provider-views/src/Browser.tsx b/packages/@uppy/provider-views/src/Browser.tsx index 1ab0a9b670..43c043089a 100644 --- a/packages/@uppy/provider-views/src/Browser.tsx +++ b/packages/@uppy/provider-views/src/Browser.tsx @@ -6,7 +6,7 @@ import type { } from '@uppy/core' import type { I18n } from '@uppy/utils' import { VirtualList } from '@uppy/utils' -import { useEffect, useState } from 'preact/hooks' +import { useEffect, useState } from '@uppy/utils/preact/hooks' import Item from './Item/index.js' import type ProviderView from './ProviderView/ProviderView.js' diff --git a/packages/@uppy/provider-views/src/FooterActions.tsx b/packages/@uppy/provider-views/src/FooterActions.tsx index df723de4da..214c27cca8 100644 --- a/packages/@uppy/provider-views/src/FooterActions.tsx +++ b/packages/@uppy/provider-views/src/FooterActions.tsx @@ -1,7 +1,7 @@ import type { Body, Meta, PartialTree } from '@uppy/core' import type { I18n } from '@uppy/utils' import classNames from 'classnames' -import { useMemo } from 'preact/hooks' +import { useMemo } from '@uppy/utils/preact/hooks' import type ProviderView from './ProviderView/ProviderView.js' import getNumberOfSelectedFiles from './utils/PartialTreeUtils/getNumberOfSelectedFiles.js' diff --git a/packages/@uppy/provider-views/src/GooglePicker/GooglePickerView.tsx b/packages/@uppy/provider-views/src/GooglePicker/GooglePickerView.tsx index c18a06557c..1f72a08edb 100644 --- a/packages/@uppy/provider-views/src/GooglePicker/GooglePickerView.tsx +++ b/packages/@uppy/provider-views/src/GooglePicker/GooglePickerView.tsx @@ -1,6 +1,6 @@ import type { AsyncStore, Uppy } from '@uppy/core' import type { I18n } from '@uppy/utils' -import { useCallback, useEffect, useRef, useState } from 'preact/hooks' +import { useCallback, useEffect, useRef, useState } from '@uppy/utils/preact/hooks' import AuthView from '../ProviderView/AuthView.js' import { authorize, diff --git a/packages/@uppy/provider-views/src/GooglePicker/googlePicker.ts b/packages/@uppy/provider-views/src/GooglePicker/googlePicker.ts index 84110d89ae..a3856e7852 100644 --- a/packages/@uppy/provider-views/src/GooglePicker/googlePicker.ts +++ b/packages/@uppy/provider-views/src/GooglePicker/googlePicker.ts @@ -1,4 +1,4 @@ -import type { MutableRef } from 'preact/hooks' +import type { MutableRef } from '@uppy/utils/preact/hooks' // https://developers.google.com/photos/picker/reference/rest/v1/mediaItems // Note that the google api doc is not correct, hence some things are optional here but not in their docs diff --git a/packages/@uppy/provider-views/src/Item/components/GridItem.tsx b/packages/@uppy/provider-views/src/Item/components/GridItem.tsx index e7c19601b6..35cc238511 100644 --- a/packages/@uppy/provider-views/src/Item/components/GridItem.tsx +++ b/packages/@uppy/provider-views/src/Item/components/GridItem.tsx @@ -1,5 +1,5 @@ import type { PartialTreeFile, PartialTreeFolderNode } from '@uppy/core' -import type { h } from 'preact' +import type { h } from '@uppy/utils/preact' import ItemIcon from './ItemIcon.js' type GridItemProps = { diff --git a/packages/@uppy/provider-views/src/Item/components/ItemIcon.tsx b/packages/@uppy/provider-views/src/Item/components/ItemIcon.tsx index 5609d16b02..618176ede4 100644 --- a/packages/@uppy/provider-views/src/Item/components/ItemIcon.tsx +++ b/packages/@uppy/provider-views/src/Item/components/ItemIcon.tsx @@ -1,4 +1,4 @@ -import type { h } from 'preact' +import type { h } from '@uppy/utils/preact' function FileIcon() { return ( diff --git a/packages/@uppy/provider-views/src/Item/components/ListItem.tsx b/packages/@uppy/provider-views/src/Item/components/ListItem.tsx index 4522644f2a..1032828177 100644 --- a/packages/@uppy/provider-views/src/Item/components/ListItem.tsx +++ b/packages/@uppy/provider-views/src/Item/components/ListItem.tsx @@ -3,7 +3,7 @@ import type { PartialTreeFolderNode, PartialTreeId, } from '@uppy/core' -import type { h } from 'preact' +import type { h } from '@uppy/utils/preact' import ItemIcon from './ItemIcon.js' // if folder: diff --git a/packages/@uppy/provider-views/src/Item/index.tsx b/packages/@uppy/provider-views/src/Item/index.tsx index 4caf673da2..34735f80e3 100644 --- a/packages/@uppy/provider-views/src/Item/index.tsx +++ b/packages/@uppy/provider-views/src/Item/index.tsx @@ -5,7 +5,7 @@ import type { } from '@uppy/core' import type { I18n } from '@uppy/utils' import classNames from 'classnames' -import type { h } from 'preact' +import type { h } from '@uppy/utils/preact' import GridItem from './components/GridItem.js' import ListItem from './components/ListItem.js' diff --git a/packages/@uppy/provider-views/src/ProviderView/AuthView.tsx b/packages/@uppy/provider-views/src/ProviderView/AuthView.tsx index f623b1d3ed..7dcacf66ab 100644 --- a/packages/@uppy/provider-views/src/ProviderView/AuthView.tsx +++ b/packages/@uppy/provider-views/src/ProviderView/AuthView.tsx @@ -1,7 +1,7 @@ import type { Body, Meta } from '@uppy/core' import type { I18n } from '@uppy/utils' -import type { h } from 'preact' -import { useCallback } from 'preact/hooks' +import type { h } from '@uppy/utils/preact' +import { useCallback } from '@uppy/utils/preact/hooks' import type ProviderViews from './ProviderView.js' import type { Opts } from './ProviderView.js' diff --git a/packages/@uppy/provider-views/src/ProviderView/Header.tsx b/packages/@uppy/provider-views/src/ProviderView/Header.tsx index 5c7c06cfd9..89921570d0 100644 --- a/packages/@uppy/provider-views/src/ProviderView/Header.tsx +++ b/packages/@uppy/provider-views/src/ProviderView/Header.tsx @@ -1,7 +1,7 @@ import type { Body, Meta, PartialTreeFolder } from '@uppy/core' import type { I18n } from '@uppy/utils' import classNames from 'classnames' -import type { h } from 'preact' +import type { h } from '@uppy/utils/preact' import Breadcrumbs from '../Breadcrumbs.js' import type ProviderView from './ProviderView.js' import User from './User.js' diff --git a/packages/@uppy/provider-views/src/ProviderView/ProviderView.tsx b/packages/@uppy/provider-views/src/ProviderView/ProviderView.tsx index 4e010678e2..e765d5e213 100644 --- a/packages/@uppy/provider-views/src/ProviderView/ProviderView.tsx +++ b/packages/@uppy/provider-views/src/ProviderView/ProviderView.tsx @@ -14,7 +14,7 @@ import type { CompanionFile, I18n } from '@uppy/utils' import { remoteFileObjToLocal } from '@uppy/utils' import classNames from 'classnames' import debounce from 'lodash/debounce.js' -import type { h } from 'preact' +import type { h } from '@uppy/utils/preact' import packageJson from '../../package.json' with { type: 'json' } import Browser from '../Browser.js' import FilterInput from '../FilterInput.js' diff --git a/packages/@uppy/provider-views/src/ProviderView/User.tsx b/packages/@uppy/provider-views/src/ProviderView/User.tsx index d95cbd40e9..da8e51fe7b 100644 --- a/packages/@uppy/provider-views/src/ProviderView/User.tsx +++ b/packages/@uppy/provider-views/src/ProviderView/User.tsx @@ -1,4 +1,4 @@ -import { Fragment } from 'preact' +import { Fragment } from '@uppy/utils/preact' type UserProps = { i18n: (phrase: string) => string diff --git a/packages/@uppy/provider-views/src/SearchProviderView/SearchProviderView.tsx b/packages/@uppy/provider-views/src/SearchProviderView/SearchProviderView.tsx index 2de72ba926..c7de50ce70 100644 --- a/packages/@uppy/provider-views/src/SearchProviderView/SearchProviderView.tsx +++ b/packages/@uppy/provider-views/src/SearchProviderView/SearchProviderView.tsx @@ -13,7 +13,7 @@ import type { import type { CompanionFile } from '@uppy/utils' import { remoteFileObjToLocal } from '@uppy/utils' import classNames from 'classnames' -import type { h } from 'preact' +import type { h } from '@uppy/utils/preact' import packageJson from '../../package.json' with { type: 'json' } import Browser from '../Browser.js' import FilterInput from '../FilterInput.js' diff --git a/packages/@uppy/provider-views/src/SearchView.tsx b/packages/@uppy/provider-views/src/SearchView.tsx index 4f25b7b847..daa52550aa 100644 --- a/packages/@uppy/provider-views/src/SearchView.tsx +++ b/packages/@uppy/provider-views/src/SearchView.tsx @@ -1,4 +1,4 @@ -import type { ComponentChild } from 'preact' +import type { ComponentChild } from '@uppy/utils/preact' import { useSearchForm } from './useSearchForm.js' interface SearchViewProps { diff --git a/packages/@uppy/provider-views/src/useSearchForm.ts b/packages/@uppy/provider-views/src/useSearchForm.ts index 2ca162744a..cc643b3156 100644 --- a/packages/@uppy/provider-views/src/useSearchForm.ts +++ b/packages/@uppy/provider-views/src/useSearchForm.ts @@ -1,5 +1,5 @@ import { nanoid } from 'nanoid/non-secure' -import { useCallback, useEffect, useState } from 'preact/hooks' +import { useCallback, useEffect, useState } from '@uppy/utils/preact/hooks' /** * Hook to create a form element outside the component tree to avoid nested forms. diff --git a/packages/@uppy/react/package.json b/packages/@uppy/react/package.json index 646e00f63a..0edf561f8f 100644 --- a/packages/@uppy/react/package.json +++ b/packages/@uppy/react/package.json @@ -36,7 +36,7 @@ ], "dependencies": { "@uppy/components": "workspace:^", - "preact": "^10.26.10", + "@uppy/utils": "workspace:^", "use-sync-external-store": "^1.3.0" }, "devDependencies": { diff --git a/packages/@uppy/react/src/headless/generated/Dropzone.tsx b/packages/@uppy/react/src/headless/generated/Dropzone.tsx index cb78238bba..0b6be50fac 100644 --- a/packages/@uppy/react/src/headless/generated/Dropzone.tsx +++ b/packages/@uppy/react/src/headless/generated/Dropzone.tsx @@ -4,7 +4,7 @@ import { type DropzoneProps, Dropzone as PreactDropzone, } from '@uppy/components' -import { h as preactH, render as preactRender } from 'preact' +import { h as preactH, render as preactRender } from '@uppy/utils/preact' import { useContext, useEffect, useRef } from 'react' import { UppyContext } from '../UppyContextProvider.js' diff --git a/packages/@uppy/react/src/headless/generated/FilesGrid.tsx b/packages/@uppy/react/src/headless/generated/FilesGrid.tsx index 6466ee0bf9..07903ba231 100644 --- a/packages/@uppy/react/src/headless/generated/FilesGrid.tsx +++ b/packages/@uppy/react/src/headless/generated/FilesGrid.tsx @@ -4,7 +4,7 @@ import { type FilesGridProps, FilesGrid as PreactFilesGrid, } from '@uppy/components' -import { h as preactH, render as preactRender } from 'preact' +import { h as preactH, render as preactRender } from '@uppy/utils/preact' import { useContext, useEffect, useRef } from 'react' import { UppyContext } from '../UppyContextProvider.js' diff --git a/packages/@uppy/react/src/headless/generated/FilesList.tsx b/packages/@uppy/react/src/headless/generated/FilesList.tsx index 1606a27cf3..db8d0caa82 100644 --- a/packages/@uppy/react/src/headless/generated/FilesList.tsx +++ b/packages/@uppy/react/src/headless/generated/FilesList.tsx @@ -4,7 +4,7 @@ import { type FilesListProps, FilesList as PreactFilesList, } from '@uppy/components' -import { h as preactH, render as preactRender } from 'preact' +import { h as preactH, render as preactRender } from '@uppy/utils/preact' import { useContext, useEffect, useRef } from 'react' import { UppyContext } from '../UppyContextProvider.js' diff --git a/packages/@uppy/react/src/headless/generated/ProviderIcon.tsx b/packages/@uppy/react/src/headless/generated/ProviderIcon.tsx index baf8e80324..6ea1339d1e 100644 --- a/packages/@uppy/react/src/headless/generated/ProviderIcon.tsx +++ b/packages/@uppy/react/src/headless/generated/ProviderIcon.tsx @@ -4,7 +4,7 @@ import { ProviderIcon as PreactProviderIcon, type ProviderIconProps, } from '@uppy/components' -import { h as preactH, render as preactRender } from 'preact' +import { h as preactH, render as preactRender } from '@uppy/utils/preact' import { useContext, useEffect, useRef } from 'react' import { UppyContext } from '../UppyContextProvider.js' diff --git a/packages/@uppy/react/src/headless/generated/Thumbnail.tsx b/packages/@uppy/react/src/headless/generated/Thumbnail.tsx index 27a0d8c57c..b7afb392b9 100644 --- a/packages/@uppy/react/src/headless/generated/Thumbnail.tsx +++ b/packages/@uppy/react/src/headless/generated/Thumbnail.tsx @@ -4,7 +4,7 @@ import { Thumbnail as PreactThumbnail, type ThumbnailProps, } from '@uppy/components' -import { h as preactH, render as preactRender } from 'preact' +import { h as preactH, render as preactRender } from '@uppy/utils/preact' import { useContext, useEffect, useRef } from 'react' import { UppyContext } from '../UppyContextProvider.js' diff --git a/packages/@uppy/react/src/headless/generated/UploadButton.tsx b/packages/@uppy/react/src/headless/generated/UploadButton.tsx index 6f9c115f45..62f8f34354 100644 --- a/packages/@uppy/react/src/headless/generated/UploadButton.tsx +++ b/packages/@uppy/react/src/headless/generated/UploadButton.tsx @@ -4,7 +4,7 @@ import { UploadButton as PreactUploadButton, type UploadButtonProps, } from '@uppy/components' -import { h as preactH, render as preactRender } from 'preact' +import { h as preactH, render as preactRender } from '@uppy/utils/preact' import { useContext, useEffect, useRef } from 'react' import { UppyContext } from '../UppyContextProvider.js' diff --git a/packages/@uppy/screen-capture/package.json b/packages/@uppy/screen-capture/package.json index ed2d63eb1d..957644245c 100644 --- a/packages/@uppy/screen-capture/package.json +++ b/packages/@uppy/screen-capture/package.json @@ -44,8 +44,7 @@ "./package.json": "./package.json" }, "dependencies": { - "@uppy/utils": "workspace:^", - "preact": "^10.26.10" + "@uppy/utils": "workspace:^" }, "peerDependencies": { "@uppy/core": "workspace:^" diff --git a/packages/@uppy/screen-capture/src/DiscardButton.tsx b/packages/@uppy/screen-capture/src/DiscardButton.tsx index d16e464a4b..d4ef9ba0a8 100644 --- a/packages/@uppy/screen-capture/src/DiscardButton.tsx +++ b/packages/@uppy/screen-capture/src/DiscardButton.tsx @@ -1,5 +1,5 @@ import type { I18n } from '@uppy/utils' -import type { h } from 'preact' +import type { h } from '@uppy/utils/preact' interface DiscardButtonProps { onDiscard: () => void diff --git a/packages/@uppy/screen-capture/src/RecordButton.tsx b/packages/@uppy/screen-capture/src/RecordButton.tsx index 4ff6de7d11..5dec46284e 100644 --- a/packages/@uppy/screen-capture/src/RecordButton.tsx +++ b/packages/@uppy/screen-capture/src/RecordButton.tsx @@ -1,5 +1,5 @@ import type { I18n } from '@uppy/utils' -import type { h } from 'preact' +import type { h } from '@uppy/utils/preact' interface RecordButtonProps { recording: boolean | undefined diff --git a/packages/@uppy/screen-capture/src/RecorderScreen.tsx b/packages/@uppy/screen-capture/src/RecorderScreen.tsx index d2e6ce129d..2b730dd8f0 100644 --- a/packages/@uppy/screen-capture/src/RecorderScreen.tsx +++ b/packages/@uppy/screen-capture/src/RecorderScreen.tsx @@ -1,5 +1,5 @@ import type { Body, Meta } from '@uppy/core' -import { Component, type ComponentChild, Fragment } from 'preact' +import { Component, type ComponentChild, Fragment } from '@uppy/utils/preact' import DiscardButton from './DiscardButton.js' import RecordButton from './RecordButton.js' import type ScreenCapture from './ScreenCapture.js' diff --git a/packages/@uppy/screen-capture/src/ScreenCapture.tsx b/packages/@uppy/screen-capture/src/ScreenCapture.tsx index e99edfd2d5..e120a177a4 100644 --- a/packages/@uppy/screen-capture/src/ScreenCapture.tsx +++ b/packages/@uppy/screen-capture/src/ScreenCapture.tsx @@ -8,7 +8,7 @@ import type { import { UIPlugin } from '@uppy/core' import type { LocaleStrings } from '@uppy/utils' import { getFileTypeExtension } from '@uppy/utils' -import type { ComponentChild } from 'preact' +import type { ComponentChild } from '@uppy/utils/preact' import packageJson from '../package.json' with { type: 'json' } import locale from './locale.js' import RecorderScreen from './RecorderScreen.js' diff --git a/packages/@uppy/screen-capture/src/StopWatch.tsx b/packages/@uppy/screen-capture/src/StopWatch.tsx index 501f583431..d427f2beca 100644 --- a/packages/@uppy/screen-capture/src/StopWatch.tsx +++ b/packages/@uppy/screen-capture/src/StopWatch.tsx @@ -1,4 +1,4 @@ -import { Component } from 'preact' +import { Component } from '@uppy/utils/preact' type $TSFixMe = any diff --git a/packages/@uppy/screen-capture/src/SubmitButton.tsx b/packages/@uppy/screen-capture/src/SubmitButton.tsx index 61761c9a7a..a0533697ae 100644 --- a/packages/@uppy/screen-capture/src/SubmitButton.tsx +++ b/packages/@uppy/screen-capture/src/SubmitButton.tsx @@ -1,5 +1,5 @@ import type { I18n } from '@uppy/utils' -import type { h } from 'preact' +import type { h } from '@uppy/utils/preact' interface SubmitButtonProps { recording: boolean diff --git a/packages/@uppy/status-bar/package.json b/packages/@uppy/status-bar/package.json index 8625379428..9969a9f288 100644 --- a/packages/@uppy/status-bar/package.json +++ b/packages/@uppy/status-bar/package.json @@ -48,8 +48,7 @@ "dependencies": { "@transloadit/prettier-bytes": "^0.3.4", "@uppy/utils": "workspace:^", - "classnames": "^2.2.6", - "preact": "^10.26.10" + "classnames": "^2.2.6" }, "peerDependencies": { "@uppy/core": "workspace:^" diff --git a/packages/@uppy/status-bar/src/StatusBar.tsx b/packages/@uppy/status-bar/src/StatusBar.tsx index 07d8827446..7d90f1c9df 100644 --- a/packages/@uppy/status-bar/src/StatusBar.tsx +++ b/packages/@uppy/status-bar/src/StatusBar.tsx @@ -8,7 +8,7 @@ import type { } from '@uppy/core' import { UIPlugin } from '@uppy/core' import { emaFilter, getTextDirection } from '@uppy/utils' -import type { ComponentChild } from 'preact' +import type { ComponentChild } from '@uppy/utils/preact' import packageJson from '../package.json' with { type: 'json' } import locale from './locale.js' import type { StatusBarOptions } from './StatusBarOptions.js' diff --git a/packages/@uppy/svelte/package.json b/packages/@uppy/svelte/package.json index f85ecbe028..360880702d 100644 --- a/packages/@uppy/svelte/package.json +++ b/packages/@uppy/svelte/package.json @@ -54,7 +54,7 @@ }, "dependencies": { "@uppy/components": "workspace:^", - "preact": "^10.26.10" + "@uppy/utils": "workspace:^" }, "devDependencies": { "@sveltejs/adapter-auto": "^6.0.0", diff --git a/packages/@uppy/svelte/src/lib/components/headless/generated/Dropzone.svelte b/packages/@uppy/svelte/src/lib/components/headless/generated/Dropzone.svelte index 3b983753d3..b70ded4676 100644 --- a/packages/@uppy/svelte/src/lib/components/headless/generated/Dropzone.svelte +++ b/packages/@uppy/svelte/src/lib/components/headless/generated/Dropzone.svelte @@ -7,7 +7,7 @@ type DropzoneProps, type UppyContext, } from '@uppy/components' - import { h as preactH, render as preactRender } from 'preact' + import { h as preactH, render as preactRender } from '@uppy/utils/preact' import { UppyContextKey } from '../UppyContextProvider.svelte' const props: Omit = $props() diff --git a/packages/@uppy/svelte/src/lib/components/headless/generated/FilesGrid.svelte b/packages/@uppy/svelte/src/lib/components/headless/generated/FilesGrid.svelte index 71dd9f91e9..4b3bca3d1c 100644 --- a/packages/@uppy/svelte/src/lib/components/headless/generated/FilesGrid.svelte +++ b/packages/@uppy/svelte/src/lib/components/headless/generated/FilesGrid.svelte @@ -7,7 +7,7 @@ type FilesGridProps, type UppyContext, } from '@uppy/components' - import { h as preactH, render as preactRender } from 'preact' + import { h as preactH, render as preactRender } from '@uppy/utils/preact' import { UppyContextKey } from '../UppyContextProvider.svelte' const props: Omit = $props() diff --git a/packages/@uppy/svelte/src/lib/components/headless/generated/FilesList.svelte b/packages/@uppy/svelte/src/lib/components/headless/generated/FilesList.svelte index db62a6d2d4..adcf2b24e8 100644 --- a/packages/@uppy/svelte/src/lib/components/headless/generated/FilesList.svelte +++ b/packages/@uppy/svelte/src/lib/components/headless/generated/FilesList.svelte @@ -7,7 +7,7 @@ type FilesListProps, type UppyContext, } from '@uppy/components' - import { h as preactH, render as preactRender } from 'preact' + import { h as preactH, render as preactRender } from '@uppy/utils/preact' import { UppyContextKey } from '../UppyContextProvider.svelte' const props: Omit = $props() diff --git a/packages/@uppy/svelte/src/lib/components/headless/generated/ProviderIcon.svelte b/packages/@uppy/svelte/src/lib/components/headless/generated/ProviderIcon.svelte index 6fca44e5b6..3074ef9c72 100644 --- a/packages/@uppy/svelte/src/lib/components/headless/generated/ProviderIcon.svelte +++ b/packages/@uppy/svelte/src/lib/components/headless/generated/ProviderIcon.svelte @@ -7,7 +7,7 @@ type ProviderIconProps, type UppyContext, } from '@uppy/components' - import { h as preactH, render as preactRender } from 'preact' + import { h as preactH, render as preactRender } from '@uppy/utils/preact' import { UppyContextKey } from '../UppyContextProvider.svelte' const props: Omit = $props() diff --git a/packages/@uppy/svelte/src/lib/components/headless/generated/Thumbnail.svelte b/packages/@uppy/svelte/src/lib/components/headless/generated/Thumbnail.svelte index 0f7ba505dd..32ad4e90cb 100644 --- a/packages/@uppy/svelte/src/lib/components/headless/generated/Thumbnail.svelte +++ b/packages/@uppy/svelte/src/lib/components/headless/generated/Thumbnail.svelte @@ -7,7 +7,7 @@ type ThumbnailProps, type UppyContext, } from '@uppy/components' - import { h as preactH, render as preactRender } from 'preact' + import { h as preactH, render as preactRender } from '@uppy/utils/preact' import { UppyContextKey } from '../UppyContextProvider.svelte' const props: Omit = $props() diff --git a/packages/@uppy/svelte/src/lib/components/headless/generated/UploadButton.svelte b/packages/@uppy/svelte/src/lib/components/headless/generated/UploadButton.svelte index cc6a0869f0..adac979db8 100644 --- a/packages/@uppy/svelte/src/lib/components/headless/generated/UploadButton.svelte +++ b/packages/@uppy/svelte/src/lib/components/headless/generated/UploadButton.svelte @@ -7,7 +7,7 @@ type UploadButtonProps, type UppyContext, } from '@uppy/components' - import { h as preactH, render as preactRender } from 'preact' + import { h as preactH, render as preactRender } from '@uppy/utils/preact' import { UppyContextKey } from '../UppyContextProvider.svelte' const props: Omit = $props() diff --git a/packages/@uppy/unsplash/package.json b/packages/@uppy/unsplash/package.json index 1c7cfa077f..3e74387504 100644 --- a/packages/@uppy/unsplash/package.json +++ b/packages/@uppy/unsplash/package.json @@ -36,8 +36,7 @@ "dependencies": { "@uppy/companion-client": "workspace:^", "@uppy/provider-views": "workspace:^", - "@uppy/utils": "workspace:^", - "preact": "^10.26.10" + "@uppy/utils": "workspace:^" }, "peerDependencies": { "@uppy/core": "workspace:^" diff --git a/packages/@uppy/unsplash/src/Unsplash.tsx b/packages/@uppy/unsplash/src/Unsplash.tsx index 8dccee16b0..1ca4b09051 100644 --- a/packages/@uppy/unsplash/src/Unsplash.tsx +++ b/packages/@uppy/unsplash/src/Unsplash.tsx @@ -16,7 +16,7 @@ import { UIPlugin, type Uppy } from '@uppy/core' import { SearchProviderViews } from '@uppy/provider-views' import type { LocaleStrings } from '@uppy/utils' // biome-ignore lint/style/useImportType: h is not a type -import { type ComponentChild, h } from 'preact' +import { type ComponentChild, h } from '@uppy/utils/preact' import packageJson from '../package.json' with { type: 'json' } import locale from './locale.js' diff --git a/packages/@uppy/url/package.json b/packages/@uppy/url/package.json index b76225a39c..ba436199ab 100644 --- a/packages/@uppy/url/package.json +++ b/packages/@uppy/url/package.json @@ -46,8 +46,7 @@ "dependencies": { "@uppy/companion-client": "workspace:^", "@uppy/utils": "workspace:^", - "nanoid": "^5.0.9", - "preact": "^10.26.10" + "nanoid": "^5.0.9" }, "peerDependencies": { "@uppy/core": "workspace:^" diff --git a/packages/@uppy/url/src/Url.tsx b/packages/@uppy/url/src/Url.tsx index 76d1873d73..44851feb39 100644 --- a/packages/@uppy/url/src/Url.tsx +++ b/packages/@uppy/url/src/Url.tsx @@ -11,7 +11,7 @@ import type { } from '@uppy/utils' import { toArray } from '@uppy/utils' // biome-ignore lint/style/useImportType: h is not a type -import { type ComponentChild, h } from 'preact' +import { type ComponentChild, h } from '@uppy/utils/preact' import packageJson from '../package.json' with { type: 'json' } import locale from './locale.js' import UrlUI from './UrlUI.js' diff --git a/packages/@uppy/url/src/UrlUI.tsx b/packages/@uppy/url/src/UrlUI.tsx index c88e499928..12ba5dc4b8 100644 --- a/packages/@uppy/url/src/UrlUI.tsx +++ b/packages/@uppy/url/src/UrlUI.tsx @@ -1,6 +1,6 @@ import type { I18n } from '@uppy/utils' import { nanoid } from 'nanoid/non-secure' -import { Component, type ComponentChild } from 'preact' +import { Component, type ComponentChild } from '@uppy/utils/preact' type UrlUIProps = { i18n: I18n diff --git a/packages/@uppy/utils/package.json b/packages/@uppy/utils/package.json index 77ead056bd..39b36dbe4f 100644 --- a/packages/@uppy/utils/package.json +++ b/packages/@uppy/utils/package.json @@ -30,6 +30,8 @@ ], "exports": { ".": "./lib/index.js", + "./preact": "./lib/preact/index.js", + "./preact/hooks": "./lib/preact/hooks.js", "./package.json": "./package.json" }, "dependencies": { diff --git a/packages/@uppy/utils/src/preact/hooks.ts b/packages/@uppy/utils/src/preact/hooks.ts new file mode 100644 index 0000000000..1a9d8d6cd6 --- /dev/null +++ b/packages/@uppy/utils/src/preact/hooks.ts @@ -0,0 +1,2 @@ +export * from 'preact/hooks' + diff --git a/packages/@uppy/utils/src/preact/index.ts b/packages/@uppy/utils/src/preact/index.ts new file mode 100644 index 0000000000..5b435dc109 --- /dev/null +++ b/packages/@uppy/utils/src/preact/index.ts @@ -0,0 +1,2 @@ +export * from 'preact' + diff --git a/packages/@uppy/vue/package.json b/packages/@uppy/vue/package.json index f43e35a79a..50d177971e 100644 --- a/packages/@uppy/vue/package.json +++ b/packages/@uppy/vue/package.json @@ -19,7 +19,7 @@ ], "dependencies": { "@uppy/components": "workspace:^", - "preact": "^10.26.10", + "@uppy/utils": "workspace:^", "shallow-equal": "^3.0.0" }, "devDependencies": { diff --git a/packages/@uppy/vue/src/headless/generated/Dropzone.ts b/packages/@uppy/vue/src/headless/generated/Dropzone.ts index 41bc3dfecc..3df5e52f25 100644 --- a/packages/@uppy/vue/src/headless/generated/Dropzone.ts +++ b/packages/@uppy/vue/src/headless/generated/Dropzone.ts @@ -5,7 +5,7 @@ import { type DropzoneProps, Dropzone as PreactDropzone, } from '@uppy/components' -import { h as preactH, render as preactRender } from 'preact' +import { h as preactH, render as preactRender } from '@uppy/utils/preact' import { defineComponent, h, onMounted, ref, watch } from 'vue' import { useUppyContext } from '../useUppyContext.js' diff --git a/packages/@uppy/vue/src/headless/generated/FilesGrid.ts b/packages/@uppy/vue/src/headless/generated/FilesGrid.ts index 389ac52a21..3a315aeed2 100644 --- a/packages/@uppy/vue/src/headless/generated/FilesGrid.ts +++ b/packages/@uppy/vue/src/headless/generated/FilesGrid.ts @@ -5,7 +5,7 @@ import { type FilesGridProps, FilesGrid as PreactFilesGrid, } from '@uppy/components' -import { h as preactH, render as preactRender } from 'preact' +import { h as preactH, render as preactRender } from '@uppy/utils/preact' import { defineComponent, h, onMounted, ref, watch } from 'vue' import { useUppyContext } from '../useUppyContext.js' diff --git a/packages/@uppy/vue/src/headless/generated/FilesList.ts b/packages/@uppy/vue/src/headless/generated/FilesList.ts index c91b24b4c1..7c85c28c28 100644 --- a/packages/@uppy/vue/src/headless/generated/FilesList.ts +++ b/packages/@uppy/vue/src/headless/generated/FilesList.ts @@ -5,7 +5,7 @@ import { type FilesListProps, FilesList as PreactFilesList, } from '@uppy/components' -import { h as preactH, render as preactRender } from 'preact' +import { h as preactH, render as preactRender } from '@uppy/utils/preact' import { defineComponent, h, onMounted, ref, watch } from 'vue' import { useUppyContext } from '../useUppyContext.js' diff --git a/packages/@uppy/vue/src/headless/generated/ProviderIcon.ts b/packages/@uppy/vue/src/headless/generated/ProviderIcon.ts index b7525d1544..97467ecefc 100644 --- a/packages/@uppy/vue/src/headless/generated/ProviderIcon.ts +++ b/packages/@uppy/vue/src/headless/generated/ProviderIcon.ts @@ -5,7 +5,7 @@ import { ProviderIcon as PreactProviderIcon, type ProviderIconProps, } from '@uppy/components' -import { h as preactH, render as preactRender } from 'preact' +import { h as preactH, render as preactRender } from '@uppy/utils/preact' import { defineComponent, h, onMounted, ref, watch } from 'vue' import { useUppyContext } from '../useUppyContext.js' diff --git a/packages/@uppy/vue/src/headless/generated/Thumbnail.ts b/packages/@uppy/vue/src/headless/generated/Thumbnail.ts index 8421facb7c..002829f9db 100644 --- a/packages/@uppy/vue/src/headless/generated/Thumbnail.ts +++ b/packages/@uppy/vue/src/headless/generated/Thumbnail.ts @@ -5,7 +5,7 @@ import { Thumbnail as PreactThumbnail, type ThumbnailProps, } from '@uppy/components' -import { h as preactH, render as preactRender } from 'preact' +import { h as preactH, render as preactRender } from '@uppy/utils/preact' import { defineComponent, h, onMounted, ref, watch } from 'vue' import { useUppyContext } from '../useUppyContext.js' diff --git a/packages/@uppy/vue/src/headless/generated/UploadButton.ts b/packages/@uppy/vue/src/headless/generated/UploadButton.ts index f2ea9e4d4e..c69a6f4db7 100644 --- a/packages/@uppy/vue/src/headless/generated/UploadButton.ts +++ b/packages/@uppy/vue/src/headless/generated/UploadButton.ts @@ -5,7 +5,7 @@ import { UploadButton as PreactUploadButton, type UploadButtonProps, } from '@uppy/components' -import { h as preactH, render as preactRender } from 'preact' +import { h as preactH, render as preactRender } from '@uppy/utils/preact' import { defineComponent, h, onMounted, ref, watch } from 'vue' import { useUppyContext } from '../useUppyContext.js' diff --git a/packages/@uppy/webcam/package.json b/packages/@uppy/webcam/package.json index c204ca8700..392b8f9f63 100644 --- a/packages/@uppy/webcam/package.json +++ b/packages/@uppy/webcam/package.json @@ -48,8 +48,7 @@ }, "dependencies": { "@uppy/utils": "workspace:^", - "is-mobile": "^4.0.0", - "preact": "^10.26.10" + "is-mobile": "^4.0.0" }, "devDependencies": { "cssnano": "^7.0.7", diff --git a/packages/@uppy/webcam/src/CameraIcon.tsx b/packages/@uppy/webcam/src/CameraIcon.tsx index 25ae6176cf..54b1d7d92c 100644 --- a/packages/@uppy/webcam/src/CameraIcon.tsx +++ b/packages/@uppy/webcam/src/CameraIcon.tsx @@ -1,4 +1,4 @@ -import type { ComponentChild } from 'preact' +import type { ComponentChild } from '@uppy/utils/preact' export default function CameraIcon(): ComponentChild { return ( diff --git a/packages/@uppy/webcam/src/CameraScreen.tsx b/packages/@uppy/webcam/src/CameraScreen.tsx index 167197f8a0..ce2bd87e8c 100644 --- a/packages/@uppy/webcam/src/CameraScreen.tsx +++ b/packages/@uppy/webcam/src/CameraScreen.tsx @@ -1,5 +1,5 @@ import type { I18n } from '@uppy/utils' -import { Component, type ComponentChild, type ComponentProps } from 'preact' +import { Component, type ComponentChild, type ComponentProps } from '@uppy/utils/preact' import DiscardButton from './DiscardButton.js' import RecordButton from './RecordButton.js' import RecordingLength from './RecordingLength.js' diff --git a/packages/@uppy/webcam/src/PermissionsScreen.tsx b/packages/@uppy/webcam/src/PermissionsScreen.tsx index 04accdadf0..0f0c6dc903 100644 --- a/packages/@uppy/webcam/src/PermissionsScreen.tsx +++ b/packages/@uppy/webcam/src/PermissionsScreen.tsx @@ -1,5 +1,5 @@ import type { I18n } from '@uppy/utils' -import type { ComponentChild } from 'preact' +import type { ComponentChild } from '@uppy/utils/preact' interface PermissionScreenProps { hasCamera: boolean diff --git a/packages/@uppy/webcam/src/VideoSourceSelect.tsx b/packages/@uppy/webcam/src/VideoSourceSelect.tsx index b9f0eb2ff9..9f46163619 100644 --- a/packages/@uppy/webcam/src/VideoSourceSelect.tsx +++ b/packages/@uppy/webcam/src/VideoSourceSelect.tsx @@ -1,4 +1,4 @@ -import type { ComponentChild } from 'preact' +import type { ComponentChild } from '@uppy/utils/preact' export interface VideoSourceSelectProps { currentDeviceId: string | MediaStreamTrack | null | undefined diff --git a/packages/@uppy/webcam/src/Webcam.tsx b/packages/@uppy/webcam/src/Webcam.tsx index 54ed86759f..e9c284f5de 100644 --- a/packages/@uppy/webcam/src/Webcam.tsx +++ b/packages/@uppy/webcam/src/Webcam.tsx @@ -12,7 +12,7 @@ import type { LocaleStrings, LocalUppyFileNonGhost } from '@uppy/utils' import { canvasToBlob, getFileTypeExtension, mimeTypes } from '@uppy/utils' import { isMobile } from 'is-mobile' // biome-ignore lint/style/useImportType: h is not a type -import { type ComponentChild, h } from 'preact' +import { type ComponentChild, h } from '@uppy/utils/preact' import packageJson from '../package.json' with { type: 'json' } import CameraIcon from './CameraIcon.js' import CameraScreen from './CameraScreen.js' diff --git a/packages/@uppy/webdav/package.json b/packages/@uppy/webdav/package.json index f2d0302f5d..6de775386b 100644 --- a/packages/@uppy/webdav/package.json +++ b/packages/@uppy/webdav/package.json @@ -40,8 +40,7 @@ "dependencies": { "@uppy/companion-client": "workspace:^", "@uppy/provider-views": "workspace:^", - "@uppy/utils": "workspace:^", - "preact": "^10.26.10" + "@uppy/utils": "workspace:^" }, "peerDependencies": { "@uppy/core": "workspace:^" diff --git a/packages/@uppy/webdav/src/Webdav.tsx b/packages/@uppy/webdav/src/Webdav.tsx index 840abe6052..7496764aed 100644 --- a/packages/@uppy/webdav/src/Webdav.tsx +++ b/packages/@uppy/webdav/src/Webdav.tsx @@ -17,8 +17,8 @@ import { UIPlugin } from '@uppy/core' import { ProviderViews, SearchView } from '@uppy/provider-views' import type { I18n, LocaleStrings } from '@uppy/utils' // biome-ignore lint/style/useImportType: h is not a type -import { type ComponentChild, h } from 'preact' -import { useCallback, useState } from 'preact/hooks' +import { type ComponentChild, h } from '@uppy/utils/preact' +import { useCallback, useState } from '@uppy/utils/preact/hooks' import packageJson from '../package.json' with { type: 'json' } import locale from './locale.js' diff --git a/packages/@uppy/zoom/package.json b/packages/@uppy/zoom/package.json index 23a44478ba..91490145d4 100644 --- a/packages/@uppy/zoom/package.json +++ b/packages/@uppy/zoom/package.json @@ -36,8 +36,7 @@ "dependencies": { "@uppy/companion-client": "workspace:^", "@uppy/provider-views": "workspace:^", - "@uppy/utils": "workspace:^", - "preact": "^10.26.10" + "@uppy/utils": "workspace:^" }, "peerDependencies": { "@uppy/core": "workspace:^" diff --git a/packages/@uppy/zoom/src/Zoom.tsx b/packages/@uppy/zoom/src/Zoom.tsx index 8cbc8b0e2e..2965a733b6 100644 --- a/packages/@uppy/zoom/src/Zoom.tsx +++ b/packages/@uppy/zoom/src/Zoom.tsx @@ -17,7 +17,7 @@ import { ProviderViews } from '@uppy/provider-views' import type { LocaleStrings } from '@uppy/utils' // biome-ignore lint/style/useImportType: h is not a type -import { type ComponentChild, h } from 'preact' +import { type ComponentChild, h } from '@uppy/utils/preact' import packageJson from '../package.json' with { type: 'json' } import locale from './locale.js' From bf03e87913088ea5d72c3058666f5de75a0587f6 Mon Sep 17 00:00:00 2001 From: Murderlon Date: Tue, 3 Mar 2026 12:19:45 +0100 Subject: [PATCH 2/4] format --- packages/@uppy/components/src/Dropzone.tsx | 2 +- packages/@uppy/components/src/FilesGrid.tsx | 2 +- packages/@uppy/components/src/FilesList.tsx | 2 +- packages/@uppy/core/src/Uppy.ts | 2 +- packages/@uppy/dashboard/src/Dashboard.tsx | 2 +- packages/@uppy/dashboard/src/components/AddFiles.tsx | 7 ++++++- packages/@uppy/dashboard/src/components/Dashboard.tsx | 2 +- .../@uppy/dashboard/src/components/FileCard/index.tsx | 7 ++++++- .../@uppy/dashboard/src/components/FileItem/index.tsx | 2 +- .../dashboard/src/components/PickerPanelContent.tsx | 2 +- packages/@uppy/dashboard/src/components/Slide.tsx | 9 +++++++-- packages/@uppy/provider-views/src/FooterActions.tsx | 2 +- .../provider-views/src/GooglePicker/GooglePickerView.tsx | 7 ++++++- packages/@uppy/provider-views/src/Item/index.tsx | 2 +- .../@uppy/provider-views/src/ProviderView/Header.tsx | 2 +- .../provider-views/src/ProviderView/ProviderView.tsx | 2 +- .../src/SearchProviderView/SearchProviderView.tsx | 2 +- packages/@uppy/provider-views/src/useSearchForm.ts | 2 +- packages/@uppy/url/src/UrlUI.tsx | 2 +- packages/@uppy/utils/src/preact/hooks.ts | 1 - packages/@uppy/utils/src/preact/index.ts | 1 - packages/@uppy/webcam/src/CameraScreen.tsx | 6 +++++- packages/@uppy/webcam/src/Webcam.tsx | 2 +- 23 files changed, 46 insertions(+), 24 deletions(-) diff --git a/packages/@uppy/components/src/Dropzone.tsx b/packages/@uppy/components/src/Dropzone.tsx index 127d8f5ce5..77a3418207 100644 --- a/packages/@uppy/components/src/Dropzone.tsx +++ b/packages/@uppy/components/src/Dropzone.tsx @@ -1,5 +1,5 @@ -import { clsx } from 'clsx' import { useMemo } from '@uppy/utils/preact/hooks' +import { clsx } from 'clsx' import { createDropzone } from './hooks/dropzone.js' import type { NonNullableUppyContext, UppyContext } from './types.js' diff --git a/packages/@uppy/components/src/FilesGrid.tsx b/packages/@uppy/components/src/FilesGrid.tsx index 41b26fd5bf..737501128d 100644 --- a/packages/@uppy/components/src/FilesGrid.tsx +++ b/packages/@uppy/components/src/FilesGrid.tsx @@ -1,7 +1,7 @@ import type { Body, Meta, UppyEventMap, UppyFile } from '@uppy/core' -import { clsx } from 'clsx' import { Fragment } from '@uppy/utils/preact' import { useEffect, useState } from '@uppy/utils/preact/hooks' +import { clsx } from 'clsx' import prettyBytes from 'pretty-bytes' import { Thumbnail } from './index.js' import type { UppyContext } from './types.js' diff --git a/packages/@uppy/components/src/FilesList.tsx b/packages/@uppy/components/src/FilesList.tsx index 79a62dc98e..7bb068d1bb 100644 --- a/packages/@uppy/components/src/FilesList.tsx +++ b/packages/@uppy/components/src/FilesList.tsx @@ -1,7 +1,7 @@ import type { Body, Meta, UppyEventMap, UppyFile } from '@uppy/core' -import { clsx } from 'clsx' import { Fragment } from '@uppy/utils/preact' import { useEffect, useState } from '@uppy/utils/preact/hooks' +import { clsx } from 'clsx' import prettyBytes from 'pretty-bytes' import { Thumbnail, type UppyContext } from './index.js' diff --git a/packages/@uppy/core/src/Uppy.ts b/packages/@uppy/core/src/Uppy.ts index 108f9540b8..3c4c07491c 100644 --- a/packages/@uppy/core/src/Uppy.ts +++ b/packages/@uppy/core/src/Uppy.ts @@ -24,11 +24,11 @@ import { getSafeFileId, Translator, } from '@uppy/utils' +import type { h } from '@uppy/utils/preact' import throttle from 'lodash/throttle.js' // @ts-ignore untyped import ee from 'namespace-emitter' import { nanoid } from 'nanoid/non-secure' -import type { h } from '@uppy/utils/preact' import packageJson from '../package.json' with { type: 'json' } import type BasePlugin from './BasePlugin.js' import getFileName from './getFileName.js' diff --git a/packages/@uppy/dashboard/src/Dashboard.tsx b/packages/@uppy/dashboard/src/Dashboard.tsx index b8fb75cd06..ca3f1130e4 100644 --- a/packages/@uppy/dashboard/src/Dashboard.tsx +++ b/packages/@uppy/dashboard/src/Dashboard.tsx @@ -14,8 +14,8 @@ import { defaultPickerIcon } from '@uppy/provider-views' import ThumbnailGenerator from '@uppy/thumbnail-generator' import type { LocaleStrings } from '@uppy/utils' import { findAllDOMElements, getDroppedFiles, toArray } from '@uppy/utils' -import { nanoid } from 'nanoid/non-secure' import type { ComponentChild, h, VNode } from '@uppy/utils/preact' +import { nanoid } from 'nanoid/non-secure' import packageJson from '../package.json' with { type: 'json' } import DashboardUI from './components/Dashboard.js' import locale from './locale.js' diff --git a/packages/@uppy/dashboard/src/components/AddFiles.tsx b/packages/@uppy/dashboard/src/components/AddFiles.tsx index 0fc8fb5cdd..1ecfee85f3 100644 --- a/packages/@uppy/dashboard/src/components/AddFiles.tsx +++ b/packages/@uppy/dashboard/src/components/AddFiles.tsx @@ -1,5 +1,10 @@ import type { I18n, Translator } from '@uppy/utils' -import { Component, type ComponentChild, Fragment, type h } from '@uppy/utils/preact' +import { + Component, + type ComponentChild, + Fragment, + type h, +} from '@uppy/utils/preact' import type { DashboardState, TargetWithRender } from '../Dashboard.js' interface AddFilesProps { diff --git a/packages/@uppy/dashboard/src/components/Dashboard.tsx b/packages/@uppy/dashboard/src/components/Dashboard.tsx index 360a7171c5..c7badfa4dc 100644 --- a/packages/@uppy/dashboard/src/components/Dashboard.tsx +++ b/packages/@uppy/dashboard/src/components/Dashboard.tsx @@ -9,8 +9,8 @@ import type { } from '@uppy/core' import type { I18n, Translator } from '@uppy/utils' import { isDragDropSupported } from '@uppy/utils' -import classNames from 'classnames' import type { h } from '@uppy/utils/preact' +import classNames from 'classnames' import type { DashboardState, TargetWithRender } from '../Dashboard.js' import AddFiles from './AddFiles.js' import AddFilesPanel from './AddFilesPanel.js' diff --git a/packages/@uppy/dashboard/src/components/FileCard/index.tsx b/packages/@uppy/dashboard/src/components/FileCard/index.tsx index 9889bf5b90..0a619a3b29 100644 --- a/packages/@uppy/dashboard/src/components/FileCard/index.tsx +++ b/packages/@uppy/dashboard/src/components/FileCard/index.tsx @@ -1,6 +1,11 @@ +import { + useCallback, + useEffect, + useRef, + useState, +} from '@uppy/utils/preact/hooks' import classNames from 'classnames' import { nanoid } from 'nanoid/non-secure' -import { useCallback, useEffect, useRef, useState } from '@uppy/utils/preact/hooks' import getFileTypeIcon from '../../utils/getFileTypeIcon.js' import ignoreEvent from '../../utils/ignoreEvent.js' import FilePreview from '../FilePreview.js' diff --git a/packages/@uppy/dashboard/src/components/FileItem/index.tsx b/packages/@uppy/dashboard/src/components/FileItem/index.tsx index abbb94d9be..292e37046d 100644 --- a/packages/@uppy/dashboard/src/components/FileItem/index.tsx +++ b/packages/@uppy/dashboard/src/components/FileItem/index.tsx @@ -1,9 +1,9 @@ import type Uppy from '@uppy/core' import type { Body, Meta, State, UppyFile } from '@uppy/core' import type { I18n } from '@uppy/utils' -import classNames from 'classnames' // biome-ignore lint/style/useImportType: h is not a type import { Component, type ComponentChild, h } from '@uppy/utils/preact' +import classNames from 'classnames' import { shallowEqualObjects } from 'shallow-equal' import type { DashboardState } from '../../Dashboard.js' import Buttons from './Buttons/index.js' diff --git a/packages/@uppy/dashboard/src/components/PickerPanelContent.tsx b/packages/@uppy/dashboard/src/components/PickerPanelContent.tsx index 33e9986346..d9bdbf5221 100644 --- a/packages/@uppy/dashboard/src/components/PickerPanelContent.tsx +++ b/packages/@uppy/dashboard/src/components/PickerPanelContent.tsx @@ -1,5 +1,5 @@ -import classNames from 'classnames' import { useRef } from '@uppy/utils/preact/hooks' +import classNames from 'classnames' import ignoreEvent from '../utils/ignoreEvent.js' type $TSFixMe = any diff --git a/packages/@uppy/dashboard/src/components/Slide.tsx b/packages/@uppy/dashboard/src/components/Slide.tsx index f3590bedfd..d08dbc5544 100644 --- a/packages/@uppy/dashboard/src/components/Slide.tsx +++ b/packages/@uppy/dashboard/src/components/Slide.tsx @@ -1,11 +1,16 @@ -import classNames from 'classnames' import { type ComponentChildren, cloneElement, toChildArray, type VNode, } from '@uppy/utils/preact' -import { useCallback, useEffect, useRef, useState } from '@uppy/utils/preact/hooks' +import { + useCallback, + useEffect, + useRef, + useState, +} from '@uppy/utils/preact/hooks' +import classNames from 'classnames' const transitionName = 'uppy-transition-slideDownUp' const duration = 250 diff --git a/packages/@uppy/provider-views/src/FooterActions.tsx b/packages/@uppy/provider-views/src/FooterActions.tsx index 214c27cca8..17dc81bc0d 100644 --- a/packages/@uppy/provider-views/src/FooterActions.tsx +++ b/packages/@uppy/provider-views/src/FooterActions.tsx @@ -1,7 +1,7 @@ import type { Body, Meta, PartialTree } from '@uppy/core' import type { I18n } from '@uppy/utils' -import classNames from 'classnames' import { useMemo } from '@uppy/utils/preact/hooks' +import classNames from 'classnames' import type ProviderView from './ProviderView/ProviderView.js' import getNumberOfSelectedFiles from './utils/PartialTreeUtils/getNumberOfSelectedFiles.js' diff --git a/packages/@uppy/provider-views/src/GooglePicker/GooglePickerView.tsx b/packages/@uppy/provider-views/src/GooglePicker/GooglePickerView.tsx index 1f72a08edb..5a1fb0c201 100644 --- a/packages/@uppy/provider-views/src/GooglePicker/GooglePickerView.tsx +++ b/packages/@uppy/provider-views/src/GooglePicker/GooglePickerView.tsx @@ -1,6 +1,11 @@ import type { AsyncStore, Uppy } from '@uppy/core' import type { I18n } from '@uppy/utils' -import { useCallback, useEffect, useRef, useState } from '@uppy/utils/preact/hooks' +import { + useCallback, + useEffect, + useRef, + useState, +} from '@uppy/utils/preact/hooks' import AuthView from '../ProviderView/AuthView.js' import { authorize, diff --git a/packages/@uppy/provider-views/src/Item/index.tsx b/packages/@uppy/provider-views/src/Item/index.tsx index 34735f80e3..0ff2f90f45 100644 --- a/packages/@uppy/provider-views/src/Item/index.tsx +++ b/packages/@uppy/provider-views/src/Item/index.tsx @@ -4,8 +4,8 @@ import type { PartialTreeId, } from '@uppy/core' import type { I18n } from '@uppy/utils' -import classNames from 'classnames' import type { h } from '@uppy/utils/preact' +import classNames from 'classnames' import GridItem from './components/GridItem.js' import ListItem from './components/ListItem.js' diff --git a/packages/@uppy/provider-views/src/ProviderView/Header.tsx b/packages/@uppy/provider-views/src/ProviderView/Header.tsx index 89921570d0..5f8772a980 100644 --- a/packages/@uppy/provider-views/src/ProviderView/Header.tsx +++ b/packages/@uppy/provider-views/src/ProviderView/Header.tsx @@ -1,7 +1,7 @@ import type { Body, Meta, PartialTreeFolder } from '@uppy/core' import type { I18n } from '@uppy/utils' -import classNames from 'classnames' import type { h } from '@uppy/utils/preact' +import classNames from 'classnames' import Breadcrumbs from '../Breadcrumbs.js' import type ProviderView from './ProviderView.js' import User from './User.js' diff --git a/packages/@uppy/provider-views/src/ProviderView/ProviderView.tsx b/packages/@uppy/provider-views/src/ProviderView/ProviderView.tsx index e765d5e213..5e206b4fc0 100644 --- a/packages/@uppy/provider-views/src/ProviderView/ProviderView.tsx +++ b/packages/@uppy/provider-views/src/ProviderView/ProviderView.tsx @@ -12,9 +12,9 @@ import type { } from '@uppy/core' import type { CompanionFile, I18n } from '@uppy/utils' import { remoteFileObjToLocal } from '@uppy/utils' +import type { h } from '@uppy/utils/preact' import classNames from 'classnames' import debounce from 'lodash/debounce.js' -import type { h } from '@uppy/utils/preact' import packageJson from '../../package.json' with { type: 'json' } import Browser from '../Browser.js' import FilterInput from '../FilterInput.js' diff --git a/packages/@uppy/provider-views/src/SearchProviderView/SearchProviderView.tsx b/packages/@uppy/provider-views/src/SearchProviderView/SearchProviderView.tsx index c7de50ce70..8fd4412ee3 100644 --- a/packages/@uppy/provider-views/src/SearchProviderView/SearchProviderView.tsx +++ b/packages/@uppy/provider-views/src/SearchProviderView/SearchProviderView.tsx @@ -12,8 +12,8 @@ import type { } from '@uppy/core' import type { CompanionFile } from '@uppy/utils' import { remoteFileObjToLocal } from '@uppy/utils' -import classNames from 'classnames' import type { h } from '@uppy/utils/preact' +import classNames from 'classnames' import packageJson from '../../package.json' with { type: 'json' } import Browser from '../Browser.js' import FilterInput from '../FilterInput.js' diff --git a/packages/@uppy/provider-views/src/useSearchForm.ts b/packages/@uppy/provider-views/src/useSearchForm.ts index cc643b3156..2fd036d920 100644 --- a/packages/@uppy/provider-views/src/useSearchForm.ts +++ b/packages/@uppy/provider-views/src/useSearchForm.ts @@ -1,5 +1,5 @@ -import { nanoid } from 'nanoid/non-secure' import { useCallback, useEffect, useState } from '@uppy/utils/preact/hooks' +import { nanoid } from 'nanoid/non-secure' /** * Hook to create a form element outside the component tree to avoid nested forms. diff --git a/packages/@uppy/url/src/UrlUI.tsx b/packages/@uppy/url/src/UrlUI.tsx index 12ba5dc4b8..8a4aebd2df 100644 --- a/packages/@uppy/url/src/UrlUI.tsx +++ b/packages/@uppy/url/src/UrlUI.tsx @@ -1,6 +1,6 @@ import type { I18n } from '@uppy/utils' -import { nanoid } from 'nanoid/non-secure' import { Component, type ComponentChild } from '@uppy/utils/preact' +import { nanoid } from 'nanoid/non-secure' type UrlUIProps = { i18n: I18n diff --git a/packages/@uppy/utils/src/preact/hooks.ts b/packages/@uppy/utils/src/preact/hooks.ts index 1a9d8d6cd6..928a269ff6 100644 --- a/packages/@uppy/utils/src/preact/hooks.ts +++ b/packages/@uppy/utils/src/preact/hooks.ts @@ -1,2 +1 @@ export * from 'preact/hooks' - diff --git a/packages/@uppy/utils/src/preact/index.ts b/packages/@uppy/utils/src/preact/index.ts index 5b435dc109..95ebf48aa8 100644 --- a/packages/@uppy/utils/src/preact/index.ts +++ b/packages/@uppy/utils/src/preact/index.ts @@ -1,2 +1 @@ export * from 'preact' - diff --git a/packages/@uppy/webcam/src/CameraScreen.tsx b/packages/@uppy/webcam/src/CameraScreen.tsx index ce2bd87e8c..826a6de55f 100644 --- a/packages/@uppy/webcam/src/CameraScreen.tsx +++ b/packages/@uppy/webcam/src/CameraScreen.tsx @@ -1,5 +1,9 @@ import type { I18n } from '@uppy/utils' -import { Component, type ComponentChild, type ComponentProps } from '@uppy/utils/preact' +import { + Component, + type ComponentChild, + type ComponentProps, +} from '@uppy/utils/preact' import DiscardButton from './DiscardButton.js' import RecordButton from './RecordButton.js' import RecordingLength from './RecordingLength.js' diff --git a/packages/@uppy/webcam/src/Webcam.tsx b/packages/@uppy/webcam/src/Webcam.tsx index e9c284f5de..7d31398080 100644 --- a/packages/@uppy/webcam/src/Webcam.tsx +++ b/packages/@uppy/webcam/src/Webcam.tsx @@ -10,9 +10,9 @@ import type { import { UIPlugin } from '@uppy/core' import type { LocaleStrings, LocalUppyFileNonGhost } from '@uppy/utils' import { canvasToBlob, getFileTypeExtension, mimeTypes } from '@uppy/utils' -import { isMobile } from 'is-mobile' // biome-ignore lint/style/useImportType: h is not a type import { type ComponentChild, h } from '@uppy/utils/preact' +import { isMobile } from 'is-mobile' import packageJson from '../package.json' with { type: 'json' } import CameraIcon from './CameraIcon.js' import CameraScreen from './CameraScreen.js' From 54579511c139e075da3fdc07b260d93c9d550056 Mon Sep 17 00:00:00 2001 From: Murderlon Date: Tue, 3 Mar 2026 12:19:50 +0100 Subject: [PATCH 3/4] yarn.lock --- yarn.lock | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/yarn.lock b/yarn.lock index 83fe5acda4..87d88c0d30 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9701,7 +9701,6 @@ __metadata: jsdom: "npm:^26.1.0" postcss: "npm:^8.5.6" postcss-cli: "npm:^11.0.1" - preact: "npm:^10.26.10" sass: "npm:^1.89.2" typescript: "npm:^5.8.3" vitest: "npm:^3.2.4" @@ -9737,7 +9736,6 @@ __metadata: "@uppy/core": "workspace:^" "@uppy/provider-views": "workspace:^" "@uppy/utils": "workspace:^" - preact: "npm:^10.26.10" typescript: "npm:^5.8.3" peerDependencies: "@uppy/core": "workspace:^" @@ -9835,12 +9833,12 @@ __metadata: dependencies: "@tailwindcss/cli": "npm:^4.0.6" "@uppy/core": "workspace:^" + "@uppy/utils": "workspace:^" clsx: "npm:^2.1.1" cssnano: "npm:^7.0.7" dequal: "npm:^2.0.3" postcss: "npm:^8.5.6" postcss-cli: "npm:^11.0.1" - preact: "npm:^10.26.10" pretty-bytes: "npm:^6.1.1" tailwindcss: "npm:^4.0.6" typescript: "npm:^5.8.3" @@ -9867,7 +9865,6 @@ __metadata: "@uppy/utils": "workspace:^" compressorjs: "npm:^1.2.1" jsdom: "npm:^26.1.0" - preact: "npm:^10.26.10" promise-queue: "npm:^2.2.5" typescript: "npm:^5.8.3" vitest: "npm:^3.2.4" @@ -9893,7 +9890,6 @@ __metadata: nanoid: "npm:^5.0.9" postcss: "npm:^8.5.6" postcss-cli: "npm:^11.0.1" - preact: "npm:^10.26.10" sass: "npm:^1.89.2" typescript: "npm:^5.8.3" vitest: "npm:^3.2.4" @@ -9922,7 +9918,6 @@ __metadata: playwright: "npm:1.57.0" postcss: "npm:^8.5.6" postcss-cli: "npm:^11.0.1" - preact: "npm:^10.26.10" resize-observer-polyfill: "npm:^1.5.0" sass: "npm:^1.89.2" shallow-equal: "npm:^3.0.0" @@ -9941,7 +9936,6 @@ __metadata: cssnano: "npm:^7.0.7" postcss: "npm:^8.5.6" postcss-cli: "npm:^11.0.1" - preact: "npm:^10.26.10" sass: "npm:^1.89.2" typescript: "npm:^5.8.3" peerDependencies: @@ -9972,7 +9966,6 @@ __metadata: "@uppy/core": "workspace:^" "@uppy/provider-views": "workspace:^" "@uppy/utils": "workspace:^" - preact: "npm:^10.26.10" typescript: "npm:^5.8.3" peerDependencies: "@uppy/core": "workspace:^" @@ -9987,7 +9980,6 @@ __metadata: "@uppy/core": "workspace:^" "@uppy/provider-views": "workspace:^" "@uppy/utils": "workspace:^" - preact: "npm:^10.26.10" typescript: "npm:^5.8.3" peerDependencies: "@uppy/core": "workspace:^" @@ -10031,7 +10023,6 @@ __metadata: "@uppy/core": "workspace:^" "@uppy/provider-views": "workspace:^" "@uppy/utils": "workspace:^" - preact: "npm:^10.26.10" typescript: "npm:^5.8.3" peerDependencies: "@uppy/core": "workspace:^" @@ -10046,7 +10037,6 @@ __metadata: "@uppy/core": "workspace:^" "@uppy/provider-views": "workspace:^" "@uppy/utils": "workspace:^" - preact: "npm:^10.26.10" typescript: "npm:^5.8.3" peerDependencies: "@uppy/core": "workspace:^" @@ -10061,7 +10051,6 @@ __metadata: "@uppy/core": "workspace:^" "@uppy/provider-views": "workspace:^" "@uppy/utils": "workspace:^" - preact: "npm:^10.26.10" typescript: "npm:^5.8.3" peerDependencies: "@uppy/core": "workspace:^" @@ -10077,7 +10066,6 @@ __metadata: cssnano: "npm:^7.0.7" postcss: "npm:^8.5.6" postcss-cli: "npm:^11.0.1" - preact: "npm:^10.26.10" sass: "npm:^1.89.2" typescript: "npm:^5.8.3" peerDependencies: @@ -10096,7 +10084,6 @@ __metadata: cssnano: "npm:^7.0.7" postcss: "npm:^8.5.6" postcss-cli: "npm:^11.0.1" - preact: "npm:^10.26.10" sass: "npm:^1.89.2" peerDependencies: "@uppy/core": "workspace:^" @@ -10111,7 +10098,6 @@ __metadata: "@uppy/core": "workspace:^" "@uppy/provider-views": "workspace:^" "@uppy/utils": "workspace:^" - preact: "npm:^10.26.10" typescript: "npm:^5.8.3" peerDependencies: "@uppy/core": "workspace:^" @@ -10138,7 +10124,6 @@ __metadata: "@uppy/core": "workspace:^" "@uppy/provider-views": "workspace:^" "@uppy/utils": "workspace:^" - preact: "npm:^10.26.10" typescript: "npm:^5.8.3" peerDependencies: "@uppy/core": "workspace:^" @@ -10161,7 +10146,6 @@ __metadata: p-queue: "npm:^8.0.0" postcss: "npm:^8.5.6" postcss-cli: "npm:^11.0.1" - preact: "npm:^10.26.10" sass: "npm:^1.89.2" typescript: "npm:^5.8.3" vitest: "npm:^3.2.4" @@ -10181,8 +10165,8 @@ __metadata: "@types/use-sync-external-store": "npm:^0.0.6" "@uppy/components": "workspace:^" "@uppy/core": "workspace:^" + "@uppy/utils": "workspace:^" jsdom: "npm:^26.1.0" - preact: "npm:^10.26.10" react: "npm:^18.2.0" react-dom: "npm:^18.2.0" typescript: "npm:^5.8.3" @@ -10240,7 +10224,6 @@ __metadata: cssnano: "npm:^7.0.7" postcss: "npm:^8.5.6" postcss-cli: "npm:^11.0.1" - preact: "npm:^10.26.10" sass: "npm:^1.89.2" typescript: "npm:^5.8.3" peerDependencies: @@ -10258,7 +10241,6 @@ __metadata: cssnano: "npm:^7.0.7" postcss: "npm:^8.5.6" postcss-cli: "npm:^11.0.1" - preact: "npm:^10.26.10" sass: "npm:^1.89.2" typescript: "npm:^5.8.3" peerDependencies: @@ -10286,7 +10268,7 @@ __metadata: "@sveltejs/vite-plugin-svelte": "npm:^5.0.3" "@uppy/components": "workspace:^" "@uppy/core": "workspace:^" - preact: "npm:^10.26.10" + "@uppy/utils": "workspace:^" svelte: "npm:^5.27.0" svelte-check: "npm:^4.1.6" tslib: "npm:^2.8.1" @@ -10369,7 +10351,6 @@ __metadata: "@uppy/core": "workspace:^" "@uppy/provider-views": "workspace:^" "@uppy/utils": "workspace:^" - preact: "npm:^10.26.10" typescript: "npm:^5.8.3" peerDependencies: "@uppy/core": "workspace:^" @@ -10389,7 +10370,6 @@ __metadata: playwright: "npm:1.57.0" postcss: "npm:^8.5.6" postcss-cli: "npm:^11.0.1" - preact: "npm:^10.26.10" sass: "npm:^1.89.2" typescript: "npm:^5.8.3" vitest: "npm:^3.2.4" @@ -10417,7 +10397,7 @@ __metadata: dependencies: "@uppy/components": "workspace:^" "@uppy/core": "workspace:^" - preact: "npm:^10.26.10" + "@uppy/utils": "workspace:^" shallow-equal: "npm:^3.0.0" typescript: "npm:^5.8.3" vue: "npm:^3.5.14" @@ -10450,7 +10430,6 @@ __metadata: jsdom: "npm:^26.1.0" postcss: "npm:^8.5.6" postcss-cli: "npm:^11.0.1" - preact: "npm:^10.26.10" sass: "npm:^1.89.2" typescript: "npm:^5.8.3" vitest: "npm:^3.2.4" @@ -10467,7 +10446,6 @@ __metadata: "@uppy/core": "workspace:^" "@uppy/provider-views": "workspace:^" "@uppy/utils": "workspace:^" - preact: "npm:^10.26.10" typescript: "npm:^5.8.3" peerDependencies: "@uppy/core": "workspace:^" @@ -10502,7 +10480,6 @@ __metadata: "@uppy/core": "workspace:^" "@uppy/provider-views": "workspace:^" "@uppy/utils": "workspace:^" - preact: "npm:^10.26.10" typescript: "npm:^5.8.3" peerDependencies: "@uppy/core": "workspace:^" From b3dcbeeb8be5ff121f5426e263d403f14df8b174 Mon Sep 17 00:00:00 2001 From: Murderlon Date: Fri, 13 Mar 2026 10:34:20 +0100 Subject: [PATCH 4/4] changeset --- .changeset/bumpy-breads-kiss.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .changeset/bumpy-breads-kiss.md diff --git a/.changeset/bumpy-breads-kiss.md b/.changeset/bumpy-breads-kiss.md new file mode 100644 index 0000000000..10144f44ab --- /dev/null +++ b/.changeset/bumpy-breads-kiss.md @@ -0,0 +1,32 @@ +--- +"@uppy/google-photos-picker": minor +"@uppy/google-drive-picker": minor +"@uppy/image-generator": minor +"@uppy/provider-views": minor +"@uppy/screen-capture": minor +"@uppy/google-drive": minor +"@uppy/image-editor": minor +"@uppy/components": minor +"@uppy/compressor": minor +"@uppy/status-bar": minor +"@uppy/dashboard": minor +"@uppy/drag-drop": minor +"@uppy/instagram": minor +"@uppy/facebook": minor +"@uppy/onedrive": minor +"@uppy/unsplash": minor +"@uppy/dropbox": minor +"@uppy/svelte": minor +"@uppy/webcam": minor +"@uppy/webdav": minor +"@uppy/audio": minor +"@uppy/react": minor +"@uppy/utils": minor +"@uppy/core": minor +"@uppy/zoom": minor +"@uppy/box": minor +"@uppy/url": minor +"@uppy/vue": minor +--- + +Import Preact from @uppy/utils to guarantee a single version across packages