@atlaskit/editor-plugin-annotation 1.10.3 → 1.10.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # @atlaskit/editor-plugin-annotation
2
2
 
3
+ ## 1.10.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#108237](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108237)
8
+ [`ea7dd8ebb249e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ea7dd8ebb249e) -
9
+ Split out side-effects from viewmode plugin to seperate plugin to reduce cyclical dependency risk
10
+
11
+ # WHAT
12
+
13
+ - Remove `createFilterStepsPlugin` from the editorViewMode Plugin and is implemented in
14
+ editorViewModeEffects instead.
15
+ - Remove `appendTransaction` from the editorViewMode plugin and add as a new PMPlugin in
16
+ editorViewModeEffects
17
+ - `applyViewModeStepAt` is moved to editorViewModeEffects. This is currently only used in
18
+ Annotation plugin which now consumes the new plugin instead and has a minor bump.
19
+
20
+ # WHY
21
+
22
+ ViewMode information is needed for upstream work in the CollabEdit plugin (see ED-23466).
23
+ Currently the viewMode plugin already depends on CollabEdit and as such implementing new work
24
+ causes a cylical dependency problem. ViewMode is likely to be required in an increasing number of
25
+ plugins and ideally should be as pure as possible with no dependencies. A larger rethink of how
26
+ these plugins fit together may be required but that is outside the scope of this change.
27
+
28
+ # HOW
29
+
30
+ All incompatibilities should be addressed within this changeset, however for the sake of
31
+ completeness:
32
+
33
+ - `editor-plugin-editor-viewmode-effects` must be added to any preset that relies on the viewmode
34
+ filter steps plugin for viewmode annotations. Currently this seems to only be the confluence
35
+ editor itself.
36
+ - `applyViewModeStepAt` should now be called from the `editorViewModeEffects` plugin. This will
37
+ need to be added to your plugin types independently (all uses covered by this change)
38
+
39
+ - Updated dependencies
40
+
3
41
  ## 1.10.3
4
42
 
5
43
  ### Patch Changes
@@ -44,7 +44,7 @@ var addInlineComment = function addInlineComment(editorAnalyticsAPI, editorAPI)
44
44
  return function (transaction, state) {
45
45
  var _editorAPI$editorView, _pluginState$featureF;
46
46
  var tr = addAnnotationMark(id, supportedBlockNodes)(transaction, state);
47
- editorAPI === null || editorAPI === void 0 || (_editorAPI$editorView = editorAPI.editorViewMode) === null || _editorAPI$editorView === void 0 || _editorAPI$editorView.actions.applyViewModeStepAt(tr);
47
+ editorAPI === null || editorAPI === void 0 || (_editorAPI$editorView = editorAPI.editorViewModeEffects) === null || _editorAPI$editorView === void 0 || _editorAPI$editorView.actions.applyViewModeStepAt(tr);
48
48
 
49
49
  // add insert analytics step to transaction
50
50
  tr = addInsertAnalytics(editorAnalyticsAPI)(tr, state);
@@ -36,7 +36,7 @@ const addAnnotationMark = (id, supportedBlockNodes) => (transaction, state) => {
36
36
  const addInlineComment = (editorAnalyticsAPI, editorAPI) => (id, supportedBlockNodes) => (transaction, state) => {
37
37
  var _editorAPI$editorView, _pluginState$featureF;
38
38
  let tr = addAnnotationMark(id, supportedBlockNodes)(transaction, state);
39
- editorAPI === null || editorAPI === void 0 ? void 0 : (_editorAPI$editorView = editorAPI.editorViewMode) === null || _editorAPI$editorView === void 0 ? void 0 : _editorAPI$editorView.actions.applyViewModeStepAt(tr);
39
+ editorAPI === null || editorAPI === void 0 ? void 0 : (_editorAPI$editorView = editorAPI.editorViewModeEffects) === null || _editorAPI$editorView === void 0 ? void 0 : _editorAPI$editorView.actions.applyViewModeStepAt(tr);
40
40
 
41
41
  // add insert analytics step to transaction
42
42
  tr = addInsertAnalytics(editorAnalyticsAPI)(tr, state);
@@ -38,7 +38,7 @@ var addInlineComment = function addInlineComment(editorAnalyticsAPI, editorAPI)
38
38
  return function (transaction, state) {
39
39
  var _editorAPI$editorView, _pluginState$featureF;
40
40
  var tr = addAnnotationMark(id, supportedBlockNodes)(transaction, state);
41
- editorAPI === null || editorAPI === void 0 || (_editorAPI$editorView = editorAPI.editorViewMode) === null || _editorAPI$editorView === void 0 || _editorAPI$editorView.actions.applyViewModeStepAt(tr);
41
+ editorAPI === null || editorAPI === void 0 || (_editorAPI$editorView = editorAPI.editorViewModeEffects) === null || _editorAPI$editorView === void 0 || _editorAPI$editorView.actions.applyViewModeStepAt(tr);
42
42
 
43
43
  // add insert analytics step to transaction
44
44
  tr = addInsertAnalytics(editorAnalyticsAPI)(tr, state);
@@ -18,8 +18,7 @@ declare const _default: {
18
18
  sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
19
19
  }, import("@atlaskit/editor-common/types").FeatureFlags>>];
20
20
  actions: EditorAnalyticsAPI;
21
- }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewMode", {
22
- sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
21
+ }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewModeEffects", {
23
22
  dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"collabEdit", {
24
23
  pluginConfiguration: import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions;
25
24
  dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
@@ -55,19 +54,22 @@ declare const _default: {
55
54
  }) => boolean;
56
55
  isRemoteReplaceDocumentTransaction: (tr: Transaction) => boolean;
57
56
  };
58
- }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>];
59
- pluginConfiguration?: {
57
+ }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewMode", {
58
+ sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
59
+ dependencies: [];
60
+ pluginConfiguration?: {
61
+ mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
62
+ } | undefined;
63
+ commands: {
64
+ updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
65
+ };
66
+ }, {
60
67
  mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
61
- } | undefined;
62
- commands: {
63
- updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
64
- };
68
+ } | undefined>];
65
69
  actions: {
66
70
  applyViewModeStepAt: (tr: Transaction) => boolean;
67
71
  };
68
- }, {
69
- mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
70
- } | undefined>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
72
+ }, undefined>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
71
73
  pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
72
74
  sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
73
75
  }, import("@atlaskit/editor-common/types").FeatureFlags>>];
@@ -88,8 +90,7 @@ declare const _default: {
88
90
  sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
89
91
  }, import("@atlaskit/editor-common/types").FeatureFlags>>];
90
92
  actions: EditorAnalyticsAPI;
91
- }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewMode", {
92
- sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
93
+ }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewModeEffects", {
93
94
  dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"collabEdit", {
94
95
  pluginConfiguration: import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions;
95
96
  dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
@@ -125,19 +126,22 @@ declare const _default: {
125
126
  }) => boolean;
126
127
  isRemoteReplaceDocumentTransaction: (tr: Transaction) => boolean;
127
128
  };
128
- }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>];
129
- pluginConfiguration?: {
129
+ }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewMode", {
130
+ sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
131
+ dependencies: [];
132
+ pluginConfiguration?: {
133
+ mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
134
+ } | undefined;
135
+ commands: {
136
+ updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
137
+ };
138
+ }, {
130
139
  mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
131
- } | undefined;
132
- commands: {
133
- updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
134
- };
140
+ } | undefined>];
135
141
  actions: {
136
142
  applyViewModeStepAt: (tr: Transaction) => boolean;
137
143
  };
138
- }, {
139
- mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
140
- } | undefined>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
144
+ }, undefined>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
141
145
  pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
142
146
  sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
143
147
  }, import("@atlaskit/editor-common/types").FeatureFlags>>]> | undefined) => (id: string, supportedBlockNodes?: string[] | undefined) => (transaction: Transaction, state: EditorState) => Transaction;
@@ -4,7 +4,7 @@ import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
4
  import type { AnnotationUpdateEmitter } from '@atlaskit/editor-common/annotation';
5
5
  import type { Command, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
6
6
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
7
- import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
7
+ import type { EditorViewModeEffectsPlugin } from '@atlaskit/editor-plugin-editor-viewmode-effects';
8
8
  import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
9
9
  import type { Slice } from '@atlaskit/editor-prosemirror/model';
10
10
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
@@ -30,7 +30,7 @@ export type AnnotationPlugin = NextEditorPlugin<'annotation', {
30
30
  sharedState: InlineCommentPluginState | undefined;
31
31
  dependencies: [
32
32
  OptionalPlugin<AnalyticsPlugin>,
33
- OptionalPlugin<EditorViewModePlugin>,
33
+ OptionalPlugin<EditorViewModeEffectsPlugin>,
34
34
  OptionalPlugin<FeatureFlagsPlugin>
35
35
  ];
36
36
  actions: {
@@ -23,8 +23,7 @@ declare const _default: {
23
23
  ];
24
24
  actions: EditorAnalyticsAPI;
25
25
  }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>,
26
- import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewMode", {
27
- sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
26
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewModeEffects", {
28
27
  dependencies: [
29
28
  import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"collabEdit", {
30
29
  pluginConfiguration: import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions;
@@ -66,20 +65,25 @@ declare const _default: {
66
65
  }) => boolean;
67
66
  isRemoteReplaceDocumentTransaction: (tr: Transaction) => boolean;
68
67
  };
69
- }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
68
+ }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>,
69
+ import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewMode", {
70
+ sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
71
+ dependencies: [
72
+ ];
73
+ pluginConfiguration?: {
74
+ mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
75
+ } | undefined;
76
+ commands: {
77
+ updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
78
+ };
79
+ }, {
80
+ mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
81
+ } | undefined>
70
82
  ];
71
- pluginConfiguration?: {
72
- mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
73
- } | undefined;
74
- commands: {
75
- updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
76
- };
77
83
  actions: {
78
84
  applyViewModeStepAt: (tr: Transaction) => boolean;
79
85
  };
80
- }, {
81
- mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
82
- } | undefined>>,
86
+ }, undefined>>,
83
87
  import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
84
88
  pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
85
89
  sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
@@ -106,8 +110,7 @@ declare const _default: {
106
110
  ];
107
111
  actions: EditorAnalyticsAPI;
108
112
  }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>,
109
- import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewMode", {
110
- sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
113
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewModeEffects", {
111
114
  dependencies: [
112
115
  import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"collabEdit", {
113
116
  pluginConfiguration: import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions;
@@ -149,20 +152,25 @@ declare const _default: {
149
152
  }) => boolean;
150
153
  isRemoteReplaceDocumentTransaction: (tr: Transaction) => boolean;
151
154
  };
152
- }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
155
+ }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>,
156
+ import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewMode", {
157
+ sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
158
+ dependencies: [
159
+ ];
160
+ pluginConfiguration?: {
161
+ mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
162
+ } | undefined;
163
+ commands: {
164
+ updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
165
+ };
166
+ }, {
167
+ mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
168
+ } | undefined>
153
169
  ];
154
- pluginConfiguration?: {
155
- mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
156
- } | undefined;
157
- commands: {
158
- updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
159
- };
160
170
  actions: {
161
171
  applyViewModeStepAt: (tr: Transaction) => boolean;
162
172
  };
163
- }, {
164
- mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
165
- } | undefined>>,
173
+ }, undefined>>,
166
174
  import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
167
175
  pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
168
176
  sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
@@ -4,7 +4,7 @@ import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
4
  import type { AnnotationUpdateEmitter } from '@atlaskit/editor-common/annotation';
5
5
  import type { Command, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
6
6
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
7
- import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
7
+ import type { EditorViewModeEffectsPlugin } from '@atlaskit/editor-plugin-editor-viewmode-effects';
8
8
  import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
9
9
  import type { Slice } from '@atlaskit/editor-prosemirror/model';
10
10
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
@@ -30,7 +30,7 @@ export type AnnotationPlugin = NextEditorPlugin<'annotation', {
30
30
  sharedState: InlineCommentPluginState | undefined;
31
31
  dependencies: [
32
32
  OptionalPlugin<AnalyticsPlugin>,
33
- OptionalPlugin<EditorViewModePlugin>,
33
+ OptionalPlugin<EditorViewModeEffectsPlugin>,
34
34
  OptionalPlugin<FeatureFlagsPlugin>
35
35
  ];
36
36
  actions: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-annotation",
3
- "version": "1.10.3",
3
+ "version": "1.10.4",
4
4
  "description": "Annotation plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,7 +35,7 @@
35
35
  "@atlaskit/adf-schema": "^36.10.7",
36
36
  "@atlaskit/editor-common": "^82.9.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^1.2.0",
38
- "@atlaskit/editor-plugin-editor-viewmode": "^1.2.0",
38
+ "@atlaskit/editor-plugin-editor-viewmode-effects": "^1.0.0",
39
39
  "@atlaskit/editor-plugin-feature-flags": "^1.1.0",
40
40
  "@atlaskit/editor-prosemirror": "4.0.1",
41
41
  "@atlaskit/icon": "^22.4.0",