@atlaskit/editor-common 71.0.3 → 72.0.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 (130) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/dist/cjs/analytics/types/enums.js +20 -1
  3. package/dist/cjs/i18n/index.js +13 -5
  4. package/dist/cjs/i18n/languages.js +42 -0
  5. package/dist/cjs/keymaps/index.js +55 -3
  6. package/dist/cjs/styles/index.js +8 -2
  7. package/dist/cjs/styles/shared/annotation.js +4 -7
  8. package/dist/cjs/styles/shared/block-marks.js +1 -1
  9. package/dist/cjs/styles/shared/code-block.js +3 -4
  10. package/dist/cjs/styles/shared/lists.js +55 -4
  11. package/dist/cjs/styles/shared/panel.js +6 -12
  12. package/dist/cjs/styles/shared/shadow.js +3 -1
  13. package/dist/cjs/styles/shared/table.js +2 -2
  14. package/dist/cjs/types/next-editor-plugin.js +5 -0
  15. package/dist/cjs/ui/DropList/index.js +1 -1
  16. package/dist/cjs/ui/Emoji/index.js +11 -2
  17. package/dist/cjs/ui/Popup/index.js +72 -2
  18. package/dist/cjs/ui/Popup/utils.js +13 -6
  19. package/dist/cjs/ui/UnsupportedBlock/index.js +2 -2
  20. package/dist/cjs/ui/UnsupportedInline/index.js +2 -2
  21. package/dist/cjs/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +138 -0
  22. package/dist/cjs/ui-color/ColorPalette/index.js +19 -1
  23. package/dist/cjs/ui-menu/DropdownMenu/index.js +2 -0
  24. package/dist/cjs/ui-menu/ToolbarButton/index.js +3 -1
  25. package/dist/cjs/utils/analytics.js +1 -38
  26. package/dist/cjs/utils/builder.js +44 -0
  27. package/dist/cjs/utils/compareNodes.js +86 -33
  28. package/dist/cjs/utils/index.js +47 -1
  29. package/dist/cjs/utils/list.js +47 -0
  30. package/dist/cjs/utils/plugin-state-factory.js +9 -9
  31. package/dist/cjs/utils/referentiality.js +281 -2
  32. package/dist/cjs/utils/track-unsupported-content.js +19 -20
  33. package/dist/cjs/utils/validate-using-spec.js +8 -2
  34. package/dist/cjs/version.json +1 -1
  35. package/dist/es2019/analytics/types/enums.js +20 -1
  36. package/dist/es2019/i18n/index.js +4 -3
  37. package/dist/es2019/i18n/languages.js +34 -0
  38. package/dist/es2019/keymaps/index.js +47 -0
  39. package/dist/es2019/styles/index.js +1 -1
  40. package/dist/es2019/styles/shared/annotation.js +4 -7
  41. package/dist/es2019/styles/shared/block-marks.js +8 -1
  42. package/dist/es2019/styles/shared/code-block.js +7 -6
  43. package/dist/es2019/styles/shared/lists.js +44 -2
  44. package/dist/es2019/styles/shared/panel.js +6 -11
  45. package/dist/es2019/styles/shared/shadow.js +21 -6
  46. package/dist/es2019/styles/shared/table.js +2 -3
  47. package/dist/es2019/types/next-editor-plugin.js +1 -0
  48. package/dist/es2019/ui/DropList/index.js +1 -1
  49. package/dist/es2019/ui/Emoji/index.js +11 -2
  50. package/dist/es2019/ui/Popup/index.js +68 -2
  51. package/dist/es2019/ui/Popup/utils.js +13 -6
  52. package/dist/es2019/ui/UnsupportedBlock/index.js +1 -1
  53. package/dist/es2019/ui/UnsupportedInline/index.js +1 -1
  54. package/dist/es2019/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +120 -0
  55. package/dist/es2019/ui-color/ColorPalette/index.js +28 -12
  56. package/dist/es2019/ui-menu/DropdownMenu/index.js +2 -0
  57. package/dist/es2019/ui-menu/ToolbarButton/index.js +3 -1
  58. package/dist/es2019/utils/analytics.js +0 -33
  59. package/dist/es2019/utils/builder.js +16 -0
  60. package/dist/es2019/utils/compareNodes.js +79 -28
  61. package/dist/es2019/utils/index.js +4 -2
  62. package/dist/es2019/utils/list.js +31 -0
  63. package/dist/es2019/utils/plugin-state-factory.js +9 -9
  64. package/dist/es2019/utils/referentiality.js +240 -0
  65. package/dist/es2019/utils/track-unsupported-content.js +20 -16
  66. package/dist/es2019/utils/validate-using-spec.js +8 -2
  67. package/dist/es2019/version.json +1 -1
  68. package/dist/esm/analytics/types/enums.js +20 -1
  69. package/dist/esm/i18n/index.js +4 -3
  70. package/dist/esm/i18n/languages.js +34 -0
  71. package/dist/esm/keymaps/index.js +48 -0
  72. package/dist/esm/styles/index.js +1 -1
  73. package/dist/esm/styles/shared/annotation.js +4 -7
  74. package/dist/esm/styles/shared/block-marks.js +1 -1
  75. package/dist/esm/styles/shared/code-block.js +3 -4
  76. package/dist/esm/styles/shared/lists.js +49 -2
  77. package/dist/esm/styles/shared/panel.js +6 -11
  78. package/dist/esm/styles/shared/shadow.js +2 -2
  79. package/dist/esm/styles/shared/table.js +2 -3
  80. package/dist/esm/types/next-editor-plugin.js +1 -0
  81. package/dist/esm/ui/DropList/index.js +1 -1
  82. package/dist/esm/ui/Emoji/index.js +11 -2
  83. package/dist/esm/ui/Popup/index.js +73 -2
  84. package/dist/esm/ui/Popup/utils.js +13 -6
  85. package/dist/esm/ui/UnsupportedBlock/index.js +1 -1
  86. package/dist/esm/ui/UnsupportedInline/index.js +1 -1
  87. package/dist/esm/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +124 -0
  88. package/dist/esm/ui-color/ColorPalette/index.js +18 -2
  89. package/dist/esm/ui-menu/DropdownMenu/index.js +2 -0
  90. package/dist/esm/ui-menu/ToolbarButton/index.js +3 -1
  91. package/dist/esm/utils/analytics.js +0 -33
  92. package/dist/esm/utils/builder.js +30 -0
  93. package/dist/esm/utils/compareNodes.js +83 -32
  94. package/dist/esm/utils/index.js +4 -2
  95. package/dist/esm/utils/list.js +31 -0
  96. package/dist/esm/utils/plugin-state-factory.js +9 -9
  97. package/dist/esm/utils/referentiality.js +269 -0
  98. package/dist/esm/utils/track-unsupported-content.js +19 -20
  99. package/dist/esm/utils/validate-using-spec.js +8 -2
  100. package/dist/esm/version.json +1 -1
  101. package/dist/types/analytics/types/enums.d.ts +23 -4
  102. package/dist/types/collab/types.d.ts +1 -1
  103. package/dist/types/i18n/index.d.ts +4 -3
  104. package/dist/types/i18n/languages.d.ts +35 -0
  105. package/dist/types/keymaps/index.d.ts +1 -0
  106. package/dist/types/styles/index.d.ts +1 -1
  107. package/dist/types/styles/shared/lists.d.ts +3 -1
  108. package/dist/types/types/collab.d.ts +1 -1
  109. package/dist/types/types/copy-button.d.ts +4 -0
  110. package/dist/types/types/feature-flags.d.ts +30 -25
  111. package/dist/types/types/floating-toolbar.d.ts +26 -1
  112. package/dist/types/types/index.d.ts +2 -1
  113. package/dist/types/types/next-editor-plugin.d.ts +61 -0
  114. package/dist/types/ui/Emoji/index.d.ts +2 -0
  115. package/dist/types/ui/Popup/index.d.ts +19 -0
  116. package/dist/types/ui/Popup/utils.d.ts +3 -3
  117. package/dist/types/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.d.ts +214 -0
  118. package/dist/types/ui-color/ColorPalette/index.d.ts +7 -0
  119. package/dist/types/ui-menu/DropdownMenu/types.d.ts +1 -0
  120. package/dist/types/ui-menu/ToolbarButton/index.d.ts +3 -1
  121. package/dist/types/utils/analytics.d.ts +1 -21
  122. package/dist/types/utils/builder.d.ts +8 -0
  123. package/dist/types/utils/compareNodes.d.ts +16 -0
  124. package/dist/types/utils/index.d.ts +3 -1
  125. package/dist/types/utils/list.d.ts +10 -0
  126. package/dist/types/utils/plugin-state-factory.d.ts +1 -1
  127. package/dist/types/utils/referentiality.d.ts +4 -0
  128. package/dist/types/utils/track-unsupported-content.d.ts +14 -2
  129. package/package.json +14 -11
  130. package/report.api.md +1 -1
