@atlaskit/editor-plugin-insert-block 2.4.24 → 2.4.26

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.
Files changed (81) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/insertBlockPlugin.js +2 -1
  3. package/dist/cjs/types/index.js +5 -0
  4. package/dist/cjs/ui/ToolbarInsertBlock/create-items.js +30 -31
  5. package/dist/cjs/ui/ToolbarInsertBlock/index.js +2 -2
  6. package/dist/cjs/ui/templateOptions.js +5 -5
  7. package/dist/cjs/ui/transformOptions.js +1 -1
  8. package/dist/es2019/insertBlockPlugin.js +2 -1
  9. package/dist/es2019/types/index.js +1 -0
  10. package/dist/es2019/ui/ToolbarInsertBlock/create-items.js +1 -2
  11. package/dist/es2019/ui/ToolbarInsertBlock/index.js +1 -1
  12. package/dist/es2019/ui/templateOptions.js +5 -5
  13. package/dist/es2019/ui/transformOptions.js +1 -1
  14. package/dist/esm/insertBlockPlugin.js +2 -1
  15. package/dist/esm/types/index.js +1 -0
  16. package/dist/esm/ui/ToolbarInsertBlock/create-items.js +1 -2
  17. package/dist/esm/ui/ToolbarInsertBlock/index.js +1 -1
  18. package/dist/esm/ui/templateOptions.js +5 -5
  19. package/dist/esm/ui/transformOptions.js +1 -1
  20. package/dist/types/index.d.ts +2 -2
  21. package/dist/types/insertBlockPlugin.d.ts +2 -24
  22. package/dist/types/insertBlockPluginType.d.ts +10 -53
  23. package/dist/types/types/index.d.ts +67 -0
  24. package/dist/types/ui/ElementRail/index.d.ts +4 -3
  25. package/dist/types/ui/ElementRail/useInsertMenuRailItems.d.ts +2 -1
  26. package/dist/types/ui/templateOptions.d.ts +1 -1
  27. package/dist/types/ui/transformOptions.d.ts +2 -2
  28. package/dist/types-ts4.5/index.d.ts +2 -2
  29. package/dist/types-ts4.5/insertBlockPlugin.d.ts +2 -24
  30. package/dist/types-ts4.5/insertBlockPluginType.d.ts +10 -53
  31. package/dist/types-ts4.5/types/index.d.ts +67 -0
  32. package/dist/types-ts4.5/ui/ElementRail/index.d.ts +4 -3
  33. package/dist/types-ts4.5/ui/ElementRail/useInsertMenuRailItems.d.ts +2 -1
  34. package/dist/types-ts4.5/ui/templateOptions.d.ts +1 -1
  35. package/dist/types-ts4.5/ui/transformOptions.d.ts +2 -2
  36. package/package.json +10 -7
  37. package/dist/cjs/ui/ToolbarInsertBlock/messages.js +0 -12
  38. package/dist/es2019/ui/ToolbarInsertBlock/messages.js +0 -1
  39. package/dist/esm/ui/ToolbarInsertBlock/messages.js +0 -1
  40. package/dist/types/ui/ToolbarInsertBlock/messages.d.ts +0 -1
  41. package/dist/types-ts4.5/ui/ToolbarInsertBlock/messages.d.ts +0 -1
  42. /package/dist/cjs/{assets → ui/assets}/action-list.js +0 -0
  43. /package/dist/cjs/{assets → ui/assets}/approvals-tracker.js +0 -0
  44. /package/dist/cjs/{assets → ui/assets}/decision-matrix.js +0 -0
  45. /package/dist/cjs/{assets → ui/assets}/discussion-notes.js +0 -0
  46. /package/dist/cjs/{assets → ui/assets}/expand.js +0 -0
  47. /package/dist/cjs/{assets → ui/assets}/instructions-outline.js +0 -0
  48. /package/dist/cjs/{assets → ui/assets}/switch.js +0 -0
  49. /package/dist/cjs/{assets → ui/assets}/use-icon-themed.js +0 -0
  50. /package/dist/es2019/{assets → ui/assets}/action-list.js +0 -0
  51. /package/dist/es2019/{assets → ui/assets}/approvals-tracker.js +0 -0
  52. /package/dist/es2019/{assets → ui/assets}/decision-matrix.js +0 -0
  53. /package/dist/es2019/{assets → ui/assets}/discussion-notes.js +0 -0
  54. /package/dist/es2019/{assets → ui/assets}/expand.js +0 -0
  55. /package/dist/es2019/{assets → ui/assets}/instructions-outline.js +0 -0
  56. /package/dist/es2019/{assets → ui/assets}/switch.js +0 -0
  57. /package/dist/es2019/{assets → ui/assets}/use-icon-themed.js +0 -0
  58. /package/dist/esm/{assets → ui/assets}/action-list.js +0 -0
  59. /package/dist/esm/{assets → ui/assets}/approvals-tracker.js +0 -0
  60. /package/dist/esm/{assets → ui/assets}/decision-matrix.js +0 -0
  61. /package/dist/esm/{assets → ui/assets}/discussion-notes.js +0 -0
  62. /package/dist/esm/{assets → ui/assets}/expand.js +0 -0
  63. /package/dist/esm/{assets → ui/assets}/instructions-outline.js +0 -0
  64. /package/dist/esm/{assets → ui/assets}/switch.js +0 -0
  65. /package/dist/esm/{assets → ui/assets}/use-icon-themed.js +0 -0
  66. /package/dist/types/{assets → ui/assets}/action-list.d.ts +0 -0
  67. /package/dist/types/{assets → ui/assets}/approvals-tracker.d.ts +0 -0
  68. /package/dist/types/{assets → ui/assets}/decision-matrix.d.ts +0 -0
  69. /package/dist/types/{assets → ui/assets}/discussion-notes.d.ts +0 -0
  70. /package/dist/types/{assets → ui/assets}/expand.d.ts +0 -0
  71. /package/dist/types/{assets → ui/assets}/instructions-outline.d.ts +0 -0
  72. /package/dist/types/{assets → ui/assets}/switch.d.ts +0 -0
  73. /package/dist/types/{assets → ui/assets}/use-icon-themed.d.ts +0 -0
  74. /package/dist/types-ts4.5/{assets → ui/assets}/action-list.d.ts +0 -0
  75. /package/dist/types-ts4.5/{assets → ui/assets}/approvals-tracker.d.ts +0 -0
  76. /package/dist/types-ts4.5/{assets → ui/assets}/decision-matrix.d.ts +0 -0
  77. /package/dist/types-ts4.5/{assets → ui/assets}/discussion-notes.d.ts +0 -0
  78. /package/dist/types-ts4.5/{assets → ui/assets}/expand.d.ts +0 -0
  79. /package/dist/types-ts4.5/{assets → ui/assets}/instructions-outline.d.ts +0 -0
  80. /package/dist/types-ts4.5/{assets → ui/assets}/switch.d.ts +0 -0
  81. /package/dist/types-ts4.5/{assets → ui/assets}/use-icon-themed.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/editor-plugin-insert-block
2
2
 
