@atlaskit/editor-common 63.0.0 → 65.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +52 -0
- package/dist/cjs/i18n/cs.js +3 -3
- package/dist/cjs/i18n/da.js +3 -3
- package/dist/cjs/i18n/de.js +3 -3
- package/dist/cjs/i18n/en_ZZ.js +27 -0
- package/dist/cjs/i18n/es.js +3 -3
- package/dist/cjs/i18n/fi.js +3 -3
- package/dist/cjs/i18n/fr.js +3 -3
- package/dist/cjs/i18n/hu.js +3 -3
- package/dist/cjs/i18n/it.js +3 -3
- package/dist/cjs/i18n/ja.js +3 -3
- package/dist/cjs/i18n/ko.js +3 -3
- package/dist/cjs/i18n/nb.js +3 -3
- package/dist/cjs/i18n/nl.js +3 -3
- package/dist/cjs/i18n/pl.js +3 -3
- package/dist/cjs/i18n/pt_BR.js +3 -3
- package/dist/cjs/i18n/ru.js +3 -3
- package/dist/cjs/i18n/sv.js +3 -3
- package/dist/cjs/i18n/th.js +3 -3
- package/dist/cjs/i18n/tr.js +3 -3
- package/dist/cjs/i18n/uk.js +3 -3
- package/dist/cjs/i18n/vi.js +3 -3
- package/dist/cjs/i18n/zh.js +3 -2
- package/dist/cjs/i18n/zh_TW.js +3 -3
- package/dist/cjs/index.js +1 -29
- package/dist/cjs/safe-plugin/index.js +42 -0
- package/dist/cjs/styles/index.js +0 -8
- package/dist/cjs/styles/shared/annotation.js +25 -17
- package/dist/cjs/styles/shared/block-marks.js +2 -2
- package/dist/cjs/styles/shared/blockquote.js +2 -2
- package/dist/cjs/styles/shared/code-mark.js +9 -5
- package/dist/cjs/styles/shared/column-layout.js +2 -2
- package/dist/cjs/styles/shared/date.js +2 -2
- package/dist/cjs/styles/shared/headings.js +5 -2
- package/dist/cjs/styles/shared/indentation.js +2 -2
- package/dist/cjs/styles/shared/lists.js +4 -2
- package/dist/cjs/styles/shared/media-single.js +2 -2
- package/dist/cjs/styles/shared/paragraph.js +2 -2
- package/dist/cjs/styles/shared/shadow.js +2 -2
- package/dist/cjs/styles/shared/table.js +37 -33
- package/dist/cjs/styles/shared/task-decision.js +2 -2
- package/dist/cjs/styles/shared/text-color.js +2 -2
- package/dist/cjs/styles/shared/whitespace.js +2 -2
- package/dist/cjs/types/collab.js +5 -0
- package/dist/cjs/ui/BaseTheme/index.js +27 -11
- package/dist/cjs/ui/Caption/index.js +10 -7
- package/dist/cjs/ui/MediaSingle/index.js +3 -1
- package/dist/cjs/ui/MediaSingle/link.js +4 -6
- package/dist/cjs/ui/Mention/index.js +1 -3
- package/dist/cjs/ui/Mention/mention-with-profilecard.js +33 -194
- package/dist/cjs/ui/Mention/mention-with-providers.js +1 -5
- package/dist/cjs/ui/Messages/index.js +25 -22
- package/dist/cjs/ui/UnsupportedBlock/index.js +9 -6
- package/dist/cjs/ui/UnsupportedInline/index.js +8 -6
- package/dist/cjs/ui/WidthProvider/index.js +8 -9
- package/dist/cjs/ui/clear-next-sibling-margin-top.js +4 -5
- package/dist/cjs/ui/index.js +12 -12
- package/dist/cjs/utils/browser.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/i18n/cs.js +3 -3
- package/dist/es2019/i18n/da.js +3 -3
- package/dist/es2019/i18n/de.js +3 -3
- package/dist/es2019/i18n/en_ZZ.js +19 -0
- package/dist/es2019/i18n/es.js +3 -3
- package/dist/es2019/i18n/fi.js +3 -3
- package/dist/es2019/i18n/fr.js +3 -3
- package/dist/es2019/i18n/hu.js +3 -3
- package/dist/es2019/i18n/it.js +3 -3
- package/dist/es2019/i18n/ja.js +3 -3
- package/dist/es2019/i18n/ko.js +3 -3
- package/dist/es2019/i18n/nb.js +3 -3
- package/dist/es2019/i18n/nl.js +3 -3
- package/dist/es2019/i18n/pl.js +3 -3
- package/dist/es2019/i18n/pt_BR.js +3 -3
- package/dist/es2019/i18n/ru.js +3 -3
- package/dist/es2019/i18n/sv.js +3 -3
- package/dist/es2019/i18n/th.js +3 -3
- package/dist/es2019/i18n/tr.js +3 -3
- package/dist/es2019/i18n/uk.js +3 -3
- package/dist/es2019/i18n/vi.js +3 -3
- package/dist/es2019/i18n/zh.js +3 -2
- package/dist/es2019/i18n/zh_TW.js +3 -3
- package/dist/es2019/index.js +2 -7
- package/dist/es2019/safe-plugin/index.js +10 -0
- package/dist/es2019/styles/index.js +0 -1
- package/dist/es2019/styles/shared/annotation.js +11 -11
- package/dist/es2019/styles/shared/block-marks.js +3 -2
- package/dist/es2019/styles/shared/blockquote.js +1 -1
- package/dist/es2019/styles/shared/code-mark.js +14 -11
- package/dist/es2019/styles/shared/column-layout.js +1 -1
- package/dist/es2019/styles/shared/date.js +1 -1
- package/dist/es2019/styles/shared/headings.js +8 -8
- package/dist/es2019/styles/shared/indentation.js +1 -1
- package/dist/es2019/styles/shared/lists.js +17 -1
- package/dist/es2019/styles/shared/media-single.js +1 -1
- package/dist/es2019/styles/shared/paragraph.js +1 -1
- package/dist/es2019/styles/shared/shadow.js +1 -1
- package/dist/es2019/styles/shared/table.js +14 -12
- package/dist/es2019/styles/shared/task-decision.js +1 -1
- package/dist/es2019/styles/shared/text-color.js +1 -1
- package/dist/es2019/styles/shared/whitespace.js +1 -1
- package/dist/es2019/types/collab.js +1 -0
- package/dist/es2019/ui/BaseTheme/index.js +16 -5
- package/dist/es2019/ui/Caption/index.js +11 -5
- package/dist/es2019/ui/MediaSingle/index.js +3 -1
- package/dist/es2019/ui/MediaSingle/link.js +3 -4
- package/dist/es2019/ui/Mention/index.js +1 -3
- package/dist/es2019/ui/Mention/mention-with-profilecard.js +33 -146
- package/dist/es2019/ui/Mention/mention-with-providers.js +1 -5
- package/dist/es2019/ui/Messages/index.js +30 -22
- package/dist/es2019/ui/UnsupportedBlock/index.js +9 -5
- package/dist/es2019/ui/UnsupportedInline/index.js +8 -5
- package/dist/es2019/ui/WidthProvider/index.js +10 -8
- package/dist/es2019/ui/clear-next-sibling-margin-top.js +2 -2
- package/dist/es2019/ui/index.js +2 -2
- package/dist/es2019/utils/browser.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/i18n/cs.js +3 -3
- package/dist/esm/i18n/da.js +3 -3
- package/dist/esm/i18n/de.js +3 -3
- package/dist/esm/i18n/en_ZZ.js +19 -0
- package/dist/esm/i18n/es.js +3 -3
- package/dist/esm/i18n/fi.js +3 -3
- package/dist/esm/i18n/fr.js +3 -3
- package/dist/esm/i18n/hu.js +3 -3
- package/dist/esm/i18n/it.js +3 -3
- package/dist/esm/i18n/ja.js +3 -3
- package/dist/esm/i18n/ko.js +3 -3
- package/dist/esm/i18n/nb.js +3 -3
- package/dist/esm/i18n/nl.js +3 -3
- package/dist/esm/i18n/pl.js +3 -3
- package/dist/esm/i18n/pt_BR.js +3 -3
- package/dist/esm/i18n/ru.js +3 -3
- package/dist/esm/i18n/sv.js +3 -3
- package/dist/esm/i18n/th.js +3 -3
- package/dist/esm/i18n/tr.js +3 -3
- package/dist/esm/i18n/uk.js +3 -3
- package/dist/esm/i18n/vi.js +3 -3
- package/dist/esm/i18n/zh.js +3 -2
- package/dist/esm/i18n/zh_TW.js +3 -3
- package/dist/esm/index.js +2 -7
- package/dist/esm/safe-plugin/index.js +27 -0
- package/dist/esm/styles/index.js +0 -1
- package/dist/esm/styles/shared/annotation.js +21 -17
- package/dist/esm/styles/shared/block-marks.js +2 -2
- package/dist/esm/styles/shared/blockquote.js +1 -1
- package/dist/esm/styles/shared/code-mark.js +9 -6
- package/dist/esm/styles/shared/column-layout.js +1 -1
- package/dist/esm/styles/shared/date.js +1 -1
- package/dist/esm/styles/shared/headings.js +4 -2
- package/dist/esm/styles/shared/indentation.js +1 -1
- package/dist/esm/styles/shared/lists.js +3 -2
- package/dist/esm/styles/shared/media-single.js +1 -1
- package/dist/esm/styles/shared/paragraph.js +1 -1
- package/dist/esm/styles/shared/shadow.js +1 -1
- package/dist/esm/styles/shared/table.js +37 -33
- package/dist/esm/styles/shared/task-decision.js +1 -1
- package/dist/esm/styles/shared/text-color.js +1 -1
- package/dist/esm/styles/shared/whitespace.js +1 -1
- package/dist/esm/types/collab.js +1 -0
- package/dist/esm/ui/BaseTheme/index.js +23 -12
- package/dist/esm/ui/Caption/index.js +10 -5
- package/dist/esm/ui/MediaSingle/index.js +3 -1
- package/dist/esm/ui/MediaSingle/link.js +2 -3
- package/dist/esm/ui/Mention/index.js +1 -3
- package/dist/esm/ui/Mention/mention-with-profilecard.js +33 -189
- package/dist/esm/ui/Mention/mention-with-providers.js +1 -5
- package/dist/esm/ui/Messages/index.js +26 -20
- package/dist/esm/ui/UnsupportedBlock/index.js +9 -5
- package/dist/esm/ui/UnsupportedInline/index.js +8 -5
- package/dist/esm/ui/WidthProvider/index.js +7 -6
- package/dist/esm/ui/clear-next-sibling-margin-top.js +2 -2
- package/dist/esm/ui/index.js +2 -2
- package/dist/esm/utils/browser.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/__tests_external__/page-objects/Editor.d.ts +0 -1
- package/dist/types/__tests_external__/page-objects/EditorMedia.d.ts +0 -1
- package/dist/types/__tests_external__/page-objects/EditorSmartLink.d.ts +0 -1
- package/dist/types/__tests_external__/page-objects/Renderer.d.ts +0 -1
- package/dist/types/collab/types.d.ts +14 -2
- package/dist/types/collab.d.ts +1 -1
- package/dist/types/i18n/cs.d.ts +2 -2
- package/dist/types/i18n/da.d.ts +2 -2
- package/dist/types/i18n/de.d.ts +2 -2
- package/dist/types/i18n/en_ZZ.d.ts +19 -0
- package/dist/types/i18n/es.d.ts +2 -2
- package/dist/types/i18n/fi.d.ts +2 -2
- package/dist/types/i18n/fr.d.ts +2 -2
- package/dist/types/i18n/hu.d.ts +2 -2
- package/dist/types/i18n/it.d.ts +2 -2
- package/dist/types/i18n/ja.d.ts +2 -2
- package/dist/types/i18n/ko.d.ts +2 -2
- package/dist/types/i18n/nb.d.ts +2 -2
- package/dist/types/i18n/nl.d.ts +2 -2
- package/dist/types/i18n/pl.d.ts +2 -2
- package/dist/types/i18n/pt_BR.d.ts +2 -2
- package/dist/types/i18n/ru.d.ts +2 -2
- package/dist/types/i18n/sv.d.ts +2 -2
- package/dist/types/i18n/th.d.ts +2 -2
- package/dist/types/i18n/tr.d.ts +2 -2
- package/dist/types/i18n/uk.d.ts +2 -2
- package/dist/types/i18n/vi.d.ts +2 -2
- package/dist/types/i18n/zh.d.ts +2 -2
- package/dist/types/i18n/zh_TW.d.ts +2 -2
- package/dist/types/index.d.ts +1 -14
- package/dist/types/safe-plugin/index.d.ts +6 -0
- package/dist/types/styles/index.d.ts +0 -1
- package/dist/types/styles/shared/annotation.d.ts +5 -4
- package/dist/types/styles/shared/block-marks.d.ts +1 -1
- package/dist/types/styles/shared/blockquote.d.ts +1 -1
- package/dist/types/styles/shared/code-mark.d.ts +2 -1
- package/dist/types/styles/shared/column-layout.d.ts +1 -1
- package/dist/types/styles/shared/date.d.ts +1 -1
- package/dist/types/styles/shared/headings.d.ts +2 -1
- package/dist/types/styles/shared/indentation.d.ts +1 -1
- package/dist/types/styles/shared/lists.d.ts +1 -1
- package/dist/types/styles/shared/media-single.d.ts +1 -1
- package/dist/types/styles/shared/panel.d.ts +1 -1
- package/dist/types/styles/shared/paragraph.d.ts +1 -1
- package/dist/types/styles/shared/rule.d.ts +1 -1
- package/dist/types/styles/shared/shadow.d.ts +1 -1
- package/dist/types/styles/shared/table.d.ts +2 -1
- package/dist/types/styles/shared/task-decision.d.ts +1 -1
- package/dist/types/styles/shared/text-color.d.ts +1 -1
- package/dist/types/styles/shared/whitespace.d.ts +1 -1
- package/dist/types/types/collab.d.ts +8 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/ui/Caption/index.d.ts +3 -1
- package/dist/types/ui/Expand/index.d.ts +2 -2
- package/dist/types/ui/MediaSingle/index.d.ts +2 -1
- package/dist/types/ui/MediaSingle/link.d.ts +1 -2
- package/dist/types/ui/MediaSingle/styled.d.ts +2 -2
- package/dist/types/ui/Mention/index.d.ts +0 -3
- package/dist/types/ui/Mention/mention-with-profilecard.d.ts +2 -25
- package/dist/types/ui/Mention/mention-with-providers.d.ts +0 -3
- package/dist/types/ui/Messages/index.d.ts +5 -3
- package/dist/types/ui/UnsupportedBlock/index.d.ts +1 -0
- package/dist/types/ui/UnsupportedInline/index.d.ts +1 -0
- package/dist/types/ui/WidthProvider/index.d.ts +3 -1
- package/dist/types/ui/clear-next-sibling-margin-top.d.ts +1 -2
- package/dist/types/ui/index.d.ts +3 -3
- package/dist/types/utils/getModeFromTheme.d.ts +1 -1
- package/package.json +18 -16
- package/safe-plugin/package.json +7 -0
- package/dist/cjs/styles/shared/inline-nodes.js +0 -17
- package/dist/es2019/styles/shared/inline-nodes.js +0 -7
- package/dist/esm/styles/shared/inline-nodes.js +0 -7
- package/dist/types/styles/shared/inline-nodes.d.ts +0 -2
|
@@ -2,7 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
import { css } from '
|
|
5
|
+
import { css } from '@emotion/react';
|
|
6
6
|
import { gridMediumMaxWidth } from '@atlaskit/editor-shared-styles';
|
|
7
7
|
var columnLayoutSharedStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n [data-layout-section] {\n display: flex;\n flex-direction: row;\n & > * {\n flex: 1;\n min-width: 0;\n }\n\n & > .unsupportedBlockView-content-wrap {\n min-width: initial;\n }\n\n @media screen and (max-width: ", "px) {\n flex-direction: column;\n }\n }\n"])), gridMediumMaxWidth);
|
|
8
8
|
export { columnLayoutSharedStyle };
|
|
@@ -2,7 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
import { css } from '
|
|
5
|
+
import { css } from '@emotion/react';
|
|
6
6
|
export var DateSharedCssClassName = {
|
|
7
7
|
DATE_WRAPPER: "date-lozenger-container",
|
|
8
8
|
DATE_CONTAINER: 'dateView-content-wrap'
|
|
@@ -2,8 +2,10 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
import { css } from '
|
|
5
|
+
import { css } from '@emotion/react';
|
|
6
6
|
import { h100, h300, h400, h500, h600, h700 } from '@atlaskit/theme/typography'; // @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
|
|
7
7
|
// text sizing prototype: http://proto/fabricrender/
|
|
8
8
|
|
|
9
|
-
export var headingsSharedStyles =
|
|
9
|
+
export var headingsSharedStyles = function headingsSharedStyles(props) {
|
|
10
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n & h1 {\n ", ";\n margin-bottom: 0;\n margin-top: 1.667em;\n }\n\n & h2 {\n ", ";\n margin-top: 1.8em;\n margin-bottom: 0;\n }\n\n & h3 {\n ", ";\n margin-top: 2em;\n margin-bottom: 0;\n }\n\n & h4 {\n ", ";\n margin-top: 1.357em;\n }\n\n & h5 {\n ", ";\n margin-top: 1.667em;\n text-transform: none;\n }\n\n & h6 {\n ", ";\n margin-top: 1.455em;\n text-transform: none;\n }\n"])), h700(props), h600(props), h500(props), h400(props), h300(props), h100(props));
|
|
11
|
+
};
|
|
@@ -2,5 +2,5 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
import { css } from '
|
|
5
|
+
import { css } from '@emotion/react';
|
|
6
6
|
export var indentationSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .fabric-editor-indentation-mark {\n &[data-level='1'] {\n margin-left: 30px;\n }\n &[data-level='2'] {\n margin-left: 60px;\n }\n &[data-level='3'] {\n margin-left: 90px;\n }\n &[data-level='4'] {\n margin-left: 120px;\n }\n &[data-level='5'] {\n margin-left: 150px;\n }\n &[data-level='6'] {\n margin-left: 180px;\n }\n }\n"])));
|
|
@@ -2,6 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
import { css } from '
|
|
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 listsSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* =============== INDENTATION SPACING ========= */\n\n ul,\n ol {\n box-sizing: border-box;\n padding-left: 24px;\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 display: table;\n display: flow-root;\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"])), browser.gecko ? 'display: inline-block;' : '', orderedListSelector, bulletListSelector);
|
|
@@ -2,7 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
import { css } from '
|
|
5
|
+
import { css } from '@emotion/react';
|
|
6
6
|
var richMediaClassName = 'rich-media-item';
|
|
7
7
|
var wrappedMediaBreakoutPoint = 410;
|
|
8
8
|
var mediaSingleSharedStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n li .", " {\n margin: 0;\n }\n\n /* Hack for chrome to fix media single position\n inside a list when media is the first child */\n &.ua-chrome li > .mediaSingleView-content-wrap::before {\n content: '';\n display: block;\n height: 0;\n }\n\n &.ua-firefox {\n .mediaSingleView-content-wrap {\n user-select: none;\n }\n\n .captionView-content-wrap {\n user-select: text;\n }\n }\n\n .mediaSingleView-content-wrap[layout='center'] {\n clear: both;\n }\n\n table .", " {\n margin-top: 12px;\n margin-bottom: 12px;\n clear: both;\n }\n\n .", ".image-wrap-right\n + .", ".image-wrap-left {\n clear: both;\n }\n\n .", ".image-wrap-left\n + .", ".image-wrap-right,\n .", ".image-wrap-right\n + .", ".image-wrap-left,\n .", ".image-wrap-left\n + .", ".image-wrap-left,\n .", ".image-wrap-right\n + .", ".image-wrap-right {\n margin-right: 0;\n margin-left: 0;\n }\n\n @media all and (max-width: ", "px) {\n div.mediaSingleView-content-wrap[layout='wrap-left'],\n div.mediaSingleView-content-wrap[data-layout='wrap-left'],\n div.mediaSingleView-content-wrap[layout='wrap-right'],\n div.mediaSingleView-content-wrap[data-layout='wrap-right'] {\n float: none;\n overflow: auto;\n margin: 12px 0;\n }\n }\n"])), richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, wrappedMediaBreakoutPoint);
|
|
@@ -2,7 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
import { css } from '
|
|
5
|
+
import { css } from '@emotion/react';
|
|
6
6
|
import { akEditorLineHeight, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles'; // @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
|
|
7
7
|
|
|
8
8
|
export var paragraphSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n & p {\n font-size: 1em;\n line-height: ", ";\n font-weight: normal;\n margin-top: ", ";\n margin-bottom: 0;\n letter-spacing: -0.005em;\n }\n"])), akEditorLineHeight, blockNodesVerticalMargin);
|
|
@@ -2,7 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
import { css } from '
|
|
5
|
+
import { css } from '@emotion/react';
|
|
6
6
|
import { akEditorShadowZIndex } from '@atlaskit/editor-shared-styles';
|
|
7
7
|
import { N40A } from '@atlaskit/theme/colors';
|
|
8
8
|
import { shadowClassNames } from '../../ui/OverflowShadow';
|
|
@@ -2,7 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
import { css } from '
|
|
5
|
+
import { css } from '@emotion/react';
|
|
6
6
|
import { tableCellContentDomSelector, tableCellSelector, tableHeaderSelector, tablePrefixSelector } from '@atlaskit/adf-schema';
|
|
7
7
|
import { akEditorBreakoutPadding, akEditorFullWidthLayoutWidth, akEditorTableBorder, akEditorTableBorderDark, akEditorTableNumberColumnWidth, akEditorTableToolbar, akEditorTableToolbarDark, akEditorWideLayoutWidth, getTableCellBackgroundDarkModeColors, overflowShadow } from '@atlaskit/editor-shared-styles';
|
|
8
8
|
import { DN20 } from '@atlaskit/theme/colors';
|
|
@@ -30,42 +30,46 @@ export var TableSharedCssClassName = {
|
|
|
30
30
|
TABLE_CELL_WRAPPER: tableCellSelector,
|
|
31
31
|
TABLE_HEADER_CELL_WRAPPER: tableHeaderSelector
|
|
32
32
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}), themed({
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
33
|
+
|
|
34
|
+
var tableSharedStyle = function tableSharedStyle(props) {
|
|
35
|
+
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-child > div {\n margin-top: 0;\n }\n }\n .", "[data-number-column='true'] {\n padding-left: ", "px;\n clear: both;\n }\n /* avoid applying styles to nested tables (possible via extensions) */\n .", " > table,\n .", " > table,\n .", " > table {\n border-collapse: collapse;\n margin: ", "px ", "px 0 0;\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: white;\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 {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + 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_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableMarginTop, tableMarginSides, tableCellBorderWidth, themed({
|
|
36
|
+
light: akEditorTableBorder,
|
|
37
|
+
dark: akEditorTableBorderDark
|
|
38
|
+
})(props), tableCellMinWidth, themed({
|
|
39
|
+
light: akEditorTableBorder,
|
|
40
|
+
dark: akEditorTableBorderDark
|
|
41
|
+
})(props), tableCellPadding, browser.gecko || browser.ie || browser.mac && browser.chrome ? 'background-clip: padding-box;' : '', themed({
|
|
42
|
+
dark: getTableCellBackgroundDarkModeColors
|
|
43
|
+
})(props), themed({
|
|
44
|
+
light: akEditorTableToolbar,
|
|
45
|
+
dark: akEditorTableToolbarDark
|
|
46
|
+
})(props), overflowShadow({
|
|
47
|
+
background: themed({
|
|
48
|
+
light: 'rgb(235, 237, 240)',
|
|
49
|
+
dark: 'rgb(36, 47, 66)'
|
|
50
|
+
})(props),
|
|
51
|
+
width: "".concat(gridSize(), "px")
|
|
52
|
+
}), themed({
|
|
46
53
|
light: 'rgb(235, 237, 240)',
|
|
47
54
|
dark: 'rgb(36, 47, 66)'
|
|
48
|
-
}),
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
})(props), themed({
|
|
56
|
+
light: 'rgb(226, 229, 233)',
|
|
57
|
+
dark: DN20
|
|
58
|
+
})(props), overflowShadow({
|
|
59
|
+
background: themed({
|
|
60
|
+
light: 'rgb(235, 237, 240)',
|
|
61
|
+
dark: 'rgb(36, 47, 66)'
|
|
62
|
+
})(props),
|
|
63
|
+
width: "".concat(gridSize(), "px")
|
|
64
|
+
}), themed({
|
|
58
65
|
light: 'rgb(235, 237, 240)',
|
|
59
66
|
dark: 'rgb(36, 47, 66)'
|
|
60
|
-
}),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
light: 'rgb(226, 229, 233)',
|
|
67
|
-
dark: DN20
|
|
68
|
-
}));
|
|
67
|
+
})(props), themed({
|
|
68
|
+
light: 'rgb(226, 229, 233)',
|
|
69
|
+
dark: DN20
|
|
70
|
+
})(props));
|
|
71
|
+
};
|
|
72
|
+
|
|
69
73
|
export var calcTableWidth = function calcTableWidth(layout, containerWidth) {
|
|
70
74
|
var addControllerPadding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
71
75
|
|
|
@@ -2,7 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
import { css } from '
|
|
5
|
+
import { css } from '@emotion/react';
|
|
6
6
|
import { akEditorTableCellMinWidth } from '@atlaskit/editor-shared-styles';
|
|
7
7
|
export var TaskDecisionSharedCssClassName = {
|
|
8
8
|
DECISION_CONTAINER: 'decisionItemView-content-wrap'
|
|
@@ -2,5 +2,5 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
import { css } from '
|
|
5
|
+
import { css } from '@emotion/react';
|
|
6
6
|
export var textColorStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .fabric-text-color-mark {\n color: var(--custom-text-color, inherit);\n }\n\n a .fabric-text-color-mark {\n color: unset;\n }\n"])));
|
|
@@ -2,6 +2,6 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
import { css } from '
|
|
5
|
+
import { css } from '@emotion/react';
|
|
6
6
|
var whitespaceSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n word-wrap: break-word;\n white-space: pre-wrap;\n"])));
|
|
7
7
|
export { whitespaceSharedStyles };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
import React, { useMemo } from 'react';
|
|
2
|
-
import { ThemeProvider } from '
|
|
3
|
+
import { ThemeProvider } from '@emotion/react';
|
|
4
|
+
import { ThemeProvider as DeprecatedThemeProvider } from 'styled-components';
|
|
3
5
|
import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
4
|
-
import {
|
|
6
|
+
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
7
|
+
import { CHANNEL, fontSize } from '@atlaskit/theme/constants';
|
|
5
8
|
import { WidthConsumer } from '../WidthProvider';
|
|
6
9
|
|
|
7
10
|
function mapBreakpointToFontSize(breakpoint) {
|
|
@@ -34,22 +37,30 @@ export function BaseThemeWrapper(_ref) {
|
|
|
34
37
|
dynamicTextSizing = _ref.dynamicTextSizing,
|
|
35
38
|
baseFontSize = _ref.baseFontSize,
|
|
36
39
|
children = _ref.children;
|
|
40
|
+
|
|
41
|
+
var _useGlobalTheme = useGlobalTheme(),
|
|
42
|
+
mode = _useGlobalTheme.mode;
|
|
43
|
+
|
|
37
44
|
var memoizedTheme = useMemo(function () {
|
|
38
|
-
return {
|
|
45
|
+
return _defineProperty({
|
|
39
46
|
baseFontSize: dynamicTextSizing ? mapBreakpointToFontSize(breakpoint) : baseFontSize || mapBreakpointToFontSize('S'),
|
|
40
47
|
layoutMaxWidth: dynamicTextSizing ? mapBreakpointToLayoutMaxWidth(breakpoint) : akEditorDefaultLayoutWidth
|
|
41
|
-
}
|
|
42
|
-
|
|
48
|
+
}, CHANNEL, {
|
|
49
|
+
mode: mode
|
|
50
|
+
});
|
|
51
|
+
}, [breakpoint, dynamicTextSizing, baseFontSize, mode]);
|
|
43
52
|
return /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
44
53
|
theme: memoizedTheme
|
|
45
|
-
},
|
|
54
|
+
}, /*#__PURE__*/React.createElement(DeprecatedThemeProvider, {
|
|
55
|
+
theme: memoizedTheme
|
|
56
|
+
}, children));
|
|
46
57
|
}
|
|
47
|
-
export function BaseTheme(
|
|
48
|
-
var children =
|
|
49
|
-
dynamicTextSizing =
|
|
50
|
-
baseFontSize =
|
|
51
|
-
return /*#__PURE__*/React.createElement(WidthConsumer, null, function (
|
|
52
|
-
var breakpoint =
|
|
58
|
+
export function BaseTheme(_ref3) {
|
|
59
|
+
var children = _ref3.children,
|
|
60
|
+
dynamicTextSizing = _ref3.dynamicTextSizing,
|
|
61
|
+
baseFontSize = _ref3.baseFontSize;
|
|
62
|
+
return /*#__PURE__*/React.createElement(WidthConsumer, null, function (_ref4) {
|
|
63
|
+
var breakpoint = _ref4.breakpoint;
|
|
53
64
|
return /*#__PURE__*/React.createElement(BaseThemeWrapper, {
|
|
54
65
|
dynamicTextSizing: dynamicTextSizing,
|
|
55
66
|
breakpoint: breakpoint,
|
|
@@ -12,13 +12,14 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
12
12
|
|
|
13
13
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
14
14
|
|
|
15
|
+
/** @jsx jsx */
|
|
15
16
|
import React from 'react';
|
|
17
|
+
import { css, jsx } from '@emotion/react';
|
|
16
18
|
import { injectIntl } from 'react-intl-next';
|
|
17
|
-
import styled from 'styled-components';
|
|
18
19
|
import { N200, N400 } from '@atlaskit/theme/colors';
|
|
19
20
|
import { messages } from './messages';
|
|
20
|
-
var
|
|
21
|
-
var
|
|
21
|
+
var captionWrapperStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-top: 8px;\n text-align: center;\n position: relative;\n color: ", ";\n"])), N400);
|
|
22
|
+
var placeholderStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: ", ";\n position: absolute;\n top: 0;\n width: 100%;\n"])), N200);
|
|
22
23
|
export var CaptionComponent = /*#__PURE__*/function (_React$Component) {
|
|
23
24
|
_inherits(CaptionComponent, _React$Component);
|
|
24
25
|
|
|
@@ -40,10 +41,14 @@ export var CaptionComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
40
41
|
dataAttributes = _this$props.dataAttributes,
|
|
41
42
|
formatMessage = _this$props.intl.formatMessage;
|
|
42
43
|
var showPlaceholder = !selected && !hasContent;
|
|
43
|
-
return
|
|
44
|
+
return jsx("div", _extends({
|
|
44
45
|
"data-media-caption": true,
|
|
45
46
|
"data-testid": "media-caption"
|
|
46
|
-
}, dataAttributes
|
|
47
|
+
}, dataAttributes, {
|
|
48
|
+
css: captionWrapperStyle
|
|
49
|
+
}), showPlaceholder ? jsx("p", {
|
|
50
|
+
css: placeholderStyle
|
|
51
|
+
}, formatMessage(messages.placeholder)) : null, children);
|
|
47
52
|
}
|
|
48
53
|
}]);
|
|
49
54
|
|
|
@@ -26,7 +26,8 @@ export default function MediaSingle(_ref) {
|
|
|
26
26
|
fullWidthMode = _ref.fullWidthMode,
|
|
27
27
|
lineLength = _ref.lineLength,
|
|
28
28
|
_ref$hasFallbackConta = _ref.hasFallbackContainer,
|
|
29
|
-
hasFallbackContainer = _ref$hasFallbackConta === void 0 ? true : _ref$hasFallbackConta
|
|
29
|
+
hasFallbackContainer = _ref$hasFallbackConta === void 0 ? true : _ref$hasFallbackConta,
|
|
30
|
+
handleMediaSingleRef = _ref.handleMediaSingleRef;
|
|
30
31
|
var children = React.Children.toArray(propsChildren);
|
|
31
32
|
|
|
32
33
|
if (!pctWidth && shouldAddDefaultWrappedWidth(layout, width, lineLength)) {
|
|
@@ -81,6 +82,7 @@ export default function MediaSingle(_ref) {
|
|
|
81
82
|
caption = _children[1];
|
|
82
83
|
|
|
83
84
|
return /*#__PURE__*/React.createElement(MediaSingleWrapper, {
|
|
85
|
+
innerRef: handleMediaSingleRef,
|
|
84
86
|
width: width,
|
|
85
87
|
layout: layout,
|
|
86
88
|
containerWidth: containerWidth,
|
|
@@ -2,6 +2,5 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
export var
|
|
7
|
-
MediaLink.displayName = 'MediaLink';
|
|
5
|
+
import { css } from '@emotion/react';
|
|
6
|
+
export var mediaLinkStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n background: transparent;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n cursor: pointer;\n width: 100%;\n height: 100%;\n"])));
|
|
@@ -31,7 +31,6 @@ var Mention = /*#__PURE__*/function (_PureComponent) {
|
|
|
31
31
|
accessLevel = _this$props.accessLevel,
|
|
32
32
|
eventHandlers = _this$props.eventHandlers,
|
|
33
33
|
id = _this$props.id,
|
|
34
|
-
portal = _this$props.portal,
|
|
35
34
|
text = _this$props.text;
|
|
36
35
|
var mentionProvider = providers.mentionProvider,
|
|
37
36
|
profilecardProvider = providers.profilecardProvider;
|
|
@@ -41,8 +40,7 @@ var Mention = /*#__PURE__*/function (_PureComponent) {
|
|
|
41
40
|
accessLevel: accessLevel,
|
|
42
41
|
eventHandlers: eventHandlers,
|
|
43
42
|
mentionProvider: mentionProvider,
|
|
44
|
-
profilecardProvider: profilecardProvider
|
|
45
|
-
portal: portal
|
|
43
|
+
profilecardProvider: profilecardProvider
|
|
46
44
|
});
|
|
47
45
|
});
|
|
48
46
|
|
|
@@ -1,190 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
|
|
10
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
|
-
|
|
12
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
|
-
|
|
14
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
15
|
-
|
|
16
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
17
|
-
|
|
18
|
-
import React, { PureComponent } from 'react';
|
|
19
|
-
import { findDOMNode } from 'react-dom';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
20
2
|
import { ResourcedMention } from '@atlaskit/mention';
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
_defineProperty(_assertThisInitialized(_this), "handleMentionNodeRef", function (component) {
|
|
56
|
-
if (!component) {
|
|
57
|
-
_this.domNode = null;
|
|
58
|
-
} else {
|
|
59
|
-
_this.domNode = findDOMNode(component);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
_defineProperty(_assertThisInitialized(_this), "showProfilecard", function (event) {
|
|
64
|
-
if (!_this.domNode) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
event.stopPropagation();
|
|
69
|
-
|
|
70
|
-
var _this$calculateLayerP = _this.calculateLayerPosition(),
|
|
71
|
-
_this$calculateLayerP2 = _slicedToArray(_this$calculateLayerP, 2),
|
|
72
|
-
popupAlignX = _this$calculateLayerP2[0],
|
|
73
|
-
popupAlignY = _this$calculateLayerP2[1];
|
|
74
|
-
|
|
75
|
-
_this.setState({
|
|
76
|
-
popupAlignX: popupAlignX,
|
|
77
|
-
popupAlignY: popupAlignY,
|
|
78
|
-
visible: true
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
_defineProperty(_assertThisInitialized(_this), "hideProfilecard", function () {
|
|
83
|
-
_this.setState({
|
|
84
|
-
visible: false
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
return _this;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
_createClass(MentionWithProfileCard, [{
|
|
92
|
-
key: "calculateLayerPosition",
|
|
93
|
-
value: function calculateLayerPosition() {
|
|
94
|
-
var domNodeCentreCoords = this.getDomNodeCenterCoords();
|
|
95
|
-
var visibleAreaCentreCoords = this.getVisibleAreaCentreCoords();
|
|
96
|
-
var popupAlignY = domNodeCentreCoords.y > visibleAreaCentreCoords.y ? 'top' : 'bottom';
|
|
97
|
-
var popupAlignX = domNodeCentreCoords.x > visibleAreaCentreCoords.x ? 'right' : 'left';
|
|
98
|
-
return [popupAlignX, popupAlignY];
|
|
99
|
-
}
|
|
100
|
-
}, {
|
|
101
|
-
key: "getDomNodeCenterCoords",
|
|
102
|
-
value: function getDomNodeCenterCoords() {
|
|
103
|
-
var rect = this.domNode.getBoundingClientRect();
|
|
104
|
-
return {
|
|
105
|
-
x: rect.left + rect.width / 2,
|
|
106
|
-
y: rect.top + rect.height / 2
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
}, {
|
|
110
|
-
key: "getVisibleAreaCentreCoords",
|
|
111
|
-
value: function getVisibleAreaCentreCoords() {
|
|
112
|
-
return {
|
|
113
|
-
x: window.innerWidth / 2,
|
|
114
|
-
y: window.innerHeight / 2
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
}, {
|
|
118
|
-
key: "getActions",
|
|
119
|
-
value: function getActions(id, text, accessLevel) {
|
|
120
|
-
var _this2 = this;
|
|
121
|
-
|
|
122
|
-
var profilecardProvider = this.props.profilecardProvider;
|
|
123
|
-
var actions = profilecardProvider.getActions(id, text, accessLevel);
|
|
124
|
-
return actions.map(function (action) {
|
|
125
|
-
return _objectSpread(_objectSpread({}, action), {}, {
|
|
126
|
-
callback: function callback() {
|
|
127
|
-
_this2.setState({
|
|
128
|
-
visible: false
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
if (action && action.callback) {
|
|
132
|
-
action.callback();
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
}, {
|
|
139
|
-
key: "render",
|
|
140
|
-
value: function render() {
|
|
141
|
-
var _this$props = this.props,
|
|
142
|
-
accessLevel = _this$props.accessLevel,
|
|
143
|
-
id = _this$props.id,
|
|
144
|
-
mentionProvider = _this$props.mentionProvider,
|
|
145
|
-
profilecardProvider = _this$props.profilecardProvider,
|
|
146
|
-
text = _this$props.text,
|
|
147
|
-
onClick = _this$props.onClick,
|
|
148
|
-
onMouseEnter = _this$props.onMouseEnter,
|
|
149
|
-
onMouseLeave = _this$props.onMouseLeave,
|
|
150
|
-
portal = _this$props.portal;
|
|
151
|
-
var _this$state = this.state,
|
|
152
|
-
popupAlignX = _this$state.popupAlignX,
|
|
153
|
-
popupAlignY = _this$state.popupAlignY,
|
|
154
|
-
target = _this$state.target,
|
|
155
|
-
visible = _this$state.visible;
|
|
156
|
-
var cloudId = profilecardProvider.cloudId,
|
|
157
|
-
resourceClient = profilecardProvider.resourceClient;
|
|
158
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
159
|
-
ref: this.handleRef,
|
|
160
|
-
onClick: this.showProfilecard
|
|
161
|
-
}, /*#__PURE__*/React.createElement(ResourcedMention, {
|
|
162
|
-
ref: this.handleMentionNodeRef,
|
|
163
|
-
id: id,
|
|
164
|
-
text: text,
|
|
165
|
-
accessLevel: accessLevel,
|
|
166
|
-
mentionProvider: mentionProvider,
|
|
167
|
-
onClick: onClick,
|
|
168
|
-
onMouseEnter: onMouseEnter,
|
|
169
|
-
onMouseLeave: onMouseLeave
|
|
170
|
-
}), target && portal && visible && /*#__PURE__*/React.createElement(Popup, {
|
|
171
|
-
offset: [0, 8],
|
|
172
|
-
target: target,
|
|
173
|
-
mountTo: portal,
|
|
174
|
-
alignX: popupAlignX,
|
|
175
|
-
alignY: popupAlignY
|
|
176
|
-
}, /*#__PURE__*/React.createElement(ProfilecardResourcedWithListeners, {
|
|
177
|
-
handleClickOutside: this.hideProfilecard,
|
|
178
|
-
handleEscapeKeydown: this.hideProfilecard,
|
|
179
|
-
cloudId: cloudId,
|
|
180
|
-
userId: id,
|
|
181
|
-
resourceClient: resourceClient,
|
|
182
|
-
actions: this.getActions(id, text, accessLevel)
|
|
183
|
-
})));
|
|
184
|
-
}
|
|
185
|
-
}]);
|
|
186
|
-
|
|
187
|
-
return MentionWithProfileCard;
|
|
188
|
-
}(PureComponent);
|
|
189
|
-
|
|
190
|
-
export { MentionWithProfileCard as default };
|
|
3
|
+
import { ProfileCardTrigger } from '@atlaskit/profilecard';
|
|
4
|
+
export default function MentionWithProfileCard(_ref) {
|
|
5
|
+
var id = _ref.id,
|
|
6
|
+
text = _ref.text,
|
|
7
|
+
accessLevel = _ref.accessLevel,
|
|
8
|
+
mentionProvider = _ref.mentionProvider,
|
|
9
|
+
profilecardProvider = _ref.profilecardProvider,
|
|
10
|
+
onClick = _ref.onClick,
|
|
11
|
+
onMouseEnter = _ref.onMouseEnter,
|
|
12
|
+
onMouseLeave = _ref.onMouseLeave;
|
|
13
|
+
var cloudId = profilecardProvider.cloudId,
|
|
14
|
+
resourceClient = profilecardProvider.resourceClient;
|
|
15
|
+
var actions = useMemo(function () {
|
|
16
|
+
return profilecardProvider.getActions(id, text, accessLevel);
|
|
17
|
+
}, [accessLevel, id, profilecardProvider, text]);
|
|
18
|
+
return /*#__PURE__*/React.createElement(ProfileCardTrigger, {
|
|
19
|
+
cloudId: cloudId,
|
|
20
|
+
userId: id,
|
|
21
|
+
resourceClient: resourceClient,
|
|
22
|
+
actions: actions,
|
|
23
|
+
trigger: "click",
|
|
24
|
+
position: "bottom-end"
|
|
25
|
+
}, /*#__PURE__*/React.createElement(ResourcedMention, {
|
|
26
|
+
id: id,
|
|
27
|
+
text: text,
|
|
28
|
+
accessLevel: accessLevel,
|
|
29
|
+
mentionProvider: mentionProvider,
|
|
30
|
+
onClick: onClick,
|
|
31
|
+
onMouseEnter: onMouseEnter,
|
|
32
|
+
onMouseLeave: onMouseLeave
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
@@ -83,11 +83,9 @@ var MentionWithProviders = /*#__PURE__*/function (_PureComponent) {
|
|
|
83
83
|
value: function render() {
|
|
84
84
|
var _this$props = this.props,
|
|
85
85
|
accessLevel = _this$props.accessLevel,
|
|
86
|
-
userType = _this$props.userType,
|
|
87
86
|
eventHandlers = _this$props.eventHandlers,
|
|
88
87
|
id = _this$props.id,
|
|
89
88
|
mentionProvider = _this$props.mentionProvider,
|
|
90
|
-
portal = _this$props.portal,
|
|
91
89
|
text = _this$props.text;
|
|
92
90
|
var profilecardProvider = this.state.profilecardProvider;
|
|
93
91
|
var actionHandlers = {};
|
|
@@ -99,10 +97,8 @@ var MentionWithProviders = /*#__PURE__*/function (_PureComponent) {
|
|
|
99
97
|
id: id,
|
|
100
98
|
text: text,
|
|
101
99
|
accessLevel: accessLevel,
|
|
102
|
-
userType: userType,
|
|
103
100
|
mentionProvider: mentionProvider,
|
|
104
|
-
profilecardProvider: profilecardProvider
|
|
105
|
-
portal: portal
|
|
101
|
+
profilecardProvider: profilecardProvider
|
|
106
102
|
}, actionHandlers));
|
|
107
103
|
}
|
|
108
104
|
}]);
|