@witchcraft/editor
    Preparing search index...
    • Commands that can split a block or modify it's position (indent/unindent) should not be called when the editor is in embedded block mode.

      This takes care of redirecting the command if possible (see WithOnTriggerByEmbeddedBlockOptions.onTriggerByEmbeddedBlock), otherwise it logs a warning.

      If the command should not be called at all and offers no redirect, don't pass the redirect parameter and it will log a different warning.

      You can use it in a command like this:

      commandName: (arg:any) => ({ commands, view, dispatch  }) => {
      const redirect = isEmbeddedBlock(view, "commandName", { args:[arg], view, commands, dispatch }))
      if (redirect.redirected) { return redirect.result }
      }

      Parameters

      • view: EditorView
      • name: string
      • Optionalredirect: { args: any[]; commands: SingleCommands; view: EditorView }

      Returns { redirected: true; result: any } | { redirected: false }