@atlaskit/editor-plugin-placeholder 6.6.0 → 6.6.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,22 @@
1
1
  # @atlaskit/editor-plugin-placeholder
2
2
 
3
+ ## 6.6.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 6.6.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`be40850b186a8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/be40850b186a8) -
14
+ Rolled up editor AIFC beta gates into the parent streaming gate. Also decoupled the placholder
15
+ from the main AIFC FG by utilising the withEmptyParagraph plugin option, since this prop is only
16
+ set when AIFC is enabled. This means we don't need refs to this gate in the plugin because it's
17
+ already controlled by a prop.
18
+ - Updated dependencies
19
+
3
20
  ## 6.6.0
4
21
 
5
22
  ### Minor Changes
@@ -39,7 +39,8 @@ function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, empt
39
39
  placeholderPrompts: placeholderPrompts,
40
40
  typedAndDeleted: false,
41
41
  userHadTyped: false,
42
- intl: intl
42
+ intl: intl,
43
+ withEmptyParagraph: withEmptyParagraph
43
44
  });
44
45
  },
45
46
  apply: function apply(tr, placeholderState, _oldEditorState, newEditorState) {
@@ -54,10 +55,10 @@ function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, empt
54
55
  userHadTyped = _calculateUserInterac.userHadTyped,
55
56
  typedAndDeleted = _calculateUserInterac.typedAndDeleted;
56
57
  var isPlaceholderHidden = (_placeholderState$isP = placeholderState === null || placeholderState === void 0 ? void 0 : placeholderState.isPlaceholderHidden) !== null && _placeholderState$isP !== void 0 ? _placeholderState$isP : false;
57
- if ((meta === null || meta === void 0 ? void 0 : meta.isPlaceholderHidden) !== undefined && (0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_beta')) {
58
+ if ((meta === null || meta === void 0 ? void 0 : meta.isPlaceholderHidden) !== undefined && withEmptyParagraph) {
58
59
  isPlaceholderHidden = meta.isPlaceholderHidden;
59
60
  }
60
- if ((meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== undefined && ((0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_beta_2') || (0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_ga'))) {
61
+ if ((meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== undefined && withEmptyParagraph) {
61
62
  // Only update defaultPlaceholderText from meta if we're not using ADF placeholder
62
63
  if (!((0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_ga') && placeholderADF)) {
63
64
  defaultPlaceholderText = meta.placeholderText;
@@ -67,7 +68,7 @@ function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, empt
67
68
  isEditorFocused: isEditorFocused,
68
69
  editorState: newEditorState,
69
70
  isTypeAheadOpen: api === null || api === void 0 || (_api$typeAhead2 = api.typeAhead) === null || _api$typeAhead2 === void 0 ? void 0 : _api$typeAhead2.actions.isOpen,
70
- defaultPlaceholderText: (0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_beta_2') || (0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_ga') ? defaultPlaceholderText : (_ref = (_meta$placeholderText = meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== null && _meta$placeholderText !== void 0 ? _meta$placeholderText : placeholderState === null || placeholderState === void 0 ? void 0 : placeholderState.placeholderText) !== null && _ref !== void 0 ? _ref : defaultPlaceholderText,
71
+ defaultPlaceholderText: withEmptyParagraph ? defaultPlaceholderText : (_ref = (_meta$placeholderText = meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== null && _meta$placeholderText !== void 0 ? _meta$placeholderText : placeholderState === null || placeholderState === void 0 ? void 0 : placeholderState.placeholderText) !== null && _ref !== void 0 ? _ref : defaultPlaceholderText,
71
72
  bracketPlaceholderText: bracketPlaceholderText,
72
73
  emptyLinePlaceholder: emptyLinePlaceholder,
73
74
  placeholderADF: placeholderADF,
@@ -134,7 +135,7 @@ function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, empt
134
135
  }
135
136
  return {
136
137
  update: function update(editorView, prevState) {
137
- if ((0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_beta_2') || (0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_ga')) {
138
+ if (withEmptyParagraph) {
138
139
  var prevPluginState = (0, _utils.getPlaceholderState)(prevState);
139
140
  var newPluginState = (0, _utils.getPlaceholderState)(editorView.state);
140
141
 
@@ -249,7 +249,7 @@ function createPlaceHolderStateFrom(_ref5) {
249
249
  isPlaceholderHidden = _ref5.isPlaceholderHidden,
250
250
  withEmptyParagraph = _ref5.withEmptyParagraph,
251
251
  showOnEmptyParagraph = _ref5.showOnEmptyParagraph;
252
- if (isPlaceholderHidden && (0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_beta')) {
252
+ if (isPlaceholderHidden && withEmptyParagraph) {
253
253
  return _objectSpread(_objectSpread({}, emptyPlaceholder({
254
254
  placeholderText: defaultPlaceholderText,
255
255
  placeholderPrompts: placeholderPrompts,
@@ -274,7 +274,7 @@ function createPlaceHolderStateFrom(_ref5) {
274
274
  userHadTyped: userHadTyped
275
275
  });
276
276
  }
277
- if ((0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_beta_2') || (0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_ga')) {
277
+ if (withEmptyParagraph) {
278
278
  var _editorState$selectio = editorState.selection,
279
279
  from = _editorState$selectio.from,
280
280
  to = _editorState$selectio.to,
@@ -441,7 +441,8 @@ function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, empt
441
441
  placeholderPrompts: placeholderPrompts,
442
442
  typedAndDeleted: false,
443
443
  userHadTyped: false,
444
- intl: intl
444
+ intl: intl,
445
+ withEmptyParagraph: withEmptyParagraph
445
446
  });
446
447
  },
447
448
  apply: function apply(tr, placeholderState, _oldEditorState, newEditorState) {
@@ -456,10 +457,10 @@ function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, empt
456
457
  userHadTyped = _calculateUserInterac.userHadTyped,
457
458
  typedAndDeleted = _calculateUserInterac.typedAndDeleted;
458
459
  var isPlaceholderHidden = (_placeholderState$isP = placeholderState === null || placeholderState === void 0 ? void 0 : placeholderState.isPlaceholderHidden) !== null && _placeholderState$isP !== void 0 ? _placeholderState$isP : false;
459
- if ((meta === null || meta === void 0 ? void 0 : meta.isPlaceholderHidden) !== undefined && (0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_beta')) {
460
+ if ((meta === null || meta === void 0 ? void 0 : meta.isPlaceholderHidden) !== undefined && withEmptyParagraph) {
460
461
  isPlaceholderHidden = meta.isPlaceholderHidden;
461
462
  }
462
- if ((meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== undefined && ((0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_beta_2') || (0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_ga'))) {
463
+ if ((meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== undefined && withEmptyParagraph) {
463
464
  // Only update defaultPlaceholderText from meta if we're not using ADF placeholder
464
465
  if (!((0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_ga') && placeholderADF)) {
465
466
  defaultPlaceholderText = meta.placeholderText;
@@ -469,7 +470,7 @@ function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, empt
469
470
  isEditorFocused: isEditorFocused,
470
471
  editorState: newEditorState,
471
472
  isTypeAheadOpen: api === null || api === void 0 || (_api$typeAhead2 = api.typeAhead) === null || _api$typeAhead2 === void 0 ? void 0 : _api$typeAhead2.actions.isOpen,
472
- defaultPlaceholderText: (0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_beta_2') || (0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_ga') ? defaultPlaceholderText : (_ref7 = (_meta$placeholderText = meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== null && _meta$placeholderText !== void 0 ? _meta$placeholderText : placeholderState === null || placeholderState === void 0 ? void 0 : placeholderState.placeholderText) !== null && _ref7 !== void 0 ? _ref7 : defaultPlaceholderText,
473
+ defaultPlaceholderText: withEmptyParagraph ? defaultPlaceholderText : (_ref7 = (_meta$placeholderText = meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== null && _meta$placeholderText !== void 0 ? _meta$placeholderText : placeholderState === null || placeholderState === void 0 ? void 0 : placeholderState.placeholderText) !== null && _ref7 !== void 0 ? _ref7 : defaultPlaceholderText,
473
474
  bracketPlaceholderText: bracketPlaceholderText,
474
475
  emptyLinePlaceholder: emptyLinePlaceholder,
475
476
  placeholderADF: placeholderADF,
@@ -536,7 +537,7 @@ function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, empt
536
537
  }
537
538
  return {
538
539
  update: function update(editorView, prevState) {
539
- if ((0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_beta_2') || (0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_ga')) {
540
+ if (withEmptyParagraph) {
540
541
  var prevPluginState = getPlaceholderState(prevState);
541
542
  var newPluginState = getPlaceholderState(editorView.state);
542
543
 
@@ -78,7 +78,7 @@ function createPlaceHolderStateFrom(_ref3) {
78
78
  isPlaceholderHidden = _ref3.isPlaceholderHidden,
79
79
  withEmptyParagraph = _ref3.withEmptyParagraph,
80
80
  showOnEmptyParagraph = _ref3.showOnEmptyParagraph;
81
- if (isPlaceholderHidden && (0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_beta')) {
81
+ if (isPlaceholderHidden && withEmptyParagraph) {
82
82
  return _objectSpread(_objectSpread({}, emptyPlaceholder({
83
83
  placeholderText: defaultPlaceholderText,
84
84
  placeholderPrompts: placeholderPrompts,
@@ -103,7 +103,7 @@ function createPlaceHolderStateFrom(_ref3) {
103
103
  userHadTyped: userHadTyped
104
104
  });
105
105
  }
106
- if ((0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_beta_2') || (0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_ga')) {
106
+ if (withEmptyParagraph) {
107
107
  var _editorState$selectio = editorState.selection,
108
108
  from = _editorState$selectio.from,
109
109
  to = _editorState$selectio.to,
@@ -31,7 +31,8 @@ export default function createPlugin(intl, defaultPlaceholderText, bracketPlaceh
31
31
  placeholderPrompts,
32
32
  typedAndDeleted: false,
33
33
  userHadTyped: false,
34
- intl
34
+ intl,
35
+ withEmptyParagraph
35
36
  });
36
37
  },
37
38
  apply: (tr, placeholderState, _oldEditorState, newEditorState) => {
@@ -47,10 +48,10 @@ export default function createPlugin(intl, defaultPlaceholderText, bracketPlaceh
47
48
  newEditorState
48
49
  });
49
50
  let isPlaceholderHidden = (_placeholderState$isP = placeholderState === null || placeholderState === void 0 ? void 0 : placeholderState.isPlaceholderHidden) !== null && _placeholderState$isP !== void 0 ? _placeholderState$isP : false;
50
- if ((meta === null || meta === void 0 ? void 0 : meta.isPlaceholderHidden) !== undefined && fg('platform_editor_ai_aifc_patch_beta')) {
51
+ if ((meta === null || meta === void 0 ? void 0 : meta.isPlaceholderHidden) !== undefined && withEmptyParagraph) {
51
52
  isPlaceholderHidden = meta.isPlaceholderHidden;
52
53
  }
53
- if ((meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== undefined && (fg('platform_editor_ai_aifc_patch_beta_2') || fg('platform_editor_ai_aifc_patch_ga'))) {
54
+ if ((meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== undefined && withEmptyParagraph) {
54
55
  // Only update defaultPlaceholderText from meta if we're not using ADF placeholder
55
56
  if (!(fg('platform_editor_ai_aifc_patch_ga') && placeholderADF)) {
56
57
  defaultPlaceholderText = meta.placeholderText;
@@ -60,7 +61,7 @@ export default function createPlugin(intl, defaultPlaceholderText, bracketPlaceh
60
61
  isEditorFocused,
61
62
  editorState: newEditorState,
62
63
  isTypeAheadOpen: api === null || api === void 0 ? void 0 : (_api$typeAhead2 = api.typeAhead) === null || _api$typeAhead2 === void 0 ? void 0 : _api$typeAhead2.actions.isOpen,
63
- defaultPlaceholderText: fg('platform_editor_ai_aifc_patch_beta_2') || fg('platform_editor_ai_aifc_patch_ga') ? defaultPlaceholderText : (_ref = (_meta$placeholderText = meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== null && _meta$placeholderText !== void 0 ? _meta$placeholderText : placeholderState === null || placeholderState === void 0 ? void 0 : placeholderState.placeholderText) !== null && _ref !== void 0 ? _ref : defaultPlaceholderText,
64
+ defaultPlaceholderText: withEmptyParagraph ? defaultPlaceholderText : (_ref = (_meta$placeholderText = meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== null && _meta$placeholderText !== void 0 ? _meta$placeholderText : placeholderState === null || placeholderState === void 0 ? void 0 : placeholderState.placeholderText) !== null && _ref !== void 0 ? _ref : defaultPlaceholderText,
64
65
  bracketPlaceholderText,
65
66
  emptyLinePlaceholder,
66
67
  placeholderADF,
@@ -128,7 +129,7 @@ export default function createPlugin(intl, defaultPlaceholderText, bracketPlaceh
128
129
  }
129
130
  return {
130
131
  update(editorView, prevState) {
131
- if (fg('platform_editor_ai_aifc_patch_beta_2') || fg('platform_editor_ai_aifc_patch_ga')) {
132
+ if (withEmptyParagraph) {
132
133
  const prevPluginState = getPlaceholderState(prevState);
133
134
  const newPluginState = getPlaceholderState(editorView.state);
134
135
 
@@ -229,7 +229,7 @@ function createPlaceHolderStateFrom({
229
229
  withEmptyParagraph,
230
230
  showOnEmptyParagraph
231
231
  }) {
232
- if (isPlaceholderHidden && fg('platform_editor_ai_aifc_patch_beta')) {
232
+ if (isPlaceholderHidden && withEmptyParagraph) {
233
233
  return {
234
234
  ...emptyPlaceholder({
235
235
  placeholderText: defaultPlaceholderText,
@@ -255,7 +255,7 @@ function createPlaceHolderStateFrom({
255
255
  userHadTyped
256
256
  });
257
257
  }
258
- if (fg('platform_editor_ai_aifc_patch_beta_2') || fg('platform_editor_ai_aifc_patch_ga')) {
258
+ if (withEmptyParagraph) {
259
259
  const {
260
260
  from,
261
261
  to,
@@ -423,7 +423,8 @@ export function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderTex
423
423
  placeholderPrompts,
424
424
  typedAndDeleted: false,
425
425
  userHadTyped: false,
426
- intl
426
+ intl,
427
+ withEmptyParagraph
427
428
  });
428
429
  },
429
430
  apply: (tr, placeholderState, _oldEditorState, newEditorState) => {
@@ -439,10 +440,10 @@ export function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderTex
439
440
  newEditorState
440
441
  });
441
442
  let isPlaceholderHidden = (_placeholderState$isP = placeholderState === null || placeholderState === void 0 ? void 0 : placeholderState.isPlaceholderHidden) !== null && _placeholderState$isP !== void 0 ? _placeholderState$isP : false;
442
- if ((meta === null || meta === void 0 ? void 0 : meta.isPlaceholderHidden) !== undefined && fg('platform_editor_ai_aifc_patch_beta')) {
443
+ if ((meta === null || meta === void 0 ? void 0 : meta.isPlaceholderHidden) !== undefined && withEmptyParagraph) {
443
444
  isPlaceholderHidden = meta.isPlaceholderHidden;
444
445
  }
445
- if ((meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== undefined && (fg('platform_editor_ai_aifc_patch_beta_2') || fg('platform_editor_ai_aifc_patch_ga'))) {
446
+ if ((meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== undefined && withEmptyParagraph) {
446
447
  // Only update defaultPlaceholderText from meta if we're not using ADF placeholder
447
448
  if (!(fg('platform_editor_ai_aifc_patch_ga') && placeholderADF)) {
448
449
  defaultPlaceholderText = meta.placeholderText;
@@ -452,7 +453,7 @@ export function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderTex
452
453
  isEditorFocused,
453
454
  editorState: newEditorState,
454
455
  isTypeAheadOpen: api === null || api === void 0 ? void 0 : (_api$typeAhead2 = api.typeAhead) === null || _api$typeAhead2 === void 0 ? void 0 : _api$typeAhead2.actions.isOpen,
455
- defaultPlaceholderText: fg('platform_editor_ai_aifc_patch_beta_2') || fg('platform_editor_ai_aifc_patch_ga') ? defaultPlaceholderText : (_ref = (_meta$placeholderText = meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== null && _meta$placeholderText !== void 0 ? _meta$placeholderText : placeholderState === null || placeholderState === void 0 ? void 0 : placeholderState.placeholderText) !== null && _ref !== void 0 ? _ref : defaultPlaceholderText,
456
+ defaultPlaceholderText: withEmptyParagraph ? defaultPlaceholderText : (_ref = (_meta$placeholderText = meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== null && _meta$placeholderText !== void 0 ? _meta$placeholderText : placeholderState === null || placeholderState === void 0 ? void 0 : placeholderState.placeholderText) !== null && _ref !== void 0 ? _ref : defaultPlaceholderText,
456
457
  bracketPlaceholderText,
457
458
  emptyLinePlaceholder,
458
459
  placeholderADF,
@@ -520,7 +521,7 @@ export function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderTex
520
521
  }
521
522
  return {
522
523
  update(editorView, prevState) {
523
- if (fg('platform_editor_ai_aifc_patch_beta_2') || fg('platform_editor_ai_aifc_patch_ga')) {
524
+ if (withEmptyParagraph) {
524
525
  const prevPluginState = getPlaceholderState(prevState);
525
526
  const newPluginState = getPlaceholderState(editorView.state);
526
527
 
@@ -65,7 +65,7 @@ export function createPlaceHolderStateFrom({
65
65
  withEmptyParagraph,
66
66
  showOnEmptyParagraph
67
67
  }) {
68
- if (isPlaceholderHidden && fg('platform_editor_ai_aifc_patch_beta')) {
68
+ if (isPlaceholderHidden && withEmptyParagraph) {
69
69
  return {
70
70
  ...emptyPlaceholder({
71
71
  placeholderText: defaultPlaceholderText,
@@ -91,7 +91,7 @@ export function createPlaceHolderStateFrom({
91
91
  userHadTyped
92
92
  });
93
93
  }
94
- if (fg('platform_editor_ai_aifc_patch_beta_2') || fg('platform_editor_ai_aifc_patch_ga')) {
94
+ if (withEmptyParagraph) {
95
95
  const {
96
96
  from,
97
97
  to,
@@ -33,7 +33,8 @@ export default function createPlugin(intl, defaultPlaceholderText, bracketPlaceh
33
33
  placeholderPrompts: placeholderPrompts,
34
34
  typedAndDeleted: false,
35
35
  userHadTyped: false,
36
- intl: intl
36
+ intl: intl,
37
+ withEmptyParagraph: withEmptyParagraph
37
38
  });
38
39
  },
39
40
  apply: function apply(tr, placeholderState, _oldEditorState, newEditorState) {
@@ -48,10 +49,10 @@ export default function createPlugin(intl, defaultPlaceholderText, bracketPlaceh
48
49
  userHadTyped = _calculateUserInterac.userHadTyped,
49
50
  typedAndDeleted = _calculateUserInterac.typedAndDeleted;
50
51
  var isPlaceholderHidden = (_placeholderState$isP = placeholderState === null || placeholderState === void 0 ? void 0 : placeholderState.isPlaceholderHidden) !== null && _placeholderState$isP !== void 0 ? _placeholderState$isP : false;
51
- if ((meta === null || meta === void 0 ? void 0 : meta.isPlaceholderHidden) !== undefined && fg('platform_editor_ai_aifc_patch_beta')) {
52
+ if ((meta === null || meta === void 0 ? void 0 : meta.isPlaceholderHidden) !== undefined && withEmptyParagraph) {
52
53
  isPlaceholderHidden = meta.isPlaceholderHidden;
53
54
  }
54
- if ((meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== undefined && (fg('platform_editor_ai_aifc_patch_beta_2') || fg('platform_editor_ai_aifc_patch_ga'))) {
55
+ if ((meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== undefined && withEmptyParagraph) {
55
56
  // Only update defaultPlaceholderText from meta if we're not using ADF placeholder
56
57
  if (!(fg('platform_editor_ai_aifc_patch_ga') && placeholderADF)) {
57
58
  defaultPlaceholderText = meta.placeholderText;
@@ -61,7 +62,7 @@ export default function createPlugin(intl, defaultPlaceholderText, bracketPlaceh
61
62
  isEditorFocused: isEditorFocused,
62
63
  editorState: newEditorState,
63
64
  isTypeAheadOpen: api === null || api === void 0 || (_api$typeAhead2 = api.typeAhead) === null || _api$typeAhead2 === void 0 ? void 0 : _api$typeAhead2.actions.isOpen,
64
- defaultPlaceholderText: fg('platform_editor_ai_aifc_patch_beta_2') || fg('platform_editor_ai_aifc_patch_ga') ? defaultPlaceholderText : (_ref = (_meta$placeholderText = meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== null && _meta$placeholderText !== void 0 ? _meta$placeholderText : placeholderState === null || placeholderState === void 0 ? void 0 : placeholderState.placeholderText) !== null && _ref !== void 0 ? _ref : defaultPlaceholderText,
65
+ defaultPlaceholderText: withEmptyParagraph ? defaultPlaceholderText : (_ref = (_meta$placeholderText = meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== null && _meta$placeholderText !== void 0 ? _meta$placeholderText : placeholderState === null || placeholderState === void 0 ? void 0 : placeholderState.placeholderText) !== null && _ref !== void 0 ? _ref : defaultPlaceholderText,
65
66
  bracketPlaceholderText: bracketPlaceholderText,
66
67
  emptyLinePlaceholder: emptyLinePlaceholder,
67
68
  placeholderADF: placeholderADF,
@@ -128,7 +129,7 @@ export default function createPlugin(intl, defaultPlaceholderText, bracketPlaceh
128
129
  }
129
130
  return {
130
131
  update: function update(editorView, prevState) {
131
- if (fg('platform_editor_ai_aifc_patch_beta_2') || fg('platform_editor_ai_aifc_patch_ga')) {
132
+ if (withEmptyParagraph) {
132
133
  var prevPluginState = getPlaceholderState(prevState);
133
134
  var newPluginState = getPlaceholderState(editorView.state);
134
135
 
@@ -239,7 +239,7 @@ function createPlaceHolderStateFrom(_ref5) {
239
239
  isPlaceholderHidden = _ref5.isPlaceholderHidden,
240
240
  withEmptyParagraph = _ref5.withEmptyParagraph,
241
241
  showOnEmptyParagraph = _ref5.showOnEmptyParagraph;
242
- if (isPlaceholderHidden && fg('platform_editor_ai_aifc_patch_beta')) {
242
+ if (isPlaceholderHidden && withEmptyParagraph) {
243
243
  return _objectSpread(_objectSpread({}, emptyPlaceholder({
244
244
  placeholderText: defaultPlaceholderText,
245
245
  placeholderPrompts: placeholderPrompts,
@@ -264,7 +264,7 @@ function createPlaceHolderStateFrom(_ref5) {
264
264
  userHadTyped: userHadTyped
265
265
  });
266
266
  }
267
- if (fg('platform_editor_ai_aifc_patch_beta_2') || fg('platform_editor_ai_aifc_patch_ga')) {
267
+ if (withEmptyParagraph) {
268
268
  var _editorState$selectio = editorState.selection,
269
269
  from = _editorState$selectio.from,
270
270
  to = _editorState$selectio.to,
@@ -431,7 +431,8 @@ export function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderTex
431
431
  placeholderPrompts: placeholderPrompts,
432
432
  typedAndDeleted: false,
433
433
  userHadTyped: false,
434
- intl: intl
434
+ intl: intl,
435
+ withEmptyParagraph: withEmptyParagraph
435
436
  });
436
437
  },
437
438
  apply: function apply(tr, placeholderState, _oldEditorState, newEditorState) {
@@ -446,10 +447,10 @@ export function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderTex
446
447
  userHadTyped = _calculateUserInterac.userHadTyped,
447
448
  typedAndDeleted = _calculateUserInterac.typedAndDeleted;
448
449
  var isPlaceholderHidden = (_placeholderState$isP = placeholderState === null || placeholderState === void 0 ? void 0 : placeholderState.isPlaceholderHidden) !== null && _placeholderState$isP !== void 0 ? _placeholderState$isP : false;
449
- if ((meta === null || meta === void 0 ? void 0 : meta.isPlaceholderHidden) !== undefined && fg('platform_editor_ai_aifc_patch_beta')) {
450
+ if ((meta === null || meta === void 0 ? void 0 : meta.isPlaceholderHidden) !== undefined && withEmptyParagraph) {
450
451
  isPlaceholderHidden = meta.isPlaceholderHidden;
451
452
  }
452
- if ((meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== undefined && (fg('platform_editor_ai_aifc_patch_beta_2') || fg('platform_editor_ai_aifc_patch_ga'))) {
453
+ if ((meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== undefined && withEmptyParagraph) {
453
454
  // Only update defaultPlaceholderText from meta if we're not using ADF placeholder
454
455
  if (!(fg('platform_editor_ai_aifc_patch_ga') && placeholderADF)) {
455
456
  defaultPlaceholderText = meta.placeholderText;
@@ -459,7 +460,7 @@ export function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderTex
459
460
  isEditorFocused: isEditorFocused,
460
461
  editorState: newEditorState,
461
462
  isTypeAheadOpen: api === null || api === void 0 || (_api$typeAhead2 = api.typeAhead) === null || _api$typeAhead2 === void 0 ? void 0 : _api$typeAhead2.actions.isOpen,
462
- defaultPlaceholderText: fg('platform_editor_ai_aifc_patch_beta_2') || fg('platform_editor_ai_aifc_patch_ga') ? defaultPlaceholderText : (_ref7 = (_meta$placeholderText = meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== null && _meta$placeholderText !== void 0 ? _meta$placeholderText : placeholderState === null || placeholderState === void 0 ? void 0 : placeholderState.placeholderText) !== null && _ref7 !== void 0 ? _ref7 : defaultPlaceholderText,
463
+ defaultPlaceholderText: withEmptyParagraph ? defaultPlaceholderText : (_ref7 = (_meta$placeholderText = meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== null && _meta$placeholderText !== void 0 ? _meta$placeholderText : placeholderState === null || placeholderState === void 0 ? void 0 : placeholderState.placeholderText) !== null && _ref7 !== void 0 ? _ref7 : defaultPlaceholderText,
463
464
  bracketPlaceholderText: bracketPlaceholderText,
464
465
  emptyLinePlaceholder: emptyLinePlaceholder,
465
466
  placeholderADF: placeholderADF,
@@ -526,7 +527,7 @@ export function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderTex
526
527
  }
527
528
  return {
528
529
  update: function update(editorView, prevState) {
529
- if (fg('platform_editor_ai_aifc_patch_beta_2') || fg('platform_editor_ai_aifc_patch_ga')) {
530
+ if (withEmptyParagraph) {
530
531
  var prevPluginState = getPlaceholderState(prevState);
531
532
  var newPluginState = getPlaceholderState(editorView.state);
532
533
 
@@ -67,7 +67,7 @@ export function createPlaceHolderStateFrom(_ref3) {
67
67
  isPlaceholderHidden = _ref3.isPlaceholderHidden,
68
68
  withEmptyParagraph = _ref3.withEmptyParagraph,
69
69
  showOnEmptyParagraph = _ref3.showOnEmptyParagraph;
70
- if (isPlaceholderHidden && fg('platform_editor_ai_aifc_patch_beta')) {
70
+ if (isPlaceholderHidden && withEmptyParagraph) {
71
71
  return _objectSpread(_objectSpread({}, emptyPlaceholder({
72
72
  placeholderText: defaultPlaceholderText,
73
73
  placeholderPrompts: placeholderPrompts,
@@ -92,7 +92,7 @@ export function createPlaceHolderStateFrom(_ref3) {
92
92
  userHadTyped: userHadTyped
93
93
  });
94
94
  }
95
- if (fg('platform_editor_ai_aifc_patch_beta_2') || fg('platform_editor_ai_aifc_patch_ga')) {
95
+ if (withEmptyParagraph) {
96
96
  var _editorState$selectio = editorState.selection,
97
97
  from = _editorState$selectio.from,
98
98
  to = _editorState$selectio.to,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-placeholder",
3
- "version": "6.6.0",
3
+ "version": "6.6.2",
4
4
  "description": "Placeholder plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,12 +34,12 @@
34
34
  "@atlaskit/editor-plugin-type-ahead": "^6.5.0",
35
35
  "@atlaskit/editor-prosemirror": "7.0.0",
36
36
  "@atlaskit/platform-feature-flags": "^1.1.0",
37
- "@atlaskit/tmp-editor-statsig": "^14.7.0",
37
+ "@atlaskit/tmp-editor-statsig": "^15.0.0",
38
38
  "@atlaskit/tokens": "^8.4.0",
39
39
  "@babel/runtime": "^7.0.0"
40
40
  },
41
41
  "peerDependencies": {
42
- "@atlaskit/editor-common": "^110.39.0",
42
+ "@atlaskit/editor-common": "^110.40.0",
43
43
  "react": "^18.2.0",
44
44
  "react-dom": "^18.2.0",
45
45
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -48,12 +48,6 @@
48
48
  "@testing-library/react": "^13.4.0"
49
49
  },
50
50
  "platform-feature-flags": {
51
- "platform_editor_ai_aifc_patch_beta": {
52
- "type": "boolean"
53
- },
54
- "platform_editor_ai_aifc_patch_beta_2": {
55
- "type": "boolean"
56
- },
57
51
  "platform_editor_ai_aifc_patch_ga": {
58
52
  "type": "boolean"
59
53
  },