diff --git a/android/capacitor.settings.gradle b/android/capacitor.settings.gradle index 23805efdee..29d60ba2d7 100644 --- a/android/capacitor.settings.gradle +++ b/android/capacitor.settings.gradle @@ -51,7 +51,7 @@ include ':capacitor-reader' project(':capacitor-reader').projectDir = new File('../node_modules/.pnpm/capacitor-reader@0.3.1_@capacitor+core@6.2.0/node_modules/capacitor-reader/android') include ':capacitor-stash-media' -project(':capacitor-stash-media').projectDir = new File('../node_modules/.pnpm/capacitor-stash-media@2.1.1_@capacitor+core@6.2.0/node_modules/capacitor-stash-media/android') +project(':capacitor-stash-media').projectDir = new File('../node_modules/.pnpm/capacitor-stash-media@2.2.0_@capacitor+core@6.2.0/node_modules/capacitor-stash-media/android') include ':capacitor-tips' project(':capacitor-tips').projectDir = new File('../node_modules/.pnpm/capacitor-tips@1.1.1_@capacitor+core@6.2.0/node_modules/capacitor-tips/android') diff --git a/ios/App/Podfile b/ios/App/Podfile index d902ae93ca..fa4b0c144f 100644 --- a/ios/App/Podfile +++ b/ios/App/Podfile @@ -27,7 +27,7 @@ def capacitor_pods pod 'CapacitorLaunchNative', :path => '../../node_modules/.pnpm/capacitor-launch-native@1.1.1_@capacitor+core@6.2.0/node_modules/capacitor-launch-native' pod 'CapacitorPluginSafeArea', :path => '../../node_modules/.pnpm/capacitor-plugin-safe-area@3.0.4_@capacitor+core@6.2.0/node_modules/capacitor-plugin-safe-area' pod 'CapacitorReader', :path => '../../node_modules/.pnpm/capacitor-reader@0.3.1_@capacitor+core@6.2.0/node_modules/capacitor-reader' - pod 'CapacitorStashMedia', :path => '../../node_modules/.pnpm/capacitor-stash-media@2.1.1_@capacitor+core@6.2.0/node_modules/capacitor-stash-media' + pod 'CapacitorStashMedia', :path => '../../node_modules/.pnpm/capacitor-stash-media@2.2.0_@capacitor+core@6.2.0/node_modules/capacitor-stash-media' pod 'CapacitorTips', :path => '../../node_modules/.pnpm/capacitor-tips@1.1.1_@capacitor+core@6.2.0/node_modules/capacitor-tips' end diff --git a/ios/App/Podfile.lock b/ios/App/Podfile.lock index 167e65a999..8589657b41 100644 --- a/ios/App/Podfile.lock +++ b/ios/App/Podfile.lock @@ -32,7 +32,7 @@ PODS: - Capacitor - CapacitorSplashScreen (6.0.3): - Capacitor - - CapacitorStashMedia (2.1.1): + - CapacitorStashMedia (2.2.0): - Capacitor - SDWebImage - CapacitorStatusBar (6.0.2): @@ -61,7 +61,7 @@ DEPENDENCIES: - "CapacitorReader (from `../../node_modules/.pnpm/capacitor-reader@0.3.1_@capacitor+core@6.2.0/node_modules/capacitor-reader`)" - "CapacitorShare (from `../../node_modules/.pnpm/@capacitor+share@6.0.3_@capacitor+core@6.2.0/node_modules/@capacitor/share`)" - "CapacitorSplashScreen (from `../../node_modules/.pnpm/@capacitor+splash-screen@6.0.3_@capacitor+core@6.2.0/node_modules/@capacitor/splash-screen`)" - - "CapacitorStashMedia (from `../../node_modules/.pnpm/capacitor-stash-media@2.1.1_@capacitor+core@6.2.0/node_modules/capacitor-stash-media`)" + - "CapacitorStashMedia (from `../../node_modules/.pnpm/capacitor-stash-media@2.2.0_@capacitor+core@6.2.0/node_modules/capacitor-stash-media`)" - "CapacitorStatusBar (from `../../node_modules/.pnpm/@capacitor+status-bar@6.0.2_@capacitor+core@6.2.0/node_modules/@capacitor/status-bar`)" - "CapacitorTips (from `../../node_modules/.pnpm/capacitor-tips@1.1.1_@capacitor+core@6.2.0/node_modules/capacitor-tips`)" @@ -105,7 +105,7 @@ EXTERNAL SOURCES: CapacitorSplashScreen: :path: "../../node_modules/.pnpm/@capacitor+splash-screen@6.0.3_@capacitor+core@6.2.0/node_modules/@capacitor/splash-screen" CapacitorStashMedia: - :path: "../../node_modules/.pnpm/capacitor-stash-media@2.1.1_@capacitor+core@6.2.0/node_modules/capacitor-stash-media" + :path: "../../node_modules/.pnpm/capacitor-stash-media@2.2.0_@capacitor+core@6.2.0/node_modules/capacitor-stash-media" CapacitorStatusBar: :path: "../../node_modules/.pnpm/@capacitor+status-bar@6.0.2_@capacitor+core@6.2.0/node_modules/@capacitor/status-bar" CapacitorTips: @@ -129,11 +129,11 @@ SPEC CHECKSUMS: CapacitorReader: a40128af9e1db017df748ab1c186870aee0bd5bf CapacitorShare: 7af6ca761ce62030e8e9fbd2eb82416f5ceced38 CapacitorSplashScreen: 68893659d77b5f82d753b3a70475082845e3039c - CapacitorStashMedia: dc7a9876e725540001f5239cc36c15ee6cb9e061 + CapacitorStashMedia: 2ed9a543c8a0471b42067a97d9e62cd90d1a99f7 CapacitorStatusBar: 3b9ac7d0684770522c532d1158a1434512ab1477 CapacitorTips: 606fd67dfdbc7d74a3568da580b3ad019fd4501b SDWebImage: 73c6079366fea25fa4bb9640d5fb58f0893facd8 -PODFILE CHECKSUM: 058d6f9b1cb40aa045ace40485f53af22aff164a +PODFILE CHECKSUM: 68200e74145345ce78359b45d8b32a893ec856d6 COCOAPODS: 1.16.2 diff --git a/package.json b/package.json index e5a12e2865..7cb5ef2131 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "capacitor-launch-native": "^1.1.1", "capacitor-plugin-safe-area": "^3.0.4", "capacitor-reader": "^0.3.1", - "capacitor-stash-media": "^2.1.1", + "capacitor-stash-media": "^2.2.0", "capacitor-tips": "^1.1.1", "colorjs.io": "^0.5.2", "compare-versions": "^6.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7006e4214d..dd92b527c8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -101,8 +101,8 @@ importers: specifier: ^0.3.1 version: 0.3.1(@capacitor/core@6.2.0) capacitor-stash-media: - specifier: ^2.1.1 - version: 2.1.1(@capacitor/core@6.2.0) + specifier: ^2.2.0 + version: 2.2.0(@capacitor/core@6.2.0) capacitor-tips: specifier: ^1.1.1 version: 1.1.1(@capacitor/core@6.2.0) @@ -2408,8 +2408,8 @@ packages: peerDependencies: '@capacitor/core': ^6.0.0 - capacitor-stash-media@2.1.1: - resolution: {integrity: sha512-JwGIvgG10RMdmiwvv6hX9fLlxrxHirZMnbHQOG0EbUjG7dnQh1ItE1LJ52q3KWVOgL33+nrPvUVUAUuguqKi8Q==} + capacitor-stash-media@2.2.0: + resolution: {integrity: sha512-lOS1dM87CmDCmpr814m9Wgjg451Y4x4u3lJUxmWHiHOccu96wRAwJ7uXeNzFG9bxqF9ETEY6RCSLM35yYFX6aA==} peerDependencies: '@capacitor/core': ^6.0.0 @@ -9071,7 +9071,7 @@ snapshots: dependencies: '@capacitor/core': 6.2.0 - capacitor-stash-media@2.1.1(@capacitor/core@6.2.0): + capacitor-stash-media@2.2.0(@capacitor/core@6.2.0): dependencies: '@capacitor/core': 6.2.0 diff --git a/src/features/icons/index.ts b/src/features/icons/index.ts index 8aab7a15d8..1616f6da44 100644 --- a/src/features/icons/index.ts +++ b/src/features/icons/index.ts @@ -18,3 +18,6 @@ export { default as superscript } from "./svg/superscript.svg"; export { default as subscript } from "./svg/subscript.svg"; export { default as strikethrough } from "./svg/strikethrough.svg"; export { default as trashEllipse } from "./svg/trashEllipse.svg"; +export { default as pip } from "./svg/pip.svg"; +export { default as forward } from "./svg/forward.svg"; +export { default as back } from "./svg/back.svg"; diff --git a/src/features/icons/svg/back.svg b/src/features/icons/svg/back.svg new file mode 100644 index 0000000000..9413dd3013 --- /dev/null +++ b/src/features/icons/svg/back.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/features/icons/svg/forward.svg b/src/features/icons/svg/forward.svg new file mode 100644 index 0000000000..fac211321f --- /dev/null +++ b/src/features/icons/svg/forward.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/features/icons/svg/pip.svg b/src/features/icons/svg/pip.svg new file mode 100644 index 0000000000..343a5512f7 --- /dev/null +++ b/src/features/icons/svg/pip.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/features/media/InlineMedia.tsx b/src/features/media/InlineMedia.tsx index 9c72624326..a8af1139dd 100644 --- a/src/features/media/InlineMedia.tsx +++ b/src/features/media/InlineMedia.tsx @@ -1,9 +1,9 @@ import { CSSProperties } from "react"; -import Media, { MediaProps } from "#/features/media/Media"; import { cx } from "#/helpers/css"; import { useAppDispatch } from "#/store"; +import GalleryMedia, { GalleryMediaProps } from "./gallery/GalleryMedia"; import { IMAGE_FAILED, imageFailed, imageLoaded } from "./imageSlice"; import MediaPlaceholder from "./MediaPlaceholder"; import { isLoadedAspectRatio } from "./useAspectRatio"; @@ -13,7 +13,7 @@ import useMediaLoadObserver, { import mediaPlaceholderStyles from "./MediaPlaceholder.module.css"; -export type InlineMediaProps = Omit & { +export type InlineMediaProps = Omit & { defaultAspectRatio?: number; mediaClassName?: string; }; @@ -49,12 +49,12 @@ export default function InlineMedia({ state={buildPlaceholderState()} defaultAspectRatio={defaultAspectRatio} > - } onError={() => { if (src) dispatch(imageFailed(src)); }} diff --git a/src/features/media/Media.tsx b/src/features/media/Media.tsx deleted file mode 100644 index 2613226bb3..0000000000 --- a/src/features/media/Media.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import { ComponentProps, ComponentRef } from "react"; - -import Video, { VideoProps } from "#/features/media/video/Video"; -import { isUrlVideo } from "#/helpers/url"; - -import GalleryMedia, { GalleryMediaProps } from "./gallery/GalleryMedia"; - -export interface MediaProps - extends Omit { - src: string; - - ref?: React.RefObject< - ComponentRef | ComponentRef - >; -} - -export default function Media({ - nativeControls, - src, - shouldPortal, - animationType, - volume, - progress, - ...props -}: MediaProps) { - const isVideo = src && isUrlVideo(src, props.post?.post.url_content_type); - - if (isVideo) - return ( -