lumiverse-spindle-types 0.2.4 → 0.2.5
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/package.json +1 -1
- package/src/dom.ts +40 -0
package/package.json
CHANGED
package/src/dom.ts
CHANGED
|
@@ -165,6 +165,26 @@ export interface PermissionRequestOptions {
|
|
|
165
165
|
reason?: string;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
// ── Text Editor ──
|
|
169
|
+
|
|
170
|
+
export interface SpindleTextEditorOptions {
|
|
171
|
+
/** Modal title. Default: "Edit Text" */
|
|
172
|
+
title?: string;
|
|
173
|
+
/** Initial text content. Default: "" */
|
|
174
|
+
value?: string;
|
|
175
|
+
/** Placeholder text. Default: "" */
|
|
176
|
+
placeholder?: string;
|
|
177
|
+
/** Enable macro syntax highlighting and insertion panel. Default: true */
|
|
178
|
+
macros?: boolean;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export interface SpindleTextEditorResult {
|
|
182
|
+
/** The edited text (or original value if cancelled) */
|
|
183
|
+
text: string;
|
|
184
|
+
/** True if the user dismissed the editor without confirming */
|
|
185
|
+
cancelled: boolean;
|
|
186
|
+
}
|
|
187
|
+
|
|
168
188
|
/** Context object provided to frontend extension modules */
|
|
169
189
|
export interface SpindleFrontendContext {
|
|
170
190
|
dom: SpindleDOMHelper;
|
|
@@ -179,6 +199,26 @@ export interface SpindleFrontendContext {
|
|
|
179
199
|
requestDockPanel(options: SpindleDockPanelOptions): SpindleDockPanelHandle;
|
|
180
200
|
mountApp(options?: SpindleAppMountOptions): SpindleAppMountHandle;
|
|
181
201
|
registerInputBarAction(options: SpindleInputBarActionOptions): SpindleInputBarActionHandle;
|
|
202
|
+
/**
|
|
203
|
+
* Open the native Lumiverse expanded text editor modal.
|
|
204
|
+
* Provides macro syntax highlighting, macro insertion panel with search,
|
|
205
|
+
* and a full-screen editing experience.
|
|
206
|
+
*
|
|
207
|
+
* Returns a Promise that resolves when the user closes the editor.
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* ```ts
|
|
211
|
+
* const result = await ctx.ui.openTextEditor({
|
|
212
|
+
* title: 'Edit System Prompt',
|
|
213
|
+
* value: currentText,
|
|
214
|
+
* macros: true,
|
|
215
|
+
* })
|
|
216
|
+
* if (!result.cancelled) {
|
|
217
|
+
* currentText = result.text
|
|
218
|
+
* }
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
openTextEditor(options?: SpindleTextEditorOptions): Promise<SpindleTextEditorResult>;
|
|
182
222
|
};
|
|
183
223
|
uploads: {
|
|
184
224
|
pickFile(options?: {
|