@fileverse-dev/ddoc 5.0.0 → 5.0.2
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/headless-editor-utils.es.js +1 -1
- package/dist/{index-CVwMVBPt.mjs → index-BUsyeThM.mjs} +1 -1
- package/dist/index.es.js +5546 -5544
- package/dist/{markdown-source-pane-BxY2Qs_P.mjs → markdown-source-pane-D7AxMBWB.mjs} +1 -1
- package/dist/package/extensions/comment/comment.d.ts +20 -1
- package/dist/package/types.d.ts +1 -1
- package/dist/package/utils/selection-utils.d.ts +16 -7
- package/dist/package/utils/transaction-range.d.ts +25 -0
- package/dist/{split-view-toolbar-Gbnjf427.mjs → split-view-toolbar-DsWLYWkB.mjs} +1 -1
- package/dist/{use-headless-editor-C3wFDi0t.mjs → use-headless-editor-C0Enxuur.mjs} +10089 -10041
- package/package.json +2 -2
|
@@ -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-BUsyeThM.mjs";
|
|
7
7
|
class ua {
|
|
8
8
|
/**
|
|
9
9
|
Create a new completion context. (Mostly useful for testing
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mark, Range } from '@tiptap/core';
|
|
1
|
+
import { Editor, Mark, Range } from '@tiptap/core';
|
|
2
2
|
import { Mark as PMMark } from '@tiptap/pm/model';
|
|
3
3
|
import { PluginKey, EditorState } from '@tiptap/pm/state';
|
|
4
4
|
import { DecorationSet } from '@tiptap/pm/view';
|
|
@@ -64,6 +64,11 @@ export interface CommentOptions {
|
|
|
64
64
|
export interface CommentStorage {
|
|
65
65
|
activeCommentId: string | null;
|
|
66
66
|
}
|
|
67
|
+
declare module '@tiptap/core' {
|
|
68
|
+
interface Storage {
|
|
69
|
+
comment: CommentStorage;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
67
72
|
export interface DraftCommentRange {
|
|
68
73
|
draftId: string;
|
|
69
74
|
from: number;
|
|
@@ -78,6 +83,20 @@ export declare const getDraftCommentState: (state: EditorState) => DraftCommentP
|
|
|
78
83
|
export declare const getDraftCommentRange: (state: EditorState, draftId: string) => DraftCommentRange | null;
|
|
79
84
|
export declare const getCommentMarkAtPosition: (state: EditorState, pos: number) => CommentMarkMatch | null;
|
|
80
85
|
export declare const getCommentMarkRange: (state: EditorState, commentId: string) => Range | null;
|
|
86
|
+
/**
|
|
87
|
+
* Which comment is "active" is UI state: extension storage plus a DOM class
|
|
88
|
+
* on the already-rendered spans. It never touches the document.
|
|
89
|
+
*
|
|
90
|
+
* These are plain functions, not commands, because a command dispatches the
|
|
91
|
+
* transaction TipTap hands it whatever the command does with it, and these
|
|
92
|
+
* are called on every transaction (the bubble menu's shouldShow, the store's
|
|
93
|
+
* focus and blur handlers). That second, empty transaction ran every plugin,
|
|
94
|
+
* decoration pass and listener again for nothing. The commands below stay as
|
|
95
|
+
* the public API and are unchanged, so a caller that chains them with real
|
|
96
|
+
* edits still gets one dispatch for the chain.
|
|
97
|
+
*/
|
|
98
|
+
export declare const setActiveComment: (editor: Editor, commentId: string) => boolean;
|
|
99
|
+
export declare const clearActiveComment: (editor: Editor) => boolean;
|
|
81
100
|
export interface IComment {
|
|
82
101
|
id?: string;
|
|
83
102
|
tabId?: string;
|
package/dist/package/types.d.ts
CHANGED
|
@@ -60,7 +60,7 @@ export interface CustomModel {
|
|
|
60
60
|
apiKey: string;
|
|
61
61
|
systemPrompt: string;
|
|
62
62
|
}
|
|
63
|
-
export type ThemeKey = 'light' | 'dark' | 'theme-sepia' | 'theme-pink' | 'theme-green';
|
|
63
|
+
export type ThemeKey = 'light' | 'dark' | 'theme-sepia' | 'theme-pink' | 'theme-green' | 'theme-palm';
|
|
64
64
|
export interface ThemeVariantValue {
|
|
65
65
|
light: string;
|
|
66
66
|
dark: string;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { Editor } from '@tiptap/core';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* cursor
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Word range for a collapsed cursor in the current textblock: the word the
|
|
5
|
+
* cursor touches, else the nearest word before it, else the nearest word
|
|
6
|
+
* after it. Null only when the block has no word at all (empty block, or a
|
|
7
|
+
* NodeSelection whose wrapper carries no text). Position math is relative
|
|
8
|
+
* ($from.start() + parentOffset), so it is schema-agnostic (works under
|
|
9
|
+
* dBlock wrappers).
|
|
10
|
+
*
|
|
11
|
+
* Falling back to a neighbour is what keeps the "can insert a comment"
|
|
12
|
+
* enablement stable while typing: with an adjacent-only rule the answer
|
|
13
|
+
* flipped on every space typed, and every consumer of the command snapshot
|
|
14
|
+
* (the whole menu bar) re-rendered each time.
|
|
8
15
|
*/
|
|
9
16
|
export declare const findWordRangeAtCursor: (editor: Editor) => {
|
|
10
17
|
from: number;
|
|
@@ -28,8 +35,10 @@ export declare const selectWordAtCursor: (editor: Editor) => boolean;
|
|
|
28
35
|
/**
|
|
29
36
|
* Single enablement predicate for anchored text actions (inline comments):
|
|
30
37
|
* true when there's already a non-empty TextSelection, or a word is
|
|
31
|
-
* reachable from a collapsed cursor via findWordRangeAtCursor
|
|
32
|
-
* passthrough condition in selectWordAtCursor so
|
|
33
|
-
* selectWordAtCursor will produce a real text
|
|
38
|
+
* reachable from a collapsed cursor via findWordRangeAtCursor (the block has
|
|
39
|
+
* any word). Mirrors the passthrough condition in selectWordAtCursor so
|
|
40
|
+
* "enabled" always implies selectWordAtCursor will produce a real text
|
|
41
|
+
* target, and only changes when the cursor moves between blocks with and
|
|
42
|
+
* without text, not on every space typed.
|
|
34
43
|
*/
|
|
35
44
|
export declare const hasTextTargetAtSelection: (editor: Editor) => boolean;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Transaction } from '@tiptap/pm/state';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Node type names that a transaction's changed ranges start or end inside,
|
|
5
|
+
* or overlap (insert, delete, paste, remote sync). Typing lists the text
|
|
6
|
+
* and its enclosing blocks. Empty for transactions that do not change the
|
|
7
|
+
* document.
|
|
8
|
+
*/
|
|
9
|
+
export declare const transactionTouchedNodeTypes: (transaction: Transaction) => ReadonlySet<string>;
|
|
10
|
+
/**
|
|
11
|
+
* True when a transaction only adds or removes characters inside blocks that
|
|
12
|
+
* already exist: ordinary typing and deleting. False for splits and joins,
|
|
13
|
+
* attribute changes (line height, paragraph spacing, heading level), marks
|
|
14
|
+
* (bold, font size), inserted or deleted whole nodes, and the whole-document
|
|
15
|
+
* replacement a remote collaboration update arrives as.
|
|
16
|
+
*
|
|
17
|
+
* Used to decide whether a page measurement of the document can be scaled by
|
|
18
|
+
* its character count instead of being taken again.
|
|
19
|
+
*/
|
|
20
|
+
export declare const transactionOnlyChangesText: (transaction: Transaction) => boolean;
|
|
21
|
+
/**
|
|
22
|
+
* True when a transaction can reach a node of `typeName`. Meant for gating
|
|
23
|
+
* work that would otherwise walk the whole document on every transaction.
|
|
24
|
+
*/
|
|
25
|
+
export declare const transactionTouchesNodeType: (transaction: Transaction, typeName: string) => boolean;
|
|
@@ -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-BUsyeThM.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(
|