@fileverse-dev/ddoc 5.0.6 → 5.1.0

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.
@@ -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-Dsbb674m.mjs";
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-mGcKslYf.mjs";
7
7
  class ua {
8
8
  /**
9
9
  Create a new completion context. (Mostly useful for testing
@@ -0,0 +1,13 @@
1
+ import { Extension } from '@tiptap/core';
2
+ import { PluginKey } from '@tiptap/pm/state';
3
+ import { DecorationSet } from '@tiptap/pm/view';
4
+ import { DispatchContext } from './dispatch-context';
5
+
6
+ export declare const caretMarksPluginKey: PluginKey<DispatchContext>;
7
+ export declare const caretMarksDecorationKey: PluginKey<DecorationSet>;
8
+ /**
9
+ * Google-Docs paragraph mark: an empty block remembers its caret style in
10
+ * `caretMarks` (JSON marks; '[]' = explicitly cleared, null = never stamped).
11
+ * See docs/FORMATTING_INHERITANCE.md.
12
+ */
13
+ export declare const CaretMarks: Extension<any, any>;
@@ -0,0 +1,24 @@
1
+ import { Editor } from '@tiptap/core';
2
+ import { Mark, Node as ProseMirrorNode, Schema } from '@tiptap/pm/model';
3
+ import { Selection } from '@tiptap/pm/state';
4
+
5
+ export declare const CARET_MARKS_ATTR = "caretMarks";
6
+ /** Both EditorState and Transaction have this shape. */
7
+ export type CaretSource = {
8
+ storedMarks: readonly Mark[] | null;
9
+ selection: Selection;
10
+ doc: ProseMirrorNode;
11
+ };
12
+ export declare const serializeMarks: (marks: readonly Mark[]) => string;
13
+ export declare const parseMarks: (schema: Schema, value: unknown) => Mark[];
14
+ /**
15
+ * Fill the font properties the marks leave unset from a legacy paragraph's
16
+ * fontFamily / fontSize attrs (old docs). Explicit marks win.
17
+ */
18
+ export declare const fillLegacyFont: (schema: Schema, marks: readonly Mark[], legacyBlock: ProseMirrorNode | null) => Mark[];
19
+ /** What typing a character would produce right now, legacy font filled in. */
20
+ export declare const caretStyle: (source: CaretSource, legacyBlock: ProseMirrorNode | null) => Mark[];
21
+ /** Marks Tiptap lets cross a split (everything but link). */
22
+ export declare const filterSplittable: (marks: readonly Mark[], editor: Editor) => Mark[];
23
+ /** A stamp carries the font; a block never holds both the stamp and the legacy attrs. */
24
+ export declare const stampAttrs: (attrs: Record<string, unknown>, style: readonly Mark[]) => Record<string, unknown>;
@@ -0,0 +1,32 @@
1
+ import { Mark } from '@tiptap/pm/model';
2
+ import { EditorState, PluginKey, Transaction } from '@tiptap/pm/state';
3
+
4
+ export type OldCaret = {
5
+ wasEmpty: boolean;
6
+ /** Opening position of the pre-root caret block, tracked per step; null once its opening token went. */
7
+ pos: number | null;
8
+ /**
9
+ * marksAcross of the last deletion inside that block; null when nothing was
10
+ * deleted there. Meaningful only while `pos !== null` (the block survived).
11
+ */
12
+ deletedMarks: readonly Mark[] | null;
13
+ };
14
+ export type Pending = {
15
+ marks: readonly Mark[] | null;
16
+ explicit: boolean;
17
+ };
18
+ /**
19
+ * Provenance of the dispatch in progress. ProseMirror's append loop hands a
20
+ * hook only the transactions it has not seen, so the root's origin, stored
21
+ * marks and steps live here, rebuilt at every root transaction.
22
+ */
23
+ export type DispatchContext = {
24
+ local: boolean;
25
+ docChanged: boolean;
26
+ oldCaret: OldCaret | null;
27
+ pending: Pending | null;
28
+ };
29
+ export declare const EMPTY_CONTEXT: DispatchContext;
30
+ export declare const isRootTransaction: (tr: Transaction) => boolean;
31
+ export declare const isLocalRoot: (tr: Transaction) => boolean;
32
+ export declare const applyDispatchContext: (tr: Transaction, prev: DispatchContext, oldState: EditorState, key: PluginKey) => DispatchContext;
@@ -0,0 +1,3 @@
1
+ export { CaretMarks, caretMarksPluginKey, caretMarksDecorationKey, } from './caret-marks';
2
+ export { CARET_MARKS_ATTR, caretStyle, fillLegacyFont, filterSplittable, parseMarks, serializeMarks, stampAttrs, } from './caret-style';
3
+ export { captureSplit, declareSplit, type SplitCapture, } from './split-declaration';
@@ -0,0 +1,11 @@
1
+ import { Editor } from '@tiptap/core';
2
+ import { Mark } from '@tiptap/pm/model';
3
+ import { Transaction } from '@tiptap/pm/state';
4
+
5
+ export type SplitCapture = {
6
+ style: Mark[];
7
+ pos: number;
8
+ sourceWasEmpty: boolean;
9
+ };
10
+ export declare const captureSplit: (tr: Transaction, editor: Editor) => SplitCapture | null;
11
+ export declare const declareSplit: (tr: Transaction, capture: SplitCapture) => void;
@@ -0,0 +1,72 @@
1
+ import { Editor } from '@tiptap/react';
2
+ import { AnyExtension } from '@tiptap/core';
3
+ import { Mark, Node as ProseMirrorNode } from '@tiptap/pm/model';
4
+ import { Plugin, Transaction } from '@tiptap/pm/state';
5
+ import { UndoManager } from 'yjs';
6
+
7
+ import * as Y from 'yjs';
8
+ /**
9
+ * Mounted, Collaboration-backed editor with the production extension set.
10
+ * Collaboration owns the doc, so content is set after construction; pass
11
+ * `null` to leave it to a Yjs sync.
12
+ */
13
+ export declare const makeEditor: (schemaVersion: number, content?: string | null, options?: {
14
+ ydoc?: Y.Doc;
15
+ extensions?: AnyExtension[];
16
+ }) => Editor;
17
+ export declare const track: (editor: Editor) => Editor;
18
+ export declare const destroyTracked: () => void;
19
+ /** Position just after the first occurrence of `text`. */
20
+ export declare const endOf: (editor: Editor, text: string) => number;
21
+ export declare const startOf: (editor: Editor, text: string) => number;
22
+ export declare const selectText: (editor: Editor, text: string) => boolean;
23
+ /** A click or arrow key: a selection change and nothing else. */
24
+ export declare const caretTo: (editor: Editor, pos: number) => boolean;
25
+ /**
26
+ * The real keydown path. `commands.keyboardShortcut('Enter')` replays only
27
+ * the handler's steps and drops its selection and stored marks.
28
+ */
29
+ export declare const pressKey: (editor: Editor, key: string) => boolean;
30
+ export declare const pressEnter: (editor: Editor) => boolean;
31
+ /** The transaction the browser produces for typed text (uses storedMarks). */
32
+ export declare const type: (editor: Editor, text?: string) => void;
33
+ export declare const markNames: (marks: readonly Mark[] | null | undefined) => string[];
34
+ /**
35
+ * Types `x` and reports what the character got — what the user sees. One
36
+ * character, so a test can read names and textStyle off the same caret.
37
+ */
38
+ export declare const typedRun: (editor: Editor) => {
39
+ names: string[];
40
+ textStyle: import('prosemirror-model').Attrs | null;
41
+ };
42
+ export declare const typedMarks: (editor: Editor) => string[];
43
+ export declare const typedTextStyle: (editor: Editor) => import('prosemirror-model').Attrs | null;
44
+ /**
45
+ * jsdom has no DOM-change path; this is what prosemirror-view dispatches
46
+ * for a native deletion: delete, then ensureMarks(marksAcross).
47
+ */
48
+ export declare const nativeDelete: (editor: Editor, from: number, to: number) => void;
49
+ export declare const backspace: (editor: Editor) => void;
50
+ /** Every textblock in document order, with its opening position. */
51
+ export declare const textblocks: (editor: Editor) => {
52
+ node: ProseMirrorNode;
53
+ pos: number;
54
+ }[];
55
+ /** The block Enter created: always the one after the original. */
56
+ export declare const createdBlock: (editor: Editor) => {
57
+ node: ProseMirrorNode;
58
+ pos: number;
59
+ };
60
+ export declare const caretBlock: (editor: Editor) => {
61
+ node: ProseMirrorNode;
62
+ pos: number;
63
+ };
64
+ export declare const stampOf: (node: ProseMirrorNode | undefined) => string | null;
65
+ export declare const storedMarkNames: (editor: Editor) => string[] | null;
66
+ /** Write a stamp by hand (test setup for stale / pre-existing stamps). */
67
+ export declare const stampBlock: (editor: Editor, pos: number, marks: readonly Mark[] | string) => void;
68
+ /** The y-sync plugin Collaboration registered (its key name is 'y-sync$…'). */
69
+ export declare const ySyncPlugin: (editor: Editor) => Plugin;
70
+ /** Dispatch a transaction tagged as a remote (y-sync) change. */
71
+ export declare const applyRemote: (editor: Editor, mutate: (tr: Transaction) => Transaction) => void;
72
+ export declare const undoManager: (editor: Editor) => UndoManager;
@@ -1,3 +1,5 @@
1
1
  import { Editor } from '@tiptap/core';
2
2
 
3
- export declare function setShowReplacePopoverWithData(editor: Editor): void;
3
+ export declare function setShowReplacePopoverWithData(editor: Editor, meta?: {
4
+ withReplaceOpen: boolean;
5
+ }): void;
@@ -2,10 +2,13 @@ type StoreActions = {
2
2
  setSearchTerm: (val: string) => void;
3
3
  setReplaceTerm: (val: string) => void;
4
4
  setShowReplacePopover: (val: boolean) => void;
5
+ setShowReplace: (val: boolean) => void;
5
6
  toggleShowReplacePopover: () => void;
7
+ toggleShowReplace: () => void;
6
8
  };
7
9
  type Store = {
8
10
  showSearchReplacePopover: boolean;
11
+ showReplace: boolean;
9
12
  searchTerm: string;
10
13
  replaceTerm: string;
11
14
  actions: StoreActions;
@@ -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-Dsbb674m.mjs";
4
+ import { a3 as _, a4 as w, c as R } from "./index-mGcKslYf.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(