@atlaskit/editor-common 130.0.0 → 130.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/collab-agent-edit-chrome-ranges/package.json +10 -0
- package/dist/cjs/collab/agent-edit-changed-ranges.js +5 -288
- package/dist/cjs/collab/agent-edit-chrome-ranges.js +15 -0
- package/dist/cjs/collab/agent-edit-range-mapping.js +553 -0
- package/dist/cjs/messages/snippets.js +1 -1
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/quick-insert/CompactQuickInsertMenuItem.compiled.css +3 -0
- package/dist/cjs/quick-insert/CompactQuickInsertMenuItem.js +17 -2
- package/dist/cjs/quick-insert/ElementBrowserQuickInsertMenuItem.compiled.css +3 -1
- package/dist/cjs/quick-insert/ElementBrowserQuickInsertMenuItem.js +17 -6
- package/dist/cjs/quick-insert/get-matching-quick-insert-components.js +20 -10
- package/dist/cjs/quick-insert/messages.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/collab/agent-edit-changed-ranges.js +5 -244
- package/dist/es2019/collab/agent-edit-chrome-ranges.js +10 -0
- package/dist/es2019/collab/agent-edit-range-mapping.js +463 -0
- package/dist/es2019/messages/snippets.js +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/quick-insert/CompactQuickInsertMenuItem.compiled.css +3 -0
- package/dist/es2019/quick-insert/CompactQuickInsertMenuItem.js +17 -2
- package/dist/es2019/quick-insert/ElementBrowserQuickInsertMenuItem.compiled.css +3 -1
- package/dist/es2019/quick-insert/ElementBrowserQuickInsertMenuItem.js +17 -6
- package/dist/es2019/quick-insert/get-matching-quick-insert-components.js +16 -6
- package/dist/es2019/quick-insert/messages.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/collab/agent-edit-changed-ranges.js +5 -286
- package/dist/esm/collab/agent-edit-chrome-ranges.js +10 -0
- package/dist/esm/collab/agent-edit-range-mapping.js +546 -0
- package/dist/esm/messages/snippets.js +1 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/quick-insert/CompactQuickInsertMenuItem.compiled.css +3 -0
- package/dist/esm/quick-insert/CompactQuickInsertMenuItem.js +17 -2
- package/dist/esm/quick-insert/ElementBrowserQuickInsertMenuItem.compiled.css +3 -1
- package/dist/esm/quick-insert/ElementBrowserQuickInsertMenuItem.js +17 -6
- package/dist/esm/quick-insert/get-matching-quick-insert-components.js +20 -10
- package/dist/esm/quick-insert/messages.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/card/cardOptions.d.ts +5 -0
- package/dist/types/collab/agent-edit-changed-ranges.d.ts +4 -1
- package/dist/types/collab/agent-edit-chrome-ranges.d.ts +8 -0
- package/dist/types/collab/agent-edit-range-mapping.d.ts +7 -0
- package/dist/types/quick-insert/CompactQuickInsertMenuItem.d.ts +4 -0
- package/package.json +4 -4
|
@@ -40,7 +40,7 @@ var getSearchResults = function getSearchResults(matches) {
|
|
|
40
40
|
* no empty-query path so browse behavior remains owned by buildQuickInsertMenuModel.
|
|
41
41
|
*/
|
|
42
42
|
export var getMatchingQuickInsertComponents = function getMatchingQuickInsertComponents(_ref4) {
|
|
43
|
-
var _childrenMap$
|
|
43
|
+
var _childrenMap$get;
|
|
44
44
|
var components = _ref4.components,
|
|
45
45
|
rootComponent = _ref4.rootComponent,
|
|
46
46
|
query = _ref4.query,
|
|
@@ -132,7 +132,9 @@ export var getMatchingQuickInsertComponents = function getMatchingQuickInsertCom
|
|
|
132
132
|
_iterator2.f();
|
|
133
133
|
}
|
|
134
134
|
var sections = Array.from(sectionsByKey.values());
|
|
135
|
-
|
|
135
|
+
// An empty query is browse mode: `buildQuickInsertMenuModel` supplies the footer there,
|
|
136
|
+
// so this search model must not add a second one.
|
|
137
|
+
if (query === '') {
|
|
136
138
|
return {
|
|
137
139
|
footer: undefined,
|
|
138
140
|
root: root,
|
|
@@ -140,21 +142,29 @@ export var getMatchingQuickInsertComponents = function getMatchingQuickInsertCom
|
|
|
140
142
|
sections: sections
|
|
141
143
|
};
|
|
142
144
|
}
|
|
145
|
+
var footerSection = topLevelChildren.find(function (section) {
|
|
146
|
+
return section.type === 'menu-section' && isMenuFooterSectionKey(section.key) && willComponentRender(section, childrenMap, surfaceContext);
|
|
147
|
+
});
|
|
148
|
+
var footer = footerSection ? ((_childrenMap$get = childrenMap.get(getComponentIdentity(footerSection))) !== null && _childrenMap$get !== void 0 ? _childrenMap$get : []).find(function (child) {
|
|
149
|
+
return child.type === 'menu-item' && willComponentRender(child, childrenMap, surfaceContext);
|
|
150
|
+
}) : undefined;
|
|
151
|
+
if (sections.length > 0) {
|
|
152
|
+
return {
|
|
153
|
+
footer: footer,
|
|
154
|
+
root: root,
|
|
155
|
+
searchResults: searchResults,
|
|
156
|
+
sections: sections
|
|
157
|
+
};
|
|
158
|
+
}
|
|
143
159
|
var fallbackItem = topLevelChildren.filter(function (section) {
|
|
144
160
|
return section.type === 'menu-section' && !isMenuFooterSectionKey(section.key) && willComponentRender(section, childrenMap, surfaceContext);
|
|
145
161
|
}).flatMap(function (section) {
|
|
146
|
-
var _childrenMap$
|
|
147
|
-
return (_childrenMap$
|
|
162
|
+
var _childrenMap$get2;
|
|
163
|
+
return (_childrenMap$get2 = childrenMap.get(getComponentIdentity(section))) !== null && _childrenMap$get2 !== void 0 ? _childrenMap$get2 : [];
|
|
148
164
|
}).find(function (component) {
|
|
149
165
|
return component.type === ASK_ROVO_MENU_ITEM.type && component.key === ASK_ROVO_MENU_ITEM.key && willComponentRender(component, childrenMap, surfaceContext);
|
|
150
166
|
});
|
|
151
167
|
var fallbackItems = fallbackItem ? [fallbackItem] : [];
|
|
152
|
-
var footerSection = topLevelChildren.find(function (section) {
|
|
153
|
-
return section.type === 'menu-section' && isMenuFooterSectionKey(section.key) && willComponentRender(section, childrenMap, surfaceContext);
|
|
154
|
-
});
|
|
155
|
-
var footer = footerSection ? ((_childrenMap$get2 = childrenMap.get(getComponentIdentity(footerSection))) !== null && _childrenMap$get2 !== void 0 ? _childrenMap$get2 : []).find(function (child) {
|
|
156
|
-
return child.type === 'menu-item' && willComponentRender(child, childrenMap, surfaceContext);
|
|
157
|
-
}) : undefined;
|
|
158
168
|
return {
|
|
159
169
|
fallbackItems: fallbackItems,
|
|
160
170
|
footer: footer,
|
|
@@ -132,7 +132,7 @@ export var messages = defineMessages({
|
|
|
132
132
|
},
|
|
133
133
|
categoryOther: {
|
|
134
134
|
id: 'editor-common.quick-insert.categoryOther',
|
|
135
|
-
defaultMessage: 'Other',
|
|
135
|
+
defaultMessage: 'Other elements',
|
|
136
136
|
description: 'Other items in the Quick Insert menu.'
|
|
137
137
|
},
|
|
138
138
|
previewAttributionBy: {
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "
|
|
24
|
+
var packageVersion = "130.2.0";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -57,6 +57,11 @@ export interface CardOptions {
|
|
|
57
57
|
* Component: embed
|
|
58
58
|
*/
|
|
59
59
|
allowWrapping?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Boolean configuration options for experimental Smart Link features.
|
|
62
|
+
* Omitted keys preserve each feature's default behavior.
|
|
63
|
+
*/
|
|
64
|
+
experimentalConfigurationOptions?: Record<string, boolean>;
|
|
60
65
|
/**
|
|
61
66
|
* A flag to determine whether page is SSRed. Directly render card if page is SSRed
|
|
62
67
|
* with resolved data and skip lazy load process.
|
|
@@ -8,5 +8,8 @@ import type { AgentEditChromeRange } from './agent-edit-chrome';
|
|
|
8
8
|
* Comparing each step's snapshots also handles attribute/mark steps with empty maps.
|
|
9
9
|
* Shared unchanged subtrees are skipped by reference. Only localId changes are ignored;
|
|
10
10
|
* meaningful attributes and marks retain the affected node's full content scope.
|
|
11
|
+
* Callers can require unique source IDs when preserving ranges across replacements.
|
|
11
12
|
*/
|
|
12
|
-
export declare function getAgentEditChangedRanges(tr: Transaction, includedStepIndexes: readonly number[]
|
|
13
|
+
export declare function getAgentEditChangedRanges(tr: Transaction, includedStepIndexes: readonly number[], options?: {
|
|
14
|
+
requireUniqueSourceIds?: boolean;
|
|
15
|
+
}): AgentEditChromeRange[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AgentEditChromeRange } from './agent-edit-chrome';
|
|
2
|
+
import type { AgentEditRangeTransaction } from './agent-edit-range-mapping';
|
|
3
|
+
/**
|
|
4
|
+
* Maps existing textblock activity through each applied step into tr.doc coordinates.
|
|
5
|
+
* Replaced content is dropped unless an unchanged block survives with a unique ID
|
|
6
|
+
* or in the same structural slot. Newly changed blocks belong to the producer.
|
|
7
|
+
*/
|
|
8
|
+
export declare function mapAgentEditChromeRanges(tr: AgentEditRangeTransaction, ranges: readonly AgentEditChromeRange[]): AgentEditChromeRange[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { AgentEditChromeRange } from './agent-edit-chrome';
|
|
3
|
+
export type AgentEditRangeTransaction = Pick<Transaction, 'before' | 'doc' | 'docs' | 'steps' | 'mapping'>;
|
|
4
|
+
export declare const agentEditRangeMapping: {
|
|
5
|
+
getChangedRanges: (tr: AgentEditRangeTransaction, includedStepIndexes: readonly number[], requireUniqueSourceIds: boolean) => AgentEditChromeRange[];
|
|
6
|
+
mapChromeRanges: (tr: AgentEditRangeTransaction, ranges: readonly AgentEditChromeRange[]) => AgentEditChromeRange[];
|
|
7
|
+
};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
1
5
|
import React from 'react';
|
|
2
6
|
import type { QuickInsertMenuItemProps } from './QuickInsertMenuItem';
|
|
3
7
|
export declare const CompactQuickInsertMenuItem: ({ ariaLabel, description, iconBefore, isDisabled, onSelect, preview, previewIcon, previewImageUrls, shortcut, titleContent, shouldShowPreview, shouldClampPreview, shouldWrapIcon, title, }: QuickInsertMenuItemProps) => React.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "130.
|
|
3
|
+
"version": "130.2.0",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@atlaskit/editor-json-transformer": "^10.0.0",
|
|
46
46
|
"@atlaskit/editor-palette": "^3.5.0",
|
|
47
47
|
"@atlaskit/editor-prosemirror": "^9.0.0",
|
|
48
|
-
"@atlaskit/editor-shared-styles": "^4.
|
|
48
|
+
"@atlaskit/editor-shared-styles": "^4.4.0",
|
|
49
49
|
"@atlaskit/editor-tables": "^3.2.0",
|
|
50
50
|
"@atlaskit/editor-toolbar": "^2.8.0",
|
|
51
51
|
"@atlaskit/editor-toolbar-model": "^1.2.0",
|
|
@@ -80,12 +80,12 @@
|
|
|
80
80
|
"@atlaskit/react-ufo": "^8.1.0",
|
|
81
81
|
"@atlaskit/section-message": "^10.2.0",
|
|
82
82
|
"@atlaskit/smart-card": "^46.5.0",
|
|
83
|
-
"@atlaskit/smart-user-picker": "^12.
|
|
83
|
+
"@atlaskit/smart-user-picker": "^12.4.0",
|
|
84
84
|
"@atlaskit/spinner": "^20.4.0",
|
|
85
85
|
"@atlaskit/task-decision": "^21.12.0",
|
|
86
86
|
"@atlaskit/teams-app-config": "^3.1.0",
|
|
87
87
|
"@atlaskit/textfield": "^10.2.0",
|
|
88
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
88
|
+
"@atlaskit/tmp-editor-statsig": "^228.0.0",
|
|
89
89
|
"@atlaskit/tokens": "^20.4.0",
|
|
90
90
|
"@atlaskit/tooltip": "^24.4.0",
|
|
91
91
|
"@atlaskit/width-detector": "^7.2.0",
|