@atlaskit/editor-plugin-synced-block 4.5.1 → 4.5.2

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,13 @@
1
1
  # @atlaskit/editor-plugin-synced-block
2
2
 
3
+ ## 4.5.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f14e76661c943`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f14e76661c943) -
8
+ [EDITOR-2844] Save reference synced block on document to BE when a page is saved
9
+ - Updated dependencies
10
+
3
11
  ## 4.5.1
4
12
 
5
13
  ### Patch Changes
@@ -23,6 +23,9 @@
23
23
  "../src/**/stories/**/*"
24
24
  ],
25
25
  "references": [
26
+ {
27
+ "path": "../../adf-schema/afm-cc/tsconfig.json"
28
+ },
26
29
  {
27
30
  "path": "../../../design-system/button/afm-cc/tsconfig.json"
28
31
  },
@@ -47,6 +50,9 @@
47
50
  {
48
51
  "path": "../../editor-plugin-selection/afm-cc/tsconfig.json"
49
52
  },
53
+ {
54
+ "path": "../../editor-prosemirror/afm-cc/tsconfig.json"
55
+ },
50
56
  {
51
57
  "path": "../../editor-shared-styles/afm-cc/tsconfig.json"
52
58
  },
@@ -23,6 +23,9 @@
23
23
  "../src/**/stories/**/*"
24
24
  ],
25
25
  "references": [
26
+ {
27
+ "path": "../../adf-schema/afm-jira/tsconfig.json"
28
+ },
26
29
  {
27
30
  "path": "../../../design-system/button/afm-jira/tsconfig.json"
28
31
  },
@@ -47,6 +50,9 @@
47
50
  {
48
51
  "path": "../../editor-plugin-selection/afm-jira/tsconfig.json"
49
52
  },
53
+ {
54
+ "path": "../../editor-prosemirror/afm-jira/tsconfig.json"
55
+ },
50
56
  {
51
57
  "path": "../../editor-shared-styles/afm-jira/tsconfig.json"
52
58
  },
@@ -80,6 +86,9 @@
80
86
  {
81
87
  "path": "../../../design-system/primitives/afm-jira/tsconfig.json"
82
88
  },
89
+ {
90
+ "path": "../../tmp-editor-statsig/afm-jira/tsconfig.json"
91
+ },
83
92
  {
84
93
  "path": "../../../design-system/tokens/afm-jira/tsconfig.json"
85
94
  },
@@ -23,6 +23,9 @@
23
23
  "../src/**/stories/**/*"
24
24
  ],
