@atlaskit/renderer 95.0.1 → 96.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 +25 -0
- package/dist/cjs/react/index.js +0 -2
- package/dist/cjs/react/nodes/embedCard.js +2 -5
- package/dist/cjs/react/nodes/inlineCard.js +5 -1
- package/dist/cjs/react/nodes/mediaInline.js +41 -4
- package/dist/cjs/react/nodes/mediaSingle/index.js +3 -7
- package/dist/cjs/react/nodes/table/colgroup.js +6 -12
- package/dist/cjs/react/nodes/table/sticky.js +2 -4
- package/dist/cjs/react/nodes/table/table.js +1 -3
- package/dist/cjs/react/nodes/table.js +20 -9
- package/dist/cjs/react/nodes/tableCell.js +5 -3
- package/dist/cjs/render-document.js +2 -2
- package/dist/cjs/ui/MediaCard.js +2 -2
- package/dist/cjs/ui/Renderer/breakout-ssr.js +6 -8
- package/dist/cjs/ui/Renderer/index.js +4 -12
- package/dist/cjs/ui/Renderer/style.js +3 -3
- package/dist/cjs/ui/annotations/hooks/use-events.js +4 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/react/index.js +0 -2
- package/dist/es2019/react/nodes/embedCard.js +4 -7
- package/dist/es2019/react/nodes/inlineCard.js +4 -1
- package/dist/es2019/react/nodes/mediaInline.js +36 -4
- package/dist/es2019/react/nodes/mediaSingle/index.js +5 -9
- package/dist/es2019/react/nodes/table/colgroup.js +2 -8
- package/dist/es2019/react/nodes/table/sticky.js +2 -4
- package/dist/es2019/react/nodes/table/table.js +1 -3
- package/dist/es2019/react/nodes/table.js +18 -9
- package/dist/es2019/react/nodes/tableCell.js +4 -1
- package/dist/es2019/render-document.js +1 -1
- package/dist/es2019/ui/MediaCard.js +1 -1
- package/dist/es2019/ui/Renderer/breakout-ssr.js +6 -8
- package/dist/es2019/ui/Renderer/index.js +3 -11
- package/dist/es2019/ui/Renderer/style.js +16 -3
- package/dist/es2019/ui/annotations/hooks/use-events.js +2 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/react/index.js +0 -2
- package/dist/esm/react/nodes/embedCard.js +4 -7
- package/dist/esm/react/nodes/inlineCard.js +4 -1
- package/dist/esm/react/nodes/mediaInline.js +36 -4
- package/dist/esm/react/nodes/mediaSingle/index.js +5 -9
- package/dist/esm/react/nodes/table/colgroup.js +6 -12
- package/dist/esm/react/nodes/table/sticky.js +2 -4
- package/dist/esm/react/nodes/table/table.js +1 -3
- package/dist/esm/react/nodes/table.js +20 -9
- package/dist/esm/react/nodes/tableCell.js +5 -3
- package/dist/esm/render-document.js +1 -1
- package/dist/esm/ui/MediaCard.js +1 -1
- package/dist/esm/ui/Renderer/breakout-ssr.js +6 -8
- package/dist/esm/ui/Renderer/index.js +3 -11
- package/dist/esm/ui/Renderer/style.js +4 -3
- package/dist/esm/ui/annotations/hooks/use-events.js +4 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/react/index.d.ts +0 -2
- package/dist/types/react/nodes/embedCard.d.ts +0 -1
- package/dist/types/react/nodes/extension.d.ts +6 -0
- package/dist/types/react/nodes/index.d.ts +1 -2
- package/dist/types/react/nodes/media.d.ts +0 -1
- package/dist/types/react/nodes/mediaInline.d.ts +6 -3
- package/dist/types/react/nodes/mediaSingle/index.d.ts +0 -1
- package/dist/types/react/nodes/table/sticky.d.ts +1 -2
- package/dist/types/react/nodes/table/table.d.ts +1 -1
- package/dist/types/react/nodes/table/types.d.ts +0 -1
- package/dist/types/react/types.d.ts +0 -1
- package/dist/types/renderer-context.d.ts +1 -0
- package/dist/types/ui/MediaCard.d.ts +1 -1
- package/dist/types/ui/Renderer/breakout-ssr.d.ts +2 -4
- package/dist/types/ui/renderer-props.d.ts +1 -0
- package/package.json +13 -12
|
@@ -96,7 +96,7 @@ var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
|
|
|
96
96
|
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 ");
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n padding: 0;\n\n .", " {\n width: 100%;\n height: 100%;\n cursor: pointer;\n padding: ", "px;\n border-width: 1.5px;\n border-style: solid;\n border-color: transparent;\n\n > *:first-child {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-
|
|
99
|
+
return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n padding: 0;\n\n .", " {\n width: 100%;\n height: 100%;\n cursor: pointer;\n padding: ", "px;\n border-width: 1.5px;\n border-style: solid;\n border-color: transparent;\n\n > *:first-child {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-of-type + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-of-type + span + * {\n margin-top: 0;\n }\n\n @supports selector(:focus-visible) {\n &:focus {\n outline: unset;\n }\n &:focus-visible {\n border-color: ", ";\n }\n }\n\n ", "\n }\n\n &.", "\n .", " {\n cursor: default;\n }\n\n .", " {\n margin: 0;\n opacity: 1;\n transition: opacity 0.2s ease-in-out;\n }\n\n .", " {\n opacity: 0;\n }\n\n &:hover {\n .", " {\n opacity: 1;\n }\n }\n }\n "])), _consts.RendererCssClassName.SORTABLE_COLUMN, _consts.RendererCssClassName.SORTABLE_COLUMN_BUTTON, _styles.tableCellPadding, (0, _tokens.token)('color.border.focused', colors.B300), headingsCss, _consts.RendererCssClassName.SORTABLE_COLUMN_NOT_ALLOWED, _consts.RendererCssClassName.SORTABLE_COLUMN_BUTTON, _consts.RendererCssClassName.SORTABLE_COLUMN_ICON, _consts.RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, _consts.RendererCssClassName.SORTABLE_COLUMN_NO_ORDER);
|
|
100
100
|
};
|
|
101
101
|
|
|
102
102
|
var fullPageStyles = function fullPageStyles(_ref3, _ref4) {
|
|
@@ -126,7 +126,7 @@ var rendererStyles = function rendererStyles(wrapperProps) {
|
|
|
126
126
|
var themeProps = {
|
|
127
127
|
theme: theme
|
|
128
128
|
};
|
|
129
|
-
return (0, _react.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-size: ", "px;\n line-height: 1.5rem;\n color: ", ";\n\n .", "::after {\n // we add a clearfix after ak-renderer-document in order to\n // contain internal floats (such as media images that are \"wrap-left\")\n // to just the renderer (and not spill outside of it)\n content: '';\n visibility: hidden;\n display: block;\n height: 0;\n clear: both;\n }\n\n ", "\n ", "\n\n & h1 {\n ", "\n }\n\n & h2 {\n ", "\n }\n\n & h3 {\n ", "\n }\n\n & h4 {\n ", "\n }\n\n & h5 {\n ", "\n }\n\n & h6 {\n ", "\n }\n\n & span.akActionMark {\n color: ", ";\n text-decoration: none;\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n\n &:active {\n color: ", ";\n }\n }\n\n & span.akActionMark {\n cursor: pointer;\n }\n\n & span[data-placeholder] {\n color: ", ";\n }\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", "\n\n & .UnknownBlock {\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n\n & span.date-node {\n background: ", ";\n border-radius: ", "px;\n color: ", ";\n padding: 2px 4px;\n margin: 0 1px;\n transition: background 0.3s;\n }\n\n & span.date-node-highlighted {\n background: ", ";\n color: ", ";\n }\n\n & .renderer-image {\n max-width: 100%;\n display: block;\n margin: ", "px 0;\n }\n\n .", ".rich-media-wrapped\n + .", ":not(.rich-media-wrapped) {\n clear: both;\n }\n\n & .code-block,\n & blockquote,\n & hr,\n & > div > div:not(.rich-media-wrapped),\n .", ".rich-media-wrapped\n + .rich-media-wrapped\n + *:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n .", ".image-align-start,\n .", ".image-center,\n .", ".image-align-end {\n clear: both;\n }\n\n & .rich-media-wrapped {\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n margin-top: 8px;\n }\n }\n\n ", "\n /* plugin styles */\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* Breakout for tables and extensions */\n .", " > {\n * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n * .", " {\n overflow-x: auto;\n }\n\n & .", ":first-child {\n margin-top: 0;\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n }\n\n .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .", " {\n overflow-x: auto;\n }\n }\n\n ", "\n\n .", " .", " {\n z-index: 0;\n transition: all 0.1s linear;\n display: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n /** Shadow overrides */\n &.", "::after,\n &.", "::before {\n top: ", "px;\n height: calc(100% - ", "px);\n z-index: ", ";\n }\n\n /**\n * 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-
|
|
129
|
+
return (0, _react.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-size: ", "px;\n line-height: 1.5rem;\n color: ", ";\n\n .", "::after {\n // we add a clearfix after ak-renderer-document in order to\n // contain internal floats (such as media images that are \"wrap-left\")\n // to just the renderer (and not spill outside of it)\n content: '';\n visibility: hidden;\n display: block;\n height: 0;\n clear: both;\n }\n\n ", "\n ", "\n\n & h1 {\n ", "\n }\n\n & h2 {\n ", "\n }\n\n & h3 {\n ", "\n }\n\n & h4 {\n ", "\n }\n\n & h5 {\n ", "\n }\n\n & h6 {\n ", "\n }\n\n & span.akActionMark {\n color: ", ";\n text-decoration: none;\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n\n &:active {\n color: ", ";\n }\n }\n\n & span.akActionMark {\n cursor: pointer;\n }\n\n & span[data-placeholder] {\n color: ", ";\n }\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", "\n\n & .UnknownBlock {\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n\n & span.date-node {\n background: ", ";\n border-radius: ", "px;\n color: ", ";\n padding: 2px 4px;\n margin: 0 1px;\n transition: background 0.3s;\n }\n\n & span.date-node-highlighted {\n background: ", ";\n color: ", ";\n }\n\n & .renderer-image {\n max-width: 100%;\n display: block;\n margin: ", "px 0;\n }\n\n .", ".rich-media-wrapped\n + .", ":not(.rich-media-wrapped) {\n clear: both;\n }\n\n & .code-block,\n & blockquote,\n & hr,\n & > div > div:not(.rich-media-wrapped),\n .", ".rich-media-wrapped\n + .rich-media-wrapped\n + *:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n .", ".image-align-start,\n .", ".image-center,\n .", ".image-align-end {\n clear: both;\n }\n\n & .rich-media-wrapped {\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n margin-top: 8px;\n }\n }\n\n ", "\n /* plugin styles */\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* Breakout for tables and extensions */\n .", " > {\n * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n * .", " {\n overflow-x: auto;\n }\n\n & .", ":first-child {\n margin-top: 0;\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n }\n\n .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .", " {\n overflow-x: auto;\n }\n\n .", "\n .", " {\n display: flex;\n }\n }\n\n ", "\n\n .", " .", " {\n z-index: 0;\n transition: all 0.1s linear;\n display: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n /** Shadow overrides */\n &.", "::after,\n &.", "::before {\n top: ", "px;\n height: calc(100% - ", "px);\n z-index: ", ";\n }\n\n &\n .", ",\n &\n .", " {\n height: calc(100% - ", "px);\n }\n\n /**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n table {\n height: 1px; /* will be ignored */\n ", ";\n margin-left: 0;\n margin-right: 0;\n }\n\n table tr:first-of-type {\n height: 100%;\n\n td,\n th {\n position: relative;\n }\n }\n\n table[data-number-column='true'] {\n .", " {\n background-color: ", ";\n border-right: 1px solid\n ", ";\n width: ", "px;\n text-align: center;\n color: ", ";\n font-size: ", ";\n }\n\n .fixed .", " {\n border-right: 0px none;\n }\n }\n }\n\n tr[data-header-row].fixed {\n position: fixed !important;\n display: flex;\n overflow: hidden;\n z-index: ", ";\n\n border-right: 1px solid\n ", ";\n border-bottom: 1px solid\n ", ";\n\n /* this is to compensate for the table border */\n transform: translateX(-1px);\n }\n\n .sticky > th {\n z-index: ", ";\n position: sticky !important;\n top: 0;\n }\n\n /* Make the number column header sticky */\n .sticky > td {\n position: sticky !important;\n top: 0;\n }\n\n /* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n .sticky th,\n .sticky td {\n box-shadow: 0px 1px\n ", ",\n 0px -0.5px ", ",\n inset -1px 0px ", ",\n 0px -1px ", ";\n }\n\n /* this will remove jumpiness caused in Chrome for sticky headers */\n .fixed + tr {\n min-height: 0px;\n }\n\n /*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n & .code-block {\n max-width: 100%;\n /* -ms- properties are necessary until MS supports the latest version of the grid spec */\n /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: auto 1fr;\n /* stylelint-enable */\n\n grid-template-columns: minmax(0, 1fr);\n position: relative;\n border-radius: ", "px;\n\n /*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n word-wrap: normal;\n\n & > span {\n /* stylelint-disable value-no-vendor-prefix */\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n /* stylelint-enable */\n grid-column: 1;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n\n &:hover button.copy-to-clipboard,\n .copy-to-clipboard:focus {\n opacity: 1;\n position: absolute;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n }\n }\n\n ", ";\n & [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 "])), (0, _editorSharedStyles.editorFontSize)(themeProps), (0, _components.themed)({
|
|
130
130
|
light: (0, _tokens.token)('color.text', colors.N800),
|
|
131
131
|
dark: (0, _tokens.token)('color.text', '#B8C7E0')
|
|
132
132
|
})(themeProps), _consts.RendererCssClassName.DOCUMENT, fullPageStyles(wrapperProps, themeProps), fullWidthStyles(wrapperProps), headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), (0, _tokens.token)('color.link', colors.B400), (0, _tokens.token)('color.link', colors.B300), (0, _tokens.token)('color.link.pressed', colors.B500), colors.placeholderText(themeProps), _styles.whitespaceSharedStyles, _styles.blockquoteSharedStyles, (0, _styles.headingsSharedStyles)(themeProps), (0, _styles.ruleSharedStyles)(themeProps), _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.blockMarksSharedStyles, (0, _styles.codeMarkSharedStyles)(themeProps), _styles.shadowSharedStyle, _styles.dateSharedStyle, _styles.textColorStyles, _styles.tasksAndDecisionsStyles, _styles.smartCardSharedStyles, (0, _constants.fontFamily)(), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _components.themed)({
|
|
@@ -135,7 +135,7 @@ var rendererStyles = function rendererStyles(wrapperProps) {
|
|
|
135
135
|
})(themeProps), (0, _constants.borderRadius)(), (0, _components.themed)({
|
|
136
136
|
light: (0, _tokens.token)('color.text', colors.N800),
|
|
137
137
|
dark: (0, _tokens.token)('color.text', colors.DN600)
|
|
138
|
-
})(themeProps), (0, _tokens.token)('color.background.danger', colors.R50), (0, _tokens.token)('color.text.danger', colors.R500), (0, _constants.gridSize)() * 3, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, alignedHeadingAnchorStyle(wrapperProps), _styles.mediaSingleSharedStyle, _consts.RendererCssClassName.DOCUMENT, _styles.TableSharedCssClassName.TABLE_CONTAINER, _consts.RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, _consts.RendererCssClassName.EXTENSION, _consts.RendererCssClassName.DOCUMENT, _consts.RendererCssClassName.EXTENSION, _editorSharedStyles.blockNodesVerticalMargin, _consts.RendererCssClassName.EXTENSION_CENTER_ALIGN, _styles.TableSharedCssClassName.TABLE_NODE_WRAPPER, (0, _styles.tableSharedStyle)(themeProps), _consts.RendererCssClassName.DOCUMENT, _styles.TableSharedCssClassName.TABLE_CONTAINER, _ui.shadowClassNames.RIGHT_SHADOW, _ui.shadowClassNames.LEFT_SHADOW, _styles.tableMarginTop - 1, _styles.tableMarginTop, _editorSharedStyles.akEditorStickyHeaderZIndex, tableSortableColumnStyle(wrapperProps), _consts.RendererCssClassName.NUMBER_COLUMN, (0, _components.themed)({
|
|
138
|
+
})(themeProps), (0, _tokens.token)('color.background.danger', colors.R50), (0, _tokens.token)('color.text.danger', colors.R500), (0, _constants.gridSize)() * 3, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, alignedHeadingAnchorStyle(wrapperProps), _styles.mediaSingleSharedStyle, _consts.RendererCssClassName.DOCUMENT, _styles.TableSharedCssClassName.TABLE_CONTAINER, _consts.RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, _consts.RendererCssClassName.EXTENSION, _consts.RendererCssClassName.DOCUMENT, _consts.RendererCssClassName.EXTENSION, _editorSharedStyles.blockNodesVerticalMargin, _consts.RendererCssClassName.EXTENSION_CENTER_ALIGN, _styles.TableSharedCssClassName.TABLE_NODE_WRAPPER, _ui.shadowObserverClassNames.SHADOW_CONTAINER, _styles.TableSharedCssClassName.TABLE_NODE_WRAPPER, (0, _styles.tableSharedStyle)(themeProps), _consts.RendererCssClassName.DOCUMENT, _styles.TableSharedCssClassName.TABLE_CONTAINER, _ui.shadowClassNames.RIGHT_SHADOW, _ui.shadowClassNames.LEFT_SHADOW, _styles.tableMarginTop - 1, _styles.tableMarginTop, _editorSharedStyles.akEditorStickyHeaderZIndex, _ui.shadowObserverClassNames.SENTINEL_LEFT, _ui.shadowObserverClassNames.SENTINEL_RIGHT, _styles.tableMarginTop, tableSortableColumnStyle(wrapperProps), _consts.RendererCssClassName.NUMBER_COLUMN, (0, _components.themed)({
|
|
139
139
|
light: (0, _tokens.token)('color.background.neutral', _editorSharedStyles.akEditorTableToolbar),
|
|
140
140
|
dark: (0, _tokens.token)('color.background.neutral', _editorSharedStyles.akEditorTableToolbarDark)
|
|
141
141
|
})(themeProps), (0, _components.themed)({
|
|
@@ -45,7 +45,7 @@ var useAnnotationStateByTypeEvent = function useAnnotationStateByTypeEvent(_ref)
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
var nextStates = Object.values(payload).reduce(function (acc, curr) {
|
|
48
|
-
if (curr.annotationType === type) {
|
|
48
|
+
if (curr.id && curr.annotationType === type) {
|
|
49
49
|
// Check for empty state to prevent additional renders
|
|
50
50
|
var isEmpty = curr.state === null || curr.state === undefined;
|
|
51
51
|
return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, curr.id, !isEmpty ? curr.state : states[curr.id]));
|
|
@@ -116,7 +116,9 @@ var useAnnotationClickEvent = function useAnnotationClickEvent(props) {
|
|
|
116
116
|
var cb = function cb(_ref3) {
|
|
117
117
|
var annotationIds = _ref3.annotationIds,
|
|
118
118
|
eventTarget = _ref3.eventTarget;
|
|
119
|
-
var annotationsByType = annotationIds.
|
|
119
|
+
var annotationsByType = annotationIds.filter(function (id) {
|
|
120
|
+
return !!id;
|
|
121
|
+
}).map(function (id) {
|
|
120
122
|
return {
|
|
121
123
|
id: id,
|
|
122
124
|
type: _adfSchema.AnnotationTypes.INLINE_COMMENT
|
package/dist/cjs/version.json
CHANGED
|
@@ -162,7 +162,6 @@ export default class ReactSerializer {
|
|
|
162
162
|
this.appearance = init.appearance;
|
|
163
163
|
this.disableHeadingIDs = init.disableHeadingIDs;
|
|
164
164
|
this.disableActions = init.disableActions;
|
|
165
|
-
this.allowDynamicTextSizing = init.allowDynamicTextSizing;
|
|
166
165
|
this.allowHeadingAnchorLinks = init.allowHeadingAnchorLinks;
|
|
167
166
|
this.allowCopyToClipboard = init.allowCopyToClipboard;
|
|
168
167
|
this.allowPlaceholderText = init.allowPlaceholderText;
|
|
@@ -482,7 +481,6 @@ export default class ReactSerializer {
|
|
|
482
481
|
rendererContext: this.rendererContext,
|
|
483
482
|
serializer: this,
|
|
484
483
|
content: node.content ? node.content.toJSON() : undefined,
|
|
485
|
-
allowDynamicTextSizing: this.allowDynamicTextSizing,
|
|
486
484
|
allowHeadingAnchorLinks: this.allowHeadingAnchorLinks,
|
|
487
485
|
allowCopyToClipboard: this.allowCopyToClipboard,
|
|
488
486
|
allowPlaceholderText: this.allowPlaceholderText,
|
|
@@ -4,8 +4,8 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
4
4
|
import { css, jsx } from '@emotion/react';
|
|
5
5
|
import { useMemo, useContext, useState, useRef } from 'react';
|
|
6
6
|
import { Card, Context as CardContext, EmbedResizeMessageListener } from '@atlaskit/smart-card';
|
|
7
|
-
import { WidthConsumer,
|
|
8
|
-
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH
|
|
7
|
+
import { WidthConsumer, UnsupportedBlock, MediaSingle as UIMediaSingle } from '@atlaskit/editor-common/ui';
|
|
8
|
+
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
|
|
9
9
|
import { getPlatform } from '../../utils';
|
|
10
10
|
import { CardErrorBoundary } from './fallback';
|
|
11
11
|
import { FullPagePadding } from '../../ui/Renderer/style';
|
|
@@ -37,7 +37,6 @@ export default function EmbedCard(props) {
|
|
|
37
37
|
layout,
|
|
38
38
|
width,
|
|
39
39
|
isInsideOfBlockNode,
|
|
40
|
-
allowDynamicTextSizing,
|
|
41
40
|
rendererAppearance
|
|
42
41
|
} = props;
|
|
43
42
|
const embedIframeRef = useRef(null);
|
|
@@ -103,10 +102,8 @@ export default function EmbedCard(props) {
|
|
|
103
102
|
if (!isInsideOfBlockNode && rendererAppearance !== 'comment') {
|
|
104
103
|
const isContainerSizeGreaterThanMaxFullPageWidth = containerWidth - padding >= akEditorDefaultLayoutWidth;
|
|
105
104
|
|
|
106
|
-
if (isContainerSizeGreaterThanMaxFullPageWidth
|
|
107
|
-
nonFullWidthSize =
|
|
108
|
-
} else if (isContainerSizeGreaterThanMaxFullPageWidth) {
|
|
109
|
-
nonFullWidthSize = getAkEditorFullPageMaxWidth(allowDynamicTextSizing);
|
|
105
|
+
if (isContainerSizeGreaterThanMaxFullPageWidth) {
|
|
106
|
+
nonFullWidthSize = akEditorDefaultLayoutWidth;
|
|
110
107
|
} else {
|
|
111
108
|
nonFullWidthSize = containerWidth - padding;
|
|
112
109
|
}
|
|
@@ -6,6 +6,7 @@ import { UnsupportedInline } from '@atlaskit/editor-common/ui';
|
|
|
6
6
|
import { CardErrorBoundary } from './fallback';
|
|
7
7
|
import { withSmartCardStorage } from '../../ui/SmartCardStorage';
|
|
8
8
|
import { getCardClickHandler } from '../utils/getCardClickHandler';
|
|
9
|
+
import { useFeatureFlags } from '../../use-feature-flags';
|
|
9
10
|
|
|
10
11
|
const InlineCard = props => {
|
|
11
12
|
const {
|
|
@@ -22,6 +23,7 @@ const InlineCard = props => {
|
|
|
22
23
|
onClick,
|
|
23
24
|
container: portal
|
|
24
25
|
};
|
|
26
|
+
const featureFlags = useFeatureFlags();
|
|
25
27
|
|
|
26
28
|
if (smartLinks !== null && smartLinks !== void 0 && smartLinks.ssr && url) {
|
|
27
29
|
return /*#__PURE__*/React.createElement(CardSSR, {
|
|
@@ -37,7 +39,8 @@ const InlineCard = props => {
|
|
|
37
39
|
}, /*#__PURE__*/React.createElement(CardErrorBoundary, _extends({
|
|
38
40
|
unsupportedComponent: UnsupportedInline
|
|
39
41
|
}, cardProps), /*#__PURE__*/React.createElement(Card, _extends({
|
|
40
|
-
appearance: "inline"
|
|
42
|
+
appearance: "inline",
|
|
43
|
+
showHoverPreview: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.showHoverPreview
|
|
41
44
|
}, cardProps, {
|
|
42
45
|
onResolve: data => {
|
|
43
46
|
if (!data.url || !data.title) {
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import React, { useEffect, useState } from 'react';
|
|
2
3
|
import { MediaInlineCard } from '@atlaskit/media-card';
|
|
4
|
+
import { MediaInlineCardErroredView, MediaInlineCardLoadingView, messages } from '@atlaskit/media-ui';
|
|
3
5
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
6
|
+
import { getClipboardAttrs } from '../../ui/MediaCard';
|
|
7
|
+
import { createIntl, injectIntl } from 'react-intl-next';
|
|
4
8
|
export const RenderMediaInline = props => {
|
|
5
9
|
const {
|
|
6
10
|
mediaProvider
|
|
7
11
|
} = props;
|
|
8
|
-
const [viewMediaClientConfigState, setViewMediaClientConfigState] = useState(
|
|
12
|
+
const [viewMediaClientConfigState, setViewMediaClientConfigState] = useState();
|
|
9
13
|
useEffect(() => {
|
|
10
14
|
updateViewMediaClientConfigState(mediaProvider);
|
|
11
15
|
}, [mediaProvider]);
|
|
@@ -16,6 +20,18 @@ export const RenderMediaInline = props => {
|
|
|
16
20
|
setViewMediaClientConfigState(mediaClientConfig.viewMediaClientConfig);
|
|
17
21
|
}
|
|
18
22
|
};
|
|
23
|
+
/*
|
|
24
|
+
* Only show the loading view if the media provider is not ready
|
|
25
|
+
* prevents calling the media API before the provider is ready
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
if (!viewMediaClientConfigState) {
|
|
30
|
+
return /*#__PURE__*/React.createElement(MediaInlineCardLoadingView, {
|
|
31
|
+
message: "",
|
|
32
|
+
isSelected: false
|
|
33
|
+
});
|
|
34
|
+
}
|
|
19
35
|
|
|
20
36
|
return /*#__PURE__*/React.createElement(MediaInlineCard, {
|
|
21
37
|
identifier: props.identifier,
|
|
@@ -28,20 +44,36 @@ const MediaInline = props => {
|
|
|
28
44
|
const {
|
|
29
45
|
collection,
|
|
30
46
|
id,
|
|
31
|
-
providers
|
|
47
|
+
providers,
|
|
48
|
+
intl
|
|
32
49
|
} = props;
|
|
33
50
|
const identifier = {
|
|
34
51
|
id,
|
|
35
52
|
mediaItemType: 'file',
|
|
36
53
|
collectionName: collection
|
|
37
54
|
};
|
|
38
|
-
|
|
55
|
+
const defaultIntl = createIntl({
|
|
56
|
+
locale: 'en'
|
|
57
|
+
});
|
|
58
|
+
return /*#__PURE__*/React.createElement("span", _extends({}, getClipboardAttrs({
|
|
59
|
+
id,
|
|
60
|
+
collection
|
|
61
|
+
}), {
|
|
62
|
+
"data-node-type": "mediaInline"
|
|
63
|
+
}), /*#__PURE__*/React.createElement(WithProviders, {
|
|
39
64
|
providers: ['mediaProvider'],
|
|
40
65
|
providerFactory: providers,
|
|
41
66
|
renderNode: providers => {
|
|
42
67
|
const {
|
|
43
68
|
mediaProvider
|
|
44
69
|
} = providers;
|
|
70
|
+
|
|
71
|
+
if (!mediaProvider) {
|
|
72
|
+
return /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
|
|
73
|
+
message: (intl || defaultIntl).formatMessage(messages.couldnt_load_file)
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
45
77
|
return /*#__PURE__*/React.createElement(RenderMediaInline, {
|
|
46
78
|
identifier: identifier,
|
|
47
79
|
mediaProvider: mediaProvider
|
|
@@ -50,4 +82,4 @@ const MediaInline = props => {
|
|
|
50
82
|
}));
|
|
51
83
|
};
|
|
52
84
|
|
|
53
|
-
export default MediaInline;
|
|
85
|
+
export default injectIntl(MediaInline);
|
|
@@ -3,8 +3,8 @@ import { default as React, Fragment } from 'react';
|
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import { injectIntl } from 'react-intl-next';
|
|
5
5
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
6
|
-
import {
|
|
7
|
-
import { akEditorFullWidthLayoutWidth,
|
|
6
|
+
import { MediaSingle as UIMediaSingle, WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
7
|
+
import { akEditorFullWidthLayoutWidth, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
8
8
|
import { FullPagePadding } from '../../../ui/Renderer/style';
|
|
9
9
|
import { useObservedWidth } from '../../hooks/use-observed-width';
|
|
10
10
|
import { uiMediaSingleBaseStyles, uiMediaSingleLayoutStyles } from './styles';
|
|
@@ -48,7 +48,6 @@ const MediaSingle = props => {
|
|
|
48
48
|
rendererAppearance,
|
|
49
49
|
featureFlags,
|
|
50
50
|
isInsideOfBlockNode,
|
|
51
|
-
allowDynamicTextSizing,
|
|
52
51
|
layout,
|
|
53
52
|
children,
|
|
54
53
|
width: pctWidth
|
|
@@ -119,7 +118,6 @@ const MediaSingle = props => {
|
|
|
119
118
|
|
|
120
119
|
const calcDimensions = (mediaContainerWidth, mediaBreakpoint) => {
|
|
121
120
|
const containerWidth = getMediaContainerWidth(mediaContainerWidth, layout);
|
|
122
|
-
const breakpoint = mediaBreakpoint || getBreakpoint(containerWidth);
|
|
123
121
|
const maxWidth = containerWidth;
|
|
124
122
|
const maxHeight = height / width * maxWidth;
|
|
125
123
|
const cardDimensions = {
|
|
@@ -129,12 +127,10 @@ const MediaSingle = props => {
|
|
|
129
127
|
let nonFullWidthSize = containerWidth;
|
|
130
128
|
|
|
131
129
|
if (!isInsideOfBlockNode && rendererAppearance !== 'comment') {
|
|
132
|
-
const isContainerSizeGreaterThanMaxFullPageWidth = containerWidth - padding >=
|
|
130
|
+
const isContainerSizeGreaterThanMaxFullPageWidth = containerWidth - padding >= akEditorDefaultLayoutWidth;
|
|
133
131
|
|
|
134
|
-
if (isContainerSizeGreaterThanMaxFullPageWidth
|
|
135
|
-
nonFullWidthSize =
|
|
136
|
-
} else if (isContainerSizeGreaterThanMaxFullPageWidth) {
|
|
137
|
-
nonFullWidthSize = getAkEditorFullPageMaxWidth(allowDynamicTextSizing);
|
|
132
|
+
if (isContainerSizeGreaterThanMaxFullPageWidth) {
|
|
133
|
+
nonFullWidthSize = akEditorDefaultLayoutWidth;
|
|
138
134
|
} else {
|
|
139
135
|
nonFullWidthSize = containerWidth - padding;
|
|
140
136
|
}
|
|
@@ -14,11 +14,7 @@ const getTableLayoutWidth = (layout, opts) => {
|
|
|
14
14
|
return akEditorWideLayoutWidth;
|
|
15
15
|
|
|
16
16
|
default:
|
|
17
|
-
|
|
18
|
-
containerWidth,
|
|
19
|
-
isDynamicTextSizingEnabled
|
|
20
|
-
} = opts || {};
|
|
21
|
-
return calcLineLength(containerWidth, isDynamicTextSizingEnabled);
|
|
17
|
+
return calcLineLength();
|
|
22
18
|
}
|
|
23
19
|
};
|
|
24
20
|
|
|
@@ -55,8 +51,7 @@ export const Colgroup = props => {
|
|
|
55
51
|
columnWidths,
|
|
56
52
|
layout,
|
|
57
53
|
isNumberColumnEnabled,
|
|
58
|
-
renderWidth
|
|
59
|
-
allowDynamicTextSizing
|
|
54
|
+
renderWidth
|
|
60
55
|
} = props;
|
|
61
56
|
|
|
62
57
|
if (!columnWidths || !isTableResized(columnWidths)) {
|
|
@@ -65,7 +60,6 @@ export const Colgroup = props => {
|
|
|
65
60
|
|
|
66
61
|
|
|
67
62
|
const layoutWidth = getTableLayoutWidth(layout, {
|
|
68
|
-
isDynamicTextSizingEnabled: allowDynamicTextSizing,
|
|
69
63
|
containerWidth: renderWidth
|
|
70
64
|
});
|
|
71
65
|
const maxTableWidth = renderWidth < layoutWidth ? renderWidth : layoutWidth; // If table has a layout of default, it is confined by the defined column width.
|
|
@@ -86,7 +86,6 @@ export const StickyTable = ({
|
|
|
86
86
|
children,
|
|
87
87
|
columnWidths,
|
|
88
88
|
renderWidth,
|
|
89
|
-
allowDynamicTextSizing,
|
|
90
89
|
rowHeight
|
|
91
90
|
}) => {
|
|
92
91
|
return jsx("div", {
|
|
@@ -100,7 +99,7 @@ export const StickyTable = ({
|
|
|
100
99
|
mode: rowHeight > 300 ? 'none' : mode,
|
|
101
100
|
wrapperWidth: wrapperWidth
|
|
102
101
|
}, jsx("div", {
|
|
103
|
-
className: `${TableSharedCssClassName.TABLE_CONTAINER} ${shadowClassNames}`,
|
|
102
|
+
className: `${TableSharedCssClassName.TABLE_CONTAINER} ${shadowClassNames || ''}`,
|
|
104
103
|
"data-layout": layout,
|
|
105
104
|
style: {
|
|
106
105
|
width: tableWidth
|
|
@@ -115,8 +114,7 @@ export const StickyTable = ({
|
|
|
115
114
|
columnWidths: columnWidths,
|
|
116
115
|
layout: layout,
|
|
117
116
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
118
|
-
renderWidth: renderWidth
|
|
119
|
-
allowDynamicTextSizing: allowDynamicTextSizing
|
|
117
|
+
renderWidth: renderWidth
|
|
120
118
|
},
|
|
121
119
|
/**
|
|
122
120
|
* @see https://product-fabric.atlassian.net/browse/ED-10235
|
|
@@ -6,7 +6,6 @@ export const Table = /*#__PURE__*/React.memo(({
|
|
|
6
6
|
columnWidths,
|
|
7
7
|
layout,
|
|
8
8
|
renderWidth,
|
|
9
|
-
allowDynamicTextSizing,
|
|
10
9
|
children
|
|
11
10
|
}) => {
|
|
12
11
|
return /*#__PURE__*/React.createElement("table", {
|
|
@@ -16,7 +15,6 @@ export const Table = /*#__PURE__*/React.memo(({
|
|
|
16
15
|
columnWidths: columnWidths,
|
|
17
16
|
layout: layout,
|
|
18
17
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
19
|
-
renderWidth: renderWidth
|
|
20
|
-
allowDynamicTextSizing: allowDynamicTextSizing
|
|
18
|
+
renderWidth: renderWidth
|
|
21
19
|
}), /*#__PURE__*/React.createElement("tbody", null, children));
|
|
22
20
|
});
|
|
@@ -253,7 +253,6 @@ export class TableContainer extends React.Component {
|
|
|
253
253
|
isNumberColumnEnabled,
|
|
254
254
|
layout,
|
|
255
255
|
renderWidth,
|
|
256
|
-
allowDynamicTextSizing,
|
|
257
256
|
columnWidths,
|
|
258
257
|
stickyHeaders,
|
|
259
258
|
tableNode
|
|
@@ -262,7 +261,7 @@ export class TableContainer extends React.Component {
|
|
|
262
261
|
stickyMode
|
|
263
262
|
} = this.state;
|
|
264
263
|
let tableWidth = calcTableWidth(layout, renderWidth, false);
|
|
265
|
-
const lineLength = calcLineLength(
|
|
264
|
+
const lineLength = calcLineLength();
|
|
266
265
|
let left;
|
|
267
266
|
|
|
268
267
|
if (canUseLinelength(this.props.rendererAppearance) && tableWidth !== 'inherit') {
|
|
@@ -285,10 +284,9 @@ export class TableContainer extends React.Component {
|
|
|
285
284
|
innerRef: this.stickyWrapperRef,
|
|
286
285
|
wrapperWidth: wrapperWidth,
|
|
287
286
|
columnWidths: columnWidths,
|
|
288
|
-
rowHeight: this.headerRowHeight
|
|
289
|
-
allowDynamicTextSizing: allowDynamicTextSizing
|
|
287
|
+
rowHeight: this.headerRowHeight
|
|
290
288
|
}, [children && children[0]]), /*#__PURE__*/React.createElement("div", {
|
|
291
|
-
className: `${TableSharedCssClassName.TABLE_CONTAINER} ${this.props.shadowClassNames}`,
|
|
289
|
+
className: `${TableSharedCssClassName.TABLE_CONTAINER} ${this.props.shadowClassNames || ''}`,
|
|
292
290
|
"data-layout": layout,
|
|
293
291
|
ref: this.props.handleRef,
|
|
294
292
|
style: {
|
|
@@ -304,8 +302,7 @@ export class TableContainer extends React.Component {
|
|
|
304
302
|
columnWidths: columnWidths,
|
|
305
303
|
layout: layout,
|
|
306
304
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
307
|
-
renderWidth: renderWidth
|
|
308
|
-
allowDynamicTextSizing: allowDynamicTextSizing
|
|
305
|
+
renderWidth: renderWidth
|
|
309
306
|
}, this.grabFirstRowRef(children)))));
|
|
310
307
|
}
|
|
311
308
|
|
|
@@ -375,14 +372,26 @@ export class TableProcessor extends React.Component {
|
|
|
375
372
|
|
|
376
373
|
}
|
|
377
374
|
const TableWithShadows = overflowShadow(TableProcessor, {
|
|
378
|
-
overflowSelector: `.${TableSharedCssClassName.TABLE_NODE_WRAPPER}
|
|
375
|
+
overflowSelector: `.${TableSharedCssClassName.TABLE_NODE_WRAPPER}`,
|
|
376
|
+
useShadowObserver: true
|
|
379
377
|
});
|
|
380
378
|
|
|
381
379
|
const TableWithWidth = props => /*#__PURE__*/React.createElement(WidthConsumer, null, ({
|
|
382
380
|
width
|
|
383
381
|
}) => {
|
|
382
|
+
var _props$columnWidths;
|
|
383
|
+
|
|
384
384
|
const renderWidth = props.rendererAppearance === 'full-page' ? width - FullPagePadding * 2 : width;
|
|
385
|
-
|
|
385
|
+
const colWidthsSum = ((_props$columnWidths = props.columnWidths) === null || _props$columnWidths === void 0 ? void 0 : _props$columnWidths.reduce((total, val) => total + val, 0)) || 0;
|
|
386
|
+
|
|
387
|
+
if (colWidthsSum) {
|
|
388
|
+
return /*#__PURE__*/React.createElement(TableWithShadows, _extends({
|
|
389
|
+
renderWidth: renderWidth
|
|
390
|
+
}, props));
|
|
391
|
+
} // there should not be a case when colWidthsSum is 0 and table is in overflow state - so no need to render shadows in this case
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
return /*#__PURE__*/React.createElement(TableProcessor, _extends({
|
|
386
395
|
renderWidth: renderWidth
|
|
387
396
|
}, props));
|
|
388
397
|
});
|
|
@@ -116,8 +116,11 @@ export const withSortableColumn = WrapperComponent => {
|
|
|
116
116
|
|
|
117
117
|
_defineProperty(this, "onKeyPress", event => {
|
|
118
118
|
const keys = [' ', 'Enter', 'Spacebar'];
|
|
119
|
+
const {
|
|
120
|
+
tagName
|
|
121
|
+
} = event.target; // trigger sorting if space or enter are clicked but not when in an input field (template variables)
|
|
119
122
|
|
|
120
|
-
if (keys.includes(event.key)) {
|
|
123
|
+
if (keys.includes(event.key) && !IgnoreSorting.includes(tagName)) {
|
|
121
124
|
event.preventDefault();
|
|
122
125
|
this.onClick(event);
|
|
123
126
|
}
|
|
@@ -5,7 +5,7 @@ import { validateADFEntity, findAndTrackUnsupportedContentNodes } from '@atlaski
|
|
|
5
5
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from './analytics/enums';
|
|
6
6
|
import { PLATFORM } from './analytics/events';
|
|
7
7
|
import { trackUnsupportedContentLevels } from './analytics/unsupported-content';
|
|
8
|
-
import { transformMediaLinkMarks } from '@atlaskit/adf-utils';
|
|
8
|
+
import { transformMediaLinkMarks } from '@atlaskit/adf-utils/transforms';
|
|
9
9
|
const SUPPORTS_HIRES_TIMER_API = !!(window.performance && performance.now);
|
|
10
10
|
|
|
11
11
|
const withStopwatch = cb => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React, { Component } from 'react';
|
|
3
|
-
import { filter } from '@atlaskit/adf-utils';
|
|
3
|
+
import { filter } from '@atlaskit/adf-utils/traverse';
|
|
4
4
|
import { Card, CardLoading, CardError } from '@atlaskit/media-card';
|
|
5
5
|
import { getMediaClient } from '@atlaskit/media-client';
|
|
6
6
|
import { withImageLoader } from '@atlaskit/editor-common/utils';
|
|
@@ -7,9 +7,7 @@ import { breakoutConsts } from '@atlaskit/editor-common/utils';
|
|
|
7
7
|
* More info: https://product-fabric.atlassian.net/wiki/spaces/E/pages/1216218119/Renderer+SSR+for+Breakout+Nodes
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
export function BreakoutSSRInlineScript({
|
|
11
|
-
allowDynamicTextSizing
|
|
12
|
-
}) {
|
|
10
|
+
export function BreakoutSSRInlineScript() {
|
|
13
11
|
/**
|
|
14
12
|
* Should only inline this script while SSR,
|
|
15
13
|
* not needed on the client side.
|
|
@@ -19,7 +17,7 @@ export function BreakoutSSRInlineScript({
|
|
|
19
17
|
}
|
|
20
18
|
|
|
21
19
|
const id = Math.floor(Math.random() * (9999999999 - 9999 + 1)) + 9999;
|
|
22
|
-
const context = createBreakoutInlineScript(id
|
|
20
|
+
const context = createBreakoutInlineScript(id);
|
|
23
21
|
return /*#__PURE__*/React.createElement("script", {
|
|
24
22
|
"data-breakout-script-id": id,
|
|
25
23
|
dangerouslySetInnerHTML: {
|
|
@@ -27,11 +25,11 @@ export function BreakoutSSRInlineScript({
|
|
|
27
25
|
}
|
|
28
26
|
});
|
|
29
27
|
}
|
|
30
|
-
export function createBreakoutInlineScript(id
|
|
28
|
+
export function createBreakoutInlineScript(id) {
|
|
31
29
|
return `
|
|
32
30
|
(function(window){
|
|
33
31
|
${breakoutInlineScriptContext};
|
|
34
|
-
(${applyBreakoutAfterSSR.toString()})("${id}",
|
|
32
|
+
(${applyBreakoutAfterSSR.toString()})("${id}", breakoutConsts);
|
|
35
33
|
})(window);
|
|
36
34
|
`;
|
|
37
35
|
}
|
|
@@ -44,7 +42,7 @@ export const breakoutInlineScriptContext = `
|
|
|
44
42
|
breakoutConsts.calcWideWidth = ${breakoutConsts.calcWideWidth.toString()};
|
|
45
43
|
`;
|
|
46
44
|
|
|
47
|
-
function applyBreakoutAfterSSR(id,
|
|
45
|
+
function applyBreakoutAfterSSR(id, breakoutConsts) {
|
|
48
46
|
const MEDIA_NODE_TYPE = 'mediaSingle';
|
|
49
47
|
const WIDE_LAYOUT_MODES = ['full-width', 'wide'];
|
|
50
48
|
|
|
@@ -98,7 +96,7 @@ function applyBreakoutAfterSSR(id, allowDynamicTextSizing, breakoutConsts) {
|
|
|
98
96
|
// https://bitbucket.org/atlassian/atlassian-frontend/src/77938aee0c140d02ff99b98a03849be1236865b4/packages/editor/renderer/src/react/nodes/table.tsx#table.tsx-235:245
|
|
99
97
|
|
|
100
98
|
if (node.classList.contains('pm-table-container')) {
|
|
101
|
-
const lineLength = breakoutConsts.calcLineLength(
|
|
99
|
+
const lineLength = breakoutConsts.calcLineLength();
|
|
102
100
|
const left = lineLength / 2 - parseInt(width) / 2;
|
|
103
101
|
|
|
104
102
|
if (left < 0) {
|
|
@@ -6,7 +6,7 @@ import React, { Fragment, useContext, useLayoutEffect, useRef } from 'react';
|
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { PureComponent } from 'react';
|
|
8
8
|
import { getSchemaBasedOnStage } from '@atlaskit/adf-schema/schema-default';
|
|
9
|
-
import { reduce } from '@atlaskit/adf-utils';
|
|
9
|
+
import { reduce } from '@atlaskit/adf-utils/traverse';
|
|
10
10
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
11
11
|
import { UnsupportedBlock, BaseTheme, WidthProvider, WithCreateAnalyticsEvent, IntlErrorBoundary } from '@atlaskit/editor-common/ui';
|
|
12
12
|
import { getAnalyticsAppearance, getAnalyticsEventSeverity, getResponseEndTime, startMeasure, stopMeasure, shouldForceTracking, measureTTI } from '@atlaskit/editor-common/utils';
|
|
@@ -192,7 +192,6 @@ export class Renderer extends PureComponent {
|
|
|
192
192
|
appearance: props.appearance,
|
|
193
193
|
disableHeadingIDs: props.disableHeadingIDs,
|
|
194
194
|
disableActions: props.disableActions,
|
|
195
|
-
allowDynamicTextSizing: props.allowDynamicTextSizing,
|
|
196
195
|
allowHeadingAnchorLinks: props.allowHeadingAnchorLinks,
|
|
197
196
|
allowColumnSorting: props.allowColumnSorting,
|
|
198
197
|
fireAnalyticsEvent: this.fireAnalyticsEvent,
|
|
@@ -218,7 +217,6 @@ export class Renderer extends PureComponent {
|
|
|
218
217
|
onError,
|
|
219
218
|
appearance,
|
|
220
219
|
adfStage,
|
|
221
|
-
allowDynamicTextSizing,
|
|
222
220
|
truncated,
|
|
223
221
|
maxHeight,
|
|
224
222
|
fadeOutHeight,
|
|
@@ -299,7 +297,6 @@ export class Renderer extends PureComponent {
|
|
|
299
297
|
}
|
|
300
298
|
}, jsx(SmartCardStorageProvider, null, jsx(RendererWrapper, {
|
|
301
299
|
appearance: appearance,
|
|
302
|
-
dynamicTextSizing: !!allowDynamicTextSizing,
|
|
303
300
|
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
304
301
|
allowColumnSorting: allowColumnSorting,
|
|
305
302
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
@@ -308,9 +305,7 @@ export class Renderer extends PureComponent {
|
|
|
308
305
|
innerRef: this.editorRef,
|
|
309
306
|
onClick: handleWrapperOnClick,
|
|
310
307
|
onMouseDown: this.onMouseDownEditView
|
|
311
|
-
}, enableSsrInlineScripts ? jsx(BreakoutSSRInlineScript, {
|
|
312
|
-
allowDynamicTextSizing: !!allowDynamicTextSizing
|
|
313
|
-
}) : null, jsx(RendererActionsInternalUpdater, {
|
|
308
|
+
}, enableSsrInlineScripts ? jsx(BreakoutSSRInlineScript, null) : null, jsx(RendererActionsInternalUpdater, {
|
|
314
309
|
doc: pmDoc,
|
|
315
310
|
schema: schema,
|
|
316
311
|
onAnalyticsEvent: this.fireAnalyticsEvent
|
|
@@ -335,7 +330,6 @@ export class Renderer extends PureComponent {
|
|
|
335
330
|
|
|
336
331
|
return jsx(RendererWrapper, {
|
|
337
332
|
appearance: appearance,
|
|
338
|
-
dynamicTextSizing: !!allowDynamicTextSizing,
|
|
339
333
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
340
334
|
allowPlaceholderText: allowPlaceholderText,
|
|
341
335
|
allowColumnSorting: allowColumnSorting,
|
|
@@ -386,7 +380,6 @@ const RendererWithAnalytics = /*#__PURE__*/React.memo(props => jsx(FabricEditorA
|
|
|
386
380
|
const RendererWrapper = /*#__PURE__*/React.memo(props => {
|
|
387
381
|
const {
|
|
388
382
|
allowColumnSorting,
|
|
389
|
-
dynamicTextSizing,
|
|
390
383
|
allowNestedHeaderLinks,
|
|
391
384
|
innerRef,
|
|
392
385
|
appearance,
|
|
@@ -397,8 +390,7 @@ const RendererWrapper = /*#__PURE__*/React.memo(props => {
|
|
|
397
390
|
return jsx(WidthProvider, {
|
|
398
391
|
className: "ak-renderer-wrapper"
|
|
399
392
|
}, jsx(BaseTheme, {
|
|
400
|
-
|
|
401
|
-
baseFontSize: !dynamicTextSizing && appearance && appearance !== 'comment' ? akEditorFullPageDefaultFontSize : undefined
|
|
393
|
+
baseFontSize: appearance && appearance !== 'comment' ? akEditorFullPageDefaultFontSize : undefined
|
|
402
394
|
}, jsx("div", {
|
|
403
395
|
ref: innerRef,
|
|
404
396
|
onClick: onClick,
|