webmarker-js 0.6.0 → 0.7.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/README.md +1 -1
- package/dist/main.js +3 -3
- package/dist/module.js +3 -3
- package/package.json +1 -1
- package/playwright-report/index.html +1 -1
- package/src/index.ts +3 -2
package/README.md
CHANGED
@@ -158,7 +158,7 @@ const markedElements = mark({
|
|
158
158
|
// Use a blue dashed outline with a transparent and slighly blue background
|
159
159
|
boundingBoxStyle: { outline: "2px dashed blue", backgroundColor: "rgba(0, 0, 255, 0.1)"},
|
160
160
|
// Place the mark at the top right corner of the element
|
161
|
-
markPlacement: "top-end"
|
161
|
+
markPlacement: "top-end",
|
162
162
|
// Show bounding boxes over elements (defaults to true)
|
163
163
|
showBoundingBoxes: true,
|
164
164
|
// Generate labels as 'Element 0', 'Element 1', 'Element 2'...
|
package/dist/main.js
CHANGED
@@ -972,7 +972,7 @@ var WebMarker = (() => {
|
|
972
972
|
markClass
|
973
973
|
);
|
974
974
|
fragment.appendChild(markElement);
|
975
|
-
const boundingBoxElement = showBoundingBoxes ? createBoundingBox(element, boundingBoxStyle, label, boundingBoxClass) : void 0;
|
975
|
+
const boundingBoxElement = showBoundingBoxes ? createBoundingBox(element, index, boundingBoxStyle, label, boundingBoxClass) : void 0;
|
976
976
|
if (boundingBoxElement) {
|
977
977
|
fragment.appendChild(boundingBoxElement);
|
978
978
|
}
|
@@ -1010,7 +1010,7 @@ var WebMarker = (() => {
|
|
1010
1010
|
);
|
1011
1011
|
return markElement;
|
1012
1012
|
}
|
1013
|
-
function createBoundingBox(element, style, label, boundingBoxClass) {
|
1013
|
+
function createBoundingBox(element, index, style, label, boundingBoxClass) {
|
1014
1014
|
const boundingBoxElement = document.createElement("div");
|
1015
1015
|
boundingBoxElement.className = `webmarker-bounding-box ${boundingBoxClass}`.trim();
|
1016
1016
|
boundingBoxElement.id = `webmarker-bounding-box-${label}`;
|
@@ -1031,7 +1031,7 @@ var WebMarker = (() => {
|
|
1031
1031
|
position: "absolute",
|
1032
1032
|
pointerEvents: "none"
|
1033
1033
|
},
|
1034
|
-
typeof style === "function" ? style(element,
|
1034
|
+
typeof style === "function" ? style(element, index) : style
|
1035
1035
|
);
|
1036
1036
|
return boundingBoxElement;
|
1037
1037
|
}
|
package/dist/module.js
CHANGED
@@ -948,7 +948,7 @@ function mark(options = {}) {
|
|
948
948
|
markClass
|
949
949
|
);
|
950
950
|
fragment.appendChild(markElement);
|
951
|
-
const boundingBoxElement = showBoundingBoxes ? createBoundingBox(element, boundingBoxStyle, label, boundingBoxClass) : void 0;
|
951
|
+
const boundingBoxElement = showBoundingBoxes ? createBoundingBox(element, index, boundingBoxStyle, label, boundingBoxClass) : void 0;
|
952
952
|
if (boundingBoxElement) {
|
953
953
|
fragment.appendChild(boundingBoxElement);
|
954
954
|
}
|
@@ -986,7 +986,7 @@ function createMark(element, index, style, label, markPlacement = "top-start", m
|
|
986
986
|
);
|
987
987
|
return markElement;
|
988
988
|
}
|
989
|
-
function createBoundingBox(element, style, label, boundingBoxClass) {
|
989
|
+
function createBoundingBox(element, index, style, label, boundingBoxClass) {
|
990
990
|
const boundingBoxElement = document.createElement("div");
|
991
991
|
boundingBoxElement.className = `webmarker-bounding-box ${boundingBoxClass}`.trim();
|
992
992
|
boundingBoxElement.id = `webmarker-bounding-box-${label}`;
|
@@ -1007,7 +1007,7 @@ function createBoundingBox(element, style, label, boundingBoxClass) {
|
|
1007
1007
|
position: "absolute",
|
1008
1008
|
pointerEvents: "none"
|
1009
1009
|
},
|
1010
|
-
typeof style === "function" ? style(element,
|
1010
|
+
typeof style === "function" ? style(element, index) : style
|
1011
1011
|
);
|
1012
1012
|
return boundingBoxElement;
|
1013
1013
|
}
|
package/package.json
CHANGED
@@ -65,4 +65,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
65
65
|
</body>
|
66
66
|
</html>
|
67
67
|
<script>
|
68
|
-
window.playwrightReportBase64 = "data:application/zip;base64,
|
68
|
+
window.playwrightReportBase64 = "data:application/zip;base64,UEsDBBQAAAgIANC1flqHcaPZqQMAABweAAAZAAAAYmNiZDI1NDU2ZDY4YTVkNDlmYWMuanNvbtWYy26bQBSGX8Vi1UoOZe6Dd70s0k1VqVm1ymIMg02DGWsYEkeR370DRUo9cewxhshdGXP5z3/O3D6dpyDLC/k1DWbBPJmnkGBCU8oFSXGciSSYts+/iZW0b+RlKjdhtZZJaCr7yMjK/s5+PbVXr4pcMQAE40QKwmOIeUIxj5rPc1M0sl/kSk3Eej25z6taFBMtF1pWVa7KSaNr31xr9VsmprORLLVa5fXKPihUIox9MZg9tUb3mCzy0t4m0yBRRb2yb5LtNEhr3X2HUTQNRFkq095o0rm11sSiu1K1SVQbVm6sppFp40eY5d/H1mhddEVwRCsjtLnJ229hBMlVhK4QuInIDNMZAiEm7GfQKBj9GMzaD+S6K2dXmU8yU1pOrpW6a1I5qkijRvHZB4r2ymb5xtRaziZzrR4qqb2k8a40iOk+6U7x5nEtw0LUZbL0EieuOHkWv22Gri6Nvb3993q6J6FElUZujEdMSsFuzEPphKV8+HyCNNyVxv2SWYuF9ArHd8PF8EAqXRpNRt999WNHHxzP55XcmpTChTLq3Yf3HqGZO0gE7YT2Xv70efkDvN3v7e/6Do26FvfyR6KlLKul8hlwDtz5G+F+PtmzTwhf8dnWUN6LohbGZ/xi6O4K/bwBnyKebg45I9zTXDzqCMfQWWOM9vMJyeAjDMMocudfT3NsxCI2NqlTRN7PJ0IeRfyYGak9j07rjROP4+C0rXmParR/5zznKGuiUK8ozrXUWunuHRvC1FU79aqqRRxhjEiWK1m2cHPbfKDugpnRtWztHgQ+u1wyklCYZSzOaDK3/9MzgC/LtQWhzSC8xyIwPO+1osd5jwzNe8Q5mTnbe/T34j1nX7YAOCDvYVccHZ+y5/Heix0cDAd8L7V74qsn8cXYqR/ibFDkOxxgTOaDIUJwmFNiTOaDIQYOmsY9bQ6PfDAk4GKRrzHnrv4LRD5r08VmAvv5H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/index.ts
CHANGED
@@ -138,7 +138,7 @@ function mark(options: MarkOptions = {}): Record<string, MarkedElement> {
|
|
138
138
|
fragment.appendChild(markElement);
|
139
139
|
|
140
140
|
const boundingBoxElement = showBoundingBoxes
|
141
|
-
? createBoundingBox(element, boundingBoxStyle, label, boundingBoxClass)
|
141
|
+
? createBoundingBox(element, index, boundingBoxStyle, label, boundingBoxClass)
|
142
142
|
: undefined;
|
143
143
|
if (boundingBoxElement) {
|
144
144
|
fragment.appendChild(boundingBoxElement);
|
@@ -190,6 +190,7 @@ function createMark(
|
|
190
190
|
|
191
191
|
function createBoundingBox(
|
192
192
|
element: Element,
|
193
|
+
index: number,
|
193
194
|
style: StyleObject | StyleFunction,
|
194
195
|
label: string,
|
195
196
|
boundingBoxClass: string
|
@@ -215,7 +216,7 @@ function createBoundingBox(
|
|
215
216
|
position: "absolute",
|
216
217
|
pointerEvents: "none",
|
217
218
|
},
|
218
|
-
typeof style === "function" ? style(element,
|
219
|
+
typeof style === "function" ? style(element, index) : style
|
219
220
|
);
|
220
221
|
return boundingBoxElement;
|
221
222
|
}
|