@keepkit/ui 0.28.2 → 0.28.3
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 -4
- package/dist/index.d.ts +71 -8
- package/dist/index.js +1051 -423
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -57,7 +57,9 @@ 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
|
-
|
|
60
|
+
|
|
61
|
+
未分類アイテムを整理するには`<keep.Inbox />`を使います。Inboxは一括移動・archive・pinと、カードのnote/tag編集を有効にします。`KeepCollection features={{ savedViews: true }}`は現在のqueryを保存し、保存済みqueryの適用・名前変更・pin・削除を提供します。`KeepWorkspace modules={{ inbox: true, savedViews: true }}`でも両方をopt-inできます。Saved Viewデータはアイテムとは別の`keepkit:saved-views` localStorage keyに保存されます。
|
|
62
|
+
再発見には`useKeepItem(item).recordOpen()`で`lastOpenedAt`を記録し、`activity`クエリまたは`createRediscoveryQuery()` / `useKeepRediscovery()`を利用できます。`inactiveForMs`は未閲覧なら`savedAt`、閲覧済みなら`lastOpenedAt`を基準にし、開封記録だけでは`updatedAt`を変更しません。`<KeepRediscovery strategy="forgotten" limit={5} />`は低レベルの一覧プリセット、`<KeepRediscoveryPanel strategy="forgotten" limit={5} />`は表示理由とActivityバッジ付きの標準UIです。カード単位では`trackOpen`を指定したときだけ開封記録を有効にします。
|
|
61
63
|
保存確認から対象へ戻すには`revealRequest={{ requestId, itemId }}`を渡し、`onRevealResult`で結果を受け取れます。検索・タグ・保存先フィルターとページを調整して対象を表示します。
|
|
62
64
|
`KeepWorkspace`はこれらのプリミティブを一つにまとめ、`basic`、`standard`、`management`、`sync`のプリセットを提供します。`createKeepKit()`を利用する場合は同じ実装を`keep.Workspace`から型付きで利用できます。`modules`、`slots`、子コンポーネントごとのpropsで部分的に差し替えられます。
|
|
63
65
|
`KeepCollectionManager`は作成・名前変更・削除・件数表示をまとめたheadless UIです。`allowCreate`、`allowRename`、`allowDelete`、`showCounts`で機能を個別に切り替えられ、`collectionLabels`、`title`、`description`、`empty`で表示を差し替えられます。
|
|
@@ -109,7 +111,7 @@ const onFeedback = useKeepToastFeedback(toast);
|
|
|
109
111
|
<KeepKitProvider storage={storage} onFeedback={onFeedback}>{children}</KeepKitProvider>;
|
|
110
112
|
```
|
|
111
113
|
|
|
112
|
-
v0.28.
|
|
114
|
+
v0.28.3ではInboxによる未分類アイテムの整理と、queryを保存・再適用できるSaved Viewsを追加しました。利用履歴、Rediscovery、個別解除できるフィルターサマリーも引き続き利用できます。
|
|
113
115
|
Phase 4の状態UIとして`KeepItemStatusBadge`、`KeepStaleNotice`、`KeepPruneStaleButton`、`KeepSyncStatusBanner`、`KeepSyncRecoveryDialog`を利用できます。`import "@keepkit/ui/theme.css"`でテーマCSSを有効にできます。
|
|
114
116
|
|
|
115
117
|
### Tailwind/shadcnテーマ
|
|
@@ -200,6 +202,8 @@ function SavedArticles() {
|
|
|
200
202
|
```
|
|
201
203
|
|
|
202
204
|
`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.
|
|
205
|
+
|
|
206
|
+
Use `<keep.Inbox />` to triage unassigned items. It enables batch collection moves, archive/pin actions, and card note/tag editing. `KeepCollection features={{ savedViews: true }}` saves the current query and supports applying, renaming, pinning, and deleting saved queries. `KeepWorkspace modules={{ inbox: true, savedViews: true }}` opts into both. Saved Views use the separate `keepkit:saved-views` localStorage key.
|
|
203
207
|
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.
|
|
204
208
|
`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.
|
|
205
209
|
`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`.
|
|
@@ -250,7 +254,7 @@ const onFeedback = useKeepToastFeedback(toast);
|
|
|
250
254
|
<KeepKitProvider storage={storage} onFeedback={onFeedback}>{children}</KeepKitProvider>;
|
|
251
255
|
```
|
|
252
256
|
|
|
253
|
-
v0.28.
|
|
257
|
+
v0.28.3 adds Inbox triage and reusable Saved Views, alongside activity tracking, Rediscovery, and removable active-filter summaries. The portal-rendered floating tour UI, Tailwind CSS v4 integration, host-theme isolation, and cascade-layer support remain available.
|
|
254
258
|
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.
|
|
255
259
|
|
|
256
260
|
### Tailwind and shadcn theme
|
|
@@ -294,7 +298,7 @@ import { KeepItemCard, KeepThemeProvider } from "@keepkit/ui";
|
|
|
294
298
|
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`.
|
|
295
299
|
|
|
296
300
|
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 `<
|
|
301
|
+
For rediscovery, use `useKeepItem(item).recordOpen()` to persist `lastOpenedAt`, then query `activity` with `opened`, `lastOpenedBefore`, `lastOpenedAfter`, or `inactiveForMs`. `inactiveForMs` uses `savedAt` for never-opened items and `lastOpenedAt` for opened items; recording an open does not change `updatedAt`. `createRediscoveryQuery()` / `useKeepRediscovery()` provide standard `never-opened`, `forgotten`, and `recently-opened` views. `<KeepRediscovery>` remains the low-level list, while `<KeepRediscoveryPanel>` adds an explanation and Activity badges. `KeepItemCard trackOpen` opts into tracking without changing existing cards.
|
|
298
302
|
|
|
299
303
|
Framework-neutral APIs remain available from `@keepkit/core/core`, low-level React bindings from `@keepkit/core/react`, and storage adapters from `@keepkit/core/storage`.
|
|
300
304
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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, KeepRediscoveryStrategy, KeepSyncConflict } from '@keepkit/core/core';
|
|
3
|
+
import { KeepListQuery, KeepUrlSyncOptions, KeepItemInput, ImportItemsResult, KeepItem, KeepItemStatus, KeepRediscoveryStrategy, KeepSavedViewStorage, KeepSavedView, KeepSyncConflict } from '@keepkit/core/core';
|
|
4
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';
|
|
5
|
+
import { useKeepItem, KeepCollectionSummary, KeepButtonProps as KeepButtonProps$1, UseKeepListResult, KeepErrorBoundaryProps, UseKeepNavigatorResult, CreateKeepKitOptions as CreateKeepKitOptions$1, KeepProviderProps, useKeepContext, useKeepList, UseKeepRediscoveryOptions, UseKeepRediscoveryResult, UseKeepCollectionsResult, UseKeepNavigatorOptions, KeepShortcutOptions } from '@keepkit/core/react';
|
|
6
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
|
|
|
@@ -120,6 +120,14 @@ type KeepBulkActionsState<TMeta = Record<string, unknown>> = {
|
|
|
120
120
|
toggleAll: () => void;
|
|
121
121
|
remove: () => Promise<void>;
|
|
122
122
|
updateTags: () => Promise<void>;
|
|
123
|
+
collectionId: string;
|
|
124
|
+
setCollectionId: (value: string) => void;
|
|
125
|
+
collections: KeepCollectionSummary[];
|
|
126
|
+
moveToCollection: () => Promise<void>;
|
|
127
|
+
archive: () => Promise<void>;
|
|
128
|
+
unarchive: () => Promise<void>;
|
|
129
|
+
pin: () => Promise<void>;
|
|
130
|
+
unpin: () => Promise<void>;
|
|
123
131
|
isMutating: boolean;
|
|
124
132
|
selectionScope: KeepSelectionScope;
|
|
125
133
|
setSelectionScope: (scope: KeepSelectionScope) => void;
|
|
@@ -255,6 +263,7 @@ type KeepImageProps = ImgHTMLAttributes<HTMLImageElement> & {
|
|
|
255
263
|
alt: string;
|
|
256
264
|
};
|
|
257
265
|
type KeepItemCardVariant = "outlined" | "elevated" | "filled";
|
|
266
|
+
type KeepActivityKind = "opened" | "inactive";
|
|
258
267
|
type KeepItemCardProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children" | "title"> & {
|
|
259
268
|
ref?: Ref<HTMLElement> | {
|
|
260
269
|
readonly current: unknown;
|
|
@@ -269,6 +278,8 @@ type KeepItemCardProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HT
|
|
|
269
278
|
showTags?: boolean;
|
|
270
279
|
showNote?: boolean;
|
|
271
280
|
showSavedAt?: boolean;
|
|
281
|
+
showActivity?: boolean;
|
|
282
|
+
activityKind?: KeepActivityKind;
|
|
272
283
|
collectionLabels?: Record<string, string>;
|
|
273
284
|
imageAlt?: string;
|
|
274
285
|
render?: RenderProp<KeepItemCardState<TMeta>>;
|
|
@@ -313,7 +324,7 @@ type KeepItemCardSkeletonProps = Omit<HTMLAttributes<HTMLElement>, "children"> &
|
|
|
313
324
|
layout?: KeepLayoutPreset;
|
|
314
325
|
};
|
|
315
326
|
/** A low-dependency item presentation primitive with composable card parts. */
|
|
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;
|
|
327
|
+
declare function KeepItemCardRoot<TMeta = Record<string, unknown>>({ item, title, getTitle, getImageProps, imageComponent: ImageComponent, renderImage, renderTags, showTags, showNote, showSavedAt, showActivity, activityKind, 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;
|
|
317
328
|
declare function KeepItemCardMedia({ children, fallback, ...props }: KeepItemCardMediaProps): react.JSX.Element;
|
|
318
329
|
declare function KeepItemCardContent({ children, ...props }: KeepItemCardContentProps): react.JSX.Element;
|
|
319
330
|
declare function KeepItemCardTitle({ as, children, ...props }: KeepItemCardTitleProps): react.DetailedReactHTMLElement<{
|
|
@@ -610,6 +621,11 @@ type KeepItemCardRemoveProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "ch
|
|
|
610
621
|
children?: ReactNode;
|
|
611
622
|
};
|
|
612
623
|
type KeepItemCardBadgeProps = HTMLAttributes<HTMLSpanElement>;
|
|
624
|
+
type KeepLastActivityProps<TMeta = Record<string, unknown>> = HTMLAttributes<HTMLSpanElement> & {
|
|
625
|
+
item: KeepItem<TMeta>;
|
|
626
|
+
kind?: KeepActivityKind;
|
|
627
|
+
};
|
|
628
|
+
declare function KeepLastActivity<TMeta = Record<string, unknown>>({ item, kind, ...props }: KeepLastActivityProps<TMeta>): react.JSX.Element;
|
|
613
629
|
declare function KeepItemCardSave({ labels, getAriaLabel, ...props }: KeepItemCardSaveProps): react.JSX.Element;
|
|
614
630
|
declare function KeepItemCardRemove({ children, disabled, onClick, ...props }: KeepItemCardRemoveProps): react.JSX.Element;
|
|
615
631
|
declare function KeepItemCardPin({ children, ...props }: KeepItemCardActionSlotProps): react.JSX.Element;
|
|
@@ -668,7 +684,7 @@ type KeepListProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLEl
|
|
|
668
684
|
/** A list primitive with built-in loading, empty, error, and removal states. */
|
|
669
685
|
declare function KeepList<TMeta = Record<string, unknown>>(props: KeepListProps<TMeta>): react.JSX.Element;
|
|
670
686
|
|
|
671
|
-
type KeepCollectionFeature = "search" | "sort" | "pagination" | "tagFilter" | "collectionFilter" | "bulkActions" | "tags" | "pin" | "archive" | "note";
|
|
687
|
+
type KeepCollectionFeature = "search" | "sort" | "pagination" | "tagFilter" | "collectionFilter" | "bulkActions" | "tags" | "pin" | "archive" | "note" | "savedViews";
|
|
672
688
|
type KeepLayoutPreset = "list" | "grid" | "compact" | "auto";
|
|
673
689
|
type KeepCollectionToolbarVariant = "plain" | "panel";
|
|
674
690
|
type KeepCollectionToolbarLayout = "flat" | "grouped";
|
|
@@ -767,6 +783,12 @@ type KeepCollectionManagerProps = Omit<HTMLAttributes<HTMLElement>, "children" |
|
|
|
767
783
|
/** A headless collection manager for creating, renaming, and removing collections. */
|
|
768
784
|
declare function KeepCollectionManager<TMeta = Record<string, unknown>>({ allowCreate, allowRename, allowDelete, showCounts, title, description, empty, collectionLabels, onCreated, onRenamed, onDeleted, onError, className, ...rootProps }: KeepCollectionManagerProps): react.JSX.Element;
|
|
769
785
|
|
|
786
|
+
type KeepInboxProps<TMeta = Record<string, unknown>> = Omit<KeepCollectionProps<TMeta>, "query"> & {
|
|
787
|
+
query?: KeepListQuery<TMeta>;
|
|
788
|
+
};
|
|
789
|
+
/** Collection preset for active items that have not been assigned to a collection. */
|
|
790
|
+
declare function KeepInbox<TMeta = Record<string, unknown>>({ query, ...props }: KeepInboxProps<TMeta>): react.JSX.Element;
|
|
791
|
+
|
|
770
792
|
type KeepLayoutProps = Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
771
793
|
layout?: KeepLayoutPreset;
|
|
772
794
|
children?: ReactNode;
|
|
@@ -846,7 +868,7 @@ type KeepTagEditorProps<TMeta = Record<string, unknown>> = Omit<FormHTMLAttribut
|
|
|
846
868
|
/** Edits one item's normalized tag set; Enter adds and Backspace removes the last tag. */
|
|
847
869
|
declare function KeepTagEditor<TMeta = Record<string, unknown>>({ item, availableTags, onSaved, onSaveError, render, ...props }: KeepTagEditorProps<TMeta>): react.JSX.Element;
|
|
848
870
|
|
|
849
|
-
type KeepUiLabelKey = "save" | "saved" | "remove" | "loading" | "saving" | "syncing" | "error" | "archive" | "unarchive" | "archived" | "pin" | "unpin" | "pinned" | "collection" | "allCollections" | "filterCollections" | "uncategorized" | "saveWithNote" | "editSavedItem" | "unsavedChanges" | "allTags" | "tags" | "filterTags" | "activeFilters" | "clearFilters" | "clearAllFilters" | "removeFilter" | "noFilteredItems" | "noFilteredItemsDescription" | "emptyStorageDescription" | "note" | "saveNote" | "noItems" | "loadingItems" | "errorItems" | "search" | "sort" | "newest" | "oldest" | "savedNewest" | "savedOldest" | "updatedNewest" | "updatedOldest" | "previousPage" | "nextPage" | "pagination" | "page" | "selectItems" | "selectedCount" | "deleteSelected" | "tagsToApply" | "applyTags" | "savedMessage" | "removedMessage" | "restoredMessage" | "syncFailedMessage" | "stalePrunedMessage" | "undo" | "undoAvailable" | "selectionScope" | "currentPage" | "searchResults" | "allItems" | "localVersion" | "remoteVersion" | "updatedAt" | "statusAvailable" | "noteSavedMessage" | "exportData" | "importData" | "importMode" | "merge" | "replace" | "importedCount" | "failedCount" | "storageQuotaError" | "statusExpired" | "statusRemoved" | "statusDeleted" | "statusPrivate" | "statusUnknown" | "retry" | "removeFromList" | "pruneStale" | "retrySync" | "resolveSync" | "keepLocal" | "useServer" | "manualMerge" | "close" | "backupRecovery" | "backupRecoveryDescription" | "syncPending" | "syncSynced" | "syncConflict" | "archiveScope" | "archiveScopeActive" | "archiveScopeArchived" | "archiveScopeAll" | "activityNeverOpened" | "activityOpened" | "activityInactiveFor" | "activityBefore" | "activityAfter" | "undoReorder" | "toolbarStart" | "toolbarQuery" | "toolbarFilters" | "toolbarEnd" | "createCollection" | "createCollectionSubmit" | "collectionName" | "manageCollections" | "renameCollection" | "renameCollectionSubmit" | "deleteCollection" | "deleteCollectionConfirm" | "deleteCollectionSubmit" | "cancel" | "collectionItem" | "collectionItems";
|
|
871
|
+
type KeepUiLabelKey = "save" | "saved" | "remove" | "loading" | "saving" | "syncing" | "error" | "archive" | "unarchive" | "archived" | "pin" | "unpin" | "pinned" | "collection" | "allCollections" | "filterCollections" | "uncategorized" | "saveWithNote" | "editSavedItem" | "unsavedChanges" | "allTags" | "tags" | "filterTags" | "activeFilters" | "clearFilters" | "clearAllFilters" | "resetFilters" | "removeFilter" | "noFilteredItems" | "noFilteredItemsDescription" | "emptyStorageDescription" | "note" | "saveNote" | "noItems" | "loadingItems" | "errorItems" | "search" | "sort" | "newest" | "oldest" | "savedNewest" | "savedOldest" | "updatedNewest" | "updatedOldest" | "previousPage" | "nextPage" | "pagination" | "page" | "selectItems" | "selectedCount" | "deleteSelected" | "tagsToApply" | "applyTags" | "savedMessage" | "removedMessage" | "restoredMessage" | "syncFailedMessage" | "stalePrunedMessage" | "undo" | "undoAvailable" | "selectionScope" | "currentPage" | "searchResults" | "allItems" | "localVersion" | "remoteVersion" | "updatedAt" | "statusAvailable" | "noteSavedMessage" | "exportData" | "importData" | "importMode" | "merge" | "replace" | "importedCount" | "failedCount" | "storageQuotaError" | "statusExpired" | "statusRemoved" | "statusDeleted" | "statusPrivate" | "statusUnknown" | "retry" | "removeFromList" | "pruneStale" | "retrySync" | "resolveSync" | "keepLocal" | "useServer" | "manualMerge" | "close" | "backupRecovery" | "backupRecoveryDescription" | "syncPending" | "syncSynced" | "syncConflict" | "archiveScope" | "archiveScopeActive" | "archiveScopeArchived" | "archiveScopeAll" | "activityNeverOpened" | "activityOpened" | "activityInactiveFor" | "activityInactiveSuffix" | "activityBefore" | "activityAfter" | "undoReorder" | "toolbarStart" | "toolbarQuery" | "toolbarFilters" | "toolbarEnd" | "createCollection" | "createCollectionSubmit" | "collectionName" | "manageCollections" | "renameCollection" | "renameCollectionSubmit" | "deleteCollection" | "deleteCollectionConfirm" | "deleteCollectionSubmit" | "cancel" | "collectionItem" | "collectionItems";
|
|
850
872
|
type KeepUiLabelOptions = {
|
|
851
873
|
/** Replaces the localized label text. Omit to keep the locale default. */
|
|
852
874
|
text?: string;
|
|
@@ -1039,6 +1061,8 @@ type KeepActiveFiltersSummaryProps<TMeta = Record<string, unknown>> = Omit<HTMLA
|
|
|
1039
1061
|
tags?: readonly string[];
|
|
1040
1062
|
collection?: string;
|
|
1041
1063
|
collectionLabel?: string;
|
|
1064
|
+
organization?: KeepListQuery<TMeta>["organization"];
|
|
1065
|
+
savedBetween?: KeepListQuery<TMeta>["savedBetween"];
|
|
1042
1066
|
activity?: KeepListQuery<TMeta>["activity"];
|
|
1043
1067
|
activityLabel?: string;
|
|
1044
1068
|
archiveScope?: KeepListQuery<TMeta>["archiveScope"];
|
|
@@ -1047,9 +1071,13 @@ type KeepActiveFiltersSummaryProps<TMeta = Record<string, unknown>> = Omit<HTMLA
|
|
|
1047
1071
|
onSearchChange?: (value: string) => void;
|
|
1048
1072
|
onTagChange?: (tag: string) => void;
|
|
1049
1073
|
onCollectionChange?: (collectionId?: string) => void;
|
|
1074
|
+
onOrganizationChange?: (organization?: KeepListQuery<TMeta>["organization"]) => void;
|
|
1075
|
+
onSavedBetweenChange?: (range?: KeepListQuery<TMeta>["savedBetween"]) => void;
|
|
1050
1076
|
onActivityChange?: (activity?: KeepListQuery<TMeta>["activity"]) => void;
|
|
1051
1077
|
onArchiveScopeChange?: (scope: NonNullable<KeepListQuery<TMeta>["archiveScope"]>) => void;
|
|
1052
1078
|
onClear?: () => void;
|
|
1079
|
+
onReset?: () => void;
|
|
1080
|
+
canReset?: boolean;
|
|
1053
1081
|
children?: ReactNode | RenderProp<KeepActiveFiltersSummaryState>;
|
|
1054
1082
|
asChild?: boolean;
|
|
1055
1083
|
};
|
|
@@ -1057,6 +1085,8 @@ type KeepActiveFiltersSummaryState = {
|
|
|
1057
1085
|
search: string;
|
|
1058
1086
|
tags: string[];
|
|
1059
1087
|
collection?: string;
|
|
1088
|
+
organization?: KeepListQuery["organization"];
|
|
1089
|
+
savedBetween?: KeepListQuery["savedBetween"];
|
|
1060
1090
|
activity?: KeepListQuery["activity"];
|
|
1061
1091
|
archiveScope?: KeepListQuery["archiveScope"];
|
|
1062
1092
|
totalCount?: number;
|
|
@@ -1065,11 +1095,14 @@ type KeepActiveFiltersSummaryState = {
|
|
|
1065
1095
|
removeSearch: () => void;
|
|
1066
1096
|
removeTag: (tag: string) => void;
|
|
1067
1097
|
removeCollection: () => void;
|
|
1098
|
+
removeOrganization: (field: "collection" | "tags" | "note") => void;
|
|
1099
|
+
removeSavedBetween: () => void;
|
|
1068
1100
|
removeActivity: () => void;
|
|
1069
1101
|
removeArchiveScope: () => void;
|
|
1102
|
+
reset: () => void;
|
|
1070
1103
|
};
|
|
1071
1104
|
/** Lists active query filters with one-tap recovery actions. */
|
|
1072
|
-
declare function KeepActiveFiltersSummary<TMeta = Record<string, unknown>>({ query, search: providedSearch, tags: providedTags, collection: providedCollection, collectionLabel: providedCollectionLabel, activity: providedActivity, activityLabel: providedActivityLabel, archiveScope: providedArchiveScope, archiveScopeLabel: providedArchiveScopeLabel, totalCount, onSearchChange, onTagChange, onCollectionChange, onActivityChange, onArchiveScopeChange, onClear, children, asChild, className, ...rootProps }: KeepActiveFiltersSummaryProps<TMeta>): ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
|
|
1105
|
+
declare function KeepActiveFiltersSummary<TMeta = Record<string, unknown>>({ query, search: providedSearch, tags: providedTags, collection: providedCollection, collectionLabel: providedCollectionLabel, organization: providedOrganization, savedBetween: providedSavedBetween, activity: providedActivity, activityLabel: providedActivityLabel, archiveScope: providedArchiveScope, archiveScopeLabel: providedArchiveScopeLabel, totalCount, onSearchChange, onTagChange, onCollectionChange, onOrganizationChange, onSavedBetweenChange, onActivityChange, onArchiveScopeChange, onClear, onReset, canReset, children, asChild, className, ...rootProps }: KeepActiveFiltersSummaryProps<TMeta>): ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
|
|
1073
1106
|
|
|
1074
1107
|
type KeepCollectionOption = {
|
|
1075
1108
|
id?: string;
|
|
@@ -1153,6 +1186,33 @@ type KeepRediscoveryProps<TMeta = Record<string, unknown>> = Omit<KeepListProps<
|
|
|
1153
1186
|
};
|
|
1154
1187
|
/** A small composition for the standard rediscovery queries. */
|
|
1155
1188
|
declare function KeepRediscovery<TMeta = Record<string, unknown>>({ strategy, inactiveForMs, limit, itemCardProps, ...props }: KeepRediscoveryProps<TMeta>): react.JSX.Element;
|
|
1189
|
+
type KeepRediscoveryPanelProps<TMeta = Record<string, unknown>> = Omit<KeepRediscoveryProps<TMeta>, "children"> & Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
1190
|
+
title?: string;
|
|
1191
|
+
description?: string;
|
|
1192
|
+
};
|
|
1193
|
+
/** A labelled Rediscovery section that explains why its items are shown. */
|
|
1194
|
+
declare function KeepRediscoveryPanel<TMeta = Record<string, unknown>>({ title, description, strategy, ...props }: KeepRediscoveryPanelProps<TMeta>): react.JSX.Element;
|
|
1195
|
+
|
|
1196
|
+
type KeepSavedViewsProps<TMeta = Record<string, unknown>> = {
|
|
1197
|
+
storage?: KeepSavedViewStorage<TMeta>;
|
|
1198
|
+
onApply?: (query: KeepListQuery<TMeta>) => void;
|
|
1199
|
+
};
|
|
1200
|
+
declare function KeepSavedViews<TMeta = Record<string, unknown>>({ storage, onApply }: KeepSavedViewsProps<TMeta>): react.JSX.Element;
|
|
1201
|
+
declare function KeepSaveViewButton<TMeta = Record<string, unknown>>({ query, storage, }: {
|
|
1202
|
+
query: KeepListQuery<TMeta>;
|
|
1203
|
+
storage?: KeepSavedViewStorage<TMeta>;
|
|
1204
|
+
}): react.JSX.Element;
|
|
1205
|
+
|
|
1206
|
+
type UseKeepSavedViewsResult<TMeta = Record<string, unknown>> = {
|
|
1207
|
+
views: KeepSavedView<TMeta>[];
|
|
1208
|
+
error: unknown;
|
|
1209
|
+
refresh: () => Promise<void>;
|
|
1210
|
+
createView: (name: string, query: KeepListQuery<TMeta>) => Promise<KeepSavedView<TMeta>>;
|
|
1211
|
+
updateView: (id: string, update: Partial<Pick<KeepSavedView<TMeta>, "name" | "query" | "pinned">>) => Promise<void>;
|
|
1212
|
+
removeView: (id: string) => Promise<void>;
|
|
1213
|
+
applyView: (id: string) => Promise<KeepListQuery<TMeta> | undefined>;
|
|
1214
|
+
};
|
|
1215
|
+
declare function useKeepSavedViews<TMeta = Record<string, unknown>>(storage?: KeepSavedViewStorage<TMeta>): UseKeepSavedViewsResult<TMeta>;
|
|
1156
1216
|
|
|
1157
1217
|
type KeepStaleNoticeProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
1158
1218
|
item: KeepItem<TMeta>;
|
|
@@ -1233,7 +1293,7 @@ type KeepSyncStatusBannerProps = Omit<HTMLAttributes<HTMLElement>, "children"> &
|
|
|
1233
1293
|
declare function KeepSyncStatusBanner({ onRetry, onResolveConflicts, children, className, ...props }: KeepSyncStatusBannerProps): react.JSX.Element | null;
|
|
1234
1294
|
|
|
1235
1295
|
type KeepWorkspacePreset = "basic" | "standard" | "management" | "sync";
|
|
1236
|
-
type KeepWorkspaceModule = "syncStatus" | "undo" | "recovery" | "backup" | "stalePrune";
|
|
1296
|
+
type KeepWorkspaceModule = "syncStatus" | "undo" | "recovery" | "backup" | "stalePrune" | "inbox" | "savedViews";
|
|
1237
1297
|
type KeepWorkspaceRegion = "before" | "syncStatus" | "collection" | "actions" | "undo" | "recovery" | "children" | "after";
|
|
1238
1298
|
type KeepWorkspaceSurface = "plain" | "compact" | "panel";
|
|
1239
1299
|
type KeepWorkspaceSectionGap = "none" | "compact" | "comfortable";
|
|
@@ -1331,11 +1391,14 @@ type KeepKit<TMeta = Record<string, unknown>> = {
|
|
|
1331
1391
|
Button: ComponentType<KeepButtonProps<TMeta>>;
|
|
1332
1392
|
Backup: ComponentType<KeepBackupProps<TMeta>>;
|
|
1333
1393
|
Collection: ComponentType<KeepCollectionProps<TMeta>>;
|
|
1394
|
+
Inbox: ComponentType<KeepInboxProps<TMeta>>;
|
|
1395
|
+
SavedViews: ComponentType<KeepSavedViewsProps<TMeta>>;
|
|
1334
1396
|
CollectionManager: ComponentType<KeepCollectionManagerProps>;
|
|
1335
1397
|
Workspace: ComponentType<KeepWorkspaceProps<TMeta>>;
|
|
1336
1398
|
useContext: () => ReturnType<typeof useKeepContext<TMeta>>;
|
|
1337
1399
|
useItem: (item?: KeepItemInput<TMeta>) => ReturnType<typeof useKeepItem<TMeta>>;
|
|
1338
1400
|
useList: (query?: KeepListQuery<TMeta>) => ReturnType<typeof useKeepList<TMeta>>;
|
|
1401
|
+
useSavedViews: () => UseKeepSavedViewsResult<TMeta>;
|
|
1339
1402
|
useRediscovery: (options: UseKeepRediscoveryOptions) => UseKeepRediscoveryResult<TMeta>;
|
|
1340
1403
|
useCollections: (options?: {
|
|
1341
1404
|
targetType?: string;
|
|
@@ -1352,4 +1415,4 @@ type KeepKit<TMeta = Record<string, unknown>> = {
|
|
|
1352
1415
|
/** Create one typed application API for the core and standard UI layer. */
|
|
1353
1416
|
declare function createKeepKit<TMeta = Record<string, unknown>>(options?: CreateKeepKitOptions<TMeta>): KeepKit<TMeta>;
|
|
1354
1417
|
|
|
1355
|
-
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 };
|
|
1418
|
+
export { type CreateKeepKitOptions, KeepActiveFiltersSummary, type KeepActiveFiltersSummaryProps, type KeepActiveFiltersSummaryState, type KeepActivityKind, 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, KeepInbox, type KeepInboxProps, 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, KeepLastActivity, type KeepLastActivityProps, 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, KeepRediscoveryPanel, type KeepRediscoveryPanelProps, type KeepRediscoveryProps, type KeepReorderableItemState, KeepReorderableList, type KeepReorderableListProps, KeepSavePopover, type KeepSavePopoverProps, KeepSaveViewButton, KeepSavedViews, type KeepSavedViewsProps, 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, type UseKeepSavedViewsResult, chainedFunction, composeRefs, createKeepKit, createNextPagesRouterAdapter, createSlot, getKeepLocaleLabels, highlightText, isAllSelected, keepThemeNames, mergeProps, toggleSelectAll, useKeepQuickEditor, useKeepSavedViews, useKeepToastFeedback, useKeepTour, useKeepTourShortcuts, useKeepUiLabels, useKeepUrlSync, useUiLabelVisibility };
|