@box/threaded-annotations 2.1.11 → 3.0.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.
@@ -2,10 +2,10 @@ var e = /* @__PURE__ */ function(e) {
2
2
  return e.Placeholder = "placeholder", e;
3
3
  }({}), t = 1, n = (e) => {
4
4
  let { content: t, paragraphNumber: n } = s(e);
5
- n === 1 && t.length === 0 && e.commands.setContent([{ type: "placeholder" }]);
5
+ n === 1 && t.length === 0 && e.commands.setContent([{ type: "placeholder" }], { emitUpdate: !1 });
6
6
  }, r = (e, t) => {
7
7
  let n = e.getJSON(), r = i(n, t);
8
- o(n) !== o(r) && e.commands.setContent(r, !0);
8
+ o(n) !== o(r) && e.commands.setContent(r, { emitUpdate: !0 });
9
9
  }, i = (e, t) => {
10
10
  let n = Array.isArray(t) ? t : [t];
11
11
  return a(e, (e) => !n.includes(e.type));
@@ -13,6 +13,7 @@ import p from "@tiptap/extension-text";
13
13
  import { v4 as m } from "uuid";
14
14
  var h = () => {
15
15
  let h = l(null), g = l(null), [_, v] = u(!0), { isActive: y, query: b, command: x, suggestionCallbacks: S } = i(h), { closeAllPopovers: C, openPopoverForMentionId: w, fetchCollaboratorState: T } = e(), E = d({
16
+ shouldRerenderOnTransaction: !0,
16
17
  extensions: [
17
18
  f,
18
19
  a,
@@ -44,7 +45,7 @@ var h = () => {
44
45
  userSelectorRef: h,
45
46
  cleanEditor: c(() => {
46
47
  E && requestAnimationFrame(() => {
47
- E.commands.setContent(""), o(E), v(!0);
48
+ E.isDestroyed || (E.commands.setContent("", { emitUpdate: !1 }), o(E), v(!0));
48
49
  });
49
50
  }, [E]),
50
51
  getEditorJsonContent: c(() => E ? E.getJSON() : null, [E]),
@@ -26,9 +26,10 @@ import { UserSelectorHeadless as C } from "@box/user-selector";
26
26
  import { EditorContent as w, useEditor as T } from "@tiptap/react";
27
27
  import E from "@tiptap/extension-document";
28
28
  import ce from "@tiptap/extension-text";
29
- import le from "@tiptap/extension-placeholder";
29
+ import { Placeholder as le } from "@tiptap/extensions";
30
30
  var D = (s) => {
31
31
  let { disableComponent: D = !1, initialContent: O, isFirstAnnotation: k = !1, isReply: ue = !1, maxCharacterCount: A, userSelectorProps: j, videoTimestamp: M } = s, N = v(null), P = v(null), F = v(null), I = y(), { errorMessage: L, isLoading: R } = ae(), { close: z, isActive: B, query: V, command: H, suggestionCallbacks: de } = o(N), { closeAllPopovers: fe } = t(), U = I.formatMessage(ue ? c.placeholderReply : c.placeholderAddComment), W = s.variant === h.EDIT_MESSAGE, G = T({
32
+ shouldRerenderOnTransaction: !0,
32
33
  extensions: [
33
34
  E,
34
35
  te,
@@ -70,7 +71,7 @@ var D = (s) => {
70
71
  };
71
72
  }, [Z]), _(() => {
72
73
  !G || O === void 0 || queueMicrotask(() => {
73
- G.commands.setContent(O ?? "", !1), G.commands.focus("end");
74
+ G.isDestroyed || (G.commands.setContent(O ?? "", { emitUpdate: !1 }), G.commands.focus("end"));
74
75
  });
75
76
  }, [O]), _(() => {
76
77
  if (!B) return;
@@ -170,7 +171,7 @@ var D = (s) => {
170
171
  excess: J.excess,
171
172
  maxCount: J.maxCount
172
173
  }), /* @__PURE__ */ x(p, {
173
- cleanEditor: () => G?.commands.setContent(""),
174
+ cleanEditor: () => G?.commands.setContent("", { emitUpdate: !1 }),
174
175
  disabled: Q,
175
176
  getEditorJsonContent: () => G?.getJSON(),
176
177
  onPost: s.onPost,
@@ -1 +1 @@
1
- export declare const CustomMention: import('@tiptap/core').Node<import('@tiptap/extension-mention').MentionOptions, any>;
1
+ export declare const CustomMention: import('@tiptap/core').Node<import('@tiptap/extension-mention').MentionOptions<any, import('@tiptap/extension-mention').MentionNodeAttrs>, any>;
@@ -33,6 +33,6 @@ export declare const filterContent: (content: JSONContent, predicate: (content:
33
33
  * @returns Object containing flattened content array and total paragraph count
34
34
  */
35
35
  export declare const getEditorContent: (editor: Editor) => {
36
- content: JSONContent[];
36
+ content: (import('@tiptap/core').NodeType<any, any, any, any> | import('@tiptap/core').TextType<import('@tiptap/core').MarkType<any, any>>)[];
37
37
  paragraphNumber: number;
38
38
  };
@@ -1,12 +1,12 @@
1
1
  import { HeadlessUserSelectorHandle, UserContactType } from '@box/user-selector';
2
2
  export declare const useMessageEditor: () => {
3
- editor: import('@tiptap/react').Editor;
3
+ editor: import('@tiptap/core').Editor;
4
4
  editorRef: import('react').MutableRefObject<HTMLElement>;
5
5
  isEditorEmpty: boolean;
6
6
  isActive: boolean;
7
7
  query: string;
8
8
  userSelectorRef: import('react').MutableRefObject<HeadlessUserSelectorHandle>;
9
9
  cleanEditor: () => void;
10
- getEditorJsonContent: () => import('@tiptap/core').JSONContent;
10
+ getEditorJsonContent: () => import('@tiptap/core').DocumentType<Record<string, any>, import('@tiptap/core').NodeType<string, Record<string, any>, any, (import('@tiptap/core').NodeType<any, any, any, any> | import('@tiptap/core').TextType<import('@tiptap/core').MarkType<any, any>>)[]>[]>;
11
11
  handleUserSelected: (user: UserContactType) => Promise<void>;
12
12
  };
@@ -1 +1 @@
1
- export declare const CustomMention: import('@tiptap/core').Node<import('@tiptap/extension-mention').MentionOptions, any>;
1
+ export declare const CustomMention: import('@tiptap/core').Node<import('@tiptap/extension-mention').MentionOptions<any, import('@tiptap/extension-mention').MentionNodeAttrs>, any>;
package/package.json CHANGED
@@ -1,38 +1,39 @@
1
1
  {
2
2
  "name": "@box/threaded-annotations",
3
- "version": "2.1.11",
3
+ "version": "3.0.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "dependencies": {
6
+ "@floating-ui/dom": "^1.6.0",
6
7
  "@tanstack/react-virtual": "^3.10.8",
7
- "@tiptap/core": "2.0.2",
8
- "@tiptap/extension-document": "2.0.2",
9
- "@tiptap/extension-mention": "2.0.2",
10
- "@tiptap/extension-paragraph": "2.0.2",
11
- "@tiptap/extension-placeholder": "2.0.2",
12
- "@tiptap/extension-text": "2.0.2",
13
- "@tiptap/pm": "2.0.2",
14
- "@tiptap/react": "2.0.2",
15
- "@tiptap/suggestion": "2.0.2",
8
+ "@tiptap/core": "3.26.1",
9
+ "@tiptap/extension-document": "3.26.1",
10
+ "@tiptap/extension-mention": "3.26.1",
11
+ "@tiptap/extension-paragraph": "3.26.1",
12
+ "@tiptap/extension-text": "3.26.1",
13
+ "@tiptap/extensions": "3.26.1",
14
+ "@tiptap/pm": "3.26.1",
15
+ "@tiptap/react": "3.26.1",
16
+ "@tiptap/suggestion": "3.26.1",
16
17
  "uuid": "^9.0.1"
17
18
  },
18
19
  "peerDependencies": {
19
- "@box/blueprint-web": "^16.4.1",
20
- "@box/blueprint-web-assets": "^5.2.6",
21
- "@box/collaboration-popover": "^2.1.8",
22
- "@box/readable-time": "^2.1.8",
23
- "@box/user-selector": "^2.1.9",
20
+ "@box/blueprint-web": "^16.4.2",
21
+ "@box/blueprint-web-assets": "^5.2.7",
22
+ "@box/collaboration-popover": "^2.1.9",
23
+ "@box/readable-time": "^2.1.9",
24
+ "@box/user-selector": "^2.1.10",
24
25
  "clsx": "^1.2.1",
25
26
  "react": "^18.0.0",
26
27
  "react-dom": "^18.0.0",
27
28
  "react-intl": "^6.4.2"
28
29
  },
29
30
  "devDependencies": {
30
- "@box/blueprint-web": "^16.4.1",
31
- "@box/blueprint-web-assets": "^5.2.6",
32
- "@box/eslint-plugin-blueprint": "2.1.4",
33
- "@box/readable-time": "^2.1.8",
34
- "@box/storybook-utils": "^1.1.8",
35
- "@box/user-selector": "^2.1.9",
31
+ "@box/blueprint-web": "^16.4.2",
32
+ "@box/blueprint-web-assets": "^5.2.7",
33
+ "@box/eslint-plugin-blueprint": "2.1.5",
34
+ "@box/readable-time": "^2.1.9",
35
+ "@box/storybook-utils": "^1.1.9",
36
+ "@box/user-selector": "^2.1.10",
36
37
  "react": "^18.0.0",
37
38
  "react-dom": "^18.0.0"
38
39
  },