@@ -9,7 +9,7 @@ exports.trackUnsupportedContentTooltipDisplayedFor = exports.fireUnsupportedEven
9
9
 
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
 
12
- var _analytics = require("./analytics");
12
+ var _analytics = require("../analytics");
13
13
 
14
14
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15
15
 
@@ -80,8 +80,6 @@ var findAndTrackUnsupportedContentNodes = function findAndTrackUnsupportedConten
80
80
  var _ref = mark.attrs || {},
81
81
  originalValue = _ref.originalValue;
82
82
 
83
- var sanitizedAttrs = sanitizeAttributes(originalValue.attrs) || {};
84
-
85
83
  var _ref2 = originalValue || {},
86
84
  type = _ref2.type;
87
85
 
@@ -90,21 +88,19 @@ var findAndTrackUnsupportedContentNodes = function findAndTrackUnsupportedConten
90
88
  ancestry: ancestorHierarchy,
91
89
  parentType: parentType,
92
90
  marks: [],
93
- attrs: sanitizedAttrs || {}
91
+ attrs: originalValue.attrs || {}
94
92
  };
95
93
  fireUnsupportedEvent(dispatchAnalyticsEvent, _analytics.ACTION_SUBJECT_ID.UNSUPPORTED_MARK, unsupportedNode);
96
94
  } else if (mark.type === unsupportedNodeAttribute) {
97
95
  var _ref3 = mark.attrs || {},
98
96
  unsupported = _ref3.unsupported;
99
97
 
100
- var _sanitizedAttrs = sanitizeAttributes(unsupported) || {};
101
-
102
98
  var _unsupportedNodeAttribute = {
103
99
  type: nodeType.name || '',
104
100
  ancestry: ancestorHierarchy,
105
101
  parentType: parentType,
106
102
  marks: [],
107
- attrs: _sanitizedAttrs || {}
103
+ attrs: unsupported || {}
108
104
  };
109
105
  fireUnsupportedEvent(dispatchAnalyticsEvent, _analytics.ACTION_SUBJECT_ID.UNSUPPORTED_NODE_ATTRIBUTE, _unsupportedNodeAttribute);
110
106
  }
