How to use the @jupyterlab/notebook.NotebookActions.paste function in @jupyterlab/notebook

To help you get started, we’ve selected a few @jupyterlab/notebook examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jupyterlab / jupyterlab-data-explorer / tests / test-notebook / src / actions.spec.ts View on Github external
it('should change to command mode', () => {
        widget.mode = 'edit';
        NotebookActions.cut(widget);
        NotebookActions.paste(widget);
        expect(widget.mode).to.equal('command');
      });
github jupyterlab / jupyterlab / tests / test-notebook / src / actions.spec.ts View on Github external
it('should paste cells from a NBTestUtils.clipboard', () => {
        const source = widget.activeCell.model.value.text;
        const next = widget.widgets[1];
        widget.select(next);
        const count = widget.widgets.length;
        NotebookActions.cut(widget);
        widget.activeCellIndex = 1;
        NotebookActions.paste(widget);
        expect(widget.widgets.length).to.equal(count);
        expect(widget.widgets[2].model.value.text).to.equal(source);
        expect(widget.activeCellIndex).to.equal(3);
      });
github yuvipanda / simplest-notebook / packages / notebook-extension / src / index.ts View on Github external
execute: args => {
      const current = getCurrent(args);

      if (current) {
        return NotebookActions.paste(current.notebook, 'replace');
      }
    },
    isEnabled
github spyder-ide / spyder-notebook / spyder_notebook / server / src / commands.ts View on Github external
    execute: () => NotebookActions.paste(nbWidget.content, 'above')
  });
github yuvipanda / simplest-notebook / packages / notebook-extension / src / index.ts View on Github external
execute: args => {
      const current = getCurrent(args);

      if (current) {
        return NotebookActions.paste(current.notebook, 'below');
      }
    },
    isEnabled
github spyder-ide / spyder-notebook / spyder_notebook / server / src / commands.ts View on Github external
    execute: () => NotebookActions.paste(nbWidget.content, 'below')
  });
github jupyterlab / jupyterlab-data-explorer / jupyterlab / packages / notebook-extension / src / index.ts View on Github external
execute: args => {
      const current = getCurrent(args);

      if (current) {
        return NotebookActions.paste(current.content, 'above');
      }
    },
    isEnabled
github yuvipanda / simplest-notebook / packages / notebook-extension / src / index.ts View on Github external
execute: args => {
      const current = getCurrent(args);

      if (current) {
        return NotebookActions.paste(current.notebook, 'above');
      }
    },
    isEnabled
github jwkvam / jupyterlab-vim / src / index.ts View on Github external
execute: args => {
                const current = getCurrent(args);

                if (current) {
                    const { content } = current;
                    NotebookActions.paste(content, 'below');
                    content.mode = 'edit';
                }
            },
            isEnabled
github jupyterlab / jupyterlab / packages / notebook-extension / src / index.ts View on Github external
execute: args => {
      const current = getCurrent(args);

      if (current) {
        return NotebookActions.paste(current.notebook);
      }
    },
    isEnabled