@atlaskit/editor-plugin-synced-block 8.3.14 → 8.4.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.
Files changed (29) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cjs/nodeviews/bodiedSyncedBlock.js +18 -1
  3. package/dist/cjs/nodeviews/syncedBlock.js +7 -2
  4. package/dist/cjs/pm-plugins/main.js +2 -1
  5. package/dist/cjs/ui/BodiedSyncBlockWrapper.js +2 -1
  6. package/dist/cjs/ui/SyncBlockSSRReactContextsProvider.js +35 -0
  7. package/dist/cjs/ui/SyncedLocationDropdown.js +137 -35
  8. package/dist/cjs/ui/floating-toolbar.js +3 -2
  9. package/dist/es2019/nodeviews/bodiedSyncedBlock.js +18 -1
  10. package/dist/es2019/nodeviews/syncedBlock.js +7 -2
  11. package/dist/es2019/pm-plugins/main.js +2 -1
  12. package/dist/es2019/ui/BodiedSyncBlockWrapper.js +2 -1
  13. package/dist/es2019/ui/SyncBlockSSRReactContextsProvider.js +29 -0
  14. package/dist/es2019/ui/SyncedLocationDropdown.js +109 -10
  15. package/dist/es2019/ui/floating-toolbar.js +3 -2
  16. package/dist/esm/nodeviews/bodiedSyncedBlock.js +18 -1
  17. package/dist/esm/nodeviews/syncedBlock.js +7 -2
  18. package/dist/esm/pm-plugins/main.js +2 -1
  19. package/dist/esm/ui/BodiedSyncBlockWrapper.js +2 -1
  20. package/dist/esm/ui/SyncBlockSSRReactContextsProvider.js +28 -0
  21. package/dist/esm/ui/SyncedLocationDropdown.js +138 -36
  22. package/dist/esm/ui/floating-toolbar.js +3 -2
  23. package/dist/types/nodeviews/syncedBlock.d.ts +3 -0
  24. package/dist/types/ui/SyncBlockSSRReactContextsProvider.d.ts +19 -0
  25. package/dist/types/ui/SyncedLocationDropdown.d.ts +3 -2
  26. package/dist/types-ts4.5/nodeviews/syncedBlock.d.ts +3 -0
  27. package/dist/types-ts4.5/ui/SyncBlockSSRReactContextsProvider.d.ts +19 -0
  28. package/dist/types-ts4.5/ui/SyncedLocationDropdown.d.ts +3 -2
  29. package/package.json +11 -7
@@ -1,9 +1,10 @@
1
1
  import type { IntlShape } from 'react-intl';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
+ import type { ExtractInjectionAPI, FloatingToolbarCustomRenderContext } from '@atlaskit/editor-common/types';
3
3
  import type { SyncBlockSourceInfo, SyncBlockStoreManager, ReferencesSourceInfo } from '@atlaskit/editor-synced-block-provider';
4
4
  import type { SyncedBlockPlugin } from '../syncedBlockPluginType';
