@atlaskit/editor-common 75.3.1 → 75.5.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 (56) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/analytics/index.js +6 -0
  3. package/dist/cjs/analytics/types/index.js +6 -0
  4. package/dist/cjs/analytics/types/table-events.js +16 -3
  5. package/dist/cjs/monitoring/error.js +1 -1
  6. package/dist/cjs/preset/builder.js +48 -48
  7. package/dist/cjs/ui/DropList/index.js +1 -1
  8. package/dist/cjs/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +6 -6
  9. package/dist/cjs/ui-menu/Dropdown/index.js +3 -2
  10. package/dist/cjs/ui-menu/DropdownMenu/index.js +2 -2
  11. package/dist/cjs/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +8 -8
  12. package/dist/cjs/ui-menu/ToolbarButton/index.js +1 -1
  13. package/dist/cjs/ui-react/with-react-editor-view-outer-listeners.js +4 -5
  14. package/dist/es2019/analytics/index.js +1 -1
  15. package/dist/es2019/analytics/types/index.js +1 -1
  16. package/dist/es2019/analytics/types/table-events.js +17 -0
  17. package/dist/es2019/monitoring/error.js +1 -1
  18. package/dist/es2019/preset/builder.js +48 -48
  19. package/dist/es2019/ui/DropList/index.js +1 -1
  20. package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +6 -6
  21. package/dist/es2019/ui-menu/Dropdown/index.js +3 -2
  22. package/dist/es2019/ui-menu/DropdownMenu/index.js +3 -2
  23. package/dist/es2019/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +8 -8
  24. package/dist/es2019/ui-menu/ToolbarButton/index.js +1 -1
  25. package/dist/es2019/ui-react/with-react-editor-view-outer-listeners.js +4 -5
  26. package/dist/esm/analytics/index.js +1 -1
  27. package/dist/esm/analytics/types/index.js +1 -1
  28. package/dist/esm/analytics/types/table-events.js +17 -0
  29. package/dist/esm/monitoring/error.js +1 -1
  30. package/dist/esm/preset/builder.js +48 -48
  31. package/dist/esm/ui/DropList/index.js +1 -1
  32. package/dist/esm/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +6 -6
  33. package/dist/esm/ui-menu/Dropdown/index.js +3 -2
  34. package/dist/esm/ui-menu/DropdownMenu/index.js +3 -2
  35. package/dist/esm/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +8 -8
  36. package/dist/esm/ui-menu/ToolbarButton/index.js +1 -1
  37. package/dist/esm/ui-react/with-react-editor-view-outer-listeners.js +4 -5
  38. package/dist/types/analytics/index.d.ts +1 -1
  39. package/dist/types/analytics/types/index.d.ts +1 -1
  40. package/dist/types/analytics/types/inline-comment-events.d.ts +2 -2
  41. package/dist/types/analytics/types/table-events.d.ts +26 -2
  42. package/dist/types/types/floating-toolbar.d.ts +4 -3
  43. package/dist/types/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.d.ts +1 -1
  44. package/dist/types/ui-menu/Dropdown/index.d.ts +3 -2
  45. package/dist/types/ui-menu/DropdownMenu/index.d.ts +1 -2
  46. package/dist/types/ui-menu/ToolbarButton/index.d.ts +3 -3
  47. package/dist/types-ts4.5/analytics/index.d.ts +1 -1
  48. package/dist/types-ts4.5/analytics/types/index.d.ts +1 -1
  49. package/dist/types-ts4.5/analytics/types/inline-comment-events.d.ts +2 -2
  50. package/dist/types-ts4.5/analytics/types/table-events.d.ts +26 -2
  51. package/dist/types-ts4.5/types/floating-toolbar.d.ts +4 -3
  52. package/dist/types-ts4.5/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.d.ts +1 -1
  53. package/dist/types-ts4.5/ui-menu/Dropdown/index.d.ts +3 -2
  54. package/dist/types-ts4.5/ui-menu/DropdownMenu/index.d.ts +1 -2
  55. package/dist/types-ts4.5/ui-menu/ToolbarButton/index.d.ts +3 -3
  56. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import React, { PureComponent } from 'react';
