@atlaskit/editor-core 151.0.0 → 151.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/cjs/create-editor/create-plugins-list.js +4 -0
  3. package/dist/cjs/plugins/code-bidi-warning/index.js +25 -0
  4. package/dist/cjs/plugins/code-bidi-warning/plugin-key.js +11 -0
  5. package/dist/cjs/plugins/code-bidi-warning/pm-plugins/main.js +43 -0
  6. package/dist/cjs/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +118 -0
  7. package/dist/cjs/plugins/code-bidi-warning/pm-plugins/reducer.js +12 -0
  8. package/dist/cjs/plugins/code-bidi-warning/pm-plugins/types.js +5 -0
  9. package/dist/cjs/plugins/code-block/index.js +10 -6
  10. package/dist/cjs/plugins/code-block/nodeviews/highlighting-code-block.js +16 -5
  11. package/dist/cjs/plugins/code-block/pm-plugins/main.js +12 -3
  12. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
  13. package/dist/cjs/plugins/index.js +8 -0
  14. package/dist/cjs/plugins/rank.js +1 -1
  15. package/dist/cjs/version-wrapper.js +1 -1
  16. package/dist/cjs/version.json +1 -1
  17. package/dist/es2019/create-editor/create-plugins-list.js +5 -1
  18. package/dist/es2019/plugins/code-bidi-warning/index.js +15 -0
  19. package/dist/es2019/plugins/code-bidi-warning/plugin-key.js +2 -0
  20. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/main.js +31 -0
  21. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +88 -0
  22. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/reducer.js +3 -0
  23. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/types.js +1 -0
  24. package/dist/es2019/plugins/code-block/index.js +6 -1
  25. package/dist/es2019/plugins/code-block/nodeviews/highlighting-code-block.js +16 -4
  26. package/dist/es2019/plugins/code-block/pm-plugins/main.js +50 -39
  27. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
  28. package/dist/es2019/plugins/index.js +2 -1
  29. package/dist/es2019/plugins/rank.js +1 -1
  30. package/dist/es2019/version-wrapper.js +1 -1
  31. package/dist/es2019/version.json +1 -1
  32. package/dist/esm/create-editor/create-plugins-list.js +5 -1
  33. package/dist/esm/plugins/code-bidi-warning/index.js +17 -0
  34. package/dist/esm/plugins/code-bidi-warning/plugin-key.js +2 -0
  35. package/dist/esm/plugins/code-bidi-warning/pm-plugins/main.js +30 -0
  36. package/dist/esm/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +96 -0
  37. package/dist/esm/plugins/code-bidi-warning/pm-plugins/reducer.js +3 -0
  38. package/dist/esm/plugins/code-bidi-warning/pm-plugins/types.js +1 -0
  39. package/dist/esm/plugins/code-block/index.js +10 -6
  40. package/dist/esm/plugins/code-block/nodeviews/highlighting-code-block.js +16 -5
  41. package/dist/esm/plugins/code-block/pm-plugins/main.js +11 -3
  42. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
  43. package/dist/esm/plugins/index.js +2 -1
  44. package/dist/esm/plugins/rank.js +1 -1
  45. package/dist/esm/version-wrapper.js +1 -1
  46. package/dist/esm/version.json +1 -1
  47. package/dist/types/plugins/code-bidi-warning/index.d.ts +3 -0
  48. package/dist/types/plugins/code-bidi-warning/plugin-key.d.ts +2 -0
  49. package/dist/types/plugins/code-bidi-warning/pm-plugins/main.d.ts +3 -0
  50. package/dist/types/plugins/code-bidi-warning/pm-plugins/plugin-factory.d.ts +7 -0
  51. package/dist/types/plugins/code-bidi-warning/pm-plugins/reducer.d.ts +3 -0
  52. package/dist/types/plugins/code-bidi-warning/pm-plugins/types.d.ts +5 -0
  53. package/dist/types/plugins/code-block/nodeviews/highlighting-code-block.d.ts +11 -2
  54. package/dist/types/plugins/code-block/pm-plugins/main.d.ts +5 -1
  55. package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +1 -1
  56. package/dist/types/plugins/index.d.ts +1 -0
  57. package/dist/types/types/feature-flags.d.ts +9 -0
  58. package/package.json +5 -5
@@ -28,7 +28,7 @@ const toDOM = node => ['div', {
28
28
  }]]];
29
29
 
