@atlaskit/editor-common 110.41.2 → 110.41.4
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 +18 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/selection/utils.js +8 -4
- package/dist/cjs/styles/shared/table.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/browser.js +2 -3
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/selection/utils.js +8 -4
- package/dist/es2019/styles/shared/table.js +4 -8
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/browser.js +2 -3
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/selection/utils.js +8 -4
- package/dist/esm/styles/shared/table.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/browser.js +2 -3
- package/dist/types/selection/utils.d.ts +4 -2
- package/dist/types-ts4.5/selection/utils.d.ts +4 -2
- package/package.json +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 110.41.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`7db8f9d5f86ab`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7db8f9d5f86ab) -
|
|
8
|
+
fix safari browser detection issue
|
|
9
|
+
- [`d94330c37d126`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d94330c37d126) -
|
|
10
|
+
tidy up ff platform_editor_disable_table_overflow_shadows
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 110.41.3
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`7c295bfea1292`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7c295bfea1292) -
|
|
18
|
+
EDITOR-3380 Use preserved selection when deleting selected range
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 110.41.2
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
19
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
20
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
21
21
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
22
|
-
var packageVersion = "
|
|
22
|
+
var packageVersion = "0.0.0-development";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -130,15 +130,19 @@ var expandSelectionBounds = exports.expandSelectionBounds = function expandSelec
|
|
|
130
130
|
/**
|
|
131
131
|
* Delete what is selected in the given transaction.
|
|
132
132
|
* @param tr the transaction to delete the selection from
|
|
133
|
+
* @param selectionToUse optional selection to delete instead of the transaction's current selection
|
|
133
134
|
* @returns the updated transaction
|
|
134
135
|
*/
|
|
135
|
-
var deleteSelectedRange = exports.deleteSelectedRange = function deleteSelectedRange(tr) {
|
|
136
|
-
var selection = tr.selection;
|
|
136
|
+
var deleteSelectedRange = exports.deleteSelectedRange = function deleteSelectedRange(tr, selectionToUse) {
|
|
137
|
+
var selection = selectionToUse || tr.selection;
|
|
137
138
|
var from = selection.$from.pos;
|
|
138
139
|
var to = selection.$to.pos;
|
|
139
140
|
if (selection instanceof _state.TextSelection) {
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
// Expand just the from position to the start of the block
|
|
142
|
+
// This ensures entire paragraphs are deleted instead of just
|
|
143
|
+
// the text content, which avoids leaving an empty line behind
|
|
144
|
+
var expanded = expandToBlockRange(selection.$from, selection.$to);
|
|
145
|
+
from = expanded.$from.pos;
|
|
142
146
|
} else if ((0, _utils.isTableSelected)(selection)) {
|
|
143
147
|
var table = (0, _utils.findTable)(selection);
|
|
144
148
|
if (table) {
|
|
@@ -64,7 +64,7 @@ var firstNodeWithNotMarginTop = function firstNodeWithNotMarginTop() {
|
|
|
64
64
|
var tableSharedStyle = exports.tableSharedStyle = function tableSharedStyle() {
|
|
65
65
|
var browser = (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ? (0, _browser.getBrowserInfo)() : _browser.browser;
|
|
66
66
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Appears safe to auto-fix, but leaving it up to the team to remediate as the readability only gets worse with autofixing
|
|
67
|
-
return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n\t\t", "\n\t\t.", " {\n\t\t\tposition: relative;\n\t\t\tmargin: 0 auto ", ";\n\t\t\tbox-sizing: border-box;\n\n\t\t\t/**\n * Fix block top alignment inside table cells.\n */\n\t\t\t.decisionItemView-content-wrap:first-of-type > div {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\n\t\t\t", "\n\t\t}\n\t\t.", "[data-number-column='true'] {\n\t\t\tpadding-left: ", "px;\n\t\t\tclear: both;\n\t\t}\n\n\t\t.", " {\n\t\t\twill-change: width, margin-left;\n\t\t}\n\n\t\t.", " table {\n\t\t\twill-change: width;\n\t\t}\n\n\t\t.", " > table {\n\t\t\tmargin: ", " 0 0 0;\n\t\t}\n\n\t\t.", " > table,\n\t\t.", " > table {\n\t\t\tmargin: ", " ", " 0 0;\n\t\t}\n\n\t\t/* support panel nested in table */\n\t\t", "\n\n\t\t/* avoid applying styles to nested tables (possible via extensions) */\n\t.", " > table,\n\t.", " > table,\n\t.", " > table {\n\t\t\tborder-collapse: collapse;\n\t\t\tborder: ", "px solid\n\t\t\t\t", ";\n\n\t\t\
|
|
67
|
+
return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n\t\t", "\n\t\t.", " {\n\t\t\tposition: relative;\n\t\t\tmargin: 0 auto ", ";\n\t\t\tbox-sizing: border-box;\n\n\t\t\t/**\n * Fix block top alignment inside table cells.\n */\n\t\t\t.decisionItemView-content-wrap:first-of-type > div {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\t\t\t.", ",\n\t\t\t\t.", " {\n\t\t\t\tdisplay: block;\n\t\t\t\twidth: 1px;\n\t\t\t\theight: calc(100% - ", ");\n\t\t\t\tbackground: ", ";\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: ", ";\n\t\t\t}\n\t\t\t.", " {\n\t\t\t\tright: 0;\n\t\t\t}\n\t\t\t.", " {\n\t\t\t\tleft: 0;\n\t\t\t}\n\t\t\t", "\n\t\t}\n\t\t.", "[data-number-column='true'] {\n\t\t\tpadding-left: ", "px;\n\t\t\tclear: both;\n\t\t}\n\n\t\t.", " {\n\t\t\twill-change: width, margin-left;\n\t\t}\n\n\t\t.", " table {\n\t\t\twill-change: width;\n\t\t}\n\n\t\t.", " > table {\n\t\t\tmargin: ", " 0 0 0;\n\t\t}\n\n\t\t.", " > table,\n\t\t.", " > table {\n\t\t\tmargin: ", " ", " 0 0;\n\t\t}\n\n\t\t/* support panel nested in table */\n\t\t", "\n\n\t\t/* avoid applying styles to nested tables (possible via extensions) */\n\t.", " > table,\n\t.", " > table,\n\t.", " > table {\n\t\t\tborder-collapse: collapse;\n\t\t\tborder: ", "px solid\n\t\t\t\t", ";\n\t\t\tborder-left-color: transparent;\n\t\t\tborder-right-color: transparent;\n\t\t\ttable-layout: fixed;\n\t\t\tfont-size: 1em;\n\t\t\twidth: 100%;\n\n\t\t\t&[data-autosize='true'] {\n\t\t\t\ttable-layout: auto;\n\t\t\t}\n\n\t\t\t& {\n\t\t\t\t* {\n\t\t\t\t\tbox-sizing: border-box;\n\t\t\t\t}\n\t\t\t\thr {\n\t\t\t\t\tbox-sizing: content-box;\n\t\t\t\t}\n\n\t\t\t\ttbody {\n\t\t\t\t\tborder-bottom: none;\n\t\t\t\t}\n\t\t\t\tth td {\n\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t}\n\n\t\t\t\t> tbody > tr > th,\n\t\t\t\t> tbody > tr > td {\n\t\t\t\t\tmin-width: ", "px;\n\t\t\t\t\tfont-weight: ", ";\n\t\t\t\t\tvertical-align: top;\n\t\t\t\t\tborder: 1px solid ", ";\n\t\t\t\t\tborder-right-width: 0;\n\t\t\t\t\tborder-bottom-width: 0;\n\n\t\t\t\t\tpadding: ", ";\n\t\t\t\t\t/* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n\t\t\t\t\t", "\n\n\t\t\t\t\t", "\n\n\t\t\t\tth p:not(:first-of-type),\n\t\t\t\ttd p:not(:first-of-type) {\n\t\t\t\t\t\tmargin-top: ", ";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* Ensures nested tables are compatible with parent table background color - uses specificity to ensure tables nested by extensions are not affected */\n\t\t\t\t> tbody > tr > td {\n\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t}\n\n\t\t\t\tth {\n\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\ttext-align: left;\n\n\t\t\t\t\t/* only apply this styling to codeblocks in default background headercells */\n\t\t\t\t\t/* TODO this needs to be overhauled as it relies on unsafe selectors */\n\t\t\t\t\t", " {\n\t\t\t\t\t\t.", ":not(.danger) {\n\t\t\t\t\t\t\tbackground-color: ", ";\n\n\t\t\t\t\t\t\t:not(.", ") {\n\t\t\t\t\t\t\t\tbox-shadow: 0px 0px 0px 1px ", ";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\t\tbackground-image: ", ";\n\n\t\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/* this is only relevant to the element taken care of by renderer */\n\t\t\t\t\t\t\t> [data-ds--code--code-block] {\n\t\t\t\t\t\t\t\tbackground-image: ", "!important;\n\n\t\t\t\t\t\t\t\tbackground-color: ", "!important;\n\n\t\t\t\t\t\t\t\t/* selector lives inside @atlaskit/code */\n\t\t\t\t\t\t\t\t--ds--code--line-number-bg-color: ", ";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t"])), (0, _tableCell.tableCellBackgroundStyleOverride)(), TableSharedCssClassName.TABLE_CONTAINER, "var(--ds-space-200, 16px)", TableSharedCssClassName.TABLE_RIGHT_BORDER, TableSharedCssClassName.TABLE_LEFT_BORDER, "var(--ds-space-300, 24px)", "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")"), "var(--ds-space-300, 24px)", TableSharedCssClassName.TABLE_RIGHT_BORDER, TableSharedCssClassName.TABLE_LEFT_BORDER, (0, _platformFeatureFlags.fg)('platform_editor_table_numbered_table_border') && "\n\t\t\t\t.".concat(TableSharedCssClassName.TABLE_LEFT_BORDER, "[data-with-numbered-table='true'] {\n\t\t\t\t\tleft: ").concat(_editorSharedStyles.akEditorTableNumberColumnWidth - 1, "px;\n\t\t\t\t}"), TableSharedCssClassName.TABLE_CONTAINER, _editorSharedStyles.akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, "var(--ds-space-300, 24px)", TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", (0, _platformFeatureFlags.fg)('platform_editor_bordered_panel_nested_in_table') ? ".".concat(TableSharedCssClassName.TABLE_NODE_WRAPPER, " .ak-editor-panel {\n\t\t\tborder: ", "var(--ds-border-width, 1px)", " solid ", "var(--ds-border, #d9dbea)", ";\n\t\t}") : '', TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableCellBorderWidth, "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")"), "var(--ds-background-neutral-subtle, white)", tableCellMinWidth, "var(--ds-font-weight-regular, 400)", "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")"), "var(--ds-space-100, 8px)", browser.gecko || browser.ie || browser.mac && browser.chrome ? 'background-clip: padding-box;' : '', firstNodeWithNotMarginTop(), "var(--ds-space-150, 12px)", "var(--ds-surface, #FFFFFF)", "var(--ds-background-accent-gray-subtlest, ".concat(_editorSharedStyles.akEditorTableToolbar, ")"), (0, _expValEquals.expValEquals)('platform_editor_native_anchor_with_dnd', 'isEnabled', true) ? '&:not(.danger)' : '&:not([style]):not(.danger)', _codeBlock.CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, rgb(235, 237, 240))", _editorSharedStyles.akEditorSelectedNodeClassName, "var(--ds-border, transparent)", _codeBlock.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, (0, _editorSharedStyles.overflowShadow)({
|
|
68
68
|
leftCoverWidth: "var(--ds-space-300, 24px)"
|
|
69
69
|
}), "var(--ds-background-neutral, rgb(235, 237, 240))", _codeBlock.CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-neutral, rgb(226, 229, 233))", (0, _editorSharedStyles.overflowShadow)({
|
|
70
70
|
leftCoverWidth: "var(--ds-space-300, 24px)"
|
|
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
24
24
|
* @jsx jsx
|
|
25
25
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "
|
|
27
|
+
var packageVersion = "0.0.0-development";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -220,11 +220,10 @@ var getBrowserInfo = exports.getBrowserInfo = (0, _memoizeOne.default)(function
|
|
|
220
220
|
!_ie && /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent);
|
|
221
221
|
|
|
222
222
|
// Previously relied on navigator.vendor, now used userAgent
|
|
223
|
-
|
|
223
|
+
result.safari = !result.chrome && !result.ie && !result.gecko && !result.android && !userAgent.includes('CriOS') && !userAgent.includes('FxiOS') &&
|
|
224
224
|
// eslint-disable-next-line require-unicode-regexp
|
|
225
|
-
|
|
225
|
+
/safari|applewebkit/i.test(userAgent);
|
|
226
226
|
result.safari_version = parseInt(
|
|
227
|
-
// Ignored via go/ees005
|
|
228
227
|
// eslint-disable-next-line require-unicode-regexp
|
|
229
228
|
(userAgent.match(/Version\/([0-9\._]+).*Safari/) || [])[1], 10);
|
|
230
229
|
|
|
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
|
|
|
4
4
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
5
5
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
6
6
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
7
|
-
const packageVersion = "
|
|
7
|
+
const packageVersion = "0.0.0-development";
|
|
8
8
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
9
9
|
// Remove URL as it has UGC
|
|
10
10
|
// Ignored via go/ees007
|
|
@@ -129,15 +129,19 @@ export const expandSelectionBounds = ($anchor, $head) => {
|
|
|
129
129
|
/**
|
|
130
130
|
* Delete what is selected in the given transaction.
|
|
131
131
|
* @param tr the transaction to delete the selection from
|
|
132
|
+
* @param selectionToUse optional selection to delete instead of the transaction's current selection
|
|
132
133
|
* @returns the updated transaction
|
|
133
134
|
*/
|
|
134
|
-
export const deleteSelectedRange = tr => {
|
|
135
|
-
const selection = tr.selection;
|
|
135
|
+
export const deleteSelectedRange = (tr, selectionToUse) => {
|
|
136
|
+
const selection = selectionToUse || tr.selection;
|
|
136
137
|
let from = selection.$from.pos;
|
|
137
138
|
let to = selection.$to.pos;
|
|
138
139
|
if (selection instanceof TextSelection) {
|
|
139
|
-
|
|
140
|
-
|
|
140
|
+
// Expand just the from position to the start of the block
|
|
141
|
+
// This ensures entire paragraphs are deleted instead of just
|
|
142
|
+
// the text content, which avoids leaving an empty line behind
|
|
143
|
+
const expanded = expandToBlockRange(selection.$from, selection.$to);
|
|
144
|
+
from = expanded.$from.pos;
|
|
141
145
|
} else if (isTableSelected(selection)) {
|
|
142
146
|
const table = findTable(selection);
|
|
143
147
|
if (table) {
|
|
@@ -88,8 +88,8 @@ const tableSharedStyle = () => {
|
|
|
88
88
|
.decisionItemView-content-wrap:first-of-type > div {
|
|
89
89
|
margin-top: 0;
|
|
90
90
|
}
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
.${TableSharedCssClassName.TABLE_RIGHT_BORDER},
|
|
92
|
+
.${TableSharedCssClassName.TABLE_LEFT_BORDER} {
|
|
93
93
|
display: block;
|
|
94
94
|
width: 1px;
|
|
95
95
|
height: calc(100% - ${"var(--ds-space-300, 24px)"});
|
|
@@ -107,7 +107,6 @@ const tableSharedStyle = () => {
|
|
|
107
107
|
.${TableSharedCssClassName.TABLE_LEFT_BORDER}[data-with-numbered-table='true'] {
|
|
108
108
|
left: ${akEditorTableNumberColumnWidth - 1}px;
|
|
109
109
|
}`}
|
|
110
|
-
`}
|
|
111
110
|
}
|
|
112
111
|
.${TableSharedCssClassName.TABLE_CONTAINER}[data-number-column='true'] {
|
|
113
112
|
padding-left: ${akEditorTableNumberColumnWidth - 1}px;
|
|
@@ -143,11 +142,8 @@ const tableSharedStyle = () => {
|
|
|
143
142
|
border-collapse: collapse;
|
|
144
143
|
border: ${tableCellBorderWidth}px solid
|
|
145
144
|
${`var(--ds-background-accent-gray-subtler, ${akEditorTableBorder})`};
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
border-left-color: transparent;
|
|
149
|
-
border-right-color: transparent;
|
|
150
|
-
`}
|
|
145
|
+
border-left-color: transparent;
|
|
146
|
+
border-right-color: transparent;
|
|
151
147
|
table-layout: fixed;
|
|
152
148
|
font-size: 1em;
|
|
153
149
|
width: 100%;
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "
|
|
17
|
+
const packageVersion = "0.0.0-development";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -214,11 +214,10 @@ export const getBrowserInfo = memorizeOne(() => {
|
|
|
214
214
|
!ie && /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent);
|
|
215
215
|
|
|
216
216
|
// Previously relied on navigator.vendor, now used userAgent
|
|
217
|
-
|
|
217
|
+
result.safari = !result.chrome && !result.ie && !result.gecko && !result.android && !userAgent.includes('CriOS') && !userAgent.includes('FxiOS') &&
|
|
218
218
|
// eslint-disable-next-line require-unicode-regexp
|
|
219
|
-
|
|
219
|
+
/safari|applewebkit/i.test(userAgent);
|
|
220
220
|
result.safari_version = parseInt(
|
|
221
|
-
// Ignored via go/ees005
|
|
222
221
|
// eslint-disable-next-line require-unicode-regexp
|
|
223
222
|
(userAgent.match(/Version\/([0-9\._]+).*Safari/) || [])[1], 10);
|
|
224
223
|
|
|
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
|
|
|
10
10
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
11
11
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
12
12
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
13
|
-
var packageVersion = "
|
|
13
|
+
var packageVersion = "0.0.0-development";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// Ignored via go/ees007
|
|
@@ -117,15 +117,19 @@ export var expandSelectionBounds = function expandSelectionBounds($anchor, $head
|
|
|
117
117
|
/**
|
|
118
118
|
* Delete what is selected in the given transaction.
|
|
119
119
|
* @param tr the transaction to delete the selection from
|
|
120
|
+
* @param selectionToUse optional selection to delete instead of the transaction's current selection
|
|
120
121
|
* @returns the updated transaction
|
|
121
122
|
*/
|
|
122
|
-
export var deleteSelectedRange = function deleteSelectedRange(tr) {
|
|
123
|
-
var selection = tr.selection;
|
|
123
|
+
export var deleteSelectedRange = function deleteSelectedRange(tr, selectionToUse) {
|
|
124
|
+
var selection = selectionToUse || tr.selection;
|
|
124
125
|
var from = selection.$from.pos;
|
|
125
126
|
var to = selection.$to.pos;
|
|
126
127
|
if (selection instanceof TextSelection) {
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
// Expand just the from position to the start of the block
|
|
129
|
+
// This ensures entire paragraphs are deleted instead of just
|
|
130
|
+
// the text content, which avoids leaving an empty line behind
|
|
131
|
+
var expanded = expandToBlockRange(selection.$from, selection.$to);
|
|
132
|
+
from = expanded.$from.pos;
|
|
129
133
|
} else if (isTableSelected(selection)) {
|
|
130
134
|
var table = findTable(selection);
|
|
131
135
|
if (table) {
|
|
@@ -58,7 +58,7 @@ var firstNodeWithNotMarginTop = function firstNodeWithNotMarginTop() {
|
|
|
58
58
|
var tableSharedStyle = function tableSharedStyle() {
|
|
59
59
|
var browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
|
|
60
60
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Appears safe to auto-fix, but leaving it up to the team to remediate as the readability only gets worse with autofixing
|
|
61
|
-
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\t\t", "\n\t\t.", " {\n\t\t\tposition: relative;\n\t\t\tmargin: 0 auto ", ";\n\t\t\tbox-sizing: border-box;\n\n\t\t\t/**\n * Fix block top alignment inside table cells.\n */\n\t\t\t.decisionItemView-content-wrap:first-of-type > div {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\n\t\t\t", "\n\t\t}\n\t\t.", "[data-number-column='true'] {\n\t\t\tpadding-left: ", "px;\n\t\t\tclear: both;\n\t\t}\n\n\t\t.", " {\n\t\t\twill-change: width, margin-left;\n\t\t}\n\n\t\t.", " table {\n\t\t\twill-change: width;\n\t\t}\n\n\t\t.", " > table {\n\t\t\tmargin: ", " 0 0 0;\n\t\t}\n\n\t\t.", " > table,\n\t\t.", " > table {\n\t\t\tmargin: ", " ", " 0 0;\n\t\t}\n\n\t\t/* support panel nested in table */\n\t\t", "\n\n\t\t/* avoid applying styles to nested tables (possible via extensions) */\n\t.", " > table,\n\t.", " > table,\n\t.", " > table {\n\t\t\tborder-collapse: collapse;\n\t\t\tborder: ", "px solid\n\t\t\t\t", ";\n\n\t\t\
|
|
61
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\t\t", "\n\t\t.", " {\n\t\t\tposition: relative;\n\t\t\tmargin: 0 auto ", ";\n\t\t\tbox-sizing: border-box;\n\n\t\t\t/**\n * Fix block top alignment inside table cells.\n */\n\t\t\t.decisionItemView-content-wrap:first-of-type > div {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\t\t\t.", ",\n\t\t\t\t.", " {\n\t\t\t\tdisplay: block;\n\t\t\t\twidth: 1px;\n\t\t\t\theight: calc(100% - ", ");\n\t\t\t\tbackground: ", ";\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: ", ";\n\t\t\t}\n\t\t\t.", " {\n\t\t\t\tright: 0;\n\t\t\t}\n\t\t\t.", " {\n\t\t\t\tleft: 0;\n\t\t\t}\n\t\t\t", "\n\t\t}\n\t\t.", "[data-number-column='true'] {\n\t\t\tpadding-left: ", "px;\n\t\t\tclear: both;\n\t\t}\n\n\t\t.", " {\n\t\t\twill-change: width, margin-left;\n\t\t}\n\n\t\t.", " table {\n\t\t\twill-change: width;\n\t\t}\n\n\t\t.", " > table {\n\t\t\tmargin: ", " 0 0 0;\n\t\t}\n\n\t\t.", " > table,\n\t\t.", " > table {\n\t\t\tmargin: ", " ", " 0 0;\n\t\t}\n\n\t\t/* support panel nested in table */\n\t\t", "\n\n\t\t/* avoid applying styles to nested tables (possible via extensions) */\n\t.", " > table,\n\t.", " > table,\n\t.", " > table {\n\t\t\tborder-collapse: collapse;\n\t\t\tborder: ", "px solid\n\t\t\t\t", ";\n\t\t\tborder-left-color: transparent;\n\t\t\tborder-right-color: transparent;\n\t\t\ttable-layout: fixed;\n\t\t\tfont-size: 1em;\n\t\t\twidth: 100%;\n\n\t\t\t&[data-autosize='true'] {\n\t\t\t\ttable-layout: auto;\n\t\t\t}\n\n\t\t\t& {\n\t\t\t\t* {\n\t\t\t\t\tbox-sizing: border-box;\n\t\t\t\t}\n\t\t\t\thr {\n\t\t\t\t\tbox-sizing: content-box;\n\t\t\t\t}\n\n\t\t\t\ttbody {\n\t\t\t\t\tborder-bottom: none;\n\t\t\t\t}\n\t\t\t\tth td {\n\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t}\n\n\t\t\t\t> tbody > tr > th,\n\t\t\t\t> tbody > tr > td {\n\t\t\t\t\tmin-width: ", "px;\n\t\t\t\t\tfont-weight: ", ";\n\t\t\t\t\tvertical-align: top;\n\t\t\t\t\tborder: 1px solid ", ";\n\t\t\t\t\tborder-right-width: 0;\n\t\t\t\t\tborder-bottom-width: 0;\n\n\t\t\t\t\tpadding: ", ";\n\t\t\t\t\t/* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n\t\t\t\t\t", "\n\n\t\t\t\t\t", "\n\n\t\t\t\tth p:not(:first-of-type),\n\t\t\t\ttd p:not(:first-of-type) {\n\t\t\t\t\t\tmargin-top: ", ";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* Ensures nested tables are compatible with parent table background color - uses specificity to ensure tables nested by extensions are not affected */\n\t\t\t\t> tbody > tr > td {\n\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t}\n\n\t\t\t\tth {\n\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\ttext-align: left;\n\n\t\t\t\t\t/* only apply this styling to codeblocks in default background headercells */\n\t\t\t\t\t/* TODO this needs to be overhauled as it relies on unsafe selectors */\n\t\t\t\t\t", " {\n\t\t\t\t\t\t.", ":not(.danger) {\n\t\t\t\t\t\t\tbackground-color: ", ";\n\n\t\t\t\t\t\t\t:not(.", ") {\n\t\t\t\t\t\t\t\tbox-shadow: 0px 0px 0px 1px ", ";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\t\tbackground-image: ", ";\n\n\t\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/* this is only relevant to the element taken care of by renderer */\n\t\t\t\t\t\t\t> [data-ds--code--code-block] {\n\t\t\t\t\t\t\t\tbackground-image: ", "!important;\n\n\t\t\t\t\t\t\t\tbackground-color: ", "!important;\n\n\t\t\t\t\t\t\t\t/* selector lives inside @atlaskit/code */\n\t\t\t\t\t\t\t\t--ds--code--line-number-bg-color: ", ";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t"])), tableCellBackgroundStyleOverride(), TableSharedCssClassName.TABLE_CONTAINER, "var(--ds-space-200, 16px)", TableSharedCssClassName.TABLE_RIGHT_BORDER, TableSharedCssClassName.TABLE_LEFT_BORDER, "var(--ds-space-300, 24px)", "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-space-300, 24px)", TableSharedCssClassName.TABLE_RIGHT_BORDER, TableSharedCssClassName.TABLE_LEFT_BORDER, fg('platform_editor_table_numbered_table_border') && "\n\t\t\t\t.".concat(TableSharedCssClassName.TABLE_LEFT_BORDER, "[data-with-numbered-table='true'] {\n\t\t\t\t\tleft: ").concat(akEditorTableNumberColumnWidth - 1, "px;\n\t\t\t\t}"), TableSharedCssClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, "var(--ds-space-300, 24px)", TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", fg('platform_editor_bordered_panel_nested_in_table') ? ".".concat(TableSharedCssClassName.TABLE_NODE_WRAPPER, " .ak-editor-panel {\n\t\t\tborder: ", "var(--ds-border-width, 1px)", " solid ", "var(--ds-border, #d9dbea)", ";\n\t\t}") : '', TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableCellBorderWidth, "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-background-neutral-subtle, white)", tableCellMinWidth, "var(--ds-font-weight-regular, 400)", "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-space-100, 8px)", browser.gecko || browser.ie || browser.mac && browser.chrome ? 'background-clip: padding-box;' : '', firstNodeWithNotMarginTop(), "var(--ds-space-150, 12px)", "var(--ds-surface, #FFFFFF)", "var(--ds-background-accent-gray-subtlest, ".concat(akEditorTableToolbar, ")"), expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) ? '&:not(.danger)' : '&:not([style]):not(.danger)', CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, rgb(235, 237, 240))", akEditorSelectedNodeClassName, "var(--ds-border, transparent)", CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, overflowShadow({
|
|
62
62
|
leftCoverWidth: "var(--ds-space-300, 24px)"
|
|
63
63
|
}), "var(--ds-background-neutral, rgb(235, 237, 240))", CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-neutral, rgb(226, 229, 233))", overflowShadow({
|
|
64
64
|
leftCoverWidth: "var(--ds-space-300, 24px)"
|
|
@@ -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 = "
|
|
24
|
+
var packageVersion = "0.0.0-development";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -214,11 +214,10 @@ export var getBrowserInfo = memorizeOne(function () {
|
|
|
214
214
|
!_ie && /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent);
|
|
215
215
|
|
|
216
216
|
// Previously relied on navigator.vendor, now used userAgent
|
|
217
|
-
|
|
217
|
+
result.safari = !result.chrome && !result.ie && !result.gecko && !result.android && !userAgent.includes('CriOS') && !userAgent.includes('FxiOS') &&
|
|
218
218
|
// eslint-disable-next-line require-unicode-regexp
|
|
219
|
-
|
|
219
|
+
/safari|applewebkit/i.test(userAgent);
|
|
220
220
|
result.safari_version = parseInt(
|
|
221
|
-
// Ignored via go/ees005
|
|
222
221
|
// eslint-disable-next-line require-unicode-regexp
|
|
223
222
|
(userAgent.match(/Version\/([0-9\._]+).*Safari/) || [])[1], 10);
|
|
224
223
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import { type Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
4
|
export declare const isSelectionAtStartOfNode: ($pos: ResolvedPos, parentNode?: PMNode) => boolean;
|
|
4
5
|
export declare const isSelectionAtEndOfNode: ($pos: ResolvedPos, parentNode?: PMNode) => boolean;
|
|
5
6
|
export declare function atTheEndOfDoc(state: EditorState): boolean;
|
|
@@ -21,9 +22,10 @@ export declare const expandSelectionBounds: ($anchor: ResolvedPos, $head: Resolv
|
|
|
21
22
|
/**
|
|
22
23
|
* Delete what is selected in the given transaction.
|
|
23
24
|
* @param tr the transaction to delete the selection from
|
|
25
|
+
* @param selectionToUse optional selection to delete instead of the transaction's current selection
|
|
24
26
|
* @returns the updated transaction
|
|
25
27
|
*/
|
|
26
|
-
export declare const deleteSelectedRange: (tr: Transaction) => Transaction;
|
|
28
|
+
export declare const deleteSelectedRange: (tr: Transaction, selectionToUse?: Selection) => Transaction;
|
|
27
29
|
/**
|
|
28
30
|
* This expands the given $from and $to resolved positions to the block boundaries
|
|
29
31
|
* spanning all nodes in the range up to the nearest common ancestor.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import { type Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
4
|
export declare const isSelectionAtStartOfNode: ($pos: ResolvedPos, parentNode?: PMNode) => boolean;
|
|
4
5
|
export declare const isSelectionAtEndOfNode: ($pos: ResolvedPos, parentNode?: PMNode) => boolean;
|
|
5
6
|
export declare function atTheEndOfDoc(state: EditorState): boolean;
|
|
@@ -21,9 +22,10 @@ export declare const expandSelectionBounds: ($anchor: ResolvedPos, $head: Resolv
|
|
|
21
22
|
/**
|
|
22
23
|
* Delete what is selected in the given transaction.
|
|
23
24
|
* @param tr the transaction to delete the selection from
|
|
25
|
+
* @param selectionToUse optional selection to delete instead of the transaction's current selection
|
|
24
26
|
* @returns the updated transaction
|
|
25
27
|
*/
|
|
26
|
-
export declare const deleteSelectedRange: (tr: Transaction) => Transaction;
|
|
28
|
+
export declare const deleteSelectedRange: (tr: Transaction, selectionToUse?: Selection) => Transaction;
|
|
27
29
|
/**
|
|
28
30
|
* This expands the given $from and $to resolved positions to the block boundaries
|
|
29
31
|
* spanning all nodes in the range up to the nearest common ancestor.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "110.41.
|
|
3
|
+
"version": "110.41.4",
|
|
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/"
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@atlaskit/task-decision": "^19.2.0",
|
|
82
82
|
"@atlaskit/textfield": "^8.1.0",
|
|
83
83
|
"@atlaskit/theme": "^21.0.0",
|
|
84
|
-
"@atlaskit/tmp-editor-statsig": "^15.
|
|
84
|
+
"@atlaskit/tmp-editor-statsig": "^15.7.0",
|
|
85
85
|
"@atlaskit/tokens": "^8.4.0",
|
|
86
86
|
"@atlaskit/tooltip": "^20.11.0",
|
|
87
87
|
"@atlaskit/width-detector": "^5.0.0",
|
|
@@ -122,8 +122,7 @@
|
|
|
122
122
|
"@atlaskit/media-core": "^37.0.0",
|
|
123
123
|
"@testing-library/dom": "^10.1.0",
|
|
124
124
|
"@testing-library/jest-dom": "^6.4.5",
|
|
125
|
-
"@testing-library/react": "^
|
|
126
|
-
"@testing-library/react-hooks": "^8.0.1",
|
|
125
|
+
"@testing-library/react": "^16.3.0",
|
|
127
126
|
"@testing-library/user-event": "^14.4.3",
|
|
128
127
|
"@types/linkify-it": "^3.0.2",
|
|
129
128
|
"@types/markdown-it": "^14.1.2",
|