@oyerinde/caliper 0.1.2 → 0.1.3

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
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [0.1.3] - 2026-01-13
6
+
7
+ ### Improved
8
+
9
+ - Shortcuts now function while editable elements are focused.
10
+
5
11
  ## [0.1.2] - 2026-01-13
6
12
 
7
13
  ### Fixed
package/dist/index.cjs CHANGED
@@ -1034,13 +1034,6 @@ function hasSize(element) {
1034
1034
  const rect = element.getBoundingClientRect();
1035
1035
  return rect.width > 0 && rect.height > 0;
1036
1036
  }
1037
- function isEditable(element) {
1038
- if (!element || !(element instanceof HTMLElement)) {
1039
- return false;
1040
- }
1041
- const tagName = element.tagName;
1042
- return tagName === "INPUT" || tagName === "TEXTAREA" || tagName === "SELECT" || element.isContentEditable;
1043
- }
1044
1037
  function isEligible(element) {
1045
1038
  if (element.closest("[data-caliper-ignore]")) {
1046
1039
  return false;
@@ -4543,7 +4536,7 @@ function Root(config) {
4543
4536
  }
4544
4537
  };
4545
4538
  const handleKeyDown = (e) => {
4546
- if (e.key === commands.clear && !isEditable(e.target)) {
4539
+ if (e.key === commands.clear) {
4547
4540
  if (!isActive()) return;
4548
4541
  e.preventDefault();
4549
4542
  e.stopImmediatePropagation();
@@ -4566,10 +4559,10 @@ function Root(config) {
4566
4559
  }
4567
4560
  return;
4568
4561
  }
4569
- if (e.key === commands.select && !isEditable(e.target)) {
4562
+ if (e.key === commands.select) {
4570
4563
  setIsSelectKeyDown(true);
4571
4564
  }
4572
- if (e.key.toLowerCase() === commands.ruler.toLowerCase() && e.shiftKey && rulerSystem && !isEditable(e.target)) {
4565
+ if (e.key.toLowerCase() === commands.ruler.toLowerCase() && e.shiftKey && rulerSystem) {
4573
4566
  e.preventDefault();
4574
4567
  const vp = viewport();
4575
4568
  const x = Math.max(0, Math.min(cursor().x, vp.width));
@@ -4592,7 +4585,7 @@ function Root(config) {
4592
4585
  resetCalculatorUI();
4593
4586
  }
4594
4587
  setIsActivatePressed(true);
4595
- } else if (e.key === commands.freeze && !isEditable(e.target) && system) {
4588
+ } else if (e.key === commands.freeze && system) {
4596
4589
  const state = system.getState();
4597
4590
  if (state === "FROZEN") {
4598
4591
  e.preventDefault();
@@ -4640,7 +4633,7 @@ function Root(config) {
4640
4633
  [projection.right]: "right"
4641
4634
  };
4642
4635
  const dir = dirMap[key];
4643
- if (dir && selectionMetadata().element && !isEditable(e.target)) {
4636
+ if (dir && selectionMetadata().element) {
4644
4637
  e.preventDefault();
4645
4638
  e.stopImmediatePropagation();
4646
4639
  setActiveInputFocus("projection");
@@ -5127,12 +5120,12 @@ function createOverlay(config) {
5127
5120
  return instance;
5128
5121
  }
5129
5122
  if (IS_BROWSER2) {
5130
- showVersionInfo("0.1.2").catch(() => {
5123
+ showVersionInfo("0.1.3").catch(() => {
5131
5124
  });
5132
5125
  }
5133
5126
 
5134
5127
  // src/index.ts
5135
- var VERSION = "0.1.2";
5128
+ var VERSION = "0.1.3";
5136
5129
 
5137
5130
  exports.VERSION = VERSION;
5138
5131
  exports.getConfig = getConfig;
package/dist/index.d.ts CHANGED
@@ -1,18 +1,2 @@
1
- export { OverlayInstance, createOverlay as init } from '@caliper/overlay';
2
- export { OverlayConfig, getConfig, setConfig } from '@caliper/core';
3
1
 
4
- /**
5
- * @oyerinde/caliper
6
- *
7
- * Browser-based measurement tool overlay.
8
- * This package bundles all dependencies for easy consumption.
9
- *
10
- * Usage:
11
- * 1. Script tag (Auto-mount): <script src="@oyerinde/caliper/dist/index.global.js"></script>
12
- * 2. ESM import (Manual): import { init } from "@oyerinde/caliper"
13
- * 3. Initialize: const caliper = init(); caliper.mount();
14
- */
15
-
16
- declare const VERSION: string;
17
-
18
- export { VERSION };
2
+ export { }
@@ -1035,13 +1035,6 @@
1035
1035
  const rect = element.getBoundingClientRect();
1036
1036
  return rect.width > 0 && rect.height > 0;
1037
1037
  }
1038
- function isEditable(element) {
1039
- if (!element || !(element instanceof HTMLElement)) {
1040
- return false;
1041
- }
1042
- const tagName = element.tagName;
1043
- return tagName === "INPUT" || tagName === "TEXTAREA" || tagName === "SELECT" || element.isContentEditable;
1044
- }
1045
1038
  function isEligible(element) {
1046
1039
  if (element.closest("[data-caliper-ignore]")) {
1047
1040
  return false;
@@ -4539,7 +4532,7 @@
4539
4532
  }
4540
4533
  };
4541
4534
  const handleKeyDown = (e) => {
4542
- if (e.key === commands.clear && !isEditable(e.target)) {
4535
+ if (e.key === commands.clear) {
4543
4536
  if (!isActive()) return;
4544
4537
  e.preventDefault();
4545
4538
  e.stopImmediatePropagation();
@@ -4562,10 +4555,10 @@
4562
4555
  }
4563
4556
  return;
4564
4557
  }
4565
- if (e.key === commands.select && !isEditable(e.target)) {
4558
+ if (e.key === commands.select) {
4566
4559
  setIsSelectKeyDown(true);
4567
4560
  }
4568
- if (e.key.toLowerCase() === commands.ruler.toLowerCase() && e.shiftKey && rulerSystem && !isEditable(e.target)) {
4561
+ if (e.key.toLowerCase() === commands.ruler.toLowerCase() && e.shiftKey && rulerSystem) {
4569
4562
  e.preventDefault();
4570
4563
  const vp = viewport();
4571
4564
  const x = Math.max(0, Math.min(cursor().x, vp.width));
@@ -4588,7 +4581,7 @@
4588
4581
  resetCalculatorUI();
4589
4582
  }
4590
4583
  setIsActivatePressed(true);
4591
- } else if (e.key === commands.freeze && !isEditable(e.target) && system) {
4584
+ } else if (e.key === commands.freeze && system) {
4592
4585
  const state = system.getState();
4593
4586
  if (state === "FROZEN") {
4594
4587
  e.preventDefault();
@@ -4636,7 +4629,7 @@
4636
4629
  [projection.right]: "right"
4637
4630
  };
4638
4631
  const dir = dirMap[key];
4639
- if (dir && selectionMetadata().element && !isEditable(e.target)) {
4632
+ if (dir && selectionMetadata().element) {
4640
4633
  e.preventDefault();
4641
4634
  e.stopImmediatePropagation();
4642
4635
  setActiveInputFocus("projection");
@@ -5123,7 +5116,7 @@
5123
5116
  return instance;
5124
5117
  }
5125
5118
  if (IS_BROWSER2) {
5126
- showVersionInfo("0.1.2").catch(() => {
5119
+ showVersionInfo("0.1.3").catch(() => {
5127
5120
  });
5128
5121
  }
5129
5122
 
package/dist/index.js CHANGED
@@ -1032,13 +1032,6 @@ function hasSize(element) {
1032
1032
  const rect = element.getBoundingClientRect();
1033
1033
  return rect.width > 0 && rect.height > 0;
1034
1034
  }
1035
- function isEditable(element) {
1036
- if (!element || !(element instanceof HTMLElement)) {
1037
- return false;
1038
- }
1039
- const tagName = element.tagName;
1040
- return tagName === "INPUT" || tagName === "TEXTAREA" || tagName === "SELECT" || element.isContentEditable;
1041
- }
1042
1035
  function isEligible(element) {
1043
1036
  if (element.closest("[data-caliper-ignore]")) {
1044
1037
  return false;
@@ -4541,7 +4534,7 @@ function Root(config) {
4541
4534
  }
4542
4535
  };
4543
4536
  const handleKeyDown = (e) => {
4544
- if (e.key === commands.clear && !isEditable(e.target)) {
4537
+ if (e.key === commands.clear) {
4545
4538
  if (!isActive()) return;
4546
4539
  e.preventDefault();
4547
4540
  e.stopImmediatePropagation();
@@ -4564,10 +4557,10 @@ function Root(config) {
4564
4557
  }
4565
4558
  return;
4566
4559
  }
4567
- if (e.key === commands.select && !isEditable(e.target)) {
4560
+ if (e.key === commands.select) {
4568
4561
  setIsSelectKeyDown(true);
4569
4562
  }
4570
- if (e.key.toLowerCase() === commands.ruler.toLowerCase() && e.shiftKey && rulerSystem && !isEditable(e.target)) {
4563
+ if (e.key.toLowerCase() === commands.ruler.toLowerCase() && e.shiftKey && rulerSystem) {
4571
4564
  e.preventDefault();
4572
4565
  const vp = viewport();
4573
4566
  const x = Math.max(0, Math.min(cursor().x, vp.width));
@@ -4590,7 +4583,7 @@ function Root(config) {
4590
4583
  resetCalculatorUI();
4591
4584
  }
4592
4585
  setIsActivatePressed(true);
4593
- } else if (e.key === commands.freeze && !isEditable(e.target) && system) {
4586
+ } else if (e.key === commands.freeze && system) {
4594
4587
  const state = system.getState();
4595
4588
  if (state === "FROZEN") {
4596
4589
  e.preventDefault();
@@ -4638,7 +4631,7 @@ function Root(config) {
4638
4631
  [projection.right]: "right"
4639
4632
  };
4640
4633
  const dir = dirMap[key];
4641
- if (dir && selectionMetadata().element && !isEditable(e.target)) {
4634
+ if (dir && selectionMetadata().element) {
4642
4635
  e.preventDefault();
4643
4636
  e.stopImmediatePropagation();
4644
4637
  setActiveInputFocus("projection");
@@ -5125,11 +5118,11 @@ function createOverlay(config) {
5125
5118
  return instance;
5126
5119
  }
5127
5120
  if (IS_BROWSER2) {
5128
- showVersionInfo("0.1.2").catch(() => {
5121
+ showVersionInfo("0.1.3").catch(() => {
5129
5122
  });
5130
5123
  }
5131
5124
 
5132
5125
  // src/index.ts
5133
- var VERSION = "0.1.2";
5126
+ var VERSION = "0.1.3";
5134
5127
 
5135
5128
  export { VERSION, getConfig, createOverlay as init, setConfig };
package/dist/version.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": "0.1.2",
3
- "timestamp": "2026-01-13T21:26:04.784Z"
2
+ "version": "0.1.3",
3
+ "timestamp": "2026-01-13T21:54:57.870Z"
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oyerinde/caliper",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "High-precision browser measurements, projections, and layout auditing",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -84,10 +84,10 @@
84
84
  "solid-js": "^1.9.10",
85
85
  "tsup": "^8.5.1",
86
86
  "typescript": "5.9.3",
87
+ "@repo/eslint-config": "0.0.0",
87
88
  "@caliper/core": "0.0.0",
88
- "@repo/typescript-config": "0.0.0",
89
89
  "@caliper/overlay": "0.0.0",
90
- "@repo/eslint-config": "0.0.0"
90
+ "@repo/typescript-config": "0.0.0"
91
91
  },
92
92
  "scripts": {
93
93
  "prebuild": "node scripts/write-version.mjs",