@atlaskit/editor-core 187.37.4 → 187.37.6

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.
Files changed (69) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/labs/next/presets/default.js +2 -2
  3. package/dist/cjs/labs/next/presets/universal.js +2 -1
  4. package/dist/cjs/plugins/index.js +0 -7
  5. package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +2 -2
  6. package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -2
  7. package/dist/cjs/plugins/placeholder/index.js +5 -6
  8. package/dist/cjs/plugins/type-ahead/index.js +3 -0
  9. package/dist/cjs/ui/ContentStyles/index.js +25 -22
  10. package/dist/cjs/version-wrapper.js +1 -1
  11. package/dist/es2019/labs/next/presets/default.js +2 -2
  12. package/dist/es2019/labs/next/presets/universal.js +2 -1
  13. package/dist/es2019/plugins/index.js +0 -1
  14. package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +2 -2
  15. package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +2 -2
  16. package/dist/es2019/plugins/placeholder/index.js +5 -6
  17. package/dist/es2019/plugins/type-ahead/index.js +4 -1
  18. package/dist/es2019/ui/ContentStyles/index.js +35 -5
  19. package/dist/es2019/version-wrapper.js +1 -1
  20. package/dist/esm/labs/next/presets/default.js +2 -2
  21. package/dist/esm/labs/next/presets/universal.js +2 -1
  22. package/dist/esm/plugins/index.js +0 -1
  23. package/dist/esm/plugins/media/nodeviews/mediaGroup.js +2 -2
  24. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +2 -2
  25. package/dist/esm/plugins/placeholder/index.js +5 -6
  26. package/dist/esm/plugins/type-ahead/index.js +4 -1
  27. package/dist/esm/ui/ContentStyles/index.js +12 -10
  28. package/dist/esm/version-wrapper.js +1 -1
  29. package/dist/types/labs/next/presets/default.d.ts +52 -4
  30. package/dist/types/plugins/index.d.ts +0 -1
  31. package/dist/types/plugins/insert-block/types.d.ts +1 -1
  32. package/dist/types/plugins/placeholder/index.d.ts +7 -5
  33. package/dist/types/ui/ContentStyles/index.d.ts +1 -0
  34. package/dist/types-ts4.5/labs/next/presets/default.d.ts +60 -0
  35. package/dist/types-ts4.5/plugins/index.d.ts +0 -1
  36. package/dist/types-ts4.5/plugins/insert-block/types.d.ts +1 -1
  37. package/dist/types-ts4.5/plugins/placeholder/index.d.ts +9 -6
  38. package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +1 -0
  39. package/package.json +4 -3
  40. package/dist/cjs/plugins/placeholder/styles.js +0 -13
  41. package/dist/cjs/plugins/rule/commands.js +0 -22
  42. package/dist/cjs/plugins/rule/index.js +0 -80
  43. package/dist/cjs/plugins/rule/pm-plugins/input-rule.js +0 -76
  44. package/dist/cjs/plugins/rule/pm-plugins/keymap.js +0 -21
  45. package/dist/cjs/plugins/rule/styles.js +0 -16
  46. package/dist/es2019/plugins/placeholder/styles.js +0 -17
  47. package/dist/es2019/plugins/rule/commands.js +0 -11
  48. package/dist/es2019/plugins/rule/index.js +0 -71
  49. package/dist/es2019/plugins/rule/pm-plugins/input-rule.js +0 -73
  50. package/dist/es2019/plugins/rule/pm-plugins/keymap.js +0 -11
  51. package/dist/es2019/plugins/rule/styles.js +0 -20
  52. package/dist/esm/plugins/placeholder/styles.js +0 -5
  53. package/dist/esm/plugins/rule/commands.js +0 -15
  54. package/dist/esm/plugins/rule/index.js +0 -72
  55. package/dist/esm/plugins/rule/pm-plugins/input-rule.js +0 -67
  56. package/dist/esm/plugins/rule/pm-plugins/keymap.js +0 -13
  57. package/dist/esm/plugins/rule/styles.js +0 -8
  58. package/dist/types/plugins/placeholder/styles.d.ts +0 -1
  59. package/dist/types/plugins/rule/commands.d.ts +0 -3
  60. package/dist/types/plugins/rule/index.d.ts +0 -13
  61. package/dist/types/plugins/rule/pm-plugins/input-rule.d.ts +0 -9
  62. package/dist/types/plugins/rule/pm-plugins/keymap.d.ts +0 -5
  63. package/dist/types/plugins/rule/styles.d.ts +0 -2
  64. package/dist/types-ts4.5/plugins/placeholder/styles.d.ts +0 -1
  65. package/dist/types-ts4.5/plugins/rule/commands.d.ts +0 -3
  66. package/dist/types-ts4.5/plugins/rule/index.d.ts +0 -16
  67. package/dist/types-ts4.5/plugins/rule/pm-plugins/input-rule.d.ts +0 -9
  68. package/dist/types-ts4.5/plugins/rule/pm-plugins/keymap.d.ts +0 -5
  69. package/dist/types-ts4.5/plugins/rule/styles.d.ts +0 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 187.37.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`ef0c2a89c72`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ef0c2a89c72) - Add isTypeAheadOpen action to type-ahead plugin. Decouple placeholder plugin from editor-core.
