@atlaskit/editor-common 87.0.3 → 87.0.4
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 +11 -0
- package/code-block/package.json +15 -0
- package/dist/cjs/code-block/index.js +31 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/code-block/index.js +25 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/code-block/index.js +25 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/code-block/index.d.ts +9 -0
- package/dist/types-ts4.5/code-block/index.d.ts +9 -0
- package/package.json +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 87.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#125133](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/125133)
|
|
8
|
+
[`d804e5dd3216b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d804e5dd3216b) -
|
|
9
|
+
ED-24226 - Add state to manage the toggle word wrap state of code blocks. New WeakMap added in
|
|
10
|
+
editor-common/src/code-block, as word wrap state is shared throughout the editor. Covers regular
|
|
11
|
+
changes to code block by the user via the node view update function. Covers breakout of code block
|
|
12
|
+
node. Does not cover drag&drop & cut&paste edge cases.
|
|
13
|
+
|
|
3
14
|
## 87.0.3
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/editor-common/code-block",
|
|
3
|
+
"main": "../dist/cjs/code-block/index.js",
|
|
4
|
+
"module": "../dist/esm/code-block/index.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/code-block/index.js",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"types": "../dist/types/code-block/index.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.5 <5.4": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.5/code-block/index.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.transferCodeBlockWrappedValue = exports.isCodeBlockWordWrapEnabled = exports.defaultWordWrapState = exports.codeBlockWrappedStates = void 0;
|
|
7
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
|
+
var defaultWordWrapState = exports.defaultWordWrapState = false;
|
|
9
|
+
var codeBlockWrappedStates = exports.codeBlockWrappedStates = new WeakMap();
|
|
10
|
+
var isCodeBlockWordWrapEnabled = exports.isCodeBlockWordWrapEnabled = function isCodeBlockWordWrapEnabled(codeBlockNode) {
|
|
11
|
+
if (!(0, _platformFeatureFlags.fg)('editor_support_code_block_wrapping')) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
var currentNodeWordWrapState = codeBlockWrappedStates.get(codeBlockNode);
|
|
15
|
+
return currentNodeWordWrapState !== undefined ? currentNodeWordWrapState : defaultWordWrapState;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* As the code block node is used as the key, there is instances where the node will be destroyed & recreated and is no longer a valid key.
|
|
20
|
+
* In these instances, we must get the value from that old node and set it to the value of the new node.
|
|
21
|
+
*/
|
|
22
|
+
var transferCodeBlockWrappedValue = exports.transferCodeBlockWrappedValue = function transferCodeBlockWrappedValue(oldCodeBlockNode, newCodeBlockNode) {
|
|
23
|
+
if (!(0, _platformFeatureFlags.fg)('editor_support_code_block_wrapping')) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
var previousValue = codeBlockWrappedStates.get(oldCodeBlockNode);
|
|
27
|
+
if (previousValue !== undefined) {
|
|
28
|
+
codeBlockWrappedStates.set(newCodeBlockNode, previousValue);
|
|
29
|
+
codeBlockWrappedStates.delete(oldCodeBlockNode);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
18
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
19
19
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
20
|
-
var packageVersion = "87.0.
|
|
20
|
+
var packageVersion = "87.0.4";
|
|
21
21
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
22
22
|
// Remove URL as it has UGC
|
|
23
23
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
23
23
|
* @jsx jsx
|
|
24
24
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
25
25
|
var packageName = "@atlaskit/editor-common";
|
|
26
|
-
var packageVersion = "87.0.
|
|
26
|
+
var packageVersion = "87.0.4";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = '0, 8';
|
|
29
29
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
+
export const defaultWordWrapState = false;
|
|
3
|
+
export const codeBlockWrappedStates = new WeakMap();
|
|
4
|
+
export const isCodeBlockWordWrapEnabled = codeBlockNode => {
|
|
5
|
+
if (!fg('editor_support_code_block_wrapping')) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
const currentNodeWordWrapState = codeBlockWrappedStates.get(codeBlockNode);
|
|
9
|
+
return currentNodeWordWrapState !== undefined ? currentNodeWordWrapState : defaultWordWrapState;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* As the code block node is used as the key, there is instances where the node will be destroyed & recreated and is no longer a valid key.
|
|
14
|
+
* In these instances, we must get the value from that old node and set it to the value of the new node.
|
|
15
|
+
*/
|
|
16
|
+
export const transferCodeBlockWrappedValue = (oldCodeBlockNode, newCodeBlockNode) => {
|
|
17
|
+
if (!fg('editor_support_code_block_wrapping')) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const previousValue = codeBlockWrappedStates.get(oldCodeBlockNode);
|
|
21
|
+
if (previousValue !== undefined) {
|
|
22
|
+
codeBlockWrappedStates.set(newCodeBlockNode, previousValue);
|
|
23
|
+
codeBlockWrappedStates.delete(oldCodeBlockNode);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isFedRamp } from './environment';
|
|
2
2
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
3
3
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
4
|
-
const packageVersion = "87.0.
|
|
4
|
+
const packageVersion = "87.0.4";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -12,7 +12,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
12
12
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
13
13
|
import Layer from '../Layer';
|
|
14
14
|
const packageName = "@atlaskit/editor-common";
|
|
15
|
-
const packageVersion = "87.0.
|
|
15
|
+
const packageVersion = "87.0.4";
|
|
16
16
|
const halfFocusRing = 1;
|
|
17
17
|
const dropOffset = '0, 8';
|
|
18
18
|
class DropList extends Component {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
+
export var defaultWordWrapState = false;
|
|
3
|
+
export var codeBlockWrappedStates = new WeakMap();
|
|
4
|
+
export var isCodeBlockWordWrapEnabled = function isCodeBlockWordWrapEnabled(codeBlockNode) {
|
|
5
|
+
if (!fg('editor_support_code_block_wrapping')) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
var currentNodeWordWrapState = codeBlockWrappedStates.get(codeBlockNode);
|
|
9
|
+
return currentNodeWordWrapState !== undefined ? currentNodeWordWrapState : defaultWordWrapState;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* As the code block node is used as the key, there is instances where the node will be destroyed & recreated and is no longer a valid key.
|
|
14
|
+
* In these instances, we must get the value from that old node and set it to the value of the new node.
|
|
15
|
+
*/
|
|
16
|
+
export var transferCodeBlockWrappedValue = function transferCodeBlockWrappedValue(oldCodeBlockNode, newCodeBlockNode) {
|
|
17
|
+
if (!fg('editor_support_code_block_wrapping')) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
var previousValue = codeBlockWrappedStates.get(oldCodeBlockNode);
|
|
21
|
+
if (previousValue !== undefined) {
|
|
22
|
+
codeBlockWrappedStates.set(newCodeBlockNode, previousValue);
|
|
23
|
+
codeBlockWrappedStates.delete(oldCodeBlockNode);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
import { isFedRamp } from './environment';
|
|
8
8
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
9
9
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
10
|
-
var packageVersion = "87.0.
|
|
10
|
+
var packageVersion = "87.0.4";
|
|
11
11
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
12
12
|
// Remove URL as it has UGC
|
|
13
13
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -20,7 +20,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
20
20
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
21
21
|
import Layer from '../Layer';
|
|
22
22
|
var packageName = "@atlaskit/editor-common";
|
|
23
|
-
var packageVersion = "87.0.
|
|
23
|
+
var packageVersion = "87.0.4";
|
|
24
24
|
var halfFocusRing = 1;
|
|
25
25
|
var dropOffset = '0, 8';
|
|
26
26
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
export declare const defaultWordWrapState = false;
|
|
3
|
+
export declare const codeBlockWrappedStates: WeakMap<PmNode, boolean | undefined>;
|
|
4
|
+
export declare const isCodeBlockWordWrapEnabled: (codeBlockNode: PmNode) => boolean;
|
|
5
|
+
/**
|
|
6
|
+
* As the code block node is used as the key, there is instances where the node will be destroyed & recreated and is no longer a valid key.
|
|
7
|
+
* In these instances, we must get the value from that old node and set it to the value of the new node.
|
|
8
|
+
*/
|
|
9
|
+
export declare const transferCodeBlockWrappedValue: (oldCodeBlockNode: PmNode, newCodeBlockNode: PmNode) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
export declare const defaultWordWrapState = false;
|
|
3
|
+
export declare const codeBlockWrappedStates: WeakMap<PmNode, boolean | undefined>;
|
|
4
|
+
export declare const isCodeBlockWordWrapEnabled: (codeBlockNode: PmNode) => boolean;
|
|
5
|
+
/**
|
|
6
|
+
* As the code block node is used as the key, there is instances where the node will be destroyed & recreated and is no longer a valid key.
|
|
7
|
+
* In these instances, we must get the value from that old node and set it to the value of the new node.
|
|
8
|
+
*/
|
|
9
|
+
export declare const transferCodeBlockWrappedValue: (oldCodeBlockNode: PmNode, newCodeBlockNode: PmNode) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "87.0.
|
|
3
|
+
"version": "87.0.4",
|
|
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/"
|
|
@@ -93,6 +93,7 @@
|
|
|
93
93
|
"./constants": "./src/link/constants.ts",
|
|
94
94
|
"./doc-utils": "./src/doc-utils/index.ts",
|
|
95
95
|
"./expand": "./src/expand/index.ts",
|
|
96
|
+
"./code-block": "./src/code-block/index.ts",
|
|
96
97
|
"./table": "./src/table/index.ts",
|
|
97
98
|
"./lazy-node-view": "./src/lazy-node-view/index.ts"
|
|
98
99
|
},
|
|
@@ -264,6 +265,9 @@
|
|
|
264
265
|
},
|
|
265
266
|
"editor_inline_comments_paste_insert_nodes": {
|
|
266
267
|
"type": "boolean"
|
|
268
|
+
},
|
|
269
|
+
"editor_support_code_block_wrapping": {
|
|
270
|
+
"type": "boolean"
|
|
267
271
|
}
|
|
268
272
|
}
|
|
269
273
|
}
|