@atlaskit/editor-plugin-layout 1.12.8 → 1.12.10
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 +21 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/{plugin.js → layoutPlugin.js} +7 -8
- package/dist/cjs/layoutPluginType.js +12 -0
- package/dist/cjs/{actions.js → pm-plugins/actions.js} +7 -8
- package/dist/cjs/pm-plugins/main.js +2 -2
- package/dist/cjs/pm-plugins/resizing.js +2 -2
- package/dist/cjs/{toolbar.js → ui/toolbar.js} +5 -5
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/{plugin.js → layoutPlugin.js} +7 -8
- package/dist/es2019/layoutPluginType.js +2 -0
- package/dist/es2019/{actions.js → pm-plugins/actions.js} +7 -8
- package/dist/es2019/pm-plugins/main.js +2 -2
- package/dist/es2019/pm-plugins/resizing.js +1 -1
- package/dist/es2019/{toolbar.js → ui/toolbar.js} +5 -5
- package/dist/esm/index.js +1 -1
- package/dist/esm/{plugin.js → layoutPlugin.js} +7 -8
- package/dist/esm/layoutPluginType.js +2 -0
- package/dist/esm/{actions.js → pm-plugins/actions.js} +7 -8
- package/dist/esm/pm-plugins/main.js +2 -2
- package/dist/esm/pm-plugins/resizing.js +1 -1
- package/dist/esm/{toolbar.js → ui/toolbar.js} +5 -5
- package/dist/types/index.d.ts +2 -2
- package/dist/types/layoutPlugin.d.ts +4 -0
- package/dist/types/{plugin.d.ts → layoutPluginType.d.ts} +1 -2
- package/dist/types/{node-views → nodeviews}/index.d.ts +1 -1
- package/dist/types/{actions.d.ts → pm-plugins/actions.d.ts} +1 -1
- package/dist/types/pm-plugins/resizing.d.ts +1 -1
- package/dist/types/{toolbar.d.ts → ui/toolbar.d.ts} +1 -1
- package/dist/types-ts4.5/index.d.ts +2 -2
- package/dist/types-ts4.5/layoutPlugin.d.ts +4 -0
- package/dist/types-ts4.5/{plugin.d.ts → layoutPluginType.d.ts} +1 -2
- package/dist/types-ts4.5/{node-views → nodeviews}/index.d.ts +1 -1
- package/dist/types-ts4.5/{actions.d.ts → pm-plugins/actions.d.ts} +1 -1
- package/dist/types-ts4.5/pm-plugins/resizing.d.ts +1 -1
- package/dist/types-ts4.5/{toolbar.d.ts → ui/toolbar.d.ts} +1 -1
- package/package.json +8 -11
- package/dist/cjs/utils/preRelease.js +0 -11
- package/dist/es2019/utils/preRelease.js +0 -3
- package/dist/esm/utils/preRelease.js +0 -5
- package/dist/types/utils/preRelease.d.ts +0 -1
- package/dist/types-ts4.5/utils/preRelease.d.ts +0 -1
- /package/dist/cjs/{node-views → nodeviews}/index.js +0 -0
- /package/dist/cjs/{consts.js → pm-plugins/consts.js} +0 -0
- /package/dist/cjs/{utils → pm-plugins/utils}/index.js +0 -0
- /package/dist/cjs/{types.js → types/index.js} +0 -0
- /package/dist/es2019/{node-views → nodeviews}/index.js +0 -0
- /package/dist/es2019/{consts.js → pm-plugins/consts.js} +0 -0
- /package/dist/es2019/{utils → pm-plugins/utils}/index.js +0 -0
- /package/dist/es2019/{types.js → types/index.js} +0 -0
- /package/dist/esm/{node-views → nodeviews}/index.js +0 -0
- /package/dist/esm/{consts.js → pm-plugins/consts.js} +0 -0
- /package/dist/esm/{utils → pm-plugins/utils}/index.js +0 -0
- /package/dist/esm/{types.js → types/index.js} +0 -0
- /package/dist/types/{consts.d.ts → pm-plugins/consts.d.ts} +0 -0
- /package/dist/types/{utils → pm-plugins/utils}/index.d.ts +0 -0
- /package/dist/types/{types.d.ts → types/index.d.ts} +0 -0
- /package/dist/types-ts4.5/{consts.d.ts → pm-plugins/consts.d.ts} +0 -0
- /package/dist/types-ts4.5/{utils → pm-plugins/utils}/index.d.ts +0 -0
- /package/dist/types-ts4.5/{types.d.ts → types/index.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-layout
|
|
2
2
|
|
|
3
|
+
## 1.12.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#171014](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/171014)
|
|
8
|
+
[`6163248356c63`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6163248356c63) -
|
|
9
|
+
[ED-25833] Replace the following FGs with experiment `platform_editor_advanced_layouts`
|
|
10
|
+
|
|
11
|
+
- platform_editor_advanced_layouts_breakout_resizing
|
|
12
|
+
- platform_editor_advanced_layouts_pre_release_1
|
|
13
|
+
- platform_editor_advanced_layouts_pre_release_2
|
|
14
|
+
|
|
15
|
+
## 1.12.9
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#170473](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/170473)
|
|
20
|
+
[`2c463f9682286`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2c463f9682286) -
|
|
21
|
+
ED-25813: refactors plugins to meet folder standards
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 1.12.8
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "layoutPlugin", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _layoutPlugin.layoutPlugin;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
var
|
|
12
|
+
var _layoutPlugin = require("./layoutPlugin");
|
|
@@ -17,14 +17,13 @@ var _schema = require("@atlaskit/adf-schema/schema");
|
|
|
17
17
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
18
18
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
19
19
|
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
20
|
-
var
|
|
21
|
-
var _actions = require("./actions");
|
|
20
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
21
|
+
var _actions = require("./pm-plugins/actions");
|
|
22
22
|
var _main = _interopRequireDefault(require("./pm-plugins/main"));
|
|
23
23
|
var _pluginKey = require("./pm-plugins/plugin-key");
|
|
24
24
|
var _resizing = _interopRequireDefault(require("./pm-plugins/resizing"));
|
|
25
|
-
var _toolbar = require("./toolbar");
|
|
26
25
|
var _globalStyles = require("./ui/global-styles");
|
|
27
|
-
var
|
|
26
|
+
var _toolbar = require("./ui/toolbar");
|
|
28
27
|
var layoutPlugin = exports.layoutPlugin = function layoutPlugin(_ref) {
|
|
29
28
|
var _api$analytics;
|
|
30
29
|
var _ref$config = _ref.config,
|
|
@@ -35,7 +34,7 @@ var layoutPlugin = exports.layoutPlugin = function layoutPlugin(_ref) {
|
|
|
35
34
|
nodes: function nodes() {
|
|
36
35
|
return [{
|
|
37
36
|
name: 'layoutSection',
|
|
38
|
-
node: (0,
|
|
37
|
+
node: (0, _experiments.editorExperiment)('advanced_layouts', true) ? _schema.layoutSectionWithSingleColumn : _adfSchema.layoutSection
|
|
39
38
|
}, {
|
|
40
39
|
name: 'layoutColumn',
|
|
41
40
|
node: _adfSchema.layoutColumn
|
|
@@ -48,7 +47,7 @@ var layoutPlugin = exports.layoutPlugin = function layoutPlugin(_ref) {
|
|
|
48
47
|
return (0, _main.default)(options);
|
|
49
48
|
}
|
|
50
49
|
}];
|
|
51
|
-
if ((options.editorAppearance === 'full-page' || options.editorAppearance === 'full-width') && api && (0,
|
|
50
|
+
if ((options.editorAppearance === 'full-page' || options.editorAppearance === 'full-width') && api && (0, _experiments.editorExperiment)('advanced_layouts', true)) {
|
|
52
51
|
plugins.push({
|
|
53
52
|
name: 'layoutResizing',
|
|
54
53
|
plugin: function plugin(_ref2) {
|
|
@@ -77,7 +76,7 @@ var layoutPlugin = exports.layoutPlugin = function layoutPlugin(_ref) {
|
|
|
77
76
|
},
|
|
78
77
|
quickInsert: function quickInsert(_ref4) {
|
|
79
78
|
var formatMessage = _ref4.formatMessage;
|
|
80
|
-
return (0,
|
|
79
|
+
return (0, _experiments.editorExperiment)('advanced_layouts', true) ? [{
|
|
81
80
|
id: 'twocolumnslayout',
|
|
82
81
|
title: formatMessage(_messages.layoutMessages.twoColumns),
|
|
83
82
|
description: formatMessage(_messages.toolbarInsertBlockMessages.columnsDescription),
|
|
@@ -156,7 +155,7 @@ var layoutPlugin = exports.layoutPlugin = function layoutPlugin(_ref) {
|
|
|
156
155
|
}
|
|
157
156
|
},
|
|
158
157
|
contentComponent: function contentComponent() {
|
|
159
|
-
return (0,
|
|
158
|
+
return (0, _experiments.editorExperiment)('advanced_layouts', true) ? /*#__PURE__*/_react.default.createElement(_globalStyles.GlobalStylesWrapper, null) : null;
|
|
160
159
|
}
|
|
161
160
|
};
|
|
162
161
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "pluginKey", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _pluginKey.pluginKey;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _pluginKey = require("./pm-plugins/plugin-key");
|
|
@@ -16,15 +16,14 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
16
16
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
17
17
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
18
18
|
var _consts = require("./consts");
|
|
19
|
-
var _pluginKey = require("./
|
|
20
|
-
var _preRelease = require("./utils/preRelease");
|
|
19
|
+
var _pluginKey = require("./plugin-key");
|
|
21
20
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
22
21
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23
22
|
var ONE_COL_LAYOUTS = exports.ONE_COL_LAYOUTS = ['single'];
|
|
24
23
|
var TWO_COL_LAYOUTS = exports.TWO_COL_LAYOUTS = ['two_equal', 'two_left_sidebar', 'two_right_sidebar'];
|
|
25
24
|
var THREE_COL_LAYOUTS = exports.THREE_COL_LAYOUTS = ['three_equal', 'three_with_sidebars'];
|
|
26
25
|
var getWidthsForPreset = function getWidthsForPreset(presetLayout) {
|
|
27
|
-
if ((0,
|
|
26
|
+
if ((0, _experiments.editorExperiment)('advanced_layouts', true)) {
|
|
28
27
|
switch (presetLayout) {
|
|
29
28
|
case 'single':
|
|
30
29
|
return [100];
|
|
@@ -87,7 +86,7 @@ var getPresetLayout = exports.getPresetLayout = function getPresetLayout(section
|
|
|
87
86
|
var widths = (0, _utils.mapChildren)(section, function (column) {
|
|
88
87
|
return column.attrs.width;
|
|
89
88
|
}).join(',');
|
|
90
|
-
if ((0,
|
|
89
|
+
if ((0, _experiments.editorExperiment)('advanced_layouts', true)) {
|
|
91
90
|
switch (widths) {
|
|
92
91
|
case '100':
|
|
93
92
|
return 'single';
|
|
@@ -190,7 +189,7 @@ var insertLayoutColumnsWithAnalytics = exports.insertLayoutColumnsWithAnalytics
|
|
|
190
189
|
* Add a column to the right of existing layout
|
|
191
190
|
*/
|
|
192
191
|
function addColumn(schema, pos) {
|
|
193
|
-
if (
|
|
192
|
+
if ((0, _experiments.editorExperiment)('advanced_layouts', false)) {
|
|
194
193
|
return function (tr) {
|
|
195
194
|
tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos), schema.nodes.layoutColumn.createAndFill());
|
|
196
195
|
};
|
|
@@ -323,7 +322,7 @@ function forceColumnWidths(state, tr, pos, presetLayout) {
|
|
|
323
322
|
return tr.replaceWith(pos + 1, pos + node.nodeSize - 1, columnWidth(node, state.schema, getWidthsForPreset(presetLayout)));
|
|
324
323
|
}
|
|
325
324
|
function forceSectionToPresetLayout(state, node, pos, presetLayout) {
|
|
326
|
-
var forceColumnStructureFn = (0,
|
|
325
|
+
var forceColumnStructureFn = (0, _experiments.editorExperiment)('advanced_layouts', true) ? forceColumnStructureNew : forceColumnStructure;
|
|
327
326
|
var tr = forceColumnStructureFn(state, node, pos, presetLayout);
|
|
328
327
|
|
|
329
328
|
// save the selection here, since forcing column widths causes a change over the
|
|
@@ -369,7 +368,7 @@ var setPresetLayout = exports.setPresetLayout = function setPresetLayout(editorA
|
|
|
369
368
|
};
|
|
370
369
|
};
|
|
371
370
|
function layoutNeedChanges(node) {
|
|
372
|
-
if ((0,
|
|
371
|
+
if ((0, _experiments.editorExperiment)('advanced_layouts', true)) {
|
|
373
372
|
return !getPresetLayout(node) || !isValidLayoutWidthDistributions(node);
|
|
374
373
|
}
|
|
375
374
|
return !getPresetLayout(node);
|
|
@@ -482,7 +481,7 @@ var deleteActiveLayoutNode = exports.deleteActiveLayoutNode = function deleteAct
|
|
|
482
481
|
};
|
|
483
482
|
};
|
|
484
483
|
var formatLayoutName = function formatLayoutName(layout) {
|
|
485
|
-
if ((0,
|
|
484
|
+
if ((0, _experiments.editorExperiment)('advanced_layouts', true)) {
|
|
486
485
|
switch (layout) {
|
|
487
486
|
case 'single':
|
|
488
487
|
return _analytics.LAYOUT_TYPE.SINGLE_COL;
|
|
@@ -13,9 +13,9 @@ var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
|
13
13
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
14
14
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
15
15
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
16
|
-
var _actions = require("
|
|
17
|
-
var _utils3 = require("../utils");
|
|
16
|
+
var _actions = require("./actions");
|
|
18
17
|
var _pluginKey = require("./plugin-key");
|
|
18
|
+
var _utils3 = require("./utils");
|
|
19
19
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20
20
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
21
|
var DEFAULT_LAYOUT = exports.DEFAULT_LAYOUT = 'two_equal';
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.pluginKey = exports.default = void 0;
|
|
7
7
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
8
8
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
|
-
var
|
|
9
|
+
var _nodeviews = require("../nodeviews");
|
|
10
10
|
var pluginKey = exports.pluginKey = new _state.PluginKey('layoutResizingPlugin');
|
|
11
11
|
var _default = exports.default = function _default(options, pluginInjectionApi, portalProviderAPI, eventDispatcher) {
|
|
12
12
|
return new _safePlugin.SafePlugin({
|
|
@@ -14,7 +14,7 @@ var _default = exports.default = function _default(options, pluginInjectionApi,
|
|
|
14
14
|
props: {
|
|
15
15
|
nodeViews: {
|
|
16
16
|
layoutSection: function layoutSection(node, view, getPos) {
|
|
17
|
-
return new
|
|
17
|
+
return new _nodeviews.LayoutSectionView({
|
|
18
18
|
node: node,
|
|
19
19
|
view: view,
|
|
20
20
|
getPos: getPos,
|
|
@@ -24,10 +24,10 @@ var _layoutTwoLeftSidebar = _interopRequireDefault(require("@atlaskit/icon/glyph
|
|
|
24
24
|
var _layoutTwoRightSidebar = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/layout-two-right-sidebar"));
|
|
25
25
|
var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove"));
|
|
26
26
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
var
|
|
27
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
28
|
+
var _actions = require("../pm-plugins/actions");
|
|
29
|
+
var _LayoutThreeWithLeftSidebars = require("./icons/LayoutThreeWithLeftSidebars");
|
|
30
|
+
var _LayoutThreeWithRightSidebars = require("./icons/LayoutThreeWithRightSidebars");
|
|
31
31
|
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); }
|
|
32
32
|
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; }
|
|
33
33
|
var LAYOUT_TYPES = [{
|
|
@@ -233,7 +233,7 @@ var buildToolbar = exports.buildToolbar = function buildToolbar(state, intl, pos
|
|
|
233
233
|
},
|
|
234
234
|
nodeType: nodeType,
|
|
235
235
|
groupLabel: intl.formatMessage(_messages.layoutMessages.floatingToolbarRadioGroupAriaLabel),
|
|
236
|
-
items: (0,
|
|
236
|
+
items: (0, _experiments.editorExperiment)('advanced_layouts', true) ? getAdvancedLayoutItems({
|
|
237
237
|
addSidebarLayouts: addSidebarLayouts,
|
|
238
238
|
intl: intl,
|
|
239
239
|
editorAnalyticsAPI: editorAnalyticsAPI,
|
package/dist/es2019/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { layoutPlugin } from './
|
|
1
|
+
export { layoutPlugin } from './layoutPlugin';
|
|
@@ -4,14 +4,13 @@ import { layoutSectionWithSingleColumn } from '@atlaskit/adf-schema/schema';
|
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { layoutMessages, toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { IconFiveColumnLayout, IconFourColumnLayout, IconLayout, IconThreeColumnLayout, IconTwoColumnLayout } from '@atlaskit/editor-common/quick-insert';
|
|
7
|
-
import {
|
|
8
|
-
import { createDefaultLayoutSection, createMultiColumnLayoutSection, insertLayoutColumnsWithAnalytics } from './actions';
|
|
7
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
|
+
import { createDefaultLayoutSection, createMultiColumnLayoutSection, insertLayoutColumnsWithAnalytics } from './pm-plugins/actions';
|
|
9
9
|
import { default as createLayoutPlugin } from './pm-plugins/main';
|
|
10
10
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
11
11
|
import { default as createLayoutResizingPlugin } from './pm-plugins/resizing';
|
|
12
|
-
import { buildToolbar } from './toolbar';
|
|
13
12
|
import { GlobalStylesWrapper } from './ui/global-styles';
|
|
14
|
-
import {
|
|
13
|
+
import { buildToolbar } from './ui/toolbar';
|
|
15
14
|
export { pluginKey };
|
|
16
15
|
export const layoutPlugin = ({
|
|
17
16
|
config: options = {},
|
|
@@ -23,7 +22,7 @@ export const layoutPlugin = ({
|
|
|
23
22
|
nodes() {
|
|
24
23
|
return [{
|
|
25
24
|
name: 'layoutSection',
|
|
26
|
-
node:
|
|
25
|
+
node: editorExperiment('advanced_layouts', true) ? layoutSectionWithSingleColumn : layoutSection
|
|
27
26
|
}, {
|
|
28
27
|
name: 'layoutColumn',
|
|
29
28
|
node: layoutColumn
|
|
@@ -34,7 +33,7 @@ export const layoutPlugin = ({
|
|
|
34
33
|
name: 'layout',
|
|
35
34
|
plugin: () => createLayoutPlugin(options)
|
|
36
35
|
}];
|
|
37
|
-
if ((options.editorAppearance === 'full-page' || options.editorAppearance === 'full-width') && api &&
|
|
36
|
+
if ((options.editorAppearance === 'full-page' || options.editorAppearance === 'full-width') && api && editorExperiment('advanced_layouts', true)) {
|
|
38
37
|
plugins.push({
|
|
39
38
|
name: 'layoutResizing',
|
|
40
39
|
plugin: ({
|
|
@@ -63,7 +62,7 @@ export const layoutPlugin = ({
|
|
|
63
62
|
},
|
|
64
63
|
quickInsert: ({
|
|
65
64
|
formatMessage
|
|
66
|
-
}) =>
|
|
65
|
+
}) => editorExperiment('advanced_layouts', true) ? [{
|
|
67
66
|
id: 'twocolumnslayout',
|
|
68
67
|
title: formatMessage(layoutMessages.twoColumns),
|
|
69
68
|
description: formatMessage(messages.columnsDescription),
|
|
@@ -131,7 +130,7 @@ export const layoutPlugin = ({
|
|
|
131
130
|
}]
|
|
132
131
|
},
|
|
133
132
|
contentComponent() {
|
|
134
|
-
return
|
|
133
|
+
return editorExperiment('advanced_layouts', true) ? /*#__PURE__*/React.createElement(GlobalStylesWrapper, null) : null;
|
|
135
134
|
}
|
|
136
135
|
};
|
|
137
136
|
};
|
|
@@ -6,13 +6,12 @@ import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state
|
|
|
6
6
|
import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
7
7
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
8
|
import { EVEN_DISTRIBUTED_COL_WIDTHS } from './consts';
|
|
9
|
-
import { pluginKey } from './
|
|
10
|
-
import { isPreRelease2 } from './utils/preRelease';
|
|
9
|
+
import { pluginKey } from './plugin-key';
|
|
11
10
|
export const ONE_COL_LAYOUTS = ['single'];
|
|
12
11
|
export const TWO_COL_LAYOUTS = ['two_equal', 'two_left_sidebar', 'two_right_sidebar'];
|
|
13
12
|
export const THREE_COL_LAYOUTS = ['three_equal', 'three_with_sidebars'];
|
|
14
13
|
const getWidthsForPreset = presetLayout => {
|
|
15
|
-
if (
|
|
14
|
+
if (editorExperiment('advanced_layouts', true)) {
|
|
16
15
|
switch (presetLayout) {
|
|
17
16
|
case 'single':
|
|
18
17
|
return [100];
|
|
@@ -71,7 +70,7 @@ const isValidLayoutWidthDistributions = layoutSection => {
|
|
|
71
70
|
*/
|
|
72
71
|
export const getPresetLayout = section => {
|
|
73
72
|
const widths = mapChildren(section, column => column.attrs.width).join(',');
|
|
74
|
-
if (
|
|
73
|
+
if (editorExperiment('advanced_layouts', true)) {
|
|
75
74
|
switch (widths) {
|
|
76
75
|
case '100':
|
|
77
76
|
return 'single';
|
|
@@ -169,7 +168,7 @@ export const insertLayoutColumnsWithAnalytics = editorAnalyticsAPI => inputMetho
|
|
|
169
168
|
* Add a column to the right of existing layout
|
|
170
169
|
*/
|
|
171
170
|
function addColumn(schema, pos) {
|
|
172
|
-
if (
|
|
171
|
+
if (editorExperiment('advanced_layouts', false)) {
|
|
173
172
|
return tr => {
|
|
174
173
|
tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos), schema.nodes.layoutColumn.createAndFill());
|
|
175
174
|
};
|
|
@@ -301,7 +300,7 @@ function forceColumnWidths(state, tr, pos, presetLayout) {
|
|
|
301
300
|
return tr.replaceWith(pos + 1, pos + node.nodeSize - 1, columnWidth(node, state.schema, getWidthsForPreset(presetLayout)));
|
|
302
301
|
}
|
|
303
302
|
export function forceSectionToPresetLayout(state, node, pos, presetLayout) {
|
|
304
|
-
const forceColumnStructureFn =
|
|
303
|
+
const forceColumnStructureFn = editorExperiment('advanced_layouts', true) ? forceColumnStructureNew : forceColumnStructure;
|
|
305
304
|
let tr = forceColumnStructureFn(state, node, pos, presetLayout);
|
|
306
305
|
|
|
307
306
|
// save the selection here, since forcing column widths causes a change over the
|
|
@@ -344,7 +343,7 @@ export const setPresetLayout = editorAnalyticsAPI => layout => (state, dispatch)
|
|
|
344
343
|
return false;
|
|
345
344
|
};
|
|
346
345
|
function layoutNeedChanges(node) {
|
|
347
|
-
if (
|
|
346
|
+
if (editorExperiment('advanced_layouts', true)) {
|
|
348
347
|
return !getPresetLayout(node) || !isValidLayoutWidthDistributions(node);
|
|
349
348
|
}
|
|
350
349
|
return !getPresetLayout(node);
|
|
@@ -459,7 +458,7 @@ export const deleteActiveLayoutNode = editorAnalyticsAPI => (state, dispatch) =>
|
|
|
459
458
|
return false;
|
|
460
459
|
};
|
|
461
460
|
const formatLayoutName = layout => {
|
|
462
|
-
if (
|
|
461
|
+
if (editorExperiment('advanced_layouts', true)) {
|
|
463
462
|
switch (layout) {
|
|
464
463
|
case 'single':
|
|
465
464
|
return LAYOUT_TYPE.SINGLE_COL;
|
|
@@ -5,9 +5,9 @@ import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
|
|
|
5
5
|
import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
7
7
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
-
import { fixColumnSizes, fixColumnStructure, getSelectedLayout } from '
|
|
9
|
-
import { getMaybeLayoutSection } from '../utils';
|
|
8
|
+
import { fixColumnSizes, fixColumnStructure, getSelectedLayout } from './actions';
|
|
10
9
|
import { pluginKey } from './plugin-key';
|
|
10
|
+
import { getMaybeLayoutSection } from './utils';
|
|
11
11
|
export const DEFAULT_LAYOUT = 'two_equal';
|
|
12
12
|
const isWholeSelectionInsideLayoutColumn = state => {
|
|
13
13
|
// Since findParentNodeOfType doesn't check if selection.to shares the parent, we do this check ourselves
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { LayoutSectionView } from '../
|
|
3
|
+
import { LayoutSectionView } from '../nodeviews';
|
|
4
4
|
export const pluginKey = new PluginKey('layoutResizingPlugin');
|
|
5
5
|
export default ((options, pluginInjectionApi, portalProviderAPI, eventDispatcher) => new SafePlugin({
|
|
6
6
|
key: pluginKey,
|
|
@@ -15,10 +15,10 @@ import LayoutTwoLeftSidebarIcon from '@atlaskit/icon/glyph/editor/layout-two-lef
|
|
|
15
15
|
import LayoutTwoRightSidebarIcon from '@atlaskit/icon/glyph/editor/layout-two-right-sidebar';
|
|
16
16
|
import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
17
17
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
18
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
19
|
+
import { deleteActiveLayoutNode, getPresetLayout, setPresetLayout } from '../pm-plugins/actions';
|
|
20
|
+
import { LayoutThreeWithLeftSidebarsIcon } from './icons/LayoutThreeWithLeftSidebars';
|
|
21
|
+
import { LayoutThreeWithRightSidebarsIcon } from './icons/LayoutThreeWithRightSidebars';
|
|
22
22
|
const LAYOUT_TYPES = [{
|
|
23
23
|
id: 'editor.layout.twoEquals',
|
|
24
24
|
type: 'two_equal',
|
|
@@ -218,7 +218,7 @@ export const buildToolbar = (state, intl, pos, _allowBreakout, addSidebarLayouts
|
|
|
218
218
|
getDomRef: view => findDomRefAtPos(pos, view.domAtPos.bind(view)),
|
|
219
219
|
nodeType,
|
|
220
220
|
groupLabel: intl.formatMessage(toolbarMessages.floatingToolbarRadioGroupAriaLabel),
|
|
221
|
-
items:
|
|
221
|
+
items: editorExperiment('advanced_layouts', true) ? getAdvancedLayoutItems({
|
|
222
222
|
addSidebarLayouts,
|
|
223
223
|
intl,
|
|
224
224
|
editorAnalyticsAPI,
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { layoutPlugin } from './
|
|
1
|
+
export { layoutPlugin } from './layoutPlugin';
|
|
@@ -4,14 +4,13 @@ import { layoutSectionWithSingleColumn } from '@atlaskit/adf-schema/schema';
|
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { layoutMessages, toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { IconFiveColumnLayout, IconFourColumnLayout, IconLayout, IconThreeColumnLayout, IconTwoColumnLayout } from '@atlaskit/editor-common/quick-insert';
|
|
7
|
-
import {
|
|
8
|
-
import { createDefaultLayoutSection, createMultiColumnLayoutSection, insertLayoutColumnsWithAnalytics } from './actions';
|
|
7
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
|
+
import { createDefaultLayoutSection, createMultiColumnLayoutSection, insertLayoutColumnsWithAnalytics } from './pm-plugins/actions';
|
|
9
9
|
import { default as createLayoutPlugin } from './pm-plugins/main';
|
|
10
10
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
11
11
|
import { default as createLayoutResizingPlugin } from './pm-plugins/resizing';
|
|
12
|
-
import { buildToolbar } from './toolbar';
|
|
13
12
|
import { GlobalStylesWrapper } from './ui/global-styles';
|
|
14
|
-
import {
|
|
13
|
+
import { buildToolbar } from './ui/toolbar';
|
|
15
14
|
export { pluginKey };
|
|
16
15
|
export var layoutPlugin = function layoutPlugin(_ref) {
|
|
17
16
|
var _api$analytics;
|
|
@@ -23,7 +22,7 @@ export var layoutPlugin = function layoutPlugin(_ref) {
|
|
|
23
22
|
nodes: function nodes() {
|
|
24
23
|
return [{
|
|
25
24
|
name: 'layoutSection',
|
|
26
|
-
node:
|
|
25
|
+
node: editorExperiment('advanced_layouts', true) ? layoutSectionWithSingleColumn : layoutSection
|
|
27
26
|
}, {
|
|
28
27
|
name: 'layoutColumn',
|
|
29
28
|
node: layoutColumn
|
|
@@ -36,7 +35,7 @@ export var layoutPlugin = function layoutPlugin(_ref) {
|
|
|
36
35
|
return createLayoutPlugin(options);
|
|
37
36
|
}
|
|
38
37
|
}];
|
|
39
|
-
if ((options.editorAppearance === 'full-page' || options.editorAppearance === 'full-width') && api &&
|
|
38
|
+
if ((options.editorAppearance === 'full-page' || options.editorAppearance === 'full-width') && api && editorExperiment('advanced_layouts', true)) {
|
|
40
39
|
plugins.push({
|
|
41
40
|
name: 'layoutResizing',
|
|
42
41
|
plugin: function plugin(_ref2) {
|
|
@@ -65,7 +64,7 @@ export var layoutPlugin = function layoutPlugin(_ref) {
|
|
|
65
64
|
},
|
|
66
65
|
quickInsert: function quickInsert(_ref4) {
|
|
67
66
|
var formatMessage = _ref4.formatMessage;
|
|
68
|
-
return
|
|
67
|
+
return editorExperiment('advanced_layouts', true) ? [{
|
|
69
68
|
id: 'twocolumnslayout',
|
|
70
69
|
title: formatMessage(layoutMessages.twoColumns),
|
|
71
70
|
description: formatMessage(messages.columnsDescription),
|
|
@@ -144,7 +143,7 @@ export var layoutPlugin = function layoutPlugin(_ref) {
|
|
|
144
143
|
}
|
|
145
144
|
},
|
|
146
145
|
contentComponent: function contentComponent() {
|
|
147
|
-
return
|
|
146
|
+
return editorExperiment('advanced_layouts', true) ? /*#__PURE__*/React.createElement(GlobalStylesWrapper, null) : null;
|
|
148
147
|
}
|
|
149
148
|
};
|
|
150
149
|
};
|
|
@@ -9,13 +9,12 @@ import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state
|
|
|
9
9
|
import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
10
10
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
11
11
|
import { EVEN_DISTRIBUTED_COL_WIDTHS } from './consts';
|
|
12
|
-
import { pluginKey } from './
|
|
13
|
-
import { isPreRelease2 } from './utils/preRelease';
|
|
12
|
+
import { pluginKey } from './plugin-key';
|
|
14
13
|
export var ONE_COL_LAYOUTS = ['single'];
|
|
15
14
|
export var TWO_COL_LAYOUTS = ['two_equal', 'two_left_sidebar', 'two_right_sidebar'];
|
|
16
15
|
export var THREE_COL_LAYOUTS = ['three_equal', 'three_with_sidebars'];
|
|
17
16
|
var getWidthsForPreset = function getWidthsForPreset(presetLayout) {
|
|
18
|
-
if (
|
|
17
|
+
if (editorExperiment('advanced_layouts', true)) {
|
|
19
18
|
switch (presetLayout) {
|
|
20
19
|
case 'single':
|
|
21
20
|
return [100];
|
|
@@ -78,7 +77,7 @@ export var getPresetLayout = function getPresetLayout(section) {
|
|
|
78
77
|
var widths = mapChildren(section, function (column) {
|
|
79
78
|
return column.attrs.width;
|
|
80
79
|
}).join(',');
|
|
81
|
-
if (
|
|
80
|
+
if (editorExperiment('advanced_layouts', true)) {
|
|
82
81
|
switch (widths) {
|
|
83
82
|
case '100':
|
|
84
83
|
return 'single';
|
|
@@ -181,7 +180,7 @@ export var insertLayoutColumnsWithAnalytics = function insertLayoutColumnsWithAn
|
|
|
181
180
|
* Add a column to the right of existing layout
|
|
182
181
|
*/
|
|
183
182
|
function addColumn(schema, pos) {
|
|
184
|
-
if (
|
|
183
|
+
if (editorExperiment('advanced_layouts', false)) {
|
|
185
184
|
return function (tr) {
|
|
186
185
|
tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos), schema.nodes.layoutColumn.createAndFill());
|
|
187
186
|
};
|
|
@@ -314,7 +313,7 @@ function forceColumnWidths(state, tr, pos, presetLayout) {
|
|
|
314
313
|
return tr.replaceWith(pos + 1, pos + node.nodeSize - 1, columnWidth(node, state.schema, getWidthsForPreset(presetLayout)));
|
|
315
314
|
}
|
|
316
315
|
export function forceSectionToPresetLayout(state, node, pos, presetLayout) {
|
|
317
|
-
var forceColumnStructureFn =
|
|
316
|
+
var forceColumnStructureFn = editorExperiment('advanced_layouts', true) ? forceColumnStructureNew : forceColumnStructure;
|
|
318
317
|
var tr = forceColumnStructureFn(state, node, pos, presetLayout);
|
|
319
318
|
|
|
320
319
|
// save the selection here, since forcing column widths causes a change over the
|
|
@@ -360,7 +359,7 @@ export var setPresetLayout = function setPresetLayout(editorAnalyticsAPI) {
|
|
|
360
359
|
};
|
|
361
360
|
};
|
|
362
361
|
function layoutNeedChanges(node) {
|
|
363
|
-
if (
|
|
362
|
+
if (editorExperiment('advanced_layouts', true)) {
|
|
364
363
|
return !getPresetLayout(node) || !isValidLayoutWidthDistributions(node);
|
|
365
364
|
}
|
|
366
365
|
return !getPresetLayout(node);
|
|
@@ -473,7 +472,7 @@ export var deleteActiveLayoutNode = function deleteActiveLayoutNode(editorAnalyt
|
|
|
473
472
|
};
|
|
474
473
|
};
|
|
475
474
|
var formatLayoutName = function formatLayoutName(layout) {
|
|
476
|
-
if (
|
|
475
|
+
if (editorExperiment('advanced_layouts', true)) {
|
|
477
476
|
switch (layout) {
|
|
478
477
|
case 'single':
|
|
479
478
|
return LAYOUT_TYPE.SINGLE_COL;
|
|
@@ -8,9 +8,9 @@ import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
|
|
|
8
8
|
import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
9
9
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
10
10
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
11
|
-
import { fixColumnSizes, fixColumnStructure, getSelectedLayout } from '
|
|
12
|
-
import { getMaybeLayoutSection } from '../utils';
|
|
11
|
+
import { fixColumnSizes, fixColumnStructure, getSelectedLayout } from './actions';
|
|
13
12
|
import { pluginKey } from './plugin-key';
|
|
13
|
+
import { getMaybeLayoutSection } from './utils';
|
|
14
14
|
export var DEFAULT_LAYOUT = 'two_equal';
|
|
15
15
|
var isWholeSelectionInsideLayoutColumn = function isWholeSelectionInsideLayoutColumn(state) {
|
|
16
16
|
// Since findParentNodeOfType doesn't check if selection.to shares the parent, we do this check ourselves
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { LayoutSectionView } from '../
|
|
3
|
+
import { LayoutSectionView } from '../nodeviews';
|
|
4
4
|
export var pluginKey = new PluginKey('layoutResizingPlugin');
|
|
5
5
|
export default (function (options, pluginInjectionApi, portalProviderAPI, eventDispatcher) {
|
|
6
6
|
return new SafePlugin({
|
|
@@ -16,10 +16,10 @@ import LayoutTwoLeftSidebarIcon from '@atlaskit/icon/glyph/editor/layout-two-lef
|
|
|
16
16
|
import LayoutTwoRightSidebarIcon from '@atlaskit/icon/glyph/editor/layout-two-right-sidebar';
|
|
17
17
|
import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
18
18
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
19
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
20
|
+
import { deleteActiveLayoutNode, getPresetLayout, setPresetLayout } from '../pm-plugins/actions';
|
|
21
|
+
import { LayoutThreeWithLeftSidebarsIcon } from './icons/LayoutThreeWithLeftSidebars';
|
|
22
|
+
import { LayoutThreeWithRightSidebarsIcon } from './icons/LayoutThreeWithRightSidebars';
|
|
23
23
|
var LAYOUT_TYPES = [{
|
|
24
24
|
id: 'editor.layout.twoEquals',
|
|
25
25
|
type: 'two_equal',
|
|
@@ -223,7 +223,7 @@ export var buildToolbar = function buildToolbar(state, intl, pos, _allowBreakout
|
|
|
223
223
|
},
|
|
224
224
|
nodeType: nodeType,
|
|
225
225
|
groupLabel: intl.formatMessage(toolbarMessages.floatingToolbarRadioGroupAriaLabel),
|
|
226
|
-
items:
|
|
226
|
+
items: editorExperiment('advanced_layouts', true) ? getAdvancedLayoutItems({
|
|
227
227
|
addSidebarLayouts: addSidebarLayouts,
|
|
228
228
|
intl: intl,
|
|
229
229
|
editorAnalyticsAPI: editorAnalyticsAPI,
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { layoutPlugin } from './
|
|
2
|
-
export type { LayoutPlugin } from './
|
|
1
|
+
export { layoutPlugin } from './layoutPlugin';
|
|
2
|
+
export type { LayoutPlugin } from './layoutPluginType';
|
|
3
3
|
export type { LayoutPluginOptions } from './types';
|
|
@@ -3,7 +3,7 @@ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
|
3
3
|
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
4
4
|
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
5
5
|
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
6
|
-
import { insertLayoutColumnsWithAnalytics } from './actions';
|
|
6
|
+
import type { insertLayoutColumnsWithAnalytics } from './pm-plugins/actions';
|
|
7
7
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
8
8
|
import type { LayoutPluginOptions } from './types';
|
|
9
9
|
export { pluginKey };
|
|
@@ -19,4 +19,3 @@ export type LayoutPlugin = NextEditorPlugin<'layout', {
|
|
|
19
19
|
insertLayoutColumns: ReturnType<typeof insertLayoutColumnsWithAnalytics>;
|
|
20
20
|
};
|
|
21
21
|
}>;
|
|
22
|
-
export declare const layoutPlugin: LayoutPlugin;
|
|
@@ -5,7 +5,7 @@ import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
|
5
5
|
import { type ExtractInjectionAPI, type getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
6
6
|
import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
7
7
|
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
-
import { type LayoutPlugin } from '../
|
|
8
|
+
import { type LayoutPlugin } from '../layoutPluginType';
|
|
9
9
|
import { type LayoutPluginOptions } from '../types';
|
|
10
10
|
type LayoutSectionViewProps = {
|
|
11
11
|
node: PMNode;
|
|
@@ -2,7 +2,7 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
|
2
2
|
import type { Command, TOOLBAR_MENU_TYPE } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import type { Change, PresetLayout } from '
|
|
5
|
+
import type { Change, PresetLayout } from '../types';
|
|
6
6
|
export declare const ONE_COL_LAYOUTS: PresetLayout[];
|
|
7
7
|
export declare const TWO_COL_LAYOUTS: PresetLayout[];
|
|
8
8
|
export declare const THREE_COL_LAYOUTS: PresetLayout[];
|
|
@@ -3,7 +3,7 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
4
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
5
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
-
import { type LayoutPlugin } from '../
|
|
6
|
+
import { type LayoutPlugin } from '../layoutPluginType';
|
|
7
7
|
import type { LayoutPluginOptions } from '../types';
|
|
8
8
|
export declare const pluginKey: PluginKey<any>;
|
|
9
9
|
declare const _default: (options: LayoutPluginOptions, pluginInjectionApi: ExtractInjectionAPI<LayoutPlugin>, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher) => SafePlugin<undefined>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next';
|
|
2
2
|
import type { ExtractInjectionAPI, FloatingToolbarConfig } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import type { LayoutPlugin } from '
|
|
4
|
+
import type { LayoutPlugin } from '../index';
|
|
5
5
|
export declare const layoutToolbarTitle = "Layout floating controls";
|
|
6
6
|
export declare const buildToolbar: (state: EditorState, intl: IntlShape, pos: number, _allowBreakout: boolean, addSidebarLayouts: boolean, allowSingleColumnLayout: boolean, api: ExtractInjectionAPI<LayoutPlugin> | undefined) => FloatingToolbarConfig | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { layoutPlugin } from './
|
|
2
|
-
export type { LayoutPlugin } from './
|
|
1
|
+
export { layoutPlugin } from './layoutPlugin';
|
|
2
|
+
export type { LayoutPlugin } from './layoutPluginType';
|
|
3
3
|
export type { LayoutPluginOptions } from './types';
|
|
@@ -3,7 +3,7 @@ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
|
3
3
|
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
4
4
|
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
5
5
|
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
6
|
-
import { insertLayoutColumnsWithAnalytics } from './actions';
|
|
6
|
+
import type { insertLayoutColumnsWithAnalytics } from './pm-plugins/actions';
|
|
7
7
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
8
8
|
import type { LayoutPluginOptions } from './types';
|
|
9
9
|
export { pluginKey };
|
|
@@ -19,4 +19,3 @@ export type LayoutPlugin = NextEditorPlugin<'layout', {
|
|
|
19
19
|
insertLayoutColumns: ReturnType<typeof insertLayoutColumnsWithAnalytics>;
|
|
20
20
|
};
|
|
21
21
|
}>;
|
|
22
|
-
export declare const layoutPlugin: LayoutPlugin;
|
|
@@ -5,7 +5,7 @@ import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
|
5
5
|
import { type ExtractInjectionAPI, type getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
6
6
|
import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
7
7
|
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
-
import { type LayoutPlugin } from '../
|
|
8
|
+
import { type LayoutPlugin } from '../layoutPluginType';
|
|
9
9
|
import { type LayoutPluginOptions } from '../types';
|
|
10
10
|
type LayoutSectionViewProps = {
|
|
11
11
|
node: PMNode;
|
|
@@ -2,7 +2,7 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
|
2
2
|
import type { Command, TOOLBAR_MENU_TYPE } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import type { Change, PresetLayout } from '
|
|
5
|
+
import type { Change, PresetLayout } from '../types';
|
|
6
6
|
export declare const ONE_COL_LAYOUTS: PresetLayout[];
|
|
7
7
|
export declare const TWO_COL_LAYOUTS: PresetLayout[];
|
|
8
8
|
export declare const THREE_COL_LAYOUTS: PresetLayout[];
|
|
@@ -3,7 +3,7 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
4
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
5
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
-
import { type LayoutPlugin } from '../
|
|
6
|
+
import { type LayoutPlugin } from '../layoutPluginType';
|
|
7
7
|
import type { LayoutPluginOptions } from '../types';
|
|
8
8
|
export declare const pluginKey: PluginKey<any>;
|
|
9
9
|
declare const _default: (options: LayoutPluginOptions, pluginInjectionApi: ExtractInjectionAPI<LayoutPlugin>, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher) => SafePlugin<undefined>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next';
|
|
2
2
|
import type { ExtractInjectionAPI, FloatingToolbarConfig } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import type { LayoutPlugin } from '
|
|
4
|
+
import type { LayoutPlugin } from '../index';
|
|
5
5
|
export declare const layoutToolbarTitle = "Layout floating controls";
|
|
6
6
|
export declare const buildToolbar: (state: EditorState, intl: IntlShape, pos: number, _allowBreakout: boolean, addSidebarLayouts: boolean, allowSingleColumnLayout: boolean, api: ExtractInjectionAPI<LayoutPlugin> | undefined) => FloatingToolbarConfig | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-layout",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.10",
|
|
4
4
|
"description": "Layout plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,16 +32,16 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^46.1.0",
|
|
35
|
-
"@atlaskit/editor-common": "^95.
|
|
35
|
+
"@atlaskit/editor-common": "^95.10.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.10.0",
|
|
37
37
|
"@atlaskit/editor-plugin-decorations": "^1.3.0",
|
|
38
38
|
"@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
|
|
39
39
|
"@atlaskit/editor-plugin-width": "^1.3.0",
|
|
40
|
-
"@atlaskit/editor-prosemirror": "6.
|
|
41
|
-
"@atlaskit/icon": "^22.
|
|
40
|
+
"@atlaskit/editor-prosemirror": "6.2.1",
|
|
41
|
+
"@atlaskit/icon": "^22.28.0",
|
|
42
42
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
43
43
|
"@atlaskit/tmp-editor-statsig": "^2.21.0",
|
|
44
|
-
"@atlaskit/tokens": "^2.
|
|
44
|
+
"@atlaskit/tokens": "^2.4.0",
|
|
45
45
|
"@babel/runtime": "^7.0.0",
|
|
46
46
|
"@emotion/react": "^11.7.1"
|
|
47
47
|
},
|
|
@@ -54,6 +54,9 @@
|
|
|
54
54
|
},
|
|
55
55
|
"techstack": {
|
|
56
56
|
"@atlassian/frontend": {
|
|
57
|
+
"code-structure": [
|
|
58
|
+
"editor-plugin"
|
|
59
|
+
],
|
|
57
60
|
"import-structure": [
|
|
58
61
|
"atlassian-conventions"
|
|
59
62
|
],
|
|
@@ -91,15 +94,9 @@
|
|
|
91
94
|
}
|
|
92
95
|
},
|
|
93
96
|
"platform-feature-flags": {
|
|
94
|
-
"platform_editor_advanced_layouts_pre_release_2": {
|
|
95
|
-
"type": "boolean"
|
|
96
|
-
},
|
|
97
97
|
"platform_editor_remove_copy_button_from_view_mode": {
|
|
98
98
|
"type": "boolean"
|
|
99
99
|
},
|
|
100
|
-
"platform_editor_advanced_layouts_breakout_resizing": {
|
|
101
|
-
"type": "boolean"
|
|
102
|
-
},
|
|
103
100
|
"platform-visual-refresh-icons": {
|
|
104
101
|
"type": "boolean"
|
|
105
102
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.isPreRelease2 = void 0;
|
|
7
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
|
-
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
9
|
-
var isPreRelease2 = exports.isPreRelease2 = function isPreRelease2() {
|
|
10
|
-
return (0, _experiments.editorExperiment)('advanced_layouts', true) || (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_pre_release_2');
|
|
11
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
|
-
export var isPreRelease2 = function isPreRelease2() {
|
|
4
|
-
return editorExperiment('advanced_layouts', true) || fg('platform_editor_advanced_layouts_pre_release_2');
|
|
5
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isPreRelease2: () => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isPreRelease2: () => boolean;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|