@atlaskit/editor-core 193.15.5 → 193.17.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 193.17.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#98727](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98727)
8
+ [`057b3d93e3d4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/057b3d93e3d4) -
9
+ The `usePreset` hook from editor-core previously required the EditorContext in order to have a
10
+ valid editorApi as a return value (otherwise it is undefined). This is confusing to developers
11
+ so this improvement allows the API value to be resolved without EditorContext - simplifying what
12
+ is required to setup the editor.
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
18
+ ## 193.16.0
19
+
20
+ ### Minor Changes
21
+
22
+ - [#99771](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/99771)
23
+ [`3cd9b2d8ae80`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3cd9b2d8ae80) -
24
+ [ux] ED-22923 Tables - Added alignment toolbat button
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies
29
+
3
30
  ## 193.15.5
4
31
 
5
32
  ### Patch Changes
@@ -43,17 +43,12 @@ var EditorInternal = exports.EditorInternal = /*#__PURE__*/(0, _react.memo)(func
43
43
  onEditorDestroyed = _ref.onEditorDestroyed,
44
44
  preset = _ref.preset;
45
45
  var Component = (0, _createEditor.getUiComponent)(props.appearance);
46
- var _setInternalEditorApi = (0, _context.useSetPresetContext)();
47
46
  var setEditorApi = (0, _react.useCallback)(function (api) {
48
- if (_setInternalEditorApi) {
49
- _setInternalEditorApi(api);
50
- }
51
-
52
47
  // This is an workaround to unblock Editor Lego Decoupling project, if you have questions ping us #cc-editor-lego
53
48
  // We may clean up this code when EditorActions deprecation process starts
54
49
  // @ts-expect-error 2339: Property '__EDITOR_INTERNALS_DO_NOT_USE__API' does not exist on type 'EditorActions<any>'.
55
50
  editorActions.__EDITOR_INTERNALS_DO_NOT_USE__API = api;
56
- }, [_setInternalEditorApi, editorActions]);
51
+ }, [editorActions]);
57
52
  var overriddenEditorProps = _objectSpread(_objectSpread({}, props), {}, {
58
53
  onSave: props.onSave ? handleSave : undefined,
59
54
  // noop all analytic events, even if a handler is still passed.
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.usePreset = usePreset;
8
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
7
9
  var _react = require("react");
8
10
  var _preset = require("@atlaskit/editor-common/preset");
9
- var _context = require("./presets/context");
10
11
  /**
11
12
  * Creates a preset.
12
13
  *
@@ -23,8 +24,8 @@ var _context = require("./presets/context");
23
24
  * Example:
24
25
  * ```ts
25
26
  * function ExampleEditor() {
26
- * const { preset, editorApi } = usePreset(() =>
27
- * new EditorPresetBuilder().add(plugin1).add(plugin2)
27
+ * const { preset, editorApi } = usePreset((builder) =>
28
+ * builder.add(plugin1).add(plugin2)
28
29
  * , []);
29
30
  *
30
31
  * // Can execute typesafe commands based on plugin1 or 2
@@ -42,12 +43,20 @@ var _context = require("./presets/context");
42
43
  */
43
44
  function usePreset(createPreset) {
44
45
  var dependencies = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
45
- var editorApi = (0, _context.usePresetContext)();
46
+ var _useState = (0, _react.useState)(undefined),
47
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
48
+ editorApi = _useState2[0],
49
+ setAPI = _useState2[1];
46
50
  var preset = (0, _react.useMemo)(function () {
47
51
  return createPreset(new _preset.EditorPresetBuilder());
48
52
  },
49
53
  // eslint-disable-next-line react-hooks/exhaustive-deps
50
54
  dependencies);
55
+ (0, _react.useLayoutEffect)(function () {
56
+ preset.apiPromise.then(function (api) {
57
+ setAPI(api);
58
+ });
59
+ }, [preset.apiPromise]);
51
60
  return {
52
61
  editorApi: editorApi,
53
62
  preset: preset
@@ -5,4 +5,4 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
- var version = exports.version = "193.15.5";
8
+ var version = exports.version = "193.17.0";
@@ -34,17 +34,12 @@ export const EditorInternal = /*#__PURE__*/memo(({
34
34
  }) => {
35
35
  var _props$performanceTra, _props$performanceTra2, _props$performanceTra3, _props$performanceTra4;
36
36
  const Component = getUiComponent(props.appearance);
37
- const _setInternalEditorApi = useSetPresetContext();
38
37
  const setEditorApi = useCallback(api => {
39
- if (_setInternalEditorApi) {
40
- _setInternalEditorApi(api);
41
- }
42
-
43
38
  // This is an workaround to unblock Editor Lego Decoupling project, if you have questions ping us #cc-editor-lego
44
39
  // We may clean up this code when EditorActions deprecation process starts
45
40
  // @ts-expect-error 2339: Property '__EDITOR_INTERNALS_DO_NOT_USE__API' does not exist on type 'EditorActions<any>'.
46
41
  editorActions.__EDITOR_INTERNALS_DO_NOT_USE__API = api;
47
- }, [_setInternalEditorApi, editorActions]);
42
+ }, [editorActions]);
48
43
  const overriddenEditorProps = {
49
44
  ...props,
50
45
  onSave: props.onSave ? handleSave : undefined,
@@ -1,6 +1,5 @@
1
- import { useMemo } from 'react';
1
+ import { useLayoutEffect, useMemo, useState } from 'react';
2
2
  import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
3
- import { usePresetContext } from './presets/context';
4
3
  /**
5
4
  * Creates a preset.
6
5
  *
@@ -17,8 +16,8 @@ import { usePresetContext } from './presets/context';
17
16
  * Example:
18
17
  * ```ts
19
18
  * function ExampleEditor() {
20
- * const { preset, editorApi } = usePreset(() =>
21
- * new EditorPresetBuilder().add(plugin1).add(plugin2)
19
+ * const { preset, editorApi } = usePreset((builder) =>
20
+ * builder.add(plugin1).add(plugin2)
22
21
  * , []);
23
22
  *
24
23
  * // Can execute typesafe commands based on plugin1 or 2
@@ -35,10 +34,15 @@ import { usePresetContext } from './presets/context';
35
34
  * ```
36
35
  */
37
36
  export function usePreset(createPreset, dependencies = []) {
38
- const editorApi = usePresetContext();
37
+ const [editorApi, setAPI] = useState(undefined);
39
38
  const preset = useMemo(() => createPreset(new EditorPresetBuilder()),
40
39
  // eslint-disable-next-line react-hooks/exhaustive-deps
41
40
  dependencies);
41
+ useLayoutEffect(() => {
42
+ preset.apiPromise.then(api => {
43
+ setAPI(api);
44
+ });
45
+ }, [preset.apiPromise]);
42
46
  return {
43
47
  editorApi,
44
48
  preset
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "193.15.5";
2
+ export const version = "193.17.0";
@@ -37,17 +37,12 @@ export var EditorInternal = /*#__PURE__*/memo(function (_ref) {
37
37
  onEditorDestroyed = _ref.onEditorDestroyed,
38
38
  preset = _ref.preset;
39
39
  var Component = getUiComponent(props.appearance);
40
- var _setInternalEditorApi = useSetPresetContext();
41
40
  var setEditorApi = useCallback(function (api) {
42
- if (_setInternalEditorApi) {
43
- _setInternalEditorApi(api);
44
- }
45
-
46
41
  // This is an workaround to unblock Editor Lego Decoupling project, if you have questions ping us #cc-editor-lego
47
42
  // We may clean up this code when EditorActions deprecation process starts
48
43
  // @ts-expect-error 2339: Property '__EDITOR_INTERNALS_DO_NOT_USE__API' does not exist on type 'EditorActions<any>'.
49
44
  editorActions.__EDITOR_INTERNALS_DO_NOT_USE__API = api;
50
- }, [_setInternalEditorApi, editorActions]);
45
+ }, [editorActions]);
51
46
  var overriddenEditorProps = _objectSpread(_objectSpread({}, props), {}, {
52
47
  onSave: props.onSave ? handleSave : undefined,
53
48
  // noop all analytic events, even if a handler is still passed.
@@ -1,6 +1,6 @@
1
- import { useMemo } from 'react';
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import { useLayoutEffect, useMemo, useState } from 'react';
2
3
  import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
3
- import { usePresetContext } from './presets/context';
4
4
  /**
5
5
  * Creates a preset.
6
6
  *
@@ -17,8 +17,8 @@ import { usePresetContext } from './presets/context';
17
17
  * Example:
18
18
  * ```ts
19
19
  * function ExampleEditor() {
20
- * const { preset, editorApi } = usePreset(() =>
21
- * new EditorPresetBuilder().add(plugin1).add(plugin2)
20
+ * const { preset, editorApi } = usePreset((builder) =>
21
+ * builder.add(plugin1).add(plugin2)
22
22
  * , []);
23
23
  *
24
24
  * // Can execute typesafe commands based on plugin1 or 2
@@ -36,12 +36,20 @@ import { usePresetContext } from './presets/context';
36
36
  */
37
37
  export function usePreset(createPreset) {
38
38
  var dependencies = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
39
- var editorApi = usePresetContext();
39
+ var _useState = useState(undefined),
40
+ _useState2 = _slicedToArray(_useState, 2),
41
+ editorApi = _useState2[0],
42
+ setAPI = _useState2[1];
40
43
  var preset = useMemo(function () {
41
44
  return createPreset(new EditorPresetBuilder());
42
45
  },
43
46
  // eslint-disable-next-line react-hooks/exhaustive-deps
44
47
  dependencies);
48
+ useLayoutEffect(function () {
49
+ preset.apiPromise.then(function (api) {
50
+ setAPI(api);
51
+ });
52
+ }, [preset.apiPromise]);
45
53
  return {
46
54
  editorApi: editorApi,
47
55
  preset: preset
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "193.15.5";
2
+ export var version = "193.17.0";
@@ -22,7 +22,9 @@ import type { EditorAppearance, EditorConfig, EditorPlugin, EditorProps, EditorR
22
22
  import type { EditorNextProps } from '../types/editor-props';
23
23
  import { TransactionTracker } from '../utils/performance/track-transactions';
24
24
  export interface EditorViewProps {
25
- editorProps: EditorProps | EditorNextProps;
25
+ editorProps: (EditorProps | EditorNextProps) & {
26
+ preset?: EditorNextProps['preset'];
27
+ };
26
28
  createAnalyticsEvent?: CreateUIAnalyticsEvent;
27
29
  providerFactory: ProviderFactory;
28
30
  portalProviderAPI: LegacyPortalProviderAPI | PortalProviderAPI;
@@ -2816,7 +2816,47 @@ export declare function createPreset(props: EditorProps, prevProps?: EditorProps
2816
2816
  sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
2817
2817
  }, import("@atlaskit/editor-common/types").FeatureFlags>>];
2818
2818
  actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
2819
- }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>];
2819
+ }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"highlight", {
2820
+ dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
2821
+ pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
2822
+ sharedState: {
2823
+ createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
2824
+ attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
2825
+ performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
2826
+ };
2827
+ dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
2828
+ pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
2829
+ sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
2830
+ }, import("@atlaskit/editor-common/types").FeatureFlags>>];
2831
+ actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
2832
+ }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"textFormatting", {
2833
+ pluginConfiguration: import("@atlaskit/editor-common/types").TextFormattingOptions | undefined;
2834
+ dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
2835
+ pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
2836
+ sharedState: {
2837
+ createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
2838
+ attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
2839
+ performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
2840
+ };
2841
+ dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
2842
+ pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
2843
+ sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
2844
+ }, import("@atlaskit/editor-common/types").FeatureFlags>>];
2845
+ actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
2846
+ }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>];
2847
+ commands: {
2848
+ toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
2849
+ toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
2850
+ toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
2851
+ toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
2852
+ toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
2853
+ toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
2854
+ toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
2855
+ };
2856
+ sharedState: import("@atlaskit/editor-common/types").TextFormattingState | undefined;
2857
+ }, import("@atlaskit/editor-common/types").TextFormattingOptions | undefined>>];
2858
+ sharedState: import("@atlaskit/editor-plugin-highlight").HighlightPluginState | undefined;
2859
+ }, undefined>>];
2820
2860
  actions: {
2821
2861
  changeColor: (color: string) => import("@atlaskit/editor-common/types").Command;
2822
2862
  };
@@ -2833,7 +2833,47 @@ export default function createUniversalPreset(appearance: EditorAppearance | und
2833
2833
  sharedState: FeatureFlags;
2834
2834
  }, FeatureFlags>>];