30
30
  export class CodeBlockView {
31
- constructor(_node, view, getPos) {
31
+ constructor(_node, view, getPos, codeBidiWarningOptions) {
32
32
  _defineProperty(this, "highlighting", null);
33
33
 
34
34
  _defineProperty(this, "highlighter", null);
@@ -57,6 +57,7 @@ export class CodeBlockView {
57
57
  dom,
58
58
  contentDOM
59
59
  } = DOMSerializer.renderSpec(document, toDOM(_node));
60
+ this.codeBidiWarningOptions = codeBidiWarningOptions;
60
61
  this.getPos = getPos;
61
62
  this.view = view;
62
63
  this.node = _node;
@@ -99,7 +100,9 @@ export class CodeBlockView {
99
100
  ReactDOM.render( /*#__PURE__*/React.createElement(CodeBlock, {
100
101
  text: node.textContent,
101
102
  language: node.attrs.language,
102
- showLineNumbers: false
103
+ showLineNumbers: false,
104
+ codeBidiWarnings: this.codeBidiWarningOptions.enabled,
105
+ codeBidiWarningLabel: this.codeBidiWarningOptions.label
103
106
  }), highlighting);
104
107
  this.measure(performance.now() - start);
105
108
  content === null || content === void 0 ? void 0 : content.setAttribute('data-debounce', 'false');
@@ -130,8 +133,17 @@ export class CodeBlockView {
130
133
  ignoreMutation(record) {
131
134
  var _this$highlighting$co, _this$highlighting;
132
135
 
133
- return record.target === this.lineNumberGutter || record.target.parentNode === this.lineNumberGutter || ((_this$highlighting$co = (_this$highlighting = this.highlighting) === null || _this$highlighting === void 0 ? void 0 : _this$highlighting.contains(record.target)) !== null && _this$highlighting$co !== void 0 ? _this$highlighting$co : false);
136
+ const lineNumberChanges = record.target === this.lineNumberGutter || record.target.parentNode === this.lineNumberGutter;
137
+ const outsideTheCodeBlockChanges = (_this$highlighting$co = (_this$highlighting = this.highlighting) === null || _this$highlighting === void 0 ? void 0 : _this$highlighting.contains(record.target)) !== null && _this$highlighting$co !== void 0 ? _this$highlighting$co : false;
138
+ const codeBidiWarningDecorationChanges = record.type === 'attributes' && record.attributeName === 'aria-describedby';
139
+ return lineNumberChanges || outsideTheCodeBlockChanges || codeBidiWarningDecorationChanges;
134
140
  }
135
141
 
136
142
  }
137
- export const highlightingCodeBlockNodeView = () => (node, view, getPos) => new CodeBlockView(node, view, getPos);
143
+ export const highlightingCodeBlockNodeView = ({
144
+ codeBidiWarnings,
145
+ codeBidiWarningLabel
146
+ }) => (node, view, getPos) => new CodeBlockView(node, view, getPos, {
147
+ enabled: codeBidiWarnings,
148
+ label: codeBidiWarningLabel
149
+ });
@@ -1,4 +1,5 @@
1
1
  import { Plugin, NodeSelection } from 'prosemirror-state';
2
+ import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
2
3
  import { codeBlockNodeView } from '../nodeviews/code-block';
3
4
  import { highlightingCodeBlockNodeView } from '../nodeviews/highlighting-code-block';
4
5
  import { createSelectionClickHandler } from '../../selection/utils';
@@ -7,51 +8,61 @@ import { ACTIONS } from './actions';
7
8
  import { findCodeBlock } from '../utils';
8
9
  import { codeBlockClassNames } from '../ui/class-names';
9
10
  import { getFeatureFlags } from '../../feature-flags-context';
10
- export const createPlugin = (useLongPressSelection = false) => new Plugin({
11
- state: {
12
- init(_, state) {
13
- const node = findCodeBlock(state, state.selection);
14
- return {
15
- pos: node ? node.pos : null,
16
- contentCopied: false,
17
- isNodeSelected: false
18
- };
19
- },
20
-
21
- apply(tr, pluginState, _oldState, newState) {
22
- if (tr.docChanged || tr.selectionSet) {
23
- const node = findCodeBlock(newState, tr.selection);
24
- const newPluginState = { ...pluginState,
11
+ export const createPlugin = ({
12
+ useLongPressSelection = false,
13
+ reactContext
14
+ }) => {
15
+ const intl = reactContext().intl;
16
+ const codeBidiWarningLabel = intl.formatMessage(codeBidiWarningMessages.label);
17
+ return new Plugin({
18
+ state: {
19
+ init(_, state) {
20
+ const node = findCodeBlock(state, state.selection);
21
+ return {
25
22
  pos: node ? node.pos : null,
26
- isNodeSelected: tr.selection instanceof NodeSelection
23
+ contentCopied: false,
24
+ isNodeSelected: false
27
25
  };
28
- return newPluginState;
29
- }
26
+ },
30
27
 
31
- const meta = tr.getMeta(pluginKey);
28
+ apply(tr, pluginState, _oldState, newState) {
29
+ if (tr.docChanged || tr.selectionSet) {
30
+ const node = findCodeBlock(newState, tr.selection);
31
+ const newPluginState = { ...pluginState,
32
+ pos: node ? node.pos : null,
33
+ isNodeSelected: tr.selection instanceof NodeSelection
34
+ };
35
+ return newPluginState;
36
+ }
32
37
 
33
- if ((meta === null || meta === void 0 ? void 0 : meta.type) === ACTIONS.SET_COPIED_TO_CLIPBOARD) {
34
- return { ...pluginState,
35
- contentCopied: meta.data
36
- };
37
- }
38
+ const meta = tr.getMeta(pluginKey);
38
39
 
39
- return pluginState;
40
- }
40
+ if ((meta === null || meta === void 0 ? void 0 : meta.type) === ACTIONS.SET_COPIED_TO_CLIPBOARD) {
41
+ return { ...pluginState,
42
+ contentCopied: meta.data
43
+ };
44
+ }
41
45
 
42
- },
43
- key: pluginKey,
44
- props: {
45
- nodeViews: {
46
- codeBlock(node, view, getPos) {
47
- const featureFlags = getFeatureFlags(view.state);
48
- const createCodeBlockNodeView = featureFlags !== null && featureFlags !== void 0 && featureFlags.codeBlockSyntaxHighlighting ? highlightingCodeBlockNodeView() : codeBlockNodeView();
49
- return createCodeBlockNodeView(node, view, getPos);
46
+ return pluginState;
50
47
  }
51
48
 
52
49
  },
53
- handleClickOn: createSelectionClickHandler(['codeBlock'], target => !!(target.closest(`.${codeBlockClassNames.gutter}`) || target.classList.contains(codeBlockClassNames.content)), {
54
- useLongPressSelection
55
- })
56
- }
57
- });
50
+ key: pluginKey,
51
+ props: {
52
+ nodeViews: {
53
+ codeBlock(node, view, getPos) {
54
+ const featureFlags = getFeatureFlags(view.state);
55
+ const createCodeBlockNodeView = featureFlags !== null && featureFlags !== void 0 && featureFlags.codeBlockSyntaxHighlighting ? highlightingCodeBlockNodeView({
56
+ codeBidiWarnings: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.codeBidiWarnings,
57
+ codeBidiWarningLabel
58
+ }) : codeBlockNodeView();
59
+ return createCodeBlockNodeView(node, view, getPos);
60
+ }
61
+
62
+ },
63
+ handleClickOn: createSelectionClickHandler(['codeBlock'], target => !!(target.closest(`.${codeBlockClassNames.gutter}`) || target.classList.contains(codeBlockClassNames.content)), {
64
+ useLongPressSelection
65
+ })
66
+ }
67
+ });
68
+ };
@@ -6,7 +6,7 @@ import { browser } from '@atlaskit/editor-common';
6
6
  */
7
7
 
8
8
  export function createFeatureFlagsFromProps(props) {
9
- var _props$allowTextColor, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$featureFlags10, _props$featureFlags11, _props$allowTables5, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27;
9
+ var _props$allowTextColor, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$featureFlags10, _props$featureFlags11, _props$allowTables5, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29;
10
10
 
11
11
  const normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
12
12
  return { ...normalizedFeatureFlags,
@@ -36,6 +36,7 @@ export function createFeatureFlagsFromProps(props) {
36
36
  enableViewUpdateSubscription: Boolean(typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22.enableViewUpdateSubscription) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23.enableViewUpdateSubscription) : false),
37
37
  collabAvatarScroll: Boolean(typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags25 = props.featureFlags) !== null && _props$featureFlags25 !== void 0 && _props$featureFlags25.collabAvatarScroll) : false),
38
38
  ufo: Boolean(typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.ufo) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.ufo) : false),
39
- codeBlockSyntaxHighlighting: Boolean(typeof normalizedFeatureFlags.codeBlockSyntaxHighlighting === 'boolean' ? !!normalizedFeatureFlags.codeBlockSyntaxHighlighting && !browser.safari : false)
39
+ codeBlockSyntaxHighlighting: Boolean(typeof normalizedFeatureFlags.codeBlockSyntaxHighlighting === 'boolean' ? !!normalizedFeatureFlags.codeBlockSyntaxHighlighting && !browser.safari : false),
40
+ codeBidiWarnings: Boolean(typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.codeBidiWarnings) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.codeBidiWarnings) : true)
40
41
  };
41
42
  }
