Skip to content

Commit 8fefefd

Browse files
refactor(react,fields)!: retire 26 zero-consumer entry exports (#30650)
<!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuGMYfayAZsFXYZK2K9ASCnF)_ Part of #25921. The umbrella stays open; this is barrel batch 4, claim 6667585132 (seat `domain:ui#6`, batch amendment from the seat after the census). Earlier batches: #30541, #30576, #30629. Clause-②: no (narrowing) Metadata-protocol: none ## 维护者速读 - 改了什么:`@object-ui/react` 的包入口不再导出 20 个名字,其中 7 个连同代码一起删掉(两个无人使用的动效 hook 模块 `useReducedMotion` / `useViewTransition` 及其两个类型、`useHasPageVariables`、`getShortcutDescriptions`、`AnimationTriggerType`),其余 13 个只离开入口、模块照旧;`@object-ui/fields` 的包入口不再导出 6 个名字(四个文件值辅助、筛选条件的额外运算符清单、表格列求和),模块全部保留。 - 为什么改:这 26 个名字在仓内(包外,含测试与文档)与 hotcrm 均零引用,README 未教,也不被保留导出的签名用到;被删的 7 个在包内也零读者,是死代码。本卡逐包收窄无人使用的公开导出。 - 风险与回滚:对外是 breaking 收窄,只影响直接从包入口 import 这些名字的外部宿主;控制台与所有 `@object-ui/*` 包不受影响。入口的 `export *` 改成了具名列表,反向探针证明其余 516 个名字一个不少。回滚即 revert 本 PR。 - 先看:`ui/packages/react/src/context/index.ts` 与 `ui/packages/react/src/index.ts`(`export *` 改具名列表,漏列即丢活名)、`ui/packages/fields/src/index.tsx`(三处同类改写)、两份 `.changeset/25921-*-zero-consumer-exports.md`(迁移说明)。 - 两分钟验证:`git grep -l -w -e useViewTransition -e useHasPageVariables -e NoDataSourcePanel -e sumColumn -- ':!ui/packages/react' ':!ui/packages/fields' ':!**/CHANGELOG.md'` 应只命中本 PR 的两份 changeset。 - 需要你做的:无,席位落地。 ## What changes - `@object-ui/react`, deleted (nothing inside the package read them either): the modules `src/hooks/useReducedMotion.ts` (`useReducedMotion`) and `src/hooks/useViewTransition.ts` (`useViewTransition`, `ViewTransitionConfig`, `ViewTransitionResult`); the function `useHasPageVariables` from `hooks/usePageVariables.tsx`; the function `getShortcutDescriptions` from `hooks/useKeyboardShortcuts.ts`; the type `AnimationTriggerType` from `hooks/useAnimation.ts`. Each was re-grepped on the new head: the only hits left are this PR's changeset. - `@object-ui/react`, off the entry only (the module keeps its readers): `formatUnresolvableVisibilityMessage`, `evaluateConfigBagInScope`, `SUPPORTED_TRANSITION_PRESETS`, `SUPPORTED_EASING_FUNCTIONS`, `useOptionalTheme`, `resolveNotificationPresentation`, `SUPPORTED_NOTIFICATION_DISPLAY_TYPES`, `SUPPORTED_NOTIFICATION_POSITIONS`, `SUPPORTED_NOTIFICATION_ACTION_VARIANTS`, `HostMapStyleContext`, `RecordPagePreferencesContext`, `PrintPageContext`, `NoDataSourcePanel`. The entry reached them through `export *`, so `src/index.ts` (`SchemaRenderer.js`, `ElementDataSourceGate.js`), `src/hooks/index.ts` (`useAnimation.js`) and `src/context/index.ts` (`ThemeContext.js`, `NotificationContext.js`, `HostMapStyleContext.js`, `RecordPagePreferencesContext.js`, `PrintPageContext.js`) now name every kept export of those modules, listed from the TypeScript checker's export list; the `visibilityDiagnostic` named list drops one line. - `@object-ui/fields`, off the entry only: `isImageValue`, `uploadResultView`, `withRecentUploads`, `FILE_STORAGE_BASE_PATH` (`widgets/file-value.ts`), `FILTER_CONDITION_EXTRA_OPERATORS` (`widgets/FilterConditionField.tsx`), `sumColumn` (`widgets/GridField.tsx`). The three `export *` lines for those modules in `src/index.tsx` become named lists of their kept exports. - Two new changesets, `.changeset/25921-react-zero-consumer-exports.md` and `.changeset/25921-fields-zero-consumer-exports.md`: patch level, `!` title, BREAKING paragraph that says which names are gone from the package and which only left the entry, FROM/TO lines for every retired name, ADR-0087 marker `not-required (runtime-export-retired …)` naming every operand. - No test moves: no in-package test imports a retired name from the entry, and the deleted code had no test. ## Why Card #25921 narrows `ui/packages` barrels to names someone imports. The checker export list after this PR is exactly the census list minus these 26 (react 324 to 304, fields 218 to 212), nothing added, and every kept name resolves to the same declaring module as before. ## Tests Census on `origin/main` b90a6f7 with the method of batches 1 to 3: entry export names from the TypeScript checker; per name `git grep -l -w -F` outside the package, minus `**/CHANGELOG.md`, `pnpm-lock.yaml` and `.changeset/**` (test files count); the package `*.md` (glob, top-level README included) and `demo/`; keep rule 3 (reached from a kept export's declared signature, walked through non-exported local declarations too, which is what keeps `DropZoneConfig`); hotcrm `6961ab1`. Full table: project file `issue-25921-seat6/census-b4.md`. | Package | Entry names | Zero outside hits | Kept (README, rule 3, or seat ruling) | Retired | |:--|--:|--:|--:|--:| | `@object-ui/react` | 324 | 104 | 84 (79 rule 3, 5 by seat ruling) | 20 | | `@object-ui/fields` | 218 | 31 | 25 (2 README, 19 rule 3, 4 by seat ruling) | 6 | Kept by seat ruling, zero hits notwithstanding: react `UNRESOLVABLE_ENABLEMENT_PREFIX` (the entry comment names a host contract, and its sibling `UNRESOLVABLE_VISIBILITY_PREFIX` has readers), `createLazyPlugin` / `preloadPlugin` / `LazyPluginOptions` (`content/docs/frontend/architecture-overview.mdx` teaches the module), `RELATED_CHANGED_EVENT` (plugin-detail spells its literal); fields `UploadIncompleteError` (thrown by the kept `fileValueForSubmit`), `deriveHexBadgePalette` / `HexBadgePalette` / `UrlCellRenderer` (declared in `index.tsx`, a module move). Controls (outside hits): `SchemaRenderer` 1104, `ElementDataSourceGate` 102, `useTheme` 13, `usePageVariables` 10, `useNotifications` 9, `usePrintPage` 7, `HostMapStyleProvider` 5, `reportUnresolvableVisibilityPredicate` 3, `useRecordPagePreferences` 3, `useConfigBagEvaluator` 3, `useAnimation` 1, `useKeyboardShortcuts` 1; `isMatchAllCriteria` 10, `fileValueForSubmit` 2, `readFileValue` 2, `lookupAutofillPatch` 2; hotcrm imports `@object-ui/react` in 3 files. Readings at c5c2149: - Build: `turbo run build --filter=@object-ui/console... --filter='./packages/**' --filter='@objectstack/dogfood^...'` 113 of 113, VERDICT command-exit 0; then `turbo run build --force --filter=@object-ui/react --filter=@object-ui/fields` (50 of 50) and `type-check` for both (`tsc --noEmit && tsc -p tsconfig.test.json`), VERDICT command-exit 0. - `pnpm --filter @object-ui/react test`: Test Files 137 passed (137), Tests 1568 passed (1568), exit 0. `pnpm --filter @object-ui/fields test`: Test Files 298 passed, 1 skipped (299), Tests 4467 passed, 7 skipped (4474), exit 0. - Reverse check on the rebuilt `.d.ts`, covering every kept name and not only the retired ones: two temporary `app-shell` probes re-exporting ALL 324 base entry names of `@object-ui/react` and all 218 of `@object-ui/fields`, `tsc --noEmit -p tsconfig.json` in `ui/packages/app-shell`: exactly 26 errors (`TS2305` / `TS2724 … has no exported member`), all in the probes, and the set of names they name is identical (`diff`) to the 26 retired names; the other 516 resolved. Probes deleted; `git status` clean. - `vitest run scripts/` (ui): Test Files 170 passed, 2 skipped (172); Tests 4970 passed, 2 skipped (4972); VERDICT command-exit 0. - Derived gate families (`dispatch-gates --commands`): 29 derived, 29 run, each exit 0 captured before any pipe; `--ran` reconciliation: 29 run, 0 NOT-MEASURED (a derived zero: all 29 recorded an exit code, none is 3). `check-platform-checklist --changed-from origin/main`: exit 0, 0 anchored files. - Dogfood battery (closure above plus `pnpm --filter @objectstack/dogfood test` under the lock): Test Files 420 passed, 3 skipped (423); Tests 3504 passed, 36 skipped (3540); VERDICT command-exit 0 (20m45s, shared box). - No ablation: export lines and dead declarations removed, no tested behaviour changed. - Consumer type-check (`Type Check UI`) is CI's: no consumer imports a retired name (census), and the reverse probe reads the same rebuilt `.d.ts` the consumers read. ## Acceptance notes - Branch name is the platform-assigned `claude/project-thread-r79zcv`, not `claude/issue-25921-*`. - `content/docs/frontend/architecture-overview.mdx:143` says plugins are wrapped by `LazyPluginLoader`, but `createLazyPlugin` / `preloadPlugin` have no reader anywhere outside their own jsdoc test; deleting the module and correcting that paragraph is a separate decision (kept here by seat ruling). - plugin-detail `RelatedList.tsx` and two of its tests write the `objectui:related-changed` literal instead of importing `RELATED_CHANGED_EVENT`. - A contract-review-tier review is owed before the queue (narrowing batch); the seat runs it. - Left for later batches: `components` (about 65 zero-hit shadcn sub-parts), `core` (about 47), `layout` / `plugin-editor` / `permissions` (1 each); fields names declared in `index.tsx` need a module move first. --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgU8CeF9ECf7uDwJLVA)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 77c203a commit 8fefefd

