@atlaskit/editor-core 190.1.6 → 190.1.7

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 (76) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/plugins/index.js +0 -21
  3. package/dist/cjs/presets/universal.js +0 -15
  4. package/dist/cjs/ui/AppearanceComponents/Mobile.js +3 -0
  5. package/dist/cjs/version-wrapper.js +1 -1
  6. package/dist/es2019/plugins/index.js +0 -3
  7. package/dist/es2019/presets/universal.js +1 -16
  8. package/dist/es2019/ui/AppearanceComponents/Mobile.js +4 -0
  9. package/dist/es2019/version-wrapper.js +1 -1
  10. package/dist/esm/plugins/index.js +0 -3
  11. package/dist/esm/presets/universal.js +1 -16
  12. package/dist/esm/ui/AppearanceComponents/Mobile.js +4 -0
  13. package/dist/esm/version-wrapper.js +1 -1
  14. package/dist/types/plugins/index.d.ts +0 -3
  15. package/dist/types-ts4.5/plugins/index.d.ts +0 -3
  16. package/package.json +1 -1
  17. package/dist/cjs/plugins/mobile-dimensions/actions.js +0 -12
  18. package/dist/cjs/plugins/mobile-dimensions/commands.js +0 -26
  19. package/dist/cjs/plugins/mobile-dimensions/index.js +0 -99
  20. package/dist/cjs/plugins/mobile-dimensions/plugin-factory.js +0 -15
  21. package/dist/cjs/plugins/mobile-dimensions/reducer.js +0 -28
  22. package/dist/cjs/plugins/mobile-dimensions/types.js +0 -5
  23. package/dist/cjs/plugins/mobile-selection/content-in-selection.js +0 -24
  24. package/dist/cjs/plugins/mobile-selection/index.js +0 -18
  25. package/dist/cjs/plugins/mobile-selection/mobile-selection-plugin.js +0 -59
  26. package/dist/cjs/plugins/mobile-selection/types.js +0 -5
  27. package/dist/cjs/plugins/view-update-subscription/index.js +0 -90
  28. package/dist/cjs/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.js +0 -109
  29. package/dist/es2019/plugins/mobile-dimensions/actions.js +0 -6
  30. package/dist/es2019/plugins/mobile-dimensions/commands.js +0 -14
  31. package/dist/es2019/plugins/mobile-dimensions/index.js +0 -88
  32. package/dist/es2019/plugins/mobile-dimensions/plugin-factory.js +0 -9
  33. package/dist/es2019/plugins/mobile-dimensions/reducer.js +0 -21
  34. package/dist/es2019/plugins/mobile-dimensions/types.js +0 -1
  35. package/dist/es2019/plugins/mobile-selection/content-in-selection.js +0 -17
  36. package/dist/es2019/plugins/mobile-selection/index.js +0 -1
  37. package/dist/es2019/plugins/mobile-selection/mobile-selection-plugin.js +0 -53
  38. package/dist/es2019/plugins/mobile-selection/types.js +0 -1
  39. package/dist/es2019/plugins/view-update-subscription/index.js +0 -73
  40. package/dist/es2019/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.js +0 -106
  41. package/dist/esm/plugins/mobile-dimensions/actions.js +0 -6
  42. package/dist/esm/plugins/mobile-dimensions/commands.js +0 -20
  43. package/dist/esm/plugins/mobile-dimensions/index.js +0 -93
  44. package/dist/esm/plugins/mobile-dimensions/plugin-factory.js +0 -9
  45. package/dist/esm/plugins/mobile-dimensions/reducer.js +0 -21
  46. package/dist/esm/plugins/mobile-dimensions/types.js +0 -1
  47. package/dist/esm/plugins/mobile-selection/content-in-selection.js +0 -18
  48. package/dist/esm/plugins/mobile-selection/index.js +0 -1
  49. package/dist/esm/plugins/mobile-selection/mobile-selection-plugin.js +0 -53
  50. package/dist/esm/plugins/mobile-selection/types.js +0 -1
  51. package/dist/esm/plugins/view-update-subscription/index.js +0 -83
  52. package/dist/esm/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.js +0 -103
  53. package/dist/types/plugins/mobile-dimensions/actions.d.ts +0 -18
  54. package/dist/types/plugins/mobile-dimensions/commands.d.ts +0 -3
  55. package/dist/types/plugins/mobile-dimensions/index.d.ts +0 -7
  56. package/dist/types/plugins/mobile-dimensions/plugin-factory.d.ts +0 -5
  57. package/dist/types/plugins/mobile-dimensions/reducer.d.ts +0 -3
  58. package/dist/types/plugins/mobile-dimensions/types.d.ts +0 -8
  59. package/dist/types/plugins/mobile-selection/content-in-selection.d.ts +0 -5
  60. package/dist/types/plugins/mobile-selection/index.d.ts +0 -2
  61. package/dist/types/plugins/mobile-selection/mobile-selection-plugin.d.ts +0 -7
  62. package/dist/types/plugins/mobile-selection/types.d.ts +0 -32
  63. package/dist/types/plugins/view-update-subscription/index.d.ts +0 -19
  64. package/dist/types/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.d.ts +0 -12
  65. package/dist/types-ts4.5/plugins/mobile-dimensions/actions.d.ts +0 -18
  66. package/dist/types-ts4.5/plugins/mobile-dimensions/commands.d.ts +0 -3
  67. package/dist/types-ts4.5/plugins/mobile-dimensions/index.d.ts +0 -7
  68. package/dist/types-ts4.5/plugins/mobile-dimensions/plugin-factory.d.ts +0 -5
  69. package/dist/types-ts4.5/plugins/mobile-dimensions/reducer.d.ts +0 -3
  70. package/dist/types-ts4.5/plugins/mobile-dimensions/types.d.ts +0 -8
  71. package/dist/types-ts4.5/plugins/mobile-selection/content-in-selection.d.ts +0 -5
  72. package/dist/types-ts4.5/plugins/mobile-selection/index.d.ts +0 -2
  73. package/dist/types-ts4.5/plugins/mobile-selection/mobile-selection-plugin.d.ts +0 -7
  74. package/dist/types-ts4.5/plugins/mobile-selection/types.d.ts +0 -32
  75. package/dist/types-ts4.5/plugins/view-update-subscription/index.d.ts +0 -19
  76. package/dist/types-ts4.5/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.d.ts +0 -12
