@atlaskit/editor-common 120.16.4 → 121.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist/cjs/ai-messages/ai-suggestions.js +5 -0
- package/dist/cjs/mark/anyMarksActiveFromTr.js +35 -0
- package/dist/cjs/mark/getHadMarkAttributes.js +38 -0
- package/dist/cjs/mark/index.js +14 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/hyperlink.js +9 -5
- package/dist/es2019/ai-messages/ai-suggestions.js +5 -0
- package/dist/es2019/mark/anyMarksActiveFromTr.js +31 -0
- package/dist/es2019/mark/getHadMarkAttributes.js +28 -0
- package/dist/es2019/mark/index.js +2 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/hyperlink.js +5 -2
- package/dist/esm/ai-messages/ai-suggestions.js +5 -0
- package/dist/esm/mark/anyMarksActiveFromTr.js +30 -0
- package/dist/esm/mark/getHadMarkAttributes.js +32 -0
- package/dist/esm/mark/index.js +2 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/hyperlink.js +8 -3
- package/dist/types/ai-messages/ai-suggestions.d.ts +5 -0
- package/dist/types/analytics/types/format-events.d.ts +1 -0
- package/dist/types/analytics/types/highlight-events.d.ts +2 -0
- package/dist/types/analytics/types/insert-events.d.ts +1 -0
- package/dist/types/analytics/types/paste-events.d.ts +1 -0
- package/dist/types/mark/anyMarksActiveFromTr.d.ts +6 -0
- package/dist/types/mark/getHadMarkAttributes.d.ts +15 -0
- package/dist/types/mark/index.d.ts +3 -0
- package/dist/types/utils/hyperlink.d.ts +2 -1
- package/package.json +6 -6
- package/deprecated-platform-feature-experiments/package.json +0 -10
- package/dist/cjs/platform-feature-experiments/exp-val.js +0 -25
- package/dist/cjs/platform-feature-experiments/index.js +0 -26
- package/dist/cjs/platform-feature-experiments/is-experiment-enabled.js +0 -26
- package/dist/cjs/platform-feature-experiments/unsafe-exp-val-no-exposure.js +0 -22
- package/dist/es2019/platform-feature-experiments/exp-val.js +0 -19
- package/dist/es2019/platform-feature-experiments/index.js +0 -4
- package/dist/es2019/platform-feature-experiments/is-experiment-enabled.js +0 -20
- package/dist/es2019/platform-feature-experiments/unsafe-exp-val-no-exposure.js +0 -17
- package/dist/esm/platform-feature-experiments/exp-val.js +0 -19
- package/dist/esm/platform-feature-experiments/index.js +0 -4
- package/dist/esm/platform-feature-experiments/is-experiment-enabled.js +0 -20
- package/dist/esm/platform-feature-experiments/unsafe-exp-val-no-exposure.js +0 -17
- package/dist/types/platform-feature-experiments/exp-val.d.ts +0 -11
- package/dist/types/platform-feature-experiments/index.d.ts +0 -3
- package/dist/types/platform-feature-experiments/is-experiment-enabled.d.ts +0 -11
- package/dist/types/platform-feature-experiments/unsafe-exp-val-no-exposure.d.ts +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 121.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`35f8ff3c9ce4f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/35f8ff3c9ce4f) -
|
|
8
|
+
Clean up the released `platform_editor_improve_inline_diffs` experiment and remove the obsolete
|
|
9
|
+
editor experiment migration entry point.
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`fb891566dfac2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fb891566dfac2) -
|
|
14
|
+
Add anyMarksActiveFromTr and getHadMarkAttributes so mark-active checks can run from a
|
|
15
|
+
transaction. Color, highlight, toolbar/Cmd+K link apply, and paste events include had-mark
|
|
16
|
+
attributes behind kill switch platform_editor_add_text_color_tracking.
|
|
17
|
+
- [`3e4b2877553a2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3e4b2877553a2) -
|
|
18
|
+
Display agent and user author identities on AI suggestion cards.
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
24
|
+
## 120.16.5
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Updated dependencies
|
|
29
|
+
|
|
3
30
|
## 120.16.4
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
|
@@ -141,6 +141,11 @@ var aiSuggestionsMessages = exports.aiSuggestionsMessages = (0, _reactIntl.defin
|
|
|
141
141
|
defaultMessage: 'Rovo',
|
|
142
142
|
description: 'Deprecated title for Rovo branding on the AI suggestions card'
|
|
143
143
|
},
|
|
144
|
+
cardAuthorsTooltipLabel: {
|
|
145
|
+
id: 'fabric.editor.ai.suggestions.card.authorsTooltipLabel.non-final',
|
|
146
|
+
defaultMessage: '{agentName} with {userName}',
|
|
147
|
+
description: 'Tooltip identifying the agent and user who authored an AI suggestion together'
|
|
148
|
+
},
|
|
144
149
|
cardPrivateLabel: {
|
|
145
150
|
id: 'fabric.editor.ai.suggestions.card.privateLabel.non-final',
|
|
146
151
|
defaultMessage: 'Private',
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.anyMarksActiveFromTr = void 0;
|
|
7
|
+
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
8
|
+
/**
|
|
9
|
+
* Determine which of the given marks exist anywhere in the transaction selection.
|
|
10
|
+
*/
|
|
11
|
+
var anyMarksActiveFromTr = exports.anyMarksActiveFromTr = function anyMarksActiveFromTr(tr, markTypes) {
|
|
12
|
+
var _tr$selection = tr.selection,
|
|
13
|
+
$from = _tr$selection.$from,
|
|
14
|
+
from = _tr$selection.from,
|
|
15
|
+
to = _tr$selection.to,
|
|
16
|
+
empty = _tr$selection.empty;
|
|
17
|
+
return markTypes.map(function (markType) {
|
|
18
|
+
if (empty) {
|
|
19
|
+
return !!markType.isInSet(tr.storedMarks || $from.marks());
|
|
20
|
+
}
|
|
21
|
+
var rangeHasMark = false;
|
|
22
|
+
if (tr.selection instanceof _cellSelection.CellSelection) {
|
|
23
|
+
tr.selection.forEachCell(function (cell, cellPos) {
|
|
24
|
+
var from = cellPos;
|
|
25
|
+
var to = cellPos + cell.nodeSize;
|
|
26
|
+
if (!rangeHasMark) {
|
|
27
|
+
rangeHasMark = tr.doc.rangeHasMark(from, to, markType);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
} else {
|
|
31
|
+
rangeHasMark = tr.doc.rangeHasMark(from, to, markType);
|
|
32
|
+
}
|
|
33
|
+
return rangeHasMark;
|
|
34
|
+
});
|
|
35
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getHadMarkAttributes = void 0;
|
|
7
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
8
|
+
var _anyMarksActiveFromTr = require("./anyMarksActiveFromTr");
|
|
9
|
+
var HAD_ATTRIBUTE = {
|
|
10
|
+
backgroundColor: 'hadBackgroundColor',
|
|
11
|
+
link: 'hadLink',
|
|
12
|
+
textColor: 'hadTextColor'
|
|
13
|
+
};
|
|
14
|
+
var isMarkName = function isMarkName(name) {
|
|
15
|
+
return name in HAD_ATTRIBUTE;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* `had*` flags for color / highlight / link apply events.
|
|
20
|
+
* Kill switch `platform_editor_add_text_color_tracking`: gate on, new attributes off.
|
|
21
|
+
*/
|
|
22
|
+
var getHadMarkAttributes = exports.getHadMarkAttributes = function getHadMarkAttributes(tr, markTypes) {
|
|
23
|
+
if ((0, _fg.fg)('platform_editor_add_text_color_tracking')) {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
var definedMarkTypes = markTypes.filter(function (markType) {
|
|
27
|
+
return !!markType;
|
|
28
|
+
});
|
|
29
|
+
var found = (0, _anyMarksActiveFromTr.anyMarksActiveFromTr)(tr, definedMarkTypes);
|
|
30
|
+
var result = {};
|
|
31
|
+
for (var i = 0; i < definedMarkTypes.length; i++) {
|
|
32
|
+
var markName = definedMarkTypes[i].name;
|
|
33
|
+
if (isMarkName(markName)) {
|
|
34
|
+
result[HAD_ATTRIBUTE[markName]] = Boolean(found[i]);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
};
|
package/dist/cjs/mark/index.js
CHANGED
|
@@ -9,6 +9,12 @@ Object.defineProperty(exports, "anyMarkActive", {
|
|
|
9
9
|
return _anyMarkActive.anyMarkActive;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "anyMarksActiveFromTr", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _anyMarksActiveFromTr.anyMarksActiveFromTr;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
12
18
|
Object.defineProperty(exports, "applyMarkOnRange", {
|
|
13
19
|
enumerable: true,
|
|
14
20
|
get: function get() {
|
|
@@ -27,6 +33,12 @@ Object.defineProperty(exports, "filterChildrenBetween", {
|
|
|
27
33
|
return _filterChildrenBetween.filterChildrenBetween;
|
|
28
34
|
}
|
|
29
35
|
});
|
|
36
|
+
Object.defineProperty(exports, "getHadMarkAttributes", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function get() {
|
|
39
|
+
return _getHadMarkAttributes.getHadMarkAttributes;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
30
42
|
Object.defineProperty(exports, "isMarkAllowedInRange", {
|
|
31
43
|
enumerable: true,
|
|
32
44
|
get: function get() {
|
|
@@ -68,6 +80,8 @@ var _entireSelectionContainsMark = require("./entireSelectionContainsMark");
|
|
|
68
80
|
var _filterChildrenBetween = require("./filterChildrenBetween");
|
|
69
81
|
var _removeMark = require("./removeMark");
|
|
70
82
|
var _anyMarkActive = require("./anyMarkActive");
|
|
83
|
+
var _anyMarksActiveFromTr = require("./anyMarksActiveFromTr");
|
|
84
|
+
var _getHadMarkAttributes = require("./getHadMarkAttributes");
|
|
71
85
|
var _isMarkAllowedInRange = require("./isMarkAllowedInRange");
|
|
72
86
|
var _isMarkExcluded = require("./isMarkExcluded");
|
|
73
87
|
var _textFormatting = require("./text-formatting");
|
|
@@ -27,7 +27,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
27
27
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
28
28
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
29
29
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
30
|
-
var packageVersion = "120.16.
|
|
30
|
+
var packageVersion = "120.16.5";
|
|
31
31
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
32
32
|
// Remove URL as it has UGC
|
|
33
33
|
// Ignored via go/ees007
|
|
@@ -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 = "120.16.
|
|
27
|
+
var packageVersion = "120.16.5";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -39,8 +40,10 @@ Object.defineProperty(exports, "normalizeUrl", {
|
|
|
39
40
|
return _normalizeUrl.normalizeUrl;
|
|
40
41
|
}
|
|
41
42
|
});
|
|
43
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
42
44
|
var _url = require("@atlaskit/adf-schema/url");
|
|
43
45
|
var _enums = require("../analytics/types/enums");
|
|
46
|
+
var _getHadMarkAttributes = require("../mark/getHadMarkAttributes");
|
|
44
47
|
var _FILEPATH_REGEXP = require("./FILEPATH_REGEXP");
|
|
45
48
|
var _getLinkDomain = require("./getLinkDomain");
|
|
46
49
|
var _normalizeUrl = require("./normalizeUrl");
|
|
@@ -48,9 +51,9 @@ var _shouldAutoLinkifyTld = require("./should-auto-linkify-tld");
|
|
|
48
51
|
var _slice = require("./slice");
|
|
49
52
|
var _LinkMatcher = require("./LinkMatcher");
|
|
50
53
|
var _canLinkBeCreatedInRange = require("./canLinkBeCreatedInRange");
|
|
51
|
-
|
|
54
|
+
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; }
|
|
55
|
+
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; } // File has been copied to packages/editor/editor-plugin-ai/src/provider/markdown-transformer/utils/hyperlink.ts
|
|
52
56
|
// If changes are made to this file, please make the same update in the linked file.
|
|
53
|
-
|
|
54
57
|
// Don't linkify if starts with $ or {
|
|
55
58
|
// Ignored via go/ees005
|
|
56
59
|
// eslint-disable-next-line require-unicode-regexp
|
|
@@ -156,15 +159,16 @@ var isLinkInMatches = exports.isLinkInMatches = function isLinkInMatches(linkSta
|
|
|
156
159
|
};
|
|
157
160
|
|
|
158
161
|
// eslint-disable-next-line jsdoc/require-jsdoc, @atlaskit/volt-strict-mode/no-multiple-exports
|
|
159
|
-
function getLinkCreationAnalyticsEvent(inputMethod, url) {
|
|
162
|
+
function getLinkCreationAnalyticsEvent(inputMethod, url, tr) {
|
|
163
|
+
var backgroundColor = tr === null || tr === void 0 ? void 0 : tr.doc.type.schema.marks.backgroundColor;
|
|
160
164
|
return {
|
|
161
165
|
action: _enums.ACTION.INSERTED,
|
|
162
166
|
actionSubject: _enums.ACTION_SUBJECT.DOCUMENT,
|
|
163
167
|
actionSubjectId: _enums.ACTION_SUBJECT_ID.LINK,
|
|
164
|
-
attributes: {
|
|
168
|
+
attributes: _objectSpread({
|
|
165
169
|
inputMethod: inputMethod,
|
|
166
170
|
fromCurrentDomain: isFromCurrentDomain(url)
|
|
167
|
-
},
|
|
171
|
+
}, tr && backgroundColor ? (0, _getHadMarkAttributes.getHadMarkAttributes)(tr, [backgroundColor]) : {}),
|
|
168
172
|
eventType: _enums.EVENT_TYPE.TRACK,
|
|
169
173
|
nonPrivacySafeAttributes: {
|
|
170
174
|
linkDomain: (0, _getLinkDomain.getLinkDomain)(url)
|
|
@@ -135,6 +135,11 @@ export const aiSuggestionsMessages = defineMessages({
|
|
|
135
135
|
defaultMessage: 'Rovo',
|
|
136
136
|
description: 'Deprecated title for Rovo branding on the AI suggestions card'
|
|
137
137
|
},
|
|
138
|
+
cardAuthorsTooltipLabel: {
|
|
139
|
+
id: 'fabric.editor.ai.suggestions.card.authorsTooltipLabel.non-final',
|
|
140
|
+
defaultMessage: '{agentName} with {userName}',
|
|
141
|
+
description: 'Tooltip identifying the agent and user who authored an AI suggestion together'
|
|
142
|
+
},
|
|
138
143
|
cardPrivateLabel: {
|
|
139
144
|
id: 'fabric.editor.ai.suggestions.card.privateLabel.non-final',
|
|
140
145
|
defaultMessage: 'Private',
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Determine which of the given marks exist anywhere in the transaction selection.
|
|
5
|
+
*/
|
|
6
|
+
export const anyMarksActiveFromTr = (tr, markTypes) => {
|
|
7
|
+
const {
|
|
8
|
+
$from,
|
|
9
|
+
from,
|
|
10
|
+
to,
|
|
11
|
+
empty
|
|
12
|
+
} = tr.selection;
|
|
13
|
+
return markTypes.map(markType => {
|
|
14
|
+
if (empty) {
|
|
15
|
+
return !!markType.isInSet(tr.storedMarks || $from.marks());
|
|
16
|
+
}
|
|
17
|
+
let rangeHasMark = false;
|
|
18
|
+
if (tr.selection instanceof CellSelection) {
|
|
19
|
+
tr.selection.forEachCell((cell, cellPos) => {
|
|
20
|
+
const from = cellPos;
|
|
21
|
+
const to = cellPos + cell.nodeSize;
|
|
22
|
+
if (!rangeHasMark) {
|
|
23
|
+
rangeHasMark = tr.doc.rangeHasMark(from, to, markType);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
} else {
|
|
27
|
+
rangeHasMark = tr.doc.rangeHasMark(from, to, markType);
|
|
28
|
+
}
|
|
29
|
+
return rangeHasMark;
|
|
30
|
+
});
|
|
31
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
2
|
+
import { anyMarksActiveFromTr } from './anyMarksActiveFromTr';
|
|
3
|
+
const HAD_ATTRIBUTE = {
|
|
4
|
+
backgroundColor: 'hadBackgroundColor',
|
|
5
|
+
link: 'hadLink',
|
|
6
|
+
textColor: 'hadTextColor'
|
|
7
|
+
};
|
|
8
|
+
const isMarkName = name => name in HAD_ATTRIBUTE;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* `had*` flags for color / highlight / link apply events.
|
|
12
|
+
* Kill switch `platform_editor_add_text_color_tracking`: gate on, new attributes off.
|
|
13
|
+
*/
|
|
14
|
+
export const getHadMarkAttributes = (tr, markTypes) => {
|
|
15
|
+
if (fg('platform_editor_add_text_color_tracking')) {
|
|
16
|
+
return {};
|
|
17
|
+
}
|
|
18
|
+
const definedMarkTypes = markTypes.filter(markType => !!markType);
|
|
19
|
+
const found = anyMarksActiveFromTr(tr, definedMarkTypes);
|
|
20
|
+
const result = {};
|
|
21
|
+
for (let i = 0; i < definedMarkTypes.length; i++) {
|
|
22
|
+
const markName = definedMarkTypes[i].name;
|
|
23
|
+
if (isMarkName(markName)) {
|
|
24
|
+
result[HAD_ATTRIBUTE[markName]] = Boolean(found[i]);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
@@ -6,6 +6,8 @@ export { entireSelectionContainsMark } from './entireSelectionContainsMark';
|
|
|
6
6
|
export { filterChildrenBetween } from './filterChildrenBetween';
|
|
7
7
|
export { removeMark } from './removeMark';
|
|
8
8
|
export { anyMarkActive } from './anyMarkActive';
|
|
9
|
+
export { anyMarksActiveFromTr } from './anyMarksActiveFromTr';
|
|
10
|
+
export { getHadMarkAttributes } from './getHadMarkAttributes';
|
|
9
11
|
export { isMarkAllowedInRange } from './isMarkAllowedInRange';
|
|
10
12
|
export { isMarkExcluded } from './isMarkExcluded';
|
|
11
13
|
export { wholeSelectionHasMarks } from './text-formatting';
|
|
@@ -13,7 +13,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
13
13
|
const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
14
14
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
15
15
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
16
|
-
const packageVersion = "120.16.
|
|
16
|
+
const packageVersion = "120.16.5";
|
|
17
17
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
18
18
|
// Remove URL as it has UGC
|
|
19
19
|
// Ignored via go/ees007
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "120.16.
|
|
17
|
+
const packageVersion = "120.16.5";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import { linkify } from '@atlaskit/adf-schema/url';
|
|
5
5
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../analytics/types/enums';
|
|
6
|
+
import { getHadMarkAttributes } from '../mark/getHadMarkAttributes';
|
|
6
7
|
import { FILEPATH_REGEXP } from './FILEPATH_REGEXP';
|
|
7
8
|
import { getLinkDomain } from './getLinkDomain';
|
|
8
9
|
import { normalizeUrl } from './normalizeUrl';
|
|
@@ -111,14 +112,16 @@ export const isLinkInMatches = (linkStart, matchesList) => {
|
|
|
111
112
|
};
|
|
112
113
|
|
|
113
114
|
// eslint-disable-next-line jsdoc/require-jsdoc, @atlaskit/volt-strict-mode/no-multiple-exports
|
|
114
|
-
export function getLinkCreationAnalyticsEvent(inputMethod, url) {
|
|
115
|
+
export function getLinkCreationAnalyticsEvent(inputMethod, url, tr) {
|
|
116
|
+
const backgroundColor = tr === null || tr === void 0 ? void 0 : tr.doc.type.schema.marks.backgroundColor;
|
|
115
117
|
return {
|
|
116
118
|
action: ACTION.INSERTED,
|
|
117
119
|
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
118
120
|
actionSubjectId: ACTION_SUBJECT_ID.LINK,
|
|
119
121
|
attributes: {
|
|
120
122
|
inputMethod,
|
|
121
|
-
fromCurrentDomain: isFromCurrentDomain(url)
|
|
123
|
+
fromCurrentDomain: isFromCurrentDomain(url),
|
|
124
|
+
...(tr && backgroundColor ? getHadMarkAttributes(tr, [backgroundColor]) : {})
|
|
122
125
|
},
|
|
123
126
|
eventType: EVENT_TYPE.TRACK,
|
|
124
127
|
nonPrivacySafeAttributes: {
|
|
@@ -135,6 +135,11 @@ export var aiSuggestionsMessages = defineMessages({
|
|
|
135
135
|
defaultMessage: 'Rovo',
|
|
136
136
|
description: 'Deprecated title for Rovo branding on the AI suggestions card'
|
|
137
137
|
},
|
|
138
|
+
cardAuthorsTooltipLabel: {
|
|
139
|
+
id: 'fabric.editor.ai.suggestions.card.authorsTooltipLabel.non-final',
|
|
140
|
+
defaultMessage: '{agentName} with {userName}',
|
|
141
|
+
description: 'Tooltip identifying the agent and user who authored an AI suggestion together'
|
|
142
|
+
},
|
|
138
143
|
cardPrivateLabel: {
|
|
139
144
|
id: 'fabric.editor.ai.suggestions.card.privateLabel.non-final',
|
|
140
145
|
defaultMessage: 'Private',
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Determine which of the given marks exist anywhere in the transaction selection.
|
|
5
|
+
*/
|
|
6
|
+
export var anyMarksActiveFromTr = function anyMarksActiveFromTr(tr, markTypes) {
|
|
7
|
+
var _tr$selection = tr.selection,
|
|
8
|
+
$from = _tr$selection.$from,
|
|
9
|
+
from = _tr$selection.from,
|
|
10
|
+
to = _tr$selection.to,
|
|
11
|
+
empty = _tr$selection.empty;
|
|
12
|
+
return markTypes.map(function (markType) {
|
|
13
|
+
if (empty) {
|
|
14
|
+
return !!markType.isInSet(tr.storedMarks || $from.marks());
|
|
15
|
+
}
|
|
16
|
+
var rangeHasMark = false;
|
|
17
|
+
if (tr.selection instanceof CellSelection) {
|
|
18
|
+
tr.selection.forEachCell(function (cell, cellPos) {
|
|
19
|
+
var from = cellPos;
|
|
20
|
+
var to = cellPos + cell.nodeSize;
|
|
21
|
+
if (!rangeHasMark) {
|
|
22
|
+
rangeHasMark = tr.doc.rangeHasMark(from, to, markType);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
} else {
|
|
26
|
+
rangeHasMark = tr.doc.rangeHasMark(from, to, markType);
|
|
27
|
+
}
|
|
28
|
+
return rangeHasMark;
|
|
29
|
+
});
|
|
30
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
2
|
+
import { anyMarksActiveFromTr } from './anyMarksActiveFromTr';
|
|
3
|
+
var HAD_ATTRIBUTE = {
|
|
4
|
+
backgroundColor: 'hadBackgroundColor',
|
|
5
|
+
link: 'hadLink',
|
|
6
|
+
textColor: 'hadTextColor'
|
|
7
|
+
};
|
|
8
|
+
var isMarkName = function isMarkName(name) {
|
|
9
|
+
return name in HAD_ATTRIBUTE;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* `had*` flags for color / highlight / link apply events.
|
|
14
|
+
* Kill switch `platform_editor_add_text_color_tracking`: gate on, new attributes off.
|
|
15
|
+
*/
|
|
16
|
+
export var getHadMarkAttributes = function getHadMarkAttributes(tr, markTypes) {
|
|
17
|
+
if (fg('platform_editor_add_text_color_tracking')) {
|
|
18
|
+
return {};
|
|
19
|
+
}
|
|
20
|
+
var definedMarkTypes = markTypes.filter(function (markType) {
|
|
21
|
+
return !!markType;
|
|
22
|
+
});
|
|
23
|
+
var found = anyMarksActiveFromTr(tr, definedMarkTypes);
|
|
24
|
+
var result = {};
|
|
25
|
+
for (var i = 0; i < definedMarkTypes.length; i++) {
|
|
26
|
+
var markName = definedMarkTypes[i].name;
|
|
27
|
+
if (isMarkName(markName)) {
|
|
28
|
+
result[HAD_ATTRIBUTE[markName]] = Boolean(found[i]);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return result;
|
|
32
|
+
};
|
package/dist/esm/mark/index.js
CHANGED
|
@@ -6,6 +6,8 @@ export { entireSelectionContainsMark } from './entireSelectionContainsMark';
|
|
|
6
6
|
export { filterChildrenBetween } from './filterChildrenBetween';
|
|
7
7
|
export { removeMark } from './removeMark';
|
|
8
8
|
export { anyMarkActive } from './anyMarkActive';
|
|
9
|
+
export { anyMarksActiveFromTr } from './anyMarksActiveFromTr';
|
|
10
|
+
export { getHadMarkAttributes } from './getHadMarkAttributes';
|
|
9
11
|
export { isMarkAllowedInRange } from './isMarkAllowedInRange';
|
|
10
12
|
export { isMarkExcluded } from './isMarkExcluded';
|
|
11
13
|
export { wholeSelectionHasMarks } from './text-formatting';
|
|
@@ -19,7 +19,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
19
19
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
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 = "120.16.
|
|
22
|
+
var packageVersion = "120.16.5";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "120.16.
|
|
24
|
+
var packageVersion = "120.16.5";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
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; }
|
|
3
|
+
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) { _defineProperty(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; }
|
|
1
4
|
// File has been copied to packages/editor/editor-plugin-ai/src/provider/markdown-transformer/utils/hyperlink.ts
|
|
2
5
|
// If changes are made to this file, please make the same update in the linked file.
|
|
3
6
|
|
|
4
7
|
import { linkify } from '@atlaskit/adf-schema/url';
|
|
5
8
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../analytics/types/enums';
|
|
9
|
+
import { getHadMarkAttributes } from '../mark/getHadMarkAttributes';
|
|
6
10
|
import { FILEPATH_REGEXP } from './FILEPATH_REGEXP';
|
|
7
11
|
import { getLinkDomain } from './getLinkDomain';
|
|
8
12
|
import { normalizeUrl } from './normalizeUrl';
|
|
@@ -114,15 +118,16 @@ export var isLinkInMatches = function isLinkInMatches(linkStart, matchesList) {
|
|
|
114
118
|
};
|
|
115
119
|
|
|
116
120
|
// eslint-disable-next-line jsdoc/require-jsdoc, @atlaskit/volt-strict-mode/no-multiple-exports
|
|
117
|
-
export function getLinkCreationAnalyticsEvent(inputMethod, url) {
|
|
121
|
+
export function getLinkCreationAnalyticsEvent(inputMethod, url, tr) {
|
|
122
|
+
var backgroundColor = tr === null || tr === void 0 ? void 0 : tr.doc.type.schema.marks.backgroundColor;
|
|
118
123
|
return {
|
|
119
124
|
action: ACTION.INSERTED,
|
|
120
125
|
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
121
126
|
actionSubjectId: ACTION_SUBJECT_ID.LINK,
|
|
122
|
-
attributes: {
|
|
127
|
+
attributes: _objectSpread({
|
|
123
128
|
inputMethod: inputMethod,
|
|
124
129
|
fromCurrentDomain: isFromCurrentDomain(url)
|
|
125
|
-
},
|
|
130
|
+
}, tr && backgroundColor ? getHadMarkAttributes(tr, [backgroundColor]) : {}),
|
|
126
131
|
eventType: EVENT_TYPE.TRACK,
|
|
127
132
|
nonPrivacySafeAttributes: {
|
|
128
133
|
linkDomain: getLinkDomain(url)
|
|
@@ -9,6 +9,11 @@ export declare const aiSuggestionsMessages: {
|
|
|
9
9
|
description: string;
|
|
10
10
|
id: string;
|
|
11
11
|
};
|
|
12
|
+
cardAuthorsTooltipLabel: {
|
|
13
|
+
defaultMessage: string;
|
|
14
|
+
description: string;
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
12
17
|
cardBadSuggestionLabel: {
|
|
13
18
|
defaultMessage: string;
|
|
14
19
|
description: string;
|
|
@@ -44,6 +44,7 @@ type FormatClearAEP = FormatAEP<ACTION_SUBJECT_ID.FORMAT_CLEAR, {
|
|
|
44
44
|
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB;
|
|
45
45
|
}>;
|
|
46
46
|
type FormatColorAEP = FormatAEP<ACTION_SUBJECT_ID.FORMAT_COLOR, {
|
|
47
|
+
hadBackgroundColor?: boolean;
|
|
47
48
|
inputMethod?: INPUT_METHOD.TOOLBAR | INPUT_METHOD.FLOATING_TB;
|
|
48
49
|
newColor: string;
|
|
49
50
|
previousColor: string;
|
|
@@ -4,6 +4,8 @@ export type HighlightToolbarToggleAEP = TrackAEP<ACTION.OPENED | ACTION.CLOSED,
|
|
|
4
4
|
inputMethod: INPUT_METHOD;
|
|
5
5
|
}, undefined>;
|
|
6
6
|
export type HighlightTextAEP = TrackAEP<ACTION.FORMATTED, ACTION_SUBJECT.TEXT, ACTION_SUBJECT_ID.FORMAT_BACKGROUND_COLOR, {
|
|
7
|
+
hadLink?: boolean;
|
|
8
|
+
hadTextColor?: boolean;
|
|
7
9
|
inputMethod: INPUT_METHOD;
|
|
8
10
|
newColor: string;
|
|
9
11
|
previousColor: string;
|
|
@@ -94,6 +94,7 @@ type InsertMediaInlineAEP = InsertAEP<ACTION_SUBJECT_ID.MEDIA, {
|
|
|
94
94
|
export type InputMethodInsertLink = INPUT_METHOD.TYPEAHEAD | INPUT_METHOD.CLIPBOARD | INPUT_METHOD.FORMATTING | INPUT_METHOD.AUTO_DETECT | INPUT_METHOD.MANUAL;
|
|
95
95
|
type InsertLinkAEP = InsertAEP<ACTION_SUBJECT_ID.LINK, {
|
|
96
96
|
fromCurrentDomain: boolean;
|
|
97
|
+
hadBackgroundColor?: boolean;
|
|
97
98
|
inputMethod: InputMethodInsertLink;
|
|
98
99
|
}, {
|
|
99
100
|
linkDomain: string;
|
|
@@ -17,6 +17,7 @@ type PasteBaseAEP<Action, Attributes, NonPrivacySafeAttributes> = TrackAEP<Actio
|
|
|
17
17
|
type PasteBaseOperationalAEP<Action, Attributes> = OperationalAEP<Action, ACTION_SUBJECT.EDITOR, PASTE_ACTION_SUBJECT_ID, Attributes>;
|
|
18
18
|
type PasteAEP = PasteBaseAEP<ACTION.PASTED, {
|
|
19
19
|
content: PasteContent;
|
|
20
|
+
hadBackgroundColor?: boolean;
|
|
20
21
|
inputMethod: INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
21
22
|
invokedFrom?: string;
|
|
22
23
|
pasteSize: number;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Mark, MarkType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
/**
|
|
4
|
+
* Determine which of the given marks exist anywhere in the transaction selection.
|
|
5
|
+
*/
|
|
6
|
+
export declare const anyMarksActiveFromTr: (tr: Transaction | ReadonlyTransaction, markTypes: readonly (Mark | MarkType)[]) => boolean[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { MarkType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
declare const HAD_ATTRIBUTE: {
|
|
4
|
+
readonly backgroundColor: 'hadBackgroundColor';
|
|
5
|
+
readonly link: 'hadLink';
|
|
6
|
+
readonly textColor: 'hadTextColor';
|
|
7
|
+
};
|
|
8
|
+
type MarkName = keyof typeof HAD_ATTRIBUTE;
|
|
9
|
+
export type HadMarkAttribute = (typeof HAD_ATTRIBUTE)[MarkName];
|
|
10
|
+
/**
|
|
11
|
+
* `had*` flags for color / highlight / link apply events.
|
|
12
|
+
* Kill switch `platform_editor_add_text_color_tracking`: gate on, new attributes off.
|
|
13
|
+
*/
|
|
14
|
+
export declare const getHadMarkAttributes: (tr: Transaction | ReadonlyTransaction, markTypes: readonly (MarkType | undefined)[]) => Partial<Record<HadMarkAttribute, boolean>>;
|
|
15
|
+
export {};
|
|
@@ -3,6 +3,9 @@ export { entireSelectionContainsMark } from './entireSelectionContainsMark';
|
|
|
3
3
|
export { filterChildrenBetween } from './filterChildrenBetween';
|
|
4
4
|
export { removeMark } from './removeMark';
|
|
5
5
|
export { anyMarkActive } from './anyMarkActive';
|
|
6
|
+
export { anyMarksActiveFromTr } from './anyMarksActiveFromTr';
|
|
7
|
+
export { getHadMarkAttributes } from './getHadMarkAttributes';
|
|
8
|
+
export type { HadMarkAttribute } from './getHadMarkAttributes';
|
|
6
9
|
export { isMarkAllowedInRange } from './isMarkAllowedInRange';
|
|
7
10
|
export { isMarkExcluded } from './isMarkExcluded';
|
|
8
11
|
export { wholeSelectionHasMarks } from './text-formatting';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Schema, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
3
|
import type { AnalyticsEventPayload } from '../analytics/types/events';
|
|
3
4
|
import type { InputMethodInsertLink } from '../analytics/types/insert-events';
|
|
4
5
|
export declare const DONTLINKIFY_REGEXP: RegExp;
|
|
@@ -13,7 +14,7 @@ interface filepathMatch {
|
|
|
13
14
|
}
|
|
14
15
|
export declare const findFilepaths: (text: string, offset?: number) => Array<filepathMatch>;
|
|
15
16
|
export declare const isLinkInMatches: (linkStart: number, matchesList: Array<filepathMatch>) => boolean;
|
|
16
|
-
export declare function getLinkCreationAnalyticsEvent(inputMethod: InputMethodInsertLink, url: string): AnalyticsEventPayload;
|
|
17
|
+
export declare function getLinkCreationAnalyticsEvent(inputMethod: InputMethodInsertLink, url: string, tr?: Transaction | ReadonlyTransaction): AnalyticsEventPayload;
|
|
17
18
|
export { FILEPATH_REGEXP } from './FILEPATH_REGEXP';
|
|
18
19
|
export { LinkMatcher } from './LinkMatcher';
|
|
19
20
|
export { normalizeUrl } from './normalizeUrl';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "121.0.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/"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@atlaskit/activity-provider": "^3.1.0",
|
|
32
|
-
"@atlaskit/adf-schema": "^57.
|
|
32
|
+
"@atlaskit/adf-schema": "^57.4.0",
|
|
33
33
|
"@atlaskit/adf-utils": "^20.9.0",
|
|
34
34
|
"@atlaskit/afm-i18n-platform-editor-editor-common": "2.200.0",
|
|
35
35
|
"@atlaskit/analytics-listeners": "^11.3.0",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"@atlaskit/task-decision": "^21.9.0",
|
|
85
85
|
"@atlaskit/teams-app-config": "^3.1.0",
|
|
86
86
|
"@atlaskit/textfield": "^10.2.0",
|
|
87
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
87
|
+
"@atlaskit/tmp-editor-statsig": "^179.0.0",
|
|
88
88
|
"@atlaskit/tokens": "^16.11.0",
|
|
89
89
|
"@atlaskit/tooltip": "^24.3.0",
|
|
90
90
|
"@atlaskit/width-detector": "^7.2.0",
|
|
@@ -146,6 +146,9 @@
|
|
|
146
146
|
"sinon": "^2.2.0"
|
|
147
147
|
},
|
|
148
148
|
"platform-feature-flags": {
|
|
149
|
+
"platform_editor_add_text_color_tracking": {
|
|
150
|
+
"type": "boolean"
|
|
151
|
+
},
|
|
149
152
|
"platform_editor_blocks_patch_7": {
|
|
150
153
|
"type": "boolean",
|
|
151
154
|
"referenceOnly": true
|
|
@@ -165,9 +168,6 @@
|
|
|
165
168
|
"type": "boolean",
|
|
166
169
|
"referenceOnly": true
|
|
167
170
|
},
|
|
168
|
-
"platform_editor_use_new_experiments_api": {
|
|
169
|
-
"type": "boolean"
|
|
170
|
-
},
|
|
171
171
|
"platform_editor_sanitize_selection_fragments": {
|
|
172
172
|
"type": "boolean"
|
|
173
173
|
},
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@atlaskit/editor-common/deprecated-platform-feature-experiments",
|
|
3
|
-
"main": "../dist/cjs/platform-feature-experiments/index.js",
|
|
4
|
-
"module": "../dist/esm/platform-feature-experiments/index.js",
|
|
5
|
-
"module:es2019": "../dist/es2019/platform-feature-experiments/index.js",
|
|
6
|
-
"sideEffects": [
|
|
7
|
-
"**/*.compiled.css"
|
|
8
|
-
],
|
|
9
|
-
"types": "../dist/types/platform-feature-experiments/index.d.ts"
|
|
10
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.expVal = expVal;
|
|
7
|
-
var _expVal = require("@atlaskit/platform-feature-experiments/exp-val");
|
|
8
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
9
|
-
/* eslint-disable @atlaskit/platform/inline-usage -- This temporary strangler intentionally wraps the old and new experiment APIs during migration. */
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Temporary strangler for migrating editor experiments to
|
|
13
|
-
* `@atlaskit/platform-feature-experiments`.
|
|
14
|
-
*
|
|
15
|
-
* The final callback preserves the existing experiment implementation while the migration gate is
|
|
16
|
-
* off. It is evaluated lazily so only one implementation reads the experiment or fires exposure.
|
|
17
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/exp-val` when the transition gate is
|
|
18
|
-
* removed.
|
|
19
|
-
*/
|
|
20
|
-
function expVal(experimentName, param, defaultValue, legacyValue) {
|
|
21
|
-
if ((0, _fg.fg)('platform_editor_use_new_experiments_api')) {
|
|
22
|
-
return (0, _expVal.expVal)(experimentName, param, defaultValue);
|
|
23
|
-
}
|
|
24
|
-
return legacyValue();
|
|
25
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "UNSAFE_expValNoExposure", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _unsafeExpValNoExposure.UNSAFE_expValNoExposure;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "expVal", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _expVal.expVal;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "isExperimentEnabled", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _isExperimentEnabled.isExperimentEnabled;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
var _expVal = require("./exp-val");
|
|
25
|
-
var _isExperimentEnabled = require("./is-experiment-enabled");
|
|
26
|
-
var _unsafeExpValNoExposure = require("./unsafe-exp-val-no-exposure");
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.isExperimentEnabled = isExperimentEnabled;
|
|
7
|
-
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
8
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
9
|
-
/* eslint-disable @atlaskit/platform/inline-usage -- This temporary strangler intentionally wraps the old and new experiment APIs during migration. */
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Temporary strangler for boolean editor experiments using the conventional `isEnabled` param.
|
|
13
|
-
* The legacy callback is evaluated only while the migration gate is off.
|
|
14
|
-
*
|
|
15
|
-
* For experiments with multiple product keys, OR one call per unique product key. Pass the real
|
|
16
|
-
* legacy callback only to the first call and `() => false` to the remaining calls so the fallback
|
|
17
|
-
* is evaluated at most once.
|
|
18
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/is-experiment-enabled` when the
|
|
19
|
-
* transition gate is removed.
|
|
20
|
-
*/
|
|
21
|
-
function isExperimentEnabled(experimentName, legacyValue) {
|
|
22
|
-
if ((0, _fg.fg)('platform_editor_use_new_experiments_api')) {
|
|
23
|
-
return (0, _isExperimentEnabled.isExperimentEnabled)(experimentName);
|
|
24
|
-
}
|
|
25
|
-
return legacyValue();
|
|
26
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.UNSAFE_expValNoExposure = UNSAFE_expValNoExposure;
|
|
7
|
-
var _unsafeExpValNoExposure = require("@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure");
|
|
8
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
9
|
-
/* eslint-disable @atlaskit/platform/inline-usage -- This temporary strangler intentionally wraps the old and new experiment APIs during migration. */
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Temporary strangler for editor experiment reads that intentionally do not fire exposure.
|
|
13
|
-
* The legacy callback is evaluated only while the migration gate is off.
|
|
14
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure` when the
|
|
15
|
-
* transition gate is removed.
|
|
16
|
-
*/
|
|
17
|
-
function UNSAFE_expValNoExposure(experimentName, param, defaultValue, legacyValue) {
|
|
18
|
-
if ((0, _fg.fg)('platform_editor_use_new_experiments_api')) {
|
|
19
|
-
return (0, _unsafeExpValNoExposure.UNSAFE_expValNoExposure)(experimentName, param, defaultValue);
|
|
20
|
-
}
|
|
21
|
-
return legacyValue();
|
|
22
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @atlaskit/platform/inline-usage -- This temporary strangler intentionally wraps the old and new experiment APIs during migration. */
|
|
2
|
-
import { expVal as platformExpVal } from '@atlaskit/platform-feature-experiments/exp-val';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Temporary strangler for migrating editor experiments to
|
|
7
|
-
* `@atlaskit/platform-feature-experiments`.
|
|
8
|
-
*
|
|
9
|
-
* The final callback preserves the existing experiment implementation while the migration gate is
|
|
10
|
-
* off. It is evaluated lazily so only one implementation reads the experiment or fires exposure.
|
|
11
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/exp-val` when the transition gate is
|
|
12
|
-
* removed.
|
|
13
|
-
*/
|
|
14
|
-
export function expVal(experimentName, param, defaultValue, legacyValue) {
|
|
15
|
-
if (fg('platform_editor_use_new_experiments_api')) {
|
|
16
|
-
return platformExpVal(experimentName, param, defaultValue);
|
|
17
|
-
}
|
|
18
|
-
return legacyValue();
|
|
19
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @atlaskit/platform/inline-usage -- This temporary strangler intentionally wraps the old and new experiment APIs during migration. */
|
|
2
|
-
import { isExperimentEnabled as platformIsExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Temporary strangler for boolean editor experiments using the conventional `isEnabled` param.
|
|
7
|
-
* The legacy callback is evaluated only while the migration gate is off.
|
|
8
|
-
*
|
|
9
|
-
* For experiments with multiple product keys, OR one call per unique product key. Pass the real
|
|
10
|
-
* legacy callback only to the first call and `() => false` to the remaining calls so the fallback
|
|
11
|
-
* is evaluated at most once.
|
|
12
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/is-experiment-enabled` when the
|
|
13
|
-
* transition gate is removed.
|
|
14
|
-
*/
|
|
15
|
-
export function isExperimentEnabled(experimentName, legacyValue) {
|
|
16
|
-
if (fg('platform_editor_use_new_experiments_api')) {
|
|
17
|
-
return platformIsExperimentEnabled(experimentName);
|
|
18
|
-
}
|
|
19
|
-
return legacyValue();
|
|
20
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @atlaskit/platform/inline-usage -- This temporary strangler intentionally wraps the old and new experiment APIs during migration. */
|
|
2
|
-
|
|
3
|
-
import { UNSAFE_expValNoExposure as platformUnsafeExpValNoExposure } from '@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Temporary strangler for editor experiment reads that intentionally do not fire exposure.
|
|
8
|
-
* The legacy callback is evaluated only while the migration gate is off.
|
|
9
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure` when the
|
|
10
|
-
* transition gate is removed.
|
|
11
|
-
*/
|
|
12
|
-
export function UNSAFE_expValNoExposure(experimentName, param, defaultValue, legacyValue) {
|
|
13
|
-
if (fg('platform_editor_use_new_experiments_api')) {
|
|
14
|
-
return platformUnsafeExpValNoExposure(experimentName, param, defaultValue);
|
|
15
|
-
}
|
|
16
|
-
return legacyValue();
|
|
17
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @atlaskit/platform/inline-usage -- This temporary strangler intentionally wraps the old and new experiment APIs during migration. */
|
|
2
|
-
import { expVal as platformExpVal } from '@atlaskit/platform-feature-experiments/exp-val';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Temporary strangler for migrating editor experiments to
|
|
7
|
-
* `@atlaskit/platform-feature-experiments`.
|
|
8
|
-
*
|
|
9
|
-
* The final callback preserves the existing experiment implementation while the migration gate is
|
|
10
|
-
* off. It is evaluated lazily so only one implementation reads the experiment or fires exposure.
|
|
11
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/exp-val` when the transition gate is
|
|
12
|
-
* removed.
|
|
13
|
-
*/
|
|
14
|
-
export function expVal(experimentName, param, defaultValue, legacyValue) {
|
|
15
|
-
if (fg('platform_editor_use_new_experiments_api')) {
|
|
16
|
-
return platformExpVal(experimentName, param, defaultValue);
|
|
17
|
-
}
|
|
18
|
-
return legacyValue();
|
|
19
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @atlaskit/platform/inline-usage -- This temporary strangler intentionally wraps the old and new experiment APIs during migration. */
|
|
2
|
-
import { isExperimentEnabled as platformIsExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Temporary strangler for boolean editor experiments using the conventional `isEnabled` param.
|
|
7
|
-
* The legacy callback is evaluated only while the migration gate is off.
|
|
8
|
-
*
|
|
9
|
-
* For experiments with multiple product keys, OR one call per unique product key. Pass the real
|
|
10
|
-
* legacy callback only to the first call and `() => false` to the remaining calls so the fallback
|
|
11
|
-
* is evaluated at most once.
|
|
12
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/is-experiment-enabled` when the
|
|
13
|
-
* transition gate is removed.
|
|
14
|
-
*/
|
|
15
|
-
export function isExperimentEnabled(experimentName, legacyValue) {
|
|
16
|
-
if (fg('platform_editor_use_new_experiments_api')) {
|
|
17
|
-
return platformIsExperimentEnabled(experimentName);
|
|
18
|
-
}
|
|
19
|
-
return legacyValue();
|
|
20
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @atlaskit/platform/inline-usage -- This temporary strangler intentionally wraps the old and new experiment APIs during migration. */
|
|
2
|
-
|
|
3
|
-
import { UNSAFE_expValNoExposure as platformUnsafeExpValNoExposure } from '@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Temporary strangler for editor experiment reads that intentionally do not fire exposure.
|
|
8
|
-
* The legacy callback is evaluated only while the migration gate is off.
|
|
9
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure` when the
|
|
10
|
-
* transition gate is removed.
|
|
11
|
-
*/
|
|
12
|
-
export function UNSAFE_expValNoExposure(experimentName, param, defaultValue, legacyValue) {
|
|
13
|
-
if (fg('platform_editor_use_new_experiments_api')) {
|
|
14
|
-
return platformUnsafeExpValNoExposure(experimentName, param, defaultValue);
|
|
15
|
-
}
|
|
16
|
-
return legacyValue();
|
|
17
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { AssurePrimitives } from '@atlaskit/platform-feature-experiments/exp-val';
|
|
2
|
-
/**
|
|
3
|
-
* Temporary strangler for migrating editor experiments to
|
|
4
|
-
* `@atlaskit/platform-feature-experiments`.
|
|
5
|
-
*
|
|
6
|
-
* The final callback preserves the existing experiment implementation while the migration gate is
|
|
7
|
-
* off. It is evaluated lazily so only one implementation reads the experiment or fires exposure.
|
|
8
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/exp-val` when the transition gate is
|
|
9
|
-
* removed.
|
|
10
|
-
*/
|
|
11
|
-
export declare function expVal<T>(experimentName: string, param: string, defaultValue: T extends true ? never : T, legacyValue: () => AssurePrimitives<T>): AssurePrimitives<T>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Temporary strangler for boolean editor experiments using the conventional `isEnabled` param.
|
|
3
|
-
* The legacy callback is evaluated only while the migration gate is off.
|
|
4
|
-
*
|
|
5
|
-
* For experiments with multiple product keys, OR one call per unique product key. Pass the real
|
|
6
|
-
* legacy callback only to the first call and `() => false` to the remaining calls so the fallback
|
|
7
|
-
* is evaluated at most once.
|
|
8
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/is-experiment-enabled` when the
|
|
9
|
-
* transition gate is removed.
|
|
10
|
-
*/
|
|
11
|
-
export declare function isExperimentEnabled(experimentName: string, legacyValue: () => boolean): boolean;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { AssurePrimitives } from '@atlaskit/platform-feature-experiments/exp-val';
|
|
2
|
-
/**
|
|
3
|
-
* Temporary strangler for editor experiment reads that intentionally do not fire exposure.
|
|
4
|
-
* The legacy callback is evaluated only while the migration gate is off.
|
|
5
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure` when the
|
|
6
|
-
* transition gate is removed.
|
|
7
|
-
*/
|
|
8
|
-
export declare function UNSAFE_expValNoExposure<T>(experimentName: string, param: string, defaultValue: T extends true ? never : T, legacyValue: () => AssurePrimitives<T>): AssurePrimitives<T>;
|