@pie-lib/mask-markup 2.2.0-next.18 → 2.2.0-next.19
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
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.2.0-next.19](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@2.2.0-next.18...@pie-lib/mask-markup@2.2.0-next.19) (2026-03-18)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **mask-markup:** add tests for new getMeasureNode method PD-5501 ([85bd3f6](https://github.com/pie-framework/pie-lib/commit/85bd3f6ea7610819b676bc0113151bd8ef06709f))
|
|
11
|
+
|
|
6
12
|
# [2.2.0-next.18](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@2.2.0-next.17...@pie-lib/mask-markup@2.2.0-next.18) (2026-03-18)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-lib/mask-markup",
|
|
3
|
-
"version": "2.2.0-next.
|
|
3
|
+
"version": "2.2.0-next.19",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@mui/icons-material": "^7.3.4",
|
|
15
15
|
"@mui/material": "^7.3.4",
|
|
16
16
|
"@pie-lib/drag": "^3.2.0-next.5",
|
|
17
|
-
"@pie-lib/editable-html-tip-tap": "^1.2.0-next.
|
|
17
|
+
"@pie-lib/editable-html-tip-tap": "^1.2.0-next.18",
|
|
18
18
|
"@pie-lib/math-rendering": "^4.2.0-next.3",
|
|
19
19
|
"@pie-lib/render-ui": "^5.2.0-next.5",
|
|
20
20
|
"classnames": "^2.2.6",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"keywords": [],
|
|
29
29
|
"author": "",
|
|
30
30
|
"license": "ISC",
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "48c079ea6b6b93ca69bd800906e1d8f258c05335"
|
|
32
32
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { render, screen, act } from '@testing-library/react';
|
|
3
3
|
import Blank from '../blank';
|
|
4
4
|
|
|
5
5
|
// Mock @dnd-kit hooks to avoid DndContext requirement
|
|
@@ -120,6 +120,38 @@ describe('Blank', () => {
|
|
|
120
120
|
);
|
|
121
121
|
expect(container.firstChild).toBeInTheDocument();
|
|
122
122
|
});
|
|
123
|
+
|
|
124
|
+
it('computes chip dimensions based on content when no emptyResponseArea size is provided', () => {
|
|
125
|
+
jest.useFakeTimers();
|
|
126
|
+
// Mock getBoundingClientRect to simulate measured content size
|
|
127
|
+
const rectSpy = jest
|
|
128
|
+
.spyOn(HTMLElement.prototype, 'getBoundingClientRect')
|
|
129
|
+
.mockReturnValue({ width: 100, height: 20, top: 0, left: 0, right: 100, bottom: 20 });
|
|
130
|
+
|
|
131
|
+
const { container } = render(
|
|
132
|
+
<Blank
|
|
133
|
+
{...defaultProps}
|
|
134
|
+
// Force measurement path that uses getMeasureNode / updateDimensions
|
|
135
|
+
emptyResponseAreaHeight={0}
|
|
136
|
+
emptyResponseAreaWidth={0}
|
|
137
|
+
/>,
|
|
138
|
+
);
|
|
139
|
+
|
|
140
|
+
// Let the internal timeout in handleElements / updateDimensions run
|
|
141
|
+
act(() => {
|
|
142
|
+
jest.runAllTimers();
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
const wrapper = container.firstChild; // StyledContent
|
|
146
|
+
const chip = wrapper && wrapper.firstChild; // StyledChip (rootRef)
|
|
147
|
+
|
|
148
|
+
// Width and height should include padding (24px) around measured content
|
|
149
|
+
expect(chip.style.width).toBe('124px');
|
|
150
|
+
expect(chip.style.height).toBe('44px');
|
|
151
|
+
|
|
152
|
+
rectSpy.mockRestore();
|
|
153
|
+
jest.useRealTimers();
|
|
154
|
+
});
|
|
123
155
|
});
|
|
124
156
|
|
|
125
157
|
describe('drag and drop', () => {
|