@oyerinde/caliper 0.2.1 → 0.2.2
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 +13 -1
- package/README.md +0 -4
- package/dist/bridge.cjs +12 -12
- package/dist/bridge.d.cts +1 -1
- package/dist/bridge.d.ts +1 -1
- package/dist/bridge.js +1 -1
- package/dist/{chunk-PYAVLOZM.cjs → chunk-2SVFU7M3.cjs} +71 -29
- package/dist/{chunk-P37B6G5P.cjs → chunk-AHX2GS7J.cjs} +57 -33
- package/dist/{chunk-L47FGEH6.js → chunk-PRUCSUJA.js} +72 -30
- package/dist/{chunk-MTIWXK3P.js → chunk-YLE25XII.js} +57 -33
- package/dist/index.cjs +6 -6
- package/dist/index.global.js +13 -13
- package/dist/index.global.js.map +1 -1
- package/dist/index.global.min.js +3 -3
- package/dist/index.global.min.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp.cjs +88 -52
- package/dist/mcp.js +89 -53
- package/dist/preset.cjs +6 -6
- package/dist/preset.d.cts +1 -1
- package/dist/preset.d.ts +1 -1
- package/dist/preset.js +3 -3
- package/dist/version.json +2 -2
- package/package.json +5 -5
|
@@ -3030,10 +3030,12 @@ var Logger = class {
|
|
|
3030
3030
|
isGlobalEnabled = enabled;
|
|
3031
3031
|
}
|
|
3032
3032
|
debug(...args) {
|
|
3033
|
-
return;
|
|
3033
|
+
if (!isGlobalEnabled) return;
|
|
3034
|
+
console.debug(this.prefix, ...args);
|
|
3034
3035
|
}
|
|
3035
3036
|
info(...args) {
|
|
3036
|
-
return;
|
|
3037
|
+
if (!isGlobalEnabled) return;
|
|
3038
|
+
console.info(this.prefix, ...args);
|
|
3037
3039
|
}
|
|
3038
3040
|
warn(...args) {
|
|
3039
3041
|
if (!isGlobalEnabled) return;
|
|
@@ -3044,7 +3046,8 @@ var Logger = class {
|
|
|
3044
3046
|
console.error(this.prefix, ...args);
|
|
3045
3047
|
}
|
|
3046
3048
|
log(...args) {
|
|
3047
|
-
return;
|
|
3049
|
+
if (!isGlobalEnabled) return;
|
|
3050
|
+
console.log(this.prefix, ...args);
|
|
3048
3051
|
}
|
|
3049
3052
|
};
|
|
3050
3053
|
var logger = new Logger({ prefix: "Caliper" });
|
|
@@ -3433,11 +3436,11 @@ function MeasurementLinesWithCalculator(props) {
|
|
|
3433
3436
|
};
|
|
3434
3437
|
}
|
|
3435
3438
|
if (line.type === "top" || line.type === "bottom") {
|
|
3436
|
-
if (line.
|
|
3437
|
-
else
|
|
3439
|
+
if (line.type === "top") start.x = end.x;
|
|
3440
|
+
else end.x = start.x;
|
|
3438
3441
|
} else if (line.type === "left" || line.type === "right") {
|
|
3439
|
-
if (line.
|
|
3440
|
-
else
|
|
3442
|
+
if (line.type === "left") start.y = end.y;
|
|
3443
|
+
else end.y = start.y;
|
|
3441
3444
|
}
|
|
3442
3445
|
let liveValue = 0;
|
|
3443
3446
|
if (line.type === "top" || line.type === "bottom") {
|
|
@@ -3535,11 +3538,11 @@ function MeasurementLabels(props) {
|
|
|
3535
3538
|
};
|
|
3536
3539
|
}
|
|
3537
3540
|
if (line.type === "top" || line.type === "bottom") {
|
|
3538
|
-
if (line.
|
|
3539
|
-
else
|
|
3541
|
+
if (line.type === "top") start.x = end.x;
|
|
3542
|
+
else end.x = start.x;
|
|
3540
3543
|
} else if (line.type === "left" || line.type === "right") {
|
|
3541
|
-
if (line.
|
|
3542
|
-
else
|
|
3544
|
+
if (line.type === "left") start.y = end.y;
|
|
3545
|
+
else end.y = start.y;
|
|
3543
3546
|
}
|
|
3544
3547
|
const naturalX = (start.x + end.x) / 2;
|
|
3545
3548
|
const naturalY = (start.y + end.y) / 2;
|
|
@@ -5103,27 +5106,48 @@ function Root(config) {
|
|
|
5103
5106
|
contextEvent.preventDefault();
|
|
5104
5107
|
contextEvent.stopImmediatePropagation();
|
|
5105
5108
|
let clipboardContent = "";
|
|
5106
|
-
if (contextEvent.shiftKey
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
})
|
|
5123
|
-
}
|
|
5109
|
+
if (contextEvent.shiftKey) {
|
|
5110
|
+
if (measurementResult && system && selectionSystem) {
|
|
5111
|
+
const primaryElement = selectionSystem.getSelected();
|
|
5112
|
+
const secondaryElement = system.getSecondaryElement();
|
|
5113
|
+
if (primaryElement && secondaryElement) {
|
|
5114
|
+
clipboardContent = JSON.stringify({
|
|
5115
|
+
primary: buildSelectorInfo(primaryElement, selectionMetadata()),
|
|
5116
|
+
secondary: buildSelectorInfo(secondaryElement, {
|
|
5117
|
+
rect: measurementResult.secondary,
|
|
5118
|
+
scrollHierarchy: measurementResult.secondaryHierarchy,
|
|
5119
|
+
position: measurementResult.secondaryPosition,
|
|
5120
|
+
stickyConfig: measurementResult.secondarySticky,
|
|
5121
|
+
initialWindowX: measurementResult.secondaryWinX,
|
|
5122
|
+
initialWindowY: measurementResult.secondaryWinY,
|
|
5123
|
+
hasContainingBlock: measurementResult.secondaryHasContainingBlock
|
|
5124
|
+
})
|
|
5125
|
+
});
|
|
5126
|
+
}
|
|
5127
|
+
} else if (selectedElement) {
|
|
5128
|
+
clipboardContent = JSON.stringify(buildSelectorInfo(selectedElement, selectionMetadata()));
|
|
5129
|
+
}
|
|
5130
|
+
} else {
|
|
5131
|
+
const ensureAgentId = (el) => {
|
|
5132
|
+
let id = el.getAttribute("data-caliper-agent-id");
|
|
5133
|
+
if (!id) {
|
|
5134
|
+
id = generateId("caliper");
|
|
5135
|
+
el.setAttribute("data-caliper-agent-id", id);
|
|
5136
|
+
}
|
|
5137
|
+
return id;
|
|
5138
|
+
};
|
|
5139
|
+
if (measurementResult && system && selectionSystem) {
|
|
5140
|
+
const primaryElement = selectionSystem.getSelected();
|
|
5141
|
+
const secondaryElement = system.getSecondaryElement();
|
|
5142
|
+
if (primaryElement && secondaryElement) {
|
|
5143
|
+
clipboardContent = JSON.stringify({
|
|
5144
|
+
primary: ensureAgentId(primaryElement),
|
|
5145
|
+
secondary: ensureAgentId(secondaryElement)
|
|
5146
|
+
});
|
|
5147
|
+
}
|
|
5148
|
+
} else if (selectedElement) {
|
|
5149
|
+
clipboardContent = ensureAgentId(selectedElement);
|
|
5124
5150
|
}
|
|
5125
|
-
} else if (selectedElement) {
|
|
5126
|
-
clipboardContent = JSON.stringify(buildSelectorInfo(selectedElement, selectionMetadata()));
|
|
5127
5151
|
}
|
|
5128
5152
|
if (clipboardContent) {
|
|
5129
5153
|
navigator.clipboard.writeText(clipboardContent).then(() => {
|
|
@@ -5886,11 +5910,11 @@ function createOverlay(config) {
|
|
|
5886
5910
|
return instance;
|
|
5887
5911
|
}
|
|
5888
5912
|
if (IS_BROWSER2) {
|
|
5889
|
-
showVersionInfo("0.2.
|
|
5913
|
+
showVersionInfo("0.2.2").catch(() => {
|
|
5890
5914
|
});
|
|
5891
5915
|
}
|
|
5892
5916
|
|
|
5893
5917
|
// src/index.ts
|
|
5894
|
-
var VERSION = "0.2.
|
|
5918
|
+
var VERSION = "0.2.2";
|
|
5895
5919
|
|
|
5896
5920
|
export { VERSION, caliperProps, createOverlay, getConfig, setConfig };
|
package/dist/index.cjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkAHX2GS7J_cjs = require('./chunk-AHX2GS7J.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "VERSION", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkAHX2GS7J_cjs.VERSION; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "caliperProps", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkAHX2GS7J_cjs.caliperProps; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "getConfig", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkAHX2GS7J_cjs.getConfig; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "init", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkAHX2GS7J_cjs.createOverlay; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "setConfig", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkAHX2GS7J_cjs.setConfig; }
|
|
26
26
|
});
|