@notectl/core 1.0.5 → 1.0.8
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 +78 -55
- package/custom-elements.json +344 -0
- package/dist/chunks/{AttrRegistry-DTsHyDVA.mjs → AttrRegistry-D-przlzb.mjs} +4 -4
- package/dist/chunks/{AttrRegistry-DTsHyDVA.mjs.map → AttrRegistry-D-przlzb.mjs.map} +1 -1
- package/dist/chunks/ColorNames-iaWsSZx1.mjs +35 -0
- package/dist/chunks/ColorNames-iaWsSZx1.mjs.map +1 -0
- package/dist/chunks/ColorValidation-Dyy4Bye8.mjs +140 -0
- package/dist/chunks/ColorValidation-Dyy4Bye8.mjs.map +1 -0
- package/dist/chunks/{Commands-DLP85Mp5.mjs → Commands-CSpSwGXv.mjs} +13 -13
- package/dist/chunks/{Commands-DLP85Mp5.mjs.map → Commands-CSpSwGXv.mjs.map} +1 -1
- package/dist/chunks/ToolbarKeyboardNav-B32OMv8r.mjs +46 -0
- package/dist/chunks/ToolbarKeyboardNav-B32OMv8r.mjs.map +1 -0
- package/dist/chunks/{ToolbarPlugin-D5VqeBPT.mjs → ToolbarPlugin-DY2xaJiu.mjs} +63 -93
- package/dist/chunks/ToolbarPlugin-DY2xaJiu.mjs.map +1 -0
- package/dist/chunks/index-BAk1EG1x.mjs +541 -0
- package/dist/chunks/index-BAk1EG1x.mjs.map +1 -0
- package/dist/chunks/index-BRYzYOYC.mjs +63 -0
- package/dist/chunks/index-BRYzYOYC.mjs.map +1 -0
- package/dist/chunks/index-BSFLNveF.mjs +953 -0
- package/dist/chunks/index-BSFLNveF.mjs.map +1 -0
- package/dist/chunks/index-BYgspns5.mjs +209 -0
- package/dist/chunks/index-BYgspns5.mjs.map +1 -0
- package/dist/chunks/index-B_3qDrUN.mjs +64 -0
- package/dist/chunks/index-B_3qDrUN.mjs.map +1 -0
- package/dist/chunks/index-Bsp4LC5t.mjs +130 -0
- package/dist/chunks/index-Bsp4LC5t.mjs.map +1 -0
- package/dist/chunks/index-C-YWHOcC.mjs +100 -0
- package/dist/chunks/index-C-YWHOcC.mjs.map +1 -0
- package/dist/chunks/index-C2GQoHot.mjs +92 -0
- package/dist/chunks/index-C2GQoHot.mjs.map +1 -0
- package/dist/chunks/index-CT3HGdQt.mjs +39 -0
- package/dist/chunks/index-CT3HGdQt.mjs.map +1 -0
- package/dist/chunks/index-Ct0ivLhO.mjs +407 -0
- package/dist/chunks/index-Ct0ivLhO.mjs.map +1 -0
- package/dist/chunks/index-CxiWyUho.mjs +191 -0
- package/dist/chunks/index-CxiWyUho.mjs.map +1 -0
- package/dist/chunks/index-D3CQWJiw.mjs +200 -0
- package/dist/chunks/index-D3CQWJiw.mjs.map +1 -0
- package/dist/chunks/index-DC1EK22F.mjs +41 -0
- package/dist/chunks/index-DC1EK22F.mjs.map +1 -0
- package/dist/chunks/index-Dh76rR13.mjs +196 -0
- package/dist/chunks/index-Dh76rR13.mjs.map +1 -0
- package/dist/chunks/index-o6hDR07y.mjs +41 -0
- package/dist/chunks/index-o6hDR07y.mjs.map +1 -0
- package/dist/chunks/index-uTnc9y7M.mjs +62 -0
- package/dist/chunks/index-uTnc9y7M.mjs.map +1 -0
- package/dist/chunks/resolvePluginLocale-B4w1OkPy.mjs +34 -0
- package/dist/chunks/resolvePluginLocale-B4w1OkPy.mjs.map +1 -0
- package/dist/editor/EditorDOM.d.ts.map +1 -1
- package/dist/editor/NotectlEditor.d.ts +15 -1
- package/dist/editor/NotectlEditor.d.ts.map +1 -1
- package/dist/editor/PaperLayoutController.d.ts +27 -0
- package/dist/editor/PaperLayoutController.d.ts.map +1 -0
- package/dist/editor/PaperSize.d.ts +35 -0
- package/dist/editor/PaperSize.d.ts.map +1 -0
- package/dist/editor/styles/color-picker.d.ts +1 -1
- package/dist/editor/styles/color-picker.d.ts.map +1 -1
- package/dist/editor/styles/paper.d.ts +3 -0
- package/dist/editor/styles/paper.d.ts.map +1 -0
- package/dist/editor/styles/table.d.ts +1 -1
- package/dist/editor/styles/table.d.ts.map +1 -1
- package/dist/editor/styles/toolbar.d.ts +1 -1
- package/dist/editor/styles/toolbar.d.ts.map +1 -1
- package/dist/editor/styles.d.ts.map +1 -1
- package/dist/i18n/Locale.d.ts +17 -0
- package/dist/i18n/Locale.d.ts.map +1 -0
- package/dist/i18n/LocaleService.d.ts +8 -0
- package/dist/i18n/LocaleService.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +4 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/resolvePluginLocale.d.ts +3 -0
- package/dist/i18n/resolvePluginLocale.d.ts.map +1 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/input/ClipboardHandler.d.ts.map +1 -1
- package/dist/input/InputHandler.d.ts.map +1 -1
- package/dist/input/KeyboardHandler.d.ts.map +1 -1
- package/dist/input/PasteHandler.d.ts.map +1 -1
- package/dist/notectl-core.mjs +1145 -837
- package/dist/notectl-core.mjs.map +1 -1
- package/dist/notectl-core.umd.js +2368 -1826
- package/dist/notectl-core.umd.js.map +1 -1
- package/dist/plugins/PluginManager.d.ts +8 -1
- package/dist/plugins/PluginManager.d.ts.map +1 -1
- package/dist/plugins/alignment/AlignmentLocale.d.ts +19 -0
- package/dist/plugins/alignment/AlignmentLocale.d.ts.map +1 -0
- package/dist/plugins/alignment/AlignmentPlugin.d.ts +4 -0
- package/dist/plugins/alignment/AlignmentPlugin.d.ts.map +1 -1
- package/dist/plugins/alignment.mjs +3 -89
- package/dist/plugins/alignment.mjs.map +1 -1
- package/dist/plugins/blockquote/BlockquoteLocale.d.ts +17 -0
- package/dist/plugins/blockquote/BlockquoteLocale.d.ts.map +1 -0
- package/dist/plugins/blockquote/BlockquotePlugin.d.ts +3 -0
- package/dist/plugins/blockquote/BlockquotePlugin.d.ts.map +1 -1
- package/dist/plugins/blockquote.mjs +2 -55
- package/dist/plugins/blockquote.mjs.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/CodeBlockLocale.d.ts +17 -0
- package/dist/plugins/code-block/CodeBlockLocale.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 +4 -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 +71 -0
- package/dist/plugins/code-block/CodeBlockTypes.d.ts.map +1 -0
- package/dist/plugins/code-block.mjs +3 -3
- package/dist/plugins/font/FontLocale.d.ts +15 -0
- package/dist/plugins/font/FontLocale.d.ts.map +1 -0
- package/dist/plugins/font/FontPlugin.d.ts +3 -0
- package/dist/plugins/font/FontPlugin.d.ts.map +1 -1
- package/dist/plugins/font-size/FontSizeLocale.d.ts +17 -0
- package/dist/plugins/font-size/FontSizeLocale.d.ts.map +1 -0
- 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 +4 -10
- package/dist/plugins/font-size/FontSizePlugin.d.ts.map +1 -1
- package/dist/plugins/font-size/FontSizePopup.d.ts +11 -0
- package/dist/plugins/font-size/FontSizePopup.d.ts.map +1 -0
- package/dist/plugins/font-size.mjs +2 -217
- package/dist/plugins/font-size.mjs.map +1 -1
- package/dist/plugins/font.mjs +2 -183
- package/dist/plugins/font.mjs.map +1 -1
- package/dist/plugins/hard-break.mjs +1 -1
- package/dist/plugins/heading/HeadingLocale.d.ts +26 -0
- package/dist/plugins/heading/HeadingLocale.d.ts.map +1 -0
- package/dist/plugins/heading/HeadingPlugin.d.ts +4 -0
- package/dist/plugins/heading/HeadingPlugin.d.ts.map +1 -1
- package/dist/plugins/heading.mjs +1 -184
- package/dist/plugins/heading.mjs.map +1 -1
- package/dist/plugins/highlight/HighlightLocale.d.ts +17 -0
- package/dist/plugins/highlight/HighlightLocale.d.ts.map +1 -0
- package/dist/plugins/highlight/HighlightPlugin.d.ts +3 -5
- package/dist/plugins/highlight/HighlightPlugin.d.ts.map +1 -1
- package/dist/plugins/highlight.mjs +2 -123
- package/dist/plugins/highlight.mjs.map +1 -1
- package/dist/plugins/horizontal-rule/HorizontalRuleLocale.d.ts +15 -0
- package/dist/plugins/horizontal-rule/HorizontalRuleLocale.d.ts.map +1 -0
- package/dist/plugins/horizontal-rule/HorizontalRulePlugin.d.ts +4 -0
- package/dist/plugins/horizontal-rule/HorizontalRulePlugin.d.ts.map +1 -1
- package/dist/plugins/horizontal-rule.mjs +2 -56
- package/dist/plugins/horizontal-rule.mjs.map +1 -1
- package/dist/plugins/image/ImageLocale.d.ts +25 -0
- package/dist/plugins/image/ImageLocale.d.ts.map +1 -0
- package/dist/plugins/image/ImageNodeView.d.ts.map +1 -1
- package/dist/plugins/image/ImagePlugin.d.ts +1 -0
- package/dist/plugins/image/ImagePlugin.d.ts.map +1 -1
- package/dist/plugins/image/ImageUpload.d.ts +3 -0
- package/dist/plugins/image/ImageUpload.d.ts.map +1 -1
- package/dist/plugins/image.mjs +4 -378
- package/dist/plugins/image.mjs.map +1 -1
- package/dist/plugins/link/LinkLocale.d.ts +23 -0
- package/dist/plugins/link/LinkLocale.d.ts.map +1 -0
- package/dist/plugins/link/LinkPlugin.d.ts +3 -0
- package/dist/plugins/link/LinkPlugin.d.ts.map +1 -1
- package/dist/plugins/link.mjs +2 -124
- package/dist/plugins/link.mjs.map +1 -1
- package/dist/plugins/list/ListLocale.d.ts +18 -0
- package/dist/plugins/list/ListLocale.d.ts.map +1 -0
- package/dist/plugins/list/ListPlugin.d.ts +4 -0
- package/dist/plugins/list/ListPlugin.d.ts.map +1 -1
- package/dist/plugins/list.mjs +2 -190
- package/dist/plugins/list.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/PrintLocale.d.ts +16 -0
- package/dist/plugins/print/PrintLocale.d.ts.map +1 -0
- package/dist/plugins/print/PrintPlugin.d.ts +13 -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 +17 -0
- package/dist/plugins/print/PrintStyleCollector.d.ts.map +1 -0
- package/dist/plugins/print/PrintTypes.d.ts +61 -0
- package/dist/plugins/print/PrintTypes.d.ts.map +1 -0
- package/dist/plugins/shared/ColorMarkOperations.d.ts +28 -0
- package/dist/plugins/shared/ColorMarkOperations.d.ts.map +1 -0
- package/dist/plugins/shared/ColorNames.d.ts +22 -0
- package/dist/plugins/shared/ColorNames.d.ts.map +1 -0
- package/dist/plugins/shared/ColorPickerPopup.d.ts +31 -0
- package/dist/plugins/shared/ColorPickerPopup.d.ts.map +1 -0
- package/dist/plugins/shared/ColorValidation.d.ts +14 -0
- package/dist/plugins/shared/ColorValidation.d.ts.map +1 -0
- package/dist/plugins/strikethrough/StrikethroughLocale.d.ts +17 -0
- package/dist/plugins/strikethrough/StrikethroughLocale.d.ts.map +1 -0
- package/dist/plugins/strikethrough/StrikethroughPlugin.d.ts +3 -0
- package/dist/plugins/strikethrough/StrikethroughPlugin.d.ts.map +1 -1
- package/dist/plugins/strikethrough.mjs +2 -32
- package/dist/plugins/strikethrough.mjs.map +1 -1
- package/dist/plugins/super-sub/SuperSubLocale.d.ts +19 -0
- package/dist/plugins/super-sub/SuperSubLocale.d.ts.map +1 -0
- package/dist/plugins/super-sub/SuperSubPlugin.d.ts +3 -0
- package/dist/plugins/super-sub/SuperSubPlugin.d.ts.map +1 -1
- package/dist/plugins/super-sub.mjs +2 -78
- package/dist/plugins/super-sub.mjs.map +1 -1
- package/dist/plugins/table/TableBorderColor.d.ts +24 -0
- package/dist/plugins/table/TableBorderColor.d.ts.map +1 -0
- package/dist/plugins/table/TableCommands.d.ts +9 -8
- package/dist/plugins/table/TableCommands.d.ts.map +1 -1
- package/dist/plugins/table/TableContextMenu.d.ts +14 -0
- package/dist/plugins/table/TableContextMenu.d.ts.map +1 -0
- package/dist/plugins/table/TableControls.d.ts +3 -1
- package/dist/plugins/table/TableControls.d.ts.map +1 -1
- package/dist/plugins/table/TableControlsDOM.d.ts +13 -1
- package/dist/plugins/table/TableControlsDOM.d.ts.map +1 -1
- package/dist/plugins/table/TableLocale.d.ts +48 -0
- package/dist/plugins/table/TableLocale.d.ts.map +1 -0
- package/dist/plugins/table/TableNavigation.d.ts +2 -1
- package/dist/plugins/table/TableNavigation.d.ts.map +1 -1
- package/dist/plugins/table/TableNodeViews.d.ts +3 -1
- package/dist/plugins/table/TableNodeViews.d.ts.map +1 -1
- package/dist/plugins/table/TablePlugin.d.ts +7 -1
- package/dist/plugins/table/TablePlugin.d.ts.map +1 -1
- package/dist/plugins/table/index.d.ts +3 -0
- package/dist/plugins/table/index.d.ts.map +1 -1
- package/dist/plugins/table.mjs +18 -660
- package/dist/plugins/table.mjs.map +1 -1
- package/dist/plugins/text-color/TextColorLocale.d.ts +17 -0
- package/dist/plugins/text-color/TextColorLocale.d.ts.map +1 -0
- package/dist/plugins/text-color/TextColorPlugin.d.ts +3 -5
- package/dist/plugins/text-color/TextColorPlugin.d.ts.map +1 -1
- package/dist/plugins/text-color.mjs +2 -123
- package/dist/plugins/text-color.mjs.map +1 -1
- package/dist/plugins/text-formatting/TextFormattingLocale.d.ts +18 -0
- package/dist/plugins/text-formatting/TextFormattingLocale.d.ts.map +1 -0
- package/dist/plugins/text-formatting/TextFormattingPlugin.d.ts +4 -0
- package/dist/plugins/text-formatting/TextFormattingPlugin.d.ts.map +1 -1
- package/dist/plugins/text-formatting.mjs +2 -49
- package/dist/plugins/text-formatting.mjs.map +1 -1
- package/dist/plugins/toolbar/ToolbarLocale.d.ts +14 -0
- package/dist/plugins/toolbar/ToolbarLocale.d.ts.map +1 -0
- package/dist/plugins/toolbar/ToolbarPlugin.d.ts +1 -0
- package/dist/plugins/toolbar/ToolbarPlugin.d.ts.map +1 -1
- package/dist/plugins/toolbar.mjs +1 -1
- package/dist/state/EditorState.d.ts +4 -1
- package/dist/state/EditorState.d.ts.map +1 -1
- package/dist/view/EditorView.d.ts.map +1 -1
- package/dist/view/Reconciler.d.ts.map +1 -1
- package/package.json +3 -2
- package/dist/chunks/Plugin-B9OZ6Y4c.mjs +0 -15
- package/dist/chunks/Plugin-B9OZ6Y4c.mjs.map +0 -1
- package/dist/chunks/ToolbarPlugin-D5VqeBPT.mjs.map +0 -1
- package/dist/chunks/color-picker-Csf0wx5a.mjs +0 -5
- package/dist/chunks/color-picker-Csf0wx5a.mjs.map +0 -1
- package/dist/chunks/index-CPPb-Jah.mjs +0 -569
- package/dist/chunks/index-CPPb-Jah.mjs.map +0 -1
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
/** Locale override for user-facing strings. */
|
|
58
|
+
readonly locale?: import('./CodeBlockLocale.js').CodeBlockLocale;
|
|
59
|
+
}
|
|
60
|
+
export declare const DEFAULT_CONFIG: CodeBlockConfig;
|
|
61
|
+
export interface CodeBlockService {
|
|
62
|
+
setLanguage(blockId: BlockId, language: string): void;
|
|
63
|
+
getLanguage(blockId: BlockId): string;
|
|
64
|
+
setBackground(blockId: BlockId, color: string): void;
|
|
65
|
+
getBackground(blockId: BlockId): string;
|
|
66
|
+
isCodeBlock(blockId: BlockId): boolean;
|
|
67
|
+
getSupportedLanguages(): readonly string[];
|
|
68
|
+
}
|
|
69
|
+
export declare const CODE_BLOCK_SERVICE_KEY: ServiceKey<CodeBlockService>;
|
|
70
|
+
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>";
|
|
71
|
+
//# 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;IACpB,QAAQ,CAAC,IAAI,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AED,eAAO,MAAM,cAAc,EAAE,eAK5B,CAAC;AAIF,MAAM,WAAW,gBAAgB;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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b, c } from "../chunks/index-BAk1EG1x.mjs";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
b as CODE_BLOCK_SERVICE_KEY,
|
|
4
|
+
c as CodeBlockPlugin
|
|
5
5
|
};
|
|
6
6
|
//# sourceMappingURL=code-block.mjs.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Locale interface and default English locale for the FontPlugin. */
|
|
2
|
+
export interface FontLocale {
|
|
3
|
+
readonly label: string;
|
|
4
|
+
readonly tooltip: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const FONT_LOCALE_EN: FontLocale;
|
|
7
|
+
export declare const FONT_LOCALE_DE: FontLocale;
|
|
8
|
+
export declare const FONT_LOCALE_ES: FontLocale;
|
|
9
|
+
export declare const FONT_LOCALE_FR: FontLocale;
|
|
10
|
+
export declare const FONT_LOCALE_ZH: FontLocale;
|
|
11
|
+
export declare const FONT_LOCALE_RU: FontLocale;
|
|
12
|
+
export declare const FONT_LOCALE_AR: FontLocale;
|
|
13
|
+
export declare const FONT_LOCALE_HI: FontLocale;
|
|
14
|
+
export declare const FONT_LOCALES: Record<string, FontLocale>;
|
|
15
|
+
//# sourceMappingURL=FontLocale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FontLocale.d.ts","sourceRoot":"","sources":["../../../src/plugins/font/FontLocale.ts"],"names":[],"mappings":"AAAA,sEAAsE;AAItE,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CACzB;AAID,eAAO,MAAM,cAAc,EAAE,UAG5B,CAAC;AAIF,eAAO,MAAM,cAAc,EAAE,UAG5B,CAAC;AAIF,eAAO,MAAM,cAAc,EAAE,UAG5B,CAAC;AAIF,eAAO,MAAM,cAAc,EAAE,UAG5B,CAAC;AAIF,eAAO,MAAM,cAAc,EAAE,UAG5B,CAAC;AAIF,eAAO,MAAM,cAAc,EAAE,UAG5B,CAAC;AAIF,eAAO,MAAM,cAAc,EAAE,UAG5B,CAAC;AAIF,eAAO,MAAM,cAAc,EAAE,UAG5B,CAAC;AAIF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CASnD,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EditorState } from '../../state/EditorState.js';
|
|
2
2
|
import { Transaction } from '../../state/Transaction.js';
|
|
3
3
|
import { Plugin, PluginContext } from '../Plugin.js';
|
|
4
|
+
import { FontLocale } from './FontLocale.js';
|
|
4
5
|
declare module '../../model/AttrRegistry.js' {
|
|
5
6
|
interface MarkAttrRegistry {
|
|
6
7
|
font: {
|
|
@@ -52,12 +53,14 @@ export interface FontConfig {
|
|
|
52
53
|
readonly defaultFont?: string;
|
|
53
54
|
/** When true, a separator is rendered after the font toolbar item. */
|
|
54
55
|
readonly separatorAfter?: boolean;
|
|
56
|
+
readonly locale?: FontLocale;
|
|
55
57
|
}
|
|
56
58
|
export declare class FontPlugin implements Plugin {
|
|
57
59
|
readonly id = "font";
|
|
58
60
|
readonly name = "Font";
|
|
59
61
|
readonly priority = 22;
|
|
60
62
|
private readonly config;
|
|
63
|
+
private locale;
|
|
61
64
|
private injectedStyleElement;
|
|
62
65
|
private context;
|
|
63
66
|
private comboLabel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FontPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/font/FontPlugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"FontPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/font/FontPlugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,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;AAE1D,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAIhE,OAAO,QAAQ,6BAA6B,CAAC;IAC5C,UAAU,gBAAgB;QACzB,IAAI,EAAE;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;KACzB;CACD;AAID,4CAA4C;AAC5C,MAAM,WAAW,kBAAkB;IAClC,wEAAwE;IACxE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,mEAAmE;IACnE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,iDAAiD;IACjD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,mDAAmD;IACnD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,8CAA8C;AAC9C,MAAM,WAAW,cAAc;IAC9B,kDAAkD;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,gEAAgE;IAChE,QAAQ,CAAC,MAAM,EAA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MAAM,GAAG,IAAI;IAyBhD,SAAS,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAyC9E,OAAO,CAAC,UAAU;IAuClB,qFAAqF;IACrF,OAAO,CAAC,mBAAmB;IAgB3B,OAAO,CAAC,eAAe;IAgCvB,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,eAAe;IA0CvB,OAAO,CAAC,cAAc;CAgCtB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Locale interface and default English locale for the FontSizePlugin. */
|
|
2
|
+
export interface FontSizeLocale {
|
|
3
|
+
readonly label: string;
|
|
4
|
+
readonly tooltip: string;
|
|
5
|
+
readonly customFontSizeAria: string;
|
|
6
|
+
readonly fontSizesAria: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const FONT_SIZE_LOCALE_EN: FontSizeLocale;
|
|
9
|
+
export declare const FONT_SIZE_LOCALE_DE: FontSizeLocale;
|
|
10
|
+
export declare const FONT_SIZE_LOCALE_ES: FontSizeLocale;
|
|
11
|
+
export declare const FONT_SIZE_LOCALE_FR: FontSizeLocale;
|
|
12
|
+
export declare const FONT_SIZE_LOCALE_ZH: FontSizeLocale;
|
|
13
|
+
export declare const FONT_SIZE_LOCALE_RU: FontSizeLocale;
|
|
14
|
+
export declare const FONT_SIZE_LOCALE_AR: FontSizeLocale;
|
|
15
|
+
export declare const FONT_SIZE_LOCALE_HI: FontSizeLocale;
|
|
16
|
+
export declare const FONT_SIZE_LOCALES: Record<string, FontSizeLocale>;
|
|
17
|
+
//# sourceMappingURL=FontSizeLocale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FontSizeLocale.d.ts","sourceRoot":"","sources":["../../../src/plugins/font-size/FontSizeLocale.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAI1E,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAC/B;AAID,eAAO,MAAM,mBAAmB,EAAE,cAKjC,CAAC;AAIF,eAAO,MAAM,mBAAmB,EAAE,cAKjC,CAAC;AAIF,eAAO,MAAM,mBAAmB,EAAE,cAKjC,CAAC;AAIF,eAAO,MAAM,mBAAmB,EAAE,cAKjC,CAAC;AAIF,eAAO,MAAM,mBAAmB,EAAE,cAKjC,CAAC;AAIF,eAAO,MAAM,mBAAmB,EAAE,cAKjC,CAAC;AAIF,eAAO,MAAM,mBAAmB,EAAE,cAKjC,CAAC;AAIF,eAAO,MAAM,mBAAmB,EAAE,cAKjC,CAAC;AAIF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAS5D,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"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EditorState } from '../../state/EditorState.js';
|
|
2
2
|
import { Transaction } from '../../state/Transaction.js';
|
|
3
3
|
import { Plugin, PluginContext } from '../Plugin.js';
|
|
4
|
+
import { FontSizeLocale } from './FontSizeLocale.js';
|
|
4
5
|
declare module '../../model/AttrRegistry.js' {
|
|
5
6
|
interface MarkAttrRegistry {
|
|
6
7
|
fontSize: {
|
|
@@ -26,6 +27,7 @@ export interface FontSizeConfig {
|
|
|
26
27
|
readonly defaultSize?: number;
|
|
27
28
|
/** When true, a separator is rendered after the fontSize toolbar item. */
|
|
28
29
|
readonly separatorAfter?: boolean;
|
|
30
|
+
readonly locale?: FontSizeLocale;
|
|
29
31
|
}
|
|
30
32
|
export declare class FontSizePlugin implements Plugin {
|
|
31
33
|
readonly id = "fontSize";
|
|
@@ -34,6 +36,7 @@ export declare class FontSizePlugin implements Plugin {
|
|
|
34
36
|
private readonly config;
|
|
35
37
|
private readonly sizes;
|
|
36
38
|
private readonly defaultSize;
|
|
39
|
+
private locale;
|
|
37
40
|
private context;
|
|
38
41
|
private comboLabel;
|
|
39
42
|
constructor(config?: Partial<FontSizeConfig>);
|
|
@@ -50,16 +53,7 @@ export declare class FontSizePlugin implements Plugin {
|
|
|
50
53
|
* browser default (16px).
|
|
51
54
|
*/
|
|
52
55
|
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
56
|
private dismissPopup;
|
|
62
|
-
private
|
|
63
|
-
private selectSize;
|
|
57
|
+
private updateComboLabel;
|
|
64
58
|
}
|
|
65
59
|
//# 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;AAIH,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;AAE1D,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAW7E,OAAO,QAAQ,6BAA6B,CAAC;IAC5C,UAAU,gBAAgB;QACzB,QAAQ,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;KAC3B;CACD;AAID,4DAA4D;AAC5D,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAE/C,CAAC;AAMF,MAAM,WAAW,cAAc;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,0EAA0E;IAC1E,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC;CACjC;AAID,qBAAa,cAAe,YAAW,MAAM;IAC5C,QAAQ,CAAC,EAAE,cAAc;IACzB,QAAQ,CAAC,IAAI,eAAe;IAC5B,QAAQ,CAAC,QAAQ,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IACxC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAoB;IAC1C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,OAAO,CAA8B;IAC7C,OAAO,CAAC,UAAU,CAAgC;gBAEtC,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC;IAM5C,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAYlC,OAAO,IAAI,IAAI;IAKf,aAAa,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI;IAMpF,OAAO,CAAC,gBAAgB;IAoCxB,OAAO,CAAC,gBAAgB;IAoBxB,OAAO,CAAC,eAAe;IAavB,OAAO,CAAC,mBAAmB;IAyB3B;;;;OAIG;IACH,OAAO,CAAC,2BAA2B;IAKnC,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,gBAAgB;CAWxB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PluginContext } from '../Plugin.js';
|
|
2
|
+
import { FontSizeLocale } from './FontSizeLocale.js';
|
|
3
|
+
export interface FontSizePopupConfig {
|
|
4
|
+
readonly sizes: readonly number[];
|
|
5
|
+
readonly defaultSize: number;
|
|
6
|
+
readonly dismissPopup: () => void;
|
|
7
|
+
readonly locale?: FontSizeLocale;
|
|
8
|
+
}
|
|
9
|
+
/** Builds the font-size picker DOM inside the given container. */
|
|
10
|
+
export declare function renderFontSizePopup(container: HTMLElement, context: PluginContext, config: FontSizePopupConfig): void;
|
|
11
|
+
//# 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;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAU1D,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;IAClC,QAAQ,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC;CACjC;AAID,kEAAkE;AAClE,wBAAgB,mBAAmB,CAClC,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,mBAAmB,GACzB,IAAI,CAaN"}
|
|
@@ -1,220 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { b as e } from "../chunks/AttrRegistry-DTsHyDVA.mjs";
|
|
3
|
-
import { e as n, h as o } from "../chunks/Document-CI3iCwEP.mjs";
|
|
4
|
-
import { i, a as s, s as r } from "../chunks/Selection-D5ZjXoB7.mjs";
|
|
5
|
-
import { m as c } from "../chunks/TypeBrands-C09nE2qO.mjs";
|
|
6
|
-
import { a } from "../chunks/ToolbarPlugin-D5VqeBPT.mjs";
|
|
7
|
-
const l = [8, 9, 10, 11, 12, 14, 16, 18, 20, 24, 28, 32, 36, 48, 64, 72, 96], p = {};
|
|
8
|
-
class u {
|
|
9
|
-
id = "fontSize";
|
|
10
|
-
name = "Font Size";
|
|
11
|
-
priority = 21;
|
|
12
|
-
config;
|
|
13
|
-
sizes;
|
|
14
|
-
defaultSize;
|
|
15
|
-
context = null;
|
|
16
|
-
comboLabel = null;
|
|
17
|
-
constructor(t2) {
|
|
18
|
-
var e2;
|
|
19
|
-
this.config = { ...p, ...t2 }, this.sizes = (function(t3) {
|
|
20
|
-
if (!t3 || 0 === t3.length) return l;
|
|
21
|
-
const e3 = [...new Set(t3)].filter((t4) => Number.isInteger(t4) && t4 > 0);
|
|
22
|
-
return e3.sort((t4, e4) => t4 - e4), e3.length > 0 ? e3 : l;
|
|
23
|
-
})(t2?.sizes), this.defaultSize = (e2 = t2?.defaultSize, void 0 === e2 ? 16 : Number.isInteger(e2) && e2 > 0 ? e2 : 16);
|
|
24
|
-
}
|
|
25
|
-
init(t2) {
|
|
26
|
-
t2.registerStyleSheet("\n/* Font Size Select — Combobox-style toolbar button */\n.notectl-toolbar-btn--fontSize {\n width: auto;\n min-width: 60px;\n max-width: 80px;\n padding: 0 8px;\n gap: 4px;\n border: 1px solid var(--notectl-border);\n border-radius: 4px;\n background: var(--notectl-bg);\n}\n\n.notectl-toolbar-btn--fontSize:hover {\n background: var(--notectl-hover-bg);\n border-color: var(--notectl-fg-muted);\n}\n\n.notectl-toolbar-btn--fontSize.notectl-toolbar-btn--active {\n background: var(--notectl-bg);\n border-color: var(--notectl-primary-muted);\n}\n\n.notectl-toolbar-btn--fontSize .notectl-toolbar-btn__icon {\n display: flex;\n align-items: center;\n gap: 4px;\n width: 100%;\n overflow: hidden;\n}\n\n.notectl-toolbar-btn--fontSize .notectl-toolbar-btn__icon svg {\n display: none;\n}\n\n.notectl-font-size-select__label {\n flex: 1;\n font-size: 13px;\n font-weight: 500;\n color: var(--notectl-fg);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n text-align: left;\n line-height: 30px;\n}\n\n.notectl-font-size-select__arrow {\n flex-shrink: 0;\n font-size: 11px;\n color: var(--notectl-fg-muted);\n line-height: 30px;\n}\n\n/* Font Size Picker Popup */\n.notectl-font-size-picker {\n min-width: 140px;\n display: flex;\n flex-direction: column;\n}\n\n.notectl-font-size-picker__input-wrapper {\n padding: 8px 8px 4px;\n}\n\n.notectl-font-size-picker__input {\n width: 100%;\n padding: 6px 8px;\n border: 1px solid var(--notectl-border);\n border-radius: 4px;\n font-size: 13px;\n font-family: inherit;\n color: var(--notectl-fg);\n background: var(--notectl-bg);\n outline: none;\n box-sizing: border-box;\n -moz-appearance: textfield;\n}\n\n.notectl-font-size-picker__input::-webkit-inner-spin-button,\n.notectl-font-size-picker__input::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n.notectl-font-size-picker__input:focus {\n border-color: var(--notectl-border-focus);\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.notectl-font-size-picker__list {\n max-height: 280px;\n overflow-y: auto;\n padding: 4px 0;\n}\n\n.notectl-font-size-picker__item {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n padding: 7px 12px;\n border: none;\n background: none;\n cursor: pointer;\n font-size: 14px;\n color: var(--notectl-fg);\n line-height: 1.4;\n text-align: left;\n white-space: nowrap;\n font-family: inherit;\n transition: background 0.1s;\n outline: none;\n}\n\n.notectl-font-size-picker__item:hover {\n background: var(--notectl-hover-bg);\n}\n\n.notectl-font-size-picker__item--active {\n background: var(--notectl-active-bg);\n color: var(--notectl-primary-fg);\n}\n\n.notectl-font-size-picker__item--active:hover {\n background: var(--notectl-active-bg);\n}\n\n.notectl-font-size-picker__item--focused {\n outline: 2px solid var(--notectl-primary);\n outline-offset: -2px;\n}\n\n.notectl-font-size-picker__check {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n flex-shrink: 0;\n font-size: 13px;\n font-weight: 600;\n color: var(--notectl-primary-fg);\n}\n\n.notectl-font-size-picker__label {\n flex: 1;\n}\n"), this.context = t2, this.registerMarkSpec(t2), this.registerCommands(t2), this.registerKeymaps(t2), this.registerToolbarItem(t2), this.applyDefaultSizeToContainer(t2);
|
|
27
|
-
}
|
|
28
|
-
destroy() {
|
|
29
|
-
this.context = null, this.comboLabel = null;
|
|
30
|
-
}
|
|
31
|
-
onStateChange(t2, e2, n2) {
|
|
32
|
-
this.updateComboLabel(e2);
|
|
33
|
-
}
|
|
34
|
-
registerMarkSpec(t2) {
|
|
35
|
-
t2.registerMarkSpec({ type: "fontSize", rank: 4, attrs: { size: { default: "" } }, toDOM(t3) {
|
|
36
|
-
const e2 = document.createElement("span"), n2 = t3.attrs?.size ?? "";
|
|
37
|
-
return n2 && (e2.style.fontSize = n2), e2;
|
|
38
|
-
}, toHTMLString: (t3, e2) => {
|
|
39
|
-
const n2 = String(t3.attrs?.size ?? "");
|
|
40
|
-
return n2 ? `<span style="font-size: ${n2}">${e2}</span>` : e2;
|
|
41
|
-
}, parseHTML: [{ tag: "span", getAttrs: (t3) => {
|
|
42
|
-
const e2 = t3.style.fontSize;
|
|
43
|
-
return !!e2 && { size: e2 };
|
|
44
|
-
} }], sanitize: { tags: ["span"] } });
|
|
45
|
-
}
|
|
46
|
-
registerCommands(t2) {
|
|
47
|
-
t2.registerCommand("removeFontSize", () => {
|
|
48
|
-
const e2 = t2.getState();
|
|
49
|
-
return this.removeFontSize(t2, e2);
|
|
50
|
-
}), t2.registerCommand("setFontSize", () => false), t2.registerCommand("increaseFontSize", () => {
|
|
51
|
-
const e2 = t2.getState();
|
|
52
|
-
return this.stepFontSize(t2, e2, "up");
|
|
53
|
-
}), t2.registerCommand("decreaseFontSize", () => {
|
|
54
|
-
const e2 = t2.getState();
|
|
55
|
-
return this.stepFontSize(t2, e2, "down");
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
registerKeymaps(t2) {
|
|
59
|
-
t2.registerKeymap({ "Mod-Shift-+": () => {
|
|
60
|
-
const e2 = t2.getState();
|
|
61
|
-
return this.stepFontSize(t2, e2, "up");
|
|
62
|
-
}, "Mod-Shift-_": () => {
|
|
63
|
-
const e2 = t2.getState();
|
|
64
|
-
return this.stepFontSize(t2, e2, "down");
|
|
65
|
-
} });
|
|
66
|
-
}
|
|
67
|
-
registerToolbarItem(t2) {
|
|
68
|
-
const e2 = `<span class="notectl-font-size-select__label" data-font-size-label>${this.defaultSize}</span><span class="notectl-font-size-select__arrow">▾</span>`;
|
|
69
|
-
t2.registerToolbarItem({ id: "fontSize", group: "format", icon: e2, label: "Font Size", tooltip: "Font Size", command: "removeFontSize", priority: 6, popupType: "custom", separatorAfter: this.config.separatorAfter, renderPopup: (t3, e3) => {
|
|
70
|
-
this.renderFontSizePopup(t3, e3);
|
|
71
|
-
}, isActive: (t3) => this.isFontSizeActive(t3) });
|
|
72
|
-
}
|
|
73
|
-
applyDefaultSizeToContainer(t2) {
|
|
74
|
-
t2.getContainer().style.fontSize = `${this.defaultSize}px`;
|
|
75
|
-
}
|
|
76
|
-
updateComboLabel(t2) {
|
|
77
|
-
if (!this.comboLabel) {
|
|
78
|
-
const t3 = this.context?.getPluginContainer("top");
|
|
79
|
-
if (!t3) return;
|
|
80
|
-
if (this.comboLabel = t3.querySelector("[data-font-size-label]") ?? null, !this.comboLabel) return;
|
|
81
|
-
}
|
|
82
|
-
const e2 = this.getActiveSizeNumeric(t2);
|
|
83
|
-
this.comboLabel.textContent = String(e2);
|
|
84
|
-
}
|
|
85
|
-
isFontSizeActive(t2) {
|
|
86
|
-
return null !== this.getActiveSize(t2);
|
|
87
|
-
}
|
|
88
|
-
getActiveSize(t2) {
|
|
89
|
-
const o2 = t2.selection;
|
|
90
|
-
if (i(o2)) return null;
|
|
91
|
-
if (s(o2)) {
|
|
92
|
-
if (t2.storedMarks) {
|
|
93
|
-
const n2 = t2.storedMarks.find((t3) => "fontSize" === t3.type);
|
|
94
|
-
return n2 && e(n2, "fontSize") ? n2.attrs.size ?? null : null;
|
|
95
|
-
}
|
|
96
|
-
const i2 = t2.getBlock(o2.anchor.blockId);
|
|
97
|
-
if (!i2) return null;
|
|
98
|
-
const s2 = n(i2, o2.anchor.offset).find((t3) => "fontSize" === t3.type);
|
|
99
|
-
return s2 && e(s2, "fontSize") ? s2.attrs.size ?? null : null;
|
|
100
|
-
}
|
|
101
|
-
const r2 = t2.getBlock(o2.anchor.blockId);
|
|
102
|
-
if (!r2) return null;
|
|
103
|
-
const c2 = n(r2, o2.anchor.offset).find((t3) => "fontSize" === t3.type);
|
|
104
|
-
return c2 && e(c2, "fontSize") ? c2.attrs.size ?? null : null;
|
|
105
|
-
}
|
|
106
|
-
getActiveSizeNumeric(t2) {
|
|
107
|
-
const e2 = this.getActiveSize(t2);
|
|
108
|
-
if (!e2) return this.defaultSize;
|
|
109
|
-
const n2 = Number.parseInt(e2, 10);
|
|
110
|
-
return Number.isNaN(n2) ? this.defaultSize : n2;
|
|
111
|
-
}
|
|
112
|
-
applyFontSize(e2, o2, a2) {
|
|
113
|
-
const l2 = o2.selection;
|
|
114
|
-
if (i(l2)) return false;
|
|
115
|
-
if (s(l2)) {
|
|
116
|
-
const t2 = o2.getBlock(l2.anchor.blockId);
|
|
117
|
-
if (!t2) return false;
|
|
118
|
-
const i2 = [...(o2.storedMarks ?? n(t2, l2.anchor.offset)).filter((t3) => "fontSize" !== t3.type), { type: c("fontSize"), attrs: { size: a2 } }], s2 = o2.transaction("command").setStoredMarks(i2, o2.storedMarks).setSelection(l2).build();
|
|
119
|
-
return e2.dispatch(s2), true;
|
|
120
|
-
}
|
|
121
|
-
const p2 = r(l2, o2.getBlockOrder()), u2 = o2.transaction("command"), f = { type: c("fontSize"), attrs: { size: a2 } };
|
|
122
|
-
return t(o2, p2, (t2, e3, n2) => {
|
|
123
|
-
u2.removeMark(t2, e3, n2, { type: c("fontSize") }), u2.addMark(t2, e3, n2, f);
|
|
124
|
-
}), u2.setSelection(l2), e2.dispatch(u2.build()), true;
|
|
125
|
-
}
|
|
126
|
-
removeFontSize(e2, a2) {
|
|
127
|
-
const l2 = a2.selection;
|
|
128
|
-
if (i(l2)) return false;
|
|
129
|
-
if (s(l2)) {
|
|
130
|
-
const t2 = a2.getBlock(l2.anchor.blockId);
|
|
131
|
-
if (!t2) return false;
|
|
132
|
-
const i2 = a2.storedMarks ?? n(t2, l2.anchor.offset);
|
|
133
|
-
if (!o(i2, c("fontSize"))) return false;
|
|
134
|
-
const s2 = i2.filter((t3) => "fontSize" !== t3.type), r2 = a2.transaction("command").setStoredMarks(s2, a2.storedMarks).setSelection(l2).build();
|
|
135
|
-
return e2.dispatch(r2), true;
|
|
136
|
-
}
|
|
137
|
-
const p2 = r(l2, a2.getBlockOrder()), u2 = a2.transaction("command");
|
|
138
|
-
return t(a2, p2, (t2, e3, n2) => {
|
|
139
|
-
u2.removeMark(t2, e3, n2, { type: c("fontSize") });
|
|
140
|
-
}), u2.setSelection(l2), e2.dispatch(u2.build()), true;
|
|
141
|
-
}
|
|
142
|
-
stepFontSize(t2, e2, n2) {
|
|
143
|
-
const o2 = this.getActiveSizeNumeric(e2), i2 = this.getNextPresetSize(o2, n2);
|
|
144
|
-
return null !== i2 && (i2 === this.defaultSize ? this.removeFontSize(t2, e2) : this.applyFontSize(t2, e2, `${i2}px`));
|
|
145
|
-
}
|
|
146
|
-
getNextPresetSize(t2, e2) {
|
|
147
|
-
if ("up" === e2) {
|
|
148
|
-
for (const e3 of this.sizes) if (e3 > t2) return e3;
|
|
149
|
-
return null;
|
|
150
|
-
}
|
|
151
|
-
for (let e3 = this.sizes.length - 1; e3 >= 0; e3--) {
|
|
152
|
-
const n2 = this.sizes[e3];
|
|
153
|
-
if (void 0 !== n2 && n2 < t2) return n2;
|
|
154
|
-
}
|
|
155
|
-
return null;
|
|
156
|
-
}
|
|
157
|
-
dismissPopup() {
|
|
158
|
-
const t2 = this.context?.getService(a);
|
|
159
|
-
t2?.closePopup();
|
|
160
|
-
}
|
|
161
|
-
renderFontSizePopup(t2, e2) {
|
|
162
|
-
t2.classList.add("notectl-font-size-picker");
|
|
163
|
-
const n2 = e2.getState(), o2 = this.getActiveSizeNumeric(n2);
|
|
164
|
-
let i2 = -1;
|
|
165
|
-
const s2 = document.createElement("div");
|
|
166
|
-
s2.className = "notectl-font-size-picker__input-wrapper";
|
|
167
|
-
const r2 = document.createElement("input");
|
|
168
|
-
r2.type = "number", r2.className = "notectl-font-size-picker__input", r2.min = String(1), r2.max = String(400), r2.value = String(o2), r2.setAttribute("aria-label", "Custom font size"), s2.appendChild(r2), t2.appendChild(s2);
|
|
169
|
-
const c2 = document.createElement("div");
|
|
170
|
-
c2.className = "notectl-font-size-picker__list", c2.setAttribute("role", "listbox"), c2.setAttribute("aria-label", "Font sizes");
|
|
171
|
-
const a2 = [];
|
|
172
|
-
for (let t3 = 0; t3 < this.sizes.length; t3++) {
|
|
173
|
-
const n3 = this.sizes[t3];
|
|
174
|
-
if (void 0 === n3) continue;
|
|
175
|
-
const i3 = n3 === o2, s3 = `notectl-font-size-option-${n3}`, r3 = document.createElement("button");
|
|
176
|
-
r3.type = "button", r3.id = s3, r3.className = "notectl-font-size-picker__item", r3.setAttribute("role", "option"), r3.setAttribute("aria-selected", String(i3)), i3 && r3.classList.add("notectl-font-size-picker__item--active");
|
|
177
|
-
const l3 = document.createElement("span");
|
|
178
|
-
l3.className = "notectl-font-size-picker__check", l3.textContent = i3 ? "✓" : "", r3.appendChild(l3);
|
|
179
|
-
const p3 = document.createElement("span");
|
|
180
|
-
p3.className = "notectl-font-size-picker__label", p3.textContent = String(n3), r3.appendChild(p3), r3.addEventListener("mousedown", (t4) => {
|
|
181
|
-
t4.preventDefault(), t4.stopPropagation(), this.selectSize(e2, n3), this.dismissPopup();
|
|
182
|
-
}), a2.push(r3), c2.appendChild(r3);
|
|
183
|
-
}
|
|
184
|
-
t2.appendChild(c2);
|
|
185
|
-
const l2 = this.sizes.indexOf(o2);
|
|
186
|
-
if (l2 >= 0) {
|
|
187
|
-
const t3 = a2[l2];
|
|
188
|
-
t3 && (requestAnimationFrame(() => {
|
|
189
|
-
t3.scrollIntoView({ block: "nearest" });
|
|
190
|
-
}), c2.setAttribute("aria-activedescendant", t3.id));
|
|
191
|
-
}
|
|
192
|
-
const p2 = (t3) => {
|
|
193
|
-
i2 >= 0 && i2 < a2.length && a2[i2]?.classList.remove("notectl-font-size-picker__item--focused"), i2 = t3;
|
|
194
|
-
const e3 = a2[i2];
|
|
195
|
-
i2 >= 0 && i2 < a2.length && e3 && (e3.classList.add("notectl-font-size-picker__item--focused"), e3.scrollIntoView({ block: "nearest" }), c2.setAttribute("aria-activedescendant", e3.id));
|
|
196
|
-
};
|
|
197
|
-
r2.addEventListener("keydown", (t3) => {
|
|
198
|
-
if ("Enter" === t3.key) {
|
|
199
|
-
t3.preventDefault();
|
|
200
|
-
const n3 = Number.parseInt(r2.value, 10);
|
|
201
|
-
!Number.isNaN(n3) && n3 >= 1 && n3 <= 400 && (this.selectSize(e2, n3), this.dismissPopup());
|
|
202
|
-
} else "ArrowDown" === t3.key ? (t3.preventDefault(), p2(0), a2[0]?.focus()) : "Escape" === t3.key && (t3.preventDefault(), this.dismissPopup());
|
|
203
|
-
}), c2.addEventListener("keydown", (t3) => {
|
|
204
|
-
if ("ArrowDown" === t3.key) t3.preventDefault(), i2 < a2.length - 1 && (p2(i2 + 1), a2[i2]?.focus());
|
|
205
|
-
else if ("ArrowUp" === t3.key) t3.preventDefault(), i2 > 0 ? (p2(i2 - 1), a2[i2]?.focus()) : (p2(-1), r2.focus());
|
|
206
|
-
else if ("Enter" === t3.key) {
|
|
207
|
-
t3.preventDefault();
|
|
208
|
-
const n3 = this.sizes[i2];
|
|
209
|
-
i2 >= 0 && i2 < this.sizes.length && void 0 !== n3 && (this.selectSize(e2, n3), this.dismissPopup());
|
|
210
|
-
} else "Escape" === t3.key && (t3.preventDefault(), this.dismissPopup());
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
selectSize(t2, e2) {
|
|
214
|
-
e2 === this.defaultSize ? t2.executeCommand("removeFontSize") : this.applyFontSize(t2, t2.getState(), `${e2}px`);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
1
|
+
import { b } from "../chunks/index-BYgspns5.mjs";
|
|
217
2
|
export {
|
|
218
|
-
|
|
3
|
+
b as FontSizePlugin
|
|
219
4
|
};
|
|
220
5
|
//# sourceMappingURL=font-size.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"font-size.mjs","sources":["../../src/editor/styles/font-size-select.ts","../../src/plugins/font-size/FontSizePlugin.ts"],"sourcesContent":["/** Font size picker toolbar combobox + popup styles. */\nexport const FONT_SIZE_SELECT_CSS = `\n/* Font Size Select — Combobox-style toolbar button */\n.notectl-toolbar-btn--fontSize {\n\twidth: auto;\n\tmin-width: 60px;\n\tmax-width: 80px;\n\tpadding: 0 8px;\n\tgap: 4px;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 4px;\n\tbackground: var(--notectl-bg);\n}\n\n.notectl-toolbar-btn--fontSize:hover {\n\tbackground: var(--notectl-hover-bg);\n\tborder-color: var(--notectl-fg-muted);\n}\n\n.notectl-toolbar-btn--fontSize.notectl-toolbar-btn--active {\n\tbackground: var(--notectl-bg);\n\tborder-color: var(--notectl-primary-muted);\n}\n\n.notectl-toolbar-btn--fontSize .notectl-toolbar-btn__icon {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 4px;\n\twidth: 100%;\n\toverflow: hidden;\n}\n\n.notectl-toolbar-btn--fontSize .notectl-toolbar-btn__icon svg {\n\tdisplay: none;\n}\n\n.notectl-font-size-select__label {\n\tflex: 1;\n\tfont-size: 13px;\n\tfont-weight: 500;\n\tcolor: var(--notectl-fg);\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\ttext-align: left;\n\tline-height: 30px;\n}\n\n.notectl-font-size-select__arrow {\n\tflex-shrink: 0;\n\tfont-size: 11px;\n\tcolor: var(--notectl-fg-muted);\n\tline-height: 30px;\n}\n\n/* Font Size Picker Popup */\n.notectl-font-size-picker {\n\tmin-width: 140px;\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.notectl-font-size-picker__input-wrapper {\n\tpadding: 8px 8px 4px;\n}\n\n.notectl-font-size-picker__input {\n\twidth: 100%;\n\tpadding: 6px 8px;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 4px;\n\tfont-size: 13px;\n\tfont-family: inherit;\n\tcolor: var(--notectl-fg);\n\tbackground: var(--notectl-bg);\n\toutline: none;\n\tbox-sizing: border-box;\n\t-moz-appearance: textfield;\n}\n\n.notectl-font-size-picker__input::-webkit-inner-spin-button,\n.notectl-font-size-picker__input::-webkit-outer-spin-button {\n\t-webkit-appearance: none;\n\tmargin: 0;\n}\n\n.notectl-font-size-picker__input:focus {\n\tborder-color: var(--notectl-border-focus);\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.notectl-font-size-picker__list {\n\tmax-height: 280px;\n\toverflow-y: auto;\n\tpadding: 4px 0;\n}\n\n.notectl-font-size-picker__item {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\twidth: 100%;\n\tpadding: 7px 12px;\n\tborder: none;\n\tbackground: none;\n\tcursor: pointer;\n\tfont-size: 14px;\n\tcolor: var(--notectl-fg);\n\tline-height: 1.4;\n\ttext-align: left;\n\twhite-space: nowrap;\n\tfont-family: inherit;\n\ttransition: background 0.1s;\n\toutline: none;\n}\n\n.notectl-font-size-picker__item:hover {\n\tbackground: var(--notectl-hover-bg);\n}\n\n.notectl-font-size-picker__item--active {\n\tbackground: var(--notectl-active-bg);\n\tcolor: var(--notectl-primary-fg);\n}\n\n.notectl-font-size-picker__item--active:hover {\n\tbackground: var(--notectl-active-bg);\n}\n\n.notectl-font-size-picker__item--focused {\n\toutline: 2px solid var(--notectl-primary);\n\toutline-offset: -2px;\n}\n\n.notectl-font-size-picker__check {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 16px;\n\tflex-shrink: 0;\n\tfont-size: 13px;\n\tfont-weight: 600;\n\tcolor: var(--notectl-primary-fg);\n}\n\n.notectl-font-size-picker__label {\n\tflex: 1;\n}\n`;\n","/**\n * FontSizePlugin: registers a fontSize mark with attrs, a combobox-style\n * toolbar selector with WCAG-accessible popup, and commands for\n * increasing / decreasing font size.\n */\n\nimport { forEachBlockInRange } from '../../commands/Commands.js';\nimport { FONT_SIZE_SELECT_CSS } from '../../editor/styles/font-size-select.js';\nimport { isMarkOfType } from '../../model/AttrRegistry.js';\nimport { getBlockMarksAtOffset, hasMark } from '../../model/Document.js';\nimport { isCollapsed, isNodeSelection, selectionRange } from '../../model/Selection.js';\nimport { markType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { Transaction } from '../../state/Transaction.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { ToolbarServiceKey } from '../toolbar/ToolbarPlugin.js';\n\n// --- Attribute Registry Augmentation ---\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface MarkAttrRegistry {\n\t\tfontSize: { size: string };\n\t}\n}\n\n// --- Constants ---\n\n/** Default preset sizes shown in the font size dropdown. */\nexport const DEFAULT_FONT_SIZES: readonly number[] = [\n\t8, 9, 10, 11, 12, 14, 16, 18, 20, 24, 28, 32, 36, 48, 64, 72, 96,\n];\n\nconst DEFAULT_FONT_SIZE = 16;\nconst MIN_CUSTOM_SIZE = 1;\nconst MAX_CUSTOM_SIZE = 400;\n\n// --- Configuration ---\n\nexport interface FontSizeConfig {\n\t/**\n\t * Preset sizes shown in the font size dropdown.\n\t * Must contain positive integers. Values are sorted and deduplicated automatically.\n\t * Defaults to {@link DEFAULT_FONT_SIZES} when omitted or empty.\n\t */\n\treadonly sizes?: readonly number[];\n\t/**\n\t * The base font size that text has when no fontSize mark is applied.\n\t * Shown as the initial value in the toolbar combo and used as the\n\t * \"neutral\" size — selecting it removes the mark instead of applying one.\n\t * Defaults to 16.\n\t */\n\treadonly defaultSize?: number;\n\t/** When true, a separator is rendered after the fontSize toolbar item. */\n\treadonly separatorAfter?: boolean;\n}\n\nconst DEFAULT_CONFIG: FontSizeConfig = {};\n\n// --- Plugin ---\n\nexport class FontSizePlugin implements Plugin {\n\treadonly id = 'fontSize';\n\treadonly name = 'Font Size';\n\treadonly priority = 21;\n\n\tprivate readonly config: FontSizeConfig;\n\tprivate readonly sizes: readonly number[];\n\tprivate readonly defaultSize: number;\n\tprivate context: PluginContext | null = null;\n\tprivate comboLabel: HTMLSpanElement | null = null;\n\n\tconstructor(config?: Partial<FontSizeConfig>) {\n\t\tthis.config = { ...DEFAULT_CONFIG, ...config };\n\t\tthis.sizes = resolveSizes(config?.sizes);\n\t\tthis.defaultSize = resolveDefaultSize(config?.defaultSize);\n\t}\n\n\tinit(context: PluginContext): void {\n\t\tcontext.registerStyleSheet(FONT_SIZE_SELECT_CSS);\n\t\tthis.context = context;\n\t\tthis.registerMarkSpec(context);\n\t\tthis.registerCommands(context);\n\t\tthis.registerKeymaps(context);\n\t\tthis.registerToolbarItem(context);\n\t\tthis.applyDefaultSizeToContainer(context);\n\t}\n\n\tdestroy(): void {\n\t\tthis.context = null;\n\t\tthis.comboLabel = null;\n\t}\n\n\tonStateChange(_oldState: EditorState, newState: EditorState, _tr: Transaction): void {\n\t\tthis.updateComboLabel(newState);\n\t}\n\n\t// --- Schema ---\n\n\tprivate registerMarkSpec(context: PluginContext): void {\n\t\tcontext.registerMarkSpec({\n\t\t\ttype: 'fontSize',\n\t\t\trank: 4,\n\t\t\tattrs: {\n\t\t\t\tsize: { default: '' },\n\t\t\t},\n\t\t\ttoDOM(mark) {\n\t\t\t\tconst span: HTMLElement = document.createElement('span');\n\t\t\t\tconst size: string = mark.attrs?.size ?? '';\n\t\t\t\tif (size) {\n\t\t\t\t\tspan.style.fontSize = size;\n\t\t\t\t}\n\t\t\t\treturn span;\n\t\t\t},\n\t\t\ttoHTMLString: (mark, content) => {\n\t\t\t\tconst size: string = String(mark.attrs?.size ?? '');\n\t\t\t\tif (!size) return content;\n\t\t\t\treturn `<span style=\"font-size: ${size}\">${content}</span>`;\n\t\t\t},\n\t\t\tparseHTML: [\n\t\t\t\t{\n\t\t\t\t\ttag: 'span',\n\t\t\t\t\tgetAttrs: (el) => {\n\t\t\t\t\t\tconst size: string = el.style.fontSize;\n\t\t\t\t\t\tif (!size) return false;\n\t\t\t\t\t\treturn { size };\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\tsanitize: { tags: ['span'] },\n\t\t});\n\t}\n\n\t// --- Commands ---\n\n\tprivate registerCommands(context: PluginContext): void {\n\t\tcontext.registerCommand('removeFontSize', () => {\n\t\t\tconst state: EditorState = context.getState();\n\t\t\treturn this.removeFontSize(context, state);\n\t\t});\n\n\t\tcontext.registerCommand('setFontSize', () => {\n\t\t\treturn false;\n\t\t});\n\n\t\tcontext.registerCommand('increaseFontSize', () => {\n\t\t\tconst state: EditorState = context.getState();\n\t\t\treturn this.stepFontSize(context, state, 'up');\n\t\t});\n\n\t\tcontext.registerCommand('decreaseFontSize', () => {\n\t\t\tconst state: EditorState = context.getState();\n\t\t\treturn this.stepFontSize(context, state, 'down');\n\t\t});\n\t}\n\n\t// --- Keymaps ---\n\n\tprivate registerKeymaps(context: PluginContext): void {\n\t\tcontext.registerKeymap({\n\t\t\t'Mod-Shift-+': () => {\n\t\t\t\tconst state: EditorState = context.getState();\n\t\t\t\treturn this.stepFontSize(context, state, 'up');\n\t\t\t},\n\t\t\t'Mod-Shift-_': () => {\n\t\t\t\tconst state: EditorState = context.getState();\n\t\t\t\treturn this.stepFontSize(context, state, 'down');\n\t\t\t},\n\t\t});\n\t}\n\n\t// --- Toolbar ---\n\n\tprivate registerToolbarItem(context: PluginContext): void {\n\t\tconst icon: string = `<span class=\"notectl-font-size-select__label\" data-font-size-label>${this.defaultSize}</span><span class=\"notectl-font-size-select__arrow\">\\u25BE</span>`;\n\n\t\tcontext.registerToolbarItem({\n\t\t\tid: 'fontSize',\n\t\t\tgroup: 'format',\n\t\t\ticon,\n\t\t\tlabel: 'Font Size',\n\t\t\ttooltip: 'Font Size',\n\t\t\tcommand: 'removeFontSize',\n\t\t\tpriority: 6,\n\t\t\tpopupType: 'custom',\n\t\t\tseparatorAfter: this.config.separatorAfter,\n\t\t\trenderPopup: (container, ctx) => {\n\t\t\t\tthis.renderFontSizePopup(container, ctx);\n\t\t\t},\n\t\t\tisActive: (state) => this.isFontSizeActive(state),\n\t\t});\n\t}\n\n\t/**\n\t * Sets the configured default font size on the editor content container\n\t * so that unformatted text renders at the correct size instead of the\n\t * browser default (16px).\n\t */\n\tprivate applyDefaultSizeToContainer(context: PluginContext): void {\n\t\tconst container: HTMLElement = context.getContainer();\n\t\tcontainer.style.fontSize = `${this.defaultSize}px`;\n\t}\n\n\tprivate updateComboLabel(state: EditorState): void {\n\t\tif (!this.comboLabel) {\n\t\t\tconst container: HTMLElement | undefined = this.context?.getPluginContainer('top');\n\t\t\tif (!container) return;\n\t\t\tthis.comboLabel = container.querySelector<HTMLSpanElement>('[data-font-size-label]') ?? null;\n\t\t\tif (!this.comboLabel) return;\n\t\t}\n\n\t\tconst activeSize: number = this.getActiveSizeNumeric(state);\n\t\tthis.comboLabel.textContent = String(activeSize);\n\t}\n\n\t// --- State Queries ---\n\n\tprivate isFontSizeActive(state: EditorState): boolean {\n\t\treturn this.getActiveSize(state) !== null;\n\t}\n\n\tprivate getActiveSize(state: EditorState): string | null {\n\t\tconst sel = state.selection;\n\t\tif (isNodeSelection(sel)) return null;\n\n\t\tif (isCollapsed(sel)) {\n\t\t\tif (state.storedMarks) {\n\t\t\t\tconst mark = state.storedMarks.find((m) => m.type === 'fontSize');\n\t\t\t\treturn mark && isMarkOfType(mark, 'fontSize') ? (mark.attrs.size ?? null) : null;\n\t\t\t}\n\t\t\tconst block = state.getBlock(sel.anchor.blockId);\n\t\t\tif (!block) return null;\n\t\t\tconst marks = getBlockMarksAtOffset(block, sel.anchor.offset);\n\t\t\tconst mark = marks.find((m) => m.type === 'fontSize');\n\t\t\treturn mark && isMarkOfType(mark, 'fontSize') ? (mark.attrs.size ?? null) : null;\n\t\t}\n\n\t\tconst block = state.getBlock(sel.anchor.blockId);\n\t\tif (!block) return null;\n\t\tconst marks = getBlockMarksAtOffset(block, sel.anchor.offset);\n\t\tconst mark = marks.find((m) => m.type === 'fontSize');\n\t\treturn mark && isMarkOfType(mark, 'fontSize') ? (mark.attrs.size ?? null) : null;\n\t}\n\n\tprivate getActiveSizeNumeric(state: EditorState): number {\n\t\tconst raw: string | null = this.getActiveSize(state);\n\t\tif (!raw) return this.defaultSize;\n\t\tconst parsed: number = Number.parseInt(raw, 10);\n\t\treturn Number.isNaN(parsed) ? this.defaultSize : parsed;\n\t}\n\n\t// --- Font Size Application ---\n\n\tprivate applyFontSize(context: PluginContext, state: EditorState, size: string): boolean {\n\t\tconst sel = state.selection;\n\t\tif (isNodeSelection(sel)) return false;\n\n\t\tif (isCollapsed(sel)) {\n\t\t\tconst anchorBlock = state.getBlock(sel.anchor.blockId);\n\t\t\tif (!anchorBlock) return false;\n\t\t\tconst currentMarks =\n\t\t\t\tstate.storedMarks ?? getBlockMarksAtOffset(anchorBlock, sel.anchor.offset);\n\t\t\tconst withoutSize = currentMarks.filter((m) => m.type !== 'fontSize');\n\t\t\tconst newMarks = [...withoutSize, { type: markType('fontSize'), attrs: { size } }];\n\n\t\t\tconst tr = state\n\t\t\t\t.transaction('command')\n\t\t\t\t.setStoredMarks(newMarks, state.storedMarks)\n\t\t\t\t.setSelection(sel)\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t\treturn true;\n\t\t}\n\n\t\tconst range = selectionRange(sel, state.getBlockOrder());\n\t\tconst builder = state.transaction('command');\n\t\tconst mark = { type: markType('fontSize'), attrs: { size } };\n\n\t\tforEachBlockInRange(state, range, (blockId, from, to) => {\n\t\t\tbuilder.removeMark(blockId, from, to, { type: markType('fontSize') });\n\t\t\tbuilder.addMark(blockId, from, to, mark);\n\t\t});\n\n\t\tbuilder.setSelection(sel);\n\t\tcontext.dispatch(builder.build());\n\t\treturn true;\n\t}\n\n\tprivate removeFontSize(context: PluginContext, state: EditorState): boolean {\n\t\tconst sel = state.selection;\n\t\tif (isNodeSelection(sel)) return false;\n\n\t\tif (isCollapsed(sel)) {\n\t\t\tconst anchorBlock = state.getBlock(sel.anchor.blockId);\n\t\t\tif (!anchorBlock) return false;\n\t\t\tconst currentMarks =\n\t\t\t\tstate.storedMarks ?? getBlockMarksAtOffset(anchorBlock, sel.anchor.offset);\n\t\t\tif (!hasMark(currentMarks, markType('fontSize'))) return false;\n\n\t\t\tconst newMarks = currentMarks.filter((m) => m.type !== 'fontSize');\n\t\t\tconst tr = state\n\t\t\t\t.transaction('command')\n\t\t\t\t.setStoredMarks(newMarks, state.storedMarks)\n\t\t\t\t.setSelection(sel)\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t\treturn true;\n\t\t}\n\n\t\tconst range = selectionRange(sel, state.getBlockOrder());\n\t\tconst builder = state.transaction('command');\n\n\t\tforEachBlockInRange(state, range, (blockId, from, to) => {\n\t\t\tbuilder.removeMark(blockId, from, to, { type: markType('fontSize') });\n\t\t});\n\n\t\tbuilder.setSelection(sel);\n\t\tcontext.dispatch(builder.build());\n\t\treturn true;\n\t}\n\n\t// --- Increase / Decrease ---\n\n\tprivate stepFontSize(\n\t\tcontext: PluginContext,\n\t\tstate: EditorState,\n\t\tdirection: 'up' | 'down',\n\t): boolean {\n\t\tconst current: number = this.getActiveSizeNumeric(state);\n\t\tconst next: number | null = this.getNextPresetSize(current, direction);\n\t\tif (next === null) return false;\n\n\t\tif (next === this.defaultSize) {\n\t\t\treturn this.removeFontSize(context, state);\n\t\t}\n\t\treturn this.applyFontSize(context, state, `${next}px`);\n\t}\n\n\tprivate getNextPresetSize(current: number, direction: 'up' | 'down'): number | null {\n\t\tif (direction === 'up') {\n\t\t\tfor (const size of this.sizes) {\n\t\t\t\tif (size > current) return size;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\tfor (let i: number = this.sizes.length - 1; i >= 0; i--) {\n\t\t\tconst size: number | undefined = this.sizes[i];\n\t\t\tif (size !== undefined && size < current) return size;\n\t\t}\n\t\treturn null;\n\t}\n\n\t// --- Popup Rendering ---\n\n\tprivate dismissPopup(): void {\n\t\tconst toolbar = this.context?.getService(ToolbarServiceKey);\n\t\ttoolbar?.closePopup();\n\t}\n\n\tprivate renderFontSizePopup(container: HTMLElement, context: PluginContext): void {\n\t\tcontainer.classList.add('notectl-font-size-picker');\n\n\t\tconst state: EditorState = context.getState();\n\t\tconst currentSize: number = this.getActiveSizeNumeric(state);\n\t\tlet focusedIndex = -1;\n\n\t\t// --- Custom Input ---\n\t\tconst inputWrapper: HTMLDivElement = document.createElement('div');\n\t\tinputWrapper.className = 'notectl-font-size-picker__input-wrapper';\n\n\t\tconst input: HTMLInputElement = document.createElement('input');\n\t\tinput.type = 'number';\n\t\tinput.className = 'notectl-font-size-picker__input';\n\t\tinput.min = String(MIN_CUSTOM_SIZE);\n\t\tinput.max = String(MAX_CUSTOM_SIZE);\n\t\tinput.value = String(currentSize);\n\t\tinput.setAttribute('aria-label', 'Custom font size');\n\n\t\tinputWrapper.appendChild(input);\n\t\tcontainer.appendChild(inputWrapper);\n\n\t\t// --- List ---\n\t\tconst list: HTMLDivElement = document.createElement('div');\n\t\tlist.className = 'notectl-font-size-picker__list';\n\t\tlist.setAttribute('role', 'listbox');\n\t\tlist.setAttribute('aria-label', 'Font sizes');\n\n\t\tconst items: HTMLButtonElement[] = [];\n\n\t\tfor (let idx = 0; idx < this.sizes.length; idx++) {\n\t\t\tconst size: number | undefined = this.sizes[idx];\n\t\t\tif (size === undefined) continue;\n\t\t\tconst isActive: boolean = size === currentSize;\n\t\t\tconst itemId: string = `notectl-font-size-option-${size}`;\n\n\t\t\tconst item: HTMLButtonElement = document.createElement('button');\n\t\t\titem.type = 'button';\n\t\t\titem.id = itemId;\n\t\t\titem.className = 'notectl-font-size-picker__item';\n\t\t\titem.setAttribute('role', 'option');\n\t\t\titem.setAttribute('aria-selected', String(isActive));\n\n\t\t\tif (isActive) {\n\t\t\t\titem.classList.add('notectl-font-size-picker__item--active');\n\t\t\t}\n\n\t\t\tconst check: HTMLSpanElement = document.createElement('span');\n\t\t\tcheck.className = 'notectl-font-size-picker__check';\n\t\t\tcheck.textContent = isActive ? '\\u2713' : '';\n\t\t\titem.appendChild(check);\n\n\t\t\tconst label: HTMLSpanElement = document.createElement('span');\n\t\t\tlabel.className = 'notectl-font-size-picker__label';\n\t\t\tlabel.textContent = String(size);\n\t\t\titem.appendChild(label);\n\n\t\t\titem.addEventListener('mousedown', (e: MouseEvent) => {\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopPropagation();\n\t\t\t\tthis.selectSize(context, size);\n\t\t\t\tthis.dismissPopup();\n\t\t\t});\n\n\t\t\titems.push(item);\n\t\t\tlist.appendChild(item);\n\t\t}\n\n\t\tcontainer.appendChild(list);\n\n\t\t// --- Scroll active item into view ---\n\t\tconst activeIdx: number = this.sizes.indexOf(currentSize);\n\t\tif (activeIdx >= 0) {\n\t\t\tconst activeItem: HTMLButtonElement | undefined = items[activeIdx];\n\t\t\tif (activeItem) {\n\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\tactiveItem.scrollIntoView({ block: 'nearest' });\n\t\t\t\t});\n\t\t\t\tlist.setAttribute('aria-activedescendant', activeItem.id);\n\t\t\t}\n\t\t}\n\n\t\t// --- Keyboard helpers ---\n\t\tconst setFocusedIndex = (idx: number): void => {\n\t\t\tif (focusedIndex >= 0 && focusedIndex < items.length) {\n\t\t\t\titems[focusedIndex]?.classList.remove('notectl-font-size-picker__item--focused');\n\t\t\t}\n\t\t\tfocusedIndex = idx;\n\t\t\tconst focused: HTMLButtonElement | undefined = items[focusedIndex];\n\t\t\tif (focusedIndex >= 0 && focusedIndex < items.length && focused) {\n\t\t\t\tfocused.classList.add('notectl-font-size-picker__item--focused');\n\t\t\t\tfocused.scrollIntoView({ block: 'nearest' });\n\t\t\t\tlist.setAttribute('aria-activedescendant', focused.id);\n\t\t\t}\n\t\t};\n\n\t\t// --- Input Events ---\n\t\tinput.addEventListener('keydown', (e: KeyboardEvent) => {\n\t\t\tif (e.key === 'Enter') {\n\t\t\t\te.preventDefault();\n\t\t\t\tconst val: number = Number.parseInt(input.value, 10);\n\t\t\t\tif (!Number.isNaN(val) && val >= MIN_CUSTOM_SIZE && val <= MAX_CUSTOM_SIZE) {\n\t\t\t\t\tthis.selectSize(context, val);\n\t\t\t\t\tthis.dismissPopup();\n\t\t\t\t}\n\t\t\t} else if (e.key === 'ArrowDown') {\n\t\t\t\te.preventDefault();\n\t\t\t\tsetFocusedIndex(0);\n\t\t\t\titems[0]?.focus();\n\t\t\t} else if (e.key === 'Escape') {\n\t\t\t\te.preventDefault();\n\t\t\t\tthis.dismissPopup();\n\t\t\t}\n\t\t});\n\n\t\t// --- List Keyboard Navigation ---\n\t\tlist.addEventListener('keydown', (e: KeyboardEvent) => {\n\t\t\tif (e.key === 'ArrowDown') {\n\t\t\t\te.preventDefault();\n\t\t\t\tif (focusedIndex < items.length - 1) {\n\t\t\t\t\tsetFocusedIndex(focusedIndex + 1);\n\t\t\t\t\titems[focusedIndex]?.focus();\n\t\t\t\t}\n\t\t\t} else if (e.key === 'ArrowUp') {\n\t\t\t\te.preventDefault();\n\t\t\t\tif (focusedIndex > 0) {\n\t\t\t\t\tsetFocusedIndex(focusedIndex - 1);\n\t\t\t\t\titems[focusedIndex]?.focus();\n\t\t\t\t} else {\n\t\t\t\t\tsetFocusedIndex(-1);\n\t\t\t\t\tinput.focus();\n\t\t\t\t}\n\t\t\t} else if (e.key === 'Enter') {\n\t\t\t\te.preventDefault();\n\t\t\t\tconst selectedSize: number | undefined = this.sizes[focusedIndex];\n\t\t\t\tif (focusedIndex >= 0 && focusedIndex < this.sizes.length && selectedSize !== undefined) {\n\t\t\t\t\tthis.selectSize(context, selectedSize);\n\t\t\t\t\tthis.dismissPopup();\n\t\t\t\t}\n\t\t\t} else if (e.key === 'Escape') {\n\t\t\t\te.preventDefault();\n\t\t\t\tthis.dismissPopup();\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate selectSize(context: PluginContext, size: number): void {\n\t\tif (size === this.defaultSize) {\n\t\t\tcontext.executeCommand('removeFontSize');\n\t\t} else {\n\t\t\tthis.applyFontSize(context, context.getState(), `${size}px`);\n\t\t}\n\t}\n}\n\n// --- Helpers ---\n\nfunction resolveSizes(sizes: readonly number[] | undefined): readonly number[] {\n\tif (!sizes || sizes.length === 0) return DEFAULT_FONT_SIZES;\n\tconst unique: number[] = [...new Set(sizes)].filter((n) => Number.isInteger(n) && n > 0);\n\tunique.sort((a, b) => a - b);\n\treturn unique.length > 0 ? unique : DEFAULT_FONT_SIZES;\n}\n\nfunction resolveDefaultSize(size: number | undefined): number {\n\tif (size === undefined) return DEFAULT_FONT_SIZE;\n\treturn Number.isInteger(size) && size > 0 ? size : DEFAULT_FONT_SIZE;\n}\n"],"names":["DEFAULT_FONT_SIZES","DEFAULT_CONFIG","FontSizePlugin","id","name","priority","config","sizes","defaultSize","context","comboLabel","size","this","length","unique","Set","filter","n","Number","isInteger","sort","a","b","registerStyleSheet","registerMarkSpec","registerCommands","registerKeymaps","registerToolbarItem","applyDefaultSizeToContainer","destroy","_oldState","newState","_tr","updateComboLabel","type","rank","attrs","default","mark","span","document","createElement","style","fontSize","toHTMLString","content","String","parseHTML","tag","getAttrs","el","sanitize","tags","registerCommand","state","getState","removeFontSize","stepFontSize","registerKeymap","icon","group","label","tooltip","command","popupType","separatorAfter","renderPopup","container","ctx","renderFontSizePopup","isActive","isFontSizeActive","getContainer","getPluginContainer","querySelector","activeSize","getActiveSizeNumeric","textContent","getActiveSize","sel","selection","isNodeSelection","isCollapsed","storedMarks","find","m","isMarkOfType","block","getBlock","anchor","blockId","getBlockMarksAtOffset","offset","raw","parsed","parseInt","isNaN","anchorBlock","newMarks","markType","tr","transaction","setStoredMarks","setSelection","build","dispatch","range","selectionRange","getBlockOrder","builder","forEachBlockInRange","from","to","removeMark","addMark","currentMarks","hasMark","direction","current","next","getNextPresetSize","applyFontSize","i","toolbar","getService","ToolbarServiceKey","closePopup","classList","add","currentSize","focusedIndex","inputWrapper","className","input","min","max","value","setAttribute","appendChild","list","items","idx","itemId","item","check","addEventListener","e","preventDefault","stopPropagation","selectSize","dismissPopup","push","activeIdx","indexOf","activeItem","requestAnimationFrame","scrollIntoView","setFocusedIndex","remove","focused","key","val","focus","selectedSize","executeCommand"],"mappings":";;;;;;AACO,MC2BMA,IAAwC,CACpD,GAAG,GAAG,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,EAAA,GA2BzDC,IAAiC,CAAA;AAIhC,MAAMC,EAAAA;AAAAA,EACHC,KAAK;AAAA,EACLC,OAAO;AAAA,EACPC,WAAW;AAAA,EAEHC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACTC,UAAgC;AAAA,EAChCC,aAAqC;AAAA,EAE7C,YAAYJ;AAmcb,QAA4BK;AAlc1BC,SAAKN,SAAS,KAAKL,GAAAA,GAAmBK,GAAAA,GACtCM,KAAKL,SA0bP,SAAsBA,IAAAA;AACrB,UAAA,CAAKA,MAA0B,MAAjBA,GAAMM,OAAc,QAAOb;AACzC,YAAMc,KAAmB,CAAA,GAAI,IAAIC,IAAIR,EAAAA,CAAAA,EAAQS,OAAQC,CAAAA,OAAMC,OAAOC,UAAUF,OAAMA,KAAI,CAAA;AAEtF,aADAH,GAAOM,KAAK,CAACC,IAAGC,OAAMD,KAAIC,KACnBR,GAAOD,SAAS,IAAIC,KAASd;AAAAA,IACrC,GA/b4BM,IAAQC,KAAAA,GAClCK,KAAKJ,eAgcqBG,KAhcYL,IAAQE,aAAAA,WAic3CG,KA3eqB,KA4elBO,OAAOC,UAAUR,OAASA,KAAO,IAAIA,KA5enB;AAAA,EA2CzB;AAAA,EAEA,KAAKF,IAAAA;AACJA,IAAAA,GAAQc,mBD7E0B,wkGAAA,GC8ElCX,KAAKH,UAAUA,IACfG,KAAKY,iBAAiBf,EAAAA,GACtBG,KAAKa,iBAAiBhB,KACtBG,KAAKc,gBAAgBjB,EAAAA,GACrBG,KAAKe,oBAAoBlB,EAAAA,GACzBG,KAAKgB,4BAA4BnB,EAAAA;AAAAA,EAClC;AAAA,EAEA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