@@ -128,8 +124,8 @@ var findAndTrackUnsupportedContentNodes = function findAndTrackUnsupportedConten
128
124
  type: type || '',
129
125
  ancestry: ancestorHierarchy,
130
126
  parentType: parentType,
131
- marks: sanitizeMarks(marks) || [],
132
- attrs: sanitizeAttributes(attrs) || {}
127
+ marks: marks || [],
128
+ attrs: attrs || {}
133
129
  };
134
130
  var actionSubjectId = nodeType === unsupportedInline ? _analytics.ACTION_SUBJECT_ID.UNSUPPORTED_INLINE : _analytics.ACTION_SUBJECT_ID.UNSUPPORTED_BLOCK;
135
131
  fireUnsupportedEvent(dispatchAnalyticsEvent, actionSubjectId, unsupportedNode);
@@ -143,22 +139,25 @@ var findAndTrackUnsupportedContentNodes = function findAndTrackUnsupportedConten
143
139
 
144
140
  exports.findAndTrackUnsupportedContentNodes = findAndTrackUnsupportedContentNodes;
145
141
 
146
- var fireUnsupportedEvent = function fireUnsupportedEvent(dispatchAnalyticsEvent, actionSubjectId) {
147
- var unsupportedNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
148
- var errorCode = arguments.length > 3 ? arguments[3] : undefined;
149
- var attrs = {
150
- unsupportedNode: unsupportedNode
142
+ var fireUnsupportedEvent = function fireUnsupportedEvent(dispatchAnalyticsEvent, actionSubjectId, unsupportedNode, errorCode) {
143
+ var sanitizedAttrs = sanitizeAttributes(unsupportedNode.attrs);
144
+ var sanitizedMarks = sanitizeMarks(unsupportedNode.marks);
145
+ var sanitizedUnsupportedNode = {
146
+ type: unsupportedNode.type,
147
+ ancestry: unsupportedNode.ancestry,
148
+ parentType: unsupportedNode.parentType,
149
+ attrs: sanitizedAttrs,
150
+ marks: sanitizedMarks
151
151
  };
152
-
153
- if (errorCode) {
154
- attrs.errorCode = errorCode;
155
- }
156
-
157
152
  var payload = {
158
153
  action: _analytics.ACTION.UNSUPPORTED_CONTENT_ENCOUNTERED,
159
154
  actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
160
155
  actionSubjectId: actionSubjectId,
161
- attributes: attrs,
156
+ attributes: _objectSpread({
157
+ unsupportedNode: sanitizedUnsupportedNode
158
+ }, !!errorCode && {
159
+ errorCode: errorCode
160
+ }),
162
161
  eventType: _analytics.EVENT_TYPE.TRACK
163
162
  };
164
163
  dispatchAnalyticsEvent(payload);
@@ -8,7 +8,7 @@ exports.wrapWithUnsupported = wrapWithUnsupported;
8
8
 
9
9
  var _validator = require("@atlaskit/adf-utils/validator");
10
10
 
11
- var _analytics = require("./analytics");
11
+ var _analytics = require("../analytics");
12
12
 
13
13
  var _trackUnsupportedContent = require("./track-unsupported-content");
14
14
 
@@ -120,7 +120,13 @@ function trackValidationError(dispatchAnalyticsEvent, error, entity) {
120
120
  return;
121
121
  }
122
122
 
123
- (0, _trackUnsupportedContent.fireUnsupportedEvent)(dispatchAnalyticsEvent, _analytics.ACTION_SUBJECT_ID.UNSUPPORTED_ERROR, entity, error.code);
123
+ (0, _trackUnsupportedContent.fireUnsupportedEvent)(dispatchAnalyticsEvent, _analytics.ACTION_SUBJECT_ID.UNSUPPORTED_ERROR, {
124
+ type: entity.type || '',
125
+ ancestry: entity.ancestorHierarchy || '',
126
+ parentType: entity.parentType || '',
127
+ marks: entity.marks || [],
128
+ attrs: entity.attrs || {}
129
+ }, error.code);
124
130
  }
125
131
 
126
132
  var validateADFEntity = function validateADFEntity(schema, node, dispatchAnalyticsEvent) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "71.0.3",
3
+ "version": "72.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -99,7 +99,7 @@ export let ACTION;
99
99
  ACTION["TYPING_FINISHED"] = "typingFinished";
100
100
  ACTION["TYPING_STARTED"] = "typingStarted";
101
101
  ACTION["UNLINK"] = "unlinked";
102
- ACTION["UNSUPPORTED_CONTENT_ENCOUNTERED"] = "unsupportedContentEncountered";
102
+ ACTION["UNSUPPORTED_CONTENT_ENCOUNTERED"] = "unsupportedContentEncounteredV2";
103
103
  ACTION["UPDATED"] = "updated";
104
104
  ACTION["UPDATED_FRAGMENT_MARK_NAME"] = "updatedFragmentMarkName";
105
105
  ACTION["UPDATED_SOURCE"] = "updatedSource";
@@ -116,6 +116,16 @@ export let ACTION;
116
116
  ACTION["UFO_SESSION_COMPLETE"] = "ufoSessionComplete";
117
117
  ACTION["INVALID_PROSEMIRROR_DOCUMENT"] = "invalidProsemirrorDocument";
118
118
  ACTION["DOCUMENT_PROCESSING_ERROR"] = "documentProcessingError";
119
+ ACTION["RENDERER_TTI"] = "tti";
120
+ ACTION["CRASHED"] = "unhandledErrorCaught";
121
+ ACTION["SELECT_ALL_CAUGHT"] = "selectAllCaught";
122
+ ACTION["SELECT_ALL_ESCAPED"] = "selectAllEscaped";
123
+ ACTION["SORT_COLUMN"] = "sortedColumn";
124
+ ACTION["SORT_COLUMN_NOT_ALLOWED"] = "sortColumnNotAllowed";
125
+ ACTION["CREATE_NOT_ALLOWED"] = "createNotAllowed";
126
+ ACTION["UNSUPPORTED_CONTENT_LEVELS_TRACKING_SUCCEEDED"] = "unsupportedContentLevelsTrackingSucceeded";
127
+ ACTION["UNSUPPORTED_CONTENT_LEVELS_TRACKING_ERRORED"] = "unsupportedContentLevelsTrackingErrored";
128
+ ACTION["UNSUPPORTED_TOOLTIP_VIEWED"] = "viewed";
119
129
  })(ACTION || (ACTION = {}));
