@atlaskit/editor-plugin-layout 11.0.2 → 11.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/layoutPlugin.js +18 -16
  3. package/dist/cjs/nodeviews/index.js +49 -1
  4. package/dist/cjs/pm-plugins/column-resize-divider.js +25 -7
  5. package/dist/cjs/pm-plugins/main.js +2 -2
  6. package/dist/cjs/pm-plugins/resizing.js +29 -4
  7. package/dist/cjs/ui/LayoutSSRReactContextsProvider.js +34 -0
  8. package/dist/es2019/layoutPlugin.js +20 -16
  9. package/dist/es2019/nodeviews/index.js +49 -1
  10. package/dist/es2019/pm-plugins/column-resize-divider.js +25 -7
  11. package/dist/es2019/pm-plugins/main.js +2 -2
  12. package/dist/es2019/pm-plugins/resizing.js +37 -7
  13. package/dist/es2019/ui/LayoutSSRReactContextsProvider.js +28 -0
  14. package/dist/esm/layoutPlugin.js +18 -16
  15. package/dist/esm/nodeviews/index.js +49 -1
  16. package/dist/esm/pm-plugins/column-resize-divider.js +25 -7
  17. package/dist/esm/pm-plugins/main.js +2 -2
  18. package/dist/esm/pm-plugins/resizing.js +29 -4
  19. package/dist/esm/ui/LayoutSSRReactContextsProvider.js +27 -0
  20. package/dist/types/nodeviews/index.d.ts +5 -0
  21. package/dist/types/pm-plugins/column-resize-divider.d.ts +2 -1
  22. package/dist/types/pm-plugins/main.d.ts +2 -1
  23. package/dist/types/pm-plugins/resizing.d.ts +2 -1
  24. package/dist/types/ui/LayoutSSRReactContextsProvider.d.ts +19 -0
  25. package/dist/types-ts4.5/nodeviews/index.d.ts +5 -0
  26. package/dist/types-ts4.5/pm-plugins/column-resize-divider.d.ts +2 -1
  27. package/dist/types-ts4.5/pm-plugins/main.d.ts +2 -1
  28. package/dist/types-ts4.5/pm-plugins/resizing.d.ts +2 -1
  29. package/dist/types-ts4.5/ui/LayoutSSRReactContextsProvider.d.ts +19 -0
  30. package/package.json +7 -4
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { IntlShape } from 'react-intl';
2
3
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
3
4
  import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
4
5
  import ReactNodeView from '@atlaskit/editor-common/react-node-view';
