@atlaskit/editor-core 189.1.11 → 189.1.13

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 (135) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/plugins/index.js +0 -14
  3. package/dist/cjs/plugins/insert-block/index.js +6 -10
  4. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +40 -38
  5. package/dist/cjs/presets/universal.js +4 -2
  6. package/dist/cjs/ui/ContentStyles/index.js +1 -1
  7. package/dist/cjs/version-wrapper.js +1 -1
  8. package/dist/es2019/plugins/index.js +0 -2
  9. package/dist/es2019/plugins/insert-block/index.js +5 -9
  10. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +4 -3
  11. package/dist/es2019/presets/universal.js +3 -1
  12. package/dist/es2019/ui/ContentStyles/index.js +1 -1
  13. package/dist/es2019/version-wrapper.js +1 -1
  14. package/dist/esm/plugins/index.js +0 -2
  15. package/dist/esm/plugins/insert-block/index.js +5 -9
  16. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +40 -38
  17. package/dist/esm/presets/universal.js +3 -1
  18. package/dist/esm/ui/ContentStyles/index.js +1 -1
  19. package/dist/esm/version-wrapper.js +1 -1
  20. package/dist/types/plugins/index.d.ts +0 -2
  21. package/dist/types/plugins/insert-block/types.d.ts +4 -2
  22. package/dist/types/types/editor-props.d.ts +2 -2
  23. package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
  24. package/dist/types-ts4.5/plugins/index.d.ts +0 -2
  25. package/dist/types-ts4.5/plugins/insert-block/types.d.ts +4 -2
  26. package/dist/types-ts4.5/types/editor-props.d.ts +2 -2
  27. package/dist/types-ts4.5/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
  28. package/package.json +4 -2
  29. package/report.api.md +2 -16
  30. package/tmp/api-report-tmp.d.ts +2 -16
  31. package/dist/cjs/plugins/layout/actions.js +0 -345
  32. package/dist/cjs/plugins/layout/index.js +0 -91
  33. package/dist/cjs/plugins/layout/pm-plugins/main.js +0 -148
  34. package/dist/cjs/plugins/layout/pm-plugins/plugin-key.js +0 -8
  35. package/dist/cjs/plugins/layout/pm-plugins/types.js +0 -5
  36. package/dist/cjs/plugins/layout/toolbar-messages.js +0 -39
  37. package/dist/cjs/plugins/layout/toolbar.js +0 -116
  38. package/dist/cjs/plugins/layout/types.js +0 -5
  39. package/dist/cjs/plugins/placeholder-text/actions.js +0 -35
  40. package/dist/cjs/plugins/placeholder-text/fake-text-cursor/cursor.js +0 -107
  41. package/dist/cjs/plugins/placeholder-text/index.js +0 -20
  42. package/dist/cjs/plugins/placeholder-text/placeholder-text-nodeview.js +0 -89
  43. package/dist/cjs/plugins/placeholder-text/plugin-key.js +0 -8
  44. package/dist/cjs/plugins/placeholder-text/plugin.js +0 -267
  45. package/dist/cjs/plugins/placeholder-text/selection-utils.js +0 -14
  46. package/dist/cjs/plugins/placeholder-text/styles.js +0 -13
  47. package/dist/cjs/plugins/placeholder-text/types.js +0 -5
  48. package/dist/cjs/plugins/placeholder-text/ui/FloatingToolbar/index.js +0 -86
  49. package/dist/cjs/plugins/placeholder-text/ui/FloatingToolbar/styles.js +0 -15
  50. package/dist/cjs/plugins/placeholder-text/ui/FloatingToolbar/utils.js +0 -54
  51. package/dist/cjs/plugins/placeholder-text/ui/PlaceholderFloatingToolbar/index.js +0 -89
  52. package/dist/es2019/plugins/layout/actions.js +0 -328
  53. package/dist/es2019/plugins/layout/index.js +0 -75
  54. package/dist/es2019/plugins/layout/pm-plugins/main.js +0 -142
  55. package/dist/es2019/plugins/layout/pm-plugins/plugin-key.js +0 -2
  56. package/dist/es2019/plugins/layout/pm-plugins/types.js +0 -1
  57. package/dist/es2019/plugins/layout/toolbar-messages.js +0 -33
  58. package/dist/es2019/plugins/layout/toolbar.js +0 -101
  59. package/dist/es2019/plugins/layout/types.js +0 -1
  60. package/dist/es2019/plugins/placeholder-text/actions.js +0 -27
  61. package/dist/es2019/plugins/placeholder-text/fake-text-cursor/cursor.js +0 -77
  62. package/dist/es2019/plugins/placeholder-text/index.js +0 -2
  63. package/dist/es2019/plugins/placeholder-text/placeholder-text-nodeview.js +0 -77
  64. package/dist/es2019/plugins/placeholder-text/plugin-key.js +0 -2
  65. package/dist/es2019/plugins/placeholder-text/plugin.js +0 -247
  66. package/dist/es2019/plugins/placeholder-text/selection-utils.js +0 -8
  67. package/dist/es2019/plugins/placeholder-text/styles.js +0 -52
  68. package/dist/es2019/plugins/placeholder-text/types.js +0 -1
  69. package/dist/es2019/plugins/placeholder-text/ui/FloatingToolbar/index.js +0 -45
  70. package/dist/es2019/plugins/placeholder-text/ui/FloatingToolbar/styles.js +0 -15
  71. package/dist/es2019/plugins/placeholder-text/ui/FloatingToolbar/utils.js +0 -41
  72. package/dist/es2019/plugins/placeholder-text/ui/PlaceholderFloatingToolbar/index.js +0 -60
  73. package/dist/esm/plugins/layout/actions.js +0 -336
  74. package/dist/esm/plugins/layout/index.js +0 -79
  75. package/dist/esm/plugins/layout/pm-plugins/main.js +0 -141
  76. package/dist/esm/plugins/layout/pm-plugins/plugin-key.js +0 -2
  77. package/dist/esm/plugins/layout/pm-plugins/types.js +0 -1
  78. package/dist/esm/plugins/layout/toolbar-messages.js +0 -33
  79. package/dist/esm/plugins/layout/toolbar.js +0 -109
  80. package/dist/esm/plugins/layout/types.js +0 -1
  81. package/dist/esm/plugins/placeholder-text/actions.js +0 -29
  82. package/dist/esm/plugins/placeholder-text/fake-text-cursor/cursor.js +0 -100
  83. package/dist/esm/plugins/placeholder-text/index.js +0 -2
  84. package/dist/esm/plugins/placeholder-text/placeholder-text-nodeview.js +0 -82
  85. package/dist/esm/plugins/placeholder-text/plugin-key.js +0 -2
  86. package/dist/esm/plugins/placeholder-text/plugin.js +0 -259
  87. package/dist/esm/plugins/placeholder-text/selection-utils.js +0 -8
  88. package/dist/esm/plugins/placeholder-text/styles.js +0 -6
  89. package/dist/esm/plugins/placeholder-text/types.js +0 -1
  90. package/dist/esm/plugins/placeholder-text/ui/FloatingToolbar/index.js +0 -63
  91. package/dist/esm/plugins/placeholder-text/ui/FloatingToolbar/styles.js +0 -8
  92. package/dist/esm/plugins/placeholder-text/ui/FloatingToolbar/utils.js +0 -48
  93. package/dist/esm/plugins/placeholder-text/ui/PlaceholderFloatingToolbar/index.js +0 -79
  94. package/dist/types/plugins/layout/actions.d.ts +0 -22
  95. package/dist/types/plugins/layout/index.d.ts +0 -15
  96. package/dist/types/plugins/layout/pm-plugins/main.d.ts +0 -6
  97. package/dist/types/plugins/layout/pm-plugins/plugin-key.d.ts +0 -3
  98. package/dist/types/plugins/layout/pm-plugins/types.d.ts +0 -14
  99. package/dist/types/plugins/layout/toolbar-messages.d.ts +0 -32
  100. package/dist/types/plugins/layout/toolbar.d.ts +0 -6
  101. package/dist/types/plugins/layout/types.d.ts +0 -13
  102. package/dist/types/plugins/placeholder-text/actions.d.ts +0 -4
  103. package/dist/types/plugins/placeholder-text/fake-text-cursor/cursor.d.ts +0 -30
  104. package/dist/types/plugins/placeholder-text/index.d.ts +0 -3
  105. package/dist/types/plugins/placeholder-text/placeholder-text-nodeview.d.ts +0 -17
  106. package/dist/types/plugins/placeholder-text/plugin-key.d.ts +0 -3
  107. package/dist/types/plugins/placeholder-text/plugin.d.ts +0 -7
  108. package/dist/types/plugins/placeholder-text/selection-utils.d.ts +0 -2
  109. package/dist/types/plugins/placeholder-text/styles.d.ts +0 -1
  110. package/dist/types/plugins/placeholder-text/types.d.ts +0 -18
  111. package/dist/types/plugins/placeholder-text/ui/FloatingToolbar/index.d.ts +0 -28
  112. package/dist/types/plugins/placeholder-text/ui/FloatingToolbar/styles.d.ts +0 -1
  113. package/dist/types/plugins/placeholder-text/ui/FloatingToolbar/utils.d.ts +0 -13
  114. package/dist/types/plugins/placeholder-text/ui/PlaceholderFloatingToolbar/index.d.ts +0 -25
  115. package/dist/types-ts4.5/plugins/layout/actions.d.ts +0 -22
  116. package/dist/types-ts4.5/plugins/layout/index.d.ts +0 -18
  117. package/dist/types-ts4.5/plugins/layout/pm-plugins/main.d.ts +0 -6
  118. package/dist/types-ts4.5/plugins/layout/pm-plugins/plugin-key.d.ts +0 -3
  119. package/dist/types-ts4.5/plugins/layout/pm-plugins/types.d.ts +0 -14
  120. package/dist/types-ts4.5/plugins/layout/toolbar-messages.d.ts +0 -32
  121. package/dist/types-ts4.5/plugins/layout/toolbar.d.ts +0 -6
  122. package/dist/types-ts4.5/plugins/layout/types.d.ts +0 -13
  123. package/dist/types-ts4.5/plugins/placeholder-text/actions.d.ts +0 -4
  124. package/dist/types-ts4.5/plugins/placeholder-text/fake-text-cursor/cursor.d.ts +0 -30
  125. package/dist/types-ts4.5/plugins/placeholder-text/index.d.ts +0 -3
  126. package/dist/types-ts4.5/plugins/placeholder-text/placeholder-text-nodeview.d.ts +0 -17
  127. package/dist/types-ts4.5/plugins/placeholder-text/plugin-key.d.ts +0 -3
  128. package/dist/types-ts4.5/plugins/placeholder-text/plugin.d.ts +0 -7
  129. package/dist/types-ts4.5/plugins/placeholder-text/selection-utils.d.ts +0 -2
  130. package/dist/types-ts4.5/plugins/placeholder-text/styles.d.ts +0 -1
  131. package/dist/types-ts4.5/plugins/placeholder-text/types.d.ts +0 -18
  132. package/dist/types-ts4.5/plugins/placeholder-text/ui/FloatingToolbar/index.d.ts +0 -28
  133. package/dist/types-ts4.5/plugins/placeholder-text/ui/FloatingToolbar/styles.d.ts +0 -1
  134. package/dist/types-ts4.5/plugins/placeholder-text/ui/FloatingToolbar/utils.d.ts +0 -13
  135. package/dist/types-ts4.5/plugins/placeholder-text/ui/PlaceholderFloatingToolbar/index.d.ts +0 -25
