Compare commits
67
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df00d61480 | ||
|
|
562166419b | ||
|
|
2b77fb345a | ||
|
|
bedf797f46 | ||
|
|
86378dbc64 | ||
|
|
d560335a6c | ||
|
|
73704feb10 | ||
|
|
b49b04bd68 | ||
|
|
873caf5172 | ||
|
|
776749277c | ||
|
|
41b1b89fcb | ||
|
|
4d4e994562 | ||
|
|
193b096495 | ||
|
|
1cdecfaf58 | ||
|
|
2b118556f3 | ||
|
|
fbaff56d1c | ||
|
|
c6f8ed43fd | ||
|
|
05de5d7e2d | ||
|
|
449353150d | ||
|
|
0f6f5b4e0b | ||
|
|
941dc35cda | ||
|
|
93bc796e2f | ||
|
|
a1b15e0570 | ||
|
|
76549288a9 | ||
|
|
544a1f02eb | ||
|
|
6800db8029 | ||
|
|
2748fe3157 | ||
|
|
b5d0c4a5ed | ||
|
|
8bfcf6eb7e | ||
|
|
b019f9b570 | ||
|
|
b7bcbc9f45 | ||
|
|
d7f51d7f72 | ||
|
|
2c0728c1a7 | ||
|
|
cca8c700d3 | ||
|
|
17b0fae153 | ||
|
|
c5fbf85035 | ||
|
|
ee6684f6a4 | ||
|
|
925caf6d11 | ||
|
|
a70f80279a | ||
|
|
99be0ae3c6 | ||
|
|
a84b375f5d | ||
|
|
52358c5bf9 | ||
|
|
c1e68c27c5 | ||
|
|
d8599e2c6f | ||
|
|
7b43bb483e | ||
|
|
5f6b88005e | ||
|
|
41f507a9f0 | ||
|
|
ffc0755b37 | ||
|
|
91e0815f93 | ||
|
|
e3b4bc2412 | ||
|
|
e9785b6b2f | ||
|
|
31b7c0069d | ||
|
|
a8a5f3a88f | ||
|
|
d4edff9059 | ||
|
|
80febc9993 | ||
|
|
c500c2fae7 | ||
|
|
38ccea074c | ||
|
|
a7307ff393 | ||
|
|
72729e99c1 | ||
|
|
5fba2720f0 | ||
|
|
01a1ef8c44 | ||
|
|
8535c7e9ac | ||
|
|
cca3f42623 | ||
|
|
1b7ffcdbac | ||
|
|
67a0ca6110 | ||
|
|
8e4b2e2fc6 | ||
|
|
3c93457021 |
@@ -1,6 +1,6 @@
|
||||
# Maintainer: Stirling PDF Inc <contact@stirlingpdf.com>
|
||||
pkgname=stirling-pdf-desktop
|
||||
pkgver=2.14.1
|
||||
pkgver=2.14.2
|
||||
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.14.1
|
||||
pkgver=2.14.2
|
||||
pkgrel=1
|
||||
pkgdesc="Locally hosted, web-based PDF manipulation tool (server JAR, prebuilt)"
|
||||
arch=('any')
|
||||
|
||||
@@ -510,6 +510,7 @@ jobs:
|
||||
# cargo output unsigned, so checking it produces false negatives.
|
||||
- name: Verify Windows Code Signature
|
||||
if: ${{ matrix.platform == 'windows-latest' && env.SM_API_KEY != '' && (github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.sign != 'false') || github.ref == 'refs/heads/V2-master') }}
|
||||
timeout-minutes: 15
|
||||
shell: pwsh
|
||||
run: |
|
||||
$allSigned = $true
|
||||
@@ -531,11 +532,26 @@ jobs:
|
||||
|
||||
# Extract MSI and verify the inner exe (the file that actually gets installed).
|
||||
# This is the critical check - AV flags the installed exe at runtime.
|
||||
# Use lessmsi, not `msiexec /a`: msiexec serializes on the global
|
||||
# _MSIExecute mutex and hangs forever on hosted runners when another
|
||||
# installer is busy. lessmsi reads MSI tables directly - no mutex, no service.
|
||||
$msi = $msiFiles[0].FullName
|
||||
$extractDir = Join-Path $env:RUNNER_TEMP "msi-verify"
|
||||
if (Test-Path $extractDir) { Remove-Item $extractDir -Recurse -Force }
|
||||
$proc = Start-Process msiexec.exe -ArgumentList '/a', $msi, '/qn', "TARGETDIR=$extractDir" -Wait -PassThru -NoNewWindow
|
||||
if ($proc.ExitCode -eq 0) {
|
||||
New-Item -ItemType Directory -Force -Path $extractDir | Out-Null
|
||||
|
||||
choco install lessmsi -y --no-progress --limit-output | Out-Null
|
||||
|
||||
# Bound the extraction and kill on hang (defence in depth over timeout-minutes).
|
||||
$proc = Start-Process lessmsi -ArgumentList 'x', "`"$msi`"", "`"$extractDir\`"" -PassThru -NoNewWindow
|
||||
if (-not $proc.WaitForExit(120000)) {
|
||||
try { $proc.Kill() } catch {}
|
||||
Write-Host "[ERROR] MSI extraction timed out after 120s"
|
||||
$allSigned = $false
|
||||
} elseif ($proc.ExitCode -ne 0) {
|
||||
Write-Host "[ERROR] Failed to extract MSI for verification (exit code: $($proc.ExitCode))"
|
||||
$allSigned = $false
|
||||
} else {
|
||||
$innerExe = Get-ChildItem -Path $extractDir -Filter "stirling-pdf.exe" -Recurse -File | Select-Object -First 1
|
||||
if ($innerExe) {
|
||||
$sig = Get-AuthenticodeSignature -FilePath $innerExe.FullName
|
||||
@@ -548,9 +564,6 @@ jobs:
|
||||
Write-Host "[ERROR] Could not find stirling-pdf.exe inside MSI"
|
||||
$allSigned = $false
|
||||
}
|
||||
} else {
|
||||
Write-Host "[ERROR] Failed to extract MSI for verification (exit code: $($proc.ExitCode))"
|
||||
$allSigned = $false
|
||||
}
|
||||
|
||||
if (-not $allSigned) {
|
||||
@@ -800,7 +813,11 @@ jobs:
|
||||
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
|
||||
with:
|
||||
tag_name: v${{ needs.determine-matrix.outputs.version }}
|
||||
generate_release_notes: true
|
||||
# Don't regenerate/append notes on re-runs, and don't force this into the
|
||||
# "Latest" slot - leave the release body and latest marker as they are.
|
||||
generate_release_notes: false
|
||||
append_body: false
|
||||
make_latest: false
|
||||
fail_on_unmatched_files: true
|
||||
# Installers + updater payloads + manifest. .sig contents are embedded
|
||||
# in latest.json so the .sig files themselves are not uploaded.
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"ignoredFiles": [
|
||||
"frontend/editor/src-tauri/icons/icon.png"
|
||||
]
|
||||
}
|
||||
@@ -203,6 +203,22 @@ tasks:
|
||||
cmds:
|
||||
- task: lint:eslint
|
||||
- task: lint:dpdm
|
||||
- task: lint:colors
|
||||
|
||||
lint:colors:
|
||||
desc: "Enforce theme tokens — all CSS colours route through the palette"
|
||||
deps: [install]
|
||||
cmds:
|
||||
- node editor/scripts/lint/theme-lint.mjs
|
||||
- node editor/scripts/lint/theme-lint.mjs css-colors
|
||||
- node editor/scripts/lint/theme-lint.mjs code-colors
|
||||
- node editor/scripts/lint/theme-lint.mjs contrast
|
||||
|
||||
contrast:
|
||||
desc: "Check theme token pairs clear WCAG AA contrast per theme"
|
||||
deps: [install]
|
||||
cmds:
|
||||
- node editor/scripts/lint/theme-lint.mjs contrast
|
||||
|
||||
lint:eslint:
|
||||
desc: "Run ESLint linting"
|
||||
|
||||
@@ -155,6 +155,8 @@ The project structure is defined in `engine/pyproject.toml`. Any new dependencie
|
||||
|
||||
For a broader explanation of the frontend layering and override architecture, read @frontend/editor/DeveloperGuide.md
|
||||
|
||||
Before touching colours or theming (tokens, dark mode, accent colours), read @frontend/editor/src/core/theme/README.md — it explains the palette/`--c-*` token system and the rule that literal colours live only in `primitives.css`.
|
||||
|
||||
```typescript
|
||||
// ✅ CORRECT - Use @app/* for all imports
|
||||
import { AppLayout } from "@app/components/AppLayout";
|
||||
|
||||
+18
-1
@@ -144,8 +144,10 @@ public class TempFileCleanupService {
|
||||
int directoriesDeletedCount = 0;
|
||||
for (Path directory : registry.getTempDirectories()) {
|
||||
try {
|
||||
if (Files.exists(directory)) {
|
||||
if (Files.exists(directory)
|
||||
&& shouldDeleteRegisteredDirectory(directory, maxAgeMillis)) {
|
||||
GeneralUtils.deleteDirectory(directory);
|
||||
registry.unregisterDirectory(directory);
|
||||
directoriesDeletedCount++;
|
||||
log.debug("Cleaned up temporary directory: {}", directory);
|
||||
}
|
||||
@@ -275,6 +277,21 @@ public class TempFileCleanupService {
|
||||
return totalDeletedCount.get();
|
||||
}
|
||||
|
||||
private boolean shouldDeleteRegisteredDirectory(Path directory, long maxAgeMillis) {
|
||||
if (maxAgeMillis <= 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
try {
|
||||
long currentTime = System.currentTimeMillis();
|
||||
long lastModified = Files.getLastModifiedTime(directory).toMillis();
|
||||
return (currentTime - lastModified) > maxAgeMillis;
|
||||
} catch (IOException e) {
|
||||
log.debug("Could not check directory age, skipping cleanup: {}", directory, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/** Get the system temp directory path based on configuration or system property. */
|
||||
private Path getSystemTempPath() {
|
||||
String systemTempDir =
|
||||
|
||||
@@ -155,6 +155,7 @@ public class TempFileManager {
|
||||
if (directory != null && Files.isDirectory(directory)) {
|
||||
try {
|
||||
GeneralUtils.deleteDirectory(directory);
|
||||
registry.unregisterDirectory(directory);
|
||||
log.debug("Deleted temp directory: {}", directory.toString());
|
||||
} catch (IOException e) {
|
||||
log.warn("Failed to delete temp directory: {}", directory.toString(), e);
|
||||
|
||||
@@ -85,6 +85,18 @@ public class TempFileRegistry {
|
||||
return directory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregister a temporary directory from the registry.
|
||||
*
|
||||
* @param directory The directory to unregister
|
||||
*/
|
||||
public void unregisterDirectory(Path directory) {
|
||||
if (directory != null) {
|
||||
tempDirectories.remove(directory);
|
||||
log.debug("Unregistered temp directory: {}", directory.toString());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a third-party temporary file that requires special handling.
|
||||
*
|
||||
|
||||
+19
-1
@@ -176,11 +176,13 @@ class TempFileCleanupServiceMoreTest {
|
||||
class ScheduledCleanup {
|
||||
|
||||
@Test
|
||||
@DisplayName("deletes registered temp directories and reports counts")
|
||||
@DisplayName("deletes stale registered temp directories and reports counts")
|
||||
void deletesRegisteredDirectories() throws IOException {
|
||||
when(tempFileManager.cleanupOldTempFiles(anyLong())).thenReturn(2);
|
||||
Path regDir = Files.createDirectories(tempDir.resolve("registeredDir"));
|
||||
Files.createFile(regDir.resolve("inside.txt"));
|
||||
Files.setLastModifiedTime(
|
||||
regDir, FileTime.fromMillis(System.currentTimeMillis() - 2L * 60 * 60 * 1000));
|
||||
Set<Path> dirs = new HashSet<>();
|
||||
dirs.add(regDir);
|
||||
when(registry.getTempDirectories()).thenReturn(dirs);
|
||||
@@ -193,6 +195,22 @@ class TempFileCleanupServiceMoreTest {
|
||||
verify(tempFileManager).cleanupOldTempFiles(anyLong());
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("keeps a fresh registered temp directory")
|
||||
void keepsFreshRegisteredDirectory() throws IOException {
|
||||
when(tempFileManager.cleanupOldTempFiles(anyLong())).thenReturn(0);
|
||||
Path regDir = Files.createDirectories(tempDir.resolve("freshRegisteredDir"));
|
||||
Files.createFile(regDir.resolve("inside.txt"));
|
||||
Set<Path> dirs = new HashSet<>();
|
||||
dirs.add(regDir);
|
||||
when(registry.getTempDirectories()).thenReturn(dirs);
|
||||
lenient().when(registry.contains(any(File.class))).thenReturn(false);
|
||||
|
||||
withIsolatedUserHome(cleanupService::scheduledCleanup);
|
||||
|
||||
assertThat(Files.exists(regDir)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("skips a registered directory that no longer exists")
|
||||
void skipsMissingRegisteredDirectory() {
|
||||
|
||||
+40
-4
@@ -43,6 +43,10 @@ public class IntegrationConfigService {
|
||||
private final OwnershipService ownership;
|
||||
private final SecretMasker secretMasker;
|
||||
private final ResourceGrantRepository grantRepository;
|
||||
// Bean-discovered extension points: features that understand a type contribute its config
|
||||
// schema and report what still references a config, without this module depending on them.
|
||||
private final List<IntegrationConfigValidator> validators;
|
||||
private final List<IntegrationConfigUsageCheck> usageChecks;
|
||||
|
||||
// ---- commands ----
|
||||
|
||||
@@ -66,13 +70,21 @@ public class IntegrationConfigService {
|
||||
? DefaultAccessPolicy.EXPLICIT_ONLY
|
||||
: request.defaultAccess());
|
||||
|
||||
// TEAM scope may omit the team id: default to the caller's own team so clients (the
|
||||
// portal) need not know it. assignOwnership still enforces admin-or-leader of that team.
|
||||
Long ownerTeamId = request.ownerTeamId();
|
||||
if (ownerTeamId == null && scope == OwnerScope.TEAM && currentUser.getTeam() != null) {
|
||||
ownerTeamId = currentUser.getTeam().getId();
|
||||
}
|
||||
ownership.assignOwnership(
|
||||
cfg,
|
||||
scope,
|
||||
request.ownerTeamId(),
|
||||
ownerTeamId,
|
||||
currentUser,
|
||||
() -> lockedServerExists(cfg.getIntegrationType()));
|
||||
cfg.setConfig(writeJson(secretMasker.sanitize(request.config())));
|
||||
Map<String, Object> config = secretMasker.sanitize(request.config());
|
||||
validateConfig(cfg.getIntegrationType(), config);
|
||||
cfg.setConfig(writeJson(config));
|
||||
return repository.save(cfg);
|
||||
}
|
||||
|
||||
@@ -101,8 +113,10 @@ public class IntegrationConfigService {
|
||||
cfg.setDefaultAccess(request.defaultAccess());
|
||||
}
|
||||
if (request.config() != null) {
|
||||
cfg.setConfig(
|
||||
writeJson(secretMasker.merge(readJson(cfg.getConfig()), request.config())));
|
||||
Map<String, Object> merged =
|
||||
secretMasker.merge(readJson(cfg.getConfig()), request.config());
|
||||
validateConfig(cfg.getIntegrationType(), merged);
|
||||
cfg.setConfig(writeJson(merged));
|
||||
}
|
||||
return repository.save(cfg);
|
||||
}
|
||||
@@ -113,6 +127,15 @@ public class IntegrationConfigService {
|
||||
if (!ownership.canManage(TYPE, cfg, currentUser)) {
|
||||
throw forbidden("You cannot manage this integration");
|
||||
}
|
||||
// Refuse to pull a connection out from under whatever still references it.
|
||||
List<String> usages =
|
||||
usageChecks.stream()
|
||||
.flatMap(check -> check.usagesOf(cfg.getId()).stream())
|
||||
.toList();
|
||||
if (!usages.isEmpty()) {
|
||||
throw new ResponseStatusException(
|
||||
HttpStatus.CONFLICT, "Integration is in use by: " + String.join(", ", usages));
|
||||
}
|
||||
// Drop grants sharing this config so they do not dangle as dead rows.
|
||||
grantRepository.deleteByResourceTypeAndResourceId(TYPE, String.valueOf(cfg.getId()));
|
||||
repository.delete(cfg);
|
||||
@@ -188,6 +211,19 @@ public class IntegrationConfigService {
|
||||
|
||||
// ---- integration-specific glue ----
|
||||
|
||||
/** Runs every registered validator for the type; unknown types save free-form. */
|
||||
private void validateConfig(IntegrationType type, Map<String, Object> config) {
|
||||
for (IntegrationConfigValidator validator : validators) {
|
||||
if (validator.type() == type) {
|
||||
try {
|
||||
validator.validate(config == null ? Map.of() : config);
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new ResponseStatusException(HttpStatus.BAD_REQUEST, e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** A non-admin can't create a personal config of a type an admin has locked at server scope. */
|
||||
private boolean lockedServerExists(IntegrationType type) {
|
||||
return repository.findByScope(OwnerScope.SERVER).stream()
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package stirling.software.proprietary.integration.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Reports what still references an integration config, so deletion can be refused instead of
|
||||
* pulling a connection out from under a live consumer. Implementations are beans discovered by
|
||||
* {@link IntegrationConfigService} (e.g. the policy subsystem reporting sources and pipelines that
|
||||
* reference a connection).
|
||||
*/
|
||||
public interface IntegrationConfigUsageCheck {
|
||||
|
||||
/** Human-readable labels of everything still using the config; empty when unreferenced. */
|
||||
List<String> usagesOf(long configId);
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package stirling.software.proprietary.integration.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import stirling.software.proprietary.integration.model.IntegrationType;
|
||||
|
||||
/**
|
||||
* Validates one integration type's config map at save time. Implementations are beans discovered by
|
||||
* {@link IntegrationConfigService}, so the feature that understands a type (e.g. the policy S3
|
||||
* backend) owns its schema without the integration module depending on it. Types with no registered
|
||||
* validator save free-form.
|
||||
*/
|
||||
public interface IntegrationConfigValidator {
|
||||
|
||||
/** The type this validator understands. */
|
||||
IntegrationType type();
|
||||
|
||||
/**
|
||||
* Validates the config as it will be stored (secrets already sanitized/merged, so values are
|
||||
* real, never the redaction mask). Throws {@link IllegalArgumentException} on bad config.
|
||||
*/
|
||||
void validate(Map<String, Object> config);
|
||||
}
|
||||
+20
@@ -120,6 +120,7 @@ public class PolicyController {
|
||||
throws IOException {
|
||||
stampPolicyAudit(definition);
|
||||
requireRunnable(definition);
|
||||
validateAdHocOutput(definition);
|
||||
PolicyInputs inputs = toInputs(files);
|
||||
PolicyRunHandle handle =
|
||||
policyRunner.runAdHoc(definition, inputs, PolicyProgressListener.NOOP);
|
||||
@@ -140,6 +141,7 @@ public class PolicyController {
|
||||
throws IOException {
|
||||
stampPolicyAudit(definition);
|
||||
requireRunnable(definition);
|
||||
validateAdHocOutput(definition);
|
||||
PolicyInputs inputs = toInputs(files);
|
||||
|
||||
SseEmitter emitter =
|
||||
@@ -530,6 +532,24 @@ public class PolicyController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Authorization-check an ad-hoc run's output while the caller's principal is present (this
|
||||
* request thread). The worker thread that later delivers carries no security context, so an S3
|
||||
* output's connection-access check would be skipped there; without this gate a caller could
|
||||
* reference another tenant's connection by id and write to it (confused deputy). Stored
|
||||
* policies are covered by save-time {@link PolicyValidator#validate} instead.
|
||||
*/
|
||||
private void validateAdHocOutput(PipelineDefinition definition) {
|
||||
if (definition.output() == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
policyValidator.validateOutput(definition.output());
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new ResponseStatusException(HttpStatus.BAD_REQUEST, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ad-hoc runs (AI / one-off pipelines) are still editor activity, so their supplied documents
|
||||
* feed the same virtual editor source as stored editor policies, counted against the caller's
|
||||
|
||||
+13
-1
@@ -52,7 +52,19 @@ public class PolicyValidator {
|
||||
InputSpec spec = source.toInputSpec();
|
||||
inputSourceFor(spec).validate(spec);
|
||||
}
|
||||
outputSinkFor(policy.output()).validate(policy.output());
|
||||
validateOutput(policy.output());
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate an output spec against its sink. Must be called on a request thread (caller's
|
||||
* principal present) so an S3 output's connection is authorization-checked against the caller -
|
||||
* ad-hoc runs are never persisted and so never hit {@link #validate(Policy)}, and the worker
|
||||
* thread that later delivers has no principal, so this is their only access gate.
|
||||
*
|
||||
* @throws IllegalArgumentException if the type is unknown or the config is invalid/inaccessible
|
||||
*/
|
||||
public void validateOutput(OutputSpec output) {
|
||||
outputSinkFor(output).validate(output);
|
||||
}
|
||||
|
||||
private PolicyTrigger triggerFor(TriggerConfig config) {
|
||||
|
||||
+14
-13
@@ -18,6 +18,7 @@ import stirling.software.proprietary.policy.model.InputSpec;
|
||||
import stirling.software.proprietary.policy.model.PolicyInputs;
|
||||
import stirling.software.proprietary.policy.s3.S3Config;
|
||||
import stirling.software.proprietary.policy.s3.S3ConnectionPool;
|
||||
import stirling.software.proprietary.policy.s3.S3ConnectionResolver;
|
||||
import stirling.software.proprietary.policy.s3.S3Identities;
|
||||
|
||||
import software.amazon.awssdk.core.exception.SdkException;
|
||||
@@ -36,15 +37,14 @@ import software.amazon.awssdk.services.s3.model.S3Object;
|
||||
* Reads input files from an Amazon S3 (or S3-compatible) bucket; each listed object is its own unit
|
||||
* of work, claimed through the {@link ResolveContext} ledger and tracked in place. Identity and
|
||||
* version gate come from {@link S3Identities}, so the steady-state sweep never downloads content.
|
||||
* Options (see {@link S3Config}): "bucket" (required), "region" (default us-east-1), "prefix" (only
|
||||
* keys starting with it are read), "endpoint" (S3-compatible stores such as MinIO; path-style
|
||||
* addressing is used automatically), "accessKeyId" and "secretAccessKey" (required; requests are
|
||||
* never signed with the server's own AWS identity), and "mode" which is "consume" (default: a
|
||||
* processed object is deleted once every policy that claimed it has settled successfully and it is
|
||||
* still the version that ran; failures stay in place and are not retried until they change) or
|
||||
* "snapshot" (stateless, every run sees the full set). Keys ending in "/" (folder placeholders) and
|
||||
* keys with a dot-prefixed path segment are never picked up, mirroring the folder source's
|
||||
* hidden-file rule.
|
||||
* Options: "connectionId" references the stored S3 connection (an {@code IntegrationConfig} owning
|
||||
* bucket, region, endpoint, and credentials - resolved by {@link S3ConnectionResolver}); "prefix"
|
||||
* (only keys starting with it are read) and "mode" are per-source, where mode is "consume"
|
||||
* (default: a processed object is deleted once every policy that claimed it has settled
|
||||
* successfully and it is still the version that ran; failures stay in place and are not retried
|
||||
* until they change) or "snapshot" (stateless, every run sees the full set). Keys ending in "/"
|
||||
* (folder placeholders) and keys with a dot-prefixed path segment are never picked up, mirroring
|
||||
* the folder source's hidden-file rule.
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@@ -55,6 +55,7 @@ public class S3InputSource implements InputSource {
|
||||
private static final String TYPE = "s3";
|
||||
|
||||
private final S3ConnectionPool connectionPool;
|
||||
private final S3ConnectionResolver connectionResolver;
|
||||
|
||||
@Override
|
||||
public String type() {
|
||||
@@ -67,12 +68,12 @@ public class S3InputSource implements InputSource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Fails fast at save time: bad config shape, a private endpoint without the operator opt-in, or
|
||||
* a bucket the supplied credentials cannot list.
|
||||
* Fails fast at save time: an unknown/disabled/unusable connection, bad config shape, a private
|
||||
* endpoint without the operator opt-in, or a bucket the connection cannot list.
|
||||
*/
|
||||
@Override
|
||||
public void validate(InputSpec spec) {
|
||||
S3Config config = S3Config.from(spec.options());
|
||||
S3Config config = connectionResolver.resolve(spec.options());
|
||||
try {
|
||||
connectionPool.clientFor(config).listObjectsV2(listRequest(config).maxKeys(1).build());
|
||||
} catch (SdkException e) {
|
||||
@@ -89,7 +90,7 @@ public class S3InputSource implements InputSource {
|
||||
|
||||
@Override
|
||||
public List<ResolvedInput> resolve(InputSpec spec, ResolveContext ctx) throws IOException {
|
||||
S3Config config = S3Config.from(spec.options());
|
||||
S3Config config = connectionResolver.resolve(spec.options());
|
||||
S3Client client = connectionPool.clientFor(config);
|
||||
// A listing failure propagates so the sweep reads it as "could not list" (which vetoes
|
||||
// presence cleanup), never as "verifiably no objects".
|
||||
|
||||
+7
-5
@@ -27,6 +27,7 @@ import stirling.software.proprietary.policy.ledger.ProcessedLedger;
|
||||
import stirling.software.proprietary.policy.model.OutputSpec;
|
||||
import stirling.software.proprietary.policy.s3.S3Config;
|
||||
import stirling.software.proprietary.policy.s3.S3ConnectionPool;
|
||||
import stirling.software.proprietary.policy.s3.S3ConnectionResolver;
|
||||
import stirling.software.proprietary.policy.s3.S3Identities;
|
||||
|
||||
import software.amazon.awssdk.core.exception.SdkException;
|
||||
@@ -59,6 +60,7 @@ public class S3OutputSink implements PolicyOutputSink {
|
||||
private static final String TYPE = "s3";
|
||||
|
||||
private final S3ConnectionPool connectionPool;
|
||||
private final S3ConnectionResolver connectionResolver;
|
||||
private final ProcessedLedger processedLedger;
|
||||
|
||||
@Override
|
||||
@@ -72,19 +74,19 @@ public class S3OutputSink implements PolicyOutputSink {
|
||||
}
|
||||
|
||||
/**
|
||||
* Config shape and endpoint guard only - no network probe, since write-only credentials
|
||||
* (s3:PutObject without s3:ListBucket) are a legitimate setup for an output bucket and a
|
||||
* listing probe would wrongly reject them.
|
||||
* Connection resolution (including the saving user's right to use it) and endpoint guard only -
|
||||
* no network probe, since write-only credentials (s3:PutObject without s3:ListBucket) are a
|
||||
* legitimate setup for an output bucket and a listing probe would wrongly reject them.
|
||||
*/
|
||||
@Override
|
||||
public void validate(OutputSpec spec) {
|
||||
connectionPool.clientFor(S3Config.from(spec.options()));
|
||||
connectionPool.clientFor(connectionResolver.resolve(spec.options()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResultFile> deliver(
|
||||
OutputDelivery delivery, List<Resource> outputs, OutputSpec spec) throws IOException {
|
||||
S3Config config = S3Config.from(spec.options());
|
||||
S3Config config = connectionResolver.resolve(spec.options());
|
||||
S3Client client = connectionPool.clientFor(config);
|
||||
|
||||
List<ResultFile> results = new ArrayList<>();
|
||||
|
||||
+212
@@ -0,0 +1,212 @@
|
||||
package stirling.software.proprietary.policy.s3;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty;
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import stirling.software.proprietary.access.model.DefaultAccessPolicy;
|
||||
import stirling.software.proprietary.access.model.OwnerScope;
|
||||
import stirling.software.proprietary.integration.model.IntegrationConfig;
|
||||
import stirling.software.proprietary.integration.model.IntegrationType;
|
||||
import stirling.software.proprietary.integration.repository.IntegrationConfigRepository;
|
||||
import stirling.software.proprietary.model.Team;
|
||||
import stirling.software.proprietary.policy.model.OutputSpec;
|
||||
import stirling.software.proprietary.policy.model.Policy;
|
||||
import stirling.software.proprietary.policy.source.Source;
|
||||
import stirling.software.proprietary.policy.source.SourceStore;
|
||||
import stirling.software.proprietary.policy.store.PolicyStore;
|
||||
import stirling.software.proprietary.security.repository.TeamRepository;
|
||||
|
||||
import tools.jackson.databind.ObjectMapper;
|
||||
|
||||
/**
|
||||
* One-time, idempotent extraction of legacy embedded S3 credentials into stored connections:
|
||||
* sources and policy outputs written before connections shipped carry bucket/credentials in their
|
||||
* own options; this rewrites each to reference a (deduplicated) S3 {@link IntegrationConfig} and
|
||||
* keeps only per-use options (prefix, mode). MUST be programmatic - the option JSON is encrypted at
|
||||
* the application layer, so no SQL migration can read it.
|
||||
*
|
||||
* <p>Idempotent by construction: rewritten rows no longer embed credentials, so re-runs find
|
||||
* nothing to do. Connections are deduplicated against both this run's extractions and existing S3
|
||||
* connections; a concurrent multi-node boot can at worst create a redundant connection row, never
|
||||
* corrupt a source. Ownership follows the owning row: team-scoped when the source/policy has a
|
||||
* team, server-scoped otherwise (single-operator self-hosted).
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@ConditionalOnBooleanProperty(name = "policies.enabled")
|
||||
public class EmbeddedS3CredentialMigration {
|
||||
|
||||
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
|
||||
private static final List<String> CONNECTION_OPTIONS =
|
||||
List.of("bucket", "region", "endpoint", "accessKeyId", "secretAccessKey");
|
||||
// Field separator for the dedup key: a unit-separator control char that cannot appear in a
|
||||
// bucket/region/endpoint/credential, so distinct field sets can never collide.
|
||||
private static final char DELIMITER = '\u001f';
|
||||
|
||||
private final SourceStore sourceStore;
|
||||
private final PolicyStore policyStore;
|
||||
private final IntegrationConfigRepository connections;
|
||||
private final TeamRepository teamRepository;
|
||||
|
||||
@EventListener(ApplicationReadyEvent.class)
|
||||
@Transactional
|
||||
public void migrate() {
|
||||
Map<String, IntegrationConfig> byCredentialKey = indexExistingConnections();
|
||||
int migrated = 0;
|
||||
for (Source source : sourceStore.all()) {
|
||||
if (!"s3".equals(source.type()) || !embedsCredentials(source.options())) {
|
||||
continue;
|
||||
}
|
||||
IntegrationConfig connection =
|
||||
connectionFor(source.options(), source.teamId(), byCredentialKey);
|
||||
sourceStore.save(withOptions(source, referencing(connection, source.options(), true)));
|
||||
migrated++;
|
||||
}
|
||||
for (Policy policy : policyStore.all()) {
|
||||
OutputSpec output = policy.output();
|
||||
if (!"s3".equals(output.type()) || !embedsCredentials(output.options())) {
|
||||
continue;
|
||||
}
|
||||
IntegrationConfig connection =
|
||||
connectionFor(output.options(), policy.teamId(), byCredentialKey);
|
||||
policyStore.save(
|
||||
withOutput(
|
||||
policy,
|
||||
new OutputSpec(
|
||||
output.type(),
|
||||
referencing(connection, output.options(), false))));
|
||||
migrated++;
|
||||
}
|
||||
if (migrated > 0) {
|
||||
log.info("Extracted embedded S3 credentials from {} row(s) into connections", migrated);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean embedsCredentials(Map<String, Object> options) {
|
||||
return options.get("accessKeyId") != null;
|
||||
}
|
||||
|
||||
/** Reuses an existing connection with identical coordinates+credentials, else creates one. */
|
||||
private IntegrationConfig connectionFor(
|
||||
Map<String, Object> options, Long teamId, Map<String, IntegrationConfig> byKey) {
|
||||
String key = credentialKey(options);
|
||||
IntegrationConfig existing = byKey.get(key);
|
||||
if (existing != null) {
|
||||
return existing;
|
||||
}
|
||||
IntegrationConfig connection = new IntegrationConfig();
|
||||
connection.setIntegrationType(IntegrationType.S3);
|
||||
connection.setName(connectionName(options, byKey));
|
||||
connection.setEnabled(true);
|
||||
connection.setLocked(false);
|
||||
connection.setDefaultAccess(DefaultAccessPolicy.EXPLICIT_ONLY);
|
||||
Team team = teamId == null ? null : teamRepository.findById(teamId).orElse(null);
|
||||
if (team != null) {
|
||||
connection.setScope(OwnerScope.TEAM);
|
||||
connection.setOwnerTeam(team);
|
||||
} else {
|
||||
// No team (teamless self-hosted, or a source whose team was since deleted): server
|
||||
// scope, i.e. admin-owned. An orphaned-team source's non-admin editor would then need
|
||||
// an admin to re-share the connection - acceptable for the narrow orphaned case.
|
||||
connection.setScope(OwnerScope.SERVER);
|
||||
}
|
||||
Map<String, Object> config = new LinkedHashMap<>();
|
||||
for (String option : CONNECTION_OPTIONS) {
|
||||
Object value = options.get(option);
|
||||
if (value != null && !value.toString().isBlank()) {
|
||||
config.put(option, value);
|
||||
}
|
||||
}
|
||||
connection.setConfig(OBJECT_MAPPER.writeValueAsString(config));
|
||||
IntegrationConfig saved = connections.save(connection);
|
||||
byKey.put(key, saved);
|
||||
return saved;
|
||||
}
|
||||
|
||||
/** The rewritten options: the connection reference plus per-use settings only. */
|
||||
private static Map<String, Object> referencing(
|
||||
IntegrationConfig connection, Map<String, Object> legacy, boolean keepMode) {
|
||||
Map<String, Object> options = new LinkedHashMap<>();
|
||||
options.put(S3ConnectionResolver.CONNECTION_ID_OPTION, connection.getId());
|
||||
Object prefix = legacy.get("prefix");
|
||||
if (prefix != null && !prefix.toString().isBlank()) {
|
||||
options.put("prefix", prefix);
|
||||
}
|
||||
Object mode = legacy.get("mode");
|
||||
if (keepMode && mode != null && !mode.toString().isBlank()) {
|
||||
options.put("mode", mode);
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
private Map<String, IntegrationConfig> indexExistingConnections() {
|
||||
Map<String, IntegrationConfig> byKey = new LinkedHashMap<>();
|
||||
for (IntegrationConfig connection : connections.findAll()) {
|
||||
if (connection.getIntegrationType() != IntegrationType.S3) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
Map<String, Object> config =
|
||||
OBJECT_MAPPER.readValue(connection.getConfig(), Map.class);
|
||||
byKey.putIfAbsent(credentialKey(config), connection);
|
||||
} catch (Exception e) {
|
||||
log.debug(
|
||||
"Skipping unreadable S3 connection {} while indexing: {}",
|
||||
connection.getId(),
|
||||
e.getMessage());
|
||||
}
|
||||
}
|
||||
return byKey;
|
||||
}
|
||||
|
||||
private static String credentialKey(Map<String, Object> options) {
|
||||
StringBuilder key = new StringBuilder();
|
||||
for (String option : CONNECTION_OPTIONS) {
|
||||
Object value = options.get(option);
|
||||
key.append(value == null ? "" : value.toString().trim()).append(DELIMITER);
|
||||
}
|
||||
return key.toString();
|
||||
}
|
||||
|
||||
private static String connectionName(
|
||||
Map<String, Object> options, Map<String, IntegrationConfig> byKey) {
|
||||
String base = "S3: " + options.getOrDefault("bucket", "bucket");
|
||||
long sameName = byKey.values().stream().filter(c -> c.getName().startsWith(base)).count();
|
||||
return sameName == 0 ? base : base + " (" + (sameName + 1) + ")";
|
||||
}
|
||||
|
||||
private static Source withOptions(Source source, Map<String, Object> options) {
|
||||
return new Source(
|
||||
source.id(),
|
||||
source.name(),
|
||||
source.type(),
|
||||
options,
|
||||
source.enabled(),
|
||||
source.owner(),
|
||||
source.teamId());
|
||||
}
|
||||
|
||||
private static Policy withOutput(Policy policy, OutputSpec output) {
|
||||
return new Policy(
|
||||
policy.id(),
|
||||
policy.name(),
|
||||
policy.owner(),
|
||||
policy.enabled(),
|
||||
policy.trigger(),
|
||||
policy.sourceIds(),
|
||||
policy.steps(),
|
||||
output,
|
||||
policy.teamId());
|
||||
}
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
package stirling.software.proprietary.policy.s3;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import stirling.software.proprietary.integration.service.IntegrationConfigUsageCheck;
|
||||
import stirling.software.proprietary.policy.model.Policy;
|
||||
import stirling.software.proprietary.policy.source.Source;
|
||||
import stirling.software.proprietary.policy.source.SourceStore;
|
||||
import stirling.software.proprietary.policy.store.PolicyStore;
|
||||
|
||||
/**
|
||||
* Reports the policy sources and pipeline outputs referencing an S3 connection, so the connection
|
||||
* cannot be deleted out from under them (mirrors {@code SourceController}'s referenced-source
|
||||
* delete guard). Scans in memory - fine at admin-dashboard scale, always consistent with the live
|
||||
* stores.
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@ConditionalOnBooleanProperty(name = "policies.enabled")
|
||||
public class PolicyS3ConnectionUsageCheck implements IntegrationConfigUsageCheck {
|
||||
|
||||
private final SourceStore sourceStore;
|
||||
private final PolicyStore policyStore;
|
||||
|
||||
@Override
|
||||
public List<String> usagesOf(long configId) {
|
||||
List<String> usages = new ArrayList<>();
|
||||
for (Source source : sourceStore.all()) {
|
||||
if (references(source.options(), configId)) {
|
||||
usages.add("source '" + source.name() + "'");
|
||||
}
|
||||
}
|
||||
for (Policy policy : policyStore.all()) {
|
||||
if (references(policy.output().options(), configId)) {
|
||||
usages.add("pipeline '" + policy.name() + "'");
|
||||
}
|
||||
}
|
||||
return usages;
|
||||
}
|
||||
|
||||
private static boolean references(Map<String, Object> options, long configId) {
|
||||
try {
|
||||
Long reference = S3ConnectionResolver.connectionId(options);
|
||||
return reference != null && reference == configId;
|
||||
} catch (IllegalArgumentException unparseable) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,10 +5,12 @@ import java.net.URISyntaxException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Connection settings shared by the S3 input source and output sink, parsed from a spec's options
|
||||
* map. Credentials are required: there is deliberately no fallback to the server's own AWS
|
||||
* credential chain, so user-supplied config can never borrow the host's identity. {@code snapshot}
|
||||
* is input-only and ignored by the sink.
|
||||
* The fully resolved connection settings the S3 input source and output sink run with - normally
|
||||
* produced by {@link S3ConnectionResolver} merging a stored connection (bucket, region, endpoint,
|
||||
* credentials) with per-use options (prefix, mode), or parsed directly from legacy options that
|
||||
* still embed credentials. Credentials are required: there is deliberately no fallback to the
|
||||
* server's own AWS credential chain, so user-supplied config can never borrow the host's identity.
|
||||
* {@code snapshot} is input-only and ignored by the sink.
|
||||
*/
|
||||
public record S3Config(
|
||||
String bucket,
|
||||
|
||||
+151
@@ -0,0 +1,151 @@
|
||||
package stirling.software.proprietary.policy.s3;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import stirling.software.proprietary.access.model.ResourceType;
|
||||
import stirling.software.proprietary.access.service.OwnershipService;
|
||||
import stirling.software.proprietary.integration.model.IntegrationConfig;
|
||||
import stirling.software.proprietary.integration.model.IntegrationType;
|
||||
import stirling.software.proprietary.integration.repository.IntegrationConfigRepository;
|
||||
import stirling.software.proprietary.security.model.User;
|
||||
import stirling.software.proprietary.security.service.UserService;
|
||||
|
||||
import tools.jackson.core.type.TypeReference;
|
||||
import tools.jackson.databind.ObjectMapper;
|
||||
|
||||
/**
|
||||
* Turns a source's or output's options into a full {@link S3Config} by dereferencing its {@code
|
||||
* connectionId} to a stored S3 {@link IntegrationConfig} (the connection owns bucket, region,
|
||||
* endpoint, and credentials; the options own per-use settings such as prefix and mode). Options
|
||||
* with no {@code connectionId} fall back to legacy embedded credentials, so rows written before
|
||||
* connections shipped keep working until {@link EmbeddedS3CredentialMigration} rewrites them.
|
||||
*
|
||||
* <p>When an authenticated caller is present (save-time validation), they must be allowed to use
|
||||
* the connection. Background sweeps and deliveries run with no caller and skip that check: the
|
||||
* referencing source or policy was access-checked when it was saved.
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(readOnly = true)
|
||||
@ConditionalOnBooleanProperty(name = "policies.enabled")
|
||||
public class S3ConnectionResolver {
|
||||
|
||||
static final String CONNECTION_ID_OPTION = "connectionId";
|
||||
private static final String PREFIX_OPTION = "prefix";
|
||||
private static final String MODE_OPTION = "mode";
|
||||
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
|
||||
|
||||
private final IntegrationConfigRepository connections;
|
||||
private final OwnershipService ownership;
|
||||
private final UserService userService;
|
||||
|
||||
public S3Config resolve(Map<String, Object> options) {
|
||||
Long connectionId = connectionId(options);
|
||||
if (connectionId == null) {
|
||||
// Legacy embedded credentials, pending migration.
|
||||
return S3Config.from(options);
|
||||
}
|
||||
IntegrationConfig connection =
|
||||
connections
|
||||
.findById(connectionId)
|
||||
.filter(cfg -> cfg.getIntegrationType() == IntegrationType.S3)
|
||||
.filter(this::usableByCurrentUser)
|
||||
// Existence and access collapse into one error: a caller must not be able
|
||||
// to tell "no such connection" from "someone else's connection" and
|
||||
// enumerate ids. The id/name are never echoed.
|
||||
.orElseThrow(
|
||||
() ->
|
||||
new IllegalArgumentException(
|
||||
"unknown or inaccessible s3 connection"));
|
||||
if (!connection.isEnabled()) {
|
||||
throw new IllegalArgumentException("s3 connection is disabled");
|
||||
}
|
||||
Map<String, Object> merged = new LinkedHashMap<>(connectionConfig(connection));
|
||||
copyPerUseOption(options, merged, PREFIX_OPTION);
|
||||
copyPerUseOption(options, merged, MODE_OPTION);
|
||||
return S3Config.from(merged);
|
||||
}
|
||||
|
||||
/** The {@code connectionId} option as a long, or null when the options are legacy-embedded. */
|
||||
static Long connectionId(Map<String, Object> options) {
|
||||
Object reference = options.get(CONNECTION_ID_OPTION);
|
||||
if (reference == null || (reference instanceof String s && s.isBlank())) {
|
||||
return null;
|
||||
}
|
||||
if (reference instanceof Number number) {
|
||||
return number.longValue();
|
||||
}
|
||||
try {
|
||||
return Long.valueOf(reference.toString().trim());
|
||||
} catch (NumberFormatException e) {
|
||||
throw new IllegalArgumentException(
|
||||
"s3 'connectionId' is not a valid connection reference: " + reference);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the current caller may use this connection. With no principal - a background sweep or
|
||||
* delivery on a worker thread that carries no {@code SecurityContext} - access is treated as
|
||||
* already established: stored policies are validated with the caller present at save time, and
|
||||
* ad-hoc runs are validated on the request thread before dispatch (see {@code
|
||||
* PolicyValidator#validateOutput}). A missing principal must therefore never be the ONLY thing
|
||||
* standing between a caller and a connection, or the check becomes a confused deputy.
|
||||
*/
|
||||
private boolean usableByCurrentUser(IntegrationConfig connection) {
|
||||
User user = currentUser();
|
||||
return user == null || ownership.canUse(ResourceType.INTEGRATION_CONFIG, connection, user);
|
||||
}
|
||||
|
||||
// Mirrors ResourceAccessSecurity's principal resolution; null when unauthenticated.
|
||||
private User currentUser() {
|
||||
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
|
||||
if (auth == null || !auth.isAuthenticated()) {
|
||||
return null;
|
||||
}
|
||||
Object principal = auth.getPrincipal();
|
||||
if (principal instanceof User user) {
|
||||
return user;
|
||||
}
|
||||
if (principal instanceof UserDetails userDetails) {
|
||||
return userService.findByUsername(userDetails.getUsername()).orElse(null);
|
||||
}
|
||||
if (principal instanceof String username && !"anonymousUser".equals(username)) {
|
||||
return userService.findByUsername(username).orElse(null);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static Map<String, Object> connectionConfig(IntegrationConfig connection) {
|
||||
String json = connection.getConfig();
|
||||
if (json == null || json.isBlank()) {
|
||||
return Map.of();
|
||||
}
|
||||
try {
|
||||
return OBJECT_MAPPER.readValue(
|
||||
json, new TypeReference<LinkedHashMap<String, Object>>() {});
|
||||
} catch (Exception e) {
|
||||
throw new IllegalArgumentException(
|
||||
"s3 connection '" + connection.getName() + "' has unreadable config", e);
|
||||
}
|
||||
}
|
||||
|
||||
private static void copyPerUseOption(
|
||||
Map<String, Object> options, Map<String, Object> merged, String key) {
|
||||
Object value = options.get(key);
|
||||
if (value != null && !value.toString().isBlank()) {
|
||||
merged.put(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
package stirling.software.proprietary.policy.s3;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import stirling.software.common.model.ApplicationProperties;
|
||||
import stirling.software.proprietary.cluster.s3.S3Clients;
|
||||
import stirling.software.proprietary.integration.model.IntegrationType;
|
||||
import stirling.software.proprietary.integration.service.IntegrationConfigValidator;
|
||||
|
||||
/**
|
||||
* The S3 connection schema, enforced when an S3 {@link IntegrationType} config is saved: bucket and
|
||||
* credentials required, endpoint an http(s) URL that must not reach private addresses without the
|
||||
* operator opt-in - the same rules {@link S3ConnectionPool} enforces before signing, moved to save
|
||||
* time so a bad connection fails in the form rather than in a sweep.
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@ConditionalOnBooleanProperty(name = "policies.enabled")
|
||||
public class S3IntegrationValidator implements IntegrationConfigValidator {
|
||||
|
||||
private final ApplicationProperties applicationProperties;
|
||||
|
||||
@Override
|
||||
public IntegrationType type() {
|
||||
return IntegrationType.S3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(Map<String, Object> config) {
|
||||
S3Config parsed = S3Config.from(config);
|
||||
if (parsed.endpoint() == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
S3Clients.validateEndpointHost(
|
||||
URI.create(parsed.endpoint()),
|
||||
applicationProperties.getPolicies().isAllowPrivateS3Endpoints(),
|
||||
"S3 connection endpoint",
|
||||
"set policies.allowPrivateS3Endpoints=true to opt in (e.g. for a local"
|
||||
+ " MinIO).");
|
||||
} catch (IllegalStateException e) {
|
||||
throw new IllegalArgumentException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,7 +103,6 @@ public class User implements UserDetails, Serializable {
|
||||
|
||||
@ElementCollection
|
||||
@MapKeyColumn(name = "setting_key")
|
||||
@Lob
|
||||
@Column(name = "setting_value", columnDefinition = "text")
|
||||
@CollectionTable(name = "user_settings", joinColumns = @JoinColumn(name = "user_id"))
|
||||
@JsonIgnore
|
||||
|
||||
+53
-2
@@ -13,9 +13,9 @@ import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -52,7 +52,58 @@ class IntegrationConfigServiceTest {
|
||||
@Mock
|
||||
private stirling.software.proprietary.access.repository.ResourceGrantRepository grantRepository;
|
||||
|
||||
@InjectMocks private IntegrationConfigService service;
|
||||
@Mock private IntegrationConfigValidator validator;
|
||||
@Mock private IntegrationConfigUsageCheck usageCheck;
|
||||
|
||||
private IntegrationConfigService service;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
service =
|
||||
new IntegrationConfigService(
|
||||
repository,
|
||||
ownership,
|
||||
secretMasker,
|
||||
grantRepository,
|
||||
List.of(validator),
|
||||
List.of(usageCheck));
|
||||
}
|
||||
|
||||
@Test
|
||||
void createRejectsAConfigItsTypeValidatorRefuses() {
|
||||
when(secretMasker.sanitize(any())).thenReturn(Map.of());
|
||||
when(validator.type()).thenReturn(IntegrationType.API);
|
||||
org.mockito.Mockito.doThrow(new IllegalArgumentException("api config needs a 'url'"))
|
||||
.when(validator)
|
||||
.validate(any());
|
||||
|
||||
assertThatThrownBy(
|
||||
() ->
|
||||
service.create(
|
||||
request(IntegrationType.API, OwnerScope.USER, null),
|
||||
user(7)))
|
||||
.isInstanceOf(ResponseStatusException.class)
|
||||
.satisfies(
|
||||
e ->
|
||||
assertThat(((ResponseStatusException) e).getStatusCode())
|
||||
.isEqualTo(HttpStatus.BAD_REQUEST));
|
||||
}
|
||||
|
||||
@Test
|
||||
void deleteRefusedWhileAnythingStillReferencesTheConfig() {
|
||||
IntegrationConfig cfg = config(9L);
|
||||
when(repository.findById(9L)).thenReturn(Optional.of(cfg));
|
||||
when(ownership.canManage(any(), eq(cfg), any())).thenReturn(true);
|
||||
when(usageCheck.usagesOf(9L)).thenReturn(List.of("source 'Claims intake'"));
|
||||
|
||||
assertThatThrownBy(() -> service.delete(9L, user(7)))
|
||||
.isInstanceOf(ResponseStatusException.class)
|
||||
.satisfies(
|
||||
e ->
|
||||
assertThat(((ResponseStatusException) e).getStatusCode())
|
||||
.isEqualTo(HttpStatus.CONFLICT));
|
||||
verify(repository, org.mockito.Mockito.never()).delete(any(IntegrationConfig.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void createDelegatesOwnershipAndSanitizesConfig() {
|
||||
|
||||
+24
@@ -4,6 +4,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.Mockito.doThrow;
|
||||
import static org.mockito.Mockito.never;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
@@ -194,6 +195,29 @@ class PolicyControllerTest {
|
||||
assertThat(((ResponseStatusException) e).getStatusCode())
|
||||
.isEqualTo(HttpStatus.BAD_REQUEST));
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("rejects an ad-hoc output the caller cannot use, on the request thread")
|
||||
void rejectsUnauthorizedAdHocOutput() {
|
||||
// The confused-deputy guard: an S3 output referencing a connection the caller may not
|
||||
// use is validated here (principal present) and refused before any worker dispatch.
|
||||
PipelineDefinition definition =
|
||||
new PipelineDefinition(
|
||||
"pipe",
|
||||
List.of(new PipelineStep("/api/v1/misc/compress-pdf", null)),
|
||||
new OutputSpec("s3", Map.of("connectionId", 999)));
|
||||
doThrow(new IllegalArgumentException("unknown or inaccessible s3 connection"))
|
||||
.when(policyValidator)
|
||||
.validateOutput(any());
|
||||
|
||||
assertThatThrownBy(() -> controller.run(definition, new PolicyRunFiles()))
|
||||
.isInstanceOf(ResponseStatusException.class)
|
||||
.satisfies(
|
||||
e ->
|
||||
assertThat(((ResponseStatusException) e).getStatusCode())
|
||||
.isEqualTo(HttpStatus.BAD_REQUEST));
|
||||
verify(policyRunner, never()).runAdHoc(any(), any(), any());
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
|
||||
+22
@@ -82,6 +82,28 @@ class PolicyValidatorTest {
|
||||
assertTrue(ex.getMessage().contains("schedule"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void validateOutputDelegatesToTheSink() {
|
||||
when(outputSink.supports(any())).thenReturn(true);
|
||||
OutputSpec output = new OutputSpec("s3", Map.of("connectionId", 1));
|
||||
|
||||
validator.validateOutput(output);
|
||||
|
||||
verify(outputSink).validate(output);
|
||||
}
|
||||
|
||||
@Test
|
||||
void validateOutputSurfacesAnInaccessibleConnection() {
|
||||
when(outputSink.supports(any())).thenReturn(true);
|
||||
doThrow(new IllegalArgumentException("unknown or inaccessible s3 connection"))
|
||||
.when(outputSink)
|
||||
.validate(any());
|
||||
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> validator.validateOutput(new OutputSpec("s3", Map.of("connectionId", 1))));
|
||||
}
|
||||
|
||||
@Test
|
||||
void rejectsAnUnknownTriggerType() {
|
||||
when(trigger.type()).thenReturn("schedule");
|
||||
|
||||
+7
-2
@@ -23,6 +23,7 @@ import stirling.software.common.model.ApplicationProperties;
|
||||
import stirling.software.proprietary.policy.ledger.InProcessProcessedLedger;
|
||||
import stirling.software.proprietary.policy.model.InputSpec;
|
||||
import stirling.software.proprietary.policy.s3.S3ConnectionPool;
|
||||
import stirling.software.proprietary.policy.s3.S3TestConnections;
|
||||
|
||||
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
|
||||
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
|
||||
@@ -82,7 +83,9 @@ class S3InputSourceMinioTest {
|
||||
// The MinIO endpoint resolves to loopback, so the operator opt-in must be on.
|
||||
ApplicationProperties properties = new ApplicationProperties();
|
||||
properties.getPolicies().setAllowPrivateS3Endpoints(true);
|
||||
source = new S3InputSource(new S3ConnectionPool(properties));
|
||||
source =
|
||||
new S3InputSource(
|
||||
new S3ConnectionPool(properties), S3TestConnections.legacyResolver());
|
||||
ledger = new InProcessProcessedLedger();
|
||||
ctx = new RecordingContext();
|
||||
}
|
||||
@@ -161,7 +164,9 @@ class S3InputSourceMinioTest {
|
||||
@Test
|
||||
void aPrivateEndpointIsRejectedWithoutTheOperatorOptIn() {
|
||||
S3InputSource guarded =
|
||||
new S3InputSource(new S3ConnectionPool(new ApplicationProperties()));
|
||||
new S3InputSource(
|
||||
new S3ConnectionPool(new ApplicationProperties()),
|
||||
S3TestConnections.legacyResolver());
|
||||
|
||||
assertThatThrownBy(() -> guarded.validate(spec(Map.of())))
|
||||
.isInstanceOf(IllegalArgumentException.class)
|
||||
|
||||
+3
-1
@@ -29,6 +29,7 @@ import stirling.software.common.model.ApplicationProperties;
|
||||
import stirling.software.proprietary.policy.ledger.InProcessProcessedLedger;
|
||||
import stirling.software.proprietary.policy.model.InputSpec;
|
||||
import stirling.software.proprietary.policy.s3.S3ConnectionPool;
|
||||
import stirling.software.proprietary.policy.s3.S3TestConnections;
|
||||
|
||||
import software.amazon.awssdk.core.ResponseInputStream;
|
||||
import software.amazon.awssdk.core.exception.SdkClientException;
|
||||
@@ -64,7 +65,8 @@ class S3InputSourceTest {
|
||||
void setUp() {
|
||||
source =
|
||||
new S3InputSource(
|
||||
new S3ConnectionPool(new ApplicationProperties(), config -> s3Client));
|
||||
new S3ConnectionPool(new ApplicationProperties(), config -> s3Client),
|
||||
S3TestConnections.legacyResolver());
|
||||
ledger = new InProcessProcessedLedger();
|
||||
ctx = new RecordingContext();
|
||||
}
|
||||
|
||||
+3
-2
@@ -28,6 +28,7 @@ import stirling.software.proprietary.policy.ledger.InProcessProcessedLedger;
|
||||
import stirling.software.proprietary.policy.model.InputSpec;
|
||||
import stirling.software.proprietary.policy.model.OutputSpec;
|
||||
import stirling.software.proprietary.policy.s3.S3ConnectionPool;
|
||||
import stirling.software.proprietary.policy.s3.S3TestConnections;
|
||||
|
||||
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
|
||||
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
|
||||
@@ -90,8 +91,8 @@ class S3OutputSinkMinioTest {
|
||||
properties.getPolicies().setAllowPrivateS3Endpoints(true);
|
||||
S3ConnectionPool pool = new S3ConnectionPool(properties);
|
||||
ledger = new InProcessProcessedLedger();
|
||||
sink = new S3OutputSink(pool, ledger);
|
||||
source = new S3InputSource(pool);
|
||||
sink = new S3OutputSink(pool, S3TestConnections.legacyResolver(), ledger);
|
||||
source = new S3InputSource(pool, S3TestConnections.legacyResolver());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+2
@@ -32,6 +32,7 @@ import stirling.software.proprietary.policy.ledger.InProcessProcessedLedger;
|
||||
import stirling.software.proprietary.policy.ledger.ProcessedFileStatus;
|
||||
import stirling.software.proprietary.policy.model.OutputSpec;
|
||||
import stirling.software.proprietary.policy.s3.S3ConnectionPool;
|
||||
import stirling.software.proprietary.policy.s3.S3TestConnections;
|
||||
|
||||
import software.amazon.awssdk.awscore.exception.AwsServiceException;
|
||||
import software.amazon.awssdk.core.exception.SdkClientException;
|
||||
@@ -66,6 +67,7 @@ class S3OutputSinkTest {
|
||||
sink =
|
||||
new S3OutputSink(
|
||||
new S3ConnectionPool(new ApplicationProperties(), config -> s3Client),
|
||||
S3TestConnections.legacyResolver(),
|
||||
ledger);
|
||||
}
|
||||
|
||||
|
||||
+212
@@ -0,0 +1,212 @@
|
||||
package stirling.software.proprietary.policy.s3;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.lenient;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
|
||||
import stirling.software.proprietary.access.model.OwnerScope;
|
||||
import stirling.software.proprietary.integration.model.IntegrationConfig;
|
||||
import stirling.software.proprietary.integration.repository.IntegrationConfigRepository;
|
||||
import stirling.software.proprietary.model.Team;
|
||||
import stirling.software.proprietary.policy.model.OutputSpec;
|
||||
import stirling.software.proprietary.policy.model.PipelineStep;
|
||||
import stirling.software.proprietary.policy.model.Policy;
|
||||
import stirling.software.proprietary.policy.source.InProcessSourceStore;
|
||||
import stirling.software.proprietary.policy.source.Source;
|
||||
import stirling.software.proprietary.policy.store.InProcessPolicyStore;
|
||||
import stirling.software.proprietary.security.repository.TeamRepository;
|
||||
|
||||
/**
|
||||
* Tests for {@link EmbeddedS3CredentialMigration}: legacy embedded credentials become deduplicated
|
||||
* team-scoped connections, rewritten rows keep only per-use options, and re-runs are no-ops.
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class EmbeddedS3CredentialMigrationTest {
|
||||
|
||||
@Mock private IntegrationConfigRepository connections;
|
||||
@Mock private TeamRepository teamRepository;
|
||||
|
||||
private final InProcessSourceStore sourceStore = new InProcessSourceStore();
|
||||
private final InProcessPolicyStore policyStore = new InProcessPolicyStore();
|
||||
private EmbeddedS3CredentialMigration migration;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
migration =
|
||||
new EmbeddedS3CredentialMigration(
|
||||
sourceStore, policyStore, connections, teamRepository);
|
||||
AtomicLong ids = new AtomicLong(100);
|
||||
// Lenient: the nothing-to-migrate cases never create a connection.
|
||||
lenient().when(connections.findAll()).thenReturn(List.of());
|
||||
lenient()
|
||||
.when(connections.save(any()))
|
||||
.thenAnswer(
|
||||
invocation -> {
|
||||
IntegrationConfig saved = invocation.getArgument(0);
|
||||
if (saved.getId() == null) {
|
||||
saved.setId(ids.incrementAndGet());
|
||||
}
|
||||
return saved;
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
void extractsSharedCredentialsIntoOneTeamScopedConnection() {
|
||||
Team team = new Team();
|
||||
team.setId(7L);
|
||||
when(teamRepository.findById(7L)).thenReturn(Optional.of(team));
|
||||
Source source =
|
||||
sourceStore.save(
|
||||
new Source(
|
||||
null,
|
||||
"Claims intake",
|
||||
"s3",
|
||||
Map.of(
|
||||
"bucket", "inbox",
|
||||
"prefix", "incoming/",
|
||||
"mode", "snapshot",
|
||||
"accessKeyId", "AKIAEXAMPLE",
|
||||
"secretAccessKey", "shh"),
|
||||
true,
|
||||
"alice",
|
||||
7L));
|
||||
Policy policy =
|
||||
policyStore.save(
|
||||
new Policy(
|
||||
null,
|
||||
"Rotate",
|
||||
"alice",
|
||||
true,
|
||||
null,
|
||||
List.of(source.id()),
|
||||
List.of(new PipelineStep("/api/v1/misc/compress-pdf", Map.of())),
|
||||
new OutputSpec(
|
||||
"s3",
|
||||
Map.of(
|
||||
"bucket", "inbox",
|
||||
"prefix", "processed/",
|
||||
"accessKeyId", "AKIAEXAMPLE",
|
||||
"secretAccessKey", "shh")),
|
||||
7L));
|
||||
|
||||
migration.migrate();
|
||||
|
||||
// Same bucket + credentials on both rows: exactly one connection extracted.
|
||||
verify(connections, times(1)).save(any());
|
||||
Map<String, Object> sourceOptions = sourceStore.get(source.id()).orElseThrow().options();
|
||||
assertEquals(101L, sourceOptions.get("connectionId"));
|
||||
assertEquals("incoming/", sourceOptions.get("prefix"));
|
||||
assertEquals("snapshot", sourceOptions.get("mode"));
|
||||
assertNull(sourceOptions.get("accessKeyId"));
|
||||
assertNull(sourceOptions.get("secretAccessKey"));
|
||||
assertNull(sourceOptions.get("bucket"));
|
||||
|
||||
Map<String, Object> outputOptions =
|
||||
policyStore.get(policy.id()).orElseThrow().output().options();
|
||||
assertEquals(101L, outputOptions.get("connectionId"));
|
||||
assertEquals("processed/", outputOptions.get("prefix"));
|
||||
assertNull(outputOptions.get("secretAccessKey"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void connectionOwnershipFollowsTheSourceTeam() {
|
||||
Team team = new Team();
|
||||
team.setId(7L);
|
||||
when(teamRepository.findById(7L)).thenReturn(Optional.of(team));
|
||||
sourceStore.save(s3Source("teamed", 7L));
|
||||
|
||||
migration.migrate();
|
||||
|
||||
verify(connections)
|
||||
.save(
|
||||
org.mockito.ArgumentMatchers.argThat(
|
||||
connection ->
|
||||
connection.getScope() == OwnerScope.TEAM
|
||||
&& connection.getOwnerTeam() == team));
|
||||
}
|
||||
|
||||
@Test
|
||||
void teamlessRowsBecomeServerScopedConnections() {
|
||||
sourceStore.save(s3Source("solo", null));
|
||||
|
||||
migration.migrate();
|
||||
|
||||
verify(connections)
|
||||
.save(
|
||||
org.mockito.ArgumentMatchers.argThat(
|
||||
connection -> connection.getScope() == OwnerScope.SERVER));
|
||||
}
|
||||
|
||||
@Test
|
||||
void aSecondRunFindsNothingToDo() {
|
||||
sourceStore.save(s3Source("once", null));
|
||||
|
||||
migration.migrate();
|
||||
migration.migrate();
|
||||
|
||||
// One connection from the first run; the rewritten source no longer embeds credentials.
|
||||
verify(connections, times(1)).save(any());
|
||||
}
|
||||
|
||||
@Test
|
||||
void nonS3AndAlreadyMigratedRowsAreUntouched() {
|
||||
Source folder =
|
||||
sourceStore.save(
|
||||
new Source(
|
||||
null,
|
||||
"Folder",
|
||||
"folder",
|
||||
Map.of("directory", "/in"),
|
||||
true,
|
||||
"alice",
|
||||
null));
|
||||
Source migrated =
|
||||
sourceStore.save(
|
||||
new Source(
|
||||
null,
|
||||
"Done already",
|
||||
"s3",
|
||||
Map.of("connectionId", 55L, "prefix", "in/"),
|
||||
true,
|
||||
"alice",
|
||||
null));
|
||||
|
||||
migration.migrate();
|
||||
|
||||
verify(connections, times(0)).save(any());
|
||||
assertEquals(
|
||||
Map.of("directory", "/in"), sourceStore.get(folder.id()).orElseThrow().options());
|
||||
assertEquals(
|
||||
Map.of("connectionId", 55L, "prefix", "in/"),
|
||||
sourceStore.get(migrated.id()).orElseThrow().options());
|
||||
}
|
||||
|
||||
private static Source s3Source(String name, Long teamId) {
|
||||
return new Source(
|
||||
null,
|
||||
name,
|
||||
"s3",
|
||||
Map.of(
|
||||
"bucket", "inbox",
|
||||
"accessKeyId", "AKIAEXAMPLE",
|
||||
"secretAccessKey", "shh"),
|
||||
true,
|
||||
"alice",
|
||||
teamId);
|
||||
}
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
package stirling.software.proprietary.policy.s3;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import stirling.software.proprietary.policy.model.OutputSpec;
|
||||
import stirling.software.proprietary.policy.model.PipelineStep;
|
||||
import stirling.software.proprietary.policy.model.Policy;
|
||||
import stirling.software.proprietary.policy.source.InProcessSourceStore;
|
||||
import stirling.software.proprietary.policy.source.Source;
|
||||
import stirling.software.proprietary.policy.store.InProcessPolicyStore;
|
||||
|
||||
/** Tests for {@link PolicyS3ConnectionUsageCheck}'s reference scan across sources and outputs. */
|
||||
class PolicyS3ConnectionUsageCheckTest {
|
||||
|
||||
private final InProcessSourceStore sourceStore = new InProcessSourceStore();
|
||||
private final InProcessPolicyStore policyStore = new InProcessPolicyStore();
|
||||
private final PolicyS3ConnectionUsageCheck check =
|
||||
new PolicyS3ConnectionUsageCheck(sourceStore, policyStore);
|
||||
|
||||
@Test
|
||||
void reportsSourcesAndOutputsReferencingTheConnection() {
|
||||
sourceStore.save(
|
||||
new Source(
|
||||
null,
|
||||
"Claims intake",
|
||||
"s3",
|
||||
Map.of("connectionId", 5L, "prefix", "in/"),
|
||||
true,
|
||||
"alice",
|
||||
null));
|
||||
policyStore.save(
|
||||
new Policy(
|
||||
null,
|
||||
"Rotate",
|
||||
"alice",
|
||||
true,
|
||||
null,
|
||||
List.of(),
|
||||
List.of(new PipelineStep("/api/v1/misc/compress-pdf", Map.of())),
|
||||
new OutputSpec("s3", Map.of("connectionId", "5")),
|
||||
null));
|
||||
|
||||
assertThat(check.usagesOf(5))
|
||||
.containsExactlyInAnyOrder("source 'Claims intake'", "pipeline 'Rotate'");
|
||||
assertThat(check.usagesOf(6)).isEmpty();
|
||||
}
|
||||
}
|
||||
+149
@@ -0,0 +1,149 @@
|
||||
package stirling.software.proprietary.policy.s3;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
|
||||
import stirling.software.proprietary.access.service.OwnershipService;
|
||||
import stirling.software.proprietary.integration.model.IntegrationConfig;
|
||||
import stirling.software.proprietary.integration.model.IntegrationType;
|
||||
import stirling.software.proprietary.integration.repository.IntegrationConfigRepository;
|
||||
import stirling.software.proprietary.security.model.User;
|
||||
import stirling.software.proprietary.security.service.UserService;
|
||||
|
||||
/**
|
||||
* Tests for {@link S3ConnectionResolver}: connection dereferencing with per-use overrides, the
|
||||
* legacy embedded fallback, and the save-time access check that background sweeps skip.
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class S3ConnectionResolverTest {
|
||||
|
||||
@Mock private IntegrationConfigRepository connections;
|
||||
@Mock private OwnershipService ownership;
|
||||
@Mock private UserService userService;
|
||||
|
||||
@AfterEach
|
||||
void clearSecurityContext() {
|
||||
SecurityContextHolder.clearContext();
|
||||
}
|
||||
|
||||
@Test
|
||||
void resolvesAConnectionAndMergesPerUseOptions() {
|
||||
when(connections.findById(9L)).thenReturn(Optional.of(s3Connection(9L, true)));
|
||||
|
||||
S3Config config =
|
||||
resolver()
|
||||
.resolve(
|
||||
Map.of(
|
||||
"connectionId", 9L,
|
||||
"prefix", "incoming/",
|
||||
"mode", "snapshot"));
|
||||
|
||||
assertEquals("inbox", config.bucket());
|
||||
assertEquals("AKIAEXAMPLE", config.accessKeyId());
|
||||
assertEquals("incoming/", config.prefix());
|
||||
assertTrue(config.snapshot());
|
||||
}
|
||||
|
||||
@Test
|
||||
void acceptsAStringConnectionReference() {
|
||||
when(connections.findById(9L)).thenReturn(Optional.of(s3Connection(9L, true)));
|
||||
|
||||
assertEquals("inbox", resolver().resolve(Map.of("connectionId", "9")).bucket());
|
||||
}
|
||||
|
||||
@Test
|
||||
void fallsBackToLegacyEmbeddedCredentials() {
|
||||
S3Config config =
|
||||
resolver()
|
||||
.resolve(
|
||||
Map.of(
|
||||
"bucket", "legacy",
|
||||
"accessKeyId", "AKIAEXAMPLE",
|
||||
"secretAccessKey", "shh"));
|
||||
|
||||
assertEquals("legacy", config.bucket());
|
||||
}
|
||||
|
||||
@Test
|
||||
void rejectsUnknownDisabledOrWrongTypeConnections() {
|
||||
when(connections.findById(1L)).thenReturn(Optional.empty());
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> resolver().resolve(Map.of("connectionId", 1L)));
|
||||
|
||||
when(connections.findById(2L)).thenReturn(Optional.of(s3Connection(2L, false)));
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> resolver().resolve(Map.of("connectionId", 2L)));
|
||||
|
||||
IntegrationConfig mcp = s3Connection(3L, true);
|
||||
mcp.setIntegrationType(IntegrationType.MCP);
|
||||
when(connections.findById(3L)).thenReturn(Optional.of(mcp));
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> resolver().resolve(Map.of("connectionId", 3L)));
|
||||
}
|
||||
|
||||
@Test
|
||||
void anAuthenticatedSaverMustBeAllowedToUseTheConnection() {
|
||||
when(connections.findById(9L)).thenReturn(Optional.of(s3Connection(9L, true)));
|
||||
User saver = new User();
|
||||
saver.setUsername("alice");
|
||||
SecurityContextHolder.getContext()
|
||||
.setAuthentication(
|
||||
new UsernamePasswordAuthenticationToken(saver, null, java.util.List.of()));
|
||||
when(ownership.canUse(any(), any(IntegrationConfig.class), eq(saver))).thenReturn(false);
|
||||
|
||||
// Denied reads the same as unknown and never echoes the connection name, so ids can't be
|
||||
// enumerated by probing.
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> resolver().resolve(Map.of("connectionId", 9L)));
|
||||
try {
|
||||
resolver().resolve(Map.of("connectionId", 9L));
|
||||
} catch (IllegalArgumentException e) {
|
||||
org.junit.jupiter.api.Assertions.assertFalse(
|
||||
e.getMessage().contains("Claims bucket"),
|
||||
"access-denied error must not leak the connection name");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void backgroundSweepsWithNoUserSkipTheAccessCheck() {
|
||||
when(connections.findById(9L)).thenReturn(Optional.of(s3Connection(9L, true)));
|
||||
|
||||
// No authentication in the context: resolution succeeds without consulting ownership.
|
||||
assertEquals("inbox", resolver().resolve(Map.of("connectionId", 9L)).bucket());
|
||||
}
|
||||
|
||||
private S3ConnectionResolver resolver() {
|
||||
return new S3ConnectionResolver(connections, ownership, userService);
|
||||
}
|
||||
|
||||
private static IntegrationConfig s3Connection(long id, boolean enabled) {
|
||||
IntegrationConfig connection = new IntegrationConfig();
|
||||
connection.setId(id);
|
||||
connection.setIntegrationType(IntegrationType.S3);
|
||||
connection.setName("Claims bucket");
|
||||
connection.setEnabled(enabled);
|
||||
connection.setConfig(
|
||||
"{\"bucket\":\"inbox\",\"accessKeyId\":\"AKIAEXAMPLE\","
|
||||
+ "\"secretAccessKey\":\"shh\"}");
|
||||
return connection;
|
||||
}
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
package stirling.software.proprietary.policy.s3;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThatCode;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import stirling.software.common.model.ApplicationProperties;
|
||||
import stirling.software.proprietary.integration.model.IntegrationType;
|
||||
|
||||
/**
|
||||
* Tests for {@link S3IntegrationValidator}: the S3 connection schema fails at save time - missing
|
||||
* credentials, bad endpoints, and private endpoints without the operator opt-in.
|
||||
*/
|
||||
class S3IntegrationValidatorTest {
|
||||
|
||||
@Test
|
||||
void acceptsACompleteConnection() {
|
||||
assertThatCode(
|
||||
() ->
|
||||
validator(false)
|
||||
.validate(
|
||||
Map.of(
|
||||
"bucket", "inbox",
|
||||
"accessKeyId", "AKIAEXAMPLE",
|
||||
"secretAccessKey", "shh")))
|
||||
.doesNotThrowAnyException();
|
||||
}
|
||||
|
||||
@Test
|
||||
void rejectsMissingCredentialsOrBucket() {
|
||||
assertThatThrownBy(() -> validator(false).validate(Map.of("bucket", "inbox")))
|
||||
.isInstanceOf(IllegalArgumentException.class);
|
||||
assertThatThrownBy(
|
||||
() ->
|
||||
validator(false)
|
||||
.validate(
|
||||
Map.of(
|
||||
"accessKeyId", "AKIAEXAMPLE",
|
||||
"secretAccessKey", "shh")))
|
||||
.isInstanceOf(IllegalArgumentException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void rejectsAPrivateEndpointWithoutTheOperatorOptIn() {
|
||||
Map<String, Object> config =
|
||||
Map.of(
|
||||
"bucket", "inbox",
|
||||
"accessKeyId", "AKIAEXAMPLE",
|
||||
"secretAccessKey", "shh",
|
||||
"endpoint", "http://localhost:9000");
|
||||
|
||||
assertThatThrownBy(() -> validator(false).validate(config))
|
||||
.isInstanceOf(IllegalArgumentException.class)
|
||||
.hasMessageContaining("allowPrivateS3Endpoints");
|
||||
assertThatCode(() -> validator(true).validate(config)).doesNotThrowAnyException();
|
||||
}
|
||||
|
||||
@Test
|
||||
void itOnlyClaimsTheS3Type() {
|
||||
org.junit.jupiter.api.Assertions.assertEquals(IntegrationType.S3, validator(false).type());
|
||||
}
|
||||
|
||||
private static S3IntegrationValidator validator(boolean allowPrivateEndpoints) {
|
||||
ApplicationProperties properties = new ApplicationProperties();
|
||||
properties.getPolicies().setAllowPrivateS3Endpoints(allowPrivateEndpoints);
|
||||
return new S3IntegrationValidator(properties);
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package stirling.software.proprietary.policy.s3;
|
||||
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
import stirling.software.proprietary.access.service.OwnershipService;
|
||||
import stirling.software.proprietary.integration.repository.IntegrationConfigRepository;
|
||||
import stirling.software.proprietary.security.service.UserService;
|
||||
|
||||
/** Test fixtures for S3 connection plumbing shared across the policy S3 tests. */
|
||||
public final class S3TestConnections {
|
||||
|
||||
private S3TestConnections() {}
|
||||
|
||||
/**
|
||||
* A resolver for tests whose options embed credentials directly (the legacy pass-through path),
|
||||
* so its collaborators are never touched.
|
||||
*/
|
||||
public static S3ConnectionResolver legacyResolver() {
|
||||
return new S3ConnectionResolver(
|
||||
mock(IntegrationConfigRepository.class),
|
||||
mock(OwnershipService.class),
|
||||
mock(UserService.class));
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -91,7 +91,7 @@ springBoot {
|
||||
|
||||
allprojects {
|
||||
group = 'stirling.software'
|
||||
version = '2.14.1'
|
||||
version = '2.14.2'
|
||||
|
||||
configurations.configureEach {
|
||||
exclude group: "org.springframework.boot", module: "spring-boot-starter-tomcat"
|
||||
|
||||
@@ -38,6 +38,10 @@ const config: StorybookConfig = {
|
||||
// modules (e.g. the auth supabase client that moved into proprietary).
|
||||
"@proprietary": resolve(__dirname, "../editor/src/proprietary"),
|
||||
"@core": resolve(__dirname, "../editor/src/core"),
|
||||
// Public assets (e.g. the en-US translation TOML loaded ?raw by preview.tsx).
|
||||
// No src alias covers public/, so this lets the config use an alias rather
|
||||
// than a relative path.
|
||||
"@public": resolve(__dirname, "../editor/public"),
|
||||
};
|
||||
// Editor stories import via @app/* (proprietary→core fallback), @core/* and
|
||||
// @proprietary/*. Resolve them exactly the way the editor's own build does —
|
||||
|
||||
@@ -17,6 +17,8 @@ import { LinkProvider, type LinkState } from "@portal/contexts/LinkContext";
|
||||
import { ThemeProvider, useTheme } from "@portal/contexts/ThemeContext";
|
||||
import { UIProvider } from "@portal/contexts/UIContext";
|
||||
import { SuiProvider } from "@portal/theme/SuiProvider";
|
||||
import { deriveAccessiblePrimary } from "@core/utils/customPrimary";
|
||||
import { DEFAULT_ACCENT_COLOR } from "@core/constants/theme";
|
||||
import { handlers } from "@portal/mocks/handlers";
|
||||
import { configureSupabase } from "@proprietary/auth/supabase/supabaseClient";
|
||||
import i18next from "i18next";
|
||||
@@ -24,11 +26,11 @@ import { initReactI18next } from "react-i18next";
|
||||
import { parse as parseToml } from "smol-toml";
|
||||
// Load the real English copy so stories render human text, not raw keys. Bundled
|
||||
// synchronously via ?raw so it's present on the very first render (no async flash).
|
||||
// eslint-disable-next-line no-restricted-imports -- Storybook-only: read the public i18n asset; no @-alias covers editor/public/.
|
||||
import enTranslationToml from "../editor/public/locales/en-US/translation.toml?raw";
|
||||
import enTranslationToml from "@public/locales/en-US/translation.toml?raw";
|
||||
|
||||
import "@mantine/core/styles.css";
|
||||
import "@core/tokens/tokens.css";
|
||||
import "@core/theme/index.css";
|
||||
import "@core/tokens/base.css";
|
||||
|
||||
// Storybook-only: init react-i18next with the real English resources parsed from
|
||||
@@ -124,6 +126,33 @@ function ThemeBridge({
|
||||
return <>{children}</>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tints the canvas from the toolbar accent picker (see .storybook/manager.tsx),
|
||||
* exactly like the editor: always `data-app-theme="custom"`, with
|
||||
* --user-primary/-on/-accent-fg derived from the active mode's accent global.
|
||||
*/
|
||||
function AccentInjector({
|
||||
scheme,
|
||||
accent,
|
||||
}: {
|
||||
scheme: "light" | "dark";
|
||||
accent: string;
|
||||
}) {
|
||||
useEffect(() => {
|
||||
const root = document.documentElement;
|
||||
root.setAttribute("data-app-theme", "custom");
|
||||
root.setAttribute("data-mantine-color-scheme", scheme);
|
||||
const { primary, onPrimary, accentForeground } = deriveAccessiblePrimary(
|
||||
accent,
|
||||
scheme,
|
||||
);
|
||||
root.style.setProperty("--user-primary", primary);
|
||||
root.style.setProperty("--user-primary-on", onPrimary);
|
||||
root.style.setProperty("--user-accent-fg", accentForeground);
|
||||
}, [scheme, accent]);
|
||||
return null;
|
||||
}
|
||||
|
||||
const withProviders: Decorator = (Story, context) => {
|
||||
const tier = (context.globals.tier as Tier) ?? "pro";
|
||||
const linkState =
|
||||
@@ -135,9 +164,15 @@ const withProviders: Decorator = (Story, context) => {
|
||||
// anything that isn't "dark" as light — matching the addon's own
|
||||
// `selected || defaultTheme` fallback where defaultTheme is light.
|
||||
const colorScheme = context.globals.theme === "dark" ? "dark" : "light";
|
||||
// Each mode has its own accent (set by the toolbar accent picker).
|
||||
const accent =
|
||||
(colorScheme === "dark"
|
||||
? (context.globals.accentDark as string)
|
||||
: (context.globals.accentLight as string)) ?? DEFAULT_ACCENT_COLOR;
|
||||
return (
|
||||
<MemoryRouter initialEntries={["/"]}>
|
||||
<ThemeProvider>
|
||||
<AccentInjector scheme={colorScheme} accent={accent} />
|
||||
<ThemeBridge theme={colorScheme}>
|
||||
<SuiProvider colorScheme={colorScheme}>
|
||||
{/* LinkProvider must wrap TierProvider: TierContext derives its tier
|
||||
@@ -182,6 +217,10 @@ const preview: Preview = {
|
||||
},
|
||||
},
|
||||
globalTypes: {
|
||||
// Per-mode accent colours, driven by the custom toolbar picker in
|
||||
// .storybook/manager.tsx (no built-in toolbar UI of their own).
|
||||
accentLight: { name: "Accent (light)", defaultValue: DEFAULT_ACCENT_COLOR },
|
||||
accentDark: { name: "Accent (dark)", defaultValue: DEFAULT_ACCENT_COLOR },
|
||||
tier: {
|
||||
name: "Tier",
|
||||
description: "Subscription tier — drives useTier() everywhere",
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
],
|
||||
"@core/*": ["../editor/src/core/*"],
|
||||
"@proprietary/*": ["../editor/src/proprietary/*"],
|
||||
"@portal/*": ["../editor/src/portal/*"]
|
||||
"@portal/*": ["../editor/src/portal/*"],
|
||||
"@public/*": ["../editor/public/*"]
|
||||
},
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
|
||||
@@ -14,6 +14,51 @@
|
||||
<link rel="manifest" href="manifest.json" />
|
||||
|
||||
<title>Stirling PDF</title>
|
||||
|
||||
<!-- Apply theme + accent before first paint (no FOUC); mirrors ThemeProvider, which then refines it. -->
|
||||
<script>
|
||||
(function () {
|
||||
try {
|
||||
var p = JSON.parse(
|
||||
localStorage.getItem("stirlingpdf_preferences") || "{}",
|
||||
);
|
||||
var mode = p.theme || "system";
|
||||
var scheme =
|
||||
mode === "light"
|
||||
? "light"
|
||||
: mode === "dark"
|
||||
? "dark"
|
||||
: window.matchMedia &&
|
||||
window.matchMedia("(prefers-color-scheme: dark)").matches
|
||||
? "dark"
|
||||
: "light";
|
||||
var stored = scheme === "dark" ? p.darkPrimary : p.lightPrimary;
|
||||
// "default" (or unset) = neutral surfaces + blue buttons; a hex tints.
|
||||
var isDefault = !stored || stored === "default";
|
||||
var accent = isDefault ? "#3b82f6" : stored;
|
||||
var r = document.documentElement;
|
||||
r.setAttribute("data-theme", scheme);
|
||||
r.setAttribute("data-app-theme", "custom");
|
||||
r.setAttribute("data-accent", isDefault ? "default" : "custom");
|
||||
r.setAttribute("data-mantine-color-scheme", scheme);
|
||||
r.style.setProperty("--user-primary", accent);
|
||||
r.style.setProperty("--user-accent-fg", accent);
|
||||
var h = accent.replace("#", "");
|
||||
if (h.length === 3) h = h.replace(/./g, "$&$&");
|
||||
var lum =
|
||||
(0.2126 * parseInt(h.slice(0, 2), 16) +
|
||||
0.7152 * parseInt(h.slice(2, 4), 16) +
|
||||
0.0722 * parseInt(h.slice(4, 6), 16)) /
|
||||
255;
|
||||
r.style.setProperty(
|
||||
"--user-primary-on",
|
||||
lum > 0.7 ? "#000000" : "#ffffff",
|
||||
);
|
||||
} catch (e) {
|
||||
/* first visit / unavailable storage: ThemeProvider handles it */
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
|
||||
@@ -356,6 +356,7 @@ text = "Diese Berechtigungen kontrollieren, was Benutzer mit der PDF machen kön
|
||||
title = "Berechtigungen ändern"
|
||||
|
||||
[addStamp]
|
||||
preview = "Stempelvorschau"
|
||||
tags = "stamp,mark,seal,approved,rejected,confidential,stamp tool,rubber stamp,date stamp,approval stamp,received,void,copy,original"
|
||||
|
||||
[AddStampRequest]
|
||||
@@ -1842,6 +1843,15 @@ export = "Export"
|
||||
accessDenied = "Zugriff verweigert"
|
||||
insufficientPermissions = "Sie haben keine Berechtigung, diese Aktion auszuführen."
|
||||
|
||||
[auth.callback]
|
||||
completing = "Authentifizierung wird abgeschlossen"
|
||||
invalidToken = "OAuth-Anmeldung fehlgeschlagen – ungültiges Token."
|
||||
missingToken = "OAuth-Anmeldung fehlgeschlagen – kein Token empfangen."
|
||||
oauthFailed = "OAuth-Anmeldung fehlgeschlagen. Bitte versuchen Sie es erneut."
|
||||
pleaseWait = "Bitte warten Sie, während wir Ihre Anmeldung abschließen."
|
||||
signedOut = "Sie wurden abgemeldet. Bitte melden Sie sich erneut an."
|
||||
windowMayClose = "Sie können dieses Fenster schließen, sobald der Vorgang abgeschlossen ist."
|
||||
|
||||
[auth.displayName]
|
||||
guest = "Gast"
|
||||
user = "Benutzer"
|
||||
@@ -2824,6 +2834,7 @@ next = "Weiter"
|
||||
preview = "Vorschau"
|
||||
previous = "Zurück"
|
||||
refresh = "Aktualisieren"
|
||||
remaining = "Verbleibend"
|
||||
retry = "Wiederholen"
|
||||
save = "Save"
|
||||
|
||||
@@ -4072,10 +4083,17 @@ discord = "Discord"
|
||||
issues = "GitHub"
|
||||
|
||||
[formFill]
|
||||
allSaved = "Alles gespeichert"
|
||||
extractCsvError = "CSV konnte nicht extrahiert werden"
|
||||
extractXlsxError = "XLSX konnte nicht extrahiert werden"
|
||||
flattenAfterFilling = "Nach dem Ausfüllen ebnen"
|
||||
requiredAbbreviation = "erf."
|
||||
requiredFieldsError = "Bitte füllen Sie alle Pflichtfelder aus"
|
||||
rescanFields = "Felder erneut scannen"
|
||||
rescanFormFields = "Formularfelder erneut scannen"
|
||||
save = "Speichern"
|
||||
saveShortcut = "Strg+S zum Speichern"
|
||||
unsavedChanges = "Nicht gespeicherte Änderungen"
|
||||
|
||||
[formFill.sidebar]
|
||||
close = "Seitenleiste schließen"
|
||||
@@ -4996,7 +5014,21 @@ titleWithOs = "Herunterladen für {{osLabel}}"
|
||||
|
||||
[onboarding.mfa]
|
||||
authenticationCode = "Authentifizierungscode"
|
||||
description = "Schützen Sie Ihr Konto, indem Sie eine Authenticator-App verknüpfen. Scannen Sie den QR-Code oder geben Sie den Einrichtungsschlüssel ein und bestätigen Sie anschließend den sechsstelligen Code."
|
||||
enable = "MFA aktivieren"
|
||||
enableError = "Die Multi-Faktor-Authentifizierung konnte nicht aktiviert werden. Prüfen Sie den Code und versuchen Sie es erneut."
|
||||
enterCode = "Geben Sie den sechsstelligen Code aus Ihrer App ein."
|
||||
enterCodeError = "Geben Sie den Authentifizierungscode ein, um fortzufahren."
|
||||
logout = "Abmelden"
|
||||
openAuthenticator = "Öffnen Sie Google Authenticator, Authy oder 1Password."
|
||||
qrCodeLoading = "Ihr QR-Code wird erstellt…"
|
||||
regenerateQrCode = "QR-Code neu erstellen"
|
||||
scanQrCode = "Scannen Sie den QR-Code oder geben Sie den unten stehenden Einrichtungsschlüssel ein."
|
||||
setupError = "Die Einrichtung der Zwei-Faktor-Authentifizierung konnte nicht gestartet werden. Bitte versuchen Sie es erneut."
|
||||
setupKey = "Einrichtungsschlüssel (manuelle Eingabe)"
|
||||
stepByStep = "Schritt für Schritt"
|
||||
success = "MFA wurde aktiviert. Sie können jetzt fortfahren."
|
||||
title = "Einrichtung der Multi-Faktor-Authentifizierung"
|
||||
|
||||
[onboarding.planOverview]
|
||||
adminBodyLoginDisabled = "Sobald Sie den Login-Modus aktivieren, können Sie Nutzer verwalten, Einstellungen konfigurieren und die Servergesundheit überwachen. Die ersten <strong>{{freeTierLimit}}</strong> Personen auf Ihrem Server nutzen Stirling kostenlos."
|
||||
@@ -9110,6 +9142,11 @@ security = "Sicherheit"
|
||||
telegram = "Telegram"
|
||||
title = "Sicherheit & Authentifizierung"
|
||||
|
||||
[settings.signOut]
|
||||
confirm = "Möchten Sie sich wirklich abmelden?"
|
||||
submit = "Abmelden"
|
||||
title = "Abmelden"
|
||||
|
||||
[settings.team]
|
||||
title = "Team"
|
||||
|
||||
@@ -9726,6 +9763,9 @@ uploadButton = "Auf Server hochladen"
|
||||
title = "Stirling-PDF Survey"
|
||||
|
||||
[swagger]
|
||||
clickHere = "hier klicken"
|
||||
fallback = "Falls die Seite nicht automatisch geöffnet wurde,"
|
||||
opening = "Swagger UI wird in einem neuen Tab geöffnet..."
|
||||
tags = "API,Dokumentation,Swagger,Endpunkte,Entwicklung"
|
||||
title = "API-Dokumentation"
|
||||
|
||||
@@ -10281,9 +10321,11 @@ title = "Attachments"
|
||||
|
||||
[viewer.bookmarks]
|
||||
bookmarkTitle = "Lesezeichentitel"
|
||||
bookmarkTitleRequired = "Ein Lesezeichentitel ist erforderlich"
|
||||
closeSidebar = "Seitenleiste für Lesezeichen schließen"
|
||||
collapseAll = "Alle Lesezeichen einklappen"
|
||||
expandAll = "Alle Lesezeichen ausklappen"
|
||||
searchPlaceholder = "Lesezeichen durchsuchen"
|
||||
|
||||
[viewer.comments]
|
||||
addComment = "Kommentar hinzufügen"
|
||||
|
||||
@@ -356,6 +356,7 @@ text = "These permissions control what users can do with the PDF. Most effective
|
||||
title = "Change Permissions"
|
||||
|
||||
[addStamp]
|
||||
preview = "Preview Stamp"
|
||||
tags = "stamp,mark,seal,approved,rejected,confidential,stamp tool,rubber stamp,date stamp,approval stamp,received,void,copy,original"
|
||||
|
||||
[AddStampRequest]
|
||||
@@ -1842,6 +1843,15 @@ export = "Export"
|
||||
accessDenied = "Access Denied"
|
||||
insufficientPermissions = "You do not have permission to perform this action."
|
||||
|
||||
[auth.callback]
|
||||
completing = "Completing authentication"
|
||||
invalidToken = "OAuth login failed - invalid token."
|
||||
missingToken = "OAuth login failed - no token received."
|
||||
oauthFailed = "OAuth login failed. Please try again."
|
||||
pleaseWait = "Please wait while we finish signing you in."
|
||||
signedOut = "You have been signed out. Please sign in again."
|
||||
windowMayClose = "You can close this window once it completes."
|
||||
|
||||
[auth.displayName]
|
||||
guest = "Guest"
|
||||
user = "User"
|
||||
@@ -2824,6 +2834,7 @@ next = "Next"
|
||||
preview = "Preview"
|
||||
previous = "Previous"
|
||||
refresh = "Refresh"
|
||||
remaining = "Remaining"
|
||||
retry = "Retry"
|
||||
save = "Save"
|
||||
|
||||
@@ -4072,10 +4083,17 @@ discord = "Discord"
|
||||
issues = "GitHub"
|
||||
|
||||
[formFill]
|
||||
allSaved = "All saved"
|
||||
extractCsvError = "Failed to extract CSV"
|
||||
extractXlsxError = "Failed to extract XLSX"
|
||||
flattenAfterFilling = "Flatten after filling"
|
||||
requiredAbbreviation = "req"
|
||||
requiredFieldsError = "Please fill in all required fields"
|
||||
rescanFields = "Re-scan fields"
|
||||
rescanFormFields = "Re-scan form fields"
|
||||
save = "Save"
|
||||
saveShortcut = "Ctrl+S to save"
|
||||
unsavedChanges = "Unsaved changes"
|
||||
|
||||
[formFill.sidebar]
|
||||
close = "Close sidebar"
|
||||
@@ -5016,7 +5034,21 @@ titleWithOs = "Download for {{osLabel}}"
|
||||
|
||||
[onboarding.mfa]
|
||||
authenticationCode = "Authentication code"
|
||||
description = "Secure your account by linking an authenticator app. Scan the QR code or enter the setup key, then confirm the 6-digit code to finish."
|
||||
enable = "Enable MFA"
|
||||
enableError = "Unable to enable two-factor authentication. Check the code and try again."
|
||||
enterCode = "Enter the 6-digit code from your app."
|
||||
enterCodeError = "Enter the authentication code to continue."
|
||||
logout = "Logout"
|
||||
openAuthenticator = "Open Google Authenticator, Authy, or 1Password."
|
||||
qrCodeLoading = "Generating your QR code…"
|
||||
regenerateQrCode = "Regenerate QR code"
|
||||
scanQrCode = "Scan the QR code or enter the setup key below."
|
||||
setupError = "Unable to start two-factor setup. Please try again."
|
||||
setupKey = "Setup key (manual entry)"
|
||||
stepByStep = "Step-by-step"
|
||||
success = "MFA has been enabled. You can now continue."
|
||||
title = "Multi-Factor Authentication Setup"
|
||||
|
||||
[onboarding.planOverview]
|
||||
adminBodyLoginDisabled = "Once you enable login mode, you can manage users, configure settings, and monitor server health. The first <strong>{{freeTierLimit}}</strong> people on your server get to use Stirling free of charge."
|
||||
@@ -6208,6 +6240,10 @@ muted = "muted"
|
||||
nameLabel = "Name"
|
||||
namePlaceholder = "e.g. Compliance escalation"
|
||||
|
||||
[portal.agentBuilder.status]
|
||||
draft = "Draft"
|
||||
published = "Published"
|
||||
|
||||
[portal.agentBuilder.tabs]
|
||||
evals = "Evals"
|
||||
scenarios = "Scenarios"
|
||||
@@ -6431,7 +6467,7 @@ install = "Install"
|
||||
usage = "Usage"
|
||||
|
||||
[portal.catalogue.detail.locked]
|
||||
description = "{{name}} is included from the {{tier}} plan. Upgrade to embed it."
|
||||
description = "{{name}} is included from the {{plan}}. Upgrade to embed it."
|
||||
title = "Not available on your plan"
|
||||
|
||||
[portal.catalogue.detail.preview]
|
||||
@@ -6498,6 +6534,35 @@ title = "No components available"
|
||||
description = "GA components are available on Pay-as-you-go; a few Beta components are enterprise-only. Locked cards show an upgrade nudge."
|
||||
title = "Some components need a paid plan"
|
||||
|
||||
[portal.connections]
|
||||
createTitle = "New S3 connection"
|
||||
delete = "Delete"
|
||||
edit = "Edit"
|
||||
editTitle = "Edit S3 connection"
|
||||
subtitle = "Reusable S3 credentials that sources and pipeline outputs connect to."
|
||||
|
||||
[portal.connections.actions]
|
||||
new = "New connection"
|
||||
|
||||
[portal.connections.empty]
|
||||
description = "Add an S3 connection to reuse the same bucket and credentials across sources and pipeline outputs."
|
||||
title = "No connections yet"
|
||||
|
||||
[portal.connections.picker]
|
||||
cancel = "Cancel"
|
||||
createNew = "New connection..."
|
||||
placeholder = "Select a connection"
|
||||
save = "Save connection"
|
||||
|
||||
[portal.connections.s3.fields]
|
||||
name = "Connection name"
|
||||
namePlaceholder = "e.g. Claims bucket"
|
||||
|
||||
[portal.connections.table]
|
||||
bucket = "Bucket"
|
||||
name = "Name"
|
||||
region = "Region"
|
||||
|
||||
[portal.docs.authentication]
|
||||
codeCaption = "every request"
|
||||
eyebrow = "GETTING STARTED"
|
||||
@@ -7309,10 +7374,6 @@ operations_one = "Operation ({{count}})"
|
||||
operations_other = "Operations ({{count}})"
|
||||
output = "Output"
|
||||
removeStep = "Remove operation"
|
||||
s3Configure = "Configure"
|
||||
s3Done = "Done"
|
||||
s3ModalTitle = "Amazon S3 output"
|
||||
s3NotConfigured = "Not configured"
|
||||
s3PrefixHelp = "Outputs are uploaded under this key prefix."
|
||||
save = "Save changes"
|
||||
scheduleEvery = "Run every"
|
||||
@@ -7383,6 +7444,7 @@ manual = "Manual"
|
||||
schedule = "Scheduled"
|
||||
|
||||
[portal.policies]
|
||||
defaultName = "{{category}} Policy"
|
||||
subtitle = "Standing automations that enforce a tool pipeline on every document. Each policy fires on upload or export, runs its tool chain, and saves the enforced version alongside the original."
|
||||
title = "Policies"
|
||||
|
||||
@@ -7954,34 +8016,29 @@ primaryNav = "Primary navigation"
|
||||
switchApp = "Switch app"
|
||||
|
||||
[portal.sources]
|
||||
subtitle = "Reusable input connections that feed documents into Stirling. Configure a connection once, then reference it from any number of policies. Click a row for its config and which policies use it."
|
||||
subtitle = "Reusable input connections that feed documents into Stirling. Configure a source once, then reference it from any number of pipelines."
|
||||
title = "Sources"
|
||||
|
||||
[portal.sources.actions]
|
||||
agentBuilder = "Agent Builder"
|
||||
connectSource = "Connect source"
|
||||
|
||||
[portal.sources.builder]
|
||||
back = "Back to sources"
|
||||
cancel = "Cancel"
|
||||
create = "Create source"
|
||||
createTitle = "Connect a source"
|
||||
delete = "Delete"
|
||||
editTitle = "Edit source"
|
||||
enabled = "Enabled"
|
||||
save = "Save changes"
|
||||
|
||||
[portal.sources.delete]
|
||||
body = "Delete \"{{name}}\"? This can't be undone. Policies that reference it would need to be updated."
|
||||
cancel = "Cancel"
|
||||
confirm = "Delete"
|
||||
title = "Delete source?"
|
||||
|
||||
[portal.sources.detail]
|
||||
closeAriaLabel = "Close detail"
|
||||
delete = "Delete source"
|
||||
docs24h = "Last 24h"
|
||||
docs30d = "Last 30 days"
|
||||
docsTotal = "Total seen"
|
||||
docsTrend = "Documents over the last 30 days"
|
||||
documents = "Documents"
|
||||
edit = "Edit"
|
||||
notReferenced = "Not referenced by any policy, so it's safe to delete."
|
||||
pause = "Pause"
|
||||
resume = "Resume"
|
||||
subtitle = "{{type}} · {{status}}"
|
||||
usedBy = "Used by"
|
||||
|
||||
[portal.sources.empty]
|
||||
description = "Connect a folder (and, soon, cloud storage) so your policies have somewhere to pull documents from."
|
||||
title = "No sources connected yet"
|
||||
@@ -7997,10 +8054,15 @@ disabled = "Disabled"
|
||||
unused = "Unused"
|
||||
|
||||
[portal.sources.table]
|
||||
documents = "Documents"
|
||||
source = "Source"
|
||||
status = "Status"
|
||||
usedBy = "Policies"
|
||||
|
||||
[portal.sources.tabs]
|
||||
connections = "Connections"
|
||||
sources = "Sources"
|
||||
|
||||
[portal.sources.types.editor]
|
||||
description = "Documents your team has processed in the editor, across policy and AI runs."
|
||||
label = "Editor"
|
||||
@@ -8048,6 +8110,10 @@ label = "Access key ID"
|
||||
label = "Bucket"
|
||||
placeholder = "my-company-inbox"
|
||||
|
||||
[portal.sources.types.s3.fields.connection]
|
||||
helperText = "The stored connection holding the bucket and credentials. Reused by every source and pipeline output that references it."
|
||||
label = "Connection"
|
||||
|
||||
[portal.sources.types.s3.fields.endpoint]
|
||||
helperText = "Leave blank for Amazon S3. Set to use an S3-compatible service such as MinIO."
|
||||
label = "Custom endpoint"
|
||||
@@ -8077,21 +8143,14 @@ label = "Secret access key"
|
||||
label = "Source"
|
||||
|
||||
[portal.sources.wizard]
|
||||
back = "Back"
|
||||
cancel = "Cancel"
|
||||
continue = "Continue"
|
||||
editTitle = "Edit source"
|
||||
name = "Name"
|
||||
namePlaceholder = "e.g. Claims intake"
|
||||
save = "Save changes"
|
||||
subtitle = "Step {{current}} of {{total}} · {{label}}"
|
||||
title = "Connect a source"
|
||||
type = "Type"
|
||||
|
||||
[portal.sources.wizard.steps]
|
||||
chooseType = "Choose type"
|
||||
configure = "Configure"
|
||||
review = "Review & connect"
|
||||
[portal.tier]
|
||||
enterprise = "Enterprise plan"
|
||||
free = "Editor plan"
|
||||
pro = "Processor plan"
|
||||
|
||||
[portal.usage]
|
||||
managePayment = "Manage Payment"
|
||||
@@ -8948,9 +9007,18 @@ languageDescription = "Choose the display language"
|
||||
logout = "Log out"
|
||||
setAsDefault = "Set as Default"
|
||||
theme = "Theme"
|
||||
themeAccent = "Accent colour"
|
||||
themeAccentCustom = "Custom colour"
|
||||
themeAccentCustomHint = "Custom (defaults recommended)"
|
||||
themeAccentDark = "Dark mode accent colour"
|
||||
themeAccentDefault = "Default"
|
||||
themeAccentDefaultHint = "Default theme (recommended)"
|
||||
themeAccentDescription = "Buttons, links and highlights follow it, and it subtly tints the app. Light and dark each have their own. System uses whichever is active."
|
||||
themeAccentLight = "Light mode accent colour"
|
||||
themeDark = "Dark"
|
||||
themeDescription = "Choose light, dark, or follow your system"
|
||||
themeDescription = "Choose light, dark, or follow your system so it switches automatically."
|
||||
themeLight = "Light"
|
||||
themeReset = "Restore theme to default"
|
||||
themeSystem = "System"
|
||||
title = "General"
|
||||
user = "User"
|
||||
@@ -9178,6 +9246,11 @@ security = "Security"
|
||||
telegram = "Telegram"
|
||||
title = "Security & Authentication"
|
||||
|
||||
[settings.signOut]
|
||||
confirm = "Are you sure you want to sign out?"
|
||||
submit = "Sign out"
|
||||
title = "Sign out"
|
||||
|
||||
[settings.team]
|
||||
title = "Team"
|
||||
|
||||
@@ -9794,6 +9867,9 @@ uploadButton = "Upload to Server"
|
||||
title = "Stirling-PDF Survey"
|
||||
|
||||
[swagger]
|
||||
clickHere = "click here"
|
||||
fallback = "If it didn't open automatically,"
|
||||
opening = "Opening Swagger UI in a new tab..."
|
||||
tags = "api,documentation,swagger,endpoints,development"
|
||||
title = "API Documentation"
|
||||
|
||||
@@ -10099,6 +10175,19 @@ resetPw = "Reset password"
|
||||
suspend = "Suspend"
|
||||
unlock = "Unlock account"
|
||||
|
||||
[users.activity]
|
||||
daysAgo = "{{count}}d ago"
|
||||
hoursAgo = "{{count}}h ago"
|
||||
justNow = "Just now"
|
||||
minutesAgo = "{{count}}m ago"
|
||||
monthsAgo_one = "{{count}} month ago"
|
||||
monthsAgo_other = "{{count}} months ago"
|
||||
never = "Never"
|
||||
weeksAgo_one = "{{count}} week ago"
|
||||
weeksAgo_other = "{{count}} weeks ago"
|
||||
yearsAgo_one = "{{count}} year ago"
|
||||
yearsAgo_other = "{{count}} years ago"
|
||||
|
||||
[users.cap]
|
||||
addProcessor = "+ Processor"
|
||||
approver = "Approves policy"
|
||||
@@ -10169,7 +10258,9 @@ by = "Invited by {{who}}"
|
||||
cancel = "Cancel"
|
||||
count = "{{count}} pending"
|
||||
desc = "Invited people who haven't joined yet. They hold a seat until they accept."
|
||||
expires = "Expires"
|
||||
expiresInDays_one = "Expires in {{count}} day"
|
||||
expiresInDays_other = "Expires in {{count}} days"
|
||||
expiresToday = "Expires today"
|
||||
title = "Pending invitations"
|
||||
|
||||
[users.loadError]
|
||||
@@ -10362,9 +10453,11 @@ title = "Attachments"
|
||||
|
||||
[viewer.bookmarks]
|
||||
bookmarkTitle = "Bookmark title"
|
||||
bookmarkTitleRequired = "Bookmark title is required"
|
||||
closeSidebar = "Close bookmarks sidebar"
|
||||
collapseAll = "Collapse all bookmarks"
|
||||
expandAll = "Expand all bookmarks"
|
||||
searchPlaceholder = "Search bookmarks"
|
||||
|
||||
[viewer.comments]
|
||||
addComment = "Add comment"
|
||||
|
||||
@@ -0,0 +1,518 @@
|
||||
#!/usr/bin/env node
|
||||
// Theme colour lint. Modes:
|
||||
//
|
||||
// node theme-lint.mjs enforce: literal colours live ONLY in
|
||||
// primitives.css; colors/dimensions must
|
||||
// reference tokens; no duplicate primitives.
|
||||
// Scope: core/theme/. (blocking)
|
||||
// node theme-lint.mjs css-colors enforce: NO hardcoded colour in any source
|
||||
// .css (primitives.css + generated output.css
|
||||
// exempt). Scope: all editor/src. (blocking)
|
||||
// node theme-lint.mjs code-colors enforce: no hardcoded colour in TS/TSX DOM
|
||||
// code. Default-deny with layered exemptions
|
||||
// (structural; var()/readColor/canvas/pdf-lib
|
||||
// contexts; `// theme-allow-color` opt-out;
|
||||
// exempt PATHS for rendering/vendor/config).
|
||||
// Scope: all editor/src. (blocking)
|
||||
// node theme-lint.mjs contrast enforce: text-on-surface / on-primary pairs
|
||||
// clear WCAG AA per theme (default accent).
|
||||
// (blocking)
|
||||
//
|
||||
// Structural black / white / transparent (shadows, scrims) are always allowed.
|
||||
|
||||
import { readFileSync, readdirSync } from "node:fs";
|
||||
import { execSync } from "node:child_process";
|
||||
import { relative, resolve, join } from "node:path";
|
||||
|
||||
const THEME = resolve(process.cwd(), "editor/src/core/theme");
|
||||
const PRIMITIVES = "editor/src/core/theme/primitives.css";
|
||||
|
||||
// Fixed list of theme CSS files to check, so every read takes a constant path
|
||||
// (no directory-listing feeding into a file read). readdir is used only to fail
|
||||
// if a new .css is added without being registered — coverage can't silently
|
||||
// lapse — but its output is never passed to readFileSync.
|
||||
const THEME_FILES = [
|
||||
"primitives.css",
|
||||
"colors.css",
|
||||
"dimensions.css",
|
||||
"index.css",
|
||||
];
|
||||
|
||||
// ── colour helpers ─────────────────────────────────────────────────────────
|
||||
const HEX_RE = /#[0-9a-fA-F]{3,8}\b/g;
|
||||
const FUNC_RE = /\b(?:rgba?|hsla?)\(\s*[^)]*\)/g;
|
||||
const NAMED_RE =
|
||||
/\b(?:white|black|red|green|blue|orange|yellow|purple|gray|grey|silver|transparent)\b/g;
|
||||
|
||||
function expandHex(hex) {
|
||||
let h = hex.slice(1).toLowerCase();
|
||||
if (h.length === 3) h = [...h].map((c) => c + c).join("");
|
||||
if (h.length === 4) h = [...h].map((c) => c + c).join("");
|
||||
return "#" + h;
|
||||
}
|
||||
function normalizeColor(raw) {
|
||||
const s = raw.trim().toLowerCase();
|
||||
if (s.startsWith("#")) return expandHex(s);
|
||||
const nums = s.match(/[\d.]+%?/g);
|
||||
if (!nums) return s;
|
||||
return `${s.startsWith("hsl") ? "hsl" : "rgb"}(${nums.join(",")})`;
|
||||
}
|
||||
function isStructuralColor(norm) {
|
||||
return (
|
||||
norm === "transparent" ||
|
||||
/^#000000(00)?$/.test(norm) ||
|
||||
/^#ffffff(ff)?$/.test(norm) ||
|
||||
/^rgb\(0,0,0[,)]/.test(norm) ||
|
||||
/^rgb\(255,255,255[,)]/.test(norm)
|
||||
);
|
||||
}
|
||||
function isStructuralName(name) {
|
||||
return /^(?:white|black|transparent)$/i.test(name.trim());
|
||||
}
|
||||
function stripComments(text) {
|
||||
return text.replace(/\/\*[\s\S]*?\*\//g, (m) => m.replace(/[^\n]/g, " "));
|
||||
}
|
||||
|
||||
// ── enforce: literals only in primitives.css, no duplicate primitives ────────
|
||||
function check() {
|
||||
const violations = [];
|
||||
const primitiveValues = new Map();
|
||||
const lineOf = (text, index) => text.slice(0, index).split("\n").length;
|
||||
|
||||
// Fail if a theme .css exists that isn't registered above (readdir is only
|
||||
// compared here — never used to build a path passed to readFileSync).
|
||||
const known = new Set(THEME_FILES);
|
||||
for (const name of readdirSync(THEME)) {
|
||||
if (name.endsWith(".css") && !known.has(name)) {
|
||||
violations.push({
|
||||
file: relative(process.cwd(), join(THEME, name)),
|
||||
line: 1,
|
||||
msg: `unregistered theme CSS — add "${name}" to THEME_FILES in theme-lint.mjs`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
for (const name of THEME_FILES) {
|
||||
const rel = relative(process.cwd(), join(THEME, name));
|
||||
const isPrimitives = rel === PRIMITIVES;
|
||||
const text = stripComments(readFileSync(join(THEME, name), "utf8"));
|
||||
|
||||
for (const re of [HEX_RE, FUNC_RE]) {
|
||||
re.lastIndex = 0;
|
||||
let m;
|
||||
while ((m = re.exec(text)) !== null) {
|
||||
const norm = normalizeColor(m[0]);
|
||||
if (isStructuralColor(norm)) continue;
|
||||
if (isPrimitives) {
|
||||
if (primitiveValues.has(norm)) {
|
||||
violations.push({
|
||||
file: rel,
|
||||
line: lineOf(text, m.index),
|
||||
msg: `duplicate primitive value ${norm} (also ${primitiveValues.get(norm)})`,
|
||||
});
|
||||
} else {
|
||||
primitiveValues.set(norm, m[0]);
|
||||
}
|
||||
} else {
|
||||
violations.push({
|
||||
file: rel,
|
||||
line: lineOf(text, m.index),
|
||||
msg: `raw colour ${m[0]} — define it in primitives.css and use var()`,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Named colours, only in value position.
|
||||
if (!isPrimitives) {
|
||||
text.split("\n").forEach((line, i) => {
|
||||
const colon = line.indexOf(":");
|
||||
if (colon < 0 || /[{}]/.test(line)) return;
|
||||
// Property must be a lone identifier — a custom prop (--x) OR a standard
|
||||
// property (color, border) — so `color: red` is checked, not just tokens,
|
||||
// while selectors (`.foo:hover`) with a colon are skipped.
|
||||
if (!/^\s*(?:--)?[a-z][a-z0-9-]*\s*$/i.test(line.slice(0, colon)))
|
||||
return;
|
||||
const value = line
|
||||
.slice(colon + 1)
|
||||
.replace(/--[a-z0-9-]+/gi, " ")
|
||||
.replace(/url\([^)]*\)/g, " ")
|
||||
.replace(/["'][^"']*["']/g, " ");
|
||||
for (const nm of value.match(NAMED_RE) || []) {
|
||||
if (isStructuralName(nm)) continue;
|
||||
violations.push({
|
||||
file: rel,
|
||||
line: i + 1,
|
||||
msg: `named colour "${nm}" — define it in primitives.css and use var()`,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
return violations;
|
||||
}
|
||||
|
||||
// ── contrast report (warn-only): resolve --c-* per theme, check legibility ───
|
||||
function reportContrast() {
|
||||
const primitivesCss = readFileSync(join(THEME, "primitives.css"), "utf8");
|
||||
const colorsCss = readFileSync(join(THEME, "colors.css"), "utf8");
|
||||
const primitives = {};
|
||||
for (const m of primitivesCss.matchAll(
|
||||
/(--p-[a-z0-9-]+)\s*:\s*(#[0-9a-fA-F]{3,8})\s*;/g,
|
||||
))
|
||||
primitives[m[1]] = m[2];
|
||||
const blocks = [];
|
||||
for (const m of colorsCss.matchAll(/([^{}]+)\{([^}]*)\}/g)) {
|
||||
const decls = {};
|
||||
for (const d of m[2].matchAll(/(--c-[a-z0-9-]+)\s*:\s*([^;]+);/g))
|
||||
decls[d[1]] = d[2].trim();
|
||||
if (Object.keys(decls).length)
|
||||
blocks.push({ selector: m[1].trim(), decls });
|
||||
}
|
||||
// The editor always renders data-app-theme="custom"; the accent (--user-*) is
|
||||
// injected at runtime, so seed the DEFAULT blue to resolve the custom tint
|
||||
// statically. Themes = the ones that actually render: editor custom light/dark
|
||||
// (data-app-theme="custom") and the portal's neutral dark (data-theme="dark").
|
||||
const SEED = {
|
||||
"--user-primary": "#3b82f6",
|
||||
"--user-primary-on": "#ffffff",
|
||||
"--user-accent-fg": "#3b82f6",
|
||||
};
|
||||
const pick = (re) => blocks.filter((b) => re.test(b.selector));
|
||||
const lightBase = pick(/:root/);
|
||||
const customBase = blocks.filter(
|
||||
(b) =>
|
||||
/app-theme="custom"/.test(b.selector) &&
|
||||
!/color-scheme="dark"/.test(b.selector),
|
||||
);
|
||||
const customDark = pick(
|
||||
/app-theme="custom"\]\[data-mantine-color-scheme="dark"/,
|
||||
);
|
||||
const midnight = pick(/data-theme="dark"/);
|
||||
const themes = {
|
||||
"editor light": [...lightBase, ...customBase],
|
||||
"editor dark": [...lightBase, ...customBase, ...customDark],
|
||||
"portal dark": [...lightBase, ...midnight],
|
||||
};
|
||||
const flatten = (list) =>
|
||||
Object.assign({ ...SEED }, ...list.map((b) => b.decls));
|
||||
const hexToRgb = (h) => {
|
||||
h = h.replace("#", "");
|
||||
if (h.length === 3)
|
||||
h = h
|
||||
.split("")
|
||||
.map((c) => c + c)
|
||||
.join("");
|
||||
return {
|
||||
r: parseInt(h.slice(0, 2), 16),
|
||||
g: parseInt(h.slice(2, 4), 16),
|
||||
b: parseInt(h.slice(4, 6), 16),
|
||||
a: 1,
|
||||
};
|
||||
};
|
||||
const over = (f, b) => ({
|
||||
r: f.r * f.a + b.r * (1 - f.a),
|
||||
g: f.g * f.a + b.g * (1 - f.a),
|
||||
b: f.b * f.a + b.b * (1 - f.a),
|
||||
a: 1,
|
||||
});
|
||||
const mix = (a, b, p) => ({
|
||||
r: (a.r * p + b.r * (100 - p)) / 100,
|
||||
g: (a.g * p + b.g * (100 - p)) / 100,
|
||||
b: (a.b * p + b.b * (100 - p)) / 100,
|
||||
a: 1,
|
||||
});
|
||||
// Resolve any token value: hex, rgb(a), var(--x[, fallback]) (--p-* → palette,
|
||||
// else the theme map/seed), or color-mix(in srgb, A n%, B|transparent).
|
||||
function resolveValue(v, t, seen) {
|
||||
if (v == null) return null;
|
||||
v = v.trim();
|
||||
let m;
|
||||
if (v.startsWith("#")) return hexToRgb(v);
|
||||
if ((m = v.match(/^rgba?\(([^)]+)\)$/))) {
|
||||
const n = m[1]
|
||||
.split(/[,/\s]+/)
|
||||
.map(Number)
|
||||
.filter((x) => !Number.isNaN(x));
|
||||
return { r: n[0], g: n[1], b: n[2], a: n[3] ?? 1 };
|
||||
}
|
||||
if ((m = v.match(/^var\(\s*(--[a-z0-9-]+)\s*(?:,\s*([\s\S]+))?\)$/))) {
|
||||
return resolveVar(m[1], m[2], t, seen);
|
||||
}
|
||||
if ((m = v.match(/^color-mix\(in srgb,\s*(.+?)\s+(\d+)%\s*,\s*(.+)\)$/))) {
|
||||
const a = resolveValue(m[1], t, seen);
|
||||
if (!a) return null;
|
||||
if (m[3].trim() === "transparent") return { ...a, a: +m[2] / 100 };
|
||||
const b = resolveValue(m[3].trim(), t, seen);
|
||||
return b ? mix(a, b, +m[2]) : null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function resolveVar(name, fallback, t, seen) {
|
||||
if (name.startsWith("--p-")) {
|
||||
return primitives[name]
|
||||
? hexToRgb(primitives[name])
|
||||
: fallback
|
||||
? resolveValue(fallback, t, seen)
|
||||
: null;
|
||||
}
|
||||
if (!seen.has(name) && t[name] !== undefined) {
|
||||
const next = new Set(seen).add(name);
|
||||
const r = resolveValue(t[name], t, next);
|
||||
if (r) return r;
|
||||
}
|
||||
return fallback ? resolveValue(fallback, t, seen) : null;
|
||||
}
|
||||
const resolve = (token, t) =>
|
||||
resolveValue(t[token] ?? null, t, new Set([token]));
|
||||
const lum = ({ r, g, b }) => {
|
||||
const f = (v) => {
|
||||
v /= 255;
|
||||
return v <= 0.03928 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4;
|
||||
};
|
||||
return 0.2126 * f(r) + 0.7152 * f(g) + 0.0722 * f(b);
|
||||
};
|
||||
const contrast = (t1, t2, t) => {
|
||||
const surface = resolve("--c-surface", t);
|
||||
let a = resolve(t1, t);
|
||||
let b = resolve(t2, t);
|
||||
if (!a || !b || !surface) return null;
|
||||
if (a.a < 1) a = over(a, surface);
|
||||
if (b.a < 1) b = over(b, surface);
|
||||
const [hi, lo] = [lum(a), lum(b)].sort((x, y) => y - x);
|
||||
return (hi + 0.05) / (lo + 0.05);
|
||||
};
|
||||
const PAIRS = [
|
||||
["--c-text", "--c-surface", 4.5],
|
||||
["--c-text-muted", "--c-surface", 4.5],
|
||||
["--c-text-subtle", "--c-surface", 4.5],
|
||||
["--c-text", "--c-bg", 4.5],
|
||||
["--c-text-on-primary", "--c-primary", 3.0],
|
||||
];
|
||||
let warnings = 0;
|
||||
console.log("contrast report (warning-only, default accent):\n");
|
||||
for (const name of Object.keys(themes)) {
|
||||
const t = flatten(themes[name]);
|
||||
console.log(` ${name}`);
|
||||
for (const [t1, t2, floor] of PAIRS) {
|
||||
const r = contrast(t1, t2, t);
|
||||
if (r == null) {
|
||||
console.log(` ? ${t1} on ${t2} (unresolved)`);
|
||||
continue;
|
||||
}
|
||||
if (r < floor) warnings++;
|
||||
console.log(
|
||||
` ${r < floor ? "⚠ " : " "}${r.toFixed(2).padStart(5)} (floor ${floor}) ${t1} on ${t2}`,
|
||||
);
|
||||
}
|
||||
console.log("");
|
||||
}
|
||||
console.log(
|
||||
warnings
|
||||
? `✖ ${warnings} pair(s) below floor.`
|
||||
: "✓ all pairs clear their floor.",
|
||||
);
|
||||
return warnings;
|
||||
}
|
||||
|
||||
// ── css-colors (blocking): no hardcoded colour in ANY source .css ────────────
|
||||
// App-wide guard that source CSS routes every colour through the palette. The
|
||||
// file list comes from `git ls-files` (a VCS query over tracked, in-repo paths)
|
||||
// — never a directory walk feeding a read — so there's no readdir→readFile path.
|
||||
// primitives.css (the literal home) and generated output.css are exempt.
|
||||
function checkAppCss() {
|
||||
const EXEMPT = /(?:^|\/)(?:primitives\.css|output\.css)$/;
|
||||
const listed = execSync("git ls-files -- editor/src", {
|
||||
encoding: "utf8",
|
||||
})
|
||||
.split("\n")
|
||||
.map((l) => l.trim())
|
||||
.filter((l) => l && l.endsWith(".css") && !EXEMPT.test(l));
|
||||
|
||||
const violations = [];
|
||||
const lineOf = (text, index) => text.slice(0, index).split("\n").length;
|
||||
for (const rel of listed) {
|
||||
const text = stripComments(readFileSync(rel, "utf8"));
|
||||
for (const re of [HEX_RE, FUNC_RE]) {
|
||||
re.lastIndex = 0;
|
||||
let m;
|
||||
while ((m = re.exec(text)) !== null) {
|
||||
if (/var\(/i.test(m[0])) continue; // rgb()/color-mix wrapping a token
|
||||
const norm = normalizeColor(m[0]);
|
||||
if (isStructuralColor(norm)) continue;
|
||||
violations.push({
|
||||
file: rel,
|
||||
line: lineOf(text, m.index),
|
||||
msg: `raw colour ${m[0]} — define it in primitives.css and use var(--p-…)`,
|
||||
});
|
||||
}
|
||||
}
|
||||
text.split("\n").forEach((line, i) => {
|
||||
const colon = line.indexOf(":");
|
||||
if (colon < 0 || /[{}]/.test(line)) return;
|
||||
if (!/^\s*(?:--)?[a-z][a-z0-9-]*\s*$/i.test(line.slice(0, colon))) return;
|
||||
const value = line
|
||||
.slice(colon + 1)
|
||||
.replace(/--[a-z0-9-]+/gi, " ")
|
||||
.replace(/url\([^)]*\)/g, " ")
|
||||
.replace(/["'][^"']*["']/g, " ");
|
||||
for (const nm of value.match(NAMED_RE) || []) {
|
||||
if (isStructuralName(nm)) continue;
|
||||
violations.push({
|
||||
file: rel,
|
||||
line: i + 1,
|
||||
msg: `named colour "${nm}" — define it in primitives.css and use var(--p-…)`,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
return violations;
|
||||
}
|
||||
|
||||
// ── code-colors (blocking): no NEW hardcoded colour in TS/TSX DOM code ───────
|
||||
// TS/TSX can't be zeroed like CSS — canvas/PDF/pdfium rendering, colour maths,
|
||||
// colour pickers, vendor brand and self-contained docs legitimately need
|
||||
// numeric colour. So this is default-deny with layered exemptions:
|
||||
// 1. structural black/white/transparent
|
||||
// 2. detected safe CONTEXTS on the line (var()/readColor fallback, canvas
|
||||
// assignment, pdf-lib 0..1 rgb) and an explicit `// theme-allow-color` opt-out
|
||||
// 3. exempt PATHS — whole areas where colour literals are inherent
|
||||
// Anything else (a raw colour in a normal DOM component) fails. File list from
|
||||
// `git ls-files` (no directory walk). Comments and HTML entities are stripped.
|
||||
const CODE_EXEMPT_PATH = [
|
||||
/Thumbnail|Overlay|DrawingCanvas|PageEditor|MobileScannerPage/, // canvas/PDF render
|
||||
/[Pp]df|PDF|pixelCompare|\/compare\.ts$|customPrimary|accentColors/,
|
||||
/validateSignature\/outputtedPDFSections|CenteredMessageSection|StatusBadgeSection/,
|
||||
/\/viewer\/|Annotation|useViewerReadAloud|CommentsSidebar|\/constants\/search\.ts$|SignaturePreview/,
|
||||
/ColorPicker|ColorControl|WatchedFolderManagementModal|watchedFolderPresets|fileColors|unifiedBackground|folder\.ts$|policyFolders/, // pickers/palettes as data
|
||||
/OAuthButtons|oauthCallbackHtml/, // vendor brand / self-contained doc
|
||||
/mantineTheme|\/theme\.ts$|toolsTaxonomy|LayoutPreview|PageNumberPreview|CloudStorageIcons/, // theme/config objects
|
||||
/\/onboarding\//, // decorative onboarding illustration gradients
|
||||
/addStamp|addWatermark|\/tooltips\//, // colour params fed to PDF + tooltip prose
|
||||
/UpgradeBanner|AdminPlanSection/, // bespoke marketing/upsell banner palette
|
||||
/\.test\.[jt]sx?$|\.stories\.[jt]sx?$|\/types\//, // tests, stories, type decls
|
||||
];
|
||||
const CODE_HEX =
|
||||
/#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{4}|[0-9a-fA-F]{3})(?![0-9a-fA-F])/g;
|
||||
const CODE_RGB = /rgba?\(([^)]*)\)/gi;
|
||||
const codeStructuralHex = (h) =>
|
||||
/^#(?:000|fff|000f|ffff|000000|ffffff|00000000|ffffffff)$/i.test(h);
|
||||
const CODE_SKIP_LINE =
|
||||
/theme-allow-color|var\(\s*--[a-z0-9-]+\s*,|readColor\(|getPropertyValue|\.colors\.[a-z]+\?\.\[|fillStyle|strokeStyle|shadowColor|addColorStop|createLinearGradient|ctx\.|getContext/i;
|
||||
function codeStripNonCode(text) {
|
||||
return text
|
||||
.replace(/\/\*[\s\S]*?\*\//g, (m) => m.replace(/[^\n]/g, " "))
|
||||
.replace(
|
||||
/(^|[^:])\/\/[^\n]*/g,
|
||||
(m, p) => p + m.slice(p.length).replace(/[^\n]/g, " "),
|
||||
)
|
||||
.replace(/&#\d+;/g, " ");
|
||||
}
|
||||
function codeRgbIsColour(inner) {
|
||||
if (/var\(/.test(inner)) return false;
|
||||
const p = inner
|
||||
.split(/[, /]+/)
|
||||
.map((x) => x.trim())
|
||||
.filter(Boolean);
|
||||
if (!/^\d/.test(p[0] || "")) return false;
|
||||
const nums = p.slice(0, 3).map(Number);
|
||||
if (nums.some((n) => Number.isNaN(n))) return false;
|
||||
if (nums.every((n) => n <= 1)) return false; // pdf-lib rgb(0..1)
|
||||
const k = `${nums[0]},${nums[1]},${nums[2]}`;
|
||||
return k !== "0,0,0" && k !== "255,255,255";
|
||||
}
|
||||
function checkCodeColors() {
|
||||
const files = execSync("git ls-files -- editor/src", { encoding: "utf8" })
|
||||
.split("\n")
|
||||
.map((l) => l.trim())
|
||||
.filter(
|
||||
(l) =>
|
||||
/\.(ts|tsx)$/.test(l) && !CODE_EXEMPT_PATH.some((re) => re.test(l)),
|
||||
);
|
||||
const violations = [];
|
||||
for (const rel of files) {
|
||||
const raw = readFileSync(rel, "utf8");
|
||||
const rawLines = raw.split("\n");
|
||||
const text = codeStripNonCode(raw);
|
||||
text.split("\n").forEach((line, i) => {
|
||||
// marker lives in a comment (stripped from `line`), so test the raw line
|
||||
if (/theme-allow-color/.test(rawLines[i] || "")) return;
|
||||
if (CODE_SKIP_LINE.test(line)) return;
|
||||
const hits = [];
|
||||
for (const h of line.match(CODE_HEX) || [])
|
||||
if (!codeStructuralHex(h)) hits.push(h);
|
||||
for (const m of line.match(CODE_RGB) || [])
|
||||
if (codeRgbIsColour(m.replace(/rgba?\(|\)/gi, ""))) hits.push(m);
|
||||
for (const h of hits)
|
||||
violations.push({
|
||||
file: rel,
|
||||
line: i + 1,
|
||||
msg: `hardcoded colour ${h} — use a var(--c-*/--p-*) token, or add \`// theme-allow-color <reason>\` if this must be a literal`,
|
||||
});
|
||||
});
|
||||
}
|
||||
return violations;
|
||||
}
|
||||
|
||||
// ── CLI ──────────────────────────────────────────────────────────────────────
|
||||
if (process.argv.includes("contrast")) {
|
||||
const below = reportContrast();
|
||||
if (below) {
|
||||
console.error(
|
||||
`\nRaise the failing token's lightness (or its surface's) until every pair clears WCAG AA (4.5 normal / 3.0 on-primary).\n`,
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (process.argv.includes("code-colors")) {
|
||||
const violations = checkCodeColors();
|
||||
if (violations.length) {
|
||||
console.error(
|
||||
`\n✖ theme-lint code-colors: ${violations.length} hardcoded colour(s) in TS/TSX:\n`,
|
||||
);
|
||||
for (const v of violations)
|
||||
console.error(` ${v.file}:${v.line} ${v.msg}`);
|
||||
console.error("");
|
||||
process.exit(1);
|
||||
}
|
||||
console.log(
|
||||
"✓ theme-lint code-colors: no hardcoded colour in TS/TSX DOM code (rendering/vendor/config areas exempt)",
|
||||
);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (process.argv.includes("css-colors")) {
|
||||
const violations = checkAppCss();
|
||||
if (violations.length) {
|
||||
console.error(
|
||||
`\n✖ theme-lint css-colors: ${violations.length} hardcoded colour(s) in source CSS:\n`,
|
||||
);
|
||||
for (const v of violations)
|
||||
console.error(` ${v.file}:${v.line} ${v.msg}`);
|
||||
console.error(
|
||||
`\nDefine every colour once in core/theme/primitives.css and reference it with var(--p-…).\n`,
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
console.log(
|
||||
"✓ theme-lint css-colors: source CSS is free of hardcoded colour",
|
||||
);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const violations = check();
|
||||
if (violations.length) {
|
||||
console.error(
|
||||
`\n✖ theme-lint: ${violations.length} raw/duplicate colour(s) in core/theme/:\n`,
|
||||
);
|
||||
for (const v of violations) console.error(` ${v.file}:${v.line} ${v.msg}`);
|
||||
console.error(
|
||||
`\nDefine every colour once in core/theme/primitives.css and reference it with var(--p-…).\n`,
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
console.log(
|
||||
"✓ theme-lint: core/theme colours all route through the primitive palette",
|
||||
);
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 19 KiB |
@@ -2,7 +2,7 @@
|
||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||
"productName": "Stirling PDF",
|
||||
"mainBinaryName": "Stirling-PDF",
|
||||
"version": "2.14.1",
|
||||
"version": "2.14.2",
|
||||
"identifier": "stirling.pdf.dev",
|
||||
"build": {
|
||||
"frontendDist": "../dist",
|
||||
|
||||
+5
-5
@@ -8,7 +8,7 @@
|
||||
}
|
||||
|
||||
.freeHighlight {
|
||||
background: linear-gradient(135deg, #6366f1, #ec4899);
|
||||
background: linear-gradient(135deg, var(--p-indigo-500), var(--p-pink-500));
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
color: transparent;
|
||||
@@ -36,7 +36,7 @@
|
||||
flex-direction: column;
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
border: 1px solid var(--border-default, #d1d5db);
|
||||
border: 1px solid var(--c-border);
|
||||
border-radius: 12px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
@@ -49,7 +49,7 @@
|
||||
}
|
||||
|
||||
.memberRow + .memberRow {
|
||||
border-top: 1px solid var(--border-subtle, #e5e7eb);
|
||||
border-top: 1px solid var(--c-border-subtle);
|
||||
}
|
||||
|
||||
.memberIdentity {
|
||||
@@ -62,7 +62,7 @@
|
||||
.memberName {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--onboarding-title, #111827);
|
||||
color: var(--c-text);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
@@ -70,7 +70,7 @@
|
||||
|
||||
.memberEmail {
|
||||
font-size: 12px;
|
||||
color: var(--onboarding-body, #6b7280);
|
||||
color: var(--c-text-muted);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
||||
@@ -87,7 +87,7 @@ export function FreeLimitReachedModal({ onClose }: FreeLimitReachedModalProps) {
|
||||
content: {
|
||||
overflow: "hidden",
|
||||
border: "none",
|
||||
background: "var(--bg-surface)",
|
||||
background: "var(--c-surface)",
|
||||
maxHeight: "90vh",
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
|
||||
@@ -87,7 +87,7 @@ export function SpendCapReachedModal({ onClose }: SpendCapReachedModalProps) {
|
||||
content: {
|
||||
overflow: "hidden",
|
||||
border: "none",
|
||||
background: "var(--bg-surface)",
|
||||
background: "var(--c-surface)",
|
||||
maxHeight: "90vh",
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
|
||||
@@ -2,25 +2,22 @@
|
||||
Uses the app's semantic theme tokens (theme.css) so it tracks light/dark. */
|
||||
|
||||
.payg {
|
||||
--payg-accent: #0a8bff;
|
||||
--payg-accent-soft: rgba(10, 139, 255, 0.1);
|
||||
--payg-accent: var(--p-azure-500);
|
||||
--payg-accent-soft: color-mix(in srgb, var(--p-azure-500) 10%, transparent);
|
||||
--payg-radius: 14px;
|
||||
--payg-gap: 20px;
|
||||
/* Cards sit ON the modal content bg; in light that's white-on-white so we
|
||||
lean on border + shadow. Tokens are overridden per scheme below. */
|
||||
--payg-card-bg: var(--bg-surface);
|
||||
--payg-card-border: var(--border-default);
|
||||
--payg-inset-bg: var(--bg-raised);
|
||||
--payg-divider: var(--border-subtle);
|
||||
--payg-card-bg: var(--c-surface);
|
||||
--payg-card-border: var(--c-border);
|
||||
--payg-inset-bg: var(--c-surface-raised);
|
||||
--payg-divider: var(--c-border-subtle);
|
||||
}
|
||||
|
||||
/* Dark mode: modal content bg is #131729 (--bg-surface), so lift cards above it */
|
||||
/* Dark mode: surfaces/borders track the neutral --c-* tokens (set on the base
|
||||
rule); only the brand-azure accent tint is tuned brighter for dark. */
|
||||
[data-mantine-color-scheme="dark"] .payg {
|
||||
--payg-card-bg: #1c2340;
|
||||
--payg-card-border: #2d3560;
|
||||
--payg-inset-bg: #0d1020;
|
||||
--payg-accent-soft: rgba(79, 142, 245, 0.16);
|
||||
--payg-divider: #2d3560;
|
||||
--payg-accent-soft: color-mix(in srgb, var(--p-azure-550) 16%, transparent);
|
||||
}
|
||||
|
||||
/* ── Header ─────────────────────────────────────────────────────────── */
|
||||
@@ -29,12 +26,12 @@
|
||||
font-size: 1.35rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.01em;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
}
|
||||
.payg-header__subtitle {
|
||||
margin-top: 4px;
|
||||
font-size: 0.875rem;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
}
|
||||
.payg-role-pill {
|
||||
display: inline-flex;
|
||||
@@ -49,12 +46,12 @@
|
||||
.payg-role-pill[data-leader="true"] {
|
||||
background: var(--payg-accent-soft);
|
||||
color: var(--payg-accent);
|
||||
border: 1px solid rgba(10, 139, 255, 0.25);
|
||||
border: 1px solid color-mix(in srgb, var(--p-azure-500) 25%, transparent);
|
||||
}
|
||||
.payg-role-pill[data-leader="false"] {
|
||||
background: var(--bg-muted);
|
||||
color: var(--text-muted);
|
||||
border: 1px solid var(--border-default);
|
||||
background: var(--c-surface-sunken);
|
||||
color: var(--c-text-subtle);
|
||||
border: 1px solid var(--c-border);
|
||||
}
|
||||
|
||||
/* ── Plan header: free-vs-metered split (shared by free + subscribed) ──── */
|
||||
@@ -73,7 +70,7 @@
|
||||
}
|
||||
.payg-planhead__eyebrow {
|
||||
font-size: 0.78rem;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
}
|
||||
.payg-planhead__split {
|
||||
display: grid;
|
||||
@@ -98,7 +95,7 @@
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.payg-planhead__lbl--free {
|
||||
color: #10b981;
|
||||
color: var(--p-emerald-500);
|
||||
}
|
||||
.payg-planhead__lbl--meter {
|
||||
color: var(--payg-accent);
|
||||
@@ -110,14 +107,14 @@
|
||||
margin: 0;
|
||||
font-size: 1.05rem;
|
||||
font-weight: 700;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
letter-spacing: -0.01em;
|
||||
line-height: 1.25;
|
||||
}
|
||||
.payg-planhead__body {
|
||||
margin: 5px 0 0;
|
||||
font-size: 0.85rem;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
line-height: 1.5;
|
||||
}
|
||||
@media (max-width: 640px) {
|
||||
@@ -147,11 +144,11 @@
|
||||
.payg-card__title {
|
||||
font-size: 0.95rem;
|
||||
font-weight: 650;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
}
|
||||
.payg-card__subtitle {
|
||||
font-size: 0.8125rem;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
@@ -175,22 +172,22 @@
|
||||
.payg-hero[data-state="FULL"]::before {
|
||||
background: linear-gradient(
|
||||
135deg,
|
||||
rgba(10, 139, 255, 0.12) 0%,
|
||||
rgba(10, 139, 255, 0) 55%
|
||||
color-mix(in srgb, var(--p-azure-500) 12%, transparent) 0%,
|
||||
color-mix(in srgb, var(--p-azure-500) 0%, transparent) 55%
|
||||
);
|
||||
}
|
||||
.payg-hero[data-state="WARNED"]::before {
|
||||
background: linear-gradient(
|
||||
135deg,
|
||||
rgba(234, 179, 8, 0.16) 0%,
|
||||
rgba(234, 179, 8, 0) 55%
|
||||
color-mix(in srgb, var(--p-amber-400) 16%, transparent) 0%,
|
||||
color-mix(in srgb, var(--p-amber-400) 0%, transparent) 55%
|
||||
);
|
||||
}
|
||||
.payg-hero[data-state="DEGRADED"]::before {
|
||||
background: linear-gradient(
|
||||
135deg,
|
||||
rgba(239, 68, 68, 0.16) 0%,
|
||||
rgba(239, 68, 68, 0) 55%
|
||||
color-mix(in srgb, var(--p-red-500) 16%, transparent) 0%,
|
||||
color-mix(in srgb, var(--p-red-500) 0%, transparent) 55%
|
||||
);
|
||||
}
|
||||
.payg-hero__inner {
|
||||
@@ -202,7 +199,7 @@
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
}
|
||||
.payg-hero__figure {
|
||||
display: flex;
|
||||
@@ -215,12 +212,12 @@
|
||||
font-weight: 750;
|
||||
line-height: 1;
|
||||
letter-spacing: -0.03em;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.payg-hero__cap {
|
||||
font-size: 1rem;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.payg-hero__meta {
|
||||
@@ -229,10 +226,10 @@
|
||||
flex-wrap: wrap;
|
||||
gap: 6px 18px;
|
||||
font-size: 0.8125rem;
|
||||
color: var(--text-secondary);
|
||||
color: var(--c-text-muted);
|
||||
}
|
||||
.payg-hero__meta-dot {
|
||||
color: var(--border-strong);
|
||||
color: var(--c-border-strong);
|
||||
}
|
||||
.payg-hero__credit {
|
||||
display: inline-flex;
|
||||
@@ -242,11 +239,11 @@
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
color: var(--color-green-700);
|
||||
background: rgba(34, 197, 94, 0.14);
|
||||
background: color-mix(in srgb, var(--p-green-500) 14%, transparent);
|
||||
}
|
||||
[data-mantine-color-scheme="dark"] .payg-hero__credit {
|
||||
color: #4ade80;
|
||||
background: rgba(34, 197, 94, 0.18);
|
||||
color: var(--p-green-400);
|
||||
background: color-mix(in srgb, var(--p-green-500) 18%, transparent);
|
||||
}
|
||||
|
||||
/* Make Mantine default-variant buttons read clearly on the lifted cards in
|
||||
@@ -257,16 +254,24 @@
|
||||
|
||||
/* Dark mode: the stock default button is a flat slab that disappears into the
|
||||
card. Lift it with a soft top-down gradient + brighter border, and warm the
|
||||
hover so the buttons feel tactile against --payg-card-bg (#1c2340). Driven
|
||||
through Mantine's --button-* vars. The same rule covers disabled buttons
|
||||
hover so the buttons feel tactile against the card surface. Driven through
|
||||
Mantine's --button-* vars. The same rule covers disabled buttons
|
||||
(Cancel/Update cap before the form is dirty) so they read identically to the
|
||||
always-enabled ones — Mantine only fades them via opacity. */
|
||||
[data-mantine-color-scheme="dark"]
|
||||
.payg
|
||||
.mantine-Button-root[data-variant="default"] {
|
||||
--button-bg: linear-gradient(180deg, #232a50 0%, #1c2340 100%);
|
||||
--button-hover: linear-gradient(180deg, #2d3560 0%, #232a50 100%);
|
||||
--button-bd: 1px solid #2d3560;
|
||||
--button-bg: linear-gradient(
|
||||
180deg,
|
||||
var(--c-surface-raised) 0%,
|
||||
var(--c-surface) 100%
|
||||
);
|
||||
--button-hover: linear-gradient(
|
||||
180deg,
|
||||
var(--c-border) 0%,
|
||||
var(--c-surface-raised) 100%
|
||||
);
|
||||
--button-bd: 1px solid var(--c-border);
|
||||
--button-color: var(--mantine-color-white);
|
||||
box-shadow:
|
||||
0 1px 0 rgba(255, 255, 255, 0.04) inset,
|
||||
@@ -307,7 +312,7 @@
|
||||
}
|
||||
.payg-status[data-state="FULL"] .payg-status__dot {
|
||||
background: var(--color-green-500);
|
||||
box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--p-green-500) 18%, transparent);
|
||||
}
|
||||
.payg-status[data-state="WARNED"] {
|
||||
background: var(--color-yellow-100);
|
||||
@@ -315,7 +320,7 @@
|
||||
}
|
||||
.payg-status[data-state="WARNED"] .payg-status__dot {
|
||||
background: var(--color-yellow-500);
|
||||
box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.2);
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--p-amber-400) 20%, transparent);
|
||||
}
|
||||
.payg-status[data-state="DEGRADED"] {
|
||||
background: var(--color-red-100);
|
||||
@@ -323,7 +328,7 @@
|
||||
}
|
||||
.payg-status[data-state="DEGRADED"] .payg-status__dot {
|
||||
background: var(--color-red-500);
|
||||
box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--p-red-500) 20%, transparent);
|
||||
}
|
||||
|
||||
/* Segmented usage bar */
|
||||
@@ -331,7 +336,7 @@
|
||||
margin-top: 18px;
|
||||
height: 10px;
|
||||
border-radius: 999px;
|
||||
background: var(--bg-muted);
|
||||
background: var(--c-surface-sunken);
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
@@ -341,13 +346,13 @@
|
||||
transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
|
||||
}
|
||||
.payg-bar__fill[data-state="FULL"] {
|
||||
background: linear-gradient(90deg, #0a8bff, #38bdf8);
|
||||
background: linear-gradient(90deg, var(--p-azure-500), var(--p-azure-400));
|
||||
}
|
||||
.payg-bar__fill[data-state="WARNED"] {
|
||||
background: linear-gradient(90deg, #f59e0b, #fbbf24);
|
||||
background: linear-gradient(90deg, var(--p-amber-500), var(--p-amber-400));
|
||||
}
|
||||
.payg-bar__fill[data-state="DEGRADED"] {
|
||||
background: linear-gradient(90deg, #dc2626, #f87171);
|
||||
background: linear-gradient(90deg, var(--p-red-600), var(--p-red-400));
|
||||
}
|
||||
|
||||
/* ── "What counts as a document?" expandable help ───────────────────── */
|
||||
@@ -365,10 +370,10 @@
|
||||
font: inherit;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-secondary);
|
||||
color: var(--c-text-muted);
|
||||
}
|
||||
.payg-help__toggle:hover {
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
}
|
||||
.payg-help__chevron {
|
||||
transition: transform 0.15s ease;
|
||||
@@ -381,10 +386,10 @@
|
||||
padding: 12px 14px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid var(--payg-card-border);
|
||||
background: var(--bg-muted);
|
||||
background: var(--c-surface-sunken);
|
||||
font-size: 0.8125rem;
|
||||
line-height: 1.45;
|
||||
color: var(--text-secondary);
|
||||
color: var(--c-text-muted);
|
||||
}
|
||||
.payg-help__panel ul {
|
||||
margin: 0;
|
||||
@@ -401,7 +406,7 @@
|
||||
padding: 13px 16px;
|
||||
border-radius: 10px;
|
||||
background: var(--payg-accent-soft);
|
||||
border: 1px solid rgba(10, 139, 255, 0.2);
|
||||
border: 1px solid color-mix(in srgb, var(--p-azure-500) 20%, transparent);
|
||||
}
|
||||
.payg-preview__icon {
|
||||
color: var(--payg-accent);
|
||||
@@ -409,12 +414,12 @@
|
||||
}
|
||||
.payg-preview__main {
|
||||
font-size: 0.875rem;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
font-weight: 550;
|
||||
}
|
||||
.payg-preview__note {
|
||||
font-size: 0.75rem;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
||||
@@ -453,17 +458,17 @@
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.payg-gate[data-enabled="true"] .payg-gate__chip {
|
||||
background: rgba(34, 197, 94, 0.16);
|
||||
color: #22c55e;
|
||||
background: color-mix(in srgb, var(--p-green-500) 16%, transparent);
|
||||
color: var(--p-green-500);
|
||||
}
|
||||
.payg-gate[data-enabled="false"] .payg-gate__chip {
|
||||
background: rgba(239, 68, 68, 0.16);
|
||||
color: #f87171;
|
||||
background: color-mix(in srgb, var(--p-red-500) 16%, transparent);
|
||||
color: var(--p-red-400);
|
||||
}
|
||||
.payg-gate__label {
|
||||
font-size: 0.8125rem;
|
||||
line-height: 1.35;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
flex: 1;
|
||||
}
|
||||
.payg-gate__tag {
|
||||
@@ -477,16 +482,16 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
.payg-gate__tag[data-variant="on"] {
|
||||
color: var(--text-muted);
|
||||
background: var(--bg-muted);
|
||||
color: var(--c-text-subtle);
|
||||
background: var(--c-surface-sunken);
|
||||
}
|
||||
.payg-gate__tag[data-variant="pause"] {
|
||||
color: #dc2626;
|
||||
background: rgba(239, 68, 68, 0.12);
|
||||
color: var(--c-danger);
|
||||
background: color-mix(in srgb, var(--p-red-500) 12%, transparent);
|
||||
}
|
||||
[data-mantine-color-scheme="dark"] .payg-gate__tag[data-variant="pause"] {
|
||||
color: #f87171;
|
||||
background: rgba(239, 68, 68, 0.18);
|
||||
color: var(--c-danger);
|
||||
background: color-mix(in srgb, var(--p-red-500) 18%, transparent);
|
||||
}
|
||||
|
||||
/* ── Member rows ────────────────────────────────────────────────────── */
|
||||
@@ -515,11 +520,11 @@
|
||||
.payg-member__name {
|
||||
font-size: 0.875rem;
|
||||
font-weight: 550;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
}
|
||||
.payg-member__email {
|
||||
font-size: 0.75rem;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
}
|
||||
.payg-member__usage {
|
||||
text-align: right;
|
||||
@@ -527,7 +532,7 @@
|
||||
}
|
||||
.payg-member__usage-num {
|
||||
font-size: 0.8125rem;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.payg-member__minibar {
|
||||
@@ -570,27 +575,27 @@
|
||||
}
|
||||
.payg-activity__label {
|
||||
font-size: 0.8438rem;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
flex: 1;
|
||||
}
|
||||
.payg-activity__ts {
|
||||
font-size: 0.75rem;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
}
|
||||
.payg-activity__kind {
|
||||
font-size: 0.625rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.05em;
|
||||
text-transform: uppercase;
|
||||
color: var(--text-muted);
|
||||
background: var(--bg-muted);
|
||||
color: var(--c-text-subtle);
|
||||
background: var(--c-surface-sunken);
|
||||
padding: 2px 8px;
|
||||
border-radius: 999px;
|
||||
}
|
||||
.payg-activity__units {
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 650;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
font-variant-numeric: tabular-nums;
|
||||
min-width: 58px;
|
||||
text-align: right;
|
||||
@@ -604,20 +609,20 @@
|
||||
gap: 16px;
|
||||
padding: 20px 24px;
|
||||
border-radius: var(--payg-radius);
|
||||
border: 1px solid rgba(99, 91, 255, 0.28);
|
||||
border: 1px solid color-mix(in srgb, var(--p-periwinkle-500) 28%, transparent);
|
||||
background: linear-gradient(
|
||||
135deg,
|
||||
rgba(99, 91, 255, 0.1) 0%,
|
||||
rgba(99, 91, 255, 0.02) 100%
|
||||
color-mix(in srgb, var(--p-periwinkle-500) 10%, transparent) 0%,
|
||||
color-mix(in srgb, var(--p-periwinkle-500) 2%, transparent) 100%
|
||||
);
|
||||
}
|
||||
.payg-stripe__title {
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 650;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
}
|
||||
.payg-stripe__subtitle {
|
||||
font-size: 0.8125rem;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
@@ -60,12 +60,12 @@ interface PaygProps {
|
||||
|
||||
// Stable-ish avatar colour from a string.
|
||||
const AVATAR_COLORS = [
|
||||
"#0a8bff",
|
||||
"#8b5cf6",
|
||||
"#ec4899",
|
||||
"#10b981",
|
||||
"#f59e0b",
|
||||
"#06b6d4",
|
||||
"var(--p-azure-500)",
|
||||
"var(--p-violet-500)",
|
||||
"var(--p-pink-500)",
|
||||
"var(--p-emerald-500)",
|
||||
"var(--p-amber-500)",
|
||||
"var(--p-cyan-500)",
|
||||
];
|
||||
function avatarColor(seed: string): string {
|
||||
let h = 0;
|
||||
|
||||
@@ -70,11 +70,11 @@
|
||||
gap: 8px;
|
||||
font-size: 0.8rem;
|
||||
line-height: 1.45;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
}
|
||||
.paygf-proc__membernote-icon {
|
||||
flex-shrink: 0;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
font-size: 1.1rem !important;
|
||||
margin-top: 1px;
|
||||
}
|
||||
@@ -113,12 +113,12 @@
|
||||
font-weight: 750;
|
||||
line-height: 1;
|
||||
letter-spacing: -0.02em;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.paygf-meter__cap {
|
||||
font-size: 0.85rem;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.paygf-meter .payg-bar {
|
||||
@@ -131,7 +131,7 @@
|
||||
align-items: center;
|
||||
gap: 6px 10px;
|
||||
font-size: 0.78rem;
|
||||
color: var(--text-secondary);
|
||||
color: var(--c-text-muted);
|
||||
}
|
||||
|
||||
/* ── Leader CTA card ──────────────────────────────────────────────────── */
|
||||
@@ -145,8 +145,10 @@
|
||||
border: 1.5px solid transparent;
|
||||
background:
|
||||
linear-gradient(var(--payg-card-bg), var(--payg-card-bg)) padding-box,
|
||||
linear-gradient(135deg, var(--payg-accent) 0%, #6c5ce7 100%) border-box;
|
||||
box-shadow: 0 10px 28px -18px rgba(10, 139, 255, 0.4);
|
||||
linear-gradient(135deg, var(--payg-accent) 0%, var(--p-purple-500) 100%)
|
||||
border-box;
|
||||
box-shadow: 0 10px 28px -18px
|
||||
color-mix(in srgb, var(--p-azure-500) 40%, transparent);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
@@ -161,7 +163,11 @@
|
||||
flex-shrink: 0;
|
||||
padding: 10px;
|
||||
border-radius: 12px;
|
||||
background: linear-gradient(135deg, var(--payg-accent) 0%, #6c5ce7 100%);
|
||||
background: linear-gradient(
|
||||
135deg,
|
||||
var(--payg-accent) 0%,
|
||||
var(--p-purple-500) 100%
|
||||
);
|
||||
color: white !important;
|
||||
font-size: 1.7rem !important;
|
||||
}
|
||||
@@ -172,14 +178,14 @@
|
||||
margin: 0;
|
||||
font-size: 1.2rem;
|
||||
font-weight: 700;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
letter-spacing: -0.01em;
|
||||
line-height: 1.25;
|
||||
}
|
||||
.paygf-cta__subtitle {
|
||||
margin: 4px 0 0;
|
||||
font-size: 0.9rem;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
@@ -196,7 +202,7 @@
|
||||
align-items: flex-start;
|
||||
gap: 8px;
|
||||
font-size: 0.85rem;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
line-height: 1.45;
|
||||
}
|
||||
.paygf-cta__check {
|
||||
@@ -220,7 +226,7 @@
|
||||
.paygf-cta__reassurance {
|
||||
margin: 0;
|
||||
font-size: 0.78rem;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
@@ -237,7 +243,7 @@
|
||||
}
|
||||
.paygf-member-note__icon {
|
||||
flex-shrink: 0;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
padding: 8px;
|
||||
background: var(--payg-card-bg);
|
||||
border-radius: 10px;
|
||||
@@ -247,14 +253,14 @@
|
||||
margin: 0;
|
||||
font-size: 1rem;
|
||||
font-weight: 700;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
letter-spacing: -0.005em;
|
||||
line-height: 1.3;
|
||||
}
|
||||
.paygf-member-note__body {
|
||||
margin: 6px 0 0;
|
||||
font-size: 0.875rem;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
@@ -285,14 +291,14 @@
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.06em;
|
||||
text-transform: uppercase;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.paygf-explainer__icon {
|
||||
font-size: 1rem !important;
|
||||
}
|
||||
.paygf-explainer__icon--free {
|
||||
color: #10b981;
|
||||
color: var(--p-emerald-500);
|
||||
}
|
||||
.paygf-explainer__icon--paid {
|
||||
color: var(--payg-accent);
|
||||
@@ -300,6 +306,6 @@
|
||||
.paygf-explainer__text {
|
||||
margin: 0;
|
||||
font-size: 0.85rem;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
line-height: 1.55;
|
||||
}
|
||||
|
||||
+20
-20
@@ -9,12 +9,12 @@
|
||||
Payg.css / UpgradeModal.css treatments the control sits beside. */
|
||||
|
||||
.scc {
|
||||
--scc-accent: #0a8bff;
|
||||
--scc-accent-text: #0a8bff;
|
||||
--scc-accent-soft: rgba(10, 139, 255, 0.12);
|
||||
--scc-accent-border: rgba(10, 139, 255, 0.25);
|
||||
--scc-chip-bg: var(--bg-muted);
|
||||
--scc-chip-border: var(--border-default);
|
||||
--scc-accent: var(--p-azure-500);
|
||||
--scc-accent-text: var(--p-azure-500);
|
||||
--scc-accent-soft: color-mix(in srgb, var(--p-azure-500) 12%, transparent);
|
||||
--scc-accent-border: color-mix(in srgb, var(--p-azure-500) 25%, transparent);
|
||||
--scc-chip-bg: var(--c-surface-sunken);
|
||||
--scc-chip-border: var(--c-border);
|
||||
/* Consistent vertical rhythm between the control row, the estimate, and any
|
||||
note — without it the blocks sit flush. */
|
||||
display: flex;
|
||||
@@ -22,10 +22,10 @@
|
||||
gap: 14px;
|
||||
}
|
||||
[data-mantine-color-scheme="dark"] .scc {
|
||||
--scc-accent-text: #7ab4ff;
|
||||
--scc-accent-soft: rgba(79, 142, 245, 0.16);
|
||||
--scc-chip-bg: #1c2340;
|
||||
--scc-chip-border: #2d3560;
|
||||
/* Chip surface/border track the neutral --c-* tokens (base rule); only the
|
||||
brand-azure accent is tuned brighter for dark. */
|
||||
--scc-accent-text: var(--p-azure-300);
|
||||
--scc-accent-soft: color-mix(in srgb, var(--p-azure-500) 16%, transparent);
|
||||
}
|
||||
|
||||
/* ── Inline row: presets · custom · no-cap · (save) ──────────────────── */
|
||||
@@ -47,7 +47,7 @@
|
||||
border-radius: 999px;
|
||||
border: 1px solid var(--scc-chip-border);
|
||||
background: var(--scc-chip-bg);
|
||||
color: var(--text-secondary);
|
||||
color: var(--c-text-muted);
|
||||
font: inherit;
|
||||
font-size: 0.85rem;
|
||||
font-weight: 600;
|
||||
@@ -59,8 +59,8 @@
|
||||
background 0.12s ease;
|
||||
}
|
||||
.scc-chip:hover:not(:disabled) {
|
||||
color: var(--text-primary);
|
||||
border-color: var(--border-strong);
|
||||
color: var(--c-text);
|
||||
border-color: var(--c-border-strong);
|
||||
}
|
||||
.scc-chip[data-selected="true"] {
|
||||
background: var(--scc-accent-soft);
|
||||
@@ -90,7 +90,7 @@
|
||||
background 0.12s ease;
|
||||
}
|
||||
.scc-custom:hover {
|
||||
border-color: var(--border-strong);
|
||||
border-color: var(--c-border-strong);
|
||||
}
|
||||
.scc-custom[data-active="true"] {
|
||||
border-style: solid;
|
||||
@@ -98,7 +98,7 @@
|
||||
background: var(--scc-accent-soft);
|
||||
}
|
||||
.scc-custom__symbol {
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
font-size: 0.85rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
@@ -111,14 +111,14 @@
|
||||
border: none;
|
||||
outline: none;
|
||||
background: transparent;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
font: inherit;
|
||||
font-size: 0.85rem;
|
||||
font-weight: 600;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.scc-custom__input::placeholder {
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
font-weight: 600;
|
||||
}
|
||||
.scc-custom:disabled,
|
||||
@@ -148,17 +148,17 @@
|
||||
.scc-estimate__main {
|
||||
font-size: 0.875rem;
|
||||
font-weight: 550;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
}
|
||||
.scc-estimate__sub {
|
||||
font-size: 0.75rem;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
||||
/* Quiet helper line (e.g. "Shown in USD — change later in your currency"). */
|
||||
.scc-note {
|
||||
font-size: 0.8125rem;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
@@ -430,8 +430,8 @@ const TeamSection: React.FC = () => {
|
||||
style={
|
||||
member.role !== "LEADER"
|
||||
? {
|
||||
backgroundColor: "var(--tool-header-badge-bg)",
|
||||
color: "var(--tool-header-badge-text)",
|
||||
backgroundColor: "var(--c-surface-raised)",
|
||||
color: "var(--c-accent-fg)",
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
|
||||
+17
-16
@@ -5,22 +5,21 @@
|
||||
user feels like they're filling out one form, not navigating pages. */
|
||||
|
||||
.upm {
|
||||
--upm-accent: #0a8bff;
|
||||
--upm-accent-2: #6c5ce7;
|
||||
--upm-accent-soft: rgba(10, 139, 255, 0.08);
|
||||
--upm-success: #10b981;
|
||||
--upm-accent: var(--p-azure-500);
|
||||
--upm-accent-2: var(--p-purple-500);
|
||||
--upm-accent-soft: color-mix(in srgb, var(--p-azure-500) 8%, transparent);
|
||||
--upm-success: var(--p-emerald-500);
|
||||
--upm-radius: 18px;
|
||||
--upm-card-bg: var(--bg-surface);
|
||||
--upm-border: var(--border-default);
|
||||
--upm-divider: var(--border-subtle);
|
||||
--upm-text: var(--text-primary);
|
||||
--upm-muted: var(--text-muted);
|
||||
--upm-card-bg: var(--c-surface);
|
||||
--upm-border: var(--c-border);
|
||||
--upm-divider: var(--c-border-subtle);
|
||||
--upm-text: var(--c-text);
|
||||
--upm-muted: var(--c-text-subtle);
|
||||
}
|
||||
[data-mantine-color-scheme="dark"] .upm {
|
||||
--upm-card-bg: #1c2340;
|
||||
--upm-border: #2d3560;
|
||||
--upm-divider: #2d3560;
|
||||
--upm-accent-soft: rgba(79, 142, 245, 0.14);
|
||||
/* Card/border/divider track the neutral --c-* tokens (base rule); only the
|
||||
brand-azure accent tint is tuned for dark. */
|
||||
--upm-accent-soft: color-mix(in srgb, var(--p-azure-550) 14%, transparent);
|
||||
}
|
||||
|
||||
/* Backdrop locks the page and centres the modal. z-index matches
|
||||
@@ -254,7 +253,7 @@
|
||||
border-radius: 6px;
|
||||
}
|
||||
.upm-step__edit:hover {
|
||||
background: rgba(10, 139, 255, 0.12);
|
||||
background: color-mix(in srgb, var(--p-azure-500) 12%, transparent);
|
||||
}
|
||||
|
||||
/* Placeholder card for the loading / error / mock states — a dashed, centered
|
||||
@@ -327,8 +326,10 @@
|
||||
}
|
||||
.upm-confirm__icon {
|
||||
font-size: 64px !important;
|
||||
color: #10b981;
|
||||
filter: drop-shadow(0 6px 18px rgba(16, 185, 129, 0.35));
|
||||
color: var(--upm-success);
|
||||
filter: drop-shadow(
|
||||
0 6px 18px color-mix(in srgb, var(--p-emerald-500) 35%, transparent)
|
||||
);
|
||||
}
|
||||
.upm-confirm__title {
|
||||
margin: 6px 0 0;
|
||||
|
||||
@@ -61,7 +61,9 @@ function Swatch({ label, src, onDark, h }: Asset & { h: number }) {
|
||||
>
|
||||
<img src={src} alt={label} style={{ height: h, maxWidth: 200 }} />
|
||||
</div>
|
||||
<figcaption style={{ fontSize: 12, color: "var(--text-muted, #71717a)" }}>
|
||||
<figcaption
|
||||
style={{ fontSize: 12, color: "var(--c-text-subtle, #71717a)" }}
|
||||
>
|
||||
{label}
|
||||
</figcaption>
|
||||
</figure>
|
||||
|
||||
@@ -221,7 +221,7 @@ const FileManager: React.FC<FileManagerProps> = ({ selectedTool }) => {
|
||||
width: "100%",
|
||||
border: "none",
|
||||
borderRadius: "var(--radius-md)",
|
||||
backgroundColor: "var(--bg-file-manager)",
|
||||
backgroundColor: "var(--c-bg)",
|
||||
}}
|
||||
styles={{
|
||||
inner: { pointerEvents: "all" },
|
||||
|
||||
@@ -227,7 +227,7 @@ export const TextInputWithFont: React.FC<TextInputWithFontProps> = ({
|
||||
width: 24,
|
||||
height: 24,
|
||||
backgroundColor: textColor,
|
||||
border: "1px solid #ccc",
|
||||
border: "1px solid var(--c-border)",
|
||||
borderRadius: 4,
|
||||
cursor: disabled ? "default" : "pointer",
|
||||
}}
|
||||
|
||||
@@ -110,7 +110,7 @@ const AddFileCard = ({
|
||||
variant="tertiary"
|
||||
style={{
|
||||
backgroundColor: "var(--landing-button-bg)",
|
||||
color: "var(--landing-button-color)",
|
||||
color: "var(--c-accent-fg)",
|
||||
border: "1px solid var(--landing-button-border)",
|
||||
borderRadius: "2rem",
|
||||
height: "38px",
|
||||
@@ -129,7 +129,7 @@ const AddFileCard = ({
|
||||
icon="add"
|
||||
width="1.5rem"
|
||||
height="1.5rem"
|
||||
className="text-[var(--accent-interactive)]"
|
||||
className="text-[var(--c-primary)]"
|
||||
/>
|
||||
<span>{t("landing.addFiles", "Add Files")}</span>
|
||||
</Button>
|
||||
@@ -140,7 +140,7 @@ const AddFileCard = ({
|
||||
title={terminology.uploadFromComputer}
|
||||
style={{
|
||||
backgroundColor: "var(--landing-button-bg)",
|
||||
color: "var(--landing-button-color)",
|
||||
color: "var(--c-accent-fg)",
|
||||
border: "1px solid var(--landing-button-border)",
|
||||
borderRadius: "1rem",
|
||||
height: "38px",
|
||||
@@ -161,7 +161,7 @@ const AddFileCard = ({
|
||||
icon={icons.uploadIconName}
|
||||
width="1.25rem"
|
||||
height="1.25rem"
|
||||
style={{ color: "var(--accent-interactive)", flexShrink: 0 }}
|
||||
style={{ color: "var(--c-primary)", flexShrink: 0 }}
|
||||
/>
|
||||
{isUploadHover && (
|
||||
<span
|
||||
@@ -181,7 +181,7 @@ const AddFileCard = ({
|
||||
|
||||
{/* Instruction Text */}
|
||||
<span
|
||||
className="text-[var(--accent-interactive)]"
|
||||
className="text-[var(--c-primary)]"
|
||||
style={{
|
||||
fontSize: ".8rem",
|
||||
textAlign: "center",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
========================= */
|
||||
|
||||
.card {
|
||||
background: var(--file-card-bg);
|
||||
background: var(--c-surface-raised);
|
||||
border-radius: 0.0625rem;
|
||||
cursor: pointer;
|
||||
transition:
|
||||
@@ -28,7 +28,7 @@
|
||||
/* While dragging */
|
||||
.card.dragging,
|
||||
.card:global(.dragging) {
|
||||
outline: 1px solid var(--border-strong);
|
||||
outline: 1px solid var(--c-border-strong);
|
||||
box-shadow: var(--shadow-md);
|
||||
transform: none !important;
|
||||
}
|
||||
@@ -42,15 +42,15 @@
|
||||
justify-content: space-between;
|
||||
padding: 0 6px;
|
||||
user-select: none;
|
||||
background: var(--bg-toolbar);
|
||||
color: var(--text-primary);
|
||||
border-bottom: 1px solid var(--border-default);
|
||||
background: var(--c-bg-raised);
|
||||
color: var(--c-text);
|
||||
border-bottom: 1px solid var(--c-border);
|
||||
}
|
||||
|
||||
.headerResting {
|
||||
background: #3b4b6e; /* dark blue for unselected in light mode */
|
||||
background: var(--p-navy-500); /* dark blue for unselected in light mode */
|
||||
color: #ffffff;
|
||||
border-bottom: 1px solid var(--border-default);
|
||||
border-bottom: 1px solid var(--c-border);
|
||||
}
|
||||
|
||||
.headerSelected {
|
||||
@@ -62,20 +62,20 @@
|
||||
/* Error highlight (transient) */
|
||||
.headerError {
|
||||
background: var(--color-red-200);
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
border-bottom: 2px solid var(--color-red-500);
|
||||
}
|
||||
|
||||
/* Unsupported (but not errored) header appearance */
|
||||
.headerUnsupported {
|
||||
background: var(--unsupported-bar-bg); /* neutral gray */
|
||||
background: var(--c-bg-raised); /* neutral gray */
|
||||
color: #ffffff;
|
||||
border-bottom: 1px solid var(--unsupported-bar-border);
|
||||
border-bottom: 1px solid var(--c-border);
|
||||
}
|
||||
|
||||
/* Selected border color in light mode */
|
||||
:global([data-mantine-color-scheme="light"]) .card[data-selected="true"] {
|
||||
outline-color: var(--card-selected-border);
|
||||
outline-color: var(--c-primary);
|
||||
}
|
||||
|
||||
/* Reserve space for checkbox instead of logo */
|
||||
@@ -117,12 +117,12 @@
|
||||
/* -------- Title / Meta -------- */
|
||||
.title {
|
||||
line-height: 1.2;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
}
|
||||
|
||||
.meta {
|
||||
margin-top: 2px;
|
||||
color: var(--text-secondary);
|
||||
color: var(--c-text-muted);
|
||||
}
|
||||
|
||||
/* -------- Preview area -------- */
|
||||
@@ -131,7 +131,7 @@
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background: var(--file-card-bg);
|
||||
background: var(--c-surface-raised);
|
||||
}
|
||||
|
||||
.previewPaper {
|
||||
@@ -142,7 +142,7 @@
|
||||
display: grid;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: var(--file-card-bg);
|
||||
background: var(--c-surface-raised);
|
||||
}
|
||||
|
||||
/* Thumbnail fallback */
|
||||
@@ -152,7 +152,7 @@
|
||||
inset: 0;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
color: var(--text-secondary);
|
||||
color: var(--c-text-muted);
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
}
|
||||
@@ -162,7 +162,7 @@
|
||||
position: absolute;
|
||||
bottom: 6px;
|
||||
right: 6px;
|
||||
color: var(--text-secondary);
|
||||
color: var(--c-text-muted);
|
||||
z-index: 1;
|
||||
cursor: grab;
|
||||
display: inline-flex;
|
||||
@@ -173,12 +173,12 @@
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 44px; /* just below header */
|
||||
background: var(--bg-toolbar);
|
||||
border-bottom: 1px solid var(--border-default);
|
||||
background: var(--c-bg-raised);
|
||||
border-bottom: 1px solid var(--c-border);
|
||||
z-index: 20;
|
||||
overflow: hidden;
|
||||
animation: slideDown 140ms ease-out;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
}
|
||||
|
||||
@keyframes slideDown {
|
||||
@@ -200,13 +200,13 @@
|
||||
padding: 12px 16px;
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
cursor: pointer;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.actionRow:hover {
|
||||
background: var(--hover-bg);
|
||||
background: var(--c-hover);
|
||||
}
|
||||
|
||||
.actionDanger {
|
||||
@@ -215,7 +215,7 @@
|
||||
|
||||
.actionsDivider {
|
||||
height: 1px;
|
||||
background: var(--border-default);
|
||||
background: var(--c-border);
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
@@ -229,13 +229,13 @@
|
||||
}
|
||||
|
||||
.pinned {
|
||||
color: #ffc107 !important;
|
||||
color: var(--p-amber-400) !important;
|
||||
}
|
||||
|
||||
/* Unsupported file indicator */
|
||||
.unsupportedPill {
|
||||
margin-left: 1.75rem;
|
||||
background: #6b7280;
|
||||
background: var(--p-gray-500);
|
||||
color: white;
|
||||
padding: 4px 8px;
|
||||
border-radius: 12px;
|
||||
@@ -291,36 +291,23 @@
|
||||
DARK MODE OVERRIDES
|
||||
========================= */
|
||||
:global([data-mantine-color-scheme="dark"]) .card {
|
||||
outline-color: #1c2340; /* deselected stroke */
|
||||
outline-color: var(--c-border); /* deselected stroke (neutral) */
|
||||
}
|
||||
|
||||
:global([data-mantine-color-scheme="dark"]) .card[data-selected="true"] {
|
||||
outline-color: #2d3560; /* selected stroke (subtle navy) */
|
||||
outline-color: var(--c-primary); /* selected stroke (accent) */
|
||||
}
|
||||
|
||||
:global([data-mantine-color-scheme="dark"]) .headerResting {
|
||||
background: #0d1020; /* requested default unselected color */
|
||||
color: var(--tool-header-text); /* #D0D6DC */
|
||||
border-bottom-color: var(--tool-header-border); /* #3A4047 */
|
||||
background: var(--p-navy-950); /* requested default unselected color */
|
||||
color: var(--c-accent-fg); /* var(--p-gray-300) */
|
||||
border-bottom-color: var(--c-border); /* #3A4047 */
|
||||
}
|
||||
|
||||
:global([data-mantine-color-scheme="dark"]) .headerSelected {
|
||||
background: var(--tool-header-border); /* #3A4047 */
|
||||
color: var(--tool-header-text); /* #D0D6DC */
|
||||
border-bottom-color: var(--tool-header-border);
|
||||
}
|
||||
|
||||
:global([data-mantine-color-scheme="dark"]) .title {
|
||||
color: #d0d6dc; /* title text */
|
||||
}
|
||||
|
||||
:global([data-mantine-color-scheme="dark"]) .meta {
|
||||
color: #6b7280; /* subtitle text */
|
||||
}
|
||||
|
||||
/* Light mode selected header stroke override */
|
||||
:global([data-mantine-color-scheme="light"]) .card[data-selected="true"] {
|
||||
outline-color: #3b4b6e;
|
||||
background: var(--c-border); /* #3A4047 */
|
||||
color: var(--c-accent-fg); /* var(--p-gray-300) */
|
||||
border-bottom-color: var(--c-border);
|
||||
}
|
||||
|
||||
/* =========================
|
||||
@@ -332,8 +319,8 @@
|
||||
max-width: 260px;
|
||||
height: calc(310px - 0.5rem);
|
||||
margin: 0.5rem auto 0;
|
||||
background: var(--file-card-bg);
|
||||
border: 1.5px solid var(--border-default);
|
||||
background: var(--c-bg);
|
||||
border: 1.5px solid var(--c-border);
|
||||
border-radius: 12px;
|
||||
box-shadow: var(--shadow-md);
|
||||
cursor: pointer;
|
||||
@@ -347,11 +334,11 @@
|
||||
.addFileCard:hover {
|
||||
box-shadow: var(--shadow-lg);
|
||||
transform: translateY(-1px);
|
||||
border-color: var(--accent-interactive);
|
||||
border-color: var(--c-primary);
|
||||
}
|
||||
|
||||
.addFileCard:focus-visible {
|
||||
outline: 2px solid var(--accent-interactive);
|
||||
outline: 2px solid var(--c-primary);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
@@ -386,7 +373,7 @@
|
||||
}
|
||||
|
||||
.addFileCard:hover .addFileText {
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
}
|
||||
|
||||
.addFileSubtext {
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
box-shadow: var(--shadow-md);
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
background: var(--bg-surface);
|
||||
background: var(--c-surface);
|
||||
transition:
|
||||
box-shadow 0.15s ease,
|
||||
transform 0.2s ease;
|
||||
@@ -91,7 +91,7 @@
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
border-radius: 12px;
|
||||
background: var(--bg-surface);
|
||||
background: var(--c-surface);
|
||||
display: block;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
@@ -115,7 +115,7 @@
|
||||
.fileName {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
line-height: var(--file-name-line-height);
|
||||
height: calc(var(--file-name-lines) * var(--file-name-line-height));
|
||||
margin: 0;
|
||||
@@ -149,7 +149,7 @@
|
||||
|
||||
.fileMeta {
|
||||
font-size: 11px;
|
||||
color: var(--text-secondary);
|
||||
color: var(--c-text-muted);
|
||||
line-height: var(--file-meta-line-height);
|
||||
height: var(--file-meta-line-height);
|
||||
overflow: hidden;
|
||||
@@ -183,7 +183,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(220, 38, 38, 0.12);
|
||||
background: color-mix(in srgb, var(--p-red-600) 12%, transparent);
|
||||
border-radius: 12px;
|
||||
z-index: 2;
|
||||
pointer-events: none;
|
||||
@@ -268,7 +268,7 @@
|
||||
bottom: 6px;
|
||||
right: 6px;
|
||||
cursor: grab;
|
||||
color: var(--text-secondary);
|
||||
color: var(--c-text-muted);
|
||||
opacity: 0;
|
||||
transition: opacity 0.15s ease;
|
||||
pointer-events: none;
|
||||
|
||||
@@ -50,7 +50,7 @@ const DesktopLayout: React.FC = () => {
|
||||
flex: 1,
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
backgroundColor: "var(--bg-file-list)",
|
||||
backgroundColor: "var(--c-surface)",
|
||||
border: "1px solid var(--mantine-color-gray-2)",
|
||||
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.1)",
|
||||
overflow: "hidden",
|
||||
|
||||
@@ -81,8 +81,8 @@ const EmptyFilesState: React.FC = () => {
|
||||
variant="tertiary"
|
||||
aria-label={t("emptyFilesState.upload", "Upload")}
|
||||
style={{
|
||||
backgroundColor: "var(--bg-file-manager)",
|
||||
color: "var(--landing-button-color)",
|
||||
backgroundColor: "var(--c-bg)",
|
||||
color: "var(--c-accent-fg)",
|
||||
border: "1px solid var(--landing-button-border)",
|
||||
borderRadius: isUploadHover ? "2rem" : "1rem",
|
||||
height: "38px",
|
||||
@@ -103,7 +103,7 @@ const EmptyFilesState: React.FC = () => {
|
||||
icon={icons.uploadIconName}
|
||||
width="1.25rem"
|
||||
height="1.25rem"
|
||||
style={{ color: "var(--accent-interactive)" }}
|
||||
style={{ color: "var(--c-primary)" }}
|
||||
/>
|
||||
{isUploadHover && (
|
||||
<span style={{ marginLeft: ".5rem" }}>
|
||||
@@ -115,7 +115,7 @@ const EmptyFilesState: React.FC = () => {
|
||||
|
||||
{/* Instruction Text */}
|
||||
<span
|
||||
className="text-[var(--accent-interactive)]"
|
||||
className="text-[var(--c-primary)]"
|
||||
style={{ fontSize: ".8rem", textAlign: "center" }}
|
||||
>
|
||||
{terminology.dropFilesHere}
|
||||
|
||||
@@ -189,7 +189,7 @@ const FileListItem: React.FC<FileListItemProps> = ({
|
||||
backgroundColor:
|
||||
isSelected || shouldShowHovered
|
||||
? "var(--mantine-color-gray-1)"
|
||||
: "var(--bg-file-list)",
|
||||
: "var(--c-surface)",
|
||||
opacity: 1,
|
||||
transition: "background-color 0.15s ease",
|
||||
userSelect: "none",
|
||||
|
||||
@@ -47,7 +47,7 @@ const MobileLayout: React.FC = () => {
|
||||
flex: 1,
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
backgroundColor: "var(--bg-file-list)",
|
||||
backgroundColor: "var(--c-surface)",
|
||||
borderRadius: "0.5rem",
|
||||
border: "1px solid var(--mantine-color-gray-2)",
|
||||
overflow: "hidden",
|
||||
|
||||
@@ -201,7 +201,7 @@ export function FileDetailsPanel({
|
||||
<img src={single.thumbnailUrl} alt="" />
|
||||
) : (
|
||||
<PictureAsPdfIcon
|
||||
style={{ fontSize: "3rem", color: "var(--text-muted)" }}
|
||||
style={{ fontSize: "3rem", color: "var(--c-text-subtle)" }}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -499,7 +499,7 @@ function FolderCard({
|
||||
<div
|
||||
className="files-page-card-thumb"
|
||||
style={{
|
||||
background: `linear-gradient(135deg, color-mix(in srgb, ${folder.color ?? "var(--accent-interactive, #6366f1)"} 18%, var(--bg-surface)), color-mix(in srgb, ${folder.color ?? "var(--accent-interactive, #6366f1)"} 6%, var(--bg-surface)))`,
|
||||
background: `linear-gradient(135deg, color-mix(in srgb, ${folder.color ?? "var(--c-primary, #6366f1)"} 18%, var(--c-surface)), color-mix(in srgb, ${folder.color ?? "var(--c-primary, #6366f1)"} 6%, var(--c-surface)))`,
|
||||
}}
|
||||
>
|
||||
<FolderThumbnail
|
||||
|
||||
@@ -845,7 +845,7 @@ export default function FileManagerView() {
|
||||
fontSize: "0.95rem",
|
||||
fontWeight: 600,
|
||||
padding: "0.25rem 0.5rem",
|
||||
color: "var(--text-primary)",
|
||||
color: "var(--c-text)",
|
||||
}}
|
||||
>
|
||||
{currentTab === "local"
|
||||
@@ -992,8 +992,8 @@ export default function FileManagerView() {
|
||||
padding: "0.6rem 1.25rem",
|
||||
background:
|
||||
"color-mix(in srgb, var(--mantine-color-red-6, #e03131) 12%, transparent)",
|
||||
color: "var(--text-primary)",
|
||||
borderBottom: "1px solid var(--border-subtle)",
|
||||
color: "var(--c-text)",
|
||||
borderBottom: "1px solid var(--c-border-subtle)",
|
||||
fontSize: "0.85rem",
|
||||
display: "flex",
|
||||
justifyContent: "space-between",
|
||||
@@ -1083,15 +1083,15 @@ export default function FileManagerView() {
|
||||
style={{
|
||||
background:
|
||||
currentTab === tab.id
|
||||
? "var(--hover-bg)"
|
||||
? "var(--c-hover)"
|
||||
: "transparent",
|
||||
border: "none",
|
||||
borderRadius: "0.3rem",
|
||||
padding: "0.2rem 0.6rem",
|
||||
color:
|
||||
currentTab === tab.id
|
||||
? "var(--text-primary)"
|
||||
: "var(--text-muted)",
|
||||
? "var(--c-text)"
|
||||
: "var(--c-text-subtle)",
|
||||
fontWeight: currentTab === tab.id ? 500 : 400,
|
||||
fontSize: "0.75rem",
|
||||
cursor: "pointer",
|
||||
@@ -1662,7 +1662,7 @@ const SearchField = React.forwardRef<
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="files-page-search">
|
||||
<SearchIcon fontSize="small" style={{ color: "var(--text-muted)" }} />
|
||||
<SearchIcon fontSize="small" style={{ color: "var(--c-text-subtle)" }} />
|
||||
<input
|
||||
ref={ref}
|
||||
type="text"
|
||||
|
||||
@@ -28,13 +28,13 @@ const styles = {
|
||||
},
|
||||
local: {
|
||||
background:
|
||||
"color-mix(in srgb, var(--text-muted, #6b7280) 16%, transparent)",
|
||||
color: "var(--text-secondary)",
|
||||
"color-mix(in srgb, var(--c-text-subtle, #6b7280) 16%, transparent)",
|
||||
color: "var(--c-text-muted)",
|
||||
},
|
||||
cloud: {
|
||||
background:
|
||||
"color-mix(in srgb, var(--accent-interactive, #6366f1) 16%, transparent)",
|
||||
color: "var(--accent-interactive, #6366f1)",
|
||||
"color-mix(in srgb, var(--c-primary, #6366f1) 16%, transparent)",
|
||||
color: "var(--c-primary, #6366f1)",
|
||||
},
|
||||
shared: {
|
||||
background:
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: var(--bg-background);
|
||||
color: var(--text-primary);
|
||||
background: var(--c-bg);
|
||||
color: var(--c-text);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
gap: 1rem;
|
||||
min-height: 48px;
|
||||
padding: 0 0.75rem;
|
||||
border-bottom: 1px solid var(--border-subtle);
|
||||
background: var(--bg-toolbar);
|
||||
border-bottom: 1px solid var(--c-border-subtle);
|
||||
background: var(--c-bg-raised);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
border: none;
|
||||
padding: 0.25rem 0.5rem;
|
||||
border-radius: 0.375rem;
|
||||
color: var(--text-secondary);
|
||||
color: var(--c-text-muted);
|
||||
cursor: pointer;
|
||||
font-size: inherit;
|
||||
font-weight: 500;
|
||||
@@ -64,19 +64,14 @@
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.files-page-breadcrumb:hover {
|
||||
background: var(--hover-bg);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.files-page-breadcrumb:hover,
|
||||
.files-page-breadcrumb.is-current {
|
||||
color: var(--text-primary);
|
||||
background: var(--hover-bg);
|
||||
background: var(--c-hover);
|
||||
color: var(--c-text);
|
||||
}
|
||||
|
||||
.files-page-breadcrumb-sep {
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
font-size: 1rem !important;
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
@@ -88,8 +83,8 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
background: var(--bg-surface);
|
||||
border: 1px solid var(--border-subtle);
|
||||
background: var(--c-surface);
|
||||
border: 1px solid var(--c-border-subtle);
|
||||
border-radius: 999px;
|
||||
padding: 0.2rem 0.75rem;
|
||||
/* Fills its grid cell; the cell's minmax(...) clamps to a sensible range. */
|
||||
@@ -102,7 +97,7 @@
|
||||
border: none;
|
||||
outline: none;
|
||||
flex: 1;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
@@ -116,8 +111,8 @@
|
||||
.files-page-tree {
|
||||
width: 17rem;
|
||||
flex-shrink: 0;
|
||||
border-right: 1px solid var(--border-subtle);
|
||||
background: var(--bg-toolbar);
|
||||
border-right: 1px solid var(--c-border-subtle);
|
||||
background: var(--c-bg-raised);
|
||||
overflow-y: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -135,7 +130,7 @@
|
||||
font-size: 0.8rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
}
|
||||
|
||||
/* Tree node styles moved to FolderTreePanel.css - that's where the
|
||||
@@ -156,8 +151,8 @@
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
padding: 0.55rem 1.25rem;
|
||||
border-bottom: 1px solid var(--border-subtle);
|
||||
background: var(--bg-background);
|
||||
border-bottom: 1px solid var(--c-border-subtle);
|
||||
background: var(--c-bg);
|
||||
flex-shrink: 0;
|
||||
flex-wrap: wrap;
|
||||
min-height: 3rem;
|
||||
@@ -165,7 +160,7 @@
|
||||
|
||||
.files-page-toolbar-info {
|
||||
font-size: 0.85rem;
|
||||
color: var(--text-secondary);
|
||||
color: var(--c-text-muted);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
@@ -178,7 +173,7 @@
|
||||
}
|
||||
|
||||
.files-page-toolbar-info span {
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
}
|
||||
|
||||
.files-page-toolbar-actions {
|
||||
@@ -226,7 +221,7 @@
|
||||
.files-page-toolbar-divider {
|
||||
width: 1px;
|
||||
height: 1.4rem;
|
||||
background: var(--border-subtle);
|
||||
background: var(--c-border-subtle);
|
||||
margin: 0 0.15rem;
|
||||
}
|
||||
|
||||
@@ -264,7 +259,7 @@
|
||||
padding: 1.25rem;
|
||||
position: relative;
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: var(--border-subtle) transparent;
|
||||
scrollbar-color: var(--c-border-subtle) transparent;
|
||||
}
|
||||
|
||||
.files-page-content::-webkit-scrollbar {
|
||||
@@ -273,14 +268,14 @@
|
||||
}
|
||||
|
||||
.files-page-content::-webkit-scrollbar-thumb {
|
||||
background: var(--border-subtle);
|
||||
background: var(--c-border-subtle);
|
||||
border-radius: 999px;
|
||||
border: 2px solid transparent;
|
||||
background-clip: content-box;
|
||||
}
|
||||
|
||||
.files-page-content::-webkit-scrollbar-thumb:hover {
|
||||
background: var(--text-muted);
|
||||
background: var(--c-text-subtle);
|
||||
background-clip: content-box;
|
||||
}
|
||||
|
||||
@@ -288,7 +283,7 @@
|
||||
.folder-tree-panel-inner,
|
||||
.files-page-details-body {
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: var(--border-subtle) transparent;
|
||||
scrollbar-color: var(--c-border-subtle) transparent;
|
||||
}
|
||||
|
||||
.files-page-tree-list::-webkit-scrollbar,
|
||||
@@ -300,7 +295,7 @@
|
||||
.files-page-tree-list::-webkit-scrollbar-thumb,
|
||||
.folder-tree-panel-inner::-webkit-scrollbar-thumb,
|
||||
.files-page-details-body::-webkit-scrollbar-thumb {
|
||||
background: var(--border-subtle);
|
||||
background: var(--c-border-subtle);
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
@@ -313,10 +308,10 @@
|
||||
.files-page-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border: 1px solid var(--border-subtle);
|
||||
border: 1px solid var(--c-border-subtle);
|
||||
border-radius: 0.6rem;
|
||||
overflow: hidden;
|
||||
background: var(--bg-surface);
|
||||
background: var(--c-surface);
|
||||
}
|
||||
|
||||
.files-page-list-row {
|
||||
@@ -325,7 +320,7 @@
|
||||
gap: 0.5rem;
|
||||
align-items: center;
|
||||
padding: 0.5rem 0.75rem;
|
||||
border-bottom: 1px solid var(--border-subtle);
|
||||
border-bottom: 1px solid var(--c-border-subtle);
|
||||
cursor: pointer;
|
||||
font-size: 0.9rem;
|
||||
transition: background-color 0.12s ease;
|
||||
@@ -336,8 +331,8 @@
|
||||
}
|
||||
|
||||
.files-page-list-row.is-header {
|
||||
background: var(--bg-toolbar);
|
||||
color: var(--text-muted);
|
||||
background: var(--c-bg-raised);
|
||||
color: var(--c-text-subtle);
|
||||
text-transform: uppercase;
|
||||
font-size: 0.72rem;
|
||||
letter-spacing: 0.05em;
|
||||
@@ -356,33 +351,25 @@
|
||||
}
|
||||
|
||||
.files-page-list-row.is-header [data-sortable="true"]:hover {
|
||||
background: var(--hover-bg);
|
||||
color: var(--text-primary);
|
||||
background: var(--c-hover);
|
||||
color: var(--c-text);
|
||||
}
|
||||
|
||||
.files-page-list-row:not(.is-header):hover {
|
||||
background: var(--hover-bg);
|
||||
}
|
||||
|
||||
.files-page-list-row:not(.is-header):hover,
|
||||
.files-page-list-row.is-selected {
|
||||
background: var(--hover-bg);
|
||||
background: var(--c-hover);
|
||||
}
|
||||
|
||||
.files-page-list-row.is-drop-target {
|
||||
background: color-mix(
|
||||
in srgb,
|
||||
var(--accent-interactive, #6366f1) 12%,
|
||||
transparent
|
||||
);
|
||||
box-shadow: inset 0 0 0 1px var(--accent-interactive, #6366f1);
|
||||
background: color-mix(in srgb, var(--c-primary) 12%, transparent);
|
||||
box-shadow: inset 0 0 0 1px var(--c-primary);
|
||||
}
|
||||
|
||||
.files-page-card {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: var(--bg-surface);
|
||||
border: 1px solid var(--border-subtle);
|
||||
background: var(--c-surface);
|
||||
border: 1px solid var(--c-border-subtle);
|
||||
border-radius: 0.85rem;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
@@ -397,8 +384,8 @@
|
||||
transform: translateY(-2px);
|
||||
border-color: color-mix(
|
||||
in srgb,
|
||||
var(--accent-interactive, #6366f1) 35%,
|
||||
var(--border-subtle)
|
||||
var(--c-primary) 35%,
|
||||
var(--c-border-subtle)
|
||||
);
|
||||
box-shadow:
|
||||
0 4px 6px -1px rgba(0, 0, 0, 0.08),
|
||||
@@ -406,16 +393,15 @@
|
||||
}
|
||||
|
||||
.files-page-card:focus-visible {
|
||||
outline: 2px solid var(--accent-interactive, #6366f1);
|
||||
outline: 2px solid var(--c-primary);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.files-page-card.is-selected {
|
||||
border-color: var(--accent-interactive, #6366f1);
|
||||
border-color: var(--c-primary);
|
||||
box-shadow:
|
||||
0 0 0 2px var(--accent-interactive, #6366f1),
|
||||
0 6px 18px -6px
|
||||
color-mix(in srgb, var(--accent-interactive, #6366f1) 35%, transparent);
|
||||
0 0 0 2px var(--c-primary),
|
||||
0 6px 18px -6px color-mix(in srgb, var(--c-primary) 35%, transparent);
|
||||
}
|
||||
|
||||
.files-page-card.is-folder {
|
||||
@@ -426,8 +412,8 @@
|
||||
aspect-ratio: 4 / 3;
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
color-mix(in srgb, var(--text-muted) 5%, var(--bg-surface)),
|
||||
var(--bg-surface)
|
||||
color-mix(in srgb, var(--c-text-subtle) 5%, var(--c-surface)),
|
||||
var(--c-surface)
|
||||
);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -452,7 +438,7 @@
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
font-size: 0.72rem;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.04em;
|
||||
@@ -472,13 +458,13 @@
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
letter-spacing: -0.005em;
|
||||
}
|
||||
|
||||
.files-page-card-meta {
|
||||
font-size: 0.76rem;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
@@ -488,7 +474,7 @@
|
||||
the user can tell which folder each hit lives in without navigating. */
|
||||
.files-page-card-path {
|
||||
font-size: 0.72rem;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@@ -517,8 +503,8 @@
|
||||
/* Style the Mantine checkbox so it reads as a soft pill rather than a
|
||||
bare form control. */
|
||||
.files-page-card-selector :where(.mantine-Checkbox-input) {
|
||||
background: var(--bg-surface);
|
||||
border-color: var(--border-subtle);
|
||||
background: var(--c-surface);
|
||||
border-color: var(--c-border-subtle);
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
|
||||
}
|
||||
|
||||
@@ -536,26 +522,26 @@
|
||||
Use stronger specificity + !important to win over Mantine's
|
||||
variant=filled inline styles. */
|
||||
.files-page-card .files-page-card-actions button.mantine-ActionIcon-root {
|
||||
background-color: var(--bg-raised, var(--bg-surface)) !important;
|
||||
color: var(--text-primary) !important;
|
||||
border: 1px solid var(--border-default, var(--border-subtle)) !important;
|
||||
background-color: var(--c-surface-raised, var(--c-surface)) !important;
|
||||
color: var(--c-text) !important;
|
||||
border: 1px solid var(--c-border, var(--c-border-subtle)) !important;
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
|
||||
backdrop-filter: blur(6px);
|
||||
}
|
||||
|
||||
.files-page-card .files-page-card-actions button.mantine-ActionIcon-root:hover {
|
||||
background-color: var(--hover-bg) !important;
|
||||
background-color: var(--c-hover) !important;
|
||||
}
|
||||
|
||||
/* Row-view kebab: same high-contrast treatment so it's readable
|
||||
against selected (tinted) and in-workspace rows. */
|
||||
.files-page-list-row .mantine-ActionIcon-root[aria-label$="actions"] {
|
||||
color: var(--text-secondary);
|
||||
color: var(--c-text-muted);
|
||||
}
|
||||
|
||||
.files-page-list-row .mantine-ActionIcon-root[aria-label$="actions"]:hover {
|
||||
background-color: var(--hover-bg) !important;
|
||||
color: var(--text-primary);
|
||||
background-color: var(--c-hover) !important;
|
||||
color: var(--c-text);
|
||||
}
|
||||
|
||||
.files-page-card-origin {
|
||||
@@ -578,7 +564,7 @@
|
||||
gap: 0.35rem;
|
||||
padding: 0.22rem 0.55rem;
|
||||
border-radius: 999px;
|
||||
background: var(--mantine-color-teal-6, #10b981);
|
||||
background: var(--mantine-color-teal-6, var(--p-emerald-500));
|
||||
color: #ffffff;
|
||||
font-size: 0.68rem;
|
||||
font-weight: 700;
|
||||
@@ -614,8 +600,8 @@
|
||||
.files-page-card.is-in-workspace {
|
||||
border-color: color-mix(
|
||||
in srgb,
|
||||
var(--mantine-color-teal-6, #10b981) 35%,
|
||||
var(--border-subtle)
|
||||
var(--mantine-color-teal-6, var(--p-emerald-500)) 35%,
|
||||
var(--c-border-subtle)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -627,7 +613,12 @@
|
||||
pointer-events: none;
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
color-mix(in srgb, var(--mantine-color-teal-6, #10b981) 6%, transparent) 0%,
|
||||
color-mix(
|
||||
in srgb,
|
||||
var(--mantine-color-teal-6, var(--p-emerald-500)) 6%,
|
||||
transparent
|
||||
)
|
||||
0%,
|
||||
transparent 40%
|
||||
);
|
||||
z-index: 0;
|
||||
@@ -639,7 +630,7 @@
|
||||
gap: 0.3rem;
|
||||
padding: 0.12rem 0.5rem;
|
||||
border-radius: 999px;
|
||||
background: var(--mantine-color-teal-6, #10b981);
|
||||
background: var(--mantine-color-teal-6, var(--p-emerald-500));
|
||||
color: #ffffff;
|
||||
font-size: 0.68rem;
|
||||
font-weight: 700;
|
||||
@@ -653,7 +644,7 @@
|
||||
.files-page-list-row.is-in-workspace {
|
||||
background: color-mix(
|
||||
in srgb,
|
||||
var(--mantine-color-teal-6, #10b981) 4%,
|
||||
var(--mantine-color-teal-6, var(--p-emerald-500)) 4%,
|
||||
transparent
|
||||
);
|
||||
}
|
||||
@@ -685,13 +676,9 @@
|
||||
}
|
||||
|
||||
.files-page-card.is-drop-target {
|
||||
background: color-mix(
|
||||
in srgb,
|
||||
var(--accent-interactive, #6366f1) 10%,
|
||||
var(--bg-surface)
|
||||
);
|
||||
box-shadow: 0 0 0 2px var(--accent-interactive, #6366f1);
|
||||
border-color: var(--accent-interactive, #6366f1);
|
||||
background: color-mix(in srgb, var(--c-primary) 10%, var(--c-surface));
|
||||
box-shadow: 0 0 0 2px var(--c-primary);
|
||||
border-color: var(--c-primary);
|
||||
}
|
||||
|
||||
@keyframes files-page-skeleton-pulse {
|
||||
@@ -707,9 +694,9 @@
|
||||
display: block;
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
color-mix(in srgb, var(--text-muted) 12%, transparent) 25%,
|
||||
color-mix(in srgb, var(--text-muted) 22%, transparent) 50%,
|
||||
color-mix(in srgb, var(--text-muted) 12%, transparent) 75%
|
||||
color-mix(in srgb, var(--c-text-subtle) 12%, transparent) 25%,
|
||||
color-mix(in srgb, var(--c-text-subtle) 22%, transparent) 50%,
|
||||
color-mix(in srgb, var(--c-text-subtle) 12%, transparent) 75%
|
||||
);
|
||||
background-size: 200% 100%;
|
||||
animation: files-page-skeleton-pulse 1.4s ease-in-out infinite;
|
||||
@@ -718,14 +705,14 @@
|
||||
|
||||
.files-page-skeleton-card {
|
||||
pointer-events: none;
|
||||
border-color: var(--border-subtle);
|
||||
border-color: var(--c-border-subtle);
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.files-page-skeleton-card:hover {
|
||||
transform: none;
|
||||
box-shadow: none;
|
||||
border-color: var(--border-subtle);
|
||||
border-color: var(--c-border-subtle);
|
||||
}
|
||||
|
||||
.files-page-skeleton-row {
|
||||
@@ -743,7 +730,7 @@
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
gap: 0.75rem;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
padding: 4rem 1.5rem;
|
||||
text-align: center;
|
||||
}
|
||||
@@ -755,25 +742,21 @@
|
||||
width: 5rem;
|
||||
height: 5rem;
|
||||
border-radius: 50%;
|
||||
background: color-mix(
|
||||
in srgb,
|
||||
var(--accent-interactive, #6366f1) 12%,
|
||||
transparent
|
||||
);
|
||||
color: var(--accent-interactive, #6366f1);
|
||||
background: color-mix(in srgb, var(--c-primary) 12%, transparent);
|
||||
color: var(--c-primary);
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.files-page-empty-title {
|
||||
font-size: 1.15rem;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
font-weight: 600;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.files-page-empty-hint {
|
||||
font-size: 0.9rem;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
max-width: 30rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
@@ -797,8 +780,8 @@
|
||||
.files-page-details {
|
||||
width: 22rem;
|
||||
flex-shrink: 0;
|
||||
border-left: 1px solid var(--border-subtle);
|
||||
background: var(--bg-toolbar);
|
||||
border-left: 1px solid var(--c-border-subtle);
|
||||
background: var(--c-bg-raised);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
@@ -817,7 +800,7 @@
|
||||
font-size: 0.78rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.06em;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
}
|
||||
|
||||
.files-page-details-header strong {
|
||||
@@ -846,8 +829,8 @@
|
||||
flex-direction: column;
|
||||
gap: 0.4rem;
|
||||
padding: 0.6rem 1.1rem;
|
||||
border-top: 1px solid var(--border-subtle);
|
||||
background: var(--bg-toolbar);
|
||||
border-top: 1px solid var(--c-border-subtle);
|
||||
background: var(--c-bg-raised);
|
||||
}
|
||||
|
||||
/* Collapsible "File info" header (size/type/dates). */
|
||||
@@ -857,11 +840,11 @@
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
padding: 0.4rem 0.6rem;
|
||||
background: var(--bg-surface);
|
||||
border: 1px solid var(--border-subtle);
|
||||
background: var(--c-surface);
|
||||
border: 1px solid var(--c-border-subtle);
|
||||
border-radius: 0.5rem;
|
||||
cursor: pointer;
|
||||
color: var(--text-secondary, var(--text-primary));
|
||||
color: var(--c-text-muted, var(--c-text));
|
||||
font-size: 0.78rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
@@ -878,8 +861,8 @@
|
||||
/* Compact fixed height (was a tall 4:3 box that dominated the panel and
|
||||
pushed the action buttons off the bottom). */
|
||||
height: 6.5rem;
|
||||
background: var(--bg-surface);
|
||||
border: 1px solid var(--border-subtle);
|
||||
background: var(--c-surface);
|
||||
border: 1px solid var(--c-border-subtle);
|
||||
border-radius: 0.6rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -911,8 +894,8 @@
|
||||
gap: 0.55rem;
|
||||
font-size: 0.85rem;
|
||||
padding: 0.65rem 0.75rem;
|
||||
background: var(--bg-surface);
|
||||
border: 1px solid var(--border-subtle);
|
||||
background: var(--c-surface);
|
||||
border: 1px solid var(--c-border-subtle);
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
@@ -923,12 +906,12 @@
|
||||
}
|
||||
|
||||
.files-page-details-field-label {
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
font-size: 0.78rem;
|
||||
}
|
||||
|
||||
.files-page-details-field-value {
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
text-align: right;
|
||||
word-break: break-word;
|
||||
font-weight: 500;
|
||||
@@ -939,8 +922,8 @@
|
||||
flex-direction: column;
|
||||
gap: 0.3rem;
|
||||
padding: 0.5rem 0.6rem;
|
||||
background: var(--bg-surface);
|
||||
border: 1px solid var(--border-subtle);
|
||||
background: var(--c-surface);
|
||||
border: 1px solid var(--c-border-subtle);
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
@@ -948,7 +931,7 @@
|
||||
font-size: 0.72rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
}
|
||||
|
||||
/* Filename chip next to the title - "PDF", "DOCX", etc.
|
||||
@@ -959,9 +942,9 @@
|
||||
align-items: center;
|
||||
padding: 0.12rem 0.5rem;
|
||||
border-radius: 0.4rem;
|
||||
background: var(--bg-surface);
|
||||
border: 1px solid var(--border-subtle);
|
||||
color: var(--text-secondary, var(--text-primary));
|
||||
background: var(--c-surface);
|
||||
border: 1px solid var(--c-border-subtle);
|
||||
color: var(--c-text-muted, var(--c-text));
|
||||
font-size: 0.65rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.05em;
|
||||
@@ -980,8 +963,8 @@
|
||||
flex-direction: column;
|
||||
gap: 0.4rem;
|
||||
padding: 0.55rem 0.7rem 0.7rem;
|
||||
background: var(--bg-surface);
|
||||
border: 1px solid var(--border-subtle);
|
||||
background: var(--c-surface);
|
||||
border: 1px solid var(--c-border-subtle);
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
.files-page-details-version-timeline-label {
|
||||
@@ -991,12 +974,12 @@
|
||||
font-size: 0.72rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
}
|
||||
.files-page-details-version-timeline-count {
|
||||
margin-left: auto;
|
||||
font-weight: 600;
|
||||
color: var(--text-secondary, var(--text-muted));
|
||||
color: var(--c-text-muted, var(--c-text-subtle));
|
||||
text-transform: none;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
@@ -1026,27 +1009,26 @@
|
||||
width: 0.55rem;
|
||||
height: 0.55rem;
|
||||
border-radius: 50%;
|
||||
background: var(--bg-toolbar);
|
||||
border: 2px solid var(--border-strong, var(--border-subtle));
|
||||
background: var(--c-bg-raised);
|
||||
border: 2px solid var(--c-border-strong, var(--c-border-subtle));
|
||||
z-index: 1;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.files-page-details-version-timeline-rail-dot.is-active {
|
||||
background: var(--accent-interactive, #6366f1);
|
||||
border-color: var(--accent-interactive, #6366f1);
|
||||
box-shadow: 0 0 0 3px
|
||||
color-mix(in srgb, var(--accent-interactive, #6366f1) 25%, transparent);
|
||||
background: var(--c-primary);
|
||||
border-color: var(--c-primary);
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-primary) 25%, transparent);
|
||||
}
|
||||
.files-page-details-version-timeline-rail-dot.is-ellipsis {
|
||||
width: 0.35rem;
|
||||
height: 0.35rem;
|
||||
background: var(--text-muted);
|
||||
background: var(--c-text-subtle);
|
||||
border-color: transparent;
|
||||
}
|
||||
.files-page-details-version-timeline-rail-line {
|
||||
width: 2px;
|
||||
flex: 1;
|
||||
background: var(--border-subtle);
|
||||
background: var(--c-border-subtle);
|
||||
min-height: 0.6rem;
|
||||
margin-top: 2px;
|
||||
}
|
||||
@@ -1062,11 +1044,7 @@
|
||||
}
|
||||
.files-page-details-version-timeline-row.is-active
|
||||
.files-page-details-version-timeline-body {
|
||||
background: color-mix(
|
||||
in srgb,
|
||||
var(--accent-interactive, #6366f1) 10%,
|
||||
transparent
|
||||
);
|
||||
background: color-mix(in srgb, var(--c-primary) 10%, transparent);
|
||||
}
|
||||
.files-page-details-version-timeline-summary {
|
||||
appearance: none;
|
||||
@@ -1084,11 +1062,11 @@
|
||||
}
|
||||
.files-page-details-version-timeline-summary:hover
|
||||
.files-page-details-version-timeline-chevron {
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
}
|
||||
.files-page-details-version-timeline-delta {
|
||||
font-size: 0.82rem;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
font-weight: 500;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
@@ -1099,30 +1077,30 @@
|
||||
}
|
||||
.files-page-details-version-timeline-delta.is-origin {
|
||||
font-weight: 400;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
font-style: italic;
|
||||
}
|
||||
.files-page-details-version-timeline-delta-plus {
|
||||
color: var(--accent-interactive, #6366f1);
|
||||
color: var(--c-primary);
|
||||
font-weight: 700;
|
||||
}
|
||||
.files-page-details-version-timeline-spacer {
|
||||
flex: 1;
|
||||
}
|
||||
.files-page-details-version-timeline-chevron {
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
transition: transform 0.15s ease;
|
||||
}
|
||||
.files-page-details-version-timeline-chevron.is-expanded {
|
||||
transform: rotate(180deg);
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
}
|
||||
.files-page-details-version-timeline-meta-line {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
font-size: 0.7rem;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
}
|
||||
.files-page-details-version-timeline-expanded {
|
||||
display: flex;
|
||||
@@ -1130,7 +1108,7 @@
|
||||
gap: 0.4rem;
|
||||
margin-top: 0.45rem;
|
||||
padding-top: 0.5rem;
|
||||
border-top: 1px dashed var(--border-subtle);
|
||||
border-top: 1px dashed var(--c-border-subtle);
|
||||
}
|
||||
.files-page-details-version-timeline-toolchain {
|
||||
display: flex;
|
||||
@@ -1139,7 +1117,7 @@
|
||||
}
|
||||
.files-page-details-version-timeline-toolchain-label {
|
||||
font-size: 0.65rem;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
@@ -1147,12 +1125,12 @@
|
||||
.files-page-details-version-timeline-collapse-btn {
|
||||
appearance: none;
|
||||
background: none;
|
||||
border: 1px dashed var(--border-subtle);
|
||||
border: 1px dashed var(--c-border-subtle);
|
||||
border-radius: 0.3rem;
|
||||
padding: 0.25rem 0.5rem;
|
||||
margin: 0.1rem 0;
|
||||
font-size: 0.72rem;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
cursor: pointer;
|
||||
text-align: left;
|
||||
transition:
|
||||
@@ -1161,8 +1139,8 @@
|
||||
}
|
||||
.files-page-details-version-timeline-ellipsis-btn:hover,
|
||||
.files-page-details-version-timeline-collapse-btn:hover {
|
||||
color: var(--text-primary);
|
||||
border-color: var(--border-strong, var(--text-muted));
|
||||
color: var(--c-text);
|
||||
border-color: var(--c-border-strong, var(--c-text-subtle));
|
||||
}
|
||||
.files-page-details-version-timeline-collapse-btn {
|
||||
align-self: flex-start;
|
||||
@@ -1172,12 +1150,8 @@
|
||||
.files-page-drop-overlay {
|
||||
position: absolute;
|
||||
inset: 1rem;
|
||||
background: color-mix(
|
||||
in srgb,
|
||||
var(--accent-interactive, #6366f1) 14%,
|
||||
var(--bg-background)
|
||||
);
|
||||
border: 2px dashed var(--accent-interactive, #6366f1);
|
||||
background: color-mix(in srgb, var(--c-primary) 14%, var(--c-bg));
|
||||
border: 2px dashed var(--c-primary);
|
||||
border-radius: 1rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -1185,7 +1159,7 @@
|
||||
justify-content: center;
|
||||
gap: 1rem;
|
||||
pointer-events: none;
|
||||
color: var(--accent-interactive, #6366f1);
|
||||
color: var(--c-primary);
|
||||
font-weight: 600;
|
||||
font-size: 1.1rem;
|
||||
z-index: 10;
|
||||
@@ -1200,40 +1174,28 @@
|
||||
width: 4.5rem;
|
||||
height: 4.5rem;
|
||||
border-radius: 50%;
|
||||
background: color-mix(
|
||||
in srgb,
|
||||
var(--accent-interactive, #6366f1) 30%,
|
||||
transparent
|
||||
);
|
||||
background: color-mix(in srgb, var(--c-primary) 30%, transparent);
|
||||
}
|
||||
|
||||
.files-page-drop-overlay-icon svg {
|
||||
font-size: 2.5rem !important;
|
||||
color: var(--bg-background);
|
||||
color: var(--c-bg);
|
||||
}
|
||||
|
||||
.files-page-drop-overlay-sub {
|
||||
font-size: 0.85rem;
|
||||
font-weight: 500;
|
||||
color: color-mix(
|
||||
in srgb,
|
||||
var(--accent-interactive, #6366f1) 80%,
|
||||
var(--text-secondary)
|
||||
);
|
||||
color: color-mix(in srgb, var(--c-primary) 80%, var(--c-text-muted));
|
||||
}
|
||||
|
||||
@keyframes files-page-drop-overlay-pulse {
|
||||
0%,
|
||||
100% {
|
||||
border-color: var(--accent-interactive, #6366f1);
|
||||
border-color: var(--c-primary);
|
||||
transform: scale(1);
|
||||
}
|
||||
50% {
|
||||
border-color: color-mix(
|
||||
in srgb,
|
||||
var(--accent-interactive, #6366f1) 60%,
|
||||
transparent
|
||||
);
|
||||
border-color: color-mix(in srgb, var(--c-primary) 60%, transparent);
|
||||
transform: scale(1.005);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ export function FolderAppearancePicker({
|
||||
borderRadius: "50%",
|
||||
border:
|
||||
folder.color === c
|
||||
? "2px solid var(--text-primary)"
|
||||
? "2px solid var(--c-text)"
|
||||
: "2px solid transparent",
|
||||
background: c,
|
||||
cursor: disabled ? "not-allowed" : "pointer",
|
||||
@@ -123,7 +123,7 @@ function Section({
|
||||
fontSize: "0.7rem",
|
||||
textTransform: "uppercase",
|
||||
letterSpacing: "0.05em",
|
||||
color: "var(--text-muted)",
|
||||
color: "var(--c-text-subtle)",
|
||||
fontWeight: 600,
|
||||
}}
|
||||
>
|
||||
@@ -163,13 +163,13 @@ function IconButton({
|
||||
justifyContent: "center",
|
||||
fontSize: "1.1rem",
|
||||
borderRadius: "0.4rem",
|
||||
background: selected ? "var(--hover-bg)" : "transparent",
|
||||
background: selected ? "var(--c-hover)" : "transparent",
|
||||
border: selected
|
||||
? "1px solid var(--accent-interactive, #6366f1)"
|
||||
? "1px solid var(--c-primary, #6366f1)"
|
||||
: "1px solid transparent",
|
||||
cursor: disabled ? "not-allowed" : "pointer",
|
||||
padding: 0,
|
||||
color: "var(--text-primary)",
|
||||
color: "var(--c-text)",
|
||||
}}
|
||||
>
|
||||
{icon.glyph || "-"}
|
||||
|
||||
@@ -30,7 +30,7 @@ export function FolderThumbnail({
|
||||
size = "thumb",
|
||||
iconGlyph,
|
||||
}: FolderThumbnailProps) {
|
||||
const accent = color ?? "var(--accent-interactive, #6366f1)";
|
||||
const accent = color ?? "var(--c-primary, #6366f1)";
|
||||
const px = SIZE_PX[size];
|
||||
const showBadge = size === "thumb" && (fileCount ?? 0) > 0;
|
||||
// Per-instance unique ids - `${color}` previously embedded `#` and CSS
|
||||
@@ -149,7 +149,7 @@ export function FolderThumbnail({
|
||||
minWidth: "1.4rem",
|
||||
height: "1.4rem",
|
||||
borderRadius: "999px",
|
||||
background: "var(--bg-surface, #fff)",
|
||||
background: "var(--c-surface, #fff)",
|
||||
border: `1px solid ${accent}`,
|
||||
color: accent,
|
||||
fontSize: "0.7rem",
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
.folder-tree-panel {
|
||||
width: 0;
|
||||
flex-shrink: 0;
|
||||
background: var(--bg-toolbar);
|
||||
border-right: 0 solid var(--border-subtle);
|
||||
background: var(--c-bg-raised);
|
||||
border-right: 0 solid var(--c-border-subtle);
|
||||
overflow: hidden;
|
||||
height: 100%;
|
||||
pointer-events: none;
|
||||
@@ -65,11 +65,7 @@
|
||||
|
||||
.folder-tree-panel-resizer:hover,
|
||||
.folder-tree-panel-resizer:focus-visible {
|
||||
background: color-mix(
|
||||
in srgb,
|
||||
var(--accent-interactive, #6366f1) 35%,
|
||||
transparent
|
||||
);
|
||||
background: color-mix(in srgb, var(--c-primary) 35%, transparent);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
@@ -87,7 +83,7 @@
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.02em;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
@@ -112,7 +108,7 @@
|
||||
margin: 0 8px;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
color: var(--text-secondary);
|
||||
color: var(--c-text-muted);
|
||||
font-size: 14px;
|
||||
position: relative;
|
||||
transition: background-color 0.15s ease;
|
||||
@@ -120,23 +116,19 @@
|
||||
}
|
||||
|
||||
.files-page-tree-node:hover {
|
||||
background: var(--hover-bg);
|
||||
background: var(--c-hover);
|
||||
}
|
||||
|
||||
.files-page-tree-node.is-active {
|
||||
background: var(--hover-bg);
|
||||
color: var(--text-primary);
|
||||
background: var(--c-hover);
|
||||
color: var(--c-text);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.files-page-tree-node.is-drop-target {
|
||||
background: color-mix(
|
||||
in srgb,
|
||||
var(--accent-interactive, #6366f1) 12%,
|
||||
transparent
|
||||
);
|
||||
box-shadow: inset 0 0 0 1px var(--accent-interactive, #6366f1);
|
||||
color: var(--text-primary);
|
||||
background: color-mix(in srgb, var(--c-primary) 12%, transparent);
|
||||
box-shadow: inset 0 0 0 1px var(--c-primary);
|
||||
color: var(--c-text);
|
||||
}
|
||||
|
||||
.files-page-tree-toggle {
|
||||
@@ -145,7 +137,7 @@
|
||||
justify-content: center;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
@@ -165,7 +157,7 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
margin-left: 8px;
|
||||
font-size: 18px;
|
||||
}
|
||||
@@ -183,7 +175,7 @@
|
||||
}
|
||||
|
||||
.files-page-tree-count {
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
font-size: 12px;
|
||||
flex-shrink: 0;
|
||||
margin-left: 8px;
|
||||
|
||||
@@ -127,7 +127,7 @@ export function MoveToFolderDialog({
|
||||
</Text>
|
||||
<div
|
||||
style={{
|
||||
border: "1px solid var(--border-subtle)",
|
||||
border: "1px solid var(--c-border-subtle)",
|
||||
borderRadius: "0.5rem",
|
||||
maxHeight: "20rem",
|
||||
overflowY: "auto",
|
||||
@@ -343,8 +343,8 @@ function FolderPick({
|
||||
opacity: disabled ? 0.45 : 1,
|
||||
gap: "0.5rem",
|
||||
padding: `0.4rem 0.75rem 0.4rem ${0.75 + depth * 0.85}rem`,
|
||||
background: isActive ? "var(--hover-bg)" : "transparent",
|
||||
borderBottom: "1px solid var(--border-subtle)",
|
||||
background: isActive ? "var(--c-hover)" : "transparent",
|
||||
borderBottom: "1px solid var(--c-border-subtle)",
|
||||
boxSizing: "border-box",
|
||||
fontWeight: isActive ? 600 : 400,
|
||||
}}
|
||||
|
||||
@@ -218,7 +218,7 @@ export default function Workbench() {
|
||||
<Box
|
||||
className="flex-1 h-full min-w-0 relative flex flex-col"
|
||||
data-tour="workbench"
|
||||
style={{ backgroundColor: "var(--bg-background)", minWidth: 0 }}
|
||||
style={{ backgroundColor: "var(--c-bg)", minWidth: 0 }}
|
||||
>
|
||||
{/* Workbench Bar - animates in/out based on file presence */}
|
||||
{currentView !== "myFiles" &&
|
||||
|
||||
+46
-46
@@ -22,7 +22,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
|
||||
box-shadow: 0 16px 32px color-mix(in srgb, var(--p-gray-900) 18%, transparent);
|
||||
animation: heroLogoScale 0.25s ease forwards;
|
||||
}
|
||||
|
||||
@@ -49,10 +49,10 @@
|
||||
.securityCard {
|
||||
width: 100%;
|
||||
max-width: 480px;
|
||||
background: var(--bg-surface, #ffffff);
|
||||
background: var(--c-surface, #ffffff);
|
||||
border-radius: 16px;
|
||||
padding: 20px;
|
||||
box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
|
||||
box-shadow: 0 12px 32px color-mix(in srgb, var(--p-gray-900) 12%, transparent);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
@@ -65,7 +65,7 @@
|
||||
font-weight: 500;
|
||||
font-size: 15px;
|
||||
line-height: 1.5;
|
||||
color: var(--onboarding-body, #1f2937);
|
||||
color: var(--c-text-muted, var(--p-gray-800));
|
||||
}
|
||||
|
||||
.mfaSlideContent {
|
||||
@@ -77,10 +77,10 @@
|
||||
.mfaCard {
|
||||
width: 100%;
|
||||
max-width: 560px;
|
||||
background: var(--bg-surface, #ffffff);
|
||||
background: var(--c-surface, #ffffff);
|
||||
border-radius: 16px;
|
||||
padding: 20px;
|
||||
box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
|
||||
box-shadow: 0 12px 32px color-mix(in srgb, var(--p-gray-900) 12%, transparent);
|
||||
}
|
||||
|
||||
.mfaSetupGrid {
|
||||
@@ -94,7 +94,7 @@
|
||||
padding: 12px;
|
||||
background: #ffffff;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
|
||||
box-shadow: 0 8px 16px color-mix(in srgb, var(--p-gray-900) 12%, transparent);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
@@ -102,7 +102,7 @@
|
||||
.mfaSteps {
|
||||
margin: 0;
|
||||
padding-left: 18px;
|
||||
color: var(--onboarding-body, #1f2937);
|
||||
color: var(--c-text-muted, var(--p-gray-800));
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
@@ -149,11 +149,7 @@
|
||||
padding: 4px;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.iconButton:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.iconButton:focus,
|
||||
.iconButton:focus-visible {
|
||||
outline: none;
|
||||
}
|
||||
@@ -194,14 +190,7 @@
|
||||
text-align: center;
|
||||
animation: heroLogoEnter 0.25s ease forwards;
|
||||
}
|
||||
|
||||
.title {
|
||||
text-align: center;
|
||||
opacity: 0;
|
||||
transform: translateX(24px);
|
||||
animation: bodySlideIn 0.25s ease forwards;
|
||||
}
|
||||
|
||||
.title,
|
||||
.bodyCopy {
|
||||
text-align: center;
|
||||
opacity: 0;
|
||||
@@ -273,13 +262,13 @@
|
||||
opacity: 1;
|
||||
border: 1px solid rgba(255, 255, 255, 0.9);
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
color: #1f2933;
|
||||
color: var(--p-gray-800);
|
||||
box-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
|
||||
}
|
||||
|
||||
/* Modal content styles */
|
||||
.modalContent {
|
||||
background: var(--bg-surface);
|
||||
background: var(--c-surface);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@@ -299,7 +288,7 @@
|
||||
sans-serif;
|
||||
font-weight: 600;
|
||||
font-size: 22px;
|
||||
color: var(--onboarding-title);
|
||||
color: var(--c-text);
|
||||
}
|
||||
|
||||
/* Body text styles */
|
||||
@@ -313,7 +302,7 @@
|
||||
Arial,
|
||||
sans-serif;
|
||||
font-size: 16px;
|
||||
color: var(--onboarding-body);
|
||||
color: var(--c-text-muted);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
@@ -335,8 +324,8 @@
|
||||
}
|
||||
|
||||
.v2Badge {
|
||||
background: #dbefff;
|
||||
color: #2a4bff;
|
||||
background: var(--c-primary-tint);
|
||||
color: var(--c-accent-fg);
|
||||
padding: 3px 9px;
|
||||
border-radius: 6px;
|
||||
font-size: 12px;
|
||||
@@ -345,7 +334,7 @@
|
||||
|
||||
/* Icon styles */
|
||||
.heroIcon {
|
||||
color: var(--onboarding-title, #0f172a);
|
||||
color: var(--c-text, var(--p-gray-900));
|
||||
}
|
||||
|
||||
/* ===================================================================== */
|
||||
@@ -353,7 +342,7 @@
|
||||
/* ===================================================================== */
|
||||
|
||||
.card {
|
||||
background: var(--bg-surface);
|
||||
background: var(--c-surface);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
@@ -383,7 +372,7 @@
|
||||
font-size: 17px;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.01em;
|
||||
color: var(--onboarding-title, #0f172a);
|
||||
color: var(--c-text, var(--p-gray-900));
|
||||
}
|
||||
|
||||
.headerRight {
|
||||
@@ -395,8 +384,8 @@
|
||||
.stepPill {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--onboarding-body, #64748b);
|
||||
background: var(--bg-muted, #f1f5f9);
|
||||
color: var(--c-text-muted, var(--p-gray-500));
|
||||
background: var(--c-surface-sunken, var(--p-gray-100));
|
||||
padding: 5px 11px;
|
||||
border-radius: 9999px;
|
||||
white-space: nowrap;
|
||||
@@ -413,17 +402,20 @@
|
||||
flex: 1;
|
||||
height: 5px;
|
||||
border-radius: 9999px;
|
||||
background: var(--onboarding-step-inactive, #e2e8f0);
|
||||
background: var(--onboarding-step-inactive, var(--p-gray-250));
|
||||
transition: background 0.2s ease;
|
||||
}
|
||||
|
||||
.progressSegDone {
|
||||
background: var(--color-blue, #3b82f6);
|
||||
background: var(--c-primary, var(--p-blue-500));
|
||||
}
|
||||
|
||||
.divider {
|
||||
height: 1px;
|
||||
background: var(--border-subtle, rgba(15, 23, 42, 0.08));
|
||||
background: var(
|
||||
--c-border-subtle,
|
||||
color-mix(in srgb, var(--p-gray-900) 8%, transparent)
|
||||
);
|
||||
}
|
||||
|
||||
/* ---- content ---- */
|
||||
@@ -445,7 +437,12 @@
|
||||
min-height: 128px;
|
||||
border-radius: 14px;
|
||||
overflow: hidden;
|
||||
background: linear-gradient(155deg, #eef1fb 0%, #f6f4fc 55%, #fbf4f7 100%);
|
||||
background: linear-gradient(
|
||||
155deg,
|
||||
var(--p-tint-blue) 0%,
|
||||
var(--p-tint-violet) 55%,
|
||||
var(--p-tint-pink) 100%
|
||||
);
|
||||
}
|
||||
|
||||
.heroArt {
|
||||
@@ -459,7 +456,9 @@
|
||||
height: 62px;
|
||||
border-radius: 15px;
|
||||
object-fit: contain;
|
||||
filter: drop-shadow(0 10px 20px rgba(15, 23, 42, 0.16));
|
||||
filter: drop-shadow(
|
||||
0 10px 20px color-mix(in srgb, var(--p-gray-900) 16%, transparent)
|
||||
);
|
||||
}
|
||||
|
||||
.heroTile {
|
||||
@@ -470,7 +469,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 10px 22px rgba(15, 23, 42, 0.14);
|
||||
box-shadow: 0 10px 22px color-mix(in srgb, var(--p-gray-900) 14%, transparent);
|
||||
}
|
||||
|
||||
/* ---- title + body (left-aligned, clean) ---- */
|
||||
@@ -479,14 +478,14 @@
|
||||
font-weight: 600;
|
||||
letter-spacing: -0.01em;
|
||||
line-height: 1.3;
|
||||
color: var(--onboarding-title, #0f172a);
|
||||
color: var(--c-text, var(--p-gray-900));
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.bodyNew {
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
color: var(--onboarding-body, #475569);
|
||||
color: var(--c-text-muted, var(--p-gray-600));
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@@ -515,14 +514,15 @@
|
||||
|
||||
/* ---- dark theme surface tuning ---- */
|
||||
:global([data-mantine-color-scheme="dark"]) .heroPanel {
|
||||
background: linear-gradient(155deg, #1a2236 0%, #171e30 55%, #201a28 100%);
|
||||
background: linear-gradient(
|
||||
155deg,
|
||||
var(--p-navy-850) 0%,
|
||||
var(--p-navy-880) 55%,
|
||||
var(--p-plum-900) 100%
|
||||
);
|
||||
}
|
||||
|
||||
:global([data-mantine-color-scheme="dark"]) .heroTile {
|
||||
background: #0f1626;
|
||||
background: var(--p-navy-900);
|
||||
box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
:global([data-mantine-color-scheme="dark"]) .divider {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ export default function OnboardingSlideShell({
|
||||
content: {
|
||||
overflow: "hidden",
|
||||
border: "none",
|
||||
background: "var(--bg-surface)",
|
||||
background: "var(--c-surface)",
|
||||
maxHeight: "90vh",
|
||||
},
|
||||
}}
|
||||
@@ -193,7 +193,7 @@ export default function OnboardingSlideShell({
|
||||
|
||||
<div key={`body-${slideKey}`} className={styles.bodyNew}>
|
||||
{body}
|
||||
<style>{`.${styles.bodyNew} strong{color: var(--onboarding-title); font-weight: 600;}`}</style>
|
||||
<style>{`.${styles.bodyNew} strong{color: var(--c-text); font-weight: 600;}`}</style>
|
||||
</div>
|
||||
|
||||
<div className={styles.footer}>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
box-shadow:
|
||||
0 0 0 2px var(--mantine-primary-color-filled),
|
||||
0 0 15px var(--mantine-primary-color-filled),
|
||||
inset 0 0 15px rgba(59, 130, 246, 0.1);
|
||||
inset 0 0 15px color-mix(in srgb, var(--p-blue-500) 10%, transparent);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
@@ -23,13 +23,13 @@
|
||||
box-shadow:
|
||||
0 0 0 3px var(--mantine-primary-color-filled),
|
||||
0 0 20px var(--mantine-primary-color-filled),
|
||||
inset 0 0 20px rgba(59, 130, 246, 0.1);
|
||||
inset 0 0 20px color-mix(in srgb, var(--p-blue-500) 10%, transparent);
|
||||
}
|
||||
50% {
|
||||
box-shadow:
|
||||
0 0 0 3px var(--mantine-primary-color-filled),
|
||||
0 0 30px var(--mantine-primary-color-filled),
|
||||
inset 0 0 30px rgba(59, 130, 246, 0.2);
|
||||
inset 0 0 30px color-mix(in srgb, var(--p-blue-500) 20%, transparent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
pointer-events: none;
|
||||
box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
|
||||
box-shadow: 0 18px 36px color-mix(in srgb, var(--p-gray-900) 12%, transparent);
|
||||
animation-name: circleSway;
|
||||
animation-timing-function: ease-in-out;
|
||||
animation-iteration-count: infinite;
|
||||
|
||||
@@ -129,9 +129,9 @@ export const DesktopInstallTitle: React.FC<DesktopInstallTitleProps> = ({
|
||||
leftSection={iconKey ? <OsIcon os={iconKey} /> : undefined}
|
||||
style={{
|
||||
backgroundColor: isSelected
|
||||
? "var(--bg-muted, #f1f5f9)"
|
||||
? "var(--c-surface-sunken, #f1f5f9)"
|
||||
: "transparent",
|
||||
color: "var(--onboarding-title, #0f172a)",
|
||||
color: "var(--c-text, #0f172a)",
|
||||
fontWeight: isSelected ? 600 : 500,
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -125,7 +125,7 @@ function FirstLoginForm({
|
||||
icon="info-rounded"
|
||||
width={20}
|
||||
height={20}
|
||||
style={{ color: "#3B82F6", flexShrink: 0 }}
|
||||
style={{ color: "var(--p-blue-500)", flexShrink: 0 }}
|
||||
/>
|
||||
<span>
|
||||
{t(
|
||||
|
||||
@@ -26,6 +26,7 @@ import LocalIcon from "@app/components/shared/LocalIcon";
|
||||
import { BASE_PATH, withBasePath } from "@app/constants/app";
|
||||
import styles from "@app/components/onboarding/InitialOnboardingModal/InitialOnboardingModal.module.css";
|
||||
import { MfaSetupResponse } from "@app/responses/Mfa/MfaResponse";
|
||||
import i18n from "@app/i18n";
|
||||
|
||||
interface MFASetupSlideProps {
|
||||
onMfaSetupComplete?: () => void;
|
||||
@@ -62,12 +63,15 @@ function MFASetupContent({ onMfaSetupComplete }: MFASetupSlideProps) {
|
||||
const axiosError = err as { response?: { data?: { error?: string } } };
|
||||
setMfaError(
|
||||
axiosError.response?.data?.error ||
|
||||
"Unable to start two-factor setup. Please try again.",
|
||||
t(
|
||||
"onboarding.mfa.setupError",
|
||||
"Unable to start two-factor setup. Please try again.",
|
||||
),
|
||||
);
|
||||
} finally {
|
||||
setMfaLoading(false);
|
||||
}
|
||||
}, []);
|
||||
}, [t]);
|
||||
|
||||
useEffect(() => {
|
||||
setupCompleteRef.current = setupComplete;
|
||||
@@ -96,7 +100,12 @@ function MFASetupContent({ onMfaSetupComplete }: MFASetupSlideProps) {
|
||||
event.preventDefault();
|
||||
|
||||
if (!mfaSetupCode.trim()) {
|
||||
setMfaError("Enter the authentication code to continue.");
|
||||
setMfaError(
|
||||
t(
|
||||
"onboarding.mfa.enterCodeError",
|
||||
"Enter the authentication code to continue.",
|
||||
),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -110,13 +119,16 @@ function MFASetupContent({ onMfaSetupComplete }: MFASetupSlideProps) {
|
||||
const axiosError = err as { response?: { data?: { error?: string } } };
|
||||
setMfaError(
|
||||
axiosError.response?.data?.error ||
|
||||
"Unable to enable two-factor authentication. Check the code and try again.",
|
||||
t(
|
||||
"onboarding.mfa.enableError",
|
||||
"Unable to enable two-factor authentication. Check the code and try again.",
|
||||
),
|
||||
);
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
}
|
||||
},
|
||||
[mfaSetupCode, onMfaSetupComplete],
|
||||
[mfaSetupCode, onMfaSetupComplete, t],
|
||||
);
|
||||
|
||||
const isReady = Boolean(mfaSetupData);
|
||||
@@ -138,15 +150,30 @@ function MFASetupContent({ onMfaSetupComplete }: MFASetupSlideProps) {
|
||||
|
||||
<Stack gap="xs">
|
||||
<Text size="sm" fw={600}>
|
||||
Step-by-step
|
||||
{t("onboarding.mfa.stepByStep", "Step-by-step")}
|
||||
</Text>
|
||||
<ol className={styles.mfaSteps}>
|
||||
<li>Open Google Authenticator, Authy, or 1Password.</li>
|
||||
<li>Scan the QR code or enter the setup key below.</li>
|
||||
<li>Enter the 6-digit code from your app.</li>
|
||||
<li>
|
||||
{t(
|
||||
"onboarding.mfa.openAuthenticator",
|
||||
"Open Google Authenticator, Authy, or 1Password.",
|
||||
)}
|
||||
</li>
|
||||
<li>
|
||||
{t(
|
||||
"onboarding.mfa.scanQrCode",
|
||||
"Scan the QR code or enter the setup key below.",
|
||||
)}
|
||||
</li>
|
||||
<li>
|
||||
{t(
|
||||
"onboarding.mfa.enterCode",
|
||||
"Enter the 6-digit code from your app.",
|
||||
)}
|
||||
</li>
|
||||
</ol>
|
||||
<Text size="xs" c="dimmed">
|
||||
Setup key (manual entry)
|
||||
{t("onboarding.mfa.setupKey", "Setup key (manual entry)")}
|
||||
</Text>
|
||||
<TextInput
|
||||
value={mfaSetupData.secret ?? ""}
|
||||
@@ -163,9 +190,10 @@ function MFASetupContent({ onMfaSetupComplete }: MFASetupSlideProps) {
|
||||
<div className={styles.mfaCard}>
|
||||
<Stack gap="md">
|
||||
<Text size="sm" c="dimmed">
|
||||
Secure your account by linking an authenticator app. Scan the QR
|
||||
code or enter the setup key, then confirm the 6-digit code to
|
||||
finish.
|
||||
{t(
|
||||
"onboarding.mfa.description",
|
||||
"Secure your account by linking an authenticator app. Scan the QR code or enter the setup key, then confirm the 6-digit code to finish.",
|
||||
)}
|
||||
</Text>
|
||||
|
||||
{mfaError && (
|
||||
@@ -215,7 +243,7 @@ function MFASetupContent({ onMfaSetupComplete }: MFASetupSlideProps) {
|
||||
onClick={fetchMfaSetup}
|
||||
disabled={mfaLoading || submitting || setupComplete}
|
||||
>
|
||||
Regenerate QR code
|
||||
{t("onboarding.mfa.regenerateQrCode", "Regenerate QR code")}
|
||||
</Button>
|
||||
<Button
|
||||
type="submit"
|
||||
@@ -224,16 +252,19 @@ function MFASetupContent({ onMfaSetupComplete }: MFASetupSlideProps) {
|
||||
!isReady || setupComplete || mfaSetupCode.length < 6
|
||||
}
|
||||
>
|
||||
Enable MFA
|
||||
{t("onboarding.mfa.enable", "Enable MFA")}
|
||||
</Button>
|
||||
<Button variant="secondary" type="button" onClick={onLogout}>
|
||||
Logout
|
||||
{t("onboarding.mfa.logout", "Logout")}
|
||||
</Button>
|
||||
</Group>
|
||||
|
||||
{setupComplete && (
|
||||
<Alert color="green" variant="light">
|
||||
MFA has been enabled. You can now continue.
|
||||
{t(
|
||||
"onboarding.mfa.success",
|
||||
"MFA has been enabled. You can now continue.",
|
||||
)}
|
||||
</Alert>
|
||||
)}
|
||||
</Stack>
|
||||
@@ -249,7 +280,7 @@ export default function MFASetupSlide({
|
||||
}: MFASetupSlideProps = {}): SlideConfig {
|
||||
return {
|
||||
key: "mfa-setup-slide",
|
||||
title: "Multi-Factor Authentication Setup",
|
||||
title: i18n.t("onboarding.mfa.title", "Multi-Factor Authentication Setup"),
|
||||
body: <MFASetupContent onMfaSetupComplete={onMfaSetupComplete} />,
|
||||
background: {
|
||||
gradientStops: ["#059669", "#0891B2"], // Green to teal - security/trust colors
|
||||
|
||||
@@ -26,7 +26,7 @@ export default function SecurityCheckSlide({
|
||||
icon="error"
|
||||
width={20}
|
||||
height={20}
|
||||
style={{ color: "#F04438", flexShrink: 0 }}
|
||||
style={{ color: "var(--p-red-500)", flexShrink: 0 }}
|
||||
/>
|
||||
<span>
|
||||
{i18n.t(
|
||||
|
||||
@@ -28,15 +28,15 @@
|
||||
|
||||
.selectionBox {
|
||||
position: absolute;
|
||||
border: 2px dashed #3b82f6;
|
||||
background-color: rgba(59, 130, 246, 0.1);
|
||||
border: 2px dashed var(--c-primary);
|
||||
background-color: color-mix(in srgb, var(--c-primary) 10%, transparent);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.dropIndicator {
|
||||
position: absolute;
|
||||
width: 4px;
|
||||
background-color: rgba(96, 165, 250, 0.8);
|
||||
background-color: color-mix(in srgb, var(--c-primary) 80%, transparent);
|
||||
border-radius: 2px;
|
||||
pointer-events: none;
|
||||
}
|
||||
@@ -50,8 +50,8 @@
|
||||
position: absolute;
|
||||
top: -8px;
|
||||
right: -8px;
|
||||
background-color: #3b82f6;
|
||||
color: #ffffff;
|
||||
background-color: var(--c-primary);
|
||||
color: var(--c-text-on-primary);
|
||||
border-radius: 50%;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
|
||||
@@ -241,7 +241,7 @@ const FileThumbnail = ({
|
||||
<CheckboxIndicator
|
||||
checked={isSelected}
|
||||
onChange={() => onToggleFile(file.id)}
|
||||
color="var(--checkbox-checked-bg)"
|
||||
color="var(--c-primary)"
|
||||
/>
|
||||
) : (
|
||||
<div className={styles.unsupportedPill}>
|
||||
@@ -372,7 +372,7 @@ const FileThumbnail = ({
|
||||
objectFit: "contain",
|
||||
borderRadius: 0,
|
||||
background: "#ffffff",
|
||||
border: "1px solid var(--border-default)",
|
||||
border: "1px solid var(--c-border)",
|
||||
display: "block",
|
||||
marginLeft: "auto",
|
||||
marginRight: "auto",
|
||||
|
||||
@@ -21,13 +21,13 @@
|
||||
|
||||
@keyframes pageMovedHighlight {
|
||||
0% {
|
||||
background-color: rgba(59, 130, 246, 0.32);
|
||||
background-color: color-mix(in srgb, var(--c-primary) 32%, transparent);
|
||||
}
|
||||
60% {
|
||||
background-color: rgba(59, 130, 246, 0.12);
|
||||
background-color: color-mix(in srgb, var(--c-primary) 12%, transparent);
|
||||
}
|
||||
100% {
|
||||
background-color: rgba(59, 130, 246, 0);
|
||||
background-color: color-mix(in srgb, var(--c-primary) 0%, transparent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
/* Action styles */
|
||||
.actionRow:hover {
|
||||
background: var(--hover-bg);
|
||||
background: var(--c-hover);
|
||||
}
|
||||
|
||||
.actionDanger {
|
||||
@@ -72,7 +72,7 @@
|
||||
|
||||
.actionsDivider {
|
||||
height: 1px;
|
||||
background: var(--border-default);
|
||||
background: var(--c-border);
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
|
||||
.unsupportedPill {
|
||||
margin-left: 1.75rem;
|
||||
background: #6b7280;
|
||||
background: var(--p-gray-500);
|
||||
color: white;
|
||||
padding: 4px 8px;
|
||||
border-radius: 12px;
|
||||
|
||||
@@ -121,8 +121,8 @@ const PageEditorControls = ({
|
||||
borderBottomLeftRadius: 0,
|
||||
borderBottomRightRadius: 0,
|
||||
boxShadow: "0 -2px 8px rgba(0,0,0,0.04)",
|
||||
backgroundColor: "var(--bg-toolbar)",
|
||||
border: "1px solid var(--border-default)",
|
||||
backgroundColor: "var(--c-bg-raised)",
|
||||
border: "1px solid var(--c-border)",
|
||||
borderRadius: "16px 16px 0 0",
|
||||
pointerEvents: "auto",
|
||||
minWidth: 360,
|
||||
|
||||
+26
-58
@@ -31,7 +31,7 @@
|
||||
|
||||
.rightCol {
|
||||
width: 8rem;
|
||||
border-left: 0.0625rem solid var(--border-default);
|
||||
border-left: 0.0625rem solid var(--c-border);
|
||||
padding-left: 0.75rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -47,15 +47,15 @@
|
||||
width: 100%;
|
||||
border-radius: 1.25rem;
|
||||
border: 0.0625rem solid var(--bulk-card-border);
|
||||
background-color: var(--bulk-card-bg);
|
||||
color: var(--text-primary);
|
||||
background-color: var(--c-surface);
|
||||
color: var(--c-text);
|
||||
transition: all 0.2s ease;
|
||||
min-height: 2rem;
|
||||
}
|
||||
|
||||
.operatorChip:hover:not(:disabled) {
|
||||
border-color: var(--bulk-card-hover-border);
|
||||
background-color: var(--hover-bg);
|
||||
background-color: var(--c-hover);
|
||||
transform: translateY(-0.0625rem);
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
@@ -70,24 +70,12 @@
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
:global([data-mantine-color-scheme="dark"]) .operatorChip {
|
||||
background-color: var(--bulk-card-bg);
|
||||
border-color: var(--bulk-card-border);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
:global([data-mantine-color-scheme="dark"]) .operatorChip:hover:not(:disabled) {
|
||||
background-color: var(--hover-bg);
|
||||
border-color: var(--bulk-card-hover-border);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.dropdownHeader {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0.75rem;
|
||||
border-bottom: 0.0625rem solid var(--border-default);
|
||||
border-bottom: 0.0625rem solid var(--c-border);
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
@@ -111,7 +99,7 @@
|
||||
}
|
||||
|
||||
.chevron {
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
}
|
||||
|
||||
/* Icon-based chevrons */
|
||||
@@ -151,13 +139,13 @@
|
||||
.selectedList {
|
||||
max-height: 8rem;
|
||||
overflow: auto;
|
||||
background-color: var(--bg-raised);
|
||||
border: 0.0625rem solid var(--border-default);
|
||||
background-color: var(--c-surface-raised);
|
||||
border: 0.0625rem solid var(--c-border);
|
||||
border-radius: 0.75rem;
|
||||
padding: 0.5rem 0.75rem;
|
||||
margin-top: 0.5rem;
|
||||
min-width: 24rem;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
}
|
||||
|
||||
.selectedText {
|
||||
@@ -175,7 +163,7 @@
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0.75rem;
|
||||
border-bottom: 0.0625rem solid var(--border-default);
|
||||
border-bottom: 0.0625rem solid var(--c-border);
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
@@ -193,26 +181,18 @@
|
||||
}
|
||||
|
||||
.advancedItem:hover {
|
||||
background-color: var(--hover-bg);
|
||||
}
|
||||
|
||||
:global([data-mantine-color-scheme="dark"]) .advancedItem:hover {
|
||||
background-color: var(--hover-bg);
|
||||
background-color: var(--c-hover);
|
||||
}
|
||||
|
||||
.advancedCard {
|
||||
background-color: var(--bulk-card-bg);
|
||||
background-color: var(--c-surface);
|
||||
border: none;
|
||||
border-radius: 0.75rem;
|
||||
padding: 0.25rem;
|
||||
margin-bottom: 0.5rem;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
:global([data-mantine-color-scheme="dark"]) .advancedCard {
|
||||
background-color: var(--bulk-card-bg);
|
||||
color: var(--c-text);
|
||||
}
|
||||
|
||||
.inputGroup {
|
||||
@@ -226,24 +206,17 @@
|
||||
.applyButton {
|
||||
min-width: 4rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* Style inputs and buttons within advanced cards to match bg-raised */
|
||||
.advancedCard :global(.mantine-NumberInput-input) {
|
||||
background-color: var(--bg-raised) !important;
|
||||
border-color: var(--border-default) !important;
|
||||
color: var(--text-primary) !important;
|
||||
}
|
||||
|
||||
} /* Style inputs and buttons within advanced cards to match bg-raised */
|
||||
.advancedCard :global(.mantine-NumberInput-input),
|
||||
.advancedCard :global(.mantine-Button-root) {
|
||||
background-color: var(--bg-raised) !important;
|
||||
border-color: var(--border-default) !important;
|
||||
color: var(--text-primary) !important;
|
||||
background-color: var(--c-surface-raised) !important;
|
||||
border-color: var(--c-border) !important;
|
||||
color: var(--c-text) !important;
|
||||
}
|
||||
|
||||
.advancedCard :global(.mantine-Button-root:hover) {
|
||||
background-color: var(--hover-bg) !important;
|
||||
border-color: var(--border-strong) !important;
|
||||
background-color: var(--c-hover) !important;
|
||||
border-color: var(--c-border-strong) !important;
|
||||
}
|
||||
|
||||
/* Error helper text above the input */
|
||||
@@ -254,8 +227,8 @@
|
||||
|
||||
/* Compact error container for inline tool settings */
|
||||
.errorCompact {
|
||||
background-color: var(--bg-raised);
|
||||
border: 0.0625rem solid var(--border-default);
|
||||
background-color: var(--c-surface-raised);
|
||||
border: 0.0625rem solid var(--c-border);
|
||||
border-radius: 0.75rem;
|
||||
padding: 0.5rem 0.75rem;
|
||||
margin-top: 0.5rem;
|
||||
@@ -271,11 +244,6 @@
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Dark-mode adjustments */
|
||||
:global([data-mantine-color-scheme="dark"]) .selectedList {
|
||||
background-color: var(--bg-raised);
|
||||
}
|
||||
|
||||
/* Small screens: allow the section to shrink instead of enforcing a large min width */
|
||||
@media (max-width: 480px) {
|
||||
.panelGroup,
|
||||
@@ -290,16 +258,16 @@
|
||||
.panelContainer {
|
||||
max-height: 95vh;
|
||||
overflow: auto;
|
||||
background-color: var(--bulk-panel-bg);
|
||||
color: var(--text-primary);
|
||||
background-color: var(--c-surface);
|
||||
color: var(--c-text);
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
/* Override Mantine Popover dropdown background */
|
||||
:global(.mantine-Popover-dropdown) {
|
||||
background-color: var(--bulk-panel-bg) !important;
|
||||
background-color: var(--c-surface) !important;
|
||||
border-color: var(--bulk-card-border) !important;
|
||||
color: var(--text-primary) !important;
|
||||
color: var(--c-text) !important;
|
||||
}
|
||||
|
||||
/* Override Mantine Switch outline */
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ const OperatorsSection = ({
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Text size="xs" c="var(--text-muted)" fw={500} mb="xs">
|
||||
<Text size="xs" c="var(--c-text-subtle)" fw={500} mb="xs">
|
||||
{t("bulkSelection.keywords.title", "Keywords")}:
|
||||
</Text>
|
||||
<Group gap="sm" wrap="nowrap">
|
||||
|
||||
+2
-2
@@ -44,7 +44,7 @@ const PageSelectionInput = ({
|
||||
icon="gpp-maybe-outline-rounded"
|
||||
width="1rem"
|
||||
height="1rem"
|
||||
style={{ color: "var(--text-instruction)" }}
|
||||
style={{ color: "var(--c-accent-fg)" }}
|
||||
/>
|
||||
<Text>
|
||||
{t("bulkSelection.pageSelection.title", "Page Selection")}
|
||||
@@ -53,7 +53,7 @@ const PageSelectionInput = ({
|
||||
</Tooltip>
|
||||
{typeof advancedOpened === "boolean" && (
|
||||
<Flex align="center" gap="xs">
|
||||
<Text size="sm" c="var(--text-secondary)">
|
||||
<Text size="sm" c="var(--c-text-muted)">
|
||||
{t("bulkSelection.advanced.title", "Advanced")}
|
||||
</Text>
|
||||
<Switch
|
||||
|
||||
@@ -50,7 +50,7 @@ const SelectPages = ({
|
||||
|
||||
return (
|
||||
<div className={classes.advancedCard}>
|
||||
<Text size="sm" fw={600} c="var(--text-secondary)" mb="xs">
|
||||
<Text size="sm" fw={600} c="var(--c-text-muted)" mb="xs">
|
||||
{title}
|
||||
</Text>
|
||||
{error && (
|
||||
|
||||
@@ -63,7 +63,8 @@
|
||||
}
|
||||
|
||||
.modal-nav-scroll:hover {
|
||||
scrollbar-color: rgba(128, 128, 128, 0.5) transparent;
|
||||
scrollbar-color: color-mix(in srgb, var(--p-gray-mid) 50%, transparent)
|
||||
transparent;
|
||||
}
|
||||
|
||||
.modal-nav-scroll::-webkit-scrollbar {
|
||||
@@ -81,11 +82,11 @@
|
||||
}
|
||||
|
||||
.modal-nav-scroll:hover::-webkit-scrollbar-thumb {
|
||||
background-color: rgba(128, 128, 128, 0.5);
|
||||
background-color: color-mix(in srgb, var(--p-gray-mid) 50%, transparent);
|
||||
}
|
||||
|
||||
.modal-nav-scroll::-webkit-scrollbar-thumb:hover {
|
||||
background-color: rgba(128, 128, 128, 0.7);
|
||||
background-color: color-mix(in srgb, var(--p-gray-mid) 70%, transparent);
|
||||
}
|
||||
|
||||
.modal-nav-section {
|
||||
@@ -131,7 +132,8 @@
|
||||
}
|
||||
|
||||
.modal-content-scroll:hover {
|
||||
scrollbar-color: rgba(128, 128, 128, 0.5) transparent;
|
||||
scrollbar-color: color-mix(in srgb, var(--p-gray-mid) 50%, transparent)
|
||||
transparent;
|
||||
}
|
||||
|
||||
.modal-content-scroll::-webkit-scrollbar {
|
||||
@@ -149,11 +151,11 @@
|
||||
}
|
||||
|
||||
.modal-content-scroll:hover::-webkit-scrollbar-thumb {
|
||||
background-color: rgba(128, 128, 128, 0.5);
|
||||
background-color: color-mix(in srgb, var(--p-gray-mid) 50%, transparent);
|
||||
}
|
||||
|
||||
.modal-content-scroll::-webkit-scrollbar-thumb:hover {
|
||||
background-color: rgba(128, 128, 128, 0.7);
|
||||
background-color: color-mix(in srgb, var(--p-gray-mid) 70%, transparent);
|
||||
}
|
||||
|
||||
.modal-header {
|
||||
@@ -212,8 +214,8 @@
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: var(--modal-content-bg);
|
||||
border-top: 1px solid var(--modal-header-border);
|
||||
background: var(--c-surface);
|
||||
border-top: 1px solid var(--c-border-subtle);
|
||||
padding: 1rem 2rem;
|
||||
margin: 0 -2rem;
|
||||
margin-bottom: -1rem;
|
||||
|
||||
@@ -165,13 +165,13 @@ const AppConfigModalInner: React.FC<AppConfigModalProps> = ({
|
||||
|
||||
const colors = useMemo(
|
||||
() => ({
|
||||
navBg: "var(--modal-nav-bg)",
|
||||
sectionTitle: "var(--modal-nav-section-title)",
|
||||
navBg: "var(--c-bg-raised)",
|
||||
sectionTitle: "var(--c-text-subtle)",
|
||||
navItem: "var(--modal-nav-item)",
|
||||
navItemActive: "var(--modal-nav-item-active)",
|
||||
navItemActiveBg: "var(--modal-nav-item-active-bg)",
|
||||
contentBg: "var(--modal-content-bg)",
|
||||
headerBorder: "var(--modal-header-border)",
|
||||
navItemActive: "var(--c-accent-fg)",
|
||||
navItemActiveBg: "var(--c-primary-subtle)",
|
||||
contentBg: "var(--c-surface)",
|
||||
headerBorder: "var(--c-border-subtle)",
|
||||
}),
|
||||
[],
|
||||
);
|
||||
|
||||
@@ -9,15 +9,15 @@
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
border-radius: var(--radius-sm);
|
||||
color: var(--color-text-4);
|
||||
color: var(--c-text-subtle);
|
||||
transition:
|
||||
background var(--motion-fast),
|
||||
color var(--motion-fast);
|
||||
}
|
||||
|
||||
.app-switch-btn:hover {
|
||||
background: var(--color-bg-hover);
|
||||
color: var(--color-text-2);
|
||||
background: var(--c-hover);
|
||||
color: var(--c-text-muted);
|
||||
}
|
||||
|
||||
.app-switch-icon {
|
||||
|
||||
@@ -79,8 +79,8 @@ const Badge: React.FC<BadgeProps> = ({
|
||||
|
||||
// Default styling
|
||||
return {
|
||||
background: "var(--tool-header-badge-bg)",
|
||||
color: "var(--tool-header-badge-text)",
|
||||
background: "var(--c-surface-raised)",
|
||||
color: "var(--c-accent-fg)",
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -78,7 +78,11 @@ export default function EditableSecretField({
|
||||
)}
|
||||
{description && (
|
||||
<p
|
||||
style={{ margin: "4px 0 12px 0", fontSize: "0.75rem", color: "#666" }}
|
||||
style={{
|
||||
margin: "4px 0 12px 0",
|
||||
fontSize: "0.75rem",
|
||||
color: "var(--c-text-muted)",
|
||||
}}
|
||||
>
|
||||
{description}
|
||||
</p>
|
||||
|
||||
@@ -117,7 +117,7 @@ export default class ErrorBoundary extends React.Component<
|
||||
style={{
|
||||
fontSize: "0.75rem",
|
||||
overflow: "auto",
|
||||
backgroundColor: "#f5f5f5",
|
||||
backgroundColor: "var(--p-gray-100)",
|
||||
padding: "1rem",
|
||||
borderRadius: "4px",
|
||||
maxHeight: "300px",
|
||||
|
||||
@@ -74,7 +74,7 @@ const FileCard = ({
|
||||
<Stack gap={6} align="center">
|
||||
<Box
|
||||
style={{
|
||||
border: "2px solid #e0e0e0",
|
||||
border: "2px solid var(--c-border)",
|
||||
borderRadius: 8,
|
||||
width: 90,
|
||||
height: 120,
|
||||
@@ -82,7 +82,7 @@ const FileCard = ({
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
margin: "0 auto",
|
||||
background: "#fafbfc",
|
||||
background: "var(--c-surface)",
|
||||
position: "relative",
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -54,8 +54,8 @@ export const FileDropdownMenu: React.FC<FileDropdownMenuProps> = ({
|
||||
</Menu.Target>
|
||||
<Menu.Dropdown
|
||||
style={{
|
||||
backgroundColor: "var(--bg-file-manager)",
|
||||
border: "1px solid var(--border-subtle)",
|
||||
backgroundColor: "var(--c-bg)",
|
||||
border: "1px solid var(--c-border-subtle)",
|
||||
borderRadius: "8px",
|
||||
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)",
|
||||
maxHeight: "50vh",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/* ── Trigger ─────────────────────────────────────── */
|
||||
.trigger {
|
||||
border: 1px solid var(--border-default);
|
||||
border: 1px solid var(--c-border);
|
||||
border-radius: var(--radius-md);
|
||||
padding: 0.5rem 0.75rem;
|
||||
background: var(--bg-surface);
|
||||
background: var(--c-surface);
|
||||
cursor: pointer;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
@@ -47,8 +47,8 @@
|
||||
justify-content: space-between;
|
||||
padding: 0.3rem 0.45rem;
|
||||
gap: 0.4rem;
|
||||
border-bottom: 1px solid var(--border-default);
|
||||
background: var(--bg-surface);
|
||||
border-bottom: 1px solid var(--c-border);
|
||||
background: var(--c-surface);
|
||||
}
|
||||
|
||||
.tabGroup {
|
||||
@@ -66,7 +66,7 @@
|
||||
min-width: 0;
|
||||
min-height: 24px;
|
||||
max-height: 26px;
|
||||
border: 1px solid var(--border-default);
|
||||
border: 1px solid var(--c-border);
|
||||
border-radius: var(--radius-sm);
|
||||
background: color-mix(
|
||||
in srgb,
|
||||
@@ -185,8 +185,8 @@
|
||||
/* ── Search / filter row ─────────────────────────── */
|
||||
.searchRow {
|
||||
padding: 0.3rem 0.45rem;
|
||||
border-bottom: 1px solid var(--border-default);
|
||||
background: var(--bg-surface);
|
||||
border-bottom: 1px solid var(--c-border);
|
||||
background: var(--c-surface);
|
||||
}
|
||||
|
||||
.searchInput {
|
||||
@@ -195,7 +195,7 @@
|
||||
height: 1.625rem;
|
||||
padding: 0 0.5rem;
|
||||
font-size: 0.7rem;
|
||||
border: 1px solid var(--border-subtle, var(--border-default));
|
||||
border: 1px solid var(--c-border-subtle, var(--c-border));
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--mantine-color-default-hover);
|
||||
color: var(--mantine-color-text);
|
||||
@@ -233,7 +233,7 @@
|
||||
cursor: pointer;
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-top: 1px solid var(--border-default);
|
||||
border-top: 1px solid var(--c-border);
|
||||
text-align: left;
|
||||
transition: background 0.08s ease;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* ========== FILE SIDEBAR ========== */
|
||||
|
||||
.file-sidebar {
|
||||
background-color: var(--bg-toolbar);
|
||||
border-right: 1px solid var(--border-subtle);
|
||||
background-color: var(--c-bg-raised);
|
||||
border-right: 1px solid var(--c-border-subtle);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
/* ---- Native file drag-and-drop ---- */
|
||||
.file-sidebar[data-file-drag-over] {
|
||||
outline: 2px dashed var(--mantine-color-blue-6, #3b82f6);
|
||||
outline: 2px dashed var(--mantine-color-blue-6, var(--p-blue-500));
|
||||
outline-offset: -4px;
|
||||
}
|
||||
|
||||
@@ -42,20 +42,20 @@
|
||||
pointer-events: none;
|
||||
background-color: color-mix(
|
||||
in srgb,
|
||||
var(--mantine-color-blue-6, #3b82f6) 12%,
|
||||
var(--bg-toolbar)
|
||||
var(--mantine-color-blue-6, var(--p-blue-500)) 12%,
|
||||
var(--c-bg-raised)
|
||||
);
|
||||
}
|
||||
|
||||
.file-sidebar-drop-overlay-icon {
|
||||
color: var(--mantine-color-blue-6, #3b82f6) !important;
|
||||
color: var(--mantine-color-blue-6, var(--p-blue-500)) !important;
|
||||
font-size: 28px !important;
|
||||
}
|
||||
|
||||
.file-sidebar-drop-overlay-text {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: var(--mantine-color-blue-6, #3b82f6);
|
||||
color: var(--mantine-color-blue-6, var(--p-blue-500));
|
||||
}
|
||||
|
||||
/* ---- Header ---- */
|
||||
@@ -75,11 +75,11 @@
|
||||
/* Icons stay left-aligned during animation; overflow:hidden on inner clips text naturally */
|
||||
|
||||
.file-sidebar-header:hover {
|
||||
background-color: var(--hover-bg);
|
||||
background-color: var(--c-hover);
|
||||
}
|
||||
|
||||
.file-sidebar-menu-icon {
|
||||
color: var(--text-muted) !important;
|
||||
color: var(--c-text-subtle) !important;
|
||||
font-size: 18px !important;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
@@ -129,11 +129,11 @@
|
||||
}
|
||||
|
||||
.file-sidebar-search-row:not(.active):hover {
|
||||
background-color: var(--hover-bg);
|
||||
background-color: var(--c-hover);
|
||||
}
|
||||
|
||||
.file-sidebar-search-icon {
|
||||
color: var(--text-muted) !important;
|
||||
color: var(--c-text-subtle) !important;
|
||||
font-size: 18px !important;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
@@ -148,19 +148,19 @@
|
||||
border: none;
|
||||
outline: none;
|
||||
font-size: 14px;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
margin-left: 12px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.file-sidebar-search-input::placeholder {
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
}
|
||||
|
||||
.file-sidebar-search-label {
|
||||
margin-left: 12px;
|
||||
font-size: 14px;
|
||||
color: var(--text-secondary);
|
||||
color: var(--c-text-muted);
|
||||
}
|
||||
|
||||
/* ---- Scrollable content ---- */
|
||||
@@ -199,7 +199,7 @@
|
||||
}
|
||||
|
||||
.file-sidebar-action-row:hover {
|
||||
background-color: var(--hover-bg);
|
||||
background-color: var(--c-hover);
|
||||
}
|
||||
|
||||
.file-sidebar-action-row.disabled {
|
||||
@@ -212,7 +212,7 @@
|
||||
}
|
||||
|
||||
.file-sidebar-action-icon {
|
||||
color: var(--text-muted) !important;
|
||||
color: var(--c-text-subtle) !important;
|
||||
font-size: 18px !important;
|
||||
flex-shrink: 0;
|
||||
display: inline-flex;
|
||||
@@ -234,7 +234,7 @@
|
||||
.file-sidebar-action-label {
|
||||
margin-left: 12px;
|
||||
font-size: 14px;
|
||||
color: var(--text-secondary);
|
||||
color: var(--c-text-muted);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@
|
||||
}
|
||||
|
||||
.file-sidebar-cloud-row:not(.disabled):hover {
|
||||
background-color: var(--hover-bg);
|
||||
background-color: var(--c-hover);
|
||||
}
|
||||
|
||||
.file-sidebar-cloud-row.disabled {
|
||||
@@ -320,19 +320,19 @@
|
||||
border: none;
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
color: var(--text-default, var(--color-text-1));
|
||||
color: var(--text-default, var(--c-text));
|
||||
border-radius: 0;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
text-align: left;
|
||||
}
|
||||
.file-sidebar-group-header:hover {
|
||||
background: var(--hover-bg, var(--color-bg-hover));
|
||||
background: var(--c-hover, var(--c-hover));
|
||||
}
|
||||
|
||||
.file-sidebar-group-icon {
|
||||
flex: none;
|
||||
color: var(--text-muted, var(--color-text-3));
|
||||
color: var(--c-text-subtle, var(--c-text-subtle));
|
||||
}
|
||||
|
||||
.file-sidebar-group-label {
|
||||
@@ -347,7 +347,7 @@
|
||||
flex: none;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
color: var(--text-muted, var(--color-text-3));
|
||||
color: var(--c-text-subtle, var(--c-text-subtle));
|
||||
}
|
||||
|
||||
/* Full-width, flat rows: no inset, no radius, so the hover/selected highlight
|
||||
@@ -363,7 +363,10 @@
|
||||
}
|
||||
/* Hover reads neutral (not the default blue tint); selected stays blue. */
|
||||
.file-sidebar-group-items .file-sidebar-file-item:hover:not(.selected) {
|
||||
background-color: var(--color-bg-hover, rgba(120, 120, 120, 0.1));
|
||||
background-color: var(
|
||||
--c-hover,
|
||||
color-mix(in srgb, var(--p-gray-mid) 10%, transparent)
|
||||
);
|
||||
}
|
||||
/* A plain circle where the selected check sits — on hover, and blue when selected. */
|
||||
.file-sidebar-group-items .file-sidebar-file-checkbox-hover,
|
||||
@@ -413,7 +416,7 @@
|
||||
border: none;
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
color: var(--color-blue, #2563eb);
|
||||
color: var(--c-primary, var(--p-blue-600));
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
border-radius: 6px;
|
||||
@@ -424,7 +427,10 @@
|
||||
display: none;
|
||||
}
|
||||
.file-sidebar-view-all:hover {
|
||||
background: var(--color-bg-hover, rgba(120, 120, 120, 0.1));
|
||||
background: var(
|
||||
--c-hover,
|
||||
color-mix(in srgb, var(--p-gray-mid) 10%, transparent)
|
||||
);
|
||||
}
|
||||
|
||||
.file-sidebar-file-list::-webkit-scrollbar {
|
||||
@@ -438,11 +444,11 @@
|
||||
border-radius: 2px;
|
||||
}
|
||||
.file-sidebar-file-list::-webkit-scrollbar-thumb:hover {
|
||||
background: var(--text-muted);
|
||||
background: var(--c-text-subtle);
|
||||
}
|
||||
|
||||
.file-sidebar-section-divider {
|
||||
border-top: 1px solid var(--border-subtle);
|
||||
border-top: 1px solid var(--c-border-subtle);
|
||||
margin: 10px 14px 6px 14px;
|
||||
}
|
||||
|
||||
@@ -457,7 +463,7 @@
|
||||
|
||||
.file-sidebar-section-header {
|
||||
position: relative;
|
||||
border-top: 1px solid var(--border-subtle);
|
||||
border-top: 1px solid var(--c-border-subtle);
|
||||
padding-top: 10px;
|
||||
margin-top: 4px;
|
||||
flex-shrink: 0;
|
||||
@@ -467,7 +473,7 @@
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.02em;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
@@ -481,7 +487,7 @@
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.file-sidebar-bulk-add-count {
|
||||
@@ -490,19 +496,23 @@
|
||||
.file-sidebar-bulk-add-track {
|
||||
height: 3px;
|
||||
border-radius: 999px;
|
||||
background: color-mix(in srgb, var(--color-blue, #3b82f6) 15%, transparent);
|
||||
background: color-mix(
|
||||
in srgb,
|
||||
var(--c-primary, var(--p-blue-500)) 15%,
|
||||
transparent
|
||||
);
|
||||
overflow: hidden;
|
||||
}
|
||||
.file-sidebar-bulk-add-bar {
|
||||
height: 100%;
|
||||
border-radius: 999px;
|
||||
background: var(--color-blue, #3b82f6);
|
||||
background: var(--c-primary, var(--p-blue-500));
|
||||
transition: width 0.15s ease-out;
|
||||
}
|
||||
|
||||
.file-sidebar-section-count {
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
}
|
||||
|
||||
.file-sidebar-section-btn {
|
||||
@@ -515,7 +525,7 @@
|
||||
background: transparent;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
padding: 0;
|
||||
outline: none;
|
||||
transition:
|
||||
@@ -525,13 +535,13 @@
|
||||
}
|
||||
|
||||
.file-sidebar-section-btn:focus-visible {
|
||||
outline: 2px solid #3b82f6;
|
||||
outline: 2px solid var(--c-primary);
|
||||
outline-offset: 1px;
|
||||
}
|
||||
|
||||
.file-sidebar-section-btn:hover {
|
||||
background-color: var(--hover-bg);
|
||||
color: var(--text-primary);
|
||||
background-color: var(--c-hover);
|
||||
color: var(--c-text);
|
||||
}
|
||||
|
||||
.file-sidebar-section-btn-external {
|
||||
@@ -576,7 +586,7 @@
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 8px 10px;
|
||||
border-top: 1px solid var(--border-subtle);
|
||||
border-top: 1px solid var(--c-border-subtle);
|
||||
flex-shrink: 0;
|
||||
min-height: 48px;
|
||||
}
|
||||
@@ -587,7 +597,7 @@
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 50%;
|
||||
background-color: var(--mantine-color-blue-6, #3b82f6);
|
||||
background-color: var(--mantine-color-blue-6, var(--p-blue-500));
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
@@ -615,7 +625,7 @@
|
||||
flex: 1;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: var(--text-primary);
|
||||
color: var(--c-text);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@@ -623,11 +633,11 @@
|
||||
}
|
||||
|
||||
.file-sidebar-bottom-bar[role="button"]:hover {
|
||||
background-color: var(--hover-bg);
|
||||
background-color: var(--c-hover);
|
||||
}
|
||||
|
||||
.file-sidebar-bottom-bar[role="button"]:focus-visible {
|
||||
outline: 2px solid #3b82f6;
|
||||
outline: 2px solid var(--c-primary);
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
@@ -638,7 +648,7 @@
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 6px;
|
||||
color: var(--text-muted);
|
||||
color: var(--c-text-subtle);
|
||||
padding: 0;
|
||||
flex-shrink: 0;
|
||||
margin-left: auto;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user