@atlaskit/editor-plugin-placeholder 3.0.0 → 3.1.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,23 @@
1
1
  # @atlaskit/editor-plugin-placeholder
2
2
 
3
+ ## 3.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`81ec1e909620a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/81ec1e909620a) -
8
+ [EDITOR-1206] Show diff plugin added as an optional dependancy, if the diff is showing do not show
9
+ the placeholder
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 3.0.1
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 3.0.0
4
22
 
5
23
  ### Major Changes
@@ -177,13 +177,14 @@ function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, empt
177
177
  },
178
178
  props: {
179
179
  decorations: function decorations(editorState) {
180
- var _api$composition;
180
+ var _api$composition, _api$showDiff;
181
181
  var _getPlaceholderState = getPlaceholderState(editorState),
182
182
  hasPlaceholder = _getPlaceholderState.hasPlaceholder,
183
183
  placeholderText = _getPlaceholderState.placeholderText,
184
184
  pos = _getPlaceholderState.pos;
185
185
  var compositionPluginState = api === null || api === void 0 || (_api$composition = api.composition) === null || _api$composition === void 0 ? void 0 : _api$composition.sharedState.currentState();
186
- if (hasPlaceholder && placeholderText && pos !== undefined && !(compositionPluginState !== null && compositionPluginState !== void 0 && compositionPluginState.isComposing)) {
186
+ var isShowingDiff = Boolean(api === null || api === void 0 || (_api$showDiff = api.showDiff) === null || _api$showDiff === void 0 || (_api$showDiff = _api$showDiff.sharedState.currentState()) === null || _api$showDiff === void 0 ? void 0 : _api$showDiff.isDisplayingChanges);
187
+ if (hasPlaceholder && placeholderText && pos !== undefined && !(compositionPluginState !== null && compositionPluginState !== void 0 && compositionPluginState.isComposing) && !isShowingDiff) {
187
188
  return createPlaceholderDecoration(editorState, placeholderText, pos);
188
189
  }
189
190
  return;
@@ -168,14 +168,15 @@ export function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderTex
168
168
  },
169
169
  props: {
170
170
  decorations(editorState) {
171
- var _api$composition;
171
+ var _api$composition, _api$showDiff, _api$showDiff$sharedS;
172
172
  const {
173
173
  hasPlaceholder,
174
174
  placeholderText,
175
175
  pos
176
176
  } = getPlaceholderState(editorState);
177
177
  const compositionPluginState = api === null || api === void 0 ? void 0 : (_api$composition = api.composition) === null || _api$composition === void 0 ? void 0 : _api$composition.sharedState.currentState();
178
- if (hasPlaceholder && placeholderText && pos !== undefined && !(compositionPluginState !== null && compositionPluginState !== void 0 && compositionPluginState.isComposing)) {
178
+ const isShowingDiff = Boolean(api === null || api === void 0 ? void 0 : (_api$showDiff = api.showDiff) === null || _api$showDiff === void 0 ? void 0 : (_api$showDiff$sharedS = _api$showDiff.sharedState.currentState()) === null || _api$showDiff$sharedS === void 0 ? void 0 : _api$showDiff$sharedS.isDisplayingChanges);
179
+ if (hasPlaceholder && placeholderText && pos !== undefined && !(compositionPluginState !== null && compositionPluginState !== void 0 && compositionPluginState.isComposing) && !isShowingDiff) {
179
180
  return createPlaceholderDecoration(editorState, placeholderText, pos);
180
181
  }
181
182
  return;
@@ -169,13 +169,14 @@ export function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderTex
169
169
  },
170
170
  props: {
171
171
  decorations: function decorations(editorState) {
172
- var _api$composition;
172
+ var _api$composition, _api$showDiff;
173
173
  var _getPlaceholderState = getPlaceholderState(editorState),
174
174
  hasPlaceholder = _getPlaceholderState.hasPlaceholder,
175
175
  placeholderText = _getPlaceholderState.placeholderText,
176
176
  pos = _getPlaceholderState.pos;
177
177
  var compositionPluginState = api === null || api === void 0 || (_api$composition = api.composition) === null || _api$composition === void 0 ? void 0 : _api$composition.sharedState.currentState();
178
- if (hasPlaceholder && placeholderText && pos !== undefined && !(compositionPluginState !== null && compositionPluginState !== void 0 && compositionPluginState.isComposing)) {
178
+ var isShowingDiff = Boolean(api === null || api === void 0 || (_api$showDiff = api.showDiff) === null || _api$showDiff === void 0 || (_api$showDiff = _api$showDiff.sharedState.currentState()) === null || _api$showDiff === void 0 ? void 0 : _api$showDiff.isDisplayingChanges);
179
+ if (hasPlaceholder && placeholderText && pos !== undefined && !(compositionPluginState !== null && compositionPluginState !== void 0 && compositionPluginState.isComposing) && !isShowingDiff) {
179
180
  return createPlaceholderDecoration(editorState, placeholderText, pos);
180
181
  }
181
182
  return;
@@ -1,6 +1,7 @@
1
- import type { EditorCommand, NextEditorPlugin } from '@atlaskit/editor-common/types';
1
+ import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
2
  import type { CompositionPlugin } from '@atlaskit/editor-plugin-composition';
3
3
  import type { FocusPlugin } from '@atlaskit/editor-plugin-focus';
4
+ import type { ShowDiffPlugin } from '@atlaskit/editor-plugin-show-diff';
4
5
  import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
5
6
  export interface PlaceholderPluginOptions {
6
7
  placeholder?: string;
@@ -12,5 +13,5 @@ export type PlaceholderPlugin = NextEditorPlugin<'placeholder', {
12
13
  commands: {
13
14
  setPlaceholder: (placeholder: string) => EditorCommand;
14
15
  };
15
- dependencies: [FocusPlugin, CompositionPlugin, TypeAheadPlugin];
16
+ dependencies: [FocusPlugin, CompositionPlugin, TypeAheadPlugin, OptionalPlugin<ShowDiffPlugin>];
16
17
  }>;
@@ -1,6 +1,7 @@
1
- import type { EditorCommand, NextEditorPlugin } from '@atlaskit/editor-common/types';
1
+ import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
2
  import type { CompositionPlugin } from '@atlaskit/editor-plugin-composition';
3
3
  import type { FocusPlugin } from '@atlaskit/editor-plugin-focus';
4
+ import type { ShowDiffPlugin } from '@atlaskit/editor-plugin-show-diff';
4
5
  import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
5
6
  export interface PlaceholderPluginOptions {
6
7
  placeholder?: string;
@@ -15,6 +16,7 @@ export type PlaceholderPlugin = NextEditorPlugin<'placeholder', {
15
16
  dependencies: [
16
17
  FocusPlugin,
17
18
  CompositionPlugin,
18
- TypeAheadPlugin
19
+ TypeAheadPlugin,
20
+ OptionalPlugin<ShowDiffPlugin>
19
21
  ];
20
22
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-placeholder",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "Placeholder plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,21 +32,21 @@
32
32
  "dependencies": {
33
33
  "@atlaskit/editor-plugin-composition": "^2.0.0",
34
34
  "@atlaskit/editor-plugin-focus": "^2.0.0",
35
- "@atlaskit/editor-plugin-type-ahead": "^3.0.0",
35
+ "@atlaskit/editor-plugin-show-diff": "^0.1.0",
36
+ "@atlaskit/editor-plugin-type-ahead": "^3.1.0",
36
37
  "@atlaskit/editor-prosemirror": "7.0.0",
37
38
  "@atlaskit/platform-feature-flags": "^1.1.0",
38
- "@atlaskit/tmp-editor-statsig": "^8.7.0",
39
+ "@atlaskit/tmp-editor-statsig": "^9.26.0",
39
40
  "@babel/runtime": "^7.0.0"
40
41
  },
41
42
  "peerDependencies": {
42
- "@atlaskit/editor-common": "^107.6.0",
43
+ "@atlaskit/editor-common": "^107.20.0",
43
44
  "react": "^18.2.0",
44
45
  "react-dom": "^18.2.0",
45
46
  "react-intl-next": "npm:react-intl@^5.18.1"
46
47
  },
47
48
  "devDependencies": {
48
- "@testing-library/react": "^13.4.0",
49
- "typescript": "~5.4.2"
49
+ "@testing-library/react": "^13.4.0"
50
50
  },
51
51
  "techstack": {
52
52
  "@atlassian/frontend": {