@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as Ql, b as Zl, s as eh } from "./index-
|
|
1
|
+
import { k as Ql, b as Zl, s as eh } from "./index-S8OhvrAi.mjs";
|
|
2
2
|
let An = [], Xr = [];
|
|
3
3
|
(() => {
|
|
4
4
|
let s = "lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,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44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((e) => e ? parseInt(e, 36) : 1);
|
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as a, a as o, E as t, P as d, f as r, i, g as n, j as m, h as E, m as c, e as l, l as p, c as u, d as C, u as f, v as D } from "./index-
|
|
1
|
+
import { D as a, a as o, E as t, P as d, f as r, i, g as n, j as m, h as E, m as c, e as l, l as p, c as u, d as C, u as f, v as D } from "./index-S8OhvrAi.mjs";
|
|
2
2
|
export {
|
|
3
3
|
a as DdocEditor,
|
|
4
4
|
o as DdocExportModal,
|
|
@@ -3,7 +3,7 @@ var Wr = (t, e, O) => e in t ? Vr(t, e, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var gt = (t, e, O) => Wr(t, typeof e != "symbol" ? e + "" : e, O);
|
|
4
4
|
import { jsx as Cr } from "react/jsx-runtime";
|
|
5
5
|
import { useRef as pe, useEffect as St } from "react";
|
|
6
|
-
import { s as y, A as pO, T as dO, a as Gr, S as et, b as Lr, P as fO, E as j, i as QO, c as _, D as le, k as tt, F as Ar, M as Pt, W as Er, R as Ur, d as mO, N as oe, e as V, f as Mr, g as Ot, h as ce, p as $O, j as Y, t as h, l as Ir, I as rt, L as at, m as ye, n as ue, o as Qe, q as gO, r as te, u as SO, v as Br, w as Nr, x as PO, y as kO, z as Dr, B as Fr, C as Kr, G as Oe, H as ZO, J as Jr, K as kt, O as Hr, Q as ea, U as ta, V as Oa, X as ra, Y as aa, Z as ia, _ as sa, $ as na, a0 as la, a1 as oa, a2 as ca } from "./index-
|
|
6
|
+
import { s as y, A as pO, T as dO, a as Gr, S as et, b as Lr, P as fO, E as j, i as QO, c as _, D as le, k as tt, F as Ar, M as Pt, W as Er, R as Ur, d as mO, N as oe, e as V, f as Mr, g as Ot, h as ce, p as $O, j as Y, t as h, l as Ir, I as rt, L as at, m as ye, n as ue, o as Qe, q as gO, r as te, u as SO, v as Br, w as Nr, x as PO, y as kO, z as Dr, B as Fr, C as Kr, G as Oe, H as ZO, J as Jr, K as kt, O as Hr, Q as ea, U as ta, V as Oa, X as ra, Y as aa, Z as ia, _ as sa, $ as na, a0 as la, a1 as oa, a2 as ca } from "./index-cYPrdQNO.mjs";
|
|
7
7
|
class ua {
|
|
8
8
|
/**
|
|
9
9
|
Create a new completion context. (Mostly useful for testing
|
|
@@ -5,16 +5,3 @@ export declare const shouldShow: ({ editor }: {
|
|
|
5
5
|
editor: Editor;
|
|
6
6
|
}) => boolean;
|
|
7
7
|
export declare const shouldShowIgnoringFocus: (editor: Editor) => boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Whether the bubble menu should take itself out of the way.
|
|
10
|
-
*
|
|
11
|
-
* It floats at an inline `z-index: 61` while @fileverse/ui dialogs stack at
|
|
12
|
-
* `z-50`, so a modal cannot paint over it — anything that owns the screen has
|
|
13
|
-
* to hide the menu explicitly or it overlaps the dialog.
|
|
14
|
-
*/
|
|
15
|
-
export declare const isBubbleMenuHidden: ({ isCommentOpen, isLinkPopupOpen, isBubbleMenuSuppressed, isCustomSpacingOpen, }: {
|
|
16
|
-
isCommentOpen: boolean;
|
|
17
|
-
isLinkPopupOpen: boolean;
|
|
18
|
-
isBubbleMenuSuppressed: boolean;
|
|
19
|
-
isCustomSpacingOpen: boolean;
|
|
20
|
-
}) => boolean;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/core';
|
|
2
1
|
import { IEditorToolElement } from '../editor-utils';
|
|
3
2
|
|
|
4
|
-
export declare const LineHeightDropdown: ({ tool,
|
|
3
|
+
export declare const LineHeightDropdown: ({ tool, currentLineHeight, onSetLineHeight, }: {
|
|
5
4
|
tool: IEditorToolElement;
|
|
6
|
-
editor: Editor | null;
|
|
7
5
|
currentLineHeight?: string;
|
|
8
6
|
onSetLineHeight: (lineHeight: string) => void;
|
|
9
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -150,13 +150,12 @@ export declare const FontSizePicker: ({ editor, setVisibility, elementRef, curre
|
|
|
150
150
|
currentSize?: string;
|
|
151
151
|
onSetFontSize: (fontSize: string) => void;
|
|
152
152
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
153
|
-
export declare const LineHeightPicker: ({
|
|
153
|
+
export declare const LineHeightPicker: ({ setVisibility, elementRef, currentLineHeight, onSetLineHeight, }: {
|
|
154
154
|
editor: Editor;
|
|
155
155
|
elementRef: React.RefObject<HTMLDivElement>;
|
|
156
156
|
setVisibility: Dispatch<SetStateAction<IEditorTool>>;
|
|
157
157
|
currentLineHeight?: string;
|
|
158
158
|
onSetLineHeight: (lineHeight: string) => void;
|
|
159
|
-
onOpenCustomSpacing?: () => void;
|
|
160
159
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
161
160
|
export declare const TextFormatingPopup: ({ editor, isOpen, setIsOpen, setToolVisibility, }: {
|
|
162
161
|
editor: Editor | null;
|
|
@@ -18,12 +18,5 @@ declare module '@tiptap/core' {
|
|
|
18
18
|
* Carrying the current line-height onto the next block is handled by the
|
|
19
19
|
* dBlock `Enter` handler (extensions/d-block/dblock.ts), alongside the
|
|
20
20
|
* fontFamily/fontSize persistence — not by an inheritance plugin here.
|
|
21
|
-
*
|
|
22
|
-
* Scope is selection-based, like textAlign: a collapsed cursor styles the block
|
|
23
|
-
* it sits in, and whole-document is Cmd+A. It used to restyle the entire
|
|
24
|
-
* document on a collapsed cursor, which stopped being defensible once the
|
|
25
|
-
* selection-scoped "Custom spacing" item joined these presets in one dropdown.
|
|
26
21
|
*/
|
|
27
|
-
/** 1.15 in the UI. Exported so serializers can tell "default" from "authored". */
|
|
28
|
-
export declare const DEFAULT_LINE_HEIGHT = "138%";
|
|
29
22
|
export declare const LineHeight: Extension<any, any>;
|
|
@@ -7,7 +7,7 @@ export type EditorCommand = {
|
|
|
7
7
|
isEnabled: boolean;
|
|
8
8
|
current?: string | null;
|
|
9
9
|
};
|
|
10
|
-
export type EditorCommandId = 'edit.undo' | 'edit.redo' | 'edit.selectAll' | 'edit.cut' | 'edit.copy' | 'edit.paste' | 'edit.pasteWithoutFormatting' | 'edit.delete' | 'edit.findReplace' | 'insert.image' | 'insert.table' | 'insert.link' | 'insert.comment' | 'insert.callout' | 'insert.quote' | 'insert.code' | 'insert.codeBlock' | 'insert.video' | 'insert.mermaid' | 'insert.plainText' | 'insert.tweet' | 'insert.soundcloud' | 'insert.divider' | 'insert.pageBreak' | 'insert.columns2' | 'insert.columns3' | 'format.bold' | 'format.italic' | 'format.underline' | 'format.strike' | 'format.superscript' | 'format.subscript' | 'format.heading' | 'format.align' | 'format.direction' | 'format.lineHeight' | 'format.
|
|
10
|
+
export type EditorCommandId = 'edit.undo' | 'edit.redo' | 'edit.selectAll' | 'edit.cut' | 'edit.copy' | 'edit.paste' | 'edit.pasteWithoutFormatting' | 'edit.delete' | 'edit.findReplace' | 'insert.image' | 'insert.table' | 'insert.link' | 'insert.comment' | 'insert.callout' | 'insert.quote' | 'insert.code' | 'insert.codeBlock' | 'insert.video' | 'insert.mermaid' | 'insert.plainText' | 'insert.tweet' | 'insert.soundcloud' | 'insert.divider' | 'insert.pageBreak' | 'insert.columns2' | 'insert.columns3' | 'format.bold' | 'format.italic' | 'format.underline' | 'format.strike' | 'format.superscript' | 'format.subscript' | 'format.heading' | 'format.align' | 'format.direction' | 'format.lineHeight' | 'format.fontFamily' | 'format.fontSize.increase' | 'format.fontSize.decrease' | 'format.list.bullet' | 'format.list.numbered' | 'format.list.check' | 'format.clearFormatting' | 'table.addRowAbove' | 'table.addRowBelow' | 'table.mergeCells' | 'table.deleteRow' | 'table.addColumnLeft' | 'table.addColumnRight' | 'table.deleteColumn' | 'table.toggleHeaderRow' | 'table.toggleHeaderColumn' | 'table.toggleHeaderCell' | 'table.deleteTable';
|
|
11
11
|
export type UseEditorCommandsOptions = UploadImageOptions;
|
|
12
12
|
/**
|
|
13
13
|
* Reactive, editor-derived command registry (architecture doc §2 bucket 1).
|
|
@@ -10,14 +10,6 @@ export declare const getFontSizeOptions: (editor?: Editor) => {
|
|
|
10
10
|
}[];
|
|
11
11
|
export declare const getCurrentFontSize: (editor: Editor | null, currentSize: string) => string;
|
|
12
12
|
export declare const uiValueToPercentage: (uiValue: string) => string;
|
|
13
|
-
/**
|
|
14
|
-
* CSS line-height comes in three shapes and ddoc stores percentages, so the
|
|
15
|
-
* attribute needs one meaning. A unitless ratio is exactly percentage / 100,
|
|
16
|
-
* so it normalises losslessly — Google Docs pastes `line-height:1.38`, which
|
|
17
|
-
* is `138%`. Absolute units cannot become a ratio without knowing the font
|
|
18
|
-
* size, so they are passed through untouched rather than guessed at.
|
|
19
|
-
*/
|
|
20
|
-
export declare const normalizeLineHeight: (value: string | null | undefined) => string | null;
|
|
21
13
|
export declare const percentageToUiValue: (percentage: string) => string;
|
|
22
14
|
export declare const LINE_HEIGHT_OPTIONS: {
|
|
23
15
|
value: string;
|
|
@@ -31,52 +23,4 @@ export declare const getLineHeightOptions: () => {
|
|
|
31
23
|
uiValue: string;
|
|
32
24
|
description: string;
|
|
33
25
|
}[];
|
|
34
|
-
export declare const SPACING_MIN_PT = 0;
|
|
35
|
-
export declare const SPACING_MAX_PT = 100;
|
|
36
|
-
/**
|
|
37
|
-
* What "Add space before/after paragraph" writes, matching Google Docs.
|
|
38
|
-
*
|
|
39
|
-
* A real value rather than null: null would hand the block back to the
|
|
40
|
-
* stylesheet, and the toggle only offers "Add" when the stylesheet is already
|
|
41
|
-
* giving it nothing — so restoring null would leave the gap at zero and the
|
|
42
|
-
* menu item would appear to do nothing.
|
|
43
|
-
*/
|
|
44
|
-
export declare const SPACING_ADD_PT = 12;
|
|
45
|
-
/** A value shared by every block in the selection, or `'mixed'`. */
|
|
46
|
-
export type SpacingReading<T> = T | 'mixed';
|
|
47
|
-
export type SpacingSelection = {
|
|
48
|
-
spaceBefore: SpacingReading<number | null>;
|
|
49
|
-
spaceAfter: SpacingReading<number | null>;
|
|
50
|
-
lineHeight: SpacingReading<string | null>;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Read spacing across the current selection, the single place the dialog and
|
|
54
|
-
* any read-back should use. `'mixed'` means the selected blocks disagree — the
|
|
55
|
-
* caller must render that as an empty field and leave the attribute alone on
|
|
56
|
-
* apply, rather than stamping one block's value onto the rest.
|
|
57
|
-
*/
|
|
58
|
-
export declare const readSpacingSelection: (editor: Editor | null) => SpacingSelection;
|
|
59
26
|
export declare const getCurrentLineHeight: (editor: Editor | null, currentLineHeight?: string) => string;
|
|
60
|
-
export type EffectiveSpacing = {
|
|
61
|
-
spaceBefore: SpacingReading<number>;
|
|
62
|
-
spaceAfter: SpacingReading<number>;
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* The spacing a block actually renders with: its explicit attribute when set,
|
|
66
|
-
* otherwise whatever the stylesheet resolves to.
|
|
67
|
-
*
|
|
68
|
-
* Read from the rendered DOM because there is no single default to hardcode —
|
|
69
|
-
* the gap depends on viewport, schema version, element type, and whether the
|
|
70
|
-
* block is the first or last child. Both the "add/remove space" menu items and
|
|
71
|
-
* the custom spacing dialog need the real number, not the attribute.
|
|
72
|
-
*/
|
|
73
|
-
export declare const readEffectiveSpacing: (editor: Editor | null) => EffectiveSpacing;
|
|
74
|
-
/**
|
|
75
|
-
* Which half of the Google-Docs-style toggle to offer.
|
|
76
|
-
*
|
|
77
|
-
* "Add space before paragraph" only appears once the block genuinely has no
|
|
78
|
-
* gap — the stylesheet's default counts, so a fresh paragraph offers "Remove"
|
|
79
|
-
* first. A mixed selection counts as having a gap, since removing is the
|
|
80
|
-
* action that leaves every block in the same state.
|
|
81
|
-
*/
|
|
82
|
-
export declare const spacingToggleAction: (effective: SpacingReading<number>) => "add" | "remove";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as m, jsxs as L } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as D, useState as E, useEffect as A } from "react";
|
|
3
3
|
import { DynamicDropdown as P, Tooltip as O, IconButton as T } from "@fileverse/ui";
|
|
4
|
-
import { a3 as _, a4 as w, c as R } from "./index-
|
|
4
|
+
import { a3 as _, a4 as w, c as R } from "./index-cYPrdQNO.mjs";
|
|
5
5
|
const p = (e, n, o = n) => {
|
|
6
6
|
const { state: i } = e, l = i.changeByRange((t) => {
|
|
7
7
|
const d = i.sliceDoc(t.from, t.to), r = i.sliceDoc(
|