mesurer 0.0.3 → 0.0.5
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 +11 -0
- package/README.md +28 -4
- package/dist/index.cjs +4 -5
- package/dist/index.js +4 -5
- package/package.json +3 -2
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<picture>
|
|
2
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://mesurer.
|
|
3
|
-
<img src="https://mesurer.
|
|
2
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://mesurer.dev/logo-dark.svg">
|
|
3
|
+
<img src="https://mesurer.dev/logo.svg" alt="Mesurer" width="200">
|
|
4
4
|
</picture>
|
|
5
5
|
|
|
6
6
|
<br>
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
[](https://www.npmjs.com/package/mesurer)
|
|
9
9
|
[](https://www.npmjs.com/package/mesurer)
|
|
10
10
|
|
|
11
|
-
**[Mesurer](https://mesurer.
|
|
11
|
+
**[Mesurer](https://mesurer.dev)** is a lightweight measurement and alignment overlay for React apps. Toggle it on, select elements, and measure distances directly in the browser.
|
|
12
12
|
|
|
13
|
-
[Full documentation](https://mesurer.
|
|
13
|
+
[Full documentation](https://mesurer.dev/)
|
|
14
14
|
|
|
15
15
|
## Install
|
|
16
16
|
|
|
@@ -35,6 +35,30 @@ function App() {
|
|
|
35
35
|
|
|
36
36
|
No additional CSS import is required.
|
|
37
37
|
|
|
38
|
+
## Props
|
|
39
|
+
|
|
40
|
+
| Prop | Description |
|
|
41
|
+
| --- | --- |
|
|
42
|
+
| `highlightColor` | Base color for selection/hover overlays (defaults to `oklch(0.62 0.18 255)`). |
|
|
43
|
+
| `guideColor` | Base color for guides (defaults to `oklch(0.63 0.26 29.23)`). |
|
|
44
|
+
| `hoverHighlightEnabled` | Disables hover highlight and deselects on click when `false`. |
|
|
45
|
+
| `persistOnReload` | Persists state in `localStorage` as `mesurer-state` when `true`. |
|
|
46
|
+
|
|
47
|
+
## Commands
|
|
48
|
+
|
|
49
|
+
| Shortcut | Action |
|
|
50
|
+
| --- | --- |
|
|
51
|
+
| `M` | Toggle measurer on/off. |
|
|
52
|
+
| `S` | Toggle Select mode. |
|
|
53
|
+
| `G` | Toggle Guides mode. |
|
|
54
|
+
| `H` | Set guide orientation to horizontal. |
|
|
55
|
+
| `V` | Set guide orientation to vertical. |
|
|
56
|
+
| `Alt` | Temporarily enable option/guide measurement overlays. |
|
|
57
|
+
| `Esc` | Clear all measurements and guides. |
|
|
58
|
+
| `Backspace` / `Delete` | Remove selected guides. |
|
|
59
|
+
| `Cmd/Ctrl + Z` | Undo. |
|
|
60
|
+
| `Cmd/Ctrl + Shift + Z` | Redo. |
|
|
61
|
+
|
|
38
62
|
## Features
|
|
39
63
|
|
|
40
64
|
- **Toggle on/off** – Enable the overlay with a single shortcut
|
package/dist/index.cjs
CHANGED
|
@@ -489,7 +489,7 @@ function ToolbarComponent({
|
|
|
489
489
|
{
|
|
490
490
|
type: "button",
|
|
491
491
|
className: cn(
|
|
492
|
-
"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[12px]",
|
|
492
|
+
"group flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[12px]",
|
|
493
493
|
activeMenuIndex === 0 || guideOrientation === "horizontal" ? "bg-[#0d99ff] text-white" : "text-ink-700 hover:bg-[#0d99ff] hover:text-white"
|
|
494
494
|
),
|
|
495
495
|
onClick: () => selectGuideOrientation("horizontal"),
|
|
@@ -505,7 +505,7 @@ function ToolbarComponent({
|
|
|
505
505
|
),
|
|
506
506
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(MinusIcon, { size: 12 }),
|
|
507
507
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "flex-1", children: "Horizontal" }),
|
|
508
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
508
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "H" })
|
|
509
509
|
]
|
|
510
510
|
}
|
|
511
511
|
),
|
|
@@ -514,7 +514,7 @@ function ToolbarComponent({
|
|
|
514
514
|
{
|
|
515
515
|
type: "button",
|
|
516
516
|
className: cn(
|
|
517
|
-
"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[12px]",
|
|
517
|
+
"group flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[12px]",
|
|
518
518
|
activeMenuIndex === 1 || guideOrientation === "vertical" ? "bg-[#0d99ff] text-white" : "text-ink-700 hover:bg-[#0d99ff] hover:text-white"
|
|
519
519
|
),
|
|
520
520
|
onClick: () => selectGuideOrientation("vertical"),
|
|
@@ -530,7 +530,7 @@ function ToolbarComponent({
|
|
|
530
530
|
),
|
|
531
531
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(MinusIcon, { size: 12, className: "rotate-90" }),
|
|
532
532
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "flex-1", children: "Vertical" }),
|
|
533
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
533
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "V" })
|
|
534
534
|
]
|
|
535
535
|
}
|
|
536
536
|
)
|
|
@@ -2089,7 +2089,6 @@ var useMeasurerPointer = ({
|
|
|
2089
2089
|
...prev,
|
|
2090
2090
|
{ id, orientation: guideOrientation, position }
|
|
2091
2091
|
]);
|
|
2092
|
-
setSelectedGuideIds([id]);
|
|
2093
2092
|
scheduleGuideDragHold(id, setDraggingGuideId);
|
|
2094
2093
|
event.currentTarget.setPointerCapture(event.pointerId);
|
|
2095
2094
|
return;
|
package/dist/index.js
CHANGED
|
@@ -478,7 +478,7 @@ function ToolbarComponent({
|
|
|
478
478
|
{
|
|
479
479
|
type: "button",
|
|
480
480
|
className: cn(
|
|
481
|
-
"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[12px]",
|
|
481
|
+
"group flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[12px]",
|
|
482
482
|
activeMenuIndex === 0 || guideOrientation === "horizontal" ? "bg-[#0d99ff] text-white" : "text-ink-700 hover:bg-[#0d99ff] hover:text-white"
|
|
483
483
|
),
|
|
484
484
|
onClick: () => selectGuideOrientation("horizontal"),
|
|
@@ -494,7 +494,7 @@ function ToolbarComponent({
|
|
|
494
494
|
),
|
|
495
495
|
/* @__PURE__ */ jsx2(MinusIcon, { size: 12 }),
|
|
496
496
|
/* @__PURE__ */ jsx2("span", { className: "flex-1", children: "Horizontal" }),
|
|
497
|
-
/* @__PURE__ */ jsx2("span", {
|
|
497
|
+
/* @__PURE__ */ jsx2("span", { children: "H" })
|
|
498
498
|
]
|
|
499
499
|
}
|
|
500
500
|
),
|
|
@@ -503,7 +503,7 @@ function ToolbarComponent({
|
|
|
503
503
|
{
|
|
504
504
|
type: "button",
|
|
505
505
|
className: cn(
|
|
506
|
-
"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[12px]",
|
|
506
|
+
"group flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[12px]",
|
|
507
507
|
activeMenuIndex === 1 || guideOrientation === "vertical" ? "bg-[#0d99ff] text-white" : "text-ink-700 hover:bg-[#0d99ff] hover:text-white"
|
|
508
508
|
),
|
|
509
509
|
onClick: () => selectGuideOrientation("vertical"),
|
|
@@ -519,7 +519,7 @@ function ToolbarComponent({
|
|
|
519
519
|
),
|
|
520
520
|
/* @__PURE__ */ jsx2(MinusIcon, { size: 12, className: "rotate-90" }),
|
|
521
521
|
/* @__PURE__ */ jsx2("span", { className: "flex-1", children: "Vertical" }),
|
|
522
|
-
/* @__PURE__ */ jsx2("span", {
|
|
522
|
+
/* @__PURE__ */ jsx2("span", { children: "V" })
|
|
523
523
|
]
|
|
524
524
|
}
|
|
525
525
|
)
|
|
@@ -2078,7 +2078,6 @@ var useMeasurerPointer = ({
|
|
|
2078
2078
|
...prev,
|
|
2079
2079
|
{ id, orientation: guideOrientation, position }
|
|
2080
2080
|
]);
|
|
2081
|
-
setSelectedGuideIds([id]);
|
|
2082
2081
|
scheduleGuideDragHold(id, setDraggingGuideId);
|
|
2083
2082
|
event.currentTarget.setPointerCapture(event.pointerId);
|
|
2084
2083
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mesurer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Measure and align everything on localhost.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Julien Thibeaut",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"files": [
|
|
21
21
|
"dist",
|
|
22
22
|
"dist/styles.css",
|
|
23
|
+
"CHANGELOG.md",
|
|
23
24
|
"README.md",
|
|
24
25
|
"LICENSE"
|
|
25
26
|
],
|
|
@@ -27,7 +28,7 @@
|
|
|
27
28
|
"publishConfig": {
|
|
28
29
|
"access": "public"
|
|
29
30
|
},
|
|
30
|
-
"homepage": "https://mesurer.
|
|
31
|
+
"homepage": "https://mesurer.dev",
|
|
31
32
|
"repository": {
|
|
32
33
|
"type": "git",
|
|
33
34
|
"url": "https://github.com/ibelick/mesurer.git"
|