2835
2835
  actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
2836
- }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>];
2836
+ }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"highlight", {
2837
+ dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
2838
+ pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
2839
+ sharedState: {
2840
+ createAnalyticsEvent: CreateUIAnalyticsEvent | null;
2841
+ attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
2842
+ performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
2843
+ };
2844
+ dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
2845
+ pluginConfiguration: FeatureFlags;
2846
+ sharedState: FeatureFlags;
2847
+ }, FeatureFlags>>];
2848
+ actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
2849
+ }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"textFormatting", {
2850
+ pluginConfiguration: import("@atlaskit/editor-common/types").TextFormattingOptions | undefined;
2851
+ dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
2852
+ pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
2853
+ sharedState: {
2854
+ createAnalyticsEvent: CreateUIAnalyticsEvent | null;
2855
+ attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
2856
+ performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
2857
+ };
2858
+ dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
2859
+ pluginConfiguration: FeatureFlags;
2860
+ sharedState: FeatureFlags;
2861
+ }, FeatureFlags>>];
2862
+ actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
2863
+ }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>];
2864
+ commands: {
2865
+ toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
2866
+ toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
2867
+ toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
2868
+ toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
2869
+ toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
2870
+ toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
2871
+ toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
2872
+ };
2873
+ sharedState: import("@atlaskit/editor-common/types").TextFormattingState | undefined;
2874
+ }, import("@atlaskit/editor-common/types").TextFormattingOptions | undefined>>];
2875
+ sharedState: import("@atlaskit/editor-plugin-highlight").HighlightPluginState | undefined;
2876
+ }, undefined>>];
2837
2877
  actions: {
2838
2878
  changeColor: (color: string) => import("@atlaskit/editor-common/types").Command;
2839
2879
  };
