@keepkit/ui 0.28.1 → 0.28.2
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 +2 -2
- package/dist/index.d.ts +20 -3
- package/dist/index.js +236 -8
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -109,7 +109,7 @@ const onFeedback = useKeepToastFeedback(toast);
|
|
|
109
109
|
<KeepKitProvider storage={storage} onFeedback={onFeedback}>{children}</KeepKitProvider>;
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
-
v0.28.
|
|
112
|
+
v0.28.2では、利用履歴とRediscovery query、カード開封追跡に加えて、検索・タグ・コレクション・Activity・アーカイブ条件を表示して個別解除できるフィルターサマリーを追加しました。レイアウト領域を消費しないPortalベースのフローティング巡回UI、Tailwind CSS v4との統合、ホストテーマ変数との衝突回避も引き続き利用できます。
|
|
113
113
|
Phase 4の状態UIとして`KeepItemStatusBadge`、`KeepStaleNotice`、`KeepPruneStaleButton`、`KeepSyncStatusBanner`、`KeepSyncRecoveryDialog`を利用できます。`import "@keepkit/ui/theme.css"`でテーマCSSを有効にできます。
|
|
114
114
|
|
|
115
115
|
### Tailwind/shadcnテーマ
|
|
@@ -250,7 +250,7 @@ const onFeedback = useKeepToastFeedback(toast);
|
|
|
250
250
|
<KeepKitProvider storage={storage} onFeedback={onFeedback}>{children}</KeepKitProvider>;
|
|
251
251
|
```
|
|
252
252
|
|
|
253
|
-
v0.28.
|
|
253
|
+
v0.28.2 adds activity tracking, Rediscovery queries, opt-in card open tracking, and a complete active-filter summary with removal and result-count feedback. The portal-rendered floating tour UI, Tailwind CSS v4 integration, host-theme isolation, and cascade-layer support remain available.
|
|
254
254
|
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
255
|
|
|
256
256
|
### Tailwind and shadcn theme
|
package/dist/index.d.ts
CHANGED
|
@@ -846,7 +846,7 @@ type KeepTagEditorProps<TMeta = Record<string, unknown>> = Omit<FormHTMLAttribut
|
|
|
846
846
|
/** Edits one item's normalized tag set; Enter adds and Backspace removes the last tag. */
|
|
847
847
|
declare function KeepTagEditor<TMeta = Record<string, unknown>>({ item, availableTags, onSaved, onSaveError, render, ...props }: KeepTagEditorProps<TMeta>): react.JSX.Element;
|
|
848
848
|
|
|
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" | "undoReorder" | "toolbarStart" | "toolbarQuery" | "toolbarFilters" | "toolbarEnd" | "createCollection" | "createCollectionSubmit" | "collectionName" | "manageCollections" | "renameCollection" | "renameCollectionSubmit" | "deleteCollection" | "deleteCollectionConfirm" | "deleteCollectionSubmit" | "cancel" | "collectionItem" | "collectionItems";
|
|
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";
|
|
850
850
|
type KeepUiLabelOptions = {
|
|
851
851
|
/** Replaces the localized label text. Omit to keep the locale default. */
|
|
852
852
|
text?: string;
|
|
@@ -1037,8 +1037,18 @@ type KeepActiveFiltersSummaryProps<TMeta = Record<string, unknown>> = Omit<HTMLA
|
|
|
1037
1037
|
query?: KeepListQuery<TMeta>;
|
|
1038
1038
|
search?: string;
|
|
1039
1039
|
tags?: readonly string[];
|
|
1040
|
+
collection?: string;
|
|
1041
|
+
collectionLabel?: string;
|
|
1042
|
+
activity?: KeepListQuery<TMeta>["activity"];
|
|
1043
|
+
activityLabel?: string;
|
|
1044
|
+
archiveScope?: KeepListQuery<TMeta>["archiveScope"];
|
|
1045
|
+
archiveScopeLabel?: string;
|
|
1046
|
+
totalCount?: number;
|
|
1040
1047
|
onSearchChange?: (value: string) => void;
|
|
1041
1048
|
onTagChange?: (tag: string) => void;
|
|
1049
|
+
onCollectionChange?: (collectionId?: string) => void;
|
|
1050
|
+
onActivityChange?: (activity?: KeepListQuery<TMeta>["activity"]) => void;
|
|
1051
|
+
onArchiveScopeChange?: (scope: NonNullable<KeepListQuery<TMeta>["archiveScope"]>) => void;
|
|
1042
1052
|
onClear?: () => void;
|
|
1043
1053
|
children?: ReactNode | RenderProp<KeepActiveFiltersSummaryState>;
|
|
1044
1054
|
asChild?: boolean;
|
|
@@ -1046,13 +1056,20 @@ type KeepActiveFiltersSummaryProps<TMeta = Record<string, unknown>> = Omit<HTMLA
|
|
|
1046
1056
|
type KeepActiveFiltersSummaryState = {
|
|
1047
1057
|
search: string;
|
|
1048
1058
|
tags: string[];
|
|
1059
|
+
collection?: string;
|
|
1060
|
+
activity?: KeepListQuery["activity"];
|
|
1061
|
+
archiveScope?: KeepListQuery["archiveScope"];
|
|
1062
|
+
totalCount?: number;
|
|
1049
1063
|
hasFilters: boolean;
|
|
1050
1064
|
clear: () => void;
|
|
1051
1065
|
removeSearch: () => void;
|
|
1052
1066
|
removeTag: (tag: string) => void;
|
|
1067
|
+
removeCollection: () => void;
|
|
1068
|
+
removeActivity: () => void;
|
|
1069
|
+
removeArchiveScope: () => void;
|
|
1053
1070
|
};
|
|
1054
|
-
/** Lists active
|
|
1055
|
-
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;
|
|
1071
|
+
/** 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;
|
|
1056
1073
|
|
|
1057
1074
|
type KeepCollectionOption = {
|
|
1058
1075
|
id?: string;
|
package/dist/index.js
CHANGED
|
@@ -197,6 +197,11 @@ var DE_LABELS = {
|
|
|
197
197
|
archiveScopeActive: "Aktiv",
|
|
198
198
|
archiveScopeArchived: "Archiviert",
|
|
199
199
|
archiveScopeAll: "Alle Elemente",
|
|
200
|
+
activityNeverOpened: "Noch nie ge\xF6ffnet",
|
|
201
|
+
activityOpened: "Ge\xF6ffnet",
|
|
202
|
+
activityInactiveFor: "Tage inaktiv",
|
|
203
|
+
activityBefore: "Ge\xF6ffnet vor",
|
|
204
|
+
activityAfter: "Ge\xF6ffnet nach",
|
|
200
205
|
undoReorder: "Sortierung r\xFCckg\xE4ngig machen",
|
|
201
206
|
toolbarStart: "Sammlungsaktionen",
|
|
202
207
|
toolbarQuery: "Suchen und sortieren",
|
|
@@ -317,6 +322,11 @@ var EN_LABELS = {
|
|
|
317
322
|
archiveScopeActive: "Active",
|
|
318
323
|
archiveScopeArchived: "Archived",
|
|
319
324
|
archiveScopeAll: "All items",
|
|
325
|
+
activityNeverOpened: "Never opened",
|
|
326
|
+
activityOpened: "Opened",
|
|
327
|
+
activityInactiveFor: "days inactive",
|
|
328
|
+
activityBefore: "Opened before",
|
|
329
|
+
activityAfter: "Opened after",
|
|
320
330
|
undoReorder: "Undo reorder",
|
|
321
331
|
toolbarStart: "Collection actions",
|
|
322
332
|
toolbarQuery: "Search and sort",
|
|
@@ -437,6 +447,11 @@ var ES_LABELS = {
|
|
|
437
447
|
archiveScopeActive: "Activos",
|
|
438
448
|
archiveScopeArchived: "Archivados",
|
|
439
449
|
archiveScopeAll: "Todos los elementos",
|
|
450
|
+
activityNeverOpened: "Nunca abierto",
|
|
451
|
+
activityOpened: "Abierto",
|
|
452
|
+
activityInactiveFor: "d\xEDas inactivo",
|
|
453
|
+
activityBefore: "Abierto antes de",
|
|
454
|
+
activityAfter: "Abierto despu\xE9s de",
|
|
440
455
|
undoReorder: "Deshacer ordenaci\xF3n",
|
|
441
456
|
toolbarStart: "Acciones de la colecci\xF3n",
|
|
442
457
|
toolbarQuery: "Buscar y ordenar",
|
|
@@ -557,6 +572,11 @@ var FIL_LABELS = {
|
|
|
557
572
|
archiveScopeActive: "Aktibo",
|
|
558
573
|
archiveScopeArchived: "Naka-archive",
|
|
559
574
|
archiveScopeAll: "Lahat ng item",
|
|
575
|
+
activityNeverOpened: "Hindi pa nabubuksan",
|
|
576
|
+
activityOpened: "Nabuksan",
|
|
577
|
+
activityInactiveFor: "araw na hindi aktibo",
|
|
578
|
+
activityBefore: "Nabuksan bago",
|
|
579
|
+
activityAfter: "Nabuksan pagkatapos",
|
|
560
580
|
undoReorder: "I-undo ang pag-aayos",
|
|
561
581
|
toolbarStart: "Mga aksyon ng koleksyon",
|
|
562
582
|
toolbarQuery: "Maghanap at mag-ayos",
|
|
@@ -677,6 +697,11 @@ var FR_LABELS = {
|
|
|
677
697
|
archiveScopeActive: "Actifs",
|
|
678
698
|
archiveScopeArchived: "Archiv\xE9s",
|
|
679
699
|
archiveScopeAll: "Tous les \xE9l\xE9ments",
|
|
700
|
+
activityNeverOpened: "Jamais ouvert",
|
|
701
|
+
activityOpened: "Ouvert",
|
|
702
|
+
activityInactiveFor: "jours inactif",
|
|
703
|
+
activityBefore: "Ouvert avant",
|
|
704
|
+
activityAfter: "Ouvert apr\xE8s",
|
|
680
705
|
undoReorder: "Annuler le r\xE9ordonnancement",
|
|
681
706
|
toolbarStart: "Actions de la collection",
|
|
682
707
|
toolbarQuery: "Recherche et tri",
|
|
@@ -797,6 +822,11 @@ var ID_LABELS = {
|
|
|
797
822
|
archiveScopeActive: "Aktif",
|
|
798
823
|
archiveScopeArchived: "Diarsipkan",
|
|
799
824
|
archiveScopeAll: "Semua item",
|
|
825
|
+
activityNeverOpened: "Belum pernah dibuka",
|
|
826
|
+
activityOpened: "Sudah dibuka",
|
|
827
|
+
activityInactiveFor: "hari tidak aktif",
|
|
828
|
+
activityBefore: "Dibuka sebelum",
|
|
829
|
+
activityAfter: "Dibuka setelah",
|
|
800
830
|
undoReorder: "Batalkan pengurutan",
|
|
801
831
|
toolbarStart: "Tindakan koleksi",
|
|
802
832
|
toolbarQuery: "Cari dan urutkan",
|
|
@@ -917,6 +947,11 @@ var IT_LABELS = {
|
|
|
917
947
|
archiveScopeActive: "Attivi",
|
|
918
948
|
archiveScopeArchived: "Archiviati",
|
|
919
949
|
archiveScopeAll: "Tutti gli elementi",
|
|
950
|
+
activityNeverOpened: "Mai aperto",
|
|
951
|
+
activityOpened: "Aperto",
|
|
952
|
+
activityInactiveFor: "giorni inattivo",
|
|
953
|
+
activityBefore: "Aperto prima di",
|
|
954
|
+
activityAfter: "Aperto dopo",
|
|
920
955
|
undoReorder: "Annulla riordinamento",
|
|
921
956
|
toolbarStart: "Azioni della raccolta",
|
|
922
957
|
toolbarQuery: "Cerca e ordina",
|
|
@@ -1037,6 +1072,11 @@ var JA_LABELS = {
|
|
|
1037
1072
|
archiveScopeActive: "\u4FDD\u5B58\u4E2D",
|
|
1038
1073
|
archiveScopeArchived: "\u30A2\u30FC\u30AB\u30A4\u30D6\u6E08\u307F",
|
|
1039
1074
|
archiveScopeAll: "\u3059\u3079\u3066",
|
|
1075
|
+
activityNeverOpened: "\u672A\u95B2\u89A7",
|
|
1076
|
+
activityOpened: "\u95B2\u89A7\u6E08\u307F",
|
|
1077
|
+
activityInactiveFor: "\u65E5\u9593\u672A\u95B2\u89A7",
|
|
1078
|
+
activityBefore: "\u95B2\u89A7\u65E5\u6642\u304C\u6B21\u3088\u308A\u524D",
|
|
1079
|
+
activityAfter: "\u95B2\u89A7\u65E5\u6642\u304C\u6B21\u3088\u308A\u5F8C",
|
|
1040
1080
|
undoReorder: "\u4E26\u3073\u66FF\u3048\u3092\u5143\u306B\u623B\u3059",
|
|
1041
1081
|
toolbarStart: "\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u306E\u64CD\u4F5C",
|
|
1042
1082
|
toolbarQuery: "\u691C\u7D22\u3068\u4E26\u3073\u66FF\u3048",
|
|
@@ -1157,6 +1197,11 @@ var KO_LABELS = {
|
|
|
1157
1197
|
archiveScopeActive: "\uD65C\uC131",
|
|
1158
1198
|
archiveScopeArchived: "\uBCF4\uAD00\uB428",
|
|
1159
1199
|
archiveScopeAll: "\uBAA8\uB4E0 \uD56D\uBAA9",
|
|
1200
|
+
activityNeverOpened: "\uC5F4\uC9C0 \uC54A\uC74C",
|
|
1201
|
+
activityOpened: "\uC5F4\uC5C8\uC74C",
|
|
1202
|
+
activityInactiveFor: "\uC77C \uB3D9\uC548 \uBE44\uD65C\uC131",
|
|
1203
|
+
activityBefore: "\uB2E4\uC74C \uC774\uC804\uC5D0 \uC5F4\uB9BC",
|
|
1204
|
+
activityAfter: "\uB2E4\uC74C \uC774\uD6C4\uC5D0 \uC5F4\uB9BC",
|
|
1160
1205
|
undoReorder: "\uC815\uB82C \uC2E4\uD589 \uCDE8\uC18C",
|
|
1161
1206
|
toolbarStart: "\uCEEC\uB809\uC158 \uC791\uC5C5",
|
|
1162
1207
|
toolbarQuery: "\uAC80\uC0C9 \uBC0F \uC815\uB82C",
|
|
@@ -1277,6 +1322,11 @@ var MS_LABELS = {
|
|
|
1277
1322
|
archiveScopeActive: "Aktif",
|
|
1278
1323
|
archiveScopeArchived: "Diarkibkan",
|
|
1279
1324
|
archiveScopeAll: "Semua item",
|
|
1325
|
+
activityNeverOpened: "Belum pernah dibuka",
|
|
1326
|
+
activityOpened: "Telah dibuka",
|
|
1327
|
+
activityInactiveFor: "hari tidak aktif",
|
|
1328
|
+
activityBefore: "Dibuka sebelum",
|
|
1329
|
+
activityAfter: "Dibuka selepas",
|
|
1280
1330
|
undoReorder: "Buat asal susunan",
|
|
1281
1331
|
toolbarStart: "Tindakan koleksi",
|
|
1282
1332
|
toolbarQuery: "Cari dan susun",
|
|
@@ -1397,6 +1447,11 @@ var PT_BR_LABELS = {
|
|
|
1397
1447
|
archiveScopeActive: "Ativos",
|
|
1398
1448
|
archiveScopeArchived: "Arquivados",
|
|
1399
1449
|
archiveScopeAll: "Todos os itens",
|
|
1450
|
+
activityNeverOpened: "Nunca aberto",
|
|
1451
|
+
activityOpened: "Aberto",
|
|
1452
|
+
activityInactiveFor: "dias inativo",
|
|
1453
|
+
activityBefore: "Aberto antes de",
|
|
1454
|
+
activityAfter: "Aberto depois de",
|
|
1400
1455
|
undoReorder: "Desfazer reordena\xE7\xE3o",
|
|
1401
1456
|
toolbarStart: "A\xE7\xF5es da cole\xE7\xE3o",
|
|
1402
1457
|
toolbarQuery: "Pesquisar e ordenar",
|
|
@@ -1517,6 +1572,11 @@ var RU_LABELS = {
|
|
|
1517
1572
|
archiveScopeActive: "\u0410\u043A\u0442\u0438\u0432\u043D\u044B\u0435",
|
|
1518
1573
|
archiveScopeArchived: "\u0412 \u0430\u0440\u0445\u0438\u0432\u0435",
|
|
1519
1574
|
archiveScopeAll: "\u0412\u0441\u0435 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",
|
|
1575
|
+
activityNeverOpened: "\u041D\u0435 \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u043B\u0441\u044F",
|
|
1576
|
+
activityOpened: "\u041E\u0442\u043A\u0440\u044B\u0432\u0430\u043B\u0441\u044F",
|
|
1577
|
+
activityInactiveFor: "\u0434\u043D. \u0431\u0435\u0437 \u0430\u043A\u0442\u0438\u0432\u043D\u043E\u0441\u0442\u0438",
|
|
1578
|
+
activityBefore: "\u041E\u0442\u043A\u0440\u044B\u0442 \u0434\u043E",
|
|
1579
|
+
activityAfter: "\u041E\u0442\u043A\u0440\u044B\u0442 \u043F\u043E\u0441\u043B\u0435",
|
|
1520
1580
|
undoReorder: "\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u0441\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0443",
|
|
1521
1581
|
toolbarStart: "\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u043A\u043E\u043B\u043B\u0435\u043A\u0446\u0438\u0438",
|
|
1522
1582
|
toolbarQuery: "\u041F\u043E\u0438\u0441\u043A \u0438 \u0441\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0430",
|
|
@@ -1637,6 +1697,11 @@ var TH_LABELS = {
|
|
|
1637
1697
|
archiveScopeActive: "\u0E43\u0E0A\u0E49\u0E07\u0E32\u0E19\u0E2D\u0E22\u0E39\u0E48",
|
|
1638
1698
|
archiveScopeArchived: "\u0E40\u0E01\u0E47\u0E1A\u0E16\u0E32\u0E27\u0E23\u0E41\u0E25\u0E49\u0E27",
|
|
1639
1699
|
archiveScopeAll: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",
|
|
1700
|
+
activityNeverOpened: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E40\u0E04\u0E22\u0E40\u0E1B\u0E34\u0E14",
|
|
1701
|
+
activityOpened: "\u0E40\u0E04\u0E22\u0E40\u0E1B\u0E34\u0E14\u0E41\u0E25\u0E49\u0E27",
|
|
1702
|
+
activityInactiveFor: "\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E21\u0E35\u0E01\u0E32\u0E23\u0E43\u0E0A\u0E49\u0E07\u0E32\u0E19",
|
|
1703
|
+
activityBefore: "\u0E40\u0E1B\u0E34\u0E14\u0E01\u0E48\u0E2D\u0E19",
|
|
1704
|
+
activityAfter: "\u0E40\u0E1B\u0E34\u0E14\u0E2B\u0E25\u0E31\u0E07",
|
|
1640
1705
|
undoReorder: "\u0E40\u0E25\u0E34\u0E01\u0E17\u0E33\u0E01\u0E32\u0E23\u0E08\u0E31\u0E14\u0E40\u0E23\u0E35\u0E22\u0E07",
|
|
1641
1706
|
toolbarStart: "\u0E01\u0E32\u0E23\u0E14\u0E33\u0E40\u0E19\u0E34\u0E19\u0E01\u0E32\u0E23\u0E02\u0E2D\u0E07\u0E04\u0E2D\u0E25\u0E40\u0E25\u0E01\u0E0A\u0E31\u0E19",
|
|
1642
1707
|
toolbarQuery: "\u0E04\u0E49\u0E19\u0E2B\u0E32\u0E41\u0E25\u0E30\u0E08\u0E31\u0E14\u0E40\u0E23\u0E35\u0E22\u0E07",
|
|
@@ -1757,6 +1822,11 @@ var VI_LABELS = {
|
|
|
1757
1822
|
archiveScopeActive: "\u0110ang ho\u1EA1t \u0111\u1ED9ng",
|
|
1758
1823
|
archiveScopeArchived: "\u0110\xE3 l\u01B0u tr\u1EEF",
|
|
1759
1824
|
archiveScopeAll: "T\u1EA5t c\u1EA3 m\u1EE5c",
|
|
1825
|
+
activityNeverOpened: "Ch\u01B0a t\u1EEBng m\u1EDF",
|
|
1826
|
+
activityOpened: "\u0110\xE3 m\u1EDF",
|
|
1827
|
+
activityInactiveFor: "ng\xE0y kh\xF4ng ho\u1EA1t \u0111\u1ED9ng",
|
|
1828
|
+
activityBefore: "\u0110\xE3 m\u1EDF tr\u01B0\u1EDBc",
|
|
1829
|
+
activityAfter: "\u0110\xE3 m\u1EDF sau",
|
|
1760
1830
|
undoReorder: "Ho\xE0n t\xE1c s\u1EAFp x\u1EBFp",
|
|
1761
1831
|
toolbarStart: "Thao t\xE1c b\u1ED9 s\u01B0u t\u1EADp",
|
|
1762
1832
|
toolbarQuery: "T\xECm ki\u1EBFm v\xE0 s\u1EAFp x\u1EBFp",
|
|
@@ -1877,6 +1947,11 @@ var ZH_HANS_LABELS = {
|
|
|
1877
1947
|
archiveScopeActive: "\u4FDD\u5B58\u4E2D",
|
|
1878
1948
|
archiveScopeArchived: "\u5DF2\u5F52\u6863",
|
|
1879
1949
|
archiveScopeAll: "\u5168\u90E8\u9879\u76EE",
|
|
1950
|
+
activityNeverOpened: "\u4ECE\u672A\u6253\u5F00",
|
|
1951
|
+
activityOpened: "\u5DF2\u6253\u5F00",
|
|
1952
|
+
activityInactiveFor: "\u5929\u672A\u6D3B\u52A8",
|
|
1953
|
+
activityBefore: "\u6253\u5F00\u65F6\u95F4\u65E9\u4E8E",
|
|
1954
|
+
activityAfter: "\u6253\u5F00\u65F6\u95F4\u665A\u4E8E",
|
|
1880
1955
|
undoReorder: "\u64A4\u9500\u6392\u5E8F",
|
|
1881
1956
|
toolbarStart: "\u96C6\u5408\u64CD\u4F5C",
|
|
1882
1957
|
toolbarQuery: "\u641C\u7D22\u548C\u6392\u5E8F",
|
|
@@ -1997,6 +2072,11 @@ var ZH_HANT_LABELS = {
|
|
|
1997
2072
|
archiveScopeActive: "\u4FDD\u5B58\u4E2D",
|
|
1998
2073
|
archiveScopeArchived: "\u5DF2\u5C01\u5B58",
|
|
1999
2074
|
archiveScopeAll: "\u6240\u6709\u9805\u76EE",
|
|
2075
|
+
activityNeverOpened: "\u5F9E\u672A\u958B\u555F",
|
|
2076
|
+
activityOpened: "\u5DF2\u958B\u555F",
|
|
2077
|
+
activityInactiveFor: "\u5929\u672A\u6D3B\u52D5",
|
|
2078
|
+
activityBefore: "\u958B\u555F\u6642\u9593\u65E9\u65BC",
|
|
2079
|
+
activityAfter: "\u958B\u555F\u6642\u9593\u665A\u65BC",
|
|
2000
2080
|
undoReorder: "\u5FA9\u539F\u6392\u5E8F",
|
|
2001
2081
|
toolbarStart: "\u96C6\u5408\u64CD\u4F5C",
|
|
2002
2082
|
toolbarQuery: "\u641C\u5C0B\u8207\u6392\u5E8F",
|
|
@@ -3450,8 +3530,18 @@ function KeepActiveFiltersSummary({
|
|
|
3450
3530
|
query,
|
|
3451
3531
|
search: providedSearch,
|
|
3452
3532
|
tags: providedTags,
|
|
3533
|
+
collection: providedCollection,
|
|
3534
|
+
collectionLabel: providedCollectionLabel,
|
|
3535
|
+
activity: providedActivity,
|
|
3536
|
+
activityLabel: providedActivityLabel,
|
|
3537
|
+
archiveScope: providedArchiveScope,
|
|
3538
|
+
archiveScopeLabel: providedArchiveScopeLabel,
|
|
3539
|
+
totalCount,
|
|
3453
3540
|
onSearchChange,
|
|
3454
3541
|
onTagChange,
|
|
3542
|
+
onCollectionChange,
|
|
3543
|
+
onActivityChange,
|
|
3544
|
+
onArchiveScopeChange,
|
|
3455
3545
|
onClear,
|
|
3456
3546
|
children,
|
|
3457
3547
|
asChild = false,
|
|
@@ -3460,14 +3550,41 @@ function KeepActiveFiltersSummary({
|
|
|
3460
3550
|
}) {
|
|
3461
3551
|
const search = (providedSearch ?? query?.search?.query ?? "").trim();
|
|
3462
3552
|
const tags = normalizeUiTags(providedTags ?? query?.tags ?? []);
|
|
3463
|
-
const
|
|
3553
|
+
const collection = providedCollection ?? query?.collectionId;
|
|
3554
|
+
const activity = providedActivity ?? query?.activity;
|
|
3555
|
+
const hasActivity = Boolean(activity && Object.keys(activity).length > 0);
|
|
3556
|
+
const archiveScope = providedArchiveScope ?? query?.archiveScope ?? (query?.archived === true ? "archived" : "active");
|
|
3557
|
+
const hasArchiveScope = archiveScope !== void 0 && archiveScope !== "active";
|
|
3558
|
+
const hasFilters = Boolean(search) || tags.length > 0 || Boolean(collection) || hasActivity || hasArchiveScope;
|
|
3464
3559
|
const activeFiltersLabel = useUiLabel("activeFilters");
|
|
3465
3560
|
const showActiveFiltersLabel = useUiLabelVisibility("activeFilters");
|
|
3466
3561
|
const clearAllLabel = useUiLabel("clearAllFilters");
|
|
3467
3562
|
const clearLabel = useUiLabel("clearFilters");
|
|
3468
3563
|
const removeLabel = useUiLabel("removeFilter");
|
|
3564
|
+
const uncategorizedLabel = useUiLabel("uncategorized");
|
|
3565
|
+
const collectionItemLabel = useUiLabel("collectionItem");
|
|
3566
|
+
const collectionItemsLabel = useUiLabel("collectionItems");
|
|
3567
|
+
const collectionLabel = providedCollectionLabel ?? (collection === "__uncategorized__" ? uncategorizedLabel : collection);
|
|
3568
|
+
const archiveLabels = {
|
|
3569
|
+
active: useUiLabel("archiveScopeActive"),
|
|
3570
|
+
archived: useUiLabel("archiveScopeArchived"),
|
|
3571
|
+
all: useUiLabel("archiveScopeAll")
|
|
3572
|
+
};
|
|
3573
|
+
const activityLabels = {
|
|
3574
|
+
neverOpened: useUiLabel("activityNeverOpened"),
|
|
3575
|
+
opened: useUiLabel("activityOpened"),
|
|
3576
|
+
inactiveFor: useUiLabel("activityInactiveFor"),
|
|
3577
|
+
before: useUiLabel("activityBefore"),
|
|
3578
|
+
after: useUiLabel("activityAfter")
|
|
3579
|
+
};
|
|
3580
|
+
const { locale } = useKeepUiLabels();
|
|
3581
|
+
const resolvedActivityLabel = providedActivityLabel ?? formatActivity(activity, activityLabels, locale);
|
|
3582
|
+
const resolvedArchiveScopeLabel = providedArchiveScopeLabel ?? (archiveScope === void 0 ? void 0 : archiveLabels[archiveScope]);
|
|
3469
3583
|
const chipRefs = useRef6([]);
|
|
3470
|
-
const
|
|
3584
|
+
const collectionIndex = Number(Boolean(search)) + tags.length;
|
|
3585
|
+
const activityIndex = collectionIndex + Number(Boolean(collection));
|
|
3586
|
+
const archiveScopeIndex = activityIndex + Number(hasActivity);
|
|
3587
|
+
const filterCount = archiveScopeIndex + Number(hasArchiveScope);
|
|
3471
3588
|
function focusChip(index) {
|
|
3472
3589
|
chipRefs.current[index]?.focus();
|
|
3473
3590
|
}
|
|
@@ -3498,13 +3615,32 @@ function KeepActiveFiltersSummary({
|
|
|
3498
3615
|
focusAfterRemoval(index, event.currentTarget);
|
|
3499
3616
|
onTagChange?.(tag);
|
|
3500
3617
|
}
|
|
3618
|
+
function removeCollection(event) {
|
|
3619
|
+
focusAfterRemoval(collectionIndex, event.currentTarget);
|
|
3620
|
+
onCollectionChange?.(void 0);
|
|
3621
|
+
}
|
|
3622
|
+
function removeActivity(event) {
|
|
3623
|
+
focusAfterRemoval(activityIndex, event.currentTarget);
|
|
3624
|
+
onActivityChange?.(void 0);
|
|
3625
|
+
}
|
|
3626
|
+
function removeArchiveScope(event) {
|
|
3627
|
+
focusAfterRemoval(archiveScopeIndex, event.currentTarget);
|
|
3628
|
+
onArchiveScopeChange?.("active");
|
|
3629
|
+
}
|
|
3501
3630
|
const state = {
|
|
3502
3631
|
search,
|
|
3503
3632
|
tags,
|
|
3633
|
+
collection,
|
|
3634
|
+
activity,
|
|
3635
|
+
archiveScope,
|
|
3636
|
+
totalCount,
|
|
3504
3637
|
hasFilters,
|
|
3505
3638
|
clear: () => onClear?.(),
|
|
3506
3639
|
removeSearch: () => onSearchChange?.(""),
|
|
3507
|
-
removeTag: (tag) => onTagChange?.(tag)
|
|
3640
|
+
removeTag: (tag) => onTagChange?.(tag),
|
|
3641
|
+
removeCollection: () => onCollectionChange?.(void 0),
|
|
3642
|
+
removeActivity: () => onActivityChange?.(void 0),
|
|
3643
|
+
removeArchiveScope: () => onArchiveScopeChange?.("active")
|
|
3508
3644
|
};
|
|
3509
3645
|
const contentChildren = asChild && isElement(children) ? void 0 : children;
|
|
3510
3646
|
const body = typeof contentChildren === "function" ? contentChildren(state) : contentChildren ?? (hasFilters ? /* @__PURE__ */ jsxs8(Fragment6, { children: [
|
|
@@ -3543,8 +3679,64 @@ function KeepActiveFiltersSummary({
|
|
|
3543
3679
|
children: "\xD7"
|
|
3544
3680
|
}
|
|
3545
3681
|
)
|
|
3546
|
-
] }, tag))
|
|
3682
|
+
] }, tag)),
|
|
3683
|
+
collection && collectionLabel ? /* @__PURE__ */ jsxs8("li", { "data-filter-kind": "collection", children: [
|
|
3684
|
+
/* @__PURE__ */ jsx10("span", { "data-filter-value": "true", children: collectionLabel }),
|
|
3685
|
+
/* @__PURE__ */ jsx10(
|
|
3686
|
+
"button",
|
|
3687
|
+
{
|
|
3688
|
+
type: "button",
|
|
3689
|
+
"data-keep-action": "remove-collection-filter",
|
|
3690
|
+
"aria-label": `${collectionLabel} ${removeLabel}`,
|
|
3691
|
+
ref: (element) => {
|
|
3692
|
+
chipRefs.current[collectionIndex] = element;
|
|
3693
|
+
},
|
|
3694
|
+
onKeyDown: (event) => handleChipKeyDown(event, collectionIndex),
|
|
3695
|
+
onClick: removeCollection,
|
|
3696
|
+
children: "\xD7"
|
|
3697
|
+
}
|
|
3698
|
+
)
|
|
3699
|
+
] }) : null,
|
|
3700
|
+
hasActivity ? /* @__PURE__ */ jsxs8("li", { "data-filter-kind": "activity", children: [
|
|
3701
|
+
/* @__PURE__ */ jsx10("span", { "data-filter-value": "true", children: resolvedActivityLabel }),
|
|
3702
|
+
/* @__PURE__ */ jsx10(
|
|
3703
|
+
"button",
|
|
3704
|
+
{
|
|
3705
|
+
type: "button",
|
|
3706
|
+
"data-keep-action": "remove-activity-filter",
|
|
3707
|
+
"aria-label": `${resolvedActivityLabel} ${removeLabel}`,
|
|
3708
|
+
ref: (element) => {
|
|
3709
|
+
chipRefs.current[activityIndex] = element;
|
|
3710
|
+
},
|
|
3711
|
+
onKeyDown: (event) => handleChipKeyDown(event, activityIndex),
|
|
3712
|
+
onClick: removeActivity,
|
|
3713
|
+
children: "\xD7"
|
|
3714
|
+
}
|
|
3715
|
+
)
|
|
3716
|
+
] }) : null,
|
|
3717
|
+
hasArchiveScope && resolvedArchiveScopeLabel ? /* @__PURE__ */ jsxs8("li", { "data-filter-kind": "archive-scope", children: [
|
|
3718
|
+
/* @__PURE__ */ jsx10("span", { "data-filter-value": "true", children: resolvedArchiveScopeLabel }),
|
|
3719
|
+
/* @__PURE__ */ jsx10(
|
|
3720
|
+
"button",
|
|
3721
|
+
{
|
|
3722
|
+
type: "button",
|
|
3723
|
+
"data-keep-action": "remove-archive-scope-filter",
|
|
3724
|
+
"aria-label": `${resolvedArchiveScopeLabel} ${removeLabel}`,
|
|
3725
|
+
ref: (element) => {
|
|
3726
|
+
chipRefs.current[archiveScopeIndex] = element;
|
|
3727
|
+
},
|
|
3728
|
+
onKeyDown: (event) => handleChipKeyDown(event, archiveScopeIndex),
|
|
3729
|
+
onClick: removeArchiveScope,
|
|
3730
|
+
children: "\xD7"
|
|
3731
|
+
}
|
|
3732
|
+
)
|
|
3733
|
+
] }) : null
|
|
3547
3734
|
] }),
|
|
3735
|
+
totalCount !== void 0 ? /* @__PURE__ */ jsxs8("span", { "data-filter-count": "true", children: [
|
|
3736
|
+
totalCount,
|
|
3737
|
+
" ",
|
|
3738
|
+
totalCount === 1 ? collectionItemLabel : collectionItemsLabel
|
|
3739
|
+
] }) : null,
|
|
3548
3740
|
/* @__PURE__ */ jsx10("button", { type: "button", "data-keep-action": "clear-filters", onClick: state.clear, children: clearAllLabel || clearLabel })
|
|
3549
3741
|
] }) : null);
|
|
3550
3742
|
if (!hasFilters && !asChild && contentChildren === void 0) return null;
|
|
@@ -3562,6 +3754,22 @@ function KeepActiveFiltersSummary({
|
|
|
3562
3754
|
"KeepActiveFiltersSummary"
|
|
3563
3755
|
);
|
|
3564
3756
|
}
|
|
3757
|
+
function formatActivity(activity, labels, locale) {
|
|
3758
|
+
if (!activity || Object.keys(activity).length === 0) return void 0;
|
|
3759
|
+
if (activity.opened === "never") return labels.neverOpened;
|
|
3760
|
+
if (activity.opened === "ever") return labels.opened;
|
|
3761
|
+
if (activity.inactiveForMs !== void 0) {
|
|
3762
|
+
const days = Math.max(1, Math.round(activity.inactiveForMs / (24 * 60 * 60 * 1e3)));
|
|
3763
|
+
return `${days}${locale?.toLowerCase().startsWith("ja") ? "" : " "}${labels.inactiveFor}`;
|
|
3764
|
+
}
|
|
3765
|
+
if (activity.lastOpenedBefore !== void 0) {
|
|
3766
|
+
return `${labels.before} ${new Date(activity.lastOpenedBefore).toLocaleDateString(locale)}`;
|
|
3767
|
+
}
|
|
3768
|
+
if (activity.lastOpenedAfter !== void 0) {
|
|
3769
|
+
return `${labels.after} ${new Date(activity.lastOpenedAfter).toLocaleDateString(locale)}`;
|
|
3770
|
+
}
|
|
3771
|
+
return void 0;
|
|
3772
|
+
}
|
|
3565
3773
|
function isElement(value) {
|
|
3566
3774
|
return isValidElement2(value);
|
|
3567
3775
|
}
|
|
@@ -4116,6 +4324,7 @@ function useKeepCollection({
|
|
|
4116
4324
|
sortValue: sortToValue(sort),
|
|
4117
4325
|
activeTags,
|
|
4118
4326
|
activeCollection,
|
|
4327
|
+
activity: activeActivity,
|
|
4119
4328
|
archiveScope: activeArchiveScope,
|
|
4120
4329
|
resolvedPageSize,
|
|
4121
4330
|
resolvedQuery,
|
|
@@ -4137,6 +4346,10 @@ function useKeepCollection({
|
|
|
4137
4346
|
setActiveCollection(value);
|
|
4138
4347
|
setPage(1);
|
|
4139
4348
|
},
|
|
4349
|
+
setActivity: (value) => {
|
|
4350
|
+
setActiveActivity(value);
|
|
4351
|
+
setPage(1);
|
|
4352
|
+
},
|
|
4140
4353
|
setArchiveScope: (value) => {
|
|
4141
4354
|
setActiveArchiveScope(value);
|
|
4142
4355
|
setPage(1);
|
|
@@ -4146,10 +4359,12 @@ function useKeepCollection({
|
|
|
4146
4359
|
setPage(1);
|
|
4147
4360
|
},
|
|
4148
4361
|
clearFilters: () => {
|
|
4149
|
-
setSearchValue("");
|
|
4150
|
-
setActiveTags([]);
|
|
4151
|
-
setActiveCollection(
|
|
4152
|
-
|
|
4362
|
+
setSearchValue(query.search?.query ?? "");
|
|
4363
|
+
setActiveTags(query.tags ?? []);
|
|
4364
|
+
setActiveCollection(query.collectionId);
|
|
4365
|
+
setActiveActivity(query.activity);
|
|
4366
|
+
setActiveArchiveScope(archiveScope ?? query.archiveScope ?? scopeFromArchived(query.archived));
|
|
4367
|
+
setPage(query.pagination?.page ?? 1);
|
|
4153
4368
|
},
|
|
4154
4369
|
setPage,
|
|
4155
4370
|
reveal
|
|
@@ -5421,6 +5636,8 @@ function KeepCollectionContent({
|
|
|
5421
5636
|
const toolbarQueryLabel = useUiLabel("toolbarQuery");
|
|
5422
5637
|
const toolbarFiltersLabel = useUiLabel("toolbarFilters");
|
|
5423
5638
|
const toolbarEndLabel = useUiLabel("toolbarEnd");
|
|
5639
|
+
const uncategorizedLabel = useUiLabel("uncategorized");
|
|
5640
|
+
const activeCollectionLabel = view.activeCollection === "__uncategorized__" ? uncategorizedLabel : view.activeCollection === void 0 ? void 0 : collectionLabels?.[view.activeCollection] ?? view.activeCollection;
|
|
5424
5641
|
const toolbarStartContent = slots?.toolbarStart === void 0 ? null : resolveContent(slots.toolbarStart, view.list);
|
|
5425
5642
|
const creatableContent = creatable ? /* @__PURE__ */ jsx22(KeepCollectionCreate, {}) : null;
|
|
5426
5643
|
const toolbarEndContent = creatableContent ?? (slots?.toolbarEnd === void 0 ? null : resolveContent(slots.toolbarEnd, view.list));
|
|
@@ -5470,8 +5687,19 @@ function KeepCollectionContent({
|
|
|
5470
5687
|
{
|
|
5471
5688
|
search: view.searchValue,
|
|
5472
5689
|
tags: view.activeTags,
|
|
5690
|
+
collection: view.activeCollection,
|
|
5691
|
+
collectionLabel: activeCollectionLabel,
|
|
5692
|
+
activity: view.activity,
|
|
5693
|
+
archiveScope: view.archiveScope,
|
|
5694
|
+
totalCount: view.list.totalCount,
|
|
5473
5695
|
onSearchChange: view.setSearchValue,
|
|
5474
5696
|
onTagChange: view.removeTag,
|
|
5697
|
+
onCollectionChange: view.setCollection,
|
|
5698
|
+
onActivityChange: view.setActivity,
|
|
5699
|
+
onArchiveScopeChange: (next) => {
|
|
5700
|
+
view.setArchiveScope(next);
|
|
5701
|
+
onArchiveScopeChange?.(next);
|
|
5702
|
+
},
|
|
5475
5703
|
onClear: view.clearFilters
|
|
5476
5704
|
}
|
|
5477
5705
|
) : resolveContent(activeFilters, view.list),
|