@atlaskit/editor-plugin-quick-insert 12.1.2 → 12.1.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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/editor-plugin-quick-insert
2
2
 
3
+ ## 12.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 12.1.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [`4bc741a70d678`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4bc741a70d678) -
14
+ Add the first registry-backed Quick Insert slice with Table
15
+ - Updated dependencies
16
+
3
17
  ## 12.1.2
4
18
 
5
19
  ### Patch Changes
@@ -17,11 +17,13 @@ var _quickInsert = require("@atlaskit/editor-common/quick-insert");
17
17
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
18
18
  var _typeAhead = require("@atlaskit/editor-common/type-ahead");
19
19
  var _showMoreHorizontal = _interopRequireDefault(require("@atlaskit/icon/core/show-more-horizontal"));
20
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
20
21
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
21
22
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
22
23
  var _commands = require("./pm-plugins/commands");
23
24
  var _quickInsertOpenExperience = require("./pm-plugins/experiences/quick-insert-open-experience");
24
25
  var _pluginKey = require("./pm-plugins/plugin-key");
26
+ var _getQuickInsertComponents = require("./ui/getQuickInsertComponents");
25
27
  var _ModalElementBrowser = _interopRequireDefault(require("./ui/ModalElementBrowser"));
26
28
  var _search = require("./ui/search");
27
29
  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; }
@@ -91,6 +93,10 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
91
93
  };
92
94
  } : undefined
93
95
  };
96
+ if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_slash_command')) {
97
+ var _api$uiControlRegistr;
98
+ api === null || api === void 0 || (_api$uiControlRegistr = api.uiControlRegistry) === null || _api$uiControlRegistr === void 0 || _api$uiControlRegistr.actions.register((0, _getQuickInsertComponents.getQuickInsertComponents)());
99
+ }
94
100
  var intl;
