@atlaskit/renderer 82.1.0 → 84.1.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 +101 -0
- package/dist/cjs/actions/matches-utils.js +1 -1
- package/dist/cjs/analytics/enums.js +2 -1
- package/dist/cjs/analytics/events.js +1 -1
- package/dist/cjs/i18n/index.js +26 -26
- package/dist/cjs/index.js +8 -8
- package/dist/cjs/messages.js +4 -4
- package/dist/cjs/react/index.js +32 -12
- package/dist/cjs/react/marks/annotation.js +1 -1
- package/dist/cjs/react/marks/breakout.js +1 -1
- package/dist/cjs/react/marks/code.js +11 -4
- package/dist/cjs/react/marks/fragment.js +21 -0
- package/dist/cjs/react/marks/index.js +28 -19
- package/dist/cjs/react/marks/textColor.js +15 -4
- package/dist/cjs/react/nodes/codeBlock.js +6 -4
- package/dist/cjs/react/nodes/codeBlockCopyButton.js +2 -2
- package/dist/cjs/react/nodes/copy-text-provider.js +1 -1
- package/dist/cjs/react/nodes/date.js +2 -2
- package/dist/cjs/react/nodes/doc.js +1 -1
- package/dist/cjs/react/nodes/extension.js +1 -1
- package/dist/cjs/react/nodes/heading-anchor.js +2 -2
- package/dist/cjs/react/nodes/heading.js +2 -4
- package/dist/cjs/react/nodes/index.js +31 -22
- package/dist/cjs/react/nodes/media.js +4 -2
- package/dist/cjs/react/nodes/mediaSingle/index.js +3 -3
- package/dist/cjs/react/nodes/panel.js +4 -6
- package/dist/cjs/react/nodes/table/colgroup.js +1 -1
- package/dist/cjs/react/nodes/table/sticky.js +1 -1
- package/dist/cjs/react/nodes/tableCell.js +1 -1
- package/dist/cjs/react/nodes/text-wrapper.js +5 -6
- package/dist/cjs/react/renderer-node.js +1 -1
- package/dist/cjs/react/utils/links.js +1 -1
- package/dist/cjs/render-document.js +21 -1
- package/dist/cjs/renderer-context.js +1 -1
- package/dist/cjs/steps/index.js +2 -2
- package/dist/cjs/text/nodes/index.js +1 -1
- package/dist/cjs/ui/Expand.js +2 -2
- package/dist/cjs/ui/MediaCard.js +12 -6
- package/dist/cjs/ui/Renderer/breakout-ssr.js +1 -1
- package/dist/cjs/ui/Renderer/index.js +11 -11
- package/dist/cjs/ui/Renderer/style.js +9 -7
- package/dist/cjs/ui/RendererActionsContext/index.js +1 -1
- package/dist/cjs/ui/SortingIcon.js +2 -2
- package/dist/cjs/ui/active-header-id-provider.js +1 -1
- package/dist/cjs/ui/annotations/context.js +1 -1
- package/dist/cjs/ui/annotations/draft/component.js +7 -7
- package/dist/cjs/ui/annotations/draft/index.js +4 -4
- package/dist/cjs/ui/annotations/draft/text.js +1 -1
- package/dist/cjs/ui/annotations/hooks/index.js +8 -8
- package/dist/cjs/ui/annotations/hooks/use-events.js +4 -2
- package/dist/cjs/ui/annotations/index.js +5 -5
- package/dist/cjs/utils.js +2 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics/enums.js +1 -0
- package/dist/es2019/messages.js +1 -1
- package/dist/es2019/react/index.js +29 -8
- package/dist/es2019/react/marks/code.js +6 -2
- package/dist/es2019/react/marks/fragment.js +10 -0
- package/dist/es2019/react/marks/index.js +4 -2
- package/dist/es2019/react/marks/textColor.js +7 -4
- package/dist/es2019/react/nodes/codeBlock.js +5 -3
- package/dist/es2019/react/nodes/codeBlockCopyButton.js +1 -1
- package/dist/es2019/react/nodes/date.js +1 -1
- package/dist/es2019/react/nodes/heading-anchor.js +1 -1
- package/dist/es2019/react/nodes/heading.js +2 -3
- package/dist/es2019/react/nodes/media.js +4 -2
- package/dist/es2019/react/nodes/mediaSingle/index.js +1 -1
- package/dist/es2019/react/nodes/panel.js +5 -6
- package/dist/es2019/react/nodes/text-wrapper.js +7 -6
- package/dist/es2019/render-document.js +19 -1
- package/dist/es2019/ui/Expand.js +1 -1
- package/dist/es2019/ui/MediaCard.js +11 -5
- package/dist/es2019/ui/Renderer/index.js +10 -10
- package/dist/es2019/ui/Renderer/style.js +4 -2
- package/dist/es2019/ui/SortingIcon.js +1 -1
- package/dist/es2019/ui/annotations/draft/component.js +6 -6
- package/dist/es2019/ui/annotations/hooks/use-events.js +3 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics/enums.js +1 -0
- package/dist/esm/messages.js +1 -1
- package/dist/esm/react/index.js +31 -12
- package/dist/esm/react/marks/code.js +6 -2
- package/dist/esm/react/marks/fragment.js +10 -0
- package/dist/esm/react/marks/index.js +4 -2
- package/dist/esm/react/marks/textColor.js +8 -4
- package/dist/esm/react/nodes/codeBlock.js +5 -3
- package/dist/esm/react/nodes/codeBlockCopyButton.js +1 -1
- package/dist/esm/react/nodes/date.js +1 -1
- package/dist/esm/react/nodes/heading-anchor.js +1 -1
- package/dist/esm/react/nodes/heading.js +2 -3
- package/dist/esm/react/nodes/media.js +4 -2
- package/dist/esm/react/nodes/mediaSingle/index.js +1 -1
- package/dist/esm/react/nodes/panel.js +5 -6
- package/dist/esm/react/nodes/text-wrapper.js +7 -6
- package/dist/esm/render-document.js +19 -1
- package/dist/esm/ui/Expand.js +1 -1
- package/dist/esm/ui/MediaCard.js +11 -5
- package/dist/esm/ui/Renderer/index.js +10 -10
- package/dist/esm/ui/Renderer/style.js +4 -3
- package/dist/esm/ui/SortingIcon.js +1 -1
- package/dist/esm/ui/annotations/draft/component.js +6 -6
- package/dist/esm/ui/annotations/hooks/use-events.js +3 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/enums.d.ts +1 -0
- package/dist/types/analytics/events.d.ts +5 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/react/index.d.ts +1 -0
- package/dist/types/react/marks/alignment.d.ts +1 -0
- package/dist/types/react/marks/annotation.d.ts +1 -0
- package/dist/types/react/marks/code.d.ts +12 -4
- package/dist/types/react/marks/data-consumer.d.ts +1 -0
- package/dist/types/react/marks/em.d.ts +1 -0
- package/dist/types/react/marks/fragment.d.ts +4 -0
- package/dist/types/react/marks/indentation.d.ts +1 -0
- package/dist/types/react/marks/index.d.ts +2 -1
- package/dist/types/react/marks/link.d.ts +1 -0
- package/dist/types/react/marks/strike.d.ts +1 -0
- package/dist/types/react/marks/strong.d.ts +1 -0
- package/dist/types/react/marks/subsup.d.ts +1 -0
- package/dist/types/react/marks/textColor.d.ts +1 -0
- package/dist/types/react/marks/underline.d.ts +1 -0
- package/dist/types/react/marks/unsupportedMark.d.ts +1 -0
- package/dist/types/react/marks/unsupportedNodeAttribute.d.ts +1 -0
- package/dist/types/react/nodes/blockCard.d.ts +1 -0
- package/dist/types/react/nodes/caption.d.ts +1 -0
- package/dist/types/react/nodes/codeBlock.d.ts +12 -3
- package/dist/types/react/nodes/codeBlockCopyButton.d.ts +3 -3
- package/dist/types/react/nodes/date.d.ts +3 -3
- package/dist/types/react/nodes/decisionItem.d.ts +1 -0
- package/dist/types/react/nodes/doc.d.ts +1 -0
- package/dist/types/react/nodes/embedCard.d.ts +1 -0
- package/dist/types/react/nodes/heading-anchor.d.ts +4 -4
- package/dist/types/react/nodes/heading.d.ts +1 -0
- package/dist/types/react/nodes/index.d.ts +8 -8
- package/dist/types/react/nodes/mediaSingle/index.d.ts +3 -3
- package/dist/types/react/nodes/paragraph.d.ts +1 -0
- package/dist/types/react/nodes/placeholder.d.ts +1 -0
- package/dist/types/react/nodes/rule.d.ts +1 -0
- package/dist/types/react/nodes/table/colgroup.d.ts +1 -0
- package/dist/types/react/nodes/text-wrapper.d.ts +3 -3
- package/dist/types/types/mediaOptions.d.ts +7 -1
- package/dist/types/ui/Expand.d.ts +3 -3
- package/dist/types/ui/MediaCard.d.ts +2 -0
- package/dist/types/ui/Renderer/breakout-ssr.d.ts +1 -0
- package/dist/types/ui/SortingIcon.d.ts +1 -0
- package/dist/types/ui/annotations/draft/component.d.ts +1 -1
- package/dist/types/ui/renderer-props.d.ts +1 -1
- package/package.json +23 -23
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.
|
|
10
|
+
exports.headingSizes = exports.Wrapper = exports.FullPagePadding = void 0;
|
|
11
11
|
|
|
12
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
13
|
|
|
@@ -21,7 +21,9 @@ var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
|
|
|
21
21
|
|
|
22
22
|
var _typography = require("@atlaskit/theme/typography");
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _styles = require("@atlaskit/editor-common/styles");
|
|
25
|
+
|
|
26
|
+
var _ui = require("@atlaskit/editor-common/ui");
|
|
25
27
|
|
|
26
28
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
27
29
|
|
|
@@ -92,7 +94,7 @@ var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
|
|
|
92
94
|
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(_headingAnchor.HeadingAnchorWrapperClassName, " {\n position: unset;\n }\n > {\n h1, h2, h3, h4, h5, h6 {\n margin-right: 30px;\n }\n }\n ");
|
|
93
95
|
}
|
|
94
96
|
|
|
95
|
-
return "\n .".concat(_consts.RendererCssClassName.SORTABLE_COLUMN, " {\n padding: 0;\n\n .").concat(_consts.RendererCssClassName.SORTABLE_COLUMN_BUTTON, " {\n width: 100%;\n height: 100%;\n cursor: pointer;\n padding: ").concat(
|
|
97
|
+
return "\n .".concat(_consts.RendererCssClassName.SORTABLE_COLUMN, " {\n padding: 0;\n\n .").concat(_consts.RendererCssClassName.SORTABLE_COLUMN_BUTTON, " {\n width: 100%;\n height: 100%;\n cursor: pointer;\n padding: ").concat(_styles.tableCellPadding, "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.-right:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + * {\n margin-top: 0;\n }\n\n @supports selector(:focus-visible) {\n &:focus {\n outline: unset;\n }\n &:focus-visible {\n border-color: ").concat(colors.B300, ";\n }\n }\n\n ").concat(headingsCss, "\n }\n\n &.").concat(_consts.RendererCssClassName.SORTABLE_COLUMN_NOT_ALLOWED, " .").concat(_consts.RendererCssClassName.SORTABLE_COLUMN_BUTTON, " {\n cursor: default;\n }\n\n .").concat(_consts.RendererCssClassName.SORTABLE_COLUMN_ICON, " {\n margin: 0;\n opacity: 1;\n transition: opacity 0.2s ease-in-out;\n }\n\n .").concat(_consts.RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, " {\n opacity: 0;\n }\n\n &:hover {\n .").concat(_consts.RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, " {\n opacity: 1;\n }\n }\n }\n ");
|
|
96
98
|
};
|
|
97
99
|
|
|
98
100
|
var fullPageStyles = function fullPageStyles(_ref3) {
|
|
@@ -117,16 +119,16 @@ var fullWidthStyles = function fullWidthStyles(_ref4) {
|
|
|
117
119
|
}; // prettier-ignore
|
|
118
120
|
|
|
119
121
|
|
|
120
|
-
var Wrapper = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n font-size: ", "px;\n line-height: 1.5rem;\n color: ", ";\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\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 + .", ":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 + .rich-media-wrapped + *: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\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 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 .", " {\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, &.", "::before {\n top: ", "px;\n height: calc(100% - ", "px);\n z-index: ", ";\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-child {\n height: 100%;\n\n td, th {\n position: relative;\n }\n }\n\n table[data-number-column='true'] {\n .", " {\n background-color: ", ";\n border-right: 1px solid ", ";\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 border-bottom: 1px solid ", ";\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, .sticky td {\n box-shadow: 0px 1px ", ", 0px -0.5px ", ", inset -1px 0px ", ", 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 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 & [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"])), _editorSharedStyles.editorFontSize, (0, _components.themed)({
|
|
122
|
+
var Wrapper = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n font-size: ", "px;\n line-height: 1.5rem;\n color: ", ";\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\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\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 + .", ":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 + .rich-media-wrapped + *: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\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 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 .", " {\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, &.", "::before {\n top: ", "px;\n height: calc(100% - ", "px);\n z-index: ", ";\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-child {\n height: 100%;\n\n td, th {\n position: relative;\n }\n }\n\n table[data-number-column='true'] {\n .", " {\n background-color: ", ";\n border-right: 1px solid ", ";\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 border-bottom: 1px solid ", ";\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, .sticky td {\n box-shadow: 0px 1px ", ", 0px -0.5px ", ", inset -1px 0px ", ", 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, .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 & [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"])), _editorSharedStyles.editorFontSize, (0, _components.themed)({
|
|
121
123
|
light: colors.N800,
|
|
122
124
|
dark: '#B8C7E0'
|
|
123
|
-
}), fullPageStyles, fullWidthStyles, headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), colors.B400, colors.B300, colors.placeholderText,
|
|
125
|
+
}), fullPageStyles, fullWidthStyles, headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), colors.B400, colors.B300, colors.placeholderText, _styles.whitespaceSharedStyles, _styles.blockquoteSharedStyles, _styles.headingsSharedStyles, _styles.panelSharedStyles, _styles.ruleSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.blockMarksSharedStyles, _styles.codeMarkSharedStyles, _styles.shadowSharedStyle, _styles.dateSharedStyle, _styles.textColorStyles, _styles.tasksAndDecisionsStyles, _styles.smartCardSharedStyles, (0, _constants.fontFamily)(), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _components.themed)({
|
|
124
126
|
light: colors.N30A,
|
|
125
127
|
dark: colors.DN70
|
|
126
128
|
}), (0, _constants.borderRadius)(), (0, _components.themed)({
|
|
127
129
|
light: colors.N800,
|
|
128
130
|
dark: colors.DN600
|
|
129
|
-
}), colors.R50, colors.R500, (0, _constants.gridSize)() * 3,
|
|
131
|
+
}), colors.R50, colors.R500, (0, _constants.gridSize)() * 3, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, alignedHeadingAnchorStyle, _styles.mediaSingleSharedStyle, _consts.RendererCssClassName.DOCUMENT, _styles.TableSharedCssClassName.TABLE_CONTAINER, _consts.RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, _consts.RendererCssClassName.EXTENSION, _consts.RendererCssClassName.EXTENSION, _editorSharedStyles.blockNodesVerticalMargin, _consts.RendererCssClassName.EXTENSION_CENTER_ALIGN, _styles.TableSharedCssClassName.TABLE_NODE_WRAPPER, _styles.tableSharedStyle, _styles.TableSharedCssClassName.TABLE_CONTAINER, _ui.shadowClassNames.RIGHT_SHADOW, _ui.shadowClassNames.LEFT_SHADOW, _styles.tableMarginTop - 1, _styles.tableMarginTop, _editorSharedStyles.akEditorStickyHeaderZIndex, tableSortableColumnStyle, _consts.RendererCssClassName.NUMBER_COLUMN, (0, _components.themed)({
|
|
130
132
|
light: _editorSharedStyles.akEditorTableToolbar,
|
|
131
133
|
dark: _editorSharedStyles.akEditorTableToolbarDark
|
|
132
134
|
}), (0, _components.themed)({
|
|
@@ -153,6 +155,6 @@ var Wrapper = _styledComponents.default.div(_templateObject2 || (_templateObject
|
|
|
153
155
|
}), (0, _components.themed)({
|
|
154
156
|
light: _editorSharedStyles.akEditorTableToolbar,
|
|
155
157
|
dark: _editorSharedStyles.akEditorTableToolbarDark
|
|
156
|
-
}), (0, _constants.borderRadius)(), _editorSharedStyles.blockNodesVerticalMargin,
|
|
158
|
+
}), (0, _constants.borderRadius)(), _editorSharedStyles.blockNodesVerticalMargin, _styles.columnLayoutSharedStyle, (0, _constants.gridSize)() * 2.5, (0, _constants.gridSize)() * 4, _editorSharedStyles.gridMediumMaxWidth);
|
|
157
159
|
|
|
158
160
|
exports.Wrapper = Wrapper;
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
10
|
exports.RendererActionsContext = RendererActionsContext;
|
|
11
|
-
exports.
|
|
11
|
+
exports.RendererContext = exports.RendererActionsContextConsumer = void 0;
|
|
12
12
|
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default = exports.
|
|
8
|
+
exports.default = exports.TableSortIconDataUrl = exports.StatusClassNames = void 0;
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
@@ -41,7 +41,7 @@ exports.StatusClassNames = StatusClassNames;
|
|
|
41
41
|
|
|
42
42
|
var Wrapper = _styledComponents.default.figure(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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 #fff;\n border-radius: ", "px;\n background-color: ", ";\n justify-content: center;\n align-items: center;\n\n &:hover {\n background-color: ", ";\n }\n\n &.", " {\n cursor: not-allowed;\n }\n"])), (0, _constants.gridSize)() / 2, _colors.N20, _colors.N30, StatusClassNames.SORTING_NOT_ALLOWED);
|
|
43
43
|
|
|
44
|
-
var TableSortingIcon = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\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 background-image: url(", ");\n\n &.", " {\n transform: rotate(-180deg);\n }\n\n &.", "-inactive {\n opacity: 0.
|
|
44
|
+
var TableSortingIcon = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\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 background-image: url(", ");\n\n &.", " {\n transform: rotate(-180deg);\n }\n\n &.", "-inactive {\n opacity: 0.7;\n }\n"])), TableSortIconDataUrl, StatusClassNames.DESC, TABLE_SORTING_ICON_CLASS);
|
|
45
45
|
|
|
46
46
|
var getClassName = function getClassName(status) {
|
|
47
47
|
switch (status) {
|
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.
|
|
10
|
+
exports.ActiveHeaderIdProvider = exports.ActiveHeaderIdConsumer = void 0;
|
|
11
11
|
|
|
12
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
13
|
|
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.
|
|
10
|
+
exports.ProvidersContext = exports.InlineCommentsStateContext = exports.AnnotationsDraftContextWrapper = exports.AnnotationsDraftContext = void 0;
|
|
11
11
|
|
|
12
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
13
|
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.getAnnotationIndex = exports.applyAnnotationOnText = exports.TextWithAnnotationDraft = exports.AnnotationDraft = void 0;
|
|
9
9
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
@@ -83,7 +83,7 @@ exports.applyAnnotationOnText = applyAnnotationOnText;
|
|
|
83
83
|
var TextWithAnnotationDraft = function TextWithAnnotationDraft(_ref3) {
|
|
84
84
|
var startPos = _ref3.startPos,
|
|
85
85
|
endPos = _ref3.endPos,
|
|
86
|
-
|
|
86
|
+
children = _ref3.children;
|
|
87
87
|
|
|
88
88
|
var textPosition = _react.default.useMemo(function () {
|
|
89
89
|
return {
|
|
@@ -103,21 +103,21 @@ var TextWithAnnotationDraft = function TextWithAnnotationDraft(_ref3) {
|
|
|
103
103
|
}, [nextDraftPosition, textPosition]);
|
|
104
104
|
|
|
105
105
|
if (shouldApplyAnnotationAt === false || !nextDraftPosition) {
|
|
106
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null,
|
|
106
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
if (shouldApplyAnnotationAt === _types.InsertDraftPosition.AROUND_TEXT) {
|
|
110
110
|
return /*#__PURE__*/_react.default.createElement(AnnotationDraft, {
|
|
111
111
|
key: 0,
|
|
112
112
|
draftPosition: nextDraftPosition
|
|
113
|
-
},
|
|
113
|
+
}, children);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
var offsets = (0, _text.calcTextSplitOffset)(nextDraftPosition, textPosition,
|
|
117
|
-
var texts = (0, _text.splitText)(
|
|
116
|
+
var offsets = (0, _text.calcTextSplitOffset)(nextDraftPosition, textPosition, children);
|
|
117
|
+
var texts = (0, _text.splitText)(children, offsets);
|
|
118
118
|
|
|
119
119
|
if (!texts) {
|
|
120
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null,
|
|
120
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
var components = applyAnnotationOnText({
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "TextWithAnnotationDraft", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _component.TextWithAnnotationDraft;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "updateWindowSelectionAroundDraft", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function get() {
|
|
15
|
-
return
|
|
15
|
+
return _dom.updateWindowSelectionAroundDraft;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.splitText = exports.calcTextSplitOffset = void 0;
|
|
7
7
|
|
|
8
8
|
var splitText = function splitText(text, _ref) {
|
|
9
9
|
var startOffset = _ref.startOffset,
|
|
@@ -3,22 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "useHasFocusEvent", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _useEvents.useHasFocusEvent;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
6
|
Object.defineProperty(exports, "useAnnotationClickEvent", {
|
|
13
7
|
enumerable: true,
|
|
14
8
|
get: function get() {
|
|
15
9
|
return _useEvents.useAnnotationClickEvent;
|
|
16
10
|
}
|
|
17
11
|
});
|
|
18
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "useHasFocusEvent", {
|
|
19
13
|
enumerable: true,
|
|
20
14
|
get: function get() {
|
|
21
|
-
return
|
|
15
|
+
return _useEvents.useHasFocusEvent;
|
|
22
16
|
}
|
|
23
17
|
});
|
|
24
18
|
Object.defineProperty(exports, "useInlineCommentSubscriberContext", {
|
|
@@ -27,6 +21,12 @@ Object.defineProperty(exports, "useInlineCommentSubscriberContext", {
|
|
|
27
21
|
return _useInlineCommentSubscriber.useInlineCommentSubscriberContext;
|
|
28
22
|
}
|
|
29
23
|
});
|
|
24
|
+
Object.defineProperty(exports, "useInlineCommentsFilter", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _useInlineCommentsFilter.useInlineCommentsFilter;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
30
|
|
|
31
31
|
var _useEvents = require("./use-events");
|
|
32
32
|
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.useHasFocusEvent = exports.useAnnotationStateByTypeEvent = exports.useAnnotationClickEvent = void 0;
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
@@ -46,7 +46,9 @@ var useAnnotationStateByTypeEvent = function useAnnotationStateByTypeEvent(_ref)
|
|
|
46
46
|
|
|
47
47
|
var nextStates = Object.values(payload).reduce(function (acc, curr) {
|
|
48
48
|
if (curr.annotationType === type) {
|
|
49
|
-
|
|
49
|
+
// Check for empty state to prevent additional renders
|
|
50
|
+
var isEmpty = curr.state === null || curr.state === undefined;
|
|
51
|
+
return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, curr.id, !isEmpty ? curr.state : states[curr.id]));
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
return acc;
|
|
@@ -5,19 +5,19 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
Object.defineProperty(exports, "
|
|
8
|
+
Object.defineProperty(exports, "AnnotationMark", {
|
|
9
9
|
enumerable: true,
|
|
10
10
|
get: function get() {
|
|
11
|
-
return
|
|
11
|
+
return _element.MarkElement;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
-
|
|
14
|
+
exports.AnnotationsWrapper = void 0;
|
|
15
|
+
Object.defineProperty(exports, "TextWithAnnotationDraft", {
|
|
15
16
|
enumerable: true,
|
|
16
17
|
get: function get() {
|
|
17
|
-
return
|
|
18
|
+
return _draft.TextWithAnnotationDraft;
|
|
18
19
|
}
|
|
19
20
|
});
|
|
20
|
-
exports.AnnotationsWrapper = void 0;
|
|
21
21
|
|
|
22
22
|
var _react = _interopRequireDefault(require("react"));
|
|
23
23
|
|
package/dist/cjs/utils.js
CHANGED
|
@@ -5,9 +5,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
+
exports.ADFEncoder = void 0;
|
|
8
9
|
exports.findHorizontalOverflowScrollParent = findHorizontalOverflowScrollParent;
|
|
9
10
|
exports.findInTree = findInTree;
|
|
10
|
-
exports.
|
|
11
|
+
exports.getText = exports.getPlatform = exports.getEventHandler = void 0;
|
|
11
12
|
|
|
12
13
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
14
|
|
package/dist/cjs/version.json
CHANGED
|
@@ -13,6 +13,7 @@ export let ACTION;
|
|
|
13
13
|
ACTION["STARTED"] = "started";
|
|
14
14
|
ACTION["RENDERED"] = "rendered";
|
|
15
15
|
ACTION["CRASHED"] = "unhandledErrorCaught";
|
|
16
|
+
ACTION["INVALID_PROSEMIRROR_DOCUMENT"] = "invalidProsemirrorDocument";
|
|
16
17
|
ACTION["SELECT_ALL_CAUGHT"] = "selectAllCaught";
|
|
17
18
|
ACTION["SELECT_ALL_ESCAPED"] = "selectAllEscaped";
|
|
18
19
|
ACTION["CLICKED"] = "clicked";
|
package/dist/es2019/messages.js
CHANGED
|
@@ -10,6 +10,7 @@ import { getMarksByOrder, isSameMark, calcTableColumnWidths } from '@atlaskit/ed
|
|
|
10
10
|
import { getText } from '../utils';
|
|
11
11
|
import { findChildrenByType } from 'prosemirror-utils';
|
|
12
12
|
import { insideBreakoutLayout } from './renderer-node';
|
|
13
|
+
import { isCodeMark } from './marks/code';
|
|
13
14
|
|
|
14
15
|
function mergeMarks(marksAndNodes) {
|
|
15
16
|
return marksAndNodes.reduce((acc, markOrNode) => {
|
|
@@ -128,13 +129,23 @@ export default class ReactSerializer {
|
|
|
128
129
|
} = mark.attrs;
|
|
129
130
|
const extraProps = {
|
|
130
131
|
isInline: node === null || node === void 0 ? void 0 : node.isInline
|
|
131
|
-
};
|
|
132
|
+
}; // currently the only mark which has custom props is the code mark
|
|
133
|
+
|
|
134
|
+
const markSpecificProps = isCodeMark(mark) ? {
|
|
135
|
+
// The appearance being mobile indicates we are in an renderer being
|
|
136
|
+
// rendered by mobile bridge in a web view.
|
|
137
|
+
// The tooltip is likely to have unexpected behaviour there, with being cut
|
|
138
|
+
// off, so we disable it. This is also to keep the behaviour consistent with
|
|
139
|
+
// the rendering in the mobile Native Renderer.
|
|
140
|
+
codeBidiWarningTooltipEnabled: this.appearance !== 'mobile'
|
|
141
|
+
} : {};
|
|
132
142
|
const props = {
|
|
133
143
|
eventHandlers: this.eventHandlers,
|
|
134
144
|
fireAnalyticsEvent: this.fireAnalyticsEvent,
|
|
135
145
|
markKey: key,
|
|
136
146
|
...otherAttrs,
|
|
137
147
|
...extraProps,
|
|
148
|
+
...markSpecificProps,
|
|
138
149
|
dataAttributes: {
|
|
139
150
|
'data-renderer-mark': true
|
|
140
151
|
}
|
|
@@ -299,9 +310,8 @@ export default class ReactSerializer {
|
|
|
299
310
|
return /*#__PURE__*/React.createElement(TextWrapperComponent, {
|
|
300
311
|
key: textKey,
|
|
301
312
|
startPos: startPos + parentDepth,
|
|
302
|
-
endPos: endPos + parentDepth
|
|
303
|
-
|
|
304
|
-
});
|
|
313
|
+
endPos: endPos + parentDepth
|
|
314
|
+
}, mark.text);
|
|
305
315
|
}
|
|
306
316
|
|
|
307
317
|
return mark.text || '';
|
|
@@ -369,6 +379,8 @@ export default class ReactSerializer {
|
|
|
369
379
|
}
|
|
370
380
|
|
|
371
381
|
getMediaProps(node, path = []) {
|
|
382
|
+
var _this$media;
|
|
383
|
+
|
|
372
384
|
const {
|
|
373
385
|
marks: {
|
|
374
386
|
link
|
|
@@ -382,7 +394,8 @@ export default class ReactSerializer {
|
|
|
382
394
|
isLinkMark,
|
|
383
395
|
allowAltTextOnImages: this.allowAltTextOnImages,
|
|
384
396
|
featureFlags: this.media && this.media.featureFlags,
|
|
385
|
-
shouldOpenMediaViewer: this.shouldOpenMediaViewer
|
|
397
|
+
shouldOpenMediaViewer: this.shouldOpenMediaViewer,
|
|
398
|
+
ssr: (_this$media = this.media) === null || _this$media === void 0 ? void 0 : _this$media.ssr
|
|
386
399
|
};
|
|
387
400
|
}
|
|
388
401
|
|
|
@@ -403,13 +416,14 @@ export default class ReactSerializer {
|
|
|
403
416
|
}
|
|
404
417
|
|
|
405
418
|
getMediaGroupProps(node) {
|
|
406
|
-
var _this$
|
|
419
|
+
var _this$media2, _this$media3;
|
|
407
420
|
|
|
408
421
|
return { ...this.getProps(node),
|
|
409
422
|
shouldOpenMediaViewer: this.shouldOpenMediaViewer,
|
|
410
423
|
allowAltTextOnImages: this.allowAltTextOnImages,
|
|
411
424
|
featureFlags: this.media && this.media.featureFlags,
|
|
412
|
-
enableDownloadButton: (_this$
|
|
425
|
+
enableDownloadButton: (_this$media2 = this.media) === null || _this$media2 === void 0 ? void 0 : _this$media2.enableDownloadButton,
|
|
426
|
+
ssr: (_this$media3 = this.media) === null || _this$media3 === void 0 ? void 0 : _this$media3.ssr
|
|
413
427
|
};
|
|
414
428
|
}
|
|
415
429
|
|
|
@@ -438,8 +452,15 @@ export default class ReactSerializer {
|
|
|
438
452
|
}
|
|
439
453
|
|
|
440
454
|
getCodeBlockProps(node) {
|
|
455
|
+
// The appearance being mobile indicates we are in an renderer being
|
|
456
|
+
// rendered by mobile bridge in a web view.
|
|
457
|
+
// The tooltip is likely to have unexpected behaviour there, with being cut
|
|
458
|
+
// off, so we disable it. This is also to keep the behaviour consistent with
|
|
459
|
+
// the rendering in the mobile Native Renderer.
|
|
460
|
+
const codeBidiWarningTooltipEnabled = this.appearance !== 'mobile';
|
|
441
461
|
return { ...this.getProps(node),
|
|
442
|
-
text: node.textContent
|
|
462
|
+
text: node.textContent,
|
|
463
|
+
codeBidiWarningTooltipEnabled
|
|
443
464
|
};
|
|
444
465
|
}
|
|
445
466
|
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { injectIntl } from 'react-intl';
|
|
3
|
+
import { injectIntl } from 'react-intl-next';
|
|
4
4
|
import AkCode from '@atlaskit/code/inline';
|
|
5
5
|
import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { useFeatureFlags } from '../../use-feature-flags';
|
|
7
|
+
export const isCodeMark = mark => {
|
|
8
|
+
return mark && mark.type && mark.type.name === 'code';
|
|
9
|
+
};
|
|
7
10
|
export function CodeWithIntl(props) {
|
|
8
11
|
const featureFlags = useFeatureFlags();
|
|
9
12
|
const codeBidiWarningLabel = props.intl.formatMessage(codeBidiWarningMessages.label);
|
|
10
13
|
return /*#__PURE__*/React.createElement(AkCode, _extends({
|
|
11
14
|
className: "code",
|
|
12
15
|
codeBidiWarnings: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.codeBidiWarnings,
|
|
13
|
-
codeBidiWarningLabel: codeBidiWarningLabel
|
|
16
|
+
codeBidiWarningLabel: codeBidiWarningLabel,
|
|
17
|
+
codeBidiWarningTooltipEnabled: props.codeBidiWarningTooltipEnabled
|
|
14
18
|
}, props.dataAttributes), props.children);
|
|
15
19
|
}
|
|
16
20
|
export default injectIntl(CodeWithIntl);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export default function FragmentMark(props) {
|
|
4
|
+
const WrapperElement = props.isInline ? 'span' : 'div';
|
|
5
|
+
return /*#__PURE__*/React.createElement(WrapperElement, _extends({
|
|
6
|
+
"data-localId": props.localId,
|
|
7
|
+
"data-name": props.name,
|
|
8
|
+
"data-mark-type": "fragment"
|
|
9
|
+
}, props.dataAttributes), props.children);
|
|
10
|
+
}
|
|
@@ -12,6 +12,7 @@ import Indentation from './indentation';
|
|
|
12
12
|
import UnsupportedMark from './unsupportedMark';
|
|
13
13
|
import UnsupportedNodeAttribute from './unsupportedNodeAttribute';
|
|
14
14
|
import DataConsumer from './data-consumer';
|
|
15
|
+
import FragmentMark from './fragment';
|
|
15
16
|
import Annotation, { isAnnotationMark } from './annotation'; // Stage0
|
|
16
17
|
|
|
17
18
|
import ConfluenceInlineComment from './confluence-inline-comment';
|
|
@@ -32,9 +33,10 @@ export const markToReact = {
|
|
|
32
33
|
indentation: Indentation,
|
|
33
34
|
unsupportedMark: UnsupportedMark,
|
|
34
35
|
unsupportedNodeAttribute: UnsupportedNodeAttribute,
|
|
35
|
-
dataConsumer: DataConsumer
|
|
36
|
+
dataConsumer: DataConsumer,
|
|
37
|
+
fragment: FragmentMark
|
|
36
38
|
};
|
|
37
39
|
export const toReact = mark => {
|
|
38
40
|
return markToReact[mark.type.name];
|
|
39
41
|
};
|
|
40
|
-
export { Code, Em, Link, Strike, Strong, Subsup, TextColor, Underline, Breakout, Annotation, UnsupportedMark, isAnnotationMark, UnsupportedNodeAttribute, DataConsumer };
|
|
42
|
+
export { Code, Em, Link, Strike, Strong, Subsup, TextColor, Underline, Breakout, Annotation, UnsupportedMark, isAnnotationMark, UnsupportedNodeAttribute, DataConsumer, FragmentMark };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
3
|
export default function TextColor(props) {
|
|
4
|
+
const style = useMemo(() => ({
|
|
5
|
+
['--custom-text-color']: props.color
|
|
6
|
+
}), [props.color]);
|
|
4
7
|
return /*#__PURE__*/React.createElement("span", _extends({}, props.dataAttributes, {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
"data-text-custom-color": props.color,
|
|
9
|
+
className: "fabric-text-color-mark",
|
|
10
|
+
style: style
|
|
8
11
|
}), props.children);
|
|
9
12
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { injectIntl } from 'react-intl';
|
|
2
|
+
import { injectIntl } from 'react-intl-next';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { CodeBlock as AkCodeBlock } from '@atlaskit/code';
|
|
5
5
|
import { overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
@@ -14,7 +14,8 @@ function CodeBlock(props) {
|
|
|
14
14
|
const {
|
|
15
15
|
text,
|
|
16
16
|
language,
|
|
17
|
-
allowCopyToClipboard = false
|
|
17
|
+
allowCopyToClipboard = false,
|
|
18
|
+
codeBidiWarningTooltipEnabled
|
|
18
19
|
} = props;
|
|
19
20
|
const featureFlags = useFeatureFlags();
|
|
20
21
|
const codeBidiWarningLabel = props.intl.formatMessage(codeBidiWarningMessages.label);
|
|
@@ -27,7 +28,8 @@ function CodeBlock(props) {
|
|
|
27
28
|
language: language,
|
|
28
29
|
text: text,
|
|
29
30
|
codeBidiWarnings: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.codeBidiWarnings,
|
|
30
|
-
codeBidiWarningLabel: codeBidiWarningLabel
|
|
31
|
+
codeBidiWarningLabel: codeBidiWarningLabel,
|
|
32
|
+
codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled
|
|
31
33
|
}));
|
|
32
34
|
}
|
|
33
35
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { injectIntl } from 'react-intl';
|
|
2
|
+
import { injectIntl } from 'react-intl-next';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import Tooltip from '@atlaskit/tooltip';
|
|
5
5
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PureComponent } from 'react';
|
|
3
3
|
import { isPastDate, timestampToString, timestampToTaskContext, DateSharedCssClassName } from '@atlaskit/editor-common';
|
|
4
|
-
import { injectIntl } from 'react-intl';
|
|
4
|
+
import { injectIntl } from 'react-intl-next';
|
|
5
5
|
|
|
6
6
|
class Date extends PureComponent {
|
|
7
7
|
render() {
|
|
@@ -5,7 +5,7 @@ import styled from 'styled-components';
|
|
|
5
5
|
import { N200, N500, B400 } from '@atlaskit/theme/colors';
|
|
6
6
|
import LinkIcon from '@atlaskit/icon/glyph/link';
|
|
7
7
|
import Tooltip from '@atlaskit/tooltip';
|
|
8
|
-
import { injectIntl } from 'react-intl';
|
|
8
|
+
import { injectIntl } from 'react-intl-next';
|
|
9
9
|
import { headingAnchorLinkMessages } from '../../messages';
|
|
10
10
|
export const HeadingAnchorWrapperClassName = 'heading-anchor-wrapper';
|
|
11
11
|
const CopyAnchorWrapperWithRef = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import HeadingAnchor from './heading-anchor';
|
|
4
|
-
import Url from 'url-parse';
|
|
5
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../analytics/enums';
|
|
6
5
|
import AnalyticsContext from '../../analytics/analyticsContext';
|
|
7
6
|
import { CopyTextConsumer } from './copy-text-provider';
|
|
8
7
|
|
|
9
8
|
const getCurrentUrlWithHash = (hash = '') => {
|
|
10
|
-
const url = new
|
|
11
|
-
url.
|
|
9
|
+
const url = new URL(window.location.href);
|
|
10
|
+
url.hash = encodeURIComponent(hash);
|
|
12
11
|
return url.href;
|
|
13
12
|
};
|
|
14
13
|
|
|
@@ -21,7 +21,8 @@ export default class Media extends PureComponent {
|
|
|
21
21
|
alt,
|
|
22
22
|
featureFlags,
|
|
23
23
|
shouldOpenMediaViewer: allowMediaViewer,
|
|
24
|
-
enableDownloadButton
|
|
24
|
+
enableDownloadButton,
|
|
25
|
+
ssr
|
|
25
26
|
} = this.props;
|
|
26
27
|
const linkMark = this.props.marks.find(this.props.isLinkMark);
|
|
27
28
|
const linkHref = linkMark === null || linkMark === void 0 ? void 0 : linkMark.attrs.href;
|
|
@@ -35,7 +36,8 @@ export default class Media extends PureComponent {
|
|
|
35
36
|
eventHandlers: eventHandlers,
|
|
36
37
|
alt: allowAltTextOnImages ? alt : undefined,
|
|
37
38
|
featureFlags: featureFlags,
|
|
38
|
-
shouldEnableDownloadButton: enableDownloadButton
|
|
39
|
+
shouldEnableDownloadButton: enableDownloadButton,
|
|
40
|
+
ssr: ssr
|
|
39
41
|
}));
|
|
40
42
|
return linkHref ? /*#__PURE__*/React.createElement(MediaLink, {
|
|
41
43
|
href: linkHref,
|
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import { mapBreakpointToLayoutMaxWidth, WidthConsumer } from '@atlaskit/editor-common';
|
|
3
3
|
import { akEditorFullWidthLayoutWidth, getAkEditorFullPageMaxWidth, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import { Component, default as React } from 'react';
|
|
5
|
-
import { injectIntl } from 'react-intl';
|
|
5
|
+
import { injectIntl } from 'react-intl-next';
|
|
6
6
|
import { FullPagePadding } from '../../../ui/Renderer/style';
|
|
7
7
|
import { ExtendedUIMediaSingle } from './styles';
|
|
8
8
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|