@atlaskit/editor-common 118.11.0 → 119.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/compass.yml +2 -2
  3. package/dist/cjs/core-utils/index.js +1 -8
  4. package/dist/cjs/extensibility/ExtensionSSRReactContextsProvider.js +1 -2
  5. package/dist/cjs/extensions/buildMenuItem.js +7 -1
  6. package/dist/cjs/monitoring/error.js +1 -1
  7. package/dist/cjs/portal/common.js +2 -3
  8. package/dist/cjs/react-node-view/NodeViewContentHole.js +1 -2
  9. package/dist/cjs/react-node-view/index.js +1 -1
  10. package/dist/cjs/ui/DropList/index.js +1 -1
  11. package/dist/cjs/ui/Mention/index.js +20 -1
  12. package/dist/cjs/ui/Mention/mention-node-data-provider.js +5 -0
  13. package/dist/cjs/ui/Mention/mention-with-profilecard.js +8 -0
  14. package/dist/cjs/ui/Mention/mention-with-providers.js +92 -15
  15. package/dist/es2019/core-utils/index.js +1 -2
  16. package/dist/es2019/extensibility/ExtensionSSRReactContextsProvider.js +1 -2
  17. package/dist/es2019/extensions/buildMenuItem.js +7 -0
  18. package/dist/es2019/monitoring/error.js +1 -1
  19. package/dist/es2019/portal/common.js +2 -3
  20. package/dist/es2019/react-node-view/NodeViewContentHole.js +1 -2
  21. package/dist/es2019/react-node-view/index.js +2 -2
  22. package/dist/es2019/ui/DropList/index.js +1 -1
  23. package/dist/es2019/ui/Mention/index.js +21 -2
  24. package/dist/es2019/ui/Mention/mention-node-data-provider.js +1 -0
  25. package/dist/es2019/ui/Mention/mention-with-profilecard.js +8 -0
  26. package/dist/es2019/ui/Mention/mention-with-providers.js +69 -2
  27. package/dist/esm/core-utils/index.js +1 -2
  28. package/dist/esm/extensibility/ExtensionSSRReactContextsProvider.js +1 -2
  29. package/dist/esm/extensions/buildMenuItem.js +7 -1
  30. package/dist/esm/monitoring/error.js +1 -1
  31. package/dist/esm/portal/common.js +2 -3
  32. package/dist/esm/react-node-view/NodeViewContentHole.js +1 -2
  33. package/dist/esm/react-node-view/index.js +2 -2
  34. package/dist/esm/ui/DropList/index.js +1 -1
  35. package/dist/esm/ui/Mention/index.js +21 -2
  36. package/dist/esm/ui/Mention/mention-node-data-provider.js +1 -0
  37. package/dist/esm/ui/Mention/mention-with-profilecard.js +8 -0
  38. package/dist/esm/ui/Mention/mention-with-providers.js +92 -15
  39. package/dist/types/analytics/types/quick-insert-events.d.ts +15 -34
  40. package/dist/types/collab/agent-remote-edit-review.d.ts +14 -0
  41. package/dist/types/core-utils/index.d.ts +0 -1
  42. package/dist/types/extensions/types/extension-manifest.d.ts +9 -0
  43. package/dist/types/extensions/types/utils.d.ts +2 -1
  44. package/dist/types/mention.d.ts +1 -0
  45. package/dist/types/provider-factory/quick-insert-provider.d.ts +3 -0
  46. package/dist/types/ui/Mention/index.d.ts +2 -0
  47. package/dist/types/ui/Mention/mention-node-data-provider.d.ts +32 -0
  48. package/dist/types/ui/Mention/mention-with-profilecard.d.ts +5 -1
  49. package/dist/types/ui/Mention/mention-with-providers.d.ts +11 -1
  50. package/package.json +9 -3
  51. package/dist/cjs/core-utils/is-ssr-streaming.js +0 -22
  52. package/dist/es2019/core-utils/is-ssr-streaming.js +0 -16
  53. package/dist/esm/core-utils/is-ssr-streaming.js +0 -16
  54. package/dist/types/core-utils/is-ssr-streaming.d.ts +0 -10
@@ -5,14 +5,18 @@ import type { ProfilecardProvider } from '../../provider-factory/profile-card-pr
5
5
  import type { MentionEventHandler } from '../EventHandlers';
