@atlaskit/editor-common 63.0.1 → 64.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 (50) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/cjs/safe-plugin/index.js +42 -0
  3. package/dist/cjs/styles/index.js +0 -8
  4. package/dist/cjs/styles/shared/block-marks.js +1 -1
  5. package/dist/cjs/styles/shared/lists.js +3 -1
  6. package/dist/cjs/types/collab.js +5 -0
  7. package/dist/cjs/ui/MediaSingle/index.js +3 -1
  8. package/dist/cjs/ui/Mention/index.js +1 -3
  9. package/dist/cjs/ui/Mention/mention-with-profilecard.js +33 -194
  10. package/dist/cjs/ui/Mention/mention-with-providers.js +1 -5
  11. package/dist/cjs/version.json +1 -1
  12. package/dist/es2019/safe-plugin/index.js +10 -0
  13. package/dist/es2019/styles/index.js +0 -1
  14. package/dist/es2019/styles/shared/block-marks.js +2 -1
  15. package/dist/es2019/styles/shared/lists.js +16 -0
  16. package/dist/es2019/types/collab.js +1 -0
  17. package/dist/es2019/ui/MediaSingle/index.js +3 -1
  18. package/dist/es2019/ui/Mention/index.js +1 -3
  19. package/dist/es2019/ui/Mention/mention-with-profilecard.js +33 -146
  20. package/dist/es2019/ui/Mention/mention-with-providers.js +1 -5
  21. package/dist/es2019/version.json +1 -1
  22. package/dist/esm/safe-plugin/index.js +27 -0
  23. package/dist/esm/styles/index.js +0 -1
  24. package/dist/esm/styles/shared/block-marks.js +1 -1
  25. package/dist/esm/styles/shared/lists.js +2 -1
  26. package/dist/esm/types/collab.js +1 -0
  27. package/dist/esm/ui/MediaSingle/index.js +3 -1
  28. package/dist/esm/ui/Mention/index.js +1 -3
  29. package/dist/esm/ui/Mention/mention-with-profilecard.js +33 -189
  30. package/dist/esm/ui/Mention/mention-with-providers.js +1 -5
  31. package/dist/esm/version.json +1 -1
  32. package/dist/types/collab/types.d.ts +14 -2
  33. package/dist/types/collab.d.ts +1 -1
  34. package/dist/types/index.d.ts +1 -0
  35. package/dist/types/safe-plugin/index.d.ts +6 -0
  36. package/dist/types/styles/index.d.ts +0 -1
  37. package/dist/types/types/collab.d.ts +8 -0
  38. package/dist/types/types/index.d.ts +1 -0
  39. package/dist/types/ui/MediaSingle/index.d.ts +2 -1
  40. package/dist/types/ui/MediaSingle/styled.d.ts +2 -2
  41. package/dist/types/ui/Mention/index.d.ts +0 -3
  42. package/dist/types/ui/Mention/mention-with-profilecard.d.ts +2 -25
  43. package/dist/types/ui/Mention/mention-with-providers.d.ts +0 -3
  44. package/dist/types/ui/index.d.ts +1 -1
  45. package/package.json +11 -10
  46. package/safe-plugin/package.json +7 -0
  47. package/dist/cjs/styles/shared/inline-nodes.js +0 -17
  48. package/dist/es2019/styles/shared/inline-nodes.js +0 -7
  49. package/dist/esm/styles/shared/inline-nodes.js +0 -7
  50. package/dist/types/styles/shared/inline-nodes.d.ts +0 -2
