@atlaskit/editor-synced-block-provider 0.9.0 → 1.0.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,12 @@
1
1
  # @atlaskit/editor-synced-block-provider
2
2
 
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`10882b2fab738`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/10882b2fab738) -
8
+ [ux] Introduced bodiedSyncBlock nodeview
9
+
3
10
  ## 0.9.0
4
11
 
5
12
  ### Minor Changes
@@ -65,7 +65,7 @@ var SyncBlockProvider = exports.SyncBlockProvider = /*#__PURE__*/function (_Sync
65
65
  value: function writeNodesData(nodes, data) {
66
66
  var _this3 = this;
67
67
  var resourceIds = [];
68
- nodes.forEach(function (node, index) {
68
+ nodes.forEach(function (_node, index) {
69
69
  if (!data[index].content) {
70
70
  resourceIds.push(Promise.reject('No Synced Blockcontent to write'));
71
71
  return;
@@ -148,7 +148,7 @@ var useHandleContentChanges = exports.useHandleContentChanges = function useHand
148
148
  }
149
149
  var syncBlockNode = (0, _utils.convertSyncBlockPMNodeToSyncBlockData)(node, false);
150
150
  var data = {
151
- content: updatedDoc.toJSON(),
151
+ content: updatedDoc,
152
152
  resourceId: node.attrs.resourceId,
153
153
  localId: node.attrs.localId
154
154
  };
@@ -87,21 +87,11 @@ var SyncBlockStoreManager = exports.SyncBlockStoreManager = /*#__PURE__*/functio
87
87
  value: function setEditorView(editorView) {
88
88
  this.editorView = editorView;
89
89
  }
90
- }, {
91
- key: "setSyncBlockNestedEditorView",
92
- value: function setSyncBlockNestedEditorView(editorView) {
93
- this.syncBlockNestedEditorView = editorView;
94
- }
95
- }, {
96
- key: "getSyncBlockNestedEditorView",
97
- value: function getSyncBlockNestedEditorView() {
98
- return this.syncBlockNestedEditorView;
99
- }
100
90
  }, {
101
91
  key: "isSourceBlock",
102
92
  value: function isSourceBlock(node) {
103
93
  var _this$dataProvider;
104
- if (node.type.name !== 'syncBlock') {
94
+ if (node.type.name !== 'bodiedSyncBlock') {
105
95
  return false;
106
96
  }
107
97
  var _node$attrs2 = node.attrs,
@@ -32,7 +32,7 @@ export class SyncBlockProvider extends SyncBlockDataProvider {
32
32
  */
33
33
  writeNodesData(nodes, data) {
34
34
  const resourceIds = [];
35
- nodes.forEach((node, index) => {
35
+ nodes.forEach((_node, index) => {
36
36
  if (!data[index].content) {
37
37
  resourceIds.push(Promise.reject('No Synced Blockcontent to write'));
38
38
  return;
@@ -110,7 +110,7 @@ export const useHandleContentChanges = (updatedDoc, isSource, node, provider) =>
110
110
  }
111
111
  const syncBlockNode = convertSyncBlockPMNodeToSyncBlockData(node, false);
112
112
  const data = {
113
- content: updatedDoc.toJSON(),
113
+ content: updatedDoc,
114
114
  resourceId: node.attrs.resourceId,
115
115
  localId: node.attrs.localId
116
116
  };
@@ -71,15 +71,9 @@ export class SyncBlockStoreManager {
71
71
  setEditorView(editorView) {
72
72
  this.editorView = editorView;
73
73
  }
74
- setSyncBlockNestedEditorView(editorView) {
75
- this.syncBlockNestedEditorView = editorView;
76
- }
77
- getSyncBlockNestedEditorView() {
78
- return this.syncBlockNestedEditorView;
79
- }
80
74
  isSourceBlock(node) {
81
75
  var _this$dataProvider;
82
- if (node.type.name !== 'syncBlock') {
76
+ if (node.type.name !== 'bodiedSyncBlock') {
83
77
  return false;
84
78
  }
85
79
  const {
@@ -58,7 +58,7 @@ export var SyncBlockProvider = /*#__PURE__*/function (_SyncBlockDataProvide) {
58
58
  value: function writeNodesData(nodes, data) {
59
59
  var _this3 = this;
60
60
  var resourceIds = [];
61
- nodes.forEach(function (node, index) {
61
+ nodes.forEach(function (_node, index) {
62
62
  if (!data[index].content) {
63
63
  resourceIds.push(Promise.reject('No Synced Blockcontent to write'));
64
64
  return;
@@ -141,7 +141,7 @@ export var useHandleContentChanges = function useHandleContentChanges(updatedDoc
141
141
  }
142
142
  var syncBlockNode = convertSyncBlockPMNodeToSyncBlockData(node, false);
143
143
  var data = {
144
- content: updatedDoc.toJSON(),
144
+ content: updatedDoc,
145
145
  resourceId: node.attrs.resourceId,
146
146
  localId: node.attrs.localId
147
147
  };
@@ -82,21 +82,11 @@ export var SyncBlockStoreManager = /*#__PURE__*/function () {
82
82
  value: function setEditorView(editorView) {
83
83
  this.editorView = editorView;
84
84
  }
85
- }, {
86
- key: "setSyncBlockNestedEditorView",
87
- value: function setSyncBlockNestedEditorView(editorView) {
88
- this.syncBlockNestedEditorView = editorView;
89
- }
90
- }, {
91
- key: "getSyncBlockNestedEditorView",
92
- value: function getSyncBlockNestedEditorView() {
93
- return this.syncBlockNestedEditorView;
94
- }
95
85
  }, {
96
86
  key: "isSourceBlock",
97
87
  value: function isSourceBlock(node) {
98
88
  var _this$dataProvider;
99
- if (node.type.name !== 'syncBlock') {
89
+ if (node.type.name !== 'bodiedSyncBlock') {
100
90
  return false;
101
91
  }
102
92
  var _node$attrs2 = node.attrs,
@@ -1,4 +1,5 @@
1
1
  import type { DocNode } from '@atlaskit/adf-schema';
2
+ import type { ADFEntity } from '@atlaskit/adf-utils/types';
2
3
  import type { JSONNode } from '@atlaskit/editor-json-transformer/types';
3
4
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
5
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
@@ -25,4 +26,4 @@ export declare class SyncBlockProvider extends SyncBlockDataProvider {
25
26
  }
26
27
  export declare const useFetchDocNode: (editorView: EditorView, node: PMNode, defaultDocNode: DocNode, provider?: SyncBlockDataProvider) => DocNode;
27
28
  export declare const useMemoizedSyncedBlockProvider: (fetchProvider: ADFFetchProvider, writeProvider: ADFWriteProvider, sourceId: string) => SyncBlockProvider;
28
- export declare const useHandleContentChanges: (updatedDoc: PMNode, isSource: boolean, node: PMNode, provider?: SyncBlockDataProvider) => void;
29
+ export declare const useHandleContentChanges: (updatedDoc: ADFEntity | undefined, isSource: boolean, node: PMNode, provider?: SyncBlockDataProvider) => void;
@@ -21,7 +21,6 @@ export declare class SyncBlockStoreManager {
21
21
  private editorView?;
22
22
  private dataProvider?;
23
23
  private confirmationTransaction?;
24
- private syncBlockNestedEditorView?;
25
24
  constructor(dataProvider?: SyncBlockDataProvider);
26
25
  /**
27
26
  * Add/update a sync block node to the store.
@@ -36,8 +35,6 @@ export declare class SyncBlockStoreManager {
36
35
  */
37
36
  getSyncBlockURL(resourceId: ResourceId): string | undefined;
38
37
  setEditorView(editorView: EditorView | undefined): void;
39
- setSyncBlockNestedEditorView(editorView: EditorView | undefined): void;
40
- getSyncBlockNestedEditorView(): EditorView | undefined;
41
38
  isSourceBlock(node: PMNode): boolean;
42
39
  registerConfirmationCallback(callback: ConfirmationCallback): () => void;
43
40
  requireConfirmationBeforeDelete(): boolean;
@@ -1,4 +1,5 @@
1
1
  import type { DocNode } from '@atlaskit/adf-schema';
2
+ import type { ADFEntity } from '@atlaskit/adf-utils/types';
2
3
  import type { JSONNode } from '@atlaskit/editor-json-transformer/types';
3
4
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
5
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
@@ -25,4 +26,4 @@ export declare class SyncBlockProvider extends SyncBlockDataProvider {
25
26
  }
26
27
  export declare const useFetchDocNode: (editorView: EditorView, node: PMNode, defaultDocNode: DocNode, provider?: SyncBlockDataProvider) => DocNode;
27
28
  export declare const useMemoizedSyncedBlockProvider: (fetchProvider: ADFFetchProvider, writeProvider: ADFWriteProvider, sourceId: string) => SyncBlockProvider;
28
- export declare const useHandleContentChanges: (updatedDoc: PMNode, isSource: boolean, node: PMNode, provider?: SyncBlockDataProvider) => void;
29
+ export declare const useHandleContentChanges: (updatedDoc: ADFEntity | undefined, isSource: boolean, node: PMNode, provider?: SyncBlockDataProvider) => void;
@@ -21,7 +21,6 @@ export declare class SyncBlockStoreManager {
21
21
  private editorView?;
22
22
  private dataProvider?;
23
23
  private confirmationTransaction?;
24
- private syncBlockNestedEditorView?;
25
24
  constructor(dataProvider?: SyncBlockDataProvider);
26
25
  /**
27
26
  * Add/update a sync block node to the store.
@@ -36,8 +35,6 @@ export declare class SyncBlockStoreManager {
36
35
  */
37
36
  getSyncBlockURL(resourceId: ResourceId): string | undefined;
38
37
  setEditorView(editorView: EditorView | undefined): void;
39
- setSyncBlockNestedEditorView(editorView: EditorView | undefined): void;
40
- getSyncBlockNestedEditorView(): EditorView | undefined;
41
38
  isSourceBlock(node: PMNode): boolean;
42
39
  registerConfirmationCallback(callback: ConfirmationCallback): () => void;
43
40
  requireConfirmationBeforeDelete(): boolean;
package/package.json CHANGED
@@ -82,7 +82,7 @@
82
82
  }
83
83
  },
84
84
  "name": "@atlaskit/editor-synced-block-provider",
85
- "version": "0.9.0",
85
+ "version": "1.0.0",
86
86
  "description": "Synced Block Provider for @atlaskit/editor-plugin-synced-block",
87
87
  "author": "Atlassian Pty Ltd",
88
88
  "license": "Apache-2.0",