@sheetxl/react 0.6.18 → 0.6.20
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/browser/cjs/{FsSILTL8Vc_EbUVs.cjs → DlC6iWL58Q1E_ugZ.cjs} +1 -1
- package/browser/cjs/{t0FKf7ytJSklun3L.cjs → fl8r4LMfnThFQFFS.cjs} +1 -1
- package/browser/cjs/index.cjs +8 -8
- package/browser/cjs/{C4SL8-6D_tlkDBCf.cjs → pg2J19CazMSu3JDD.cjs} +1 -1
- package/browser/esm/{CyhtUECczvbpv4vy.mjs → BOHKrMtUTuwwUvqU.mjs} +1 -1
- package/browser/esm/{BmKv24az-HnDGyjD.mjs → Bi3KhGw_0O5g9Clj.mjs} +1 -1
- package/browser/esm/{BRm5kJ6lgI-iuCb1.mjs → Bxhh5X3s2fFAnEV4.mjs} +1 -1
- package/browser/esm/index.mjs +273 -275
- package/node/esm/{C6ZIlg3sg-bFT1k4.mjs → BnHx9Zuwgc6znz2n.mjs} +1 -1
- package/node/esm/index.mjs +22 -24
- package/package.json +5 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.6.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.6.20
|
|
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.
|
package/node/esm/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.6.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.6.20
|
|
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.
|
|
@@ -2185,7 +2185,7 @@ const Rt = (e2, t2, o2 = null) => {
|
|
|
2185
2185
|
Ce2.current = true;
|
|
2186
2186
|
const e3 = Q.lazy(async () => {
|
|
2187
2187
|
try {
|
|
2188
|
-
const e4 = await import("./
|
|
2188
|
+
const e4 = await import("./BnHx9Zuwgc6znz2n.mjs");
|
|
2189
2189
|
return Ce2.current = false, be2.current = true, R2([...k2]), e4;
|
|
2190
2190
|
} catch (e4) {
|
|
2191
2191
|
return console.warn(e4), _2.current?.(false), null;
|
|
@@ -3107,11 +3107,9 @@ const sn = (e2) => {
|
|
|
3107
3107
|
}, dn = () => {
|
|
3108
3108
|
const e2 = he(an), [t2] = oe(() => new y());
|
|
3109
3109
|
return te(() => e2 || t2, [e2]);
|
|
3110
|
-
}, cn = "_script-editor_iy654_5", gn =
|
|
3110
|
+
}, cn = "_script-editor_iy654_5", gn = { lightbulb: { enabled: false }, tabSize: 2, acceptSuggestionOnCommitCharacter: true, acceptSuggestionOnEnter: "on", accessibilitySupport: "auto", automaticLayout: true, autoIndent: false, codeLens: true, colorDecorators: true, contextmenu: true, cursorBlinking: "blink", cursorSmoothCaretAnimation: false, cursorStyle: "line", disableLayerHinting: false, disableMonospaceOptimizations: false, dragAndDrop: true, glyphMargin: true, fixedOverflowWidgets: false, folding: true, foldingStrategy: "auto", fontLigatures: false, formatOnPaste: true, formatOnType: false, hideCursorInOverviewRuler: false, highlightActiveIndentGuide: true, links: true, lineDecorationsWidth: 8, lineNumbersMinChars: 3, mouseWheelZoom: false, multiCursorMergeOverlapping: true, multiCursorModifier: "alt", overviewRulerBorder: true, overviewRulerLanes: 2, quickSuggestions: true, quickSuggestionsDelay: 100, readOnly: false, renderControlCharacters: false, renderFinalNewline: true, renderIndentGuides: true, renderLineHighlight: "all", renderWhitespace: "none", revealHorizontalRightPadding: 30, roundedSelection: true, rulers: [], scrollBeyondLastColumn: 5, scrollBeyondLastLine: true, selectOnLineNumbers: true, selectionClipboard: true, selectionHighlight: true, showLightbulbIconMode: false, showFoldingControls: "mouseover", smoothScrolling: true, suggestOnTriggerCharacters: true, wordBasedSuggestions: true, wordSeparators: `~!@#$%^&*()-=+[{]}|;:'",.<>/?`, wordWrap: "off", wordWrapBreakAfterCharacters: " })]?|&,;", wordWrapBreakBeforeCharacters: "{([+", wordWrapBreakObtrusiveCharacters: ".", wordWrapColumn: 80, wordWrapMinified: true, wrappingIndent: "none" }, un = Q.lazy(() => import("@monaco-editor/react"));
|
|
3111
3111
|
let hn, mn, pn = ["define", "require"], fn = false;
|
|
3112
|
-
const wn =
|
|
3113
|
-
console.log("loading", wn);
|
|
3114
|
-
const qn = wn, vn = async (e2, t2, o2) => {
|
|
3112
|
+
const wn = async (e2, t2, o2) => {
|
|
3115
3113
|
const n2 = e2.getModel();
|
|
3116
3114
|
if (!n2) return;
|
|
3117
3115
|
const l2 = await t2.languages.typescript.getTypeScriptWorker(), r2 = await l2(n2.uri), i2 = await r2.getNavigationTree(n2.uri.toString()), a2 = e2.getPosition();
|
|
@@ -3120,8 +3118,8 @@ const qn = wn, vn = async (e2, t2, o2) => {
|
|
|
3120
3118
|
let d2 = false;
|
|
3121
3119
|
for (let e3 = a2.lineNumber; e3 >= 1; e3--) {
|
|
3122
3120
|
if ("" === n2.getLineContent(e3).trim()) {
|
|
3123
|
-
const t3 =
|
|
3124
|
-
if (!t3 ||
|
|
3121
|
+
const t3 = yn(i2, n2.getOffsetAt({ lineNumber: e3, column: 1 }), "function");
|
|
3122
|
+
if (!t3 || Cn(t3)) {
|
|
3125
3123
|
d2 = true, s2.lineNumber = e3 + 1;
|
|
3126
3124
|
break;
|
|
3127
3125
|
}
|
|
@@ -3139,7 +3137,7 @@ const qn = wn, vn = async (e2, t2, o2) => {
|
|
|
3139
3137
|
let m2 = null;
|
|
3140
3138
|
n2.pushEditOperations([], h2, (e3) => (m2 = e3[0].range, g2 && m2.startLineNumber++, u2 && m2.endLineNumber--, [new t2.Selection(m2.startLineNumber, m2.startColumn, m2.endLineNumber, m2.endColumn)])), e2.setSelection({ startLineNumber: m2.endLineNumber, startColumn: m2.endColumn, endLineNumber: m2.startLineNumber, endColumn: m2.startColumn });
|
|
3141
3139
|
};
|
|
3142
|
-
function
|
|
3140
|
+
function qn(e2, t2) {
|
|
3143
3141
|
let o2 = null;
|
|
3144
3142
|
const n2 = e2.length;
|
|
3145
3143
|
for (let l2 = 0; !o2 && l2 < n2; l2++) {
|
|
@@ -3148,32 +3146,32 @@ function yn(e2, t2) {
|
|
|
3148
3146
|
}
|
|
3149
3147
|
return o2 ? o2.getContext() : "formula";
|
|
3150
3148
|
}
|
|
3151
|
-
function
|
|
3149
|
+
function vn(e2, t2, o2, n2, l2 = []) {
|
|
3152
3150
|
if ("function" === n2.kind && "export" === n2.kindModifiers) {
|
|
3153
3151
|
const t3 = n2.spans[0].start, r2 = e2.getPositionAt(t3);
|
|
3154
|
-
l2.push({ name: n2.text, type:
|
|
3152
|
+
l2.push({ name: n2.text, type: qn(o2, n2), lineNumber: r2.lineNumber });
|
|
3155
3153
|
}
|
|
3156
|
-
if (n2.childItems) for (const r2 of n2.childItems)
|
|
3154
|
+
if (n2.childItems) for (const r2 of n2.childItems) vn(e2, t2, o2, r2, l2);
|
|
3157
3155
|
return l2;
|
|
3158
3156
|
}
|
|
3159
|
-
function
|
|
3157
|
+
function yn(e2, t2, o2 = "function", n2) {
|
|
3160
3158
|
const l2 = e2.spans, r2 = l2.length;
|
|
3161
3159
|
for (let i2 = 0; i2 < r2; i2++) {
|
|
3162
3160
|
const r3 = l2[i2];
|
|
3163
3161
|
if (r3.start <= t2 && t2 < r3.start + r3.length) {
|
|
3164
3162
|
if (e2.kind === o2 && (!n2 || e2.kindModifiers === n2)) return e2;
|
|
3165
3163
|
for (const l3 of e2.childItems || []) {
|
|
3166
|
-
const e3 =
|
|
3164
|
+
const e3 = yn(l3, t2, o2, n2);
|
|
3167
3165
|
if (e3) return e3;
|
|
3168
3166
|
}
|
|
3169
3167
|
}
|
|
3170
3168
|
return null;
|
|
3171
3169
|
}
|
|
3172
3170
|
}
|
|
3173
|
-
function
|
|
3171
|
+
function Cn(e2) {
|
|
3174
3172
|
return "comment" === e2.kind;
|
|
3175
3173
|
}
|
|
3176
|
-
const
|
|
3174
|
+
const bn = ee(ne((e2, t2) => {
|
|
3177
3175
|
const { className: o2, style: n2, commands: l2, readOnly: r2 = false, onClose: i2, darkMode: a2, loadingPanel: s2, autoFocus: d2 = true, onStatusChange: c2, ...g2 } = e2, u2 = le(null), h2 = S(i2, [i2]), m2 = le(false), p2 = te(() => ({ contains(e3) {
|
|
3178
3176
|
if (!u2.current) return;
|
|
3179
3177
|
const t3 = u2.current.editor;
|
|
@@ -3227,7 +3225,7 @@ const xn = ee(ne((e2, t2) => {
|
|
|
3227
3225
|
let a3 = null, s3 = e4.getSelection();
|
|
3228
3226
|
const d3 = s3.startLineNumber === s3.endLineNumber && s3.startColumn === s3.endColumn ? n4.getLineCount() : Math.min(s3.endLineNumber, n4.getLineCount());
|
|
3229
3227
|
for (let e5 = s3.startLineNumber; !a3 && e5 <= d3; e5++) {
|
|
3230
|
-
const t5 =
|
|
3228
|
+
const t5 = yn(i3, n4.getOffsetAt({ lineNumber: e5, column: 1 }), "function", o4);
|
|
3231
3229
|
t5 && (a3 = t5.text);
|
|
3232
3230
|
}
|
|
3233
3231
|
return a3;
|
|
@@ -3248,7 +3246,7 @@ const xn = ee(ne((e2, t2) => {
|
|
|
3248
3246
|
t4.editor.setModelMarkers(e4, "owner", o4);
|
|
3249
3247
|
})(e3, t3);
|
|
3250
3248
|
!(async function(e4, t4, o4, n4) {
|
|
3251
|
-
const l3 = await t4.languages.typescript.getTypeScriptWorker(), r3 = await l3(e4.uri), i3 = await r3.getNavigationTree(e4.uri.toString()), a3 =
|
|
3249
|
+
const l3 = await t4.languages.typescript.getTypeScriptWorker(), r3 = await l3(e4.uri), i3 = await r3.getNavigationTree(e4.uri.toString()), a3 = vn(e4, t4, n4, i3).map((e5) => {
|
|
3252
3250
|
let o5 = null, n5 = null;
|
|
3253
3251
|
return "formula" === e5.type ? (o5 = "formula.margin-icon", n5 = "Formula") : "macro" === e5.type ? (o5 = "macro.margin-icon", n5 = "Macro") : "autoRun" === e5.type && (o5 = "autorun.margin-icon", n5 = "Auto Run"), { range: new t4.Range(e5.lineNumber, 1, e5.lineNumber, 1), options: { isWholeLine: false, glyphMarginClassName: o5, glyphMarginHoverMessage: { value: n5 }, stickiness: t4.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges } };
|
|
3254
3252
|
});
|
|
@@ -3269,7 +3267,7 @@ const xn = ee(ne((e2, t2) => {
|
|
|
3269
3267
|
re(() => {
|
|
3270
3268
|
if (!C2) return;
|
|
3271
3269
|
const e3 = { insertSnippet: (e4) => {
|
|
3272
|
-
u2.current?.editor &&
|
|
3270
|
+
u2.current?.editor && wn(u2.current.editor, u2.current.monaco, e4);
|
|
3273
3271
|
}, close: () => $2() };
|
|
3274
3272
|
C2.setEditor(e3), C2.setSelectedFunction(H2());
|
|
3275
3273
|
const t3 = C2.addContainerListener({ onBeforeSave: async () => {
|
|
@@ -3343,7 +3341,7 @@ const xn = ee(ne((e2, t2) => {
|
|
|
3343
3341
|
F2();
|
|
3344
3342
|
} }), e3.onMouseDown(async (e4) => {
|
|
3345
3343
|
if (e4.target.type === t3.editor.MouseTargetType.GUTTER_GLYPH_MARGIN) {
|
|
3346
|
-
const o4 = e4.target.position.lineNumber, l3 = await t3.languages.typescript.getTypeScriptWorker(), r3 = await l3(n3.uri), i3 = await r3.getNavigationTree(n3.uri.toString()), a3 = (await F2()).getFunctions().getItems(), s3 =
|
|
3344
|
+
const o4 = e4.target.position.lineNumber, l3 = await t3.languages.typescript.getTypeScriptWorker(), r3 = await l3(n3.uri), i3 = await r3.getNavigationTree(n3.uri.toString()), a3 = (await F2()).getFunctions().getItems(), s3 = vn(n3, t3, a3, i3).find((e5) => e5.lineNumber === o4);
|
|
3347
3345
|
if (s3) {
|
|
3348
3346
|
const t4 = e4.event.browserEvent.button;
|
|
3349
3347
|
0 === t4 ? "macro" === s3.type || "autoRun" === s3.type ? E2({ functionName: s3.name }) : "formula" === s3.type && C2.quickInsertFunction?.(s3.name) : 2 === t4 && (console.log("Context menu for function:", s3.name), e4.event.browserEvent.preventDefault());
|
|
@@ -3390,7 +3388,7 @@ const xn = ee(ne((e2, t2) => {
|
|
|
3390
3388
|
}
|
|
3391
3389
|
}
|
|
3392
3390
|
const e3 = C2?.getScripts().getModules().getByName("scripts")?.getSource() ?? "";
|
|
3393
|
-
return Z("div", { style: { display: "flex", flex: "1 1 100%", width: "100%", flexDirection: "row", position: "relative", boxSizing: "border-box" }, children: [G(de, { children: G(
|
|
3391
|
+
return Z("div", { style: { display: "flex", flex: "1 1 100%", width: "100%", flexDirection: "row", position: "relative", boxSizing: "border-box" }, children: [G(de, { children: G(un, { theme: a2 ? "extended-dark" : "extended", options: { ...gn, fixedOverflowWidgets: true, readOnly: r2 }, language: "typescript", value: e3, onValidate: (e4) => {
|
|
3394
3392
|
let t3 = false;
|
|
3395
3393
|
const o3 = e4 ? e4.length : 0;
|
|
3396
3394
|
for (let n3 = 0; !t3 && n3 < o3; n3++) 8 === e4[n3].severity && (t3 = true);
|
|
@@ -3400,7 +3398,7 @@ const xn = ee(ne((e2, t2) => {
|
|
|
3400
3398
|
let t3 = false, o3 = false;
|
|
3401
3399
|
try {
|
|
3402
3400
|
const n3 = await (async () => {
|
|
3403
|
-
const e5 = await fetch(
|
|
3401
|
+
const e5 = await fetch("https://cdn.jsdelivr.net/npm/@sheetxl/sdk@0.6.20/types/scripting.d.ts");
|
|
3404
3402
|
return await e5.text();
|
|
3405
3403
|
})(), l3 = e4.Uri.parse('inmemory://model/"sheetxl-models".d.ts');
|
|
3406
3404
|
let r3 = e4.editor.getModel(l3);
|
|
@@ -3443,7 +3441,7 @@ const xn = ee(ne((e2, t2) => {
|
|
|
3443
3441
|
const t4 = e4.languages.typescript.typescriptDefaults.getCompilerOptions();
|
|
3444
3442
|
e4.languages.typescript.typescriptDefaults.setCompilerOptions({ ...t4, target: e4.languages.typescript.ScriptTarget.ES2020, lib: ["webworker", "es2020", "esnext.asynciterable"], downlevelIteration: true, moduleResolution: e4.languages.typescript.ModuleResolutionKind.NodeJs, allowSyntheticDefaultImports: true, baseUrl: "inmemory://model/", allowNonTsExtensions: true });
|
|
3445
3443
|
}
|
|
3446
|
-
if (I2.current && (await
|
|
3444
|
+
if (I2.current && (await wn(u2.current.editor, u2.current.monaco, I2.current), I2.current = null), m2.current && requestAnimationFrame(async () => {
|
|
3447
3445
|
m2.current && e4.editor.focus();
|
|
3448
3446
|
}), !mn) {
|
|
3449
3447
|
mn = {};
|
|
@@ -3508,7 +3506,7 @@ export {
|
|
|
3508
3506
|
Xt as MovableArea,
|
|
3509
3507
|
wo as PictureEditor,
|
|
3510
3508
|
Ro as Row,
|
|
3511
|
-
|
|
3509
|
+
bn as ScriptEditor,
|
|
3512
3510
|
lt as SheetCellEditor,
|
|
3513
3511
|
et as SheetCellRenderer,
|
|
3514
3512
|
mo as SheetElement,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/react",
|
|
3
3
|
"description": "React - React components needed to build advanced grid and spreadsheet UIs.",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.20",
|
|
5
5
|
"license": "SEE LICENSE IN <LICENSE>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"@dnd-kit/sortable": "^10.0.0",
|
|
38
38
|
"@dnd-kit/utilities": "^3.2.2",
|
|
39
39
|
"@monaco-editor/react": "^4.6.0",
|
|
40
|
-
"@sheetxl/grid-react": "^0.6.
|
|
41
|
-
"@sheetxl/sdk": "^0.6.
|
|
42
|
-
"@sheetxl/utils": "^0.6.
|
|
43
|
-
"@sheetxl/utils-react": "^0.6.
|
|
40
|
+
"@sheetxl/grid-react": "^0.6.20",
|
|
41
|
+
"@sheetxl/sdk": "^0.6.20",
|
|
42
|
+
"@sheetxl/utils": "^0.6.20",
|
|
43
|
+
"@sheetxl/utils-react": "^0.6.20",
|
|
44
44
|
"clsx": "^2.1.1",
|
|
45
45
|
"monaco-editor-auto-typings": "^0.4.6",
|
|
46
46
|
"react-merge-refs": "^3.0.2",
|