@snaptrude/plugin-core 0.9.8 → 0.9.10
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/AGENTS.md +4 -0
- package/CHANGELOG.md +12 -4
- package/api-manifest.json +242 -1
- package/dist/api/core/mode/index.d.ts +19 -7
- package/dist/api/core/mode/index.d.ts.map +1 -1
- package/dist/api/core/tags.d.ts +81 -0
- package/dist/api/core/tags.d.ts.map +1 -1
- package/dist/api/program/departments.d.ts +58 -2
- package/dist/api/program/departments.d.ts.map +1 -1
- package/dist/api/program/index.d.ts +16 -6
- package/dist/api/program/index.d.ts.map +1 -1
- package/dist/api/program/labels.d.ts +355 -0
- package/dist/api/program/labels.d.ts.map +1 -0
- package/dist/api/program/metadata.d.ts +328 -0
- package/dist/api/program/metadata.d.ts.map +1 -0
- package/dist/api/program/spreadsheet.d.ts +263 -0
- package/dist/api/program/spreadsheet.d.ts.map +1 -1
- package/dist/api/workspace/index.d.ts +49 -2
- package/dist/api/workspace/index.d.ts.map +1 -1
- package/dist/index.cjs +1079 -831
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1034 -831
- package/dist/index.js.map +1 -1
- package/package.json +13 -13
- package/src/api/core/mode/index.ts +19 -7
- package/src/api/core/tags.ts +76 -0
- package/src/api/program/departments.ts +54 -2
- package/src/api/program/index.ts +16 -6
- package/src/api/program/labels.ts +332 -0
- package/src/api/program/metadata.ts +364 -0
- package/src/api/program/spreadsheet.ts +282 -0
- package/src/api/workspace/index.ts +51 -2
- package/api-manifest.full.json +0 -8443
|
@@ -10,13 +10,16 @@ import { PluginApiReturn } from "../../types"
|
|
|
10
10
|
* Teams are **read-only** here (no create/invite/delete in v1, a deliberate
|
|
11
11
|
* safety decision); there are no folders in v1. A `projectId` is the project's
|
|
12
12
|
* floorkey. Plan limits are enforced by the backend — a limit rejection surfaces
|
|
13
|
-
* as a normal host error. It also carries the workspace-level mode
|
|
13
|
+
* as a normal host error. It also carries the workspace-level mode switches for
|
|
14
14
|
* Present mode ({@linkcode PluginWorkspaceApi.openPresentMode} /
|
|
15
|
-
* {@linkcode PluginWorkspaceApi.closePresentMode})
|
|
15
|
+
* {@linkcode PluginWorkspaceApi.closePresentMode}) and Program mode
|
|
16
|
+
* ({@linkcode PluginWorkspaceApi.openProgramMode} /
|
|
17
|
+
* {@linkcode PluginWorkspaceApi.closeProgramMode}).
|
|
16
18
|
*
|
|
17
19
|
* - {@linkcode PluginWorkspaceApi.projects} — Create, copy, list, read & rename projects
|
|
18
20
|
* - {@linkcode PluginWorkspaceApi.teams} — Read teams and their members
|
|
19
21
|
* - {@linkcode PluginWorkspaceApi.openPresentMode} / {@linkcode PluginWorkspaceApi.closePresentMode} — Open/close the Present-mode documentation editor
|
|
22
|
+
* - {@linkcode PluginWorkspaceApi.openProgramMode} / {@linkcode PluginWorkspaceApi.closeProgramMode} — Open/close the Program tab (the spreadsheet the `program.spreadsheet.*` calls run in)
|
|
20
23
|
*/
|
|
21
24
|
export abstract class PluginWorkspaceApi {
|
|
22
25
|
/** Projects — create, copy, list, read & rename. See {@linkcode PluginWorkspaceProjectsApi}. */
|
|
@@ -68,6 +71,52 @@ export abstract class PluginWorkspaceApi {
|
|
|
68
71
|
*/
|
|
69
72
|
public abstract closePresentMode(): PluginApiReturn<void>
|
|
70
73
|
|
|
74
|
+
/**
|
|
75
|
+
* Open Program mode — the Program tab the `program.spreadsheet.*` calls run in.
|
|
76
|
+
*
|
|
77
|
+
* Runs the top bar's own Program-button sequence (remember the preference,
|
|
78
|
+
* open or re-link the paired Program window) and resolves only once that tab
|
|
79
|
+
* has connected to the editor over its channel, so a `program.spreadsheet.*`
|
|
80
|
+
* call issued right after this resolves finds the tab open. The open happens
|
|
81
|
+
* outside a user gesture, so the browser may block the pop-up; the editor
|
|
82
|
+
* then shows its "Allow pop-up to continue" modal and this call keeps waiting
|
|
83
|
+
* (up to ~90s) for the user to confirm. Idempotent — resolves immediately
|
|
84
|
+
* when the Program tab is already connected, and is a no-op when the plugin is
|
|
85
|
+
* itself running in the Program tab. Write-gated.
|
|
86
|
+
*
|
|
87
|
+
* @throws `PRECONDITION_FAILED` if the user dismisses the pop-up modal or the
|
|
88
|
+
* Program tab does not connect within the timeout.
|
|
89
|
+
*
|
|
90
|
+
* @examplePrompt Open program mode
|
|
91
|
+
* @examplePrompt Open the Program tab so I can build a custom sheet
|
|
92
|
+
* @examplePrompt Switch to the program spreadsheet
|
|
93
|
+
*
|
|
94
|
+
* # Example
|
|
95
|
+
* ```ts
|
|
96
|
+
* await snaptrude.workspace.openProgramMode()
|
|
97
|
+
* const { sheets } = await snaptrude.program.spreadsheet.listSheets()
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
public abstract openProgramMode(): PluginApiReturn<void>
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Close the Program tab.
|
|
104
|
+
*
|
|
105
|
+
* Idempotent — a no-op when no Program tab is connected. Write-gated, like
|
|
106
|
+
* {@linkcode PluginWorkspaceApi.openProgramMode}.
|
|
107
|
+
*
|
|
108
|
+
* @throws `PRECONDITION_FAILED` if the tab is still connected after ~15s.
|
|
109
|
+
*
|
|
110
|
+
* @examplePrompt Close program mode
|
|
111
|
+
* @examplePrompt Close the Program tab
|
|
112
|
+
*
|
|
113
|
+
* # Example
|
|
114
|
+
* ```ts
|
|
115
|
+
* await snaptrude.workspace.closeProgramMode()
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
public abstract closeProgramMode(): PluginApiReturn<void>
|
|
119
|
+
|
|
71
120
|
constructor() {}
|
|
72
121
|
}
|
|
73
122
|
|