@harbour-enterprises/superdoc 0.20.0-next.13 → 0.20.0-next.15
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 +4 -4
- package/dist/chunks/{PdfViewer-Beoed5G0.es.js → PdfViewer-D3gJ5ozH.es.js} +1 -1
- package/dist/chunks/{PdfViewer-Dh2tr2ag.cjs → PdfViewer-DuEWa8ox.cjs} +1 -1
- package/dist/chunks/{index-BFe2eMYK.cjs → index-D2h9q27o.cjs} +32 -9
- package/dist/chunks/{index-OC4NDn1G.es.js → index-DiSIyVKk.es.js} +32 -9
- package/dist/chunks/{super-editor.es-cgub83Px.es.js → super-editor.es-4Ig7dBJr.es.js} +2901 -902
- package/dist/chunks/{super-editor.es-4ltXjey_.cjs → super-editor.es-lzaBZOn2.cjs} +2901 -902
- package/dist/core/SuperDoc.d.ts.map +1 -1
- package/dist/stores/comments-store.d.ts.map +1 -1
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-CTJIyTAA.js → converter-BJVy6JMW.js} +1996 -657
- package/dist/super-editor/chunks/{docx-zipper-BwicJKh2.js → docx-zipper-DWDJGX0b.js} +1 -1
- package/dist/super-editor/chunks/{editor-B97u3IuY.js → editor-BUCOmU2Y.js} +1027 -411
- package/dist/super-editor/chunks/{toolbar-BcdsHEOP.js → toolbar-CiBIcgiI.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/src/components/toolbar/format-negation.d.ts +5 -0
- package/dist/super-editor/src/core/commands/index.d.ts +1 -0
- package/dist/super-editor/src/core/commands/toggleMarkCascade.d.ts +42 -0
- package/dist/super-editor/src/core/commands/types/index.d.ts +29 -1
- package/dist/super-editor/src/core/super-converter/SuperConverter.d.ts +5 -0
- package/dist/super-editor/src/core/super-converter/exporter.d.ts +8 -0
- package/dist/super-editor/src/core/super-converter/helpers.d.ts +2 -0
- package/dist/super-editor/src/core/super-converter/v2/importer/markImporter.d.ts +12 -0
- package/dist/super-editor/src/core/super-converter/v2/importer/runNodeImporter.d.ts +6 -6
- package/dist/super-editor/src/core/super-converter/v3/handlers/constants/east-asian-regex.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/constants/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/index.d.ts +2 -12
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/b/attributes/index.d.ts +3 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/b/attributes/w-val.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/b/b-translator.d.ts +7 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/b/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/color/attributes/index.d.ts +2 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/color/attributes/w-theme-color.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/color/attributes/w-theme-shade.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/color/attributes/w-theme-tint.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/color/attributes/w-val.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/color/color-translator.d.ts +7 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/highlight/attributes/index.d.ts +2 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/highlight/attributes/w-val.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/highlight/highlight-translator.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/i/attributes/index.d.ts +2 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/i/attributes/w-val.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/i/i-translator.d.ts +7 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/r/attributes/index.d.ts +2 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/r/attributes/w-rsid-del.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/r/attributes/w-rsid-r-pr.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/r/attributes/w-rsid-r.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/r/helpers/helpers.d.ts +40 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/r/helpers/index.d.ts +3 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/r/helpers/split-run-properties.d.ts +9 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/r/helpers/track-change-helpers.d.ts +5 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/r/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/r/r-translator.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/rFonts/attributes/index.d.ts +2 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/rFonts/attributes/w-ascii.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/rFonts/attributes/w-cs.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/rFonts/attributes/w-east-asia.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/rFonts/attributes/w-hansi.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/rFonts/attributes/w-val.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/rFonts/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/rFonts/rFonts-translator.d.ts +5 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/rStyle/attributes/index.d.ts +2 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/rStyle/attributes/w-val.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/rStyle/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/rStyle/rstyle-translator.d.ts +7 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/rpr/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/rpr/rpr-translator.d.ts +5 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/rpr/run-property-translators.d.ts +11 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/strike/attributes/index.d.ts +2 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/strike/attributes/w-val.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/strike/strike-translator.d.ts +7 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/sz/attributes/index.d.ts +2 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/sz/attributes/w-val.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/sz/sz-translator.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/szcs/attributes/index.d.ts +2 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/szcs/attributes/w-val.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/szcs/szcs-translator.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/u/attributes/index.d.ts +2 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/u/attributes/w-color.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/u/attributes/w-theme-color.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/u/attributes/w-theme-shade.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/u/attributes/w-theme-tint.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/u/attributes/w-val.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/u/u-translator.d.ts +7 -0
- package/dist/super-editor/src/extensions/index.d.ts +2 -2
- package/dist/super-editor/src/extensions/linked-styles/index.d.ts +1 -0
- package/dist/super-editor/src/extensions/linked-styles/underline-css.d.ts +17 -0
- package/dist/super-editor/src/extensions/list-item/helpers/listItemTypography.d.ts +62 -0
- package/dist/super-editor/src/extensions/run/commands/index.d.ts +1 -0
- package/dist/super-editor/src/extensions/run/commands/split-run.d.ts +1 -0
- package/dist/super-editor/src/extensions/run/index.d.ts +1 -0
- package/dist/super-editor/src/extensions/run/run.d.ts +6 -0
- package/dist/super-editor/src/extensions/shared/cascade-toggle.d.ts +8 -0
- package/dist/super-editor/src/extensions/tab/helpers/tabDecorations.d.ts +12 -0
- package/dist/super-editor/src/extensions/tab/tab.d.ts +4 -0
- package/dist/super-editor/src/tests/helpers/getParagraphText.d.ts +2 -0
- package/dist/super-editor/super-editor.es.js +90 -21
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +2933 -911
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +7 -4
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** @type {import('@translator').NodeTranslatorConfig} */
|
|
2
|
+
export const config: import("@translator").NodeTranslatorConfig;
|
|
3
|
+
/**
|
|
4
|
+
* The NodeTranslator instance for the w:u element.
|
|
5
|
+
* @type {import('@translator').NodeTranslator}
|
|
6
|
+
*/
|
|
7
|
+
export const translator: import("@translator").NodeTranslator;
|
|
@@ -2,7 +2,7 @@ import { History } from './history/index.js';
|
|
|
2
2
|
import { Heading } from './heading/index.js';
|
|
3
3
|
import { Document } from './document/index.js';
|
|
4
4
|
import { Text } from './text/index.js';
|
|
5
|
-
import {
|
|
5
|
+
import { Run } from './run/index.js';
|
|
6
6
|
import { BulletList } from './bullet-list/index.js';
|
|
7
7
|
import { OrderedList } from './ordered-list/index.js';
|
|
8
8
|
import { ListItem } from './list-item/index.js';
|
|
@@ -63,4 +63,4 @@ import { DocumentSection } from './structured-content/index.js';
|
|
|
63
63
|
import { NodeResizer } from './noderesizer/index.js';
|
|
64
64
|
import { CustomSelection } from './custom-selection/index.js';
|
|
65
65
|
import { TextTransform } from './text-transform/index.js';
|
|
66
|
-
export { History, Heading, Document, Text,
|
|
66
|
+
export { History, Heading, Document, Text, Run, BulletList, OrderedList, ListItem, Paragraph, CommentRangeStart, CommentRangeEnd, CommentReference, TabNode, LineBreak, HardBreak, Bold, Italic, Underline, Highlight, Strike, Color, FontFamily, FontSize, TextAlign, TextIndent, TextStyle, LineHeight, FormatCommands, CommentsPlugin, Gapcursor, Table, TableRow, TableCell, TableHeader, Placeholder, DropCursor, BlockNode, FieldAnnotation, fieldAnnotationHelpers, Image, BookmarkStart, BookmarkEnd, PopoverPlugin, Mention, Collaboration, CollaborationCursor, TrackChanges, TrackInsert, TrackDelete, TrackFormat, CommentsMark, trackChangesHelpers, AiMark, AiAnimationMark, AiLoaderNode, AiPlugin, Search, StructuredContent, StructuredContentBlock, DocumentSection, NodeResizer, CustomSelection, TextTransform };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Map OOXML underline types to CSS text-decoration properties.
|
|
3
|
+
* Returns a CSS style string (kebab-case) suitable for inline decorations.
|
|
4
|
+
*
|
|
5
|
+
* @param {Object} params
|
|
6
|
+
* @param {string} [params.type='single'] - OOXML w:u@w:val value
|
|
7
|
+
* @param {string|null} [params.color=null] - CSS color (e.g., '#RRGGBB')
|
|
8
|
+
* @param {string|null} [params.thickness=null] - Optional explicit thickness (e.g., '0.2em', '2px')
|
|
9
|
+
* @param {boolean} [params.approximate=true] - Whether to approximate non-standard styles
|
|
10
|
+
* @returns {string} CSS style string (e.g., 'text-decoration-line: underline; text-decoration-style: dashed;')
|
|
11
|
+
*/
|
|
12
|
+
export function getUnderlineCssString({ type, color, thickness, approximate }?: {
|
|
13
|
+
type?: string;
|
|
14
|
+
color?: string | null;
|
|
15
|
+
thickness?: string | null;
|
|
16
|
+
approximate?: boolean;
|
|
17
|
+
}): string;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collect textStyle marks within a list item node.
|
|
3
|
+
* @param {Node} listItem
|
|
4
|
+
* @param {MarkType} markType
|
|
5
|
+
* @returns {{ marks: Array, attrs: { lineHeight?: string } }}
|
|
6
|
+
*/
|
|
7
|
+
export function collectTextStyleMarks(listItem: Node, markType: MarkType): {
|
|
8
|
+
marks: any[];
|
|
9
|
+
attrs: {
|
|
10
|
+
lineHeight?: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export function parseSizeFromRunProperties(listRunProperties: any): string;
|
|
14
|
+
export function parseFontFamilyFromRunProperties(listRunProperties: any): any;
|
|
15
|
+
export function readNodeViewStyles(view: any): {
|
|
16
|
+
fontSize: any;
|
|
17
|
+
fontFamily: any;
|
|
18
|
+
lineHeight: any;
|
|
19
|
+
};
|
|
20
|
+
export function getAdjacentListItemNodeView({ nodeView, pos, direction, activeNodeViews }: {
|
|
21
|
+
nodeView: any;
|
|
22
|
+
pos: any;
|
|
23
|
+
direction: any;
|
|
24
|
+
activeNodeViews: any;
|
|
25
|
+
}): any;
|
|
26
|
+
export function findSiblingListItem({ editor, pos, direction }: {
|
|
27
|
+
editor: any;
|
|
28
|
+
pos: any;
|
|
29
|
+
direction: any;
|
|
30
|
+
}): any;
|
|
31
|
+
export function deriveFontStylesFromNode({ node, textStyleType, defaultFont, defaultSize, listRunProperties }: {
|
|
32
|
+
node: any;
|
|
33
|
+
textStyleType: any;
|
|
34
|
+
defaultFont: any;
|
|
35
|
+
defaultSize: any;
|
|
36
|
+
listRunProperties: any;
|
|
37
|
+
}): {
|
|
38
|
+
fontSize: any;
|
|
39
|
+
fontFamily: any;
|
|
40
|
+
lineHeight: string;
|
|
41
|
+
hasSize: boolean;
|
|
42
|
+
hasFamily: boolean;
|
|
43
|
+
};
|
|
44
|
+
export function getStylesFromLinkedStyles({ node, pos, editor }: {
|
|
45
|
+
node: any;
|
|
46
|
+
pos: any;
|
|
47
|
+
editor: any;
|
|
48
|
+
}): {
|
|
49
|
+
font: any;
|
|
50
|
+
size: any;
|
|
51
|
+
};
|
|
52
|
+
export function resolveListItemTypography({ node, pos, editor, nodeView, activeNodeViews }: {
|
|
53
|
+
node: any;
|
|
54
|
+
pos: any;
|
|
55
|
+
editor: any;
|
|
56
|
+
nodeView: any;
|
|
57
|
+
activeNodeViews: any;
|
|
58
|
+
}): {
|
|
59
|
+
fontSize: any;
|
|
60
|
+
fontFamily: any;
|
|
61
|
+
lineHeight: string;
|
|
62
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./split-run.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function splitRun(): import("@core/commands/types").Command;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./run.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run node emulates OOXML w:r (run) boundaries while remaining transparent to layout.
|
|
3
|
+
* It carries run-level metadata (runProperties, rsid attributes) without affecting visual style.
|
|
4
|
+
*/
|
|
5
|
+
export const Run: OxmlNode;
|
|
6
|
+
import { OxmlNode } from '@core/index.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility helpers for cascade-aware mark toggles.
|
|
3
|
+
*/
|
|
4
|
+
export function createCascadeToggleCommands({ markName, setCommand, unsetCommand, toggleCommand, negationAttrs, isNegation, extendEmptyMarkRange, }?: {}): {
|
|
5
|
+
[x: number]: () => ({ commands }: {
|
|
6
|
+
commands: any;
|
|
7
|
+
}) => any;
|
|
8
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function getParagraphContext($pos: any, cache: any): any;
|
|
2
|
+
export function flattenParagraph(paragraph: any, paragraphStartPos: any): any[];
|
|
3
|
+
export function findNextTabIndex(flattened: any, fromIndex: any): any;
|
|
4
|
+
export function findDecimalBreakPos(flattened: any, startIndex: any, breakChar: any): any;
|
|
5
|
+
export function measureRangeWidth(view: any, from: any, to: any): number;
|
|
6
|
+
export function getIndentWidth(view: any, paragraphStartPos: any, indentAttrs?: {}): number;
|
|
7
|
+
export function calculateIndentFallback(indentAttrs?: {}): number;
|
|
8
|
+
export function getLeftCoord(view: any, pos: any): any;
|
|
9
|
+
export function calcTabHeight(pos: any): string;
|
|
10
|
+
export const defaultTabDistance: 48;
|
|
11
|
+
export const defaultLineLength: 816;
|
|
12
|
+
export function getTabDecorations(doc: any, view: any, from?: number, to?: any): any[];
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
* @snippetPath /snippets/extensions/tab.mdx
|
|
17
17
|
*/
|
|
18
18
|
export const TabNode: Node;
|
|
19
|
+
export namespace __testing__ {
|
|
20
|
+
export { getTabDecorations };
|
|
21
|
+
}
|
|
19
22
|
/**
|
|
20
23
|
* Configuration options for TabNode
|
|
21
24
|
*/
|
|
@@ -25,3 +28,4 @@ export type TabNodeOptions = any;
|
|
|
25
28
|
*/
|
|
26
29
|
export type TabNodeAttributes = any;
|
|
27
30
|
import { Node } from '@core/index.js';
|
|
31
|
+
import { getTabDecorations } from './helpers/tabDecorations.js';
|
|
@@ -9,14 +9,14 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
9
9
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
10
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
11
11
|
var _SuperToolbar_instances, initToolbarGroups_fn, _interceptedCommands, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, runCommandWithArgumentOnly_fn;
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, d as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, e as uploadAndInsertImage, y as yUndoPluginKey, f as undoDepth, h as redoDepth, S as SlashMenuPluginKey, E as Editor, i as getStarterExtensions, P as Placeholder, j as getRichTextExtensions, M as Mark, k as Extension, A as Attribute, N as Node } from "./chunks/editor-
|
|
15
|
-
import { n, C, o, T, l, p, m } from "./chunks/editor-
|
|
12
|
+
import { av as getDefaultExportFromCjs, V as v4, T as TextSelection$1, v as getMarkRange, ay as vClickOutside, H as findParentNode, az as getActiveFormatting, ap as isInTable, aA as readFromClipboard, aB as handleClipboardPaste, aC as getFileObject, aD as runPropertyTranslators, aE as translator, aF as translator$1, aG as translator$2, aH as translator$3, aI as translator$4, aJ as translator$5, aK as translator$6, aL as translator$7, aM as translator$8, aN as translator$9, aO as translator$a, aP as translator$b, aQ as translator$c, aR as translator$d, aS as translator$e, aT as translator$f, aU as translator$g, aV as translator$h, aW as translator$i, aX as translator$j, aY as translator$k, aZ as translator$l, a_ as translator$m, a$ as translator$n, b0 as translator$o, b1 as translator$p, a as Plugin } from "./chunks/converter-BJVy6JMW.js";
|
|
13
|
+
import { b2, a5, i, a2 } from "./chunks/converter-BJVy6JMW.js";
|
|
14
|
+
import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, d as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, e as uploadAndInsertImage, y as yUndoPluginKey, f as undoDepth, h as redoDepth, S as SlashMenuPluginKey, E as Editor, i as getStarterExtensions, P as Placeholder, j as getRichTextExtensions, M as Mark, k as Extension, A as Attribute, N as Node } from "./chunks/editor-BUCOmU2Y.js";
|
|
15
|
+
import { n, C, o, T, l, p, m } from "./chunks/editor-BUCOmU2Y.js";
|
|
16
16
|
import { ref, onMounted, createElementBlock, openBlock, normalizeClass, unref, Fragment, renderList, createElementVNode, withModifiers, toDisplayString, createCommentVNode, normalizeStyle, computed, watch, withDirectives, withKeys, vModelText, createTextVNode, createVNode, h, createApp, markRaw, nextTick, onBeforeUnmount, reactive, onUnmounted, renderSlot, shallowRef, createBlock, withCtx, resolveDynamicComponent, normalizeProps, guardReactiveProps } from "vue";
|
|
17
|
-
import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, m as magicWandIcon, p as plusIconSvg, a as trashIconSvg, l as linkIconSvg, b as tableIconSvg, c as scissorsIconSvg, d as copyIconSvg, e as pasteIconSvg, f as borderNoneIconSvg, g as arrowsToDotIconSvg, h as arrowsLeftRightIconSvg, w as wrenchIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-
|
|
17
|
+
import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, m as magicWandIcon, p as plusIconSvg, a as trashIconSvg, l as linkIconSvg, b as tableIconSvg, c as scissorsIconSvg, d as copyIconSvg, e as pasteIconSvg, f as borderNoneIconSvg, g as arrowsToDotIconSvg, h as arrowsLeftRightIconSvg, w as wrenchIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-CiBIcgiI.js";
|
|
18
18
|
import AIWriter from "./ai-writer.es.js";
|
|
19
|
-
import { D } from "./chunks/docx-zipper-
|
|
19
|
+
import { D } from "./chunks/docx-zipper-DWDJGX0b.js";
|
|
20
20
|
import { createZip } from "./file-zipper.es.js";
|
|
21
21
|
var eventemitter3 = { exports: {} };
|
|
22
22
|
var hasRequiredEventemitter3;
|
|
@@ -2504,6 +2504,38 @@ const toolbarTexts = {
|
|
|
2504
2504
|
documentViewingModeDescription: "View clean version of document only",
|
|
2505
2505
|
linkedStyles: "Linked styles"
|
|
2506
2506
|
};
|
|
2507
|
+
const isOffValue = (value) => {
|
|
2508
|
+
if (value == null) return false;
|
|
2509
|
+
const normalized = String(value).toLowerCase();
|
|
2510
|
+
return normalized === "0" || normalized === "false" || normalized === "off";
|
|
2511
|
+
};
|
|
2512
|
+
const negationChecks = {
|
|
2513
|
+
bold: (attrs = {}) => isOffValue(attrs.value),
|
|
2514
|
+
italic: (attrs = {}) => isOffValue(attrs.value),
|
|
2515
|
+
strike: (attrs = {}) => isOffValue(attrs.value),
|
|
2516
|
+
underline: (attrs = {}) => {
|
|
2517
|
+
const type = attrs.underlineType ?? attrs.value;
|
|
2518
|
+
if (type == null) return false;
|
|
2519
|
+
const normalized = String(type).toLowerCase();
|
|
2520
|
+
return normalized === "none" || isOffValue(normalized);
|
|
2521
|
+
},
|
|
2522
|
+
color: (attrs = {}) => {
|
|
2523
|
+
const value = attrs.color;
|
|
2524
|
+
if (value == null) return true;
|
|
2525
|
+
return String(value).toLowerCase() === "inherit";
|
|
2526
|
+
},
|
|
2527
|
+
highlight: (attrs = {}) => {
|
|
2528
|
+
const value = attrs.color;
|
|
2529
|
+
if (value == null) return true;
|
|
2530
|
+
const normalized = String(value).toLowerCase();
|
|
2531
|
+
return normalized === "transparent" || normalized === "none";
|
|
2532
|
+
}
|
|
2533
|
+
};
|
|
2534
|
+
const isNegatedMark = (name, attrs = {}) => {
|
|
2535
|
+
const checker = negationChecks[name];
|
|
2536
|
+
if (typeof checker !== "function") return false;
|
|
2537
|
+
return Boolean(checker(attrs));
|
|
2538
|
+
};
|
|
2507
2539
|
class SuperToolbar extends EventEmitter {
|
|
2508
2540
|
/**
|
|
2509
2541
|
* Creates a new SuperToolbar instance
|
|
@@ -2606,10 +2638,14 @@ class SuperToolbar extends EventEmitter {
|
|
|
2606
2638
|
* @param {string} params.argument - The color to set
|
|
2607
2639
|
* @returns {void}
|
|
2608
2640
|
*/
|
|
2609
|
-
setColor: ({
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2641
|
+
setColor: ({ argument }) => {
|
|
2642
|
+
if (!argument || !this.activeEditor) return;
|
|
2643
|
+
const isNone = argument === "none";
|
|
2644
|
+
const value = isNone ? "inherit" : argument;
|
|
2645
|
+
if (this.activeEditor?.commands?.setColor) this.activeEditor.commands.setColor(value);
|
|
2646
|
+
const argValue = isNone ? null : argument;
|
|
2647
|
+
this.activeEditor?.commands.setFieldAnnotationsTextColor(argValue, true);
|
|
2648
|
+
this.updateToolbarState();
|
|
2613
2649
|
},
|
|
2614
2650
|
/**
|
|
2615
2651
|
* Sets the highlight color for text
|
|
@@ -2618,12 +2654,14 @@ class SuperToolbar extends EventEmitter {
|
|
|
2618
2654
|
* @param {string} params.argument - The highlight color to set
|
|
2619
2655
|
* @returns {void}
|
|
2620
2656
|
*/
|
|
2621
|
-
setHighlight: ({
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2657
|
+
setHighlight: ({ argument }) => {
|
|
2658
|
+
if (!argument || !this.activeEditor) return;
|
|
2659
|
+
const inlineColor = argument !== "none" ? argument : "transparent";
|
|
2660
|
+
if (this.activeEditor?.commands?.setHighlight) this.activeEditor.commands.setHighlight(inlineColor);
|
|
2661
|
+
const argValue = argument !== "none" ? argument : null;
|
|
2662
|
+
this.activeEditor?.commands.setFieldAnnotationsTextHighlight(argValue, true);
|
|
2663
|
+
this.activeEditor?.commands.setCellBackground(argValue);
|
|
2664
|
+
this.updateToolbarState();
|
|
2627
2665
|
},
|
|
2628
2666
|
/**
|
|
2629
2667
|
* Toggles the ruler visibility
|
|
@@ -2944,14 +2982,16 @@ class SuperToolbar extends EventEmitter {
|
|
|
2944
2982
|
return item.activate();
|
|
2945
2983
|
}
|
|
2946
2984
|
}
|
|
2947
|
-
const
|
|
2985
|
+
const rawActiveMark = marks.find((mark) => mark.name === item.name.value);
|
|
2986
|
+
const markNegated = rawActiveMark ? isNegatedMark(rawActiveMark.name, rawActiveMark.attrs) : false;
|
|
2987
|
+
const activeMark = markNegated ? null : rawActiveMark;
|
|
2948
2988
|
if (activeMark) {
|
|
2949
2989
|
item.activate(activeMark.attrs);
|
|
2950
2990
|
} else {
|
|
2951
2991
|
item.deactivate();
|
|
2952
2992
|
}
|
|
2953
2993
|
const styleIdMark = marks.find((mark) => mark.name === "styleId");
|
|
2954
|
-
if (!activeMark && styleIdMark?.attrs.styleId) {
|
|
2994
|
+
if (!activeMark && !markNegated && styleIdMark?.attrs.styleId) {
|
|
2955
2995
|
const markToStyleMap = {
|
|
2956
2996
|
fontSize: "font-size",
|
|
2957
2997
|
fontFamily: "font-family",
|
|
@@ -3009,7 +3049,6 @@ class SuperToolbar extends EventEmitter {
|
|
|
3009
3049
|
if (!command) {
|
|
3010
3050
|
return;
|
|
3011
3051
|
}
|
|
3012
|
-
this.log("(emmitCommand) Command:", command, "\n item:", item, "\n argument:", argument, "\n option:", option);
|
|
3013
3052
|
if (command in __privateGet(this, _interceptedCommands)) {
|
|
3014
3053
|
return __privateGet(this, _interceptedCommands)[command]({ item, argument });
|
|
3015
3054
|
}
|
|
@@ -4617,6 +4656,36 @@ const _sfc_main = {
|
|
|
4617
4656
|
}
|
|
4618
4657
|
};
|
|
4619
4658
|
const SuperInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4d5cff52"]]);
|
|
4659
|
+
const baseHandlers = {
|
|
4660
|
+
...runPropertyTranslators,
|
|
4661
|
+
"w:br": translator$p,
|
|
4662
|
+
"w:cantSplit": translator$o,
|
|
4663
|
+
"w:cnfStyle": translator$n,
|
|
4664
|
+
"w:divId": translator$m,
|
|
4665
|
+
"w:gridAfter": translator$l,
|
|
4666
|
+
"w:gridBefore": translator$k,
|
|
4667
|
+
"w:hidden": translator$j,
|
|
4668
|
+
"w:hyperlink": translator$i,
|
|
4669
|
+
"w:jc": translator$h,
|
|
4670
|
+
"w:p": translator$g,
|
|
4671
|
+
"w:r": translator$f,
|
|
4672
|
+
"w:rPr": translator$e,
|
|
4673
|
+
"w:sdt": translator$d,
|
|
4674
|
+
"w:tab": translator$c,
|
|
4675
|
+
"w:tblCellSpacing": translator$b,
|
|
4676
|
+
"w:tblHeader": translator$a,
|
|
4677
|
+
"w:tc": translator$9,
|
|
4678
|
+
"w:tr": translator$8,
|
|
4679
|
+
"w:trHeight": translator$7,
|
|
4680
|
+
"w:trPr": translator$6,
|
|
4681
|
+
"w:wAfter": translator$5,
|
|
4682
|
+
"w:wBefore": translator$4,
|
|
4683
|
+
"wp:anchor": translator$3,
|
|
4684
|
+
"wp:inline": translator$2,
|
|
4685
|
+
"w:bookmarkStart": translator$1,
|
|
4686
|
+
"w:bookmarkEnd": translator
|
|
4687
|
+
};
|
|
4688
|
+
const registeredHandlers = Object.freeze(baseHandlers);
|
|
4620
4689
|
const Extensions = {
|
|
4621
4690
|
Node,
|
|
4622
4691
|
Attribute,
|
|
@@ -4627,7 +4696,7 @@ const Extensions = {
|
|
|
4627
4696
|
export {
|
|
4628
4697
|
AIWriter,
|
|
4629
4698
|
n as AnnotatorHelpers,
|
|
4630
|
-
|
|
4699
|
+
b2 as BasicUpload,
|
|
4631
4700
|
C as CommentsPluginKey,
|
|
4632
4701
|
D as DocxZipper,
|
|
4633
4702
|
Editor,
|
|
@@ -4648,6 +4717,6 @@ export {
|
|
|
4648
4717
|
getRichTextExtensions,
|
|
4649
4718
|
getStarterExtensions,
|
|
4650
4719
|
a2 as helpers,
|
|
4651
|
-
|
|
4720
|
+
registeredHandlers,
|
|
4652
4721
|
m as trackChangesHelpers
|
|
4653
4722
|
};
|
package/dist/super-editor.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const superEditor_es = require("./chunks/super-editor.es-
|
|
3
|
+
const superEditor_es = require("./chunks/super-editor.es-lzaBZOn2.cjs");
|
|
4
4
|
require("./chunks/vue-DWle4Cai.cjs");
|
|
5
5
|
exports.AIWriter = superEditor_es.AIWriter;
|
|
6
6
|
exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
|
package/dist/super-editor.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, a, _, C, D, E, b, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-
|
|
1
|
+
import { A, a, _, C, D, E, b, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-4Ig7dBJr.es.js";
|
|
2
2
|
import "./chunks/vue-CXxsqYcP.es.js";
|
|
3
3
|
export {
|
|
4
4
|
A as AIWriter,
|
package/dist/superdoc.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const superEditor_es = require("./chunks/super-editor.es-
|
|
4
|
-
const superdoc = require("./chunks/index-
|
|
3
|
+
const superEditor_es = require("./chunks/super-editor.es-lzaBZOn2.cjs");
|
|
4
|
+
const superdoc = require("./chunks/index-D2h9q27o.cjs");
|
|
5
5
|
require("./chunks/vue-DWle4Cai.cjs");
|
|
6
6
|
require("./chunks/jszip-b7l8QkfH.cjs");
|
|
7
7
|
const blankDocx = require("./chunks/blank-docx-CPqX9RF5.cjs");
|
package/dist/superdoc.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-
|
|
2
|
-
import { D, H, P, S as S2, m, l } from "./chunks/index-
|
|
1
|
+
import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-4Ig7dBJr.es.js";
|
|
2
|
+
import { D, H, P, S as S2, m, l } from "./chunks/index-DiSIyVKk.es.js";
|
|
3
3
|
import "./chunks/vue-CXxsqYcP.es.js";
|
|
4
4
|
import "./chunks/jszip-B8KIZSNe.es.js";
|
|
5
5
|
import { B } from "./chunks/blank-docx-iwdyG9RH.es.js";
|