@keepkit/ui 0.28.16 → 0.28.17
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 +31 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +1025 -866
- package/dist/index.js.map +1 -1
- package/dist/styles/base.css +13 -0
- package/dist/styles/collection.css +1 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[日本語](#日本語) | [English](#english)
|
|
4
4
|
|
|
5
|
-
Release: v0.28.
|
|
5
|
+
Release: v0.28.17
|
|
6
6
|
|
|
7
7
|
## 日本語
|
|
8
8
|
|
|
@@ -106,6 +106,21 @@ Next.js Pages Routerでは`createNextPagesRouterAdapter(router)`を`urlAdapter`
|
|
|
106
106
|
`presentation="reading"`はタイトル、URLの保存元、コレクション名、メモ、タグ、保存・訪問情報を表示します。画像は`getImageProps`で指定した場合だけ表示します。保存トグルは既定で非表示、編集・メモ・訪問情報は表示され、既存の表示フラグで上書きできます。`href`と`trackOpen`は明示指定です。編集は300msの自動保存と「完了」を使い、失敗時は下書きを残します。
|
|
107
107
|
|
|
108
108
|
`bulkActionsVariant="inline"`は記事行で選択します。全選択は現在ページだけで、検索・フィルター・ページ・表示先を変えると選択を解除します。失敗した一括操作は選択を保持します。既定の`separate`は従来の選択用一覧を維持します。
|
|
109
|
+
検索結果が0件のときの「フィルターをクリア」は、アーカイブの表示範囲を維持します。トーストのUndoが失敗した場合はエラーと再試行操作を表示します。カード削除・利用不能項目削除の通知は、Undo期限が切れた場合や別の削除が行われた場合に、古い通知から復元できません。
|
|
110
|
+
|
|
111
|
+
`KeepArchiveUndo`を同じProvider内に配置すると、直前にアーカイブした1件を復元できます。復元に失敗した場合はエラーを表示し、再試行できます。一括アーカイブは対象外です。`collapsibleFilters`を`KeepCollection`に渡すとフィルターを開閉でき、閉じても条件は維持されます。Saved Viewsは別に表示されます。
|
|
112
|
+
保存先やスコープを切り替えると、以前の保存先のアーカイブUndoは解除されます。削除の`KeepUndo`と利用不能項目の一括削除は、保存に失敗した場合にエラーを表示し、操作を再試行できます。削除Undoの再試行は元の有効期限内に限ります。
|
|
113
|
+
|
|
114
|
+
```tsx
|
|
115
|
+
import { KeepArchiveUndo, KeepCollection, KeepProvider } from "@keepkit/ui";
|
|
116
|
+
|
|
117
|
+
<KeepProvider storage={storage}>
|
|
118
|
+
<KeepCollection collapsibleFilters features={{ archive: true, tagFilter: true }} />
|
|
119
|
+
<KeepArchiveUndo />
|
|
120
|
+
</KeepProvider>;
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
`KeepBackup`のMergeはバックアップの項目を既存データに統合し、Replaceは現在のデータを置き換えます。Replace選択時はその旨を表示し、`confirmReplace`を指定すると実行前に確認します。保存場所や同期設定はホストアプリ側で説明してください。
|
|
109
124
|
|
|
110
125
|
独自の行には`KeepListSelection`(`selectedIds: readonly string[]`、`onSelectedIdsChange`、任意の`disabled`)を`KeepList.selection`に渡せます。`KeepList`と`KeepCollection`の`renderItem(item, state, selection?)`の第三引数は`KeepItemSelection`(`checked`、`onCheckedChange`、任意の`disabled`)で、`KeepItemCheckbox`にそのまま渡せます。従来の二引数コールバックも使用できます。
|
|
111
126
|
|
|
@@ -308,6 +323,21 @@ Default `linkTarget="card"` links ordinary media and static content, placing tag
|
|
|
308
323
|
`presentation="reading"` shows the title, URL source, collection name, note, tags, and save/open information. Images appear only when supplied through `getImageProps`. It hides the save toggle and shows editing, notes, and activity by default; existing visibility flags override these defaults. Supply `href` and `trackOpen` explicitly. Editing uses 300ms autosave and Done, retaining the draft on failure.
|
|
309
324
|
|
|
310
325
|
`bulkActionsVariant="inline"` selects items on their article rows. Select-all targets only the current page; changes to search, filters, page, or view clear selection. Failed bulk operations retain selection. The default `separate` preserves the existing selection list.
|
|
326
|
+
Clearing filters from an empty search keeps the current archive scope. A failed toast Undo displays the error and a retry action. Card and stale-item removal notifications cannot undo a newer removal or restore an item after their Undo deadline.
|
|
327
|
+
|
|
328
|
+
Place `KeepArchiveUndo` inside the same provider to restore the most recently archived item. A failed restore displays an error and can be retried. Batch archiving is not included. Pass `collapsibleFilters` to `KeepCollection` to hide or show filters without clearing their values; Saved Views remain separate.
|
|
329
|
+
Changing storage or scope clears the previous archive Undo. `KeepUndo` and stale-item bulk removal display persistence errors so users can retry; removal Undo is limited to its original deadline.
|
|
330
|
+
|
|
331
|
+
```tsx
|
|
332
|
+
import { KeepArchiveUndo, KeepCollection, KeepProvider } from "@keepkit/ui";
|
|
333
|
+
|
|
334
|
+
<KeepProvider storage={storage}>
|
|
335
|
+
<KeepCollection collapsibleFilters features={{ archive: true, tagFilter: true }} />
|
|
336
|
+
<KeepArchiveUndo />
|
|
337
|
+
</KeepProvider>;
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
`KeepBackup` merges backup items into existing data in Merge mode; Replace mode replaces the current data. A warning is shown when Replace is selected, and `confirmReplace` requests confirmation before importing. Describe the storage location and sync configuration in the host application.
|
|
311
341
|
|
|
312
342
|
For custom rows, pass `KeepListSelection` (`selectedIds: readonly string[]`, `onSelectedIdsChange`, optional `disabled`) to `KeepList.selection`. The third argument of `KeepList` and `KeepCollection`'s `renderItem(item, state, selection?)` is `KeepItemSelection` (`checked`, `onCheckedChange`, optional `disabled`), ready to spread onto `KeepItemCheckbox`. Existing two-argument callbacks still work.
|
|
313
343
|
|
package/dist/index.d.ts
CHANGED
|
@@ -58,6 +58,9 @@ type KeepPinButtonProps<TMeta = Record<string, unknown>> = Omit<ButtonHTMLAttrib
|
|
|
58
58
|
/** A style-free accessible pin toggle. */
|
|
59
59
|
declare function KeepPinButton<TMeta = Record<string, unknown>>({ item, children, pinLabel, unpinLabel, onToggleError, disabled, ...props }: KeepPinButtonProps<TMeta>): react.JSX.Element;
|
|
60
60
|
|
|
61
|
+
/** Offers to restore the most recently archived item. */
|
|
62
|
+
declare function KeepArchiveUndo<TMeta = Record<string, unknown>>(): react.JSX.Element | null;
|
|
63
|
+
|
|
61
64
|
type KeepBackupProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
62
65
|
filename?: string;
|
|
63
66
|
markdownFilename?: string;
|
|
@@ -754,6 +757,8 @@ type KeepCollectionProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<
|
|
|
754
757
|
toolbarVariant?: KeepCollectionToolbarVariant;
|
|
755
758
|
/** Groups host actions, query controls, and filters into labelled regions. */
|
|
756
759
|
toolbarLayout?: KeepCollectionToolbarLayout;
|
|
760
|
+
/** Makes the filter controls collapsible while keeping their active values. */
|
|
761
|
+
collapsibleFilters?: boolean;
|
|
757
762
|
slots?: KeepCollectionSlots<TMeta>;
|
|
758
763
|
urlSync?: boolean | KeepUrlSyncOptions;
|
|
759
764
|
urlAdapter?: KeepUrlAdapter;
|
|
@@ -1476,4 +1481,4 @@ type KeepKit<TMeta = Record<string, unknown>> = {
|
|
|
1476
1481
|
/** Create one typed application API for the core and standard UI layer. */
|
|
1477
1482
|
declare function createKeepKit<TMeta = Record<string, unknown>>(options?: CreateKeepKitOptions<TMeta>): KeepKit<TMeta>;
|
|
1478
1483
|
|
|
1479
|
-
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, KeepFallbackRecovery, type KeepFallbackRecoveryProps, KeepFloatingTour, type KeepFloatingTourProps, KeepHighlight, type KeepHighlightProps, type KeepImageProps, KeepInbox, type KeepInboxProps, KeepItemCard, type KeepItemCardActionSlotProps, type KeepItemCardActionsProps, type KeepItemCardBadgeProps, type KeepItemCardContentProps, type KeepItemCardLinkProps, type KeepItemCardLinkRegionProps, type KeepItemCardMediaProps, type KeepItemCardPresentation, type KeepItemCardProps, type KeepItemCardRemoveProps, type KeepItemCardSaveProps, KeepItemCardSkeleton, type KeepItemCardSkeletonProps, type KeepItemCardState, type KeepItemCardTagsProps, type KeepItemCardTitleProps, type KeepItemCardVariant, KeepItemCheckbox, type KeepItemCheckboxProps, type KeepItemSelection, KeepItemStatusBadge, type KeepItemStatusBadgeProps, type KeepKit, KeepKitProvider, type KeepKitProviderProps, KeepLastActivity, type KeepLastActivityProps, KeepLayout, type KeepLayoutPreset, type KeepLayoutProps, KeepList, type KeepListProps, type KeepListSelection, 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 };
|
|
1484
|
+
export { type CreateKeepKitOptions, KeepActiveFiltersSummary, type KeepActiveFiltersSummaryProps, type KeepActiveFiltersSummaryState, type KeepActivityKind, KeepAnnouncements, type KeepAnnouncementsProps, KeepAnnouncer, KeepArchiveButton, type KeepArchiveButtonProps, type KeepArchiveButtonState, type KeepArchiveScope, KeepArchiveScopeSelect, type KeepArchiveScopeSelectProps, KeepArchiveUndo, 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, KeepFallbackRecovery, type KeepFallbackRecoveryProps, KeepFloatingTour, type KeepFloatingTourProps, KeepHighlight, type KeepHighlightProps, type KeepImageProps, KeepInbox, type KeepInboxProps, KeepItemCard, type KeepItemCardActionSlotProps, type KeepItemCardActionsProps, type KeepItemCardBadgeProps, type KeepItemCardContentProps, type KeepItemCardLinkProps, type KeepItemCardLinkRegionProps, type KeepItemCardMediaProps, type KeepItemCardPresentation, type KeepItemCardProps, type KeepItemCardRemoveProps, type KeepItemCardSaveProps, KeepItemCardSkeleton, type KeepItemCardSkeletonProps, type KeepItemCardState, type KeepItemCardTagsProps, type KeepItemCardTitleProps, type KeepItemCardVariant, KeepItemCheckbox, type KeepItemCheckboxProps, type KeepItemSelection, KeepItemStatusBadge, type KeepItemStatusBadgeProps, type KeepKit, KeepKitProvider, type KeepKitProviderProps, KeepLastActivity, type KeepLastActivityProps, KeepLayout, type KeepLayoutPreset, type KeepLayoutProps, KeepList, type KeepListProps, type KeepListSelection, 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 };
|