@notectl/core 1.7.1 → 1.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AttrRegistry-Ci0qAvtS.mjs → AttrRegistry-D9Jx_RVb.mjs} +2 -2
- package/dist/chunks/{AttrRegistry-Ci0qAvtS.mjs.map → AttrRegistry-D9Jx_RVb.mjs.map} +1 -1
- package/dist/chunks/AttributedMarkCommands-BtLea72z.mjs +80 -0
- package/dist/chunks/AttributedMarkCommands-BtLea72z.mjs.map +1 -0
- package/dist/chunks/{CaretNavigation-qLfeL0So.mjs → CaretNavigation-7JYpIKbs.mjs} +3 -3
- package/dist/chunks/{CaretNavigation-qLfeL0So.mjs.map → CaretNavigation-7JYpIKbs.mjs.map} +1 -1
- package/dist/chunks/{ColorGrid-BBkN0AOb.mjs → ColorGrid--lBQ7jCK.mjs} +56 -55
- package/dist/chunks/ColorGrid--lBQ7jCK.mjs.map +1 -0
- package/dist/chunks/{ColorPickerPopup-D3ysvOH-.mjs → ColorPickerPopup-TpIRlXc8.mjs} +15 -15
- package/dist/chunks/ColorPickerPopup-TpIRlXc8.mjs.map +1 -0
- package/dist/chunks/{Document-DfZ1NOjs.mjs → Document-Brtw2jL1.mjs} +6 -6
- package/dist/chunks/Document-Brtw2jL1.mjs.map +1 -0
- package/dist/chunks/{MarkCommands-uybmkw9l.mjs → MarkCommands-6RUJ4L3r.mjs} +3 -3
- package/dist/chunks/MarkCommands-6RUJ4L3r.mjs.map +1 -0
- package/dist/chunks/{NodeResolver-CzLmmrph.mjs → NodeResolver-C2XYkeOi.mjs} +2 -2
- package/dist/chunks/{NodeResolver-CzLmmrph.mjs.map → NodeResolver-C2XYkeOi.mjs.map} +1 -1
- package/dist/chunks/NodeSpec-NZVvcCuH.mjs.map +1 -1
- package/dist/chunks/PopupPositioning-CgjgAKjp.mjs +34 -0
- package/dist/chunks/PopupPositioning-CgjgAKjp.mjs.map +1 -0
- package/dist/chunks/RangeIterator-Bh4Vl_6D.mjs +16 -0
- package/dist/chunks/{RangeIterator-Bye0UtbY.mjs.map → RangeIterator-Bh4Vl_6D.mjs.map} +1 -1
- package/dist/chunks/StyleRuntime-CP4NCwKT.mjs +235 -0
- package/dist/chunks/StyleRuntime-CP4NCwKT.mjs.map +1 -0
- package/dist/chunks/ToolbarItem-BpZggUGo.mjs.map +1 -1
- package/dist/chunks/{index-Bt_d4IqB.mjs → index--7pBhSF4.mjs} +74 -73
- package/dist/chunks/index--7pBhSF4.mjs.map +1 -0
- package/dist/chunks/{index-DayTn6Re.mjs → index-BXCkjDax.mjs} +78 -83
- package/dist/chunks/index-BXCkjDax.mjs.map +1 -0
- package/dist/chunks/{index-DGKQhSAl.mjs → index-BXtw5PNN.mjs} +2 -2
- package/dist/chunks/{index-DGKQhSAl.mjs.map → index-BXtw5PNN.mjs.map} +1 -1
- package/dist/chunks/{ToolbarPlugin-B7oJRzpl.mjs → index-BcDRT4K2.mjs} +110 -121
- package/dist/chunks/index-BcDRT4K2.mjs.map +1 -0
- package/dist/chunks/{index-DoCvDkfj.mjs → index-BjFBWBOC.mjs} +23 -25
- package/dist/chunks/index-BjFBWBOC.mjs.map +1 -0
- package/dist/chunks/{index-CrKz_IEn.mjs → index-C1opJocO.mjs} +2 -2
- package/dist/chunks/{index-CrKz_IEn.mjs.map → index-C1opJocO.mjs.map} +1 -1
- package/dist/chunks/{index-CfyS_pgH.mjs → index-CCyqQ0Dz.mjs} +32 -31
- package/dist/chunks/index-CCyqQ0Dz.mjs.map +1 -0
- package/dist/chunks/{index-E7OgN7hM.mjs → index-Cd3uJLP3.mjs} +2 -2
- package/dist/chunks/{index-E7OgN7hM.mjs.map → index-Cd3uJLP3.mjs.map} +1 -1
- package/dist/chunks/{index-yhz2qeeh.mjs → index-DSAuGP4n.mjs} +131 -127
- package/dist/chunks/index-DSAuGP4n.mjs.map +1 -0
- package/dist/chunks/{index-CH1r7DL-.mjs → index-DtRfqsq5.mjs} +211 -210
- package/dist/chunks/index-DtRfqsq5.mjs.map +1 -0
- package/dist/chunks/{index-CFPP456m.mjs → index-DxbQirny.mjs} +8 -8
- package/dist/chunks/{index-CFPP456m.mjs.map → index-DxbQirny.mjs.map} +1 -1
- package/dist/chunks/{index-DuRNETFv.mjs → index-ErZ5_a1o.mjs} +3 -3
- package/dist/chunks/{index-DuRNETFv.mjs.map → index-ErZ5_a1o.mjs.map} +1 -1
- package/dist/chunks/{index-Deag_lVi.mjs → index-WpbK_s_H.mjs} +29 -31
- package/dist/chunks/index-WpbK_s_H.mjs.map +1 -0
- package/dist/chunks/{index-DIvHQtE2.mjs → index-WrqH1wG8.mjs} +15 -14
- package/dist/chunks/index-WrqH1wG8.mjs.map +1 -0
- package/dist/chunks/{index-Dy6SllXW.mjs → index-fsVJLutn.mjs} +3 -3
- package/dist/chunks/{index-Dy6SllXW.mjs.map → index-fsVJLutn.mjs.map} +1 -1
- package/dist/chunks/{index-Ckzqtn5D.mjs → index-fx3KIap3.mjs} +15 -14
- package/dist/chunks/index-fx3KIap3.mjs.map +1 -0
- package/dist/chunks/{index-DmuuFS5D.mjs → index-oOJo-ywB.mjs} +4 -4
- package/dist/chunks/{index-DmuuFS5D.mjs.map → index-oOJo-ywB.mjs.map} +1 -1
- package/dist/chunks/{index-CFJFD4lF.mjs → index-toj88jtL.mjs} +19 -18
- package/dist/chunks/index-toj88jtL.mjs.map +1 -0
- package/dist/commands/AttributedMarkCommands.d.ts.map +1 -1
- package/dist/commands/MarkCommands.d.ts +3 -3
- package/dist/commands/MarkCommands.d.ts.map +1 -1
- package/dist/editor/CSSClassCollector.d.ts +36 -0
- package/dist/editor/CSSClassCollector.d.ts.map +1 -0
- package/dist/editor/ContentHTMLTypes.d.ts +29 -0
- package/dist/editor/ContentHTMLTypes.d.ts.map +1 -0
- package/dist/editor/ContentStyleInjector.d.ts +69 -0
- package/dist/editor/ContentStyleInjector.d.ts.map +1 -0
- package/dist/editor/DocumentParser.d.ts +9 -1
- package/dist/editor/DocumentParser.d.ts.map +1 -1
- package/dist/editor/DocumentSerializer.d.ts +6 -0
- package/dist/editor/DocumentSerializer.d.ts.map +1 -1
- package/dist/editor/EditorThemeController.d.ts +3 -0
- package/dist/editor/EditorThemeController.d.ts.map +1 -1
- package/dist/editor/MarkSerializer.d.ts +7 -0
- package/dist/editor/MarkSerializer.d.ts.map +1 -1
- package/dist/editor/NotectlEditor.d.ts +13 -3
- package/dist/editor/NotectlEditor.d.ts.map +1 -1
- package/dist/editor/PaperLayoutController.d.ts.map +1 -1
- package/dist/editor/styles/font-select.d.ts +1 -1
- package/dist/editor/styles/font-select.d.ts.map +1 -1
- package/dist/editor/styles/font-size-select.d.ts +1 -1
- package/dist/editor/styles/font-size-select.d.ts.map +1 -1
- package/dist/editor/styles/heading-select.d.ts +1 -1
- package/dist/editor/styles/heading-select.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/index.d.ts +10 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/input/LegacyHTMLNormalizer.d.ts.map +1 -1
- package/dist/model/Document.d.ts +0 -4
- package/dist/model/Document.d.ts.map +1 -1
- package/dist/model/NodeSpec.d.ts +19 -2
- package/dist/model/NodeSpec.d.ts.map +1 -1
- package/dist/notectl-core.mjs +613 -477
- package/dist/notectl-core.mjs.map +1 -1
- package/dist/notectl-core.umd.js +1571 -1225
- package/dist/notectl-core.umd.js.map +1 -1
- package/dist/plugins/alignment/AlignmentPlugin.d.ts.map +1 -1
- package/dist/plugins/alignment.mjs +1 -1
- package/dist/plugins/caret-navigation.mjs +1 -1
- package/dist/plugins/code-block/CodeBlockNodeView.d.ts.map +1 -1
- package/dist/plugins/code-block/CodeBlockPlugin.d.ts +0 -1
- package/dist/plugins/code-block/CodeBlockPlugin.d.ts.map +1 -1
- package/dist/plugins/code-block/index.d.ts +2 -1
- package/dist/plugins/code-block/index.d.ts.map +1 -1
- package/dist/plugins/code-block.mjs +1 -1
- package/dist/plugins/font/FontPlugin.d.ts +0 -1
- package/dist/plugins/font/FontPlugin.d.ts.map +1 -1
- package/dist/plugins/font-size/FontSizePlugin.d.ts +0 -2
- package/dist/plugins/font-size/FontSizePlugin.d.ts.map +1 -1
- package/dist/plugins/font-size/FontSizePopup.d.ts +3 -1
- package/dist/plugins/font-size/FontSizePopup.d.ts.map +1 -1
- package/dist/plugins/font-size.mjs +1 -1
- package/dist/plugins/font.mjs +1 -1
- package/dist/plugins/gap-cursor.mjs +6 -6
- package/dist/plugins/hard-break.mjs +1 -1
- package/dist/plugins/heading/HeadingBlockTypePicker.d.ts.map +1 -1
- package/dist/plugins/heading.mjs +1 -1
- package/dist/plugins/highlight/HighlightPlugin.d.ts.map +1 -1
- package/dist/plugins/highlight.mjs +1 -1
- package/dist/plugins/horizontal-rule.mjs +1 -1
- package/dist/plugins/image/ImageNodeView.d.ts.map +1 -1
- package/dist/plugins/image/ImagePlugin.d.ts.map +1 -1
- package/dist/plugins/image.mjs +1 -1
- package/dist/plugins/link.mjs +1 -1
- package/dist/plugins/list/ListPlugin.d.ts.map +1 -1
- package/dist/plugins/list.mjs +1 -1
- package/dist/plugins/print/PrintContentPreparer.d.ts.map +1 -1
- package/dist/plugins/shared/ColorGrid.d.ts.map +1 -1
- package/dist/plugins/shared/ColorPickerPopup.d.ts +2 -1
- package/dist/plugins/shared/ColorPickerPopup.d.ts.map +1 -1
- package/dist/plugins/shared/PopupManager.d.ts +12 -2
- package/dist/plugins/shared/PopupManager.d.ts.map +1 -1
- package/dist/plugins/shared/PopupPositioning.d.ts.map +1 -1
- package/dist/plugins/strikethrough.mjs +1 -1
- package/dist/plugins/super-sub.mjs +1 -1
- package/dist/plugins/table/TableContextMenu.d.ts.map +1 -1
- package/dist/plugins/table/TableControls.d.ts.map +1 -1
- package/dist/plugins/table/TableControlsDOM.d.ts.map +1 -1
- package/dist/plugins/table/TableControlsLayout.d.ts.map +1 -1
- package/dist/plugins/table/TableNodeViews.d.ts.map +1 -1
- package/dist/plugins/table/TablePlugin.d.ts.map +1 -1
- package/dist/plugins/table.mjs +1 -1
- package/dist/plugins/text-color/TextColorPlugin.d.ts.map +1 -1
- package/dist/plugins/text-color.mjs +1 -1
- package/dist/plugins/text-formatting.mjs +1 -1
- package/dist/plugins/toolbar/ToolbarItem.d.ts +3 -2
- package/dist/plugins/toolbar/ToolbarItem.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarOverflowController.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarPopupController.d.ts +0 -3
- package/dist/plugins/toolbar/ToolbarPopupController.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarRenderers.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarTooltip.d.ts.map +1 -1
- package/dist/plugins/toolbar.mjs +2 -2
- package/dist/presets/PresetTypes.d.ts +1 -1
- package/dist/presets/PresetTypes.d.ts.map +1 -1
- package/dist/style/StyleRuntime.d.ts +34 -0
- package/dist/style/StyleRuntime.d.ts.map +1 -0
- package/dist/view/Reconciler.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/AttributedMarkCommands-BETuHXj8.mjs +0 -58
- package/dist/chunks/AttributedMarkCommands-BETuHXj8.mjs.map +0 -1
- package/dist/chunks/ColorGrid-BBkN0AOb.mjs.map +0 -1
- package/dist/chunks/ColorPickerPopup-D3ysvOH-.mjs.map +0 -1
- package/dist/chunks/Document-DfZ1NOjs.mjs.map +0 -1
- package/dist/chunks/MarkCommands-uybmkw9l.mjs.map +0 -1
- package/dist/chunks/PopupPositioning-Cn6L_mO2.mjs +0 -30
- package/dist/chunks/PopupPositioning-Cn6L_mO2.mjs.map +0 -1
- package/dist/chunks/RangeIterator-Bye0UtbY.mjs +0 -16
- package/dist/chunks/ToolbarPlugin-B7oJRzpl.mjs.map +0 -1
- package/dist/chunks/index-Bt_d4IqB.mjs.map +0 -1
- package/dist/chunks/index-CFJFD4lF.mjs.map +0 -1
- package/dist/chunks/index-CH1r7DL-.mjs.map +0 -1
- package/dist/chunks/index-CfyS_pgH.mjs.map +0 -1
- package/dist/chunks/index-Ckzqtn5D.mjs.map +0 -1
- package/dist/chunks/index-DIvHQtE2.mjs.map +0 -1
- package/dist/chunks/index-DayTn6Re.mjs.map +0 -1
- package/dist/chunks/index-Deag_lVi.mjs.map +0 -1
- package/dist/chunks/index-DoCvDkfj.mjs.map +0 -1
- package/dist/chunks/index-yhz2qeeh.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-BXtw5PNN.mjs","sources":["../../src/plugins/strikethrough/StrikethroughLocale.ts","../../src/plugins/strikethrough/StrikethroughPlugin.ts"],"sourcesContent":["/**\n * Locale interface and default English locale for the StrikethroughPlugin.\n */\n\n// --- Locale Interface ---\n\nexport interface StrikethroughLocale {\n\treadonly label: string;\n\treadonly tooltip: (shortcut: string) => string;\n}\n\n// --- Default English Locale ---\n\nexport const STRIKETHROUGH_LOCALE_EN: StrikethroughLocale = {\n\tlabel: 'Strikethrough',\n\ttooltip: (shortcut: string) => `Strikethrough (${shortcut})`,\n};\n\n// --- German Locale ---\n\nexport const STRIKETHROUGH_LOCALE_DE: StrikethroughLocale = {\n\tlabel: 'Durchgestrichen',\n\ttooltip: (shortcut: string) => `Durchgestrichen (${shortcut})`,\n};\n\n// --- Spanish Locale ---\n\nexport const STRIKETHROUGH_LOCALE_ES: StrikethroughLocale = {\n\tlabel: 'Tachado',\n\ttooltip: (shortcut: string) => `Tachado (${shortcut})`,\n};\n\n// --- French Locale ---\n\nexport const STRIKETHROUGH_LOCALE_FR: StrikethroughLocale = {\n\tlabel: 'Barré',\n\ttooltip: (shortcut: string) => `Barré (${shortcut})`,\n};\n\n// --- Chinese (Simplified) Locale ---\n\nexport const STRIKETHROUGH_LOCALE_ZH: StrikethroughLocale = {\n\tlabel: '删除线',\n\ttooltip: (shortcut: string) => `删除线 (${shortcut})`,\n};\n\n// --- Russian Locale ---\n\nexport const STRIKETHROUGH_LOCALE_RU: StrikethroughLocale = {\n\tlabel: 'Зачёркнутый',\n\ttooltip: (shortcut: string) => `Зачёркнутый (${shortcut})`,\n};\n\n// --- Arabic Locale ---\n\nexport const STRIKETHROUGH_LOCALE_AR: StrikethroughLocale = {\n\tlabel: 'يتوسطه خط',\n\ttooltip: (shortcut: string) => `يتوسطه خط (${shortcut})`,\n};\n\n// --- Hindi Locale ---\n\nexport const STRIKETHROUGH_LOCALE_HI: StrikethroughLocale = {\n\tlabel: 'स्ट्राइकथ्रू',\n\ttooltip: (shortcut: string) => `स्ट्राइकथ्रू (${shortcut})`,\n};\n\n// --- Locale Map ---\n\nexport const STRIKETHROUGH_LOCALES: Record<string, StrikethroughLocale> = {\n\ten: STRIKETHROUGH_LOCALE_EN,\n\tde: STRIKETHROUGH_LOCALE_DE,\n\tes: STRIKETHROUGH_LOCALE_ES,\n\tfr: STRIKETHROUGH_LOCALE_FR,\n\tzh: STRIKETHROUGH_LOCALE_ZH,\n\tru: STRIKETHROUGH_LOCALE_RU,\n\tar: STRIKETHROUGH_LOCALE_AR,\n\thi: STRIKETHROUGH_LOCALE_HI,\n};\n","/**\n * StrikethroughPlugin: registers a strikethrough inline mark with MarkSpec,\n * toggle command, keyboard shortcut (Mod-Shift-X), and a toolbar button.\n */\n\nimport { isMarkActive, toggleMark } from '../../commands/Commands.js';\nimport { resolvePluginLocale } from '../../i18n/resolvePluginLocale.js';\nimport { markType } from '../../model/TypeBrands.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { formatShortcut } from '../toolbar/ToolbarItem.js';\nimport { STRIKETHROUGH_LOCALES, type StrikethroughLocale } from './StrikethroughLocale.js';\n\n// --- Attribute Registry Augmentation ---\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface MarkAttrRegistry {\n\t\tstrikethrough: Record<string, never>;\n\t}\n}\n\n// --- Configuration ---\n\nexport interface StrikethroughConfig {\n\t/** When true, a separator is rendered after the strikethrough toolbar item. */\n\treadonly separatorAfter?: boolean;\n\treadonly locale?: StrikethroughLocale;\n}\n\nconst DEFAULT_CONFIG: StrikethroughConfig = {};\n\n// --- Plugin ---\n\nexport class StrikethroughPlugin implements Plugin {\n\treadonly id = 'strikethrough';\n\treadonly name = 'Strikethrough';\n\treadonly priority = 22;\n\n\tprivate readonly config: StrikethroughConfig;\n\tprivate locale!: StrikethroughLocale;\n\n\tconstructor(config?: Partial<StrikethroughConfig>) {\n\t\tthis.config = { ...DEFAULT_CONFIG, ...config };\n\t}\n\n\tinit(context: PluginContext): void {\n\t\tthis.locale = resolvePluginLocale(STRIKETHROUGH_LOCALES, context, this.config.locale);\n\t\tthis.registerMarkSpec(context);\n\t\tthis.registerCommand(context);\n\t\tthis.registerKeymap(context);\n\t\tthis.registerToolbarItem(context);\n\t}\n\n\tprivate registerMarkSpec(context: PluginContext): void {\n\t\tcontext.registerMarkSpec({\n\t\t\ttype: 'strikethrough',\n\t\t\trank: 3,\n\t\t\ttoDOM() {\n\t\t\t\treturn document.createElement('s');\n\t\t\t},\n\t\t\ttoHTMLString: (_mark, content) => `<s>${content}</s>`,\n\t\t\tparseHTML: [\n\t\t\t\t{ tag: 's' },\n\t\t\t\t{ tag: 'strike' },\n\t\t\t\t{ tag: 'del' },\n\t\t\t\t{\n\t\t\t\t\ttag: 'span',\n\t\t\t\t\tgetAttrs: (el: HTMLElement) => {\n\t\t\t\t\t\treturn el.style.textDecoration.includes('line-through') ? {} : false;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\tsanitize: { tags: ['s'] },\n\t\t});\n\t}\n\n\tprivate registerCommand(context: PluginContext): void {\n\t\tcontext.registerCommand('toggleStrikethrough', () => {\n\t\t\tconst tr = toggleMark(context.getState(), markType('strikethrough'));\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\t}\n\n\tprivate registerKeymap(context: PluginContext): void {\n\t\tcontext.registerKeymap({\n\t\t\t'Mod-Shift-X': () => context.executeCommand('toggleStrikethrough'),\n\t\t});\n\t}\n\n\tprivate registerToolbarItem(context: PluginContext): void {\n\t\tconst icon =\n\t\t\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z\"/></svg>';\n\n\t\tcontext.registerToolbarItem({\n\t\t\tid: 'strikethrough',\n\t\t\tgroup: 'format',\n\t\t\ticon,\n\t\t\tlabel: this.locale.label,\n\t\t\ttooltip: this.locale.tooltip(formatShortcut('Mod-Shift-X')),\n\t\t\tcommand: 'toggleStrikethrough',\n\t\t\tpriority: 40,\n\t\t\tseparatorAfter: this.config.separatorAfter,\n\t\t\tisActive: (state) => isMarkActive(state, markType('strikethrough')),\n\t\t});\n\t}\n}\n"],"names":["STRIKETHROUGH_LOCALE_EN","label","tooltip","shortcut","STRIKETHROUGH_LOCALES","en","de","es","fr","zh","ru","ar","hi","DEFAULT_CONFIG","StrikethroughPlugin","id","name","priority","config","locale","this","context","resolvePluginLocale","registerMarkSpec","registerCommand","registerKeymap","registerToolbarItem","type","rank","toDOM","document","createElement","toHTMLString","_mark","content","parseHTML","tag","getAttrs","el","style","textDecoration","includes","sanitize","tags","tr","toggleMark","getState","markType","dispatch","executeCommand","group","icon","formatShortcut","command","separatorAfter","isActive","state","isMarkActive"],"mappings":";;;;AAaO,MAAMA,IAA+C,EAC3DC,OAAO,iBACPC,SAAUC,CAAAA,OAAqB,kBAAkBA,EAAAA,IAAAA,GAsDrCC,IAA6D,EACzEC,IAAIL,GACJM,IAnD2D,EAC3DL,OAAO,mBACPC,SAAUC,CAAAA,OAAqB,oBAAoBA,EAAAA,IAAAA,GAkDnDI,IA7C2D,EAC3DN,OAAO,WACPC,SAAUC,CAAAA,OAAqB,YAAYA,EAAAA,IAAAA,GA4C3CK,IAvC2D,EAC3DP,OAAO,SACPC,SAAUC,CAAAA,OAAqB,UAAUA,EAAAA,IAAAA,GAsCzCM,IAjC2D,EAC3DR,OAAO,OACPC,SAAUC,CAAAA,OAAqB,QAAQA,EAAAA,IAAAA,GAgCvCO,IA3B2D,EAC3DT,OAAO,eACPC,SAAUC,CAAAA,OAAqB,gBAAgBA,SA0B/CQ,IArB2D,EAC3DV,OAAO,aACPC,SAAUC,CAAAA,OAAqB,cAAcA,EAAAA,IAAAA,GAoB7CS,IAf2D,EAC3DX,OAAO,gBACPC,SAAUC,CAAAA,OAAqB,iBAAiBA,EAAAA,IAAAA,EAAAA,GCpC3CU,IAAsC,CAAA;AAIrC,MAAMC,EAAAA;AAAAA,EACHC,KAAK;AAAA,EACLC,OAAO;AAAA,EACPC,WAAW;AAAA,EAEHC;AAAAA,EACTC;AAAAA,EAER,YAAYD,IAAAA;AACXE,SAAKF,SAAS,EAAA,GAAKL,GAAAA,GAAmBK,GAAAA;AAAAA,EACvC;AAAA,EAEA,KAAKG,IAAAA;AACJD,SAAKD,SAASG,EAAoBlB,GAAuBiB,IAASD,KAAKF,OAAOC,MAAAA,GAC9EC,KAAKG,iBAAiBF,EAAAA,GACtBD,KAAKI,gBAAgBH,EAAAA,GACrBD,KAAKK,eAAeJ,EAAAA,GACpBD,KAAKM,oBAAoBL,EAAAA;AAAAA,EAC1B;AAAA,EAEQ,iBAAiBA,IAAAA;AACxBA,IAAAA,GAAQE,iBAAiB,EACxBI,MAAM,iBACNC,MAAM,GACNC,OAAA,MACQC,SAASC,cAAc,GAAA,GAE/BC,cAAc,CAACC,IAAOC,OAAY,MAAMA,EAAAA,QACxCC,WAAW,CACV,EAAEC,KAAK,IAAA,GACP,EAAEA,KAAK,SAAA,GACP,EAAEA,KAAK,MAAA,GACP,EACCA,KAAK,QACLC,UAAWC,CAAAA,OAAAA,CAAAA,CACHA,GAAGC,MAAMC,eAAeC,SAAS,cAAA,KAAkB,CAAA,EAAA,CAAA,GAI7DC,UAAU,EAAEC,MAAM,CAAC,GAAA,EAAA,EAAA,CAAA;AAAA,EAErB;AAAA,EAEQ,gBAAgBtB,IAAAA;AACvBA,IAAAA,GAAQG,gBAAgB,uBAAuB,MAAA;AAC9C,YAAMoB,KAAKC,EAAWxB,GAAQyB,YAAYC,EAAS,eAAA,CAAA;AACnD,aAAA,CAAA,CAAIH,OACHvB,GAAQ2B,SAASJ,EAAAA,GAAAA;AAAAA,IACV,CAAA;AAAA,EAIV;AAAA,EAEQ,eAAevB,IAAAA;AACtBA,IAAAA,GAAQI,eAAe,EACtB,eAAe,MAAMJ,GAAQ4B,eAAe,qBAAA,EAAA,CAAA;AAAA,EAE9C;AAAA,EAEQ,oBAAoB5B,IAAAA;AAI3BA,IAAAA,GAAQK,oBAAoB,EAC3BX,IAAI,iBACJmC,OAAO,UACPC,MALA,wIAMAlD,OAAOmB,KAAKD,OAAOlB,OACnBC,SAASkB,KAAKD,OAAOjB,QAAQkD,EAAe,aAAA,CAAA,GAC5CC,SAAS,uBACTpC,UAAU,IACVqC,gBAAgBlC,KAAKF,OAAOoC,gBAC5BC,UAAWC,CAAAA,OAAUC,EAAaD,IAAOT,EAAS,eAAA,CAAA,EAAA,CAAA;AAAA,EAEpD;AAAA;"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { S as t, r as e } from "./resolvePluginLocale-B4w1OkPy.mjs";
|
|
2
|
-
import { a as o, p as n } from "./PopupPositioning-
|
|
3
|
-
import { f as r, n as i, b as
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { a as o, p as n } from "./PopupPositioning-CgjgAKjp.mjs";
|
|
3
|
+
import { f as r, n as i, b as l, a as s, c as a, d as c } from "./ToolbarKeyboardNav-DhpL8zNV.mjs";
|
|
4
|
+
import { s as d, a as p } from "./StyleRuntime-CP4NCwKT.mjs";
|
|
5
|
+
import "./ToolbarItem-BpZggUGo.mjs";
|
|
6
|
+
const u = new t("popup");
|
|
7
|
+
class h {
|
|
6
8
|
stack = [];
|
|
7
9
|
referenceNode;
|
|
8
10
|
constructor(t2) {
|
|
@@ -11,19 +13,19 @@ class p {
|
|
|
11
13
|
open(t2) {
|
|
12
14
|
const e2 = document.createElement("div");
|
|
13
15
|
e2.className = t2.className ? `notectl-popup ${t2.className}` : "notectl-popup", t2.ariaRole && e2.setAttribute("role", t2.ariaRole), t2.ariaLabel && e2.setAttribute("aria-label", t2.ariaLabel);
|
|
14
|
-
const r2 = { close: () => this.closeEntry(c2), getElement: () => e2 };
|
|
15
|
-
t2.content(e2, () => this.closeEntry(c2));
|
|
16
|
+
const r2 = { close: (t3) => this.closeEntry(c2, t3), getElement: () => e2 };
|
|
17
|
+
t2.content(e2, (t3) => this.closeEntry(c2, t3));
|
|
16
18
|
const i2 = t2.referenceNode ?? this.referenceNode;
|
|
17
19
|
o(e2, i2);
|
|
18
|
-
const
|
|
19
|
-
n(e2,
|
|
20
|
-
const
|
|
20
|
+
const l2 = t2.anchor instanceof HTMLElement ? t2.anchor.getBoundingClientRect() : t2.anchor;
|
|
21
|
+
n(e2, l2, { position: t2.position ?? "below-start" });
|
|
22
|
+
const s2 = t2.parent ? this.findEntryByHandle(t2.parent) : null, a2 = (o2) => {
|
|
21
23
|
const n2 = o2.composedPath();
|
|
22
24
|
if (!n2.includes(e2)) {
|
|
23
25
|
for (const t3 of this.stack) if (n2.includes(t3.element)) return;
|
|
24
26
|
t2.anchor instanceof HTMLElement && n2.includes(t2.anchor) || this.closeEntry(c2);
|
|
25
27
|
}
|
|
26
|
-
}, c2 = { element: e2, config: t2, clickOutsideHandler: a2, parent:
|
|
28
|
+
}, c2 = { element: e2, config: t2, clickOutsideHandler: a2, parent: s2 };
|
|
27
29
|
return this.stack.push(c2), setTimeout(() => {
|
|
28
30
|
document.addEventListener("mousedown", a2);
|
|
29
31
|
}, 0), this.focusFirstItem(e2), r2;
|
|
@@ -44,14 +46,14 @@ class p {
|
|
|
44
46
|
destroy() {
|
|
45
47
|
this.closeAll();
|
|
46
48
|
}
|
|
47
|
-
closeEntry(t2) {
|
|
48
|
-
const
|
|
49
|
-
if (-1 !==
|
|
50
|
-
for (; this.stack.length >
|
|
49
|
+
closeEntry(t2, e2) {
|
|
50
|
+
const o2 = this.stack.indexOf(t2);
|
|
51
|
+
if (-1 !== o2) {
|
|
52
|
+
for (; this.stack.length > o2 + 1; ) {
|
|
51
53
|
const t3 = this.stack[this.stack.length - 1];
|
|
52
54
|
t3 && this.removeEntry(t3);
|
|
53
55
|
}
|
|
54
|
-
this.removeEntry(t2), t2.config.restoreFocusTo && t2.config.restoreFocusTo.focus(), t2.config.onClose?.();
|
|
56
|
+
this.removeEntry(t2), void 0 !== e2 && "restoreFocusTo" in e2 ? e2.restoreFocusTo?.focus() : t2.config.restoreFocusTo && t2.config.restoreFocusTo.focus(), t2.config.onClose?.();
|
|
55
57
|
}
|
|
56
58
|
}
|
|
57
59
|
removeEntry(t2) {
|
|
@@ -69,8 +71,8 @@ class p {
|
|
|
69
71
|
});
|
|
70
72
|
}
|
|
71
73
|
}
|
|
72
|
-
const
|
|
73
|
-
class
|
|
74
|
+
const b = { formattingOptionsAria: "Formatting options", moreToolsAria: "More tools" }, m = { en: b, de: { formattingOptionsAria: "Formatierungsoptionen", moreToolsAria: "Weitere Werkzeuge" }, es: { formattingOptionsAria: "Opciones de formato", moreToolsAria: "Más herramientas" }, fr: { formattingOptionsAria: "Options de mise en forme", moreToolsAria: "Plus d'outils" }, zh: { formattingOptionsAria: "格式选项", moreToolsAria: "更多工具" }, ru: { formattingOptionsAria: "Параметры форматирования", moreToolsAria: "Другие инструменты" }, ar: { formattingOptionsAria: "خيارات التنسيق", moreToolsAria: "أدوات إضافية" }, hi: { formattingOptionsAria: "फ़ॉर्मेटिंग विकल्प", moreToolsAria: "और उपकरण" } }, f = { BurgerMenu: "burger-menu", Flow: "flow", None: "none" }, v = "notectl-toolbar-btn--overflow-hidden", g = "notectl-toolbar-separator--overflow-hidden";
|
|
75
|
+
class w {
|
|
74
76
|
toolbar;
|
|
75
77
|
context;
|
|
76
78
|
onOverflowChange;
|
|
@@ -96,28 +98,28 @@ class v {
|
|
|
96
98
|
this.closeDropdown(), this.resetVisibility(), this.ensureOverflowButton(), this.setOverflowButtonVisible(false);
|
|
97
99
|
const t2 = this.measureAvailableWidth(), e2 = Array.from(this.toolbar.children), o2 = this.measureChildWidths(e2), n2 = t2 - 34 - 2;
|
|
98
100
|
let r2 = 0, i2 = false;
|
|
99
|
-
const
|
|
101
|
+
const l2 = [];
|
|
100
102
|
for (const t3 of e2) {
|
|
101
103
|
if (t3 === this.overflowButton) continue;
|
|
102
104
|
if (t3.classList.contains("notectl-toolbar-separator")) {
|
|
103
105
|
if (i2) {
|
|
104
|
-
t3.classList.add(
|
|
106
|
+
t3.classList.add(g);
|
|
105
107
|
continue;
|
|
106
108
|
}
|
|
107
109
|
const e4 = (o2.get(t3) ?? 0) + 2;
|
|
108
|
-
r2 + e4 > n2 ? (i2 = true, t3.classList.add(
|
|
110
|
+
r2 + e4 > n2 ? (i2 = true, t3.classList.add(g)) : r2 += e4;
|
|
109
111
|
continue;
|
|
110
112
|
}
|
|
111
113
|
const e3 = this.entries.find((e4) => e4.element === t3);
|
|
112
114
|
if (!e3) continue;
|
|
113
115
|
if (i2) {
|
|
114
|
-
e3.element.classList.add(
|
|
116
|
+
e3.element.classList.add(v), l2.push(e3);
|
|
115
117
|
continue;
|
|
116
118
|
}
|
|
117
|
-
const
|
|
118
|
-
r2 +
|
|
119
|
+
const s2 = (o2.get(t3) ?? 0) + 2;
|
|
120
|
+
r2 + s2 > n2 ? (i2 = true, e3.element.classList.add(v), l2.push(e3)) : r2 += s2;
|
|
119
121
|
}
|
|
120
|
-
this.overflowEntries =
|
|
122
|
+
this.overflowEntries = l2, this.hideTrailingSeparators(), this.setOverflowButtonVisible(l2.length > 0), this.notifyChange();
|
|
121
123
|
}
|
|
122
124
|
updateItemStates(t2) {
|
|
123
125
|
if (!this.overflowDropdown) return;
|
|
@@ -145,9 +147,9 @@ class v {
|
|
|
145
147
|
return this.toolbar.clientWidth - e2 - o2;
|
|
146
148
|
}
|
|
147
149
|
resetVisibility() {
|
|
148
|
-
for (const t3 of this.entries) t3.element.classList.remove(
|
|
150
|
+
for (const t3 of this.entries) t3.element.classList.remove(v);
|
|
149
151
|
const t2 = Array.from(this.toolbar.querySelectorAll(".notectl-toolbar-separator"));
|
|
150
|
-
for (const e2 of t2) e2.classList.remove(
|
|
152
|
+
for (const e2 of t2) e2.classList.remove(g);
|
|
151
153
|
}
|
|
152
154
|
setOverflowButtonVisible(t2) {
|
|
153
155
|
this.overflowButton && (this.overflowButton.classList.toggle("notectl-toolbar-overflow-btn--hidden", !t2), t2 || this.overflowButton.removeAttribute("tabindex"));
|
|
@@ -186,8 +188,8 @@ class v {
|
|
|
186
188
|
r2.type = "button", r2.className = "notectl-dropdown__item", r2.setAttribute("role", "menuitem"), r2.setAttribute("tabindex", "-1"), r2.setAttribute("data-toolbar-item", n2.item.id);
|
|
187
189
|
const i2 = document.createElement("span");
|
|
188
190
|
i2.className = "notectl-dropdown__item-icon", "combobox" !== n2.item.popupType && (i2.innerHTML = n2.item.icon), r2.appendChild(i2);
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
+
const l2 = document.createElement("span");
|
|
192
|
+
l2.className = "notectl-dropdown__item-label", l2.textContent = "combobox" === n2.item.popupType ? n2.item.getLabel(e2) : n2.item.tooltip ?? n2.item.label, r2.appendChild(l2), r2.addEventListener("mousedown", (t3) => {
|
|
191
193
|
t3.preventDefault(), t3.stopPropagation(), this.activateOverflowItem(n2);
|
|
192
194
|
}), t2.appendChild(r2);
|
|
193
195
|
}
|
|
@@ -195,7 +197,7 @@ class v {
|
|
|
195
197
|
positionDropdown(t2) {
|
|
196
198
|
if (!this.overflowButton) return;
|
|
197
199
|
const e2 = this.overflowButton.getBoundingClientRect(), o2 = window.innerWidth - e2.right;
|
|
198
|
-
t2
|
|
200
|
+
d(t2, { position: "fixed", top: `${e2.bottom + 2}px`, right: `${o2}px`, left: "auto", zIndex: "10000" });
|
|
199
201
|
}
|
|
200
202
|
registerCloseHandler() {
|
|
201
203
|
this.closeHandler = (t2) => {
|
|
@@ -248,28 +250,28 @@ class v {
|
|
|
248
250
|
for (let e2 = t2.length - 1; e2 >= 0; e2--) {
|
|
249
251
|
const o2 = t2[e2];
|
|
250
252
|
if (o2 && o2 !== this.overflowButton) {
|
|
251
|
-
if (o2.classList.contains("notectl-toolbar-separator")) o2.classList.contains(
|
|
252
|
-
else if (!o2.classList.contains(
|
|
253
|
+
if (o2.classList.contains("notectl-toolbar-separator")) o2.classList.contains(g) || o2.classList.add(g);
|
|
254
|
+
else if (!o2.classList.contains(v)) break;
|
|
253
255
|
}
|
|
254
256
|
}
|
|
255
257
|
}
|
|
256
258
|
notifyChange() {
|
|
257
|
-
const t2 = this.entries.filter((t3) => !t3.element.classList.contains(
|
|
259
|
+
const t2 = this.entries.filter((t3) => !t3.element.classList.contains(v)).map((t3) => t3.element);
|
|
258
260
|
this.onOverflowChange(t2, this.overflowEntries.length > 0 ? this.overflowButton : null);
|
|
259
261
|
}
|
|
260
262
|
}
|
|
261
|
-
function
|
|
263
|
+
function x(t2, e2, o2) {
|
|
262
264
|
const n2 = t2.querySelectorAll(".notectl-grid-picker__cell");
|
|
263
265
|
for (const t3 of n2) {
|
|
264
266
|
const n3 = Number(t3.getAttribute("data-row")), r2 = Number(t3.getAttribute("data-col"));
|
|
265
267
|
t3.classList.toggle("notectl-grid-picker__cell--highlighted", n3 <= e2 && r2 <= o2);
|
|
266
268
|
}
|
|
267
269
|
}
|
|
268
|
-
function
|
|
270
|
+
function y() {
|
|
269
271
|
const t2 = document.createElement("span");
|
|
270
272
|
return t2.className = "notectl-toolbar-separator", t2.setAttribute("role", "separator"), t2;
|
|
271
273
|
}
|
|
272
|
-
class
|
|
274
|
+
class E {
|
|
273
275
|
activePopup = null;
|
|
274
276
|
activePopupButton = null;
|
|
275
277
|
activeHandle = null;
|
|
@@ -285,7 +287,7 @@ class x {
|
|
|
285
287
|
return null !== this.activePopup;
|
|
286
288
|
}
|
|
287
289
|
toggle(t2, e2, o2) {
|
|
288
|
-
this.activePopup ? this.close() : this.
|
|
290
|
+
this.activePopup ? this.close() : this.openViaManager(t2, e2, o2);
|
|
289
291
|
}
|
|
290
292
|
close() {
|
|
291
293
|
if (this.activeHandle) {
|
|
@@ -308,39 +310,24 @@ class x {
|
|
|
308
310
|
this.activePopup = t3, this.renderPopupContent(t3, e2, o2, n2), t3.addEventListener("keydown", (t4) => this.handlePopupKeydown(t4));
|
|
309
311
|
} }));
|
|
310
312
|
}
|
|
311
|
-
openLegacy(t2, e2, o2) {
|
|
312
|
-
const n2 = document.createElement("div");
|
|
313
|
-
n2.className = "notectl-toolbar-popup", this.renderPopupContent(n2, e2, o2, () => this.close()), this.positionAndAppend(n2, t2), this.activePopup = n2, this.activePopupButton = t2, t2.classList.add("notectl-toolbar-btn--popup-open"), t2.setAttribute("aria-expanded", "true"), this.focusFirstItem(n2), n2.addEventListener("keydown", (t3) => this.handlePopupKeydown(t3));
|
|
314
|
-
const r2 = (e3) => {
|
|
315
|
-
const o3 = e3.composedPath();
|
|
316
|
-
o3.includes(n2) || o3.includes(t2) || this.close();
|
|
317
|
-
};
|
|
318
|
-
setTimeout(() => {
|
|
319
|
-
document.addEventListener("mousedown", r2);
|
|
320
|
-
}, 0), n2.dataset.legacyClose = "true";
|
|
321
|
-
const i2 = this.close.bind(this);
|
|
322
|
-
this.close = () => {
|
|
323
|
-
document.removeEventListener("mousedown", r2), this.close = i2, i2();
|
|
324
|
-
};
|
|
325
|
-
}
|
|
326
313
|
renderPopupContent(t2, e2, o2, n2) {
|
|
327
314
|
switch (e2.popupType) {
|
|
328
315
|
case "gridPicker":
|
|
329
316
|
!(function(t3, e3, o3) {
|
|
330
317
|
t3.className += " notectl-grid-picker";
|
|
331
318
|
const n3 = document.createElement("div");
|
|
332
|
-
n3.className = "notectl-grid-picker__grid", n3.setAttribute("role", "grid"), n3
|
|
319
|
+
n3.className = "notectl-grid-picker__grid", n3.setAttribute("role", "grid"), d(n3, { display: "grid", gridTemplateColumns: `repeat(${e3.maxCols}, 1fr)`, gap: "2px", padding: "8px" });
|
|
333
320
|
const r2 = document.createElement("div");
|
|
334
|
-
r2.className = "notectl-grid-picker__label", r2.textContent = "1 x 1", r2
|
|
321
|
+
r2.className = "notectl-grid-picker__label", r2.textContent = "1 x 1", d(r2, { textAlign: "center", padding: "4px", fontSize: "12px" }), r2.setAttribute("aria-live", "polite");
|
|
335
322
|
for (let t4 = 1; t4 <= e3.maxRows; t4++) for (let i2 = 1; i2 <= e3.maxCols; i2++) {
|
|
336
|
-
const
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
}),
|
|
323
|
+
const l2 = document.createElement("div");
|
|
324
|
+
l2.className = "notectl-grid-picker__cell", l2.setAttribute("role", "gridcell"), l2.setAttribute("tabindex", "-1"), l2.setAttribute("aria-label", `${t4} x ${i2}`), d(l2, { width: "20px", height: "20px", border: "1px solid #ccc", cursor: "pointer" }), l2.setAttribute("data-row", String(t4)), l2.setAttribute("data-col", String(i2)), l2.addEventListener("mouseenter", () => {
|
|
325
|
+
x(n3, t4, i2), r2.textContent = `${t4} x ${i2}`;
|
|
326
|
+
}), l2.addEventListener("mousedown", (n4) => {
|
|
340
327
|
n4.preventDefault(), n4.stopPropagation(), e3.onSelect(t4, i2), o3();
|
|
341
|
-
}),
|
|
328
|
+
}), l2.addEventListener("click", () => {
|
|
342
329
|
e3.onSelect(t4, i2), o3();
|
|
343
|
-
}), n3.appendChild(
|
|
330
|
+
}), n3.appendChild(l2);
|
|
344
331
|
}
|
|
345
332
|
t3.appendChild(n3), t3.appendChild(r2);
|
|
346
333
|
})(t2, e2.popupConfig, n2);
|
|
@@ -371,18 +358,6 @@ class x {
|
|
|
371
358
|
clearButtonState() {
|
|
372
359
|
this.activePopupButton && (this.activePopupButton.classList.remove("notectl-toolbar-btn--popup-open"), this.activePopupButton.setAttribute("aria-expanded", "false"), this.activePopupButton = null);
|
|
373
360
|
}
|
|
374
|
-
positionAndAppend(t2, e2) {
|
|
375
|
-
const o2 = e2.getBoundingClientRect();
|
|
376
|
-
t2.style.position = "fixed", t2.style.top = `${o2.bottom + 2}px`, t2.style.left = `${o2.left}px`, t2.style.zIndex = "10000";
|
|
377
|
-
const n2 = e2.getRootNode();
|
|
378
|
-
n2 instanceof ShadowRoot ? n2.appendChild(t2) : document.body.appendChild(t2);
|
|
379
|
-
}
|
|
380
|
-
focusFirstItem(t2) {
|
|
381
|
-
requestAnimationFrame(() => {
|
|
382
|
-
const e2 = t2.querySelector('[role="menuitem"]') ?? t2.querySelector(".notectl-grid-picker__cell") ?? t2.querySelector("button");
|
|
383
|
-
e2?.focus();
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
361
|
handlePopupKeydown(t2) {
|
|
387
362
|
if (!this.activePopup) return;
|
|
388
363
|
if ("Escape" === t2.key) return t2.preventDefault(), t2.stopPropagation(), void this.closeAndRestoreFocus();
|
|
@@ -417,13 +392,13 @@ class x {
|
|
|
417
392
|
handleGridKeydown(t2) {
|
|
418
393
|
const e2 = this.getActiveElement(), o2 = Number(e2?.getAttribute("data-row") ?? 1), n2 = Number(e2?.getAttribute("data-col") ?? 1), r2 = this.activePopup?.querySelector(".notectl-grid-picker__grid") ?? null;
|
|
419
394
|
if (!r2) return;
|
|
420
|
-
const
|
|
395
|
+
const l2 = r2.querySelector(".notectl-grid-picker__cell:last-child"), s2 = Number(l2?.getAttribute("data-col") ?? 1), a2 = Number(l2?.getAttribute("data-row") ?? 1);
|
|
421
396
|
if (["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(t2.key)) {
|
|
422
397
|
t2.preventDefault();
|
|
423
|
-
const [e3,
|
|
424
|
-
c2?.focus(),
|
|
398
|
+
const [e3, l3] = i(o2, n2, a2, s2, t2.key), c2 = r2.querySelector(`.notectl-grid-picker__cell[data-row="${e3}"][data-col="${l3}"]`);
|
|
399
|
+
c2?.focus(), x(r2, e3, l3);
|
|
425
400
|
const d2 = this.activePopup?.querySelector(".notectl-grid-picker__label") ?? null;
|
|
426
|
-
d2 && (d2.textContent = `${e3} x ${
|
|
401
|
+
d2 && (d2.textContent = `${e3} x ${l3}`);
|
|
427
402
|
}
|
|
428
403
|
"Enter" !== t2.key && " " !== t2.key || (t2.preventDefault(), e2?.click());
|
|
429
404
|
}
|
|
@@ -451,36 +426,36 @@ class x {
|
|
|
451
426
|
}
|
|
452
427
|
}
|
|
453
428
|
}
|
|
454
|
-
class
|
|
429
|
+
class A {
|
|
455
430
|
element;
|
|
456
431
|
timer = null;
|
|
457
432
|
target = null;
|
|
458
433
|
isPopupActive;
|
|
459
434
|
static TOOLTIP_ID = "notectl-toolbar-tooltip";
|
|
460
435
|
constructor(t2) {
|
|
461
|
-
this.isPopupActive = t2, this.element = document.createElement("div"), this.element.className = "notectl-toolbar-tooltip", this.element.id =
|
|
436
|
+
this.isPopupActive = t2, this.element = document.createElement("div"), this.element.className = "notectl-toolbar-tooltip", this.element.id = A.TOOLTIP_ID, this.element.setAttribute("role", "tooltip"), p(this.element, "display", "none");
|
|
462
437
|
}
|
|
463
438
|
show(t2) {
|
|
464
439
|
if (this.hide(), this.isPopupActive() || t2.disabled) return;
|
|
465
440
|
const e2 = t2.getAttribute("data-tooltip");
|
|
466
441
|
e2 && (this.target = t2, this.timer = setTimeout(() => {
|
|
467
442
|
if (this.isPopupActive()) return;
|
|
468
|
-
this.element.textContent = e2, this.element
|
|
443
|
+
this.element.textContent = e2, p(this.element, "display", "");
|
|
469
444
|
const o2 = t2.getRootNode();
|
|
470
|
-
o2 instanceof ShadowRoot && !this.element.parentNode ? o2.appendChild(this.element) : o2 instanceof ShadowRoot || this.element.parentNode || document.body.appendChild(this.element), t2.setAttribute("aria-describedby",
|
|
445
|
+
o2 instanceof ShadowRoot && !this.element.parentNode ? o2.appendChild(this.element) : o2 instanceof ShadowRoot || this.element.parentNode || document.body.appendChild(this.element), t2.setAttribute("aria-describedby", A.TOOLTIP_ID);
|
|
471
446
|
const n2 = t2.getBoundingClientRect();
|
|
472
|
-
this.element
|
|
447
|
+
d(this.element, { position: "fixed", top: `${n2.bottom + 6}px`, left: `${n2.left + n2.width / 2}px`, transform: "translateX(-50%)" });
|
|
473
448
|
}, 500));
|
|
474
449
|
}
|
|
475
450
|
hide() {
|
|
476
|
-
this.timer && (clearTimeout(this.timer), this.timer = null), this.target && (this.target.removeAttribute("aria-describedby"), this.target = null), this.element
|
|
451
|
+
this.timer && (clearTimeout(this.timer), this.timer = null), this.target && (this.target.removeAttribute("aria-describedby"), this.target = null), p(this.element, "display", "none");
|
|
477
452
|
}
|
|
478
453
|
destroy() {
|
|
479
454
|
this.hide(), this.element.remove();
|
|
480
455
|
}
|
|
481
456
|
}
|
|
482
|
-
const
|
|
483
|
-
class
|
|
457
|
+
const k = new t("toolbar");
|
|
458
|
+
class C {
|
|
484
459
|
id = "toolbar";
|
|
485
460
|
name = "Toolbar";
|
|
486
461
|
priority = 10;
|
|
@@ -498,10 +473,10 @@ class E {
|
|
|
498
473
|
visibleElements = [];
|
|
499
474
|
locale;
|
|
500
475
|
constructor(t2) {
|
|
501
|
-
this.layoutConfig = t2 ?? null, this.overflowBehavior = t2?.overflow ??
|
|
476
|
+
this.layoutConfig = t2 ?? null, this.overflowBehavior = t2?.overflow ?? f.BurgerMenu;
|
|
502
477
|
}
|
|
503
478
|
init(t2) {
|
|
504
|
-
this.locale = e(
|
|
479
|
+
this.locale = e(m, t2), t2.registerStyleSheet(`
|
|
505
480
|
/* Toolbar */
|
|
506
481
|
.notectl-plugin-container--top {
|
|
507
482
|
display: flex;
|
|
@@ -545,9 +520,11 @@ class E {
|
|
|
545
520
|
transition: background 0.1s, border-color 0.1s;
|
|
546
521
|
}
|
|
547
522
|
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
523
|
+
@media (hover: hover) {
|
|
524
|
+
.notectl-toolbar-btn:hover {
|
|
525
|
+
background: var(--notectl-hover-bg);
|
|
526
|
+
border-color: var(--notectl-border);
|
|
527
|
+
}
|
|
551
528
|
}
|
|
552
529
|
|
|
553
530
|
.notectl-toolbar-btn--active {
|
|
@@ -566,9 +543,11 @@ class E {
|
|
|
566
543
|
cursor: not-allowed;
|
|
567
544
|
}
|
|
568
545
|
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
546
|
+
@media (hover: hover) {
|
|
547
|
+
.notectl-toolbar-btn:disabled:hover {
|
|
548
|
+
background: transparent;
|
|
549
|
+
border-color: transparent;
|
|
550
|
+
}
|
|
572
551
|
}
|
|
573
552
|
|
|
574
553
|
.notectl-toolbar-btn__icon {
|
|
@@ -653,12 +632,14 @@ class E {
|
|
|
653
632
|
white-space: nowrap;
|
|
654
633
|
}
|
|
655
634
|
|
|
656
|
-
|
|
657
|
-
.notectl-dropdown__item:
|
|
658
|
-
|
|
635
|
+
@media (hover: hover) {
|
|
636
|
+
.notectl-dropdown__item:hover {
|
|
637
|
+
background: var(--notectl-hover-bg);
|
|
638
|
+
}
|
|
659
639
|
}
|
|
660
640
|
|
|
661
641
|
.notectl-dropdown__item:focus-visible {
|
|
642
|
+
background: var(--notectl-hover-bg);
|
|
662
643
|
outline: none;
|
|
663
644
|
}
|
|
664
645
|
|
|
@@ -714,9 +695,11 @@ class E {
|
|
|
714
695
|
transition: background 0.1s, border-color 0.1s;
|
|
715
696
|
}
|
|
716
697
|
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
698
|
+
@media (hover: hover) {
|
|
699
|
+
.notectl-toolbar-overflow-btn:hover {
|
|
700
|
+
background: var(--notectl-hover-bg);
|
|
701
|
+
border-color: var(--notectl-border);
|
|
702
|
+
}
|
|
720
703
|
}
|
|
721
704
|
|
|
722
705
|
.notectl-toolbar-overflow-btn--hidden {
|
|
@@ -734,8 +717,10 @@ class E {
|
|
|
734
717
|
cursor: not-allowed;
|
|
735
718
|
}
|
|
736
719
|
|
|
737
|
-
|
|
738
|
-
|
|
720
|
+
@media (hover: hover) {
|
|
721
|
+
.notectl-dropdown__item:disabled:hover {
|
|
722
|
+
background: none;
|
|
723
|
+
}
|
|
739
724
|
}
|
|
740
725
|
|
|
741
726
|
.notectl-dropdown__item--active {
|
|
@@ -765,9 +750,11 @@ class E {
|
|
|
765
750
|
background: var(--notectl-bg);
|
|
766
751
|
}
|
|
767
752
|
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
753
|
+
@media (hover: hover) {
|
|
754
|
+
.notectl-toolbar-btn[role="combobox"]:hover {
|
|
755
|
+
background: var(--notectl-hover-bg);
|
|
756
|
+
border-color: var(--notectl-fg-muted);
|
|
757
|
+
}
|
|
771
758
|
}
|
|
772
759
|
|
|
773
760
|
.notectl-toolbar-btn[role="combobox"].notectl-toolbar-btn--active {
|
|
@@ -831,15 +818,17 @@ class E {
|
|
|
831
818
|
margin-top: 4px;
|
|
832
819
|
}
|
|
833
820
|
|
|
834
|
-
|
|
835
|
-
|
|
821
|
+
@media (hover: hover) {
|
|
822
|
+
.notectl-link-popup__button:hover {
|
|
823
|
+
background: var(--notectl-hover-bg);
|
|
824
|
+
}
|
|
836
825
|
}
|
|
837
826
|
|
|
838
827
|
.notectl-link-popup__button:focus-visible {
|
|
839
828
|
outline: 2px solid var(--notectl-focus-ring);
|
|
840
829
|
outline-offset: -1px;
|
|
841
830
|
}
|
|
842
|
-
`), this.context = t2, this.popupManager = new
|
|
831
|
+
`), this.context = t2, this.popupManager = new h(t2.getContainer()), t2.registerService(u, this.popupManager), this.popupController = new E(() => this.getActiveElement()), this.popupController.setPopupManager(this.popupManager), this.tooltip = new A(() => this.popupController?.isOpen() ?? false), t2.registerService(k, { refresh: () => this.updateButtonStates(t2.getState()), closePopup: () => this.popupController?.close() }), this.createToolbarElement();
|
|
843
832
|
}
|
|
844
833
|
getOverflowBehavior() {
|
|
845
834
|
return this.overflowBehavior;
|
|
@@ -870,7 +859,7 @@ class E {
|
|
|
870
859
|
this.toolbarElement = document.createElement("div"), this.toolbarElement.setAttribute("role", "toolbar"), this.toolbarElement.setAttribute("aria-label", this.locale.formattingOptionsAria), this.toolbarElement.setAttribute("data-notectl-no-print", ""), this.toolbarElement.className = "notectl-toolbar", this.toolbarElement.addEventListener("keydown", (t3) => this.handleToolbarKeydown(t3)), this.applyOverflowBehavior(), t2.appendChild(this.toolbarElement);
|
|
871
860
|
}
|
|
872
861
|
applyOverflowBehavior() {
|
|
873
|
-
this.toolbarElement && this.context && (this.overflowController?.destroy(), this.overflowController = null, this.toolbarElement.setAttribute("data-overflow", this.overflowBehavior), this.overflowBehavior ===
|
|
862
|
+
this.toolbarElement && this.context && (this.overflowController?.destroy(), this.overflowController = null, this.toolbarElement.setAttribute("data-overflow", this.overflowBehavior), this.overflowBehavior === f.BurgerMenu ? this.overflowController = new w({ toolbar: this.toolbarElement, ariaLabel: this.locale.moreToolsAria, context: this.context, popupManager: this.popupManager ?? void 0, onOverflowChange: (t2, e2) => {
|
|
874
863
|
this.visibleElements = e2 ? [...t2, e2] : [...t2], this.initRovingTabindex();
|
|
875
864
|
}, onItemActivated: (t2, e2) => {
|
|
876
865
|
this.activateButton(t2, e2);
|
|
@@ -888,12 +877,12 @@ class E {
|
|
|
888
877
|
return this.visibleElements.length > 0 ? this.visibleElements : this.buttons.map((t2) => t2.element);
|
|
889
878
|
}
|
|
890
879
|
initRovingTabindex() {
|
|
891
|
-
const t2 = this.getTabElements(), e2 =
|
|
892
|
-
this.focusedIndex = e2 >= 0 ? e2 : 0,
|
|
880
|
+
const t2 = this.getTabElements(), e2 = l(t2);
|
|
881
|
+
this.focusedIndex = e2 >= 0 ? e2 : 0, s(t2, this.focusedIndex);
|
|
893
882
|
}
|
|
894
883
|
setRovingFocus(t2) {
|
|
895
884
|
const e2 = this.getTabElements();
|
|
896
|
-
t2 < 0 || t2 >= e2.length || (this.focusedIndex = t2,
|
|
885
|
+
t2 < 0 || t2 >= e2.length || (this.focusedIndex = t2, s(e2, t2), e2[t2]?.focus());
|
|
897
886
|
}
|
|
898
887
|
getActiveElement() {
|
|
899
888
|
const t2 = this.toolbarElement?.getRootNode();
|
|
@@ -920,7 +909,7 @@ class E {
|
|
|
920
909
|
}
|
|
921
910
|
case "Home": {
|
|
922
911
|
t2.preventDefault();
|
|
923
|
-
const o2 =
|
|
912
|
+
const o2 = l(e2);
|
|
924
913
|
o2 >= 0 && this.setRovingFocus(o2);
|
|
925
914
|
break;
|
|
926
915
|
}
|
|
@@ -953,7 +942,7 @@ class E {
|
|
|
953
942
|
o3.sort((t3, e4) => (t3.priority ?? 100) - (e4.priority ?? 100)), n2.push(...o3);
|
|
954
943
|
}
|
|
955
944
|
if (0 !== n2.length) {
|
|
956
|
-
e2 || this.toolbarElement.appendChild(
|
|
945
|
+
e2 || this.toolbarElement.appendChild(y()), e2 = false;
|
|
957
946
|
for (const t3 of n2) {
|
|
958
947
|
const e3 = this.createButton(t3);
|
|
959
948
|
this.toolbarElement.appendChild(e3.element), this.buttons.push(e3);
|
|
@@ -971,7 +960,7 @@ class E {
|
|
|
971
960
|
const o2 = e2[t3];
|
|
972
961
|
if (!o2) continue;
|
|
973
962
|
const n2 = this.createButton(o2);
|
|
974
|
-
this.toolbarElement.appendChild(n2.element), this.buttons.push(n2), o2.separatorAfter && t3 < e2.length - 1 && this.toolbarElement.appendChild(
|
|
963
|
+
this.toolbarElement.appendChild(n2.element), this.buttons.push(n2), o2.separatorAfter && t3 < e2.length - 1 && this.toolbarElement.appendChild(y());
|
|
975
964
|
}
|
|
976
965
|
else {
|
|
977
966
|
const t3 = /* @__PURE__ */ new Map();
|
|
@@ -981,7 +970,7 @@ class E {
|
|
|
981
970
|
}
|
|
982
971
|
let o2 = true;
|
|
983
972
|
for (const [, e3] of t3) {
|
|
984
|
-
o2 || this.toolbarElement.appendChild(
|
|
973
|
+
o2 || this.toolbarElement.appendChild(y()), o2 = false;
|
|
985
974
|
for (const t4 of e3) {
|
|
986
975
|
const e4 = this.createButton(t4);
|
|
987
976
|
this.toolbarElement.appendChild(e4.element), this.buttons.push(e4);
|
|
@@ -1019,12 +1008,12 @@ class E {
|
|
|
1019
1008
|
}
|
|
1020
1009
|
}
|
|
1021
1010
|
export {
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1011
|
+
h as P,
|
|
1012
|
+
C as T,
|
|
1013
|
+
u as a,
|
|
1014
|
+
m as b,
|
|
1015
|
+
b as c,
|
|
1016
|
+
f as d,
|
|
1017
|
+
k as e
|
|
1029
1018
|
};
|
|
1030
|
-
//# sourceMappingURL=
|
|
1019
|
+
//# sourceMappingURL=index-BcDRT4K2.mjs.map
|