@atlaskit/editor-plugin-layout 1.12.20 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/editor-plugin-layout
2
2
 
3
+ ## 1.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#102136](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/102136)
8
+ [`0d56e554b5633`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0d56e554b5633) -
9
+ ED-26000 add support for layout without breakout
10
+
11
+ ## 1.12.21
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 1.12.20
4
18
 
5
19
  ### Patch Changes
@@ -24,6 +24,9 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
24
24
  var isEmptyParagraph = function isEmptyParagraph(node) {
25
25
  return !!node && node.type.name === 'paragraph' && !node.childCount;
26
26
  };
27
+ var isBreakoutAvailable = function isBreakoutAvailable(schema) {
28
+ return Boolean(schema.marks.breakout);
29
+ };
27
30
  var isEmptyLayout = function isEmptyLayout(node) {
28
31
  if (!node) {
29
32
  return false;
@@ -65,7 +68,7 @@ var LayoutBreakoutResizer = function LayoutBreakoutResizer(_ref) {
65
68
  editorView: view,
66
69
  nodeType: "layoutSection",
67
70
  getEditorWidth: getEditorWidth,
68
- disabled: (editorDisabledState === null || editorDisabledState === void 0 ? void 0 : editorDisabledState.editorDisabled) === true,
71
+ disabled: (editorDisabledState === null || editorDisabledState === void 0 ? void 0 : editorDisabledState.editorDisabled) === true || !isBreakoutAvailable(view.state.schema),
69
72
  parentRef: parentRef,
70
73
  editorAnalyticsApi: pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions,
71
74
  displayGapCursor: displayGapCursor
@@ -7,6 +7,9 @@ import { fg } from '@atlaskit/platform-feature-flags';
7
7
  const isEmptyParagraph = node => {
8
8
  return !!node && node.type.name === 'paragraph' && !node.childCount;
9
9
  };
10
+ const isBreakoutAvailable = schema => {
11
+ return Boolean(schema.marks.breakout);
12
+ };
10
13
  const isEmptyLayout = node => {
11
14
  if (!node) {
12
15
  return false;
@@ -50,7 +53,7 @@ const LayoutBreakoutResizer = ({
50
53
  editorView: view,
51
54
  nodeType: "layoutSection",
52
55
  getEditorWidth: getEditorWidth,
53
- disabled: (editorDisabledState === null || editorDisabledState === void 0 ? void 0 : editorDisabledState.editorDisabled) === true,
56
+ disabled: (editorDisabledState === null || editorDisabledState === void 0 ? void 0 : editorDisabledState.editorDisabled) === true || !isBreakoutAvailable(view.state.schema),
54
57
  parentRef: parentRef,
55
58
  editorAnalyticsApi: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions,
56
59
  displayGapCursor: displayGapCursor
@@ -14,6 +14,9 @@ import { fg } from '@atlaskit/platform-feature-flags';
14
14
  var isEmptyParagraph = function isEmptyParagraph(node) {
15
15
  return !!node && node.type.name === 'paragraph' && !node.childCount;
16
16
  };
17
+ var isBreakoutAvailable = function isBreakoutAvailable(schema) {
18
+ return Boolean(schema.marks.breakout);
19
+ };
17
20
  var isEmptyLayout = function isEmptyLayout(node) {
18
21
  if (!node) {
19
22
  return false;
@@ -55,7 +58,7 @@ var LayoutBreakoutResizer = function LayoutBreakoutResizer(_ref) {
55
58
  editorView: view,
56
59
  nodeType: "layoutSection",
57
60
  getEditorWidth: getEditorWidth,
58
- disabled: (editorDisabledState === null || editorDisabledState === void 0 ? void 0 : editorDisabledState.editorDisabled) === true,
61
+ disabled: (editorDisabledState === null || editorDisabledState === void 0 ? void 0 : editorDisabledState.editorDisabled) === true || !isBreakoutAvailable(view.state.schema),
59
62
  parentRef: parentRef,
60
63
  editorAnalyticsApi: pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions,
61
64
  displayGapCursor: displayGapCursor
@@ -6,15 +6,16 @@ import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
6
6
  import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
7
7
  import type { insertLayoutColumnsWithAnalytics } from './pm-plugins/actions';
8
8
  import type { LayoutPluginOptions } from './types';
9
+ export type LayoutPluginDependencies = [
10
+ DecorationsPlugin,
11
+ SelectionPlugin,
12
+ OptionalPlugin<AnalyticsPlugin>,
13
+ OptionalPlugin<WidthPlugin>,
14
+ OptionalPlugin<EditorDisabledPlugin>
15
+ ];
9
16
  export type LayoutPlugin = NextEditorPlugin<'layout', {
10
17
  pluginConfiguration: LayoutPluginOptions | undefined;
11
- dependencies: [
12
- DecorationsPlugin,
13
- SelectionPlugin,
14
- OptionalPlugin<AnalyticsPlugin>,
15
- OptionalPlugin<WidthPlugin>,
16
- OptionalPlugin<EditorDisabledPlugin>
17
- ];
18
+ dependencies: LayoutPluginDependencies;
18
19
  actions: {
19
20
  insertLayoutColumns: ReturnType<typeof insertLayoutColumnsWithAnalytics>;
20
21
  };
@@ -6,15 +6,16 @@ import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
6
6
  import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
7
7
  import type { insertLayoutColumnsWithAnalytics } from './pm-plugins/actions';
8
8
  import type { LayoutPluginOptions } from './types';
9
+ export type LayoutPluginDependencies = [
10
+ DecorationsPlugin,
11
+ SelectionPlugin,
12
+ OptionalPlugin<AnalyticsPlugin>,
13
+ OptionalPlugin<WidthPlugin>,
14
+ OptionalPlugin<EditorDisabledPlugin>
15
+ ];
9
16
  export type LayoutPlugin = NextEditorPlugin<'layout', {
10
17
  pluginConfiguration: LayoutPluginOptions | undefined;
11
- dependencies: [
12
- DecorationsPlugin,
13
- SelectionPlugin,
14
- OptionalPlugin<AnalyticsPlugin>,
15
- OptionalPlugin<WidthPlugin>,
16
- OptionalPlugin<EditorDisabledPlugin>
17
- ];
18
+ dependencies: LayoutPluginDependencies;
18
19
  actions: {
19
20
  insertLayoutColumns: ReturnType<typeof insertLayoutColumnsWithAnalytics>;
20
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-layout",
3
- "version": "1.12.20",
3
+ "version": "1.13.0",
4
4
  "description": "Layout plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,17 +32,17 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^46.1.0",
35
- "@atlaskit/editor-common": "^98.0.0",
35
+ "@atlaskit/editor-common": "^99.1.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-selection": "^1.6.0",
40
40
  "@atlaskit/editor-plugin-width": "^2.0.0",
41
41
  "@atlaskit/editor-prosemirror": "6.2.1",
42
- "@atlaskit/icon": "^23.1.0",
42
+ "@atlaskit/icon": "^23.3.0",
43
43
  "@atlaskit/platform-feature-flags": "^0.3.0",
44
- "@atlaskit/tmp-editor-statsig": "^2.31.0",
45
- "@atlaskit/tokens": "^2.5.0",
44
+ "@atlaskit/tmp-editor-statsig": "^2.34.0",
45
+ "@atlaskit/tokens": "^3.0.0",
46
46
  "@babel/runtime": "^7.0.0",
47
47
  "@emotion/react": "^11.7.1"
48
48
  },