@atlaskit/editor-common 65.0.0 → 66.0.2

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 (102) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/build/tsconfig.json +1 -2
  3. package/dist/cjs/i18n/en.js +27 -0
  4. package/dist/cjs/i18n/en_GB.js +27 -0
  5. package/dist/cjs/normalize-feature-flags.js +40 -4
  6. package/dist/cjs/panel.js +55 -0
  7. package/dist/cjs/styles/index.js +0 -44
  8. package/dist/cjs/styles/shared/link.js +2 -2
  9. package/dist/cjs/styles/shared/lists.js +1 -1
  10. package/dist/cjs/styles/shared/panel.js +15 -6
  11. package/dist/cjs/styles/shared/rule.js +5 -2
  12. package/dist/cjs/styles/shared/table.js +1 -1
  13. package/dist/cjs/ui/BaseTheme/index.js +1 -5
  14. package/dist/cjs/ui/Expand/index.js +84 -46
  15. package/dist/cjs/ui/{IntlNextErrorBoundary → IntlErrorBoundary}/index.js +9 -9
  16. package/dist/cjs/ui/MediaSingle/index.js +13 -8
  17. package/dist/cjs/ui/MediaSingle/styled.js +23 -20
  18. package/dist/cjs/ui/Popup/index.js +15 -1
  19. package/dist/cjs/ui/UnsupportedBlock/index.js +1 -1
  20. package/dist/cjs/ui/index.js +12 -22
  21. package/dist/cjs/utils/compare-props.js +136 -0
  22. package/dist/cjs/utils/index.js +23 -1
  23. package/dist/cjs/utils/performance/hooks/use-component-render-tracking/index.js +47 -0
  24. package/dist/cjs/utils/validator.js +7 -5
  25. package/dist/cjs/version.json +1 -1
  26. package/dist/es2019/i18n/en.js +19 -0
  27. package/dist/es2019/i18n/en_GB.js +19 -0
  28. package/dist/es2019/normalize-feature-flags.js +40 -4
  29. package/dist/es2019/panel.js +1 -0
  30. package/dist/es2019/styles/index.js +0 -1
  31. package/dist/es2019/styles/shared/link.js +1 -1
  32. package/dist/es2019/styles/shared/lists.js +2 -0
  33. package/dist/es2019/styles/shared/panel.js +79 -76
  34. package/dist/es2019/styles/shared/rule.js +3 -3
  35. package/dist/es2019/styles/shared/table.js +9 -1
  36. package/dist/es2019/ui/BaseTheme/index.js +1 -4
  37. package/dist/es2019/ui/Expand/index.js +97 -67
  38. package/dist/es2019/ui/{IntlNextErrorBoundary → IntlErrorBoundary}/index.js +1 -1
  39. package/dist/es2019/ui/MediaSingle/index.js +13 -9
  40. package/dist/es2019/ui/MediaSingle/styled.js +13 -12
  41. package/dist/es2019/ui/Popup/index.js +16 -1
  42. package/dist/es2019/ui/UnsupportedBlock/index.js +0 -1
  43. package/dist/es2019/ui/index.js +2 -4
  44. package/dist/es2019/utils/compare-props.js +99 -0
  45. package/dist/es2019/utils/index.js +3 -1
  46. package/dist/es2019/utils/performance/hooks/use-component-render-tracking/index.js +36 -0
  47. package/dist/es2019/utils/validator.js +3 -2
  48. package/dist/es2019/version.json +1 -1
  49. package/dist/esm/i18n/en.js +19 -0
  50. package/dist/esm/i18n/en_GB.js +19 -0
  51. package/dist/esm/normalize-feature-flags.js +39 -4
  52. package/dist/esm/panel.js +1 -0
  53. package/dist/esm/styles/index.js +0 -1
  54. package/dist/esm/styles/shared/link.js +1 -1
  55. package/dist/esm/styles/shared/lists.js +1 -1
  56. package/dist/esm/styles/shared/panel.js +10 -5
  57. package/dist/esm/styles/shared/rule.js +4 -2
  58. package/dist/esm/styles/shared/table.js +1 -1
  59. package/dist/esm/ui/BaseTheme/index.js +1 -4
  60. package/dist/esm/ui/Expand/index.js +79 -42
  61. package/dist/esm/ui/{IntlNextErrorBoundary → IntlErrorBoundary}/index.js +7 -7
  62. package/dist/esm/ui/MediaSingle/index.js +14 -9
  63. package/dist/esm/ui/MediaSingle/styled.js +17 -10
  64. package/dist/esm/ui/Popup/index.js +16 -1
  65. package/dist/esm/ui/UnsupportedBlock/index.js +1 -1
  66. package/dist/esm/ui/index.js +2 -4
  67. package/dist/esm/utils/compare-props.js +115 -0
  68. package/dist/esm/utils/index.js +3 -1
  69. package/dist/esm/utils/performance/hooks/use-component-render-tracking/index.js +37 -0
  70. package/dist/esm/utils/validator.js +3 -2
  71. package/dist/esm/version.json +1 -1
  72. package/dist/types/extensions/types/field-definitions.d.ts +1 -1
  73. package/dist/types/i18n/en.d.ts +19 -0
  74. package/dist/types/i18n/en_GB.d.ts +19 -0
  75. package/dist/types/normalize-feature-flags.d.ts +6 -3
  76. package/dist/types/panel.d.ts +1 -0
  77. package/dist/types/provider-factory/media-provider.d.ts +2 -2
  78. package/dist/types/provider-factory/types.d.ts +1 -1
  79. package/dist/types/styles/index.d.ts +0 -1
  80. package/dist/types/styles/shared/link.d.ts +1 -1
  81. package/dist/types/styles/shared/panel.d.ts +2 -1
  82. package/dist/types/styles/shared/rule.d.ts +2 -1
  83. package/dist/types/ui/EventHandlers/index.d.ts +2 -2
  84. package/dist/types/ui/Expand/index.d.ts +12 -10
  85. package/dist/types/ui/{IntlNextErrorBoundary → IntlErrorBoundary}/index.d.ts +1 -1
  86. package/dist/types/ui/MediaSingle/index.d.ts +4 -2
  87. package/dist/types/ui/MediaSingle/styled.d.ts +10 -5
  88. package/dist/types/ui/Popup/index.d.ts +3 -0
  89. package/dist/types/ui/index.d.ts +2 -4
  90. package/dist/types/utils/compare-props.d.ts +32 -0
  91. package/dist/types/utils/index.d.ts +4 -0
  92. package/dist/types/utils/performance/hooks/use-component-render-tracking/index.d.ts +19 -0
  93. package/package.json +18 -19
  94. package/panel/package.json +7 -0
  95. package/dist/cjs/ui/IntlLegacyFallbackProvider/index.js +0 -60
  96. package/dist/cjs/ui/LegacyToNextIntlProvider/index.js +0 -67
  97. package/dist/es2019/ui/IntlLegacyFallbackProvider/index.js +0 -21
  98. package/dist/es2019/ui/LegacyToNextIntlProvider/index.js +0 -24
  99. package/dist/esm/ui/IntlLegacyFallbackProvider/index.js +0 -45
  100. package/dist/esm/ui/LegacyToNextIntlProvider/index.js +0 -51
  101. package/dist/types/ui/IntlLegacyFallbackProvider/index.d.ts +0 -8
  102. package/dist/types/ui/LegacyToNextIntlProvider/index.d.ts +0 -8
