@fileverse-dev/ddoc 4.6.5-ps.0 → 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/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-ps.0",
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,21 +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
- * The Google Docs "Add / Remove space before|after paragraph" pair, shared by
10
- * the toolbar dropdown and the bubble menu so the label logic exists once.
11
- *
12
- * The label reflects what the block actually renders with, stylesheet
13
- * included, so a fresh paragraph offers "Remove" first — its gap comes from
14
- * editor.css rather than from an attribute.
15
- *
16
- * Both halves write an explicit value. Removing writes 0, because null hands
17
- * the block back to the stylesheet — the very gap being removed. Adding writes
18
- * SPACING_ADD_PT for the mirror-image reason: "Add" is only offered when the
19
- * stylesheet already gives nothing, so null would leave it at zero.
20
- */
21
- 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 {};