6
6
  export interface Props {
7
7
  accessLevel?: string;
8
+ appType?: string | null;
8
9
  autoFocus?: boolean;
10
+ avatarUrl?: string;
9
11
  id: string;
12
+ isAvatarImagePreShaped?: boolean;
10
13
  localId?: string;
11
14
  mentionProvider?: Promise<MentionProvider>;
12
15
  onClick?: MentionEventHandler;
13
16
  onMouseEnter?: MentionEventHandler;
14
17
  onMouseLeave?: MentionEventHandler;
15
18
  profilecardProvider: ProfilecardProvider;
19
+ renderAvatarSlot?: boolean;
16
20
  ssrPlaceholderId?: string;
17
21
  text: string;
18
22
  userType?: MentionUserType;
@@ -22,4 +26,4 @@ export interface Props {
22
26
  * 1. Agent mentions (`userType === 'APP'`, behind the `rovo_chat_mention_agents` experiment) open the Rovo agent profile card on click.
23
27
  * 2. Otherwise renders the person profile card (either via the provider's `renderUserMentionCard`/link fallback or the default user `ProfileCardTrigger`).
24
28
  */
25
- export default function MentionWithProfileCard({ autoFocus, id, text, accessLevel, mentionProvider, profilecardProvider, onClick, onMouseEnter, onMouseLeave, localId, ssrPlaceholderId, userType, }: Props): React.JSX.Element;
29
+ export default function MentionWithProfileCard({ autoFocus, id, text, accessLevel, appType, avatarUrl, isAvatarImagePreShaped, mentionProvider, profilecardProvider, onClick, onMouseEnter, onMouseLeave, renderAvatarSlot, localId, ssrPlaceholderId, userType, }: Props): React.JSX.Element;
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
2
  import type { MentionUserType } from '@atlaskit/adf-schema';
3
3
  import type { MentionProvider } from '@atlaskit/mention/resource';
4
+ import type { MentionNodeData } from '@atlaskit/mention/types';
4
5
  import type { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
5
6
  import type { MentionEventHandlers } from '../EventHandlers';
7
+ import type { MentionNodeDataProvider } from './mention-node-data-provider';
6
8
  export interface Props {
7
9
  accessLevel?: string;
8
10
  disabledTooltip?: string;
@@ -10,12 +12,20 @@ export interface Props {
10
12
  id: string;
11
13
  isDisabled?: boolean;
12
14
  localId?: string;
15
+ mentionNodeDataProvider?: MentionNodeDataProvider;
13
16
  mentionProvider?: Promise<MentionProvider>;
14
17
  profilecardProvider?: Promise<ProfilecardProvider>;
15
18
  text: string;
16
19
  userType?: MentionUserType;
17
20
  }
21
+ export interface MentionWithProvidersProps extends Props {
22
+ mentionNodeData?: MentionNodeData;
23
+ renderAvatarSlot?: boolean;
24
+ }
18
25
  export interface State {
19
26
  profilecardProvider: ProfilecardProvider | null;
20
27
  }
21
- export declare const MentionWithProviders: React.MemoExoticComponent<({ accessLevel, eventHandlers, id, mentionProvider, profilecardProvider, text, localId, }: Props) => React.JSX.Element>;
28
+ export declare const MentionWithProviders: React.MemoExoticComponent<(props: MentionWithProvidersProps) => React.JSX.Element>;
29
+ export declare const MentionWithAvatarProviders: React.MemoExoticComponent<(props: Props & {
30
+ mentionNodeDataProvider: MentionNodeDataProvider;
31
+ }) => React.JSX.Element>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "118.11.0",
3
+ "version": "119.0.0",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -64,7 +64,7 @@
64
64
  "@atlaskit/media-picker": "^72.1.0",
65
65
  "@atlaskit/media-ui": "^30.11.0",
66
66
  "@atlaskit/media-viewer": "^54.5.0",
67
- "@atlaskit/mention": "^27.15.0",
67
+ "@atlaskit/mention": "^27.16.0",
68
68
  "@atlaskit/menu": "^10.0.0",
69
69
  "@atlaskit/object": "^2.2.0",
70
70
  "@atlaskit/onboarding": "^15.1.0",
@@ -84,7 +84,7 @@
84
84
  "@atlaskit/task-decision": "^21.8.0",
85
85
  "@atlaskit/teams-app-config": "^2.2.0",
86
86
  "@atlaskit/textfield": "^10.0.0",
87
- "@atlaskit/tmp-editor-statsig": "^147.0.0",
87
+ "@atlaskit/tmp-editor-statsig": "^147.1.0",
88
88
  "@atlaskit/tokens": "^16.7.0",
89
89
  "@atlaskit/tooltip": "^24.0.0",
90
90
  "@atlaskit/width-detector": "^7.0.0",
@@ -266,5 +266,11 @@
266
266
  "platform_editor_embed_height_only_fallback": {
267
267
  "type": "boolean"
268
268
  }
269
+ },
270
+ "platform-experiments": {
271
+ "platform_editor_mention_node_avatar": {
272
+ "param": "isEnabled",
273
+ "defaultValue": false
274
+ }
269
275
  }
270
276
  }
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.isSSRStreaming = isSSRStreaming;
7
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
8
- /** Returns true if React SSR streaming is actually active at runtime. */
9
- function isSSRStreaming() {
10
- try {
11
- var _process$env;
12
- var isSSRRendered =
13
- // In most places there is no document when running on server-side
14
- // eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
15
- typeof document === 'undefined' || typeof process !== 'undefined' && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env.REACT_SSR) || typeof window !== 'undefined' && window.__SSR_RENDERED__ || globalThis.__SSR_RENDERED__;
16
- var isSSRReactStreaming = typeof window !== 'undefined' && window.__SSR_REACT_STREAMING__ || globalThis.__SSR_REACT_STREAMING__;
17
- return Boolean(isSSRRendered) && (0, _expValEquals.expValEquals)('platform_editor_editor_ssr_streaming', 'isEnabled', true) && Boolean(isSSRReactStreaming);
18
- } catch (_unused) {
19
- // Catch possible error that might occur and just return false
20
- return false;
21
- }
22
- }
@@ -1,16 +0,0 @@
1
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
2
- /** Returns true if React SSR streaming is actually active at runtime. */
3
- export function isSSRStreaming() {
4
- try {
5
- var _process$env;
6
- const isSSRRendered =
7
- // In most places there is no document when running on server-side
8
- // eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
9
- typeof document === 'undefined' || typeof process !== 'undefined' && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env.REACT_SSR) || typeof window !== 'undefined' && window.__SSR_RENDERED__ || globalThis.__SSR_RENDERED__;
10
- const isSSRReactStreaming = typeof window !== 'undefined' && window.__SSR_REACT_STREAMING__ || globalThis.__SSR_REACT_STREAMING__;
11
- return Boolean(isSSRRendered) && expValEquals('platform_editor_editor_ssr_streaming', 'isEnabled', true) && Boolean(isSSRReactStreaming);
12
- } catch {
13
- // Catch possible error that might occur and just return false
14
- return false;
15
- }
16
- }
@@ -1,16 +0,0 @@
1
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
2
- /** Returns true if React SSR streaming is actually active at runtime. */
3
- export function isSSRStreaming() {
4
- try {
5
- var _process$env;
6
- var isSSRRendered =
7
- // In most places there is no document when running on server-side
8
- // eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
9
- typeof document === 'undefined' || typeof process !== 'undefined' && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env.REACT_SSR) || typeof window !== 'undefined' && window.__SSR_RENDERED__ || globalThis.__SSR_RENDERED__;
10
- var isSSRReactStreaming = typeof window !== 'undefined' && window.__SSR_REACT_STREAMING__ || globalThis.__SSR_REACT_STREAMING__;
11
- return Boolean(isSSRRendered) && expValEquals('platform_editor_editor_ssr_streaming', 'isEnabled', true) && Boolean(isSSRReactStreaming);
12
- } catch (_unused) {
13
- // Catch possible error that might occur and just return false
14
- return false;
15
- }
16
- }
@@ -1,10 +0,0 @@
1
- declare global {
2
- var __SSR_RENDERED__: boolean | undefined;
3
- var __SSR_REACT_STREAMING__: boolean | undefined;
4
- interface Window {
5
- __SSR_REACT_STREAMING__?: boolean;
6
- __SSR_RENDERED__?: boolean;
7
- }
8
- }
9
- /** Returns true if React SSR streaming is actually active at runtime. */
10
- export declare function isSSRStreaming(): boolean;