2
- import { OpenChangedEvent } from '../../ui/DropList';
3
- import { ArrowKeyNavigationProviderOptions } from '../ArrowKeyNavigationProvider/types';
2
+ import type { OpenChangedEvent } from '../../ui/DropList';
3
+ import type { ArrowKeyNavigationProviderOptions } from '../ArrowKeyNavigationProvider/types';
4
4
  export interface Props {
5
5
  mountTo?: HTMLElement;
6
6
  boundariesElement?: HTMLElement;
@@ -13,6 +13,7 @@ export interface Props {
13
13
  zIndex?: number;
14
14
  arrowKeyNavigationProviderOptions: ArrowKeyNavigationProviderOptions;
15
15
  dropdownListId?: string;
16
+ alignDropdownWithParentElement?: boolean;
16
17
  }
17
18
  export interface State {
18
19
  target?: HTMLElement;
@@ -1,7 +1,6 @@
1
- /** @jsx jsx */
2
1
  import React, { PureComponent } from 'react';
3
2
  import { jsx } from '@emotion/react';
4
- import { Props, State } from './types';
3
+ import type { Props, State } from './types';
5
4
  export type { MenuItem } from './types';
6
5
  /**
7
6
  * Wrapper around @atlaskit/droplist which uses Popup and Portal to render
@@ -1,9 +1,9 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
- import { ButtonProps } from '@atlaskit/button/types';
4
- import { PositionType } from '@atlaskit/tooltip';
3
+ import type { ButtonProps } from '@atlaskit/button/types';
4
+ import type { PositionType } from '@atlaskit/tooltip';
5
5
  import { TOOLBAR_ACTION_SUBJECT_ID } from '../../analytics';
6
- import { MenuItem } from '../DropdownMenu';
6
+ import type { MenuItem } from '../DropdownMenu';
7
7
  export declare const TOOLBAR_BUTTON: typeof TOOLBAR_ACTION_SUBJECT_ID;
8
8
  export type Props = {
9
9
  buttonId?: TOOLBAR_ACTION_SUBJECT_ID;
@@ -1,4 +1,4 @@
1
- export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT, } from './types';
1
+ export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT, } from './types';
2
2
  export type { AnalyticsDispatch, AnalyticsEventPayload, AnalyticsEventPayloadCallback, AnalyticsEventPayloadWithChannel, AnnotationAEP, AnnotationAEPAttributes, AnnotationActionType, AnnotationDraftAEPAttributes, AnnotationResolvedAEPAttributes, CaptionTrackAction, ColorPickerAEP, CommonListAnalyticsAttributes, RestartListsAttributesForListOutdented, CreateLinkInlineDialogActionType, CreateLinkInlineDialogEventPayload, DismissedCreateLinkInlineDialogAEP, DispatchAnalyticsEvent, EditLinkToolbarAEP, EnteredTextLinkSearchInputAEP, ErrorEventAttributes, ErrorEventPayload, ExperimentalEventPayload, ExtensionEventPayload, ExtensionType, FeatureExposureAEP, FormatEventPayload, GeneralEventPayload, HighlightedSearchResultsAEP, InputMethodInsertLink, InputMethodInsertMedia, InsertEventPayload, InsertSmartLinkAEP, ListEventPayload, MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, MediaResizeTrackAction, MediaInputResizeTrackAction, NodeCount, NodeEventPayload, OperationalAEP, PASTE_ACTION_SUBJECT_ID, PasteContent, PasteEventPayload, PasteSource, PasteType, PluginMethodReport, PluginPerformanceReportData, PluginsReport, QuickSearchPerfAEP, RecentActivitiesPerfAEP, SelectAllAEP, SelectCellAEP, SelectNodeAEP, SelectRangeAEP, SelectedSearchResultsAEP, SelectionEventPayload, SelectionJson, ShownPostQuerySearchResultsAEP, ShownPreQuerySearchResultsAEP, SimplifiedNode, SmartLinkNodeContext, SubstituteEventPayload, TableEventPayload, TextColorSelectedAEP, TextColorSelectedAttr, TextColorShowPaletteToggleAEP, TextColorShowPaletteToggleAttr, ToolbarEventPayload, TransactionEventPayload, TypeAheadPayload, UfoSessionCompletePayloadAEP, UnlinkToolbarAEP, ViewedCreateLinkInlineDialogAEP, FireAnalyticsCallback, FireAnalyticsEvent, FireAnalyticsEventPayload, InitialiseFragmentMarksAEP, ConnectedNodesAEP, DisconnectedSourceAEP, DisconnectedTargetAEP, GotConnectionsAEP, UpdatedFragmentMarkNameAEP, UpdatedSourceAEP, UpdatedTargetAEP, } from './types';
3
3
  export type { EditorAnalyticsAPI } from './api';
4
4
  export { fireAnalyticsEvent } from './fire-analytics-event';
@@ -8,7 +8,7 @@ export { PUNC, SYMBOL } from './substitute-events';
8
8
  export { BROWSER_FREEZE_INTERACTION_TYPE, FULL_WIDTH_MODE, MODE, PLATFORMS, } from './general-events';
9
9
  export { LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, USER_CONTEXT, } from './insert-events';
10
10
  export type { InputMethodInsertLink, InputMethodInsertMedia, InsertEventPayload, } from './insert-events';
11
- export { TABLE_ACTION, TABLE_BREAKOUT } from './table-events';
11
+ export { TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, } from './table-events';
12
12
  export type { TableEventPayload } from './table-events';
13
13
  export { PasteContents, PasteSources, PasteTypes } from './paste-events';
14
14
  export type { PASTE_ACTION_SUBJECT_ID, PasteContent, PasteEventPayload, PasteSource, PasteType, } from './paste-events';
@@ -1,5 +1,5 @@
1
- import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD } from './enums';
2
- import { TrackAEP } from './utils';
1
+ import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD } from './enums';
2
+ import type { TrackAEP } from './utils';
3
3
  export type AnnotationActionType = ACTION.INSERTED | ACTION.CLOSED | ACTION.EDITED | ACTION.DELETED | ACTION.OPENED | ACTION.RESOLVED | ACTION.VIEWED;
4
4
  export type AnnotationAEP = TrackAEP<AnnotationActionType, ACTION_SUBJECT.ANNOTATION, ACTION_SUBJECT_ID.INLINE_COMMENT, AnnotationAEPAttributes, undefined>;
5
5
  export type AnnotationAEPAttributes = undefined | {} | AnnotationDraftAEPAttributes | AnnotationResolvedAEPAttributes;
@@ -24,13 +24,25 @@ export declare enum TABLE_ACTION {
24
24
  DISTRIBUTED_COLUMNS_WIDTHS = "distributedColumnsWidths",
25
25
  FIXED = "fixed",
26
26
  RESIZED = "resized",
27
- RESIZE_PERF_SAMPLING = "resizePerfSampling"
27
+ RESIZE_PERF_SAMPLING = "resizePerfSampling",
28
+ OVERFLOW_CHANGED = "overflowChanged",
29
+ INITIAL_OVERFLOW_CAPTURED = "initialOverflowCaptured"
28
30
  }
29
31
  export declare enum TABLE_BREAKOUT {
30
32
  WIDE = "wide",
31
33
  FULL_WIDTH = "fullWidth",
32
34
  NORMAL = "normal"
33
35
  }
36
+ export declare enum TABLE_OVERFLOW_CHANGE_TRIGGER {
37
+ EXTERNAL = "external",
38
+ ADDED_COLUMN = "addedColumn",
39
+ DELETED_COLUMN = "deletedColumn",
40
+ RESIZED_COLUMN = "resizedColumn",
41
+ ENABLED_NUMBERED_COLUMN = "enabledNumberedColumn",
42
+ DISABLED_NUMBERED_COLUMN = "disabledNumberedColumn",
43
+ DISTRIBUTED_COLUMNS = "distributedColumnsWidths",
44
+ RESIZED = "resizedTable"
45
+ }
34
46
  interface SortColumn {
35
47
  sortOrder: SortOrder;
36
48
  mode: 'editor';
@@ -64,6 +76,13 @@ type ResizePreviewInfo = {
64
76
  docSize: number;
65
77
  nodeSize: number;
66
78
  };
79
+ type OverflowStateInfo = {
80
+ editorWidth: number;
81
+ isOverflowing: boolean;
82
+ tableResizingEnabled: boolean;
83
+ width: number;
84
+ parentWidth: number;
85
+ };
67
86
  type TableDeleteAEP = TableAEP<TABLE_ACTION.DELETED, {
68
87
  inputMethod: INPUT_METHOD.KEYBOARD | INPUT_METHOD.FLOATING_TB;
69
88
  } & TotalRowAndColCount, undefined>;
@@ -112,7 +131,12 @@ type TableCollapsedAEP = TableAEP<TABLE_ACTION.COLLAPSED, TotalRowAndColCount, u
112
131
  type TableFixedAEP = TableAEP<TABLE_ACTION.FIXED, {
113
132
  reason: string;
114
133
  }, undefined>;
134
+ type TableOverflowChangedAEP = TableAEP<TABLE_ACTION.OVERFLOW_CHANGED, {
135
+ wasOverflowing: boolean;
136
+ trigger: TABLE_OVERFLOW_CHANGE_TRIGGER;
137
+ } & OverflowStateInfo, undefined>;
138
+ type TableInitialOverflowCapturedAEP = TableAEP<TABLE_ACTION.INITIAL_OVERFLOW_CAPTURED, OverflowStateInfo, undefined>;
115
139
  type TableResizedAEP = TableAEP<TABLE_ACTION.RESIZED, ResizedInfo, undefined>;
116
140
  type TableResizePerfSamplingAEP = OperationalAEP<TABLE_ACTION.RESIZE_PERF_SAMPLING, ACTION_SUBJECT.TABLE, undefined, ResizePreviewInfo, undefined>;
117
- export type TableEventPayload = TableDeleteAEP | TableClearAEP | TableMergeSplitAEP | TableColorAEP | TableToggleHeaderAEP | TableChangeBreakoutAEP | TableCopyAndCutAEP | TableAddRowOrColumnAEP | TableSortColumnAEP | TableDeleteRowOrColumnAEP | TableReplaceAEP | TableAttemptedResizeAEP | TableDistributeColumnsWidthsAEP | TableCollapsedAEP | TableFixedAEP | TableResizedAEP | TableResizePerfSamplingAEP;
141
+ export type TableEventPayload = TableDeleteAEP | TableClearAEP | TableMergeSplitAEP | TableColorAEP | TableToggleHeaderAEP | TableChangeBreakoutAEP | TableCopyAndCutAEP | TableAddRowOrColumnAEP | TableSortColumnAEP | TableDeleteRowOrColumnAEP | TableReplaceAEP | TableAttemptedResizeAEP | TableDistributeColumnsWidthsAEP | TableCollapsedAEP | TableFixedAEP | TableOverflowChangedAEP | TableInitialOverflowCapturedAEP | TableResizedAEP | TableResizePerfSamplingAEP;
118
142
  export {};
@@ -1,8 +1,8 @@
1
1
  import type React from 'react';
2
- import { IntlShape } from 'react-intl-next';
3
- import { Node, NodeType } from '@atlaskit/editor-prosemirror/model';
2
+ import type { IntlShape } from 'react-intl-next';
3
+ import type { Node, NodeType } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
5
- import { EditorView } from '@atlaskit/editor-prosemirror/view';
5
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
6
  import type { EmojiId } from '@atlaskit/emoji/types';
7
7
  import type { DispatchAnalyticsEvent } from '../analytics/types/dispatch-analytics-event';
8
8
  import type { ProviderFactory } from '../provider-factory';
@@ -191,6 +191,7 @@ export type FloatingToolbarDropdown<T extends {}> = {
191
191
  tooltip?: string;
192
192
  dropdownWidth?: number;
193
193
  showSelected?: boolean;
194
+ alignDropdownWithToolbar?: boolean;
194
195
  };
195
196
  type FloatingToolbarExtensionsPlaceholder = {
196
197
  type: 'extensions-placeholder';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { MenuArrowKeyNavigationProviderProps } from '../types';
2
+ import type { MenuArrowKeyNavigationProviderProps } from '../types';
3
3
  /**
4
4
  * This component is a wrapper of vertical menus which listens to keydown events of children
5
5
  * and handles up/down arrow key navigation
@@ -1,6 +1,6 @@
1
1
  import React, { PureComponent } from 'react';
2
- import { OpenChangedEvent } from '../../ui/DropList';
3
- import { ArrowKeyNavigationProviderOptions } from '../ArrowKeyNavigationProvider/types';
2
+ import type { OpenChangedEvent } from '../../ui/DropList';
3
+ import type { ArrowKeyNavigationProviderOptions } from '../ArrowKeyNavigationProvider/types';
4
4
  export interface Props {
5
5
  mountTo?: HTMLElement;
6
6
  boundariesElement?: HTMLElement;
@@ -13,6 +13,7 @@ export interface Props {
13
13
  zIndex?: number;
14
14
  arrowKeyNavigationProviderOptions: ArrowKeyNavigationProviderOptions;
15
15
  dropdownListId?: string;
16
+ alignDropdownWithParentElement?: boolean;
16
17
  }
17
18
  export interface State {
18
19
  target?: HTMLElement;
@@ -1,7 +1,6 @@
1
- /** @jsx jsx */
2
1
  import React, { PureComponent } from 'react';
3
2
  import { jsx } from '@emotion/react';
4
- import { Props, State } from './types';
3
+ import type { Props, State } from './types';
5
4
  export type { MenuItem } from './types';
6
5
  /**
7
6
  * Wrapper around @atlaskit/droplist which uses Popup and Portal to render
@@ -1,9 +1,9 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
- import { ButtonProps } from '@atlaskit/button/types';
4
- import { PositionType } from '@atlaskit/tooltip';
3
+ import type { ButtonProps } from '@atlaskit/button/types';
4
+ import type { PositionType } from '@atlaskit/tooltip';
5
5
  import { TOOLBAR_ACTION_SUBJECT_ID } from '../../analytics';
6
- import { MenuItem } from '../DropdownMenu';
6
+ import type { MenuItem } from '../DropdownMenu';
7
7
  export declare const TOOLBAR_BUTTON: typeof TOOLBAR_ACTION_SUBJECT_ID;
8
8
  export type Props = {
9
9
  buttonId?: TOOLBAR_ACTION_SUBJECT_ID;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "75.3.1",
3
+ "version": "75.5.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/"