@sheetxl/grid-react 0.1.115 → 0.1.120

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.
@@ -0,0 +1,11 @@
1
+ # Repository Licensing
2
+
3
+ The SheetXL monorepo contains a mix of open-source and commercially licensed packages. Each package is individually licensed and contains its own license file.
4
+
5
+ For the specific terms and conditions applicable to a package, please see the `LICENSE.md` file located in that package's root directory.
6
+
7
+ Generally, packages intended for public distribution (such as CLIs, adapters, and vanilla wrappers) are licensed under the MIT license. All other core packages are proprietary and require a commercial license for use.
8
+
9
+ For more details on commercial licensing, please visit our website:
10
+
11
+ https://www.sheetxl.com/licensing-pricing
@@ -0,0 +1,9 @@
1
+ # Grid React
2
+
3
+ <a href="https://www.sheetxl.com" target="_blank" rel="noopener">
4
+ <img src="https://www.sheetxl.com/logo-text.svg" width="150" alt="SheetXL"/>
5
+ </a>
6
+
7
+ An advanced standalone data-grid component available for all [SheetXL](https://www.sheetxl.com) projects.
8
+
9
+ This package will generally not be used by itself but rather as a dependency of other packages.
@@ -1,6 +1,6 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._sheetxl-grid_11irg_13{position:relative;box-sizing:border-box;user-select:none}._sheetxl-grid_11irg_13 *{box-sizing:border-box!important}._sheetxl-grid_11irg_13 *:focus{outline:none}._sheetxl-grid_11irg_13 .cell-container{position:absolute;overflow:visible;white-space:pre}._sheetxl-grid_11irg_13 .cell-container>*{inset:0;position:absolute}._sheetxl-grid_11irg_13 .sheetxl-stage{contain:strict}._sheetxl-grid_11irg_13 .sheetxl-stage>*{contain:strict}")),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
2
2
  "use strict";/**
3
- * @license @sheetxl/grid-react - Grid - Advanced data grid component for React - v0.0.0
3
+ * @license @sheetxl/grid-react - Grid - Advanced data grid component for React - v0.1.119
4
4
  *
5
5
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
6
6
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -12,7 +12,7 @@ All copy and paste operations will be limited to the browser tab.`,Gr={Safari:`T
12
12
  Copy and paste will be limited to within the browser tab.
13
13
 
14
14
  Please use Chrome or Edge if external copy and paste is required.`,Perms:bo,PermsWrite:zn()===Dt.Safari?gr:bo,PermsRead:zn()===Dt.Safari?gr:bo},So=async()=>new Promise(e=>{document.hasFocus()?e():globalThis.addEventListener?.("focus",()=>{e()},{once:!0}),document.activeElement.focus?.()}),Eo=async(e,t,n)=>{if(zn()===Dt.Safari)return await n(new Error(Gr.Safari));try{const o=async l=>{try{return await l()}catch(s){if(s.message?.includes("Document is not focused"))return!1;throw s}},r=await globalThis?.navigator?.permissions?.query({name:e,allowWithoutGesture:!0,allowWithoutSanitization:!0});let i=!1;if(r.state==="prompt"&&(i=await o(t)),i||r.state!=="granted"||(i=await t()),!i)return await n(new Error(r.state))}catch(o){return o.message==="No valid data on clipboard"||o.name==="DataError"?void 0:await n(o)}},Zr=async e=>{try{return await e.read({unsanitized:[Lt]})}catch{}return await e.read()};if(!globalThis.ClipboardItem){const e=(n,o)=>new Blob([o],{type:n});class t{constructor(o,r){this._items={},this._types=Object.keys(o);const i={},l=Object.keys(o);for(let s=0;s<l.length;s++){const u=l[s];let d=o[u];i[u]=typeof d=="string"?e(u,d):d}this._items=i,this._presentationStyle=r?.presentationStyle??"unspecified"}get types(){return this._types}getType(o){return Promise.resolve(this._items[o])}supports(o){return!0}}globalThis.ClipboardItem=t}const Do=async(e,t=Lt)=>new Promise(async(n,o)=>{try{const r=await(async(i,l)=>{if(!i)return null;const s=await Zr(i);let u=!1;for(let d=0;!u&&s&&d<s.length;d++)if(u=s[d].types.includes(l),u)return await s[d].getType(l);return u?void 0:null})(e,t);if(r){const i=new FileReader;i.onload=()=>{n(i.result)},i.onerror=()=>{n("")},i.readAsText(r)}else n("")}catch(r){o(r)}}),wr=async(e,t=Lt)=>{const n=await Do(e,t);if(!n)return null;let o=null;try{o=new DOMParser().parseFromString(n,Lt)}catch{console.warn("Can't parse html from clipboard.")}return o},jn="clipboard-uuid",xn="web text/uuid",mr=e=>`<div style="display:none" ${jn}="${e}"/>`,Vi=(e,t)=>{let n=null;try{const o=new DOMParser().parseFromString(t,Lt);o.body.firstElementChild.setAttribute(jn,e),n=o.getElementsByTagName("body")[0].innerHTML}catch(o){console.warn("Can't embed uuid.",o)}return n},xr=(e,t)=>{if(!t||!e)return!1;try{const n=t.querySelectorAll(`[${jn}="${e}"]`);if(n&&n.length===1)return!0;if(t.querySelector("parsererror"))throw new Error("We are unable to parse node");return!1}catch{return!1}};let no=class{constructor(e){if(e?.nativeClipboard===void 0||e?.nativeClipboard===!0)try{this._nativeClipboard=globalThis?.navigator.clipboard}catch{e?.nativeClipboard===!0&&console.warn("NativeClipboard option set to true but no native clipboard available.")}else this._nativeClipboard=e?.nativeClipboard===!1?null:e?.nativeClipboard;this._disableCheckOnFocus=e?.disableCheckOnFocus??!1,this._init()}async _checkForChanges(){this._nativeClipboard&&this._state&&!this._disableCheckOnFocus&&await Eo("clipboard-read",async()=>{await So();const e=await Do(this._nativeClipboard,xn);if(!this._state||e&&e===this._state.uuid)return!0;const t=await wr(this._nativeClipboard,Lt);return!this._state||(xr(this._state.uuid,t)||this.clear(),!0)},async e=>{e?.message==="denied"||e.message?.includes("Document is not focused")||zn()===Dt.Safari||console.warn("Unable to detect clipboard changes: ",e)})}_init(){const e=this;this._listeners=new Map,this._listenersCapture=new Map,this._state=null,this._nativeClipboard&&(this._onFocus=()=>{e._checkForChanges()},this._onBlur=()=>{globalThis.addEventListener?.("focus",e._onFocus,{once:!0})},globalThis.addEventListener?.("blur",this._onBlur),this._nativeClipboard.addEventListener("clipboardchange",t=>{e._checkForChanges()}))}async read(){if(!this._nativeClipboard)return this._state?.items??null;const e=this;return await Eo("clipboard-read",async()=>{if(await So(),this._state?.uuid){const t=await Do(this._nativeClipboard,xn);if(t&&t===e._state.uuid)return!0;const n=await wr(this._nativeClipboard,Lt);if(xr(e._state?.uuid,n))return!0}return e._state={items:await Zr(this._nativeClipboard),uuid:null,ref:null},this.dispatchEvent(new Event("clipboardread")),!0},async t=>{this.dispatchEvent(new Event("clipboarderrorread"))}),this._state?.items??[]}async write(e){return this._write({uuid:Zn(),items:e,ref:null})}async _write(e){if(!this._nativeClipboard)return this._state=e,this.dispatchEvent(new Event("clipboardwrite")),this.dispatchEvent(new Event("clipboardchange")),null;const t=this,n=[],o=e.uuid;let r=e.items??[];const i=()=>{t._state={uuid:o,ref:e.ref,items:n},t.dispatchEvent(new Event("clipboardwrite")),t.dispatchEvent(new Event("clipboardchange"))};await Eo("clipboard-write",async()=>{await So(),o&&r.length===0&&(r.push(new ClipboardItem({[xn]:new Blob([o],{type:xn})})),r.push(new ClipboardItem({[Lt]:new Blob([mr(o)],{type:Lt})})));for(let l=0;l<Math.min(1,r.length);l++){const s=r[l];let u=s.types.indexOf(Lt),d=null;if(u!==-1){const p=await s.getType(Lt);d=await Lo(p),d&&(d=Vi(o,d))}if(!d&&s.types.includes(rn)){const p=await s.getType(rn);if(p){let y=null;typeof p=="string"?(console.warn("text as string",p),y=p):y=await Lo(p),y&&(d=`<div ${jn}="${o}">${y}</div>`)}}if(!d&&s.types.includes(xo)){const p=await s.getType(xo),y=Kr(await p.arrayBuffer());d=`<div ${jn}="${o}"><img src="${Xr+y}"/></div>`}!d&&o&&(d=mr(o));const w=new Blob([d??""],{type:Lt}),x={};for(let p=0;p<s.types.length;p++){const y=s.types[p];x[y]=p===u?w:s.getType(y)}d&&u===-1&&(x[Lt]=w),o&&(x[xn]=new Blob([o],{type:xn})),n.push(new ClipboardItem(x))}try{n&&n.length!==0?await this._nativeClipboard.write(n):await(async l=>{l&&await l.writeText("")})(this._nativeClipboard)}catch(l){l.message?.includes("Document is not focused")||console.warn("Unable to write to native clipboard: ",l)}return i(),!0},async l=>{this.dispatchEvent(new Event("clipboarderrorwrite")),i()})}async writeReference(e){if(!e)return void this.clear();let t=null;const n={};try{const r=await e.toText?.()??null;r&&(n[rn]=new Blob([r??""],{type:rn}))}catch(r){t=r}try{const r=await e.toHtml?.()??null;r&&(n[Lt]=new Blob([r],{type:Lt}))}catch(r){t=r,console.warn("export to html",r)}try{const r=await e.toImage?.()??null;r&&(n[xo]=r)}catch(r){t=r,console.warn("export to png",r)}const o=this._write({uuid:Zn(),ref:e,items:Object.keys(n).length>0?[new ClipboardItem(n)]:null});if(t)throw t;return o}clear(e=!1){this._state&&(this._state=null,e&&this._write({uuid:null,ref:null,items:null}),this.dispatchEvent(new Event("clipboardwrite")),this.dispatchEvent(new Event("clipboardchange")))}async readReference(){return await this.read(),this._state?.ref??null}readText(){return new Promise(async(e,t)=>{const n=await this.read();let o=null;for(let i=0;!o&&n&&i<n.length;i++)n[i].types.includes(rn)&&(o=await n[i].getType(rn));if(!o)return void e("");const r=new FileReader;r.onload=()=>{e(r.result)},r.readAsText(o),r.onerror=i=>{t(i)}})}async writeText(e){const t=[new ClipboardItem({[rn]:new Blob([e],{type:rn})})];return this._write({uuid:Zn(),items:t,ref:null})}addEventListener(e,t,n={}){const o=n?.capture?this._listenersCapture:this._listeners;let r=o.get(e);r||(r=new Map,o.set(e,r)),r.set(t,typeof n=="boolean"?{}:n)}dispatchEvent(e){if(!e)return;const t=n=>{const o=n.get(e.type);o&&o.forEach((r,i)=>{try{typeof i=="function"?i(e):i.handleEvent&&i.handleEvent(e),r.once&&o.delete(i)}catch(l){console.warn(l)}})};return t(this._listenersCapture),t(this._listeners),!0}removeEventListener(e,t,n){const o=n?.capture?this._listenersCapture:this._listeners,r=o.get(e);r&&(r.delete(t),r.size===0&&o.delete(e))}close(){globalThis.removeEventListener?.("focus",this._onFocus),globalThis.removeEventListener?.("blur",this._onBlur)}};var _o;(_o=no||(no={})).ErrorMessages=Gr,_o.Global=new _o,function(){try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._sheetxl-scrollbar_18qzf_11 ::-webkit-scrollbar-button{background:transparent}._fullscreen-portal-root_5qk7s_7{pointer-events:none;position:absolute;inset:0;width:100%;height:100%;z-index:1200}._fullscreen-portal-root_5qk7s_7>*{pointer-events:auto}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();/**
15
- * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.1.95
15
+ * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.1.119
16
16
  *
17
17
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
18
18
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -4,13 +4,13 @@ import Sn, { memo as Dt, useCallback as O, useRef as J, useEffect as st, useImpe
4
4
  import { createRoot as Oi } from "react-dom/client";
5
5
  import { unstable_batchedUpdates as Li, createPortal as Kr } from "react-dom";
6
6
  /**
7
- * @license @sheetxl/grid-react - Grid - Advanced data grid component for React - v0.0.0
7
+ * @license @sheetxl/grid-react - Grid - Advanced data grid component for React - v0.1.119
8
8
  *
9
9
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
10
10
  * License: The license can be found at https://www.sheetxl.com/license.
11
11
  */
12
12
  /**
13
- * @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.1.93
13
+ * @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.1.119
14
14
  *
15
15
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
16
16
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -823,7 +823,7 @@ var Lo;
823
823
  }
824
824
  }();
825
825
  /**
826
- * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.1.95
826
+ * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.1.119
827
827
  *
828
828
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
829
829
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -1,18 +1,46 @@
1
1
  Name: @sheetxl/utils
2
- Version: 0.1.93
2
+ Version: 0.1.119
3
3
  License: SEE LICENSE IN <LICENSE>
4
4
  Private: false
5
5
  Description: Utils - Utilities used by most SheetXL components.
6
6
  Author: Michael T Ford
7
+ License Copyright:
8
+ ===
9
+
10
+ # Repository Licensing
11
+
12
+ The SheetXL monorepo contains a mix of open-source and commercially licensed packages. Each package is individually licensed and contains its own license file.
13
+
14
+ For the specific terms and conditions applicable to a package, please see the `LICENSE.md` file located in that package's root directory.
15
+
16
+ Generally, packages intended for public distribution (such as CLIs, adapters, and vanilla wrappers) are licensed under the MIT license. All other core packages are proprietary and require a commercial license for use.
17
+
18
+ For more details on commercial licensing, please visit our website:
19
+
20
+ https://www.sheetxl.com/licensing-pricing
7
21
 
8
22
  ---
9
23
 
10
24
  Name: @sheetxl/utils-react
11
- Version: 0.1.95
25
+ Version: 0.1.119
12
26
  License: SEE LICENSE IN <LICENSE>
13
27
  Private: false
14
28
  Description: Utils React - Utilities for React capabilities needed for all SheetXL components.
15
29
  Author: Michael T Ford
30
+ License Copyright:
31
+ ===
32
+
33
+ # Repository Licensing
34
+
35
+ The SheetXL monorepo contains a mix of open-source and commercially licensed packages. Each package is individually licensed and contains its own license file.
36
+
37
+ For the specific terms and conditions applicable to a package, please see the `LICENSE.md` file located in that package's root directory.
38
+
39
+ Generally, packages intended for public distribution (such as CLIs, adapters, and vanilla wrappers) are licensed under the MIT license. All other core packages are proprietary and require a commercial license for use.
40
+
41
+ For more details on commercial licensing, please visit our website:
42
+
43
+ https://www.sheetxl.com/licensing-pricing
16
44
 
17
45
  ---
18
46
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/grid-react - Grid - Advanced data grid component for React - v0.0.0
2
+ * @license @sheetxl/grid-react - Grid - Advanced data grid component for React - v0.1.119
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -13,7 +13,7 @@ import { createRoot as x } from "react-dom/client";
13
13
  import { unstable_batchedUpdates as y, createPortal as v } from "react-dom";
14
14
  import b from "tiny-invariant";
15
15
  /**
16
- * @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.1.93
16
+ * @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.1.119
17
17
  *
18
18
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
19
19
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -845,7 +845,7 @@ const ft = Object.freeze(Object.defineProperty({ __proto__: null, deviceType: ut
845
845
  return r2;
846
846
  };
847
847
  /**
848
- * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.1.95
848
+ * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.1.119
849
849
  *
850
850
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
851
851
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sheetxl/grid-react",
3
3
  "description": "Grid - Advanced data grid component for React",
4
- "version": "0.1.115",
4
+ "version": "0.1.120",
5
5
  "license": "SEE LICENSE IN <LICENSE>",
6
6
  "type": "module",
7
7
  "exports": {
@@ -34,12 +34,12 @@
34
34
  "table"
35
35
  ],
36
36
  "dependencies": {
37
+ "@sheetxl/utils": "^0.1.119",
38
+ "@sheetxl/utils-react": "^0.1.119",
37
39
  "clsx": "^2.1.1",
38
40
  "react-merge-refs": "^3.0.2",
39
41
  "react-use": "^17.6.0",
40
- "tiny-invariant": "^1.3.3",
41
- "@sheetxl/utils": "^0.0.0",
42
- "@sheetxl/utils-react": "^0.0.0"
42
+ "tiny-invariant": "^1.3.3"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "react": "^19.1.0",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sheetxl/grid-react",
3
3
  "description": "Grid - Advanced data grid component for React",
4
- "version": "0.1.115",
4
+ "version": "0.1.120",
5
5
  "license": "SEE LICENSE IN <LICENSE>",
6
6
  "author": "Michael T Ford",
7
7
  "private": false,
@@ -28,8 +28,8 @@
28
28
  "react-merge-refs": "^3.0.2",
29
29
  "react-use": "^17.6.0",
30
30
  "tiny-invariant": "^1.3.3",
31
- "@sheetxl/utils-react": "0.1.115",
32
- "@sheetxl/utils": "0.1.115"
31
+ "@sheetxl/utils": "0.1.120",
32
+ "@sheetxl/utils-react": "0.1.120"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "react": "^19.1.0",