@atlaskit/editor-core 191.6.0 → 191.7.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 (82) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/afm-cc/tsconfig.json +1 -211
  3. package/dist/cjs/composable-editor/editor-internal.js +4 -0
  4. package/dist/cjs/composable-editor/editor.js +2 -2
  5. package/dist/cjs/composable-editor/hooks/useProviders.js +57 -0
  6. package/dist/cjs/labs-next.js +1 -1
  7. package/dist/cjs/presets/default.js +35 -32
  8. package/dist/cjs/presets/universal.js +70 -70
  9. package/dist/cjs/test-utils.js +2 -2
  10. package/dist/cjs/ui/Appearance/Comment/Comment.js +1 -1
  11. package/dist/cjs/ui/Appearance/FullPage/BeforeWrapper.js +1 -1
  12. package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +2 -2
  13. package/dist/cjs/ui/ContentStyles/expand.js +1 -1
  14. package/dist/cjs/ui/ContentStyles/index.js +5 -5
  15. package/dist/cjs/ui/ContentStyles/layout.js +2 -2
  16. package/dist/cjs/ui/ToolbarFeedback/index.js +6 -7
  17. package/dist/cjs/ui/WithHelpTrigger/index.js +2 -2
  18. package/dist/cjs/version-wrapper.js +1 -1
  19. package/dist/es2019/composable-editor/editor-internal.js +4 -0
  20. package/dist/es2019/composable-editor/editor.js +1 -1
  21. package/dist/es2019/composable-editor/hooks/useProviders.js +28 -0
  22. package/dist/es2019/index.js +2 -2
  23. package/dist/es2019/labs-next.js +1 -1
  24. package/dist/es2019/presets/default.js +32 -29
  25. package/dist/es2019/presets/universal.js +45 -45
  26. package/dist/es2019/test-utils.js +1 -1
  27. package/dist/es2019/ui/Appearance/Comment/Comment.js +1 -1
  28. package/dist/es2019/ui/Appearance/FullPage/BeforeWrapper.js +1 -1
  29. package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +2 -2
  30. package/dist/es2019/ui/ContentStyles/expand.js +2 -2
  31. package/dist/es2019/ui/ContentStyles/index.js +5 -5
  32. package/dist/es2019/ui/ContentStyles/layout.js +2 -2
  33. package/dist/es2019/ui/ToolbarFeedback/index.js +2 -3
  34. package/dist/es2019/ui/WithHelpTrigger/index.js +1 -1
  35. package/dist/es2019/version-wrapper.js +1 -1
  36. package/dist/esm/composable-editor/editor-internal.js +4 -0
  37. package/dist/esm/composable-editor/editor.js +1 -1
  38. package/dist/esm/composable-editor/hooks/useProviders.js +50 -0
  39. package/dist/esm/index.js +2 -2
  40. package/dist/esm/labs-next.js +1 -1
  41. package/dist/esm/presets/default.js +32 -29
  42. package/dist/esm/presets/universal.js +45 -45
  43. package/dist/esm/test-utils.js +1 -1
  44. package/dist/esm/ui/Appearance/Comment/Comment.js +1 -1
  45. package/dist/esm/ui/Appearance/FullPage/BeforeWrapper.js +1 -1
  46. package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +2 -2
  47. package/dist/esm/ui/ContentStyles/expand.js +2 -2
  48. package/dist/esm/ui/ContentStyles/index.js +5 -5
  49. package/dist/esm/ui/ContentStyles/layout.js +2 -2
  50. package/dist/esm/ui/ToolbarFeedback/index.js +6 -7
  51. package/dist/esm/ui/WithHelpTrigger/index.js +1 -1
  52. package/dist/esm/version-wrapper.js +1 -1
  53. package/dist/types/composable-editor/hooks/useProviders.d.ts +14 -0
  54. package/dist/types/create-editor/create-plugins-list.d.ts +3 -4
  55. package/dist/types/create-editor/create-preset.d.ts +235 -63
  56. package/dist/types/index.d.ts +4 -4
  57. package/dist/types/labs-next.d.ts +1 -1
  58. package/dist/types/presets/default.d.ts +908 -758
  59. package/dist/types/presets/universal.d.ts +433 -262
  60. package/dist/types/presets/useUniversalPreset.d.ts +235 -63
  61. package/dist/types/types/editor-props.d.ts +12 -12
  62. package/dist/types/ui/ContextPanel/index.d.ts +1 -1
  63. package/dist/types/utils/action.d.ts +2 -2
  64. package/dist/types-ts4.5/composable-editor/hooks/useProviders.d.ts +14 -0
  65. package/dist/types-ts4.5/create-editor/create-plugins-list.d.ts +3 -4
  66. package/dist/types-ts4.5/create-editor/create-preset.d.ts +255 -56
  67. package/dist/types-ts4.5/index.d.ts +4 -4
  68. package/dist/types-ts4.5/labs-next.d.ts +1 -1
  69. package/dist/types-ts4.5/presets/default.d.ts +930 -756
  70. package/dist/types-ts4.5/presets/universal.d.ts +453 -255
  71. package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +255 -56
  72. package/dist/types-ts4.5/types/editor-props.d.ts +12 -12
  73. package/dist/types-ts4.5/ui/ContextPanel/index.d.ts +1 -1
  74. package/dist/types-ts4.5/utils/action.d.ts +2 -2
  75. package/docs/0-intro.tsx +5 -5
  76. package/package.json +17 -150
  77. package/tsconfig.json +196 -166
  78. package/dist/cjs/presets/types.js +0 -5
  79. package/dist/es2019/presets/types.js +0 -1
  80. package/dist/esm/presets/types.js +0 -1
  81. package/dist/types/presets/types.d.ts +0 -6
  82. package/dist/types-ts4.5/presets/types.d.ts +0 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 191.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#68640](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68640) [`6a3ea210641a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6a3ea210641a) - Create new context identifier plugin which contains the provider.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
