@atlaskit/editor-common 76.15.1 → 76.15.2
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 +30 -0
- package/dist/cjs/commands/index.js +7 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/commands/index.js +7 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/commands/index.js +7 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/commands/index.d.ts +6 -0
- package/dist/types/ui-menu/ArrowKeyNavigationProvider/index.d.ts +1 -1
- package/dist/types-ts4.5/commands/index.d.ts +6 -0
- package/dist/types-ts4.5/ui-menu/ArrowKeyNavigationProvider/index.d.ts +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 76.15.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#42090](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42090) [`dfea93d39c9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dfea93d39c9) - Replacing setBlockType action on `editor-plugin-block-type` with setTextLevel
|
|
8
|
+
command.
|
|
9
|
+
|
|
10
|
+
WHAT/WHY?: setBlockType is only for headings/text so the naming is not clear,
|
|
11
|
+
it is also an action which makes it difficult to use by external consumers.
|
|
12
|
+
|
|
13
|
+
This replacement can be easily used by external consumers (ie. for custom toolbars)
|
|
14
|
+
and also has more type safety (for setBlockType the name parameter is any string but
|
|
15
|
+
setTextLevel only accepts valid values including "normal", "heading1",
|
|
16
|
+
"heading2" etc.)
|
|
17
|
+
|
|
18
|
+
HOW?: This API at this stage should be unused by consumers to the best of our
|
|
19
|
+
knowledge. However if you are using it you should change as so:
|
|
20
|
+
|
|
21
|
+
Before:
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
api?.blockType.actions.setBlockType(blockType, inputMethod)(state, dispatch);
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
api?.core.actions.execute(
|
|
29
|
+
api?.blockType.commands.setTextLevel(blockType, inputMethod),
|
|
30
|
+
);
|
|
31
|
+
```
|
|
32
|
+
|
|
3
33
|
## 76.15.1
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
|
@@ -155,6 +155,13 @@ function findCutBefore($pos) {
|
|
|
155
155
|
}
|
|
156
156
|
return null;
|
|
157
157
|
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* @deprecated
|
|
161
|
+
*
|
|
162
|
+
* This method is no longer needed and can be accessed via the
|
|
163
|
+
* `editor-plugin-block-type` command of `setTextLevel`
|
|
164
|
+
*/
|
|
158
165
|
function setHeading(level) {
|
|
159
166
|
return function (state, dispatch) {
|
|
160
167
|
var selection = state.selection,
|
|
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
17
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
18
18
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
19
|
-
var packageVersion = "76.15.
|
|
19
|
+
var packageVersion = "76.15.2";
|
|
20
20
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
21
21
|
// Remove URL as it has UGC
|
|
22
22
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -24,7 +24,7 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
24
24
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
25
25
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "76.15.
|
|
27
|
+
var packageVersion = "76.15.2";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -137,6 +137,13 @@ export function findCutBefore($pos) {
|
|
|
137
137
|
}
|
|
138
138
|
return null;
|
|
139
139
|
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* @deprecated
|
|
143
|
+
*
|
|
144
|
+
* This method is no longer needed and can be accessed via the
|
|
145
|
+
* `editor-plugin-block-type` command of `setTextLevel`
|
|
146
|
+
*/
|
|
140
147
|
export function setHeading(level) {
|
|
141
148
|
return function (state, dispatch) {
|
|
142
149
|
const {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
2
2
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
3
|
-
const packageVersion = "76.15.
|
|
3
|
+
const packageVersion = "76.15.2";
|
|
4
4
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
5
5
|
// Remove URL as it has UGC
|
|
6
6
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -9,7 +9,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
9
9
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
10
10
|
import Layer from '../Layer';
|
|
11
11
|
const packageName = "@atlaskit/editor-common";
|
|
12
|
-
const packageVersion = "76.15.
|
|
12
|
+
const packageVersion = "76.15.2";
|
|
13
13
|
const halfFocusRing = 1;
|
|
14
14
|
const dropOffset = '0, 8';
|
|
15
15
|
class DropList extends Component {
|
|
@@ -135,6 +135,13 @@ export function findCutBefore($pos) {
|
|
|
135
135
|
}
|
|
136
136
|
return null;
|
|
137
137
|
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* @deprecated
|
|
141
|
+
*
|
|
142
|
+
* This method is no longer needed and can be accessed via the
|
|
143
|
+
* `editor-plugin-block-type` command of `setTextLevel`
|
|
144
|
+
*/
|
|
138
145
|
export function setHeading(level) {
|
|
139
146
|
return function (state, dispatch) {
|
|
140
147
|
var selection = state.selection,
|
|
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
8
8
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
9
|
-
var packageVersion = "76.15.
|
|
9
|
+
var packageVersion = "76.15.2";
|
|
10
10
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
11
11
|
// Remove URL as it has UGC
|
|
12
12
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -19,7 +19,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
19
19
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
20
20
|
import Layer from '../Layer';
|
|
21
21
|
var packageName = "@atlaskit/editor-common";
|
|
22
|
-
var packageVersion = "76.15.
|
|
22
|
+
var packageVersion = "76.15.2";
|
|
23
23
|
var halfFocusRing = 1;
|
|
24
24
|
var dropOffset = '0, 8';
|
|
25
25
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -17,5 +17,11 @@ export declare const createToggleBlockMarkOnRange: <T extends {} = object>(markT
|
|
|
17
17
|
export declare const toggleBlockMark: <T extends {} = object>(markType: MarkType, getAttrs: (prevAttrs?: T | undefined, node?: PMNode) => false | T | undefined, allowedBlocks?: NodeType[] | ((schema: Schema, node: PMNode, parent: PMNode | null) => boolean) | undefined) => Command;
|
|
18
18
|
export declare const clearEditorContent: Command;
|
|
19
19
|
export declare function findCutBefore($pos: ResolvedPos): ResolvedPos | null;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated
|
|
22
|
+
*
|
|
23
|
+
* This method is no longer needed and can be accessed via the
|
|
24
|
+
* `editor-plugin-block-type` command of `setTextLevel`
|
|
25
|
+
*/
|
|
20
26
|
export declare function setHeading(level: HeadingLevelsAndNormalText): Command;
|
|
21
27
|
export { insertBlock } from './insert-block';
|
|
@@ -17,5 +17,11 @@ export declare const createToggleBlockMarkOnRange: <T extends {} = object>(markT
|
|
|
17
17
|
export declare const toggleBlockMark: <T extends {} = object>(markType: MarkType, getAttrs: (prevAttrs?: T | undefined, node?: PMNode) => false | T | undefined, allowedBlocks?: NodeType[] | ((schema: Schema, node: PMNode, parent: PMNode | null) => boolean) | undefined) => Command;
|
|
18
18
|
export declare const clearEditorContent: Command;
|
|
19
19
|
export declare function findCutBefore($pos: ResolvedPos): ResolvedPos | null;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated
|
|
22
|
+
*
|
|
23
|
+
* This method is no longer needed and can be accessed via the
|
|
24
|
+
* `editor-plugin-block-type` command of `setTextLevel`
|
|
25
|
+
*/
|
|
20
26
|
export declare function setHeading(level: HeadingLevelsAndNormalText): Command;
|
|
21
27
|
export { insertBlock } from './insert-block';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "76.15.
|
|
3
|
+
"version": "76.15.2",
|
|
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/"
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
"devDependencies": {
|
|
155
155
|
"@atlaskit/media-core": "^34.1.0",
|
|
156
156
|
"@atlaskit/media-test-helpers": "^33.0.0",
|
|
157
|
-
"@atlaskit/smart-card": "^26.
|
|
157
|
+
"@atlaskit/smart-card": "^26.38.0",
|
|
158
158
|
"@atlaskit/util-data-test": "^17.8.0",
|
|
159
159
|
"@atlaskit/visual-regression": "*",
|
|
160
160
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|