@atlaskit/editor-common 99.5.0 → 99.5.2
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 +16 -0
- package/dist/cjs/analytics/types/ai-events.js +5 -0
- package/dist/cjs/analytics/types/enums.js +2 -0
- package/dist/cjs/card/MediaAndEmbedsToolbar/index.js +3 -12
- package/dist/cjs/commands/index.js +42 -50
- package/dist/cjs/commands/insert-block.js +1 -4
- package/dist/cjs/element-browser/hooks/use-select-and-focus-on-arrow-navigation.js +1 -6
- package/dist/cjs/extensibility/Extension/Extension/index.js +6 -3
- package/dist/cjs/extensibility/Extension/InlineExtension/index.js +4 -2
- package/dist/cjs/extensibility/Extension/Lozenge/ExtensionLabel.js +16 -6
- package/dist/cjs/extensibility/Extension/Lozenge/LozengeComponent.js +4 -2
- package/dist/cjs/extensibility/Extension/Lozenge/index.js +4 -2
- package/dist/cjs/extensibility/MultiBodiedExtension/index.js +4 -2
- package/dist/cjs/extensibility/extensionNodeView.js +1 -2
- package/dist/cjs/guideline/dynamicGuideline.js +1 -4
- package/dist/cjs/guideline/relativeGuideline.js +3 -12
- package/dist/cjs/guideline/updateGuideline.js +1 -4
- package/dist/cjs/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +9 -11
- package/dist/cjs/insert/index.js +1 -4
- package/dist/cjs/keymaps/index.js +0 -3
- package/dist/cjs/lazy-node-view/index.js +1 -6
- package/dist/cjs/lazy-node-view/node-view.js +0 -2
- package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +0 -2
- package/dist/cjs/lists/analytics.js +0 -2
- package/dist/cjs/mark/commands.js +2 -11
- package/dist/cjs/media-single/utils.js +0 -5
- package/dist/cjs/messages/ai-proactive-setting.js +109 -0
- package/dist/cjs/messages/ai-proactive-transform.js +99 -0
- package/dist/cjs/messages/ai-proactive.js +145 -0
- package/dist/cjs/messages/index.js +14 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/node-width/index.js +1 -4
- package/dist/cjs/paste/md-plugins/ignore-list-heading-md-plugin.js +0 -5
- package/dist/cjs/preset/core-plugin/requestDocument.js +1 -2
- package/dist/cjs/react-node-view/index.js +1 -9
- package/dist/cjs/resizer/Resizer.js +2 -8
- package/dist/cjs/selection/gap-cursor/actions.js +2 -8
- package/dist/cjs/selection/index.js +0 -2
- package/dist/cjs/selection-based-node-view/SelectionBasedNodeView.js +0 -6
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Layer/index.js +0 -2
- package/dist/cjs/ui/MediaSingle/grid.js +2 -8
- package/dist/cjs/ui/MediaSingle/styled.js +0 -4
- package/dist/cjs/ui/Popup/utils.js +0 -7
- package/dist/cjs/ui/ResizerLegacy/index.js +0 -4
- package/dist/cjs/ui/unsupported-content-helper.js +0 -2
- package/dist/cjs/utils/breakout.js +0 -2
- package/dist/cjs/utils/commands.js +1 -4
- package/dist/cjs/utils/editor-core-utils.js +0 -3
- package/dist/cjs/utils/input-rules.js +1 -4
- package/dist/cjs/utils/nodes.js +1 -6
- package/dist/cjs/utils/page-element-counts.js +10 -3
- package/dist/cjs/utils/performance/measure-tti.js +0 -5
- package/dist/cjs/utils/plugin-state-factory.js +0 -2
- package/dist/cjs/utils/processRawValue.js +0 -6
- package/dist/cjs/utils/prosemirror/autojoin.js +0 -2
- package/dist/cjs/utils/rich-media-utils.js +1 -4
- package/dist/cjs/utils/track-unsupported-content.js +2 -8
- package/dist/cjs/utils/validate-using-spec.js +1 -7
- package/dist/cjs/with-plugin-state/index.js +0 -4
- package/dist/es2019/analytics/types/ai-events.js +1 -0
- package/dist/es2019/analytics/types/enums.js +2 -0
- package/dist/es2019/card/MediaAndEmbedsToolbar/index.js +3 -12
- package/dist/es2019/commands/index.js +2 -8
- package/dist/es2019/commands/insert-block.js +1 -4
- package/dist/es2019/element-browser/hooks/use-select-and-focus-on-arrow-navigation.js +1 -6
- package/dist/es2019/extensibility/Extension/Extension/index.js +6 -3
- package/dist/es2019/extensibility/Extension/InlineExtension/index.js +4 -2
- package/dist/es2019/extensibility/Extension/Lozenge/ExtensionLabel.js +16 -6
- package/dist/es2019/extensibility/Extension/Lozenge/LozengeComponent.js +4 -2
- package/dist/es2019/extensibility/Extension/Lozenge/index.js +4 -2
- package/dist/es2019/extensibility/MultiBodiedExtension/index.js +4 -2
- package/dist/es2019/extensibility/extensionNodeView.js +0 -3
- package/dist/es2019/guideline/dynamicGuideline.js +1 -4
- package/dist/es2019/guideline/relativeGuideline.js +3 -12
- package/dist/es2019/guideline/snapping.js +1 -4
- package/dist/es2019/guideline/updateGuideline.js +1 -4
- package/dist/es2019/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +9 -11
- package/dist/es2019/insert/index.js +1 -4
- package/dist/es2019/keymaps/index.js +0 -3
- package/dist/es2019/lazy-node-view/index.js +1 -6
- package/dist/es2019/lazy-node-view/node-view.js +0 -2
- package/dist/es2019/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +0 -2
- package/dist/es2019/lists/analytics.js +0 -2
- package/dist/es2019/mark/commands.js +2 -11
- package/dist/es2019/media-single/utils.js +0 -5
- package/dist/es2019/messages/ai-proactive-setting.js +103 -0
- package/dist/es2019/messages/ai-proactive-transform.js +93 -0
- package/dist/es2019/messages/ai-proactive.js +145 -0
- package/dist/es2019/messages/index.js +2 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/node-width/index.js +1 -4
- package/dist/es2019/paste/md-plugins/ignore-list-heading-md-plugin.js +0 -5
- package/dist/es2019/preset/core-plugin/requestDocument.js +1 -2
- package/dist/es2019/react-node-view/index.js +0 -7
- package/dist/es2019/resizer/Resizer.js +2 -8
- package/dist/es2019/selection/gap-cursor/actions.js +2 -8
- package/dist/es2019/selection/index.js +0 -2
- package/dist/es2019/selection-based-node-view/SelectionBasedNodeView.js +0 -6
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Layer/index.js +0 -2
- package/dist/es2019/ui/MediaSingle/grid.js +2 -8
- package/dist/es2019/ui/MediaSingle/styled.js +0 -4
- package/dist/es2019/ui/Popup/utils.js +0 -7
- package/dist/es2019/ui/ResizerLegacy/index.js +0 -4
- package/dist/es2019/ui/unsupported-content-helper.js +0 -2
- package/dist/es2019/utils/breakout.js +0 -2
- package/dist/es2019/utils/commands.js +1 -4
- package/dist/es2019/utils/compare-props.js +1 -4
- package/dist/es2019/utils/editor-core-utils.js +0 -3
- package/dist/es2019/utils/input-rules.js +1 -4
- package/dist/es2019/utils/nodes.js +1 -6
- package/dist/es2019/utils/page-element-counts.js +10 -3
- package/dist/es2019/utils/performance/measure-tti.js +0 -6
- package/dist/es2019/utils/plugin-state-factory.js +0 -2
- package/dist/es2019/utils/processRawValue.js +0 -6
- package/dist/es2019/utils/prosemirror/autojoin.js +0 -2
- package/dist/es2019/utils/rich-media-utils.js +1 -4
- package/dist/es2019/utils/track-unsupported-content.js +3 -12
- package/dist/es2019/utils/validate-using-spec.js +1 -7
- package/dist/es2019/with-plugin-state/index.js +0 -4
- package/dist/esm/analytics/types/ai-events.js +1 -0
- package/dist/esm/analytics/types/enums.js +2 -0
- package/dist/esm/card/MediaAndEmbedsToolbar/index.js +3 -12
- package/dist/esm/commands/index.js +42 -50
- package/dist/esm/commands/insert-block.js +1 -4
- package/dist/esm/element-browser/hooks/use-select-and-focus-on-arrow-navigation.js +1 -6
- package/dist/esm/extensibility/Extension/Extension/index.js +6 -3
- package/dist/esm/extensibility/Extension/InlineExtension/index.js +4 -2
- package/dist/esm/extensibility/Extension/Lozenge/ExtensionLabel.js +16 -6
- package/dist/esm/extensibility/Extension/Lozenge/LozengeComponent.js +4 -2
- package/dist/esm/extensibility/Extension/Lozenge/index.js +4 -2
- package/dist/esm/extensibility/MultiBodiedExtension/index.js +4 -2
- package/dist/esm/extensibility/extensionNodeView.js +0 -3
- package/dist/esm/guideline/dynamicGuideline.js +1 -4
- package/dist/esm/guideline/relativeGuideline.js +3 -12
- package/dist/esm/guideline/updateGuideline.js +1 -4
- package/dist/esm/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +9 -11
- package/dist/esm/insert/index.js +1 -4
- package/dist/esm/keymaps/index.js +0 -3
- package/dist/esm/lazy-node-view/index.js +1 -6
- package/dist/esm/lazy-node-view/node-view.js +0 -2
- package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +0 -2
- package/dist/esm/lists/analytics.js +0 -2
- package/dist/esm/mark/commands.js +2 -11
- package/dist/esm/media-single/utils.js +0 -5
- package/dist/esm/messages/ai-proactive-setting.js +103 -0
- package/dist/esm/messages/ai-proactive-transform.js +93 -0
- package/dist/esm/messages/ai-proactive.js +145 -0
- package/dist/esm/messages/index.js +2 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/node-width/index.js +1 -4
- package/dist/esm/paste/md-plugins/ignore-list-heading-md-plugin.js +0 -5
- package/dist/esm/preset/core-plugin/requestDocument.js +1 -2
- package/dist/esm/react-node-view/index.js +1 -9
- package/dist/esm/resizer/Resizer.js +2 -8
- package/dist/esm/selection/gap-cursor/actions.js +2 -8
- package/dist/esm/selection/index.js +0 -2
- package/dist/esm/selection-based-node-view/SelectionBasedNodeView.js +0 -6
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Layer/index.js +0 -2
- package/dist/esm/ui/MediaSingle/grid.js +2 -8
- package/dist/esm/ui/MediaSingle/styled.js +0 -4
- package/dist/esm/ui/Popup/utils.js +0 -7
- package/dist/esm/ui/ResizerLegacy/index.js +0 -4
- package/dist/esm/ui/unsupported-content-helper.js +0 -2
- package/dist/esm/utils/breakout.js +0 -2
- package/dist/esm/utils/commands.js +1 -4
- package/dist/esm/utils/editor-core-utils.js +0 -3
- package/dist/esm/utils/input-rules.js +1 -4
- package/dist/esm/utils/nodes.js +1 -6
- package/dist/esm/utils/page-element-counts.js +10 -3
- package/dist/esm/utils/performance/measure-tti.js +0 -6
- package/dist/esm/utils/plugin-state-factory.js +0 -2
- package/dist/esm/utils/processRawValue.js +0 -6
- package/dist/esm/utils/prosemirror/autojoin.js +0 -2
- package/dist/esm/utils/rich-media-utils.js +1 -4
- package/dist/esm/utils/track-unsupported-content.js +2 -8
- package/dist/esm/utils/validate-using-spec.js +1 -7
- package/dist/esm/with-plugin-state/index.js +0 -4
- package/dist/types/analytics/index.d.ts +1 -0
- package/dist/types/analytics/types/ai-events.d.ts +15 -0
- package/dist/types/analytics/types/ai-proactive-events.d.ts +1 -1
- package/dist/types/analytics/types/enums.d.ts +2 -0
- package/dist/types/analytics/types/events.d.ts +5 -4
- package/dist/types/extensibility/Extension/Lozenge/ExtensionLabel.d.ts +3 -1
- package/dist/types/extensibility/Extension/Lozenge/LozengeComponent.d.ts +3 -1
- package/dist/types/extensibility/Extension/Lozenge/index.d.ts +2 -0
- package/dist/types/messages/ai-proactive-setting.d.ts +102 -0
- package/dist/types/messages/ai-proactive-transform.d.ts +92 -0
- package/dist/types/messages/ai-proactive.d.ts +145 -0
- package/dist/types/messages/index.d.ts +2 -0
- package/dist/types-ts4.5/analytics/index.d.ts +1 -0
- package/dist/types-ts4.5/analytics/types/ai-events.d.ts +15 -0
- package/dist/types-ts4.5/analytics/types/ai-proactive-events.d.ts +1 -1
- package/dist/types-ts4.5/analytics/types/enums.d.ts +2 -0
- package/dist/types-ts4.5/analytics/types/events.d.ts +5 -4
- package/dist/types-ts4.5/extensibility/Extension/Lozenge/ExtensionLabel.d.ts +3 -1
- package/dist/types-ts4.5/extensibility/Extension/Lozenge/LozengeComponent.d.ts +3 -1
- package/dist/types-ts4.5/extensibility/Extension/Lozenge/index.d.ts +2 -0
- package/dist/types-ts4.5/messages/ai-proactive-setting.d.ts +102 -0
- package/dist/types-ts4.5/messages/ai-proactive-transform.d.ts +92 -0
- package/dist/types-ts4.5/messages/ai-proactive.d.ts +145 -0
- package/dist/types-ts4.5/messages/index.d.ts +2 -0
- package/package.json +3 -3
|
@@ -6,10 +6,7 @@ import { isVerticalPosition } from './utils';
|
|
|
6
6
|
* Returns keys of guidelines that are closest to the image and withthin the snapGap.
|
|
7
7
|
* If both default and dynamic guidelines present, only returns default guidelines
|
|
8
8
|
*/
|
|
9
|
-
export const findClosestSnap = (mediaSingleWidth, snapArray, guidelineSnaps, snapGap = 0
|
|
10
|
-
// Ignored via go/ees005
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
12
|
-
) => {
|
|
9
|
+
export const findClosestSnap = (mediaSingleWidth, snapArray, guidelineSnaps, snapGap = 0) => {
|
|
13
10
|
const closestGapIndex = snapArray.reduce((prev, curr, index) => Math.abs(curr - mediaSingleWidth) < Math.abs(snapArray[prev] - mediaSingleWidth) ? index : prev, 0);
|
|
14
11
|
const gap = Math.abs(snapArray[closestGapIndex] - mediaSingleWidth);
|
|
15
12
|
if (gap < snapGap) {
|
|
@@ -3,10 +3,7 @@ const activeGuidelineStyle = guideline => ({
|
|
|
3
3
|
active: true,
|
|
4
4
|
show: true
|
|
5
5
|
});
|
|
6
|
-
export const getGuidelinesWithHighlights = (gap, maxGap, activeGuidelineKeys, guidelines
|
|
7
|
-
// Ignored via go/ees005
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
9
|
-
) => {
|
|
6
|
+
export const getGuidelinesWithHighlights = (gap, maxGap, activeGuidelineKeys, guidelines) => {
|
|
10
7
|
if (activeGuidelineKeys.length) {
|
|
11
8
|
return guidelines.map(guideline => {
|
|
12
9
|
if (activeGuidelineKeys.includes(guideline.key) && gap < maxGap) {
|
|
@@ -35,13 +35,13 @@ import { usePluginStateEffect } from '../usePluginStateEffect';
|
|
|
35
35
|
* ⚠️⚠️⚠️ This is a debounced hook ⚠️⚠️⚠️
|
|
36
36
|
* If the plugins you are listening to generate multiple shared states while the user is typing,
|
|
37
37
|
* your React Component will get only the last one.
|
|
38
|
-
*
|
|
38
|
+
*
|
|
39
39
|
* Used to return the current plugin state of input dependencies.
|
|
40
40
|
* It will recursively retrieve a slice of the state using a "." to separate
|
|
41
41
|
* parts of the state.
|
|
42
|
-
*
|
|
42
|
+
*
|
|
43
43
|
* Example:
|
|
44
|
-
*
|
|
44
|
+
*
|
|
45
45
|
* ```typescript
|
|
46
46
|
* const pluginA: NextEditorPlugin<
|
|
47
47
|
'pluginA',
|
|
@@ -51,7 +51,7 @@ import { usePluginStateEffect } from '../usePluginStateEffect';
|
|
|
51
51
|
>
|
|
52
52
|
* ```
|
|
53
53
|
* You can use `const value = useSharedPluginStateSelector(api, 'pluginA.deepObj.value')` to retrieve the value
|
|
54
|
-
*
|
|
54
|
+
*
|
|
55
55
|
* Example in plugin:
|
|
56
56
|
*
|
|
57
57
|
* ```typescript
|
|
@@ -67,12 +67,12 @@ import { usePluginStateEffect } from '../usePluginStateEffect';
|
|
|
67
67
|
* }
|
|
68
68
|
* }
|
|
69
69
|
* ```
|
|
70
|
-
*
|
|
70
|
+
*
|
|
71
71
|
* NOTE: If you pass an invalid path, `undefined` will be returned
|
|
72
|
-
*
|
|
73
|
-
* @param api
|
|
74
|
-
* @param plugin
|
|
75
|
-
* @returns
|
|
72
|
+
*
|
|
73
|
+
* @param api
|
|
74
|
+
* @param plugin
|
|
75
|
+
* @returns
|
|
76
76
|
*/
|
|
77
77
|
export function useSharedPluginStateSelector(api, plugin) {
|
|
78
78
|
const transformer = useCallback(pluginState => {
|
|
@@ -95,8 +95,6 @@ export function useSharedPluginStateSelector(api, plugin) {
|
|
|
95
95
|
}, [plugin, api, transformer]);
|
|
96
96
|
return useSharedPluginStateSelectorInternal(api, pluginNameArray, transformer, initialState);
|
|
97
97
|
}
|
|
98
|
-
|
|
99
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
100
98
|
function useSharedPluginStateSelectorInternal(api, plugins, transformer, initialState) {
|
|
101
99
|
const [selectedPluginState, setSelectedPluginState] = useState(initialState);
|
|
102
100
|
usePluginStateEffect(api, plugins, pluginStates => {
|
|
@@ -55,10 +55,7 @@ const selectionIsInNestedList = tr => {
|
|
|
55
55
|
}
|
|
56
56
|
return isListItemNode(tr.doc.resolve(parentListNode.pos).parent);
|
|
57
57
|
};
|
|
58
|
-
const insertBeforeOrAfter = (tr, lookDirection, $parentPos, $proposedPosition, content
|
|
59
|
-
// Ignored via go/ees005
|
|
60
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
61
|
-
) => {
|
|
58
|
+
const insertBeforeOrAfter = (tr, lookDirection, $parentPos, $proposedPosition, content) => {
|
|
62
59
|
/**
|
|
63
60
|
* This block caters for the first item in a parent with the cursor being at the very start
|
|
64
61
|
* or the last item with the cursor being at the very end
|
|
@@ -244,9 +244,6 @@ export function getAriaKeyshortcuts(keymap) {
|
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
const ALL = [toggleOrderedList, toggleBulletList, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleCode, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleBlockQuote, insertNewLine, insertRule, splitCodeBlock, splitListItem, redo, undo, find, escape, enter, shiftEnter];
|
|
247
|
-
|
|
248
|
-
// Ignored via go/ees005
|
|
249
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
250
247
|
export function makeKeymap(description, windows, mac, common) {
|
|
251
248
|
return {
|
|
252
249
|
description: description,
|
|
@@ -111,10 +111,7 @@ export const withLazyLoading = ({
|
|
|
111
111
|
loader,
|
|
112
112
|
getNodeViewOptions
|
|
113
113
|
}) => {
|
|
114
|
-
const createLazyNodeView = (node, view, getPos, decorations
|
|
115
|
-
// Ignored via go/ees005
|
|
116
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
117
|
-
) => {
|
|
114
|
+
const createLazyNodeView = (node, view, getPos, decorations) => {
|
|
118
115
|
var _node$type, _node$type$spec;
|
|
119
116
|
let requestedNodes = requestedNodesPerEditorView.get(view);
|
|
120
117
|
if (!requestedNodes) {
|
|
@@ -135,8 +132,6 @@ export const withLazyLoading = ({
|
|
|
135
132
|
}
|
|
136
133
|
const loaderPromise = loader().then(nodeViewFuncModule => {
|
|
137
134
|
var _resolvedNodesPerEdit;
|
|
138
|
-
// Ignored via go/ees005
|
|
139
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
140
135
|
const nodeViewFunc = (node, view, getPos, decorations) => {
|
|
141
136
|
const nodeView = nodeViewFuncModule(node, view, getPos, decorations, getNodeViewOptions);
|
|
142
137
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
@@ -35,8 +35,6 @@ export function makeNodePlaceholderId(nodeType, pos) {
|
|
|
35
35
|
* A NodeView that serves as a placeholder until the actual NodeView is loaded.
|
|
36
36
|
*/
|
|
37
37
|
export class LazyNodeView {
|
|
38
|
-
// Ignored via go/ees005
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
40
38
|
constructor(_node, view, _getPos, _outerDeco) {
|
|
41
39
|
var _node$type, _node$type$spec;
|
|
42
40
|
_defineProperty(this, "update", (node, outerDeco) => {
|
|
@@ -353,8 +353,6 @@ export class HyperlinkLinkAddToolbar extends PureComponent {
|
|
|
353
353
|
_defineProperty(this, "handleSelected", (href, text) => {
|
|
354
354
|
this.handleInsert(href, text, INPUT_METHOD.TYPEAHEAD, 'click');
|
|
355
355
|
});
|
|
356
|
-
// Ignored via go/ees005
|
|
357
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
358
356
|
_defineProperty(this, "handleInsert", (href, title, inputType, interaction) => {
|
|
359
357
|
const {
|
|
360
358
|
searchSessionId,
|
|
@@ -27,8 +27,6 @@ export const countListItemsInSelection = tr => {
|
|
|
27
27
|
}
|
|
28
28
|
let count = 0;
|
|
29
29
|
const listSlice = tr.doc.cut(from, to);
|
|
30
|
-
// Ignored via go/ees005
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
32
30
|
listSlice.content.nodesBetween(0, listSlice.content.size, (node, pos, parent, index) => {
|
|
33
31
|
if (parent && isListItemNode(parent) && !isListNode(node) && index === 0) {
|
|
34
32
|
count++;
|
|
@@ -17,9 +17,6 @@ const SMART_TO_ASCII = {
|
|
|
17
17
|
// Ignored via go/ees005
|
|
18
18
|
// eslint-disable-next-line require-unicode-regexp
|
|
19
19
|
const FIND_SMART_CHAR = new RegExp(`[${Object.keys(SMART_TO_ASCII).join('')}]`, 'g');
|
|
20
|
-
|
|
21
|
-
// Ignored via go/ees005
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
23
20
|
export function filterChildrenBetween(doc, from, to, predicate) {
|
|
24
21
|
const results = [];
|
|
25
22
|
doc.nodesBetween(from, to, (node, pos, parent) => {
|
|
@@ -80,10 +77,7 @@ export function transformNonTextNodesToText(from, to, tr) {
|
|
|
80
77
|
}
|
|
81
78
|
});
|
|
82
79
|
}
|
|
83
|
-
export const applyMarkOnRange = (from, to, removeMark, mark, tr
|
|
84
|
-
// Ignored via go/ees005
|
|
85
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
86
|
-
) => {
|
|
80
|
+
export const applyMarkOnRange = (from, to, removeMark, mark, tr) => {
|
|
87
81
|
const {
|
|
88
82
|
schema
|
|
89
83
|
} = tr.doc.type;
|
|
@@ -122,10 +116,7 @@ export const applyMarkOnRange = (from, to, removeMark, mark, tr
|
|
|
122
116
|
});
|
|
123
117
|
return tr;
|
|
124
118
|
};
|
|
125
|
-
export const entireSelectionContainsMark = (mark, doc, fromPos, toPos
|
|
126
|
-
// Ignored via go/ees005
|
|
127
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
128
|
-
) => {
|
|
119
|
+
export const entireSelectionContainsMark = (mark, doc, fromPos, toPos) => {
|
|
129
120
|
let onlyContainsMark = true;
|
|
130
121
|
doc.nodesBetween(fromPos, toPos, node => {
|
|
131
122
|
// Skip recursion once we've found text which doesn't include the mark
|
|
@@ -15,8 +15,6 @@ import { DEFAULT_IMAGE_WIDTH, DEFAULT_ROUNDING_INTERVAL, MEDIA_SINGLE_DEFAULT_MI
|
|
|
15
15
|
* @param gutterOffset - resize handle bar offset, determines whether align with resize handle bar
|
|
16
16
|
* @returns pixel number for media single node
|
|
17
17
|
*/
|
|
18
|
-
// Ignored via go/ees005
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
20
18
|
export function getMediaSinglePixelWidth(width, editorWidth, widthType = 'percentage', gutterOffset = 0) {
|
|
21
19
|
if (widthType === 'pixel') {
|
|
22
20
|
return width;
|
|
@@ -106,9 +104,6 @@ export const calcMediaSingleMaxWidth = (containerWidth, editorAppearance) => {
|
|
|
106
104
|
export const getMediaSingleInitialWidth = (origWidth = DEFAULT_IMAGE_WIDTH, maxWidth = akEditorDefaultLayoutWidth, minWidth = MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH) => {
|
|
107
105
|
return Math.max(Math.min(origWidth, maxWidth), minWidth);
|
|
108
106
|
};
|
|
109
|
-
|
|
110
|
-
// Ignored via go/ees005
|
|
111
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
112
107
|
export function calculateOffsetLeft(insideInlineLike, insideLayout, pmViewDom, wrapper) {
|
|
113
108
|
let offsetLeft = 0;
|
|
114
109
|
if (wrapper && insideInlineLike && !insideLayout) {
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export const aiProactiveSettingMessages = defineMessages({
|
|
3
|
+
toggleAllSuggestionsTitle: {
|
|
4
|
+
id: 'fabric.editor.ai.proactive.moreMenu.toggleAllSuggestionsTitle.non-final',
|
|
5
|
+
defaultMessage: 'All suggestions',
|
|
6
|
+
description: 'This is the title displayed in the modal to allow the user to toggle all suggestions on or off'
|
|
7
|
+
},
|
|
8
|
+
toggleAllSuggestionsDescription: {
|
|
9
|
+
id: 'fabric.editor.ai.proactive.moreMenu.toggleAllSuggestionsDescription.non-final',
|
|
10
|
+
defaultMessage: 'Toggle to turn suggested edits on or off',
|
|
11
|
+
description: 'This is the description displayed in the modal to allow the user to toggle all suggestions on or off'
|
|
12
|
+
},
|
|
13
|
+
toggleAllPanelSuggestionsTitle: {
|
|
14
|
+
id: 'fabric.editor.ai.proactive.moreMenu.toggleAllPanelSuggestionsTitle.non-final',
|
|
15
|
+
defaultMessage: 'Panels',
|
|
16
|
+
description: 'This is the title displayed in the modal to allow the user to toggle all suggestions on or off'
|
|
17
|
+
},
|
|
18
|
+
toggleAllPanelSuggestionsDescription: {
|
|
19
|
+
id: 'fabric.editor.ai.proactive.moreMenu.toggleAllPanelSuggestionsDescription.non-final',
|
|
20
|
+
defaultMessage: 'Use panels to make your message stand out',
|
|
21
|
+
description: 'This is the description displayed in the modal to allow the user to toggle all suggestions on or off'
|
|
22
|
+
},
|
|
23
|
+
toggleErrorPanelTitle: {
|
|
24
|
+
id: 'fabric.editor.ai.proactive.moreMenu.toggleErrorPanelTitle.non-final',
|
|
25
|
+
defaultMessage: 'Error panel',
|
|
26
|
+
description: 'This is the title displayed in the modal to allow the user to toggle error panel on or off'
|
|
27
|
+
},
|
|
28
|
+
toggleErrorPanelDescription: {
|
|
29
|
+
id: 'fabric.editor.ai.proactive.moreMenu.toggleErrorPanelDescription.non-final',
|
|
30
|
+
defaultMessage: 'Transform text into a red error panel',
|
|
31
|
+
description: 'This is the description displayed in the modal to allow the user to toggle error panel on or off'
|
|
32
|
+
},
|
|
33
|
+
toggleInfoPanelTitle: {
|
|
34
|
+
id: 'fabric.editor.ai.proactive.moreMenu.toggleInfoPanelTitle.non-final',
|
|
35
|
+
defaultMessage: 'Info panel',
|
|
36
|
+
description: 'This is the title displayed in the modal to allow the user to toggle info panel on or off'
|
|
37
|
+
},
|
|
38
|
+
toggleInfoPanelDescription: {
|
|
39
|
+
id: 'fabric.editor.ai.proactive.moreMenu.toggleInfoPanelDescription.non-final',
|
|
40
|
+
defaultMessage: 'Transform text into a blue information panel',
|
|
41
|
+
description: 'This is the description displayed in the modal to allow the user to toggle info panel on or off'
|
|
42
|
+
},
|
|
43
|
+
toggleNotePanelTitle: {
|
|
44
|
+
id: 'fabric.editor.ai.proactive.moreMenu.toggleNotePanelTitle.non-final',
|
|
45
|
+
defaultMessage: 'Note panel',
|
|
46
|
+
description: 'This is the title displayed in the modal to allow the user to toggle success panel on or off'
|
|
47
|
+
},
|
|
48
|
+
toggleNotePanelDescription: {
|
|
49
|
+
id: 'fabric.editor.ai.proactive.moreMenu.toggleNotePanelDescription.non-final',
|
|
50
|
+
defaultMessage: 'Transform text into a purple note panel',
|
|
51
|
+
description: 'This is the description displayed in the modal to allow the user to toggle success panel on or off'
|
|
52
|
+
},
|
|
53
|
+
toggleSuccessPanelTitle: {
|
|
54
|
+
id: 'fabric.editor.ai.proactive.moreMenu.toggleSuccessPanelTitle.non-final',
|
|
55
|
+
defaultMessage: 'Success panel',
|
|
56
|
+
description: 'This is the title displayed in the modal to allow the user to toggle success panel on or off'
|
|
57
|
+
},
|
|
58
|
+
toggleSuccessPanelDescription: {
|
|
59
|
+
id: 'fabric.editor.ai.proactive.moreMenu.toggleSuccessPanelDescription.non-final',
|
|
60
|
+
defaultMessage: 'Transform text into a green success panel',
|
|
61
|
+
description: 'This is the description displayed in the modal to allow the user to toggle success panel on or off'
|
|
62
|
+
},
|
|
63
|
+
toggleWarningPanelTitle: {
|
|
64
|
+
id: 'fabric.editor.ai.proactive.moreMenu.toggleWarningPanelTitle.non-final',
|
|
65
|
+
defaultMessage: 'Warning panel',
|
|
66
|
+
description: 'This is the title displayed in the modal to allow the user to toggle warning panel on or off'
|
|
67
|
+
},
|
|
68
|
+
toggleWarningPanelDescription: {
|
|
69
|
+
id: 'fabric.editor.ai.proactive.moreMenu.toggleWarningPanelDescription.non-final',
|
|
70
|
+
defaultMessage: 'Transform text into a yellow warning panel',
|
|
71
|
+
description: 'This is the description displayed in the modal to allow the user to toggle warning panel on or off'
|
|
72
|
+
},
|
|
73
|
+
toggleTableTitle: {
|
|
74
|
+
id: 'fabric.editor.ai.proactive.moreMenu.toggleTableTitle.non-final',
|
|
75
|
+
defaultMessage: 'Table',
|
|
76
|
+
description: 'This is the title displayed in the modal to allow the user to toggle table on or off'
|
|
77
|
+
},
|
|
78
|
+
toggleTableDescription: {
|
|
79
|
+
id: 'fabric.editor.ai.proactive.moreMenu.toggleTableDescription.non-final',
|
|
80
|
+
defaultMessage: 'Format content in a table to improve readability',
|
|
81
|
+
description: 'This is the description displayed in the modal to allow the user to toggle table on or off'
|
|
82
|
+
},
|
|
83
|
+
toggleSplitParagraphTitle: {
|
|
84
|
+
id: 'fabric.editor.ai.proactive.moreMenu.toggleSplitParagraphTitle.non-final',
|
|
85
|
+
defaultMessage: 'Paragraph break',
|
|
86
|
+
description: 'This is the title displayed in the modal to allow the user to toggle paragraph break on or off'
|
|
87
|
+
},
|
|
88
|
+
toggleSplitParagraphDescription: {
|
|
89
|
+
id: 'fabric.editor.ai.proactive.moreMenu.toggleSplitParagraphDescription.non-final',
|
|
90
|
+
defaultMessage: 'Add paragraph breaks to separate key ideas',
|
|
91
|
+
description: 'This is the description displayed in the modal to allow the user to toggle paragraph break on or off'
|
|
92
|
+
},
|
|
93
|
+
toggleFormatParagraphTitle: {
|
|
94
|
+
id: 'fabric.editor.ai.proactive.moreMenu.toggleFormatParagraphTitle.non-final',
|
|
95
|
+
defaultMessage: 'Improve paragraph',
|
|
96
|
+
description: 'This is the title displayed in the modal to allow the user to toggle format paragraph on or off'
|
|
97
|
+
},
|
|
98
|
+
toggleFormatParagraphDescription: {
|
|
99
|
+
id: 'fabric.editor.ai.proactive.moreMenu.toggleFormatParagraphDescription.non-final',
|
|
100
|
+
defaultMessage: 'Simplify content and fix spelling and grammar.',
|
|
101
|
+
description: 'This is the description displayed in the modal to allow the user to toggle format paragraph on or off'
|
|
102
|
+
}
|
|
103
|
+
});
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export const aiProactiveTransformMessages = defineMessages({
|
|
3
|
+
recommendationDefaultTitle: {
|
|
4
|
+
id: 'fabric.editor.ai.proactive.recommendation.default.title.non-final',
|
|
5
|
+
defaultMessage: 'Suggestion',
|
|
6
|
+
description: 'The default generic title displayed in the side context panel for AI recommendations which have not explicit matching override'
|
|
7
|
+
},
|
|
8
|
+
recommendationDefaultDescription: {
|
|
9
|
+
id: 'fabric.editor.ai.proactive.recommendation.default.description.non-final',
|
|
10
|
+
defaultMessage: 'A suggestion to improve the content.',
|
|
11
|
+
description: 'The default generic description displayed in the side context panel for AI recommendations which have no explicit matching override'
|
|
12
|
+
},
|
|
13
|
+
recommendationConvertToTableTitle: {
|
|
14
|
+
id: 'fabric.editor.ai.proactive.recommendation.convertToTable.title.non-final',
|
|
15
|
+
defaultMessage: 'Format in table',
|
|
16
|
+
description: 'The title displayed in the side context panel for AI recommendations which suggest a conversion to table operation'
|
|
17
|
+
},
|
|
18
|
+
recommendationConvertToTableDescription: {
|
|
19
|
+
id: 'fabric.editor.ai.proactive.recommendation.convertToTable.description.non-final',
|
|
20
|
+
defaultMessage: 'Format content in a table to improve readability.',
|
|
21
|
+
description: 'The description displayed in the side context panel for AI recommendations which suggest a conversion to table operation'
|
|
22
|
+
},
|
|
23
|
+
recommendationConvertToNotePanelTitle: {
|
|
24
|
+
id: 'fabric.editor.ai.proactive.recommendation.convertToNotePanel.title.non-final',
|
|
25
|
+
defaultMessage: 'Frame with note panel',
|
|
26
|
+
description: 'The title displayed in the side context panel for AI recommendations which suggest a conversion to note panel operation'
|
|
27
|
+
},
|
|
28
|
+
recommendationConvertToNotePanelDescription: {
|
|
29
|
+
id: 'fabric.editor.ai.proactive.recommendation.convertToNotePanel.description.non-final',
|
|
30
|
+
defaultMessage: 'Use a purple note panel to make your message stand out.',
|
|
31
|
+
description: 'The description displayed in the side context panel for AI recommendations which suggest a conversion to note panel operation'
|
|
32
|
+
},
|
|
33
|
+
recommendationConvertToInfoPanelTitle: {
|
|
34
|
+
id: 'fabric.editor.ai.proactive.recommendation.convertToInfoPanel.title.non-final',
|
|
35
|
+
defaultMessage: 'Frame with info panel',
|
|
36
|
+
description: 'The title displayed in the side context panel for AI recommendations which suggest a conversion to note panel operation'
|
|
37
|
+
},
|
|
38
|
+
recommendationConvertToInfoPanelDescription: {
|
|
39
|
+
id: 'fabric.editor.ai.proactive.recommendation.convertToInfoPanel.description.non-final',
|
|
40
|
+
defaultMessage: 'Use a blue info panel to make your message stand out. ',
|
|
41
|
+
description: 'The description displayed in the side context panel for AI recommendations which suggest a conversion to info panel operation'
|
|
42
|
+
},
|
|
43
|
+
recommendationConvertToWarnPanelTitle: {
|
|
44
|
+
id: 'fabric.editor.ai.proactive.recommendation.convertToWarnPanel.title.non-final',
|
|
45
|
+
defaultMessage: 'Frame with warning panel',
|
|
46
|
+
description: 'The title displayed in the side context panel for AI recommendations which suggest a conversion to warning panel operation'
|
|
47
|
+
},
|
|
48
|
+
recommendationConvertToWarnPanelDescription: {
|
|
49
|
+
id: 'fabric.editor.ai.proactive.recommendation.convertToWarnPanel.description.non-final',
|
|
50
|
+
defaultMessage: 'Use a yellow warning panel to make your message stand out.',
|
|
51
|
+
description: 'The description displayed in the side context panel for AI recommendations which suggest a conversion to warning panel operation'
|
|
52
|
+
},
|
|
53
|
+
recommendationConvertToErrorPanelTitle: {
|
|
54
|
+
id: 'fabric.editor.ai.proactive.recommendation.convertToErrorPanel.title.non-final',
|
|
55
|
+
defaultMessage: 'Frame with error panel',
|
|
56
|
+
description: 'The title displayed in the side context panel for AI recommendations which suggest a conversion to error panel operation'
|
|
57
|
+
},
|
|
58
|
+
recommendationConvertToErrorPanelDescription: {
|
|
59
|
+
id: 'fabric.editor.ai.proactive.recommendation.convertToErrorPanel.description.non-final',
|
|
60
|
+
defaultMessage: 'Use a red error panel to make your message stand out.',
|
|
61
|
+
description: 'The description displayed in the side context panel for AI recommendations which suggest a conversion to error panel operation'
|
|
62
|
+
},
|
|
63
|
+
recommendationConvertToSuccessPanelTitle: {
|
|
64
|
+
id: 'fabric.editor.ai.proactive.recommendation.convertToSuccessPanel.title.non-final',
|
|
65
|
+
defaultMessage: 'Frame with success panel',
|
|
66
|
+
description: 'The title displayed in the side context panel for AI recommendations which suggest a conversion to success panel operation'
|
|
67
|
+
},
|
|
68
|
+
recommendationConvertToSuccessPanelDescription: {
|
|
69
|
+
id: 'fabric.editor.ai.proactive.recommendation.convertToSuccessPanel.description.non-final',
|
|
70
|
+
defaultMessage: 'Use a green success panel to make your message stand out.',
|
|
71
|
+
description: 'The description displayed in the side context panel for AI recommendations which suggest a conversion to success panel operation'
|
|
72
|
+
},
|
|
73
|
+
recommendationSplitParagraphTitle: {
|
|
74
|
+
id: 'fabric.editor.ai.proactive.recommendation.splitParagraph.title.non-final',
|
|
75
|
+
defaultMessage: 'Divide paragraph',
|
|
76
|
+
description: 'The title displayed in the side context panel for AI recommendations which suggest a split paragraph operation'
|
|
77
|
+
},
|
|
78
|
+
recommendationSplitParagraphDescription: {
|
|
79
|
+
id: 'fabric.editor.ai.proactive.recommendation.splitParagraph.description.non-final',
|
|
80
|
+
defaultMessage: 'Add paragraph breaks to separate key ideas.',
|
|
81
|
+
description: 'The description displayed in the side context panel for AI recommendations which suggest a split paragraph operation'
|
|
82
|
+
},
|
|
83
|
+
recommendationFormatParagraphTitle: {
|
|
84
|
+
id: 'fabric.editor.ai.proactive.recommendation.formatParagraph.title.non-final',
|
|
85
|
+
defaultMessage: 'Improve paragraph',
|
|
86
|
+
description: 'The title displayed in the side context panel for AI recommendations which suggest a format paragraph operation'
|
|
87
|
+
},
|
|
88
|
+
recommendationFormatParagraphDescription: {
|
|
89
|
+
id: 'fabric.editor.ai.proactive.recommendation.formatParagraph.description.non-final',
|
|
90
|
+
defaultMessage: 'Simplify content and fix spelling and grammar.',
|
|
91
|
+
description: 'The description displayed in the side context panel for AI recommendations which suggest a format paragraph operation'
|
|
92
|
+
}
|
|
93
|
+
});
|
|
@@ -4,5 +4,150 @@ export const aiProactiveMessages = defineMessages({
|
|
|
4
4
|
id: 'fabric.editor.ai.proactive.loading.iconAltText.non-final',
|
|
5
5
|
defaultMessage: 'Loading icon',
|
|
6
6
|
description: 'Icon alt text of the Loading icon'
|
|
7
|
+
},
|
|
8
|
+
findingSuggestionsLabel: {
|
|
9
|
+
id: 'fabric.editor.ai.proactive.findingSuggestionsLabel.non-final',
|
|
10
|
+
defaultMessage: 'Finding suggestions',
|
|
11
|
+
description: 'The label next to the spinner which indicates recommendations are being requested.'
|
|
12
|
+
},
|
|
13
|
+
findingSuggestionsLoadingLabel: {
|
|
14
|
+
id: 'fabric.editor.ai.proactive.findingSuggestionsLoadingLabel.non-final',
|
|
15
|
+
defaultMessage: 'Finding suggestions',
|
|
16
|
+
description: 'This is the label under the loading spinner when suggestions are being reloaded.'
|
|
17
|
+
},
|
|
18
|
+
findingMoreSuggestionsLoadingLabel: {
|
|
19
|
+
id: 'fabric.editor.ai.proactive.findingMoreSuggestionsLoadingLabel.non-final',
|
|
20
|
+
defaultMessage: 'Finding more suggestions',
|
|
21
|
+
description: 'The label next to the spinner which indicates more recommendations are being requested.'
|
|
22
|
+
},
|
|
23
|
+
unhandledErrorMessage: {
|
|
24
|
+
id: 'fabric.editor.ai.proactive.error.unhandledErrorMessage',
|
|
25
|
+
defaultMessage: "We're having trouble. Close the dialog and try again.",
|
|
26
|
+
description: 'Message to users that displays when an unexpected error happens'
|
|
27
|
+
},
|
|
28
|
+
markdownErrorMessage: {
|
|
29
|
+
id: 'fabric.editor.ai.proactive.error.markdownErrorMessage',
|
|
30
|
+
defaultMessage: "We're having trouble generating the preview. Close the dialog and try again.",
|
|
31
|
+
description: 'Message to users that displays when an error occurs while generating a preview.'
|
|
32
|
+
},
|
|
33
|
+
recommendationPreviewButtonLabel: {
|
|
34
|
+
id: 'fabric.editor.ai.proactive.recommendation.preview.button.non-final',
|
|
35
|
+
defaultMessage: 'Preview',
|
|
36
|
+
description: 'The preview button label which allows the user to open the preview modal and see the AI recommendation which will be applied when the user inserts'
|
|
37
|
+
},
|
|
38
|
+
recommendationReplaceButtonLabel: {
|
|
39
|
+
id: 'fabric.editor.ai.proactive.recommendation.replace.button.non-final',
|
|
40
|
+
defaultMessage: 'Replace',
|
|
41
|
+
description: 'The replace button label, when clicked the AI recommendation which immediately be inserted'
|
|
42
|
+
},
|
|
43
|
+
recommendationDismissButtonLabel: {
|
|
44
|
+
id: 'fabric.editor.ai.proactive.recommendation.dismiss.button.non-final',
|
|
45
|
+
defaultMessage: 'Dismiss',
|
|
46
|
+
description: 'The dismiss button label,when clicked the AI recommendation will be removed from the list and no longer displayed to the user'
|
|
47
|
+
},
|
|
48
|
+
dismissProactiveRecommendation: {
|
|
49
|
+
id: 'fabric.editor.ai.proactive.preview.dismissProactiveRecommendation.non-final',
|
|
50
|
+
defaultMessage: 'Dismiss',
|
|
51
|
+
description: 'Label for button to dismiss the proactive recommendation'
|
|
52
|
+
},
|
|
53
|
+
insertBelowProactiveRecommendation: {
|
|
54
|
+
id: 'fabric.editor.ai.proactive.preview.insertBelowProactiveRecommendation',
|
|
55
|
+
defaultMessage: 'Insert below',
|
|
56
|
+
description: 'Label for button to insert the proactive recommendation below the user selection'
|
|
57
|
+
},
|
|
58
|
+
replaceProactiveRecommendation: {
|
|
59
|
+
id: 'fabric.editor.ai.proactive.preview.replaceProactiveRecommendation',
|
|
60
|
+
defaultMessage: 'Replace',
|
|
61
|
+
description: 'Label for button to replace selection with proactive recommendation'
|
|
62
|
+
},
|
|
63
|
+
spellingAndGrammarLabel: {
|
|
64
|
+
id: 'fabric.editor.ai.proactive.spellingAndGrammar.label.non-final',
|
|
65
|
+
defaultMessage: 'Spelling and grammar',
|
|
66
|
+
description: 'The label displayed in the context panel on the spelling and grammar item which display the total spelling and grammar issues found'
|
|
67
|
+
},
|
|
68
|
+
ManageSuggestionTitle: {
|
|
69
|
+
id: 'fabric.editor.ai.proactive.moreMenu.manageSuggestionsTitle.non-final',
|
|
70
|
+
defaultMessage: 'Manage suggestions',
|
|
71
|
+
description: 'This is the message displayed in the more menu dropdown in the context panel to allow the user to manage suggestions on the suggestions'
|
|
72
|
+
},
|
|
73
|
+
closeButtonLabel: {
|
|
74
|
+
id: 'fabric.editor.ai.proactive.close.label.non-final',
|
|
75
|
+
defaultMessage: 'Close',
|
|
76
|
+
description: 'This is the text applied to the Close icon button label'
|
|
77
|
+
},
|
|
78
|
+
suggestionsTitle: {
|
|
79
|
+
id: 'fabric.editor.ai.proactive.suggestions.title.non-final',
|
|
80
|
+
defaultMessage: 'Suggestions',
|
|
81
|
+
description: 'The title displayed at the top of the context panel for all recommendations displayed'
|
|
82
|
+
},
|
|
83
|
+
betaLabel: {
|
|
84
|
+
id: 'fabric.editor.ai.proactive.beta.label.non-final',
|
|
85
|
+
defaultMessage: 'BETA',
|
|
86
|
+
description: 'This is a lozenge displayed in the suggested edits header to signify that this is a beta feature'
|
|
87
|
+
},
|
|
88
|
+
moreMenuLabel: {
|
|
89
|
+
id: 'fabric.editor.ai.proactive.moreMenu.label.non-final',
|
|
90
|
+
defaultMessage: 'more',
|
|
91
|
+
description: 'This is the message displayed tooltip in the more menu dropdown in the context panel'
|
|
92
|
+
},
|
|
93
|
+
moreMenuManageSuggestions: {
|
|
94
|
+
id: 'fabric.editor.ai.proactive.moreMenu.manageSuggestions.non-final',
|
|
95
|
+
defaultMessage: 'Manage Suggestions',
|
|
96
|
+
description: 'This is the message displayed in the more menu dropdown in the context panel to allow the user to manage suggestions on the suggestions'
|
|
97
|
+
},
|
|
98
|
+
moreMenuGiveFeedback: {
|
|
99
|
+
id: 'fabric.editor.ai.proactive.moreMenu.giveFeedback.non-final',
|
|
100
|
+
defaultMessage: 'Give feedback',
|
|
101
|
+
description: 'This is the message displayed in the more menu dropdown in the context panel to allow the user to give feedback on the suggestions'
|
|
102
|
+
},
|
|
103
|
+
moreActionsLabel: {
|
|
104
|
+
id: 'fabric.editor.ai.proactive.moreActions.label.non-final',
|
|
105
|
+
defaultMessage: 'More actions',
|
|
106
|
+
description: 'This is the text applied to the More icon button label'
|
|
107
|
+
},
|
|
108
|
+
reloadSuggestionsStateTitle: {
|
|
109
|
+
id: 'fabric.editor.ai.proactive.reloadSuggestionsState.title.non-final',
|
|
110
|
+
defaultMessage: 'Your content’s looking good',
|
|
111
|
+
description: 'This is the title of the message displayed in the suggested edits panel when there are new recommendations left after a user has dismissed them all.'
|
|
112
|
+
},
|
|
113
|
+
reloadSuggestionsStateDescription: {
|
|
114
|
+
id: 'fabric.editor.ai.proactive.reloadSuggestionsState.description.non-final',
|
|
115
|
+
defaultMessage: 'Any new suggestions will appear here.',
|
|
116
|
+
description: 'This is the message displayed in the suggested edits panel when there are no new recommendations left after a user has dismissed them all.'
|
|
117
|
+
},
|
|
118
|
+
reloadSuggestionsButtonLabel: {
|
|
119
|
+
id: 'fabric.editor.ai.proactive.reloadSuggestionsButtonLabel.non-final',
|
|
120
|
+
defaultMessage: 'View past suggestions',
|
|
121
|
+
description: 'This is the button label to reload suggestions when a user has dismised all recommendations.'
|
|
122
|
+
},
|
|
123
|
+
noSuggestionsStateTitle: {
|
|
124
|
+
id: 'fabric.editor.ai.proactive.noSuggestionsState.title.non-final',
|
|
125
|
+
defaultMessage: 'Suggestions will appear here',
|
|
126
|
+
description: 'This is the title of the message displayed in the suggested edits panel when there are no recommendations available.'
|
|
127
|
+
},
|
|
128
|
+
noSuggestionsStateDescription: {
|
|
129
|
+
id: 'fabric.editor.ai.proactive.noSuggestionsState.description.non-final',
|
|
130
|
+
defaultMessage: 'You can also ask AI to improve your page with requests such as <i>Add a table of contents</i> or <i>Create headings</i>.',
|
|
131
|
+
description: 'This is the message displayed in the suggested edits panel when there are no recommendations available'
|
|
132
|
+
},
|
|
133
|
+
askAIButtonLabel: {
|
|
134
|
+
id: 'fabric.editor.ai.proactive.askAIButtonLabel.non-final',
|
|
135
|
+
defaultMessage: 'Ask AI',
|
|
136
|
+
description: 'This is the button label to open the AI modal.'
|
|
137
|
+
},
|
|
138
|
+
enableSuggestionsStateTitle: {
|
|
139
|
+
id: 'fabric.editor.ai.proactive.enableSuggestionsState.title.non-final',
|
|
140
|
+
defaultMessage: 'You create. We polish.',
|
|
141
|
+
description: 'This is the title of the message displayed in the suggested edits panel when suggestions are disabled.'
|
|
142
|
+
},
|
|
143
|
+
enableSuggestionsStateDescription: {
|
|
144
|
+
id: 'fabric.editor.ai.proactive.enableSuggestionsState.description.non-final',
|
|
145
|
+
defaultMessage: 'Turn on suggested edits to quickly preview content improvements.',
|
|
146
|
+
description: 'This is the message displayed in the suggested edits panel when suggestions are disabled.'
|
|
147
|
+
},
|
|
148
|
+
enableSuggestionsButtonLabel: {
|
|
149
|
+
id: 'fabric.editor.ai.proactive.enableSuggestionsButtonLabel.non-final',
|
|
150
|
+
defaultMessage: 'Turn on',
|
|
151
|
+
description: 'This is the button label in the suggested edits panel when suggestions are disabled.'
|
|
7
152
|
}
|
|
8
153
|
});
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
import { defineMessages } from 'react-intl-next';
|
|
5
5
|
export { aiDefinitionsMessages } from './ai-definitions';
|
|
6
6
|
export { aiProactiveMessages } from './ai-proactive';
|
|
7
|
+
export { aiProactiveSettingMessages } from './ai-proactive-setting';
|
|
8
|
+
export { aiProactiveTransformMessages } from './ai-proactive-transform';
|
|
7
9
|
export { alignmentMessages } from './alignment';
|
|
8
10
|
export { annotationMessages } from './annotation';
|
|
9
11
|
export { messages as blockTypeMessages } from './block-type';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isFedRamp } from './environment';
|
|
2
2
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
3
3
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
4
|
-
const packageVersion = "99.5.
|
|
4
|
+
const packageVersion = "99.5.2";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -17,10 +17,7 @@ export const layoutToWidth = {
|
|
|
17
17
|
* Calculates width of parent node of a nested node (inside layouts, extension)
|
|
18
18
|
* If current node selection is not nested will return undefined
|
|
19
19
|
*/
|
|
20
|
-
export const getParentNodeWidth = (pos, state, containerWidth, isFullWidthModeEnabled
|
|
21
|
-
// Ignored via go/ees005
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
23
|
-
) => {
|
|
20
|
+
export const getParentNodeWidth = (pos, state, containerWidth, isFullWidthModeEnabled) => {
|
|
24
21
|
if (!pos) {
|
|
25
22
|
return;
|
|
26
23
|
}
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
* prosemirror-markdown cannot conform to the schema
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
// Ignored via go/ees005
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
11
9
|
function handleHeadingOpen(state, token, acc, index) {
|
|
12
10
|
var _state$tokens;
|
|
13
11
|
const isInListItem = ((_state$tokens = state.tokens[index - 1]) === null || _state$tokens === void 0 ? void 0 : _state$tokens.type) === 'list_item_open';
|
|
@@ -17,9 +15,6 @@ function handleHeadingOpen(state, token, acc, index) {
|
|
|
17
15
|
acc.push(token);
|
|
18
16
|
}
|
|
19
17
|
}
|
|
20
|
-
|
|
21
|
-
// Ignored via go/ees005
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
23
18
|
function handleHeadingClose(state, token, acc, index) {
|
|
24
19
|
var _state$tokens2;
|
|
25
20
|
const isInListItem = ((_state$tokens2 = state.tokens[index + 1]) === null || _state$tokens2 === void 0 ? void 0 : _state$tokens2.type) === 'list_item_close';
|
|
@@ -34,8 +34,7 @@ function createThrottleSchedule(callback) {
|
|
|
34
34
|
}
|
|
35
35
|
export const scheduleDocumentRequest = createThrottleSchedule(returnDocumentRequest);
|
|
36
36
|
|
|
37
|
-
//
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/max-params
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
38
|
function returnDocumentRequest(editorView, callback, transformer, fireAnalyticsEvent) {
|
|
40
39
|
var _editorView$state;
|
|
41
40
|
const {
|
|
@@ -12,8 +12,6 @@ import { analyticsEventKey } from '../utils/analytics';
|
|
|
12
12
|
import { generateUniqueNodeKey } from './generateUniqueNodeKey';
|
|
13
13
|
export { getInlineNodeViewProducer, inlineNodeViewClassname } from './getInlineNodeViewProducer';
|
|
14
14
|
export default class ReactNodeView {
|
|
15
|
-
// Ignored via go/ees005
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
17
15
|
constructor(_node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps,
|
|
18
16
|
// Ignored via go/ees005
|
|
19
17
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -183,9 +181,6 @@ export default class ReactNodeView {
|
|
|
183
181
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
184
182
|
}, props)) : null;
|
|
185
183
|
}
|
|
186
|
-
|
|
187
|
-
// Ignored via go/ees005
|
|
188
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
189
184
|
update(node, decorations, _innerDecorations, validUpdate = () => true) {
|
|
190
185
|
// @see https://github.com/ProseMirror/prosemirror/issues/648
|
|
191
186
|
const isValidUpdate = this.node.type === node.type && validUpdate(this.node, node);
|
|
@@ -237,8 +232,6 @@ export default class ReactNodeView {
|
|
|
237
232
|
this.domRef = undefined;
|
|
238
233
|
this.contentDOM = undefined;
|
|
239
234
|
}
|
|
240
|
-
// Ignored via go/ees005
|
|
241
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
242
235
|
static fromComponent(
|
|
243
236
|
// Ignored via go/ees005
|
|
244
237
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|