3
+ ## 2.4.26
4
+
5
+ ### Patch Changes
6
+
7
+ - [#181001](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/181001)
8
+ [`fc8a0ad4362f4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fc8a0ad4362f4) -
9
+ NO-ISSUE: refactor insert block plugin to meet folder standards
10
+
11
+ ## 2.4.25
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 2.4.24
4
18
 
5
19
  ### Patch Changes
@@ -19,9 +19,9 @@ var _utils = require("@atlaskit/editor-common/utils");
19
19
  var _consts = require("@atlaskit/editor-plugin-block-type/consts");
20
20
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
21
21
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
22
- var _switch = _interopRequireDefault(require("./assets/switch"));
23
22
  var _elementBrowser2 = require("./pm-plugins/elementBrowser");
24
23
  var _toggleInsertBlock = require("./pm-plugins/toggleInsertBlock");
24
+ var _switch = _interopRequireDefault(require("./ui/assets/switch"));
25
25
  var _ElementRail = require("./ui/ElementRail");
26
26
  var _templateOptions = require("./ui/templateOptions");
27
27
  var _ToolbarInsertBlock = _interopRequireDefault(require("./ui/ToolbarInsertBlock"));
@@ -69,6 +69,7 @@ var toolbarSizeToButtons = exports.toolbarSizeToButtons = function toolbarSizeTo
69
69
  }
70
70
  }
71
71
  };
72
+
72
73
  /**
73
74
  * Wrapper over insertBlockTypeWithAnalytics to autobind toolbar input method
74
75
  * @param name Block name
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -14,7 +14,6 @@ var _keymaps = require("@atlaskit/editor-common/keymaps");
14
14
  var _messages = require("@atlaskit/editor-common/messages");
15
15
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
16
  var _item = require("./item");
17
- var _messages2 = require("./messages");
18
17
  var _shallowEquals = require("./shallow-equals");
19
18
  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; }
20
19
  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; }
@@ -69,67 +68,67 @@ var createInsertBlockItems = function createInsertBlockItems(config) {
69
68
  var isOffline = isEditorOffline === true;
70
69
  if (actionSupported) {
71
70
  items.push((0, _item.action)({
72
- content: formatMessage(_messages2.messages.action),
73
- tooltipDescription: formatMessage(_messages2.messages.actionDescription),
71
+ content: formatMessage(_messages.toolbarInsertBlockMessages.action),
72
+ tooltipDescription: formatMessage(_messages.toolbarInsertBlockMessages.actionDescription),
74
73
  disabled: false
75
74
  }));
76
75
  }
77
76
  if (linkSupported) {
78
77
  items.push((0, _item.link)({
79
- content: formatMessage(_messages2.messages.link),
80
- tooltipDescription: formatMessage(_messages2.messages.linkDescription),
78
+ content: formatMessage(_messages.toolbarInsertBlockMessages.link),
79
+ tooltipDescription: formatMessage(_messages.toolbarInsertBlockMessages.linkDescription),
81
80
  disabled: !!linkDisabled,
82
81
  'aria-haspopup': 'dialog'
83
82
  }));
84
83
  }
85
84
  if (mediaSupported && mediaUploadsEnabled) {
86
85
  items.push((0, _item.media)({
87
- content: formatMessage(_messages2.messages.addMediaFiles),
88
- tooltipDescription: formatMessage(_messages2.messages.mediaFilesDescription),
86
+ content: formatMessage(_messages.toolbarInsertBlockMessages.addMediaFiles),
87
+ tooltipDescription: formatMessage(_messages.toolbarInsertBlockMessages.mediaFilesDescription),
89
88
  disabled: isOffline
90
89
  }));
91
90
  }
92
91
  if (imageUploadSupported) {
93
92
  items.push((0, _item.imageUpload)({
94
- content: formatMessage(_messages2.messages.image),
93
+ content: formatMessage(_messages.toolbarInsertBlockMessages.image),
95
94
  disabled: !imageUploadEnabled || isOffline
96
95
  }));
97
96
  }
98
97
  if (mentionsSupported) {
99
98
  items.push((0, _item.mention)({
100
- content: formatMessage(_messages2.messages.mention),
101
- tooltipDescription: formatMessage(_messages2.messages.mentionDescription),
99
+ content: formatMessage(_messages.toolbarInsertBlockMessages.mention),
100
+ tooltipDescription: formatMessage(_messages.toolbarInsertBlockMessages.mentionDescription),
102
101
  disabled: !isTypeAheadAllowed || !!mentionsDisabled || isOffline,
103
102
  'aria-haspopup': 'listbox'
104
103
  }));
105
104
  }
106
105
  if (emojiProvider) {
107
106
  items.push((0, _item.emoji)({
108
- content: formatMessage(_messages2.messages.emoji),
109
- tooltipDescription: formatMessage(_messages2.messages.emojiDescription),
107
+ content: formatMessage(_messages.toolbarInsertBlockMessages.emoji),
108
+ tooltipDescription: formatMessage(_messages.toolbarInsertBlockMessages.emojiDescription),
110
109
  disabled: emojiDisabled || !isTypeAheadAllowed || isOffline,
111
110
  'aria-haspopup': 'dialog'
112
111
  }));
113
112
  }
114
113
  if (tableSupported) {
115
114
  items.push((0, _item.table)({
116
- content: formatMessage(_messages2.messages.table),
117
- tooltipDescription: formatMessage(_messages2.messages.tableDescription),
115
+ content: formatMessage(_messages.toolbarInsertBlockMessages.table),
116
+ tooltipDescription: formatMessage(_messages.toolbarInsertBlockMessages.tableDescription),
118
117
  disabled: false
119
118
  }));
120
119
  }
121
120
  if (tableSupported && tableSelectorSupported) {
122
121
  items.push((0, _item.tableSelector)({
123
- content: formatMessage(_messages2.messages.tableSelector),
124
- tooltipDescription: formatMessage(_messages2.messages.tableSelectorDescription),
122
+ content: formatMessage(_messages.toolbarInsertBlockMessages.tableSelector),
123
+ tooltipDescription: formatMessage(_messages.toolbarInsertBlockMessages.tableSelectorDescription),
125
124
  disabled: false
126
125
  }));
127
126
  }
128
127
  if (layoutSectionEnabled) {
129
- var labelColumns = formatMessage(_messages2.messages.columns);
128
+ var labelColumns = formatMessage(_messages.toolbarInsertBlockMessages.columns);
130
129
  items.push((0, _item.layout)({
131
130
  content: labelColumns,
132
- tooltipDescription: formatMessage(_messages2.messages.columnsDescription),
131
+ tooltipDescription: formatMessage(_messages.toolbarInsertBlockMessages.columnsDescription),
133
132
  disabled: false
134
133
  }));
135
134
  }
@@ -168,44 +167,44 @@ var createInsertBlockItems = function createInsertBlockItems(config) {
168
167
  }
169
168
  if (decisionSupported) {
170
169
  items.push((0, _item.decision)({
171
- content: formatMessage(_messages2.messages.decision),
172
- tooltipDescription: formatMessage(_messages2.messages.decisionDescription),
170
+ content: formatMessage(_messages.toolbarInsertBlockMessages.decision),
171
+ tooltipDescription: formatMessage(_messages.toolbarInsertBlockMessages.decisionDescription),
173
172
  disabled: false
174
173
  }));
175
174
  }
176
175
  if (horizontalRuleEnabled && schema.nodes.rule) {
177
176
  items.push((0, _item.horizontalrule)({
178
- content: formatMessage(_messages2.messages.horizontalRule),
179
- tooltipDescription: formatMessage(_messages2.messages.horizontalRuleDescription),
177
+ content: formatMessage(_messages.toolbarInsertBlockMessages.horizontalRule),
178
+ tooltipDescription: formatMessage(_messages.toolbarInsertBlockMessages.horizontalRuleDescription),
180
179
  disabled: false
181
180
  }));
182
181
  }
183
182
  if (expandEnabled && schema.nodes.expand) {
184
183
  items.push((0, _item.expand)({
185
- content: formatMessage(_messages2.messages.expand),
186
- tooltipDescription: formatMessage(_messages2.messages.expandDescription),
184
+ content: formatMessage(_messages.toolbarInsertBlockMessages.expand),
185
+ tooltipDescription: formatMessage(_messages.toolbarInsertBlockMessages.expandDescription),
187
186
  disabled: false
188
187
  }));
189
188
  }
190
189
  if (dateEnabled) {
191
- var labelDate = formatMessage(_messages2.messages.date);
190
+ var labelDate = formatMessage(_messages.toolbarInsertBlockMessages.date);
192
191
  items.push((0, _item.date)({
193
192
  content: labelDate,
194
- tooltipDescription: formatMessage(_messages2.messages.dateDescription),
193
+ tooltipDescription: formatMessage(_messages.toolbarInsertBlockMessages.dateDescription),
195
194
  disabled: false
196
195
  }));
197
196
  }
198
197
  if (placeholderTextEnabled) {
199
198
  items.push((0, _item.placeholder)({
200
- content: formatMessage(_messages2.messages.placeholderText),
199
+ content: formatMessage(_messages.toolbarInsertBlockMessages.placeholderText),
201
200
  disabled: false
202
201
  }));
203
202
  }
204
203
  if (nativeStatusSupported) {
205
- var labelStatus = formatMessage(_messages2.messages.status);
204
+ var labelStatus = formatMessage(_messages.toolbarInsertBlockMessages.status);
206
205
  items.push((0, _item.status)({
207
206
  content: labelStatus,
208
- tooltipDescription: formatMessage(_messages2.messages.statusDescription),
207
+ tooltipDescription: formatMessage(_messages.toolbarInsertBlockMessages.statusDescription),
209
208
  disabled: false
210
209
  }));
211
210
  }
@@ -214,7 +213,7 @@ var createInsertBlockItems = function createInsertBlockItems(config) {
214
213
  }
215
214
  if (showElementBrowserLink) {
216
215
  items.push((0, _item.more)({
217
- content: formatMessage(_messages2.messages.viewMore),
216
+ content: formatMessage(_messages.toolbarInsertBlockMessages.viewMore),
218
217
  disabled: false
219
218
  }));
220
219
  }
@@ -233,7 +232,7 @@ var createInsertBlockItems = function createInsertBlockItems(config) {
233
232
  var name = _ref.value.name;
234
233
  return name !== 'table selector';
235
234
  });
236
- var dropdownItems = remainingItems.map(buttonToDropdownItem(formatMessage(_messages2.messages.insertMenu)));
235
+ var dropdownItems = remainingItems.map(buttonToDropdownItem(formatMessage(_messages.toolbarInsertBlockMessages.insertMenu)));
237
236
  return [buttonItems, dropdownItems];
238
237
  };
239
238
  var createItems = exports.createItems = (0, _memoizeOne.default)(createInsertBlockItems, _shallowEquals.shallowEquals);
@@ -19,6 +19,7 @@ var _react = _interopRequireDefault(require("react"));
19
19
  var _react2 = require("@emotion/react");
20
20
  var _reactIntlNext = require("react-intl-next");
21
21
  var _analytics = require("@atlaskit/editor-common/analytics");
22
+ var _messages = require("@atlaskit/editor-common/messages");
22
23
  var _styles = require("@atlaskit/editor-common/styles");
23
24
  var _ui = require("@atlaskit/editor-common/ui");
24
25
  var _uiMenu = require("@atlaskit/editor-common/ui-menu");
@@ -30,7 +31,6 @@ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
30
31
  var _commands = require("../../pm-plugins/commands");
31
32
  var _blockInsertMenu = require("./block-insert-menu");
32
33
  var _createItems3 = require("./create-items");
33
- var _messages = require("./messages");
34
34
  var _tableSelectorPopupWithListeners = _interopRequireDefault(require("./table-selector-popup-with-listeners"));
35
35
  var _templateObject;
36
36
  /**
@@ -792,7 +792,7 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
792
792
  disabled: (_this$props$isDisable = this.props.isDisabled) !== null && _this$props$isDisable !== void 0 ? _this$props$isDisable : false,
793
793
  editorView: this.props.editorView,
794
794
  spacing: this.props.isReducedSpacing ? 'none' : 'default',
795
- label: this.props.intl.formatMessage(_messages.messages.insertMenu),
795
+ label: this.props.intl.formatMessage(_messages.toolbarInsertBlockMessages.insertMenu),
796
796
  open: (0, _experiments.editorExperiment)('insert-menu-in-right-rail', true) ? !isFullPageAppearance && this.state.isPlusMenuOpen : this.state.isPlusMenuOpen,
797
797
  plusButtonRef: (_this$plusButtonRef = this.plusButtonRef) === null || _this$plusButtonRef === void 0 ? void 0 : _this$plusButtonRef.deref(),
798
798
  items: this.state.dropdownItems,
@@ -8,11 +8,11 @@ exports.templateOptions = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _analytics = require("@atlaskit/editor-common/analytics");
10
10
  var _model = require("@atlaskit/editor-prosemirror/model");
11
- var _actionList = _interopRequireDefault(require("../assets/action-list"));
12
- var _approvalsTracker = _interopRequireDefault(require("../assets/approvals-tracker"));
13
- var _decisionMatrix = _interopRequireDefault(require("../assets/decision-matrix"));
14
- var _discussionNotes = _interopRequireDefault(require("../assets/discussion-notes"));
15
- var _instructionsOutline = _interopRequireDefault(require("../assets/instructions-outline"));
11
+ var _actionList = _interopRequireDefault(require("./assets/action-list"));
12
+ var _approvalsTracker = _interopRequireDefault(require("./assets/approvals-tracker"));
13
+ var _decisionMatrix = _interopRequireDefault(require("./assets/decision-matrix"));
14
+ var _discussionNotes = _interopRequireDefault(require("./assets/discussion-notes"));
15
+ var _instructionsOutline = _interopRequireDefault(require("./assets/instructions-outline"));
16
16
  var _templates = require("./templates");
17
17
  var getTemplateInsertionPayload = function getTemplateInsertionPayload(templateType, source) {
18
18
  return {
@@ -9,7 +9,7 @@ var _messages = require("@atlaskit/editor-common/messages");
9
9
  var _code = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/code"));
10
10
  var _info = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/info"));
11
11
  var _quote = _interopRequireDefault(require("@atlaskit/icon/glyph/quote"));
12
- var _expand = _interopRequireDefault(require("../assets/expand"));
12
+ var _expand = _interopRequireDefault(require("./assets/expand"));
13
13
  var transformationOptions = exports.transformationOptions = function transformationOptions(api, schema) {
14
14
  var _api$panel, _api$expand, _api$codeBlock, _api$blockType;
15
15
  return [{
@@ -11,9 +11,9 @@ import { getWrappingOptions } from '@atlaskit/editor-common/utils';
11
11
  import { BLOCK_QUOTE, CODE_BLOCK, PANEL } from '@atlaskit/editor-plugin-block-type/consts';
12
12
  import { fg } from '@atlaskit/platform-feature-flags';
13
13
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
14
- import SwitchIcon from './assets/switch';
15
14
  import { elementBrowserPmKey, elementBrowserPmPlugin } from './pm-plugins/elementBrowser';
16
15
  import { toggleInsertBlockPmKey, toggleInsertBlockPmPlugin } from './pm-plugins/toggleInsertBlock';
16
+ import SwitchIcon from './ui/assets/switch';
17
17
  import { InsertMenuRail } from './ui/ElementRail';
18
18
  import { templateOptions } from './ui/templateOptions';
19
19
  import ToolbarInsertBlock from './ui/ToolbarInsertBlock';
@@ -59,6 +59,7 @@ export const toolbarSizeToButtons = (toolbarSize, appearance) => {
59
59
  }
60
60
  }
61
61
  };
62
+
62
63
  /**
63
64
  * Wrapper over insertBlockTypeWithAnalytics to autobind toolbar input method
64
65
  * @param name Block name
@@ -0,0 +1 @@
1
+ export {};
@@ -2,10 +2,9 @@ import React from 'react';
2
2
  import memoize from 'lodash/memoize';
3
3
  import memoizeOne from 'memoize-one';
4
4
  import { ToolTipContent } from '@atlaskit/editor-common/keymaps';
5
- import { blockTypeMessages } from '@atlaskit/editor-common/messages';
5
+ import { blockTypeMessages, toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
6
6
  import { fg } from '@atlaskit/platform-feature-flags';
7
7
  import { action, blockquote, codeblock, date, decision, emoji, expand, horizontalrule, imageUpload, layout, link, media, mention, more, panel, placeholder, status, table, tableSelector } from './item';
8
- import { messages } from './messages';
9
8
  import { shallowEquals } from './shallow-equals';
10
9
  const buttonToItem = memoize(button => ({
11
10
  ...button,
@@ -10,6 +10,7 @@ import React from 'react';
10
10
  import { css, jsx } from '@emotion/react';
11
11
  import { injectIntl } from 'react-intl-next';
12
12
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
13
+ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
13
14
  import { buttonGroupStyle, separatorStyles, wrapperStyle } from '@atlaskit/editor-common/styles';
14
15
  import { Popup } from '@atlaskit/editor-common/ui';
15
16
  import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
@@ -21,7 +22,6 @@ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
21
22
  import { toggleInsertMenuRightRail } from '../../pm-plugins/commands';
22
23
  import { BlockInsertMenu } from './block-insert-menu';
23
24
  import { createItems } from './create-items';
24
- import { messages } from './messages';
25
25
  import TableSelectorPopup from './table-selector-popup-with-listeners';
26
26
  /**
27
27
  * Checks if an element is detached (i.e. not in the current document)
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
4
- import ActionListIcon from '../assets/action-list';
5
- import ApprovalsTrackerIcon from '../assets/approvals-tracker';
6
- import DecisionMatrixIcon from '../assets/decision-matrix';
7
- import DiscussionNotesIcon from '../assets/discussion-notes';
8
- import InstructionsOutlineIcon from '../assets/instructions-outline';
4
+ import ActionListIcon from './assets/action-list';
5
+ import ApprovalsTrackerIcon from './assets/approvals-tracker';
6
+ import DecisionMatrixIcon from './assets/decision-matrix';
7
+ import DiscussionNotesIcon from './assets/discussion-notes';
8
+ import InstructionsOutlineIcon from './assets/instructions-outline';
9
9
  import { actionList, approvalsTracker, decisionMatrix, discussionNotes, instructionsOutline } from './templates';
10
10
  const getTemplateInsertionPayload = (templateType, source) => ({
11
11
  action: ACTION.INSERTED,
@@ -2,7 +2,7 @@ import { blockTypeMessages as messages, toolbarInsertBlockMessages as toolbarMes
2
2
  import EditorCodeIcon from '@atlaskit/icon/glyph/editor/code';
3
3
  import EditorInfoIcon from '@atlaskit/icon/glyph/editor/info';
4
4
  import QuoteIcon from '@atlaskit/icon/glyph/quote';
5
- import ExpandIcon from '../assets/expand';
5
+ import ExpandIcon from './assets/expand';
6
6
  export const transformationOptions = (api, schema) => {
7
7
  var _api$panel, _api$expand, _api$codeBlock, _api$blockType;
8
8
  return [{
@@ -11,9 +11,9 @@ import { getWrappingOptions } from '@atlaskit/editor-common/utils';
11
11
  import { BLOCK_QUOTE, CODE_BLOCK, PANEL } from '@atlaskit/editor-plugin-block-type/consts';
12
12
  import { fg } from '@atlaskit/platform-feature-flags';
13
13
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
14
- import SwitchIcon from './assets/switch';
15
14
  import { elementBrowserPmKey, elementBrowserPmPlugin } from './pm-plugins/elementBrowser';
16
15
  import { toggleInsertBlockPmKey, toggleInsertBlockPmPlugin } from './pm-plugins/toggleInsertBlock';
16
+ import SwitchIcon from './ui/assets/switch';
17
17
  import { InsertMenuRail } from './ui/ElementRail';
18
18
  import { templateOptions } from './ui/templateOptions';
19
19
  import ToolbarInsertBlock from './ui/ToolbarInsertBlock';
@@ -59,6 +59,7 @@ export var toolbarSizeToButtons = function toolbarSizeToButtons(toolbarSize, app
59
59
  }
60
60
  }
61
61
  };
62
+
62
63
  /**
63
64
  * Wrapper over insertBlockTypeWithAnalytics to autobind toolbar input method
64
65
  * @param name Block name
@@ -0,0 +1 @@
1
+ export {};
@@ -6,10 +6,9 @@ import React from 'react';
6
6
  import memoize from 'lodash/memoize';
7
7
  import memoizeOne from 'memoize-one';
8
8
  import { ToolTipContent } from '@atlaskit/editor-common/keymaps';
9
- import { blockTypeMessages } from '@atlaskit/editor-common/messages';
9
+ import { blockTypeMessages, toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
10
10
  import { fg } from '@atlaskit/platform-feature-flags';
11
11
  import { action, blockquote, codeblock, date, decision, emoji, expand, horizontalrule, imageUpload, layout, link, media, mention, more, panel, placeholder, status, table, tableSelector } from './item';
12
- import { messages } from './messages';
13
12
  import { shallowEquals } from './shallow-equals';
14
13
  var buttonToItem = memoize(function (button) {
15
14
  return _objectSpread(_objectSpread({}, button), {}, {
@@ -25,6 +25,7 @@ import React from 'react';
25
25
  import { css, jsx } from '@emotion/react';
26
26
  import { injectIntl } from 'react-intl-next';
27
27
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
28
+ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
28
29
  import { buttonGroupStyle, separatorStyles, wrapperStyle } from '@atlaskit/editor-common/styles';
29
30
  import { Popup } from '@atlaskit/editor-common/ui';
30
31
  import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
@@ -36,7 +37,6 @@ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
36
37
  import { toggleInsertMenuRightRail } from '../../pm-plugins/commands';
37
38
  import { BlockInsertMenu } from './block-insert-menu';
38
39
  import { createItems } from './create-items';
39
- import { messages } from './messages';
40
40
  import TableSelectorPopup from './table-selector-popup-with-listeners';
41
41
  /**
42
42
  * Checks if an element is detached (i.e. not in the current document)
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
4
- import ActionListIcon from '../assets/action-list';
5
- import ApprovalsTrackerIcon from '../assets/approvals-tracker';
6
- import DecisionMatrixIcon from '../assets/decision-matrix';
7
- import DiscussionNotesIcon from '../assets/discussion-notes';
8
- import InstructionsOutlineIcon from '../assets/instructions-outline';
4
+ import ActionListIcon from './assets/action-list';
5
+ import ApprovalsTrackerIcon from './assets/approvals-tracker';
6
+ import DecisionMatrixIcon from './assets/decision-matrix';
7
+ import DiscussionNotesIcon from './assets/discussion-notes';
8
+ import InstructionsOutlineIcon from './assets/instructions-outline';
9
9
  import { actionList, approvalsTracker, decisionMatrix, discussionNotes, instructionsOutline } from './templates';
10
10
  var getTemplateInsertionPayload = function getTemplateInsertionPayload(templateType, source) {
11
11
  return {
@@ -2,7 +2,7 @@ import { blockTypeMessages as messages, toolbarInsertBlockMessages as toolbarMes
2
2
  import EditorCodeIcon from '@atlaskit/icon/glyph/editor/code';
3
3
  import EditorInfoIcon from '@atlaskit/icon/glyph/editor/info';
4
4
  import QuoteIcon from '@atlaskit/icon/glyph/quote';
5
- import ExpandIcon from '../assets/expand';
5
+ import ExpandIcon from './assets/expand';
6
6
  export var transformationOptions = function transformationOptions(api, schema) {
7
7
  var _api$panel, _api$expand, _api$codeBlock, _api$blockType;
8
8
  return [{
@@ -1,3 +1,3 @@
1
1
  export { insertBlockPlugin } from './insertBlockPlugin';
2
- export type { InsertBlockPlugin, InsertBlockOptions, InsertBlockPluginState, } from './insertBlockPlugin';
3
- export type { InsertBlockPluginDependencies } from './insertBlockPluginType';
2
+ export type { InsertBlockPlugin } from './insertBlockPluginType';
3
+ export type { InsertBlockOptions, InsertBlockPluginDependencies, InsertBlockPluginState, } from './types';
@@ -1,27 +1,5 @@
1
1
  import { ToolbarSize } from '@atlaskit/editor-common/types';
2
- import type { EditorAppearance, NextEditorPlugin } from '@atlaskit/editor-common/types';
3
- import type { InsertBlockPluginDependencies } from './insertBlockPluginType';
2
+ import type { EditorAppearance } from '@atlaskit/editor-common/types';
3
+ import type { InsertBlockPlugin } from './insertBlockPluginType';
4
4
  export declare const toolbarSizeToButtons: (toolbarSize: ToolbarSize, appearance?: EditorAppearance) => 0 | 2 | 3 | 5 | 7;
5
- export interface InsertBlockOptions {
6
- allowTables?: boolean;
7
- allowExpand?: boolean;
8
- insertMenuItems?: any;
9
- horizontalRuleEnabled?: boolean;
10
- nativeStatusSupported?: boolean;
11
- showElementBrowserLink?: boolean;
12
- tableSelectorSupported?: boolean;
13
- appearance?: EditorAppearance;
14
- }
15
- export interface InsertBlockPluginState {
16
- showElementBrowser: boolean;
17
- menuBrowserOpen?: boolean;
18
- }
19
- export type InsertBlockPlugin = NextEditorPlugin<'insertBlock', {
20
- pluginConfiguration: InsertBlockOptions | undefined;
21
- dependencies: InsertBlockPluginDependencies;
22
- actions: {
23
- toggleAdditionalMenu: () => void;
24
- };
25
- sharedState: InsertBlockPluginState | undefined;
26
- }>;
27
5
  export declare const insertBlockPlugin: InsertBlockPlugin;
@@ -1,53 +1,10 @@
1
- import type { OptionalPlugin } from '@atlaskit/editor-common/types';
2
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
- import type { BlockTypePlugin } from '@atlaskit/editor-plugin-block-type';
4
- import type { CodeBlockPlugin } from '@atlaskit/editor-plugin-code-block';
5
- import type { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
6
- import type { ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
7
- import type { DatePlugin } from '@atlaskit/editor-plugin-date';
8
- import type { EmojiPlugin } from '@atlaskit/editor-plugin-emoji';
9
- import type { ExpandPlugin } from '@atlaskit/editor-plugin-expand';
10
- import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
11
- import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
12
- import type { HyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
13
- import type { ImageUploadPlugin } from '@atlaskit/editor-plugin-image-upload';
14
- import type { LayoutPlugin } from '@atlaskit/editor-plugin-layout';
15
- import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
16
- import type { MediaInsertPlugin } from '@atlaskit/editor-plugin-media-insert';
17
- import type { MentionsPlugin } from '@atlaskit/editor-plugin-mentions';
18
- import type { PanelPlugin } from '@atlaskit/editor-plugin-panel';
19
- import type { PlaceholderTextPlugin } from '@atlaskit/editor-plugin-placeholder-text';
20
- import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
21
- import type { QuickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
22
- import type { RulePlugin } from '@atlaskit/editor-plugin-rule';
23
- import type { StatusPlugin } from '@atlaskit/editor-plugin-status';
24
- import type { TablePlugin } from '@atlaskit/editor-plugin-table';
25
- import type { TasksAndDecisionsPlugin } from '@atlaskit/editor-plugin-tasks-and-decisions';
26
- import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
27
- export type InsertBlockPluginDependencies = [
28
- TypeAheadPlugin,
29
- OptionalPlugin<TablePlugin>,
30
- OptionalPlugin<HyperlinkPlugin>,
31
- OptionalPlugin<DatePlugin>,
32
- OptionalPlugin<BlockTypePlugin>,
33
- OptionalPlugin<AnalyticsPlugin>,
34
- OptionalPlugin<ImageUploadPlugin>,
35
- OptionalPlugin<EmojiPlugin>,
36
- OptionalPlugin<QuickInsertPlugin>,
37
- OptionalPlugin<RulePlugin>,
38
- OptionalPlugin<CodeBlockPlugin>,
39
- OptionalPlugin<PanelPlugin>,
40
- OptionalPlugin<MediaPlugin>,
41
- OptionalPlugin<MediaInsertPlugin>,
42
- OptionalPlugin<MentionsPlugin>,
43
- OptionalPlugin<StatusPlugin>,
44
- OptionalPlugin<LayoutPlugin>,
45
- OptionalPlugin<ExpandPlugin>,
46
- OptionalPlugin<PlaceholderTextPlugin>,
47
- OptionalPlugin<ExtensionPlugin>,
48
- OptionalPlugin<TasksAndDecisionsPlugin>,
49
- OptionalPlugin<PrimaryToolbarPlugin>,
50
- OptionalPlugin<FeatureFlagsPlugin>,
51
- OptionalPlugin<ContextPanelPlugin>,
52
- OptionalPlugin<ConnectivityPlugin>
53
- ];
1
+ import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
+ import type { InsertBlockOptions, InsertBlockPluginDependencies, InsertBlockPluginState } from './types';
3
+ export type InsertBlockPlugin = NextEditorPlugin<'insertBlock', {
4
+ pluginConfiguration: InsertBlockOptions | undefined;
5
+ dependencies: InsertBlockPluginDependencies;
6
+ actions: {
7
+ toggleAdditionalMenu: () => void;
8
+ };
9
+ sharedState: InsertBlockPluginState | undefined;
10
+ }>;
@@ -0,0 +1,67 @@
1
+ import type { EditorAppearance, OptionalPlugin } from '@atlaskit/editor-common/types';
2
+ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
+ import type { BlockTypePlugin } from '@atlaskit/editor-plugin-block-type';
4
+ import type { CodeBlockPlugin } from '@atlaskit/editor-plugin-code-block';
5
+ import type { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
6
+ import type { ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
7
+ import type { DatePlugin } from '@atlaskit/editor-plugin-date';
8
+ import type { EmojiPlugin } from '@atlaskit/editor-plugin-emoji';
9
+ import type { ExpandPlugin } from '@atlaskit/editor-plugin-expand';
10
+ import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
11
+ import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
12
+ import type { HyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
13
+ import type { ImageUploadPlugin } from '@atlaskit/editor-plugin-image-upload';
14
+ import type { LayoutPlugin } from '@atlaskit/editor-plugin-layout';
15
+ import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
16
+ import type { MediaInsertPlugin } from '@atlaskit/editor-plugin-media-insert';
17
+ import type { MentionsPlugin } from '@atlaskit/editor-plugin-mentions';
18
+ import type { PanelPlugin } from '@atlaskit/editor-plugin-panel';
19
+ import type { PlaceholderTextPlugin } from '@atlaskit/editor-plugin-placeholder-text';
20
+ import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
21
+ import type { QuickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
22
+ import type { RulePlugin } from '@atlaskit/editor-plugin-rule';
23
+ import type { StatusPlugin } from '@atlaskit/editor-plugin-status';
24
+ import type { TablePlugin } from '@atlaskit/editor-plugin-table';
25
+ import type { TasksAndDecisionsPlugin } from '@atlaskit/editor-plugin-tasks-and-decisions';
26
+ import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
27
+ export type InsertBlockPluginDependencies = [
28
+ TypeAheadPlugin,
29
+ OptionalPlugin<TablePlugin>,
30
+ OptionalPlugin<HyperlinkPlugin>,
31
+ OptionalPlugin<DatePlugin>,
32
+ OptionalPlugin<BlockTypePlugin>,
33
+ OptionalPlugin<AnalyticsPlugin>,
34
+ OptionalPlugin<ImageUploadPlugin>,
35
+ OptionalPlugin<EmojiPlugin>,
36
+ OptionalPlugin<QuickInsertPlugin>,
37
+ OptionalPlugin<RulePlugin>,
38
+ OptionalPlugin<CodeBlockPlugin>,
39
+ OptionalPlugin<PanelPlugin>,
40
+ OptionalPlugin<MediaPlugin>,
41
+ OptionalPlugin<MediaInsertPlugin>,
42
+ OptionalPlugin<MentionsPlugin>,
43
+ OptionalPlugin<StatusPlugin>,
44
+ OptionalPlugin<LayoutPlugin>,
45
+ OptionalPlugin<ExpandPlugin>,
46
+ OptionalPlugin<PlaceholderTextPlugin>,
47
+ OptionalPlugin<ExtensionPlugin>,
48
+ OptionalPlugin<TasksAndDecisionsPlugin>,
49
+ OptionalPlugin<PrimaryToolbarPlugin>,
50
+ OptionalPlugin<FeatureFlagsPlugin>,
51
+ OptionalPlugin<ContextPanelPlugin>,
52
+ OptionalPlugin<ConnectivityPlugin>
53
+ ];
54
+ export interface InsertBlockOptions {
55
+ allowTables?: boolean;
56
+ allowExpand?: boolean;
57
+ insertMenuItems?: any;
58
+ horizontalRuleEnabled?: boolean;
59
+ nativeStatusSupported?: boolean;
60
+ showElementBrowserLink?: boolean;
61
+ tableSelectorSupported?: boolean;
62
+ appearance?: EditorAppearance;
63
+ }
64
+ export interface InsertBlockPluginState {
65
+ showElementBrowser: boolean;
66
+ menuBrowserOpen?: boolean;
67
+ }
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- import { type InsertBlockOptions, type InsertBlockPlugin } from '../../insertBlockPlugin';
4
+ import { type InsertBlockPlugin } from '../../insertBlockPluginType';
5
+ import { type InsertBlockOptions } from '../../types';
5
6
  /**
6
7
  * For insert menu in right rail experiment
7
8
  * - Clean up ticket ED-24801
@@ -11,10 +12,10 @@ export declare const InsertMenuRail: ({ editorView, options, api, }: {
11
12
  options: InsertBlockOptions;
12
13
  api?: import("@atlaskit/editor-common/types").EditorInjectionAPI<"insertBlock", {
13
14
  pluginConfiguration: InsertBlockOptions | undefined;
14
- dependencies: import("../..").InsertBlockPluginDependencies;
15
+ dependencies: import("../../types").InsertBlockPluginDependencies;
15
16
  actions: {
16
17
  toggleAdditionalMenu: () => void;
17
18
  };
18
- sharedState: import("../../insertBlockPlugin").InsertBlockPluginState | undefined;
19
+ sharedState: import("../../types").InsertBlockPluginState | undefined;
19
20
  }> | undefined;
20
21
  }) => JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- import type { InsertBlockOptions, insertBlockPlugin } from '../../insertBlockPlugin';
3
+ import type { insertBlockPlugin } from '../../insertBlockPlugin';
4
+ import type { InsertBlockOptions } from '../../types';
4
5
  export declare const useInsertMenuRailItems: (editorView: EditorView, options: InsertBlockOptions, api?: ExtractInjectionAPI<typeof insertBlockPlugin>) => import("../ToolbarInsertBlock/create-items").BlockMenuItem[];
@@ -1,4 +1,4 @@
1
1
  import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
2
2
  import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import { type InsertBlockPlugin } from '../insertBlockPlugin';
3
+ import { type InsertBlockPlugin } from '../insertBlockPluginType';
4
4
  export declare const templateOptions: (api: ExtractInjectionAPI<InsertBlockPlugin> | undefined) => QuickInsertItem[];
@@ -1,8 +1,8 @@
1
1
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
2
  import { type Schema } from '@atlaskit/editor-prosemirror/model';
3
3
  import QuoteIcon from '@atlaskit/icon/glyph/quote';
4
- import ExpandIcon from '../assets/expand';
5
- import type { InsertBlockPlugin } from '../insertBlockPlugin';
4
+ import type { InsertBlockPlugin } from '../insertBlockPluginType';
5
+ import ExpandIcon from './assets/expand';
6
6
  export declare const transformationOptions: (api: ExtractInjectionAPI<InsertBlockPlugin> | undefined, schema: Schema) => ({
7
7
  type: import("prosemirror-model").NodeType;
8
8
  title: {
@@ -1,3 +1,3 @@
1
1
  export { insertBlockPlugin } from './insertBlockPlugin';
2
- export type { InsertBlockPlugin, InsertBlockOptions, InsertBlockPluginState, } from './insertBlockPlugin';
3
- export type { InsertBlockPluginDependencies } from './insertBlockPluginType';
2
+ export type { InsertBlockPlugin } from './insertBlockPluginType';
3
+ export type { InsertBlockOptions, InsertBlockPluginDependencies, InsertBlockPluginState, } from './types';
@@ -1,27 +1,5 @@
1
1
  import { ToolbarSize } from '@atlaskit/editor-common/types';
2
- import type { EditorAppearance, NextEditorPlugin } from '@atlaskit/editor-common/types';
3
- import type { InsertBlockPluginDependencies } from './insertBlockPluginType';
2
+ import type { EditorAppearance } from '@atlaskit/editor-common/types';
3
+ import type { InsertBlockPlugin } from './insertBlockPluginType';
4
4
  export declare const toolbarSizeToButtons: (toolbarSize: ToolbarSize, appearance?: EditorAppearance) => 0 | 2 | 3 | 5 | 7;
5
- export interface InsertBlockOptions {
6
- allowTables?: boolean;
7
- allowExpand?: boolean;
8
- insertMenuItems?: any;
9
- horizontalRuleEnabled?: boolean;
10
- nativeStatusSupported?: boolean;
11
- showElementBrowserLink?: boolean;
12
- tableSelectorSupported?: boolean;
13
- appearance?: EditorAppearance;
14
- }
15
- export interface InsertBlockPluginState {
16
- showElementBrowser: boolean;
17
- menuBrowserOpen?: boolean;
18
- }
19
- export type InsertBlockPlugin = NextEditorPlugin<'insertBlock', {
20
- pluginConfiguration: InsertBlockOptions | undefined;
21
- dependencies: InsertBlockPluginDependencies;
22
- actions: {
23
- toggleAdditionalMenu: () => void;
24
- };
25
- sharedState: InsertBlockPluginState | undefined;
26
- }>;
27
5
  export declare const insertBlockPlugin: InsertBlockPlugin;
@@ -1,53 +1,10 @@
1
- import type { OptionalPlugin } from '@atlaskit/editor-common/types';
2
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
- import type { BlockTypePlugin } from '@atlaskit/editor-plugin-block-type';
4
- import type { CodeBlockPlugin } from '@atlaskit/editor-plugin-code-block';
5
- import type { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
6
- import type { ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
7
- import type { DatePlugin } from '@atlaskit/editor-plugin-date';
8
- import type { EmojiPlugin } from '@atlaskit/editor-plugin-emoji';
9
- import type { ExpandPlugin } from '@atlaskit/editor-plugin-expand';
10
- import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
11
- import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
12
- import type { HyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
13
- import type { ImageUploadPlugin } from '@atlaskit/editor-plugin-image-upload';
14
- import type { LayoutPlugin } from '@atlaskit/editor-plugin-layout';
15
- import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
16
- import type { MediaInsertPlugin } from '@atlaskit/editor-plugin-media-insert';
17
- import type { MentionsPlugin } from '@atlaskit/editor-plugin-mentions';
18
- import type { PanelPlugin } from '@atlaskit/editor-plugin-panel';
19
- import type { PlaceholderTextPlugin } from '@atlaskit/editor-plugin-placeholder-text';
20
- import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
21
- import type { QuickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
22
- import type { RulePlugin } from '@atlaskit/editor-plugin-rule';
23
- import type { StatusPlugin } from '@atlaskit/editor-plugin-status';
24
- import type { TablePlugin } from '@atlaskit/editor-plugin-table';
25
- import type { TasksAndDecisionsPlugin } from '@atlaskit/editor-plugin-tasks-and-decisions';
26
- import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
27
- export type InsertBlockPluginDependencies = [
28
- TypeAheadPlugin,
29
- OptionalPlugin<TablePlugin>,
30
- OptionalPlugin<HyperlinkPlugin>,
31
- OptionalPlugin<DatePlugin>,
32
- OptionalPlugin<BlockTypePlugin>,
33
- OptionalPlugin<AnalyticsPlugin>,
34
- OptionalPlugin<ImageUploadPlugin>,
35
- OptionalPlugin<EmojiPlugin>,
36
- OptionalPlugin<QuickInsertPlugin>,
37
- OptionalPlugin<RulePlugin>,
38
- OptionalPlugin<CodeBlockPlugin>,
39
- OptionalPlugin<PanelPlugin>,
40
- OptionalPlugin<MediaPlugin>,
41
- OptionalPlugin<MediaInsertPlugin>,
42
- OptionalPlugin<MentionsPlugin>,
43
- OptionalPlugin<StatusPlugin>,
44
- OptionalPlugin<LayoutPlugin>,
45
- OptionalPlugin<ExpandPlugin>,
46
- OptionalPlugin<PlaceholderTextPlugin>,
47
- OptionalPlugin<ExtensionPlugin>,
48
- OptionalPlugin<TasksAndDecisionsPlugin>,
49
- OptionalPlugin<PrimaryToolbarPlugin>,
50
- OptionalPlugin<FeatureFlagsPlugin>,
51
- OptionalPlugin<ContextPanelPlugin>,
52
- OptionalPlugin<ConnectivityPlugin>
53
- ];
1
+ import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
+ import type { InsertBlockOptions, InsertBlockPluginDependencies, InsertBlockPluginState } from './types';
3
+ export type InsertBlockPlugin = NextEditorPlugin<'insertBlock', {
4
+ pluginConfiguration: InsertBlockOptions | undefined;
5
+ dependencies: InsertBlockPluginDependencies;
6
+ actions: {
7
+ toggleAdditionalMenu: () => void;
8
+ };
9
+ sharedState: InsertBlockPluginState | undefined;
10
+ }>;
@@ -0,0 +1,67 @@
1
+ import type { EditorAppearance, OptionalPlugin } from '@atlaskit/editor-common/types';
2
+ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
+ import type { BlockTypePlugin } from '@atlaskit/editor-plugin-block-type';
4
+ import type { CodeBlockPlugin } from '@atlaskit/editor-plugin-code-block';
5
+ import type { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
6
+ import type { ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
7
+ import type { DatePlugin } from '@atlaskit/editor-plugin-date';
8
+ import type { EmojiPlugin } from '@atlaskit/editor-plugin-emoji';
9
+ import type { ExpandPlugin } from '@atlaskit/editor-plugin-expand';
10
+ import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
11
+ import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
12
+ import type { HyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
13
+ import type { ImageUploadPlugin } from '@atlaskit/editor-plugin-image-upload';
14
+ import type { LayoutPlugin } from '@atlaskit/editor-plugin-layout';
15
+ import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
16
+ import type { MediaInsertPlugin } from '@atlaskit/editor-plugin-media-insert';
17
+ import type { MentionsPlugin } from '@atlaskit/editor-plugin-mentions';
18
+ import type { PanelPlugin } from '@atlaskit/editor-plugin-panel';
19
+ import type { PlaceholderTextPlugin } from '@atlaskit/editor-plugin-placeholder-text';
20
+ import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
21
+ import type { QuickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
22
+ import type { RulePlugin } from '@atlaskit/editor-plugin-rule';
23
+ import type { StatusPlugin } from '@atlaskit/editor-plugin-status';
24
+ import type { TablePlugin } from '@atlaskit/editor-plugin-table';
25
+ import type { TasksAndDecisionsPlugin } from '@atlaskit/editor-plugin-tasks-and-decisions';
26
+ import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
27
+ export type InsertBlockPluginDependencies = [
28
+ TypeAheadPlugin,
29
+ OptionalPlugin<TablePlugin>,
30
+ OptionalPlugin<HyperlinkPlugin>,
31
+ OptionalPlugin<DatePlugin>,
32
+ OptionalPlugin<BlockTypePlugin>,
33
+ OptionalPlugin<AnalyticsPlugin>,
34
+ OptionalPlugin<ImageUploadPlugin>,
35
+ OptionalPlugin<EmojiPlugin>,
36
+ OptionalPlugin<QuickInsertPlugin>,
37
+ OptionalPlugin<RulePlugin>,
38
+ OptionalPlugin<CodeBlockPlugin>,
39
+ OptionalPlugin<PanelPlugin>,
40
+ OptionalPlugin<MediaPlugin>,
41
+ OptionalPlugin<MediaInsertPlugin>,
42
+ OptionalPlugin<MentionsPlugin>,
43
+ OptionalPlugin<StatusPlugin>,
44
+ OptionalPlugin<LayoutPlugin>,
45
+ OptionalPlugin<ExpandPlugin>,
46
+ OptionalPlugin<PlaceholderTextPlugin>,
47
+ OptionalPlugin<ExtensionPlugin>,
48
+ OptionalPlugin<TasksAndDecisionsPlugin>,
49
+ OptionalPlugin<PrimaryToolbarPlugin>,
50
+ OptionalPlugin<FeatureFlagsPlugin>,
51
+ OptionalPlugin<ContextPanelPlugin>,
52
+ OptionalPlugin<ConnectivityPlugin>
53
+ ];
54
+ export interface InsertBlockOptions {
55
+ allowTables?: boolean;
56
+ allowExpand?: boolean;
57
+ insertMenuItems?: any;
58
+ horizontalRuleEnabled?: boolean;
59
+ nativeStatusSupported?: boolean;
60
+ showElementBrowserLink?: boolean;
61
+ tableSelectorSupported?: boolean;
62
+ appearance?: EditorAppearance;
63
+ }
64
+ export interface InsertBlockPluginState {
65
+ showElementBrowser: boolean;
66
+ menuBrowserOpen?: boolean;
67
+ }
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- import { type InsertBlockOptions, type InsertBlockPlugin } from '../../insertBlockPlugin';
4
+ import { type InsertBlockPlugin } from '../../insertBlockPluginType';
5
+ import { type InsertBlockOptions } from '../../types';
5
6
  /**
6
7
  * For insert menu in right rail experiment
7
8
  * - Clean up ticket ED-24801
@@ -11,10 +12,10 @@ export declare const InsertMenuRail: ({ editorView, options, api, }: {
11
12
  options: InsertBlockOptions;
12
13
  api?: import("@atlaskit/editor-common/types").EditorInjectionAPI<"insertBlock", {
13
14
  pluginConfiguration: InsertBlockOptions | undefined;
14
- dependencies: import("../..").InsertBlockPluginDependencies;
15
+ dependencies: import("../../types").InsertBlockPluginDependencies;
15
16
  actions: {
16
17
  toggleAdditionalMenu: () => void;
17
18
  };
18
- sharedState: import("../../insertBlockPlugin").InsertBlockPluginState | undefined;
19
+ sharedState: import("../../types").InsertBlockPluginState | undefined;
19
20
  }> | undefined;
20
21
  }) => JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- import type { InsertBlockOptions, insertBlockPlugin } from '../../insertBlockPlugin';
3
+ import type { insertBlockPlugin } from '../../insertBlockPlugin';
4
+ import type { InsertBlockOptions } from '../../types';
4
5
  export declare const useInsertMenuRailItems: (editorView: EditorView, options: InsertBlockOptions, api?: ExtractInjectionAPI<typeof insertBlockPlugin>) => import("../ToolbarInsertBlock/create-items").BlockMenuItem[];
@@ -1,4 +1,4 @@
1
1
  import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
2
2
  import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import { type InsertBlockPlugin } from '../insertBlockPlugin';
3
+ import { type InsertBlockPlugin } from '../insertBlockPluginType';
4
4
  export declare const templateOptions: (api: ExtractInjectionAPI<InsertBlockPlugin> | undefined) => QuickInsertItem[];
@@ -1,8 +1,8 @@
1
1
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
2
  import { type Schema } from '@atlaskit/editor-prosemirror/model';
3
3
  import QuoteIcon from '@atlaskit/icon/glyph/quote';
4
- import ExpandIcon from '../assets/expand';
5
- import type { InsertBlockPlugin } from '../insertBlockPlugin';
4
+ import type { InsertBlockPlugin } from '../insertBlockPluginType';
5
+ import ExpandIcon from './assets/expand';
6
6
  export declare const transformationOptions: (api: ExtractInjectionAPI<InsertBlockPlugin> | undefined, schema: Schema) => ({
7
7
  type: import("prosemirror-model").NodeType;
8
8
  title: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-insert-block",
3
- "version": "2.4.24",
3
+ "version": "2.4.26",
4
4
  "description": "Insert block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/button": "^20.3.0",
35
- "@atlaskit/editor-common": "^96.5.0",
35
+ "@atlaskit/editor-common": "^97.0.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
37
37
  "@atlaskit/editor-plugin-block-type": "^4.0.0",
38
38
  "@atlaskit/editor-plugin-code-block": "^3.5.0",
@@ -40,7 +40,7 @@
40
40
  "@atlaskit/editor-plugin-date": "^2.4.0",
41
41
  "@atlaskit/editor-plugin-emoji": "^2.7.0",
42
42
  "@atlaskit/editor-plugin-expand": "^2.10.0",
43
- "@atlaskit/editor-plugin-extension": "^2.0.0",
43
+ "@atlaskit/editor-plugin-extension": "^3.0.0",
44
44
  "@atlaskit/editor-plugin-feature-flags": "^1.2.0",
45
45
  "@atlaskit/editor-plugin-hyperlink": "^3.2.0",
46
46
  "@atlaskit/editor-plugin-image-upload": "^1.2.0",
@@ -48,9 +48,9 @@
48
48
  "@atlaskit/editor-plugin-media": "^1.43.0",
49
49
  "@atlaskit/editor-plugin-media-insert": "^4.0.0",
50
50
  "@atlaskit/editor-plugin-mentions": "^2.10.0",
51
- "@atlaskit/editor-plugin-panel": "^3.1.0",
52
- "@atlaskit/editor-plugin-placeholder-text": "^1.8.0",
53
- "@atlaskit/editor-plugin-primary-toolbar": "^2.0.0",
51
+ "@atlaskit/editor-plugin-panel": "^3.2.0",
52
+ "@atlaskit/editor-plugin-placeholder-text": "^1.9.0",
53
+ "@atlaskit/editor-plugin-primary-toolbar": "^2.1.0",
54
54
  "@atlaskit/editor-plugin-quick-insert": "^1.8.0",
55
55
  "@atlaskit/editor-plugin-rule": "^1.9.0",
56
56
  "@atlaskit/editor-plugin-status": "^2.6.0",
@@ -66,7 +66,7 @@
66
66
  "@atlaskit/platform-feature-flags": "^0.3.0",
67
67
  "@atlaskit/primitives": "^13.3.0",
68
68
  "@atlaskit/theme": "^14.0.0",
69
- "@atlaskit/tmp-editor-statsig": "^2.27.0",
69
+ "@atlaskit/tmp-editor-statsig": "^2.29.0",
70
70
  "@atlaskit/tokens": "^2.5.0",
71
71
  "@atlaskit/tooltip": "19.0.0",
72
72
  "@babel/runtime": "^7.0.0",
@@ -92,6 +92,9 @@
92
92
  },
93
93
  "techstack": {
94
94
  "@atlassian/frontend": {
95
+ "code-structure": [
96
+ "editor-plugin"
97
+ ],
95
98
  "import-structure": [
96
99
  "atlassian-conventions"
97
100
  ],
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "messages", {
7
- enumerable: true,
8
- get: function get() {
9
- return _messages.toolbarInsertBlockMessages;
10
- }
11
- });
12
- var _messages = require("@atlaskit/editor-common/messages");
@@ -1 +0,0 @@
1
- export { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
@@ -1 +0,0 @@
1
- export { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
@@ -1 +0,0 @@
1
- export { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
@@ -1 +0,0 @@
1
- export { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes