@atlaskit/editor-common 116.0.0 → 116.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 116.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`1abdd6ae1f4aa`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1abdd6ae1f4aa) -
8
+ Add renderUnicodeEmojiAsImage prop to render unicode emojis as images via OffscreenCanvas, with
9
+ override to text as alternative
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 116.1.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [`bf27b605e0e68`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bf27b605e0e68) -
20
+ add analytics to track review button exposure in the pinned toolbar once per session
21
+
22
+ ### Patch Changes
23
+
24
+ - [`4543a53261907`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4543a53261907) -
25
+ Fix code block language picker behaviour for auto-detection state, cap the picker trigger width,
26
+ keep detected labels stable across toolbar updates, and avoid selecting the whole code block when
27
+ dragging across multiple code lines.
28
+ - Updated dependencies
29
+
3
30
  ## 116.0.0
4
31
 
5
32
  ### Major Changes
@@ -56,6 +56,11 @@ var normalizeMarkdownCodeBlockAttrsInSlice = exports.normalizeMarkdownCodeBlockA
56
56
  var isReplaceStep = function isReplaceStep(step) {
57
57
  return step instanceof _transform.ReplaceStep || step instanceof _transform.ReplaceAroundStep;
58
58
  };
59
+ var isNodeShellReplaceStep = function isNodeShellReplaceStep(step) {
60
+ return step instanceof _transform.ReplaceAroundStep &&
61
+ // Node shell updates preserve all inner content and only replace the outer node boundary.
62
+ step.gapFrom === step.from + 1 && step.gapTo === step.to - 1;
63
+ };
59
64
  var hasInsertedCodeBlockInStep = function hasInsertedCodeBlockInStep(step, codeBlockType, filter) {
60
65
  var hasInsertedCodeBlock = false;
61
66
  step.slice.content.descendants(function (node) {
@@ -91,6 +96,12 @@ var getInsertedCodeBlocksInTransaction = exports.getInsertedCodeBlocksInTransact
91
96
  if (!isReplaceStep(step)) {
92
97
  return;
93
98
  }
99
+
100
+ // Attribute/type updates can replace just the node shell while preserving content.
101
+ // Those should not make an existing code block look newly inserted.
102
+ if (isNodeShellReplaceStep(step)) {
103
+ return;
104
+ }
94
105
  var insertedCodeBlockByStep = hasInsertedCodeBlockInStep(step, codeBlockType, options.filter);
95
106
  if (!insertedCodeBlockByStep) {
96
107
  return;
@@ -102,5 +102,10 @@ var codeBlockButtonMessages = exports.codeBlockButtonMessages = (0, _reactIntl.d
102
102
  id: 'fabric.editor.codeBlock.all',
103
103
  defaultMessage: 'All',
104
104
  description: 'Section heading for all languages in the code block language picker.'
105
+ },
106
+ downloadCodeBlock: {
107
+ id: 'fabric.editor.codeBlockDownloadButton.downloadCodeBlock',
108
+ defaultMessage: 'Download',
109
+ description: 'Download the content of the code block as a file'
105
110
  }
106
111
  });
@@ -28,7 +28,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
28
28
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
29
29
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
30
30
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
31
- var packageVersion = "115.16.1";
31
+ var packageVersion = "116.1.0";
32
32
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
33
33
  // Remove URL as it has UGC
34
34
  // Ignored via go/ees007
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
24
24
  * @jsx jsx
25
25
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "115.16.1";
27
+ var packageVersion = "116.1.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -49,7 +49,8 @@ var EmojiNodeFunctional = function EmojiNodeFunctional(props) {
49
49
  fallback: fallback,
50
50
  shortName: shortName
51
51
  }),
52
- editorEmoji: true
52
+ editorEmoji: true,
53
+ renderUnicodeEmojiAsImage: false
53
54
  });
54
55
  };
55
56
  var EmojiNode = function EmojiNode(_ref) {
@@ -46,6 +46,9 @@ export const normalizeMarkdownCodeBlockAttrsInSlice = (slice, schema) => {
46
46
  });
47
47
  };
48
48
  const isReplaceStep = step => step instanceof ReplaceStep || step instanceof ReplaceAroundStep;