@@ -1,8 +0,0 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2;
3
- import { css } from '@emotion/react';
4
- import { borderRadius } from '@atlaskit/theme/constants';
5
- import { N0, N50A, N60A } from '@atlaskit/theme/colors';
6
- export var container = function container(height) {
7
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-radius: ", "px;\n box-shadow: ", ";\n display: flex;\n align-items: center;\n box-sizing: border-box;\n padding: ", " ", ";\n background-color: ", ";\n ", ";\n"])), borderRadius(), "var(--ds-shadow-overlay, ".concat("0 12px 24px -6px ".concat(N50A, ", 0 0 1px ").concat(N60A), ")"), "var(--ds-space-050, 4px)", "var(--ds-space-100, 8px)", "var(--ds-background-input, ".concat(N0, ")"), height ? css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: ", "px;\n "])), height) : '');
8
- };
@@ -1,48 +0,0 @@
1
- var getCursorHeightFrom = function getCursorHeightFrom(node) {
2
- return parseFloat(window.getComputedStyle(node, undefined).lineHeight || '');
3
- };
4
- export var getOffsetParent = function getOffsetParent(editorViewDom, popupsMountPoint) {
5
- return popupsMountPoint ? popupsMountPoint.offsetParent : editorViewDom.offsetParent;
6
- };
7
- export var getNearestNonTextNode = function getNearestNonTextNode(node) {
8
- return node.nodeType === Node.TEXT_NODE ? node.parentNode : node;
9
- };
10
-
11
- /**
12
- * We need to translate the co-ordinates because `coordsAtPos` returns co-ordinates
13
- * relative to `window`. And, also need to adjust the cursor container height.
14
- * (0, 0)
15
- * +--------------------- [window] ---------------------+
16
- * | (left, top) +-------- [Offset Parent] --------+ |
17
- * | {coordsAtPos} | [Cursor] <- cursorHeight | |
18
- * | | [FloatingToolbar] | |
19
- */
20
- var convertFixedCoordinatesToAbsolutePositioning = function convertFixedCoordinatesToAbsolutePositioning(coordinates, offsetParent, cursorHeight) {
21
- var _offsetParent$getBoun = offsetParent.getBoundingClientRect(),
22
- offsetParentLeft = _offsetParent$getBoun.left,
23
- offsetParentTop = _offsetParent$getBoun.top,
24
- offsetParentHeight = _offsetParent$getBoun.height;
25
- return {
26
- left: coordinates.left - offsetParentLeft,
27
- right: coordinates.right - offsetParentLeft,
28
- top: coordinates.top - (offsetParentTop - cursorHeight) + offsetParent.scrollTop,
29
- bottom: offsetParentHeight - (coordinates.top - (offsetParentTop - cursorHeight) - offsetParent.scrollTop)
30
- };
31
- };
32
- export var handlePositionCalculatedWith = function handlePositionCalculatedWith(offsetParent, node, getCurrentFixedCoordinates) {
33
- return function (position) {
34
- if (!offsetParent) {
35
- return position;
36
- }
37
- var target = getNearestNonTextNode(node);
38
- var cursorHeight = getCursorHeightFrom(target);
39
- var fixedCoordinates = getCurrentFixedCoordinates();
40
- var absoluteCoordinates = convertFixedCoordinatesToAbsolutePositioning(fixedCoordinates, offsetParent, cursorHeight);
41
- return {
42
- left: position.left ? absoluteCoordinates.left : undefined,
43
- right: position.right ? absoluteCoordinates.right : undefined,
44
- top: position.top ? absoluteCoordinates.top : undefined,
45
- bottom: position.bottom ? absoluteCoordinates.bottom : undefined
46
- };
47
- };
48
- };
@@ -1,79 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
- import _inherits from "@babel/runtime/helpers/inherits";
5
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
- import React from 'react';
11
- import { defineMessages, injectIntl } from 'react-intl-next';
12
- import { PanelTextInput } from '@atlaskit/editor-common/ui';
13
- import FloatingToolbar, { handlePositionCalculatedWith, getOffsetParent, getNearestNonTextNode } from '../FloatingToolbar';
14
- export var messages = defineMessages({
15
- placeholderTextPlaceholder: {
16
- id: 'fabric.editor.placeholderTextPlaceholder',
17
- defaultMessage: 'Add placeholder text',
18
- description: ''
19
- }
20
- });
21
- var PlaceholderFloatingToolbar = /*#__PURE__*/function (_React$Component) {
22
- _inherits(PlaceholderFloatingToolbar, _React$Component);
23
- var _super = _createSuper(PlaceholderFloatingToolbar);
24
- function PlaceholderFloatingToolbar() {
25
- var _this;
26
- _classCallCheck(this, PlaceholderFloatingToolbar);
27
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
28
- args[_key] = arguments[_key];
29
- }
30
- _this = _super.call.apply(_super, [this].concat(args));
31
- _defineProperty(_assertThisInitialized(_this), "handleSubmit", function (value) {
32
- if (value) {
33
- _this.props.insertPlaceholder(value);
34
- _this.props.setFocusInEditor();
35
- } else {
36
- _this.props.hidePlaceholderFloatingToolbar();
37
- }
38
- });
39
- _defineProperty(_assertThisInitialized(_this), "handleBlur", function () {
40
- _this.props.hidePlaceholderFloatingToolbar();
41
- });
42
- return _this;
43
- }
44
- _createClass(PlaceholderFloatingToolbar, [{
45
- key: "render",
46
- value: function render() {
47
- var _this$props = this.props,
48
- getNodeFromPos = _this$props.getNodeFromPos,
49
- showInsertPanelAt = _this$props.showInsertPanelAt,
50
- editorViewDOM = _this$props.editorViewDOM,
51
- popupsMountPoint = _this$props.popupsMountPoint,
52
- getFixedCoordinatesFromPos = _this$props.getFixedCoordinatesFromPos,
53
- popupsBoundariesElement = _this$props.popupsBoundariesElement,
54
- formatMessage = _this$props.intl.formatMessage;
55
- var target = getNodeFromPos(showInsertPanelAt);
56
- var offsetParent = getOffsetParent(editorViewDOM, popupsMountPoint);
57
- var getFixedCoordinates = function getFixedCoordinates() {
58
- return getFixedCoordinatesFromPos(showInsertPanelAt);
59
- };
60
- var handlePositionCalculated = handlePositionCalculatedWith(offsetParent, target, getFixedCoordinates);
61
- return /*#__PURE__*/React.createElement(FloatingToolbar, {
62
- target: getNearestNonTextNode(target),
63
- onPositionCalculated: handlePositionCalculated,
64
- popupsMountPoint: popupsMountPoint,
65
- popupsBoundariesElement: popupsBoundariesElement,
66
- fitHeight: 32,
67
- offset: [0, 12]
68
- }, /*#__PURE__*/React.createElement(PanelTextInput, {
69
- placeholder: formatMessage(messages.placeholderTextPlaceholder),
70
- onSubmit: this.handleSubmit,
71
- onBlur: this.handleBlur,
72
- autoFocus: true,
73
- width: 300
74
- }));
75
- }
76
- }]);
77
- return PlaceholderFloatingToolbar;
78
- }(React.Component);
79
- export default injectIntl(PlaceholderFloatingToolbar);
@@ -1,22 +0,0 @@
1
- import type { Node } from '@atlaskit/editor-prosemirror/model';
2
- import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
3
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
- import type { Change, PresetLayout } from './types';
5
- import type { TOOLBAR_MENU_TYPE, Command } from '@atlaskit/editor-common/types';
6
- export declare const ONE_COL_LAYOUTS: PresetLayout[];
7
- export declare const TWO_COL_LAYOUTS: PresetLayout[];
8
- export declare const THREE_COL_LAYOUTS: PresetLayout[];
9
- /**
10
- * Finds layout preset based on the width attrs of all the layoutColumn nodes
11
- * inside the layoutSection node
12
- */
13
- export declare const getPresetLayout: (section: Node) => PresetLayout | undefined;
14
- export declare const getSelectedLayout: (maybeLayoutSection: Node | undefined, current: PresetLayout) => PresetLayout;
15
- export declare const createDefaultLayoutSection: (state: EditorState) => Node;
16
- export declare const insertLayoutColumns: Command;
17
- export declare const insertLayoutColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: TOOLBAR_MENU_TYPE) => Command;
18
- export declare function forceSectionToPresetLayout(state: EditorState, node: Node, pos: number, presetLayout: PresetLayout): Transaction;
19
- export declare const setPresetLayout: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (layout: PresetLayout) => Command;
20
- export declare const fixColumnSizes: (changedTr: Transaction, state: EditorState) => Change | undefined;
21
- export declare const fixColumnStructure: (state: EditorState) => Transaction | undefined;
22
- export declare const deleteActiveLayoutNode: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
@@ -1,15 +0,0 @@
1
- import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
- import { insertLayoutColumnsWithAnalytics } from './actions';
3
- import { pluginKey } from './pm-plugins/plugin-key';
4
- import type { LayoutPluginOptions } from './types';
5
- import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
6
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
7
- export { pluginKey };
8
- export type LayoutPlugin = NextEditorPlugin<'layout', {
9
- pluginConfiguration: LayoutPluginOptions | undefined;
10
- dependencies: [DecorationsPlugin, OptionalPlugin<AnalyticsPlugin>];
11
- actions: {
12
- insertLayoutColumns: ReturnType<typeof insertLayoutColumnsWithAnalytics>;
13
- };
14
- }>;
15
- export declare const layoutPlugin: LayoutPlugin;
@@ -1,6 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { LayoutState } from './types';
3
- import type { LayoutPluginOptions } from '../types';
4
- export declare const DEFAULT_LAYOUT = "two_equal";
5
- declare const _default: (options: LayoutPluginOptions) => SafePlugin<LayoutState>;
6
- export default _default;
@@ -1,3 +0,0 @@
1
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
- import type { LayoutState } from './types';
3
- export declare const pluginKey: PluginKey<LayoutState>;
@@ -1,14 +0,0 @@
1
- import type { Slice } from '@atlaskit/editor-prosemirror/model';
2
- import type { PresetLayout } from '../types';
3
- export type LayoutState = {
4
- pos: number | null;
5
- allowBreakout: boolean;
6
- addSidebarLayouts: boolean;
7
- selectedLayout: PresetLayout | undefined;
8
- allowSingleColumnLayout: boolean;
9
- };
10
- export type Change = {
11
- from: number;
12
- to: number;
13
- slice: Slice;
14
- };
@@ -1,32 +0,0 @@
1
- export declare const toolbarMessages: {
2
- singleColumn: {
3
- id: string;
4
- defaultMessage: string;
5
- description: string;
6
- };
7
- twoColumns: {
8
- id: string;
9
- defaultMessage: string;
10
- description: string;
11
- };
12
- threeColumns: {
13
- id: string;
14
- defaultMessage: string;
15
- description: string;
16
- };
17
- rightSidebar: {
18
- id: string;
19
- defaultMessage: string;
20
- description: string;
21
- };
22
- leftSidebar: {
23
- id: string;
24
- defaultMessage: string;
25
- description: string;
26
- };
27
- threeColumnsWithSidebars: {
28
- id: string;
29
- defaultMessage: string;
30
- description: string;
31
- };
32
- };
@@ -1,6 +0,0 @@
1
- import type { IntlShape } from 'react-intl-next';
2
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
- import type { FloatingToolbarConfig, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
- import type { LayoutPlugin } from './';
5
- export declare const layoutToolbarTitle = "Layout floating controls";
6
- export declare const buildToolbar: (state: EditorState, intl: IntlShape, pos: number, _allowBreakout: boolean, addSidebarLayouts: boolean, allowSingleColumnLayout: boolean, api: ExtractInjectionAPI<LayoutPlugin> | undefined) => FloatingToolbarConfig | undefined;
@@ -1,13 +0,0 @@
1
- import type { Slice } from '@atlaskit/editor-prosemirror/model';
2
- import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
3
- export interface LayoutPluginOptions extends LongPressSelectionPluginOptions {
4
- allowBreakout?: boolean;
5
- UNSAFE_addSidebarLayouts?: boolean;
6
- UNSAFE_allowSingleColumnLayout?: boolean;
7
- }
8
- export type PresetLayout = 'single' | 'two_equal' | 'three_equal' | 'two_right_sidebar' | 'two_left_sidebar' | 'three_with_sidebars';
9
- export interface Change {
10
- from: number;
11
- to: number;
12
- slice: Slice;
13
- }
@@ -1,4 +0,0 @@
1
- import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
2
- export declare const showPlaceholderFloatingToolbar: (state: EditorState, dispatch: (tr: Transaction) => void) => boolean;
3
- export declare const insertPlaceholderTextAtSelection: (value: string) => (state: EditorState, dispatch: (tr: Transaction) => void) => boolean;
4
- export declare const hidePlaceholderFloatingToolbar: (state: EditorState, dispatch: (tr: Transaction) => void) => boolean;
@@ -1,30 +0,0 @@
1
- import type { EditorState, SelectionBookmark, Transaction } from '@atlaskit/editor-prosemirror/state';
2
- import { Selection } from '@atlaskit/editor-prosemirror/state';
3
- import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
4
- import type { Node, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
5
- import { Slice } from '@atlaskit/editor-prosemirror/model';
6
- import type { Mappable } from '@atlaskit/editor-prosemirror/transform';
7
- export declare class FakeTextCursorBookmark {
8
- pos: undefined | number;
9
- visible: boolean;
10
- constructor(pos: number);
11
- map(mapping: Mappable): FakeTextCursorBookmark;
12
- resolve(doc: Node): Selection;
13
- }
14
- export declare class FakeTextCursorSelection extends Selection {
15
- constructor($pos: ResolvedPos);
16
- map(doc: Node, mapping: Mappable): Selection;
17
- static content(): Slice;
18
- eq(other: Selection): boolean;
19
- toJSON(): {
20
- type: string;
21
- pos: number;
22
- };
23
- static fromJSON(doc: Node, json: {
24
- pos: number;
25
- }): Selection;
26
- getBookmark(): SelectionBookmark;
27
- }
28
- export declare const addFakeTextCursor: (state: EditorState, dispatch: (tr: Transaction) => void) => void;
29
- export declare const removeFakeTextCursor: (state: EditorState, dispatch: (tr: Transaction) => void) => void;
30
- export declare const drawFakeTextCursor: (state: EditorState) => DecorationSet | null;
@@ -1,3 +0,0 @@
1
- export { default as placeholderTextPlugin } from './plugin';
2
- export { FakeTextCursorSelection } from './fake-text-cursor/cursor';
3
- export type { PlaceholderTextPlugin, PlaceholderTextPluginState, PlaceholderTextOptions, } from './types';
@@ -1,17 +0,0 @@
1
- import type { NodeView, EditorView } from '@atlaskit/editor-prosemirror/view';
2
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
- import type { getPosHandler } from '@atlaskit/editor-common/react-node-view';
4
- type PmMutationRecord = MutationRecord | {
5
- type: 'selection';
6
- target: Element;
7
- };
8
- export declare class PlaceholderTextNodeView implements NodeView {
9
- private readonly node;
10
- private readonly view;
11
- private readonly getPos;
12
- readonly dom: Node;
13
- constructor(node: PMNode, view: EditorView, getPos: getPosHandler);
14
- stopEvent(e: Event): boolean;
15
- ignoreMutation(record: PmMutationRecord): boolean;
16
- }
17
- export {};
@@ -1,3 +0,0 @@
1
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
- import type { PlaceholderTextPluginState } from './types';
3
- export declare const pluginKey: PluginKey<PlaceholderTextPluginState>;
@@ -1,7 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
4
- import type { PlaceholderTextOptions, PlaceholderTextPlugin, PlaceholderTextPluginState } from './types';
5
- export declare function createPlugin(dispatch: Dispatch<PlaceholderTextPluginState>, options: PlaceholderTextOptions, api: ExtractInjectionAPI<PlaceholderTextPlugin> | undefined): SafePlugin | undefined;
6
- declare const placeholderTextPlugin: PlaceholderTextPlugin;
7
- export default placeholderTextPlugin;
@@ -1,2 +0,0 @@
1
- import type { Selection } from '@atlaskit/editor-prosemirror/state';
2
- export declare const isSelectionAtPlaceholder: (selection: Selection) => boolean;
@@ -1 +0,0 @@
1
- export declare const placeholderTextStyles: import("@emotion/react").SerializedStyles;
@@ -1,18 +0,0 @@
1
- import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
- import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
3
- import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
4
- export interface PlaceholderTextOptions {
5
- allowInserting?: boolean;
6
- }
7
- export interface PlaceholderTextPluginState {
8
- showInsertPanelAt: number | null;
9
- allowInserting: boolean;
10
- }
11
- export type PlaceholderTextPlugin = NextEditorPlugin<'placeholderText', {
12
- dependencies: [
13
- OptionalPlugin<typeof analyticsPlugin>,
14
- OptionalPlugin<TypeAheadPlugin>
15
- ];
16
- pluginConfiguration: PlaceholderTextOptions;
17
- sharedState: PlaceholderTextPluginState | undefined;
18
- }>;
@@ -1,28 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/react';
3
- import { PureComponent } from 'react';
4
- export type Coordinates = {
5
- left?: number;
6
- right?: number;
7
- top?: number;
8
- bottom?: number;
9
- };
10
- export type PositionOffset = Coordinates;
11
- export interface Props {
12
- zIndex?: number;
13
- className?: string;
14
- target?: HTMLElement;
15
- popupsMountPoint?: HTMLElement;
16
- popupsBoundariesElement?: HTMLElement;
17
- offset?: number[];
18
- fitWidth?: number;
19
- fitHeight?: number;
20
- absoluteOffset?: PositionOffset;
21
- alignX?: 'left' | 'center' | 'right';
22
- alignY?: 'bottom' | 'top';
23
- onPositionCalculated?: (position: Coordinates) => any;
24
- }
25
- export { handlePositionCalculatedWith, getOffsetParent, getNearestNonTextNode, } from './utils';
26
- export default class FloatingToolbar extends PureComponent<Props, any> {
27
- render(): jsx.JSX.Element | null;
28
- }
@@ -1 +0,0 @@
1
- export declare const container: (height?: number) => import("@emotion/react").SerializedStyles;
@@ -1,13 +0,0 @@
1
- export declare const getOffsetParent: (editorViewDom: HTMLElement, popupsMountPoint?: HTMLElement) => HTMLElement;
2
- export declare const getNearestNonTextNode: (node: Node) => HTMLElement;
3
- export declare const handlePositionCalculatedWith: (offsetParent: HTMLElement, node: Node, getCurrentFixedCoordinates: () => any) => (position: {
4
- top?: number;
5
- left?: number;
6
- bottom?: number;
7
- right?: number;
8
- }) => {
9
- top?: number | undefined;
10
- left?: number | undefined;
11
- bottom?: number | undefined;
12
- right?: number | undefined;
13
- };
@@ -1,25 +0,0 @@
1
- import React from 'react';
2
- import type { WrappedComponentProps } from 'react-intl-next';
3
- import type { Coordinates } from '../FloatingToolbar';
4
- export declare const messages: {
5
- placeholderTextPlaceholder: {
6
- id: string;
7
- defaultMessage: string;
8
- description: string;
9
- };
10
- };
11
- export interface Props {
12
- getNodeFromPos: (pos: number) => Node;
13
- getFixedCoordinatesFromPos: (pos: number) => Coordinates;
14
- insertPlaceholder: (value: string) => void;
15
- hidePlaceholderFloatingToolbar: () => void;
16
- setFocusInEditor: () => void;
17
- showInsertPanelAt: number;
18
- editorViewDOM: HTMLElement;
19
- popupsMountPoint?: HTMLElement;
20
- popupsBoundariesElement?: HTMLElement;
21
- }
22
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
23
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
24
- };
25
- export default _default;
@@ -1,22 +0,0 @@
1
- import type { Node } from '@atlaskit/editor-prosemirror/model';
2
- import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
3
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
- import type { Change, PresetLayout } from './types';
5
- import type { TOOLBAR_MENU_TYPE, Command } from '@atlaskit/editor-common/types';
6
- export declare const ONE_COL_LAYOUTS: PresetLayout[];
7
- export declare const TWO_COL_LAYOUTS: PresetLayout[];
8
- export declare const THREE_COL_LAYOUTS: PresetLayout[];
9
- /**
10
- * Finds layout preset based on the width attrs of all the layoutColumn nodes
11
- * inside the layoutSection node
12
- */
13
- export declare const getPresetLayout: (section: Node) => PresetLayout | undefined;
14
- export declare const getSelectedLayout: (maybeLayoutSection: Node | undefined, current: PresetLayout) => PresetLayout;
15
- export declare const createDefaultLayoutSection: (state: EditorState) => Node;
16
- export declare const insertLayoutColumns: Command;
17
- export declare const insertLayoutColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: TOOLBAR_MENU_TYPE) => Command;
18
- export declare function forceSectionToPresetLayout(state: EditorState, node: Node, pos: number, presetLayout: PresetLayout): Transaction;
19
- export declare const setPresetLayout: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (layout: PresetLayout) => Command;
20
- export declare const fixColumnSizes: (changedTr: Transaction, state: EditorState) => Change | undefined;
21
- export declare const fixColumnStructure: (state: EditorState) => Transaction | undefined;
22
- export declare const deleteActiveLayoutNode: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
@@ -1,18 +0,0 @@
1
- import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
- import { insertLayoutColumnsWithAnalytics } from './actions';
3
- import { pluginKey } from './pm-plugins/plugin-key';
4
- import type { LayoutPluginOptions } from './types';
5
- import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
6
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
7
- export { pluginKey };
8
- export type LayoutPlugin = NextEditorPlugin<'layout', {
9
- pluginConfiguration: LayoutPluginOptions | undefined;
10
- dependencies: [
11
- DecorationsPlugin,
12
- OptionalPlugin<AnalyticsPlugin>
13
- ];
14
- actions: {
15
- insertLayoutColumns: ReturnType<typeof insertLayoutColumnsWithAnalytics>;
16
- };
17
- }>;
18
- export declare const layoutPlugin: LayoutPlugin;
@@ -1,6 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { LayoutState } from './types';
3
- import type { LayoutPluginOptions } from '../types';
4
- export declare const DEFAULT_LAYOUT = "two_equal";
5
- declare const _default: (options: LayoutPluginOptions) => SafePlugin<LayoutState>;
6
- export default _default;
@@ -1,3 +0,0 @@
1
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
- import type { LayoutState } from './types';
3
- export declare const pluginKey: PluginKey<LayoutState>;
@@ -1,14 +0,0 @@
1
- import type { Slice } from '@atlaskit/editor-prosemirror/model';
2
- import type { PresetLayout } from '../types';
3
- export type LayoutState = {
4
- pos: number | null;
5
- allowBreakout: boolean;
6
- addSidebarLayouts: boolean;
7
- selectedLayout: PresetLayout | undefined;
8
- allowSingleColumnLayout: boolean;
9
- };
10
- export type Change = {
11
- from: number;
12
- to: number;
13
- slice: Slice;
14
- };
@@ -1,32 +0,0 @@
1
- export declare const toolbarMessages: {
2
- singleColumn: {
3
- id: string;
4
- defaultMessage: string;
5
- description: string;
6
- };
7
- twoColumns: {
8
- id: string;
9
- defaultMessage: string;
10
- description: string;
11
- };
12
- threeColumns: {
13
- id: string;
14
- defaultMessage: string;
15
- description: string;
16
- };
17
- rightSidebar: {
18
- id: string;
19
- defaultMessage: string;
20
- description: string;
21
- };
22
- leftSidebar: {
23
- id: string;
24
- defaultMessage: string;
25
- description: string;
26
- };
27
- threeColumnsWithSidebars: {
28
- id: string;
29
- defaultMessage: string;
30
- description: string;
31
- };
32
- };
@@ -1,6 +0,0 @@
1
- import type { IntlShape } from 'react-intl-next';
2
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
- import type { FloatingToolbarConfig, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
- import type { LayoutPlugin } from './';
5
- export declare const layoutToolbarTitle = "Layout floating controls";
6
- export declare const buildToolbar: (state: EditorState, intl: IntlShape, pos: number, _allowBreakout: boolean, addSidebarLayouts: boolean, allowSingleColumnLayout: boolean, api: ExtractInjectionAPI<LayoutPlugin> | undefined) => FloatingToolbarConfig | undefined;
@@ -1,13 +0,0 @@
1
- import type { Slice } from '@atlaskit/editor-prosemirror/model';
2
- import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
3
- export interface LayoutPluginOptions extends LongPressSelectionPluginOptions {
4
- allowBreakout?: boolean;
5
- UNSAFE_addSidebarLayouts?: boolean;
6
- UNSAFE_allowSingleColumnLayout?: boolean;
7
- }
8
- export type PresetLayout = 'single' | 'two_equal' | 'three_equal' | 'two_right_sidebar' | 'two_left_sidebar' | 'three_with_sidebars';
9
- export interface Change {
10
- from: number;
11
- to: number;
12
- slice: Slice;
13
- }
@@ -1,4 +0,0 @@
1
- import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
2
- export declare const showPlaceholderFloatingToolbar: (state: EditorState, dispatch: (tr: Transaction) => void) => boolean;
3
- export declare const insertPlaceholderTextAtSelection: (value: string) => (state: EditorState, dispatch: (tr: Transaction) => void) => boolean;
4
- export declare const hidePlaceholderFloatingToolbar: (state: EditorState, dispatch: (tr: Transaction) => void) => boolean;
@@ -1,30 +0,0 @@
1
- import type { EditorState, SelectionBookmark, Transaction } from '@atlaskit/editor-prosemirror/state';
2
- import { Selection } from '@atlaskit/editor-prosemirror/state';
3
- import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
4
- import type { Node, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
5
- import { Slice } from '@atlaskit/editor-prosemirror/model';
6
- import type { Mappable } from '@atlaskit/editor-prosemirror/transform';
7
- export declare class FakeTextCursorBookmark {
8
- pos: undefined | number;
9
- visible: boolean;
10
- constructor(pos: number);
11
- map(mapping: Mappable): FakeTextCursorBookmark;
12
- resolve(doc: Node): Selection;
13
- }
14
- export declare class FakeTextCursorSelection extends Selection {
15
- constructor($pos: ResolvedPos);
16
- map(doc: Node, mapping: Mappable): Selection;
17
- static content(): Slice;
18
- eq(other: Selection): boolean;
19
- toJSON(): {
20
- type: string;
21
- pos: number;
22
- };
23
- static fromJSON(doc: Node, json: {
24
- pos: number;
25
- }): Selection;
26
- getBookmark(): SelectionBookmark;
27
- }
28
- export declare const addFakeTextCursor: (state: EditorState, dispatch: (tr: Transaction) => void) => void;
29
- export declare const removeFakeTextCursor: (state: EditorState, dispatch: (tr: Transaction) => void) => void;
30
- export declare const drawFakeTextCursor: (state: EditorState) => DecorationSet | null;
@@ -1,3 +0,0 @@
1
- export { default as placeholderTextPlugin } from './plugin';
2
- export { FakeTextCursorSelection } from './fake-text-cursor/cursor';
3
- export type { PlaceholderTextPlugin, PlaceholderTextPluginState, PlaceholderTextOptions, } from './types';
@@ -1,17 +0,0 @@
1
- import type { NodeView, EditorView } from '@atlaskit/editor-prosemirror/view';
2
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
- import type { getPosHandler } from '@atlaskit/editor-common/react-node-view';
4
- type PmMutationRecord = MutationRecord | {
5
- type: 'selection';
6
- target: Element;
7
- };
8
- export declare class PlaceholderTextNodeView implements NodeView {
9
- private readonly node;
10
- private readonly view;
11
- private readonly getPos;
12
- readonly dom: Node;
13
- constructor(node: PMNode, view: EditorView, getPos: getPosHandler);
14
- stopEvent(e: Event): boolean;
15
- ignoreMutation(record: PmMutationRecord): boolean;
16
- }
17
- export {};
@@ -1,3 +0,0 @@
1
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
- import type { PlaceholderTextPluginState } from './types';
3
- export declare const pluginKey: PluginKey<PlaceholderTextPluginState>;