@atlaskit/editor-common 74.58.5 → 74.59.0
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 +6 -0
- package/dist/cjs/commands/index.js +20 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/commands/index.js +22 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/commands/index.js +19 -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 +2 -0
- package/dist/types-ts4.5/commands/index.d.ts +2 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 74.59.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`8441acc0e0c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8441acc0e0c) - Extract block-type plugin into @atlaskit/editor-plugin-block-type
|
|
8
|
+
|
|
3
9
|
## 74.58.5
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "insertBlock", {
|
|
|
15
15
|
return _insertBlock.insertBlock;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
exports.setHeading = setHeading;
|
|
18
19
|
exports.toggleBlockMark = void 0;
|
|
19
20
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
20
21
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
@@ -157,4 +158,23 @@ function findCutBefore($pos) {
|
|
|
157
158
|
}
|
|
158
159
|
}
|
|
159
160
|
return null;
|
|
161
|
+
}
|
|
162
|
+
function setHeading(level) {
|
|
163
|
+
return function (state, dispatch) {
|
|
164
|
+
var selection = state.selection,
|
|
165
|
+
schema = state.schema,
|
|
166
|
+
tr = state.tr;
|
|
167
|
+
var ranges = selection instanceof _cellSelection.CellSelection ? selection.ranges : [selection];
|
|
168
|
+
ranges.forEach(function (_ref) {
|
|
169
|
+
var $from = _ref.$from,
|
|
170
|
+
$to = _ref.$to;
|
|
171
|
+
tr.setBlockType($from.pos, $to.pos, schema.nodes.heading, {
|
|
172
|
+
level: level
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
if (dispatch) {
|
|
176
|
+
dispatch(tr);
|
|
177
|
+
}
|
|
178
|
+
return true;
|
|
179
|
+
};
|
|
160
180
|
}
|
|
@@ -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 = "74.
|
|
19
|
+
var packageVersion = "74.59.0";
|
|
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 = "74.
|
|
27
|
+
var packageVersion = "74.59.0";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -137,4 +137,26 @@ export function findCutBefore($pos) {
|
|
|
137
137
|
}
|
|
138
138
|
return null;
|
|
139
139
|
}
|
|
140
|
+
export function setHeading(level) {
|
|
141
|
+
return function (state, dispatch) {
|
|
142
|
+
const {
|
|
143
|
+
selection,
|
|
144
|
+
schema,
|
|
145
|
+
tr
|
|
146
|
+
} = state;
|
|
147
|
+
const ranges = selection instanceof CellSelection ? selection.ranges : [selection];
|
|
148
|
+
ranges.forEach(({
|
|
149
|
+
$from,
|
|
150
|
+
$to
|
|
151
|
+
}) => {
|
|
152
|
+
tr.setBlockType($from.pos, $to.pos, schema.nodes.heading, {
|
|
153
|
+
level
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
if (dispatch) {
|
|
157
|
+
dispatch(tr);
|
|
158
|
+
}
|
|
159
|
+
return true;
|
|
160
|
+
};
|
|
161
|
+
}
|
|
140
162
|
export { insertBlock } from './insert-block';
|
|
@@ -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 = "74.
|
|
3
|
+
const packageVersion = "74.59.0";
|
|
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 = "74.
|
|
12
|
+
const packageVersion = "74.59.0";
|
|
13
13
|
const halfFocusRing = 1;
|
|
14
14
|
const dropOffset = '0, 8';
|
|
15
15
|
class DropList extends Component {
|
|
@@ -135,4 +135,23 @@ export function findCutBefore($pos) {
|
|
|
135
135
|
}
|
|
136
136
|
return null;
|
|
137
137
|
}
|
|
138
|
+
export function setHeading(level) {
|
|
139
|
+
return function (state, dispatch) {
|
|
140
|
+
var selection = state.selection,
|
|
141
|
+
schema = state.schema,
|
|
142
|
+
tr = state.tr;
|
|
143
|
+
var ranges = selection instanceof CellSelection ? selection.ranges : [selection];
|
|
144
|
+
ranges.forEach(function (_ref) {
|
|
145
|
+
var $from = _ref.$from,
|
|
146
|
+
$to = _ref.$to;
|
|
147
|
+
tr.setBlockType($from.pos, $to.pos, schema.nodes.heading, {
|
|
148
|
+
level: level
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
if (dispatch) {
|
|
152
|
+
dispatch(tr);
|
|
153
|
+
}
|
|
154
|
+
return true;
|
|
155
|
+
};
|
|
156
|
+
}
|
|
138
157
|
export { insertBlock } from './insert-block';
|
|
@@ -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 = "74.
|
|
9
|
+
var packageVersion = "74.59.0";
|
|
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 = "74.
|
|
22
|
+
var packageVersion = "74.59.0";
|
|
23
23
|
var halfFocusRing = 1;
|
|
24
24
|
var dropOffset = '0, 8';
|
|
25
25
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { MarkType, NodeType, Node as PMNode, ResolvedPos, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { HeadingLevelsAndNormalText } from '../types/block-type';
|
|
3
4
|
import type { Command } from '../types/command';
|
|
4
5
|
type AlignmentState = 'start' | 'end' | 'center';
|
|
5
6
|
export declare function addParagraphAtEnd(tr: Transaction): void;
|
|
@@ -16,4 +17,5 @@ export declare const createToggleBlockMarkOnRange: <T extends {} = object>(markT
|
|
|
16
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;
|
|
17
18
|
export declare const clearEditorContent: Command;
|
|
18
19
|
export declare function findCutBefore($pos: ResolvedPos): ResolvedPos | null;
|
|
20
|
+
export declare function setHeading(level: HeadingLevelsAndNormalText): Command;
|
|
19
21
|
export { insertBlock } from './insert-block';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { MarkType, NodeType, Node as PMNode, ResolvedPos, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { HeadingLevelsAndNormalText } from '../types/block-type';
|
|
3
4
|
import type { Command } from '../types/command';
|
|
4
5
|
type AlignmentState = 'start' | 'end' | 'center';
|
|
5
6
|
export declare function addParagraphAtEnd(tr: Transaction): void;
|
|
@@ -16,4 +17,5 @@ export declare const createToggleBlockMarkOnRange: <T extends {} = object>(markT
|
|
|
16
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;
|
|
17
18
|
export declare const clearEditorContent: Command;
|
|
18
19
|
export declare function findCutBefore($pos: ResolvedPos): ResolvedPos | null;
|
|
20
|
+
export declare function setHeading(level: HeadingLevelsAndNormalText): Command;
|
|
19
21
|
export { insertBlock } from './insert-block';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "74.
|
|
3
|
+
"version": "74.59.0",
|
|
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/"
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
"devDependencies": {
|
|
150
150
|
"@atlaskit/media-core": "^34.1.0",
|
|
151
151
|
"@atlaskit/media-test-helpers": "^33.0.0",
|
|
152
|
-
"@atlaskit/smart-card": "^26.
|
|
152
|
+
"@atlaskit/smart-card": "^26.25.0",
|
|
153
153
|
"@atlaskit/util-data-test": "^17.8.0",
|
|
154
154
|
"@atlaskit/visual-regression": "*",
|
|
155
155
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|