@@ -1,93 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { setWindowHeight } from './commands';
3
- import { createPluginState, mobileDimensionsPluginKey } from './plugin-factory';
4
- var getInitialState = function getInitialState() {
5
- return {
6
- mobilePaddingTop: 0,
7
- windowHeight: window.innerHeight,
8
- isExpanded: false
9
- };
10
- };
11
-
12
- /**
13
- * Plugin to store the dimensions of the mobile such as keyboard height and window size
14
- */
15
-
16
- var createPlugin = function createPlugin(dispatch) {
17
- var rafId;
18
- return new SafePlugin({
19
- state: createPluginState(dispatch, getInitialState),
20
- key: mobileDimensionsPluginKey,
21
- props: {
22
- scrollThreshold: {
23
- top: 12,
24
- left: 0,
25
- right: 0,
26
- bottom: 12
27
- },
28
- scrollMargin: {
29
- top: 12,
30
- bottom: 12,
31
- left: 0,
32
- right: 0
33
- }
34
- },
35
- view: function view(editorView) {
36
- var handleResize = function handleResize() {
37
- if (rafId) {
38
- window.cancelAnimationFrame(rafId);
39
- }
40
- var windowInnerHeight = window.innerHeight;
41
- var count = 0;
42
- var checkWindowHeight = function checkWindowHeight() {
43
- // wait for height to stabilise before we commit to set it
44
- // this helps handle menu transitions in Android which we don't want to scroll for
45
- if (window.innerHeight === windowInnerHeight) {
46
- count++;
47
- if (count >= 5) {
48
- rafId = undefined;
49
- setWindowHeight(window.innerHeight)(editorView.state, editorView.dispatch);
50
- } else {
51
- rafId = requestAnimationFrame(checkWindowHeight);
52
- }
53
- } else {
54
- rafId = requestAnimationFrame(checkWindowHeight);
55
- }
56
- windowInnerHeight = window.innerHeight;
57
- };
58
- rafId = requestAnimationFrame(checkWindowHeight);
59
- };
60
- // the window will resize on Android when the keyboard shows/hides
61
- window.addEventListener('resize', handleResize);
62
- return {
63
- destroy: function destroy() {
64
- window.removeEventListener('resize', handleResize);
65
- if (rafId) {
66
- window.cancelAnimationFrame(rafId);
67
- }
68
- }
69
- };
70
- }
71
- });
72
- };
73
- var mobileDimensionsPlugin = function mobileDimensionsPlugin() {
74
- return {
75
- name: 'mobileDimensions',
76
- getSharedState: function getSharedState(editorState) {
77
- if (!editorState) {
78
- return undefined;
79
- }
80
- return mobileDimensionsPluginKey.getState(editorState);
81
- },
82
- pmPlugins: function pmPlugins() {
83
- return [{
84
- name: 'mobileDimensions',
85
- plugin: function plugin(_ref) {
86
- var dispatch = _ref.dispatch;
87
- return createPlugin(dispatch);
88
- }
89
- }];
90
- }
91
- };
92
- };
93
- export default mobileDimensionsPlugin;
@@ -1,9 +0,0 @@
1
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
- import { pluginFactory } from '../../utils/plugin-state-factory';
3
- import reducer from './reducer';
4
- export var mobileDimensionsPluginKey = new PluginKey('mobileDimensions');
5
- var _pluginFactory = pluginFactory(mobileDimensionsPluginKey, reducer),
6
- createPluginState = _pluginFactory.createPluginState,
7
- getPluginState = _pluginFactory.getPluginState,
8
- createCommand = _pluginFactory.createCommand;
9
- export { createPluginState, getPluginState, createCommand };
@@ -1,21 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- 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; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- import { MobileDimensionsActionTypes } from './actions';
5
- export default function (state, action) {
6
- switch (action.type) {
7
- case MobileDimensionsActionTypes.SET_WINDOW_HEIGHT:
8
- return _objectSpread(_objectSpread({}, state), {}, {
9
- windowHeight: action.windowHeight
10
- });
11
- case MobileDimensionsActionTypes.SET_MOBILE_PADDING_TOP:
12
- return _objectSpread(_objectSpread({}, state), {}, {
13
- mobilePaddingTop: action.paddingTop
14
- });
15
- case MobileDimensionsActionTypes.SET_IS_EXPANDED:
16
- return _objectSpread(_objectSpread({}, state), {}, {
17
- isExpanded: action.isExpanded
18
- });
19
- }
20
- return state;
21
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,18 +0,0 @@
1
- // Gets a plain text representation of the nodes in the current selection
2
- export var contentInSelection = function contentInSelection(_ref) {
3
- var selection = _ref.selection,
4
- doc = _ref.doc;
5
- var nodes = new Array();
6
- var marks = new Array();
7
- doc.nodesBetween(selection.from, selection.to, function (node) {
8
- nodes.push(node.type.name);
9
- node.marks.forEach(function (mark) {
10
- return marks.push(mark.type.name);
11
- });
12
- return true;
13
- });
14
- return {
15
- nodeTypes: Array.from(nodes),
16
- markTypes: Array.from(marks)
17
- };
18
- };
@@ -1 +0,0 @@
1
- export { mobileSelectionPlugin as default, selectionPluginKey } from './mobile-selection-plugin';
@@ -1,53 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
- import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
4
- import { contentInSelection } from './content-in-selection';
5
- export var selectionPluginKey = new PluginKey('mobile-selection');
6
- export var createProseMirrorPlugin = function createProseMirrorPlugin(dispatch) {
7
- return new SafePlugin({
8
- view: function view(editorView) {
9
- var domAtPos = editorView.domAtPos.bind(editorView);
10
- return {
11
- update: function update(view, previousState) {
12
- var state = view.state,
13
- _view$state = view.state,
14
- selection = _view$state.selection,
15
- doc = _view$state.doc;
16
- if (previousState.doc.eq(doc) && previousState.selection.eq(selection)) {
17
- return;
18
- }
19
- var ref = findDomRefAtPos(selection.$anchor.pos, domAtPos);
20
- var _ref$getBoundingClien = ref.getBoundingClientRect(),
21
- top = _ref$getBoundingClien.top,
22
- left = _ref$getBoundingClien.left;
23
- var _contentInSelection = contentInSelection(state),
24
- nodeTypes = _contentInSelection.nodeTypes,
25
- markTypes = _contentInSelection.markTypes;
26
- dispatch(selectionPluginKey, {
27
- rect: {
28
- top: Math.round(top),
29
- left: Math.round(left)
30
- },
31
- selection: state.selection.toJSON(),
32
- nodeTypes: nodeTypes,
33
- markTypes: markTypes
34
- });
35
- }
36
- };
37
- }
38
- });
39
- };
40
- export var mobileSelectionPlugin = function mobileSelectionPlugin() {
41
- return {
42
- name: 'mobileSelection',
43
- pmPlugins: function pmPlugins() {
44
- return [{
45
- name: 'mobileSelection',
46
- plugin: function plugin(_ref) {
47
- var dispatch = _ref.dispatch;
48
- return createProseMirrorPlugin(dispatch);
49
- }
50
- }];
51
- }
52
- };
53
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,83 +0,0 @@
1
- import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
6
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
7
- export var trackerStore = new WeakMap();
8
- var Tracker = /*#__PURE__*/_createClass(function Tracker() {
9
- var _this = this;
10
- _classCallCheck(this, Tracker);
11
- _defineProperty(this, "update", function (props) {
12
- _this.subscriptions.forEach(function (cb) {
13
- return cb(props);
14
- });
15
- });
16
- _defineProperty(this, "add", function (subscription) {
17
- _this.subscriptions.push(subscription);
18
- });
19
- _defineProperty(this, "remove", function (subscription) {
20
- _this.subscriptions = _this.subscriptions.filter(function (s) {
21
- return s !== subscription;
22
- });
23
- });
24
- this.subscriptions = [];
25
- });
26
- var pluginKey = new PluginKey('viewUpdateSubscriptionKey');
27
- var createViewUpdateSubscriptionPlugin = function createViewUpdateSubscriptionPlugin() {
28
- var tracker;
29
- var lastUpdateRef = {
30
- current: null,
31
- initial: null,
32
- transactions: [],
33
- queued: false
34
- };
35
- return {
36
- name: 'viewUpdateSubscription',
37
- pmPlugins: function pmPlugins() {
38
- var createPlugin = function createPlugin() {
39
- return new SafePlugin({
40
- key: pluginKey,
41
- view: function view(editorView) {
42
- tracker = trackerStore.get(editorView);
43
- if (!tracker) {
44
- tracker = new Tracker();
45
- trackerStore.set(editorView, tracker);
46
- }
47
- return {};
48
- }
49
- });
50
- };
51
- return [{
52
- name: 'viewUpdateSubscription',
53
- plugin: createPlugin
54
- }];
55
- },
56
- onEditorViewStateUpdated: function onEditorViewStateUpdated(props) {
57
- var _lastUpdateRef$transa;
58
- lastUpdateRef.current = props;
59
- (_lastUpdateRef$transa = lastUpdateRef.transactions).push.apply(_lastUpdateRef$transa, _toConsumableArray(props.transactions));
60
- if (!lastUpdateRef.queued) {
61
- lastUpdateRef.initial = props;
62
- lastUpdateRef.queued = true;
63
- queueMicrotask(function () {
64
- if (!lastUpdateRef.current || !lastUpdateRef.initial) {
65
- return;
66
- }
67
- if (tracker) {
68
- var _lastUpdateRef$initia;
69
- tracker.update({
70
- newEditorState: lastUpdateRef.current.newEditorState,
71
- oldEditorState: (_lastUpdateRef$initia = lastUpdateRef.initial) === null || _lastUpdateRef$initia === void 0 ? void 0 : _lastUpdateRef$initia.oldEditorState,
72
- transactions: lastUpdateRef.transactions
73
- });
74
- }
75
- lastUpdateRef.queued = false;
76
- lastUpdateRef.current = null;
77
- lastUpdateRef.transactions = [];
78
- });
79
- }
80
- }
81
- };
82
- };
83
- export default createViewUpdateSubscriptionPlugin;
@@ -1,103 +0,0 @@
1
- import { areSameItems } from '@atlaskit/editor-common/floating-toolbar';
2
- import { trackerStore } from '..';
3
- var areToolbarsSame = function areToolbarsSame(left, right) {
4
- if (!left && !right) {
5
- return true;
6
- }
7
- if (left && !right || !left && right) {
8
- return false;
9
- }
10
- var leftConfig = left.config;
11
- var rightConfig = right.config;
12
- if (!leftConfig && !rightConfig) {
13
- return true;
14
- }
15
- if (!leftConfig && rightConfig || leftConfig && !rightConfig) {
16
- return false;
17
- }
18
- var leftItems = Array.isArray(leftConfig.items) ? leftConfig.items : leftConfig.items(left.node);
19
- var rightItems = Array.isArray(rightConfig.items) ? rightConfig.items : rightConfig.items(right.node);
20
- return areSameItems(leftItems, rightItems);
21
- };
22
- export var subscribeToToolbarAndPickerUpdates = function subscribeToToolbarAndPickerUpdates(editorView, cb) {
23
- var lastUpdatedState = null;
24
- var subscription = function subscription(_ref) {
25
- var newEditorState = _ref.newEditorState;
26
- // Creating fake plugin keys for these plugins for the mean time until all these plugins are extracted.
27
- var typeAheadPluginKey = {
28
- key: 'typeAheadPlugin$',
29
- getState: function getState(state) {
30
- return state['typeAheadPlugin$'];
31
- }
32
- };
33
- var datePluginKey = {
34
- key: 'datePlugin$',
35
- getState: function getState(state) {
36
- return state['datePlugin$'];
37
- }
38
- };
39
- var statusPluginKey = {
40
- key: 'statusPlugin$',
41
- getState: function getState(state) {
42
- return state['statusPlugin$'];
43
- }
44
- };
45
- var floatingToolbarPluginKey = {
46
- key: 'floatingToolbarPluginKey$',
47
- getState: function getState(state) {
48
- return state['floatingToolbarPluginKey$'];
49
- }
50
- };
51
- var isTypeAheadOpen = function isTypeAheadOpen(editorState) {
52
- var _typeAheadState$decor;
53
- var typeAheadState = typeAheadPluginKey.getState(newEditorState);
54
- return !!((_typeAheadState$decor = typeAheadState.decorationSet) !== null && _typeAheadState$decor !== void 0 && _typeAheadState$decor.find().length);
55
- };
56
- // TypeAhead has priority in the mobile-bridge
57
- // In case it is open we don't need to send
58
- // any toolbar updates don't need to be send
59
- if (isTypeAheadOpen(newEditorState)) {
60
- return;
61
- }
62
- var dateState = datePluginKey.getState(newEditorState);
63
- var statusState = statusPluginKey.getState(newEditorState);
64
- var _ref2 = floatingToolbarPluginKey.getState(newEditorState),
65
- getConfigWithNodeInfo = _ref2.getConfigWithNodeInfo;
66
- var toolbarConfig = getConfigWithNodeInfo(newEditorState);
67
- var shouldCallback = false;
68
- if (lastUpdatedState) {
69
- var oldDateState = datePluginKey.getState(lastUpdatedState);
70
- var oldStatusState = statusPluginKey.getState(lastUpdatedState);
71
- var _ref3 = floatingToolbarPluginKey.getState(lastUpdatedState),
72
- getOldConfigWithNodeInfo = _ref3.getConfigWithNodeInfo;
73
- var oldToolbarConfig = getOldConfigWithNodeInfo(lastUpdatedState);
74
- var isToolbarEqual = areToolbarsSame(toolbarConfig, oldToolbarConfig);
75
- if (dateState !== oldDateState || statusState !== oldStatusState ||
76
- // Sometimes the toolbar changes while a picker is open, we dont care about this
77
- // EG A nested status or date node in a table
78
- !isToolbarEqual && !(statusState !== null && statusState !== void 0 && statusState.showStatusPickerAt) && !(dateState !== null && dateState !== void 0 && dateState.showDatePickerAt)) {
79
- shouldCallback = true;
80
- }
81
- } else {
82
- shouldCallback = true;
83
- }
84
- if (shouldCallback) {
85
- cb({
86
- dateState: dateState,
87
- statusState: statusState,
88
- toolbarConfig: toolbarConfig
89
- });
90
- }
91
- lastUpdatedState = newEditorState;
92
- };
93
- var tracker = trackerStore.get(editorView);
94
- if (tracker) {
95
- tracker.add(subscription);
96
- }
97
- return function () {
98
- var tracker = trackerStore.get(editorView);
99
- if (tracker) {
100
- tracker.remove(subscription);
101
- }
102
- };
103
- };
@@ -1,18 +0,0 @@
1
- export declare enum MobileDimensionsActionTypes {
2
- SET_WINDOW_HEIGHT = "SET_WINDOW_HEIGHT",
3
- SET_MOBILE_PADDING_TOP = "SET_MOBILE_PADDING_TOP",
4
- SET_IS_EXPANDED = "SET_IS_EXPANDED"
5
- }
6
- export interface SetMobilePaddingTop {
7
- type: MobileDimensionsActionTypes.SET_MOBILE_PADDING_TOP;
8
- paddingTop: number;
9
- }
10
- export interface SetWindowHeight {
11
- type: MobileDimensionsActionTypes.SET_WINDOW_HEIGHT;
12
- windowHeight: number;
13
- }
14
- export interface SetIsExpanded {
15
- type: MobileDimensionsActionTypes.SET_IS_EXPANDED;
16
- isExpanded: boolean;
17
- }
18
- export type MobileDimensionsAction = SetWindowHeight | SetMobilePaddingTop | SetIsExpanded;
@@ -1,3 +0,0 @@
1
- export declare const setWindowHeight: (windowHeight: number) => import("@atlaskit/editor-common/types").Command;
2
- export declare const setMobilePaddingTop: (paddingTop: number) => import("@atlaskit/editor-common/types").Command;
3
- export declare const setIsExpanded: (isExpanded: boolean) => import("@atlaskit/editor-common/types").Command;
@@ -1,7 +0,0 @@
1
- import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
- import type { MobileDimensionsPluginState } from './types';
3
- export type MobileDimensionsPlugin = NextEditorPlugin<'mobileDimensions', {
4
- sharedState: MobileDimensionsPluginState | undefined;
5
- }>;
6
- declare const mobileDimensionsPlugin: MobileDimensionsPlugin;
7
- export default mobileDimensionsPlugin;
@@ -1,5 +0,0 @@
1
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
- import type { MobileDimensionsPluginState } from './types';
3
- import type { MobileDimensionsAction } from './actions';
4
- export declare const mobileDimensionsPluginKey: PluginKey<any>;
5
- export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: MobileDimensionsPluginState | ((state: import("prosemirror-state").EditorState) => MobileDimensionsPluginState)) => import("prosemirror-state").SafeStateField<MobileDimensionsPluginState>, getPluginState: (state: import("prosemirror-state").EditorState) => MobileDimensionsPluginState, createCommand: <A = MobileDimensionsAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command;
@@ -1,3 +0,0 @@
1
- import type { MobileDimensionsAction } from './actions';
2
- import type { MobileDimensionsPluginState } from './types';
3
- export default function (state: MobileDimensionsPluginState, action: MobileDimensionsAction): MobileDimensionsPluginState;
@@ -1,8 +0,0 @@
1
- export type MobileDimensionsPluginState = {
2
- /** Current value of window.innerHeight, on Android this changes when keyboards shows/hides */
3
- windowHeight: number;
4
- /** Current value of padding top set from native (see WebBridge abstract class implementation) */
5
- mobilePaddingTop: number;
6
- /** Hybrid editor is always expanded, compact editor is collapsed or expanded */
7
- isExpanded: boolean;
8
- };
@@ -1,5 +0,0 @@
1
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
- export declare const contentInSelection: ({ selection, doc, }: EditorState) => {
3
- nodeTypes: string[];
4
- markTypes: string[];
5
- };
@@ -1,2 +0,0 @@
1
- export type { SelectionData, SelectionDataState } from './types';
2
- export { mobileSelectionPlugin as default, selectionPluginKey, } from './mobile-selection-plugin';
@@ -1,7 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
- import type { Dispatch } from '../../event-dispatcher';
4
- import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
5
- export declare const selectionPluginKey: PluginKey<any>;
6
- export declare const createProseMirrorPlugin: (dispatch: Dispatch) => SafePlugin;
7
- export declare const mobileSelectionPlugin: NextEditorPlugin<'mobileSelection'>;
@@ -1,32 +0,0 @@
1
- export interface SelectionDataState {
2
- rect: RectData;
3
- selection: SelectionData;
4
- nodeTypes: string[];
5
- markTypes: string[];
6
- }
7
- export type SelectionData = AllSelectionData | NodeSelectionData | TextSelectionData | GapSelectionData | CellSelectionData;
8
- export interface RectData {
9
- top: number;
10
- left: number;
11
- }
12
- export interface AllSelectionData {
13
- type: 'all';
14
- }
15
- export interface NodeSelectionData {
16
- type: 'node';
17
- anchor: number;
18
- }
19
- export interface TextSelectionData {
20
- type: 'text';
21
- anchor: number;
22
- head: number;
23
- }
24
- export interface GapSelectionData {
25
- type: 'gapcursor';
26
- pos: number;
27
- }
28
- export interface CellSelectionData {
29
- type: 'cell';
30
- anchor: number;
31
- head: number;
32
- }
@@ -1,19 +0,0 @@
1
- import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
2
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
4
- type UpdateArgs = {
5
- newEditorState: EditorState;
6
- oldEditorState: EditorState;
7
- transactions: readonly Transaction[];
8
- };
9
- export type ViewUpdateSubscription = (args: UpdateArgs) => void;
10
- export declare const trackerStore: WeakMap<EditorView, Tracker>;
11
- declare class Tracker {
12
- private subscriptions;
13
- constructor();
14
- update: (props: UpdateArgs) => void;
15
- add: (subscription: ViewUpdateSubscription) => void;
16
- remove: (subscription: ViewUpdateSubscription) => void;
17
- }
18
- declare const createViewUpdateSubscriptionPlugin: NextEditorPlugin<'viewUpdateSubscription'>;
19
- export default createViewUpdateSubscriptionPlugin;
@@ -1,12 +0,0 @@
1
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
- import type { DatePluginSharedState } from '@atlaskit/editor-plugin-date';
3
- import type { ConfigWithNodeInfo } from '@atlaskit/editor-plugin-floating-toolbar';
4
- import type { StatusState } from '@atlaskit/editor-plugin-status';
5
- type SubscribeToToolbarAndPickerUpdatesCallbackArgs = {
6
- dateState?: DatePluginSharedState;
7
- statusState?: StatusState;
8
- toolbarConfig: ConfigWithNodeInfo | null | undefined;
9
- };
10
- type SubscribeToToolbarAndPickerUpdates = (editorView: EditorView, cb: (args: SubscribeToToolbarAndPickerUpdatesCallbackArgs) => void) => () => void;
11
- export declare const subscribeToToolbarAndPickerUpdates: SubscribeToToolbarAndPickerUpdates;
12
- export {};
@@ -1,18 +0,0 @@
1
- export declare enum MobileDimensionsActionTypes {
2
- SET_WINDOW_HEIGHT = "SET_WINDOW_HEIGHT",
3
- SET_MOBILE_PADDING_TOP = "SET_MOBILE_PADDING_TOP",
4
- SET_IS_EXPANDED = "SET_IS_EXPANDED"
5
- }
6
- export interface SetMobilePaddingTop {
7
- type: MobileDimensionsActionTypes.SET_MOBILE_PADDING_TOP;
8
- paddingTop: number;
9
- }
10
- export interface SetWindowHeight {
11
- type: MobileDimensionsActionTypes.SET_WINDOW_HEIGHT;
12
- windowHeight: number;
13
- }
14
- export interface SetIsExpanded {
15
- type: MobileDimensionsActionTypes.SET_IS_EXPANDED;
16
- isExpanded: boolean;
17
- }
18
- export type MobileDimensionsAction = SetWindowHeight | SetMobilePaddingTop | SetIsExpanded;
@@ -1,3 +0,0 @@
1
- export declare const setWindowHeight: (windowHeight: number) => import("@atlaskit/editor-common/types").Command;
2
- export declare const setMobilePaddingTop: (paddingTop: number) => import("@atlaskit/editor-common/types").Command;
3
- export declare const setIsExpanded: (isExpanded: boolean) => import("@atlaskit/editor-common/types").Command;
@@ -1,7 +0,0 @@
1
- import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
- import type { MobileDimensionsPluginState } from './types';
3
- export type MobileDimensionsPlugin = NextEditorPlugin<'mobileDimensions', {
4
- sharedState: MobileDimensionsPluginState | undefined;
5
- }>;
6
- declare const mobileDimensionsPlugin: MobileDimensionsPlugin;
7
- export default mobileDimensionsPlugin;
@@ -1,5 +0,0 @@
1
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
- import type { MobileDimensionsPluginState } from './types';
3
- import type { MobileDimensionsAction } from './actions';
4
- export declare const mobileDimensionsPluginKey: PluginKey<any>;
5
- export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: MobileDimensionsPluginState | ((state: import("prosemirror-state").EditorState) => MobileDimensionsPluginState)) => import("prosemirror-state").SafeStateField<MobileDimensionsPluginState>, getPluginState: (state: import("prosemirror-state").EditorState) => MobileDimensionsPluginState, createCommand: <A = MobileDimensionsAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command;
@@ -1,3 +0,0 @@
1
- import type { MobileDimensionsAction } from './actions';
2
- import type { MobileDimensionsPluginState } from './types';
3
- export default function (state: MobileDimensionsPluginState, action: MobileDimensionsAction): MobileDimensionsPluginState;
@@ -1,8 +0,0 @@
1
- export type MobileDimensionsPluginState = {
2
- /** Current value of window.innerHeight, on Android this changes when keyboards shows/hides */
3
- windowHeight: number;
4
- /** Current value of padding top set from native (see WebBridge abstract class implementation) */
5
- mobilePaddingTop: number;
6
- /** Hybrid editor is always expanded, compact editor is collapsed or expanded */
7
- isExpanded: boolean;
8
- };
@@ -1,5 +0,0 @@
1
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
- export declare const contentInSelection: ({ selection, doc, }: EditorState) => {
3
- nodeTypes: string[];
4
- markTypes: string[];
5
- };
@@ -1,2 +0,0 @@
1
- export type { SelectionData, SelectionDataState } from './types';
2
- export { mobileSelectionPlugin as default, selectionPluginKey, } from './mobile-selection-plugin';
@@ -1,7 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
- import type { Dispatch } from '../../event-dispatcher';
4
- import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
5
- export declare const selectionPluginKey: PluginKey<any>;
6
- export declare const createProseMirrorPlugin: (dispatch: Dispatch) => SafePlugin;
7
- export declare const mobileSelectionPlugin: NextEditorPlugin<'mobileSelection'>;
@@ -1,32 +0,0 @@
1
- export interface SelectionDataState {
2
- rect: RectData;
3
- selection: SelectionData;
4
- nodeTypes: string[];
5
- markTypes: string[];
6
- }
7
- export type SelectionData = AllSelectionData | NodeSelectionData | TextSelectionData | GapSelectionData | CellSelectionData;
8
- export interface RectData {
9
- top: number;
10
- left: number;
11
- }
12
- export interface AllSelectionData {
13
- type: 'all';
14
- }
15
- export interface NodeSelectionData {
16
- type: 'node';
17
- anchor: number;
18
- }
19
- export interface TextSelectionData {
20
- type: 'text';
21
- anchor: number;
22
- head: number;
23
- }
24
- export interface GapSelectionData {
25
- type: 'gapcursor';
26
- pos: number;
27
- }
28
- export interface CellSelectionData {
29
- type: 'cell';
30
- anchor: number;
31
- head: number;
32
- }