@domternal/core 0.14.0 → 1.0.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.cts CHANGED
@@ -134,6 +134,16 @@ interface EditorEvents {
134
134
  notionColorOpen: {
135
135
  anchorElement?: HTMLElement | null;
136
136
  };
137
+ /**
138
+ * Fired after the document has been marked for printing and before the
139
+ * browser's print dialog opens. Listeners run synchronously: this is the
140
+ * last moment to add page rules or set `document.title`.
141
+ */
142
+ beforePrint: {
143
+ root: HTMLElement;
144
+ };
145
+ /** Fired once the print dialog is done and the print marks are removed. */
146
+ afterPrint: undefined;
137
147
  }
138
148
  /**
139
149
  * Event names as a type
@@ -172,6 +182,19 @@ interface AnyExtension {
172
182
  * - number: Focus at specific position
173
183
  */
174
184
  type FocusPosition = boolean | 'start' | 'end' | 'all' | number | null;
185
+ /**
186
+ * The editing experience the editor is assembled for.
187
+ *
188
+ * - 'classic': the default toolbar-driven experience
189
+ * - 'notion': the block-based Notion-style experience; the editor paints
190
+ * `dm-notion-mode` on its `.dm-editor` host, and preset-aware extensions
191
+ * (the bubble menu contexts, the image placement controls) adapt
192
+ *
193
+ * Read the resolved value via `editor.preset`, never this option directly:
194
+ * consumers that predate the option declare Notion mode with the theme
195
+ * class alone, and the getter honors that.
196
+ */
197
+ type EditorPreset = 'classic' | 'notion';
175
198
  /**
176
199
  * Configuration options for creating an Editor instance
177
200
  */
@@ -203,6 +226,15 @@ interface EditorOptions {
203
226
  * @default true
204
227
  */
205
228
  editable?: boolean;
229
+ /**
230
+ * Editing experience preset. `'notion'` paints `dm-notion-mode` on the
231
+ * `.dm-editor` host and switches preset-aware extensions to their Notion
232
+ * behavior, so one option replaces setting the class by hand. When omitted,
233
+ * a `dm-notion-mode` class already on the host still counts as Notion;
234
+ * an explicit `'classic'` overrides even that.
235
+ * @default undefined (resolved from the host class, else 'classic')
236
+ */
237
+ preset?: EditorPreset;
206
238
  /**
207
239
  * Accessible label for the editor.
208
240
  * Sets aria-label on the contenteditable element.
@@ -774,12 +806,25 @@ declare class ExtensionManager {
774
806
  /**
775
807
  * Recursively flattens extensions by expanding addExtensions()
776
808
  * This allows extension bundles like StarterKit to work
809
+ *
810
+ * `autoIncluded` collects everything that arrived through an
811
+ * `addExtensions()` rather than from the caller's own list, which is what
812
+ * lets deduplication tell a default apart from a choice.
777
813
  */
778
814
  private flattenExtensions;
779
815
  /**
780
- * Removes duplicate extensions by name, keeping the last occurrence.
781
- * This allows parent extensions to auto-include children via addExtensions()
782
- * while letting users override with explicitly configured versions.
816
+ * Removes duplicate extensions by name.
817
+ *
818
+ * A version the caller listed themselves always wins over one a bundle
819
+ * included on their behalf, and position does not enter into it. Keeping
820
+ * the last occurrence alone said the same thing only while every bundle was
821
+ * listed first, which is the habit for StarterKit and no rule at all: an
822
+ * extension that includes a default and is written LOWER in the list, as
823
+ * `Export` and its `Print` are, silently replaced the configured copy
824
+ * above it and the caller's options went missing with it.
825
+ *
826
+ * Between two of the same kind the later one still wins, so two bundles
827
+ * offering the same default resolve as they always have.
783
828
  */
784
829
  private deduplicateExtensions;
785
830
  /**
@@ -1085,6 +1130,12 @@ declare class Editor extends EventEmitter<EditorEvents> {
1085
1130
  * True while EditorView's constructor runs; see buildViewDispatch.
1086
1131
  */
1087
1132
  private _isViewConstructing;
1133
+ /**
1134
+ * The `.dm-editor` host this editor painted `dm-notion-mode` onto because
1135
+ * of `preset: 'notion'`. Tracked so destroy() removes only a class the
1136
+ * editor itself added, never one the consumer wrote.
1137
+ */
1138
+ private _presetClassHost;
1088
1139
  /**
1089
1140
  * Creates a new Editor instance
1090
1141
  *
@@ -1105,6 +1156,26 @@ declare class Editor extends EventEmitter<EditorEvents> {
1105
1156
  * Checks if the editor is editable
1106
1157
  */
1107
1158
  get isEditable(): boolean;
1159
+ /**
1160
+ * The resolved editing-experience preset.
1161
+ *
1162
+ * The `preset` option wins when provided (so an explicit 'classic' can
1163
+ * opt out of everything). Otherwise a `dm-notion-mode` class on or above
1164
+ * the view counts as 'notion': consumers that predate the option declare
1165
+ * Notion mode with the theme class alone, and behavior must follow what
1166
+ * the user actually sees. Resolved on every read, not cached, so a class
1167
+ * toggled at runtime is picked up.
1168
+ */
1169
+ get preset(): EditorPreset;
1170
+ /**
1171
+ * Paints `dm-notion-mode` on the `.dm-editor` host when the editor was
1172
+ * created with `preset: 'notion'`. Runs during creation, and framework
1173
+ * wrappers call it again after adopting the view's DOM: they construct
1174
+ * the editor in a detached element, so the creation-time run cannot see
1175
+ * the host yet. Idempotent; a no-op for any other preset. Only a class
1176
+ * added here is removed again on destroy.
1177
+ */
1178
+ adoptPresetClass(): void;
1108
1179
  /**
1109
1180
  * Checks if the editor content is empty
1110
1181
  */
@@ -1381,6 +1452,11 @@ interface ExtensionEditor {
1381
1452
  readonly schema: unknown;
1382
1453
  readonly commands: SingleCommands;
1383
1454
  readonly isEditable: boolean;
1455
+ /**
1456
+ * Resolved editing-experience preset; see Editor.preset. Optional so
1457
+ * minimal editor mocks keep compiling; treat undefined as 'classic'.
1458
+ */
1459
+ readonly preset?: EditorPreset;
1384
1460
  }
1385
1461
  /**
1386
1462
  * Any extension type (forward declaration)
@@ -1749,6 +1825,11 @@ interface NodeEditorContext {
1749
1825
  nodes: Record<string, NodeType>;
1750
1826
  };
1751
1827
  readonly commands: Record<string, (...args: unknown[]) => boolean>;
1828
+ /**
1829
+ * Resolved editing-experience preset; see Editor.preset. Optional so
1830
+ * minimal editor mocks keep compiling; treat undefined as 'classic'.
1831
+ */
1832
+ readonly preset?: EditorPreset;
1752
1833
  }
1753
1834
  /**
1754
1835
  * Context interface for Node config methods.
@@ -2089,11 +2170,21 @@ interface MarkSchemaProperties {
2089
2170
  * Marks that this mark excludes (cannot coexist with)
2090
2171
  *
2091
2172
  * - '_' excludes all marks
2092
- * - Space-separated mark names exclude specific marks
2173
+ * - Space-separated mark names or group names exclude those marks
2093
2174
  * - Empty string or undefined means no exclusions
2094
2175
  *
2176
+ * Note: mark NAMES listed here must exist in the schema or schema
2177
+ * compilation throws, so extensions meant to work in minimal setups
2178
+ * should exclude by group. The core formatting marks (bold, italic,
2179
+ * underline, strike, code, sub/superscript, textStyle) all declare
2180
+ * group 'formatting', and Code excludes that group: a third-party
2181
+ * formatting mark joins the exclusion by declaring the same group,
2182
+ * while semantic marks (link, comment anchors) stay combinable with
2183
+ * code by staying out of it.
2184
+ *
2095
2185
  * @example 'code' - excludes code mark
2096
2186
  * @example 'bold italic' - excludes bold and italic
2187
+ * @example 'formatting' - excludes the formatting group
2097
2188
  * @example '_' - excludes all other marks
2098
2189
  */
