@t007/utils 0.0.35 → 0.0.36

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.
@@ -4,7 +4,7 @@ import {
4
4
  createEl,
5
5
  getActiveEl,
6
6
  isInteractive
7
- } from "./chunk-ZALPHCSJ.js";
7
+ } from "./chunk-ZOFWWRKV.js";
8
8
 
9
9
  // src/ts/hooks/vanilla/outsideClick.ts
10
10
  import { NIL, NOOP } from "sia-reactor";
@@ -140,7 +140,7 @@ var NAV_KEYS = [...H_NAV_KEYS, ...V_NAV_KEYS];
140
140
  var DEFAULT_CONFIG = {
141
141
  enabled: null,
142
142
  selector: "[data-arrow-item]",
143
- focusOnHover: true,
143
+ focusOnHover: false,
144
144
  loop: true,
145
145
  virtual: false,
146
146
  typeahead: false,
@@ -21,7 +21,7 @@ function loadResource(req, type = "style", { module, media, crossOrigin, integri
21
21
  console.warn(`Retrying ${type} load for "${src}" (${attempts - remaining + 1})...`);
22
22
  } else {
23
23
  delete win.t007._resourceCache[src];
24
- reject(new Error(`${capitalize(type)} load failed for "${src}" after ${attempts - 1} attempts`));
24
+ reject(new Error(`${capitalize(type)} load failed for "${src}"`));
25
25
  }
26
26
  };
27
27
  const url = retryKey && remaining < attempts ? `${src}${src.includes("?") ? "&" : "?"}_${retryKey}=${Date.now()}` : src;
@@ -56,7 +56,7 @@ function createListRenderer({ container, getKey, createNode, updateNode = NOOP,
56
56
  continue;
57
57
  }
58
58
  oldIndices.push(-1);
59
- } else updateNode(node, item), oldIndices.push(oldPositions.get(node) ?? -1);
59
+ } else updateNode(node, item, i), oldIndices.push(oldPositions.get(node) ?? -1);
60
60
  seenKeys.add(key), futureNodes.push(node), newRegistry.set(key, node);
61
61
  }
62
62
  for (const [key, node] of nodeRegistry.entries()) !seenKeys.has(key) && node.parentElement === container && (destroyNode(node, key), node.remove());
@@ -207,7 +207,7 @@ var NAV_KEYS = [...H_NAV_KEYS, ...V_NAV_KEYS];
207
207
  var DEFAULT_CONFIG = {
208
208
  enabled: null,
209
209
  selector: "[data-arrow-item]",
210
- focusOnHover: true,
210
+ focusOnHover: false,
211
211
  loop: true,
212
212
  virtual: false,
213
213
  typeahead: false,
@@ -11,11 +11,11 @@ import {
11
11
  initFocusTrap,
12
12
  initOutsideClick,
13
13
  rippleHandler
14
- } from "../chunk-NX2LWYD6.js";
14
+ } from "../chunk-DSDFIB5F.js";
15
15
  import {
16
16
  INTERACTIVE_SELECTOR,
17
17
  getActiveEl
18
- } from "../chunk-ZALPHCSJ.js";
18
+ } from "../chunk-ZOFWWRKV.js";
19
19
 
20
20
  // src/ts/hooks/react/useScrollAssist.ts
21
21
  import { useEffect, useRef, useCallback } from "react";
@@ -205,7 +205,7 @@ var NAV_KEYS = [...H_NAV_KEYS, ...V_NAV_KEYS];
205
205
  var DEFAULT_CONFIG = {
206
206
  enabled: null,
207
207
  selector: "[data-arrow-item]",
208
- focusOnHover: true,
208
+ focusOnHover: false,
209
209
  loop: true,
210
210
  virtual: false,
211
211
  typeahead: false,
@@ -11,12 +11,12 @@ import {
11
11
  removeOutsideClick,
12
12
  rippleHandler,
13
13
  syncFocusTrap
14
- } from "../chunk-NX2LWYD6.js";
14
+ } from "../chunk-DSDFIB5F.js";
15
15
  import {
16
16
  INTERACTIVE_SELECTOR,
17
17
  createEl,
18
18
  getActiveEl
19
- } from "../chunk-ZALPHCSJ.js";
19
+ } from "../chunk-ZOFWWRKV.js";
20
20
 
