@pie-lib/drag 2.36.0-mui-update.0 → 3.0.0-next.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 CHANGED
@@ -3,7 +3,7 @@
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.36.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.35.0-mui-update.0...@pie-lib/drag@2.36.0-mui-update.0) (2025-12-29)
6
+ # [3.0.0-next.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.22.3-next.0...@pie-lib/drag@3.0.0-next.0) (2026-01-19)
7
7
 
8
8
  **Note:** Version bump only for package @pie-lib/drag
9
9
 
@@ -11,26 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
- # [2.35.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.34.0-mui-update.0...@pie-lib/drag@2.35.0-mui-update.0) (2025-12-29)
15
-
16
-
17
- ### Bug Fixes
18
-
19
- * drag fixes ([d8920a2](https://github.com/pie-framework/pie-lib/commit/d8920a2b5e6e365c42f03368f9f235fed9090a88))
20
-
21
-
22
-
23
-
24
-
25
- # [2.34.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.33.0-mui-update.0...@pie-lib/drag@2.34.0-mui-update.0) (2025-12-17)
26
-
27
- **Note:** Version bump only for package @pie-lib/drag
28
-
29
-
30
-
31
-
32
-
33
- # [2.33.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.32.0-mui-update.0...@pie-lib/drag@2.33.0-mui-update.0) (2025-12-17)
14
+ ## [2.22.3-next.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.36.0-mui-update.0...@pie-lib/drag@2.22.3-next.0) (2026-01-19)
34
15
 
35
16
  **Note:** Version bump only for package @pie-lib/drag
36
17
 
@@ -38,186 +19,87 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
38
19
 
39
20
 
40
21
 
41
- # [2.32.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.31.0-mui-update.0...@pie-lib/drag@2.32.0-mui-update.0) (2025-12-11)
42
-
43
-
44
- ### Features
45
-
46
- * drag changes for ditb ([fc79ecd](https://github.com/pie-framework/pie-lib/commit/fc79ecdacb5693f1b5dcf19c7114f9cd4bed83ba))
47
- * updates for drag-in-the-blank ([0c096d8](https://github.com/pie-framework/pie-lib/commit/0c096d887f97edecd2dac68cda136b2d265dc7d5))
48
-
49
-
50
-
51
-
52
-
53
- # [2.31.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.30.0-mui-update.0...@pie-lib/drag@2.31.0-mui-update.0) (2025-12-02)
54
-
55
-
56
- ### Bug Fixes
57
-
58
- * drag components ([bea5eaa](https://github.com/pie-framework/pie-lib/commit/bea5eaaa54fc9060ac83bb7d6383b4c9e2491574))
59
-
60
-
61
- ### Features
62
-
63
- * add drag provider onDragStart prop ([0879247](https://github.com/pie-framework/pie-lib/commit/087924747b02ceed710e971e8dbe0291071396af))
64
- * sync latest changes from dev ([c936e9c](https://github.com/pie-framework/pie-lib/commit/c936e9c7f9e095e7d9b9805ac2bf72bd271e05f1))
65
-
66
-
67
-
68
-
69
-
70
22
  ## [2.22.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.22.1...@pie-lib/drag@2.22.2) (2025-11-27)
71
23
 
72
24
  **Note:** Version bump only for package @pie-lib/drag
73
25
 
74
-
75
-
76
-
77
-
78
26
  ## [2.22.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.18.2...@pie-lib/drag@2.22.1) (2025-10-22)
79
27
 
80
28
  **Note:** Version bump only for package @pie-lib/drag
81
29
 
82
-
83
-
84
-
85
-
86
30
  # [2.22.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.21.0...@pie-lib/drag@2.22.0) (2025-10-16)
87
31
 
88
32
  **Note:** Version bump only for package @pie-lib/drag
89
33
 
90
-
91
-
92
-
93
-
94
34
  # [2.21.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.18.0...@pie-lib/drag@2.21.0) (2025-10-16)
95
35
 
96
36
  **Note:** Version bump only for package @pie-lib/drag
97
37
 
98
-
99
-
100
-
101
-
102
38
  # [2.20.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.18.0...@pie-lib/drag@2.20.0) (2025-10-16)
103
39
 
104
40
  **Note:** Version bump only for package @pie-lib/drag
105
41
 
106
-
107
-
108
-
109
-
110
42
  # [2.19.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.18.0...@pie-lib/drag@2.19.0) (2025-10-16)
111
43
 
112
44
  **Note:** Version bump only for package @pie-lib/drag
113
45
 
114
-
115
-
116
-
117
-
118
46
  ## [2.18.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.18.1...@pie-lib/drag@2.18.2) (2025-10-14)
119
47
 
120
48
  **Note:** Version bump only for package @pie-lib/drag
121
49
 
122
-
123
-
124
-
125
-
126
50
  ## [2.18.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.18.0...@pie-lib/drag@2.18.1) (2025-10-09)
127
51
 
128
52
  **Note:** Version bump only for package @pie-lib/drag
129
53
 
130
-
131
-
132
-
133
-
134
54
  # [2.18.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.2.9...@pie-lib/drag@2.18.0) (2025-09-25)
135
55
 
136
-
137
56
  ### Bug Fixes
138
57
 
139
- * fixed pie-lib/icons import [PD-5126] ([dcb506c](https://github.com/pie-framework/pie-lib/commit/dcb506c914a177f6d88bf73247a023bfe71dac1f))
140
-
58
+ - fixed pie-lib/icons import [PD-5126](<[dcb506c](https://github.com/pie-framework/pie-lib/commit/dcb506c914a177f6d88bf73247a023bfe71dac1f)>)
141
59
 
142
60
  ### Features
143
61
 
144
- * split pie-toolbox into multiple packages [PD-5126] ([7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2))
145
-
146
-
147
-
148
-
62
+ - split pie-toolbox into multiple packages [PD-5126](<[7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2)>)
149
63
 
150
64
  # [2.17.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.16.0...@pie-lib/drag@2.17.0) (2025-09-18)
151
65
 
152
66
  **Note:** Version bump only for package @pie-lib/drag
153
67
 
154
-
155
-
156
-
157
-
158
68
  # [2.16.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.15.0...@pie-lib/drag@2.16.0) (2025-09-18)
159
69
 
160
70
  **Note:** Version bump only for package @pie-lib/drag
161
71
 
162
-
163
-
164
-
165
-
166
72
  # [2.15.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.2.9...@pie-lib/drag@2.15.0) (2025-09-18)
167
73
 
168
-
169
74
  ### Bug Fixes
170
75
 
171
- * fixed pie-lib/icons import [PD-5126] ([dcb506c](https://github.com/pie-framework/pie-lib/commit/dcb506c914a177f6d88bf73247a023bfe71dac1f))
172
-
76
+ - fixed pie-lib/icons import [PD-5126](<[dcb506c](https://github.com/pie-framework/pie-lib/commit/dcb506c914a177f6d88bf73247a023bfe71dac1f)>)
173
77
 
174
78
  ### Features
175
79
 
176
- * split pie-toolbox into multiple packages [PD-5126] ([7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2))
177
-
178
-
179
-
180
-
80
+ - split pie-toolbox into multiple packages [PD-5126](<[7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2)>)
181
81
 
182
82
  # [2.14.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.13.0...@pie-lib/drag@2.14.0) (2025-09-17)
183
83
 
184
84
  **Note:** Version bump only for package @pie-lib/drag
185
85
 
186
-
187
-
188
-
189
-
190
86
  # [2.13.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.12.0...@pie-lib/drag@2.13.0) (2025-09-17)
191
87
 
192
88
  **Note:** Version bump only for package @pie-lib/drag
193
89
 
194
-
195
-
196
-
197
-
198
90
  # [2.12.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.11.1...@pie-lib/drag@2.12.0) (2025-09-17)
199
91
 
200
92
  **Note:** Version bump only for package @pie-lib/drag
201
93
 
202
-
203
-
204
-
205
-
206
94
  ## [2.11.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.2.9...@pie-lib/drag@2.11.1) (2025-08-11)
207
95
 
208
-
209
96
  ### Bug Fixes
210
97
 
211
- * fixed pie-lib/icons import [PD-5126] ([dcb506c](https://github.com/pie-framework/pie-lib/commit/dcb506c914a177f6d88bf73247a023bfe71dac1f))
212
-
98
+ - fixed pie-lib/icons import [PD-5126](<[dcb506c](https://github.com/pie-framework/pie-lib/commit/dcb506c914a177f6d88bf73247a023bfe71dac1f)>)
213
99
 
214
100
  ### Features
215
101
 
216
- * split pie-toolbox into multiple packages [PD-5126] ([7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2))
217
-
218
-
219
-
220
-
102
+ - split pie-toolbox into multiple packages [PD-5126](<[7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2)>)
221
103
 
222
104
  # [2.11.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.2.9...@pie-lib/drag@2.11.0) (2025-08-07)
223
105
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/drag",
3
- "version": "2.36.0-mui-update.0",
3
+ "version": "3.0.0-next.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "src/index.js",
@@ -12,8 +12,8 @@
12
12
  "@emotion/style": "^0.8.0",
13
13
  "@mui/icons-material": "^7.3.4",
14
14
  "@mui/material": "^7.3.4",
15
- "@pie-lib/math-rendering": "3.40.0-mui-update.0",
16
- "@pie-lib/render-ui": "4.49.0-mui-update.0",
15
+ "@pie-lib/math-rendering": "3.22.2-next.16",
16
+ "@pie-lib/render-ui": "4.35.3-next.15",
17
17
  "classnames": "^2.2.6",
18
18
  "lodash": "^4.17.11",
19
19
  "prop-types": "^15.7.2",
@@ -25,5 +25,13 @@
25
25
  "scripts": {},
26
26
  "author": "",
27
27
  "license": "ISC",
28
- "gitHead": "1e3f5fd7812b0a334d3b2719026a01c3102398c9"
28
+ "gitHead": "e0f8f2250addd014938f4a631ab86cafe16b2730",
29
+ "exports": {
30
+ ".": {
31
+ "require": "./lib/index.js",
32
+ "import": "./src/index.js",
33
+ "default": "./lib/index.js"
34
+ },
35
+ "./esm": "./esm/index.js"
36
+ }
29
37
  }
@@ -1,48 +1,107 @@
1
- import { shallow } from 'enzyme';
1
+ import { render, screen } from '@testing-library/react';
2
2
  import React from 'react';
3
3
  import { PlaceHolder } from '../placeholder';
4
4
 
5
5
  describe('placeholder', () => {
6
- const wrapper = (extras) => {
7
- const defaults = {
8
- classes: {
9
- placeholder: 'placeholder',
10
- disabled: 'disabled',
11
- over: 'over',
12
- number: 'number',
13
- },
14
- };
15
- const props = { ...defaults, ...extras };
16
- return shallow(<PlaceHolder {...props}> Foo </PlaceHolder>);
6
+ const renderComponent = (extras = {}) => {
7
+ const props = { ...extras };
8
+ return render(<PlaceHolder {...props}>Foo</PlaceHolder>);
17
9
  };
18
10
 
19
- describe('snapshot', () => {
20
- it('reqular', () => {
21
- const w = wrapper();
22
- expect(w).toMatchSnapshot();
11
+ describe('rendering', () => {
12
+ it('renders children content', () => {
13
+ renderComponent();
14
+ expect(screen.getByText('Foo')).toBeInTheDocument();
23
15
  });
24
16
 
25
- it('isOver: true', () => {
26
- expect(wrapper({ isOver: true })).toMatchSnapshot();
17
+ it('renders with regular placeholder class', () => {
18
+ const { container } = renderComponent();
19
+ const placeholder = container.firstChild;
20
+ expect(placeholder).toHaveClass('placeholder');
27
21
  });
28
22
 
29
- it('disabled: true', () => {
30
- expect(wrapper({ disabled: true })).toMatchSnapshot();
23
+ it('applies over class when isOver is true', () => {
24
+ const { container } = renderComponent({ isOver: true });
25
+ const placeholder = container.firstChild;
26
+ expect(placeholder).toHaveClass('over');
31
27
  });
32
28
 
33
- it('className', () => {
34
- expect(wrapper({ className: 'bar' })).toMatchSnapshot();
29
+ it('applies disabled class when disabled is true', () => {
30
+ const { container } = renderComponent({ disabled: true });
31
+ const placeholder = container.firstChild;
32
+ expect(placeholder).toHaveClass('disabled');
35
33
  });
36
34
 
37
- it('specific grid rowsRepeatValue', () => {
38
- const w = wrapper({
35
+ it('applies custom className', () => {
36
+ const { container } = renderComponent({ className: 'bar' });
37
+ const placeholder = container.firstChild;
38
+ expect(placeholder).toHaveClass('bar');
39
+ expect(placeholder).toHaveClass('placeholder');
40
+ });
41
+
42
+ it('applies choice type class', () => {
43
+ const { container } = renderComponent({ type: 'choice' });
44
+ const placeholder = container.firstChild;
45
+ expect(placeholder).toHaveClass('choice');
46
+ });
47
+
48
+ it('applies board class when choiceBoard is true', () => {
49
+ const { container } = renderComponent({ choiceBoard: true });
50
+ const placeholder = container.firstChild;
51
+ expect(placeholder).toHaveClass('board');
52
+ });
53
+
54
+ it('applies categorizeBoard class when choiceBoard and isCategorize are true', () => {
55
+ const { container } = renderComponent({ choiceBoard: true, isCategorize: true });
56
+ const placeholder = container.firstChild;
57
+ expect(placeholder).toHaveClass('categorizeBoard');
58
+ });
59
+
60
+ it('applies verticalPool class when isVerticalPool is true', () => {
61
+ const { container } = renderComponent({ isVerticalPool: true });
62
+ const placeholder = container.firstChild;
63
+ expect(placeholder).toHaveClass('verticalPool');
64
+ });
65
+ });
66
+
67
+ describe('grid styles', () => {
68
+ it('applies grid column styles', () => {
69
+ const { container } = renderComponent({
70
+ grid: { columns: 3 },
71
+ });
72
+ const placeholder = container.firstChild;
73
+ expect(placeholder).toHaveStyle({ gridTemplateColumns: 'repeat(3, 1fr)' });
74
+ });
75
+
76
+ it('applies grid row styles with default value', () => {
77
+ const { container } = renderComponent({
78
+ grid: { rows: 2 },
79
+ });
80
+ const placeholder = container.firstChild;
81
+ expect(placeholder).toHaveStyle({ gridTemplateRows: 'repeat(2, 1fr)' });
82
+ });
83
+
84
+ it('applies grid row styles with custom rowsRepeatValue', () => {
85
+ const { container } = renderComponent({
39
86
  grid: {
40
87
  rows: 2,
41
88
  columns: 1,
42
89
  rowsRepeatValue: 'min-content',
43
90
  },
44
91
  });
45
- expect(w).toMatchSnapshot();
92
+ const placeholder = container.firstChild;
93
+ expect(placeholder).toHaveStyle({
94
+ gridTemplateRows: 'repeat(2, min-content)',
95
+ gridTemplateColumns: 'repeat(1, 1fr)',
96
+ });
97
+ });
98
+ });
99
+
100
+ describe('min height', () => {
101
+ it('applies minHeight style when provided', () => {
102
+ const { container } = renderComponent({ minHeight: 200 });
103
+ const placeholder = container.firstChild;
104
+ expect(placeholder).toHaveStyle({ minHeight: '200px' });
46
105
  });
47
106
  });
48
107
  });
@@ -1,21 +1,54 @@
1
- import { createContext, createElement } from 'react';
2
- import { withUid } from '../uid-context';
3
-
4
- jest.mock('react', () => ({
5
- createElement: jest.fn((c) => c),
6
- createContext: jest.fn().mockReturnValue({
7
- Consumer: jest.fn((fn) => fn),
8
- Provider: jest.fn(),
9
- }),
10
- }));
11
-
12
- describe('id-context', () => {
1
+ import React from 'react';
2
+ import { render, screen } from '@testing-library/react';
3
+ import { withUid, Provider as UidProvider } from '../uid-context';
4
+
5
+ describe('uid-context', () => {
13
6
  describe('withUid', () => {
14
- it('calls createElement', () => {
15
- const Wrapped = withUid(() => ({}));
7
+ it('provides uid to wrapped component', () => {
8
+ const TestComponent = ({ uid }) => <div data-testid="test-uid">{uid}</div>;
9
+ const WrappedComponent = withUid(TestComponent);
10
+
11
+ render(
12
+ <UidProvider value="test-uid-123">
13
+ <WrappedComponent />
14
+ </UidProvider>,
15
+ );
16
+
17
+ expect(screen.getByTestId('test-uid')).toHaveTextContent('test-uid-123');
18
+ });
19
+
20
+ it('passes through other props to wrapped component', () => {
21
+ const TestComponent = ({ uid, customProp }) => (
22
+ <div>
23
+ <span data-testid="uid">{uid}</span>
24
+ <span data-testid="custom">{customProp}</span>
25
+ </div>
26
+ );
27
+ const WrappedComponent = withUid(TestComponent);
28
+
29
+ render(
30
+ <UidProvider value="test-uid">
31
+ <WrappedComponent customProp="custom-value" />
32
+ </UidProvider>,
33
+ );
34
+
35
+ expect(screen.getByTestId('uid')).toHaveTextContent('test-uid');
36
+ expect(screen.getByTestId('custom')).toHaveTextContent('custom-value');
37
+ });
38
+ });
39
+
40
+ describe('UidProvider', () => {
41
+ it('provides uid context to children', () => {
42
+ const TestComponent = ({ uid }) => <div data-testid="uid-value">{uid}</div>;
43
+ const WrappedComponent = withUid(TestComponent);
44
+
45
+ render(
46
+ <UidProvider value="provider-uid">
47
+ <WrappedComponent />
48
+ </UidProvider>,
49
+ );
16
50
 
17
- const Consumer = Wrapped({});
18
- expect(createElement).toBeCalledWith(expect.any(Function), null, expect.anything());
51
+ expect(screen.getByTestId('uid-value')).toHaveTextContent('provider-uid');
19
52
  });
20
53
  });
21
54
  });
@@ -1,68 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`placeholder snapshot className 1`] = `
4
- <div
5
- className="placeholder bar"
6
- style={
7
- Object {
8
- "minHeight": undefined,
9
- }
10
- }
11
- >
12
- Foo
13
- </div>
14
- `;
15
-
16
- exports[`placeholder snapshot disabled: true 1`] = `
17
- <div
18
- className="placeholder disabled"
19
- style={
20
- Object {
21
- "minHeight": undefined,
22
- }
23
- }
24
- >
25
- Foo
26
- </div>
27
- `;
28
-
29
- exports[`placeholder snapshot isOver: true 1`] = `
30
- <div
31
- className="placeholder over"
32
- style={
33
- Object {
34
- "minHeight": undefined,
35
- }
36
- }
37
- >
38
- Foo
39
- </div>
40
- `;
41
-
42
- exports[`placeholder snapshot reqular 1`] = `
43
- <div
44
- className="placeholder"
45
- style={
46
- Object {
47
- "minHeight": undefined,
48
- }
49
- }
50
- >
51
- Foo
52
- </div>
53
- `;
54
-
55
- exports[`placeholder snapshot specific grid rowsRepeatValue 1`] = `
56
- <div
57
- className="placeholder"
58
- style={
59
- Object {
60
- "gridTemplateColumns": "repeat(1, 1fr)",
61
- "gridTemplateRows": "repeat(2, min-content)",
62
- "minHeight": undefined,
63
- }
64
- }
65
- >
66
- Foo
67
- </div>
68
- `;