@proveanything/smartlinks-utils-ui 0.11.0 → 0.11.1

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.
@@ -1,4 +1,4 @@
1
- import React$1 from 'react';
1
+ import React__default from 'react';
2
2
 
3
3
  /** FA7 icon families */
4
4
  type IconFamily = 'classic' | 'duotone' | 'brands';
@@ -38,6 +38,6 @@ interface IconPickerProps {
38
38
  className?: string;
39
39
  }
40
40
 
41
- declare const IconPicker: React$1.FC<IconPickerProps>;
41
+ declare const IconPicker: React__default.FC<IconPickerProps>;
42
42
 
43
43
  export { type IconFamily as I, type IconStyle as a, IconPicker as b, type IconPickerProps as c, type IconSelection as d };
@@ -95,8 +95,8 @@ async function readShowHints(SL) {
95
95
  if (inflight) return inflight;
96
96
  inflight = (async () => {
97
97
  try {
98
- const cfg = await SL?.userAppData?.getConfig?.(HINTS_PREFS_APP_ID);
99
- const value = cfg?.[HINTS_PREFS_KEY];
98
+ const account = await SL?.auth?.getAccount?.();
99
+ const value = account?.prefs?.[HINTS_PREFS_KEY];
100
100
  const resolved = typeof value === "boolean" ? value : true;
101
101
  cachedShowHints = resolved;
102
102
  return resolved;
@@ -181,5 +181,5 @@ function useIntroState({ SL, persistKey }) {
181
181
  }
182
182
 
183
183
  export { AdminPageHeader, HINTS_PREFS_APP_ID, HINTS_PREFS_KEY, useHintsPreference, useIntroState };
184
- //# sourceMappingURL=chunk-BNC6Z6WB.js.map
185
- //# sourceMappingURL=chunk-BNC6Z6WB.js.map
184
+ //# sourceMappingURL=chunk-3RRHM4LP.js.map
185
+ //# sourceMappingURL=chunk-3RRHM4LP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/AdminPageHeader/AdminPageHeader.tsx","../src/hints/useHintsPreference.ts","../src/hints/useIntroState.ts"],"names":["useState","useEffect","useCallback"],"mappings":";;;;;AA+EA,IAAM,SAAA,GAAY;AAAA,EAChB,IAAA,EAAM,SAAA;AAAA,E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M,UAAU,CAAC,CAAA,KAAM,GAAA;AAAA,EAAK,CAAA,CAAA,MACxD;AAAE,IAAA,OAAO,KAAA;AAAA,EAAO;AACxB;AAGO,SAAS,aAAA,CAAc,EAAE,EAAA,EAAI,UAAA,EAAW,EAA2C;AACxF,EAAA,MAAM,EAAE,SAAA,EAAW,SAAA,EAAU,GAAI,mBAAmB,EAAE,CAAA;AACtD,EAAA,MAAM,CAAC,kBAAkB,mBAAmB,CAAA,GAAIA,SAAkB,MAAM,oBAAA,CAAqB,UAAU,CAAC,CAAA;AAGxG,EAAAC,UAAU,MAAM;AACd,IAAA,mBAAA,CAAoB,oBAAA,CAAqB,UAAU,CAAC,CAAA;AAAA,EACtD,CAAA,EAAG,CAAC,UAAU,CAAC,CAAA;AAEf,EAAA,MAAM,SAAA,GAAYC,YAAY,MAAM;AAClC,IAAA,mBAAA,CAAoB,IAAI,CAAA;AACxB,IAAA,IAAI;AAAE,MAAA,YAAA,CAAa,OAAA,CAAQ,KAAA,CAAM,UAAU,CAAA,EAAG,GAAG,CAAA;AAAA,IAAG,CAAA,CAAA,MAAQ;AAAA,IAAe;AAAA,EAC7E,CAAA,EAAG,CAAC,UAAU,CAAC,CAAA;AAEf,EAAA,MAAM,QAAA,GAAWA,YAAY,MAAM;AACjC,IAAA,mBAAA,CAAoB,KAAK,CAAA;AACzB,IAAA,IAAI;AAAE,MAAA,YAAA,CAAa,UAAA,CAAW,KAAA,CAAM,UAAU,CAAC,CAAA;AAAA,IAAG,CAAA,CAAA,MAAQ;AAAA,IAAe;AAAA,EAC3E,CAAA,EAAG,CAAC,UAAU,CAAC,CAAA;AAKf,EAAA,MAAM,SAAA,GAAY,CAAC,SAAA,IAAa,gBAAA;AAEhC,EAAA,OAAO,EAAE,SAAA,EAAW,SAAA,EAAW,QAAA,EAAU,SAAA,EAAU;AACrD","file":"chunk-3RRHM4LP.js","sourcesContent":["// =============================================================================\r\n// AdminPageHeader\r\n//\r\n// A standardised page header for any SmartLinks admin surface. Designed to be\r\n// used standalone (lightweight apps that don't need the full RecordsAdminShell)\r\n// or composed inside other shells. Supports:\r\n//\r\n// • Inline icon + title + full-width subtitle\r\n// • Right-aligned slot for app-specific actions (e.g. \"+ New\" button)\r\n// • External help link (icon-button that opens docs in a new tab)\r\n// • Optional dismissible intro card with `?` reopen affordance\r\n// • Optional `aside` slot for extra header content (stats strips, etc.)\r\n//\r\n// Styling is self-contained under `.sl-aph` and reuses the shared `--ra-*`\r\n// design tokens with sensible fallbacks, so it themes correctly whether the\r\n// host has loaded the records-admin token sheet or not.\r\n// =============================================================================\r\nimport { type ReactNode, useId } from 'react';\r\nimport { BookOpen, HelpCircle, X, Lightbulb, CheckCircle2, AlertTriangle, Info } from 'lucide-react';\r\nimport './admin-page-header.css';\r\n\r\nexport type AdminPageHeaderIntroTone = 'info' | 'success' | 'warning';\r\n\r\nexport interface AdminPageHeaderIntro {\r\n /** Short headline shown in bold at the start of the intro card. */\r\n title: string;\r\n /** Body content — plain text or rich nodes. */\r\n body: ReactNode;\r\n /** Visual tone — controls icon and surface tint. Default `'info'`. */\r\n tone?: AdminPageHeaderIntroTone;\r\n /** Optional action node rendered inline after the body (e.g. a Learn-more link). */\r\n action?: ReactNode;\r\n /** Whether the intro is currently dismissed. Controlled. */\r\n dismissed: boolean;\r\n /** Called when the user clicks the dismiss `X`. */\r\n onDismiss: () => void;\r\n /**\r\n * Called when the user clicks the reopen `?` button (only rendered when\r\n * dismissed is true). Omit to hide the reopen affordance entirely.\r\n */\r\n onReopen?: () => void;\r\n /** Tooltip / aria-label for the reopen button. Default \"How it works\". */\r\n reopenLabel?: string;\r\n}\r\n\r\nexport interface AdminPageHeaderProps {\r\n /** Page title — required. */\r\n title: string;\r\n /** Single-line muted subtitle under the title. */\r\n subtitle?: string;\r\n /** Icon rendered inline before the title. Pass a Lucide element or any node. */\r\n icon?: ReactNode;\r\n /**\r\n * External help / documentation URL. When set, renders a small icon-button\r\n * that opens the URL in a new tab. Use this to point at app-specific docs.\r\n */\r\n helpUrl?: string;\r\n /** Tooltip / aria-label for the help link. Default \"Help & documentation\". */\r\n helpLabel?: string;\r\n /**\r\n * Right-aligned action slot — typically a primary \"+ New\" button and/or\r\n * secondary controls. Rendered before the help / intro-reopen icon-buttons.\r\n */\r\n actions?: ReactNode;\r\n /**\r\n * Extra header content rendered between `actions` and the trailing\r\n * help / reopen icon-buttons. Used by RecordsAdminShell for its stats strip;\r\n * standalone apps rarely need it.\r\n */\r\n aside?: ReactNode;\r\n /**\r\n * Optional dismissible intro card rendered below the header row.\r\n * See {@link AdminPageHeaderIntro}.\r\n */\r\n intro?: AdminPageHeaderIntro;\r\n /** Extra class on the root container for layout overrides. */\r\n className?: string;\r\n}\r\n\r\nconst TONE_ICON = {\r\n info: Lightbulb,\r\n success: CheckCircle2,\r\n warning: AlertTriangle,\r\n} as const;\r\n\r\nexport function AdminPageHeader({\r\n title, subtitle, icon, helpUrl, helpLabel,\r\n actions, aside, intro, className,\r\n}: AdminPageHeaderProps) {\r\n const titleId = useId();\r\n const resolvedHelpLabel = helpLabel ?? 'Help & documentation';\r\n const resolvedReopenLabel = intro?.reopenLabel ?? 'How it works';\r\n const showReopen = !!intro && intro.dismissed && !!intro.onReopen;\r\n const showIntro = !!intro && !intro.dismissed;\r\n\r\n return (\r\n <header className={`sl-aph${className ? ` ${className}` : ''}`} aria-labelledby={titleId}>\r\n <div className=\"sl-aph__row\">\r\n <div className=\"sl-aph__main\">\r\n <div className=\"sl-aph__text\">\r\n <h1 className=\"sl-aph__title\" id={titleId}>\r\n {icon ? (\r\n <span className=\"sl-aph__icon\" aria-hidden=\"true\">{icon}</span>\r\n ) : null}\r\n <span>{title}</span>\r\n </h1>\r\n {subtitle ? <p className=\"sl-aph__subtitle\">{subtitle}</p> : null}\r\n </div>\r\n </div>\r\n {(actions || aside || helpUrl || showReopen) ? (\r\n <div className=\"sl-aph__aside\">\r\n {actions}\r\n {aside}\r\n {helpUrl ? (\r\n <a\r\n href={helpUrl}\r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n className=\"sl-aph__icon-btn\"\r\n aria-label={resolvedHelpLabel}\r\n title={resolvedHelpLabel}\r\n >\r\n <BookOpen aria-hidden=\"true\" />\r\n </a>\r\n ) : null}\r\n {showReopen ? (\r\n <button\r\n type=\"button\"\r\n onClick={intro!.onReopen}\r\n className=\"sl-aph__icon-btn\"\r\n aria-label={resolvedReopenLabel}\r\n title={resolvedReopenLabel}\r\n >\r\n <HelpCircle aria-hidden=\"true\" />\r\n </button>\r\n ) : null}\r\n </div>\r\n ) : null}\r\n </div>\r\n {showIntro ? <AdminPageHeaderIntroCard intro={intro!} /> : null}\r\n </header>\r\n );\r\n}\r\n\r\nfunction AdminPageHeaderIntroCard({ intro }: { intro: AdminPageHeaderIntro }) {\r\n const tone = intro.tone ?? 'info';\r\n const Icon = TONE_ICON[tone] ?? Info;\r\n return (\r\n <div className=\"sl-aph__intro\" data-tone={tone} role=\"note\">\r\n <div className=\"sl-aph__intro-icon\">\r\n <Icon aria-hidden=\"true\" style={{ width: '0.95rem', height: '0.95rem' }} />\r\n </div>\r\n <div className=\"sl-aph__intro-body\">\r\n <h4 className=\"sl-aph__intro-title\">{intro.title}</h4>\r\n <span className=\"sl-aph__intro-text\">{intro.body}</span>\r\n {intro.action ? <span className=\"sl-aph__intro-action\">{intro.action}</span> : null}\r\n </div>\r\n <button\r\n type=\"button\"\r\n onClick={intro.onDismiss}\r\n aria-label=\"Dismiss\"\r\n className=\"sl-aph__intro-dismiss\"\r\n >\r\n <X aria-hidden=\"true\" style={{ width: '0.875rem', height: '0.875rem' }} />\r\n </button>\r\n </div>\r\n );\r\n}","// =============================================================================\r\n// useHintsPreference\r\n//\r\n// Single source of truth for the user-level \"show inline hints?\" preference.\r\n// Reads from `SL.auth.getAccount().prefs` (the canonical account-level prefs\r\n// bag added in SmartLinks SDK 1.11.5+) so the same flag follows the user\r\n// across every SmartLinks admin app — flip it once, applies everywhere.\r\n// There is intentionally no per-app preference list; that's what\r\n// `useIntroState` (browser-level dismiss) is for.\r\n//\r\n// Writes still flow through `SL.userAppData('prefs')` because the SDK does\r\n// not yet expose a dedicated `auth.setPrefs(...)`. The server treats the\r\n// `prefs` userAppData document as the backing store for `account.prefs`,\r\n// so reads and writes stay in sync.\r\n//\r\n// Shape on `account.prefs`:\r\n// { showHints?: boolean, ...other future flags }\r\n//\r\n// Default when unset / unauthenticated / SDK missing → `true` (show hints).\r\n// =============================================================================\r\nimport { useCallback, useEffect, useRef, useState } from 'react';\r\n\r\nexport const HINTS_PREFS_APP_ID = 'prefs';\r\nexport const HINTS_PREFS_KEY = 'showHints';\r\n\r\n/** Optional cross-tab cache so multiple components share one fetch per session. */\r\nlet cachedShowHints: boolean | undefined;\r\nlet inflight: Promise<boolean> | null = null;\r\n\r\nasync function readShowHints(SL: any): Promise<boolean> {\r\n if (cachedShowHints !== undefined) return cachedShowHints;\r\n if (inflight) return inflight;\r\n inflight = (async () => {\r\n try {\r\n // Read from the authenticated account's prefs bag. `prefs` may be\r\n // absent (server returned no document) — that's fine, we fall back\r\n // to the default below.\r\n const account = await SL?.auth?.getAccount?.();\r\n const value = account?.prefs?.[HINTS_PREFS_KEY];\r\n const resolved = typeof value === 'boolean' ? value : true;\r\n cachedShowHints = resolved;\r\n return resolved;\r\n } catch {\r\n cachedShowHints = true;\r\n return true;\r\n } finally {\r\n inflight = null;\r\n }\r\n })();\r\n return inflight;\r\n}\r\n\r\nasync function writeShowHints(SL: any, next: boolean): Promise<void> {\r\n cachedShowHints = next;\r\n try {\r\n // No dedicated `auth.setPrefs` setter exists yet — write through\r\n // userAppData('prefs'), which the server uses as the backing store\r\n // for `account.prefs`.\r\n const cfg = await SL?.userAppData?.getConfig?.(HINTS_PREFS_APP_ID).catch(() => ({}));\r\n await SL?.userAppData?.setConfig?.(HINTS_PREFS_APP_ID, {\r\n ...(cfg ?? {}),\r\n [HINTS_PREFS_KEY]: next,\r\n });\r\n } catch { /* best-effort */ }\r\n}\r\n\r\nexport interface UseHintsPreferenceResult {\r\n /** Whether inline hints / intro cards should be shown by default. */\r\n showHints: boolean;\r\n /** True until the first read from `userAppData` resolves. */\r\n isLoading: boolean;\r\n /** Persist a new value on the user record. */\r\n setShowHints: (next: boolean) => Promise<void>;\r\n}\r\n\r\n/**\r\n * Subscribe to the user's global `showHints` preference. Optimistic; defaults\r\n * to `true` while loading so admins coming in fresh always see the help.\r\n */\r\nexport function useHintsPreference(SL: any): UseHintsPreferenceResult {\r\n // NB: do NOT lazy-init from a module-level cache — Vite HMR reloads this\r\n // module while React keeps the old hook queue, which trips\r\n // \"Should have a queue. This is likely a bug in React.\". Always init to\r\n // the same shape and rely on the effect below to hydrate.\r\n const [showHints, setShowHintsState] = useState<boolean>(true);\r\n const [isLoading, setIsLoading] = useState<boolean>(true);\r\n const mounted = useRef(true);\r\n\r\n useEffect(() => {\r\n mounted.current = true;\r\n if (cachedShowHints !== undefined) {\r\n setShowHintsState(cachedShowHints);\r\n setIsLoading(false);\r\n return () => { mounted.current = false; };\r\n }\r\n readShowHints(SL).then((value) => {\r\n if (!mounted.current) return;\r\n setShowHintsState(value);\r\n setIsLoading(false);\r\n });\r\n return () => { mounted.current = false; };\r\n }, [SL]);\r\n\r\n const setShowHints = useCallback(async (next: boolean) => {\r\n setShowHintsState(next);\r\n await writeShowHints(SL, next);\r\n }, [SL]);\r\n\r\n return { showHints, isLoading, setShowHints };\r\n}\r\n\r\n/** Test / sign-out helper — drop the in-memory cache. */\r\nexport function __resetHintsPreferenceCache() {\r\n cachedShowHints = undefined;\r\n inflight = null;\r\n}\r\n","// =============================================================================\r\n// useIntroState\r\n//\r\n// One hook that resolves the full intro-card state for an `<AdminPageHeader>`:\r\n//\r\n// 1. Global user preference (`prefs.showHints` on `userAppData`)\r\n// → if `false`, the intro stays collapsed by default. The `?` reopen\r\n// button is still rendered so the user can pop it open whenever.\r\n// 2. Per-browser, per-app temporary dismiss (`localStorage`)\r\n// → flipped by the dismiss `X`, so reloads on this browser keep it\r\n// collapsed until they click `?`.\r\n//\r\n// Apps just call:\r\n// const intro = useIntroState({ SL, persistKey: appId });\r\n// <AdminPageHeader intro={{ title, body, ...intro }} />\r\n// =============================================================================\r\nimport { useCallback, useEffect, useState } from 'react';\r\nimport { useHintsPreference } from './useHintsPreference';\r\n\r\nconst lsKey = (persistKey: string) => `sl:intro-dismissed:${persistKey}`;\r\n\r\nexport interface UseIntroStateArgs {\r\n /** SmartLinks SDK namespace (`* as SL from '@proveanything/smartlinks'`). */\r\n SL: any;\r\n /**\r\n * Stable per-app key used for the browser-level dismiss. Usually the\r\n * app's `appId`. Pass a more specific value (e.g. `${appId}:rules`) if\r\n * you have multiple intros within one app.\r\n */\r\n persistKey: string;\r\n}\r\n\r\nexport interface UseIntroStateResult {\r\n /** Whether the intro card is currently dismissed/collapsed. */\r\n dismissed: boolean;\r\n /** Wire to AdminPageHeader's `intro.onDismiss`. */\r\n onDismiss: () => void;\r\n /** Wire to AdminPageHeader's `intro.onReopen`. Always available. */\r\n onReopen: () => void;\r\n /** True until the user preference has finished loading. */\r\n isLoading: boolean;\r\n}\r\n\r\nfunction readBrowserDismissed(persistKey: string): boolean {\r\n try { return localStorage.getItem(lsKey(persistKey)) === '1'; }\r\n catch { return false; }\r\n}\r\n\r\n/** Resolve dismiss state from global pref + per-browser flag. */\r\nexport function useIntroState({ SL, persistKey }: UseIntroStateArgs): UseIntroStateResult {\r\n const { showHints, isLoading } = useHintsPreference(SL);\r\n const [browserDismissed, setBrowserDismissed] = useState<boolean>(() => readBrowserDismissed(persistKey));\r\n\r\n // Re-read browser flag if the key changes (rare, but cheap).\r\n useEffect(() => {\r\n setBrowserDismissed(readBrowserDismissed(persistKey));\r\n }, [persistKey]);\r\n\r\n const onDismiss = useCallback(() => {\r\n setBrowserDismissed(true);\r\n try { localStorage.setItem(lsKey(persistKey), '1'); } catch { /* ignore */ }\r\n }, [persistKey]);\r\n\r\n const onReopen = useCallback(() => {\r\n setBrowserDismissed(false);\r\n try { localStorage.removeItem(lsKey(persistKey)); } catch { /* ignore */ }\r\n }, [persistKey]);\r\n\r\n // Dismissed when either: user opted out of hints globally, or they X'd it\r\n // on this browser. Reopening always works (it just clears the browser flag\r\n // for this session — global pref stays as-is).\r\n const dismissed = !showHints || browserDismissed;\r\n\r\n return { dismissed, onDismiss, onReopen, isLoading };\r\n}\r\n"]}
@@ -1,4 +1,4 @@
1
- export { A as AssetItem, a as AssetPicker, b as AssetPickerMode, c as AssetPickerProps, d as AssetPickerSelection, e as AssetScope, f as AssetViewMode, u as useAssets } from '../../useAssets-BAtXv6D5.js';
1
+ export { A as AssetItem, a as AssetPicker, b as AssetPickerMode, c as AssetPickerProps, d as AssetPickerSelection, e as AssetScope, f as AssetViewMode, u as useAssets } from '../../useAssets-DwUdZePm.js';
2
2
  import 'react';
3
3
 
4
4
  interface AppRegistryEntry {
@@ -1,7 +1,7 @@
1
- import React from 'react';
1
+ import React__default from 'react';
2
2
  import { d as ConditionsEditorProps } from '../../types-a2DdgZ2H.js';
3
3
  export { C as Condition, a as ConditionGroup, b as ConditionType, c as ConditionTypeMeta, F as FacetOption, e as FacetValueOption, S as SelectOption, V as VersionOption } from '../../types-a2DdgZ2H.js';
4
4
 
5
- declare const ConditionsEditor: React.FC<ConditionsEditorProps>;
5
+ declare const ConditionsEditor: React__default.FC<ConditionsEditorProps>;
6
6
 
7
7
  export { ConditionsEditor, ConditionsEditorProps };
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React__default from 'react';
2
2
  import { FacetRule } from '@proveanything/smartlinks/dist/types/appObjects';
3
3
  export { FacetRule, FacetRuleClause } from '@proveanything/smartlinks/dist/types/appObjects';
4
4
  import { F as FacetOption } from '../../types-a2DdgZ2H.js';
@@ -37,6 +37,6 @@ interface FacetRuleEditorProps {
37
37
  className?: string;
38
38
  }
39
39
 
40
- declare const FacetRuleEditor: React.FC<FacetRuleEditorProps>;
40
+ declare const FacetRuleEditor: React__default.FC<FacetRuleEditorProps>;
41
41
 
42
42
  export { FacetOption, FacetRuleEditor, type FacetRuleEditorProps };
@@ -1,4 +1,4 @@
1
- import React$1 from 'react';
1
+ import React__default from 'react';
2
2
 
3
3
  /** Where the font comes from */
4
4
  type FontSource = 'google' | 'custom';
@@ -121,7 +121,7 @@ interface FontPickerProps {
121
121
  admin?: boolean;
122
122
  }
123
123
 
124
- declare const FontPicker: React$1.FC<FontPickerProps>;
124
+ declare const FontPicker: React__default.FC<FontPickerProps>;
125
125
 
126
126
  declare const GOOGLE_FONTS_CATALOG: FontEntry[];
127
127
  /** Get a Google Fonts CSS URL for a specific font */
@@ -1,5 +1,5 @@
1
- import { I as IconFamily, a as IconStyle } from '../../IconPicker-DKpL5Hcc.js';
2
- export { b as IconPicker, c as IconPickerProps, d as IconSelection } from '../../IconPicker-DKpL5Hcc.js';
1
+ import { I as IconFamily, a as IconStyle } from '../../IconPicker-nhY3wWlB.js';
2
+ export { b as IconPicker, c as IconPickerProps, d as IconSelection } from '../../IconPicker-nhY3wWlB.js';
3
3
  import 'react';
4
4
 
5
5
  declare function toFaClass(id: string, family: IconFamily, style: IconStyle | null): string;
@@ -1,5 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { FacetRule, MatchedAt, AppRecord, RecordTarget, MatchResult, ResolveAllEntry } from '@proveanything/smartlinks/dist/types/appObjects';
3
+ import * as React$1 from 'react';
3
4
  import { ReactNode, ComponentType } from 'react';
4
5
  import { LucideIcon } from 'lucide-react';
5
6
  import * as _tanstack_query_core from '@tanstack/query-core';
@@ -1203,7 +1204,7 @@ interface RecordBrowserProps {
1203
1204
  }
1204
1205
  declare const RecordBrowser: ({ scopes, activeScope, onActiveScopeChange, selectedId, onSelectRef, items, counts, isLoading, error, filter, onFilterChange, search, onSearchChange, hasNextPage, isFetchingNextPage, onLoadMore, scopesLoading, i18n, }: RecordBrowserProps) => react_jsx_runtime.JSX.Element;
1205
1206
 
1206
- interface Props$g {
1207
+ interface Props$h {
1207
1208
  scopes: ScopeKind[];
1208
1209
  active: ScopeKind;
1209
1210
  onChange: (s: ScopeKind) => void;
@@ -1221,20 +1222,20 @@ interface Props$g {
1221
1222
  /** Override icons used per scope. Falls back to DEFAULT_ICONS.scope. */
1222
1223
  icons?: RecordsAdminIcons['scope'];
1223
1224
  }
1224
- declare const ScopeTabs: ({ scopes, active, onChange, loading, counts, tooltips, icons, }: Props$g) => react_jsx_runtime.JSX.Element;
1225
+ declare const ScopeTabs: ({ scopes, active, onChange, loading, counts, tooltips, icons, }: Props$h) => react_jsx_runtime.JSX.Element;
1225
1226
 
1226
- interface Props$f {
1227
+ interface Props$g {
1227
1228
  source?: RecordSource;
1228
1229
  status?: RecordStatus;
1229
1230
  className?: string;
1230
1231
  }
1231
1232
  /** Emerald = own data, amber = inherited, muted = empty */
1232
- declare const StatusDot: ({ source, status, className }: Props$f) => react_jsx_runtime.JSX.Element;
1233
+ declare const StatusDot: ({ source, status, className }: Props$g) => react_jsx_runtime.JSX.Element;
1233
1234
 
1234
1235
  type StatusTone = 'own' | 'shared' | 'missing';
1235
1236
  /** Semantic tones used by host-driven iconography (e.g. lifecycle buckets). */
1236
1237
  type SemanticTone = 'success' | 'warning' | 'danger' | 'muted' | 'info' | 'default';
1237
- interface Props$e {
1238
+ interface Props$f {
1238
1239
  source?: RecordSource;
1239
1240
  status?: RecordStatus;
1240
1241
  className?: string;
@@ -1256,11 +1257,11 @@ interface Props$e {
1256
1257
  */
1257
1258
  semanticTone?: SemanticTone;
1258
1259
  }
1259
- declare const StatusIcon: ({ source, status, className, size, label, iconHint, semanticTone, }: Props$e) => react_jsx_runtime.JSX.Element;
1260
+ declare const StatusIcon: ({ source, status, className, size, label, iconHint, semanticTone, }: Props$f) => react_jsx_runtime.JSX.Element;
1260
1261
  /** Short label rendered next to / under the row title. */
1261
1262
  declare const statusToneLabel: (tone: StatusTone) => string;
1262
1263
 
1263
- interface Props$d {
1264
+ interface Props$e {
1264
1265
  value: 'all' | RecordStatus;
1265
1266
  onChange: (v: 'all' | RecordStatus) => void;
1266
1267
  counts: {
@@ -1275,9 +1276,9 @@ interface Props$d {
1275
1276
  * active filter is always rendered so users never lose context. */
1276
1277
  hideZero?: Array<'all' | RecordStatus>;
1277
1278
  }
1278
- declare const StatusFilterPills: ({ value, onChange, counts, i18n, hideZero }: Props$d) => react_jsx_runtime.JSX.Element;
1279
+ declare const StatusFilterPills: ({ value, onChange, counts, i18n, hideZero }: Props$e) => react_jsx_runtime.JSX.Element;
1279
1280
 
1280
- interface Props$c {
1281
+ interface Props$d {
1281
1282
  items: RecordSummary[];
1282
1283
  /**
1283
1284
  * UUID of the currently-selected row. Matches `RecordSummary.id`. Records
@@ -1348,11 +1349,11 @@ interface Props$c {
1348
1349
  /** Resolved i18n strings — used by default row/card renderers. */
1349
1350
  i18n?: RecordsAdminI18n;
1350
1351
  }
1351
- declare const RecordList: ({ items, selectedId, selectedAnchorKey, onSelect, dirtyId, dirtyAnchorKey, dirtyKeys, errorKeys, presentation, renderListRow, groupBy, renderGroupActions, rowClipboard, rowActions, i18n, }: Props$c) => react_jsx_runtime.JSX.Element;
1352
- declare const ProductList: ({ items, selectedId, selectedAnchorKey, onSelect, dirtyId, dirtyAnchorKey, dirtyKeys, errorKeys, presentation, renderListRow, groupBy, renderGroupActions, rowClipboard, rowActions, i18n, }: Props$c) => react_jsx_runtime.JSX.Element;
1353
- declare const FacetList: ({ items, selectedId, selectedAnchorKey, onSelect, dirtyId, dirtyAnchorKey, dirtyKeys, errorKeys, presentation, renderListRow, groupBy, renderGroupActions, rowClipboard, rowActions, i18n, }: Props$c) => react_jsx_runtime.JSX.Element;
1354
- declare const VariantList: ({ items, selectedId, selectedAnchorKey, onSelect, dirtyId, dirtyAnchorKey, dirtyKeys, errorKeys, presentation, renderListRow, groupBy, renderGroupActions, rowClipboard, rowActions, i18n, }: Props$c) => react_jsx_runtime.JSX.Element;
1355
- declare const BatchList: ({ items, selectedId, selectedAnchorKey, onSelect, dirtyId, dirtyAnchorKey, dirtyKeys, errorKeys, presentation, renderListRow, groupBy, renderGroupActions, rowClipboard, rowActions, i18n, }: Props$c) => react_jsx_runtime.JSX.Element;
1352
+ declare const RecordList: ({ items, selectedId, selectedAnchorKey, onSelect, dirtyId, dirtyAnchorKey, dirtyKeys, errorKeys, presentation, renderListRow, groupBy, renderGroupActions, rowClipboard, rowActions, i18n, }: Props$d) => react_jsx_runtime.JSX.Element;
1353
+ declare const ProductList: ({ items, selectedId, selectedAnchorKey, onSelect, dirtyId, dirtyAnchorKey, dirtyKeys, errorKeys, presentation, renderListRow, groupBy, renderGroupActions, rowClipboard, rowActions, i18n, }: Props$d) => react_jsx_runtime.JSX.Element;
1354
+ declare const FacetList: ({ items, selectedId, selectedAnchorKey, onSelect, dirtyId, dirtyAnchorKey, dirtyKeys, errorKeys, presentation, renderListRow, groupBy, renderGroupActions, rowClipboard, rowActions, i18n, }: Props$d) => react_jsx_runtime.JSX.Element;
1355
+ declare const VariantList: ({ items, selectedId, selectedAnchorKey, onSelect, dirtyId, dirtyAnchorKey, dirtyKeys, errorKeys, presentation, renderListRow, groupBy, renderGroupActions, rowClipboard, rowActions, i18n, }: Props$d) => react_jsx_runtime.JSX.Element;
1356
+ declare const BatchList: ({ items, selectedId, selectedAnchorKey, onSelect, dirtyId, dirtyAnchorKey, dirtyKeys, errorKeys, presentation, renderListRow, groupBy, renderGroupActions, rowClipboard, rowActions, i18n, }: Props$d) => react_jsx_runtime.JSX.Element;
1356
1357
 
1357
1358
  interface DefaultRecordRowProps {
1358
1359
  record: RecordSummary;
@@ -1394,7 +1395,7 @@ declare const ErrorState: ({ error }: {
1394
1395
  error: Error;
1395
1396
  }) => react_jsx_runtime.JSX.Element;
1396
1397
 
1397
- interface Props$b {
1398
+ interface Props$c {
1398
1399
  i18n: RecordsAdminI18n;
1399
1400
  onApplyToMany?: () => void;
1400
1401
  onCopyFrom?: () => void;
@@ -1402,9 +1403,9 @@ interface Props$b {
1402
1403
  onImportCsv?: () => void;
1403
1404
  onExportCsv?: () => void;
1404
1405
  }
1405
- declare const BulkActionsMenu: ({ i18n, onApplyToMany, onCopyFrom, onClearMany, onImportCsv, onExportCsv, }: Props$b) => react_jsx_runtime.JSX.Element | null;
1406
+ declare const BulkActionsMenu: ({ i18n, onApplyToMany, onCopyFrom, onClearMany, onImportCsv, onExportCsv, }: Props$c) => react_jsx_runtime.JSX.Element | null;
1406
1407
 
1407
- interface Props$a<T> {
1408
+ interface Props$b<T> {
1408
1409
  ctx: EditorContext<T>;
1409
1410
  i18n: RecordsAdminI18n;
1410
1411
  children: ReactNode;
@@ -1469,7 +1470,7 @@ interface Props$a<T> {
1469
1470
  /** Host-provided icons rendered before save / discard / delete labels. */
1470
1471
  actionIcons?: Partial<Record<RecordsAdminActionKey, RecordsAdminActionIcon>>;
1471
1472
  }
1472
- declare function RecordEditor<T>({ ctx, i18n, children, preview, targeting, targetingControl, bulkActions, footerExtra, onBeforeDelete, headerLabel, headerSubtitle, headerMeta, headerLeading, clipboard, actionLabels, actionIcons, }: Props$a<T>): react_jsx_runtime.JSX.Element;
1473
+ declare function RecordEditor<T>({ ctx, i18n, children, preview, targeting, targetingControl, bulkActions, footerExtra, onBeforeDelete, headerLabel, headerSubtitle, headerMeta, headerLeading, clipboard, actionLabels, actionIcons, }: Props$b<T>): react_jsx_runtime.JSX.Element;
1473
1474
 
1474
1475
  interface InheritanceCtx {
1475
1476
  parentValue?: Record<string, unknown> | null;
@@ -1487,10 +1488,10 @@ interface MarkerProps {
1487
1488
  }
1488
1489
  declare const InheritanceMarker: ({ field, inheritedValue, value, children }: MarkerProps) => react_jsx_runtime.JSX.Element;
1489
1490
 
1490
- interface Props$9 {
1491
+ interface Props$a {
1491
1492
  children: ReactNode;
1492
1493
  }
1493
- declare const ResolvedPreview: ({ children }: Props$9) => react_jsx_runtime.JSX.Element;
1494
+ declare const ResolvedPreview: ({ children }: Props$a) => react_jsx_runtime.JSX.Element;
1494
1495
 
1495
1496
  interface ProductChildItem {
1496
1497
  /** Variant or batch id (the `<id>` part of `variant:<id>` / `batch:<id>`). */
@@ -1521,7 +1522,7 @@ declare const useProductChildren: (args: UseProductChildrenArgs) => {
1521
1522
  };
1522
1523
 
1523
1524
  type DrillTab = 'product' | 'variant' | 'batch';
1524
- interface Props$8 {
1525
+ interface Props$9 {
1525
1526
  productLabel: string;
1526
1527
  /** Which child types are available on the collection. */
1527
1528
  showVariants: boolean;
@@ -1546,7 +1547,7 @@ interface Props$8 {
1546
1547
  */
1547
1548
  hideSingleTab?: boolean;
1548
1549
  }
1549
- declare const ProductDrillDown: ({ productLabel, showVariants, showBatches, active, onChange, selectedChildId, onSelectChild, variants, batches, variantsLoading, batchesLoading, children, hideSingleTab, }: Props$8) => react_jsx_runtime.JSX.Element;
1550
+ declare const ProductDrillDown: ({ productLabel, showVariants, showBatches, active, onChange, selectedChildId, onSelectChild, variants, batches, variantsLoading, batchesLoading, children, hideSingleTab, }: Props$9) => react_jsx_runtime.JSX.Element;
1550
1551
 
1551
1552
  type PreviewMode = 'inline' | 'side' | 'tab' | 'drawer';
1552
1553
  interface CommonProps {
@@ -1614,6 +1615,16 @@ interface PreviewScopePickerProps {
1614
1615
  }
1615
1616
  declare const PreviewScopePicker: ({ SL, collectionId, editingScope, value, onChange, showVariants, showBatches, activeScope, i18n, }: PreviewScopePickerProps) => react_jsx_runtime.JSX.Element | null;
1616
1617
 
1618
+ interface Props$8 {
1619
+ /** Element whose right edge the pill should anchor to. */
1620
+ anchorRef: React.RefObject<HTMLElement>;
1621
+ onClick: () => void;
1622
+ ariaLabel: string;
1623
+ title: string;
1624
+ children: ReactNode;
1625
+ }
1626
+ declare function PreviewReopenPill({ anchorRef, onClick, ariaLabel, title, children }: Props$8): React$1.ReactPortal | null;
1627
+
1617
1628
  declare const ScopeBreadcrumb: ({ scope }: {
1618
1629
  scope: ParsedRef;
1619
1630
  }) => react_jsx_runtime.JSX.Element | null;
@@ -2795,4 +2806,4 @@ declare const exportCsv: <T>(records: RecordSummary<T>[], schema: CsvSchema<T>)
2795
2806
  declare const importCsv: <T>(file: File, schema: CsvSchema<T>, ctx: RecordsCtx) => Promise<ImportReport>;
2796
2807
  declare const downloadBlob: (blob: Blob, filename: string) => void;
2797
2808
 
2798
- export { ALL_ITEM_VIEWS, ALL_PRESENTATIONS, BatchList, BulkActionsMenu, type ClipboardEntry, type CollectedRecord, type CollectedSort, type CollectionRailMode, type CsvSchema, type CsvSchemaColumn, DEFAULT_DEEP_LINK_PARAM_NAMES, DEFAULT_I18N, DEFAULT_ICONS, type DeepLinkAdapter, type DeepLinkChangeKind, type DeepLinkHistoryMode, type DeepLinkOptions, type DeepLinkParamNames, type DeepLinkState, DefaultItemCards, DefaultItemTable, DefaultRecordCard, DefaultRecordRow, DeleteButton, type DirtyDraft, DirtyDraftProvider, type DirtyDraftStatus, type DirtyDraftStore, type DirtyStrategy, DrawerPreview, type EditorContext, EditorItemNav, EmptyState, ErrorState, FacetList, InheritanceMarker, InheritanceProvider, InlinePreview, IntroCard, type ItemColumn, ItemListView, type ItemSlotContext, type ItemView, type ItemViewContext, ItemViewSwitcher, LoadingState, type MergeStrategy, type MergedRecord, type NavConfirmI18n, type NormalisedRule, type ParsedRef, type PasteCompatibility, type PasteCompatibilityResult, PresentationSwitcher, type PreviewMode, PreviewScopePicker, PreviewToggleButton, type ProductBrowseItem, type ProductChildItem, ProductDrillDown, ProductList, type RecordAction, type RecordBadge, RecordBrowser, type RecordCardinality, RecordEditor, RecordList, type RecordPresentation, type RecordSlotContext, type RecordSource, type RecordStatus, type RecordSummary, type RecordsAdminActionIcon, type RecordsAdminActionKey, type RecordsAdminI18n, type RecordsAdminIcons, RecordsAdminShell, type RecordsAdminShellProps, type ResolvedDeepLinkParamNames, ResolvedPreview, type ResolvedRecord, type RouterParamsGetter, type RouterParamsSetter, ScopeBreadcrumb, type ScopeCounts, type ScopeKind, ScopeTabs, SiblingRail, SidePreview, type SmartLinksSDK, StatusDot, StatusFilterPills, StatusIcon, type StatusTone, TabbedPreview, type TelemetryEvent, type UseCollectionItemsArgs, type UseRecordClipboardArgs, type UseRecordClipboardReturn, type UseResolveAllRecordsArgs, type UseResolveAllResult, type UseRulePreviewArgs, type UseRulePreviewResult, type UseScopeCountsArgs, type UseScopeCountsResult, UtilityRow, VariantList, buildDraftKey, buildRef, bulkDelete, bulkUpsert, checkPasteCompatibility, cloneValue, createDefaultDeepLinkAdapter, createPostMessageDeepLinkAdapter, createRecord, createRouterDeepLinkAdapter, downloadBlob, exportCsv, getRecordById, importCsv, isInSmartLinksIframe, listRecords, matchRecords, mergeIcons, normaliseRule, parseRef, parsedRefToScope, parsedRefToTarget, pickHeaderIcon, removeRecord, resolutionChain, resolveRecord, restoreRecord, ruleHash, rulesEqual, scopeCountsQueryKey, scopesEqual, statusToneLabel, summariseRule, upsertRecord, useCollectedRecords, useCollectionItems, useDeepLinkState, useDirtyDraft, useDirtyDraftActions, useDirtyDraftStore, useDirtyDrafts, useDirtyNavigation, useFacetBrowse, useIntroDismissed, useItemViewPref, useMergedRecord, usePresentationPref, useProductBrowse, useProductChildren, useRecordClipboard, useRecordEditor, useRecordList, useResolveAllRecords, useResolvedRecord, useRulePreview, useScopeCounts, useScopeProbe, useUnsavedGuard };
2809
+ export { ALL_ITEM_VIEWS, ALL_PRESENTATIONS, BatchList, BulkActionsMenu, type ClipboardEntry, type CollectedRecord, type CollectedSort, type CollectionRailMode, type CsvSchema, type CsvSchemaColumn, DEFAULT_DEEP_LINK_PARAM_NAMES, DEFAULT_I18N, DEFAULT_ICONS, type DeepLinkAdapter, type DeepLinkChangeKind, type DeepLinkHistoryMode, type DeepLinkOptions, type DeepLinkParamNames, type DeepLinkState, DefaultItemCards, DefaultItemTable, DefaultRecordCard, DefaultRecordRow, DeleteButton, type DirtyDraft, DirtyDraftProvider, type DirtyDraftStatus, type DirtyDraftStore, type DirtyStrategy, DrawerPreview, type EditorContext, EditorItemNav, EmptyState, ErrorState, FacetList, InheritanceMarker, InheritanceProvider, InlinePreview, IntroCard, type ItemColumn, ItemListView, type ItemSlotContext, type ItemView, type ItemViewContext, ItemViewSwitcher, LoadingState, type MergeStrategy, type MergedRecord, type NavConfirmI18n, type NormalisedRule, type ParsedRef, type PasteCompatibility, type PasteCompatibilityResult, PresentationSwitcher, type PreviewMode, PreviewReopenPill, PreviewScopePicker, PreviewToggleButton, type ProductBrowseItem, type ProductChildItem, ProductDrillDown, ProductList, type RecordAction, type RecordBadge, RecordBrowser, type RecordCardinality, RecordEditor, RecordList, type RecordPresentation, type RecordSlotContext, type RecordSource, type RecordStatus, type RecordSummary, type RecordsAdminActionIcon, type RecordsAdminActionKey, type RecordsAdminI18n, type RecordsAdminIcons, RecordsAdminShell, type RecordsAdminShellProps, type ResolvedDeepLinkParamNames, ResolvedPreview, type ResolvedRecord, type RouterParamsGetter, type RouterParamsSetter, ScopeBreadcrumb, type ScopeCounts, type ScopeKind, ScopeTabs, SiblingRail, SidePreview, type SmartLinksSDK, StatusDot, StatusFilterPills, StatusIcon, type StatusTone, TabbedPreview, type TelemetryEvent, type UseCollectionItemsArgs, type UseRecordClipboardArgs, type UseRecordClipboardReturn, type UseResolveAllRecordsArgs, type UseResolveAllResult, type UseRulePreviewArgs, type UseRulePreviewResult, type UseScopeCountsArgs, type UseScopeCountsResult, UtilityRow, VariantList, buildDraftKey, buildRef, bulkDelete, bulkUpsert, checkPasteCompatibility, cloneValue, createDefaultDeepLinkAdapter, createPostMessageDeepLinkAdapter, createRecord, createRouterDeepLinkAdapter, downloadBlob, exportCsv, getRecordById, importCsv, isInSmartLinksIframe, listRecords, matchRecords, mergeIcons, normaliseRule, parseRef, parsedRefToScope, parsedRefToTarget, pickHeaderIcon, removeRecord, resolutionChain, resolveRecord, restoreRecord, ruleHash, rulesEqual, scopeCountsQueryKey, scopesEqual, statusToneLabel, summariseRule, upsertRecord, useCollectedRecords, useCollectionItems, useDeepLinkState, useDirtyDraft, useDirtyDraftActions, useDirtyDraftStore, useDirtyDrafts, useDirtyNavigation, useFacetBrowse, useIntroDismissed, useItemViewPref, useMergedRecord, usePresentationPref, useProductBrowse, useProductChildren, useRecordClipboard, useRecordEditor, useRecordList, useResolveAllRecords, useResolvedRecord, useRulePreview, useScopeCounts, useScopeProbe, useUnsavedGuard };
@@ -1,4 +1,4 @@
1
- import { useIntroState, AdminPageHeader } from '../../chunk-BNC6Z6WB.js';
1
+ import { useIntroState, AdminPageHeader } from '../../chunk-3RRHM4LP.js';
2
2
  import { assertComponentStylesLoaded } from '../../chunk-OLYC54YT.js';
3
3
  import '../../chunk-5UQQYXCX.js';
4
4
  import { FacetRuleEditor } from '../../chunk-JMCV6FOW.js';
@@ -6,7 +6,7 @@ import { useFacets } from '../../chunk-4LHF5JB7.js';
6
6
  import { cn } from '../../chunk-L7FQ52F5.js';
7
7
  import { parsedRefToTarget, parsedRefToScope, matchRecords, scopesEqual, getRecordById, listRecords, upsertRecord, updateRecord, createRecord, removeRecord } from '../../chunk-KA4MKRHL.js';
8
8
  export { bulkDelete, bulkUpsert, createRecord, getRecordById, listRecords, matchRecords, parsedRefToScope, parsedRefToTarget, removeRecord, restoreRecord, scopesEqual, upsertRecord } from '../../chunk-KA4MKRHL.js';
9
- import { createContext, useMemo, useState, useEffect, useCallback, useRef, isValidElement, useContext, useSyncExternalStore, useLayoutEffect, createElement } from 'react';
9
+ import { createContext, useMemo, useState, useEffect, useCallback, useRef, isValidElement, useLayoutEffect, useContext, useSyncExternalStore, createElement } from 'react';
10
10
  import { ChevronDown, Database, Lightbulb, SearchX, Inbox, LayoutGrid, Eye, MoreHorizontal, Download, Upload, Trash2, Copy, Pencil, Plus, CircleDashed, ArrowDownLeft, CheckCircle2, List, SlidersHorizontal, Globe, Tag, Boxes, Layers, Package, Target, Rows3, ChevronRight, Eraser, ClipboardPaste, Box, X, Search, Image, Table, ArrowLeft, ChevronLeft, AlertTriangle, Info, HelpCircle, CornerDownLeft, Circle, ArrowUpDown, ArrowUp, ArrowDown, MinusCircle, XCircle, CopyPlus, AlertCircle, Undo2, Save, Loader2, ArrowRight, Globe2, Check, Settings2 } from 'lucide-react';
11
11
  import { useQuery, useQueryClient, useInfiniteQuery } from '@tanstack/react-query';
12
12
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -7390,12 +7390,19 @@ function PreviewReopenPill({ anchorRef, onClick, ariaLabel, title, children }) {
7390
7390
  const rafRef = useRef(null);
7391
7391
  useLayoutEffect(() => {
7392
7392
  const el = anchorRef.current;
7393
- if (!el || typeof window === "undefined") return;
7393
+ if (typeof window === "undefined") return;
7394
+ if (!el) {
7395
+ setPos({ top: window.innerHeight / 2, right: 8 });
7396
+ return;
7397
+ }
7394
7398
  const measure = () => {
7395
7399
  if (rafRef.current != null) cancelAnimationFrame(rafRef.current);
7396
7400
  rafRef.current = requestAnimationFrame(() => {
7397
7401
  const rect = el.getBoundingClientRect();
7398
- if (rect.width === 0 && rect.height === 0) return;
7402
+ if (rect.width === 0 && rect.height === 0) {
7403
+ setPos({ top: window.innerHeight / 2, right: 8 });
7404
+ return;
7405
+ }
7399
7406
  setPos({
7400
7407
  top: rect.top + rect.height / 2,
7401
7408
  right: Math.max(0, window.innerWidth - rect.right)
@@ -7415,7 +7422,11 @@ function PreviewReopenPill({ anchorRef, onClick, ariaLabel, title, children }) {
7415
7422
  if (rafRef.current != null) cancelAnimationFrame(rafRef.current);
7416
7423
  };
7417
7424
  }, [anchorRef]);
7418
- if (typeof document === "undefined" || !pos) return null;
7425
+ if (typeof document === "undefined") return null;
7426
+ const effectivePos = pos ?? {
7427
+ top: typeof window !== "undefined" ? window.innerHeight / 2 : 200,
7428
+ right: 8
7429
+ };
7419
7430
  return createPortal(
7420
7431
  /* @__PURE__ */ jsx(
7421
7432
  "button",
@@ -7427,8 +7438,8 @@ function PreviewReopenPill({ anchorRef, onClick, ariaLabel, title, children }) {
7427
7438
  title,
7428
7439
  style: {
7429
7440
  position: "fixed",
7430
- top: pos.top,
7431
- right: pos.right,
7441
+ top: effectivePos.top,
7442
+ right: effectivePos.right,
7432
7443
  // Pull half the pill width out into the gutter so it visually
7433
7444
  // anchors *to* the editor edge rather than sitting inside it.
7434
7445
  transform: "translate(50%, -50%)"
@@ -10474,6 +10485,6 @@ function useMergedRecord(args) {
10474
10485
  // src/components/RecordsAdmin/index.ts
10475
10486
  assertComponentStylesLoaded("records-admin");
10476
10487
 
10477
- export { ALL_ITEM_VIEWS, ALL_PRESENTATIONS, BatchList, BulkActionsMenu, DEFAULT_DEEP_LINK_PARAM_NAMES, DEFAULT_I18N, DEFAULT_ICONS, DefaultItemCards, DefaultItemTable, DefaultRecordCard, DefaultRecordRow, DeleteButton, DirtyDraftProvider, DrawerPreview, EditorItemNav, EmptyState, ErrorState, FacetList, InheritanceMarker, InheritanceProvider, InlinePreview, IntroCard, ItemListView, ItemViewSwitcher, LoadingState, PresentationSwitcher, PreviewScopePicker, PreviewToggleButton, ProductDrillDown, ProductList, RecordBrowser, RecordEditor, RecordList, RecordsAdminShell, ResolvedPreview, ScopeBreadcrumb, ScopeTabs, SiblingRail, SidePreview, StatusDot, StatusFilterPills, StatusIcon, TabbedPreview, UtilityRow, VariantList, buildDraftKey, buildRef, checkPasteCompatibility, cloneValue, createDefaultDeepLinkAdapter, createPostMessageDeepLinkAdapter, createRouterDeepLinkAdapter, downloadBlob, exportCsv, importCsv, isInSmartLinksIframe, mergeIcons, normaliseRule, parseRef, pickHeaderIcon, resolutionChain, resolveRecord, ruleHash, rulesEqual, scopeCountsQueryKey, statusToneLabel, summariseRule, useCollectedRecords, useCollectionItems, useDeepLinkState, useDirtyDraft, useDirtyDraftActions, useDirtyDraftStore, useDirtyDrafts, useDirtyNavigation, useFacetBrowse, useIntroDismissed, useItemViewPref, useMergedRecord, usePresentationPref, useProductBrowse, useProductChildren, useRecordClipboard, useRecordEditor, useRecordList, useResolveAllRecords, useResolvedRecord, useRulePreview, useScopeCounts, useScopeProbe, useUnsavedGuard };
10488
+ export { ALL_ITEM_VIEWS, ALL_PRESENTATIONS, BatchList, BulkActionsMenu, DEFAULT_DEEP_LINK_PARAM_NAMES, DEFAULT_I18N, DEFAULT_ICONS, DefaultItemCards, DefaultItemTable, DefaultRecordCard, DefaultRecordRow, DeleteButton, DirtyDraftProvider, DrawerPreview, EditorItemNav, EmptyState, ErrorState, FacetList, InheritanceMarker, InheritanceProvider, InlinePreview, IntroCard, ItemListView, ItemViewSwitcher, LoadingState, PresentationSwitcher, PreviewReopenPill, PreviewScopePicker, PreviewToggleButton, ProductDrillDown, ProductList, RecordBrowser, RecordEditor, RecordList, RecordsAdminShell, ResolvedPreview, ScopeBreadcrumb, ScopeTabs, SiblingRail, SidePreview, StatusDot, StatusFilterPills, StatusIcon, TabbedPreview, UtilityRow, VariantList, buildDraftKey, buildRef, checkPasteCompatibility, cloneValue, createDefaultDeepLinkAdapter, createPostMessageDeepLinkAdapter, createRouterDeepLinkAdapter, downloadBlob, exportCsv, importCsv, isInSmartLinksIframe, mergeIcons, normaliseRule, parseRef, pickHeaderIcon, resolutionChain, resolveRecord, ruleHash, rulesEqual, scopeCountsQueryKey, statusToneLabel, summariseRule, useCollectedRecords, useCollectionItems, useDeepLinkState, useDirtyDraft, useDirtyDraftActions, useDirtyDraftStore, useDirtyDrafts, useDirtyNavigation, useFacetBrowse, useIntroDismissed, useItemViewPref, useMergedRecord, usePresentationPref, useProductBrowse, useProductChildren, useRecordClipboard, useRecordEditor, useRecordList, useResolveAllRecords, useResolvedRecord, useRulePreview, useScopeCounts, useScopeProbe, useUnsavedGuard };
10478
10489
  //# sourceMappingURL=index.js.map
10479
10490
  //# sourceMappingURL=index.js.map