@infinite-table/infinite-react 0.2.8 → 0.2.9

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.
Files changed (4) hide show
  1. package/index.d.ts +951 -3219
  2. package/index.esm.js +28 -19
  3. package/index.js +28 -19
  4. package/package.json +2 -2
package/index.esm.js CHANGED
@@ -193,11 +193,11 @@ var require_common = __commonJS({
193
193
  let enableOverride = null;
194
194
  let namespacesCache;
195
195
  let enabledCache;
196
- function debug6(...args) {
197
- if (!debug6.enabled) {
196
+ function debug7(...args) {
197
+ if (!debug7.enabled) {
198
198
  return;
199
199
  }
200
- const self = debug6;
200
+ const self = debug7;
201
201
  const curr = Number(new Date());
202
202
  const ms = curr - (prevTime || curr);
203
203
  self.diff = ms;
@@ -227,12 +227,12 @@ var require_common = __commonJS({
227
227
  const logFn = self.log || createDebug.log;
228
228
  logFn.apply(self, args);
229
229
  }
230
- debug6.namespace = namespace;
231
- debug6.useColors = createDebug.useColors();
232
- debug6.color = createDebug.selectColor(namespace);
233
- debug6.extend = extend;
234
- debug6.destroy = createDebug.destroy;
235
- Object.defineProperty(debug6, "enabled", {
230
+ debug7.namespace = namespace;
231
+ debug7.useColors = createDebug.useColors();
232
+ debug7.color = createDebug.selectColor(namespace);
233
+ debug7.extend = extend;
234
+ debug7.destroy = createDebug.destroy;
235
+ Object.defineProperty(debug7, "enabled", {
236
236
  enumerable: true,
237
237
  configurable: false,
238
238
  get: () => {
@@ -250,9 +250,9 @@ var require_common = __commonJS({
250
250
  }
251
251
  });
252
252
  if (typeof createDebug.init === "function") {
253
- createDebug.init(debug6);
253
+ createDebug.init(debug7);
254
254
  }
255
- return debug6;
255
+ return debug7;
256
256
  }
257
257
  function extend(namespace, delimiter) {
258
258
  const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
@@ -7392,11 +7392,12 @@ var VirtualBrain = class extends Logger {
7392
7392
 
7393
7393
  // src/components/InfiniteTable/hooks/useColumnSizeFn.ts
7394
7394
  import { useCallback as useCallback16 } from "react";
7395
+ var debug5 = dbg("useColumnSizeFn");
7395
7396
  function useColumnSizeFn(computedUnpinnedColumns) {
7396
7397
  const columnSize = useCallback16((index) => {
7397
7398
  const column = computedUnpinnedColumns[index];
7398
7399
  if (!column) {
7399
- console.log("cannot find column at index", index, computedUnpinnedColumns);
7400
+ debug5("cannot find column at index", index, computedUnpinnedColumns);
7400
7401
  }
7401
7402
  return column ? column.computedWidth : 0;
7402
7403
  }, [computedUnpinnedColumns]);
@@ -7816,17 +7817,25 @@ var decode = (licenseKey) => {
7816
7817
  };
7817
7818
 
7818
7819
  // src/components/InfiniteTable/hooks/useLicense/useLicense.ts
7819
- var SANDBOX_REGEX = /(https):\/\/\d+\-\d+\-\d\-(sandpack\.codesandbox\.io)/g;
7820
+ var SANDPACK_REGEX = /(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g;
7821
+ var SANDBOX_REGEX = /(https):\/\/\S+(\.csb\.app)/g;
7820
7822
  var origin = typeof window !== "undefined" ? window.location.origin : "";
7821
- var [_fullUrl, protocol, sandboxUrl] = Array.from(SANDBOX_REGEX.exec(origin) || []);
7822
- var isInsideSandbox = protocol === "https" && sandboxUrl === "sandpack.codesandbox.io";
7823
+ var isInsideSandpack = () => {
7824
+ const [_fullUrl, protocol, sandpackUrl] = Array.from(SANDPACK_REGEX.exec(origin) || []);
7825
+ return protocol === "https" && sandpackUrl === "sandpack.codesandbox.io";
7826
+ };
7827
+ var isInsideSandbox = () => {
7828
+ const [_fullUrl, protocol, sandboxUrl] = Array.from(SANDBOX_REGEX.exec(origin) || []);
7829
+ return protocol === "https" && sandboxUrl === ".csb.app";
7830
+ };
7831
+ var isInsidePlayground = isInsideSandbox() || isInsideSandpack();
7823
7832
  var useLicense = (licenseKey = "") => {
7824
7833
  const valid = useMemo13(() => {
7825
7834
  let valid2 = isValidLicense(licenseKey, {
7826
7835
  publishedAt: 1624970570587,
7827
- version: "0.2.8"
7836
+ version: "0.2.9"
7828
7837
  });
7829
- if (!licenseKey && !valid2 && isInsideSandbox) {
7838
+ if (!licenseKey && !valid2 && isInsidePlayground) {
7830
7839
  return true;
7831
7840
  }
7832
7841
  return valid2;
@@ -7842,7 +7851,7 @@ import {
7842
7851
  } from "react";
7843
7852
  import { useRef as useRef19 } from "react";
7844
7853
  var error = err("CSSVariableWatch");
7845
- var debug5 = dbg("CSSVariableWatch");
7854
+ var debug6 = dbg("CSSVariableWatch");
7846
7855
  var WRAPPER_STYLE = {
7847
7856
  position: "absolute",
7848
7857
  pointerEvents: "none",
@@ -7865,7 +7874,7 @@ var useCSSVariableWatch = (params) => {
7865
7874
  const value = params.ref.current.getBoundingClientRect().height;
7866
7875
  if (value) {
7867
7876
  lastValueRef.current = value;
7868
- debug5(`Variable ${params.varName} found and equals ${value}.`);
7877
+ debug6(`Variable ${params.varName} found and equals ${value}.`);
7869
7878
  params.onChange(value);
7870
7879
  } else {
7871
7880
  error(`Specified variable ${params.varName} not found or does not have a numeric value.`);
package/index.js CHANGED
@@ -198,11 +198,11 @@ var require_common = __commonJS({
198
198
  let enableOverride = null;
199
199
  let namespacesCache;
200
200
  let enabledCache;
201
- function debug6(...args) {
202
- if (!debug6.enabled) {
201
+ function debug7(...args) {
202
+ if (!debug7.enabled) {
203
203
  return;
204
204
  }
205
- const self = debug6;
205
+ const self = debug7;
206
206
  const curr = Number(new Date());
207
207
  const ms = curr - (prevTime || curr);
208
208
  self.diff = ms;
@@ -232,12 +232,12 @@ var require_common = __commonJS({
232
232
  const logFn = self.log || createDebug.log;
233
233
  logFn.apply(self, args);
234
234
  }
235
- debug6.namespace = namespace;
236
- debug6.useColors = createDebug.useColors();
237
- debug6.color = createDebug.selectColor(namespace);
238
- debug6.extend = extend;
239
- debug6.destroy = createDebug.destroy;
240
- Object.defineProperty(debug6, "enabled", {
235
+ debug7.namespace = namespace;
236
+ debug7.useColors = createDebug.useColors();
237
+ debug7.color = createDebug.selectColor(namespace);
238
+ debug7.extend = extend;
239
+ debug7.destroy = createDebug.destroy;
240
+ Object.defineProperty(debug7, "enabled", {
241
241
  enumerable: true,
242
242
  configurable: false,
243
243
  get: () => {
@@ -255,9 +255,9 @@ var require_common = __commonJS({
255
255
  }
256
256
  });
257
257
  if (typeof createDebug.init === "function") {
258
- createDebug.init(debug6);
258
+ createDebug.init(debug7);
259
259
  }
260
- return debug6;
260
+ return debug7;
261
261
  }
262
262
  function extend(namespace, delimiter) {
263
263
  const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
@@ -7304,11 +7304,12 @@ var VirtualBrain = class extends Logger {
7304
7304
 
7305
7305
  // src/components/InfiniteTable/hooks/useColumnSizeFn.ts
7306
7306
  var import_react39 = __toModule(require("react"));
7307
+ var debug5 = dbg("useColumnSizeFn");
7307
7308
  function useColumnSizeFn(computedUnpinnedColumns) {
7308
7309
  const columnSize = (0, import_react39.useCallback)((index) => {
7309
7310
  const column = computedUnpinnedColumns[index];
7310
7311
  if (!column) {
7311
- console.log("cannot find column at index", index, computedUnpinnedColumns);
7312
+ debug5("cannot find column at index", index, computedUnpinnedColumns);
7312
7313
  }
7313
7314
  return column ? column.computedWidth : 0;
7314
7315
  }, [computedUnpinnedColumns]);
@@ -7723,17 +7724,25 @@ var decode = (licenseKey) => {
7723
7724
  };
7724
7725
 
7725
7726
  // src/components/InfiniteTable/hooks/useLicense/useLicense.ts
7726
- var SANDBOX_REGEX = /(https):\/\/\d+\-\d+\-\d\-(sandpack\.codesandbox\.io)/g;
7727
+ var SANDPACK_REGEX = /(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g;
7728
+ var SANDBOX_REGEX = /(https):\/\/\S+(\.csb\.app)/g;
7727
7729
  var origin = typeof window !== "undefined" ? window.location.origin : "";
7728
- var [_fullUrl, protocol, sandboxUrl] = Array.from(SANDBOX_REGEX.exec(origin) || []);
7729
- var isInsideSandbox = protocol === "https" && sandboxUrl === "sandpack.codesandbox.io";
7730
+ var isInsideSandpack = () => {
7731
+ const [_fullUrl, protocol, sandpackUrl] = Array.from(SANDPACK_REGEX.exec(origin) || []);
7732
+ return protocol === "https" && sandpackUrl === "sandpack.codesandbox.io";
7733
+ };
7734
+ var isInsideSandbox = () => {
7735
+ const [_fullUrl, protocol, sandboxUrl] = Array.from(SANDBOX_REGEX.exec(origin) || []);
7736
+ return protocol === "https" && sandboxUrl === ".csb.app";
7737
+ };
7738
+ var isInsidePlayground = isInsideSandbox() || isInsideSandpack();
7730
7739
  var useLicense = (licenseKey = "") => {
7731
7740
  const valid = (0, import_react43.useMemo)(() => {
7732
7741
  let valid2 = isValidLicense(licenseKey, {
7733
7742
  publishedAt: 1624970570587,
7734
- version: "0.2.8"
7743
+ version: "0.2.9"
7735
7744
  });
7736
- if (!licenseKey && !valid2 && isInsideSandbox) {
7745
+ if (!licenseKey && !valid2 && isInsidePlayground) {
7737
7746
  return true;
7738
7747
  }
7739
7748
  return valid2;
@@ -7745,7 +7754,7 @@ var useLicense = (licenseKey = "") => {
7745
7754
  var React32 = __toModule(require("react"));
7746
7755
  var import_react44 = __toModule(require("react"));
7747
7756
  var error = err("CSSVariableWatch");
7748
- var debug5 = dbg("CSSVariableWatch");
7757
+ var debug6 = dbg("CSSVariableWatch");
7749
7758
  var WRAPPER_STYLE = {
7750
7759
  position: "absolute",
7751
7760
  pointerEvents: "none",
@@ -7768,7 +7777,7 @@ var useCSSVariableWatch = (params) => {
7768
7777
  const value = params.ref.current.getBoundingClientRect().height;
7769
7778
  if (value) {
7770
7779
  lastValueRef.current = value;
7771
- debug5(`Variable ${params.varName} found and equals ${value}.`);
7780
+ debug6(`Variable ${params.varName} found and equals ${value}.`);
7772
7781
  params.onChange(value);
7773
7782
  } else {
7774
7783
  error(`Specified variable ${params.varName} not found or does not have a numeric value.`);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@infinite-table/infinite-react",
3
3
  "description": "Infinite Table for React",
4
- "version": "0.2.8",
4
+ "version": "0.2.9",
5
5
  "main": "index.js",
6
6
  "module": "index.esm.js",
7
7
  "typings": "index.d.ts",
@@ -14,5 +14,5 @@
14
14
  },
15
15
  "license": "Commercial & Open Source",
16
16
  "//": "will be updated at build time",
17
- "publishedAt": 1645485108085
17
+ "publishedAt": 1646311895842
18
18
  }