@@ -0,0 +1,115 @@
1
+ import _typeof from "@babel/runtime/helpers/typeof";
2
+ import React from 'react';
3
+ export var getKeys = Object.keys;
4
+ export var getKeysAddedRemovedCommon = function getKeysAddedRemovedCommon(object1, object2) {
5
+ var oldKeys = object1 !== null ? getKeys(object1) : [];
6
+ var newKeys = object2 !== null ? getKeys(object2) : [];
7
+ var removed = oldKeys.filter(function (key) {
8
+ return !newKeys.includes(key);
9
+ });
10
+ var added = newKeys.filter(function (key) {
11
+ return !oldKeys.includes(key);
12
+ });
13
+ var common = oldKeys.filter(function (key) {
14
+ return newKeys.includes(key);
15
+ });
16
+ return {
17
+ added: added,
18
+ common: common,
19
+ removed: removed
20
+ };
21
+ };
22
+ export var serializeValue = function serializeValue(value) {
23
+ var valueType = _typeof(value);
24
+
25
+ if (value === null) {
26
+ return 'null';
27
+ } else if (value === undefined) {
28
+ return 'undefined';
29
+ } else if (valueType === 'string' || valueType === 'number') {
30
+ return value;
31
+ } else if (valueType === 'symbol') {
32
+ return value.toString();
33
+ } // Calling toString of function returns whole function text with body.
34
+ // So, just return function with name.
35
+ else if (valueType === 'function') {
36
+ return "function:".concat(value.name);
37
+ } else if (valueType === 'object') {
38
+ return {
39
+ type: 'object',
40
+ keys: Object.keys(value)
41
+ };
42
+ }
43
+ };
44
+ export var getPropsDifference = function getPropsDifference(object1, object2) {
45
+ var curDepth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
46
+ var maxDepth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2;
47
+ var keysToIgnore = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
48
+
49
+ var _getKeysAddedRemovedC = getKeysAddedRemovedCommon(object1, object2),
50
+ added = _getKeysAddedRemovedC.added,
51
+ common = _getKeysAddedRemovedC.common,
52
+ removed = _getKeysAddedRemovedC.removed;
53
+
54
+ var changed = [];
55
+ common.forEach(function (key) {
56
+ var value1 = object1[key];
57
+ var value2 = object2[key];
58
+
59
+ var value1Type = _typeof(value1);
60
+
61
+ var value2Type = _typeof(value2); // Do comparision only if values doesn't match (or reference to same object in memory).
62
+ // Or if key does not exist in keys to ignore.
63
+
64
+
65
+ if (value1 !== value2 && keysToIgnore.indexOf(key) === -1) {
66
+ // if both key value are objects and not referencing same object in memory.
67
+ // then get recursive difference.
68
+ if ( /*#__PURE__*/React.isValidElement(value1) || /*#__PURE__*/React.isValidElement(value2)) {
69
+ changed.push({
70
+ key: key,
71
+ reactElementChanged: true
72
+ });
73
+ } else if (value1Type === 'object' && value2Type === 'object') {
74
+ if (curDepth <= maxDepth) {
75
+ var difference = getPropsDifference(value1, value2, curDepth + 1, maxDepth);
76
+ changed.push({
77
+ key: key,
78
+ difference: difference
79
+ });
80
+ } else {
81
+ changed.push({
82
+ key: key,
83
+ maxDepthReached: true
84
+ });
85
+ }
86
+ } else {
87
+ changed.push({
88
+ key: key,
89
+ oldValue: serializeValue(value1),
90
+ newValue: serializeValue(value2)
91
+ });
92
+ }
93
+ }
94
+ });
95
+ return {
96
+ added: added,
97
+ changed: changed,
98
+ removed: removed
99
+ };
100
+ };
101
+ export var getShallowPropsDifference = function getShallowPropsDifference(object1, object2) {
102
+ var _getKeysAddedRemovedC2 = getKeysAddedRemovedCommon(object1, object2),
103
+ added = _getKeysAddedRemovedC2.added,
104
+ common = _getKeysAddedRemovedC2.common,
105
+ removed = _getKeysAddedRemovedC2.removed;
106
+
107
+ var changed = common.filter(function (key) {
108
+ return object1[key] !== object2[key];
109
+ });
110
+ return {
111
+ added: added,
112
+ changed: changed,
113
+ removed: removed
114
+ };
115
+ };
@@ -23,4 +23,6 @@ export { shouldForceTracking } from './should-force-tracking';
23
23
  export { getModeFromTheme } from './getModeFromTheme';
