@atlaskit/editor-plugin-code-block 14.1.4 → 14.1.5
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,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-code-block
|
|
2
2
|
|
|
3
|
+
## 14.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`a07646d6c829b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a07646d6c829b) -
|
|
8
|
+
Fix code block language selection analytics attributes
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 14.1.4
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -64,11 +64,12 @@ var changeLanguage = exports.changeLanguage = function changeLanguage(editorAnal
|
|
|
64
64
|
}
|
|
65
65
|
var node = state.doc.nodeAt(pos);
|
|
66
66
|
var localId = node === null || node === void 0 ? void 0 : node.attrs.localId;
|
|
67
|
-
var
|
|
67
|
+
var shouldIncludeAutoDetectionContext = (0, _expValEquals.expValEquals)('platform_editor_code_block_q4_lovability', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_code_block_language_detection_flow');
|
|
68
|
+
var previousAutoDetectEntry = shouldIncludeAutoDetectionContext ? (_autoDetectPluginKey$ = _autoDetectState.autoDetectPluginKey.getState(state)) === null || _autoDetectPluginKey$ === void 0 ? void 0 : _autoDetectPluginKey$.languageDetectionMap[localId] : undefined;
|
|
68
69
|
var tr = state.tr.setNodeMarkup(pos, codeBlock, _objectSpread(_objectSpread({}, node === null || node === void 0 ? void 0 : node.attrs), {}, {
|
|
69
70
|
language: language
|
|
70
71
|
})).setMeta('scrollIntoView', false);
|
|
71
|
-
if (
|
|
72
|
+
if (shouldIncludeAutoDetectionContext) {
|
|
72
73
|
tr.setMeta(_autoDetectState.autoDetectPluginKey, {
|
|
73
74
|
type: _actions.ACTIONS.REMOVE_AUTO_DETECT_ENTRY,
|
|
74
75
|
data: {
|
|
@@ -86,10 +87,10 @@ var changeLanguage = exports.changeLanguage = function changeLanguage(editorAnal
|
|
|
86
87
|
language: language !== null && language !== void 0 ? language : 'none'
|
|
87
88
|
}, selectionSource ? {
|
|
88
89
|
selectionSource: selectionSource
|
|
89
|
-
} : {}),
|
|
90
|
+
} : {}), shouldIncludeAutoDetectionContext ? {
|
|
90
91
|
autoDetectionResult: previousAutoDetectEntry === null || previousAutoDetectEntry === void 0 ? void 0 : previousAutoDetectEntry.detectionResult,
|
|
91
92
|
autoDetectedLanguage: previousAutoDetectEntry === null || previousAutoDetectEntry === void 0 ? void 0 : previousAutoDetectEntry.autoDetectedLanguage
|
|
92
|
-
}),
|
|
93
|
+
} : {}),
|
|
93
94
|
eventType: _analytics.EVENT_TYPE.TRACK
|
|
94
95
|
})(result);
|
|
95
96
|
dispatch(result);
|
|
@@ -54,12 +54,13 @@ export const changeLanguage = editorAnalyticsAPI => (language, selectionSource)
|
|
|
54
54
|
}
|
|
55
55
|
const node = state.doc.nodeAt(pos);
|
|
56
56
|
const localId = node === null || node === void 0 ? void 0 : node.attrs.localId;
|
|
57
|
-
const
|
|
57
|
+
const shouldIncludeAutoDetectionContext = expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true) && fg('platform_editor_code_block_language_detection_flow');
|
|
58
|
+
const previousAutoDetectEntry = shouldIncludeAutoDetectionContext ? (_autoDetectPluginKey$ = autoDetectPluginKey.getState(state)) === null || _autoDetectPluginKey$ === void 0 ? void 0 : _autoDetectPluginKey$.languageDetectionMap[localId] : undefined;
|
|
58
59
|
const tr = state.tr.setNodeMarkup(pos, codeBlock, {
|
|
59
60
|
...(node === null || node === void 0 ? void 0 : node.attrs),
|
|
60
61
|
language
|
|
61
62
|
}).setMeta('scrollIntoView', false);
|
|
62
|
-
if (
|
|
63
|
+
if (shouldIncludeAutoDetectionContext) {
|
|
63
64
|
tr.setMeta(autoDetectPluginKey, {
|
|
64
65
|
type: ACTIONS.REMOVE_AUTO_DETECT_ENTRY,
|
|
65
66
|
data: {
|
|
@@ -78,8 +79,10 @@ export const changeLanguage = editorAnalyticsAPI => (language, selectionSource)
|
|
|
78
79
|
...(selectionSource ? {
|
|
79
80
|
selectionSource
|
|
80
81
|
} : {}),
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
...(shouldIncludeAutoDetectionContext ? {
|
|
83
|
+
autoDetectionResult: previousAutoDetectEntry === null || previousAutoDetectEntry === void 0 ? void 0 : previousAutoDetectEntry.detectionResult,
|
|
84
|
+
autoDetectedLanguage: previousAutoDetectEntry === null || previousAutoDetectEntry === void 0 ? void 0 : previousAutoDetectEntry.autoDetectedLanguage
|
|
85
|
+
} : {})
|
|
83
86
|
},
|
|
84
87
|
eventType: EVENT_TYPE.TRACK
|
|
85
88
|
})(result);
|
|
@@ -53,11 +53,12 @@ export var changeLanguage = function changeLanguage(editorAnalyticsAPI) {
|
|
|
53
53
|
}
|
|
54
54
|
var node = state.doc.nodeAt(pos);
|
|
55
55
|
var localId = node === null || node === void 0 ? void 0 : node.attrs.localId;
|
|
56
|
-
var
|
|
56
|
+
var shouldIncludeAutoDetectionContext = expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true) && fg('platform_editor_code_block_language_detection_flow');
|
|
57
|
+
var previousAutoDetectEntry = shouldIncludeAutoDetectionContext ? (_autoDetectPluginKey$ = autoDetectPluginKey.getState(state)) === null || _autoDetectPluginKey$ === void 0 ? void 0 : _autoDetectPluginKey$.languageDetectionMap[localId] : undefined;
|
|
57
58
|
var tr = state.tr.setNodeMarkup(pos, codeBlock, _objectSpread(_objectSpread({}, node === null || node === void 0 ? void 0 : node.attrs), {}, {
|
|
58
59
|
language: language
|
|
59
60
|
})).setMeta('scrollIntoView', false);
|
|
60
|
-
if (
|
|
61
|
+
if (shouldIncludeAutoDetectionContext) {
|
|
61
62
|
tr.setMeta(autoDetectPluginKey, {
|
|
62
63
|
type: ACTIONS.REMOVE_AUTO_DETECT_ENTRY,
|
|
63
64
|
data: {
|
|
@@ -75,10 +76,10 @@ export var changeLanguage = function changeLanguage(editorAnalyticsAPI) {
|
|
|
75
76
|
language: language !== null && language !== void 0 ? language : 'none'
|
|
76
77
|
}, selectionSource ? {
|
|
77
78
|
selectionSource: selectionSource
|
|
78
|
-
} : {}),
|
|
79
|
+
} : {}), shouldIncludeAutoDetectionContext ? {
|
|
79
80
|
autoDetectionResult: previousAutoDetectEntry === null || previousAutoDetectEntry === void 0 ? void 0 : previousAutoDetectEntry.detectionResult,
|
|
80
81
|
autoDetectedLanguage: previousAutoDetectEntry === null || previousAutoDetectEntry === void 0 ? void 0 : previousAutoDetectEntry.autoDetectedLanguage
|
|
81
|
-
}),
|
|
82
|
+
} : {}),
|
|
82
83
|
eventType: EVENT_TYPE.TRACK
|
|
83
84
|
})(result);
|
|
84
85
|
dispatch(result);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-code-block",
|
|
3
|
-
"version": "14.1.
|
|
3
|
+
"version": "14.1.5",
|
|
4
4
|
"description": "Code block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"atlaskit:src": "src/index.ts",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@atlaskit/adf-schema": "^56.0.0",
|
|
23
|
-
"@atlaskit/button": "^24.
|
|
24
|
-
"@atlaskit/code": "^18.
|
|
23
|
+
"@atlaskit/button": "^24.2.0",
|
|
24
|
+
"@atlaskit/code": "^18.2.0",
|
|
25
25
|
"@atlaskit/css": "^1.0.0",
|
|
26
26
|
"@atlaskit/editor-plugin-analytics": "^12.0.0",
|
|
27
27
|
"@atlaskit/editor-plugin-block-menu": "^11.1.0",
|
|
@@ -34,21 +34,21 @@
|
|
|
34
34
|
"@atlaskit/editor-plugin-toolbar": "^9.0.0",
|
|
35
35
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
36
36
|
"@atlaskit/editor-shared-styles": "^4.0.0",
|
|
37
|
-
"@atlaskit/editor-toolbar": "^2.
|
|
38
|
-
"@atlaskit/flag": "^18.
|
|
39
|
-
"@atlaskit/frontend-utilities": "^4.
|
|
40
|
-
"@atlaskit/icon": "^36.
|
|
37
|
+
"@atlaskit/editor-toolbar": "^2.1.0",
|
|
38
|
+
"@atlaskit/flag": "^18.1.0",
|
|
39
|
+
"@atlaskit/frontend-utilities": "^4.1.0",
|
|
40
|
+
"@atlaskit/icon": "^36.1.0",
|
|
41
41
|
"@atlaskit/platform-feature-flags": "^2.0.0",
|
|
42
|
-
"@atlaskit/primitives": "^20.
|
|
42
|
+
"@atlaskit/primitives": "^20.1.0",
|
|
43
43
|
"@atlaskit/prosemirror-input-rules": "^4.0.0",
|
|
44
|
-
"@atlaskit/select": "^22.
|
|
44
|
+
"@atlaskit/select": "^22.2.0",
|
|
45
45
|
"@atlaskit/tmp-editor-statsig": "^114.0.0",
|
|
46
|
-
"@atlaskit/tokens": "^15.
|
|
46
|
+
"@atlaskit/tokens": "^15.1.0",
|
|
47
47
|
"@babel/runtime": "^7.0.0",
|
|
48
48
|
"@compiled/react": "^0.20.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@atlaskit/editor-common": "^116.
|
|
51
|
+
"@atlaskit/editor-common": "^116.15.0",
|
|
52
52
|
"react": "^18.2.0",
|
|
53
53
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
54
54
|
},
|