@atlaskit/editor-core 185.15.2 → 185.16.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.
Files changed (149) hide show
  1. package/.eslintrc.js +2 -0
  2. package/CHANGELOG.md +16 -0
  3. package/dist/cjs/actions/index.js +1 -1
  4. package/dist/cjs/commands/index.js +1 -1
  5. package/dist/cjs/editor-next/editor-internal.js +17 -17
  6. package/dist/cjs/editor-next/hooks/useMeasureEditorMountTime.js +1 -1
  7. package/dist/cjs/editor-next/hooks/useProviderFactory.js +3 -3
  8. package/dist/cjs/editor-next/index.js +15 -15
  9. package/dist/cjs/editor-next/utils/editorMeasureTTICallback.js +2 -2
  10. package/dist/cjs/editor-next/utils/onEditorCreated.js +1 -1
  11. package/dist/cjs/editor-next/utils/sendDurationAnalytics.js +1 -1
  12. package/dist/cjs/editor.js +5 -5
  13. package/dist/cjs/messages.js +4 -4
  14. package/dist/cjs/nodeviews/context-adapter.js +1 -1
  15. package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  16. package/dist/cjs/plugins/card/index.js +29 -1
  17. package/dist/cjs/plugins/card/messages.js +20 -0
  18. package/dist/cjs/plugins/card/pm-plugins/actions.js +7 -4
  19. package/dist/cjs/plugins/card/pm-plugins/doc.js +26 -7
  20. package/dist/cjs/plugins/card/pm-plugins/main.js +3 -2
  21. package/dist/cjs/plugins/card/pm-plugins/reducers.js +11 -3
  22. package/dist/cjs/plugins/card/toolbar.js +3 -9
  23. package/dist/cjs/plugins/card/ui/DatasourceModal/ModalWithState.js +25 -0
  24. package/dist/cjs/plugins/card/ui/DatasourceModal/index.js +60 -0
  25. package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +8 -28
  26. package/dist/cjs/plugins/type-ahead/commands/insert-type-ahead-item.js +4 -4
  27. package/dist/cjs/test-utils.js +3 -3
  28. package/dist/cjs/version-wrapper.js +1 -1
  29. package/dist/cjs/version.json +1 -1
  30. package/dist/es2019/actions/index.js +2 -3
  31. package/dist/es2019/commands/index.js +1 -1
  32. package/dist/es2019/editor-next/editor-internal.js +6 -7
  33. package/dist/es2019/editor-next/hooks/useMeasureEditorMountTime.js +1 -1
  34. package/dist/es2019/editor-next/hooks/useProviderFactory.js +3 -3
  35. package/dist/es2019/editor-next/index.js +10 -11
  36. package/dist/es2019/editor-next/utils/editorMeasureTTICallback.js +2 -2
  37. package/dist/es2019/editor-next/utils/onEditorCreated.js +1 -1
  38. package/dist/es2019/editor-next/utils/sendDurationAnalytics.js +1 -1
  39. package/dist/es2019/editor.js +1 -1
  40. package/dist/es2019/messages.js +1 -1
  41. package/dist/es2019/nodeviews/context-adapter.js +1 -1
  42. package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  43. package/dist/es2019/plugins/card/index.js +29 -1
  44. package/dist/es2019/plugins/card/messages.js +13 -0
  45. package/dist/es2019/plugins/card/pm-plugins/actions.js +3 -2
  46. package/dist/es2019/plugins/card/pm-plugins/doc.js +27 -5
  47. package/dist/es2019/plugins/card/pm-plugins/main.js +3 -2
  48. package/dist/es2019/plugins/card/pm-plugins/reducers.js +12 -3
  49. package/dist/es2019/plugins/card/toolbar.js +4 -10
  50. package/dist/es2019/plugins/card/ui/DatasourceModal/ModalWithState.js +19 -0
  51. package/dist/es2019/plugins/card/ui/DatasourceModal/index.js +48 -0
  52. package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +6 -26
  53. package/dist/es2019/plugins/type-ahead/commands/insert-type-ahead-item.js +5 -5
  54. package/dist/es2019/test-utils.js +3 -3
  55. package/dist/es2019/version-wrapper.js +1 -1
  56. package/dist/es2019/version.json +1 -1
  57. package/dist/esm/actions/index.js +2 -3
  58. package/dist/esm/commands/index.js +1 -1
  59. package/dist/esm/editor-next/editor-internal.js +6 -7
  60. package/dist/esm/editor-next/hooks/useMeasureEditorMountTime.js +1 -1
  61. package/dist/esm/editor-next/hooks/useProviderFactory.js +3 -3
  62. package/dist/esm/editor-next/index.js +10 -11
  63. package/dist/esm/editor-next/utils/editorMeasureTTICallback.js +2 -2
  64. package/dist/esm/editor-next/utils/onEditorCreated.js +1 -1
  65. package/dist/esm/editor-next/utils/sendDurationAnalytics.js +1 -1
  66. package/dist/esm/editor.js +1 -1
  67. package/dist/esm/messages.js +1 -1
  68. package/dist/esm/nodeviews/context-adapter.js +1 -1
  69. package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  70. package/dist/esm/plugins/card/index.js +30 -1
  71. package/dist/esm/plugins/card/messages.js +13 -0
  72. package/dist/esm/plugins/card/pm-plugins/actions.js +7 -4
  73. package/dist/esm/plugins/card/pm-plugins/doc.js +23 -5
  74. package/dist/esm/plugins/card/pm-plugins/main.js +3 -2
  75. package/dist/esm/plugins/card/pm-plugins/reducers.js +11 -3
  76. package/dist/esm/plugins/card/toolbar.js +4 -10
  77. package/dist/esm/plugins/card/ui/DatasourceModal/ModalWithState.js +17 -0
  78. package/dist/esm/plugins/card/ui/DatasourceModal/index.js +49 -0
  79. package/dist/esm/plugins/card/ui/EditLinkToolbar.js +6 -25
  80. package/dist/esm/plugins/type-ahead/commands/insert-type-ahead-item.js +5 -5
  81. package/dist/esm/test-utils.js +3 -3
  82. package/dist/esm/version-wrapper.js +1 -1
  83. package/dist/esm/version.json +1 -1
  84. package/dist/types/actions/index.d.ts +2 -2
  85. package/dist/types/commands/index.d.ts +2 -2
  86. package/dist/types/create-editor/get-plugins.d.ts +6 -6
  87. package/dist/types/editor-next/editor-internal.d.ts +5 -6
  88. package/dist/types/editor-next/hooks/useMeasureEditorMountTime.d.ts +1 -1
  89. package/dist/types/editor-next/hooks/useProviderFactory.d.ts +3 -3
  90. package/dist/types/editor-next/index.d.ts +2 -1
  91. package/dist/types/editor-next/utils/deprecationWarnings.d.ts +1 -1
  92. package/dist/types/editor-next/utils/handleProviders.d.ts +1 -2
  93. package/dist/types/editor-next/utils/onEditorCreated.d.ts +3 -3
  94. package/dist/types/editor-next/utils/sendDurationAnalytics.d.ts +1 -1
  95. package/dist/types/editor-next/utils/trackEditorActions.d.ts +1 -1
  96. package/dist/types/editor.d.ts +1 -1
  97. package/dist/types/messages.d.ts +1 -1
  98. package/dist/types/plugins/card/messages.d.ts +12 -0
  99. package/dist/types/plugins/card/pm-plugins/actions.d.ts +2 -1
  100. package/dist/types/plugins/card/pm-plugins/doc.d.ts +1 -0
  101. package/dist/types/plugins/card/pm-plugins/util/state.d.ts +1 -0
  102. package/dist/types/plugins/card/types.d.ts +3 -0
  103. package/dist/types/plugins/card/ui/DatasourceModal/ModalWithState.d.ts +9 -0
  104. package/dist/{types-ts4.5/plugins/card/ui/DatasourceModal.d.ts → types/plugins/card/ui/DatasourceModal/index.d.ts} +3 -5
  105. package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +1 -7
  106. package/dist/types/selection-api/api.d.ts +1 -1
  107. package/dist/types/test-utils.d.ts +3 -3
  108. package/dist/types/types/editor-appearance-component.d.ts +8 -8
  109. package/dist/types/types/editor-config.d.ts +3 -3
  110. package/dist/types/types/editor-props.d.ts +10 -10
  111. package/dist/types/ui/Appearance/FullPage/FullPageContentArea.d.ts +1 -1
  112. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
  113. package/dist/types/ui/ConfigPanel/FormErrorBoundary.d.ts +1 -1
  114. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  115. package/dist/types-ts4.5/actions/index.d.ts +2 -2
  116. package/dist/types-ts4.5/commands/index.d.ts +2 -2
  117. package/dist/types-ts4.5/create-editor/get-plugins.d.ts +6 -6
  118. package/dist/types-ts4.5/editor-next/editor-internal.d.ts +5 -6
  119. package/dist/types-ts4.5/editor-next/hooks/useMeasureEditorMountTime.d.ts +1 -1
  120. package/dist/types-ts4.5/editor-next/hooks/useProviderFactory.d.ts +3 -3
  121. package/dist/types-ts4.5/editor-next/index.d.ts +2 -1
  122. package/dist/types-ts4.5/editor-next/utils/deprecationWarnings.d.ts +1 -1
  123. package/dist/types-ts4.5/editor-next/utils/handleProviders.d.ts +1 -2
  124. package/dist/types-ts4.5/editor-next/utils/onEditorCreated.d.ts +3 -3
  125. package/dist/types-ts4.5/editor-next/utils/sendDurationAnalytics.d.ts +1 -1
  126. package/dist/types-ts4.5/editor-next/utils/trackEditorActions.d.ts +1 -1
  127. package/dist/types-ts4.5/editor.d.ts +1 -1
  128. package/dist/types-ts4.5/messages.d.ts +1 -1
  129. package/dist/types-ts4.5/plugins/card/messages.d.ts +12 -0
  130. package/dist/types-ts4.5/plugins/card/pm-plugins/actions.d.ts +2 -1
  131. package/dist/types-ts4.5/plugins/card/pm-plugins/doc.d.ts +1 -0
  132. package/dist/types-ts4.5/plugins/card/pm-plugins/util/state.d.ts +1 -0
  133. package/dist/types-ts4.5/plugins/card/types.d.ts +3 -0
  134. package/dist/types-ts4.5/plugins/card/ui/DatasourceModal/ModalWithState.d.ts +9 -0
  135. package/dist/{types/plugins/card/ui/DatasourceModal.d.ts → types-ts4.5/plugins/card/ui/DatasourceModal/index.d.ts} +3 -5
  136. package/dist/types-ts4.5/plugins/card/ui/EditLinkToolbar.d.ts +1 -7
  137. package/dist/types-ts4.5/selection-api/api.d.ts +1 -1
  138. package/dist/types-ts4.5/test-utils.d.ts +3 -3
  139. package/dist/types-ts4.5/types/editor-appearance-component.d.ts +8 -8
  140. package/dist/types-ts4.5/types/editor-config.d.ts +3 -3
  141. package/dist/types-ts4.5/types/editor-props.d.ts +10 -10
  142. package/dist/types-ts4.5/ui/Appearance/FullPage/FullPageContentArea.d.ts +1 -1
  143. package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
  144. package/dist/types-ts4.5/ui/ConfigPanel/FormErrorBoundary.d.ts +1 -1
  145. package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
  146. package/package.json +3 -3
  147. package/dist/cjs/plugins/card/ui/DatasourceModal.js +0 -41
  148. package/dist/es2019/plugins/card/ui/DatasourceModal.js +0 -30
  149. package/dist/esm/plugins/card/ui/DatasourceModal.js +0 -31