@@ -10,6 +11,7 @@ import type { LayoutPluginOptions } from '../types';
10
11
  type LayoutSectionViewProps = {
11
12
  eventDispatcher: EventDispatcher;
12
13
  getPos: getPosHandlerNode;
14
+ intl?: IntlShape;
13
15
  node: PMNode;
14
16
  options: LayoutPluginOptions;
15
17
  pluginInjectionApi?: ExtractInjectionAPI<LayoutPlugin>;
@@ -24,6 +26,7 @@ export declare class LayoutSectionView extends ReactNodeView<LayoutSectionViewPr
24
26
  options: LayoutPluginOptions;
25
27
  layoutDOM?: HTMLElement;
26
28
  isEmpty?: boolean;
29
+ private intl?;
27
30
  /**
28
31
  * constructor
29
32
  * @param props
@@ -34,11 +37,13 @@ export declare class LayoutSectionView extends ReactNodeView<LayoutSectionViewPr
34
37
  * @param props.eventDispatcher
35
38
  * @param props.pluginInjectionApi
36
39
  * @param props.options
40
+ * @param props.intl
37
41
  * @example
38
42
  */
39
43
  constructor(props: {
40
44
  eventDispatcher: EventDispatcher;
41
45
  getPos: getPosHandlerNode;
46
+ intl?: IntlShape;
42
47
  node: PMNode;
43
48
  options: LayoutPluginOptions;
44
49
  pluginInjectionApi: ExtractInjectionAPI<LayoutPlugin>;
@@ -1,3 +1,4 @@
1
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
1
2
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
3
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
3
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
@@ -5,4 +6,4 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
6
  * Returns ProseMirror Decoration widgets for column dividers between layout columns.
6
7
  * Each divider supports drag-to-resize interaction for the adjacent columns.
7
8
  */
8
- export declare const getColumnDividerDecorations: (state: EditorState, view?: EditorView) => Decoration[];
9
+ export declare const getColumnDividerDecorations: (state: EditorState, view?: EditorView, editorAnalyticsAPI?: EditorAnalyticsAPI) => Decoration[];
@@ -1,6 +1,7 @@
1
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
1
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
3
  import type { LayoutPluginOptions } from '../types';
3
4
  import type { LayoutState } from './types';
4
5
  export declare const DEFAULT_LAYOUT = "two_equal";
5
- declare const _default: (options: LayoutPluginOptions) => SafePlugin<LayoutState>;
6
+ declare const _default: (options: LayoutPluginOptions, editorAnalyticsAPI?: EditorAnalyticsAPI) => SafePlugin<LayoutState>;
6
7
  export default _default;
@@ -1,3 +1,4 @@
1
+ import type { IntlShape } from 'react-intl';
1
2
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
2
3
  import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
3
4
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
@@ -6,5 +7,5 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
6
7
  import type { LayoutPlugin } from '../layoutPluginType';
7
8
  import type { LayoutPluginOptions } from '../types';
8
9
  export declare const pluginKey: PluginKey;
9
- declare const _default: (options: LayoutPluginOptions, pluginInjectionApi: ExtractInjectionAPI<LayoutPlugin>, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher) => SafePlugin<undefined>;
10
+ declare const _default: (options: LayoutPluginOptions, pluginInjectionApi: ExtractInjectionAPI<LayoutPlugin>, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, intl?: IntlShape) => SafePlugin<undefined>;
10
11
  export default _default;
@@ -0,0 +1,19 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type IntlShape } from 'react-intl';
3
+ interface Props {
4
+ children: ReactNode;
5
+ intl: IntlShape | undefined;
6
+ }
7
+ /**
8
+ * Wraps the layout section nodeview children with the editor's actual
9
+ * IntlProvider during SSR streaming (renderToStaticMarkup). This ensures any
10
+ * descendants that call `useIntl()` (e.g. `BreakoutResizer`'s ARIA labels)
11
+ * have a valid intl context and do not throw during the static render pass.
12
+ *
13
+ * Outside of SSR streaming this is a no-op passthrough.
14
+ *
15
+ * Follows the same pattern as `MediaSSRReactContextsProvider` and
16
+ * `SyncBlockSSRReactContextsProvider`.
17
+ */
18
+ export declare function LayoutSSRReactContextsProvider({ children, intl }: Props): ReactNode;
19
+ export {};
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { IntlShape } from 'react-intl';
2
3
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
3
4
  import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
4
5
  import ReactNodeView from '@atlaskit/editor-common/react-node-view';
@@ -10,6 +11,7 @@ import type { LayoutPluginOptions } from '../types';
10
11
  type LayoutSectionViewProps = {
11
12
  eventDispatcher: EventDispatcher;
12
13
  getPos: getPosHandlerNode;
14
+ intl?: IntlShape;
13
15
  node: PMNode;
14
16
  options: LayoutPluginOptions;
15
17
  pluginInjectionApi?: ExtractInjectionAPI<LayoutPlugin>;
@@ -24,6 +26,7 @@ export declare class LayoutSectionView extends ReactNodeView<LayoutSectionViewPr
24
26
  options: LayoutPluginOptions;
25
27
  layoutDOM?: HTMLElement;
26
28
  isEmpty?: boolean;
29
+ private intl?;
27
30
  /**
28
31
  * constructor
29
32
  * @param props
@@ -34,11 +37,13 @@ export declare class LayoutSectionView extends ReactNodeView<LayoutSectionViewPr
34
37
  * @param props.eventDispatcher
35
38
  * @param props.pluginInjectionApi
36
39
  * @param props.options
40
+ * @param props.intl
37
41
  * @example
38
42
  */
39
43
  constructor(props: {
40
44
  eventDispatcher: EventDispatcher;
41
45
  getPos: getPosHandlerNode;
46
+ intl?: IntlShape;
42
47
  node: PMNode;
43
48
  options: LayoutPluginOptions;
44
49
  pluginInjectionApi: ExtractInjectionAPI<LayoutPlugin>;
@@ -1,3 +1,4 @@
1
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
1
2
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
3
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
3
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
@@ -5,4 +6,4 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
6
  * Returns ProseMirror Decoration widgets for column dividers between layout columns.
6
7
  * Each divider supports drag-to-resize interaction for the adjacent columns.
7
8
  */
8
- export declare const getColumnDividerDecorations: (state: EditorState, view?: EditorView) => Decoration[];
9
+ export declare const getColumnDividerDecorations: (state: EditorState, view?: EditorView, editorAnalyticsAPI?: EditorAnalyticsAPI) => Decoration[];
@@ -1,6 +1,7 @@
1
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
1
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
3
  import type { LayoutPluginOptions } from '../types';
3
4
  import type { LayoutState } from './types';
4
5
  export declare const DEFAULT_LAYOUT = "two_equal";
5
- declare const _default: (options: LayoutPluginOptions) => SafePlugin<LayoutState>;
6
+ declare const _default: (options: LayoutPluginOptions, editorAnalyticsAPI?: EditorAnalyticsAPI) => SafePlugin<LayoutState>;
6
7
  export default _default;
@@ -1,3 +1,4 @@
1
+ import type { IntlShape } from 'react-intl';
1
2
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
2
3
  import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
3
4
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
@@ -6,5 +7,5 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
6
7
  import type { LayoutPlugin } from '../layoutPluginType';
7
8
  import type { LayoutPluginOptions } from '../types';
8
9
  export declare const pluginKey: PluginKey;
9
- declare const _default: (options: LayoutPluginOptions, pluginInjectionApi: ExtractInjectionAPI<LayoutPlugin>, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher) => SafePlugin<undefined>;
10
+ declare const _default: (options: LayoutPluginOptions, pluginInjectionApi: ExtractInjectionAPI<LayoutPlugin>, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, intl?: IntlShape) => SafePlugin<undefined>;
10
11
  export default _default;
@@ -0,0 +1,19 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type IntlShape } from 'react-intl';
3
+ interface Props {
4
+ children: ReactNode;
5
+ intl: IntlShape | undefined;
6
+ }
7
+ /**
8
+ * Wraps the layout section nodeview children with the editor's actual
9
+ * IntlProvider during SSR streaming (renderToStaticMarkup). This ensures any
10
+ * descendants that call `useIntl()` (e.g. `BreakoutResizer`'s ARIA labels)
11
+ * have a valid intl context and do not throw during the static render pass.
12
+ *
13
+ * Outside of SSR streaming this is a no-op passthrough.
14
+ *
15
+ * Follows the same pattern as `MediaSSRReactContextsProvider` and
16
+ * `SyncBlockSSRReactContextsProvider`.
17
+ */
18
+ export declare function LayoutSSRReactContextsProvider({ children, intl }: Props): ReactNode;
19
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-layout",
3
- "version": "11.0.2",
3
+ "version": "11.0.4",
4
4
  "description": "Layout plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -50,14 +50,14 @@
50
50
  "@atlaskit/icon": "^35.4.0",
51
51
  "@atlaskit/icon-lab": "^6.13.0",
52
52
  "@atlaskit/platform-feature-flags": "^1.1.0",
53
- "@atlaskit/tmp-editor-statsig": "^89.0.0",
54
- "@atlaskit/tokens": "^13.1.0",
53
+ "@atlaskit/tmp-editor-statsig": "^89.4.0",
54
+ "@atlaskit/tokens": "^13.3.0",
55
55
  "@babel/runtime": "^7.0.0",
56
56
  "@emotion/react": "^11.7.1",
57
57
  "bind-event-listener": "^3.0.0"
58
58
  },
59
59
  "peerDependencies": {
60
- "@atlaskit/editor-common": "^115.2.0",
60
+ "@atlaskit/editor-common": "^115.6.0",
61
61
  "react": "^18.2.0",
62
62
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
63
63
  },
@@ -114,6 +114,9 @@
114
114
  },
115
115
  "platform_editor_block_menu_v2_patch_3": {
116
116
  "type": "boolean"
117
+ },
118
+ "platform_editor_layout_resize_analytics": {
119
+ "type": "boolean"
117
120
  }
118
121
  },
119
122
  "devDependencies": {