@@ -2819,7 +2819,47 @@ export default function useUniversalPreset({ props }: PresetProps): import("@atl
2819
2819
  sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
2820
2820
  }, import("@atlaskit/editor-common/types").FeatureFlags>>];
2821
2821
  actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
2822
- }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>];
2822
+ }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"highlight", {
2823
+ dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"analytics", {
2824
+ pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
2825
+ sharedState: {
2826
+ createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
2827
+ attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
2828
+ performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
2829
+ };
2830
+ dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"featureFlags", {
2831
+ pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
2832
+ sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
2833
+ }, import("@atlaskit/editor-common/types").FeatureFlags>>];
2834
+ actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
2835
+ }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"textFormatting", {
2836
+ pluginConfiguration: import("@atlaskit/editor-common/types").TextFormattingOptions | undefined;
2837
+ dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"analytics", {
2838
+ pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
2839
+ sharedState: {
2840
+ createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
2841
+ attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
2842
+ performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
2843
+ };
2844
+ dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"featureFlags", {
2845
+ pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
2846
+ sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
2847
+ }, import("@atlaskit/editor-common/types").FeatureFlags>>];
2848
+ actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
2849
+ }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>];
2850
+ commands: {
2851
+ toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
2852
+ toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
2853
+ toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
2854
+ toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
2855
+ toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
2856
+ toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
2857
+ toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
2858
+ };
2859
+ sharedState: import("@atlaskit/editor-common/types").TextFormattingState | undefined;
2860
+ }, import("@atlaskit/editor-common/types").TextFormattingOptions | undefined>>];
2861
+ sharedState: import("@atlaskit/editor-plugin-highlight").HighlightPluginState | undefined;
2862
+ }, undefined>>];
2823
2863
  actions: {
2824
2864
  changeColor: (color: string) => import("@atlaskit/editor-common/types").Command;
2825
2865
  };
