@atlaskit/editor-plugin-block-type 3.14.4 → 3.14.6
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 +15 -0
- package/dist/cjs/plugin/commands/block-type.js +3 -3
- package/dist/cjs/plugin/index.js +4 -5
- package/dist/cjs/plugin/pm-plugins/keymap.js +1 -1
- package/dist/cjs/plugin/ui/ToolbarBlockType/index.js +1 -1
- package/dist/es2019/plugin/index.js +4 -5
- package/dist/esm/plugin/commands/block-type.js +3 -3
- package/dist/esm/plugin/index.js +4 -5
- package/dist/esm/plugin/ui/ToolbarBlockType/index.js +1 -1
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
# @atlaskit/editor-plugin-block-type
|
2
2
|
|
3
|
+
## 3.14.6
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [#139784](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/139784)
|
8
|
+
[`47d08e6f06b2e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/47d08e6f06b2e) -
|
9
|
+
[ux] [ED-24861] Toggle between ProseMirror node based on feature gate instead of existing
|
10
|
+
experiment for node nesting media and codeblocks in blockquotes.
|
11
|
+
|
12
|
+
## 3.14.5
|
13
|
+
|
14
|
+
### Patch Changes
|
15
|
+
|
16
|
+
- Updated dependencies
|
17
|
+
|
3
18
|
## 3.14.4
|
4
19
|
|
5
20
|
### Patch Changes
|
@@ -15,9 +15,9 @@ var _editorAnalytics = require("@atlaskit/editor-common/editor-analytics");
|
|
15
15
|
var _utils = require("@atlaskit/editor-common/utils");
|
16
16
|
var _editorTables = require("@atlaskit/editor-tables");
|
17
17
|
var _blockTypes = require("../block-types");
|
18
|
-
function _createForOfIteratorHelper(
|
19
|
-
function _unsupportedIterableToArray(
|
20
|
-
function _arrayLikeToArray(
|
18
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
19
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
20
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
21
21
|
function setBlockType(name) {
|
22
22
|
return function (_ref) {
|
23
23
|
var tr = _ref.tr;
|
package/dist/cjs/plugin/index.js
CHANGED
@@ -102,12 +102,11 @@ var blockquotePluginOptions = function blockquotePluginOptions(_ref2, isAllowed,
|
|
102
102
|
}];
|
103
103
|
};
|
104
104
|
var blockTypePlugin = exports.blockTypePlugin = function blockTypePlugin(_ref3) {
|
105
|
-
var _api$
|
105
|
+
var _api$primaryToolbar;
|
106
106
|
var options = _ref3.config,
|
107
107
|
api = _ref3.api;
|
108
|
-
// Confluence is
|
109
|
-
|
110
|
-
var isNestingMediaAndCodeblockInQuoteSupported = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 || (_api$featureFlags = _api$featureFlags.sharedState.currentState()) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.nestMediaAndCodeblockInQuote) || (0, _platformFeatureFlags.fg)('editor_nest_media_and_codeblock_in_quotes_jira');
|
108
|
+
// Confluence and Jira is pulling it in through platform feature flags, from a feature gate
|
109
|
+
var isNestingInQuoteSchemaChanged = (0, _platformFeatureFlags.fg)('platform_editor_nest_in_quotes_adf_change') || (0, _platformFeatureFlags.fg)('editor_nest_media_and_codeblock_in_quotes_jira');
|
111
110
|
var primaryToolbarComponent = function primaryToolbarComponent(_ref4) {
|
112
111
|
var popupsMountPoint = _ref4.popupsMountPoint,
|
113
112
|
popupsBoundariesElement = _ref4.popupsBoundariesElement,
|
@@ -139,7 +138,7 @@ var blockTypePlugin = exports.blockTypePlugin = function blockTypePlugin(_ref3)
|
|
139
138
|
node: _adfSchema.heading
|
140
139
|
}, {
|
141
140
|
name: 'blockquote',
|
142
|
-
node:
|
141
|
+
node: isNestingInQuoteSchemaChanged ? _adfSchema.blockquoteWithNestedCodeblockOrMedia : _adfSchema.blockquoteWithList
|
143
142
|
}, {
|
144
143
|
name: 'hardBreak',
|
145
144
|
node: _adfSchema.hardBreak
|
@@ -14,7 +14,7 @@ var blockTypes = _interopRequireWildcard(require("../block-types"));
|
|
14
14
|
var _commands2 = require("../commands");
|
15
15
|
var _utils2 = require("../utils");
|
16
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
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 &&
|
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 && {}.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 backspaceCommand = (0, _commands.chainCommands)(_commands2.cleanUpAtTheStartOfDocument, (0, _commands2.deleteBlockContent)(_utils2.isNodeAWrappingBlockNode), _commands2.deleteAndMoveCursor);
|
19
19
|
var del = (0, _commands.chainCommands)((0, _utils.deleteEmptyParagraphAndMoveBlockUp)(_utils2.isNodeAWrappingBlockNode), (0, _commands2.deleteBlockContent)(_utils2.isNodeAWrappingBlockNode), _commands2.deleteAndMoveCursor);
|
20
20
|
function keymapPlugin(editorAnalyticsApi, schema, _featureFlags) {
|
@@ -23,7 +23,7 @@ var _blocktypeButton = require("./blocktype-button");
|
|
23
23
|
var _styled = require("./styled");
|
24
24
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
25
25
|
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) { (0, _defineProperty2.default)(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; }
|
26
|
-
function _createSuper(
|
26
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
27
27
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
|
28
28
|
* @jsxRuntime classic
|
29
29
|
* @jsx jsx
|
@@ -89,10 +89,9 @@ const blockTypePlugin = ({
|
|
89
89
|
config: options,
|
90
90
|
api
|
91
91
|
}) => {
|
92
|
-
var _api$
|
93
|
-
// Confluence is
|
94
|
-
|
95
|
-
const isNestingMediaAndCodeblockInQuoteSupported = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : (_api$featureFlags$sha = _api$featureFlags.sharedState.currentState()) === null || _api$featureFlags$sha === void 0 ? void 0 : _api$featureFlags$sha.nestMediaAndCodeblockInQuote) || fg('editor_nest_media_and_codeblock_in_quotes_jira');
|
92
|
+
var _api$primaryToolbar;
|
93
|
+
// Confluence and Jira is pulling it in through platform feature flags, from a feature gate
|
94
|
+
const isNestingInQuoteSchemaChanged = fg('platform_editor_nest_in_quotes_adf_change') || fg('editor_nest_media_and_codeblock_in_quotes_jira');
|
96
95
|
const primaryToolbarComponent = ({
|
97
96
|
popupsMountPoint,
|
98
97
|
popupsBoundariesElement,
|
@@ -125,7 +124,7 @@ const blockTypePlugin = ({
|
|
125
124
|
node: heading
|
126
125
|
}, {
|
127
126
|
name: 'blockquote',
|
128
|
-
node:
|
127
|
+
node: isNestingInQuoteSchemaChanged ? blockquoteWithNestedCodeblockOrMedia : blockquoteWithList
|
129
128
|
}, {
|
130
129
|
name: 'hardBreak',
|
131
130
|
node: hardBreak
|
@@ -1,6 +1,6 @@
|
|
1
|
-
function _createForOfIteratorHelper(
|
2
|
-
function _unsupportedIterableToArray(
|
3
|
-
function _arrayLikeToArray(
|
1
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
2
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
3
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
4
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
5
5
|
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
6
6
|
import { filterChildrenBetween, wrapSelectionIn } from '@atlaskit/editor-common/utils';
|
package/dist/esm/plugin/index.js
CHANGED
@@ -89,12 +89,11 @@ var blockquotePluginOptions = function blockquotePluginOptions(_ref2, isAllowed,
|
|
89
89
|
}];
|
90
90
|
};
|
91
91
|
var blockTypePlugin = function blockTypePlugin(_ref3) {
|
92
|
-
var _api$
|
92
|
+
var _api$primaryToolbar;
|
93
93
|
var options = _ref3.config,
|
94
94
|
api = _ref3.api;
|
95
|
-
// Confluence is
|
96
|
-
|
97
|
-
var isNestingMediaAndCodeblockInQuoteSupported = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 || (_api$featureFlags = _api$featureFlags.sharedState.currentState()) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.nestMediaAndCodeblockInQuote) || fg('editor_nest_media_and_codeblock_in_quotes_jira');
|
95
|
+
// Confluence and Jira is pulling it in through platform feature flags, from a feature gate
|
96
|
+
var isNestingInQuoteSchemaChanged = fg('platform_editor_nest_in_quotes_adf_change') || fg('editor_nest_media_and_codeblock_in_quotes_jira');
|
98
97
|
var primaryToolbarComponent = function primaryToolbarComponent(_ref4) {
|
99
98
|
var popupsMountPoint = _ref4.popupsMountPoint,
|
100
99
|
popupsBoundariesElement = _ref4.popupsBoundariesElement,
|
@@ -126,7 +125,7 @@ var blockTypePlugin = function blockTypePlugin(_ref3) {
|
|
126
125
|
node: heading
|
127
126
|
}, {
|
128
127
|
name: 'blockquote',
|
129
|
-
node:
|
128
|
+
node: isNestingInQuoteSchemaChanged ? blockquoteWithNestedCodeblockOrMedia : blockquoteWithList
|
130
129
|
}, {
|
131
130
|
name: 'hardBreak',
|
132
131
|
node: hardBreak
|
@@ -7,7 +7,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
8
8
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
9
9
|
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; }
|
10
|
-
function _createSuper(
|
10
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
11
11
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
12
12
|
/**
|
13
13
|
* @jsxRuntime classic
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaskit/editor-plugin-block-type",
|
3
|
-
"version": "3.14.
|
3
|
+
"version": "3.14.6",
|
4
4
|
"description": "BlockType plugin for @atlaskit/editor-core",
|
5
5
|
"author": "Atlassian Pty Ltd",
|
6
6
|
"license": "Apache-2.0",
|
@@ -34,13 +34,13 @@
|
|
34
34
|
},
|
35
35
|
"dependencies": {
|
36
36
|
"@atlaskit/adf-schema": "^40.9.0",
|
37
|
-
"@atlaskit/editor-common": "^
|
37
|
+
"@atlaskit/editor-common": "^89.0.0",
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^1.8.0",
|
39
39
|
"@atlaskit/editor-plugin-primary-toolbar": "^2.0.0",
|
40
40
|
"@atlaskit/editor-prosemirror": "5.0.1",
|
41
41
|
"@atlaskit/editor-shared-styles": "^2.13.0",
|
42
42
|
"@atlaskit/editor-tables": "^2.8.0",
|
43
|
-
"@atlaskit/icon": "^22.
|
43
|
+
"@atlaskit/icon": "^22.16.0",
|
44
44
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
45
45
|
"@atlaskit/prosemirror-input-rules": "^3.2.0",
|
46
46
|
"@atlaskit/theme": "^13.0.0",
|
@@ -103,6 +103,9 @@
|
|
103
103
|
"platform-feature-flags": {
|
104
104
|
"editor_nest_media_and_codeblock_in_quotes_jira": {
|
105
105
|
"type": "boolean"
|
106
|
+
},
|
107
|
+
"platform_editor_nest_in_quotes_adf_change": {
|
108
|
+
"type": "boolean"
|
106
109
|
}
|
107
110
|
}
|
108
111
|
}
|