@keepkit/ui 0.20.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -3
- package/dist/index.d.ts +135 -7
- package/dist/index.js +1230 -344
- package/dist/index.js.map +1 -1
- package/dist/styles/base.css +19 -1
- package/dist/styles/collection.css +105 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -77,7 +77,12 @@ function SavedArticles() {
|
|
|
77
77
|
<KeepItemCard.Title />
|
|
78
78
|
<KeepItemCard.Tags />
|
|
79
79
|
</KeepItemCard.Content>
|
|
80
|
-
<KeepItemCard.Actions
|
|
80
|
+
<KeepItemCard.Actions>
|
|
81
|
+
<KeepItemCard.Save />
|
|
82
|
+
<KeepItemCard.Pin />
|
|
83
|
+
<KeepItemCard.Archive />
|
|
84
|
+
<KeepItemCard.Remove />
|
|
85
|
+
</KeepItemCard.Actions>
|
|
81
86
|
</KeepItemCard>
|
|
82
87
|
```
|
|
83
88
|
|
|
@@ -88,7 +93,7 @@ const onFeedback = useKeepToastFeedback(toast);
|
|
|
88
93
|
<KeepKitProvider storage={storage} onFeedback={onFeedback}>{children}</KeepKitProvider>;
|
|
89
94
|
```
|
|
90
95
|
|
|
91
|
-
v0.
|
|
96
|
+
v0.22.0では保存直後の`KeepSavePopover`自動編集、`KeepQuickEditorState.saveStatus`、`KeepItemCard.Save` / `KeepItemCard.Remove`、管理モード向け`KeepBulkActions`、通知からのコレクション再訪導線を追加しました。`KeepTourBar` / `KeepNavigator`、`KeepReorderableList`、`useKeepTourShortcuts`、16言語の`locale`/`labels`上書きも引き続き利用できます。
|
|
92
97
|
Phase 4の状態UIとして`KeepItemStatusBadge`、`KeepStaleNotice`、`KeepPruneStaleButton`、`KeepSyncStatusBanner`、`KeepSyncRecoveryDialog`を利用できます。`import "@keepkit/ui/theme.css"`でテーマCSSを有効にできます。
|
|
93
98
|
|
|
94
99
|
### Tailwind/shadcnテーマ
|
|
@@ -207,7 +212,7 @@ const onFeedback = useKeepToastFeedback(toast);
|
|
|
207
212
|
<KeepKitProvider storage={storage} onFeedback={onFeedback}>{children}</KeepKitProvider>;
|
|
208
213
|
```
|
|
209
214
|
|
|
210
|
-
In v0.
|
|
215
|
+
In v0.22.0, `KeepSavePopover` supports post-save editing, `KeepQuickEditorState.saveStatus`, `KeepItemCard.Save` / `KeepItemCard.Remove`, management-mode `KeepBulkActions`, and notification-driven return to the collection. `KeepTourBar` / `KeepNavigator`, `KeepReorderableList`, `useKeepTourShortcuts`, 16 built-in locales, and `labels` overrides remain available.
|
|
211
216
|
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.
|
|
212
217
|
|
|
213
218
|
### Tailwind and shadcn theme
|
|
@@ -248,3 +253,11 @@ Use `[data-state="saved"]`, `[data-state="unsaved"]`, `[data-loading="true"]`, `
|
|
|
248
253
|
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.
|
|
249
254
|
|
|
250
255
|
Framework-neutral APIs remain available from `@keepkit/core/core`, low-level React bindings from `@keepkit/core/react`, and storage adapters from `@keepkit/core/storage`.
|
|
256
|
+
|
|
257
|
+
## Archive, pin, collections, and quick save editing
|
|
258
|
+
|
|
259
|
+
The UI package exports `KeepArchiveButton`, `KeepPinButton`, `KeepCollectionSelect`, `KeepCollectionFilter`, `KeepSavePopover`, `KeepQuickEditor`, and `useKeepQuickEditor`. Buttons expose `aria-pressed`, `data-archived`/`data-pinned`, and `data-keep-action`. Collection labels default to IDs and can be overridden with `collectionLabels`. Enable `features={{ collectionFilter: true }}` on `KeepCollection` to include the collection filter. `KeepSavePopover` wraps `KeepButton`, opens after a new save, labels and focuses its dialog, flushes pending edits before closing, and restores focus to the trigger. Its quick editor debounces note, tags, and collection updates by 300ms and exposes `saveStatus`. Set `showSaveButton={false}` when visible save status should replace the submit button. `KeepItemCard.Save` and `KeepItemCard.Remove` let compound cards place those actions alongside `Pin` and `Archive` without replacing the default card API.
|
|
260
|
+
|
|
261
|
+
## アーカイブ・ピン留め・コレクション・保存直後編集
|
|
262
|
+
|
|
263
|
+
UI パッケージは `KeepArchiveButton`、`KeepPinButton`、`KeepCollectionSelect`、`KeepCollectionFilter`、`KeepSavePopover`、`KeepQuickEditor`、`useKeepQuickEditor` を公開します。ボタンは `aria-pressed`、`data-archived` / `data-pinned`、`data-keep-action` を出力します。コレクション名は既定で ID を表示し、`collectionLabels` で置換できます。`KeepCollection` に `features={{ collectionFilter: true }}` を指定するとフィルターを統合できます。`KeepSavePopover` は `KeepButton` を内部 trigger とし、新規保存後にdialogへフォーカスし、閉じる前に未保存編集をflushしてtriggerへフォーカスを戻します。クイックエディターはメモ・タグ・コレクションを一時状態として扱い、既定300msで保存し、`saveStatus`で状態を公開します。自動保存だけを表示する場合は`showSaveButton={false}`を指定します。compound cardでは`KeepItemCard.Save` / `Remove`を`Pin` / `Archive`と同じ操作領域に配置できます。
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { KeepListQuery, KeepUrlSyncOptions, ImportItemsResult, KeepItem, KeepItemStatus, KeepSyncConflict
|
|
2
|
+
import { ButtonHTMLAttributes, ReactNode, HTMLAttributes, ComponentType, Ref, RefCallback, ReactElement, InputHTMLAttributes, FormHTMLAttributes, ImgHTMLAttributes, MouseEvent, HTMLAttributeAnchorTarget, KeyboardEvent, SelectHTMLAttributes, CSSProperties } from 'react';
|
|
3
|
+
import { KeepListQuery, KeepUrlSyncOptions, KeepItemInput, ImportItemsResult, KeepItem, KeepItemStatus, KeepSyncConflict } from '@keepkit/core/core';
|
|
4
4
|
export { AuthenticatedSyncAuthContext, AuthenticatedSyncKit, AuthenticatedSyncKitOptions, AuthenticatedSyncRequestContext, AuthenticatedSyncTransport, KeepItem, KeepItemInput, KeepListQuery, KeepScope, KeepSyncConflict, KeepSyncResolution, KeepSyncState, KeepSyncStatus, KeepUndoState, KeepUrlSyncOptions, createAuthenticatedSyncKit } from '@keepkit/core/core';
|
|
5
|
-
import { KeepButtonProps as KeepButtonProps$1, UseKeepListResult, KeepErrorBoundaryProps, UseKeepNavigatorResult, CreateKeepKitOptions as CreateKeepKitOptions$1, KeepProviderProps, useKeepContext,
|
|
5
|
+
import { useKeepItem, KeepButtonProps as KeepButtonProps$1, UseKeepListResult, KeepErrorBoundaryProps, UseKeepNavigatorResult, CreateKeepKitOptions as CreateKeepKitOptions$1, KeepProviderProps, useKeepContext, useKeepList, UseKeepNavigatorOptions, KeepShortcutOptions } from '@keepkit/core/react';
|
|
6
6
|
export { KeepButtonState, KeepContextValue, KeepErrorBoundary, KeepErrorBoundaryProps, KeepProvider, KeepProviderProps, KeepShortcutOptions, useKeepContext, useKeepItem, useKeepList, useKeepNavigator, useKeepShortcut } from '@keepkit/core/react';
|
|
7
7
|
export { FallbackStorageAdapter, IndexedDBAdapter, IndexedDBSyncQueueAdapter, LocalStorageAdapter, LocalStorageSyncQueueAdapter, SyncStorageAdapter, createBrowserStorageAdapter, createStorageAdapter } from '@keepkit/core/storage';
|
|
8
8
|
|
|
@@ -36,6 +36,27 @@ declare function createNextPagesRouterAdapter(router: KeepPagesRouterLike): Keep
|
|
|
36
36
|
/** Synchronizes collection filters with browser history and supports back/forward restoration. */
|
|
37
37
|
declare function useKeepUrlSync<TMeta = Record<string, unknown>>({ enabled, query, onQueryChange, options, adapter: providedAdapter, }: KeepUrlSyncProps<TMeta>): void;
|
|
38
38
|
|
|
39
|
+
type KeepArchiveButtonState<TMeta = Record<string, unknown>> = ReturnType<typeof useKeepItem<TMeta>>;
|
|
40
|
+
type KeepArchiveButtonProps<TMeta = Record<string, unknown>> = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "onClick" | "aria-pressed"> & {
|
|
41
|
+
item: KeepItemInput<TMeta>;
|
|
42
|
+
children?: ReactNode | ((state: KeepArchiveButtonState<TMeta>) => ReactNode);
|
|
43
|
+
archiveLabel?: ReactNode;
|
|
44
|
+
unarchiveLabel?: ReactNode;
|
|
45
|
+
onToggleError?: (error: unknown) => void;
|
|
46
|
+
};
|
|
47
|
+
/** A style-free accessible archive toggle. */
|
|
48
|
+
declare function KeepArchiveButton<TMeta = Record<string, unknown>>({ item, children, archiveLabel, unarchiveLabel, onToggleError, disabled, ...props }: KeepArchiveButtonProps<TMeta>): react.JSX.Element;
|
|
49
|
+
type KeepPinButtonState<TMeta = Record<string, unknown>> = ReturnType<typeof useKeepItem<TMeta>>;
|
|
50
|
+
type KeepPinButtonProps<TMeta = Record<string, unknown>> = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "onClick" | "aria-pressed"> & {
|
|
51
|
+
item: KeepItemInput<TMeta>;
|
|
52
|
+
children?: ReactNode | ((state: KeepPinButtonState<TMeta>) => ReactNode);
|
|
53
|
+
pinLabel?: ReactNode;
|
|
54
|
+
unpinLabel?: ReactNode;
|
|
55
|
+
onToggleError?: (error: unknown) => void;
|
|
56
|
+
};
|
|
57
|
+
/** A style-free accessible pin toggle. */
|
|
58
|
+
declare function KeepPinButton<TMeta = Record<string, unknown>>({ item, children, pinLabel, unpinLabel, onToggleError, disabled, ...props }: KeepPinButtonProps<TMeta>): react.JSX.Element;
|
|
59
|
+
|
|
39
60
|
type KeepBackupProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
40
61
|
filename?: string;
|
|
41
62
|
onExport?: (data: string) => void;
|
|
@@ -141,6 +162,69 @@ type KeepItemCheckboxProps<TMeta = Record<string, unknown>> = Omit<InputHTMLAttr
|
|
|
141
162
|
/** A reusable accessible selection checkbox for a saved item. */
|
|
142
163
|
declare function KeepItemCheckbox<TMeta = Record<string, unknown>>({ item, checked, label, onCheckedChange, "aria-label": ariaLabel, ...props }: KeepItemCheckboxProps<TMeta>): react.JSX.Element;
|
|
143
164
|
|
|
165
|
+
type KeepQuickEditorState<TMeta = Record<string, unknown>> = {
|
|
166
|
+
item: KeepItem<TMeta>;
|
|
167
|
+
note: string;
|
|
168
|
+
tags: string[];
|
|
169
|
+
collectionId?: string;
|
|
170
|
+
setNote: (value: string) => void;
|
|
171
|
+
setTags: (value: string[]) => void;
|
|
172
|
+
setCollectionId: (value?: string) => void;
|
|
173
|
+
isDirty: boolean;
|
|
174
|
+
isSaving: boolean;
|
|
175
|
+
saveStatus: "idle" | "dirty" | "saving" | "saved" | "error";
|
|
176
|
+
error: unknown | null;
|
|
177
|
+
flush: () => Promise<void>;
|
|
178
|
+
};
|
|
179
|
+
declare function useKeepQuickEditor<TMeta = Record<string, unknown>>(item: KeepItem<TMeta>, options?: {
|
|
180
|
+
debounceMs?: number;
|
|
181
|
+
onSaved?: (item: KeepItem<TMeta>) => void;
|
|
182
|
+
onSaveError?: (error: unknown) => void;
|
|
183
|
+
}): {
|
|
184
|
+
state: {
|
|
185
|
+
item: KeepItem<TMeta>;
|
|
186
|
+
note: string;
|
|
187
|
+
tags: string[];
|
|
188
|
+
collectionId: string | undefined;
|
|
189
|
+
setNote: (value: string) => void;
|
|
190
|
+
setTags: (value: string[]) => void;
|
|
191
|
+
setCollectionId: (value: string | undefined) => void;
|
|
192
|
+
isDirty: boolean;
|
|
193
|
+
isSaving: boolean;
|
|
194
|
+
saveStatus: "saved" | "saving" | "error" | "idle" | "dirty";
|
|
195
|
+
error: unknown;
|
|
196
|
+
flush: () => Promise<void>;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
type KeepQuickEditorProps<TMeta = Record<string, unknown>> = Omit<FormHTMLAttributes<HTMLFormElement>, "children" | "onSubmit"> & {
|
|
200
|
+
item: KeepItem<TMeta>;
|
|
201
|
+
debounceMs?: number;
|
|
202
|
+
collectionIds?: string[];
|
|
203
|
+
collectionLabels?: Record<string, string>;
|
|
204
|
+
showSaveButton?: boolean;
|
|
205
|
+
children?: ReactNode | ((state: KeepQuickEditorState<TMeta>) => ReactNode);
|
|
206
|
+
onClose?: () => void;
|
|
207
|
+
onSaved?: (item: KeepItem<TMeta>) => void;
|
|
208
|
+
onSaveError?: (error: unknown) => void;
|
|
209
|
+
};
|
|
210
|
+
/** A compact, temporary-state editor for note, tags, and collection metadata. */
|
|
211
|
+
declare function KeepQuickEditor<TMeta = Record<string, unknown>>({ item, debounceMs, onSaved, onSaveError, ...props }: KeepQuickEditorProps<TMeta>): react.JSX.Element;
|
|
212
|
+
|
|
213
|
+
type KeepSavePopoverProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
214
|
+
item: KeepItemInput<TMeta>;
|
|
215
|
+
open?: boolean;
|
|
216
|
+
defaultOpen?: boolean;
|
|
217
|
+
onOpenChange?: (open: boolean) => void;
|
|
218
|
+
dialogLabel?: string;
|
|
219
|
+
buttonProps?: Omit<KeepButtonProps<TMeta>, "item" | "asChild"> & {
|
|
220
|
+
asChild?: false;
|
|
221
|
+
};
|
|
222
|
+
editorProps?: Omit<KeepQuickEditorProps<TMeta>, "item" | "onClose">;
|
|
223
|
+
children?: ReactNode;
|
|
224
|
+
};
|
|
225
|
+
/** Opens a quick editor only after this trigger changes from unsaved to saved. */
|
|
226
|
+
declare function KeepSavePopover<TMeta = Record<string, unknown>>({ item, open: controlledOpen, defaultOpen, onOpenChange, dialogLabel, buttonProps, editorProps, children, ...props }: KeepSavePopoverProps<TMeta>): react.JSX.Element;
|
|
227
|
+
|
|
144
228
|
type KeepUndoProps = Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
145
229
|
children?: ReactNode;
|
|
146
230
|
label?: ReactNode;
|
|
@@ -180,6 +264,7 @@ type KeepItemCardProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HT
|
|
|
180
264
|
renderTags?: (tags: string[], item: KeepItem<TMeta>) => ReactNode;
|
|
181
265
|
showTags?: boolean;
|
|
182
266
|
showSavedAt?: boolean;
|
|
267
|
+
collectionLabels?: Record<string, string>;
|
|
183
268
|
imageAlt?: string;
|
|
184
269
|
render?: RenderProp<KeepItemCardState<TMeta>>;
|
|
185
270
|
children?: ReactNode | RenderProp<KeepItemCardState<TMeta>>;
|
|
@@ -212,7 +297,7 @@ type KeepItemCardSkeletonProps = Omit<HTMLAttributes<HTMLElement>, "children"> &
|
|
|
212
297
|
layout?: KeepLayoutPreset;
|
|
213
298
|
};
|
|
214
299
|
/** A low-dependency item presentation primitive with composable card parts. */
|
|
215
|
-
declare function KeepItemCardRoot<TMeta = Record<string, unknown>>({ item, title, getTitle, getImageProps, imageComponent: ImageComponent, renderImage, renderTags, showTags, showSavedAt, imageAlt, render, children, removeLabel, onRemoveError, onRemoved, onRetry, showSaveButton, saveButtonLabels, asChild, href: hrefOption, onOpen, linkTarget, linkComponent: LinkComponent, linkTargetAttribute, linkRel, highlightQuery, className, ...rootProps }: KeepItemCardProps<TMeta>): react.JSX.Element;
|
|
300
|
+
declare function KeepItemCardRoot<TMeta = Record<string, unknown>>({ item, title, getTitle, getImageProps, imageComponent: ImageComponent, renderImage, renderTags, showTags, showSavedAt, collectionLabels, imageAlt, render, children, removeLabel, onRemoveError, onRemoved, onRetry, showSaveButton, saveButtonLabels, asChild, href: hrefOption, onOpen, linkTarget, linkComponent: LinkComponent, linkTargetAttribute, linkRel, highlightQuery, className, ...rootProps }: KeepItemCardProps<TMeta>): react.JSX.Element;
|
|
216
301
|
declare function KeepItemCardMedia({ children, fallback, ...props }: KeepItemCardMediaProps): react.JSX.Element;
|
|
217
302
|
declare function KeepItemCardContent({ children, ...props }: KeepItemCardContentProps): react.JSX.Element;
|
|
218
303
|
declare function KeepItemCardTitle({ as, children, ...props }: KeepItemCardTitleProps): react.DetailedReactHTMLElement<{
|
|
@@ -499,12 +584,34 @@ declare function KeepItemCardTitle({ as, children, ...props }: KeepItemCardTitle
|
|
|
499
584
|
}, HTMLElement>;
|
|
500
585
|
declare function KeepItemCardTags({ children, ...props }: KeepItemCardTagsProps): string | number | bigint | true | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react.JSX.Element | null;
|
|
501
586
|
declare function KeepItemCardActions({ children, ...props }: KeepItemCardActionsProps): react.JSX.Element;
|
|
587
|
+
type KeepItemCardActionSlotProps = Omit<KeepPinButtonProps<unknown>, "item" | "children"> & {
|
|
588
|
+
children?: ReactNode;
|
|
589
|
+
};
|
|
590
|
+
type KeepItemCardSaveProps = Omit<KeepButtonProps<unknown>, "item" | "asChild"> & {
|
|
591
|
+
asChild?: false;
|
|
592
|
+
};
|
|
593
|
+
type KeepItemCardRemoveProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> & {
|
|
594
|
+
children?: ReactNode;
|
|
595
|
+
};
|
|
596
|
+
type KeepItemCardBadgeProps = HTMLAttributes<HTMLSpanElement>;
|
|
597
|
+
declare function KeepItemCardSave({ labels, getAriaLabel, ...props }: KeepItemCardSaveProps): react.JSX.Element;
|
|
598
|
+
declare function KeepItemCardRemove({ children, disabled, onClick, ...props }: KeepItemCardRemoveProps): react.JSX.Element;
|
|
599
|
+
declare function KeepItemCardPin({ children, ...props }: KeepItemCardActionSlotProps): react.JSX.Element;
|
|
600
|
+
declare function KeepItemCardArchive({ children, ...props }: Omit<KeepArchiveButtonProps<unknown>, "item" | "children"> & {
|
|
601
|
+
children?: ReactNode;
|
|
602
|
+
}): react.JSX.Element;
|
|
603
|
+
declare function KeepItemCardCollectionBadge({ children, ...props }: KeepItemCardBadgeProps): react.JSX.Element | null;
|
|
502
604
|
declare const KeepItemCard: typeof KeepItemCardRoot & {
|
|
503
605
|
Media: typeof KeepItemCardMedia;
|
|
504
606
|
Content: typeof KeepItemCardContent;
|
|
505
607
|
Title: typeof KeepItemCardTitle;
|
|
506
608
|
Tags: typeof KeepItemCardTags;
|
|
507
609
|
Actions: typeof KeepItemCardActions;
|
|
610
|
+
Save: typeof KeepItemCardSave;
|
|
611
|
+
Remove: typeof KeepItemCardRemove;
|
|
612
|
+
Pin: typeof KeepItemCardPin;
|
|
613
|
+
Archive: typeof KeepItemCardArchive;
|
|
614
|
+
CollectionBadge: typeof KeepItemCardCollectionBadge;
|
|
508
615
|
};
|
|
509
616
|
/** A non-interactive placeholder that preserves the selected card layout while data loads. */
|
|
510
617
|
declare function KeepItemCardSkeleton({ layout, ...props }: KeepItemCardSkeletonProps): react.JSX.Element;
|
|
@@ -534,7 +641,7 @@ type KeepListProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLEl
|
|
|
534
641
|
/** A list primitive with built-in loading, empty, error, and removal states. */
|
|
535
642
|
declare function KeepList<TMeta = Record<string, unknown>>(props: KeepListProps<TMeta>): react.JSX.Element;
|
|
536
643
|
|
|
537
|
-
type KeepCollectionFeature = "search" | "sort" | "pagination" | "tagFilter" | "bulkActions";
|
|
644
|
+
type KeepCollectionFeature = "search" | "sort" | "pagination" | "tagFilter" | "collectionFilter" | "bulkActions";
|
|
538
645
|
type KeepLayoutPreset = "list" | "grid" | "compact" | "auto";
|
|
539
646
|
type KeepCollectionProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
540
647
|
query?: KeepListQuery<TMeta>;
|
|
@@ -543,6 +650,7 @@ type KeepCollectionProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<
|
|
|
543
650
|
urlSync?: boolean | KeepUrlSyncOptions;
|
|
544
651
|
urlAdapter?: KeepUrlAdapter;
|
|
545
652
|
features?: Partial<Record<KeepCollectionFeature, boolean>>;
|
|
653
|
+
collectionLabels?: Record<string, string>;
|
|
546
654
|
renderItem?: (item: KeepItem<TMeta>, state: KeepListState<TMeta>) => ReactNode;
|
|
547
655
|
itemCardProps?: Omit<KeepItemCardProps<TMeta>, "item" | "children" | "render">;
|
|
548
656
|
loading?: ReactNode | RenderProp<KeepListState<TMeta>>;
|
|
@@ -638,7 +746,7 @@ type KeepTagEditorProps<TMeta = Record<string, unknown>> = Omit<FormHTMLAttribut
|
|
|
638
746
|
/** Edits one item's normalized tag set; Enter adds and Backspace removes the last tag. */
|
|
639
747
|
declare function KeepTagEditor<TMeta = Record<string, unknown>>({ item, availableTags, onSaved, onSaveError, render, ...props }: KeepTagEditorProps<TMeta>): react.JSX.Element;
|
|
640
748
|
|
|
641
|
-
type KeepUiLabelKey = "save" | "saved" | "remove" | "loading" | "saving" | "syncing" | "error" | "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";
|
|
749
|
+
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";
|
|
642
750
|
type KeepUiLabels = Partial<Record<KeepUiLabelKey, string>>;
|
|
643
751
|
type KeepUiLocaleLabels = Record<KeepUiLabelKey, string>;
|
|
644
752
|
|
|
@@ -778,6 +886,26 @@ type KeepActiveFiltersSummaryState = {
|
|
|
778
886
|
/** Lists active search and tag filters with one-tap recovery actions. */
|
|
779
887
|
declare function KeepActiveFiltersSummary<TMeta = Record<string, unknown>>({ query, search: providedSearch, tags: providedTags, onSearchChange, onTagChange, onClear, children, asChild, className, ...rootProps }: KeepActiveFiltersSummaryProps<TMeta>): ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
|
|
780
888
|
|
|
889
|
+
type KeepCollectionOption = {
|
|
890
|
+
id?: string;
|
|
891
|
+
label: string;
|
|
892
|
+
};
|
|
893
|
+
type KeepCollectionControlProps = Omit<SelectHTMLAttributes<HTMLSelectElement>, "value" | "defaultValue" | "onChange"> & {
|
|
894
|
+
value?: string;
|
|
895
|
+
defaultValue?: string;
|
|
896
|
+
onValueChange?: (collectionId?: string) => void;
|
|
897
|
+
onChange?: (collectionId?: string) => void;
|
|
898
|
+
collectionLabels?: Record<string, string>;
|
|
899
|
+
allLabel?: string;
|
|
900
|
+
uncategorizedLabel?: string;
|
|
901
|
+
};
|
|
902
|
+
/** A select that moves one item between derived collections. */
|
|
903
|
+
declare function KeepCollectionSelect<TMeta = Record<string, unknown>>({ item, value, defaultValue, onValueChange, onChange, collectionLabels, uncategorizedLabel, ...props }: KeepCollectionControlProps & {
|
|
904
|
+
item: KeepItem<TMeta>;
|
|
905
|
+
}): react.JSX.Element;
|
|
906
|
+
/** A select filter for the collections derived from current items. */
|
|
907
|
+
declare function KeepCollectionFilter<TMeta = Record<string, unknown>>({ value, defaultValue, onValueChange, onChange, collectionLabels, allLabel, uncategorizedLabel, ...props }: KeepCollectionControlProps): react.JSX.Element;
|
|
908
|
+
|
|
781
909
|
type KeepTagFilterState = {
|
|
782
910
|
tags: string[];
|
|
783
911
|
tagCounts: Record<string, number>;
|
|
@@ -977,4 +1105,4 @@ type KeepKit<TMeta = Record<string, unknown>> = {
|
|
|
977
1105
|
/** Create one typed application API for the core and standard UI layer. */
|
|
978
1106
|
declare function createKeepKit<TMeta = Record<string, unknown>>(options?: CreateKeepKitOptions<TMeta>): KeepKit<TMeta>;
|
|
979
1107
|
|
|
980
|
-
export { type CreateKeepKitOptions, KeepActiveFiltersSummary, type KeepActiveFiltersSummaryProps, type KeepActiveFiltersSummaryState, KeepAnnouncements, type KeepAnnouncementsProps, KeepAnnouncer, KeepBackup, type KeepBackupProps, KeepBulkActions, type KeepBulkActionsProps, type KeepBulkActionsState, KeepButton, type KeepButtonIcon, type KeepButtonIconProps, type KeepButtonIcons, type KeepButtonLabels, type KeepButtonProps, KeepCollection, type KeepCollectionFeature, type KeepCollectionProps, type KeepDisplayStatus, KeepEmptyState, type KeepEmptyStateProps, type KeepEmptyStateVariant, KeepHighlight, type KeepHighlightProps, type KeepImageProps, KeepItemCard, type KeepItemCardActionsProps, type KeepItemCardContentProps, type KeepItemCardLinkProps, type KeepItemCardMediaProps, type KeepItemCardProps, KeepItemCardSkeleton, type KeepItemCardSkeletonProps, type KeepItemCardState, type KeepItemCardTagsProps, type KeepItemCardTitleProps, 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, KeepPruneStaleButton, type KeepPruneStaleButtonProps, type KeepReorderableItemState, KeepReorderableList, type KeepReorderableListProps, 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 KeepUiLabels, type KeepUiLocale, type KeepUiLocaleLabels, KeepUiProvider, type KeepUiProviderProps, KeepUndo, type KeepUndoProps, type KeepUrlAdapter, type RenderProp, chainedFunction, composeRefs, createKeepKit, createNextPagesRouterAdapter, createSlot, getKeepLocaleLabels, highlightText, isAllSelected, keepThemeNames, mergeProps, toggleSelectAll, useKeepToastFeedback, useKeepTourShortcuts, useKeepUiLabels, useKeepUrlSync };
|
|
1108
|
+
export { type CreateKeepKitOptions, KeepActiveFiltersSummary, type KeepActiveFiltersSummaryProps, type KeepActiveFiltersSummaryState, KeepAnnouncements, type KeepAnnouncementsProps, KeepAnnouncer, KeepArchiveButton, type KeepArchiveButtonProps, type KeepArchiveButtonState, KeepBackup, type KeepBackupProps, KeepBulkActions, type KeepBulkActionsProps, type KeepBulkActionsState, KeepButton, type KeepButtonIcon, type KeepButtonIconProps, type KeepButtonIcons, type KeepButtonLabels, type KeepButtonProps, KeepCollection, type KeepCollectionControlProps, type KeepCollectionFeature, KeepCollectionFilter, type KeepCollectionOption, type KeepCollectionProps, KeepCollectionSelect, 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, 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 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 KeepUiLabels, type KeepUiLocale, type KeepUiLocaleLabels, KeepUiProvider, type KeepUiProviderProps, KeepUndo, type KeepUndoProps, type KeepUrlAdapter, type RenderProp, chainedFunction, composeRefs, createKeepKit, createNextPagesRouterAdapter, createSlot, getKeepLocaleLabels, highlightText, isAllSelected, keepThemeNames, mergeProps, toggleSelectAll, useKeepQuickEditor, useKeepToastFeedback, useKeepTourShortcuts, useKeepUiLabels, useKeepUrlSync };
|