@atlaskit/editor-core 204.5.3 → 204.5.5
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 +19 -0
- package/dist/cjs/composable-editor/editor-internal.js +2 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +4 -1
- package/dist/cjs/ui/Appearance/FullPage/getEditorViewModeSync.js +43 -0
- package/dist/cjs/ui/ContentStyles/layout.js +1 -2
- package/dist/cjs/utils/extensions.js +8 -18
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/composable-editor/editor-internal.js +2 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +4 -1
- package/dist/es2019/ui/Appearance/FullPage/getEditorViewModeSync.js +33 -0
- package/dist/es2019/ui/ContentStyles/layout.js +1 -2
- package/dist/es2019/utils/extensions.js +8 -18
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/composable-editor/editor-internal.js +2 -1
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +4 -1
- package/dist/esm/ui/Appearance/FullPage/getEditorViewModeSync.js +36 -0
- package/dist/esm/ui/ContentStyles/layout.js +1 -2
- package/dist/esm/utils/extensions.js +8 -18
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/create-editor/create-universal-preset.d.ts +17 -15
- package/dist/types/presets/universal.d.ts +17 -15
- package/dist/types/presets/useUniversalPreset.d.ts +17 -15
- package/dist/types/types/editor-appearance-component.d.ts +2 -0
- package/dist/types/ui/Appearance/FullPage/FullPage.d.ts +1 -2
- package/dist/types/ui/Appearance/FullPage/getEditorViewModeSync.d.ts +3 -0
- package/dist/types-ts4.5/create-editor/create-universal-preset.d.ts +17 -15
- package/dist/types-ts4.5/presets/universal.d.ts +17 -15
- package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +17 -15
- package/dist/types-ts4.5/types/editor-appearance-component.d.ts +2 -0
- package/dist/types-ts4.5/ui/Appearance/FullPage/FullPage.d.ts +1 -2
- package/dist/types-ts4.5/ui/Appearance/FullPage/getEditorViewModeSync.d.ts +3 -0
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 204.5.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#129005](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/129005)
|
|
8
|
+
[`faf7b7b63e80f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/faf7b7b63e80f) -
|
|
9
|
+
Cleanup feature gate for exposing the extension api to the quick insert callback.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 204.5.4
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#128779](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/128779)
|
|
17
|
+
[`ed8a7f2bc8c46`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ed8a7f2bc8c46) -
|
|
18
|
+
Fix delayed initialisation of view mode which causes the toolbar to show unexpectedly in view
|
|
19
|
+
mode.
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 204.5.3
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -137,7 +137,8 @@ var EditorInternal = exports.EditorInternal = /*#__PURE__*/(0, _react.memo)(func
|
|
|
137
137
|
useStickyToolbar: props.useStickyToolbar,
|
|
138
138
|
featureFlags: featureFlags,
|
|
139
139
|
pluginHooks: config.pluginHooks,
|
|
140
|
-
__livePage: props.__livePage
|
|
140
|
+
__livePage: props.__livePage,
|
|
141
|
+
preset: preset
|
|
141
142
|
}));
|
|
142
143
|
}
|
|
143
144
|
}), (0, _react2.jsx)(PortalRenderer, null), (0, _react2.jsx)(NodeViewPortalRenderer, null)))))));
|
|
@@ -13,9 +13,11 @@ var _browser = require("@atlaskit/editor-common/browser");
|
|
|
13
13
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
14
14
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
15
15
|
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
17
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
17
18
|
var _FullPageContentArea = require("./FullPageContentArea");
|
|
18
19
|
var _FullPageToolbar = require("./FullPageToolbar");
|
|
20
|
+
var _getEditorViewModeSync = require("./getEditorViewModeSync");
|
|
19
21
|
var _StyledComponents = require("./StyledComponents");
|
|
20
22
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
21
23
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -75,12 +77,13 @@ var FullPageEditor = exports.FullPageEditor = function FullPageEditor(props) {
|
|
|
75
77
|
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(editorAPI, ['editorViewMode', 'primaryToolbar']),
|
|
76
78
|
editorViewModeState = _useSharedPluginState.editorViewModeState,
|
|
77
79
|
primaryToolbarState = _useSharedPluginState.primaryToolbarState;
|
|
80
|
+
var viewMode = (0, _getEditorViewModeSync.getEditorViewMode)(editorViewModeState, props.preset);
|
|
78
81
|
var toolbarDocking = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(editorAPI, 'selectionToolbar.toolbarDocking');
|
|
79
82
|
var primaryToolbarComponents = props.primaryToolbarComponents;
|
|
80
83
|
if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
|
|
81
84
|
primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
|
|
82
85
|
}
|
|
83
|
-
var isEditorToolbarHidden = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view';
|
|
86
|
+
var isEditorToolbarHidden = (0, _platformFeatureFlags.fg)('platform_editor_sync_editor_view_mode_state') ? viewMode === 'view' : (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view';
|
|
84
87
|
if (props.__livePage && !(0, _experiments.editorExperiment)('live_pages_graceful_edit', 'control')) {
|
|
85
88
|
// the custom toolbar logic should only be applied when the experiment cohort is not control,
|
|
86
89
|
// and the editor is in live page mode.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.getEditorViewMode = void 0;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
|
+
// Retrieve the initial config value from the editor view plugin preset
|
|
11
|
+
var getViewModeSync = function getViewModeSync(preset) {
|
|
12
|
+
var _editorViewModePlugin;
|
|
13
|
+
if (!(0, _platformFeatureFlags.fg)('platform_editor_sync_editor_view_mode_state')) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
// @ts-expect-error - data is a private property
|
|
17
|
+
var editorViewModePlugin = preset.data.find(function (p) {
|
|
18
|
+
if (Array.isArray(p)) {
|
|
19
|
+
var _p = (0, _slicedToArray2.default)(p, 2),
|
|
20
|
+
plugin = _p[0],
|
|
21
|
+
config = _p[1];
|
|
22
|
+
return plugin({
|
|
23
|
+
config: config
|
|
24
|
+
}).name === 'editorViewMode';
|
|
25
|
+
} else {
|
|
26
|
+
var _p2;
|
|
27
|
+
return (p === null || p === void 0 || (_p2 = p({
|
|
28
|
+
config: undefined
|
|
29
|
+
})) === null || _p2 === void 0 ? void 0 : _p2.name) === 'editorViewMode';
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
// If we have set a default value on the view mode (index 1) then we can return the mode, otherwise we haven't set by default
|
|
33
|
+
return Array.isArray(editorViewModePlugin) ? (_editorViewModePlugin = editorViewModePlugin[1]) === null || _editorViewModePlugin === void 0 ? void 0 : _editorViewModePlugin.mode : undefined;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// Temporary to ensure view mode is always set synchronously
|
|
37
|
+
// TODO: ED-27194 - Make editorAPI be set synchronously and we can remove this code
|
|
38
|
+
var getEditorViewMode = exports.getEditorViewMode = function getEditorViewMode(editorViewModeState, preset) {
|
|
39
|
+
if (!(editorViewModeState !== null && editorViewModeState !== void 0 && editorViewModeState.mode)) {
|
|
40
|
+
return getViewModeSync(preset);
|
|
41
|
+
}
|
|
42
|
+
return editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode;
|
|
43
|
+
};
|
|
@@ -11,7 +11,6 @@ var _styles = require("@atlaskit/editor-common/styles");
|
|
|
11
11
|
var _types = require("@atlaskit/editor-plugins/table/types");
|
|
12
12
|
var _consts = require("@atlaskit/editor-plugins/table/ui/consts");
|
|
13
13
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
14
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
14
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
16
15
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
17
16
|
var firstNodeWithNotMarginTop = function firstNodeWithNotMarginTop() {
|
|
@@ -65,5 +64,5 @@ var layoutResponsiveStyles = function layoutResponsiveStyles(viewMode) {
|
|
|
65
64
|
|
|
66
65
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
67
66
|
var layoutStyles = exports.layoutStyles = function layoutStyles(viewMode) {
|
|
68
|
-
return (0, _react.css)(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\t", "\n\t\t[data-layout-section] {\n\t\t\t// Ignored via go/ees007\n\t\t\t// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format\n\t\t\t// TODO: Migrate away from gridSize\n\t\t\t// Recommendation: Replace directly with 7px\n\t\t\tmargin: ", " -", "px 0;\n\t\t\ttransition: border-color 0.3s ", ";\n\t\t\tcursor: ", ";\n\n\t\t\t/* Inner cursor located 26px from left */\n\t\t\t[data-layout-column] {\n\t\t\t\tflex: 1;\n\t\t\t\tposition: relative;\n\n\t\t\t\tmin-width: 0;\n\t\t\t\t/* disable 4 borders when in view mode and advanced layouts is on */\n\t\t\t\tborder: ", "px\n\t\t\t\t\tsolid ", ";\n\t\t\t\tborder-radius: 4px;\n\t\t\t\tpadding: ", "px\n\t\t\t\t\t", "px;\n\t\t\t\tbox-sizing: border-box;\n\n\t\t\t\t> div {\n\t\t\t\t\t", "\n\n\t\t\t\t\t> .embedCardView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .mediaSingleView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-child\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor.-right\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-of-type\n\t\t\t\t\t\t+ .embedCardView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor:first-child\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down\n and shrinking layout's node selectable area (leniency margin) */\n\t\t\t\t\t> [data-node-type='decisionList'] {\n\t\t\t\t\t\tli:first-of-type [data-decision-wrapper] {\n\t\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* Make the 'content' fill the entire height of the layout column to allow click\n handler of layout section nodeview to target only data-layout-column */\n\t\t\t\t[data-layout-content] {\n\t\t\t\t\theight: 100%;\n\t\t\t\t\tcursor: text;\n\t\t\t\t\t.mediaGroupView-content-wrap {\n\t\t\t\t\t\tclear: both;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t", "\n\t\t}\n\n\t\t// styles to support borders for layout\n\t\t[data-layout-section],\n\t\t.layoutSectionView-content-wrap {\n\t\t\t", "\n\t\t}\n\t}\n\n\t", "\n\n\t// hide separator when element is dragging on top of a layout column\n\t[data-blocks-drop-target-container] ~ [data-layout-column] > [data-layout-content]::before {\n\t\tdisplay: none;\n\t}\n\n\t.fabric-editor--full-width-mode .ProseMirror {\n\t\t[data-layout-section] {\n\t\t\t.", " {\n\t\t\t\tmargin: 0 ", "px;\n\t\t\t}\n\t\t}\n\t}\n\n\t", "\n"])), layoutSectionStyles(), "var(--ds-space-100, 8px)", _editorSharedStyles.akLayoutGutterOffset + ((0, _experiments.editorExperiment)('nested-dnd', true)
|
|
67
|
+
return (0, _react.css)(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\t", "\n\t\t[data-layout-section] {\n\t\t\t// Ignored via go/ees007\n\t\t\t// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format\n\t\t\t// TODO: Migrate away from gridSize\n\t\t\t// Recommendation: Replace directly with 7px\n\t\t\tmargin: ", " -", "px 0;\n\t\t\ttransition: border-color 0.3s ", ";\n\t\t\tcursor: ", ";\n\n\t\t\t/* Inner cursor located 26px from left */\n\t\t\t[data-layout-column] {\n\t\t\t\tflex: 1;\n\t\t\t\tposition: relative;\n\n\t\t\t\tmin-width: 0;\n\t\t\t\t/* disable 4 borders when in view mode and advanced layouts is on */\n\t\t\t\tborder: ", "px\n\t\t\t\t\tsolid ", ";\n\t\t\t\tborder-radius: 4px;\n\t\t\t\tpadding: ", "px\n\t\t\t\t\t", "px;\n\t\t\t\tbox-sizing: border-box;\n\n\t\t\t\t> div {\n\t\t\t\t\t", "\n\n\t\t\t\t\t> .embedCardView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .mediaSingleView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-child\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor.-right\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-of-type\n\t\t\t\t\t\t+ .embedCardView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor:first-child\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down\n and shrinking layout's node selectable area (leniency margin) */\n\t\t\t\t\t> [data-node-type='decisionList'] {\n\t\t\t\t\t\tli:first-of-type [data-decision-wrapper] {\n\t\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* Make the 'content' fill the entire height of the layout column to allow click\n handler of layout section nodeview to target only data-layout-column */\n\t\t\t\t[data-layout-content] {\n\t\t\t\t\theight: 100%;\n\t\t\t\t\tcursor: text;\n\t\t\t\t\t.mediaGroupView-content-wrap {\n\t\t\t\t\t\tclear: both;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t", "\n\t\t}\n\n\t\t// styles to support borders for layout\n\t\t[data-layout-section],\n\t\t.layoutSectionView-content-wrap {\n\t\t\t", "\n\t\t}\n\t}\n\n\t", "\n\n\t// hide separator when element is dragging on top of a layout column\n\t[data-blocks-drop-target-container] ~ [data-layout-column] > [data-layout-content]::before {\n\t\tdisplay: none;\n\t}\n\n\t.fabric-editor--full-width-mode .ProseMirror {\n\t\t[data-layout-section] {\n\t\t\t.", " {\n\t\t\t\tmargin: 0 ", "px;\n\t\t\t}\n\t\t}\n\t}\n\n\t", "\n"])), layoutSectionStyles(), "var(--ds-space-100, 8px)", _editorSharedStyles.akLayoutGutterOffset + ((0, _experiments.editorExperiment)('nested-dnd', true) ? 8 : 0), _editorSharedStyles.akEditorSwoopCubicBezier, viewMode === 'view' ? 'default' : 'pointer', viewMode === 'view' || (0, _experiments.editorExperiment)('advanced_layouts', true) ? 0 : _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border, #091E4224)", _styles.LAYOUT_COLUMN_PADDING, _styles.LAYOUT_COLUMN_PADDING + ((0, _experiments.editorExperiment)('nested-dnd', true) ? 8 : 0), firstNodeWithNotMarginTop(), layoutColumnStyles(), (0, _experiments.editorExperiment)('advanced_layouts', true) ? layoutWithSeparatorBorderStyles(viewMode) : layoutBorderStyles(viewMode), (0, _experiments.editorExperiment)('advanced_layouts', true) && layoutResponsiveStyles(viewMode), _types.TableCssClassName.TABLE_CONTAINER, _consts.tableMarginFullWidthMode, (0, _experiments.editorExperiment)('nested-dnd', true) && (0, _experiments.editorExperiment)('advanced_layouts', false) && ".ak-editor-content-area.appearance-full-page .ProseMirror [data-layout-section] {\n\t\t\t\tmargin: ".concat("var(--ds-space-100, 8px)", " -", _editorSharedStyles.akLayoutGutterOffset + 8, "px 0;\n\t\t\t\t}"));
|
|
69
68
|
};
|
|
@@ -89,24 +89,14 @@ function _extensionProviderToQuickInsertProvider() {
|
|
|
89
89
|
isDisabledOffline: true,
|
|
90
90
|
action: function action(insert, state, source) {
|
|
91
91
|
if (typeof item.node === 'function') {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
(0, _extensions.resolveImport)(item.node(extensionAPI)).then(function (node) {
|
|
101
|
-
sendExtensionQuickInsertAnalytics(item, state.selection, createAnalyticsEvent, source);
|
|
102
|
-
if (node) {
|
|
103
|
-
editorActions.replaceSelection(node);
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
} else {
|
|
108
|
-
// @ts-expect-error No longer supported without extension API - this will be removed once we cleanup the FG.
|
|
109
|
-
(0, _extensions.resolveImport)(item.node()).then(function (node) {
|
|
92
|
+
var _apiRef$current;
|
|
93
|
+
var extensionAPI = apiRef === null || apiRef === void 0 || (_apiRef$current = apiRef.current) === null || _apiRef$current === void 0 || (_apiRef$current = _apiRef$current.extension) === null || _apiRef$current === void 0 || (_apiRef$current = _apiRef$current.actions) === null || _apiRef$current === void 0 ? void 0 : _apiRef$current.api();
|
|
94
|
+
// While the api can be "undefined" there are no runtime scenarios where this is the case because:
|
|
95
|
+
// - The quick insert API can only be called from an active editor
|
|
96
|
+
// - The extension module handler can only be called from an active editor with the extension plugin
|
|
97
|
+
// Therefore this should always be run unless there is something very wrong.
|
|
98
|
+
if (extensionAPI) {
|
|
99
|
+
(0, _extensions.resolveImport)(item.node(extensionAPI)).then(function (node) {
|
|
110
100
|
sendExtensionQuickInsertAnalytics(item, state.selection, createAnalyticsEvent, source);
|
|
111
101
|
if (node) {
|
|
112
102
|
editorActions.replaceSelection(node);
|
|
@@ -126,7 +126,8 @@ export const EditorInternal = /*#__PURE__*/memo(({
|
|
|
126
126
|
useStickyToolbar: props.useStickyToolbar,
|
|
127
127
|
featureFlags: featureFlags,
|
|
128
128
|
pluginHooks: config.pluginHooks,
|
|
129
|
-
__livePage: props.__livePage
|
|
129
|
+
__livePage: props.__livePage,
|
|
130
|
+
preset: preset
|
|
130
131
|
}));
|
|
131
132
|
}
|
|
132
133
|
}), jsx(PortalRenderer, null), jsx(NodeViewPortalRenderer, null)))))));
|
|
@@ -10,9 +10,11 @@ import { browser } from '@atlaskit/editor-common/browser';
|
|
|
10
10
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
11
11
|
import { ContextPanelWidthProvider } from '@atlaskit/editor-common/ui';
|
|
12
12
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
13
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
14
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
14
15
|
import { FullPageContentArea } from './FullPageContentArea';
|
|
15
16
|
import { FullPageToolbar } from './FullPageToolbar';
|
|
17
|
+
import { getEditorViewMode } from './getEditorViewModeSync';
|
|
16
18
|
import { fullPageEditorWrapper } from './StyledComponents';
|
|
17
19
|
const useShowKeyline = contentAreaRef => {
|
|
18
20
|
const [showKeyline, setShowKeyline] = useState(false);
|
|
@@ -57,12 +59,13 @@ export const FullPageEditor = props => {
|
|
|
57
59
|
editorViewModeState,
|
|
58
60
|
primaryToolbarState
|
|
59
61
|
} = useSharedPluginState(editorAPI, ['editorViewMode', 'primaryToolbar']);
|
|
62
|
+
const viewMode = getEditorViewMode(editorViewModeState, props.preset);
|
|
60
63
|
const toolbarDocking = useSharedPluginStateSelector(editorAPI, 'selectionToolbar.toolbarDocking');
|
|
61
64
|
let primaryToolbarComponents = props.primaryToolbarComponents;
|
|
62
65
|
if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
|
|
63
66
|
primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
|
|
64
67
|
}
|
|
65
|
-
let isEditorToolbarHidden = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view';
|
|
68
|
+
let isEditorToolbarHidden = fg('platform_editor_sync_editor_view_mode_state') ? viewMode === 'view' : (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view';
|
|
66
69
|
if (props.__livePage && !editorExperiment('live_pages_graceful_edit', 'control')) {
|
|
67
70
|
// the custom toolbar logic should only be applied when the experiment cohort is not control,
|
|
68
71
|
// and the editor is in live page mode.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
+
// Retrieve the initial config value from the editor view plugin preset
|
|
3
|
+
const getViewModeSync = preset => {
|
|
4
|
+
var _editorViewModePlugin;
|
|
5
|
+
if (!fg('platform_editor_sync_editor_view_mode_state')) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
// @ts-expect-error - data is a private property
|
|
9
|
+
const editorViewModePlugin = preset.data.find(p => {
|
|
10
|
+
if (Array.isArray(p)) {
|
|
11
|
+
const [plugin, config] = p;
|
|
12
|
+
return plugin({
|
|
13
|
+
config
|
|
14
|
+
}).name === 'editorViewMode';
|
|
15
|
+
} else {
|
|
16
|
+
var _p;
|
|
17
|
+
return (p === null || p === void 0 ? void 0 : (_p = p({
|
|
18
|
+
config: undefined
|
|
19
|
+
})) === null || _p === void 0 ? void 0 : _p.name) === 'editorViewMode';
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
// If we have set a default value on the view mode (index 1) then we can return the mode, otherwise we haven't set by default
|
|
23
|
+
return Array.isArray(editorViewModePlugin) ? (_editorViewModePlugin = editorViewModePlugin[1]) === null || _editorViewModePlugin === void 0 ? void 0 : _editorViewModePlugin.mode : undefined;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// Temporary to ensure view mode is always set synchronously
|
|
27
|
+
// TODO: ED-27194 - Make editorAPI be set synchronously and we can remove this code
|
|
28
|
+
export const getEditorViewMode = (editorViewModeState, preset) => {
|
|
29
|
+
if (!(editorViewModeState !== null && editorViewModeState !== void 0 && editorViewModeState.mode)) {
|
|
30
|
+
return getViewModeSync(preset);
|
|
31
|
+
}
|
|
32
|
+
return editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode;
|
|
33
|
+
};
|
|
@@ -4,7 +4,6 @@ import { columnLayoutResponsiveSharedStyle, columnLayoutSharedStyle, LAYOUT_COLU
|
|
|
4
4
|
import { TableCssClassName } from '@atlaskit/editor-plugins/table/types';
|
|
5
5
|
import { tableMarginFullWidthMode } from '@atlaskit/editor-plugins/table/ui/consts';
|
|
6
6
|
import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorSelectedNodeClassName, akEditorSwoopCubicBezier, akLayoutGutterOffset, getSelectionStyles, gridMediumMaxWidth, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
9
8
|
const firstNodeWithNotMarginTop = () => editorExperiment('nested-dnd', true) ?
|
|
10
9
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
@@ -272,7 +271,7 @@ export const layoutStyles = viewMode => css`
|
|
|
272
271
|
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
273
272
|
// TODO: Migrate away from gridSize
|
|
274
273
|
// Recommendation: Replace directly with 7px
|
|
275
|
-
margin: ${"var(--ds-space-100, 8px)"} -${akLayoutGutterOffset + (editorExperiment('nested-dnd', true)
|
|
274
|
+
margin: ${"var(--ds-space-100, 8px)"} -${akLayoutGutterOffset + (editorExperiment('nested-dnd', true) ? 8 : 0)}px 0;
|
|
276
275
|
transition: border-color 0.3s ${akEditorSwoopCubicBezier};
|
|
277
276
|
cursor: ${viewMode === 'view' ? 'default' : 'pointer'};
|
|
278
277
|
|
|
@@ -61,24 +61,14 @@ export async function extensionProviderToQuickInsertProvider(extensionProvider,
|
|
|
61
61
|
isDisabledOffline: true,
|
|
62
62
|
action: (insert, state, source) => {
|
|
63
63
|
if (typeof item.node === 'function') {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
resolveImport(item.node(extensionAPI)).then(node => {
|
|
73
|
-
sendExtensionQuickInsertAnalytics(item, state.selection, createAnalyticsEvent, source);
|
|
74
|
-
if (node) {
|
|
75
|
-
editorActions.replaceSelection(node);
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
} else {
|
|
80
|
-
// @ts-expect-error No longer supported without extension API - this will be removed once we cleanup the FG.
|
|
81
|
-
resolveImport(item.node()).then(node => {
|
|
64
|
+
var _apiRef$current, _apiRef$current$exten, _apiRef$current$exten2;
|
|
65
|
+
const extensionAPI = apiRef === null || apiRef === void 0 ? void 0 : (_apiRef$current = apiRef.current) === null || _apiRef$current === void 0 ? void 0 : (_apiRef$current$exten = _apiRef$current.extension) === null || _apiRef$current$exten === void 0 ? void 0 : (_apiRef$current$exten2 = _apiRef$current$exten.actions) === null || _apiRef$current$exten2 === void 0 ? void 0 : _apiRef$current$exten2.api();
|
|
66
|
+
// While the api can be "undefined" there are no runtime scenarios where this is the case because:
|
|
67
|
+
// - The quick insert API can only be called from an active editor
|
|
68
|
+
// - The extension module handler can only be called from an active editor with the extension plugin
|
|
69
|
+
// Therefore this should always be run unless there is something very wrong.
|
|
70
|
+
if (extensionAPI) {
|
|
71
|
+
resolveImport(item.node(extensionAPI)).then(node => {
|
|
82
72
|
sendExtensionQuickInsertAnalytics(item, state.selection, createAnalyticsEvent, source);
|
|
83
73
|
if (node) {
|
|
84
74
|
editorActions.replaceSelection(node);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "204.5.
|
|
2
|
+
export const version = "204.5.5";
|
|
@@ -133,7 +133,8 @@ export var EditorInternal = /*#__PURE__*/memo(function (_ref) {
|
|
|
133
133
|
useStickyToolbar: props.useStickyToolbar,
|
|
134
134
|
featureFlags: featureFlags,
|
|
135
135
|
pluginHooks: config.pluginHooks,
|
|
136
|
-
__livePage: props.__livePage
|
|
136
|
+
__livePage: props.__livePage,
|
|
137
|
+
preset: preset
|
|
137
138
|
}));
|
|
138
139
|
}
|
|
139
140
|
}), jsx(PortalRenderer, null), jsx(NodeViewPortalRenderer, null)))))));
|
|
@@ -11,9 +11,11 @@ import { browser } from '@atlaskit/editor-common/browser';
|
|
|
11
11
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
12
12
|
import { ContextPanelWidthProvider } from '@atlaskit/editor-common/ui';
|
|
13
13
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
14
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
15
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
15
16
|
import { FullPageContentArea } from './FullPageContentArea';
|
|
16
17
|
import { FullPageToolbar } from './FullPageToolbar';
|
|
18
|
+
import { getEditorViewMode } from './getEditorViewModeSync';
|
|
17
19
|
import { fullPageEditorWrapper } from './StyledComponents';
|
|
18
20
|
var useShowKeyline = function useShowKeyline(contentAreaRef) {
|
|
19
21
|
var _useState = useState(false),
|
|
@@ -64,12 +66,13 @@ export var FullPageEditor = function FullPageEditor(props) {
|
|
|
64
66
|
var _useSharedPluginState = useSharedPluginState(editorAPI, ['editorViewMode', 'primaryToolbar']),
|
|
65
67
|
editorViewModeState = _useSharedPluginState.editorViewModeState,
|
|
66
68
|
primaryToolbarState = _useSharedPluginState.primaryToolbarState;
|
|
69
|
+
var viewMode = getEditorViewMode(editorViewModeState, props.preset);
|
|
67
70
|
var toolbarDocking = useSharedPluginStateSelector(editorAPI, 'selectionToolbar.toolbarDocking');
|
|
68
71
|
var primaryToolbarComponents = props.primaryToolbarComponents;
|
|
69
72
|
if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
|
|
70
73
|
primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
|
|
71
74
|
}
|
|
72
|
-
var isEditorToolbarHidden = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view';
|
|
75
|
+
var isEditorToolbarHidden = fg('platform_editor_sync_editor_view_mode_state') ? viewMode === 'view' : (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view';
|
|
73
76
|
if (props.__livePage && !editorExperiment('live_pages_graceful_edit', 'control')) {
|
|
74
77
|
// the custom toolbar logic should only be applied when the experiment cohort is not control,
|
|
75
78
|
// and the editor is in live page mode.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
+
// Retrieve the initial config value from the editor view plugin preset
|
|
4
|
+
var getViewModeSync = function getViewModeSync(preset) {
|
|
5
|
+
var _editorViewModePlugin;
|
|
6
|
+
if (!fg('platform_editor_sync_editor_view_mode_state')) {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
// @ts-expect-error - data is a private property
|
|
10
|
+
var editorViewModePlugin = preset.data.find(function (p) {
|
|
11
|
+
if (Array.isArray(p)) {
|
|
12
|
+
var _p = _slicedToArray(p, 2),
|
|
13
|
+
plugin = _p[0],
|
|
14
|
+
config = _p[1];
|
|
15
|
+
return plugin({
|
|
16
|
+
config: config
|
|
17
|
+
}).name === 'editorViewMode';
|
|
18
|
+
} else {
|
|
19
|
+
var _p2;
|
|
20
|
+
return (p === null || p === void 0 || (_p2 = p({
|
|
21
|
+
config: undefined
|
|
22
|
+
})) === null || _p2 === void 0 ? void 0 : _p2.name) === 'editorViewMode';
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
// If we have set a default value on the view mode (index 1) then we can return the mode, otherwise we haven't set by default
|
|
26
|
+
return Array.isArray(editorViewModePlugin) ? (_editorViewModePlugin = editorViewModePlugin[1]) === null || _editorViewModePlugin === void 0 ? void 0 : _editorViewModePlugin.mode : undefined;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// Temporary to ensure view mode is always set synchronously
|
|
30
|
+
// TODO: ED-27194 - Make editorAPI be set synchronously and we can remove this code
|
|
31
|
+
export var getEditorViewMode = function getEditorViewMode(editorViewModeState, preset) {
|
|
32
|
+
if (!(editorViewModeState !== null && editorViewModeState !== void 0 && editorViewModeState.mode)) {
|
|
33
|
+
return getViewModeSync(preset);
|
|
34
|
+
}
|
|
35
|
+
return editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode;
|
|
36
|
+
};
|
|
@@ -6,7 +6,6 @@ import { columnLayoutResponsiveSharedStyle, columnLayoutSharedStyle, LAYOUT_COLU
|
|
|
6
6
|
import { TableCssClassName } from '@atlaskit/editor-plugins/table/types';
|
|
7
7
|
import { tableMarginFullWidthMode } from '@atlaskit/editor-plugins/table/ui/consts';
|
|
8
8
|
import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorSelectedNodeClassName, akEditorSwoopCubicBezier, akLayoutGutterOffset, getSelectionStyles, gridMediumMaxWidth, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
9
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
11
10
|
var firstNodeWithNotMarginTop = function firstNodeWithNotMarginTop() {
|
|
12
11
|
return editorExperiment('nested-dnd', true) ? // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
@@ -59,5 +58,5 @@ var layoutResponsiveStyles = function layoutResponsiveStyles(viewMode) {
|
|
|
59
58
|
|
|
60
59
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
61
60
|
export var layoutStyles = function layoutStyles(viewMode) {
|
|
62
|
-
return css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n\t.ProseMirror {\n\t\t", "\n\t\t[data-layout-section] {\n\t\t\t// Ignored via go/ees007\n\t\t\t// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format\n\t\t\t// TODO: Migrate away from gridSize\n\t\t\t// Recommendation: Replace directly with 7px\n\t\t\tmargin: ", " -", "px 0;\n\t\t\ttransition: border-color 0.3s ", ";\n\t\t\tcursor: ", ";\n\n\t\t\t/* Inner cursor located 26px from left */\n\t\t\t[data-layout-column] {\n\t\t\t\tflex: 1;\n\t\t\t\tposition: relative;\n\n\t\t\t\tmin-width: 0;\n\t\t\t\t/* disable 4 borders when in view mode and advanced layouts is on */\n\t\t\t\tborder: ", "px\n\t\t\t\t\tsolid ", ";\n\t\t\t\tborder-radius: 4px;\n\t\t\t\tpadding: ", "px\n\t\t\t\t\t", "px;\n\t\t\t\tbox-sizing: border-box;\n\n\t\t\t\t> div {\n\t\t\t\t\t", "\n\n\t\t\t\t\t> .embedCardView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .mediaSingleView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-child\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor.-right\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-of-type\n\t\t\t\t\t\t+ .embedCardView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor:first-child\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down\n and shrinking layout's node selectable area (leniency margin) */\n\t\t\t\t\t> [data-node-type='decisionList'] {\n\t\t\t\t\t\tli:first-of-type [data-decision-wrapper] {\n\t\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* Make the 'content' fill the entire height of the layout column to allow click\n handler of layout section nodeview to target only data-layout-column */\n\t\t\t\t[data-layout-content] {\n\t\t\t\t\theight: 100%;\n\t\t\t\t\tcursor: text;\n\t\t\t\t\t.mediaGroupView-content-wrap {\n\t\t\t\t\t\tclear: both;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t", "\n\t\t}\n\n\t\t// styles to support borders for layout\n\t\t[data-layout-section],\n\t\t.layoutSectionView-content-wrap {\n\t\t\t", "\n\t\t}\n\t}\n\n\t", "\n\n\t// hide separator when element is dragging on top of a layout column\n\t[data-blocks-drop-target-container] ~ [data-layout-column] > [data-layout-content]::before {\n\t\tdisplay: none;\n\t}\n\n\t.fabric-editor--full-width-mode .ProseMirror {\n\t\t[data-layout-section] {\n\t\t\t.", " {\n\t\t\t\tmargin: 0 ", "px;\n\t\t\t}\n\t\t}\n\t}\n\n\t", "\n"])), layoutSectionStyles(), "var(--ds-space-100, 8px)", akLayoutGutterOffset + (editorExperiment('nested-dnd', true)
|
|
61
|
+
return css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n\t.ProseMirror {\n\t\t", "\n\t\t[data-layout-section] {\n\t\t\t// Ignored via go/ees007\n\t\t\t// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format\n\t\t\t// TODO: Migrate away from gridSize\n\t\t\t// Recommendation: Replace directly with 7px\n\t\t\tmargin: ", " -", "px 0;\n\t\t\ttransition: border-color 0.3s ", ";\n\t\t\tcursor: ", ";\n\n\t\t\t/* Inner cursor located 26px from left */\n\t\t\t[data-layout-column] {\n\t\t\t\tflex: 1;\n\t\t\t\tposition: relative;\n\n\t\t\t\tmin-width: 0;\n\t\t\t\t/* disable 4 borders when in view mode and advanced layouts is on */\n\t\t\t\tborder: ", "px\n\t\t\t\t\tsolid ", ";\n\t\t\t\tborder-radius: 4px;\n\t\t\t\tpadding: ", "px\n\t\t\t\t\t", "px;\n\t\t\t\tbox-sizing: border-box;\n\n\t\t\t\t> div {\n\t\t\t\t\t", "\n\n\t\t\t\t\t> .embedCardView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .mediaSingleView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-child\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor.-right\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-of-type\n\t\t\t\t\t\t+ .embedCardView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor:first-child\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down\n and shrinking layout's node selectable area (leniency margin) */\n\t\t\t\t\t> [data-node-type='decisionList'] {\n\t\t\t\t\t\tli:first-of-type [data-decision-wrapper] {\n\t\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* Make the 'content' fill the entire height of the layout column to allow click\n handler of layout section nodeview to target only data-layout-column */\n\t\t\t\t[data-layout-content] {\n\t\t\t\t\theight: 100%;\n\t\t\t\t\tcursor: text;\n\t\t\t\t\t.mediaGroupView-content-wrap {\n\t\t\t\t\t\tclear: both;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t", "\n\t\t}\n\n\t\t// styles to support borders for layout\n\t\t[data-layout-section],\n\t\t.layoutSectionView-content-wrap {\n\t\t\t", "\n\t\t}\n\t}\n\n\t", "\n\n\t// hide separator when element is dragging on top of a layout column\n\t[data-blocks-drop-target-container] ~ [data-layout-column] > [data-layout-content]::before {\n\t\tdisplay: none;\n\t}\n\n\t.fabric-editor--full-width-mode .ProseMirror {\n\t\t[data-layout-section] {\n\t\t\t.", " {\n\t\t\t\tmargin: 0 ", "px;\n\t\t\t}\n\t\t}\n\t}\n\n\t", "\n"])), layoutSectionStyles(), "var(--ds-space-100, 8px)", akLayoutGutterOffset + (editorExperiment('nested-dnd', true) ? 8 : 0), akEditorSwoopCubicBezier, viewMode === 'view' ? 'default' : 'pointer', viewMode === 'view' || editorExperiment('advanced_layouts', true) ? 0 : akEditorSelectedBorderSize, "var(--ds-border, #091E4224)", LAYOUT_COLUMN_PADDING, LAYOUT_COLUMN_PADDING + (editorExperiment('nested-dnd', true) ? 8 : 0), firstNodeWithNotMarginTop(), layoutColumnStyles(), editorExperiment('advanced_layouts', true) ? layoutWithSeparatorBorderStyles(viewMode) : layoutBorderStyles(viewMode), editorExperiment('advanced_layouts', true) && layoutResponsiveStyles(viewMode), TableCssClassName.TABLE_CONTAINER, tableMarginFullWidthMode, editorExperiment('nested-dnd', true) && editorExperiment('advanced_layouts', false) && ".ak-editor-content-area.appearance-full-page .ProseMirror [data-layout-section] {\n\t\t\t\tmargin: ".concat("var(--ds-space-100, 8px)", " -", akLayoutGutterOffset + 8, "px 0;\n\t\t\t\t}"));
|
|
63
62
|
};
|
|
@@ -83,24 +83,14 @@ function _extensionProviderToQuickInsertProvider() {
|
|
|
83
83
|
isDisabledOffline: true,
|
|
84
84
|
action: function action(insert, state, source) {
|
|
85
85
|
if (typeof item.node === 'function') {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
resolveImport(item.node(extensionAPI)).then(function (node) {
|
|
95
|
-
sendExtensionQuickInsertAnalytics(item, state.selection, createAnalyticsEvent, source);
|
|
96
|
-
if (node) {
|
|
97
|
-
editorActions.replaceSelection(node);
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
} else {
|
|
102
|
-
// @ts-expect-error No longer supported without extension API - this will be removed once we cleanup the FG.
|
|
103
|
-
resolveImport(item.node()).then(function (node) {
|
|
86
|
+
var _apiRef$current;
|
|
87
|
+
var extensionAPI = apiRef === null || apiRef === void 0 || (_apiRef$current = apiRef.current) === null || _apiRef$current === void 0 || (_apiRef$current = _apiRef$current.extension) === null || _apiRef$current === void 0 || (_apiRef$current = _apiRef$current.actions) === null || _apiRef$current === void 0 ? void 0 : _apiRef$current.api();
|
|
88
|
+
// While the api can be "undefined" there are no runtime scenarios where this is the case because:
|
|
89
|
+
// - The quick insert API can only be called from an active editor
|
|
90
|
+
// - The extension module handler can only be called from an active editor with the extension plugin
|
|
91
|
+
// Therefore this should always be run unless there is something very wrong.
|
|
92
|
+
if (extensionAPI) {
|
|
93
|
+
resolveImport(item.node(extensionAPI)).then(function (node) {
|
|
104
94
|
sendExtensionQuickInsertAnalytics(item, state.selection, createAnalyticsEvent, source);
|
|
105
95
|
if (node) {
|
|
106
96
|
editorActions.replaceSelection(node);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "204.5.
|
|
2
|
+
export var version = "204.5.5";
|
|
@@ -117,6 +117,7 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
|
|
|
117
117
|
stripNonExistingAnnotations: (slice: import("prosemirror-model").Slice, state: import("prosemirror-state").EditorState) => boolean | undefined;
|
|
118
118
|
setInlineCommentDraftState: (drafting: boolean, inputMethod: import("@atlaskit/editor-plugins/annotation").InlineCommentInputMethod, targetType?: import("@atlaskit/editor-plugins/annotation").TargetType | undefined, targetNodeId?: string | undefined, isOpeningMediaCommentFromToolbar?: boolean | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
119
119
|
showCommentForBlockNode: (node: import("prosemirror-model").Node | null, viewMethod?: import("@atlaskit/editor-common/analytics").VIEW_METHOD | undefined, isOpeningMediaCommentFromToolbar?: boolean | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
120
|
+
hasAnyUnResolvedAnnotationInPage: (state: import("prosemirror-state").EditorState) => boolean;
|
|
120
121
|
};
|
|
121
122
|
}, import("@atlaskit/editor-plugins/annotation").AnnotationProviders | undefined> | undefined, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"extension", {
|
|
122
123
|
pluginConfiguration: import("@atlaskit/editor-plugins/extension").ExtensionPluginOptions | undefined;
|
|
@@ -131,9 +132,9 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
|
|
|
131
132
|
pluginConfiguration: import("@atlaskit/editor-plugins/context-panel").ContextPanelPluginOptions | undefined;
|
|
132
133
|
actions: {
|
|
133
134
|
applyChange: (tr: import("prosemirror-state").Transaction) => import("prosemirror-state").Transaction;
|
|
134
|
-
showPanel
|
|
135
|
-
closePanel
|
|
136
|
-
closePanelById
|
|
135
|
+
showPanel?: import("packages/editor/editor-plugin-context-panel/dist/types/types/object-siderbar-types").ShowObjectSidebar | undefined;
|
|
136
|
+
closePanel?: import("packages/editor/editor-plugin-context-panel/dist/types/types/object-siderbar-types").HideObjectSidebar | undefined;
|
|
137
|
+
closePanelById?: import("packages/editor/editor-plugin-context-panel/dist/types/types/object-siderbar-types").HideObjectSidebarById | undefined;
|
|
137
138
|
};
|
|
138
139
|
sharedState: {
|
|
139
140
|
contents: import("react").ReactNode[] | undefined;
|
|
@@ -270,6 +271,7 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
|
|
|
270
271
|
stripNonExistingAnnotations: (slice: import("prosemirror-model").Slice, state: import("prosemirror-state").EditorState) => boolean | undefined;
|
|
271
272
|
setInlineCommentDraftState: (drafting: boolean, inputMethod: import("@atlaskit/editor-plugins/annotation").InlineCommentInputMethod, targetType?: import("@atlaskit/editor-plugins/annotation").TargetType | undefined, targetNodeId?: string | undefined, isOpeningMediaCommentFromToolbar?: boolean | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
272
273
|
showCommentForBlockNode: (node: import("prosemirror-model").Node | null, viewMethod?: import("@atlaskit/editor-common/analytics").VIEW_METHOD | undefined, isOpeningMediaCommentFromToolbar?: boolean | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
274
|
+
hasAnyUnResolvedAnnotationInPage: (state: import("prosemirror-state").EditorState) => boolean;
|
|
273
275
|
};
|
|
274
276
|
}, import("@atlaskit/editor-plugins/annotation").AnnotationProviders | undefined> | undefined, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"grid", {
|
|
275
277
|
pluginConfiguration: import("packages/editor/editor-plugin-grid/dist/types/gridPluginType").GridPluginConfiguration;
|
|
@@ -449,9 +451,9 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
|
|
|
449
451
|
pluginConfiguration: import("@atlaskit/editor-plugins/context-panel").ContextPanelPluginOptions | undefined;
|
|
450
452
|
actions: {
|
|
451
453
|
applyChange: (tr: import("prosemirror-state").Transaction) => import("prosemirror-state").Transaction;
|
|
452
|
-
showPanel
|
|
453
|
-
closePanel
|
|
454
|
-
closePanelById
|
|
454
|
+
showPanel?: import("packages/editor/editor-plugin-context-panel/dist/types/types/object-siderbar-types").ShowObjectSidebar | undefined;
|
|
455
|
+
closePanel?: import("packages/editor/editor-plugin-context-panel/dist/types/types/object-siderbar-types").HideObjectSidebar | undefined;
|
|
456
|
+
closePanelById?: import("packages/editor/editor-plugin-context-panel/dist/types/types/object-siderbar-types").HideObjectSidebarById | undefined;
|
|
455
457
|
};
|
|
456
458
|
sharedState: {
|
|
457
459
|
contents: import("react").ReactNode[] | undefined;
|
|
@@ -513,9 +515,9 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
|
|
|
513
515
|
pluginConfiguration: import("@atlaskit/editor-plugins/context-panel").ContextPanelPluginOptions | undefined;
|
|
514
516
|
actions: {
|
|
515
517
|
applyChange: (tr: import("prosemirror-state").Transaction) => import("prosemirror-state").Transaction;
|
|
516
|
-
showPanel
|
|
517
|
-
closePanel
|
|
518
|
-
closePanelById
|
|
518
|
+
showPanel?: import("packages/editor/editor-plugin-context-panel/dist/types/types/object-siderbar-types").ShowObjectSidebar | undefined;
|
|
519
|
+
closePanel?: import("packages/editor/editor-plugin-context-panel/dist/types/types/object-siderbar-types").HideObjectSidebar | undefined;
|
|
520
|
+
closePanelById?: import("packages/editor/editor-plugin-context-panel/dist/types/types/object-siderbar-types").HideObjectSidebarById | undefined;
|
|
519
521
|
};
|
|
520
522
|
sharedState: {
|
|
521
523
|
contents: import("react").ReactNode[] | undefined;
|
|
@@ -785,9 +787,9 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
|
|
|
785
787
|
pluginConfiguration: import("@atlaskit/editor-plugins/context-panel").ContextPanelPluginOptions | undefined;
|
|
786
788
|
actions: {
|
|
787
789
|
applyChange: (tr: import("prosemirror-state").Transaction) => import("prosemirror-state").Transaction;
|
|
788
|
-
showPanel
|
|
789
|
-
closePanel
|
|
790
|
-
closePanelById
|
|
790
|
+
showPanel?: import("packages/editor/editor-plugin-context-panel/dist/types/types/object-siderbar-types").ShowObjectSidebar | undefined;
|
|
791
|
+
closePanel?: import("packages/editor/editor-plugin-context-panel/dist/types/types/object-siderbar-types").HideObjectSidebar | undefined;
|
|
792
|
+
closePanelById?: import("packages/editor/editor-plugin-context-panel/dist/types/types/object-siderbar-types").HideObjectSidebarById | undefined;
|
|
791
793
|
};
|
|
792
794
|
sharedState: {
|
|
793
795
|
contents: import("react").ReactNode[] | undefined;
|
|
@@ -877,9 +879,9 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
|
|
|
877
879
|
pluginConfiguration: import("@atlaskit/editor-plugins/context-panel").ContextPanelPluginOptions | undefined;
|
|
878
880
|
actions: {
|
|
879
881
|
applyChange: (tr: import("prosemirror-state").Transaction) => import("prosemirror-state").Transaction;
|
|
880
|
-
showPanel
|
|
881
|
-
closePanel
|
|
882
|
-
closePanelById
|
|
882
|
+
showPanel?: import("packages/editor/editor-plugin-context-panel/dist/types/types/object-siderbar-types").ShowObjectSidebar | undefined;
|
|
883
|
+
closePanel?: import("packages/editor/editor-plugin-context-panel/dist/types/types/object-siderbar-types").HideObjectSidebar | undefined;
|
|
884
|
+
closePanelById?: import("packages/editor/editor-plugin-context-panel/dist/types/types/object-siderbar-types").HideObjectSidebarById | undefined;
|
|
883
885
|
};
|
|
884
886
|
sharedState: {
|
|
885
887
|
contents: import("react").ReactNode[] | undefined;
|