25
25
  "references": [
26
+ {
27
+ "path": "../../adf-schema/afm-products/tsconfig.json"
28
+ },
26
29
  {
27
30
  "path": "../../../design-system/button/afm-products/tsconfig.json"
28
31
  },
@@ -47,6 +50,9 @@
47
50
  {
48
51
  "path": "../../editor-plugin-selection/afm-products/tsconfig.json"
49
52
  },
53
+ {
54
+ "path": "../../editor-prosemirror/afm-products/tsconfig.json"
55
+ },
50
56
  {
51
57
  "path": "../../editor-shared-styles/afm-products/tsconfig.json"
52
58
  },
@@ -80,6 +86,9 @@
80
86
  {
81
87
  "path": "../../../design-system/primitives/afm-products/tsconfig.json"
82
88
  },
89
+ {
90
+ "path": "../../tmp-editor-statsig/afm-products/tsconfig.json"
91
+ },
83
92
  {
84
93
  "path": "../../../design-system/tokens/afm-products/tsconfig.json"
85
94
  },
@@ -3,7 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.flushBodiedSyncBlocks = void 0;
6
+ exports.flushSyncBlocks = exports.flushBodiedSyncBlocks = void 0;
7
7
  var flushBodiedSyncBlocks = exports.flushBodiedSyncBlocks = function flushBodiedSyncBlocks(syncBlockStore) {
8
8
  return syncBlockStore.sourceManager.flush();
9
+ };
10
+ var flushSyncBlocks = exports.flushSyncBlocks = function flushSyncBlocks(syncBlockStore) {
11
+ return syncBlockStore.referenceManager.flush();
9
12
  };
@@ -63,6 +63,9 @@ var syncedBlockPlugin = exports.syncedBlockPlugin = function syncedBlockPlugin(_
63
63
  actions: {
64
64
  flushBodiedSyncBlocks: function flushBodiedSyncBlocks() {
65
65
  return (0, _editorActions.flushBodiedSyncBlocks)(syncBlockStore);
66
+ },
67
+ flushSyncedBlocks: function flushSyncedBlocks() {
68
+ return (0, _editorActions.flushSyncBlocks)(syncBlockStore);
66
69
  }
67
70
  },
68
71
  pluginsOptions: {
@@ -1,3 +1,6 @@
1
1
  export const flushBodiedSyncBlocks = syncBlockStore => {
2
2
  return syncBlockStore.sourceManager.flush();
3
+ };
4
+ export const flushSyncBlocks = syncBlockStore => {
5
+ return syncBlockStore.referenceManager.flush();
3
6
  };
@@ -4,7 +4,7 @@ import { blockTypeMessages } from '@atlaskit/editor-common/messages';
4
4
  import { IconSyncBlock } from '@atlaskit/editor-common/quick-insert';
5
5
  import { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
6
6
  import Lozenge from '@atlaskit/lozenge';
7
- import { flushBodiedSyncBlocks } from './editor-actions';
7
+ import { flushBodiedSyncBlocks, flushSyncBlocks } from './editor-actions';
8
8
  import { copySyncedBlockReferenceToClipboardEditorCommand, createSyncedBlock } from './editor-commands';
9
9
  import { createPlugin, syncedBlockPluginKey } from './pm-plugins/main';
10
10
  import { getBlockMenuComponents } from './ui/block-menu-components';
@@ -50,6 +50,9 @@ export const syncedBlockPlugin = ({
50
50
  actions: {
51
51
  flushBodiedSyncBlocks: () => {
52
52
  return flushBodiedSyncBlocks(syncBlockStore);
53
+ },
54
+ flushSyncedBlocks: () => {
55
+ return flushSyncBlocks(syncBlockStore);
53
56
  }
54
57
  },
55
58
  pluginsOptions: {
@@ -1,3 +1,6 @@
1
1
  export var flushBodiedSyncBlocks = function flushBodiedSyncBlocks(syncBlockStore) {
2
2
  return syncBlockStore.sourceManager.flush();
3
+ };
4
+ export var flushSyncBlocks = function flushSyncBlocks(syncBlockStore) {
5
+ return syncBlockStore.referenceManager.flush();
3
6
  };
@@ -4,7 +4,7 @@ import { blockTypeMessages } from '@atlaskit/editor-common/messages';
4
4
  import { IconSyncBlock } from '@atlaskit/editor-common/quick-insert';
5
5
  import { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
6
6
  import Lozenge from '@atlaskit/lozenge';
7
- import { flushBodiedSyncBlocks as _flushBodiedSyncBlocks } from './editor-actions';
7
+ import { flushBodiedSyncBlocks as _flushBodiedSyncBlocks, flushSyncBlocks } from './editor-actions';
8
8
  import { copySyncedBlockReferenceToClipboardEditorCommand, createSyncedBlock } from './editor-commands';
9
9
  import { createPlugin, syncedBlockPluginKey } from './pm-plugins/main';
10
10
  import { getBlockMenuComponents } from './ui/block-menu-components';
@@ -56,6 +56,9 @@ export var syncedBlockPlugin = function syncedBlockPlugin(_ref) {
56
56
  actions: {
57
57
  flushBodiedSyncBlocks: function flushBodiedSyncBlocks() {
58
58
  return _flushBodiedSyncBlocks(syncBlockStore);
59
+ },
60
+ flushSyncedBlocks: function flushSyncedBlocks() {
61
+ return flushSyncBlocks(syncBlockStore);
59
62
  }
60
63
  },
61
64
  pluginsOptions: {
@@ -1,2 +1,3 @@
1
1
  import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
2
2
  export declare const flushBodiedSyncBlocks: (syncBlockStore: SyncBlockStoreManager) => Promise<boolean>;
3
+ export declare const flushSyncBlocks: (syncBlockStore: SyncBlockStoreManager) => Promise<boolean>;
@@ -53,6 +53,14 @@ export type SyncedBlockPlugin = NextEditorPlugin<'syncedBlock', {
53
53
  * @returns true if saving all nodes successfully, false if fail to save some/all nodes
54
54
  */
55
55
  flushBodiedSyncBlocks: () => Promise<boolean>;
56
+ /**
57
+ * Save reference synced blocks on the document (tracked by local cache)to the backend.
58
+ * This action allows syncBlock on the document to be saved in sync with product saving experience
59
+ * as per {@link https://hello.atlassian.net/wiki/spaces/egcuc/pages/5932393240/Synced+Blocks+Save+refresh+principles}
60
+ *
61
+ * @returns true if flushing all syncBlocks successfully, false otherwise
62
+ */
63
+ flushSyncedBlocks: () => Promise<boolean>;
56
64
  };
57
65
  commands: {
58
66
  copySyncedBlockReferenceToClipboard: () => EditorCommand;
@@ -1,2 +1,3 @@
1
1
  import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
2
2
  export declare const flushBodiedSyncBlocks: (syncBlockStore: SyncBlockStoreManager) => Promise<boolean>;
3
+ export declare const flushSyncBlocks: (syncBlockStore: SyncBlockStoreManager) => Promise<boolean>;
@@ -53,6 +53,14 @@ export type SyncedBlockPlugin = NextEditorPlugin<'syncedBlock', {
53
53
  * @returns true if saving all nodes successfully, false if fail to save some/all nodes
54
54
  */
55
55
  flushBodiedSyncBlocks: () => Promise<boolean>;
56
+ /**
57
+ * Save reference synced blocks on the document (tracked by local cache)to the backend.
58
+ * This action allows syncBlock on the document to be saved in sync with product saving experience
59
+ * as per {@link https://hello.atlassian.net/wiki/spaces/egcuc/pages/5932393240/Synced+Blocks+Save+refresh+principles}
60
+ *
61
+ * @returns true if flushing all syncBlocks successfully, false otherwise
62
+ */
63
+ flushSyncedBlocks: () => Promise<boolean>;
56
64
  };
57
65
  commands: {
58
66
  copySyncedBlockReferenceToClipboard: () => EditorCommand;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-synced-block",
3
- "version": "4.5.1",
3
+ "version": "4.5.2",
4
4
  "description": "SyncedBlock plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -28,7 +28,7 @@
28
28
  "sideEffects": false,
29
29
  "atlaskit:src": "src/index.ts",
30
30
  "dependencies": {
31
- "@atlaskit/adf-schema": "^51.5.1",
31
+ "@atlaskit/adf-schema": "^51.5.0",
32
32
  "@atlaskit/button": "23.7.0",
33
33
  "@atlaskit/editor-json-transformer": "^8.31.0",
34
34
  "@atlaskit/editor-plugin-analytics": "^6.2.0",
@@ -37,7 +37,7 @@
37
37
  "@atlaskit/editor-plugin-decorations": "^6.1.0",
38
38
  "@atlaskit/editor-plugin-floating-toolbar": "^8.2.0",
39
39
  "@atlaskit/editor-plugin-selection": "^6.1.0",
40
- "@atlaskit/editor-prosemirror": "7.0.0",
40
+ "@atlaskit/editor-prosemirror": "^7.2.0",
41
41
  "@atlaskit/editor-shared-styles": "^3.10.0",
42
42
  "@atlaskit/editor-synced-block-provider": "^2.15.0",
43
43
  "@atlaskit/editor-tables": "^2.9.0",