8
+ - Updated dependencies
9
+
10
+ ## 187.37.5
11
+
12
+ ### Patch Changes
13
+
14
+ - [`1f6e908f2bd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1f6e908f2bd) - Workaround invalid getPos error occuring for TableComponent
15
+ - [`94662d7c5af`](https://bitbucket.org/atlassian/atlassian-frontend/commits/94662d7c5af) - Extracted rule plugin from editor-core to editor-plugin-rule.
16
+ - Updated dependencies
17
+
3
18
  ## 187.37.4
4
19
 
5
20
  ### Patch Changes
@@ -69,14 +69,14 @@ function createDefaultPreset(options) {
69
69
  return builder.add(p);
70
70
  }
71
71
  return builder;
72
- }).add([_blockType.default, options.blockType]).add([_placeholder.default, options.placeholder]).add(_clearMarksOnChangeToEmptyDocument.default).maybeAdd(_annotation.default, function (p, builder) {
72
+ }).add([_blockType.default, options.blockType]).add(_clearMarksOnChangeToEmptyDocument.default).maybeAdd(_annotation.default, function (p, builder) {
73
73
  if (options.annotationProviders) {
74
74
  return builder.add([p, options.annotationProviders]);
75
75
  }
76
76
  return builder;
77
77
  }).add([_editorPluginHyperlink.hyperlinkPlugin, options.hyperlinkOptions]).add([_editorPluginTextFormatting.textFormattingPlugin, options.textFormatting]).add(_editorPluginWidth.widthPlugin).add([_quickInsert.default, options.quickInsert]).add([_typeAhead.default, options.typeAhead || {
78
78
  createAnalyticsEvent: options.createAnalyticsEvent
79
- }]).add(_editorPluginUnsupportedContent.unsupportedContentPlugin).add(_editorPluginEditorDisabled.editorDisabledPlugin).add([_submitEditor.default, options.submitEditor]).add(_fakeTextCursor.default).add(_floatingToolbar.default).add([_selection.default, options.selection]).add([_codeBlock.default, options.codeBlock || {
79
+ }]).add([_placeholder.default, options.placeholder]).add(_editorPluginUnsupportedContent.unsupportedContentPlugin).add(_editorPluginEditorDisabled.editorDisabledPlugin).add([_submitEditor.default, options.submitEditor]).add(_fakeTextCursor.default).add(_floatingToolbar.default).add([_selection.default, options.selection]).add([_codeBlock.default, options.codeBlock || {
80
80
  appearance: 'full-page'
81
81
  }]);
82
82
  return preset;
@@ -9,6 +9,7 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _api = require("../../../selection-api/api");
11
11
  var _plugins = require("../../../plugins");
12
+ var _editorPluginRule = require("@atlaskit/editor-plugin-rule");
12
13
  var _editorPluginEmoji = require("@atlaskit/editor-plugin-emoji");
13
14
  var _editorPluginList = require("@atlaskit/editor-plugin-list");
14
15
  var _editorPluginImageUpload = require("@atlaskit/editor-plugin-image-upload");
@@ -74,7 +75,7 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
74
75
  return builder;
75
76
  }).add([_editorPluginList.listPlugin, {
76
77
  restartNumberedLists: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.restartNumberedLists
77
- }]).maybeAdd(_plugins.rulePlugin, function (plugin, builder) {
78
+ }]).maybeAdd(_editorPluginRule.rulePlugin, function (plugin, builder) {
78
79
  if (props.allowRule) {
79
80
  return builder.add(plugin);
80
81
  }
@@ -275,12 +275,6 @@ Object.defineProperty(exports, "quickInsertPlugin", {
275
275
  return _quickInsert.default;
276
276
  }
277
277
  });
278
- Object.defineProperty(exports, "rulePlugin", {
279
- enumerable: true,
280
- get: function get() {
281
- return _rule.default;
282
- }
283
- });
284
278
  Object.defineProperty(exports, "saveOnEnterPlugin", {
285
279
  enumerable: true,
286
280
  get: function get() {
@@ -369,7 +363,6 @@ var _panel = _interopRequireDefault(require("./panel"));
369
363
  var _paste = _interopRequireDefault(require("./paste"));
370
364
  var _placeholder = _interopRequireDefault(require("./placeholder"));
371
365
  var _placeholderText = _interopRequireDefault(require("./placeholder-text"));
372
- var _rule = _interopRequireDefault(require("./rule"));
373
366
  var _quickInsert = _interopRequireDefault(require("./quick-insert"));
374
367
  var _saveOnEnter = _interopRequireDefault(require("./save-on-enter"));
375
368
  var _submitEditor = _interopRequireDefault(require("./submit-editor"));
@@ -35,11 +35,11 @@ var isMediaGroupSelectedFromProps = function isMediaGroupSelectedFromProps(props
35
35
  /**
36
36
  * ED-19831
37
37
  * There is a getPos issue coming from this code. We need to apply this workaround for now and apply a patch
38
- * directly to confluence since this bug is now iun production.
38
+ * directly to confluence since this bug is now in production.
39
39
  */
40
40
  var pos;
41
41
  try {
42
- pos = typeof props.getPos === 'function' ? props.getPos() : undefined;
42
+ pos = props.getPos ? props.getPos() : undefined;
43
43
  } catch (e) {
44
44
  pos = undefined;
45
45
  }
@@ -473,11 +473,11 @@ var MediaSingleNodeView = /*#__PURE__*/function (_ReactNodeView) {
473
473
  /**
474
474
  * ED-19831
475
475
  * There is a getPos issue coming from this code. We need to apply this workaround for now and apply a patch
476
- * directly to confluence since this bug is now iun production.
476
+ * directly to confluence since this bug is now in production.
477
477
  */
478
478
  var pos;
479
479
  try {
480
- pos = typeof getPos === 'function' ? getPos() : undefined;
480
+ pos = getPos ? getPos() : undefined;
481
481
  } catch (e) {
482
482
  pos = undefined;
483
483
  }
@@ -10,7 +10,6 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
10
10
  var _utils = require("@atlaskit/editor-common/utils");
11
11
  var _state = require("@atlaskit/editor-prosemirror/state");
12
12
  var _view = require("@atlaskit/editor-prosemirror/view");
13
- var _utils2 = require("../type-ahead/utils");
14
13
  var pluginKey = new _state.PluginKey('placeholderPlugin');
15
14
  exports.pluginKey = pluginKey;
16
15
  function getPlaceholderState(editorState) {
@@ -60,8 +59,8 @@ function setPlaceHolderState(placeholderText, pos) {
60
59
  var emptyPlaceholder = {
61
60
  hasPlaceholder: false
62
61
  };
63
- function createPlaceHolderStateFrom(isEditorFocused, editorState, defaultPlaceholderText, bracketPlaceholderText) {
64
- if ((0, _utils2.isTypeAheadOpen)(editorState)) {
62
+ function createPlaceHolderStateFrom(isEditorFocused, editorState, isTypeAheadOpen, defaultPlaceholderText, bracketPlaceholderText) {
63
+ if (isTypeAheadOpen !== null && isTypeAheadOpen !== void 0 && isTypeAheadOpen(editorState)) {
65
64
  return emptyPlaceholder;
66
65
  }
67
66
  if (defaultPlaceholderText && (0, _utils.isEmptyDocument)(editorState.doc)) {
@@ -84,7 +83,7 @@ function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api) {
84
83
  state: {
85
84
  init: function init(_, state) {
86
85
  var _api$focus, _api$focus$sharedStat;
87
- return createPlaceHolderStateFrom(Boolean(api === null || api === void 0 ? void 0 : (_api$focus = api.focus) === null || _api$focus === void 0 ? void 0 : (_api$focus$sharedStat = _api$focus.sharedState.currentState()) === null || _api$focus$sharedStat === void 0 ? void 0 : _api$focus$sharedStat.hasFocus), state, defaultPlaceholderText, bracketPlaceholderText);
86
+ return createPlaceHolderStateFrom(Boolean(api === null || api === void 0 ? void 0 : (_api$focus = api.focus) === null || _api$focus === void 0 ? void 0 : (_api$focus$sharedStat = _api$focus.sharedState.currentState()) === null || _api$focus$sharedStat === void 0 ? void 0 : _api$focus$sharedStat.hasFocus), state, api === null || api === void 0 ? void 0 : api.typeAhead.actions.isOpen, defaultPlaceholderText, bracketPlaceholderText);
88
87
  },
89
88
  apply: function apply(tr, _oldPluginState, _oldEditorState, newEditorState) {
90
89
  var _api$focus2, _api$focus2$sharedSta;
@@ -95,10 +94,10 @@ function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api) {
95
94
  return emptyPlaceholder;
96
95
  }
97
96
  if (meta.applyPlaceholderIfEmpty) {
98
- return createPlaceHolderStateFrom(isEditorFocused, newEditorState, defaultPlaceholderText, bracketPlaceholderText);
97
+ return createPlaceHolderStateFrom(isEditorFocused, newEditorState, api === null || api === void 0 ? void 0 : api.typeAhead.actions.isOpen, defaultPlaceholderText, bracketPlaceholderText);
99
98
  }
100
99
  }
101
- return createPlaceHolderStateFrom(isEditorFocused, newEditorState, defaultPlaceholderText, bracketPlaceholderText);
100
+ return createPlaceHolderStateFrom(isEditorFocused, newEditorState, api === null || api === void 0 ? void 0 : api.typeAhead.actions.isOpen, defaultPlaceholderText, bracketPlaceholderText);
102
101
  }
103
102
  },
104
103
  props: {
@@ -173,6 +173,9 @@ var typeAheadPlugin = function typeAheadPlugin(_ref4) {
173
173
  commands: {
174
174
  openTypeAheadAtCursor: _openTypeaheadAtCursor.openTypeAheadAtCursor
175
175
  },
176
+ actions: {
177
+ isOpen: _utils.isTypeAheadOpen
178
+ },
176
179
  contentComponent: function contentComponent(_ref7) {
177
180
  var editorView = _ref7.editorView,
178
181
  containerElement = _ref7.containerElement,
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.linkStyles = exports.default = exports.createEditorContentStyle = void 0;
8
+ exports.placeholderStyles = exports.linkStyles = exports.default = exports.createEditorContentStyle = void 0;
9
9
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
  var _react2 = require("@emotion/react");
@@ -15,39 +15,42 @@ var _mention = require("@atlaskit/editor-common/mention");
15
15
  var _styles2 = require("../../plugins/collab-edit/styles");
16
16
  var _styles3 = require("../../plugins/selection/gap-cursor/styles");
17
17
  var _commonStyles = require("@atlaskit/editor-plugin-table/ui/common-styles");
18
- var _styles4 = require("../../plugins/placeholder/styles");
19
- var _styles5 = require("../../plugins/block-type/styles");
20
- var _styles6 = require("../../plugins/code-block/styles");
21
- var _styles7 = require("../../plugins/rule/styles");
22
- var _styles8 = require("../../plugins/media/styles");
23
- var _styles9 = require("../../plugins/layout/styles");
24
- var _styles10 = require("../../plugins/panel/styles");
25
- var _styles11 = require("../../plugins/fake-text-cursor/styles");
26
- var _styles12 = require("../../plugins/placeholder-text/styles");
27
- var _styles13 = require("../../plugins/extension/ui/styles");
28
- var _styles14 = require("../../plugins/expand/ui/styles");
18
+ var _styles4 = require("../../plugins/block-type/styles");
19
+ var _styles5 = require("../../plugins/code-block/styles");
20
+ var _styles6 = require("../../plugins/media/styles");
21
+ var _styles7 = require("../../plugins/layout/styles");
22
+ var _styles8 = require("../../plugins/panel/styles");
23
+ var _styles9 = require("../../plugins/fake-text-cursor/styles");
24
+ var _styles10 = require("../../plugins/placeholder-text/styles");
25
+ var _styles11 = require("../../plugins/extension/ui/styles");
26
+ var _styles12 = require("../../plugins/expand/ui/styles");
29
27
  var _style = require("../../plugins/media/pm-plugins/alt-text/style");
30
- var _styles15 = require("../../plugins/find-replace/styles");
31
- var _styles16 = require("../../plugins/tasks-and-decisions/styles");
32
- var _styles17 = require("../../plugins/status/styles");
33
- var _styles18 = require("../../plugins/date/styles");
28
+ var _styles13 = require("../../plugins/find-replace/styles");
29
+ var _styles14 = require("../../plugins/tasks-and-decisions/styles");
30
+ var _styles15 = require("../../plugins/status/styles");
31
+ var _styles16 = require("../../plugins/date/styles");
34
32
  var _getInlineNodeViewProducer = require("../../nodeviews/getInlineNodeViewProducer.styles");
35
33
  var _utils = require("@atlaskit/editor-common/utils");
36
34
  var _emoji = require("@atlaskit/editor-common/emoji");
37
35
  var _colors = require("@atlaskit/theme/colors");
38
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
36
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
39
37
  /** @jsx jsx */
40
38
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
41
39
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
42
40
  var linkStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n ", "\n }\n"])), _styles.linkSharedStyle);
43
41
  exports.linkStyles = linkStyles;
44
- var mentionsStyles = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n &.", " [data-mention-id] > span {\n ", "\n\n /* need to specify dark text colour because personal mentions\n (in dark blue) have white text by default */\n color: ", ";\n }\n }\n\n .danger {\n .", ".", "\n > span\n > span\n > span {\n box-shadow: 0 0 0 ", "px ", ";\n background-color: ", ";\n }\n .", " > span > span > span {\n background-color: ", ";\n color: ", ";\n }\n }\n"])), _mention.MentionSharedCssClassName.MENTION_CONTAINER, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow, _editorSharedStyles.SelectionStyle.Background]), "var(--ds-text-subtle, ".concat(_colors.N500, ")"), _mention.MentionSharedCssClassName.MENTION_CONTAINER, _editorSharedStyles.akEditorSelectedNodeClassName, _editorSharedStyles.akEditorSelectedBorderSize, _editorSharedStyles.akEditorDeleteBorder, "var(--ds-background-danger, ".concat(_editorSharedStyles.akEditorDeleteBackgroundWithOpacity, ")"), _mention.MentionSharedCssClassName.MENTION_CONTAINER, "var(--ds-background-neutral, ".concat(_colors.N30A, ")"), "var(--ds-text-subtle, ".concat(_colors.N500, ")"));
45
- var listsStyles = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n li {\n position: relative;\n\n > p:not(:first-child) {\n margin: ", " 0 0 0;\n }\n\n // In SSR the above rule will apply to all p tags because first-child would be a style tag.\n // The following rule resets the first p tag back to its original margin\n // defined in packages/editor/editor-common/src/styles/shared/paragraph.ts\n > style:first-child + p {\n margin-top: ", ";\n }\n }\n\n & :not([data-node-type='decisionList']) > li {\n ", "\n }\n }\n"])), "var(--ds-space-050, 4px)", _editorSharedStyles.blockNodesVerticalMargin, _utils.browser.safari ? _styles.codeBlockInListSafariFix : '');
46
- var emojiStyles = (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n display: inline-block;\n\n .", " {\n cursor: pointer;\n\n &.", " > span {\n /** needed for selection style to cover custom emoji image properly */\n display: flex;\n }\n }\n\n &.", " {\n .", ",\n .", " {\n border-radius: 2px;\n ", "\n }\n }\n }\n"])), _emoji.EmojiSharedCssClassName.EMOJI_CONTAINER, _emoji.EmojiSharedCssClassName.EMOJI_NODE, _emoji.EmojiSharedCssClassName.EMOJI_IMAGE, _editorSharedStyles.akEditorSelectedNodeClassName, _emoji.EmojiSharedCssClassName.EMOJI_SPRITE, _emoji.EmojiSharedCssClassName.EMOJI_IMAGE, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket, _editorSharedStyles.SelectionStyle.BoxShadow]));
42
+ var ruleStyles = function ruleStyles(props) {
43
+ return (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n ", ";\n\n hr {\n cursor: pointer;\n padding: ", " 0;\n margin: calc(", "em - 4px) 0;\n background-clip: content-box;\n\n &.", " {\n outline: none;\n background-color: ", ";\n }\n }\n }\n"])), (0, _styles.ruleSharedStyles)(props), "var(--ds-space-050, 4px)", _editorSharedStyles.akEditorLineHeight, _editorSharedStyles.akEditorSelectedNodeClassName, "var(--ds-border-selected, ".concat(_editorSharedStyles.akEditorSelectedBorderColor, ")"));
44
+ };
45
+ var mentionsStyles = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n &.", " [data-mention-id] > span {\n ", "\n\n /* need to specify dark text colour because personal mentions\n (in dark blue) have white text by default */\n color: ", ";\n }\n }\n\n .danger {\n .", ".", "\n > span\n > span\n > span {\n box-shadow: 0 0 0 ", "px ", ";\n background-color: ", ";\n }\n .", " > span > span > span {\n background-color: ", ";\n color: ", ";\n }\n }\n"])), _mention.MentionSharedCssClassName.MENTION_CONTAINER, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow, _editorSharedStyles.SelectionStyle.Background]), "var(--ds-text-subtle, ".concat(_colors.N500, ")"), _mention.MentionSharedCssClassName.MENTION_CONTAINER, _editorSharedStyles.akEditorSelectedNodeClassName, _editorSharedStyles.akEditorSelectedBorderSize, _editorSharedStyles.akEditorDeleteBorder, "var(--ds-background-danger, ".concat(_editorSharedStyles.akEditorDeleteBackgroundWithOpacity, ")"), _mention.MentionSharedCssClassName.MENTION_CONTAINER, "var(--ds-background-neutral, ".concat(_colors.N30A, ")"), "var(--ds-text-subtle, ".concat(_colors.N500, ")"));
46
+ var listsStyles = (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n li {\n position: relative;\n\n > p:not(:first-child) {\n margin: ", " 0 0 0;\n }\n\n // In SSR the above rule will apply to all p tags because first-child would be a style tag.\n // The following rule resets the first p tag back to its original margin\n // defined in packages/editor/editor-common/src/styles/shared/paragraph.ts\n > style:first-child + p {\n margin-top: ", ";\n }\n }\n\n & :not([data-node-type='decisionList']) > li {\n ", "\n }\n }\n"])), "var(--ds-space-050, 4px)", _editorSharedStyles.blockNodesVerticalMargin, _utils.browser.safari ? _styles.codeBlockInListSafariFix : '');
47
+ var emojiStyles = (0, _react2.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n display: inline-block;\n\n .", " {\n cursor: pointer;\n\n &.", " > span {\n /** needed for selection style to cover custom emoji image properly */\n display: flex;\n }\n }\n\n &.", " {\n .", ",\n .", " {\n border-radius: 2px;\n ", "\n }\n }\n }\n"])), _emoji.EmojiSharedCssClassName.EMOJI_CONTAINER, _emoji.EmojiSharedCssClassName.EMOJI_NODE, _emoji.EmojiSharedCssClassName.EMOJI_IMAGE, _editorSharedStyles.akEditorSelectedNodeClassName, _emoji.EmojiSharedCssClassName.EMOJI_SPRITE, _emoji.EmojiSharedCssClassName.EMOJI_IMAGE, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket, _editorSharedStyles.SelectionStyle.BoxShadow]));
48
+ var placeholderStyles = (0, _react2.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror .placeholder-decoration {\n color: ", ";\n width: 100%;\n pointer-events: none;\n user-select: none;\n\n .placeholder-android {\n pointer-events: none;\n outline: none;\n user-select: none;\n position: absolute;\n }\n }\n"])), "var(--ds-text-subtlest, ".concat(_colors.N200, ")"));
49
+ exports.placeholderStyles = placeholderStyles;
47
50
  var contentStyles = function contentStyles(props) {
48
- return (0, _react2.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid ", ";\n }\n\n ", "\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap :not(.fabric-editor-alignment),\n .pm-table-header-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark,\n .pm-table-cell-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark {\n p:first-of-type {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), (0, _editorSharedStyles.editorFontSize)({
51
+ return (0, _react2.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid ", ";\n }\n\n ", "\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap :not(.fabric-editor-alignment),\n .pm-table-header-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark,\n .pm-table-cell-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark {\n p:first-of-type {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), (0, _editorSharedStyles.editorFontSize)({
49
52
  theme: props.theme
50
- }), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles12.placeholderTextStyles, _styles4.placeholderStyles, (0, _styles6.codeBlockStyles)(props), (0, _styles5.blocktypeStyles)(props), (0, _styles.codeMarkSharedStyles)(props), _styles.textColorStyles, listsStyles, (0, _styles7.ruleStyles)(props), _styles8.mediaStyles, (0, _styles9.layoutStyles)(props), _styles2.telepointerStyle, _styles3.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _styles10.panelStyles)(props), _styles11.fakeCursorStyles, mentionsStyles, emojiStyles, _styles.tasksAndDecisionsStyles, _styles.gridStyles, linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _styles13.extensionStyles, (0, _styles14.expandStyles)(props), _styles15.findReplaceStyles, _styles16.taskDecisionStyles, _styles17.statusStyles, (0, _styles.annotationSharedStyles)(props), _styles.smartCardStyles, _styles.smartCardSharedStyles, _styles18.dateStyles, _styles.embedCardStyles, _styles.unsupportedStyles, _styles.resizerStyles, _style.ClassNames.FLOATING_TOOLBAR_COMPONENT);
53
+ }), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles10.placeholderTextStyles, placeholderStyles, (0, _styles5.codeBlockStyles)(props), (0, _styles4.blocktypeStyles)(props), (0, _styles.codeMarkSharedStyles)(props), _styles.textColorStyles, listsStyles, ruleStyles(props), _styles6.mediaStyles, (0, _styles7.layoutStyles)(props), _styles2.telepointerStyle, _styles3.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _styles8.panelStyles)(props), _styles9.fakeCursorStyles, mentionsStyles, emojiStyles, _styles.tasksAndDecisionsStyles, _styles.gridStyles, linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _styles11.extensionStyles, (0, _styles12.expandStyles)(props), _styles13.findReplaceStyles, _styles14.taskDecisionStyles, _styles15.statusStyles, (0, _styles.annotationSharedStyles)(props), _styles.smartCardStyles, _styles.smartCardSharedStyles, _styles16.dateStyles, _styles.embedCardStyles, _styles.unsupportedStyles, _styles.resizerStyles, _style.ClassNames.FLOATING_TOOLBAR_COMPONENT);
51
54
  };
52
55
  var createEditorContentStyle = function createEditorContentStyle(styles) {
53
56
  return /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = "@atlaskit/editor-core";
8
8
  exports.name = name;
9
- var version = "187.37.4";
9
+ var version = "187.37.6";
10
10
  exports.version = version;
11
11
  var nextMajorVersion = function nextMajorVersion() {
12
12
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
@@ -65,14 +65,14 @@ export function createDefaultPreset(options) {
65
65
  return builder.add(p);
66
66
  }
67
67
  return builder;
68
- }).add([blockTypePlugin, options.blockType]).add([placeholderPlugin, options.placeholder]).add(clearMarksOnChangeToEmptyDocumentPlugin).maybeAdd(annotationPlugin, (p, builder) => {
68
+ }).add([blockTypePlugin, options.blockType]).add(clearMarksOnChangeToEmptyDocumentPlugin).maybeAdd(annotationPlugin, (p, builder) => {
69
69
  if (options.annotationProviders) {
70
70
  return builder.add([p, options.annotationProviders]);
71
71
  }
72
72
  return builder;
73
73
  }).add([hyperlinkPlugin, options.hyperlinkOptions]).add([textFormattingPlugin, options.textFormatting]).add(widthPlugin).add([quickInsertPlugin, options.quickInsert]).add([typeAheadPlugin, options.typeAhead || {
74
74
  createAnalyticsEvent: options.createAnalyticsEvent
75
- }]).add(unsupportedContentPlugin).add(editorDisabledPlugin).add([submitEditorPlugin, options.submitEditor]).add(fakeTextCursorPlugin).add(floatingToolbarPlugin).add([selectionPlugin, options.selection]).add([codeBlockPlugin, options.codeBlock || {
75
+ }]).add([placeholderPlugin, options.placeholder]).add(unsupportedContentPlugin).add(editorDisabledPlugin).add([submitEditorPlugin, options.submitEditor]).add(fakeTextCursorPlugin).add(floatingToolbarPlugin).add([selectionPlugin, options.selection]).add([codeBlockPlugin, options.codeBlock || {
76
76
  appearance: 'full-page'
77
77
  }]);
78
78
  return preset;
@@ -1,5 +1,6 @@
1
1
  import { createEditorSelectionAPI } from '../../../selection-api/api';
2
- import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, extensionPlugin, fragmentMarkPlugin, helpDialogPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tasksAndDecisionsPlugin, textColorPlugin, statusPlugin, alignmentPlugin, indentationPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin, copyButtonPlugin, borderPlugin } from '../../../plugins';
2
+ import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, extensionPlugin, fragmentMarkPlugin, helpDialogPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, saveOnEnterPlugin, tasksAndDecisionsPlugin, textColorPlugin, statusPlugin, alignmentPlugin, indentationPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin, copyButtonPlugin, borderPlugin } from '../../../plugins';
3
+ import { rulePlugin } from '@atlaskit/editor-plugin-rule';
3
4
  import { emojiPlugin } from '@atlaskit/editor-plugin-emoji';
4
5
  import { listPlugin } from '@atlaskit/editor-plugin-list';
5
6
  import { imageUploadPlugin } from '@atlaskit/editor-plugin-image-upload';
@@ -20,7 +20,6 @@ export { default as panelPlugin } from './panel';
20
20
  export { default as pastePlugin } from './paste';
21
21
  export { default as placeholderPlugin } from './placeholder';
22
22
  export { default as placeholderTextPlugin } from './placeholder-text';
23
- export { default as rulePlugin } from './rule';
24
23
  export { default as quickInsertPlugin } from './quick-insert';
25
24
  export { default as saveOnEnterPlugin } from './save-on-enter';
26
25
  export { default as submitEditorPlugin } from './submit-editor';
@@ -16,11 +16,11 @@ const isMediaGroupSelectedFromProps = props => {
16
16
  /**
17
17
  * ED-19831
18
18
  * There is a getPos issue coming from this code. We need to apply this workaround for now and apply a patch
19
- * directly to confluence since this bug is now iun production.
19
+ * directly to confluence since this bug is now in production.
20
20
  */
21
21
  let pos;
22
22
  try {
23
- pos = typeof props.getPos === 'function' ? props.getPos() : undefined;
23
+ pos = props.getPos ? props.getPos() : undefined;
24
24
  } catch (e) {
25
25
  pos = undefined;
26
26
  }
@@ -377,11 +377,11 @@ class MediaSingleNodeView extends ReactNodeView {
377
377
  /**
378
378
  * ED-19831
379
379
  * There is a getPos issue coming from this code. We need to apply this workaround for now and apply a patch
380
- * directly to confluence since this bug is now iun production.
380
+ * directly to confluence since this bug is now in production.
381
381
  */
382
382
  let pos;
383
383
  try {
384
- pos = typeof getPos === 'function' ? getPos() : undefined;
384
+ pos = getPos ? getPos() : undefined;
385
385
  } catch (e) {
386
386
  pos = undefined;
387
387
  }
@@ -3,7 +3,6 @@ import { browser, isEmptyDocument, bracketTyped } from '@atlaskit/editor-common/
3
3
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
4
4
  import { DecorationSet, Decoration } from '@atlaskit/editor-prosemirror/view';
5
5
  export const pluginKey = new PluginKey('placeholderPlugin');
6
- import { isTypeAheadOpen } from '../type-ahead/utils';
7
6
  function getPlaceholderState(editorState) {
8
7
  return pluginKey.getState(editorState);
9
8
  }
@@ -49,8 +48,8 @@ function setPlaceHolderState(placeholderText, pos) {
49
48
  const emptyPlaceholder = {
50
49
  hasPlaceholder: false
51
50
  };
52
- function createPlaceHolderStateFrom(isEditorFocused, editorState, defaultPlaceholderText, bracketPlaceholderText) {
53
- if (isTypeAheadOpen(editorState)) {
51
+ function createPlaceHolderStateFrom(isEditorFocused, editorState, isTypeAheadOpen, defaultPlaceholderText, bracketPlaceholderText) {
52
+ if (isTypeAheadOpen !== null && isTypeAheadOpen !== void 0 && isTypeAheadOpen(editorState)) {
54
53
  return emptyPlaceholder;
55
54
  }
56
55
  if (defaultPlaceholderText && isEmptyDocument(editorState.doc)) {
@@ -75,7 +74,7 @@ export function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api
75
74
  state: {
76
75
  init: (_, state) => {
77
76
  var _api$focus, _api$focus$sharedStat;
78
- return createPlaceHolderStateFrom(Boolean(api === null || api === void 0 ? void 0 : (_api$focus = api.focus) === null || _api$focus === void 0 ? void 0 : (_api$focus$sharedStat = _api$focus.sharedState.currentState()) === null || _api$focus$sharedStat === void 0 ? void 0 : _api$focus$sharedStat.hasFocus), state, defaultPlaceholderText, bracketPlaceholderText);
77
+ return createPlaceHolderStateFrom(Boolean(api === null || api === void 0 ? void 0 : (_api$focus = api.focus) === null || _api$focus === void 0 ? void 0 : (_api$focus$sharedStat = _api$focus.sharedState.currentState()) === null || _api$focus$sharedStat === void 0 ? void 0 : _api$focus$sharedStat.hasFocus), state, api === null || api === void 0 ? void 0 : api.typeAhead.actions.isOpen, defaultPlaceholderText, bracketPlaceholderText);
79
78
  },
80
79
  apply: (tr, _oldPluginState, _oldEditorState, newEditorState) => {
81
80
  var _api$focus2, _api$focus2$sharedSta;
@@ -86,10 +85,10 @@ export function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api
86
85
  return emptyPlaceholder;
87
86
  }
88
87
  if (meta.applyPlaceholderIfEmpty) {
89
- return createPlaceHolderStateFrom(isEditorFocused, newEditorState, defaultPlaceholderText, bracketPlaceholderText);
88
+ return createPlaceHolderStateFrom(isEditorFocused, newEditorState, api === null || api === void 0 ? void 0 : api.typeAhead.actions.isOpen, defaultPlaceholderText, bracketPlaceholderText);
90
89
  }
91
90
  }
92
- return createPlaceHolderStateFrom(isEditorFocused, newEditorState, defaultPlaceholderText, bracketPlaceholderText);
91
+ return createPlaceHolderStateFrom(isEditorFocused, newEditorState, api === null || api === void 0 ? void 0 : api.typeAhead.actions.isOpen, defaultPlaceholderText, bracketPlaceholderText);
93
92
  }
94
93
  },
95
94
  props: {
@@ -15,7 +15,7 @@ import { typeAheadQuery } from '@atlaskit/adf-schema';
15
15
  import { pluginKey as typeAheadPluginKey } from './pm-plugins/key';
16
16
  import { inputRulePlugin } from './pm-plugins/input-rules';
17
17
  import { TypeAheadPopup } from './ui/TypeAheadPopup';
18
- import { getPluginState } from './utils';
18
+ import { getPluginState, isTypeAheadOpen } from './utils';
19
19
  import { useItemInsert } from './ui/hooks/use-item-insert';
20
20
  import { updateSelectedIndex } from './commands/update-selected-index';
21
21
  import { StatsModifier } from './stats-modifier';
@@ -155,6 +155,9 @@ const typeAheadPlugin = ({
155
155
  commands: {
156
156
  openTypeAheadAtCursor
157
157
  },
158
+ actions: {
159
+ isOpen: isTypeAheadOpen
160
+ },
158
161
  contentComponent({
159
162
  editorView,
160
163
  containerElement,
@@ -2,15 +2,13 @@
2
2
  import React, { useMemo } from 'react';
3
3
  import { jsx, css, useTheme } from '@emotion/react';
4
4
  import { whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, shadowSharedStyle, dateSharedStyle, tasksAndDecisionsStyles, annotationSharedStyles, smartCardSharedStyles, textColorStyles, resizerStyles, gridStyles, smartCardStyles, embedCardStyles, codeBlockInListSafariFix, unsupportedStyles } from '@atlaskit/editor-common/styles';
5
- import { akEditorSelectedBorderSize, akEditorDeleteBorder, akEditorDeleteBackgroundWithOpacity, akEditorSelectedNodeClassName, blockNodesVerticalMargin, editorFontSize, getSelectionStyles, SelectionStyle } from '@atlaskit/editor-shared-styles';
5
+ import { akEditorSelectedBorderSize, akEditorDeleteBorder, akEditorDeleteBackgroundWithOpacity, akEditorSelectedNodeClassName, blockNodesVerticalMargin, editorFontSize, getSelectionStyles, SelectionStyle, akEditorLineHeight, akEditorSelectedBorderColor } from '@atlaskit/editor-shared-styles';
6
6
  import { MentionSharedCssClassName } from '@atlaskit/editor-common/mention';
7
7
  import { telepointerStyle } from '../../plugins/collab-edit/styles';
8
8
  import { gapCursorStyles } from '../../plugins/selection/gap-cursor/styles';
9
9
  import { tableStyles } from '@atlaskit/editor-plugin-table/ui/common-styles';
10
- import { placeholderStyles } from '../../plugins/placeholder/styles';
11
10
  import { blocktypeStyles } from '../../plugins/block-type/styles';
12
11
  import { codeBlockStyles } from '../../plugins/code-block/styles';
13
- import { ruleStyles } from '../../plugins/rule/styles';
14
12
  import { mediaStyles } from '../../plugins/media/styles';
15
13
  import { layoutStyles } from '../../plugins/layout/styles';
16
14
  import { panelStyles } from '../../plugins/panel/styles';
@@ -24,15 +22,32 @@ import { taskDecisionStyles } from '../../plugins/tasks-and-decisions/styles';
24
22
  import { statusStyles } from '../../plugins/status/styles';
25
23
  import { dateStyles } from '../../plugins/date/styles';
26
24
  import { InlineNodeViewSharedStyles } from '../../nodeviews/getInlineNodeViewProducer.styles';
27
- import { linkSharedStyle, codeMarkSharedStyles } from '@atlaskit/editor-common/styles';
25
+ import { linkSharedStyle, codeMarkSharedStyles, ruleSharedStyles } from '@atlaskit/editor-common/styles';
28
26
  import { browser } from '@atlaskit/editor-common/utils';
29
27
  import { EmojiSharedCssClassName } from '@atlaskit/editor-common/emoji';
30
- import { N500, N30A } from '@atlaskit/theme/colors';
28
+ import { N500, N30A, N200 } from '@atlaskit/theme/colors';
31
29
  export const linkStyles = css`
32
30
  .ProseMirror {
33
31
  ${linkSharedStyle}
34
32
  }
35
33
  `;
34
+ const ruleStyles = props => css`
35
+ .ProseMirror {
36
+ ${ruleSharedStyles(props)};
37
+
38
+ hr {
39
+ cursor: pointer;
40
+ padding: ${"var(--ds-space-050, 4px)"} 0;
41
+ margin: calc(${akEditorLineHeight}em - 4px) 0;
42
+ background-clip: content-box;
43
+
44
+ &.${akEditorSelectedNodeClassName} {
45
+ outline: none;
46
+ background-color: ${`var(--ds-border-selected, ${akEditorSelectedBorderColor})`};
47
+ }
48
+ }
49
+ }
50
+ `;
36
51
  const mentionsStyles = css`
37
52
  .${MentionSharedCssClassName.MENTION_CONTAINER} {
38
53
  &.${akEditorSelectedNodeClassName} [data-mention-id] > span {
@@ -102,6 +117,21 @@ const emojiStyles = css`
102
117
  }
103
118
  }
104
119
  `;
120
+ export const placeholderStyles = css`
121
+ .ProseMirror .placeholder-decoration {
122
+ color: ${`var(--ds-text-subtlest, ${N200})`};
123
+ width: 100%;
124
+ pointer-events: none;
125
+ user-select: none;
126
+
127
+ .placeholder-android {
128
+ pointer-events: none;
129
+ outline: none;
130
+ user-select: none;
131
+ position: absolute;
132
+ }
133
+ }
134
+ `;
105
135
  const contentStyles = props => css`
106
136
  .ProseMirror {
107
137
  outline: none;
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "187.37.4";
2
+ export const version = "187.37.6";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -61,14 +61,14 @@ export function createDefaultPreset(options) {
61
61
  return builder.add(p);
62
62
  }
63
63
  return builder;
64
- }).add([blockTypePlugin, options.blockType]).add([placeholderPlugin, options.placeholder]).add(clearMarksOnChangeToEmptyDocumentPlugin).maybeAdd(annotationPlugin, function (p, builder) {
64
+ }).add([blockTypePlugin, options.blockType]).add(clearMarksOnChangeToEmptyDocumentPlugin).maybeAdd(annotationPlugin, function (p, builder) {
65
65
  if (options.annotationProviders) {
66
66
  return builder.add([p, options.annotationProviders]);
67
67
  }
68
68
  return builder;
69
69
  }).add([hyperlinkPlugin, options.hyperlinkOptions]).add([textFormattingPlugin, options.textFormatting]).add(widthPlugin).add([quickInsertPlugin, options.quickInsert]).add([typeAheadPlugin, options.typeAhead || {
70
70
  createAnalyticsEvent: options.createAnalyticsEvent
71
- }]).add(unsupportedContentPlugin).add(editorDisabledPlugin).add([submitEditorPlugin, options.submitEditor]).add(fakeTextCursorPlugin).add(floatingToolbarPlugin).add([selectionPlugin, options.selection]).add([codeBlockPlugin, options.codeBlock || {
71
+ }]).add([placeholderPlugin, options.placeholder]).add(unsupportedContentPlugin).add(editorDisabledPlugin).add([submitEditorPlugin, options.submitEditor]).add(fakeTextCursorPlugin).add(floatingToolbarPlugin).add([selectionPlugin, options.selection]).add([codeBlockPlugin, options.codeBlock || {
72
72
  appearance: 'full-page'
73
73
  }]);
74
74
  return preset;
@@ -3,7 +3,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
4
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
5
  import { createEditorSelectionAPI } from '../../../selection-api/api';
6
- import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, extensionPlugin, fragmentMarkPlugin, helpDialogPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tasksAndDecisionsPlugin, textColorPlugin, statusPlugin, alignmentPlugin, indentationPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin, copyButtonPlugin, borderPlugin } from '../../../plugins';
6
+ import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, extensionPlugin, fragmentMarkPlugin, helpDialogPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, saveOnEnterPlugin, tasksAndDecisionsPlugin, textColorPlugin, statusPlugin, alignmentPlugin, indentationPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin, copyButtonPlugin, borderPlugin } from '../../../plugins';
7
+ import { rulePlugin } from '@atlaskit/editor-plugin-rule';
7
8
  import { emojiPlugin } from '@atlaskit/editor-plugin-emoji';
8
9
  import { listPlugin } from '@atlaskit/editor-plugin-list';
9
10
  import { imageUploadPlugin } from '@atlaskit/editor-plugin-image-upload';
@@ -20,7 +20,6 @@ export { default as panelPlugin } from './panel';
20
20
  export { default as pastePlugin } from './paste';
21
21
  export { default as placeholderPlugin } from './placeholder';
22
22
  export { default as placeholderTextPlugin } from './placeholder-text';
23
- export { default as rulePlugin } from './rule';
24
23
  export { default as quickInsertPlugin } from './quick-insert';
25
24
  export { default as saveOnEnterPlugin } from './save-on-enter';
26
25
  export { default as submitEditorPlugin } from './submit-editor';
@@ -28,11 +28,11 @@ var isMediaGroupSelectedFromProps = function isMediaGroupSelectedFromProps(props
28
28
  /**
29
29
  * ED-19831
30
30
  * There is a getPos issue coming from this code. We need to apply this workaround for now and apply a patch
31
- * directly to confluence since this bug is now iun production.
31
+ * directly to confluence since this bug is now in production.
32
32
  */
33
33
  var pos;
34
34
  try {
35
- pos = typeof props.getPos === 'function' ? props.getPos() : undefined;
35
+ pos = props.getPos ? props.getPos() : undefined;
36
36
  } catch (e) {
37
37
  pos = undefined;
38
38
  }
@@ -464,11 +464,11 @@ var MediaSingleNodeView = /*#__PURE__*/function (_ReactNodeView) {
464
464
  /**
465
465
  * ED-19831
466
466
  * There is a getPos issue coming from this code. We need to apply this workaround for now and apply a patch
467
- * directly to confluence since this bug is now iun production.
467
+ * directly to confluence since this bug is now in production.
468
468
  */
469
469
  var pos;
470
470
  try {
471
- pos = typeof getPos === 'function' ? getPos() : undefined;
471
+ pos = getPos ? getPos() : undefined;
472
472
  } catch (e) {
473
473
  pos = undefined;
474
474
  }
@@ -3,7 +3,6 @@ import { browser, isEmptyDocument, bracketTyped } from '@atlaskit/editor-common/
3
3
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
4
4
  import { DecorationSet, Decoration } from '@atlaskit/editor-prosemirror/view';
5
5
  export var pluginKey = new PluginKey('placeholderPlugin');
6
- import { isTypeAheadOpen } from '../type-ahead/utils';
7
6
  function getPlaceholderState(editorState) {
8
7
  return pluginKey.getState(editorState);
9
8
  }
@@ -50,8 +49,8 @@ function setPlaceHolderState(placeholderText, pos) {
50
49
  var emptyPlaceholder = {
51
50
  hasPlaceholder: false
52
51
  };
53
- function createPlaceHolderStateFrom(isEditorFocused, editorState, defaultPlaceholderText, bracketPlaceholderText) {
54
- if (isTypeAheadOpen(editorState)) {
52
+ function createPlaceHolderStateFrom(isEditorFocused, editorState, isTypeAheadOpen, defaultPlaceholderText, bracketPlaceholderText) {
53
+ if (isTypeAheadOpen !== null && isTypeAheadOpen !== void 0 && isTypeAheadOpen(editorState)) {
55
54
  return emptyPlaceholder;
56
55
  }
57
56
  if (defaultPlaceholderText && isEmptyDocument(editorState.doc)) {
@@ -74,7 +73,7 @@ export function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api
74
73
  state: {
75
74
  init: function init(_, state) {
76
75
  var _api$focus, _api$focus$sharedStat;
77
- return createPlaceHolderStateFrom(Boolean(api === null || api === void 0 ? void 0 : (_api$focus = api.focus) === null || _api$focus === void 0 ? void 0 : (_api$focus$sharedStat = _api$focus.sharedState.currentState()) === null || _api$focus$sharedStat === void 0 ? void 0 : _api$focus$sharedStat.hasFocus), state, defaultPlaceholderText, bracketPlaceholderText);
76
+ return createPlaceHolderStateFrom(Boolean(api === null || api === void 0 ? void 0 : (_api$focus = api.focus) === null || _api$focus === void 0 ? void 0 : (_api$focus$sharedStat = _api$focus.sharedState.currentState()) === null || _api$focus$sharedStat === void 0 ? void 0 : _api$focus$sharedStat.hasFocus), state, api === null || api === void 0 ? void 0 : api.typeAhead.actions.isOpen, defaultPlaceholderText, bracketPlaceholderText);
78
77
  },
79
78
  apply: function apply(tr, _oldPluginState, _oldEditorState, newEditorState) {
80
79
  var _api$focus2, _api$focus2$sharedSta;
@@ -85,10 +84,10 @@ export function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api
85
84
  return emptyPlaceholder;
86
85
  }
87
86
  if (meta.applyPlaceholderIfEmpty) {
88
- return createPlaceHolderStateFrom(isEditorFocused, newEditorState, defaultPlaceholderText, bracketPlaceholderText);
87
+ return createPlaceHolderStateFrom(isEditorFocused, newEditorState, api === null || api === void 0 ? void 0 : api.typeAhead.actions.isOpen, defaultPlaceholderText, bracketPlaceholderText);
89
88
  }
90
89
  }
91
- return createPlaceHolderStateFrom(isEditorFocused, newEditorState, defaultPlaceholderText, bracketPlaceholderText);
90
+ return createPlaceHolderStateFrom(isEditorFocused, newEditorState, api === null || api === void 0 ? void 0 : api.typeAhead.actions.isOpen, defaultPlaceholderText, bracketPlaceholderText);
92
91
  }
93
92
  },
94
93
  props: {