@reidelsaltres/pureper 0.1.91 → 0.1.93

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAE3D,cAAc,2CAA2C,CAAC;AAE1D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAE/E,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,WAAW,EAAG,MAAM,EAAC,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAEhF,cAAc,uBAAuB,CAAC;AA+BtC,eAAO,MAAM,OAAO,EAAE,MAA6B,CAAC;AAEpD,eAAO,MAAM,cAAc,EAAE,MAA8C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAE3D,cAAc,2CAA2C,CAAC;AAE1D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAE/E,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,WAAW,EAAG,MAAM,EAAC,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAEhF,cAAc,uBAAuB,CAAC;AAGtC,eAAO,MAAM,OAAO,EAAE,MAEjB,CAAC;AAEN,eAAO,MAAM,cAAc,EAAE,MAAyC,CAAC"}
package/out/index.js CHANGED
@@ -9,29 +9,9 @@ export { default as Fetcher } from './foundation/Fetcher.js';
9
9
  export { Router } from './foundation/worker/Router.js';
10
10
  export { default as ServiceWorker } from './foundation/worker/ServiceWorker.js';
11
11
  export * from './foundation/Theme.js';
12
- const computeHostingPath = () => {
13
- if (typeof window === "undefined" || typeof window.location === "undefined") {
14
- return "/";
15
- }
16
- const pathname = window.location.pathname || "/";
17
- if (pathname === "") {
18
- return "/";
19
- }
20
- if (pathname.endsWith("/")) {
21
- return pathname;
22
- }
23
- const lastSlash = pathname.lastIndexOf("/");
24
- if (lastSlash <= 0) {
25
- // either no slash at all or only the leading slash
26
- return pathname.includes(".") ? "/" : `${pathname}/`;
27
- }
28
- const lastSegment = pathname.slice(lastSlash + 1);
29
- if (lastSegment && !lastSegment.includes(".")) {
30
- // we are on a nested route without trailing slash — treat it as a directory
31
- return `${pathname}/`;
32
- }
33
- return pathname.slice(0, lastSlash + 1);
34
- };
35
- export const HOSTING = computeHostingPath();
36
- export const HOSTING_ORIGIN = `${window.location.origin}${HOSTING}`;
12
+ // derive the part of href after the origin (e.g. "/path?query#hash")
13
+ export const HOSTING = window.location.href.startsWith(window.location.origin)
14
+ ? window.location.href.substring(window.location.origin.length)
15
+ : "";
16
+ export const HOSTING_ORIGIN = window.location.origin + HOSTING;
37
17
  //# sourceMappingURL=index.js.map
package/out/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAE3D,cAAc,2CAA2C,CAAC;AAE1D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAE/E,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,WAAW,EAAG,MAAM,EAAC,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAEhF,cAAc,uBAAuB,CAAC;AAEtC,MAAM,kBAAkB,GAAG,GAAW,EAAE;IACvC,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,WAAW,EAAE,CAAC;QAC7E,OAAO,GAAG,CAAC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,OAAO,IAAI,IAAI,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAE/E,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,WAAW,EAAG,MAAM,EAAC,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAEhF,cAAc,uBAAuB,CAAC;AAEtC,qEAAqE;AACrE,MAAM,CAAC,MAAM,OAAO,GAAW,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;IACrF,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IAC/D,CAAC,CAAC,EAAE,CAAC;AAEN,MAAM,CAAC,MAAM,cAAc,GAAW,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,OAAO,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reidelsaltres/pureper",
3
- "version": "0.1.91",
3
+ "version": "0.1.93",
4
4
  "description": "Minimal library extracted from the Pureper SPA foundation — utilities and base classes for components/pages.",
5
5
  "type": "module",
6
6
  "main": "out/src/index.js",
package/src/index.ts CHANGED
@@ -19,35 +19,9 @@ export { default as ServiceWorker } from './foundation/worker/ServiceWorker.js';
19
19
 
20
20
  export * from './foundation/Theme.js';
21
21
 
22
- const computeHostingPath = (): string => {
23
- if (typeof window === "undefined" || typeof window.location === "undefined") {
24
- return "/";
25
- }
26
-
27
- const pathname = window.location.pathname || "/";
28
- if (pathname === "") {
29
- return "/";
30
- }
31
-
32
- if (pathname.endsWith("/")) {
33
- return pathname;
34
- }
35
-
36
- const lastSlash = pathname.lastIndexOf("/");
37
- if (lastSlash <= 0) {
38
- // either no slash at all or only the leading slash
39
- return pathname.includes(".") ? "/" : `${pathname}/`;
40
- }
41
-
42
- const lastSegment = pathname.slice(lastSlash + 1);
43
- if (lastSegment && !lastSegment.includes(".")) {
44
- // we are on a nested route without trailing slash — treat it as a directory
45
- return `${pathname}/`;
46
- }
47
-
48
- return pathname.slice(0, lastSlash + 1);
49
- };
50
-
51
- export const HOSTING: string = computeHostingPath();
52
-
53
- export const HOSTING_ORIGIN: string = `${window.location.origin}${HOSTING}`;
22
+ // derive the part of href after the origin (e.g. "/path?query#hash")
23
+ export const HOSTING: string = window.location.href.startsWith(window.location.origin)
24
+ ? window.location.href.substring(window.location.origin.length)
25
+ : "";
26
+
27
+ export const HOSTING_ORIGIN: string = window.location.origin + HOSTING;