@fileverse-dev/ddoc 5.1.4 → 5.1.6
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-CapPoFVO.mjs → index-D9xaees6.mjs} +1 -1
- package/dist/index.es.js +8306 -8379
- package/dist/{markdown-source-pane-BOjMSyJS.mjs → markdown-source-pane-Dtuzt6cD.mjs} +1 -1
- package/dist/package/components/editor-toolbar.d.ts +1 -2
- package/dist/package/components/mobile-toolbar.d.ts +1 -2
- package/dist/package/components/toolbar-reveal.d.ts +5 -0
- package/dist/package/constants/twitter.d.ts +0 -1
- package/dist/package/extensions/d-block/dblock-media-plugin.d.ts +2 -7
- package/dist/package/extensions/paste-as/paste-as-candidate.d.ts +38 -0
- package/dist/package/extensions/paste-as/paste-as-menu.d.ts +14 -0
- package/dist/{split-view-toolbar-CIHsF9uI.mjs → split-view-toolbar-DQ6H0Nmh.mjs} +1 -1
- package/dist/{use-headless-editor-B0lYmRIm.mjs → use-headless-editor-Dm07peFJ.mjs} +6470 -6428
- package/package.json +1 -1
- package/dist/package/extensions/twitter-embed/embed-settings.d.ts +0 -7
|
@@ -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-D9xaees6.mjs";
|
|
7
7
|
class ua {
|
|
8
8
|
/**
|
|
9
9
|
Create a new completion context. (Mostly useful for testing
|
|
@@ -4,7 +4,7 @@ import { FontDescriptor, IpfsImageFetchPayload, IpfsImageUploadResponse } from '
|
|
|
4
4
|
import { Tab } from './tabs/utils/tab-utils';
|
|
5
5
|
|
|
6
6
|
import * as Y from 'yjs';
|
|
7
|
-
declare const MemoizedTiptapToolBar: React.MemoExoticComponent<({ editor, onError, isPresentationMode, setIsPresentationMode, enableCollaboration, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onOdtExport, onDocxImport,
|
|
7
|
+
declare const MemoizedTiptapToolBar: React.MemoExoticComponent<({ editor, onError, isPresentationMode, setIsPresentationMode, enableCollaboration, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onOdtExport, onDocxImport, ipfsImageFetchFn, fetchV1ImageFn, isConnected, tabs, ydoc, onRegisterExportTrigger, toggleFocusMode, isSplitView, onToggleSplitView, fonts: consumerFonts, renderToolbarLeading, }: {
|
|
8
8
|
editor: Editor | null;
|
|
9
9
|
onError?: (errorString: string) => void;
|
|
10
10
|
isPresentationMode?: boolean;
|
|
@@ -22,7 +22,6 @@ declare const MemoizedTiptapToolBar: React.MemoExoticComponent<({ editor, onErro
|
|
|
22
22
|
onTxtExport?: () => void;
|
|
23
23
|
onOdtExport?: () => void;
|
|
24
24
|
onDocxImport?: () => void;
|
|
25
|
-
isLoading: boolean;
|
|
26
25
|
fetchV1ImageFn?: (url: string) => Promise<ArrayBuffer | undefined>;
|
|
27
26
|
ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
|
|
28
27
|
url: string;
|
|
@@ -2,14 +2,13 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { Editor } from '@tiptap/react';
|
|
3
3
|
import { FontDescriptor, IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
|
|
4
4
|
|
|
5
|
-
declare const MemoizedMobileToolbar: React.MemoExoticComponent<({ editor, onError, isKeyboardVisible, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn,
|
|
5
|
+
declare const MemoizedMobileToolbar: React.MemoExoticComponent<({ editor, onError, isKeyboardVisible, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn, ipfsImageFetchFn, fetchV1ImageFn, fonts, }: {
|
|
6
6
|
editor: Editor | null;
|
|
7
7
|
onError?: (errorString: string) => void;
|
|
8
8
|
isKeyboardVisible: boolean;
|
|
9
9
|
isNavbarVisible: boolean;
|
|
10
10
|
setIsNavbarVisible: React.Dispatch<React.SetStateAction<boolean>>;
|
|
11
11
|
ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
|
|
12
|
-
isLoading: boolean;
|
|
13
12
|
ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
|
|
14
13
|
url: string;
|
|
15
14
|
file: File;
|
|
@@ -3,17 +3,12 @@ import { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
|
3
3
|
import { Plugin } from '@tiptap/pm/state';
|
|
4
4
|
import { DBlockRuntimeState } from './dblock-runtime';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
type: 'img';
|
|
8
|
-
src: string;
|
|
9
|
-
from: number;
|
|
10
|
-
to: number;
|
|
11
|
-
} | {
|
|
6
|
+
interface MediaCandidate {
|
|
12
7
|
type: 'iframe';
|
|
13
8
|
src: string;
|
|
14
9
|
from: number;
|
|
15
10
|
to: number;
|
|
16
|
-
}
|
|
11
|
+
}
|
|
17
12
|
interface MediaPluginState {
|
|
18
13
|
version: number;
|
|
19
14
|
shouldScan: boolean;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Extension, Editor } from '@tiptap/core';
|
|
2
|
+
import { PluginKey, EditorState } from '@tiptap/pm/state';
|
|
3
|
+
|
|
4
|
+
export type PasteAsCandidate = {
|
|
5
|
+
kind: 'image';
|
|
6
|
+
href: string;
|
|
7
|
+
} | {
|
|
8
|
+
kind: 'tweet';
|
|
9
|
+
href: string;
|
|
10
|
+
tweetId: string;
|
|
11
|
+
};
|
|
12
|
+
interface PastedRange {
|
|
13
|
+
from: number;
|
|
14
|
+
to: number;
|
|
15
|
+
}
|
|
16
|
+
export declare const pasteAsPluginKey: PluginKey<PastedRange | null>;
|
|
17
|
+
/**
|
|
18
|
+
* Remembers the range the last paste filled. The paste stays live while the
|
|
19
|
+
* selection still ends at the end of that range (mapped through later
|
|
20
|
+
* changes); typing, clicking or arrowing away ends it. Judged on state, not
|
|
21
|
+
* on which transaction did what: the editor's own paste colour clean-up
|
|
22
|
+
* (use-tab-editor) selects the pasted range, re-marks it and puts the caret
|
|
23
|
+
* back a tick later, and that must not dismiss the menu.
|
|
24
|
+
*/
|
|
25
|
+
export declare const PasteAs: Extension<any, any>;
|
|
26
|
+
export declare const findBareLinkCandidate: (state: EditorState) => PasteAsCandidate | null;
|
|
27
|
+
/**
|
|
28
|
+
* The paste-as menu's candidate: a bare embeddable link the user just
|
|
29
|
+
* pasted. The link has to lie inside the pasted range, or a paste that
|
|
30
|
+
* merely ends next to an older link would offer to convert that one.
|
|
31
|
+
*/
|
|
32
|
+
export declare const getPasteAsCandidate: (state: EditorState) => PasteAsCandidate | null;
|
|
33
|
+
/**
|
|
34
|
+
* Replace the link under the caret with the candidate's embed node and
|
|
35
|
+
* select that node, so the caret does not fall into a neighbouring block.
|
|
36
|
+
*/
|
|
37
|
+
export declare const embedPasteAsCandidate: (editor: Editor, candidate: PasteAsCandidate) => boolean;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/core';
|
|
2
|
+
|
|
3
|
+
interface PasteAsMenuProps {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* "Paste as" menu under a freshly pasted bare URL that could become an
|
|
8
|
+
* embed (tweet or image, see getPasteAsCandidate): Enter embeds it, Esc or
|
|
9
|
+
* clicking away keeps it as a plain link (TEC-2758). Focus stays in the
|
|
10
|
+
* editor so continued typing just dismisses the menu; Arrow keys move
|
|
11
|
+
* focus onto the buttons for anyone who wants to pick with the keyboard.
|
|
12
|
+
*/
|
|
13
|
+
export declare const PasteAsMenu: ({ editor }: PasteAsMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -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-D9xaees6.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(
|