feat: add core domain types for Photo Gallery SDK including media items, albums, and annotations

This commit is contained in:
2026-07-23 07:39:01 +05:30
parent 7bcd1a2a2d
commit 2613c767a6
107 changed files with 20699 additions and 7 deletions
+77 -1
View File
@@ -1140,4 +1140,80 @@
.dash-root .ai-bubble { max-width: 86%; }
.dash-root .ai-view { height: calc(100vh - 150px); }
}
/* =========================================================================
Smart Gallery — the embedded @photo-gallery/sdk surface.
The SDK is themed entirely through the token map in lib/gallery-api.ts
(--apg-* -> this file's own vars), so the rules below only handle the
host chrome: sizing, the demo banner, and the load/error placeholders.
========================================================================= */
/* The gallery is the one view that wants the whole viewport: it has its own sidebar, toolbar and
scrollers, so any height we leave on the table is wasted chrome. The old big PageHead cost ~90px;
a slim header (~40px) + compact banner + tight gaps hand almost all of that back to the shell.
96px = the dashboard's top padding + the slim header row; `.gal-shell` (flex:1; min-height:0)
consumes whatever is left after the header and the optional demo banner. */
.dash-root .gal { display: flex; flex-direction: column; gap: 10px; height: calc(100vh - 96px); min-height: 700px; }
/* Slim inline header — replaces the tall PageHead. One row, ~40px, so the shell keeps the height. */
.dash-root .gal-head { display: flex; align-items: center; gap: 10px; min-height: 36px; flex: 0 0 auto; }
.dash-root .gal-head-ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: var(--grad-brand); box-shadow: var(--glow-orange); flex: 0 0 auto; }
.dash-root .gal-head-title { font-size: 16px; font-weight: 700; line-height: 1.1; margin: 0; }
.dash-root .gal-head-sub { color: var(--muted); font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@media (max-width: 720px) { .dash-root .gal-head-sub { display: none; } }
/* `.view` sets `z-index: 1`, which makes it a stacking context and traps the SDK's
full-screen overlays (lightbox z1000, editors z1050, camera z1080, modals z1100)
underneath the topbar's `z-index: 20`. Opting this one view out of the stacking
context lets those overlays cover the whole dashboard, as they must. The view still
paints above the ambient `.dash-content::before` glow because it follows it in the DOM. */
.dash-root .view.gal { z-index: auto; }
/* Compact single-line demo banner (~34px). Truncates rather than wrapping so it never steals a
second row of height from the shell. */
.dash-root .gal-banner { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 12px; border-radius: 11px; border: 1px solid var(--border); background: color-mix(in srgb, var(--orange) 9%, var(--panel-2)); color: var(--text-2); font-size: 12px; font-weight: 500; flex: 0 0 auto; white-space: nowrap; overflow: hidden; }
.dash-root .gal-banner span { overflow: hidden; text-overflow: ellipsis; }
.dash-root .gal-banner svg { color: var(--orange); flex: 0 0 auto; }
/* The gallery's own viewport. `overflow: hidden` keeps the SDK's internal scrollers
in charge; its full-screen overlays (lightbox/editor/camera) are position:fixed
and deliberately escape this box to cover the whole dashboard. */
.dash-root .gal-shell { flex: 1; min-height: 0; position: relative; border-radius: 18px; border: 1px solid var(--border); background: var(--panel-2); overflow: hidden; box-shadow: var(--card-hi), 0 1px 2px rgba(0, 0, 0, 0.18); }
.dash-root[data-theme="dark"] .gal-shell { border: 0.5px solid #452b1a; border-radius: 20px; }
/* The SDK's embedded root fills this box. (--apg-overlay-top is set from the
component's `style` prop — the SDK writes an inline default that a stylesheet
rule could not override.) */
.dash-root .gal-shell .apg { height: 100%; }
/* ---- Fullscreen (the SDK puts `.apg--fullscreen` on its root: position:fixed; inset:0) ----
A position:fixed box is only clipped by an ancestor that is its CONTAINING BLOCK, which
`overflow`/`border-radius`/`box-shadow` alone never create — only transform / filter /
perspective / backdrop-filter / will-change / contain do. Nothing on the path
(.dash-content > .view.gal > .gal-shell) uses any of those: `.view`'s `ds-fade` animates
opacity only, and `.view.gal` already drops the `z-index: 1` stacking context. So the
fullscreen root does escape today — these rules make that survive an edit above. */
/* `.dash-root .gal-shell .apg` (0,3,0) would otherwise out-specify the SDK's own sizing; with
inset:0 driving the box, height must get out of the way. */
.dash-root .gal-shell .apg.apg--fullscreen {
height: auto;
/* Above the topbar (z-index: 20) and the sidebar, below the SDK's own overlays (1000+). */
z-index: 900;
}
/* Belt and braces: if a future rule ever DOES make `.gal-shell` a containing block, an
`overflow: hidden` on it would crop the fullscreen root to the embedded box. Drop the clip
(and the rounded corner it exists to enforce) for exactly as long as fullscreen is on. */
.dash-root .gal-shell:has(.apg--fullscreen) { overflow: visible; }
.dash-root .gal-placeholder { height: 100%; min-height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 28px; }
.dash-root .gal-placeholder-ic { width: 66px; height: 66px; border-radius: 20px; display: grid; place-items: center; color: #fff; background: var(--grad-brand); box-shadow: var(--glow-orange); }
.dash-root .gal-placeholder p { color: var(--muted); font-size: 13px; max-width: 420px; }
.dash-root .gal-placeholder h3 { font-size: 16px; font-weight: 700; }
.dash-root .gal-placeholder-error .gal-placeholder-ic { background: color-mix(in srgb, var(--red) 88%, #000); box-shadow: 0 10px 28px -12px color-mix(in srgb, var(--red) 60%, transparent); }
@media (max-width: 920px) {
/* Narrower chrome: a little less top offset, and a smaller floor so short viewports still work. */
.dash-root .gal { height: calc(100vh - 84px); min-height: 560px; }
}