@opencorestack/opengridx 3.2.1 → 3.2.2

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.
@@ -10,7 +10,7 @@ const COMFORTABLE_ROW_HEIGHT = 72;
10
10
  /** A theme height in pixels (`'36px'` or `'36'`); anything else (rem, calc, …) is ignored. */
11
11
  export function parseThemePixels(value: string | undefined): number | undefined {
12
12
  if (value === undefined) return undefined;
13
- const match = /^\s*(\d+(?:\.\d+)?)\s*(px)?\s*$/.exec(value);
13
+ const match = /^(\d+(?:\.\d+)?)(?:\s*px)?$/.exec(value.trim());
14
14
  if (!match) return undefined;
15
15
  const px = Number(match[1]);
16
16
  return px > 0 ? px : undefined;
@@ -29,7 +29,7 @@ function measureCell(cell: HTMLElement, content: HTMLElement): number {
29
29
  * hidden by a row span are skipped. Returns null when nothing of the column is rendered.
30
30
  */
31
31
  export function measureColumnContentWidth(root: HTMLElement, field: string): number | null {
32
- const escaped = typeof CSS !== 'undefined' && CSS.escape ? CSS.escape(field) : field.replace(/"/g, '\\"');
32
+ const escaped = typeof CSS !== 'undefined' && CSS.escape ? CSS.escape(field) : field.replace(/["\\]/g, '\\$&');
33
33
  const ownedByRoot = (el: Element) => el.closest(ROOT_SELECTOR) === root;
34
34
  let width: number | null = null;
35
35
  const take = (w: number) => { width = width === null ? w : Math.max(width, w); };
@@ -147,7 +147,7 @@ export function pickExportedAggregates<R extends GridRowModel>(
147
147
  const FORMULA_TRIGGER = /^[=+\-@\t\r]/;
148
148
  // Optional sign, then only digits, separators and whitespace (\s includes NBSP and U+202F):
149
149
  // such text cannot reference cells or call functions.
150
- const PLAIN_NUMBER = /^[-+]?[\d.,\s]*\d[\d.,\s]*%?$/;
150
+ const PLAIN_NUMBER = /^[-+]?(?=[\d.,\s]*\d)[\d.,\s]*%?$/;
151
151
 
152
152
  /**
153
153
  * Neutralise spreadsheet formula injection (CSV injection). Text that starts with `=`, `+`, `-`,
@@ -173,6 +173,15 @@ export function escapeHTML(value: string): string {
173
173
  .replace(/'/g, '&#039;');
174
174
  }
175
175
 
176
+ /** Drops leading and trailing apostrophes (a loop, not a regex: `/'+$/` backtracks on long runs). */
177
+ function stripApostrophes(text: string): string {
178
+ let start = 0;
179
+ let end = text.length;
180
+ while (start < end && text[start] === "'") start++;
181
+ while (end > start && text[end - 1] === "'") end--;
182
+ return text.slice(start, end);
183
+ }
184
+
176
185
  const INVALID_SHEET_CHARS = /[\\/?*:[\]]/g;
177
186
  const MAX_SHEET_NAME = 31;
178
187
 
@@ -183,7 +192,7 @@ const MAX_SHEET_NAME = 31;
183
192
  * name is added to `used`.
184
193
  */
185
194
  export function sanitizeSheetName(name: string | undefined, used: Set<string> = new Set()): string {
186
- let base = String(name ?? '').replace(INVALID_SHEET_CHARS, '-').trim().replace(/^'+|'+$/g, '').trim();
195
+ let base = stripApostrophes(String(name ?? '').replace(INVALID_SHEET_CHARS, '-').trim()).trim();
187
196
  if (!base) base = 'Sheet';
188
197
  base = base.slice(0, MAX_SHEET_NAME).trim();
189
198
  const taken = (candidate: string) => used.has(candidate.toLowerCase()) || candidate.toLowerCase() === 'history';
package/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # OpenGridX — AI Agent Context
2
2
  # Package: @opencorestack/opengridx
3
- # Version: 3.2.1
3
+ # Version: 3.2.2
4
4
  # Docs: https://opencorestack.github.io/OpenGridX/
5
5
  # This file is machine-readable. AI developers: start here.
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencorestack/opengridx",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "description": "OpenGridX: High-performance React data infrastructure. Unlock advanced Row Grouping, Excel Export, and Column Pinning without the usual \"Pro\" gatekeeping. Built for speed, scale, and complete architectural freedom. Fully open, virtualization-ready, and feature-complete.",
5
5
  "type": "module",
6
6
  "main": "./dist/opengridx.umd.js",
@@ -120,6 +120,7 @@
120
120
  "eslint": "^9.39.1",
121
121
  "eslint-plugin-react-hooks": "^7.0.1",
122
122
  "eslint-plugin-react-refresh": "^0.4.24",
123
+ "exceljs": "^4.4.0",
123
124
  "globals": "^16.5.0",
124
125
  "jsdom": "^29.1.1",
125
126
  "jspdf": "^4.2.1",
@@ -133,5 +134,8 @@
133
134
  "vite": "^7.2.4",
134
135
  "vite-plugin-dts": "^4.5.4",
135
136
  "vitest": "^4.1.11"
137
+ },
138
+ "overrides": {
139
+ "uuid": "^11.1.1"
136
140
  }
137
141
  }