@infinite-table/infinite-react 11.0.1 → 11.0.3

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/index.dev.js CHANGED
@@ -29686,6 +29686,10 @@ var fieldsToLicenseDetails = (fields) => {
29686
29686
  };
29687
29687
  return details;
29688
29688
  };
29689
+ var FREE_USAGE_MESSAGE = `Thank you for using the Infinite Table free version! Make sure the "Powered by Infinite Table" footer link is visible in your app.
29690
+
29691
+ If you want to remove the footer link, please visit infinite-table.com to purchase a license.`;
29692
+ var freeUsageNoteLogged = false;
29689
29693
  var logLicenseError = (lines, fn = console.error.bind(console)) => {
29690
29694
  lines = ["* * * infinite-table.com * * *", ...lines];
29691
29695
  const max = Math.max(Math.max(...lines.map((l) => l.length)) + 4 * 2, 60);
@@ -29707,6 +29711,15 @@ var checkLicense = (licenseKey = "", packageInfo, fn) => {
29707
29711
  try {
29708
29712
  details = decode(licenseKey);
29709
29713
  } catch (ex) {
29714
+ if (!licenseKey) {
29715
+ if (fn) {
29716
+ fn(FREE_USAGE_MESSAGE);
29717
+ } else if (!freeUsageNoteLogged) {
29718
+ freeUsageNoteLogged = true;
29719
+ console.info(FREE_USAGE_MESSAGE);
29720
+ }
29721
+ return "invalid";
29722
+ }
29710
29723
  logLicenseError(
29711
29724
  [
29712
29725
  `You don't have a valid Infinite Table license`,
@@ -29783,8 +29796,8 @@ function getLicenseStatus(licenseKey = "", options) {
29783
29796
  return "valid";
29784
29797
  }
29785
29798
  const result = checkLicense(licenseKey, {
29786
- publishedAt: 1795784312033,
29787
- version: "11.0.1"
29799
+ publishedAt: 1796157962491,
29800
+ version: "11.0.3"
29788
29801
  });
29789
29802
  if (result === "invalid" && !licenseKey) {
29790
29803
  return "missing";
@@ -33285,7 +33298,7 @@ var DevToolsOverlay = createRuntimeFn({ defaultClassName: "_143ofgf0", variantCl
33285
33298
  var DevToolsOverlayBg = "_143ofgf5";
33286
33299
  var DevToolsOverlayText = "_143ofgf3";
33287
33300
 
33288
- // src/components/InfiniteTable/hooks/useDebugMode.ts
33301
+ // src/components/InfiniteTable/utils/devToolsConnection.ts
33289
33302
  var cssFileLoadedVarName = stripVar(ThemeVars.loaded);
33290
33303
  var messageBase = {
33291
33304
  source: "infinite-table-page",
@@ -33420,37 +33433,6 @@ var setupHook = once(() => {
33420
33433
  });
33421
33434
  return hookFn;
33422
33435
  });
33423
- function useDebugMode() {
33424
- const { getState, getDataSourceState, dataSourceActions } = useInfiniteTableSelector((ctx) => {
33425
- return {
33426
- getState: ctx.getState,
33427
- getDataSourceState: ctx.getDataSourceState,
33428
- dataSourceActions: ctx.dataSourceActions
33429
- };
33430
- });
33431
- const state = getState();
33432
- const { domRef, debugId } = state;
33433
- if (debugId) {
33434
- if (domRef.current) {
33435
- const value = getComputedStyle(domRef.current).getPropertyValue(
33436
- cssFileLoadedVarName
33437
- );
33438
- if (value !== `${CSS_LOADED_VALUE}`) {
33439
- logDevToolsWarning({
33440
- debugId,
33441
- key: "CSS001_CSS"
33442
- });
33443
- }
33444
- }
33445
- }
33446
- (0, import_react68.useEffect)(() => {
33447
- const dataSourceState = getDataSourceState();
33448
- if (dataSourceState.debugId !== debugId) {
33449
- dataSourceActions.debugId = debugId;
33450
- }
33451
- }, [debugId]);
33452
- return useDevTools();
33453
- }
33454
33436
  var HOOK_FN_SETUP_CALLBACK = buildSubscriptionCallback();
33455
33437
  var DEVTOOLS_MESSAGES = {
33456
33438
  revertAll: (payload) => {
@@ -33673,6 +33655,57 @@ function listenForDevTools() {
33673
33655
  }
33674
33656
  }
33675
33657
  listenForDevTools();
33658
+ function warnIfDevToolsCssNotLoaded(debugId, domNode) {
33659
+ if (!domNode) {
33660
+ return;
33661
+ }
33662
+ const value = getComputedStyle(domNode).getPropertyValue(cssFileLoadedVarName);
33663
+ if (value !== `${CSS_LOADED_VALUE}`) {
33664
+ logDevToolsWarning({
33665
+ debugId,
33666
+ key: "CSS001_CSS"
33667
+ });
33668
+ }
33669
+ }
33670
+ function getDevToolsHookFn() {
33671
+ return HOOK_FN_SETUP_CALLBACK.get();
33672
+ }
33673
+ function onDevToolsHookFn(fn) {
33674
+ return HOOK_FN_SETUP_CALLBACK.onChange((hookFn) => {
33675
+ if (hookFn) {
33676
+ fn(hookFn);
33677
+ }
33678
+ });
33679
+ }
33680
+ function disconnectFromDevTools(debugId) {
33681
+ const devtoolsHookFn = globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;
33682
+ if (devtoolsHookFn) {
33683
+ devtoolsHookFn(debugId, null);
33684
+ }
33685
+ }
33686
+
33687
+ // src/components/InfiniteTable/hooks/useDebugMode.ts
33688
+ function useDebugMode() {
33689
+ const { getState, getDataSourceState, dataSourceActions } = useInfiniteTableSelector((ctx) => {
33690
+ return {
33691
+ getState: ctx.getState,
33692
+ getDataSourceState: ctx.getDataSourceState,
33693
+ dataSourceActions: ctx.dataSourceActions
33694
+ };
33695
+ });
33696
+ const state = getState();
33697
+ const { domRef, debugId } = state;
33698
+ if (debugId) {
33699
+ warnIfDevToolsCssNotLoaded(debugId, domRef.current);
33700
+ }
33701
+ (0, import_react68.useEffect)(() => {
33702
+ const dataSourceState = getDataSourceState();
33703
+ if (dataSourceState.debugId !== debugId) {
33704
+ dataSourceActions.debugId = debugId;
33705
+ }
33706
+ }, [debugId]);
33707
+ return useDevTools();
33708
+ }
33676
33709
  function useDevTools() {
33677
33710
  const {
33678
33711
  getState,
@@ -33713,24 +33746,19 @@ function useDevTools() {
33713
33746
  dataSourceApi
33714
33747
  });
33715
33748
  };
33716
- const hookFn = HOOK_FN_SETUP_CALLBACK.get();
33749
+ const hookFn = getDevToolsHookFn();
33717
33750
  if (hookFn) {
33718
33751
  withHookFn(hookFn);
33719
33752
  return;
33720
33753
  }
33721
- return HOOK_FN_SETUP_CALLBACK.onChange((hookFn2) => {
33722
- if (!hookFn2) {
33723
- return;
33724
- }
33725
- withHookFn(hookFn2);
33726
- });
33754
+ return onDevToolsHookFn(withHookFn);
33727
33755
  }, []);
33728
33756
  (0, import_react68.useEffect)(() => {
33729
33757
  const debugId2 = debugIdRef.current;
33730
33758
  if (!debugId2) {
33731
33759
  return;
33732
33760
  }
33733
- const hookFn = HOOK_FN_SETUP_CALLBACK.get();
33761
+ const hookFn = getDevToolsHookFn();
33734
33762
  if (hookFn) {
33735
33763
  hookFn(debugId2, {
33736
33764
  getState,
@@ -33748,10 +33776,7 @@ function useDevTools() {
33748
33776
  return;
33749
33777
  }
33750
33778
  return () => {
33751
- const devtoolsHookFn = globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;
33752
- if (devtoolsHookFn) {
33753
- devtoolsHookFn(debugId, null);
33754
- }
33779
+ disconnectFromDevTools(debugId);
33755
33780
  };
33756
33781
  }, [debugId]);
33757
33782
  return debugId;
package/index.dev.mjs CHANGED
@@ -29629,6 +29629,10 @@ var fieldsToLicenseDetails = (fields) => {
29629
29629
  };
29630
29630
  return details;
29631
29631
  };
29632
+ var FREE_USAGE_MESSAGE = `Thank you for using the Infinite Table free version! Make sure the "Powered by Infinite Table" footer link is visible in your app.
29633
+
29634
+ If you want to remove the footer link, please visit infinite-table.com to purchase a license.`;
29635
+ var freeUsageNoteLogged = false;
29632
29636
  var logLicenseError = (lines, fn = console.error.bind(console)) => {
29633
29637
  lines = ["* * * infinite-table.com * * *", ...lines];
29634
29638
  const max = Math.max(Math.max(...lines.map((l) => l.length)) + 4 * 2, 60);
@@ -29650,6 +29654,15 @@ var checkLicense = (licenseKey = "", packageInfo, fn) => {
29650
29654
  try {
29651
29655
  details = decode(licenseKey);
29652
29656
  } catch (ex) {
29657
+ if (!licenseKey) {
29658
+ if (fn) {
29659
+ fn(FREE_USAGE_MESSAGE);
29660
+ } else if (!freeUsageNoteLogged) {
29661
+ freeUsageNoteLogged = true;
29662
+ console.info(FREE_USAGE_MESSAGE);
29663
+ }
29664
+ return "invalid";
29665
+ }
29653
29666
  logLicenseError(
29654
29667
  [
29655
29668
  `You don't have a valid Infinite Table license`,
@@ -29726,8 +29739,8 @@ function getLicenseStatus(licenseKey = "", options) {
29726
29739
  return "valid";
29727
29740
  }
29728
29741
  const result = checkLicense(licenseKey, {
29729
- publishedAt: 1795784312033,
29730
- version: "11.0.1"
29742
+ publishedAt: 1796157962491,
29743
+ version: "11.0.3"
29731
29744
  });
29732
29745
  if (result === "invalid" && !licenseKey) {
29733
29746
  return "missing";
@@ -33238,7 +33251,7 @@ var DevToolsOverlay = createRuntimeFn({ defaultClassName: "_143ofgf0", variantCl
33238
33251
  var DevToolsOverlayBg = "_143ofgf5";
33239
33252
  var DevToolsOverlayText = "_143ofgf3";
33240
33253
 
33241
- // src/components/InfiniteTable/hooks/useDebugMode.ts
33254
+ // src/components/InfiniteTable/utils/devToolsConnection.ts
33242
33255
  var cssFileLoadedVarName = stripVar(ThemeVars.loaded);
33243
33256
  var messageBase = {
33244
33257
  source: "infinite-table-page",
@@ -33373,37 +33386,6 @@ var setupHook = once(() => {
33373
33386
  });
33374
33387
  return hookFn;
33375
33388
  });
33376
- function useDebugMode() {
33377
- const { getState, getDataSourceState, dataSourceActions } = useInfiniteTableSelector((ctx) => {
33378
- return {
33379
- getState: ctx.getState,
33380
- getDataSourceState: ctx.getDataSourceState,
33381
- dataSourceActions: ctx.dataSourceActions
33382
- };
33383
- });
33384
- const state = getState();
33385
- const { domRef, debugId } = state;
33386
- if (debugId) {
33387
- if (domRef.current) {
33388
- const value = getComputedStyle(domRef.current).getPropertyValue(
33389
- cssFileLoadedVarName
33390
- );
33391
- if (value !== `${CSS_LOADED_VALUE}`) {
33392
- logDevToolsWarning({
33393
- debugId,
33394
- key: "CSS001_CSS"
33395
- });
33396
- }
33397
- }
33398
- }
33399
- useEffect38(() => {
33400
- const dataSourceState = getDataSourceState();
33401
- if (dataSourceState.debugId !== debugId) {
33402
- dataSourceActions.debugId = debugId;
33403
- }
33404
- }, [debugId]);
33405
- return useDevTools();
33406
- }
33407
33389
  var HOOK_FN_SETUP_CALLBACK = buildSubscriptionCallback();
33408
33390
  var DEVTOOLS_MESSAGES = {
33409
33391
  revertAll: (payload) => {
@@ -33626,6 +33608,57 @@ function listenForDevTools() {
33626
33608
  }
33627
33609
  }
33628
33610
  listenForDevTools();
33611
+ function warnIfDevToolsCssNotLoaded(debugId, domNode) {
33612
+ if (!domNode) {
33613
+ return;
33614
+ }
33615
+ const value = getComputedStyle(domNode).getPropertyValue(cssFileLoadedVarName);
33616
+ if (value !== `${CSS_LOADED_VALUE}`) {
33617
+ logDevToolsWarning({
33618
+ debugId,
33619
+ key: "CSS001_CSS"
33620
+ });
33621
+ }
33622
+ }
33623
+ function getDevToolsHookFn() {
33624
+ return HOOK_FN_SETUP_CALLBACK.get();
33625
+ }
33626
+ function onDevToolsHookFn(fn) {
33627
+ return HOOK_FN_SETUP_CALLBACK.onChange((hookFn) => {
33628
+ if (hookFn) {
33629
+ fn(hookFn);
33630
+ }
33631
+ });
33632
+ }
33633
+ function disconnectFromDevTools(debugId) {
33634
+ const devtoolsHookFn = globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;
33635
+ if (devtoolsHookFn) {
33636
+ devtoolsHookFn(debugId, null);
33637
+ }
33638
+ }
33639
+
33640
+ // src/components/InfiniteTable/hooks/useDebugMode.ts
33641
+ function useDebugMode() {
33642
+ const { getState, getDataSourceState, dataSourceActions } = useInfiniteTableSelector((ctx) => {
33643
+ return {
33644
+ getState: ctx.getState,
33645
+ getDataSourceState: ctx.getDataSourceState,
33646
+ dataSourceActions: ctx.dataSourceActions
33647
+ };
33648
+ });
33649
+ const state = getState();
33650
+ const { domRef, debugId } = state;
33651
+ if (debugId) {
33652
+ warnIfDevToolsCssNotLoaded(debugId, domRef.current);
33653
+ }
33654
+ useEffect38(() => {
33655
+ const dataSourceState = getDataSourceState();
33656
+ if (dataSourceState.debugId !== debugId) {
33657
+ dataSourceActions.debugId = debugId;
33658
+ }
33659
+ }, [debugId]);
33660
+ return useDevTools();
33661
+ }
33629
33662
  function useDevTools() {
33630
33663
  const {
33631
33664
  getState,
@@ -33666,24 +33699,19 @@ function useDevTools() {
33666
33699
  dataSourceApi
33667
33700
  });
33668
33701
  };
33669
- const hookFn = HOOK_FN_SETUP_CALLBACK.get();
33702
+ const hookFn = getDevToolsHookFn();
33670
33703
  if (hookFn) {
33671
33704
  withHookFn(hookFn);
33672
33705
  return;
33673
33706
  }
33674
- return HOOK_FN_SETUP_CALLBACK.onChange((hookFn2) => {
33675
- if (!hookFn2) {
33676
- return;
33677
- }
33678
- withHookFn(hookFn2);
33679
- });
33707
+ return onDevToolsHookFn(withHookFn);
33680
33708
  }, []);
33681
33709
  useEffect38(() => {
33682
33710
  const debugId2 = debugIdRef.current;
33683
33711
  if (!debugId2) {
33684
33712
  return;
33685
33713
  }
33686
- const hookFn = HOOK_FN_SETUP_CALLBACK.get();
33714
+ const hookFn = getDevToolsHookFn();
33687
33715
  if (hookFn) {
33688
33716
  hookFn(debugId2, {
33689
33717
  getState,
@@ -33701,10 +33729,7 @@ function useDevTools() {
33701
33729
  return;
33702
33730
  }
33703
33731
  return () => {
33704
- const devtoolsHookFn = globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;
33705
- if (devtoolsHookFn) {
33706
- devtoolsHookFn(debugId, null);
33707
- }
33732
+ disconnectFromDevTools(debugId);
33708
33733
  };
33709
33734
  }, [debugId]);
33710
33735
  return debugId;