@sheetxl/scripting-react 0.7.23-beta.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.
Files changed (44) hide show
  1. package/LICENSE.md +11 -0
  2. package/README.md +25 -0
  3. package/browser/cjs/BAh9DnP6CTFXt1HI.cjs +1 -0
  4. package/browser/cjs/Bf_pmg4C0o1aKVy-.cjs +2 -0
  5. package/browser/cjs/CsWMPekp2nRo3bHt.cjs +11 -0
  6. package/browser/cjs/index.cjs +9 -0
  7. package/browser/esm/79R_LZrdMANq6eyF.mjs +545 -0
  8. package/browser/esm/C1aR3ISFO7Zp-stK.mjs +17 -0
  9. package/browser/esm/MBTRgCPV6sAugbR3.mjs +1483 -0
  10. package/browser/esm/index.mjs +1215 -0
  11. package/licenses/dependencies.txt +225 -0
  12. package/node/esm/index.mjs +1323 -0
  13. package/package.json +62 -0
  14. package/resources/contents.json +36 -0
  15. package/resources/locales/contents.json +58 -0
  16. package/resources/locales/de/groups.cmd.json +21 -0
  17. package/resources/locales/de/scriptEditor.cmd.json +36 -0
  18. package/resources/locales/de/ui.msg.json +8 -0
  19. package/resources/locales/de/workbookScript.cmd.json +26 -0
  20. package/resources/locales/en/groups.cmd.json +21 -0
  21. package/resources/locales/en/scriptEditor.cmd.json +36 -0
  22. package/resources/locales/en/ui.msg.json +8 -0
  23. package/resources/locales/en/workbookScript.cmd.json +26 -0
  24. package/types/index.d.ts +2 -0
  25. package/types/src/IScriptEditor.d.ts +52 -0
  26. package/types/src/IScriptEditor.d.ts.map +1 -0
  27. package/types/src/MonacoOptions.d.ts +68 -0
  28. package/types/src/MonacoOptions.d.ts.map +1 -0
  29. package/types/src/ScriptEditor.d.ts +73 -0
  30. package/types/src/ScriptEditor.d.ts.map +1 -0
  31. package/types/src/ScriptEditorCommands.d.ts +23 -0
  32. package/types/src/ScriptEditorCommands.d.ts.map +1 -0
  33. package/types/src/ScriptEditorOpener.d.ts +33 -0
  34. package/types/src/ScriptEditorOpener.d.ts.map +1 -0
  35. package/types/src/ScriptingReactPlugin.d.ts +9 -0
  36. package/types/src/ScriptingReactPlugin.d.ts.map +1 -0
  37. package/types/src/WorkbookScriptCommands.d.ts +18 -0
  38. package/types/src/WorkbookScriptCommands.d.ts.map +1 -0
  39. package/types/src/command-catalog/index.d.ts +3 -0
  40. package/types/src/command-catalog/index.d.ts.map +1 -0
  41. package/types/src/index.d.ts +6 -0
  42. package/types/src/index.d.ts.map +1 -0
  43. package/types/src/tsMonarchLanguage.d.ts +19 -0
  44. package/types/src/tsMonarchLanguage.d.ts.map +1 -0
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "@sheetxl/scripting-react",
3
+ "description": "Scripting React - Monaco based script editor and scripting UI for SheetXL.",
4
+ "version": "0.7.23-beta.2",
5
+ "license": "SEE LICENSE IN <LICENSE>",
6
+ "type": "module",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./types/index.d.ts",
10
+ "browser": "./browser/esm/index.mjs",
11
+ "node": "./node/esm/index.mjs",
12
+ "import": "./browser/esm/index.mjs",
13
+ "require": "./browser/cjs/index.cjs"
14
+ }
15
+ },
16
+ "types": "./types/index.d.ts",
17
+ "module": "./browser/esm/index.mjs",
18
+ "main": "./browser/cjs/index.cjs",
19
+ "sideEffects": [
20
+ "*.css",
21
+ "**/*.css"
22
+ ],
23
+ "homepage": "https://sheetxl.com",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://github.com/sheetxl/sheetxl.git"
27
+ },
28
+ "bugs": {
29
+ "url": "https://github.com/sheetxl/sheetxl/issues"
30
+ },
31
+ "keywords": [
32
+ "sheetxl",
33
+ "spreadsheet",
34
+ "javascript",
35
+ "typescript",
36
+ "react",
37
+ "scripting",
38
+ "monaco",
39
+ "automation",
40
+ "macros"
41
+ ],
42
+ "dependencies": {
43
+ "@monaco-editor/react": "^4.7.0",
44
+ "@sheetxl/react": "^0.7.23-beta.2",
45
+ "@sheetxl/scripting": "^0.7.23-beta.2",
46
+ "@sheetxl/sdk": "^0.7.23-beta.2",
47
+ "@sheetxl/utils": "^0.7.23-beta.2",
48
+ "@sheetxl/utils-react": "^0.7.23-beta.2",
49
+ "clsx": "^2.1.1",
50
+ "monaco-editor-auto-typings": "^0.4.6",
51
+ "path-browserify": "^1.0.1",
52
+ "react-merge-refs": "^3.0.2"
53
+ },
54
+ "peerDependencies": {
55
+ "react": "^19.0.0",
56
+ "react-dom": "^19.0.0"
57
+ },
58
+ "devDependencies": {
59
+ "@types/react": "^19.2.17",
60
+ "@types/react-dom": "^19.2.3"
61
+ }
62
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "entries": [
3
+ {
4
+ "path": "locales/contents.json"
5
+ },
6
+ {
7
+ "path": "locales/de/groups.cmd.json"
8
+ },
9
+ {
10
+ "path": "locales/de/scriptEditor.cmd.json"
11
+ },
12
+ {
13
+ "path": "locales/de/ui.msg.json"
14
+ },
15
+ {
16
+ "path": "locales/de/workbookScript.cmd.json"
17
+ },
18
+ {
19
+ "path": "locales/en/groups.cmd.json"
20
+ },
21
+ {
22
+ "path": "locales/en/scriptEditor.cmd.json"
23
+ },
24
+ {
25
+ "path": "locales/en/ui.msg.json"
26
+ },
27
+ {
28
+ "path": "locales/en/workbookScript.cmd.json"
29
+ }
30
+ ],
31
+ "folders": [
32
+ "locales",
33
+ "locales/de",
34
+ "locales/en"
35
+ ]
36
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "kind": "locales",
3
+ "package": "@sheetxl/scripting-react",
4
+ "entries": [
5
+ {
6
+ "path": "de/groups.cmd.json",
7
+ "locale": "de",
8
+ "role": "catalog",
9
+ "scope": "ui",
10
+ "sourceId": "groups"
11
+ },
12
+ {
13
+ "path": "de/scriptEditor.cmd.json",
14
+ "locale": "de",
15
+ "role": "catalog",
16
+ "scope": "scriptEditor",
17
+ "sourceId": "scriptEditor"
18
+ },
19
+ {
20
+ "path": "de/ui.msg.json",
21
+ "locale": "de",
22
+ "role": "messages"
23
+ },
24
+ {
25
+ "path": "de/workbookScript.cmd.json",
26
+ "locale": "de",
27
+ "role": "catalog",
28
+ "scope": "workbook",
29
+ "sourceId": "workbookScript"
30
+ },
31
+ {
32
+ "path": "en/groups.cmd.json",
33
+ "locale": "en",
34
+ "role": "catalog",
35
+ "scope": "ui",
36
+ "sourceId": "groups"
37
+ },
38
+ {
39
+ "path": "en/scriptEditor.cmd.json",
40
+ "locale": "en",
41
+ "role": "catalog",
42
+ "scope": "scriptEditor",
43
+ "sourceId": "scriptEditor"
44
+ },
45
+ {
46
+ "path": "en/ui.msg.json",
47
+ "locale": "en",
48
+ "role": "messages"
49
+ },
50
+ {
51
+ "path": "en/workbookScript.cmd.json",
52
+ "locale": "en",
53
+ "role": "catalog",
54
+ "scope": "workbook",
55
+ "sourceId": "workbookScript"
56
+ }
57
+ ]
58
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "../../../utils-react/command-catalog.schema.json",
3
+ "scope": "ui",
4
+ "label": "Benutzeroberfläche",
5
+ "tag": "de",
6
+ "version": 1,
7
+ "commands": {
8
+ "customFunctionOptions": {
9
+ "label": "Benutzerdefiniert",
10
+ "description": "Eine benutzerdefinierte Funktion einfügen."
11
+ },
12
+ "scriptEditor": {
13
+ "label": "Skript (TypeScript)",
14
+ "icon": "ScriptRun"
15
+ },
16
+ "scriptsOptions": {
17
+ "label": "Makros",
18
+ "description": "Makros ausführen oder verwalten."
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "$schema": "../../../utils-react/command-catalog.schema.json",
3
+ "scope": "scriptEditor",
4
+ "label": "Skript-Editor",
5
+ "tag": "de",
6
+ "version": 1,
7
+ "commands": {
8
+ "scriptingHelp": {
9
+ "label": "Skripting-Hilfe",
10
+ "groupLabels": {
11
+ "scriptsOptions": "Hilfe"
12
+ },
13
+ "description": "Die Dokumentation zum Skripting öffnen.",
14
+ "icon": "Help"
15
+ },
16
+ "showScriptingCommands": {
17
+ "label": "Skript-Befehlspalette",
18
+ "groupLabels": {
19
+ "scriptsOptions": "Befehlspalette"
20
+ },
21
+ "description": "Befehle für Skripting anzeigen.",
22
+ "icon": "Keyboard",
23
+ "shortcut": "F1"
24
+ },
25
+ "insertScript": {
26
+ "label": "Skript einfügen",
27
+ "description": "Ein Skript aus einer Reihe von Vorlagen einfügen.",
28
+ "icon": "ScriptInsert"
29
+ },
30
+ "saveScripts": {
31
+ "label": "Skript speichern",
32
+ "description": "Die aktuellen Skripte speichern.",
33
+ "icon": "ScriptSave"
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "reason.noChangesToSave": "Keine Änderungen zum Speichern",
3
+ "scriptEditor.glyph.autoRun": "Automatisch ausführen",
4
+ "scriptEditor.glyph.formula": "Formel",
5
+ "scriptEditor.glyph.macro": "Makro",
6
+ "scriptEditor.loading": "Wird geladen...",
7
+ "scriptEditor.saving": "Skripte werden gespeichert..."
8
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "$schema": "../../../utils-react/command-catalog.schema.json",
3
+ "scope": "workbook",
4
+ "label": "Arbeitsmappe",
5
+ "tag": "de",
6
+ "version": 1,
7
+ "commands": {
8
+ "showScriptEditor": {
9
+ "label": "Skripte",
10
+ "groupLabels": {
11
+ "scriptsOptions": "Skript-Editor…"
12
+ },
13
+ "description": "Den Skript-Editor anzeigen.",
14
+ "icon": "ScriptRun",
15
+ "shortcut": [
16
+ "alt+F11"
17
+ ]
18
+ },
19
+ "executeScript": {
20
+ "label": "Skript ausführen",
21
+ "description": "Das zuletzt ausgeführte Skript ausführen.",
22
+ "icon": "ScriptRun",
23
+ "shortcut": "F8"
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "../../../utils-react/command-catalog.schema.json",
3
+ "scope": "ui",
4
+ "label": "Interface",
5
+ "tag": "en",
6
+ "version": 1,
7
+ "commands": {
8
+ "customFunctionOptions": {
9
+ "label": "Custom",
10
+ "description": "Insert a custom function."
11
+ },
12
+ "scriptEditor": {
13
+ "label": "Script (Typescript)",
14
+ "icon": "ScriptRun"
15
+ },
16
+ "scriptsOptions": {
17
+ "label": "Macros",
18
+ "description": "Run or manage macros."
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "$schema": "../../../utils-react/command-catalog.schema.json",
3
+ "scope": "scriptEditor",
4
+ "label": "Script Editor",
5
+ "tag": "en",
6
+ "version": 1,
7
+ "commands": {
8
+ "scriptingHelp": {
9
+ "label": "Scripting Help",
10
+ "description": "Open Documentation For Scripting.",
11
+ "groupLabels": {
12
+ "scriptsOptions": "Help"
13
+ },
14
+ "icon": "Help"
15
+ },
16
+ "showScriptingCommands": {
17
+ "label": "Scripting Command Palette",
18
+ "description": "Show commands for scripting.",
19
+ "groupLabels": {
20
+ "scriptsOptions": "Command Palette"
21
+ },
22
+ "icon": "Keyboard",
23
+ "shortcut": "F1"
24
+ },
25
+ "insertScript": {
26
+ "label": "Insert Script",
27
+ "description": "Inserts a script from a set of templates.",
28
+ "icon": "ScriptInsert"
29
+ },
30
+ "saveScripts": {
31
+ "label": "Save Script",
32
+ "description": "Save the current scripts.",
33
+ "icon": "ScriptSave"
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "reason.noChangesToSave": "No changes to save",
3
+ "scriptEditor.glyph.autoRun": "Auto Run",
4
+ "scriptEditor.glyph.formula": "Formula",
5
+ "scriptEditor.glyph.macro": "Macro",
6
+ "scriptEditor.loading": "Loading...",
7
+ "scriptEditor.saving": "Saving Scripts..."
8
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "$schema": "../../../utils-react/command-catalog.schema.json",
3
+ "scope": "workbook",
4
+ "label": "Workbook",
5
+ "tag": "en",
6
+ "version": 1,
7
+ "commands": {
8
+ "showScriptEditor": {
9
+ "label": "Scripts",
10
+ "description": "Show the script editor.",
11
+ "groupLabels": {
12
+ "scriptsOptions": "Script Editor…"
13
+ },
14
+ "icon": "ScriptRun",
15
+ "shortcut": [
16
+ "alt+F11"
17
+ ]
18
+ },
19
+ "executeScript": {
20
+ "label": "Run Script",
21
+ "description": "Run the last executed script.",
22
+ "icon": "ScriptRun",
23
+ "shortcut": "F8"
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,2 @@
1
+ export * from './src/index'
2
+ export {}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Used by the Script editor to interface with the repo for the Scripts.
3
+ *
4
+ * @remarks
5
+ * The old `Context` / `ContainerListener` marshalling is gone — the editor reads the live workbook directly
6
+ * (`useWorkbook`) for ranges/scripts, executes the workbook `insertFunction` command for the fx picker, and
7
+ * listens to the workbook's own `onBeforeSave`/`onLoad` for the save-flush + reload. What remains is the small
8
+ * set of editor-facing view types.
9
+ */
10
+ export declare namespace IScriptEditor {
11
+ /**
12
+ * Implemented by the editor to allow for ui interactions.
13
+ */
14
+ interface Editor {
15
+ /**
16
+ * Closes the editor.
17
+ * @returns A promise that resolves when the editor is closed.
18
+ */
19
+ close: () => Promise<void>;
20
+ }
21
+ /**
22
+ * The current function that is selected.
23
+ */
24
+ interface SelectedFunction {
25
+ /**
26
+ * The selected function.
27
+ */
28
+ name: string;
29
+ /**
30
+ * Needed for JIT.
31
+ */
32
+ source: string;
33
+ }
34
+ /**
35
+ * Provides status of the editor.
36
+ */
37
+ interface Status {
38
+ /**
39
+ * The message to display.
40
+ */
41
+ message: string;
42
+ /**
43
+ * The cursor position.
44
+ */
45
+ cursor: string;
46
+ /**
47
+ * If the script is unsaved.
48
+ */
49
+ dirty: boolean;
50
+ }
51
+ }
52
+ //# sourceMappingURL=IScriptEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IScriptEditor.d.ts","sourceRoot":"","sources":["../../../src/IScriptEditor.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,yBAAiB,aAAa,CAAC;IAC7B;;OAEG;IACH,UAAiB,MAAM;QACrB;;;WAGG;QACH,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;KAC5B;IAED;;OAEG;IAEH,UAAiB,gBAAgB;QAC/B;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QACb;;WAEG;QACH,MAAM,EAAE,MAAM,CAAA;KACf;IAED;;OAEG;IACH,UAAiB,MAAM;QACrB;;WAEG;QACH,OAAO,EAAE,MAAM,CAAC;QAChB;;WAEG;QACH,MAAM,EAAE,MAAM,CAAC;QACf;;WAEG;QACH,KAAK,EAAE,OAAO,CAAC;KAGhB;CACF"}
@@ -0,0 +1,68 @@
1
+ declare const _default: {
2
+ lightbulb: {
3
+ enabled: boolean;
4
+ };
5
+ tabSize: number;
6
+ acceptSuggestionOnCommitCharacter: boolean;
7
+ acceptSuggestionOnEnter: string;
8
+ accessibilitySupport: string;
9
+ automaticLayout: boolean;
10
+ autoIndent: boolean;
11
+ codeLens: boolean;
12
+ colorDecorators: boolean;
13
+ contextmenu: boolean;
14
+ cursorBlinking: string;
15
+ cursorSmoothCaretAnimation: boolean;
16
+ cursorStyle: string;
17
+ disableLayerHinting: boolean;
18
+ disableMonospaceOptimizations: boolean;
19
+ dragAndDrop: boolean;
20
+ glyphMargin: boolean;
21
+ fixedOverflowWidgets: boolean;
22
+ folding: boolean;
23
+ foldingStrategy: string;
24
+ fontLigatures: boolean;
25
+ formatOnPaste: boolean;
26
+ formatOnType: boolean;
27
+ hideCursorInOverviewRuler: boolean;
28
+ highlightActiveIndentGuide: boolean;
29
+ links: boolean;
30
+ lineDecorationsWidth: number;
31
+ lineNumbersMinChars: number;
32
+ mouseWheelZoom: boolean;
33
+ multiCursorMergeOverlapping: boolean;
34
+ multiCursorModifier: string;
35
+ overviewRulerBorder: boolean;
36
+ overviewRulerLanes: number;
37
+ quickSuggestions: boolean;
38
+ quickSuggestionsDelay: number;
39
+ readOnly: boolean;
40
+ renderControlCharacters: boolean;
41
+ renderFinalNewline: boolean;
42
+ renderIndentGuides: boolean;
43
+ renderLineHighlight: string;
44
+ renderWhitespace: string;
45
+ revealHorizontalRightPadding: number;
46
+ roundedSelection: boolean;
47
+ rulers: never[];
48
+ scrollBeyondLastColumn: number;
49
+ scrollBeyondLastLine: boolean;
50
+ selectOnLineNumbers: boolean;
51
+ selectionClipboard: boolean;
52
+ selectionHighlight: boolean;
53
+ showLightbulbIconMode: boolean;
54
+ showFoldingControls: string;
55
+ smoothScrolling: boolean;
56
+ suggestOnTriggerCharacters: boolean;
57
+ wordBasedSuggestions: boolean;
58
+ wordSeparators: string;
59
+ wordWrap: string;
60
+ wordWrapBreakAfterCharacters: string;
61
+ wordWrapBreakBeforeCharacters: string;
62
+ wordWrapBreakObtrusiveCharacters: string;
63
+ wordWrapColumn: number;
64
+ wordWrapMinified: boolean;
65
+ wrappingIndent: string;
66
+ };
67
+ export default _default;
68
+ //# sourceMappingURL=MonacoOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MonacoOptions.d.ts","sourceRoot":"","sources":["../../../src/MonacoOptions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wBAiEC"}
@@ -0,0 +1,73 @@
1
+ import { default as React } from 'react';
2
+ import { IScript } from '@sheetxl/sdk';
3
+ import { IFrame } from '@sheetxl/react';
4
+ import { IScriptEditor } from './IScriptEditor';
5
+ /**
6
+ * Move this to another project. Automation-Editor
7
+ */
8
+ export interface ScriptEditorProps extends React.HTMLAttributes<HTMLElement> {
9
+ /**
10
+ * If the values can be modified
11
+ */
12
+ readOnly?: boolean;
13
+ /**
14
+ * Handle to the frame
15
+ */
16
+ frame?: IFrame;
17
+ /**
18
+ * The script collection to edit.
19
+ */
20
+ scripts: IScript;
21
+ /**
22
+ * Allows for component to be autoFocused.
23
+ */
24
+ /**
25
+ * If provided then a custom loading panel will be used.
26
+ */
27
+ loadingPanel?: React.ReactElement;
28
+ /**
29
+ * Called for status change events.
30
+ */
31
+ onStatusChange?: (status: Partial<IScriptEditor.Status>) => void;
32
+ /**
33
+ * Monaco theme
34
+ */
35
+ darkMode?: boolean;
36
+ }
37
+ export interface ScriptEditorAttributes {
38
+ insertSnippet(snippet: string): Promise<void>;
39
+ showCommandPalette(): void;
40
+ getScripts(): IScript;
41
+ saveSource(): Promise<void>;
42
+ isScriptEditorElement(): true;
43
+ close(): Promise<void>;
44
+ /**
45
+ * Run a Monaco editor action by id (e.g. `editor.action.selectAll`). The editor owns its own
46
+ * selection, so `selectAll` routes here rather than through the generic input-clipboard injector.
47
+ * No-op until the editor has mounted. **Not for clipboard** — see {@link copy}/{@link cut}/{@link paste}.
48
+ */
49
+ runAction(actionId: string): void;
50
+ /**
51
+ * Clipboard, model-based (focus-independent, so they also work from the context menu, and paste is a
52
+ * single undo). No-op until the editor has mounted. These are what the editor's `copy`/`cut`/`paste`
53
+ * commands and its context-menu items call — NOT Monaco's built-in clipboard actions, which depend on
54
+ * editor focus and so fail from the (focus-stealing) context menu.
55
+ */
56
+ copy(): Promise<void>;
57
+ cut(): Promise<void>;
58
+ paste(): Promise<void>;
59
+ }
60
+ /**
61
+ * Type returned via ref property
62
+ */
63
+ export interface IScriptEditorElement extends ScriptEditorAttributes, HTMLDivElement {
64
+ }
65
+ export type ScriptEditorAttribute = {
66
+ ref?: React.Ref<IScriptEditorElement>;
67
+ };
68
+ /**
69
+ * This tracks the selection of the sheet and
70
+ * updates the a named range editor and a sheet cell editor.
71
+ */
72
+ export declare const ScriptEditor: React.FC<ScriptEditorProps & ScriptEditorAttribute>;
73
+ //# sourceMappingURL=ScriptEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScriptEditor.d.ts","sourceRoot":"","sources":["../../../src/ScriptEditor.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B,OAAO,EAAkB,KAAK,OAAO,EAAkD,MAAM,cAAc,CAAC;AAK5G,OAAO,EAAiC,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAI5E,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAmDrD;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IAC1E;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IAEH;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAClC;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACjE;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAGD,MAAM,WAAW,sBAAsB;IACrC,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,kBAAkB,IAAI,IAAI,CAAC;IAC3B,UAAU,IAAI,OAAO,CAAC;IACtB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,qBAAqB,IAAI,IAAI,CAAC;IAC9B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB;;;;OAIG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC;;;;;OAKG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACrB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,sBAAsB,EAAE,cAAc;CAAG;AAEvF,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;CACvC,CAAC;AAi0BF;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,GAAG,qBAAqB,CAqtB5E,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { Command } from '@sheetxl/utils-react';
2
+ import { IScriptEditorElement } from './ScriptEditor';
3
+ export interface ContributeScriptEditorCommandsOptions {
4
+ /** Whether the editor has unsaved changes — gates `saveScripts`. */
5
+ isDirty?: boolean;
6
+ }
7
+ /**
8
+ * Contribute the script-editor commands (help / command palette / insert-snippet / save) into a
9
+ * command scope, wired **directly to the live editor handle**. The replacement for
10
+ * `useScriptCommands`' `CommandGroup`.
11
+ *
12
+ * @remarks
13
+ * Because the definition is contributed *where the editor handle lives* and resolved via the shared
14
+ * scope, the old `IScriptEditor.Context` marshalling is unnecessary for these commands — the toolbar
15
+ * (above the editor, same resolver) resolves them straight off the scope. Idempotent: re-call to refresh
16
+ * `saveScripts`' enabled state when `isDirty` changes.
17
+ */
18
+ /** The single `data` bundle {@link contributeScriptEditorCommands} takes (the `DynamicCommandContributor` shape). */
19
+ export interface ScriptEditorCommandData extends ContributeScriptEditorCommandsOptions {
20
+ scriptEditor: IScriptEditorElement;
21
+ }
22
+ export declare function contributeScriptEditorCommands(contribution: Command.CommandContribution, data: ScriptEditorCommandData): void;
23
+ //# sourceMappingURL=ScriptEditorCommands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScriptEditorCommands.d.ts","sourceRoot":"","sources":["../../../src/ScriptEditorCommands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,MAAM,WAAW,qCAAqC;IACpD,oEAAoE;IACpE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;GAUG;AACH,qHAAqH;AACrH,MAAM,WAAW,uBAAwB,SAAQ,qCAAqC;IACpF,YAAY,EAAE,oBAAoB,CAAC;CACpC;AACD,wBAAgB,8BAA8B,CAC5C,YAAY,EAAE,OAAO,CAAC,mBAAmB,EACzC,IAAI,EAAE,uBAAuB,GAC5B,IAAI,CAuCN"}
@@ -0,0 +1,33 @@
1
+ import { IWorkbook } from '@sheetxl/sdk';
2
+ /**
3
+ * Details passed to a {@link ScriptEditorOpener} when the user invokes `showScriptEditor`.
4
+ */
5
+ export interface ScriptEditorOpenRequest {
6
+ /**
7
+ * The workbook whose script should be edited.
8
+ */
9
+ workbook: IWorkbook;
10
+ }
11
+ /**
12
+ * Opens the script editor for a workbook.
13
+ *
14
+ * @remarks
15
+ * When registered via {@link setScriptEditorOpener}, this fully owns the `showScriptEditor` action -
16
+ * the default in-app behavior (toggling the `scriptEditor` task pane) is skipped. A host that edits
17
+ * scripts elsewhere (e.g. the VS Code extension opening a native editor) registers one of these.
18
+ */
19
+ export type ScriptEditorOpener = (request: ScriptEditorOpenRequest) => void;
20
+ /**
21
+ * Registers (or clears, with `null`) the global script-editor opener.
22
+ *
23
+ * @remarks
24
+ * A single opener is supported; the last registration wins. This is a host-level override, set once
25
+ * during application startup.
26
+ */
27
+ export declare const setScriptEditorOpener: (opener: ScriptEditorOpener | null) => void;
28
+ /**
29
+ * Returns the registered {@link ScriptEditorOpener}, or `null` if none is set (use the default
30
+ * in-app task-pane behavior).
31
+ */
32
+ export declare const getScriptEditorOpener: () => ScriptEditorOpener | null;
33
+ //# sourceMappingURL=ScriptEditorOpener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScriptEditorOpener.d.ts","sourceRoot":"","sources":["../../../src/ScriptEditorOpener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,uBAAuB,KAAK,IAAI,CAAC;AAI5E;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAAI,QAAQ,kBAAkB,GAAG,IAAI,KAAG,IAEzE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAAO,kBAAkB,GAAG,IAE7D,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Registers the scripting task pane (`scriptEditor`) into the {@link DefaultTaskPaneRegistry}.
3
+ *
4
+ * @remarks
5
+ * Call once during application startup. This is the lightweight registration that ships the bare
6
+ * {@link ScriptEditor}; it is intentionally MUI free so it can be used by non-studio hosts.
7
+ */
8
+ export declare const ScriptingReactPlugin: () => void;
9
+ //# sourceMappingURL=ScriptingReactPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScriptingReactPlugin.d.ts","sourceRoot":"","sources":["../../../src/ScriptingReactPlugin.tsx"],"names":[],"mappings":"AAoCA;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,QAAO,IA+BvC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { CommandContributionComponentProps } from '@sheetxl/utils-react';
2
+ import { WorkbookCommandContributorData } from '@sheetxl/react';
3
+ /**
4
+ * Wires the workbook-level scripting commands' behavior — `executeScript` (run a macro) and
5
+ * `showScriptEditor` (toggle the task pane) — onto the per-workbook `workbook` scope, and starts the script
6
+ * engine on workbook load.
7
+ *
8
+ * @remarks
9
+ * The editor no longer needs a pushed-in `IScriptEditor.Context`: it reads the live workbook via `useWorkbook`
10
+ * (ranges/scripts), executes the workbook `insertFunction` command for the fx picker, and listens to the
11
+ * workbook's own `onBeforeSave` to flush its source. So this component contributes plain callbacks — no context
12
+ * marshalling.
13
+ *
14
+ * `showScriptEditor` defers to a registered {@link ScriptEditorOpener} when present (e.g. the VS Code
15
+ * host opens a native editor); otherwise it toggles the in-app `scriptEditor` task pane.
16
+ */
17
+ export declare const WorkbookScriptCommands: import('react').MemoExoticComponent<(props: CommandContributionComponentProps<WorkbookCommandContributorData>) => null>;
18
+ //# sourceMappingURL=WorkbookScriptCommands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkbookScriptCommands.d.ts","sourceRoot":"","sources":["../../../src/WorkbookScriptCommands.tsx"],"names":[],"mappings":"AAMA,OAAO,EAC6C,KAAK,iCAAiC,EACzF,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAC8B,KAAK,8BAA8B,EACvE,MAAM,gBAAgB,CAAC;AAIxB;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,8CAAgB,iCAAiC,CAAC,8BAA8B,CAAC,UAmFlH,CAAC"}