@atlaskit/renderer 103.0.0 → 103.0.2
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 +27 -0
- package/dist/cjs/consts.js +2 -2
- package/dist/cjs/messages.js +1 -1
- package/dist/cjs/react/nodes/panel.js +19 -10
- package/dist/cjs/react/nodes/tableCell.js +8 -26
- package/dist/cjs/ui/ExtensionRenderer.js +9 -2
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/cjs/ui/Renderer/style.js +5 -3
- package/dist/cjs/ui/SortingIcon.js +55 -28
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/consts.js +2 -2
- package/dist/es2019/messages.js +1 -1
- package/dist/es2019/react/nodes/panel.js +16 -6
- package/dist/es2019/react/nodes/tableCell.js +8 -27
- package/dist/es2019/ui/ExtensionRenderer.js +7 -2
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/es2019/ui/Renderer/style.js +308 -287
- package/dist/es2019/ui/SortingIcon.js +89 -32
- package/dist/es2019/version.json +1 -1
- package/dist/esm/consts.js +2 -2
- package/dist/esm/messages.js +1 -1
- package/dist/esm/react/nodes/panel.js +18 -10
- package/dist/esm/react/nodes/tableCell.js +8 -26
- package/dist/esm/ui/ExtensionRenderer.js +9 -2
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/esm/ui/Renderer/style.js +5 -4
- package/dist/esm/ui/SortingIcon.js +55 -27
- package/dist/esm/version.json +1 -1
- package/dist/types/consts.d.ts +2 -2
- package/dist/types/react/nodes/bodiedExtension.d.ts +2 -1
- package/dist/types/react/nodes/extension.d.ts +2 -1
- package/dist/types/react/nodes/inlineExtension.d.ts +2 -0
- package/dist/types/ui/ExtensionRenderer.d.ts +2 -0
- package/dist/types/ui/SortingIcon.d.ts +4 -1
- package/package.json +19 -23
- package/report.api.md +359 -255
- package/dist/types-ts4.0/actions/index.d.ts +0 -61
- package/dist/types-ts4.0/actions/matches-utils.d.ts +0 -7
- package/dist/types-ts4.0/actions.d.ts +0 -3
- package/dist/types-ts4.0/analytics/analyticsContext.d.ts +0 -6
- package/dist/types-ts4.0/analytics/enums.d.ts +0 -56
- package/dist/types-ts4.0/analytics/events.d.ts +0 -110
- package/dist/types-ts4.0/analytics/unsupported-content.d.ts +0 -10
- package/dist/types-ts4.0/consts.d.ts +0 -12
- package/dist/types-ts4.0/i18n/cs.d.ts +0 -20
- package/dist/types-ts4.0/i18n/da.d.ts +0 -20
- package/dist/types-ts4.0/i18n/de.d.ts +0 -20
- package/dist/types-ts4.0/i18n/en.d.ts +0 -20
- package/dist/types-ts4.0/i18n/en_GB.d.ts +0 -20
- package/dist/types-ts4.0/i18n/en_ZZ.d.ts +0 -20
- package/dist/types-ts4.0/i18n/es.d.ts +0 -20
- package/dist/types-ts4.0/i18n/et.d.ts +0 -8
- package/dist/types-ts4.0/i18n/fi.d.ts +0 -20
- package/dist/types-ts4.0/i18n/fr.d.ts +0 -20
- package/dist/types-ts4.0/i18n/hu.d.ts +0 -20
- package/dist/types-ts4.0/i18n/index.d.ts +0 -31
- package/dist/types-ts4.0/i18n/it.d.ts +0 -20
- package/dist/types-ts4.0/i18n/ja.d.ts +0 -20
- package/dist/types-ts4.0/i18n/ko.d.ts +0 -20
- package/dist/types-ts4.0/i18n/nb.d.ts +0 -20
- package/dist/types-ts4.0/i18n/nl.d.ts +0 -20
- package/dist/types-ts4.0/i18n/pl.d.ts +0 -20
- package/dist/types-ts4.0/i18n/pt_BR.d.ts +0 -20
- package/dist/types-ts4.0/i18n/pt_PT.d.ts +0 -8
- package/dist/types-ts4.0/i18n/ru.d.ts +0 -20
- package/dist/types-ts4.0/i18n/sk.d.ts +0 -8
- package/dist/types-ts4.0/i18n/sv.d.ts +0 -20
- package/dist/types-ts4.0/i18n/th.d.ts +0 -20
- package/dist/types-ts4.0/i18n/tr.d.ts +0 -20
- package/dist/types-ts4.0/i18n/uk.d.ts +0 -20
- package/dist/types-ts4.0/i18n/vi.d.ts +0 -20
- package/dist/types-ts4.0/i18n/zh.d.ts +0 -20
- package/dist/types-ts4.0/i18n/zh_TW.d.ts +0 -20
- package/dist/types-ts4.0/index.d.ts +0 -11
- package/dist/types-ts4.0/messages.d.ts +0 -61
- package/dist/types-ts4.0/react/hooks/use-bidi-warnings.d.ts +0 -10
- package/dist/types-ts4.0/react/hooks/use-in-viewport.d.ts +0 -5
- package/dist/types-ts4.0/react/hooks/use-observed-width.d.ts +0 -3
- package/dist/types-ts4.0/react/index.d.ts +0 -118
- package/dist/types-ts4.0/react/marks/alignment.d.ts +0 -4
- package/dist/types-ts4.0/react/marks/annotation.d.ts +0 -6
- package/dist/types-ts4.0/react/marks/breakout.d.ts +0 -6
- package/dist/types-ts4.0/react/marks/code.d.ts +0 -16
- package/dist/types-ts4.0/react/marks/confluence-inline-comment.d.ts +0 -8
- package/dist/types-ts4.0/react/marks/data-consumer.d.ts +0 -4
- package/dist/types-ts4.0/react/marks/em.d.ts +0 -3
- package/dist/types-ts4.0/react/marks/fragment.d.ts +0 -4
- package/dist/types-ts4.0/react/marks/indentation.d.ts +0 -4
- package/dist/types-ts4.0/react/marks/index.d.ts +0 -21
- package/dist/types-ts4.0/react/marks/link.d.ts +0 -9
- package/dist/types-ts4.0/react/marks/strike.d.ts +0 -3
- package/dist/types-ts4.0/react/marks/strong.d.ts +0 -3
- package/dist/types-ts4.0/react/marks/subsup.d.ts +0 -4
- package/dist/types-ts4.0/react/marks/textColor.d.ts +0 -4
- package/dist/types-ts4.0/react/marks/underline.d.ts +0 -3
- package/dist/types-ts4.0/react/marks/unsupportedMark.d.ts +0 -3
- package/dist/types-ts4.0/react/marks/unsupportedNodeAttribute.d.ts +0 -3
- package/dist/types-ts4.0/react/nodes/blockCard.d.ts +0 -10
- package/dist/types-ts4.0/react/nodes/blockquote.d.ts +0 -2
- package/dist/types-ts4.0/react/nodes/bodiedExtension.d.ts +0 -23
- package/dist/types-ts4.0/react/nodes/bulletList.d.ts +0 -5
- package/dist/types-ts4.0/react/nodes/caption.d.ts +0 -4
- package/dist/types-ts4.0/react/nodes/codeBlock/codeBlock.d.ts +0 -14
- package/dist/types-ts4.0/react/nodes/codeBlock/components/codeBlockContainer.d.ts +0 -12
- package/dist/types-ts4.0/react/nodes/codeBlock/components/lightWeightCodeBlock.d.ts +0 -9
- package/dist/types-ts4.0/react/nodes/codeBlock/windowedCodeBlock.d.ts +0 -4
- package/dist/types-ts4.0/react/nodes/codeBlockCopyButton.d.ts +0 -9
- package/dist/types-ts4.0/react/nodes/date.d.ts +0 -11
- package/dist/types-ts4.0/react/nodes/decisionItem.d.ts +0 -3
- package/dist/types-ts4.0/react/nodes/decisionList.d.ts +0 -7
- package/dist/types-ts4.0/react/nodes/doc.d.ts +0 -3
- package/dist/types-ts4.0/react/nodes/embedCard.d.ts +0 -17
- package/dist/types-ts4.0/react/nodes/emoji.d.ts +0 -10
- package/dist/types-ts4.0/react/nodes/extension.d.ts +0 -112
- package/dist/types-ts4.0/react/nodes/fallback.d.ts +0 -16
- package/dist/types-ts4.0/react/nodes/hardBreak.d.ts +0 -6
- package/dist/types-ts4.0/react/nodes/heading-anchor.d.ts +0 -14
- package/dist/types-ts4.0/react/nodes/heading.d.ts +0 -14
- package/dist/types-ts4.0/react/nodes/index.d.ts +0 -94
- package/dist/types-ts4.0/react/nodes/inline.d.ts +0 -1
- package/dist/types-ts4.0/react/nodes/inlineCard.d.ts +0 -65
- package/dist/types-ts4.0/react/nodes/inlineExtension.d.ts +0 -16
- package/dist/types-ts4.0/react/nodes/layoutColumn.d.ts +0 -6
- package/dist/types-ts4.0/react/nodes/layoutSection.d.ts +0 -2
- package/dist/types-ts4.0/react/nodes/listItem.d.ts +0 -2
- package/dist/types-ts4.0/react/nodes/media.d.ts +0 -27
- package/dist/types-ts4.0/react/nodes/mediaGroup.d.ts +0 -29
- package/dist/types-ts4.0/react/nodes/mediaInline.d.ts +0 -20
- package/dist/types-ts4.0/react/nodes/mediaSingle/index.d.ts +0 -23
- package/dist/types-ts4.0/react/nodes/mediaSingle/styles.d.ts +0 -2
- package/dist/types-ts4.0/react/nodes/mention.d.ts +0 -13
- package/dist/types-ts4.0/react/nodes/orderedList.d.ts +0 -6
- package/dist/types-ts4.0/react/nodes/panel.d.ts +0 -17
- package/dist/types-ts4.0/react/nodes/paragraph.d.ts +0 -3
- package/dist/types-ts4.0/react/nodes/placeholder.d.ts +0 -6
- package/dist/types-ts4.0/react/nodes/rule.d.ts +0 -2
- package/dist/types-ts4.0/react/nodes/status.d.ts +0 -10
- package/dist/types-ts4.0/react/nodes/table/colgroup.d.ts +0 -3
- package/dist/types-ts4.0/react/nodes/table/sticky.d.ts +0 -38
- package/dist/types-ts4.0/react/nodes/table/table.d.ts +0 -7
- package/dist/types-ts4.0/react/nodes/table/types.d.ts +0 -7
- package/dist/types-ts4.0/react/nodes/table.d.ts +0 -269
- package/dist/types-ts4.0/react/nodes/tableCell.d.ts +0 -81
- package/dist/types-ts4.0/react/nodes/tableRow.d.ts +0 -24
- package/dist/types-ts4.0/react/nodes/task-item-with-providers.d.ts +0 -29
- package/dist/types-ts4.0/react/nodes/taskItem.d.ts +0 -19
- package/dist/types-ts4.0/react/nodes/taskList.d.ts +0 -8
- package/dist/types-ts4.0/react/nodes/text-wrapper.d.ts +0 -8
- package/dist/types-ts4.0/react/nodes/unknownBlock.d.ts +0 -2
- package/dist/types-ts4.0/react/renderer-node.d.ts +0 -4
- package/dist/types-ts4.0/react/types.d.ts +0 -57
- package/dist/types-ts4.0/react/utils/clipboard.d.ts +0 -1
- package/dist/types-ts4.0/react/utils/element-selection.d.ts +0 -9
- package/dist/types-ts4.0/react/utils/getCardClickHandler.d.ts +0 -2
- package/dist/types-ts4.0/react/utils/inject-props.d.ts +0 -6
- package/dist/types-ts4.0/react/utils/links.d.ts +0 -3
- package/dist/types-ts4.0/react/utils/lists.d.ts +0 -2
- package/dist/types-ts4.0/react/utils/performance/RenderTracking.d.ts +0 -15
- package/dist/types-ts4.0/react/utils/use-select-all-trap.d.ts +0 -2
- package/dist/types-ts4.0/render-document.d.ts +0 -23
- package/dist/types-ts4.0/renderer-context.d.ts +0 -9
- package/dist/types-ts4.0/serializer.d.ts +0 -4
- package/dist/types-ts4.0/steps/index.d.ts +0 -14
- package/dist/types-ts4.0/text/index.d.ts +0 -8
- package/dist/types-ts4.0/text/nodes/blockquote.d.ts +0 -3
- package/dist/types-ts4.0/text/nodes/bulletList.d.ts +0 -3
- package/dist/types-ts4.0/text/nodes/date.d.ts +0 -3
- package/dist/types-ts4.0/text/nodes/decisionItem.d.ts +0 -3
- package/dist/types-ts4.0/text/nodes/hardBreak.d.ts +0 -3
- package/dist/types-ts4.0/text/nodes/heading.d.ts +0 -3
- package/dist/types-ts4.0/text/nodes/index.d.ts +0 -6
- package/dist/types-ts4.0/text/nodes/inlineCard.d.ts +0 -3
- package/dist/types-ts4.0/text/nodes/listItem.d.ts +0 -3
- package/dist/types-ts4.0/text/nodes/mediaGroup.d.ts +0 -3
- package/dist/types-ts4.0/text/nodes/mention.d.ts +0 -3
- package/dist/types-ts4.0/text/nodes/orderedList.d.ts +0 -3
- package/dist/types-ts4.0/text/nodes/panel.d.ts +0 -3
- package/dist/types-ts4.0/text/nodes/paragraph.d.ts +0 -3
- package/dist/types-ts4.0/text/nodes/rule.d.ts +0 -3
- package/dist/types-ts4.0/text/nodes/status.d.ts +0 -3
- package/dist/types-ts4.0/text/nodes/table.d.ts +0 -3
- package/dist/types-ts4.0/text/nodes/taskItem.d.ts +0 -3
- package/dist/types-ts4.0/text/nodes/unknown.d.ts +0 -3
- package/dist/types-ts4.0/text-serializer.d.ts +0 -1
- package/dist/types-ts4.0/types/i18n.d.ts +0 -5
- package/dist/types-ts4.0/types/mediaOptions.d.ts +0 -12
- package/dist/types-ts4.0/types/smartLinksOptions.d.ts +0 -3
- package/dist/types-ts4.0/ui/Expand.d.ts +0 -21
- package/dist/types-ts4.0/ui/ExtensionRenderer.d.ts +0 -40
- package/dist/types-ts4.0/ui/MediaCard.d.ts +0 -77
- package/dist/types-ts4.0/ui/Renderer/ErrorBoundary.d.ts +0 -24
- package/dist/types-ts4.0/ui/Renderer/breakout-ssr.d.ts +0 -11
- package/dist/types-ts4.0/ui/Renderer/click-to-edit.d.ts +0 -6
- package/dist/types-ts4.0/ui/Renderer/index.d.ts +0 -33
- package/dist/types-ts4.0/ui/Renderer/style.d.ts +0 -14
- package/dist/types-ts4.0/ui/Renderer/truncated-wrapper.d.ts +0 -12
- package/dist/types-ts4.0/ui/Renderer/types.d.ts +0 -16
- package/dist/types-ts4.0/ui/RendererActionsContext/WithRendererActions.d.ts +0 -6
- package/dist/types-ts4.0/ui/RendererActionsContext/index.d.ts +0 -9
- package/dist/types-ts4.0/ui/SmartCardStorage.d.ts +0 -60
- package/dist/types-ts4.0/ui/SortingIcon.d.ts +0 -20
- package/dist/types-ts4.0/ui/TaskItemsFormatContext/TaskItemsFormatContext.d.ts +0 -15
- package/dist/types-ts4.0/ui/TaskItemsFormatContext/index.d.ts +0 -2
- package/dist/types-ts4.0/ui/active-header-id-provider.d.ts +0 -18
- package/dist/types-ts4.0/ui/annotations/context.d.ts +0 -27
- package/dist/types-ts4.0/ui/annotations/draft/component.d.ts +0 -20
- package/dist/types-ts4.0/ui/annotations/draft/dom.d.ts +0 -7
- package/dist/types-ts4.0/ui/annotations/draft/index.d.ts +0 -2
- package/dist/types-ts4.0/ui/annotations/draft/position.d.ts +0 -2
- package/dist/types-ts4.0/ui/annotations/draft/text.d.ts +0 -11
- package/dist/types-ts4.0/ui/annotations/element/index.d.ts +0 -10
- package/dist/types-ts4.0/ui/annotations/element/mark.d.ts +0 -14
- package/dist/types-ts4.0/ui/annotations/hooks/index.d.ts +0 -3
- package/dist/types-ts4.0/ui/annotations/hooks/use-events.d.ts +0 -18
- package/dist/types-ts4.0/ui/annotations/hooks/use-inline-comment-subscriber.d.ts +0 -1
- package/dist/types-ts4.0/ui/annotations/hooks/use-inline-comments-filter.d.ts +0 -9
- package/dist/types-ts4.0/ui/annotations/hooks/use-load-annotations.d.ts +0 -6
- package/dist/types-ts4.0/ui/annotations/hooks/user-selection.d.ts +0 -9
- package/dist/types-ts4.0/ui/annotations/hooks/utils.d.ts +0 -2
- package/dist/types-ts4.0/ui/annotations/index.d.ts +0 -5
- package/dist/types-ts4.0/ui/annotations/selection/index.d.ts +0 -1
- package/dist/types-ts4.0/ui/annotations/selection/mounter.d.ts +0 -20
- package/dist/types-ts4.0/ui/annotations/selection/range-validator.d.ts +0 -13
- package/dist/types-ts4.0/ui/annotations/selection/wrapper.d.ts +0 -8
- package/dist/types-ts4.0/ui/annotations/types.d.ts +0 -22
- package/dist/types-ts4.0/ui/annotations/view/index.d.ts +0 -7
- package/dist/types-ts4.0/ui/index.d.ts +0 -1
- package/dist/types-ts4.0/ui/renderer-props.d.ts +0 -100
- package/dist/types-ts4.0/use-feature-flags.d.ts +0 -2
- package/dist/types-ts4.0/utils.d.ts +0 -24
|
@@ -6,14 +6,9 @@ import { N20, N30 } from '@atlaskit/theme/colors';
|
|
|
6
6
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
7
7
|
import { sortingIconMessages } from '../messages';
|
|
8
8
|
import { injectIntl } from 'react-intl-next';
|
|
9
|
-
import { token } from '@atlaskit/tokens';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
// TODO: Quality ticket: https://product-fabric.atlassian.net/browse/DSP-4136
|
|
13
|
-
|
|
14
|
-
export const TableSortIconDataUrl = `data:image/svg+xml;utf8,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="M-8-6h24v24H-8z"></path><path d="M3 8.509V1c0-.552.449-1 1-1 .552 0 1 .448 1 1V8.51l1.217-1.206a1.05 1.05 0 011.477 0 1.03 1.03 0 01.004 1.463l-.003.002-2.956 2.93a1.053 1.053 0 01-1.478 0L.305 8.767a1.03 1.03 0 01.001-1.464 1.05 1.05 0 011.477 0L3 8.508z" fill="#42526E"></path></g></svg>`)}`;
|
|
15
|
-
const TABLE_SORTING_ICON_CLASS = 'table-sorting-icon';
|
|
16
|
-
export let StatusClassNames; // TODO: get design to check border
|
|
9
|
+
import { token } from '@atlaskit/tokens';
|
|
10
|
+
import { RendererCssClassName } from '../consts';
|
|
11
|
+
export let StatusClassNames;
|
|
17
12
|
|
|
18
13
|
(function (StatusClassNames) {
|
|
19
14
|
StatusClassNames["ASC"] = "sorting-icon-svg__asc";
|
|
@@ -22,7 +17,7 @@ export let StatusClassNames; // TODO: get design to check border
|
|
|
22
17
|
StatusClassNames["SORTING_NOT_ALLOWED"] = "sorting-icon-svg__not-allowed";
|
|
23
18
|
})(StatusClassNames || (StatusClassNames = {}));
|
|
24
19
|
|
|
25
|
-
const
|
|
20
|
+
const buttonStyles = css`
|
|
26
21
|
position: absolute;
|
|
27
22
|
display: flex;
|
|
28
23
|
height: 28px;
|
|
@@ -30,50 +25,90 @@ const wrapperStyles = css`
|
|
|
30
25
|
margin: 6px;
|
|
31
26
|
right: 0;
|
|
32
27
|
top: 0;
|
|
33
|
-
border: 2px solid ${token('color.border
|
|
28
|
+
border: 2px solid ${token('color.border', '#fff')};
|
|
34
29
|
border-radius: ${gridSize() / 2}px;
|
|
35
|
-
background-color: ${token('
|
|
30
|
+
background-color: ${token('elevation.surface.overlay', N20)};
|
|
36
31
|
justify-content: center;
|
|
37
32
|
align-items: center;
|
|
33
|
+
cursor: pointer;
|
|
38
34
|
|
|
39
35
|
&:hover {
|
|
40
|
-
background-color: ${token('
|
|
36
|
+
background-color: ${token('elevation.surface.overlay.hovered', N30)};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&:active {
|
|
40
|
+
background-color: ${token('elevation.surface.overlay.pressed', 'rgba(179, 212, 255, 0.6)')};
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
&.${
|
|
43
|
+
&.${RendererCssClassName.SORTABLE_COLUMN_ICON}__not-allowed {
|
|
44
44
|
cursor: not-allowed;
|
|
45
45
|
}
|
|
46
46
|
`;
|
|
47
|
-
const
|
|
47
|
+
const iconWrapperStyles = css`
|
|
48
48
|
width: 8px;
|
|
49
49
|
height: 12px;
|
|
50
50
|
transition: transform 0.3s cubic-bezier(0.15, 1, 0.3, 1);
|
|
51
51
|
transform-origin: 50% 50%;
|
|
52
|
-
|
|
52
|
+
display: flex;
|
|
53
|
+
justify-content: center;
|
|
53
54
|
|
|
54
55
|
&.${StatusClassNames.DESC} {
|
|
55
56
|
transform: rotate(-180deg);
|
|
56
57
|
}
|
|
57
58
|
|
|
58
|
-
&.${
|
|
59
|
+
&.${RendererCssClassName.SORTABLE_COLUMN_ICON}-inactive {
|
|
59
60
|
opacity: 0.7;
|
|
60
61
|
}
|
|
62
|
+
`; // The icon is created with CSS due to the following Firefox issue: https://product-fabric.atlassian.net/browse/ED-8001
|
|
63
|
+
// The TL;DR is that svg's in tables mess up how HTML is copied in Firefox. Using a styled div instead solves the problem.
|
|
64
|
+
// For this reason, svg's should be avoided in tables until this issue is fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=1664350
|
|
65
|
+
|
|
66
|
+
const iconStyles = css`
|
|
67
|
+
height: 100%;
|
|
68
|
+
width: 2px;
|
|
69
|
+
border-radius: 50px;
|
|
70
|
+
background: ${token('color.icon', '#42526E')};
|
|
71
|
+
|
|
72
|
+
&::before,
|
|
73
|
+
&::after {
|
|
74
|
+
background: ${token('color.icon', '#42526E')};
|
|
75
|
+
content: '';
|
|
76
|
+
height: 2px;
|
|
77
|
+
width: 6px;
|
|
78
|
+
position: absolute;
|
|
79
|
+
border-radius: 50px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&::before {
|
|
83
|
+
transform: rotate(45deg) translate(3.4px, 8.5px);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&::after {
|
|
87
|
+
transform: rotate(-45deg) translate(-6.3px, 5.7px);
|
|
88
|
+
}
|
|
61
89
|
`;
|
|
62
90
|
|
|
63
|
-
const
|
|
64
|
-
|
|
91
|
+
const getIconClassName = (isSortingAllowed, sortOrdered) => {
|
|
92
|
+
const activated = sortOrdered !== SortOrder.NO_ORDER;
|
|
93
|
+
const activeStatusClass = `${RendererCssClassName.SORTABLE_COLUMN_ICON}-${activated ? 'active' : 'inactive'}`;
|
|
94
|
+
|
|
95
|
+
if (!isSortingAllowed) {
|
|
96
|
+
return `${StatusClassNames.SORTING_NOT_ALLOWED} ${activeStatusClass}`;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
switch (sortOrdered) {
|
|
65
100
|
case SortOrder.ASC:
|
|
66
|
-
return StatusClassNames.ASC
|
|
101
|
+
return `${StatusClassNames.ASC} ${activeStatusClass}`;
|
|
67
102
|
|
|
68
103
|
case SortOrder.DESC:
|
|
69
|
-
return StatusClassNames.DESC
|
|
104
|
+
return `${StatusClassNames.DESC} ${activeStatusClass}`;
|
|
70
105
|
|
|
71
106
|
default:
|
|
72
|
-
return StatusClassNames.NO_ORDER
|
|
107
|
+
return `${StatusClassNames.NO_ORDER} ${activeStatusClass}`;
|
|
73
108
|
}
|
|
74
109
|
};
|
|
75
110
|
|
|
76
|
-
const getTooltipTitle = (intl, isSortingAllowed,
|
|
111
|
+
const getTooltipTitle = (intl, isSortingAllowed, sortOrdered) => {
|
|
77
112
|
const {
|
|
78
113
|
noOrderLabel,
|
|
79
114
|
ascOrderLabel,
|
|
@@ -85,7 +120,7 @@ const getTooltipTitle = (intl, isSortingAllowed, status) => {
|
|
|
85
120
|
return intl.formatMessage(invalidLabel);
|
|
86
121
|
}
|
|
87
122
|
|
|
88
|
-
switch (
|
|
123
|
+
switch (sortOrdered) {
|
|
89
124
|
case SortOrder.NO_ORDER:
|
|
90
125
|
return intl.formatMessage(noOrderLabel);
|
|
91
126
|
|
|
@@ -102,22 +137,44 @@ const getTooltipTitle = (intl, isSortingAllowed, status) => {
|
|
|
102
137
|
const SortingIcon = ({
|
|
103
138
|
isSortingAllowed,
|
|
104
139
|
sortOrdered,
|
|
105
|
-
intl
|
|
140
|
+
intl,
|
|
141
|
+
onClick,
|
|
142
|
+
onKeyDown
|
|
106
143
|
}) => {
|
|
107
|
-
const
|
|
108
|
-
const wrapperClassName = !isSortingAllowed ? StatusClassNames.SORTING_NOT_ALLOWED : '';
|
|
144
|
+
const buttonClassName = `${RendererCssClassName.SORTABLE_COLUMN_ICON}${isSortingAllowed ? '' : ` ${RendererCssClassName.SORTABLE_COLUMN_ICON}__not-allowed`}`;
|
|
109
145
|
const content = getTooltipTitle(intl, isSortingAllowed, sortOrdered);
|
|
146
|
+
|
|
147
|
+
const handleClick = () => {
|
|
148
|
+
if (isSortingAllowed) {
|
|
149
|
+
onClick();
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const handleKeyDown = event => {
|
|
154
|
+
if (isSortingAllowed) {
|
|
155
|
+
onKeyDown(event);
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
|
|
110
159
|
return jsx(Tooltip, {
|
|
111
160
|
delay: 0,
|
|
112
161
|
content: content,
|
|
113
162
|
position: "top"
|
|
114
|
-
}, jsx("figure", {
|
|
115
|
-
css: wrapperStyles,
|
|
116
|
-
className: wrapperClassName
|
|
117
163
|
}, jsx("div", {
|
|
118
|
-
css:
|
|
119
|
-
className:
|
|
120
|
-
|
|
164
|
+
css: buttonStyles,
|
|
165
|
+
className: buttonClassName,
|
|
166
|
+
role: "button",
|
|
167
|
+
tabIndex: isSortingAllowed ? 0 : -1,
|
|
168
|
+
"aria-label": "sort column",
|
|
169
|
+
"aria-disabled": !isSortingAllowed,
|
|
170
|
+
onClick: handleClick,
|
|
171
|
+
onKeyDown: handleKeyDown
|
|
172
|
+
}, jsx("div", {
|
|
173
|
+
css: iconWrapperStyles,
|
|
174
|
+
className: getIconClassName(isSortingAllowed, sortOrdered)
|
|
175
|
+
}, jsx("div", {
|
|
176
|
+
css: iconStyles
|
|
177
|
+
}))));
|
|
121
178
|
};
|
|
122
179
|
|
|
123
180
|
export default injectIntl(SortingIcon);
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/consts.js
CHANGED
|
@@ -5,9 +5,9 @@ export var RendererCssClassName = {
|
|
|
5
5
|
EXTENSION_CENTER_ALIGN: "".concat(clPrefix, "extension-center-align"),
|
|
6
6
|
EXTENSION_OVERFLOW_CONTAINER: "".concat(clPrefix, "extension-overflow-container"),
|
|
7
7
|
NUMBER_COLUMN: "".concat(clPrefix, "table-number-column"),
|
|
8
|
+
SORTABLE_COLUMN_WRAPPER: "".concat(clPrefix, "tableHeader-sortable-column__wrapper"),
|
|
8
9
|
SORTABLE_COLUMN: "".concat(clPrefix, "tableHeader-sortable-column"),
|
|
9
|
-
|
|
10
|
-
SORTABLE_COLUMN_NOT_ALLOWED: "".concat(clPrefix, "tableHeader-sortable-column__not-allowed"),
|
|
10
|
+
SORTABLE_COLUMN_ICON_WRAPPER: "".concat(clPrefix, "tableHeader-sorting-icon__wrapper"),
|
|
11
11
|
SORTABLE_COLUMN_ICON: "".concat(clPrefix, "tableHeader-sorting-icon"),
|
|
12
12
|
SORTABLE_COLUMN_NO_ORDER: "".concat(clPrefix, "tableHeader-sorting-icon__no-order")
|
|
13
13
|
};
|
package/dist/esm/messages.js
CHANGED
|
@@ -56,7 +56,7 @@ export var sortingIconMessages = defineMessages({
|
|
|
56
56
|
},
|
|
57
57
|
invalidLabel: {
|
|
58
58
|
id: 'fabric.editor.headingLink.invalidLabel',
|
|
59
|
-
defaultMessage: "\u26A0\uFE0F You can't sort a table with merged
|
|
59
|
+
defaultMessage: "\u26A0\uFE0F You can't sort a table with merged cells",
|
|
60
60
|
description: 'this sort is invalid for merged cells'
|
|
61
61
|
}
|
|
62
62
|
});
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
4
|
|
|
4
5
|
var _templateObject, _templateObject2;
|
|
5
6
|
|
|
7
|
+
var _excluded = ["backgroundColor", "hasIcon"];
|
|
8
|
+
|
|
6
9
|
/** @jsx jsx */
|
|
7
10
|
import React from 'react';
|
|
8
11
|
import { css, jsx } from '@emotion/react';
|
|
@@ -16,24 +19,28 @@ import EmojiItem from './emoji'; // AFP-2532 TODO: Fix automatic suppressions be
|
|
|
16
19
|
import { themed } from '@atlaskit/theme';
|
|
17
20
|
import { PanelInfoIcon, PanelSuccessIcon, PanelNoteIcon, PanelWarningIcon, PanelErrorIcon } from '@atlaskit/editor-common/icons';
|
|
18
21
|
|
|
19
|
-
var PanelStyled = function PanelStyled(
|
|
22
|
+
var PanelStyled = function PanelStyled(_ref) {
|
|
23
|
+
var backgroundColor = _ref.backgroundColor,
|
|
24
|
+
hasIcon = _ref.hasIcon,
|
|
25
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
26
|
+
|
|
20
27
|
var styles = function styles(theme) {
|
|
21
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.", " {\n ", "\n }\n "])), PanelSharedCssClassName.prefix, panelSharedStylesWithoutPrefix({
|
|
28
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.", " {\n ", "\n\n &[data-panel-type=", "] {\n ", "\n }\n }\n "])), PanelSharedCssClassName.prefix, panelSharedStylesWithoutPrefix({
|
|
22
29
|
theme: theme
|
|
23
|
-
}));
|
|
30
|
+
}), PanelType.CUSTOM, hasIcon ? '' : 'padding: 12px;');
|
|
24
31
|
};
|
|
25
32
|
|
|
26
|
-
if (props['data-panel-type'] === PanelType.CUSTOM &&
|
|
33
|
+
if (props['data-panel-type'] === PanelType.CUSTOM && backgroundColor) {
|
|
27
34
|
styles = function styles(theme) {
|
|
28
35
|
var customStyle = themed({
|
|
29
36
|
dark: getPanelBackgroundDarkModeColors,
|
|
30
|
-
light: "background-color: ".concat(
|
|
37
|
+
light: "background-color: ".concat(backgroundColor, ";")
|
|
31
38
|
})({
|
|
32
39
|
theme: theme
|
|
33
40
|
});
|
|
34
|
-
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &.", " {\n ", "\n }\n\n &[data-panel-type=", "] {\n ", ";\n }\n "])), PanelSharedCssClassName.prefix, panelSharedStylesWithoutPrefix({
|
|
41
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &.", " {\n ", "\n }\n\n &[data-panel-type=", "] {\n ", ";\n ", "\n }\n "])), PanelSharedCssClassName.prefix, panelSharedStylesWithoutPrefix({
|
|
35
42
|
theme: theme
|
|
36
|
-
}), PanelType.CUSTOM, customStyle);
|
|
43
|
+
}), PanelType.CUSTOM, customStyle, hasIcon ? '' : 'padding: 12px;');
|
|
37
44
|
};
|
|
38
45
|
}
|
|
39
46
|
|
|
@@ -86,9 +93,9 @@ var Panel = function Panel(props) {
|
|
|
86
93
|
});
|
|
87
94
|
};
|
|
88
95
|
|
|
89
|
-
var
|
|
90
|
-
var icon = getIcon();
|
|
96
|
+
var icon = getIcon();
|
|
91
97
|
|
|
98
|
+
var renderIcon = function renderIcon() {
|
|
92
99
|
if (icon) {
|
|
93
100
|
return jsx("div", {
|
|
94
101
|
className: PanelSharedCssClassName.icon
|
|
@@ -103,7 +110,8 @@ var Panel = function Panel(props) {
|
|
|
103
110
|
"data-panel-icon": panelIcon,
|
|
104
111
|
"data-panel-icon-id": panelIconId,
|
|
105
112
|
"data-panel-icon-text": panelIconText,
|
|
106
|
-
backgroundColor: panelColor
|
|
113
|
+
backgroundColor: panelColor,
|
|
114
|
+
hasIcon: Boolean(icon)
|
|
107
115
|
}, renderIcon(), jsx("div", {
|
|
108
116
|
className: PanelSharedCssClassName.content
|
|
109
117
|
}, children));
|
|
@@ -152,19 +152,11 @@ export var withSortableColumn = function withSortableColumn(WrapperComponent) {
|
|
|
152
152
|
if (keys.includes(event.key) && !IgnoreSorting.includes(tagName)) {
|
|
153
153
|
event.preventDefault();
|
|
154
154
|
|
|
155
|
-
_this.
|
|
155
|
+
_this.sort();
|
|
156
156
|
}
|
|
157
157
|
});
|
|
158
158
|
|
|
159
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
160
|
-
// ignore sorting when specific elements are clicked
|
|
161
|
-
var _ref2 = event.target,
|
|
162
|
-
tagName = _ref2.tagName;
|
|
163
|
-
|
|
164
|
-
if (IgnoreSorting.includes(tagName)) {
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
|
|
159
|
+
_defineProperty(_assertThisInitialized(_this), "sort", function () {
|
|
168
160
|
var _this$props2 = _this.props,
|
|
169
161
|
fireAnalyticsEvent = _this$props2.fireAnalyticsEvent,
|
|
170
162
|
onSorting = _this$props2.onSorting,
|
|
@@ -217,28 +209,18 @@ export var withSortableColumn = function withSortableColumn(WrapperComponent) {
|
|
|
217
209
|
return /*#__PURE__*/React.createElement(WrapperComponent, this.props);
|
|
218
210
|
}
|
|
219
211
|
|
|
220
|
-
var className = RendererCssClassName.SORTABLE_COLUMN;
|
|
221
|
-
|
|
222
|
-
if (!onSorting) {
|
|
223
|
-
className = "".concat(className, " ").concat(RendererCssClassName.SORTABLE_COLUMN_NOT_ALLOWED);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
212
|
return /*#__PURE__*/React.createElement(WrapperComponent, _extends({}, this.props, {
|
|
227
|
-
className:
|
|
213
|
+
className: RendererCssClassName.SORTABLE_COLUMN_WRAPPER,
|
|
228
214
|
ariaSort: getSortOrderLabel(intl, sortOrdered)
|
|
229
215
|
}), /*#__PURE__*/React.createElement("div", {
|
|
230
|
-
className: RendererCssClassName.
|
|
231
|
-
role: "button",
|
|
232
|
-
tabIndex: onSorting ? 0 : -1,
|
|
233
|
-
onClick: this.onClick,
|
|
234
|
-
onKeyDown: this.onKeyPress,
|
|
235
|
-
"aria-disabled": !onSorting
|
|
216
|
+
className: RendererCssClassName.SORTABLE_COLUMN
|
|
236
217
|
}, children, /*#__PURE__*/React.createElement("figure", {
|
|
237
|
-
"
|
|
238
|
-
className: "".concat(RendererCssClassName.SORTABLE_COLUMN_ICON, " ").concat(sortOrderedClassName)
|
|
218
|
+
className: "".concat(RendererCssClassName.SORTABLE_COLUMN_ICON_WRAPPER, " ").concat(sortOrderedClassName)
|
|
239
219
|
}, /*#__PURE__*/React.createElement(SortingIcon, {
|
|
240
220
|
isSortingAllowed: !!onSorting,
|
|
241
|
-
sortOrdered: sortOrdered
|
|
221
|
+
sortOrdered: sortOrdered,
|
|
222
|
+
onClick: this.sort,
|
|
223
|
+
onKeyDown: this.onKeyPress
|
|
242
224
|
}))));
|
|
243
225
|
}
|
|
244
226
|
}]);
|
|
@@ -49,6 +49,8 @@ var ExtensionRenderer = /*#__PURE__*/function (_React$Component) {
|
|
|
49
49
|
_defineProperty(_assertThisInitialized(_this), "getNodeRenderer", memoizeOne(getNodeRenderer));
|
|
50
50
|
|
|
51
51
|
_defineProperty(_assertThisInitialized(_this), "renderExtensionNode", function (extensionProvider) {
|
|
52
|
+
var _marks$find, _marks$find$attrs;
|
|
53
|
+
|
|
52
54
|
var _this$props = _this.props,
|
|
53
55
|
extensionHandlers = _this$props.extensionHandlers,
|
|
54
56
|
rendererContext = _this$props.rendererContext,
|
|
@@ -58,14 +60,19 @@ var ExtensionRenderer = /*#__PURE__*/function (_React$Component) {
|
|
|
58
60
|
content = _this$props.content,
|
|
59
61
|
text = _this$props.text,
|
|
60
62
|
type = _this$props.type,
|
|
61
|
-
localId = _this$props.localId
|
|
63
|
+
localId = _this$props.localId,
|
|
64
|
+
marks = _this$props.marks;
|
|
65
|
+
var fragmentLocalId = marks === null || marks === void 0 ? void 0 : (_marks$find = marks.find(function (m) {
|
|
66
|
+
return m.type.name === 'fragment';
|
|
67
|
+
})) === null || _marks$find === void 0 ? void 0 : (_marks$find$attrs = _marks$find.attrs) === null || _marks$find$attrs === void 0 ? void 0 : _marks$find$attrs.localId;
|
|
62
68
|
var node = {
|
|
63
69
|
type: type,
|
|
64
70
|
extensionKey: extensionKey,
|
|
65
71
|
extensionType: extensionType,
|
|
66
72
|
parameters: parameters,
|
|
67
73
|
content: content || text,
|
|
68
|
-
localId: localId
|
|
74
|
+
localId: localId,
|
|
75
|
+
fragmentLocalId: fragmentLocalId
|
|
69
76
|
};
|
|
70
77
|
var result = null;
|
|
71
78
|
|
|
@@ -50,7 +50,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
|
|
|
50
50
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
51
51
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
52
52
|
var packageName = "@atlaskit/renderer";
|
|
53
|
-
var packageVersion = "103.0.
|
|
53
|
+
var packageVersion = "103.0.2";
|
|
54
54
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
55
55
|
_inherits(Renderer, _PureComponent);
|
|
56
56
|
|
|
@@ -8,8 +8,9 @@ import { gridSize, fontFamily, fontSize, borderRadius } from '@atlaskit/theme/co
|
|
|
8
8
|
import * as colors from '@atlaskit/theme/colors';
|
|
9
9
|
import { headingSizes as headingSizesImport } from '@atlaskit/theme/typography';
|
|
10
10
|
import { token } from '@atlaskit/tokens';
|
|
11
|
-
import { tableSharedStyle, columnLayoutSharedStyle, blockquoteSharedStyles, headingsSharedStyles, ruleSharedStyles, whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, mediaSingleSharedStyle, TableSharedCssClassName, tableMarginTop, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, richMediaClassName, tasksAndDecisionsStyles, smartCardSharedStyles, tableCellPadding, textColorStyles } from '@atlaskit/editor-common/styles';
|
|
11
|
+
import { tableSharedStyle, columnLayoutSharedStyle, blockquoteSharedStyles, headingsSharedStyles, ruleSharedStyles, whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, mediaSingleSharedStyle, TableSharedCssClassName, tableMarginTop, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, richMediaClassName, tasksAndDecisionsStyles, smartCardSharedStyles, tableCellPadding, textColorStyles, codeBlockInListSafariFix } from '@atlaskit/editor-common/styles';
|
|
12
12
|
import { shadowClassNames } from '@atlaskit/editor-common/ui';
|
|
13
|
+
import { browser } from '@atlaskit/editor-common/utils';
|
|
13
14
|
import { editorFontSize, blockNodesVerticalMargin, akEditorTableToolbar, akEditorTableToolbarDark, akEditorTableBorder, akEditorTableBorderDark, akEditorTableNumberColumnWidth, gridMediumMaxWidth, akEditorFullWidthLayoutWidth, akEditorStickyHeaderZIndex, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
14
15
|
import { RendererCssClassName } from '../../consts';
|
|
15
16
|
import { HeadingAnchorWrapperClassName } from '../../react/nodes/heading-anchor';
|
|
@@ -70,7 +71,7 @@ var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
|
|
|
70
71
|
headingsCss = "\n /**\n * When the sort button is enabled we want the heading's copy link button\n * to reserve space so that it can prematurely wrap to avoid the button\n * being displayed underneath the sort button (hidden or obscured).\n *\n * The two buttons fight each other since the sort button is displayed\n * on hover of the <th /> and the copy link button is displayed on hover\n * of the heading.\n *\n * Note that this can break the WYSIWYG experience in the case where\n * a heading fills the width of the table cell and the only thing which\n * wraps is the copy link button. This is hopefully a rare fringe case.\n */\n .".concat(HeadingAnchorWrapperClassName, " {\n position: unset;\n }\n > {\n h1, h2, h3, h4, h5, h6 {\n margin-right: 30px;\n }\n }\n ");
|
|
71
72
|
}
|
|
72
73
|
|
|
73
|
-
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .", " {\n padding: 0;\n\n .", " {\n width: 100%;\n height: 100%;\n
|
|
74
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .", " {\n padding: 0;\n\n .", " {\n width: 100%;\n height: 100%;\n padding: ", "px;\n border-width: 1.5px;\n border-style: solid;\n border-color: transparent;\n\n > *: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 @supports selector(:focus-visible) {\n &:focus {\n outline: unset;\n }\n &:focus-visible {\n border-color: ", ";\n }\n }\n\n ", "\n }\n\n .", " {\n margin: 0;\n .", " {\n opacity: 1;\n transition: opacity 0.2s ease-in-out;\n }\n }\n\n .", " {\n .", " {\n opacity: 0;\n &:focus {\n opacity: 1;\n }\n }\n }\n\n &:hover {\n .", " {\n .", " {\n opacity: 1;\n }\n }\n }\n }\n "])), RendererCssClassName.SORTABLE_COLUMN_WRAPPER, RendererCssClassName.SORTABLE_COLUMN, tableCellPadding, token('color.border.focused', colors.B300), headingsCss, RendererCssClassName.SORTABLE_COLUMN_ICON_WRAPPER, RendererCssClassName.SORTABLE_COLUMN_ICON, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, RendererCssClassName.SORTABLE_COLUMN_ICON, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, RendererCssClassName.SORTABLE_COLUMN_ICON);
|
|
74
75
|
};
|
|
75
76
|
|
|
76
77
|
var fullPageStyles = function fullPageStyles(_ref3, _ref4) {
|
|
@@ -100,7 +101,7 @@ export var rendererStyles = function rendererStyles(wrapperProps) {
|
|
|
100
101
|
var themeProps = {
|
|
101
102
|
theme: theme
|
|
102
103
|
};
|
|
103
|
-
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n
|
|
104
|
+
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: 1.5rem;\n color: ", ";\n\n .", "::after {\n // we add a clearfix after ak-renderer-document in order to\n // contain internal floats (such as media images that are \"wrap-left\")\n // to just the renderer (and not spill outside of it)\n content: '';\n visibility: hidden;\n display: block;\n height: 0;\n clear: both;\n }\n\n ", "\n ", "\n\n & h1 {\n ", "\n }\n\n & h2 {\n ", "\n }\n\n & h3 {\n ", "\n }\n\n & h4 {\n ", "\n }\n\n & h5 {\n ", "\n }\n\n & h6 {\n ", "\n }\n\n & span.akActionMark {\n color: ", ";\n text-decoration: none;\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n\n &:active {\n color: ", ";\n }\n }\n\n & span.akActionMark {\n cursor: pointer;\n }\n\n & span[data-placeholder] {\n color: ", ";\n }\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", "\n\n & .UnknownBlock {\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n\n & span.date-node {\n background: ", ";\n border-radius: ", "px;\n color: ", ";\n padding: 2px 4px;\n margin: 0 1px;\n transition: background 0.3s;\n }\n\n & span.date-node-highlighted {\n background: ", ";\n color: ", ";\n }\n\n & .renderer-image {\n max-width: 100%;\n display: block;\n margin: ", "px 0;\n }\n\n .", ".rich-media-wrapped\n + .", ":not(.rich-media-wrapped) {\n clear: both;\n }\n\n & .code-block,\n & blockquote,\n & hr,\n & > div > div:not(.rich-media-wrapped),\n .", ".rich-media-wrapped\n + .rich-media-wrapped\n + *:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n .", ".image-align-start,\n .", ".image-center,\n .", ".image-align-end {\n clear: both;\n }\n\n & .rich-media-wrapped {\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n margin-top: 8px;\n }\n }\n\n ", "\n /* plugin styles */\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* Breakout for tables and extensions */\n .", " > {\n * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n * .", " {\n overflow-x: auto;\n }\n\n & .", ":first-child {\n margin-top: 0;\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n }\n\n .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .", " {\n overflow-x: auto;\n }\n\n .", "\n .", " {\n display: flex;\n }\n }\n\n ", "\n\n .", " .", " {\n z-index: 0;\n transition: all 0.1s linear;\n display: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n /** Shadow overrides */\n &.", "::after,\n &.", "::before {\n top: ", "px;\n height: calc(100% - ", "px);\n z-index: ", ";\n }\n\n &\n .", ",\n &\n .", " {\n height: calc(100% - ", "px);\n }\n\n /**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n table {\n height: 1px; /* will be ignored */\n ", ";\n margin-left: 0;\n margin-right: 0;\n }\n\n table tr:first-of-type {\n height: 100%;\n\n td,\n th {\n position: relative;\n }\n }\n\n table[data-number-column='true'] {\n .", " {\n background-color: ", ";\n border-right: 1px solid\n ", ";\n width: ", "px;\n text-align: center;\n color: ", ";\n font-size: ", ";\n }\n\n .fixed .", " {\n border-right: 0px none;\n }\n }\n }\n\n tr[data-header-row].fixed {\n position: fixed !important;\n display: flex;\n overflow: hidden;\n z-index: ", ";\n\n border-right: 1px solid\n ", ";\n border-bottom: 1px solid\n ", ";\n\n /* this is to compensate for the table border */\n transform: translateX(-1px);\n }\n\n .sticky > th {\n z-index: ", ";\n position: sticky !important;\n top: 0;\n }\n\n /* Make the number column header sticky */\n .sticky > td {\n position: sticky !important;\n top: 0;\n }\n\n /* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n .sticky th,\n .sticky td {\n box-shadow: 0px 1px\n ", ",\n 0px -0.5px ", ",\n inset -1px 0px ", ",\n 0px -1px ", ";\n }\n\n /* this will remove jumpiness caused in Chrome for sticky headers */\n .fixed + tr {\n min-height: 0px;\n }\n\n /*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n & .code-block {\n max-width: 100%;\n /* -ms- properties are necessary until MS supports the latest version of the grid spec */\n /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: auto 1fr;\n /* stylelint-enable */\n\n grid-template-columns: minmax(0, 1fr);\n position: relative;\n border-radius: ", "px;\n\n /*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n word-wrap: normal;\n\n & > span {\n /* stylelint-disable value-no-vendor-prefix */\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n /* stylelint-enable */\n grid-column: 1;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n\n &:hover button.copy-to-clipboard,\n .copy-to-clipboard:focus {\n opacity: 1;\n position: absolute;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n }\n }\n\n ", "\n\n ", ";\n & [data-layout-section] {\n margin-top: ", "px;\n & > div + div {\n margin-left: ", "px;\n }\n\n @media screen and (max-width: ", "px) {\n & > div + div {\n margin-left: 0;\n }\n }\n }\n\n & li {\n > .code-block {\n margin: ", " 0 0 0;\n }\n > .code-block:first-child {\n margin-top: 0;\n }\n\n > div:last-of-type.code-block {\n margin-bottom: ", ";\n }\n\n ", "\n }\n "])), editorFontSize(themeProps), themed({
|
|
104
105
|
light: token('color.text', colors.N800),
|
|
105
106
|
dark: token('color.text', '#B8C7E0')
|
|
106
107
|
})(themeProps), RendererCssClassName.DOCUMENT, fullPageStyles(wrapperProps, themeProps), fullWidthStyles(wrapperProps), headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), token('color.link', colors.B400), token('color.link', colors.B300), token('color.link.pressed', colors.B500), colors.placeholderText(themeProps), whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles(themeProps), ruleSharedStyles(themeProps), paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, codeMarkSharedStyles(themeProps), shadowSharedStyle, dateSharedStyle, textColorStyles, tasksAndDecisionsStyles, smartCardSharedStyles, fontFamily(), relativeFontSizeToBase16(fontSize()), themed({
|
|
@@ -136,6 +137,6 @@ export var rendererStyles = function rendererStyles(wrapperProps) {
|
|
|
136
137
|
})(themeProps), themed({
|
|
137
138
|
light: token('color.border', akEditorTableToolbar),
|
|
138
139
|
dark: token('color.border', akEditorTableToolbarDark)
|
|
139
|
-
})(themeProps), borderRadius(), blockNodesVerticalMargin, getLightWeightCodeBlockStylesForRootRendererStyleSheet(), columnLayoutSharedStyle, gridSize() * 2.5, gridSize() * 4, gridMediumMaxWidth);
|
|
140
|
+
})(themeProps), borderRadius(), blockNodesVerticalMargin, getLightWeightCodeBlockStylesForRootRendererStyleSheet(), columnLayoutSharedStyle, gridSize() * 2.5, gridSize() * 4, gridMediumMaxWidth, blockNodesVerticalMargin, blockNodesVerticalMargin, browser.safari ? codeBlockInListSafariFix : '');
|
|
140
141
|
};
|
|
141
142
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
|
|
3
|
-
var _templateObject, _templateObject2;
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
4
4
|
|
|
5
5
|
/** @jsx jsx */
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
@@ -10,14 +10,9 @@ import { N20, N30 } from '@atlaskit/theme/colors';
|
|
|
10
10
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
11
11
|
import { sortingIconMessages } from '../messages';
|
|
12
12
|
import { injectIntl } from 'react-intl-next';
|
|
13
|
-
import { token } from '@atlaskit/tokens';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// TODO: Quality ticket: https://product-fabric.atlassian.net/browse/DSP-4136
|
|
17
|
-
|
|
18
|
-
export var TableSortIconDataUrl = "data:image/svg+xml;utf8,".concat(encodeURIComponent("<svg xmlns=\"http://www.w3.org/2000/svg\"><g fill=\"none\" fill-rule=\"evenodd\"><path d=\"M-8-6h24v24H-8z\"></path><path d=\"M3 8.509V1c0-.552.449-1 1-1 .552 0 1 .448 1 1V8.51l1.217-1.206a1.05 1.05 0 011.477 0 1.03 1.03 0 01.004 1.463l-.003.002-2.956 2.93a1.053 1.053 0 01-1.478 0L.305 8.767a1.03 1.03 0 01.001-1.464 1.05 1.05 0 011.477 0L3 8.508z\" fill=\"#42526E\"></path></g></svg>"));
|
|
19
|
-
var TABLE_SORTING_ICON_CLASS = 'table-sorting-icon';
|
|
20
|
-
export var StatusClassNames; // TODO: get design to check border
|
|
13
|
+
import { token } from '@atlaskit/tokens';
|
|
14
|
+
import { RendererCssClassName } from '../consts';
|
|
15
|
+
export var StatusClassNames;
|
|
21
16
|
|
|
22
17
|
(function (StatusClassNames) {
|
|
23
18
|
StatusClassNames["ASC"] = "sorting-icon-svg__asc";
|
|
@@ -26,23 +21,34 @@ export var StatusClassNames; // TODO: get design to check border
|
|
|
26
21
|
StatusClassNames["SORTING_NOT_ALLOWED"] = "sorting-icon-svg__not-allowed";
|
|
27
22
|
})(StatusClassNames || (StatusClassNames = {}));
|
|
28
23
|
|
|
29
|
-
var
|
|
30
|
-
var
|
|
24
|
+
var buttonStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n display: flex;\n height: 28px;\n width: 28px;\n margin: 6px;\n right: 0;\n top: 0;\n border: 2px solid ", ";\n border-radius: ", "px;\n background-color: ", ";\n justify-content: center;\n align-items: center;\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n }\n\n &.", "__not-allowed {\n cursor: not-allowed;\n }\n"])), token('color.border', '#fff'), gridSize() / 2, token('elevation.surface.overlay', N20), token('elevation.surface.overlay.hovered', N30), token('elevation.surface.overlay.pressed', 'rgba(179, 212, 255, 0.6)'), RendererCssClassName.SORTABLE_COLUMN_ICON);
|
|
25
|
+
var iconWrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 8px;\n height: 12px;\n transition: transform 0.3s cubic-bezier(0.15, 1, 0.3, 1);\n transform-origin: 50% 50%;\n display: flex;\n justify-content: center;\n\n &.", " {\n transform: rotate(-180deg);\n }\n\n &.", "-inactive {\n opacity: 0.7;\n }\n"])), StatusClassNames.DESC, RendererCssClassName.SORTABLE_COLUMN_ICON); // The icon is created with CSS due to the following Firefox issue: https://product-fabric.atlassian.net/browse/ED-8001
|
|
26
|
+
// The TL;DR is that svg's in tables mess up how HTML is copied in Firefox. Using a styled div instead solves the problem.
|
|
27
|
+
// For this reason, svg's should be avoided in tables until this issue is fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=1664350
|
|
28
|
+
|
|
29
|
+
var iconStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n height: 100%;\n width: 2px;\n border-radius: 50px;\n background: ", ";\n\n &::before,\n &::after {\n background: ", ";\n content: '';\n height: 2px;\n width: 6px;\n position: absolute;\n border-radius: 50px;\n }\n\n &::before {\n transform: rotate(45deg) translate(3.4px, 8.5px);\n }\n\n &::after {\n transform: rotate(-45deg) translate(-6.3px, 5.7px);\n }\n"])), token('color.icon', '#42526E'), token('color.icon', '#42526E'));
|
|
30
|
+
|
|
31
|
+
var getIconClassName = function getIconClassName(isSortingAllowed, sortOrdered) {
|
|
32
|
+
var activated = sortOrdered !== SortOrder.NO_ORDER;
|
|
33
|
+
var activeStatusClass = "".concat(RendererCssClassName.SORTABLE_COLUMN_ICON, "-").concat(activated ? 'active' : 'inactive');
|
|
34
|
+
|
|
35
|
+
if (!isSortingAllowed) {
|
|
36
|
+
return "".concat(StatusClassNames.SORTING_NOT_ALLOWED, " ").concat(activeStatusClass);
|
|
37
|
+
}
|
|
31
38
|
|
|
32
|
-
|
|
33
|
-
switch (status) {
|
|
39
|
+
switch (sortOrdered) {
|
|
34
40
|
case SortOrder.ASC:
|
|
35
|
-
return StatusClassNames.ASC;
|
|
41
|
+
return "".concat(StatusClassNames.ASC, " ").concat(activeStatusClass);
|
|
36
42
|
|
|
37
43
|
case SortOrder.DESC:
|
|
38
|
-
return StatusClassNames.DESC;
|
|
44
|
+
return "".concat(StatusClassNames.DESC, " ").concat(activeStatusClass);
|
|
39
45
|
|
|
40
46
|
default:
|
|
41
|
-
return StatusClassNames.NO_ORDER;
|
|
47
|
+
return "".concat(StatusClassNames.NO_ORDER, " ").concat(activeStatusClass);
|
|
42
48
|
}
|
|
43
49
|
};
|
|
44
50
|
|
|
45
|
-
var getTooltipTitle = function getTooltipTitle(intl, isSortingAllowed,
|
|
51
|
+
var getTooltipTitle = function getTooltipTitle(intl, isSortingAllowed, sortOrdered) {
|
|
46
52
|
var noOrderLabel = sortingIconMessages.noOrderLabel,
|
|
47
53
|
ascOrderLabel = sortingIconMessages.ascOrderLabel,
|
|
48
54
|
descOrderLabel = sortingIconMessages.descOrderLabel,
|
|
@@ -52,7 +58,7 @@ var getTooltipTitle = function getTooltipTitle(intl, isSortingAllowed, status) {
|
|
|
52
58
|
return intl.formatMessage(invalidLabel);
|
|
53
59
|
}
|
|
54
60
|
|
|
55
|
-
switch (
|
|
61
|
+
switch (sortOrdered) {
|
|
56
62
|
case SortOrder.NO_ORDER:
|
|
57
63
|
return intl.formatMessage(noOrderLabel);
|
|
58
64
|
|
|
@@ -69,21 +75,43 @@ var getTooltipTitle = function getTooltipTitle(intl, isSortingAllowed, status) {
|
|
|
69
75
|
var SortingIcon = function SortingIcon(_ref) {
|
|
70
76
|
var isSortingAllowed = _ref.isSortingAllowed,
|
|
71
77
|
sortOrdered = _ref.sortOrdered,
|
|
72
|
-
intl = _ref.intl
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
intl = _ref.intl,
|
|
79
|
+
onClick = _ref.onClick,
|
|
80
|
+
onKeyDown = _ref.onKeyDown;
|
|
81
|
+
var buttonClassName = "".concat(RendererCssClassName.SORTABLE_COLUMN_ICON).concat(isSortingAllowed ? '' : " ".concat(RendererCssClassName.SORTABLE_COLUMN_ICON, "__not-allowed"));
|
|
75
82
|
var content = getTooltipTitle(intl, isSortingAllowed, sortOrdered);
|
|
83
|
+
|
|
84
|
+
var handleClick = function handleClick() {
|
|
85
|
+
if (isSortingAllowed) {
|
|
86
|
+
onClick();
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
var handleKeyDown = function handleKeyDown(event) {
|
|
91
|
+
if (isSortingAllowed) {
|
|
92
|
+
onKeyDown(event);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
76
96
|
return jsx(Tooltip, {
|
|
77
97
|
delay: 0,
|
|
78
98
|
content: content,
|
|
79
99
|
position: "top"
|
|
80
|
-
}, jsx("figure", {
|
|
81
|
-
css: wrapperStyles,
|
|
82
|
-
className: wrapperClassName
|
|
83
100
|
}, jsx("div", {
|
|
84
|
-
css:
|
|
85
|
-
className:
|
|
86
|
-
|
|
101
|
+
css: buttonStyles,
|
|
102
|
+
className: buttonClassName,
|
|
103
|
+
role: "button",
|
|
104
|
+
tabIndex: isSortingAllowed ? 0 : -1,
|
|
105
|
+
"aria-label": "sort column",
|
|
106
|
+
"aria-disabled": !isSortingAllowed,
|
|
107
|
+
onClick: handleClick,
|
|
108
|
+
onKeyDown: handleKeyDown
|
|
109
|
+
}, jsx("div", {
|
|
110
|
+
css: iconWrapperStyles,
|
|
111
|
+
className: getIconClassName(isSortingAllowed, sortOrdered)
|
|
112
|
+
}, jsx("div", {
|
|
113
|
+
css: iconStyles
|
|
114
|
+
}))));
|
|
87
115
|
};
|
|
88
116
|
|
|
89
117
|
export default injectIntl(SortingIcon);
|
package/dist/esm/version.json
CHANGED