@atlaskit/editor-common 70.1.2 → 70.2.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 +40 -0
- package/dist/cjs/__tests_external__/index.js +1 -9
- package/dist/cjs/__tests_external__/page-objects/Editor.js +0 -7
- package/dist/cjs/__tests_external__/page-objects/EditorSmartLink.js +7 -1
- package/dist/cjs/__tests_external__/page-objects/Renderer.js +0 -9
- package/dist/cjs/in-product.js +0 -6
- package/dist/cjs/react-node-view/index.js +19 -17
- package/dist/cjs/styles/index.js +12 -0
- package/dist/cjs/styles/shared/code-block.js +5 -3
- package/dist/cjs/styles/shared/lists.js +4 -2
- package/dist/cjs/styles/shared/table.js +1 -1
- package/dist/cjs/{__tests_external__/cases/media/test-cases/types.js → types/copy-button.js} +0 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Expand/index.js +2 -2
- package/dist/cjs/ui/IntlProviderIfMissingWrapper/index.js +33 -0
- package/dist/cjs/ui/Popup/index.js +2 -2
- package/dist/cjs/ui/PortalProvider/index.js +62 -47
- package/dist/cjs/ui/index.js +8 -0
- package/dist/cjs/utils/breakout.js +53 -2
- package/dist/cjs/utils/collab.js +22 -0
- package/dist/cjs/utils/dom.js +16 -0
- package/dist/cjs/utils/get-performance-options.js +70 -0
- package/dist/cjs/utils/index.js +57 -1
- package/dist/cjs/utils/outdated-browsers.js +41 -0
- package/dist/cjs/utils/referentiality.js +49 -0
- package/dist/cjs/utils/sendLogs.js +19 -0
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/with-plugin-state/index.js +61 -54
- package/dist/es2019/__tests_external__/index.js +1 -2
- package/dist/es2019/__tests_external__/page-objects/Editor.js +0 -6
- package/dist/es2019/__tests_external__/page-objects/EditorSmartLink.js +4 -1
- package/dist/es2019/__tests_external__/page-objects/Renderer.js +0 -6
- package/dist/es2019/in-product.js +1 -1
- package/dist/es2019/react-node-view/index.js +19 -24
- package/dist/es2019/styles/index.js +2 -2
- package/dist/es2019/styles/shared/code-block.js +13 -1
- package/dist/es2019/styles/shared/lists.js +2 -1
- package/dist/es2019/styles/shared/table.js +4 -2
- package/dist/es2019/{__tests_external__/cases/media/test-cases/types.js → types/copy-button.js} +0 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Expand/index.js +17 -15
- package/dist/es2019/ui/IntlProviderIfMissingWrapper/index.js +18 -0
- package/dist/es2019/ui/Popup/index.js +2 -1
- package/dist/es2019/ui/PortalProvider/index.js +33 -14
- package/dist/es2019/ui/index.js +2 -1
- package/dist/es2019/utils/breakout.js +47 -1
- package/dist/es2019/utils/collab.js +13 -0
- package/dist/es2019/utils/dom.js +16 -0
- package/dist/es2019/utils/get-performance-options.js +57 -0
- package/dist/es2019/utils/index.js +6 -2
- package/dist/es2019/utils/outdated-browsers.js +32 -0
- package/dist/es2019/utils/referentiality.js +34 -0
- package/dist/es2019/utils/sendLogs.js +8 -0
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/with-plugin-state/index.js +55 -52
- package/dist/esm/__tests_external__/index.js +1 -2
- package/dist/esm/__tests_external__/page-objects/Editor.js +0 -7
- package/dist/esm/__tests_external__/page-objects/EditorSmartLink.js +7 -1
- package/dist/esm/__tests_external__/page-objects/Renderer.js +0 -9
- package/dist/esm/in-product.js +1 -1
- package/dist/esm/react-node-view/index.js +19 -22
- package/dist/esm/styles/index.js +2 -2
- package/dist/esm/styles/shared/code-block.js +4 -3
- package/dist/esm/styles/shared/lists.js +2 -1
- package/dist/esm/styles/shared/table.js +1 -1
- package/dist/esm/{__tests_external__/cases/media/test-cases/types.js → types/copy-button.js} +0 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Expand/index.js +2 -2
- package/dist/esm/ui/IntlProviderIfMissingWrapper/index.js +19 -0
- package/dist/esm/ui/Popup/index.js +2 -2
- package/dist/esm/ui/PortalProvider/index.js +59 -48
- package/dist/esm/ui/index.js +2 -1
- package/dist/esm/utils/breakout.js +46 -1
- package/dist/esm/utils/collab.js +13 -0
- package/dist/esm/utils/dom.js +16 -0
- package/dist/esm/utils/get-performance-options.js +55 -0
- package/dist/esm/utils/index.js +6 -2
- package/dist/esm/utils/outdated-browsers.js +32 -0
- package/dist/esm/utils/referentiality.js +40 -0
- package/dist/esm/utils/sendLogs.js +10 -0
- package/dist/esm/version.json +1 -1
- package/dist/esm/with-plugin-state/index.js +59 -54
- package/dist/types/__tests_external__/index.d.ts +0 -1
- package/dist/types/__tests_external__/page-objects/Editor.d.ts +0 -1
- package/dist/types/__tests_external__/page-objects/Renderer.d.ts +0 -1
- package/dist/types/analytics/types/events.d.ts +1 -0
- package/dist/types/extensions/types/extension-handler.d.ts +1 -0
- package/dist/types/in-product.d.ts +1 -1
- package/dist/types/styles/index.d.ts +2 -2
- package/dist/types/styles/shared/code-block.d.ts +1 -0
- package/dist/types/styles/shared/lists.d.ts +1 -0
- package/dist/types/types/copy-button.d.ts +20 -0
- package/dist/types/types/editor-actions.d.ts +1 -0
- package/dist/types/types/editor-container-width.d.ts +14 -0
- package/dist/types/types/feature-flags.d.ts +0 -6
- package/dist/types/types/floating-toolbar.d.ts +23 -2
- package/dist/types/types/index.d.ts +2 -1
- package/dist/types/ui/IntlProviderIfMissingWrapper/index.d.ts +6 -0
- package/dist/types/ui/Popup/index.d.ts +1 -0
- package/dist/types/ui/PortalProvider/index.d.ts +2 -1
- package/dist/types/ui/index.d.ts +1 -0
- package/dist/types/ui-menu/ToolbarButton/index.d.ts +1 -1
- package/dist/types/utils/breakout.d.ts +25 -0
- package/dist/types/utils/collab.d.ts +2 -0
- package/dist/types/utils/dom.d.ts +15 -1
- package/dist/types/utils/get-performance-options.d.ts +18 -0
- package/dist/types/utils/getModeFromTheme.d.ts +1 -1
- package/dist/types/utils/index.d.ts +5 -1
- package/dist/types/utils/outdated-browsers.d.ts +1 -0
- package/dist/types/utils/referentiality.d.ts +3 -0
- package/dist/types/utils/sendLogs.d.ts +1 -0
- package/dist/types/with-plugin-state/index.d.ts +4 -2
- package/dist/types-ts4.0/__tests_external__/index.d.ts +0 -1
- package/dist/types-ts4.0/__tests_external__/page-objects/Editor.d.ts +0 -1
- package/dist/types-ts4.0/__tests_external__/page-objects/Renderer.d.ts +0 -1
- package/dist/types-ts4.0/analytics/types/events.d.ts +1 -0
- package/dist/types-ts4.0/extensions/types/extension-handler.d.ts +1 -0
- package/dist/types-ts4.0/in-product.d.ts +1 -1
- package/dist/types-ts4.0/styles/index.d.ts +2 -2
- package/dist/types-ts4.0/styles/shared/code-block.d.ts +1 -0
- package/dist/types-ts4.0/styles/shared/lists.d.ts +1 -0
- package/dist/types-ts4.0/types/copy-button.d.ts +20 -0
- package/dist/types-ts4.0/types/editor-actions.d.ts +1 -0
- package/dist/types-ts4.0/types/editor-container-width.d.ts +14 -0
- package/dist/types-ts4.0/types/feature-flags.d.ts +0 -6
- package/dist/types-ts4.0/types/floating-toolbar.d.ts +23 -2
- package/dist/types-ts4.0/types/index.d.ts +2 -1
- package/dist/types-ts4.0/ui/IntlProviderIfMissingWrapper/index.d.ts +6 -0
- package/dist/types-ts4.0/ui/Popup/index.d.ts +1 -0
- package/dist/types-ts4.0/ui/PortalProvider/index.d.ts +2 -1
- package/dist/types-ts4.0/ui/index.d.ts +1 -0
- package/dist/types-ts4.0/ui-menu/ToolbarButton/index.d.ts +1 -1
- package/dist/types-ts4.0/utils/breakout.d.ts +25 -0
- package/dist/types-ts4.0/utils/collab.d.ts +2 -0
- package/dist/types-ts4.0/utils/dom.d.ts +15 -1
- package/dist/types-ts4.0/utils/get-performance-options.d.ts +18 -0
- package/dist/types-ts4.0/utils/getModeFromTheme.d.ts +1 -1
- package/dist/types-ts4.0/utils/index.d.ts +5 -1
- package/dist/types-ts4.0/utils/outdated-browsers.d.ts +1 -0
- package/dist/types-ts4.0/utils/referentiality.d.ts +3 -0
- package/dist/types-ts4.0/utils/sendLogs.d.ts +1 -0
- package/dist/types-ts4.0/with-plugin-state/index.d.ts +4 -2
- package/package.json +12 -10
- package/report.api.md +7 -3
- package/tsconfig.json +2 -1
- package/dist/cjs/__tests_external__/cases/media/test-cases/alt-text.js +0 -45
- package/dist/cjs/__tests_external__/cases/media/test-cases/caption.js +0 -44
- package/dist/cjs/__tests_external__/cases/media/test-cases/index.js +0 -23
- package/dist/cjs/__tests_external__/cases/media/test-cases/upload.js +0 -38
- package/dist/cjs/__tests_external__/page-objects/EditorMedia.js +0 -98
- package/dist/cjs/cypress-config.js +0 -3
- package/dist/es2019/__tests_external__/cases/media/test-cases/alt-text.js +0 -29
- package/dist/es2019/__tests_external__/cases/media/test-cases/caption.js +0 -28
- package/dist/es2019/__tests_external__/cases/media/test-cases/index.js +0 -8
- package/dist/es2019/__tests_external__/cases/media/test-cases/upload.js +0 -23
- package/dist/es2019/__tests_external__/page-objects/EditorMedia.js +0 -51
- package/dist/es2019/cypress-config.js +0 -1
- package/dist/esm/__tests_external__/cases/media/test-cases/alt-text.js +0 -32
- package/dist/esm/__tests_external__/cases/media/test-cases/caption.js +0 -31
- package/dist/esm/__tests_external__/cases/media/test-cases/index.js +0 -10
- package/dist/esm/__tests_external__/cases/media/test-cases/upload.js +0 -26
- package/dist/esm/__tests_external__/page-objects/EditorMedia.js +0 -83
- package/dist/esm/cypress-config.js +0 -1
- package/dist/types/__tests_external__/cases/media/test-cases/alt-text.d.ts +0 -3
- package/dist/types/__tests_external__/cases/media/test-cases/caption.d.ts +0 -3
- package/dist/types/__tests_external__/cases/media/test-cases/index.d.ts +0 -3
- package/dist/types/__tests_external__/cases/media/test-cases/types.d.ts +0 -4
- package/dist/types/__tests_external__/cases/media/test-cases/upload.d.ts +0 -7
- package/dist/types/__tests_external__/page-objects/EditorMedia.d.ts +0 -19
- package/dist/types/cypress-config.d.ts +0 -1
- package/dist/types-ts4.0/__tests_external__/cases/media/test-cases/alt-text.d.ts +0 -3
- package/dist/types-ts4.0/__tests_external__/cases/media/test-cases/caption.d.ts +0 -3
- package/dist/types-ts4.0/__tests_external__/cases/media/test-cases/index.d.ts +0 -3
- package/dist/types-ts4.0/__tests_external__/cases/media/test-cases/types.d.ts +0 -4
- package/dist/types-ts4.0/__tests_external__/cases/media/test-cases/upload.d.ts +0 -7
- package/dist/types-ts4.0/__tests_external__/page-objects/EditorMedia.d.ts +0 -19
- package/dist/types-ts4.0/cypress-config.d.ts +0 -1
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
|
|
5
|
+
import { createDispatch } from '../event-dispatcher';
|
|
6
|
+
import { analyticsEventKey, startMeasure, stopMeasure } from '../utils';
|
|
7
|
+
import { getParticipantsCount } from '../utils/collab';
|
|
4
8
|
const DEFAULT_SAMPLING_RATE = 100;
|
|
5
9
|
const DEFAULT_SLOW_THRESHOLD = 4;
|
|
6
10
|
|
|
@@ -32,6 +36,8 @@ class WithPluginState extends React.Component {
|
|
|
32
36
|
|
|
33
37
|
_defineProperty(this, "isSubscribed", false);
|
|
34
38
|
|
|
39
|
+
_defineProperty(this, "callsCount", 0);
|
|
40
|
+
|
|
35
41
|
_defineProperty(this, "state", this.getPluginsStates(this.props.plugins, this.getEditorView(this.props, this.context)));
|
|
36
42
|
|
|
37
43
|
_defineProperty(this, "handlePluginStateChange", (propName, pluginName, performanceOptions, skipEqualityCheck) => pluginState => {
|
|
@@ -62,39 +68,42 @@ class WithPluginState extends React.Component {
|
|
|
62
68
|
|
|
63
69
|
const debounce = this.props.debounce !== false ? fn => window.setTimeout(fn, 0) : fn => fn();
|
|
64
70
|
this.debounce = debounce(() => {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
// editorView && editorView.state,
|
|
86
|
-
// ),
|
|
87
|
-
// },
|
|
88
|
-
// });
|
|
89
|
-
// }
|
|
90
|
-
// });
|
|
91
|
-
//}
|
|
92
|
-
this.setState(this.notAppliedState);
|
|
71
|
+
const measure = `🦉${pluginName}::WithPluginState`;
|
|
72
|
+
performanceOptions.trackingEnabled && startMeasure(measure);
|
|
73
|
+
this.setState(this.notAppliedState, () => {
|
|
74
|
+
performanceOptions.trackingEnabled && stopMeasure(measure, duration => {
|
|
75
|
+
// Each WithPluginState component will fire analytics event no more than once every `samplingLimit` times
|
|
76
|
+
if (++this.callsCount % performanceOptions.samplingRate === 0 && duration > performanceOptions.slowThreshold) {
|
|
77
|
+
const editorView = this.getEditorView();
|
|
78
|
+
this.dispatchAnalyticsEvent({
|
|
79
|
+
action: ACTION.WITH_PLUGIN_STATE_CALLED,
|
|
80
|
+
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
81
|
+
eventType: EVENT_TYPE.OPERATIONAL,
|
|
82
|
+
attributes: {
|
|
83
|
+
plugin: pluginName,
|
|
84
|
+
duration,
|
|
85
|
+
participants: getParticipantsCount(editorView && editorView.state)
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
});
|
|
93
91
|
this.debounce = null;
|
|
94
92
|
this.notAppliedState = {};
|
|
95
93
|
});
|
|
96
94
|
});
|
|
97
95
|
|
|
96
|
+
_defineProperty(this, "dispatchAnalyticsEvent", payload => {
|
|
97
|
+
const eventDispatcher = this.getEventDispatcher();
|
|
98
|
+
|
|
99
|
+
if (eventDispatcher) {
|
|
100
|
+
const dispatch = createDispatch(eventDispatcher);
|
|
101
|
+
dispatch(analyticsEventKey, {
|
|
102
|
+
payload
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
|
|
98
107
|
_defineProperty(this, "onContextUpdate", () => {
|
|
99
108
|
this.subscribe(this.props);
|
|
100
109
|
});
|
|
@@ -111,16 +120,6 @@ class WithPluginState extends React.Component {
|
|
|
111
120
|
return props.eventDispatcher || this.context && this.context.editorActions && this.context.editorActions._privateGetEventDispatcher() || this.context && this.context.editorSharedConfig && this.context.editorSharedConfig.eventDispatcher;
|
|
112
121
|
}
|
|
113
122
|
|
|
114
|
-
// TODO: ED-15580
|
|
115
|
-
//private dispatchAnalyticsEvent = (payload: AnalyticsEventPayload) => {
|
|
116
|
-
// const eventDispatcher = this.getEventDispatcher();
|
|
117
|
-
// if (eventDispatcher) {
|
|
118
|
-
// const dispatch: AnalyticsDispatch = createDispatch(eventDispatcher);
|
|
119
|
-
// dispatch(analyticsEventKey, {
|
|
120
|
-
// payload,
|
|
121
|
-
// });
|
|
122
|
-
// }
|
|
123
|
-
//};
|
|
124
123
|
getPluginsStates(plugins, editorView) {
|
|
125
124
|
if (!editorView || !plugins) {
|
|
126
125
|
return {};
|
|
@@ -140,26 +139,30 @@ class WithPluginState extends React.Component {
|
|
|
140
139
|
}
|
|
141
140
|
|
|
142
141
|
subscribe(props) {
|
|
142
|
+
var _uiTracking$samplingR, _uiTracking$slowThres;
|
|
143
|
+
|
|
143
144
|
const plugins = props.plugins;
|
|
144
145
|
const eventDispatcher = this.getEventDispatcher(props);
|
|
145
146
|
const editorView = this.getEditorView(props);
|
|
146
147
|
|
|
147
148
|
if (!eventDispatcher || !editorView || this.isSubscribed) {
|
|
148
149
|
return;
|
|
149
|
-
} // TODO: ED-
|
|
150
|
-
//
|
|
151
|
-
//
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
const
|
|
161
|
-
const
|
|
162
|
-
const
|
|
150
|
+
} // TODO: ED-15663
|
|
151
|
+
// Please, do not copy or use this kind of code below
|
|
152
|
+
// @ts-ignore
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
const fakePluginKey = {
|
|
156
|
+
key: 'analyticsPlugin$',
|
|
157
|
+
getState: state => {
|
|
158
|
+
return state['analyticsPlugin$'];
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
const analyticsPlugin = fakePluginKey.getState(editorView.state);
|
|
162
|
+
const uiTracking = analyticsPlugin && analyticsPlugin.performanceTracking ? analyticsPlugin.performanceTracking.uiTracking || {} : {};
|
|
163
|
+
const trackingEnabled = uiTracking.enabled === true;
|
|
164
|
+
const samplingRate = (_uiTracking$samplingR = uiTracking.samplingRate) !== null && _uiTracking$samplingR !== void 0 ? _uiTracking$samplingR : DEFAULT_SAMPLING_RATE;
|
|
165
|
+
const slowThreshold = (_uiTracking$slowThres = uiTracking.slowThreshold) !== null && _uiTracking$slowThres !== void 0 ? _uiTracking$slowThres : DEFAULT_SLOW_THRESHOLD;
|
|
163
166
|
this.isSubscribed = true;
|
|
164
167
|
const pluginsStates = this.getPluginsStates(plugins, editorView);
|
|
165
168
|
this.setState(pluginsStates);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { EditorPageObject } from './page-objects/Editor';
|
|
2
2
|
export { fundamentalsTestCollection } from './cases/fundamentals/collection';
|
|
3
|
-
export { inlineSmartLinksTestCollection, blockSmartLinksTestCollection, embedSmartLinksTestCollection, blueLinksTestCollection } from './cases/smart-links';
|
|
4
|
-
export { mediaTestCollection } from './cases/media/test-cases';
|
|
3
|
+
export { inlineSmartLinksTestCollection, blockSmartLinksTestCollection, embedSmartLinksTestCollection, blueLinksTestCollection } from './cases/smart-links';
|
|
@@ -43,13 +43,6 @@ export var EditorPageObject = /*#__PURE__*/function (_InProductTestPageObj) {
|
|
|
43
43
|
|
|
44
44
|
throw Error('No publish button selector supplied!');
|
|
45
45
|
}
|
|
46
|
-
}, {
|
|
47
|
-
key: "upload",
|
|
48
|
-
value: function upload(fixtures) {
|
|
49
|
-
return this.getEditorArea().attachFile(fixtures, {
|
|
50
|
-
subjectType: 'drag-n-drop'
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
46
|
}]);
|
|
54
47
|
|
|
55
48
|
return EditorPageObject;
|
|
@@ -97,8 +97,14 @@ export var EditorSmartLinkPageObject = /*#__PURE__*/function (_InProductTestPage
|
|
|
97
97
|
}, {
|
|
98
98
|
key: "insertSmartLinkByTyping",
|
|
99
99
|
value: function insertSmartLinkByTyping(url) {
|
|
100
|
-
|
|
100
|
+
var _this2 = this;
|
|
101
|
+
|
|
102
|
+
return this.editor.getEditorArea().type("".concat(url, " "), {
|
|
101
103
|
delay: 0
|
|
104
|
+
}).get('p>a').type('{leftArrow}{leftArrow}').get('[aria-label="Floating Toolbar"]').then(function () {
|
|
105
|
+
_this2.openViewSwitcher();
|
|
106
|
+
|
|
107
|
+
_this2.selectViewSwitcherOption('inline');
|
|
102
108
|
});
|
|
103
109
|
}
|
|
104
110
|
}, {
|
|
@@ -30,15 +30,6 @@ export var RendererPageObject = /*#__PURE__*/function (_InProductTestPageObj) {
|
|
|
30
30
|
value: function expectContentReady() {
|
|
31
31
|
return this.cy.get('.ak-renderer-document').should('be.visible');
|
|
32
32
|
}
|
|
33
|
-
}, {
|
|
34
|
-
key: "expectMediaSingleRenders",
|
|
35
|
-
value: function expectMediaSingleRenders(numOfMedia) {
|
|
36
|
-
var _this = this;
|
|
37
|
-
|
|
38
|
-
return this.cy.get('.rich-media-item').should('have.length', numOfMedia).each(function (element) {
|
|
39
|
-
_this.cy.wrap(element).should('have.attr', 'data-layout', 'center').should('have.attr', 'data-node-type', 'mediaSingle').should('be.visible');
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
33
|
}]);
|
|
43
34
|
|
|
44
35
|
return RendererPageObject;
|
package/dist/esm/in-product.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { fundamentalsTestCollection, blueLinksTestCollection, inlineSmartLinksTestCollection, blockSmartLinksTestCollection, embedSmartLinksTestCollection,
|
|
1
|
+
export { fundamentalsTestCollection, blueLinksTestCollection, inlineSmartLinksTestCollection, blockSmartLinksTestCollection, embedSmartLinksTestCollection, EditorPageObject } from './__tests_external__';
|
|
@@ -6,11 +6,8 @@ import React from 'react';
|
|
|
6
6
|
import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../analytics';
|
|
7
7
|
import { createDispatch } from '../event-dispatcher';
|
|
8
8
|
import { ErrorBoundary } from '../ui/ErrorBoundary';
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
// startMeasureReactNodeViewRendered,
|
|
12
|
-
// stopMeasureReactNodeViewRendered,
|
|
13
|
-
//} from './get-performance-options';
|
|
9
|
+
import { getPerformanceOptions, startMeasureReactNodeViewRendered, stopMeasureReactNodeViewRendered } from '../utils';
|
|
10
|
+
import { analyticsEventKey } from '../utils/analytics';
|
|
14
11
|
|
|
15
12
|
var ReactNodeView = /*#__PURE__*/function () {
|
|
16
13
|
function ReactNodeView(_node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent) {
|
|
@@ -82,26 +79,26 @@ var ReactNodeView = /*#__PURE__*/function () {
|
|
|
82
79
|
// difference between them and it kills the nodeView
|
|
83
80
|
|
|
84
81
|
|
|
85
|
-
this.domRef.classList.add("".concat(this.node.type.name, "View-content-wrap"));
|
|
86
|
-
//const {
|
|
87
|
-
// samplingRate,
|
|
88
|
-
// slowThreshold,
|
|
89
|
-
// trackingEnabled,
|
|
90
|
-
//} = getPerformanceOptions(this.view);
|
|
91
|
-
//trackingEnabled &&
|
|
92
|
-
// startMeasureReactNodeViewRendered({ nodeTypeName: this.node.type.name });
|
|
82
|
+
this.domRef.classList.add("".concat(this.node.type.name, "View-content-wrap"));
|
|
93
83
|
|
|
84
|
+
var _getPerformanceOption = getPerformanceOptions(this.view),
|
|
85
|
+
samplingRate = _getPerformanceOption.samplingRate,
|
|
86
|
+
slowThreshold = _getPerformanceOption.slowThreshold,
|
|
87
|
+
trackingEnabled = _getPerformanceOption.trackingEnabled;
|
|
88
|
+
|
|
89
|
+
trackingEnabled && startMeasureReactNodeViewRendered({
|
|
90
|
+
nodeTypeName: this.node.type.name
|
|
91
|
+
});
|
|
94
92
|
this.renderReactComponent(function () {
|
|
95
93
|
return _this2.render(_this2.reactComponentProps, _this2.handleRef);
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
94
|
+
});
|
|
95
|
+
trackingEnabled && stopMeasureReactNodeViewRendered({
|
|
96
|
+
nodeTypeName: this.node.type.name,
|
|
97
|
+
dispatchAnalyticsEvent: this.dispatchAnalyticsEvent,
|
|
98
|
+
editorState: this.view.state,
|
|
99
|
+
samplingRate: samplingRate,
|
|
100
|
+
slowThreshold: slowThreshold
|
|
101
|
+
});
|
|
105
102
|
return this;
|
|
106
103
|
}
|
|
107
104
|
}, {
|
package/dist/esm/styles/index.js
CHANGED
|
@@ -9,7 +9,7 @@ export { ruleSharedStyles } from './shared/rule';
|
|
|
9
9
|
export { whitespaceSharedStyles } from './shared/whitespace';
|
|
10
10
|
export { paragraphSharedStyles } from './shared/paragraph';
|
|
11
11
|
export { linkSharedStyle } from './shared/link';
|
|
12
|
-
export { listsSharedStyles } from './shared/lists';
|
|
12
|
+
export { listsSharedStyles, listPaddingLeftMarkerSpace } from './shared/lists';
|
|
13
13
|
export { indentationSharedStyles } from './shared/indentation';
|
|
14
14
|
export { blockMarksSharedStyles } from './shared/block-marks';
|
|
15
15
|
export { codeMarkSharedStyles } from './shared/code-mark';
|
|
@@ -18,6 +18,6 @@ export { dateSharedStyle, DateSharedCssClassName } from './shared/date';
|
|
|
18
18
|
export { tasksAndDecisionsStyles, TaskDecisionSharedCssClassName } from './shared/task-decision';
|
|
19
19
|
export { StatusSharedCssClassName } from './shared/status';
|
|
20
20
|
export { smartCardSharedStyles, SmartCardSharedCssClassName } from './shared/smart-card';
|
|
21
|
-
export { CodeBlockSharedCssClassName, codeBlockSharedStyles } from './shared/code-block';
|
|
21
|
+
export { CodeBlockSharedCssClassName, codeBlockSharedStyles, codeBlockInListSafariFix } from './shared/code-block';
|
|
22
22
|
export { LAYOUT_SECTION_MARGIN, LAYOUT_COLUMN_PADDING } from './shared/layout';
|
|
23
23
|
export { EXTENSION_PADDING, BODIED_EXT_PADDING } from './shared/extension';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
|
|
3
|
-
var _templateObject;
|
|
3
|
+
var _templateObject, _templateObject2;
|
|
4
4
|
|
|
5
5
|
import { css } from '@emotion/react';
|
|
6
|
-
import { akEditorCodeFontFamily, akEditorTableCellMinWidth, blockNodesVerticalMargin, overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
6
|
+
import { akEditorCodeFontFamily, akEditorLineHeight, akEditorTableCellMinWidth, blockNodesVerticalMargin, overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
7
7
|
import { DN20, DN400, DN50, DN800, N20, N30, N400, N800 } from '@atlaskit/theme/colors';
|
|
8
8
|
import { themed } from '@atlaskit/theme/components';
|
|
9
9
|
import { borderRadius, fontSize, gridSize } from '@atlaskit/theme/constants';
|
|
@@ -38,4 +38,5 @@ export var codeBlockSharedStyles = function codeBlockSharedStyles(props) {
|
|
|
38
38
|
light: token('color.text', N800),
|
|
39
39
|
dark: token('color.text', DN800)
|
|
40
40
|
})(props), borderRadius(), gridSize(), relativeFontSizeToBase16(fontSize()));
|
|
41
|
-
};
|
|
41
|
+
};
|
|
42
|
+
export var codeBlockInListSafariFix = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ::before {\n content: ' ';\n line-height: ", ";\n }\n\n > p:first-child,\n > .code-block:first-child,\n > .ProseMirror-gapcursor:first-child + .code-block {\n margin-top: -", "em !important;\n }\n"])), akEditorLineHeight, akEditorLineHeight);
|
|
@@ -5,4 +5,5 @@ var _templateObject;
|
|
|
5
5
|
import { css } from '@emotion/react';
|
|
6
6
|
import { bulletListSelector, orderedListSelector } from '@atlaskit/adf-schema';
|
|
7
7
|
import browser from '../../utils/browser';
|
|
8
|
-
export var
|
|
8
|
+
export var listPaddingLeftMarkerSpace = 24;
|
|
9
|
+
export var listsSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* =============== INDENTATION SPACING ========= */\n\n ul,\n ol {\n box-sizing: border-box;\n padding-left: ", "px;\n\n /*\n Firefox does not handle empty block element inside li tag.\n If there is not block element inside li tag,\n then firefox sets inherited height to li\n However, if there is any block element and if it's empty\n (or has empty inline element) then\n firefox sets li tag height to zero.\n More details at\n https://product-fabric.atlassian.net/wiki/spaces/~455502413/pages/3149365890/ED-14110+Investigation\n */\n li p:empty,\n li p > span:empty {\n ", "\n }\n }\n\n ", ", ", " {\n /*\n Ensures list item content adheres to the list's margin instead\n of filling the entire block row. This is important to allow\n clicking interactive elements which are floated next to a list.\n\n For some history and context on this block, see PRs related to tickets.:\n @see ED-6551 - original issue.\n @see ED-7015 - follow up issue.\n @see ED-7447 - flow-root change.\n\n We use 'display: table' (old clear fix / new block formatting context hack)\n for older browsers and 'flow-root' for modern browsers.\n\n @see https://css-tricks.com/display-flow-root/\n */\n // For older browsers the do not support flow-root.\n /* stylelint-disable declaration-block-no-duplicate-properties */\n display: table;\n display: flow-root;\n /* stylelint-enable declaration-block-no-duplicate-properties */\n }\n\n /* =============== INDENTATION AESTHETICS ========= */\n\n /**\n We support nested lists up to six levels deep.\n **/\n\n /* LEGACY LISTS */\n\n ul,\n ul ul ul ul {\n list-style-type: disc;\n }\n\n ul ul,\n ul ul ul ul ul {\n list-style-type: circle;\n }\n\n ul ul ul,\n ul ul ul ul ul ul {\n list-style-type: square;\n }\n\n ol,\n ol ol ol ol {\n list-style-type: decimal;\n }\n ol ol,\n ol ol ol ol ol {\n list-style-type: lower-alpha;\n }\n ol ol ol,\n ol ol ol ol ol ol {\n list-style-type: lower-roman;\n }\n\n /* PREDICTABLE LISTS */\n\n ol[data-indent-level='1'],\n ol[data-indent-level='4'] {\n list-style-type: decimal;\n }\n\n ol[data-indent-level='2'],\n ol[data-indent-level='5'] {\n list-style-type: lower-alpha;\n }\n\n ol[data-indent-level='3'],\n ol[data-indent-level='6'] {\n list-style-type: lower-roman;\n }\n\n ul[data-indent-level='1'],\n ul[data-indent-level='4'] {\n list-style-type: disc;\n }\n\n ul[data-indent-level='2'],\n ul[data-indent-level='5'] {\n list-style-type: circle;\n }\n\n ul[data-indent-level='3'],\n ul[data-indent-level='6'] {\n list-style-type: square;\n }\n"])), listPaddingLeftMarkerSpace, browser.gecko ? 'display: inline-block;' : '', orderedListSelector, bulletListSelector);
|
|
@@ -38,7 +38,7 @@ export var TableSharedCssClassName = {
|
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
var tableSharedStyle = function tableSharedStyle(props) {
|
|
41
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n position: relative;\n margin: 0 auto ", "px;\n box-sizing: border-box;\n\n /**\n * Fix block top alignment inside table cells.\n */\n .decisionItemView-content-wrap:first-of-type > div {\n margin-top: 0;\n }\n }\n .", "[data-number-column='true'] {\n padding-left: ", "px;\n clear: both;\n }\n .", " > table {\n margin: ", "px 0 0 0;\n }\n\n .", " > table,\n .", " > table {\n margin: ", "px ", "px 0 0;\n }\n\n /* avoid applying styles to nested tables (possible via extensions) */\n .", " > table,\n .", " > table,\n .", " > table {\n border-collapse: collapse;\n border: ", "px solid\n ", ";\n table-layout: fixed;\n font-size: 1em;\n width: 100%;\n\n &[data-autosize='true'] {\n table-layout: auto;\n }\n\n & {\n * {\n box-sizing: border-box;\n }\n hr {\n box-sizing: content-box;\n }\n\n tbody {\n border-bottom: none;\n }\n th td {\n background-color: ", ";\n }\n th,\n td {\n min-width: ", "px;\n font-weight: normal;\n vertical-align: top;\n border: 1px solid\n ", ";\n border-right-width: 0;\n border-bottom-width: 0;\n padding: ", "px;\n /* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n ", "\n\n ", ";\n\n > :first-child:not(style),\n > style:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor
|
|
41
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n position: relative;\n margin: 0 auto ", "px;\n box-sizing: border-box;\n\n /**\n * Fix block top alignment inside table cells.\n */\n .decisionItemView-content-wrap:first-of-type > div {\n margin-top: 0;\n }\n }\n .", "[data-number-column='true'] {\n padding-left: ", "px;\n clear: both;\n }\n .", " > table {\n margin: ", "px 0 0 0;\n }\n\n .", " > table,\n .", " > table {\n margin: ", "px ", "px 0 0;\n }\n\n /* avoid applying styles to nested tables (possible via extensions) */\n .", " > table,\n .", " > table,\n .", " > table {\n border-collapse: collapse;\n border: ", "px solid\n ", ";\n table-layout: fixed;\n font-size: 1em;\n width: 100%;\n\n &[data-autosize='true'] {\n table-layout: auto;\n }\n\n & {\n * {\n box-sizing: border-box;\n }\n hr {\n box-sizing: content-box;\n }\n\n tbody {\n border-bottom: none;\n }\n th td {\n background-color: ", ";\n }\n th,\n td {\n min-width: ", "px;\n font-weight: normal;\n vertical-align: top;\n border: 1px solid\n ", ";\n border-right-width: 0;\n border-bottom-width: 0;\n padding: ", "px;\n /* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n ", "\n\n ", ";\n\n > :first-child:not(style),\n > style:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + *,\n > style:first-child + .ProseMirror-gapcursor + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + *,\n > style:first-child + .ProseMirror-gapcursor + span + * {\n margin-top: 0;\n }\n\n th p:not(:first-of-type),\n td p:not(:first-of-type) {\n margin-top: 12px;\n }\n }\n th {\n background-color: ", ";\n text-align: left;\n\n /* only apply this styling to codeblocks in default background headercells */\n /* TODO this needs to be overhauled as it relies on unsafe selectors */\n &:not([style]) {\n .code-block {\n background-image: ", ";\n background-attachment: local, scroll, scroll;\n background-position: 100% 0, 100% 0, 0 0;\n background-color: ", ";\n\n .line-number-gutter {\n background-color: ", ";\n }\n\n /* this is only relevant to the element taken care of by renderer */\n > [data-ds--code--code-block] {\n background-image: ", "!important;\n\n background-color: ", "!important;\n\n // selector lives inside @atlaskit/code\n --ds--code--line-number-bg-color: ", ";\n }\n }\n }\n }\n }\n }\n"])), TableSharedCssClassName.TABLE_CONTAINER, tableMarginBottom, TableSharedCssClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_NODE_WRAPPER, tableMarginTop, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableMarginTop, tableMarginSides, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableCellBorderWidth, themed({
|
|
42
42
|
light: token('color.border', akEditorTableBorder),
|
|
43
43
|
dark: token('color.border', akEditorTableBorderDark)
|
|
44
44
|
})(props), token('color.background.neutral.subtle', 'white'), tableCellMinWidth, themed({
|
package/dist/esm/{__tests_external__/cases/media/test-cases/types.js → types/copy-button.js}
RENAMED
|
File without changes
|
|
@@ -23,7 +23,7 @@ import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
|
23
23
|
import { token } from '@atlaskit/tokens';
|
|
24
24
|
import Layer from '../Layer';
|
|
25
25
|
var packageName = "@atlaskit/editor-common";
|
|
26
|
-
var packageVersion = "70.
|
|
26
|
+
var packageVersion = "70.2.0";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = "0, ".concat(gridSize(), "px");
|
|
29
29
|
|
|
@@ -88,7 +88,7 @@ var containerStyles = function containerStyles(styleProps) {
|
|
|
88
88
|
var marginHorizontal = styleProps['data-node-type'] === 'expand' ? "-".concat(akLayoutGutterOffset, "px") : 0;
|
|
89
89
|
var margin = "".concat(marginTop, " ").concat(marginHorizontal, " ").concat(marginBottom);
|
|
90
90
|
return function (themeProps) {
|
|
91
|
-
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n border-radius: ", "px;\n min-height: 25px;\n background: ", ";\n margin: ", ";\n\n transition: background 0.3s ", ",\n border-color 0.3s ", ";\n padding: ", "px;\n\n // TODO: https://product-fabric.atlassian.net/browse/DSP-4152\n
|
|
91
|
+
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n border-radius: ", "px;\n min-height: 25px;\n background: ", ";\n margin: ", ";\n\n transition: background 0.3s ", ",\n border-color 0.3s ", ";\n padding: ", "px;\n\n &:hover {\n // TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.\n // This is because the default state already uses the same token and, as such, the hover style won't change anything.\n // https://product-fabric.atlassian.net/browse/DSP-4152\n border: 1px solid\n ", ";\n background: ", ";\n }\n\n td > :not(style):first-child,\n td > style:first-child + * {\n margin-top: 0;\n }\n "])), focused ? EXPAND_FOCUSED_BORDER_COLOR : expanded ? EXPAND_EXPANDED_BORDER_COLOR(themeProps) : EXPAND_COLLAPSED_BORDER_COLOR, BORDER_RADIUS, !expanded ? EXPAND_COLLAPSED_BACKGROUND : EXPAND_SELECTED_BACKGROUND(themeProps), margin, akEditorSwoopCubicBezier, akEditorSwoopCubicBezier, gridSize(), themed({
|
|
92
92
|
light: token('color.border', colors.N50A),
|
|
93
93
|
dark: token('color.border', colors.DN50)
|
|
94
94
|
})(themeProps), EXPAND_SELECTED_BACKGROUND(themeProps));
|
|
@@ -97,7 +97,7 @@ var containerStyles = function containerStyles(styleProps) {
|
|
|
97
97
|
|
|
98
98
|
var contentStyles = function contentStyles(styleProps) {
|
|
99
99
|
return function (themeProps) {
|
|
100
|
-
return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n
|
|
100
|
+
return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n padding-top: ", "px;\n padding-right: ", "px;\n padding-left: ", "px;\n display: flow-root;\n\n // The follow rules inside @supports block are added as a part of ED-8893\n // The fix is targeting mobile bridge on iOS 12 or below,\n // We should consider remove this fix when we no longer support iOS 12\n @supports not (display: flow-root) {\n width: 100%;\n box-sizing: border-box;\n }\n\n ", "\n "])), styleProps.expanded ? gridSize() : 0, gridSize(), gridSize() * 4 - gridSize() / 2, !styleProps.expanded ? "\n .expand-content-wrapper, .nestedExpand-content-wrapper {\n /* We visually hide the content here to preserve the content during copy+paste */\n width: 100%;\n display: block;\n height: 0;\n overflow: hidden;\n clip: rect(1px, 1px, 1px, 1px);\n white-space: nowrap;\n user-select: none;\n }\n " : '');
|
|
101
101
|
};
|
|
102
102
|
};
|
|
103
103
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import { IntlContext, IntlProvider } from 'react-intl-next';
|
|
3
|
+
|
|
4
|
+
var useCheckIntlContext = function useCheckIntlContext() {
|
|
5
|
+
return useContext(IntlContext) === null;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export default function IntlProviderIfMissingWrapper(_ref) {
|
|
9
|
+
var children = _ref.children;
|
|
10
|
+
var missingIntlContext = useCheckIntlContext();
|
|
11
|
+
|
|
12
|
+
if (missingIntlContext) {
|
|
13
|
+
return /*#__PURE__*/React.createElement(IntlProvider, {
|
|
14
|
+
locale: "en"
|
|
15
|
+
}, children);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return children;
|
|
19
|
+
}
|
|
@@ -235,10 +235,10 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
235
235
|
|
|
236
236
|
return /*#__PURE__*/React.createElement("div", {
|
|
237
237
|
ref: this.handleRef,
|
|
238
|
-
style: _objectSpread({
|
|
238
|
+
style: _objectSpread(_objectSpread({
|
|
239
239
|
position: 'absolute',
|
|
240
240
|
zIndex: this.props.zIndex || akEditorFloatingPanelZIndex
|
|
241
|
-
}, position),
|
|
241
|
+
}, position), this.props.style),
|
|
242
242
|
"aria-label": this.props.ariaLabel || 'Popup' // Indicates component is an editor pop. Required for focus handling in Message.tsx
|
|
243
243
|
,
|
|
244
244
|
"data-editor-popup": true
|