@@ -0,0 +1,49 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import React, { useCallback } from 'react';
3
+ import { JIRA_LIST_OF_LINKS_DATASOURCE_ID, JiraIssuesConfigModal } from '@atlaskit/link-datasource';
4
+ import { hideDatasourceModal } from '../../pm-plugins/actions';
5
+ import { updateExistingDatasource, insertDatasource } from '../../pm-plugins/doc';
6
+ import { NodeSelection } from 'prosemirror-state';
7
+ export var DatasourceModal = function DatasourceModal(_ref) {
8
+ var view = _ref.view,
9
+ modalType = _ref.modalType;
10
+ var dispatch = view.dispatch,
11
+ state = view.state;
12
+ var selection = state.selection;
13
+ var existingNode = selection instanceof NodeSelection ? selection.node : undefined;
14
+ var onClose = useCallback(function () {
15
+ dispatch(hideDatasourceModal(state.tr));
16
+ }, [dispatch, state.tr]);
17
+ var onInsert = useCallback(function (newAdf) {
18
+ if (existingNode) {
19
+ updateExistingDatasource(state, existingNode, newAdf, view);
20
+ } else {
21
+ insertDatasource(state, newAdf, view);
22
+ }
23
+ }, [existingNode, state, view]);
24
+ if (modalType === 'jira') {
25
+ var _existingNode$attrs, _tableView$properties;
26
+ var _ref2 = (existingNode === null || existingNode === void 0 ? void 0 : (_existingNode$attrs = existingNode.attrs) === null || _existingNode$attrs === void 0 ? void 0 : _existingNode$attrs.datasource) || {},
27
+ _ref2$id = _ref2.id,
28
+ datasourceId = _ref2$id === void 0 ? JIRA_LIST_OF_LINKS_DATASOURCE_ID : _ref2$id,
29
+ parameters = _ref2.parameters,
30
+ _ref2$views = _ref2.views,
31
+ views = _ref2$views === void 0 ? [] : _ref2$views;
32
+ var _ref3 = views,
33
+ _ref4 = _slicedToArray(_ref3, 1),
34
+ tableView = _ref4[0];
35
+ var visibleColumnKeys = tableView === null || tableView === void 0 ? void 0 : (_tableView$properties = tableView.properties) === null || _tableView$properties === void 0 ? void 0 : _tableView$properties.columns.map(function (column) {
36
+ return column.key;
37
+ });
38
+ return /*#__PURE__*/React.createElement("div", {
39
+ "data-testid": "jira-config-modal"
40
+ }, /*#__PURE__*/React.createElement(JiraIssuesConfigModal, {
41
+ datasourceId: datasourceId,
42
+ visibleColumnKeys: visibleColumnKeys,
43
+ parameters: parameters,
44
+ onCancel: onClose,
45
+ onInsert: onInsert
46
+ }));
47
+ }
48
+ return null; // null for now until we have modal component that handles other datasources
49
+ };
@@ -18,8 +18,8 @@ import { changeSelectedCardToLink, updateCard } from '../pm-plugins/doc';
18
18
  import { findCardInfo, displayInfoForCard } from '../utils';
