@atlaskit/adf-schema 25.4.0 → 25.5.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 +11 -0
- package/dist/cjs/schema/jira-schema.js +4 -0
- package/dist/cjs/schema/marks/alignment.js +4 -0
- package/dist/cjs/schema/marks/border.js +6 -0
- package/dist/cjs/schema/marks/breakout.js +5 -0
- package/dist/cjs/schema/marks/code.js +4 -0
- package/dist/cjs/schema/marks/data-consumer.js +17 -0
- package/dist/cjs/schema/marks/em.js +4 -0
- package/dist/cjs/schema/marks/fragment.js +6 -0
- package/dist/cjs/schema/marks/indentation.js +4 -0
- package/dist/cjs/schema/marks/link.js +4 -0
- package/dist/cjs/schema/marks/strike.js +4 -0
- package/dist/cjs/schema/marks/strong.js +4 -0
- package/dist/cjs/schema/marks/subsup.js +4 -0
- package/dist/cjs/schema/marks/text-color.js +4 -0
- package/dist/cjs/schema/marks/underline.js +4 -0
- package/dist/cjs/schema/nodes/bodied-extension.js +8 -0
- package/dist/cjs/schema/nodes/code-block.js +12 -0
- package/dist/cjs/schema/nodes/decision-item.js +4 -0
- package/dist/cjs/schema/nodes/decision-list.js +4 -0
- package/dist/cjs/schema/nodes/emoji.js +4 -0
- package/dist/cjs/schema/nodes/extension.js +8 -0
- package/dist/cjs/schema/nodes/inline-extension.js +8 -0
- package/dist/cjs/schema/nodes/media-inline.js +4 -0
- package/dist/cjs/schema/nodes/media.js +4 -0
- package/dist/cjs/schema/nodes/mention.js +3 -0
- package/dist/cjs/schema/nodes/panel.js +3 -0
- package/dist/cjs/schema/nodes/paragraph.js +0 -3
- package/dist/cjs/schema/nodes/status.js +4 -0
- package/dist/cjs/schema/nodes/tableNodes.js +23 -0
- package/dist/cjs/schema/nodes/task-item.js +4 -0
- package/dist/cjs/schema/nodes/task-list.js +4 -0
- package/dist/cjs/steps/link-meta-step.js +112 -0
- package/dist/cjs/steps/table/utils/cells-at-column.js +4 -4
- package/dist/cjs/steps.js +8 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/schema/jira-schema.js +5 -0
- package/dist/es2019/schema/marks/alignment.js +5 -0
- package/dist/es2019/schema/marks/border.js +7 -0
- package/dist/es2019/schema/marks/breakout.js +5 -0
- package/dist/es2019/schema/marks/data-consumer.js +6 -0
- package/dist/es2019/schema/marks/fragment.js +7 -0
- package/dist/es2019/schema/marks/indentation.js +5 -0
- package/dist/es2019/schema/marks/link.js +5 -0
- package/dist/es2019/schema/marks/subsup.js +5 -0
- package/dist/es2019/schema/marks/text-color.js +5 -0
- package/dist/es2019/schema/nodes/bodied-extension.js +9 -0
- package/dist/es2019/schema/nodes/code-block.js +13 -0
- package/dist/es2019/schema/nodes/decision-item.js +5 -0
- package/dist/es2019/schema/nodes/extension.js +9 -0
- package/dist/es2019/schema/nodes/heading.js +0 -2
- package/dist/es2019/schema/nodes/inline-extension.js +9 -0
- package/dist/es2019/schema/nodes/layout-section.js +0 -3
- package/dist/es2019/schema/nodes/media-inline.js +5 -0
- package/dist/es2019/schema/nodes/media.js +5 -0
- package/dist/es2019/schema/nodes/mention.js +3 -0
- package/dist/es2019/schema/nodes/panel.js +3 -0
- package/dist/es2019/schema/nodes/paragraph.js +0 -3
- package/dist/es2019/schema/nodes/tableNodes.js +23 -0
- package/dist/es2019/schema/nodes/task-item.js +5 -0
- package/dist/es2019/schema/nodes/task-list.js +5 -0
- package/dist/es2019/steps/link-meta-step.js +71 -0
- package/dist/es2019/steps.js +2 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/schema/jira-schema.js +5 -0
- package/dist/esm/schema/marks/alignment.js +5 -0
- package/dist/esm/schema/marks/border.js +7 -0
- package/dist/esm/schema/marks/breakout.js +5 -0
- package/dist/esm/schema/marks/data-consumer.js +6 -0
- package/dist/esm/schema/marks/fragment.js +7 -0
- package/dist/esm/schema/marks/indentation.js +5 -0
- package/dist/esm/schema/marks/link.js +5 -0
- package/dist/esm/schema/marks/subsup.js +5 -0
- package/dist/esm/schema/marks/text-color.js +5 -0
- package/dist/esm/schema/nodes/bodied-extension.js +9 -0
- package/dist/esm/schema/nodes/code-block.js +13 -0
- package/dist/esm/schema/nodes/decision-item.js +5 -0
- package/dist/esm/schema/nodes/extension.js +9 -0
- package/dist/esm/schema/nodes/heading.js +0 -2
- package/dist/esm/schema/nodes/inline-extension.js +9 -0
- package/dist/esm/schema/nodes/layout-section.js +0 -3
- package/dist/esm/schema/nodes/media-inline.js +5 -0
- package/dist/esm/schema/nodes/media.js +5 -0
- package/dist/esm/schema/nodes/mention.js +3 -0
- package/dist/esm/schema/nodes/panel.js +3 -0
- package/dist/esm/schema/nodes/paragraph.js +0 -3
- package/dist/esm/schema/nodes/tableNodes.js +23 -0
- package/dist/esm/schema/nodes/task-item.js +5 -0
- package/dist/esm/schema/nodes/task-list.js +5 -0
- package/dist/esm/steps/link-meta-step.js +103 -0
- package/dist/esm/steps/table/utils/cells-at-column.js +4 -3
- package/dist/esm/steps.js +2 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/steps/link-meta-step.d.ts +51 -0
- package/dist/types/steps.d.ts +2 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# @atlaskit/adf-schema
|
2
2
|
|
3
|
+
## 25.5.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- [`0237059f136`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0237059f136) - Adds `LinkMetaStep` prosemirror step to be used to annotate a transaction with metadata about how (action, input method etc) for how a transaction has been performed.
|
8
|
+
|
9
|
+
### Patch Changes
|
10
|
+
|
11
|
+
- [`2e01c9c74b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e01c9c74b5) - DUMMY remove before merging to master; dupe adf-schema via adf-utils
|
12
|
+
- Updated dependencies
|
13
|
+
|
3
14
|
## 25.4.0
|
4
15
|
|
5
16
|
### Minor Changes
|
@@ -16,6 +16,10 @@ exports.isSchemaWithSubSupMark = isSchemaWithSubSupMark;
|
|
16
16
|
exports.isSchemaWithTables = isSchemaWithTables;
|
17
17
|
exports.isSchemaWithTextColor = isSchemaWithTextColor;
|
18
18
|
var _createSchema = require("./create-schema");
|
19
|
+
/**
|
20
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
21
|
+
**/
|
22
|
+
|
19
23
|
/**
|
20
24
|
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
21
25
|
**/
|
@@ -8,6 +8,12 @@ exports.borderColorPalette = exports.border = void 0;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
9
9
|
var _editorPalette = require("@atlaskit/editor-palette");
|
10
10
|
var _colors = require("../../utils/colors");
|
11
|
+
/**
|
12
|
+
* @name border_mark
|
13
|
+
* @stage 0
|
14
|
+
* @description This mark adds decoration to an element, and any element decorated with it will also have a border style.
|
15
|
+
*/
|
16
|
+
|
11
17
|
var borderColorArrayPalette = [[_colors.N300A, 'Subtle gray'], [_colors.N600, 'Gray'], [_colors.N1000, 'Bold gray']];
|
12
18
|
var borderColorPalette = new Map();
|
13
19
|
exports.borderColorPalette = borderColorPalette;
|
@@ -5,6 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.code = void 0;
|
7
7
|
var _groups = require("../groups");
|
8
|
+
/**
|
9
|
+
* @name code_mark
|
10
|
+
*/
|
11
|
+
|
8
12
|
var code = {
|
9
13
|
excludes: "".concat(_groups.FONT_STYLE, " ").concat(_groups.LINK, " ").concat(_groups.SEARCH_QUERY, " ").concat(_groups.COLOR),
|
10
14
|
inclusive: true,
|
@@ -5,6 +5,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.toJSON = exports.dataConsumer = void 0;
|
7
7
|
var _parseDOM = require("../../utils/parseDOM");
|
8
|
+
/**
|
9
|
+
* This annotation is purely for reference, & does _nothing_ given annotating
|
10
|
+
* `minLength` on an array of strings is not supported with our schema+spec
|
11
|
+
* generator.
|
12
|
+
*
|
13
|
+
* We're keeping it to signal that data consumer `sources` shouldn't be empty
|
14
|
+
* strings
|
15
|
+
*
|
16
|
+
* // @minLength 1
|
17
|
+
*/
|
18
|
+
|
19
|
+
/**
|
20
|
+
* @name dataConsumer_mark
|
21
|
+
* @description This mark is used for metadata surrounding a node consuming data
|
22
|
+
* from a given source node
|
23
|
+
*/
|
24
|
+
|
8
25
|
var parseDataConsumer = function parseDataConsumer(maybeValue) {
|
9
26
|
var sources = (0, _parseDOM.isDOMElement)(maybeValue) && maybeValue.getAttribute('data-sources');
|
10
27
|
try {
|
@@ -9,6 +9,12 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
9
9
|
var _parseDOM = require("../../utils/parseDOM");
|
10
10
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
11
11
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
12
|
+
/**
|
13
|
+
* @name fragment_mark
|
14
|
+
* @description Indicates that the elements decorated with this mark belong to a "fragment" entity, which represents a collection of ADF nodes.
|
15
|
+
* This entity can be referred to later by its `localId` attribute.
|
16
|
+
*/
|
17
|
+
|
12
18
|
var parseFragment = function parseFragment(maybeValue) {
|
13
19
|
var _maybeValue$getAttrib;
|
14
20
|
if (!(0, _parseDOM.isDOMElement)(maybeValue)) {
|
@@ -5,6 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.indentation = void 0;
|
7
7
|
var _groups = require("../groups");
|
8
|
+
/**
|
9
|
+
* @name indentation_mark
|
10
|
+
*/
|
11
|
+
|
8
12
|
var indentation = {
|
9
13
|
excludes: "indentation ".concat(_groups.ALIGNMENT),
|
10
14
|
group: _groups.INDENTATION,
|
@@ -10,6 +10,10 @@ var _groups = require("../groups");
|
|
10
10
|
var _url = require("../../utils/url");
|
11
11
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
12
12
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
13
|
+
/**
|
14
|
+
* @name link_mark
|
15
|
+
*/
|
16
|
+
|
13
17
|
var getLinkAttrs = function getLinkAttrs(attribute) {
|
14
18
|
return function (domNode) {
|
15
19
|
var dom = domNode;
|
@@ -5,6 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.subsup = void 0;
|
7
7
|
var _groups = require("../groups");
|
8
|
+
/**
|
9
|
+
* @name subsup_mark
|
10
|
+
*/
|
11
|
+
|
8
12
|
function getAttrFromVerticalAlign(node) {
|
9
13
|
if (node.style.verticalAlign) {
|
10
14
|
var type = node.style.verticalAlign.slice(0, 3);
|
@@ -10,6 +10,10 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
10
10
|
var _editorPalette = require("@atlaskit/editor-palette");
|
11
11
|
var _groups = require("../groups");
|
12
12
|
var _colors = require("../../utils/colors");
|
13
|
+
/**
|
14
|
+
* @name textColor_mark
|
15
|
+
*/
|
16
|
+
|
13
17
|
// used for extended palette in text color picker
|
14
18
|
var colorArrayPalette = [
|
15
19
|
// default row - first color is added programatically
|
@@ -5,6 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.bodiedExtension = void 0;
|
7
7
|
var _extensions = require("../../utils/extensions");
|
8
|
+
/**
|
9
|
+
* @name bodiedExtension_node
|
10
|
+
*/
|
11
|
+
|
12
|
+
/**
|
13
|
+
* @name bodiedExtension_with_marks_node
|
14
|
+
*/
|
15
|
+
|
8
16
|
var createBodiedExtensionNodeSpec = function createBodiedExtensionNodeSpec() {
|
9
17
|
var nodeSpec = {
|
10
18
|
inline: false,
|
@@ -5,6 +5,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.toJSON = exports.codeBlock = void 0;
|
7
7
|
var _prosemirrorModel = require("prosemirror-model");
|
8
|
+
/**
|
9
|
+
* @name codeBlock_node
|
10
|
+
*/
|
11
|
+
|
12
|
+
/**
|
13
|
+
* @name codeBlock_with_no_marks_node
|
14
|
+
*/
|
15
|
+
|
16
|
+
/**
|
17
|
+
* @name codeBlock_with_marks_node
|
18
|
+
*/
|
19
|
+
|
8
20
|
var getLanguageFromEditorStyle = function getLanguageFromEditorStyle(dom) {
|
9
21
|
return dom.getAttribute('data-language') || undefined;
|
10
22
|
};
|
@@ -5,6 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.decisionListSelector = exports.decisionList = void 0;
|
7
7
|
var _uuid = require("../../utils/uuid");
|
8
|
+
/**
|
9
|
+
* @name decisionList_node
|
10
|
+
*/
|
11
|
+
|
8
12
|
var name = 'decisionList';
|
9
13
|
var decisionListSelector = "[data-node-type=\"".concat(name, "\"]");
|
10
14
|
exports.decisionListSelector = decisionListSelector;
|
@@ -5,6 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.extension = void 0;
|
7
7
|
var _extensions = require("../../utils/extensions");
|
8
|
+
/**
|
9
|
+
* @name extension_node
|
10
|
+
*/
|
11
|
+
|
12
|
+
/**
|
13
|
+
* @name extension_with_marks_node
|
14
|
+
*/
|
15
|
+
|
8
16
|
var createExtensionNodeSpec = function createExtensionNodeSpec() {
|
9
17
|
var nodeSpec = {
|
10
18
|
inline: false,
|
@@ -5,6 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.inlineExtension = void 0;
|
7
7
|
var _extensions = require("../../utils/extensions");
|
8
|
+
/**
|
9
|
+
* @name inlineExtension_node
|
10
|
+
*/
|
11
|
+
|
12
|
+
/**
|
13
|
+
* @name inlineExtension_with_marks_node
|
14
|
+
*/
|
15
|
+
|
8
16
|
var createInlineExtensionNodeSpec = function createInlineExtensionNodeSpec() {
|
9
17
|
var nodeSpec = {
|
10
18
|
inline: true,
|
@@ -5,5 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.mediaInline = void 0;
|
7
7
|
var _media = require("./media");
|
8
|
+
/**
|
9
|
+
* @name mediaInline_node
|
10
|
+
*/
|
11
|
+
|
8
12
|
var mediaInline = (0, _media.createMediaSpec)(_media.defaultAttrs, true);
|
9
13
|
exports.mediaInline = mediaInline;
|
@@ -5,6 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.toJSON = exports.media = exports.defaultAttrs = exports.createMediaSpec = exports.copyPrivateAttributes = exports.camelCaseToKebabCase = void 0;
|
7
7
|
var _colors = require("../../utils/colors");
|
8
|
+
/**
|
9
|
+
* @name media_node
|
10
|
+
*/
|
11
|
+
|
8
12
|
var defaultAttrs = {
|
9
13
|
id: {
|
10
14
|
default: ''
|
@@ -19,6 +19,9 @@ exports.PanelType = PanelType;
|
|
19
19
|
PanelType["SUCCESS"] = "success";
|
20
20
|
PanelType["CUSTOM"] = "custom";
|
21
21
|
})(PanelType || (exports.PanelType = PanelType = {}));
|
22
|
+
/**
|
23
|
+
* @name panel_node
|
24
|
+
*/
|
22
25
|
var getDefaultAttrs = function getDefaultAttrs() {
|
23
26
|
var attrs = {
|
24
27
|
panelType: {
|
@@ -20,15 +20,12 @@ exports.paragraph = void 0;
|
|
20
20
|
* type T1 = X | Y
|
21
21
|
* type T2 = A | T1 | B // T2 = A | X | Y | B
|
22
22
|
*/
|
23
|
-
|
24
23
|
/**
|
25
24
|
* @name paragraph_with_alignment_node
|
26
25
|
*/
|
27
|
-
|
28
26
|
/**
|
29
27
|
* @name paragraph_with_indentation_node
|
30
28
|
*/
|
31
|
-
|
32
29
|
var isImageNode = function isImageNode(node) {
|
33
30
|
return Boolean(node && node.nodeName.toLowerCase() === 'img');
|
34
31
|
};
|
@@ -134,6 +134,29 @@ exports.tableBackgroundColorNames = tableBackgroundColorNames;
|
|
134
134
|
tableBackgroundColorPalette.set(colorValue.toLowerCase(), colorName);
|
135
135
|
tableBackgroundColorNames.set(colorName.toLowerCase(), colorValue.toLowerCase());
|
136
136
|
});
|
137
|
+
|
138
|
+
/**
|
139
|
+
* @name table_node
|
140
|
+
*/
|
141
|
+
|
142
|
+
/**
|
143
|
+
* @name table_row_node
|
144
|
+
*/
|
145
|
+
|
146
|
+
/**
|
147
|
+
* @name table_cell_content
|
148
|
+
* @minItems 1
|
149
|
+
* @allowUnsupportedBlock true
|
150
|
+
*/
|
151
|
+
|
152
|
+
/**
|
153
|
+
* @name table_cell_node
|
154
|
+
*/
|
155
|
+
|
156
|
+
/**
|
157
|
+
* @name table_header_node
|
158
|
+
*/
|
159
|
+
|
137
160
|
// TODO: Fix any, potential issue. ED-5048
|
138
161
|
var createTableSpec = function createTableSpec() {
|
139
162
|
var attrs = {
|
@@ -5,6 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.taskListSelector = exports.taskList = void 0;
|
7
7
|
var _uuid = require("../../utils/uuid");
|
8
|
+
/**
|
9
|
+
* @name taskList_node
|
10
|
+
*/
|
11
|
+
|
8
12
|
var name = 'actionList';
|
9
13
|
var taskListSelector = "[data-node-type=\"".concat(name, "\"]");
|
10
14
|
exports.taskListSelector = taskListSelector;
|
@@ -0,0 +1,112 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports.stepType = exports.invertStepType = exports.LinkMetaStep = void 0;
|
8
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
9
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
11
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
12
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
13
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
14
|
+
var _prosemirrorModel = require("prosemirror-model");
|
15
|
+
var _prosemirrorTransform = require("prosemirror-transform");
|
16
|
+
var _excluded = ["sourceEvent"];
|
17
|
+
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); }; }
|
18
|
+
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; } }
|
19
|
+
var stepType = 'editor-linking-meta';
|
20
|
+
exports.stepType = stepType;
|
21
|
+
var invertStepType = 'editor-linking-meta-invert';
|
22
|
+
exports.invertStepType = invertStepType;
|
23
|
+
/**
|
24
|
+
* Custom Prosemirror Step to attach metadata about user interactions with links
|
25
|
+
* Using a Step means that it will work with prosemirror-history and we get utilise when
|
26
|
+
* firing events on history change
|
27
|
+
*/
|
28
|
+
var LinkMetaStep = /*#__PURE__*/function (_Step) {
|
29
|
+
(0, _inherits2.default)(LinkMetaStep, _Step);
|
30
|
+
var _super = _createSuper(LinkMetaStep);
|
31
|
+
function LinkMetaStep(pos, metadata) {
|
32
|
+
var _this;
|
33
|
+
var isInverted = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
34
|
+
(0, _classCallCheck2.default)(this, LinkMetaStep);
|
35
|
+
_this = _super.call(this);
|
36
|
+
_this.pos = pos;
|
37
|
+
_this.metadata = metadata;
|
38
|
+
_this.isInverted = isInverted;
|
39
|
+
return _this;
|
40
|
+
}
|
41
|
+
(0, _createClass2.default)(LinkMetaStep, [{
|
42
|
+
key: "getMetadata",
|
43
|
+
value: function getMetadata() {
|
44
|
+
return this.metadata;
|
45
|
+
}
|
46
|
+
|
47
|
+
/**
|
48
|
+
* Generate new undo/redo analytics event when step is inverted
|
49
|
+
*/
|
50
|
+
}, {
|
51
|
+
key: "invert",
|
52
|
+
value: function invert() {
|
53
|
+
/**
|
54
|
+
* Omit sourceEvent in history
|
55
|
+
*/
|
56
|
+
var _this$metadata = this.metadata,
|
57
|
+
sourceEvent = _this$metadata.sourceEvent,
|
58
|
+
metadata = (0, _objectWithoutProperties2.default)(_this$metadata, _excluded);
|
59
|
+
return new LinkMetaStep(this.pos, metadata, true);
|
60
|
+
}
|
61
|
+
|
62
|
+
// Should make no modifications to the doc
|
63
|
+
}, {
|
64
|
+
key: "apply",
|
65
|
+
value: function apply(doc) {
|
66
|
+
return _prosemirrorTransform.StepResult.ok(doc);
|
67
|
+
}
|
68
|
+
}, {
|
69
|
+
key: "map",
|
70
|
+
value: function map(mapping) {
|
71
|
+
var newPos = this.pos;
|
72
|
+
if (typeof newPos === 'number') {
|
73
|
+
newPos = mapping.map(newPos);
|
74
|
+
}
|
75
|
+
// Return the same events, this step will never be removed
|
76
|
+
return new LinkMetaStep(newPos, this.metadata, this.isInverted);
|
77
|
+
}
|
78
|
+
}, {
|
79
|
+
key: "getMap",
|
80
|
+
value: function getMap() {
|
81
|
+
return new _prosemirrorTransform.StepMap([this.pos || 0, 0, 0]);
|
82
|
+
}
|
83
|
+
|
84
|
+
// Return null to avoid merging events
|
85
|
+
}, {
|
86
|
+
key: "merge",
|
87
|
+
value: function merge() {
|
88
|
+
return null;
|
89
|
+
}
|
90
|
+
}, {
|
91
|
+
key: "toJSON",
|
92
|
+
value: function toJSON() {
|
93
|
+
// When serialized we should create a noop Replace step
|
94
|
+
return {
|
95
|
+
stepType: 'replace',
|
96
|
+
from: 0,
|
97
|
+
to: 0
|
98
|
+
};
|
99
|
+
}
|
100
|
+
}], [{
|
101
|
+
key: "fromJSON",
|
102
|
+
value: function fromJSON(_, __) {
|
103
|
+
// This is a "local custom step" once serialized
|
104
|
+
// we need to transform it in a no-operation action
|
105
|
+
return new _prosemirrorTransform.ReplaceStep(0, 0, _prosemirrorModel.Slice.empty);
|
106
|
+
}
|
107
|
+
}]);
|
108
|
+
return LinkMetaStep;
|
109
|
+
}(_prosemirrorTransform.Step);
|
110
|
+
/** Register this step with Prosemirror */
|
111
|
+
exports.LinkMetaStep = LinkMetaStep;
|
112
|
+
_prosemirrorTransform.Step.jsonID(stepType, LinkMetaStep);
|
@@ -1,14 +1,14 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
5
5
|
value: true
|
6
6
|
});
|
7
7
|
exports.cellsAtColumn = cellsAtColumn;
|
8
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
9
8
|
var _utils = require("@atlaskit/editor-tables/utils");
|
10
9
|
var _tableMap = require("./table-map");
|
11
|
-
var _marked = /*#__PURE__*/_regenerator.default.mark(cellsAtColumn);
|
10
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
11
|
+
var _marked = /*#__PURE__*/_regeneratorRuntime().mark(cellsAtColumn);
|
12
12
|
/**
|
13
13
|
* Helper to have a consistent way to iterate for all the cells in a column.
|
14
14
|
* You can skip rows by passing the rows to skipped in the next arguments.
|
@@ -18,7 +18,7 @@ var _marked = /*#__PURE__*/_regenerator.default.mark(cellsAtColumn);
|
|
18
18
|
*/
|
19
19
|
function cellsAtColumn(rect, col) {
|
20
20
|
var map, tableStart, table, refColumn, row, index, pos, hasMergedCells, type, cell, cellInfo, skippedRows;
|
21
|
-
return
|
21
|
+
return _regeneratorRuntime().wrap(function cellsAtColumn$(_context) {
|
22
22
|
while (1) {
|
23
23
|
switch (_context.prev = _context.next) {
|
24
24
|
case 0:
|
package/dist/cjs/steps.js
CHANGED
@@ -27,6 +27,12 @@ Object.defineProperty(exports, "InsertTypeAheadStep", {
|
|
27
27
|
return _typeAhead.InsertTypeAheadStep;
|
28
28
|
}
|
29
29
|
});
|
30
|
+
Object.defineProperty(exports, "LinkMetaStep", {
|
31
|
+
enumerable: true,
|
32
|
+
get: function get() {
|
33
|
+
return _linkMetaStep.LinkMetaStep;
|
34
|
+
}
|
35
|
+
});
|
30
36
|
Object.defineProperty(exports, "SetAttrsStep", {
|
31
37
|
enumerable: true,
|
32
38
|
get: function get() {
|
@@ -50,4 +56,5 @@ var _sortColumn = require("./steps/table/sort-column");
|
|
50
56
|
var _typeAhead = require("./steps/type-ahead");
|
51
57
|
var _addColumn = require("./steps/table/add-column");
|
52
58
|
var _setAttrs = require("./steps/set-attrs");
|
53
|
-
var _analytics = require("./steps/analytics");
|
59
|
+
var _analytics = require("./steps/analytics");
|
60
|
+
var _linkMetaStep = require("./steps/link-meta-step");
|
package/dist/cjs/version.json
CHANGED
@@ -1,4 +1,9 @@
|
|
1
1
|
import { createSchema } from './create-schema';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
5
|
+
**/
|
6
|
+
|
2
7
|
/**
|
3
8
|
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
4
9
|
**/
|