@keepkit/core 0.28.15 → 0.28.16

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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  persistKeepItems,
3
3
  removeKeepItems
4
- } from "./chunk-WKXLHEAK.js";
4
+ } from "./chunk-HTTOCLOC.js";
5
5
 
6
6
  // src/features/items/navigation.ts
7
7
  function orderKeepItems(items) {
@@ -273,4 +273,4 @@ export {
273
273
  reconcileKeepItems,
274
274
  KeepStore
275
275
  };
276
- //# sourceMappingURL=chunk-36NNVLEU.js.map
276
+ //# sourceMappingURL=chunk-OLGYOC3D.js.map
package/dist/core.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { S as StorageAdapter, d as KeepCollectionMembership, K as KeepItem, e as KeepScope, R as RemoteSyncDriver, f as KeepPluginContext, g as KeepPlugin, h as SyncOperation, i as KeepCollectionSyncOperation, j as KeepMembershipSyncOperation, k as SyncScope, l as SyncCapableStorageAdapter, m as RemoteSyncResult, n as KeepCollectionSyncResult, o as KeepCollectionDefinition, p as KeepSyncAuthError } from './types-KNIY89_m.js';
2
- export { F as FallbackRecoveryJournal, q as FallbackRecoveryJournalState, r as FallbackRecoveryJournalV2, s as FallbackRecoveryOperation, t as FallbackRecoverySnapshot, I as ImportItemsOptions, u as ImportItemsResult, v as KEEP_BACKUP_FORMAT, w as KEEP_BACKUP_VERSION, x as KeepAction, y as KeepBackup, z as KeepBackupAppliedCounts, A as KeepBackupDataType, B as KeepBackupImportError, C as KeepBackupParseError, D as KeepBackupSummary, E as KeepBackupV1, G as KeepBackupV2, b as KeepChangeContext, H as KeepChangePhase, J as KeepCollectionSyncConflict, L as KeepConflictContext, M as KeepConflictResolver, N as KeepErrorContext, O as KeepErrorHandler, P as KeepEventHandlers, Q as KeepInvalidItemPolicy, T as KeepItemInput, a as KeepItemStatus, U as KeepRecoveryInspection, V as KeepRecoveryResult, W as KeepRecoveryRow, X as KeepRecoveryState, Y as KeepSchema, Z as KeepSchemaParseResult, _ as KeepStorageAccessError, $ as KeepStorageError, a0 as KeepStorageOperation, a1 as KeepStorageParseError, a2 as KeepStorageQuotaError, a3 as KeepStorageRecovery, a4 as KeepStorageSerializationError, a5 as KeepSyncAuthStatus, a6 as KeepSyncConflict, a7 as KeepSyncQueueOperation, a8 as KeepSyncRejectedOperation, a9 as KeepSyncResolution, aa as KeepSyncState, ab as KeepSyncStatus, c as KeepUndoState, ac as LocalStorageRecoveryJournal, ad as ScopedStorageAdapter, ae as ScopedSyncQueueAdapter, af as SyncQueueAdapter, ag as createScopedStorageAdapter, ah as exportItems, ai as formatItemsAsMarkdown, aj as getKeepScopeKey, ak as importItems, al as inspectKeepBackup, am as isKeepSyncAuthError, an as isSameKeepScope, ao as normalizeKeepTags } from './types-KNIY89_m.js';
3
- import { K as KeepListQuery } from './store-D-ZFtgDn.js';
4
- export { D as DEFAULT_KEEP_URL_PARAMS, a as KeepAutoRevalidationOptions, b as KeepCollectionMeta, c as KeepItemMetadataRefresher, d as KeepItemResolver, e as KeepItemRevalidationRecord, f as KeepItemRevalidationResult, g as KeepItemRevalidationSummary, h as KeepItemRevalidator, i as KeepNavigationState, j as KeepRediscoveryOptions, k as KeepRediscoveryStrategy, l as KeepStore, m as KeepStoreActions, n as KeepStoreState, o as KeepUrlParamNames, p as KeepUrlState, q as KeepUrlSyncOptions, Q as QueryKeepItemsResult, R as RevalidateKeepItemsOptions, r as createInboxQuery, s as createRediscoveryQuery, t as decodeKeepListQuery, u as encodeKeepListQuery, v as getKeepNavigationState, w as getTagCounts, x as isKeepItemMetadataStale, y as mergeKeepListQueryFromUrl, z as moveKeepItem, A as orderKeepItems, B as queryKeepItems, C as reconcileKeepItems, E as reorderKeepItems, F as revalidateKeepItems, G as serializeKeepListQuery } from './store-D-ZFtgDn.js';
1
+ import { S as StorageAdapter, d as KeepCollectionMembership, K as KeepItem, e as KeepScope, R as RemoteSyncDriver, f as KeepPluginContext, g as KeepPlugin, h as SyncOperation, i as KeepCollectionSyncOperation, j as KeepMembershipSyncOperation, k as SyncScope, l as SyncCapableStorageAdapter, m as RemoteSyncResult, n as KeepCollectionSyncResult, o as KeepCollectionDefinition, p as KeepSyncAuthError } from './types-Bnc0c8CB.js';
2
+ export { F as FallbackRecoveryJournal, q as FallbackRecoveryJournalState, r as FallbackRecoveryJournalV2, s as FallbackRecoveryOperation, t as FallbackRecoverySnapshot, I as ImportItemsOptions, u as ImportItemsResult, v as KEEP_BACKUP_FORMAT, w as KEEP_BACKUP_VERSION, x as KeepAction, y as KeepBackup, z as KeepBackupAppliedCounts, A as KeepBackupDataType, B as KeepBackupImportError, C as KeepBackupParseError, D as KeepBackupSummary, E as KeepBackupV1, G as KeepBackupV2, b as KeepChangeContext, H as KeepChangePhase, J as KeepCollectionSyncConflict, L as KeepConflictContext, M as KeepConflictResolver, N as KeepErrorContext, O as KeepErrorHandler, P as KeepEventHandlers, Q as KeepInvalidItemPolicy, T as KeepItemInput, a as KeepItemStatus, U as KeepRecoveryInspection, V as KeepRecoveryResult, W as KeepRecoveryRow, X as KeepRecoveryState, Y as KeepSchema, Z as KeepSchemaParseResult, _ as KeepStorageAccessError, $ as KeepStorageError, a0 as KeepStorageOperation, a1 as KeepStorageParseError, a2 as KeepStorageQuotaError, a3 as KeepStorageRecovery, a4 as KeepStorageSerializationError, a5 as KeepSyncAuthStatus, a6 as KeepSyncConflict, a7 as KeepSyncQueueOperation, a8 as KeepSyncRejectedOperation, a9 as KeepSyncResolution, aa as KeepSyncState, ab as KeepSyncStatus, c as KeepUndoState, ac as LocalStorageRecoveryJournal, ad as ScopedStorageAdapter, ae as ScopedSyncQueueAdapter, af as SyncQueueAdapter, ag as createScopedStorageAdapter, ah as exportItems, ai as formatItemsAsMarkdown, aj as getKeepScopeKey, ak as importItems, al as inspectKeepBackup, am as isKeepSyncAuthError, an as isSameKeepScope, ao as normalizeKeepTags } from './types-Bnc0c8CB.js';
3
+ import { K as KeepListQuery } from './store-3LwroO9A.js';
4
+ export { D as DEFAULT_KEEP_URL_PARAMS, a as KeepAutoRevalidationOptions, b as KeepCollectionMeta, c as KeepItemMetadataRefresher, d as KeepItemResolver, e as KeepItemRevalidationRecord, f as KeepItemRevalidationResult, g as KeepItemRevalidationSummary, h as KeepItemRevalidator, i as KeepNavigationState, j as KeepRediscoveryOptions, k as KeepRediscoveryStrategy, l as KeepStore, m as KeepStoreActions, n as KeepStoreState, o as KeepUrlParamNames, p as KeepUrlState, q as KeepUrlSyncOptions, Q as QueryKeepItemsResult, R as RevalidateKeepItemsOptions, r as createInboxQuery, s as createRediscoveryQuery, t as decodeKeepListQuery, u as encodeKeepListQuery, v as getKeepNavigationState, w as getTagCounts, x as isKeepItemMetadataStale, y as mergeKeepListQueryFromUrl, z as moveKeepItem, A as orderKeepItems, B as queryKeepItems, C as reconcileKeepItems, E as reorderKeepItems, F as revalidateKeepItems, G as serializeKeepListQuery } from './store-3LwroO9A.js';
5
5
  export { KeepSchemaValidationError, parseKeepMeta, validateKeepItem } from './schema.js';
6
6
  import { SyncStorageAdapterOptions, BrowserStorageAdapterOptions } from './storage.js';
7
7
  export { DEFAULT_INDEXEDDB_DATABASE, DEFAULT_INDEXEDDB_STORE, DEFAULT_STORAGE_KEY, DEFAULT_SYNC_QUEUE_DATABASE, DEFAULT_SYNC_QUEUE_KEY, DEFAULT_SYNC_QUEUE_STORE, FallbackStorageAdapter, FallbackStorageAdapterOptions, FallbackSyncQueueAdapter, FallbackSyncQueueAdapterOptions, IndexedDBAdapter, IndexedDBAdapterOptions, IndexedDBSyncQueueAdapter, IndexedDBSyncQueueOptions, LocalStorageAdapter, LocalStorageAdapterOptions, LocalStorageSyncQueueAdapter, LocalStorageSyncQueueOptions, RecoveryJournalFactoryContext, StorageAdapterFactoryOptions, SyncStorageAdapter, createBrowserStorageAdapter, createStorageAdapter } from './storage.js';
package/dist/core.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  reconcileKeepItems,
12
12
  reorderKeepItems,
13
13
  revalidateKeepItems
14
- } from "./chunk-36NNVLEU.js";
14
+ } from "./chunk-OLGYOC3D.js";
15
15
  import {
16
16
  DEFAULT_INDEXEDDB_DATABASE,
17
17
  DEFAULT_INDEXEDDB_STORE,
@@ -55,7 +55,7 @@ import {
55
55
  migrateLegacyCollectionMemberships,
56
56
  normalizeKeepTags,
57
57
  withLocalStorageWriteLock
58
- } from "./chunk-WKXLHEAK.js";
58
+ } from "./chunk-HTTOCLOC.js";
59
59
  import {
60
60
  KeepSchemaValidationError,
61
61
  parseKeepMeta,
package/dist/react.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { c as KeepItemMetadataRefresher, h as KeepItemRevalidator, d as KeepItemResolver, a as KeepAutoRevalidationOptions, b as KeepCollectionMeta, R as RevalidateKeepItemsOptions, g as KeepItemRevalidationSummary, l as KeepStore, m as KeepStoreActions, K as KeepListQuery, i as KeepNavigationState, j as KeepRediscoveryOptions } from './store-D-ZFtgDn.js';
2
- export { f as KeepItemRevalidationResult, k as KeepRediscoveryStrategy, o as KeepUrlParamNames, p as KeepUrlState, q as KeepUrlSyncOptions, s as createRediscoveryQuery, x as isKeepItemMetadataStale } from './store-D-ZFtgDn.js';
3
- import { T as KeepItemInput, K as KeepItem, P as KeepEventHandlers, S as StorageAdapter, g as KeepPlugin, Y as KeepSchema, Q as KeepInvalidItemPolicy, b as KeepChangeContext, aa as KeepSyncState, c as KeepUndoState, I as ImportItemsOptions, u as ImportItemsResult } from './types-KNIY89_m.js';
4
- export { a as KeepItemStatus, e as KeepScope, ad as ScopedStorageAdapter } from './types-KNIY89_m.js';
1
+ import { c as KeepItemMetadataRefresher, h as KeepItemRevalidator, d as KeepItemResolver, a as KeepAutoRevalidationOptions, b as KeepCollectionMeta, R as RevalidateKeepItemsOptions, g as KeepItemRevalidationSummary, l as KeepStore, m as KeepStoreActions, K as KeepListQuery, i as KeepNavigationState, j as KeepRediscoveryOptions } from './store-3LwroO9A.js';
2
+ export { f as KeepItemRevalidationResult, k as KeepRediscoveryStrategy, o as KeepUrlParamNames, p as KeepUrlState, q as KeepUrlSyncOptions, s as createRediscoveryQuery, x as isKeepItemMetadataStale } from './store-3LwroO9A.js';
3
+ import { T as KeepItemInput, K as KeepItem, P as KeepEventHandlers, S as StorageAdapter, g as KeepPlugin, Y as KeepSchema, Q as KeepInvalidItemPolicy, b as KeepChangeContext, aa as KeepSyncState, c as KeepUndoState, I as ImportItemsOptions, u as ImportItemsResult } from './types-Bnc0c8CB.js';
4
+ export { a as KeepItemStatus, e as KeepScope, ad as ScopedStorageAdapter } from './types-Bnc0c8CB.js';
5
5
  import * as react from 'react';
6
6
  import { ReactNode, Ref, ButtonHTMLAttributes, MouseEvent, HTMLAttributes, ReactElement, ErrorInfo, Component, PropsWithChildren, ComponentType } from 'react';
7
7
 
package/dist/react.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  queryKeepItems,
10
10
  reorderKeepItems,
11
11
  revalidateKeepItems
12
- } from "./chunk-36NNVLEU.js";
12
+ } from "./chunk-OLGYOC3D.js";
13
13
  import {
14
14
  createBrowserStorageAdapter,
15
15
  exportItems,
@@ -18,7 +18,7 @@ import {
18
18
  normalizeKeepTags,
19
19
  persistKeepItems,
20
20
  removeKeepItems
21
- } from "./chunk-WKXLHEAK.js";
21
+ } from "./chunk-HTTOCLOC.js";
22
22
  import {
23
23
  parseKeepMeta
24
24
  } from "./chunk-5W4QSJHV.js";
