@atlaskit/editor-plugin-synced-block 3.10.0 → 3.11.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,16 @@
1
1
  # @atlaskit/editor-plugin-synced-block
2
2
 
3
+ ## 3.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`424619eee38cb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/424619eee38cb) -
8
+ EDITOR-2451 add tests and refactor
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
3
14
  ## 3.10.0
4
15
 
5
16
  ### Minor Changes
@@ -17,7 +17,11 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
17
17
  return new _safePlugin.SafePlugin({
18
18
  key: syncedBlockPluginKey,
19
19
  state: {
20
- init: function init() {
20
+ init: function init(_, instance) {
21
+ var syncBlockNodes = instance.doc.children.filter(function (node) {
22
+ return node.type.name === 'syncBlock';
23
+ });
24
+ syncBlockStore.fetchSyncBlocksData(syncBlockNodes);
21
25
  return {};
22
26
  },
23
27
  apply: function apply(tr, currentPluginState) {
@@ -11,7 +11,9 @@ export const createPlugin = (options, pmPluginFactoryParams, syncBlockStore, api
11
11
  return new SafePlugin({
12
12
  key: syncedBlockPluginKey,
13
13
  state: {
14
- init() {
14
+ init(_, instance) {
15
+ const syncBlockNodes = instance.doc.children.filter(node => node.type.name === 'syncBlock');
16
+ syncBlockStore.fetchSyncBlocksData(syncBlockNodes);
15
17
  return {};
16
18
  },
17
19
  apply: (tr, currentPluginState) => {
@@ -11,7 +11,11 @@ export var createPlugin = function createPlugin(options, pmPluginFactoryParams,
11
11
  return new SafePlugin({
12
12
  key: syncedBlockPluginKey,
13
13
  state: {
14
- init: function init() {
14
+ init: function init(_, instance) {
15
+ var syncBlockNodes = instance.doc.children.filter(function (node) {
16
+ return node.type.name === 'syncBlock';
17
+ });
18
+ syncBlockStore.fetchSyncBlocksData(syncBlockNodes);
15
19
  return {};
16
20
  },
17
21
  apply: function apply(tr, currentPluginState) {
@@ -8,7 +8,7 @@ import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
8
8
  import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
9
9
  import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
10
10
  import type { EditorView } from '@atlaskit/editor-prosemirror/dist/types/view';
11
- import type { FetchSyncBlockDataResult, SyncBlockDataProvider } from '@atlaskit/editor-synced-block-provider';
11
+ import type { SyncBlockInstance, SyncBlockDataProvider } from '@atlaskit/editor-synced-block-provider';
12
12
  export type SyncedBlockEditorProps = {
13
13
  defaultDocument: JSONDocNode;
14
14
  onChange: (editorView: EditorView, meta: {
@@ -32,7 +32,7 @@ export type SyncedBlockEditorProps = {
32
32
  popupsMountPoint: HTMLElement;
33
33
  };
34
34
  export type SyncedBlockRendererProps = {
35
- useFetchSyncBlockData: () => FetchSyncBlockDataResult | null;
35
+ useFetchSyncBlockData: () => SyncBlockInstance | null;
36
36
  };
37
37
  export type SyncedBlockPluginOptions = {
38
38
  dataProvider?: SyncBlockDataProvider;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import type { FetchSyncBlockDataResult } from '@atlaskit/editor-synced-block-provider';
2
+ import type { SyncBlockInstance } from '@atlaskit/editor-synced-block-provider';
3
3
  import type { SyncedBlockRendererProps } from '../syncedBlockPluginType';
4
4
  type Props = {
5
5
  getSyncedBlockRenderer: (props: SyncedBlockRendererProps) => React.JSX.Element;
6
- useFetchSyncBlockData: () => FetchSyncBlockDataResult | null;
6
+ useFetchSyncBlockData: () => SyncBlockInstance | null;
7
7
  };
8
8
  export declare const SyncBlockRendererWrapper: React.MemoExoticComponent<({ getSyncedBlockRenderer, useFetchSyncBlockData, }: Props) => React.JSX.Element>;
9
9
  export {};
@@ -8,7 +8,7 @@ import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
8
8
  import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
9
9
  import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
10
10
  import type { EditorView } from '@atlaskit/editor-prosemirror/dist/types/view';
11
- import type { FetchSyncBlockDataResult, SyncBlockDataProvider } from '@atlaskit/editor-synced-block-provider';
11
+ import type { SyncBlockInstance, SyncBlockDataProvider } from '@atlaskit/editor-synced-block-provider';
12
12
  export type SyncedBlockEditorProps = {
13
13
  defaultDocument: JSONDocNode;
14
14
  onChange: (editorView: EditorView, meta: {
@@ -32,7 +32,7 @@ export type SyncedBlockEditorProps = {
32
32
  popupsMountPoint: HTMLElement;
33
33
  };
34
34
  export type SyncedBlockRendererProps = {
35
- useFetchSyncBlockData: () => FetchSyncBlockDataResult | null;
35
+ useFetchSyncBlockData: () => SyncBlockInstance | null;
36
36
  };
37
37
  export type SyncedBlockPluginOptions = {
38
38
  dataProvider?: SyncBlockDataProvider;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import type { FetchSyncBlockDataResult } from '@atlaskit/editor-synced-block-provider';
2
+ import type { SyncBlockInstance } from '@atlaskit/editor-synced-block-provider';
3
3
  import type { SyncedBlockRendererProps } from '../syncedBlockPluginType';
4
4
  type Props = {
5
5
  getSyncedBlockRenderer: (props: SyncedBlockRendererProps) => React.JSX.Element;
6
- useFetchSyncBlockData: () => FetchSyncBlockDataResult | null;
6
+ useFetchSyncBlockData: () => SyncBlockInstance | null;
7
7
  };
8
8
  export declare const SyncBlockRendererWrapper: React.MemoExoticComponent<({ getSyncedBlockRenderer, useFetchSyncBlockData, }: Props) => React.JSX.Element>;
9
9
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-synced-block",
3
- "version": "3.10.0",
3
+ "version": "3.11.0",
4
4
  "description": "SyncedBlock plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -38,7 +38,7 @@
38
38
  "@atlaskit/editor-plugin-selection": "^6.1.0",
39
39
  "@atlaskit/editor-prosemirror": "7.0.0",
40
40
  "@atlaskit/editor-shared-styles": "^3.8.0",
41
- "@atlaskit/editor-synced-block-provider": "^2.3.0",
41
+ "@atlaskit/editor-synced-block-provider": "^2.5.0",
42
42
  "@atlaskit/editor-tables": "^2.9.0",
43
43
  "@atlaskit/editor-toolbar": "^0.17.0",
44
44
  "@atlaskit/icon": "28.5.3",
@@ -47,7 +47,7 @@
47
47
  "react-intl-next": "npm:react-intl@^5.18.1"
48
48
  },
49
49
  "peerDependencies": {
50
- "@atlaskit/editor-common": "^110.19.0",
50
+ "@atlaskit/editor-common": "^110.21.0",
51
51
  "react": "^18.2.0"
52
52
  },
53
53
  "devDependencies": {
@@ -1,68 +0,0 @@
1
- {
2
- "extends": "../../../../tsconfig.entry-points.post-office.json",
3
- "compilerOptions": {
4
- "target": "es5",
5
- "outDir": "../../../../../post-office/tsDist/@atlaskit__editor-plugin-synced-block/app",
6
- "rootDir": "../",
7
- "composite": true
8
- },
9
- "include": [
10
- "../src/**/*.ts",
11
- "../src/**/*.tsx"
12
- ],
13
- "exclude": [
14
- "../src/**/__tests__/*",
15
- "../src/**/*.test.*",
16
- "../src/**/test.*",
17
- "../src/**/examples.*",
18
- "../src/**/examples/*",
19
- "../src/**/examples/**/*",
20
- "../src/**/*.stories.*",
21
- "../src/**/stories/*",
22
- "../src/**/stories/**/*"
23
- ],
24
- "references": [
25
- {
26
- "path": "../../../design-system/button/afm-post-office/tsconfig.json"
27
- },
28
- {
29
- "path": "../../editor-json-transformer/afm-post-office/tsconfig.json"
30
- },
31
- {
32
- "path": "../../editor-plugin-analytics/afm-post-office/tsconfig.json"
33
- },
34
- {
35
- "path": "../../editor-plugin-block-menu/afm-post-office/tsconfig.json"
36
- },
37
- {
38
- "path": "../../editor-plugin-decorations/afm-post-office/tsconfig.json"
39
- },
40
- {
41
- "path": "../../editor-plugin-floating-toolbar/afm-post-office/tsconfig.json"
42
- },
43
- {
44
- "path": "../../editor-plugin-selection/afm-post-office/tsconfig.json"
45
- },
46
- {
47
- "path": "../../editor-shared-styles/afm-post-office/tsconfig.json"
48
- },
49
- {
50
- "path": "../../editor-synced-block-provider/afm-post-office/tsconfig.json"
51
- },
52
- {
53
- "path": "../../editor-tables/afm-post-office/tsconfig.json"
54
- },
55
- {
56
- "path": "../../editor-toolbar/afm-post-office/tsconfig.json"
57
- },
58
- {
59
- "path": "../../../design-system/icon/afm-post-office/tsconfig.json"
60
- },
61
- {
62
- "path": "../../../design-system/modal-dialog/afm-post-office/tsconfig.json"
63
- },
64
- {
65
- "path": "../../editor-common/afm-post-office/tsconfig.json"
66
- }
67
- ]
68
- }