@atlaskit/editor-plugin-code-block 14.1.17 → 14.1.19

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,19 @@
1
1
  # @atlaskit/editor-plugin-code-block
2
2
 
3
+ ## 14.1.19
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b76b433b0c9ec`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b76b433b0c9ec) -
8
+ Fix code block detect language recent-language handling
9
+ - Updated dependencies
10
+
11
+ ## 14.1.18
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 14.1.17
4
18
 
5
19
  ### Patch Changes
@@ -34,7 +34,8 @@ var CodeBlockLanguagePicker = exports.CodeBlockLanguagePicker = function CodeBlo
34
34
  }, []);
35
35
  var handleSelection = (0, _react.useCallback)(function (option, selectionSource, interactionMethod) {
36
36
  var _api$analytics;
37
- var command = option.value === _languagePickerOptions.DETECT_LANGUAGE_VALUE && (0, _platformFeatureFlags.fg)('platform_editor_code_block_language_detection_flow') ? (0, _editorCommands.detectLanguage)() : (0, _editorCommands.changeLanguage)(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)(option.value, selectionSource);
37
+ var isDetectLanguageSelected = option.value === _languagePickerOptions.DETECT_LANGUAGE_VALUE;
38
+ var command = isDetectLanguageSelected && ((0, _platformFeatureFlags.fg)('platform_editor_code_block_ga_patch_1') || (0, _platformFeatureFlags.fg)('platform_editor_code_block_language_detection_flow')) ? (0, _editorCommands.detectLanguage)() : (0, _editorCommands.changeLanguage)(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)(option.value, selectionSource);
38
39
  var commandSucceeded = command(editorView.state, editorView.dispatch);
39
40
  if ((0, _platformFeatureFlags.fg)('platform_editor_code_block_dogfooding_patch')) {
40
41
  if ((0, _platformFeatureFlags.fg)('platform_editor_code_block_ga_patch_1')) {
@@ -56,7 +57,7 @@ var CodeBlockLanguagePicker = exports.CodeBlockLanguagePicker = function CodeBlo
56
57
  });
57
58
  }
58
59
  }
59
- if (commandSucceeded && option.value !== _languagePickerOptions.DETECT_LANGUAGE_VALUE) {
60
+ if (commandSucceeded && (option.value !== _languagePickerOptions.DETECT_LANGUAGE_VALUE || (0, _platformFeatureFlags.fg)('platform_editor_code_block_ga_patch_1'))) {
60
61
  (0, _recentLanguages.saveRecentLanguage)(option.value);
61
62
  setRecentLanguageValues((0, _recentLanguages.getRecentLanguages)());
62
63
  }
@@ -20,7 +20,8 @@ export const CodeBlockLanguagePicker = ({
20
20
  }, []);
21
21
  const handleSelection = useCallback((option, selectionSource, interactionMethod) => {
22
22
  var _api$analytics;
23
- const command = option.value === DETECT_LANGUAGE_VALUE && fg('platform_editor_code_block_language_detection_flow') ? detectLanguage() : changeLanguage(api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)(option.value, selectionSource);
23
+ const isDetectLanguageSelected = option.value === DETECT_LANGUAGE_VALUE;
24
+ const command = isDetectLanguageSelected && (fg('platform_editor_code_block_ga_patch_1') || fg('platform_editor_code_block_language_detection_flow')) ? detectLanguage() : changeLanguage(api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)(option.value, selectionSource);
24
25
  const commandSucceeded = command(editorView.state, editorView.dispatch);
25
26
  if (fg('platform_editor_code_block_dogfooding_patch')) {
26
27
  if (fg('platform_editor_code_block_ga_patch_1')) {
@@ -42,7 +43,7 @@ export const CodeBlockLanguagePicker = ({
42
43
  });
43
44
  }
44
45
  }
45
- if (commandSucceeded && option.value !== DETECT_LANGUAGE_VALUE) {
46
+ if (commandSucceeded && (option.value !== DETECT_LANGUAGE_VALUE || fg('platform_editor_code_block_ga_patch_1'))) {
46
47
  saveRecentLanguage(option.value);
47
48
  setRecentLanguageValues(getRecentLanguages());
48
49
  }
@@ -25,7 +25,8 @@ export var CodeBlockLanguagePicker = function CodeBlockLanguagePicker(_ref) {
25
25
  }, []);
26
26
  var handleSelection = useCallback(function (option, selectionSource, interactionMethod) {
27
27
  var _api$analytics;
28
- var command = option.value === DETECT_LANGUAGE_VALUE && fg('platform_editor_code_block_language_detection_flow') ? detectLanguage() : changeLanguage(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)(option.value, selectionSource);
28
+ var isDetectLanguageSelected = option.value === DETECT_LANGUAGE_VALUE;
29
+ var command = isDetectLanguageSelected && (fg('platform_editor_code_block_ga_patch_1') || fg('platform_editor_code_block_language_detection_flow')) ? detectLanguage() : changeLanguage(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)(option.value, selectionSource);
29
30
  var commandSucceeded = command(editorView.state, editorView.dispatch);
30
31
  if (fg('platform_editor_code_block_dogfooding_patch')) {
31
32
  if (fg('platform_editor_code_block_ga_patch_1')) {
@@ -47,7 +48,7 @@ export var CodeBlockLanguagePicker = function CodeBlockLanguagePicker(_ref) {
47
48
  });
48
49
  }
49
50
  }
50
- if (commandSucceeded && option.value !== DETECT_LANGUAGE_VALUE) {
51
+ if (commandSucceeded && (option.value !== DETECT_LANGUAGE_VALUE || fg('platform_editor_code_block_ga_patch_1'))) {
51
52
  saveRecentLanguage(option.value);
52
53
  setRecentLanguageValues(getRecentLanguages());
53
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-code-block",
3
- "version": "14.1.17",
3
+ "version": "14.1.19",
4
4
  "description": "Code block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -42,7 +42,7 @@
42
42
  "@atlaskit/primitives": "^20.5.0",
43
43
  "@atlaskit/prosemirror-input-rules": "^4.0.0",
44
44
  "@atlaskit/select": "^22.4.0",
45
- "@atlaskit/tmp-editor-statsig": "^123.0.0",
45
+ "@atlaskit/tmp-editor-statsig": "^124.1.0",
46
46
  "@atlaskit/tokens": "^15.5.0",
47
47
  "@babel/runtime": "^7.0.0",
48
48
  "@compiled/react": "^0.20.0"