@edgepdf/viewer-react 0.0.3 → 0.0.4
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/index.js +43 -2
- package/dist/lib/viewer-context.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -9583,6 +9583,26 @@ var require_leaflet_src = __commonJS({
|
|
|
9583
9583
|
});
|
|
9584
9584
|
}
|
|
9585
9585
|
});
|
|
9586
|
+
if (typeof window !== "undefined" && typeof document !== "undefined") {
|
|
9587
|
+
const existingLink = document.querySelector("link[data-edgepdf-styles]");
|
|
9588
|
+
if (!existingLink) {
|
|
9589
|
+
const link = document.createElement("link");
|
|
9590
|
+
link.rel = "stylesheet";
|
|
9591
|
+
link.type = "text/css";
|
|
9592
|
+
link.setAttribute("data-edgepdf-styles", "true");
|
|
9593
|
+
try {
|
|
9594
|
+
if (typeof import.meta !== "undefined" && import.meta.url) {
|
|
9595
|
+
const baseUrl = new URL(import.meta.url);
|
|
9596
|
+
link.href = new URL("./styles.css", baseUrl).href;
|
|
9597
|
+
} else {
|
|
9598
|
+
link.href = "./styles.css";
|
|
9599
|
+
}
|
|
9600
|
+
} catch (e) {
|
|
9601
|
+
link.href = "./styles.css";
|
|
9602
|
+
}
|
|
9603
|
+
document.head.appendChild(link);
|
|
9604
|
+
}
|
|
9605
|
+
}
|
|
9586
9606
|
var import_leaflet4 = __toESM(require_leaflet_src(), 1);
|
|
9587
9607
|
var import_leaflet = __toESM(require_leaflet_src(), 1);
|
|
9588
9608
|
function calculateTileCount(imageSize, tileSize, zoom) {
|
|
@@ -10576,7 +10596,8 @@ var MarkerManager = class {
|
|
|
10576
10596
|
showDeleteButton: true
|
|
10577
10597
|
};
|
|
10578
10598
|
defaultIconType = "pin";
|
|
10579
|
-
iconBasePath = "/";
|
|
10599
|
+
iconBasePath = "./images/";
|
|
10600
|
+
// Default to library's images folder
|
|
10580
10601
|
/**
|
|
10581
10602
|
* Creates a new MarkerManager instance
|
|
10582
10603
|
*
|
|
@@ -11065,11 +11086,31 @@ var MarkerManager = class {
|
|
|
11065
11086
|
/**
|
|
11066
11087
|
* Sets the base path for marker icons
|
|
11067
11088
|
*
|
|
11068
|
-
* @param basePath - Base path for icon files (default: '/')
|
|
11089
|
+
* @param basePath - Base path for icon files (default: './images/')
|
|
11090
|
+
*
|
|
11091
|
+
* @example
|
|
11092
|
+
* ```typescript
|
|
11093
|
+
* // Use library's built-in icons (default)
|
|
11094
|
+
* markerManager.setIconBasePath('./images/');
|
|
11095
|
+
*
|
|
11096
|
+
* // Use custom icons from public folder
|
|
11097
|
+
* markerManager.setIconBasePath('/');
|
|
11098
|
+
*
|
|
11099
|
+
* // Use icons from a CDN
|
|
11100
|
+
* markerManager.setIconBasePath('https://cdn.example.com/icons/');
|
|
11101
|
+
* ```
|
|
11069
11102
|
*/
|
|
11070
11103
|
setIconBasePath(basePath) {
|
|
11071
11104
|
this.iconBasePath = basePath.endsWith("/") ? basePath : `${basePath}/`;
|
|
11072
11105
|
}
|
|
11106
|
+
/**
|
|
11107
|
+
* Gets the current base path for marker icons
|
|
11108
|
+
*
|
|
11109
|
+
* @returns The current icon base path
|
|
11110
|
+
*/
|
|
11111
|
+
getIconBasePath() {
|
|
11112
|
+
return this.iconBasePath;
|
|
11113
|
+
}
|
|
11073
11114
|
/**
|
|
11074
11115
|
* Updates the icon type for a specific marker
|
|
11075
11116
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewer-context.d.ts","sourceRoot":"","sources":["../../src/lib/viewer-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,MAAM,EACN,UAAU,EACV,SAAS,EACV,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,MAAM,WAAW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AsB;IACtB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,yBAAyB;IACzB,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;CAC7B;AAOD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,2BAA2B;IAC3B,MAAM,EAAE,YAAY,CAAC;IACrB,2BAA2B;IAC3B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,sDAAsD;IACtD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,6CAA6C;IAC7C,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACxC,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;IACpC,0BAA0B;IAC1B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,UAAU,EACV,gBAAuB,EACvB,YAAY,EACZ,WAAW,EACX,QAAQ,GACT,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CAqPnC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,IAAI,kBAAkB,CAMrD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edgepdf/viewer-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "EdgePDF Viewer - React components for viewing PDF documents with interactive markers and zoom controls",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@edgepdf/testing-utils": "workspace:*"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"@edgepdf/viewer-js": "^0.0.
|
|
73
|
+
"@edgepdf/viewer-js": "^0.0.4",
|
|
74
74
|
"react": "^18.0.0",
|
|
75
75
|
"react-dom": "^18.0.0"
|
|
76
76
|
}
|