@atlaskit/editor-core 196.1.0 → 197.0.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.
- package/CHANGELOG.md +9 -0
- package/dist/cjs/create-editor/get-ui-component.js +0 -3
- package/dist/cjs/create-editor/preset-utils.js +1 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/get-ui-component.js +0 -3
- package/dist/es2019/create-editor/preset-utils.js +1 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/get-ui-component.js +0 -3
- package/dist/esm/create-editor/preset-utils.js +1 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/package.json +3 -3
- package/dist/cjs/ui/Appearance/Mobile.js +0 -52
- package/dist/cjs/ui/AppearanceComponents/Mobile.js +0 -110
- package/dist/es2019/ui/Appearance/Mobile.js +0 -47
- package/dist/es2019/ui/AppearanceComponents/Mobile.js +0 -105
- package/dist/esm/ui/Appearance/Mobile.js +0 -45
- package/dist/esm/ui/AppearanceComponents/Mobile.js +0 -100
- package/dist/types/ui/Appearance/Mobile.d.ts +0 -3
- package/dist/types/ui/AppearanceComponents/Mobile.d.ts +0 -17
- package/dist/types-ts4.5/ui/Appearance/Mobile.d.ts +0 -3
- package/dist/types-ts4.5/ui/AppearanceComponents/Mobile.d.ts +0 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 197.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#135235](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/135235)
|
|
8
|
+
[`f67578e7140b5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f67578e7140b5) -
|
|
9
|
+
removed MobileAppearance from editor-core, removed editor-mobile-bridge testing step from a
|
|
10
|
+
pipeline
|
|
11
|
+
|
|
3
12
|
## 196.1.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
|
@@ -8,7 +8,6 @@ exports.default = getUiComponent;
|
|
|
8
8
|
var _Chromeless = _interopRequireDefault(require("../ui/Appearance/Chromeless"));
|
|
9
9
|
var _Comment = _interopRequireDefault(require("../ui/Appearance/Comment"));
|
|
10
10
|
var _FullPage = _interopRequireDefault(require("../ui/Appearance/FullPage"));
|
|
11
|
-
var _Mobile = _interopRequireDefault(require("../ui/Appearance/Mobile"));
|
|
12
11
|
function getUiComponent(appearance) {
|
|
13
12
|
appearance = appearance || 'comment';
|
|
14
13
|
switch (appearance) {
|
|
@@ -19,8 +18,6 @@ function getUiComponent(appearance) {
|
|
|
19
18
|
return _Chromeless.default;
|
|
20
19
|
case 'comment':
|
|
21
20
|
return _Comment.default;
|
|
22
|
-
case 'mobile':
|
|
23
|
-
return _Mobile.default;
|
|
24
21
|
default:
|
|
25
22
|
throw new Error("Appearance '".concat(appearance, "' is not supported by the editor."));
|
|
26
23
|
}
|
|
@@ -19,8 +19,7 @@ function shouldRecreatePreset(props, nextProps) {
|
|
|
19
19
|
return shouldReconfigureState(props, nextProps);
|
|
20
20
|
}
|
|
21
21
|
function shouldReconfigureState(props, nextProps) {
|
|
22
|
-
var
|
|
23
|
-
var properties = ['appearance', 'persistScrollGutter', 'allowUndoRedoButtons', 'placeholder', 'sanitizePrivateContent'].concat(mobileProperties);
|
|
22
|
+
var properties = ['appearance', 'persistScrollGutter', 'allowUndoRedoButtons', 'placeholder', 'sanitizePrivateContent'];
|
|
24
23
|
return properties.reduce(function (acc, curr) {
|
|
25
24
|
return acc || props[curr] !== nextProps[curr];
|
|
26
25
|
}, false);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import Chromeless from '../ui/Appearance/Chromeless';
|
|
2
2
|
import Comment from '../ui/Appearance/Comment';
|
|
3
3
|
import FullPage from '../ui/Appearance/FullPage';
|
|
4
|
-
import Mobile from '../ui/Appearance/Mobile';
|
|
5
4
|
export default function getUiComponent(appearance) {
|
|
6
5
|
appearance = appearance || 'comment';
|
|
7
6
|
switch (appearance) {
|
|
@@ -12,8 +11,6 @@ export default function getUiComponent(appearance) {
|
|
|
12
11
|
return Chromeless;
|
|
13
12
|
case 'comment':
|
|
14
13
|
return Comment;
|
|
15
|
-
case 'mobile':
|
|
16
|
-
return Mobile;
|
|
17
14
|
default:
|
|
18
15
|
throw new Error(`Appearance '${appearance}' is not supported by the editor.`);
|
|
19
16
|
}
|
|
@@ -9,7 +9,6 @@ export function shouldRecreatePreset(props, nextProps) {
|
|
|
9
9
|
return shouldReconfigureState(props, nextProps);
|
|
10
10
|
}
|
|
11
11
|
function shouldReconfigureState(props, nextProps) {
|
|
12
|
-
const
|
|
13
|
-
const properties = ['appearance', 'persistScrollGutter', 'allowUndoRedoButtons', 'placeholder', 'sanitizePrivateContent', ...mobileProperties];
|
|
12
|
+
const properties = ['appearance', 'persistScrollGutter', 'allowUndoRedoButtons', 'placeholder', 'sanitizePrivateContent'];
|
|
14
13
|
return properties.reduce((acc, curr) => acc || props[curr] !== nextProps[curr], false);
|
|
15
14
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "
|
|
2
|
+
export const version = "197.0.0";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import Chromeless from '../ui/Appearance/Chromeless';
|
|
2
2
|
import Comment from '../ui/Appearance/Comment';
|
|
3
3
|
import FullPage from '../ui/Appearance/FullPage';
|
|
4
|
-
import Mobile from '../ui/Appearance/Mobile';
|
|
5
4
|
export default function getUiComponent(appearance) {
|
|
6
5
|
appearance = appearance || 'comment';
|
|
7
6
|
switch (appearance) {
|
|
@@ -12,8 +11,6 @@ export default function getUiComponent(appearance) {
|
|
|
12
11
|
return Chromeless;
|
|
13
12
|
case 'comment':
|
|
14
13
|
return Comment;
|
|
15
|
-
case 'mobile':
|
|
16
|
-
return Mobile;
|
|
17
14
|
default:
|
|
18
15
|
throw new Error("Appearance '".concat(appearance, "' is not supported by the editor."));
|
|
19
16
|
}
|
|
@@ -13,8 +13,7 @@ export function shouldRecreatePreset(props, nextProps) {
|
|
|
13
13
|
return shouldReconfigureState(props, nextProps);
|
|
14
14
|
}
|
|
15
15
|
function shouldReconfigureState(props, nextProps) {
|
|
16
|
-
var
|
|
17
|
-
var properties = ['appearance', 'persistScrollGutter', 'allowUndoRedoButtons', 'placeholder', 'sanitizePrivateContent'].concat(mobileProperties);
|
|
16
|
+
var properties = ['appearance', 'persistScrollGutter', 'allowUndoRedoButtons', 'placeholder', 'sanitizePrivateContent'];
|
|
18
17
|
return properties.reduce(function (acc, curr) {
|
|
19
18
|
return acc || props[curr] !== nextProps[curr];
|
|
20
19
|
}, false);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "
|
|
2
|
+
export var version = "197.0.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "197.0.0",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/analytics-next-stable-react-context": "1.0.1",
|
|
47
47
|
"@atlaskit/button": "^20.1.0",
|
|
48
48
|
"@atlaskit/editor-common": "^88.4.0",
|
|
49
|
-
"@atlaskit/editor-plugins": "^4.
|
|
49
|
+
"@atlaskit/editor-plugins": "^4.3.0",
|
|
50
50
|
"@atlaskit/editor-prosemirror": "5.0.1",
|
|
51
51
|
"@atlaskit/editor-shared-styles": "^2.13.0",
|
|
52
52
|
"@atlaskit/emoji": "^67.7.0",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@af/editor-examples-helpers": "0.3.
|
|
83
|
+
"@af/editor-examples-helpers": "0.3.5",
|
|
84
84
|
"@af/editor-libra": "*",
|
|
85
85
|
"@af/visual-regression": "*",
|
|
86
86
|
"@atlaskit/adf-utils": "^19.8.0",
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = Mobile;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _Mobile = require("../AppearanceComponents/Mobile");
|
|
10
|
-
var _PluginSlot = _interopRequireDefault(require("../PluginSlot"));
|
|
11
|
-
function Mobile(_ref) {
|
|
12
|
-
var _innerRef$current;
|
|
13
|
-
var editorView = _ref.editorView,
|
|
14
|
-
maxHeight = _ref.maxHeight,
|
|
15
|
-
persistScrollGutter = _ref.persistScrollGutter,
|
|
16
|
-
editorDOMElement = _ref.editorDOMElement,
|
|
17
|
-
disabled = _ref.disabled,
|
|
18
|
-
contentComponents = _ref.contentComponents,
|
|
19
|
-
editorActions = _ref.editorActions,
|
|
20
|
-
eventDispatcher = _ref.eventDispatcher,
|
|
21
|
-
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent,
|
|
22
|
-
providerFactory = _ref.providerFactory,
|
|
23
|
-
appearance = _ref.appearance,
|
|
24
|
-
popupsMountPoint = _ref.popupsMountPoint,
|
|
25
|
-
popupsBoundariesElement = _ref.popupsBoundariesElement,
|
|
26
|
-
popupsScrollableElement = _ref.popupsScrollableElement,
|
|
27
|
-
innerRef = _ref.innerRef,
|
|
28
|
-
pluginHooks = _ref.pluginHooks,
|
|
29
|
-
featureFlags = _ref.featureFlags;
|
|
30
|
-
return /*#__PURE__*/_react.default.createElement(_Mobile.MobileAppearance, {
|
|
31
|
-
ref: innerRef,
|
|
32
|
-
editorView: editorView || null,
|
|
33
|
-
maxHeight: maxHeight,
|
|
34
|
-
persistScrollGutter: persistScrollGutter,
|
|
35
|
-
editorDisabled: disabled,
|
|
36
|
-
featureFlags: featureFlags
|
|
37
|
-
}, editorDOMElement, /*#__PURE__*/_react.default.createElement(_PluginSlot.default, {
|
|
38
|
-
editorView: editorView,
|
|
39
|
-
editorActions: editorActions,
|
|
40
|
-
eventDispatcher: eventDispatcher,
|
|
41
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
42
|
-
providerFactory: providerFactory,
|
|
43
|
-
appearance: appearance,
|
|
44
|
-
popupsMountPoint: popupsMountPoint,
|
|
45
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
46
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
47
|
-
containerElement: (_innerRef$current = innerRef === null || innerRef === void 0 ? void 0 : innerRef.current) !== null && _innerRef$current !== void 0 ? _innerRef$current : null,
|
|
48
|
-
disabled: !!disabled,
|
|
49
|
-
wrapperElement: null,
|
|
50
|
-
pluginHooks: pluginHooks
|
|
51
|
-
}));
|
|
52
|
-
}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.MobileAppearance = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _react2 = require("@emotion/react");
|
|
11
|
-
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
12
|
-
var _context = require("../../presets/context");
|
|
13
|
-
var _Addon = require("../Addon");
|
|
14
|
-
var _ContentStyles = require("../ContentStyles");
|
|
15
|
-
var _WithFlash = _interopRequireDefault(require("../WithFlash"));
|
|
16
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
17
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
|
-
/**
|
|
19
|
-
* @jsxRuntime classic
|
|
20
|
-
* @jsx jsx
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
24
|
-
|
|
25
|
-
// Only mobile bridge is using this appearance. We have some plans to decouple the appearances from editor-core. So it doesn't make sense to move this plugin to a separated package for now.
|
|
26
|
-
// Copied packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/index.ts
|
|
27
|
-
|
|
28
|
-
// Copied from packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/types.ts
|
|
29
|
-
|
|
30
|
-
var mobileEditor = (0, _react2.css)({
|
|
31
|
-
minHeight: '30px',
|
|
32
|
-
width: '100%',
|
|
33
|
-
maxWidth: 'inherit',
|
|
34
|
-
boxSizing: 'border-box',
|
|
35
|
-
wordWrap: 'break-word',
|
|
36
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
37
|
-
'div > .ProseMirror': {
|
|
38
|
-
outline: 'none',
|
|
39
|
-
whiteSpace: 'pre-wrap',
|
|
40
|
-
padding: 0,
|
|
41
|
-
margin: 0
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
var ContentArea = (0, _ContentStyles.createEditorContentStyle)();
|
|
45
|
-
ContentArea.displayName = 'ContentArea';
|
|
46
|
-
var MobileAppearance = exports.MobileAppearance = /*#__PURE__*/(0, _react.forwardRef)(function MobileAppearance(_ref, ref) {
|
|
47
|
-
var _api$base2;
|
|
48
|
-
var editorView = _ref.editorView,
|
|
49
|
-
persistScrollGutter = _ref.persistScrollGutter,
|
|
50
|
-
children = _ref.children,
|
|
51
|
-
editorDisabled = _ref.editorDisabled,
|
|
52
|
-
featureFlags = _ref.featureFlags;
|
|
53
|
-
var api = (0, _context.usePresetContext)();
|
|
54
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['maxContentSize', 'mobileDimensions']),
|
|
55
|
-
maxContentSizeState = _useSharedPluginState.maxContentSizeState,
|
|
56
|
-
mobileDimensionsState = _useSharedPluginState.mobileDimensionsState;
|
|
57
|
-
var render = (0, _react.useCallback)(function (_ref2) {
|
|
58
|
-
var maxContentSize = _ref2.maxContentSize,
|
|
59
|
-
mobileDimensions = _ref2.mobileDimensions;
|
|
60
|
-
var maxContentSizeReached = Boolean(maxContentSize === null || maxContentSize === void 0 ? void 0 : maxContentSize.maxContentSizeReached);
|
|
61
|
-
var minHeight = 100;
|
|
62
|
-
var currentIsExpanded = true; // isExpanded prop should always be true for Hybrid Editor
|
|
63
|
-
if (mobileDimensions) {
|
|
64
|
-
var _api$base, _basePluginState$keyb;
|
|
65
|
-
var windowHeight = mobileDimensions.windowHeight,
|
|
66
|
-
mobilePaddingTop = mobileDimensions.mobilePaddingTop,
|
|
67
|
-
isExpanded = mobileDimensions.isExpanded;
|
|
68
|
-
var basePluginState = api === null || api === void 0 || (_api$base = api.base) === null || _api$base === void 0 ? void 0 : _api$base.sharedState.currentState();
|
|
69
|
-
var keyboardHeight = (_basePluginState$keyb = basePluginState === null || basePluginState === void 0 ? void 0 : basePluginState.keyboardHeight) !== null && _basePluginState$keyb !== void 0 ? _basePluginState$keyb : -1;
|
|
70
|
-
|
|
71
|
-
/*
|
|
72
|
-
We calculate the min-height based on the windowHeight - keyboardHeight - paddingTop.
|
|
73
|
-
This is needed due to scrolling issues when there is no content to scroll (like, only having 1 paragraph),
|
|
74
|
-
but if the clickable area is bigger than the windowHeight - keyboard (including toolbar) then the view
|
|
75
|
-
is scrolled nevertheless, and it gives the sensation that the content was lost.
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
if (!persistScrollGutter) {
|
|
79
|
-
// in iOS Hybrid Editor windowHeight doesn't exclude keyboardHeight
|
|
80
|
-
// in Android keyboardHeight is always set to -1;
|
|
81
|
-
minHeight = windowHeight - keyboardHeight - 2 * mobilePaddingTop;
|
|
82
|
-
} else {
|
|
83
|
-
// in iOS Compact Editor windowHeight excludes keyboardHeight
|
|
84
|
-
minHeight = windowHeight - mobilePaddingTop;
|
|
85
|
-
// isExpanded can be true of false for Compact editor
|
|
86
|
-
currentIsExpanded = isExpanded;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return (0, _react2.jsx)(_WithFlash.default, {
|
|
90
|
-
animate: maxContentSizeReached
|
|
91
|
-
}, (0, _react2.jsx)("div", {
|
|
92
|
-
css: mobileEditor,
|
|
93
|
-
ref: ref
|
|
94
|
-
}, (0, _react2.jsx)(_Addon.ClickAreaMobile, {
|
|
95
|
-
editorView: editorView || undefined,
|
|
96
|
-
minHeight: minHeight,
|
|
97
|
-
persistScrollGutter: persistScrollGutter,
|
|
98
|
-
isExpanded: currentIsExpanded,
|
|
99
|
-
editorDisabled: editorDisabled
|
|
100
|
-
}, (0, _react2.jsx)(ContentArea, {
|
|
101
|
-
featureFlags: featureFlags
|
|
102
|
-
}, (0, _react2.jsx)("div", {
|
|
103
|
-
className: "ak-editor-content-area"
|
|
104
|
-
}, children)))));
|
|
105
|
-
}, [children, editorView, persistScrollGutter, editorDisabled, ref, featureFlags, api === null || api === void 0 || (_api$base2 = api.base) === null || _api$base2 === void 0 ? void 0 : _api$base2.sharedState]);
|
|
106
|
-
return render({
|
|
107
|
-
maxContentSize: maxContentSizeState,
|
|
108
|
-
mobileDimensions: mobileDimensionsState
|
|
109
|
-
});
|
|
110
|
-
});
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { MobileAppearance } from '../AppearanceComponents/Mobile';
|
|
3
|
-
import PluginSlot from '../PluginSlot';
|
|
4
|
-
export default function Mobile({
|
|
5
|
-
editorView,
|
|
6
|
-
maxHeight,
|
|
7
|
-
persistScrollGutter,
|
|
8
|
-
editorDOMElement,
|
|
9
|
-
disabled,
|
|
10
|
-
contentComponents,
|
|
11
|
-
editorActions,
|
|
12
|
-
eventDispatcher,
|
|
13
|
-
dispatchAnalyticsEvent,
|
|
14
|
-
providerFactory,
|
|
15
|
-
appearance,
|
|
16
|
-
popupsMountPoint,
|
|
17
|
-
popupsBoundariesElement,
|
|
18
|
-
popupsScrollableElement,
|
|
19
|
-
innerRef,
|
|
20
|
-
pluginHooks,
|
|
21
|
-
featureFlags
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
|
-
}) {
|
|
24
|
-
var _innerRef$current;
|
|
25
|
-
return /*#__PURE__*/React.createElement(MobileAppearance, {
|
|
26
|
-
ref: innerRef,
|
|
27
|
-
editorView: editorView || null,
|
|
28
|
-
maxHeight: maxHeight,
|
|
29
|
-
persistScrollGutter: persistScrollGutter,
|
|
30
|
-
editorDisabled: disabled,
|
|
31
|
-
featureFlags: featureFlags
|
|
32
|
-
}, editorDOMElement, /*#__PURE__*/React.createElement(PluginSlot, {
|
|
33
|
-
editorView: editorView,
|
|
34
|
-
editorActions: editorActions,
|
|
35
|
-
eventDispatcher: eventDispatcher,
|
|
36
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
37
|
-
providerFactory: providerFactory,
|
|
38
|
-
appearance: appearance,
|
|
39
|
-
popupsMountPoint: popupsMountPoint,
|
|
40
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
41
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
42
|
-
containerElement: (_innerRef$current = innerRef === null || innerRef === void 0 ? void 0 : innerRef.current) !== null && _innerRef$current !== void 0 ? _innerRef$current : null,
|
|
43
|
-
disabled: !!disabled,
|
|
44
|
-
wrapperElement: null,
|
|
45
|
-
pluginHooks: pluginHooks
|
|
46
|
-
}));
|
|
47
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import React, { forwardRef, useCallback } from 'react';
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
-
import { css, jsx } from '@emotion/react';
|
|
9
|
-
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
10
|
-
import { usePresetContext } from '../../presets/context';
|
|
11
|
-
import { ClickAreaMobile as ClickArea } from '../Addon';
|
|
12
|
-
import { createEditorContentStyle } from '../ContentStyles';
|
|
13
|
-
import WithFlash from '../WithFlash';
|
|
14
|
-
|
|
15
|
-
// Only mobile bridge is using this appearance. We have some plans to decouple the appearances from editor-core. So it doesn't make sense to move this plugin to a separated package for now.
|
|
16
|
-
// Copied packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/index.ts
|
|
17
|
-
|
|
18
|
-
// Copied from packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/types.ts
|
|
19
|
-
|
|
20
|
-
const mobileEditor = css({
|
|
21
|
-
minHeight: '30px',
|
|
22
|
-
width: '100%',
|
|
23
|
-
maxWidth: 'inherit',
|
|
24
|
-
boxSizing: 'border-box',
|
|
25
|
-
wordWrap: 'break-word',
|
|
26
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
27
|
-
'div > .ProseMirror': {
|
|
28
|
-
outline: 'none',
|
|
29
|
-
whiteSpace: 'pre-wrap',
|
|
30
|
-
padding: 0,
|
|
31
|
-
margin: 0
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
const ContentArea = createEditorContentStyle();
|
|
35
|
-
ContentArea.displayName = 'ContentArea';
|
|
36
|
-
export const MobileAppearance = /*#__PURE__*/forwardRef(function MobileAppearance({
|
|
37
|
-
editorView,
|
|
38
|
-
persistScrollGutter,
|
|
39
|
-
children,
|
|
40
|
-
editorDisabled,
|
|
41
|
-
featureFlags
|
|
42
|
-
}, ref) {
|
|
43
|
-
var _api$base2;
|
|
44
|
-
const api = usePresetContext();
|
|
45
|
-
const {
|
|
46
|
-
maxContentSizeState,
|
|
47
|
-
mobileDimensionsState
|
|
48
|
-
} = useSharedPluginState(api, ['maxContentSize', 'mobileDimensions']);
|
|
49
|
-
const render = useCallback(({
|
|
50
|
-
maxContentSize,
|
|
51
|
-
mobileDimensions
|
|
52
|
-
}) => {
|
|
53
|
-
const maxContentSizeReached = Boolean(maxContentSize === null || maxContentSize === void 0 ? void 0 : maxContentSize.maxContentSizeReached);
|
|
54
|
-
let minHeight = 100;
|
|
55
|
-
let currentIsExpanded = true; // isExpanded prop should always be true for Hybrid Editor
|
|
56
|
-
if (mobileDimensions) {
|
|
57
|
-
var _api$base, _basePluginState$keyb;
|
|
58
|
-
const {
|
|
59
|
-
windowHeight,
|
|
60
|
-
mobilePaddingTop,
|
|
61
|
-
isExpanded
|
|
62
|
-
} = mobileDimensions;
|
|
63
|
-
const basePluginState = api === null || api === void 0 ? void 0 : (_api$base = api.base) === null || _api$base === void 0 ? void 0 : _api$base.sharedState.currentState();
|
|
64
|
-
const keyboardHeight = (_basePluginState$keyb = basePluginState === null || basePluginState === void 0 ? void 0 : basePluginState.keyboardHeight) !== null && _basePluginState$keyb !== void 0 ? _basePluginState$keyb : -1;
|
|
65
|
-
|
|
66
|
-
/*
|
|
67
|
-
We calculate the min-height based on the windowHeight - keyboardHeight - paddingTop.
|
|
68
|
-
This is needed due to scrolling issues when there is no content to scroll (like, only having 1 paragraph),
|
|
69
|
-
but if the clickable area is bigger than the windowHeight - keyboard (including toolbar) then the view
|
|
70
|
-
is scrolled nevertheless, and it gives the sensation that the content was lost.
|
|
71
|
-
*/
|
|
72
|
-
|
|
73
|
-
if (!persistScrollGutter) {
|
|
74
|
-
// in iOS Hybrid Editor windowHeight doesn't exclude keyboardHeight
|
|
75
|
-
// in Android keyboardHeight is always set to -1;
|
|
76
|
-
minHeight = windowHeight - keyboardHeight - 2 * mobilePaddingTop;
|
|
77
|
-
} else {
|
|
78
|
-
// in iOS Compact Editor windowHeight excludes keyboardHeight
|
|
79
|
-
minHeight = windowHeight - mobilePaddingTop;
|
|
80
|
-
// isExpanded can be true of false for Compact editor
|
|
81
|
-
currentIsExpanded = isExpanded;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return jsx(WithFlash, {
|
|
85
|
-
animate: maxContentSizeReached
|
|
86
|
-
}, jsx("div", {
|
|
87
|
-
css: mobileEditor,
|
|
88
|
-
ref: ref
|
|
89
|
-
}, jsx(ClickArea, {
|
|
90
|
-
editorView: editorView || undefined,
|
|
91
|
-
minHeight: minHeight,
|
|
92
|
-
persistScrollGutter: persistScrollGutter,
|
|
93
|
-
isExpanded: currentIsExpanded,
|
|
94
|
-
editorDisabled: editorDisabled
|
|
95
|
-
}, jsx(ContentArea, {
|
|
96
|
-
featureFlags: featureFlags
|
|
97
|
-
}, jsx("div", {
|
|
98
|
-
className: "ak-editor-content-area"
|
|
99
|
-
}, children)))));
|
|
100
|
-
}, [children, editorView, persistScrollGutter, editorDisabled, ref, featureFlags, api === null || api === void 0 ? void 0 : (_api$base2 = api.base) === null || _api$base2 === void 0 ? void 0 : _api$base2.sharedState]);
|
|
101
|
-
return render({
|
|
102
|
-
maxContentSize: maxContentSizeState,
|
|
103
|
-
mobileDimensions: mobileDimensionsState
|
|
104
|
-
});
|
|
105
|
-
});
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { MobileAppearance } from '../AppearanceComponents/Mobile';
|
|
3
|
-
import PluginSlot from '../PluginSlot';
|
|
4
|
-
export default function Mobile(_ref) {
|
|
5
|
-
var _innerRef$current;
|
|
6
|
-
var editorView = _ref.editorView,
|
|
7
|
-
maxHeight = _ref.maxHeight,
|
|
8
|
-
persistScrollGutter = _ref.persistScrollGutter,
|
|
9
|
-
editorDOMElement = _ref.editorDOMElement,
|
|
10
|
-
disabled = _ref.disabled,
|
|
11
|
-
contentComponents = _ref.contentComponents,
|
|
12
|
-
editorActions = _ref.editorActions,
|
|
13
|
-
eventDispatcher = _ref.eventDispatcher,
|
|
14
|
-
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent,
|
|
15
|
-
providerFactory = _ref.providerFactory,
|
|
16
|
-
appearance = _ref.appearance,
|
|
17
|
-
popupsMountPoint = _ref.popupsMountPoint,
|
|
18
|
-
popupsBoundariesElement = _ref.popupsBoundariesElement,
|
|
19
|
-
popupsScrollableElement = _ref.popupsScrollableElement,
|
|
20
|
-
innerRef = _ref.innerRef,
|
|
21
|
-
pluginHooks = _ref.pluginHooks,
|
|
22
|
-
featureFlags = _ref.featureFlags;
|
|
23
|
-
return /*#__PURE__*/React.createElement(MobileAppearance, {
|
|
24
|
-
ref: innerRef,
|
|
25
|
-
editorView: editorView || null,
|
|
26
|
-
maxHeight: maxHeight,
|
|
27
|
-
persistScrollGutter: persistScrollGutter,
|
|
28
|
-
editorDisabled: disabled,
|
|
29
|
-
featureFlags: featureFlags
|
|
30
|
-
}, editorDOMElement, /*#__PURE__*/React.createElement(PluginSlot, {
|
|
31
|
-
editorView: editorView,
|
|
32
|
-
editorActions: editorActions,
|
|
33
|
-
eventDispatcher: eventDispatcher,
|
|
34
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
35
|
-
providerFactory: providerFactory,
|
|
36
|
-
appearance: appearance,
|
|
37
|
-
popupsMountPoint: popupsMountPoint,
|
|
38
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
39
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
40
|
-
containerElement: (_innerRef$current = innerRef === null || innerRef === void 0 ? void 0 : innerRef.current) !== null && _innerRef$current !== void 0 ? _innerRef$current : null,
|
|
41
|
-
disabled: !!disabled,
|
|
42
|
-
wrapperElement: null,
|
|
43
|
-
pluginHooks: pluginHooks
|
|
44
|
-
}));
|
|
45
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import React, { forwardRef, useCallback } from 'react';
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
-
import { css, jsx } from '@emotion/react';
|
|
9
|
-
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
10
|
-
import { usePresetContext } from '../../presets/context';
|
|
11
|
-
import { ClickAreaMobile as ClickArea } from '../Addon';
|
|
12
|
-
import { createEditorContentStyle } from '../ContentStyles';
|
|
13
|
-
import WithFlash from '../WithFlash';
|
|
14
|
-
|
|
15
|
-
// Only mobile bridge is using this appearance. We have some plans to decouple the appearances from editor-core. So it doesn't make sense to move this plugin to a separated package for now.
|
|
16
|
-
// Copied packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/index.ts
|
|
17
|
-
|
|
18
|
-
// Copied from packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/types.ts
|
|
19
|
-
|
|
20
|
-
var mobileEditor = css({
|
|
21
|
-
minHeight: '30px',
|
|
22
|
-
width: '100%',
|
|
23
|
-
maxWidth: 'inherit',
|
|
24
|
-
boxSizing: 'border-box',
|
|
25
|
-
wordWrap: 'break-word',
|
|
26
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
27
|
-
'div > .ProseMirror': {
|
|
28
|
-
outline: 'none',
|
|
29
|
-
whiteSpace: 'pre-wrap',
|
|
30
|
-
padding: 0,
|
|
31
|
-
margin: 0
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
var ContentArea = createEditorContentStyle();
|
|
35
|
-
ContentArea.displayName = 'ContentArea';
|
|
36
|
-
export var MobileAppearance = /*#__PURE__*/forwardRef(function MobileAppearance(_ref, ref) {
|
|
37
|
-
var _api$base2;
|
|
38
|
-
var editorView = _ref.editorView,
|
|
39
|
-
persistScrollGutter = _ref.persistScrollGutter,
|
|
40
|
-
children = _ref.children,
|
|
41
|
-
editorDisabled = _ref.editorDisabled,
|
|
42
|
-
featureFlags = _ref.featureFlags;
|
|
43
|
-
var api = usePresetContext();
|
|
44
|
-
var _useSharedPluginState = useSharedPluginState(api, ['maxContentSize', 'mobileDimensions']),
|
|
45
|
-
maxContentSizeState = _useSharedPluginState.maxContentSizeState,
|
|
46
|
-
mobileDimensionsState = _useSharedPluginState.mobileDimensionsState;
|
|
47
|
-
var render = useCallback(function (_ref2) {
|
|
48
|
-
var maxContentSize = _ref2.maxContentSize,
|
|
49
|
-
mobileDimensions = _ref2.mobileDimensions;
|
|
50
|
-
var maxContentSizeReached = Boolean(maxContentSize === null || maxContentSize === void 0 ? void 0 : maxContentSize.maxContentSizeReached);
|
|
51
|
-
var minHeight = 100;
|
|
52
|
-
var currentIsExpanded = true; // isExpanded prop should always be true for Hybrid Editor
|
|
53
|
-
if (mobileDimensions) {
|
|
54
|
-
var _api$base, _basePluginState$keyb;
|
|
55
|
-
var windowHeight = mobileDimensions.windowHeight,
|
|
56
|
-
mobilePaddingTop = mobileDimensions.mobilePaddingTop,
|
|
57
|
-
isExpanded = mobileDimensions.isExpanded;
|
|
58
|
-
var basePluginState = api === null || api === void 0 || (_api$base = api.base) === null || _api$base === void 0 ? void 0 : _api$base.sharedState.currentState();
|
|
59
|
-
var keyboardHeight = (_basePluginState$keyb = basePluginState === null || basePluginState === void 0 ? void 0 : basePluginState.keyboardHeight) !== null && _basePluginState$keyb !== void 0 ? _basePluginState$keyb : -1;
|
|
60
|
-
|
|
61
|
-
/*
|
|
62
|
-
We calculate the min-height based on the windowHeight - keyboardHeight - paddingTop.
|
|
63
|
-
This is needed due to scrolling issues when there is no content to scroll (like, only having 1 paragraph),
|
|
64
|
-
but if the clickable area is bigger than the windowHeight - keyboard (including toolbar) then the view
|
|
65
|
-
is scrolled nevertheless, and it gives the sensation that the content was lost.
|
|
66
|
-
*/
|
|
67
|
-
|
|
68
|
-
if (!persistScrollGutter) {
|
|
69
|
-
// in iOS Hybrid Editor windowHeight doesn't exclude keyboardHeight
|
|
70
|
-
// in Android keyboardHeight is always set to -1;
|
|
71
|
-
minHeight = windowHeight - keyboardHeight - 2 * mobilePaddingTop;
|
|
72
|
-
} else {
|
|
73
|
-
// in iOS Compact Editor windowHeight excludes keyboardHeight
|
|
74
|
-
minHeight = windowHeight - mobilePaddingTop;
|
|
75
|
-
// isExpanded can be true of false for Compact editor
|
|
76
|
-
currentIsExpanded = isExpanded;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return jsx(WithFlash, {
|
|
80
|
-
animate: maxContentSizeReached
|
|
81
|
-
}, jsx("div", {
|
|
82
|
-
css: mobileEditor,
|
|
83
|
-
ref: ref
|
|
84
|
-
}, jsx(ClickArea, {
|
|
85
|
-
editorView: editorView || undefined,
|
|
86
|
-
minHeight: minHeight,
|
|
87
|
-
persistScrollGutter: persistScrollGutter,
|
|
88
|
-
isExpanded: currentIsExpanded,
|
|
89
|
-
editorDisabled: editorDisabled
|
|
90
|
-
}, jsx(ContentArea, {
|
|
91
|
-
featureFlags: featureFlags
|
|
92
|
-
}, jsx("div", {
|
|
93
|
-
className: "ak-editor-content-area"
|
|
94
|
-
}, children)))));
|
|
95
|
-
}, [children, editorView, persistScrollGutter, editorDisabled, ref, featureFlags, api === null || api === void 0 || (_api$base2 = api.base) === null || _api$base2 === void 0 ? void 0 : _api$base2.sharedState]);
|
|
96
|
-
return render({
|
|
97
|
-
maxContentSize: maxContentSizeState,
|
|
98
|
-
mobileDimensions: mobileDimensionsState
|
|
99
|
-
});
|
|
100
|
-
});
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { EditorAppearanceComponentProps } from '../../types';
|
|
3
|
-
export default function Mobile({ editorView, maxHeight, persistScrollGutter, editorDOMElement, disabled, contentComponents, editorActions, eventDispatcher, dispatchAnalyticsEvent, providerFactory, appearance, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, innerRef, pluginHooks, featureFlags, }: EditorAppearanceComponentProps<any>): JSX.Element;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
-
import type { FeatureFlags } from '../../types/feature-flags';
|
|
8
|
-
export declare const MobileAppearance: React.ForwardRefExoticComponent<{
|
|
9
|
-
editorView: EditorView | null;
|
|
10
|
-
maxHeight?: number | undefined;
|
|
11
|
-
persistScrollGutter?: boolean | undefined;
|
|
12
|
-
editorDisabled?: boolean | undefined;
|
|
13
|
-
children?: React.ReactNode;
|
|
14
|
-
featureFlags?: FeatureFlags | undefined;
|
|
15
|
-
} & {
|
|
16
|
-
children?: React.ReactNode;
|
|
17
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { EditorAppearanceComponentProps } from '../../types';
|
|
3
|
-
export default function Mobile({ editorView, maxHeight, persistScrollGutter, editorDOMElement, disabled, contentComponents, editorActions, eventDispatcher, dispatchAnalyticsEvent, providerFactory, appearance, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, innerRef, pluginHooks, featureFlags, }: EditorAppearanceComponentProps<any>): JSX.Element;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
-
import type { FeatureFlags } from '../../types/feature-flags';
|
|
8
|
-
export declare const MobileAppearance: React.ForwardRefExoticComponent<{
|
|
9
|
-
editorView: EditorView | null;
|
|
10
|
-
maxHeight?: number | undefined;
|
|
11
|
-
persistScrollGutter?: boolean | undefined;
|
|
12
|
-
editorDisabled?: boolean | undefined;
|
|
13
|
-
children?: React.ReactNode;
|
|
14
|
-
featureFlags?: FeatureFlags | undefined;
|
|
15
|
-
} & {
|
|
16
|
-
children?: React.ReactNode;
|
|
17
|
-
} & React.RefAttributes<HTMLDivElement>>;
|