120
130
 
121
131
  export let INPUT_METHOD;
@@ -202,6 +212,10 @@ export let ACTION_SUBJECT;
202
212
  ACTION_SUBJECT["CREATE_LINK_INLINE_DIALOG"] = "createLinkInlineDialog";
203
213
  ACTION_SUBJECT["CODE_BLOCK"] = "codeBlock";
204
214
  ACTION_SUBJECT["REACT_EDITOR_VIEW"] = "reactEditorView";
215
+ ACTION_SUBJECT["RENDERER"] = "renderer";
216
+ ACTION_SUBJECT["ANCHOR_LINK"] = "anchorLink";
217
+ ACTION_SUBJECT["LINK"] = "link";
218
+ ACTION_SUBJECT["TOOLTIP"] = "tooltip";
205
219
  })(ACTION_SUBJECT || (ACTION_SUBJECT = {}));
206
220
 
207
221
  export let ACTION_SUBJECT_ID;
@@ -319,9 +333,14 @@ export let ACTION_SUBJECT_ID;
319
333
  ACTION_SUBJECT_ID["TYPEAHEAD_QUICK_INSERT"] = "quickInsertTypeAhead";
320
334
  ACTION_SUBJECT_ID["UNKNOWN_NODE"] = "unknownNode";
321
335
  ACTION_SUBJECT_ID["UNLINK"] = "unlink";
336
+ ACTION_SUBJECT_ID["HEADING_ANCHOR_LINK"] = "headingAnchorLink";
337
+ ACTION_SUBJECT_ID["UNSUPPORTED_ERROR"] = "unsupportedUnhandled";
338
+ ACTION_SUBJECT_ID["UNSUPPORTED_NODE_ATTRIBUTE"] = "unsupportedNodeAttribute";
322
339
  ACTION_SUBJECT_ID["UNSUPPORTED_BLOCK"] = "unsupportedBlock";
323
340
  ACTION_SUBJECT_ID["UNSUPPORTED_INLINE"] = "unsupportedInline";
324
341
  ACTION_SUBJECT_ID["UNSUPPORTED_MARK"] = "unsupportedMark";
342
+ ACTION_SUBJECT_ID["ON_UNSUPPORTED_INLINE"] = "onUnsupportedInline";
343
+ ACTION_SUBJECT_ID["ON_UNSUPPORTED_BLOCK"] = "onUnsupportedBlock";
325
344
  })(ACTION_SUBJECT_ID || (ACTION_SUBJECT_ID = {}));
326
345
 
327
346
  export let FLOATING_CONTROLS_TITLE;
@@ -1,15 +1,16 @@
1
1
  /**
2
2
  * NOTE:
3
3
  *
4
- * This file is automatically generated by i18n-tools.
5
- * DO NOT CHANGE IT BY HAND or your changes will be lost.
4
+ * ED-16073:
5
+ * This was manually updated since the original `@atlaskit/i18n-tools` has been deprecated
6
6
  */
7
7
  export { default as zh } from './zh';
8
8
  export { default as zh_TW } from './zh_TW';
9
9
  export { default as cs } from './cs';
10
10
  export { default as da } from './da';
11
11
  export { default as nl } from './nl';
12
- export { default as et } from './et';
12
+ export { default as en } from './en';
13
+ export { default as en_GB } from './en_GB';
13
14
  export { default as fi } from './fi';
14
15
  export { default as fr } from './fr';
15
16
  export { default as de } from './de';
