@ai-matrx/media 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -0
- package/README.md +40 -3
- package/dist/core.d.cts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/react.cjs +43 -0
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +9 -2
- package/dist/react.d.ts +9 -2
- package/dist/react.js +43 -0
- package/dist/react.js.map +1 -1
- package/dist/share.cjs +606 -0
- package/dist/share.cjs.map +1 -0
- package/dist/share.d.cts +52 -0
- package/dist/share.d.ts +52 -0
- package/dist/share.js +598 -0
- package/dist/share.js.map +1 -0
- package/dist/use-media-upload-Dg2HSvTq.d.ts +53 -0
- package/dist/use-media-upload-v5Uq9Ruq.d.cts +53 -0
- package/package.json +17 -2
- package/dist/use-media-upload-VjUhqbyY.d.cts +0 -270
- package/dist/use-media-upload-VjUhqbyY.d.ts +0 -270
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/share.ts","../src/share/media-share-popover.tsx","../src/core/context.ts","../src/react/cn.ts","../src/react/icons.tsx"],"sourcesContent":["/**\n * @ai-matrx/media/share — THE SHARE MANDATE's popover bodies (wave M-SHARE,\n * ruling C19).\n *\n * This is the ONLY entry that imports `@ai-matrx/associations` (an OPTIONAL\n * peer, C8): consumers of `.`, `/core`, and `/react` never carry it. Install\n * `@ai-matrx/associations` (and its design-system peer, which its `/react`\n * entry loads) to use this entry; mount `AssociationsProvider` to light up\n * the attach/link affordances — without the provider they degrade to absent,\n * and the share quick actions still work off the MediaClient alone.\n *\n * Wire-up:\n *\n * const SharePopover = createMediaSharePopover({ manageLinks, AccessSummary, notify });\n * <MediaProvider client={client} ports={{ actions: { SharePopover, download, copy } }}>\n */\n\nexport {\n MediaSharePopover,\n createMediaSharePopover,\n type MediaShareAccessSummaryProps,\n type MediaShareNotifier,\n type MediaSharePopoverComponentProps,\n type MediaSharePopoverOptions,\n} from \"./share/media-share-popover\";\n","/**\n * src/share/media-share-popover.tsx — THE SHARE MANDATE's popover BODY\n * (wave M-SHARE, ruling C19).\n *\n * The complete share surface for one media ref, ported from the canonical\n * matrx-frontend share flows (`features/files/blocks/image/ImageSharePopover.tsx`\n * + the video twin — ONE share mechanism, this is its package body) with the\n * coupling seams inverted:\n *\n * • `useSharing`/`pythonShareUrl`/`shareableMediaUrl` → the ONE\n * `MediaClient.shareableUrl` door (law 4 — fails closed: `null` renders\n * the action unavailable; the package never mints or classifies a URL).\n * • `ShareLinkDialog` (the iam share-link manager — app content per C8)\n * → the `manageLinks` host callback; row hidden when the host binds none.\n * • `AccessSummaryPanel` (iam reachability — app content per C8) → the\n * `AccessSummary` host slot.\n * • toasts → the optional `notify` adapter; every failure ALSO renders as\n * inline state so no outcome is silent without it.\n * • the association system → `@ai-matrx/associations/react` consumed\n * through its PUBLIC surface only (provider context + hooks). The\n * \"Linked to\" / \"Attach to…\" affordances render when an\n * `AssociationsProvider` is mounted above and degrade to ABSENT (never\n * broken chrome) when it is not — associations stays an OPTIONAL peer\n * and only this `/share` entry carries it (C8).\n *\n * Matrx refs (a `file_id` identity) get the full surface; external refs get\n * the simplified copy-external-link surface, exactly like the originals.\n * `shareableUrl` is called on CLICK for matrx refs (the host may mint a\n * no-expiry share link — a side effect the origin also deferred to the\n * click), but prefetched for external refs (pure classification, mirroring\n * the origin's synchronous `shareableMediaUrl` display).\n */\n\n\"use client\";\n\nimport {\n useCallback,\n useEffect,\n useMemo,\n useState,\n type ComponentType,\n type ReactNode,\n} from \"react\";\nimport type {\n AssociationTargetType,\n EntityTypeToken,\n} from \"@ai-matrx/associations\";\nimport {\n useAssociations,\n useAssociationsStore,\n useEntityTitles,\n useUniversalEntitySearch,\n} from \"@ai-matrx/associations/react\";\nimport type {\n MediaActionContext,\n MediaKind,\n MediaRefLike,\n MediaSharePopoverProps,\n MediaSlotComponent,\n} from \"../types\";\nimport { useMediaClient } from \"../core/context\";\nimport { cn } from \"../react/cn\";\nimport {\n CheckIcon,\n GlobeIcon,\n Link2Icon,\n PlusIcon,\n SearchIcon,\n Settings2Icon,\n SpinnerIcon,\n XIcon,\n} from \"../react/icons\";\n\n// ---------------------------------------------------------------------------\n// Options — the host-shaped seams. Bound once via `createMediaSharePopover`\n// (the factory returns a component matching the `SharePopover` slot of\n// `MediaActionsPort`), or passed directly to `MediaSharePopover`.\n// ---------------------------------------------------------------------------\n\n/** Toast adapter (host-shaped). Failures also render inline regardless. */\nexport interface MediaShareNotifier {\n success(message: string, opts?: { description?: string }): void;\n error(message: string, opts?: { description?: string }): void;\n}\n\nexport interface MediaShareAccessSummaryProps {\n /** The entity token the summary is for (the popover's `entityToken`). */\n entityType: string;\n /** The matrx file id. */\n entityId: string;\n context: MediaActionContext;\n}\n\nexport interface MediaSharePopoverOptions {\n /**\n * Opens the host's full share-link manager (\"Manage all links\" — custom\n * expiry / permissions / revoke). The iam share-link dialog is app content\n * (C8); absent → the row is hidden. Matrx refs only.\n */\n manageLinks?: ((ctx: MediaActionContext) => void) | undefined;\n /**\n * The host's \"who can see this\" panel (iam reachability — app content per\n * C8). Rendered under the quick actions for matrx refs when provided.\n */\n AccessSummary?: MediaSlotComponent<MediaShareAccessSummaryProps> | undefined;\n /** Toast adapter; failures also render inline without one. */\n notify?: MediaShareNotifier | undefined;\n /** The ref's entity token in the association registry. Default `\"file\"`. */\n entityToken?: string | undefined;\n /** Containers offered by \"Attach to…\". Must be association TARGET types. */\n attachTokens?: readonly AssociationTargetType[] | undefined;\n /** Set false to hide the association affordances even with a provider. */\n associations?: boolean | undefined;\n className?: string | undefined;\n}\n\nconst DEFAULT_ATTACH_TOKENS: readonly AssociationTargetType[] = [\n \"organization\",\n \"project\",\n \"task\",\n \"conversation\",\n \"scope\",\n];\n\nconst KIND_LABEL: Record<MediaKind, string> = {\n image: \"image\",\n video: \"video\",\n audio: \"audio\",\n file: \"file\",\n};\n\nfunction fileIdOf(ref: MediaRefLike | null | undefined): string | null {\n if (!ref || typeof ref === \"string\") return null;\n return ref.file_id ?? null;\n}\n\nasync function copyToClipboard(text: string): Promise<boolean> {\n try {\n if (typeof navigator === \"undefined\" || !navigator.clipboard) return false;\n await navigator.clipboard.writeText(text);\n return true;\n } catch {\n return false;\n }\n}\n\n// ---------------------------------------------------------------------------\n// The popover body.\n// ---------------------------------------------------------------------------\n\nexport type MediaSharePopoverComponentProps = MediaSharePopoverProps &\n MediaSharePopoverOptions;\n\nexport function MediaSharePopover({\n context,\n onClose,\n manageLinks,\n AccessSummary,\n notify,\n entityToken = \"file\",\n attachTokens = DEFAULT_ATTACH_TOKENS,\n associations = true,\n className,\n}: MediaSharePopoverComponentProps) {\n const fileId = fileIdOf(context.ref);\n const kind = context.resolution?.kind ?? \"file\";\n const associationsStore = useOptionalAssociationsStore();\n const AccessSummarySlot = (AccessSummary ??\n null) as ComponentType<MediaShareAccessSummaryProps> | null;\n\n return (\n <div\n className={cn(\n \"w-80 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md\",\n className,\n )}\n >\n <div className=\"border-b px-3 py-2\">\n <div className=\"text-xs font-semibold\">Share {KIND_LABEL[kind]}</div>\n <div className=\"text-[11px] text-muted-foreground\">\n Public links use Matrx sharing · playback URLs stay private\n </div>\n </div>\n <div className=\"flex flex-col gap-1 p-2\">\n {fileId ? (\n <MatrxQuickActions\n context={context}\n notify={notify}\n onActionComplete={onClose}\n />\n ) : (\n <ExternalQuickActions\n context={context}\n kind={kind}\n notify={notify}\n onActionComplete={onClose}\n />\n )}\n {fileId && manageLinks ? (\n <>\n <div className=\"my-1 h-px bg-border\" />\n <QuickActionRow\n icon={<Settings2Icon className=\"h-4 w-4 text-muted-foreground\" width={16} height={16} />}\n label=\"Manage all links\"\n sublabel=\"Custom expiry · permissions · revoke\"\n onClick={() => {\n manageLinks(context);\n onClose();\n }}\n muted\n />\n </>\n ) : null}\n {fileId && AccessSummarySlot ? (\n <ShareSection title=\"Who can see this\">\n <AccessSummarySlot\n entityType={entityToken}\n entityId={fileId}\n context={context}\n />\n </ShareSection>\n ) : null}\n {fileId && associations && associationsStore ? (\n <AssociationsSection\n entityToken={entityToken}\n entityId={fileId}\n attachTokens={attachTokens}\n notify={notify}\n />\n ) : null}\n </div>\n </div>\n );\n}\n\n/**\n * Bind the host-shaped options once; the result is exactly the\n * `SharePopover` slot shape of `MediaActionsPort` — inject it and the\n * toolbar/lightbox shells open the complete share experience.\n */\nexport function createMediaSharePopover(\n options: MediaSharePopoverOptions = {},\n): MediaSlotComponent<MediaSharePopoverProps> {\n return function ConfiguredMediaSharePopover(props: MediaSharePopoverProps) {\n return <MediaSharePopover {...props} {...options} />;\n };\n}\n\n// ---------------------------------------------------------------------------\n// Optional associations store — the clean-degradation probe.\n//\n// `useAssociationsStore` is documented to THROW when no AssociationsProvider\n// is mounted. Its hook usage is a single `useContext` call made BEFORE the\n// throw, so catching preserves hook order across renders in both states —\n// present and absent trees call the same hooks. The behavioral contract\n// (affordances present with a provider, cleanly absent without, never a\n// crash) is pinned by this package's tests.\n// ---------------------------------------------------------------------------\n\nfunction useOptionalAssociationsStore(): ReturnType<\n typeof useAssociationsStore\n> | null {\n try {\n return useAssociationsStore();\n } catch {\n return null;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Matrx quick actions — the \"truly permanent\" public-link path, verbatim\n// from the origin body. The origin's two paths (permanent CDN URL for\n// visibility=\"public\"; else reuse-or-mint a no-expiry read-only share link)\n// live behind the host's ONE `shareableUrl` implementation — the package\n// asks once, on click, and fails closed on `null`.\n// ---------------------------------------------------------------------------\n\nfunction MatrxQuickActions({\n context,\n notify,\n onActionComplete,\n}: {\n context: MediaActionContext;\n notify: MediaShareNotifier | undefined;\n onActionComplete: () => void;\n}) {\n const client = useMediaClient();\n const [publicBusy, setPublicBusy] = useState(false);\n const [copied, setCopied] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const handleCopyPublic = useCallback(async () => {\n if (publicBusy) return;\n setPublicBusy(true);\n setError(null);\n try {\n const url = await client.shareableUrl(context.ref);\n if (!url) {\n // Law 4: fails closed — never a signed URL, never a silent no-op.\n setError(\"This file cannot be shared publicly\");\n notify?.error(\"Could not create public link\", {\n description: \"This file cannot be shared publicly.\",\n });\n return;\n }\n const wrote = await copyToClipboard(url);\n if (!wrote) {\n setError(\"Could not copy link\");\n notify?.error(\"Could not copy link\");\n return;\n }\n notify?.success(\"Public link copied\", {\n description: \"This link will never expire.\",\n });\n setCopied(true);\n onActionComplete();\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n setError(message);\n notify?.error(\"Could not create public link\", { description: message });\n } finally {\n setPublicBusy(false);\n }\n }, [publicBusy, client, context.ref, notify, onActionComplete]);\n\n return (\n <div className=\"flex flex-col gap-1\">\n <QuickActionRow\n icon={<GlobeIcon className=\"h-4 w-4 text-emerald-500\" width={16} height={16} />}\n label=\"Copy public link\"\n sublabel=\"Never expires · anyone with the link\"\n onClick={() => void handleCopyPublic()}\n busy={publicBusy}\n copied={copied}\n />\n {error ? (\n <p role=\"alert\" className=\"px-3 text-[11px] text-destructive\">\n {error}\n </p>\n ) : null}\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// External quick actions — no share-link surface, just the safe URL we have.\n// `shareableUrl` here is pure classification (no matrx identity to mint links\n// for), so it is prefetched to drive the enabled/disabled row like the\n// origin's synchronous `shareableMediaUrl(externalUrl)` did.\n// ---------------------------------------------------------------------------\n\nfunction ExternalQuickActions({\n context,\n kind,\n notify,\n onActionComplete,\n}: {\n context: MediaActionContext;\n kind: MediaKind;\n notify: MediaShareNotifier | undefined;\n onActionComplete: () => void;\n}) {\n const client = useMediaClient();\n const [externalUrl, setExternalUrl] = useState<string | null>(null);\n const [checked, setChecked] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n useEffect(() => {\n let cancelled = false;\n setChecked(false);\n void client\n .shareableUrl(context.ref)\n .then((url) => {\n if (cancelled) return;\n setExternalUrl(url);\n setChecked(true);\n })\n .catch(() => {\n if (cancelled) return;\n setExternalUrl(null);\n setChecked(true);\n });\n return () => {\n cancelled = true;\n };\n }, [client, context.ref]);\n\n const handleCopy = useCallback(async () => {\n if (!externalUrl) {\n setError(\"This private playback URL cannot be shared\");\n notify?.error(\"This private playback URL cannot be shared\");\n return;\n }\n const wrote = await copyToClipboard(externalUrl);\n if (!wrote) {\n setError(\"Could not copy link\");\n notify?.error(\"Could not copy link\");\n return;\n }\n notify?.success(\"Link copied\");\n onActionComplete();\n }, [externalUrl, notify, onActionComplete]);\n\n return (\n <div className=\"flex flex-col gap-1\">\n <QuickActionRow\n icon={<Link2Icon className=\"h-4 w-4\" width={16} height={16} />}\n label=\"Copy external link\"\n sublabel={externalUrl ?? \"No safe external URL available\"}\n onClick={() => void handleCopy()}\n busy={!checked}\n disabled={checked && !externalUrl}\n />\n {error ? (\n <p role=\"alert\" className=\"px-3 text-[11px] text-destructive\">\n {error}\n </p>\n ) : null}\n <p className=\"px-3 pt-2 text-[11px] text-muted-foreground\">\n This {KIND_LABEL[kind]} is hosted externally — we can't create a\n permanent Matrx share link for it.\n </p>\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Associations — \"Linked to\" + \"Attach to…\", THE canonical edge system\n// consumed through @ai-matrx/associations' public hooks. Rendered only when\n// an AssociationsProvider is mounted (the parent gates on the store probe).\n// ---------------------------------------------------------------------------\n\nfunction AssociationsSection({\n entityToken,\n entityId,\n attachTokens,\n notify,\n}: {\n entityToken: string;\n entityId: string;\n attachTokens: readonly AssociationTargetType[];\n notify: MediaShareNotifier | undefined;\n}) {\n const { edges, status, error, add, remove } = useAssociations({\n type: entityToken,\n id: entityId,\n });\n const [attachOpen, setAttachOpen] = useState(false);\n const [query, setQuery] = useState(\"\");\n const [busyKey, setBusyKey] = useState<string | null>(null);\n const [writeError, setWriteError] = useState<string | null>(null);\n\n // Containers this ref is attached to (the ref is the edge SOURCE —\n // little→big is registry-owned; never flipped here).\n const outgoing = useMemo(\n () => edges.filter((edge) => edge.direction === \"outgoing\"),\n [edges],\n );\n const titles = useEntityTitles(\n outgoing.map((edge) => ({\n token: edge.otherType,\n id: edge.otherId,\n label: edge.label,\n })),\n );\n const attachedKeys = useMemo(\n () => new Set(outgoing.map((edge) => `${edge.otherType}:${edge.otherId}`)),\n [outgoing],\n );\n\n const search = useUniversalEntitySearch({\n query,\n tokens: [...attachTokens] as EntityTypeToken[],\n enabled: attachOpen,\n });\n\n const runWrite = useCallback(\n async (key: string, verb: string, op: () => Promise<{ ok: boolean; error?: string }>) => {\n if (busyKey) return;\n setBusyKey(key);\n setWriteError(null);\n try {\n const res = await op();\n // A silent no-op attach is the bug class this scream kills.\n if (!res.ok) {\n const message = `Couldn't ${verb}${res.error ? `: ${res.error}` : \"\"}`;\n setWriteError(message);\n notify?.error(message);\n }\n } finally {\n setBusyKey(null);\n }\n },\n [busyKey, notify],\n );\n\n return (\n <ShareSection\n title=\"Linked to\"\n action={\n <button\n type=\"button\"\n onClick={() => setAttachOpen((open) => !open)}\n className=\"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] text-muted-foreground hover:bg-accent hover:text-foreground\"\n >\n <PlusIcon className=\"h-3 w-3\" width={12} height={12} />\n Attach to…\n </button>\n }\n >\n {status === \"loading\" && outgoing.length === 0 ? (\n <div className=\"flex items-center gap-2 px-3 py-1.5 text-[11px] text-muted-foreground\">\n <SpinnerIcon className=\"h-3.5 w-3.5 animate-spin\" width={14} height={14} />\n Loading links…\n </div>\n ) : null}\n {error ? (\n <p role=\"alert\" className=\"px-3 text-[11px] text-destructive\">\n {error}\n </p>\n ) : null}\n {status !== \"loading\" && !error && outgoing.length === 0 ? (\n <p className=\"px-3 py-1 text-[11px] text-muted-foreground\">\n Not linked to anything yet.\n </p>\n ) : null}\n {outgoing.map((edge) => {\n const ref = { token: edge.otherType, id: edge.otherId, label: edge.label };\n const unresolved = titles.isUnresolved(ref);\n const key = `edge:${edge.id}`;\n return (\n <div\n key={edge.id}\n className=\"flex items-center gap-2 rounded-md px-3 py-1.5 hover:bg-accent/50\"\n >\n <Link2Icon\n className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\"\n width={14}\n height={14}\n />\n <span className=\"flex min-w-0 flex-1 flex-col\">\n <span\n className={cn(\n \"truncate text-xs\",\n unresolved && \"text-destructive\",\n )}\n >\n {unresolved ? \"Unavailable\" : titles.titleFor(ref)}\n </span>\n <span className=\"text-[10px] uppercase tracking-wide text-muted-foreground\">\n {edge.otherType}\n {edge.role ? ` · ${edge.role}` : \"\"}\n </span>\n </span>\n <button\n type=\"button\"\n aria-label={`Detach ${unresolved ? edge.otherType : titles.titleFor(ref)}`}\n disabled={busyKey === key}\n onClick={() =>\n void runWrite(key, \"detach\", () =>\n remove({\n targetType: edge.otherType,\n targetId: edge.otherId,\n ...(edge.role != null ? { role: edge.role } : {}),\n }),\n )\n }\n className=\"flex h-6 w-6 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-destructive\"\n >\n {busyKey === key ? (\n <SpinnerIcon className=\"h-3 w-3 animate-spin\" width={12} height={12} />\n ) : (\n <XIcon className=\"h-3 w-3\" width={12} height={12} />\n )}\n </button>\n </div>\n );\n })}\n {attachOpen ? (\n <div className=\"flex flex-col gap-1 border-t pt-2\">\n <div className=\"relative px-3\">\n <SearchIcon\n className=\"pointer-events-none absolute left-5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground\"\n width={14}\n height={14}\n />\n <input\n type=\"text\"\n value={query}\n onChange={(event) => setQuery(event.target.value)}\n placeholder=\"Search to attach…\"\n aria-label=\"Search to attach\"\n className=\"w-full rounded-md border bg-background py-1 pl-7 pr-2 text-xs\"\n />\n </div>\n {search.loading ? (\n <div className=\"flex items-center gap-2 px-3 py-1.5 text-[11px] text-muted-foreground\">\n <SpinnerIcon className=\"h-3.5 w-3.5 animate-spin\" width={14} height={14} />\n Searching…\n </div>\n ) : null}\n {search.results.map((candidate) => {\n const candidateKey = `${candidate.token}:${candidate.id}`;\n const attached = attachedKeys.has(candidateKey);\n return (\n <button\n key={candidateKey}\n type=\"button\"\n disabled={busyKey === candidateKey}\n onClick={() =>\n void runWrite(\n candidateKey,\n attached\n ? `detach \"${candidate.title}\"`\n : `attach \"${candidate.title}\"`,\n () =>\n attached\n ? remove({\n targetType: candidate.token,\n targetId: candidate.id,\n })\n : add({\n targetType: candidate.token as AssociationTargetType,\n targetId: candidate.id,\n label: candidate.title,\n }),\n )\n }\n className=\"flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-left hover:bg-accent\"\n >\n <span className=\"flex min-w-0 flex-1 flex-col\">\n <span className=\"truncate text-xs\">{candidate.title}</span>\n <span className=\"text-[10px] uppercase tracking-wide text-muted-foreground\">\n {candidate.token}\n </span>\n </span>\n {busyKey === candidateKey ? (\n <SpinnerIcon className=\"h-3.5 w-3.5 shrink-0 animate-spin\" width={14} height={14} />\n ) : attached ? (\n <CheckIcon className=\"h-3.5 w-3.5 shrink-0 text-emerald-500\" width={14} height={14} />\n ) : (\n <PlusIcon className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" width={14} height={14} />\n )}\n </button>\n );\n })}\n {!search.loading && query.trim() && search.results.length === 0 ? (\n <p className=\"px-3 py-1 text-[11px] text-muted-foreground\">\n No matches.\n </p>\n ) : null}\n </div>\n ) : null}\n {writeError ? (\n <p role=\"alert\" className=\"px-3 text-[11px] text-destructive\">\n {writeError}\n </p>\n ) : null}\n </ShareSection>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Chrome shared by the sections.\n// ---------------------------------------------------------------------------\n\nfunction ShareSection({\n title,\n action,\n children,\n}: {\n title: string;\n action?: ReactNode | undefined;\n children: ReactNode;\n}) {\n return (\n <div className=\"mt-1 flex flex-col gap-1 border-t pt-2\">\n <div className=\"flex items-center justify-between px-3\">\n <span className=\"text-[10px] font-medium uppercase tracking-wide text-muted-foreground\">\n {title}\n </span>\n {action}\n </div>\n {children}\n </div>\n );\n}\n\n// One tappable, two-line action button — ported verbatim from the origin\n// popovers' QuickActionRow.\nfunction QuickActionRow({\n icon,\n label,\n sublabel,\n onClick,\n busy,\n disabled,\n copied,\n muted,\n}: {\n icon: ReactNode;\n label: string;\n sublabel?: string | undefined;\n onClick: () => void;\n busy?: boolean | undefined;\n disabled?: boolean | undefined;\n copied?: boolean | undefined;\n muted?: boolean | undefined;\n}) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n disabled={busy || disabled}\n className={cn(\n \"flex w-full items-center gap-3 rounded-md px-3 py-2 text-left transition-colors\",\n \"hover:bg-accent focus-visible:bg-accent focus-visible:outline-none\",\n (busy || disabled) && \"opacity-50 cursor-not-allowed\",\n muted && \"text-muted-foreground\",\n )}\n >\n <span className=\"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-muted\">\n {busy ? (\n <SpinnerIcon className=\"h-4 w-4 animate-spin\" width={16} height={16} />\n ) : (\n icon\n )}\n </span>\n <span className=\"flex min-w-0 flex-1 flex-col\">\n <span className=\"text-sm font-medium leading-tight\">{label}</span>\n {sublabel ? (\n <span className=\"truncate text-[11px] text-muted-foreground\">\n {sublabel}\n </span>\n ) : null}\n </span>\n {copied ? (\n <CheckIcon className=\"h-4 w-4 shrink-0 text-emerald-500\" width={16} height={16} />\n ) : null}\n </button>\n );\n}\n","/**\n * src/core/context.ts — the MediaClient / host-ports React contexts.\n *\n * The context OBJECTS live on `globalThis` under `Symbol.for` slots — NOT at\n * module level. With `splitting: false` this module is duplicated into the\n * `/core` and `/react` bundles, and CJS/ESM each instantiate their own module\n * graph; a module-level `createContext` would silently produce two different\n * contexts (a Provider from one graph invisible to a consumer from the\n * other) — the kit tap-target/link-registry lesson. Never \"clean this up\".\n */\n\nimport {\n createContext,\n createElement,\n useContext,\n type Context,\n type ReactNode,\n} from \"react\";\nimport type { MediaClient, MediaHostPorts } from \"../types\";\n\nconst CLIENT_SLOT = Symbol.for(\"ai-matrx.media.client-context\");\nconst PORTS_SLOT = Symbol.for(\"ai-matrx.media.host-ports-context\");\n\ntype SlotHost = typeof globalThis & {\n [CLIENT_SLOT]?: Context<MediaClient | null>;\n [PORTS_SLOT]?: Context<MediaHostPorts>;\n};\n\nfunction clientContext(): Context<MediaClient | null> {\n const host = globalThis as SlotHost;\n host[CLIENT_SLOT] ??= createContext<MediaClient | null>(null);\n return host[CLIENT_SLOT];\n}\n\nconst INERT_PORTS: MediaHostPorts = {};\n\nfunction portsContext(): Context<MediaHostPorts> {\n const host = globalThis as SlotHost;\n host[PORTS_SLOT] ??= createContext<MediaHostPorts>(INERT_PORTS);\n return host[PORTS_SLOT];\n}\n\nexport interface MediaProviderProps {\n client: MediaClient;\n /**\n * Optional host ports (playback session, actions, ImageComponent). Must be\n * referentially stable — the playback port members are hooks.\n */\n ports?: MediaHostPorts | undefined;\n children?: ReactNode;\n}\n\n/** Wire the injected MediaClient (and optional host ports) into the tree. */\nexport function MediaProvider({ client, ports, children }: MediaProviderProps) {\n const ClientCtx = clientContext();\n const PortsCtx = portsContext();\n return createElement(\n ClientCtx.Provider,\n { value: client },\n createElement(PortsCtx.Provider, { value: ports ?? INERT_PORTS }, children),\n );\n}\n\n/** The injected MediaClient. Throws when no MediaProvider is mounted. */\nexport function useMediaClient(): MediaClient {\n const client = useContext(clientContext());\n if (!client) {\n throw new Error(\n \"@ai-matrx/media: no MediaClient. Mount <MediaProvider client={...}> \" +\n \"above every media surface (canonically wired to @ai-matrx/data/files).\",\n );\n }\n return client;\n}\n\n/** The injected host ports; inert defaults when none were provided. */\nexport function useMediaHostPorts(): MediaHostPorts {\n return useContext(portsContext());\n}\n","/**\n * src/react/cn.ts — conditional class join with last-wins Tailwind conflict\n * merging. The originals used the app's `cn` (clsx + tailwind-merge); public\n * `className` overrides depend on last-wins class-conflict merging, so a\n * naive join would be a behavior divergence (the kit `./confirm` precedent —\n * this is why `tailwind-merge` is a sanctioned runtime dep of `/react`).\n */\n\nimport { twMerge } from \"tailwind-merge\";\n\nexport type ClassValue = string | false | null | undefined | 0;\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(inputs.filter(Boolean).join(\" \"));\n}\n","/**\n * src/react/icons.tsx — the package's OWN inlined SVG icons.\n *\n * Per campaign ruling C19 (2026-08-29): no icon-library dependency, ever.\n * Every glyph below is copied from lucide-react v1.22.0 (ISC license) exactly,\n * following the @ai-matrx/tap-target precedent. Add a new icon by copying the\n * lucide __iconNode data — never by adding a lucide peer.\n *\n * Internal module: icons are exported for the package's own components and for\n * hosts that want visual parity in slots, but they are not the product.\n */\n\nimport type { SVGProps } from \"react\";\n\nexport type MediaIconProps = SVGProps<SVGSVGElement>;\n\nfunction svgProps(props: MediaIconProps): MediaIconProps {\n return {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n width: 24,\n height: 24,\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n \"aria-hidden\": true,\n ...props,\n };\n}\n\n// lucide: archive\nexport function ArchiveIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <rect width=\"20\" height=\"5\" x=\"2\" y=\"3\" rx=\"1\" />\n <path d=\"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8\" />\n <path d=\"M10 12h4\" />\n </svg>\n );\n}\n\n// lucide: braces\nexport function BracesIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1\" />\n <path d=\"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1\" />\n </svg>\n );\n}\n\n// lucide: check\nexport function CheckIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n );\n}\n\n// lucide: code\nexport function CodeIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"m16 18 6-6-6-6\" />\n <path d=\"m8 6-6 6 6 6\" />\n </svg>\n );\n}\n\n// lucide: copy\nexport function CopyIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" />\n </svg>\n );\n}\n\n// lucide: database\nexport function DatabaseIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <ellipse cx=\"12\" cy=\"5\" rx=\"9\" ry=\"3\" />\n <path d=\"M3 5V19A9 3 0 0 0 21 19V5\" />\n <path d=\"M3 12A9 3 0 0 0 21 12\" />\n </svg>\n );\n}\n\n// lucide: download\nexport function DownloadIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M12 15V3\" />\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n <path d=\"m7 10 5 5 5-5\" />\n </svg>\n );\n}\n\n// lucide: externalLink\nexport function ExternalLinkIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M15 3h6v6\" />\n <path d=\"M10 14 21 3\" />\n <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" />\n </svg>\n );\n}\n\n// lucide: file\nexport function FileIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n </svg>\n );\n}\n\n// lucide: fileAudio\nexport function FileAudioIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0\" />\n </svg>\n );\n}\n\n// lucide: fileCode\nexport function FileCodeIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M10 12.5 8 15l2 2.5\" />\n <path d=\"m14 12.5 2 2.5-2 2.5\" />\n </svg>\n );\n}\n\n// lucide: fileJson\nexport function FileJsonIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1\" />\n <path d=\"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1\" />\n </svg>\n );\n}\n\n// lucide: fileSpreadsheet\nexport function FileSpreadsheetIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M8 13h2\" />\n <path d=\"M14 13h2\" />\n <path d=\"M8 17h2\" />\n <path d=\"M14 17h2\" />\n </svg>\n );\n}\n\n// lucide: fileText\nexport function FileTextIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M10 9H8\" />\n <path d=\"M16 13H8\" />\n <path d=\"M16 17H8\" />\n </svg>\n );\n}\n\n// lucide: fileType\nexport function FileTypeIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M11 18h2\" />\n <path d=\"M12 12v6\" />\n <path d=\"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5\" />\n </svg>\n );\n}\n\n// lucide: fileVideo\nexport function FileVideoIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z\" />\n </svg>\n );\n}\n\n// lucide: folder\nexport function FolderIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z\" />\n </svg>\n );\n}\n\n// lucide: folderOpen\nexport function FolderOpenIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2\" />\n </svg>\n );\n}\n\n// lucide: image\nexport function ImageIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" ry=\"2\" />\n <circle cx=\"9\" cy=\"9\" r=\"2\" />\n <path d=\"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21\" />\n </svg>\n );\n}\n\n// lucide: imageOff\nexport function ImageOffIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <line x1=\"2\" x2=\"22\" y1=\"2\" y2=\"22\" />\n <path d=\"M10.41 10.41a2 2 0 1 1-2.83-2.83\" />\n <line x1=\"13.5\" x2=\"6\" y1=\"13.5\" y2=\"21\" />\n <line x1=\"18\" x2=\"21\" y1=\"12\" y2=\"15\" />\n <path d=\"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59\" />\n <path d=\"M21 15V5a2 2 0 0 0-2-2H9\" />\n </svg>\n );\n}\n\n// lucide: music\nexport function MusicIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M9 18V5l12-2v13\" />\n <circle cx=\"6\" cy=\"18\" r=\"3\" />\n <circle cx=\"18\" cy=\"16\" r=\"3\" />\n </svg>\n );\n}\n\n// lucide: packageBox\nexport function PackageBoxIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z\" />\n <path d=\"M12 22V12\" />\n <polyline points=\"3.29 7 12 12 20.71 7\" />\n <path d=\"m7.5 4.27 9 5.15\" />\n </svg>\n );\n}\n\n// lucide: penTool\nexport function PenToolIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z\" />\n <path d=\"m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18\" />\n <path d=\"m2.3 2.3 7.286 7.286\" />\n <circle cx=\"11\" cy=\"11\" r=\"2\" />\n </svg>\n );\n}\n\n// lucide: share2\nexport function Share2Icon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <circle cx=\"18\" cy=\"5\" r=\"3\" />\n <circle cx=\"6\" cy=\"12\" r=\"3\" />\n <circle cx=\"18\" cy=\"19\" r=\"3\" />\n <line x1=\"8.59\" x2=\"15.42\" y1=\"13.51\" y2=\"17.49\" />\n <line x1=\"15.41\" x2=\"8.59\" y1=\"6.51\" y2=\"10.49\" />\n </svg>\n );\n}\n\n// lucide: subtitles\nexport function SubtitlesIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <rect width=\"18\" height=\"14\" x=\"3\" y=\"5\" rx=\"2\" ry=\"2\" />\n <path d=\"M7 15h4M15 15h2M7 11h2M13 11h4\" />\n </svg>\n );\n}\n\n// lucide: upload\nexport function UploadIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M12 3v12\" />\n <path d=\"m17 8-5-5-5 5\" />\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n </svg>\n );\n}\n\n// lucide: video\nexport function VideoIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5\" />\n <rect x=\"2\" y=\"6\" width=\"14\" height=\"12\" rx=\"2\" />\n </svg>\n );\n}\n\n// lucide: videoOff\nexport function VideoOffIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196\" />\n <path d=\"M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2\" />\n <path d=\"m2 2 20 20\" />\n </svg>\n );\n}\n\n// lucide: volumeX\nexport function VolumeXIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\" />\n <line x1=\"22\" x2=\"16\" y1=\"9\" y2=\"15\" />\n <line x1=\"16\" x2=\"22\" y1=\"9\" y2=\"15\" />\n </svg>\n );\n}\n\n// lucide: x\nexport function XIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n );\n}\n\n// lucide: alertCircle\nexport function AlertCircleIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <line x1=\"12\" x2=\"12\" y1=\"8\" y2=\"12\" />\n <line x1=\"12\" x2=\"12.01\" y1=\"16\" y2=\"16\" />\n </svg>\n );\n}\n\n// lucide: checkCircle2\nexport function CheckCircle2Icon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M21.801 10A10 10 0 1 1 17 3.335\" />\n <path d=\"m9 11 3 3L22 4\" />\n </svg>\n );\n}\n\n// lucide: globe\nexport function GlobeIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20\" />\n <path d=\"M2 12h20\" />\n </svg>\n );\n}\n\n// lucide: link-2\nexport function Link2Icon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M9 17H7A5 5 0 0 1 7 7h2\" />\n <path d=\"M15 7h2a5 5 0 1 1 0 10h-2\" />\n <line x1=\"8\" x2=\"16\" y1=\"12\" y2=\"12\" />\n </svg>\n );\n}\n\n// lucide: settings-2\nexport function Settings2Icon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M20 7h-9\" />\n <path d=\"M14 17H5\" />\n <circle cx=\"17\" cy=\"17\" r=\"3\" />\n <circle cx=\"7\" cy=\"7\" r=\"3\" />\n </svg>\n );\n}\n\n// lucide: loader-circle (a.k.a. Loader2)\nexport function SpinnerIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\" />\n </svg>\n );\n}\n\n// lucide: plus\nexport function PlusIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <path d=\"M5 12h14\" />\n <path d=\"M12 5v14\" />\n </svg>\n );\n}\n\n// lucide: search\nexport function SearchIcon(props: MediaIconProps) {\n return (\n <svg {...svgProps(props)}>\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4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AA,IACC;AAAA,KACH;AAEJ;AAIA,SAAS,eAAe;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GASG;AACD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL;AAAA,MACA,UAAU,QAAQ;AAAA,MAClB,WAAW;AAAA,QACT;AAAA,QACA;AAAA,SACC,QAAQ,aAAa;AAAA,QACtB,SAAS;AAAA,MACX;AAAA,MAEA;AAAA,qDAAC,UAAK,WAAU,yEACb,iBACC,6CAAC,eAAY,WAAU,wBAAuB,OAAO,IAAI,QAAQ,IAAI,IAErE,MAEJ;AAAA,QACA,8CAAC,UAAK,WAAU,gCACd;AAAA,uDAAC,UAAK,WAAU,qCAAqC,iBAAM;AAAA,UAC1D,WACC,6CAAC,UAAK,WAAU,8CACb,oBACH,IACE;AAAA,WACN;AAAA,QACC,SACC,6CAAC,aAAU,WAAU,qCAAoC,OAAO,IAAI,QAAQ,IAAI,IAC9E;AAAA;AAAA;AAAA,EACN;AAEJ;","names":["import_react","import_jsx_runtime"]}
|
package/dist/share.d.cts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { AssociationTargetType } from '@ai-matrx/associations';
|
|
3
|
+
import { MediaActionContext, MediaSharePopoverProps, MediaSlotComponent } from './index.cjs';
|
|
4
|
+
|
|
5
|
+
/** Toast adapter (host-shaped). Failures also render inline regardless. */
|
|
6
|
+
interface MediaShareNotifier {
|
|
7
|
+
success(message: string, opts?: {
|
|
8
|
+
description?: string;
|
|
9
|
+
}): void;
|
|
10
|
+
error(message: string, opts?: {
|
|
11
|
+
description?: string;
|
|
12
|
+
}): void;
|
|
13
|
+
}
|
|
14
|
+
interface MediaShareAccessSummaryProps {
|
|
15
|
+
/** The entity token the summary is for (the popover's `entityToken`). */
|
|
16
|
+
entityType: string;
|
|
17
|
+
/** The matrx file id. */
|
|
18
|
+
entityId: string;
|
|
19
|
+
context: MediaActionContext;
|
|
20
|
+
}
|
|
21
|
+
interface MediaSharePopoverOptions {
|
|
22
|
+
/**
|
|
23
|
+
* Opens the host's full share-link manager ("Manage all links" — custom
|
|
24
|
+
* expiry / permissions / revoke). The iam share-link dialog is app content
|
|
25
|
+
* (C8); absent → the row is hidden. Matrx refs only.
|
|
26
|
+
*/
|
|
27
|
+
manageLinks?: ((ctx: MediaActionContext) => void) | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* The host's "who can see this" panel (iam reachability — app content per
|
|
30
|
+
* C8). Rendered under the quick actions for matrx refs when provided.
|
|
31
|
+
*/
|
|
32
|
+
AccessSummary?: MediaSlotComponent<MediaShareAccessSummaryProps> | undefined;
|
|
33
|
+
/** Toast adapter; failures also render inline without one. */
|
|
34
|
+
notify?: MediaShareNotifier | undefined;
|
|
35
|
+
/** The ref's entity token in the association registry. Default `"file"`. */
|
|
36
|
+
entityToken?: string | undefined;
|
|
37
|
+
/** Containers offered by "Attach to…". Must be association TARGET types. */
|
|
38
|
+
attachTokens?: readonly AssociationTargetType[] | undefined;
|
|
39
|
+
/** Set false to hide the association affordances even with a provider. */
|
|
40
|
+
associations?: boolean | undefined;
|
|
41
|
+
className?: string | undefined;
|
|
42
|
+
}
|
|
43
|
+
type MediaSharePopoverComponentProps = MediaSharePopoverProps & MediaSharePopoverOptions;
|
|
44
|
+
declare function MediaSharePopover({ context, onClose, manageLinks, AccessSummary, notify, entityToken, attachTokens, associations, className, }: MediaSharePopoverComponentProps): react.JSX.Element;
|
|
45
|
+
/**
|
|
46
|
+
* Bind the host-shaped options once; the result is exactly the
|
|
47
|
+
* `SharePopover` slot shape of `MediaActionsPort` — inject it and the
|
|
48
|
+
* toolbar/lightbox shells open the complete share experience.
|
|
49
|
+
*/
|
|
50
|
+
declare function createMediaSharePopover(options?: MediaSharePopoverOptions): MediaSlotComponent<MediaSharePopoverProps>;
|
|
51
|
+
|
|
52
|
+
export { type MediaShareAccessSummaryProps, type MediaShareNotifier, MediaSharePopover, type MediaSharePopoverComponentProps, type MediaSharePopoverOptions, createMediaSharePopover };
|
package/dist/share.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { AssociationTargetType } from '@ai-matrx/associations';
|
|
3
|
+
import { MediaActionContext, MediaSharePopoverProps, MediaSlotComponent } from './index.js';
|
|
4
|
+
|
|
5
|
+
/** Toast adapter (host-shaped). Failures also render inline regardless. */
|
|
6
|
+
interface MediaShareNotifier {
|
|
7
|
+
success(message: string, opts?: {
|
|
8
|
+
description?: string;
|
|
9
|
+
}): void;
|
|
10
|
+
error(message: string, opts?: {
|
|
11
|
+
description?: string;
|
|
12
|
+
}): void;
|
|
13
|
+
}
|
|
14
|
+
interface MediaShareAccessSummaryProps {
|
|
15
|
+
/** The entity token the summary is for (the popover's `entityToken`). */
|
|
16
|
+
entityType: string;
|
|
17
|
+
/** The matrx file id. */
|
|
18
|
+
entityId: string;
|
|
19
|
+
context: MediaActionContext;
|
|
20
|
+
}
|
|
21
|
+
interface MediaSharePopoverOptions {
|
|
22
|
+
/**
|
|
23
|
+
* Opens the host's full share-link manager ("Manage all links" — custom
|
|
24
|
+
* expiry / permissions / revoke). The iam share-link dialog is app content
|
|
25
|
+
* (C8); absent → the row is hidden. Matrx refs only.
|
|
26
|
+
*/
|
|
27
|
+
manageLinks?: ((ctx: MediaActionContext) => void) | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* The host's "who can see this" panel (iam reachability — app content per
|
|
30
|
+
* C8). Rendered under the quick actions for matrx refs when provided.
|
|
31
|
+
*/
|
|
32
|
+
AccessSummary?: MediaSlotComponent<MediaShareAccessSummaryProps> | undefined;
|
|
33
|
+
/** Toast adapter; failures also render inline without one. */
|
|
34
|
+
notify?: MediaShareNotifier | undefined;
|
|
35
|
+
/** The ref's entity token in the association registry. Default `"file"`. */
|
|
36
|
+
entityToken?: string | undefined;
|
|
37
|
+
/** Containers offered by "Attach to…". Must be association TARGET types. */
|
|
38
|
+
attachTokens?: readonly AssociationTargetType[] | undefined;
|
|
39
|
+
/** Set false to hide the association affordances even with a provider. */
|
|
40
|
+
associations?: boolean | undefined;
|
|
41
|
+
className?: string | undefined;
|
|
42
|
+
}
|
|
43
|
+
type MediaSharePopoverComponentProps = MediaSharePopoverProps & MediaSharePopoverOptions;
|
|
44
|
+
declare function MediaSharePopover({ context, onClose, manageLinks, AccessSummary, notify, entityToken, attachTokens, associations, className, }: MediaSharePopoverComponentProps): react.JSX.Element;
|
|
45
|
+
/**
|
|
46
|
+
* Bind the host-shaped options once; the result is exactly the
|
|
47
|
+
* `SharePopover` slot shape of `MediaActionsPort` — inject it and the
|
|
48
|
+
* toolbar/lightbox shells open the complete share experience.
|
|
49
|
+
*/
|
|
50
|
+
declare function createMediaSharePopover(options?: MediaSharePopoverOptions): MediaSlotComponent<MediaSharePopoverProps>;
|
|
51
|
+
|
|
52
|
+
export { type MediaShareAccessSummaryProps, type MediaShareNotifier, MediaSharePopover, type MediaSharePopoverComponentProps, type MediaSharePopoverOptions, createMediaSharePopover };
|