@pie-lib/tools 0.9.24 → 0.9.26-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
- ## [0.9.24](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.22...@pie-lib/tools@0.9.24) (2021-06-25)
6
+ ## [0.9.25](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.24...@pie-lib/tools@0.9.25) (2022-11-23)
7
7
 
8
8
  **Note:** Version bump only for package @pie-lib/tools
9
9
 
@@ -11,505 +11,310 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
- ## [0.9.22](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.21...@pie-lib/tools@0.9.22) (2021-02-15)
14
+ ## [0.9.24](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.22...@pie-lib/tools@0.9.24) (2021-06-25)
15
15
 
16
16
  **Note:** Version bump only for package @pie-lib/tools
17
17
 
18
+ ## [0.9.22](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.21...@pie-lib/tools@0.9.22) (2021-02-15)
18
19
 
19
-
20
-
20
+ **Note:** Version bump only for package @pie-lib/tools
21
21
 
22
22
  ## [0.9.21](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.19...@pie-lib/tools@0.9.21) (2021-02-15)
23
23
 
24
24
  **Note:** Version bump only for package @pie-lib/tools
25
25
 
26
-
27
-
28
-
29
-
30
26
  ## [0.9.19](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.18...@pie-lib/tools@0.9.19) (2020-04-14)
31
27
 
32
28
  **Note:** Version bump only for package @pie-lib/tools
33
29
 
34
-
35
-
36
-
37
-
38
30
  ## [0.9.18](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.17...@pie-lib/tools@0.9.18) (2020-04-08)
39
31
 
40
32
  **Note:** Version bump only for package @pie-lib/tools
41
33
 
42
-
43
-
44
-
45
-
46
34
  ## [0.9.17](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.16...@pie-lib/tools@0.9.17) (2020-03-31)
47
35
 
48
36
  **Note:** Version bump only for package @pie-lib/tools
49
37
 
50
-
51
-
52
-
53
-
54
38
  ## [0.9.16](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.15...@pie-lib/tools@0.9.16) (2020-03-31)
55
39
 
56
40
  **Note:** Version bump only for package @pie-lib/tools
57
41
 
58
-
59
-
60
-
61
-
62
42
  ## [0.9.15](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.14...@pie-lib/tools@0.9.15) (2020-03-31)
63
43
 
64
44
  **Note:** Version bump only for package @pie-lib/tools
65
45
 
66
-
67
-
68
-
69
-
70
46
  ## [0.9.14](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.13...@pie-lib/tools@0.9.14) (2020-03-30)
71
47
 
72
48
  **Note:** Version bump only for package @pie-lib/tools
73
49
 
74
-
75
-
76
-
77
-
78
50
  ## [0.9.13](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.12...@pie-lib/tools@0.9.13) (2020-03-30)
79
51
 
80
52
  **Note:** Version bump only for package @pie-lib/tools
81
53
 
82
-
83
-
84
-
85
-
86
54
  ## [0.9.12](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.11...@pie-lib/tools@0.9.12) (2020-03-30)
87
55
 
88
56
  **Note:** Version bump only for package @pie-lib/tools
89
57
 
90
-
91
-
92
-
93
-
94
58
  ## [0.9.11](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.10...@pie-lib/tools@0.9.11) (2020-03-30)
95
59
 
96
60
  **Note:** Version bump only for package @pie-lib/tools
97
61
 
98
-
99
-
100
-
101
-
102
62
  ## [0.9.10](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.9...@pie-lib/tools@0.9.10) (2020-03-30)
103
63
 
104
64
  **Note:** Version bump only for package @pie-lib/tools
105
65
 
106
-
107
-
108
-
109
-
110
66
  ## [0.9.9](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.8...@pie-lib/tools@0.9.9) (2020-03-30)
111
67
 
112
68
  **Note:** Version bump only for package @pie-lib/tools
113
69
 
114
-
115
-
116
-
117
-
118
70
  ## [0.9.8](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.7...@pie-lib/tools@0.9.8) (2020-03-30)
119
71
 
120
-
121
72
  ### Bug Fixes
122
73
 