@@ -21,8 +21,8 @@ interface PresetAPI<PluginNames extends string[] = [], StackPlugins extends AllE
21
21
  * Example:
22
22
  * ```ts
23
23
  * function ExampleEditor() {
24
- * const { preset, editorApi } = usePreset(() =>
25
- * new EditorPresetBuilder().add(plugin1).add(plugin2)
24
+ * const { preset, editorApi } = usePreset((builder) =>
25
+ * builder.add(plugin1).add(plugin2)
26
26
  * , []);
27
27
  *
28
28
  * // Can execute typesafe commands based on plugin1 or 2
@@ -22,7 +22,9 @@ import type { EditorAppearance, EditorConfig, EditorPlugin, EditorProps, EditorR
22
22
  import type { EditorNextProps } from '../types/editor-props';
23
23
  import { TransactionTracker } from '../utils/performance/track-transactions';
24
24
  export interface EditorViewProps {
25
- editorProps: EditorProps | EditorNextProps;
25
+ editorProps: (EditorProps | EditorNextProps) & {
26
+ preset?: EditorNextProps['preset'];
27
+ };
26
28
  createAnalyticsEvent?: CreateUIAnalyticsEvent;
27
29
  providerFactory: ProviderFactory;
28
30
  portalProviderAPI: LegacyPortalProviderAPI | PortalProviderAPI;
@@ -3495,7 +3495,57 @@ export declare function createPreset(props: EditorProps, prevProps?: EditorProps
3495
3495
  }, import("@atlaskit/editor-common/types").FeatureFlags>>
3496
3496
  ];
3497
3497
  actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
3498
- }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>
3498
+ }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>,
3499
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"highlight", {
3500
+ dependencies: [
3501
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
3502
+ pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
3503
+ sharedState: {
3504
+ createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
3505
+ attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
3506
+ performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
3507
+ };
3508
+ dependencies: [
3509
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
3510
+ pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
3511
+ sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
3512
+ }, import("@atlaskit/editor-common/types").FeatureFlags>>
3513
+ ];
3514
+ actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
3515
+ }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>,
3516
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"textFormatting", {
3517
+ pluginConfiguration: import("@atlaskit/editor-common/types").TextFormattingOptions | undefined;
3518
+ dependencies: [
3519
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
3520
+ pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
3521
+ sharedState: {
3522
+ createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
3523
+ attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
3524
+ performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
3525
+ };
3526
+ dependencies: [
3527
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
3528
+ pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
3529
+ sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
3530
+ }, import("@atlaskit/editor-common/types").FeatureFlags>>
3531
+ ];
3532
+ actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
3533
+ }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>
3534
+ ];
3535
+ commands: {
3536
+ toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
3537
+ toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
3538
+ toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
3539
+ toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
3540
+ toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
3541
+ toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
3542
+ toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
3543
+ };
3544
+ sharedState: import("@atlaskit/editor-common/types").TextFormattingState | undefined;
3545
+ }, import("@atlaskit/editor-common/types").TextFormattingOptions | undefined>>
3546
+ ];
3547
+ sharedState: import("@atlaskit/editor-plugin-highlight").HighlightPluginState | undefined;
3548
+ }, undefined>>
3499
3549
  ];
3500
3550
  actions: {
3501
3551
  changeColor: (color: string) => import("@atlaskit/editor-common/types").Command;
@@ -3512,7 +3512,57 @@ export default function createUniversalPreset(appearance: EditorAppearance | und
3512
3512
  }, FeatureFlags>>
3513
3513
  ];
3514
3514
  actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
3515
- }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>
3515
+ }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>,
3516
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"highlight", {
3517
+ dependencies: [
3518
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
3519
+ pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
3520
+ sharedState: {
3521
+ createAnalyticsEvent: CreateUIAnalyticsEvent | null;
3522
+ attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
3523
+ performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
3524
+ };
3525
+ dependencies: [
3526
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
3527
+ pluginConfiguration: FeatureFlags;
3528
+ sharedState: FeatureFlags;
3529
+ }, FeatureFlags>>
3530
+ ];
3531
+ actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
3532
+ }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>,
3533
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"textFormatting", {
3534
+ pluginConfiguration: import("@atlaskit/editor-common/types").TextFormattingOptions | undefined;
3535
+ dependencies: [
3536
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
3537
+ pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
3538
+ sharedState: {
3539
+ createAnalyticsEvent: CreateUIAnalyticsEvent | null;
3540
+ attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
3541
+ performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
3542
+ };
3543
+ dependencies: [
3544
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
3545
+ pluginConfiguration: FeatureFlags;
3546
+ sharedState: FeatureFlags;
3547
+ }, FeatureFlags>>
3548
+ ];
3549
+ actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
3550
+ }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>
3551
+ ];
3552
+ commands: {
3553
+ toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
3554
+ toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
3555
+ toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
3556
+ toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
3557
+ toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
3558
+ toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
3559
+ toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
3560
+ };
3561
+ sharedState: import("@atlaskit/editor-common/types").TextFormattingState | undefined;
3562
+ }, import("@atlaskit/editor-common/types").TextFormattingOptions | undefined>>
3563
+ ];
3564
+ sharedState: import("@atlaskit/editor-plugin-highlight").HighlightPluginState | undefined;
3565
+ }, undefined>>
3516
3566
  ];
3517
3567
  actions: {
3518
3568
  changeColor: (color: string) => import("@atlaskit/editor-common/types").Command;
@@ -3498,7 +3498,57 @@ export default function useUniversalPreset({ props }: PresetProps): import("@atl
3498
3498
  }, import("@atlaskit/editor-common/types").FeatureFlags>>
3499
3499
  ];
3500
3500
  actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
3501
- }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>
3501
+ }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>,
3502
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"highlight", {
3503
+ dependencies: [
3504
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"analytics", {
3505
+ pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
3506
+ sharedState: {
3507
+ createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
3508
+ attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
3509
+ performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
3510
+ };
3511
+ dependencies: [
3512
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"featureFlags", {
3513
+ pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
3514
+ sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
3515
+ }, import("@atlaskit/editor-common/types").FeatureFlags>>
3516
+ ];
3517
+ actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
3518
+ }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>,
3519
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"textFormatting", {
3520
+ pluginConfiguration: import("@atlaskit/editor-common/types").TextFormattingOptions | undefined;
3521
+ dependencies: [
3522
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"analytics", {
3523
+ pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
3524
+ sharedState: {
3525
+ createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
3526
+ attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
3527
+ performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
3528
+ };
3529
+ dependencies: [
3530
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"featureFlags", {
3531
+ pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
3532
+ sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
3533
+ }, import("@atlaskit/editor-common/types").FeatureFlags>>
3534
+ ];
3535
+ actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
3536
+ }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>
3537
+ ];
3538
+ commands: {
3539
+ toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
3540
+ toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
3541
+ toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
3542
+ toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
3543
+ toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
3544
+ toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
3545
+ toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
3546
+ };
3547
+ sharedState: import("@atlaskit/editor-common/types").TextFormattingState | undefined;
3548
+ }, import("@atlaskit/editor-common/types").TextFormattingOptions | undefined>>
3549
+ ];
3550
+ sharedState: import("@atlaskit/editor-plugin-highlight").HighlightPluginState | undefined;
3551
+ }, undefined>>
3502
3552
  ];
3503
3553
  actions: {
3504
3554
  changeColor: (color: string) => import("@atlaskit/editor-common/types").Command;
@@ -23,8 +23,8 @@ interface PresetAPI<PluginNames extends string[] = [
23
23
  * Example:
24
24
  * ```ts
