@keepkit/ui 0.28.12 → 0.28.14
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 +1 -1
- package/dist/index.d.ts +23 -5
- package/dist/index.js +453 -65
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -60,11 +60,17 @@ declare function KeepPinButton<TMeta = Record<string, unknown>>({ item, children
|
|
|
60
60
|
|
|
61
61
|
type KeepBackupProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
62
62
|
filename?: string;
|
|
63
|
+
markdownFilename?: string;
|
|
64
|
+
/** Enables a button to export saved items as a portable Markdown list. */
|
|
65
|
+
allowMarkdownExport?: boolean;
|
|
66
|
+
/** Requires confirmation with a backup summary before replacing current storage data. */
|
|
67
|
+
confirmReplace?: boolean;
|
|
63
68
|
onExport?: (data: string) => void;
|
|
69
|
+
onExportMarkdown?: (markdown: string) => void;
|
|
64
70
|
onImported?: (result: ImportItemsResult<TMeta>) => void;
|
|
65
71
|
};
|
|
66
72
|
/** Accessible JSON backup controls backed by the current KeepProvider storage. */
|
|
67
|
-
declare function KeepBackup<TMeta = Record<string, unknown>>({ filename, onExport, onImported, ...props }: KeepBackupProps<TMeta>): react.JSX.Element;
|
|
73
|
+
declare function KeepBackup<TMeta = Record<string, unknown>>({ filename, markdownFilename, allowMarkdownExport, confirmReplace, onExport, onExportMarkdown, onImported, ...props }: KeepBackupProps<TMeta>): react.JSX.Element;
|
|
68
74
|
|
|
69
75
|
type RenderProp<TState> = (state: TState) => ReactNode;
|
|
70
76
|
type KeepHighlightProps = {
|
|
@@ -128,6 +134,8 @@ type KeepBulkActionsState<TMeta = Record<string, unknown>> = {
|
|
|
128
134
|
count: number;
|
|
129
135
|
} | null;
|
|
130
136
|
updateTags: () => Promise<void>;
|
|
137
|
+
addTags: () => Promise<void>;
|
|
138
|
+
removeTags: () => Promise<void>;
|
|
131
139
|
collectionId: string;
|
|
132
140
|
setCollectionId: (value: string) => void;
|
|
133
141
|
collections: KeepCollectionSummary[];
|
|
@@ -183,9 +191,11 @@ declare function KeepItemCheckbox<TMeta = Record<string, unknown>>({ item, check
|
|
|
183
191
|
|
|
184
192
|
type KeepQuickEditorState<TMeta = Record<string, unknown>> = {
|
|
185
193
|
item: KeepItem<TMeta>;
|
|
194
|
+
title: string;
|
|
186
195
|
note: string;
|
|
187
196
|
tags: string[];
|
|
188
197
|
collectionId?: string;
|
|
198
|
+
setTitle: (value: string) => void;
|
|
189
199
|
setNote: (value: string) => void;
|
|
190
200
|
setTags: (value: string[]) => void;
|
|
191
201
|
setCollectionId: (value?: string) => void;
|
|
@@ -202,9 +212,11 @@ declare function useKeepQuickEditor<TMeta = Record<string, unknown>>(item: KeepI
|
|
|
202
212
|
}): {
|
|
203
213
|
state: {
|
|
204
214
|
item: KeepItem<TMeta>;
|
|
215
|
+
title: string;
|
|
205
216
|
note: string;
|
|
206
217
|
tags: string[];
|
|
207
218
|
collectionId: string | undefined;
|
|
219
|
+
setTitle: (value: string) => void;
|
|
208
220
|
setNote: (value: string) => void;
|
|
209
221
|
setTags: (value: string[]) => void;
|
|
210
222
|
setCollectionId: (value: string | undefined) => void;
|
|
@@ -215,7 +227,7 @@ declare function useKeepQuickEditor<TMeta = Record<string, unknown>>(item: KeepI
|
|
|
215
227
|
flush: () => Promise<void>;
|
|
216
228
|
};
|
|
217
229
|
};
|
|
218
|
-
type KeepQuickEditorFeature = "note" | "tags" | "collection";
|
|
230
|
+
type KeepQuickEditorFeature = "title" | "note" | "tags" | "collection";
|
|
219
231
|
type KeepQuickEditorProps<TMeta = Record<string, unknown>> = Omit<FormHTMLAttributes<HTMLFormElement>, "children" | "onSubmit"> & {
|
|
220
232
|
item: KeepItem<TMeta>;
|
|
221
233
|
debounceMs?: number;
|
|
@@ -288,6 +300,7 @@ type KeepItemCardProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HT
|
|
|
288
300
|
imageComponent?: ComponentType<KeepImageProps>;
|
|
289
301
|
renderImage?: (props: KeepImageProps, item: KeepItem<TMeta>) => ReactNode;
|
|
290
302
|
renderTags?: (tags: string[], item: KeepItem<TMeta>) => ReactNode;
|
|
303
|
+
onTagClick?: (tag: string, item: KeepItem<TMeta>) => void;
|
|
291
304
|
showTags?: boolean;
|
|
292
305
|
showNote?: boolean;
|
|
293
306
|
showSavedAt?: boolean;
|
|
@@ -340,7 +353,7 @@ type KeepItemCardSkeletonProps = Omit<HTMLAttributes<HTMLElement>, "children"> &
|
|
|
340
353
|
layout?: KeepLayoutPreset;
|
|
341
354
|
};
|
|
342
355
|
/** A low-dependency item presentation primitive with composable card parts. */
|
|
343
|
-
declare function KeepItemCardRoot<TMeta = Record<string, unknown>>({ item, title, getTitle, getImageProps, imageComponent: ImageComponent, renderImage, renderTags, presentation, 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;
|
|
356
|
+
declare function KeepItemCardRoot<TMeta = Record<string, unknown>>({ item, title, getTitle, getImageProps, imageComponent: ImageComponent, renderImage, renderTags, onTagClick, presentation, 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;
|
|
344
357
|
declare function KeepItemCardMedia({ children, fallback, ...props }: KeepItemCardMediaProps): react.JSX.Element;
|
|
345
358
|
declare function KeepItemCardLink({ children, ...props }: KeepItemCardLinkRegionProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react.JSX.Element | null | undefined;
|
|
346
359
|
declare function KeepItemCardContent({ children, ...props }: KeepItemCardContentProps): react.JSX.Element;
|
|
@@ -900,7 +913,7 @@ type KeepTagEditorProps<TMeta = Record<string, unknown>> = Omit<FormHTMLAttribut
|
|
|
900
913
|
/** Edits one item's normalized tag set; Enter adds and Backspace removes the last tag. */
|
|
901
914
|
declare function KeepTagEditor<TMeta = Record<string, unknown>>({ item, availableTags, onSaved, onSaveError, render, ...props }: KeepTagEditorProps<TMeta>): react.JSX.Element;
|
|
902
915
|
|
|
903
|
-
type KeepUiLabelKey = "confirmRemoval" | "confirmRemovalDescription" | "fallbackRecovery" | "inspectRecovery" | "recoveryPrimary" | "recoveryFallback" | "recoverySnapshot" | "recoveryLegacy" | "recoveryUnavailable" | "recoveryStale" | "recoveryPending" | "recoveryReady" | "recoveryChooseSource" | "recoveryPreview" | "recoveryApply" | "recoveryApplied" | "recoveryCommitted" | "recoveryItems" | "recoveryMemberships" | "recoveryBackups" | "recoveryIssues" | "recoveryNoChanges" | "moveSelectedCollection" | "archiveSelected" | "unarchiveSelected" | "pinSelected" | "unpinSelected" | "done" | "moreActions" | "moveSelected" | "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" | "manualSort" | "moveItem" | "reorderMoved" | "reorderFailed" | "savedViews" | "savedViewName" | "saveView" | "renameSavedView" | "savedViewNewName" | "deleteSavedView" | "savedViewsLoadError" | "savedViewSaveError" | "savedViewNameRequired" | "savedViewNotSerializable" | "savedViewInvalidDates";
|
|
916
|
+
type KeepUiLabelKey = "confirmRemoval" | "confirmRemovalDescription" | "confirmReplace" | "confirmReplaceDescription" | "fallbackRecovery" | "inspectRecovery" | "recoveryPrimary" | "recoveryFallback" | "recoverySnapshot" | "recoveryLegacy" | "recoveryUnavailable" | "recoveryStale" | "recoveryPending" | "recoveryReady" | "recoveryChooseSource" | "recoveryPreview" | "recoveryApply" | "recoveryApplied" | "recoveryCommitted" | "recoveryItems" | "recoveryMemberships" | "recoveryBackups" | "recoveryIssues" | "recoveryNoChanges" | "moveSelectedCollection" | "archiveSelected" | "unarchiveSelected" | "pinSelected" | "unpinSelected" | "done" | "moreActions" | "moveSelected" | "save" | "saved" | "remove" | "loading" | "saving" | "syncing" | "error" | "archive" | "unarchive" | "archived" | "pin" | "unpin" | "pinned" | "collection" | "allCollections" | "filterCollections" | "uncategorized" | "saveWithNote" | "editSavedItem" | "unsavedChanges" | "allTags" | "tags" | "title" | "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" | "addTags" | "removeTags" | "savedMessage" | "removedMessage" | "restoredMessage" | "syncFailedMessage" | "stalePrunedMessage" | "undo" | "undoAvailable" | "selectionScope" | "currentPage" | "searchResults" | "allItems" | "localVersion" | "remoteVersion" | "updatedAt" | "statusAvailable" | "noteSavedMessage" | "exportData" | "exportMarkdown" | "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" | "manualSort" | "moveItem" | "reorderMoved" | "reorderFailed" | "savedViews" | "savedViewName" | "saveView" | "renameSavedView" | "savedViewNewName" | "deleteSavedView" | "savedViewsLoadError" | "savedViewSaveError" | "savedViewNameRequired" | "savedViewNotSerializable" | "savedViewInvalidDates";
|
|
904
917
|
type KeepUiLabelOptions = {
|
|
905
918
|
/** Replaces the localized label text. Omit to keep the locale default. */
|
|
906
919
|
text?: string;
|
|
@@ -1160,14 +1173,19 @@ type KeepTagFilterState = {
|
|
|
1160
1173
|
tags: string[];
|
|
1161
1174
|
tagCounts: Record<string, number>;
|
|
1162
1175
|
value?: string;
|
|
1176
|
+
values: string[];
|
|
1163
1177
|
select: (tag?: string) => void;
|
|
1178
|
+
toggle: (tag: string) => void;
|
|
1164
1179
|
};
|
|
1165
1180
|
type KeepTagFilterProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children" | "onChange"> & {
|
|
1166
1181
|
query?: KeepListQuery<TMeta>;
|
|
1167
1182
|
value?: string;
|
|
1168
1183
|
defaultValue?: string;
|
|
1184
|
+
values?: readonly string[];
|
|
1185
|
+
defaultValues?: readonly string[];
|
|
1169
1186
|
onChange?: (tag?: string) => void;
|
|
1170
1187
|
onValueChange?: (tag?: string) => void;
|
|
1188
|
+
onValuesChange?: (tags: string[]) => void;
|
|
1171
1189
|
allLabel?: ReactNode;
|
|
1172
1190
|
ariaLabel?: string;
|
|
1173
1191
|
renderTag?: (tag: string, count: number, selected: boolean) => ReactNode;
|
|
@@ -1176,7 +1194,7 @@ type KeepTagFilterProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<H
|
|
|
1176
1194
|
asChild?: boolean;
|
|
1177
1195
|
};
|
|
1178
1196
|
/** An ARIA button group for tag filtering; consumers can connect value to a collection query. */
|
|
1179
|
-
declare function KeepTagFilter<TMeta = Record<string, unknown>>({ query, value: controlledValue, defaultValue, onChange, onValueChange, allLabel, ariaLabel, renderTag, render, children, asChild, className, ...rootProps }: KeepTagFilterProps<TMeta>): react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
1197
|
+
declare function KeepTagFilter<TMeta = Record<string, unknown>>({ query, value: controlledValue, defaultValue, values: controlledValues, defaultValues, onChange, onValueChange, onValuesChange, allLabel, ariaLabel, renderTag, render, children, asChild, className, ...rootProps }: KeepTagFilterProps<TMeta>): react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
1180
1198
|
|
|
1181
1199
|
type KeepSearchInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange"> & {
|
|
1182
1200
|
value?: string;
|