@atlaskit/editor-plugin-autocomplete 9.1.0 → 9.2.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 +115 -0
- package/dist/cjs/analytics/ufo.js +6 -5
- package/dist/cjs/pm-plugins/autocomplete-plugin.js +496 -50
- package/dist/cjs/pm-plugins/debug-mode.js +14 -3
- package/dist/cjs/pm-plugins/inline-code-harvester.js +576 -0
- package/dist/cjs/pm-plugins/text-predictor.js +298 -151
- package/dist/es2019/analytics/ufo.js +2 -1
- package/dist/es2019/pm-plugins/autocomplete-plugin.js +457 -36
- package/dist/es2019/pm-plugins/debug-mode.js +13 -2
- package/dist/es2019/pm-plugins/inline-code-harvester.js +455 -0
- package/dist/es2019/pm-plugins/text-predictor.js +136 -4
- package/dist/esm/analytics/ufo.js +2 -1
- package/dist/esm/pm-plugins/autocomplete-plugin.js +494 -50
- package/dist/esm/pm-plugins/debug-mode.js +13 -2
- package/dist/esm/pm-plugins/inline-code-harvester.js +572 -0
- package/dist/esm/pm-plugins/text-predictor.js +297 -150
- package/dist/types/analytics/ufo.d.ts +1 -1
- package/dist/types/pm-plugins/autocomplete-plugin.d.ts +37 -0
- package/dist/types/pm-plugins/debug-mode.d.ts +19 -4
- package/dist/types/pm-plugins/inline-code-harvester.d.ts +146 -0
- package/dist/types/pm-plugins/text-predictor.d.ts +70 -3
- package/package.json +2 -2
- package/src/analytics/ufo.ts +3 -6
- package/src/pm-plugins/autocomplete-plugin.ts +526 -31
- package/src/pm-plugins/debug-mode.ts +26 -5
- package/src/pm-plugins/inline-code-harvester.ts +561 -0
- package/src/pm-plugins/text-predictor.ts +162 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,120 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-autocomplete
|
|
2
2
|
|
|
3
|
+
## 9.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`656801b9e097c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/656801b9e097c) -
|
|
8
|
+
VOLTC-331 - Migrate updated package usage in platform/editor: rewrite barrel imports of
|
|
9
|
+
voltCompliant provider packages to deep/subpath imports (consumer-side debarrel). No public API
|
|
10
|
+
changes.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 9.2.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- [`027dc05ee4e0d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/027dc05ee4e0d) -
|
|
18
|
+
Suggest inline-code identifiers the session has seen, for hosts that opt in with the new
|
|
19
|
+
`harvestInlineCode` plugin option — which Rovo Chat now does.
|
|
20
|
+
|
|
21
|
+
A term like `ml-studio` cannot be suggested today whatever the session does with it:
|
|
22
|
+
`incrementSessionFreq` only touches trie nodes that already exist, so a word the shipped
|
|
23
|
+
vocabulary does not hold is silently discarded. The new harvester collects backticked spans from
|
|
24
|
+
ingested reply and page text and code-marked spans from the live document, drops anything with
|
|
25
|
+
internal whitespace, over 50 characters, not starting with a letter, or already served by L2/L3,
|
|
26
|
+
and holds the result to 200 surfaces with the least-mentioned evicted first.
|
|
27
|
+
|
|
28
|
+
A harvested surface has no frequency, no vector and no canonical token ids, so what stands in for
|
|
29
|
+
a score is where it is allowed to speak. It is offered only where the scored path has finished and
|
|
30
|
+
recorded that no vocabulary reaches the prefix at all — not when the 100ms budget expires, since
|
|
31
|
+
that means the ranker was still working. It asks for four typed characters rather than three,
|
|
32
|
+
respects the post-accept cooldown and the no-repeat check, and on accept rewrites the typed prefix
|
|
33
|
+
in the surface's own casing and marks it as code, because casing is load-bearing in code and being
|
|
34
|
+
marked as code is what authorized the suggestion. The stored mark is dropped straight after, since
|
|
35
|
+
the backtick input rule never ran and nothing else would close the span. It reports itself as a
|
|
36
|
+
new `harvest` value on `CompletionSource`, so its views and acceptances cannot move the headline
|
|
37
|
+
rate unattributed.
|
|
38
|
+
|
|
39
|
+
The harvester is a separate chunk, requested on first focus and only for a host that opted in, so
|
|
40
|
+
a host that has not stays exactly as it was and never downloads it. What it holds is readable at
|
|
41
|
+
any time with `__atlCtcDebug__.harvest()`, or `__atlCtcDebug__.harvest('ml-s')` to ask what a
|
|
42
|
+
prefix would be offered.
|
|
43
|
+
|
|
44
|
+
Both the harvested set and the L1 session boosts are now dropped when the session they describe
|
|
45
|
+
ends. A host whose editor does not last as long as what it is writing about can say so with the
|
|
46
|
+
new `contextScopeKey` on the context it returns: when the key changes, both stores are emptied and
|
|
47
|
+
the context reported with the new key is ingested as if it were the first, so anything still
|
|
48
|
+
current is primed again. The key is tracked beside the data it guards rather than per editor,
|
|
49
|
+
because a host may answer a navigation by replacing the editor instead of keeping it — read from a
|
|
50
|
+
new editor alone, every scope looks like the first one, while the previous scope's terms carry on
|
|
51
|
+
in the state they share. Teardown clears both stores as well, once the last editor has gone:
|
|
52
|
+
Confluence mounts several, and closing one reply must not wipe what the others primed.
|
|
53
|
+
`resetSessionBoosts` is exported for the same purpose, and `__atlCtcDebug__.session()` now lists
|
|
54
|
+
100 boosted words rather than 50.
|
|
55
|
+
|
|
56
|
+
Because those stores are shared, an editor that reported no scope is put back in the same tick an
|
|
57
|
+
eviction empties them, from the context it is already holding rather than a second read. A comment
|
|
58
|
+
box under a chat panel that switched conversation never asked to lose its page, and without this
|
|
59
|
+
it could not get it back either: the record of what an editor has ingested is per editor, so its
|
|
60
|
+
own page would read as already seen from then on. An editor that did report a scope is left alone,
|
|
61
|
+
since the scope being dropped may be its own — a page transition mounts the editor arriving before
|
|
62
|
+
tearing down the one leaving.
|
|
63
|
+
|
|
64
|
+
A context read requested while another is still open is now deferred until that one settles, where
|
|
65
|
+
before it was dropped. A scope change reaches the plugin as a context read, and a host that pushes
|
|
66
|
+
its context has no other channel to raise one on, so a read refused mid-navigation was an eviction
|
|
67
|
+
that never happened.
|
|
68
|
+
|
|
69
|
+
On the Rovo Chat side, chat messages now reach autocomplete through `extractCodeAwareTextFromAdf`,
|
|
70
|
+
the same extractor the page already uses. Assistant replies keep their backticks by arriving as
|
|
71
|
+
markdown, but a user's own inline code arrives as ADF and was being flattened by
|
|
72
|
+
`extractPlainTextFromAdf`, which drops the `code` mark — the only thing distinguishing an
|
|
73
|
+
identifier from a word. The L1 boost is unaffected, since its tokenizer strips backticks as
|
|
74
|
+
boundary punctuation. Each context read is stamped with the conversation and the page the body in
|
|
75
|
+
it came from, and the stamp is reported even when there is nothing else to report: arriving at an
|
|
76
|
+
empty new chat is exactly when the previous one's terms most need dropping.
|
|
77
|
+
|
|
78
|
+
The page in that stamp is taken from the body rather than from where the host says the reader is,
|
|
79
|
+
and a host that publishes the page it is on has its empty answer read as "no page" rather than as
|
|
80
|
+
no answer. Confluence in-app navigation is why: it clears the page it was holding immediately, but
|
|
81
|
+
the content id the chat reads can lag it by a long way and sometimes never arrives, and a body
|
|
82
|
+
accepted only when the two agree is a page that is never read at all. Attributing a body to the
|
|
83
|
+
page it came from cannot offer one page's text under another's, which is what agreement was being
|
|
84
|
+
required for.
|
|
85
|
+
|
|
86
|
+
A body published by an editor is no longer attributed to a page it was already attributed
|
|
87
|
+
elsewhere for. The published document carries no page id, so the page has to come from where the
|
|
88
|
+
reader is, and that is the same answer whether the editor has just published or the store is still
|
|
89
|
+
holding the document from the page before. Two live docs in a row is where it showed: arriving at
|
|
90
|
+
the second turns editor publishing back on and asks again, while the first one's body is the only
|
|
91
|
+
one there is.
|
|
92
|
+
|
|
93
|
+
Dropping the boosts when the last editor goes is limited to hosts that scope their context, which
|
|
94
|
+
are the ones asking for their learning to end with the conversation. A host that sends no scope
|
|
95
|
+
has boosts belonging to the page it is on, and a comment box closes far more often than that page
|
|
96
|
+
changes.
|
|
97
|
+
|
|
98
|
+
A host that cannot answer a page read now reports it, once per chat input, as an operational
|
|
99
|
+
event. The read still succeeds without a page, which is the right thing for a keystroke to do and
|
|
100
|
+
also the reason the failure is otherwise invisible: the editor's own monitoring only sees reads
|
|
101
|
+
that reject, and the symptom of this one — no page context on viewed pages — looks the same as a
|
|
102
|
+
page with nothing worth learning in it.
|
|
103
|
+
|
|
104
|
+
Dropping the session boosts now reads an index of the nodes that were boosted rather than walking
|
|
105
|
+
the whole word trie for them, since it runs on every page change rather than only at teardown:
|
|
106
|
+
about 10ms of main thread on a large tenant vocabulary, twice per navigation, for a few hundred
|
|
107
|
+
words.
|
|
108
|
+
|
|
109
|
+
Both the option and the extraction carry the same
|
|
110
|
+
`platform_editor_ai_autocomplete_rovo_chat_editor` decision the rest of the chat's autocomplete
|
|
111
|
+
wiring does. With the experiment off no context is collected and the harvester chunk is never
|
|
112
|
+
requested.
|
|
113
|
+
|
|
114
|
+
### Patch Changes
|
|
115
|
+
|
|
116
|
+
- Updated dependencies
|
|
117
|
+
|
|
3
118
|
## 9.1.0
|
|
4
119
|
|
|
5
120
|
### Minor Changes
|
|
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.succeedExp = exports.startExp = exports.failExp = exports.abortExp = exports.EXPERIENCE_NAME = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var
|
|
9
|
+
var _concurrentExperience = require("@atlaskit/ufo/concurrent-experience");
|
|
10
|
+
var _experienceTypes = require("@atlaskit/ufo/experience-types");
|
|
10
11
|
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; }
|
|
11
12
|
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; } /**
|
|
12
13
|
* UFO experience tracking helpers for `@atlaskit/editor-plugin-autocomplete`.
|
|
@@ -50,15 +51,15 @@ var operationConfig = {
|
|
|
50
51
|
platform: {
|
|
51
52
|
component: 'editor-plugin-autocomplete'
|
|
52
53
|
},
|
|
53
|
-
type:
|
|
54
|
-
performanceType:
|
|
54
|
+
type: _experienceTypes.ExperienceTypes.Operation,
|
|
55
|
+
performanceType: _experienceTypes.ExperiencePerformanceTypes.Custom,
|
|
55
56
|
performanceConfig: {
|
|
56
|
-
histogram: (0, _defineProperty2.default)({},
|
|
57
|
+
histogram: (0, _defineProperty2.default)({}, _experienceTypes.ExperiencePerformanceTypes.Custom, {
|
|
57
58
|
duration: '50_100_250_500_1000_2000_4000'
|
|
58
59
|
})
|
|
59
60
|
}
|
|
60
61
|
};
|
|
61
|
-
var experiences = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, EXPERIENCE_NAME.SLOW_LANE_FETCH, new
|
|
62
|
+
var experiences = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, EXPERIENCE_NAME.SLOW_LANE_FETCH, new _concurrentExperience.ConcurrentExperience(EXPERIENCE_NAME.SLOW_LANE_FETCH, operationConfig)), EXPERIENCE_NAME.LOAD_VOCABULARY, new _concurrentExperience.ConcurrentExperience(EXPERIENCE_NAME.LOAD_VOCABULARY, operationConfig)), EXPERIENCE_NAME.LOAD_VECTORS, new _concurrentExperience.ConcurrentExperience(EXPERIENCE_NAME.LOAD_VECTORS, operationConfig)), EXPERIENCE_NAME.LOAD_PHRASES, new _concurrentExperience.ConcurrentExperience(EXPERIENCE_NAME.LOAD_PHRASES, operationConfig)), EXPERIENCE_NAME.LOAD_GRAMMAR, new _concurrentExperience.ConcurrentExperience(EXPERIENCE_NAME.LOAD_GRAMMAR, operationConfig));
|
|
62
63
|
var startExp = exports.startExp = function startExp(name, id, metadata) {
|
|
63
64
|
if (!isUfoEnabled()) {
|
|
64
65
|
return;
|