codex-team/editor.js

API: improve block.insert() interface to allow passing parameters as an object instead of set

Open

#1.817 aberto em 24 de nov. de 2021

Ver no GitHub
 (0 comments) (0 reactions) (0 assignees)TypeScript (1.985 forks)batch import
good first issue

Métricas do repositório

Stars
 (26.602 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

  1. Describe a problem.

The current interface of the api.blocks.insert accepts parameters as a list:

this.api.blocks.insert(
      toolName,
      undefined,
      undefined,
      index,
      undefined,
      currentBlock.isEmpty
);    
  1. Describe the solution you'd like. Mockups are welcome.

It would better to pass parameters as an object:

this.api.blocks.insert({
  type: toolName,
  index,
  replace: currentBlock.isEmpty
});    

Important. We need to save the backward capability.

Guia do colaborador