@atlaskit/editor-plugin-mentions 13.2.0 → 13.3.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.
@@ -10,7 +10,6 @@ interface MentionNodeViewProps {
10
10
  portalProviderAPI: PortalProviderAPI;
11
11
  }
12
12
  export declare class MentionNodeView implements NodeView {
13
- private state;
14
13
  dom: Node;
15
14
  domElement: HTMLElement | undefined;
16
15
  contentDOM: HTMLElement | undefined;
@@ -20,8 +19,26 @@ export declare class MentionNodeView implements NodeView {
20
19
  private destroyProfileCard;
21
20
  private removeProfileCard;
22
21
  private mentionPrimitiveElement;
22
+ private disabledTooltip;
23
+ private unsubscribeFromDisabledStateChanges;
24
+ private subscribedProvider;
23
25
  constructor(node: PMNode, config: MentionNodeViewProps);
24
26
  private setClassList;
27
+ private getDisabledState;
28
+ /**
29
+ * Subscribes this NodeView to disabled-state-change notifications on the
30
+ * supplied provider so already-rendered chips can re-evaluate themselves
31
+ * when the consumer's predicate inputs change (e.g. the active agent
32
+ * selection toggling in Rovo Chat). No-op for providers that don't
33
+ * implement `subscribeToDisabledStateChanges`.
34
+ *
35
+ * Idempotent: re-calling with the same provider keeps the existing
36
+ * subscription; passing a different provider tears the old subscription
37
+ * down before attaching the new one. Safe to call from the sharedState
38
+ * `onChange` handler when the editor swaps providers.
39
+ */
40
+ private subscribeToProviderDisabledStateChanges;
41
+ private syncDisabledTooltip;
25
42
  private setTextContent;
26
43
  private shouldHighlightMention;
27
44
  private updateState;
@@ -0,0 +1,25 @@
1
+ import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
2
+ /**
3
+ * Anchors an ADS `<Tooltip>` to a ProseMirror chip element that is **not** a
4
+ * React child of the tooltip. The chip itself stays in the PM document; this
5
+ * renderer mounts an always-present React subtree via `portalProviderAPI` whose
6
+ * sole job is to host the tooltip and forward the ADS-provided trigger ref +
7
+ * event handlers onto the chip.
8
+ *
9
+ * The forwarding is deliberate: ADS `<Tooltip>` expects to attach its hover /
10
+ * focus / blur listeners to its render-prop child, but our render-prop child
11
+ * is a `display: none` placeholder span that no real event can reach. We bridge
12
+ * those listeners to the chip via `addEventListener` so the tooltip opens and
13
+ * closes in response to the user actually interacting with the chip — keyboard
14
+ * focus, mouse hover, screen-reader focus, the lot.
15
+ */
16
+ export interface DisabledTooltipController {
17
+ /** Tear down the React subtree. */
18
+ destroy: () => void;
19
+ /** Update the tooltip text. Passing `undefined` hides the tooltip. */
20
+ setTooltip: (text: string | undefined) => void;
21
+ }
22
+ export declare const disabledTooltipRenderer: ({ chipElement, portalProviderAPI, }: {
23
+ chipElement: HTMLElement;
24
+ portalProviderAPI: PortalProviderAPI;
25
+ }) => DisabledTooltipController;
@@ -10,7 +10,6 @@ interface MentionNodeViewProps {
10
10
  portalProviderAPI: PortalProviderAPI;
11
11
  }
12
12
  export declare class MentionNodeView implements NodeView {
13
- private state;
14
13
  dom: Node;
15
14
  domElement: HTMLElement | undefined;
16
15
  contentDOM: HTMLElement | undefined;
@@ -20,8 +19,26 @@ export declare class MentionNodeView implements NodeView {
20
19
  private destroyProfileCard;
21
20
  private removeProfileCard;
22
21
  private mentionPrimitiveElement;
22
+ private disabledTooltip;
23
+ private unsubscribeFromDisabledStateChanges;
24
+ private subscribedProvider;
23
25
  constructor(node: PMNode, config: MentionNodeViewProps);
24
26
  private setClassList;
27
+ private getDisabledState;
28
+ /**
29
+ * Subscribes this NodeView to disabled-state-change notifications on the
30
+ * supplied provider so already-rendered chips can re-evaluate themselves
31
+ * when the consumer's predicate inputs change (e.g. the active agent
32
+ * selection toggling in Rovo Chat). No-op for providers that don't
33
+ * implement `subscribeToDisabledStateChanges`.
34
+ *
35
+ * Idempotent: re-calling with the same provider keeps the existing
36
+ * subscription; passing a different provider tears the old subscription
37
+ * down before attaching the new one. Safe to call from the sharedState
38
+ * `onChange` handler when the editor swaps providers.
39
+ */
40
+ private subscribeToProviderDisabledStateChanges;
41
+ private syncDisabledTooltip;
25
42
  private setTextContent;
26
43
  private shouldHighlightMention;
27
44
  private updateState;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-mentions",
3
- "version": "13.2.0",
3
+ "version": "13.3.0",
4
4
  "description": "Mentions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -40,7 +40,7 @@
40
40
  "@atlaskit/icon": "^35.4.0",
41
41
  "@atlaskit/insm": "^0.4.0",
42
42
  "@atlaskit/link": "^3.4.0",
43
- "@atlaskit/mention": "^26.1.0",
43
+ "@atlaskit/mention": "^26.2.0",
44
44
  "@atlaskit/platform-feature-flags": "^1.1.0",
45
45
  "@atlaskit/popper": "^7.2.0",
46
46
  "@atlaskit/portal": "^5.5.0",
@@ -48,8 +48,9 @@
48
48
  "@atlaskit/profilecard": "^25.8.0",
49
49
  "@atlaskit/teams-app-config": "^1.12.0",
50
50
  "@atlaskit/theme": "^25.0.0",
51
- "@atlaskit/tmp-editor-statsig": "^89.0.0",
51
+ "@atlaskit/tmp-editor-statsig": "^89.1.0",
52
52
  "@atlaskit/tokens": "^13.1.0",
53
+ "@atlaskit/tooltip": "^22.6.0",
53
54
  "@atlaskit/user-picker": "^12.1.0",
54
55
  "@babel/runtime": "^7.0.0",
55
56
  "@compiled/react": "^0.20.0",
@@ -59,7 +60,7 @@
59
60
  "uuid": "^3.1.0"
60
61
  },
61
62
  "peerDependencies": {
62
- "@atlaskit/editor-common": "^115.3.0",
63
+ "@atlaskit/editor-common": "^115.5.0",
63
64
  "react": "^18.2.0",
64
65
  "react-dom": "^18.2.0",
65
66
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"