@atlaskit/editor-core 187.48.0 → 187.48.4

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 (93) hide show
  1. package/CHANGELOG.md +521 -507
  2. package/dist/cjs/{editor-next → composable-editor}/editor-internal.js +2 -22
  3. package/dist/cjs/{editor-next/index.js → composable-editor/editor.js} +14 -8
  4. package/dist/cjs/composable-editor.js +2 -3
  5. package/dist/cjs/editor.js +4 -4
  6. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +3 -70
  7. package/dist/cjs/plugins/floating-toolbar/utils.js +0 -41
  8. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +3 -1
  9. package/dist/cjs/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.js +28 -11
  10. package/dist/cjs/ui/CollapsedEditor/index.js +3 -3
  11. package/dist/cjs/version-wrapper.js +1 -1
  12. package/dist/es2019/{editor-next → composable-editor}/editor-internal.js +1 -23
  13. package/dist/es2019/{editor-next/index.js → composable-editor/editor.js} +14 -6
  14. package/dist/es2019/composable-editor.js +1 -1
  15. package/dist/es2019/editor.js +4 -4
  16. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +1 -52
  17. package/dist/es2019/plugins/floating-toolbar/utils.js +0 -36
  18. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +3 -1
  19. package/dist/es2019/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.js +21 -4
  20. package/dist/es2019/ui/CollapsedEditor/index.js +3 -3
  21. package/dist/es2019/version-wrapper.js +1 -1
  22. package/dist/esm/{editor-next → composable-editor}/editor-internal.js +1 -20
  23. package/dist/esm/{editor-next/index.js → composable-editor/editor.js} +14 -6
  24. package/dist/esm/composable-editor.js +1 -1
  25. package/dist/esm/editor.js +4 -4
  26. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +1 -66
  27. package/dist/esm/plugins/floating-toolbar/utils.js +0 -37
  28. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +3 -1
  29. package/dist/esm/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.js +21 -4
  30. package/dist/esm/ui/CollapsedEditor/index.js +3 -3
  31. package/dist/esm/version-wrapper.js +1 -1
  32. package/dist/{types-ts4.5/editor-next → types/composable-editor}/editor-internal.d.ts +4 -13
  33. package/dist/types/{editor-next/index.d.ts → composable-editor/editor.d.ts} +2 -4
  34. package/dist/types/{editor-next → composable-editor}/hooks/useMeasureEditorMountTime.d.ts +3 -3
  35. package/dist/types/{editor-next → composable-editor}/utils/getBaseFontSize.d.ts +1 -1
  36. package/dist/{types-ts4.5/editor-next → types/composable-editor}/utils/getProvidersFromEditorProps.d.ts +2 -2
  37. package/dist/types/{editor-next → composable-editor}/utils/sendDurationAnalytics.d.ts +4 -4
  38. package/dist/{types-ts4.5/editor-next → types/composable-editor}/utils/trackEditorActions.d.ts +3 -3
  39. package/dist/types/composable-editor.d.ts +1 -1
  40. package/dist/types/plugins/floating-toolbar/pm-plugins/toolbar-data/commands.d.ts +1 -1
  41. package/dist/types/plugins/floating-toolbar/pm-plugins/toolbar-data/plugin.d.ts +1 -1
  42. package/dist/types/plugins/floating-toolbar/ui/Select.d.ts +1 -1
  43. package/dist/types/plugins/floating-toolbar/ui/Toolbar.d.ts +3 -4
  44. package/dist/types/plugins/floating-toolbar/utils.d.ts +0 -2
  45. package/dist/{types/editor-next → types-ts4.5/composable-editor}/editor-internal.d.ts +4 -13
  46. package/dist/types-ts4.5/{editor-next/index.d.ts → composable-editor/editor.d.ts} +2 -4
  47. package/dist/types-ts4.5/{editor-next → composable-editor}/hooks/useMeasureEditorMountTime.d.ts +3 -3
  48. package/dist/types-ts4.5/{editor-next → composable-editor}/utils/getBaseFontSize.d.ts +1 -1
  49. package/dist/{types/editor-next → types-ts4.5/composable-editor}/utils/getProvidersFromEditorProps.d.ts +2 -2
  50. package/dist/types-ts4.5/{editor-next → composable-editor}/utils/sendDurationAnalytics.d.ts +4 -4
  51. package/dist/{types/editor-next → types-ts4.5/composable-editor}/utils/trackEditorActions.d.ts +3 -3
  52. package/dist/types-ts4.5/composable-editor.d.ts +1 -1
  53. package/dist/types-ts4.5/plugins/floating-toolbar/pm-plugins/toolbar-data/commands.d.ts +1 -1
  54. package/dist/types-ts4.5/plugins/floating-toolbar/pm-plugins/toolbar-data/plugin.d.ts +1 -1
  55. package/dist/types-ts4.5/plugins/floating-toolbar/ui/Select.d.ts +1 -1
  56. package/dist/types-ts4.5/plugins/floating-toolbar/ui/Toolbar.d.ts +3 -4
  57. package/dist/types-ts4.5/plugins/floating-toolbar/utils.d.ts +0 -2
  58. package/package.json +2 -2
  59. /package/dist/cjs/{editor-next → composable-editor}/hooks/useEditorMeasuresConstructor.js +0 -0
  60. /package/dist/cjs/{editor-next → composable-editor}/hooks/useMeasureEditorMountTime.js +0 -0
  61. /package/dist/cjs/{editor-next → composable-editor}/hooks/useProviderFactory.js +0 -0
  62. /package/dist/cjs/{editor-next → composable-editor}/utils/editorMeasureTTICallback.js +0 -0
  63. /package/dist/cjs/{editor-next → composable-editor}/utils/getBaseFontSize.js +0 -0
  64. /package/dist/cjs/{editor-next → composable-editor}/utils/getProvidersFromEditorProps.js +0 -0
  65. /package/dist/cjs/{editor-next → composable-editor}/utils/handleProviders.js +0 -0
  66. /package/dist/cjs/{editor-next → composable-editor}/utils/sendDurationAnalytics.js +0 -0
  67. /package/dist/cjs/{editor-next → composable-editor}/utils/trackEditorActions.js +0 -0
  68. /package/dist/es2019/{editor-next → composable-editor}/hooks/useEditorMeasuresConstructor.js +0 -0
  69. /package/dist/es2019/{editor-next → composable-editor}/hooks/useMeasureEditorMountTime.js +0 -0
  70. /package/dist/es2019/{editor-next → composable-editor}/hooks/useProviderFactory.js +0 -0
  71. /package/dist/es2019/{editor-next → composable-editor}/utils/editorMeasureTTICallback.js +0 -0
  72. /package/dist/es2019/{editor-next → composable-editor}/utils/getBaseFontSize.js +0 -0
  73. /package/dist/es2019/{editor-next → composable-editor}/utils/getProvidersFromEditorProps.js +0 -0
  74. /package/dist/es2019/{editor-next → composable-editor}/utils/handleProviders.js +0 -0
  75. /package/dist/es2019/{editor-next → composable-editor}/utils/sendDurationAnalytics.js +0 -0
  76. /package/dist/es2019/{editor-next → composable-editor}/utils/trackEditorActions.js +0 -0
  77. /package/dist/esm/{editor-next → composable-editor}/hooks/useEditorMeasuresConstructor.js +0 -0
  78. /package/dist/esm/{editor-next → composable-editor}/hooks/useMeasureEditorMountTime.js +0 -0
  79. /package/dist/esm/{editor-next → composable-editor}/hooks/useProviderFactory.js +0 -0
  80. /package/dist/esm/{editor-next → composable-editor}/utils/editorMeasureTTICallback.js +0 -0
  81. /package/dist/esm/{editor-next → composable-editor}/utils/getBaseFontSize.js +0 -0
  82. /package/dist/esm/{editor-next → composable-editor}/utils/getProvidersFromEditorProps.js +0 -0
  83. /package/dist/esm/{editor-next → composable-editor}/utils/handleProviders.js +0 -0
  84. /package/dist/esm/{editor-next → composable-editor}/utils/sendDurationAnalytics.js +0 -0
  85. /package/dist/esm/{editor-next → composable-editor}/utils/trackEditorActions.js +0 -0
  86. /package/dist/types/{editor-next → composable-editor}/hooks/useEditorMeasuresConstructor.d.ts +0 -0
  87. /package/dist/types/{editor-next → composable-editor}/hooks/useProviderFactory.d.ts +0 -0
  88. /package/dist/types/{editor-next → composable-editor}/utils/editorMeasureTTICallback.d.ts +0 -0
  89. /package/dist/types/{editor-next → composable-editor}/utils/handleProviders.d.ts +0 -0
  90. /package/dist/types-ts4.5/{editor-next → composable-editor}/hooks/useEditorMeasuresConstructor.d.ts +0 -0
  91. /package/dist/types-ts4.5/{editor-next → composable-editor}/hooks/useProviderFactory.d.ts +0 -0
  92. /package/dist/types-ts4.5/{editor-next → composable-editor}/utils/editorMeasureTTICallback.d.ts +0 -0
  93. /package/dist/types-ts4.5/{editor-next → composable-editor}/utils/handleProviders.d.ts +0 -0