@@ -0,0 +1,34 @@
1
+ /**
2
+ * NOTE:
3
+ *
4
+ * ED-16073:
5
+ * This was manually updated since the original `@atlaskit/i18n-tools` has been deprecated
6
+ */
7
+ export default {
8
+ zh: 'Chinese (Simplified)',
9
+ zh_TW: 'Chinese (Traditional)',
10
+ cs: 'Czech',
11
+ da: 'Danish',
12
+ nl: 'Dutch',
13
+ en: 'English',
14
+ en_GB: 'English (United Kingdom)',
15
+ fi: 'Finnish',
16
+ fr: 'French',
17
+ de: 'German',
18
+ hu: 'Hungarian',
19
+ it: 'Italian',
20
+ ja: 'Japanese',
21
+ ko: 'Korean',
22
+ nb: 'Norwegian Bokmål',
23
+ pl: 'Polish',
24
+ pt_BR: 'Portuguese (Brazil)',
25
+ pt_PT: 'Portuguese (Portugal)',
26
+ ru: 'Russian',
27
+ sk: 'Slovak',
28
+ es: 'Spanish',
29
+ sv: 'Swedish',
30
+ th: 'Thai',
31
+ tr: 'Turkish',
32
+ uk: 'Ukrainian',
33
+ vi: 'Vietnamese'
34
+ };
@@ -144,6 +144,53 @@ export function findShortcutByKeymap(keymap) {
144
144
 
145
145
  return keymap.windows;
146
146
  }
147
+ export function getAriaKeyshortcuts(keymap) {
148
+ let keyShortcuts;
149
+
150
+ if (typeof keymap === 'string') {
151
+ keyShortcuts = keymap;
152
+ } else if (typeof keymap === 'object') {
153
+ keyShortcuts = keymap[browser.mac ? 'mac' : 'windows'];
154
+ }
155
+
156
+ if (keyShortcuts) {
157
+ return keyShortcuts.toLowerCase().split('-').map(modifier => {
158
+ switch (modifier) {
159
+ case 'cmd':
160
+ return 'Meta';
161
+
162
+ case 'ctrl':
163
+ return 'Control';
164
+
165
+ case 'alt':
166
+ return 'Alt';
167
+
168
+ case 'shift':
169
+ return 'Shift';
170
+
171
+ case 'enter':
172
+ return 'Enter';
173
+
174
+ case 'esc':
175
+ return 'Esc';
176
+
177
+ case 'tab':
178
+ return 'Tab';
179
+
180
+ case 'space':
181
+ return 'Space';
182
+
183
+ case 'backspace':
184
+ return 'Backspace';
185
+
186
+ default:
187
+ return modifier.split('').join(' ');
188
+ }
189
+ }).join('+');
190
+ } else {
191
+ return undefined;
192
+ }
193
+ }
147
194
  const ALL = [toggleOrderedList, toggleBulletList, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleCode, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleBlockQuote, insertNewLine, insertRule, splitCodeBlock, splitListItem, redo, undo, find, escape, enter, shiftEnter];
