@atlaskit/editor-core 165.0.0 → 166.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 +31 -0
- package/dist/cjs/actions/index.js +9 -0
- package/dist/cjs/create-editor/ReactEditorView.js +14 -6
- package/dist/cjs/create-editor/create-plugins-list.js +1 -2
- package/dist/cjs/editor.js +13 -0
- package/dist/cjs/event-dispatcher/index.js +9 -0
- package/dist/cjs/nodeviews/ReactNodeView.js +1 -11
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/cjs/plugins/analytics/types/enums.js +1 -0
- package/dist/cjs/plugins/base/pm-plugins/frozen-editor.js +128 -79
- package/dist/cjs/plugins/base/utils/input-latency-tracking.js +157 -0
- package/dist/cjs/plugins/card/styles.js +3 -1
- package/dist/cjs/plugins/code-block/styles.js +6 -4
- package/dist/cjs/plugins/collab-edit/plugin-state.js +23 -5
- package/dist/cjs/plugins/date/styles.js +3 -1
- package/dist/cjs/plugins/emoji/index.js +30 -34
- package/dist/cjs/plugins/emoji/nodeviews/emoji.js +12 -66
- package/dist/cjs/plugins/emoji/styles.js +3 -17
- package/dist/cjs/plugins/expand/ui/styles.js +2 -2
- package/dist/cjs/plugins/extension/ui/styles.js +3 -1
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
- package/dist/cjs/plugins/hyperlink/pm-plugins/input-rule.js +1 -9
- package/dist/cjs/plugins/hyperlink/pm-plugins/keymap.js +1 -9
- package/dist/cjs/plugins/layout/styles.js +3 -1
- package/dist/cjs/plugins/list/commands/indent-list.js +5 -1
- package/dist/cjs/plugins/list/commands/outdent-list.js +5 -1
- package/dist/cjs/plugins/list/transforms.js +11 -3
- package/dist/cjs/plugins/media/styles.js +3 -1
- package/dist/cjs/plugins/mentions/index.js +10 -14
- package/dist/cjs/plugins/mentions/nodeviews/mention.js +15 -67
- package/dist/cjs/plugins/mentions/pm-plugins/main.js +19 -10
- package/dist/cjs/plugins/mentions/type-ahead/index.js +7 -2
- package/dist/cjs/plugins/panel/styles.js +3 -1
- package/dist/cjs/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
- package/dist/cjs/plugins/rule/styles.js +3 -1
- package/dist/cjs/plugins/selection/utils.js +39 -23
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +24 -0
- package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
- package/dist/cjs/plugins/table/ui/consts.js +6 -4
- package/dist/cjs/plugins/tasks-and-decisions/styles.js +3 -1
- package/dist/cjs/plugins/type-ahead/index.js +6 -2
- package/dist/cjs/plugins/unsupported-content/index.js +22 -10
- package/dist/cjs/plugins/unsupported-content/styles.js +4 -2
- package/dist/cjs/plugins/unsupported-content/unsupported-inline-node-view.js +21 -0
- package/dist/cjs/ui/Appearance/Chromeless.js +6 -3
- package/dist/cjs/ui/Appearance/Comment/Comment.js +6 -4
- package/dist/cjs/ui/ChromeCollapsed/styles.js +3 -1
- package/dist/cjs/ui/ContentStyles/index.js +2 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +12 -1
- package/dist/es2019/create-editor/ReactEditorView.js +14 -6
- package/dist/es2019/create-editor/create-plugins-list.js +1 -2
- package/dist/es2019/editor.js +14 -0
- package/dist/es2019/event-dispatcher/index.js +8 -0
- package/dist/es2019/nodeviews/ReactNodeView.js +1 -10
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +9 -0
- package/dist/es2019/plugins/analytics/types/enums.js +1 -0
- package/dist/es2019/plugins/base/pm-plugins/frozen-editor.js +138 -80
- package/dist/es2019/plugins/base/utils/input-latency-tracking.js +128 -0
- package/dist/es2019/plugins/card/styles.js +9 -5
- package/dist/es2019/plugins/code-block/styles.js +11 -8
- package/dist/es2019/plugins/collab-edit/plugin-state.js +23 -8
- package/dist/es2019/plugins/date/styles.js +3 -1
- package/dist/es2019/plugins/emoji/index.js +16 -21
- package/dist/es2019/plugins/emoji/nodeviews/emoji.js +12 -31
- package/dist/es2019/plugins/emoji/styles.js +1 -82
- package/dist/es2019/plugins/expand/ui/styles.js +2 -2
- package/dist/es2019/plugins/extension/ui/styles.js +4 -2
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
- package/dist/es2019/plugins/hyperlink/pm-plugins/input-rule.js +1 -8
- package/dist/es2019/plugins/hyperlink/pm-plugins/keymap.js +1 -8
- package/dist/es2019/plugins/layout/styles.js +3 -2
- package/dist/es2019/plugins/list/commands/indent-list.js +4 -1
- package/dist/es2019/plugins/list/commands/outdent-list.js +4 -1
- package/dist/es2019/plugins/list/transforms.js +9 -4
- package/dist/es2019/plugins/media/styles.js +9 -7
- package/dist/es2019/plugins/mentions/index.js +1 -6
- package/dist/es2019/plugins/mentions/nodeviews/mention.js +16 -35
- package/dist/es2019/plugins/mentions/pm-plugins/main.js +18 -10
- package/dist/es2019/plugins/mentions/type-ahead/index.js +7 -2
- package/dist/es2019/plugins/panel/styles.js +5 -4
- package/dist/es2019/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
- package/dist/es2019/plugins/rule/styles.js +2 -1
- package/dist/es2019/plugins/selection/utils.js +35 -20
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +22 -0
- package/dist/es2019/plugins/table/ui/common-styles.js +4 -0
- package/dist/es2019/plugins/table/ui/consts.js +5 -4
- package/dist/es2019/plugins/tasks-and-decisions/styles.js +4 -2
- package/dist/es2019/plugins/type-ahead/index.js +5 -1
- package/dist/es2019/plugins/unsupported-content/index.js +23 -12
- package/dist/es2019/plugins/unsupported-content/styles.js +5 -3
- package/dist/es2019/plugins/unsupported-content/unsupported-inline-node-view.js +7 -0
- package/dist/es2019/ui/Appearance/Chromeless.js +5 -2
- package/dist/es2019/ui/Appearance/Comment/Comment.js +5 -2
- package/dist/es2019/ui/ChromeCollapsed/styles.js +2 -1
- package/dist/es2019/ui/ContentStyles/index.js +3 -3
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +8 -0
- package/dist/esm/create-editor/ReactEditorView.js +14 -6
- package/dist/esm/create-editor/create-plugins-list.js +1 -2
- package/dist/esm/editor.js +14 -0
- package/dist/esm/event-dispatcher/index.js +9 -0
- package/dist/esm/nodeviews/ReactNodeView.js +1 -10
- package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/esm/plugins/analytics/types/enums.js +1 -0
- package/dist/esm/plugins/base/pm-plugins/frozen-editor.js +128 -79
- package/dist/esm/plugins/base/utils/input-latency-tracking.js +149 -0
- package/dist/esm/plugins/card/styles.js +2 -1
- package/dist/esm/plugins/code-block/styles.js +5 -4
- package/dist/esm/plugins/collab-edit/plugin-state.js +21 -6
- package/dist/esm/plugins/date/styles.js +2 -1
- package/dist/esm/plugins/emoji/index.js +26 -29
- package/dist/esm/plugins/emoji/nodeviews/emoji.js +11 -56
- package/dist/esm/plugins/emoji/styles.js +3 -14
- package/dist/esm/plugins/expand/ui/styles.js +2 -2
- package/dist/esm/plugins/extension/ui/styles.js +2 -1
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
- package/dist/esm/plugins/hyperlink/pm-plugins/input-rule.js +1 -8
- package/dist/esm/plugins/hyperlink/pm-plugins/keymap.js +1 -8
- package/dist/esm/plugins/layout/styles.js +2 -1
- package/dist/esm/plugins/list/commands/indent-list.js +4 -1
- package/dist/esm/plugins/list/commands/outdent-list.js +4 -1
- package/dist/esm/plugins/list/transforms.js +9 -4
- package/dist/esm/plugins/media/styles.js +2 -1
- package/dist/esm/plugins/mentions/index.js +10 -14
- package/dist/esm/plugins/mentions/nodeviews/mention.js +13 -58
- package/dist/esm/plugins/mentions/pm-plugins/main.js +18 -10
- package/dist/esm/plugins/mentions/type-ahead/index.js +7 -2
- package/dist/esm/plugins/panel/styles.js +2 -1
- package/dist/esm/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
- package/dist/esm/plugins/rule/styles.js +2 -1
- package/dist/esm/plugins/selection/utils.js +35 -20
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +23 -0
- package/dist/esm/plugins/table/ui/common-styles.js +1 -1
- package/dist/esm/plugins/table/ui/consts.js +5 -4
- package/dist/esm/plugins/tasks-and-decisions/styles.js +2 -1
- package/dist/esm/plugins/type-ahead/index.js +6 -2
- package/dist/esm/plugins/unsupported-content/index.js +21 -11
- package/dist/esm/plugins/unsupported-content/styles.js +3 -2
- package/dist/esm/plugins/unsupported-content/unsupported-inline-node-view.js +7 -0
- package/dist/esm/ui/Appearance/Chromeless.js +6 -3
- package/dist/esm/ui/Appearance/Comment/Comment.js +6 -4
- package/dist/esm/ui/ChromeCollapsed/styles.js +2 -1
- package/dist/esm/ui/ContentStyles/index.js +3 -3
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +3 -1
- package/dist/types/editor.d.ts +3 -0
- package/dist/types/event-dispatcher/index.d.ts +1 -0
- package/dist/types/nodeviews/ReactNodeView.d.ts +1 -5
- package/dist/types/plugins/analytics/types/enums.d.ts +1 -0
- package/dist/types/plugins/analytics/types/events.d.ts +2 -2
- package/dist/types/plugins/analytics/types/general-events.d.ts +10 -1
- package/dist/types/plugins/base/utils/input-latency-tracking.d.ts +44 -0
- package/dist/types/plugins/collab-edit/plugin-state.d.ts +4 -0
- package/dist/types/plugins/emoji/index.d.ts +2 -6
- package/dist/types/plugins/emoji/nodeviews/emoji.d.ts +4 -14
- package/dist/types/plugins/emoji/styles.d.ts +0 -1
- package/dist/types/plugins/emoji/types.d.ts +0 -1
- package/dist/types/plugins/list/transforms.d.ts +10 -1
- package/dist/types/plugins/mentions/nodeviews/mention.d.ts +6 -14
- package/dist/types/plugins/mentions/pm-plugins/main.d.ts +2 -5
- package/dist/types/plugins/selection/utils.d.ts +7 -15
- package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +3 -0
- package/dist/types/plugins/table/ui/consts.d.ts +2 -2
- package/dist/types/plugins/type-ahead/types.d.ts +1 -0
- package/dist/types/plugins/unsupported-content/unsupported-inline-node-view.d.ts +11 -0
- package/dist/types/types/editor-appearance-component.d.ts +1 -0
- package/dist/types/types/editor-props.d.ts +1 -0
- package/dist/types/types/feature-flags.d.ts +0 -14
- package/dist/types/ui/Appearance/Chromeless.d.ts +1 -0
- package/dist/types/ui/Appearance/Comment/Comment.d.ts +1 -0
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +4 -4
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/package.json +22 -22
- package/dist/cjs/plugins/emoji/nodeviews/emoji-next.js +0 -250
- package/dist/es2019/plugins/emoji/nodeviews/emoji-next.js +0 -177
- package/dist/esm/plugins/emoji/nodeviews/emoji-next.js +0 -234
- package/dist/types/plugins/emoji/nodeviews/emoji-next.d.ts +0 -31
|
@@ -1,60 +1,15 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _get from "@babel/runtime/helpers/get";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
|
|
8
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
|
-
|
|
10
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11
|
-
|
|
12
1
|
import React from 'react';
|
|
13
|
-
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
|
|
14
2
|
import Mention from '../ui/Mention';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
key: "createDomRef",
|
|
29
|
-
value: function createDomRef() {
|
|
30
|
-
return _get(_getPrototypeOf(MentionNodeView.prototype), "createDomRef", this).call(this);
|
|
31
|
-
}
|
|
32
|
-
}, {
|
|
33
|
-
key: "render",
|
|
34
|
-
value: function render(props) {
|
|
35
|
-
var providerFactory = props.providerFactory,
|
|
36
|
-
options = props.options;
|
|
37
|
-
var _this$node$attrs = this.node.attrs,
|
|
38
|
-
id = _this$node$attrs.id,
|
|
39
|
-
text = _this$node$attrs.text,
|
|
40
|
-
accessLevel = _this$node$attrs.accessLevel;
|
|
41
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Mention, {
|
|
42
|
-
id: id,
|
|
43
|
-
text: text,
|
|
44
|
-
accessLevel: accessLevel,
|
|
45
|
-
providers: providerFactory
|
|
46
|
-
}), options && options.allowZeroWidthSpaceAfter && ZERO_WIDTH_SPACE);
|
|
47
|
-
}
|
|
48
|
-
}]);
|
|
49
|
-
|
|
50
|
-
return MentionNodeView;
|
|
51
|
-
}(ReactNodeView);
|
|
52
|
-
export default function mentionNodeView(portalProviderAPI, eventDispatcher, providerFactory, options) {
|
|
53
|
-
return function (node, view, getPos) {
|
|
54
|
-
var hasIntlContext = true;
|
|
55
|
-
return new MentionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
56
|
-
providerFactory: providerFactory,
|
|
57
|
-
options: options
|
|
58
|
-
}, undefined, undefined, undefined, hasIntlContext).init();
|
|
59
|
-
};
|
|
60
|
-
}
|
|
3
|
+
export var MentionNodeView = function MentionNodeView(props) {
|
|
4
|
+
var providerFactory = props.providerFactory;
|
|
5
|
+
var _props$node$attrs = props.node.attrs,
|
|
6
|
+
id = _props$node$attrs.id,
|
|
7
|
+
text = _props$node$attrs.text,
|
|
8
|
+
accessLevel = _props$node$attrs.accessLevel;
|
|
9
|
+
return /*#__PURE__*/React.createElement(Mention, {
|
|
10
|
+
id: id,
|
|
11
|
+
text: text,
|
|
12
|
+
accessLevel: accessLevel,
|
|
13
|
+
providers: providerFactory
|
|
14
|
+
});
|
|
15
|
+
};
|
|
@@ -6,7 +6,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
6
6
|
|
|
7
7
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
8
8
|
import { SLI_EVENT_TYPE, SMART_EVENT_TYPE, buildSliPayload } from '@atlaskit/mention/resource';
|
|
9
|
-
import
|
|
9
|
+
import { getInlineNodeViewProducer } from '../../../nodeviews/getInlineNodeViewProducer';
|
|
10
|
+
import { MentionNodeView } from '../nodeviews/mention';
|
|
10
11
|
import { mentionPluginKey } from './key';
|
|
11
12
|
var ACTIONS = {
|
|
12
13
|
SET_PROVIDER: 'SET_PROVIDER',
|
|
@@ -42,7 +43,7 @@ export var setContext = function setContext(context) {
|
|
|
42
43
|
return true;
|
|
43
44
|
};
|
|
44
45
|
};
|
|
45
|
-
export function createMentionPlugin(
|
|
46
|
+
export function createMentionPlugin(pmPluginFactoryParams, fireEvent, options) {
|
|
46
47
|
var mentionProvider;
|
|
47
48
|
|
|
48
49
|
var sendAnalytics = function sendAnalytics(event, actionSubject, action, attributes) {
|
|
@@ -72,14 +73,14 @@ export function createMentionPlugin(dispatch, providerFactory, portalProviderAPI
|
|
|
72
73
|
newPluginState = _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
73
74
|
mentionProvider: params.provider
|
|
74
75
|
});
|
|
75
|
-
dispatch(mentionPluginKey, newPluginState);
|
|
76
|
+
pmPluginFactoryParams.dispatch(mentionPluginKey, newPluginState);
|
|
76
77
|
return newPluginState;
|
|
77
78
|
|
|
78
79
|
case ACTIONS.SET_CONTEXT:
|
|
79
80
|
newPluginState = _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
80
81
|
contextIdentifierProvider: params.context
|
|
81
82
|
});
|
|
82
|
-
dispatch(mentionPluginKey, newPluginState);
|
|
83
|
+
pmPluginFactoryParams.dispatch(mentionPluginKey, newPluginState);
|
|
83
84
|
return newPluginState;
|
|
84
85
|
}
|
|
85
86
|
|
|
@@ -88,7 +89,14 @@ export function createMentionPlugin(dispatch, providerFactory, portalProviderAPI
|
|
|
88
89
|
},
|
|
89
90
|
props: {
|
|
90
91
|
nodeViews: {
|
|
91
|
-
mention:
|
|
92
|
+
mention: getInlineNodeViewProducer({
|
|
93
|
+
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
94
|
+
Component: MentionNodeView,
|
|
95
|
+
extraComponentProps: {
|
|
96
|
+
providerFactory: pmPluginFactoryParams.providerFactory,
|
|
97
|
+
options: options
|
|
98
|
+
}
|
|
99
|
+
})
|
|
92
100
|
}
|
|
93
101
|
},
|
|
94
102
|
view: function view(editorView) {
|
|
@@ -126,13 +134,13 @@ export function createMentionPlugin(dispatch, providerFactory, portalProviderAPI
|
|
|
126
134
|
return;
|
|
127
135
|
};
|
|
128
136
|
|
|
129
|
-
providerFactory.subscribe('mentionProvider', providerHandler);
|
|
130
|
-
providerFactory.subscribe('contextIdentifierProvider', providerHandler);
|
|
137
|
+
pmPluginFactoryParams.providerFactory.subscribe('mentionProvider', providerHandler);
|
|
138
|
+
pmPluginFactoryParams.providerFactory.subscribe('contextIdentifierProvider', providerHandler);
|
|
131
139
|
return {
|
|
132
140
|
destroy: function destroy() {
|
|
133
|
-
if (providerFactory) {
|
|
134
|
-
providerFactory.unsubscribe('mentionProvider', providerHandler);
|
|
135
|
-
providerFactory.unsubscribe('contextIdentifierProvider', providerHandler);
|
|
141
|
+
if (pmPluginFactoryParams.providerFactory) {
|
|
142
|
+
pmPluginFactoryParams.providerFactory.unsubscribe('mentionProvider', providerHandler);
|
|
143
|
+
pmPluginFactoryParams.providerFactory.unsubscribe('contextIdentifierProvider', providerHandler);
|
|
136
144
|
}
|
|
137
145
|
|
|
138
146
|
if (mentionProvider) {
|
|
@@ -378,10 +378,15 @@ export var createTypeAheadConfig = function createTypeAheadConfig(_ref6) {
|
|
|
378
378
|
dismiss: function dismiss(_ref9) {
|
|
379
379
|
var editorState = _ref9.editorState,
|
|
380
380
|
query = _ref9.query,
|
|
381
|
-
stats = _ref9.stats
|
|
381
|
+
stats = _ref9.stats,
|
|
382
|
+
wasItemInserted = _ref9.wasItemInserted;
|
|
382
383
|
firstQueryWithoutResults = null;
|
|
383
384
|
var pickerElapsedTime = stats.startedAt ? Date.now() - stats.startedAt : 0;
|
|
384
|
-
|
|
385
|
+
|
|
386
|
+
if (!wasItemInserted) {
|
|
387
|
+
fireEvent(buildTypeAheadCancelPayload(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, query || ''));
|
|
388
|
+
}
|
|
389
|
+
|
|
385
390
|
var pluginState = getMentionPluginState(editorState);
|
|
386
391
|
|
|
387
392
|
if (pluginState !== null && pluginState !== void 0 && pluginState.mentionProvider) {
|
|
@@ -5,6 +5,7 @@ var _templateObject;
|
|
|
5
5
|
import { css } from '@emotion/react';
|
|
6
6
|
import { panelSharedStyles, PanelSharedCssClassName } from '@atlaskit/editor-common/panel';
|
|
7
7
|
import { SelectionStyle, getSelectionStyles, akEditorDeleteBackground, akEditorDeleteBackgroundWithOpacity, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorDeleteIconColor, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
8
|
+
import { token } from '@atlaskit/tokens';
|
|
8
9
|
export var panelStyles = function panelStyles(props) {
|
|
9
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n .", " {\n cursor: pointer;\n\n /* Danger when top level node */\n &.danger {\n box-shadow: 0 0 0 ", "px\n ", ";\n background-color: ", " !important;\n\n .", " {\n color: ", " !important;\n }\n }\n }\n\n .", " {\n cursor: text;\n }\n\n /* Danger when nested node */\n .danger .", " {\n &[data-panel-type] {\n background-color: ", ";\n\n .", " {\n color: ", ";\n }\n }\n }\n\n ", ";\n }\n\n .", ".", ":not(.danger) {\n ", "\n }\n"])), PanelSharedCssClassName.prefix, akEditorSelectedBorderSize, akEditorDeleteBorder, akEditorDeleteBackground, PanelSharedCssClassName.icon, akEditorDeleteIconColor, PanelSharedCssClassName.content, PanelSharedCssClassName.prefix, akEditorDeleteBackgroundWithOpacity, PanelSharedCssClassName.icon, akEditorDeleteIconColor, panelSharedStyles(props), PanelSharedCssClassName.prefix, akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket]));
|
|
10
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n .", " {\n cursor: pointer;\n\n /* Danger when top level node */\n &.danger {\n box-shadow: 0 0 0 ", "px\n ", ";\n background-color: ", " !important;\n\n .", " {\n color: ", " !important;\n }\n }\n }\n\n .", " {\n cursor: text;\n }\n\n /* Danger when nested node */\n .danger .", " {\n &[data-panel-type] {\n background-color: ", ";\n\n .", " {\n color: ", ";\n }\n }\n }\n\n ", ";\n }\n\n .", ".", ":not(.danger) {\n ", "\n }\n"])), PanelSharedCssClassName.prefix, akEditorSelectedBorderSize, akEditorDeleteBorder, token('color.background.danger', akEditorDeleteBackground), PanelSharedCssClassName.icon, token('color.icon.danger', akEditorDeleteIconColor), PanelSharedCssClassName.content, PanelSharedCssClassName.prefix, token('color.blanket.danger', akEditorDeleteBackgroundWithOpacity), PanelSharedCssClassName.icon, token('color.icon.danger', akEditorDeleteIconColor), panelSharedStyles(props), PanelSharedCssClassName.prefix, akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket]));
|
|
10
11
|
};
|
|
@@ -5,7 +5,9 @@ import { browser, ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
|
|
|
5
5
|
|
|
6
6
|
var serializePlaceholderNode = function serializePlaceholderNode(node) {
|
|
7
7
|
var element = document.createElement('span');
|
|
8
|
-
element.classList.add('pm-placeholder');
|
|
8
|
+
element.classList.add('pm-placeholder'); // the inline node api test suite requires the following class name
|
|
9
|
+
|
|
10
|
+
element.classList.add('placeholderView-content-wrap');
|
|
9
11
|
|
|
10
12
|
if (browser.gecko) {
|
|
11
13
|
element.setAttribute('contenteditable', 'true');
|
|
@@ -5,6 +5,7 @@ var _templateObject;
|
|
|
5
5
|
import { css } from '@emotion/react';
|
|
6
6
|
import { ruleSharedStyles } from '@atlaskit/editor-common/styles';
|
|
7
7
|
import { akEditorLineHeight, akEditorSelectedBorderColor, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
8
|
+
import { token } from '@atlaskit/tokens';
|
|
8
9
|
export var ruleStyles = function ruleStyles(props) {
|
|
9
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n ", ";\n\n hr {\n cursor: pointer;\n padding: 4px 0;\n margin: calc(", "em - 4px) 0;\n background-clip: content-box;\n\n &.", " {\n outline: none;\n background-color: ", ";\n }\n }\n }\n"])), ruleSharedStyles(props), akEditorLineHeight, akEditorSelectedNodeClassName, akEditorSelectedBorderColor);
|
|
10
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n ", ";\n\n hr {\n cursor: pointer;\n padding: 4px 0;\n margin: calc(", "em - 4px) 0;\n background-clip: content-box;\n\n &.", " {\n outline: none;\n background-color: ", ";\n }\n }\n }\n"])), ruleSharedStyles(props), akEditorLineHeight, akEditorSelectedNodeClassName, token('color.border.selected', akEditorSelectedBorderColor));
|
|
10
11
|
};
|
|
@@ -39,7 +39,7 @@ export var getDecorations = function getDecorations(tr) {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
if (tr.selection instanceof TextSelection || tr.selection instanceof AllSelection) {
|
|
42
|
-
var decorations =
|
|
42
|
+
var decorations = getNodesToDecorateFromSelection(tr.selection, tr.doc).map(function (_ref) {
|
|
43
43
|
var node = _ref.node,
|
|
44
44
|
pos = _ref.pos;
|
|
45
45
|
return Decoration.node(pos, pos + node.nodeSize, {
|
|
@@ -91,38 +91,53 @@ export function getCellSelectionAnalyticsPayload(state) {
|
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
+
var topLevelBlockNodesThatHaveSelectionStyles = ['table', 'panel', 'expand', 'layoutSection', 'decisionList', 'decisionItem', 'codeBlock'];
|
|
94
95
|
/**
|
|
95
|
-
* Use `
|
|
96
|
-
* a list of
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
* For example, using the following document:
|
|
102
|
-
* ```
|
|
103
|
-
* doc(p('{<}one'), blockquote(p('hello')), p(expand({ title: 'two' })(p('three'))), p('four{>}'))))
|
|
104
|
-
* ```
|
|
105
|
-
* we would expect `getTopLevelNodesFromSelection` to return:
|
|
106
|
-
* ```
|
|
107
|
-
* [blockquote(p('hello')), expand({ title: 'two' })(p('three')))]
|
|
108
|
-
* ```
|
|
96
|
+
* Use `getNodesToDecorateFromSelection` to collect and return
|
|
97
|
+
* a list of nodes within the Selection that should have Selection
|
|
98
|
+
* decorations applied. This allows selection styles to be added to
|
|
99
|
+
* nested nodes. It will ignore text nodes as decorations are
|
|
100
|
+
* applied natively and also ignore nodes that don't completely
|
|
101
|
+
* sit within the given `Selection`.
|
|
109
102
|
*/
|
|
110
103
|
|
|
111
|
-
export var
|
|
104
|
+
export var getNodesToDecorateFromSelection = function getNodesToDecorateFromSelection(selection, doc) {
|
|
112
105
|
var nodes = [];
|
|
113
106
|
|
|
114
107
|
if (selection.from !== selection.to) {
|
|
115
108
|
var from = selection.from,
|
|
116
109
|
to = selection.to;
|
|
117
110
|
doc.nodesBetween(from, to, function (node, pos) {
|
|
118
|
-
var withinSelection = from <= pos && pos + node.nodeSize <= to;
|
|
119
|
-
|
|
120
|
-
|
|
111
|
+
var withinSelection = from <= pos && pos + node.nodeSize <= to; // The reason we need to check for these nodes is to stop
|
|
112
|
+
// traversing their children if they are within a selection -
|
|
113
|
+
// this is to prevent selection styles from being added to
|
|
114
|
+
// the children as well as the parent node.
|
|
115
|
+
// Example scenario is if an entire table has been selected
|
|
116
|
+
// we should not traverse its children so we can apply the
|
|
117
|
+
// selection styles to the table. But if an entire tableRow
|
|
118
|
+
// has been selected (but the parent table has not) we should
|
|
119
|
+
// traverse it as it could contain other nodes that need
|
|
120
|
+
// selection styles. I couldn’t see a clear way to differentiate
|
|
121
|
+
// without explicitly stating which nodes should be traversed
|
|
122
|
+
// and which shouldn’t.
|
|
123
|
+
|
|
124
|
+
var isTopLevelNodeThatHasSelectionStyles = topLevelBlockNodesThatHaveSelectionStyles.includes(node.type.name); // If the node is a top-level block node and completely sits within
|
|
125
|
+
// the selection, we do not recurse it's children to prevent selection
|
|
126
|
+
// styles being added to its child nodes. The expected behaviour
|
|
127
|
+
// is that selection styles are only added to the parent.
|
|
128
|
+
|
|
129
|
+
if (node && withinSelection && isTopLevelNodeThatHasSelectionStyles) {
|
|
130
|
+
nodes.push({
|
|
131
|
+
node: node,
|
|
132
|
+
pos: pos
|
|
133
|
+
});
|
|
134
|
+
return false; // Otherwise we recurse the children and return them so we can apply
|
|
135
|
+
// selection styles. Text is handled by the browser.
|
|
136
|
+
} else if (node && withinSelection && !node.isText) {
|
|
121
137
|
nodes.push({
|
|
122
138
|
node: node,
|
|
123
139
|
pos: pos
|
|
124
140
|
});
|
|
125
|
-
return false;
|
|
126
141
|
}
|
|
127
142
|
|
|
128
143
|
return true;
|
|
@@ -11,6 +11,13 @@ import { syncStickyRowToTable, updateStickyMargins as updateTableMargin } from '
|
|
|
11
11
|
import { updateStickyState } from '../commands';
|
|
12
12
|
import { getTop, getTree } from './dom';
|
|
13
13
|
import { getFeatureFlags } from '../../../../feature-flags-context';
|
|
14
|
+
import debounce from 'lodash/debounce';
|
|
15
|
+
import throttle from 'lodash/throttle'; // limit scroll event calls
|
|
16
|
+
|
|
17
|
+
var HEADER_ROW_SCROLL_THROTTLE_TIMEOUT = 200; // timeout for resetting the scroll class - if it’s too long then users won’t be able to click on the header cells,
|
|
18
|
+
// if too short it would trigger too many dom udpates.
|
|
19
|
+
|
|
20
|
+
var HEADER_ROW_SCROLL_RESET_DEBOUNCE_TIMEOUT = 400;
|
|
14
21
|
export var supportedHeaderRow = function supportedHeaderRow(node) {
|
|
15
22
|
var allHeaders = mapChildren(node, function (child) {
|
|
16
23
|
return child.type.name === 'tableHeader';
|
|
@@ -40,6 +47,18 @@ export var TableRowNodeView = /*#__PURE__*/function () {
|
|
|
40
47
|
|
|
41
48
|
_defineProperty(this, "listening", false);
|
|
42
49
|
|
|
50
|
+
_defineProperty(this, "headerRowMouseScrollEnd", debounce(function () {
|
|
51
|
+
_this.dom.classList.remove('no-pointer-events');
|
|
52
|
+
}, HEADER_ROW_SCROLL_RESET_DEBOUNCE_TIMEOUT));
|
|
53
|
+
|
|
54
|
+
_defineProperty(this, "headerRowMouseScroll", throttle(function () {
|
|
55
|
+
if (_this.isSticky) {
|
|
56
|
+
_this.dom.classList.add('no-pointer-events');
|
|
57
|
+
|
|
58
|
+
_this.headerRowMouseScrollEnd();
|
|
59
|
+
}
|
|
60
|
+
}, HEADER_ROW_SCROLL_THROTTLE_TIMEOUT));
|
|
61
|
+
|
|
43
62
|
_defineProperty(this, "onScroll", function () {
|
|
44
63
|
if (!_this.tree) {
|
|
45
64
|
return;
|
|
@@ -350,6 +369,8 @@ export var TableRowNodeView = /*#__PURE__*/function () {
|
|
|
350
369
|
this.eventDispatcher.on(widthPluginKey.key, this.onWidthPluginState);
|
|
351
370
|
this.eventDispatcher.on(tablePluginKey.key, this.onTablePluginState);
|
|
352
371
|
this.listening = true;
|
|
372
|
+
this.dom.addEventListener('wheel', this.headerRowMouseScroll.bind(this));
|
|
373
|
+
this.dom.addEventListener('touchmove', this.headerRowMouseScroll.bind(this));
|
|
353
374
|
}
|
|
354
375
|
}, {
|
|
355
376
|
key: "unsubscribe",
|
|
@@ -373,6 +394,8 @@ export var TableRowNodeView = /*#__PURE__*/function () {
|
|
|
373
394
|
this.eventDispatcher.off(widthPluginKey.key, this.onWidthPluginState);
|
|
374
395
|
this.eventDispatcher.off(tablePluginKey.key, this.onTablePluginState);
|
|
375
396
|
this.listening = false;
|
|
397
|
+
this.dom.removeEventListener('wheel', this.headerRowMouseScroll);
|
|
398
|
+
this.dom.removeEventListener('touchmove', this.headerRowMouseScroll);
|
|
376
399
|
} // initialize intersection observer to track if table is within scroll area
|
|
377
400
|
|
|
378
401
|
}, {
|
|
@@ -17,7 +17,7 @@ var sentinelStyles = ".".concat(ClassName.TABLE_CONTAINER, " {\n > .").concat(C
|
|
|
17
17
|
export var tableStyles = function tableStyles(props) {
|
|
18
18
|
var _props$featureFlags;
|
|
19
19
|
|
|
20
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " button {\n background: ", ";\n color: ", ";\n cursor: none;\n }\n\n .", ":not(.", ") button:hover {\n background: ", ";\n color: white !important;\n cursor: pointer;\n }\n\n .ProseMirror {\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n .", " {\n margin-bottom: 0;\n }\n\n .", " {\n td.", ", th.", " {\n position: relative;\n overflow: visible;\n }\n\n td.", " {\n background-color: ", ";\n }\n }\n\n .", " {\n ", "\n }\n\n .", " {\n ", "\n }\n\n /* Delete button */\n ", "\n /* Ends Delete button */\n\n /* sticky styles */\n .", " .", " .", ":first-child {\n margin-top: ", "px;\n width: ", "px;\n\n position: fixed !important;\n z-index: ", " !important;\n\n box-shadow: 0px -", "px white;\n border-right: 0 none;\n /* top set by NumberColumn component */\n }\n\n .", " .", ".sticky {\n position: fixed !important;\n /* needs to be above row controls */\n z-index: ", " !important;\n background: white;\n\n width: ", "px;\n height: ", "px;\n }\n\n .", ".sticky .", " {\n border-bottom: 0px none;\n border-right: 0px none;\n\n height: ", "px;\n width: ", "px;\n }\n\n .", " .", " {\n z-index: 0;\n }\n\n .", "\n .", "\n .", ".sticky {\n position: fixed !important;\n z-index: ", " !important;\n display: flex;\n border-left: ", "px solid white;\n margin-left: -", "px;\n }\n\n .", " col:first-of-type {\n /* moving rows out of a table layout does weird things in Chrome */\n border-right: 1px solid green;\n }\n\n tr.sticky {\n padding-top: ", "px;\n position: fixed;\n display: grid;\n\n /* to keep it above cell selection */\n z-index: ", ";\n\n overflow-y: visible;\n overflow-x: hidden;\n\n grid-auto-flow: column;\n\n /* background for where controls apply */\n background: white;\n box-sizing: content-box;\n\n margin-top: 2px;\n\n box-shadow: 0 6px 4px -4px ", ";\n margin-left: -1px;\n }\n\n .", " .", " {\n left: unset;\n position: fixed;\n z-index: ", ";\n }\n\n .", ".", "\n .", " {\n padding-bottom: ", "px;\n }\n\n tr.sticky th {\n border-bottom: ", "px solid\n ", ";\n margin-right: -1px;\n }\n\n .", " tr.sticky > th:last-child {\n border-right-width: 1px;\n }\n\n /* add left edge for first cell */\n .", " tr.sticky > th:first-child {\n margin-left: 0px;\n }\n\n /* add a little bit so the scroll lines up with the table */\n .", " tr.sticky::after {\n content: ' ';\n width: 1px;\n }\n\n /* To fix jumpiness caused in Chrome Browsers for sticky headers */\n .", " .sticky + tr {\n min-height: 0px;\n }\n\n /* move resize line a little in sticky bar */\n .", ".", " {\n tr.sticky\n td.", ",\n tr.sticky\n th.", " {\n .", "::after {\n right: ", "px;\n }\n }\n\n /* when selected put it back to normal -- :not selector would be nicer */\n tr.sticky\n td.", ".", ",\n tr.sticky\n th.", ".", " {\n .", "::after {\n right: ", "px;\n }\n }\n }\n\n tr.sticky\n .", ",\n tr.sticky\n .", " {\n z-index: 1;\n }\n\n .", " tr.sticky {\n padding-top: ", "px;\n }\n\n .", ".", "\n .", "\n .", ":first-child {\n margin-top: ", "px;\n }\n\n .", ".sticky {\n border-top: ", "px solid white;\n }\n\n ", "\n ", "\n\n .", " .", " {\n height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts\n }\n\n .less-padding {\n padding: 0 ", "px;\n\n .", " {\n padding: 0 ", "px;\n }\n\n &.", "[data-number-column='true'] {\n padding-left: ", "px;\n }\n\n .", " {\n left: 6px;\n }\n\n .", " {\n left: calc(100% - 6px);\n }\n }\n\n > .", " {\n /**\n * Prevent margins collapsing, aids with placing the gap-cursor correctly\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing\n *\n * TODO: Enable this, many tests will fail!\n * border-top: 1px solid transparent;\n */\n }\n\n /* Breakout only works on top level */\n > * .", " .", " {\n margin-left: unset !important;\n width: 100% !important;\n }\n\n ", ";\n\n /* Corner controls */\n .", " {\n width: ", "px;\n height: ", "px;\n display: none;\n\n .", " {\n position: relative;\n\n ", ";\n }\n\n .", " {\n position: relative;\n\n ", ";\n }\n }\n\n .", ".sticky {\n .", " {\n /* sticky row insert dot overlaps other row insert and messes things up */\n display: none !important;\n }\n }\n\n .", " {\n position: absolute;\n top: 0;\n width: ", "px;\n height: ", "px;\n border: 1px solid ", ";\n border-radius: 0;\n border-top-left-radius: ", "px;\n background: ", ";\n box-sizing: border-box;\n padding: 0;\n :focus {\n outline: none;\n }\n }\n .active .", " {\n border-color: ", ";\n background: ", ";\n }\n\n .", "[data-number-column='true'] {\n .", ", .", " {\n width: ", "px;\n }\n .", " .", " {\n border-right-width: 0;\n }\n }\n\n :not(.", ") .", ":hover {\n border-color: ", ";\n background: ", ";\n cursor: pointer;\n }\n\n :not(.", ")\n .", ".", " {\n border-color: ", ";\n background: ", ";\n }\n\n /* Row controls */\n .", " {\n width: ", "px;\n box-sizing: border-box;\n display: none;\n position: relative;\n\n ", ";\n\n .", " {\n display: flex;\n flex-direction: column;\n }\n .", ":last-child > button {\n border-bottom-left-radius: ", "px;\n }\n .", " {\n position: relative;\n margin-top: -1px;\n }\n .", ":hover,\n .", ".active,\n .", ":hover {\n z-index: ", ";\n }\n\n ", "\n }\n\n :not(.", ") .", " {\n ", "\n ", "\n }\n\n /* Numbered column */\n .", " {\n position: relative;\n float: right;\n margin-left: ", "px;\n top: ", "px;\n width: ", "px;\n box-sizing: border-box;\n }\n\n .", " {\n border: 1px solid ", ";\n box-sizing: border-box;\n margin-top: -1px;\n padding-bottom: 2px;\n padding: 10px 2px;\n text-align: center;\n font-size: ", ";\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n :first-child {\n margin-top: 0;\n }\n :last-child {\n border-bottom: 1px solid ", ";\n }\n }\n\n .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: 1px;\n .", " {\n border-left: 0 none;\n }\n\n .", ".active {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n }\n }\n :not(.", ") .", " {\n .", " {\n cursor: pointer;\n }\n .", ":hover {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n .", ".", " {\n background-color: ", ";\n border: 1px solid ", ";\n border-left: 0;\n color: ", ";\n position: relative;\n z-index: ", ";\n }\n }\n\n /* Table */\n .", " > table {\n table-layout: fixed;\n\n .", " + * {\n margin-top: 0;\n }\n\n /*\n * Headings have a top margin by default, but we don't want this on the\n * first heading within table header cells.\n *\n * This specifically sets margin-top for the first heading within a header\n * cell when center/right aligned.\n */\n th.", " > .fabric-editor-block-mark {\n > h1:first-child,\n > h2:first-child,\n > h3:first-child,\n > h4:first-child,\n > h5:first-child,\n > h6:first-child {\n margin-top: 0;\n }\n }\n\n .", ", .", " {\n position: relative;\n }\n /* Give selected cells a blue overlay */\n .", "::after,\n .", "::after {\n z-index: ", ";\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n opacity: 0.3;\n pointer-events: none;\n }\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n }\n th.", "::after,\n td.", "::after {\n background: ", ";\n }\n }\n .", " {\n position: absolute;\n /* top of corner control is table margin top - corner control height + 1 pixel of table border. */\n top: ", "px;\n }\n .", ".", " {\n z-index: ", ";\n }\n .", " {\n left: -", "px;\n }\n .", " {\n /*\n compensating for half of the insert column button\n that is aligned to the right edge initially on hover of the top right column control when table overflown,\n its center should be aligned with the edge\n */\n padding-right: ", "px;\n margin-right: -", "px;\n padding-bottom: ", "px;\n margin-bottom: -", "px;\n /* fixes gap cursor height */\n overflow: auto;\n position: relative;\n }\n }\n\n .ProseMirror.", " {\n .", " {\n overflow-x: auto;\n ", ";\n }\n }\n\n .ProseMirror.", " {\n cursor: col-resize;\n }\n\n .ProseMirror .pm-table-cell-content-wrap ol[data-child-count='100+'] {\n padding-left: revert;\n }\n"])), ClassName.LAYOUT_BUTTON, N20A, N300, ClassName.LAYOUT_BUTTON, ClassName.IS_RESIZING, B300, tableSharedStyle(props), columnControlsLineMarker(props), hoveredDeleteButton, hoveredCell, hoveredWarningCell, resizeHandle, rangeSelectionStyles, ClassName.LAST_ITEM_IN_CELL, ClassName.TABLE_NODE_WRAPPER, ClassName.TABLE_CELL, ClassName.TABLE_HEADER_CELL, ClassName.TABLE_CELL, tableCellBackgroundColor(props), ClassName.CONTROLS_FLOATING_BUTTON_COLUMN, insertColumnButtonWrapper, ClassName.CONTROLS_FLOATING_BUTTON_ROW, insertRowButtonWrapper, DeleteButton, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, stickyRowOffsetTop + 2, akEditorTableNumberColumnWidth, akEditorStickyHeaderZIndex, stickyRowOffsetTop, ClassName.TABLE_STICKY, ClassName.CORNER_CONTROLS, akEditorSmallZIndex, tableToolbarSize, tableToolbarSize, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize, tableToolbarSize, ClassName.TABLE_STICKY, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_STICKY, ClassName.ROW_CONTROLS, ClassName.ROW_CONTROLS_BUTTON_WRAP, akEditorStickyHeaderZIndex, tableToolbarSize, tableToolbarSize, ClassName.TABLE_STICKY, stickyRowOffsetTop, stickyRowZIndex, N40A, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, stickyRowZIndex + 1, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tableToolbarSize, stickyHeaderBorderBottomWidth, tableBorderColor(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_CONTAINER, ClassName.TABLE_STICKY, ClassName.WITH_RESIZE_LINE, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2 + 1, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.WITH_CONTROLS, tableControlsSpacing, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, tableControlsSpacing + 2, ClassName.CORNER_CONTROLS, tableControlsSpacing - tableToolbarSize + 2, (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.stickyHeadersOptimization ? sentinelStyles : '', OverflowShadow(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tablePadding, ClassName.ROW_CONTROLS_WRAPPER, tablePadding, ClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth + tablePadding - 1, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, ClassName.NODEVIEW_WRAPPER, ClassName.NODEVIEW_WRAPPER, ClassName.TABLE_CONTAINER, columnControlsDecoration(props), ClassName.CORNER_CONTROLS, tableToolbarSize + 1, cornerControlHeight, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, InsertMarker(props, "\n left: -11px;\n top: 9px;\n "), ClassName.CORNER_CONTROLS_INSERT_COLUMN_MARKER, InsertMarker(props, "\n right: -1px;\n top: -12px;\n "), ClassName.CORNER_CONTROLS, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize + 1, tableToolbarSize + 1, tableBorderColor(props), tableBorderRadiusSize, tableToolbarColor(props), ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, tableToolbarSelectedColor, ClassName.TABLE_CONTAINER, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, akEditorTableToolbarSize + akEditorTableNumberColumnWidth, ClassName.ROW_CONTROLS, ClassName.CONTROLS_BUTTON, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, tableToolbarSelectedColor, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor, tableToolbarDeleteColor, ClassName.ROW_CONTROLS, tableToolbarSize, InsertMarker(props, "\n bottom: -1px;\n left: -11px;\n "), ClassName.ROW_CONTROLS_INNER, ClassName.ROW_CONTROLS_BUTTON_WRAP, tableBorderRadiusSize, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.CONTROLS_BUTTON, akEditorUnitZIndex, HeaderButton(props, "\n border-bottom: 1px solid ".concat(tableBorderColor(props), ";\n border-right: 0px;\n border-radius: 0;\n height: 100%;\n width: ").concat(tableToolbarSize, "px;\n\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, " {\n position: absolute;\n width: 30px;\n height: 50%;\n right: 0;\n bottom: 0;\n }\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, ":first-child {\n top: 0;\n }\n ")), ClassName.IS_RESIZING, ClassName.ROW_CONTROLS, HeaderButtonHover(), HeaderButtonDanger(), ClassName.NUMBERED_COLUMN, akEditorTableToolbarSize - 1, akEditorTableToolbarSize, akEditorTableNumberColumnWidth + 1, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderColor(props), relativeFontSizeToBase16(fontSize()), tableToolbarColor(props), tableTextColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.WITH_CONTROLS, ClassName.CORNER_CONTROLS, ClassName.ROW_CONTROLS, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor, tableBorderSelectedColor, tableToolbarSelectedColor, akEditorUnitZIndex, N0, ClassName.IS_RESIZING, ClassName.WITH_CONTROLS, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor, tableBorderSelectedColor, tableToolbarSelectedColor, akEditorUnitZIndex, N0, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableToolbarDeleteColor, tableBorderDeleteColor, R500, akEditorUnitZIndex, ClassName.TABLE_NODE_WRAPPER, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, akEditorSmallZIndex, ClassName.SELECTED_CELL, tableBorderSelectedColor, ClassName.SELECTED_CELL, tableCellSelectedColor, ClassName.HOVERED_CELL_IN_DANGER, ClassName.HOVERED_CELL_IN_DANGER, tableCellDeleteColor, ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop - cornerControlHeight + 1, ClassName.ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, akEditorUnitZIndex, ClassName.ROW_CONTROLS_WRAPPER, tableToolbarSize, ClassName.TABLE_NODE_WRAPPER, tableInsertColumnButtonSize / 2, tableInsertColumnButtonSize / 2, tableScrollbarOffset, tableScrollbarOffset, ClassName.IS_RESIZING, ClassName.TABLE_NODE_WRAPPER, scrollbarStyles, ClassName.RESIZE_CURSOR);
|
|
20
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " button {\n background: ", ";\n color: ", ";\n cursor: none;\n }\n\n .", ":not(.", ") button:hover {\n background: ", ";\n color: white !important;\n cursor: pointer;\n }\n\n .ProseMirror {\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n .", " {\n margin-bottom: 0;\n }\n\n .", " {\n td.", ", th.", " {\n position: relative;\n overflow: visible;\n }\n\n td.", " {\n background-color: ", ";\n }\n }\n\n .", " {\n ", "\n }\n\n .", " {\n ", "\n }\n\n /* Delete button */\n ", "\n /* Ends Delete button */\n\n /* sticky styles */\n .", " .", " .", ":first-child {\n margin-top: ", "px;\n width: ", "px;\n\n position: fixed !important;\n z-index: ", " !important;\n\n box-shadow: 0px -", "px white;\n border-right: 0 none;\n /* top set by NumberColumn component */\n }\n\n .", " .", ".sticky {\n position: fixed !important;\n /* needs to be above row controls */\n z-index: ", " !important;\n background: white;\n\n width: ", "px;\n height: ", "px;\n }\n\n .", ".sticky .", " {\n border-bottom: 0px none;\n border-right: 0px none;\n\n height: ", "px;\n width: ", "px;\n }\n\n .", " .", " {\n z-index: 0;\n }\n\n .", "\n .", "\n .", ".sticky {\n position: fixed !important;\n z-index: ", " !important;\n display: flex;\n border-left: ", "px solid white;\n margin-left: -", "px;\n }\n\n .", " col:first-of-type {\n /* moving rows out of a table layout does weird things in Chrome */\n border-right: 1px solid green;\n }\n\n tr.sticky {\n padding-top: ", "px;\n position: fixed;\n display: grid;\n\n /* to keep it above cell selection */\n z-index: ", ";\n\n overflow-y: visible;\n overflow-x: hidden;\n\n grid-auto-flow: column;\n\n /* background for where controls apply */\n background: white;\n box-sizing: content-box;\n\n margin-top: 2px;\n\n box-shadow: 0 6px 4px -4px ", ";\n margin-left: -1px;\n\n &.no-pointer-events {\n pointer-events: none;\n }\n }\n\n .", " .", " {\n left: unset;\n position: fixed;\n z-index: ", ";\n }\n\n .", ".", "\n .", " {\n padding-bottom: ", "px;\n }\n\n tr.sticky th {\n border-bottom: ", "px solid\n ", ";\n margin-right: -1px;\n }\n\n .", " tr.sticky > th:last-child {\n border-right-width: 1px;\n }\n\n /* add left edge for first cell */\n .", " tr.sticky > th:first-child {\n margin-left: 0px;\n }\n\n /* add a little bit so the scroll lines up with the table */\n .", " tr.sticky::after {\n content: ' ';\n width: 1px;\n }\n\n /* To fix jumpiness caused in Chrome Browsers for sticky headers */\n .", " .sticky + tr {\n min-height: 0px;\n }\n\n /* move resize line a little in sticky bar */\n .", ".", " {\n tr.sticky\n td.", ",\n tr.sticky\n th.", " {\n .", "::after {\n right: ", "px;\n }\n }\n\n /* when selected put it back to normal -- :not selector would be nicer */\n tr.sticky\n td.", ".", ",\n tr.sticky\n th.", ".", " {\n .", "::after {\n right: ", "px;\n }\n }\n }\n\n tr.sticky\n .", ",\n tr.sticky\n .", " {\n z-index: 1;\n }\n\n .", " tr.sticky {\n padding-top: ", "px;\n }\n\n .", ".", "\n .", "\n .", ":first-child {\n margin-top: ", "px;\n }\n\n .", ".sticky {\n border-top: ", "px solid white;\n }\n\n ", "\n ", "\n\n .", " .", " {\n height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts\n }\n\n .less-padding {\n padding: 0 ", "px;\n\n .", " {\n padding: 0 ", "px;\n }\n\n &.", "[data-number-column='true'] {\n padding-left: ", "px;\n }\n\n .", " {\n left: 6px;\n }\n\n .", " {\n left: calc(100% - 6px);\n }\n }\n\n > .", " {\n /**\n * Prevent margins collapsing, aids with placing the gap-cursor correctly\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing\n *\n * TODO: Enable this, many tests will fail!\n * border-top: 1px solid transparent;\n */\n }\n\n /* Breakout only works on top level */\n > * .", " .", " {\n margin-left: unset !important;\n width: 100% !important;\n }\n\n ", ";\n\n /* Corner controls */\n .", " {\n width: ", "px;\n height: ", "px;\n display: none;\n\n .", " {\n position: relative;\n\n ", ";\n }\n\n .", " {\n position: relative;\n\n ", ";\n }\n }\n\n .", ".sticky {\n .", " {\n /* sticky row insert dot overlaps other row insert and messes things up */\n display: none !important;\n }\n }\n\n .", " {\n position: absolute;\n top: 0;\n width: ", "px;\n height: ", "px;\n border: 1px solid ", ";\n border-radius: 0;\n border-top-left-radius: ", "px;\n background: ", ";\n box-sizing: border-box;\n padding: 0;\n :focus {\n outline: none;\n }\n }\n .active .", " {\n border-color: ", ";\n background: ", ";\n }\n\n .", "[data-number-column='true'] {\n .", ", .", " {\n width: ", "px;\n }\n .", " .", " {\n border-right-width: 0;\n }\n }\n\n :not(.", ") .", ":hover {\n border-color: ", ";\n background: ", ";\n cursor: pointer;\n }\n\n :not(.", ")\n .", ".", " {\n border-color: ", ";\n background: ", ";\n }\n\n /* Row controls */\n .", " {\n width: ", "px;\n box-sizing: border-box;\n display: none;\n position: relative;\n\n ", ";\n\n .", " {\n display: flex;\n flex-direction: column;\n }\n .", ":last-child > button {\n border-bottom-left-radius: ", "px;\n }\n .", " {\n position: relative;\n margin-top: -1px;\n }\n .", ":hover,\n .", ".active,\n .", ":hover {\n z-index: ", ";\n }\n\n ", "\n }\n\n :not(.", ") .", " {\n ", "\n ", "\n }\n\n /* Numbered column */\n .", " {\n position: relative;\n float: right;\n margin-left: ", "px;\n top: ", "px;\n width: ", "px;\n box-sizing: border-box;\n }\n\n .", " {\n border: 1px solid ", ";\n box-sizing: border-box;\n margin-top: -1px;\n padding-bottom: 2px;\n padding: 10px 2px;\n text-align: center;\n font-size: ", ";\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n :first-child {\n margin-top: 0;\n }\n :last-child {\n border-bottom: 1px solid ", ";\n }\n }\n\n .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: 1px;\n .", " {\n border-left: 0 none;\n }\n\n .", ".active {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n }\n }\n :not(.", ") .", " {\n .", " {\n cursor: pointer;\n }\n .", ":hover {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n .", ".", " {\n background-color: ", ";\n border: 1px solid ", ";\n border-left: 0;\n color: ", ";\n position: relative;\n z-index: ", ";\n }\n }\n\n /* Table */\n .", " > table {\n table-layout: fixed;\n\n .", " + * {\n margin-top: 0;\n }\n\n /*\n * Headings have a top margin by default, but we don't want this on the\n * first heading within table header cells.\n *\n * This specifically sets margin-top for the first heading within a header\n * cell when center/right aligned.\n */\n th.", " > .fabric-editor-block-mark {\n > h1:first-child,\n > h2:first-child,\n > h3:first-child,\n > h4:first-child,\n > h5:first-child,\n > h6:first-child {\n margin-top: 0;\n }\n }\n\n .", ", .", " {\n position: relative;\n }\n /* Give selected cells a blue overlay */\n .", "::after,\n .", "::after {\n z-index: ", ";\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n opacity: 0.3;\n pointer-events: none;\n }\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n }\n th.", "::after,\n td.", "::after {\n background: ", ";\n }\n }\n .", " {\n position: absolute;\n /* top of corner control is table margin top - corner control height + 1 pixel of table border. */\n top: ", "px;\n }\n .", ".", " {\n z-index: ", ";\n }\n .", " {\n left: -", "px;\n }\n .", " {\n /*\n compensating for half of the insert column button\n that is aligned to the right edge initially on hover of the top right column control when table overflown,\n its center should be aligned with the edge\n */\n padding-right: ", "px;\n margin-right: -", "px;\n padding-bottom: ", "px;\n margin-bottom: -", "px;\n /* fixes gap cursor height */\n overflow: auto;\n position: relative;\n }\n }\n\n .ProseMirror.", " {\n .", " {\n overflow-x: auto;\n ", ";\n }\n }\n\n .ProseMirror.", " {\n cursor: col-resize;\n }\n\n .ProseMirror .pm-table-cell-content-wrap ol[data-child-count='100+'] {\n padding-left: revert;\n }\n"])), ClassName.LAYOUT_BUTTON, N20A, N300, ClassName.LAYOUT_BUTTON, ClassName.IS_RESIZING, B300, tableSharedStyle(props), columnControlsLineMarker(props), hoveredDeleteButton, hoveredCell, hoveredWarningCell, resizeHandle, rangeSelectionStyles, ClassName.LAST_ITEM_IN_CELL, ClassName.TABLE_NODE_WRAPPER, ClassName.TABLE_CELL, ClassName.TABLE_HEADER_CELL, ClassName.TABLE_CELL, tableCellBackgroundColor(props), ClassName.CONTROLS_FLOATING_BUTTON_COLUMN, insertColumnButtonWrapper, ClassName.CONTROLS_FLOATING_BUTTON_ROW, insertRowButtonWrapper, DeleteButton, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, stickyRowOffsetTop + 2, akEditorTableNumberColumnWidth, akEditorStickyHeaderZIndex, stickyRowOffsetTop, ClassName.TABLE_STICKY, ClassName.CORNER_CONTROLS, akEditorSmallZIndex, tableToolbarSize, tableToolbarSize, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize, tableToolbarSize, ClassName.TABLE_STICKY, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_STICKY, ClassName.ROW_CONTROLS, ClassName.ROW_CONTROLS_BUTTON_WRAP, akEditorStickyHeaderZIndex, tableToolbarSize, tableToolbarSize, ClassName.TABLE_STICKY, stickyRowOffsetTop, stickyRowZIndex, N40A, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, stickyRowZIndex + 1, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tableToolbarSize, stickyHeaderBorderBottomWidth, tableBorderColor(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_CONTAINER, ClassName.TABLE_STICKY, ClassName.WITH_RESIZE_LINE, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2 + 1, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.WITH_CONTROLS, tableControlsSpacing, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, tableControlsSpacing + 2, ClassName.CORNER_CONTROLS, tableControlsSpacing - tableToolbarSize + 2, (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.stickyHeadersOptimization ? sentinelStyles : '', OverflowShadow(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tablePadding, ClassName.ROW_CONTROLS_WRAPPER, tablePadding, ClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth + tablePadding - 1, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, ClassName.NODEVIEW_WRAPPER, ClassName.NODEVIEW_WRAPPER, ClassName.TABLE_CONTAINER, columnControlsDecoration(props), ClassName.CORNER_CONTROLS, tableToolbarSize + 1, cornerControlHeight, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, InsertMarker(props, "\n left: -11px;\n top: 9px;\n "), ClassName.CORNER_CONTROLS_INSERT_COLUMN_MARKER, InsertMarker(props, "\n right: -1px;\n top: -12px;\n "), ClassName.CORNER_CONTROLS, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize + 1, tableToolbarSize + 1, tableBorderColor(props), tableBorderRadiusSize, tableToolbarColor(props), ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, tableToolbarSelectedColor, ClassName.TABLE_CONTAINER, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, akEditorTableToolbarSize + akEditorTableNumberColumnWidth, ClassName.ROW_CONTROLS, ClassName.CONTROLS_BUTTON, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, tableToolbarSelectedColor, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor, tableToolbarDeleteColor, ClassName.ROW_CONTROLS, tableToolbarSize, InsertMarker(props, "\n bottom: -1px;\n left: -11px;\n "), ClassName.ROW_CONTROLS_INNER, ClassName.ROW_CONTROLS_BUTTON_WRAP, tableBorderRadiusSize, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.CONTROLS_BUTTON, akEditorUnitZIndex, HeaderButton(props, "\n border-bottom: 1px solid ".concat(tableBorderColor(props), ";\n border-right: 0px;\n border-radius: 0;\n height: 100%;\n width: ").concat(tableToolbarSize, "px;\n\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, " {\n position: absolute;\n width: 30px;\n height: 50%;\n right: 0;\n bottom: 0;\n }\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, ":first-child {\n top: 0;\n }\n ")), ClassName.IS_RESIZING, ClassName.ROW_CONTROLS, HeaderButtonHover(), HeaderButtonDanger(), ClassName.NUMBERED_COLUMN, akEditorTableToolbarSize - 1, akEditorTableToolbarSize, akEditorTableNumberColumnWidth + 1, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderColor(props), relativeFontSizeToBase16(fontSize()), tableToolbarColor(props), tableTextColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.WITH_CONTROLS, ClassName.CORNER_CONTROLS, ClassName.ROW_CONTROLS, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor, tableBorderSelectedColor, tableToolbarSelectedColor, akEditorUnitZIndex, N0, ClassName.IS_RESIZING, ClassName.WITH_CONTROLS, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor, tableBorderSelectedColor, tableToolbarSelectedColor, akEditorUnitZIndex, N0, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableToolbarDeleteColor, tableBorderDeleteColor, R500, akEditorUnitZIndex, ClassName.TABLE_NODE_WRAPPER, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, akEditorSmallZIndex, ClassName.SELECTED_CELL, tableBorderSelectedColor, ClassName.SELECTED_CELL, tableCellSelectedColor, ClassName.HOVERED_CELL_IN_DANGER, ClassName.HOVERED_CELL_IN_DANGER, tableCellDeleteColor, ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop - cornerControlHeight + 1, ClassName.ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, akEditorUnitZIndex, ClassName.ROW_CONTROLS_WRAPPER, tableToolbarSize, ClassName.TABLE_NODE_WRAPPER, tableInsertColumnButtonSize / 2, tableInsertColumnButtonSize / 2, tableScrollbarOffset, tableScrollbarOffset, ClassName.IS_RESIZING, ClassName.TABLE_NODE_WRAPPER, scrollbarStyles, ClassName.RESIZE_CURSOR);
|
|
21
21
|
};
|
|
22
22
|
export var tableFullPageEditorStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n margin-right: 0;\n width: 100%;\n }\n"])), ClassName.TABLE_NODE_WRAPPER);
|
|
23
23
|
export var tableCommentEditorStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n margin-right: 0;\n ", ";\n }\n"])), ClassName.TABLE_NODE_WRAPPER, scrollbarStyles);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { B200, B300, B75, N0, N20, R50, R400, R75, DN400, N200, DN30 } from '@atlaskit/theme/colors';
|
|
2
2
|
import { tableCellBorderWidth, tableMarginTop } from '@atlaskit/editor-common/styles';
|
|
3
3
|
import { akEditorTableBorder, akEditorTableBorderDark, akEditorTableToolbar, akEditorTableToolbarDark, akEditorTableToolbarSize, akEditorUnitZIndex, akRichMediaResizeZIndex } from '@atlaskit/editor-shared-styles';
|
|
4
|
+
import { token } from '@atlaskit/tokens';
|
|
4
5
|
import { RESIZE_HANDLE_AREA_DECORATION_GAP } from '../types';
|
|
5
6
|
import { themed } from '@atlaskit/theme/components';
|
|
6
7
|
/**
|
|
@@ -12,16 +13,16 @@ export var tableCellBackgroundColor = themed({
|
|
|
12
13
|
dark: DN30
|
|
13
14
|
});
|
|
14
15
|
export var tableToolbarColor = themed({
|
|
15
|
-
light: akEditorTableToolbar,
|
|
16
|
-
dark: akEditorTableToolbarDark
|
|
16
|
+
light: token('color.background.neutral', akEditorTableToolbar),
|
|
17
|
+
dark: token('color.background.neutral', akEditorTableToolbarDark)
|
|
17
18
|
});
|
|
18
19
|
export var tableTextColor = themed({
|
|
19
20
|
light: N200,
|
|
20
21
|
dark: DN400
|
|
21
22
|
});
|
|
22
23
|
export var tableBorderColor = themed({
|
|
23
|
-
light: akEditorTableBorder,
|
|
24
|
-
dark: akEditorTableBorderDark
|
|
24
|
+
light: token('color.border', akEditorTableBorder),
|
|
25
|
+
dark: token('color.border', akEditorTableBorderDark)
|
|
25
26
|
});
|
|
26
27
|
export var tableFloatingControlsColor = N20;
|
|
27
28
|
export var tableCellSelectedColor = B75;
|
|
@@ -5,4 +5,5 @@ var _templateObject;
|
|
|
5
5
|
import { css } from '@emotion/react';
|
|
6
6
|
import { TaskDecisionSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
7
7
|
import { SelectionStyle, getSelectionStyles, akEditorDeleteBackgroundWithOpacity, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
8
|
-
|
|
8
|
+
import { token } from '@atlaskit/tokens';
|
|
9
|
+
export var taskDecisionStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n [data-decision-wrapper] {\n cursor: pointer;\n }\n\n .", " > [data-decision-wrapper],\n ol[data-node-type='decisionList'].", " {\n border-radius: 4px;\n ", "\n }\n\n .danger {\n .", ".", "\n > div {\n box-shadow: 0 0 0 ", "px\n ", ";\n background-color: ", ";\n &::after {\n content: none; /* reset the Blanket selection style */\n }\n }\n }\n"])), akEditorSelectedNodeClassName, akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket]), TaskDecisionSharedCssClassName.DECISION_CONTAINER, akEditorSelectedNodeClassName, akEditorSelectedBorderSize, token('color.border.danger', akEditorDeleteBorder), token('color.blanket.danger', akEditorDeleteBackgroundWithOpacity));
|
|
@@ -183,7 +183,8 @@ var typeAheadPlugin = function typeAheadPlugin(options) {
|
|
|
183
183
|
});
|
|
184
184
|
},
|
|
185
185
|
onEditorViewStateUpdated: function onEditorViewStateUpdated(_ref7) {
|
|
186
|
-
var
|
|
186
|
+
var originalTransaction = _ref7.originalTransaction,
|
|
187
|
+
oldEditorState = _ref7.oldEditorState,
|
|
187
188
|
newEditorState = _ref7.newEditorState;
|
|
188
189
|
var oldPluginState = getPluginState(oldEditorState);
|
|
189
190
|
var newPluginState = getPluginState(newEditorState);
|
|
@@ -197,10 +198,13 @@ var typeAheadPlugin = function typeAheadPlugin(options) {
|
|
|
197
198
|
var isANewHandler = oldTriggerHandler !== newTriggerHandler;
|
|
198
199
|
|
|
199
200
|
if (oldTriggerHandler !== null && oldTriggerHandler !== void 0 && oldTriggerHandler.dismiss && isANewHandler) {
|
|
201
|
+
var typeAheadMessage = originalTransaction.getMeta(typeAheadPluginKey);
|
|
202
|
+
var wasItemInserted = typeAheadMessage && typeAheadMessage.action === 'INSERT_RAW_QUERY';
|
|
200
203
|
oldTriggerHandler.dismiss({
|
|
201
204
|
editorState: newEditorState,
|
|
202
205
|
query: oldPluginState.query,
|
|
203
|
-
stats: (oldPluginState.stats || new StatsModifier()).serialize()
|
|
206
|
+
stats: (oldPluginState.stats || new StatsModifier()).serialize(),
|
|
207
|
+
wasItemInserted: wasItemInserted
|
|
204
208
|
});
|
|
205
209
|
}
|
|
206
210
|
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from 'prosemirror-state';
|
|
3
3
|
import { confluenceUnsupportedBlock, confluenceUnsupportedInline, unsupportedBlock, unsupportedInline, unsupportedMark, unsupportedNodeAttribute } from '@atlaskit/adf-schema';
|
|
4
|
-
import { UnsupportedBlock
|
|
4
|
+
import { UnsupportedBlock } from '@atlaskit/editor-common/ui';
|
|
5
|
+
import { UnsupportedInlineNodeView } from './unsupported-inline-node-view';
|
|
5
6
|
import { ReactNodeView } from '../../nodeviews';
|
|
7
|
+
import { getInlineNodeViewProducer } from '../../nodeviews/getInlineNodeViewProducer';
|
|
6
8
|
export var pluginKey = new PluginKey('unsupportedContentPlugin');
|
|
7
9
|
|
|
8
|
-
var createPlugin = function createPlugin(
|
|
9
|
-
var portalProviderAPI = _ref.portalProviderAPI,
|
|
10
|
-
eventDispatcher = _ref.eventDispatcher,
|
|
11
|
-
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
|
|
10
|
+
var createPlugin = function createPlugin(pmPluginFactoryParams) {
|
|
12
11
|
var hasIntlContext = true;
|
|
12
|
+
var portalProviderAPI = pmPluginFactoryParams.portalProviderAPI,
|
|
13
|
+
eventDispatcher = pmPluginFactoryParams.eventDispatcher,
|
|
14
|
+
dispatchAnalyticsEvent = pmPluginFactoryParams.dispatchAnalyticsEvent;
|
|
13
15
|
return new SafePlugin({
|
|
14
16
|
key: pluginKey,
|
|
15
17
|
props: {
|
|
@@ -17,15 +19,23 @@ var createPlugin = function createPlugin(_ref) {
|
|
|
17
19
|
confluenceUnsupportedBlock: ReactNodeView.fromComponent(UnsupportedBlock, portalProviderAPI, eventDispatcher, {
|
|
18
20
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
19
21
|
}, undefined, hasIntlContext),
|
|
20
|
-
confluenceUnsupportedInline:
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
confluenceUnsupportedInline: getInlineNodeViewProducer({
|
|
23
|
+
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
24
|
+
Component: UnsupportedInlineNodeView,
|
|
25
|
+
extraComponentProps: {
|
|
26
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
27
|
+
}
|
|
28
|
+
}),
|
|
23
29
|
unsupportedBlock: ReactNodeView.fromComponent(UnsupportedBlock, portalProviderAPI, eventDispatcher, {
|
|
24
30
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
25
31
|
}, undefined, hasIntlContext),
|
|
26
|
-
unsupportedInline:
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
unsupportedInline: getInlineNodeViewProducer({
|
|
33
|
+
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
34
|
+
Component: UnsupportedInlineNodeView,
|
|
35
|
+
extraComponentProps: {
|
|
36
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
37
|
+
}
|
|
38
|
+
})
|
|
29
39
|
}
|
|
30
40
|
}
|
|
31
41
|
});
|
|
@@ -4,10 +4,11 @@ var _templateObject;
|
|
|
4
4
|
|
|
5
5
|
import { css } from '@emotion/react';
|
|
6
6
|
import { SelectionStyle, getSelectionStyles, akEditorDeleteBackgroundWithOpacity, akEditorSelectedBorderSize, akEditorDeleteBorder, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
7
|
+
import { token } from '@atlaskit/tokens';
|
|
7
8
|
export var UnsupportedSharedCssClassName = {
|
|
8
9
|
BLOCK_CONTAINER: 'unsupportedBlockView-content-wrap',
|
|
9
10
|
INLINE_CONTAINER: 'unsupportedInlineView-content-wrap'
|
|
10
11
|
};
|
|
11
|
-
var inlineUnsupportedSelector = ".".concat(UnsupportedSharedCssClassName.INLINE_CONTAINER, " > span");
|
|
12
|
+
var inlineUnsupportedSelector = ".".concat(UnsupportedSharedCssClassName.INLINE_CONTAINER, " > span:nth-child(2)");
|
|
12
13
|
var blockUnsupportedSelector = ".".concat(UnsupportedSharedCssClassName.BLOCK_CONTAINER, " > div");
|
|
13
|
-
export var unsupportedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", ", ", " {\n cursor: pointer;\n }\n\n .", "", ",\n .", "", " {\n ", "\n }\n\n .danger {\n .", "", ",\n .", "", " {\n border: ", "px solid
|
|
14
|
+
export var unsupportedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", ", ", " {\n cursor: pointer;\n }\n\n .", "", ",\n .", "", " {\n ", "\n }\n\n .danger {\n .", "", ",\n .", "", " {\n border: ", "px solid\n ", ";\n background-color: ", ";\n }\n }\n"])), blockUnsupportedSelector, inlineUnsupportedSelector, akEditorSelectedNodeClassName, blockUnsupportedSelector, akEditorSelectedNodeClassName, inlineUnsupportedSelector, getSelectionStyles([SelectionStyle.Background, SelectionStyle.Border]), akEditorSelectedNodeClassName, blockUnsupportedSelector, akEditorSelectedNodeClassName, inlineUnsupportedSelector, akEditorSelectedBorderSize, token('color.border.danger', akEditorDeleteBorder), token('color.blanket.danger', akEditorDeleteBackgroundWithOpacity));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import { UnsupportedInline } from '@atlaskit/editor-common/ui';
|
|
5
|
+
export var UnsupportedInlineNodeView = function UnsupportedInlineNodeView(props) {
|
|
6
|
+
return jsx(UnsupportedInline, props);
|
|
7
|
+
};
|
|
@@ -7,7 +7,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
9
9
|
|
|
10
|
-
var _templateObject, _templateObject2;
|
|
10
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
11
11
|
|
|
12
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
13
|
|
|
@@ -22,7 +22,7 @@ import { createEditorContentStyle } from '../ContentStyles';
|
|
|
22
22
|
import { pluginKey as maxContentSizePluginKey } from '../../plugins/max-content-size';
|
|
23
23
|
import { scrollbarStyles } from '../styles';
|
|
24
24
|
import WithFlash from '../WithFlash';
|
|
25
|
-
var chromelessEditor = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n line-height: 20px;\n height: auto;\n
|
|
25
|
+
var chromelessEditor = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n line-height: 20px;\n height: auto;\n\n overflow-x: hidden;\n overflow-y: auto;\n ", ";\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"])), scrollbarStyles);
|
|
26
26
|
var ContentArea = createEditorContentStyle();
|
|
27
27
|
ContentArea.displayName = 'ContentArea';
|
|
28
28
|
|
|
@@ -57,6 +57,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
57
57
|
contentComponents = _this$props.contentComponents,
|
|
58
58
|
customContentComponents = _this$props.customContentComponents,
|
|
59
59
|
maxHeight = _this$props.maxHeight,
|
|
60
|
+
_this$props$minHeight = _this$props.minHeight,
|
|
61
|
+
minHeight = _this$props$minHeight === void 0 ? 30 : _this$props$minHeight,
|
|
60
62
|
popupsMountPoint = _this$props.popupsMountPoint,
|
|
61
63
|
popupsBoundariesElement = _this$props.popupsBoundariesElement,
|
|
62
64
|
popupsScrollableElement = _this$props.popupsScrollableElement,
|
|
@@ -66,7 +68,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
66
68
|
return jsx(WithFlash, {
|
|
67
69
|
animate: maxContentSizeReached
|
|
68
70
|
}, jsx("div", {
|
|
69
|
-
css: [chromelessEditor, maxHeight && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n max-height: ", "px;\n "])), maxHeight)],
|
|
71
|
+
css: [chromelessEditor, maxHeight && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n max-height: ", "px;\n "])), maxHeight), css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n min-height: ", "px;\n "])), minHeight)],
|
|
72
|
+
"data-testid": "chromeless-editor",
|
|
70
73
|
ref: function ref(_ref2) {
|
|
71
74
|
return _this.containerElement = _ref2;
|
|
72
75
|
}
|