@atlaskit/editor-common 116.10.1 → 116.11.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 +45 -0
- package/afm-cc/tsconfig.json +3 -0
- package/afm-products/tsconfig.json +3 -0
- package/dist/cjs/ai-messages/ai-suggestions.js +3 -3
- package/dist/cjs/code-block/index.js +4 -3
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/ai-messages/ai-suggestions.js +3 -3
- package/dist/es2019/code-block/index.js +4 -3
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/ai-messages/ai-suggestions.js +3 -3
- package/dist/esm/code-block/index.js +4 -3
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/ai-messages/ai-suggestions.d.ts +1 -1
- package/dist/types/analytics/types/block-menu-events.d.ts +1 -0
- package/dist/types/analytics/types/general-events.d.ts +1 -0
- package/dist/types/types/markdown-mode-plugin-stub.d.ts +2 -0
- package/dist/types/types/type-ahead.d.ts +49 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 116.11.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`49b8e9a322976`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/49b8e9a322976) -
|
|
8
|
+
Reduce q4 lovability experiment exposure noise in code block setup and bookkeeping paths
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 116.11.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [`b483e293da76f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b483e293da76f) -
|
|
16
|
+
Add a gated `isSuggested` attribute to block menu element transformed analytics events so
|
|
17
|
+
suggested and non-suggested transform selections can be distinguished. The event attribute is
|
|
18
|
+
gated behind the `platform_editor_blocks_patch_2` feature gate.
|
|
19
|
+
- [`dbf22f118dd9e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dbf22f118dd9e) -
|
|
20
|
+
Rewrite Rovo Chat @-mention provider on a single Relay-native RovoChatMentionResource that fires
|
|
21
|
+
people + agents in parallel via Promise. People render as soon as URS resolves and agents pop in
|
|
22
|
+
below when ready. New aliased agentStudio_getAgents query consolidates 3 prefetch round trips into
|
|
23
|
+
1, drops over-fetched fields, and uses real abort plumbing. Adds opt-in subscribeToItemsUpdates
|
|
24
|
+
multi-emit contract to the editor mention typeahead so progressive emissions are no longer dropped
|
|
25
|
+
after the first frame.
|
|
26
|
+
- [`77f3d60237123`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/77f3d60237123) -
|
|
27
|
+
Add a live word count next to the line count in the markdown source view footer
|
|
28
|
+
- [`59f92f7b6fbac`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/59f92f7b6fbac) -
|
|
29
|
+
EDITOR-7095: Use shorter tooltip for padlock
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- [`ee28cf33718b0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ee28cf33718b0) -
|
|
34
|
+
Add @atlassian/react-compiler-gating as a runtime dependency to enable React Compiler platform
|
|
35
|
+
gating.
|
|
36
|
+
- [`64a0b50380570`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/64a0b50380570) - -
|
|
37
|
+
Improve TypeScript auto-detection for class fields and typed arrow function params/return types.
|
|
38
|
+
- Avoid unnecessary code block node updates when auto-detection re-detects the same language.
|
|
39
|
+
- Prevent wrap toggles from scrolling long code blocks to the top.
|
|
40
|
+
- Keep the language picker placement stable while it is open.
|
|
41
|
+
- Reset language picker search state on reopen so recent selections are not reported as search
|
|
42
|
+
selections.
|
|
43
|
+
- Prevent language picker close/selection from scrolling partially visible code blocks while
|
|
44
|
+
restoring editor focus.
|
|
45
|
+
- Add auto-detection analytics metadata to distinguish initial detection from re-detection.
|
|
46
|
+
- Updated dependencies
|
|
47
|
+
|
|
3
48
|
## 116.10.1
|
|
4
49
|
|
|
5
50
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -184,6 +184,9 @@
|
|
|
184
184
|
{
|
|
185
185
|
"path": "../../../design-system/width-detector/afm-cc/tsconfig.json"
|
|
186
186
|
},
|
|
187
|
+
{
|
|
188
|
+
"path": "../../../react-compiler/react-compiler-gating/afm-cc/tsconfig.json"
|
|
189
|
+
},
|
|
187
190
|
{
|
|
188
191
|
"path": "../../../media/media-core/afm-cc/tsconfig.json"
|
|
189
192
|
}
|
|
@@ -184,6 +184,9 @@
|
|
|
184
184
|
{
|
|
185
185
|
"path": "../../../design-system/width-detector/afm-products/tsconfig.json"
|
|
186
186
|
},
|
|
187
|
+
{
|
|
188
|
+
"path": "../../../react-compiler/react-compiler-gating/afm-products/tsconfig.json"
|
|
189
|
+
},
|
|
187
190
|
{
|
|
188
191
|
"path": "../../../media/media-core/afm-products/tsconfig.json"
|
|
189
192
|
}
|
|
@@ -121,9 +121,9 @@ var aiSuggestionsMessages = exports.aiSuggestionsMessages = (0, _reactIntl.defin
|
|
|
121
121
|
defaultMessage: 'Private',
|
|
122
122
|
description: 'Label for the private/lock indicator on the AI suggestions card'
|
|
123
123
|
},
|
|
124
|
-
|
|
125
|
-
id: 'fabric.editor.ai.suggestions.card.
|
|
126
|
-
defaultMessage: '
|
|
124
|
+
cardPrivateTooltipLabelShort: {
|
|
125
|
+
id: 'fabric.editor.ai.suggestions.card.privateTooltipLabelShort.non-final',
|
|
126
|
+
defaultMessage: 'Visible only to you',
|
|
127
127
|
description: 'Tooltip shown on the private indicator icon in the AI suggestions card'
|
|
128
128
|
},
|
|
129
129
|
cardSourcesButtonLabel: {
|
|
@@ -11,6 +11,7 @@ var _adfSchema = require("@atlaskit/adf-schema");
|
|
|
11
11
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
12
12
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
13
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
14
|
+
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
14
15
|
var _slice = require("../utils/slice");
|
|
15
16
|
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; }
|
|
16
17
|
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; } /* eslint-disable @atlaskit/volt-strict-mode/no-multiple-exports */
|
|
@@ -26,7 +27,7 @@ var getDefaultCodeBlockAttrs = exports.getDefaultCodeBlockAttrs = function getDe
|
|
|
26
27
|
var attrsWithLocalId = localId ? _objectSpread(_objectSpread({}, attrs), {}, {
|
|
27
28
|
localId: localId
|
|
28
29
|
}) : attrs;
|
|
29
|
-
if (!(0,
|
|
30
|
+
if (!(0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
|
|
30
31
|
return attrsWithLocalId;
|
|
31
32
|
}
|
|
32
33
|
|
|
@@ -130,14 +131,14 @@ var getInsertedCodeBlocksInTransaction = exports.getInsertedCodeBlocksInTransact
|
|
|
130
131
|
|
|
131
132
|
var codeBlockFoldStates = new WeakMap();
|
|
132
133
|
var isCodeBlockWordWrapEnabled = exports.isCodeBlockWordWrapEnabled = function isCodeBlockWordWrapEnabled(codeBlockNode) {
|
|
133
|
-
if ((0,
|
|
134
|
+
if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
|
|
134
135
|
return Boolean(codeBlockNode.attrs.wrap);
|
|
135
136
|
}
|
|
136
137
|
var currentNodeWordWrapState = codeBlockWrappedStates.get(codeBlockNode);
|
|
137
138
|
return currentNodeWordWrapState !== undefined ? currentNodeWordWrapState : defaultWordWrapState;
|
|
138
139
|
};
|
|
139
140
|
var areCodeBlockLineNumbersHidden = exports.areCodeBlockLineNumbersHidden = function areCodeBlockLineNumbersHidden(codeBlockNode) {
|
|
140
|
-
if (!(0,
|
|
141
|
+
if (!(0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
|
|
141
142
|
return false;
|
|
142
143
|
}
|
|
143
144
|
return Boolean(codeBlockNode.attrs.hideLineNumbers);
|
|
@@ -28,7 +28,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
28
28
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
29
29
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
30
30
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
31
|
-
var packageVersion = "116.
|
|
31
|
+
var packageVersion = "116.11.0";
|
|
32
32
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
33
33
|
// Remove URL as it has UGC
|
|
34
34
|
// 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 = "116.
|
|
27
|
+
var packageVersion = "116.11.0";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -115,9 +115,9 @@ export const aiSuggestionsMessages = defineMessages({
|
|
|
115
115
|
defaultMessage: 'Private',
|
|
116
116
|
description: 'Label for the private/lock indicator on the AI suggestions card'
|
|
117
117
|
},
|
|
118
|
-
|
|
119
|
-
id: 'fabric.editor.ai.suggestions.card.
|
|
120
|
-
defaultMessage: '
|
|
118
|
+
cardPrivateTooltipLabelShort: {
|
|
119
|
+
id: 'fabric.editor.ai.suggestions.card.privateTooltipLabelShort.non-final',
|
|
120
|
+
defaultMessage: 'Visible only to you',
|
|
121
121
|
description: 'Tooltip shown on the private indicator icon in the AI suggestions card'
|
|
122
122
|
},
|
|
123
123
|
cardSourcesButtonLabel: {
|
|
@@ -3,6 +3,7 @@ import { uuid } from '@atlaskit/adf-schema';
|
|
|
3
3
|
import { ReplaceAroundStep, ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
4
4
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
5
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
6
7
|
import { mapSlice } from '../utils/slice';
|
|
7
8
|
export const defaultWordWrapState = false;
|
|
8
9
|
|
|
@@ -17,7 +18,7 @@ export const getDefaultCodeBlockAttrs = attrs => {
|
|
|
17
18
|
...attrs,
|
|
18
19
|
localId
|
|
19
20
|
} : attrs;
|
|
20
|
-
if (!
|
|
21
|
+
if (!expValEqualsNoExposure('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
|
|
21
22
|
return attrsWithLocalId;
|
|
22
23
|
}
|
|
23
24
|
|
|
@@ -114,14 +115,14 @@ export const getInsertedCodeBlocksInTransaction = (tr, codeBlockType, options =
|
|
|
114
115
|
|
|
115
116
|
const codeBlockFoldStates = new WeakMap();
|
|
116
117
|
export const isCodeBlockWordWrapEnabled = codeBlockNode => {
|
|
117
|
-
if (
|
|
118
|
+
if (expValEqualsNoExposure('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
|
|
118
119
|
return Boolean(codeBlockNode.attrs.wrap);
|
|
119
120
|
}
|
|
120
121
|
const currentNodeWordWrapState = codeBlockWrappedStates.get(codeBlockNode);
|
|
121
122
|
return currentNodeWordWrapState !== undefined ? currentNodeWordWrapState : defaultWordWrapState;
|
|
122
123
|
};
|
|
123
124
|
export const areCodeBlockLineNumbersHidden = codeBlockNode => {
|
|
124
|
-
if (!
|
|
125
|
+
if (!expValEqualsNoExposure('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
|
|
125
126
|
return false;
|
|
126
127
|
}
|
|
127
128
|
return Boolean(codeBlockNode.attrs.hideLineNumbers);
|
|
@@ -14,7 +14,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
14
14
|
const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
15
15
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
16
16
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
17
|
-
const packageVersion = "116.
|
|
17
|
+
const packageVersion = "116.11.0";
|
|
18
18
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
19
19
|
// Remove URL as it has UGC
|
|
20
20
|
// Ignored via go/ees007
|
|
@@ -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 = "116.
|
|
17
|
+
const packageVersion = "116.11.0";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -115,9 +115,9 @@ export var aiSuggestionsMessages = defineMessages({
|
|
|
115
115
|
defaultMessage: 'Private',
|
|
116
116
|
description: 'Label for the private/lock indicator on the AI suggestions card'
|
|
117
117
|
},
|
|
118
|
-
|
|
119
|
-
id: 'fabric.editor.ai.suggestions.card.
|
|
120
|
-
defaultMessage: '
|
|
118
|
+
cardPrivateTooltipLabelShort: {
|
|
119
|
+
id: 'fabric.editor.ai.suggestions.card.privateTooltipLabelShort.non-final',
|
|
120
|
+
defaultMessage: 'Visible only to you',
|
|
121
121
|
description: 'Tooltip shown on the private indicator icon in the AI suggestions card'
|
|
122
122
|
},
|
|
123
123
|
cardSourcesButtonLabel: {
|
|
@@ -7,6 +7,7 @@ import { uuid } from '@atlaskit/adf-schema';
|
|
|
7
7
|
import { ReplaceAroundStep, ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
9
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
10
11
|
import { mapSlice } from '../utils/slice';
|
|
11
12
|
export var defaultWordWrapState = false;
|
|
12
13
|
|
|
@@ -20,7 +21,7 @@ export var getDefaultCodeBlockAttrs = function getDefaultCodeBlockAttrs(attrs) {
|
|
|
20
21
|
var attrsWithLocalId = localId ? _objectSpread(_objectSpread({}, attrs), {}, {
|
|
21
22
|
localId: localId
|
|
22
23
|
}) : attrs;
|
|
23
|
-
if (!
|
|
24
|
+
if (!expValEqualsNoExposure('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
|
|
24
25
|
return attrsWithLocalId;
|
|
25
26
|
}
|
|
26
27
|
|
|
@@ -124,14 +125,14 @@ export var getInsertedCodeBlocksInTransaction = function getInsertedCodeBlocksIn
|
|
|
124
125
|
|
|
125
126
|
var codeBlockFoldStates = new WeakMap();
|
|
126
127
|
export var isCodeBlockWordWrapEnabled = function isCodeBlockWordWrapEnabled(codeBlockNode) {
|
|
127
|
-
if (
|
|
128
|
+
if (expValEqualsNoExposure('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
|
|
128
129
|
return Boolean(codeBlockNode.attrs.wrap);
|
|
129
130
|
}
|
|
130
131
|
var currentNodeWordWrapState = codeBlockWrappedStates.get(codeBlockNode);
|
|
131
132
|
return currentNodeWordWrapState !== undefined ? currentNodeWordWrapState : defaultWordWrapState;
|
|
132
133
|
};
|
|
133
134
|
export var areCodeBlockLineNumbersHidden = function areCodeBlockLineNumbersHidden(codeBlockNode) {
|
|
134
|
-
if (!
|
|
135
|
+
if (!expValEqualsNoExposure('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
|
|
135
136
|
return false;
|
|
136
137
|
}
|
|
137
138
|
return Boolean(codeBlockNode.attrs.hideLineNumbers);
|
|
@@ -20,7 +20,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
20
20
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
21
21
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
22
22
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
23
|
-
var packageVersion = "116.
|
|
23
|
+
var packageVersion = "116.11.0";
|
|
24
24
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
25
25
|
// Remove URL as it has UGC
|
|
26
26
|
// Ignored via go/ees007
|
|
@@ -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 = "116.
|
|
24
|
+
var packageVersion = "116.11.0";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -174,6 +174,7 @@ type CodeBlockLanguageSelectedAEP = TrackAEP<ACTION.LANGUAGE_SELECTED, ACTION_SU
|
|
|
174
174
|
selectionSource?: 'all' | 'pinned' | 'recentlyUsed' | 'search';
|
|
175
175
|
}, undefined>;
|
|
176
176
|
type CodeBlockLanguageAutoDetectedAEP = TrackAEP<ACTION.LANGUAGE_AUTO_DETECTED, ACTION_SUBJECT.CODE_BLOCK, undefined, {
|
|
177
|
+
detectionPhase?: 'initial' | 'redetection';
|
|
177
178
|
detectionResult: 'detected' | 'noneDetected';
|
|
178
179
|
language: string;
|
|
179
180
|
}, undefined>;
|
|
@@ -23,6 +23,7 @@ export type _MarkdownModePluginStateStub = {
|
|
|
23
23
|
columnNumber: number;
|
|
24
24
|
lineCount: number;
|
|
25
25
|
lineNumber: number;
|
|
26
|
+
wordCount?: number;
|
|
26
27
|
} | null;
|
|
27
28
|
view: 'syntax' | 'split-view' | 'preview';
|
|
28
29
|
wrapSourceCode: boolean;
|
|
@@ -59,6 +60,7 @@ export type _MarkdownModePluginStub = NextEditorPlugin<'markdownMode', {
|
|
|
59
60
|
columnNumber: number;
|
|
60
61
|
lineCount: number;
|
|
61
62
|
lineNumber: number;
|
|
63
|
+
wordCount?: number;
|
|
62
64
|
} | null) => void;
|
|
63
65
|
setView: (view: 'syntax' | 'split-view' | 'preview') => void;
|
|
64
66
|
setWrapSourceCode: (wrapSourceCode: boolean) => void;
|
|
@@ -75,6 +75,33 @@ export type TypeAheadSectionTitleUpdate = {
|
|
|
75
75
|
title: string;
|
|
76
76
|
};
|
|
77
77
|
export type TypeAheadForceSelect = (props: TypeAheadForceSelectProps) => TypeAheadItem | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Multi-emit contract returned by `TypeAheadHandler.subscribeToItemsUpdates`.
|
|
80
|
+
*
|
|
81
|
+
* The runtime awaits `initial` to render the dropdown's first frame,
|
|
82
|
+
* then re-renders with whatever each `subscribe` callback delivers
|
|
83
|
+
* thereafter. The returned unsubscribe function is called when the
|
|
84
|
+
* query changes or the component unmounts.
|
|
85
|
+
*/
|
|
86
|
+
export type TypeAheadItemsUpdate = {
|
|
87
|
+
initial: Promise<Array<TypeAheadItem>>;
|
|
88
|
+
/**
|
|
89
|
+
* Subscribe to incremental updates from this `TypeAheadItemsUpdate`.
|
|
90
|
+
*
|
|
91
|
+
* **Single-subscriber contract.** Implementations are NOT required
|
|
92
|
+
* to support multiple concurrent subscribers; calling `subscribe`
|
|
93
|
+
* twice on the same instance may silently overwrite the first
|
|
94
|
+
* callback. The runtime calls this once per filter cycle, and a
|
|
95
|
+
* fresh `TypeAheadItemsUpdate` is produced by
|
|
96
|
+
* `subscribeToItemsUpdates` for every query, so fan-out is never
|
|
97
|
+
* needed in practice.
|
|
98
|
+
*
|
|
99
|
+
* The returned function unsubscribes the callback and releases any
|
|
100
|
+
* underlying transport. The runtime calls it on query change or
|
|
101
|
+
* component unmount.
|
|
102
|
+
*/
|
|
103
|
+
subscribe: (update: (items: Array<TypeAheadItem>) => void) => () => void;
|
|
104
|
+
};
|
|
78
105
|
export type MoreOptionsButtonConfig = {
|
|
79
106
|
ariaLabel?: string;
|
|
80
107
|
iconBefore?: ReactNode;
|
|
@@ -119,6 +146,28 @@ export type TypeAheadHandler = {
|
|
|
119
146
|
onOpen?: (editorState: EditorState) => void;
|
|
120
147
|
/** Handler returns a transaction which inserts the TypeAheadItem into the doc */
|
|
121
148
|
selectItem: TypeAheadSelectItem;
|
|
149
|
+
/**
|
|
150
|
+
* Optional opt-in to multi-emit. When implemented, the type-ahead
|
|
151
|
+
* runtime calls this INSTEAD of `getItems` and renders the dropdown
|
|
152
|
+
* progressively as updates arrive.
|
|
153
|
+
*
|
|
154
|
+
* Returns:
|
|
155
|
+
* - `initial`: a Promise that resolves with the first set of items
|
|
156
|
+
* to show. Replaces the single-shot `getItems` Promise.
|
|
157
|
+
* - `subscribe(update)`: registers a callback that fires with a
|
|
158
|
+
* fresh items array whenever the underlying provider has more
|
|
159
|
+
* results (for example: "people first, then merged people +
|
|
160
|
+
* agents" for the Rovo Chat mention provider). Returns an
|
|
161
|
+
* unsubscribe function that the runtime calls on query change
|
|
162
|
+
* or component unmount.
|
|
163
|
+
*
|
|
164
|
+
* Existing handlers using only `getItems` continue to work
|
|
165
|
+
* unchanged. This field is purely additive.
|
|
166
|
+
*/
|
|
167
|
+
subscribeToItemsUpdates?: (props: {
|
|
168
|
+
editorState: EditorState;
|
|
169
|
+
query: string;
|
|
170
|
+
}) => TypeAheadItemsUpdate;
|
|
122
171
|
/** Pattern that will trigger the TypeAhead */
|
|
123
172
|
trigger: string;
|
|
124
173
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "116.
|
|
3
|
+
"version": "116.11.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/"
|
|
@@ -73,16 +73,17 @@
|
|
|
73
73
|
"@atlaskit/prosemirror-history": "^1.0.0",
|
|
74
74
|
"@atlaskit/react-ufo": "^7.1.0",
|
|
75
75
|
"@atlaskit/section-message": "^9.1.0",
|
|
76
|
-
"@atlaskit/smart-card": "^45.
|
|
76
|
+
"@atlaskit/smart-card": "^45.3.0",
|
|
77
77
|
"@atlaskit/smart-user-picker": "^11.0.0",
|
|
78
78
|
"@atlaskit/spinner": "^20.0.0",
|
|
79
79
|
"@atlaskit/task-decision": "^21.2.0",
|
|
80
80
|
"@atlaskit/teams-app-config": "^2.0.0",
|
|
81
81
|
"@atlaskit/textfield": "^9.0.0",
|
|
82
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
83
|
-
"@atlaskit/tokens": "^
|
|
82
|
+
"@atlaskit/tmp-editor-statsig": "^111.0.0",
|
|
83
|
+
"@atlaskit/tokens": "^15.0.0",
|
|
84
84
|
"@atlaskit/tooltip": "^23.0.0",
|
|
85
85
|
"@atlaskit/width-detector": "^6.0.0",
|
|
86
|
+
"@atlassian/react-compiler-gating": "^0.2.0",
|
|
86
87
|
"@babel/runtime": "^7.0.0",
|
|
87
88
|
"@compiled/react": "^0.20.0",
|
|
88
89
|
"@emotion/react": "^11.7.1",
|
|
@@ -121,7 +122,6 @@
|
|
|
121
122
|
"devDependencies": {
|
|
122
123
|
"@atlaskit/media-core": "^38.0.0",
|
|
123
124
|
"@atlassian/a11y-jest-testing": "^0.12.0",
|
|
124
|
-
"@atlassian/react-compiler-gating": "workspace:^",
|
|
125
125
|
"@testing-library/dom": "^10.1.0",
|
|
126
126
|
"@testing-library/jest-dom": "^6.4.5",
|
|
127
127
|
"@testing-library/react": "^16.3.0",
|