@@ -11,3 +11,4 @@ export declare enum SortOrder {
11
11
  export { AnnotationUpdateEmitter, AnnotationUpdateEvent } from './annotation';
12
12
  export type { AnnotationState, AnnotationProviders, AnnotationUpdateEventPayloads, InlineCommentSelectionComponentProps, InlineCommentViewComponentProps, InlineCommentAnnotationProvider, OnAnnotationClickPayload, AnnotationByMatches, AnnotationActionResult, } from './annotation';
13
13
  export type { TypeAheadItem, TypeAheadItemRenderProps } from './type-ahead';
14
+ export type { NewCollabSyncUpErrorAttributes, SyncUpErrorFunction, } from './collab';
@@ -16,6 +16,7 @@ export interface Props {
16
16
  nodeType?: string;
17
17
  fullWidthMode?: boolean;
18
18
  hasFallbackContainer?: boolean;
19
+ handleMediaSingleRef?: React.RefObject<HTMLElement>;
19
20
  }
20
21
  export declare const shouldAddDefaultWrappedWidth: (layout: RichMediaLayout, width?: number | undefined, lineLength?: number | undefined) => boolean | 0 | undefined;
21
- export default function MediaSingle({ layout, width, height, containerWidth, isLoading, pctWidth, className, children: propsChildren, nodeType, fullWidthMode, lineLength, hasFallbackContainer, }: Props): JSX.Element;
22
+ export default function MediaSingle({ layout, width, height, containerWidth, isLoading, pctWidth, className, children: propsChildren, nodeType, fullWidthMode, lineLength, hasFallbackContainer, handleMediaSingleRef, }: Props): JSX.Element;
@@ -1,4 +1,4 @@
1
- import React, { HTMLAttributes } from 'react';
1
+ import React, { HTMLAttributes, RefObject } from 'react';
2
2
  import { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
3
3
  /**
4
4
  * Calculates the image width for non-resized images.
@@ -22,7 +22,7 @@ export interface MediaSingleWrapperProps {
22
22
  layout: MediaSingleLayout;
23
23
  pctWidth?: number;
24
24
  width?: number;
25
- innerRef?: (elem: HTMLElement) => void;
25
+ innerRef?: ((elem: HTMLElement) => void) | RefObject<HTMLElement>;
26
26
  }
27
27
  /**
28
28
  * Can't use `.attrs` to handle highly dynamic styles because we are still
@@ -1,5 +1,4 @@
1
1
  import { PureComponent } from 'react';
2
- import { MentionUserType as UserType } from '@atlaskit/adf-schema';
3
2
  import { ProviderFactory } from '../../provider-factory';
4
3
  import { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
5
4
  import { MentionEventHandlers } from '../EventHandlers';
@@ -9,8 +8,6 @@ export interface MentionProps {
9
8
  eventHandlers?: MentionEventHandlers;
10
9
  text: string;
11
10
  accessLevel?: string;
12
- portal?: HTMLElement;
13
- userType?: UserType;
14
11
  }
15
12
  export interface MentionState {
16
13
  profilecardProvider: ProfilecardProvider | null;
@@ -1,5 +1,4 @@
1
- import { PureComponent } from 'react';
2
- import { MentionUserType as UserType } from '@atlaskit/adf-schema';
1
+ /// <reference types="react" />
3
2
  import { MentionProvider } from '@atlaskit/mention';
4
3
  import { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
5
4
  import { MentionEventHandler } from '../EventHandlers';
@@ -7,32 +6,10 @@ export interface Props {
7
6
  id: string;
8
7
  text: string;
9
8
  accessLevel?: string;
10
- userType?: UserType;
11
9
  mentionProvider?: Promise<MentionProvider>;
12
- portal?: HTMLElement;
13
10
  profilecardProvider: ProfilecardProvider;
14
11
  onClick?: MentionEventHandler;
15
12
  onMouseEnter?: MentionEventHandler;
16
13
  onMouseLeave?: MentionEventHandler;
17
14
  }
18
- export declare type PopupAlignX = 'left' | 'right';
19
- export declare type PopupAlignY = 'top' | 'bottom';
20
- export interface State {
21
- target: HTMLElement | null;
22
- visible: boolean;
23
- popupAlignX: PopupAlignX;
24
- popupAlignY: PopupAlignY;
25
- }
26
- export default class MentionWithProfileCard extends PureComponent<Props, State> {
27
- private domNode;
28
- state: State;
29
- private handleRef;
30
- private calculateLayerPosition;
31
- private handleMentionNodeRef;
32
- private getDomNodeCenterCoords;
33
- private getVisibleAreaCentreCoords;
34
- private getActions;
35
- private showProfilecard;
36
- private hideProfilecard;
37
- render(): JSX.Element;
38
- }
15
+ export default function MentionWithProfileCard({ id, text, accessLevel, mentionProvider, profilecardProvider, onClick, onMouseEnter, onMouseLeave, }: Props): JSX.Element;
@@ -1,5 +1,4 @@
1
1
  import { PureComponent } from 'react';
2
- import { MentionUserType as UserType } from '@atlaskit/adf-schema';
3
2
  import { MentionProvider } from '@atlaskit/mention/resource';
4
3
  import { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
5
4
  import { MentionEventHandlers } from '../EventHandlers';
@@ -7,11 +6,9 @@ export interface Props {
7
6
  id: string;
8
7
  text: string;
9
8
  accessLevel?: string;
10
- userType?: UserType;
11
9
  mentionProvider?: Promise<MentionProvider>;
12
10
  profilecardProvider?: Promise<ProfilecardProvider>;
13
11
  eventHandlers?: MentionEventHandlers;
14
- portal?: HTMLElement;
15
12
  }
16
13
  export interface State {
17
14
  profilecardProvider: ProfilecardProvider | null;
@@ -13,7 +13,7 @@ export { BaseTheme, mapBreakpointToLayoutMaxWidth } from './BaseTheme';
13
13
  export { default as withOuterListeners } from './with-outer-listeners';
14
14
  export type { CardEventClickHandler, CardSurroundings, EventHandlers, LinkEventClickHandler, MentionEventHandler, MentionEventHandlers, SmartCardEventClickHandler, } from './EventHandlers';
15
15
  export { WidthConsumer, WidthProvider, getBreakpoint } from './WidthProvider';
16
- export type { WidthConsumerContext } from './WidthProvider';
16
+ export type { WidthConsumerContext, Breakpoints } from './WidthProvider';
17
17
  export { default as overflowShadow, shadowClassNames } from './OverflowShadow';
18
18
  export type { OverflowShadowOptions, OverflowShadowProps, OverflowShadowState, } from './OverflowShadow';
19
19
  export { WithCreateAnalyticsEvent } from './WithCreateAnalyticsEvent';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "63.0.1",
3
+ "version": "64.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/"
@@ -38,12 +38,13 @@
38
38
  "./emoji": "./src/emoji.ts",
39
39
  "./mention": "./src/mention.ts",
40
40
  "./provider-helpers": "./src/provider-helpers/index.ts",
41
- "./icons": "./src/icons/index.ts"
41
+ "./icons": "./src/icons/index.ts",
42
+ "./safe-plugin": "./src/safe-plugin/index.ts"
42
43
  },
43
44
  "dependencies": {
44
45
  "@atlaskit/activity-provider": "^2.3.0",
45
- "@atlaskit/adf-schema": "^21.0.0",
46
- "@atlaskit/adf-utils": "^15.0.0",
46
+ "@atlaskit/adf-schema": "^22.0.0",
47
+ "@atlaskit/adf-utils": "^16.0.0",
47
48
  "@atlaskit/analytics-namespaced-context": "^6.4.0",
48
49
  "@atlaskit/analytics-next": "^8.2.0",
49
50
  "@atlaskit/code": "^14.3.0",
@@ -52,17 +53,17 @@
52
53
  "@atlaskit/emoji": "^64.1.0",
53
54
  "@atlaskit/icon": "^21.10.0",
54
55
  "@atlaskit/in-product-testing": "^0.1.0",
55
- "@atlaskit/media-card": "^73.1.0",
56
+ "@atlaskit/media-card": "^73.2.0",
56
57
  "@atlaskit/media-client": "^14.3.0",
57
58
  "@atlaskit/media-picker": "^59.0.0",
58
- "@atlaskit/mention": "^19.7.0",
59
+ "@atlaskit/mention": "^20.0.0",
59
60
  "@atlaskit/profilecard": "^16.2.0",
60
- "@atlaskit/smart-card": "^17.0.0",
61
+ "@atlaskit/smart-card": "^17.1.0",
61
62
  "@atlaskit/task-decision": "^17.3.0",
62
63
  "@atlaskit/theme": "^12.1.0",
63
64
  "@atlaskit/tooltip": "^17.5.0",
64
- "@atlaskit/ufo": "^0.0.6",
65
- "@atlaskit/user-picker": "^8.4.0",
65
+ "@atlaskit/ufo": "^0.1.0",
66
+ "@atlaskit/user-picker": "^8.5.0",
66
67
  "@atlaskit/width-detector": "^3.0.0",
67
68
  "@babel/runtime": "^7.0.0",
68
69
  "@types/prosemirror-model": "^1.11.0",
@@ -90,7 +91,7 @@
90
91
  },
91
92
  "devDependencies": {
92
93
  "@atlaskit/editor-json-transformer": "^8.7.0",
93
- "@atlaskit/editor-test-helpers": "^16.0.0",
94
+ "@atlaskit/editor-test-helpers": "^16.1.0",
94
95
  "@atlaskit/media-core": "^32.2.0",
95
96
  "@atlaskit/util-data-test": "^17.2.0",
96
97
  "@atlaskit/visual-regression": "*",
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "@atlaskit/editor-common/safe-plugin",
3
+ "main": "../dist/cjs/safe-plugin/index.js",
4
+ "module": "../dist/esm/safe-plugin/index.js",
5
+ "module:es2019": "../dist/es2019/safe-plugin/index.js",
6
+ "types": "../dist/types/safe-plugin/index.d.ts"
7
+ }
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.inlineNodeSharedStyle = void 0;
9
-
10
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
-
12
- var _styledComponents = require("styled-components");
13
-
14
- var _templateObject;
15
-
16
- var inlineNodeSharedStyle = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .inline-node--mobile {\n display: inline-block !important;\n }\n"])));
17
- exports.inlineNodeSharedStyle = inlineNodeSharedStyle;
@@ -1,7 +0,0 @@
1
- import { css } from 'styled-components';
2
- const inlineNodeSharedStyle = css`
3
- .inline-node--mobile {
4
- display: inline-block !important;
5
- }
6
- `;
7
- export { inlineNodeSharedStyle };
@@ -1,7 +0,0 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
-
3
- var _templateObject;
4
-
5
- import { css } from 'styled-components';
6
- var inlineNodeSharedStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .inline-node--mobile {\n display: inline-block !important;\n }\n"])));
7
- export { inlineNodeSharedStyle };
@@ -1,2 +0,0 @@
1
- declare const inlineNodeSharedStyle: import("styled-components").InterpolationValue[];
2
- export { inlineNodeSharedStyle };