49
+ const isNodeShellReplaceStep = step => step instanceof ReplaceAroundStep &&
50
+ // Node shell updates preserve all inner content and only replace the outer node boundary.
51
+ step.gapFrom === step.from + 1 && step.gapTo === step.to - 1;
49
52
  const hasInsertedCodeBlockInStep = (step, codeBlockType, filter) => {
50
53
  let hasInsertedCodeBlock = false;
51
54
  step.slice.content.descendants(node => {
@@ -80,6 +83,12 @@ export const getInsertedCodeBlocksInTransaction = (tr, codeBlockType, options =
80
83
  if (!isReplaceStep(step)) {
81
84
  return;
82
85
  }
86
+
87
+ // Attribute/type updates can replace just the node shell while preserving content.
88
+ // Those should not make an existing code block look newly inserted.
89
+ if (isNodeShellReplaceStep(step)) {
90
+ return;
91
+ }
83
92
  const insertedCodeBlockByStep = hasInsertedCodeBlockInStep(step, codeBlockType, options.filter);
84
93
  if (!insertedCodeBlockByStep) {
85
94
  return;
@@ -96,5 +96,10 @@ export const codeBlockButtonMessages = defineMessages({
96
96
  id: 'fabric.editor.codeBlock.all',
97
97
  defaultMessage: 'All',
98
98
  description: 'Section heading for all languages in the code block language picker.'
99
+ },
100
+ downloadCodeBlock: {
101
+ id: 'fabric.editor.codeBlockDownloadButton.downloadCodeBlock',
102
+ defaultMessage: 'Download',
103
+ description: 'Download the content of the code block as a file'
99
104
  }
100
105
  });
@@ -14,7 +14,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
14
14
  const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
15
15
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
16
16
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
17
- const packageVersion = "115.16.1";
17
+ const packageVersion = "116.1.0";
18
18
  const sanitiseSentryEvents = (data, _hint) => {
19
19
  // Remove URL as it has UGC
20
20
  // Ignored via go/ees007
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "115.16.1";
17
+ const packageVersion = "116.1.0";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -39,7 +39,8 @@ const EmojiNodeFunctional = props => {
39
39
  fallback,
40
40
  shortName
41
41
  }),
42
- editorEmoji: true
42
+ editorEmoji: true,
43
+ renderUnicodeEmojiAsImage: false
43
44
  });
44
45
  };
45
46
  const EmojiNode = ({
@@ -50,6 +50,11 @@ export var normalizeMarkdownCodeBlockAttrsInSlice = function normalizeMarkdownCo
50
50
  var isReplaceStep = function isReplaceStep(step) {
51
51
  return step instanceof ReplaceStep || step instanceof ReplaceAroundStep;
52
52
  };
53
+ var isNodeShellReplaceStep = function isNodeShellReplaceStep(step) {
54
+ return step instanceof ReplaceAroundStep &&
55
+ // Node shell updates preserve all inner content and only replace the outer node boundary.
56
+ step.gapFrom === step.from + 1 && step.gapTo === step.to - 1;
57
+ };
53
58
  var hasInsertedCodeBlockInStep = function hasInsertedCodeBlockInStep(step, codeBlockType, filter) {
54
59
  var hasInsertedCodeBlock = false;
55
60
  step.slice.content.descendants(function (node) {
@@ -85,6 +90,12 @@ export var getInsertedCodeBlocksInTransaction = function getInsertedCodeBlocksIn
85
90
  if (!isReplaceStep(step)) {
86
91
  return;
87
92
  }
93
+
94
+ // Attribute/type updates can replace just the node shell while preserving content.
95
+ // Those should not make an existing code block look newly inserted.
96
+ if (isNodeShellReplaceStep(step)) {
97
+ return;
98
+ }
88
99
  var insertedCodeBlockByStep = hasInsertedCodeBlockInStep(step, codeBlockType, options.filter);
89
100
  if (!insertedCodeBlockByStep) {
90
101
  return;
@@ -96,5 +96,10 @@ export var codeBlockButtonMessages = defineMessages({
96
96
  id: 'fabric.editor.codeBlock.all',
97
97
  defaultMessage: 'All',
98
98
  description: 'Section heading for all languages in the code block language picker.'
99
+ },
100
+ downloadCodeBlock: {
101
+ id: 'fabric.editor.codeBlockDownloadButton.downloadCodeBlock',
102
+ defaultMessage: 'Download',
103
+ description: 'Download the content of the code block as a file'
99
104
  }
100
105
  });
@@ -20,7 +20,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
20
20
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
21
21
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
22
22
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
23
- var packageVersion = "115.16.1";
23
+ var packageVersion = "116.1.0";
24
24
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
25
25
  // Remove URL as it has UGC
26
26
  // Ignored via go/ees007
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import { fg } from '@atlaskit/platform-feature-flags';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "115.16.1";
24
+ var packageVersion = "116.1.0";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -41,7 +41,8 @@ var EmojiNodeFunctional = function EmojiNodeFunctional(props) {
41
41
  fallback: fallback,
42
42
  shortName: shortName
43
43
  }),
44
- editorEmoji: true
44
+ editorEmoji: true,
45
+ renderUnicodeEmojiAsImage: false
45
46
  });
46
47
  };
47
48
  var EmojiNode = function EmojiNode(_ref) {
@@ -13,6 +13,9 @@ type NoDiffSuggestionAEP = OperationalAEP<ACTION.NO_DIFF_FOUND, ACTION_SUBJECT.A
13
13
  type EntryPointClickedAEP = TrackAEP<ACTION.CLICKED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
14
14
  entryPoint: AiSuggestionsEntryPoint;
15
15
  }, undefined>;
16
+ type EntryPointExposureAEP = TrackAEP<ACTION.EXPOSED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
17
+ entryPoint: AiSuggestionsEntryPoint;
18
+ }, undefined>;
16
19
  type AcceptSuggestionAEP = TrackAEP<ACTION.ACCEPTED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
17
20
  affectedBlocks: number;
18
21
  charactersAdded: number;
@@ -34,5 +37,5 @@ type ViewSuggestionAEP = TrackAEP<ACTION.VIEWED, ACTION_SUBJECT.AI_SUGGESTIONS,
34
37
  suggestionCardCharacterCount: number;
35
38
  suggestionType: string;
36
39
  }, undefined>;