95
101
  return {
96
102
  name: 'quickInsert',
@@ -98,7 +98,9 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
98
98
  var label = intl.formatMessage(_quickInsert.messages.browse);
99
99
  return (0, _react2.jsx)("div", {
100
100
  "data-editor-popup": true
101
- }, (0, _react2.jsx)(_modalDialog.ModalTransition, null, props.isOpen && (0, _react2.jsx)(_modalDialog.default, {
101
+ }, (0, _react2.jsx)(_modalDialog.ModalTransition, null, props.isOpen &&
102
+ // eslint-disable-next-line @atlaskit/design-system/no-modal-label
103
+ (0, _react2.jsx)(_modalDialog.default, {
102
104
  label: label,
103
105
  testId: "element-browser-modal-dialog",
104
106
  stackIndex: 0,
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.getQuickInsertComponents = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
+ var _keys = require("@atlaskit/editor-common/quick-insert/keys");
11
+ var _rank = require("@atlaskit/editor-common/quick-insert/rank");
12
+ 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; }
13
+ 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; }
14
+ var sections = [_keys.RECOMMENDED_SECTION, _keys.STRUCTURE_SECTION, _keys.MEDIA_SECTION, _keys.EMBED_SECTION, _keys.TEXT_FORMATTING_SECTION, _keys.ROVO_SECTION, _keys.DATA_AND_CHARTS_SECTION, _keys.BLOCK_TEMPLATES_SECTION, _keys.OTHER_SECTION];
15
+ var getQuickInsertComponents = exports.getQuickInsertComponents = function getQuickInsertComponents() {
16
+ return [_keys.MENU].concat((0, _toConsumableArray2.default)(sections.map(function (section) {
17
+ return _objectSpread(_objectSpread({}, section), {}, {
18
+ parents: [_objectSpread(_objectSpread({}, _keys.MENU), {}, {
19
+ rank: _rank.QUICK_INSERT_MENU_RANK[section.key]
20
+ })]
21
+ });
22
+ })));
23
+ };
@@ -6,11 +6,13 @@ import { memoProcessQuickInsertItems } from '@atlaskit/editor-common/quick-inser
6
6
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
7
7
  import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
8
8
  import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
9
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
9
10
  import { fg } from '@atlaskit/platform-feature-flags';
10
11
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
11
12
  import { createInsertItem, openElementBrowserModal } from './pm-plugins/commands';
12
13
  import { getQuickInsertOpenExperiencePlugin } from './pm-plugins/experiences/quick-insert-open-experience';
13
14
  import { pluginKey } from './pm-plugins/plugin-key';
15
+ import { getQuickInsertComponents } from './ui/getQuickInsertComponents';
14
16
  import ModalElementBrowser from './ui/ModalElementBrowser';
15
17
  import { getQuickInsertSuggestions, withLayoutQuickInsertPrioritySorting } from './ui/search';
16
18
  export const quickInsertPlugin = ({
@@ -82,6 +84,10 @@ export const quickInsertPlugin = ({
82
84
  };
83
85
  } : undefined
84
86
  };
87
+ if (isExperimentEnabled('platform_editor_slash_command')) {
88
+ var _api$uiControlRegistr;
89
+ api === null || api === void 0 ? void 0 : (_api$uiControlRegistr = api.uiControlRegistry) === null || _api$uiControlRegistr === void 0 ? void 0 : _api$uiControlRegistr.actions.register(getQuickInsertComponents());
90
+ }
85
91
  let intl;
86
92
  return {
87
93
  name: 'quickInsert',
@@ -80,7 +80,9 @@ const ModalElementBrowser = props => {
80
80
  const label = intl.formatMessage(messages.browse);
81
81
  return jsx("div", {
82
82
  "data-editor-popup": true
83
- }, jsx(ModalTransition, null, props.isOpen && jsx(Modal, {
83
+ }, jsx(ModalTransition, null, props.isOpen &&
84
+ // eslint-disable-next-line @atlaskit/design-system/no-modal-label
85
+ jsx(Modal, {
84
86
  label: label,
85
87
  testId: "element-browser-modal-dialog",
86
88
  stackIndex: 0,
@@ -0,0 +1,10 @@
1
+ import { BLOCK_TEMPLATES_SECTION, DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, MENU, OTHER_SECTION, RECOMMENDED_SECTION, ROVO_SECTION, STRUCTURE_SECTION, TEXT_FORMATTING_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
2
+ import { QUICK_INSERT_MENU_RANK } from '@atlaskit/editor-common/quick-insert/rank';
3
+ const sections = [RECOMMENDED_SECTION, STRUCTURE_SECTION, MEDIA_SECTION, EMBED_SECTION, TEXT_FORMATTING_SECTION, ROVO_SECTION, DATA_AND_CHARTS_SECTION, BLOCK_TEMPLATES_SECTION, OTHER_SECTION];
4
+ export const getQuickInsertComponents = () => [MENU, ...sections.map(section => ({
5
+ ...section,
6
+ parents: [{
7
+ ...MENU,
8
+ rank: QUICK_INSERT_MENU_RANK[section.key]
9
+ }]
10
+ }))];
@@ -12,11 +12,13 @@ import { memoProcessQuickInsertItems } from '@atlaskit/editor-common/quick-inser
12
12
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
13
13
  import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
14
14
  import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
15
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
15
16
  import { fg } from '@atlaskit/platform-feature-flags';
16
17
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
17
18
  import { createInsertItem, openElementBrowserModal as _openElementBrowserModal } from './pm-plugins/commands';
18
19
  import { getQuickInsertOpenExperiencePlugin } from './pm-plugins/experiences/quick-insert-open-experience';
19
20
  import { pluginKey } from './pm-plugins/plugin-key';
21
+ import { getQuickInsertComponents } from './ui/getQuickInsertComponents';
20
22
  import ModalElementBrowser from './ui/ModalElementBrowser';
21
23
  import { getQuickInsertSuggestions, withLayoutQuickInsertPrioritySorting } from './ui/search';
22
24
  export var quickInsertPlugin = function quickInsertPlugin(_ref) {
@@ -84,6 +86,10 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
84
86
  };
85
87
  } : undefined
86
88
  };
89
+ if (isExperimentEnabled('platform_editor_slash_command')) {
90
+ var _api$uiControlRegistr;
91
+ api === null || api === void 0 || (_api$uiControlRegistr = api.uiControlRegistry) === null || _api$uiControlRegistr === void 0 || _api$uiControlRegistr.actions.register(getQuickInsertComponents());
92
+ }
87
93
  var intl;
88
94
  return {
89
95
  name: 'quickInsert',
@@ -88,7 +88,9 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
88
88
  var label = intl.formatMessage(messages.browse);
89
89
  return jsx("div", {
90
90
  "data-editor-popup": true
91
- }, jsx(ModalTransition, null, props.isOpen && jsx(Modal, {
91
+ }, jsx(ModalTransition, null, props.isOpen &&
92
+ // eslint-disable-next-line @atlaskit/design-system/no-modal-label
93
+ jsx(Modal, {
92
94
  label: label,
93
95
  testId: "element-browser-modal-dialog",
94
96
  stackIndex: 0,
@@ -0,0 +1,16 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
+ 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; }
4
+ 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; }
5
+ import { BLOCK_TEMPLATES_SECTION, DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, MENU, OTHER_SECTION, RECOMMENDED_SECTION, ROVO_SECTION, STRUCTURE_SECTION, TEXT_FORMATTING_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
6
+ import { QUICK_INSERT_MENU_RANK } from '@atlaskit/editor-common/quick-insert/rank';
7
+ var sections = [RECOMMENDED_SECTION, STRUCTURE_SECTION, MEDIA_SECTION, EMBED_SECTION, TEXT_FORMATTING_SECTION, ROVO_SECTION, DATA_AND_CHARTS_SECTION, BLOCK_TEMPLATES_SECTION, OTHER_SECTION];
8
+ export var getQuickInsertComponents = function getQuickInsertComponents() {
9
+ return [MENU].concat(_toConsumableArray(sections.map(function (section) {
10
+ return _objectSpread(_objectSpread({}, section), {}, {
11
+ parents: [_objectSpread(_objectSpread({}, MENU), {}, {
12
+ rank: QUICK_INSERT_MENU_RANK[section.key]
13
+ })]
14
+ });
15
+ })));
16
+ };
@@ -5,6 +5,7 @@ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
5
5
  import type { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
6
6
  import type { MetricsPlugin } from '@atlaskit/editor-plugin-metrics';
7
7
  import type { TypeAheadInputMethod, TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
8
+ import type { UiControlRegistryPlugin } from '@atlaskit/editor-plugin-ui-control-registry/ui-control-registry-plugin-type';
8
9
  export type QuickInsertSharedState = CommonQuickInsertSharedState & {
9
10
  typeAheadHandler: TypeAheadHandler;
10
11
  };
@@ -25,7 +26,8 @@ export type QuickInsertPlugin = NextEditorPlugin<'quickInsert', {
25
26
  TypeAheadPlugin,
26
27
  OptionalPlugin<ConnectivityPlugin>,
27
28
  OptionalPlugin<MetricsPlugin>,
28
- OptionalPlugin<AnalyticsPlugin>
29
+ OptionalPlugin<AnalyticsPlugin>,
30
+ OptionalPlugin<UiControlRegistryPlugin>
29
31
  ];
30
32
  pluginConfiguration: QuickInsertPluginOptions | undefined;
31
33
  sharedState: QuickInsertSharedState | null;
@@ -0,0 +1,2 @@
1
+ import type { RegisterComponent } from '@atlaskit/editor-ui-control-model/types';
2
+ export declare const getQuickInsertComponents: () => RegisterComponent[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-quick-insert",
3
- "version": "12.1.2",
3
+ "version": "12.1.4",
4
4
  "description": "Quick insert plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -26,17 +26,20 @@
26
26
  "@atlaskit/editor-plugin-connectivity": "^12.1.0",
27
27
  "@atlaskit/editor-plugin-metrics": "^13.1.0",
28
28
  "@atlaskit/editor-plugin-type-ahead": "^13.2.0",
29
+ "@atlaskit/editor-plugin-ui-control-registry": "^6.1.0",
29
30
  "@atlaskit/editor-prosemirror": "^8.0.0",
31
+ "@atlaskit/editor-ui-control-model": "^2.4.0",
30
32
  "@atlaskit/icon": "^37.2.0",
31
33
  "@atlaskit/modal-dialog": "^16.2.0",
34
+ "@atlaskit/platform-feature-experiments": "^0.3.0",
32
35
  "@atlaskit/platform-feature-flags": "^2.1.0",
33
- "@atlaskit/tmp-editor-statsig": "^136.0.0",
36
+ "@atlaskit/tmp-editor-statsig": "^137.0.0",
34
37
  "@atlaskit/tokens": "^16.3.0",
35
38
  "@babel/runtime": "^7.0.0",
36
39
  "@emotion/react": "^11.7.1"
37
40
  },
38
41
  "peerDependencies": {
39
- "@atlaskit/editor-common": "^116.48.0",
42
+ "@atlaskit/editor-common": "^116.51.0",
40
43
  "react": "^18.2.0 || ^19.2.0",
41
44
  "react-dom": "^18.2.0 || ^19.2.0",
42
45
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"