@@ -60,4 +60,5 @@ export { default as mobileSelectionPlugin } from './mobile-selection';
60
60
  export { default as clipboardPlugin } from './clipboard';
61
61
  export { default as undoRedoPlugin } from './undo-redo';
62
62
  export { default as avatarGroupPlugin } from './avatar-group';
63
- export { default as viewUpdateSubscriptionPlugin } from './view-update-subscription';
63
+ export { default as viewUpdateSubscriptionPlugin } from './view-update-subscription';
64
+ export { default as codeBidiWarningPlugin } from './code-bidi-warning';
@@ -6,7 +6,7 @@ export default {
6
6
  // https://product-fabric.atlassian.net/wiki/spaces/E/pages/1113098008/Selection+Guide#Special-Cases
7
7
  'expandKeymap', 'tableSelectionKeymap', 'tableKeymap', 'captionKeymap', // selection keymap needs to be above gap cursor keymap so it can set node selections from
8
8
  // left/right arrows
9
- 'selectionKeymap', 'gapCursorKeymap', 'gapCursor', 'syncUrlText', 'fakeCursorToolbarPlugin', 'hyperLink', 'table', 'tableDecorations', 'hyperlinkInputRule', 'tablePMColResizing', 'hyperlinkKeymap', 'tableColResizing', 'undoRedoKeyMap', 'blockTypeKeyMap', 'tableEditing', 'filterStepsPlugin', 'pmCollab', 'collab', 'ruleInputRule', 'ruleKeymap', 'panel', 'media', 'mediaKeymap', 'mediaSingleKeymap', 'mediaEditor', 'unsupportedContent', 'jiraIssue', 'fakeTextCursor', 'helpDialog', 'helpDialogKeymap', 'macro', 'expand', 'extension', 'layout', 'contextPanel', 'floatingToolbar', 'clearMarksOnChange', 'reactNodeView', 'history', 'undoRedoPlugin', 'codeBlockIndent', 'placeholder', 'width', 'maxContentSize', 'multilineContent', 'grid', 'mobileDimensions', 'scrollGutterPlugin', 'analytics', 'findReplace', 'selection', 'avatarGroup', 'viewUpdateSubscription'],
9
+ 'selectionKeymap', 'gapCursorKeymap', 'gapCursor', 'syncUrlText', 'fakeCursorToolbarPlugin', 'hyperLink', 'table', 'tableDecorations', 'hyperlinkInputRule', 'tablePMColResizing', 'hyperlinkKeymap', 'tableColResizing', 'undoRedoKeyMap', 'blockTypeKeyMap', 'tableEditing', 'filterStepsPlugin', 'pmCollab', 'collab', 'ruleInputRule', 'ruleKeymap', 'panel', 'media', 'mediaKeymap', 'mediaSingleKeymap', 'mediaEditor', 'unsupportedContent', 'jiraIssue', 'fakeTextCursor', 'helpDialog', 'helpDialogKeymap', 'macro', 'expand', 'extension', 'layout', 'contextPanel', 'floatingToolbar', 'clearMarksOnChange', 'reactNodeView', 'history', 'undoRedoPlugin', 'codeBlockIndent', 'placeholder', 'width', 'maxContentSize', 'multilineContent', 'grid', 'mobileDimensions', 'scrollGutterPlugin', 'analytics', 'findReplace', 'selection', 'avatarGroup', 'viewUpdateSubscription', 'inlineCode'],
10
10
  nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'rule', 'panel', 'mention', 'confluenceUnsupportedBlock', 'confluenceUnsupportedInline', 'unsupportedBlock', 'unsupportedInline', 'confluenceJiraIssue', 'hardBreak', 'emoji', 'placeholder', 'mediaSingle', 'mediaGroup', 'table', 'expand', 'nestedExpand', 'media', 'tableHeader', 'decisionList', 'tableRow', 'decisionItem', 'tableCell', 'taskList', 'taskItem', 'extension', 'bodiedExtension', 'inlineExtension', 'layoutSection', 'layoutColumn', 'inlineCard', 'blockCard', 'embedCard'],
