@atlaskit/editor-common 102.19.0 → 102.19.1
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 +9 -0
- package/dist/cjs/link/index.js +6 -0
- package/dist/cjs/link/utils.js +58 -1
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/table/SortingIcon.js +2 -4
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/link/index.js +1 -1
- package/dist/es2019/link/utils.js +62 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/table/SortingIcon.js +2 -4
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/link/index.js +1 -1
- package/dist/esm/link/utils.js +57 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/table/SortingIcon.js +2 -4
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/link/index.d.ts +1 -1
- package/dist/types/link/utils.d.ts +6 -1
- package/dist/types-ts4.5/link/index.d.ts +1 -1
- package/dist/types-ts4.5/link/utils.d.ts +6 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 102.19.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#136939](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/136939)
|
|
8
|
+
[`960086975117b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/960086975117b) -
|
|
9
|
+
EDITOR-566 Cleaned up platform_editor_allow_annotation_triple_click and defaulted to true
|
|
10
|
+
behaviour.
|
|
11
|
+
|
|
3
12
|
## 102.19.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
package/dist/cjs/link/index.js
CHANGED
|
@@ -83,6 +83,12 @@ Object.defineProperty(exports, "containerWithProvider", {
|
|
|
83
83
|
return _ToolbarComponents.containerWithProvider;
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
|
+
Object.defineProperty(exports, "getActiveLinkMark", {
|
|
87
|
+
enumerable: true,
|
|
88
|
+
get: function get() {
|
|
89
|
+
return _utils2.getActiveLinkMark;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
86
92
|
Object.defineProperty(exports, "getLinkPreferencesURLFromENV", {
|
|
87
93
|
enumerable: true,
|
|
88
94
|
get: function get() {
|
package/dist/cjs/link/utils.js
CHANGED
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getLinkPreferencesURLFromENV = void 0;
|
|
6
|
+
exports.getLinkPreferencesURLFromENV = exports.getActiveLinkMark = void 0;
|
|
7
7
|
exports.isLinkAtPos = isLinkAtPos;
|
|
8
8
|
exports.isTextAtPos = isTextAtPos;
|
|
9
9
|
var _atlassianContext = require("@atlaskit/atlassian-context");
|
|
10
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
10
12
|
var _constants = require("./constants");
|
|
11
13
|
function isTextAtPos(pos) {
|
|
12
14
|
return function (_ref) {
|
|
@@ -23,4 +25,59 @@ function isLinkAtPos(pos) {
|
|
|
23
25
|
}
|
|
24
26
|
var getLinkPreferencesURLFromENV = exports.getLinkPreferencesURLFromENV = function getLinkPreferencesURLFromENV() {
|
|
25
27
|
return (0, _atlassianContext.getATLContextUrl)('id') + _constants.linkPreferencesPath;
|
|
28
|
+
};
|
|
29
|
+
var isSelectionInsideLink = function isSelectionInsideLink(state) {
|
|
30
|
+
return !!state.doc.type.schema.marks.link.isInSet(state.selection.$from.marks());
|
|
31
|
+
};
|
|
32
|
+
var isEmptySelectionBeforeLink = function isEmptySelectionBeforeLink(state) {
|
|
33
|
+
var _$from$nodeAfter;
|
|
34
|
+
var _state$selection = state.selection,
|
|
35
|
+
$from = _state$selection.$from,
|
|
36
|
+
$to = _state$selection.$to;
|
|
37
|
+
return $from === $to && !!state.doc.type.schema.marks.link.isInSet(((_$from$nodeAfter = $from.nodeAfter) === null || _$from$nodeAfter === void 0 ? void 0 : _$from$nodeAfter.marks) || []);
|
|
38
|
+
};
|
|
39
|
+
var isEmptySelectionAfterLink = function isEmptySelectionAfterLink(state) {
|
|
40
|
+
var _$from$nodeBefore;
|
|
41
|
+
var _state$selection2 = state.selection,
|
|
42
|
+
$from = _state$selection2.$from,
|
|
43
|
+
$to = _state$selection2.$to;
|
|
44
|
+
return $from === $to && !!state.doc.type.schema.marks.link.isInSet(((_$from$nodeBefore = $from.nodeBefore) === null || _$from$nodeBefore === void 0 ? void 0 : _$from$nodeBefore.marks) || []);
|
|
45
|
+
};
|
|
46
|
+
var isSelectionAroundLink = function isSelectionAroundLink(state) {
|
|
47
|
+
var _state$selection3 = state.selection,
|
|
48
|
+
$from = _state$selection3.$from,
|
|
49
|
+
$to = _state$selection3.$to;
|
|
50
|
+
var node = $from.nodeAfter;
|
|
51
|
+
return !!node && $from.textOffset === 0 && $to.pos - $from.pos === node.nodeSize && !!state.doc.type.schema.marks.link.isInSet(node.marks);
|
|
52
|
+
};
|
|
53
|
+
var getActiveLinkMark = exports.getActiveLinkMark = function getActiveLinkMark(state) {
|
|
54
|
+
var $from = state.selection.$from;
|
|
55
|
+
if (isSelectionInsideLink(state) || isSelectionAroundLink(state)) {
|
|
56
|
+
var pos = $from.pos - $from.textOffset;
|
|
57
|
+
var node = state.doc.nodeAt(pos);
|
|
58
|
+
return node && node.isText ? {
|
|
59
|
+
node: node,
|
|
60
|
+
pos: pos
|
|
61
|
+
} : undefined;
|
|
62
|
+
}
|
|
63
|
+
if (isEmptySelectionBeforeLink(state) && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_3')) {
|
|
64
|
+
// if user clicks right before the link, we want to show the toolbar for the link
|
|
65
|
+
// but only if the link is a single character
|
|
66
|
+
var _node = state.doc.nodeAt($from.pos);
|
|
67
|
+
return _node && _node.isText && _node.nodeSize === 1 ? {
|
|
68
|
+
node: _node,
|
|
69
|
+
pos: $from.pos
|
|
70
|
+
} : undefined;
|
|
71
|
+
}
|
|
72
|
+
if (isEmptySelectionAfterLink(state) && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_3')) {
|
|
73
|
+
// if user clicks right after the link, we want to show the toolbar for the link
|
|
74
|
+
// but only if the link is a single character
|
|
75
|
+
// and we return the position of the link
|
|
76
|
+
var _node2 = state.doc.nodeAt($from.pos - 1);
|
|
77
|
+
return _node2 && _node2.isText && _node2.nodeSize === 1 ? {
|
|
78
|
+
node: _node2,
|
|
79
|
+
pos: $from.pos - 1
|
|
80
|
+
} : undefined;
|
|
81
|
+
}
|
|
82
|
+
return undefined;
|
|
26
83
|
};
|
|
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
18
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
19
19
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
20
|
-
var packageVersion = "102.19.
|
|
20
|
+
var packageVersion = "102.19.1";
|
|
21
21
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
22
22
|
// Remove URL as it has UGC
|
|
23
23
|
// Ignored via go/ees007
|
|
@@ -19,9 +19,6 @@ var _templateObject, _templateObject2;
|
|
|
19
19
|
* @jsx jsx
|
|
20
20
|
*/
|
|
21
21
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
22
|
-
var annotationRangeFixStyle = (0, _react.css)({
|
|
23
|
-
userSelect: 'none'
|
|
24
|
-
});
|
|
25
22
|
var StatusClassNames = exports.StatusClassNames = /*#__PURE__*/function (StatusClassNames) {
|
|
26
23
|
StatusClassNames["ASC"] = "sorting-icon-svg__asc";
|
|
27
24
|
StatusClassNames["DESC"] = "sorting-icon-svg__desc";
|
|
@@ -42,6 +39,7 @@ var iconStyles = (0, _react.css)({
|
|
|
42
39
|
width: '2px',
|
|
43
40
|
borderRadius: '50px',
|
|
44
41
|
background: "var(--ds-icon, #42526E)",
|
|
42
|
+
userSelect: 'none',
|
|
45
43
|
'&::before, &::after': {
|
|
46
44
|
background: "var(--ds-icon, #42526E)",
|
|
47
45
|
content: "''",
|
|
@@ -150,7 +148,7 @@ var SortingIcon = function SortingIcon(_ref) {
|
|
|
150
148
|
,
|
|
151
149
|
className: getIconClassName(isSortingAllowed, sortOrdered)
|
|
152
150
|
}, (0, _react.jsx)("div", {
|
|
153
|
-
css: [iconStyles
|
|
151
|
+
css: [iconStyles]
|
|
154
152
|
}))));
|
|
155
153
|
};
|
|
156
154
|
var _default = exports.default = (0, _reactIntlNext.injectIntl)(SortingIcon);
|
|
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
23
23
|
* @jsx jsx
|
|
24
24
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
25
25
|
var packageName = "@atlaskit/editor-common";
|
|
26
|
-
var packageVersion = "102.19.
|
|
26
|
+
var packageVersion = "102.19.1";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = '0, 8';
|
|
29
29
|
// Ignored via go/ees005
|
|
@@ -11,6 +11,6 @@ export { EditorLinkPicker } from './LinkPicker/EditorLinkPicker';
|
|
|
11
11
|
export { HyperlinkAddToolbar } from './LinkPicker/HyperlinkAddToolbar';
|
|
12
12
|
export { default as HyperlinkLinkAddToolbar, HyperlinkLinkAddToolbarWithIntl, RECENT_SEARCH_LIST_SIZE } from './LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar';
|
|
13
13
|
export { sha1 } from './LinkPicker/HyperlinkAddToolbar/utils';
|
|
14
|
-
export { isLinkAtPos, isTextAtPos, getLinkPreferencesURLFromENV } from './utils';
|
|
14
|
+
export { isLinkAtPos, isTextAtPos, getLinkPreferencesURLFromENV, getActiveLinkMark } from './utils';
|
|
15
15
|
export { OverlayButton } from './ConfigureLinkOverlay';
|
|
16
16
|
export { handleNavigation } from './ConfigureLinkOverlay/handleNavigation';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { getATLContextUrl } from '@atlaskit/atlassian-context';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
2
4
|
import { linkPreferencesPath } from './constants';
|
|
3
5
|
export function isTextAtPos(pos) {
|
|
4
6
|
return ({
|
|
@@ -16,4 +18,64 @@ export function isLinkAtPos(pos) {
|
|
|
16
18
|
}
|
|
17
19
|
export const getLinkPreferencesURLFromENV = () => {
|
|
18
20
|
return getATLContextUrl('id') + linkPreferencesPath;
|
|
21
|
+
};
|
|
22
|
+
const isSelectionInsideLink = state => !!state.doc.type.schema.marks.link.isInSet(state.selection.$from.marks());
|
|
23
|
+
const isEmptySelectionBeforeLink = state => {
|
|
24
|
+
var _$from$nodeAfter;
|
|
25
|
+
const {
|
|
26
|
+
$from,
|
|
27
|
+
$to
|
|
28
|
+
} = state.selection;
|
|
29
|
+
return $from === $to && !!state.doc.type.schema.marks.link.isInSet(((_$from$nodeAfter = $from.nodeAfter) === null || _$from$nodeAfter === void 0 ? void 0 : _$from$nodeAfter.marks) || []);
|
|
30
|
+
};
|
|
31
|
+
const isEmptySelectionAfterLink = state => {
|
|
32
|
+
var _$from$nodeBefore;
|
|
33
|
+
const {
|
|
34
|
+
$from,
|
|
35
|
+
$to
|
|
36
|
+
} = state.selection;
|
|
37
|
+
return $from === $to && !!state.doc.type.schema.marks.link.isInSet(((_$from$nodeBefore = $from.nodeBefore) === null || _$from$nodeBefore === void 0 ? void 0 : _$from$nodeBefore.marks) || []);
|
|
38
|
+
};
|
|
39
|
+
const isSelectionAroundLink = state => {
|
|
40
|
+
const {
|
|
41
|
+
$from,
|
|
42
|
+
$to
|
|
43
|
+
} = state.selection;
|
|
44
|
+
const node = $from.nodeAfter;
|
|
45
|
+
return !!node && $from.textOffset === 0 && $to.pos - $from.pos === node.nodeSize && !!state.doc.type.schema.marks.link.isInSet(node.marks);
|
|
46
|
+
};
|
|
47
|
+
export const getActiveLinkMark = state => {
|
|
48
|
+
const {
|
|
49
|
+
selection: {
|
|
50
|
+
$from
|
|
51
|
+
}
|
|
52
|
+
} = state;
|
|
53
|
+
if (isSelectionInsideLink(state) || isSelectionAroundLink(state)) {
|
|
54
|
+
const pos = $from.pos - $from.textOffset;
|
|
55
|
+
const node = state.doc.nodeAt(pos);
|
|
56
|
+
return node && node.isText ? {
|
|
57
|
+
node,
|
|
58
|
+
pos
|
|
59
|
+
} : undefined;
|
|
60
|
+
}
|
|
61
|
+
if (isEmptySelectionBeforeLink(state) && editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_3')) {
|
|
62
|
+
// if user clicks right before the link, we want to show the toolbar for the link
|
|
63
|
+
// but only if the link is a single character
|
|
64
|
+
const node = state.doc.nodeAt($from.pos);
|
|
65
|
+
return node && node.isText && node.nodeSize === 1 ? {
|
|
66
|
+
node,
|
|
67
|
+
pos: $from.pos
|
|
68
|
+
} : undefined;
|
|
69
|
+
}
|
|
70
|
+
if (isEmptySelectionAfterLink(state) && editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_3')) {
|
|
71
|
+
// if user clicks right after the link, we want to show the toolbar for the link
|
|
72
|
+
// but only if the link is a single character
|
|
73
|
+
// and we return the position of the link
|
|
74
|
+
const node = state.doc.nodeAt($from.pos - 1);
|
|
75
|
+
return node && node.isText && node.nodeSize === 1 ? {
|
|
76
|
+
node,
|
|
77
|
+
pos: $from.pos - 1
|
|
78
|
+
} : undefined;
|
|
79
|
+
}
|
|
80
|
+
return undefined;
|
|
19
81
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isFedRamp } from './environment';
|
|
2
2
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
3
3
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
4
|
-
const packageVersion = "102.19.
|
|
4
|
+
const packageVersion = "102.19.1";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// Ignored via go/ees007
|
|
@@ -10,9 +10,6 @@ import Tooltip from '@atlaskit/tooltip';
|
|
|
10
10
|
import { SortOrder } from '../types';
|
|
11
11
|
import { SORTABLE_COLUMN_ICON_CLASSNAME } from './consts';
|
|
12
12
|
import { sortingAriaLabelMessages, sortingIconMessages } from './messages';
|
|
13
|
-
const annotationRangeFixStyle = css({
|
|
14
|
-
userSelect: 'none'
|
|
15
|
-
});
|
|
16
13
|
export let StatusClassNames = /*#__PURE__*/function (StatusClassNames) {
|
|
17
14
|
StatusClassNames["ASC"] = "sorting-icon-svg__asc";
|
|
18
15
|
StatusClassNames["DESC"] = "sorting-icon-svg__desc";
|
|
@@ -76,6 +73,7 @@ const iconStyles = css({
|
|
|
76
73
|
width: '2px',
|
|
77
74
|
borderRadius: '50px',
|
|
78
75
|
background: "var(--ds-icon, #42526E)",
|
|
76
|
+
userSelect: 'none',
|
|
79
77
|
'&::before, &::after': {
|
|
80
78
|
background: "var(--ds-icon, #42526E)",
|
|
81
79
|
content: "''",
|
|
@@ -189,7 +187,7 @@ const SortingIcon = ({
|
|
|
189
187
|
,
|
|
190
188
|
className: getIconClassName(isSortingAllowed, sortOrdered)
|
|
191
189
|
}, jsx("div", {
|
|
192
|
-
css: [iconStyles
|
|
190
|
+
css: [iconStyles]
|
|
193
191
|
}))));
|
|
194
192
|
};
|
|
195
193
|
export default injectIntl(SortingIcon);
|
|
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
13
13
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
14
14
|
import Layer from '../Layer';
|
|
15
15
|
const packageName = "@atlaskit/editor-common";
|
|
16
|
-
const packageVersion = "102.19.
|
|
16
|
+
const packageVersion = "102.19.1";
|
|
17
17
|
const halfFocusRing = 1;
|
|
18
18
|
const dropOffset = '0, 8';
|
|
19
19
|
// Ignored via go/ees005
|
package/dist/esm/link/index.js
CHANGED
|
@@ -11,6 +11,6 @@ export { EditorLinkPicker } from './LinkPicker/EditorLinkPicker';
|
|
|
11
11
|
export { HyperlinkAddToolbar } from './LinkPicker/HyperlinkAddToolbar';
|
|
12
12
|
export { default as HyperlinkLinkAddToolbar, HyperlinkLinkAddToolbarWithIntl, RECENT_SEARCH_LIST_SIZE } from './LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar';
|
|
13
13
|
export { sha1 } from './LinkPicker/HyperlinkAddToolbar/utils';
|
|
14
|
-
export { isLinkAtPos, isTextAtPos, getLinkPreferencesURLFromENV } from './utils';
|
|
14
|
+
export { isLinkAtPos, isTextAtPos, getLinkPreferencesURLFromENV, getActiveLinkMark } from './utils';
|
|
15
15
|
export { OverlayButton } from './ConfigureLinkOverlay';
|
|
16
16
|
export { handleNavigation } from './ConfigureLinkOverlay/handleNavigation';
|
package/dist/esm/link/utils.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { getATLContextUrl } from '@atlaskit/atlassian-context';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
2
4
|
import { linkPreferencesPath } from './constants';
|
|
3
5
|
export function isTextAtPos(pos) {
|
|
4
6
|
return function (_ref) {
|
|
@@ -15,4 +17,59 @@ export function isLinkAtPos(pos) {
|
|
|
15
17
|
}
|
|
16
18
|
export var getLinkPreferencesURLFromENV = function getLinkPreferencesURLFromENV() {
|
|
17
19
|
return getATLContextUrl('id') + linkPreferencesPath;
|
|
20
|
+
};
|
|
21
|
+
var isSelectionInsideLink = function isSelectionInsideLink(state) {
|
|
22
|
+
return !!state.doc.type.schema.marks.link.isInSet(state.selection.$from.marks());
|
|
23
|
+
};
|
|
24
|
+
var isEmptySelectionBeforeLink = function isEmptySelectionBeforeLink(state) {
|
|
25
|
+
var _$from$nodeAfter;
|
|
26
|
+
var _state$selection = state.selection,
|
|
27
|
+
$from = _state$selection.$from,
|
|
28
|
+
$to = _state$selection.$to;
|
|
29
|
+
return $from === $to && !!state.doc.type.schema.marks.link.isInSet(((_$from$nodeAfter = $from.nodeAfter) === null || _$from$nodeAfter === void 0 ? void 0 : _$from$nodeAfter.marks) || []);
|
|
30
|
+
};
|
|
31
|
+
var isEmptySelectionAfterLink = function isEmptySelectionAfterLink(state) {
|
|
32
|
+
var _$from$nodeBefore;
|
|
33
|
+
var _state$selection2 = state.selection,
|
|
34
|
+
$from = _state$selection2.$from,
|
|
35
|
+
$to = _state$selection2.$to;
|
|
36
|
+
return $from === $to && !!state.doc.type.schema.marks.link.isInSet(((_$from$nodeBefore = $from.nodeBefore) === null || _$from$nodeBefore === void 0 ? void 0 : _$from$nodeBefore.marks) || []);
|
|
37
|
+
};
|
|
38
|
+
var isSelectionAroundLink = function isSelectionAroundLink(state) {
|
|
39
|
+
var _state$selection3 = state.selection,
|
|
40
|
+
$from = _state$selection3.$from,
|
|
41
|
+
$to = _state$selection3.$to;
|
|
42
|
+
var node = $from.nodeAfter;
|
|
43
|
+
return !!node && $from.textOffset === 0 && $to.pos - $from.pos === node.nodeSize && !!state.doc.type.schema.marks.link.isInSet(node.marks);
|
|
44
|
+
};
|
|
45
|
+
export var getActiveLinkMark = function getActiveLinkMark(state) {
|
|
46
|
+
var $from = state.selection.$from;
|
|
47
|
+
if (isSelectionInsideLink(state) || isSelectionAroundLink(state)) {
|
|
48
|
+
var pos = $from.pos - $from.textOffset;
|
|
49
|
+
var node = state.doc.nodeAt(pos);
|
|
50
|
+
return node && node.isText ? {
|
|
51
|
+
node: node,
|
|
52
|
+
pos: pos
|
|
53
|
+
} : undefined;
|
|
54
|
+
}
|
|
55
|
+
if (isEmptySelectionBeforeLink(state) && editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_3')) {
|
|
56
|
+
// if user clicks right before the link, we want to show the toolbar for the link
|
|
57
|
+
// but only if the link is a single character
|
|
58
|
+
var _node = state.doc.nodeAt($from.pos);
|
|
59
|
+
return _node && _node.isText && _node.nodeSize === 1 ? {
|
|
60
|
+
node: _node,
|
|
61
|
+
pos: $from.pos
|
|
62
|
+
} : undefined;
|
|
63
|
+
}
|
|
64
|
+
if (isEmptySelectionAfterLink(state) && editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_3')) {
|
|
65
|
+
// if user clicks right after the link, we want to show the toolbar for the link
|
|
66
|
+
// but only if the link is a single character
|
|
67
|
+
// and we return the position of the link
|
|
68
|
+
var _node2 = state.doc.nodeAt($from.pos - 1);
|
|
69
|
+
return _node2 && _node2.isText && _node2.nodeSize === 1 ? {
|
|
70
|
+
node: _node2,
|
|
71
|
+
pos: $from.pos - 1
|
|
72
|
+
} : undefined;
|
|
73
|
+
}
|
|
74
|
+
return undefined;
|
|
18
75
|
};
|
|
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
import { isFedRamp } from './environment';
|
|
8
8
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
9
9
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
10
|
-
var packageVersion = "102.19.
|
|
10
|
+
var packageVersion = "102.19.1";
|
|
11
11
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
12
12
|
// Remove URL as it has UGC
|
|
13
13
|
// Ignored via go/ees007
|
|
@@ -12,9 +12,6 @@ import Tooltip from '@atlaskit/tooltip';
|
|
|
12
12
|
import { SortOrder } from '../types';
|
|
13
13
|
import { SORTABLE_COLUMN_ICON_CLASSNAME } from './consts';
|
|
14
14
|
import { sortingAriaLabelMessages, sortingIconMessages } from './messages';
|
|
15
|
-
var annotationRangeFixStyle = css({
|
|
16
|
-
userSelect: 'none'
|
|
17
|
-
});
|
|
18
15
|
export var StatusClassNames = /*#__PURE__*/function (StatusClassNames) {
|
|
19
16
|
StatusClassNames["ASC"] = "sorting-icon-svg__asc";
|
|
20
17
|
StatusClassNames["DESC"] = "sorting-icon-svg__desc";
|
|
@@ -37,6 +34,7 @@ var iconStyles = css({
|
|
|
37
34
|
width: '2px',
|
|
38
35
|
borderRadius: '50px',
|
|
39
36
|
background: "var(--ds-icon, #42526E)",
|
|
37
|
+
userSelect: 'none',
|
|
40
38
|
'&::before, &::after': {
|
|
41
39
|
background: "var(--ds-icon, #42526E)",
|
|
42
40
|
content: "''",
|
|
@@ -145,7 +143,7 @@ var SortingIcon = function SortingIcon(_ref) {
|
|
|
145
143
|
,
|
|
146
144
|
className: getIconClassName(isSortingAllowed, sortOrdered)
|
|
147
145
|
}, jsx("div", {
|
|
148
|
-
css: [iconStyles
|
|
146
|
+
css: [iconStyles]
|
|
149
147
|
}))));
|
|
150
148
|
};
|
|
151
149
|
export default injectIntl(SortingIcon);
|
|
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
20
20
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
21
21
|
import Layer from '../Layer';
|
|
22
22
|
var packageName = "@atlaskit/editor-common";
|
|
23
|
-
var packageVersion = "102.19.
|
|
23
|
+
var packageVersion = "102.19.1";
|
|
24
24
|
var halfFocusRing = 1;
|
|
25
25
|
var dropOffset = '0, 8';
|
|
26
26
|
// Ignored via go/ees005
|
|
@@ -13,7 +13,7 @@ export { default as HyperlinkLinkAddToolbar, HyperlinkLinkAddToolbarWithIntl, RE
|
|
|
13
13
|
export type { Props as HyperlinkLinkAddToolbarProps } from './LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar';
|
|
14
14
|
export type { HyperlinkAddToolbarProps } from './LinkPicker/HyperlinkAddToolbar';
|
|
15
15
|
export { sha1 } from './LinkPicker/HyperlinkAddToolbar/utils';
|
|
16
|
-
export { isLinkAtPos, isTextAtPos, getLinkPreferencesURLFromENV } from './utils';
|
|
16
|
+
export { isLinkAtPos, isTextAtPos, getLinkPreferencesURLFromENV, getActiveLinkMark } from './utils';
|
|
17
17
|
export { OverlayButton } from './ConfigureLinkOverlay';
|
|
18
18
|
export type { OverlayButtonProps } from './ConfigureLinkOverlay';
|
|
19
19
|
export { handleNavigation } from './ConfigureLinkOverlay/handleNavigation';
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
3
|
import type { Predicate } from '../types';
|
|
3
4
|
export declare function isTextAtPos(pos: number): (props: {
|
|
4
5
|
tr: Transaction;
|
|
5
6
|
}) => boolean;
|
|
6
7
|
export declare function isLinkAtPos(pos: number): Predicate;
|
|
7
8
|
export declare const getLinkPreferencesURLFromENV: () => string;
|
|
9
|
+
export declare const getActiveLinkMark: (state: EditorState | Transaction) => {
|
|
10
|
+
node: Node;
|
|
11
|
+
pos: number;
|
|
12
|
+
} | undefined;
|
|
@@ -13,7 +13,7 @@ export { default as HyperlinkLinkAddToolbar, HyperlinkLinkAddToolbarWithIntl, RE
|
|
|
13
13
|
export type { Props as HyperlinkLinkAddToolbarProps } from './LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar';
|
|
14
14
|
export type { HyperlinkAddToolbarProps } from './LinkPicker/HyperlinkAddToolbar';
|
|
15
15
|
export { sha1 } from './LinkPicker/HyperlinkAddToolbar/utils';
|
|
16
|
-
export { isLinkAtPos, isTextAtPos, getLinkPreferencesURLFromENV } from './utils';
|
|
16
|
+
export { isLinkAtPos, isTextAtPos, getLinkPreferencesURLFromENV, getActiveLinkMark } from './utils';
|
|
17
17
|
export { OverlayButton } from './ConfigureLinkOverlay';
|
|
18
18
|
export type { OverlayButtonProps } from './ConfigureLinkOverlay';
|
|
19
19
|
export { handleNavigation } from './ConfigureLinkOverlay/handleNavigation';
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
3
|
import type { Predicate } from '../types';
|
|
3
4
|
export declare function isTextAtPos(pos: number): (props: {
|
|
4
5
|
tr: Transaction;
|
|
5
6
|
}) => boolean;
|
|
6
7
|
export declare function isLinkAtPos(pos: number): Predicate;
|
|
7
8
|
export declare const getLinkPreferencesURLFromENV: () => string;
|
|
9
|
+
export declare const getActiveLinkMark: (state: EditorState | Transaction) => {
|
|
10
|
+
node: Node;
|
|
11
|
+
pos: number;
|
|
12
|
+
} | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "102.19.
|
|
3
|
+
"version": "102.19.1",
|
|
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/"
|
|
@@ -263,9 +263,6 @@
|
|
|
263
263
|
"platform_editor_react18_phase2_v2_extended": {
|
|
264
264
|
"type": "boolean"
|
|
265
265
|
},
|
|
266
|
-
"platform_editor_allow_annotation_triple_click": {
|
|
267
|
-
"type": "boolean"
|
|
268
|
-
},
|
|
269
266
|
"platform_editor_typography_ugc": {
|
|
270
267
|
"type": "boolean"
|
|
271
268
|
},
|
|
@@ -341,6 +338,9 @@
|
|
|
341
338
|
"platform_editor_controls_patch_2": {
|
|
342
339
|
"type": "boolean"
|
|
343
340
|
},
|
|
341
|
+
"platform_editor_controls_patch_3": {
|
|
342
|
+
"type": "boolean"
|
|
343
|
+
},
|
|
344
344
|
"platform_editor_lcm_nested_panel_icon_fix": {
|
|
345
345
|
"type": "boolean"
|
|
346
346
|
}
|