@atlaskit/renderer 130.0.1 → 130.2.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 +26 -0
- package/dist/cjs/react/index.js +3 -2
- package/dist/cjs/react/nodes/mediaInline.js +8 -4
- package/dist/cjs/react/nodes/table/content-mode.js +2 -62
- package/dist/cjs/react/nodes/table/table.js +6 -3
- package/dist/cjs/react/nodes/table.js +6 -3
- package/dist/cjs/react/nodes/tableNew.js +6 -3
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/react/index.js +3 -2
- package/dist/es2019/react/nodes/mediaInline.js +8 -4
- package/dist/es2019/react/nodes/table/content-mode.js +1 -62
- package/dist/es2019/react/nodes/table/table.js +6 -3
- package/dist/es2019/react/nodes/table.js +6 -3
- package/dist/es2019/react/nodes/tableNew.js +6 -3
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/react/index.js +3 -2
- package/dist/esm/react/nodes/mediaInline.js +8 -4
- package/dist/esm/react/nodes/table/content-mode.js +1 -61
- package/dist/esm/react/nodes/table/table.js +6 -3
- package/dist/esm/react/nodes/table.js +6 -3
- package/dist/esm/react/nodes/tableNew.js +6 -3
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/types/react/nodes/index.d.ts +1 -0
- package/dist/types/react/nodes/mediaInline.d.ts +1 -0
- package/dist/types/react/nodes/table/content-mode.d.ts +1 -25
- package/dist/types/types/mediaOptions.d.ts +6 -0
- package/dist/types-ts4.5/react/nodes/index.d.ts +1 -0
- package/dist/types-ts4.5/react/nodes/mediaInline.d.ts +1 -0
- package/dist/types-ts4.5/react/nodes/table/content-mode.d.ts +1 -25
- package/dist/types-ts4.5/types/mediaOptions.d.ts +6 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 130.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`3394e81c10e6e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3394e81c10e6e) -
|
|
8
|
+
Fix table flicker on focus: defer data-initial-width-mode removal to after colgroup update.
|
|
9
|
+
Consolidate isTableInContentMode and hasTableBeenResized into editor-common/table.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 130.1.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [`b6bb07e5d72ac`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b6bb07e5d72ac) -
|
|
20
|
+
[ux] Fix for #hot-301450, add new media option for fallback media name fetcher to allow confluence
|
|
21
|
+
to use the attachment service instead of the media service to get filenames. After DC -> Cloud
|
|
22
|
+
migration filenames were not properly copied across to the media service causing inline media to
|
|
23
|
+
show an error.
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
|
|
3
29
|
## 130.0.1
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
package/dist/cjs/react/index.js
CHANGED
|
@@ -593,9 +593,10 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
593
593
|
}, {
|
|
594
594
|
key: "getMediaInlineProps",
|
|
595
595
|
value: function getMediaInlineProps(node) {
|
|
596
|
-
var _this$media6;
|
|
596
|
+
var _this$media6, _this$media7;
|
|
597
597
|
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
598
|
-
ssr: (_this$media6 = this.media) === null || _this$media6 === void 0 ? void 0 : _this$media6.ssr
|
|
598
|
+
ssr: (_this$media6 = this.media) === null || _this$media6 === void 0 ? void 0 : _this$media6.ssr,
|
|
599
|
+
fallbackMediaNameFetcher: (_this$media7 = this.media) === null || _this$media7 === void 0 ? void 0 : _this$media7.fallbackMediaNameFetcher
|
|
599
600
|
});
|
|
600
601
|
}
|
|
601
602
|
}, {
|
|
@@ -31,7 +31,8 @@ var RenderMediaInline = function RenderMediaInline(_ref) {
|
|
|
31
31
|
clipboardAttrs = _ref.clipboardAttrs,
|
|
32
32
|
collectionName = _ref.collection,
|
|
33
33
|
eventHandlers = _ref.eventHandlers,
|
|
34
|
-
identifier = _ref.identifier
|
|
34
|
+
identifier = _ref.identifier,
|
|
35
|
+
fallbackMediaNameFetcher = _ref.fallbackMediaNameFetcher;
|
|
35
36
|
var _useState = (0, _react.useState)(),
|
|
36
37
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
37
38
|
contextIdentifier = _useState2[0],
|
|
@@ -141,7 +142,8 @@ var RenderMediaInline = function RenderMediaInline(_ref) {
|
|
|
141
142
|
shouldOpenMediaViewer: shouldOpenMediaViewer,
|
|
142
143
|
shouldDisplayToolTip: shouldDisplayToolTip,
|
|
143
144
|
mediaClientConfig: mediaClient.mediaClientConfig,
|
|
144
|
-
mediaViewerItems: Array.from(_MediaCard.mediaIdentifierMap.values())
|
|
145
|
+
mediaViewerItems: Array.from(_MediaCard.mediaIdentifierMap.values()),
|
|
146
|
+
fallbackMediaNameFetcher: fallbackMediaNameFetcher
|
|
145
147
|
}))
|
|
146
148
|
);
|
|
147
149
|
};
|
|
@@ -156,7 +158,8 @@ var MediaInline = function MediaInline(props) {
|
|
|
156
158
|
width = props.width,
|
|
157
159
|
height = props.height,
|
|
158
160
|
marks = props.marks,
|
|
159
|
-
ssr = props.ssr
|
|
161
|
+
ssr = props.ssr,
|
|
162
|
+
fallbackMediaNameFetcher = props.fallbackMediaNameFetcher;
|
|
160
163
|
var clipboardAttrs = {
|
|
161
164
|
id: id,
|
|
162
165
|
collection: collection
|
|
@@ -209,7 +212,8 @@ var MediaInline = function MediaInline(props) {
|
|
|
209
212
|
rendererAppearance: rendererAppearance,
|
|
210
213
|
intl: intl,
|
|
211
214
|
collection: collection,
|
|
212
|
-
featureFlags: featureFlags
|
|
215
|
+
featureFlags: featureFlags,
|
|
216
|
+
fallbackMediaNameFetcher: fallbackMediaNameFetcher
|
|
213
217
|
});
|
|
214
218
|
};
|
|
215
219
|
var _default = exports.default = (0, _reactIntl.injectIntl)(MediaInline);
|
|
@@ -3,69 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var
|
|
8
|
-
/**
|
|
9
|
-
* Checks whether any cell in the first row of the table has a colwidth attribute set.
|
|
10
|
-
*
|
|
11
|
-
* This mirrors `hasTableColumnBeenResized` from editor-plugin-table's `colgroup.ts`.
|
|
12
|
-
*/
|
|
13
|
-
var hasColWidths = exports.hasColWidths = function hasColWidths(tableNode) {
|
|
14
|
-
var firstRow = tableNode.content.firstChild;
|
|
15
|
-
if (!firstRow) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
for (var i = 0; i < firstRow.childCount; i++) {
|
|
19
|
-
if (firstRow.child(i).attrs.colwidth) {
|
|
20
|
-
return true;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return false;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Mirrors `isContentModeSupported()` from editor-plugin-table's `tableMode.ts`.
|
|
27
|
-
*
|
|
28
|
-
* In the editor this checks `allowColumnResizing && allowTableResizing && isFullPageEditor`.
|
|
29
|
-
* In the renderer there is no separate `allowColumnResizing` flag — `allowTableResizing`
|
|
30
|
-
* covers both — and `isFullPageEditor` maps to `rendererAppearance === 'full-page'`.
|
|
31
|
-
*/
|
|
32
|
-
var isContentModeSupported = function isContentModeSupported(_ref) {
|
|
6
|
+
exports.isContentModeSupported = void 0;
|
|
7
|
+
var isContentModeSupported = exports.isContentModeSupported = function isContentModeSupported(_ref) {
|
|
33
8
|
var allowTableResizing = _ref.allowTableResizing,
|
|
34
9
|
rendererAppearance = _ref.rendererAppearance;
|
|
35
10
|
return !!allowTableResizing && (rendererAppearance === 'full-page' || rendererAppearance === 'full-width' || rendererAppearance === 'max');
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Determines whether a table should render in content mode.
|
|
40
|
-
*
|
|
41
|
-
* Content mode tables have no fixed column widths — the browser sizes columns to fit their
|
|
42
|
-
* content (table-layout: auto). A table is in content mode when:
|
|
43
|
-
*
|
|
44
|
-
* 1. The feature is supported (table resizing enabled, full-page appearance)
|
|
45
|
-
* 2. The table is at the top level of the document (not nested in another table or block node)
|
|
46
|
-
* 3. The table node exists
|
|
47
|
-
* 4. `table.attrs.width` is null (no explicit width set by the user)
|
|
48
|
-
* 5. No cells in the first row have `colwidth` set (table has not been column-resized)
|
|
49
|
-
* 6. The `platform_editor_table_fit_to_content_auto_convert` experiment is enabled
|
|
50
|
-
*
|
|
51
|
-
* This mirrors `isTableInContentMode()` from editor-plugin-table's `tableMode.ts`.
|
|
52
|
-
*
|
|
53
|
-
* SSR-safe: `expValEquals` returns false on the server (FeatureGates not initialised),
|
|
54
|
-
* so content mode is never active during SSR — no hydration mismatch.
|
|
55
|
-
*/
|
|
56
|
-
var isTableInContentMode = exports.isTableInContentMode = function isTableInContentMode(_ref2) {
|
|
57
|
-
var tableNode = _ref2.tableNode,
|
|
58
|
-
allowTableResizing = _ref2.allowTableResizing,
|
|
59
|
-
rendererAppearance = _ref2.rendererAppearance,
|
|
60
|
-
isTableNested = _ref2.isTableNested;
|
|
61
|
-
if (!(0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true)) {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
if (!tableNode) {
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
return !isTableNested && isContentModeSupported({
|
|
68
|
-
allowTableResizing: allowTableResizing,
|
|
69
|
-
rendererAppearance: rendererAppearance
|
|
70
|
-
}) && tableNode.attrs.width === null && !hasColWidths(tableNode) && tableNode.attrs.layout === 'align-start';
|
|
71
11
|
};
|
|
@@ -12,6 +12,7 @@ var _nodeWidth = require("@atlaskit/editor-common/node-width");
|
|
|
12
12
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
13
13
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
14
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
15
|
+
var _table = require("@atlaskit/editor-common/table");
|
|
15
16
|
var _contentMode = require("./content-mode");
|
|
16
17
|
var Table = exports.Table = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
17
18
|
var _tableNode$attrs;
|
|
@@ -55,10 +56,12 @@ var Table = exports.Table = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
55
56
|
}
|
|
56
57
|
var tableLayout = tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.layout;
|
|
57
58
|
var tableDisplayMode = tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.displayMode;
|
|
58
|
-
var isContentMode = (0,
|
|
59
|
+
var isContentMode = (0, _table.isTableInContentMode)({
|
|
59
60
|
tableNode: tableNode,
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
isSupported: (0, _contentMode.isContentModeSupported)({
|
|
62
|
+
allowTableResizing: allowTableResizing,
|
|
63
|
+
rendererAppearance: rendererAppearance
|
|
64
|
+
}),
|
|
62
65
|
isTableNested: isInsideOfBlockNode || isInsideOfTable
|
|
63
66
|
}) && (0, _expValEquals.expValEquals)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true);
|
|
64
67
|
return /*#__PURE__*/_react.default.createElement("table", (0, _extends2.default)({}, (0, _platformFeatureFlags.fg)('platform_renderer_isPresentational') && {
|
|
@@ -33,6 +33,7 @@ var _appearance = require("../utils/appearance");
|
|
|
33
33
|
var _TableStickyScrollbar = require("./TableStickyScrollbar");
|
|
34
34
|
var _tableNew = require("./tableNew");
|
|
35
35
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
36
|
+
var _table2 = require("@atlaskit/editor-common/table");
|
|
36
37
|
var _contentMode = require("./table/content-mode");
|
|
37
38
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
38
39
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -521,10 +522,12 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
521
522
|
// instead of 760 that was set on tableNode when the table had been published.
|
|
522
523
|
finalTableContainerWidth = ((tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.layout) === 'align-start' || (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.layout) === 'center') && tableNode !== null && tableNode !== void 0 && tableNode.attrs.width ? fixTableSSRResizing ? "calc(".concat(tableWidthCSS, ")") : tableWidth : 'inherit';
|
|
523
524
|
}
|
|
524
|
-
var isContentModeTable = (0,
|
|
525
|
+
var isContentModeTable = (0, _table2.isTableInContentMode)({
|
|
525
526
|
tableNode: tableNode,
|
|
526
|
-
|
|
527
|
-
|
|
527
|
+
isSupported: (0, _contentMode.isContentModeSupported)({
|
|
528
|
+
allowTableResizing: allowTableResizing,
|
|
529
|
+
rendererAppearance: rendererAppearance
|
|
530
|
+
}),
|
|
528
531
|
isTableNested: isInsideOfBlockNode || isInsideOfTable
|
|
529
532
|
}) && (0, _expValEquals.expValEquals)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true);
|
|
530
533
|
var style;
|
|
@@ -26,6 +26,7 @@ var _table = require("./table/table");
|
|
|
26
26
|
var _appearance = require("../utils/appearance");
|
|
27
27
|
var _TableStickyScrollbar = require("./TableStickyScrollbar");
|
|
28
28
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
29
|
+
var _table2 = require("@atlaskit/editor-common/table");
|
|
29
30
|
var _contentMode = require("./table/content-mode");
|
|
30
31
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
31
32
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -478,10 +479,12 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
478
479
|
// instead of 760 that was set on tableNode when the table had been published.
|
|
479
480
|
finalTableContainerWidth = ((tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.layout) === 'align-start' || (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.layout) === 'center') && tableNode !== null && tableNode !== void 0 && tableNode.attrs.width ? "calc(".concat(tableWidthCSS, ")") : 'inherit';
|
|
480
481
|
}
|
|
481
|
-
var isContentModeTable = (0,
|
|
482
|
+
var isContentModeTable = (0, _table2.isTableInContentMode)({
|
|
482
483
|
tableNode: tableNode,
|
|
483
|
-
|
|
484
|
-
|
|
484
|
+
isSupported: (0, _contentMode.isContentModeSupported)({
|
|
485
|
+
allowTableResizing: allowTableResizing,
|
|
486
|
+
rendererAppearance: rendererAppearance
|
|
487
|
+
}),
|
|
485
488
|
isTableNested: isInsideOfBlockNode || isInsideOfTable
|
|
486
489
|
}) && (0, _expValEquals.expValEquals)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true);
|
|
487
490
|
var style = _objectSpread(_objectSpread({}, isContentModeTable && {
|
|
@@ -71,7 +71,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
71
71
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
72
72
|
var RENDER_EVENT_SAMPLE_RATE = 0.2;
|
|
73
73
|
var packageName = "@atlaskit/renderer";
|
|
74
|
-
var packageVersion = "
|
|
74
|
+
var packageVersion = "130.1.0";
|
|
75
75
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
76
76
|
containerName: 'ak-renderer-wrapper',
|
|
77
77
|
containerType: 'inline-size'
|
|
@@ -531,10 +531,11 @@ export default class ReactSerializer {
|
|
|
531
531
|
};
|
|
532
532
|
}
|
|
533
533
|
getMediaInlineProps(node) {
|
|
534
|
-
var _this$media6;
|
|
534
|
+
var _this$media6, _this$media7;
|
|
535
535
|
return {
|
|
536
536
|
...this.getProps(node),
|
|
537
|
-
ssr: (_this$media6 = this.media) === null || _this$media6 === void 0 ? void 0 : _this$media6.ssr
|
|
537
|
+
ssr: (_this$media6 = this.media) === null || _this$media6 === void 0 ? void 0 : _this$media6.ssr,
|
|
538
|
+
fallbackMediaNameFetcher: (_this$media7 = this.media) === null || _this$media7 === void 0 ? void 0 : _this$media7.fallbackMediaNameFetcher
|
|
538
539
|
};
|
|
539
540
|
}
|
|
540
541
|
getTaskItemProps(node, path = []) {
|
|
@@ -16,7 +16,8 @@ const RenderMediaInline = ({
|
|
|
16
16
|
clipboardAttrs,
|
|
17
17
|
collection: collectionName,
|
|
18
18
|
eventHandlers,
|
|
19
|
-
identifier
|
|
19
|
+
identifier,
|
|
20
|
+
fallbackMediaNameFetcher
|
|
20
21
|
}) => {
|
|
21
22
|
const [contextIdentifier, setContextIdentifier] = useState();
|
|
22
23
|
const [fileState, setFileState] = useState();
|
|
@@ -107,7 +108,8 @@ const RenderMediaInline = ({
|
|
|
107
108
|
shouldOpenMediaViewer: shouldOpenMediaViewer,
|
|
108
109
|
shouldDisplayToolTip: shouldDisplayToolTip,
|
|
109
110
|
mediaClientConfig: mediaClient.mediaClientConfig,
|
|
110
|
-
mediaViewerItems: Array.from(mediaIdentifierMap.values())
|
|
111
|
+
mediaViewerItems: Array.from(mediaIdentifierMap.values()),
|
|
112
|
+
fallbackMediaNameFetcher: fallbackMediaNameFetcher
|
|
111
113
|
}))
|
|
112
114
|
);
|
|
113
115
|
};
|
|
@@ -123,7 +125,8 @@ const MediaInline = props => {
|
|
|
123
125
|
width,
|
|
124
126
|
height,
|
|
125
127
|
marks,
|
|
126
|
-
ssr
|
|
128
|
+
ssr,
|
|
129
|
+
fallbackMediaNameFetcher
|
|
127
130
|
} = props;
|
|
128
131
|
const clipboardAttrs = {
|
|
129
132
|
id,
|
|
@@ -174,7 +177,8 @@ const MediaInline = props => {
|
|
|
174
177
|
rendererAppearance: rendererAppearance,
|
|
175
178
|
intl: intl,
|
|
176
179
|
collection: collection,
|
|
177
|
-
featureFlags: featureFlags
|
|
180
|
+
featureFlags: featureFlags,
|
|
181
|
+
fallbackMediaNameFetcher: fallbackMediaNameFetcher
|
|
178
182
|
});
|
|
179
183
|
};
|
|
180
184
|
export default injectIntl(MediaInline);
|
|
@@ -1,67 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Checks whether any cell in the first row of the table has a colwidth attribute set.
|
|
4
|
-
*
|
|
5
|
-
* This mirrors `hasTableColumnBeenResized` from editor-plugin-table's `colgroup.ts`.
|
|
6
|
-
*/
|
|
7
|
-
export const hasColWidths = tableNode => {
|
|
8
|
-
const firstRow = tableNode.content.firstChild;
|
|
9
|
-
if (!firstRow) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
for (let i = 0; i < firstRow.childCount; i++) {
|
|
13
|
-
if (firstRow.child(i).attrs.colwidth) {
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return false;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Mirrors `isContentModeSupported()` from editor-plugin-table's `tableMode.ts`.
|
|
21
|
-
*
|
|
22
|
-
* In the editor this checks `allowColumnResizing && allowTableResizing && isFullPageEditor`.
|
|
23
|
-
* In the renderer there is no separate `allowColumnResizing` flag — `allowTableResizing`
|
|
24
|
-
* covers both — and `isFullPageEditor` maps to `rendererAppearance === 'full-page'`.
|
|
25
|
-
*/
|
|
26
|
-
const isContentModeSupported = ({
|
|
1
|
+
export const isContentModeSupported = ({
|
|
27
2
|
allowTableResizing,
|
|
28
3
|
rendererAppearance
|
|
29
4
|
}) => {
|
|
30
5
|
return !!allowTableResizing && (rendererAppearance === 'full-page' || rendererAppearance === 'full-width' || rendererAppearance === 'max');
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Determines whether a table should render in content mode.
|
|
35
|
-
*
|
|
36
|
-
* Content mode tables have no fixed column widths — the browser sizes columns to fit their
|
|
37
|
-
* content (table-layout: auto). A table is in content mode when:
|
|
38
|
-
*
|
|
39
|
-
* 1. The feature is supported (table resizing enabled, full-page appearance)
|
|
40
|
-
* 2. The table is at the top level of the document (not nested in another table or block node)
|
|
41
|
-
* 3. The table node exists
|
|
42
|
-
* 4. `table.attrs.width` is null (no explicit width set by the user)
|
|
43
|
-
* 5. No cells in the first row have `colwidth` set (table has not been column-resized)
|
|
44
|
-
* 6. The `platform_editor_table_fit_to_content_auto_convert` experiment is enabled
|
|
45
|
-
*
|
|
46
|
-
* This mirrors `isTableInContentMode()` from editor-plugin-table's `tableMode.ts`.
|
|
47
|
-
*
|
|
48
|
-
* SSR-safe: `expValEquals` returns false on the server (FeatureGates not initialised),
|
|
49
|
-
* so content mode is never active during SSR — no hydration mismatch.
|
|
50
|
-
*/
|
|
51
|
-
export const isTableInContentMode = ({
|
|
52
|
-
tableNode,
|
|
53
|
-
allowTableResizing,
|
|
54
|
-
rendererAppearance,
|
|
55
|
-
isTableNested
|
|
56
|
-
}) => {
|
|
57
|
-
if (!expValEqualsNoExposure('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true)) {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
if (!tableNode) {
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
return !isTableNested && isContentModeSupported({
|
|
64
|
-
allowTableResizing,
|
|
65
|
-
rendererAppearance
|
|
66
|
-
}) && tableNode.attrs.width === null && !hasColWidths(tableNode) && tableNode.attrs.layout === 'align-start';
|
|
67
6
|
};
|
|
@@ -5,7 +5,8 @@ import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
|
5
5
|
import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
7
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
|
-
import { isTableInContentMode } from '
|
|
8
|
+
import { isTableInContentMode } from '@atlaskit/editor-common/table';
|
|
9
|
+
import { isContentModeSupported } from './content-mode';
|
|
9
10
|
export const Table = /*#__PURE__*/React.memo(({
|
|
10
11
|
innerRef,
|
|
11
12
|
isNumberColumnEnabled,
|
|
@@ -49,8 +50,10 @@ export const Table = /*#__PURE__*/React.memo(({
|
|
|
49
50
|
const tableDisplayMode = tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.displayMode;
|
|
50
51
|
const isContentMode = isTableInContentMode({
|
|
51
52
|
tableNode,
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
isSupported: isContentModeSupported({
|
|
54
|
+
allowTableResizing,
|
|
55
|
+
rendererAppearance
|
|
56
|
+
}),
|
|
54
57
|
isTableNested: isInsideOfBlockNode || isInsideOfTable
|
|
55
58
|
}) && expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true);
|
|
56
59
|
return /*#__PURE__*/React.createElement("table", _extends({}, fg('platform_renderer_isPresentational') && {
|
|
@@ -20,7 +20,8 @@ import { isCommentAppearance, isFullPageAppearance, isFullWidthAppearance, isFul
|
|
|
20
20
|
import { TableStickyScrollbar } from './TableStickyScrollbar';
|
|
21
21
|
import { TableProcessorWithContainerStyles } from './tableNew';
|
|
22
22
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
23
|
-
import { isTableInContentMode } from '
|
|
23
|
+
import { isTableInContentMode } from '@atlaskit/editor-common/table';
|
|
24
|
+
import { isContentModeSupported } from './table/content-mode';
|
|
24
25
|
export const isTableResizingEnabled = appearance => isFullWidthOrFullPageAppearance(appearance) || isCommentAppearance(appearance);
|
|
25
26
|
export const isStickyScrollbarEnabled = appearance => isFullWidthOrFullPageAppearance(appearance) && editorExperiment('platform_renderer_table_sticky_scrollbar', true, {
|
|
26
27
|
exposure: true
|
|
@@ -464,8 +465,10 @@ export class TableContainer extends React.Component {
|
|
|
464
465
|
}
|
|
465
466
|
const isContentModeTable = isTableInContentMode({
|
|
466
467
|
tableNode,
|
|
467
|
-
|
|
468
|
-
|
|
468
|
+
isSupported: isContentModeSupported({
|
|
469
|
+
allowTableResizing,
|
|
470
|
+
rendererAppearance
|
|
471
|
+
}),
|
|
469
472
|
isTableNested: isInsideOfBlockNode || isInsideOfTable
|
|
470
473
|
}) && expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true);
|
|
471
474
|
let style;
|
|
@@ -15,7 +15,8 @@ import { Table } from './table/table';
|
|
|
15
15
|
import { isCommentAppearance, isFullWidthOrFullPageAppearance, isFullWidthAppearance, isMaxWidthAppearance, isFullPageAppearance } from '../utils/appearance';
|
|
16
16
|
import { TableStickyScrollbar } from './TableStickyScrollbar';
|
|
17
17
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
18
|
-
import { isTableInContentMode } from '
|
|
18
|
+
import { isTableInContentMode } from '@atlaskit/editor-common/table';
|
|
19
|
+
import { isContentModeSupported } from './table/content-mode';
|
|
19
20
|
const stickyContainerBaseStyles = {
|
|
20
21
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
21
22
|
height: "var(--ds-space-250, 20px)",
|
|
@@ -424,8 +425,10 @@ export class TableContainer extends React.Component {
|
|
|
424
425
|
}
|
|
425
426
|
const isContentModeTable = isTableInContentMode({
|
|
426
427
|
tableNode,
|
|
427
|
-
|
|
428
|
-
|
|
428
|
+
isSupported: isContentModeSupported({
|
|
429
|
+
allowTableResizing,
|
|
430
|
+
rendererAppearance
|
|
431
|
+
}),
|
|
429
432
|
isTableNested: isInsideOfBlockNode || isInsideOfTable
|
|
430
433
|
}) && expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true);
|
|
431
434
|
const style = {
|
|
@@ -57,7 +57,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
57
57
|
const TABLE_INFO_TIMEOUT = 10000;
|
|
58
58
|
const RENDER_EVENT_SAMPLE_RATE = 0.2;
|
|
59
59
|
const packageName = "@atlaskit/renderer";
|
|
60
|
-
const packageVersion = "
|
|
60
|
+
const packageVersion = "130.1.0";
|
|
61
61
|
const setAsQueryContainerStyles = css({
|
|
62
62
|
containerName: 'ak-renderer-wrapper',
|
|
63
63
|
containerType: 'inline-size'
|
package/dist/esm/react/index.js
CHANGED
|
@@ -586,9 +586,10 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
586
586
|
}, {
|
|
587
587
|
key: "getMediaInlineProps",
|
|
588
588
|
value: function getMediaInlineProps(node) {
|
|
589
|
-
var _this$media6;
|
|
589
|
+
var _this$media6, _this$media7;
|
|
590
590
|
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
591
|
-
ssr: (_this$media6 = this.media) === null || _this$media6 === void 0 ? void 0 : _this$media6.ssr
|
|
591
|
+
ssr: (_this$media6 = this.media) === null || _this$media6 === void 0 ? void 0 : _this$media6.ssr,
|
|
592
|
+
fallbackMediaNameFetcher: (_this$media7 = this.media) === null || _this$media7 === void 0 ? void 0 : _this$media7.fallbackMediaNameFetcher
|
|
592
593
|
});
|
|
593
594
|
}
|
|
594
595
|
}, {
|
|
@@ -22,7 +22,8 @@ var RenderMediaInline = function RenderMediaInline(_ref) {
|
|
|
22
22
|
clipboardAttrs = _ref.clipboardAttrs,
|
|
23
23
|
collectionName = _ref.collection,
|
|
24
24
|
eventHandlers = _ref.eventHandlers,
|
|
25
|
-
identifier = _ref.identifier
|
|
25
|
+
identifier = _ref.identifier,
|
|
26
|
+
fallbackMediaNameFetcher = _ref.fallbackMediaNameFetcher;
|
|
26
27
|
var _useState = useState(),
|
|
27
28
|
_useState2 = _slicedToArray(_useState, 2),
|
|
28
29
|
contextIdentifier = _useState2[0],
|
|
@@ -132,7 +133,8 @@ var RenderMediaInline = function RenderMediaInline(_ref) {
|
|
|
132
133
|
shouldOpenMediaViewer: shouldOpenMediaViewer,
|
|
133
134
|
shouldDisplayToolTip: shouldDisplayToolTip,
|
|
134
135
|
mediaClientConfig: mediaClient.mediaClientConfig,
|
|
135
|
-
mediaViewerItems: Array.from(mediaIdentifierMap.values())
|
|
136
|
+
mediaViewerItems: Array.from(mediaIdentifierMap.values()),
|
|
137
|
+
fallbackMediaNameFetcher: fallbackMediaNameFetcher
|
|
136
138
|
}))
|
|
137
139
|
);
|
|
138
140
|
};
|
|
@@ -147,7 +149,8 @@ var MediaInline = function MediaInline(props) {
|
|
|
147
149
|
width = props.width,
|
|
148
150
|
height = props.height,
|
|
149
151
|
marks = props.marks,
|
|
150
|
-
ssr = props.ssr
|
|
152
|
+
ssr = props.ssr,
|
|
153
|
+
fallbackMediaNameFetcher = props.fallbackMediaNameFetcher;
|
|
151
154
|
var clipboardAttrs = {
|
|
152
155
|
id: id,
|
|
153
156
|
collection: collection
|
|
@@ -200,7 +203,8 @@ var MediaInline = function MediaInline(props) {
|
|
|
200
203
|
rendererAppearance: rendererAppearance,
|
|
201
204
|
intl: intl,
|
|
202
205
|
collection: collection,
|
|
203
|
-
featureFlags: featureFlags
|
|
206
|
+
featureFlags: featureFlags,
|
|
207
|
+
fallbackMediaNameFetcher: fallbackMediaNameFetcher
|
|
204
208
|
});
|
|
205
209
|
};
|
|
206
210
|
export default injectIntl(MediaInline);
|
|
@@ -1,65 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Checks whether any cell in the first row of the table has a colwidth attribute set.
|
|
4
|
-
*
|
|
5
|
-
* This mirrors `hasTableColumnBeenResized` from editor-plugin-table's `colgroup.ts`.
|
|
6
|
-
*/
|
|
7
|
-
export var hasColWidths = function hasColWidths(tableNode) {
|
|
8
|
-
var firstRow = tableNode.content.firstChild;
|
|
9
|
-
if (!firstRow) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
for (var i = 0; i < firstRow.childCount; i++) {
|
|
13
|
-
if (firstRow.child(i).attrs.colwidth) {
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return false;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Mirrors `isContentModeSupported()` from editor-plugin-table's `tableMode.ts`.
|
|
21
|
-
*
|
|
22
|
-
* In the editor this checks `allowColumnResizing && allowTableResizing && isFullPageEditor`.
|
|
23
|
-
* In the renderer there is no separate `allowColumnResizing` flag — `allowTableResizing`
|
|
24
|
-
* covers both — and `isFullPageEditor` maps to `rendererAppearance === 'full-page'`.
|
|
25
|
-
*/
|
|
26
|
-
var isContentModeSupported = function isContentModeSupported(_ref) {
|
|
1
|
+
export var isContentModeSupported = function isContentModeSupported(_ref) {
|
|
27
2
|
var allowTableResizing = _ref.allowTableResizing,
|
|
28
3
|
rendererAppearance = _ref.rendererAppearance;
|
|
29
4
|
return !!allowTableResizing && (rendererAppearance === 'full-page' || rendererAppearance === 'full-width' || rendererAppearance === 'max');
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Determines whether a table should render in content mode.
|
|
34
|
-
*
|
|
35
|
-
* Content mode tables have no fixed column widths — the browser sizes columns to fit their
|
|
36
|
-
* content (table-layout: auto). A table is in content mode when:
|
|
37
|
-
*
|
|
38
|
-
* 1. The feature is supported (table resizing enabled, full-page appearance)
|
|
39
|
-
* 2. The table is at the top level of the document (not nested in another table or block node)
|
|
40
|
-
* 3. The table node exists
|
|
41
|
-
* 4. `table.attrs.width` is null (no explicit width set by the user)
|
|
42
|
-
* 5. No cells in the first row have `colwidth` set (table has not been column-resized)
|
|
43
|
-
* 6. The `platform_editor_table_fit_to_content_auto_convert` experiment is enabled
|
|
44
|
-
*
|
|
45
|
-
* This mirrors `isTableInContentMode()` from editor-plugin-table's `tableMode.ts`.
|
|
46
|
-
*
|
|
47
|
-
* SSR-safe: `expValEquals` returns false on the server (FeatureGates not initialised),
|
|
48
|
-
* so content mode is never active during SSR — no hydration mismatch.
|
|
49
|
-
*/
|
|
50
|
-
export var isTableInContentMode = function isTableInContentMode(_ref2) {
|
|
51
|
-
var tableNode = _ref2.tableNode,
|
|
52
|
-
allowTableResizing = _ref2.allowTableResizing,
|
|
53
|
-
rendererAppearance = _ref2.rendererAppearance,
|
|
54
|
-
isTableNested = _ref2.isTableNested;
|
|
55
|
-
if (!expValEqualsNoExposure('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true)) {
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
if (!tableNode) {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
return !isTableNested && isContentModeSupported({
|
|
62
|
-
allowTableResizing: allowTableResizing,
|
|
63
|
-
rendererAppearance: rendererAppearance
|
|
64
|
-
}) && tableNode.attrs.width === null && !hasColWidths(tableNode) && tableNode.attrs.layout === 'align-start';
|
|
65
5
|
};
|
|
@@ -5,7 +5,8 @@ import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
|
5
5
|
import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
7
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
|
-
import { isTableInContentMode } from '
|
|
8
|
+
import { isTableInContentMode } from '@atlaskit/editor-common/table';
|
|
9
|
+
import { isContentModeSupported } from './content-mode';
|
|
9
10
|
export var Table = /*#__PURE__*/React.memo(function (_ref) {
|
|
10
11
|
var _tableNode$attrs;
|
|
11
12
|
var innerRef = _ref.innerRef,
|
|
@@ -50,8 +51,10 @@ export var Table = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
50
51
|
var tableDisplayMode = tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.displayMode;
|
|
51
52
|
var isContentMode = isTableInContentMode({
|
|
52
53
|
tableNode: tableNode,
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
isSupported: isContentModeSupported({
|
|
55
|
+
allowTableResizing: allowTableResizing,
|
|
56
|
+
rendererAppearance: rendererAppearance
|
|
57
|
+
}),
|
|
55
58
|
isTableNested: isInsideOfBlockNode || isInsideOfTable
|
|
56
59
|
}) && expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true);
|
|
57
60
|
return /*#__PURE__*/React.createElement("table", _extends({}, fg('platform_renderer_isPresentational') && {
|
|
@@ -33,7 +33,8 @@ import { isCommentAppearance, isFullPageAppearance, isFullWidthAppearance, isFul
|
|
|
33
33
|
import { TableStickyScrollbar } from './TableStickyScrollbar';
|
|
34
34
|
import { TableProcessorWithContainerStyles } from './tableNew';
|
|
35
35
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
36
|
-
import { isTableInContentMode } from '
|
|
36
|
+
import { isTableInContentMode } from '@atlaskit/editor-common/table';
|
|
37
|
+
import { isContentModeSupported } from './table/content-mode';
|
|
37
38
|
export var isTableResizingEnabled = function isTableResizingEnabled(appearance) {
|
|
38
39
|
return isFullWidthOrFullPageAppearance(appearance) || isCommentAppearance(appearance);
|
|
39
40
|
};
|
|
@@ -516,8 +517,10 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
516
517
|
}
|
|
517
518
|
var isContentModeTable = isTableInContentMode({
|
|
518
519
|
tableNode: tableNode,
|
|
519
|
-
|
|
520
|
-
|
|
520
|
+
isSupported: isContentModeSupported({
|
|
521
|
+
allowTableResizing: allowTableResizing,
|
|
522
|
+
rendererAppearance: rendererAppearance
|
|
523
|
+
}),
|
|
521
524
|
isTableNested: isInsideOfBlockNode || isInsideOfTable
|
|
522
525
|
}) && expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true);
|
|
523
526
|
var style;
|
|
@@ -27,7 +27,8 @@ import { Table } from './table/table';
|
|
|
27
27
|
import { isCommentAppearance, isFullWidthOrFullPageAppearance, isFullWidthAppearance, isMaxWidthAppearance, isFullPageAppearance } from '../utils/appearance';
|
|
28
28
|
import { TableStickyScrollbar } from './TableStickyScrollbar';
|
|
29
29
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
30
|
-
import { isTableInContentMode } from '
|
|
30
|
+
import { isTableInContentMode } from '@atlaskit/editor-common/table';
|
|
31
|
+
import { isContentModeSupported } from './table/content-mode';
|
|
31
32
|
var stickyContainerBaseStyles = {
|
|
32
33
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
33
34
|
height: "var(--ds-space-250, 20px)",
|
|
@@ -474,8 +475,10 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
474
475
|
}
|
|
475
476
|
var isContentModeTable = isTableInContentMode({
|
|
476
477
|
tableNode: tableNode,
|
|
477
|
-
|
|
478
|
-
|
|
478
|
+
isSupported: isContentModeSupported({
|
|
479
|
+
allowTableResizing: allowTableResizing,
|
|
480
|
+
rendererAppearance: rendererAppearance
|
|
481
|
+
}),
|
|
479
482
|
isTableNested: isInsideOfBlockNode || isInsideOfTable
|
|
480
483
|
}) && expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true);
|
|
481
484
|
var style = _objectSpread(_objectSpread({}, isContentModeTable && {
|
|
@@ -62,7 +62,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
62
62
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
63
63
|
var RENDER_EVENT_SAMPLE_RATE = 0.2;
|
|
64
64
|
var packageName = "@atlaskit/renderer";
|
|
65
|
-
var packageVersion = "
|
|
65
|
+
var packageVersion = "130.1.0";
|
|
66
66
|
var setAsQueryContainerStyles = css({
|
|
67
67
|
containerName: 'ak-renderer-wrapper',
|
|
68
68
|
containerType: 'inline-size'
|
|
@@ -68,6 +68,7 @@ declare const MediaGroup: React.ComponentType<import("./mediaGroup").MediaGroupP
|
|
|
68
68
|
declare const MediaInline: React.ComponentType<import("react-intl").WithIntlProps<{
|
|
69
69
|
collection?: string;
|
|
70
70
|
eventHandlers?: import("@atlaskit/editor-common/ui").EventHandlers;
|
|
71
|
+
fallbackMediaNameFetcher?: (id: string) => Promise<string>;
|
|
71
72
|
featureFlags?: import("@atlaskit/media-common").MediaFeatureFlags;
|
|
72
73
|
id: string;
|
|
73
74
|
marks?: Array<Mark>;
|
|
@@ -10,6 +10,7 @@ import type { MediaSSR } from '../../types/mediaOptions';
|
|
|
10
10
|
type MediaInlineProps = {
|
|
11
11
|
collection?: string;
|
|
12
12
|
eventHandlers?: EventHandlers;
|
|
13
|
+
fallbackMediaNameFetcher?: (id: string) => Promise<string>;
|
|
13
14
|
featureFlags?: MediaFeatureFlags;
|
|
14
15
|
id: string;
|
|
15
16
|
marks?: Array<Mark>;
|
|
@@ -1,34 +1,10 @@
|
|
|
1
1
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { RendererAppearance } from '../../../ui/Renderer/types';
|
|
3
|
-
/**
|
|
4
|
-
* Checks whether any cell in the first row of the table has a colwidth attribute set.
|
|
5
|
-
*
|
|
6
|
-
* This mirrors `hasTableColumnBeenResized` from editor-plugin-table's `colgroup.ts`.
|
|
7
|
-
*/
|
|
8
|
-
export declare const hasColWidths: (tableNode: PMNode) => boolean;
|
|
9
3
|
type ContentModeOptions = {
|
|
10
4
|
allowTableResizing?: boolean;
|
|
11
5
|
isTableNested?: boolean;
|
|
12
6
|
rendererAppearance?: RendererAppearance;
|
|
13
7
|
tableNode: PMNode | undefined;
|
|
14
8
|
};
|
|
15
|
-
|
|
16
|
-
* Determines whether a table should render in content mode.
|
|
17
|
-
*
|
|
18
|
-
* Content mode tables have no fixed column widths — the browser sizes columns to fit their
|
|
19
|
-
* content (table-layout: auto). A table is in content mode when:
|
|
20
|
-
*
|
|
21
|
-
* 1. The feature is supported (table resizing enabled, full-page appearance)
|
|
22
|
-
* 2. The table is at the top level of the document (not nested in another table or block node)
|
|
23
|
-
* 3. The table node exists
|
|
24
|
-
* 4. `table.attrs.width` is null (no explicit width set by the user)
|
|
25
|
-
* 5. No cells in the first row have `colwidth` set (table has not been column-resized)
|
|
26
|
-
* 6. The `platform_editor_table_fit_to_content_auto_convert` experiment is enabled
|
|
27
|
-
*
|
|
28
|
-
* This mirrors `isTableInContentMode()` from editor-plugin-table's `tableMode.ts`.
|
|
29
|
-
*
|
|
30
|
-
* SSR-safe: `expValEquals` returns false on the server (FeatureGates not initialised),
|
|
31
|
-
* so content mode is never active during SSR — no hydration mismatch.
|
|
32
|
-
*/
|
|
33
|
-
export declare const isTableInContentMode: ({ tableNode, allowTableResizing, rendererAppearance, isTableNested, }: ContentModeOptions) => boolean;
|
|
9
|
+
export declare const isContentModeSupported: ({ allowTableResizing, rendererAppearance, }: Pick<ContentModeOptions, "allowTableResizing" | "rendererAppearance">) => boolean;
|
|
34
10
|
export {};
|
|
@@ -10,6 +10,12 @@ export interface MediaOptions {
|
|
|
10
10
|
allowLinking?: boolean;
|
|
11
11
|
enableDownloadButton?: boolean;
|
|
12
12
|
enableSyncMediaCard?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Optional fallback fetcher to retrieve the media filename from another service
|
|
15
|
+
* Workaround for #hot-301450 where media service is missing filenames for DC -> Cloud migrated media
|
|
16
|
+
* Receives the file ID and should resolve to the filename string.
|
|
17
|
+
*/
|
|
18
|
+
fallbackMediaNameFetcher?: (id: string) => Promise<string>;
|
|
13
19
|
featureFlags?: MediaFeatureFlags;
|
|
14
20
|
/** Extensions for the media viewer header (e.g. comment navigation button). */
|
|
15
21
|
mediaViewerExtensions?: MediaViewerExtensions;
|
|
@@ -68,6 +68,7 @@ declare const MediaGroup: React.ComponentType<import("./mediaGroup").MediaGroupP
|
|
|
68
68
|
declare const MediaInline: React.ComponentType<import("react-intl").WithIntlProps<{
|
|
69
69
|
collection?: string;
|
|
70
70
|
eventHandlers?: import("@atlaskit/editor-common/ui").EventHandlers;
|
|
71
|
+
fallbackMediaNameFetcher?: (id: string) => Promise<string>;
|
|
71
72
|
featureFlags?: import("@atlaskit/media-common").MediaFeatureFlags;
|
|
72
73
|
id: string;
|
|
73
74
|
marks?: Array<Mark>;
|
|
@@ -10,6 +10,7 @@ import type { MediaSSR } from '../../types/mediaOptions';
|
|
|
10
10
|
type MediaInlineProps = {
|
|
11
11
|
collection?: string;
|
|
12
12
|
eventHandlers?: EventHandlers;
|
|
13
|
+
fallbackMediaNameFetcher?: (id: string) => Promise<string>;
|
|
13
14
|
featureFlags?: MediaFeatureFlags;
|
|
14
15
|
id: string;
|
|
15
16
|
marks?: Array<Mark>;
|
|
@@ -1,34 +1,10 @@
|
|
|
1
1
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { RendererAppearance } from '../../../ui/Renderer/types';
|
|
3
|
-
/**
|
|
4
|
-
* Checks whether any cell in the first row of the table has a colwidth attribute set.
|
|
5
|
-
*
|
|
6
|
-
* This mirrors `hasTableColumnBeenResized` from editor-plugin-table's `colgroup.ts`.
|
|
7
|
-
*/
|
|
8
|
-
export declare const hasColWidths: (tableNode: PMNode) => boolean;
|
|
9
3
|
type ContentModeOptions = {
|
|
10
4
|
allowTableResizing?: boolean;
|
|
11
5
|
isTableNested?: boolean;
|
|
12
6
|
rendererAppearance?: RendererAppearance;
|
|
13
7
|
tableNode: PMNode | undefined;
|
|
14
8
|
};
|
|
15
|
-
|
|
16
|
-
* Determines whether a table should render in content mode.
|
|
17
|
-
*
|
|
18
|
-
* Content mode tables have no fixed column widths — the browser sizes columns to fit their
|
|
19
|
-
* content (table-layout: auto). A table is in content mode when:
|
|
20
|
-
*
|
|
21
|
-
* 1. The feature is supported (table resizing enabled, full-page appearance)
|
|
22
|
-
* 2. The table is at the top level of the document (not nested in another table or block node)
|
|
23
|
-
* 3. The table node exists
|
|
24
|
-
* 4. `table.attrs.width` is null (no explicit width set by the user)
|
|
25
|
-
* 5. No cells in the first row have `colwidth` set (table has not been column-resized)
|
|
26
|
-
* 6. The `platform_editor_table_fit_to_content_auto_convert` experiment is enabled
|
|
27
|
-
*
|
|
28
|
-
* This mirrors `isTableInContentMode()` from editor-plugin-table's `tableMode.ts`.
|
|
29
|
-
*
|
|
30
|
-
* SSR-safe: `expValEquals` returns false on the server (FeatureGates not initialised),
|
|
31
|
-
* so content mode is never active during SSR — no hydration mismatch.
|
|
32
|
-
*/
|
|
33
|
-
export declare const isTableInContentMode: ({ tableNode, allowTableResizing, rendererAppearance, isTableNested, }: ContentModeOptions) => boolean;
|
|
9
|
+
export declare const isContentModeSupported: ({ allowTableResizing, rendererAppearance, }: Pick<ContentModeOptions, "allowTableResizing" | "rendererAppearance">) => boolean;
|
|
34
10
|
export {};
|
|
@@ -10,6 +10,12 @@ export interface MediaOptions {
|
|
|
10
10
|
allowLinking?: boolean;
|
|
11
11
|
enableDownloadButton?: boolean;
|
|
12
12
|
enableSyncMediaCard?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Optional fallback fetcher to retrieve the media filename from another service
|
|
15
|
+
* Workaround for #hot-301450 where media service is missing filenames for DC -> Cloud migrated media
|
|
16
|
+
* Receives the file ID and should resolve to the filename string.
|
|
17
|
+
*/
|
|
18
|
+
fallbackMediaNameFetcher?: (id: string) => Promise<string>;
|
|
13
19
|
featureFlags?: MediaFeatureFlags;
|
|
14
20
|
/** Extensions for the media viewer header (e.g. comment navigation button). */
|
|
15
21
|
mediaViewerExtensions?: MediaViewerExtensions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "130.0
|
|
3
|
+
"version": "130.2.0",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@atlaskit/link-datasource": "^5.0.0",
|
|
45
45
|
"@atlaskit/link-extractors": "^2.4.0",
|
|
46
46
|
"@atlaskit/linking-common": "^9.11.0",
|
|
47
|
-
"@atlaskit/media-card": "^80.
|
|
47
|
+
"@atlaskit/media-card": "^80.1.0",
|
|
48
48
|
"@atlaskit/media-client": "^36.0.0",
|
|
49
49
|
"@atlaskit/media-client-react": "^5.0.0",
|
|
50
50
|
"@atlaskit/media-common": "^13.0.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@atlaskit/status": "^4.0.0",
|
|
60
60
|
"@atlaskit/task-decision": "^20.0.0",
|
|
61
61
|
"@atlaskit/theme": "^23.1.0",
|
|
62
|
-
"@atlaskit/tmp-editor-statsig": "^62.
|
|
62
|
+
"@atlaskit/tmp-editor-statsig": "^62.8.0",
|
|
63
63
|
"@atlaskit/tokens": "^13.0.0",
|
|
64
64
|
"@atlaskit/tooltip": "^21.1.0",
|
|
65
65
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"uuid": "^3.1.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"@atlaskit/editor-common": "^114.
|
|
75
|
+
"@atlaskit/editor-common": "^114.2.0",
|
|
76
76
|
"@atlaskit/link-provider": "^4.3.0",
|
|
77
77
|
"@atlaskit/media-core": "^37.0.0",
|
|
78
78
|
"react": "^18.2.0",
|
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
"@atlaskit/media-test-helpers": "^41.0.0",
|
|
92
92
|
"@atlaskit/mention": "^25.0.0",
|
|
93
93
|
"@atlaskit/modal-dialog": "^14.15.0",
|
|
94
|
-
"@atlaskit/navigation-system": "^
|
|
95
|
-
"@atlaskit/profilecard": "^25.
|
|
94
|
+
"@atlaskit/navigation-system": "^8.0.0",
|
|
95
|
+
"@atlaskit/profilecard": "^25.1.0",
|
|
96
96
|
"@atlaskit/side-nav-items": "^1.13.0",
|
|
97
97
|
"@atlaskit/util-data-test": "^18.5.0",
|
|
98
98
|
"@atlassian/a11y-jest-testing": "^0.11.0",
|