37
- export type AiSuggestionsEventPayload = NoDiffSuggestionAEP | EntryPointClickedAEP | AcceptSuggestionAEP | DiscardSuggestionAEP | ViewSuggestionAEP;
40
+ export type AiSuggestionsEventPayload = NoDiffSuggestionAEP | EntryPointClickedAEP | EntryPointExposureAEP | AcceptSuggestionAEP | DiscardSuggestionAEP | ViewSuggestionAEP;
38
41
  export {};
@@ -24,6 +24,11 @@ export declare const codeBlockButtonMessages: {
24
24
  description: string;
25
25
  id: string;
26
26
  };
27
+ downloadCodeBlock: {
28
+ defaultMessage: string;
29
+ description: string;
30
+ id: string;
31
+ };
27
32
  formatCode: {
28
33
  defaultMessage: string;
29
34
  description: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "116.0.0",
3
+ "version": "116.2.0",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -49,7 +49,7 @@
49
49
  "@atlaskit/editor-tables": "^3.0.0",
50
50
  "@atlaskit/editor-toolbar": "^2.0.0",
51
51
  "@atlaskit/editor-toolbar-model": "^1.0.0",
52
- "@atlaskit/emoji": "^71.0.0",
52
+ "@atlaskit/emoji": "^71.1.0",
53
53
  "@atlaskit/icon": "^36.0.0",
54
54
  "@atlaskit/link": "^4.0.0",
55
55
  "@atlaskit/link-datasource": "^6.0.0",
@@ -79,7 +79,7 @@
79
79
  "@atlaskit/task-decision": "^21.0.0",
80
80
  "@atlaskit/teams-app-config": "^2.0.0",
81
81
  "@atlaskit/textfield": "^9.0.0",
82
- "@atlaskit/tmp-editor-statsig": "^104.0.0",
82
+ "@atlaskit/tmp-editor-statsig": "^105.0.0",
83
83
  "@atlaskit/tokens": "^14.0.0",
84
84
  "@atlaskit/tooltip": "^23.0.0",
85
85
  "@atlaskit/width-detector": "^6.0.0",