24
24
  export { sniffUserBrowserExtensions } from './browser-extensions';
25
25
  export { RenderCountProfiler } from './profiler/render-count';
26
- export { validateADFEntity, validationErrorHandler } from './validate-using-spec';
26
+ export { validateADFEntity, validationErrorHandler } from './validate-using-spec';
27
+ export { getShallowPropsDifference, getPropsDifference } from './compare-props';
28
+ export { useComponentRenderTracking } from './performance/hooks/use-component-render-tracking';
@@ -0,0 +1,37 @@
1
+ import { useEffect, useRef } from 'react';
2
+ import { uuid } from '@atlaskit/adf-schema';
3
+ import { getPropsDifference, getShallowPropsDifference } from '../../../compare-props';
4
+ export function useComponentRenderTracking(_ref) {
5
+ var onRender = _ref.onRender,
6
+ propsDiffingOptions = _ref.propsDiffingOptions,
7
+ _ref$zeroBasedCount = _ref.zeroBasedCount,
8
+ zeroBasedCount = _ref$zeroBasedCount === void 0 ? true : _ref$zeroBasedCount;
9
+ var propsRef = useRef();
10
+ var renderCountRef = useRef(zeroBasedCount ? 0 : 1);
11
+
12
+ var _useRef = useRef(uuid.generate()),
13
+ componentId = _useRef.current;
14
+
15
+ useEffect(function () {
16
+ var lastProps = propsRef.current;
17
+ var renderCount = renderCountRef.current;
18
+ var propsDifference;
19
+
20
+ if (propsDiffingOptions !== null && propsDiffingOptions !== void 0 && propsDiffingOptions.enabled && lastProps) {
21
+ propsDifference = propsDiffingOptions !== null && propsDiffingOptions !== void 0 && propsDiffingOptions.useShallow ? getShallowPropsDifference(lastProps, propsDiffingOptions.props) : getPropsDifference(lastProps, propsDiffingOptions.props, 0, 2, propsDiffingOptions === null || propsDiffingOptions === void 0 ? void 0 : propsDiffingOptions.propsToIgnore);
22
+ }
23
+
24
+ var result = {
25
+ renderCount: renderCount,
26
+ propsDifference: propsDifference,
27
+ componentId: componentId
28
+ };
29
+ onRender(result);
30
+
31
+ if (propsDiffingOptions !== null && propsDiffingOptions !== void 0 && propsDiffingOptions.enabled) {
32
+ propsRef.current = propsDiffingOptions.props;
33
+ }
34
+
35
+ renderCountRef.current = renderCountRef.current + 1;
36
+ }); // No dependencies run on each render
37
+ }
@@ -5,7 +5,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
5
5
 
