editate 0.6.2 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -213,6 +213,7 @@ export const App = () => {
213
213
  - Solid ([Demo](https://inokawa.github.io/editate/solid), [Source](./examples/solid))
214
214
  - Angular ([Demo](https://inokawa.github.io/editate/angular), [Source](./examples/angular))
215
215
  - Preact ([Demo](https://inokawa.github.io/editate/preact), [Source](./examples/preact))
216
+ - Alpine ([Demo](https://inokawa.github.io/editate/alpine), [Source](./examples/alpine))
216
217
  - Vanilla ([Demo](https://inokawa.github.io/editate/vanilla), [Source](./examples/vanilla))
217
218
 
218
219
  ...and more! Contribution welcome!
package/lib/editor.d.ts CHANGED
@@ -2,7 +2,7 @@ import type { StandardSchemaV1 } from "@standard-schema/spec";
2
2
  import type { DocNode, Fragment, Selection } from "./doc/types.js";
3
3
  import { type Operation } from "./doc/edit.js";
4
4
  import type { Parser } from "./dom/parser.js";
5
- type EditorCommand<A extends unknown[], T extends DocNode = DocNode> = (editor: Editor<T>, ...args: A) => void | undefined;
5
+ type EditorCommandOrPlugin<A extends unknown[], T extends DocNode = DocNode> = (editor: Editor<T>, ...args: A) => void | undefined;
6
6
  type EditorQuery<A extends unknown[], V, T extends DocNode = DocNode> = (editor: Editor<T>, ...args: A) => V;
7
7
  /**
8
8
  * Options of {@link createEditor}.
@@ -82,10 +82,10 @@ export interface Editor<T extends DocNode = DocNode> {
82
82
  apply(op: Operation | Operation[]): this;
83
83
  /**
84
84
  * Executes a function with editor bound as context.
85
- * @param fn {@link EditorCommand} or {@link EditorQuery}
85
+ * @param fn {@link EditorCommandOrPlugin} or {@link EditorQuery}
86
86
  * @param args arguments of the function
87
87
  */
88
- exec<A extends unknown[]>(fn: EditorCommand<A, T>, ...args: A): this;
88
+ exec<A extends unknown[]>(fn: EditorCommandOrPlugin<A, T>, ...args: A): this;
89
89
  exec<A extends unknown[], V>(fn: EditorQuery<A, V, T>, ...args: A): V;
90
90
  /**
91
91
  * A function to subscribe editor events.