@atlaskit/editor-common 114.31.0 → 114.32.1
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 +17 -0
- package/dist/cjs/analytics/types/enums.js +1 -0
- package/dist/cjs/code-block/index.js +10 -1
- package/dist/cjs/messages/codeBlockButton.js +10 -0
- package/dist/cjs/messages/syncBlock.js +1 -1
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/node-width/index.js +1 -3
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/processRawValue.js +3 -5
- package/dist/es2019/analytics/types/enums.js +1 -0
- package/dist/es2019/code-block/index.js +7 -0
- package/dist/es2019/messages/codeBlockButton.js +10 -0
- package/dist/es2019/messages/syncBlock.js +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/node-width/index.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/processRawValue.js +3 -5
- package/dist/esm/analytics/types/enums.js +1 -0
- package/dist/esm/code-block/index.js +9 -0
- package/dist/esm/messages/codeBlockButton.js +10 -0
- package/dist/esm/messages/syncBlock.js +1 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/node-width/index.js +1 -2
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/processRawValue.js +3 -5
- package/dist/types/analytics/types/enums.d.ts +1 -0
- package/dist/types/analytics/types/general-events.d.ts +6 -1
- package/dist/types/code-block/index.d.ts +2 -0
- package/dist/types/messages/codeBlockButton.d.ts +10 -0
- package/dist/types-ts4.5/analytics/types/enums.d.ts +1 -0
- package/dist/types-ts4.5/analytics/types/general-events.d.ts +6 -1
- package/dist/types-ts4.5/code-block/index.d.ts +2 -0
- package/dist/types-ts4.5/messages/codeBlockButton.d.ts +10 -0
- package/package.json +1 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 114.32.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4c459a2718b67`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4c459a2718b67) -
|
|
8
|
+
Clean up synced block feature gates
|
|
9
|
+
- [`05ed8529e66e1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/05ed8529e66e1) -
|
|
10
|
+
EDITOR-6686: migrate panel styles
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 114.32.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- [`7e8145e6a7ce6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7e8145e6a7ce6) -
|
|
18
|
+
Add ADF-backed code block line number visibility
|
|
19
|
+
|
|
3
20
|
## 114.31.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
|
@@ -208,6 +208,7 @@ var ACTION = exports.ACTION = /*#__PURE__*/function (ACTION) {
|
|
|
208
208
|
ACTION["UPLOAD_SUCCEEDED"] = "uploadSucceeded";
|
|
209
209
|
ACTION["UPLOAD_FAILED"] = "uploadFailed";
|
|
210
210
|
ACTION["TOGGLE_CODE_BLOCK_WRAP"] = "toggleCodeBlockWrap";
|
|
211
|
+
ACTION["TOGGLE_CODE_BLOCK_LINE_NUMBERS"] = "toggleCodeBlockLineNumbers";
|
|
211
212
|
ACTION["TRANSFORMED"] = "transformed";
|
|
212
213
|
ACTION["RESIZED"] = "resized";
|
|
213
214
|
ACTION["RESIZED_PERF_SAMPLING"] = "resizedPerfSampling";
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.updateCodeBlockWrappedStateNodeKeys = exports.transferCodeBlockWrappedValue = exports.setCodeBlockFoldState = exports.isCodeBlockWordWrapEnabled = exports.getDefaultCodeBlockAttrs = exports.getCodeBlockFoldState = exports.defaultWrapForMarkdownCodeBlocksInSlice = exports.defaultWordWrapState = exports.codeBlockWrappedStates = void 0;
|
|
7
|
+
exports.updateCodeBlockWrappedStateNodeKeys = exports.transferCodeBlockWrappedValue = exports.setCodeBlockFoldState = exports.isCodeBlockWordWrapEnabled = exports.getDefaultCodeBlockAttrs = exports.getCodeBlockFoldState = exports.defaultWrapForMarkdownCodeBlocksInSlice = exports.defaultWordWrapState = exports.codeBlockWrappedStates = exports.areCodeBlockLineNumbersVisible = exports.areCodeBlockLineNumbersHidden = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
10
10
|
var _slice = require("../utils/slice");
|
|
@@ -55,6 +55,15 @@ var isCodeBlockWordWrapEnabled = exports.isCodeBlockWordWrapEnabled = function i
|
|
|
55
55
|
var currentNodeWordWrapState = codeBlockWrappedStates.get(codeBlockNode);
|
|
56
56
|
return currentNodeWordWrapState !== undefined ? currentNodeWordWrapState : defaultWordWrapState;
|
|
57
57
|
};
|
|
58
|
+
var areCodeBlockLineNumbersHidden = exports.areCodeBlockLineNumbersHidden = function areCodeBlockLineNumbersHidden(codeBlockNode) {
|
|
59
|
+
if (!(0, _expValEquals.expValEquals)('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
return Boolean(codeBlockNode.attrs.hideLineNumbers);
|
|
63
|
+
};
|
|
64
|
+
var areCodeBlockLineNumbersVisible = exports.areCodeBlockLineNumbersVisible = function areCodeBlockLineNumbersVisible(codeBlockNode) {
|
|
65
|
+
return !areCodeBlockLineNumbersHidden(codeBlockNode);
|
|
66
|
+
};
|
|
58
67
|
var getCodeBlockFoldState = exports.getCodeBlockFoldState = function getCodeBlockFoldState(codeBlockNode) {
|
|
59
68
|
var currentNodeFoldState = codeBlockFoldStates.get(codeBlockNode);
|
|
60
69
|
return currentNodeFoldState || [];
|
|
@@ -38,6 +38,16 @@ var codeBlockButtonMessages = exports.codeBlockButtonMessages = (0, _reactIntl.d
|
|
|
38
38
|
defaultMessage: 'Unwrap code',
|
|
39
39
|
description: 'Tooltip for a code block toolbar button that turns off line wrapping. This is shown when code is wrapped.'
|
|
40
40
|
},
|
|
41
|
+
showLineNumbersLabel: {
|
|
42
|
+
id: 'fabric.editor.codeBlockLineNumbersButton.showLineNumbers',
|
|
43
|
+
defaultMessage: 'Show line numbers',
|
|
44
|
+
description: 'Tooltip for a code block toolbar button that shows line numbers. This is shown when line numbers are hidden.'
|
|
45
|
+
},
|
|
46
|
+
hideLineNumbersLabel: {
|
|
47
|
+
id: 'fabric.editor.codeBlockLineNumbersButton.hideLineNumbers',
|
|
48
|
+
defaultMessage: 'Hide line numbers',
|
|
49
|
+
description: 'Tooltip for a code block toolbar button that hides line numbers. This is shown when line numbers are visible.'
|
|
50
|
+
},
|
|
41
51
|
selectLanguage: {
|
|
42
52
|
id: 'fabric.editor.selectLanguage',
|
|
43
53
|
defaultMessage: 'Select language',
|
|
@@ -376,7 +376,7 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntl.defineMessage
|
|
|
376
376
|
unpublishedSyncBlockPastedDescriptionJiraWorkItem: {
|
|
377
377
|
id: 'fabric.editor.unpublishedSyncBlockPastedDescription.jiraWorkItem',
|
|
378
378
|
defaultMessage: "When the item's description is saved, the content will be displayed.",
|
|
379
|
-
description:
|
|
379
|
+
description: 'Description in flag which appears when a reference to a sync block whose source is a Jira work item with an unsaved description is pasted'
|
|
380
380
|
},
|
|
381
381
|
unsyncButton: {
|
|
382
382
|
id: 'fabric.editor.syncedBlock.unsync',
|
|
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
19
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
20
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
21
21
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
22
|
-
var packageVersion = "
|
|
22
|
+
var packageVersion = "0.0.0-development";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.layoutToWidth = exports.getTableWidthWithNumberColumn = exports.getTableContainerWidth = exports.getParentNodeWidth = exports.getNestedParentNode = void 0;
|
|
8
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
7
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
10
8
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
11
9
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
@@ -113,7 +111,7 @@ var getNestedParentNode = exports.getNestedParentNode = function getNestedParent
|
|
|
113
111
|
return null;
|
|
114
112
|
}
|
|
115
113
|
var $pos = state.doc.resolve(tablePos);
|
|
116
|
-
var parent = (0, _utils.findParentNodeOfTypeClosestToPos)($pos, [state.schema.nodes.bodiedExtension, state.schema.nodes.extensionFrame, state.schema.nodes.layoutSection, state.schema.nodes.expand, state.schema.nodes.tableCell, state.schema.nodes.tableHeader
|
|
114
|
+
var parent = (0, _utils.findParentNodeOfTypeClosestToPos)($pos, [state.schema.nodes.bodiedExtension, state.schema.nodes.extensionFrame, state.schema.nodes.layoutSection, state.schema.nodes.expand, state.schema.nodes.tableCell, state.schema.nodes.tableHeader, state.schema.nodes.bodiedSyncBlock]);
|
|
117
115
|
return parent ? parent.node : null;
|
|
118
116
|
};
|
|
119
117
|
var calcBreakoutNodeWidth = function calcBreakoutNodeWidth(layout, containerWidth, isFullWidthModeEnabled, breakoutWidth) {
|
|
@@ -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 = "
|
|
27
|
+
var packageVersion = "0.0.0-development";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -85,11 +85,9 @@ function processRawValueWithoutValidation(schema, value, dispatchAnalyticsEvent)
|
|
|
85
85
|
// Convert nested-table extensions into nested tables
|
|
86
86
|
var _transformNestedTable2 = transformNestedTablesWithAnalytics(node, dispatchAnalyticsEvent),
|
|
87
87
|
transformedAdf = _transformNestedTable2.transformedAdf;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
transformedAdf = result.transformedAdf;
|
|
92
|
-
}
|
|
88
|
+
var result = (0, _transforms.syncBlockFallbackTransform)(schema, transformedAdf);
|
|
89
|
+
if (result.isTransformed && result.transformedAdf) {
|
|
90
|
+
transformedAdf = result.transformedAdf;
|
|
93
91
|
}
|
|
94
92
|
return _model.Node.fromJSON(schema, transformedAdf);
|
|
95
93
|
}
|
|
@@ -202,6 +202,7 @@ export let ACTION = /*#__PURE__*/function (ACTION) {
|
|
|
202
202
|
ACTION["UPLOAD_SUCCEEDED"] = "uploadSucceeded";
|
|
203
203
|
ACTION["UPLOAD_FAILED"] = "uploadFailed";
|
|
204
204
|
ACTION["TOGGLE_CODE_BLOCK_WRAP"] = "toggleCodeBlockWrap";
|
|
205
|
+
ACTION["TOGGLE_CODE_BLOCK_LINE_NUMBERS"] = "toggleCodeBlockLineNumbers";
|
|
205
206
|
ACTION["TRANSFORMED"] = "transformed";
|
|
206
207
|
ACTION["RESIZED"] = "resized";
|
|
207
208
|
ACTION["RESIZED_PERF_SAMPLING"] = "resizedPerfSampling";
|
|
@@ -47,6 +47,13 @@ export const isCodeBlockWordWrapEnabled = codeBlockNode => {
|
|
|
47
47
|
const currentNodeWordWrapState = codeBlockWrappedStates.get(codeBlockNode);
|
|
48
48
|
return currentNodeWordWrapState !== undefined ? currentNodeWordWrapState : defaultWordWrapState;
|
|
49
49
|
};
|
|
50
|
+
export const areCodeBlockLineNumbersHidden = codeBlockNode => {
|
|
51
|
+
if (!expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
return Boolean(codeBlockNode.attrs.hideLineNumbers);
|
|
55
|
+
};
|
|
56
|
+
export const areCodeBlockLineNumbersVisible = codeBlockNode => !areCodeBlockLineNumbersHidden(codeBlockNode);
|
|
50
57
|
export const getCodeBlockFoldState = codeBlockNode => {
|
|
51
58
|
const currentNodeFoldState = codeBlockFoldStates.get(codeBlockNode);
|
|
52
59
|
return currentNodeFoldState || [];
|
|
@@ -32,6 +32,16 @@ export const codeBlockButtonMessages = defineMessages({
|
|
|
32
32
|
defaultMessage: 'Unwrap code',
|
|
33
33
|
description: 'Tooltip for a code block toolbar button that turns off line wrapping. This is shown when code is wrapped.'
|
|
34
34
|
},
|
|
35
|
+
showLineNumbersLabel: {
|
|
36
|
+
id: 'fabric.editor.codeBlockLineNumbersButton.showLineNumbers',
|
|
37
|
+
defaultMessage: 'Show line numbers',
|
|
38
|
+
description: 'Tooltip for a code block toolbar button that shows line numbers. This is shown when line numbers are hidden.'
|
|
39
|
+
},
|
|
40
|
+
hideLineNumbersLabel: {
|
|
41
|
+
id: 'fabric.editor.codeBlockLineNumbersButton.hideLineNumbers',
|
|
42
|
+
defaultMessage: 'Hide line numbers',
|
|
43
|
+
description: 'Tooltip for a code block toolbar button that hides line numbers. This is shown when line numbers are visible.'
|
|
44
|
+
},
|
|
35
45
|
selectLanguage: {
|
|
36
46
|
id: 'fabric.editor.selectLanguage',
|
|
37
47
|
defaultMessage: 'Select language',
|
|
@@ -370,7 +370,7 @@ export const syncBlockMessages = defineMessages({
|
|
|
370
370
|
unpublishedSyncBlockPastedDescriptionJiraWorkItem: {
|
|
371
371
|
id: 'fabric.editor.unpublishedSyncBlockPastedDescription.jiraWorkItem',
|
|
372
372
|
defaultMessage: "When the item's description is saved, the content will be displayed.",
|
|
373
|
-
description:
|
|
373
|
+
description: 'Description in flag which appears when a reference to a sync block whose source is a Jira work item with an unsaved description is pasted'
|
|
374
374
|
},
|
|
375
375
|
unsyncButton: {
|
|
376
376
|
id: 'fabric.editor.syncedBlock.unsync',
|
|
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
|
|
|
4
4
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
5
5
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
6
6
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
7
|
-
const packageVersion = "
|
|
7
|
+
const packageVersion = "0.0.0-development";
|
|
8
8
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
9
9
|
// Remove URL as it has UGC
|
|
10
10
|
// Ignored via go/ees007
|
|
@@ -105,7 +105,7 @@ export const getNestedParentNode = (tablePos, state) => {
|
|
|
105
105
|
return null;
|
|
106
106
|
}
|
|
107
107
|
const $pos = state.doc.resolve(tablePos);
|
|
108
|
-
const parent = findParentNodeOfTypeClosestToPos($pos, [state.schema.nodes.bodiedExtension, state.schema.nodes.extensionFrame, state.schema.nodes.layoutSection, state.schema.nodes.expand, state.schema.nodes.tableCell, state.schema.nodes.tableHeader,
|
|
108
|
+
const parent = findParentNodeOfTypeClosestToPos($pos, [state.schema.nodes.bodiedExtension, state.schema.nodes.extensionFrame, state.schema.nodes.layoutSection, state.schema.nodes.expand, state.schema.nodes.tableCell, state.schema.nodes.tableHeader, state.schema.nodes.bodiedSyncBlock]);
|
|
109
109
|
return parent ? parent.node : null;
|
|
110
110
|
};
|
|
111
111
|
const calcBreakoutNodeWidth = (layout, containerWidth, isFullWidthModeEnabled, breakoutWidth) => {
|
|
@@ -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 = "
|
|
17
|
+
const packageVersion = "0.0.0-development";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -79,11 +79,9 @@ export function processRawValueWithoutValidation(schema, value, dispatchAnalytic
|
|
|
79
79
|
let {
|
|
80
80
|
transformedAdf
|
|
81
81
|
} = transformNestedTablesWithAnalytics(node, dispatchAnalyticsEvent);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
transformedAdf = result.transformedAdf;
|
|
86
|
-
}
|
|
82
|
+
const result = syncBlockFallbackTransform(schema, transformedAdf);
|
|
83
|
+
if (result.isTransformed && result.transformedAdf) {
|
|
84
|
+
transformedAdf = result.transformedAdf;
|
|
87
85
|
}
|
|
88
86
|
return Node.fromJSON(schema, transformedAdf);
|
|
89
87
|
}
|
|
@@ -202,6 +202,7 @@ export var ACTION = /*#__PURE__*/function (ACTION) {
|
|
|
202
202
|
ACTION["UPLOAD_SUCCEEDED"] = "uploadSucceeded";
|
|
203
203
|
ACTION["UPLOAD_FAILED"] = "uploadFailed";
|
|
204
204
|
ACTION["TOGGLE_CODE_BLOCK_WRAP"] = "toggleCodeBlockWrap";
|
|
205
|
+
ACTION["TOGGLE_CODE_BLOCK_LINE_NUMBERS"] = "toggleCodeBlockLineNumbers";
|
|
205
206
|
ACTION["TRANSFORMED"] = "transformed";
|
|
206
207
|
ACTION["RESIZED"] = "resized";
|
|
207
208
|
ACTION["RESIZED_PERF_SAMPLING"] = "resizedPerfSampling";
|
|
@@ -48,6 +48,15 @@ export var isCodeBlockWordWrapEnabled = function isCodeBlockWordWrapEnabled(code
|
|
|
48
48
|
var currentNodeWordWrapState = codeBlockWrappedStates.get(codeBlockNode);
|
|
49
49
|
return currentNodeWordWrapState !== undefined ? currentNodeWordWrapState : defaultWordWrapState;
|
|
50
50
|
};
|
|
51
|
+
export var areCodeBlockLineNumbersHidden = function areCodeBlockLineNumbersHidden(codeBlockNode) {
|
|
52
|
+
if (!expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
return Boolean(codeBlockNode.attrs.hideLineNumbers);
|
|
56
|
+
};
|
|
57
|
+
export var areCodeBlockLineNumbersVisible = function areCodeBlockLineNumbersVisible(codeBlockNode) {
|
|
58
|
+
return !areCodeBlockLineNumbersHidden(codeBlockNode);
|
|
59
|
+
};
|
|
51
60
|
export var getCodeBlockFoldState = function getCodeBlockFoldState(codeBlockNode) {
|
|
52
61
|
var currentNodeFoldState = codeBlockFoldStates.get(codeBlockNode);
|
|
53
62
|
return currentNodeFoldState || [];
|
|
@@ -32,6 +32,16 @@ export var codeBlockButtonMessages = defineMessages({
|
|
|
32
32
|
defaultMessage: 'Unwrap code',
|
|
33
33
|
description: 'Tooltip for a code block toolbar button that turns off line wrapping. This is shown when code is wrapped.'
|
|
34
34
|
},
|
|
35
|
+
showLineNumbersLabel: {
|
|
36
|
+
id: 'fabric.editor.codeBlockLineNumbersButton.showLineNumbers',
|
|
37
|
+
defaultMessage: 'Show line numbers',
|
|
38
|
+
description: 'Tooltip for a code block toolbar button that shows line numbers. This is shown when line numbers are hidden.'
|
|
39
|
+
},
|
|
40
|
+
hideLineNumbersLabel: {
|
|
41
|
+
id: 'fabric.editor.codeBlockLineNumbersButton.hideLineNumbers',
|
|
42
|
+
defaultMessage: 'Hide line numbers',
|
|
43
|
+
description: 'Tooltip for a code block toolbar button that hides line numbers. This is shown when line numbers are visible.'
|
|
44
|
+
},
|
|
35
45
|
selectLanguage: {
|
|
36
46
|
id: 'fabric.editor.selectLanguage',
|
|
37
47
|
defaultMessage: 'Select language',
|
|
@@ -370,7 +370,7 @@ export var syncBlockMessages = defineMessages({
|
|
|
370
370
|
unpublishedSyncBlockPastedDescriptionJiraWorkItem: {
|
|
371
371
|
id: 'fabric.editor.unpublishedSyncBlockPastedDescription.jiraWorkItem',
|
|
372
372
|
defaultMessage: "When the item's description is saved, the content will be displayed.",
|
|
373
|
-
description:
|
|
373
|
+
description: 'Description in flag which appears when a reference to a sync block whose source is a Jira work item with an unsaved description is pasted'
|
|
374
374
|
},
|
|
375
375
|
unsyncButton: {
|
|
376
376
|
id: 'fabric.editor.syncedBlock.unsync',
|
|
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
|
|
|
10
10
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
11
11
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
12
12
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
13
|
-
var packageVersion = "
|
|
13
|
+
var packageVersion = "0.0.0-development";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// Ignored via go/ees007
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
1
|
import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
2
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorGutterPaddingDynamic, akEditorWideLayoutWidth, gridMediumMaxWidth } from '@atlaskit/editor-shared-styles';
|
|
4
3
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
@@ -106,7 +105,7 @@ export var getNestedParentNode = function getNestedParentNode(tablePos, state) {
|
|
|
106
105
|
return null;
|
|
107
106
|
}
|
|
108
107
|
var $pos = state.doc.resolve(tablePos);
|
|
109
|
-
var parent = findParentNodeOfTypeClosestToPos($pos, [state.schema.nodes.bodiedExtension, state.schema.nodes.extensionFrame, state.schema.nodes.layoutSection, state.schema.nodes.expand, state.schema.nodes.tableCell, state.schema.nodes.tableHeader
|
|
108
|
+
var parent = findParentNodeOfTypeClosestToPos($pos, [state.schema.nodes.bodiedExtension, state.schema.nodes.extensionFrame, state.schema.nodes.layoutSection, state.schema.nodes.expand, state.schema.nodes.tableCell, state.schema.nodes.tableHeader, state.schema.nodes.bodiedSyncBlock]);
|
|
110
109
|
return parent ? parent.node : null;
|
|
111
110
|
};
|
|
112
111
|
var calcBreakoutNodeWidth = function calcBreakoutNodeWidth(layout, containerWidth, isFullWidthModeEnabled, breakoutWidth) {
|
|
@@ -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 = "
|
|
24
|
+
var packageVersion = "0.0.0-development";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -77,11 +77,9 @@ export function processRawValueWithoutValidation(schema, value, dispatchAnalytic
|
|
|
77
77
|
// Convert nested-table extensions into nested tables
|
|
78
78
|
var _transformNestedTable2 = transformNestedTablesWithAnalytics(node, dispatchAnalyticsEvent),
|
|
79
79
|
transformedAdf = _transformNestedTable2.transformedAdf;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
transformedAdf = result.transformedAdf;
|
|
84
|
-
}
|
|
80
|
+
var result = syncBlockFallbackTransform(schema, transformedAdf);
|
|
81
|
+
if (result.isTransformed && result.transformedAdf) {
|
|
82
|
+
transformedAdf = result.transformedAdf;
|
|
85
83
|
}
|
|
86
84
|
return Node.fromJSON(schema, transformedAdf);
|
|
87
85
|
}
|
|
@@ -200,6 +200,7 @@ export declare enum ACTION {
|
|
|
200
200
|
UPLOAD_SUCCEEDED = "uploadSucceeded",
|
|
201
201
|
UPLOAD_FAILED = "uploadFailed",
|
|
202
202
|
TOGGLE_CODE_BLOCK_WRAP = "toggleCodeBlockWrap",
|
|
203
|
+
TOGGLE_CODE_BLOCK_LINE_NUMBERS = "toggleCodeBlockLineNumbers",
|
|
203
204
|
TRANSFORMED = "transformed",
|
|
204
205
|
RESIZED = "resized",
|
|
205
206
|
RESIZED_PERF_SAMPLING = "resizedPerfSampling",
|
|
@@ -194,6 +194,11 @@ type CodeBlockWordWrapToggleAEP = TrackAEP<ACTION.TOGGLE_CODE_BLOCK_WRAP, ACTION
|
|
|
194
194
|
platform: PLATFORMS;
|
|
195
195
|
wordWrapEnabled: boolean;
|
|
196
196
|
}, undefined>;
|
|
197
|
+
type CodeBlockLineNumbersToggleAEP = TrackAEP<ACTION.TOGGLE_CODE_BLOCK_LINE_NUMBERS, ACTION_SUBJECT.CODE_BLOCK, undefined, {
|
|
198
|
+
codeBlockNodeSize: number;
|
|
199
|
+
lineNumbersHidden: boolean;
|
|
200
|
+
platform: PLATFORMS;
|
|
201
|
+
}, undefined>;
|
|
197
202
|
export type RequestToEditAEP = UIAEP<ACTION.REQUEST_TO_EDIT | ACTION.DISMISSED, ACTION_SUBJECT.REQUEST_TO_EDIT_POP_UP, undefined, {
|
|
198
203
|
mode: MODE;
|
|
199
204
|
platform: PLATFORMS;
|
|
@@ -225,5 +230,5 @@ type ChangeToneMenuItemClickedAEP = UIAEP<ACTION.CLICKED, ACTION_SUBJECT.TOOLBAR
|
|
|
225
230
|
type TranslateMenuItemClickedAEP = UIAEP<ACTION.CLICKED, ACTION_SUBJECT.TOOLBAR_DROPDOWN_MENU_ITEM, ACTION_SUBJECT_ID.AI_TRANSLATE, {
|
|
226
231
|
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.FLOATING_TB;
|
|
227
232
|
}>;
|
|
228
|
-
export type GeneralEventPayload<T = void> = AnnotateButtonAEP | AnnotationAEP | AnnotationErrorAEP | BrowserFreezePayload | ButtonFeedbackAEP | ButtonHelpAEP | ButtonUploadMediaAEP | ColorPickerAEP | EditorPerfAEP | EditorRenderedAEP<T> | EditorStartAEP | EditorStopAEP | ExpandToggleAEP | FeedbackAEP | FullWidthModeAEP | HelpQuickInsertAEP | InputPerfSamplingAEP | InputPerfSamplingAvgAEP | PickerEmojiAEP | PickerImageAEP | PickerMediaInsertAEP | PickerMediaInsertClosedAEP | PickerMediaInsertCancelledAEP | ReactNodeViewRenderedAEP | RichMediaLayoutAEP | SelectionAEP | SlowInputAEP | TransactionMutatedAEP | UploadExternalFailedAEP | WithPluginStateCalledAEP | CodeBlockLanguageSelectedAEP | EditorContentRetrievalPerformedAEP | MediaLinkTransformedAEP | TextLinkCodeMarkTransformedAEP | DedupeMarksTransformedAEP | IndentationMarksTransformedAEP | NodesMissingContentTransformedAEP | InvalidProsemirrorDocumentErrorAEP | DocumentProcessingErrorAEP | InvalidMediaContentTransformedAEP | HeadingAnchorLinkButtonAEP | CollabStepsTrackerPayloadAEP | CollabOrganicChangesTrackerPayloadAEP | BlocksDragInitAEP | CodeBlockWordWrapToggleAEP | RequestToEditAEP | SingleColumLayoutDetectedAEP | CopyLinkToAnchorButtonAEP | DockedPrimaryToolbarRenderedAEP | RovoMoreOptionsClickedAEP | AskRovoButtonClickedAEP | SmartLinkRovoButtonClickedAEP | SmartLinkSummarizeButtonClickedAEP | ChangeToneMenuItemClickedAEP | TranslateMenuItemClickedAEP | MediaSingleWidthTransformedAEP;
|
|
233
|
+
export type GeneralEventPayload<T = void> = AnnotateButtonAEP | AnnotationAEP | AnnotationErrorAEP | BrowserFreezePayload | ButtonFeedbackAEP | ButtonHelpAEP | ButtonUploadMediaAEP | ColorPickerAEP | EditorPerfAEP | EditorRenderedAEP<T> | EditorStartAEP | EditorStopAEP | ExpandToggleAEP | FeedbackAEP | FullWidthModeAEP | HelpQuickInsertAEP | InputPerfSamplingAEP | InputPerfSamplingAvgAEP | PickerEmojiAEP | PickerImageAEP | PickerMediaInsertAEP | PickerMediaInsertClosedAEP | PickerMediaInsertCancelledAEP | ReactNodeViewRenderedAEP | RichMediaLayoutAEP | SelectionAEP | SlowInputAEP | TransactionMutatedAEP | UploadExternalFailedAEP | WithPluginStateCalledAEP | CodeBlockLanguageSelectedAEP | EditorContentRetrievalPerformedAEP | MediaLinkTransformedAEP | TextLinkCodeMarkTransformedAEP | DedupeMarksTransformedAEP | IndentationMarksTransformedAEP | NodesMissingContentTransformedAEP | InvalidProsemirrorDocumentErrorAEP | DocumentProcessingErrorAEP | InvalidMediaContentTransformedAEP | HeadingAnchorLinkButtonAEP | CollabStepsTrackerPayloadAEP | CollabOrganicChangesTrackerPayloadAEP | BlocksDragInitAEP | CodeBlockWordWrapToggleAEP | CodeBlockLineNumbersToggleAEP | RequestToEditAEP | SingleColumLayoutDetectedAEP | CopyLinkToAnchorButtonAEP | DockedPrimaryToolbarRenderedAEP | RovoMoreOptionsClickedAEP | AskRovoButtonClickedAEP | SmartLinkRovoButtonClickedAEP | SmartLinkSummarizeButtonClickedAEP | ChangeToneMenuItemClickedAEP | TranslateMenuItemClickedAEP | MediaSingleWidthTransformedAEP;
|
|
229
234
|
export {};
|
|
@@ -12,6 +12,8 @@ export interface FoldRange {
|
|
|
12
12
|
to: number;
|
|
13
13
|
}
|
|
14
14
|
export declare const isCodeBlockWordWrapEnabled: (codeBlockNode: PmNode) => boolean;
|
|
15
|
+
export declare const areCodeBlockLineNumbersHidden: (codeBlockNode: PmNode) => boolean;
|
|
16
|
+
export declare const areCodeBlockLineNumbersVisible: (codeBlockNode: PmNode) => boolean;
|
|
15
17
|
export declare const getCodeBlockFoldState: (codeBlockNode: PmNode) => FoldRange[];
|
|
16
18
|
export declare const setCodeBlockFoldState: (codeBlockNode: PmNode, foldRanges: FoldRange[]) => void;
|
|
17
19
|
/**
|
|
@@ -9,11 +9,21 @@ export declare const codeBlockButtonMessages: {
|
|
|
9
9
|
description: string;
|
|
10
10
|
id: string;
|
|
11
11
|
};
|
|
12
|
+
hideLineNumbersLabel: {
|
|
13
|
+
defaultMessage: string;
|
|
14
|
+
description: string;
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
12
17
|
selectLanguage: {
|
|
13
18
|
defaultMessage: string;
|
|
14
19
|
description: string;
|
|
15
20
|
id: string;
|
|
16
21
|
};
|
|
22
|
+
showLineNumbersLabel: {
|
|
23
|
+
defaultMessage: string;
|
|
24
|
+
description: string;
|
|
25
|
+
id: string;
|
|
26
|
+
};
|
|
17
27
|
unwrapCode: {
|
|
18
28
|
defaultMessage: string;
|
|
19
29
|
description: string;
|
|
@@ -200,6 +200,7 @@ export declare enum ACTION {
|
|
|
200
200
|
UPLOAD_SUCCEEDED = "uploadSucceeded",
|
|
201
201
|
UPLOAD_FAILED = "uploadFailed",
|
|
202
202
|
TOGGLE_CODE_BLOCK_WRAP = "toggleCodeBlockWrap",
|
|
203
|
+
TOGGLE_CODE_BLOCK_LINE_NUMBERS = "toggleCodeBlockLineNumbers",
|
|
203
204
|
TRANSFORMED = "transformed",
|
|
204
205
|
RESIZED = "resized",
|
|
205
206
|
RESIZED_PERF_SAMPLING = "resizedPerfSampling",
|
|
@@ -194,6 +194,11 @@ type CodeBlockWordWrapToggleAEP = TrackAEP<ACTION.TOGGLE_CODE_BLOCK_WRAP, ACTION
|
|
|
194
194
|
platform: PLATFORMS;
|
|
195
195
|
wordWrapEnabled: boolean;
|
|
196
196
|
}, undefined>;
|
|
197
|
+
type CodeBlockLineNumbersToggleAEP = TrackAEP<ACTION.TOGGLE_CODE_BLOCK_LINE_NUMBERS, ACTION_SUBJECT.CODE_BLOCK, undefined, {
|
|
198
|
+
codeBlockNodeSize: number;
|
|
199
|
+
lineNumbersHidden: boolean;
|
|
200
|
+
platform: PLATFORMS;
|
|
201
|
+
}, undefined>;
|
|
197
202
|
export type RequestToEditAEP = UIAEP<ACTION.REQUEST_TO_EDIT | ACTION.DISMISSED, ACTION_SUBJECT.REQUEST_TO_EDIT_POP_UP, undefined, {
|
|
198
203
|
mode: MODE;
|
|
199
204
|
platform: PLATFORMS;
|
|
@@ -225,5 +230,5 @@ type ChangeToneMenuItemClickedAEP = UIAEP<ACTION.CLICKED, ACTION_SUBJECT.TOOLBAR
|
|
|
225
230
|
type TranslateMenuItemClickedAEP = UIAEP<ACTION.CLICKED, ACTION_SUBJECT.TOOLBAR_DROPDOWN_MENU_ITEM, ACTION_SUBJECT_ID.AI_TRANSLATE, {
|
|
226
231
|
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.FLOATING_TB;
|
|
227
232
|
}>;
|
|
228
|
-
export type GeneralEventPayload<T = void> = AnnotateButtonAEP | AnnotationAEP | AnnotationErrorAEP | BrowserFreezePayload | ButtonFeedbackAEP | ButtonHelpAEP | ButtonUploadMediaAEP | ColorPickerAEP | EditorPerfAEP | EditorRenderedAEP<T> | EditorStartAEP | EditorStopAEP | ExpandToggleAEP | FeedbackAEP | FullWidthModeAEP | HelpQuickInsertAEP | InputPerfSamplingAEP | InputPerfSamplingAvgAEP | PickerEmojiAEP | PickerImageAEP | PickerMediaInsertAEP | PickerMediaInsertClosedAEP | PickerMediaInsertCancelledAEP | ReactNodeViewRenderedAEP | RichMediaLayoutAEP | SelectionAEP | SlowInputAEP | TransactionMutatedAEP | UploadExternalFailedAEP | WithPluginStateCalledAEP | CodeBlockLanguageSelectedAEP | EditorContentRetrievalPerformedAEP | MediaLinkTransformedAEP | TextLinkCodeMarkTransformedAEP | DedupeMarksTransformedAEP | IndentationMarksTransformedAEP | NodesMissingContentTransformedAEP | InvalidProsemirrorDocumentErrorAEP | DocumentProcessingErrorAEP | InvalidMediaContentTransformedAEP | HeadingAnchorLinkButtonAEP | CollabStepsTrackerPayloadAEP | CollabOrganicChangesTrackerPayloadAEP | BlocksDragInitAEP | CodeBlockWordWrapToggleAEP | RequestToEditAEP | SingleColumLayoutDetectedAEP | CopyLinkToAnchorButtonAEP | DockedPrimaryToolbarRenderedAEP | RovoMoreOptionsClickedAEP | AskRovoButtonClickedAEP | SmartLinkRovoButtonClickedAEP | SmartLinkSummarizeButtonClickedAEP | ChangeToneMenuItemClickedAEP | TranslateMenuItemClickedAEP | MediaSingleWidthTransformedAEP;
|
|
233
|
+
export type GeneralEventPayload<T = void> = AnnotateButtonAEP | AnnotationAEP | AnnotationErrorAEP | BrowserFreezePayload | ButtonFeedbackAEP | ButtonHelpAEP | ButtonUploadMediaAEP | ColorPickerAEP | EditorPerfAEP | EditorRenderedAEP<T> | EditorStartAEP | EditorStopAEP | ExpandToggleAEP | FeedbackAEP | FullWidthModeAEP | HelpQuickInsertAEP | InputPerfSamplingAEP | InputPerfSamplingAvgAEP | PickerEmojiAEP | PickerImageAEP | PickerMediaInsertAEP | PickerMediaInsertClosedAEP | PickerMediaInsertCancelledAEP | ReactNodeViewRenderedAEP | RichMediaLayoutAEP | SelectionAEP | SlowInputAEP | TransactionMutatedAEP | UploadExternalFailedAEP | WithPluginStateCalledAEP | CodeBlockLanguageSelectedAEP | EditorContentRetrievalPerformedAEP | MediaLinkTransformedAEP | TextLinkCodeMarkTransformedAEP | DedupeMarksTransformedAEP | IndentationMarksTransformedAEP | NodesMissingContentTransformedAEP | InvalidProsemirrorDocumentErrorAEP | DocumentProcessingErrorAEP | InvalidMediaContentTransformedAEP | HeadingAnchorLinkButtonAEP | CollabStepsTrackerPayloadAEP | CollabOrganicChangesTrackerPayloadAEP | BlocksDragInitAEP | CodeBlockWordWrapToggleAEP | CodeBlockLineNumbersToggleAEP | RequestToEditAEP | SingleColumLayoutDetectedAEP | CopyLinkToAnchorButtonAEP | DockedPrimaryToolbarRenderedAEP | RovoMoreOptionsClickedAEP | AskRovoButtonClickedAEP | SmartLinkRovoButtonClickedAEP | SmartLinkSummarizeButtonClickedAEP | ChangeToneMenuItemClickedAEP | TranslateMenuItemClickedAEP | MediaSingleWidthTransformedAEP;
|
|
229
234
|
export {};
|
|
@@ -12,6 +12,8 @@ export interface FoldRange {
|
|
|
12
12
|
to: number;
|
|
13
13
|
}
|
|
14
14
|
export declare const isCodeBlockWordWrapEnabled: (codeBlockNode: PmNode) => boolean;
|
|
15
|
+
export declare const areCodeBlockLineNumbersHidden: (codeBlockNode: PmNode) => boolean;
|
|
16
|
+
export declare const areCodeBlockLineNumbersVisible: (codeBlockNode: PmNode) => boolean;
|
|
15
17
|
export declare const getCodeBlockFoldState: (codeBlockNode: PmNode) => FoldRange[];
|
|
16
18
|
export declare const setCodeBlockFoldState: (codeBlockNode: PmNode, foldRanges: FoldRange[]) => void;
|
|
17
19
|
/**
|
|
@@ -9,11 +9,21 @@ export declare const codeBlockButtonMessages: {
|
|
|
9
9
|
description: string;
|
|
10
10
|
id: string;
|
|
11
11
|
};
|
|
12
|
+
hideLineNumbersLabel: {
|
|
13
|
+
defaultMessage: string;
|
|
14
|
+
description: string;
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
12
17
|
selectLanguage: {
|
|
13
18
|
defaultMessage: string;
|
|
14
19
|
description: string;
|
|
15
20
|
id: string;
|
|
16
21
|
};
|
|
22
|
+
showLineNumbersLabel: {
|
|
23
|
+
defaultMessage: string;
|
|
24
|
+
description: string;
|
|
25
|
+
id: string;
|
|
26
|
+
};
|
|
17
27
|
unwrapCode: {
|
|
18
28
|
defaultMessage: string;
|
|
19
29
|
description: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "114.
|
|
3
|
+
"version": "114.32.1",
|
|
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/"
|
|
@@ -227,9 +227,6 @@
|
|
|
227
227
|
"cc_fd_wb_create_priority_in_slash_menu_enabled": {
|
|
228
228
|
"type": "boolean"
|
|
229
229
|
},
|
|
230
|
-
"platform_editor_sync_block_fallback_transform": {
|
|
231
|
-
"type": "boolean"
|
|
232
|
-
},
|
|
233
230
|
"draft_reply_contextual_pills_gate": {
|
|
234
231
|
"type": "boolean"
|
|
235
232
|
},
|
|
@@ -272,9 +269,6 @@
|
|
|
272
269
|
"platform_editor_media_border_radius_fix": {
|
|
273
270
|
"type": "boolean"
|
|
274
271
|
},
|
|
275
|
-
"platform_synced_block_patch_8": {
|
|
276
|
-
"type": "boolean"
|
|
277
|
-
},
|
|
278
272
|
"people-teams_migrate-user-profile-card": {
|
|
279
273
|
"type": "boolean"
|
|
280
274
|
}
|