report-studio 1.3.0 → 1.3.1
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/dist/{designer-Dj330bWd.js → designer-_sWqzOj8.js} +1361 -999
- package/dist/designer.js +1 -1
- package/dist/index.js +1 -1
- package/dist/react-designer.js +1 -1
- package/dist/react.js +1 -1
- package/dist/{viewer-BewnkhfP.js → viewer-4I7C1Rnd.js} +1053 -998
- package/package.json +1 -1
- package/src/designer/choice.js +368 -0
- package/src/designer/designer.js +30 -1
- package/src/designer/dialog.js +49 -25
- package/src/designer/fields.js +219 -27
- package/src/designer/icons.js +13 -0
- package/src/designer/panel.js +419 -56
- package/src/designer/select.js +21 -1
- package/src/designer/styles.css +1196 -545
- package/src/engine/validate.js +39 -0
- package/src/preview/chrome.css +302 -84
- package/src/preview/chrome.js +70 -58
- package/src/preview/viewer.js +137 -85
- package/src/shared/dropdown.css +78 -45
- package/src/shared/dropdown.js +105 -5
- package/src/shared/modal.css +78 -13
- package/types/index.d.ts +8 -1
- package/types/layout.d.ts +8 -0
package/src/designer/select.js
CHANGED
|
@@ -26,6 +26,13 @@ import {
|
|
|
26
26
|
} from './rulers.js';
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* How far, in screen pixels, the pointer goes before a press on an item is a
|
|
31
|
+
* drag rather than a click. The rail's label scrubbing waits for the same.
|
|
32
|
+
*/
|
|
33
|
+
export const DRAG_START = 3;
|
|
34
|
+
|
|
35
|
+
|
|
29
36
|
/**
|
|
30
37
|
* Wires selection, dragging and resizing onto a designer canvas.
|
|
31
38
|
*
|
|
@@ -380,7 +387,20 @@ export function attachEditing({
|
|
|
380
387
|
|
|
381
388
|
setMeasuring(event.altKey);
|
|
382
389
|
|
|
383
|
-
|
|
390
|
+
/**
|
|
391
|
+
* A press only becomes a drag once the pointer has really gone
|
|
392
|
+
* somewhere - measured on the screen, not the page, so it is the same
|
|
393
|
+
* flick of the wrist at every zoom.
|
|
394
|
+
*
|
|
395
|
+
* It used to be one page pixel, which a hand resting on a mouse moves
|
|
396
|
+
* during an ordinary click. That click then counted as a drag: the
|
|
397
|
+
* item went to the nearest 10px grid line and to any edge within
|
|
398
|
+
* SNAP of it - a box at y 44 clicked to select it landed on 40 - and
|
|
399
|
+
* the move was saved as an undo step nobody had made.
|
|
400
|
+
*/
|
|
401
|
+
if (!drag.moved
|
|
402
|
+
&& Math.abs(event.clientX - drag.startX) < DRAG_START
|
|
403
|
+
&& Math.abs(event.clientY - drag.startY) < DRAG_START) return;
|
|
384
404
|
drag.moved = true;
|
|
385
405
|
|
|
386
406
|
if (drag.mode === 'resize') {
|