21
21
  // src/ts/hooks/vanilla/scrollAssist.ts
22
22
  import { NIL } from "sia-reactor";
package/dist/index.cjs CHANGED
@@ -107,7 +107,7 @@ function loadResource(req, type = "style", { module: module2, media, crossOrigin
107
107
  console.warn(`Retrying ${type} load for "${src}" (${attempts - remaining + 1})...`);
108
108
  } else {
109
109
  delete win.t007._resourceCache[src];
110
- reject(new Error(`${capitalize(type)} load failed for "${src}" after ${attempts - 1} attempts`));
110
+ reject(new Error(`${capitalize(type)} load failed for "${src}"`));
111
111
  }
112
112
  };
113
113
  const url = retryKey && remaining < attempts ? `${src}${src.includes("?") ? "&" : "?"}_${retryKey}=${Date.now()}` : src;
@@ -142,7 +142,7 @@ function createListRenderer({ container, getKey, createNode, updateNode = import
142
142
  continue;
143
143
  }
144
144
  oldIndices.push(-1);
145
- } else updateNode(node, item), oldIndices.push(oldPositions.get(node) ?? -1);
145
+ } else updateNode(node, item, i), oldIndices.push(oldPositions.get(node) ?? -1);
146
146
  seenKeys.add(key), futureNodes.push(node), newRegistry.set(key, node);
147
147
  }
148
148
  for (const [key, node] of nodeRegistry.entries()) !seenKeys.has(key) && node.parentElement === container && (destroyNode(node, key), node.remove());
package/dist/index.d.cts CHANGED
@@ -286,8 +286,9 @@ type ListRendererOptions<T, El extends HTMLElement = HTMLElement> = {
286
286
  /** Optional function to update an existing node with new item data, called when an item is reused.
287
287
  * @param node The existing DOM node for the item
288
288
  * @param item The new item data to update the node with
289
+ * @param index The new index of the item in the array
289
290
  */
290
- updateNode?: (node: El, item: T) => void;
291
+ updateNode?: (node: El, item: T, index: number) => void;
291
292
  /** Optional function to clean up a DOM node when an item is removed, called before the node is removed from the DOM.
292
293
  * @param node The DOM node to be removed
293
294
  * @param key The unique key of the item associated with the node
package/dist/index.d.ts CHANGED
@@ -286,8 +286,9 @@ type ListRendererOptions<T, El extends HTMLElement = HTMLElement> = {
286
286
  /** Optional function to update an existing node with new item data, called when an item is reused.
287
287
  * @param node The existing DOM node for the item
288
288
  * @param item The new item data to update the node with
289
+ * @param index The new index of the item in the array
289
290
  */
290
- updateNode?: (node: El, item: T) => void;
291
+ updateNode?: (node: El, item: T, index: number) => void;
291
292
  /** Optional function to clean up a DOM node when an item is removed, called before the node is removed from the DOM.
292
293
  * @param node The DOM node to be removed
293
294
  * @param key The unique key of the item associated with the node
package/dist/index.js CHANGED
@@ -60,7 +60,7 @@ import {
60
60
  throttle,
61
61
  uid,
62
62
  uncamelize
63
- } from "./chunk-ZALPHCSJ.js";
63
+ } from "./chunk-ZOFWWRKV.js";
64
64
  export {
65
65
  INTERACTIVE_SELECTOR,
66
66
  KEYS_BLOCKS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t007/utils",
3
- "version": "0.0.35",
3
+ "version": "0.0.36",
4
4
  "description": "High-performance utilities for the t007 ecosystem.",
5
5
  "author": "Oketade Oluwatobiloba <tobioketade007@gmail.com>",
6
6
  "license": "MIT",
@@ -76,7 +76,7 @@
76
76
  "react-dom": "^18.3.1"
77
77
  },
78
78
  "dependencies": {
79
- "sia-reactor": "^0.0.36"
79
+ "sia-reactor": "^0.0.37"
80
80
  },
81
81
  "peerDependencies": {
82
82
  "react": "^18.0.0"