@meowdown/react 0.59.1 → 0.60.0

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/dist/index.d.ts CHANGED
@@ -20,10 +20,8 @@ type EditorStateSnapshot = [markdown: string, selection: SelectionJSON$1];
20
20
  */
21
21
  interface EditorHandle {
22
22
  /**
23
- * Reconciles pending native input, then serializes the current document to
24
- * Markdown. If reconciliation changes the document, `onDocChange` runs
25
- * before this method returns. Can be expensive on large documents; call it
26
- * on demand (e.g. throttled) instead of on every change.
23
+ * Serializes the current document to Markdown. Can be expensive on large
24
+ * documents; call it on demand (e.g. throttled) instead of on every change.
27
25
  */
28
26
  getMarkdown: () => string;
29
27
  /** Replaces the whole document as a single undoable edit. */
@@ -38,10 +36,7 @@ interface EditorHandle {
38
36
  * `onDocChange`: the host cannot know the resulting document.
39
37
  */
40
38
  insertMarkdown: (markdown: string) => void;
41
- /**
42
- * Returns the current Markdown and selection, with the same pending-input
43
- * reconciliation (and possible synchronous `onDocChange`) as `getMarkdown`.
44
- */
39
+ /** Returns the current Markdown and selection. */
45
40
  getState: () => EditorStateSnapshot;
46
41
  /**
47
42
  * Replaces the document (if `markdown` is given) and restores `selection`:
package/dist/index.js CHANGED
@@ -1636,18 +1636,6 @@ function WikilinkMenu({ onWikilinkSearch }) {
1636
1636
 
1637
1637
  //#endregion
1638
1638
  //#region src/components/prosekit-editor.tsx
1639
- function isFlushableDOMObserver(value) {
1640
- if (typeof value !== "object" || value === null) return false;
1641
- const forceFlush = Reflect.get(value, "forceFlush");
1642
- return typeof Reflect.get(value, "flush") === "function" && (forceFlush === void 0 || typeof forceFlush === "function");
1643
- }
1644
- function flushPendingDOMChanges(editor) {
1645
- if (!editor.mounted) return;
1646
- const observer = Reflect.get(editor.view, "domObserver");
1647
- if (!isFlushableDOMObserver(observer)) return;
1648
- observer.forceFlush?.();
1649
- observer.flush();
1650
- }
1651
1639
  function resolveSelection(doc, selection) {
1652
1640
  if (selection === "start") return Selection.atStart(doc);
1653
1641
  if (selection === "end") return Selection.atEnd(doc);
@@ -1722,7 +1710,6 @@ function ProseKitEditor({ markMode = "focus", initialMarkdown, onDocChange, onSl
1722
1710
  }, []);
1723
1711
  useImperativeHandle(ref, () => {
1724
1712
  function getMarkdown() {
1725
- flushPendingDOMChanges(editor);
1726
1713
  return docToMarkdown(editor.state.doc, { frontmatter });
1727
1714
  }
1728
1715
  function getSelection() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@meowdown/react",
3
3
  "type": "module",
4
- "version": "0.59.1",
4
+ "version": "0.60.0",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -31,7 +31,7 @@
31
31
  "github-slugger": "^2.0.0",
32
32
  "lucide-react": "^1.27.0",
33
33
  "react-property": "^2.0.2",
34
- "@meowdown/core": "0.59.1"
34
+ "@meowdown/core": "0.60.0"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "react": "^19.0.0",