11
11
  marks: [// Inline marks
12
12
  'link', 'em', 'strong', 'textColor', 'strike', 'subsup', 'underline', 'code', 'typeAheadQuery', // Block marks
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "151.0.0";
2
+ export const version = "151.1.0";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "151.0.0",
3
+ "version": "151.1.0",
4
4
  "sideEffects": false
5
5
  }
@@ -5,7 +5,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
5
5
 
6
6
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
7
7
 
8
- import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, helpDialogPlugin, imageUploadPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, listPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tablesPlugin, tasksAndDecisionsPlugin, textColorPlugin, cardPlugin, gridPlugin, statusPlugin, alignmentPlugin, indentationPlugin, analyticsPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, contextPanelPlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin } from '../plugins';
8
+ import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, helpDialogPlugin, imageUploadPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, listPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tablesPlugin, tasksAndDecisionsPlugin, textColorPlugin, cardPlugin, gridPlugin, statusPlugin, alignmentPlugin, indentationPlugin, analyticsPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, contextPanelPlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, codeBidiWarningPlugin } from '../plugins';
9
9
  import { isFullPage as fullPageCheck } from '../utils/is-full-page';
10
10
  import { GUTTER_SIZE_MOBILE_IN_PX } from '../plugins/base/pm-plugins/scroll-gutter';
11
11
  import { createFeatureFlagsFromProps } from '../plugins/feature-flags-context/feature-flags-from-props';
@@ -393,6 +393,10 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
393
393
  preset.add([viewUpdateSubscriptionPlugin]);
394
394
  }
395
395
 
396
+ if (featureFlags.codeBidiWarnings) {
397
+ preset.add(codeBidiWarningPlugin);
398
+ }
399
+
396
400
  var excludes = new Set();
397
401
 
