@open-elements/ui 0.9.0 → 0.10.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.
@@ -54,12 +54,44 @@ export interface UserMultiSelectProps {
54
54
  readonly translations: UserMultiSelectTranslations;
55
55
  }
56
56
 
57
+ /**
58
+ * A single action offered in the {@link MarkdownEditorProps.toolbar}. Names follow
59
+ * the underlying TipTap node/mark names so the mapping to commands is obvious.
60
+ * Unlink is deliberately absent — it is rendered contextually as part of `"link"`.
61
+ */
62
+ export type MarkdownToolbarAction =
63
+ | "bold"
64
+ | "italic"
65
+ | "strike"
66
+ | "code"
67
+ | "link"
68
+ | "h1"
69
+ | "h2"
70
+ | "h3"
71
+ | "bulletList"
72
+ | "orderedList"
73
+ | "taskList"
74
+ | "blockquote"
75
+ | "codeBlock"
76
+ | "horizontalRule";
77
+
57
78
  export interface MarkdownEditorProps {
58
79
  readonly value: string;
59
80
  readonly onChange: (value: string) => void;
60
81
  readonly placeholder?: string;
82
+ /** Actions offered in the toolbar, in render order. Defaults to `["bold", "italic"]`. */
83
+ readonly toolbar?: readonly MarkdownToolbarAction[];
61
84
  }
62
85
 
63
86
  export interface MarkdownViewProps {
64
87
  readonly content: string;
88
+ /**
89
+ * Called when the reader toggles a task list checkbox, with the complete
90
+ * updated Markdown. Omit to render checkboxes as read-only.
91
+ *
92
+ * Return a Promise to have the view disable interaction until it settles and
93
+ * revert the document if it rejects. Return nothing (`void`) to apply the
94
+ * toggle without a busy state or rollback.
95
+ */
96
+ readonly onChange?: (markdown: string) => void | Promise<void>;
65
97
  }