webmarker-js 0.0.5 → 0.0.6

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/main.js CHANGED
@@ -1048,8 +1048,10 @@ var WebMarker = (() => {
1048
1048
  function isMarked() {
1049
1049
  return document.documentElement.hasAttribute("data-webmarkered");
1050
1050
  }
1051
- window["mark"] = mark;
1052
- window["unmark"] = unmark;
1053
- window["isMarked"] = isMarked;
1051
+ if (typeof window !== "undefined") {
1052
+ window["mark"] = mark;
1053
+ window["unmark"] = unmark;
1054
+ window["isMarked"] = isMarked;
1055
+ }
1054
1056
  return __toCommonJS(src_exports);
1055
1057
  })();
package/dist/module.js CHANGED
@@ -1024,9 +1024,11 @@ function unmark() {
1024
1024
  function isMarked() {
1025
1025
  return document.documentElement.hasAttribute("data-webmarkered");
1026
1026
  }
1027
- window["mark"] = mark;
1028
- window["unmark"] = unmark;
1029
- window["isMarked"] = isMarked;
1027
+ if (typeof window !== "undefined") {
1028
+ window["mark"] = mark;
1029
+ window["unmark"] = unmark;
1030
+ window["isMarked"] = isMarked;
1031
+ }
1030
1032
  export {
1031
1033
  isMarked,
1032
1034
  mark,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webmarker-js",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "A library for marking web pages for Set-of-Mark (SoM) prompting with vision-language models.",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/main.js",
package/src/index.ts CHANGED
@@ -226,9 +226,11 @@ function isMarked(): boolean {
226
226
  return document.documentElement.hasAttribute("data-webmarkered");
227
227
  }
228
228
 
229
- window["mark"] = mark;
230
- window["unmark"] = unmark;
231
- window["isMarked"] = isMarked;
229
+ if (typeof window !== "undefined") {
230
+ window["mark"] = mark;
231
+ window["unmark"] = unmark;
232
+ window["isMarked"] = isMarked;
233
+ }
232
234
 
233
235
  export { mark, unmark, isMarked };
234
236
  export type { MarkOptions, MarkedElement, Placement };