123
- * add module prop to package.json ([09543ca](https://github.com/pie-framework/pie-lib/commit/09543ca))
124
-
125
-
126
-
127
-
74
+ - add module prop to package.json ([09543ca](https://github.com/pie-framework/pie-lib/commit/09543ca))
128
75
 
129
76
  ## [0.9.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.6...@pie-lib/tools@0.9.7) (2020-03-18)
130
77
 
131
78
  **Note:** Version bump only for package @pie-lib/tools
132
79
 
133
-
134
-
135
-
136
-
137
80
  ## [0.9.6](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.5...@pie-lib/tools@0.9.6) (2020-02-11)
138
81
 
139
82
  **Note:** Version bump only for package @pie-lib/tools
140
83
 
141
-
142
-
143
-
144
-
145
84
  ## [0.9.5](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.4...@pie-lib/tools@0.9.5) (2019-08-21)
146
85
 
147
86
  **Note:** Version bump only for package @pie-lib/tools
148
87
 
149
-
150
-
151
-
152
-
153
88
  ## [0.9.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.3...@pie-lib/tools@0.9.4) (2019-07-08)
154
89
 
155
90
  **Note:** Version bump only for package @pie-lib/tools
156
91
 
157
-
158
-
159
-
160
-
161
92
  ## [0.9.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.2...@pie-lib/tools@0.9.3) (2019-07-05)
162
93
 
163
94
  **Note:** Version bump only for package @pie-lib/tools
164
95
 
165
-
166
-
167
-
168
-
169
96
  ## [0.9.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.1...@pie-lib/tools@0.9.2) (2019-07-02)
170
97
 
171
98
  **Note:** Version bump only for package @pie-lib/tools
172
99
 
173
-
174
-
175
-
176
-
177
100
  ## [0.9.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.9.0...@pie-lib/tools@0.9.1) (2019-06-17)
178
101
 
179
102
  **Note:** Version bump only for package @pie-lib/tools
180
103
 
181
-
182
-
183
-
184
-
185
104
  # [0.9.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.8.11...@pie-lib/tools@0.9.0) (2019-06-12)
186
105
 
187
-
188
106
  ### Features
189
107
 
190
- * version bumps ([23eb54f](https://github.com/pie-framework/pie-lib/commit/23eb54f))
191
-
192
-
193
-
194
-
108
+ - version bumps ([23eb54f](https://github.com/pie-framework/pie-lib/commit/23eb54f))
195
109
 
196
110
  ## [0.8.11](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.8.10...@pie-lib/tools@0.8.11) (2019-03-15)
197
111
 
198
-
199
112
  ### Bug Fixes
200
113
 
201
- * rm child prepack in favour of root prepack ([381d8d6](https://github.com/pie-framework/pie-lib/commit/381d8d6))
202
-
203
-
204
-
205
-
114
+ - rm child prepack in favour of root prepack ([381d8d6](https://github.com/pie-framework/pie-lib/commit/381d8d6))
206
115
 
207
116
  ## [0.8.10](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.8.9...@pie-lib/tools@0.8.10) (2019-03-14)
208
117
 
209
118
  **Note:** Version bump only for package @pie-lib/tools
210
119
 
211
-
212
-
213
-
214
-
215
120
  ## [0.8.9](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.8.8...@pie-lib/tools@0.8.9) (2019-03-14)
216
121
 
217
122
  **Note:** Version bump only for package @pie-lib/tools
218
123
 
219
-
220
-
221
-
222
-
223
124
  ## [0.8.8](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.8.7...@pie-lib/tools@0.8.8) (2019-03-14)
224
125
 
225
126
  **Note:** Version bump only for package @pie-lib/tools
226
127
 
227
-
228
-
229
-
230
-
231
128
  ## [0.8.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.8.6...@pie-lib/tools@0.8.7) (2019-03-14)
232
129
 
233
130
  **Note:** Version bump only for package @pie-lib/tools
234
131
 
235
-
236
-
237
-
238
-
239
132
  ## [0.8.6](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.8.5...@pie-lib/tools@0.8.6) (2019-03-13)
240
133
 
241
134
  **Note:** Version bump only for package @pie-lib/tools
242
135
 
243
-
244
-
245
-
246
-
247
136
  ## [0.8.5](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.8.4...@pie-lib/tools@0.8.5) (2019-03-13)
248
137
 
249
138
  **Note:** Version bump only for package @pie-lib/tools
250
139
 
251
-
252
-
253
-
254
-
255
140
  ## [0.8.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.8.3...@pie-lib/tools@0.8.4) (2019-03-13)
256
141
 
257
142
  **Note:** Version bump only for package @pie-lib/tools
258
143
 
259
-
260
-
261
-
262
-
263
144
  ## [0.8.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.8.2...@pie-lib/tools@0.8.3) (2019-03-12)
264
145
 
265
-
266
146
  ### Bug Fixes
267
147
 
268
- * unfoo fix ([75c78bf](https://github.com/pie-framework/pie-lib/commit/75c78bf))
269
-
270
-
271
-
272
-
148
+ - unfoo fix ([75c78bf](https://github.com/pie-framework/pie-lib/commit/75c78bf))
273
149
 
274
150
  ## [0.8.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.8.1...@pie-lib/tools@0.8.2) (2019-03-12)
275
151
 
276
-
277
152
  ### Bug Fixes
278
153
 
279
- * foo fix ([f54d013](https://github.com/pie-framework/pie-lib/commit/f54d013))
280
-
281
-
282
-
283
-
154
+ - foo fix ([f54d013](https://github.com/pie-framework/pie-lib/commit/f54d013))
284
155
 
285
156
  ## [0.8.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.8.0...@pie-lib/tools@0.8.1) (2019-01-30)
286
157
 
287
158
  **Note:** Version bump only for package @pie-lib/tools
288
159
 
289
-
290
-
291
-
292
-
293
160
  # [0.8.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.7.4...@pie-lib/tools@0.8.0) (2019-01-30)
294
161
 
295
-
296
162
  ### Features
297
163
 
298
- * libs version bump ([f9861fc](https://github.com/pie-framework/pie-lib/commit/f9861fc))
299
-
300
-
301
-
302
-
164
+ - libs version bump ([f9861fc](https://github.com/pie-framework/pie-lib/commit/f9861fc))
303
165
 
304
166
  <a name="0.7.4"></a>
305
- ## [0.7.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.7.3...@pie-lib/tools@0.7.4) (2018-11-16)
306
167
 
168
+ ## [0.7.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.7.3...@pie-lib/tools@0.7.4) (2018-11-16)
307
169
 
308
170
  ### Bug Fixes
309
171
 
310
- * add assert package ([02f13bd](https://github.com/pie-framework/pie-lib/commit/02f13bd))
311
-
312
-
313
-
314
-
172
+ - add assert package ([02f13bd](https://github.com/pie-framework/pie-lib/commit/02f13bd))
315
173
 
316
174
  <a name="0.7.3"></a>
317
- ## [0.7.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.7.2...@pie-lib/tools@0.7.3) (2018-09-12)
318
175
 
176
+ ## [0.7.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.7.2...@pie-lib/tools@0.7.3) (2018-09-12)
319
177
 
320
178
  ### Bug Fixes
321
179
 
322
- * githead ([3e485e0](https://github.com/pie-framework/pie-lib/commit/3e485e0))
323
- * rm githead ([a1523aa](https://github.com/pie-framework/pie-lib/commit/a1523aa))
324
-
325
-
326
-
180
+ - githead ([3e485e0](https://github.com/pie-framework/pie-lib/commit/3e485e0))
181
+ - rm githead ([a1523aa](https://github.com/pie-framework/pie-lib/commit/a1523aa))
327
182
 
328
183
  <a name="0.7.2"></a>
184
+
329
185
  ## [0.7.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.7.0...@pie-lib/tools@0.7.2) (2018-09-12)
330
186
 
331
187
  **Note:** Version bump only for package @pie-lib/tools
332
188
 
333
-
334
-
335
-
336
-
337
189
  <a name="0.7.1"></a>
190
+
338
191
  ## [0.7.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.7.0...@pie-lib/tools@0.7.1) (2018-09-12)
339
192
 
340
193
  **Note:** Version bump only for package @pie-lib/tools
341
194
 
342
-
343
-
344
-
345
-
346
195
  <a name="0.7.0"></a>
347
- # [0.7.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.6.2...@pie-lib/tools@0.7.0) (2018-05-16)
348
196
 
197
+ # [0.7.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.6.2...@pie-lib/tools@0.7.0) (2018-05-16)
349
198
 
350
199
  ### Features
351
200
 
352
- * upgrade material-ui -> [@material-ui](https://github.com/material-ui)/core@^1.0.0-rc.1 ([017ef63](https://github.com/pie-framework/pie-lib/commit/017ef63))
353
-
354
-
355
-
201
+ - upgrade material-ui -> [@material-ui](https://github.com/material-ui)/core@^1.0.0-rc.1 ([017ef63](https://github.com/pie-framework/pie-lib/commit/017ef63))
356
202
 
357
203
  <a name="0.6.2"></a>
358
- ## [0.6.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.6.1...@pie-lib/tools@0.6.2) (2018-05-09)
359
204
 
205
+ ## [0.6.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.6.1...@pie-lib/tools@0.6.2) (2018-05-09)
360
206
 
361
207
  ### Bug Fixes
362
208
 
363
- * **lint:** lint fixes ([f059583](https://github.com/pie-framework/pie-lib/commit/f059583))
364
-
365
-
366
-
209
+ - **lint:** lint fixes ([f059583](https://github.com/pie-framework/pie-lib/commit/f059583))
367
210
 
368
211
  <a name="0.6.1"></a>
369
- ## [0.6.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.6.0...@pie-lib/tools@0.6.1) (2018-05-09)
370
212
 
213
+ ## [0.6.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.6.0...@pie-lib/tools@0.6.1) (2018-05-09)
371
214
 
372
215
  ### Bug Fixes
373
216
 
374
- * **test:** fix test run ([d15ac94](https://github.com/pie-framework/pie-lib/commit/d15ac94))
375
-
376
-
377
-
217
+ - **test:** fix test run ([d15ac94](https://github.com/pie-framework/pie-lib/commit/d15ac94))
378
218
 
379
219
  <a name="0.6.0"></a>
380
- # [0.6.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.5.3...@pie-lib/tools@0.6.0) (2018-05-08)
381
220
 
221
+ # [0.6.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.5.3...@pie-lib/tools@0.6.0) (2018-05-08)
382
222
 
383
223
  ### Features
384
224
 
385
- * **text-select:** Add new text-select package. ([3916c19](https://github.com/pie-framework/pie-lib/commit/3916c19))
386
-
387
-
388
-
225
+ - **text-select:** Add new text-select package. ([3916c19](https://github.com/pie-framework/pie-lib/commit/3916c19))
389
226
 
390
227
  <a name="0.5.3"></a>
391
- ## [0.5.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.5.1...@pie-lib/tools@0.5.3) (2018-05-08)
392
228
 
229
+ ## [0.5.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.5.1...@pie-lib/tools@0.5.3) (2018-05-08)
393
230
 
394
231
  ### Bug Fixes
395
232
 
396
- * **build:** trigger rebuild ([9357023](https://github.com/pie-framework/pie-lib/commit/9357023))
397
-
398
-
399
-
233
+ - **build:** trigger rebuild ([9357023](https://github.com/pie-framework/pie-lib/commit/9357023))
400
234
 
401
235
  <a name="0.5.1"></a>
402
- ## [0.5.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.5.0...@pie-lib/tools@0.5.1) (2018-05-02)
403
-
404
-
405
236
 
237
+ ## [0.5.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.5.0...@pie-lib/tools@0.5.1) (2018-05-02)
406
238
 
407
239
  **Note:** Version bump only for package @pie-lib/tools
408
240
 
409
241
  <a name="0.5.0"></a>
410
- # [0.5.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.4.0...@pie-lib/tools@0.5.0) (2018-05-01)
411
242
 
243
+ # [0.5.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.4.0...@pie-lib/tools@0.5.0) (2018-05-01)
412
244
 
413
245
  ### Features
414
246
 
415
- * **ruler:** add label and tickCount (only for imperial measure) ([9c9069a](https://github.com/pie-framework/pie-lib/commit/9c9069a))
416
-
417
-
418
-
247
+ - **ruler:** add label and tickCount (only for imperial measure) ([9c9069a](https://github.com/pie-framework/pie-lib/commit/9c9069a))
419
248
 
420
249
  <a name="0.4.0"></a>
421
- # [0.4.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.3.0...@pie-lib/tools@0.4.0) (2018-05-01)
422
250
 
251
+ # [0.4.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.3.0...@pie-lib/tools@0.4.0) (2018-05-01)
423
252
 
424
253
  ### Features
425
254
 
426
- * **ruler:** move handles away from ticks ([85353fb](https://github.com/pie-framework/pie-lib/commit/85353fb))
427
-
428
-
429
-
255
+ - **ruler:** move handles away from ticks ([85353fb](https://github.com/pie-framework/pie-lib/commit/85353fb))
430
256
 
431
257
  <a name="0.3.0"></a>
432
- # [0.3.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.2.2...@pie-lib/tools@0.3.0) (2018-05-01)
433
258
 
259
+ # [0.3.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.2.2...@pie-lib/tools@0.3.0) (2018-05-01)
434
260
 
435
261
  ### Features
436
262
 
437
- * **ruler:** add className and startPosition ([bca0544](https://github.com/pie-framework/pie-lib/commit/bca0544))
438
-
439
-
440
-
263
+ - **ruler:** add className and startPosition ([bca0544](https://github.com/pie-framework/pie-lib/commit/bca0544))
441
264
 
442
265
  <a name="0.2.2"></a>
443
- ## [0.2.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.2.1...@pie-lib/tools@0.2.2) (2018-04-30)
444
266
 
267
+ ## [0.2.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.2.1...@pie-lib/tools@0.2.2) (2018-04-30)
445
268
 
446
269
  ### Bug Fixes
447
270
 
448
- * **protractor:** move lines out of circle ([505178d](https://github.com/pie-framework/pie-lib/commit/505178d))
449
-
450
-
451
-
271
+ - **protractor:** move lines out of circle ([505178d](https://github.com/pie-framework/pie-lib/commit/505178d))
452
272
 
453
273
  <a name="0.2.1"></a>
454
- ## [0.2.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.2.0...@pie-lib/tools@0.2.1) (2018-04-30)
455
274
 
275
+ ## [0.2.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.2.0...@pie-lib/tools@0.2.1) (2018-04-30)
456
276
 
457
277
  ### Bug Fixes
458
278
 
459
- * **protractor:** make center circle transparent ([e748293](https://github.com/pie-framework/pie-lib/commit/e748293))
460
-
461
-
462
-
279
+ - **protractor:** make center circle transparent ([e748293](https://github.com/pie-framework/pie-lib/commit/e748293))
463
280
 
464
281
  <a name="0.2.0"></a>
465
- # [0.2.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.1.3...@pie-lib/tools@0.2.0) (2018-04-30)
466
282
 
283
+ # [0.2.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.1.3...@pie-lib/tools@0.2.0) (2018-04-30)
467
284
 
468
285
  ### Features
469
286
 
470
- * **rotatable:** add startPosition and className ([4e93991](https://github.com/pie-framework/pie-lib/commit/4e93991))
471
-
472
-
473
-
287
+ - **rotatable:** add startPosition and className ([4e93991](https://github.com/pie-framework/pie-lib/commit/4e93991))
474
288
 
475
289
  <a name="0.1.3"></a>
476
- ## [0.1.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.1.2...@pie-lib/tools@0.1.3) (2018-04-30)
477
290
 
291
+ ## [0.1.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.1.2...@pie-lib/tools@0.1.3) (2018-04-30)
478
292
 
479
293
  ### Bug Fixes
480
294
 
481
- * **dependencies:** set material-ui version to ^1.0.0-beta.44 ([6fd66bc](https://github.com/pie-framework/pie-lib/commit/6fd66bc))
482
-
483
-
484
-
295
+ - **dependencies:** set material-ui version to ^1.0.0-beta.44 ([6fd66bc](https://github.com/pie-framework/pie-lib/commit/6fd66bc))
485
296
 
486
297
  <a name="0.1.2"></a>
487
- ## [0.1.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.1.1...@pie-lib/tools@0.1.2) (2018-04-30)
488
298
 
299
+ ## [0.1.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.1.1...@pie-lib/tools@0.1.2) (2018-04-30)
489
300
 
490
301
  ### Bug Fixes
491
302
 
492
- * **dependencies:** lock material-ui to 1.0.0-beta.44 ([60df8e6](https://github.com/pie-framework/pie-lib/commit/60df8e6))
493
-
494
-
495
-
303
+ - **dependencies:** lock material-ui to 1.0.0-beta.44 ([60df8e6](https://github.com/pie-framework/pie-lib/commit/60df8e6))
496
304
 
497
305
  <a name="0.1.1"></a>
498
- ## [0.1.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.1.0...@pie-lib/tools@0.1.1) (2018-04-30)
499
306
 
307
+ ## [0.1.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/tools@0.1.0...@pie-lib/tools@0.1.1) (2018-04-30)
500
308
 
501
309
  ### Bug Fixes
502
310
 
503
- * **dependencies:** lock material-ui to 1.0.0-beta.43 ([2a3e087](https://github.com/pie-framework/pie-lib/commit/2a3e087))
504
- * **dependencies:** upgrade material-ui ([b94b50e](https://github.com/pie-framework/pie-lib/commit/b94b50e))
505
-
506
-
507
-
311
+ - **dependencies:** lock material-ui to 1.0.0-beta.43 ([2a3e087](https://github.com/pie-framework/pie-lib/commit/2a3e087))
312
+ - **dependencies:** upgrade material-ui ([b94b50e](https://github.com/pie-framework/pie-lib/commit/b94b50e))
508
313
 
509
314
  <a name="0.1.0"></a>
510
- # 0.1.0 (2018-04-30)
511
315
 
316
+ # 0.1.0 (2018-04-30)
512
317
 
513
318
  ### Features
514
319
 
515
- * **tools:** Add new 'tools' package. ([9217d0c](https://github.com/pie-framework/pie-lib/commit/9217d0c))
320
+ - **tools:** Add new 'tools' package. ([9217d0c](https://github.com/pie-framework/pie-lib/commit/9217d0c))
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
- exports.getAnchor = exports.getLeft = exports.getTop = exports.getAngleAndHypotenuse = exports.arctangent = exports.getXAndY = exports.distanceBetween = exports.toPoint = exports.normalizeAngle = exports.toRadians = exports.toDegrees = void 0;
8
+ exports.toRadians = exports.toPoint = exports.toDegrees = exports.normalizeAngle = exports.getXAndY = exports.getTop = exports.getLeft = exports.getAngleAndHypotenuse = exports.getAnchor = exports.distanceBetween = exports.arctangent = void 0;
7
9
 
8
10
  var _trigonometryCalculator = require("trigonometry-calculator");
9
11
 
@@ -13,8 +15,6 @@ var _debug = _interopRequireDefault(require("debug"));
13
15
 
14
16
  var _transformOrigin = require("./transform-origin");
15
17
 
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
-
18
18
  var log = (0, _debug["default"])('@pie-lib:tools:anchor-utils');
19
19
 
20
20
  var toDegrees = function toDegrees(radians) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/anchor-utils.js"],"names":["log","toDegrees","radians","Math","PI","toRadians","degrees","normalizeAngle","a","toPoint","rect","edge","out","Point","x","y","distanceBetween","from","to","center","width","height","fromCenter","rotateAround","toCenter","diff","sub","getXAndY","corner","point","arctangent","atan2","getAngleAndHypotenuse","hypotenuse","sqrt","pow","getPosition","side","angle","calcAngle","points","anglePoints","key","ra","t","angles","sides","getTop","abs","getLeft","getAnchor","Error","top","left"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;AACA,IAAMA,GAAG,GAAG,uBAAM,6BAAN,CAAZ;;AAEO,IAAMC,SAAS,GAAG,SAAZA,SAAY,CAAAC,OAAO;AAAA,SAAIA,OAAO,IAAI,MAAMC,IAAI,CAACC,EAAf,CAAX;AAAA,CAAzB;;;;AACA,IAAMC,SAAS,GAAG,SAAZA,SAAY,CAAAC,OAAO;AAAA,SAAIA,OAAO,IAAIH,IAAI,CAACC,EAAL,GAAU,GAAd,CAAX;AAAA,CAAzB;;;;AAEA,IAAMG,cAAc,GAAG,SAAjBA,cAAiB,CAAAC,CAAC,EAAI;AACjC,MAAIA,CAAC,GAAG,GAAR,EAAa;AACX,WAAOA,CAAC,GAAG,GAAX;AACD,GAFD,MAEO,IAAIA,CAAC,GAAG,CAAR,EAAW;AAChB,WAAO,MAAOA,CAAC,GAAG,GAAlB;AACD;;AACD,SAAOA,CAAP;AACD,CAPM;;;;AASA,IAAMC,OAAO,GAAG,SAAVA,OAAU,CAACC,IAAD,EAAOC,IAAP,EAAgB;AACrC,MAAMC,GAAG,GAAG,4BAAYF,IAAZ,EAAkBC,IAAlB,CAAZ;AACA,SAAO,IAAIE,yBAAJ,CAAUD,GAAG,CAACE,CAAd,EAAiBF,GAAG,CAACG,CAArB,CAAP;AACD,CAHM;AAKP;;;;;;;;;;;;AAQO,IAAMC,eAA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,EAAJA;AAAP,GAAP;AACD,CAdM;;;;AAgBP,IAAMZ,WAAW,GAAG,SAAdA,WAAc,CAAAH,KAAK,EAAI;AAC3B,MAAIA,KAAK,IAAI,EAAb,EAAiB;AACf,WAAO;AAAEc,MAAAA,GAAG,EAAE,UAAP;AAAmBC,MAAAA,IAAI,EAAE;AAAzB,KAAP;AACD,GAFD,MAEO,IAAIf,KAAK,GAAG,EAAR,IAAcA,KAAK,IAAI,GAA3B,EAAgC;AACrC,WAAO;AAAEc,MAAAA,GAAG,EAAE,aAAP;AAAsBC,MAAAA,IAAI,EAAE;AAA5B,KAAP;AACD,GAFM,MAEA,IAAIf,KAAK,GAAG,GAAR,IAAeA,KAAK,IAAI,GAA5B,EAAiC;AACtC,WAAO;AAAEc,MAAAA,GAAG,EAAE,cAAP;AAAuBC,MAAAA,IAAI,EAAE;AAA7B,KAAP;AACD,GAFM,MAEA,IAAIf,KAAK,GAAG,GAAR,IAAeA,KAAK,GAAG,GAA3B,EAAgC;AACrC,WAAO;AAAEc,MAAAA,GAAG,EAAE,WAAP;AAAoBC,MAAAA,IAAI,EAAE;AAA1B,KAAP;AACD;AACF,CAVD","sourcesContent":["import { trigCalculator } from 'trigonometry-calculator';\nimport Point from '@mapbox/point-geometry';\nimport debug from 'debug';\nimport { parse as parseOrigin } from './transform-origin';\nconst log = debug('@pie-lib:tools:anchor-utils');\n\nexport const toDegrees = radians => radians * (180 / Math.PI);\nexport const toRadians = degrees => degrees * (Math.PI / 180);\n\nexport const normalizeAngle = a => {\n if (a > 360) {\n return a % 360;\n } else if (a < 0) {\n return 360 + (a % 360);\n }\n return a;\n};\n\nexport const toPoint = (rect, edge) => {\n const out = parseOrigin(rect, edge);\n return new Point(out.x, out.y);\n};\n\n/**\n * Get the distance between to anchor points in a rect.\n * @param {{width: number, height: number}} rect - the rect\n * @param {number} degrees - the degrees\n * @param {string} from - from anchor\n * @param {string} to - to anchor\n * @returns {Point} point - the distance as a Point\n */\nexport const distanceBetween = (rect, degrees, from, to) => {\n const center = new Point(rect.width / 2, rect.height / 2);\n const radians = toRadians(degrees);\n const fromCenter = center.rotateAround(radians, toPoint(rect, from));\n const toCenter = center.rotateAround(radians, toPoint(rect, to));\n const diff = fromCenter.sub(toCenter);\n return diff;\n};\n\n/**\n * For a corner string, a point and a rect, return a relative x,y from that point to a corner.\n * Note that the y value descends as it goes down (unlike for a screen's y value), so this is only really useful for math functions.\n * @example\n * ```\n * getXAndY('top-left', {width: 100, height: 100}, 10, 10) //=> {x:10, y: -90}\n * ```\n * @param {*} corner\n * @param {*} rect\n * @param {*} point\n */\nexport const getXAndY = (corner, rect, point) => {\n if (corner === 'top-left') {\n const x = point.x * -1;\n const y = point.y;\n return { x, y };\n } else if (corner === 'bottom-left') {\n const x = point.x * -1;\n const y = point.y - rect.height;\n return { x, y };\n } else if (corner === 'top-right') {\n const x = rect.width - point.x;\n const y = point.y;\n return { x, y };\n } else if (corner === 'bottom-right') {\n const x = rect.width - point.x;\n const y = point.y - rect.height;\n return { x, y };\n }\n};\n\nexport const arctangent = (x, y) => toDegrees(Math.atan2(x, y));\n\nexport const getAngleAndHypotenuse = (corner, rect, point) => {\n const { x, y } = getXAndY(corner, rect, point);\n const degrees = arctangent(x, y);\n const hypotenuse = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));\n return { x, y, degrees, hypotenuse };\n};\n\nconst getPosition = (side, rect, point, angle, calcAngle) => {\n if (angle === 0) {\n return side === 'left' ? point.x : point.y;\n }\n const points = anglePoints(angle);\n const key = points[side];\n\n const { degrees, hypotenuse } = getAngleAndHypotenuse(key, rect, point);\n\n const ra = calcAngle(degrees);\n\n if (ra === 0) {\n return hypotenuse;\n }\n\n const t = {\n angles: { 0: ra, 1: 90 },\n sides: { 1: hypotenuse }\n };\n const out = trigCalculator(t);\n return out.sides[2];\n};\n\nexport const getTop = (rect, point, angle) => {\n return getPosition('top', rect, point, angle, degrees => {\n return Math.abs(angle + degrees);\n });\n};\n\nexport const getLeft = (rect, point, angle) => {\n return getPosition('left', rect, point, angle, degrees => {\n return Math.abs(angle + degrees + 90);\n });\n};\n\n/**\n * Calculate the position of an anchor within a bounding rect, if the source rect has been rotated by an angle.\n * It does this by finding the appropriate corner of the src rect, that touches the bounding rect, calculates\n * the hypotenuse (h) of that anchor to that point. Then using that plus the rotation it calculates\n * the sides of the triangle and returns the length of the side that touches the bounding rect.\n * @param {{width: number, height: number}} rect - the rect which contains the point\n * @param {{x:number, y: number}} point - the point within the rect\n * @param {number} angle - the angle in degrees that the rect has rotated.\n * @returns {{left: number, top: number}} position\n */\nexport const getAnchor = (rect, point, angle) => {\n log('[getAnchor] rect: ', rect, 'point:', point, 'angle: ', angle);\n if (point.x > rect.width) {\n throw new Error(`x: ${point.x} cannot be greater than width: ${rect.width}`);\n }\n if (point.y > rect.height) {\n throw new Error(`y: ${point.y} cannot be greater than height: ${rect.height}`);\n }\n const a = normalizeAngle(angle);\n const top = getTop(rect, point, a);\n const left = getLeft(rect, point, a);\n\n log('[getAnchor] top: ', top, 'left: ', left);\n return { top, left };\n};\n\nconst anglePoints = angle => {\n if (angle <= 90) {\n return { top: 'top-left', left: 'bottom-left' };\n } else if (angle > 90 && angle <= 180) {\n return { top: 'bottom-left', left: 'bottom-right' };\n } else if (angle > 180 && angle <= 270) {\n return { top: 'bottom-right', left: 'top-right' };\n } else if (angle > 270 && angle < 360) {\n return { top: 'top-right', left: 'top-left' };\n }\n};\n"],"file":"anchor-utils.js"}
1
+ {"version":3,"sources":["../src/anchor-utils.js"],"names":["log","toDegrees","radians","Math","PI","toRadians","degrees","normalizeAngle","a","toPoint","rect","edge","out","Point","x","y","distanceBetween","from","to","center","width","height","fromCenter","rotateAround","toCenter","diff","sub","getXAndY","corner","point","arctangent","atan2","getAngleAndHypotenuse","hypotenuse","sqrt","pow","getPosition","side","angle","calcAngle","points","anglePoints","key","ra","t","angles","sides","getTop","abs","getLeft","getAnchor","Error","top","left"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;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AP;AAAsBC,MAAAA,IAAI,EAAE;AAA5B,KAAP;AACD,GAFM,MAEA,IAAIf,KAAK,GAAG,GAAR,IAAeA,KAAK,IAAI,GAA5B,EAAiC;AACtC,WAAO;AAAEc,MAAAA,GAAG,EAAE,cAAP;AAAuBC,MAAAA,IAAI,EAAE;AAA7B,KAAP;AACD,GAFM,MAEA,IAAIf,KAAK,GAAG,GAAR,IAAeA,KAAK,GAAG,GAA3B,EAAgC;AACrC,WAAO;AAAEc,MAAAA,GAAG,EAAE,WAAP;AAAoBC,MAAAA,IAAI,EAAE;AAA1B,KAAP;AACD;AACF,CAVD","sourcesContent":["import { trigCalculator } from 'trigonometry-calculator';\nimport Point from '@mapbox/point-geometry';\nimport debug from 'debug';\nimport { parse as parseOrigin } from './transform-origin';\nconst log = debug('@pie-lib:tools:anchor-utils');\n\nexport const toDegrees = (radians) => radians * (180 / Math.PI);\nexport const toRadians = (degrees) => degrees * (Math.PI / 180);\n\nexport const normalizeAngle = (a) => {\n if (a > 360) {\n return a % 360;\n } else if (a < 0) {\n return 360 + (a % 360);\n }\n return a;\n};\n\nexport const toPoint = (rect, edge) => {\n const out = parseOrigin(rect, edge);\n return new Point(out.x, out.y);\n};\n\n/**\n * Get the distance between to anchor points in a rect.\n * @param {{width: number, height: number}} rect - the rect\n * @param {number} degrees - the degrees\n * @param {string} from - from anchor\n * @param {string} to - to anchor\n * @returns {Point} point - the distance as a Point\n */\nexport const distanceBetween = (rect, degrees, from, to) => {\n const center = new Point(rect.width / 2, rect.height / 2);\n const radians = toRadians(degrees);\n const fromCenter = center.rotateAround(radians, toPoint(rect, from));\n const toCenter = center.rotateAround(radians, toPoint(rect, to));\n const diff = fromCenter.sub(toCenter);\n return diff;\n};\n\n/**\n * For a corner string, a point and a rect, return a relative x,y from that point to a corner.\n * Note that the y value descends as it goes down (unlike for a screen's y value), so this is only really useful for math functions.\n * @example\n * ```\n * getXAndY('top-left', {width: 100, height: 100}, 10, 10) //=> {x:10, y: -90}\n * ```\n * @param {*} corner\n * @param {*} rect\n * @param {*} point\n */\nexport const getXAndY = (corner, rect, point) => {\n if (corner === 'top-left') {\n const x = point.x * -1;\n const y = point.y;\n return { x, y };\n } else if (corner === 'bottom-left') {\n const x = point.x * -1;\n const y = point.y - rect.height;\n return { x, y };\n } else if (corner === 'top-right') {\n const x = rect.width - point.x;\n const y = point.y;\n return { x, y };\n } else if (corner === 'bottom-right') {\n const x = rect.width - point.x;\n const y = point.y - rect.height;\n return { x, y };\n }\n};\n\nexport const arctangent = (x, y) => toDegrees(Math.atan2(x, y));\n\nexport const getAngleAndHypotenuse = (corner, rect, point) => {\n const { x, y } = getXAndY(corner, rect, point);\n const degrees = arctangent(x, y);\n const hypotenuse = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));\n return { x, y, degrees, hypotenuse };\n};\n\nconst getPosition = (side, rect, point, angle, calcAngle) => {\n if (angle === 0) {\n return side === 'left' ? point.x : point.y;\n }\n const points = anglePoints(angle);\n const key = points[side];\n\n const { degrees, hypotenuse } = getAngleAndHypotenuse(key, rect, point);\n\n const ra = calcAngle(degrees);\n\n if (ra === 0) {\n return hypotenuse;\n }\n\n const t = {\n angles: { 0: ra, 1: 90 },\n sides: { 1: hypotenuse },\n };\n const out = trigCalculator(t);\n return out.sides[2];\n};\n\nexport const getTop = (rect, point, angle) => {\n return getPosition('top', rect, point, angle, (degrees) => {\n return Math.abs(angle + degrees);\n });\n};\n\nexport const getLeft = (rect, point, angle) => {\n return getPosition('left', rect, point, angle, (degrees) => {\n return Math.abs(angle + degrees + 90);\n });\n};\n\n/**\n * Calculate the position of an anchor within a bounding rect, if the source rect has been rotated by an angle.\n * It does this by finding the appropriate corner of the src rect, that touches the bounding rect, calculates\n * the hypotenuse (h) of that anchor to that point. Then using that plus the rotation it calculates\n * the sides of the triangle and returns the length of the side that touches the bounding rect.\n * @param {{width: number, height: number}} rect - the rect which contains the point\n * @param {{x:number, y: number}} point - the point within the rect\n * @param {number} angle - the angle in degrees that the rect has rotated.\n * @returns {{left: number, top: number}} position\n */\nexport const getAnchor = (rect, point, angle) => {\n log('[getAnchor] rect: ', rect, 'point:', point, 'angle: ', angle);\n if (point.x > rect.width) {\n throw new Error(`x: ${point.x} cannot be greater than width: ${rect.width}`);\n }\n if (point.y > rect.height) {\n throw new Error(`y: ${point.y} cannot be greater than height: ${rect.height}`);\n }\n const a = normalizeAngle(angle);\n const top = getTop(rect, point, a);\n const left = getLeft(rect, point, a);\n\n log('[getAnchor] top: ', top, 'left: ', left);\n return { top, left };\n};\n\nconst anglePoints = (angle) => {\n if (angle <= 90) {\n return { top: 'top-left', left: 'bottom-left' };\n } else if (angle > 90 && angle <= 180) {\n return { top: 'bottom-left', left: 'bottom-right' };\n } else if (angle > 180 && angle <= 270) {\n return { top: 'bottom-right', left: 'top-right' };\n } else if (angle > 270 && angle < 360) {\n return { top: 'top-right', left: 'top-left' };\n }\n};\n"],"file":"anchor-utils.js"}
package/lib/anchor.js CHANGED
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -11,8 +13,6 @@ var _styles = require("@material-ui/core/styles");
11
13
 
12
14
  var _classnames = _interopRequireDefault(require("classnames"));
13
15
 
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
-
16
16
  var Anchor = (0, _styles.withStyles)(function (theme) {
17
17
  return {
18
18
  anchor: {
@@ -32,7 +32,7 @@ var Anchor = (0, _styles.withStyles)(function (theme) {
32
32
  })(function (_ref) {
33
33
  var classes = _ref.classes,
34
34
  className = _ref.className;
35
- return _react["default"].createElement("div", {
35
+ return /*#__PURE__*/_react["default"].createElement("div", {
36
36
  className: (0, _classnames["default"])(classes.anchor, className)
37
37
  });
38
38
  });