6
6
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
7
 
8
- import { defaultSchema, inlineNodes, isSafeUrl, PanelType, generateUuid as uuid } from '@atlaskit/adf-schema';
8
+ import { inlineNodes, isSafeUrl, PanelType, generateUuid as uuid } from '@atlaskit/adf-schema';
9
+ import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
9
10
  export var ADFStages = {
10
11
  FINAL: 'final',
11
12
  STAGE_0: 'stage0'
@@ -370,7 +371,7 @@ export var getValidNode = function getValidNode(originalNode) {
370
371
  mediaCollection = collection;
371
372
  }
372
373
 
373
- if (mediaId && mediaCollection && adfStage === 'stage0') {
374
+ if (mediaId && mediaCollection) {
374
375
  return {
375
376
  type: type,
376
377
  attrs: attrs,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "65.0.0",
3
+ "version": "66.0.2",
4
4
  "sideEffects": false
5
5
  }
@@ -11,7 +11,7 @@ export declare type Option = {
11
11
  */
12
12
  icon?: string | React.ReactNode;
13
13
  };
14
- import { SmartUserPickerProps } from '@atlaskit/user-picker';
14
+ import { Props as SmartUserPickerProps } from '@atlaskit/smart-user-picker';
15
15
  export declare type UserFieldContext = Pick<SmartUserPickerProps, 'siteId' | 'principalId' | 'fieldId' | 'productKey' | 'containerId' | 'objectId' | 'childObjectId' | 'productAttributes' | 'includeUsers'>;
16
16
  interface BaseFieldDefinition {
17
17
  description?: string;
@@ -0,0 +1,19 @@
1
+ declare const _default: {
2
+ 'fabric.editor.captionPlaceholder': string;
3
+ 'fabric.editor.codeBidiWarningLabel': string;
4
+ 'fabric.editor.collapseNode': string;
5
+ 'fabric.editor.expandDefaultTitle': string;
6
+ 'fabric.editor.expandNode': string;
7
+ 'fabric.editor.expandPlaceholder': string;
8
+ 'fabric.editor.openLink': string;
9
+ 'fabric.editor.unsupportedBlockContent': string;
10
+ 'fabric.editor.unsupportedContentTooltip': string;
11
+ 'fabric.editor.unsupportedInlineContent': string;
12
+ };
13
+ /**
14
+ * NOTE:
15
+ *
16
+ * This file is automatically generated by Traduki 2.0.
17
+ * DO NOT CHANGE IT BY HAND or your changes will be lost.
18
+ */
19
+ export default _default;
@@ -0,0 +1,19 @@
1
+ declare const _default: {
2
+ 'fabric.editor.captionPlaceholder': string;
3
+ 'fabric.editor.codeBidiWarningLabel': string;
4
+ 'fabric.editor.collapseNode': string;
5
+ 'fabric.editor.expandDefaultTitle': string;
6
+ 'fabric.editor.expandNode': string;
7
+ 'fabric.editor.expandPlaceholder': string;
8
+ 'fabric.editor.openLink': string;
9
+ 'fabric.editor.unsupportedBlockContent': string;
10
+ 'fabric.editor.unsupportedContentTooltip': string;
11
+ 'fabric.editor.unsupportedInlineContent': string;
12
+ };
13
+ /**
14
+ * NOTE:
15
+ *
16
+ * This file is automatically generated by Traduki 2.0.
17
+ * DO NOT CHANGE IT BY HAND or your changes will be lost.
18
+ */
19
+ export default _default;
@@ -1,4 +1,5 @@
1
- declare type NormalizedFeatureFlags = Record<string, boolean>;
1
+ declare type BooleanFlags = Record<string, boolean>;
2
+ declare type NormalizedFeatureFlags<ObjectFlags> = Partial<ObjectFlags & BooleanFlags>;
2
3
  /**
3
4
  * Normalise and filter a free Record<string, unknown> to match
4
5
  * the rules for feature flags in editor and renderer
@@ -9,9 +10,11 @@ declare type NormalizedFeatureFlags = Record<string, boolean>;
9
10
  *
10
11
  * Output matches
11
12
  * 1. cased in camelCase (match [a-zA-Z])
12
- * 2. has boolean value
13
+ * 2. has boolean value or object {} value
13
14
  *
14
15
  * @param rawFeatureFlags
15
16
  */
16
- export declare function normalizeFeatureFlags(rawFeatureFlags?: Record<string, unknown>): NormalizedFeatureFlags;
17
+ export declare function normalizeFeatureFlags<ObjectFlags>(rawFeatureFlags?: Record<string, unknown>, options?: {
18
+ objectFlagKeys: string[];
19
+ }): NormalizedFeatureFlags<ObjectFlags>;
17
20
  export {};
@@ -0,0 +1 @@
1
+ export { getPanelTypeBackground, darkPanelColors, getPanelDarkColor, panelSharedStyles, panelSharedStylesWithoutPrefix, PanelSharedCssClassName, PanelSharedSelectors, getPanelBackgroundDarkModeColors, } from './styles/shared/panel';
@@ -1,5 +1,5 @@
1
- import { MediaClientConfig } from '@atlaskit/media-core/auth';
2
- import { UploadParams } from '@atlaskit/media-picker/types';
1
+ import type { MediaClientConfig } from '@atlaskit/media-core/auth';
2
+ import type { UploadParams } from '@atlaskit/media-picker/types';
3
3
  export declare type MediaProvider = {
4
4
  uploadParams?: UploadParams;
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { ActivityProvider } from '@atlaskit/activity-provider';
2
- import { EmojiProvider } from '@atlaskit/emoji/types';
2
+ import type { EmojiProvider } from '@atlaskit/emoji/types';
3
3
  import { MentionProvider } from '@atlaskit/mention/types';
4
4
  import { TaskDecisionProvider } from '@atlaskit/task-decision/types';
5
5
  import { CollabEditProvider } from '../collab/types';
@@ -5,7 +5,6 @@ export { columnLayoutSharedStyle } from './shared/column-layout';
5
5
  export { mediaSingleSharedStyle, richMediaClassName, } from './shared/media-single';
6
6
  export { blockquoteSharedStyles } from './shared/blockquote';
7
7
  export { headingsSharedStyles } from './shared/headings';
8
- export { getPanelTypeBackground, darkPanelColors, getPanelDarkColor, panelSharedStyles, PanelSharedCssClassName, PanelSharedSelectors, getPanelBackgroundDarkModeColors, } from './shared/panel';
9
8
  export { ruleSharedStyles } from './shared/rule';
10
9
  export { whitespaceSharedStyles } from './shared/whitespace';
11
10
  export { paragraphSharedStyles } from './shared/paragraph';
@@ -1,2 +1,2 @@
1
- declare const linkSharedStyle: import("styled-components").InterpolationValue[];
1
+ declare const linkSharedStyle: import("@emotion/react").SerializedStyles;
2
2
  export { linkSharedStyle };
@@ -79,4 +79,5 @@ export declare const PanelSharedSelectors: {
79
79
  yellowWarningIcon: string;
80
80
  };
81
81
  export declare const getPanelTypeBackground: (panelType: Exclude<PanelType, PanelType.CUSTOM>, props?: ThemeProps) => string;
82
- export declare const panelSharedStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<ThemeProps, any>>[];
82
+ export declare const panelSharedStylesWithoutPrefix: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
83
+ export declare const panelSharedStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
@@ -1 +1,2 @@
1
- export declare const ruleSharedStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<import("@atlaskit/theme").ThemeProps, any>>[];
1
+ import { ThemeProps } from '@atlaskit/theme/types';
2
+ export declare const ruleSharedStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
@@ -1,6 +1,6 @@
1
1
  import { SyntheticEvent } from 'react';
2
- import { CardEvent } from '@atlaskit/media-card';
3
- import { Identifier } from '@atlaskit/media-client';
2
+ import type { CardEvent } from '@atlaskit/media-card';
3
+ import type { Identifier } from '@atlaskit/media-client';
4
4
  export interface CardSurroundings {
5
5
  collectionName: string;
6
6
  list: Identifier[];
@@ -1,4 +1,7 @@
1
- /// <reference types="react" />
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ import { jsx } from '@emotion/react';
4
+ import { ThemeProps } from '@atlaskit/theme/types';
2
5
  export declare const messages: {
3
6
  collapseNode: {
4
7
  id: string;
@@ -27,15 +30,14 @@ export interface StyleProps {
27
30
  'data-node-type'?: 'expand' | 'nestedExpand';
28
31
  'data-title'?: string;
29
32
  }
30
- export declare const ExpandIconWrapper: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
33
+ export declare const ExpandIconWrapper: ({ children, expanded, }: React.HTMLAttributes<HTMLDivElement> & {
31
34
  expanded: boolean;
32
- }, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
33
- expanded: boolean;
34
- }>;
35
- export declare const ExpandLayoutWrapper: import("styled-components").StyledComponentClass<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
35
+ }) => jsx.JSX.Element;
36
+ export declare const expandLayoutWrapperStyle: import("@emotion/react").SerializedStyles;
37
+ export declare const ExpandLayoutWrapperWithRef: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<any>>;
36
38
  export declare const sharedExpandStyles: {
37
- TitleInputStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<import("@atlaskit/theme").ThemeProps, any>>[];
38
- TitleContainerStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<import("@atlaskit/theme").ThemeProps, any>>[];
39
- ContainerStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<StyleProps, any>>[];
40
- ContentStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<StyleProps, any>>[];
39
+ titleInputStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
40
+ titleContainerStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
41
+ containerStyles: (styleProps: StyleProps) => (themeProps: ThemeProps) => import("@emotion/react").SerializedStyles;
42
+ contentStyles: (styleProps: StyleProps) => (themeProps: ThemeProps) => import("@emotion/react").SerializedStyles;
41
43
  };
@@ -5,7 +5,7 @@ interface ErrorBoundaryState {
5
5
  missingIntlProviderInAncestry: boolean;
6
6
  }
7
7
  export declare const REACT_INTL_ERROR_MESSAGE = "<IntlProvider> needs to exist in the component ancestry";
8
- export declare class IntlNextErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
8
+ export declare class IntlErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
9
9
  state: {
10
10
  missingIntlProviderInAncestry: boolean;
11
11
  };
@@ -1,4 +1,6 @@
1
+ /** @jsx jsx */
1
2
  import React from 'react';
3
+ import { jsx } from '@emotion/react';
2
4
  import { RichMediaLayout as MediaSingleLayout, RichMediaLayout } from '@atlaskit/adf-schema';
3
5
  export declare const DEFAULT_IMAGE_WIDTH = 250;
4
6
  export declare const DEFAULT_IMAGE_HEIGHT = 200;
@@ -16,7 +18,7 @@ export interface Props {
16
18
  nodeType?: string;
17
19
  fullWidthMode?: boolean;
18
20
  hasFallbackContainer?: boolean;
19
- handleMediaSingleRef?: React.RefObject<HTMLElement>;
21
+ handleMediaSingleRef?: React.RefObject<HTMLDivElement>;
20
22
  }
21
23
  export declare const shouldAddDefaultWrappedWidth: (layout: RichMediaLayout, width?: number | undefined, lineLength?: number | undefined) => boolean | 0 | undefined;
22
- export default function MediaSingle({ layout, width, height, containerWidth, isLoading, pctWidth, className, children: propsChildren, nodeType, fullWidthMode, lineLength, hasFallbackContainer, handleMediaSingleRef, }: Props): JSX.Element;
24
+ export default function MediaSingle({ layout, width, height, containerWidth, isLoading, pctWidth, className, children: propsChildren, nodeType, fullWidthMode, lineLength, hasFallbackContainer, handleMediaSingleRef, }: Props): jsx.JSX.Element;
@@ -1,4 +1,6 @@
1
- import React, { HTMLAttributes, RefObject } from 'react';
1
+ /** @jsx jsx */
2
+ import React, { RefObject } from 'react';
3
+ import { jsx } from '@emotion/react';
2
4
  import { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
3
5
  /**
4
6
  * Calculates the image width for non-resized images.
@@ -22,17 +24,20 @@ export interface MediaSingleWrapperProps {
22
24
  layout: MediaSingleLayout;
23
25
  pctWidth?: number;
24
26
  width?: number;
25
- innerRef?: ((elem: HTMLElement) => void) | RefObject<HTMLElement>;
27
+ innerRef?: ((elem: HTMLDivElement) => void) | RefObject<HTMLDivElement>;
26
28
  }
27
29
  /**
28
30
  * Can't use `.attrs` to handle highly dynamic styles because we are still
29
31
  * supporting `styled-components` v1.
30
32
  */
31
- export declare const MediaSingleDimensionHelper: ({ containerWidth, fullWidthMode, isResized, layout, pctWidth, width, }: MediaSingleWrapperProps) => import("styled-components").InterpolationValue[];
33
+ export declare const MediaSingleDimensionHelper: ({ containerWidth, fullWidthMode, isResized, layout, pctWidth, width, }: MediaSingleWrapperProps) => import("@emotion/react").SerializedStyles;
32
34
  export interface MediaWrapperProps {
33
35
  paddingBottom?: string;
34
36
  height?: number;
35
37
  hasFallbackContainer?: boolean;
36
38
  }
37
- export declare const MediaWrapper: React.ComponentClass<HTMLAttributes<{}> & MediaWrapperProps>;
38
- export declare const MediaSingleWrapper: import("styled-components").StyledComponentClass<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & MediaSingleWrapperProps, any, React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & MediaSingleWrapperProps>;
39
+ export declare const mediaWrapperStyle: (props: MediaWrapperProps) => import("@emotion/react").SerializedStyles;
40
+ export declare const MediaWrapper: {
41
+ ({ children, ...rest }: React.HTMLAttributes<HTMLDivElement> & MediaWrapperProps): jsx.JSX.Element;
42
+ displayName: string;
43
+ };
@@ -1,3 +1,4 @@
1
+ /// <reference types="resize-observer-browser" />
1
2
  import React from 'react';
2
3
  import { Position } from './utils';
3
4
  export interface Props {
@@ -27,6 +28,7 @@ export interface State {
27
28
  }
28
29
  export default class Popup extends React.Component<Props, State> {
29
30
  scrollElement: undefined | false | HTMLElement;
31
+ scrollParentElement: undefined | false | HTMLElement;
30
32
  static defaultProps: {
31
33
  offset: number[];
32
34
  allowOutOfBound: boolean;
@@ -48,6 +50,7 @@ export default class Popup extends React.Component<Props, State> {
48
50
  private scheduledUpdatePosition;
49
51
  onResize: () => void;
50
52
  UNSAFE_componentWillReceiveProps(newProps: Props): void;
53
+ resizeObserver: ResizeObserver | undefined;
51
54
  componentDidMount(): void;
52
55
  componentWillUnmount(): void;
53
56
  private renderPopup;
@@ -17,10 +17,8 @@ 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';
20
- export { messages as expandMessages, sharedExpandStyles, ExpandIconWrapper, ExpandLayoutWrapper, } from './Expand';
20
+ export { messages as expandMessages, sharedExpandStyles, ExpandIconWrapper, expandLayoutWrapperStyle, ExpandLayoutWrapperWithRef, } from './Expand';
21
21
  export type { StyleProps as ExpandStyleProps } from './Expand';
22
22
  export { ErrorMessage, HelperMessage, ValidMessage } from './Messages';
23
23
  export { clearNextSiblingMarginTopStyle } from './clear-next-sibling-margin-top';
24
- export { IntlNextErrorBoundary, REACT_INTL_ERROR_MESSAGE, } from './IntlNextErrorBoundary';
25
- export { IntlLegacyFallbackProvider } from './IntlLegacyFallbackProvider';
26
- export { LegacyToNextIntlProvider } from './LegacyToNextIntlProvider';
24
+ export { IntlErrorBoundary, REACT_INTL_ERROR_MESSAGE, } from './IntlErrorBoundary';
@@ -0,0 +1,32 @@
1
+ declare type ChangedData<T> = {
2
+ key: keyof T;
3
+ difference?: any;
4
+ maxDepthReached?: boolean;
5
+ newValue?: any;
6
+ oldValue?: any;
7
+ reactElementChanged?: boolean;
8
+ };
9
+ declare type Changed<T> = Array<ChangedData<T>>;
10
+ export declare type PropsDifference<T> = {
11
+ removed: Array<keyof T>;
12
+ added: Array<keyof T>;
13
+ changed: Changed<T>;
14
+ };
15
+ export declare type ShallowPropsDifference<T> = {
16
+ removed: Array<keyof T>;
17
+ added: Array<keyof T>;
18
+ changed: Array<keyof T>;
19
+ };
20
+ export declare const getKeys: <T>(obj: T) => (keyof T)[];
21
+ export declare const getKeysAddedRemovedCommon: <T>(object1: T, object2: T) => {
22
+ added: (keyof T)[];
23
+ common: (keyof T)[];
24
+ removed: (keyof T)[];
25
+ };
26
+ export declare const serializeValue: <T>(value: T[keyof T]) => string | T[keyof T] | {
27
+ type: string;
28
+ keys: string[];
29
+ } | undefined;
30
+ export declare const getPropsDifference: <T>(object1: T, object2: T, curDepth?: number, maxDepth?: number, keysToIgnore?: (keyof T)[]) => PropsDifference<T>;
31
+ export declare const getShallowPropsDifference: <T>(object1: T, object2: T) => ShallowPropsDifference<T>;
32
+ export {};
@@ -32,3 +32,7 @@ export type { UserBrowserExtensionResults } from './browser-extensions';
32
32
  export { sniffUserBrowserExtensions } from './browser-extensions';
33
33
  export { RenderCountProfiler } from './profiler/render-count';
34
34
  export { validateADFEntity, validationErrorHandler, } from './validate-using-spec';
35
+ export { getShallowPropsDifference, getPropsDifference } from './compare-props';
36
+ export type { ShallowPropsDifference, PropsDifference } from './compare-props';
37
+ export { useComponentRenderTracking } from './performance/hooks/use-component-render-tracking';
38
+ export type { UseComponentRenderTrackingArgs } from './performance/hooks/use-component-render-tracking';
@@ -0,0 +1,19 @@
1
+ import { PropsDifference, ShallowPropsDifference } from '../../../compare-props';
2
+ declare type PropsDiff<Props> = ShallowPropsDifference<Props> | PropsDifference<Props>;
3
+ declare type OnRenderCb<Props = undefined> = ({ renderCount, propsDifference, }: {
4
+ renderCount: number;
5
+ propsDifference: PropsDiff<Props> | undefined;
6
+ componentId: string;
7
+ }) => void;
8
+ export declare type UseComponentRenderTrackingArgs<Props = undefined> = {
9
+ onRender: OnRenderCb<Props>;
10
+ propsDiffingOptions?: {
11
+ enabled: boolean;
12
+ props?: Props;
13
+ propsToIgnore?: Array<keyof Props>;
14
+ useShallow?: boolean;
15
+ };
16
+ zeroBasedCount?: boolean;
17
+ };
18
+ export declare function useComponentRenderTracking<Props = undefined>({ onRender, propsDiffingOptions, zeroBasedCount, }: UseComponentRenderTrackingArgs<Props>): void;
19
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "65.0.0",
3
+ "version": "66.0.2",
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/"
@@ -39,32 +39,33 @@
39
39
  "./mention": "./src/mention.ts",
40
40
  "./provider-helpers": "./src/provider-helpers/index.ts",
41
41
  "./icons": "./src/icons/index.ts",
42
- "./safe-plugin": "./src/safe-plugin/index.ts"
42
+ "./safe-plugin": "./src/safe-plugin/index.ts",
43
+ "./panel": "./src/panel.ts"
43
44
  },
44
45
  "dependencies": {
45
46
  "@atlaskit/activity-provider": "^2.3.0",
46
- "@atlaskit/adf-schema": "^22.0.0",
47
+ "@atlaskit/adf-schema": "^23.0.0",
47
48
  "@atlaskit/adf-utils": "^16.0.0",
48
49
  "@atlaskit/analytics-namespaced-context": "^6.4.0",
49
50
  "@atlaskit/analytics-next": "^8.2.0",
50
51
  "@atlaskit/code": "^14.3.0",
51
52
  "@atlaskit/editor-json-transformer": "^8.7.0",
52
53
  "@atlaskit/editor-shared-styles": "^2.0.0",
53
- "@atlaskit/emoji": "^64.2.0",
54
+ "@atlaskit/emoji": "^64.5.0",
54
55
  "@atlaskit/icon": "^21.10.0",
55
56
  "@atlaskit/in-product-testing": "^0.1.0",
56
- "@atlaskit/media-card": "^73.3.0",
57
- "@atlaskit/media-client": "^14.4.0",
58
- "@atlaskit/media-picker": "^59.1.0",
57
+ "@atlaskit/media-card": "^73.5.0",
58
+ "@atlaskit/media-client": "^15.0.0",
59
+ "@atlaskit/media-picker": "^61.0.0",
59
60
  "@atlaskit/mention": "^21.0.0",
60
- "@atlaskit/profilecard": "^16.3.0",
61
- "@atlaskit/smart-card": "^17.7.0",
62
- "@atlaskit/task-decision": "^17.3.0",
61
+ "@atlaskit/profilecard": "^16.4.0",
62
+ "@atlaskit/smart-card": "^18.0.0",
63
+ "@atlaskit/smart-user-picker": "^5.0.2",
64
+ "@atlaskit/task-decision": "^17.4.0",
63
65
  "@atlaskit/theme": "^12.1.0",
64
66
  "@atlaskit/tooltip": "^17.5.0",
65
67
  "@atlaskit/ufo": "^0.1.0",
66
- "@atlaskit/user-picker": "^8.8.0",
67
- "@atlaskit/width-detector": "^3.0.0",
68
+ "@atlaskit/width-detector": "^4.0.0",
68
69
  "@babel/runtime": "^7.0.0",
69
70
  "@emotion/react": "^11.7.1",
70
71
  "@types/prosemirror-model": "^1.11.0",
@@ -83,17 +84,15 @@
83
84
  "react-loadable": "^5.1.0"
84
85
  },
85
86
  "peerDependencies": {
86
- "@atlaskit/media-core": "^32.2.0",
87
+ "@atlaskit/media-core": "^32.3.0",
87
88
  "react": "^16.8.0",
88
89
  "react-dom": "^16.8.0",
89
- "react-intl": "^2.6.0",
90
- "react-intl-next": "npm:react-intl@^5.18.1",
91
- "styled-components": "^3.2.6"
90
+ "react-intl-next": "npm:react-intl@^5.18.1"
92
91
  },
93
92
  "devDependencies": {
94
93
  "@atlaskit/editor-json-transformer": "^8.7.0",
95
- "@atlaskit/editor-test-helpers": "^16.1.0",
96
- "@atlaskit/media-core": "^32.2.0",
94
+ "@atlaskit/editor-test-helpers": "^17.0.0",
95
+ "@atlaskit/media-core": "^32.3.0",
97
96
  "@atlaskit/util-data-test": "^17.2.0",
98
97
  "@atlaskit/visual-regression": "*",
99
98
  "@atlaskit/webdriver-runner": "*",
@@ -107,7 +106,7 @@
107
106
  "react": "^16.8.0",
108
107
  "react-test-renderer": "^16.8.0",
109
108
  "sinon": "^2.2.0",
110
- "typescript": "3.9.6"
109
+ "typescript": "3.9.10"
111
110
  },
112
111
  "techstack": {
113
112
  "@atlassian/frontend": {
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "@atlaskit/editor-common/panel",
3
+ "main": "../dist/cjs/panel.js",
4
+ "module": "../dist/esm/panel.js",
5
+ "module:es2019": "../dist/es2019/panel.js",
6
+ "types": "../dist/types/panel.d.ts"
7
+ }