@fileverse-dev/ddoc 5.0.6 → 5.0.7

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-D4hYioav.mjs";
7
7
  class ua {
8
8
  /**
9
9
  Create a new completion context. (Mostly useful for testing
@@ -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-D4hYioav.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(
@@ -18477,6 +18477,7 @@ const IJ = (e) => {
18477
18477
  return Object.assign(n, t), n;
18478
18478
  }, iM = (e) => IJ, RJ = iM()((e) => ({
18479
18479
  showSearchReplacePopover: !1,
18480
+ showReplace: !1,
18480
18481
  searchTerm: "",
18481
18482
  replaceTerm: "",
18482
18483
  actions: {
@@ -18485,16 +18486,25 @@ const IJ = (e) => {
18485
18486
  setShowReplacePopover: (t) => e({
18486
18487
  showSearchReplacePopover: t
18487
18488
  }),
18489
+ setShowReplace: (t) => e({
18490
+ showReplace: t
18491
+ }),
18488
18492
  toggleShowReplacePopover: () => e((t) => ({
18489
18493
  showSearchReplacePopover: !t.showSearchReplacePopover
18494
+ })),
18495
+ toggleShowReplace: () => e((t) => ({
18496
+ showReplace: !t.showReplace
18490
18497
  }))
18491
18498
  }
18492
18499
  }));
18493
- function aM(e) {
18494
- const { from: t, to: n } = e.state.selection, r = e.state.doc.textBetween(t, n, " "), { getState: o, setState: i } = RJ, a = o().searchTerm;
18495
- r === "" ? (e.commands.setSearchTerm(a), e.commands.resetIndex()) : (i({
18496
- searchTerm: r
18497
- }), e.commands.setSearchTerm(r), e.commands.resetIndex()), i({
18500
+ function aM(e, t) {
18501
+ const { from: n, to: r } = e.state.selection, o = e.state.doc.textBetween(n, r, " "), { getState: i, setState: a } = RJ, s = i().searchTerm;
18502
+ o === "" ? (e.commands.setSearchTerm(s), e.commands.resetIndex()) : (a({
18503
+ searchTerm: o
18504
+ }), e.commands.setSearchTerm(o), e.commands.resetIndex()), t != null && t.withReplaceOpen ? a({
18505
+ showSearchReplacePopover: !0,
18506
+ showReplace: !0
18507
+ }) : a({
18498
18508
  showSearchReplacePopover: !0
18499
18509
  });
18500
18510
  }
@@ -21567,7 +21577,11 @@ const see = iM()((e) => ({
21567
21577
  "edit.delete": u(() => e.chain().focus().deleteSelection().run(), {
21568
21578
  isEnabled: s.hasSelection
21569
21579
  }),
21570
- "edit.findReplace": u(() => aM(e)),
21580
+ "edit.findReplace": u(
21581
+ () => aM(e, {
21582
+ withReplaceOpen: !0
21583
+ })
21584
+ ),
21571
21585
  "edit.cut": u(() => document.execCommand("cut"), {
21572
21586
  isEnabled: s.hasSelection
21573
21587
  }),
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/ddoc",
3
3
  "private": false,
4
4
  "description": "DDoc",
5
- "version": "5.0.6",
5
+ "version": "5.0.7",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/fileverse/fileverse-ddocs.git"