viconic-react-icons 1.5.2 → 1.5.4

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/dist/index.js CHANGED
@@ -2013,6 +2013,7 @@ if (typeof document !== "undefined") {
2013
2013
  }
2014
2014
  var _kitMissQueues = {};
2015
2015
  var _kitMissTimers = {};
2016
+ var _kitQueued = {};
2016
2017
  function _resolveRegistry(prefix) {
2017
2018
  if (_kitRegistry[prefix]) return _kitRegistry[prefix];
2018
2019
  const kits = window.CopyIconsKit || {};
@@ -2036,6 +2037,9 @@ function _flushPendingMisses(prefix) {
2036
2037
  }
2037
2038
  function _dispatchBatchFetch(prefix, iconBaseName, entry) {
2038
2039
  const { kitId, api } = entry;
2040
+ if (!_kitQueued[kitId]) _kitQueued[kitId] = /* @__PURE__ */ new Set();
2041
+ if (_kitQueued[kitId].has(iconBaseName)) return;
2042
+ _kitQueued[kitId].add(iconBaseName);
2039
2043
  if (!_kitMissQueues[kitId]) _kitMissQueues[kitId] = /* @__PURE__ */ new Set();
2040
2044
  _kitMissQueues[kitId].add(iconBaseName);
2041
2045
  if (_kitMissTimers[kitId]) return;
package/dist/index.mjs CHANGED
@@ -1978,6 +1978,7 @@ if (typeof document !== "undefined") {
1978
1978
  }
1979
1979
  var _kitMissQueues = {};
1980
1980
  var _kitMissTimers = {};
1981
+ var _kitQueued = {};
1981
1982
  function _resolveRegistry(prefix) {
1982
1983
  if (_kitRegistry[prefix]) return _kitRegistry[prefix];
1983
1984
  const kits = window.CopyIconsKit || {};
@@ -2001,6 +2002,9 @@ function _flushPendingMisses(prefix) {
2001
2002
  }
2002
2003
  function _dispatchBatchFetch(prefix, iconBaseName, entry) {
2003
2004
  const { kitId, api } = entry;
2005
+ if (!_kitQueued[kitId]) _kitQueued[kitId] = /* @__PURE__ */ new Set();
2006
+ if (_kitQueued[kitId].has(iconBaseName)) return;
2007
+ _kitQueued[kitId].add(iconBaseName);
2004
2008
  if (!_kitMissQueues[kitId]) _kitMissQueues[kitId] = /* @__PURE__ */ new Set();
2005
2009
  _kitMissQueues[kitId].add(iconBaseName);
2006
2010
  if (_kitMissTimers[kitId]) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viconic-react-icons",
3
- "version": "1.5.2",
3
+ "version": "1.5.4",
4
4
  "description": "Viconic Smart Icons loader for React — supports Kit and 200k+ system icons",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
package/src/index.jsx CHANGED
@@ -62,6 +62,7 @@ if (typeof document !== 'undefined') {
62
62
  // ============================================
63
63
  const _kitMissQueues = {}; // kitId -> Set of icon names
64
64
  const _kitMissTimers = {}; // kitId -> timer handle
65
+ const _kitQueued = {}; // kitId -> Set of icon names already queued (prevents Strict Mode double-queue)
65
66
 
66
67
  function _resolveRegistry(prefix) {
67
68
  if (_kitRegistry[prefix]) return _kitRegistry[prefix];
@@ -89,10 +90,14 @@ function _flushPendingMisses(prefix) {
89
90
 
90
91
  function _dispatchBatchFetch(prefix, iconBaseName, entry) {
91
92
  const { kitId, api } = entry;
93
+ // Skip if already queued — prevents React Strict Mode double-invoke from making 2 requests
94
+ if (!_kitQueued[kitId]) _kitQueued[kitId] = new Set();
95
+ if (_kitQueued[kitId].has(iconBaseName)) return;
96
+ _kitQueued[kitId].add(iconBaseName);
92
97
  if (!_kitMissQueues[kitId]) _kitMissQueues[kitId] = new Set();
93
98
  _kitMissQueues[kitId].add(iconBaseName);
94
99
  if (_kitMissTimers[kitId]) return; // already scheduled, will pick up new additions
95
- // 150ms debounce: long enough to collect all icons across a full React render cycle
100
+ // 150ms debounce: collect all icons across the full React render cycle
96
101
  _kitMissTimers[kitId] = setTimeout(() => {
97
102
  delete _kitMissTimers[kitId];
98
103
  const names = [...(_kitMissQueues[kitId] || [])];