@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.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/plugins/index.js +0 -21
- package/dist/cjs/presets/universal.js +0 -15
- package/dist/cjs/ui/AppearanceComponents/Mobile.js +3 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/index.js +0 -3
- package/dist/es2019/presets/universal.js +1 -16
- package/dist/es2019/ui/AppearanceComponents/Mobile.js +4 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/index.js +0 -3
- package/dist/esm/presets/universal.js +1 -16
- package/dist/esm/ui/AppearanceComponents/Mobile.js +4 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/index.d.ts +0 -3
- package/dist/types-ts4.5/plugins/index.d.ts +0 -3
- package/package.json +1 -1
- package/dist/cjs/plugins/mobile-dimensions/actions.js +0 -12
- package/dist/cjs/plugins/mobile-dimensions/commands.js +0 -26
- package/dist/cjs/plugins/mobile-dimensions/index.js +0 -99
- package/dist/cjs/plugins/mobile-dimensions/plugin-factory.js +0 -15
- package/dist/cjs/plugins/mobile-dimensions/reducer.js +0 -28
- package/dist/cjs/plugins/mobile-dimensions/types.js +0 -5
- package/dist/cjs/plugins/mobile-selection/content-in-selection.js +0 -24
- package/dist/cjs/plugins/mobile-selection/index.js +0 -18
- package/dist/cjs/plugins/mobile-selection/mobile-selection-plugin.js +0 -59
- package/dist/cjs/plugins/mobile-selection/types.js +0 -5
- package/dist/cjs/plugins/view-update-subscription/index.js +0 -90
- package/dist/cjs/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.js +0 -109
- package/dist/es2019/plugins/mobile-dimensions/actions.js +0 -6
- package/dist/es2019/plugins/mobile-dimensions/commands.js +0 -14
- package/dist/es2019/plugins/mobile-dimensions/index.js +0 -88
- package/dist/es2019/plugins/mobile-dimensions/plugin-factory.js +0 -9
- package/dist/es2019/plugins/mobile-dimensions/reducer.js +0 -21
- package/dist/es2019/plugins/mobile-dimensions/types.js +0 -1
- package/dist/es2019/plugins/mobile-selection/content-in-selection.js +0 -17
- package/dist/es2019/plugins/mobile-selection/index.js +0 -1
- package/dist/es2019/plugins/mobile-selection/mobile-selection-plugin.js +0 -53
- package/dist/es2019/plugins/mobile-selection/types.js +0 -1
- package/dist/es2019/plugins/view-update-subscription/index.js +0 -73
- package/dist/es2019/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.js +0 -106
- package/dist/esm/plugins/mobile-dimensions/actions.js +0 -6
- package/dist/esm/plugins/mobile-dimensions/commands.js +0 -20
- package/dist/esm/plugins/mobile-dimensions/index.js +0 -93
- package/dist/esm/plugins/mobile-dimensions/plugin-factory.js +0 -9
- package/dist/esm/plugins/mobile-dimensions/reducer.js +0 -21
- package/dist/esm/plugins/mobile-dimensions/types.js +0 -1
- package/dist/esm/plugins/mobile-selection/content-in-selection.js +0 -18
- package/dist/esm/plugins/mobile-selection/index.js +0 -1
- package/dist/esm/plugins/mobile-selection/mobile-selection-plugin.js +0 -53
- package/dist/esm/plugins/mobile-selection/types.js +0 -1
- package/dist/esm/plugins/view-update-subscription/index.js +0 -83
- package/dist/esm/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.js +0 -103
- package/dist/types/plugins/mobile-dimensions/actions.d.ts +0 -18
- package/dist/types/plugins/mobile-dimensions/commands.d.ts +0 -3
- package/dist/types/plugins/mobile-dimensions/index.d.ts +0 -7
- package/dist/types/plugins/mobile-dimensions/plugin-factory.d.ts +0 -5
- package/dist/types/plugins/mobile-dimensions/reducer.d.ts +0 -3
- package/dist/types/plugins/mobile-dimensions/types.d.ts +0 -8
- package/dist/types/plugins/mobile-selection/content-in-selection.d.ts +0 -5
- package/dist/types/plugins/mobile-selection/index.d.ts +0 -2
- package/dist/types/plugins/mobile-selection/mobile-selection-plugin.d.ts +0 -7
- package/dist/types/plugins/mobile-selection/types.d.ts +0 -32
- package/dist/types/plugins/view-update-subscription/index.d.ts +0 -19
- package/dist/types/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.d.ts +0 -12
- package/dist/types-ts4.5/plugins/mobile-dimensions/actions.d.ts +0 -18
- package/dist/types-ts4.5/plugins/mobile-dimensions/commands.d.ts +0 -3
- package/dist/types-ts4.5/plugins/mobile-dimensions/index.d.ts +0 -7
- package/dist/types-ts4.5/plugins/mobile-dimensions/plugin-factory.d.ts +0 -5
- package/dist/types-ts4.5/plugins/mobile-dimensions/reducer.d.ts +0 -3
- package/dist/types-ts4.5/plugins/mobile-dimensions/types.d.ts +0 -8
- package/dist/types-ts4.5/plugins/mobile-selection/content-in-selection.d.ts +0 -5
- package/dist/types-ts4.5/plugins/mobile-selection/index.d.ts +0 -2
- package/dist/types-ts4.5/plugins/mobile-selection/mobile-selection-plugin.d.ts +0 -7
- package/dist/types-ts4.5/plugins/mobile-selection/types.d.ts +0 -32
- package/dist/types-ts4.5/plugins/view-update-subscription/index.d.ts +0 -19
- package/dist/types-ts4.5/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.d.ts +0 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 190.1.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#62176](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/62176) [`60bdfaccaa8c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/60bdfaccaa8c) - Move all mobile-only Editor plugins to editor-mobile-bridge package
|
|
8
|
+
|
|
3
9
|
## 190.1.6
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -76,18 +76,6 @@ Object.defineProperty(exports, "jiraIssuePlugin", {
|
|
|
76
76
|
return _jiraIssue.default;
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
|
-
Object.defineProperty(exports, "mobileDimensionsPlugin", {
|
|
80
|
-
enumerable: true,
|
|
81
|
-
get: function get() {
|
|
82
|
-
return _mobileDimensions.default;
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
Object.defineProperty(exports, "mobileSelectionPlugin", {
|
|
86
|
-
enumerable: true,
|
|
87
|
-
get: function get() {
|
|
88
|
-
return _mobileSelection.default;
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
79
|
Object.defineProperty(exports, "pastePlugin", {
|
|
92
80
|
enumerable: true,
|
|
93
81
|
get: function get() {
|
|
@@ -100,12 +88,6 @@ Object.defineProperty(exports, "undoRedoPlugin", {
|
|
|
100
88
|
return _undoRedo.default;
|
|
101
89
|
}
|
|
102
90
|
});
|
|
103
|
-
Object.defineProperty(exports, "viewUpdateSubscriptionPlugin", {
|
|
104
|
-
enumerable: true,
|
|
105
|
-
get: function get() {
|
|
106
|
-
return _viewUpdateSubscription.default;
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
91
|
var _collabEdit = _interopRequireDefault(require("./collab-edit"));
|
|
110
92
|
var _extension = _interopRequireDefault(require("./extension"));
|
|
111
93
|
var _jiraIssue = _interopRequireDefault(require("./jira-issue"));
|
|
@@ -116,10 +98,7 @@ var _dataConsumer = _interopRequireDefault(require("./data-consumer"));
|
|
|
116
98
|
var _annotation = _interopRequireDefault(require("./annotation"));
|
|
117
99
|
var _customAutoformat = _interopRequireDefault(require("./custom-autoformat"));
|
|
118
100
|
var _feedbackDialog = _interopRequireDefault(require("./feedback-dialog"));
|
|
119
|
-
var _mobileDimensions = _interopRequireDefault(require("./mobile-dimensions"));
|
|
120
101
|
var _findReplace = _interopRequireDefault(require("./find-replace"));
|
|
121
|
-
var _mobileSelection = _interopRequireDefault(require("./mobile-selection"));
|
|
122
102
|
var _undoRedo = _interopRequireDefault(require("./undo-redo"));
|
|
123
103
|
var _avatarGroup = _interopRequireDefault(require("./avatar-group"));
|
|
124
|
-
var _viewUpdateSubscription = _interopRequireDefault(require("./view-update-subscription"));
|
|
125
104
|
var _beforePrimaryToolbar = _interopRequireDefault(require("./before-primaryToolbar"));
|
|
@@ -348,16 +348,6 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
348
348
|
return builder.add(_editorPluginHistory.historyPlugin);
|
|
349
349
|
}
|
|
350
350
|
return builder;
|
|
351
|
-
}).maybeAdd(_plugins.mobileDimensionsPlugin, function (plugin, builder) {
|
|
352
|
-
if (isMobile) {
|
|
353
|
-
return builder.add(plugin);
|
|
354
|
-
}
|
|
355
|
-
return builder;
|
|
356
|
-
}).maybeAdd(_plugins.mobileSelectionPlugin, function (plugin, builder) {
|
|
357
|
-
if (isMobile) {
|
|
358
|
-
return builder.add(plugin);
|
|
359
|
-
}
|
|
360
|
-
return builder;
|
|
361
351
|
}).add([_editorPluginToolbarListsIndentation.toolbarListsIndentationPlugin, {
|
|
362
352
|
showIndentationButtons: !!props.showIndentationButtons,
|
|
363
353
|
allowHeadingAndParagraphIndentation: !!props.allowIndentation
|
|
@@ -406,11 +396,6 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
406
396
|
return builder.add(plugin);
|
|
407
397
|
}
|
|
408
398
|
return builder;
|
|
409
|
-
}).maybeAdd(_plugins.viewUpdateSubscriptionPlugin, function (plugin, builder) {
|
|
410
|
-
if (featureFlags.enableViewUpdateSubscription) {
|
|
411
|
-
return builder.add(plugin);
|
|
412
|
-
}
|
|
413
|
-
return builder;
|
|
414
399
|
}).maybeAdd(_editorPluginPasteOptionsToolbar.pasteOptionsToolbarPlugin, function (plugin, builder) {
|
|
415
400
|
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.paste-options-toolbar')) {
|
|
416
401
|
return builder.add(plugin);
|
|
@@ -18,6 +18,9 @@ var _templateObject;
|
|
|
18
18
|
/** @jsx jsx */
|
|
19
19
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
+
// 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.
|
|
22
|
+
// Copied packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/index.ts
|
|
23
|
+
// Copied from packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/types.ts
|
|
21
24
|
var mobileEditor = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n min-height: 30px;\n width: 100%;\n max-width: inherit;\n box-sizing: border-box;\n word-wrap: break-word;\n\n div > .ProseMirror {\n outline: none;\n white-space: pre-wrap;\n padding: 0;\n margin: 0;\n }\n"])));
|
|
22
25
|
var ContentArea = (0, _ContentStyles.createEditorContentStyle)();
|
|
23
26
|
ContentArea.displayName = 'ContentArea';
|
|
@@ -8,10 +8,7 @@ export { default as dataConsumerMarkPlugin } from './data-consumer';
|
|
|
8
8
|
export { default as annotationPlugin } from './annotation';
|
|
9
9
|
export { default as customAutoformatPlugin } from './custom-autoformat';
|
|
10
10
|
export { default as feedbackDialogPlugin } from './feedback-dialog';
|
|
11
|
-
export { default as mobileDimensionsPlugin } from './mobile-dimensions';
|
|
12
11
|
export { default as findReplacePlugin } from './find-replace';
|
|
13
|
-
export { default as mobileSelectionPlugin } from './mobile-selection';
|
|
14
12
|
export { default as undoRedoPlugin } from './undo-redo';
|
|
15
13
|
export { default as avatarGroupPlugin } from './avatar-group';
|
|
16
|
-
export { default as viewUpdateSubscriptionPlugin } from './view-update-subscription';
|
|
17
14
|
export { default as beforePrimaryToolbarPlugin } from './before-primaryToolbar';
|
|
@@ -33,7 +33,7 @@ import { tasksAndDecisionsPlugin } from '@atlaskit/editor-plugin-tasks-and-decis
|
|
|
33
33
|
import { textColorPlugin } from '@atlaskit/editor-plugin-text-color';
|
|
34
34
|
import { toolbarListsIndentationPlugin } from '@atlaskit/editor-plugin-toolbar-lists-indentation';
|
|
35
35
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
36
|
-
import { alignmentPlugin, annotationPlugin, avatarGroupPlugin, beforePrimaryToolbarPlugin, breakoutPlugin, collabEditPlugin, customAutoformatPlugin, dataConsumerMarkPlugin, extensionPlugin, feedbackDialogPlugin, findReplacePlugin, jiraIssuePlugin
|
|
36
|
+
import { alignmentPlugin, annotationPlugin, avatarGroupPlugin, beforePrimaryToolbarPlugin, breakoutPlugin, collabEditPlugin, customAutoformatPlugin, dataConsumerMarkPlugin, extensionPlugin, feedbackDialogPlugin, findReplacePlugin, jiraIssuePlugin } from '../plugins';
|
|
37
37
|
import { shouldForceTracking } from '@atlaskit/editor-common/utils';
|
|
38
38
|
import { isFullPage as fullPageCheck } from '../utils/is-full-page';
|
|
39
39
|
import { createDefaultPreset } from './default';
|
|
@@ -344,16 +344,6 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
344
344
|
return builder.add(historyPlugin);
|
|
345
345
|
}
|
|
346
346
|
return builder;
|
|
347
|
-
}).maybeAdd(mobileDimensionsPlugin, (plugin, builder) => {
|
|
348
|
-
if (isMobile) {
|
|
349
|
-
return builder.add(plugin);
|
|
350
|
-
}
|
|
351
|
-
return builder;
|
|
352
|
-
}).maybeAdd(mobileSelectionPlugin, (plugin, builder) => {
|
|
353
|
-
if (isMobile) {
|
|
354
|
-
return builder.add(plugin);
|
|
355
|
-
}
|
|
356
|
-
return builder;
|
|
357
347
|
}).add([toolbarListsIndentationPlugin, {
|
|
358
348
|
showIndentationButtons: !!props.showIndentationButtons,
|
|
359
349
|
allowHeadingAndParagraphIndentation: !!props.allowIndentation
|
|
@@ -402,11 +392,6 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
402
392
|
return builder.add(plugin);
|
|
403
393
|
}
|
|
404
394
|
return builder;
|
|
405
|
-
}).maybeAdd(viewUpdateSubscriptionPlugin, (plugin, builder) => {
|
|
406
|
-
if (featureFlags.enableViewUpdateSubscription) {
|
|
407
|
-
return builder.add(plugin);
|
|
408
|
-
}
|
|
409
|
-
return builder;
|
|
410
395
|
}).maybeAdd(pasteOptionsToolbarPlugin, (plugin, builder) => {
|
|
411
396
|
if (getBooleanFF('platform.editor.paste-options-toolbar')) {
|
|
412
397
|
return builder.add(plugin);
|
|
@@ -6,6 +6,10 @@ import { createEditorContentStyle } from '../ContentStyles';
|
|
|
6
6
|
import { ClickAreaMobile as ClickArea } from '../Addon';
|
|
7
7
|
import { usePresetContext } from '../../presets/context';
|
|
8
8
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
9
|
+
|
|
10
|
+
// 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.
|
|
11
|
+
// Copied packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/index.ts
|
|
12
|
+
// Copied from packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/types.ts
|
|
9
13
|
const mobileEditor = css`
|
|
10
14
|
min-height: 30px;
|
|
11
15
|
width: 100%;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "190.1.
|
|
2
|
+
export const version = "190.1.7";
|
|
@@ -8,10 +8,7 @@ export { default as dataConsumerMarkPlugin } from './data-consumer';
|
|
|
8
8
|
export { default as annotationPlugin } from './annotation';
|
|
9
9
|
export { default as customAutoformatPlugin } from './custom-autoformat';
|
|
10
10
|
export { default as feedbackDialogPlugin } from './feedback-dialog';
|
|
11
|
-
export { default as mobileDimensionsPlugin } from './mobile-dimensions';
|
|
12
11
|
export { default as findReplacePlugin } from './find-replace';
|
|
13
|
-
export { default as mobileSelectionPlugin } from './mobile-selection';
|
|
14
12
|
export { default as undoRedoPlugin } from './undo-redo';
|
|
15
13
|
export { default as avatarGroupPlugin } from './avatar-group';
|
|
16
|
-
export { default as viewUpdateSubscriptionPlugin } from './view-update-subscription';
|
|
17
14
|
export { default as beforePrimaryToolbarPlugin } from './before-primaryToolbar';
|
|
@@ -37,7 +37,7 @@ import { tasksAndDecisionsPlugin } from '@atlaskit/editor-plugin-tasks-and-decis
|
|
|
37
37
|
import { textColorPlugin } from '@atlaskit/editor-plugin-text-color';
|
|
38
38
|
import { toolbarListsIndentationPlugin } from '@atlaskit/editor-plugin-toolbar-lists-indentation';
|
|
39
39
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
40
|
-
import { alignmentPlugin, annotationPlugin, avatarGroupPlugin, beforePrimaryToolbarPlugin, breakoutPlugin, collabEditPlugin, customAutoformatPlugin, dataConsumerMarkPlugin, extensionPlugin, feedbackDialogPlugin, findReplacePlugin, jiraIssuePlugin
|
|
40
|
+
import { alignmentPlugin, annotationPlugin, avatarGroupPlugin, beforePrimaryToolbarPlugin, breakoutPlugin, collabEditPlugin, customAutoformatPlugin, dataConsumerMarkPlugin, extensionPlugin, feedbackDialogPlugin, findReplacePlugin, jiraIssuePlugin } from '../plugins';
|
|
41
41
|
import { shouldForceTracking } from '@atlaskit/editor-common/utils';
|
|
42
42
|
import { isFullPage as fullPageCheck } from '../utils/is-full-page';
|
|
43
43
|
import { createDefaultPreset } from './default';
|
|
@@ -340,16 +340,6 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
340
340
|
return builder.add(historyPlugin);
|
|
341
341
|
}
|
|
342
342
|
return builder;
|
|
343
|
-
}).maybeAdd(mobileDimensionsPlugin, function (plugin, builder) {
|
|
344
|
-
if (isMobile) {
|
|
345
|
-
return builder.add(plugin);
|
|
346
|
-
}
|
|
347
|
-
return builder;
|
|
348
|
-
}).maybeAdd(mobileSelectionPlugin, function (plugin, builder) {
|
|
349
|
-
if (isMobile) {
|
|
350
|
-
return builder.add(plugin);
|
|
351
|
-
}
|
|
352
|
-
return builder;
|
|
353
343
|
}).add([toolbarListsIndentationPlugin, {
|
|
354
344
|
showIndentationButtons: !!props.showIndentationButtons,
|
|
355
345
|
allowHeadingAndParagraphIndentation: !!props.allowIndentation
|
|
@@ -398,11 +388,6 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
398
388
|
return builder.add(plugin);
|
|
399
389
|
}
|
|
400
390
|
return builder;
|
|
401
|
-
}).maybeAdd(viewUpdateSubscriptionPlugin, function (plugin, builder) {
|
|
402
|
-
if (featureFlags.enableViewUpdateSubscription) {
|
|
403
|
-
return builder.add(plugin);
|
|
404
|
-
}
|
|
405
|
-
return builder;
|
|
406
391
|
}).maybeAdd(pasteOptionsToolbarPlugin, function (plugin, builder) {
|
|
407
392
|
if (getBooleanFF('platform.editor.paste-options-toolbar')) {
|
|
408
393
|
return builder.add(plugin);
|
|
@@ -8,6 +8,10 @@ import { createEditorContentStyle } from '../ContentStyles';
|
|
|
8
8
|
import { ClickAreaMobile as ClickArea } from '../Addon';
|
|
9
9
|
import { usePresetContext } from '../../presets/context';
|
|
10
10
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
11
|
+
|
|
12
|
+
// 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.
|
|
13
|
+
// Copied packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/index.ts
|
|
14
|
+
// Copied from packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/types.ts
|
|
11
15
|
var mobileEditor = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n min-height: 30px;\n width: 100%;\n max-width: inherit;\n box-sizing: border-box;\n word-wrap: break-word;\n\n div > .ProseMirror {\n outline: none;\n white-space: pre-wrap;\n padding: 0;\n margin: 0;\n }\n"])));
|
|
12
16
|
var ContentArea = createEditorContentStyle();
|
|
13
17
|
ContentArea.displayName = 'ContentArea';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "190.1.
|
|
2
|
+
export var version = "190.1.7";
|
|
@@ -8,10 +8,7 @@ export { default as dataConsumerMarkPlugin } from './data-consumer';
|
|
|
8
8
|
export { default as annotationPlugin } from './annotation';
|
|
9
9
|
export { default as customAutoformatPlugin } from './custom-autoformat';
|
|
10
10
|
export { default as feedbackDialogPlugin } from './feedback-dialog';
|
|
11
|
-
export { default as mobileDimensionsPlugin } from './mobile-dimensions';
|
|
12
11
|
export { default as findReplacePlugin } from './find-replace';
|
|
13
|
-
export { default as mobileSelectionPlugin } from './mobile-selection';
|
|
14
12
|
export { default as undoRedoPlugin } from './undo-redo';
|
|
15
13
|
export { default as avatarGroupPlugin } from './avatar-group';
|
|
16
|
-
export { default as viewUpdateSubscriptionPlugin } from './view-update-subscription';
|
|
17
14
|
export { default as beforePrimaryToolbarPlugin } from './before-primaryToolbar';
|
|
@@ -8,10 +8,7 @@ export { default as dataConsumerMarkPlugin } from './data-consumer';
|
|
|
8
8
|
export { default as annotationPlugin } from './annotation';
|
|
9
9
|
export { default as customAutoformatPlugin } from './custom-autoformat';
|
|
10
10
|
export { default as feedbackDialogPlugin } from './feedback-dialog';
|
|
11
|
-
export { default as mobileDimensionsPlugin } from './mobile-dimensions';
|
|
12
11
|
export { default as findReplacePlugin } from './find-replace';
|
|
13
|
-
export { default as mobileSelectionPlugin } from './mobile-selection';
|
|
14
12
|
export { default as undoRedoPlugin } from './undo-redo';
|
|
15
13
|
export { default as avatarGroupPlugin } from './avatar-group';
|
|
16
|
-
export { default as viewUpdateSubscriptionPlugin } from './view-update-subscription';
|
|
17
14
|
export { default as beforePrimaryToolbarPlugin } from './before-primaryToolbar';
|
package/package.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.MobileDimensionsActionTypes = void 0;
|
|
7
|
-
var MobileDimensionsActionTypes = exports.MobileDimensionsActionTypes = /*#__PURE__*/function (MobileDimensionsActionTypes) {
|
|
8
|
-
MobileDimensionsActionTypes["SET_WINDOW_HEIGHT"] = "SET_WINDOW_HEIGHT";
|
|
9
|
-
MobileDimensionsActionTypes["SET_MOBILE_PADDING_TOP"] = "SET_MOBILE_PADDING_TOP";
|
|
10
|
-
MobileDimensionsActionTypes["SET_IS_EXPANDED"] = "SET_IS_EXPANDED";
|
|
11
|
-
return MobileDimensionsActionTypes;
|
|
12
|
-
}({});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.setWindowHeight = exports.setMobilePaddingTop = exports.setIsExpanded = void 0;
|
|
7
|
-
var _actions = require("./actions");
|
|
8
|
-
var _pluginFactory = require("./plugin-factory");
|
|
9
|
-
var setWindowHeight = exports.setWindowHeight = function setWindowHeight(windowHeight) {
|
|
10
|
-
return (0, _pluginFactory.createCommand)({
|
|
11
|
-
type: _actions.MobileDimensionsActionTypes.SET_WINDOW_HEIGHT,
|
|
12
|
-
windowHeight: windowHeight
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
var setMobilePaddingTop = exports.setMobilePaddingTop = function setMobilePaddingTop(paddingTop) {
|
|
16
|
-
return (0, _pluginFactory.createCommand)({
|
|
17
|
-
type: _actions.MobileDimensionsActionTypes.SET_MOBILE_PADDING_TOP,
|
|
18
|
-
paddingTop: paddingTop
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var setIsExpanded = exports.setIsExpanded = function setIsExpanded(isExpanded) {
|
|
22
|
-
return (0, _pluginFactory.createCommand)({
|
|
23
|
-
type: _actions.MobileDimensionsActionTypes.SET_IS_EXPANDED,
|
|
24
|
-
isExpanded: isExpanded
|
|
25
|
-
});
|
|
26
|
-
};
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
8
|
-
var _commands = require("./commands");
|
|
9
|
-
var _pluginFactory = require("./plugin-factory");
|
|
10
|
-
var getInitialState = function getInitialState() {
|
|
11
|
-
return {
|
|
12
|
-
mobilePaddingTop: 0,
|
|
13
|
-
windowHeight: window.innerHeight,
|
|
14
|
-
isExpanded: false
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Plugin to store the dimensions of the mobile such as keyboard height and window size
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
var createPlugin = function createPlugin(dispatch) {
|
|
23
|
-
var rafId;
|
|
24
|
-
return new _safePlugin.SafePlugin({
|
|
25
|
-
state: (0, _pluginFactory.createPluginState)(dispatch, getInitialState),
|
|
26
|
-
key: _pluginFactory.mobileDimensionsPluginKey,
|
|
27
|
-
props: {
|
|
28
|
-
scrollThreshold: {
|
|
29
|
-
top: 12,
|
|
30
|
-
left: 0,
|
|
31
|
-
right: 0,
|
|
32
|
-
bottom: 12
|
|
33
|
-
},
|
|
34
|
-
scrollMargin: {
|
|
35
|
-
top: 12,
|
|
36
|
-
bottom: 12,
|
|
37
|
-
left: 0,
|
|
38
|
-
right: 0
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
view: function view(editorView) {
|
|
42
|
-
var handleResize = function handleResize() {
|
|
43
|
-
if (rafId) {
|
|
44
|
-
window.cancelAnimationFrame(rafId);
|
|
45
|
-
}
|
|
46
|
-
var windowInnerHeight = window.innerHeight;
|
|
47
|
-
var count = 0;
|
|
48
|
-
var checkWindowHeight = function checkWindowHeight() {
|
|
49
|
-
// wait for height to stabilise before we commit to set it
|
|
50
|
-
// this helps handle menu transitions in Android which we don't want to scroll for
|
|
51
|
-
if (window.innerHeight === windowInnerHeight) {
|
|
52
|
-
count++;
|
|
53
|
-
if (count >= 5) {
|
|
54
|
-
rafId = undefined;
|
|
55
|
-
(0, _commands.setWindowHeight)(window.innerHeight)(editorView.state, editorView.dispatch);
|
|
56
|
-
} else {
|
|
57
|
-
rafId = requestAnimationFrame(checkWindowHeight);
|
|
58
|
-
}
|
|
59
|
-
} else {
|
|
60
|
-
rafId = requestAnimationFrame(checkWindowHeight);
|
|
61
|
-
}
|
|
62
|
-
windowInnerHeight = window.innerHeight;
|
|
63
|
-
};
|
|
64
|
-
rafId = requestAnimationFrame(checkWindowHeight);
|
|
65
|
-
};
|
|
66
|
-
// the window will resize on Android when the keyboard shows/hides
|
|
67
|
-
window.addEventListener('resize', handleResize);
|
|
68
|
-
return {
|
|
69
|
-
destroy: function destroy() {
|
|
70
|
-
window.removeEventListener('resize', handleResize);
|
|
71
|
-
if (rafId) {
|
|
72
|
-
window.cancelAnimationFrame(rafId);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
var mobileDimensionsPlugin = function mobileDimensionsPlugin() {
|
|
80
|
-
return {
|
|
81
|
-
name: 'mobileDimensions',
|
|
82
|
-
getSharedState: function getSharedState(editorState) {
|
|
83
|
-
if (!editorState) {
|
|
84
|
-
return undefined;
|
|
85
|
-
}
|
|
86
|
-
return _pluginFactory.mobileDimensionsPluginKey.getState(editorState);
|
|
87
|
-
},
|
|
88
|
-
pmPlugins: function pmPlugins() {
|
|
89
|
-
return [{
|
|
90
|
-
name: 'mobileDimensions',
|
|
91
|
-
plugin: function plugin(_ref) {
|
|
92
|
-
var dispatch = _ref.dispatch;
|
|
93
|
-
return createPlugin(dispatch);
|
|
94
|
-
}
|
|
95
|
-
}];
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
var _default = exports.default = mobileDimensionsPlugin;
|
|
@@ -1,15 +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.mobileDimensionsPluginKey = exports.getPluginState = exports.createPluginState = exports.createCommand = void 0;
|
|
8
|
-
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
|
-
var _pluginStateFactory = require("../../utils/plugin-state-factory");
|
|
10
|
-
var _reducer = _interopRequireDefault(require("./reducer"));
|
|
11
|
-
var mobileDimensionsPluginKey = exports.mobileDimensionsPluginKey = new _state.PluginKey('mobileDimensions');
|
|
12
|
-
var _pluginFactory = (0, _pluginStateFactory.pluginFactory)(mobileDimensionsPluginKey, _reducer.default),
|
|
13
|
-
createPluginState = exports.createPluginState = _pluginFactory.createPluginState,
|
|
14
|
-
getPluginState = exports.getPluginState = _pluginFactory.getPluginState,
|
|
15
|
-
createCommand = exports.createCommand = _pluginFactory.createCommand;
|
|
@@ -1,28 +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 = _default;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _actions = require("./actions");
|
|
10
|
-
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; }
|
|
11
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
-
function _default(state, action) {
|
|
13
|
-
switch (action.type) {
|
|
14
|
-
case _actions.MobileDimensionsActionTypes.SET_WINDOW_HEIGHT:
|
|
15
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
16
|
-
windowHeight: action.windowHeight
|
|
17
|
-
});
|
|
18
|
-
case _actions.MobileDimensionsActionTypes.SET_MOBILE_PADDING_TOP:
|
|
19
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
20
|
-
mobilePaddingTop: action.paddingTop
|
|
21
|
-
});
|
|
22
|
-
case _actions.MobileDimensionsActionTypes.SET_IS_EXPANDED:
|
|
23
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
24
|
-
isExpanded: action.isExpanded
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return state;
|
|
28
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.contentInSelection = void 0;
|
|
7
|
-
// Gets a plain text representation of the nodes in the current selection
|
|
8
|
-
var contentInSelection = exports.contentInSelection = function contentInSelection(_ref) {
|
|
9
|
-
var selection = _ref.selection,
|
|
10
|
-
doc = _ref.doc;
|
|
11
|
-
var nodes = new Array();
|
|
12
|
-
var marks = new Array();
|
|
13
|
-
doc.nodesBetween(selection.from, selection.to, function (node) {
|
|
14
|
-
nodes.push(node.type.name);
|
|
15
|
-
node.marks.forEach(function (mark) {
|
|
16
|
-
return marks.push(mark.type.name);
|
|
17
|
-
});
|
|
18
|
-
return true;
|
|
19
|
-
});
|
|
20
|
-
return {
|
|
21
|
-
nodeTypes: Array.from(nodes),
|
|
22
|
-
markTypes: Array.from(marks)
|
|
23
|
-
};
|
|
24
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "default", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _mobileSelectionPlugin.mobileSelectionPlugin;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "selectionPluginKey", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _mobileSelectionPlugin.selectionPluginKey;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
var _mobileSelectionPlugin = require("./mobile-selection-plugin");
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.selectionPluginKey = exports.mobileSelectionPlugin = exports.createProseMirrorPlugin = void 0;
|
|
7
|
-
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
8
|
-
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
|
-
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
10
|
-
var _contentInSelection2 = require("./content-in-selection");
|
|
11
|
-
var selectionPluginKey = exports.selectionPluginKey = new _state.PluginKey('mobile-selection');
|
|
12
|
-
var createProseMirrorPlugin = exports.createProseMirrorPlugin = function createProseMirrorPlugin(dispatch) {
|
|
13
|
-
return new _safePlugin.SafePlugin({
|
|
14
|
-
view: function view(editorView) {
|
|
15
|
-
var domAtPos = editorView.domAtPos.bind(editorView);
|
|
16
|
-
return {
|
|
17
|
-
update: function update(view, previousState) {
|
|
18
|
-
var state = view.state,
|
|
19
|
-
_view$state = view.state,
|
|
20
|
-
selection = _view$state.selection,
|
|
21
|
-
doc = _view$state.doc;
|
|
22
|
-
if (previousState.doc.eq(doc) && previousState.selection.eq(selection)) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
var ref = (0, _utils.findDomRefAtPos)(selection.$anchor.pos, domAtPos);
|
|
26
|
-
var _ref$getBoundingClien = ref.getBoundingClientRect(),
|
|
27
|
-
top = _ref$getBoundingClien.top,
|
|
28
|
-
left = _ref$getBoundingClien.left;
|
|
29
|
-
var _contentInSelection = (0, _contentInSelection2.contentInSelection)(state),
|
|
30
|
-
nodeTypes = _contentInSelection.nodeTypes,
|
|
31
|
-
markTypes = _contentInSelection.markTypes;
|
|
32
|
-
dispatch(selectionPluginKey, {
|
|
33
|
-
rect: {
|
|
34
|
-
top: Math.round(top),
|
|
35
|
-
left: Math.round(left)
|
|
36
|
-
},
|
|
37
|
-
selection: state.selection.toJSON(),
|
|
38
|
-
nodeTypes: nodeTypes,
|
|
39
|
-
markTypes: markTypes
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
var mobileSelectionPlugin = exports.mobileSelectionPlugin = function mobileSelectionPlugin() {
|
|
47
|
-
return {
|
|
48
|
-
name: 'mobileSelection',
|
|
49
|
-
pmPlugins: function pmPlugins() {
|
|
50
|
-
return [{
|
|
51
|
-
name: 'mobileSelection',
|
|
52
|
-
plugin: function plugin(_ref) {
|
|
53
|
-
var dispatch = _ref.dispatch;
|
|
54
|
-
return createProseMirrorPlugin(dispatch);
|
|
55
|
-
}
|
|
56
|
-
}];
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
};
|