@atlaskit/editor-common 112.12.1 → 112.13.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 +18 -0
- package/dist/cjs/ai-messages/ai-autocomplete.js +30 -0
- package/dist/cjs/ai-messages/index.js +8 -1
- package/dist/cjs/lists/block-mark.js +73 -0
- package/dist/cjs/lists/index.js +31 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/ai-messages/ai-autocomplete.js +25 -0
- package/dist/es2019/ai-messages/index.js +2 -1
- package/dist/es2019/lists/block-mark.js +67 -0
- package/dist/es2019/lists/index.js +1 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/ai-messages/ai-autocomplete.js +25 -0
- package/dist/esm/ai-messages/index.js +2 -1
- package/dist/esm/lists/block-mark.js +67 -0
- package/dist/esm/lists/index.js +1 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/ai-messages/ai-autocomplete.d.ts +22 -0
- package/dist/types/ai-messages/index.d.ts +1 -0
- package/dist/types/lists/block-mark.d.ts +9 -0
- package/dist/types/lists/index.d.ts +1 -0
- package/dist/types-ts4.5/ai-messages/ai-autocomplete.d.ts +22 -0
- package/dist/types-ts4.5/ai-messages/index.d.ts +1 -0
- package/dist/types-ts4.5/lists/block-mark.d.ts +9 -0
- package/dist/types-ts4.5/lists/index.d.ts +1 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 112.13.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`9571b24edc635`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9571b24edc635) -
|
|
8
|
+
Add i18n messages for trigger keywords
|
|
9
|
+
|
|
10
|
+
## 112.13.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [`b749ce678d575`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b749ce678d575) -
|
|
15
|
+
Preserve small text formatting across list and task list edits
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 112.12.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.aiAutocompleteMessages = void 0;
|
|
7
|
+
var _reactIntlNext = require("react-intl-next");
|
|
8
|
+
/**
|
|
9
|
+
* Default keyword lists omit longer phrases when a shorter phrase in the same list already
|
|
10
|
+
* matches as a whole word within them (case-insensitive), e.g. drop `in summary` when `summary`
|
|
11
|
+
* is present.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
var aiAutocompleteMessages = exports.aiAutocompleteMessages = (0, _reactIntlNext.defineMessages)({
|
|
15
|
+
summaryKeywords: {
|
|
16
|
+
id: 'fabric.editor.ai.autocomplete.summary.trigger.keywords.non-final',
|
|
17
|
+
defaultMessage: 'summary, tldr, tl;dr, tl dr, overview, synopsis, recap, abstract, brief, outline, quick, in short, rundown, review, roundup, highlights, key points, snapshot, at a glance, in essence, takeaways, to summarize, to summarise',
|
|
18
|
+
description: 'Comma-separated heading phrases that trigger AI autocomplete when the user finishes typing one as a whole token at the cursor. Translators may reorder or localize phrases; keep comma separation.'
|
|
19
|
+
},
|
|
20
|
+
conclusionKeywords: {
|
|
21
|
+
id: 'fabric.editor.ai.autocomplete.conclusion.trigger.keywords.non-final',
|
|
22
|
+
defaultMessage: 'conclusion, conclusions, findings, results, outcome, outcomes, final thoughts, takeaway, takeaways, verdict, determination, resolution, final analysis, deduction, judgment, decision, culmination, end result, bottom line, final word, closing, to conclude, final notes, learnings, what we learned, overall',
|
|
23
|
+
description: 'Comma-separated phrases that trigger AI autocomplete for a conclusion-style completion when typed in the last lines of the document. Translators may reorder or localize; keep comma separation.'
|
|
24
|
+
},
|
|
25
|
+
nextStepsKeywords: {
|
|
26
|
+
id: 'fabric.editor.ai.autocomplete.next.steps.trigger.keywords.non-final',
|
|
27
|
+
defaultMessage: "recommendations, follow-through, implementation, moving forward, going forward, deliverables, path forward, what is next, way forward, what's next, next steps, priorities, whats next, task list, follow-up, follow up, next step, followup, priority, next up, up next, roadmap, actions, action, tasks, todos, to do, to-do, todo, plan",
|
|
28
|
+
description: 'Comma-separated phrases that trigger AI autocomplete for a next-steps-style completion when typed in the last lines of the document. Translators may reorder or localize; keep comma separation. Prefer longer phrases before shorter ones that are suffixes.'
|
|
29
|
+
}
|
|
30
|
+
});
|
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "aiAutocompleteMessages", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _aiAutocomplete.aiAutocompleteMessages;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
6
12
|
Object.defineProperty(exports, "aiConfigItemMessages", {
|
|
7
13
|
enumerable: true,
|
|
8
14
|
get: function get() {
|
|
@@ -79,4 +85,5 @@ var _ai = require("./ai");
|
|
|
79
85
|
var _aiProactiveSetting = require("./ai-proactive-setting");
|
|
80
86
|
var _aiProactiveTransform = require("./ai-proactive-transform");
|
|
81
87
|
var _aiQuickPrompt = require("./ai-quick-prompt");
|
|
82
|
-
var _aiSuggestions = require("./ai-suggestions");
|
|
88
|
+
var _aiSuggestions = require("./ai-suggestions");
|
|
89
|
+
var _aiAutocomplete = require("./ai-autocomplete");
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.reconcileBlockMarkInRange = exports.reconcileBlockMarkForParagraphAtPos = exports.reconcileBlockMarkForContainerAtPos = exports.getFirstParagraphBlockMarkAttrs = exports.getBlockMarkAttrs = void 0;
|
|
7
|
+
var _commands = require("../commands");
|
|
8
|
+
var getDefaultBlockNodeTypes = function getDefaultBlockNodeTypes(tr) {
|
|
9
|
+
var paragraph = tr.doc.type.schema.nodes.paragraph;
|
|
10
|
+
return paragraph ? [paragraph] : [];
|
|
11
|
+
};
|
|
12
|
+
var getBlockMarkAttrs = exports.getBlockMarkAttrs = function getBlockMarkAttrs(node, markType) {
|
|
13
|
+
if (!node || !markType) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
var blockMark = node.marks.find(function (mark) {
|
|
17
|
+
return mark.type === markType;
|
|
18
|
+
});
|
|
19
|
+
return blockMark ? blockMark.attrs : false;
|
|
20
|
+
};
|
|
21
|
+
var getFirstParagraphBlockMarkAttrs = exports.getFirstParagraphBlockMarkAttrs = function getFirstParagraphBlockMarkAttrs(node, markType) {
|
|
22
|
+
if (!node || !markType) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
var paragraph = node.type.schema.nodes.paragraph;
|
|
26
|
+
if (!paragraph) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
var _findFirstParagraphBlockMarkAttrs = function findFirstParagraphBlockMarkAttrs(currentNode) {
|
|
30
|
+
if (currentNode.type === paragraph) {
|
|
31
|
+
return getBlockMarkAttrs(currentNode, markType);
|
|
32
|
+
}
|
|
33
|
+
for (var index = 0; index < currentNode.childCount; index++) {
|
|
34
|
+
var childResult = _findFirstParagraphBlockMarkAttrs(currentNode.child(index));
|
|
35
|
+
if (childResult !== false) {
|
|
36
|
+
return childResult;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return false;
|
|
40
|
+
};
|
|
41
|
+
return _findFirstParagraphBlockMarkAttrs(node);
|
|
42
|
+
};
|
|
43
|
+
var reconcileBlockMarkInRange = exports.reconcileBlockMarkInRange = function reconcileBlockMarkInRange(tr, from, to, markType, markAttrs) {
|
|
44
|
+
var blockNodeTypes = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : getDefaultBlockNodeTypes(tr);
|
|
45
|
+
if (!markType || blockNodeTypes.length === 0) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
return (0, _commands.createToggleBlockMarkOnRangeNext)(markType, function () {
|
|
49
|
+
return markAttrs;
|
|
50
|
+
}, blockNodeTypes)(from, to, tr);
|
|
51
|
+
};
|
|
52
|
+
var reconcileBlockMarkForContainerAtPos = exports.reconcileBlockMarkForContainerAtPos = function reconcileBlockMarkForContainerAtPos(tr, containerPos, markType, markAttrs) {
|
|
53
|
+
var blockNodeTypes = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : getDefaultBlockNodeTypes(tr);
|
|
54
|
+
var containerNode = tr.doc.nodeAt(containerPos);
|
|
55
|
+
if (!containerNode) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
return reconcileBlockMarkInRange(tr, containerPos, containerPos + containerNode.nodeSize, markType, markAttrs, blockNodeTypes);
|
|
59
|
+
};
|
|
60
|
+
var reconcileBlockMarkForParagraphAtPos = exports.reconcileBlockMarkForParagraphAtPos = function reconcileBlockMarkForParagraphAtPos(tr, pos, markType, markAttrs) {
|
|
61
|
+
var paragraph = tr.doc.type.schema.nodes.paragraph;
|
|
62
|
+
if (!paragraph) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
var resolvedPos = tr.doc.resolve(Math.max(0, Math.min(pos, tr.doc.content.size)));
|
|
66
|
+
for (var depth = resolvedPos.depth; depth > 0; depth--) {
|
|
67
|
+
var node = resolvedPos.node(depth);
|
|
68
|
+
if (node.type === paragraph) {
|
|
69
|
+
return reconcileBlockMarkInRange(tr, resolvedPos.before(depth), resolvedPos.before(depth) + node.nodeSize, markType, markAttrs, [paragraph]);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return false;
|
|
73
|
+
};
|
package/dist/cjs/lists/index.js
CHANGED
|
@@ -33,12 +33,24 @@ Object.defineProperty(exports, "flattenList", {
|
|
|
33
33
|
return _flattenList.flattenList;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
+
Object.defineProperty(exports, "getBlockMarkAttrs", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function get() {
|
|
39
|
+
return _blockMark.getBlockMarkAttrs;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
36
42
|
Object.defineProperty(exports, "getCommonListAnalyticsAttributes", {
|
|
37
43
|
enumerable: true,
|
|
38
44
|
get: function get() {
|
|
39
45
|
return _analytics.getCommonListAnalyticsAttributes;
|
|
40
46
|
}
|
|
41
47
|
});
|
|
48
|
+
Object.defineProperty(exports, "getFirstParagraphBlockMarkAttrs", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function get() {
|
|
51
|
+
return _blockMark.getFirstParagraphBlockMarkAttrs;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
42
54
|
Object.defineProperty(exports, "getListItemAttributes", {
|
|
43
55
|
enumerable: true,
|
|
44
56
|
get: function get() {
|
|
@@ -117,6 +129,24 @@ Object.defineProperty(exports, "processNestedTaskListsInSameLevel", {
|
|
|
117
129
|
return _node.processNestedTaskListsInSameLevel;
|
|
118
130
|
}
|
|
119
131
|
});
|
|
132
|
+
Object.defineProperty(exports, "reconcileBlockMarkForContainerAtPos", {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: function get() {
|
|
135
|
+
return _blockMark.reconcileBlockMarkForContainerAtPos;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
Object.defineProperty(exports, "reconcileBlockMarkForParagraphAtPos", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function get() {
|
|
141
|
+
return _blockMark.reconcileBlockMarkForParagraphAtPos;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
Object.defineProperty(exports, "reconcileBlockMarkInRange", {
|
|
145
|
+
enumerable: true,
|
|
146
|
+
get: function get() {
|
|
147
|
+
return _blockMark.reconcileBlockMarkInRange;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
120
150
|
Object.defineProperty(exports, "restoreSelection", {
|
|
121
151
|
enumerable: true,
|
|
122
152
|
get: function get() {
|
|
@@ -132,5 +162,6 @@ var _restoreSelection = require("./restore-selection");
|
|
|
132
162
|
var _buildReplacementFragment = require("./build-replacement-fragment");
|
|
133
163
|
var _narrowReplacementRange = require("./narrow-replacement-range");
|
|
134
164
|
var _flattenList = require("./flatten-list");
|
|
165
|
+
var _blockMark = require("./block-mark");
|
|
135
166
|
var _utils = require("../utils");
|
|
136
167
|
var _messages = require("./messages");
|
|
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
19
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
20
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
21
21
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
22
|
-
var packageVersion = "
|
|
22
|
+
var packageVersion = "112.13.0";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// 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 = "
|
|
27
|
+
var packageVersion = "112.13.0";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Default keyword lists omit longer phrases when a shorter phrase in the same list already
|
|
5
|
+
* matches as a whole word within them (case-insensitive), e.g. drop `in summary` when `summary`
|
|
6
|
+
* is present.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export const aiAutocompleteMessages = defineMessages({
|
|
10
|
+
summaryKeywords: {
|
|
11
|
+
id: 'fabric.editor.ai.autocomplete.summary.trigger.keywords.non-final',
|
|
12
|
+
defaultMessage: 'summary, tldr, tl;dr, tl dr, overview, synopsis, recap, abstract, brief, outline, quick, in short, rundown, review, roundup, highlights, key points, snapshot, at a glance, in essence, takeaways, to summarize, to summarise',
|
|
13
|
+
description: 'Comma-separated heading phrases that trigger AI autocomplete when the user finishes typing one as a whole token at the cursor. Translators may reorder or localize phrases; keep comma separation.'
|
|
14
|
+
},
|
|
15
|
+
conclusionKeywords: {
|
|
16
|
+
id: 'fabric.editor.ai.autocomplete.conclusion.trigger.keywords.non-final',
|
|
17
|
+
defaultMessage: 'conclusion, conclusions, findings, results, outcome, outcomes, final thoughts, takeaway, takeaways, verdict, determination, resolution, final analysis, deduction, judgment, decision, culmination, end result, bottom line, final word, closing, to conclude, final notes, learnings, what we learned, overall',
|
|
18
|
+
description: 'Comma-separated phrases that trigger AI autocomplete for a conclusion-style completion when typed in the last lines of the document. Translators may reorder or localize; keep comma separation.'
|
|
19
|
+
},
|
|
20
|
+
nextStepsKeywords: {
|
|
21
|
+
id: 'fabric.editor.ai.autocomplete.next.steps.trigger.keywords.non-final',
|
|
22
|
+
defaultMessage: "recommendations, follow-through, implementation, moving forward, going forward, deliverables, path forward, what is next, way forward, what's next, next steps, priorities, whats next, task list, follow-up, follow up, next step, followup, priority, next up, up next, roadmap, actions, action, tasks, todos, to do, to-do, todo, plan",
|
|
23
|
+
description: 'Comma-separated phrases that trigger AI autocomplete for a next-steps-style completion when typed in the last lines of the document. Translators may reorder or localize; keep comma separation. Prefer longer phrases before shorter ones that are suffixes.'
|
|
24
|
+
}
|
|
25
|
+
});
|
|
@@ -11,4 +11,5 @@ export { aiMessages } from './ai';
|
|
|
11
11
|
export { aiProactiveSettingMessages } from './ai-proactive-setting';
|
|
12
12
|
export { aiProactiveTransformMessages } from './ai-proactive-transform';
|
|
13
13
|
export { aiQuickPromptMessages } from './ai-quick-prompt';
|
|
14
|
-
export { aiSuggestionsMessages } from './ai-suggestions';
|
|
14
|
+
export { aiSuggestionsMessages } from './ai-suggestions';
|
|
15
|
+
export { aiAutocompleteMessages } from './ai-autocomplete';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { createToggleBlockMarkOnRangeNext } from '../commands';
|
|
2
|
+
const getDefaultBlockNodeTypes = tr => {
|
|
3
|
+
const {
|
|
4
|
+
paragraph
|
|
5
|
+
} = tr.doc.type.schema.nodes;
|
|
6
|
+
return paragraph ? [paragraph] : [];
|
|
7
|
+
};
|
|
8
|
+
export const getBlockMarkAttrs = (node, markType) => {
|
|
9
|
+
if (!node || !markType) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
const blockMark = node.marks.find(mark => mark.type === markType);
|
|
13
|
+
return blockMark ? blockMark.attrs : false;
|
|
14
|
+
};
|
|
15
|
+
export const getFirstParagraphBlockMarkAttrs = (node, markType) => {
|
|
16
|
+
if (!node || !markType) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
const {
|
|
20
|
+
paragraph
|
|
21
|
+
} = node.type.schema.nodes;
|
|
22
|
+
if (!paragraph) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
const findFirstParagraphBlockMarkAttrs = currentNode => {
|
|
26
|
+
if (currentNode.type === paragraph) {
|
|
27
|
+
return getBlockMarkAttrs(currentNode, markType);
|
|
28
|
+
}
|
|
29
|
+
for (let index = 0; index < currentNode.childCount; index++) {
|
|
30
|
+
const childResult = findFirstParagraphBlockMarkAttrs(currentNode.child(index));
|
|
31
|
+
if (childResult !== false) {
|
|
32
|
+
return childResult;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return false;
|
|
36
|
+
};
|
|
37
|
+
return findFirstParagraphBlockMarkAttrs(node);
|
|
38
|
+
};
|
|
39
|
+
export const reconcileBlockMarkInRange = (tr, from, to, markType, markAttrs, blockNodeTypes = getDefaultBlockNodeTypes(tr)) => {
|
|
40
|
+
if (!markType || blockNodeTypes.length === 0) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
return createToggleBlockMarkOnRangeNext(markType, () => markAttrs, blockNodeTypes)(from, to, tr);
|
|
44
|
+
};
|
|
45
|
+
export const reconcileBlockMarkForContainerAtPos = (tr, containerPos, markType, markAttrs, blockNodeTypes = getDefaultBlockNodeTypes(tr)) => {
|
|
46
|
+
const containerNode = tr.doc.nodeAt(containerPos);
|
|
47
|
+
if (!containerNode) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
return reconcileBlockMarkInRange(tr, containerPos, containerPos + containerNode.nodeSize, markType, markAttrs, blockNodeTypes);
|
|
51
|
+
};
|
|
52
|
+
export const reconcileBlockMarkForParagraphAtPos = (tr, pos, markType, markAttrs) => {
|
|
53
|
+
const {
|
|
54
|
+
paragraph
|
|
55
|
+
} = tr.doc.type.schema.nodes;
|
|
56
|
+
if (!paragraph) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
const resolvedPos = tr.doc.resolve(Math.max(0, Math.min(pos, tr.doc.content.size)));
|
|
60
|
+
for (let depth = resolvedPos.depth; depth > 0; depth--) {
|
|
61
|
+
const node = resolvedPos.node(depth);
|
|
62
|
+
if (node.type === paragraph) {
|
|
63
|
+
return reconcileBlockMarkInRange(tr, resolvedPos.before(depth), resolvedPos.before(depth) + node.nodeSize, markType, markAttrs, [paragraph]);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return false;
|
|
67
|
+
};
|
|
@@ -10,5 +10,6 @@ export { restoreSelection, computeSelectionOffsets } from './restore-selection';
|
|
|
10
10
|
export { buildReplacementFragment } from './build-replacement-fragment';
|
|
11
11
|
export { narrowReplacementRange } from './narrow-replacement-range';
|
|
12
12
|
export { flattenList } from './flatten-list';
|
|
13
|
+
export { getBlockMarkAttrs, getFirstParagraphBlockMarkAttrs, reconcileBlockMarkForContainerAtPos, reconcileBlockMarkForParagraphAtPos, reconcileBlockMarkInRange } from './block-mark';
|
|
13
14
|
export { isListNode, isListItemNode, isBulletList, isParagraphNode } from '../utils';
|
|
14
15
|
export { messages } from './messages';
|
|
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
|
|
|
4
4
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
5
5
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
6
6
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
7
|
-
const packageVersion = "
|
|
7
|
+
const packageVersion = "112.13.0";
|
|
8
8
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
9
9
|
// Remove URL as it has UGC
|
|
10
10
|
// 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 = "
|
|
17
|
+
const packageVersion = "112.13.0";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Default keyword lists omit longer phrases when a shorter phrase in the same list already
|
|
5
|
+
* matches as a whole word within them (case-insensitive), e.g. drop `in summary` when `summary`
|
|
6
|
+
* is present.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export var aiAutocompleteMessages = defineMessages({
|
|
10
|
+
summaryKeywords: {
|
|
11
|
+
id: 'fabric.editor.ai.autocomplete.summary.trigger.keywords.non-final',
|
|
12
|
+
defaultMessage: 'summary, tldr, tl;dr, tl dr, overview, synopsis, recap, abstract, brief, outline, quick, in short, rundown, review, roundup, highlights, key points, snapshot, at a glance, in essence, takeaways, to summarize, to summarise',
|
|
13
|
+
description: 'Comma-separated heading phrases that trigger AI autocomplete when the user finishes typing one as a whole token at the cursor. Translators may reorder or localize phrases; keep comma separation.'
|
|
14
|
+
},
|
|
15
|
+
conclusionKeywords: {
|
|
16
|
+
id: 'fabric.editor.ai.autocomplete.conclusion.trigger.keywords.non-final',
|
|
17
|
+
defaultMessage: 'conclusion, conclusions, findings, results, outcome, outcomes, final thoughts, takeaway, takeaways, verdict, determination, resolution, final analysis, deduction, judgment, decision, culmination, end result, bottom line, final word, closing, to conclude, final notes, learnings, what we learned, overall',
|
|
18
|
+
description: 'Comma-separated phrases that trigger AI autocomplete for a conclusion-style completion when typed in the last lines of the document. Translators may reorder or localize; keep comma separation.'
|
|
19
|
+
},
|
|
20
|
+
nextStepsKeywords: {
|
|
21
|
+
id: 'fabric.editor.ai.autocomplete.next.steps.trigger.keywords.non-final',
|
|
22
|
+
defaultMessage: "recommendations, follow-through, implementation, moving forward, going forward, deliverables, path forward, what is next, way forward, what's next, next steps, priorities, whats next, task list, follow-up, follow up, next step, followup, priority, next up, up next, roadmap, actions, action, tasks, todos, to do, to-do, todo, plan",
|
|
23
|
+
description: 'Comma-separated phrases that trigger AI autocomplete for a next-steps-style completion when typed in the last lines of the document. Translators may reorder or localize; keep comma separation. Prefer longer phrases before shorter ones that are suffixes.'
|
|
24
|
+
}
|
|
25
|
+
});
|
|
@@ -11,4 +11,5 @@ export { aiMessages } from './ai';
|
|
|
11
11
|
export { aiProactiveSettingMessages } from './ai-proactive-setting';
|
|
12
12
|
export { aiProactiveTransformMessages } from './ai-proactive-transform';
|
|
13
13
|
export { aiQuickPromptMessages } from './ai-quick-prompt';
|
|
14
|
-
export { aiSuggestionsMessages } from './ai-suggestions';
|
|
14
|
+
export { aiSuggestionsMessages } from './ai-suggestions';
|
|
15
|
+
export { aiAutocompleteMessages } from './ai-autocomplete';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { createToggleBlockMarkOnRangeNext } from '../commands';
|
|
2
|
+
var getDefaultBlockNodeTypes = function getDefaultBlockNodeTypes(tr) {
|
|
3
|
+
var paragraph = tr.doc.type.schema.nodes.paragraph;
|
|
4
|
+
return paragraph ? [paragraph] : [];
|
|
5
|
+
};
|
|
6
|
+
export var getBlockMarkAttrs = function getBlockMarkAttrs(node, markType) {
|
|
7
|
+
if (!node || !markType) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
var blockMark = node.marks.find(function (mark) {
|
|
11
|
+
return mark.type === markType;
|
|
12
|
+
});
|
|
13
|
+
return blockMark ? blockMark.attrs : false;
|
|
14
|
+
};
|
|
15
|
+
export var getFirstParagraphBlockMarkAttrs = function getFirstParagraphBlockMarkAttrs(node, markType) {
|
|
16
|
+
if (!node || !markType) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
var paragraph = node.type.schema.nodes.paragraph;
|
|
20
|
+
if (!paragraph) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
var _findFirstParagraphBlockMarkAttrs = function findFirstParagraphBlockMarkAttrs(currentNode) {
|
|
24
|
+
if (currentNode.type === paragraph) {
|
|
25
|
+
return getBlockMarkAttrs(currentNode, markType);
|
|
26
|
+
}
|
|
27
|
+
for (var index = 0; index < currentNode.childCount; index++) {
|
|
28
|
+
var childResult = _findFirstParagraphBlockMarkAttrs(currentNode.child(index));
|
|
29
|
+
if (childResult !== false) {
|
|
30
|
+
return childResult;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return false;
|
|
34
|
+
};
|
|
35
|
+
return _findFirstParagraphBlockMarkAttrs(node);
|
|
36
|
+
};
|
|
37
|
+
export var reconcileBlockMarkInRange = function reconcileBlockMarkInRange(tr, from, to, markType, markAttrs) {
|
|
38
|
+
var blockNodeTypes = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : getDefaultBlockNodeTypes(tr);
|
|
39
|
+
if (!markType || blockNodeTypes.length === 0) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
return createToggleBlockMarkOnRangeNext(markType, function () {
|
|
43
|
+
return markAttrs;
|
|
44
|
+
}, blockNodeTypes)(from, to, tr);
|
|
45
|
+
};
|
|
46
|
+
export var reconcileBlockMarkForContainerAtPos = function reconcileBlockMarkForContainerAtPos(tr, containerPos, markType, markAttrs) {
|
|
47
|
+
var blockNodeTypes = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : getDefaultBlockNodeTypes(tr);
|
|
48
|
+
var containerNode = tr.doc.nodeAt(containerPos);
|
|
49
|
+
if (!containerNode) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
return reconcileBlockMarkInRange(tr, containerPos, containerPos + containerNode.nodeSize, markType, markAttrs, blockNodeTypes);
|
|
53
|
+
};
|
|
54
|
+
export var reconcileBlockMarkForParagraphAtPos = function reconcileBlockMarkForParagraphAtPos(tr, pos, markType, markAttrs) {
|
|
55
|
+
var paragraph = tr.doc.type.schema.nodes.paragraph;
|
|
56
|
+
if (!paragraph) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
var resolvedPos = tr.doc.resolve(Math.max(0, Math.min(pos, tr.doc.content.size)));
|
|
60
|
+
for (var depth = resolvedPos.depth; depth > 0; depth--) {
|
|
61
|
+
var node = resolvedPos.node(depth);
|
|
62
|
+
if (node.type === paragraph) {
|
|
63
|
+
return reconcileBlockMarkInRange(tr, resolvedPos.before(depth), resolvedPos.before(depth) + node.nodeSize, markType, markAttrs, [paragraph]);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return false;
|
|
67
|
+
};
|
package/dist/esm/lists/index.js
CHANGED
|
@@ -10,5 +10,6 @@ export { restoreSelection, computeSelectionOffsets } from './restore-selection';
|
|
|
10
10
|
export { buildReplacementFragment } from './build-replacement-fragment';
|
|
11
11
|
export { narrowReplacementRange } from './narrow-replacement-range';
|
|
12
12
|
export { flattenList } from './flatten-list';
|
|
13
|
+
export { getBlockMarkAttrs, getFirstParagraphBlockMarkAttrs, reconcileBlockMarkForContainerAtPos, reconcileBlockMarkForParagraphAtPos, reconcileBlockMarkInRange } from './block-mark';
|
|
13
14
|
export { isListNode, isListItemNode, isBulletList, isParagraphNode } from '../utils';
|
|
14
15
|
export { messages } from './messages';
|
|
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
|
|
|
10
10
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
11
11
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
12
12
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
13
|
-
var packageVersion = "
|
|
13
|
+
var packageVersion = "112.13.0";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// 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 = "
|
|
24
|
+
var packageVersion = "112.13.0";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default keyword lists omit longer phrases when a shorter phrase in the same list already
|
|
3
|
+
* matches as a whole word within them (case-insensitive), e.g. drop `in summary` when `summary`
|
|
4
|
+
* is present.
|
|
5
|
+
*/
|
|
6
|
+
export declare const aiAutocompleteMessages: {
|
|
7
|
+
conclusionKeywords: {
|
|
8
|
+
defaultMessage: string;
|
|
9
|
+
description: string;
|
|
10
|
+
id: string;
|
|
11
|
+
};
|
|
12
|
+
nextStepsKeywords: {
|
|
13
|
+
defaultMessage: string;
|
|
14
|
+
description: string;
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
summaryKeywords: {
|
|
18
|
+
defaultMessage: string;
|
|
19
|
+
description: string;
|
|
20
|
+
id: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -9,3 +9,4 @@ export { aiProactiveSettingMessages } from './ai-proactive-setting';
|
|
|
9
9
|
export { aiProactiveTransformMessages } from './ai-proactive-transform';
|
|
10
10
|
export { aiQuickPromptMessages } from './ai-quick-prompt';
|
|
11
11
|
export { aiSuggestionsMessages } from './ai-suggestions';
|
|
12
|
+
export { aiAutocompleteMessages } from './ai-autocomplete';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MarkType, Node as PMNode, NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
type BlockMarkAttrs = Record<string, unknown>;
|
|
4
|
+
export declare const getBlockMarkAttrs: <T extends BlockMarkAttrs = BlockMarkAttrs>(node: PMNode | null | undefined, markType?: MarkType) => T | false;
|
|
5
|
+
export declare const getFirstParagraphBlockMarkAttrs: <T extends BlockMarkAttrs = BlockMarkAttrs>(node: PMNode | null | undefined, markType?: MarkType) => T | false;
|
|
6
|
+
export declare const reconcileBlockMarkInRange: <T extends BlockMarkAttrs = BlockMarkAttrs>(tr: Transaction, from: number, to: number, markType: MarkType | undefined, markAttrs: T | false, blockNodeTypes?: NodeType[]) => boolean;
|
|
7
|
+
export declare const reconcileBlockMarkForContainerAtPos: <T extends BlockMarkAttrs = BlockMarkAttrs>(tr: Transaction, containerPos: number, markType: MarkType | undefined, markAttrs: T | false, blockNodeTypes?: NodeType[]) => boolean;
|
|
8
|
+
export declare const reconcileBlockMarkForParagraphAtPos: <T extends BlockMarkAttrs = BlockMarkAttrs>(tr: Transaction, pos: number, markType: MarkType | undefined, markAttrs: T | false) => boolean;
|
|
9
|
+
export {};
|
|
@@ -11,5 +11,6 @@ export type { NarrowedReplacement } from './narrow-replacement-range';
|
|
|
11
11
|
export type { FlattenedItem } from './flatten-list';
|
|
12
12
|
export { flattenList } from './flatten-list';
|
|
13
13
|
export type { FlattenListOptions, FlattenListResult } from './flatten-list';
|
|
14
|
+
export { getBlockMarkAttrs, getFirstParagraphBlockMarkAttrs, reconcileBlockMarkForContainerAtPos, reconcileBlockMarkForParagraphAtPos, reconcileBlockMarkInRange, } from './block-mark';
|
|
14
15
|
export { isListNode, isListItemNode, isBulletList, isParagraphNode } from '../utils';
|
|
15
16
|
export { messages } from './messages';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default keyword lists omit longer phrases when a shorter phrase in the same list already
|
|
3
|
+
* matches as a whole word within them (case-insensitive), e.g. drop `in summary` when `summary`
|
|
4
|
+
* is present.
|
|
5
|
+
*/
|
|
6
|
+
export declare const aiAutocompleteMessages: {
|
|
7
|
+
conclusionKeywords: {
|
|
8
|
+
defaultMessage: string;
|
|
9
|
+
description: string;
|
|
10
|
+
id: string;
|
|
11
|
+
};
|
|
12
|
+
nextStepsKeywords: {
|
|
13
|
+
defaultMessage: string;
|
|
14
|
+
description: string;
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
summaryKeywords: {
|
|
18
|
+
defaultMessage: string;
|
|
19
|
+
description: string;
|
|
20
|
+
id: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -9,3 +9,4 @@ export { aiProactiveSettingMessages } from './ai-proactive-setting';
|
|
|
9
9
|
export { aiProactiveTransformMessages } from './ai-proactive-transform';
|
|
10
10
|
export { aiQuickPromptMessages } from './ai-quick-prompt';
|
|
11
11
|
export { aiSuggestionsMessages } from './ai-suggestions';
|
|
12
|
+
export { aiAutocompleteMessages } from './ai-autocomplete';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MarkType, Node as PMNode, NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
type BlockMarkAttrs = Record<string, unknown>;
|
|
4
|
+
export declare const getBlockMarkAttrs: <T extends BlockMarkAttrs = BlockMarkAttrs>(node: PMNode | null | undefined, markType?: MarkType) => T | false;
|
|
5
|
+
export declare const getFirstParagraphBlockMarkAttrs: <T extends BlockMarkAttrs = BlockMarkAttrs>(node: PMNode | null | undefined, markType?: MarkType) => T | false;
|
|
6
|
+
export declare const reconcileBlockMarkInRange: <T extends BlockMarkAttrs = BlockMarkAttrs>(tr: Transaction, from: number, to: number, markType: MarkType | undefined, markAttrs: T | false, blockNodeTypes?: NodeType[]) => boolean;
|
|
7
|
+
export declare const reconcileBlockMarkForContainerAtPos: <T extends BlockMarkAttrs = BlockMarkAttrs>(tr: Transaction, containerPos: number, markType: MarkType | undefined, markAttrs: T | false, blockNodeTypes?: NodeType[]) => boolean;
|
|
8
|
+
export declare const reconcileBlockMarkForParagraphAtPos: <T extends BlockMarkAttrs = BlockMarkAttrs>(tr: Transaction, pos: number, markType: MarkType | undefined, markAttrs: T | false) => boolean;
|
|
9
|
+
export {};
|
|
@@ -11,5 +11,6 @@ export type { NarrowedReplacement } from './narrow-replacement-range';
|
|
|
11
11
|
export type { FlattenedItem } from './flatten-list';
|
|
12
12
|
export { flattenList } from './flatten-list';
|
|
13
13
|
export type { FlattenListOptions, FlattenListResult } from './flatten-list';
|
|
14
|
+
export { getBlockMarkAttrs, getFirstParagraphBlockMarkAttrs, reconcileBlockMarkForContainerAtPos, reconcileBlockMarkForParagraphAtPos, reconcileBlockMarkInRange, } from './block-mark';
|
|
14
15
|
export { isListNode, isListItemNode, isBulletList, isParagraphNode } from '../utils';
|
|
15
16
|
export { messages } from './messages';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "112.
|
|
3
|
+
"version": "112.13.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,7 +73,7 @@
|
|
|
73
73
|
"@atlaskit/primitives": "^18.1.0",
|
|
74
74
|
"@atlaskit/profilecard": "^24.45.0",
|
|
75
75
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
76
|
-
"@atlaskit/react-ufo": "^5.
|
|
76
|
+
"@atlaskit/react-ufo": "^5.7.0",
|
|
77
77
|
"@atlaskit/section-message": "^8.12.0",
|
|
78
78
|
"@atlaskit/smart-card": "^43.28.0",
|
|
79
79
|
"@atlaskit/smart-user-picker": "^9.2.0",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@atlaskit/status": "^3.2.0",
|
|
82
82
|
"@atlaskit/task-decision": "^19.3.0",
|
|
83
83
|
"@atlaskit/textfield": "^8.2.0",
|
|
84
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
84
|
+
"@atlaskit/tmp-editor-statsig": "^49.0.0",
|
|
85
85
|
"@atlaskit/tokens": "^11.4.0",
|
|
86
86
|
"@atlaskit/tooltip": "^21.0.0",
|
|
87
87
|
"@atlaskit/width-detector": "^5.0.0",
|