2099
2190
  excludes?: string;
@@ -2104,6 +2195,17 @@ interface MarkSchemaProperties {
2104
2195
  * @example 'formatting', 'inline'
2105
2196
  */
2106
2197
  group?: string;
2198
+ /**
2199
+ * Whether block duplication keeps this mark on the copied content
2200
+ *
2201
+ * Set false for marks that reference identity-bearing external state
2202
+ * (a comment thread anchor, a suggestion id): duplicating such a mark
2203
+ * would make one identity point at two unrelated places, so block
2204
+ * duplicate strips it from the copy instead.
2205
+ *
2206
+ * @default true
2207
+ */
2208
+ keepOnDuplicate?: boolean;
2107
2209
  /**
2108
2210
  * Whether this mark can span multiple nodes
2109
2211
  *
@@ -2696,33 +2798,499 @@ declare function announce(view: {
2696
2798
  * UNLESS the command moved focus into a popover input the user is meant to type
2697
2799
  * into (currently the math LaTeX field).
2698
2800
  *
2699
- * The refocus exists so keyboard (Enter / Space) activation of a plain command
2700
- * button returns the caret to the document and keeps the native `::selection`
2701
- * highlight. Mouse clicks already keep focus via `mousedown.preventDefault()`.
2801
+ * The refocus exists so keyboard (Enter / Space) activation of a plain command
2802
+ * button returns the caret to the document and keeps the native `::selection`
2803
+ * highlight. Mouse clicks already keep focus via `mousedown.preventDefault()`.
2804
+ *
2805
+ * A focused element is treated as such a popover when it sits inside a
2806
+ * `[data-dm-editor-ui]` element that is NOT the toolbar / bubble-menu / floating-
2807
+ * menu chrome and is not inside the contenteditable. To opt in, a popover must
2808
+ * render outside those surfaces, carry `data-dm-editor-ui`, and focus itself
2809
+ * synchronously while the opening command dispatches (so `activeElement` reflects
2810
+ * it before this frame runs).
2811
+ */
2812
+ declare function refocusEditorAfterCommand(view: {
2813
+ dom: Element;
2814
+ focus: () => void;
2815
+ }): void;
2816
+
2817
+ /**
2818
+ * Default `contexts` map for a bubble menu when the consumer has not
2819
+ * supplied one. Returns a richer item set when the editor resolves to the
2820
+ * Notion preset (the `preset` option, or the `.dm-notion-mode` class the
2821
+ * getter also honors), so the bubble menu mirrors the Notion UX by leading
2822
+ * with the `ai` and `comment` selection actions, then offering the block-type
2823
+ * dropdown and `link` ahead of the formatting marks.
2824
+ *
2825
+ * Consumers can always override by passing their own `contexts` prop.
2826
+ */
2827
+ declare function defaultBubbleContexts(editor: Editor): Record<string, string[]>;
2828
+
2829
+ /**
2830
+ * Drop the separators that ended up with nothing to separate.
2831
+ *
2832
+ * A menu built from a flat list of names (`['ai', '|', 'bold', ...]`) resolves
2833
+ * each name against the extensions the editor actually loaded, and silently
2834
+ * skips the ones it cannot find. That is what lets one default list serve every
2835
+ * build: an editor without the AI extension simply does not show `ai`. The
2836
+ * separators do not take part in that, because a `|` always resolves. So the
2837
+ * list shrinks around them and they stay, and a bar that was drawn between two
2838
+ * groups is left leading the menu, trailing it, or standing next to another
2839
+ * bar with nothing in between.
2840
+ *
2841
+ * This is the pass that finishes the job. Run it after everything that can
2842
+ * remove an item, which includes schema filtering as well as name resolution:
2843
+ * a separator can be orphaned by a selection whose node type does not allow
2844
+ * the marks on one side of it, and that is decided per transaction rather than
2845
+ * once at construction.
2846
+ *
2847
+ * The trailing buttons a menu appends afterwards are not visible here, so a
2848
+ * caller that appends its own leading separator has to ask whether anything
2849
+ * came before it. What this guarantees is the half it can: the list is empty,
2850
+ * or it begins and ends with something that is not a separator.
2851
+ *
2852
+ * Written against `{ type: string }` rather than a menu's item union because
2853
+ * every surface spells its item type differently and none of the differences
2854
+ * matter here.
2855
+ *
2856
+ * A list with nothing to drop comes back as the SAME array, not a copy. React
2857
+ * and Vue hand this straight to their state, and a fresh array every time is a
2858
+ * re-render every time: this runs once per transaction, and pointer motion
2859
+ * alone dispatches those. Most lists never need collapsing, so most passes
2860
+ * cost nothing.
2861
+ */
2862
+ declare function collapseSeparators<T extends {
2863
+ type: string;
2864
+ }>(items: readonly T[]): T[];
2865
+
2866
+ /**
2867
+ * Extension - Base class for all extensions
2868
+ *
2869
+ * Extensions provide functionality without contributing to the schema.
2870
+ * For schema contributions, use Node (for block/inline nodes) or Mark (for inline formatting).
2871
+ *
2872
+ * Three-tier model:
2873
+ * - Extension (type: 'extension') → Pure functionality (History, Placeholder, etc.)
2874
+ * - Node (type: 'node') → Schema nodes (Paragraph, Heading, etc.)
2875
+ * - Mark (type: 'mark') → Schema marks (Bold, Italic, etc.)
2876
+ *
2877
+ * @example
2878
+ * const History = Extension.create({
2879
+ * name: 'history',
2880
+ * addOptions() {
2881
+ * return { depth: 100 };
2882
+ * },
2883
+ * addKeyboardShortcuts() {
2884
+ * return {
2885
+ * 'Mod-z': () => this.editor.commands.undo(),
2886
+ * 'Mod-Shift-z': () => this.editor.commands.redo(),
2887
+ * };
2888
+ * },
2889
+ * });
2890
+ */
2891
+
2892
+ /**
2893
+ * Editor interface for Extension
2894
+ * Forward declaration to avoid circular dependency
2895
+ */
2896
+ interface ExtensionEditorInterface {
2897
+ readonly state: EditorState;
2898
+ readonly view: EditorView;
2899
+ readonly schema: unknown;
2900
+ readonly commands: SingleCommands;
2901
+ }
2902
+ /**
2903
+ * Marks an object as a Domternal extension, recognisably across copies.
2904
+ *
2905
+ * `Symbol.for` rather than `Symbol()`: the whole point is that an extension
2906
+ * built by a SECOND physical copy of this module still carries a mark the
2907
+ * first copy can read. A copy-local symbol would be a different key and every
2908
+ * foreign extension would look like a hand-written object instead.
2909
+ *
2910
+ * The value is deliberately `true` rather than a per-copy token. Which copy an
2911
+ * extension came from is answered by `instanceof Extension`, and that answer is
2912
+ * exact; this only separates "a Domternal extension from somewhere" from "a
2913
+ * plain object somebody passed in", which must keep working as it always has.
2914
+ */
2915
+ declare const EXTENSION_BRAND: unique symbol;
2916
+ /**
2917
+ * Base class for all extensions
2918
+ *
2919
+ * @typeParam Options - Extension options type
2920
+ * @typeParam Storage - Extension storage type
2921
+ */
2922
+ declare class Extension<Options = unknown, Storage = unknown> {
2923
+ /**
2924
+ * Brand read by `ExtensionManager` to tell an extension built by another
2925
+ * copy of `@domternal/core` from a plain object. See `EXTENSION_BRAND`.
2926
+ */
2927
+ readonly [EXTENSION_BRAND] = true;
2928
+ /**
2929
+ * Extension type identifier
2930
+ * Used to distinguish between Extension, Node, and Mark
2931
+ * Subclasses override this to 'node' or 'mark'
2932
+ */
2933
+ readonly type: 'extension' | 'node' | 'mark';
2934
+ /**
2935
+ * Unique extension name
2936
+ */
2937
+ readonly name: string;
2938
+ /**
2939
+ * Extension options (immutable after creation)
2940
+ */
2941
+ readonly options: Options;
2942
+ /**
2943
+ * Extension storage (mutable state)
2944
+ * Accessible via editor.storage[extensionName]
2945
+ */
2946
+ storage: Storage;
2947
+ /**
2948
+ * The original configuration object
2949
+ */
2950
+ readonly config: ExtensionConfig<Options, Storage>;
2951
+ /**
2952
+ * Editor instance (set by ExtensionManager after creation)
2953
+ * null until ExtensionManager binds it
2954
+ */
2955
+ editor: ExtensionEditorInterface | null;
2956
+ /**
2957
+ * Reference to the parent config method when using extend().
2958
+ * Set temporarily during config method execution so overridden
2959
+ * methods can call `this.parent?.()` to invoke the original.
2960
+ */
2961
+ parent?: ((...args: unknown[]) => unknown) | undefined;
2962
+ /**
2963
+ * Protected constructor - use Extension.create() instead
2964
+ */
2965
+ protected constructor(config: ExtensionConfig<Options, Storage>);
2966
+ /**
2967
+ * Creates a new extension instance
2968
+ *
2969
+ * @param config - Extension configuration
2970
+ * @returns New extension instance
2971
+ *
2972
+ * @example
2973
+ * const MyExtension = Extension.create({
2974
+ * name: 'myExtension',
2975
+ * addOptions() {
2976
+ * return { enabled: true };
2977
+ * },
2978
+ * });
2979
+ */
2980
+ static create<O = unknown, S = unknown>(config: ExtensionConfig<O, S>): Extension<O, S>;
2981
+ /**
2982
+ * Creates a new extension with merged options
2983
+ * Original extension is not modified
2984
+ *
2985
+ * **Note:** Options are merged shallowly using object spread (`...`).
2986
+ * Nested objects are replaced entirely, not deeply merged.
2987
+ *
2988
+ * @param options - Options to merge with existing options
2989
+ * @returns New extension instance with merged options
2990
+ *
2991
+ * @example
2992
+ * const configured = MyExtension.configure({ enabled: false });
2993
+ *
2994
+ * @example
2995
+ * // Shallow merge behavior with nested objects:
2996
+ * // Given: options = { nested: { a: 1, b: 2 } }
2997
+ * // configure({ nested: { b: 3 } })
2998
+ * // Result: { nested: { b: 3 } } - 'a' is lost!
2999
+ * // To preserve nested values, spread manually:
3000
+ * // configure({ nested: { ...original.options.nested, b: 3 } })
3001
+ */
3002
+ configure(options: Partial<Options>): Extension<Options, Storage>;
3003
+ /**
3004
+ * Returns a fresh, unbound copy built from the same `config`: `editor` reset to
3005
+ * null and `options`/`storage` re-derived, while `configure()`/`extend()`
3006
+ * results are preserved (they live in `config`). Polymorphic: a `Node`/`Mark`
3007
+ * clones to its own subclass.
3008
+ *
3009
+ * `ExtensionManager` clones every extension so each editor owns its instances
3010
+ * and binding one editor can't mutate extensions shared with another.
3011
+ */
3012
+ clone(): Extension<Options, Storage>;
3013
+ /**
3014
+ * Creates a new extension with extended configuration
3015
+ * Original extension is not modified
3016
+ *
3017
+ * **Note:** Config is merged shallowly using object spread (`...`).
3018
+ * Config properties (like `addCommands`, `addKeyboardShortcuts`) are
3019
+ * replaced entirely, not combined with the base extension's config.
3020
+ *
3021
+ * @param extendedConfig - Configuration to extend/override
3022
+ * @returns New extension instance with extended config
3023
+ *
3024
+ * @example
3025
+ * const Extended = MyExtension.extend({
3026
+ * name: 'extendedExtension',
3027
+ * addCommands() {
3028
+ * return { customCommand: () => ({ tr }) => true };
3029
+ * },
3030
+ * });
3031
+ *
3032
+ * @example
3033
+ * // To preserve base extension's commands while adding new ones:
3034
+ * const Extended = BaseExtension.extend({
3035
+ * addCommands() {
3036
+ * const baseCommands = BaseExtension.config.addCommands?.call(this) ?? {};
3037
+ * return {
3038
+ * ...baseCommands,
3039
+ * newCommand: () => ({ tr }) => true,
3040
+ * };
3041
+ * },
3042
+ * });
3043
+ */
3044
+ extend<ExtendedOptions = Options, ExtendedStorage = Storage>(extendedConfig: Partial<ExtensionConfigBase<ExtendedOptions, ExtendedStorage>> & ThisType<ExtensionContext<ExtendedOptions, ExtendedStorage>>): Extension<ExtendedOptions, ExtendedStorage>;
3045
+ }
3046
+
3047
+ /**
3048
+ * Floating menu shown when text is selected. Contextual formatting toolbar.
3049
+ */
3050
+
3051
+ declare const bubbleMenuPluginKey: PluginKey<any>;
3052
+ interface BubbleMenuOptions {
3053
+ /**
3054
+ * The HTML element that contains the menu.
3055
+ * Must be provided by the user.
3056
+ */
3057
+ element: HTMLElement | null;
3058
+ /**
3059
+ * Duration in ms to wait before showing the menu.
3060
+ * @default 0
3061
+ */
3062
+ updateDelay: number;
3063
+ /**
3064
+ * Function to determine if the menu should be shown.
3065
+ * By default, shows for text selections with actual content in an editable editor.
3066
+ */
3067
+ shouldShow: (props: {
3068
+ editor: Editor;
3069
+ view: EditorView;
3070
+ state: EditorState;
3071
+ from: number;
3072
+ to: number;
3073
+ }) => boolean;
3074
+ /**
3075
+ * Placement of the menu relative to the selection.
3076
+ * @default 'top'
3077
+ */
3078
+ placement: 'top' | 'bottom';
3079
+ /**
3080
+ * Offset in pixels from the selection.
3081
+ * @default 8
3082
+ */
3083
+ offset: number;
3084
+ }
3085
+ interface CreateBubbleMenuPluginOptions {
3086
+ pluginKey: PluginKey;
3087
+ editor: Editor;
3088
+ element: HTMLElement;
3089
+ shouldShow?: BubbleMenuOptions['shouldShow'];
3090
+ placement?: 'top' | 'bottom';
3091
+ offset?: number;
3092
+ updateDelay?: number;
3093
+ }
3094
+ /**
3095
+ * Creates a standalone BubbleMenu ProseMirror plugin.
3096
+ * Can be used by framework wrappers (Angular, React, Vue) to create the plugin
3097
+ * independently of the extension system.
3098
+ */
3099
+ declare function createBubbleMenuPlugin(options: CreateBubbleMenuPluginOptions): Plugin;
3100
+ declare const BubbleMenu: Extension<BubbleMenuOptions, unknown>;
3101
+
3102
+ /**
3103
+ * The bubble menu's item pipeline: what the editor registered, what the
3104
+ * selection is, and what the consumer asked for, resolved into the finished
3105
+ * list a menu renders.
3106
+ *
3107
+ * It lives in core because four surfaces need it and each of them is only a
3108
+ * renderer. Vanilla, React, Vue and Angular each carried their own copy of
3109
+ * every function below, four transcriptions of one algorithm kept in step by
3110
+ * hand. They did not stay in step: the separator cleanup that this module now
3111
+ * ends with had to be written four times to fix one defect, which is the
3112
+ * clearest argument that the algorithm was never theirs to hold.
3113
+ *
3114
+ * ProseMirror shapes are duck-typed here rather than imported. A selection or
3115
+ * a schema can arrive from a different copy of prosemirror-state, and
3116
+ * `instanceof` across two copies is false for objects that are otherwise
3117
+ * identical; reading the fields is the check that survives it.
3118
+ */
3119
+
3120
+ interface ResolvedPosShape {
3121
+ parent: {
3122
+ type: {
3123
+ name: string;
3124
+ spec: {
3125
+ marks?: string;
3126
+ };
3127
+ };
3128
+ };
3129
+ depth: number;
3130
+ node: (depth: number) => {
3131
+ type: {
3132
+ name: string;
3133
+ };
3134
+ };
3135
+ }
3136
+ interface SelectionShape {
3137
+ empty: boolean;
3138
+ $from: ResolvedPosShape;
3139
+ $to: ResolvedPosShape;
3140
+ node?: {
3141
+ type: {
3142
+ name: string;
3143
+ };
3144
+ };
3145
+ }
3146
+ interface BubbleMenuSeparator {
3147
+ type: 'separator';
3148
+ name: string;
3149
+ }
3150
+ type BubbleMenuItem = ToolbarButton | ToolbarDropdown | BubbleMenuSeparator;
3151
+ /**
3152
+ * What a consumer may say about one context: an explicit name list, `true`
3153
+ * for every formatting mark the schema allows there, or `null` for no menu.
3154
+ */
3155
+ type BubbleContexts = Record<string, string[] | true | null>;
3156
+ interface BubbleItemMaps {
3157
+ itemMap: Map<string, ToolbarButton>;
3158
+ dropdownMap: Map<string, ToolbarDropdown>;
3159
+ /** Bubble defaults indexed by context name (e.g. 'text', 'codeBlock'). */
3160
+ bubbleDefaults: Map<string, BubbleMenuItem[]>;
3161
+ }
3162
+ /**
3163
+ * Walks `editor.toolbarItems` and indexes them by name. Dropdowns are kept
3164
+ * separately so the bubble menu can resolve them by name (e.g. text-align).
3165
+ *
3166
+ * A dropdown's children are indexed as buttons as well, which is what lets a
3167
+ * consumer name one alignment directly instead of the whole dropdown.
3168
+ */
3169
+ declare function buildBubbleItemMaps(editor: Editor): BubbleItemMaps;
3170
+ /**
3171
+ * Resolve a name array to BubbleMenuItems via the item/dropdown maps.
3172
+ * Dropdowns take priority over buttons sharing the same name. Pipe `|`
3173
+ * tokens become separator entries.
3174
+ *
3175
+ * A name the editor does not carry is skipped, which is what lets one list
3176
+ * serve every build: a default naming `ai` shows it where the Pro extension
3177
+ * is installed and says nothing where it is not. The separator beside such a
3178
+ * name is not skipped with it, because a `|` always resolves; that is what
3179
+ * `collapseSeparators` is for, and why it has to run after this rather than
3180
+ * inside it.
3181
+ */
3182
+ declare function resolveBubbleNames(names: string[], itemMap: Map<string, ToolbarButton>, dropdownMap: Map<string, ToolbarDropdown>): BubbleMenuItem[];
3183
+ /**
3184
+ * All `format`-group buttons sorted by priority (used by the `true` shorthand
3185
+ * to show "all format marks for this context").
3186
+ */
3187
+ declare function getBubbleFormatItems(itemMap: Map<string, ToolbarButton>): ToolbarButton[];
3188
+ /**
3189
+ * Determine the active bubble-menu context based on the selection. Returns
3190
+ * `null` when no context matches (menu should not show).
3191
+ *
3192
+ * Resolution order:
3193
+ * 1. CellSelection (`$anchorCell`) - no menu inside table cell selections
3194
+ * 2. NodeSelection (image, HR, etc.) - return the node's type name
3195
+ * 3. Empty selection - no context (caret-only)
3196
+ * 4. Inside a table cell - return 'table' (when from/to share a cell)
3197
+ * 5. `$from.parent.type.name` if listed in contexts
3198
+ * 6. 'text' if the parent allows marks
3199
+ */
3200
+ declare function detectBubbleContext(selection: SelectionShape, ctxs: BubbleContexts): string | null;
3201
+ /**
3202
+ * Filter items by what the schema actually allows in the given context.
3203
+ * E.g. inside a `codeBlock` node, marks like Bold/Italic aren't permitted.
3204
+ *
3205
+ * Pass-through for 'text' and 'table' contexts (schema check would be
3206
+ * lossy there because marks are allowed but some items still apply).
3207
+ */
3208
+ declare function filterBubbleItemsBySchema(editor: Editor, contextName: string, schemaItems: ToolbarButton[]): ToolbarButton[];
3209
+ /** Detect whether `$pos` is inside a table cell (cell or header). */
3210
+ declare function isInsideTableCell($pos: ResolvedPosShape): boolean;
3211
+ interface ResolveBubbleMenuItemsOptions {
3212
+ editor: Editor;
3213
+ maps: BubbleItemMaps;
3214
+ /** The consumer's `contexts`, or undefined for the fixed-list path. */
3215
+ contexts?: BubbleContexts | undefined;
3216
+ /**
3217
+ * The list to show when `contexts` is absent and the selection is not a
3218
+ * node the editor registered a default for. Already resolved, because it
3219
+ * never changes with the selection.
3220
+ */
3221
+ fallbackItems: BubbleMenuItem[];
3222
+ }
3223
+ /**
3224
+ * The whole decision, in one place: which list this selection gets, filtered
3225
+ * by what the schema allows, with the orphaned separators removed.
3226
+ *
3227
+ * The cleanup is the last step rather than a step inside name resolution
3228
+ * because filtering removes items too: a selection inside a node type that
3229
+ * refuses a mark strands a separator exactly the way a missing extension
3230
+ * does, and only decides it per transaction.
3231
+ */
3232
+ declare function resolveBubbleMenuItems(options: ResolveBubbleMenuItemsOptions): BubbleMenuItem[];
3233
+ /**
3234
+ * The default `shouldShow`, which has to agree with the resolution above:
3235
+ * a menu that opens on a selection resolving to nothing is an empty box, and
3236
+ * one that stays shut on a selection with items is a feature nobody can
3237
+ * reach.
3238
+ */
3239
+ declare function createBubbleShouldShow(maps: BubbleItemMaps, contexts?: BubbleContexts): BubbleMenuOptions['shouldShow'];
3240
+
3241
+ /**
3242
+ * Two packages disagreeing about which copy of `module` they use.
3243
+ *
3244
+ * `message` is the whole story, already formatted: what broke, why it cannot
3245
+ * work, and the one-line fix for each package manager and bundler. Callers
3246
+ * decide only whether to warn or throw.
3247
+ */
3248
+ interface ProseMirrorCopyConflict {
3249
+ /** Package whose copies disagree, e.g. `prosemirror-model`. */
3250
+ module: string;
3251
+ /** Package that registered the copy the page settled on. */
3252
+ firstConsumer: string;
3253
+ /** Package that arrived with a different one. */
3254
+ secondConsumer: string;
3255
+ /** Ready-to-print explanation and fix. */
3256
+ message: string;
3257
+ }
3258
+ /**
3259
+ * Records which copy of `module` a package is using, and reports a conflict
3260
+ * when that disagrees with the copy already registered.
3261
+ *
3262
+ * Returns `null` on the first registration and on every later one that
3263
+ * matches, so the happy path costs one `Map` lookup. Registering a conflicting
3264
+ * copy does NOT replace the recorded one: the first registration wins, which
3265
+ * keeps `firstConsumer` stable no matter how many latecomers arrive.
3266
+ *
3267
+ * @param module Package name, e.g. `prosemirror-model`.
3268
+ * @param copy An export of that package, the same one for every caller. See
3269
+ * the contract in this file's header.
3270
+ * @param consumer Package doing the registering, used in the message.
3271
+ */
3272
+ declare function registerProseMirrorCopy(module: string, copy: object, consumer: string): ProseMirrorCopyConflict | null;
3273
+ /**
3274
+ * Registers a copy and throws when it conflicts.
3275
+ *
3276
+ * For the call sites where a duplicate is already fatal and the only question
3277
+ * is which error the developer reads: the collaboration binding, for one,
3278
+ * throws `Can not convert <> to a Fragment` from inside y-prosemirror one call
3279
+ * later, naming neither package involved.
2702
3280
  *
2703
- * A focused element is treated as such a popover when it sits inside a
2704
- * `[data-dm-editor-ui]` element that is NOT the toolbar / bubble-menu / floating-
2705
- * menu chrome and is not inside the contenteditable. To opt in, a popover must
2706
- * render outside those surfaces, carry `data-dm-editor-ui`, and focus itself
2707
- * synchronously while the opening command dispatches (so `activeElement` reflects
2708
- * it before this frame runs).
3281
+ * @throws ExtensionConfigurationError so `new Editor(...)` fails loudly rather
3282
+ * than being swallowed by the per-extension error isolation.
2709
3283
  */
2710
- declare function refocusEditorAfterCommand(view: {
2711
- dom: Element;
2712
- focus: () => void;
2713
- }): void;
2714
-
3284
+ declare function assertSingleProseMirrorCopy(module: string, copy: object, consumer: string): void;
2715
3285
  /**
2716
- * Default `contexts` map for a bubble menu when the consumer has not
2717
- * supplied one. Returns a richer item set when the editor (or any
2718
- * ancestor) carries the `.dm-notion-mode` class - that class is the
2719
- * project-wide signal that the host is rendering Notion-style UX, so
2720
- * the bubble menu mirrors it by leading with `ai` and including `link`
2721
- * and `textAlign`.
3286
+ * Registers a copy and warns once per module, for call sites where a duplicate
3287
+ * is a strong signal but not necessarily fatal yet: two editors built from two
3288
+ * copies of the core work fine until a node crosses between them.
2722
3289
  *
2723
- * Consumers can always override by passing their own `contexts` prop.
3290
+ * Deduped through `globalThis` as well, so a page holding two copies of this
3291
+ * module still prints one warning rather than one per editor per copy.
2724
3292
  */
2725
- declare function defaultBubbleContexts(editor: Editor): Record<string, string[]>;
3293
+ declare function warnOnDuplicateProseMirrorCopy(module: string, copy: object, consumer: string): ProseMirrorCopyConflict | null;
2726
3294
 
2727
3295
  interface InsertAsListItemChildArgs {
2728
3296
  /** Existing transaction to mutate. Caller dispatches. */
@@ -3440,168 +4008,6 @@ declare const findChildren: (node: Node$1, predicate: (node: Node$1) => boolean)
3440
4008
 
3441
4009
  declare const defaultBlockAt: (match: ContentMatch) => NodeType | null;
3442
4010
 
3443
- /**
3444
- * Extension - Base class for all extensions
3445
- *
3446
- * Extensions provide functionality without contributing to the schema.
3447
- * For schema contributions, use Node (for block/inline nodes) or Mark (for inline formatting).
3448
- *
3449
- * Three-tier model:
3450
- * - Extension (type: 'extension') → Pure functionality (History, Placeholder, etc.)
3451
- * - Node (type: 'node') → Schema nodes (Paragraph, Heading, etc.)
3452
- * - Mark (type: 'mark') → Schema marks (Bold, Italic, etc.)
3453
- *
3454
- * @example
3455
- * const History = Extension.create({
3456
- * name: 'history',
3457
- * addOptions() {
3458
- * return { depth: 100 };
3459
- * },
3460
- * addKeyboardShortcuts() {
3461
- * return {
3462
- * 'Mod-z': () => this.editor.commands.undo(),
3463
- * 'Mod-Shift-z': () => this.editor.commands.redo(),
3464
- * };
3465
- * },
3466
- * });
3467
- */
3468
-
3469
- /**
3470
- * Editor interface for Extension
3471
- * Forward declaration to avoid circular dependency
3472
- */
3473
- interface ExtensionEditorInterface {
3474
- readonly state: EditorState;
3475
- readonly view: EditorView;
3476
- readonly schema: unknown;
3477
- readonly commands: SingleCommands;
3478
- }
3479
- /**
3480
- * Base class for all extensions
3481
- *
3482
- * @typeParam Options - Extension options type
3483
- * @typeParam Storage - Extension storage type
3484
- */
3485
- declare class Extension<Options = unknown, Storage = unknown> {
3486
- /**
3487
- * Extension type identifier
3488
- * Used to distinguish between Extension, Node, and Mark
3489
- * Subclasses override this to 'node' or 'mark'
3490
- */
3491
- readonly type: 'extension' | 'node' | 'mark';
3492
- /**
3493
- * Unique extension name
3494
- */
3495
- readonly name: string;
3496
- /**
3497
- * Extension options (immutable after creation)
3498
- */
3499
- readonly options: Options;
3500
- /**
3501
- * Extension storage (mutable state)
3502
- * Accessible via editor.storage[extensionName]
3503
- */
3504
- storage: Storage;
3505
- /**
3506
- * The original configuration object
3507
- */
3508
- readonly config: ExtensionConfig<Options, Storage>;
3509
- /**
3510
- * Editor instance (set by ExtensionManager after creation)
3511
- * null until ExtensionManager binds it
3512
- */
3513
- editor: ExtensionEditorInterface | null;
3514
- /**
3515
- * Reference to the parent config method when using extend().
3516
- * Set temporarily during config method execution so overridden
3517
- * methods can call `this.parent?.()` to invoke the original.
3518
- */
3519
- parent?: ((...args: unknown[]) => unknown) | undefined;
3520
- /**
3521
- * Protected constructor - use Extension.create() instead
3522
- */
3523
- protected constructor(config: ExtensionConfig<Options, Storage>);
3524
- /**
3525
- * Creates a new extension instance
3526
- *
3527
- * @param config - Extension configuration
3528
- * @returns New extension instance
3529
- *
3530
- * @example
3531
- * const MyExtension = Extension.create({
3532
- * name: 'myExtension',
3533
- * addOptions() {
3534
- * return { enabled: true };
3535
- * },
3536
- * });
3537
- */
3538
- static create<O = unknown, S = unknown>(config: ExtensionConfig<O, S>): Extension<O, S>;
3539
- /**
3540
- * Creates a new extension with merged options
3541
- * Original extension is not modified
3542
- *
3543
- * **Note:** Options are merged shallowly using object spread (`...`).
3544
- * Nested objects are replaced entirely, not deeply merged.
3545
- *
3546
- * @param options - Options to merge with existing options
3547
- * @returns New extension instance with merged options
3548
- *
3549
- * @example
3550
- * const configured = MyExtension.configure({ enabled: false });
3551
- *
3552
- * @example
3553
- * // Shallow merge behavior with nested objects:
3554
- * // Given: options = { nested: { a: 1, b: 2 } }
3555
- * // configure({ nested: { b: 3 } })
3556
- * // Result: { nested: { b: 3 } } - 'a' is lost!
3557
- * // To preserve nested values, spread manually:
3558
- * // configure({ nested: { ...original.options.nested, b: 3 } })
3559
- */
3560
- configure(options: Partial<Options>): Extension<Options, Storage>;
3561
- /**
3562
- * Returns a fresh, unbound copy built from the same `config`: `editor` reset to
3563
- * null and `options`/`storage` re-derived, while `configure()`/`extend()`
3564
- * results are preserved (they live in `config`). Polymorphic: a `Node`/`Mark`
3565
- * clones to its own subclass.
3566
- *
3567
- * `ExtensionManager` clones every extension so each editor owns its instances
3568
- * and binding one editor can't mutate extensions shared with another.
3569
- */
3570
- clone(): Extension<Options, Storage>;
3571
- /**
3572
- * Creates a new extension with extended configuration
3573
- * Original extension is not modified
3574
- *
3575
- * **Note:** Config is merged shallowly using object spread (`...`).
3576
- * Config properties (like `addCommands`, `addKeyboardShortcuts`) are
3577
- * replaced entirely, not combined with the base extension's config.
3578
- *
3579
- * @param extendedConfig - Configuration to extend/override
3580
- * @returns New extension instance with extended config
3581
- *
3582
- * @example
3583
- * const Extended = MyExtension.extend({
3584
- * name: 'extendedExtension',
3585
- * addCommands() {
3586
- * return { customCommand: () => ({ tr }) => true };
3587
- * },
3588
- * });
3589
- *
3590
- * @example
3591
- * // To preserve base extension's commands while adding new ones:
3592
- * const Extended = BaseExtension.extend({
3593
- * addCommands() {
3594
- * const baseCommands = BaseExtension.config.addCommands?.call(this) ?? {};
3595
- * return {
3596
- * ...baseCommands,
3597
- * newCommand: () => ({ tr }) => true,
3598
- * };
3599
- * },
3600
- * });
3601
- */
3602
- extend<ExtendedOptions = Options, ExtendedStorage = Storage>(extendedConfig: Partial<ExtensionConfigBase<ExtendedOptions, ExtendedStorage>> & ThisType<ExtensionContext<ExtendedOptions, ExtendedStorage>>): Extension<ExtendedOptions, ExtendedStorage>;
3603
- }
3604
-
3605
4011
  /**
3606
4012
  * Node - Base class for node extensions
3607
4013
  *
@@ -3922,6 +4328,10 @@ interface FloatingMenuGroup {
3922
4328
  * order of groups. Within each group, items are sorted by `priority`
3923
4329
  * descending (higher first, default 100).
3924
4330
  *
4331
+ * An item with NO group leads: declining a category marks a primary action,
4332
+ * and insertion order would file it last, since whatever adds one loads after
4333
+ * the extensions defining the categories. Renderers give it no heading.
4334
+ *
3925
4335
  * Shared between `FloatingMenuController` (which renders grouped item lists
3926
4336
  * for FloatingMenu + framework wrappers) and `createSlashSuggestionRenderer`
3927
4337
  * (the popup shown by SlashCommand). Having one implementation keeps visual
@@ -6303,69 +6713,70 @@ declare const NotionColorPicker: Extension<NotionColorPickerOptions, NotionColor
6303
6713
 
6304
6714
  declare const ClearFormatting: Extension<unknown, unknown>;
6305
6715
 
6306
- interface LinkPopoverOptions {
6307
- /**
6308
- * List of allowed URL protocols (should match Link mark's protocols)
6309
- * @default ['http:', 'https:', 'mailto:', 'tel:']
6310
- */
6311
- protocols: string[];
6312
- }
6313
- declare const LinkPopover: Extension<LinkPopoverOptions, unknown>;
6314
-
6315
6716
  /**
6316
- * Floating menu shown when text is selected. Contextual formatting toolbar.
6717
+ * Print Extension
6718
+ *
6719
+ * Sends the document to the browser's own print dialog, which is also the
6720
+ * one place a reader can save a PDF that looks exactly like the editor:
6721
+ * the same engine paints both, so floats, columns and fonts survive
6722
+ * untouched. What it cannot do is hand a file back to code, so it
6723
+ * complements a file exporter rather than replacing one.
6724
+ *
6725
+ * The paper styling itself lives in `@domternal/theme` (`_print.scss`) and
6726
+ * applies to the reader's own Ctrl/Cmd+P with no code involved. This
6727
+ * extension adds the two things CSS cannot do on its own: a button, and
6728
+ * isolating the document from the host application's chrome.
6729
+ *
6730
+ * @example
6731
+ * ```ts
6732
+ * import { Print } from '@domternal/core';
6733
+ *
6734
+ * const editor = new Editor({ extensions: [Print] });
6735
+ * editor.commands.printDocument();
6736
+ * ```
6317
6737
  */
6318
6738
 
6319
- declare const bubbleMenuPluginKey: PluginKey<any>;
6320
- interface BubbleMenuOptions {
6321
- /**
6322
- * The HTML element that contains the menu.
6323
- * Must be provided by the user.
6324
- */
6325
- element: HTMLElement | null;
6326
- /**
6327
- * Duration in ms to wait before showing the menu.
6328
- * @default 0
6329
- */
6330
- updateDelay: number;
6739
+ interface PrintOptions {
6740
+ /** Show the toolbar button. @default true */
6741
+ toolbar: boolean;
6331
6742
  /**
6332
- * Function to determine if the menu should be shown.
6333
- * By default, shows for text selections with actual content in an editable editor.
6743
+ * Resolve the element to print. Defaults to the editor's `.dm-editor`
6744
+ * wrapper, falling back to the ProseMirror element itself.
6334
6745
  */
6335
- shouldShow: (props: {
6336
- editor: Editor;
6337
- view: EditorView;
6338
- state: EditorState;
6339
- from: number;
6340
- to: number;
6341
- }) => boolean;
6746
+ root: ((editor: ExtensionEditor) => HTMLElement | null) | null;
6342
6747
  /**
6343
- * Placement of the menu relative to the selection.
6344
- * @default 'top'
6748
+ * Also isolate the document when the reader presses Ctrl/Cmd+P instead of
6749
+ * using the command.
6750
+ *
6751
+ * Off by default, and deliberately: isolating means erasing everything
6752
+ * else on the page. That is obviously right for an app that IS the
6753
+ * editor, and obviously wrong for an article with an editor embedded in
6754
+ * it, and only the host knows which one it is. With it off, a native
6755
+ * print still gets the whole paper stylesheet, just not the erasure.
6756
+ *
6757
+ * @default false
6345
6758
  */
6346
- placement: 'top' | 'bottom';
6759
+ isolateNativePrint: boolean;
6760
+ }
6761
+ interface PrintStorage {
6762
+ /** Removes the native print listeners; set only when they were attached. */
6763
+ cleanup: (() => void) | null;
6764
+ }
6765
+ declare const Print: Extension<PrintOptions, PrintStorage>;
6766
+ declare module '@domternal/core' {
6767
+ interface RawCommands {
6768
+ printDocument: CommandSpec;
6769
+ }
6770
+ }
6771
+
6772
+ interface LinkPopoverOptions {
6347
6773
  /**
6348
- * Offset in pixels from the selection.
6349
- * @default 8
6774
+ * List of allowed URL protocols (should match Link mark's protocols)
6775
+ * @default ['http:', 'https:', 'mailto:', 'tel:']
6350
6776
  */
6351
- offset: number;
6352
- }
6353
- interface CreateBubbleMenuPluginOptions {
6354
- pluginKey: PluginKey;
6355
- editor: Editor;
6356
- element: HTMLElement;
6357
- shouldShow?: BubbleMenuOptions['shouldShow'];
6358
- placement?: 'top' | 'bottom';
6359
- offset?: number;
6360
- updateDelay?: number;
6777
+ protocols: string[];
6361
6778
  }
6362
- /**
6363
- * Creates a standalone BubbleMenu ProseMirror plugin.
6364
- * Can be used by framework wrappers (Angular, React, Vue) to create the plugin
6365
- * independently of the extension system.
6366
- */
6367
- declare function createBubbleMenuPlugin(options: CreateBubbleMenuPluginOptions): Plugin;
6368
- declare const BubbleMenu: Extension<BubbleMenuOptions, unknown>;
6779
+ declare const LinkPopover: Extension<LinkPopoverOptions, unknown>;
6369
6780
 
6370
6781
  /**
6371
6782
  * StarterKit Extension
@@ -6502,6 +6913,6 @@ declare const StarterKit: Extension<StarterKitOptions, unknown>;
6502
6913
  * @domternal/core
6503
6914
  * Framework-agnostic ProseMirror editor engine
6504
6915
  */
6505
- declare const VERSION = "0.14.0";
6916
+ declare const VERSION = "1.0.0";
6506
6917
 
6507
- export { type AnyExtension, type AnyExtensionConfig, type AttributeSpec, type AttributeSpecs, type AutolinkPluginOptions, BaseKeymap, type BaseKeymapOptions, BlockColor, type BlockColorOptions, Blockquote, type BlockquoteOptions, Bold, type BoldOptions, BubbleMenu, type BubbleMenuOptions, type BuildCommandPropsOptions, BulletList, type BulletListOptions, type CanChainedCommands, CanChecker, type CanCheckerEditor, type CanCheckerOptions, type CanCommands, ChainBuilder, type ChainBuilderEditor, type ChainBuilderOptions, type ChainFailure, type ChainedCommands, CharacterCount, type CharacterCountOptions, type CharacterCountStorage, type ClearContentOptions, ClearFormatting, Code, CodeBlock, type CodeBlockOptions, type CodeOptions, type Command, type CommandEditor, CommandManager, type CommandManagerEditor, type CommandMap, type CommandProps, type CommandPropsEditor, type CommandSpec, type Content, type ContentErrorProps, type CreateBubbleMenuPluginOptions, type CreateDocumentOptions, type CreateEventProps, type CreateFloatingMenuPluginOptions, DEFAULT_BLOCK_COLORS, DEFAULT_BLOCK_COLOR_TYPES, DEFAULT_HIGHLIGHT_COLORS, DEFAULT_NOTION_COLOR_PALETTE, DEFAULT_TEXT_COLORS, Document$1 as Document, Dropcursor, type DropcursorOptions, Editor, type EditorEventName, type EditorEvents, type EditorInstance, type EditorOptions, EventEmitter, Extension, type ExtensionConfig, type ExtensionConfigBase, ExtensionConfigurationError, type ExtensionEditor, ExtensionManager, type ExtensionManagerEditor, type ExtensionManagerOptions, FLOATING_MENU_META, FLOATING_MENU_NO_FOCUS, type FindChildResult, type FindParentNodeResult, FloatingMenuController, type FloatingMenuGroup, type FloatingMenuItem, type FloatingMenuItemsOverride, type FloatingMenuKeymap, type FloatingMenuOptions, Focus, type FocusEventProps, type FocusOptions, type FocusPosition, FontFamily, type FontFamilyOptions, FontSize, type FontSizeOptions, Gapcursor, type GenerateHTMLOptions, type GenerateJSONOptions, type GenerateTextOptions, type GlobalAttributeSpec, type GlobalAttributes, HardBreak, type HardBreakOptions, Heading, type HeadingOptions, Highlight, type HighlightOptions, History, type HistoryOptions, HorizontalRule, type HorizontalRuleOptions, type IconSet, type InlineStyleOverrides, type InsertAsListItemChildArgs, type InsertAsListItemChildResult, InvisibleChars, type InvisibleCharsOptions, type InvisibleCharsStorage, type IsNodeEmptyOptions, type IsValidUrlOptions, Italic, type ItalicOptions, type JSONAttribute, type JSONContent, type JSONMark, type KeyboardShortcutCommand, LIST_ITEM_TYPE_NAMES, LineHeight, type LineHeightOptions, Link, type LinkAttributes, type LinkClickPluginOptions, type LinkExitPluginOptions, type LinkOptions, type LinkPastePluginOptions, LinkPopover, type LinkPopoverOptions, ListIndent, ListItem, type ListItemCursorContext, type ListItemOptions, ListKeymap, type ListKeymapOptions, Mark, type MarkConfig, type MarkInputRuleOptions, type MarkParseRule, type MarkRange, type MarkRenderHTMLProps, type MountEventProps, Node, type NodeConfig, type NodeInputRuleOptions, type NodeParseRule, type NodeRenderHTMLProps, type NodeViewContext, NotionColorPicker, type NotionColorPickerOptions, type NotionColorPickerStorage, OrderedList, type OrderedListOptions, Paragraph, type ParagraphOptions, Placeholder, type PlaceholderOptions, type PositionFloatingOptions, type Range, type RawCommands, Selection, SelectionDecoration, type SelectionDecorationOptions, type SelectionOptions, type SelectionStorage, type SetContentOptions, type SingleCommands, type SplitListForInsertRange, StarterKit, type StarterKitOptions, Strike, type StrikeOptions, Subscript, type SubscriptOptions, Superscript, type SuperscriptOptions, TaskItem, type TaskItemOptions, TaskList, type TaskListOptions, Text, TextAlign, type TextAlignOptions, TextColor, type TextColorOptions, type TextInputRuleOptions, TextStyle, type TextStyleOptions, type TextblockTypeInputRuleOptions, type ToolbarButton, ToolbarController, type ToolbarControllerEditor, type ToolbarDropdown, type ToolbarGroup, type ToolbarItem, type ToolbarLayoutDropdown, type ToolbarLayoutEntry, type ToolbarSeparator, TrailingNode, type TrailingNodeOptions, type TransactionEventProps, Typography, type TypographyOptions, Underline, type UnderlineOptions, UniqueID, type UniqueIDOptions, VERSION, type WrappingInputRuleOptions, announce, applyInlineStyles, autolinkPlugin, autolinkPluginKey, blur, bubbleMenuPluginKey, buildCommandProps, builtInCommands, callOrReturn, characterCountPluginKey, clearContent, copyThemeClass, createAccumulatingDispatch, createBubbleMenuPlugin, createCanChecker, createChainBuilder, createDocument, createFloatingMenuPlugin, defaultBlockAt, defaultBubbleContexts, defaultFloatingMenuShouldShow, defaultIcons, deleteSelection, findChildren, findListItemAncestorDepth, findParentNode, floatingMenuPluginKey, focus, focusPluginKey, generateHTML, generateJSON, generateText, getListItemCursorContext, getMarkRange, groupFloatingMenuItems, hideFloatingMenu, indentBlockAsListChild, inlineStyles, insertAsListItemChild, insertChildrenZoneSibling, insertContent, insertText, invisibleCharsPluginKey, isDocumentEmpty, isInListItemLabel, isInsideListItem, isNodeEmpty, isValidUrl, lift, liftCurrentListItem, liftEmptyChildrenZoneParagraph, linkClickPlugin, linkClickPluginKey, linkExitPlugin, linkExitPluginKey, linkPastePlugin, linkPastePluginKey, markInputRule, markInputRulePatterns, nodeInputRule, outdentBlockFromListItem, placeholderPluginKey, positionFloating, positionFloatingOnce, refocusEditorAfterCommand, resetAttributes, selectAll, selectNodeBackward, selectionDecorationPluginKey, setBlockType, setContent, setMark, showFloatingMenu, splitListForInsert, stripInlineColorConflicts, textInputRule, textblockTypeInputRule, toggleBlockType, toggleList, toggleMark, toggleWrap, uniqueIDPluginKey, unsetAllMarks, unsetMark, updateAttributes, wrapIn, wrappingInputRule, writeToClipboard };
6918
+ export { type AnyExtension, type AnyExtensionConfig, type AttributeSpec, type AttributeSpecs, type AutolinkPluginOptions, BaseKeymap, type BaseKeymapOptions, BlockColor, type BlockColorOptions, Blockquote, type BlockquoteOptions, Bold, type BoldOptions, type BubbleContexts, type BubbleItemMaps, BubbleMenu, type BubbleMenuItem, type BubbleMenuOptions, type BubbleMenuSeparator, type BuildCommandPropsOptions, BulletList, type BulletListOptions, type CanChainedCommands, CanChecker, type CanCheckerEditor, type CanCheckerOptions, type CanCommands, ChainBuilder, type ChainBuilderEditor, type ChainBuilderOptions, type ChainFailure, type ChainedCommands, CharacterCount, type CharacterCountOptions, type CharacterCountStorage, type ClearContentOptions, ClearFormatting, Code, CodeBlock, type CodeBlockOptions, type CodeOptions, type Command, type CommandEditor, CommandManager, type CommandManagerEditor, type CommandMap, type CommandProps, type CommandPropsEditor, type CommandSpec, type Content, type ContentErrorProps, type CreateBubbleMenuPluginOptions, type CreateDocumentOptions, type CreateEventProps, type CreateFloatingMenuPluginOptions, DEFAULT_BLOCK_COLORS, DEFAULT_BLOCK_COLOR_TYPES, DEFAULT_HIGHLIGHT_COLORS, DEFAULT_NOTION_COLOR_PALETTE, DEFAULT_TEXT_COLORS, Document$1 as Document, Dropcursor, type DropcursorOptions, Editor, type EditorEventName, type EditorEvents, type EditorInstance, type EditorOptions, type EditorPreset, EventEmitter, Extension, type ExtensionConfig, type ExtensionConfigBase, ExtensionConfigurationError, type ExtensionEditor, ExtensionManager, type ExtensionManagerEditor, type ExtensionManagerOptions, FLOATING_MENU_META, FLOATING_MENU_NO_FOCUS, type FindChildResult, type FindParentNodeResult, FloatingMenuController, type FloatingMenuGroup, type FloatingMenuItem, type FloatingMenuItemsOverride, type FloatingMenuKeymap, type FloatingMenuOptions, Focus, type FocusEventProps, type FocusOptions, type FocusPosition, FontFamily, type FontFamilyOptions, FontSize, type FontSizeOptions, Gapcursor, type GenerateHTMLOptions, type GenerateJSONOptions, type GenerateTextOptions, type GlobalAttributeSpec, type GlobalAttributes, HardBreak, type HardBreakOptions, Heading, type HeadingOptions, Highlight, type HighlightOptions, History, type HistoryOptions, HorizontalRule, type HorizontalRuleOptions, type IconSet, type InlineStyleOverrides, type InsertAsListItemChildArgs, type InsertAsListItemChildResult, InvisibleChars, type InvisibleCharsOptions, type InvisibleCharsStorage, type IsNodeEmptyOptions, type IsValidUrlOptions, Italic, type ItalicOptions, type JSONAttribute, type JSONContent, type JSONMark, type KeyboardShortcutCommand, LIST_ITEM_TYPE_NAMES, LineHeight, type LineHeightOptions, Link, type LinkAttributes, type LinkClickPluginOptions, type LinkExitPluginOptions, type LinkOptions, type LinkPastePluginOptions, LinkPopover, type LinkPopoverOptions, ListIndent, ListItem, type ListItemCursorContext, type ListItemOptions, ListKeymap, type ListKeymapOptions, Mark, type MarkConfig, type MarkInputRuleOptions, type MarkParseRule, type MarkRange, type MarkRenderHTMLProps, type MountEventProps, Node, type NodeConfig, type NodeInputRuleOptions, type NodeParseRule, type NodeRenderHTMLProps, type NodeViewContext, NotionColorPicker, type NotionColorPickerOptions, type NotionColorPickerStorage, OrderedList, type OrderedListOptions, Paragraph, type ParagraphOptions, Placeholder, type PlaceholderOptions, type PositionFloatingOptions, Print, type PrintOptions, type PrintStorage, type ProseMirrorCopyConflict, type Range, type RawCommands, type ResolveBubbleMenuItemsOptions, type ResolvedPosShape, Selection, SelectionDecoration, type SelectionDecorationOptions, type SelectionOptions, type SelectionShape, type SelectionStorage, type SetContentOptions, type SingleCommands, type SplitListForInsertRange, StarterKit, type StarterKitOptions, Strike, type StrikeOptions, Subscript, type SubscriptOptions, Superscript, type SuperscriptOptions, TaskItem, type TaskItemOptions, TaskList, type TaskListOptions, Text, TextAlign, type TextAlignOptions, TextColor, type TextColorOptions, type TextInputRuleOptions, TextStyle, type TextStyleOptions, type TextblockTypeInputRuleOptions, type ToolbarButton, ToolbarController, type ToolbarControllerEditor, type ToolbarDropdown, type ToolbarGroup, type ToolbarItem, type ToolbarLayoutDropdown, type ToolbarLayoutEntry, type ToolbarSeparator, TrailingNode, type TrailingNodeOptions, type TransactionEventProps, Typography, type TypographyOptions, Underline, type UnderlineOptions, UniqueID, type UniqueIDOptions, VERSION, type WrappingInputRuleOptions, announce, applyInlineStyles, assertSingleProseMirrorCopy, autolinkPlugin, autolinkPluginKey, blur, bubbleMenuPluginKey, buildBubbleItemMaps, buildCommandProps, builtInCommands, callOrReturn, characterCountPluginKey, clearContent, collapseSeparators, copyThemeClass, createAccumulatingDispatch, createBubbleMenuPlugin, createBubbleShouldShow, createCanChecker, createChainBuilder, createDocument, createFloatingMenuPlugin, defaultBlockAt, defaultBubbleContexts, defaultFloatingMenuShouldShow, defaultIcons, deleteSelection, detectBubbleContext, filterBubbleItemsBySchema, findChildren, findListItemAncestorDepth, findParentNode, floatingMenuPluginKey, focus, focusPluginKey, generateHTML, generateJSON, generateText, getBubbleFormatItems, getListItemCursorContext, getMarkRange, groupFloatingMenuItems, hideFloatingMenu, indentBlockAsListChild, inlineStyles, insertAsListItemChild, insertChildrenZoneSibling, insertContent, insertText, invisibleCharsPluginKey, isDocumentEmpty, isInListItemLabel, isInsideListItem, isInsideTableCell, isNodeEmpty, isValidUrl, lift, liftCurrentListItem, liftEmptyChildrenZoneParagraph, linkClickPlugin, linkClickPluginKey, linkExitPlugin, linkExitPluginKey, linkPastePlugin, linkPastePluginKey, markInputRule, markInputRulePatterns, nodeInputRule, outdentBlockFromListItem, placeholderPluginKey, positionFloating, positionFloatingOnce, refocusEditorAfterCommand, registerProseMirrorCopy, resetAttributes, resolveBubbleMenuItems, resolveBubbleNames, selectAll, selectNodeBackward, selectionDecorationPluginKey, setBlockType, setContent, setMark, showFloatingMenu, splitListForInsert, stripInlineColorConflicts, textInputRule, textblockTypeInputRule, toggleBlockType, toggleList, toggleMark, toggleWrap, uniqueIDPluginKey, unsetAllMarks, unsetMark, updateAttributes, warnOnDuplicateProseMirrorCopy, wrapIn, wrappingInputRule, writeToClipboard };