@notectl/core 1.0.5 → 1.0.6
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 +2 -1
- package/dist/chunks/{ToolbarPlugin-D5VqeBPT.mjs → ToolbarPlugin-sJTiZr-S.mjs} +2 -2
- package/dist/chunks/ToolbarPlugin-sJTiZr-S.mjs.map +1 -0
- package/dist/chunks/index-QvKiO9_4.mjs +538 -0
- package/dist/chunks/index-QvKiO9_4.mjs.map +1 -0
- package/dist/editor/EditorDOM.d.ts.map +1 -1
- package/dist/editor/NotectlEditor.d.ts +5 -1
- package/dist/editor/NotectlEditor.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/notectl-core.mjs +1846 -1712
- package/dist/notectl-core.mjs.map +1 -1
- package/dist/notectl-core.umd.js +1050 -966
- package/dist/notectl-core.umd.js.map +1 -1
- package/dist/plugins/PluginManager.d.ts +3 -1
- package/dist/plugins/PluginManager.d.ts.map +1 -1
- package/dist/plugins/code-block/CodeBlockCommands.d.ts +5 -0
- package/dist/plugins/code-block/CodeBlockCommands.d.ts.map +1 -0
- package/dist/plugins/code-block/CodeBlockKeyboardHandlers.d.ts +10 -0
- package/dist/plugins/code-block/CodeBlockKeyboardHandlers.d.ts.map +1 -0
- package/dist/plugins/code-block/CodeBlockNodeView.d.ts +1 -1
- package/dist/plugins/code-block/CodeBlockNodeView.d.ts.map +1 -1
- package/dist/plugins/code-block/CodeBlockPlugin.d.ts +3 -111
- package/dist/plugins/code-block/CodeBlockPlugin.d.ts.map +1 -1
- package/dist/plugins/code-block/CodeBlockService.d.ts +5 -0
- package/dist/plugins/code-block/CodeBlockService.d.ts.map +1 -0
- package/dist/plugins/code-block/CodeBlockTypes.d.ts +69 -0
- package/dist/plugins/code-block/CodeBlockTypes.d.ts.map +1 -0
- package/dist/plugins/code-block.mjs +1 -1
- package/dist/plugins/font-size/FontSizeOperations.d.ts +22 -0
- package/dist/plugins/font-size/FontSizeOperations.d.ts.map +1 -0
- package/dist/plugins/font-size/FontSizePlugin.d.ts +1 -10
- package/dist/plugins/font-size/FontSizePlugin.d.ts.map +1 -1
- package/dist/plugins/font-size/FontSizePopup.d.ts +9 -0
- package/dist/plugins/font-size/FontSizePopup.d.ts.map +1 -0
- package/dist/plugins/font-size.mjs +146 -162
- package/dist/plugins/font-size.mjs.map +1 -1
- package/dist/plugins/font.mjs +1 -1
- package/dist/plugins/heading.mjs +1 -1
- package/dist/plugins/image/ImageNodeView.d.ts.map +1 -1
- package/dist/plugins/image.mjs +1 -1
- package/dist/plugins/image.mjs.map +1 -1
- package/dist/plugins/print/PrintContentPreparer.d.ts +12 -0
- package/dist/plugins/print/PrintContentPreparer.d.ts.map +1 -0
- package/dist/plugins/print/PrintPlugin.d.ts +12 -0
- package/dist/plugins/print/PrintPlugin.d.ts.map +1 -0
- package/dist/plugins/print/PrintServiceImpl.d.ts +7 -0
- package/dist/plugins/print/PrintServiceImpl.d.ts.map +1 -0
- package/dist/plugins/print/PrintStyleCollector.d.ts +10 -0
- package/dist/plugins/print/PrintStyleCollector.d.ts.map +1 -0
- package/dist/plugins/print/PrintTypes.d.ts +56 -0
- package/dist/plugins/print/PrintTypes.d.ts.map +1 -0
- package/dist/plugins/table/TableControls.d.ts.map +1 -1
- package/dist/plugins/table/TableControlsDOM.d.ts.map +1 -1
- package/dist/plugins/table.mjs +13 -13
- package/dist/plugins/table.mjs.map +1 -1
- package/dist/plugins/toolbar/ToolbarPlugin.d.ts.map +1 -1
- package/dist/plugins/toolbar.mjs +1 -1
- package/dist/view/Reconciler.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/ToolbarPlugin-D5VqeBPT.mjs.map +0 -1
- package/dist/chunks/index-CPPb-Jah.mjs +0 -569
- package/dist/chunks/index-CPPb-Jah.mjs.map +0 -1
|
@@ -2,7 +2,7 @@ import { DecorationSet } from '../decorations/Decoration.js';
|
|
|
2
2
|
import { SchemaRegistry } from '../model/SchemaRegistry.js';
|
|
3
3
|
import { EditorState } from '../state/EditorState.js';
|
|
4
4
|
import { Transaction } from '../state/Transaction.js';
|
|
5
|
-
import { Plugin, PluginConfig, ServiceKey } from './Plugin.js';
|
|
5
|
+
import { EventKey, Plugin, PluginConfig, PluginEventCallback, ServiceKey } from './Plugin.js';
|
|
6
6
|
export interface PluginManagerInitOptions {
|
|
7
7
|
getState(): EditorState;
|
|
8
8
|
dispatch(transaction: Transaction): void;
|
|
@@ -49,6 +49,8 @@ export declare class PluginManager {
|
|
|
49
49
|
get(id: string): Plugin | undefined;
|
|
50
50
|
/** Gets a registered service by typed key. */
|
|
51
51
|
getService<T>(key: ServiceKey<T>): T | undefined;
|
|
52
|
+
/** Subscribes to a plugin event from outside the plugin system. Returns an unsubscribe function. */
|
|
53
|
+
onEvent<T>(key: EventKey<T>, callback: PluginEventCallback<T>): () => void;
|
|
52
54
|
/** Returns all plugin-registered stylesheets. */
|
|
53
55
|
getPluginStyleSheets(): readonly CSSStyleSheet[];
|
|
54
56
|
/** Destroys all plugins in reverse init order. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginManager.d.ts","sourceRoot":"","sources":["../../src/plugins/PluginManager.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG7D,OAAO,EAAoB,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"PluginManager.d.ts","sourceRoot":"","sources":["../../src/plugins/PluginManager.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG7D,OAAO,EAAoB,cAAc,EAAE,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luginContext } from '../Plugin.js';
|
|
2
|
+
import { CodeBlockConfig } from './CodeBlockTypes.js';
|
|
3
|
+
/** Registers all code-block commands. */
|
|
4
|
+
export declare function registerCodeBlockCommands(context: PluginContext, config: CodeBlockConfig): void;
|
|
5
|
+
//# sourceMappingURL=CodeBlockCommands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlockCommands.d.ts","sourceRoot":"","sources":["../../../src/plugins/code-block/CodeBlockCommands.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,yCAAyC;AACzC,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAU/F"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PluginContext } from '../Plugin.js';
|
|
2
|
+
import { CodeBlockConfig, CodeBlockKeymap } from './CodeBlockTypes.js';
|
|
3
|
+
/** Registers all code-block keyboard handlers. */
|
|
4
|
+
export declare function registerCodeBlockKeymaps(context: PluginContext, config: CodeBlockConfig, resolvedKeymap: Readonly<Record<keyof CodeBlockKeymap, string | null>>): void;
|
|
5
|
+
/**
|
|
6
|
+
* Exits the code block to the next block or creates a new paragraph.
|
|
7
|
+
* Exported for use by the `exitCodeBlock` command.
|
|
8
|
+
*/
|
|
9
|
+
export declare function handleEscape(context: PluginContext): boolean;
|
|
10
|
+
//# sourceMappingURL=CodeBlockKeyboardHandlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlockKeyboardHandlers.d.ts","sourceRoot":"","sources":["../../../src/plugins/code-block/CodeBlockKeyboardHandlers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAkC5E,kDAAkD;AAClD,wBAAgB,wBAAwB,CACvC,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,eAAe,EACvB,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,GACpE,IAAI,CAuBN;AAsFD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAkB5D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NodeViewFactory } from '../../view/NodeView.js';
|
|
2
|
-
import { CodeBlockConfig } from './
|
|
2
|
+
import { CodeBlockConfig } from './CodeBlockTypes.js';
|
|
3
3
|
/** Creates a NodeViewFactory for code_block nodes. */
|
|
4
4
|
export declare function createCodeBlockNodeViewFactory(config: CodeBlockConfig): NodeViewFactory;
|
|
5
5
|
//# sourceMappingURL=CodeBlockNodeView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlockNodeView.d.ts","sourceRoot":"","sources":["../../../src/plugins/code-block/CodeBlockNodeView.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,OAAO,KAAK,EAAY,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"CodeBlockNodeView.d.ts","sourceRoot":"","sources":["../../../src/plugins/code-block/CodeBlockNodeView.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,OAAO,KAAK,EAAY,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAK3D,sDAAsD;AACtD,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,eAAe,GAAG,eAAe,CAkJvF"}
|
|
@@ -1,71 +1,9 @@
|
|
|
1
1
|
import { DecorationSet } from '../../decorations/Decoration.js';
|
|
2
|
-
import { BlockId } from '../../model/TypeBrands.js';
|
|
3
2
|
import { EditorState } from '../../state/EditorState.js';
|
|
4
3
|
import { Transaction } from '../../state/Transaction.js';
|
|
5
|
-
import { Plugin, PluginContext
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
code_block: {
|
|
9
|
-
language: string;
|
|
10
|
-
backgroundColor: string;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export interface SyntaxToken {
|
|
15
|
-
readonly from: number;
|
|
16
|
-
readonly to: number;
|
|
17
|
-
readonly type: string;
|
|
18
|
-
}
|
|
19
|
-
export interface SyntaxHighlighter {
|
|
20
|
-
tokenize(code: string, language: string): readonly SyntaxToken[];
|
|
21
|
-
getSupportedLanguages(): readonly string[];
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Configurable keyboard bindings for CodeBlockPlugin actions.
|
|
25
|
-
* Omit a slot to use the default; set to `null` to disable the binding.
|
|
26
|
-
*
|
|
27
|
-
* Key descriptor format: `'Mod-Enter'`, `'Mod-Shift-M'`, etc.
|
|
28
|
-
* `Mod` resolves to Cmd on macOS, Ctrl on Windows/Linux.
|
|
29
|
-
*/
|
|
30
|
-
export interface CodeBlockKeymap {
|
|
31
|
-
/**
|
|
32
|
-
* Insert a new paragraph below the code block and move the cursor there.
|
|
33
|
-
* @default 'Mod-Enter'
|
|
34
|
-
*/
|
|
35
|
-
readonly insertAfter?: string | null;
|
|
36
|
-
/**
|
|
37
|
-
* Toggle the current block between code block and paragraph.
|
|
38
|
-
* @default 'Mod-Shift-M'
|
|
39
|
-
*/
|
|
40
|
-
readonly toggle?: string | null;
|
|
41
|
-
}
|
|
42
|
-
export interface CodeBlockConfig {
|
|
43
|
-
readonly highlighter?: SyntaxHighlighter;
|
|
44
|
-
readonly defaultLanguage?: string;
|
|
45
|
-
readonly useSpaces?: boolean;
|
|
46
|
-
readonly spaceCount?: number;
|
|
47
|
-
readonly showCopyButton?: boolean;
|
|
48
|
-
readonly separatorAfter?: boolean;
|
|
49
|
-
/** Default body background color (overrides --notectl-code-block-bg). */
|
|
50
|
-
readonly background?: string;
|
|
51
|
-
/** Default header background color (overrides --notectl-code-block-header-bg). */
|
|
52
|
-
readonly headerBackground?: string;
|
|
53
|
-
/** Default text color (overrides --notectl-code-block-color). */
|
|
54
|
-
readonly textColor?: string;
|
|
55
|
-
/** Default header/label text color (overrides --notectl-code-block-header-color). */
|
|
56
|
-
readonly headerColor?: string;
|
|
57
|
-
/** Customize keyboard bindings for code block actions. */
|
|
58
|
-
readonly keymap?: CodeBlockKeymap;
|
|
59
|
-
}
|
|
60
|
-
export interface CodeBlockService {
|
|
61
|
-
setLanguage(blockId: BlockId, language: string): void;
|
|
62
|
-
getLanguage(blockId: BlockId): string;
|
|
63
|
-
setBackground(blockId: BlockId, color: string): void;
|
|
64
|
-
getBackground(blockId: BlockId): string;
|
|
65
|
-
isCodeBlock(blockId: BlockId): boolean;
|
|
66
|
-
getSupportedLanguages(): readonly string[];
|
|
67
|
-
}
|
|
68
|
-
export declare const CODE_BLOCK_SERVICE_KEY: ServiceKey<CodeBlockService>;
|
|
4
|
+
import { Plugin, PluginContext } from '../Plugin.js';
|
|
5
|
+
import { CodeBlockConfig } from './CodeBlockTypes.js';
|
|
6
|
+
export { CODE_BLOCK_SERVICE_KEY, type CodeBlockConfig, type CodeBlockKeymap, type CodeBlockService, type SyntaxHighlighter, type SyntaxToken, } from './CodeBlockTypes.js';
|
|
69
7
|
export declare class CodeBlockPlugin implements Plugin {
|
|
70
8
|
readonly id = "code-block";
|
|
71
9
|
readonly name = "Code Block";
|
|
@@ -80,56 +18,10 @@ export declare class CodeBlockPlugin implements Plugin {
|
|
|
80
18
|
decorations(state: EditorState): DecorationSet;
|
|
81
19
|
private registerNodeSpec;
|
|
82
20
|
private registerNodeView;
|
|
83
|
-
private registerCommands;
|
|
84
|
-
private registerKeymaps;
|
|
85
21
|
private registerInputRule;
|
|
86
22
|
private registerToolbarItem;
|
|
87
23
|
private registerMiddleware;
|
|
88
|
-
private registerService;
|
|
89
24
|
private patchTableCellContent;
|
|
90
|
-
/**
|
|
91
|
-
* Handles Backspace at the start of a code block.
|
|
92
|
-
* Converts the code block back to a paragraph, preserving text.
|
|
93
|
-
*/
|
|
94
|
-
private handleBackspace;
|
|
95
|
-
private handleEnter;
|
|
96
|
-
private handleTab;
|
|
97
|
-
private handleShiftTab;
|
|
98
|
-
private handleEscape;
|
|
99
|
-
/**
|
|
100
|
-
* Handles ArrowDown at the last line of a code block.
|
|
101
|
-
* Exits to the next block or creates a paragraph below.
|
|
102
|
-
*/
|
|
103
|
-
private handleArrowDown;
|
|
104
|
-
/**
|
|
105
|
-
* Handles ArrowUp at the first line of a code block.
|
|
106
|
-
* Exits to the previous block.
|
|
107
|
-
*/
|
|
108
|
-
private handleArrowUp;
|
|
109
|
-
/**
|
|
110
|
-
* Handles ArrowRight at the end of a code block.
|
|
111
|
-
* Exits to the next block or creates a paragraph below.
|
|
112
|
-
*/
|
|
113
|
-
private handleArrowRight;
|
|
114
|
-
/**
|
|
115
|
-
* Handles ArrowLeft at the start of a code block.
|
|
116
|
-
* Exits to the previous block at end.
|
|
117
|
-
*/
|
|
118
|
-
private handleArrowLeft;
|
|
119
|
-
/**
|
|
120
|
-
* Handles Mod+Enter: always creates a paragraph below and moves cursor there.
|
|
121
|
-
*/
|
|
122
|
-
private handleModEnter;
|
|
123
25
|
private setBlockFocused;
|
|
124
|
-
private toggleCodeBlock;
|
|
125
|
-
private insertCodeBlock;
|
|
126
|
-
private exitOnDoubleEnter;
|
|
127
|
-
private insertParagraphAfter;
|
|
128
|
-
private setAttr;
|
|
129
|
-
/**
|
|
130
|
-
* Strips all marks from a block's inline content.
|
|
131
|
-
* Used when converting to code_block so no formatting carries over.
|
|
132
|
-
*/
|
|
133
|
-
private stripAllMarks;
|
|
134
26
|
}
|
|
135
27
|
//# sourceMappingURL=CodeBlockPlugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlockPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/code-block/CodeBlockPlugin.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"CodeBlockPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/code-block/CodeBlockPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAWrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAM1D,OAAO,KAAK,EAAE,eAAe,EAAgC,MAAM,qBAAqB,CAAC;AAIzF,OAAO,EACN,sBAAsB,EACtB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,WAAW,GAChB,MAAM,qBAAqB,CAAC;AAE7B,qBAAa,eAAgB,YAAW,MAAM;IAC7C,QAAQ,CAAC,EAAE,gBAAgB;IAC3B,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,QAAQ,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAyD;IACxF,OAAO,CAAC,OAAO,CAA8B;gBAEjC,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC;IAQ7C,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAelC,OAAO,IAAI,IAAI;IAIf,aAAa,CAAC,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI;IA8BnF,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa;IA+B9C,OAAO,CAAC,gBAAgB;IA+CxB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,iBAAiB;IA6BzB,OAAO,CAAC,mBAAmB;IAsB3B,OAAO,CAAC,kBAAkB;IAyB1B,OAAO,CAAC,qBAAqB;IAoB7B,OAAO,CAAC,eAAe;CAQvB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PluginContext } from '../Plugin.js';
|
|
2
|
+
import { CodeBlockConfig } from './CodeBlockTypes.js';
|
|
3
|
+
/** Registers the CodeBlockService on the given context. */
|
|
4
|
+
export declare function registerCodeBlockService(context: PluginContext, config: CodeBlockConfig, getContext: () => PluginContext | null): void;
|
|
5
|
+
//# sourceMappingURL=CodeBlockService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlockService.d.ts","sourceRoot":"","sources":["../../../src/plugins/code-block/CodeBlockService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG3D,2DAA2D;AAC3D,wBAAgB,wBAAwB,CACvC,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,eAAe,EACvB,UAAU,EAAE,MAAM,aAAa,GAAG,IAAI,GACpC,IAAI,CAwCN"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { BlockId } from '../../model/TypeBrands.js';
|
|
2
|
+
import { ServiceKey } from '../Plugin.js';
|
|
3
|
+
declare module '../../model/AttrRegistry.js' {
|
|
4
|
+
interface NodeAttrRegistry {
|
|
5
|
+
code_block: {
|
|
6
|
+
language: string;
|
|
7
|
+
backgroundColor: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export interface SyntaxToken {
|
|
12
|
+
readonly from: number;
|
|
13
|
+
readonly to: number;
|
|
14
|
+
readonly type: string;
|
|
15
|
+
}
|
|
16
|
+
export interface SyntaxHighlighter {
|
|
17
|
+
tokenize(code: string, language: string): readonly SyntaxToken[];
|
|
18
|
+
getSupportedLanguages(): readonly string[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Configurable keyboard bindings for CodeBlockPlugin actions.
|
|
22
|
+
* Omit a slot to use the default; set to `null` to disable the binding.
|
|
23
|
+
*
|
|
24
|
+
* Key descriptor format: `'Mod-Enter'`, `'Mod-Shift-M'`, etc.
|
|
25
|
+
* `Mod` resolves to Cmd on macOS, Ctrl on Windows/Linux.
|
|
26
|
+
*/
|
|
27
|
+
export interface CodeBlockKeymap {
|
|
28
|
+
/**
|
|
29
|
+
* Insert a new paragraph below the code block and move the cursor there.
|
|
30
|
+
* @default 'Mod-Enter'
|
|
31
|
+
*/
|
|
32
|
+
readonly insertAfter?: string | null;
|
|
33
|
+
/**
|
|
34
|
+
* Toggle the current block between code block and paragraph.
|
|
35
|
+
* @default 'Mod-Shift-M'
|
|
36
|
+
*/
|
|
37
|
+
readonly toggle?: string | null;
|
|
38
|
+
}
|
|
39
|
+
export declare const DEFAULT_KEYMAP: Readonly<Record<keyof CodeBlockKeymap, string>>;
|
|
40
|
+
export interface CodeBlockConfig {
|
|
41
|
+
readonly highlighter?: SyntaxHighlighter;
|
|
42
|
+
readonly defaultLanguage?: string;
|
|
43
|
+
readonly useSpaces?: boolean;
|
|
44
|
+
readonly spaceCount?: number;
|
|
45
|
+
readonly showCopyButton?: boolean;
|
|
46
|
+
readonly separatorAfter?: boolean;
|
|
47
|
+
/** Default body background color (overrides --notectl-code-block-bg). */
|
|
48
|
+
readonly background?: string;
|
|
49
|
+
/** Default header background color (overrides --notectl-code-block-header-bg). */
|
|
50
|
+
readonly headerBackground?: string;
|
|
51
|
+
/** Default text color (overrides --notectl-code-block-color). */
|
|
52
|
+
readonly textColor?: string;
|
|
53
|
+
/** Default header/label text color (overrides --notectl-code-block-header-color). */
|
|
54
|
+
readonly headerColor?: string;
|
|
55
|
+
/** Customize keyboard bindings for code block actions. */
|
|
56
|
+
readonly keymap?: CodeBlockKeymap;
|
|
57
|
+
}
|
|
58
|
+
export declare const DEFAULT_CONFIG: CodeBlockConfig;
|
|
59
|
+
export interface CodeBlockService {
|
|
60
|
+
setLanguage(blockId: BlockId, language: string): void;
|
|
61
|
+
getLanguage(blockId: BlockId): string;
|
|
62
|
+
setBackground(blockId: BlockId, color: string): void;
|
|
63
|
+
getBackground(blockId: BlockId): string;
|
|
64
|
+
isCodeBlock(blockId: BlockId): boolean;
|
|
65
|
+
getSupportedLanguages(): readonly string[];
|
|
66
|
+
}
|
|
67
|
+
export declare const CODE_BLOCK_SERVICE_KEY: ServiceKey<CodeBlockService>;
|
|
68
|
+
export declare const CODE_BLOCK_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z\"/></svg>";
|
|
69
|
+
//# sourceMappingURL=CodeBlockTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlockTypes.d.ts","sourceRoot":"","sources":["../../../src/plugins/code-block/CodeBlockTypes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,OAAO,QAAQ,6BAA6B,CAAC;IAC5C,UAAU,gBAAgB;QACzB,UAAU,EAAE;YACX,QAAQ,EAAE,MAAM,CAAC;YACjB,eAAe,EAAE,MAAM,CAAC;SACxB,CAAC;KACF;CACD;AAID,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;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BAAgB;IAChC,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACtD,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC;IACtC,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrD,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC;IACxC,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;IACvC,qBAAqB,IAAI,SAAS,MAAM,EAAE,CAAC;CAC3C;AAED,eAAO,MAAM,sBAAsB,8BAAgD,CAAC;AAIpF,eAAO,MAAM,eAAe,mLAC+I,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EditorState } from '../../state/EditorState.js';
|
|
2
|
+
import { PluginContext } from '../Plugin.js';
|
|
3
|
+
/** Returns the raw fontSize CSS value at the current selection, or null. */
|
|
4
|
+
export declare function getActiveSize(state: EditorState): string | null;
|
|
5
|
+
/** Returns the active font size as a number, falling back to defaultSize. */
|
|
6
|
+
export declare function getActiveSizeNumeric(state: EditorState, defaultSize: number): number;
|
|
7
|
+
/** Returns true when the selection carries a fontSize mark. */
|
|
8
|
+
export declare function isFontSizeActive(state: EditorState): boolean;
|
|
9
|
+
/** Applies a fontSize mark with the given CSS size string to the selection. */
|
|
10
|
+
export declare function applyFontSize(context: PluginContext, state: EditorState, size: string): boolean;
|
|
11
|
+
/** Removes the fontSize mark from the current selection. */
|
|
12
|
+
export declare function removeFontSize(context: PluginContext, state: EditorState): boolean;
|
|
13
|
+
/** Steps the font size up or down through the preset list. */
|
|
14
|
+
export declare function stepFontSize(context: PluginContext, state: EditorState, direction: 'up' | 'down', sizes: readonly number[], defaultSize: number): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Selects a specific font size: removes the mark when size equals the
|
|
17
|
+
* default, otherwise applies the new size.
|
|
18
|
+
*/
|
|
19
|
+
export declare function selectSize(context: PluginContext, size: number, defaultSize: number): void;
|
|
20
|
+
/** Finds the next preset size in the given direction, or null at boundaries. */
|
|
21
|
+
export declare function getNextPresetSize(current: number, direction: 'up' | 'down', sizes: readonly number[]): number | null;
|
|
22
|
+
//# sourceMappingURL=FontSizeOperations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FontSizeOperations.d.ts","sourceRoot":"","sources":["../../../src/plugins/font-size/FontSizeOperations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAIlD,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAW/D;AAED,6EAA6E;AAC7E,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAKpF;AAED,+DAA+D;AAC/D,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAE5D;AAID,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAgC/F;AAED,4DAA4D;AAC5D,wBAAgB,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CA8BlF;AAED,8DAA8D;AAC9D,wBAAgB,YAAY,CAC3B,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,IAAI,GAAG,MAAM,EACxB,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,WAAW,EAAE,MAAM,GACjB,OAAO,CAST;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAM1F;AAID,gFAAgF;AAChF,wBAAgB,iBAAiB,CAChC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,IAAI,GAAG,MAAM,EACxB,KAAK,EAAE,SAAS,MAAM,EAAE,GACtB,MAAM,GAAG,IAAI,CAYf"}
|
|
@@ -50,16 +50,7 @@ export declare class FontSizePlugin implements Plugin {
|
|
|
50
50
|
* browser default (16px).
|
|
51
51
|
*/
|
|
52
52
|
private applyDefaultSizeToContainer;
|
|
53
|
-
private updateComboLabel;
|
|
54
|
-
private isFontSizeActive;
|
|
55
|
-
private getActiveSize;
|
|
56
|
-
private getActiveSizeNumeric;
|
|
57
|
-
private applyFontSize;
|
|
58
|
-
private removeFontSize;
|
|
59
|
-
private stepFontSize;
|
|
60
|
-
private getNextPresetSize;
|
|
61
53
|
private dismissPopup;
|
|
62
|
-
private
|
|
63
|
-
private selectSize;
|
|
54
|
+
private updateComboLabel;
|
|
64
55
|
}
|
|
65
56
|
//# sourceMappingURL=FontSizePlugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FontSizePlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/font-size/FontSizePlugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"FontSizePlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/font-size/FontSizePlugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAY1D,OAAO,QAAQ,6BAA6B,CAAC;IAC5C,UAAU,gBAAgB;QACzB,QAAQ,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;KAC3B;CACD;A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readonly dismissPopup: () => void;
|
|
6
|
+
}
|
|
7
|
+
/** Builds the font-size picker DOM inside the given container. */
|
|
8
|
+
export declare function renderFontSizePopup(container: HTMLElement, context: PluginContext, config: FontSizePopupConfig): void;
|
|
9
|
+
//# sourceMappingURL=FontSizePopup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FontSizePopup.d.ts","sourceRoot":"","sources":["../../../src/plugins/font-size/FontSizePopup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAUlD,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,IAAI,CAAC;CAClC;AAID,kEAAkE;AAClE,wBAAgB,mBAAmB,CAClC,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,mBAAmB,GACzB,IAAI,CAaN"}
|