@fileverse-dev/ddoc 4.6.5-ps.1 → 4.6.5
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/{index-CtY7xa2V.mjs → index-S8OhvrAi.mjs} +19158 -19733
- package/dist/{index-Bm6q0fMZ.mjs → index-cYPrdQNO.mjs} +1 -1
- package/dist/index.es.js +1 -1
- package/dist/{markdown-source-pane-BiQqa-dc.mjs → markdown-source-pane-C9C86Ki_.mjs} +1 -1
- package/dist/package/components/editor-bubble-menu/props.d.ts +0 -13
- package/dist/package/components/editor-toolbar/line-height.d.ts +1 -3
- package/dist/package/components/editor-utils.d.ts +1 -2
- package/dist/package/extensions/line-height.d.ts +0 -7
- package/dist/package/hooks/use-editor-commands.d.ts +1 -1
- package/dist/package/utils/typography.d.ts +0 -56
- package/dist/{split-view-toolbar-CYN12s4i.mjs → split-view-toolbar-oNIzrpyR.mjs} +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -3
- package/dist/package/components/editor-toolbar/custom-spacing-dialog.d.ts +0 -14
- package/dist/package/components/editor-toolbar/spacing-toggles.d.ts +0 -30
- package/dist/package/extensions/docx/docx-spacing.d.ts +0 -39
- package/dist/package/extensions/paragraph-spacing.d.ts +0 -31
- package/dist/package/stores/custom-spacing-store.d.ts +0 -14
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@fileverse-dev/ddoc",
|
|
3
3
|
"private": false,
|
|
4
4
|
"description": "DDoc",
|
|
5
|
-
"version": "4.6.5
|
|
5
|
+
"version": "4.6.5",
|
|
6
6
|
"main": "dist/index.es.js",
|
|
7
7
|
"module": "dist/index.es.js",
|
|
8
8
|
"exports": {
|
|
@@ -99,7 +99,6 @@
|
|
|
99
99
|
"highlight.js": "^11.11.1",
|
|
100
100
|
"html2pdf.js": "^0.14.0",
|
|
101
101
|
"js-base64": "^3.7.7",
|
|
102
|
-
"jszip": "^3.10.1",
|
|
103
102
|
"katex": "^0.16.11",
|
|
104
103
|
"lib0": "^0.2.95",
|
|
105
104
|
"lowlight": "^3.3.0",
|
|
@@ -180,4 +179,4 @@
|
|
|
180
179
|
"vitest": "^2.1.0",
|
|
181
180
|
"yjs": "13.6.30"
|
|
182
181
|
}
|
|
183
|
-
}
|
|
182
|
+
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/core';
|
|
2
|
-
|
|
3
|
-
export declare const CustomSpacingDialog: ({ editor, open, onOpenChange, }: {
|
|
4
|
-
editor: Editor | null;
|
|
5
|
-
open: boolean;
|
|
6
|
-
onOpenChange: (open: boolean) => void;
|
|
7
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
/**
|
|
9
|
-
* The single mounted instance, wired to the store. Subscribing here rather
|
|
10
|
-
* than at the mount site keeps the open/close re-render off the editor tree.
|
|
11
|
-
*/
|
|
12
|
-
export declare const CustomSpacingDialogHost: ({ editor, }: {
|
|
13
|
-
editor: Editor | null;
|
|
14
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/core';
|
|
2
|
-
|
|
3
|
-
export type SpacingToggle = {
|
|
4
|
-
edge: 'before' | 'after';
|
|
5
|
-
label: string;
|
|
6
|
-
onSelect: () => void;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Write one half of the toggle.
|
|
10
|
-
*
|
|
11
|
-
* Both halves write an explicit value. Removing writes 0, because null hands
|
|
12
|
-
* the block back to the stylesheet — the very gap being removed. Adding writes
|
|
13
|
-
* SPACING_ADD_PT for the mirror-image reason: "Add" is only offered when the
|
|
14
|
-
* stylesheet already gives nothing, so null would leave it at zero.
|
|
15
|
-
*
|
|
16
|
-
* Exported so the second-level nav's registry entry writes exactly what the
|
|
17
|
-
* toolbar dropdown and bubble menu write, without rebuilding the toggle list.
|
|
18
|
-
*/
|
|
19
|
-
export declare const applySpacingToggle: (editor: Editor | null, edge: "before" | "after", action: "add" | "remove") => boolean | undefined;
|
|
20
|
-
/** The menu wording for one half, shared so every surface reads identically. */
|
|
21
|
-
export declare const spacingToggleLabel: (edge: "before" | "after", action: "add" | "remove") => string;
|
|
22
|
-
/**
|
|
23
|
-
* The Google Docs "Add / Remove space before|after paragraph" pair, shared by
|
|
24
|
-
* the toolbar dropdown and the bubble menu so the label logic exists once.
|
|
25
|
-
*
|
|
26
|
-
* The label reflects what the block actually renders with, stylesheet
|
|
27
|
-
* included, so a fresh paragraph offers "Remove" first — its gap comes from
|
|
28
|
-
* editor.css rather than from an attribute.
|
|
29
|
-
*/
|
|
30
|
-
export declare const getSpacingToggles: (editor: Editor | null) => SpacingToggle[];
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Paragraph spacing read straight out of the OOXML.
|
|
3
|
-
*
|
|
4
|
-
* Mammoth is a *semantic* converter — its README is explicit that it uses "the
|
|
5
|
-
* semantic information in the document, and ignoring other details" — so it
|
|
6
|
-
* never parses w:spacing at all. Structure still comes from mammoth; only the
|
|
7
|
-
* presentational values we model are read here, from the same arrayBuffer.
|
|
8
|
-
*/
|
|
9
|
-
export type DocxParagraphSpacing = {
|
|
10
|
-
spaceBefore: number | null;
|
|
11
|
-
spaceAfter: number | null;
|
|
12
|
-
lineHeight: string | null;
|
|
13
|
-
/** Paragraph text, used to verify alignment against mammoth's output. */
|
|
14
|
-
text: string;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* One entry per w:p, in document order — the same order mammoth emits its
|
|
18
|
-
* blocks in, which is what makes them zippable.
|
|
19
|
-
*/
|
|
20
|
-
export declare const readDocxSpacing: (documentXml: string, stylesXml: string) => DocxParagraphSpacing[];
|
|
21
|
-
/**
|
|
22
|
-
* Zip the spacing onto mammoth's HTML as inline styles, which the LineHeight
|
|
23
|
-
* and ParagraphSpacing attributes already parse back on import.
|
|
24
|
-
*
|
|
25
|
-
* Alignment is positional, so it is verified rather than trusted: mammoth
|
|
26
|
-
* relocates text boxes and appends footnotes, and `ignoreEmptyParagraphs`
|
|
27
|
-
* has to stay off for the counts to line up at all. On any divergence the
|
|
28
|
-
* HTML is returned untouched — no spacing is better than spacing on the
|
|
29
|
-
* wrong paragraphs, which is silent and hard to trace.
|
|
30
|
-
*/
|
|
31
|
-
export declare const applyDocxSpacingToHtml: (html: string, spacings: DocxParagraphSpacing[]) => string;
|
|
32
|
-
/**
|
|
33
|
-
* Read the spacing out of the .docx archive and zip it onto mammoth's HTML.
|
|
34
|
-
*
|
|
35
|
-
* Reuses the arrayBuffer mammoth is already given, so the file is not read
|
|
36
|
-
* twice. Every failure path returns the original HTML: losing spacing is
|
|
37
|
-
* recoverable, losing the import is not.
|
|
38
|
-
*/
|
|
39
|
-
export declare const readDocxSpacingFromArchive: (arrayBuffer: ArrayBuffer, html: string) => Promise<string>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Extension } from '@tiptap/core';
|
|
2
|
-
|
|
3
|
-
export type ParagraphSpacingAttrs = {
|
|
4
|
-
/** Space above the block, in pt. `null` unsets it; omit to leave as-is. */
|
|
5
|
-
spaceBefore?: number | null;
|
|
6
|
-
/** Space below the block, in pt. `null` unsets it; omit to leave as-is. */
|
|
7
|
-
spaceAfter?: number | null;
|
|
8
|
-
};
|
|
9
|
-
declare module '@tiptap/core' {
|
|
10
|
-
interface Commands<ReturnType> {
|
|
11
|
-
paragraphSpacing: {
|
|
12
|
-
/**
|
|
13
|
-
* Set space before/after on the blocks in the current selection.
|
|
14
|
-
*/
|
|
15
|
-
setParagraphSpacing: (attrs: ParagraphSpacingAttrs) => ReturnType;
|
|
16
|
-
/**
|
|
17
|
-
* Clear both space before and space after on the current selection.
|
|
18
|
-
*/
|
|
19
|
-
unsetParagraphSpacing: () => ReturnType;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* `spaceBefore` / `spaceAfter` as inline margins, in pt.
|
|
25
|
-
*
|
|
26
|
-
* Unlike `lineHeight`, the default is `null` — an untouched block renders no
|
|
27
|
-
* inline margin at all, so the stylesheet in editor.css (including its
|
|
28
|
-
* responsive overrides and :first-child resets) stays in charge. `0` is a
|
|
29
|
-
* distinct, explicit value: it renders `margin-*: 0` and overrides that CSS.
|
|
30
|
-
*/
|
|
31
|
-
export declare const ParagraphSpacing: Extension<any, any>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
type Store = {
|
|
2
|
-
isCustomSpacingOpen: boolean;
|
|
3
|
-
setCustomSpacingOpen: (val: boolean) => void;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Open/closed state for the one CustomSpacingDialog, which ddoc-editor mounts.
|
|
7
|
-
* Module-level like search-replace-store: the entry points are scattered (the
|
|
8
|
-
* toolbar dropdown, the bubble menu, and a host app's own menu rendered
|
|
9
|
-
* outside the editor tree), so they share a flag rather than each owning a
|
|
10
|
-
* dialog instance.
|
|
11
|
-
*/
|
|
12
|
-
export declare const useCustomSpacingStore: import('zustand').UseBoundStore<import('zustand').StoreApi<Store>>;
|
|
13
|
-
export declare const openCustomSpacingDialog: () => void;
|
|
14
|
-
export {};
|