5
5
  interface Props {
6
6
  api?: ExtractInjectionAPI<SyncedBlockPlugin>;
7
+ floatingToolbarRenderContext?: FloatingToolbarCustomRenderContext;
7
8
  intl: IntlShape;
8
9
  isSource: boolean;
9
10
  localId: string;
@@ -11,5 +12,5 @@ interface Props {
11
12
  syncBlockStore: SyncBlockStoreManager;
12
13
  }
13
14
  export declare const processReferenceData: (referenceData: ReferencesSourceInfo["references"], intl: IntlShape) => SyncBlockSourceInfo[];
14
- export declare const SyncedLocationDropdown: ({ syncBlockStore, resourceId, intl, isSource, localId, api, }: Props) => JSX.Element;
15
+ export declare const SyncedLocationDropdown: ({ syncBlockStore, resourceId, intl, isSource, localId, api, floatingToolbarRenderContext, }: Props) => JSX.Element;
15
16
  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';
@@ -13,6 +14,7 @@ export interface SyncBlockNodeViewProps extends ReactComponentProps {
13
14
  api?: ExtractInjectionAPI<SyncedBlockPlugin>;
14
15
  eventDispatcher: EventDispatcher;
15
16
  getPos: getPosHandlerNode;
17
+ intl?: IntlShape;
16
18
  isNodeNested?: boolean;
17
19
  node: PMNode;
18
20
  options: SyncedBlockPluginOptions | undefined;
@@ -24,6 +26,7 @@ export declare class SyncBlock extends ReactNodeView<SyncBlockNodeViewProps> {
24
26
  private options;
25
27
  private api?;
26
28
  private syncBlockStore?;
29
+ private intl?;
27
30
  constructor(props: SyncBlockNodeViewProps);
28
31
  private removeSyncBlockStable;
29
32
  private fetchSyncBlockSourceInfoStable;
@@ -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 syncBlock nodeview children with the editor's actual IntlProvider during
9
+ * SSR streaming (renderToStaticMarkup). This ensures that components using
10
+ * useIntl() — such as SyncBlockLabel, SyncedBlockLoadingState, and
11
+ * ReactRenderer's table/code-block node renderers — have a valid intl context
12
+ * and do not throw during the static render pass.
13
+ *
14
+ * Outside of SSR streaming this is a no-op passthrough.
15
+ *
16
+ * Follows the same pattern as MediaSSRReactContextsProvider.
17
+ */
18
+ export declare function SyncBlockSSRReactContextsProvider({ children, intl }: Props): ReactNode;
19
+ export {};
@@ -1,9 +1,10 @@
1
1
  import type { IntlShape } from 'react-intl';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
+ import type { ExtractInjectionAPI, FloatingToolbarCustomRenderContext } from '@atlaskit/editor-common/types';
3
3
  import type { SyncBlockSourceInfo, SyncBlockStoreManager, ReferencesSourceInfo } from '@atlaskit/editor-synced-block-provider';
4
4
  import type { SyncedBlockPlugin } from '../syncedBlockPluginType';
5
5
  interface Props {
6
6
  api?: ExtractInjectionAPI<SyncedBlockPlugin>;
7
+ floatingToolbarRenderContext?: FloatingToolbarCustomRenderContext;
7
8
  intl: IntlShape;
8
9
  isSource: boolean;
9
10
  localId: string;
@@ -11,5 +12,5 @@ interface Props {
11
12
  syncBlockStore: SyncBlockStoreManager;
12
13
  }
13
14
  export declare const processReferenceData: (referenceData: ReferencesSourceInfo["references"], intl: IntlShape) => SyncBlockSourceInfo[];
14
- export declare const SyncedLocationDropdown: ({ syncBlockStore, resourceId, intl, isSource, localId, api, }: Props) => JSX.Element;
15
+ export declare const SyncedLocationDropdown: ({ syncBlockStore, resourceId, intl, isSource, localId, api, floatingToolbarRenderContext, }: Props) => JSX.Element;
15
16
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-synced-block",
3
- "version": "8.3.14",
3
+ "version": "8.4.0",
4
4
  "description": "SyncedBlock plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,22 +29,22 @@
29
29
  "atlaskit:src": "src/index.ts",
30
30
  "dependencies": {
31
31
  "@atlaskit/adf-schema": "^52.13.0",
32
- "@atlaskit/button": "23.11.6",
33
- "@atlaskit/dropdown-menu": "16.9.1",
32
+ "@atlaskit/button": "23.11.7",
33
+ "@atlaskit/dropdown-menu": "16.9.2",
34
34
  "@atlaskit/editor-json-transformer": "^8.32.0",
35
35
  "@atlaskit/editor-plugin-analytics": "^10.1.0",
36
36
  "@atlaskit/editor-plugin-block-menu": "^9.2.0",
37
37
  "@atlaskit/editor-plugin-connectivity": "10.1.0",
38
38
  "@atlaskit/editor-plugin-content-format": "^4.1.0",
39
39
  "@atlaskit/editor-plugin-decorations": "^10.1.0",
40
- "@atlaskit/editor-plugin-floating-toolbar": "^12.1.0",
40
+ "@atlaskit/editor-plugin-floating-toolbar": "^12.2.0",
41
41
  "@atlaskit/editor-plugin-focus": "^9.1.0",
42
42
  "@atlaskit/editor-plugin-selection": "^10.1.0",
43
43
  "@atlaskit/editor-plugin-user-intent": "^8.2.0",
44
44
  "@atlaskit/editor-prosemirror": "^7.3.0",
45
45
  "@atlaskit/editor-shared-styles": "^3.11.0",
46
46
  "@atlaskit/editor-synced-block-provider": "^6.6.0",
47
- "@atlaskit/editor-toolbar": "^1.6.0",
47
+ "@atlaskit/editor-toolbar": "^1.7.0",
48
48
  "@atlaskit/flag": "^17.12.0",
49
49
  "@atlaskit/icon": "35.0.0",
50
50
  "@atlaskit/icon-lab": "^6.9.0",
@@ -54,7 +54,7 @@
54
54
  "@atlaskit/platform-feature-flags": "^1.1.0",
55
55
  "@atlaskit/primitives": "^19.0.0",
56
56
  "@atlaskit/spinner": "19.1.2",
57
- "@atlaskit/tmp-editor-statsig": "^82.0.0",
57
+ "@atlaskit/tmp-editor-statsig": "^82.4.0",
58
58
  "@atlaskit/tokens": "13.0.4",
59
59
  "@atlaskit/tooltip": "^22.2.0",
60
60
  "@atlaskit/visually-hidden": "^3.1.0",
@@ -64,11 +64,12 @@
64
64
  "date-fns": "^2.17.0"
65
65
  },
66
66
  "peerDependencies": {
67
- "@atlaskit/editor-common": "^114.36.0",
67
+ "@atlaskit/editor-common": "^114.42.0",
68
68
  "react": "^18.2.0",
69
69
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
70
70
  },
71
71
  "devDependencies": {
72
+ "react": "^18.2.0",
72
73
  "react-intl": "^6.6.2",
73
74
  "typescript": "5.9.2"
74
75
  },
@@ -114,6 +115,9 @@
114
115
  },
115
116
  "platform_synced_block_patch_12": {
116
117
  "type": "boolean"
118
+ },
119
+ "platform_synced_block_patch_13": {
120
+ "type": "boolean"
117
121
  }
118
122
  }
119
123
  }