@atlaskit/editor-common 78.11.5 → 78.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/collab/index.js +38 -11
- package/dist/cjs/extensibility/Extension/Extension/index.js +16 -2
- package/dist/cjs/extensibility/Extension/Lozenge.js +2 -0
- package/dist/cjs/extensibility/Extension/LozengeComponent.js +23 -18
- package/dist/cjs/extensibility/Extension/styles.js +9 -1
- package/dist/cjs/extensibility/ExtensionComponent.js +11 -2
- package/dist/cjs/extensibility/MultiBodiedExtension/index.js +17 -3
- package/dist/cjs/keymaps/index.js +9 -6
- package/dist/cjs/media-inline/styles.js +2 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/preset/plugin-injection-api.js +0 -4
- package/dist/cjs/selection/gap-cursor/styles.js +12 -3
- package/dist/cjs/styles/shared/annotation.js +18 -4
- package/dist/cjs/styles/shared/block-marks.js +1 -0
- package/dist/cjs/styles/shared/blockquote.js +29 -4
- package/dist/cjs/styles/shared/code-block.js +1 -0
- package/dist/cjs/styles/shared/code-mark.js +8 -3
- package/dist/cjs/styles/shared/column-layout.js +17 -3
- package/dist/cjs/styles/shared/date.js +4 -3
- package/dist/cjs/styles/shared/expand.js +3 -5
- package/dist/cjs/styles/shared/headings.js +34 -3
- package/dist/cjs/styles/shared/indentation.js +28 -5
- package/dist/cjs/styles/shared/link.js +5 -4
- package/dist/cjs/styles/shared/lists.js +2 -0
- package/dist/cjs/styles/shared/media-single.js +39 -3
- package/dist/cjs/styles/shared/panel.js +5 -2
- package/dist/cjs/styles/shared/paragraph.js +11 -4
- package/dist/cjs/styles/shared/plugins.js +30 -7
- package/dist/cjs/styles/shared/resizer.js +2 -0
- package/dist/cjs/styles/shared/rule.js +10 -4
- package/dist/cjs/styles/shared/shadow.js +1 -2
- package/dist/cjs/styles/shared/smartCard.js +2 -0
- package/dist/cjs/styles/shared/table.js +2 -0
- package/dist/cjs/styles/shared/tableCell.js +2 -4
- package/dist/cjs/styles/shared/text-color.js +8 -4
- package/dist/cjs/styles/shared/unsupported-content.js +2 -0
- package/dist/cjs/styles/shared/whitespace.js +4 -4
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/MediaSingle/styled.js +16 -8
- package/dist/cjs/ui/ResizerLegacy/styled.js +1 -0
- package/dist/cjs/ui/clear-next-sibling-margin-top.js +12 -5
- package/dist/es2019/collab/index.js +34 -41
- package/dist/es2019/extensibility/Extension/Extension/index.js +12 -2
- package/dist/es2019/extensibility/Extension/Lozenge.js +2 -0
- package/dist/es2019/extensibility/Extension/LozengeComponent.js +22 -17
- package/dist/es2019/extensibility/Extension/styles.js +9 -1
- package/dist/es2019/extensibility/ExtensionComponent.js +11 -2
- package/dist/es2019/extensibility/MultiBodiedExtension/index.js +13 -3
- package/dist/es2019/keymaps/index.js +7 -11
- package/dist/es2019/media-inline/media-inline-image-card.js +0 -1
- package/dist/es2019/media-inline/styles.js +2 -0
- package/dist/es2019/media-inline/views/icon-wrapper.js +0 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/preset/plugin-injection-api.js +0 -4
- package/dist/es2019/selection/gap-cursor/styles.js +9 -7
- package/dist/es2019/styles/shared/annotation.js +13 -12
- package/dist/es2019/styles/shared/block-marks.js +1 -0
- package/dist/es2019/styles/shared/blockquote.js +27 -34
- package/dist/es2019/styles/shared/code-block.js +1 -0
- package/dist/es2019/styles/shared/code-mark.js +5 -5
- package/dist/es2019/styles/shared/column-layout.js +15 -17
- package/dist/es2019/styles/shared/date.js +4 -4
- package/dist/es2019/styles/shared/expand.js +3 -4
- package/dist/es2019/styles/shared/headings.js +36 -35
- package/dist/es2019/styles/shared/indentation.js +26 -22
- package/dist/es2019/styles/shared/link.js +4 -4
- package/dist/es2019/styles/shared/lists.js +2 -0
- package/dist/es2019/styles/shared/media-single.js +42 -65
- package/dist/es2019/styles/shared/panel.js +5 -5
- package/dist/es2019/styles/shared/paragraph.js +10 -9
- package/dist/es2019/styles/shared/plugins.js +29 -34
- package/dist/es2019/styles/shared/resizer.js +2 -0
- package/dist/es2019/styles/shared/rule.js +9 -8
- package/dist/es2019/styles/shared/shadow.js +1 -2
- package/dist/es2019/styles/shared/smartCard.js +2 -0
- package/dist/es2019/styles/shared/table.js +2 -0
- package/dist/es2019/styles/shared/tableCell.js +1 -3
- package/dist/es2019/styles/shared/text-color.js +7 -8
- package/dist/es2019/styles/shared/unsupported-content.js +2 -0
- package/dist/es2019/styles/shared/whitespace.js +4 -4
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/MediaSingle/styled.js +37 -31
- package/dist/es2019/ui/ResizerLegacy/styled.js +2 -0
- package/dist/es2019/ui/clear-next-sibling-margin-top.js +11 -9
- package/dist/esm/collab/index.js +38 -11
- package/dist/esm/extensibility/Extension/Extension/index.js +16 -2
- package/dist/esm/extensibility/Extension/Lozenge.js +2 -0
- package/dist/esm/extensibility/Extension/LozengeComponent.js +23 -18
- package/dist/esm/extensibility/Extension/styles.js +9 -1
- package/dist/esm/extensibility/ExtensionComponent.js +11 -2
- package/dist/esm/extensibility/MultiBodiedExtension/index.js +17 -3
- package/dist/esm/keymaps/index.js +7 -5
- package/dist/esm/media-inline/media-inline-image-card.js +0 -1
- package/dist/esm/media-inline/styles.js +2 -0
- package/dist/esm/media-inline/views/icon-wrapper.js +0 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/preset/plugin-injection-api.js +0 -4
- package/dist/esm/selection/gap-cursor/styles.js +12 -3
- package/dist/esm/styles/shared/annotation.js +18 -4
- package/dist/esm/styles/shared/block-marks.js +1 -0
- package/dist/esm/styles/shared/blockquote.js +29 -3
- package/dist/esm/styles/shared/code-block.js +1 -0
- package/dist/esm/styles/shared/code-mark.js +8 -3
- package/dist/esm/styles/shared/column-layout.js +17 -3
- package/dist/esm/styles/shared/date.js +4 -3
- package/dist/esm/styles/shared/expand.js +3 -4
- package/dist/esm/styles/shared/headings.js +34 -3
- package/dist/esm/styles/shared/indentation.js +28 -5
- package/dist/esm/styles/shared/link.js +5 -3
- package/dist/esm/styles/shared/lists.js +2 -0
- package/dist/esm/styles/shared/media-single.js +39 -3
- package/dist/esm/styles/shared/panel.js +5 -2
- package/dist/esm/styles/shared/paragraph.js +11 -3
- package/dist/esm/styles/shared/plugins.js +30 -6
- package/dist/esm/styles/shared/resizer.js +2 -0
- package/dist/esm/styles/shared/rule.js +10 -3
- package/dist/esm/styles/shared/shadow.js +1 -2
- package/dist/esm/styles/shared/smartCard.js +2 -0
- package/dist/esm/styles/shared/table.js +2 -0
- package/dist/esm/styles/shared/tableCell.js +1 -3
- package/dist/esm/styles/shared/text-color.js +8 -3
- package/dist/esm/styles/shared/unsupported-content.js +2 -0
- package/dist/esm/styles/shared/whitespace.js +4 -3
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/MediaSingle/styled.js +16 -8
- package/dist/esm/ui/ResizerLegacy/styled.js +2 -0
- package/dist/esm/ui/clear-next-sibling-margin-top.js +12 -5
- package/dist/types/collab/index.d.ts +1 -1
- package/dist/types/element-browser/components/ElementBrowserLoader.d.ts +1 -1
- package/dist/types/extensibility/Extension/Extension/index.d.ts +2 -0
- package/dist/types/extensibility/Extension/Lozenge.d.ts +1 -0
- package/dist/types/extensibility/Extension/LozengeComponent.d.ts +2 -1
- package/dist/types/extensibility/ExtensionComponent.d.ts +2 -0
- package/dist/types/extensibility/MultiBodiedExtension/index.d.ts +2 -0
- package/dist/types/extensions/types/extension-manifest-common.d.ts +1 -1
- package/dist/types/extensions/types/extension-manifest.d.ts +1 -1
- package/dist/types/icons/index.d.ts +1 -1
- package/dist/types/link/LinkSearch/withActivityProvider.d.ts +1 -1
- package/dist/types/media-inline/inline-image-wrapper.d.ts +3 -2
- package/dist/types/media-inline/media-inline-image-card.d.ts +4 -4
- package/dist/types/media-inline/views/error-view.d.ts +3 -2
- package/dist/types/media-inline/views/frame.d.ts +3 -2
- package/dist/types/media-inline/views/icon-wrapper.d.ts +3 -2
- package/dist/types/media-inline/views/loading-view.d.ts +2 -2
- package/dist/types/quick-insert/assets/index.d.ts +24 -24
- package/dist/types/react-node-view/getInlineNodeViewProducer.d.ts +1 -1
- package/dist/types/react-node-view/index.d.ts +2 -2
- package/dist/types/selection-based-node-view/SelectionBasedNodeView.d.ts +1 -1
- package/dist/types/types/annotation/index.d.ts +2 -2
- package/dist/types/types/floating-toolbar.d.ts +3 -3
- package/dist/types/ui/Announcer/announcer.d.ts +1 -1
- package/dist/types/ui/DropList/index.d.ts +1 -2
- package/dist/types/ui/ErrorBoundary/index.d.ts +1 -0
- package/dist/types/ui/IntlErrorBoundary/index.d.ts +1 -0
- package/dist/types/ui/Layer/index.d.ts +2 -1
- package/dist/types/ui/MediaSingle/styled.d.ts +1 -1
- package/dist/types/ui/OverflowShadow/index.d.ts +1 -1
- package/dist/types/ui/Popup/index.d.ts +1 -0
- package/dist/types/ui/with-outer-listeners.d.ts +3 -2
- package/dist/types/ui-menu/ArrowKeyNavigationProvider/ColorPaletteArrowKeyNavigationProvider/index.d.ts +1 -1
- package/dist/types/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.d.ts +1 -1
- package/dist/types/ui-menu/ArrowKeyNavigationProvider/index.d.ts +1 -1
- package/dist/types/ui-menu/ColorPickerButton/index.d.ts +1 -1
- package/dist/types/ui-menu/Dropdown/index.d.ts +1 -1
- package/dist/types/ui-menu/DropdownMenu/index.d.ts +1 -1
- package/dist/types/ui-menu/DropdownMenu/types.d.ts +1 -0
- package/dist/types/ui-react/with-react-editor-view-outer-listeners.d.ts +1 -2
- package/dist/types/utils/imageLoader.d.ts +1 -1
- package/dist/types-ts4.5/collab/index.d.ts +1 -1
- package/dist/types-ts4.5/element-browser/components/ElementBrowserLoader.d.ts +1 -1
- package/dist/types-ts4.5/extensibility/Extension/Extension/index.d.ts +2 -0
- package/dist/types-ts4.5/extensibility/Extension/Lozenge.d.ts +1 -0
- package/dist/types-ts4.5/extensibility/Extension/LozengeComponent.d.ts +2 -1
- package/dist/types-ts4.5/extensibility/ExtensionComponent.d.ts +2 -0
- package/dist/types-ts4.5/extensibility/MultiBodiedExtension/index.d.ts +2 -0
- package/dist/types-ts4.5/extensions/types/extension-manifest-common.d.ts +1 -1
- package/dist/types-ts4.5/extensions/types/extension-manifest.d.ts +1 -1
- package/dist/types-ts4.5/icons/index.d.ts +1 -1
- package/dist/types-ts4.5/link/LinkSearch/withActivityProvider.d.ts +1 -1
- package/dist/types-ts4.5/media-inline/inline-image-wrapper.d.ts +3 -2
- package/dist/types-ts4.5/media-inline/media-inline-image-card.d.ts +4 -4
- package/dist/types-ts4.5/media-inline/views/error-view.d.ts +3 -2
- package/dist/types-ts4.5/media-inline/views/frame.d.ts +3 -2
- package/dist/types-ts4.5/media-inline/views/icon-wrapper.d.ts +3 -2
- package/dist/types-ts4.5/media-inline/views/loading-view.d.ts +2 -2
- package/dist/types-ts4.5/quick-insert/assets/index.d.ts +24 -24
- package/dist/types-ts4.5/react-node-view/getInlineNodeViewProducer.d.ts +1 -1
- package/dist/types-ts4.5/react-node-view/index.d.ts +2 -2
- package/dist/types-ts4.5/selection-based-node-view/SelectionBasedNodeView.d.ts +1 -1
- package/dist/types-ts4.5/types/annotation/index.d.ts +2 -2
- package/dist/types-ts4.5/types/floating-toolbar.d.ts +3 -3
- package/dist/types-ts4.5/ui/Announcer/announcer.d.ts +1 -1
- package/dist/types-ts4.5/ui/DropList/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/ErrorBoundary/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/IntlErrorBoundary/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/Layer/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/MediaSingle/styled.d.ts +1 -1
- package/dist/types-ts4.5/ui/OverflowShadow/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/Popup/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/with-outer-listeners.d.ts +3 -2
- package/dist/types-ts4.5/ui-menu/ArrowKeyNavigationProvider/ColorPaletteArrowKeyNavigationProvider/index.d.ts +1 -1
- package/dist/types-ts4.5/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.d.ts +1 -1
- package/dist/types-ts4.5/ui-menu/ArrowKeyNavigationProvider/index.d.ts +1 -1
- package/dist/types-ts4.5/ui-menu/ColorPickerButton/index.d.ts +1 -1
- package/dist/types-ts4.5/ui-menu/Dropdown/index.d.ts +1 -1
- package/dist/types-ts4.5/ui-menu/DropdownMenu/index.d.ts +1 -1
- package/dist/types-ts4.5/ui-menu/DropdownMenu/types.d.ts +1 -0
- package/dist/types-ts4.5/ui-react/with-react-editor-view-outer-listeners.d.ts +1 -2
- package/dist/types-ts4.5/utils/imageLoader.d.ts +1 -1
- package/package.json +5 -5
|
@@ -132,51 +132,44 @@ export const colors = [themeColors.R100, themeColors.R300, themeColors.R500, the
|
|
|
132
132
|
solid,
|
|
133
133
|
selection: hexToRgba(solid, 0.2)
|
|
134
134
|
}));
|
|
135
|
-
const telepointerColorStyle = (color, index) => `
|
|
136
|
-
&.color-${index} {
|
|
137
|
-
background-color: ${color.selection};
|
|
138
|
-
&::after {
|
|
139
|
-
background-color: ${color.solid};
|
|
140
|
-
color: ${"var(--ds-text-inverse, #fff)"};
|
|
141
|
-
border-color: ${color.solid};
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
`;
|
|
145
135
|
export const TELEPOINTER_DIM_CLASS = 'telepointer-dim';
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
136
|
+
export const telepointerStyle = css({
|
|
137
|
+
'.ProseMirror .telepointer': {
|
|
138
|
+
position: 'relative',
|
|
139
|
+
transition: 'opacity 200ms',
|
|
140
|
+
'&.telepointer-selection': {
|
|
141
|
+
lineHeight: 1.2,
|
|
142
|
+
pointerEvents: 'none',
|
|
143
|
+
userSelect: 'none'
|
|
144
|
+
},
|
|
145
|
+
'&.telepointer-selection-badge::after': {
|
|
146
|
+
content: 'attr(data-initial)',
|
|
147
|
+
position: 'absolute',
|
|
148
|
+
display: 'block',
|
|
149
|
+
// Disable top: -14px since it is necessary to align to cursor
|
|
150
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
151
|
+
top: '-14px',
|
|
152
|
+
fontSize: relativeFontSizeToBase16(9),
|
|
153
|
+
padding: "var(--ds-space-025, 2px)",
|
|
154
|
+
color: "var(--ds-text-inverse, white)",
|
|
155
|
+
left: '0px',
|
|
156
|
+
borderRadius: '2px 2px 2px 0',
|
|
157
|
+
lineHeight: 'initial'
|
|
158
|
+
},
|
|
159
|
+
[`&.${TELEPOINTER_DIM_CLASS}`]: {
|
|
160
|
+
opacity: 0.2
|
|
171
161
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
162
|
+
}
|
|
163
|
+
}, ...colors.map((color, index) => ({
|
|
164
|
+
[`&.color-${index}`]: {
|
|
165
|
+
backgroundColor: color.selection,
|
|
166
|
+
'&::after': {
|
|
167
|
+
backgroundColor: color.solid,
|
|
168
|
+
color: "var(--ds-text-inverse, #fff)",
|
|
169
|
+
borderColor: color.solid
|
|
175
170
|
}
|
|
176
|
-
|
|
177
|
-
${colors.map((color, index) => telepointerColorStyle(color, index))};
|
|
178
171
|
}
|
|
179
|
-
|
|
172
|
+
})));
|
|
180
173
|
const tintKey = 'collab:isDirtyTransaction';
|
|
181
174
|
export const isDirtyTransaction = tr => {
|
|
182
175
|
return Boolean(tr.getMeta(tintKey));
|
|
@@ -24,7 +24,9 @@ function ExtensionWithPluginState(props) {
|
|
|
24
24
|
hideFrame,
|
|
25
25
|
editorAppearance,
|
|
26
26
|
showMacroInteractionDesignUpdates,
|
|
27
|
-
isNodeSelected
|
|
27
|
+
isNodeSelected,
|
|
28
|
+
isNodeHovered,
|
|
29
|
+
setIsNodeHovered
|
|
28
30
|
} = props;
|
|
29
31
|
const hasBody = ['bodiedExtension', 'multiBodiedExtension'].includes(node.type.name);
|
|
30
32
|
const isMobile = editorAppearance === 'mobile';
|
|
@@ -80,8 +82,14 @@ function ExtensionWithPluginState(props) {
|
|
|
80
82
|
...newContentStyles,
|
|
81
83
|
...contentWrapper
|
|
82
84
|
};
|
|
85
|
+
const handleMouseEvent = didHover => {
|
|
86
|
+
if (setIsNodeHovered) {
|
|
87
|
+
setIsNodeHovered(didHover);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
83
90
|
return jsx(Fragment, null, showMacroInteractionDesignUpdates && jsx(ExtensionLozenge, {
|
|
84
91
|
isNodeSelected: isNodeSelected,
|
|
92
|
+
isNodeHovered: isNodeHovered,
|
|
85
93
|
node: node,
|
|
86
94
|
showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates,
|
|
87
95
|
customContainerStyles: customContainerStyles
|
|
@@ -90,7 +98,9 @@ function ExtensionWithPluginState(props) {
|
|
|
90
98
|
"data-layout": node.attrs.layout,
|
|
91
99
|
className: classNames,
|
|
92
100
|
css: wrapperStyle,
|
|
93
|
-
style: customContainerStyles
|
|
101
|
+
style: customContainerStyles,
|
|
102
|
+
onMouseOver: () => handleMouseEvent(true),
|
|
103
|
+
onMouseLeave: () => handleMouseEvent(false)
|
|
94
104
|
}, jsx("div", {
|
|
95
105
|
className: `extension-overflow-wrapper ${hasBody ? 'with-body' : ''}`
|
|
96
106
|
}, jsx("div", {
|
|
@@ -28,6 +28,7 @@ export default class ExtensionLozenge extends Component {
|
|
|
28
28
|
const {
|
|
29
29
|
showMacroInteractionDesignUpdates,
|
|
30
30
|
isNodeSelected,
|
|
31
|
+
isNodeHovered,
|
|
31
32
|
customContainerStyles
|
|
32
33
|
} = this.props;
|
|
33
34
|
const {
|
|
@@ -41,6 +42,7 @@ export default class ExtensionLozenge extends Component {
|
|
|
41
42
|
const title = parameters && parameters.extensionTitle || parameters && parameters.macroMetadata && parameters.macroMetadata.title || extensionKey;
|
|
42
43
|
const isBlockExtension = name === 'extension';
|
|
43
44
|
return jsx(LozengeComponent, {
|
|
45
|
+
isNodeHovered: isNodeHovered,
|
|
44
46
|
isNodeSelected: isNodeSelected,
|
|
45
47
|
showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates,
|
|
46
48
|
isBlockExtension: isBlockExtension,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
+
import classnames from 'classnames';
|
|
4
5
|
import EditorFileIcon from '@atlaskit/icon/glyph/editor/file';
|
|
5
6
|
import { SimpleTag as Tag } from '@atlaskit/tag';
|
|
6
7
|
import { lozengeWrapper, placeholderFallback, placeholderFallbackParams } from './styles';
|
|
@@ -16,13 +17,16 @@ export const LozengeComponent = ({
|
|
|
16
17
|
renderImage,
|
|
17
18
|
isNodeSelected,
|
|
18
19
|
showMacroInteractionDesignUpdates,
|
|
19
|
-
customContainerStyles
|
|
20
|
+
customContainerStyles,
|
|
21
|
+
isNodeHovered
|
|
20
22
|
}) => {
|
|
21
23
|
const capitalizedTitle = capitalizeFirstLetter(title);
|
|
22
|
-
// TODO: only show on lozenge on hover: https://product-fabric.atlassian.net/browse/PGXT-4945
|
|
23
24
|
if (showMacroInteractionDesignUpdates) {
|
|
25
|
+
const lozengeClassNames = classnames('extension-title', {
|
|
26
|
+
'show-lozenge': isNodeHovered || isNodeSelected
|
|
27
|
+
});
|
|
24
28
|
return jsx("div", {
|
|
25
|
-
className:
|
|
29
|
+
className: lozengeClassNames,
|
|
26
30
|
css: lozengeWrapper,
|
|
27
31
|
"data-testid": "new-lozenge",
|
|
28
32
|
style: customContainerStyles
|
|
@@ -30,19 +34,20 @@ export const LozengeComponent = ({
|
|
|
30
34
|
text: capitalizedTitle,
|
|
31
35
|
color: isNodeSelected ? 'blueLight' : 'greyLight'
|
|
32
36
|
}));
|
|
37
|
+
} else {
|
|
38
|
+
return jsx("div", {
|
|
39
|
+
"data-testid": "lozenge-fallback",
|
|
40
|
+
css: placeholderFallback
|
|
41
|
+
}, lozengeData && !isBlockExtension ? renderImage({
|
|
42
|
+
height: ICON_SIZE,
|
|
43
|
+
width: ICON_SIZE,
|
|
44
|
+
...lozengeData
|
|
45
|
+
}) : jsx(EditorFileIcon, {
|
|
46
|
+
label: title
|
|
47
|
+
}), jsx("span", {
|
|
48
|
+
className: "extension-title"
|
|
49
|
+
}, capitalizedTitle), params && !isBlockExtension && jsx("span", {
|
|
50
|
+
css: placeholderFallbackParams
|
|
51
|
+
}, Object.keys(params).map(key => key && ` | ${key} = ${params[key].value}`)));
|
|
33
52
|
}
|
|
34
|
-
return jsx("div", {
|
|
35
|
-
"data-testid": "lozenge-fallback",
|
|
36
|
-
css: placeholderFallback
|
|
37
|
-
}, lozengeData && !isBlockExtension ? renderImage({
|
|
38
|
-
height: ICON_SIZE,
|
|
39
|
-
width: ICON_SIZE,
|
|
40
|
-
...lozengeData
|
|
41
|
-
}) : jsx(EditorFileIcon, {
|
|
42
|
-
label: title
|
|
43
|
-
}), jsx("span", {
|
|
44
|
-
className: "extension-title"
|
|
45
|
-
}, capitalizedTitle), params && !isBlockExtension && jsx("span", {
|
|
46
|
-
css: placeholderFallbackParams
|
|
47
|
-
}, Object.keys(params).map(key => key && ` | ${key} = ${params[key].value}`)));
|
|
48
53
|
};
|
|
@@ -60,6 +60,14 @@ export const lozengeWrapper = css({
|
|
|
60
60
|
display: 'flex',
|
|
61
61
|
justifyContent: 'left',
|
|
62
62
|
width: '100%',
|
|
63
|
+
/* -0.75rem neutralizes the margin top coming from extensionView-content-wrap.
|
|
64
|
+
The lozenge takes up space so we don't need the extra padding anymore. */
|
|
65
|
+
marginTop: "var(--ds-space-negative-150, -0.75rem)",
|
|
63
66
|
marginLeft: "var(--ds-space-050, 4px)",
|
|
64
|
-
marginBottom: "var(--ds-space-negative-050, -4px)"
|
|
67
|
+
marginBottom: "var(--ds-space-negative-050, -4px)",
|
|
68
|
+
// Using opacity so that lozenge takes up space and doesn't cause shift on render
|
|
69
|
+
opacity: '0',
|
|
70
|
+
'&.show-lozenge': {
|
|
71
|
+
opacity: '1'
|
|
72
|
+
}
|
|
65
73
|
});
|
|
@@ -16,6 +16,11 @@ export class ExtensionComponent extends Component {
|
|
|
16
16
|
// memoized to avoid rerender on extension state changes
|
|
17
17
|
_defineProperty(this, "getNodeRenderer", memoizeOne(getNodeRenderer));
|
|
18
18
|
_defineProperty(this, "getExtensionModuleNodePrivateProps", memoizeOne(getExtensionModuleNodePrivateProps));
|
|
19
|
+
_defineProperty(this, "setIsNodeHovered", isHovered => {
|
|
20
|
+
this.setState({
|
|
21
|
+
isNodeHovered: isHovered
|
|
22
|
+
});
|
|
23
|
+
});
|
|
19
24
|
_defineProperty(this, "setStateFromPromise", (stateKey, promise) => {
|
|
20
25
|
promise && promise.then(p => {
|
|
21
26
|
if (!this.mounted) {
|
|
@@ -164,7 +169,9 @@ export class ExtensionComponent extends Component {
|
|
|
164
169
|
pluginInjectionApi: pluginInjectionApi,
|
|
165
170
|
editorAppearance: editorAppearance,
|
|
166
171
|
showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates,
|
|
167
|
-
isNodeSelected: selectedNode === node
|
|
172
|
+
isNodeSelected: selectedNode === node,
|
|
173
|
+
isNodeHovered: this.state.isNodeHovered,
|
|
174
|
+
setIsNodeHovered: this.setIsNodeHovered
|
|
168
175
|
});
|
|
169
176
|
}
|
|
170
177
|
const extensionHandlerResult = this.tryExtensionHandler(undefined);
|
|
@@ -182,7 +189,9 @@ export class ExtensionComponent extends Component {
|
|
|
182
189
|
hideFrame: (_this$state$_privateP = this.state._privateProps) === null || _this$state$_privateP === void 0 ? void 0 : _this$state$_privateP.__hideFrame,
|
|
183
190
|
pluginInjectionApi: pluginInjectionApi,
|
|
184
191
|
showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates,
|
|
185
|
-
isNodeSelected: selectedNode === node
|
|
192
|
+
isNodeSelected: selectedNode === node,
|
|
193
|
+
isNodeHovered: this.state.isNodeHovered,
|
|
194
|
+
setIsNodeHovered: this.setIsNodeHovered
|
|
186
195
|
}, extensionHandlerResult);
|
|
187
196
|
case 'inlineExtension':
|
|
188
197
|
return /*#__PURE__*/React.createElement(InlineExtension, {
|
|
@@ -52,7 +52,9 @@ const MultiBodiedExtensionWithWidth = ({
|
|
|
52
52
|
widthState,
|
|
53
53
|
editorAppearance,
|
|
54
54
|
showMacroInteractionDesignUpdates,
|
|
55
|
-
isNodeSelected
|
|
55
|
+
isNodeSelected,
|
|
56
|
+
isNodeHovered,
|
|
57
|
+
setIsNodeHovered
|
|
56
58
|
}) => {
|
|
57
59
|
const {
|
|
58
60
|
parameters,
|
|
@@ -114,16 +116,24 @@ const MultiBodiedExtensionWithWidth = ({
|
|
|
114
116
|
const navigationClassNames = classnames('multiBodiedExtension--navigation', {
|
|
115
117
|
'remove-margins': showMacroInteractionDesignUpdates
|
|
116
118
|
});
|
|
119
|
+
const handleMouseEvent = didHover => {
|
|
120
|
+
if (setIsNodeHovered) {
|
|
121
|
+
setIsNodeHovered(didHover);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
117
124
|
return jsx(Fragment, null, showMacroInteractionDesignUpdates && jsx(ExtensionLozenge, {
|
|
118
125
|
isNodeSelected: isNodeSelected,
|
|
119
126
|
node: node,
|
|
120
127
|
showMacroInteractionDesignUpdates: true,
|
|
121
|
-
customContainerStyles: mbeWrapperStyles
|
|
128
|
+
customContainerStyles: mbeWrapperStyles,
|
|
129
|
+
isNodeHovered: isNodeHovered
|
|
122
130
|
}), jsx("div", {
|
|
123
131
|
className: wrapperClassNames,
|
|
124
132
|
css: mbeExtensionWrapperCSS,
|
|
125
133
|
"data-testid": "multiBodiedExtension--wrapper",
|
|
126
|
-
style: mbeWrapperStyles
|
|
134
|
+
style: mbeWrapperStyles,
|
|
135
|
+
onMouseOver: () => handleMouseEvent(true),
|
|
136
|
+
onMouseLeave: () => handleMouseEvent(false)
|
|
127
137
|
}, getWrapperTitleContent(imageData, title, showMacroInteractionDesignUpdates), jsx("div", {
|
|
128
138
|
className: containerClassNames,
|
|
129
139
|
css: containerCssExtended,
|
|
@@ -90,17 +90,13 @@ const arrowKeysMap = {
|
|
|
90
90
|
ARROWUP: '\u2191',
|
|
91
91
|
ARROWDOWN: '\u2193'
|
|
92
92
|
};
|
|
93
|
-
const tooltipShortcutStyle = css
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
padding: 0 ${"var(--ds-space-025, 2px)"}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
label: tooltip-shortcut;
|
|
101
|
-
`;
|
|
102
|
-
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
103
|
-
|
|
93
|
+
const tooltipShortcutStyle = css({
|
|
94
|
+
borderRadius: '2px',
|
|
95
|
+
backgroundColor: `var(--ds-background-inverse-subtle, ${N400})`,
|
|
96
|
+
padding: `0 ${"var(--ds-space-025, 2px)"}`,
|
|
97
|
+
// NOTE: This might not actually do anything: https://atlassian.slack.com/archives/CFG3PSQ9E/p1647395052443259?thread_ts=1647394572.556029&cid=CFG3PSQ9E
|
|
98
|
+
label: 'tooltip-shortcut'
|
|
99
|
+
});
|
|
104
100
|
function formatShortcut(keymap) {
|
|
105
101
|
let shortcut;
|
|
106
102
|
if (browser.mac) {
|
|
@@ -7,6 +7,7 @@ export const INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY = '--editor-media-inline-image
|
|
|
7
7
|
export const INLINE_IMAGE_BORDER_COLOR_CSS_VAR_KEY = '--editor-media-inline-image-border-color';
|
|
8
8
|
|
|
9
9
|
// We implemented such selectors to ensure specificity:
|
|
10
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Nested and dynamic css calls are violations, needs manual remediation
|
|
10
11
|
const inlineImageHeight = (height, margin = 0) => css`
|
|
11
12
|
/* Editor style */
|
|
12
13
|
> .mediaInlineView-content-wrap > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
|
|
@@ -25,6 +26,7 @@ const inlineImageHeight = (height, margin = 0) => css`
|
|
|
25
26
|
* shift in top and bottom and size adjustments to make up for lack of 1to1 size
|
|
26
27
|
* mapping
|
|
27
28
|
*/
|
|
29
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Nested and dynamic css calls are violations, needs manual remediation
|
|
28
30
|
export const mediaInlineImageStyles = css`
|
|
29
31
|
// p, h3, and action items
|
|
30
32
|
.${INLINE_IMAGE_WRAPPER_CLASS_NAME} {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
2
2
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
3
|
-
const packageVersion = "78.11.
|
|
3
|
+
const packageVersion = "78.11.7";
|
|
4
4
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
5
5
|
// Remove URL as it has UGC
|
|
6
6
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -220,10 +220,6 @@ export class EditorPluginInjectionAPI {
|
|
|
220
220
|
}
|
|
221
221
|
const plugin = getPluginByName(prop);
|
|
222
222
|
if (!plugin) {
|
|
223
|
-
if (process.env.NODE_ENV === 'development') {
|
|
224
|
-
// eslint-disable-next-line
|
|
225
|
-
console.warn(`Plugin: ${prop} does not exist`);
|
|
226
|
-
}
|
|
227
223
|
return undefined;
|
|
228
224
|
}
|
|
229
225
|
const sharedState = sharedStateAPI.createAPI(plugin);
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { css, keyframes } from '@emotion/react';
|
|
2
|
-
const gapCursorBlink = keyframes
|
|
3
|
-
from, to {
|
|
4
|
-
opacity: 0
|
|
2
|
+
const gapCursorBlink = keyframes({
|
|
3
|
+
'from, to': {
|
|
4
|
+
opacity: 0
|
|
5
|
+
},
|
|
6
|
+
'50%': {
|
|
7
|
+
opacity: 1
|
|
5
8
|
}
|
|
6
|
-
|
|
7
|
-
opacity: 1;
|
|
8
|
-
}
|
|
9
|
-
`;
|
|
9
|
+
});
|
|
10
10
|
export const hideCaretModifier = 'ProseMirror-hide-gapcursor';
|
|
11
11
|
const gapCursor = '.ProseMirror-gapcursor';
|
|
12
12
|
const prosemirrorwidget = '.ProseMirror-widget';
|
|
13
13
|
const wrapLeft = '[layout="wrap-left"]';
|
|
14
14
|
const wrapRight = '[layout="wrap-right"]';
|
|
15
|
+
|
|
16
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- This needs manual remediation, it autofixes seemingly safely, but the code style and readability is destroyed.
|
|
15
17
|
export const gapCursorStyles = css`
|
|
16
18
|
/* =============== GAP CURSOR ================== */
|
|
17
19
|
.ProseMirror {
|
|
@@ -9,22 +9,23 @@ export const AnnotationSharedClassNames = {
|
|
|
9
9
|
const Y75a = 'rgba(255, 240, 179, 0.5)';
|
|
10
10
|
const Y200a = 'rgba(255, 196, 0, 0.82)';
|
|
11
11
|
export const AnnotationSharedCSSByState = () => ({
|
|
12
|
-
focus: css
|
|
12
|
+
focus: css({
|
|
13
13
|
// Background is not coming through in confluence, suspecting to be caused by some specific combination of
|
|
14
14
|
// emotion and token look up
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
border-bottom: 2px solid ${`var(--ds-border-accent-yellow, ${Y300})`};
|
|
15
|
+
background: `var(--ds-background-accent-yellow-subtler, ${Y75})`,
|
|
16
|
+
borderBottom: `2px solid ${`var(--ds-border-accent-yellow, ${Y300})`}`,
|
|
18
17
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-4147
|
|
19
|
-
|
|
20
|
-
cursor: pointer
|
|
21
|
-
|
|
22
|
-
blur: css
|
|
23
|
-
background:
|
|
24
|
-
|
|
25
|
-
cursor: pointer
|
|
26
|
-
|
|
18
|
+
boxShadow: `var(--ds-shadow-overlay, ${`1px 2px 3px ${N60A}, -1px 2px 3px ${N60A}`})`,
|
|
19
|
+
cursor: 'pointer'
|
|
20
|
+
}),
|
|
21
|
+
blur: css({
|
|
22
|
+
background: `var(--ds-background-accent-yellow-subtlest, ${Y75a})`,
|
|
23
|
+
borderBottom: `2px solid ${`var(--ds-border-accent-yellow, ${Y200a})`}`,
|
|
24
|
+
cursor: 'pointer'
|
|
25
|
+
})
|
|
27
26
|
});
|
|
27
|
+
|
|
28
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- `AnnotationSharedCSSByState()` is not safe in object syntax
|
|
28
29
|
export const annotationSharedStyles = () => css`
|
|
29
30
|
.ProseMirror {
|
|
30
31
|
.${AnnotationSharedClassNames.focus} {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/design-system/no-css-tagged-template-expression -- Perfectly safe to auto-fix, but leaving it up to the team to remediate as the readability only gets worse with autofixing */
|
|
1
2
|
import { css } from '@emotion/react';
|
|
2
3
|
export const blockMarksSharedStyles = css`
|
|
3
4
|
/**
|
|
@@ -1,38 +1,31 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { akEditorBlockquoteBorderColor, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
3
|
-
export const blockquoteSharedStyles = css
|
|
4
|
-
& blockquote {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
margin:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
&::
|
|
22
|
-
content: ''
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
& p {
|
|
30
|
-
display: block;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
& table,
|
|
34
|
-
& table:last-child {
|
|
35
|
-
display: inline-table;
|
|
3
|
+
export const blockquoteSharedStyles = css({
|
|
4
|
+
'& blockquote': {
|
|
5
|
+
boxSizing: 'border-box',
|
|
6
|
+
paddingLeft: "var(--ds-space-200, 16px)",
|
|
7
|
+
borderLeft: `2px solid ${`var(--ds-border, ${akEditorBlockquoteBorderColor})`}`,
|
|
8
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
9
|
+
margin: `${blockNodesVerticalMargin} 0 0 0`,
|
|
10
|
+
marginRight: 0,
|
|
11
|
+
"[dir='rtl'] &": {
|
|
12
|
+
paddingLeft: 0,
|
|
13
|
+
paddingRight: "var(--ds-space-200, 16px)"
|
|
14
|
+
},
|
|
15
|
+
'&:first-child': {
|
|
16
|
+
marginTop: 0
|
|
17
|
+
},
|
|
18
|
+
'&::before': {
|
|
19
|
+
content: "''"
|
|
20
|
+
},
|
|
21
|
+
'&::after': {
|
|
22
|
+
content: 'none'
|
|
23
|
+
},
|
|
24
|
+
'& p': {
|
|
25
|
+
display: 'block'
|
|
26
|
+
},
|
|
27
|
+
'& table, & table:last-child': {
|
|
28
|
+
display: 'inline-table'
|
|
36
29
|
}
|
|
37
30
|
}
|
|
38
|
-
|
|
31
|
+
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/design-system/no-css-tagged-template-expression -- Should be safe to autofix, but ignoring for now */
|
|
1
2
|
import { css } from '@emotion/react';
|
|
2
3
|
import { akEditorCodeFontFamily, akEditorLineHeight, akEditorTableCellMinWidth, blockNodesVerticalMargin, overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
3
4
|
import { N20, N30, N400, N800 } from '@atlaskit/theme/colors';
|
|
@@ -2,10 +2,10 @@ import { css } from '@emotion/react';
|
|
|
2
2
|
import { getCodeStyles } from '@atlaskit/code/inline';
|
|
3
3
|
import { N30A } from '@atlaskit/theme/colors';
|
|
4
4
|
export const codeMarkSharedStyles = () => {
|
|
5
|
-
return css
|
|
6
|
-
.code {
|
|
7
|
-
--ds--code--bg-color:
|
|
8
|
-
|
|
5
|
+
return css({
|
|
6
|
+
'.code': {
|
|
7
|
+
'--ds--code--bg-color': `var(--ds-background-neutral, ${N30A})`,
|
|
8
|
+
...getCodeStyles()
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
});
|
|
11
11
|
};
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { gridMediumMaxWidth } from '@atlaskit/editor-shared-styles';
|
|
3
|
-
const columnLayoutSharedStyle = css
|
|
4
|
-
[data-layout-section] {
|
|
5
|
-
position: relative
|
|
6
|
-
display: flex
|
|
7
|
-
|
|
8
|
-
& > * {
|
|
9
|
-
flex: 1
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
@media screen and (max-width: ${gridMediumMaxWidth}px) {
|
|
18
|
-
flex-direction: column;
|
|
3
|
+
const columnLayoutSharedStyle = css({
|
|
4
|
+
'[data-layout-section]': {
|
|
5
|
+
position: 'relative',
|
|
6
|
+
display: 'flex',
|
|
7
|
+
flexDirection: 'row',
|
|
8
|
+
'& > *': {
|
|
9
|
+
flex: 1,
|
|
10
|
+
minWidth: 0
|
|
11
|
+
},
|
|
12
|
+
'& > .unsupportedBlockView-content-wrap': {
|
|
13
|
+
minWidth: 'initial'
|
|
14
|
+
},
|
|
15
|
+
[`@media screen and (max-width: ${gridMediumMaxWidth}px)`]: {
|
|
16
|
+
flexDirection: 'column'
|
|
19
17
|
}
|
|
20
18
|
}
|
|
21
|
-
|
|
19
|
+
});
|
|
22
20
|
export { columnLayoutSharedStyle };
|
|
@@ -3,8 +3,8 @@ export const DateSharedCssClassName = {
|
|
|
3
3
|
DATE_WRAPPER: `date-lozenger-container`,
|
|
4
4
|
DATE_CONTAINER: 'dateView-content-wrap'
|
|
5
5
|
};
|
|
6
|
-
export const dateSharedStyle = css
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export const dateSharedStyle = css({
|
|
7
|
+
[`.${DateSharedCssClassName.DATE_WRAPPER} span`]: {
|
|
8
|
+
whiteSpace: 'unset'
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
});
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
`;
|
|
2
|
+
export const expandIconWrapperStyle = css({
|
|
3
|
+
marginLeft: "var(--ds-space-negative-100, -8px)"
|
|
4
|
+
});
|
|
6
5
|
const prefix = 'ak-editor-expand';
|
|
7
6
|
export const expandClassNames = {
|
|
8
7
|
prefix,
|