@@ -1291,7 +1291,7 @@ function KeepButton({
1291
1291
  }) {
1292
1292
  const state = useKeepItem(item);
1293
1293
  const { isSaved, toggle } = state;
1294
- const isDisabled = disabled ?? state.isMutating;
1294
+ const isDisabled = Boolean(disabled || state.isLoading || state.isMutating);
1295
1295
  async function handleClick(event) {
1296
1296
  if (isDisabled) return;
1297
1297
  if (asChild) {
@@ -1310,11 +1310,17 @@ function KeepButton({
1310
1310
  }
1311
1311
  const content = typeof children === "function" ? children(state) : children ?? (isSaved ? savedLabel : unsavedLabel);
1312
1312
  function handleElementClick(event) {
1313
- if (isDisabled) return;
1313
+ if (isDisabled) {
1314
+ if (asChild) event.preventDefault();
1315
+ return;
1316
+ }
1314
1317
  if (asChild && isValidElement(content)) {
1315
1318
  content.props.onClick?.(event);
1316
1319
  }
1317
- if (!event.defaultPrevented) void handleClick(event);
1320
+ if (!event.defaultPrevented) {
1321
+ void handleClick(event);
1322
+ if (asChild && event.currentTarget instanceof HTMLAnchorElement) event.preventDefault();
1323
+ }
1318
1324
  }
1319
1325
  function handleKeyDown(event) {
1320
1326
  if (asChild && isValidElement(content)) {