11 files changed

Lines changed: 121 additions & 243 deletions
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@object-ui/fields': patch
3+
---
4+
5+
refactor(fields)!: retire six zero-consumer exports (four file-value helpers, the filter-condition extra operators, the grid column sum)
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (runtime-export-retired @object-ui/fields#isImageValue, @object-ui/fields#uploadResultView, @object-ui/fields#withRecentUploads, @object-ui/fields#FILE_STORAGE_BASE_PATH, @object-ui/fields#FILTER_CONDITION_EXTRA_OPERATORS, @object-ui/fields#sumColumn) the retired operands are three file-value helper functions, a storage path constant, an operator list and a column sum helper; nothing in the workspace or in hotcrm imports any of them from the package entry, and no packages/spec schema, registered node type, conversion surface or stored shape names them, so there is nothing for `objectstack migrate meta` to rewrite -->
11+
12+
**BREAKING** for a host that imports any of these six names from `@object-ui/fields`. None had an importer anywhere in the workspace or in hotcrm, so the Console and every `@object-ui/*` package are unaffected. Every module stays in the package: `FileField`, `ImageField` and `AvatarField` keep reading the file-value helpers, `FilterConditionField` keeps offering its extra operators, `fileUrlFromId` keeps building on the storage base path and `GridField` keeps summing its total column. Only the entry stops publishing them. `fileIdOf`, `fileUrlFromId`, `readFileValue`, `readFileValues`, `fileValueForSubmit`, `isFileIdToken`, `UploadIncompleteError`, the `FileValueView` and `UploadResultLike` types, `condToMongo`, `kvToCondition`, `isMatchAllCriteria`, `FilterConditionField`, `evalArith`, `lookupAutofillPatch`, `computeRow`, `GridField`, `LineItemsField` and the `GridColumn` type stay exported unchanged.
13+
14+
What leaves, and what to write instead:
15+
16+
- FROM `isImageValue` TO `readFileValue(value)` and a check on its `mimeType`.
17+
- FROM `uploadResultView`, `withRecentUploads` TO `FileField` / `ImageField` / `AvatarField`, which show a just-uploaded file themselves.
18+
- FROM `FILE_STORAGE_BASE_PATH` TO `fileUrlFromId`, which builds the download URL for a file id on that path.
19+
- FROM `FILTER_CONDITION_EXTRA_OPERATORS` TO `FilterConditionField`, which offers those operators itself.
20+
- FROM `sumColumn` TO `GridField`, which draws the total of its declared total column, or a local reduce over the rows.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
'@object-ui/react': patch
3+
---
4+
5+
refactor(react)!: retire twenty zero-consumer exports, and delete the two motion hooks, two helpers and one type nothing reads
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (runtime-export-retired @object-ui/react#formatUnresolvableVisibilityMessage, @object-ui/react#evaluateConfigBagInScope, @object-ui/react#useHasPageVariables, @object-ui/react#getShortcutDescriptions, @object-ui/react#useReducedMotion, @object-ui/react#AnimationTriggerType, @object-ui/react#SUPPORTED_TRANSITION_PRESETS, @object-ui/react#SUPPORTED_EASING_FUNCTIONS, @object-ui/react#useViewTransition, @object-ui/react#ViewTransitionConfig, @object-ui/react#ViewTransitionResult, @object-ui/react#useOptionalTheme, @object-ui/react#resolveNotificationPresentation, @object-ui/react#SUPPORTED_NOTIFICATION_DISPLAY_TYPES, @object-ui/react#SUPPORTED_NOTIFICATION_POSITIONS, @object-ui/react#SUPPORTED_NOTIFICATION_ACTION_VARIANTS, @object-ui/react#HostMapStyleContext, @object-ui/react#RecordPagePreferencesContext, @object-ui/react#PrintPageContext, @object-ui/react#NoDataSourcePanel) the retired operands are four React hooks, a shortcut-description helper, three raw context objects, a diagnostic formatter, a config-bag evaluator, a fallback panel component, five supported-value sets, one presentation resolver, two hook interfaces and one string-union type; nothing in the workspace or in hotcrm imports any of them from the package entry, and no packages/spec schema, registered node type, conversion surface or stored shape names them, so there is nothing for `objectstack migrate meta` to rewrite -->
11+
12+
**BREAKING** for a host that imports any of these twenty names from `@object-ui/react`. None had an importer anywhere in the workspace or in hotcrm, so the Console and every `@object-ui/*` package are unaffected.
13+
14+
Seven of them are **gone from the package, not only from the entry**, because nothing inside the package read them either: the `hooks/useReducedMotion.ts` module (`useReducedMotion`) and the `hooks/useViewTransition.ts` module (`useViewTransition`, `ViewTransitionConfig`, `ViewTransitionResult`) are deleted, and the functions `useHasPageVariables` and `getShortcutDescriptions` and the type `AnimationTriggerType` are deleted from their modules.
15+
16+
The other thirteen stay in their modules for the code that reads them and only leave the entry: `formatUnresolvableVisibilityMessage` (the visibility reporter still formats with it), `evaluateConfigBagInScope` (`useConfigBagEvaluator` still calls it), `SUPPORTED_TRANSITION_PRESETS` / `SUPPORTED_EASING_FUNCTIONS` and the three `SUPPORTED_NOTIFICATION_*` sets (the spec-parity tests still hold them against the spec vocabularies, and `resolveNotificationPosition` still checks positions against its set), `useOptionalTheme`, `resolveNotificationPresentation` (`NotificationProvider` still calls it), the raw `HostMapStyleContext` / `RecordPagePreferencesContext` / `PrintPageContext` objects, and `NoDataSourcePanel` (`ElementDataSourceGate` still renders it). Every other name the entry exported stays exported unchanged, among them `reportUnresolvableVisibilityPredicate`, `UNRESOLVABLE_VISIBILITY_PREFIX`, `UNRESOLVABLE_ENABLEMENT_PREFIX`, `useAnimation`, `useTheme`, `useNotifications`, `NotificationProvider`, the `HostMapStyleProvider` / `RecordPagePreferencesProvider` / `PrintPageProvider` providers with their `useHostMapStyle` / `useRecordPagePreferences` / `usePrintPage` hooks, `usePageVariables`, `useKeyboardShortcuts` and `ElementDataSourceGate`.
17+
18+
What leaves, and what to write instead:
19+
20+
- FROM `useReducedMotion` TO `window.matchMedia('(prefers-reduced-motion: reduce)')` in your own hook; the package no longer carries one.
21+
- FROM `useViewTransition`, `ViewTransitionConfig`, `ViewTransitionResult` TO `document.startViewTransition` called directly; the package no longer carries a wrapper.
22+
- FROM `useHasPageVariables` TO `usePageVariables()`, which answers a frozen empty value outside a `PageVariablesProvider`.
23+
- FROM `getShortcutDescriptions` TO a local map over your `KeyboardShortcutDefinition[]` (filter on `description` and `enabled !== false`).
24+
- FROM `AnimationTriggerType` TO a local string union: no function in the package takes it.
25+
- FROM `formatUnresolvableVisibilityMessage` TO `reportUnresolvableVisibilityPredicate`, which formats and reports in one call; filter its lines by `UNRESOLVABLE_VISIBILITY_PREFIX` / `UNRESOLVABLE_ENABLEMENT_PREFIX`.
26+
- FROM `evaluateConfigBagInScope` TO `SchemaRenderer`, which evaluates a node's config bag itself.
27+
- FROM `SUPPORTED_TRANSITION_PRESETS`, `SUPPORTED_EASING_FUNCTIONS` TO the `TransitionPresetType` / `EasingPreset` types, or the spec's `TransitionPresetSchema` / `EasingFunctionSchema` for a runtime list.
28+
- FROM `useOptionalTheme` TO `useTheme` inside a `ThemeProvider`.
29+
- FROM `resolveNotificationPresentation` TO `useNotificationsByPresentation(presentation)`, which returns the notifications a surface of that presentation renders.
30+
- FROM `SUPPORTED_NOTIFICATION_DISPLAY_TYPES`, `SUPPORTED_NOTIFICATION_POSITIONS`, `SUPPORTED_NOTIFICATION_ACTION_VARIANTS` TO the `NotificationDisplayType` / `NotificationPositionValue` / `NotificationActionVariant` types, or `resolveNotificationPosition` to normalize a position.
31+
- FROM `HostMapStyleContext`, `RecordPagePreferencesContext`, `PrintPageContext` TO their providers (`HostMapStyleProvider`, `RecordPagePreferencesProvider`, `PrintPageProvider`) and hooks (`useHostMapStyle`, `useRecordPagePreferences`, `usePrintPage`).
32+
- FROM `NoDataSourcePanel` TO `ElementDataSourceGate`, which renders it when no data source resolves, or `noDataSourceMessage` for the text.

‎ui/packages/fields/src/index.tsx‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5420,7 +5420,18 @@ export * from './widgets/types.js';
54205420
// File field value shapes (ObjectStack ADR-0104 D3 wave 2) — the single
54215421
// arbiter of reference vs expanded vs legacy-blob form, shared by the upload
54225422
// widgets and by action-param serialization.
5423-
export * from './widgets/file-value.js';
5423+
// isImageValue, uploadResultView, withRecentUploads and FILE_STORAGE_BASE_PATH
5424+
// stay module-level: the upload widgets read them; no host does.
5425+
export {
5426+
fileIdOf,
5427+
fileUrlFromId,
5428+
readFileValue,
5429+
readFileValues,
5430+
fileValueForSubmit,
5431+
isFileIdToken,
5432+
UploadIncompleteError,
5433+
} from './widgets/file-value.js';
5434+
export type { FileValueView, UploadResultLike } from './widgets/file-value.js';
54245435
export * from './FieldEditWidget.js';
54255436
export * from './widgets/TextField.js';
54265437
export * from './widgets/NumberField.js';
@@ -5445,7 +5456,7 @@ export * from './widgets/RichTextField.js';
54455456
export * from './widgets/LookupField.js';
54465457
export * from './widgets/CapabilityMultiSelectField.js';
54475458
export * from './widgets/ObjectRefField.js';
5448-
export * from './widgets/FilterConditionField.js';
5459+
export { condToMongo, kvToCondition, isMatchAllCriteria, FilterConditionField } from './widgets/FilterConditionField.js';
54495460
export * from './widgets/RecipientPickerField.js';
54505461
// The kind table and the two spellings the reference widgets share with a host
54515462
// face (objectui#12613), published so the face names a stored value as the
@@ -5484,7 +5495,8 @@ export * from './widgets/AutoNumberField.js';
54845495
export * from './widgets/UserField.js';
54855496
export * from './widgets/ObjectField.js';
54865497
export * from './widgets/VectorField.js';
5487-
export * from './widgets/GridField.js';
5498+
export { evalArith, lookupAutofillPatch, computeRow, GridField, LineItemsField } from './widgets/GridField.js';
5499+
export type { GridColumn } from './widgets/GridField.js';
54885500
export * from './widgets/lookupAutofill.js';
54895501
// New widgets according to @objectstack/spec
54905502
export * from './widgets/ColorField.js';
Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,43 @@
11
export * from './SchemaRendererContext.js';
22
export * from './PreviewModeContext.js';
33
export * from './ActionContext.js';
4-
export * from './ThemeContext.js';
5-
export * from './NotificationContext.js';
4+
export { ThemeProvider, useTheme } from './ThemeContext.js';
5+
export type { ThemeContextValue, ThemeProviderProps } from './ThemeContext.js';
6+
// resolveNotificationPresentation and the three SUPPORTED_NOTIFICATION_* sets stay
7+
// module-level for the provider and the spec-parity test; no host imports them.
8+
export {
9+
resolveNotificationConfig,
10+
useNotifications,
11+
useHasNotificationProvider,
12+
visibleNotificationStack,
13+
resolveNotificationPosition,
14+
useNotificationsByPresentation,
15+
NOTIFICATION_PRESENTATIONS,
16+
NotificationProvider,
17+
} from './NotificationContext.js';
18+
export type {
19+
NotificationSeverityLevel,
20+
NotificationPresentation,
21+
NotificationDisplayType,
22+
NotificationSurface,
23+
NotificationPresentationBehavior,
24+
NotificationPositionValue,
25+
NotificationActionVariant,
26+
NotificationActionButton,
27+
NotificationItem,
28+
NotificationSystemConfig,
29+
ResolvedNotificationConfig,
30+
NotificationProviderProps,
31+
} from './NotificationContext.js';
632
export * from './DndContext.js';
733
export * from './AppShellContext.js';
834
export * from './RecordContext.js';
935
export * from './InlineEditContext.js';
1036
export * from './DiscussionContext.js';
1137
export * from './DrillNavigationContext.js';
1238
export * from './HostNavigationContext.js';
13-
export * from './HostMapStyleContext.js';
14-
export * from './RecordPagePreferencesContext.js';
39+
export { useHostMapStyle, HostMapStyleProvider } from './HostMapStyleContext.js';
40+
export { useRecordPagePreferences, RecordPagePreferencesProvider } from './RecordPagePreferencesContext.js';
41+
export type { RecordPagePreference, RecordPagePreferencesStore } from './RecordPagePreferencesContext.js';
1542
export * from './RelatedRecordActionsContext.js';
16-
export * from './PrintPageContext.js';
43+
export { PrintPageProvider, usePrintPage } from './PrintPageContext.js';

‎ui/packages/react/src/hooks/index.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ export * from './useDynamicApp.js';
2323
export * from './useDiscovery.js';
2424
export * from './useKeyboardShortcuts.js';
2525
export * from './useCrudShortcuts.js';
26-
export * from './useReducedMotion.js';
27-
export * from './useAnimation.js';
26+
// SUPPORTED_TRANSITION_PRESETS / SUPPORTED_EASING_FUNCTIONS stay module-level for
27+
// the spec-parity test that imports them from the module; no host imports them.
28+
export { useAnimation } from './useAnimation.js';
29+
export type { EasingPreset, TransitionPresetType, AnimationConfig, AnimationResult } from './useAnimation.js';
2830
export * from './useDensityMode.js';
2931
export * from './useViewSharing.js';
3032
export * from './useOffline.js';
3133
export * from './usePerformance.js';
3234
export * from './usePerformanceBudget.js';
33-
export * from './useViewTransition.js';
3435
export * from './useETagCache.js';
3536
export * from './useGlobalUndo.js';
3637
export * from './useDebugMode.js';

‎ui/packages/react/src/hooks/useAnimation.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88

99
import { useMemo } from 'react';
1010

11-
/** Animation trigger type */
12-
export type AnimationTriggerType = 'enter' | 'exit' | 'hover' | 'focus' | 'click';
13-
1411
/**
1512
* Easing presets aligned with the spec `EasingFunctionSchema`
1613
* (`ui/animation.zod.ts` — underscore spellings). The hyphen spellings are

‎ui/packages/react/src/hooks/useKeyboardShortcuts.ts‎

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -95,25 +95,3 @@ export function useKeyboardShortcuts(
9595
};
9696
}, [enabled, handleKeyDown]);
9797
}
98-
99-
/**
100-
* Returns a list of all registered shortcut descriptions.
101-
* Useful for building a help dialog (? key).
102-
*/
103-
export function getShortcutDescriptions(
104-
shortcuts: KeyboardShortcutDefinition[]
105-
): Array<{ keys: string; description: string }> {
106-
return shortcuts
107-
.filter((s) => s.description && s.enabled !== false)
108-
.map((s) => {
109-
const parts: string[] = [];
110-
if (s.ctrlOrMeta) parts.push('⌘/Ctrl');
111-
if (s.shift) parts.push('Shift');
112-
if (s.alt) parts.push('Alt');
113-
parts.push(s.key.length === 1 ? s.key.toUpperCase() : s.key);
114-
return {
115-
keys: parts.join(' + '),
116-
description: s.description!,
117-
};
118-
});
119-
}

‎ui/packages/react/src/hooks/usePageVariables.tsx‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,6 @@ const OUTSIDE_PAGE: PageVariablesContextValue = Object.freeze({
213213
resetVariables: () => {},
214214
});
215215

216-
/**
217-
* Hook to check if a PageVariablesProvider is available.
218-
*/
219-
export function useHasPageVariables(): boolean {
220-
return useContext(PageVariablesContext) !== null;
221-
}
222-
223216
/**
224217
* A writer binding for a page variable, resolved from a component id.
225218
*/

‎ui/packages/react/src/hooks/useReducedMotion.ts‎

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)