25
25
  * function ExampleEditor() {
26
- * const { preset, editorApi } = usePreset(() =>
27
- * new EditorPresetBuilder().add(plugin1).add(plugin2)
26
+ * const { preset, editorApi } = usePreset((builder) =>
27
+ * builder.add(plugin1).add(plugin2)
28
28
  * , []);
29
29
  *
30
30
  * // Can execute typesafe commands based on plugin1 or 2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "193.15.5",
3
+ "version": "193.17.0",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -45,7 +45,7 @@
45
45
  "@atlaskit/analytics-next": "^9.3.0",
46
46
  "@atlaskit/analytics-next-stable-react-context": "1.0.1",
47
47
  "@atlaskit/button": "^17.14.0",
48
- "@atlaskit/editor-common": "^79.3.0",
48
+ "@atlaskit/editor-common": "^79.6.0",
49
49
  "@atlaskit/editor-json-transformer": "^8.12.0",
50
50
  "@atlaskit/editor-plugins": "^2.5.0",
51
51
  "@atlaskit/editor-prosemirror": "4.0.1",
@@ -106,7 +106,7 @@
106
106
  "@atlaskit/primitives": "^6.1.0",
107
107
  "@atlaskit/renderer": "^109.25.0",
108
108
  "@atlaskit/select": "^17.9.0",
109
- "@atlaskit/smart-card": "^26.65.0",
109
+ "@atlaskit/smart-card": "^26.66.0",
110
110
  "@atlaskit/synchrony-test-helpers": "^2.4.0",
111
111
  "@atlaskit/util-data-test": "^17.9.0",
112
112
  "@atlaskit/visual-regression": "*",