@atlaskit/editor-core 184.0.4 → 185.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/dist/cjs/create-editor/feature-flags-from-props.js +1 -2
- package/dist/cjs/editor-next/index.js +41 -34
- package/dist/cjs/editor.js +30 -269
- package/dist/cjs/i18n/en_ZZ.js +32 -6
- package/dist/cjs/index.js +0 -7
- package/dist/cjs/labs/next/presets/default.js +2 -1
- package/dist/cjs/plugins/base/index.js +0 -12
- package/dist/cjs/plugins/card/nodeviews/blockCard.js +7 -0
- package/dist/cjs/plugins/card/nodeviews/embedCard.js +7 -0
- package/dist/cjs/plugins/card/nodeviews/inlineCard.js +5 -1
- package/dist/cjs/plugins/card/pm-plugins/doc.js +1 -2
- package/dist/cjs/plugins/card/toolbar.js +11 -9
- package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +4 -4
- package/dist/cjs/plugins/code-block/index.js +7 -5
- package/dist/cjs/plugins/code-block/toolbar.js +5 -5
- package/dist/cjs/plugins/copy-button/commands.js +2 -3
- package/dist/cjs/plugins/copy-button/toolbar.js +7 -8
- package/dist/cjs/plugins/expand/index.js +1 -1
- package/dist/cjs/plugins/expand/toolbar.js +40 -39
- package/dist/cjs/plugins/extension/index.js +1 -1
- package/dist/cjs/plugins/extension/toolbar.js +5 -5
- package/dist/cjs/plugins/floating-toolbar/index.js +3 -2
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +2 -4
- package/dist/cjs/plugins/layout/index.js +8 -4
- package/dist/cjs/plugins/layout/toolbar.js +5 -6
- package/dist/cjs/plugins/media/toolbar/index.js +31 -24
- package/dist/cjs/plugins/panel/index.js +2 -1
- package/dist/cjs/plugins/panel/toolbar.js +7 -7
- package/dist/cjs/plugins/placeholder-text/index.js +7 -5
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +19 -0
- package/dist/cjs/ui/CollapsedEditor/index.js +1 -2
- package/dist/cjs/ui/ElementBrowser/components/StatelessElementBrowser.js +5 -3
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/feature-flags-from-props.js +1 -2
- package/dist/es2019/editor-next/index.js +39 -30
- package/dist/es2019/editor.js +29 -232
- package/dist/es2019/i18n/en_ZZ.js +32 -6
- package/dist/es2019/index.js +1 -2
- package/dist/es2019/labs/next/presets/default.js +2 -1
- package/dist/es2019/plugins/base/index.js +0 -7
- package/dist/es2019/plugins/card/nodeviews/blockCard.js +8 -0
- package/dist/es2019/plugins/card/nodeviews/embedCard.js +8 -0
- package/dist/es2019/plugins/card/nodeviews/inlineCard.js +5 -1
- package/dist/es2019/plugins/card/pm-plugins/doc.js +1 -2
- package/dist/es2019/plugins/card/toolbar.js +8 -6
- package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +2 -2
- package/dist/es2019/plugins/code-block/index.js +7 -5
- package/dist/es2019/plugins/code-block/toolbar.js +5 -6
- package/dist/es2019/plugins/copy-button/commands.js +2 -3
- package/dist/es2019/plugins/copy-button/toolbar.js +7 -8
- package/dist/es2019/plugins/expand/index.js +1 -1
- package/dist/es2019/plugins/expand/toolbar.js +5 -6
- package/dist/es2019/plugins/extension/index.js +1 -1
- package/dist/es2019/plugins/extension/toolbar.js +5 -6
- package/dist/es2019/plugins/floating-toolbar/index.js +3 -2
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +2 -4
- package/dist/es2019/plugins/layout/index.js +8 -5
- package/dist/es2019/plugins/layout/toolbar.js +5 -6
- package/dist/es2019/plugins/media/toolbar/index.js +35 -24
- package/dist/es2019/plugins/panel/index.js +2 -2
- package/dist/es2019/plugins/panel/toolbar.js +7 -8
- package/dist/es2019/plugins/placeholder-text/index.js +7 -5
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +21 -0
- package/dist/es2019/ui/CollapsedEditor/index.js +1 -2
- package/dist/es2019/ui/ElementBrowser/components/StatelessElementBrowser.js +5 -3
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/feature-flags-from-props.js +1 -2
- package/dist/esm/editor-next/index.js +42 -33
- package/dist/esm/editor.js +29 -270
- package/dist/esm/i18n/en_ZZ.js +32 -6
- package/dist/esm/index.js +1 -2
- package/dist/esm/labs/next/presets/default.js +2 -1
- package/dist/esm/plugins/base/index.js +0 -9
- package/dist/esm/plugins/card/nodeviews/blockCard.js +7 -0
- package/dist/esm/plugins/card/nodeviews/embedCard.js +7 -0
- package/dist/esm/plugins/card/nodeviews/inlineCard.js +5 -1
- package/dist/esm/plugins/card/pm-plugins/doc.js +1 -2
- package/dist/esm/plugins/card/toolbar.js +7 -6
- package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +2 -2
- package/dist/esm/plugins/code-block/index.js +7 -5
- package/dist/esm/plugins/code-block/toolbar.js +5 -5
- package/dist/esm/plugins/copy-button/commands.js +2 -3
- package/dist/esm/plugins/copy-button/toolbar.js +7 -8
- package/dist/esm/plugins/expand/index.js +1 -1
- package/dist/esm/plugins/expand/toolbar.js +40 -39
- package/dist/esm/plugins/extension/index.js +1 -1
- package/dist/esm/plugins/extension/toolbar.js +5 -5
- package/dist/esm/plugins/floating-toolbar/index.js +3 -2
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +2 -4
- package/dist/esm/plugins/layout/index.js +8 -4
- package/dist/esm/plugins/layout/toolbar.js +5 -6
- package/dist/esm/plugins/media/toolbar/index.js +31 -24
- package/dist/esm/plugins/panel/index.js +2 -1
- package/dist/esm/plugins/panel/toolbar.js +7 -7
- package/dist/esm/plugins/placeholder-text/index.js +7 -5
- package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +19 -0
- package/dist/esm/ui/CollapsedEditor/index.js +1 -2
- package/dist/esm/ui/ElementBrowser/components/StatelessElementBrowser.js +5 -3
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/editor-next/index.d.ts +0 -6
- package/dist/types/editor.d.ts +1 -137
- package/dist/types/i18n/en_ZZ.d.ts +28 -2
- package/dist/types/index.d.ts +0 -1
- package/dist/types/labs/next/presets/cxhtml.d.ts +106 -0
- package/dist/types/labs/next/presets/default.d.ts +212 -0
- package/dist/types/labs/next/presets/mobile.d.ts +106 -0
- package/dist/types/plugins/base/index.d.ts +0 -4
- package/dist/types/plugins/card/index.d.ts +2 -2
- package/dist/types/plugins/card/nodeviews/blockCard.d.ts +3 -0
- package/dist/types/plugins/card/nodeviews/embedCard.d.ts +3 -0
- package/dist/types/plugins/card/nodeviews/inlineCard.d.ts +1 -0
- package/dist/types/plugins/card/pm-plugins/doc.d.ts +1 -1
- package/dist/types/plugins/card/pm-plugins/keymap.d.ts +1 -1
- package/dist/types/plugins/card/pm-plugins/main.d.ts +1 -2
- package/dist/types/plugins/card/toolbar.d.ts +1 -2
- package/dist/types/plugins/card/types.d.ts +1 -1
- package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +1 -2
- package/dist/types/plugins/card/ui/link-toolbar-button-group-options.d.ts +1 -1
- package/dist/types/plugins/card/ui/types.d.ts +1 -1
- package/dist/types/plugins/code-block/index.d.ts +7 -1
- package/dist/types/plugins/code-block/toolbar.d.ts +2 -1
- package/dist/types/plugins/copy-button/commands.d.ts +2 -1
- package/dist/types/plugins/copy-button/toolbar.d.ts +3 -2
- package/dist/types/plugins/expand/index.d.ts +2 -1
- package/dist/types/plugins/expand/toolbar.d.ts +2 -1
- package/dist/types/plugins/extension/index.d.ts +7 -2
- package/dist/types/plugins/extension/toolbar.d.ts +2 -1
- package/dist/types/plugins/floating-toolbar/index.d.ts +2 -1
- package/dist/types/plugins/floating-toolbar/ui/Toolbar.d.ts +3 -1
- package/dist/types/plugins/layout/index.d.ts +7 -1
- package/dist/types/plugins/layout/toolbar.d.ts +2 -1
- package/dist/types/plugins/media/index.d.ts +3 -1
- package/dist/types/plugins/panel/index.d.ts +2 -0
- package/dist/types/plugins/panel/toolbar.d.ts +3 -2
- package/dist/types/plugins/placeholder-text/index.d.ts +3 -1
- package/dist/types/ui/CollapsedEditor/index.d.ts +1 -2
- package/dist/types-ts4.5/editor-next/index.d.ts +0 -6
- package/dist/types-ts4.5/editor.d.ts +1 -137
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +28 -2
- package/dist/types-ts4.5/index.d.ts +0 -1
- package/dist/types-ts4.5/labs/next/presets/cxhtml.d.ts +122 -0
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +244 -0
- package/dist/types-ts4.5/labs/next/presets/mobile.d.ts +122 -0
- package/dist/types-ts4.5/plugins/base/index.d.ts +0 -4
- package/dist/types-ts4.5/plugins/card/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/card/nodeviews/blockCard.d.ts +3 -0
- package/dist/types-ts4.5/plugins/card/nodeviews/embedCard.d.ts +3 -0
- package/dist/types-ts4.5/plugins/card/nodeviews/inlineCard.d.ts +1 -0
- package/dist/types-ts4.5/plugins/card/pm-plugins/doc.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/pm-plugins/keymap.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/pm-plugins/main.d.ts +1 -2
- package/dist/types-ts4.5/plugins/card/toolbar.d.ts +1 -2
- package/dist/types-ts4.5/plugins/card/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/ui/EditLinkToolbar.d.ts +1 -2
- package/dist/types-ts4.5/plugins/card/ui/link-toolbar-button-group-options.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/ui/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/code-block/index.d.ts +7 -1
- package/dist/types-ts4.5/plugins/code-block/toolbar.d.ts +2 -1
- package/dist/types-ts4.5/plugins/copy-button/commands.d.ts +2 -1
- package/dist/types-ts4.5/plugins/copy-button/toolbar.d.ts +3 -2
- package/dist/types-ts4.5/plugins/expand/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/expand/toolbar.d.ts +2 -1
- package/dist/types-ts4.5/plugins/extension/index.d.ts +4 -2
- package/dist/types-ts4.5/plugins/extension/toolbar.d.ts +2 -1
- package/dist/types-ts4.5/plugins/floating-toolbar/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/floating-toolbar/ui/Toolbar.d.ts +3 -1
- package/dist/types-ts4.5/plugins/layout/index.d.ts +7 -1
- package/dist/types-ts4.5/plugins/layout/toolbar.d.ts +2 -1
- package/dist/types-ts4.5/plugins/media/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/panel/index.d.ts +4 -0
- package/dist/types-ts4.5/plugins/panel/toolbar.d.ts +3 -2
- package/dist/types-ts4.5/plugins/placeholder-text/index.d.ts +5 -1
- package/dist/types-ts4.5/ui/CollapsedEditor/index.d.ts +1 -2
- package/package.json +15 -10
- package/report.api.md +5 -93
- package/dist/cjs/editor-next/editor-migration-component.js +0 -54
- package/dist/cjs/plugins/base/pm-plugins/decoration.js +0 -122
- package/dist/es2019/editor-next/editor-migration-component.js +0 -30
- package/dist/es2019/plugins/base/pm-plugins/decoration.js +0 -111
- package/dist/esm/editor-next/editor-migration-component.js +0 -47
- package/dist/esm/plugins/base/pm-plugins/decoration.js +0 -113
- package/dist/types/editor-next/editor-migration-component.d.ts +0 -6
- package/dist/types/plugins/base/pm-plugins/decoration.d.ts +0 -24
- package/dist/types-ts4.5/editor-next/editor-migration-component.d.ts +0 -6
- package/dist/types-ts4.5/plugins/base/pm-plugins/decoration.d.ts +0 -24
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 185.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 185.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- [`741b3acd455`](https://bitbucket.org/atlassian/atlassian-frontend/commits/741b3acd455) - This major change includes:
|
|
14
|
+
|
|
15
|
+
- `EditorMigrationComponent` being renamed to `Editor`. This includes making component methods which should never be used private (which should never be used in normal operation and have been deprecated for several releases).
|
|
16
|
+
- `EditorMigrationComponent` is now removed
|
|
17
|
+
- Removing `useEditorNext` feature flag
|
|
18
|
+
|
|
19
|
+
This change was made as part of our strategy to move to a new architecture with `EditorMigrationComponent`, now that the component has served its purpose it is no longer required.
|
|
20
|
+
|
|
21
|
+
Any references to this component can be updated like so:
|
|
22
|
+
|
|
23
|
+
Before:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { EditorMigrationComponent } from '@atlaskit/editor-core';
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
After:
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { Editor } from '@atlaskit/editor-core';
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Minor Changes
|
|
36
|
+
|
|
37
|
+
- [`26d9c8cb4b1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/26d9c8cb4b1) - Extract decorations plugin from editor-core to its own package.
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- [`4fe16193baa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4fe16193baa) - [ux] fix element browser adding component twice
|
|
42
|
+
- [`6f5276b3eb1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6f5276b3eb1) - ED-17921 updated placeholder text analytics event to use new analyticsAPI
|
|
43
|
+
- [`1df016865b3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1df016865b3) - [ED-17443] Update escape key behaviour when typeahead is open
|
|
44
|
+
- [`65ff31a2ad4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/65ff31a2ad4) - use onError prop on smart card to handle errors
|
|
45
|
+
- Updated dependencies
|
|
46
|
+
|
|
3
47
|
## 184.0.4
|
|
4
48
|
|
|
5
49
|
### Patch Changes
|
|
@@ -32,7 +32,7 @@ function getSpellCheck(featureFlags) {
|
|
|
32
32
|
* which is used by both current and archv3 editors.
|
|
33
33
|
*/
|
|
34
34
|
function createFeatureFlagsFromProps(props) {
|
|
35
|
-
var _props$featureFlags, _ref, _props$featureFlags$u, _props$featureFlags2, _props$featureFlags3, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags4, _props$featureFlags5, _props$allowTables, _props$featureFlags6, _props$featureFlags7, _props$allowTables2, _props$featureFlags8, _props$featureFlags9, _props$allowTables3, _props$featureFlags10, _props$featureFlags11, _props$allowTables4, _props$allowTables5, _props$featureFlags12, _props$featureFlags13, _props$allowTables6, _props$allowExtension, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$collabEdit, _props$collabEdit2, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39, _props$featureFlags40, _props$featureFlags41, _props$featureFlags42, _props$featureFlags43, _props$featureFlags44, _props$featureFlags45, _props$featureFlags46
|
|
35
|
+
var _props$featureFlags, _ref, _props$featureFlags$u, _props$featureFlags2, _props$featureFlags3, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags4, _props$featureFlags5, _props$allowTables, _props$featureFlags6, _props$featureFlags7, _props$allowTables2, _props$featureFlags8, _props$featureFlags9, _props$allowTables3, _props$featureFlags10, _props$featureFlags11, _props$allowTables4, _props$allowTables5, _props$featureFlags12, _props$featureFlags13, _props$allowTables6, _props$allowExtension, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$collabEdit, _props$collabEdit2, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39, _props$featureFlags40, _props$featureFlags41, _props$featureFlags42, _props$featureFlags43, _props$featureFlags44, _props$featureFlags45, _props$featureFlags46;
|
|
36
36
|
var normalizedFeatureFlags = (0, _normalizeFeatureFlags.normalizeFeatureFlags)(props.featureFlags);
|
|
37
37
|
var tableCellOptionsInFloatingToolbar = normalizedFeatureFlags.tableCellOptionsInFloatingToolbar || ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.tableCellOptionsInFloatingToolbar) || undefined;
|
|
38
38
|
|
|
@@ -79,7 +79,6 @@ function createFeatureFlagsFromProps(props) {
|
|
|
79
79
|
useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$featureFlags43 = props.featureFlags) === null || _props$featureFlags43 === void 0 ? void 0 : _props$featureFlags43.useSomewhatSemanticTextColorNames) === 'boolean' ? !!((_props$featureFlags44 = props.featureFlags) !== null && _props$featureFlags44 !== void 0 && _props$featureFlags44.useSomewhatSemanticTextColorNames) : false)),
|
|
80
80
|
lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
|
|
81
81
|
preventPopupOverflow: Boolean(typeof ((_props$featureFlags45 = props.featureFlags) === null || _props$featureFlags45 === void 0 ? void 0 : _props$featureFlags45['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags46 = props.featureFlags) !== null && _props$featureFlags46 !== void 0 && _props$featureFlags46['prevent-popup-overflow']) : false),
|
|
82
|
-
useEditorNext: normalizedFeatureFlags.useEditorNext === true || ((_props$featureFlags47 = props.featureFlags) === null || _props$featureFlags47 === void 0 ? void 0 : _props$featureFlags47.useEditorNext) === true,
|
|
83
82
|
// duplicated logic from `create-plugins-list.ts` due to presets not being finalised
|
|
84
83
|
useBetterTypeaheadNavigation: Boolean(typeof pseudoNormalisedUseBetterTypeaheadNavigation === 'boolean' ? !!pseudoNormalisedUseBetterTypeaheadNavigation : true)
|
|
85
84
|
});
|
|
@@ -13,13 +13,9 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
16
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
17
16
|
var _react = require("@emotion/react");
|
|
18
17
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
18
|
var _react2 = _interopRequireDefault(require("react"));
|
|
20
|
-
var _versionWrapper = require("../version-wrapper");
|
|
21
|
-
var _analyticsNamespacedContext = require("@atlaskit/analytics-namespaced-context");
|
|
22
|
-
var _v = _interopRequireDefault(require("uuid/v4"));
|
|
23
19
|
var _actions = _interopRequireDefault(require("../actions"));
|
|
24
20
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
25
21
|
var _editorInternal = _interopRequireDefault(require("./editor-internal"));
|
|
@@ -32,10 +28,15 @@ var _plugins = require("../plugins");
|
|
|
32
28
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
33
29
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
34
30
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
35
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
31
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */ // import { getAnalyticsAppearance } from '@atlaskit/editor-common/utils';
|
|
32
|
+
// import { name, version } from '../version-wrapper';
|
|
33
|
+
// import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
|
|
34
|
+
// import uuid from 'uuid/v4';
|
|
36
35
|
var EditorNext = /*#__PURE__*/function (_React$Component) {
|
|
37
36
|
(0, _inherits2.default)(EditorNext, _React$Component);
|
|
38
37
|
var _super = _createSuper(EditorNext);
|
|
38
|
+
// private editorSessionId: string;
|
|
39
|
+
|
|
39
40
|
function EditorNext(props, context) {
|
|
40
41
|
var _this;
|
|
41
42
|
(0, _classCallCheck2.default)(this, EditorNext);
|
|
@@ -55,7 +56,7 @@ var EditorNext = /*#__PURE__*/function (_React$Component) {
|
|
|
55
56
|
});
|
|
56
57
|
(0, _deprecationWarnings.default)(props);
|
|
57
58
|
_this.editorActions = (context || {}).editorActions || new _actions.default();
|
|
58
|
-
|
|
59
|
+
// this.editorSessionId = uuid();
|
|
59
60
|
_this.startTime = performance.now();
|
|
60
61
|
_this.onEditorCreated = _this.onEditorCreated.bind((0, _assertThisInitialized2.default)(_this));
|
|
61
62
|
_this.onEditorDestroyed = _this.onEditorDestroyed.bind((0, _assertThisInitialized2.default)(_this));
|
|
@@ -98,39 +99,45 @@ var EditorNext = /*#__PURE__*/function (_React$Component) {
|
|
|
98
99
|
key: "render",
|
|
99
100
|
value: function render() {
|
|
100
101
|
var _this3 = this;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
102
|
+
// TODO: https://product-fabric.atlassian.net/browse/ED-16979
|
|
103
|
+
// Move `FabricEditorAnalyticsContext` back into `EditorNext`
|
|
104
|
+
// This was moved out here to workaround the issue that the analytics
|
|
105
|
+
// context does not wrap the Preset (and therefore does not pass this context
|
|
106
|
+
// information to analytics calls within plugins). After this cleanup task ^ we will
|
|
107
|
+
// not have to generate the `createAnalyticsEvent` outside the Preset
|
|
108
|
+
// and we can move this back into `EditorNext`.
|
|
109
|
+
return (
|
|
110
|
+
// <FabricEditorAnalyticsContext
|
|
111
|
+
// data={{
|
|
112
|
+
// packageName: name,
|
|
113
|
+
// packageVersion: version,
|
|
114
|
+
// componentName: 'editorCore',
|
|
115
|
+
// appearance: getAnalyticsAppearance(this.props.appearance),
|
|
116
|
+
// editorSessionId: this.editorSessionId,
|
|
117
|
+
// }}
|
|
118
|
+
// >
|
|
119
|
+
(0, _react.jsx)(_ui.WithCreateAnalyticsEvent, {
|
|
120
|
+
render: function render(createAnalyticsEvent) {
|
|
121
|
+
return (_this3.createAnalyticsEvent = createAnalyticsEvent) && (0, _react.jsx)(_editorInternal.default, {
|
|
122
|
+
props: _this3.props,
|
|
123
|
+
handleAnalyticsEvent: _this3.handleAnalyticsEvent,
|
|
124
|
+
createAnalyticsEvent: _this3.createAnalyticsEvent,
|
|
125
|
+
preset: _this3.props.preset,
|
|
126
|
+
handleSave: _this3.handleSave,
|
|
127
|
+
editorActions: _this3.editorActions,
|
|
128
|
+
getExperienceStore: _this3.getExperienceStore,
|
|
129
|
+
onEditorCreated: _this3.onEditorCreated,
|
|
130
|
+
onEditorDestroyed: _this3.onEditorDestroyed
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
})
|
|
134
|
+
// </FabricEditorAnalyticsContext>
|
|
135
|
+
);
|
|
124
136
|
}
|
|
125
137
|
}]);
|
|
126
138
|
return EditorNext;
|
|
127
139
|
}(_react2.default.Component);
|
|
128
140
|
exports.default = EditorNext;
|
|
129
|
-
/**
|
|
130
|
-
* WARNING: Code should be shared between Editor + EditorNext
|
|
131
|
-
* If you are making changes that affect both, consider making them
|
|
132
|
-
* in editor-next/editor-internal.tsx or editor-next/editor-utils.ts
|
|
133
|
-
*/
|
|
134
141
|
(0, _defineProperty2.default)(EditorNext, "defaultProps", _editorPropTypes.defaultProps);
|
|
135
142
|
(0, _defineProperty2.default)(EditorNext, "contextTypes", {
|
|
136
143
|
editorActions: _propTypes.default.object
|
package/dist/cjs/editor.js
CHANGED
|
@@ -12,268 +12,50 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
12
12
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
16
|
var _react = require("@emotion/react");
|
|
16
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
17
|
var _react2 = _interopRequireDefault(require("react"));
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var _versionWrapper = require("./version-wrapper");
|
|
18
|
+
var _editorPropTypes = require("./editor-next/utils/editorPropTypes");
|
|
19
|
+
var _editorNext = _interopRequireDefault(require("./editor-next"));
|
|
20
|
+
var _useUniversalPreset = _interopRequireDefault(require("./labs/next/presets/useUniversalPreset"));
|
|
22
21
|
var _analyticsNamespacedContext = require("@atlaskit/analytics-namespaced-context");
|
|
22
|
+
var _versionWrapper = require("./version-wrapper");
|
|
23
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
23
24
|
var _v = _interopRequireDefault(require("uuid/v4"));
|
|
24
|
-
var _actions = _interopRequireDefault(require("./actions"));
|
|
25
|
-
var _editorInternal = require("./editor-next/editor-internal");
|
|
26
|
-
var _editorPropTypes = require("./editor-next/utils/editorPropTypes");
|
|
27
|
-
var _trackEditorActions2 = _interopRequireDefault(require("./editor-next/utils/trackEditorActions"));
|
|
28
|
-
var _onEditorCreated2 = _interopRequireDefault(require("./editor-next/utils/onEditorCreated"));
|
|
29
|
-
var _deprecationWarnings = _interopRequireDefault(require("./editor-next/utils/deprecationWarnings"));
|
|
30
|
-
var _featureFlagsFromProps = require("./create-editor/feature-flags-from-props");
|
|
31
|
-
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
32
|
-
var _prepareQuickInsertProvider = _interopRequireDefault(require("./utils/prepare-quick-insert-provider"));
|
|
33
|
-
var _prepareExtensionProvider = _interopRequireDefault(require("./utils/prepare-extension-provider"));
|
|
34
|
-
var _handleProviders = _interopRequireDefault(require("./editor-next/utils/handleProviders"));
|
|
35
|
-
var _getProvidersFromEditorProps = _interopRequireDefault(require("./editor-next/utils/getProvidersFromEditorProps"));
|
|
36
|
-
var _measureEnum = _interopRequireDefault(require("./utils/performance/measure-enum"));
|
|
37
|
-
var _editorMeasureTTICallback = _interopRequireDefault(require("./editor-next/utils/editorMeasureTTICallback"));
|
|
38
|
-
var _sendDurationAnalytics = _interopRequireDefault(require("./editor-next/utils/sendDurationAnalytics"));
|
|
39
|
-
var _createPluginsList = require("./create-editor/create-plugins-list");
|
|
40
|
-
var _presetUtils = require("./create-editor/preset-utils");
|
|
41
25
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
42
26
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
27
|
+
var EditorNextWrapper = function EditorNextWrapper(_ref) {
|
|
28
|
+
var props = _ref.props;
|
|
29
|
+
var preset = (0, _useUniversalPreset.default)({
|
|
30
|
+
props: props
|
|
31
|
+
});
|
|
32
|
+
return (0, _react.jsx)(_editorNext.default, (0, _extends2.default)({
|
|
33
|
+
preset: preset
|
|
34
|
+
}, props));
|
|
35
|
+
};
|
|
43
36
|
var Editor = /*#__PURE__*/function (_React$Component) {
|
|
44
37
|
(0, _inherits2.default)(Editor, _React$Component);
|
|
45
38
|
var _super = _createSuper(Editor);
|
|
46
|
-
function Editor(
|
|
47
|
-
var _props$performanceTra, _props$performanceTra2, _props$featureFlags;
|
|
39
|
+
function Editor() {
|
|
48
40
|
var _this;
|
|
49
41
|
(0, _classCallCheck2.default)(this, Editor);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
* @private
|
|
53
|
-
* @deprecated - Do not override this at all, this is an antipattern.
|
|
54
|
-
* Please reach out to the Editor team if you were previously using this
|
|
55
|
-
* and need to find a workaround.
|
|
56
|
-
*/
|
|
57
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "prepareExtensionProvider", (0, _prepareExtensionProvider.default)(function () {
|
|
58
|
-
return _this.editorActions;
|
|
59
|
-
}));
|
|
60
|
-
/**
|
|
61
|
-
* @private
|
|
62
|
-
* @deprecated - Do not override this at all, this is an antipattern.
|
|
63
|
-
* Please reach out to the Editor team if you were previously using this
|
|
64
|
-
* and need to find a workaround.
|
|
65
|
-
*/
|
|
66
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "prepareQuickInsertProvider", function (extensionProvider, quickInsert) {
|
|
67
|
-
return (0, _prepareQuickInsertProvider.default)(_this.editorActions, extensionProvider, quickInsert, _this.createAnalyticsEvent);
|
|
68
|
-
});
|
|
69
|
-
/**
|
|
70
|
-
* @private
|
|
71
|
-
* @deprecated - Do not override this at all, this is an antipattern.
|
|
72
|
-
* Please reach out to the Editor team if you were previously using this
|
|
73
|
-
* and need to find a workaround.
|
|
74
|
-
*/
|
|
75
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleSave", function (view) {
|
|
76
|
-
var _this$props$onSave, _this$props;
|
|
77
|
-
return (_this$props$onSave = (_this$props = _this.props).onSave) === null || _this$props$onSave === void 0 ? void 0 : _this$props$onSave.call(_this$props, view);
|
|
78
|
-
});
|
|
79
|
-
/**
|
|
80
|
-
* @private
|
|
81
|
-
* @deprecated - Do not override this at all, this is an antipattern.
|
|
82
|
-
* Please reach out to the Editor team if you were previously using this
|
|
83
|
-
* and need to find a workaround.
|
|
84
|
-
*/
|
|
85
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleAnalyticsEvent", function (data) {
|
|
86
|
-
return (0, _analytics.fireAnalyticsEvent)(_this.createAnalyticsEvent)(data);
|
|
87
|
-
});
|
|
88
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getFeatureFlags", function () {
|
|
89
|
-
return (0, _featureFlagsFromProps.createFeatureFlagsFromProps)(_this.props);
|
|
90
|
-
});
|
|
91
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getExperienceStore", function () {
|
|
92
|
-
return _this.experienceStore;
|
|
93
|
-
});
|
|
94
|
-
_this.providerFactory = new _providerFactory.ProviderFactory();
|
|
95
|
-
(0, _deprecationWarnings.default)(props);
|
|
96
|
-
_this.editorActions = (context || {}).editorActions || new _actions.default();
|
|
97
|
-
_this.editorSessionId = (0, _v.default)();
|
|
98
|
-
_this.startTime = performance.now();
|
|
99
|
-
_this.onEditorCreated = _this.onEditorCreated.bind((0, _assertThisInitialized2.default)(_this));
|
|
100
|
-
_this.onEditorDestroyed = _this.onEditorDestroyed.bind((0, _assertThisInitialized2.default)(_this));
|
|
101
|
-
_this.getExperienceStore = _this.getExperienceStore.bind((0, _assertThisInitialized2.default)(_this));
|
|
102
|
-
_this.trackEditorActions(_this.editorActions, props);
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Consider any changes here to corresponding file for `EditorNext` in
|
|
106
|
-
* `useEditorConstructor` (editor-next/hooks/useEditorMeasuresConstructor.ts)
|
|
107
|
-
*/
|
|
108
|
-
(0, _utils.startMeasure)(_measureEnum.default.EDITOR_MOUNTED);
|
|
109
|
-
if ((_props$performanceTra = props.performanceTracking) !== null && _props$performanceTra !== void 0 && (_props$performanceTra2 = _props$performanceTra.ttiTracking) !== null && _props$performanceTra2 !== void 0 && _props$performanceTra2.enabled || (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.ufo) {
|
|
110
|
-
var _props$performanceTra3, _props$performanceTra4, _props$performanceTra5, _props$performanceTra6;
|
|
111
|
-
(0, _utils.measureTTI)(function (tti, ttiFromInvocation, canceled) {
|
|
112
|
-
(0, _editorMeasureTTICallback.default)(tti, ttiFromInvocation, canceled, _this.props.performanceTracking, _this.props.featureFlags, _this.createAnalyticsEvent, _this.experienceStore);
|
|
113
|
-
}, (_props$performanceTra3 = props.performanceTracking) === null || _props$performanceTra3 === void 0 ? void 0 : (_props$performanceTra4 = _props$performanceTra3.ttiTracking) === null || _props$performanceTra4 === void 0 ? void 0 : _props$performanceTra4.ttiIdleThreshold, (_props$performanceTra5 = props.performanceTracking) === null || _props$performanceTra5 === void 0 ? void 0 : (_props$performanceTra6 = _props$performanceTra5.ttiTracking) === null || _props$performanceTra6 === void 0 ? void 0 : _props$performanceTra6.ttiCancelTimeout);
|
|
42
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
43
|
+
args[_key] = arguments[_key];
|
|
114
44
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
* Consider any changes here to corresponding file for `EditorNext` in
|
|
118
|
-
* `useProviderFactory` (editor-next/hooks/useProviderFactory.ts)
|
|
119
|
-
*/
|
|
120
|
-
var _extensionProvider = _this.prepareExtensionProvider(props.extensionProviders);
|
|
121
|
-
var quickInsertProvider = _this.prepareQuickInsertProvider(_extensionProvider, props.quickInsert);
|
|
122
|
-
var preset = (0, _createPluginsList.createPreset)(props, undefined, _this.createAnalyticsEvent);
|
|
123
|
-
_this.state = {
|
|
124
|
-
extensionProvider: _extensionProvider,
|
|
125
|
-
quickInsertProvider: quickInsertProvider,
|
|
126
|
-
preset: preset
|
|
127
|
-
};
|
|
45
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
46
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "editorSessionId", (0, _v.default)());
|
|
128
47
|
return _this;
|
|
129
48
|
}
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Consider any changes here to corresponding file for `EditorNext` in
|
|
133
|
-
* `useProviderFactory` (editor-next/hooks/useProviderFactory.ts) and
|
|
134
|
-
* `useMeasureEditorMountTime` (editor-next/hooks/useMeasureEditorMountTime.ts)
|
|
135
|
-
*/
|
|
136
49
|
(0, _createClass2.default)(Editor, [{
|
|
137
|
-
key: "componentDidMount",
|
|
138
|
-
value: function componentDidMount() {
|
|
139
|
-
(0, _utils.stopMeasure)(_measureEnum.default.EDITOR_MOUNTED, (0, _sendDurationAnalytics.default)(_analytics.ACTION.EDITOR_MOUNTED, this.props, this.getExperienceStore, this.createAnalyticsEvent));
|
|
140
|
-
(0, _handleProviders.default)(this.providerFactory, (0, _getProvidersFromEditorProps.default)(this.props), this.state.extensionProvider, this.state.quickInsertProvider);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Consider any changes here to corresponding file for `EditorNext` in
|
|
145
|
-
* `useProviderFactory` (editor-next/hooks/useProviderFactory.ts)
|
|
146
|
-
*/
|
|
147
|
-
}, {
|
|
148
|
-
key: "componentDidUpdate",
|
|
149
|
-
value: function componentDidUpdate(prevProps) {
|
|
150
|
-
var _this2 = this;
|
|
151
|
-
var needsANewPreset = (0, _presetUtils.shouldRecreatePreset)(prevProps, this.props);
|
|
152
|
-
var preset = needsANewPreset ? (0, _createPluginsList.createPreset)(this.props, prevProps, this.createAnalyticsEvent) : this.state.preset;
|
|
153
|
-
var _this$props2 = this.props,
|
|
154
|
-
extensionProviders = _this$props2.extensionProviders,
|
|
155
|
-
quickInsert = _this$props2.quickInsert;
|
|
156
|
-
if (extensionProviders && extensionProviders !== prevProps.extensionProviders ||
|
|
157
|
-
// Though this will introduce some performance regression related to quick insert
|
|
158
|
-
// loading but we can remove it soon when Forge will move to new API.
|
|
159
|
-
// quickInsert={Promise.resolve(consumerQuickInsert)} is one of the main reason behind this performance issue.
|
|
160
|
-
quickInsert && quickInsert !== prevProps.quickInsert) {
|
|
161
|
-
var extensionProvider = this.prepareExtensionProvider(extensionProviders);
|
|
162
|
-
var quickInsertProvider = this.prepareQuickInsertProvider(extensionProvider, quickInsert);
|
|
163
|
-
this.setState({
|
|
164
|
-
extensionProvider: extensionProvider,
|
|
165
|
-
quickInsertProvider: quickInsertProvider,
|
|
166
|
-
preset: preset
|
|
167
|
-
}, function () {
|
|
168
|
-
return (0, _handleProviders.default)(_this2.providerFactory, (0, _getProvidersFromEditorProps.default)(_this2.props), _this2.state.extensionProvider, _this2.state.quickInsertProvider);
|
|
169
|
-
});
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
if (needsANewPreset) {
|
|
173
|
-
this.setState({
|
|
174
|
-
preset: preset
|
|
175
|
-
});
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
(0, _handleProviders.default)(this.providerFactory, (0, _getProvidersFromEditorProps.default)(this.props), this.state.extensionProvider, this.state.quickInsertProvider);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Consider any changes here to corresponding file for `EditorNext` in
|
|
183
|
-
* `useProviderFactory` (editor-next/hooks/useProviderFactory.ts) and
|
|
184
|
-
* `useMeasureEditorMountTime` (editor-next/hooks/useMeasureEditorMountTime.ts)
|
|
185
|
-
*/
|
|
186
|
-
}, {
|
|
187
|
-
key: "componentWillUnmount",
|
|
188
|
-
value: function componentWillUnmount() {
|
|
189
|
-
var _this$props3, _this$props3$performa, _this$props3$performa2, _this$props$featureFl;
|
|
190
|
-
this.unregisterEditorFromActions();
|
|
191
|
-
this.providerFactory.destroy();
|
|
192
|
-
(0, _utils.clearMeasure)(_measureEnum.default.EDITOR_MOUNTED);
|
|
193
|
-
((_this$props3 = this.props) === null || _this$props3 === void 0 ? void 0 : (_this$props3$performa = _this$props3.performanceTracking) === null || _this$props3$performa === void 0 ? void 0 : (_this$props3$performa2 = _this$props3$performa.onEditorReadyCallbackTracking) === null || _this$props3$performa2 === void 0 ? void 0 : _this$props3$performa2.enabled) && (0, _utils.clearMeasure)(_measureEnum.default.ON_EDITOR_READY_CALLBACK);
|
|
194
|
-
if ((_this$props$featureFl = this.props.featureFlags) !== null && _this$props$featureFl !== void 0 && _this$props$featureFl.ufo) {
|
|
195
|
-
var _this$experienceStore;
|
|
196
|
-
(_this$experienceStore = this.experienceStore) === null || _this$experienceStore === void 0 ? void 0 : _this$experienceStore.abortAll({
|
|
197
|
-
reason: 'editor component unmounted'
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* @private
|
|
204
|
-
* @deprecated - Do not override this at all, this is an anti-pattern.
|
|
205
|
-
* Please reach out to the Editor team if you were previously using this
|
|
206
|
-
* and need to find a workaround.
|
|
207
|
-
*/
|
|
208
|
-
}, {
|
|
209
|
-
key: "trackEditorActions",
|
|
210
|
-
value: function trackEditorActions(editorActions, props) {
|
|
211
|
-
var _this3 = this;
|
|
212
|
-
return (0, _trackEditorActions2.default)(editorActions, props.performanceTracking, function (value) {
|
|
213
|
-
return _this3.handleAnalyticsEvent(value);
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
}, {
|
|
217
|
-
key: "onEditorCreated",
|
|
218
|
-
value:
|
|
219
|
-
/**
|
|
220
|
-
* @private
|
|
221
|
-
* @deprecated - Do not override this at all, this is an antipattern.
|
|
222
|
-
* Please reach out to the Editor team if you were previously using this
|
|
223
|
-
* and need to find a workaround.
|
|
224
|
-
*/
|
|
225
|
-
function onEditorCreated(instance) {
|
|
226
|
-
var _this4 = this;
|
|
227
|
-
(0, _onEditorCreated2.default)(instance, this.props, function (experienceStore) {
|
|
228
|
-
return _this4.experienceStore = experienceStore;
|
|
229
|
-
}, this.getExperienceStore, function () {
|
|
230
|
-
return _this4.createAnalyticsEvent;
|
|
231
|
-
}, this.editorActions, this.startTime, function (view, dispatcher, transformerForActions) {
|
|
232
|
-
return _this4.registerEditorForActions(view, dispatcher, transformerForActions);
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* @private
|
|
238
|
-
* @deprecated - Do not override this at all, this is an antipattern.
|
|
239
|
-
* Please reach out to the Editor team if you were previously using this
|
|
240
|
-
* and need to find a workaround.
|
|
241
|
-
*/
|
|
242
|
-
}, {
|
|
243
|
-
key: "onEditorDestroyed",
|
|
244
|
-
value: function onEditorDestroyed(_instance) {
|
|
245
|
-
var _this$props$onDestroy, _this$props4;
|
|
246
|
-
this.unregisterEditorFromActions();
|
|
247
|
-
(_this$props$onDestroy = (_this$props4 = this.props).onDestroy) === null || _this$props$onDestroy === void 0 ? void 0 : _this$props$onDestroy.call(_this$props4);
|
|
248
|
-
}
|
|
249
|
-
}, {
|
|
250
|
-
key: "registerEditorForActions",
|
|
251
|
-
value:
|
|
252
|
-
/**
|
|
253
|
-
* @private
|
|
254
|
-
* @deprecated - Do not override this at all, this is an antipattern.
|
|
255
|
-
* Please reach out to the Editor team if you were previously using this
|
|
256
|
-
* and need to find a workaround.
|
|
257
|
-
*/
|
|
258
|
-
function registerEditorForActions(editorView, eventDispatcher, contentTransformer) {
|
|
259
|
-
this.editorActions._privateRegisterEditor(editorView, eventDispatcher, contentTransformer, this.getFeatureFlags);
|
|
260
|
-
}
|
|
261
|
-
}, {
|
|
262
|
-
key: "unregisterEditorFromActions",
|
|
263
|
-
value:
|
|
264
|
-
/**
|
|
265
|
-
* @private
|
|
266
|
-
* @deprecated - Do not override this at all, this is an antipattern.
|
|
267
|
-
* Please reach out to the Editor team if you were previously using this
|
|
268
|
-
* and need to find a workaround.
|
|
269
|
-
*/
|
|
270
|
-
function unregisterEditorFromActions() {
|
|
271
|
-
this.editorActions._privateUnregisterEditor();
|
|
272
|
-
}
|
|
273
|
-
}, {
|
|
274
50
|
key: "render",
|
|
275
51
|
value: function render() {
|
|
276
|
-
|
|
52
|
+
// TODO: https://product-fabric.atlassian.net/browse/ED-16979
|
|
53
|
+
// Move `FabricEditorAnalyticsContext` back into `EditorNext`
|
|
54
|
+
// This was moved out here to workaround the issue that the analytics
|
|
55
|
+
// context does not wrap the Preset (and therefore does not pass this context
|
|
56
|
+
// information to analytics calls within plugins). After this cleanup task ^ we will
|
|
57
|
+
// not have to generate the `createAnalyticsEvent` outside the Preset
|
|
58
|
+
// and we can move this back into `EditorNext`.
|
|
277
59
|
return (0, _react.jsx)(_analyticsNamespacedContext.FabricEditorAnalyticsContext, {
|
|
278
60
|
data: {
|
|
279
61
|
packageName: _versionWrapper.name,
|
|
@@ -282,33 +64,12 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
282
64
|
appearance: (0, _utils.getAnalyticsAppearance)(this.props.appearance),
|
|
283
65
|
editorSessionId: this.editorSessionId
|
|
284
66
|
}
|
|
285
|
-
}, (0, _react.jsx)(
|
|
286
|
-
|
|
287
|
-
return (_this5.createAnalyticsEvent = createAnalyticsEvent) && (0, _react.jsx)(_editorInternal.EditorInternalWithoutHooks, {
|
|
288
|
-
props: _this5.props,
|
|
289
|
-
handleAnalyticsEvent: _this5.handleAnalyticsEvent,
|
|
290
|
-
createAnalyticsEvent: _this5.createAnalyticsEvent,
|
|
291
|
-
preset: _this5.state.preset,
|
|
292
|
-
handleSave: _this5.handleSave,
|
|
293
|
-
editorActions: _this5.editorActions,
|
|
294
|
-
providerFactory: _this5.providerFactory,
|
|
295
|
-
onEditorCreated: _this5.onEditorCreated,
|
|
296
|
-
onEditorDestroyed: _this5.onEditorDestroyed
|
|
297
|
-
});
|
|
298
|
-
}
|
|
67
|
+
}, (0, _react.jsx)(EditorNextWrapper, {
|
|
68
|
+
props: this.props
|
|
299
69
|
}));
|
|
300
70
|
}
|
|
301
71
|
}]);
|
|
302
72
|
return Editor;
|
|
303
73
|
}(_react2.default.Component);
|
|
304
74
|
exports.default = Editor;
|
|
305
|
-
|
|
306
|
-
* WARNING: Code should be shared between Editor + EditorNext
|
|
307
|
-
* If you are making changes that affect both, consider making them
|
|
308
|
-
* in editor-next/editor-internal.tsx or editor-next/editor-utils.ts
|
|
309
|
-
*/
|
|
310
|
-
(0, _defineProperty2.default)(Editor, "defaultProps", _editorPropTypes.defaultProps);
|
|
311
|
-
(0, _defineProperty2.default)(Editor, "contextTypes", {
|
|
312
|
-
editorActions: _propTypes.default.object
|
|
313
|
-
});
|
|
314
|
-
(0, _defineProperty2.default)(Editor, "propTypes", (0, _editorPropTypes.propTypes)('minHeight only supports editor appearance chromeless and comment for Editor'));
|
|
75
|
+
(0, _defineProperty2.default)(Editor, "defaultProps", _editorPropTypes.defaultProps);
|