@fileverse-dev/ddoc 5.1.5 → 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.
@@ -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-CapPoFVO.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-D9xaees6.mjs";
7
7
  class ua {
8
8
  /**
9
9
  Create a new completion context. (Mostly useful for testing
@@ -1,2 +1 @@
1
1
  export declare const TWITTER_REGEX: RegExp;
2
- export declare const isTwitterUrl: (url: string | null | undefined) => boolean;
@@ -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
- type MediaCandidate = {
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-CapPoFVO.mjs";
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(