codex-team/editor.js

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

Offen

#1.817 geöffnet am 24.11.2021

 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (1.985 Forks)batch import
good first issue

Repository-Metriken

Stars
 (26.602 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

  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.

Contributor Guide