@atlaskit/editor-common 115.10.2 → 115.12.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 +36 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Popup/utils.js +31 -2
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Popup/utils.js +31 -2
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Popup/utils.js +31 -2
- package/dist/types/analytics/index.d.ts +1 -1
- package/dist/types/analytics/types/ai-suggestions-events.d.ts +6 -1
- package/dist/types/ui/Popup/utils.d.ts +23 -1
- package/dist/types-ts4.5/analytics/index.d.ts +1 -1
- package/dist/types-ts4.5/analytics/types/ai-suggestions-events.d.ts +6 -1
- package/dist/types-ts4.5/ui/Popup/utils.d.ts +23 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 115.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`a812261b9c644`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a812261b9c644) -
|
|
8
|
+
Added analytics for clicking Suggested Edits entry points
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- [`8430991dd8eb6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8430991dd8eb6) -
|
|
13
|
+
follow up pr to add affectedBlocks as an attribute to discard analytics
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
16
|
+
## 115.11.2
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
22
|
+
## 115.11.1
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
|
|
28
|
+
## 115.11.0
|
|
29
|
+
|
|
30
|
+
### Minor Changes
|
|
31
|
+
|
|
32
|
+
- [`1dc602ab5b6ec`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1dc602ab5b6ec) -
|
|
33
|
+
Bug Fix for pop up rendering on the bottom instead of top of pop up modal
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- Updated dependencies
|
|
38
|
+
|
|
3
39
|
## 115.10.2
|
|
4
40
|
|
|
5
41
|
### Patch Changes
|
|
@@ -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 _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); 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 = "115.
|
|
22
|
+
var packageVersion = "115.11.2";
|
|
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 = "115.
|
|
27
|
+
var packageVersion = "115.11.2";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -35,7 +35,16 @@ var _validatePosition = require("./validatePosition");
|
|
|
35
35
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
36
36
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
37
37
|
/**
|
|
38
|
+
* Determines the optimal vertical placement ('top' or 'bottom') for a popup relative to a target element.
|
|
38
39
|
* Decides if given fitHeight fits below or above the target taking boundaries into account.
|
|
40
|
+
*
|
|
41
|
+
* @param target - The target element to position the popup relative to
|
|
42
|
+
* @param boundariesElement - The boundaries element that constrains the popup positioning
|
|
43
|
+
* @param fitHeight - The desired height of the popup content
|
|
44
|
+
* @param alignY - Forced alignment direction ('top' or 'bottom')
|
|
45
|
+
* @param forcePlacement - Whether to force the placement to the alignY value
|
|
46
|
+
* @param preventOverflow - Whether to prevent overflow by forcing bottom placement when space above is insufficient
|
|
47
|
+
* @returns The optimal placement direction ('top' or 'bottom')
|
|
39
48
|
*/
|
|
40
49
|
function getVerticalPlacement(target, boundariesElement, fitHeight, alignY, forcePlacement, preventOverflow) {
|
|
41
50
|
if (forcePlacement && alignY) {
|
|
@@ -64,10 +73,16 @@ function getVerticalPlacement(target, boundariesElement, fitHeight, alignY, forc
|
|
|
64
73
|
return 'bottom';
|
|
65
74
|
}
|
|
66
75
|
}
|
|
67
|
-
if (spaceBelow >= fitHeight
|
|
76
|
+
if (spaceBelow >= fitHeight) {
|
|
68
77
|
return 'bottom';
|
|
69
78
|
}
|
|
70
|
-
|
|
79
|
+
if (spaceAbove >= fitHeight) {
|
|
80
|
+
return 'top';
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// If neither space can accommodate the full height, prefer the one with more space
|
|
84
|
+
// When spaces are equal, prefer 'top' to show the top portion of the popup
|
|
85
|
+
return spaceAbove >= spaceBelow ? 'top' : 'bottom';
|
|
71
86
|
}
|
|
72
87
|
|
|
73
88
|
/**
|
|
@@ -101,6 +116,20 @@ function getHorizontalPlacement(target, boundariesElement, fitWidth, alignX, for
|
|
|
101
116
|
}
|
|
102
117
|
return 'right';
|
|
103
118
|
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Calculates the optimal placement for a popup element in both vertical and horizontal directions.
|
|
122
|
+
*
|
|
123
|
+
* @param target - The target element to position the popup relative to
|
|
124
|
+
* @param boundariesElement - The boundaries element that constrains the popup positioning
|
|
125
|
+
* @param fitWidth - The desired width of the popup content
|
|
126
|
+
* @param fitHeight - The desired height of the popup content
|
|
127
|
+
* @param alignX - Forced horizontal alignment direction
|
|
128
|
+
* @param alignY - Forced vertical alignment direction
|
|
129
|
+
* @param forcePlacement - Whether to force the placement to the specified alignment values
|
|
130
|
+
* @param preventOverflow - Whether to prevent overflow by adjusting placement
|
|
131
|
+
* @returns A tuple containing the vertical and horizontal placement directions
|
|
132
|
+
*/
|
|
104
133
|
function calculatePlacement(target, boundariesElement, fitWidth, fitHeight, alignX, alignY, forcePlacement, preventOverflow) {
|
|
105
134
|
return [getVerticalPlacement(target, boundariesElement, fitHeight, alignY, forcePlacement, preventOverflow), getHorizontalPlacement(target, boundariesElement, fitWidth, alignX, forcePlacement, preventOverflow)];
|
|
106
135
|
}
|
|
@@ -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 = "115.
|
|
7
|
+
const packageVersion = "115.11.2";
|
|
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 = "115.
|
|
17
|
+
const packageVersion = "115.11.2";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { isBody } from './isBody';
|
|
2
2
|
import { isTextNode } from './isTextNode';
|
|
3
3
|
/**
|
|
4
|
+
* Determines the optimal vertical placement ('top' or 'bottom') for a popup relative to a target element.
|
|
4
5
|
* Decides if given fitHeight fits below or above the target taking boundaries into account.
|
|
6
|
+
*
|
|
7
|
+
* @param target - The target element to position the popup relative to
|
|
8
|
+
* @param boundariesElement - The boundaries element that constrains the popup positioning
|
|
9
|
+
* @param fitHeight - The desired height of the popup content
|
|
10
|
+
* @param alignY - Forced alignment direction ('top' or 'bottom')
|
|
11
|
+
* @param forcePlacement - Whether to force the placement to the alignY value
|
|
12
|
+
* @param preventOverflow - Whether to prevent overflow by forcing bottom placement when space above is insufficient
|
|
13
|
+
* @returns The optimal placement direction ('top' or 'bottom')
|
|
5
14
|
*/
|
|
6
15
|
export function getVerticalPlacement(target, boundariesElement, fitHeight, alignY, forcePlacement, preventOverflow) {
|
|
7
16
|
if (forcePlacement && alignY) {
|
|
@@ -33,10 +42,16 @@ export function getVerticalPlacement(target, boundariesElement, fitHeight, align
|
|
|
33
42
|
return 'bottom';
|
|
34
43
|
}
|
|
35
44
|
}
|
|
36
|
-
if (spaceBelow >= fitHeight
|
|
45
|
+
if (spaceBelow >= fitHeight) {
|
|
37
46
|
return 'bottom';
|
|
38
47
|
}
|
|
39
|
-
|
|
48
|
+
if (spaceAbove >= fitHeight) {
|
|
49
|
+
return 'top';
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// If neither space can accommodate the full height, prefer the one with more space
|
|
53
|
+
// When spaces are equal, prefer 'top' to show the top portion of the popup
|
|
54
|
+
return spaceAbove >= spaceBelow ? 'top' : 'bottom';
|
|
40
55
|
}
|
|
41
56
|
|
|
42
57
|
/**
|
|
@@ -72,6 +87,20 @@ export function getHorizontalPlacement(target, boundariesElement, fitWidth, alig
|
|
|
72
87
|
}
|
|
73
88
|
return 'right';
|
|
74
89
|
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Calculates the optimal placement for a popup element in both vertical and horizontal directions.
|
|
93
|
+
*
|
|
94
|
+
* @param target - The target element to position the popup relative to
|
|
95
|
+
* @param boundariesElement - The boundaries element that constrains the popup positioning
|
|
96
|
+
* @param fitWidth - The desired width of the popup content
|
|
97
|
+
* @param fitHeight - The desired height of the popup content
|
|
98
|
+
* @param alignX - Forced horizontal alignment direction
|
|
99
|
+
* @param alignY - Forced vertical alignment direction
|
|
100
|
+
* @param forcePlacement - Whether to force the placement to the specified alignment values
|
|
101
|
+
* @param preventOverflow - Whether to prevent overflow by adjusting placement
|
|
102
|
+
* @returns A tuple containing the vertical and horizontal placement directions
|
|
103
|
+
*/
|
|
75
104
|
export function calculatePlacement(target, boundariesElement, fitWidth, fitHeight, alignX, alignY, forcePlacement, preventOverflow) {
|
|
76
105
|
return [getVerticalPlacement(target, boundariesElement, fitHeight, alignY, forcePlacement, preventOverflow), getHorizontalPlacement(target, boundariesElement, fitWidth, alignX, forcePlacement, preventOverflow)];
|
|
77
106
|
}
|
|
@@ -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 = "115.
|
|
13
|
+
var packageVersion = "115.11.2";
|
|
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 = "115.
|
|
24
|
+
var packageVersion = "115.11.2";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -5,7 +5,16 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
5
5
|
import { isBody } from './isBody';
|
|
6
6
|
import { isTextNode } from './isTextNode';
|
|
7
7
|
/**
|
|
8
|
+
* Determines the optimal vertical placement ('top' or 'bottom') for a popup relative to a target element.
|
|
8
9
|
* Decides if given fitHeight fits below or above the target taking boundaries into account.
|
|
10
|
+
*
|
|
11
|
+
* @param target - The target element to position the popup relative to
|
|
12
|
+
* @param boundariesElement - The boundaries element that constrains the popup positioning
|
|
13
|
+
* @param fitHeight - The desired height of the popup content
|
|
14
|
+
* @param alignY - Forced alignment direction ('top' or 'bottom')
|
|
15
|
+
* @param forcePlacement - Whether to force the placement to the alignY value
|
|
16
|
+
* @param preventOverflow - Whether to prevent overflow by forcing bottom placement when space above is insufficient
|
|
17
|
+
* @returns The optimal placement direction ('top' or 'bottom')
|
|
9
18
|
*/
|
|
10
19
|
export function getVerticalPlacement(target, boundariesElement, fitHeight, alignY, forcePlacement, preventOverflow) {
|
|
11
20
|
if (forcePlacement && alignY) {
|
|
@@ -34,10 +43,16 @@ export function getVerticalPlacement(target, boundariesElement, fitHeight, align
|
|
|
34
43
|
return 'bottom';
|
|
35
44
|
}
|
|
36
45
|
}
|
|
37
|
-
if (spaceBelow >= fitHeight
|
|
46
|
+
if (spaceBelow >= fitHeight) {
|
|
38
47
|
return 'bottom';
|
|
39
48
|
}
|
|
40
|
-
|
|
49
|
+
if (spaceAbove >= fitHeight) {
|
|
50
|
+
return 'top';
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// If neither space can accommodate the full height, prefer the one with more space
|
|
54
|
+
// When spaces are equal, prefer 'top' to show the top portion of the popup
|
|
55
|
+
return spaceAbove >= spaceBelow ? 'top' : 'bottom';
|
|
41
56
|
}
|
|
42
57
|
|
|
43
58
|
/**
|
|
@@ -71,6 +86,20 @@ export function getHorizontalPlacement(target, boundariesElement, fitWidth, alig
|
|
|
71
86
|
}
|
|
72
87
|
return 'right';
|
|
73
88
|
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Calculates the optimal placement for a popup element in both vertical and horizontal directions.
|
|
92
|
+
*
|
|
93
|
+
* @param target - The target element to position the popup relative to
|
|
94
|
+
* @param boundariesElement - The boundaries element that constrains the popup positioning
|
|
95
|
+
* @param fitWidth - The desired width of the popup content
|
|
96
|
+
* @param fitHeight - The desired height of the popup content
|
|
97
|
+
* @param alignX - Forced horizontal alignment direction
|
|
98
|
+
* @param alignY - Forced vertical alignment direction
|
|
99
|
+
* @param forcePlacement - Whether to force the placement to the specified alignment values
|
|
100
|
+
* @param preventOverflow - Whether to prevent overflow by adjusting placement
|
|
101
|
+
* @returns A tuple containing the vertical and horizontal placement directions
|
|
102
|
+
*/
|
|
74
103
|
export function calculatePlacement(target, boundariesElement, fitWidth, fitHeight, alignX, alignY, forcePlacement, preventOverflow) {
|
|
75
104
|
return [getVerticalPlacement(target, boundariesElement, fitHeight, alignY, forcePlacement, preventOverflow), getHorizontalPlacement(target, boundariesElement, fitWidth, alignX, forcePlacement, preventOverflow)];
|
|
76
105
|
}
|
|
@@ -59,4 +59,4 @@ export { type NcsSessionStepEventAEP, type NcsSessionStepMetrics, } from './type
|
|
|
59
59
|
export type { BlockMenuEventPayload } from './types/block-menu-events';
|
|
60
60
|
export type { BreakoutEventPayload, BreakoutSupportedNodes } from './types/breakout-events';
|
|
61
61
|
export type { RendererSyncBlockEventPayload, SyncBlockEventPayload, SyncedBlockSSRErrorAEP, } from './types/sync-block-events';
|
|
62
|
-
export type { AiSuggestionsEventPayload } from './types/ai-suggestions-events';
|
|
62
|
+
export type { AiSuggestionsEntryPoint, AiSuggestionsEventPayload, } from './types/ai-suggestions-events';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ACTION, ACTION_SUBJECT } from './enums';
|
|
2
2
|
import type { OperationalAEP, TrackAEP } from './utils';
|
|
3
|
+
export type AiSuggestionsEntryPoint = 'primaryToolbar' | 'commentsEmptyState';
|
|
3
4
|
type NoDiffSuggestionAEP = OperationalAEP<ACTION.NO_DIFF_FOUND, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
|
|
4
5
|
suggestionType: string;
|
|
5
6
|
toolCalls: {
|
|
@@ -8,6 +9,9 @@ type NoDiffSuggestionAEP = OperationalAEP<ACTION.NO_DIFF_FOUND, ACTION_SUBJECT.A
|
|
|
8
9
|
nodeTypes: string[];
|
|
9
10
|
}[];
|
|
10
11
|
}>;
|
|
12
|
+
type EntryPointClickedAEP = TrackAEP<ACTION.CLICKED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
|
|
13
|
+
entryPoint: AiSuggestionsEntryPoint;
|
|
14
|
+
}, undefined>;
|
|
11
15
|
type AcceptSuggestionAEP = TrackAEP<ACTION.ACCEPTED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
|
|
12
16
|
affectedBlocks: number;
|
|
13
17
|
charactersAdded: number;
|
|
@@ -16,6 +20,7 @@ type AcceptSuggestionAEP = TrackAEP<ACTION.ACCEPTED, ACTION_SUBJECT.AI_SUGGESTIO
|
|
|
16
20
|
suggestionType: string;
|
|
17
21
|
}, undefined>;
|
|
18
22
|
type DiscardSuggestionAEP = TrackAEP<ACTION.DISCARDED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
|
|
23
|
+
affectedBlocks: number;
|
|
19
24
|
entryPoint: 'sidebar' | 'card';
|
|
20
25
|
suggestionType: string;
|
|
21
26
|
}, undefined>;
|
|
@@ -28,5 +33,5 @@ type ViewSuggestionAEP = TrackAEP<ACTION.VIEWED, ACTION_SUBJECT.AI_SUGGESTIONS,
|
|
|
28
33
|
suggestionCardCharacterCount: number;
|
|
29
34
|
suggestionType: string;
|
|
30
35
|
}, undefined>;
|
|
31
|
-
export type AiSuggestionsEventPayload = NoDiffSuggestionAEP | AcceptSuggestionAEP | DiscardSuggestionAEP | ViewSuggestionAEP;
|
|
36
|
+
export type AiSuggestionsEventPayload = NoDiffSuggestionAEP | EntryPointClickedAEP | AcceptSuggestionAEP | DiscardSuggestionAEP | ViewSuggestionAEP;
|
|
32
37
|
export {};
|
|
@@ -12,18 +12,40 @@ export interface CalculatePositionParams {
|
|
|
12
12
|
placement: [string, string];
|
|
13
13
|
popup?: HTMLElement;
|
|
14
14
|
rect?: DOMRect;
|
|
15
|
+
scrollableElement?: HTMLElement | false;
|
|
15
16
|
stick?: boolean;
|
|
16
17
|
target?: HTMLElement;
|
|
17
|
-
scrollableElement?: HTMLElement | false;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
+
* Determines the optimal vertical placement ('top' or 'bottom') for a popup relative to a target element.
|
|
20
21
|
* Decides if given fitHeight fits below or above the target taking boundaries into account.
|
|
22
|
+
*
|
|
23
|
+
* @param target - The target element to position the popup relative to
|
|
24
|
+
* @param boundariesElement - The boundaries element that constrains the popup positioning
|
|
25
|
+
* @param fitHeight - The desired height of the popup content
|
|
26
|
+
* @param alignY - Forced alignment direction ('top' or 'bottom')
|
|
27
|
+
* @param forcePlacement - Whether to force the placement to the alignY value
|
|
28
|
+
* @param preventOverflow - Whether to prevent overflow by forcing bottom placement when space above is insufficient
|
|
29
|
+
* @returns The optimal placement direction ('top' or 'bottom')
|
|
21
30
|
*/
|
|
22
31
|
export declare function getVerticalPlacement(target: HTMLElement, boundariesElement: HTMLElement, fitHeight?: number, alignY?: string, forcePlacement?: boolean, preventOverflow?: boolean): string;
|
|
23
32
|
/**
|
|
24
33
|
* Decides if given fitWidth fits to the left or to the right of the target taking boundaries into account.
|
|
25
34
|
*/
|
|
26
35
|
export declare function getHorizontalPlacement(target: HTMLElement, boundariesElement: HTMLElement, fitWidth?: number, alignX?: string, forcePlacement?: boolean, preventOverflow?: boolean): string;
|
|
36
|
+
/**
|
|
37
|
+
* Calculates the optimal placement for a popup element in both vertical and horizontal directions.
|
|
38
|
+
*
|
|
39
|
+
* @param target - The target element to position the popup relative to
|
|
40
|
+
* @param boundariesElement - The boundaries element that constrains the popup positioning
|
|
41
|
+
* @param fitWidth - The desired width of the popup content
|
|
42
|
+
* @param fitHeight - The desired height of the popup content
|
|
43
|
+
* @param alignX - Forced horizontal alignment direction
|
|
44
|
+
* @param alignY - Forced vertical alignment direction
|
|
45
|
+
* @param forcePlacement - Whether to force the placement to the specified alignment values
|
|
46
|
+
* @param preventOverflow - Whether to prevent overflow by adjusting placement
|
|
47
|
+
* @returns A tuple containing the vertical and horizontal placement directions
|
|
48
|
+
*/
|
|
27
49
|
export declare function calculatePlacement(target: HTMLElement, boundariesElement: HTMLElement, fitWidth?: number, fitHeight?: number, alignX?: string, alignY?: string, forcePlacement?: boolean, preventOverflow?: boolean): [string, string];
|
|
28
50
|
/**
|
|
29
51
|
* Calculates relative coordinates for placing popup along with the target.
|
|
@@ -59,4 +59,4 @@ export { type NcsSessionStepEventAEP, type NcsSessionStepMetrics, } from './type
|
|
|
59
59
|
export type { BlockMenuEventPayload } from './types/block-menu-events';
|
|
60
60
|
export type { BreakoutEventPayload, BreakoutSupportedNodes } from './types/breakout-events';
|
|
61
61
|
export type { RendererSyncBlockEventPayload, SyncBlockEventPayload, SyncedBlockSSRErrorAEP, } from './types/sync-block-events';
|
|
62
|
-
export type { AiSuggestionsEventPayload } from './types/ai-suggestions-events';
|
|
62
|
+
export type { AiSuggestionsEntryPoint, AiSuggestionsEventPayload, } from './types/ai-suggestions-events';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ACTION, ACTION_SUBJECT } from './enums';
|
|
2
2
|
import type { OperationalAEP, TrackAEP } from './utils';
|
|
3
|
+
export type AiSuggestionsEntryPoint = 'primaryToolbar' | 'commentsEmptyState';
|
|
3
4
|
type NoDiffSuggestionAEP = OperationalAEP<ACTION.NO_DIFF_FOUND, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
|
|
4
5
|
suggestionType: string;
|
|
5
6
|
toolCalls: {
|
|
@@ -8,6 +9,9 @@ type NoDiffSuggestionAEP = OperationalAEP<ACTION.NO_DIFF_FOUND, ACTION_SUBJECT.A
|
|
|
8
9
|
nodeTypes: string[];
|
|
9
10
|
}[];
|
|
10
11
|
}>;
|
|
12
|
+
type EntryPointClickedAEP = TrackAEP<ACTION.CLICKED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
|
|
13
|
+
entryPoint: AiSuggestionsEntryPoint;
|
|
14
|
+
}, undefined>;
|
|
11
15
|
type AcceptSuggestionAEP = TrackAEP<ACTION.ACCEPTED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
|
|
12
16
|
affectedBlocks: number;
|
|
13
17
|
charactersAdded: number;
|
|
@@ -16,6 +20,7 @@ type AcceptSuggestionAEP = TrackAEP<ACTION.ACCEPTED, ACTION_SUBJECT.AI_SUGGESTIO
|
|
|
16
20
|
suggestionType: string;
|
|
17
21
|
}, undefined>;
|
|
18
22
|
type DiscardSuggestionAEP = TrackAEP<ACTION.DISCARDED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
|
|
23
|
+
affectedBlocks: number;
|
|
19
24
|
entryPoint: 'sidebar' | 'card';
|
|
20
25
|
suggestionType: string;
|
|
21
26
|
}, undefined>;
|
|
@@ -28,5 +33,5 @@ type ViewSuggestionAEP = TrackAEP<ACTION.VIEWED, ACTION_SUBJECT.AI_SUGGESTIONS,
|
|
|
28
33
|
suggestionCardCharacterCount: number;
|
|
29
34
|
suggestionType: string;
|
|
30
35
|
}, undefined>;
|
|
31
|
-
export type AiSuggestionsEventPayload = NoDiffSuggestionAEP | AcceptSuggestionAEP | DiscardSuggestionAEP | ViewSuggestionAEP;
|
|
36
|
+
export type AiSuggestionsEventPayload = NoDiffSuggestionAEP | EntryPointClickedAEP | AcceptSuggestionAEP | DiscardSuggestionAEP | ViewSuggestionAEP;
|
|
32
37
|
export {};
|
|
@@ -15,18 +15,40 @@ export interface CalculatePositionParams {
|
|
|
15
15
|
];
|
|
16
16
|
popup?: HTMLElement;
|
|
17
17
|
rect?: DOMRect;
|
|
18
|
+
scrollableElement?: HTMLElement | false;
|
|
18
19
|
stick?: boolean;
|
|
19
20
|
target?: HTMLElement;
|
|
20
|
-
scrollableElement?: HTMLElement | false;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
+
* Determines the optimal vertical placement ('top' or 'bottom') for a popup relative to a target element.
|
|
23
24
|
* Decides if given fitHeight fits below or above the target taking boundaries into account.
|
|
25
|
+
*
|
|
26
|
+
* @param target - The target element to position the popup relative to
|
|
27
|
+
* @param boundariesElement - The boundaries element that constrains the popup positioning
|
|
28
|
+
* @param fitHeight - The desired height of the popup content
|
|
29
|
+
* @param alignY - Forced alignment direction ('top' or 'bottom')
|
|
30
|
+
* @param forcePlacement - Whether to force the placement to the alignY value
|
|
31
|
+
* @param preventOverflow - Whether to prevent overflow by forcing bottom placement when space above is insufficient
|
|
32
|
+
* @returns The optimal placement direction ('top' or 'bottom')
|
|
24
33
|
*/
|
|
25
34
|
export declare function getVerticalPlacement(target: HTMLElement, boundariesElement: HTMLElement, fitHeight?: number, alignY?: string, forcePlacement?: boolean, preventOverflow?: boolean): string;
|
|
26
35
|
/**
|
|
27
36
|
* Decides if given fitWidth fits to the left or to the right of the target taking boundaries into account.
|
|
28
37
|
*/
|
|
29
38
|
export declare function getHorizontalPlacement(target: HTMLElement, boundariesElement: HTMLElement, fitWidth?: number, alignX?: string, forcePlacement?: boolean, preventOverflow?: boolean): string;
|
|
39
|
+
/**
|
|
40
|
+
* Calculates the optimal placement for a popup element in both vertical and horizontal directions.
|
|
41
|
+
*
|
|
42
|
+
* @param target - The target element to position the popup relative to
|
|
43
|
+
* @param boundariesElement - The boundaries element that constrains the popup positioning
|
|
44
|
+
* @param fitWidth - The desired width of the popup content
|
|
45
|
+
* @param fitHeight - The desired height of the popup content
|
|
46
|
+
* @param alignX - Forced horizontal alignment direction
|
|
47
|
+
* @param alignY - Forced vertical alignment direction
|
|
48
|
+
* @param forcePlacement - Whether to force the placement to the specified alignment values
|
|
49
|
+
* @param preventOverflow - Whether to prevent overflow by adjusting placement
|
|
50
|
+
* @returns A tuple containing the vertical and horizontal placement directions
|
|
51
|
+
*/
|
|
30
52
|
export declare function calculatePlacement(target: HTMLElement, boundariesElement: HTMLElement, fitWidth?: number, fitHeight?: number, alignX?: string, alignY?: string, forcePlacement?: boolean, preventOverflow?: boolean): [
|
|
31
53
|
string,
|
|
32
54
|
string
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "115.
|
|
3
|
+
"version": "115.12.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/"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@atlaskit/analytics-listeners": "^10.1.0",
|
|
44
44
|
"@atlaskit/analytics-namespaced-context": "^7.3.0",
|
|
45
45
|
"@atlaskit/analytics-next": "^11.3.0",
|
|
46
|
-
"@atlaskit/atlassian-context": "^0.
|
|
46
|
+
"@atlaskit/atlassian-context": "^0.11.0",
|
|
47
47
|
"@atlaskit/browser-apis": "^0.0.2",
|
|
48
48
|
"@atlaskit/button": "^23.11.0",
|
|
49
49
|
"@atlaskit/codemod-utils": "^4.3.0",
|
|
@@ -81,13 +81,13 @@
|
|
|
81
81
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
82
82
|
"@atlaskit/react-ufo": "^6.7.0",
|
|
83
83
|
"@atlaskit/section-message": "^8.13.0",
|
|
84
|
-
"@atlaskit/smart-card": "^44.
|
|
84
|
+
"@atlaskit/smart-card": "^44.28.0",
|
|
85
85
|
"@atlaskit/smart-user-picker": "^10.2.0",
|
|
86
86
|
"@atlaskit/spinner": "^19.1.0",
|
|
87
|
-
"@atlaskit/task-decision": "^20.
|
|
87
|
+
"@atlaskit/task-decision": "^20.2.0",
|
|
88
88
|
"@atlaskit/teams-app-config": "^1.12.0",
|
|
89
89
|
"@atlaskit/textfield": "^8.3.0",
|
|
90
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
90
|
+
"@atlaskit/tmp-editor-statsig": "^98.0.0",
|
|
91
91
|
"@atlaskit/tokens": "^13.3.0",
|
|
92
92
|
"@atlaskit/tooltip": "^22.6.0",
|
|
93
93
|
"@atlaskit/width-detector": "^5.1.0",
|