@atlaskit/editor-common 114.1.0 → 114.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 +32 -0
- package/dist/cjs/card/ui/assets/card.js +13 -7
- package/dist/cjs/card/ui/assets/embed.js +13 -7
- package/dist/cjs/card/ui/assets/inline.js +13 -7
- package/dist/cjs/card/ui/assets/url.js +13 -7
- package/dist/cjs/extensibility/ExtensionNodeWrapper.js +1 -1
- package/dist/cjs/extensibility/extensionNodeView.js +1 -1
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/react-node-view/getInlineNodeViewProducer.js +44 -13
- package/dist/cjs/resizer/BreakoutResizer.js +7 -4
- package/dist/cjs/resizer/Resizer.js +33 -12
- package/dist/cjs/table/content-mode.js +62 -0
- package/dist/cjs/table/index.js +19 -0
- package/dist/cjs/toolbar/context.js +14 -4
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/MediaSingle/styled.js +1 -1
- package/dist/es2019/card/ui/assets/card.js +14 -7
- package/dist/es2019/card/ui/assets/embed.js +14 -7
- package/dist/es2019/card/ui/assets/inline.js +14 -7
- package/dist/es2019/card/ui/assets/url.js +14 -7
- package/dist/es2019/extensibility/ExtensionNodeWrapper.js +1 -1
- package/dist/es2019/extensibility/extensionNodeView.js +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/react-node-view/getInlineNodeViewProducer.js +44 -13
- package/dist/es2019/resizer/BreakoutResizer.js +7 -4
- package/dist/es2019/resizer/Resizer.js +33 -13
- package/dist/es2019/table/content-mode.js +56 -0
- package/dist/es2019/table/index.js +2 -1
- package/dist/es2019/toolbar/context.js +17 -9
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/MediaSingle/styled.js +1 -1
- package/dist/esm/card/ui/assets/card.js +14 -7
- package/dist/esm/card/ui/assets/embed.js +14 -7
- package/dist/esm/card/ui/assets/inline.js +14 -7
- package/dist/esm/card/ui/assets/url.js +14 -7
- package/dist/esm/extensibility/ExtensionNodeWrapper.js +1 -1
- package/dist/esm/extensibility/extensionNodeView.js +1 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/react-node-view/getInlineNodeViewProducer.js +44 -13
- package/dist/esm/resizer/BreakoutResizer.js +7 -4
- package/dist/esm/resizer/Resizer.js +33 -12
- package/dist/esm/table/content-mode.js +57 -0
- package/dist/esm/table/index.js +2 -1
- package/dist/esm/toolbar/context.js +15 -5
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/MediaSingle/styled.js +1 -1
- package/dist/types/table/content-mode.d.ts +35 -0
- package/dist/types/table/index.d.ts +1 -0
- package/dist/types-ts4.5/table/content-mode.d.ts +35 -0
- package/dist/types-ts4.5/table/index.d.ts +1 -0
- package/package.json +5 -8
|
@@ -10,16 +10,19 @@ import React from 'react';
|
|
|
10
10
|
|
|
11
11
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
12
12
|
import { jsx } from '@emotion/react';
|
|
13
|
+
import { flushSync } from 'react-dom';
|
|
14
|
+
import { createRoot } from 'react-dom/client';
|
|
13
15
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
14
16
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
15
18
|
import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../analytics';
|
|
19
|
+
import { isSSR } from '../core-utils/is-ssr';
|
|
16
20
|
import { ErrorBoundary } from '../ui/ErrorBoundary';
|
|
17
21
|
import { analyticsEventKey, getPerformanceOptions, startMeasureReactNodeViewRendered, stopMeasureReactNodeViewRendered } from '../utils';
|
|
18
22
|
import { getBrowserInfo } from '../utils/browser';
|
|
19
23
|
import { ZERO_WIDTH_SPACE } from '../whitespace';
|
|
20
24
|
import { generateUniqueNodeKey } from './generateUniqueNodeKey';
|
|
21
25
|
import { getOrCreateOnVisibleObserver } from './onVisibleObserverFactory';
|
|
22
|
-
var isSSR = Boolean(process.env.REACT_SSR);
|
|
23
26
|
export var inlineNodeViewClassname = 'inlineNodeView';
|
|
24
27
|
var canRenderFallback = function canRenderFallback(node) {
|
|
25
28
|
return node.type.isInline && node.type.isAtom && node.type.isLeaf;
|
|
@@ -72,13 +75,39 @@ function createNodeView(_ref) {
|
|
|
72
75
|
// to the passed dom element (domRef) which means it is automatically
|
|
73
76
|
// "cleaned up" when you do a "re render".
|
|
74
77
|
function renderComponent() {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
if (isSSR() && expValEquals('platform_editor_editor_ssr_streaming', 'isEnabled', true)) {
|
|
79
|
+
var html = '';
|
|
80
|
+
|
|
81
|
+
// We don't use direct rendering to the domRef, as this can lead to unexpected behavior,
|
|
82
|
+
// when the domRef element might have handlers from ProseMirror that will start executing
|
|
83
|
+
// in JSDom. Therefore, we simply attempt to render the element synchronously, get its HTML, and set it to the domRef,
|
|
84
|
+
// to keep the domRef as clear as possible.
|
|
85
|
+
try {
|
|
86
|
+
var PortalComponent = getPortalChildren({
|
|
87
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
88
|
+
currentNode: currentNode,
|
|
89
|
+
nodeViewParams: nodeViewParams,
|
|
90
|
+
Component: Component,
|
|
91
|
+
extraComponentProps: extraComponentProps
|
|
92
|
+
});
|
|
93
|
+
var rootElement = document.createElement('span');
|
|
94
|
+
var ssrRoot = createRoot(rootElement);
|
|
95
|
+
flushSync(function () {
|
|
96
|
+
ssrRoot.render(jsx(PortalComponent, null));
|
|
97
|
+
});
|
|
98
|
+
html = rootElement.innerHTML;
|
|
99
|
+
ssrRoot.unmount();
|
|
100
|
+
} catch (_unused) {}
|
|
101
|
+
domRef.innerHTML = html;
|
|
102
|
+
} else {
|
|
103
|
+
pmPluginFactoryParams.portalProviderAPI.render(getPortalChildren({
|
|
104
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
105
|
+
currentNode: currentNode,
|
|
106
|
+
nodeViewParams: nodeViewParams,
|
|
107
|
+
Component: Component,
|
|
108
|
+
extraComponentProps: extraComponentProps
|
|
109
|
+
}), domRef, key);
|
|
110
|
+
}
|
|
82
111
|
}
|
|
83
112
|
var _getPerformanceOption = getPerformanceOptions(nodeViewParams.view),
|
|
84
113
|
samplingRate = _getPerformanceOption.samplingRate,
|
|
@@ -132,10 +161,12 @@ function createNodeView(_ref) {
|
|
|
132
161
|
return true;
|
|
133
162
|
},
|
|
134
163
|
destroy: function destroy() {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
164
|
+
if (!isSSR() || !expValEquals('platform_editor_editor_ssr_streaming', 'isEnabled', true)) {
|
|
165
|
+
// When prosemirror destroys the node view, we need to clean up
|
|
166
|
+
// what we have previously rendered using the editor portal
|
|
167
|
+
// provider api.
|
|
168
|
+
pmPluginFactoryParams.portalProviderAPI.remove(key);
|
|
169
|
+
}
|
|
139
170
|
// @ts-expect-error Expect an error as domRef is expected to be
|
|
140
171
|
// of HTMLSpanElement type however once the node view has
|
|
141
172
|
// been destroyed no other consumers should still be using it.
|
|
@@ -407,7 +438,7 @@ export function getInlineNodeViewProducer(_ref4) {
|
|
|
407
438
|
extraNodeViewProps: extraNodeViewProps
|
|
408
439
|
};
|
|
409
440
|
var isNodeTypeAllowedToBeVirtualized = virtualizedNodeAllowlist.includes((node === null || node === void 0 || (_node$type = node.type) === null || _node$type === void 0 ? void 0 : _node$type.name) || '');
|
|
410
|
-
if (!isNodeTypeAllowedToBeVirtualized || isSSR) {
|
|
441
|
+
if (!isNodeTypeAllowedToBeVirtualized || isSSR()) {
|
|
411
442
|
return createNodeView(parameters);
|
|
412
443
|
}
|
|
413
444
|
if (fg('platform_editor_inline_node_virt_threshold_override')) {
|
|
@@ -3,6 +3,7 @@ import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useSta
|
|
|
3
3
|
import { bind, bindAll } from 'bind-event-listener';
|
|
4
4
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
7
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
8
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
|
|
8
9
|
import { LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN } from '../styles';
|
|
@@ -69,6 +70,10 @@ var defaultStyles = {
|
|
|
69
70
|
display: 'grid'
|
|
70
71
|
};
|
|
71
72
|
var RESIZE_STEP_VALUE = 10;
|
|
73
|
+
var RESIZER_ENABLE_HANDLES = {
|
|
74
|
+
left: true,
|
|
75
|
+
right: true
|
|
76
|
+
};
|
|
72
77
|
/**
|
|
73
78
|
* BreakoutResizer is a common component used to resize nodes that support the 'Breakout' mark, so it requires
|
|
74
79
|
* correct ADF support.
|
|
@@ -321,10 +326,8 @@ var BreakoutResizer = function BreakoutResizer(_ref) {
|
|
|
321
326
|
});
|
|
322
327
|
}
|
|
323
328
|
return /*#__PURE__*/React.createElement(Resizer, {
|
|
324
|
-
ref: resizerRef
|
|
325
|
-
|
|
326
|
-
,
|
|
327
|
-
enable: {
|
|
329
|
+
ref: resizerRef,
|
|
330
|
+
enable: expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? RESIZER_ENABLE_HANDLES : {
|
|
328
331
|
left: true,
|
|
329
332
|
right: true
|
|
330
333
|
},
|
|
@@ -12,6 +12,7 @@ import { useIntl } from 'react-intl';
|
|
|
12
12
|
|
|
13
13
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
14
14
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
15
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
15
16
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
16
17
|
import Tooltip from '@atlaskit/tooltip';
|
|
17
18
|
import { messages } from '../messages/breakout';
|
|
@@ -120,16 +121,30 @@ var ResizerNext = function ResizerNext(props, ref) {
|
|
|
120
121
|
left: classnames(handleClassName !== null && handleClassName !== void 0 ? handleClassName : resizerHandleClassName, 'left', handleSize, handleAlignmentMethod),
|
|
121
122
|
right: classnames(handleClassName !== null && handleClassName !== void 0 ? handleClassName : resizerHandleClassName, 'right', handleSize, handleAlignmentMethod)
|
|
122
123
|
};
|
|
124
|
+
var handleWidth = handlePositioning === 'adjacent' ? "var(--ds-space-100, 8px)" : "var(--ds-space-300, 24px)";
|
|
123
125
|
var baseHandleStyles = {
|
|
124
|
-
width:
|
|
126
|
+
width: handleWidth,
|
|
125
127
|
zIndex: resizerHandleZIndex,
|
|
126
128
|
pointerEvents: 'auto',
|
|
127
129
|
alignItems: handlePositioning === 'adjacent' ? 'center' : undefined
|
|
128
130
|
};
|
|
129
|
-
var
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
var memoizedBaseHandleStyles = useMemo(function () {
|
|
132
|
+
return {
|
|
133
|
+
width: handleWidth,
|
|
134
|
+
zIndex: resizerHandleZIndex,
|
|
135
|
+
pointerEvents: 'auto',
|
|
136
|
+
alignItems: handlePositioning === 'adjacent' ? 'center' : undefined
|
|
137
|
+
};
|
|
138
|
+
}, [handleWidth, handlePositioning]);
|
|
139
|
+
var offset = handlePositioning === 'adjacent' ? "calc(".concat(handleWidth, " * -1)") : "calc(".concat(handleWidth, " * -0.5)");
|
|
140
|
+
var memoizedNextHandleStyles = useMemo(function () {
|
|
141
|
+
return SUPPORTED_HANDLES.reduce(function (result, position) {
|
|
142
|
+
return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, position, _objectSpread(_objectSpread({}, memoizedBaseHandleStyles), {}, _defineProperty({}, position, offset), handleStyles === null || handleStyles === void 0 ? void 0 : handleStyles[position])));
|
|
143
|
+
}, {});
|
|
144
|
+
}, [memoizedBaseHandleStyles, offset, handleStyles]);
|
|
145
|
+
var nextHandleStyles = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedNextHandleStyles :
|
|
146
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-expensive-computations-in-render -- intentional fallback for experiment off path
|
|
147
|
+
SUPPORTED_HANDLES.reduce(function (result, position) {
|
|
133
148
|
return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, position, _objectSpread(_objectSpread({}, baseHandleStyles), {}, _defineProperty({}, position, offset), handleStyles === null || handleStyles === void 0 ? void 0 : handleStyles[position])));
|
|
134
149
|
}, {});
|
|
135
150
|
var resizerClassName = classnames(className, resizerItemClassName, _defineProperty({
|
|
@@ -195,15 +210,21 @@ var ResizerNext = function ResizerNext(props, ref) {
|
|
|
195
210
|
}
|
|
196
211
|
return snapGap;
|
|
197
212
|
}, [snap, snapGap]);
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
201
|
-
,
|
|
202
|
-
size: {
|
|
213
|
+
var resizerAutoSize = useMemo(function () {
|
|
214
|
+
return {
|
|
203
215
|
width: width !== null && width !== void 0 ? width : 'auto',
|
|
204
|
-
// just content itself (no paddings)
|
|
205
216
|
height: 'auto'
|
|
206
|
-
}
|
|
217
|
+
};
|
|
218
|
+
}, [width]);
|
|
219
|
+
var resizerSize = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? resizerAutoSize :
|
|
220
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- intentional fallback for experiment off path
|
|
221
|
+
{
|
|
222
|
+
width: width !== null && width !== void 0 ? width : 'auto',
|
|
223
|
+
height: 'auto'
|
|
224
|
+
};
|
|
225
|
+
return /*#__PURE__*/React.createElement(Resizable, _extends({
|
|
226
|
+
ref: resizable,
|
|
227
|
+
size: resizerSize
|
|
207
228
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
208
229
|
,
|
|
209
230
|
className: resizerClassName,
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Returns true if any cell in the first row of the table has a colwidth attribute set.
|
|
5
|
+
*
|
|
6
|
+
* Used by both the editor (as `hasTableColumnBeenResized`) and the renderer (as `hasColWidths`)
|
|
7
|
+
* to determine whether a table has had its columns manually resized.
|
|
8
|
+
*/
|
|
9
|
+
export var hasTableColumnBeenResized = function hasTableColumnBeenResized(tableNode) {
|
|
10
|
+
var firstRow = tableNode.content.firstChild;
|
|
11
|
+
if (!firstRow) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
for (var i = 0; i < firstRow.childCount; i++) {
|
|
15
|
+
if (firstRow.child(i).attrs.colwidth) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return false;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Returns true if the table has been explicitly resized — either the table itself has a width
|
|
24
|
+
* attribute set, or any column has been individually resized (colwidth present on cells).
|
|
25
|
+
*/
|
|
26
|
+
export var hasTableBeenResized = function hasTableBeenResized(tableNode) {
|
|
27
|
+
return tableNode.attrs.width !== null || hasTableColumnBeenResized(tableNode);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Determines whether a table should render in content mode.
|
|
32
|
+
*
|
|
33
|
+
* Content mode tables have no fixed column widths — the browser sizes columns to fit their
|
|
34
|
+
* content (`table-layout: auto`). This is the shared core predicate used by both the editor
|
|
35
|
+
* and the renderer. Each consumer is responsible for computing `isSupported` from its own
|
|
36
|
+
* feature flags / props before calling this function.
|
|
37
|
+
*
|
|
38
|
+
* A table is in content mode when ALL of the following are true:
|
|
39
|
+
* 1. The `platform_editor_table_fit_to_content_auto_convert` experiment is enabled
|
|
40
|
+
* 2. `isSupported` is true (caller has verified resizing is allowed and appearance is full-page)
|
|
41
|
+
* 3. The table is not nested inside another table or block node
|
|
42
|
+
* 4. The table node exists
|
|
43
|
+
* 5. The table has not been explicitly resized (`width === null` and no `colwidth` on cells)
|
|
44
|
+
* 6. The table's layout is `'align-start'`
|
|
45
|
+
*/
|
|
46
|
+
export var isTableInContentMode = function isTableInContentMode(_ref) {
|
|
47
|
+
var tableNode = _ref.tableNode,
|
|
48
|
+
isSupported = _ref.isSupported,
|
|
49
|
+
isTableNested = _ref.isTableNested;
|
|
50
|
+
if (!expValEqualsNoExposure('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true)) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
if (!tableNode || isTableNested) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
return isSupported && !hasTableBeenResized(tableNode) && tableNode.attrs.layout === 'align-start';
|
|
57
|
+
};
|
package/dist/esm/table/index.js
CHANGED
|
@@ -2,4 +2,5 @@
|
|
|
2
2
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
3
3
|
|
|
4
4
|
export { SORTABLE_COLUMN_ICON_CLASSNAME } from './consts';
|
|
5
|
-
export { default as SortingIcon, StatusClassNames } from './SortingIcon';
|
|
5
|
+
export { default as SortingIcon, StatusClassNames } from './SortingIcon';
|
|
6
|
+
export { hasTableBeenResized, hasTableColumnBeenResized, isTableInContentMode } from './content-mode';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React, { createContext, useContext } from 'react';
|
|
1
|
+
import React, { createContext, useContext, useMemo } from 'react';
|
|
2
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
2
3
|
var EditorToolbarContext = /*#__PURE__*/createContext({
|
|
3
4
|
editorView: null,
|
|
4
5
|
editorAppearance: undefined,
|
|
@@ -23,14 +24,23 @@ export var EditorToolbarProvider = function EditorToolbarProvider(_ref) {
|
|
|
23
24
|
editorViewMode = _ref.editorViewMode,
|
|
24
25
|
editorToolbarDockingPreference = _ref.editorToolbarDockingPreference,
|
|
25
26
|
isOffline = _ref.isOffline;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
value: {
|
|
27
|
+
var memoizedValue = useMemo(function () {
|
|
28
|
+
return {
|
|
29
29
|
editorView: editorView,
|
|
30
30
|
editorAppearance: editorAppearance,
|
|
31
31
|
editorViewMode: editorViewMode,
|
|
32
32
|
editorToolbarDockingPreference: editorToolbarDockingPreference,
|
|
33
33
|
isOffline: isOffline
|
|
34
|
-
}
|
|
34
|
+
};
|
|
35
|
+
}, [editorView, editorAppearance, editorViewMode, editorToolbarDockingPreference, isOffline]);
|
|
36
|
+
var contextValue = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedValue : {
|
|
37
|
+
editorView: editorView,
|
|
38
|
+
editorAppearance: editorAppearance,
|
|
39
|
+
editorViewMode: editorViewMode,
|
|
40
|
+
editorToolbarDockingPreference: editorToolbarDockingPreference,
|
|
41
|
+
isOffline: isOffline
|
|
42
|
+
};
|
|
43
|
+
return /*#__PURE__*/React.createElement(EditorToolbarContext.Provider, {
|
|
44
|
+
value: contextValue
|
|
35
45
|
}, children);
|
|
36
46
|
};
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "114.
|
|
24
|
+
var packageVersion = "114.1.1";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -250,7 +250,7 @@ var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
|
|
|
250
250
|
|
|
251
251
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
252
252
|
export var mediaWrapperStyle = function mediaWrapperStyle(props) {
|
|
253
|
-
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\tposition: relative;\n\n\t", "\n\n\t/* Editor */\n & > figure {\n\t\tposition: ", ";\n\t\theight: 100%;\n\t\twidth: 100%;\n\t}\n\n\t/* Comments on media project adds comment badge as child of the media wrapper,\n\tthus we need to exclude it so that style is applied to intended div */\n\t& > div:not([data-media-badges='true']) {\n\t\tposition: ", ";\n\t\theight: 100%;\n\t\twidth: 100%;\n\t}\n\n\t& * [data-mark-annotation-type='inlineComment'] {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t}\n\n\t&[data-node-type='embedCard'] > div {\n\t\twidth: 100%;\n\t}\n\n\t/* Renderer */\n\t[data-node-type='media'] {\n\t\tposition: static !important;\n\t\
|
|
253
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\tposition: relative;\n\n\t", "\n\n\t/* Editor */\n & > figure {\n\t\tposition: ", ";\n\t\theight: 100%;\n\t\twidth: 100%;\n\t}\n\n\t/* Comments on media project adds comment badge as child of the media wrapper,\n\tthus we need to exclude it so that style is applied to intended div */\n\t& > div:not([data-media-badges='true']) {\n\t\tposition: ", ";\n\t\theight: 100%;\n\t\twidth: 100%;\n\t}\n\n\t& * [data-mark-annotation-type='inlineComment'] {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t}\n\n\t&[data-node-type='embedCard'] > div {\n\t\twidth: 100%;\n\t}\n\n\t/* Renderer */\n\t[data-node-type='media'] {\n\t\tposition: static !important;\n\t\theight: auto !important;\n\n\t\t> div {\n\t\t\tposition: absolute;\n\t\t\theight: 100%;\n\t\t}\n\t}\n"])), RenderFallbackContainer(props), props.hasFallbackContainer ? 'absolute' : 'relative', props.hasFallbackContainer ? 'absolute' : 'relative');
|
|
254
254
|
};
|
|
255
255
|
var MediaWrapper = function MediaWrapper(_ref3) {
|
|
256
256
|
var children = _ref3.children,
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
/**
|
|
3
|
+
* Returns true if any cell in the first row of the table has a colwidth attribute set.
|
|
4
|
+
*
|
|
5
|
+
* Used by both the editor (as `hasTableColumnBeenResized`) and the renderer (as `hasColWidths`)
|
|
6
|
+
* to determine whether a table has had its columns manually resized.
|
|
7
|
+
*/
|
|
8
|
+
export declare const hasTableColumnBeenResized: (tableNode: PMNode) => boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Returns true if the table has been explicitly resized — either the table itself has a width
|
|
11
|
+
* attribute set, or any column has been individually resized (colwidth present on cells).
|
|
12
|
+
*/
|
|
13
|
+
export declare const hasTableBeenResized: (tableNode: PMNode) => boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Determines whether a table should render in content mode.
|
|
16
|
+
*
|
|
17
|
+
* Content mode tables have no fixed column widths — the browser sizes columns to fit their
|
|
18
|
+
* content (`table-layout: auto`). This is the shared core predicate used by both the editor
|
|
19
|
+
* and the renderer. Each consumer is responsible for computing `isSupported` from its own
|
|
20
|
+
* feature flags / props before calling this function.
|
|
21
|
+
*
|
|
22
|
+
* A table is in content mode when ALL of the following are true:
|
|
23
|
+
* 1. The `platform_editor_table_fit_to_content_auto_convert` experiment is enabled
|
|
24
|
+
* 2. `isSupported` is true (caller has verified resizing is allowed and appearance is full-page)
|
|
25
|
+
* 3. The table is not nested inside another table or block node
|
|
26
|
+
* 4. The table node exists
|
|
27
|
+
* 5. The table has not been explicitly resized (`width === null` and no `colwidth` on cells)
|
|
28
|
+
* 6. The table's layout is `'align-start'`
|
|
29
|
+
*/
|
|
30
|
+
export declare const isTableInContentMode: ({ tableNode, isSupported, isTableNested, }: {
|
|
31
|
+
/** Whether the current environment supports content mode (resizing enabled, full-page appearance). */
|
|
32
|
+
isSupported: boolean;
|
|
33
|
+
isTableNested?: boolean;
|
|
34
|
+
tableNode: PMNode | undefined;
|
|
35
|
+
}) => boolean;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
/**
|
|
3
|
+
* Returns true if any cell in the first row of the table has a colwidth attribute set.
|
|
4
|
+
*
|
|
5
|
+
* Used by both the editor (as `hasTableColumnBeenResized`) and the renderer (as `hasColWidths`)
|
|
6
|
+
* to determine whether a table has had its columns manually resized.
|
|
7
|
+
*/
|
|
8
|
+
export declare const hasTableColumnBeenResized: (tableNode: PMNode) => boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Returns true if the table has been explicitly resized — either the table itself has a width
|
|
11
|
+
* attribute set, or any column has been individually resized (colwidth present on cells).
|
|
12
|
+
*/
|
|
13
|
+
export declare const hasTableBeenResized: (tableNode: PMNode) => boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Determines whether a table should render in content mode.
|
|
16
|
+
*
|
|
17
|
+
* Content mode tables have no fixed column widths — the browser sizes columns to fit their
|
|
18
|
+
* content (`table-layout: auto`). This is the shared core predicate used by both the editor
|
|
19
|
+
* and the renderer. Each consumer is responsible for computing `isSupported` from its own
|
|
20
|
+
* feature flags / props before calling this function.
|
|
21
|
+
*
|
|
22
|
+
* A table is in content mode when ALL of the following are true:
|
|
23
|
+
* 1. The `platform_editor_table_fit_to_content_auto_convert` experiment is enabled
|
|
24
|
+
* 2. `isSupported` is true (caller has verified resizing is allowed and appearance is full-page)
|
|
25
|
+
* 3. The table is not nested inside another table or block node
|
|
26
|
+
* 4. The table node exists
|
|
27
|
+
* 5. The table has not been explicitly resized (`width === null` and no `colwidth` on cells)
|
|
28
|
+
* 6. The table's layout is `'align-start'`
|
|
29
|
+
*/
|
|
30
|
+
export declare const isTableInContentMode: ({ tableNode, isSupported, isTableNested, }: {
|
|
31
|
+
/** Whether the current environment supports content mode (resizing enabled, full-page appearance). */
|
|
32
|
+
isSupported: boolean;
|
|
33
|
+
isTableNested?: boolean;
|
|
34
|
+
tableNode: PMNode | undefined;
|
|
35
|
+
}) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "114.
|
|
3
|
+
"version": "114.2.0",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@atlaskit/link": "^3.4.0",
|
|
57
57
|
"@atlaskit/link-datasource": "^5.0.0",
|
|
58
58
|
"@atlaskit/link-picker": "^5.0.0",
|
|
59
|
-
"@atlaskit/media-card": "^80.
|
|
59
|
+
"@atlaskit/media-card": "^80.1.0",
|
|
60
60
|
"@atlaskit/media-client": "^36.0.0",
|
|
61
61
|
"@atlaskit/media-client-react": "^5.0.0",
|
|
62
62
|
"@atlaskit/media-common": "^13.0.0",
|
|
@@ -70,16 +70,16 @@
|
|
|
70
70
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
71
71
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
72
72
|
"@atlaskit/primitives": "^19.0.0",
|
|
73
|
-
"@atlaskit/profilecard": "^25.
|
|
73
|
+
"@atlaskit/profilecard": "^25.1.0",
|
|
74
74
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
75
75
|
"@atlaskit/react-ufo": "^5.14.0",
|
|
76
76
|
"@atlaskit/section-message": "^8.12.0",
|
|
77
|
-
"@atlaskit/smart-card": "^44.
|
|
77
|
+
"@atlaskit/smart-card": "^44.1.0",
|
|
78
78
|
"@atlaskit/smart-user-picker": "^10.0.0",
|
|
79
79
|
"@atlaskit/spinner": "^19.1.0",
|
|
80
80
|
"@atlaskit/task-decision": "^20.0.0",
|
|
81
81
|
"@atlaskit/textfield": "^8.3.0",
|
|
82
|
-
"@atlaskit/tmp-editor-statsig": "^62.
|
|
82
|
+
"@atlaskit/tmp-editor-statsig": "^62.8.0",
|
|
83
83
|
"@atlaskit/tokens": "^13.0.0",
|
|
84
84
|
"@atlaskit/tooltip": "^21.1.0",
|
|
85
85
|
"@atlaskit/width-detector": "^5.1.0",
|
|
@@ -251,9 +251,6 @@
|
|
|
251
251
|
"platform_editor_ally_remove_role_tabpanel": {
|
|
252
252
|
"type": "boolean"
|
|
253
253
|
},
|
|
254
|
-
"platform_forge_ui_support_images_in_adfrenderer": {
|
|
255
|
-
"type": "boolean"
|
|
256
|
-
},
|
|
257
254
|
"platform_editor_toolbar_aifc_placement_overridden": {
|
|
258
255
|
"type": "boolean"
|
|
259
256
|
},
|