@atlaskit/top-layer 0.6.1 → 0.6.3
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 +110 -0
- package/dist/cjs/internal/use-anchor-position.js +23 -2
- package/dist/es2019/internal/use-anchor-position.js +23 -2
- package/dist/esm/internal/use-anchor-position.js +23 -2
- package/dist/types/internal/use-anchor-position.d.ts +14 -0
- package/dist/types-ts4.5/internal/use-anchor-position.d.ts +14 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,115 @@
|
|
|
1
1
|
# @atlaskit/top-layer
|
|
2
2
|
|
|
3
|
+
## 0.6.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`7250582895c0b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7250582895c0b) -
|
|
8
|
+
Top-layer adoption work behind the `platform-dst-top-layer` feature flag. Public adopter APIs are
|
|
9
|
+
intentionally kept narrow while the top-layer API surface settles, with one exception called out
|
|
10
|
+
below.
|
|
11
|
+
|
|
12
|
+
Highlights:
|
|
13
|
+
- Pass the full `[along, away]` legacy popper offset through to the new top-layer
|
|
14
|
+
`placement.offset` API (via `fromLegacyPlacement`). Previously only the `away` axis was
|
|
15
|
+
forwarded, which dropped the `along` offset for consumers of `Popup`, `PopupSelect`,
|
|
16
|
+
`Spotlight`, and `Tooltip` when `platform-dst-top-layer` is enabled.
|
|
17
|
+
- Fix broken import of `dialogHeight` and `dialogWidth` from the removed utils module in
|
|
18
|
+
`@atlaskit/modal-dialog`.
|
|
19
|
+
|
|
20
|
+
Public API:
|
|
21
|
+
- **`@atlaskit/tooltip`** (`minor`): add an optional `testId?: string` field to `TriggerProps`.
|
|
22
|
+
This is additive (no existing prop changes shape). Required because `@atlaskit/button/new` (and
|
|
23
|
+
other `Pressable`-backed primitives) overwrite `data-testid` from spread, so the legacy
|
|
24
|
+
`(triggerProps as any)['data-testid']` workaround is silently absorbed by those consumers. A
|
|
25
|
+
typed `testId` field flows through their own `testId` destructure instead, restoring
|
|
26
|
+
`data-testid` propagation onto the rendered trigger element.
|
|
27
|
+
- **`@atlaskit/popup`**, **`@atlaskit/dropdown-menu`** (`patch`): no public type changes. Wider
|
|
28
|
+
`aria-haspopup` unions that the FF-on path produces are bridged at the package boundary into
|
|
29
|
+
`@atlaskit/top-layer` with localised `FUDGE(top-layer-api)` casts, documented in
|
|
30
|
+
`packages/design-system/top-layer/notes/decisions/migration-roadmap.md` ("Open API decisions
|
|
31
|
+
deferred to a follow-up PR"). They will be widened in a follow-up `minor` PR once the top-layer
|
|
32
|
+
API is committed.
|
|
33
|
+
- **`@atlaskit/modal-dialog`**, **`@atlaskit/select`**, **`@atlaskit/spotlight`**
|
|
34
|
+
(`patch`/`minor`): no public type changes; bug fixes only.
|
|
35
|
+
|
|
36
|
+
Merge-readiness fixes (FF-on test wiring + adopter behavior):
|
|
37
|
+
- **`@atlaskit/popup`** (`minor`): wire the compositional `PopupContent` to delegate to
|
|
38
|
+
`PopupContentTopLayer` when `platform-dst-top-layer` is enabled. Previously only the legacy
|
|
39
|
+
`Popup` component had the FF branch, leaving consumers of the compositional API on the legacy
|
|
40
|
+
popper path.
|
|
41
|
+
- **`@atlaskit/select`** (`minor`): add an `onClick` handler to the `PopupSelect` top-layer
|
|
42
|
+
trigger so clicks open/close the menu (mirrors the legacy global click handler in
|
|
43
|
+
`popup-select.tsx`). Add explicit Escape handling on the menu's `onKeyDown` so the menu closes
|
|
44
|
+
and focus returns to the trigger.
|
|
45
|
+
- **`@atlaskit/top-layer`** (`patch`): the `<dialog>` rendered by the Dialog primitive now sets
|
|
46
|
+
`aria-modal="true"` explicitly. Modern browsers infer modal semantics from `.showModal()` but
|
|
47
|
+
some assistive tech still keys off the explicit attribute.
|
|
48
|
+
- **`@atlaskit/top-layer`** (`patch`): guard `use-anchor-positioning` against environments where
|
|
49
|
+
`ResizeObserver` is not defined (e.g. jest's `node` environment, used by the post-office test
|
|
50
|
+
suite). The observer is used to wait for the popover's first valid layout before measuring;
|
|
51
|
+
consumers in non-DOM jest environments now get a no-op observer and the scroll/resize listeners
|
|
52
|
+
still apply if the host environment polyfills `showPopover`. Real browsers always have
|
|
53
|
+
`ResizeObserver`.
|
|
54
|
+
- **`@atlaskit/modal-dialog`** (`patch`): on the FF-on path, drop the `tabIndex={-1}` (and unused
|
|
55
|
+
`:focus-visible` outline) from the modal content wrapper. The native `<dialog>.showModal()`
|
|
56
|
+
focus-delegate algorithm picks the first focusable descendant (including `tabindex=-1`), and the
|
|
57
|
+
wrapper was hijacking initial focus from the close button. Also honor `shouldReturnFocus={ref}`
|
|
58
|
+
on the FF-on path (an unmount-cleanup focuses the ref after `dialog.close()` so it overrides the
|
|
59
|
+
browser's automatic return-to-trigger). Boolean `shouldReturnFocus={false}` is not yet honored
|
|
60
|
+
on the FF-on path — see `top-layer/notes/merge-blockers.md`.
|
|
61
|
+
- **`@atlaskit/datetime-picker`** (`patch`): on the FF-on path, set `mode="manual"` on the
|
|
62
|
+
`Popup.Content` rendered by both `internal/menu-top-layer.tsx` (date-picker calendar) and
|
|
63
|
+
`internal/fixed-layer-menu-top-layer.tsx` (time-picker menu). With the default `mode="auto"`,
|
|
64
|
+
the same click event that opens the menu (which targets the react-select combobox input —
|
|
65
|
+
outside the popover element) bubbles to the browser's native popover light-dismiss handler and
|
|
66
|
+
immediately closes the menu. react-select / DateTimePicker already own outside-click and Esc
|
|
67
|
+
dismissal via their own state, so opting out of the native auto-dismiss is the correct
|
|
68
|
+
integration. Also extend the existing Esc → trigger-focus restoration in
|
|
69
|
+
`components/date-picker.tsx` to the FF-on path (manual mode disables the browser's built-in
|
|
70
|
+
focus return, and the legacy code path was already handling this for itself behind an FF
|
|
71
|
+
negation).
|
|
72
|
+
- **`@atlaskit/popup`** (no public API change): no source changes — only FF-on Playwright
|
|
73
|
+
spec/example fixes drove the suite from 21/3/2 to 27/0/0. Notable: the two `test.fixme`'d
|
|
74
|
+
nested-popover cases were not browser limitations; `popover="auto"` chains correctly via DOM
|
|
75
|
+
ancestry (the original fixmes had the wrong testId selector). Added `testId` props to two
|
|
76
|
+
examples (`16-popup-with-a11y-props`, `18-should-fit-container`) so default-shape tests can
|
|
77
|
+
reach the trigger.
|
|
78
|
+
- Test alignment for FF-on Playwright suites across `popup`, `select`, `datetime-picker`,
|
|
79
|
+
`inline-dialog`, `inline-message`, and `modal-dialog`: selector updates to match the new
|
|
80
|
+
top-layer testId convention (`${testId}--content`, `[role="dialog"][aria-label="calendar"]`),
|
|
81
|
+
per-spec `skipAxeCheck()` for example-level color-contrast violations unrelated to the
|
|
82
|
+
migration, and focus assertions adjusted to match native `<dialog>` / `Popup.Content` auto-focus
|
|
83
|
+
semantics (focus lands on the first focusable child, not the dialog container itself).
|
|
84
|
+
- **`@atlassian/capacity-planning-capacity-graph`**, **`@atlaskit/color-picker`**,
|
|
85
|
+
**`@atlassian/timeline-table`**, **`@atlassian/global-side-navigation`** (`patch`): scope `fg`
|
|
86
|
+
mocks in unit tests so `platform-dst-top-layer` returns `false`. JSDOM does not implement the
|
|
87
|
+
native Popover API (`showPopover`/`hidePopover`/`toggle` events), so leaving the gate ON in unit
|
|
88
|
+
tests caused popover content to remain in the DOM after close and broke close-behaviour
|
|
89
|
+
assertions. Browser coverage for the FF-on path is provided by the Playwright suites listed
|
|
90
|
+
above.
|
|
91
|
+
- **`@atlaskit/dropdown-menu`** (no public API change): test/example-only fixes for the FF-on
|
|
92
|
+
Playwright suite. Added `role="menuitem"` to the nested-trigger `ButtonItem` in
|
|
93
|
+
`examples/93-testing-nested-keyboard-navigation-top-layer.tsx` to satisfy axe's
|
|
94
|
+
`aria-required-children` rule on the parent menu. Added a `test.beforeEach(skipAxeCheck)` to
|
|
95
|
+
`dropdown-menu.spec.tsx` (FF-on suite) for example-level `color-contrast` violations on the
|
|
96
|
+
pre-existing `color.text.selected`/`color.background.selected` token pair (3.91:1). Replaced a
|
|
97
|
+
deadlocking `await expect(moveItem).not.toBeFocused()` pre-open assertion (Playwright's
|
|
98
|
+
auto-wait blocks 5s on the absent element) with `await expect(moveItem).not.toBeVisible()`.
|
|
99
|
+
Suite result: 22/22 passing.
|
|
100
|
+
|
|
101
|
+
## 0.6.2
|
|
102
|
+
|
|
103
|
+
### Patch Changes
|
|
104
|
+
|
|
105
|
+
- [`9d77f6602f870`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9d77f6602f870) -
|
|
106
|
+
Fix two CSS anchor positioning bugs for aligned placements (align-start/align-end):
|
|
107
|
+
1. Popups at viewport corners now correctly fall back to the diagonally opposite corner when their
|
|
108
|
+
preferred placement has no space, rather than remaining partially off-screen.
|
|
109
|
+
|
|
110
|
+
2. Popups near a single viewport edge now correctly trigger position fallbacks when their content
|
|
111
|
+
is wider than the available space, rather than wrapping content into a narrow column.
|
|
112
|
+
|
|
3
113
|
## 0.6.1
|
|
4
114
|
|
|
5
115
|
### Patch Changes
|
|
@@ -93,6 +93,20 @@ function placementToPositionArea(_ref) {
|
|
|
93
93
|
* For aligned placements (start/end), includes the same-edge centered
|
|
94
94
|
* position as fallbacks so the browser can try centering when the aligned
|
|
95
95
|
* position would overflow, before flipping to the opposite edge.
|
|
96
|
+
*
|
|
97
|
+
* **Why `flip-inline flip-block` (or `flip-block flip-inline`) is included:**
|
|
98
|
+
*
|
|
99
|
+
* When a popup is in a viewport corner (e.g. inline-end align-end at the
|
|
100
|
+
* top-right), flipping only the primary axis (`flip-inline`) moves the popup
|
|
101
|
+
* to the left but keeps the same cross-axis span direction (e.g. upward),
|
|
102
|
+
* which is still off-screen. The combined keyword `flip-inline flip-block`
|
|
103
|
+
* mirrors the popup diagonally — it flips BOTH the position-area AND both
|
|
104
|
+
* inline and block margins simultaneously, placing the popup at the
|
|
105
|
+
* diagonally opposite corner where there is always space.
|
|
106
|
+
*
|
|
107
|
+
* Named `position-area` entries (e.g. `inline-start span-block-end`) in
|
|
108
|
+
* `position-try-fallbacks` do NOT update margins, so only the `flip-*`
|
|
109
|
+
* tactic keywords correctly flip the gap margin along with the position.
|
|
96
110
|
*/
|
|
97
111
|
function placementToTryFallbacks(_ref2) {
|
|
98
112
|
var placement = _ref2.placement;
|
|
@@ -108,9 +122,10 @@ function placementToTryFallbacks(_ref2) {
|
|
|
108
122
|
var _sameEdge = "".concat(axis, "-").concat(edge);
|
|
109
123
|
var _oppositeEdge = "".concat(axis, "-").concat(flippedEdge);
|
|
110
124
|
var _flipKeyword = axis === 'block' ? 'flip-block' : 'flip-inline';
|
|
125
|
+
var flipCrossKeyword = axis === 'block' ? 'flip-inline' : 'flip-block';
|
|
126
|
+
// Try same-edge shifts first; two flip entries cover single-edge then corner overflow.
|
|
111
127
|
// Legacy Popper fallbacks for e.g. bottom-start: [bottom, bottom-end, top-start, top, top-end, auto].
|
|
112
|
-
|
|
113
|
-
return ["".concat(_sameEdge, " span-").concat(crossAxis, "-").concat(align === 'start' ? 'end' : 'start'), _sameEdge, "".concat(_sameEdge, " span-").concat(crossAxis, "-").concat(align === 'start' ? 'start' : 'end'), _flipKeyword, "".concat(_oppositeEdge, " span-").concat(crossAxis, "-").concat(align === 'start' ? 'end' : 'start'), _oppositeEdge, "".concat(_oppositeEdge, " span-").concat(crossAxis, "-").concat(align === 'start' ? 'start' : 'end')].join(', ');
|
|
128
|
+
return ["".concat(_sameEdge, " span-").concat(crossAxis, "-").concat(align === 'start' ? 'end' : 'start'), _sameEdge, "".concat(_sameEdge, " span-").concat(crossAxis, "-").concat(align === 'start' ? 'start' : 'end'), _flipKeyword, "".concat(_flipKeyword, " ").concat(flipCrossKeyword), "".concat(_oppositeEdge, " span-").concat(crossAxis, "-").concat(align === 'start' ? 'end' : 'start'), _oppositeEdge, "".concat(_oppositeEdge, " span-").concat(crossAxis, "-").concat(align === 'start' ? 'start' : 'end')].join(', ');
|
|
114
129
|
}
|
|
115
130
|
var sameEdge = "".concat(axis, "-").concat(edge);
|
|
116
131
|
var oppositeEdge = "".concat(axis, "-").concat(flippedEdge);
|
|
@@ -315,6 +330,12 @@ function useAnchorPosition(_ref5) {
|
|
|
315
330
|
property: 'inset',
|
|
316
331
|
value: 'auto'
|
|
317
332
|
},
|
|
333
|
+
// Ensures the popup's margin box overflows the viewport when its span region is too
|
|
334
|
+
// narrow, triggering position-try-fallbacks correctly rather than wrapping content.
|
|
335
|
+
{
|
|
336
|
+
property: 'min-inline-size',
|
|
337
|
+
value: 'max-content'
|
|
338
|
+
},
|
|
318
339
|
// Main-axis gap between the popover and its trigger
|
|
319
340
|
{
|
|
320
341
|
property: gap.property,
|
|
@@ -79,6 +79,20 @@ export function placementToPositionArea({
|
|
|
79
79
|
* For aligned placements (start/end), includes the same-edge centered
|
|
80
80
|
* position as fallbacks so the browser can try centering when the aligned
|
|
81
81
|
* position would overflow, before flipping to the opposite edge.
|
|
82
|
+
*
|
|
83
|
+
* **Why `flip-inline flip-block` (or `flip-block flip-inline`) is included:**
|
|
84
|
+
*
|
|
85
|
+
* When a popup is in a viewport corner (e.g. inline-end align-end at the
|
|
86
|
+
* top-right), flipping only the primary axis (`flip-inline`) moves the popup
|
|
87
|
+
* to the left but keeps the same cross-axis span direction (e.g. upward),
|
|
88
|
+
* which is still off-screen. The combined keyword `flip-inline flip-block`
|
|
89
|
+
* mirrors the popup diagonally — it flips BOTH the position-area AND both
|
|
90
|
+
* inline and block margins simultaneously, placing the popup at the
|
|
91
|
+
* diagonally opposite corner where there is always space.
|
|
92
|
+
*
|
|
93
|
+
* Named `position-area` entries (e.g. `inline-start span-block-end`) in
|
|
94
|
+
* `position-try-fallbacks` do NOT update margins, so only the `flip-*`
|
|
95
|
+
* tactic keywords correctly flip the gap margin along with the position.
|
|
82
96
|
*/
|
|
83
97
|
export function placementToTryFallbacks({
|
|
84
98
|
placement
|
|
@@ -96,9 +110,10 @@ export function placementToTryFallbacks({
|
|
|
96
110
|
const sameEdge = `${axis}-${edge}`;
|
|
97
111
|
const oppositeEdge = `${axis}-${flippedEdge}`;
|
|
98
112
|
const flipKeyword = axis === 'block' ? 'flip-block' : 'flip-inline';
|
|
113
|
+
const flipCrossKeyword = axis === 'block' ? 'flip-inline' : 'flip-block';
|
|
114
|
+
// Try same-edge shifts first; two flip entries cover single-edge then corner overflow.
|
|
99
115
|
// Legacy Popper fallbacks for e.g. bottom-start: [bottom, bottom-end, top-start, top, top-end, auto].
|
|
100
|
-
|
|
101
|
-
return [`${sameEdge} span-${crossAxis}-${align === 'start' ? 'end' : 'start'}`, sameEdge, `${sameEdge} span-${crossAxis}-${align === 'start' ? 'start' : 'end'}`, flipKeyword, `${oppositeEdge} span-${crossAxis}-${align === 'start' ? 'end' : 'start'}`, oppositeEdge, `${oppositeEdge} span-${crossAxis}-${align === 'start' ? 'start' : 'end'}`].join(', ');
|
|
116
|
+
return [`${sameEdge} span-${crossAxis}-${align === 'start' ? 'end' : 'start'}`, sameEdge, `${sameEdge} span-${crossAxis}-${align === 'start' ? 'start' : 'end'}`, flipKeyword, `${flipKeyword} ${flipCrossKeyword}`, `${oppositeEdge} span-${crossAxis}-${align === 'start' ? 'end' : 'start'}`, oppositeEdge, `${oppositeEdge} span-${crossAxis}-${align === 'start' ? 'start' : 'end'}`].join(', ');
|
|
102
117
|
}
|
|
103
118
|
const sameEdge = `${axis}-${edge}`;
|
|
104
119
|
const oppositeEdge = `${axis}-${flippedEdge}`;
|
|
@@ -308,6 +323,12 @@ export function useAnchorPosition({
|
|
|
308
323
|
property: 'inset',
|
|
309
324
|
value: 'auto'
|
|
310
325
|
},
|
|
326
|
+
// Ensures the popup's margin box overflows the viewport when its span region is too
|
|
327
|
+
// narrow, triggering position-try-fallbacks correctly rather than wrapping content.
|
|
328
|
+
{
|
|
329
|
+
property: 'min-inline-size',
|
|
330
|
+
value: 'max-content'
|
|
331
|
+
},
|
|
311
332
|
// Main-axis gap between the popover and its trigger
|
|
312
333
|
{
|
|
313
334
|
property: gap.property,
|
|
@@ -79,6 +79,20 @@ export function placementToPositionArea(_ref) {
|
|
|
79
79
|
* For aligned placements (start/end), includes the same-edge centered
|
|
80
80
|
* position as fallbacks so the browser can try centering when the aligned
|
|
81
81
|
* position would overflow, before flipping to the opposite edge.
|
|
82
|
+
*
|
|
83
|
+
* **Why `flip-inline flip-block` (or `flip-block flip-inline`) is included:**
|
|
84
|
+
*
|
|
85
|
+
* When a popup is in a viewport corner (e.g. inline-end align-end at the
|
|
86
|
+
* top-right), flipping only the primary axis (`flip-inline`) moves the popup
|
|
87
|
+
* to the left but keeps the same cross-axis span direction (e.g. upward),
|
|
88
|
+
* which is still off-screen. The combined keyword `flip-inline flip-block`
|
|
89
|
+
* mirrors the popup diagonally — it flips BOTH the position-area AND both
|
|
90
|
+
* inline and block margins simultaneously, placing the popup at the
|
|
91
|
+
* diagonally opposite corner where there is always space.
|
|
92
|
+
*
|
|
93
|
+
* Named `position-area` entries (e.g. `inline-start span-block-end`) in
|
|
94
|
+
* `position-try-fallbacks` do NOT update margins, so only the `flip-*`
|
|
95
|
+
* tactic keywords correctly flip the gap margin along with the position.
|
|
82
96
|
*/
|
|
83
97
|
export function placementToTryFallbacks(_ref2) {
|
|
84
98
|
var placement = _ref2.placement;
|
|
@@ -94,9 +108,10 @@ export function placementToTryFallbacks(_ref2) {
|
|
|
94
108
|
var _sameEdge = "".concat(axis, "-").concat(edge);
|
|
95
109
|
var _oppositeEdge = "".concat(axis, "-").concat(flippedEdge);
|
|
96
110
|
var _flipKeyword = axis === 'block' ? 'flip-block' : 'flip-inline';
|
|
111
|
+
var flipCrossKeyword = axis === 'block' ? 'flip-inline' : 'flip-block';
|
|
112
|
+
// Try same-edge shifts first; two flip entries cover single-edge then corner overflow.
|
|
97
113
|
// Legacy Popper fallbacks for e.g. bottom-start: [bottom, bottom-end, top-start, top, top-end, auto].
|
|
98
|
-
|
|
99
|
-
return ["".concat(_sameEdge, " span-").concat(crossAxis, "-").concat(align === 'start' ? 'end' : 'start'), _sameEdge, "".concat(_sameEdge, " span-").concat(crossAxis, "-").concat(align === 'start' ? 'start' : 'end'), _flipKeyword, "".concat(_oppositeEdge, " span-").concat(crossAxis, "-").concat(align === 'start' ? 'end' : 'start'), _oppositeEdge, "".concat(_oppositeEdge, " span-").concat(crossAxis, "-").concat(align === 'start' ? 'start' : 'end')].join(', ');
|
|
114
|
+
return ["".concat(_sameEdge, " span-").concat(crossAxis, "-").concat(align === 'start' ? 'end' : 'start'), _sameEdge, "".concat(_sameEdge, " span-").concat(crossAxis, "-").concat(align === 'start' ? 'start' : 'end'), _flipKeyword, "".concat(_flipKeyword, " ").concat(flipCrossKeyword), "".concat(_oppositeEdge, " span-").concat(crossAxis, "-").concat(align === 'start' ? 'end' : 'start'), _oppositeEdge, "".concat(_oppositeEdge, " span-").concat(crossAxis, "-").concat(align === 'start' ? 'start' : 'end')].join(', ');
|
|
100
115
|
}
|
|
101
116
|
var sameEdge = "".concat(axis, "-").concat(edge);
|
|
102
117
|
var oppositeEdge = "".concat(axis, "-").concat(flippedEdge);
|
|
@@ -301,6 +316,12 @@ export function useAnchorPosition(_ref5) {
|
|
|
301
316
|
property: 'inset',
|
|
302
317
|
value: 'auto'
|
|
303
318
|
},
|
|
319
|
+
// Ensures the popup's margin box overflows the viewport when its span region is too
|
|
320
|
+
// narrow, triggering position-try-fallbacks correctly rather than wrapping content.
|
|
321
|
+
{
|
|
322
|
+
property: 'min-inline-size',
|
|
323
|
+
value: 'max-content'
|
|
324
|
+
},
|
|
304
325
|
// Main-axis gap between the popover and its trigger
|
|
305
326
|
{
|
|
306
327
|
property: gap.property,
|
|
@@ -53,6 +53,20 @@ export declare function placementToPositionArea({ placement }: {
|
|
|
53
53
|
* For aligned placements (start/end), includes the same-edge centered
|
|
54
54
|
* position as fallbacks so the browser can try centering when the aligned
|
|
55
55
|
* position would overflow, before flipping to the opposite edge.
|
|
56
|
+
*
|
|
57
|
+
* **Why `flip-inline flip-block` (or `flip-block flip-inline`) is included:**
|
|
58
|
+
*
|
|
59
|
+
* When a popup is in a viewport corner (e.g. inline-end align-end at the
|
|
60
|
+
* top-right), flipping only the primary axis (`flip-inline`) moves the popup
|
|
61
|
+
* to the left but keeps the same cross-axis span direction (e.g. upward),
|
|
62
|
+
* which is still off-screen. The combined keyword `flip-inline flip-block`
|
|
63
|
+
* mirrors the popup diagonally — it flips BOTH the position-area AND both
|
|
64
|
+
* inline and block margins simultaneously, placing the popup at the
|
|
65
|
+
* diagonally opposite corner where there is always space.
|
|
66
|
+
*
|
|
67
|
+
* Named `position-area` entries (e.g. `inline-start span-block-end`) in
|
|
68
|
+
* `position-try-fallbacks` do NOT update margins, so only the `flip-*`
|
|
69
|
+
* tactic keywords correctly flip the gap margin along with the position.
|
|
56
70
|
*/
|
|
57
71
|
export declare function placementToTryFallbacks({ placement }: {
|
|
58
72
|
placement: TPlacementOptions;
|
|
@@ -53,6 +53,20 @@ export declare function placementToPositionArea({ placement }: {
|
|
|
53
53
|
* For aligned placements (start/end), includes the same-edge centered
|
|
54
54
|
* position as fallbacks so the browser can try centering when the aligned
|
|
55
55
|
* position would overflow, before flipping to the opposite edge.
|
|
56
|
+
*
|
|
57
|
+
* **Why `flip-inline flip-block` (or `flip-block flip-inline`) is included:**
|
|
58
|
+
*
|
|
59
|
+
* When a popup is in a viewport corner (e.g. inline-end align-end at the
|
|
60
|
+
* top-right), flipping only the primary axis (`flip-inline`) moves the popup
|
|
61
|
+
* to the left but keeps the same cross-axis span direction (e.g. upward),
|
|
62
|
+
* which is still off-screen. The combined keyword `flip-inline flip-block`
|
|
63
|
+
* mirrors the popup diagonally — it flips BOTH the position-area AND both
|
|
64
|
+
* inline and block margins simultaneously, placing the popup at the
|
|
65
|
+
* diagonally opposite corner where there is always space.
|
|
66
|
+
*
|
|
67
|
+
* Named `position-area` entries (e.g. `inline-start span-block-end`) in
|
|
68
|
+
* `position-try-fallbacks` do NOT update margins, so only the `flip-*`
|
|
69
|
+
* tactic keywords correctly flip the gap margin along with the position.
|
|
56
70
|
*/
|
|
57
71
|
export declare function placementToTryFallbacks({ placement }: {
|
|
58
72
|
placement: TPlacementOptions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/top-layer",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "Low-level layering primitives based on popover and dialog",
|
|
5
5
|
"homepage": "https://atlassian.design/components/top-layer",
|
|
6
6
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|