@keepkit/ui 0.23.2 → 0.24.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 CHANGED
@@ -57,6 +57,15 @@ 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
+ `KeepWorkspace`はこれらのプリミティブを一つにまとめ、`basic`、`standard`、`management`、`sync`のプリセットを提供します。`createKeepKit()`を利用する場合は同じ実装を`keep.Workspace`から型付きで利用できます。`modules`、`slots`、子コンポーネントごとのpropsで部分的に差し替えられます。
61
+
62
+ ```tsx
63
+ const keep = createKeepKit<ArticleMeta>({ storage, locale: "ja" });
64
+
65
+ <keep.Provider>
66
+ <keep.Workspace preset="sync" collectionProps={{ layout: "auto" }} />
67
+ </keep.Provider>;
68
+ ```
60
69
  一覧の標準カードで必要な機能だけを有効化する場合は、`features={{ pin: true, archive: true, tags: false }}`を指定できます。`pin` / `archive` はカード操作ボタン、`tags` はカード内のタグ表示を切り替えます。タグフィルターは`tagFilter`、タグ編集は`KeepTagEditor`で個別に制御でき、`itemCardProps`の明示指定が`features`より優先されます。
61
70
  `KeepCollection`は検索語と選択タグを`KeepActiveFiltersSummary`のチップとして表示し、個別解除と「すべての条件をクリア」を提供します。`activeFilters`でこの領域を差し替えられます。標準の`KeepList` / `KeepCollection`は、全件0件の`empty-storage`と絞り込み結果0件の`empty-filtered`を区別し、後者では`onClearFilters`付きの解除ボタンを表示します。
62
71
  `KeepItemCard`は`href`、`onOpen`、`linkTarget`、`linkComponent`に対応し、保存アイテムから詳細ページへ遷移できます。非公開・期限切れ等の`status`を持つアイテムは自動的にリンクを無効化します。`KeepBackup`はJSONのエクスポート、merge / replaceインポート、結果件数、容量エラー表示を提供します。
@@ -94,7 +103,7 @@ const onFeedback = useKeepToastFeedback(toast);
94
103
  <KeepKitProvider storage={storage} onFeedback={onFeedback}>{children}</KeepKitProvider>;
95
104
  ```
96
105
 
97
- v0.23.2では一覧の標準カードでピン留め・アーカイブ・タグ表示を個別に切り替えられるようにしました。Tailwind CSS v4との統合、ホストテーマ変数との衝突回避、CSS cascade layer対応も引き続き利用できます。保存直後の`KeepSavePopover`自動編集、`KeepQuickEditorState.saveStatus`、`KeepItemCard.Save` / `KeepItemCard.Remove`、管理モード向け`KeepBulkActions`、通知からのコレクション再訪導線も引き続き利用できます。
106
+ v0.24.0では`KeepWorkspace`と型付きの`keep.Workspace`を追加しました。Tailwind CSS v4との統合、ホストテーマ変数との衝突回避、CSS cascade layer対応も引き続き利用できます。保存直後の`KeepSavePopover`自動編集、`KeepQuickEditorState.saveStatus`、`KeepItemCard.Save` / `KeepItemCard.Remove`、管理モード向け`KeepBulkActions`、通知からのコレクション再訪導線も引き続き利用できます。
98
107
  Phase 4の状態UIとして`KeepItemStatusBadge`、`KeepStaleNotice`、`KeepPruneStaleButton`、`KeepSyncStatusBanner`、`KeepSyncRecoveryDialog`を利用できます。`import "@keepkit/ui/theme.css"`でテーマCSSを有効にできます。
99
108
 
100
109
  ### Tailwind/shadcnテーマ
@@ -185,6 +194,15 @@ function SavedArticles() {
185
194
  ```
186
195
 
187
196
  `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.
197
+ `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.
198
+
199
+ ```tsx
200
+ const keep = createKeepKit<ArticleMeta>({ storage, locale: "en" });
201
+
202
+ <keep.Provider>
203
+ <keep.Workspace preset="sync" collectionProps={{ layout: "auto" }} />
204
+ </keep.Provider>;
205
+ ```
188
206
  Enable only the standard card features you need with `features={{ pin: true, archive: true, tags: false }}`. `pin` and `archive` toggle card action buttons, while `tags` controls tag display inside cards. Tag filtering remains independently controlled by `tagFilter`, tag editing by `KeepTagEditor`, and explicit `itemCardProps` values take precedence over `features`.