@@ -5,17 +5,15 @@ import type { FireAnalyticsCallback } from '@atlaskit/editor-common/analytics';
5
5
  import type { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
6
6
  import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
7
7
  import type { AllEditorPresetPluginTypes, Transformer } from '@atlaskit/editor-common/types';
8
- import type { ExperienceStore } from '@atlaskit/editor-common/ufo';
9
8
  import type EditorActions from '../actions';
10
9
  import type { EventDispatcher } from '../event-dispatcher';
11
- import type { EditorNextProps, EditorProps } from '../types/editor-props';
12
- interface Props<PropsType> {
13
- props: PropsType;
10
+ import type { EditorNextProps } from '../types/editor-props';
11
+ interface InternalProps {
12
+ props: EditorNextProps;
14
13
  handleAnalyticsEvent: FireAnalyticsCallback;
15
14
  createAnalyticsEvent: CreateUIAnalyticsEvent;
16
15
  handleSave: (view: EditorView) => void;
17
16
  editorActions: EditorActions;
18
- getExperienceStore: () => ExperienceStore | undefined;
19
17
  onEditorCreated: (instance: {
20
18
  view: EditorView;
21
19
  eventDispatcher: EventDispatcher;
@@ -26,18 +24,11 @@ interface Props<PropsType> {
26
24
  transformer?: Transformer<string>;
27
25
  }) => void;
28
26
  preset: EditorPresetBuilder<string[], AllEditorPresetPluginTypes[]>;
29
- }
30
- interface InternalProps extends Omit<Props<EditorNextProps | EditorProps>, 'getExperienceStore'> {
31
27
  providerFactory: ProviderFactory;
32
28
  }
33
- /**
34
- * EditorInternal is used for the internal editor react component
35
- * with the lifecycle methods extracted into hooks.
36
- */
37
- export default function EditorInternal(props: Props<EditorNextProps>): jsx.JSX.Element;
38
29
  /**
39
30
  * EditorInternalComponent is used to capture the common component
40
31
  * from the `render` method of `Editor` and share it with `EditorNext`.
41
32
  */
42
- export declare function EditorInternalWithoutHooks({ props, handleAnalyticsEvent, createAnalyticsEvent, handleSave, editorActions, providerFactory, onEditorCreated, onEditorDestroyed, preset, }: InternalProps): jsx.JSX.Element;
33
+ export declare function EditorInternal({ props, handleAnalyticsEvent, createAnalyticsEvent, handleSave, editorActions, providerFactory, onEditorCreated, onEditorDestroyed, preset, }: InternalProps): jsx.JSX.Element;
43
34
  export {};
@@ -1,11 +1,9 @@
1
1
  import { jsx } from '@emotion/react';
2
2
  import type { EditorNextProps } from '../types/editor-props';
3
- export declare function Editor(passedProps: EditorNextProps): jsx.JSX.Element;
4
- declare function EditorNext(props: EditorNextProps): jsx.JSX.Element;
5
- declare namespace EditorNext {
3
+ export declare function ComposableEditor(props: EditorNextProps): jsx.JSX.Element;
4
+ export declare namespace ComposableEditor {
6
5
  var propTypes: {
7
6
  minHeight: ({ appearance, minHeight, }: Pick<EditorNextProps, "appearance" | "minHeight">) => Error | null;
8
7
  preset: ({ preset }: Pick<EditorNextProps, "preset">) => Error | null;
9
8
  };
10
9
  }
11
- export default EditorNext;
@@ -1,6 +1,6 @@
1
- import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
- import { ExperienceStore } from '@atlaskit/editor-common/ufo';
3
- import { EditorNextProps, EditorProps } from '../../types/editor-props';
1
+ import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
+ import type { ExperienceStore } from '@atlaskit/editor-common/ufo';
3
+ import type { EditorNextProps, EditorProps } from '../../types/editor-props';
4
4
  /**
5
5
  *
6
6
  * Hook to run the analytics for the Editor component.
@@ -1,4 +1,4 @@
1
- import { EditorAppearance } from '@atlaskit/editor-common/types';
1
+ import type { EditorAppearance } from '@atlaskit/editor-common/types';
2
2
  /**
3
3
  * @param appearance
4
4
  * @returns default font size if valid
@@ -1,5 +1,5 @@
1
- import { Providers } from '@atlaskit/editor-common/provider-factory';
2
- import { EditorProps } from '../../types/editor-props';
1
+ import type { Providers } from '@atlaskit/editor-common/provider-factory';
2
+ import type { EditorProps } from '../../types/editor-props';
3
3
  type Complete<T> = {
4
4
  [P in keyof Required<T>]: Pick<T, P> extends Required<Pick<T, P>> ? T[P] : T[P] | undefined;
5
5
  };
@@ -1,7 +1,7 @@
1
- import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
- import { ACTION } from '@atlaskit/editor-common/analytics';
3
- import { ExperienceStore } from '@atlaskit/editor-common/ufo';
4
- import { EditorProps } from '../../types/editor-props';
1
+ import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
+ import type { ACTION } from '@atlaskit/editor-common/analytics';
3
+ import type { ExperienceStore } from '@atlaskit/editor-common/ufo';
4
+ import type { EditorProps } from '../../types/editor-props';
5
5
  /**
6
6
  *
7
7
  * Util function to be used with the Editor component to send duration analytics
@@ -1,6 +1,6 @@
1
- import { FireAnalyticsCallback } from '@atlaskit/editor-common/analytics';
2
- import EditorActions from '../../actions';
3
- import { PerformanceTracking } from '../../types/performance-tracking';
1
+ import type { FireAnalyticsCallback } from '@atlaskit/editor-common/analytics';
2
+ import type EditorActions from '../../actions';
3
+ import type { PerformanceTracking } from '../../types/performance-tracking';
4
4
  /**
5
5
  *
6
6
  * Util function to be used with the Editor to track the EditorActions prop
@@ -1 +1 @@
1
- export { default as ComposableEditor } from './editor-next';
1
+ export { ComposableEditor } from './composable-editor/editor';
@@ -1,3 +1,3 @@
1
- import { Command } from '@atlaskit/editor-common/types';
1
+ import type { Command } from '@atlaskit/editor-common/types';
2
2
  export declare const showConfirmDialog: (buttonIndex: number) => Command;
3
3
  export declare const hideConfirmDialog: () => Command;
@@ -1,3 +1,3 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
2
+ import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
3
3
  export declare const createPlugin: (dispatch: Dispatch) => SafePlugin<import("@atlaskit/editor-plugin-floating-toolbar").FloatingToolbarPluginData>;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ValueType } from '@atlaskit/select';
2
+ import type { ValueType } from '@atlaskit/select';
3
3
  import type { RenderOptionsPropsT, SelectOption } from '@atlaskit/editor-common/types';
4
4
  export type { RenderOptionsPropsT, SelectOption };
5
5
  export interface Props {
@@ -6,11 +6,12 @@ import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
6
6
  import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
7
7
  import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
8
8
  import type { WrappedComponentProps } from 'react-intl-next';
9
- import type { FloatingToolbarItem, FeatureFlags, PluginInjectionAPIWithDependencies, OptionalPlugin } from '@atlaskit/editor-common/types';
9
+ import type { FeatureFlags, PluginInjectionAPIWithDependencies, OptionalPlugin } from '@atlaskit/editor-common/types';
10
10
  import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
11
11
  import type { contextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
12
12
  import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
13
- export type Item = FloatingToolbarItem<Function>;
13
+ import type { Item } from '@atlaskit/editor-common/floating-toolbar';
14
+ export type { Item };
14
15
  export interface Props {
15
16
  items: Array<Item>;
16
17
  dispatchCommand: (command?: Function) => void;
@@ -33,8 +34,6 @@ export interface Props {
33
34
  OptionalPlugin<ExtensionPlugin>
34
35
  ]> | undefined;
35
36
  }
36
- export declare const isSameItem: (leftItem: Item, rightItem: Item) => boolean;
37
- export declare const areSameItems: (leftArr?: Array<Item>, rightArr?: Array<Item>) => boolean;
38
37
  export interface State {
39
38
  scrollDisabled: boolean;
40
39
  mounted: boolean;
@@ -1,4 +1,2 @@
1
1
  import type { Node } from '@atlaskit/editor-prosemirror/model';
2
- export declare const shallowEqual: (objA?: Object, objB?: Object) => boolean;
3
- export declare const compareArrays: <T extends any[]>(left: T[], right: T[], compareFn?: (left: T, right: T) => boolean) => boolean;
4
2
  export declare function findNode(parent: Node, predicate: (node: Node) => boolean): Node | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.48.0",
3
+ "version": "187.48.4",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -55,7 +55,7 @@
55
55
  "@atlaskit/code": "^14.6.0",
56
56
  "@atlaskit/date": "^0.10.0",
57
57
  "@atlaskit/datetime-picker": "^12.10.0",
58
- "@atlaskit/editor-common": "^76.0.0",
58
+ "@atlaskit/editor-common": "^76.1.0",
59
59
  "@atlaskit/editor-json-transformer": "^8.10.0",
60
60
  "@atlaskit/editor-markdown-transformer": "^5.2.5",
61
61
  "@atlaskit/editor-palette": "1.5.1",