398
402
  if (!isCodeBlockAllowed({
@@ -0,0 +1,17 @@
1
+ import { createPlugin } from './pm-plugins/main';
2
+
3
+ var codeBidiWarning = function codeBidiWarning() {
4
+ return {
5
+ name: 'codeBidiWarning',
6
+ pmPlugins: function pmPlugins() {
7
+ return [{
8
+ name: 'codeBidiWarning',
9
+ plugin: function plugin(options) {
10
+ return createPlugin(options);
11
+ }
12
+ }];
13
+ }
14
+ };
15
+ };
16
+
17
+ export default codeBidiWarning;
@@ -0,0 +1,2 @@
1
+ import { PluginKey } from 'prosemirror-state';
2
+ export var codeBidiWarningPluginKey = new PluginKey('codeBidiWarningPlugin');
@@ -0,0 +1,30 @@
1
+ import { Plugin } from 'prosemirror-state';
2
+ import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
3
+ import { codeBidiWarningPluginKey } from '../plugin-key';
4
+ import { createBidiWarningsDecorationSetFromDoc, createPluginState, getPluginState } from './plugin-factory';
5
+ export var createPlugin = function createPlugin(_ref) {
6
+ var dispatch = _ref.dispatch,
7
+ reactContext = _ref.reactContext;
8
+ var intl = reactContext().intl;
9
+ var codeBidiWarningLabel = intl.formatMessage(codeBidiWarningMessages.label);
10
+ return new Plugin({
11
+ key: codeBidiWarningPluginKey,
12
+ state: createPluginState(dispatch, function (state) {
13
+ return {
14
+ decorationSet: createBidiWarningsDecorationSetFromDoc({
15
+ doc: state.doc,
16
+ codeBidiWarningLabel: codeBidiWarningLabel
17
+ }),
18
+ codeBidiWarningLabel: codeBidiWarningLabel
19
+ };
20
+ }),
21
+ props: {
22
+ decorations: function decorations(state) {
23
+ var _getPluginState = getPluginState(state),
24
+ decorationSet = _getPluginState.decorationSet;
25
+
26
+ return decorationSet;
27
+ }
28
+ }
29
+ });
30
+ };
@@ -0,0 +1,96 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+
3
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
4
+
5
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6
+
7
+ import React from 'react';
8
+ import ReactDOM from 'react-dom';
9
+ import { Decoration, DecorationSet } from 'prosemirror-view';
10
+ import CodeBidiWarning from '@atlaskit/code/bidi-warning';
11
+ import codeBidiWarningDecorator from '@atlaskit/code/bidi-warning-decorator';
12
+ import { pluginFactory } from '../../../utils/plugin-state-factory';
13
+ import { stepHasSlice } from '../../../utils/step';
14
+ import { codeBidiWarningPluginKey } from '../plugin-key';
15
+ import reducer from './reducer';
16
+
17
+ var _pluginFactory = pluginFactory(codeBidiWarningPluginKey, reducer, {
18
+ onDocChanged: function onDocChanged(tr, pluginState) {
19
+ if (!tr.steps.find(stepHasSlice)) {
20
+ return pluginState;
21
+ }
22
+
23
+ var newBidiWarningsDecorationSet = createBidiWarningsDecorationSetFromDoc({
24
+ doc: tr.doc,
25
+ codeBidiWarningLabel: pluginState.codeBidiWarningLabel
26
+ });
27
+ return _objectSpread(_objectSpread({}, pluginState), {}, {
28
+ decorationSet: newBidiWarningsDecorationSet
29
+ });
30
+ }
31
+ }),
32
+ createPluginState = _pluginFactory.createPluginState,
33
+ getPluginState = _pluginFactory.getPluginState;
34
+
35
+ export { createPluginState, getPluginState };
36
+ export function createBidiWarningsDecorationSetFromDoc(_ref) {
37
+ var doc = _ref.doc,
38
+ codeBidiWarningLabel = _ref.codeBidiWarningLabel;
39
+ var bidiCharactersAndTheirPositions = [];
40
+ doc.descendants(function (node, pos) {
41
+ var isTextWithCodeMark = node.type.name === 'text' && node.marks && node.marks.some(function (mark) {
42
+ return mark.type.name === 'code';
43
+ });
44
+
45
+ if (isTextWithCodeMark) {
46
+ codeBidiWarningDecorator(node.textContent, function (_ref2) {
47
+ var bidiCharacter = _ref2.bidiCharacter,
48
+ index = _ref2.index;
49
+ bidiCharactersAndTheirPositions.push({
50
+ position: pos + index,
51
+ bidiCharacter: bidiCharacter
52
+ });
53
+ });
54
+ return false;
55
+ }
56
+
57
+ var isCodeBlock = node.type.name === 'codeBlock';
58
+
59
+ if (isCodeBlock) {
60
+ codeBidiWarningDecorator(node.textContent, function (_ref3) {
61
+ var bidiCharacter = _ref3.bidiCharacter,
62
+ index = _ref3.index;
63
+ bidiCharactersAndTheirPositions.push({
64
+ position: pos + index + 1,
65
+ bidiCharacter: bidiCharacter
66
+ });
67
+ });
68
+ }
69
+ }); // Bidi characters are not expected to commonly appear in code snippets, so recreating the decoration set
70
+ // for documents rather than reusing existing decorations seems a reasonable performance/complexity tradeoff.
71
+
72
+ if (bidiCharactersAndTheirPositions.length === 0) {
73
+ return DecorationSet.empty;
74
+ }
75
+
76
+ var newBidiWarningsDecorationSet = DecorationSet.create(doc, bidiCharactersAndTheirPositions.map(function (_ref4) {
77
+ var position = _ref4.position,
78
+ bidiCharacter = _ref4.bidiCharacter;
79
+ return Decoration.widget(position, function () {
80
+ return renderDOM(bidiCharacter, codeBidiWarningLabel);
81
+ });
82
+ }));
83
+ return newBidiWarningsDecorationSet;
84
+ }
85
+
86
+ function renderDOM(bidiCharacter, codeBidiWarningLabel) {
87
+ var element = document.createElement('span'); // Note: we use this pattern elsewhere (see highlighting code block, and drop cursor widget decoration)
88
+ // we should investigate if there is a memory leak with such usage.
89
+
90
+ ReactDOM.render( /*#__PURE__*/React.createElement(CodeBidiWarning, {
91
+ bidiCharacter: bidiCharacter,
92
+ skipChildren: true,
93
+ label: codeBidiWarningLabel
94
+ }), element);
95
+ return element;
96
+ }
@@ -0,0 +1,3 @@
1
+ export default (function (pluginState, action) {
2
+ return pluginState;
3
+ });
@@ -22,8 +22,12 @@ var codeBlockPlugin = function codeBlockPlugin() {
22
22
  pmPlugins: function pmPlugins() {
23
23
  return [{
24
24
  name: 'codeBlock',
25
- plugin: function plugin() {
26
- return createPlugin(options.useLongPressSelection);
25
+ plugin: function plugin(_ref) {
26
+ var reactContext = _ref.reactContext;
27
+ return createPlugin({
28
+ useLongPressSelection: options.useLongPressSelection,
29
+ reactContext: reactContext
30
+ });
27
31
  }
28
32
  }, {
29
33
  name: 'codeBlockIDEKeyBindings',
@@ -32,8 +36,8 @@ var codeBlockPlugin = function codeBlockPlugin() {
32
36
  }
33
37
  }, {
34
38
  name: 'codeBlockKeyMap',
35
- plugin: function plugin(_ref) {
36
- var schema = _ref.schema;
39
+ plugin: function plugin(_ref2) {
40
+ var schema = _ref2.schema;
37
41
  return keymap(schema);
38
42
  }
39
43
  }];
@@ -44,8 +48,8 @@ var codeBlockPlugin = function codeBlockPlugin() {
44
48
  refreshBrowserSelectionOnChange(props.originalTransaction, props.newEditorState);
45
49
  },
46
50
  pluginsOptions: {
47
- quickInsert: function quickInsert(_ref2) {
48
- var formatMessage = _ref2.formatMessage;
51
+ quickInsert: function quickInsert(_ref3) {
52
+ var formatMessage = _ref3.formatMessage;
49
53
  return [{
50
54
  id: 'codeblock',
51
55
  title: formatMessage(messages.codeblock),
@@ -32,7 +32,7 @@ var toDOM = function toDOM(node) {
32
32
  };
33
33
 
34
34
  export var CodeBlockView = /*#__PURE__*/function () {
35
- function CodeBlockView(_node, view, getPos) {
35
+ function CodeBlockView(_node, view, getPos, codeBidiWarningOptions) {
36
36
  var _this = this;
37
37
 
38
38
  _classCallCheck(this, CodeBlockView);
@@ -66,6 +66,7 @@ export var CodeBlockView = /*#__PURE__*/function () {
66
66
  dom = _DOMSerializer$render.dom,
67
67
  contentDOM = _DOMSerializer$render.contentDOM;
68
68
 
69
+ this.codeBidiWarningOptions = codeBidiWarningOptions;
69
70
  this.getPos = getPos;
70
71
  this.view = view;
71
72
  this.node = _node;
@@ -118,7 +119,9 @@ export var CodeBlockView = /*#__PURE__*/function () {
118
119
  ReactDOM.render( /*#__PURE__*/React.createElement(CodeBlock, {
119
120
  text: node.textContent,
120
121
  language: node.attrs.language,
121
- showLineNumbers: false
122
+ showLineNumbers: false,
123
+ codeBidiWarnings: this.codeBidiWarningOptions.enabled,
124
+ codeBidiWarningLabel: this.codeBidiWarningOptions.label
122
125
  }), highlighting);
123
126
  this.measure(performance.now() - start);
124
127
  content === null || content === void 0 ? void 0 : content.setAttribute('data-debounce', 'false');
@@ -151,14 +154,22 @@ export var CodeBlockView = /*#__PURE__*/function () {
151
154
  value: function ignoreMutation(record) {
152
155
  var _this$highlighting$co, _this$highlighting;
153
156
 
154
- return record.target === this.lineNumberGutter || record.target.parentNode === this.lineNumberGutter || ((_this$highlighting$co = (_this$highlighting = this.highlighting) === null || _this$highlighting === void 0 ? void 0 : _this$highlighting.contains(record.target)) !== null && _this$highlighting$co !== void 0 ? _this$highlighting$co : false);
157
+ var lineNumberChanges = record.target === this.lineNumberGutter || record.target.parentNode === this.lineNumberGutter;
158
+ var outsideTheCodeBlockChanges = (_this$highlighting$co = (_this$highlighting = this.highlighting) === null || _this$highlighting === void 0 ? void 0 : _this$highlighting.contains(record.target)) !== null && _this$highlighting$co !== void 0 ? _this$highlighting$co : false;
159
+ var codeBidiWarningDecorationChanges = record.type === 'attributes' && record.attributeName === 'aria-describedby';
160
+ return lineNumberChanges || outsideTheCodeBlockChanges || codeBidiWarningDecorationChanges;
155
161
  }
156
162
  }]);
157
163
 
158
164
  return CodeBlockView;
159
165
  }();
160
- export var highlightingCodeBlockNodeView = function highlightingCodeBlockNodeView() {
166
+ export var highlightingCodeBlockNodeView = function highlightingCodeBlockNodeView(_ref) {
167
+ var codeBidiWarnings = _ref.codeBidiWarnings,
168
+ codeBidiWarningLabel = _ref.codeBidiWarningLabel;
161
169
  return function (node, view, getPos) {
162
- return new CodeBlockView(node, view, getPos);
170
+ return new CodeBlockView(node, view, getPos, {
171
+ enabled: codeBidiWarnings,
172
+ label: codeBidiWarningLabel
173
+ });
163
174
  };
164
175
  };
@@ -5,6 +5,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
5
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6
6
 
7
7
  import { Plugin, NodeSelection } from 'prosemirror-state';
8
+ import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
8
9
  import { codeBlockNodeView } from '../nodeviews/code-block';
9
10
  import { highlightingCodeBlockNodeView } from '../nodeviews/highlighting-code-block';
10
11
  import { createSelectionClickHandler } from '../../selection/utils';
@@ -13,8 +14,12 @@ import { ACTIONS } from './actions';
13
14
  import { findCodeBlock } from '../utils';
14
15
  import { codeBlockClassNames } from '../ui/class-names';
15
16
  import { getFeatureFlags } from '../../feature-flags-context';
16
- export var createPlugin = function createPlugin() {
17
- var useLongPressSelection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
17
+ export var createPlugin = function createPlugin(_ref) {
18
+ var _ref$useLongPressSele = _ref.useLongPressSelection,
19
+ useLongPressSelection = _ref$useLongPressSele === void 0 ? false : _ref$useLongPressSele,
20
+ reactContext = _ref.reactContext;
21
+ var intl = reactContext().intl;
22
+ var codeBidiWarningLabel = intl.formatMessage(codeBidiWarningMessages.label);
18
23
  return new Plugin({
19
24
  state: {
20
25
  init: function init(_, state) {
@@ -53,7 +58,10 @@ export var createPlugin = function createPlugin() {
53
58
  nodeViews: {
54
59
  codeBlock: function codeBlock(node, view, getPos) {
55
60
  var featureFlags = getFeatureFlags(view.state);
56
- var createCodeBlockNodeView = featureFlags !== null && featureFlags !== void 0 && featureFlags.codeBlockSyntaxHighlighting ? highlightingCodeBlockNodeView() : codeBlockNodeView();
61
+ var createCodeBlockNodeView = featureFlags !== null && featureFlags !== void 0 && featureFlags.codeBlockSyntaxHighlighting ? highlightingCodeBlockNodeView({
62
+ codeBidiWarnings: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.codeBidiWarnings,
63
+ codeBidiWarningLabel: codeBidiWarningLabel
64
+ }) : codeBlockNodeView();
57
65
  return createCodeBlockNodeView(node, view, getPos);
58
66
  }
59
67
  },
@@ -13,7 +13,7 @@ import { browser } from '@atlaskit/editor-common';
13
13
  */
14
14
 
15
15
  export function createFeatureFlagsFromProps(props) {
16
- var _props$allowTextColor, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$featureFlags10, _props$featureFlags11, _props$allowTables5, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27;
16
+ var _props$allowTextColor, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$featureFlags10, _props$featureFlags11, _props$allowTables5, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29;
17
17
 
18
18
  var normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
19
19
  return _objectSpread(_objectSpread({}, normalizedFeatureFlags), {}, {
@@ -43,6 +43,7 @@ export function createFeatureFlagsFromProps(props) {
43
43
  enableViewUpdateSubscription: Boolean(typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22.enableViewUpdateSubscription) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23.enableViewUpdateSubscription) : false),
44
44
  collabAvatarScroll: Boolean(typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags25 = props.featureFlags) !== null && _props$featureFlags25 !== void 0 && _props$featureFlags25.collabAvatarScroll) : false),
45
45
  ufo: Boolean(typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.ufo) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.ufo) : false),
46
- codeBlockSyntaxHighlighting: Boolean(typeof normalizedFeatureFlags.codeBlockSyntaxHighlighting === 'boolean' ? !!normalizedFeatureFlags.codeBlockSyntaxHighlighting && !browser.safari : false)
46
+ codeBlockSyntaxHighlighting: Boolean(typeof normalizedFeatureFlags.codeBlockSyntaxHighlighting === 'boolean' ? !!normalizedFeatureFlags.codeBlockSyntaxHighlighting && !browser.safari : false),
47
+ codeBidiWarnings: Boolean(typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.codeBidiWarnings) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.codeBidiWarnings) : true)
47
48
  });
48
49
  }
@@ -60,4 +60,5 @@ export { default as mobileSelectionPlugin } from './mobile-selection';
60
60
  export { default as clipboardPlugin } from './clipboard';
61
61
  export { default as undoRedoPlugin } from './undo-redo';
62
62
  export { default as avatarGroupPlugin } from './avatar-group';
63
- export { default as viewUpdateSubscriptionPlugin } from './view-update-subscription';
63
+ export { default as viewUpdateSubscriptionPlugin } from './view-update-subscription';
64
+ export { default as codeBidiWarningPlugin } from './code-bidi-warning';
@@ -6,7 +6,7 @@ export default {
6
6
  // https://product-fabric.atlassian.net/wiki/spaces/E/pages/1113098008/Selection+Guide#Special-Cases
7
7
  'expandKeymap', 'tableSelectionKeymap', 'tableKeymap', 'captionKeymap', // selection keymap needs to be above gap cursor keymap so it can set node selections from
8
8
  // left/right arrows
9
- 'selectionKeymap', 'gapCursorKeymap', 'gapCursor', 'syncUrlText', 'fakeCursorToolbarPlugin', 'hyperLink', 'table', 'tableDecorations', 'hyperlinkInputRule', 'tablePMColResizing', 'hyperlinkKeymap', 'tableColResizing', 'undoRedoKeyMap', 'blockTypeKeyMap', 'tableEditing', 'filterStepsPlugin', 'pmCollab', 'collab', 'ruleInputRule', 'ruleKeymap', 'panel', 'media', 'mediaKeymap', 'mediaSingleKeymap', 'mediaEditor', 'unsupportedContent', 'jiraIssue', 'fakeTextCursor', 'helpDialog', 'helpDialogKeymap', 'macro', 'expand', 'extension', 'layout', 'contextPanel', 'floatingToolbar', 'clearMarksOnChange', 'reactNodeView', 'history', 'undoRedoPlugin', 'codeBlockIndent', 'placeholder', 'width', 'maxContentSize', 'multilineContent', 'grid', 'mobileDimensions', 'scrollGutterPlugin', 'analytics', 'findReplace', 'selection', 'avatarGroup', 'viewUpdateSubscription'],
9
+ 'selectionKeymap', 'gapCursorKeymap', 'gapCursor', 'syncUrlText', 'fakeCursorToolbarPlugin', 'hyperLink', 'table', 'tableDecorations', 'hyperlinkInputRule', 'tablePMColResizing', 'hyperlinkKeymap', 'tableColResizing', 'undoRedoKeyMap', 'blockTypeKeyMap', 'tableEditing', 'filterStepsPlugin', 'pmCollab', 'collab', 'ruleInputRule', 'ruleKeymap', 'panel', 'media', 'mediaKeymap', 'mediaSingleKeymap', 'mediaEditor', 'unsupportedContent', 'jiraIssue', 'fakeTextCursor', 'helpDialog', 'helpDialogKeymap', 'macro', 'expand', 'extension', 'layout', 'contextPanel', 'floatingToolbar', 'clearMarksOnChange', 'reactNodeView', 'history', 'undoRedoPlugin', 'codeBlockIndent', 'placeholder', 'width', 'maxContentSize', 'multilineContent', 'grid', 'mobileDimensions', 'scrollGutterPlugin', 'analytics', 'findReplace', 'selection', 'avatarGroup', 'viewUpdateSubscription', 'inlineCode'],
10
10
  nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'rule', 'panel', 'mention', 'confluenceUnsupportedBlock', 'confluenceUnsupportedInline', 'unsupportedBlock', 'unsupportedInline', 'confluenceJiraIssue', 'hardBreak', 'emoji', 'placeholder', 'mediaSingle', 'mediaGroup', 'table', 'expand', 'nestedExpand', 'media', 'tableHeader', 'decisionList', 'tableRow', 'decisionItem', 'tableCell', 'taskList', 'taskItem', 'extension', 'bodiedExtension', 'inlineExtension', 'layoutSection', 'layoutColumn', 'inlineCard', 'blockCard', 'embedCard'],
11
11
  marks: [// Inline marks
12
12
  'link', 'em', 'strong', 'textColor', 'strike', 'subsup', 'underline', 'code', 'typeAheadQuery', // Block marks
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "151.0.0";
2
+ export var version = "151.1.0";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "151.0.0",
3
+ "version": "151.1.0",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1,3 @@
1
+ import { EditorPlugin } from '../../types';
2
+ declare const codeBidiWarning: () => EditorPlugin;
3
+ export default codeBidiWarning;
@@ -0,0 +1,2 @@
1
+ import { PluginKey } from 'prosemirror-state';
2
+ export declare const codeBidiWarningPluginKey: PluginKey<any, any>;
@@ -0,0 +1,3 @@
1
+ import { Plugin } from 'prosemirror-state';
2
+ import { PMPluginFactoryParams } from '../../../types';
3
+ export declare const createPlugin: ({ dispatch, reactContext, }: PMPluginFactoryParams) => Plugin<any, import("prosemirror-model").Schema<any, any>>;
@@ -0,0 +1,7 @@
1
+ import { DecorationSet } from 'prosemirror-view';
2
+ import { Node as PmNode } from 'prosemirror-model';
3
+ export declare const createPluginState: (dispatch: import("../../../event-dispatcher").Dispatch<any>, initialState: import("./types").CodeBidiWarningPluginState | ((state: import("prosemirror-state").EditorState<any>) => import("./types").CodeBidiWarningPluginState)) => import("prosemirror-state").StateField<import("./types").CodeBidiWarningPluginState, import("prosemirror-model").Schema<any, any>>, getPluginState: (state: import("prosemirror-state").EditorState<any>) => import("./types").CodeBidiWarningPluginState;
4
+ export declare function createBidiWarningsDecorationSetFromDoc({ doc, codeBidiWarningLabel, }: {
5
+ doc: PmNode<any>;
6
+ codeBidiWarningLabel: string;
7
+ }): DecorationSet<any>;
@@ -0,0 +1,3 @@
1
+ import { CodeBidiWarningPluginState } from './types';
2
+ declare const _default: (pluginState: CodeBidiWarningPluginState, action: unknown) => CodeBidiWarningPluginState;
3
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import { DecorationSet } from 'prosemirror-view';
2
+ export declare type CodeBidiWarningPluginState = {
3
+ decorationSet: DecorationSet;
4
+ codeBidiWarningLabel: string;
5
+ };