148
195
  export function makeKeymap(description, windows, mac, common) {
149
196
  return {
@@ -9,7 +9,7 @@ export { ruleSharedStyles } from './shared/rule';
9
9
  export { whitespaceSharedStyles } from './shared/whitespace';
10
10
  export { paragraphSharedStyles } from './shared/paragraph';
11
11
  export { linkSharedStyle } from './shared/link';
12
- export { listsSharedStyles, listPaddingLeftMarkerSpace } from './shared/lists';
12
+ export { listsSharedStyles, listItemCounterPadding, getOrderedListInlineStyles } from './shared/lists';
13
13
  export { indentationSharedStyles } from './shared/indentation';
14
14
  export { blockMarksSharedStyles } from './shared/block-marks';
15
15
  export { codeMarkSharedStyles } from './shared/code-mark';
@@ -15,14 +15,13 @@ const Y200a = 'rgba(255, 196, 0, 0.82)';
15
15
  const DY75a = 'rgba(111, 92, 37, 0.5)';
16
16
  const DY200 = '#82641c';
17
17
  export const AnnotationSharedCSSByState = props => ({
18
- /* eslint-disable */
19
18
  focus: css`
20
19
  // Background is not coming through in confluence, suspecting to be caused by some specific combination of
21
20
  // emotion and token look up
22
21
 
23
22
  background: ${themed({
24
- light: Y75,
25
- dark: DY75
23
+ light: token('color.background.accent.yellow.subtler', Y75),
24
+ dark: token('color.background.accent.yellow.subtler', DY75)
26
25
  })(props)};
27
26
  border-bottom: 2px solid
28
27
  ${themed({
@@ -35,8 +34,8 @@ export const AnnotationSharedCSSByState = props => ({
35
34
  `,
36
35
  blur: css`
37
36
  background: ${themed({
38
- light: Y75a,
39
- dark: DY75a
37
+ light: token('color.background.accent.yellow.subtlest', Y75a),
38
+ dark: token('color.background.accent.yellow.subtlest', DY75a)
40
39
  })(props)};
41
40
  border-bottom: 2px solid
42
41
  ${themed({
@@ -45,8 +44,6 @@ export const AnnotationSharedCSSByState = props => ({
45
44
  })(props)};
46
45
  cursor: pointer;
47
46
  `
48
- /* eslint-enable */
49
-
50
47
  });
51
48
  export const annotationSharedStyles = props => css`
52
49
  .ProseMirror {
@@ -6,7 +6,14 @@ export const blockMarksSharedStyles = css`
6
6
  */
7
7
  *:not(.fabric-editor-block-mark) >,
8
8
  /* For nested block marks apart from those with indentation mark */
9
- *:not(.fabric-editor-block-mark) > div.fabric-editor-block-mark:first-of-type:not(.fabric-editor-indentation-mark),
9
+ *:not(.fabric-editor-block-mark) >
10
+ div.fabric-editor-block-mark:first-of-type
11
+ /* Do not remove the margin top for nodes inside indentation marks */
12
+ :not(.fabric-editor-indentation-mark)
13
+ /* Do not remove the margin top for nodes inside alignment marks */
14
+ :not(.fabric-editor-alignment),
15
+ // If first element inside a block node has alignment mark, then remove the margin-top
16
+ .fabric-editor-alignment:first-of-type:first-child,
10
17
  // If first document element has indentation mark remove margin-top
11
18
  .ProseMirror .fabric-editor-indentation-mark:first-of-type:first-child {
12
19
  p,
@@ -56,19 +56,20 @@ export const codeBlockSharedStyles = props => css`
56
56
  overflow-x: auto;
57
57
 
58
58
  background-image: ${overflowShadow({
59
- // TODO: https://product-fabric.atlassian.net/browse/DSP-4118
60
59
  background: themed({
61
60
  light: token('color.background.neutral', N20),
62
61
  dark: token('color.background.neutral', DN50)
63
62
  })(props),
64
- width: '8px'
63
+ leftCoverWidth: `${gridSize() * 3}px`
65
64
  })};
66
65
 
67
66
  background-repeat: no-repeat;
68
- background-attachment: local, local, local, local, scroll, scroll;
69
- background-size: 8px 100%, 8px 100%, 8px 100%, 8px 100%, 8px 100%,
70
- 8px 100%;
71
- background-position: 0 0, 0 0, 100% 0, 100% 0, 100% 0, 0 0;
67
+ background-attachment: local, local, local, local, scroll, scroll, scroll,
68
+ scroll;
69
+ background-size: ${gridSize() * 3}px 100%, ${gridSize() * 3}px 100%,
70
+ ${gridSize()}px 100%, ${gridSize()}px 100%, ${gridSize()}px 100%,
71
+ 1px 100%, ${gridSize()}px 100%, 1px 100%;
72
+ background-position: 0 0, 0 0, 100% 0, 100% 0, 100% 0, 100% 0, 0 0, 0 0;
72
73
 
73
74
  /* Be careful if refactoring this; it is needed to keep arrow key navigation in Firefox consistent with other browsers. */
74
75
  overflow-y: hidden;
@@ -1,14 +1,56 @@
1
1
  import { css } from '@emotion/react';
2
2
  import { bulletListSelector, orderedListSelector } from '@atlaskit/adf-schema';
3
3
  import browser from '../../utils/browser';
4
- export const listPaddingLeftMarkerSpace = 24;
4
+ export const listItemCounterPadding = 24;
5
+ var CSS_VAR_NAMES;
6
+
7
+ (function (CSS_VAR_NAMES) {
8
+ CSS_VAR_NAMES["ITEM_COUNTER_PADDING"] = "--ed--list--item-counter--padding";
9
+ })(CSS_VAR_NAMES || (CSS_VAR_NAMES = {}));
10
+
11
+ const getItemCounterLeftPadding = itemCounterDigitsSize => {
12
+ // Previous padding-left was approximately 24px. We approximate that
13
+ // same value using "ch" units (which represent the width of a "0" digit
14
+ // character). We use "ch" so that this computed padding can now grow if
15
+ // the font-size ever enlarges.
16
+ let paddingLeft = `2.385ch`;
17
+
18
+ if (itemCounterDigitsSize >= 3) {
19
+ // When there are 3 or more digits, we use a combination of "ch" units and
20
+ // pixel values so that while the computed padding grows if font-size ever
21
+ // enlarges, it doesn't over-scale with each digit (because of the fixed pixel
22
+ // portion of the computed value). This way, very large item counters will not
23
+ // become overly left-padded.
24
+ const fixedBasePx = 2;
25
+ paddingLeft = `calc(${itemCounterDigitsSize + 1}ch - ${fixedBasePx}px)`;
26
+ }
27
+
28
+ return paddingLeft;
29
+ };
30
+
31
+ const stringifyStyle = style => Object.entries(style).reduce((str, [key, value]) => `${str}${key}:${value};`, ``);
32
+
33
+ export function getOrderedListInlineStyles(itemCounterDigitsSize, styleFormat) {
34
+ const style = {
35
+ [CSS_VAR_NAMES.ITEM_COUNTER_PADDING]: getItemCounterLeftPadding(itemCounterDigitsSize)
36
+ };
37
+
38
+ if (styleFormat === 'string') {
39
+ return stringifyStyle(style);
40
+ }
41
+
42
+ return style;
43
+ }
5
44
  export const listsSharedStyles = css`
6
45
  /* =============== INDENTATION SPACING ========= */
7
46
 
8
47
  ul,
9
48
  ol {
10
49
  box-sizing: border-box;
11
- padding-left: ${listPaddingLeftMarkerSpace}px;
50
+ padding-left: var(
51
+ ${CSS_VAR_NAMES.ITEM_COUNTER_PADDING},
52
+ ${listItemCounterPadding}px
53
+ );
12
54
 
13
55
  /*
14
56
  Firefox does not handle empty block element inside li tag.
@@ -1,5 +1,7 @@
1
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
1
2
  import { css } from '@emotion/react';
2
3
  import { PanelType } from '@atlaskit/adf-schema';
4
+ import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
3
5
  import { akEditorTableCellMinWidth, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
4
6
  import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
5
7
  import { emojiImage, emojiSprite } from '@atlaskit/emoji';
@@ -16,9 +18,6 @@ const tokenPanelColor = {
16
18
  error: 'color.background.danger'
17
19
  };
18
20
  const lightPanelColor = {
19
- // TODO: https://product-fabric.atlassian.net/browse/DSP-4066
20
-
21
- /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
22
21
  info: colors.B50,
23
22
  note: colors.P50,
24
23
  tip: colors.G50,
@@ -88,8 +87,6 @@ export const darkPanelColors = {
88
87
  LightGray: '#5A6977',
89
88
  TextColor: '#D9DDE3'
90
89
  };
91
- /* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
92
-
93
90
  const lightIconColor = {
94
91
  info: token('color.icon.information', colors.B400),
95
92
  note: token('color.icon.discovery', colors.P400),
@@ -111,13 +108,13 @@ const darkIconColor = {
111
108
  const panelEmojiSpriteVerticalAlignment = -(gridSize() * 3 - akEditorCustomIconSize) / 2;
112
109
  const panelEmojiImageVerticalAlignment = panelEmojiSpriteVerticalAlignment - 1; // TODO: https://product-fabric.atlassian.net/browse/DSP-4066
113
110
 
114
- /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
111
+ const panelDarkModeColors = [[colors.B50, darkPanelColors.B1200S], [colors.B75, darkPanelColors.B900], [colors.B100, darkPanelColors.B800S], [colors.N0, darkPanelColors.LightGray], [colors.N20, darkPanelColors.Gray], [colors.N60, darkPanelColors.DarkGray], [colors.T50, darkPanelColors.T1200S], [colors.T75, darkPanelColors.T900], [colors.T100, darkPanelColors.T900S], [colors.G50, darkPanelColors.G1200S], [colors.G75, darkPanelColors.G900], [colors.G200, darkPanelColors.G900S], [colors.Y50, darkPanelColors.Y1200S], [colors.Y75, darkPanelColors.Y900], [colors.Y200, darkPanelColors.Y800S], [colors.R50, darkPanelColors.R1200S], [colors.R75, darkPanelColors.R900], [colors.R100, darkPanelColors.R800S], [colors.P50, darkPanelColors.P1200S], [colors.P75, darkPanelColors.P900], [colors.P100, darkPanelColors.P800S]]; // used for custom panels
115
112
 
116
- const panelDarkModeColors = [[colors.B50, darkPanelColors.B1200S], [colors.B75, darkPanelColors.B900], [colors.B100, darkPanelColors.B800S], [colors.N0, darkPanelColors.LightGray], [colors.N20, darkPanelColors.Gray], [colors.N60, darkPanelColors.DarkGray], [colors.T50, darkPanelColors.T1200S], [colors.T75, darkPanelColors.T900], [colors.T100, darkPanelColors.T900S], [colors.G50, darkPanelColors.G1200S], [colors.G75, darkPanelColors.G900], [colors.G200, darkPanelColors.G900S], [colors.Y50, darkPanelColors.Y1200S], [colors.Y75, darkPanelColors.Y900], [colors.Y200, darkPanelColors.Y800S], [colors.R50, darkPanelColors.R1200S], [colors.R75, darkPanelColors.R900], [colors.R100, darkPanelColors.R800S], [colors.P50, darkPanelColors.P1200S], [colors.P75, darkPanelColors.P900], [colors.P100, darkPanelColors.P800S]];
117
113
  export const getPanelDarkColor = panelColor => {
118
114
  const colorObject = panelDarkModeColors.find(color => color[0] === panelColor || color[1] === panelColor);
119
115
  return colorObject ? colorObject[1] : darkPanelColors.B1200S;
120
- };
116
+ }; // used for custom panels
117
+
121
118
  export const getPanelBackgroundDarkModeColors = panelDarkModeColors.map(([colorName, colorValue]) => getPanelDarkModeCSS(colorName, colorValue)).join('\n');
122
119
  export function getPanelDarkModeCSS(colorName, colorValue) {
123
120
  return `
@@ -183,10 +180,8 @@ export const getPanelTypeBackground = (panelType, props = {}) => {
183
180
  // TODO: https://product-fabric.atlassian.net/browse/DSP-4066
184
181
 
185
182
  /* eslint-disable @atlaskit/design-system/no-unsafe-design-token-usage */
186
- const light = token(tokenPanelColor[panelType], lightPanelColor[panelType]);
183
+ const light = hexToEditorBackgroundPaletteColor(lightPanelColor[panelType]);
187
184
  const dark = token(tokenPanelColor[panelType], darkPanelColors[panelType]);
188
- /* eslint-disable @atlaskit/design-system/no-unsafe-design-token-usage */
189
-
190
185
  const background = themed({
191
186
  light,
192
187
  dark
@@ -1,8 +1,8 @@
1
1
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
2
- // TODO: https://product-fabric.atlassian.net/browse/DSP-4116
3
2
  import { css } from '@emotion/react';
4
3
  import { akEditorShadowZIndex } from '@atlaskit/editor-shared-styles';
5
4
  import { N40A } from '@atlaskit/theme/colors';
5
+ import { token } from '@atlaskit/tokens';
6
6
  import { shadowClassNames } from '../../ui/OverflowShadow';
7
7
  import { shadowObserverClassNames } from '../../ui/OverflowShadow/shadowObserver';
8
8
  const shadowWidth = 8;
@@ -41,7 +41,16 @@ const shadowSharedStyle = css`
41
41
  }
42
42
 
43
43
  & .${shadowClassNames.LEFT_SHADOW}::before {
44
- background: linear-gradient(to left, rgba(99, 114, 130, 0) 0, ${N40A} 100%);
44
+ background: linear-gradient(
45
+ to left,
46
+ transparent 0,
47
+ ${token('elevation.shadow.overflow.spread', N40A)} 100%
48
+ ),
49
+ linear-gradient(
50
+ to right,
51
+ ${token('elevation.shadow.overflow.perimeter', 'transparent')} 0px,
52
+ transparent 1px
53
+ );
45
54
  top: 0px;
46
55
  left: 0;
47
56
  display: block;
@@ -49,14 +58,20 @@ const shadowSharedStyle = css`
49
58
 
50
59
  & .${shadowClassNames.RIGHT_SHADOW}::after {
51
60
  background: linear-gradient(
52
- to right,
53
- rgba(99, 114, 130, 0) 0,
54
- ${N40A} 100%
55
- );
61
+ to right,
62
+ transparent 0,
63
+ ${token('elevation.shadow.overflow.spread', N40A)} 100%
64
+ ),
65
+ linear-gradient(
66
+ to left,
67
+ ${token('elevation.shadow.overflow.perimeter', 'transparent')} 0px,
68
+ transparent 1px
69
+ );
56
70
  left: calc(100% - ${shadowWidth}px);
57
71
  top: 0px;
58
72
  display: block;
59
73
  }
74
+
60
75
  & .${shadowObserverClassNames.SENTINEL_LEFT} {
61
76
  height: 100%;
62
77
  width: 0px;
@@ -1,5 +1,4 @@
1
1
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
2
- // TODO: https://product-fabric.atlassian.net/browse/DSP-4118
3
2
  import { css } from '@emotion/react';
4
3
  import { tableCellContentDomSelector, tableCellSelector, tableHeaderSelector, tablePrefixSelector } from '@atlaskit/adf-schema';
5
4
  import { akEditorBreakoutPadding, akEditorFullWidthLayoutWidth, akEditorSelectedNodeClassName, akEditorTableBorder, akEditorTableBorderDark, akEditorTableNumberColumnWidth, akEditorTableToolbar, akEditorTableToolbarDark, akEditorWideLayoutWidth, getTableCellBackgroundDarkModeColors, overflowShadow } from '@atlaskit/editor-shared-styles';
@@ -158,7 +157,7 @@ const tableSharedStyle = props => css`
158
157
  light: token('color.background.neutral', 'rgb(235, 237, 240)'),
159
158
  dark: token('color.background.neutral', 'rgb(36, 47, 66)')
160
159
  })(props),
161
- width: `${gridSize()}px`
160
+ leftCoverWidth: `${gridSize() * 3}px`
162
161
  })};
163
162
 
164
163
  background-color: ${themed({
@@ -181,7 +180,7 @@ const tableSharedStyle = props => css`
181
180
  light: token('color.background.neutral', 'rgb(235, 237, 240)'),
182
181
  dark: token('color.background.neutral', 'rgb(36, 47, 66)')
183
182
  })(props),
184
- width: `${gridSize()}px`
183
+ leftCoverWidth: `${gridSize() * 3}px`
185
184
  })}!important;
186
185
 
187
186
  background-color: ${themed({
@@ -0,0 +1 @@
1
+ export {};
@@ -10,7 +10,7 @@ import { borderRadius, gridSize } from '@atlaskit/theme/constants';
10
10
  import { token } from '@atlaskit/tokens';
11
11
  import Layer from '../Layer';
12
12
  const packageName = "@atlaskit/editor-common";
13
- const packageVersion = "71.0.3";
13
+ const packageVersion = "72.0.0";
14
14
  const halfFocusRing = 1;
15
15
  const dropOffset = `0, ${gridSize()}px`;
16
16
 
@@ -7,13 +7,16 @@ export default class EmojiNode extends PureComponent {
7
7
  super(props);
8
8
 
9
9
  _defineProperty(this, "renderWithProvider", providers => {
10
+ var _resourceConfig$optim;
11
+
10
12
  const {
11
13
  allowTextFallback,
12
14
  shortName,
13
15
  id,
14
16
  fallback,
15
17
  fitToHeight,
16
- showTooltip
18
+ showTooltip,
19
+ resourceConfig
17
20
  } = this.props;
18
21
 
19
22
  if (allowTextFallback && !providers.emojiProvider) {
@@ -36,7 +39,13 @@ export default class EmojiNode extends PureComponent {
36
39
  },
37
40
  emojiProvider: providers.emojiProvider,
38
41
  showTooltip: showTooltip,
39
- fitToHeight: fitToHeight
42
+ fitToHeight: fitToHeight,
43
+ optimistic: true,
44
+ optimisticImageURL: resourceConfig === null || resourceConfig === void 0 ? void 0 : (_resourceConfig$optim = resourceConfig.optimisticImageApi) === null || _resourceConfig$optim === void 0 ? void 0 : _resourceConfig$optim.getUrl({
45
+ id,
46
+ fallback,
47
+ shortName
48
+ })
40
49
  });
41
50
  });
42
51