@notectl/core 1.0.6 → 1.0.9
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 -56
- 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-DFkl1uYO.mjs +818 -0
- package/dist/chunks/ToolbarPlugin-DFkl1uYO.mjs.map +1 -0
- package/dist/chunks/index-BCvuDpVr.mjs +191 -0
- package/dist/chunks/index-BCvuDpVr.mjs.map +1 -0
- package/dist/chunks/index-BFsYGsBR.mjs +92 -0
- package/dist/chunks/index-BFsYGsBR.mjs.map +1 -0
- package/dist/chunks/index-BIL37LSL.mjs +73 -0
- package/dist/chunks/index-BIL37LSL.mjs.map +1 -0
- package/dist/chunks/index-BL56fbXt.mjs +402 -0
- package/dist/chunks/index-BL56fbXt.mjs.map +1 -0
- package/dist/chunks/index-BQ8iIYLn.mjs +209 -0
- package/dist/chunks/index-BQ8iIYLn.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-BTJfyJlJ.mjs +187 -0
- package/dist/chunks/index-BTJfyJlJ.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-DA8TG2S8.mjs +220 -0
- package/dist/chunks/index-DA8TG2S8.mjs.map +1 -0
- package/dist/chunks/index-DAFCISBN.mjs +100 -0
- package/dist/chunks/index-DAFCISBN.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-DGrRWMlW.mjs +541 -0
- package/dist/chunks/index-DGrRWMlW.mjs.map +1 -0
- package/dist/chunks/index-DfO_fKw6.mjs +39 -0
- package/dist/chunks/index-DfO_fKw6.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/DocumentSerializer.d.ts.map +1 -1
- package/dist/editor/NotectlEditor.d.ts +37 -5
- 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/list.d.ts +2 -0
- package/dist/editor/styles/list.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 +48 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/input/ClipboardHandler.d.ts +2 -0
- package/dist/input/ClipboardHandler.d.ts.map +1 -1
- package/dist/input/InputHandler.d.ts +2 -0
- package/dist/input/InputHandler.d.ts.map +1 -1
- package/dist/input/KeyboardHandler.d.ts +2 -0
- package/dist/input/KeyboardHandler.d.ts.map +1 -1
- package/dist/input/LegacyHTMLNormalizer.d.ts +18 -0
- package/dist/input/LegacyHTMLNormalizer.d.ts.map +1 -0
- package/dist/input/PasteHandler.d.ts +4 -0
- package/dist/input/PasteHandler.d.ts.map +1 -1
- package/dist/model/HTMLParser.d.ts +13 -0
- package/dist/model/HTMLParser.d.ts.map +1 -1
- package/dist/model/SchemaRegistry.d.ts +2 -2
- package/dist/model/SchemaRegistry.d.ts.map +1 -1
- package/dist/notectl-core.mjs +2297 -1971
- package/dist/notectl-core.mjs.map +1 -1
- package/dist/notectl-core.umd.js +2894 -1825
- package/dist/notectl-core.umd.js.map +1 -1
- package/dist/plugins/Plugin.d.ts +17 -2
- package/dist/plugins/Plugin.d.ts.map +1 -1
- package/dist/plugins/PluginManager.d.ts +22 -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/CodeBlockLocale.d.ts +17 -0
- package/dist/plugins/code-block/CodeBlockLocale.d.ts.map +1 -0
- package/dist/plugins/code-block/CodeBlockPlugin.d.ts +1 -0
- package/dist/plugins/code-block/CodeBlockPlugin.d.ts.map +1 -1
- package/dist/plugins/code-block/CodeBlockTypes.d.ts +2 -0
- package/dist/plugins/code-block/CodeBlockTypes.d.ts.map +1 -1
- 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/FontSizePlugin.d.ts +3 -0
- package/dist/plugins/font-size/FontSizePlugin.d.ts.map +1 -1
- package/dist/plugins/font-size/FontSizePopup.d.ts +2 -0
- package/dist/plugins/font-size/FontSizePopup.d.ts.map +1 -1
- package/dist/plugins/font-size.mjs +2 -201
- 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/HeadingBlockTypePicker.d.ts +14 -0
- package/dist/plugins/heading/HeadingBlockTypePicker.d.ts.map +1 -0
- package/dist/plugins/heading/HeadingCommands.d.ts +5 -0
- package/dist/plugins/heading/HeadingCommands.d.ts.map +1 -0
- package/dist/plugins/heading/HeadingInputRules.d.ts +5 -0
- package/dist/plugins/heading/HeadingInputRules.d.ts.map +1 -0
- package/dist/plugins/heading/HeadingKeyboardHandlers.d.ts +5 -0
- package/dist/plugins/heading/HeadingKeyboardHandlers.d.ts.map +1 -0
- 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 -40
- 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/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 +13 -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/PrintLocale.d.ts +16 -0
- package/dist/plugins/print/PrintLocale.d.ts.map +1 -0
- package/dist/plugins/print/PrintPlugin.d.ts +1 -0
- package/dist/plugins/print/PrintPlugin.d.ts.map +1 -1
- package/dist/plugins/print/PrintStyleCollector.d.ts +7 -0
- package/dist/plugins/print/PrintStyleCollector.d.ts.map +1 -1
- package/dist/plugins/print/PrintTypes.d.ts +5 -0
- package/dist/plugins/print/PrintTypes.d.ts.map +1 -1
- 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 +15 -0
- package/dist/plugins/toolbar/ToolbarLocale.d.ts.map +1 -0
- package/dist/plugins/toolbar/ToolbarOverflowBehavior.d.ts +23 -0
- package/dist/plugins/toolbar/ToolbarOverflowBehavior.d.ts.map +1 -0
- package/dist/plugins/toolbar/ToolbarOverflowController.d.ts +56 -0
- package/dist/plugins/toolbar/ToolbarOverflowController.d.ts.map +1 -0
- package/dist/plugins/toolbar/ToolbarPlugin.d.ts +18 -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/state/ReadonlyGuard.d.ts +6 -0
- package/dist/state/ReadonlyGuard.d.ts.map +1 -0
- package/dist/state/Transaction.d.ts +4 -0
- package/dist/state/Transaction.d.ts.map +1 -1
- package/dist/view/EditorView.d.ts +2 -0
- package/dist/view/EditorView.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-sJTiZr-S.mjs +0 -398
- package/dist/chunks/ToolbarPlugin-sJTiZr-S.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-QvKiO9_4.mjs +0 -538
- package/dist/chunks/index-QvKiO9_4.mjs.map +0 -1
- package/dist/input/SourceNormalizer.d.ts +0 -7
- package/dist/input/SourceNormalizer.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrintTypes.d.ts","sourceRoot":"","sources":["../../../src/plugins/print/PrintTypes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAIpD,MAAM,WAAW,YAAY;IAC5B,oDAAoD;IACpD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB,uDAAuD;IACvD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAE5B;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,CAAC;IAE1C;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,CAAC;IAE1C,8CAA8C;IAC9C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEzB,iDAAiD;IACjD,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IAEnD,mDAAmD;IACnD,QAAQ,CAAC,iBAAiB,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IAErD,0CAA0C;IAC1C,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IAEnC,wBAAwB;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,UAAU,GAAG,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"PrintTypes.d.ts","sourceRoot":"","sources":["../../../src/plugins/print/PrintTypes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC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;IAC5B,6DAA6D;IAC7D,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAEpC,gEAAgE;IAChE,MAAM,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC;CACvC;AAID,eAAO,MAAM,iBAAiB,EAAE,UAAU,CAAC,YAAY,CAAyC,CAAC;AAEjG,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,gBAAgB,CAEnD,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,eAAe,CAAgD,CAAC;AAInG,MAAM,WAAW,gBAAgB;IAChC,6DAA6D;IAC7D,OAAO,EAAE,YAAY,CAAC;IACtB,uCAAuC;IACvC,SAAS,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC/B,sCAAsC;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { MarkAttrRegistry } from '../../model/AttrRegistry.js';
|
|
2
|
+
import { EditorState } from '../../state/EditorState.js';
|
|
3
|
+
import { PluginContext } from '../Plugin.js';
|
|
4
|
+
/** Color mark type names that have `{ color: string }` attrs. */
|
|
5
|
+
type ColorMarkType = {
|
|
6
|
+
[K in keyof MarkAttrRegistry]: MarkAttrRegistry[K] extends {
|
|
7
|
+
color: string;
|
|
8
|
+
} ? K : never;
|
|
9
|
+
}[keyof MarkAttrRegistry];
|
|
10
|
+
/**
|
|
11
|
+
* Returns the active color value for the given mark type at the current
|
|
12
|
+
* selection, or `null` if the mark is not present.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getActiveColor(state: EditorState, markTypeName: ColorMarkType): string | null;
|
|
15
|
+
/** Returns `true` when the given color mark is active at the current selection. */
|
|
16
|
+
export declare function isColorMarkActive(state: EditorState, markTypeName: ColorMarkType): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Applies the given color to the selection. For collapsed selections,
|
|
19
|
+
* sets stored marks. For range selections, removes then re-adds the mark.
|
|
20
|
+
*/
|
|
21
|
+
export declare function applyColorMark(context: PluginContext, state: EditorState, markTypeName: ColorMarkType, color: string): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Removes the given color mark from the selection.
|
|
24
|
+
* Returns `false` when the mark was not present.
|
|
25
|
+
*/
|
|
26
|
+
export declare function removeColorMark(context: PluginContext, state: EditorState, markTypeName: ColorMarkType): boolean;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=ColorMarkOperations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorMarkOperations.d.ts","sourceRoot":"","sources":["../../../src/plugins/shared/ColorMarkOperations.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,KAAK,gBAAgB,EAAgB,MAAM,6BAA6B,CAAC;AAKlF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,iEAAiE;AACjE,KAAK,aAAa,GAAG;KACnB,CAAC,IAAI,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,CAAC,CAAC,SAAS;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,CAAC,GAAG,KAAK;CACxF,CAAC,MAAM,gBAAgB,CAAC,CAAC;AAE1B;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,GAAG,MAAM,GAAG,IAAI,CAqB7F;AAED,mFAAmF;AACnF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,GAAG,OAAO,CAE1F;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC7B,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,WAAW,EAClB,YAAY,EAAE,aAAa,EAC3B,KAAK,EAAE,MAAM,GACX,OAAO,CAkCT;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC9B,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,WAAW,EAClB,YAAY,EAAE,aAAa,GACzB,OAAO,CAgCT"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Human-readable color name lookup for accessibility.
|
|
3
|
+
*
|
|
4
|
+
* Provides descriptive names for color swatches so screen readers
|
|
5
|
+
* announce "Red" instead of "#ff0000". Covers all default palette
|
|
6
|
+
* colors with a fallback algorithm for custom hex values.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Returns a human-readable name for a hex color.
|
|
10
|
+
*
|
|
11
|
+
* Checks the static map first, then falls back to a computed
|
|
12
|
+
* description based on hue, saturation, and lightness.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getColorName(hex: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Determines whether a color is light enough to need a visible
|
|
17
|
+
* border when rendered on a white background (WCAG 1.4.11).
|
|
18
|
+
*
|
|
19
|
+
* Uses a contrast-ratio threshold of 3:1 against white.
|
|
20
|
+
*/
|
|
21
|
+
export declare function isLightColor(hex: string): boolean;
|
|
22
|
+
//# sourceMappingURL=ColorNames.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorNames.d.ts","sourceRoot":"","sources":["../../../src/plugins/shared/ColorNames.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgKH;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAIhD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAMjD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { MarkAttrRegistry } from '../../model/AttrRegistry.js';
|
|
2
|
+
import { PluginContext } from '../Plugin.js';
|
|
3
|
+
/** Color mark type names that have `{ color: string }` attrs. */
|
|
4
|
+
type ColorMarkType = {
|
|
5
|
+
[K in keyof MarkAttrRegistry]: MarkAttrRegistry[K] extends {
|
|
6
|
+
color: string;
|
|
7
|
+
} ? K : never;
|
|
8
|
+
}[keyof MarkAttrRegistry];
|
|
9
|
+
/** Configuration for `renderColorPickerPopup`. */
|
|
10
|
+
export interface ColorPickerConfig {
|
|
11
|
+
readonly markType: ColorMarkType;
|
|
12
|
+
readonly colors: readonly string[];
|
|
13
|
+
readonly columns: number;
|
|
14
|
+
readonly resetLabel: string;
|
|
15
|
+
readonly resetCommand: string;
|
|
16
|
+
readonly ariaLabelPrefix: string;
|
|
17
|
+
readonly onClose: () => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Renders an accessible color picker popup into `container`.
|
|
21
|
+
*
|
|
22
|
+
* Features:
|
|
23
|
+
* - WAI-ARIA `role="grid"` with row/gridcell structure
|
|
24
|
+
* - Arrow key navigation (wraps around, clamps on partial last row)
|
|
25
|
+
* - Enter/Space selects color and closes popup
|
|
26
|
+
* - Escape closes popup
|
|
27
|
+
* - Roving tabindex on swatches
|
|
28
|
+
*/
|
|
29
|
+
export declare function renderColorPickerPopup(container: HTMLElement, context: PluginContext, config: ColorPickerConfig): void;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=ColorPickerPopup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorPickerPopup.d.ts","sourceRoot":"","sources":["../../../src/plugins/shared/ColorPickerPopup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAKlD,iEAAiE;AACjE,KAAK,aAAa,GAAG;KACnB,CAAC,IAAI,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,CAAC,CAAC,SAAS;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,CAAC,GAAG,KAAK;CACxF,CAAC,MAAM,gBAAgB,CAAC,CAAC;AAE1B,kDAAkD;AAClD,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC7B;AAOD;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACrC,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,iBAAiB,GACvB,IAAI,CAuJN"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared color validation and normalization utilities
|
|
3
|
+
* for color-based mark plugins (TextColor, Highlight).
|
|
4
|
+
*/
|
|
5
|
+
/** Returns `true` when the value is a valid `#RGB` or `#RRGGBB` hex color. */
|
|
6
|
+
export declare function isValidHexColor(value: string): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Validates, deduplicates, and normalizes a user-supplied color list.
|
|
9
|
+
* Returns `fallbackPalette` when no custom colors are provided.
|
|
10
|
+
*
|
|
11
|
+
* @throws {Error} if any value is not a valid hex color code.
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveColors(colors: readonly string[] | undefined, fallbackPalette: readonly string[], pluginName: string): readonly string[];
|
|
14
|
+
//# sourceMappingURL=ColorValidation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorValidation.d.ts","sourceRoot":"","sources":["../../../src/plugins/shared/ColorValidation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC5B,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EACrC,eAAe,EAAE,SAAS,MAAM,EAAE,EAClC,UAAU,EAAE,MAAM,GAChB,SAAS,MAAM,EAAE,CAoBnB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locale interface and default English locale for the StrikethroughPlugin.
|
|
3
|
+
*/
|
|
4
|
+
export interface StrikethroughLocale {
|
|
5
|
+
readonly label: string;
|
|
6
|
+
readonly tooltip: (shortcut: string) => string;
|
|
7
|
+
}
|
|
8
|
+
export declare const STRIKETHROUGH_LOCALE_EN: StrikethroughLocale;
|
|
9
|
+
export declare const STRIKETHROUGH_LOCALE_DE: StrikethroughLocale;
|
|
10
|
+
export declare const STRIKETHROUGH_LOCALE_ES: StrikethroughLocale;
|
|
11
|
+
export declare const STRIKETHROUGH_LOCALE_FR: StrikethroughLocale;
|
|
12
|
+
export declare const STRIKETHROUGH_LOCALE_ZH: StrikethroughLocale;
|
|
13
|
+
export declare const STRIKETHROUGH_LOCALE_RU: StrikethroughLocale;
|
|
14
|
+
export declare const STRIKETHROUGH_LOCALE_AR: StrikethroughLocale;
|
|
15
|
+
export declare const STRIKETHROUGH_LOCALE_HI: StrikethroughLocale;
|
|
16
|
+
export declare const STRIKETHROUGH_LOCALES: Record<string, StrikethroughLocale>;
|
|
17
|
+
//# sourceMappingURL=StrikethroughLocale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StrikethroughLocale.d.ts","sourceRoot":"","sources":["../../../src/plugins/strikethrough/StrikethroughLocale.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/C;AAID,eAAO,MAAM,uBAAuB,EAAE,mBAGrC,CAAC;AAIF,eAAO,MAAM,uBAAuB,EAAE,mBAGrC,CAAC;AAIF,eAAO,MAAM,uBAAuB,EAAE,mBAGrC,CAAC;AAIF,eAAO,MAAM,uBAAuB,EAAE,mBAGrC,CAAC;AAIF,eAAO,MAAM,uBAAuB,EAAE,mBAGrC,CAAC;AAIF,eAAO,MAAM,uBAAuB,EAAE,mBAGrC,CAAC;AAIF,eAAO,MAAM,uBAAuB,EAAE,mBAGrC,CAAC;AAIF,eAAO,MAAM,uBAAuB,EAAE,mBAGrC,CAAC;AAIF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CASrE,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Plugin, PluginContext } from '../Plugin.js';
|
|
2
|
+
import { StrikethroughLocale } from './StrikethroughLocale.js';
|
|
2
3
|
declare module '../../model/AttrRegistry.js' {
|
|
3
4
|
interface MarkAttrRegistry {
|
|
4
5
|
strikethrough: Record<string, never>;
|
|
@@ -7,12 +8,14 @@ declare module '../../model/AttrRegistry.js' {
|
|
|
7
8
|
export interface StrikethroughConfig {
|
|
8
9
|
/** When true, a separator is rendered after the strikethrough toolbar item. */
|
|
9
10
|
readonly separatorAfter?: boolean;
|
|
11
|
+
readonly locale?: StrikethroughLocale;
|
|
10
12
|
}
|
|
11
13
|
export declare class StrikethroughPlugin implements Plugin {
|
|
12
14
|
readonly id = "strikethrough";
|
|
13
15
|
readonly name = "Strikethrough";
|
|
14
16
|
readonly priority = 22;
|
|
15
17
|
private readonly config;
|
|
18
|
+
private locale;
|
|
16
19
|
constructor(config?: Partial<StrikethroughConfig>);
|
|
17
20
|
init(context: PluginContext): void;
|
|
18
21
|
private registerMarkSpec;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StrikethroughPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/strikethrough/StrikethroughPlugin.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"StrikethroughPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/strikethrough/StrikethroughPlugin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAyB,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAI3F,OAAO,QAAQ,6BAA6B,CAAC;IAC5C,UAAU,gBAAgB;QACzB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;KACrC;CACD;AAID,MAAM,WAAW,mBAAmB;IACnC,+EAA+E;IAC/E,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,CAAC;CACtC;AAMD,qBAAa,mBAAoB,YAAW,MAAM;IACjD,QAAQ,CAAC,EAAE,mBAAmB;IAC9B,QAAQ,CAAC,IAAI,mBAAmB;IAChC,QAAQ,CAAC,QAAQ,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;IAC7C,OAAO,CAAC,MAAM,CAAuB;gBAEzB,MAAM,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC;IAIjD,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAQlC,OAAO,CAAC,gBAAgB;IAuBxB,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,mBAAmB;CAgB3B"}
|
|
@@ -1,35 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { m as e } from "../chunks/TypeBrands-C09nE2qO.mjs";
|
|
3
|
-
import { f as o } from "../chunks/ToolbarItem-ugDymuXi.mjs";
|
|
4
|
-
const s = {};
|
|
5
|
-
class i {
|
|
6
|
-
id = "strikethrough";
|
|
7
|
-
name = "Strikethrough";
|
|
8
|
-
priority = 22;
|
|
9
|
-
config;
|
|
10
|
-
constructor(t2) {
|
|
11
|
-
this.config = { ...s, ...t2 };
|
|
12
|
-
}
|
|
13
|
-
init(t2) {
|
|
14
|
-
this.registerMarkSpec(t2), this.registerCommand(t2), this.registerKeymap(t2), this.registerToolbarItem(t2);
|
|
15
|
-
}
|
|
16
|
-
registerMarkSpec(t2) {
|
|
17
|
-
t2.registerMarkSpec({ type: "strikethrough", rank: 3, toDOM: () => document.createElement("s"), toHTMLString: (t3, r2) => `<s>${r2}</s>`, parseHTML: [{ tag: "s" }, { tag: "strike" }, { tag: "del" }], sanitize: { tags: ["s"] } });
|
|
18
|
-
}
|
|
19
|
-
registerCommand(r2) {
|
|
20
|
-
r2.registerCommand("toggleStrikethrough", () => {
|
|
21
|
-
const o2 = t(r2.getState(), e("strikethrough"));
|
|
22
|
-
return !!o2 && (r2.dispatch(o2), true);
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
registerKeymap(t2) {
|
|
26
|
-
t2.registerKeymap({ "Mod-Shift-X": () => t2.executeCommand("toggleStrikethrough") });
|
|
27
|
-
}
|
|
28
|
-
registerToolbarItem(t2) {
|
|
29
|
-
t2.registerToolbarItem({ id: "strikethrough", group: "format", icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"/></svg>', label: "Strikethrough", tooltip: `Strikethrough (${o("Mod-Shift-X")})`, command: "toggleStrikethrough", priority: 40, separatorAfter: this.config.separatorAfter, isActive: (t3) => r(t3, e("strikethrough")) });
|
|
30
|
-
}
|
|
31
|
-
}
|
|
1
|
+
import { b } from "../chunks/index-DfO_fKw6.mjs";
|
|
32
2
|
export {
|
|
33
|
-
|
|
3
|
+
b as StrikethroughPlugin
|
|
34
4
|
};
|
|
35
5
|
//# sourceMappingURL=strikethrough.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strikethrough.mjs","sources":[
|
|
1
|
+
{"version":3,"file":"strikethrough.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locale interface and default English locale for the SuperSubPlugin.
|
|
3
|
+
*/
|
|
4
|
+
export interface SuperSubLocale {
|
|
5
|
+
readonly superscriptLabel: string;
|
|
6
|
+
readonly superscriptTooltip: (shortcut: string) => string;
|
|
7
|
+
readonly subscriptLabel: string;
|
|
8
|
+
readonly subscriptTooltip: (shortcut: string) => string;
|
|
9
|
+
}
|
|
10
|
+
export declare const SUPER_SUB_LOCALE_EN: SuperSubLocale;
|
|
11
|
+
export declare const SUPER_SUB_LOCALE_DE: SuperSubLocale;
|
|
12
|
+
export declare const SUPER_SUB_LOCALE_ES: SuperSubLocale;
|
|
13
|
+
export declare const SUPER_SUB_LOCALE_FR: SuperSubLocale;
|
|
14
|
+
export declare const SUPER_SUB_LOCALE_ZH: SuperSubLocale;
|
|
15
|
+
export declare const SUPER_SUB_LOCALE_RU: SuperSubLocale;
|
|
16
|
+
export declare const SUPER_SUB_LOCALE_AR: SuperSubLocale;
|
|
17
|
+
export declare const SUPER_SUB_LOCALE_HI: SuperSubLocale;
|
|
18
|
+
export declare const SUPER_SUB_LOCALES: Record<string, SuperSubLocale>;
|
|
19
|
+
//# sourceMappingURL=SuperSubLocale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuperSubLocale.d.ts","sourceRoot":"","sources":["../../../src/plugins/super-sub/SuperSubLocale.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;IAC1D,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;CACxD;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"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Plugin, PluginContext } from '../Plugin.js';
|
|
2
|
+
import { SuperSubLocale } from './SuperSubLocale.js';
|
|
2
3
|
declare module '../../model/AttrRegistry.js' {
|
|
3
4
|
interface MarkAttrRegistry {
|
|
4
5
|
superscript: Record<string, never>;
|
|
@@ -17,12 +18,14 @@ export interface SuperSubConfig {
|
|
|
17
18
|
readonly toolbar?: SuperSubToolbarConfig;
|
|
18
19
|
/** When true, a separator is rendered after the last toolbar item. */
|
|
19
20
|
readonly separatorAfter?: boolean;
|
|
21
|
+
readonly locale?: SuperSubLocale;
|
|
20
22
|
}
|
|
21
23
|
export declare class SuperSubPlugin implements Plugin {
|
|
22
24
|
readonly id = "super-sub";
|
|
23
25
|
readonly name = "Superscript & Subscript";
|
|
24
26
|
readonly priority = 23;
|
|
25
27
|
private readonly config;
|
|
28
|
+
private locale;
|
|
26
29
|
constructor(config?: Partial<SuperSubConfig>);
|
|
27
30
|
init(context: PluginContext): void;
|
|
28
31
|
private registerMark;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuperSubPlugin.d.ts","sourceRoot":"","sources":["../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O,EAAE,aAAa,GAAG,IAAI;IAsBlC,OAAO,CAAC,YAAY;IA6CpB,OAAO,CAAC,eAAe;IAWvB;;;;;OAKG;IACH,OAAO,CAAC,6BAA6B;IAoErC;;;OAGG;IACH,OAAO,CAAC,4BAA4B;IAuBpC,OAAO,CAAC,gBAAgB;CAMxB"}
|
|
@@ -1,81 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { m as e } from "../chunks/TypeBrands-C09nE2qO.mjs";
|
|
3
|
-
import { f as i } from "../chunks/ToolbarItem-ugDymuXi.mjs";
|
|
4
|
-
const r = { superscript: true, subscript: true }, o = [{ type: "superscript", opposite: "subscript", configKey: "superscript", rank: 4, tag: "sup", label: "Superscript", icon: ['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">', '<path d="M16 7.41L11.41 12 16 16.59 14.59 18l-6-6 6-6z"', ' fill="none"/>', '<path d="M9.64 7.64c.23-.5.36-1.05.36-1.64', " 0-2.21-1.79-4-4-4H2v14h4.36c2.34 0 4.24-1.9", " 4.24-4.24 0-1.6-.89-2.99-2.2-3.71zM4.5 4.5H6c.83", " 0 1.5.67 1.5 1.5S6.83 7.5 6 7.5H4.5v-3zm2 9H4.5v-3H6.5c.83", ' 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z" fill="none"/>', '<path d="M15.97 3.84c0-.47.19-.91.53-1.21.34-.31.8-.49', " 1.3-.49.5 0 .95.18 1.28.48.32.3.5.7.51 1.15h1.59c-.02", "-.96-.43-1.83-1.13-2.42C19.36.77 18.45.44 17.5.44c-.88", " 0-1.74.28-2.39.8-.67.53-1.06 1.28-1.06 2.1 0 .76.34", " 1.47.93 1.97.59.49 1.41.84 2.32 1.15.7.24 1.26.5 1.62.8.35.3.53.64.53", " 1.02 0 .48-.2.93-.55 1.24-.36.3-.84.48-1.37.48-.55 0-1.04-.2-1.39-.54", "-.34-.33-.53-.8-.53-1.32h-1.58c.01 1.02.43 1.95 1.16 2.57.72.62 1.67.96", " 2.67.96.92 0 1.81-.3 2.46-.84.67-.56 1.04-1.33 1.04-2.18 0-.81-.36-1.56", "-.99-2.08-.62-.51-1.48-.88-2.43-1.2-.67-.23-1.2-.47-1.52-.75-.32-.27-.46", '-.59-.46-.94z"/>', '<path d="M5.88 20h2.66l3.4-5.42L15.3 20h2.67l-4.73-7.38', ' 4.37-6.62h-2.6l-3.07 4.98L8.92 6h-2.6l4.26 6.58z"/>', "</svg>"].join(""), keyBinding: "Mod-.", toolbarPriority: 50, toHTMLString: (t2) => `<sup>${t2}</sup>`, parseHTML: [{ tag: "sup" }], sanitize: { tags: ["sup"] } }, { type: "subscript", opposite: "superscript", configKey: "subscript", rank: 4, tag: "sub", label: "Subscript", icon: ['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">', '<path d="M15.97 16.84c0-.47.19-.91.53-1.21.34-.31.8-.49', " 1.3-.49.5 0 .95.18 1.28.48.32.3.5.7.51 1.15h1.59c-.02", "-.96-.43-1.83-1.13-2.42-.7-.58-1.61-.91-2.56-.91-.88", " 0-1.74.28-2.39.8-.67.53-1.06 1.28-1.06 2.1 0 .76.34", " 1.47.93 1.97.59.49 1.41.84 2.32 1.15.7.24 1.26.5 1.62.8.35.3.53.64.53", " 1.02 0 .48-.2.93-.55 1.24-.36.3-.84.48-1.37.48-.55 0-1.04-.2-1.39-.54", "-.34-.33-.53-.8-.53-1.32h-1.58c.01 1.02.43 1.95 1.16 2.57.72.62 1.67.96", " 2.67.96.92 0 1.81-.3 2.46-.84.67-.56 1.04-1.33 1.04-2.18 0-.81-.36-1.56", "-.99-2.08-.62-.51-1.48-.88-2.43-1.2-.67-.23-1.2-.47-1.52-.75-.32-.27-.46", '-.59-.46-.94z"/>', '<path d="M5.88 18h2.66l3.4-5.42L15.3 18h2.67l-4.73-7.38', ' 4.37-6.62h-2.6l-3.07 4.98L8.92 4h-2.6l4.26 6.58z"/>', "</svg>"].join(""), keyBinding: "Mod-,", toolbarPriority: 51, toHTMLString: (t2) => `<sub>${t2}</sub>`, parseHTML: [{ tag: "sub" }], sanitize: { tags: ["sub"] } }];
|
|
5
|
-
class p {
|
|
6
|
-
id = "super-sub";
|
|
7
|
-
name = "Superscript & Subscript";
|
|
8
|
-
priority = 23;
|
|
9
|
-
config;
|
|
10
|
-
constructor(t2) {
|
|
11
|
-
this.config = { ...r, ...t2 };
|
|
12
|
-
}
|
|
13
|
-
init(t2) {
|
|
14
|
-
const s2 = o.filter((t3) => this.config[t3.configKey]), e2 = s2.filter((t3) => this.isToolbarVisible(t3.configKey)).at(-1);
|
|
15
|
-
for (const i2 of s2) {
|
|
16
|
-
const s3 = !!this.config.separatorAfter && i2 === e2;
|
|
17
|
-
this.registerMark(t2, i2, s3);
|
|
18
|
-
}
|
|
19
|
-
this.registerKeymaps(t2, s2), this.registerExclusivityMiddleware(t2, s2), this.registerDisabledToolbarItems(t2);
|
|
20
|
-
}
|
|
21
|
-
registerMark(r2, o2, p2) {
|
|
22
|
-
const a = n(o2.type), c = this.isToolbarVisible(o2.configKey);
|
|
23
|
-
r2.registerMarkSpec({ type: o2.type, rank: o2.rank, toDOM: () => document.createElement(o2.tag), toHTMLString: (t2, s2) => o2.toHTMLString(s2), parseHTML: o2.parseHTML, sanitize: o2.sanitize }), r2.registerCommand(a, () => {
|
|
24
|
-
const s2 = t(r2.getState(), e(o2.type));
|
|
25
|
-
return !!s2 && (r2.dispatch(s2), true);
|
|
26
|
-
}), c && r2.registerToolbarItem({ id: o2.type, group: "format", icon: o2.icon, label: o2.label, tooltip: `${o2.label} (${i(o2.keyBinding)})`, command: a, priority: o2.toolbarPriority, separatorAfter: p2, isActive: (t2) => s(t2, e(o2.type)) });
|
|
27
|
-
}
|
|
28
|
-
registerKeymaps(t2, s2) {
|
|
29
|
-
const e2 = {};
|
|
30
|
-
for (const i2 of s2) {
|
|
31
|
-
const s3 = n(i2.type);
|
|
32
|
-
e2[i2.keyBinding] = () => t2.executeCommand(s3);
|
|
33
|
-
}
|
|
34
|
-
Object.keys(e2).length > 0 && t2.registerKeymap(e2);
|
|
35
|
-
}
|
|
36
|
-
registerExclusivityMiddleware(t2, s2) {
|
|
37
|
-
s2.some((t3) => "superscript" === t3.type) && s2.some((t3) => "subscript" === t3.type) && t2.registerMiddleware((t3, s3, i2) => {
|
|
38
|
-
let r2 = false;
|
|
39
|
-
const p2 = [];
|
|
40
|
-
for (const s4 of t3.steps) {
|
|
41
|
-
if ("addMark" !== s4.type) {
|
|
42
|
-
p2.push(s4);
|
|
43
|
-
continue;
|
|
44
|
-
}
|
|
45
|
-
const t4 = s4.mark.type, i3 = o.find((s5) => s5.type === t4);
|
|
46
|
-
if (!i3) {
|
|
47
|
-
p2.push(s4);
|
|
48
|
-
continue;
|
|
49
|
-
}
|
|
50
|
-
r2 = true;
|
|
51
|
-
const n3 = { type: "removeMark", blockId: s4.blockId, from: s4.from, to: s4.to, mark: { type: e(i3.opposite) }, ...s4.path ? { path: s4.path } : {} };
|
|
52
|
-
p2.push(n3, s4);
|
|
53
|
-
}
|
|
54
|
-
let n2 = t3.storedMarksAfter;
|
|
55
|
-
if (n2) {
|
|
56
|
-
const t4 = n2.some((t5) => "superscript" === t5.type), s4 = n2.some((t5) => "subscript" === t5.type);
|
|
57
|
-
if (t4 && s4) {
|
|
58
|
-
const t5 = n2.findLastIndex((t6) => "superscript" === t6.type) > n2.findLastIndex((t6) => "subscript" === t6.type) ? "subscript" : "superscript";
|
|
59
|
-
n2 = n2.filter((s5) => s5.type !== t5), r2 = true;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
i2(r2 ? { ...t3, steps: p2, storedMarksAfter: n2 } : t3);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
registerDisabledToolbarItems(t2) {
|
|
66
|
-
if (this.config.toolbar) for (const s2 of o) {
|
|
67
|
-
const e2 = this.config[s2.configKey], i2 = this.config.toolbar[s2.configKey] ?? true;
|
|
68
|
-
!e2 && i2 && t2.registerToolbarItem({ id: s2.type, group: "format", icon: s2.icon, label: s2.label, command: n(s2.type), priority: s2.toolbarPriority, isEnabled: () => false });
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
isToolbarVisible(t2) {
|
|
72
|
-
return !this.config.toolbar || (this.config.toolbar[t2] ?? true);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
function n(t2) {
|
|
76
|
-
return `toggle${t2.charAt(0).toUpperCase()}${t2.slice(1)}`;
|
|
77
|
-
}
|
|
1
|
+
import { b } from "../chunks/index-BFsYGsBR.mjs";
|
|
78
2
|
export {
|
|
79
|
-
|
|
3
|
+
b as SuperSubPlugin
|
|
80
4
|
};
|
|
81
5
|
//# sourceMappingURL=super-sub.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"super-sub.mjs","sources":["../../src/plugins/super-sub/SuperSubPlugin.ts"],"sourcesContent":["/**\n * SuperSubPlugin: registers superscript and subscript inline marks with\n * MarkSpecs, toggle commands, keyboard shortcuts, toolbar buttons, and\n * a middleware that enforces mutual exclusivity between the two marks.\n *\n * Data-driven — each mark type is defined declaratively and all\n * registrations are derived from the same definition table.\n */\n\nimport { isMarkActive, toggleMark } from '../../commands/Commands.js';\nimport type { Mark } from '../../model/Document.js';\nimport type { ParseRule } from '../../model/ParseRule.js';\nimport type { SanitizeConfig } from '../../model/SanitizeConfig.js';\nimport { markType as mkType } from '../../model/TypeBrands.js';\nimport type { RemoveMarkStep, Step } from '../../state/Transaction.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { formatShortcut } from '../toolbar/ToolbarItem.js';\n\n// --- Attribute Registry Augmentation ---\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface MarkAttrRegistry {\n\t\tsuperscript: Record<string, never>;\n\t\tsubscript: Record<string, never>;\n\t}\n}\n\n// --- Configuration ---\n\n/** Controls toolbar button visibility per mark. */\nexport interface SuperSubToolbarConfig {\n\treadonly superscript?: boolean;\n\treadonly subscript?: boolean;\n}\n\n/** Controls which marks are enabled and which toolbar buttons are shown. */\nexport interface SuperSubConfig {\n\treadonly superscript: boolean;\n\treadonly subscript: boolean;\n\treadonly toolbar?: SuperSubToolbarConfig;\n\t/** When true, a separator is rendered after the last toolbar item. */\n\treadonly separatorAfter?: boolean;\n}\n\nconst DEFAULT_CONFIG: SuperSubConfig = {\n\tsuperscript: true,\n\tsubscript: true,\n};\n\n// --- Mark Definitions ---\n\ninterface MarkDefinition {\n\treadonly type: 'superscript' | 'subscript';\n\treadonly opposite: 'superscript' | 'subscript';\n\treadonly configKey: keyof Omit<SuperSubConfig, 'toolbar' | 'separatorAfter'>;\n\treadonly rank: number;\n\treadonly tag: string;\n\treadonly label: string;\n\treadonly icon: string;\n\treadonly keyBinding: string;\n\treadonly toolbarPriority: number;\n\treadonly toHTMLString: (content: string) => string;\n\treadonly parseHTML: readonly ParseRule[];\n\treadonly sanitize: SanitizeConfig;\n}\n\nconst SUPERSCRIPT_ICON: string = [\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">',\n\t'<path d=\"M16 7.41L11.41 12 16 16.59 14.59 18l-6-6 6-6z\"',\n\t' fill=\"none\"/>',\n\t'<path d=\"M9.64 7.64c.23-.5.36-1.05.36-1.64',\n\t' 0-2.21-1.79-4-4-4H2v14h4.36c2.34 0 4.24-1.9',\n\t' 4.24-4.24 0-1.6-.89-2.99-2.2-3.71zM4.5 4.5H6c.83',\n\t' 0 1.5.67 1.5 1.5S6.83 7.5 6 7.5H4.5v-3zm2 9H4.5v-3H6.5c.83',\n\t' 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z\" fill=\"none\"/>',\n\t'<path d=\"M15.97 3.84c0-.47.19-.91.53-1.21.34-.31.8-.49',\n\t' 1.3-.49.5 0 .95.18 1.28.48.32.3.5.7.51 1.15h1.59c-.02',\n\t'-.96-.43-1.83-1.13-2.42C19.36.77 18.45.44 17.5.44c-.88',\n\t' 0-1.74.28-2.39.8-.67.53-1.06 1.28-1.06 2.1 0 .76.34',\n\t' 1.47.93 1.97.59.49 1.41.84 2.32 1.15.7.24 1.26.5 1.62.8.35.3.53.64.53',\n\t' 1.02 0 .48-.2.93-.55 1.24-.36.3-.84.48-1.37.48-.55 0-1.04-.2-1.39-.54',\n\t'-.34-.33-.53-.8-.53-1.32h-1.58c.01 1.02.43 1.95 1.16 2.57.72.62 1.67.96',\n\t' 2.67.96.92 0 1.81-.3 2.46-.84.67-.56 1.04-1.33 1.04-2.18 0-.81-.36-1.56',\n\t'-.99-2.08-.62-.51-1.48-.88-2.43-1.2-.67-.23-1.2-.47-1.52-.75-.32-.27-.46',\n\t'-.59-.46-.94z\"/>',\n\t'<path d=\"M5.88 20h2.66l3.4-5.42L15.3 20h2.67l-4.73-7.38',\n\t' 4.37-6.62h-2.6l-3.07 4.98L8.92 6h-2.6l4.26 6.58z\"/>',\n\t'</svg>',\n].join('');\n\nconst SUBSCRIPT_ICON: string = [\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">',\n\t'<path d=\"M15.97 16.84c0-.47.19-.91.53-1.21.34-.31.8-.49',\n\t' 1.3-.49.5 0 .95.18 1.28.48.32.3.5.7.51 1.15h1.59c-.02',\n\t'-.96-.43-1.83-1.13-2.42-.7-.58-1.61-.91-2.56-.91-.88',\n\t' 0-1.74.28-2.39.8-.67.53-1.06 1.28-1.06 2.1 0 .76.34',\n\t' 1.47.93 1.97.59.49 1.41.84 2.32 1.15.7.24 1.26.5 1.62.8.35.3.53.64.53',\n\t' 1.02 0 .48-.2.93-.55 1.24-.36.3-.84.48-1.37.48-.55 0-1.04-.2-1.39-.54',\n\t'-.34-.33-.53-.8-.53-1.32h-1.58c.01 1.02.43 1.95 1.16 2.57.72.62 1.67.96',\n\t' 2.67.96.92 0 1.81-.3 2.46-.84.67-.56 1.04-1.33 1.04-2.18 0-.81-.36-1.56',\n\t'-.99-2.08-.62-.51-1.48-.88-2.43-1.2-.67-.23-1.2-.47-1.52-.75-.32-.27-.46',\n\t'-.59-.46-.94z\"/>',\n\t'<path d=\"M5.88 18h2.66l3.4-5.42L15.3 18h2.67l-4.73-7.38',\n\t' 4.37-6.62h-2.6l-3.07 4.98L8.92 4h-2.6l4.26 6.58z\"/>',\n\t'</svg>',\n].join('');\n\nconst MARK_DEFINITIONS: readonly MarkDefinition[] = [\n\t{\n\t\ttype: 'superscript',\n\t\topposite: 'subscript',\n\t\tconfigKey: 'superscript',\n\t\trank: 4,\n\t\ttag: 'sup',\n\t\tlabel: 'Superscript',\n\t\ticon: SUPERSCRIPT_ICON,\n\t\tkeyBinding: 'Mod-.',\n\t\ttoolbarPriority: 50,\n\t\ttoHTMLString: (content) => `<sup>${content}</sup>`,\n\t\tparseHTML: [{ tag: 'sup' }],\n\t\tsanitize: { tags: ['sup'] },\n\t},\n\t{\n\t\ttype: 'subscript',\n\t\topposite: 'superscript',\n\t\tconfigKey: 'subscript',\n\t\trank: 4,\n\t\ttag: 'sub',\n\t\tlabel: 'Subscript',\n\t\ticon: SUBSCRIPT_ICON,\n\t\tkeyBinding: 'Mod-,',\n\t\ttoolbarPriority: 51,\n\t\ttoHTMLString: (content) => `<sub>${content}</sub>`,\n\t\tparseHTML: [{ tag: 'sub' }],\n\t\tsanitize: { tags: ['sub'] },\n\t},\n];\n\n// --- Plugin ---\n\nexport class SuperSubPlugin implements Plugin {\n\treadonly id = 'super-sub';\n\treadonly name = 'Superscript & Subscript';\n\treadonly priority = 23;\n\n\tprivate readonly config: SuperSubConfig;\n\n\tconstructor(config?: Partial<SuperSubConfig>) {\n\t\tthis.config = { ...DEFAULT_CONFIG, ...config };\n\t}\n\n\tinit(context: PluginContext): void {\n\t\tconst enabledMarks: MarkDefinition[] = MARK_DEFINITIONS.filter(\n\t\t\t(def) => this.config[def.configKey],\n\t\t);\n\n\t\tconst visibleToolbarMarks: MarkDefinition[] = enabledMarks.filter((def) =>\n\t\t\tthis.isToolbarVisible(def.configKey),\n\t\t);\n\t\tconst lastVisibleMark: MarkDefinition | undefined = visibleToolbarMarks.at(-1);\n\n\t\tfor (const def of enabledMarks) {\n\t\t\tconst isSeparatorTarget: boolean = !!this.config.separatorAfter && def === lastVisibleMark;\n\t\t\tthis.registerMark(context, def, isSeparatorTarget);\n\t\t}\n\n\t\tthis.registerKeymaps(context, enabledMarks);\n\t\tthis.registerExclusivityMiddleware(context, enabledMarks);\n\t\tthis.registerDisabledToolbarItems(context);\n\t}\n\n\tprivate registerMark(context: PluginContext, def: MarkDefinition, separatorAfter: boolean): void {\n\t\tconst commandName: string = toCommandName(def.type);\n\t\tconst toolbarVisible: boolean = this.isToolbarVisible(def.configKey);\n\n\t\tcontext.registerMarkSpec({\n\t\t\ttype: def.type,\n\t\t\trank: def.rank,\n\t\t\ttoDOM() {\n\t\t\t\treturn document.createElement(def.tag);\n\t\t\t},\n\t\t\ttoHTMLString: (_mark, content) => def.toHTMLString(content),\n\t\t\tparseHTML: def.parseHTML,\n\t\t\tsanitize: def.sanitize,\n\t\t});\n\n\t\tcontext.registerCommand(commandName, () => {\n\t\t\tconst tr = toggleMark(context.getState(), mkType(def.type));\n\t\t\tif (tr) {\n\t\t\t\tcontext.dispatch(tr);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\n\t\tif (toolbarVisible) {\n\t\t\tcontext.registerToolbarItem({\n\t\t\t\tid: def.type,\n\t\t\t\tgroup: 'format',\n\t\t\t\ticon: def.icon,\n\t\t\t\tlabel: def.label,\n\t\t\t\ttooltip: `${def.label} (${formatShortcut(def.keyBinding)})`,\n\t\t\t\tcommand: commandName,\n\t\t\t\tpriority: def.toolbarPriority,\n\t\t\t\tseparatorAfter,\n\t\t\t\tisActive: (state) => isMarkActive(state, mkType(def.type)),\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate registerKeymaps(context: PluginContext, marks: readonly MarkDefinition[]): void {\n\t\tconst keymap: Record<string, () => boolean> = {};\n\t\tfor (const def of marks) {\n\t\t\tconst commandName: string = toCommandName(def.type);\n\t\t\tkeymap[def.keyBinding] = () => context.executeCommand(commandName);\n\t\t}\n\t\tif (Object.keys(keymap).length > 0) {\n\t\t\tcontext.registerKeymap(keymap);\n\t\t}\n\t}\n\n\t/**\n\t * Ensures superscript and subscript are mutually exclusive.\n\t * When an addMark step for one type is found, a removeMark step\n\t * for the opposite type is injected. For stored marks, the opposite\n\t * mark is filtered out.\n\t */\n\tprivate registerExclusivityMiddleware(\n\t\tcontext: PluginContext,\n\t\tenabledMarks: readonly MarkDefinition[],\n\t): void {\n\t\tconst bothEnabled: boolean =\n\t\t\tenabledMarks.some((d) => d.type === 'superscript') &&\n\t\t\tenabledMarks.some((d) => d.type === 'subscript');\n\n\t\tif (!bothEnabled) return;\n\n\t\tcontext.registerMiddleware((tr, _state, next) => {\n\t\t\tlet patched = false;\n\n\t\t\t// Handle addMark steps: inject removeMark for the opposite type\n\t\t\tconst patchedSteps: Step[] = [];\n\t\t\tfor (const step of tr.steps) {\n\t\t\t\tif (step.type !== 'addMark') {\n\t\t\t\t\tpatchedSteps.push(step);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst markName: string = step.mark.type;\n\t\t\t\tconst def: MarkDefinition | undefined = MARK_DEFINITIONS.find((d) => d.type === markName);\n\t\t\t\tif (!def) {\n\t\t\t\t\tpatchedSteps.push(step);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tpatched = true;\n\t\t\t\tconst removeStep: RemoveMarkStep = {\n\t\t\t\t\ttype: 'removeMark',\n\t\t\t\t\tblockId: step.blockId,\n\t\t\t\t\tfrom: step.from,\n\t\t\t\t\tto: step.to,\n\t\t\t\t\tmark: { type: mkType(def.opposite) },\n\t\t\t\t\t...(step.path ? { path: step.path } : {}),\n\t\t\t\t};\n\t\t\t\tpatchedSteps.push(removeStep, step);\n\t\t\t}\n\n\t\t\t// Handle stored marks: remove the opposite mark\n\t\t\tlet storedMarksAfter: readonly Mark[] | null = tr.storedMarksAfter;\n\t\t\tif (storedMarksAfter) {\n\t\t\t\tconst hasSup: boolean = storedMarksAfter.some((m) => m.type === 'superscript');\n\t\t\t\tconst hasSub: boolean = storedMarksAfter.some((m) => m.type === 'subscript');\n\n\t\t\t\tif (hasSup && hasSub) {\n\t\t\t\t\t// Keep the one that was most recently added (last in array)\n\t\t\t\t\tconst lastSupIdx: number = storedMarksAfter.findLastIndex(\n\t\t\t\t\t\t(m) => m.type === 'superscript',\n\t\t\t\t\t);\n\t\t\t\t\tconst lastSubIdx: number = storedMarksAfter.findLastIndex((m) => m.type === 'subscript');\n\t\t\t\t\tconst removeType: string = lastSupIdx > lastSubIdx ? 'subscript' : 'superscript';\n\n\t\t\t\t\tstoredMarksAfter = storedMarksAfter.filter((m) => m.type !== removeType);\n\t\t\t\t\tpatched = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnext(patched ? { ...tr, steps: patchedSteps, storedMarksAfter } : tr);\n\t\t});\n\t}\n\n\t/**\n\t * Registers disabled toolbar buttons for marks whose feature is disabled\n\t * but whose toolbar button is explicitly requested.\n\t */\n\tprivate registerDisabledToolbarItems(context: PluginContext): void {\n\t\tif (!this.config.toolbar) return;\n\n\t\tfor (const def of MARK_DEFINITIONS) {\n\t\t\tconst featureEnabled: boolean = this.config[def.configKey];\n\t\t\tconst toolbarVisible: boolean = this.config.toolbar[def.configKey] ?? true;\n\n\t\t\tif (!featureEnabled && toolbarVisible) {\n\t\t\t\tcontext.registerToolbarItem({\n\t\t\t\t\tid: def.type,\n\t\t\t\t\tgroup: 'format',\n\t\t\t\t\ticon: def.icon,\n\t\t\t\t\tlabel: def.label,\n\t\t\t\t\tcommand: toCommandName(def.type),\n\t\t\t\t\tpriority: def.toolbarPriority,\n\t\t\t\t\tisEnabled: () => false,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate isToolbarVisible(\n\t\tconfigKey: keyof Omit<SuperSubConfig, 'toolbar' | 'separatorAfter'>,\n\t): boolean {\n\t\tif (!this.config.toolbar) return true;\n\t\treturn this.config.toolbar[configKey] ?? true;\n\t}\n}\n\n/** Converts a mark type to its toggle command name (e.g. 'superscript' → 'toggleSuperscript'). */\nfunction toCommandName(markType: string): string {\n\treturn `toggle${markType.charAt(0).toUpperCase()}${markType.slice(1)}`;\n}\n"],"names":["DEFAULT_CONFIG","superscript","subscript","MARK_DEFINITIONS","type","opposite","configKey","rank","tag","label","icon","join","keyBinding","toolbarPriority","toHTMLString","content","parseHTML","sanitize","tags","SuperSubPlugin","id","name","priority","config","this","context","enabledMarks","filter","def","lastVisibleMark","isToolbarVisible","at","isSeparatorTarget","separatorAfter","registerMark","registerKeymaps","registerExclusivityMiddleware","registerDisabledToolbarItems","commandName","toCommandName","toolbarVisible","registerMarkSpec","toDOM","document","createElement","_mark","registerCommand","tr","toggleMark","getState","mkType","dispatch","registerToolbarItem","group","tooltip","formatShortcut","command","isActive","state","isMarkActive","marks","keymap","executeCommand","Object","keys","length","registerKeymap","some","d","registerMiddleware","_state","next","patched","patchedSteps","step","steps","push","markName","mark","find","removeStep","blockId","from","to","path","storedMarksAfter","hasSup","m","hasSub","removeType","findLastIndex","toolbar","featureEnabled","isEnabled","markType","charAt","toUpperCase","slice"],"mappings":";;;AA4CA,MAAMA,IAAiC,EACtCC,aAAAA,MACAC,WAAAA,QA6DKC,IAA8C,CACnD,EACCC,MAAM,eACNC,UAAU,aACVC,WAAW,eACXC,MAAM,GACNC,KAAK,OACLC,OAAO,eACPC,MAjD+B,CAChC,gEACA,2DACA,kBACA,8CACA,gDACA,qDACA,+DACA,sDACA,0DACA,0DACA,0DACA,wDACA,0EACA,0EACA,2EACA,4EACA,4EACA,oBACA,2DACA,wDACA,QAAA,EACCC,KAAK,EAAA,GA4BLC,YAAY,SACZC,iBAAiB,IACjBC,cAAeC,CAAAA,OAAY,QAAQA,EAAAA,UACnCC,WAAW,CAAC,EAAER,KAAK,UACnBS,UAAU,EAAEC,MAAM,CAAC,KAAA,EAAA,EAAA,GAEpB,EACCd,MAAM,aACNC,UAAU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yBAAqBtC,EAAAA;AAAAA,IAAAA,CAAAA;AAAAA,EAEpE;AAAA,EAMQ,6BAA6BtB,IAAAA;AACpC,QAAKD,KAAKD,OAAOoE,QAEjB,YAAW/D,MAAOzB,GAAkB;AACnC,YAAMyF,KAA0BpE,KAAKD,OAAOK,GAAItB,SAAAA,GAC1CkC,KAA0BhB,KAAKD,OAAOoE,QAAQ/D,GAAItB;AAAc,OAEjEsF,MAAkBpD,MACtBf,GAAQ2B,oBAAoB,EAC3BhC,IAAIQ,GAAIxB,MACRiD,OAAO,UACP3C,MAAMkB,GAAIlB,MACVD,OAAOmB,GAAInB,OACX+C,SAASjB,EAAcX,GAAIxB,IAAAA,GAC3BkB,UAAUM,GAAIf,iBACdgF,WAAW,MAAA;IAGd;AAAA,EACD;AAAA,EAEQ,iBACPvF,IAAAA;AAEA,WAAA,CAAKkB,KAAKD,OAAOoE,YACVnE,KAAKD,OAAOoE,QAAQrF,EAAAA,KAAAA;AAAAA,EAC5B;AAAA;AAID,SAASiC,EAAcuD;AACtB,SAAO,SAASA,GAASC,OAAO,CAAA,EAAGC,YAAAA,CAAAA,GAAgBF,GAASG,MAAM;AACnE;"}
|
|
1
|
+
{"version":3,"file":"super-sub.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BlockId } from '../../model/TypeBrands.js';
|
|
2
|
+
import { EditorState } from '../../state/EditorState.js';
|
|
3
|
+
import { Transaction } from '../../state/Transaction.js';
|
|
4
|
+
import { PluginContext } from '../Plugin.js';
|
|
5
|
+
import { TableLocale } from './TableLocale.js';
|
|
6
|
+
/** Subdued, border-appropriate colors: grays, earth tones, muted hues. */
|
|
7
|
+
export declare const BORDER_COLOR_PALETTE: readonly string[];
|
|
8
|
+
/**
|
|
9
|
+
* Builds a transaction that sets `borderColor` on a table node.
|
|
10
|
+
* Preserves existing attributes (spread pattern).
|
|
11
|
+
*/
|
|
12
|
+
export declare function buildSetBorderColorTransaction(state: EditorState, tableId: BlockId, borderColor: string | undefined): Transaction | null;
|
|
13
|
+
/** Sets the border color on the table surrounding the cursor. */
|
|
14
|
+
export declare function setTableBorderColor(context: PluginContext, color: string, locale?: TableLocale): boolean;
|
|
15
|
+
/** Resets the border color to theme default. */
|
|
16
|
+
export declare function resetTableBorderColor(context: PluginContext, locale?: TableLocale): boolean;
|
|
17
|
+
/** Reads the current border color from a table node. */
|
|
18
|
+
export declare function getTableBorderColor(state: EditorState, tableId: BlockId): string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Renders an accessible border color picker into a container element.
|
|
21
|
+
* Includes "Default", "No borders", and a WAI-ARIA grid of color swatches.
|
|
22
|
+
*/
|
|
23
|
+
export declare function renderBorderColorPicker(container: HTMLElement, context: PluginContext, tableId: BlockId, onClose: () => void, locale?: TableLocale): void;
|
|
24
|
+
//# sourceMappingURL=TableBorderColor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableBorderColor.d.ts","sourceRoot":"","sources":["../../../src/plugins/table/TableBorderColor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAIlD,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIrE,0EAA0E;AAC1E,eAAO,MAAM,oBAAoB,EAAE,SAAS,MAAM,EAqBjD,CAAC;AAYF;;;GAGG;AACH,wBAAgB,8BAA8B,CAC7C,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,MAAM,GAAG,SAAS,GAC7B,WAAW,GAAG,IAAI,CA2BpB;AAID,iEAAiE;AACjE,wBAAgB,mBAAmB,CAClC,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,MAAM,EACb,MAAM,GAAE,WAA6B,GACnC,OAAO,CAaT;AAED,gDAAgD;AAChD,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,aAAa,EACtB,MAAM,GAAE,WAA6B,GACnC,OAAO,CAYT;AAED,wDAAwD;AACxD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAI5F;AAID;;;GAGG;AACH,wBAAgB,uBAAuB,CACtC,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,IAAI,EACnB,MAAM,GAAE,WAA6B,GACnC,IAAI,CA+JN"}
|
|
@@ -2,6 +2,7 @@ import { BlockId } from '../../model/TypeBrands.js';
|
|
|
2
2
|
import { EditorState } from '../../state/EditorState.js';
|
|
3
3
|
import { Transaction } from '../../state/Transaction.js';
|
|
4
4
|
import { PluginContext } from '../Plugin.js';
|
|
5
|
+
import { TableLocale } from './TableLocale.js';
|
|
5
6
|
/** Builds a transaction that inserts a new row at the given index. */
|
|
6
7
|
export declare function buildInsertRowTransaction(state: EditorState, tableId: BlockId, rowIndex: number): Transaction | null;
|
|
7
8
|
/** Builds a transaction that inserts a new column at the given index. */
|
|
@@ -30,21 +31,21 @@ export declare function createDeleteTableTransaction(state: EditorState, tableId
|
|
|
30
31
|
*/
|
|
31
32
|
export declare function insertTable(context: PluginContext, rows: number, cols: number): boolean;
|
|
32
33
|
/** Adds a row above the current row. */
|
|
33
|
-
export declare function addRowAbove(context: PluginContext): boolean;
|
|
34
|
+
export declare function addRowAbove(context: PluginContext, locale?: TableLocale): boolean;
|
|
34
35
|
/** Adds a row below the current row. */
|
|
35
|
-
export declare function addRowBelow(context: PluginContext): boolean;
|
|
36
|
+
export declare function addRowBelow(context: PluginContext, locale?: TableLocale): boolean;
|
|
36
37
|
/** Adds a column to the left of the current column. */
|
|
37
|
-
export declare function addColumnLeft(context: PluginContext): boolean;
|
|
38
|
+
export declare function addColumnLeft(context: PluginContext, locale?: TableLocale): boolean;
|
|
38
39
|
/** Adds a column to the right of the current column. */
|
|
39
|
-
export declare function addColumnRight(context: PluginContext): boolean;
|
|
40
|
+
export declare function addColumnRight(context: PluginContext, locale?: TableLocale): boolean;
|
|
40
41
|
/** Deletes the current row. If it's the last row, deletes the entire table. */
|
|
41
|
-
export declare function deleteRow(context: PluginContext): boolean;
|
|
42
|
+
export declare function deleteRow(context: PluginContext, locale?: TableLocale): boolean;
|
|
42
43
|
/** Deletes the current column. If it's the last column, deletes the entire table. */
|
|
43
|
-
export declare function deleteColumn(context: PluginContext): boolean;
|
|
44
|
+
export declare function deleteColumn(context: PluginContext, locale?: TableLocale): boolean;
|
|
44
45
|
/** Deletes the entire table and moves cursor to surrounding block. */
|
|
45
|
-
export declare function deleteTable(context: PluginContext): boolean;
|
|
46
|
+
export declare function deleteTable(context: PluginContext, locale?: TableLocale): boolean;
|
|
46
47
|
/** Selects the surrounding table as a node object. */
|
|
47
48
|
export declare function selectTable(context: PluginContext): boolean;
|
|
48
49
|
/** Registers all table commands on the given plugin context. */
|
|
49
|
-
export declare function registerTableCommands(context: PluginContext): void;
|
|
50
|
+
export declare function registerTableCommands(context: PluginContext, locale?: TableLocale): void;
|
|
50
51
|
//# sourceMappingURL=TableCommands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCommands.d.ts","sourceRoot":"","sources":["../../../src/plugins/table/TableCommands.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH,OAAO,KAAK,EAAE,OAAO,EAAgB,MAAM,2BAA2B,CAAC;AAEvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,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AE,IAAI,EAAE,MAAM,GAAG,OAAO,CAiDvF;AAED,wCAAwC;AACxC,wBAAgB,WAAW,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAYjF;AAED,wCAAwC;AACxC,wBAAgB,WAAW,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAYjF;AAED,uDAAuD;AACvD,wBAAgB,aAAa,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAEnF;AAED,wDAAwD;AACxD,wBAAgB,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAEpF;AAiBD,+EAA+E;AAC/E,wBAAgB,SAAS,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAiB/E;AAED,qFAAqF;AACrF,wBAAgB,YAAY,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAiBlF;AAED,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAUjF;AAED,sDAAsD;AACtD,wBAAgB,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAqB3D;AAED,gEAAgE;AAChE,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAUxF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BlockId } from '../../model/TypeBrands.js';
|
|
2
|
+
import { PluginContext } from '../Plugin.js';
|
|
3
|
+
import { TableLocale } from './TableLocale.js';
|
|
4
|
+
export interface TableContextMenuHandle {
|
|
5
|
+
isOpen(): boolean;
|
|
6
|
+
close(): void;
|
|
7
|
+
destroy(): void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Creates and displays an accessible context menu for table operations.
|
|
11
|
+
* Attaches to the provided container (shadow root or editor container).
|
|
12
|
+
*/
|
|
13
|
+
export declare function createTableContextMenu(container: HTMLElement, context: PluginContext, tableId: BlockId, anchorRect: DOMRect, onClosed?: () => void, locale?: TableLocale): TableContextMenuHandle;
|
|
14
|
+
//# sourceMappingURL=TableContextMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableContextMenu.d.ts","sourceRoot":"","sources":["../../../src/plugins/table/TableContextMenu.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIrE,MAAM,WAAW,sBAAsB;IACtC,MAAM,IAAI,OAAO,CAAC;IAClB,KAAK,IAAI,IAAI,CAAC;IACd,OAAO,IAAI,IAAI,CAAC;CAChB;AAyCD;;;GAGG;AACH,wBAAgB,sBAAsB,CACrC,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,OAAO,EACnB,QAAQ,CAAC,EAAE,MAAM,IAAI,EACrB,MAAM,GAAE,WAA6B,GACnC,sBAAsB,CAgQxB"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { BlockNode } from '../../model/Document.js';
|
|
2
2
|
import { EditorState } from '../../state/EditorState.js';
|
|
3
3
|
import { Transaction } from '../../state/Transaction.js';
|
|
4
|
+
import { PluginContext } from '../Plugin.js';
|
|
5
|
+
import { TableLocale } from './TableLocale.js';
|
|
4
6
|
export interface TableControlsHandle {
|
|
5
7
|
update(node: BlockNode): void;
|
|
6
8
|
destroy(): void;
|
|
7
9
|
}
|
|
8
10
|
/** Creates table controls for the given table element. */
|
|
9
|
-
export declare function createTableControls(container: HTMLElement, tableEl: HTMLTableElement, initialNode: BlockNode, getState: () => EditorState, dispatch: (tr: Transaction) => void): TableControlsHandle;
|
|
11
|
+
export declare function createTableControls(container: HTMLElement, tableEl: HTMLTableElement, initialNode: BlockNode, getState: () => EditorState, dispatch: (tr: Transaction) => void, pluginContext?: PluginContext, locale?: TableLocale): TableControlsHandle;
|
|
10
12
|
//# sourceMappingURL=TableControls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableControls.d.ts","sourceRoot":"","sources":["../../../src/plugins/table/TableControls.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"TableControls.d.ts","sourceRoot":"","sources":["../../../src/plugins/table/TableControls.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAiClD,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIrE,MAAM,WAAW,mBAAmB;IACnC,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;IAC9B,OAAO,IAAI,IAAI,CAAC;CAChB;AA0XD,0DAA0D;AAC1D,wBAAgB,mBAAmB,CAClC,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,gBAAgB,EACzB,WAAW,EAAE,SAAS,EACtB,QAAQ,EAAE,MAAM,WAAW,EAC3B,QAAQ,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,EACnC,aAAa,CAAC,EAAE,aAAa,EAC7B,MAAM,CAAC,EAAE,WAAW,GAClB,mBAAmB,CAUrB"}
|
|
@@ -8,11 +8,23 @@ export declare const TABLE_DELETE_SVG: string;
|
|
|
8
8
|
/** Creates a button with standard table-control setup (mousedown prevention, ARIA). */
|
|
9
9
|
export declare function createButton(className: string, innerHTML: string, title: string): HTMLButtonElement;
|
|
10
10
|
/** Builds the insert-line element (horizontal or vertical) with a plus-icon button. */
|
|
11
|
-
export declare function buildInsertLine(orientation: 'horizontal' | 'vertical'): HTMLDivElement;
|
|
11
|
+
export declare function buildInsertLine(orientation: 'horizontal' | 'vertical', label?: string): HTMLDivElement;
|
|
12
12
|
/** Builds a zone-button for adding rows or columns at the table edge. */
|
|
13
13
|
export declare function buildAddButton(className: string, title: string): HTMLButtonElement;
|
|
14
14
|
/** Builds a handle-bar container (for column or row handles). */
|
|
15
15
|
export declare function buildHandleBar(className: string): HTMLDivElement;
|
|
16
|
+
/** SVG icon for kebab menu (three vertical dots). */
|
|
17
|
+
export declare const ACTIONS_SVG: string;
|
|
18
|
+
/** Builds the table actions button (kebab menu icon). */
|
|
19
|
+
export declare function buildActionsButton(label?: string): HTMLButtonElement;
|
|
20
|
+
/** Builds the context menu discovery hint shown on first focus. */
|
|
21
|
+
export declare function buildContextHint(label?: string): HTMLDivElement;
|
|
22
|
+
/** SVG icon for border/grid. */
|
|
23
|
+
export declare const BORDER_COLOR_SVG: string;
|
|
24
|
+
/** Builds the border color button with a color indicator swatch. */
|
|
25
|
+
export declare function buildBorderColorButton(currentColor?: string): HTMLButtonElement;
|
|
26
|
+
/** Updates the swatch indicator to reflect the current border color. */
|
|
27
|
+
export declare function updateBorderColorSwatch(swatch: HTMLElement, color?: string): void;
|
|
16
28
|
/** Builds a single column or row handle with a delete button. */
|
|
17
29
|
export declare function buildHandle(className: string, index: number, deleteLabel: string, onDelete: (idx: number) => void): HTMLDivElement;
|
|
18
30
|
//# sourceMappingURL=TableControlsDOM.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableControlsDOM.d.ts","sourceRoot":"","sources":["../../../src/plugins/table/TableControlsDOM.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,eAAO,MAAM,QAAQ,EAAE,MAI6B,CAAC;AAErD,eAAO,MAAM,UAAU,EAAE,MAI2B,CAAC;AAErD,eAAO,MAAM,gBAAgB,EAAE,MAKG,CAAC;AAInC,uFAAuF;AACvF,wBAAgB,YAAY,CAC3B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GACX,iBAAiB,CAanB;AAED,uFAAuF;AACvF,wBAAgB,eAAe,
|
|
1
|
+
{"version":3,"file":"TableControlsDOM.d.ts","sourceRoot":"","sources":["../../../src/plugins/table/TableControlsDOM.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,eAAO,MAAM,QAAQ,EAAE,MAI6B,CAAC;AAErD,eAAO,MAAM,UAAU,EAAE,MAI2B,CAAC;AAErD,eAAO,MAAM,gBAAgB,EAAE,MAKG,CAAC;AAInC,uFAAuF;AACvF,wBAAgB,YAAY,CAC3B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GACX,iBAAiB,CAanB;AAED,uFAAuF;AACvF,wBAAgB,eAAe,CAC9B,WAAW,EAAE,YAAY,GAAG,UAAU,EACtC,KAAK,CAAC,EAAE,MAAM,GACZ,cAAc,CAWhB;AAED,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,iBAAiB,CAoBlF;AAED,iEAAiE;AACjE,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,CAMhE;AAED,qDAAqD;AACrD,eAAO,MAAM,WAAW,EAAE,MAKc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