Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ Plugin Playground exposes command APIs for scripting, agents, and automation:
- `plugin-playground:list-commands` (supports optional `{ query?: string }`)
- `plugin-playground:list-extension-examples` (supports optional `{ query?: string }`)
- `plugin-playground:export-as-extension` (supports optional `{ path?: string, format?: 'zip' | 'wheel' }`)
- `plugin-playground:share-via-link` (supports optional `{ path?: string }`)
- `plugin-playground:share-via-link` (supports optional `{ path?: string, useBrowserSelection?: boolean, useContextTarget?: boolean }`)

Example:

Expand All @@ -225,18 +225,30 @@ await app.commands.execute('plugin-playground:export-as-extension', {
});

await app.commands.execute('plugin-playground:share-via-link', {
path: 'my-extension/src/index.ts'
path: 'my-extension'
});
```

`plugin-playground:share-via-link` shares a single file. If no `path` is
provided, it shares the active file.
`plugin-playground:share-via-link` shares a file or folder. If no `path` is
provided, it shares the active file. The file/folder right-click context-menu
entries use the selected browser item path automatically.
In the editor toolbar, the Share action is a dropdown with `Share Single File`
and `Share Package`; package sharing is enabled when a
`package.json` is found in the current file directory or its parent directory.
Folder sharing excludes common non-exportable files by default (for example
media assets, README/docs files, and test/spec files), but you can include them
manually from the selection dialog.
By default, folder sharing always opens a file-selection dialog so you can
exclude files before creating the link. You can control this with
`shareFolderSelectionDialogMode` (`always`, `auto-excluded-or-limit`, or
`limit-only`). If the generated URL is too long, you can pick a smaller subset
of files in the same dialog.
The same action is also available from the `IPluginPlayground` API via
`shareViaLink(path?)`.

When opening a shared URL, Plugin Playground restores and opens the shared
file but does not execute it automatically. Run `Load Current File As
Extension` when you are ready.
When opening a shared URL, Plugin Playground restores the shared file(s) and
opens one restored file, but does not execute it automatically. Run `Load
Current File As Extension` when you are ready.

List commands (`list-tokens`, `list-commands`, `list-extension-examples`)
return a JSON object with:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"@jupyterlab/apputils": "^4.6.5",
"@jupyterlab/codemirror": "^4.5.5",
"@jupyterlab/completer": "^4.5.5",
"@jupyterlab/filebrowser": "^4.5.5",
"@jupyterlab/fileeditor": "^4.5.5",
"@jupyterlab/settingregistry": "^4.5.5",
"jupyterlab-js-logs": "^1.1.0",
Expand All @@ -87,7 +88,6 @@
"@jupyterlab/docmanager": "^4.5.5",
"@jupyterlab/documentsearch": "^4.5.5",
"@jupyterlab/extensionmanager": "^4.5.5",
"@jupyterlab/filebrowser": "^4.5.5",
"@jupyterlab/htmlviewer": "^4.5.5",
"@jupyterlab/imageviewer": "^4.5.5",
"@jupyterlab/inspector": "^4.5.5",
Expand Down
23 changes: 23 additions & 0 deletions schema/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@
"type": "string",
"enum": ["insert", "ai"]
},
"shareFolderSelectionDialogMode": {
"title": "Show file selection dialog on folder share",
"description": "Control when folder sharing opens the file-selection dialog. Use \"always\" to always ask, \"auto-excluded-or-limit\" to ask when files are auto-excluded or the URL size limit is hit, or \"limit-only\" to ask only when the URL size limit is hit.",
"default": "always",
"type": "string",
"enum": ["always", "auto-excluded-or-limit", "limit-only"]
},
"plugins": {
"title": "Plugins",
"description": "List of strings of plugin text to load automatically. Line breaks are encoded as '\\n'",
Expand Down Expand Up @@ -84,6 +91,22 @@
}
]
},
"jupyter.lab.menus": {
"context": [
{
"command": "plugin-playground:share-via-link",
"args": { "useBrowserSelection": true, "useContextTarget": true },
"selector": ".jp-DirListing-item[data-isdir=\"false\"]",
"rank": 11
},
{
"command": "plugin-playground:share-via-link",
"args": { "useBrowserSelection": true, "useContextTarget": true },
"selector": ".jp-DirListing-item[data-isdir=\"true\"]",
"rank": 12
}
]
},
"jupyter.lab.shortcuts": [
{
"command": "plugin-playground:load-as-extension",
Expand Down
Loading
Loading