Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ Plugin Playground now exposes command APIs that mirror sidebar data and support
- `plugin-playground:list-tokens`
- `plugin-playground:list-commands`
- `plugin-playground:list-extension-examples`
- `plugin-playground:export-as-extension` (supports optional `{ path: string }`)
- `plugin-playground:share-via-link` (supports optional `{ path: string }`)
- `plugin-playground:export-as-extension` (supports optional `{ path?: string }`)
- `plugin-playground:share-via-link` (supports optional `{ path?: string, useBrowserSelection?: boolean }`)

Example:

Expand All @@ -179,18 +179,25 @@ 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.
Folder sharing skips non-text/media files (for example images and videos).
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 @@ -65,6 +65,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 @@ -86,7 +87,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 @@ -85,6 +92,22 @@
}
]
},
"jupyter.lab.menus": {
"context": [
{
"command": "plugin-playground:share-via-link",
"args": { "useBrowserSelection": true },
"selector": ".jp-DirListing-item[data-isdir=\"false\"]",
"rank": 11
},
{
"command": "plugin-playground:share-via-link",
"args": { "useBrowserSelection": true },
"selector": ".jp-DirListing-item[data-isdir=\"true\"]",
"rank": 12
}
]
},
"jupyter.lab.shortcuts": [
{
"command": "plugin-playground:load-as-extension",
Expand Down
Loading
Loading