189
207
  `KeepCollection` renders the current search and tag filters as `KeepActiveFiltersSummary` chips with individual removal and a “Clear all filters” action. Replace that area with the `activeFilters` slot. Default `KeepList` / `KeepCollection` output distinguishes `empty-storage` from `empty-filtered`; the filtered state includes a reset button when `onClearFilters` is provided.
190
208
 
@@ -219,7 +237,7 @@ const onFeedback = useKeepToastFeedback(toast);
219
237
  <KeepKitProvider storage={storage} onFeedback={onFeedback}>{children}</KeepKitProvider>;
220
238
  ```
221
239
 
222
- In v0.23.2, standard card pinning, archiving, and tag display can be enabled independently. Tailwind CSS v4 integration, host-theme isolation, and cascade-layer support remain available. `KeepSavePopover` post-save editing, `KeepQuickEditorState.saveStatus`, `KeepItemCard.Save` / `KeepItemCard.Remove`, management-mode `KeepBulkActions`, and notification-driven return to the collection remain available.
240
+ v0.24.0 adds `KeepWorkspace` and the typed `keep.Workspace`. Tailwind CSS v4 integration, host-theme isolation, and cascade-layer support remain available. `KeepSavePopover` post-save editing, `KeepQuickEditorState.saveStatus`, `KeepItemCard.Save` / `KeepItemCard.Remove`, management-mode `KeepBulkActions`, and notification-driven return to the collection remain available.
223
241
  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.
224
242
 
225
243
  ### Tailwind and shadcn theme
package/dist/index.d.ts CHANGED
@@ -1041,6 +1041,39 @@ type KeepSyncStatusBannerProps = Omit<HTMLAttributes<HTMLElement>, "children"> &
1041
1041
  /** Announces synchronization failures and exposes retry or conflict-recovery entry points. */
1042
1042
  declare function KeepSyncStatusBanner({ onRetry, onResolveConflicts, children, className, ...props }: KeepSyncStatusBannerProps): react.JSX.Element | null;
1043
1043
 
1044
+ type KeepWorkspacePreset = "basic" | "standard" | "management" | "sync";
1045
+ type KeepWorkspaceModule = "syncStatus" | "undo" | "recovery" | "backup" | "stalePrune";
1046
+ type KeepWorkspaceState = {
1047
+ preset: KeepWorkspacePreset;
1048
+ modules: Readonly<Record<KeepWorkspaceModule, boolean>>;
1049
+ recoveryOpen: boolean;
1050
+ setRecoveryOpen: (open: boolean) => void;
1051
+ };
1052
+ type KeepWorkspaceContent = ReactNode | RenderProp<KeepWorkspaceState>;
1053
+ type KeepWorkspaceSlots = {
1054
+ before?: KeepWorkspaceContent;
1055
+ syncStatus?: KeepWorkspaceContent;
1056
+ collection?: KeepWorkspaceContent;
1057
+ actions?: KeepWorkspaceContent;
1058
+ undo?: KeepWorkspaceContent;
1059
+ recovery?: KeepWorkspaceContent;
1060
+ after?: KeepWorkspaceContent;
1061
+ };
1062
+ type KeepWorkspaceProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children"> & {
1063
+ preset?: KeepWorkspacePreset;
1064
+ modules?: Partial<Record<KeepWorkspaceModule, boolean>>;
1065
+ collectionProps?: KeepCollectionProps<TMeta>;
1066
+ syncStatusProps?: KeepSyncStatusBannerProps;
1067
+ recoveryProps?: KeepSyncRecoveryDialogProps<TMeta>;
1068
+ backupProps?: KeepBackupProps<TMeta>;
1069
+ undoProps?: KeepUndoProps;
1070
+ stalePruneProps?: KeepPruneStaleButtonProps;
1071
+ slots?: KeepWorkspaceSlots;
1072
+ children?: KeepWorkspaceContent;
1073
+ };
1074
+ /** Composes the standard collection, management, and sync primitives into one customizable workspace. */
1075
+ declare function KeepWorkspace<TMeta = Record<string, unknown>>({ preset, modules, collectionProps, syncStatusProps, recoveryProps, backupProps, undoProps, stalePruneProps, slots, children, className, ...props }: KeepWorkspaceProps<TMeta>): react.JSX.Element;
1076
+
1044
1077
  declare const keepThemeNames: readonly ["default", "ocean", "forest", "sunset", "lavender", "compact", "minimal", "rounded", "high-contrast", "dark"];
1045
1078
  type KeepThemeName = (typeof keepThemeNames)[number];
1046
1079
  type KeepThemeMode = "light" | "dark" | "system";
@@ -1098,6 +1131,7 @@ type KeepKit<TMeta = Record<string, unknown>> = {
1098
1131
  Button: ComponentType<KeepButtonProps<TMeta>>;
1099
1132
  Backup: ComponentType<KeepBackupProps<TMeta>>;
1100
1133
  Collection: ComponentType<KeepCollectionProps<TMeta>>;
1134
+ Workspace: ComponentType<KeepWorkspaceProps<TMeta>>;
1101
1135
  useContext: () => ReturnType<typeof useKeepContext<TMeta>>;
1102
1136
  useItem: (item?: KeepItemInput<TMeta>) => ReturnType<typeof useKeepItem<TMeta>>;
1103
1137
  useList: (query?: KeepListQuery<TMeta>) => ReturnType<typeof useKeepList<TMeta>>;
@@ -1107,4 +1141,4 @@ type KeepKit<TMeta = Record<string, unknown>> = {
1107
1141
  /** Create one typed application API for the core and standard UI layer. */
1108
1142
  declare function createKeepKit<TMeta = Record<string, unknown>>(options?: CreateKeepKitOptions<TMeta>): KeepKit<TMeta>;
1109
1143
 
1110
- 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 };
1144
+ 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, KeepWorkspace, type KeepWorkspaceModule, type KeepWorkspacePreset, type KeepWorkspaceProps, type KeepWorkspaceSlots, type KeepWorkspaceState, type RenderProp, chainedFunction, composeRefs, createKeepKit, createNextPagesRouterAdapter, createSlot, getKeepLocaleLabels, highlightText, isAllSelected, keepThemeNames, mergeProps, toggleSelectAll, useKeepQuickEditor, useKeepToastFeedback, useKeepTourShortcuts, useKeepUiLabels, useKeepUrlSync };
package/dist/index.js CHANGED
@@ -5545,9 +5545,128 @@ function KeepSyncStatusBanner({
5545
5545
  );
5546
5546
  }
5547
5547
 
5548
+ // src/features/workspace/hooks/useKeepWorkspace.ts
5549
+ import { useCallback as useCallback9, useState as useState17 } from "react";
5550
+ var PRESET_MODULES = {
5551
+ basic: { syncStatus: false, undo: false, recovery: false, backup: false, stalePrune: false },
5552
+ standard: { syncStatus: false, undo: true, recovery: false, backup: false, stalePrune: false },
5553
+ management: { syncStatus: false, undo: true, recovery: false, backup: true, stalePrune: true },
5554
+ sync: { syncStatus: true, undo: true, recovery: true, backup: false, stalePrune: false }
5555
+ };
5556
+ var PRESET_COLLECTION_FEATURES = {
5557
+ basic: { search: false, sort: false, pagination: false },
5558
+ standard: {},
5559
+ management: { tagFilter: true, collectionFilter: true, bulkActions: true, pin: true, archive: true },
5560
+ sync: {}
5561
+ };
5562
+ function useKeepWorkspace({
5563
+ preset,
5564
+ modules,
5565
+ recoveryOpen,
5566
+ onRecoveryOpenChange,
5567
+ onResolveConflicts
5568
+ }) {
5569
+ const [internalRecoveryOpen, setInternalRecoveryOpen] = useState17(false);
5570
+ const resolvedModules = { ...PRESET_MODULES[preset], ...modules };
5571
+ const setRecoveryOpen = useCallback9(
5572
+ (open) => {
5573
+ if (recoveryOpen === void 0) setInternalRecoveryOpen(open);
5574
+ onRecoveryOpenChange?.(open);
5575
+ },
5576
+ [onRecoveryOpenChange, recoveryOpen]
5577
+ );
5578
+ const openRecovery = useCallback9(() => {
5579
+ onResolveConflicts?.();
5580
+ setRecoveryOpen(true);
5581
+ }, [onResolveConflicts, setRecoveryOpen]);
5582
+ return {
5583
+ preset,
5584
+ modules: resolvedModules,
5585
+ collectionFeatures: PRESET_COLLECTION_FEATURES[preset],
5586
+ recoveryOpen: recoveryOpen ?? internalRecoveryOpen,
5587
+ setRecoveryOpen,
5588
+ openRecovery
5589
+ };
5590
+ }
5591
+
5592
+ // src/features/workspace/KeepWorkspace.tsx
5593
+ import { jsx as jsx29, jsxs as jsxs24 } from "react/jsx-runtime";
5594
+ function KeepWorkspace({
5595
+ preset = "standard",
5596
+ modules,
5597
+ collectionProps,
5598
+ syncStatusProps,
5599
+ recoveryProps,
5600
+ backupProps,
5601
+ undoProps,
5602
+ stalePruneProps,
5603
+ slots,
5604
+ children,
5605
+ className,
5606
+ ...props
5607
+ }) {
5608
+ const view = useKeepWorkspace({
5609
+ preset,
5610
+ modules,
5611
+ recoveryOpen: recoveryProps?.open,
5612
+ onRecoveryOpenChange: recoveryProps?.onOpenChange,
5613
+ onResolveConflicts: syncStatusProps?.onResolveConflicts
5614
+ });
5615
+ const state = {
5616
+ preset: view.preset,
5617
+ modules: view.modules,
5618
+ recoveryOpen: view.recoveryOpen,
5619
+ setRecoveryOpen: view.setRecoveryOpen
5620
+ };
5621
+ const resolvedCollectionProps = {
5622
+ ...collectionProps,
5623
+ features: { ...view.collectionFeatures, ...collectionProps?.features }
5624
+ };
5625
+ return /* @__PURE__ */ jsxs24("section", { ...props, className, "data-keepkit": "workspace", "data-preset": preset, children: [
5626
+ resolveOptionalSlot(slots?.before, state),
5627
+ view.modules.syncStatus ? resolveSlot(
5628
+ slots?.syncStatus,
5629
+ /* @__PURE__ */ jsx29(KeepSyncStatusBanner, { ...syncStatusProps, onResolveConflicts: view.openRecovery }),
5630
+ state
5631
+ ) : null,
5632
+ resolveSlot(slots?.collection, /* @__PURE__ */ jsx29(KeepCollection, { ...resolvedCollectionProps }), state),
5633
+ view.modules.backup || view.modules.stalePrune ? resolveSlot(
5634
+ slots?.actions,
5635
+ /* @__PURE__ */ jsxs24("div", { "data-keepkit": "workspace-actions", children: [
5636
+ view.modules.stalePrune ? /* @__PURE__ */ jsx29(KeepPruneStaleButton, { ...stalePruneProps }) : null,
5637
+ view.modules.backup ? /* @__PURE__ */ jsx29(KeepBackup, { ...backupProps }) : null
5638
+ ] }),
5639
+ state
5640
+ ) : null,
5641
+ view.modules.undo ? resolveSlot(slots?.undo, /* @__PURE__ */ jsx29(KeepUndo, { ...undoProps }), state) : null,
5642
+ view.modules.recovery ? resolveSlot(
5643
+ slots?.recovery,
5644
+ /* @__PURE__ */ jsx29(
5645
+ KeepSyncRecoveryDialog,
5646
+ {
5647
+ ...recoveryProps,
5648
+ open: view.recoveryOpen,
5649
+ onOpenChange: view.setRecoveryOpen
5650
+ }
5651
+ ),
5652
+ state
5653
+ ) : null,
5654
+ resolveOptionalSlot(children, state),
5655
+ resolveOptionalSlot(slots?.after, state)
5656
+ ] });
5657
+ }
5658
+ function resolveSlot(slot, fallback, state) {
5659
+ if (slot === void 0) return fallback;
5660
+ return resolveContent(slot, state);
5661
+ }
5662
+ function resolveOptionalSlot(slot, state) {
5663
+ if (slot === void 0) return null;
5664
+ return resolveContent(slot, state);
5665
+ }
5666
+
5548
5667
  // src/foundation/theme.tsx
5549
5668
  import { isValidElement as isValidElement9 } from "react";
5550
- import { jsx as jsx29 } from "react/jsx-runtime";
5669
+ import { jsx as jsx30 } from "react/jsx-runtime";
5551
5670
  var keepThemeNames = [
5552
5671
  "default",
5553
5672
  "ocean",
@@ -5606,7 +5725,7 @@ function KeepThemeProvider({
5606
5725
  throw new Error("KeepThemeProvider with asChild requires a single React element child.");
5607
5726
  return createSlot(children, rootProps);
5608
5727
  }
5609
- return /* @__PURE__ */ jsx29("div", { ...rootProps, children });
5728
+ return /* @__PURE__ */ jsx30("div", { ...rootProps, children });
5610
5729
  }
5611
5730
 
5612
5731
  // src/index.tsx
@@ -5630,7 +5749,7 @@ import {
5630
5749
  LocalStorageSyncQueueAdapter,
5631
5750
  SyncStorageAdapter
5632
5751
  } from "@keepkit/core/storage";
5633
- import { jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
5752
+ import { jsx as jsx31, jsxs as jsxs25 } from "react/jsx-runtime";
5634
5753
  function KeepKitProvider({
5635
5754
  labels,
5636
5755
  locale,
@@ -5650,7 +5769,7 @@ function KeepKitProvider({
5650
5769
  children,
5651
5770
  ...providerProps
5652
5771
  }) {
5653
- return /* @__PURE__ */ jsx30(KeepUiProvider, { labels, locale, labelResolver, onFeedback, children: /* @__PURE__ */ jsx30(
5772
+ return /* @__PURE__ */ jsx31(KeepUiProvider, { labels, locale, labelResolver, onFeedback, children: /* @__PURE__ */ jsx31(
5654
5773
  KeepThemeProvider,
5655
5774
  {
5656
5775
  theme,
@@ -5664,10 +5783,10 @@ function KeepKitProvider({
5664
5783
  className: themeClassName,
5665
5784
  style: themeStyle,
5666
5785
  asChild: themeAsChild,
5667
- children: /* @__PURE__ */ jsxs24(CoreKeepProvider, { ...providerProps, children: [
5668
- /* @__PURE__ */ jsx30(KeepSyncFeedbackObserver, {}),
5786
+ children: /* @__PURE__ */ jsxs25(CoreKeepProvider, { ...providerProps, children: [
5787
+ /* @__PURE__ */ jsx31(KeepSyncFeedbackObserver, {}),
5669
5788
  children,
5670
- /* @__PURE__ */ jsx30(KeepAnnouncements, {})
5789
+ /* @__PURE__ */ jsx31(KeepAnnouncements, {})
5671
5790
  ] })
5672
5791
  }
5673
5792
  ) });
@@ -5694,7 +5813,7 @@ function createKeepKit(options = {}) {
5694
5813
  } = options;
5695
5814
  const coreKit = createCoreKeepKit(coreOptions);
5696
5815
  return {
5697
- Provider: (props) => /* @__PURE__ */ jsx30(
5816
+ Provider: (props) => /* @__PURE__ */ jsx31(
5698
5817
  KeepKitProvider,
5699
5818
  {
5700
5819
  ...coreOptions,
@@ -5715,9 +5834,9 @@ function createKeepKit(options = {}) {
5715
5834
  ...props
5716
5835
  }
5717
5836
  ),
5718
- Button: (props) => /* @__PURE__ */ jsx30(KeepButton, { ...props }),
5719
- Backup: (props) => /* @__PURE__ */ jsx30(KeepBackup, { ...props }),
5720
- Collection: (props) => /* @__PURE__ */ jsx30(
5837
+ Button: (props) => /* @__PURE__ */ jsx31(KeepButton, { ...props }),
5838
+ Backup: (props) => /* @__PURE__ */ jsx31(KeepBackup, { ...props }),
5839
+ Collection: (props) => /* @__PURE__ */ jsx31(
5721
5840
  KeepCollection,
5722
5841
  {
5723
5842
  ...props,
@@ -5728,6 +5847,20 @@ function createKeepKit(options = {}) {
5728
5847
  }
5729
5848
  }
5730
5849
  ),
5850
+ Workspace: (props) => /* @__PURE__ */ jsx31(
5851
+ KeepWorkspace,
5852
+ {
5853
+ ...props,
5854
+ collectionProps: {
5855
+ ...props.collectionProps,
5856
+ itemCardProps: {
5857
+ ...getTitle ? { getTitle } : {},
5858
+ ...getImageProps ? { getImageProps } : {},
5859
+ ...props.collectionProps?.itemCardProps
5860
+ }
5861
+ }
5862
+ }
5863
+ ),
5731
5864
  useContext: () => coreKit.useContext(),
5732
5865
  useItem: (item) => coreKit.useItem(item),
5733
5866
  useList: (query) => coreKit.useList(query),
@@ -5781,6 +5914,7 @@ export {
5781
5914
  KeepTourBar,
5782
5915
  KeepUiProvider,
5783
5916
  KeepUndo,
5917
+ KeepWorkspace,
5784
5918
  LocalStorageAdapter,
5785
5919
  LocalStorageSyncQueueAdapter,
5786
5920
  SyncStorageAdapter,