13
+ ## 191.6.1
14
+
15
+ ### Patch Changes
16
+
17
+ - [#69000](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69000) [`792d51f0651e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/792d51f0651e) - Removing editor-plugin-\* deps from editor-core, using editor-plugins facade package instead
18
+ - [#69944](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69944) [`7171fa529a5f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7171fa529a5f) - Added ufo interaction id context package to platform
19
+ - [#68670](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68670) [`801899ef02f2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/801899ef02f2) - [ux] Added accessibility via keyboard for arrows left, right, up and down
20
+ - [#69097](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69097) [`e9a198e87414`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e9a198e87414) - [ux] Changed color contrast in expanded panel button
21
+ - [#69226](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69226) [`eb9cd91f1bdb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/eb9cd91f1bdb) - ED-21807: Replace Dnd LD feature flag with Statsig experiment
22
+ - Updated dependencies
23
+
3
24
  ## 191.6.0
4
25
 
5
26
  ### Minor Changes
@@ -38,217 +38,7 @@
38
38
  "path": "../../editor-json-transformer/afm-cc/tsconfig.json"
39
39
  },
40
40
  {
41
- "path": "../../editor-plugin-alignment/afm-cc/tsconfig.json"
42
- },
43
- {
44
- "path": "../../editor-plugin-analytics/afm-cc/tsconfig.json"
45
- },
46
- {
47
- "path": "../../editor-plugin-annotation/afm-cc/tsconfig.json"
48
- },
49
- {
50
- "path": "../../editor-plugin-avatar-group/afm-cc/tsconfig.json"
51
- },
52
- {
53
- "path": "../../editor-plugin-base/afm-cc/tsconfig.json"
54
- },
55
- {
56
- "path": "../../editor-plugin-before-primary-toolbar/afm-cc/tsconfig.json"
57
- },
58
- {
59
- "path": "../../editor-plugin-better-type-history/afm-cc/tsconfig.json"
60
- },
61
- {
62
- "path": "../../editor-plugin-block-type/afm-cc/tsconfig.json"
63
- },
64
- {
65
- "path": "../../editor-plugin-border/afm-cc/tsconfig.json"
66
- },
67
- {
68
- "path": "../../editor-plugin-breakout/afm-cc/tsconfig.json"
69
- },
70
- {
71
- "path": "../../editor-plugin-caption/afm-cc/tsconfig.json"
72
- },
73
- {
74
- "path": "../../editor-plugin-card/afm-cc/tsconfig.json"
75
- },
76
- {
77
- "path": "../../editor-plugin-clear-marks-on-empty-doc/afm-cc/tsconfig.json"
78
- },
79
- {
80
- "path": "../../editor-plugin-clipboard/afm-cc/tsconfig.json"
81
- },
82
- {
83
- "path": "../../editor-plugin-code-bidi-warning/afm-cc/tsconfig.json"
84
- },
85
- {
86
- "path": "../../editor-plugin-code-block/afm-cc/tsconfig.json"
87
- },
88
- {
89
- "path": "../../editor-plugin-collab-edit/afm-cc/tsconfig.json"
90
- },
91
- {
92
- "path": "../../editor-plugin-composition/afm-cc/tsconfig.json"
93
- },
94
- {
95
- "path": "../../editor-plugin-content-insertion/afm-cc/tsconfig.json"
96
- },
97
- {
98
- "path": "../../editor-plugin-context-panel/afm-cc/tsconfig.json"
99
- },
100
- {
101
- "path": "../../editor-plugin-copy-button/afm-cc/tsconfig.json"
102
- },
103
- {
104
- "path": "../../editor-plugin-custom-autoformat/afm-cc/tsconfig.json"
105
- },
106
- {
107
- "path": "../../editor-plugin-data-consumer/afm-cc/tsconfig.json"
108
- },
109
- {
110
- "path": "../../editor-plugin-date/afm-cc/tsconfig.json"
111
- },
112
- {
113
- "path": "../../editor-plugin-decorations/afm-cc/tsconfig.json"
114
- },
115
- {
116
- "path": "../../editor-plugin-editor-disabled/afm-cc/tsconfig.json"
117
- },
118
- {
119
- "path": "../../editor-plugin-emoji/afm-cc/tsconfig.json"
120
- },
121
- {
122
- "path": "../../editor-plugin-expand/afm-cc/tsconfig.json"
123
- },
124
- {
125
- "path": "../../editor-plugin-extension/afm-cc/tsconfig.json"
126
- },
127
- {
128
- "path": "../../editor-plugin-feature-flags/afm-cc/tsconfig.json"
129
- },
130
- {
131
- "path": "../../editor-plugin-feedback-dialog/afm-cc/tsconfig.json"
132
- },
133
- {
134
- "path": "../../editor-plugin-find-replace/afm-cc/tsconfig.json"
135
- },
136
- {
137
- "path": "../../editor-plugin-floating-toolbar/afm-cc/tsconfig.json"
138
- },
139
- {
140
- "path": "../../editor-plugin-focus/afm-cc/tsconfig.json"
141
- },
142
- {
143
- "path": "../../editor-plugin-fragment/afm-cc/tsconfig.json"
144
- },
145
- {
146
- "path": "../../editor-plugin-grid/afm-cc/tsconfig.json"
147
- },
148
- {
149
- "path": "../../editor-plugin-guideline/afm-cc/tsconfig.json"
150
- },
151
- {
152
- "path": "../../editor-plugin-help-dialog/afm-cc/tsconfig.json"
153
- },
154
- {
155
- "path": "../../editor-plugin-history/afm-cc/tsconfig.json"
156
- },
157
- {
158
- "path": "../../editor-plugin-hyperlink/afm-cc/tsconfig.json"
159
- },
160
- {
161
- "path": "../../editor-plugin-image-upload/afm-cc/tsconfig.json"
162
- },
163
- {
164
- "path": "../../editor-plugin-indentation/afm-cc/tsconfig.json"
165
- },
166
- {
167
- "path": "../../editor-plugin-insert-block/afm-cc/tsconfig.json"
168
- },
169
- {
170
- "path": "../../editor-plugin-layout/afm-cc/tsconfig.json"
171
- },
172
- {
173
- "path": "../../editor-plugin-list/afm-cc/tsconfig.json"
174
- },
175
- {
176
- "path": "../../editor-plugin-loom/afm-cc/tsconfig.json"
177
- },
178
- {
179
- "path": "../../editor-plugin-max-content-size/afm-cc/tsconfig.json"
180
- },
181
- {
182
- "path": "../../editor-plugin-media/afm-cc/tsconfig.json"
183
- },
184
- {
185
- "path": "../../editor-plugin-mentions/afm-cc/tsconfig.json"
186
- },
187
- {
188
- "path": "../../editor-plugin-panel/afm-cc/tsconfig.json"
189
- },
190
- {
191
- "path": "../../editor-plugin-paste/afm-cc/tsconfig.json"
192
- },
193
- {
194
- "path": "../../editor-plugin-paste-options-toolbar/afm-cc/tsconfig.json"
195
- },
196
- {
197
- "path": "../../editor-plugin-placeholder/afm-cc/tsconfig.json"
198
- },
199
- {
200
- "path": "../../editor-plugin-placeholder-text/afm-cc/tsconfig.json"
201
- },
202
- {
203
- "path": "../../editor-plugin-quick-insert/afm-cc/tsconfig.json"
204
- },
205
- {
206
- "path": "../../editor-plugin-rule/afm-cc/tsconfig.json"
207
- },
208
- {
209
- "path": "../../editor-plugin-save-on-enter/afm-cc/tsconfig.json"
210
- },
211
- {
212
- "path": "../../editor-plugin-scroll-into-view/afm-cc/tsconfig.json"
213
- },
214
- {
215
- "path": "../../editor-plugin-selection/afm-cc/tsconfig.json"
216
- },
217
- {
218
- "path": "../../editor-plugin-selection-toolbar/afm-cc/tsconfig.json"
219
- },
220
- {
221
- "path": "../../editor-plugin-status/afm-cc/tsconfig.json"
222
- },
223
- {
224
- "path": "../../editor-plugin-submit-editor/afm-cc/tsconfig.json"
225
- },
226
- {
227
- "path": "../../editor-plugin-table/afm-cc/tsconfig.json"
228
- },
229
- {
230
- "path": "../../editor-plugin-tasks-and-decisions/afm-cc/tsconfig.json"
231
- },
232
- {
233
- "path": "../../editor-plugin-text-color/afm-cc/tsconfig.json"
234
- },
235
- {
236
- "path": "../../editor-plugin-text-formatting/afm-cc/tsconfig.json"
237
- },
238
- {
239
- "path": "../../editor-plugin-toolbar-lists-indentation/afm-cc/tsconfig.json"
240
- },
241
- {
242
- "path": "../../editor-plugin-type-ahead/afm-cc/tsconfig.json"
243
- },
244
- {
245
- "path": "../../editor-plugin-undo-redo/afm-cc/tsconfig.json"
246
- },
247
- {
248
- "path": "../../editor-plugin-unsupported-content/afm-cc/tsconfig.json"
249
- },
250
- {
251
- "path": "../../editor-plugin-width/afm-cc/tsconfig.json"
41
+ "path": "../../editor-plugins/afm-cc/tsconfig.json"
252
42
  },
253
43
  {
254
44
  "path": "../../editor-shared-styles/afm-cc/tsconfig.json"
@@ -20,6 +20,7 @@ var _contextAdapter = require("../nodeviews/context-adapter");
20
20
  var _context = require("../presets/context");
21
21
  var _EditorContext = _interopRequireDefault(require("../ui/EditorContext"));
22
22
  var _RenderTracking = require("../utils/performance/components/RenderTracking");
23
+ var _useProviders = require("./hooks/useProviders");
23
24
  var _getBaseFontSize = require("./utils/getBaseFontSize");
24
25
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
25
26
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /** @jsx jsx */
@@ -161,6 +162,9 @@ function ReactEditorViewContextWrapper(props) {
161
162
  setInternalEditorAPI === null || setInternalEditorAPI === void 0 || setInternalEditorAPI(api);
162
163
  setExternalEditorAPI === null || setExternalEditorAPI === void 0 || setExternalEditorAPI(api);
163
164
  }, [setInternalEditorAPI, setExternalEditorAPI]);
165
+ (0, _useProviders.useProviders)({
166
+ contextIdentifierProvider: props.editorProps.contextIdentifierProvider
167
+ });
164
168
  return (0, _react2.jsx)(_ReactEditorView.default, (0, _extends2.default)({}, props, {
165
169
  setEditorApi: setEditorAPI
166
170
  }));
@@ -16,7 +16,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
16
16
  var _hooks = require("@atlaskit/editor-common/hooks");
17
17
  var _ufo = require("@atlaskit/editor-common/ufo");
18
18
  var _utils = require("@atlaskit/editor-common/utils");
19
- var _editorPluginBase = require("@atlaskit/editor-plugin-base");
19
+ var _base = require("@atlaskit/editor-plugins/base");
20
20
  var _actions = _interopRequireDefault(require("../actions"));
21
21
  var _featureFlagsFromProps = require("../create-editor/feature-flags-from-props");
22
22
  var _EditorContext = require("../ui/EditorContext");
@@ -150,7 +150,7 @@ ComposableEditor.propTypes = {
150
150
  },
151
151
  preset: function preset(_ref2) {
152
152
  var _preset = _ref2.preset;
153
- if (!_preset.has(_editorPluginBase.basePlugin)) {
153
+ if (!_preset.has(_base.basePlugin)) {
154
154
  return new Error('Presets must contain the base plugin');
155
155
  }
156
156
  return null;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.useProviders = void 0;
8
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
+ var _react = require("react");
11
+ var _context2 = require("../../presets/context");
12
+ /**
13
+ * This hook is used to replace the old approach of using the `providerFactory`.
14
+ *
15
+ * Because plugins can't update their initial configuration, this hook listens to changes
16
+ * and calls a command to push the update to the plugins shared state.
17
+ *
18
+ * In the future ideally consumers implement this behaviour themselves.
19
+ */
20
+ var useProviders = exports.useProviders = function useProviders(_ref) {
21
+ var contextIdentifierProvider = _ref.contextIdentifierProvider;
22
+ var editorApi = (0, _context2.usePresetContext)();
23
+ (0, _react.useEffect)(function () {
24
+ function setProvider() {
25
+ return _setProvider.apply(this, arguments);
26
+ }
27
+ function _setProvider() {
28
+ _setProvider = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
29
+ var _editorApi$core, _editorApi$contextIde;
30
+ var provider;
31
+ return _regenerator.default.wrap(function _callee$(_context) {
32
+ while (1) switch (_context.prev = _context.next) {
33
+ case 0:
34
+ if (contextIdentifierProvider) {
35
+ _context.next = 2;
36
+ break;
37
+ }
38
+ return _context.abrupt("return");
39
+ case 2:
40
+ _context.next = 4;
41
+ return contextIdentifierProvider;
42
+ case 4:
43
+ provider = _context.sent;
44
+ editorApi === null || editorApi === void 0 || (_editorApi$core = editorApi.core) === null || _editorApi$core === void 0 || _editorApi$core.actions.execute(editorApi === null || editorApi === void 0 || (_editorApi$contextIde = editorApi.contextIdentifier) === null || _editorApi$contextIde === void 0 ? void 0 : _editorApi$contextIde.commands.setProvider({
45
+ contextIdentifierProvider: provider
46
+ }));
47
+ case 6:
48
+ case "end":
49
+ return _context.stop();
50
+ }
51
+ }, _callee);
52
+ }));
53
+ return _setProvider.apply(this, arguments);
54
+ }
55
+ setProvider();
56
+ }, [contextIdentifierProvider, editorApi]);
57
+ };
@@ -9,4 +9,4 @@ Object.defineProperty(exports, "createDefaultPreset", {
9
9
  return _default.createDefaultPreset;
10
10
  }
11
11
  });
12
- var _default = require("./presets/default");
12
+ var _default = require("../src/presets/default");
@@ -6,34 +6,35 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.createDefaultPreset = createDefaultPreset;
7
7
  exports.useDefaultPreset = useDefaultPreset;
8
8
  var _preset = require("@atlaskit/editor-common/preset");
9
- var _editorPluginAnalytics = require("@atlaskit/editor-plugin-analytics");
10
- var _editorPluginAnnotation = require("@atlaskit/editor-plugin-annotation");
11
- var _editorPluginBase = require("@atlaskit/editor-plugin-base");
12
- var _editorPluginBetterTypeHistory = require("@atlaskit/editor-plugin-better-type-history");
13
- var _editorPluginBlockType = require("@atlaskit/editor-plugin-block-type");
14
- var _editorPluginClearMarksOnEmptyDoc = require("@atlaskit/editor-plugin-clear-marks-on-empty-doc");
15
- var _editorPluginClipboard = require("@atlaskit/editor-plugin-clipboard");
16
- var _editorPluginCodeBlock = require("@atlaskit/editor-plugin-code-block");
17
- var _editorPluginComposition = require("@atlaskit/editor-plugin-composition");
18
- var _editorPluginCopyButton = require("@atlaskit/editor-plugin-copy-button");
19
- var _editorPluginDecorations = require("@atlaskit/editor-plugin-decorations");
20
- var _editorPluginEditorDisabled = require("@atlaskit/editor-plugin-editor-disabled");
21
- var _editorPluginFeatureFlags = require("@atlaskit/editor-plugin-feature-flags");
22
- var _editorPluginFloatingToolbar = require("@atlaskit/editor-plugin-floating-toolbar");
23
- var _editorPluginFocus = require("@atlaskit/editor-plugin-focus");
24
- var _editorPluginHistory = require("@atlaskit/editor-plugin-history");
25
- var _editorPluginHyperlink = require("@atlaskit/editor-plugin-hyperlink");
26
- var _editorPluginPaste = require("@atlaskit/editor-plugin-paste");
27
- var _editorPluginPlaceholder = require("@atlaskit/editor-plugin-placeholder");
28
- var _editorPluginQuickInsert = require("@atlaskit/editor-plugin-quick-insert");
29
- var _editorPluginSelection = require("@atlaskit/editor-plugin-selection");
30
- var _editorPluginSelectionToolbar = require("@atlaskit/editor-plugin-selection-toolbar");
31
- var _editorPluginSubmitEditor = require("@atlaskit/editor-plugin-submit-editor");
32
- var _editorPluginTextFormatting = require("@atlaskit/editor-plugin-text-formatting");
33
- var _editorPluginTypeAhead = require("@atlaskit/editor-plugin-type-ahead");
34
- var _editorPluginUndoRedo = require("@atlaskit/editor-plugin-undo-redo");
35
- var _editorPluginUnsupportedContent = require("@atlaskit/editor-plugin-unsupported-content");
36
- var _editorPluginWidth = require("@atlaskit/editor-plugin-width");
9
+ var _analytics = require("@atlaskit/editor-plugins/analytics");
10
+ var _annotation = require("@atlaskit/editor-plugins/annotation");
11
+ var _base = require("@atlaskit/editor-plugins/base");
12
+ var _betterTypeHistory = require("@atlaskit/editor-plugins/better-type-history");
13
+ var _blockType = require("@atlaskit/editor-plugins/block-type");
14
+ var _clearMarksOnEmptyDoc = require("@atlaskit/editor-plugins/clear-marks-on-empty-doc");
15
+ var _clipboard = require("@atlaskit/editor-plugins/clipboard");
16
+ var _codeBlock = require("@atlaskit/editor-plugins/code-block");
17
+ var _composition = require("@atlaskit/editor-plugins/composition");
18
+ var _contextIdentifier = require("@atlaskit/editor-plugins/context-identifier");
19
+ var _copyButton = require("@atlaskit/editor-plugins/copy-button");
20
+ var _decorations = require("@atlaskit/editor-plugins/decorations");
21
+ var _editorDisabled = require("@atlaskit/editor-plugins/editor-disabled");
22
+ var _featureFlags = require("@atlaskit/editor-plugins/feature-flags");
23
+ var _floatingToolbar = require("@atlaskit/editor-plugins/floating-toolbar");
24
+ var _focus = require("@atlaskit/editor-plugins/focus");
25
+ var _history = require("@atlaskit/editor-plugins/history");
26
+ var _hyperlink = require("@atlaskit/editor-plugins/hyperlink");
27
+ var _paste = require("@atlaskit/editor-plugins/paste");
28
+ var _placeholder = require("@atlaskit/editor-plugins/placeholder");
29
+ var _quickInsert = require("@atlaskit/editor-plugins/quick-insert");
30
+ var _selection = require("@atlaskit/editor-plugins/selection");
31
+ var _selectionToolbar = require("@atlaskit/editor-plugins/selection-toolbar");
32
+ var _submitEditor = require("@atlaskit/editor-plugins/submit-editor");
33
+ var _textFormatting = require("@atlaskit/editor-plugins/text-formatting");
34
+ var _typeAhead = require("@atlaskit/editor-plugins/type-ahead");
35
+ var _undoRedo = require("@atlaskit/editor-plugins/undo-redo");
36
+ var _unsupportedContent = require("@atlaskit/editor-plugins/unsupported-content");
37
+ var _width = require("@atlaskit/editor-plugins/width");
37
38
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
38
39
  // #region Imports
39
40
 
@@ -46,19 +47,21 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
46
47
  function createDefaultPreset(options) {
47
48
  var _options$featureFlags;
48
49
  var isMobile = options.appearance === 'mobile';
49
- var preset = new _preset.EditorPresetBuilder().add([_editorPluginFeatureFlags.featureFlagsPlugin, options.featureFlags || {}]).maybeAdd([_editorPluginAnalytics.analyticsPlugin, {
50
+ var preset = new _preset.EditorPresetBuilder().add([_featureFlags.featureFlagsPlugin, options.featureFlags || {}]).maybeAdd([_analytics.analyticsPlugin, {
50
51
  createAnalyticsEvent: options.createAnalyticsEvent,
51
52
  performanceTracking: options.performanceTracking
52
- }], Boolean(options.allowAnalyticsGASV3)).add(_editorPluginBetterTypeHistory.betterTypeHistoryPlugin).add([_editorPluginPaste.pastePlugin, options.paste]).add(_editorPluginClipboard.clipboardPlugin).add(_editorPluginFocus.focusPlugin).add(_editorPluginComposition.compositionPlugin).add([_editorPluginBase.basePlugin, options.base]).add(_editorPluginDecorations.decorationsPlugin).add([_editorPluginTypeAhead.typeAheadPlugin, options.typeAhead || {
53
+ }], Boolean(options.allowAnalyticsGASV3)).add(_betterTypeHistory.betterTypeHistoryPlugin).add([_paste.pastePlugin, options.paste]).add(_clipboard.clipboardPlugin).add(_focus.focusPlugin).add(_composition.compositionPlugin).add([_contextIdentifier.contextIdentifierPlugin, {
54
+ contextIdentifierProvider: options.contextIdentifierProvider
55
+ }]).add([_base.basePlugin, options.base]).add(_decorations.decorationsPlugin).add([_typeAhead.typeAheadPlugin, options.typeAhead || {
53
56
  createAnalyticsEvent: options.createAnalyticsEvent
54
- }]).maybeAdd(_editorPluginHistory.historyPlugin, Boolean(isMobile || options.allowUndoRedoButtons)).maybeAdd(_editorPluginUndoRedo.undoRedoPlugin, Boolean((_options$featureFlags = options.featureFlags) === null || _options$featureFlags === void 0 ? void 0 : _options$featureFlags.undoRedoButtons)).add([_editorPluginBlockType.blockTypePlugin, options.blockType]).add(_editorPluginClearMarksOnEmptyDoc.clearMarksOnEmptyDocPlugin).maybeAdd([_editorPluginAnnotation.annotationPlugin, options.annotationProviders], Boolean(options.annotationProviders)).maybeAdd([_editorPluginSelectionToolbar.selectionToolbarPlugin, {
57
+ }]).maybeAdd(_history.historyPlugin, Boolean(isMobile || options.allowUndoRedoButtons)).maybeAdd(_undoRedo.undoRedoPlugin, Boolean((_options$featureFlags = options.featureFlags) === null || _options$featureFlags === void 0 ? void 0 : _options$featureFlags.undoRedoButtons)).add([_blockType.blockTypePlugin, options.blockType]).add(_clearMarksOnEmptyDoc.clearMarksOnEmptyDocPlugin).maybeAdd([_annotation.annotationPlugin, options.annotationProviders], Boolean(options.annotationProviders)).maybeAdd([_selectionToolbar.selectionToolbarPlugin, {
55
58
  preferenceToolbarAboveSelection: false
56
59
  }], function () {
57
60
  if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.enable-selection-toolbar_ucdwd')) {
58
61
  return true;
59
62
  }
60
63
  return false;
61
- }).add([_editorPluginHyperlink.hyperlinkPlugin, options.hyperlinkOptions]).add([_editorPluginTextFormatting.textFormattingPlugin, options.textFormatting]).add(_editorPluginWidth.widthPlugin).add([_editorPluginQuickInsert.quickInsertPlugin, options.quickInsert]).add([_editorPluginPlaceholder.placeholderPlugin, options.placeholder]).add(_editorPluginUnsupportedContent.unsupportedContentPlugin).add(_editorPluginEditorDisabled.editorDisabledPlugin).add([_editorPluginSubmitEditor.submitEditorPlugin, options.submitEditor]).add(_editorPluginCopyButton.copyButtonPlugin).add(_editorPluginFloatingToolbar.floatingToolbarPlugin).add([_editorPluginSelection.selectionPlugin, options.selection]).add([_editorPluginCodeBlock.codeBlockPlugin, options.codeBlock || {
64
+ }).add([_hyperlink.hyperlinkPlugin, options.hyperlinkOptions]).add([_textFormatting.textFormattingPlugin, options.textFormatting]).add(_width.widthPlugin).add([_quickInsert.quickInsertPlugin, options.quickInsert]).add([_placeholder.placeholderPlugin, options.placeholder]).add(_unsupportedContent.unsupportedContentPlugin).add(_editorDisabled.editorDisabledPlugin).add([_submitEditor.submitEditorPlugin, options.submitEditor]).add(_copyButton.copyButtonPlugin).add(_floatingToolbar.floatingToolbarPlugin).add([_selection.selectionPlugin, options.selection]).add([_codeBlock.codeBlockPlugin, options.codeBlock || {
62
65
  appearance: 'full-page'
63
66
  }]);
64
67
  return preset;