@keepkit/ui 0.27.3 → 0.28.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.
- package/README.md +8 -2
- package/dist/index.d.ts +91 -8
- package/dist/index.js +744 -367
- package/dist/index.js.map +1 -1
- package/dist/styles/collection.css +66 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -57,6 +57,8 @@ function SavedArticles() {
|
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
`keep.Collection`は検索、ソート、ページング、loading / empty / error、ARIA live通知を標準で提供します。検索は既定で300msデバウンスされます。`features={{ tagFilter: true, bulkActions: true }}`でタグフィルターと一括操作も有効にできます。個別の`KeepList`、`KeepSearchInput`、`KeepSortSelect`、`KeepPagination`、`KeepItemCheckbox`、`KeepTagEditor`などは高度なレイアウト用に利用できます。`KeepBulkActions`はrender propsで操作UIを差し替えられ、`isAllSelected` / `toggleSelectAll`で表示中アイテムを一括操作できます。`KeepNoteEditor`は既定300msのデバウンス保存に対応し、`debounceMs={0}`でフォーム送信のみへ戻せます。通知領域だけを明示的に置く場合は`KeepAnnouncer`(`KeepAnnouncements`のalias)を使えます。
|
|
60
|
+
再発見には`useKeepItem(item).recordOpen()`で`lastOpenedAt`を記録し、`activity`クエリまたは`createRediscoveryQuery()` / `useKeepRediscovery()`を利用できます。`<KeepRediscovery strategy="forgotten" limit={5} />`は既存の`KeepList`を組み合わせた標準プリセットです。カード単位では`trackOpen`を指定したときだけ開封記録を有効にします。
|
|
61
|
+
保存確認から対象へ戻すには`revealRequest={{ requestId, itemId }}`を渡し、`onRevealResult`で結果を受け取れます。検索・タグ・保存先フィルターとページを調整して対象を表示します。
|
|
60
62
|
`KeepWorkspace`はこれらのプリミティブを一つにまとめ、`basic`、`standard`、`management`、`sync`のプリセットを提供します。`createKeepKit()`を利用する場合は同じ実装を`keep.Workspace`から型付きで利用できます。`modules`、`slots`、子コンポーネントごとのpropsで部分的に差し替えられます。
|
|
61
63
|
`KeepCollectionManager`は作成・名前変更・削除・件数表示をまとめたheadless UIです。`allowCreate`、`allowRename`、`allowDelete`、`showCounts`で機能を個別に切り替えられ、`collectionLabels`、`title`、`description`、`empty`で表示を差し替えられます。
|
|
62
64
|
画面領域を明示する場合は`surface="panel"`または領域別の`surface`と、`sectionGap="compact" | "comfortable"`を指定できます。空のslotは枠を生成せず、未指定時と`surface="plain"`では従来のDOM順序を維持します。
|
|
@@ -107,7 +109,7 @@ const onFeedback = useKeepToastFeedback(toast);
|
|
|
107
109
|
<KeepKitProvider storage={storage} onFeedback={onFeedback}>{children}</KeepKitProvider>;
|
|
108
110
|
```
|
|
109
111
|
|
|
110
|
-
v0.
|
|
112
|
+
v0.28.1では、利用履歴とRediscovery query、カード開封追跡を追加しました。レイアウト領域を消費しないPortalベースのフローティング巡回UI、Tailwind CSS v4との統合、ホストテーマ変数との衝突回避も引き続き利用できます。
|
|
111
113
|
Phase 4の状態UIとして`KeepItemStatusBadge`、`KeepStaleNotice`、`KeepPruneStaleButton`、`KeepSyncStatusBanner`、`KeepSyncRecoveryDialog`を利用できます。`import "@keepkit/ui/theme.css"`でテーマCSSを有効にできます。
|
|
112
114
|
|
|
113
115
|
### Tailwind/shadcnテーマ
|
|
@@ -198,6 +200,7 @@ function SavedArticles() {
|
|
|
198
200
|
```
|
|
199
201
|
|
|
200
202
|
`keep.Collection` includes search, sorting, pagination, loading/empty/error states, and polite live announcements. Search is debounced by 300ms by default. Enable `features={{ tagFilter: true, bulkActions: true }}` for tag filtering and bulk operations. Use the individual `KeepList`, `KeepSearchInput`, `KeepSortSelect`, `KeepPagination`, `KeepItemCheckbox`, and `KeepTagEditor` primitives when you need a custom layout. `KeepBulkActions` supports render props and exposes `isAllSelected` / `toggleSelectAll` for visible-item selection. `KeepNoteEditor` auto-saves dirty notes after 300ms by default; set `debounceMs={0}` to use form submission only. Mount `KeepAnnouncer` (`KeepAnnouncements` alias) when you need the live region explicitly.
|
|
203
|
+
Pass `revealRequest={{ requestId, itemId }}` to return to an item from a save confirmation; `onRevealResult` reports the outcome after search, tag, collection, and pagination state is adjusted.
|
|
201
204
|
`KeepWorkspace` composes these primitives into `basic`, `standard`, `management`, and `sync` presets. `createKeepKit()` exposes the same implementation as a typed `keep.Workspace`. Override individual areas through `modules`, `slots`, and child-component props.
|
|
202
205
|
`KeepCollectionManager` is a headless collection-management UI for creating, renaming, deleting, and counting collections. Toggle each capability with `allowCreate`, `allowRename`, `allowDelete`, and `showCounts`; customize `collectionLabels`, `title`, `description`, and `empty`.
|
|
203
206
|
Use `surface="panel"` or a per-region `surface` map together with `sectionGap="compact" | "comfortable"` to make workspace boundaries explicit. Empty slots do not create frames, and omitted `surface` or `surface="plain"` preserves the existing DOM order.
|
|
@@ -216,7 +219,9 @@ Set `toolbarLayout="grouped"` and `toolbarVariant="panel"` to render host `slots
|
|
|
216
219
|
The opt-in theme adds neutral borders, surfaces, shadows, focus treatment, and decorative action icons without changing accessible names. Regular remove, bulk-delete, and stale-prune actions use a subtle red outline and text with a light hover surface; solid red is reserved for error states that need confirmation. Target individual controls with `data-keep-action`, or override `--keep-icon-size`, `--keep-control-gap`, `--keep-shadow`, `--keep-success`, and `--keep-warning`. Consumers that omit the CSS keep the headless markup, and `KeepButton icons` continues to take precedence over the built-in icon.
|
|
217
220
|
`KeepItemCard` accepts `href`, `onOpen`, `linkTarget`, and `linkComponent` for detail-page navigation. Links are disabled for unavailable `status` values such as private or expired. `KeepBackup` provides JSON export, merge/replace import, result counts, and quota-error messaging.
|
|
218
221
|
`KeepTourBar` (aliased as `KeepNavigator`) provides progress, previous/next, and return-to-list actions through URLs or callbacks. Inject host routing with `getItemHref`, `getBackHref`, and `onNavigate`. Adjacent item titles are previewed below the navigation labels; customize them with `getItemTitle`. Set `keyboardShortcuts` for J/K or ]/[ tour navigation, or use `useKeepTourShortcuts` for custom bindings. `KeepReorderableList` supports drag and keyboard reordering and shows the active insertion position; `KeepCollection reorderable` includes that path and standard undo without a slot replacement.
|
|
222
|
+
`KeepTourProvider` / `useKeepTour` manage a session-scoped tour, and `KeepFloatingTour` renders controls in a body portal so the host layout needs no reserved space. Start with `start({ itemIds })`, configure `position`, `offset`, `zIndex`, and routing callbacks. Same-tab state resumes from `sessionStorage`; set `tour={{ sessionKey }}` on `KeepKitProvider` to namespace it.
|
|
219
223
|
`KeepShortcutHint` renders semantic `<kbd>` badges. `KeepTourBar showShortcutHint` displays the previous/next keys, while `KeepNoteEditor showShortcutHint` displays `Ctrl+Enter` in the save button. `mergeProps` / `createSlot` compose className, style, ARIA, events, and child/parent refs for `asChild` slots; `composeRefs` combines callback and object refs. Filter chips restore focus to an adjacent chip after removal and support ArrowLeft / ArrowRight navigation.
|
|
224
|
+
`KeepFloatingTour` is a fixed portal-rendered tour control that does not consume page layout space. Use `KeepTourProvider` / `useKeepTour` to start an ordered session with `start({ itemIds })` and configure host routing with `getItemHref`, `getBackHref`, or `onNavigate`.
|
|
220
225
|
Cards rendered by `KeepList` and `KeepCollection` highlight case-insensitive search matches with `<mark class="keep-highlight" data-highlight="true">`. Use `highlightQuery` on a standalone `KeepItemCard` or `KeepHighlight` for arbitrary text. `KeepItemCard.Media` exposes its loading state through `data-media-status` and replaces failed images with `fallback` or the built-in SVG placeholder.
|
|
221
226
|
The theme defines WCAG-oriented `--keep-highlight-bg` / `--keep-highlight-fg` pairs for light and dark modes, clamps titles to two lines and memo previews to three, and reserves a stable media aspect ratio. `KeepItemStatusBadge` combines visible status text with check, clock, ban, or lock SVG icons; import `@keepkit/ui/styles/status.css` when using the status styles independently.
|
|
222
227
|
External detail URLs receive `target="_blank"` and `rel="noreferrer"` defaults. Unavailable cards expose `aria-disabled="true"` and normalized `data-item-status` values, and the sync recovery dialog compares local and remote updated dates and notes side by side.
|
|
@@ -245,7 +250,7 @@ const onFeedback = useKeepToastFeedback(toast);
|
|
|
245
250
|
<KeepKitProvider storage={storage} onFeedback={onFeedback}>{children}</KeepKitProvider>;
|
|
246
251
|
```
|
|
247
252
|
|
|
248
|
-
v0.
|
|
253
|
+
v0.28.1 adds activity tracking, Rediscovery queries, and opt-in card open tracking. The portal-rendered floating tour UI, Tailwind CSS v4 integration, host-theme isolation, and cascade-layer support remain available.
|
|
249
254
|
Phase 4 adds `KeepItemStatusBadge`, `KeepStaleNotice`, `KeepPruneStaleButton`, `KeepSyncStatusBanner`, and `KeepSyncRecoveryDialog` for unavailable items, sync failures, conflict resolution, and backup recovery. Import `@keepkit/ui/theme.css` or `@keepkit/ui/tailwind.css` for the opt-in theme layer.
|
|
250
255
|
|
|
251
256
|
### Tailwind and shadcn theme
|
|
@@ -289,6 +294,7 @@ import { KeepItemCard, KeepThemeProvider } from "@keepkit/ui";
|
|
|
289
294
|
Use `[data-state="saved"]`, `[data-state="unsaved"]`, `[data-loading="true"]`, `[data-state="error"]`, `[data-state="empty"]`, `[data-state="stale"]`, `[data-status="expired"]`, `[data-status="removed"]`, and `[data-state="selected"]` from host CSS or Tailwind data variants. For migration, keep importing `@keepkit/ui/theme.css` while replacing direct `--keepkit-*` references with `--keep-*`. In the Pages Router, inject `createNextPagesRouterAdapter(router)` into `urlAdapter`.
|
|
290
295
|
|
|
291
296
|
Collection queries use one canonical shape: `targetType`, `tags`, `search`, `sort`, `pagination`, `filter`, and `savedBetween`. Saved item inputs contain only `id`, `meta`, `targetType`, `note`, and `tags`; KeepKit owns persistence timestamps.
|
|
297
|
+
For rediscovery, use `useKeepItem(item).recordOpen()` to persist `lastOpenedAt`, then query `activity` with `opened`, `lastOpenedBefore`, `lastOpenedAfter`, or `inactiveForMs`. `createRediscoveryQuery()` / `useKeepRediscovery()` provide standard `never-opened`, `forgotten`, and `recently-opened` views, while `<KeepRediscovery strategy="forgotten" limit={5} />` composes the UI list. `KeepItemCard trackOpen` opts into tracking without changing existing cards.
|
|
292
298
|
|
|
293
299
|
Framework-neutral APIs remain available from `@keepkit/core/core`, low-level React bindings from `@keepkit/core/react`, and storage adapters from `@keepkit/core/storage`.
|
|
294
300
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ButtonHTMLAttributes, ReactNode, HTMLAttributes, ComponentType, Ref, RefCallback, ReactElement, InputHTMLAttributes, FormHTMLAttributes, ImgHTMLAttributes, MouseEvent, HTMLAttributeAnchorTarget, SelectHTMLAttributes, KeyboardEvent, CSSProperties } from 'react';
|
|
3
|
-
import { KeepListQuery, KeepUrlSyncOptions, KeepItemInput, ImportItemsResult, KeepItem, KeepItemStatus, KeepSyncConflict } from '@keepkit/core/core';
|
|
4
|
-
export { AuthenticatedSyncAuthContext, AuthenticatedSyncKit, AuthenticatedSyncKitOptions, AuthenticatedSyncRequestContext, AuthenticatedSyncTransport, KeepItem, KeepItemInput, KeepListQuery, KeepScope, KeepSyncConflict, KeepSyncResolution, KeepSyncState, KeepSyncStatus, KeepUndoState, KeepUrlSyncOptions, createAuthenticatedSyncKit } from '@keepkit/core/core';
|
|
5
|
-
import { useKeepItem, KeepButtonProps as KeepButtonProps$1, UseKeepListResult, KeepErrorBoundaryProps, UseKeepNavigatorResult, CreateKeepKitOptions as CreateKeepKitOptions$1, KeepProviderProps, useKeepContext, useKeepList, UseKeepCollectionsResult, UseKeepNavigatorOptions, KeepShortcutOptions } from '@keepkit/core/react';
|
|
6
|
-
export { KeepButtonState, KeepContextValue, KeepErrorBoundary, KeepErrorBoundaryProps, KeepProvider, KeepProviderProps, KeepShortcutOptions, useKeepCollections, useKeepContext, useKeepItem, useKeepList, useKeepNavigator, useKeepShortcut } from '@keepkit/core/react';
|
|
3
|
+
import { KeepListQuery, KeepUrlSyncOptions, KeepItemInput, ImportItemsResult, KeepItem, KeepItemStatus, KeepRediscoveryStrategy, KeepSyncConflict } from '@keepkit/core/core';
|
|
4
|
+
export { AuthenticatedSyncAuthContext, AuthenticatedSyncKit, AuthenticatedSyncKitOptions, AuthenticatedSyncRequestContext, AuthenticatedSyncTransport, KeepItem, KeepItemInput, KeepListQuery, KeepRediscoveryStrategy, KeepScope, KeepSyncConflict, KeepSyncResolution, KeepSyncState, KeepSyncStatus, KeepUndoState, KeepUrlSyncOptions, createAuthenticatedSyncKit } from '@keepkit/core/core';
|
|
5
|
+
import { useKeepItem, KeepButtonProps as KeepButtonProps$1, UseKeepListResult, KeepErrorBoundaryProps, UseKeepNavigatorResult, CreateKeepKitOptions as CreateKeepKitOptions$1, KeepProviderProps, useKeepContext, useKeepList, UseKeepRediscoveryOptions, UseKeepRediscoveryResult, UseKeepCollectionsResult, UseKeepNavigatorOptions, KeepShortcutOptions } from '@keepkit/core/react';
|
|
6
|
+
export { KeepButtonState, KeepContextValue, KeepErrorBoundary, KeepErrorBoundaryProps, KeepProvider, KeepProviderProps, KeepShortcutOptions, useKeepCollections, useKeepContext, useKeepItem, useKeepList, useKeepNavigator, useKeepRediscovery, useKeepShortcut } from '@keepkit/core/react';
|
|
7
7
|
export { FallbackStorageAdapter, IndexedDBAdapter, IndexedDBSyncQueueAdapter, LocalStorageAdapter, LocalStorageSyncQueueAdapter, SyncStorageAdapter, createBrowserStorageAdapter, createStorageAdapter } from '@keepkit/core/storage';
|
|
8
8
|
|
|
9
9
|
type KeepUrlAdapter = {
|
|
@@ -289,6 +289,8 @@ type KeepItemCardProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HT
|
|
|
289
289
|
asChild?: boolean;
|
|
290
290
|
href?: string | ((item: KeepItem<TMeta>) => string | undefined);
|
|
291
291
|
onOpen?: (item: KeepItem<TMeta>, event: MouseEvent<HTMLElement>) => void;
|
|
292
|
+
/** Records an open through KeepKit before invoking `onOpen`. */
|
|
293
|
+
trackOpen?: boolean;
|
|
292
294
|
linkTarget?: "title" | "card";
|
|
293
295
|
linkComponent?: ComponentType<KeepItemCardLinkProps>;
|
|
294
296
|
linkTargetAttribute?: HTMLAttributeAnchorTarget;
|
|
@@ -311,7 +313,7 @@ type KeepItemCardSkeletonProps = Omit<HTMLAttributes<HTMLElement>, "children"> &
|
|
|
311
313
|
layout?: KeepLayoutPreset;
|
|
312
314
|
};
|
|
313
315
|
/** A low-dependency item presentation primitive with composable card parts. */
|
|
314
|
-
declare function KeepItemCardRoot<TMeta = Record<string, unknown>>({ item, title, getTitle, getImageProps, imageComponent: ImageComponent, renderImage, renderTags, showTags, showNote, showSavedAt, collectionLabels, imageAlt, render, children, removeLabel, onRemoveError, onRemoved, onRetry, showSaveButton, showPinButton, showArchiveButton, showEditButton, onEdit, editSlot, editFeatures, saveButtonLabels, asChild, href: hrefOption, onOpen, linkTarget, linkComponent: LinkComponent, linkTargetAttribute, linkRel, highlightQuery, cardVariant, className, ...rootProps }: KeepItemCardProps<TMeta>): react.JSX.Element;
|
|
316
|
+
declare function KeepItemCardRoot<TMeta = Record<string, unknown>>({ item, title, getTitle, getImageProps, imageComponent: ImageComponent, renderImage, renderTags, showTags, showNote, showSavedAt, collectionLabels, imageAlt, render, children, removeLabel, onRemoveError, onRemoved, onRetry, showSaveButton, showPinButton, showArchiveButton, showEditButton, onEdit, editSlot, editFeatures, saveButtonLabels, asChild, href: hrefOption, onOpen, trackOpen, linkTarget, linkComponent: LinkComponent, linkTargetAttribute, linkRel, highlightQuery, cardVariant, className, ...rootProps }: KeepItemCardProps<TMeta>): react.JSX.Element;
|
|
315
317
|
declare function KeepItemCardMedia({ children, fallback, ...props }: KeepItemCardMediaProps): react.JSX.Element;
|
|
316
318
|
declare function KeepItemCardContent({ children, ...props }: KeepItemCardContentProps): react.JSX.Element;
|
|
317
319
|
declare function KeepItemCardTitle({ as, children, ...props }: KeepItemCardTitleProps): react.DetailedReactHTMLElement<{
|
|
@@ -676,6 +678,15 @@ type KeepCollectionSlots<TMeta = Record<string, unknown>> = {
|
|
|
676
678
|
toolbarStart?: KeepCollectionToolbarContent<TMeta>;
|
|
677
679
|
toolbarEnd?: KeepCollectionToolbarContent<TMeta>;
|
|
678
680
|
};
|
|
681
|
+
type KeepCollectionRevealRequest = {
|
|
682
|
+
requestId: number;
|
|
683
|
+
itemId: string;
|
|
684
|
+
};
|
|
685
|
+
type KeepCollectionRevealResult = {
|
|
686
|
+
requestId: number;
|
|
687
|
+
itemId: string;
|
|
688
|
+
status: "visible" | "not-found" | "excluded";
|
|
689
|
+
};
|
|
679
690
|
type KeepCollectionProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
680
691
|
query?: KeepListQuery<TMeta>;
|
|
681
692
|
pageSize?: number;
|
|
@@ -709,6 +720,9 @@ type KeepCollectionProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<
|
|
|
709
720
|
fallback?: KeepErrorBoundaryProps["fallback"];
|
|
710
721
|
onBoundaryError?: KeepErrorBoundaryProps["onError"];
|
|
711
722
|
boundaryResetKey?: unknown;
|
|
723
|
+
/** Requests the collection to clear local filters and reveal an item. */
|
|
724
|
+
revealRequest?: KeepCollectionRevealRequest;
|
|
725
|
+
onRevealResult?: (result: KeepCollectionRevealResult) => void;
|
|
712
726
|
};
|
|
713
727
|
/** A batteries-included collection with query controls and accessible status feedback. */
|
|
714
728
|
declare function KeepCollection<TMeta = Record<string, unknown>>(props: KeepCollectionProps<TMeta>): react.JSX.Element;
|
|
@@ -911,6 +925,24 @@ type KeepDisplayStatus = "available" | "expired" | "removed" | "restricted";
|
|
|
911
925
|
/** Displays the normalized availability state of a saved item. */
|
|
912
926
|
declare function KeepItemStatusBadge({ status, label, className, ...props }: KeepItemStatusBadgeProps): react.JSX.Element;
|
|
913
927
|
|
|
928
|
+
type KeepFloatingTourProps<TMeta = Record<string, unknown>> = {
|
|
929
|
+
currentId?: string;
|
|
930
|
+
getItemHref?: (item: KeepItem<TMeta>) => string;
|
|
931
|
+
getBackHref?: () => string;
|
|
932
|
+
onNavigate?: (direction: "prev" | "next", item: KeepItem<TMeta>) => void;
|
|
933
|
+
onBack?: () => void | Promise<void>;
|
|
934
|
+
position?: "bottom-center" | "bottom-left" | "bottom-right";
|
|
935
|
+
offset?: number | string;
|
|
936
|
+
zIndex?: number;
|
|
937
|
+
className?: string;
|
|
938
|
+
style?: CSSProperties;
|
|
939
|
+
keyboardShortcuts?: boolean;
|
|
940
|
+
showShortcutHint?: boolean;
|
|
941
|
+
children?: ReactNode;
|
|
942
|
+
};
|
|
943
|
+
/** A fixed, portal-rendered tour bar that does not consume host layout space. */
|
|
944
|
+
declare function KeepFloatingTour<TMeta = Record<string, unknown>>({ currentId, getItemHref, getBackHref, onNavigate, onBack, position, offset, zIndex, className, style, keyboardShortcuts, showShortcutHint, }: KeepFloatingTourProps<TMeta>): react.ReactPortal | null;
|
|
945
|
+
|
|
914
946
|
type KeepShortcutHintProps = Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
|
|
915
947
|
shortcut: string | readonly string[];
|
|
916
948
|
separator?: ReactNode;
|
|
@@ -963,6 +995,41 @@ type KeepTourBarProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTM
|
|
|
963
995
|
declare function KeepTourBar<TMeta = Record<string, unknown>>({ navigation: providedNavigation, currentId, initialIndex, showProgress, prevHref, nextHref, backHref, getItemHref, getBackHref, onNavigate, onPrev, onNext, onBack, prevLabel, nextLabel, backLabel, keyboardShortcuts, showShortcutHint, shortcutOptions, progress, getItemTitle, children, asChild, ...props }: KeepTourBarProps<TMeta>): react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
964
996
|
declare const KeepNavigator: typeof KeepTourBar;
|
|
965
997
|
|
|
998
|
+
type KeepTourPosition = "bottom-center" | "bottom-left" | "bottom-right";
|
|
999
|
+
type KeepTourPersistenceStatus = "persistent" | "memory";
|
|
1000
|
+
type KeepTourStartOptions = {
|
|
1001
|
+
itemIds: readonly string[];
|
|
1002
|
+
currentId?: string;
|
|
1003
|
+
};
|
|
1004
|
+
type KeepTourContextValue<TMeta = Record<string, unknown>> = {
|
|
1005
|
+
active: boolean;
|
|
1006
|
+
itemIds: readonly string[];
|
|
1007
|
+
currentId: string | null;
|
|
1008
|
+
collapsed: boolean;
|
|
1009
|
+
persistenceStatus: KeepTourPersistenceStatus;
|
|
1010
|
+
getItemHref?: (item: KeepItem<TMeta>) => string;
|
|
1011
|
+
getBackHref?: () => string;
|
|
1012
|
+
onNavigate?: (direction: "prev" | "next", item: KeepItem<TMeta>) => void;
|
|
1013
|
+
start: (options: KeepTourStartOptions) => boolean;
|
|
1014
|
+
end: () => void;
|
|
1015
|
+
collapse: () => void;
|
|
1016
|
+
expand: () => void;
|
|
1017
|
+
goNext: () => KeepItem<TMeta> | null;
|
|
1018
|
+
goPrev: () => KeepItem<TMeta> | null;
|
|
1019
|
+
setCurrentId: (id: string) => void;
|
|
1020
|
+
};
|
|
1021
|
+
type KeepTourProviderProps<TMeta = Record<string, unknown>> = {
|
|
1022
|
+
children?: ReactNode;
|
|
1023
|
+
sessionKey?: string;
|
|
1024
|
+
getItemHref?: (item: KeepItem<TMeta>) => string;
|
|
1025
|
+
getBackHref?: () => string;
|
|
1026
|
+
onNavigate?: (direction: "prev" | "next", item: KeepItem<TMeta>) => void;
|
|
1027
|
+
};
|
|
1028
|
+
declare function KeepTourProvider<TMeta = Record<string, unknown>>({ children, sessionKey, getItemHref, getBackHref, onNavigate, }: KeepTourProviderProps<TMeta>): react.JSX.Element;
|
|
1029
|
+
declare function useKeepTour<TMeta = Record<string, unknown>>(options?: {
|
|
1030
|
+
currentId?: string;
|
|
1031
|
+
}): KeepTourContextValue<TMeta>;
|
|
1032
|
+
|
|
966
1033
|
type KeepActiveFiltersSummaryProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
967
1034
|
ref?: Ref<HTMLElement> | {
|
|
968
1035
|
readonly current: unknown;
|
|
@@ -1038,7 +1105,7 @@ type KeepSearchInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "value"
|
|
|
1038
1105
|
};
|
|
1039
1106
|
/** A controlled/uncontrolled search field with a small built-in debounce. */
|
|
1040
1107
|
declare function KeepSearchInput({ value: controlledValue, defaultValue, debounceMs, onValueChange, "aria-label": ariaLabel, placeholder, ...props }: KeepSearchInputProps): react.JSX.Element;
|
|
1041
|
-
type KeepSortValue = "savedAt:desc" | "savedAt:asc" | "updatedAt:desc" | "updatedAt:asc";
|
|
1108
|
+
type KeepSortValue = "savedAt:desc" | "savedAt:asc" | "updatedAt:desc" | "updatedAt:asc" | "lastOpenedAt:desc" | "lastOpenedAt:asc";
|
|
1042
1109
|
type KeepSortSelectProps = Omit<SelectHTMLAttributes<HTMLSelectElement>, "value" | "defaultValue" | "onChange"> & {
|
|
1043
1110
|
value?: KeepSortValue;
|
|
1044
1111
|
defaultValue?: KeepSortValue;
|
|
@@ -1062,6 +1129,14 @@ type KeepPaginationProps = Omit<React.HTMLAttributes<HTMLElement>, "children"> &
|
|
|
1062
1129
|
/** Accessible pagination with previous/next controls and numbered page buttons. */
|
|
1063
1130
|
declare function KeepPagination({ totalCount, pageSize, page, maxPageButtons, onPageChange, render, ...props }: KeepPaginationProps): react.JSX.Element;
|
|
1064
1131
|
|
|
1132
|
+
type KeepRediscoveryProps<TMeta = Record<string, unknown>> = Omit<KeepListProps<TMeta>, "query"> & {
|
|
1133
|
+
strategy: KeepRediscoveryStrategy;
|
|
1134
|
+
inactiveForMs?: number;
|
|
1135
|
+
limit?: number;
|
|
1136
|
+
};
|
|
1137
|
+
/** A small composition for the standard rediscovery queries. */
|
|
1138
|
+
declare function KeepRediscovery<TMeta = Record<string, unknown>>({ strategy, inactiveForMs, limit, itemCardProps, ...props }: KeepRediscoveryProps<TMeta>): react.JSX.Element;
|
|
1139
|
+
|
|
1065
1140
|
type KeepStaleNoticeProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
1066
1141
|
item: KeepItem<TMeta>;
|
|
1067
1142
|
onRetry?: (item: KeepItem<TMeta>) => void | Promise<void>;
|
|
@@ -1214,9 +1289,10 @@ declare function KeepThemeProvider({ children, theme, mode, density, radius, acc
|
|
|
1214
1289
|
|
|
1215
1290
|
type KeepKitProviderProps<TMeta = Record<string, unknown>> = Omit<KeepProviderProps<TMeta>, "children"> & Omit<KeepUiProviderProps<TMeta>, "children"> & Omit<KeepThemeProviderProps, "children"> & {
|
|
1216
1291
|
children?: ReactNode;
|
|
1292
|
+
tour?: Omit<KeepTourProviderProps<TMeta>, "children">;
|
|
1217
1293
|
};
|
|
1218
1294
|
/** Combines the core store, UI labels, and the global live announcer. */
|
|
1219
|
-
declare function KeepKitProvider<TMeta = Record<string, unknown>>({ labels, labelOptions, locale, labelResolver, onFeedback, theme, mode, density, radius, accentColor, highContrast, reducedMotion, variables, className: themeClassName, style: themeStyle, asChild: themeAsChild, children, ...providerProps }: KeepKitProviderProps<TMeta>): react.JSX.Element;
|
|
1295
|
+
declare function KeepKitProvider<TMeta = Record<string, unknown>>({ labels, labelOptions, locale, labelResolver, onFeedback, theme, mode, density, radius, accentColor, highContrast, reducedMotion, variables, className: themeClassName, style: themeStyle, asChild: themeAsChild, tour, children, ...providerProps }: KeepKitProviderProps<TMeta>): react.JSX.Element;
|
|
1220
1296
|
|
|
1221
1297
|
type CreateKeepKitOptions<TMeta = Record<string, unknown>> = CreateKeepKitOptions$1<TMeta> & Omit<KeepUiProviderProps<TMeta>, "children"> & {
|
|
1222
1298
|
theme?: KeepThemeName;
|
|
@@ -1229,6 +1305,7 @@ type CreateKeepKitOptions<TMeta = Record<string, unknown>> = CreateKeepKitOption
|
|
|
1229
1305
|
variables?: KeepThemeVariables;
|
|
1230
1306
|
themeClassName?: string;
|
|
1231
1307
|
themeStyle?: KeepThemeProviderProps["style"];
|
|
1308
|
+
tour?: Omit<KeepTourProviderProps<TMeta>, "children">;
|
|
1232
1309
|
getTitle?: (item: KeepItem<TMeta>) => ReactNode;
|
|
1233
1310
|
getImageProps?: (item: KeepItem<TMeta>, title: ReactNode) => KeepImageProps | undefined;
|
|
1234
1311
|
};
|
|
@@ -1242,14 +1319,20 @@ type KeepKit<TMeta = Record<string, unknown>> = {
|
|
|
1242
1319
|
useContext: () => ReturnType<typeof useKeepContext<TMeta>>;
|
|
1243
1320
|
useItem: (item?: KeepItemInput<TMeta>) => ReturnType<typeof useKeepItem<TMeta>>;
|
|
1244
1321
|
useList: (query?: KeepListQuery<TMeta>) => ReturnType<typeof useKeepList<TMeta>>;
|
|
1322
|
+
useRediscovery: (options: UseKeepRediscoveryOptions) => UseKeepRediscoveryResult<TMeta>;
|
|
1245
1323
|
useCollections: (options?: {
|
|
1246
1324
|
targetType?: string;
|
|
1247
1325
|
orderBy?: "name" | "count";
|
|
1248
1326
|
}) => UseKeepCollectionsResult;
|
|
1249
1327
|
useNavigator: (options?: UseKeepNavigatorOptions<TMeta>) => UseKeepNavigatorResult<TMeta>;
|
|
1250
1328
|
useShortcut: (options: KeepShortcutOptions<TMeta>) => void;
|
|
1329
|
+
FloatingTour: ComponentType<KeepFloatingTourProps<TMeta>>;
|
|
1330
|
+
TourProvider: ComponentType<KeepTourProviderProps<TMeta>>;
|
|
1331
|
+
useTour: (options?: {
|
|
1332
|
+
currentId?: string;
|
|
1333
|
+
}) => ReturnType<typeof useKeepTour<TMeta>>;
|
|
1251
1334
|
};
|
|
1252
1335
|
/** Create one typed application API for the core and standard UI layer. */
|
|
1253
1336
|
declare function createKeepKit<TMeta = Record<string, unknown>>(options?: CreateKeepKitOptions<TMeta>): KeepKit<TMeta>;
|
|
1254
1337
|
|
|
1255
|
-
export { type CreateKeepKitOptions, KeepActiveFiltersSummary, type KeepActiveFiltersSummaryProps, type KeepActiveFiltersSummaryState, KeepAnnouncements, type KeepAnnouncementsProps, KeepAnnouncer, KeepArchiveButton, type KeepArchiveButtonProps, type KeepArchiveButtonState, type KeepArchiveScope, KeepArchiveScopeSelect, type KeepArchiveScopeSelectProps, KeepBackup, type KeepBackupProps, KeepBulkActions, type KeepBulkActionsProps, type KeepBulkActionsState, KeepButton, type KeepButtonIcon, type KeepButtonIconProps, type KeepButtonIcons, type KeepButtonLabels, type KeepButtonProps, KeepCollection, type KeepCollectionControlProps, KeepCollectionCreate, type KeepCollectionCreateProps, type KeepCollectionFeature, KeepCollectionFilter, KeepCollectionManager, type KeepCollectionManagerProps, type KeepCollectionOption, type KeepCollectionProps, KeepCollectionSelect, type KeepCollectionSlots, type KeepCollectionToolbarContent, type KeepCollectionToolbarGroup, type KeepCollectionToolbarLayout, type KeepCollectionToolbarVariant, type KeepDisplayStatus, KeepEmptyState, type KeepEmptyStateProps, type KeepEmptyStateVariant, KeepHighlight, type KeepHighlightProps, type KeepImageProps, KeepItemCard, type KeepItemCardActionSlotProps, type KeepItemCardActionsProps, type KeepItemCardBadgeProps, type KeepItemCardContentProps, type KeepItemCardLinkProps, type KeepItemCardMediaProps, type KeepItemCardProps, type KeepItemCardRemoveProps, type KeepItemCardSaveProps, KeepItemCardSkeleton, type KeepItemCardSkeletonProps, type KeepItemCardState, type KeepItemCardTagsProps, type KeepItemCardTitleProps, type KeepItemCardVariant, KeepItemCheckbox, type KeepItemCheckboxProps, KeepItemStatusBadge, type KeepItemStatusBadgeProps, type KeepKit, KeepKitProvider, type KeepKitProviderProps, KeepLayout, type KeepLayoutPreset, type KeepLayoutProps, KeepList, type KeepListProps, type KeepListState, KeepNavigator, KeepNoteEditor, type KeepNoteEditorProps, type KeepNoteEditorState, type KeepPagesRouterLike, KeepPagination, type KeepPaginationProps, type KeepPaginationState, KeepPinButton, type KeepPinButtonProps, type KeepPinButtonState, KeepPruneStaleButton, type KeepPruneStaleButtonProps, KeepQuickEditor, type KeepQuickEditorFeature, type KeepQuickEditorProps, type KeepQuickEditorState, type KeepReorderableItemState, KeepReorderableList, type KeepReorderableListProps, KeepSavePopover, type KeepSavePopoverProps, KeepSearchInput, type KeepSearchInputProps, type KeepSelectionScope, KeepShortcutHint, type KeepShortcutHintProps, KeepSortSelect, type KeepSortSelectProps, type KeepSortValue, KeepStaleNotice, type KeepStaleNoticeProps, KeepStatus, type KeepStatusLabels, type KeepStatusProps, type KeepStatusState, type KeepStatusValue, KeepSyncRecoveryDialog, type KeepSyncRecoveryDialogProps, KeepSyncStatusBanner, type KeepSyncStatusBannerProps, KeepTagEditor, type KeepTagEditorProps, type KeepTagEditorState, KeepTagFilter, type KeepTagFilterProps, type KeepTagFilterState, type KeepThemeDensity, type KeepThemeMode, type KeepThemeName, KeepThemeProvider, type KeepThemeProviderProps, type KeepThemeRadius, type KeepThemeVariables, type KeepToastFeedbackOptions, type KeepToastHandler, KeepTourBar, type KeepTourBarProps, type KeepTourShortcutsOptions, type KeepUiFeedbackEvent, type KeepUiLabelContext, type KeepUiLabelKey, type KeepUiLabelOptions, type KeepUiLabelOptionsMap, type KeepUiLabels, type KeepUiLocale, type KeepUiLocaleLabels, KeepUiProvider, type KeepUiProviderProps, KeepUndo, type KeepUndoProps, type KeepUrlAdapter, KeepWorkspace, type KeepWorkspaceModule, type KeepWorkspacePreset, type KeepWorkspaceProps, type KeepWorkspaceRegion, type KeepWorkspaceSectionGap, type KeepWorkspaceSlots, type KeepWorkspaceState, type KeepWorkspaceSurface, type RenderProp, chainedFunction, composeRefs, createKeepKit, createNextPagesRouterAdapter, createSlot, getKeepLocaleLabels, highlightText, isAllSelected, keepThemeNames, mergeProps, toggleSelectAll, useKeepQuickEditor, useKeepToastFeedback, useKeepTourShortcuts, useKeepUiLabels, useKeepUrlSync, useUiLabelVisibility };
|
|
1338
|
+
export { type CreateKeepKitOptions, KeepActiveFiltersSummary, type KeepActiveFiltersSummaryProps, type KeepActiveFiltersSummaryState, KeepAnnouncements, type KeepAnnouncementsProps, KeepAnnouncer, KeepArchiveButton, type KeepArchiveButtonProps, type KeepArchiveButtonState, type KeepArchiveScope, KeepArchiveScopeSelect, type KeepArchiveScopeSelectProps, KeepBackup, type KeepBackupProps, KeepBulkActions, type KeepBulkActionsProps, type KeepBulkActionsState, KeepButton, type KeepButtonIcon, type KeepButtonIconProps, type KeepButtonIcons, type KeepButtonLabels, type KeepButtonProps, KeepCollection, type KeepCollectionControlProps, KeepCollectionCreate, type KeepCollectionCreateProps, type KeepCollectionFeature, KeepCollectionFilter, KeepCollectionManager, type KeepCollectionManagerProps, type KeepCollectionOption, type KeepCollectionProps, type KeepCollectionRevealRequest, type KeepCollectionRevealResult, KeepCollectionSelect, type KeepCollectionSlots, type KeepCollectionToolbarContent, type KeepCollectionToolbarGroup, type KeepCollectionToolbarLayout, type KeepCollectionToolbarVariant, type KeepDisplayStatus, KeepEmptyState, type KeepEmptyStateProps, type KeepEmptyStateVariant, KeepFloatingTour, type KeepFloatingTourProps, KeepHighlight, type KeepHighlightProps, type KeepImageProps, KeepItemCard, type KeepItemCardActionSlotProps, type KeepItemCardActionsProps, type KeepItemCardBadgeProps, type KeepItemCardContentProps, type KeepItemCardLinkProps, type KeepItemCardMediaProps, type KeepItemCardProps, type KeepItemCardRemoveProps, type KeepItemCardSaveProps, KeepItemCardSkeleton, type KeepItemCardSkeletonProps, type KeepItemCardState, type KeepItemCardTagsProps, type KeepItemCardTitleProps, type KeepItemCardVariant, KeepItemCheckbox, type KeepItemCheckboxProps, KeepItemStatusBadge, type KeepItemStatusBadgeProps, type KeepKit, KeepKitProvider, type KeepKitProviderProps, KeepLayout, type KeepLayoutPreset, type KeepLayoutProps, KeepList, type KeepListProps, type KeepListState, KeepNavigator, KeepNoteEditor, type KeepNoteEditorProps, type KeepNoteEditorState, type KeepPagesRouterLike, KeepPagination, type KeepPaginationProps, type KeepPaginationState, KeepPinButton, type KeepPinButtonProps, type KeepPinButtonState, KeepPruneStaleButton, type KeepPruneStaleButtonProps, KeepQuickEditor, type KeepQuickEditorFeature, type KeepQuickEditorProps, type KeepQuickEditorState, KeepRediscovery, type KeepRediscoveryProps, type KeepReorderableItemState, KeepReorderableList, type KeepReorderableListProps, KeepSavePopover, type KeepSavePopoverProps, KeepSearchInput, type KeepSearchInputProps, type KeepSelectionScope, KeepShortcutHint, type KeepShortcutHintProps, KeepSortSelect, type KeepSortSelectProps, type KeepSortValue, KeepStaleNotice, type KeepStaleNoticeProps, KeepStatus, type KeepStatusLabels, type KeepStatusProps, type KeepStatusState, type KeepStatusValue, KeepSyncRecoveryDialog, type KeepSyncRecoveryDialogProps, KeepSyncStatusBanner, type KeepSyncStatusBannerProps, KeepTagEditor, type KeepTagEditorProps, type KeepTagEditorState, KeepTagFilter, type KeepTagFilterProps, type KeepTagFilterState, type KeepThemeDensity, type KeepThemeMode, type KeepThemeName, KeepThemeProvider, type KeepThemeProviderProps, type KeepThemeRadius, type KeepThemeVariables, type KeepToastFeedbackOptions, type KeepToastHandler, KeepTourBar, type KeepTourBarProps, type KeepTourContextValue, type KeepTourPersistenceStatus, type KeepTourPosition, KeepTourProvider, type KeepTourProviderProps, type KeepTourShortcutsOptions, type KeepTourStartOptions, type KeepUiFeedbackEvent, type KeepUiLabelContext, type KeepUiLabelKey, type KeepUiLabelOptions, type KeepUiLabelOptionsMap, type KeepUiLabels, type KeepUiLocale, type KeepUiLocaleLabels, KeepUiProvider, type KeepUiProviderProps, KeepUndo, type KeepUndoProps, type KeepUrlAdapter, KeepWorkspace, type KeepWorkspaceModule, type KeepWorkspacePreset, type KeepWorkspaceProps, type KeepWorkspaceRegion, type KeepWorkspaceSectionGap, type KeepWorkspaceSlots, type KeepWorkspaceState, type KeepWorkspaceSurface, type RenderProp, chainedFunction, composeRefs, createKeepKit, createNextPagesRouterAdapter, createSlot, getKeepLocaleLabels, highlightText, isAllSelected, keepThemeNames, mergeProps, toggleSelectAll, useKeepQuickEditor, useKeepToastFeedback, useKeepTour, useKeepTourShortcuts, useKeepUiLabels, useKeepUrlSync, useUiLabelVisibility };
|