19
19
  import { NodeSelection } from 'prosemirror-state';
20
20
  import { linkToolbarMessages } from '@atlaskit/editor-common/messages';
21
- import { DatasourceModal } from './DatasourceModal';
22
21
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
22
+ import { JIRA_LIST_OF_LINKS_DATASOURCE_ID } from '@atlaskit/link-datasource';
23
23
  var HyperLinkToolbarWithListeners = withOuterListeners(HyperlinkAddToolbarWithState);
24
24
  export function HyperlinkAddToolbarWithState(_ref) {
25
25
  var _ref$linkPickerOption = _ref.linkPickerOptions,
@@ -220,11 +220,13 @@ export var editLinkToolbarConfig = function editLinkToolbarConfig(showLinkingToo
220
220
  forcePlacement: true
221
221
  } : {};
222
222
  };
223
- export var editDatasource = function editDatasource(editorAnalyticsApi) {
223
+ export var editDatasource = function editDatasource(node, editorAnalyticsApi) {
224
224
  return function (state, dispatch) {
225
- if (dispatch) {
225
+ var _node$attrs;
226
+ var modalType = ((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.datasource.id) === JIRA_LIST_OF_LINKS_DATASOURCE_ID ? 'jira' : undefined;
227
+ if (dispatch && modalType) {
226
228
  var tr = state.tr;
227
- showDatasourceModal(tr);
229
+ showDatasourceModal(modalType)(tr);
228
230
  // editorAnalyticsApi?.attachAnalyticsEvent(
229
231
  // buildEditLinkPayload(
230
232
  // type as
@@ -238,25 +240,4 @@ export var editDatasource = function editDatasource(editorAnalyticsApi) {
238
240
  }
239
241
  return false;
240
242
  };
241
- };
242
- export var openDatasourceModal = function openDatasourceModal(_ref3) {
243
- var state = _ref3.state,
244
- node = _ref3.node,
245
- editorAnalyticsApi = _ref3.editorAnalyticsApi;
246
- return {
247
- type: 'custom',
248
- disableArrowNavigation: true,
249
- fallback: [],
250
- render: function render(view) {
251
- if (!view) {
252
- return null;
253
- }
254
- return /*#__PURE__*/React.createElement(DatasourceModal, {
255
- state: state,
256
- view: view,
257
- node: node,
258
- editorAnalyticsApi: editorAnalyticsApi
259
- });
260
- }
261
- };
262
243
  };
@@ -1,12 +1,12 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
- import { Node as PMNode, Fragment } from 'prosemirror-model';
3
- import { InsertTypeAheadStep, InsertTypeAheadStages } from '@atlaskit/adf-schema/steps';
4
2
  import { closeHistory } from 'prosemirror-history';
5
- import { pluginKey } from '../pm-plugins/key';
6
- import { insertBlockNode, insertInlineNodeOrFragment } from '../insert-utils';
7
- import { StatsModifier } from '../stats-modifier';
3
+ import { Fragment, Node as PMNode } from 'prosemirror-model';
4
+ import { InsertTypeAheadStages, InsertTypeAheadStep } from '@atlaskit/adf-schema/steps';
8
5
  import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
6
+ import { insertBlockNode, insertInlineNodeOrFragment } from '../insert-utils';
9
7
  import { ACTIONS } from '../pm-plugins/actions';
8
+ import { pluginKey } from '../pm-plugins/key';
9
+ import { StatsModifier } from '../stats-modifier';
10
10
  import { closeTypeAhead } from '../transforms/close-type-ahead';
11
11
  import { getPluginState } from '../utils';
12
12
  var validateNode = function validateNode(_ref) {
@@ -3,12 +3,12 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
3
  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; }
4
4
  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) { _defineProperty(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; }
5
5
  import { TextSelection } from 'prosemirror-state';
6
- import { sortByOrder } from './create-editor/sort-by-order';
6
+ import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
7
7
  import { createSchema } from './create-editor/create-schema';
8
- import basePlugin from './plugins/base';
8
+ import { sortByOrder } from './create-editor/sort-by-order';
9
9
  import { analyticsPluginKey } from './plugins/analytics/plugin-key';
10
+ import basePlugin from './plugins/base';
10
11
  export { createTypeAheadTools } from './plugins/type-ahead/api';
11
- import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
12
12
  export function getFireAnalytics(editorView) {
13
13
  var _analyticsPluginKey$g;
14
14
  return analyticsPluginKey === null || analyticsPluginKey === void 0 ? void 0 : (_analyticsPluginKey$g = analyticsPluginKey.getState(editorView.state)) === null || _analyticsPluginKey$g === void 0 ? void 0 : _analyticsPluginKey$g.fireAnalytics;
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "185.15.2";
2
+ export var version = "185.16.0";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "185.15.2",
3
+ "version": "185.16.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,9 +1,9 @@
1
1
  import { Node } from 'prosemirror-model';
2
- import { ContextUpdateHandler, EditorActionsOptions, ReplaceRawValue } from '@atlaskit/editor-common/types';
2
+ import { EditorView } from 'prosemirror-view';
3
3
  import { AnalyticsEventPayload } from '@atlaskit/analytics-next/AnalyticsEvent';
4
4
  import type { ResolvedEditorState } from '@atlaskit/collab-provider';
5
+ import { ContextUpdateHandler, EditorActionsOptions, ReplaceRawValue } from '@atlaskit/editor-common/types';
5
6
  import type { FeatureFlags, Transformer } from '@atlaskit/editor-common/types';
6
- import { EditorView } from 'prosemirror-view';
7
7
  import { EventDispatcher } from '../event-dispatcher';
8
8
  export default class EditorActions<T = any> implements EditorActionsOptions<T> {
9
9
  private editorView?;
@@ -1,7 +1,7 @@
1
- import { Node as PMNode, NodeType, MarkType, Schema } from 'prosemirror-model';
1
+ import { MarkType, NodeType, Node as PMNode, Schema } from 'prosemirror-model';
2
2
  import { EditorState, Transaction } from 'prosemirror-state';
3
- import { Command } from '../types';
4
3
  import { AlignmentState } from '../plugins/alignment/pm-plugins/types';
4
+ import { Command } from '../types';
5
5
  export declare function preventDefault(): Command;
6
6
  export declare function insertNewLine(): Command;
7
7
  export declare const insertNewLineWithAnalytics: Command;
@@ -1,13 +1,13 @@
1
1
  import { Schema } from 'prosemirror-model';
2
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- import { Transaction, EditorState } from 'prosemirror-state';
2
+ import { EditorState, Transaction } from 'prosemirror-state';
3
+ import { IntlShape } from 'react-intl-next';
4
4
  import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
- import { EventDispatcher, Dispatch } from '../event-dispatcher';
6
- import { MarkConfig, NodeConfig } from '../types/pm-config';
5
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
6
+ import type { ReactHookFactory, UIComponentFactory } from '@atlaskit/editor-common/types';
7
+ import { Dispatch, EventDispatcher } from '../event-dispatcher';
7
8
  import { EditorReactContext } from '../types/editor-react-context';
8
9
  import { FeatureFlags } from '../types/feature-flags';
9
- import { IntlShape } from 'react-intl-next';
10
- import type { UIComponentFactory, ReactHookFactory } from '@atlaskit/editor-common/types';
10
+ import { MarkConfig, NodeConfig } from '../types/pm-config';
11
11
  export type LightPMPluginFactoryParams = {
12
12
  schema: Schema;
13
13
  dispatch: Dispatch;
@@ -1,15 +1,14 @@
1
- /** @jsx jsx */
2
- import type { Transformer, AllEditorPresetPluginTypes } from '@atlaskit/editor-common/types';
3
1
  import { jsx } from '@emotion/react';
4
2
  import { EditorView } from 'prosemirror-view';
5
3
  import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
4
+ import { FireAnalyticsCallback } from '@atlaskit/editor-common/analytics';
5
+ import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
6
+ import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
7
+ import type { AllEditorPresetPluginTypes, Transformer } from '@atlaskit/editor-common/types';
6
8
  import { ExperienceStore } from '@atlaskit/editor-common/ufo';
7
9
  import EditorActions from '../actions';
8
10
  import { EventDispatcher } from '../event-dispatcher';
9
- import { FireAnalyticsCallback } from '@atlaskit/editor-common/analytics';
10
- import { EditorProps, EditorNextProps } from '../types/editor-props';
11
- import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
12
- import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
11
+ import { EditorNextProps, EditorProps } from '../types/editor-props';
13
12
  interface Props<PropsType> {
14
13
  props: PropsType;
15
14
  handleAnalyticsEvent: FireAnalyticsCallback;
@@ -1,6 +1,6 @@
1
1
  import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
2
  import { ExperienceStore } from '@atlaskit/editor-common/ufo';
3
- import { EditorProps, EditorNextProps } from '../../types/editor-props';
3
+ import { EditorNextProps, EditorProps } from '../../types/editor-props';
4
4
  /**
5
5
  *
6
6
  * Hook to run the analytics for the Editor component.
@@ -1,9 +1,9 @@
1
+ import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
+ import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
1
3
  import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
2
- import { EditorNextProps } from '../../types/editor-props';
3
4
  import EditorActions from '../../actions';
4
- import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
5
5
  import { QuickInsertProvider } from '../../plugins/quick-insert/types';
6
- import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
6
+ import { EditorNextProps } from '../../types/editor-props';
7
7
  export type ProviderFactoryState = {
8
8
  extensionProvider?: ExtensionProvider;
9
9
  quickInsertProvider?: Promise<QuickInsertProvider>;
@@ -1,6 +1,7 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
1
3
  import { jsx } from '@emotion/react';
2
4
  import PropTypes from 'prop-types';
3
- import React from 'react';
4
5
  import { EditorNextProps } from '../types/editor-props';
5
6
  import { Context } from './utils/editorPropTypes';
6
7
  export default class EditorNext extends React.Component<EditorNextProps> {
@@ -1,2 +1,2 @@
1
- import { EditorProps, EditorNextProps } from '../../types/editor-props';
1
+ import { EditorNextProps, EditorProps } from '../../types/editor-props';
2
2
  export default function deprecationWarnings(props: EditorProps | EditorNextProps): void;
@@ -1,6 +1,5 @@
1
1
  import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
2
- import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
3
- import { Providers } from '@atlaskit/editor-common/provider-factory';
2
+ import { ProviderFactory, Providers } from '@atlaskit/editor-common/provider-factory';
4
3
  import { QuickInsertProvider } from '../../plugins/quick-insert/types';
5
4
  /**
6
5
  *
@@ -1,10 +1,10 @@
1
+ import { EditorView } from 'prosemirror-view';
1
2
  import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
- import { ExperienceStore } from '@atlaskit/editor-common/ufo';
3
3
  import { Transformer } from '@atlaskit/editor-common/types';
4
- import { EditorView } from 'prosemirror-view';
4
+ import { ExperienceStore } from '@atlaskit/editor-common/ufo';
5
5
  import EditorActions from '../../actions';
6
6
  import { EventDispatcher } from '../../event-dispatcher';
7
- import { EditorProps, EditorNextProps } from '../../types/editor-props';
7
+ import { EditorNextProps, EditorProps } from '../../types/editor-props';
8
8
  export default function onEditorCreated(instance: {
9
9
  view: EditorView;
10
10
  eventDispatcher: EventDispatcher;
@@ -1,6 +1,6 @@
1
1
  import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
- import { ExperienceStore } from '@atlaskit/editor-common/ufo';
3
2
  import { ACTION } from '@atlaskit/editor-common/analytics';
3
+ import { ExperienceStore } from '@atlaskit/editor-common/ufo';
4
4
  import { EditorProps } from '../../types/editor-props';
5
5
  /**
6
6
  *
@@ -1,5 +1,5 @@
1
- import EditorActions from '../../actions';
2
1
  import { FireAnalyticsCallback } from '@atlaskit/editor-common/analytics';
2
+ import EditorActions from '../../actions';
3
3
  import { PerformanceTracking } from '../../types/performance-tracking';
4
4
  /**
5
5
  *
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
- import { jsx } from '@emotion/react';
3
2
  import React from 'react';
3
+ import { jsx } from '@emotion/react';
4
4
  import { EditorProps } from './types/editor-props';
5
5
  export type { AllowedBlockTypes, Command, CommandDispatch, DomAtPos, EditorAppearance, EditorAppearanceComponentProps, EditorConfig, EditorInstance, EditorPlugin, EditorProps, ExtensionConfig, ExtensionProvidersProp, FeedbackInfo, MarkConfig, MessageDescriptor, NodeConfig, NodeViewConfig, PluginsOptions, PMPlugin, PMPluginCreateConfig, PMPluginFactory, PMPluginFactoryParams, ReactComponents, ToolbarUIComponentFactory, ToolbarUiComponentFactoryParams, UIComponentFactory, UiComponentFactoryParams, } from './types';
6
6
  export default class Editor extends React.Component<EditorProps> {
@@ -1,6 +1,6 @@
1
1
  import commonMessages, { linkMessages, linkToolbarMessages } from '@atlaskit/editor-common/messages';
2
- import { messages as statusMessages } from './plugins/status/nodeviews/messages';
3
2
  import { messages as dateMessages } from './plugins/date/nodeviews/messages';
3
+ import { messages as statusMessages } from './plugins/status/nodeviews/messages';
4
4
  export { linkMessages };
5
5
  export { statusMessages };
6
6
  export { dateMessages };
@@ -0,0 +1,12 @@
1
+ export declare const messages: {
2
+ datasourceJiraIssue: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ datasourceJiraIssueDescription: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
12
+ };
@@ -3,6 +3,7 @@ import { CardProvider } from '@atlaskit/editor-common/provider-factory';
3
3
  import { CardPluginAction, Request, CardInfo, SmartLinkEventsNext } from '../types';
4
4
  import { SmartLinkEvents } from '@atlaskit/smart-card';
5
5
  import { DatasourceTableLayout } from '../ui/LayoutButton/types';
6
+ import { DatasourceModalType } from '@atlaskit/editor-common/types';
6
7
  export declare const cardAction: (tr: Transaction, action: CardPluginAction) => Transaction;
7
8
  export declare const resolveCard: (url: string) => (tr: Transaction) => Transaction;
8
9
  export declare const queueCards: (requests: Request[]) => (tr: Transaction) => Transaction;
@@ -18,5 +19,5 @@ export declare const setCardLayoutAndDatasourceTableRef: ({ layout, datasourceTa
18
19
  }) => (tr: Transaction) => Transaction;
19
20
  export declare const showLinkToolbar: (tr: Transaction) => Transaction;
20
21
  export declare const hideLinkToolbar: (tr: Transaction) => Transaction;
21
- export declare const showDatasourceModal: (tr: Transaction) => Transaction;
22
+ export declare const showDatasourceModal: (modalType: DatasourceModalType) => (tr: Transaction) => Transaction;
22
23
  export declare const hideDatasourceModal: (tr: Transaction) => Transaction;
@@ -20,3 +20,4 @@ export declare const updateCard: (href: string, sourceEvent?: UIAnalyticsEvent |
20
20
  export declare const changeSelectedCardToText: (text: string, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
21
21
  export declare const setSelectedCardAppearance: (appearance: CardAppearance, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
22
22
  export declare const updateExistingDatasource: (state: EditorState, node: Node, newAdf: DatasourceAdf | InlineCardAdf, view: EditorView) => void;
23
+ export declare const insertDatasource: (state: EditorState, adf: DatasourceAdf | InlineCardAdf, view: EditorView) => void;
@@ -24,6 +24,7 @@ export declare const getPluginStateWithUpdatedPos: (pluginState: CardPluginState
24
24
  smartLinkEventsNext?: import("../../types").SmartLinkEventsNext | undefined;
25
25
  editorAppearance?: import("@atlaskit/editor-common/types").EditorAppearance | undefined;
26
26
  showDatasourceModal: boolean;
27
+ datasourceModalType?: "jira" | undefined;
27
28
  datasourceTableRef?: HTMLElement | undefined;
28
29
  layout?: import("../../ui/LayoutButton/types").DatasourceTableLayout | undefined;
29
30
  };
@@ -6,6 +6,7 @@ import type { CardOptions, CardReplacementInputMethod } from '@atlaskit/editor-c
6
6
  import type { EditorAppearance } from '@atlaskit/editor-common/types';
7
7
  import { LinkPickerOptions } from '@atlaskit/editor-common/types';
8
8
  import { DatasourceTableLayout } from './ui/LayoutButton/types';
9
+ import { DatasourceModalType } from '@atlaskit/editor-common/types';
9
10
  export type CardInfo = {
10
11
  title?: string;
11
12
  url?: string;
@@ -101,6 +102,7 @@ export type CardPluginState = {
101
102
  smartLinkEventsNext?: SmartLinkEventsNext;
102
103
  editorAppearance?: EditorAppearance;
103
104
  showDatasourceModal: boolean;
105
+ datasourceModalType?: DatasourceModalType;
104
106
  datasourceTableRef?: HTMLElement;
105
107
  layout?: DatasourceTableLayout;
106
108
  };
@@ -134,6 +136,7 @@ export type HideLinkToolbar = {
134
136
  };
135
137
  export type ShowDatasourceModal = {
136
138
  type: 'SHOW_DATASOURCE_MODAL';
139
+ modalType: DatasourceModalType;
137
140
  };
138
141
  export type HideDatasourceModal = {
139
142
  type: 'HIDE_DATASOURCE_MODAL';
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { EditorView } from 'prosemirror-view';
3
+ import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
+ import type cardPlugin from '../../index';
5
+ declare const ModalWithState: ({ api, editorView, }: {
6
+ api: ExtractInjectionAPI<typeof cardPlugin> | undefined;
7
+ editorView: EditorView;
8
+ }) => JSX.Element | null;
9
+ export default ModalWithState;
@@ -1,13 +1,11 @@
1
1
  /// <reference types="react" />
2
- import { Node } from 'prosemirror-model';
3
- import { EditorState } from 'prosemirror-state';
4
2
  import { EditorView } from 'prosemirror-view';
5
3
  import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
+ import { DatasourceModalType } from '@atlaskit/editor-common/types';
6
5
  type DatasourceModalProps = {
7
- state: EditorState;
8
6
  view: EditorView;
9
- node: Node;
10
7
  editorAnalyticsApi?: EditorAnalyticsAPI;
8
+ modalType?: DatasourceModalType;
11
9
  };
12
- export declare const DatasourceModal: ({ state, view, node, }: DatasourceModalProps) => JSX.Element | null;
10
+ export declare const DatasourceModal: ({ view, modalType }: DatasourceModalProps) => JSX.Element | null;
13
11
  export {};
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { Node } from 'prosemirror-model';
3
- import { EditorState } from 'prosemirror-state';
4
3
  import { EditorView } from 'prosemirror-view';
5
4
  import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
6
5
  import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
@@ -45,9 +44,4 @@ export declare const buildEditLinkToolbar: ({ providerFactory, node, linkPicker,
45
44
  pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined;
46
45
  }) => FloatingToolbarItem<Command>;
47
46
  export declare const editLinkToolbarConfig: (showLinkingToolbar: boolean, lpLinkPicker: boolean) => Partial<FloatingToolbarConfig>;
48
- export declare const editDatasource: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
49
- export declare const openDatasourceModal: ({ state, node, editorAnalyticsApi, }: {
50
- state: EditorState;
51
- node: Node;
52
- editorAnalyticsApi?: EditorAnalyticsAPI | undefined;
53
- }) => FloatingToolbarItem<Command>;
47
+ export declare const editDatasource: (node: Node, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
@@ -1,5 +1,5 @@
1
+ import type { EditorState, Selection, Transaction } from 'prosemirror-state';
1
2
  import { RelativeSelectionPos } from '@atlaskit/editor-common/selection';
2
- import type { Transaction, Selection, EditorState } from 'prosemirror-state';
3
3
  import type { SelectionPluginState } from '../plugins/selection/types';
4
4
  export type EditorSelectionAPI = {
5
5
  setSelectionRelativeToNode: (props: {
@@ -1,14 +1,14 @@
1
+ import { Schema } from 'prosemirror-model';
1
2
  import { Plugin } from 'prosemirror-state';
2
3
  import { EditorView } from 'prosemirror-view';
4
+ import { type EditorPluginInjectionAPI, EditorPresetBuilder } from '@atlaskit/editor-common/preset';
5
+ import type { AllEditorPresetPluginTypes, ReactHookFactory, UIComponentFactory } from '@atlaskit/editor-common/types';
3
6
  import { LightPMPlugin, LightPMPluginFactoryParams, OnEditorViewStateUpdated } from './create-editor/get-plugins';
4
- import { Schema } from 'prosemirror-model';
5
7
  import { MarkConfig, NodeConfig } from './types/pm-config';
6
8
  export { createTypeAheadTools } from './plugins/type-ahead/api';
7
9
  export type { LightEditorPlugin } from './create-editor/get-plugins';
8
10
  export type { DispatchAnalyticsEvent } from './plugins/analytics/types';
9
11
  export type { FeatureFlags } from './types/feature-flags';
10
- import { EditorPresetBuilder, type EditorPluginInjectionAPI } from '@atlaskit/editor-common/preset';
11
- import type { AllEditorPresetPluginTypes, UIComponentFactory, ReactHookFactory } from '@atlaskit/editor-common/types';
12
12
  export interface LightEditorConfig {
13
13
  nodes: NodeConfig[];
14
14
  marks: MarkConfig[];
@@ -1,19 +1,19 @@
1
- import { EditorView } from 'prosemirror-view';
2
1
  import { RefObject } from 'react';
2
+ import { ReactElement } from 'react';
3
+ import { EditorView } from 'prosemirror-view';
4
+ import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
3
5
  import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
4
6
  import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
- import { EventDispatcher } from '../event-dispatcher';
7
+ import type { ReactHookFactory } from '@atlaskit/editor-common/types';
6
8
  import EditorActions from '../actions';
9
+ import { EventDispatcher } from '../event-dispatcher';
10
+ import { CollabEditOptions } from '../plugins/collab-edit/types';
11
+ import { PrimaryToolbarComponents, ReactComponents, UseStickyToolbarType } from '../types/editor-props';
7
12
  import { UIComponentFactory } from '../types/ui-components';
8
- import { ReactComponents, PrimaryToolbarComponents, UseStickyToolbarType } from '../types/editor-props';
13
+ import { MenuItem } from '../ui/DropdownMenu/types';
9
14
  import { ToolbarUIComponentFactory } from '../ui/Toolbar/types';
10
- import { CollabEditOptions } from '../plugins/collab-edit/types';
11
- import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
12
15
  import { EditorAppearance } from './editor-appearance';
13
- import { MenuItem } from '../ui/DropdownMenu/types';
14
- import { ReactElement } from 'react';
15
16
  import { FeatureFlags } from './feature-flags';
16
- import type { ReactHookFactory } from '@atlaskit/editor-common/types';
17
17
  export interface EditorAppearanceComponentProps {
18
18
  appearance?: EditorAppearance;
19
19
  onSave?: (editorView: EditorView) => void;
@@ -1,8 +1,8 @@
1
+ import { EditorState, Transaction } from 'prosemirror-state';
2
+ import type { ReactHookFactory, UIComponentFactory } from '@atlaskit/editor-common/types';
1
3
  import { ToolbarUIComponentFactory } from '../ui/Toolbar/types';
2
- import { Transaction, EditorState } from 'prosemirror-state';
3
- import { PMPlugin } from './pm-plugin';
4
4
  import { MarkConfig, NodeConfig } from './pm-config';
5
- import type { UIComponentFactory, ReactHookFactory } from '@atlaskit/editor-common/types';
5
+ import { PMPlugin } from './pm-plugin';
6
6
  type EditorViewStateUpdatedCallbackProps = {
7
7
  readonly originalTransaction: Readonly<Transaction>;
8
8
  readonly transactions: readonly Transaction[];
@@ -1,39 +1,39 @@
1
+ import { ReactElement, RefObject } from 'react';
1
2
  import { Node, Schema } from 'prosemirror-model';
2
3
  import { EditorView } from 'prosemirror-view';
3
- import { ReactElement, RefObject } from 'react';
4
- import EditorActions from '../actions';
4
+ import { ActivityProvider } from '@atlaskit/activity-provider';
5
+ import { CardOptions } from '@atlaskit/editor-common/card';
5
6
  import type { ExtensionHandlers, ExtensionProvider } from '@atlaskit/editor-common/extensions';
7
+ import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
6
8
  import type { ContextIdentifierProvider, Providers, SearchProvider } from '@atlaskit/editor-common/provider-factory';
7
- import type { Transformer, AllEditorPresetPluginTypes } from '@atlaskit/editor-common/types';
9
+ import type { AllEditorPresetPluginTypes, Transformer } from '@atlaskit/editor-common/types';
10
+ import type { LinkingOptions } from '@atlaskit/editor-common/types';
8
11
  import type { ErrorReportingHandler } from '@atlaskit/editor-common/utils';
9
- import { ActivityProvider } from '@atlaskit/activity-provider';
12
+ import { PluginConfig as TablesPluginConfig } from '@atlaskit/editor-plugin-table/types';
10
13
  import { MentionProvider } from '@atlaskit/mention/resource';
11
14
  import { TaskDecisionProvider } from '@atlaskit/task-decision';
12
- import { CardOptions } from '@atlaskit/editor-common/card';
13
- import { PluginConfig as TablesPluginConfig } from '@atlaskit/editor-plugin-table/types';
15
+ import EditorActions from '../actions';
14
16
  import { AnnotationProviders } from '../plugins/annotation/types';
15
17
  import { BlockTypePluginOptions } from '../plugins/block-type/types';
16
18
  import { CodeBlockOptions } from '../plugins/code-block/types';
17
19
  import { CollabEditOptions } from '../plugins/collab-edit/types';
18
20
  import { DatePluginConfig } from '../plugins/date/types';
19
21
  import { FindReplaceOptions } from '../plugins/find-replace/types';
20
- import type { LinkingOptions } from '@atlaskit/editor-common/types';
21
22
  import { LayoutPluginOptions } from '../plugins/layout/types';
22
23
  import { MediaOptions, MediaState } from '../plugins/media/types';
24
+ import { MentionPluginConfig } from '../plugins/mentions/types';
25
+ import { PanelPluginConfig } from '../plugins/panel/types';
23
26
  import { PlaceholderTextOptions } from '../plugins/placeholder-text/types';
24
27
  import { QuickInsertOptions } from '../plugins/quick-insert/types';
25
28
  import { TextColorPluginConfig } from '../plugins/text-color/pm-plugins/main';
26
29
  import { TextFormattingOptions } from '../plugins/text-formatting/types';
27
30
  import { MenuItem } from '../ui/DropdownMenu/types';
28
- import { MentionPluginConfig } from './../plugins/mentions/types';
29
- import { PanelPluginConfig } from './../plugins/panel/types';
30
31
  import { EditorAppearance } from './editor-appearance';
31
32
  import { EditorOnChangeHandler } from './editor-onchange';
32
33
  import { EditorPlugin } from './editor-plugin';
33
34
  import { EmptyStateHandler } from './empty-state-handler';
34
35
  import { ExtensionConfig } from './extension-config';
35
36
  import { PerformanceTracking } from './performance-tracking';
36
- import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
37
37
  export type ReactComponents = ReactElement<any> | ReactElement<any>[];
38
38
  type ExtensionProviders = (ExtensionProvider | Promise<ExtensionProvider>)[];
39
39
  type ExtensionProvidersWithEditorAction = (editorActions?: EditorActions) => ExtensionProviders;
@@ -32,7 +32,7 @@ type ScrollContainerRefs = {
32
32
  scrollContainer: HTMLDivElement | null;
33
33
  contentArea: HTMLDivElement | null;
34
34
  };
35
- export declare const FullPageContentArea: React.ForwardRefExoticComponent<Pick<import("react-intl-next").WithIntlProps<React.PropsWithChildren<FullPageEditorContentAreaProps & WrappedComponentProps<"intl"> & React.RefAttributes<ScrollContainerRefs>>>, "key" | "children" | keyof FullPageEditorContentAreaProps | "forwardedRef"> & React.RefAttributes<any>> & {
35
+ export declare const FullPageContentArea: React.ForwardRefExoticComponent<Pick<import("react-intl-next").WithIntlProps<React.PropsWithChildren<FullPageEditorContentAreaProps & WrappedComponentProps<"intl"> & React.RefAttributes<ScrollContainerRefs>>>, "key" | "children" | "forwardedRef" | keyof FullPageEditorContentAreaProps> & React.RefAttributes<any>> & {
36
36
  WrappedComponent: React.ComponentType<FullPageEditorContentAreaProps & WrappedComponentProps<"intl"> & React.RefAttributes<ScrollContainerRefs>>;
37
37
  };
38
38
  export {};