Compare commits
24
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
19647fb45b | ||
|
|
7f0c36a33a | ||
|
|
809eda2d6f | ||
|
|
c78524a609 | ||
|
|
2e4bfc3a5b | ||
|
|
e65775319e | ||
|
|
4ee47fdddd | ||
|
|
9494ef9a26 | ||
|
|
270af912d4 | ||
|
|
efd2ed754c | ||
|
|
23dc03832f | ||
|
|
6730ad7cbb | ||
|
|
8fb9fced35 | ||
|
|
b5f11c4efe | ||
|
|
cec414d11b | ||
|
|
ed56490f93 | ||
|
|
5ca7e35ba9 | ||
|
|
144c8afb0c | ||
|
|
c892b985e2 | ||
|
|
14834723c9 | ||
|
|
1d18b3db1a | ||
|
|
95c39b4648 | ||
|
|
44f2d0d679 | ||
|
|
1a63aa045e |
@@ -1,6 +1,6 @@
|
||||
# Maintainer: Stirling PDF Inc <contact@stirlingpdf.com>
|
||||
pkgname=stirling-pdf-desktop
|
||||
pkgver=2.10.0
|
||||
pkgver=2.10.1
|
||||
pkgrel=1
|
||||
pkgdesc="Locally hosted, web-based PDF manipulation tool (Tauri desktop app, official Stirling PDF Inc build)"
|
||||
arch=('x86_64')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Maintainer: Stirling PDF Inc <contact@stirlingpdf.com>
|
||||
pkgname=stirling-pdf-server-bin
|
||||
pkgver=2.10.0
|
||||
pkgver=2.10.1
|
||||
pkgrel=1
|
||||
pkgdesc="Locally hosted, web-based PDF manipulation tool (server JAR, prebuilt)"
|
||||
arch=('any')
|
||||
|
||||
@@ -93,18 +93,18 @@ jobs:
|
||||
echo 'matrix={"include":[{"platform":"windows-latest","args":"--target x86_64-pc-windows-msvc","name":"windows-x86_64"}]}' >> $GITHUB_OUTPUT
|
||||
;;
|
||||
"macos")
|
||||
echo 'matrix={"include":[{"platform":"macos-15","args":"--target aarch64-apple-darwin","name":"macos-aarch64"},{"platform":"macos-15-intel","args":"--target x86_64-apple-darwin","name":"macos-x86_64"}]}' >> $GITHUB_OUTPUT
|
||||
echo 'matrix={"include":[{"platform":"macos-15","args":"--target universal-apple-darwin","name":"macos-universal"}]}' >> $GITHUB_OUTPUT
|
||||
;;
|
||||
"linux")
|
||||
echo 'matrix={"include":[{"platform":"ubuntu-22.04","args":"","name":"linux-x86_64"}]}' >> $GITHUB_OUTPUT
|
||||
;;
|
||||
*)
|
||||
echo 'matrix={"include":[{"platform":"windows-latest","args":"--target x86_64-pc-windows-msvc","name":"windows-x86_64"},{"platform":"macos-15","args":"--target aarch64-apple-darwin","name":"macos-aarch64"},{"platform":"macos-15-intel","args":"--target x86_64-apple-darwin","name":"macos-x86_64"},{"platform":"ubuntu-22.04","args":"","name":"linux-x86_64"}]}' >> $GITHUB_OUTPUT
|
||||
echo 'matrix={"include":[{"platform":"windows-latest","args":"--target x86_64-pc-windows-msvc","name":"windows-x86_64"},{"platform":"macos-15","args":"--target universal-apple-darwin","name":"macos-universal"},{"platform":"ubuntu-22.04","args":"","name":"linux-x86_64"}]}' >> $GITHUB_OUTPUT
|
||||
;;
|
||||
esac
|
||||
else
|
||||
# For push/release events, build all platforms
|
||||
echo 'matrix={"include":[{"platform":"windows-latest","args":"--target x86_64-pc-windows-msvc","name":"windows-x86_64"},{"platform":"macos-15","args":"--target aarch64-apple-darwin","name":"macos-aarch64"},{"platform":"macos-15-intel","args":"--target x86_64-apple-darwin","name":"macos-x86_64"},{"platform":"ubuntu-22.04","args":"","name":"linux-x86_64"}]}' >> $GITHUB_OUTPUT
|
||||
echo 'matrix={"include":[{"platform":"windows-latest","args":"--target x86_64-pc-windows-msvc","name":"windows-x86_64"},{"platform":"macos-15","args":"--target universal-apple-darwin","name":"macos-universal"},{"platform":"ubuntu-22.04","args":"","name":"linux-x86_64"}]}' >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
build-jars:
|
||||
@@ -218,7 +218,23 @@ jobs:
|
||||
uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
|
||||
with:
|
||||
toolchain: stable
|
||||
targets: ${{ (matrix.platform == 'macos-15' || matrix.platform == 'macos-15-intel') && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
|
||||
targets: ${{ matrix.platform == 'macos-15' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
|
||||
|
||||
# x86_64 JDK is set up first so the aarch64 step below can leave its
|
||||
# JAVA_HOME as the active one. The macOS universal JRE build needs
|
||||
# jmods from both arches; the x64 path is captured into the env
|
||||
# before the second setup-java overwrites JAVA_HOME.
|
||||
- name: Set up x86_64 JDK 25 (macOS universal JRE)
|
||||
if: matrix.platform == 'macos-15'
|
||||
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
|
||||
with:
|
||||
java-version: "25"
|
||||
distribution: "temurin"
|
||||
architecture: "x64"
|
||||
|
||||
- name: Capture x86_64 JAVA_HOME
|
||||
if: matrix.platform == 'macos-15'
|
||||
run: echo "X64_JAVA_HOME=$JAVA_HOME" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Set up JDK 25
|
||||
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
|
||||
@@ -234,6 +250,14 @@ jobs:
|
||||
- name: Install Task
|
||||
uses: go-task/setup-task@3be4020d41929789a01026e0e427a4321ce0ad44 # v2.0.0
|
||||
|
||||
# Build the universal JRE before desktop:prepare so the jlink:runtime
|
||||
# task short-circuits on its `test -d runtime/jre` status check.
|
||||
- name: Build universal macOS JRE
|
||||
if: matrix.platform == 'macos-15'
|
||||
env:
|
||||
AARCH64_JAVA_HOME: ${{ env.JAVA_HOME }}
|
||||
run: task desktop:jlink:universal-mac
|
||||
|
||||
- name: Prepare desktop build
|
||||
run: task desktop:prepare
|
||||
env:
|
||||
@@ -321,7 +345,7 @@ jobs:
|
||||
}
|
||||
|
||||
- name: Import Apple Developer Certificate
|
||||
if: (matrix.platform == 'macos-15' || matrix.platform == 'macos-15-intel') && (github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.sign != 'false') || github.ref == 'refs/heads/V2-master')
|
||||
if: matrix.platform == 'macos-15' && (github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.sign != 'false') || github.ref == 'refs/heads/V2-master')
|
||||
env:
|
||||
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
|
||||
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||
@@ -342,7 +366,7 @@ jobs:
|
||||
rm certificate.p12
|
||||
|
||||
- name: Verify Certificate
|
||||
if: (matrix.platform == 'macos-15' || matrix.platform == 'macos-15-intel') && (github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.sign != 'false') || github.ref == 'refs/heads/V2-master')
|
||||
if: matrix.platform == 'macos-15' && (github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.sign != 'false') || github.ref == 'refs/heads/V2-master')
|
||||
run: |
|
||||
echo "Verifying Apple Developer Certificate..."
|
||||
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
|
||||
@@ -557,7 +581,7 @@ jobs:
|
||||
# Only ship the MSI installer on Windows. The loose exe and WiX toolset exes
|
||||
# are not the user-facing installer - the MSI contains the signed inner exe.
|
||||
find . -name "*.msi" -exec cp {} "../../../dist/Stirling-PDF-${{ matrix.name }}.msi" \;
|
||||
elif [ "${{ matrix.platform }}" = "macos-15" ] || [ "${{ matrix.platform }}" = "macos-15-intel" ]; then
|
||||
elif [ "${{ matrix.platform }}" = "macos-15" ]; then
|
||||
find . -name "*.dmg" -exec cp {} "../../../dist/Stirling-PDF-${{ matrix.name }}.dmg" \;
|
||||
find . -name "*.app" -exec cp -r {} "../../../dist/Stirling-PDF-${{ matrix.name }}.app" \;
|
||||
else
|
||||
|
||||
@@ -22,8 +22,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.info.outputs.version }}
|
||||
dmg_arm64_sha256: ${{ steps.hashes.outputs.dmg_arm64_sha256 }}
|
||||
dmg_x86_64_sha256: ${{ steps.hashes.outputs.dmg_x86_64_sha256 }}
|
||||
dmg_sha256: ${{ steps.hashes.outputs.dmg_sha256 }}
|
||||
msi_sha256: ${{ steps.hashes.outputs.msi_sha256 }}
|
||||
deb_sha256: ${{ steps.hashes.outputs.deb_sha256 }}
|
||||
jar_sha256: ${{ steps.hashes.outputs.jar_sha256 }}
|
||||
@@ -63,17 +62,15 @@ jobs:
|
||||
sha256sum "$file" | awk '{print $1}'
|
||||
}
|
||||
|
||||
DMG_ARM64_SHA=$(download_sha256 "${BASE}/Stirling-PDF-macos-aarch64.dmg")
|
||||
DMG_X64_SHA=$(download_sha256 "${BASE}/Stirling-PDF-macos-x86_64.dmg")
|
||||
DMG_SHA=$(download_sha256 "${BASE}/Stirling-PDF-macos-universal.dmg")
|
||||
MSI_SHA=$(download_sha256 "${BASE}/Stirling-PDF-windows-x86_64.msi")
|
||||
DEB_SHA=$(download_sha256 "${BASE}/Stirling-PDF-linux-x86_64.deb")
|
||||
JAR_SHA=$(download_sha256 "${BASE}/Stirling-PDF-with-login.jar")
|
||||
|
||||
echo "dmg_arm64_sha256=$DMG_ARM64_SHA" >> "$GITHUB_OUTPUT"
|
||||
echo "dmg_x86_64_sha256=$DMG_X64_SHA" >> "$GITHUB_OUTPUT"
|
||||
echo "msi_sha256=$MSI_SHA" >> "$GITHUB_OUTPUT"
|
||||
echo "deb_sha256=$DEB_SHA" >> "$GITHUB_OUTPUT"
|
||||
echo "jar_sha256=$JAR_SHA" >> "$GITHUB_OUTPUT"
|
||||
echo "dmg_sha256=$DMG_SHA" >> "$GITHUB_OUTPUT"
|
||||
echo "msi_sha256=$MSI_SHA" >> "$GITHUB_OUTPUT"
|
||||
echo "deb_sha256=$DEB_SHA" >> "$GITHUB_OUTPUT"
|
||||
echo "jar_sha256=$JAR_SHA" >> "$GITHUB_OUTPUT"
|
||||
|
||||
update-homebrew-and-scoop:
|
||||
needs: get-release-info
|
||||
@@ -93,22 +90,21 @@ jobs:
|
||||
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
|
||||
path: tap
|
||||
|
||||
# Stirling-PDF now ships a single universal DMG, so the Cask should
|
||||
# have one sha256 line rather than separate on_arm/on_intel blocks.
|
||||
# We rewrite every `sha256 "..."` in the Cask to the same value so
|
||||
# the workflow keeps working through the Cask migration: pre-migration
|
||||
# both arch blocks get the universal SHA (still correct, since both
|
||||
# would resolve to the same DMG), post-migration the lone sha256 line
|
||||
# is updated.
|
||||
- name: Update Homebrew cask (Casks/stirling-pdf.rb)
|
||||
env:
|
||||
VERSION: ${{ needs.get-release-info.outputs.version }}
|
||||
ARM64_SHA: ${{ needs.get-release-info.outputs.dmg_arm64_sha256 }}
|
||||
X64_SHA: ${{ needs.get-release-info.outputs.dmg_x86_64_sha256 }}
|
||||
DMG_SHA: ${{ needs.get-release-info.outputs.dmg_sha256 }}
|
||||
run: |
|
||||
CASK="tap/Casks/stirling-pdf.rb"
|
||||
sed -i "s/version \".*\"/version \"${VERSION}\"/" "$CASK"
|
||||
awk -v arm="$ARM64_SHA" -v x64="$X64_SHA" '
|
||||
/on_arm/ { in_arm=1 }
|
||||
/on_intel/ { in_arm=0; in_intel=1 }
|
||||
/end/ { in_arm=0; in_intel=0 }
|
||||
in_arm && /sha256/ { sub(/sha256 ".*"/, "sha256 \"" arm "\"") }
|
||||
in_intel && /sha256/ { sub(/sha256 ".*"/, "sha256 \"" x64 "\"") }
|
||||
{ print }
|
||||
' "$CASK" > tmp && mv tmp "$CASK"
|
||||
sed -i "s/version \"[^\"]*\"/version \"${VERSION}\"/" "$CASK"
|
||||
sed -i "s/sha256 \"[^\"]*\"/sha256 \"${DMG_SHA}\"/g" "$CASK"
|
||||
|
||||
- name: Update Homebrew formula (Formula/stirling-pdf-server.rb)
|
||||
env:
|
||||
@@ -116,8 +112,8 @@ jobs:
|
||||
JAR_SHA: ${{ needs.get-release-info.outputs.jar_sha256 }}
|
||||
run: |
|
||||
FORMULA="tap/Formula/stirling-pdf-server.rb"
|
||||
sed -i "s/version \".*\"/version \"${VERSION}\"/" "$FORMULA"
|
||||
sed -i "s/sha256 \".*\"/sha256 \"${JAR_SHA}\"/" "$FORMULA"
|
||||
sed -i "s/version \"[^\"]*\"/version \"${VERSION}\"/" "$FORMULA"
|
||||
sed -i "s/sha256 \"[^\"]*\"/sha256 \"${JAR_SHA}\"/" "$FORMULA"
|
||||
|
||||
- name: Update Scoop stirling-pdf.json
|
||||
env:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: Build Tauri Applications
|
||||
|
||||
# Multi-OS Tauri desktop bundle build matrix (Windows / macOS arm+intel /
|
||||
# Multi-OS Tauri desktop bundle build matrix (Windows / macOS universal /
|
||||
# Linux). Called from build.yml on PRs that touch desktop sources (gated
|
||||
# via the `tauri` filter in .github/config/.files.yaml). Also runnable
|
||||
# on demand via workflow_dispatch with a per-platform selector.
|
||||
@@ -48,17 +48,16 @@ jobs:
|
||||
PLATFORM: ${{ inputs.platform }}
|
||||
run: |
|
||||
WINDOWS='{"platform":"windows-latest","args":"--target x86_64-pc-windows-msvc","name":"windows-x86_64"}'
|
||||
MACOS_ARM='{"platform":"macos-15","args":"--target aarch64-apple-darwin","name":"macos-aarch64"}'
|
||||
MACOS_INTEL='{"platform":"macos-15-intel","args":"--target x86_64-apple-darwin","name":"macos-x86_64"}'
|
||||
MACOS='{"platform":"macos-15","args":"--target universal-apple-darwin","name":"macos-universal"}'
|
||||
LINUX='{"platform":"ubuntu-22.04","args":"","name":"linux-x86_64"}'
|
||||
|
||||
# Resolve requested platform — populated by either workflow_dispatch
|
||||
# or workflow_call inputs; both paths default to "all".
|
||||
case "$PLATFORM" in
|
||||
windows) ENTRIES=("$WINDOWS") ;;
|
||||
macos) ENTRIES=("$MACOS_ARM" "$MACOS_INTEL") ;;
|
||||
macos) ENTRIES=("$MACOS") ;;
|
||||
linux) ENTRIES=("$LINUX") ;;
|
||||
*) ENTRIES=("$WINDOWS" "$MACOS_ARM" "$MACOS_INTEL" "$LINUX") ;;
|
||||
*) ENTRIES=("$WINDOWS" "$MACOS" "$LINUX") ;;
|
||||
esac
|
||||
|
||||
# Drop macOS entries when Apple certificate secret is unavailable
|
||||
@@ -111,7 +110,23 @@ jobs:
|
||||
uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
|
||||
with:
|
||||
toolchain: stable
|
||||
targets: ${{ (matrix.platform == 'macos-15' || matrix.platform == 'macos-15-intel') && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
|
||||
targets: ${{ matrix.platform == 'macos-15' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
|
||||
|
||||
# x86_64 JDK is set up first so the aarch64 step below can leave its
|
||||
# JAVA_HOME as the active one. The macOS universal JRE build needs
|
||||
# jmods from both arches; the x64 path is captured into the env
|
||||
# before the second setup-java overwrites JAVA_HOME.
|
||||
- name: Set up x86_64 JDK 25 (macOS universal JRE)
|
||||
if: matrix.platform == 'macos-15'
|
||||
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
|
||||
with:
|
||||
java-version: "25"
|
||||
distribution: "temurin"
|
||||
architecture: "x64"
|
||||
|
||||
- name: Capture x86_64 JAVA_HOME
|
||||
if: matrix.platform == 'macos-15'
|
||||
run: echo "X64_JAVA_HOME=$JAVA_HOME" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Set up JDK 25
|
||||
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
|
||||
@@ -126,6 +141,15 @@ jobs:
|
||||
|
||||
- name: Setup Task
|
||||
uses: go-task/setup-task@3be4020d41929789a01026e0e427a4321ce0ad44 # v2.0.0
|
||||
|
||||
# Build the universal JRE before desktop:prepare so the jlink:runtime
|
||||
# task short-circuits on its `test -d runtime/jre` status check.
|
||||
- name: Build universal macOS JRE
|
||||
if: matrix.platform == 'macos-15'
|
||||
env:
|
||||
AARCH64_JAVA_HOME: ${{ env.JAVA_HOME }}
|
||||
run: task desktop:jlink:universal-mac
|
||||
|
||||
- name: Prepare desktop build
|
||||
run: task desktop:prepare
|
||||
env:
|
||||
@@ -213,7 +237,7 @@ jobs:
|
||||
}
|
||||
|
||||
- name: Import Apple Developer Certificate
|
||||
if: (matrix.platform == 'macos-15' || matrix.platform == 'macos-15-intel') && env.APPLE_CERTIFICATE != ''
|
||||
if: matrix.platform == 'macos-15' && env.APPLE_CERTIFICATE != ''
|
||||
env:
|
||||
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
|
||||
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||
@@ -234,7 +258,7 @@ jobs:
|
||||
rm certificate.p12
|
||||
|
||||
- name: Verify Certificate
|
||||
if: (matrix.platform == 'macos-15' || matrix.platform == 'macos-15-intel') && env.APPLE_CERTIFICATE != ''
|
||||
if: matrix.platform == 'macos-15' && env.APPLE_CERTIFICATE != ''
|
||||
run: |
|
||||
echo "Verifying Apple Developer Certificate..."
|
||||
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
|
||||
@@ -246,7 +270,7 @@ jobs:
|
||||
echo "Certificate imported successfully."
|
||||
|
||||
- name: Check DMG creation dependencies (macOS only)
|
||||
if: matrix.platform == 'macos-15' || matrix.platform == 'macos-15-intel'
|
||||
if: matrix.platform == 'macos-15'
|
||||
run: |
|
||||
echo "🔍 Checking DMG creation dependencies on ${{ matrix.platform }}..."
|
||||
echo "hdiutil version: $(hdiutil --version || echo 'NOT FOUND')"
|
||||
@@ -373,7 +397,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Verify notarization (macOS only)
|
||||
if: matrix.platform == 'macos-15' || matrix.platform == 'macos-15-intel'
|
||||
if: matrix.platform == 'macos-15'
|
||||
run: |
|
||||
echo "🔍 Verifying notarization status..."
|
||||
cd ./frontend/src-tauri/target
|
||||
@@ -398,7 +422,7 @@ jobs:
|
||||
# Only ship the MSI installer. The loose exe and WiX toolset exes
|
||||
# are not the user-facing installer - the MSI contains the signed inner exe.
|
||||
find . -name "*.msi" -exec cp {} "../../../dist/Stirling-PDF-${{ matrix.name }}.msi" \;
|
||||
elif [ "${{ matrix.platform }}" = "macos-15" ] || [ "${{ matrix.platform }}" = "macos-15-intel" ]; then
|
||||
elif [ "${{ matrix.platform }}" = "macos-15" ]; then
|
||||
find . -name "*.dmg" -exec cp {} "../../../dist/Stirling-PDF-${{ matrix.name }}.dmg" \;
|
||||
else
|
||||
find . -name "*.deb" -exec cp {} "../../../dist/Stirling-PDF-${{ matrix.name }}.deb" \;
|
||||
@@ -491,7 +515,7 @@ jobs:
|
||||
echo "❌ No Windows executable found"
|
||||
exit 1
|
||||
fi
|
||||
elif [ "${{ matrix.platform }}" = "macos-15" ] || [ "${{ matrix.platform }}" = "macos-15-intel" ]; then
|
||||
elif [ "${{ matrix.platform }}" = "macos-15" ]; then
|
||||
echo "Checking for macOS artifacts..."
|
||||
find . -name "*.dmg" | head -5
|
||||
if [ $(find . -name "*.dmg" | wc -l) -eq 0 ]; then
|
||||
@@ -556,8 +580,7 @@ jobs:
|
||||
// Map of expected artifact names to display info
|
||||
const artifactMap = {
|
||||
'Stirling-PDF-windows-x86_64': { icon: '🪟', platform: 'Windows x64', files: '.exe, .msi' },
|
||||
'Stirling-PDF-macos-aarch64': { icon: '🍎', platform: 'macOS ARM64', files: '.dmg' },
|
||||
'Stirling-PDF-macos-x86_64': { icon: '🍎', platform: 'macOS Intel', files: '.dmg' },
|
||||
'Stirling-PDF-macos-universal': { icon: '🍎', platform: 'macOS Universal', files: '.dmg' },
|
||||
'Stirling-PDF-linux-x86_64': { icon: '🐧', platform: 'Linux x64', files: '.deb, .rpm, .AppImage' }
|
||||
};
|
||||
|
||||
|
||||
@@ -266,3 +266,7 @@ docs/type3/signatures/
|
||||
|
||||
# Claude
|
||||
.claude/
|
||||
|
||||
# Playwright MCP screenshots / traces
|
||||
.playwright-mcp/
|
||||
*.playwright-mcp.png
|
||||
|
||||
+16
-1
@@ -96,7 +96,7 @@ tasks:
|
||||
jlink
|
||||
--add-modules {{.JLINK_MODULES}}
|
||||
--strip-debug
|
||||
--compress=2
|
||||
--compress=zip-6
|
||||
--no-header-files
|
||||
--no-man-pages
|
||||
--output src-tauri/runtime/jre
|
||||
@@ -107,3 +107,18 @@ tasks:
|
||||
desc: "Remove JLink runtime and bundled JARs"
|
||||
cmds:
|
||||
- rm -rf src-tauri/libs src-tauri/runtime
|
||||
|
||||
# macOS-only. Replaces jlink:runtime's single-arch JRE with a universal
|
||||
# (arm64 + x86_64) one for the universal Tauri shell. Runs the x86_64
|
||||
# jlink under Rosetta on Apple Silicon, so it is opt-in and not part of
|
||||
# the default desktop:build flow. Requires AARCH64_JAVA_HOME and
|
||||
# X64_JAVA_HOME to point at matching JDK installations with jmods/.
|
||||
jlink:universal-mac:
|
||||
desc: "Create universal (arm64+x86_64) JRE for the macOS Tauri build"
|
||||
deps: [jlink:jar]
|
||||
platforms: [darwin]
|
||||
env:
|
||||
JLINK_MODULES: "{{.JLINK_MODULES}}"
|
||||
OUTPUT_DIR: src-tauri/runtime/jre
|
||||
cmds:
|
||||
- scripts/build-universal-mac-jre.sh
|
||||
|
||||
@@ -183,26 +183,26 @@ Use this pattern for desktop-specific or proprietary-specific features WITHOUT r
|
||||
**Example - Desktop-specific footer:**
|
||||
|
||||
```typescript
|
||||
// core/components/rightRail/RightRailFooterExtensions.tsx (stub)
|
||||
interface RightRailFooterExtensionsProps {
|
||||
// core/components/workbenchBar/WorkbenchBarFooterExtensions.tsx (stub)
|
||||
interface WorkbenchBarFooterExtensionsProps {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export function RightRailFooterExtensions(_props: RightRailFooterExtensionsProps) {
|
||||
export function WorkbenchBarFooterExtensions(_props: WorkbenchBarFooterExtensionsProps) {
|
||||
return null; // Stub - does nothing in web builds
|
||||
}
|
||||
```
|
||||
|
||||
```tsx
|
||||
// desktop/components/rightRail/RightRailFooterExtensions.tsx (real implementation)
|
||||
// desktop/components/workbenchBar/WorkbenchBarFooterExtensions.tsx (real implementation)
|
||||
import { Box } from '@mantine/core';
|
||||
import { BackendHealthIndicator } from '@app/components/BackendHealthIndicator';
|
||||
|
||||
interface RightRailFooterExtensionsProps {
|
||||
interface WorkbenchBarFooterExtensionsProps {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export function RightRailFooterExtensions({ className }: RightRailFooterExtensionsProps) {
|
||||
export function WorkbenchBarFooterExtensions({ className }: WorkbenchBarFooterExtensionsProps) {
|
||||
return (
|
||||
<Box className={className}>
|
||||
<BackendHealthIndicator />
|
||||
@@ -212,15 +212,15 @@ export function RightRailFooterExtensions({ className }: RightRailFooterExtensio
|
||||
```
|
||||
|
||||
```tsx
|
||||
// core/components/shared/RightRail.tsx (usage - works in ALL builds)
|
||||
import { RightRailFooterExtensions } from '@app/components/rightRail/RightRailFooterExtensions';
|
||||
// core/components/shared/WorkbenchBar.tsx (usage - works in ALL builds)
|
||||
import { WorkbenchBarFooterExtensions } from '@app/components/workbenchBar/WorkbenchBarFooterExtensions';
|
||||
|
||||
export function RightRail() {
|
||||
export function WorkbenchBar() {
|
||||
return (
|
||||
<div>
|
||||
{/* In web builds: renders nothing (stub returns null) */}
|
||||
{/* In desktop builds: renders BackendHealthIndicator */}
|
||||
<RightRailFooterExtensions className="right-rail-footer" />
|
||||
<WorkbenchBarFooterExtensions className="workbench-bar-footer" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
+2
-2
@@ -25,7 +25,7 @@ ext {
|
||||
imageioVersion = "3.13.1"
|
||||
lombokVersion = "1.18.44"
|
||||
bouncycastleVersion = "1.83"
|
||||
springSecuritySamlVersion = "7.0.4"
|
||||
springSecuritySamlVersion = "7.0.5"
|
||||
openSamlVersion = "5.2.1"
|
||||
commonmarkVersion = "0.28.0"
|
||||
googleJavaFormatVersion = "1.28.0"
|
||||
@@ -78,7 +78,7 @@ springBoot {
|
||||
|
||||
allprojects {
|
||||
group = 'stirling.software'
|
||||
version = '2.10.0'
|
||||
version = '2.10.1'
|
||||
|
||||
configurations.configureEach {
|
||||
exclude group: "org.springframework.boot", module: "spring-boot-starter-tomcat"
|
||||
|
||||
Generated
+171
-170
@@ -12,29 +12,29 @@
|
||||
"@atlaskit/pragmatic-drag-and-drop": "^1.7.7",
|
||||
"@cantoo/pdf-lib": "^2.5.3",
|
||||
"@dnd-kit/core": "^6.3.1",
|
||||
"@embedpdf/core": "^2.8.0",
|
||||
"@embedpdf/core": "^2.14.1",
|
||||
"@embedpdf/engines": "^2.8.0",
|
||||
"@embedpdf/models": "^2.8.0",
|
||||
"@embedpdf/plugin-annotation": "^2.8.0",
|
||||
"@embedpdf/plugin-attachment": "^2.8.0",
|
||||
"@embedpdf/plugin-bookmark": "^2.8.0",
|
||||
"@embedpdf/plugin-document-manager": "^2.8.0",
|
||||
"@embedpdf/plugin-export": "^2.8.0",
|
||||
"@embedpdf/plugin-history": "^2.8.0",
|
||||
"@embedpdf/plugin-interaction-manager": "^2.8.0",
|
||||
"@embedpdf/plugin-pan": "^2.8.0",
|
||||
"@embedpdf/plugin-print": "^2.8.0",
|
||||
"@embedpdf/plugin-redaction": "^2.8.0",
|
||||
"@embedpdf/plugin-render": "^2.8.0",
|
||||
"@embedpdf/plugin-rotate": "^2.8.0",
|
||||
"@embedpdf/plugin-scroll": "^2.8.0",
|
||||
"@embedpdf/plugin-search": "^2.8.0",
|
||||
"@embedpdf/models": "^2.14.1",
|
||||
"@embedpdf/plugin-annotation": "^2.14.1",
|
||||
"@embedpdf/plugin-attachment": "^2.14.1",
|
||||
"@embedpdf/plugin-bookmark": "^2.14.1",
|
||||
"@embedpdf/plugin-document-manager": "^2.14.1",
|
||||
"@embedpdf/plugin-export": "^2.14.1",
|
||||
"@embedpdf/plugin-history": "^2.14.1",
|
||||
"@embedpdf/plugin-interaction-manager": "^2.14.1",
|
||||
"@embedpdf/plugin-pan": "^2.14.1",
|
||||
"@embedpdf/plugin-print": "^2.14.1",
|
||||
"@embedpdf/plugin-redaction": "^2.14.1",
|
||||
"@embedpdf/plugin-render": "^2.14.1",
|
||||
"@embedpdf/plugin-rotate": "^2.14.1",
|
||||
"@embedpdf/plugin-scroll": "^2.14.1",
|
||||
"@embedpdf/plugin-search": "^2.14.1",
|
||||
"@embedpdf/plugin-selection": "^2.8.0",
|
||||
"@embedpdf/plugin-spread": "^2.8.0",
|
||||
"@embedpdf/plugin-thumbnail": "^2.8.0",
|
||||
"@embedpdf/plugin-tiling": "^2.8.0",
|
||||
"@embedpdf/plugin-viewport": "^2.8.0",
|
||||
"@embedpdf/plugin-zoom": "^2.8.0",
|
||||
"@embedpdf/plugin-spread": "^2.14.1",
|
||||
"@embedpdf/plugin-thumbnail": "^2.14.1",
|
||||
"@embedpdf/plugin-tiling": "^2.14.1",
|
||||
"@embedpdf/plugin-viewport": "^2.14.1",
|
||||
"@embedpdf/plugin-zoom": "^2.14.1",
|
||||
"@emotion/react": "^11.14.0",
|
||||
"@emotion/styled": "^11.14.1",
|
||||
"@iconify/react": "^6.0.2",
|
||||
@@ -52,8 +52,8 @@
|
||||
"@tailwindcss/postcss": "^4.1.13",
|
||||
"@tanstack/react-virtual": "^3.13.12",
|
||||
"@tauri-apps/api": "^2.10.1",
|
||||
"@tauri-apps/plugin-dialog": "^2.6.0",
|
||||
"@tauri-apps/plugin-fs": "^2.4.5",
|
||||
"@tauri-apps/plugin-dialog": "2.7.0",
|
||||
"@tauri-apps/plugin-fs": "2.5.0",
|
||||
"@tauri-apps/plugin-http": "^2.5.7",
|
||||
"@tauri-apps/plugin-notification": "^2.3.3",
|
||||
"@tauri-apps/plugin-shell": "^2.3.5",
|
||||
@@ -585,13 +585,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/core": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/core/-/core-2.9.1.tgz",
|
||||
"integrity": "sha512-DlFV2o+tv9S+j4TeBVkRaIjjE9o3Tq3+hvJNoIOFtl87cR77UVQqEIRqOf61yk85Y+T2LfmnVPWjNcMuiKUh8w==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/core/-/core-2.14.1.tgz",
|
||||
"integrity": "sha512-L0lNn5WGnGDPaI1q2wnavVF6C6haRtvPGbMfqhZrjr7V+e0GExeoTO0VjK1DwH4IIBHOuD6nsQFYI89+nY/sJA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@embedpdf/engines": "2.9.1",
|
||||
"@embedpdf/models": "2.9.1"
|
||||
"@embedpdf/engines": "2.14.1",
|
||||
"@embedpdf/models": "2.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"preact": "^10.26.4",
|
||||
@@ -602,9 +602,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/engines": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/engines/-/engines-2.9.1.tgz",
|
||||
"integrity": "sha512-zyUdKgM2BZVzkqkbIMiTPAKIdH4M3bRV91P1nXUJUU94AmL9DrDrMkf2Nv6+S0bxGt19OpqDlclGSRZ8txhbGw==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/engines/-/engines-2.14.1.tgz",
|
||||
"integrity": "sha512-k+HHuhj7dPKZC+8wUvMbpEUbNfi6F5r96Ky2XbNhBxiMQSWlVljBQVfZWcq9Jy3TLslwn5m2BbrvvHw+UVqe3w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@embedpdf/fonts-arabic": "1.0.0",
|
||||
@@ -614,8 +614,8 @@
|
||||
"@embedpdf/fonts-latin": "1.0.0",
|
||||
"@embedpdf/fonts-sc": "1.0.0",
|
||||
"@embedpdf/fonts-tc": "1.0.0",
|
||||
"@embedpdf/models": "2.9.1",
|
||||
"@embedpdf/pdfium": "2.9.1"
|
||||
"@embedpdf/models": "2.14.1",
|
||||
"@embedpdf/pdfium": "2.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"preact": "^10.26.4",
|
||||
@@ -668,31 +668,32 @@
|
||||
"license": "OFL-1.1"
|
||||
},
|
||||
"node_modules/@embedpdf/models": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/models/-/models-2.9.1.tgz",
|
||||
"integrity": "sha512-hUKj30D+a9dDOQlbqbrpjaECDPIcw/526Vo/s+eqJBY8zDNUkZ6meX+aVUrKg8+ApBm2dcEdVo3ff7KgNRhUGw==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/models/-/models-2.14.1.tgz",
|
||||
"integrity": "sha512-jbuoXKv4jW8F1o8EzCmPIB5U/yVC5DWlWhxL9ZfvBiBgW2HIy68ydcu+AykqOG75eAvCfxqcvF2HzSDsV3+K0A==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@embedpdf/pdfium": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/pdfium/-/pdfium-2.9.1.tgz",
|
||||
"integrity": "sha512-GUu1rDF3XP8X7UpQNnOCvc/jAX/Tw0NoUpOF0aEksVZ6CoujBxtu84P3kWAxcJl6cicyIJq1GAp9szHBSYrTrQ==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/pdfium/-/pdfium-2.14.1.tgz",
|
||||
"integrity": "sha512-4FKhpeb7CYfkZ1k0WyDTq8i2FlIO5MaR0ywIDJ0goxOjenKkYOgHQ4747B5evxRzNEC2H5V3Rk6Dunf7TlIYBQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@embedpdf/plugin-annotation": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-annotation/-/plugin-annotation-2.9.1.tgz",
|
||||
"integrity": "sha512-aNtXjI3NUwz7kdmWsQIWzuS1QdZmuHXGCc+Kwl9u5O0PAgoj74OLsgoNEcFzz9m1rljyq3WPVnLczO6ByiifpQ==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-annotation/-/plugin-annotation-2.14.1.tgz",
|
||||
"integrity": "sha512-YGe/DLL5r9HsF54QYgNnsc82W4E2jXRaX6D4WzR38argBhiSLf3IhTJmFXVR2WlPK4VwW6DA0p7WqKcEYUOyDg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@embedpdf/models": "2.9.1",
|
||||
"@embedpdf/utils": "2.9.1"
|
||||
"@embedpdf/models": "2.14.1",
|
||||
"@embedpdf/utils": "2.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@embedpdf/core": "2.9.1",
|
||||
"@embedpdf/plugin-history": "2.9.1",
|
||||
"@embedpdf/plugin-interaction-manager": "2.9.1",
|
||||
"@embedpdf/plugin-selection": "2.9.1",
|
||||
"@embedpdf/core": "2.14.1",
|
||||
"@embedpdf/plugin-history": "2.14.1",
|
||||
"@embedpdf/plugin-interaction-manager": "2.14.1",
|
||||
"@embedpdf/plugin-scroll": "2.14.1",
|
||||
"@embedpdf/plugin-selection": "2.14.1",
|
||||
"preact": "^10.26.4",
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0",
|
||||
@@ -701,15 +702,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/plugin-attachment": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-attachment/-/plugin-attachment-2.9.1.tgz",
|
||||
"integrity": "sha512-7fPPHLWHZE9SXZRPnibo6o/AkuiknJQckdNgO16g9EdbPbO6IDNg/8e8pyjK4Knc+ckyyF4gnJ1lemWswSELUw==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-attachment/-/plugin-attachment-2.14.1.tgz",
|
||||
"integrity": "sha512-RdR43Kp/t15/KcvAiN8VEMxhqJcTfK2ZeU95PbPHr8zZ1rDatRltVGmKQ4fcaBXQMv15VLTEPZNbGFbfRgdF8g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@embedpdf/models": "2.9.1"
|
||||
"@embedpdf/models": "2.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@embedpdf/core": "2.9.1",
|
||||
"@embedpdf/core": "2.14.1",
|
||||
"preact": "^10.26.4",
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0",
|
||||
@@ -718,15 +719,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/plugin-bookmark": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-bookmark/-/plugin-bookmark-2.9.1.tgz",
|
||||
"integrity": "sha512-5qgz4yBFEi6h1cogvn9q9CBObGdNLVfkX809kVNPHuRIYsghEieqYkdoh1BNwdP/bm9+D7a6pcXZrVvbXs5e5w==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-bookmark/-/plugin-bookmark-2.14.1.tgz",
|
||||
"integrity": "sha512-ur5tEu4OaVec8T6qF9c18W9hfMNqg0g6dkVqcuh+qaLUYznJpyxMSsNTMJmw/h607bsVLfA1QCwk4l2vORwNmQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@embedpdf/models": "2.9.1"
|
||||
"@embedpdf/models": "2.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@embedpdf/core": "2.9.1",
|
||||
"@embedpdf/core": "2.14.1",
|
||||
"preact": "^10.26.4",
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0",
|
||||
@@ -735,15 +736,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/plugin-document-manager": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-document-manager/-/plugin-document-manager-2.9.1.tgz",
|
||||
"integrity": "sha512-TrqkZvPIQxcWikL9Fmm8/qAJvI+uG7ahPXuyGyyF0JxkrrHCkUMCL8SPJN/fntcPnLJRIi3/K/xR5Qnt/L0aAg==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-document-manager/-/plugin-document-manager-2.14.1.tgz",
|
||||
"integrity": "sha512-Qdj6Xkmpyt0aLHCkqZbOsOK5xzwI4IjaV8C2ihPiggB/iPDhoyXPklJb3wXmJfxjTIl+aw+FZmmPkmr4IpYn7w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@embedpdf/models": "2.9.1"
|
||||
"@embedpdf/models": "2.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@embedpdf/core": "2.9.1",
|
||||
"@embedpdf/core": "2.14.1",
|
||||
"preact": "^10.26.4",
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0",
|
||||
@@ -752,15 +753,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/plugin-export": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-export/-/plugin-export-2.9.1.tgz",
|
||||
"integrity": "sha512-oYl8H0km1m75SYz17mVwxm9ljZvW0yBV8sTcyCa7YhnqE7yxtczu7jw3BrU3KW4Sua9mr9izhs3AixvWkTASQg==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-export/-/plugin-export-2.14.1.tgz",
|
||||
"integrity": "sha512-O52WPexZD7dbUJQnjp3ikhNg7D3PmGZJowJmXVcmJ2YlTkBabN799LBppC+FYP7nXrtbwy7UmG6vdGWha1b/NQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@embedpdf/models": "2.9.1"
|
||||
"@embedpdf/models": "2.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@embedpdf/core": "2.9.1",
|
||||
"@embedpdf/core": "2.14.1",
|
||||
"preact": "^10.26.4",
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0",
|
||||
@@ -769,15 +770,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/plugin-history": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-history/-/plugin-history-2.9.1.tgz",
|
||||
"integrity": "sha512-3AcvSTT7fmqe1ve/FvR3lJ5q7t5JYmnnAg8LKc9ATsDjS9J5b0WE03Omz9a8/sL19iKq8xeR1+W28phgvlcKNw==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-history/-/plugin-history-2.14.1.tgz",
|
||||
"integrity": "sha512-mJUKNO69b8Cf0zpE3zJRM5in/AsVRLZq4bRbuAfK9c5+YG2Z59fYEjfRNSwDefxatzFTgy3mlZ5/fSfZsAZz0w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@embedpdf/models": "2.9.1"
|
||||
"@embedpdf/models": "2.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@embedpdf/core": "2.9.1",
|
||||
"@embedpdf/core": "2.14.1",
|
||||
"preact": "^10.26.4",
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0",
|
||||
@@ -786,15 +787,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/plugin-interaction-manager": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-interaction-manager/-/plugin-interaction-manager-2.9.1.tgz",
|
||||
"integrity": "sha512-/wpdStr1NeyMCvAEMVSCPC0a3zaMd+TSK4u8INsIo3b1RoFfb9iTlBB+qW/aaxvZJ/C7MChQ7cLX6VSKXK/6JQ==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-interaction-manager/-/plugin-interaction-manager-2.14.1.tgz",
|
||||
"integrity": "sha512-eyH45cF3vHeZ5BlcgIjH212EtUhi20FvKSRZeLWZW72noOn6saXRDScLy/XGbtfGFjJoTrzkNA553hvrRpqVKA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@embedpdf/models": "2.9.1"
|
||||
"@embedpdf/models": "2.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@embedpdf/core": "2.9.1",
|
||||
"@embedpdf/core": "2.14.1",
|
||||
"preact": "^10.26.4",
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0",
|
||||
@@ -803,17 +804,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/plugin-pan": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-pan/-/plugin-pan-2.9.1.tgz",
|
||||
"integrity": "sha512-LH5fp/2xKWuEYb5cc5jNWdXkhgOL+8TEf4oLcgao6hK33aV1xry+HAg5ATy+OPpIJItCwjU/Lk7Mc7uibYcFlA==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-pan/-/plugin-pan-2.14.1.tgz",
|
||||
"integrity": "sha512-sHc9gjfoWQhfMcJ2JULsTzH9Sg9z6wX76Qvr5cujSPoOVV5bZ4QCB0kF1vgLFFzA1ia7vIBveGtDHIGkQQjsxA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@embedpdf/models": "2.9.1"
|
||||
"@embedpdf/models": "2.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@embedpdf/core": "2.9.1",
|
||||
"@embedpdf/plugin-interaction-manager": "2.9.1",
|
||||
"@embedpdf/plugin-viewport": "2.9.1",
|
||||
"@embedpdf/core": "2.14.1",
|
||||
"@embedpdf/plugin-interaction-manager": "2.14.1",
|
||||
"@embedpdf/plugin-viewport": "2.14.1",
|
||||
"preact": "^10.26.4",
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0",
|
||||
@@ -822,15 +823,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/plugin-print": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-print/-/plugin-print-2.9.1.tgz",
|
||||
"integrity": "sha512-brTn0R8AVyAfpm0SYxz/8bg0e373n4KaeIgw5E51DSrczVr3zIgqYGSvXFbfbv57ZUp63Hb93sVorP1et2AeUw==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-print/-/plugin-print-2.14.1.tgz",
|
||||
"integrity": "sha512-wYuGuxuBhau7l2BfTlD5oohboRdseOn9/v0uVNGwKDuLHUTrv2WnkpzibBYIjv73gttyMBxTXdB3PZfnWOo8VA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@embedpdf/models": "2.9.1"
|
||||
"@embedpdf/models": "2.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@embedpdf/core": "2.9.1",
|
||||
"@embedpdf/core": "2.14.1",
|
||||
"preact": "^10.26.4",
|
||||
"react": ">=18.0.0",
|
||||
"react-dom": ">=18.0.0",
|
||||
@@ -839,20 +840,20 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/plugin-redaction": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-redaction/-/plugin-redaction-2.9.1.tgz",
|
||||
"integrity": "sha512-2R81U4ex/JU4IAJ0+G3eIMOwpq80HnAIZ2sI5yMhkDbz+ZZE/sdAP4JKTOFIbhTkwk7DmC222yW34dQJoX4tRQ==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-redaction/-/plugin-redaction-2.14.1.tgz",
|
||||
"integrity": "sha512-xlcOgYDNqIKp9u7exT95RtfDGCkW1b+knGikpTNZEA5OJgtYO9RxquTkEZ4rdVZbgIWxs0xiMg6b0mhr33z4JQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@embedpdf/models": "2.9.1",
|
||||
"@embedpdf/utils": "2.9.1"
|
||||
"@embedpdf/models": "2.14.1",
|
||||
"@embedpdf/utils": "2.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@embedpdf/core": "2.9.1",
|
||||
"@embedpdf/plugin-annotation": "2.9.1",
|
||||
"@embedpdf/plugin-history": "2.9.1",
|
||||
"@embedpdf/plugin-interaction-manager": "2.9.1",
|
||||
"@embedpdf/plugin-selection": "2.9.1",
|
||||
"@embedpdf/core": "2.14.1",
|
||||
"@embedpdf/plugin-annotation": "2.14.1",
|
||||
"@embedpdf/plugin-history": "2.14.1",
|
||||
"@embedpdf/plugin-interaction-manager": "2.14.1",
|
||||
"@embedpdf/plugin-selection": "2.14.1",
|
||||
"preact": "^10.26.4",
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0",
|
||||
@@ -861,15 +862,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/plugin-render": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-render/-/plugin-render-2.9.1.tgz",
|
||||
"integrity": "sha512-mtfu6uDxlz3+j0xPXfKyvuu8iCFjapPkbnx8vGQ0z2PBNAMm+05hsNIzxJSGMP2VCFo09SOz2zCs7ch9J6NeNg==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-render/-/plugin-render-2.14.1.tgz",
|
||||
"integrity": "sha512-KRjeSZeQRrg6fuyUgSU43yE6bOrRredpEiAfPI/FUCGgniO9nokTHjnFYg5G3UtVteJdnzdnKwzBl5sY++NQkg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@embedpdf/models": "2.9.1"
|
||||
"@embedpdf/models": "2.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@embedpdf/core": "2.9.1",
|
||||
"@embedpdf/core": "2.14.1",
|
||||
"preact": "^10.26.4",
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0",
|
||||
@@ -878,15 +879,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/plugin-rotate": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-rotate/-/plugin-rotate-2.9.1.tgz",
|
||||
"integrity": "sha512-OgfMI2IsSPHKs4A0DGpmHpxuhoBcZjvw+tz+CXGBi6ILL6oS7z5wXhoMZfRgCgkvjII8RnmjBvmLeahoSaepAA==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-rotate/-/plugin-rotate-2.14.1.tgz",
|
||||
"integrity": "sha512-ILu0Y6bXzLQg63cj9pAJ0ime5m5HVDOSBOyTT/Nb47hBfDLSbTWQuvAHZXwxPhGOjM5Pn6gHssKWZjW2WiXkBQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@embedpdf/models": "2.9.1"
|
||||
"@embedpdf/models": "2.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@embedpdf/core": "2.9.1",
|
||||
"@embedpdf/core": "2.14.1",
|
||||
"preact": "^10.26.4",
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0",
|
||||
@@ -895,16 +896,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/plugin-scroll": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-scroll/-/plugin-scroll-2.9.1.tgz",
|
||||
"integrity": "sha512-+U3PSIUuNlIOTXzRhnPBP+Rx20sFOd3OPiowyI2EP/Kx/j5R/amgL/t2rjrpw9gjXEMEGsli9Fn4UqnVgMrPaQ==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-scroll/-/plugin-scroll-2.14.1.tgz",
|
||||
"integrity": "sha512-ppnP4t43EVNiXr2coEwybQ7BYucbUEpdTGlcEBm38DhLywgseVVySrcIMx7rHdM7ZylsW7uwS84hCFndTpPezg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@embedpdf/models": "2.9.1"
|
||||
"@embedpdf/models": "2.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@embedpdf/core": "2.9.1",
|
||||
"@embedpdf/plugin-viewport": "2.9.1",
|
||||
"@embedpdf/core": "2.14.1",
|
||||
"@embedpdf/plugin-viewport": "2.14.1",
|
||||
"preact": "^10.26.4",
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0",
|
||||
@@ -913,15 +914,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/plugin-search": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-search/-/plugin-search-2.9.1.tgz",
|
||||
"integrity": "sha512-NefZgXPfj1MW8i5bYEfuphpXXAODutJTtwCHpLff1YwPw6liuBug9G1lDKSpNddvp+7aSkTcXV5LYNhcPxb1vg==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-search/-/plugin-search-2.14.1.tgz",
|
||||
"integrity": "sha512-dAX4aIc4WeO+bUImbcHVm4c32UADYelpTeJA0It2eq6agZVND20B25kyDYpJiWKTl9NaVcJbNic+wreudl6vsQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@embedpdf/models": "2.9.1"
|
||||
"@embedpdf/models": "2.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@embedpdf/core": "2.9.1",
|
||||
"@embedpdf/core": "2.14.1",
|
||||
"preact": "^10.26.4",
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0",
|
||||
@@ -930,17 +931,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/plugin-selection": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-selection/-/plugin-selection-2.9.1.tgz",
|
||||
"integrity": "sha512-dVLjiLGnZDo0xO7lZulLGl3cJ/mO7BcA3PGO2uMdhqSWK4tAF/DrakvwXdD581VBwXD/C25EJhxiNa2L7mU4wg==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-selection/-/plugin-selection-2.14.1.tgz",
|
||||
"integrity": "sha512-M+omnIDqgME+QgYX3nW3ypjzRvvz2IrSWpx7vP7vUhfd12R4ZJnTkS9AkKbXgHBVwWrxnbibKlZduiiehRLeKg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@embedpdf/models": "2.9.1",
|
||||
"@embedpdf/utils": "2.9.1"
|
||||
"@embedpdf/models": "2.14.1",
|
||||
"@embedpdf/utils": "2.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@embedpdf/core": "2.9.1",
|
||||
"@embedpdf/plugin-interaction-manager": "2.9.1",
|
||||
"@embedpdf/core": "2.14.1",
|
||||
"@embedpdf/plugin-interaction-manager": "2.14.1",
|
||||
"preact": "^10.26.4",
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0",
|
||||
@@ -949,15 +950,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/plugin-spread": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-spread/-/plugin-spread-2.9.1.tgz",
|
||||
"integrity": "sha512-s9J4tvoucNac8pUAHVhv3PWDWMZJyK0ikaG78VdGwh4G2iMo5HW1LKDJkJ29l1TjAuxhIoKihpfQbLgUgi7JHA==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-spread/-/plugin-spread-2.14.1.tgz",
|
||||
"integrity": "sha512-MychoG54eYqjB+8/1/ArKYF+4eonULtBuGPqU72MO9t/Nadl8nNThaPrOW/eKQr3zQu1Af3KO7ng6tm6Umz4rA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@embedpdf/models": "2.9.1"
|
||||
"@embedpdf/models": "2.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@embedpdf/core": "2.9.1",
|
||||
"@embedpdf/core": "2.14.1",
|
||||
"preact": "^10.26.4",
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0",
|
||||
@@ -966,16 +967,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/plugin-thumbnail": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-thumbnail/-/plugin-thumbnail-2.9.1.tgz",
|
||||
"integrity": "sha512-TAEUkVxvvB5kh2VVGf9RMuJFq++CQgWpKJ62ed2GhB9WvVKP5gBYj7G5ff90TLCrAV8iXZL9ENKcHgGKxrZrYw==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-thumbnail/-/plugin-thumbnail-2.14.1.tgz",
|
||||
"integrity": "sha512-NOaFve83gbD6BUiANSSbiREjUJ1qpNyQrHl2RdMDNLyDaSUARweUu5zC5vfFRd9I+jUf3XGsCa3GNFlzQt+C9A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@embedpdf/models": "2.9.1"
|
||||
"@embedpdf/models": "2.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@embedpdf/core": "2.9.1",
|
||||
"@embedpdf/plugin-render": "2.9.1",
|
||||
"@embedpdf/core": "2.14.1",
|
||||
"@embedpdf/plugin-render": "2.14.1",
|
||||
"preact": "^10.26.4",
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0",
|
||||
@@ -984,18 +985,18 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/plugin-tiling": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-tiling/-/plugin-tiling-2.9.1.tgz",
|
||||
"integrity": "sha512-UQ/gr/Rdzj7sMsgvtuClw6Jq25fMr+OEdW4tQmg2bV/MqpKptpOEUZ5Aiay4M03X3cgoxhS8UvobRMnjlpYljA==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-tiling/-/plugin-tiling-2.14.1.tgz",
|
||||
"integrity": "sha512-tvs3pPT6wVh0MjMN7Dp8R1XeoTjguH30j/ToWz9ziTKkwXADfJXdyjqYGhagiamMMTwQeUF9py+yDTMP23QV7Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@embedpdf/models": "2.9.1"
|
||||
"@embedpdf/models": "2.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@embedpdf/core": "2.9.1",
|
||||
"@embedpdf/plugin-render": "2.9.1",
|
||||
"@embedpdf/plugin-scroll": "2.9.1",
|
||||
"@embedpdf/plugin-viewport": "2.9.1",
|
||||
"@embedpdf/core": "2.14.1",
|
||||
"@embedpdf/plugin-render": "2.14.1",
|
||||
"@embedpdf/plugin-scroll": "2.14.1",
|
||||
"@embedpdf/plugin-viewport": "2.14.1",
|
||||
"preact": "^10.26.4",
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0",
|
||||
@@ -1004,15 +1005,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/plugin-viewport": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-viewport/-/plugin-viewport-2.9.1.tgz",
|
||||
"integrity": "sha512-bVhBuZHTppKV+OB5lBLqXQv+5oW1A7kAIc5UzsImBwl6NpwH+2PdVkelfrF37yEqnEF/mdxobriWSP0aOVl93w==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-viewport/-/plugin-viewport-2.14.1.tgz",
|
||||
"integrity": "sha512-U45B46XoaAFxC3yKnVhBO8Z5Wa+ca17UW7esJC/yWneJ2dNfSnvRAR7309KKP/RpZfDmn/lfJDVOFGCDbR3hvw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@embedpdf/models": "2.9.1"
|
||||
"@embedpdf/models": "2.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@embedpdf/core": "2.9.1",
|
||||
"@embedpdf/core": "2.14.1",
|
||||
"preact": "^10.26.4",
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0",
|
||||
@@ -1021,17 +1022,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/plugin-zoom": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-zoom/-/plugin-zoom-2.9.1.tgz",
|
||||
"integrity": "sha512-FVOYj+AKTc2aCPrZHOrgbiYNTfBmiwVpFCedmqeGLYOIYTIeGzwJlyIHLU0PmIC/nuHcu1ZFwh0tH23fWAfVCQ==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-zoom/-/plugin-zoom-2.14.1.tgz",
|
||||
"integrity": "sha512-rVah7XgrWiNe9kT7VGRhNp5mCImf3eMk4cGO9kXIidQWka+yFqBANJw6Rj+FJdtWqz6pamZNWXTDZ1jvQkMKZg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@embedpdf/models": "2.9.1"
|
||||
"@embedpdf/models": "2.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@embedpdf/core": "2.9.1",
|
||||
"@embedpdf/plugin-scroll": "2.9.1",
|
||||
"@embedpdf/plugin-viewport": "2.9.1",
|
||||
"@embedpdf/core": "2.14.1",
|
||||
"@embedpdf/plugin-scroll": "2.14.1",
|
||||
"@embedpdf/plugin-viewport": "2.14.1",
|
||||
"preact": "^10.26.4",
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0",
|
||||
@@ -1040,9 +1041,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/utils": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/utils/-/utils-2.9.1.tgz",
|
||||
"integrity": "sha512-IKe/k5DruzpuyGJBIoLEL9AKJ9rEBDLgi1eSCWQPyYkuLWTJg4rBzyGh57eS4S4K4dzQrlJ3Z9zGAW1mgbY2Jw==",
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/utils/-/utils-2.14.1.tgz",
|
||||
"integrity": "sha512-TlJBT+SgRgcSMKH2EX3WBXIm/a/LEtgG2IiZ7hXPhT3t2e1HOeXjkvreJi6wcnvkMt4eYtJh3nocetto5gNclw==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"preact": "^10.26.4",
|
||||
@@ -4430,21 +4431,21 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@tauri-apps/plugin-dialog": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/plugin-dialog/-/plugin-dialog-2.6.0.tgz",
|
||||
"integrity": "sha512-q4Uq3eY87TdcYzXACiYSPhmpBA76shgmQswGkSVio4C82Sz2W4iehe9TnKYwbq7weHiL88Yw19XZm7v28+Micg==",
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/plugin-dialog/-/plugin-dialog-2.7.0.tgz",
|
||||
"integrity": "sha512-4nS/hfGMGCXiAS3LtVjH9AgsSAPJeG/7R+q8agTFqytjnMa4Zq95Bq8WzVDkckpanX+yyRHXnRtrKXkANKDHvw==",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^2.8.0"
|
||||
"@tauri-apps/api": "^2.10.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@tauri-apps/plugin-fs": {
|
||||
"version": "2.4.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/plugin-fs/-/plugin-fs-2.4.5.tgz",
|
||||
"integrity": "sha512-dVxWWGE6VrOxC7/jlhyE+ON/Cc2REJlM35R3PJX3UvFw2XwYhLGQVAIyrehenDdKjotipjYEVc4YjOl3qq90fA==",
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/plugin-fs/-/plugin-fs-2.5.0.tgz",
|
||||
"integrity": "sha512-c83kbz61AK+rKjhS+je9+stIO27nXj7p9cqeg36TwkIUtxpCFTttlHHtqon6h6FN54cXjyAjlMPOJcW3mwE5XQ==",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^2.8.0"
|
||||
"@tauri-apps/api": "^2.10.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@tauri-apps/plugin-http": {
|
||||
|
||||
+23
-23
@@ -8,29 +8,29 @@
|
||||
"@atlaskit/pragmatic-drag-and-drop": "^1.7.7",
|
||||
"@cantoo/pdf-lib": "^2.5.3",
|
||||
"@dnd-kit/core": "^6.3.1",
|
||||
"@embedpdf/core": "^2.8.0",
|
||||
"@embedpdf/core": "^2.14.1",
|
||||
"@embedpdf/engines": "^2.8.0",
|
||||
"@embedpdf/models": "^2.8.0",
|
||||
"@embedpdf/plugin-annotation": "^2.8.0",
|
||||
"@embedpdf/plugin-attachment": "^2.8.0",
|
||||
"@embedpdf/plugin-bookmark": "^2.8.0",
|
||||
"@embedpdf/plugin-document-manager": "^2.8.0",
|
||||
"@embedpdf/plugin-export": "^2.8.0",
|
||||
"@embedpdf/plugin-history": "^2.8.0",
|
||||
"@embedpdf/plugin-interaction-manager": "^2.8.0",
|
||||
"@embedpdf/plugin-pan": "^2.8.0",
|
||||
"@embedpdf/plugin-print": "^2.8.0",
|
||||
"@embedpdf/plugin-redaction": "^2.8.0",
|
||||
"@embedpdf/plugin-render": "^2.8.0",
|
||||
"@embedpdf/plugin-rotate": "^2.8.0",
|
||||
"@embedpdf/plugin-scroll": "^2.8.0",
|
||||
"@embedpdf/plugin-search": "^2.8.0",
|
||||
"@embedpdf/models": "^2.14.1",
|
||||
"@embedpdf/plugin-annotation": "^2.14.1",
|
||||
"@embedpdf/plugin-attachment": "^2.14.1",
|
||||
"@embedpdf/plugin-bookmark": "^2.14.1",
|
||||
"@embedpdf/plugin-document-manager": "^2.14.1",
|
||||
"@embedpdf/plugin-export": "^2.14.1",
|
||||
"@embedpdf/plugin-history": "^2.14.1",
|
||||
"@embedpdf/plugin-interaction-manager": "^2.14.1",
|
||||
"@embedpdf/plugin-pan": "^2.14.1",
|
||||
"@embedpdf/plugin-print": "^2.14.1",
|
||||
"@embedpdf/plugin-redaction": "^2.14.1",
|
||||
"@embedpdf/plugin-render": "^2.14.1",
|
||||
"@embedpdf/plugin-rotate": "^2.14.1",
|
||||
"@embedpdf/plugin-scroll": "^2.14.1",
|
||||
"@embedpdf/plugin-search": "^2.14.1",
|
||||
"@embedpdf/plugin-selection": "^2.8.0",
|
||||
"@embedpdf/plugin-spread": "^2.8.0",
|
||||
"@embedpdf/plugin-thumbnail": "^2.8.0",
|
||||
"@embedpdf/plugin-tiling": "^2.8.0",
|
||||
"@embedpdf/plugin-viewport": "^2.8.0",
|
||||
"@embedpdf/plugin-zoom": "^2.8.0",
|
||||
"@embedpdf/plugin-spread": "^2.14.1",
|
||||
"@embedpdf/plugin-thumbnail": "^2.14.1",
|
||||
"@embedpdf/plugin-tiling": "^2.14.1",
|
||||
"@embedpdf/plugin-viewport": "^2.14.1",
|
||||
"@embedpdf/plugin-zoom": "^2.14.1",
|
||||
"@emotion/react": "^11.14.0",
|
||||
"@emotion/styled": "^11.14.1",
|
||||
"@iconify/react": "^6.0.2",
|
||||
@@ -48,8 +48,8 @@
|
||||
"@tailwindcss/postcss": "^4.1.13",
|
||||
"@tanstack/react-virtual": "^3.13.12",
|
||||
"@tauri-apps/api": "^2.10.1",
|
||||
"@tauri-apps/plugin-dialog": "^2.6.0",
|
||||
"@tauri-apps/plugin-fs": "^2.4.5",
|
||||
"@tauri-apps/plugin-dialog": "2.7.0",
|
||||
"@tauri-apps/plugin-fs": "2.5.0",
|
||||
"@tauri-apps/plugin-http": "^2.5.7",
|
||||
"@tauri-apps/plugin-notification": "^2.3.3",
|
||||
"@tauri-apps/plugin-shell": "^2.3.5",
|
||||
|
||||
@@ -1460,14 +1460,14 @@ inactive = "Inactive"
|
||||
|
||||
[adminOnboarding]
|
||||
adminTools = "Finally, we have advanced administration tools like <strong>Auditing</strong> to track system activity and <strong>Usage Analytics</strong> to monitor how your users interact with the platform."
|
||||
configButton = "Click the <strong>Config</strong> button to access all system settings and administrative controls."
|
||||
configButton = "Open <strong>Settings</strong> to access all system configuration and administrative controls."
|
||||
connectionsSection = "The <strong>Connections</strong> section supports various login methods including custom SSO and SAML providers like Google and GitHub, plus email integrations for notifications and communications."
|
||||
databaseSection = "For advanced production environments, we have settings to allow <strong>external database hookups</strong> so you can integrate with your existing infrastructure."
|
||||
settingsOverview = "This is the <strong>Settings Panel</strong>. Admin settings are organised by category for easy navigation."
|
||||
systemCustomization = "We have extensive ways to customise the UI: <strong>System Settings</strong> let you change the app name and languages, <strong>Features</strong> allows server certificate management, and <strong>Endpoints</strong> lets you enable or disable specific tools for your users."
|
||||
teamsAndUsers = "Manage <strong>Teams</strong> and individual users here. You can invite new users via email, shareable links, or create custom accounts for them yourself."
|
||||
welcome = "Welcome to the <strong>Admin Tour</strong>! Let's explore the powerful enterprise features and settings available to system administrators."
|
||||
wrapUp = "That's the admin tour! You've seen the enterprise features that make Stirling PDF a powerful, customisable solution for organisations. Access this tour anytime from the <strong>Help</strong> menu."
|
||||
wrapUp = "That's the admin tour! You've seen the enterprise features that make Stirling PDF a powerful, customisable solution for organisations. You can replay it anytime — just open <strong>Settings</strong> and find it here in the <strong>Tours</strong> section under Help."
|
||||
|
||||
[adminUserSettings]
|
||||
actions = "Actions"
|
||||
@@ -1791,26 +1791,14 @@ bullet3 = "Keeps the original name if no suitable title is found"
|
||||
text = "Automatically finds the title from your PDF content and uses it as the filename."
|
||||
title = "Smart Renaming"
|
||||
|
||||
[pdfCommentAgent]
|
||||
submit = "Generate comments"
|
||||
prompt.label = "What should the AI comment on?"
|
||||
prompt.placeholder = "e.g. Flag any ambiguous dates and suggest clarifications"
|
||||
|
||||
[pdfCommentAgent.settings]
|
||||
title = "Comment instructions"
|
||||
|
||||
[pdfCommentAgent.results]
|
||||
title = "Commented PDF"
|
||||
|
||||
[pdfCommentAgent.error]
|
||||
failed = "Failed to generate comments"
|
||||
emptyPrompt = "Please describe what the AI should comment on"
|
||||
tooLong = "Prompt is too long (maximum {{max}} characters)"
|
||||
|
||||
[automate]
|
||||
copyToSaved = "Copy to Saved"
|
||||
desc = "Build multi-step workflows by chaining together PDF actions. Ideal for recurring tasks."
|
||||
export = "Export"
|
||||
exportForFolderScanning = "Export for Folder Scanning"
|
||||
import = "Import"
|
||||
importPartialSuccess = "Imported with {{count}} unmapped operation(s): {{ops}}"
|
||||
importSuccess = "Imported automation: {{name}}"
|
||||
invalidStep = "Invalid step"
|
||||
reviewTitle = "Automation Results"
|
||||
title = "Automate"
|
||||
@@ -1826,6 +1814,7 @@ title = "Configure {{toolName}}"
|
||||
[automate.creation]
|
||||
createTitle = "Create Automation"
|
||||
editTitle = "Edit Automation"
|
||||
export = "Export"
|
||||
exportForFolderScanning = "Export for Folder Scanning"
|
||||
intro = "Automations run tools sequentially. To get started, add tools in the order you want them to run."
|
||||
save = "Save Automation"
|
||||
@@ -1856,9 +1845,28 @@ confirm = "Go Back"
|
||||
message = "You have unsaved changes. Are you sure you want to go back? All changes will be lost."
|
||||
title = "Unsaved Changes"
|
||||
|
||||
[automate.entryMenu]
|
||||
label = "Open menu for {{title}}"
|
||||
|
||||
[automate.files]
|
||||
placeholder = "Select files to process with this automation"
|
||||
|
||||
[automate.importModal]
|
||||
cancel = "Cancel"
|
||||
confirm = "Import"
|
||||
detectedAutomation = "Automate JSON"
|
||||
detectedFolderScan = "Folder Scanning JSON"
|
||||
dropHint = "Drop JSON here or click to choose a file"
|
||||
dropSubhint = "Both Automate and Folder Scanning configs are accepted"
|
||||
dropzoneAriaLabel = "Drop an automation JSON file here"
|
||||
intro = "Drop a JSON file or paste its contents below. The format (Automate or Folder Scanning) is detected automatically."
|
||||
opCount = "{{count}} operation(s)"
|
||||
parseError = "Could not parse: {{message}}"
|
||||
pasteLabel = "Or paste JSON"
|
||||
pastePlaceholder = "Paste your automation JSON here…"
|
||||
title = "Import automation"
|
||||
unresolved = "Unmapped: {{ops}}"
|
||||
|
||||
[automate.run]
|
||||
title = "Run Automation"
|
||||
|
||||
@@ -4113,11 +4121,6 @@ desc = "Auto renames a PDF file based on its detected header"
|
||||
tags = "auto-detect,header-based,organize,relabel,auto rename,automatic rename,smart rename,rename by content,filename,file naming,detect title"
|
||||
title = "Auto Rename PDF File"
|
||||
|
||||
[home.pdfCommentAgent]
|
||||
desc = "Ask AI to annotate a PDF with sticky-note comments based on your prompt"
|
||||
tags = "AI,agent,comment,annotate,sticky note,review,feedback,notes"
|
||||
title = "Add AI comments"
|
||||
|
||||
[home.autoSizeSplitPDF]
|
||||
desc = "Automatically split PDFs by file size or page count"
|
||||
tags = "auto,split,size"
|
||||
@@ -4257,6 +4260,11 @@ desc = "Merge multiple pages of a PDF document into a single page"
|
||||
tags = "layout,arrange,combine,N-up,2-up,4-up,multiple per page,pages per sheet,layout pages,tile,grid layout,multi-page layout,combine on page,handout"
|
||||
title = "Multi-Page Layout"
|
||||
|
||||
[home.pdfCommentAgent]
|
||||
desc = "Ask AI to annotate a PDF with sticky-note comments based on your prompt"
|
||||
tags = "AI,agent,comment,annotate,sticky note,review,feedback,notes"
|
||||
title = "Add AI comments"
|
||||
|
||||
[home.pdfOrganiser]
|
||||
desc = "Remove/Rearrange pages in any order"
|
||||
tags = "organize,rearrange,reorder,organise,arrange pages,sort,move pages,delete pages,remove pages,page management,page organizer,page organiser,resequence"
|
||||
@@ -4892,7 +4900,7 @@ toolInterface = "This is the <strong>Crop</strong> tool interface. As you can se
|
||||
viewer = "The <strong>Viewer</strong> lets you read and annotate your PDFs."
|
||||
viewSwitcher = "Use these controls to select how you want to view your PDFs."
|
||||
workbench = "This is the <strong>Workbench</strong> - the main area where you view and edit your PDFs."
|
||||
wrapUp = "You're all set! You've learnt about the main areas of the app and how to use them. Click the <strong>Help</strong> button whenever you like to see this tour again."
|
||||
wrapUp = "You're all set! You can replay this tour anytime — just open <strong>Settings</strong> and find it here in the <strong>Tours</strong> section under Help."
|
||||
|
||||
[onboarding.buttons]
|
||||
back = "Back"
|
||||
@@ -4957,7 +4965,6 @@ fileUpload = "Use the <strong>Files</strong> button to upload or pick a recent P
|
||||
leftPanel = "The left <strong>Tools</strong> panel lists everything you can do. Browse categories or search to find a tool quickly."
|
||||
pageEditorView = "Switch to the Page Editor to reorder, rotate, or delete pages."
|
||||
quickAccess = "Start at the <strong>Quick Access</strong> rail to jump between Reader, Automate, your files, and all the tours."
|
||||
rightRail = "The <strong>Right Rail</strong> holds quick actions to select files, change theme or language, and download results."
|
||||
topBar = "The top bar lets you swap between <strong>Viewer</strong>, <strong>Page Editor</strong>, and <strong>Active Files</strong>."
|
||||
wrapUp = "That is what is new in V2. Open the <strong>Tours</strong> menu anytime to replay this, the Tools tour, or the Admin tour."
|
||||
|
||||
@@ -5333,6 +5340,24 @@ selectYearly = "Select Yearly"
|
||||
title = "Choose Your Billing Period"
|
||||
totalForSeats = "Total ({{count}} seats)"
|
||||
|
||||
[pdfCommentAgent]
|
||||
submit = "Generate comments"
|
||||
|
||||
[pdfCommentAgent.error]
|
||||
emptyPrompt = "Please describe what the AI should comment on"
|
||||
failed = "Failed to generate comments"
|
||||
tooLong = "Prompt is too long (maximum {{max}} characters)"
|
||||
|
||||
[pdfCommentAgent.prompt]
|
||||
label = "What should the AI comment on?"
|
||||
placeholder = "e.g. Flag any ambiguous dates and suggest clarifications"
|
||||
|
||||
[pdfCommentAgent.results]
|
||||
title = "Commented PDF"
|
||||
|
||||
[pdfCommentAgent.settings]
|
||||
title = "Comment instructions"
|
||||
|
||||
[pdfOrganiser]
|
||||
header = "PDF Page Organiser"
|
||||
placeholder = "(e.g. 1,3,2 or 4-8,2,10-12 or 2n-1)"
|
||||
@@ -6540,7 +6565,7 @@ title = "High Contrast"
|
||||
text = "Completely invert all colours in the PDF, creating a negative-like effect. Useful for creating dark mode versions of documents or reducing eye strain in low-light conditions."
|
||||
title = "Invert All Colours"
|
||||
|
||||
[rightRail]
|
||||
[workbenchBar]
|
||||
annotations = "Annotations"
|
||||
applyRedactionsFirst = "Apply redactions first"
|
||||
closeAll = "Close All Files"
|
||||
@@ -6581,6 +6606,9 @@ toggleComments = "Comments"
|
||||
toggleLayers = "Toggle Layers"
|
||||
toggleSidebar = "Toggle Sidebar"
|
||||
toggleTheme = "Toggle Theme"
|
||||
activeFiles = "Active Files"
|
||||
multiTool = "Multi-Tool"
|
||||
viewer = "Viewer"
|
||||
|
||||
[rotate]
|
||||
rotateLeft = "Rotate Anticlockwise"
|
||||
@@ -6814,7 +6842,7 @@ defaultPdfEditorChecking = "Checking..."
|
||||
defaultPdfEditorInactive = "Another application is set as default"
|
||||
defaultPdfEditorSet = "Already Default"
|
||||
defaultStartupView = "Default view on launch"
|
||||
defaultStartupViewDescription = "Choose which tab is active in the left column when the app starts"
|
||||
defaultStartupViewDescription = "Choose which view is active when the app starts"
|
||||
defaultToolPickerMode = "Default tool picker mode"
|
||||
defaultToolPickerModeDescription = "Choose whether the tool picker opens in fullscreen or sidebar by default"
|
||||
defaultViewerZoom = "Default reader zoom"
|
||||
@@ -7006,6 +7034,20 @@ title = "Team"
|
||||
enableLoginFirst = "Enable login mode first"
|
||||
requiresEnterprise = "Requires Enterprise license"
|
||||
|
||||
[settings.help]
|
||||
label = "Tours"
|
||||
title = "Help"
|
||||
|
||||
[settings.help.adminTour]
|
||||
description = "Explore team management, system settings, and enterprise features."
|
||||
start = "Start"
|
||||
title = "Admin Tour"
|
||||
|
||||
[settings.help.toolsTour]
|
||||
description = "Walk through uploading files, picking a tool, and reviewing results."
|
||||
start = "Start"
|
||||
title = "Tools Tour"
|
||||
|
||||
[settings.workspace]
|
||||
people = "People"
|
||||
teams = "Teams"
|
||||
@@ -7855,6 +7897,7 @@ singleFileScope = "Only applying to: {{fileName}}"
|
||||
viewerMode = "Switch to the file editor to add multiple files."
|
||||
|
||||
[toolPanel]
|
||||
allTools = "All tools"
|
||||
alpha = "Alpha"
|
||||
backToTools = "Back to tools"
|
||||
collapse = "Collapse panel"
|
||||
@@ -8414,11 +8457,6 @@ description = "Upload a pre-created signature image. Ideal if you have a scanned
|
||||
title = "Upload Signature Image"
|
||||
|
||||
|
||||
[workbenchBar]
|
||||
activeFiles = "Active Files"
|
||||
multiTool = "Multi-Tool"
|
||||
viewer = "Viewer"
|
||||
|
||||
[workspace]
|
||||
title = "Workspace"
|
||||
|
||||
|
||||
Executable
+108
@@ -0,0 +1,108 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build a universal (arm64 + x86_64) JRE bundle for the macOS Tauri app.
|
||||
#
|
||||
# jlink can only emit a single-architecture runtime, but the Tauri shell is
|
||||
# universal-apple-darwin. Without this merge the bundled JRE would only run
|
||||
# on whichever arch the runner used. We jlink twice (once per target JDK's
|
||||
# jmods) and lipo-fatten every Mach-O file in the result.
|
||||
#
|
||||
# Inputs (env):
|
||||
# AARCH64_JAVA_HOME path to an aarch64 JDK with jmods/
|
||||
# X64_JAVA_HOME path to an x86_64 JDK with jmods/
|
||||
# JLINK_MODULES comma-separated module list (matches desktop.yml)
|
||||
# OUTPUT_DIR target directory (will be wiped); defaults to
|
||||
# frontend/src-tauri/runtime/jre
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
: "${AARCH64_JAVA_HOME:?AARCH64_JAVA_HOME must be set}"
|
||||
: "${X64_JAVA_HOME:?X64_JAVA_HOME must be set}"
|
||||
: "${JLINK_MODULES:?JLINK_MODULES must be set}"
|
||||
|
||||
OUTPUT_DIR="${OUTPUT_DIR:-frontend/src-tauri/runtime/jre}"
|
||||
|
||||
if [[ "$(uname -s)" != "Darwin" ]]; then
|
||||
echo "build-universal-mac-jre.sh only runs on macOS" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# x86_64 jlink runs under Rosetta on Apple Silicon. If Rosetta isn't
|
||||
# installed the failure mode is a cryptic "Bad CPU type" from exec, so
|
||||
# fail loudly up front when running on arm64 without it.
|
||||
if [[ "$(uname -m)" == "arm64" ]] && ! arch -x86_64 /usr/bin/true >/dev/null 2>&1; then
|
||||
echo "Rosetta 2 is required to run x86_64 jlink on Apple Silicon. Install with: softwareupdate --install-rosetta --agree-to-license" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
WORK_DIR="$(mktemp -d -t universal-jre)"
|
||||
trap 'rm -rf "$WORK_DIR"' EXIT INT TERM
|
||||
|
||||
ARM_JRE="$WORK_DIR/jre-aarch64"
|
||||
X64_JRE="$WORK_DIR/jre-x86_64"
|
||||
|
||||
# Each jlink invocation must run on the native arch of its JDK: jlink
|
||||
# stamps out launcher executables (bin/java, bin/rmiregistry, etc.)
|
||||
# matching the host binary, regardless of --module-path. So we run the
|
||||
# arm64 jlink for the arm64 JRE and the x86_64 jlink for the x86_64
|
||||
# JRE.
|
||||
run_jlink() {
|
||||
local java_home="$1"
|
||||
local out="$2"
|
||||
"$java_home/bin/jlink" \
|
||||
--module-path "$java_home/jmods" \
|
||||
--add-modules "$JLINK_MODULES" \
|
||||
--strip-debug \
|
||||
--compress=zip-6 \
|
||||
--no-header-files \
|
||||
--no-man-pages \
|
||||
--output "$out"
|
||||
}
|
||||
|
||||
echo "Building aarch64 JRE from $AARCH64_JAVA_HOME"
|
||||
run_jlink "$AARCH64_JAVA_HOME" "$ARM_JRE"
|
||||
|
||||
echo "Building x86_64 JRE from $X64_JAVA_HOME (runs under Rosetta on Apple Silicon)"
|
||||
run_jlink "$X64_JAVA_HOME" "$X64_JRE"
|
||||
|
||||
rm -rf "$OUTPUT_DIR"
|
||||
mkdir -p "$(dirname "$OUTPUT_DIR")"
|
||||
cp -R "$ARM_JRE" "$OUTPUT_DIR"
|
||||
|
||||
# Replace every Mach-O file in the copied tree with a fat binary.
|
||||
# Files that aren't Mach-O (text, modules archive, etc.) are left as-is.
|
||||
merged=0
|
||||
skipped=0
|
||||
while IFS= read -r -d '' arm_file; do
|
||||
rel="${arm_file#"$ARM_JRE"/}"
|
||||
x64_file="$X64_JRE/$rel"
|
||||
out_file="$OUTPUT_DIR/$rel"
|
||||
|
||||
if [[ ! -f "$x64_file" ]]; then
|
||||
skipped=$((skipped + 1))
|
||||
continue
|
||||
fi
|
||||
|
||||
if ! file "$arm_file" | grep -q "Mach-O"; then
|
||||
continue
|
||||
fi
|
||||
|
||||
lipo -create "$arm_file" "$x64_file" -output "$out_file"
|
||||
merged=$((merged + 1))
|
||||
done < <(find "$ARM_JRE" -type f -print0)
|
||||
|
||||
echo "Universal JRE written to $OUTPUT_DIR (merged $merged Mach-O files, skipped $skipped arm-only files)"
|
||||
|
||||
if [[ "$merged" -eq 0 ]]; then
|
||||
echo "Refusing to ship a JRE with zero merged Mach-O binaries" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Sanity-check: the launcher must be a fat binary or the app crashes on the
|
||||
# arch we didn't lipo for. `lipo -archs` prints just the arch names space-
|
||||
# separated (avoiding fragile grep alternation across BSD/GNU grep).
|
||||
java_archs="$(lipo -archs "$OUTPUT_DIR/bin/java" 2>/dev/null || true)"
|
||||
if [[ "$java_archs" != *arm64* || "$java_archs" != *x86_64* ]]; then
|
||||
echo "bin/java is not a universal binary (archs: ${java_archs:-unknown})" >&2
|
||||
lipo -info "$OUTPUT_DIR/bin/java" >&2
|
||||
exit 1
|
||||
fi
|
||||
Generated
+301
-129
@@ -265,6 +265,21 @@ version = "0.22.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
|
||||
|
||||
[[package]]
|
||||
name = "bit-set"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3"
|
||||
dependencies = [
|
||||
"bit-vec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bit-vec"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7"
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "1.3.2"
|
||||
@@ -633,24 +648,6 @@ dependencies = [
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cookie_store"
|
||||
version = "0.21.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2eac901828f88a5241ee0600950ab981148a18f2f756900ffba1b125ca6a3ef9"
|
||||
dependencies = [
|
||||
"cookie",
|
||||
"document-features",
|
||||
"idna",
|
||||
"log",
|
||||
"publicsuffix",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"serde_json",
|
||||
"time",
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cookie_store"
|
||||
version = "0.22.1"
|
||||
@@ -697,9 +694,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
|
||||
|
||||
[[package]]
|
||||
name = "core-graphics"
|
||||
version = "0.24.0"
|
||||
version = "0.25.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1"
|
||||
checksum = "064badf302c3194842cf2c5d61f56cc88e54a759313879cdf03abdd27d0c3b97"
|
||||
dependencies = [
|
||||
"bitflags 2.11.0",
|
||||
"core-foundation 0.10.1",
|
||||
@@ -812,6 +809,19 @@ dependencies = [
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cssparser"
|
||||
version = "0.36.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dae61cf9c0abb83bd659dab65b7e4e38d8236824c85f0f804f173567bda257d2"
|
||||
dependencies = [
|
||||
"cssparser-macros",
|
||||
"dtoa-short",
|
||||
"itoa",
|
||||
"phf 0.13.1",
|
||||
"smallvec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cssparser-macros"
|
||||
version = "0.6.1"
|
||||
@@ -824,14 +834,20 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ctor"
|
||||
version = "0.2.9"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501"
|
||||
checksum = "352d39c2f7bef1d6ad73db6f5160efcaed66d94ef8c6c573a8410c00bf909a98"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn 2.0.117",
|
||||
"ctor-proc-macro",
|
||||
"dtor",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ctor-proc-macro"
|
||||
version = "0.0.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "52560adf09603e58c9a7ee1fe1dcb95a16927b17c127f0ac02d6e768a0e25bc1"
|
||||
|
||||
[[package]]
|
||||
name = "darling"
|
||||
version = "0.21.3"
|
||||
@@ -896,6 +912,27 @@ dependencies = [
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "derive_more"
|
||||
version = "2.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134"
|
||||
dependencies = [
|
||||
"derive_more-impl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "derive_more-impl"
|
||||
version = "2.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"rustc_version",
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "digest"
|
||||
version = "0.10.7"
|
||||
@@ -935,15 +972,9 @@ dependencies = [
|
||||
"libc",
|
||||
"option-ext",
|
||||
"redox_users",
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dispatch"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b"
|
||||
|
||||
[[package]]
|
||||
name = "dispatch2"
|
||||
version = "0.3.1"
|
||||
@@ -1008,6 +1039,21 @@ dependencies = [
|
||||
"litrs",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dom_query"
|
||||
version = "0.27.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "521e380c0c8afb8d9a1e83a1822ee03556fc3e3e7dbc1fd30be14e37f9cb3f89"
|
||||
dependencies = [
|
||||
"bit-set",
|
||||
"cssparser 0.36.0",
|
||||
"foldhash 0.2.0",
|
||||
"html5ever 0.38.0",
|
||||
"precomputed-hash",
|
||||
"selectors 0.36.1",
|
||||
"tendril 0.5.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dpi"
|
||||
version = "0.1.2"
|
||||
@@ -1032,6 +1078,21 @@ dependencies = [
|
||||
"dtoa",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dtor"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f1057d6c64987086ff8ed0fd3fbf377a6b7d205cc7715868cd401705f715cbe4"
|
||||
dependencies = [
|
||||
"dtor-proc-macro",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dtor-proc-macro"
|
||||
version = "0.0.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f678cf4a922c215c63e0de95eb1ff08a958a81d47e485cf9da1e27bf6305cfa5"
|
||||
|
||||
[[package]]
|
||||
name = "dunce"
|
||||
version = "1.0.5"
|
||||
@@ -1134,7 +1195,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1220,6 +1281,12 @@ version = "0.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
|
||||
|
||||
[[package]]
|
||||
name = "foldhash"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
|
||||
|
||||
[[package]]
|
||||
name = "foreign-types"
|
||||
version = "0.5.0"
|
||||
@@ -1713,7 +1780,7 @@ version = "0.15.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
|
||||
dependencies = [
|
||||
"foldhash",
|
||||
"foldhash 0.1.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1754,10 +1821,20 @@ checksum = "3b7410cae13cbc75623c98ac4cbfd1f0bedddf3227afc24f370cf0f50a44a11c"
|
||||
dependencies = [
|
||||
"log",
|
||||
"mac",
|
||||
"markup5ever",
|
||||
"markup5ever 0.14.1",
|
||||
"match_token",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "html5ever"
|
||||
version = "0.38.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1054432bae2f14e0061e33d23402fbaa67a921d319d56adc6bcf887ddad1cbc2"
|
||||
dependencies = [
|
||||
"log",
|
||||
"markup5ever 0.38.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "http"
|
||||
version = "1.4.0"
|
||||
@@ -1889,7 +1966,7 @@ dependencies = [
|
||||
"js-sys",
|
||||
"log",
|
||||
"wasm-bindgen",
|
||||
"windows-core 0.62.2",
|
||||
"windows-core 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2206,18 +2283,12 @@ version = "0.8.8-speedreader"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "02cb977175687f33fa4afa0c95c112b987ea1443e5a51c8f8ff27dc618270cc2"
|
||||
dependencies = [
|
||||
"cssparser",
|
||||
"html5ever",
|
||||
"cssparser 0.29.6",
|
||||
"html5ever 0.29.1",
|
||||
"indexmap 2.13.0",
|
||||
"selectors",
|
||||
"selectors 0.24.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lazy_static"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
|
||||
|
||||
[[package]]
|
||||
name = "leb128fmt"
|
||||
version = "0.1.0"
|
||||
@@ -2342,9 +2413,20 @@ dependencies = [
|
||||
"log",
|
||||
"phf 0.11.3",
|
||||
"phf_codegen 0.11.3",
|
||||
"string_cache",
|
||||
"string_cache_codegen",
|
||||
"tendril",
|
||||
"string_cache 0.8.9",
|
||||
"string_cache_codegen 0.5.4",
|
||||
"tendril 0.4.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "markup5ever"
|
||||
version = "0.38.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8983d30f2915feeaaab2d6babdd6bc7e9ed1a00b66b5e6d74df19aa9c0e91862"
|
||||
dependencies = [
|
||||
"log",
|
||||
"tendril 0.5.0",
|
||||
"web_atoms",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2680,16 +2762,6 @@ dependencies = [
|
||||
"objc2-core-foundation",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc2-javascript-core"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2a1e6550c4caed348956ce3370c9ffeca70bb1dbed4fa96112e7c6170e074586"
|
||||
dependencies = [
|
||||
"objc2",
|
||||
"objc2-core-foundation",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc2-pdf-kit"
|
||||
version = "0.3.2"
|
||||
@@ -2716,17 +2788,6 @@ dependencies = [
|
||||
"objc2-foundation",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc2-security"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "709fe137109bd1e8b5a99390f77a7d8b2961dafc1a1c5db8f2e60329ad6d895a"
|
||||
dependencies = [
|
||||
"bitflags 2.11.0",
|
||||
"objc2",
|
||||
"objc2-core-foundation",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc2-ui-kit"
|
||||
version = "0.3.2"
|
||||
@@ -2751,8 +2812,6 @@ dependencies = [
|
||||
"objc2-app-kit",
|
||||
"objc2-core-foundation",
|
||||
"objc2-foundation",
|
||||
"objc2-javascript-core",
|
||||
"objc2-security",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2812,7 +2871,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2911,6 +2970,17 @@ dependencies = [
|
||||
"phf_shared 0.11.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf"
|
||||
version = "0.13.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf"
|
||||
dependencies = [
|
||||
"phf_macros 0.13.1",
|
||||
"phf_shared 0.13.1",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf_codegen"
|
||||
version = "0.8.0"
|
||||
@@ -2931,6 +3001,16 @@ dependencies = [
|
||||
"phf_shared 0.11.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf_codegen"
|
||||
version = "0.13.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1"
|
||||
dependencies = [
|
||||
"phf_generator 0.13.1",
|
||||
"phf_shared 0.13.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf_generator"
|
||||
version = "0.8.0"
|
||||
@@ -2961,6 +3041,16 @@ dependencies = [
|
||||
"rand 0.8.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf_generator"
|
||||
version = "0.13.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737"
|
||||
dependencies = [
|
||||
"fastrand",
|
||||
"phf_shared 0.13.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf_macros"
|
||||
version = "0.10.0"
|
||||
@@ -2988,6 +3078,19 @@ dependencies = [
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf_macros"
|
||||
version = "0.13.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef"
|
||||
dependencies = [
|
||||
"phf_generator 0.13.1",
|
||||
"phf_shared 0.13.1",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf_shared"
|
||||
version = "0.8.0"
|
||||
@@ -3015,6 +3118,15 @@ dependencies = [
|
||||
"siphasher 1.0.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf_shared"
|
||||
version = "0.13.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266"
|
||||
dependencies = [
|
||||
"siphasher 1.0.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pin-project-lite"
|
||||
version = "0.2.17"
|
||||
@@ -3525,7 +3637,7 @@ dependencies = [
|
||||
"base64 0.22.1",
|
||||
"bytes",
|
||||
"cookie",
|
||||
"cookie_store 0.22.1",
|
||||
"cookie_store",
|
||||
"encoding_rs",
|
||||
"futures-core",
|
||||
"h2",
|
||||
@@ -3712,7 +3824,7 @@ dependencies = [
|
||||
"errno",
|
||||
"libc",
|
||||
"linux-raw-sys",
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3898,14 +4010,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0c37578180969d00692904465fb7f6b3d50b9a2b952b87c23d0e2e5cb5013416"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"cssparser",
|
||||
"derive_more",
|
||||
"cssparser 0.29.6",
|
||||
"derive_more 0.99.20",
|
||||
"fxhash",
|
||||
"log",
|
||||
"phf 0.8.0",
|
||||
"phf_codegen 0.8.0",
|
||||
"precomputed-hash",
|
||||
"servo_arc",
|
||||
"servo_arc 0.2.0",
|
||||
"smallvec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "selectors"
|
||||
version = "0.36.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c5d9c0c92a92d33f08817311cf3f2c29a3538a8240e94a6a3c622ce652d7e00c"
|
||||
dependencies = [
|
||||
"bitflags 2.11.0",
|
||||
"cssparser 0.36.0",
|
||||
"derive_more 2.1.1",
|
||||
"log",
|
||||
"new_debug_unreachable",
|
||||
"phf 0.13.1",
|
||||
"phf_codegen 0.13.1",
|
||||
"precomputed-hash",
|
||||
"rustc-hash",
|
||||
"servo_arc 0.4.3",
|
||||
"smallvec",
|
||||
]
|
||||
|
||||
@@ -4089,6 +4220,15 @@ dependencies = [
|
||||
"stable_deref_trait",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "servo_arc"
|
||||
version = "0.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "170fb83ab34de17dc69aa7c67482b22218ddb85da56546f9bd6b929e32a05930"
|
||||
dependencies = [
|
||||
"stable_deref_trait",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sha2"
|
||||
version = "0.10.9"
|
||||
@@ -4310,6 +4450,18 @@ dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "string_cache"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901"
|
||||
dependencies = [
|
||||
"new_debug_unreachable",
|
||||
"parking_lot",
|
||||
"phf_shared 0.13.1",
|
||||
"precomputed-hash",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "string_cache_codegen"
|
||||
version = "0.5.4"
|
||||
@@ -4322,6 +4474,18 @@ dependencies = [
|
||||
"quote",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "string_cache_codegen"
|
||||
version = "0.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69"
|
||||
dependencies = [
|
||||
"phf_generator 0.13.1",
|
||||
"phf_shared 0.13.1",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "strsim"
|
||||
version = "0.11.1"
|
||||
@@ -4423,23 +4587,22 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tao"
|
||||
version = "0.34.5"
|
||||
version = "0.34.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f3a753bdc39c07b192151523a3f77cd0394aa75413802c883a0f6f6a0e5ee2e7"
|
||||
checksum = "9103edf55f2da3c82aea4c7fab7c4241032bfeea0e71fa557d98e00e7ce7cc20"
|
||||
dependencies = [
|
||||
"bitflags 2.11.0",
|
||||
"block2",
|
||||
"core-foundation 0.10.1",
|
||||
"core-graphics",
|
||||
"crossbeam-channel",
|
||||
"dispatch",
|
||||
"dispatch2",
|
||||
"dlopen2",
|
||||
"dpi",
|
||||
"gdkwayland-sys",
|
||||
"gdkx11-sys",
|
||||
"gtk",
|
||||
"jni",
|
||||
"lazy_static",
|
||||
"libc",
|
||||
"log",
|
||||
"ndk",
|
||||
@@ -4451,7 +4614,6 @@ dependencies = [
|
||||
"once_cell",
|
||||
"parking_lot",
|
||||
"raw-window-handle",
|
||||
"scopeguard",
|
||||
"tao-macros",
|
||||
"unicode-segmentation",
|
||||
"url",
|
||||
@@ -4486,9 +4648,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
|
||||
|
||||
[[package]]
|
||||
name = "tauri"
|
||||
version = "2.10.2"
|
||||
version = "2.10.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "463ae8677aa6d0f063a900b9c41ecd4ac2b7ca82f0b058cc4491540e55b20129"
|
||||
checksum = "da77cc00fb9028caf5b5d4650f75e31f1ef3693459dfca7f7e506d1ecef0ba2d"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bytes",
|
||||
@@ -4537,9 +4699,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-build"
|
||||
version = "2.5.5"
|
||||
version = "2.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ca7bd893329425df750813e95bd2b643d5369d929438da96d5bbb7cc2c918f74"
|
||||
checksum = "be9aa8c59a894f76c29a002501c589de5eb4987a5913d62a6e0a47f320901988"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"cargo_toml",
|
||||
@@ -4553,15 +4715,14 @@ dependencies = [
|
||||
"serde_json",
|
||||
"tauri-utils",
|
||||
"tauri-winres",
|
||||
"toml 0.9.12+spec-1.1.0",
|
||||
"walkdir",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-codegen"
|
||||
version = "2.5.4"
|
||||
version = "2.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "aac423e5859d9f9ccdd32e3cf6a5866a15bedbf25aa6630bcb2acde9468f6ae3"
|
||||
checksum = "d3e4e8230d565106aa19dfbaa01a7ed01abf78047fe0577a83377224bd1bf20e"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"brotli",
|
||||
@@ -4586,9 +4747,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-macros"
|
||||
version = "2.5.4"
|
||||
version = "2.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1b6a1bd2861ff0c8766b1d38b32a6a410f6dc6532d4ef534c47cfb2236092f59"
|
||||
checksum = "bc8de2cddbbc33dbdf4c84f170121886595efdbcc9cb4b3d76342b79d082cedc"
|
||||
dependencies = [
|
||||
"heck 0.5.0",
|
||||
"proc-macro2",
|
||||
@@ -4617,9 +4778,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-deep-link"
|
||||
version = "2.4.7"
|
||||
version = "2.4.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "94deb2e2e4641514ac496db2cddcfc850d6fc9d51ea17b82292a0490bd20ba5b"
|
||||
checksum = "70ee75bc5627f77bfdf40c913255ebc258117b10ebe2b2239a1a1cf40b0b58aa"
|
||||
dependencies = [
|
||||
"dunce",
|
||||
"plist",
|
||||
@@ -4638,9 +4799,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-dialog"
|
||||
version = "2.6.0"
|
||||
version = "2.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9204b425d9be8d12aa60c2a83a289cf7d1caae40f57f336ed1155b3a5c0e359b"
|
||||
checksum = "a1fa4150c95ae391946cc8b8f905ab14797427caba3a8a2f79628e956da91809"
|
||||
dependencies = [
|
||||
"log",
|
||||
"raw-window-handle",
|
||||
@@ -4656,13 +4817,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-fs"
|
||||
version = "2.4.5"
|
||||
version = "2.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ed390cc669f937afeb8b28032ce837bac8ea023d975a2e207375ec05afaf1804"
|
||||
checksum = "36e1ec28b79f3d0683f4507e1615c36292c0ea6716668770d4396b9b39871ed8"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"dunce",
|
||||
"glob",
|
||||
"log",
|
||||
"objc2-foundation",
|
||||
"percent-encoding",
|
||||
"schemars 0.8.22",
|
||||
"serde",
|
||||
@@ -4678,12 +4841,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-http"
|
||||
version = "2.5.7"
|
||||
version = "2.5.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d8f069451c4e87e7e2636b7f065a4c52866c4ce5e60e2d53fa1038edb6d184dc"
|
||||
checksum = "cfba7d4ec72763f9d1fdf73c217747f01e2c84b08b87a8cacd2f94f35853f84d"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"cookie_store 0.21.1",
|
||||
"cookie_store",
|
||||
"data-url",
|
||||
"http",
|
||||
"regex",
|
||||
@@ -4786,9 +4949,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-single-instance"
|
||||
version = "2.4.0"
|
||||
version = "2.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dc61e4822b8f74d68278e09161d3e3fdd1b14b9eb781e24edccaabf10c420e8c"
|
||||
checksum = "a33a5b7d78f0dec4406b003ea87c40bf928d801b6fd9323a556172c91d8712c1"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -4833,9 +4996,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-runtime"
|
||||
version = "2.10.0"
|
||||
version = "2.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b885ffeac82b00f1f6fd292b6e5aabfa7435d537cef57d11e38a489956535651"
|
||||
checksum = "2826d79a3297ed08cd6ea7f412644ef58e32969504bc4fbd8d7dbeabc4445ea2"
|
||||
dependencies = [
|
||||
"cookie",
|
||||
"dpi",
|
||||
@@ -4858,9 +5021,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-runtime-wry"
|
||||
version = "2.10.0"
|
||||
version = "2.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5204682391625e867d16584fedc83fc292fb998814c9f7918605c789cd876314"
|
||||
checksum = "e11ea2e6f801d275fdd890d6c9603736012742a1c33b96d0db788c9cdebf7f9e"
|
||||
dependencies = [
|
||||
"gtk",
|
||||
"http",
|
||||
@@ -4868,7 +5031,6 @@ dependencies = [
|
||||
"log",
|
||||
"objc2",
|
||||
"objc2-app-kit",
|
||||
"objc2-foundation",
|
||||
"once_cell",
|
||||
"percent-encoding",
|
||||
"raw-window-handle",
|
||||
@@ -4885,17 +5047,18 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-utils"
|
||||
version = "2.8.2"
|
||||
version = "2.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fcd169fccdff05eff2c1033210b9b94acd07a47e6fa9a3431cf09cfd4f01c87e"
|
||||
checksum = "55f61d2bf7188fbcf2b0ed095b67a6bc498f713c939314bb19eb700118a573b7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"brotli",
|
||||
"cargo_metadata",
|
||||
"ctor",
|
||||
"dom_query",
|
||||
"dunce",
|
||||
"glob",
|
||||
"html5ever",
|
||||
"html5ever 0.29.1",
|
||||
"http",
|
||||
"infer",
|
||||
"json-patch",
|
||||
@@ -4903,6 +5066,7 @@ dependencies = [
|
||||
"log",
|
||||
"memchr",
|
||||
"phf 0.11.3",
|
||||
"plist",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"regex",
|
||||
@@ -4951,10 +5115,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "82a72c767771b47409d2345987fda8628641887d5466101319899796367354a0"
|
||||
dependencies = [
|
||||
"fastrand",
|
||||
"getrandom 0.4.1",
|
||||
"getrandom 0.3.4",
|
||||
"once_cell",
|
||||
"rustix",
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4968,6 +5132,16 @@ dependencies = [
|
||||
"utf-8",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tendril"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c4790fc369d5a530f4b544b094e31388b9b3a37c0f4652ade4505945f5660d24"
|
||||
dependencies = [
|
||||
"new_debug_unreachable",
|
||||
"utf-8",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
version = "1.0.69"
|
||||
@@ -5698,6 +5872,18 @@ dependencies = [
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "web_atoms"
|
||||
version = "0.2.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d7cff6eef815df1834fd250e3a2ff436044d82a9f1bc1980ca1dbdf07effc538"
|
||||
dependencies = [
|
||||
"phf 0.13.1",
|
||||
"phf_codegen 0.13.1",
|
||||
"string_cache 0.9.0",
|
||||
"string_cache_codegen 0.6.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "webkit2gtk"
|
||||
version = "2.0.2"
|
||||
@@ -5809,7 +5995,7 @@ version = "0.1.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
|
||||
dependencies = [
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5855,19 +6041,6 @@ dependencies = [
|
||||
"windows-core 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-core"
|
||||
version = "0.61.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3"
|
||||
dependencies = [
|
||||
"windows-implement",
|
||||
"windows-interface",
|
||||
"windows-link 0.1.3",
|
||||
"windows-result 0.3.4",
|
||||
"windows-strings 0.4.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-core"
|
||||
version = "0.62.2"
|
||||
@@ -6367,24 +6540,23 @@ checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9"
|
||||
|
||||
[[package]]
|
||||
name = "wry"
|
||||
version = "0.54.2"
|
||||
version = "0.54.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bb26159b420aa77684589a744ae9a9461a95395b848764ad12290a14d960a11a"
|
||||
checksum = "e5a8135d8676225e5744de000d4dff5a082501bf7db6a1c1495034f8c314edbc"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"block2",
|
||||
"cookie",
|
||||
"crossbeam-channel",
|
||||
"dirs",
|
||||
"dom_query",
|
||||
"dpi",
|
||||
"dunce",
|
||||
"gdkx11",
|
||||
"gtk",
|
||||
"html5ever",
|
||||
"http",
|
||||
"javascriptcore-rs",
|
||||
"jni",
|
||||
"kuchikiki",
|
||||
"libc",
|
||||
"ndk",
|
||||
"objc2",
|
||||
|
||||
@@ -24,13 +24,13 @@ tauri-build = { version = "2.5.3", features = [] }
|
||||
serde_json = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
log = "0.4"
|
||||
tauri = { version = "2.10.1", features = [ "devtools"] }
|
||||
tauri = { version = "2.10.3", features = [ "devtools"] }
|
||||
tauri-plugin-log = "2.8.0"
|
||||
tauri-plugin-shell = "2.3.4"
|
||||
tauri-plugin-fs = "2.4.5"
|
||||
tauri-plugin-dialog = "2.4.2"
|
||||
tauri-plugin-http = { version = "2.5.6", features = ["dangerous-settings"] }
|
||||
tauri-plugin-single-instance = { version = "2.3.7", features = ["deep-link"] }
|
||||
tauri-plugin-fs = "2.5.0"
|
||||
tauri-plugin-dialog = "2.7.0"
|
||||
tauri-plugin-http = { version = "2.5.8", features = ["dangerous-settings"] }
|
||||
tauri-plugin-single-instance = { version = "2.4.1", features = ["deep-link"] }
|
||||
tauri-plugin-store = "2.4.2"
|
||||
tauri-plugin-opener = "2.5.3"
|
||||
tauri-plugin-deep-link = "2.4.6"
|
||||
|
||||
@@ -13,6 +13,7 @@ const STORE_FILE: &str = "connection.json";
|
||||
const USER_INFO_KEY: &str = "user_info";
|
||||
const TOKENS_STORE_FILE: &str = "tokens.json";
|
||||
const REFRESH_TOKEN_STORE_KEY: &str = "refresh_token";
|
||||
const AUTH_TOKEN_STORE_KEY: &str = "auth_token";
|
||||
const KEYRING_SERVICE: &str = "stirling-pdf";
|
||||
const KEYRING_TOKEN_KEY: &str = "auth-token";
|
||||
const KEYRING_REFRESH_TOKEN_KEY: &str = "refresh-token";
|
||||
@@ -40,73 +41,134 @@ fn get_refresh_token_keyring_entry() -> Result<Entry, String> {
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn save_auth_token(_app_handle: AppHandle, token: String) -> Result<(), String> {
|
||||
pub async fn save_auth_token(app_handle: AppHandle, token: String) -> Result<(), String> {
|
||||
let trimmed = token.trim();
|
||||
if trimmed.is_empty() {
|
||||
log::warn!("Attempted to save empty auth token");
|
||||
return Err("Token cannot be empty".to_string());
|
||||
}
|
||||
|
||||
let entry = get_keyring_entry()?;
|
||||
|
||||
if trimmed.len() != token.len() {
|
||||
log::debug!("Auth token had surrounding whitespace; storing trimmed token");
|
||||
}
|
||||
|
||||
entry
|
||||
.set_password(trimmed)
|
||||
.map_err(|e| {
|
||||
log::error!("Failed to set password in keyring: {}", e);
|
||||
format!("Failed to save token to keyring: {}", e)
|
||||
})?;
|
||||
|
||||
// Verify the save worked
|
||||
match entry.get_password() {
|
||||
Ok(retrieved_token) => {
|
||||
if retrieved_token != trimmed {
|
||||
log::error!("Token verification failed: Retrieved token doesn't match");
|
||||
return Err("Token verification failed after save".to_string());
|
||||
// Try keyring first (works in environments where Credential Manager persists writes).
|
||||
// Any failure - including entry creation - falls through to the Tauri Store fallback
|
||||
// below, never an early return, so restricted environments still persist the token.
|
||||
match get_keyring_entry() {
|
||||
Ok(entry) => match entry.set_password(trimmed) {
|
||||
Ok(_) => {
|
||||
// Verify it persists. On managed Win10 Pro environments (GPO restricting
|
||||
// Credential Manager, AV/EDR rules, roaming-profile DPAPI quirks) the
|
||||
// read-back can return the wrong value or NoEntry even when set succeeded.
|
||||
match entry.get_password() {
|
||||
Ok(saved) if saved == trimmed => {
|
||||
// Clear any stale fallback copy so the keyring stays authoritative.
|
||||
if let Ok(store) = app_handle.store(TOKENS_STORE_FILE) {
|
||||
if store.get(AUTH_TOKEN_STORE_KEY).is_some() {
|
||||
store.delete(AUTH_TOKEN_STORE_KEY);
|
||||
let _ = store.save();
|
||||
}
|
||||
}
|
||||
log::info!("Auth token saved to keyring");
|
||||
return Ok(());
|
||||
}
|
||||
_ => {
|
||||
log::info!("Keyring did not persist auth token - using Tauri Store fallback");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
log::info!("Keyring set failed for auth token: {} - using Tauri Store fallback", e);
|
||||
}
|
||||
},
|
||||
Err(e) => {
|
||||
log::error!("Token verification failed: {}", e);
|
||||
return Err(format!("Token verification failed: {}", e));
|
||||
log::info!("Keyring entry unavailable for auth token: {} - using Tauri Store fallback", e);
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback to Tauri Store (same pattern as save_refresh_token)
|
||||
let store = app_handle
|
||||
.store(TOKENS_STORE_FILE)
|
||||
.map_err(|e| format!("Failed to access tokens store: {}", e))?;
|
||||
|
||||
store.set(
|
||||
AUTH_TOKEN_STORE_KEY,
|
||||
serde_json::to_value(trimmed)
|
||||
.map_err(|e| format!("Failed to serialize token: {}", e))?,
|
||||
);
|
||||
|
||||
store
|
||||
.save()
|
||||
.map_err(|e| format!("Failed to save tokens store: {}", e))?;
|
||||
|
||||
log::info!("Auth token saved to Tauri Store (fallback)");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn get_auth_token(_app_handle: AppHandle) -> Result<Option<String>, String> {
|
||||
let entry = get_keyring_entry()?;
|
||||
|
||||
match entry.get_password() {
|
||||
Ok(token) => Ok(Some(token)),
|
||||
Err(keyring::Error::NoEntry) => Ok(None),
|
||||
Err(e) => {
|
||||
log::error!("Failed to retrieve token from keyring: {}", e);
|
||||
Err(format!("Failed to retrieve token: {}", e))
|
||||
pub async fn get_auth_token(app_handle: AppHandle) -> Result<Option<String>, String> {
|
||||
// Try keyring first (production / unrestricted environments). Any failure -
|
||||
// including entry creation - falls through to the Tauri Store fallback below.
|
||||
match get_keyring_entry() {
|
||||
Ok(entry) => match entry.get_password() {
|
||||
Ok(token) => return Ok(Some(token)),
|
||||
Err(keyring::Error::NoEntry) => {
|
||||
log::debug!("No auth token in keyring, trying Tauri Store");
|
||||
}
|
||||
Err(e) => {
|
||||
log::warn!("Keyring error reading auth token: {} - trying Tauri Store", e);
|
||||
}
|
||||
},
|
||||
Err(e) => {
|
||||
log::warn!("Keyring entry unavailable for auth token: {} - trying Tauri Store", e);
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback to Tauri Store
|
||||
let store = app_handle
|
||||
.store(TOKENS_STORE_FILE)
|
||||
.map_err(|e| format!("Failed to access tokens store: {}", e))?;
|
||||
|
||||
let token: Option<String> = store
|
||||
.get(AUTH_TOKEN_STORE_KEY)
|
||||
.and_then(|v| serde_json::from_value(v.clone()).ok());
|
||||
|
||||
Ok(token)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn clear_auth_token(_app_handle: AppHandle) -> Result<(), String> {
|
||||
let entry = get_keyring_entry()?;
|
||||
|
||||
// Delete the token - ignore error if it doesn't exist
|
||||
match entry.delete_credential() {
|
||||
Ok(_) | Err(keyring::Error::NoEntry) => Ok(()),
|
||||
Err(e) => {
|
||||
log::warn!("Failed to delete keyring credential: {}. Attempting overwrite with empty token.", e);
|
||||
// As a fallback, overwrite with an empty token so a stale value cannot be reused
|
||||
match entry.set_password("") {
|
||||
Ok(_) => Ok(()),
|
||||
Err(e2) => Err(format!("Failed to clear token (delete + overwrite failed): {}", e2)),
|
||||
pub async fn clear_auth_token(app_handle: AppHandle) -> Result<(), String> {
|
||||
// Clear from keyring (best-effort). Entry creation failure must not block clearing
|
||||
// the disk fallback, otherwise a stale fallback token could survive sign-out.
|
||||
match get_keyring_entry() {
|
||||
Ok(entry) => match entry.delete_credential() {
|
||||
Ok(_) | Err(keyring::Error::NoEntry) => {}
|
||||
Err(e) => {
|
||||
log::warn!("Failed to delete keyring credential: {}. Attempting overwrite with empty token.", e);
|
||||
// Overwrite with an empty token so a stale value cannot be reused
|
||||
if let Err(e2) = entry.set_password("") {
|
||||
log::warn!("Failed to overwrite keyring auth token: {}", e2);
|
||||
}
|
||||
}
|
||||
},
|
||||
Err(e) => {
|
||||
log::warn!("Keyring entry unavailable while clearing auth token: {} - clearing Tauri Store fallback only", e);
|
||||
}
|
||||
}
|
||||
|
||||
// Clear from Tauri Store fallback
|
||||
let store = app_handle
|
||||
.store(TOKENS_STORE_FILE)
|
||||
.map_err(|e| format!("Failed to access tokens store: {}", e))?;
|
||||
|
||||
store.delete(AUTH_TOKEN_STORE_KEY);
|
||||
|
||||
store
|
||||
.save()
|
||||
.map_err(|e| format!("Failed to save tokens store: {}", e))?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||
"productName": "Stirling-PDF",
|
||||
"version": "2.10.0",
|
||||
"version": "2.10.1",
|
||||
"identifier": "stirling.pdf.dev",
|
||||
"build": {
|
||||
"frontendDist": "../dist",
|
||||
|
||||
@@ -16,8 +16,7 @@ export function AppLayout({ children }: AppLayoutProps) {
|
||||
return (
|
||||
<>
|
||||
<style>{`
|
||||
.h-screen,
|
||||
.right-rail {
|
||||
.h-screen {
|
||||
height: 100% !important;
|
||||
}
|
||||
`}</style>
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
AppConfigRetryOptions,
|
||||
useAppConfig,
|
||||
} from "@app/contexts/AppConfigContext";
|
||||
import { RightRailProvider } from "@app/contexts/RightRailContext";
|
||||
import { WorkbenchBarProvider } from "@app/contexts/WorkbenchBarContext";
|
||||
import { ViewerProvider } from "@app/contexts/ViewerContext";
|
||||
import { SignatureProvider } from "@app/contexts/SignatureContext";
|
||||
import { AnnotationProvider } from "@app/contexts/AnnotationContext";
|
||||
@@ -139,13 +139,13 @@ export function AppProviders({
|
||||
<RedactionProvider>
|
||||
<FormFillProvider>
|
||||
<AnnotationProvider>
|
||||
<RightRailProvider>
|
||||
<WorkbenchBarProvider>
|
||||
<TourOrchestrationProvider>
|
||||
<AdminTourOrchestrationProvider>
|
||||
{children}
|
||||
</AdminTourOrchestrationProvider>
|
||||
</TourOrchestrationProvider>
|
||||
</RightRailProvider>
|
||||
</WorkbenchBarProvider>
|
||||
</AnnotationProvider>
|
||||
</FormFillProvider>
|
||||
</RedactionProvider>
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
import React from "react";
|
||||
import { describe, expect, test } from "vitest";
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import { MantineProvider } from "@mantine/core";
|
||||
import FileEditorFileName from "@app/components/fileEditor/FileEditorFileName";
|
||||
import type { StirlingFileStub } from "@app/types/fileContext";
|
||||
import type { FileId } from "@app/types/file";
|
||||
|
||||
const buildFileStub = (
|
||||
overrides: Partial<StirlingFileStub> = {},
|
||||
): StirlingFileStub => ({
|
||||
id: "file-1" as FileId,
|
||||
name: "report.pdf",
|
||||
type: "application/pdf",
|
||||
size: 1024,
|
||||
lastModified: 0,
|
||||
isLeaf: true,
|
||||
originalFileId: "file-1",
|
||||
versionNumber: 1,
|
||||
...overrides,
|
||||
});
|
||||
|
||||
const renderName = (file: StirlingFileStub) =>
|
||||
render(
|
||||
<MantineProvider>
|
||||
<FileEditorFileName file={file} />
|
||||
</MantineProvider>,
|
||||
);
|
||||
|
||||
describe("FileEditorFileName (core / web)", () => {
|
||||
test.each([
|
||||
{ name: "not-saved", file: buildFileStub() },
|
||||
{
|
||||
name: "dirty",
|
||||
file: buildFileStub({ localFilePath: "/tmp/report.pdf", isDirty: true }),
|
||||
},
|
||||
{
|
||||
name: "saved",
|
||||
file: buildFileStub({ localFilePath: "/tmp/report.pdf", isDirty: false }),
|
||||
},
|
||||
])("does not render a save indicator ($name)", ({ file }) => {
|
||||
renderName(file);
|
||||
|
||||
expect(screen.queryByLabelText("fileNotSavedToDisk")).toBeNull();
|
||||
expect(screen.queryByLabelText("unsavedChanges")).toBeNull();
|
||||
expect(screen.queryByLabelText("fileSavedToDisk")).toBeNull();
|
||||
});
|
||||
|
||||
test("renders the filename", () => {
|
||||
renderName(buildFileStub({ name: "invoice.pdf" }));
|
||||
expect(screen.getByText("invoice.pdf")).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
@@ -1,13 +1,18 @@
|
||||
import React from "react";
|
||||
import { StirlingFileStub } from "@app/types/fileContext";
|
||||
import { PrivateContent } from "@app/components/shared/PrivateContent";
|
||||
import { truncateCenter } from "@app/utils/textUtils";
|
||||
|
||||
interface FileEditorFileNameProps {
|
||||
file: StirlingFileStub;
|
||||
maxLength?: number;
|
||||
}
|
||||
|
||||
const FileEditorFileName = ({ file }: FileEditorFileNameProps) => (
|
||||
<PrivateContent>{file.name}</PrivateContent>
|
||||
const FileEditorFileName = ({
|
||||
file,
|
||||
maxLength = 40,
|
||||
}: FileEditorFileNameProps) => (
|
||||
<PrivateContent>{truncateCenter(file.name, maxLength)}</PrivateContent>
|
||||
);
|
||||
|
||||
export default FileEditorFileName;
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import { StirlingFileStub } from "@app/types/fileContext";
|
||||
|
||||
interface FileEditorStatusDotProps {
|
||||
file: StirlingFileStub;
|
||||
}
|
||||
|
||||
export function FileEditorStatusDot(_props: FileEditorStatusDotProps) {
|
||||
return null;
|
||||
}
|
||||
@@ -33,6 +33,7 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
@@ -80,11 +81,6 @@
|
||||
transform 0.2s ease;
|
||||
}
|
||||
|
||||
.thumbContainer[data-supported="false"] {
|
||||
filter: grayscale(80%);
|
||||
opacity: 0.65;
|
||||
}
|
||||
|
||||
.thumbContainer:hover {
|
||||
transform: translateY(-1px);
|
||||
box-shadow: var(--shadow-lg);
|
||||
@@ -93,7 +89,7 @@
|
||||
.thumbImage {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: fill;
|
||||
object-fit: contain;
|
||||
border-radius: 12px;
|
||||
background: var(--bg-surface);
|
||||
display: block;
|
||||
@@ -200,6 +196,26 @@
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.thumbBadgesRight {
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
right: 6px;
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
align-items: center;
|
||||
z-index: 3;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.statusDot {
|
||||
display: inline-block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
flex-shrink: 0;
|
||||
box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.ownershipBadge {
|
||||
background: var(--mantine-color-blue-6);
|
||||
color: white;
|
||||
|
||||
@@ -5,7 +5,6 @@ import {
|
||||
Button,
|
||||
Group,
|
||||
Stack,
|
||||
Loader,
|
||||
ActionIcon,
|
||||
Tooltip,
|
||||
} from "@mantine/core";
|
||||
@@ -42,7 +41,10 @@ import { PrivateContent } from "@app/components/shared/PrivateContent";
|
||||
import UploadToServerModal from "@app/components/shared/UploadToServerModal";
|
||||
import ShareFileModal from "@app/components/shared/ShareFileModal";
|
||||
import { useAppConfig } from "@app/contexts/AppConfigContext";
|
||||
import { useFileThumbnail } from "@app/hooks/useFileThumbnail";
|
||||
import DocumentThumbnail from "@app/components/shared/filePreview/DocumentThumbnail";
|
||||
import { truncateCenter } from "@app/utils/textUtils";
|
||||
import { FileEditorStatusDot } from "@app/components/fileEditor/FileEditorStatusDot";
|
||||
|
||||
interface FileEditorThumbnailProps {
|
||||
file: StirlingFileStub;
|
||||
@@ -96,7 +98,11 @@ const FileEditorThumbnail = ({
|
||||
|
||||
const hasError = state.ui.errorFileIds.includes(file.id);
|
||||
const pageCount = file.processedFile?.totalPages || 0;
|
||||
const isEncrypted = Boolean(file.processedFile?.isEncrypted);
|
||||
const {
|
||||
isEncrypted,
|
||||
thumbnail: displayThumbnail,
|
||||
isGenerating: isThumbGenerating,
|
||||
} = useFileThumbnail(file);
|
||||
|
||||
// Aspect ratio from page dimensions, falling back to letter size
|
||||
const firstPage = file.processedFile?.pages?.[0];
|
||||
@@ -298,6 +304,7 @@ const FileEditorThumbnail = ({
|
||||
label: isPinned
|
||||
? t("unpin", "Unpin File (replace after tool run)")
|
||||
: t("pin", "Pin File (keep active after tool run)"),
|
||||
dataTour: "file-card-pin",
|
||||
onClick: (e) => {
|
||||
e.stopPropagation();
|
||||
if (actualFile) {
|
||||
@@ -481,35 +488,25 @@ const FileEditorThumbnail = ({
|
||||
)}
|
||||
|
||||
{/* Thumbnail image or loading state */}
|
||||
{file.thumbnailUrl ? (
|
||||
<PrivateContent>
|
||||
<img
|
||||
src={file.thumbnailUrl}
|
||||
alt={file.name}
|
||||
className={styles.thumbImage}
|
||||
draggable={false}
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
onError={(e) => {
|
||||
e.currentTarget.style.display = "none";
|
||||
}}
|
||||
/>
|
||||
</PrivateContent>
|
||||
) : file.type?.startsWith("application/pdf") ? (
|
||||
<Stack
|
||||
align="center"
|
||||
justify="center"
|
||||
gap="xs"
|
||||
style={{ height: "100%" }}
|
||||
>
|
||||
<Loader size="sm" />
|
||||
<Text size="xs" c="dimmed">
|
||||
Loading thumbnail...
|
||||
</Text>
|
||||
</Stack>
|
||||
) : null}
|
||||
<DocumentThumbnail
|
||||
file={file}
|
||||
thumbnail={displayThumbnail || undefined}
|
||||
isEncrypted={isEncrypted}
|
||||
isLoading={
|
||||
!isEncrypted &&
|
||||
!displayThumbnail &&
|
||||
(isThumbGenerating ||
|
||||
file.type?.startsWith("application/pdf") ||
|
||||
file.type?.startsWith("image/"))
|
||||
}
|
||||
iconSize="6rem"
|
||||
imgClassName={styles.thumbImage}
|
||||
onImageError={(e) => {
|
||||
e.currentTarget.style.display = "none";
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Badges — visible on hover via CSS */}
|
||||
{/* Badges — top-left: version, pin, ownership, encrypted */}
|
||||
<div className={styles.thumbBadges}>
|
||||
<span className={styles.versionBadgeThumb}>
|
||||
v{file.versionNumber}
|
||||
@@ -546,6 +543,8 @@ const FileEditorThumbnail = ({
|
||||
</Tooltip>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<FileEditorStatusDot file={file} />
|
||||
</div>
|
||||
</div>
|
||||
{/* end thumbUnit */}
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
import { useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {
|
||||
useRightRailButtons,
|
||||
RightRailButtonWithAction,
|
||||
} from "@app/hooks/useRightRailButtons";
|
||||
import LocalIcon from "@app/components/shared/LocalIcon";
|
||||
|
||||
interface FileEditorRightRailButtonsParams {
|
||||
totalItems: number;
|
||||
selectedCount: number;
|
||||
onSelectAll: () => void;
|
||||
onDeselectAll: () => void;
|
||||
onCloseSelected: () => void;
|
||||
}
|
||||
|
||||
export function useFileEditorRightRailButtons({
|
||||
totalItems,
|
||||
selectedCount,
|
||||
onSelectAll,
|
||||
onDeselectAll,
|
||||
onCloseSelected,
|
||||
}: FileEditorRightRailButtonsParams) {
|
||||
const { t, i18n } = useTranslation();
|
||||
|
||||
const buttons = useMemo<RightRailButtonWithAction[]>(
|
||||
() => [
|
||||
{
|
||||
id: "file-select-all",
|
||||
icon: <LocalIcon icon="select-all" width="1.5rem" height="1.5rem" />,
|
||||
tooltip: t("rightRail.selectAll", "Select All"),
|
||||
ariaLabel:
|
||||
typeof t === "function"
|
||||
? t("rightRail.selectAll", "Select All")
|
||||
: "Select All",
|
||||
section: "top" as const,
|
||||
order: 10,
|
||||
disabled: totalItems === 0 || selectedCount === totalItems,
|
||||
visible: totalItems > 0,
|
||||
onClick: onSelectAll,
|
||||
},
|
||||
{
|
||||
id: "file-deselect-all",
|
||||
icon: (
|
||||
<LocalIcon
|
||||
icon="crop-square-outline"
|
||||
width="1.5rem"
|
||||
height="1.5rem"
|
||||
/>
|
||||
),
|
||||
tooltip: t("rightRail.deselectAll", "Deselect All"),
|
||||
ariaLabel:
|
||||
typeof t === "function"
|
||||
? t("rightRail.deselectAll", "Deselect All")
|
||||
: "Deselect All",
|
||||
section: "top" as const,
|
||||
order: 20,
|
||||
disabled: selectedCount === 0,
|
||||
visible: totalItems > 0,
|
||||
onClick: onDeselectAll,
|
||||
},
|
||||
{
|
||||
id: "file-close-selected",
|
||||
icon: <LocalIcon icon="close-rounded" width="1.5rem" height="1.5rem" />,
|
||||
tooltip: t("rightRail.closeSelected", "Close Selected Files"),
|
||||
ariaLabel:
|
||||
typeof t === "function"
|
||||
? t("rightRail.closeSelected", "Close Selected Files")
|
||||
: "Close Selected Files",
|
||||
section: "top" as const,
|
||||
order: 30,
|
||||
disabled: selectedCount === 0,
|
||||
visible: totalItems > 0,
|
||||
onClick: onCloseSelected,
|
||||
},
|
||||
],
|
||||
[
|
||||
t,
|
||||
i18n.language,
|
||||
totalItems,
|
||||
selectedCount,
|
||||
onSelectAll,
|
||||
onDeselectAll,
|
||||
onCloseSelected,
|
||||
],
|
||||
);
|
||||
|
||||
useRightRailButtons(buttons);
|
||||
}
|
||||
@@ -11,7 +11,6 @@ interface FileHistoryGroupProps {
|
||||
onDownloadSingle: (file: StirlingFileStub) => void;
|
||||
onFileDoubleClick: (file: StirlingFileStub) => void;
|
||||
onHistoryFileRemove: (file: StirlingFileStub) => void;
|
||||
isFileSupported: (fileName: string) => boolean;
|
||||
}
|
||||
|
||||
const FileHistoryGroup: React.FC<FileHistoryGroupProps> = ({
|
||||
@@ -21,7 +20,6 @@ const FileHistoryGroup: React.FC<FileHistoryGroupProps> = ({
|
||||
onDownloadSingle,
|
||||
onFileDoubleClick,
|
||||
onHistoryFileRemove,
|
||||
isFileSupported,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -50,7 +48,6 @@ const FileHistoryGroup: React.FC<FileHistoryGroupProps> = ({
|
||||
key={`history-${historyFile.id}-${historyFile.versionNumber || 1}`}
|
||||
file={historyFile}
|
||||
isSelected={false} // History files are not selectable
|
||||
isSupported={isFileSupported(historyFile.name)}
|
||||
onSelect={() => {}} // No selection for history files
|
||||
onRemove={() => onHistoryFileRemove(historyFile)} // Remove specific history file
|
||||
onDownload={() => onDownloadSingle(historyFile)}
|
||||
|
||||
@@ -28,7 +28,6 @@ const FileListArea: React.FC<FileListAreaProps> = ({
|
||||
onHistoryFileRemove,
|
||||
onFileDoubleClick,
|
||||
onDownloadSingle,
|
||||
isFileSupported,
|
||||
isLoading,
|
||||
activeFileIds,
|
||||
} = useFileManagerContext();
|
||||
@@ -65,7 +64,6 @@ const FileListArea: React.FC<FileListAreaProps> = ({
|
||||
<FileListItem
|
||||
file={file}
|
||||
isSelected={selectedFilesSet.has(file.id)}
|
||||
isSupported={isFileSupported(file.name)}
|
||||
onSelect={(shiftKey) => onFileSelect(file, index, shiftKey)}
|
||||
onRemove={() => onFileRemove(index)}
|
||||
onDownload={() => onDownloadSingle(file)}
|
||||
@@ -82,7 +80,6 @@ const FileListArea: React.FC<FileListAreaProps> = ({
|
||||
onDownloadSingle={onDownloadSingle}
|
||||
onFileDoubleClick={onFileDoubleClick}
|
||||
onHistoryFileRemove={onHistoryFileRemove}
|
||||
isFileSupported={isFileSupported}
|
||||
/>
|
||||
</React.Fragment>
|
||||
);
|
||||
|
||||
@@ -39,7 +39,6 @@ import { alert } from "@app/components/toast";
|
||||
interface FileListItemProps {
|
||||
file: StirlingFileStub;
|
||||
isSelected: boolean;
|
||||
isSupported: boolean;
|
||||
onSelect: (shiftKey?: boolean) => void;
|
||||
onRemove: () => void;
|
||||
onDownload?: () => void;
|
||||
@@ -53,7 +52,6 @@ interface FileListItemProps {
|
||||
const FileListItem: React.FC<FileListItemProps> = ({
|
||||
file,
|
||||
isSelected,
|
||||
isSupported,
|
||||
onSelect,
|
||||
onRemove,
|
||||
onDownload,
|
||||
@@ -192,7 +190,7 @@ const FileListItem: React.FC<FileListItemProps> = ({
|
||||
isSelected || shouldShowHovered
|
||||
? "var(--mantine-color-gray-1)"
|
||||
: "var(--bg-file-list)",
|
||||
opacity: isSupported ? 1 : 0.5,
|
||||
opacity: 1,
|
||||
transition: "background-color 0.15s ease",
|
||||
userSelect: "none",
|
||||
WebkitUserSelect: "none",
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
useNavigationActions,
|
||||
} from "@app/contexts/NavigationContext";
|
||||
import { isBaseWorkbench } from "@app/types/workbench";
|
||||
import { VIEWER_SUPPORTED_EXTENSIONS } from "@app/utils/fileUtils";
|
||||
import { useAppConfig } from "@app/contexts/AppConfigContext";
|
||||
import styles from "@app/components/layout/Workbench.module.css";
|
||||
|
||||
@@ -107,7 +108,9 @@ export default function Workbench() {
|
||||
return (
|
||||
<FileEditor
|
||||
toolMode={!!selectedToolId}
|
||||
supportedExtensions={selectedTool?.supportedFormats || ["pdf"]}
|
||||
supportedExtensions={
|
||||
selectedTool?.supportedFormats || VIEWER_SUPPORTED_EXTENSIONS
|
||||
}
|
||||
{...(!selectedToolId && {
|
||||
onOpenPageEditor: () => {
|
||||
setCurrentView("pageEditor");
|
||||
|
||||
@@ -232,12 +232,15 @@ export default function Onboarding() {
|
||||
loadSampleFile: tourOrch.loadSampleFile,
|
||||
switchToActiveFiles: tourOrch.switchToActiveFiles,
|
||||
pinFile: tourOrch.pinFile,
|
||||
revealFileCardHoverMenu: tourOrch.revealFileCardHoverMenu,
|
||||
modifyCropSettings: tourOrch.modifyCropSettings,
|
||||
executeTool: tourOrch.executeTool,
|
||||
openFilesModal,
|
||||
openSettingsHelpSection: () =>
|
||||
adminTourOrch.navigateToSection("help"),
|
||||
},
|
||||
}),
|
||||
[t, tourOrch, closeFilesModal, openFilesModal],
|
||||
[t, tourOrch, adminTourOrch, closeFilesModal, openFilesModal],
|
||||
);
|
||||
|
||||
const whatsNewStepsConfig = useMemo(
|
||||
@@ -253,7 +256,6 @@ export default function Onboarding() {
|
||||
switchToViewer: tourOrch.switchToViewer,
|
||||
switchToPageEditor: tourOrch.switchToPageEditor,
|
||||
switchToActiveFiles: tourOrch.switchToActiveFiles,
|
||||
selectFirstFile: tourOrch.selectFirstFile,
|
||||
},
|
||||
}),
|
||||
[t, tourOrch, closeFilesModal, openFilesModal],
|
||||
|
||||
@@ -4,6 +4,10 @@ import {
|
||||
addGlowToElements,
|
||||
removeAllGlows,
|
||||
} from "@app/components/onboarding/tourGlow";
|
||||
import {
|
||||
waitForElement,
|
||||
waitForHighlightable,
|
||||
} from "@app/components/onboarding/tourUtils";
|
||||
|
||||
export enum AdminTourStep {
|
||||
WELCOME,
|
||||
@@ -57,7 +61,7 @@ export function createAdminStepsConfig({
|
||||
selector: '[data-tour="config-button"]',
|
||||
content: t(
|
||||
"adminOnboarding.configButton",
|
||||
"Click the <strong>Config</strong> button to access all system settings and administrative controls.",
|
||||
"Open <strong>Settings</strong> to access all system configuration and administrative controls.",
|
||||
),
|
||||
position: "right",
|
||||
padding: 10,
|
||||
@@ -204,15 +208,18 @@ export function createAdminStepsConfig({
|
||||
},
|
||||
},
|
||||
[AdminTourStep.WRAP_UP]: {
|
||||
selector: '[data-tour="help-button"]',
|
||||
selector: '[data-tour="admin-help-nav"]',
|
||||
content: t(
|
||||
"adminOnboarding.wrapUp",
|
||||
"That's the admin tour! You've seen the enterprise features that make Stirling PDF a powerful, customisable solution for organisations. Access this tour anytime from the <strong>Help</strong> menu.",
|
||||
"That's the admin tour! You've seen the enterprise features that make Stirling PDF a powerful, customisable solution for organisations. You can replay it anytime — just open <strong>Settings</strong> and find it here in the <strong>Tours</strong> section under Help.",
|
||||
),
|
||||
position: "right",
|
||||
padding: 10,
|
||||
action: () => {
|
||||
action: async () => {
|
||||
removeAllGlows();
|
||||
navigateToSection("help");
|
||||
await waitForElement('[data-tour="admin-help-nav"]', 5000);
|
||||
await waitForHighlightable('[data-tour="admin-help-nav"]', 5000);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
/**
|
||||
* Waits for a CSS selector to appear in the DOM using MutationObserver.
|
||||
* Resolves immediately if already present; resolves after timeoutMs if it
|
||||
* never appears (no throw — tour steps are best-effort).
|
||||
*/
|
||||
export function waitForElement(
|
||||
selector: string,
|
||||
timeoutMs = 7000,
|
||||
): Promise<void> {
|
||||
return new Promise((resolve) => {
|
||||
if (typeof document === "undefined") {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
if (document.querySelector(selector)) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const observer = new MutationObserver(() => {
|
||||
if (document.querySelector(selector)) {
|
||||
clearTimeout(timer);
|
||||
observer.disconnect();
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
|
||||
const timer = setTimeout(() => {
|
||||
observer.disconnect();
|
||||
resolve();
|
||||
}, timeoutMs);
|
||||
|
||||
observer.observe(document.body, { childList: true, subtree: true });
|
||||
});
|
||||
}
|
||||
|
||||
const nudgeReactour = () => {
|
||||
window.dispatchEvent(new Event("resize"));
|
||||
requestAnimationFrame(() => window.dispatchEvent(new Event("resize")));
|
||||
};
|
||||
|
||||
/**
|
||||
* Waits for a CSS selector to be present AND have a non-zero bounding box,
|
||||
* then nudges Reactour to recalculate its spotlight position.
|
||||
*
|
||||
* Uses MutationObserver to detect element insertion, then ResizeObserver to
|
||||
* detect when the element receives layout dimensions.
|
||||
*/
|
||||
export function waitForHighlightable(
|
||||
selector: string,
|
||||
timeoutMs = 7000,
|
||||
): Promise<void> {
|
||||
return new Promise((resolve) => {
|
||||
if (typeof document === "undefined") {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
let mutationObserver: MutationObserver | null = null;
|
||||
let resizeObserver: ResizeObserver | null = null;
|
||||
|
||||
const cleanup = () => {
|
||||
mutationObserver?.disconnect();
|
||||
resizeObserver?.disconnect();
|
||||
};
|
||||
|
||||
const done = () => {
|
||||
clearTimeout(timer);
|
||||
cleanup();
|
||||
nudgeReactour();
|
||||
resolve();
|
||||
};
|
||||
|
||||
const timer = setTimeout(done, timeoutMs);
|
||||
|
||||
const watchLayout = (el: HTMLElement) => {
|
||||
if (el.getClientRects().length > 0) {
|
||||
done();
|
||||
return;
|
||||
}
|
||||
resizeObserver = new ResizeObserver((entries) => {
|
||||
for (const entry of entries) {
|
||||
if (entry.contentRect.width > 0 || entry.contentRect.height > 0) {
|
||||
done();
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
resizeObserver.observe(el);
|
||||
};
|
||||
|
||||
const el = document.querySelector<HTMLElement>(selector);
|
||||
if (el) {
|
||||
watchLayout(el);
|
||||
return;
|
||||
}
|
||||
|
||||
mutationObserver = new MutationObserver(() => {
|
||||
const found = document.querySelector<HTMLElement>(selector);
|
||||
if (found) {
|
||||
mutationObserver!.disconnect();
|
||||
mutationObserver = null;
|
||||
watchLayout(found);
|
||||
}
|
||||
});
|
||||
|
||||
mutationObserver.observe(document.body, { childList: true, subtree: true });
|
||||
});
|
||||
}
|
||||
@@ -35,13 +35,8 @@ export function useOnboardingDownload(): UseOnboardingDownloadResult {
|
||||
switch (osType) {
|
||||
case "windows":
|
||||
return { label: "Windows", url: DOWNLOAD_URLS.WINDOWS };
|
||||
case "mac-apple":
|
||||
return {
|
||||
label: "Mac (Apple Silicon)",
|
||||
url: DOWNLOAD_URLS.MAC_APPLE_SILICON,
|
||||
};
|
||||
case "mac-intel":
|
||||
return { label: "Mac (Intel)", url: DOWNLOAD_URLS.MAC_INTEL };
|
||||
case "mac":
|
||||
return { label: "Mac", url: DOWNLOAD_URLS.MAC };
|
||||
case "linux-x64":
|
||||
case "linux-arm64":
|
||||
return { label: "Linux", url: DOWNLOAD_URLS.LINUX_DOCS };
|
||||
@@ -54,16 +49,7 @@ export function useOnboardingDownload(): UseOnboardingDownloadResult {
|
||||
() =>
|
||||
[
|
||||
{ label: "Windows", url: DOWNLOAD_URLS.WINDOWS, value: "windows" },
|
||||
{
|
||||
label: "Mac (Apple Silicon)",
|
||||
url: DOWNLOAD_URLS.MAC_APPLE_SILICON,
|
||||
value: "mac-apple",
|
||||
},
|
||||
{
|
||||
label: "Mac (Intel)",
|
||||
url: DOWNLOAD_URLS.MAC_INTEL,
|
||||
value: "mac-intel",
|
||||
},
|
||||
{ label: "Mac", url: DOWNLOAD_URLS.MAC, value: "mac" },
|
||||
{ label: "Linux", url: DOWNLOAD_URLS.LINUX_DOCS, value: "linux" },
|
||||
].filter((opt) => opt.url),
|
||||
[],
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import type { StepType } from "@reactour/tour";
|
||||
import type { TFunction } from "i18next";
|
||||
import {
|
||||
waitForElement,
|
||||
waitForHighlightable,
|
||||
} from "@app/components/onboarding/tourUtils";
|
||||
|
||||
export enum TourStep {
|
||||
ALL_TOOLS,
|
||||
@@ -26,9 +30,11 @@ interface UserStepActions {
|
||||
loadSampleFile: () => void;
|
||||
switchToActiveFiles: () => void;
|
||||
pinFile: () => void;
|
||||
revealFileCardHoverMenu: () => void;
|
||||
modifyCropSettings: () => void;
|
||||
executeTool: () => void;
|
||||
openFilesModal: () => void;
|
||||
openSettingsHelpSection: () => void;
|
||||
}
|
||||
|
||||
interface CreateUserStepsConfigArgs {
|
||||
@@ -48,9 +54,11 @@ export function createUserStepsConfig({
|
||||
loadSampleFile,
|
||||
switchToActiveFiles,
|
||||
pinFile,
|
||||
revealFileCardHoverMenu,
|
||||
modifyCropSettings,
|
||||
executeTool,
|
||||
openFilesModal,
|
||||
openSettingsHelpSection,
|
||||
} = actions;
|
||||
|
||||
return {
|
||||
@@ -95,7 +103,7 @@ export function createUserStepsConfig({
|
||||
),
|
||||
position: "right",
|
||||
padding: 10,
|
||||
action: () => openFilesModal(),
|
||||
actionAfter: () => openFilesModal(),
|
||||
},
|
||||
[TourStep.FILE_SOURCES]: {
|
||||
selector: '[data-tour="file-sources"]',
|
||||
@@ -105,6 +113,10 @@ export function createUserStepsConfig({
|
||||
),
|
||||
position: "right",
|
||||
padding: 0,
|
||||
action: async () => {
|
||||
await waitForElement('[data-tour="file-sources"]', 5000);
|
||||
await waitForHighlightable('[data-tour="file-sources"]', 5000);
|
||||
},
|
||||
actionAfter: () => {
|
||||
loadSampleFile();
|
||||
closeFilesModal();
|
||||
@@ -184,16 +196,22 @@ export function createUserStepsConfig({
|
||||
),
|
||||
position: "left",
|
||||
padding: 10,
|
||||
action: () => pinFile(),
|
||||
action: () => revealFileCardHoverMenu(),
|
||||
actionAfter: () => pinFile(),
|
||||
},
|
||||
[TourStep.WRAP_UP]: {
|
||||
selector: '[data-tour="help-button"]',
|
||||
selector: '[data-tour="admin-help-nav"]',
|
||||
content: t(
|
||||
"onboarding.wrapUp",
|
||||
"You're all set! You've learnt about the main areas of the app and how to use them. Click the <strong>Help</strong> button whenever you like to see this tour again.",
|
||||
"You're all set! You can replay this tour anytime — just open <strong>Settings</strong> and find it here in the <strong>Tours</strong> section under Help.",
|
||||
),
|
||||
position: "right",
|
||||
padding: 10,
|
||||
action: async () => {
|
||||
openSettingsHelpSection();
|
||||
await waitForElement('[data-tour="admin-help-nav"]', 5000);
|
||||
await waitForHighlightable('[data-tour="admin-help-nav"]', 5000);
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,58 +1,14 @@
|
||||
import type { StepType } from "@reactour/tour";
|
||||
import type { TFunction } from "i18next";
|
||||
|
||||
async function waitForElement(
|
||||
selector: string,
|
||||
timeoutMs = 7000,
|
||||
intervalMs = 100,
|
||||
): Promise<void> {
|
||||
if (typeof document === "undefined") return;
|
||||
const start = Date.now();
|
||||
// Immediate hit
|
||||
if (document.querySelector(selector)) return;
|
||||
|
||||
return new Promise((resolve) => {
|
||||
const check = () => {
|
||||
if (document.querySelector(selector) || Date.now() - start >= timeoutMs) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
setTimeout(check, intervalMs);
|
||||
};
|
||||
check();
|
||||
});
|
||||
}
|
||||
|
||||
async function waitForHighlightable(
|
||||
selector: string,
|
||||
timeoutMs = 7000,
|
||||
intervalMs = 500,
|
||||
): Promise<void> {
|
||||
if (typeof document === "undefined") return;
|
||||
const start = Date.now();
|
||||
|
||||
return new Promise((resolve) => {
|
||||
const check = () => {
|
||||
const el = document.querySelector<HTMLElement>(selector);
|
||||
const isVisible = !!el && el.getClientRects().length > 0;
|
||||
if (isVisible || Date.now() - start >= timeoutMs) {
|
||||
// Nudge Reactour to recalc positions in case layout shifted
|
||||
window.dispatchEvent(new Event("resize"));
|
||||
requestAnimationFrame(() => window.dispatchEvent(new Event("resize")));
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
setTimeout(check, intervalMs);
|
||||
};
|
||||
check();
|
||||
});
|
||||
}
|
||||
import {
|
||||
waitForElement,
|
||||
waitForHighlightable,
|
||||
} from "@app/components/onboarding/tourUtils";
|
||||
|
||||
export enum WhatsNewTourStep {
|
||||
QUICK_ACCESS,
|
||||
LEFT_PANEL,
|
||||
FILE_UPLOAD,
|
||||
RIGHT_RAIL,
|
||||
TOP_BAR,
|
||||
PAGE_EDITOR_VIEW,
|
||||
ACTIVE_FILES_VIEW,
|
||||
@@ -68,7 +24,6 @@ interface WhatsNewStepActions {
|
||||
switchToViewer: () => void;
|
||||
switchToPageEditor: () => void;
|
||||
switchToActiveFiles: () => void;
|
||||
selectFirstFile: () => void;
|
||||
}
|
||||
|
||||
interface CreateWhatsNewStepsConfigArgs {
|
||||
@@ -89,7 +44,6 @@ export function createWhatsNewStepsConfig({
|
||||
switchToViewer,
|
||||
switchToPageEditor,
|
||||
switchToActiveFiles,
|
||||
selectFirstFile,
|
||||
} = actions;
|
||||
|
||||
return {
|
||||
@@ -124,34 +78,15 @@ export function createWhatsNewStepsConfig({
|
||||
),
|
||||
position: "right",
|
||||
padding: 10,
|
||||
action: async () => {
|
||||
openFilesModal();
|
||||
await waitForElement('[data-tour="file-sources"]', 5000, 100);
|
||||
},
|
||||
actionAfter: async () => {
|
||||
openFilesModal();
|
||||
await waitForElement('[data-tour="file-sources"]', 5000);
|
||||
await Promise.resolve(loadSampleFile());
|
||||
closeFilesModal();
|
||||
switchToViewer();
|
||||
// wait for file render and top controls to mount
|
||||
await waitForElement('[data-tour="view-switcher"]', 7000, 100);
|
||||
await waitForHighlightable('[data-tour="view-switcher"]', 7000, 500);
|
||||
},
|
||||
},
|
||||
[WhatsNewTourStep.RIGHT_RAIL]: {
|
||||
selector: '[data-tour="right-rail-controls"]',
|
||||
highlightedSelectors: [
|
||||
'[data-tour="right-rail-controls"]',
|
||||
'[data-tour="right-rail-settings"]',
|
||||
],
|
||||
content: t(
|
||||
"onboarding.whatsNew.rightRail",
|
||||
"The <strong>Right Rail</strong> holds quick actions to select files, change theme or language, and download results.",
|
||||
),
|
||||
position: "left",
|
||||
padding: 10,
|
||||
action: async () => {
|
||||
await waitForElement('[data-tour="right-rail-controls"]', 7000, 100);
|
||||
selectFirstFile();
|
||||
await waitForElement('[data-tour="view-switcher"]', 7000);
|
||||
await waitForHighlightable('[data-tour="view-switcher"]', 7000);
|
||||
},
|
||||
},
|
||||
[WhatsNewTourStep.TOP_BAR]: {
|
||||
@@ -165,8 +100,8 @@ export function createWhatsNewStepsConfig({
|
||||
// Ensure the switcher has mounted before this step renders
|
||||
action: async () => {
|
||||
switchToViewer();
|
||||
await waitForElement('[data-tour="view-switcher"]', 7000, 100);
|
||||
await waitForHighlightable('[data-tour="view-switcher"]', 7000, 500);
|
||||
await waitForElement('[data-tour="view-switcher"]', 7000);
|
||||
await waitForHighlightable('[data-tour="view-switcher"]', 7000);
|
||||
},
|
||||
},
|
||||
[WhatsNewTourStep.PAGE_EDITOR_VIEW]: {
|
||||
@@ -179,8 +114,8 @@ export function createWhatsNewStepsConfig({
|
||||
padding: 8,
|
||||
action: async () => {
|
||||
switchToPageEditor();
|
||||
await waitForElement('[data-tour="view-switcher"]', 7000, 100);
|
||||
await waitForHighlightable('[data-tour="view-switcher"]', 7000, 500);
|
||||
await waitForElement('[data-tour="view-switcher"]', 7000);
|
||||
await waitForHighlightable('[data-tour="view-switcher"]', 7000);
|
||||
},
|
||||
},
|
||||
[WhatsNewTourStep.ACTIVE_FILES_VIEW]: {
|
||||
@@ -193,8 +128,8 @@ export function createWhatsNewStepsConfig({
|
||||
padding: 8,
|
||||
action: async () => {
|
||||
switchToActiveFiles();
|
||||
await waitForElement('[data-tour="view-switcher"]', 7000, 100);
|
||||
await waitForHighlightable('[data-tour="view-switcher"]', 7000, 500);
|
||||
await waitForElement('[data-tour="view-switcher"]', 7000);
|
||||
await waitForHighlightable('[data-tour="view-switcher"]', 7000);
|
||||
},
|
||||
},
|
||||
[WhatsNewTourStep.WRAP_UP]: {
|
||||
|
||||
@@ -17,7 +17,7 @@ import { GRID_CONSTANTS } from "@app/components/pageEditor/constants";
|
||||
import { useInitialPageDocument } from "@app/components/pageEditor/hooks/useInitialPageDocument";
|
||||
import { usePageDocument } from "@app/components/pageEditor/hooks/usePageDocument";
|
||||
import { usePageEditorState } from "@app/components/pageEditor/hooks/usePageEditorState";
|
||||
import { usePageEditorRightRailButtons } from "@app/components/pageEditor/pageEditorRightRailButtons";
|
||||
import { usePageEditorWorkbenchBarButtons } from "@app/components/pageEditor/pageEditorWorkbenchBarButtons";
|
||||
import { useFileColorMap } from "@app/components/pageEditor/hooks/useFileColorMap";
|
||||
import { useWheelZoom } from "@app/hooks/useWheelZoom";
|
||||
import { useEditedDocumentState } from "@app/components/pageEditor/hooks/useEditedDocumentState";
|
||||
@@ -458,10 +458,10 @@ const PageEditor = ({ onFunctionsReady }: PageEditorProps) => {
|
||||
unregisterNavigationWarningHandlers,
|
||||
]);
|
||||
|
||||
// Derived values for right rail and usePageEditorRightRailButtons (must be after displayDocument)
|
||||
// Derived values for usePageEditorWorkbenchBarButtons (must be after displayDocument)
|
||||
const selectedPageCount = selectedPageIds.length;
|
||||
|
||||
usePageEditorRightRailButtons({
|
||||
usePageEditorWorkbenchBarButtons({
|
||||
totalPages,
|
||||
selectedPageCount,
|
||||
csvInput,
|
||||
|
||||
@@ -25,7 +25,6 @@ interface PageEditorControlsProps {
|
||||
onPageBreak: () => void;
|
||||
onPageBreakAll: () => void;
|
||||
|
||||
// Export functions (moved to right rail)
|
||||
onExportAll: () => void;
|
||||
exportLoading: boolean;
|
||||
|
||||
@@ -138,9 +137,7 @@ const PageEditorControls = ({
|
||||
disabled={!canUndo}
|
||||
variant="subtle"
|
||||
style={{
|
||||
color: canUndo
|
||||
? "var(--right-rail-icon)"
|
||||
: "var(--right-rail-icon-disabled)",
|
||||
color: canUndo ? "var(--text-secondary)" : "var(--text-muted)",
|
||||
}}
|
||||
radius="md"
|
||||
size="lg"
|
||||
@@ -154,9 +151,7 @@ const PageEditorControls = ({
|
||||
disabled={!canRedo}
|
||||
variant="subtle"
|
||||
style={{
|
||||
color: canRedo
|
||||
? "var(--right-rail-icon)"
|
||||
: "var(--right-rail-icon-disabled)",
|
||||
color: canRedo ? "var(--text-secondary)" : "var(--text-muted)",
|
||||
}}
|
||||
radius="md"
|
||||
size="lg"
|
||||
@@ -183,8 +178,8 @@ const PageEditorControls = ({
|
||||
style={{
|
||||
color:
|
||||
selectedPageIds.length > 0
|
||||
? "var(--right-rail-icon)"
|
||||
: "var(--right-rail-icon-disabled)",
|
||||
? "var(--text-secondary)"
|
||||
: "var(--text-muted)",
|
||||
}}
|
||||
radius="md"
|
||||
size="lg"
|
||||
@@ -200,8 +195,8 @@ const PageEditorControls = ({
|
||||
style={{
|
||||
color:
|
||||
selectedPageIds.length > 0
|
||||
? "var(--right-rail-icon)"
|
||||
: "var(--right-rail-icon-disabled)",
|
||||
? "var(--text-secondary)"
|
||||
: "var(--text-muted)",
|
||||
}}
|
||||
radius="md"
|
||||
size="lg"
|
||||
@@ -217,8 +212,8 @@ const PageEditorControls = ({
|
||||
style={{
|
||||
color:
|
||||
selectedPageIds.length > 0
|
||||
? "var(--right-rail-icon)"
|
||||
: "var(--right-rail-icon-disabled)",
|
||||
? "var(--text-secondary)"
|
||||
: "var(--text-muted)",
|
||||
}}
|
||||
radius="md"
|
||||
size="lg"
|
||||
@@ -234,8 +229,8 @@ const PageEditorControls = ({
|
||||
style={{
|
||||
color:
|
||||
selectedPageIds.length > 0
|
||||
? "var(--right-rail-icon)"
|
||||
: "var(--right-rail-icon-disabled)",
|
||||
? "var(--text-secondary)"
|
||||
: "var(--text-muted)",
|
||||
}}
|
||||
radius="md"
|
||||
size="lg"
|
||||
@@ -251,8 +246,8 @@ const PageEditorControls = ({
|
||||
style={{
|
||||
color:
|
||||
selectedPageIds.length > 0
|
||||
? "var(--right-rail-icon)"
|
||||
: "var(--right-rail-icon-disabled)",
|
||||
? "var(--text-secondary)"
|
||||
: "var(--text-muted)",
|
||||
}}
|
||||
radius="md"
|
||||
size="lg"
|
||||
|
||||
@@ -32,14 +32,13 @@ export default function PageSelectByNumberButton({
|
||||
arrow
|
||||
portalTarget={document.body}
|
||||
>
|
||||
<div className={`right-rail-fade enter`}>
|
||||
<div>
|
||||
<Popover position="left" withArrow shadow="md" offset={8}>
|
||||
<Popover.Target>
|
||||
<div style={{ display: "inline-flex" }}>
|
||||
<ActionIcon
|
||||
variant="subtle"
|
||||
radius="md"
|
||||
className="right-rail-icon"
|
||||
disabled={disabled || totalPages === 0}
|
||||
aria-label={label}
|
||||
>
|
||||
|
||||
@@ -88,7 +88,6 @@ const PageThumbnail: React.FC<PageThumbnailProps> = ({
|
||||
onTogglePage,
|
||||
onExecuteCommand,
|
||||
onSetStatus,
|
||||
onSetMovingPage,
|
||||
onDeletePage,
|
||||
createRotateCommand,
|
||||
createSplitCommand,
|
||||
@@ -328,10 +327,8 @@ const PageThumbnail: React.FC<PageThumbnailProps> = ({
|
||||
label: "Move Left",
|
||||
onClick: (e) => {
|
||||
e.stopPropagation();
|
||||
if (pageIndex > 0 && !movingPage && !isAnimating) {
|
||||
onSetMovingPage(page.pageNumber);
|
||||
if (pageIndex > 0 && !isAnimating) {
|
||||
onReorderPages(page.pageNumber, pageIndex - 1);
|
||||
setTimeout(() => onSetMovingPage(null), 650);
|
||||
onSetStatus(`Moved page ${page.pageNumber} left`);
|
||||
}
|
||||
},
|
||||
@@ -343,13 +340,9 @@ const PageThumbnail: React.FC<PageThumbnailProps> = ({
|
||||
label: "Move Right",
|
||||
onClick: (e) => {
|
||||
e.stopPropagation();
|
||||
if (pageIndex < totalPages - 1 && !movingPage && !isAnimating) {
|
||||
onSetMovingPage(page.pageNumber);
|
||||
// ReorderPagesCommand expects target index relative to the original array.
|
||||
// When moving toward the right (higher index), provide desiredIndex + 1
|
||||
// so the command's internal adjustment (targetIndex - 1) lands correctly.
|
||||
if (pageIndex < totalPages - 1 && !isAnimating) {
|
||||
// +2 compensates for ReorderPagesCommand's internal targetIndex - 1 adjustment.
|
||||
onReorderPages(page.pageNumber, pageIndex + 2);
|
||||
setTimeout(() => onSetMovingPage(null), 650);
|
||||
onSetStatus(`Moved page ${page.pageNumber} right`);
|
||||
}
|
||||
},
|
||||
@@ -391,7 +384,6 @@ const PageThumbnail: React.FC<PageThumbnailProps> = ({
|
||||
[
|
||||
pageIndex,
|
||||
totalPages,
|
||||
movingPage,
|
||||
isAnimating,
|
||||
page.pageNumber,
|
||||
handleRotateLeft,
|
||||
@@ -400,7 +392,6 @@ const PageThumbnail: React.FC<PageThumbnailProps> = ({
|
||||
handleSplit,
|
||||
handleInsertFileAfter,
|
||||
onReorderPages,
|
||||
onSetMovingPage,
|
||||
onSetStatus,
|
||||
],
|
||||
);
|
||||
|
||||
@@ -232,7 +232,7 @@ export class ReorderPagesCommand extends DOMCommand {
|
||||
);
|
||||
if (sourceIndex === -1) return;
|
||||
|
||||
const newPages = [...currentDoc.pages];
|
||||
let reorderedPages: PDFPage[];
|
||||
|
||||
if (
|
||||
this.selectedPages &&
|
||||
@@ -246,19 +246,15 @@ export class ReorderPagesCommand extends DOMCommand {
|
||||
)
|
||||
.filter((page) => page !== undefined) as PDFPage[];
|
||||
|
||||
const remainingPages = newPages.filter(
|
||||
const remainingPages = currentDoc.pages.filter(
|
||||
(page) => !this.selectedPages!.includes(page.pageNumber),
|
||||
);
|
||||
remainingPages.splice(this.targetIndex, 0, ...selectedPageObjects);
|
||||
|
||||
remainingPages.forEach((page, index) => {
|
||||
page.pageNumber = index + 1;
|
||||
});
|
||||
|
||||
newPages.splice(0, newPages.length, ...remainingPages);
|
||||
reorderedPages = remainingPages;
|
||||
} else {
|
||||
// Single page reorder
|
||||
const [movedPage] = newPages.splice(sourceIndex, 1);
|
||||
const working = [...currentDoc.pages];
|
||||
const [movedPage] = working.splice(sourceIndex, 1);
|
||||
|
||||
// Adjust target index if moving forward (after removal, indices shift)
|
||||
const adjustedTargetIndex =
|
||||
@@ -266,13 +262,15 @@ export class ReorderPagesCommand extends DOMCommand {
|
||||
? this.targetIndex - 1
|
||||
: this.targetIndex;
|
||||
|
||||
newPages.splice(adjustedTargetIndex, 0, movedPage);
|
||||
|
||||
newPages.forEach((page, index) => {
|
||||
page.pageNumber = index + 1;
|
||||
});
|
||||
working.splice(adjustedTargetIndex, 0, movedPage);
|
||||
reorderedPages = working;
|
||||
}
|
||||
|
||||
const newPages = reorderedPages.map((page, index) => ({
|
||||
...page,
|
||||
pageNumber: index + 1,
|
||||
}));
|
||||
|
||||
const reorderedDocument: PDFDocument = {
|
||||
...currentDoc,
|
||||
pages: newPages,
|
||||
|
||||
+14
-14
@@ -1,13 +1,13 @@
|
||||
import { useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {
|
||||
useRightRailButtons,
|
||||
RightRailButtonWithAction,
|
||||
} from "@app/hooks/useRightRailButtons";
|
||||
useWorkbenchBarButtons,
|
||||
WorkbenchBarButtonWithAction,
|
||||
} from "@app/hooks/useWorkbenchBarButtons";
|
||||
import LocalIcon from "@app/components/shared/LocalIcon";
|
||||
import PageSelectByNumberButton from "@app/components/pageEditor/PageSelectByNumberButton";
|
||||
|
||||
interface PageEditorRightRailButtonsParams {
|
||||
interface PageEditorWorkbenchBarButtonsParams {
|
||||
totalPages: number;
|
||||
selectedPageCount: number;
|
||||
csvInput: string;
|
||||
@@ -23,8 +23,8 @@ interface PageEditorRightRailButtonsParams {
|
||||
exportLoading: boolean;
|
||||
}
|
||||
|
||||
export function usePageEditorRightRailButtons(
|
||||
params: PageEditorRightRailButtonsParams,
|
||||
export function usePageEditorWorkbenchBarButtons(
|
||||
params: PageEditorWorkbenchBarButtonsParams,
|
||||
) {
|
||||
const {
|
||||
totalPages,
|
||||
@@ -45,22 +45,22 @@ export function usePageEditorRightRailButtons(
|
||||
const { t, i18n } = useTranslation();
|
||||
|
||||
// Lift i18n labels out of memo for clarity
|
||||
const selectAllLabel = t("rightRail.selectAll", "Select All");
|
||||
const deselectAllLabel = t("rightRail.deselectAll", "Deselect All");
|
||||
const selectAllLabel = t("workbenchBar.selectAll", "Select All");
|
||||
const deselectAllLabel = t("workbenchBar.deselectAll", "Deselect All");
|
||||
const selectByNumberLabel = t(
|
||||
"rightRail.selectByNumber",
|
||||
"workbenchBar.selectByNumber",
|
||||
"Select by Page Numbers",
|
||||
);
|
||||
const deleteSelectedLabel = t(
|
||||
"rightRail.deleteSelected",
|
||||
"workbenchBar.deleteSelected",
|
||||
"Delete Selected Pages",
|
||||
);
|
||||
const exportSelectedLabel = t(
|
||||
"rightRail.exportSelected",
|
||||
"workbenchBar.exportSelected",
|
||||
"Export Selected Pages",
|
||||
);
|
||||
const saveChangesLabel = t("rightRail.saveChanges", "Save Changes");
|
||||
const buttons = useMemo<RightRailButtonWithAction[]>(() => {
|
||||
const saveChangesLabel = t("workbenchBar.saveChanges", "Save Changes");
|
||||
const buttons = useMemo<WorkbenchBarButtonWithAction[]>(() => {
|
||||
return [
|
||||
{
|
||||
id: "page-select-all",
|
||||
@@ -175,5 +175,5 @@ export function usePageEditorRightRailButtons(
|
||||
exportLoading,
|
||||
]);
|
||||
|
||||
useRightRailButtons(buttons);
|
||||
useWorkbenchBarButtons(buttons);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
interface RightRailFooterExtensionsProps {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export function RightRailFooterExtensions(
|
||||
_props: RightRailFooterExtensionsProps,
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
@@ -108,11 +108,26 @@ const AppConfigModalInner: React.FC<AppConfigModalProps> = ({
|
||||
const runningEE = config?.runningEE ?? false;
|
||||
const loginEnabled = config?.enableLogin ?? false;
|
||||
|
||||
const handleClose = useCallback(async () => {
|
||||
const canProceed = await confirmIfDirty();
|
||||
if (!canProceed) return;
|
||||
|
||||
// Navigate back to home when closing modal
|
||||
navigate("/", { replace: true });
|
||||
onClose();
|
||||
}, [confirmIfDirty, navigate, onClose]);
|
||||
|
||||
// Synchronous wrapper for contexts (e.g. tour buttons) that need () => void
|
||||
const handleCloseSync = useCallback(() => {
|
||||
void handleClose();
|
||||
}, [handleClose]);
|
||||
|
||||
// Left navigation structure and icons
|
||||
const configNavSections = useConfigNavSections(
|
||||
isAdmin,
|
||||
runningEE,
|
||||
loginEnabled,
|
||||
handleCloseSync,
|
||||
);
|
||||
|
||||
const activeLabel = useMemo(() => {
|
||||
@@ -131,15 +146,6 @@ const AppConfigModalInner: React.FC<AppConfigModalProps> = ({
|
||||
return null;
|
||||
}, [configNavSections, active]);
|
||||
|
||||
const handleClose = useCallback(async () => {
|
||||
const canProceed = await confirmIfDirty();
|
||||
if (!canProceed) return;
|
||||
|
||||
// Navigate back to home when closing modal
|
||||
navigate("/", { replace: true });
|
||||
onClose();
|
||||
}, [confirmIfDirty, navigate, onClose]);
|
||||
|
||||
const handleNavigation = useCallback(
|
||||
async (key: NavKey) => {
|
||||
const canProceed = await confirmIfDirty();
|
||||
|
||||
@@ -7,21 +7,18 @@ import {
|
||||
Badge,
|
||||
Button,
|
||||
Box,
|
||||
Image,
|
||||
ThemeIcon,
|
||||
ActionIcon,
|
||||
Tooltip,
|
||||
Loader,
|
||||
} from "@mantine/core";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import PictureAsPdfIcon from "@mui/icons-material/PictureAsPdf";
|
||||
import StorageIcon from "@mui/icons-material/Storage";
|
||||
import VisibilityIcon from "@mui/icons-material/Visibility";
|
||||
import EditIcon from "@mui/icons-material/Edit";
|
||||
|
||||
import { StirlingFileStub } from "@app/types/fileContext";
|
||||
import { getFileSize, getFileDate } from "@app/utils/fileUtils";
|
||||
import { useIndexedDBThumbnail } from "@app/hooks/useIndexedDBThumbnail";
|
||||
import { useFileThumbnail } from "@app/hooks/useFileThumbnail";
|
||||
import DocumentThumbnail from "@app/components/shared/filePreview/DocumentThumbnail";
|
||||
|
||||
interface FileCardProps {
|
||||
file: File;
|
||||
@@ -47,15 +44,15 @@ const FileCard = ({
|
||||
isSupported = true,
|
||||
}: FileCardProps) => {
|
||||
const { t } = useTranslation();
|
||||
// Use record thumbnail if available, otherwise fall back to IndexedDB lookup
|
||||
const { thumbnail: indexedDBThumb, isGenerating } =
|
||||
useIndexedDBThumbnail(fileStub);
|
||||
const thumb = fileStub?.thumbnailUrl || indexedDBThumb;
|
||||
const {
|
||||
isEncrypted,
|
||||
thumbnail: thumb,
|
||||
isGenerating,
|
||||
} = useFileThumbnail(fileStub);
|
||||
const [isHovered, setIsHovered] = useState(false);
|
||||
|
||||
// Show loading state during hydration: PDF file without thumbnail yet
|
||||
const isPdf = file.type === "application/pdf";
|
||||
const isHydrating = isPdf && !thumb && !isGenerating;
|
||||
const isHydrating = isPdf && !isEncrypted && !thumb && !isGenerating;
|
||||
|
||||
return (
|
||||
<Card
|
||||
@@ -73,8 +70,7 @@ const FileCard = ({
|
||||
? "2px solid var(--mantine-color-blue-6)"
|
||||
: undefined,
|
||||
backgroundColor: isSelected ? "var(--mantine-color-blue-0)" : undefined,
|
||||
opacity: isSupported ? 1 : 0.5,
|
||||
filter: isSupported ? "none" : "grayscale(50%)",
|
||||
opacity: 1,
|
||||
}}
|
||||
onDoubleClick={onDoubleClick}
|
||||
onMouseEnter={() => setIsHovered(true)}
|
||||
@@ -146,51 +142,13 @@ const FileCard = ({
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{thumb ? (
|
||||
<Image
|
||||
src={thumb}
|
||||
alt="PDF thumbnail"
|
||||
height={110}
|
||||
width={80}
|
||||
fit="contain"
|
||||
radius="sm"
|
||||
/>
|
||||
) : isGenerating || isHydrating ? (
|
||||
<Stack align="center" justify="center" gap="xs">
|
||||
<Loader size="sm" />
|
||||
<Text size="xs" c="dimmed">
|
||||
Loading...
|
||||
</Text>
|
||||
</Stack>
|
||||
) : (
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
<ThemeIcon
|
||||
variant="light"
|
||||
color={file.size > 100 * 1024 * 1024 ? "orange" : "red"}
|
||||
size={60}
|
||||
radius="sm"
|
||||
style={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
<PictureAsPdfIcon style={{ fontSize: 40 }} />
|
||||
</ThemeIcon>
|
||||
{file.size > 100 * 1024 * 1024 && (
|
||||
<Text size="xs" c="dimmed" mt={4}>
|
||||
Large File
|
||||
</Text>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<DocumentThumbnail
|
||||
file={file}
|
||||
thumbnail={thumb || undefined}
|
||||
isEncrypted={isEncrypted}
|
||||
isLoading={isGenerating || isHydrating}
|
||||
iconSize="3rem"
|
||||
/>
|
||||
</Box>
|
||||
|
||||
<Text fw={500} size="sm" lineClamp={1} ta="center">
|
||||
|
||||
@@ -0,0 +1,204 @@
|
||||
export type FileDocVariant =
|
||||
| "pdf"
|
||||
| "spreadsheet"
|
||||
| "doc"
|
||||
| "image"
|
||||
| "archive"
|
||||
| "code"
|
||||
| "generic";
|
||||
|
||||
export const VARIANT_COLORS: Record<FileDocVariant, string> = {
|
||||
pdf: "#DC2626",
|
||||
spreadsheet: "#16a34a",
|
||||
doc: "#2563eb",
|
||||
image: "#7c3aed",
|
||||
archive: "#ea580c",
|
||||
code: "#0891b2",
|
||||
generic: "#71717a",
|
||||
};
|
||||
|
||||
export function FileDocIcon({
|
||||
color,
|
||||
variant,
|
||||
className,
|
||||
style,
|
||||
}: {
|
||||
color?: string;
|
||||
variant: FileDocVariant;
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
}) {
|
||||
color ??= VARIANT_COLORS[variant];
|
||||
const foldX = 10.5;
|
||||
const foldY = 5.5;
|
||||
|
||||
let interior: React.ReactNode;
|
||||
if (variant === "spreadsheet") {
|
||||
// Outer border of the grid
|
||||
const gx1 = 3,
|
||||
gy1 = 8,
|
||||
gx2 = 13,
|
||||
gy2 = 17;
|
||||
// Column divider x, row divider y positions
|
||||
const colX = 8;
|
||||
const row1Y = 11,
|
||||
row2Y = 14;
|
||||
interior = (
|
||||
<g opacity="0.7" stroke={color} strokeWidth="1" fill="none">
|
||||
<rect x={gx1} y={gy1} width={gx2 - gx1} height={gy2 - gy1} rx="0.5" />
|
||||
<line x1={colX} y1={gy1} x2={colX} y2={gy2} />
|
||||
<line x1={gx1} y1={row1Y} x2={gx2} y2={row1Y} />
|
||||
<line x1={gx1} y1={row2Y} x2={gx2} y2={row2Y} />
|
||||
</g>
|
||||
);
|
||||
} else if (variant === "image") {
|
||||
interior = (
|
||||
<>
|
||||
<polyline
|
||||
points="2.5,16 5.5,11.5 8,14 10,12 13.5,16"
|
||||
stroke={color}
|
||||
strokeWidth="1.1"
|
||||
opacity="0.6"
|
||||
fill="none"
|
||||
strokeLinejoin="round"
|
||||
strokeLinecap="round"
|
||||
/>
|
||||
<circle
|
||||
cx="11"
|
||||
cy="9.5"
|
||||
r="1.3"
|
||||
stroke={color}
|
||||
strokeWidth="1"
|
||||
opacity="0.6"
|
||||
fill="none"
|
||||
/>
|
||||
</>
|
||||
);
|
||||
} else if (variant === "code") {
|
||||
interior = (
|
||||
<>
|
||||
<polyline
|
||||
points="6,9.5 3.5,12.5 6,15.5"
|
||||
stroke={color}
|
||||
strokeWidth="1.3"
|
||||
opacity="0.7"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<polyline
|
||||
points="10,9.5 12.5,12.5 10,15.5"
|
||||
stroke={color}
|
||||
strokeWidth="1.3"
|
||||
opacity="0.7"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
</>
|
||||
);
|
||||
} else if (variant === "archive") {
|
||||
interior = (
|
||||
<>
|
||||
<line
|
||||
x1="5"
|
||||
y1="9.5"
|
||||
x2="11"
|
||||
y2="9.5"
|
||||
stroke={color}
|
||||
strokeWidth="1.1"
|
||||
opacity="0.6"
|
||||
strokeDasharray="2,1.5"
|
||||
strokeLinecap="round"
|
||||
/>
|
||||
<line
|
||||
x1="5"
|
||||
y1="12"
|
||||
x2="11"
|
||||
y2="12"
|
||||
stroke={color}
|
||||
strokeWidth="1.1"
|
||||
opacity="0.6"
|
||||
strokeDasharray="2,1.5"
|
||||
strokeLinecap="round"
|
||||
/>
|
||||
<line
|
||||
x1="5"
|
||||
y1="14.5"
|
||||
x2="11"
|
||||
y2="14.5"
|
||||
stroke={color}
|
||||
strokeWidth="1.1"
|
||||
opacity="0.6"
|
||||
strokeDasharray="2,1.5"
|
||||
strokeLinecap="round"
|
||||
/>
|
||||
</>
|
||||
);
|
||||
} else {
|
||||
// pdf, doc, generic — text lines
|
||||
interior = (
|
||||
<>
|
||||
<line
|
||||
x1="3.5"
|
||||
y1="9.5"
|
||||
x2="12.5"
|
||||
y2="9.5"
|
||||
stroke={color}
|
||||
strokeWidth="1.1"
|
||||
opacity="0.6"
|
||||
strokeLinecap="round"
|
||||
/>
|
||||
<line
|
||||
x1="3.5"
|
||||
y1="12"
|
||||
x2="12.5"
|
||||
y2="12"
|
||||
stroke={color}
|
||||
strokeWidth="1.1"
|
||||
opacity="0.6"
|
||||
strokeLinecap="round"
|
||||
/>
|
||||
<line
|
||||
x1="3.5"
|
||||
y1="14.5"
|
||||
x2="8.5"
|
||||
y2="14.5"
|
||||
stroke={color}
|
||||
strokeWidth="1.1"
|
||||
opacity="0.6"
|
||||
strokeLinecap="round"
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<svg
|
||||
className={className}
|
||||
style={{ width: 16, height: 20, ...style }}
|
||||
viewBox="0 0 16 20"
|
||||
fill="none"
|
||||
aria-hidden="true"
|
||||
>
|
||||
{/* Document outline with top-right page fold */}
|
||||
<path
|
||||
d={`M 1.5,1 H ${foldX} L 15,${foldY} V 18.5 Q 15,19 14.5,19 H 1.5 Q 1,19 1,18.5 V 1.5 Q 1,1 1.5,1 Z`}
|
||||
stroke={color}
|
||||
strokeWidth="1.3"
|
||||
fill="none"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
{/* Fold corner triangle */}
|
||||
<path
|
||||
d={`M ${foldX},1 L ${foldX},${foldY} L 15,${foldY} Z`}
|
||||
stroke={color}
|
||||
strokeWidth="1.3"
|
||||
fill={color}
|
||||
fillOpacity="0.2"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
{interior}
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
@@ -51,7 +51,7 @@ export const FileDropdownMenu: React.FC<FileDropdownMenuProps> = ({
|
||||
</Menu.Target>
|
||||
<Menu.Dropdown
|
||||
style={{
|
||||
backgroundColor: "var(--right-rail-bg)",
|
||||
backgroundColor: "var(--bg-file-manager)",
|
||||
border: "1px solid var(--border-subtle)",
|
||||
borderRadius: "8px",
|
||||
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)",
|
||||
|
||||
@@ -8,13 +8,11 @@ import {
|
||||
Checkbox,
|
||||
ScrollArea,
|
||||
Box,
|
||||
Image,
|
||||
Badge,
|
||||
ThemeIcon,
|
||||
SimpleGrid,
|
||||
} from "@mantine/core";
|
||||
import PictureAsPdfIcon from "@mui/icons-material/PictureAsPdf";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import DocumentThumbnail from "@app/components/shared/filePreview/DocumentThumbnail";
|
||||
import { FileId } from "@app/types/file";
|
||||
import { useFileActionTerminology } from "@app/hooks/useFileActionTerminology";
|
||||
|
||||
@@ -200,26 +198,23 @@ const FilePickerModal = ({
|
||||
height: 80,
|
||||
border: "1px solid var(--mantine-color-gray-3)",
|
||||
borderRadius: 4,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
backgroundColor: "var(--mantine-color-gray-0)",
|
||||
backgroundColor: "white",
|
||||
flexShrink: 0,
|
||||
overflow: "hidden",
|
||||
}}
|
||||
>
|
||||
{file.thumbnail ? (
|
||||
<Image
|
||||
src={file.thumbnail}
|
||||
alt="PDF thumbnail"
|
||||
height={70}
|
||||
width={50}
|
||||
fit="contain"
|
||||
/>
|
||||
) : (
|
||||
<ThemeIcon variant="light" color="red" size={40}>
|
||||
<PictureAsPdfIcon style={{ fontSize: 24 }} />
|
||||
</ThemeIcon>
|
||||
)}
|
||||
<DocumentThumbnail
|
||||
file={file}
|
||||
thumbnail={
|
||||
file.processedFile?.isEncrypted
|
||||
? undefined
|
||||
: file.thumbnail
|
||||
}
|
||||
isEncrypted={Boolean(
|
||||
file.processedFile?.isEncrypted,
|
||||
)}
|
||||
iconSize="2rem"
|
||||
/>
|
||||
</Box>
|
||||
|
||||
{/* File info */}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
border-right: 1px solid var(--border-subtle);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
transition:
|
||||
@@ -124,7 +124,7 @@
|
||||
background: transparent;
|
||||
}
|
||||
.file-sidebar-scroll::-webkit-scrollbar-thumb {
|
||||
background: var(--border);
|
||||
background: rgb(var(--border));
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
@@ -220,6 +220,26 @@
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.file-sidebar-file-list {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.file-sidebar-file-list::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
.file-sidebar-file-list::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
.file-sidebar-file-list::-webkit-scrollbar-thumb {
|
||||
background: rgb(var(--border));
|
||||
border-radius: 2px;
|
||||
}
|
||||
.file-sidebar-file-list::-webkit-scrollbar-thumb:hover {
|
||||
background: var(--text-muted);
|
||||
}
|
||||
|
||||
.file-sidebar-section-divider {
|
||||
border-top: 1px solid var(--border-subtle);
|
||||
margin: 10px 14px 6px 14px;
|
||||
|
||||
@@ -316,6 +316,7 @@ const FileSidebar = forwardRef<HTMLDivElement, FileSidebarProps>(
|
||||
style={{ width, minWidth: width, maxWidth: width }}
|
||||
data-collapsed={collapsed}
|
||||
data-sidebar="file-sidebar"
|
||||
data-tour="quick-access-bar"
|
||||
>
|
||||
<div className="file-sidebar-inner">
|
||||
{/* Header: hamburger + branding */}
|
||||
@@ -392,6 +393,7 @@ const FileSidebar = forwardRef<HTMLDivElement, FileSidebarProps>(
|
||||
<div
|
||||
className="file-sidebar-action-row"
|
||||
data-testid="files-button"
|
||||
data-tour="files-button"
|
||||
onClick={() => {
|
||||
if (collapsed && onToggleCollapse) onToggleCollapse();
|
||||
openFilesModal();
|
||||
@@ -500,10 +502,15 @@ const FileSidebar = forwardRef<HTMLDivElement, FileSidebarProps>(
|
||||
);
|
||||
const isActive = isViewedInViewer;
|
||||
// In-memory thumbnail may be fresher than the IndexedDB stub.
|
||||
const thumbnailUrl =
|
||||
(workbenchFileId
|
||||
? state.files.byId[workbenchFileId]?.thumbnailUrl
|
||||
: undefined) || stub.thumbnailUrl;
|
||||
// Encrypted files never get a raster thumbnail — use undefined
|
||||
// so the sidebar icon is shown instead of a stale canvas thumbnail.
|
||||
const isEncryptedFile =
|
||||
stub.processedFile?.isEncrypted === true;
|
||||
const thumbnailUrl = isEncryptedFile
|
||||
? undefined
|
||||
: (workbenchFileId
|
||||
? state.files.byId[workbenchFileId]?.thumbnailUrl
|
||||
: undefined) || stub.thumbnailUrl;
|
||||
return (
|
||||
<FileItem
|
||||
key={stub.id}
|
||||
@@ -550,6 +557,7 @@ const FileSidebar = forwardRef<HTMLDivElement, FileSidebarProps>(
|
||||
: undefined
|
||||
}
|
||||
data-testid={onOpenSettings ? "config-button" : undefined}
|
||||
data-tour={onOpenSettings ? "config-button" : undefined}
|
||||
aria-label={
|
||||
onOpenSettings
|
||||
? t("fileSidebar.openSettings", "Open settings")
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
background: transparent;
|
||||
}
|
||||
.file-sidebar-file-list::-webkit-scrollbar-thumb {
|
||||
background: var(--border);
|
||||
background: rgb(var(--border));
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,12 @@ import { createPortal } from "react-dom";
|
||||
import VisibilityOutlinedIcon from "@mui/icons-material/VisibilityOutlined";
|
||||
import VisibilityOffOutlinedIcon from "@mui/icons-material/VisibilityOffOutlined";
|
||||
import type { FileId } from "@app/types/file";
|
||||
import { FileDocIcon } from "@app/components/shared/FileDocIcon";
|
||||
import { getFileDocVariant } from "@app/components/shared/filePreview/getFileTypeIcon";
|
||||
import { useIndexedDB } from "@app/contexts/IndexedDBContext";
|
||||
import { useFileManagement } from "@app/contexts/FileContext";
|
||||
import { generateThumbnailForFile } from "@app/utils/thumbnailUtils";
|
||||
import { IMAGE_EXTENSIONS } from "@app/utils/fileUtils";
|
||||
import "@app/components/shared/FileSidebarFileItem.css";
|
||||
|
||||
const THUMBNAIL_SIZE_LIMIT = 100 * 1024 * 1024; // 100MB
|
||||
@@ -18,6 +22,7 @@ function useLazyThumbnail(
|
||||
const [thumb, setThumb] = useState<string | undefined>(thumbnailUrl);
|
||||
const attempted = useRef(false);
|
||||
const indexedDB = useIndexedDB();
|
||||
const { updateStirlingFileStub } = useFileManagement();
|
||||
|
||||
// Sync prop changes (e.g. thumbnail arrives after TTL bump)
|
||||
useEffect(() => {
|
||||
@@ -38,6 +43,7 @@ function useLazyThumbnail(
|
||||
if (cancelled || !thumbnail) return;
|
||||
setThumb(thumbnail);
|
||||
void indexedDB.updateThumbnail(fileId, thumbnail);
|
||||
updateStirlingFileStub(fileId, { thumbnailUrl: thumbnail });
|
||||
} catch {
|
||||
// non-critical
|
||||
}
|
||||
@@ -46,7 +52,7 @@ function useLazyThumbnail(
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
}, [fileId, size, thumbnailUrl, indexedDB]);
|
||||
}, [fileId, size, thumbnailUrl, indexedDB, updateStirlingFileStub]);
|
||||
|
||||
return thumb;
|
||||
}
|
||||
@@ -128,85 +134,6 @@ export function formatFileDate(lastModifiedTs: number): string {
|
||||
});
|
||||
}
|
||||
|
||||
function FilePdfIcon({
|
||||
className,
|
||||
style,
|
||||
}: {
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
}) {
|
||||
return (
|
||||
<svg
|
||||
className={className}
|
||||
style={style}
|
||||
width="16"
|
||||
height="20"
|
||||
viewBox="0 0 16 20"
|
||||
fill="none"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<path
|
||||
d="M1 2C1 .895 1.895 0 3 0H9.5L15 5.5V18C15 19.105 14.105 20 13 20H3C1.895 20 1 19.105 1 18V2Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path
|
||||
d="M9.5 0L15 5.5H11C10.172 5.5 9.5 4.828 9.5 4V0Z"
|
||||
fill="rgba(0,0,0,0.2)"
|
||||
/>
|
||||
<rect
|
||||
x="3.5"
|
||||
y="8.5"
|
||||
width="7"
|
||||
height="1.2"
|
||||
rx=".6"
|
||||
fill="rgba(255,255,255,.85)"
|
||||
/>
|
||||
<rect
|
||||
x="3.5"
|
||||
y="11"
|
||||
width="9"
|
||||
height="1.2"
|
||||
rx=".6"
|
||||
fill="rgba(255,255,255,.85)"
|
||||
/>
|
||||
<rect
|
||||
x="3.5"
|
||||
y="13.5"
|
||||
width="5.5"
|
||||
height="1.2"
|
||||
rx=".6"
|
||||
fill="rgba(255,255,255,.85)"
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
function FileGenericIcon({
|
||||
className,
|
||||
style,
|
||||
}: {
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
}) {
|
||||
return (
|
||||
<svg
|
||||
className={className}
|
||||
style={style}
|
||||
width="20"
|
||||
height="20"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<path d="M14 2v4a2 2 0 0 0 2 2h4" />
|
||||
<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z" />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
function CheckIcon({
|
||||
className,
|
||||
style,
|
||||
@@ -232,6 +159,11 @@ function CheckIcon({
|
||||
);
|
||||
}
|
||||
|
||||
function getSidebarFileIcon(ext: string): React.ReactElement {
|
||||
const cls = "file-sidebar-file-icon file-sidebar-file-icon-hover-hide";
|
||||
return <FileDocIcon className={cls} variant={getFileDocVariant(ext)} />;
|
||||
}
|
||||
|
||||
export interface FileItemProps {
|
||||
fileId: FileId;
|
||||
name: string;
|
||||
@@ -258,11 +190,16 @@ export function FileItem({
|
||||
onEyeClick,
|
||||
}: FileItemProps) {
|
||||
const ext = getFileExtension(name);
|
||||
const isPdf = ext === "pdf";
|
||||
const dateLabel = lastModified ? formatFileDate(lastModified) : "";
|
||||
const typeLabel = isPdf ? "" : ext ? ext.toUpperCase() : "File";
|
||||
const typeLabel = ext ? ext.toUpperCase() : "File";
|
||||
|
||||
const resolvedThumbnail = useLazyThumbnail(fileId, size ?? 0, thumbnailUrl);
|
||||
// Only use raster thumbnails for PDFs and images — everything else uses scalable SVG icons
|
||||
const useRasterThumb = ext === "pdf" || IMAGE_EXTENSIONS.has(ext);
|
||||
const resolvedThumbnail = useLazyThumbnail(
|
||||
fileId,
|
||||
size ?? 0,
|
||||
useRasterThumb ? thumbnailUrl : undefined,
|
||||
);
|
||||
|
||||
const itemRef = useRef<HTMLDivElement>(null);
|
||||
const [hoverRect, setHoverRect] = useState<DOMRect | null>(null);
|
||||
@@ -302,17 +239,7 @@ export function FileItem({
|
||||
) : (
|
||||
<>
|
||||
<div className="file-sidebar-file-checkbox-hover" />
|
||||
{isPdf ? (
|
||||
<FilePdfIcon
|
||||
className="file-sidebar-file-icon file-sidebar-file-icon-hover-hide"
|
||||
style={{ color: "#DC2626" }}
|
||||
/>
|
||||
) : (
|
||||
<FileGenericIcon
|
||||
className="file-sidebar-file-icon file-sidebar-file-icon-hover-hide"
|
||||
style={{ color: "#71717A" }}
|
||||
/>
|
||||
)}
|
||||
{getSidebarFileIcon(ext)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
@@ -349,7 +276,8 @@ export function FileItem({
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{thumbPos &&
|
||||
{useRasterThumb &&
|
||||
thumbPos &&
|
||||
resolvedThumbnail &&
|
||||
createPortal(
|
||||
<div
|
||||
|
||||
@@ -11,6 +11,7 @@ export interface HoverAction {
|
||||
disabled?: boolean;
|
||||
color?: string;
|
||||
hidden?: boolean;
|
||||
dataTour?: string;
|
||||
}
|
||||
|
||||
interface HoverActionMenuProps {
|
||||
@@ -63,7 +64,8 @@ const HoverActionMenu: React.FC<HoverActionMenuProps> = ({
|
||||
disabled={action.disabled}
|
||||
onClick={action.onClick}
|
||||
c={action.color}
|
||||
style={{ color: action.color || "var(--right-rail-icon)" }}
|
||||
style={{ color: action.color || "var(--text-secondary)" }}
|
||||
data-tour={action.dataTour}
|
||||
>
|
||||
{action.icon}
|
||||
</ActionIcon>
|
||||
|
||||
@@ -50,6 +50,7 @@ interface InfoBannerProps {
|
||||
buttonVariant?: "light" | "filled" | "white" | "outline" | "subtle";
|
||||
minHeight?: number | string;
|
||||
closeIconColor?: string;
|
||||
compact?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -75,6 +76,7 @@ export const InfoBanner: React.FC<InfoBannerProps> = ({
|
||||
buttonVariant = "light",
|
||||
minHeight = 56,
|
||||
closeIconColor,
|
||||
compact = false,
|
||||
}) => {
|
||||
if (!show) {
|
||||
return null;
|
||||
@@ -85,13 +87,21 @@ export const InfoBanner: React.FC<InfoBannerProps> = ({
|
||||
onDismiss?.();
|
||||
};
|
||||
|
||||
const iconSize = compact ? "1rem" : "1.2rem";
|
||||
const textSize = compact ? "xs" : "sm";
|
||||
const buttonSize = compact ? "xs" : "xs";
|
||||
|
||||
return (
|
||||
<Paper
|
||||
p="sm"
|
||||
p={compact ? "xs" : "sm"}
|
||||
radius={0}
|
||||
style={{
|
||||
background: background ?? toneStyle.background,
|
||||
borderBottom: `1px solid ${borderColor ?? toneStyle.border}`,
|
||||
border: "none",
|
||||
borderBottom:
|
||||
borderColor === "transparent"
|
||||
? "none"
|
||||
: `1px solid ${borderColor ?? toneStyle.border}`,
|
||||
minHeight,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
@@ -105,22 +115,22 @@ export const InfoBanner: React.FC<InfoBannerProps> = ({
|
||||
style={{ width: "100%" }}
|
||||
>
|
||||
<Group
|
||||
gap="sm"
|
||||
gap={compact ? "xs" : "sm"}
|
||||
align="center"
|
||||
wrap="nowrap"
|
||||
style={{ flex: 1, minWidth: 0 }}
|
||||
>
|
||||
<LocalIcon
|
||||
icon={icon}
|
||||
width="1.2rem"
|
||||
height="1.2rem"
|
||||
width={iconSize}
|
||||
height={iconSize}
|
||||
style={{ color: iconColor ?? toneStyle.icon, flexShrink: 0 }}
|
||||
/>
|
||||
<Stack gap={2} style={{ flex: 1, minWidth: 0 }}>
|
||||
<Stack gap={compact ? 1 : 2} style={{ flex: 1, minWidth: 0 }}>
|
||||
{title && (
|
||||
<Text
|
||||
fw={600}
|
||||
size="sm"
|
||||
size={textSize}
|
||||
style={{ color: textColor ?? toneStyle.text }}
|
||||
>
|
||||
{title}
|
||||
@@ -128,9 +138,9 @@ export const InfoBanner: React.FC<InfoBannerProps> = ({
|
||||
)}
|
||||
<Text
|
||||
fw={title ? 400 : 500}
|
||||
size="sm"
|
||||
size={textSize}
|
||||
style={{ color: textColor ?? toneStyle.text }}
|
||||
lineClamp={2}
|
||||
lineClamp={compact ? 1 : 2}
|
||||
>
|
||||
{message}
|
||||
</Text>
|
||||
@@ -141,11 +151,15 @@ export const InfoBanner: React.FC<InfoBannerProps> = ({
|
||||
<Button
|
||||
variant={buttonVariant}
|
||||
color={buttonColor ?? toneStyle.buttonColor}
|
||||
size="xs"
|
||||
size={buttonSize}
|
||||
onClick={onButtonClick}
|
||||
loading={loading}
|
||||
leftSection={
|
||||
<LocalIcon icon={buttonIcon} width="0.9rem" height="0.9rem" />
|
||||
<LocalIcon
|
||||
icon={buttonIcon}
|
||||
width={compact ? "0.75rem" : "0.9rem"}
|
||||
height={compact ? "0.75rem" : "0.9rem"}
|
||||
/>
|
||||
}
|
||||
>
|
||||
{buttonText}
|
||||
@@ -160,7 +174,11 @@ export const InfoBanner: React.FC<InfoBannerProps> = ({
|
||||
aria-label="Dismiss"
|
||||
style={closeIconColor ? { color: closeIconColor } : undefined}
|
||||
>
|
||||
<LocalIcon icon="close-rounded" width="1rem" height="1rem" />
|
||||
<LocalIcon
|
||||
icon="close-rounded"
|
||||
width={compact ? "0.85rem" : "1rem"}
|
||||
height={compact ? "0.85rem" : "1rem"}
|
||||
/>
|
||||
</ActionIcon>
|
||||
)}
|
||||
</Group>
|
||||
|
||||
@@ -91,10 +91,10 @@ const LanguageItem: React.FC<LanguageItemProps> = ({
|
||||
? "light-dark(var(--mantine-color-blue-1), var(--mantine-color-blue-8))"
|
||||
: "transparent",
|
||||
color: disabled
|
||||
? "light-dark(var(--mantine-color-gray-5), var(--mantine-color-dark-3))"
|
||||
? "var(--text-muted)"
|
||||
: isSelected
|
||||
? "light-dark(var(--mantine-color-blue-9), var(--mantine-color-white))"
|
||||
: "light-dark(var(--mantine-color-gray-7), var(--mantine-color-white))",
|
||||
? "light-dark(var(--mantine-color-blue-9), var(--mantine-color-blue-3))"
|
||||
: "var(--text-primary)",
|
||||
transition: "all 0.12s cubic-bezier(0.25, 0.46, 0.45, 0.94)",
|
||||
cursor: disabled ? "not-allowed" : "pointer",
|
||||
"&:hover": !disabled
|
||||
@@ -274,12 +274,11 @@ const LanguageSelector: React.FC<LanguageSelectorProps> = ({
|
||||
<ActionIcon
|
||||
variant="subtle"
|
||||
radius="md"
|
||||
className="right-rail-icon"
|
||||
data-testid="language-selector-button"
|
||||
title={!opened && tooltip ? tooltip : undefined}
|
||||
styles={{
|
||||
root: {
|
||||
color: "var(--right-rail-icon)",
|
||||
color: "var(--text-secondary)",
|
||||
"&:hover": {
|
||||
backgroundColor:
|
||||
"light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-5))",
|
||||
@@ -300,8 +299,7 @@ const LanguageSelector: React.FC<LanguageSelectorProps> = ({
|
||||
styles={{
|
||||
root: {
|
||||
border: "none",
|
||||
color:
|
||||
"light-dark(var(--mantine-color-gray-7), var(--mantine-color-gray-1))",
|
||||
color: "var(--text-primary)",
|
||||
transition:
|
||||
"background-color 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94)",
|
||||
"&:hover": {
|
||||
|
||||
@@ -197,7 +197,7 @@ export const PageEditorFileDropdown: React.FC<PageEditorFileDropdownProps> = ({
|
||||
<Menu.Dropdown
|
||||
className="ph-no-capture"
|
||||
style={{
|
||||
backgroundColor: "var(--right-rail-bg)",
|
||||
backgroundColor: "var(--bg-file-manager)",
|
||||
border: "1px solid var(--border-subtle)",
|
||||
borderRadius: "8px",
|
||||
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)",
|
||||
|
||||
@@ -1,375 +0,0 @@
|
||||
import React, { useCallback, useMemo } from "react";
|
||||
import { ActionIcon, Divider } from "@mantine/core";
|
||||
import "@app/components/shared/rightRail/RightRail.css";
|
||||
import { useToolWorkflow } from "@app/contexts/ToolWorkflowContext";
|
||||
import { useRightRail } from "@app/contexts/RightRailContext";
|
||||
import {
|
||||
useFileState,
|
||||
useFileSelection,
|
||||
useFileActions,
|
||||
} from "@app/contexts/FileContext";
|
||||
import { isStirlingFile } from "@app/types/fileContext";
|
||||
import { useNavigationState } from "@app/contexts/NavigationContext";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useFileActionTerminology } from "@app/hooks/useFileActionTerminology";
|
||||
import { useFileActionIcons } from "@app/hooks/useFileActionIcons";
|
||||
|
||||
import LanguageSelector from "@app/components/shared/LanguageSelector";
|
||||
import { useRainbowThemeContext } from "@app/components/shared/RainbowThemeProvider";
|
||||
import { Tooltip } from "@app/components/shared/Tooltip";
|
||||
import { ViewerContext } from "@app/contexts/ViewerContext";
|
||||
import LocalIcon from "@app/components/shared/LocalIcon";
|
||||
import { RightRailFooterExtensions } from "@app/components/rightRail/RightRailFooterExtensions";
|
||||
import DarkModeIcon from "@mui/icons-material/DarkMode";
|
||||
import LightModeIcon from "@mui/icons-material/LightMode";
|
||||
|
||||
import { useSidebarContext } from "@app/contexts/SidebarContext";
|
||||
import {
|
||||
RightRailButtonConfig,
|
||||
RightRailRenderContext,
|
||||
RightRailSection,
|
||||
} from "@app/types/rightRail";
|
||||
import { useRightRailTooltipSide } from "@app/hooks/useRightRailTooltipSide";
|
||||
import { downloadFile } from "@app/services/downloadService";
|
||||
|
||||
const SECTION_ORDER: RightRailSection[] = ["top", "middle", "bottom"];
|
||||
|
||||
function renderWithTooltip(
|
||||
node: React.ReactNode,
|
||||
tooltip: React.ReactNode | undefined,
|
||||
position: "left" | "right" | "bottom",
|
||||
offset: number,
|
||||
) {
|
||||
if (!tooltip) return node;
|
||||
|
||||
const portalTarget =
|
||||
typeof document !== "undefined" ? document.body : undefined;
|
||||
|
||||
return (
|
||||
<Tooltip
|
||||
content={tooltip}
|
||||
position={position}
|
||||
offset={offset}
|
||||
arrow
|
||||
portalTarget={portalTarget}
|
||||
>
|
||||
<div className="right-rail-tooltip-wrapper">{node}</div>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
|
||||
export default function RightRail() {
|
||||
const { sidebarRefs } = useSidebarContext();
|
||||
const { position: tooltipPosition, offset: tooltipOffset } =
|
||||
useRightRailTooltipSide(sidebarRefs);
|
||||
const { t } = useTranslation();
|
||||
const terminology = useFileActionTerminology();
|
||||
const icons = useFileActionIcons();
|
||||
const viewerContext = React.useContext(ViewerContext);
|
||||
const { toggleTheme, themeMode } = useRainbowThemeContext();
|
||||
const { buttons, actions, allButtonsDisabled } = useRightRail();
|
||||
|
||||
const { pageEditorFunctions, toolPanelMode, leftPanelView } =
|
||||
useToolWorkflow();
|
||||
const disableForFullscreen =
|
||||
toolPanelMode === "fullscreen" && leftPanelView === "toolPicker";
|
||||
|
||||
const { workbench: currentView } = useNavigationState();
|
||||
|
||||
const { selectors } = useFileState();
|
||||
const { selectedFiles, selectedFileIds } = useFileSelection();
|
||||
const { actions: fileActions } = useFileActions();
|
||||
const activeFiles = selectors.getFiles();
|
||||
const pageEditorTotalPages = pageEditorFunctions?.totalPages ?? 0;
|
||||
const pageEditorSelectedCount =
|
||||
pageEditorFunctions?.selectedPageIds?.length ?? 0;
|
||||
|
||||
const totalItems = useMemo(() => {
|
||||
if (currentView === "pageEditor") return pageEditorTotalPages;
|
||||
return activeFiles.length;
|
||||
}, [currentView, pageEditorTotalPages, activeFiles.length]);
|
||||
|
||||
const selectedCount = useMemo(() => {
|
||||
if (currentView === "pageEditor") {
|
||||
return pageEditorSelectedCount;
|
||||
}
|
||||
return selectedFileIds.length;
|
||||
}, [currentView, pageEditorSelectedCount, selectedFileIds.length]);
|
||||
|
||||
const sectionsWithButtons = useMemo(() => {
|
||||
return SECTION_ORDER.map((section) => {
|
||||
const sectionButtons = buttons.filter(
|
||||
(btn) => (btn.section ?? "top") === section && (btn.visible ?? true),
|
||||
);
|
||||
return { section, buttons: sectionButtons };
|
||||
}).filter((entry) => entry.buttons.length > 0);
|
||||
}, [buttons]);
|
||||
|
||||
const renderButton = useCallback(
|
||||
(btn: RightRailButtonConfig) => {
|
||||
const action = actions[btn.id];
|
||||
const disabled = Boolean(
|
||||
btn.disabled || allButtonsDisabled || disableForFullscreen,
|
||||
);
|
||||
const isActive = Boolean(btn.active);
|
||||
|
||||
const triggerAction = () => {
|
||||
if (!disabled) action?.();
|
||||
};
|
||||
|
||||
if (btn.render) {
|
||||
const context: RightRailRenderContext = {
|
||||
id: btn.id,
|
||||
disabled,
|
||||
allButtonsDisabled,
|
||||
action,
|
||||
triggerAction,
|
||||
active: isActive,
|
||||
};
|
||||
return btn.render(context) ?? null;
|
||||
}
|
||||
|
||||
if (!btn.icon) return null;
|
||||
|
||||
const ariaLabel =
|
||||
btn.ariaLabel ||
|
||||
(typeof btn.tooltip === "string" ? (btn.tooltip as string) : undefined);
|
||||
const className = ["right-rail-icon", btn.className]
|
||||
.filter(Boolean)
|
||||
.join(" ");
|
||||
const buttonNode = (
|
||||
<ActionIcon
|
||||
variant={isActive ? "filled" : "subtle"}
|
||||
color={isActive ? "blue" : undefined}
|
||||
radius="md"
|
||||
className={className}
|
||||
onClick={triggerAction}
|
||||
disabled={disabled}
|
||||
aria-label={ariaLabel}
|
||||
aria-pressed={isActive ? true : undefined}
|
||||
data-active={isActive ? "true" : "false"}
|
||||
>
|
||||
{btn.icon}
|
||||
</ActionIcon>
|
||||
);
|
||||
|
||||
return renderWithTooltip(
|
||||
buttonNode,
|
||||
btn.tooltip,
|
||||
tooltipPosition,
|
||||
tooltipOffset,
|
||||
);
|
||||
},
|
||||
[
|
||||
actions,
|
||||
allButtonsDisabled,
|
||||
disableForFullscreen,
|
||||
tooltipPosition,
|
||||
tooltipOffset,
|
||||
],
|
||||
);
|
||||
|
||||
const handleExportAll = useCallback(
|
||||
async (forceNewFile = false) => {
|
||||
if (currentView === "viewer") {
|
||||
const buffer = await viewerContext?.exportActions?.saveAsCopy?.();
|
||||
if (!buffer) return;
|
||||
const fileToExport =
|
||||
selectedFiles.length > 0 ? selectedFiles[0] : activeFiles[0];
|
||||
if (!fileToExport) return;
|
||||
const stub = isStirlingFile(fileToExport)
|
||||
? selectors.getStirlingFileStub(fileToExport.fileId)
|
||||
: undefined;
|
||||
try {
|
||||
const result = await downloadFile({
|
||||
data: new Blob([buffer], { type: "application/pdf" }),
|
||||
filename: fileToExport.name,
|
||||
localPath: forceNewFile ? undefined : stub?.localFilePath,
|
||||
});
|
||||
if (!forceNewFile && !result.cancelled && stub && result.savedPath) {
|
||||
fileActions.updateStirlingFileStub(stub.id, {
|
||||
localFilePath: stub.localFilePath ?? result.savedPath,
|
||||
isDirty: false,
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("[RightRail] Failed to export viewer file:", error);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentView === "pageEditor") {
|
||||
pageEditorFunctions?.onExportAll?.();
|
||||
return;
|
||||
}
|
||||
|
||||
const filesToExport =
|
||||
selectedFiles.length > 0 ? selectedFiles : activeFiles;
|
||||
|
||||
if (filesToExport.length > 0) {
|
||||
for (const file of filesToExport) {
|
||||
const stub = isStirlingFile(file)
|
||||
? selectors.getStirlingFileStub(file.fileId)
|
||||
: undefined;
|
||||
try {
|
||||
const result = await downloadFile({
|
||||
data: file,
|
||||
filename: file.name,
|
||||
localPath: forceNewFile ? undefined : stub?.localFilePath,
|
||||
});
|
||||
if (result.cancelled) continue;
|
||||
if (!forceNewFile && stub && result.savedPath) {
|
||||
fileActions.updateStirlingFileStub(stub.id, {
|
||||
localFilePath: stub.localFilePath ?? result.savedPath,
|
||||
isDirty: false,
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(
|
||||
"[RightRail] Failed to export file:",
|
||||
file.name,
|
||||
error,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
[
|
||||
currentView,
|
||||
selectedFiles,
|
||||
activeFiles,
|
||||
pageEditorFunctions,
|
||||
viewerContext,
|
||||
selectors,
|
||||
fileActions,
|
||||
],
|
||||
);
|
||||
|
||||
const downloadTooltip = useMemo(() => {
|
||||
if (currentView === "pageEditor") {
|
||||
return t("rightRail.exportAll", "Export PDF");
|
||||
}
|
||||
if (currentView === "viewer") {
|
||||
return terminology.download;
|
||||
}
|
||||
if (selectedCount > 0) {
|
||||
return terminology.downloadSelected;
|
||||
}
|
||||
return terminology.downloadAll;
|
||||
}, [currentView, selectedCount, t, terminology]);
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={sidebarRefs.rightRailRef}
|
||||
className="right-rail"
|
||||
data-sidebar="right-rail"
|
||||
>
|
||||
<div className="right-rail-inner">
|
||||
{sectionsWithButtons.map(({ section, buttons: sectionButtons }) => (
|
||||
<React.Fragment key={section}>
|
||||
<div className="right-rail-section" data-tour="right-rail-controls">
|
||||
{sectionButtons.map((btn, index) => {
|
||||
const content = renderButton(btn);
|
||||
if (!content) return null;
|
||||
return (
|
||||
<div
|
||||
key={btn.id}
|
||||
className="right-rail-button-wrapper"
|
||||
style={{ animationDelay: `${index * 50}ms` }}
|
||||
>
|
||||
{content}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
<Divider className="right-rail-divider" />
|
||||
</React.Fragment>
|
||||
))}
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
alignItems: "center",
|
||||
gap: "1rem",
|
||||
}}
|
||||
data-tour="right-rail-settings"
|
||||
>
|
||||
{renderWithTooltip(
|
||||
<ActionIcon
|
||||
variant="subtle"
|
||||
radius="md"
|
||||
className="right-rail-icon"
|
||||
onClick={toggleTheme}
|
||||
>
|
||||
{themeMode === "dark" ? (
|
||||
<LightModeIcon sx={{ fontSize: "1.5rem" }} />
|
||||
) : (
|
||||
<DarkModeIcon sx={{ fontSize: "1.5rem" }} />
|
||||
)}
|
||||
</ActionIcon>,
|
||||
t("rightRail.toggleTheme", "Toggle Theme"),
|
||||
tooltipPosition,
|
||||
tooltipOffset,
|
||||
)}
|
||||
|
||||
<LanguageSelector
|
||||
position="left-start"
|
||||
offset={6}
|
||||
compact
|
||||
tooltip={t("rightRail.language", "Language")}
|
||||
/>
|
||||
|
||||
{renderWithTooltip(
|
||||
<ActionIcon
|
||||
variant="subtle"
|
||||
radius="md"
|
||||
className="right-rail-icon"
|
||||
onClick={() => handleExportAll()}
|
||||
disabled={
|
||||
disableForFullscreen ||
|
||||
(currentView !== "viewer" &&
|
||||
(totalItems === 0 || allButtonsDisabled))
|
||||
}
|
||||
>
|
||||
<LocalIcon
|
||||
icon={icons.downloadIconName}
|
||||
width="1.5rem"
|
||||
height="1.5rem"
|
||||
/>
|
||||
</ActionIcon>,
|
||||
downloadTooltip,
|
||||
tooltipPosition,
|
||||
tooltipOffset,
|
||||
)}
|
||||
{icons.saveAsIconName &&
|
||||
renderWithTooltip(
|
||||
<ActionIcon
|
||||
variant="subtle"
|
||||
radius="md"
|
||||
className="right-rail-icon"
|
||||
onClick={() => handleExportAll(true)}
|
||||
disabled={
|
||||
disableForFullscreen ||
|
||||
(currentView !== "viewer" &&
|
||||
(totalItems === 0 || allButtonsDisabled))
|
||||
}
|
||||
>
|
||||
<LocalIcon
|
||||
icon={icons.saveAsIconName}
|
||||
width="1.5rem"
|
||||
height="1.5rem"
|
||||
/>
|
||||
</ActionIcon>,
|
||||
t("rightRail.saveAs", "Save As"),
|
||||
tooltipPosition,
|
||||
tooltipOffset,
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="right-rail-spacer" />
|
||||
|
||||
<RightRailFooterExtensions className="right-rail-footer" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
/* ========== WORKBENCH BAR ========== */
|
||||
/* Horizontal toolbar at the top of the workbench area.
|
||||
Replaces TopControls (view switcher) and RightRail (action buttons). */
|
||||
/* Horizontal toolbar at the top of the workbench area. */
|
||||
|
||||
.workbench-bar {
|
||||
display: flex;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { useCallback, useEffect, useMemo, useRef } from "react";
|
||||
import { ActionIcon } from "@mantine/core";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useRightRail } from "@app/contexts/RightRailContext";
|
||||
import { useWorkbenchBar } from "@app/contexts/WorkbenchBarContext";
|
||||
import {
|
||||
useFileState,
|
||||
useFileSelection,
|
||||
@@ -18,17 +18,17 @@ import { Tooltip } from "@app/components/shared/Tooltip";
|
||||
import LocalIcon from "@app/components/shared/LocalIcon";
|
||||
import { downloadFile } from "@app/services/downloadService";
|
||||
import {
|
||||
RightRailButtonConfig,
|
||||
RightRailRenderContext,
|
||||
RightRailSection,
|
||||
} from "@app/types/rightRail";
|
||||
WorkbenchBarButtonConfig,
|
||||
WorkbenchBarRenderContext,
|
||||
WorkbenchBarSection,
|
||||
} from "@app/types/workbenchBar";
|
||||
import InsertDriveFileIcon from "@mui/icons-material/InsertDriveFile";
|
||||
import FolderIcon from "@mui/icons-material/Folder";
|
||||
import CloseIcon from "@mui/icons-material/Close";
|
||||
import PrintIcon from "@mui/icons-material/Print";
|
||||
import "@app/components/shared/WorkbenchBar.css";
|
||||
|
||||
const SECTION_ORDER: RightRailSection[] = ["top", "middle", "bottom"];
|
||||
const SECTION_ORDER: WorkbenchBarSection[] = ["top", "middle", "bottom"];
|
||||
|
||||
interface ViewOption {
|
||||
value: WorkbenchType;
|
||||
@@ -66,7 +66,7 @@ export default function WorkbenchBar({
|
||||
hasFiles,
|
||||
}: WorkbenchBarProps) {
|
||||
const { t } = useTranslation();
|
||||
const { buttons, actions, allButtonsDisabled } = useRightRail();
|
||||
const { buttons, actions, allButtonsDisabled } = useWorkbenchBar();
|
||||
const {
|
||||
pageEditorFunctions,
|
||||
toolPanelMode,
|
||||
@@ -227,14 +227,14 @@ export default function WorkbenchBar({
|
||||
|
||||
const downloadTooltip = useMemo(() => {
|
||||
if (currentView === "pageEditor")
|
||||
return t("rightRail.exportAll", "Export PDF");
|
||||
return t("workbenchBar.exportAll", "Export PDF");
|
||||
if (currentView === "viewer") return terminology.download;
|
||||
if (selectedCount > 0) return terminology.downloadSelected;
|
||||
return terminology.downloadAll;
|
||||
}, [currentView, selectedCount, t, terminology]);
|
||||
|
||||
const renderButton = useCallback(
|
||||
(btn: RightRailButtonConfig) => {
|
||||
(btn: WorkbenchBarButtonConfig) => {
|
||||
const action = actions[btn.id];
|
||||
const disabled = Boolean(
|
||||
btn.disabled || allButtonsDisabled || disableForFullscreen,
|
||||
@@ -246,7 +246,7 @@ export default function WorkbenchBar({
|
||||
};
|
||||
|
||||
if (btn.render) {
|
||||
const context: RightRailRenderContext = {
|
||||
const context: WorkbenchBarRenderContext = {
|
||||
id: btn.id,
|
||||
disabled,
|
||||
allButtonsDisabled,
|
||||
@@ -357,7 +357,7 @@ export default function WorkbenchBar({
|
||||
data-tour="workbench-bar"
|
||||
>
|
||||
{/* Left: View switcher */}
|
||||
<div className="workbench-bar-views">
|
||||
<div className="workbench-bar-views" data-tour="view-switcher">
|
||||
{hasFiles &&
|
||||
viewOptions.map((opt) => (
|
||||
<button
|
||||
@@ -408,11 +408,11 @@ export default function WorkbenchBar({
|
||||
disabled={
|
||||
totalItems === 0 || allButtonsDisabled || disableForFullscreen
|
||||
}
|
||||
aria-label={t("rightRail.print", "Print PDF")}
|
||||
aria-label={t("workbenchBar.print", "Print PDF")}
|
||||
>
|
||||
<PrintIcon sx={{ fontSize: "1rem" }} />
|
||||
</ActionIcon>,
|
||||
t("rightRail.print", "Print PDF"),
|
||||
t("workbenchBar.print", "Print PDF"),
|
||||
)}
|
||||
|
||||
{/* Download */}
|
||||
@@ -453,7 +453,7 @@ export default function WorkbenchBar({
|
||||
height="1rem"
|
||||
/>
|
||||
</ActionIcon>,
|
||||
t("rightRail.saveAs", "Save As"),
|
||||
t("workbenchBar.saveAs", "Save As"),
|
||||
)}
|
||||
|
||||
{/* Separator: export group | close */}
|
||||
@@ -474,15 +474,15 @@ export default function WorkbenchBar({
|
||||
}
|
||||
aria-label={
|
||||
currentView === "fileEditor"
|
||||
? t("rightRail.closeAll", "Close All")
|
||||
: t("rightRail.closePdf", "Close PDF")
|
||||
? t("workbenchBar.closeAll", "Close All")
|
||||
: t("workbenchBar.closePdf", "Close PDF")
|
||||
}
|
||||
>
|
||||
<CloseIcon sx={{ fontSize: "1rem" }} />
|
||||
</ActionIcon>,
|
||||
currentView === "fileEditor"
|
||||
? t("rightRail.closeAll", "Close All")
|
||||
: t("rightRail.closePdf", "Close PDF"),
|
||||
? t("workbenchBar.closeAll", "Close All")
|
||||
: t("workbenchBar.closePdf", "Close PDF"),
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,6 +3,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { NavKey } from "@app/components/shared/config/types";
|
||||
import HotkeysSection from "@app/components/shared/config/configSections/HotkeysSection";
|
||||
import GeneralSection from "@app/components/shared/config/configSections/GeneralSection";
|
||||
import HelpSection from "@app/components/shared/config/configSections/HelpSection";
|
||||
|
||||
export interface ConfigNavItem {
|
||||
key: NavKey;
|
||||
@@ -34,6 +35,7 @@ export const useConfigNavSections = (
|
||||
_isAdmin: boolean = false,
|
||||
_runningEE: boolean = false,
|
||||
_loginEnabled: boolean = false,
|
||||
onRequestClose: () => void = () => {},
|
||||
): ConfigNavSection[] => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -55,6 +57,19 @@ export const useConfigNavSections = (
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: t("settings.help.title", "Help"),
|
||||
items: [
|
||||
{
|
||||
key: "help",
|
||||
label: t("settings.help.label", "Tours"),
|
||||
icon: "help-rounded",
|
||||
component: (
|
||||
<HelpSection isAdmin={_isAdmin} onRequestClose={onRequestClose} />
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
return sections;
|
||||
|
||||
@@ -476,7 +476,7 @@ const GeneralSection: React.FC<GeneralSectionProps> = ({
|
||||
<Text size="xs" c="dimmed" mt={4}>
|
||||
{t(
|
||||
"settings.general.defaultStartupViewDescription",
|
||||
"Choose which tab is active in the left column when the app starts",
|
||||
"Choose which view is active when the app starts",
|
||||
)}
|
||||
</Text>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
import React from "react";
|
||||
import { Button, Group, Paper, Stack, Text } from "@mantine/core";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import LocalIcon from "@app/components/shared/LocalIcon";
|
||||
import { requestStartTour } from "@app/constants/events";
|
||||
|
||||
interface HelpSectionProps {
|
||||
isAdmin: boolean;
|
||||
onRequestClose: () => void;
|
||||
}
|
||||
|
||||
const HelpSection: React.FC<HelpSectionProps> = ({
|
||||
isAdmin,
|
||||
onRequestClose,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const startTour = (tourType: "tools" | "admin") => {
|
||||
onRequestClose();
|
||||
setTimeout(() => requestStartTour(tourType), 300);
|
||||
};
|
||||
|
||||
return (
|
||||
<Stack gap="lg">
|
||||
<Paper withBorder p="md" radius="md">
|
||||
<Stack gap="md">
|
||||
<Group justify="space-between" align="center">
|
||||
<div>
|
||||
<Text fw={600} size="sm">
|
||||
{t("settings.help.toolsTour.title", "Tools Tour")}
|
||||
</Text>
|
||||
<Text size="xs" c="dimmed" mt={4}>
|
||||
{t(
|
||||
"settings.help.toolsTour.description",
|
||||
"Walk through uploading files, picking a tool, and reviewing results.",
|
||||
)}
|
||||
</Text>
|
||||
</div>
|
||||
<Button
|
||||
variant="default"
|
||||
size="sm"
|
||||
leftSection={
|
||||
<LocalIcon
|
||||
icon="build-outline-rounded"
|
||||
width="1rem"
|
||||
height="1rem"
|
||||
/>
|
||||
}
|
||||
onClick={() => startTour("tools")}
|
||||
>
|
||||
{t("settings.help.toolsTour.start", "Start")}
|
||||
</Button>
|
||||
</Group>
|
||||
|
||||
{isAdmin && (
|
||||
<Group justify="space-between" align="center">
|
||||
<div>
|
||||
<Text fw={600} size="sm">
|
||||
{t("settings.help.adminTour.title", "Admin Tour")}
|
||||
</Text>
|
||||
<Text size="xs" c="dimmed" mt={4}>
|
||||
{t(
|
||||
"settings.help.adminTour.description",
|
||||
"Explore team management, system settings, and enterprise features.",
|
||||
)}
|
||||
</Text>
|
||||
</div>
|
||||
<Button
|
||||
variant="default"
|
||||
size="sm"
|
||||
leftSection={
|
||||
<LocalIcon icon="person-rounded" width="1rem" height="1rem" />
|
||||
}
|
||||
onClick={() => startTour("admin")}
|
||||
>
|
||||
{t("settings.help.adminTour.start", "Start")}
|
||||
</Button>
|
||||
</Group>
|
||||
)}
|
||||
</Stack>
|
||||
</Paper>
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
|
||||
export default HelpSection;
|
||||
@@ -30,6 +30,7 @@ export const VALID_NAV_KEYS = [
|
||||
"adminUsage",
|
||||
"adminEndpoints",
|
||||
"adminStorageSharing",
|
||||
"help",
|
||||
] as const;
|
||||
|
||||
// Derive the type from the array
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
import React from "react";
|
||||
import { Box, Center, Image } from "@mantine/core";
|
||||
import { Box, Center, Loader, Stack, Text } from "@mantine/core";
|
||||
import LockIcon from "@mui/icons-material/Lock";
|
||||
import { getFileTypeIcon } from "@app/components/shared/filePreview/getFileTypeIcon";
|
||||
import { StirlingFileStub } from "@app/types/fileContext";
|
||||
import { PrivateContent } from "@app/components/shared/PrivateContent";
|
||||
import { detectFileExtension } from "@app/utils/fileUtils";
|
||||
|
||||
export interface DocumentThumbnailProps {
|
||||
file: File | StirlingFileStub | null;
|
||||
thumbnail?: string | null;
|
||||
isEncrypted?: boolean;
|
||||
isLoading?: boolean;
|
||||
iconSize?: string | number;
|
||||
imgClassName?: string;
|
||||
onImageError?: React.ReactEventHandler<HTMLImageElement>;
|
||||
style?: React.CSSProperties;
|
||||
onClick?: () => void;
|
||||
children?: React.ReactNode;
|
||||
@@ -15,14 +22,19 @@ export interface DocumentThumbnailProps {
|
||||
const DocumentThumbnail: React.FC<DocumentThumbnailProps> = ({
|
||||
file,
|
||||
thumbnail,
|
||||
isEncrypted = false,
|
||||
isLoading = false,
|
||||
iconSize = "4rem",
|
||||
imgClassName,
|
||||
onImageError,
|
||||
style = {},
|
||||
onClick,
|
||||
children,
|
||||
}) => {
|
||||
if (!file) return null;
|
||||
|
||||
const containerStyle = {
|
||||
position: "relative" as const,
|
||||
const containerStyle: React.CSSProperties = {
|
||||
position: "relative",
|
||||
cursor: onClick ? "pointer" : "default",
|
||||
transition: "opacity 0.2s ease",
|
||||
width: "100%",
|
||||
@@ -33,20 +45,29 @@ const DocumentThumbnail: React.FC<DocumentThumbnailProps> = ({
|
||||
...style,
|
||||
};
|
||||
|
||||
if (thumbnail) {
|
||||
if (thumbnail && !isEncrypted) {
|
||||
return (
|
||||
<Box style={containerStyle} onClick={onClick}>
|
||||
<PrivateContent>
|
||||
<Image
|
||||
<img
|
||||
src={thumbnail}
|
||||
alt={`Preview of ${file.name}`}
|
||||
fit="contain"
|
||||
style={{
|
||||
maxWidth: "100%",
|
||||
maxHeight: "100%",
|
||||
width: "auto",
|
||||
height: "auto",
|
||||
}}
|
||||
className={imgClassName}
|
||||
style={
|
||||
imgClassName
|
||||
? undefined
|
||||
: {
|
||||
maxWidth: "100%",
|
||||
maxHeight: "100%",
|
||||
width: "auto",
|
||||
height: "auto",
|
||||
objectFit: "contain",
|
||||
}
|
||||
}
|
||||
draggable={false}
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
onError={onImageError}
|
||||
/>
|
||||
</PrivateContent>
|
||||
{children}
|
||||
@@ -54,17 +75,93 @@ const DocumentThumbnail: React.FC<DocumentThumbnailProps> = ({
|
||||
);
|
||||
}
|
||||
|
||||
if (isEncrypted) {
|
||||
return (
|
||||
<Box style={containerStyle} onClick={onClick}>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
width: "calc(100% - 8px)",
|
||||
height: "calc(100% - 8px)",
|
||||
gap: "0.5rem",
|
||||
border: "2px dashed var(--mantine-color-red-5)",
|
||||
borderRadius: "10px",
|
||||
}}
|
||||
>
|
||||
<LockIcon
|
||||
style={{ fontSize: iconSize, color: "var(--mantine-color-red-6)" }}
|
||||
/>
|
||||
<span
|
||||
style={{
|
||||
fontSize: "0.65rem",
|
||||
fontWeight: 700,
|
||||
letterSpacing: "0.08em",
|
||||
textTransform: "uppercase",
|
||||
color: "var(--mantine-color-red-6)",
|
||||
background: "rgba(220,38,38,0.1)",
|
||||
padding: "2px 8px",
|
||||
borderRadius: "6px",
|
||||
}}
|
||||
>
|
||||
Locked
|
||||
</span>
|
||||
</div>
|
||||
{children}
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<Box style={containerStyle} onClick={onClick}>
|
||||
<Stack
|
||||
align="center"
|
||||
justify="center"
|
||||
gap="xs"
|
||||
style={{ height: "100%" }}
|
||||
>
|
||||
<Loader size="sm" />
|
||||
<Text size="xs" c="dimmed">
|
||||
Loading thumbnail...
|
||||
</Text>
|
||||
</Stack>
|
||||
{children}
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
const ext = detectFileExtension(file.name ?? "").toUpperCase();
|
||||
|
||||
return (
|
||||
<Box style={containerStyle} onClick={onClick}>
|
||||
<Center
|
||||
style={{
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
backgroundColor: "var(--mantine-color-gray-1)",
|
||||
borderRadius: "0.25rem",
|
||||
flexDirection: "column",
|
||||
gap: "0.75rem",
|
||||
}}
|
||||
>
|
||||
<PrivateContent>{getFileTypeIcon(file)}</PrivateContent>
|
||||
<PrivateContent>{getFileTypeIcon(file, iconSize)}</PrivateContent>
|
||||
{ext && (
|
||||
<span
|
||||
style={{
|
||||
fontSize: "0.7rem",
|
||||
fontWeight: 700,
|
||||
letterSpacing: "0.1em",
|
||||
textTransform: "uppercase",
|
||||
color: "var(--text-secondary)",
|
||||
background: "rgb(var(--border))",
|
||||
padding: "3px 10px",
|
||||
borderRadius: "6px",
|
||||
}}
|
||||
>
|
||||
{ext}
|
||||
</span>
|
||||
)}
|
||||
</Center>
|
||||
{children}
|
||||
</Box>
|
||||
|
||||
@@ -1,17 +1,84 @@
|
||||
import React from "react";
|
||||
import JavascriptIcon from "@mui/icons-material/Javascript";
|
||||
import PictureAsPdfIcon from "@mui/icons-material/PictureAsPdf";
|
||||
import InsertDriveFileIcon from "@mui/icons-material/InsertDriveFile";
|
||||
import { FileDocIcon } from "@app/components/shared/FileDocIcon";
|
||||
import type { FileDocVariant } from "@app/components/shared/FileDocIcon";
|
||||
import type { StirlingFileStub } from "@app/types/fileContext";
|
||||
import { detectFileExtension } from "@app/utils/fileUtils";
|
||||
|
||||
export const SPREADSHEET_EXTS = new Set(["csv", "xls", "xlsx", "ods"]);
|
||||
export const DOC_EXTS = new Set([
|
||||
"md",
|
||||
"markdown",
|
||||
"txt",
|
||||
"doc",
|
||||
"docx",
|
||||
"odt",
|
||||
"rtf",
|
||||
]);
|
||||
export const IMAGE_EXTS = new Set([
|
||||
"png",
|
||||
"jpg",
|
||||
"jpeg",
|
||||
"gif",
|
||||
"webp",
|
||||
"svg",
|
||||
"bmp",
|
||||
"tiff",
|
||||
"tif",
|
||||
]);
|
||||
export const ARCHIVE_EXTS = new Set([
|
||||
"zip",
|
||||
"tar",
|
||||
"gz",
|
||||
"rar",
|
||||
"7z",
|
||||
"cbz",
|
||||
"cbr",
|
||||
]);
|
||||
export const CODE_EXTS = new Set([
|
||||
"js",
|
||||
"ts",
|
||||
"jsx",
|
||||
"tsx",
|
||||
"html",
|
||||
"css",
|
||||
"json",
|
||||
"xml",
|
||||
"yaml",
|
||||
"yml",
|
||||
]);
|
||||
|
||||
type FileLike = File | StirlingFileStub;
|
||||
|
||||
/**
|
||||
* Returns an appropriate file type icon for the provided file.
|
||||
* - Uses the real file type and extension to decide the icon.
|
||||
* - No any-casts; accepts File or StirlingFileStub.
|
||||
*/
|
||||
export function getFileDocVariant(ext: string, mime = ""): FileDocVariant {
|
||||
if (ext === "pdf" || mime === "application/pdf") return "pdf";
|
||||
if (
|
||||
SPREADSHEET_EXTS.has(ext) ||
|
||||
mime.includes("spreadsheet") ||
|
||||
mime === "text/csv"
|
||||
)
|
||||
return "spreadsheet";
|
||||
if (
|
||||
DOC_EXTS.has(ext) ||
|
||||
mime === "text/markdown" ||
|
||||
mime === "text/plain" ||
|
||||
mime.includes("word") ||
|
||||
mime.includes("opendocument.text")
|
||||
)
|
||||
return "doc";
|
||||
if (IMAGE_EXTS.has(ext) || mime.startsWith("image/")) return "image";
|
||||
if (ARCHIVE_EXTS.has(ext) || mime.includes("zip") || mime.includes("archive"))
|
||||
return "archive";
|
||||
if (
|
||||
CODE_EXTS.has(ext) ||
|
||||
mime.includes("javascript") ||
|
||||
mime.includes("json") ||
|
||||
mime.includes("xml") ||
|
||||
mime === "text/html"
|
||||
)
|
||||
return "code";
|
||||
return "generic";
|
||||
}
|
||||
|
||||
export function getFileTypeIcon(
|
||||
file: FileLike,
|
||||
size: number | string = "2rem",
|
||||
@@ -19,29 +86,10 @@ export function getFileTypeIcon(
|
||||
const name = (file?.name ?? "").toLowerCase();
|
||||
const mime = (file?.type ?? "").toLowerCase();
|
||||
const ext = detectFileExtension(name);
|
||||
|
||||
// JavaScript
|
||||
if (ext === "js" || mime.includes("javascript")) {
|
||||
return (
|
||||
<JavascriptIcon
|
||||
style={{ fontSize: size, color: "var(--mantine-color-gray-6)" }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
// PDF
|
||||
if (ext === "pdf" || mime === "application/pdf") {
|
||||
return (
|
||||
<PictureAsPdfIcon
|
||||
style={{ fontSize: size, color: "var(--mantine-color-gray-6)" }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
// Fallback generic
|
||||
return (
|
||||
<InsertDriveFileIcon
|
||||
style={{ fontSize: size, color: "var(--mantine-color-gray-6)" }}
|
||||
<FileDocIcon
|
||||
variant={getFileDocVariant(ext, mime)}
|
||||
style={{ width: size, height: "auto" }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,145 +0,0 @@
|
||||
# RightRail Component
|
||||
|
||||
A dynamic vertical toolbar on the right side of the application that supports both static buttons (Undo/Redo, Save, Print, Share) and dynamic buttons registered by tools.
|
||||
|
||||
## Structure
|
||||
|
||||
- **Top Section**: Dynamic buttons from tools (empty when none)
|
||||
- **Middle Section**: Grid, Cut, Undo, Redo
|
||||
- **Bottom Section**: Save, Print, Share
|
||||
|
||||
## Usage
|
||||
|
||||
### For Tools (Recommended)
|
||||
|
||||
```tsx
|
||||
import { useRightRailButtons } from '../hooks/useRightRailButtons';
|
||||
import PlayArrowIcon from '@mui/icons-material/PlayArrow';
|
||||
|
||||
function MyTool() {
|
||||
const handleAction = useCallback(() => {
|
||||
// Your action here
|
||||
}, []);
|
||||
|
||||
useRightRailButtons([
|
||||
{
|
||||
id: 'my-action',
|
||||
icon: <PlayArrowIcon />,
|
||||
tooltip: 'Execute Action',
|
||||
onClick: handleAction,
|
||||
},
|
||||
]);
|
||||
|
||||
return <div>My Tool</div>;
|
||||
}
|
||||
```
|
||||
|
||||
### Multiple Buttons
|
||||
|
||||
```tsx
|
||||
useRightRailButtons([
|
||||
{
|
||||
id: 'primary',
|
||||
icon: <StarIcon />,
|
||||
tooltip: 'Primary Action',
|
||||
order: 1,
|
||||
onClick: handlePrimary,
|
||||
},
|
||||
{
|
||||
id: 'secondary',
|
||||
icon: <SettingsIcon />,
|
||||
tooltip: 'Secondary Action',
|
||||
order: 2,
|
||||
onClick: handleSecondary,
|
||||
},
|
||||
]);
|
||||
```
|
||||
|
||||
### Conditional Buttons
|
||||
|
||||
```tsx
|
||||
useRightRailButtons([
|
||||
// Always show
|
||||
{
|
||||
id: 'process',
|
||||
icon: <PlayArrowIcon />,
|
||||
tooltip: 'Process',
|
||||
disabled: isProcessing,
|
||||
onClick: handleProcess,
|
||||
},
|
||||
// Only show when condition met
|
||||
...(hasResults ? [{
|
||||
id: 'export',
|
||||
icon: <DownloadIcon />,
|
||||
tooltip: 'Export',
|
||||
onClick: handleExport,
|
||||
}] : []),
|
||||
]);
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### Button Config
|
||||
|
||||
```typescript
|
||||
interface RightRailButtonWithAction {
|
||||
id: string; // Unique identifier
|
||||
icon?: React.ReactNode; // Icon component (omit when using render)
|
||||
tooltip?: React.ReactNode; // Hover tooltip / description
|
||||
active?: boolean; // Optional active state for highlight
|
||||
section?: 'top' | 'middle' | 'bottom'; // Section (default: 'top')
|
||||
order?: number; // Sort order (default: 0)
|
||||
disabled?: boolean; // Disabled state (default: false)
|
||||
visible?: boolean; // Visibility (default: true)
|
||||
render?: (ctx: RightRailRenderContext) => React.ReactNode; // Custom renderer
|
||||
onClick?: () => void; // Click handler (optional if using render)
|
||||
}
|
||||
|
||||
interface RightRailRenderContext {
|
||||
id: string;
|
||||
disabled: boolean;
|
||||
allButtonsDisabled: boolean;
|
||||
action?: () => void;
|
||||
triggerAction: () => void;
|
||||
active: boolean;
|
||||
}
|
||||
```
|
||||
|
||||
### Custom Rendering (Popovers, Multi-button Blocks)
|
||||
|
||||
```tsx
|
||||
useRightRailButtons([
|
||||
{
|
||||
id: 'viewer-search',
|
||||
tooltip: t('rightRail.search', 'Search PDF'),
|
||||
render: ({ disabled }) => (
|
||||
<Tooltip content={t('rightRail.search', 'Search PDF')}>
|
||||
<Popover position="left">
|
||||
<Popover.Target>
|
||||
<ActionIcon disabled={disabled}>
|
||||
<SearchIcon />
|
||||
</ActionIcon>
|
||||
</Popover.Target>
|
||||
<Popover.Dropdown>
|
||||
<SearchInterface />
|
||||
</Popover.Dropdown>
|
||||
</Popover>
|
||||
</Tooltip>
|
||||
),
|
||||
},
|
||||
]);
|
||||
```
|
||||
|
||||
## Built-in Features
|
||||
|
||||
- **Undo/Redo**: Automatically integrates with Page Editor
|
||||
- **Theme Support**: Light/dark mode with CSS variables
|
||||
- **Auto Cleanup**: Buttons unregister when tool unmounts
|
||||
|
||||
## Best Practices
|
||||
|
||||
- Use descriptive IDs: `'compress-optimize'`, `'ocr-process'`
|
||||
- Choose appropriate Material-UI icons
|
||||
- Keep tooltips concise: `'Compress PDF'`, `'Process with OCR'`
|
||||
- Use `useCallback` for click handlers to prevent re-registration
|
||||
- Reach for `render` when you need popovers or multi-control groups inside the rail
|
||||
@@ -1,170 +0,0 @@
|
||||
.right-rail {
|
||||
background-color: var(--right-rail-bg);
|
||||
width: 3.5rem;
|
||||
min-width: 3.5rem;
|
||||
max-width: 3.5rem;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
border-left: 1px solid var(--border-subtle);
|
||||
}
|
||||
|
||||
.right-rail-inner {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
padding: 1rem 0.5rem;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.right-rail-section {
|
||||
background-color: var(--right-rail-foreground);
|
||||
border-radius: 12px;
|
||||
padding: 0.5rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.right-rail-button-wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
width: 100%;
|
||||
animation: rightRailButtonReveal 200ms ease forwards;
|
||||
transform-origin: top center;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.right-rail-tooltip-wrapper {
|
||||
display: inline-flex;
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@keyframes rightRailButtonReveal {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: scaleY(0.6) translateY(-6px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: scaleY(1) translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.right-rail-divider {
|
||||
width: 2.75rem;
|
||||
border: none;
|
||||
border-top: 1px solid var(--tool-subcategory-rule-color);
|
||||
margin: 0.25rem 0;
|
||||
}
|
||||
|
||||
.right-rail-icon {
|
||||
color: var(--right-rail-icon);
|
||||
}
|
||||
|
||||
.right-rail-icon[data-active="true"] {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.right-rail-icon[aria-disabled="true"],
|
||||
.right-rail-icon[disabled] {
|
||||
color: var(--right-rail-icon-disabled) !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
/* When all buttons are disabled via context */
|
||||
.right-rail--all-disabled .right-rail-icon {
|
||||
color: var(--right-rail-icon-disabled) !important;
|
||||
background-color: transparent !important;
|
||||
pointer-events: none !important;
|
||||
}
|
||||
|
||||
.right-rail-spacer {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
/* Animated grow-down slot for buttons (mirrors current-tool-slot behavior) */
|
||||
.right-rail-slot {
|
||||
overflow: hidden;
|
||||
max-height: 0;
|
||||
opacity: 0;
|
||||
transition:
|
||||
max-height 450ms ease-out,
|
||||
opacity 300ms ease-out;
|
||||
}
|
||||
|
||||
.right-rail-enter {
|
||||
animation: rightRailGrowDown 450ms ease-out;
|
||||
}
|
||||
|
||||
.right-rail-exit {
|
||||
animation: rightRailShrinkUp 450ms ease-out;
|
||||
}
|
||||
|
||||
.right-rail-slot.visible {
|
||||
max-height: 40rem; /* increased to fit additional controls + divider */
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
@keyframes rightRailGrowDown {
|
||||
0% {
|
||||
max-height: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
max-height: 40rem;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rightRailShrinkUp {
|
||||
0% {
|
||||
max-height: 40rem;
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
max-height: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Remove bottom margin from close icon */
|
||||
.right-rail-slot .right-rail-icon {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* Inline appear/disappear animation for page-number selector button */
|
||||
.right-rail-fade {
|
||||
transition-property: opacity, transform, max-height, visibility;
|
||||
transition-duration: 220ms, 220ms, 220ms, 0s;
|
||||
transition-timing-function: ease, ease, ease, linear;
|
||||
transition-delay: 0s, 0s, 0s, 0s;
|
||||
transform-origin: top center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.right-rail-fade.enter {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
max-height: 3rem;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.right-rail-fade.exit {
|
||||
opacity: 0;
|
||||
transform: scale(0.85);
|
||||
max-height: 0;
|
||||
visibility: hidden;
|
||||
/* delay visibility change so opacity/max-height can finish */
|
||||
transition-delay: 0s, 0s, 0s, 220ms;
|
||||
pointer-events: none;
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useState, useRef } from "react";
|
||||
import { ActionIcon, ScrollArea, Switch } from "@mantine/core";
|
||||
import DoubleArrowIcon from "@mui/icons-material/DoubleArrow";
|
||||
import { useRef } from "react";
|
||||
import { ScrollArea, Switch } from "@mantine/core";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import ToolSearch from "@app/components/tools/toolPicker/ToolSearch";
|
||||
import FullscreenToolList from "@app/components/tools/FullscreenToolList";
|
||||
@@ -9,10 +8,8 @@ import { ToolId } from "@app/types/toolId";
|
||||
import { useFocusTrap } from "@app/hooks/useFocusTrap";
|
||||
import { LogoIcon } from "@app/components/shared/LogoIcon";
|
||||
import { Wordmark } from "@app/components/shared/Wordmark";
|
||||
import { Tooltip } from "@app/components/shared/Tooltip";
|
||||
import "@app/components/tools/ToolPanel.css";
|
||||
import { ToolPanelGeometry } from "@app/hooks/tools/useToolPanelGeometry";
|
||||
import { Z_INDEX_OVER_FULLSCREEN_SURFACE } from "@app/styles/zIndex";
|
||||
|
||||
interface FullscreenToolSurfaceProps {
|
||||
searchQuery: string;
|
||||
@@ -28,7 +25,6 @@ interface FullscreenToolSurfaceProps {
|
||||
onSelect: (id: ToolId) => void;
|
||||
onToggleDescriptions: () => void;
|
||||
onExitFullscreenMode: () => void;
|
||||
toggleLabel: string;
|
||||
geometry: ToolPanelGeometry | null;
|
||||
}
|
||||
|
||||
@@ -42,47 +38,17 @@ const FullscreenToolSurface = ({
|
||||
onSearchChange,
|
||||
onSelect,
|
||||
onToggleDescriptions,
|
||||
onExitFullscreenMode,
|
||||
toggleLabel,
|
||||
onExitFullscreenMode: _onExitFullscreenMode,
|
||||
geometry,
|
||||
}: FullscreenToolSurfaceProps) => {
|
||||
const { t } = useTranslation();
|
||||
const [isExiting, setIsExiting] = useState(false);
|
||||
const surfaceRef = useRef<HTMLDivElement>(null);
|
||||
const isRTL =
|
||||
typeof document !== "undefined" && document.documentElement.dir === "rtl";
|
||||
|
||||
// Enable focus trap when surface is active
|
||||
useFocusTrap(surfaceRef, !isExiting);
|
||||
useFocusTrap(surfaceRef, true);
|
||||
|
||||
const brandAltText = t("home.mobile.brandAlt", "Stirling PDF logo");
|
||||
|
||||
const handleExit = () => {
|
||||
const prefersReducedMotion = window.matchMedia(
|
||||
"(prefers-reduced-motion: reduce)",
|
||||
).matches;
|
||||
|
||||
if (prefersReducedMotion) {
|
||||
onExitFullscreenMode();
|
||||
return;
|
||||
}
|
||||
|
||||
setIsExiting(true);
|
||||
const el = surfaceRef.current;
|
||||
if (!el) {
|
||||
onExitFullscreenMode();
|
||||
return;
|
||||
}
|
||||
// Rely on CSS animation end rather than duplicating timing in JS
|
||||
el.addEventListener(
|
||||
"animationend",
|
||||
() => {
|
||||
onExitFullscreenMode();
|
||||
},
|
||||
{ once: true },
|
||||
);
|
||||
};
|
||||
|
||||
const style = geometry
|
||||
? {
|
||||
left: `${geometry.left}px`,
|
||||
@@ -103,10 +69,7 @@ const FullscreenToolSurface = ({
|
||||
)}
|
||||
data-tour="tool-panel"
|
||||
>
|
||||
<div
|
||||
ref={surfaceRef}
|
||||
className={`tool-panel__fullscreen-surface-inner ${isExiting ? "tool-panel__fullscreen-surface-inner--exiting" : ""}`}
|
||||
>
|
||||
<div ref={surfaceRef} className="tool-panel__fullscreen-surface-inner">
|
||||
<header className="tool-panel__fullscreen-header">
|
||||
<div className="tool-panel__fullscreen-brand">
|
||||
<LogoIcon className="tool-panel__fullscreen-brand-icon" />
|
||||
@@ -115,29 +78,6 @@ const FullscreenToolSurface = ({
|
||||
className="tool-panel__fullscreen-brand-text"
|
||||
/>
|
||||
</div>
|
||||
<div style={{ display: "flex", gap: "0.5rem", alignItems: "center" }}>
|
||||
<Tooltip
|
||||
content={toggleLabel}
|
||||
position="bottom"
|
||||
arrow={true}
|
||||
openOnFocus={false}
|
||||
containerStyle={{ zIndex: Z_INDEX_OVER_FULLSCREEN_SURFACE }}
|
||||
>
|
||||
<ActionIcon
|
||||
variant="subtle"
|
||||
radius="xl"
|
||||
size="md"
|
||||
onClick={handleExit}
|
||||
aria-label={toggleLabel}
|
||||
style={{ color: "var(--right-rail-icon)" }}
|
||||
>
|
||||
<DoubleArrowIcon
|
||||
fontSize="small"
|
||||
style={{ transform: isRTL ? undefined : "rotate(180deg)" }}
|
||||
/>
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div className="tool-panel__fullscreen-controls">
|
||||
|
||||
@@ -120,16 +120,8 @@
|
||||
var(--text-primary) 20%,
|
||||
var(--border-subtle)
|
||||
);
|
||||
--fullscreen-text-icon: color-mix(
|
||||
in srgb,
|
||||
var(--text-primary) 90%,
|
||||
var(--text-muted)
|
||||
);
|
||||
--fullscreen-text-icon-compact: color-mix(
|
||||
in srgb,
|
||||
var(--text-primary) 88%,
|
||||
var(--text-muted)
|
||||
);
|
||||
--fullscreen-text-icon: var(--text-primary);
|
||||
--fullscreen-text-icon-compact: var(--text-primary);
|
||||
}
|
||||
|
||||
.tool-panel {
|
||||
@@ -190,7 +182,9 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
padding: 0.35rem 0.5rem;
|
||||
height: 48px;
|
||||
padding: 0 0.5rem;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.tool-panel__search-row .search-input-container {
|
||||
@@ -523,6 +517,8 @@
|
||||
|
||||
.tool-panel__fullscreen-name {
|
||||
color: var(--text-primary);
|
||||
font-size: 13px !important;
|
||||
font-weight: 500 !important;
|
||||
}
|
||||
|
||||
.tool-panel__fullscreen-description {
|
||||
|
||||
@@ -8,14 +8,14 @@ import ToolRenderer from "@app/components/tools/ToolRenderer";
|
||||
import ToolSearch from "@app/components/tools/toolPicker/ToolSearch";
|
||||
import { useSidebarContext } from "@app/contexts/SidebarContext";
|
||||
import rainbowStyles from "@app/styles/rainbow.module.css";
|
||||
import { ActionIcon, ScrollArea } from "@mantine/core";
|
||||
import { ActionIcon, Button, ScrollArea } from "@mantine/core";
|
||||
import { ToolId } from "@app/types/toolId";
|
||||
import { useIsMobile } from "@app/hooks/useIsMobile";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import FullscreenToolSurface from "@app/components/tools/FullscreenToolSurface";
|
||||
import { ToolPanelViewerBar } from "@app/components/tools/ToolPanelViewerBar";
|
||||
import { useToolPanelGeometry } from "@app/hooks/tools/useToolPanelGeometry";
|
||||
import { useRightRail } from "@app/contexts/RightRailContext";
|
||||
import { useWorkbenchBar } from "@app/contexts/WorkbenchBarContext";
|
||||
import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
|
||||
import ChevronRightIcon from "@mui/icons-material/ChevronRight";
|
||||
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
|
||||
@@ -28,7 +28,7 @@ export default function ToolPanel() {
|
||||
const { t } = useTranslation();
|
||||
const { isRainbowMode } = useRainbowThemeContext();
|
||||
const { sidebarRefs } = useSidebarContext();
|
||||
const { toolPanelRef, quickAccessRef, rightRailRef } = sidebarRefs;
|
||||
const { toolPanelRef, quickAccessRef } = sidebarRefs;
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
const {
|
||||
@@ -51,7 +51,7 @@ export default function ToolPanel() {
|
||||
readerMode,
|
||||
} = useToolWorkflow();
|
||||
|
||||
const { setAllRightRailButtonsDisabled } = useRightRail();
|
||||
const { setAllButtonsDisabled } = useWorkbenchBar();
|
||||
const { preferences, updatePreference } = usePreferences();
|
||||
|
||||
const isFullscreenMode = toolPanelMode === "fullscreen";
|
||||
@@ -62,22 +62,17 @@ export default function ToolPanel() {
|
||||
!isMobile &&
|
||||
toolPickerVisible;
|
||||
|
||||
// Disable right rail buttons when fullscreen mode is active
|
||||
// Disable workbench bar buttons when fullscreen mode is active
|
||||
useEffect(() => {
|
||||
setAllRightRailButtonsDisabled(fullscreenExpanded);
|
||||
}, [fullscreenExpanded, setAllRightRailButtonsDisabled]);
|
||||
setAllButtonsDisabled(fullscreenExpanded);
|
||||
}, [fullscreenExpanded, setAllButtonsDisabled]);
|
||||
|
||||
const fullscreenGeometry = useToolPanelGeometry({
|
||||
enabled: fullscreenExpanded,
|
||||
toolPanelRef,
|
||||
quickAccessRef,
|
||||
rightRailRef,
|
||||
});
|
||||
|
||||
const toggleLabel = isFullscreenMode
|
||||
? t("toolPanel.toggle.sidebar", "Switch to sidebar mode")
|
||||
: t("toolPanel.toggle.fullscreen", "Switch to fullscreen mode");
|
||||
|
||||
const handleExpand = () => {
|
||||
if (readerMode) setReaderMode(false);
|
||||
if (leftPanelView === "hidden") setLeftPanelView("toolPicker");
|
||||
@@ -196,20 +191,6 @@ export default function ToolPanel() {
|
||||
toolRegistry={toolRegistry}
|
||||
mode="filter"
|
||||
autoFocus={focusSearch}
|
||||
iconOverride={
|
||||
leftPanelView === "toolContent" ? (
|
||||
<ActionIcon
|
||||
variant="transparent"
|
||||
radius="md"
|
||||
size="1.25rem"
|
||||
onClick={handleBackToTools}
|
||||
aria-label={t("toolPanel.backToTools", "Back to tools")}
|
||||
style={{ color: "var(--search-text-and-icon-color)" }}
|
||||
>
|
||||
<ArrowBackIcon sx={{ fontSize: "1.25rem" }} />
|
||||
</ActionIcon>
|
||||
) : undefined
|
||||
}
|
||||
/>
|
||||
<ActionIcon
|
||||
variant="outline"
|
||||
@@ -245,6 +226,26 @@ export default function ToolPanel() {
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex-1 flex flex-col overflow-hidden">
|
||||
<div
|
||||
style={{
|
||||
borderBottom: "1px solid var(--border-subtle)",
|
||||
flexShrink: 0,
|
||||
}}
|
||||
>
|
||||
<Button
|
||||
variant="light"
|
||||
color="blue"
|
||||
size="sm"
|
||||
fullWidth
|
||||
radius={0}
|
||||
leftSection={<ArrowBackIcon sx={{ fontSize: "0.9rem" }} />}
|
||||
onClick={handleBackToTools}
|
||||
aria-label={t("toolPanel.backToTools", "Back to tools")}
|
||||
styles={{ root: { justifyContent: "flex-start" } }}
|
||||
>
|
||||
{t("toolPanel.backToTools", "Back to tools")}
|
||||
</Button>
|
||||
</div>
|
||||
<div className="flex-1 min-h-0 overflow-hidden">
|
||||
<ScrollArea h="100%">
|
||||
{selectedToolKey ? (
|
||||
@@ -284,7 +285,6 @@ export default function ToolPanel() {
|
||||
)
|
||||
}
|
||||
onExitFullscreenMode={() => setToolPanelMode("sidebar")}
|
||||
toggleLabel={toggleLabel}
|
||||
geometry={fullscreenGeometry}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import React, { useCallback } from "react";
|
||||
import { ActionIcon } from "@mantine/core";
|
||||
import { useRightRail } from "@app/contexts/RightRailContext";
|
||||
import { useWorkbenchBar } from "@app/contexts/WorkbenchBarContext";
|
||||
import { useNavigationState } from "@app/contexts/NavigationContext";
|
||||
import { Tooltip } from "@app/components/shared/Tooltip";
|
||||
import type {
|
||||
RightRailButtonConfig,
|
||||
RightRailRenderContext,
|
||||
} from "@app/types/rightRail";
|
||||
WorkbenchBarButtonConfig,
|
||||
WorkbenchBarRenderContext,
|
||||
} from "@app/types/workbenchBar";
|
||||
|
||||
/**
|
||||
* Mini toolbar rendered at the top of the ToolPanel when in viewer mode.
|
||||
@@ -14,14 +14,14 @@ import type {
|
||||
*/
|
||||
export function ToolPanelViewerBar() {
|
||||
const { workbench } = useNavigationState();
|
||||
const { buttons, actions, allButtonsDisabled } = useRightRail();
|
||||
const { buttons, actions, allButtonsDisabled } = useWorkbenchBar();
|
||||
|
||||
const toolPanelButtons = buttons
|
||||
.filter((btn) => btn.section === "tool-panel" && (btn.visible ?? true))
|
||||
.sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
||||
|
||||
const renderButton = useCallback(
|
||||
(btn: RightRailButtonConfig) => {
|
||||
(btn: WorkbenchBarButtonConfig) => {
|
||||
const action = actions[btn.id];
|
||||
const disabled = Boolean(btn.disabled || allButtonsDisabled);
|
||||
const isActive = Boolean(btn.active);
|
||||
@@ -31,7 +31,7 @@ export function ToolPanelViewerBar() {
|
||||
};
|
||||
|
||||
if (btn.render) {
|
||||
const context: RightRailRenderContext = {
|
||||
const context: WorkbenchBarRenderContext = {
|
||||
id: btn.id,
|
||||
disabled,
|
||||
allButtonsDisabled,
|
||||
|
||||
@@ -23,7 +23,10 @@ import {
|
||||
AutomationTool,
|
||||
} from "@app/types/automation";
|
||||
import { useAutomationForm } from "@app/hooks/tools/automate/useAutomationForm";
|
||||
import { downloadFolderScanningConfig } from "@app/utils/automationConverter";
|
||||
import {
|
||||
downloadAutomationConfig,
|
||||
downloadFolderScanningConfig,
|
||||
} from "@app/utils/automationConverter";
|
||||
|
||||
interface AutomationCreationProps {
|
||||
mode: AutomationMode;
|
||||
@@ -154,6 +157,24 @@ export default function AutomationCreation({
|
||||
const currentConfigTool =
|
||||
configuraingToolIndex >= 0 ? selectedTools[configuraingToolIndex] : null;
|
||||
|
||||
/**
|
||||
* Build a temporary AutomationConfig from in-progress form state so the
|
||||
* export buttons can run without requiring the user to save first. The
|
||||
* `id` and timestamps are placeholders — the export utilities strip them.
|
||||
*/
|
||||
const buildExportableAutomation = (): AutomationConfig => ({
|
||||
id: existingAutomation?.id || "temp",
|
||||
name: automationName.trim(),
|
||||
description: automationDescription.trim(),
|
||||
icon: automationIcon,
|
||||
operations: selectedTools.map((tool) => ({
|
||||
operation: tool.operation,
|
||||
parameters: tool.parameters || {},
|
||||
})),
|
||||
createdAt: existingAutomation?.createdAt || new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Text
|
||||
@@ -237,34 +258,34 @@ export default function AutomationCreation({
|
||||
{t("automate.creation.save", "Save Automation")}
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
leftSection={<DownloadIcon />}
|
||||
onClick={() => {
|
||||
// Create a temporary automation config from current state
|
||||
const tempAutomation: AutomationConfig = {
|
||||
id: existingAutomation?.id || "temp",
|
||||
name: automationName.trim(),
|
||||
description: automationDescription.trim(),
|
||||
icon: automationIcon,
|
||||
operations: selectedTools.map((tool) => ({
|
||||
operation: tool.operation,
|
||||
parameters: tool.parameters || {},
|
||||
})),
|
||||
createdAt:
|
||||
existingAutomation?.createdAt || new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
};
|
||||
downloadFolderScanningConfig(tempAutomation, toolRegistry);
|
||||
}}
|
||||
disabled={!canSaveAutomation()}
|
||||
variant="light"
|
||||
fullWidth
|
||||
>
|
||||
{t(
|
||||
"automate.creation.exportForFolderScanning",
|
||||
"Export for Folder Scanning",
|
||||
)}
|
||||
</Button>
|
||||
<Group gap="sm" grow>
|
||||
<Button
|
||||
leftSection={<DownloadIcon />}
|
||||
onClick={() => {
|
||||
downloadAutomationConfig(buildExportableAutomation());
|
||||
}}
|
||||
disabled={!canSaveAutomation()}
|
||||
variant="light"
|
||||
>
|
||||
{t("automate.creation.export", "Export")}
|
||||
</Button>
|
||||
<Button
|
||||
leftSection={<DownloadIcon />}
|
||||
onClick={() => {
|
||||
downloadFolderScanningConfig(
|
||||
buildExportableAutomation(),
|
||||
toolRegistry,
|
||||
);
|
||||
}}
|
||||
disabled={!canSaveAutomation()}
|
||||
variant="light"
|
||||
>
|
||||
{t(
|
||||
"automate.creation.exportForFolderScanning",
|
||||
"Export for Folder Scanning",
|
||||
)}
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import EditIcon from "@mui/icons-material/Edit";
|
||||
import DeleteIcon from "@mui/icons-material/Delete";
|
||||
import ContentCopyIcon from "@mui/icons-material/ContentCopy";
|
||||
import DownloadIcon from "@mui/icons-material/Download";
|
||||
import UploadFileIcon from "@mui/icons-material/UploadFile";
|
||||
import { Tooltip } from "@app/components/shared/Tooltip";
|
||||
import { ToolIcon } from "@app/components/shared/ToolIcon";
|
||||
import { ToolRegistry } from "@app/data/toolsTaxonomy";
|
||||
@@ -32,8 +33,12 @@ interface AutomationEntryProps {
|
||||
onDelete?: () => void;
|
||||
/** Copy handler (for suggested automations) */
|
||||
onCopy?: () => void;
|
||||
/** Export handler (for folder scanning) */
|
||||
onExport?: () => void;
|
||||
/** Export handler — folder scanning JSON */
|
||||
onExportFolderScan?: () => void;
|
||||
/** Export handler — native Automate JSON (renders as just "Export") */
|
||||
onExportAutomation?: () => void;
|
||||
/** Import handler — opens the import modal (used on "Create New" entry) */
|
||||
onImport?: () => void;
|
||||
/** Tool registry to resolve operation names */
|
||||
toolRegistry?: Partial<ToolRegistry>;
|
||||
}
|
||||
@@ -49,7 +54,9 @@ export default function AutomationEntry({
|
||||
onEdit,
|
||||
onDelete,
|
||||
onCopy,
|
||||
onExport,
|
||||
onExportFolderScan,
|
||||
onExportAutomation,
|
||||
onImport,
|
||||
toolRegistry,
|
||||
}: AutomationEntryProps) {
|
||||
const { t } = useTranslation();
|
||||
@@ -211,6 +218,11 @@ export default function AutomationEntry({
|
||||
variant="subtle"
|
||||
c="dimmed"
|
||||
size="md"
|
||||
aria-label={t(
|
||||
"automate.entryMenu.label",
|
||||
"Open menu for {{title}}",
|
||||
{ title: title || operations.join(" → ") },
|
||||
)}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
style={{
|
||||
position: "absolute",
|
||||
@@ -228,6 +240,17 @@ export default function AutomationEntry({
|
||||
</Menu.Target>
|
||||
|
||||
<Menu.Dropdown>
|
||||
{onImport && (
|
||||
<Menu.Item
|
||||
leftSection={<UploadFileIcon style={{ fontSize: 16 }} />}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
onImport();
|
||||
}}
|
||||
>
|
||||
{t("automate.import", "Import")}
|
||||
</Menu.Item>
|
||||
)}
|
||||
{onCopy && (
|
||||
<Menu.Item
|
||||
leftSection={<ContentCopyIcon style={{ fontSize: 16 }} />}
|
||||
@@ -250,12 +273,23 @@ export default function AutomationEntry({
|
||||
{t("edit", "Edit")}
|
||||
</Menu.Item>
|
||||
)}
|
||||
{onExport && (
|
||||
{onExportAutomation && (
|
||||
<Menu.Item
|
||||
leftSection={<DownloadIcon style={{ fontSize: 16 }} />}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
onExport();
|
||||
onExportAutomation();
|
||||
}}
|
||||
>
|
||||
{t("automate.export", "Export")}
|
||||
</Menu.Item>
|
||||
)}
|
||||
{onExportFolderScan && (
|
||||
<Menu.Item
|
||||
leftSection={<DownloadIcon style={{ fontSize: 16 }} />}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
onExportFolderScan();
|
||||
}}
|
||||
>
|
||||
{t(
|
||||
|
||||
@@ -0,0 +1,235 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {
|
||||
Alert,
|
||||
Badge,
|
||||
Button,
|
||||
Group,
|
||||
Modal,
|
||||
Stack,
|
||||
Text,
|
||||
Textarea,
|
||||
} from "@mantine/core";
|
||||
import { Dropzone } from "@mantine/dropzone";
|
||||
import UploadFileIcon from "@mui/icons-material/UploadFile";
|
||||
import { Z_INDEX_AUTOMATE_MODAL } from "@app/styles/zIndex";
|
||||
import {
|
||||
ParsedAutomationImport,
|
||||
parseAutomationFile,
|
||||
} from "@app/utils/automationConverter";
|
||||
import { ToolRegistry } from "@app/data/toolsTaxonomy";
|
||||
import type { ImportableAutomation } from "@app/hooks/tools/automate/useSavedAutomations";
|
||||
|
||||
interface AutomationImportModalProps {
|
||||
opened: boolean;
|
||||
toolRegistry: Partial<ToolRegistry>;
|
||||
onCancel: () => void;
|
||||
onImport: (
|
||||
automation: ImportableAutomation,
|
||||
meta: { format: ParsedAutomationImport["format"]; unresolved: string[] },
|
||||
) => void | Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Single import surface for both supported automation JSON shapes.
|
||||
*
|
||||
* Accepts a file drop or pasted text, auto-detects whether the JSON is the
|
||||
* native Automate config or the backend folder-scanning config, and shows
|
||||
* the resolved name + format before the user commits the import.
|
||||
*/
|
||||
export default function AutomationImportModal({
|
||||
opened,
|
||||
toolRegistry,
|
||||
onCancel,
|
||||
onImport,
|
||||
}: AutomationImportModalProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [pastedText, setPastedText] = useState("");
|
||||
const [parsed, setParsed] = useState<ParsedAutomationImport | null>(null);
|
||||
const [parseError, setParseError] = useState<string | null>(null);
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
|
||||
// Reset modal state every time it's reopened so a previous import doesn't
|
||||
// leak into the next one.
|
||||
useEffect(() => {
|
||||
if (opened) {
|
||||
setPastedText("");
|
||||
setParsed(null);
|
||||
setParseError(null);
|
||||
setSubmitting(false);
|
||||
}
|
||||
}, [opened]);
|
||||
|
||||
// Re-parse whenever the textarea changes — gives the user immediate feedback
|
||||
// without requiring a click.
|
||||
useEffect(() => {
|
||||
const trimmed = pastedText.trim();
|
||||
if (!trimmed) {
|
||||
setParsed(null);
|
||||
setParseError(null);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const result = parseAutomationFile(trimmed, toolRegistry);
|
||||
setParsed(result);
|
||||
setParseError(null);
|
||||
} catch (err) {
|
||||
setParsed(null);
|
||||
setParseError(err instanceof Error ? err.message : String(err));
|
||||
}
|
||||
}, [pastedText, toolRegistry]);
|
||||
|
||||
const handleFileDrop = async (files: File[]) => {
|
||||
const file = files[0];
|
||||
if (!file) return;
|
||||
try {
|
||||
const text = await file.text();
|
||||
setPastedText(text);
|
||||
} catch (err) {
|
||||
setParseError(err instanceof Error ? err.message : String(err));
|
||||
}
|
||||
};
|
||||
|
||||
const handleSubmit = async () => {
|
||||
if (!parsed) return;
|
||||
setSubmitting(true);
|
||||
try {
|
||||
await onImport(parsed.automation, {
|
||||
format: parsed.format,
|
||||
unresolved: parsed.unresolvedOperations,
|
||||
});
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
}
|
||||
};
|
||||
|
||||
const formatLabel =
|
||||
parsed?.format === "automate"
|
||||
? t("automate.importModal.detectedAutomation", "Automate JSON")
|
||||
: parsed?.format === "folderScanning"
|
||||
? t("automate.importModal.detectedFolderScan", "Folder Scanning JSON")
|
||||
: null;
|
||||
|
||||
return (
|
||||
<Modal
|
||||
opened={opened}
|
||||
onClose={onCancel}
|
||||
title={t("automate.importModal.title", "Import automation")}
|
||||
centered
|
||||
size="lg"
|
||||
zIndex={Z_INDEX_AUTOMATE_MODAL}
|
||||
>
|
||||
<Stack gap="md">
|
||||
<Text size="sm" c="dimmed">
|
||||
{t(
|
||||
"automate.importModal.intro",
|
||||
"Drop a JSON file or paste its contents below. The format (Automate or Folder Scanning) is detected automatically.",
|
||||
)}
|
||||
</Text>
|
||||
|
||||
<Dropzone
|
||||
onDrop={(files) => void handleFileDrop(files)}
|
||||
accept={["application/json", "text/plain"]}
|
||||
multiple={false}
|
||||
maxSize={10 * 1024 * 1024}
|
||||
aria-label={t(
|
||||
"automate.importModal.dropzoneAriaLabel",
|
||||
"Drop an automation JSON file here",
|
||||
)}
|
||||
>
|
||||
<Group
|
||||
gap="md"
|
||||
align="center"
|
||||
wrap="nowrap"
|
||||
mih={80}
|
||||
justify="center"
|
||||
>
|
||||
<UploadFileIcon style={{ fontSize: 32, opacity: 0.6 }} />
|
||||
<div>
|
||||
<Text size="sm" fw={500}>
|
||||
{t(
|
||||
"automate.importModal.dropHint",
|
||||
"Drop JSON here or click to choose a file",
|
||||
)}
|
||||
</Text>
|
||||
<Text size="xs" c="dimmed">
|
||||
{t(
|
||||
"automate.importModal.dropSubhint",
|
||||
"Both Automate and Folder Scanning configs are accepted",
|
||||
)}
|
||||
</Text>
|
||||
</div>
|
||||
</Group>
|
||||
</Dropzone>
|
||||
|
||||
<Textarea
|
||||
label={t("automate.importModal.pasteLabel", "Or paste JSON")}
|
||||
placeholder={t(
|
||||
"automate.importModal.pastePlaceholder",
|
||||
"Paste your automation JSON here…",
|
||||
)}
|
||||
value={pastedText}
|
||||
onChange={(e) => setPastedText(e.currentTarget.value)}
|
||||
autosize
|
||||
minRows={6}
|
||||
maxRows={12}
|
||||
spellCheck={false}
|
||||
styles={{ input: { fontFamily: "monospace", fontSize: 12 } }}
|
||||
/>
|
||||
|
||||
{parseError && (
|
||||
<Alert color="red" variant="light">
|
||||
{t(
|
||||
"automate.importModal.parseError",
|
||||
"Could not parse: {{message}}",
|
||||
{
|
||||
message: parseError,
|
||||
},
|
||||
)}
|
||||
</Alert>
|
||||
)}
|
||||
|
||||
{parsed && (
|
||||
<Alert color="green" variant="light">
|
||||
<Stack gap="xs">
|
||||
<Group gap="xs" align="center">
|
||||
<Badge color="green" variant="light">
|
||||
{formatLabel}
|
||||
</Badge>
|
||||
<Text size="sm" fw={500}>
|
||||
{parsed.automation.name}
|
||||
</Text>
|
||||
</Group>
|
||||
<Text size="xs" c="dimmed">
|
||||
{t("automate.importModal.opCount", "{{count}} operation(s)", {
|
||||
count: parsed.automation.operations.length,
|
||||
})}
|
||||
</Text>
|
||||
{parsed.unresolvedOperations.length > 0 && (
|
||||
<Text size="xs" c="orange">
|
||||
{t("automate.importModal.unresolved", "Unmapped: {{ops}}", {
|
||||
ops: parsed.unresolvedOperations.join(", "),
|
||||
})}
|
||||
</Text>
|
||||
)}
|
||||
</Stack>
|
||||
</Alert>
|
||||
)}
|
||||
|
||||
<Group gap="sm" justify="flex-end">
|
||||
<Button variant="subtle" onClick={onCancel} disabled={submitting}>
|
||||
{t("automate.importModal.cancel", "Cancel")}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => void handleSubmit()}
|
||||
disabled={!parsed || submitting}
|
||||
loading={submitting}
|
||||
>
|
||||
{t("automate.importModal.confirm", "Import")}
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
@@ -1,13 +1,19 @@
|
||||
import { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Title, Stack, Divider } from "@mantine/core";
|
||||
import AddCircleOutline from "@mui/icons-material/AddCircleOutlined";
|
||||
import SettingsIcon from "@mui/icons-material/Settings";
|
||||
import AutomationEntry from "@app/components/tools/automate/AutomationEntry";
|
||||
import AutomationImportModal from "@app/components/tools/automate/AutomationImportModal";
|
||||
import { useSuggestedAutomations } from "@app/hooks/tools/automate/useSuggestedAutomations";
|
||||
import { AutomationConfig, SuggestedAutomation } from "@app/types/automation";
|
||||
import { iconMap } from "@app/components/tools/automate/iconMap";
|
||||
import { ToolRegistry } from "@app/data/toolsTaxonomy";
|
||||
import { downloadFolderScanningConfig } from "@app/utils/automationConverter";
|
||||
import {
|
||||
downloadAutomationConfig,
|
||||
downloadFolderScanningConfig,
|
||||
} from "@app/utils/automationConverter";
|
||||
import type { ImportableAutomation } from "@app/hooks/tools/automate/useSavedAutomations";
|
||||
|
||||
interface AutomationSelectionProps {
|
||||
savedAutomations: AutomationConfig[];
|
||||
@@ -16,6 +22,11 @@ interface AutomationSelectionProps {
|
||||
onEdit: (automation: AutomationConfig) => void;
|
||||
onDelete: (automation: AutomationConfig) => void;
|
||||
onCopyFromSuggested: (automation: SuggestedAutomation) => void;
|
||||
onImportAutomation: (
|
||||
automation: ImportableAutomation,
|
||||
) => Promise<AutomationConfig>;
|
||||
onImportError?: (message: string) => void;
|
||||
onImportSuccess?: (message: string) => void;
|
||||
toolRegistry: Partial<ToolRegistry>;
|
||||
}
|
||||
|
||||
@@ -26,11 +37,49 @@ export default function AutomationSelection({
|
||||
onEdit,
|
||||
onDelete,
|
||||
onCopyFromSuggested,
|
||||
onImportAutomation,
|
||||
onImportError,
|
||||
onImportSuccess,
|
||||
toolRegistry,
|
||||
}: AutomationSelectionProps) {
|
||||
const { t } = useTranslation();
|
||||
const suggestedAutomations = useSuggestedAutomations();
|
||||
|
||||
const [importModalOpen, setImportModalOpen] = useState(false);
|
||||
|
||||
const handleImportSubmit = async (
|
||||
automation: ImportableAutomation,
|
||||
meta: { format: "automate" | "folderScanning"; unresolved: string[] },
|
||||
) => {
|
||||
try {
|
||||
await onImportAutomation(automation);
|
||||
setImportModalOpen(false);
|
||||
if (meta.unresolved.length > 0) {
|
||||
onImportSuccess?.(
|
||||
t(
|
||||
"automate.importPartialSuccess",
|
||||
"Imported with {{count}} unmapped operation(s): {{ops}}",
|
||||
{
|
||||
count: meta.unresolved.length,
|
||||
ops: meta.unresolved.join(", "),
|
||||
},
|
||||
),
|
||||
);
|
||||
} else {
|
||||
onImportSuccess?.(
|
||||
t("automate.importSuccess", "Imported automation: {{name}}", {
|
||||
name: automation.name,
|
||||
}),
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
const message =
|
||||
err instanceof Error ? err.message : "Failed to import automation";
|
||||
console.error("Failed to import automation:", err);
|
||||
onImportError?.(message);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Title
|
||||
@@ -53,6 +102,8 @@ export default function AutomationSelection({
|
||||
operations={[]}
|
||||
onClick={onCreateNew}
|
||||
keepIconColor={true}
|
||||
showMenu={true}
|
||||
onImport={() => setImportModalOpen(true)}
|
||||
toolRegistry={toolRegistry}
|
||||
/>
|
||||
{/* Saved Automations */}
|
||||
@@ -72,7 +123,8 @@ export default function AutomationSelection({
|
||||
onClick={() => onRun(automation)}
|
||||
showMenu={true}
|
||||
onEdit={() => onEdit(automation)}
|
||||
onExport={() =>
|
||||
onExportAutomation={() => downloadAutomationConfig(automation)}
|
||||
onExportFolderScan={() =>
|
||||
downloadFolderScanningConfig(automation, toolRegistry)
|
||||
}
|
||||
onDelete={() => onDelete(automation)}
|
||||
@@ -110,6 +162,13 @@ export default function AutomationSelection({
|
||||
</Stack>
|
||||
</div>
|
||||
</Stack>
|
||||
|
||||
<AutomationImportModal
|
||||
opened={importModalOpen}
|
||||
toolRegistry={toolRegistry}
|
||||
onCancel={() => setImportModalOpen(false)}
|
||||
onImport={handleImportSubmit}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,14 +14,14 @@ import {
|
||||
import { CompareResultData, CompareWorkbenchData } from "@app/types/compare";
|
||||
import ComparePixelWorkbenchView from "@app/components/tools/compare/ComparePixelWorkbenchView";
|
||||
import { useFileContext } from "@app/contexts/file/fileHooks";
|
||||
import { useRightRailButtons } from "@app/hooks/useRightRailButtons";
|
||||
import { useWorkbenchBarButtons } from "@app/hooks/useWorkbenchBarButtons";
|
||||
import CompareDocumentPane from "@app/components/tools/compare/CompareDocumentPane";
|
||||
import { useComparePagePreviews } from "@app/components/tools/compare/hooks/useComparePagePreviews";
|
||||
import { useComparePanZoom } from "@app/components/tools/compare/hooks/useComparePanZoom";
|
||||
import { useCompareHighlights } from "@app/components/tools/compare/hooks/useCompareHighlights";
|
||||
import { useCompareChangeNavigation } from "@app/components/tools/compare/hooks/useCompareChangeNavigation";
|
||||
import "@app/components/tools/compare/compareView.css";
|
||||
import { useCompareRightRailButtons } from "@app/components/tools/compare/hooks/useCompareRightRailButtons";
|
||||
import { useCompareWorkbenchBarButtons } from "@app/components/tools/compare/hooks/useCompareWorkbenchBarButtons";
|
||||
import {
|
||||
alert,
|
||||
updateToast,
|
||||
@@ -209,7 +209,7 @@ const CompareTextWorkbenchView = ({ data }: CompareTextWorkbenchViewProps) => {
|
||||
})
|
||||
);
|
||||
|
||||
const rightRailButtons = useCompareRightRailButtons({
|
||||
const workbenchBarButtons = useCompareWorkbenchBarButtons({
|
||||
layout,
|
||||
toggleLayout,
|
||||
isPanMode,
|
||||
@@ -230,7 +230,7 @@ const CompareTextWorkbenchView = ({ data }: CompareTextWorkbenchViewProps) => {
|
||||
comparisonScrollRef,
|
||||
});
|
||||
|
||||
useRightRailButtons(rightRailButtons);
|
||||
useWorkbenchBarButtons(workbenchBarButtons);
|
||||
|
||||
// Rendering progress toast for very large PDFs
|
||||
const LARGE_PAGE_THRESHOLD = 400; // show banner when one or both exceed threshold
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
padding: 1rem;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
/* Allow the custom workbench to shrink within flex parents (prevents pushing right rail off-screen) */
|
||||
/* Allow the custom workbench to shrink within flex parents */
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -4,12 +4,12 @@ import { useTranslation } from "react-i18next";
|
||||
import LocalIcon from "@app/components/shared/LocalIcon";
|
||||
import { alert } from "@app/components/toast";
|
||||
import type { ToastLocation } from "@app/components/toast/types";
|
||||
import type { RightRailButtonWithAction } from "@app/hooks/useRightRailButtons";
|
||||
import type { WorkbenchBarButtonWithAction } from "@app/hooks/useWorkbenchBarButtons";
|
||||
import { useIsMobile } from "@app/hooks/useIsMobile";
|
||||
|
||||
type Pane = "base" | "comparison";
|
||||
|
||||
export interface UseCompareRightRailButtonsOptions {
|
||||
export interface UseCompareWorkbenchBarButtonsOptions {
|
||||
layout: "side-by-side" | "stacked";
|
||||
toggleLayout: () => void;
|
||||
isPanMode: boolean;
|
||||
@@ -30,7 +30,7 @@ export interface UseCompareRightRailButtonsOptions {
|
||||
comparisonScrollRef?: React.RefObject<HTMLDivElement | null>;
|
||||
}
|
||||
|
||||
export const useCompareRightRailButtons = ({
|
||||
export const useCompareWorkbenchBarButtons = ({
|
||||
layout,
|
||||
toggleLayout,
|
||||
isPanMode,
|
||||
@@ -49,11 +49,11 @@ export const useCompareRightRailButtons = ({
|
||||
zoomLimits,
|
||||
baseScrollRef,
|
||||
comparisonScrollRef,
|
||||
}: UseCompareRightRailButtonsOptions): RightRailButtonWithAction[] => {
|
||||
}: UseCompareWorkbenchBarButtonsOptions): WorkbenchBarButtonWithAction[] => {
|
||||
const { t, i18n } = useTranslation();
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
return useMemo<RightRailButtonWithAction[]>(
|
||||
return useMemo<WorkbenchBarButtonWithAction[]>(
|
||||
() => [
|
||||
{
|
||||
id: "compare-toggle-layout",
|
||||
@@ -212,6 +212,6 @@ export const useCompareRightRailButtons = ({
|
||||
);
|
||||
};
|
||||
|
||||
export type UseCompareRightRailButtonsReturn = ReturnType<
|
||||
typeof useCompareRightRailButtons
|
||||
export type UseCompareWorkbenchBarButtonsReturn = ReturnType<
|
||||
typeof useCompareWorkbenchBarButtons
|
||||
>;
|
||||
@@ -76,9 +76,7 @@ const CompactToolItem: React.FC<CompactToolItemProps> = ({
|
||||
) : null}
|
||||
<span className="tool-panel__fullscreen-list-body">
|
||||
<div style={{ display: "flex", alignItems: "center", gap: "0.5rem" }}>
|
||||
<Text fw={600} size="sm" className="tool-panel__fullscreen-name">
|
||||
{tool.name}
|
||||
</Text>
|
||||
<Text className="tool-panel__fullscreen-name">{tool.name}</Text>
|
||||
{tool.versionStatus === "alpha" && (
|
||||
<Badge size="xs" variant="light" color="orange">
|
||||
{t("toolPanel.alpha", "Alpha")}
|
||||
|
||||
@@ -78,9 +78,7 @@ const DetailedToolItem: React.FC<DetailedToolItemProps> = ({
|
||||
) : null}
|
||||
<span className="tool-panel__fullscreen-body">
|
||||
<div style={{ display: "flex", alignItems: "center", gap: "0.5rem" }}>
|
||||
<Text fw={600} size="sm" className="tool-panel__fullscreen-name">
|
||||
{tool.name}
|
||||
</Text>
|
||||
<Text className="tool-panel__fullscreen-name">{tool.name}</Text>
|
||||
{tool.versionStatus === "alpha" && (
|
||||
<Badge size="xs" variant="light" color="orange">
|
||||
{/* we can add more translations for different badges in future, like beta, etc. */}
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
border: 1px solid var(--mantine-color-gray-4);
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
background: var(--right-rail-bg);
|
||||
background: var(--bg-file-manager);
|
||||
}
|
||||
|
||||
.showjs-toolbar {
|
||||
|
||||
@@ -538,7 +538,7 @@ export function CommentsSidebar({
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
width: SIDEBAR_WIDTH,
|
||||
backgroundColor: "var(--right-rail-bg)",
|
||||
backgroundColor: "var(--bg-file-manager)",
|
||||
borderLeft: "1px solid var(--border-subtle)",
|
||||
zIndex: 998,
|
||||
display: "flex",
|
||||
|
||||
@@ -28,7 +28,7 @@ import { useRedaction } from "@app/contexts/RedactionContext";
|
||||
import type { RedactionPendingTrackerAPI } from "@app/components/viewer/RedactionPendingTracker";
|
||||
import { createStirlingFilesAndStubs } from "@app/services/fileStubHelpers";
|
||||
import { isStirlingFile, getFormFillFileId } from "@app/types/fileContext";
|
||||
import { useViewerRightRailButtons } from "@app/components/viewer/useViewerRightRailButtons";
|
||||
import { useViewerWorkbenchBarButtons } from "@app/components/viewer/useViewerWorkbenchBarButtons";
|
||||
import { StampPlacementOverlay } from "@app/components/viewer/StampPlacementOverlay";
|
||||
import {
|
||||
RulerOverlay,
|
||||
@@ -1082,8 +1082,8 @@ const EmbedPdfViewerContent = ({
|
||||
};
|
||||
}, [effectiveFile]);
|
||||
|
||||
// Register viewer right-rail buttons
|
||||
useViewerRightRailButtons(isRulerActive, setIsRulerActive);
|
||||
// Register workbench bar buttons for the viewer
|
||||
useViewerWorkbenchBarButtons(isRulerActive, setIsRulerActive);
|
||||
|
||||
// Auto-fetch form fields when a PDF is loaded in the viewer.
|
||||
// In normal viewer mode, this uses PDFium WASM (frontend-only).
|
||||
|
||||
+7
-22
@@ -12,9 +12,7 @@ import {
|
||||
useNavigationGuard,
|
||||
useNavigationActions,
|
||||
} from "@app/contexts/NavigationContext";
|
||||
import { useSidebarContext } from "@app/contexts/SidebarContext";
|
||||
import { useToolWorkflow } from "@app/contexts/ToolWorkflowContext";
|
||||
import { useRightRailTooltipSide } from "@app/hooks/useRightRailTooltipSide";
|
||||
import { useRedactionMode, useRedaction } from "@app/contexts/RedactionContext";
|
||||
import {
|
||||
defaultParameters,
|
||||
@@ -32,10 +30,7 @@ export default function ViewerAnnotationControls({
|
||||
disabled = false,
|
||||
}: ViewerAnnotationControlsProps) {
|
||||
const { t } = useTranslation();
|
||||
const { sidebarRefs } = useSidebarContext();
|
||||
const { setLeftPanelView, setSidebarsVisible } = useToolWorkflow();
|
||||
const { position: tooltipPosition, offset: tooltipOffset } =
|
||||
useRightRailTooltipSide(sidebarRefs);
|
||||
|
||||
// Viewer context for PDF controls - safely handle when not available
|
||||
const viewerContext = React.useContext(ViewerContext);
|
||||
@@ -129,31 +124,25 @@ export default function ViewerAnnotationControls({
|
||||
// Handle redaction mode toggle
|
||||
const handleRedactionToggle = async () => {
|
||||
if (isRedactMode) {
|
||||
// Exit redaction mode
|
||||
exitRedactionMode();
|
||||
} else {
|
||||
// Check for unsaved annotation changes
|
||||
const hasAnnotationChanges = historyApiRef?.current?.canUndo() ?? false;
|
||||
|
||||
const enterRedactionMode = async () => {
|
||||
await saveAnnotationsIfNeeded();
|
||||
|
||||
// Set redaction config to manual mode when opening from viewer
|
||||
const manualConfig: RedactParameters = {
|
||||
...defaultParameters,
|
||||
mode: "manual",
|
||||
};
|
||||
setRedactionConfig(manualConfig);
|
||||
|
||||
// Set tool and keep viewer workbench
|
||||
navActions.setToolAndWorkbench("redact", "viewer");
|
||||
|
||||
// Ensure sidebars are visible and open tool content
|
||||
setSidebarsVisible(true);
|
||||
setLeftPanelView("toolContent");
|
||||
|
||||
setRedactionMode(true);
|
||||
// Activate unified redact mode after a short delay
|
||||
setTimeout(() => {
|
||||
const currentType = redactionApiRef.current?.getActiveType?.();
|
||||
if (currentType !== RedactionMode.Redact) {
|
||||
@@ -171,7 +160,6 @@ export default function ViewerAnnotationControls({
|
||||
};
|
||||
|
||||
const handleToggleAnnotationsVisibility = useCallback(() => {
|
||||
// When going from visible → hidden with unsaved changes, prompt to save first
|
||||
if (!annotationsHidden && hasUnsavedChanges) {
|
||||
requestNavigation(() => viewerContext?.toggleAnnotationsVisibility());
|
||||
} else {
|
||||
@@ -179,7 +167,6 @@ export default function ViewerAnnotationControls({
|
||||
}
|
||||
}, [annotationsHidden, hasUnsavedChanges, requestNavigation, viewerContext]);
|
||||
|
||||
// Don't show any annotation controls in sign mode
|
||||
// NOTE: This early return is placed AFTER all hooks to satisfy React's rules of hooks
|
||||
if (isSignMode) {
|
||||
return null;
|
||||
@@ -187,15 +174,14 @@ export default function ViewerAnnotationControls({
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Redaction Mode Toggle */}
|
||||
<Tooltip
|
||||
content={
|
||||
isRedactMode
|
||||
? t("rightRail.exitRedaction", "Exit Redaction Mode")
|
||||
: t("rightRail.redact", "Redact")
|
||||
? t("workbenchBar.exitRedaction", "Exit Redaction Mode")
|
||||
: t("workbenchBar.redact", "Redact")
|
||||
}
|
||||
position={tooltipPosition}
|
||||
offset={tooltipOffset}
|
||||
position="bottom"
|
||||
offset={16}
|
||||
arrow
|
||||
portalTarget={document.body}
|
||||
>
|
||||
@@ -215,14 +201,13 @@ export default function ViewerAnnotationControls({
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
|
||||
{/* Annotation Visibility Toggle */}
|
||||
<Tooltip
|
||||
content={t(
|
||||
"rightRail.toggleAnnotations",
|
||||
"workbenchBar.toggleAnnotations",
|
||||
"Toggle Annotations Visibility",
|
||||
)}
|
||||
position={tooltipPosition}
|
||||
offset={tooltipOffset}
|
||||
position="bottom"
|
||||
offset={16}
|
||||
arrow
|
||||
portalTarget={document.body}
|
||||
>
|
||||
+27
-27
@@ -4,15 +4,15 @@ import { useTranslation } from "react-i18next";
|
||||
import { supportedLanguages } from "@app/i18n";
|
||||
import { useViewer } from "@app/contexts/ViewerContext";
|
||||
import {
|
||||
useRightRailButtons,
|
||||
RightRailButtonWithAction,
|
||||
} from "@app/hooks/useRightRailButtons";
|
||||
useWorkbenchBarButtons,
|
||||
WorkbenchBarButtonWithAction,
|
||||
} from "@app/hooks/useWorkbenchBarButtons";
|
||||
import LocalIcon from "@app/components/shared/LocalIcon";
|
||||
import { Tooltip } from "@app/components/shared/Tooltip";
|
||||
import { SearchInterface } from "@app/components/viewer/SearchInterface";
|
||||
import ViewerAnnotationControls from "@app/components/shared/rightRail/ViewerAnnotationControls";
|
||||
import ViewerAnnotationControls from "@app/components/viewer/ViewerAnnotationControls";
|
||||
import { useSidebarContext } from "@app/contexts/SidebarContext";
|
||||
import { useRightRailTooltipSide } from "@app/hooks/useRightRailTooltipSide";
|
||||
import { useWorkbenchBarTooltipSide } from "@app/hooks/useWorkbenchBarTooltipSide";
|
||||
import { useToolWorkflow } from "@app/contexts/ToolWorkflowContext";
|
||||
import {
|
||||
useNavigationState,
|
||||
@@ -27,7 +27,7 @@ import VolumeUpIcon from "@mui/icons-material/VolumeUp";
|
||||
import StopIcon from "@mui/icons-material/Stop";
|
||||
import { useViewerReadAloud } from "@app/components/viewer/useViewerReadAloud";
|
||||
|
||||
export function useViewerRightRailButtons(
|
||||
export function useViewerWorkbenchBarButtons(
|
||||
isRulerActive?: boolean,
|
||||
setIsRulerActive?: (v: boolean) => void,
|
||||
) {
|
||||
@@ -46,7 +46,7 @@ export function useViewerRightRailButtons(
|
||||
} = viewer;
|
||||
const [isPanning, setIsPanning] = useState<boolean>(false);
|
||||
const { sidebarRefs } = useSidebarContext();
|
||||
const { position: tooltipPosition } = useRightRailTooltipSide(
|
||||
const { position: tooltipPosition } = useWorkbenchBarTooltipSide(
|
||||
sidebarRefs,
|
||||
12,
|
||||
);
|
||||
@@ -105,27 +105,27 @@ export function useViewerRightRailButtons(
|
||||
return () => window.removeEventListener("popstate", handlePopState);
|
||||
}, [isAnnotationsPath]);
|
||||
|
||||
const searchLabel = t("rightRail.search", "Search PDF");
|
||||
const panLabel = t("rightRail.panMode", "Pan Mode");
|
||||
const searchLabel = t("workbenchBar.search", "Search PDF");
|
||||
const panLabel = t("workbenchBar.panMode", "Pan Mode");
|
||||
const applyRedactionsLabel = t(
|
||||
"rightRail.applyRedactionsFirst",
|
||||
"workbenchBar.applyRedactionsFirst",
|
||||
"Apply redactions first",
|
||||
);
|
||||
const rotateLeftLabel = t("rightRail.rotateLeft", "Rotate Left");
|
||||
const rotateRightLabel = t("rightRail.rotateRight", "Rotate Right");
|
||||
const sidebarLabel = t("rightRail.toggleSidebar", "Toggle Sidebar");
|
||||
const bookmarkLabel = t("rightRail.toggleBookmarks", "Toggle Bookmarks");
|
||||
const rotateLeftLabel = t("workbenchBar.rotateLeft", "Rotate Left");
|
||||
const rotateRightLabel = t("workbenchBar.rotateRight", "Rotate Right");
|
||||
const sidebarLabel = t("workbenchBar.toggleSidebar", "Toggle Sidebar");
|
||||
const bookmarkLabel = t("workbenchBar.toggleBookmarks", "Toggle Bookmarks");
|
||||
const attachmentLabel = t(
|
||||
"rightRail.toggleAttachments",
|
||||
"workbenchBar.toggleAttachments",
|
||||
"Toggle Attachments",
|
||||
);
|
||||
const layersLabel = t("rightRail.toggleLayers", "Toggle Layers");
|
||||
const commentsLabel = t("rightRail.toggleComments", "Comments");
|
||||
const annotationsLabel = t("rightRail.annotations", "Annotations");
|
||||
const formFillLabel = t("rightRail.formFill", "Fill Form");
|
||||
const rulerLabel = t("rightRail.ruler", "Ruler / Measure");
|
||||
const readAloudLabel = t("rightRail.readAloud", "Read Aloud");
|
||||
const readAloudSpeedLabel = t("rightRail.readAloudSpeed", "Speed");
|
||||
const layersLabel = t("workbenchBar.toggleLayers", "Toggle Layers");
|
||||
const commentsLabel = t("workbenchBar.toggleComments", "Comments");
|
||||
const annotationsLabel = t("workbenchBar.annotations", "Annotations");
|
||||
const formFillLabel = t("workbenchBar.formFill", "Fill Form");
|
||||
const rulerLabel = t("workbenchBar.ruler", "Ruler / Measure");
|
||||
const readAloudLabel = t("workbenchBar.readAloud", "Read Aloud");
|
||||
const readAloudSpeedLabel = t("workbenchBar.readAloudSpeed", "Speed");
|
||||
|
||||
const isFormFillActive = (selectedTool as string) === "formFill";
|
||||
|
||||
@@ -149,8 +149,8 @@ export function useViewerRightRailButtons(
|
||||
const shouldShowLanguageSelector =
|
||||
supportedLanguageCodes.size === 0 || filteredLanguages.length > 1;
|
||||
|
||||
const viewerButtons = useMemo<RightRailButtonWithAction[]>(() => {
|
||||
const buttons: RightRailButtonWithAction[] = [
|
||||
const viewerButtons = useMemo<WorkbenchBarButtonWithAction[]>(() => {
|
||||
const buttons: WorkbenchBarButtonWithAction[] = [
|
||||
{
|
||||
id: "viewer-search",
|
||||
tooltip: searchLabel,
|
||||
@@ -420,9 +420,9 @@ export function useViewerRightRailButtons(
|
||||
/>
|
||||
{shouldShowLanguageSelector && (
|
||||
<Select
|
||||
label={t("rightRail.readAloudLanguage", "Language")}
|
||||
label={t("workbenchBar.readAloudLanguage", "Language")}
|
||||
placeholder={t(
|
||||
"rightRail.selectLanguage",
|
||||
"workbenchBar.selectLanguage",
|
||||
"Select language",
|
||||
)}
|
||||
value={speechLanguage}
|
||||
@@ -584,5 +584,5 @@ export function useViewerRightRailButtons(
|
||||
handleSpeechLanguageChange,
|
||||
]);
|
||||
|
||||
useRightRailButtons(viewerButtons);
|
||||
useWorkbenchBarButtons(viewerButtons);
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
// Centralized download URLs for Stirling PDF desktop installers
|
||||
export const DOWNLOAD_URLS = {
|
||||
WINDOWS: "https://files.stirlingpdf.com/win-installer.exe",
|
||||
MAC_APPLE_SILICON: "https://files.stirlingpdf.com/mac-installer.dmg",
|
||||
MAC_INTEL: "https://files.stirlingpdf.com/mac-x86_64-installer.dmg",
|
||||
MAC: "https://files.stirlingpdf.com/mac-installer.dmg",
|
||||
LINUX_DOCS: "https://docs.stirlingpdf.com/Installation/Unix%20Installation/",
|
||||
} as const;
|
||||
|
||||
|
||||
@@ -92,9 +92,11 @@ export function IndexedDBProvider({ children }: IndexedDBProviderProps) {
|
||||
fileId: FileId,
|
||||
existingThumbnail?: string,
|
||||
): Promise<StirlingFileStub> => {
|
||||
// Use existing thumbnail or generate new one if none provided
|
||||
const thumbnail =
|
||||
existingThumbnail || (await generateThumbnailForFile(file));
|
||||
// existingThumbnail="" means caller explicitly opted out of a raster thumbnail;
|
||||
// only generate when the caller passed nothing (undefined).
|
||||
const generated =
|
||||
existingThumbnail ?? (await generateThumbnailForFile(file));
|
||||
const thumbnail = generated || undefined;
|
||||
|
||||
// History is handled via direct fileStorage calls, not here
|
||||
const stirlingFile = createStirlingFile(file, fileId);
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
import React, {
|
||||
createContext,
|
||||
useCallback,
|
||||
useContext,
|
||||
useMemo,
|
||||
useState,
|
||||
} from "react";
|
||||
import { RightRailAction, RightRailButtonConfig } from "@app/types/rightRail";
|
||||
|
||||
interface RightRailContextValue {
|
||||
buttons: RightRailButtonConfig[];
|
||||
actions: Record<string, RightRailAction>;
|
||||
allButtonsDisabled: boolean;
|
||||
registerButtons: (buttons: RightRailButtonConfig[]) => void;
|
||||
unregisterButtons: (ids: string[]) => void;
|
||||
setAction: (id: string, action?: RightRailAction) => void;
|
||||
setAllRightRailButtonsDisabled: (disabled: boolean) => void;
|
||||
clear: () => void;
|
||||
}
|
||||
|
||||
const RightRailContext = createContext<RightRailContextValue | undefined>(
|
||||
undefined,
|
||||
);
|
||||
|
||||
export function RightRailProvider({ children }: { children: React.ReactNode }) {
|
||||
const [buttons, setButtons] = useState<RightRailButtonConfig[]>([]);
|
||||
const [actions, setActions] = useState<Record<string, RightRailAction>>({});
|
||||
const [allButtonsDisabled, setAllButtonsDisabled] = useState<boolean>(false);
|
||||
|
||||
const registerButtons = useCallback((newButtons: RightRailButtonConfig[]) => {
|
||||
setButtons((prev) => {
|
||||
const byId = new Map(prev.map((b) => [b.id, b] as const));
|
||||
newButtons.forEach((nb) => {
|
||||
const existing = byId.get(nb.id) || ({} as RightRailButtonConfig);
|
||||
byId.set(nb.id, { ...existing, ...nb });
|
||||
});
|
||||
const merged = Array.from(byId.values());
|
||||
merged.sort(
|
||||
(a, b) => (a.order ?? 0) - (b.order ?? 0) || a.id.localeCompare(b.id),
|
||||
);
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
const ids = newButtons.map((b) => b.id);
|
||||
const dupes = ids.filter((id, idx) => ids.indexOf(id) !== idx);
|
||||
if (dupes.length)
|
||||
console.warn("[RightRail] Duplicate ids in registerButtons:", dupes);
|
||||
}
|
||||
return merged;
|
||||
});
|
||||
}, []);
|
||||
|
||||
const unregisterButtons = useCallback((ids: string[]) => {
|
||||
setButtons((prev) => prev.filter((b) => !ids.includes(b.id)));
|
||||
setActions((prev) =>
|
||||
Object.fromEntries(
|
||||
Object.entries(prev).filter(([id]) => !ids.includes(id)),
|
||||
),
|
||||
);
|
||||
}, []);
|
||||
|
||||
const setAction = useCallback((id: string, action?: RightRailAction) => {
|
||||
setActions((prev) => {
|
||||
if (!action) {
|
||||
if (!(id in prev)) return prev;
|
||||
const next = { ...prev };
|
||||
delete next[id];
|
||||
return next;
|
||||
}
|
||||
return { ...prev, [id]: action };
|
||||
});
|
||||
}, []);
|
||||
|
||||
const setAllRightRailButtonsDisabled = useCallback((disabled: boolean) => {
|
||||
setAllButtonsDisabled(disabled);
|
||||
}, []);
|
||||
|
||||
const clear = useCallback(() => {
|
||||
setButtons([]);
|
||||
setActions({});
|
||||
}, []);
|
||||
|
||||
const value = useMemo<RightRailContextValue>(
|
||||
() => ({
|
||||
buttons,
|
||||
actions,
|
||||
allButtonsDisabled,
|
||||
registerButtons,
|
||||
unregisterButtons,
|
||||
setAction,
|
||||
setAllRightRailButtonsDisabled,
|
||||
clear,
|
||||
}),
|
||||
[
|
||||
buttons,
|
||||
actions,
|
||||
allButtonsDisabled,
|
||||
registerButtons,
|
||||
unregisterButtons,
|
||||
setAction,
|
||||
setAllRightRailButtonsDisabled,
|
||||
clear,
|
||||
],
|
||||
);
|
||||
|
||||
return (
|
||||
<RightRailContext.Provider value={value}>
|
||||
{children}
|
||||
</RightRailContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
export function useRightRail() {
|
||||
const ctx = useContext(RightRailContext);
|
||||
if (!ctx)
|
||||
throw new Error("useRightRail must be used within RightRailProvider");
|
||||
return ctx;
|
||||
}
|
||||
@@ -14,7 +14,6 @@ export function SidebarProvider({ children }: SidebarProviderProps) {
|
||||
// All sidebar state management
|
||||
const quickAccessRef = useRef<HTMLDivElement>(null);
|
||||
const toolPanelRef = useRef<HTMLDivElement>(null);
|
||||
const rightRailRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
const [sidebarsVisible, setSidebarsVisible] = useState(true);
|
||||
const [leftPanelView, setLeftPanelView] = useState<
|
||||
@@ -35,9 +34,8 @@ export function SidebarProvider({ children }: SidebarProviderProps) {
|
||||
() => ({
|
||||
quickAccessRef,
|
||||
toolPanelRef,
|
||||
rightRailRef,
|
||||
}),
|
||||
[quickAccessRef, toolPanelRef, rightRailRef],
|
||||
[quickAccessRef, toolPanelRef],
|
||||
);
|
||||
|
||||
const contextValue: SidebarContextValue = useMemo(
|
||||
|
||||
@@ -30,6 +30,7 @@ interface TourOrchestrationContextType {
|
||||
// File operations
|
||||
selectFirstFile: () => void;
|
||||
pinFile: () => void;
|
||||
revealFileCardHoverMenu: () => void;
|
||||
|
||||
// Crop settings (placeholder for now)
|
||||
modifyCropSettings: () => void;
|
||||
@@ -192,6 +193,20 @@ export const TourOrchestrationProvider: React.FC<{
|
||||
window.dispatchEvent(event);
|
||||
}, []);
|
||||
|
||||
const revealFileCardHoverMenu = useCallback(() => {
|
||||
// The hover menu is hidden via CSS until the card is hovered.
|
||||
// Override data-force-visible so the CSS rule makes it opacity:1 / pointer-events:auto,
|
||||
// then nudge Reactour to re-measure the now-visible pin button.
|
||||
const menu = document.querySelector(
|
||||
'[data-hover-action-menu-mode="cssHover"]',
|
||||
) as HTMLElement | null;
|
||||
if (menu) {
|
||||
menu.setAttribute("data-force-visible", "true");
|
||||
window.dispatchEvent(new Event("resize"));
|
||||
requestAnimationFrame(() => window.dispatchEvent(new Event("resize")));
|
||||
}
|
||||
}, []);
|
||||
|
||||
const executeTool = useCallback(() => {
|
||||
// Trigger the run button click
|
||||
const runButton = document.querySelector(
|
||||
@@ -213,6 +228,7 @@ export const TourOrchestrationProvider: React.FC<{
|
||||
switchToActiveFiles,
|
||||
selectFirstFile,
|
||||
pinFile,
|
||||
revealFileCardHoverMenu,
|
||||
modifyCropSettings,
|
||||
executeTool,
|
||||
};
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
import React, {
|
||||
createContext,
|
||||
useCallback,
|
||||
useContext,
|
||||
useMemo,
|
||||
useState,
|
||||
} from "react";
|
||||
import {
|
||||
WorkbenchBarAction,
|
||||
WorkbenchBarButtonConfig,
|
||||
} from "@app/types/workbenchBar";
|
||||
|
||||
interface WorkbenchBarContextValue {
|
||||
buttons: WorkbenchBarButtonConfig[];
|
||||
actions: Record<string, WorkbenchBarAction>;
|
||||
allButtonsDisabled: boolean;
|
||||
registerButtons: (buttons: WorkbenchBarButtonConfig[]) => void;
|
||||
unregisterButtons: (ids: string[]) => void;
|
||||
setAction: (id: string, action?: WorkbenchBarAction) => void;
|
||||
setAllButtonsDisabled: (disabled: boolean) => void;
|
||||
clear: () => void;
|
||||
}
|
||||
|
||||
const WorkbenchBarContext = createContext<WorkbenchBarContextValue | undefined>(
|
||||
undefined,
|
||||
);
|
||||
|
||||
export function WorkbenchBarProvider({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const [buttons, setButtons] = useState<WorkbenchBarButtonConfig[]>([]);
|
||||
const [actions, setActions] = useState<Record<string, WorkbenchBarAction>>(
|
||||
{},
|
||||
);
|
||||
const [allButtonsDisabled, setAllButtonsDisabledState] =
|
||||
useState<boolean>(false);
|
||||
|
||||
const registerButtons = useCallback(
|
||||
(newButtons: WorkbenchBarButtonConfig[]) => {
|
||||
setButtons((prev) => {
|
||||
const byId = new Map(prev.map((b) => [b.id, b] as const));
|
||||
newButtons.forEach((nb) => {
|
||||
const existing = byId.get(nb.id) || ({} as WorkbenchBarButtonConfig);
|
||||
byId.set(nb.id, { ...existing, ...nb });
|
||||
});
|
||||
const merged = Array.from(byId.values());
|
||||
merged.sort(
|
||||
(a, b) => (a.order ?? 0) - (b.order ?? 0) || a.id.localeCompare(b.id),
|
||||
);
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
const ids = newButtons.map((b) => b.id);
|
||||
const dupes = ids.filter((id, idx) => ids.indexOf(id) !== idx);
|
||||
if (dupes.length)
|
||||
console.warn(
|
||||
"[WorkbenchBar] Duplicate ids in registerButtons:",
|
||||
dupes,
|
||||
);
|
||||
}
|
||||
return merged;
|
||||
});
|
||||
},
|
||||
[],
|
||||
);
|
||||
|
||||
const unregisterButtons = useCallback((ids: string[]) => {
|
||||
setButtons((prev) => prev.filter((b) => !ids.includes(b.id)));
|
||||
setActions((prev) =>
|
||||
Object.fromEntries(
|
||||
Object.entries(prev).filter(([id]) => !ids.includes(id)),
|
||||
),
|
||||
);
|
||||
}, []);
|
||||
|
||||
const setAction = useCallback((id: string, action?: WorkbenchBarAction) => {
|
||||
setActions((prev) => {
|
||||
if (!action) {
|
||||
if (!(id in prev)) return prev;
|
||||
const next = { ...prev };
|
||||
delete next[id];
|
||||
return next;
|
||||
}
|
||||
return { ...prev, [id]: action };
|
||||
});
|
||||
}, []);
|
||||
|
||||
const setAllButtonsDisabled = useCallback((disabled: boolean) => {
|
||||
setAllButtonsDisabledState(disabled);
|
||||
}, []);
|
||||
|
||||
const clear = useCallback(() => {
|
||||
setButtons([]);
|
||||
setActions({});
|
||||
}, []);
|
||||
|
||||
const value = useMemo<WorkbenchBarContextValue>(
|
||||
() => ({
|
||||
buttons,
|
||||
actions,
|
||||
allButtonsDisabled,
|
||||
registerButtons,
|
||||
unregisterButtons,
|
||||
setAction,
|
||||
setAllButtonsDisabled,
|
||||
clear,
|
||||
}),
|
||||
[
|
||||
buttons,
|
||||
actions,
|
||||
allButtonsDisabled,
|
||||
registerButtons,
|
||||
unregisterButtons,
|
||||
setAction,
|
||||
setAllButtonsDisabled,
|
||||
clear,
|
||||
],
|
||||
);
|
||||
|
||||
return (
|
||||
<WorkbenchBarContext.Provider value={value}>
|
||||
{children}
|
||||
</WorkbenchBarContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
export function useWorkbenchBar() {
|
||||
const ctx = useContext(WorkbenchBarContext);
|
||||
if (!ctx)
|
||||
throw new Error("useWorkbenchBar must be used within WorkbenchBarProvider");
|
||||
return ctx;
|
||||
}
|
||||
@@ -24,7 +24,11 @@ export function useAutomationForm({
|
||||
|
||||
const [automationName, setAutomationName] = useState("");
|
||||
const [automationDescription, setAutomationDescription] = useState("");
|
||||
const [automationIcon, setAutomationIcon] = useState<string>("");
|
||||
// Default to "SettingsIcon" so the saved entry always has a valid icon key
|
||||
// matching what the IconSelector renders visually. Saving an empty string
|
||||
// here would round-trip into a fallback cog, making it look like the
|
||||
// picker silently lost the user's choice.
|
||||
const [automationIcon, setAutomationIcon] = useState<string>("SettingsIcon");
|
||||
const [selectedTools, setSelectedTools] = useState<AutomationTool[]>([]);
|
||||
|
||||
const getToolName = useCallback(
|
||||
@@ -54,7 +58,7 @@ export function useAutomationForm({
|
||||
) {
|
||||
setAutomationName(existingAutomation.name || "");
|
||||
setAutomationDescription(existingAutomation.description || "");
|
||||
setAutomationIcon(existingAutomation.icon || "");
|
||||
setAutomationIcon(existingAutomation.icon || "SettingsIcon");
|
||||
|
||||
const operations = existingAutomation.operations || [];
|
||||
const tools = operations.map((op, index) => {
|
||||
|
||||
@@ -4,6 +4,11 @@ import { SuggestedAutomation } from "@app/types/automation";
|
||||
|
||||
export interface SavedAutomation extends AutomationConfig {}
|
||||
|
||||
export type ImportableAutomation = Omit<
|
||||
AutomationConfig,
|
||||
"id" | "createdAt" | "updatedAt"
|
||||
>;
|
||||
|
||||
export function useSavedAutomations() {
|
||||
const [savedAutomations, setSavedAutomations] = useState<SavedAutomation[]>(
|
||||
[],
|
||||
@@ -89,6 +94,22 @@ export function useSavedAutomations() {
|
||||
[refreshAutomations],
|
||||
);
|
||||
|
||||
const importAutomation = useCallback(
|
||||
async (automation: ImportableAutomation): Promise<SavedAutomation> => {
|
||||
try {
|
||||
const { automationStorage } =
|
||||
await import("@app/services/automationStorage");
|
||||
const saved = await automationStorage.saveAutomation(automation);
|
||||
refreshAutomations();
|
||||
return saved;
|
||||
} catch (err) {
|
||||
console.error("Error importing automation:", err);
|
||||
throw err;
|
||||
}
|
||||
},
|
||||
[refreshAutomations],
|
||||
);
|
||||
|
||||
// Load automations on mount
|
||||
useEffect(() => {
|
||||
loadSavedAutomations();
|
||||
@@ -101,5 +122,6 @@ export function useSavedAutomations() {
|
||||
refreshAutomations,
|
||||
deleteAutomation,
|
||||
copyFromSuggested,
|
||||
importAutomation,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -11,14 +11,12 @@ interface UseToolPanelGeometryOptions {
|
||||
enabled: boolean;
|
||||
toolPanelRef: RefObject<HTMLDivElement | null>;
|
||||
quickAccessRef: RefObject<HTMLDivElement | null>;
|
||||
rightRailRef?: RefObject<HTMLDivElement | null>;
|
||||
}
|
||||
|
||||
export function useToolPanelGeometry({
|
||||
enabled,
|
||||
toolPanelRef,
|
||||
quickAccessRef,
|
||||
rightRailRef,
|
||||
}: UseToolPanelGeometryOptions) {
|
||||
const [geometry, setGeometry] = useState<ToolPanelGeometry | null>(null);
|
||||
const scheduleUpdateRef = useRef<() => void>(() => {});
|
||||
@@ -35,30 +33,19 @@ export function useToolPanelGeometry({
|
||||
return;
|
||||
}
|
||||
|
||||
const rightRailEl = () => rightRailRef?.current ?? null;
|
||||
|
||||
let rafId: number | null = null;
|
||||
|
||||
const computeAndSetGeometry = () => {
|
||||
const rect = panelEl.getBoundingClientRect();
|
||||
const rail = rightRailEl();
|
||||
const isRTL =
|
||||
typeof document !== "undefined" &&
|
||||
document.documentElement.dir === "rtl";
|
||||
const railRect = rail?.getBoundingClientRect();
|
||||
const railIsOnRight = railRect
|
||||
? railRect.right > window.innerWidth / 2
|
||||
: false;
|
||||
const rightOffset =
|
||||
railRect && railIsOnRight
|
||||
? Math.max(0, window.innerWidth - railRect.right)
|
||||
: 0;
|
||||
let width: number;
|
||||
let left: number;
|
||||
|
||||
if (isRTL) {
|
||||
// RTL: panel is on the left, expands rightward
|
||||
width = Math.max(360, window.innerWidth - rect.right - rightOffset);
|
||||
width = Math.max(360, window.innerWidth - rect.right);
|
||||
left = rect.right;
|
||||
} else {
|
||||
// LTR: panel is on the right, expands leftward to the file sidebar
|
||||
@@ -97,10 +84,6 @@ export function useToolPanelGeometry({
|
||||
if (quickAccessRef.current) {
|
||||
resizeObserver.observe(quickAccessRef.current);
|
||||
}
|
||||
const rail = rightRailEl();
|
||||
if (rail) {
|
||||
resizeObserver.observe(rail);
|
||||
}
|
||||
// Observe root element to react to viewport-driven layout changes
|
||||
if (document.documentElement) {
|
||||
resizeObserver.observe(document.documentElement);
|
||||
@@ -122,21 +105,19 @@ export function useToolPanelGeometry({
|
||||
scheduleUpdateRef.current = () => {};
|
||||
resizeObserver?.disconnect();
|
||||
};
|
||||
}, [enabled, quickAccessRef, toolPanelRef, rightRailRef]);
|
||||
}, [enabled, quickAccessRef, toolPanelRef]);
|
||||
|
||||
// Secondary effect: (re)attach observers when refs' .current become available later
|
||||
// Secondary effect: (re)attach observer when quickAccessRef.current becomes available later
|
||||
useLayoutEffect(() => {
|
||||
if (!enabled) return;
|
||||
if (typeof ResizeObserver === "undefined") return;
|
||||
const qa = quickAccessRef.current;
|
||||
const rail = rightRailRef?.current ?? null;
|
||||
if (!qa && !rail) return;
|
||||
if (!qa) return;
|
||||
|
||||
const ro = new ResizeObserver(() => scheduleUpdateRef.current());
|
||||
if (qa) ro.observe(qa);
|
||||
if (rail) ro.observe(rail);
|
||||
ro.observe(qa);
|
||||
return () => ro.disconnect();
|
||||
}, [enabled, quickAccessRef.current, rightRailRef?.current]);
|
||||
}, [enabled, quickAccessRef.current]);
|
||||
|
||||
return geometry;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ export function useFileActionTerminology() {
|
||||
mobileUpload: t("landing.mobileUpload", "Upload from Mobile"),
|
||||
uploadFromComputer: t("landing.uploadFromComputer", "Upload from computer"),
|
||||
download: t("download", "Download"),
|
||||
downloadAll: t("rightRail.downloadAll", "Download All"),
|
||||
downloadAll: t("workbenchBar.downloadAll", "Download All"),
|
||||
downloadSelected: t("fileManager.downloadSelected", "Download Selected"),
|
||||
downloadUnavailable: t(
|
||||
"downloadUnavailable",
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import { StirlingFileStub } from "@app/types/fileContext";
|
||||
import { useIndexedDBThumbnail } from "@app/hooks/useIndexedDBThumbnail";
|
||||
|
||||
export function useFileThumbnail(
|
||||
fileStub: StirlingFileStub | null | undefined,
|
||||
): {
|
||||
isEncrypted: boolean;
|
||||
thumbnail: string | null;
|
||||
isGenerating: boolean;
|
||||
} {
|
||||
const isEncrypted = Boolean(fileStub?.processedFile?.isEncrypted);
|
||||
const { thumbnail: indexedDBThumb, isGenerating } = useIndexedDBThumbnail(
|
||||
isEncrypted ? null : fileStub,
|
||||
);
|
||||
const thumbnail = isEncrypted
|
||||
? null
|
||||
: fileStub?.thumbnailUrl || indexedDBThumb || null;
|
||||
return { isEncrypted, thumbnail, isGenerating };
|
||||
}
|
||||
@@ -2,8 +2,7 @@ import { useEffect, useState } from "react";
|
||||
|
||||
export type OS =
|
||||
| "windows"
|
||||
| "mac-intel"
|
||||
| "mac-apple"
|
||||
| "mac"
|
||||
| "linux-x64"
|
||||
| "linux-arm64"
|
||||
| "ios"
|
||||
@@ -23,15 +22,7 @@ function parseUA(ua: string): OS {
|
||||
|
||||
if (/android/.test(uaLower)) return "android";
|
||||
if (/windows nt/.test(uaLower)) return "windows";
|
||||
if (/mac os x/.test(uaLower)) {
|
||||
// Default to Intel; refine via hints below
|
||||
let detected: OS = "mac-intel";
|
||||
// Safari on Apple Silicon sometimes exposes both tokens
|
||||
if (ua.includes("Apple") && ua.includes("ARM")) {
|
||||
detected = "mac-apple";
|
||||
}
|
||||
return detected; // will be further refined via Client Hints if available
|
||||
}
|
||||
if (/mac os x/.test(uaLower)) return "mac";
|
||||
if (/linux|x11/.test(uaLower)) return "linux-x64";
|
||||
|
||||
return "unknown";
|
||||
@@ -64,10 +55,7 @@ export function useOs(): OS {
|
||||
else if (plat.includes("ios")) detected = "ios";
|
||||
else if (plat.includes("android")) detected = "android";
|
||||
else if (plat.includes("mac")) {
|
||||
// CH “architecture” is often "arm" on Apple Silicon
|
||||
detected = architecture?.toLowerCase().includes("arm")
|
||||
? "mac-apple"
|
||||
: "mac-intel";
|
||||
detected = "mac";
|
||||
} else if (plat.includes("linux") || plat.includes("chrome os")) {
|
||||
const archLower = (architecture || "").toLowerCase();
|
||||
const isArm =
|
||||
@@ -78,9 +66,6 @@ export function useOs(): OS {
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
} else {
|
||||
// Heuristic Apple Silicon from UA when no Client Hints (Safari): uncertain, prefer not to guess
|
||||
// Keep detected as-is (often 'mac-intel').
|
||||
}
|
||||
|
||||
if (!cancelled) setOs(detected);
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { SidebarRefs } from "@app/types/sidebar";
|
||||
|
||||
export function useRightRailTooltipSide(
|
||||
sidebarRefs?: SidebarRefs,
|
||||
defaultOffset: number = 16,
|
||||
): { position: "left" | "right" | "bottom"; offset: number } {
|
||||
const [position, setPosition] = useState<"left" | "right" | "bottom">(
|
||||
"bottom",
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
const computePosition = () => {
|
||||
const rail = sidebarRefs?.rightRailRef?.current;
|
||||
const isRTL =
|
||||
typeof document !== "undefined" &&
|
||||
document.documentElement.dir === "rtl";
|
||||
|
||||
// No rail visible — buttons are in the top bar, tooltips should point down
|
||||
if (!rail || typeof window === "undefined") {
|
||||
setPosition("bottom");
|
||||
return;
|
||||
}
|
||||
|
||||
const rect = rail.getBoundingClientRect();
|
||||
const center = rect.left + rect.width / 2;
|
||||
const preferred = center > window.innerWidth / 2 ? "left" : "right";
|
||||
setPosition(isRTL ? "left" : preferred);
|
||||
};
|
||||
|
||||
computePosition();
|
||||
window.addEventListener("resize", computePosition);
|
||||
return () => window.removeEventListener("resize", computePosition);
|
||||
}, [sidebarRefs]);
|
||||
|
||||
return { position, offset: defaultOffset };
|
||||
}
|
||||
@@ -60,15 +60,14 @@ export function useNavigationUrlSync(
|
||||
firePixel(currentPath);
|
||||
|
||||
const route = parseToolRoute(registry);
|
||||
if (route.toolId !== selectedTool) {
|
||||
if (route.toolId) {
|
||||
if (route.toolId) {
|
||||
// URL specifies a tool — navigate to it (URL takes precedence over startup view preference)
|
||||
if (route.toolId !== selectedTool) {
|
||||
checkPremiumAndSelect(route.toolId);
|
||||
} else if (selectedTool !== null) {
|
||||
// Only clear selection if we actually had a tool selected
|
||||
// Don't clear on initial load when selectedTool starts as null
|
||||
clearToolSelection();
|
||||
}
|
||||
}
|
||||
// When the URL is the home path (no tool), leave selectedTool untouched so that
|
||||
// the startup view preference (defaultStartupView) is respected.
|
||||
|
||||
hasInitialized.current = true;
|
||||
}, [checkPremiumAndSelect, config, enableSync, registry, selectedTool]); // Include dependencies
|
||||
|
||||
+14
-11
@@ -1,23 +1,26 @@
|
||||
import { useEffect, useMemo } from "react";
|
||||
import { useRightRail } from "@app/contexts/RightRailContext";
|
||||
import { RightRailAction, RightRailButtonConfig } from "@app/types/rightRail";
|
||||
import { useWorkbenchBar } from "@app/contexts/WorkbenchBarContext";
|
||||
import {
|
||||
WorkbenchBarAction,
|
||||
WorkbenchBarButtonConfig,
|
||||
} from "@app/types/workbenchBar";
|
||||
|
||||
export interface RightRailButtonWithAction extends RightRailButtonConfig {
|
||||
onClick?: RightRailAction;
|
||||
export interface WorkbenchBarButtonWithAction extends WorkbenchBarButtonConfig {
|
||||
onClick?: WorkbenchBarAction;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers one or more RightRail buttons and their actions.
|
||||
* Registers one or more WorkbenchBar buttons and their actions.
|
||||
* - Automatically registers on mount and unregisters on unmount
|
||||
* - Updates registration when the input array reference changes
|
||||
*/
|
||||
export function useRightRailButtons(
|
||||
buttons: readonly RightRailButtonWithAction[],
|
||||
export function useWorkbenchBarButtons(
|
||||
buttons: readonly WorkbenchBarButtonWithAction[],
|
||||
) {
|
||||
const { registerButtons, unregisterButtons, setAction } = useRightRail();
|
||||
const { registerButtons, unregisterButtons, setAction } = useWorkbenchBar();
|
||||
|
||||
// Memoize configs and ids to reduce churn
|
||||
const configs: RightRailButtonConfig[] = useMemo(
|
||||
const configs: WorkbenchBarButtonConfig[] = useMemo(
|
||||
() => buttons.map(({ onClick, ...cfg }) => cfg),
|
||||
[buttons],
|
||||
);
|
||||
@@ -31,9 +34,9 @@ export function useRightRailButtons(
|
||||
const idSet = new Set<string>();
|
||||
buttons.forEach((b) => {
|
||||
if (!b.onClick && !b.render)
|
||||
console.warn("[RightRail] Missing onClick/render for id:", b.id);
|
||||
console.warn("[WorkbenchBar] Missing onClick/render for id:", b.id);
|
||||
if (idSet.has(b.id))
|
||||
console.warn("[RightRail] Duplicate id in buttons array:", b.id);
|
||||
console.warn("[WorkbenchBar] Duplicate id in buttons array:", b.id);
|
||||
idSet.add(b.id);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import { SidebarRefs } from "@app/types/sidebar";
|
||||
|
||||
export function useWorkbenchBarTooltipSide(
|
||||
_sidebarRefs?: SidebarRefs,
|
||||
defaultOffset: number = 16,
|
||||
): { position: "left" | "right" | "bottom"; offset: number } {
|
||||
return { position: "bottom", offset: defaultOffset };
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user