@reidelsaltres/pureper 0.1.92 → 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":"AA6BA,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;AAEtC,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
@@ -1,26 +1,3 @@
1
- const computeHostingPath = () => {
2
- if (typeof window === "undefined" || typeof window.location === "undefined") {
3
- return "/";
4
- }
5
- const pathname = window.location.pathname || "/";
6
- if (pathname === "") {
7
- return "/";
8
- }
9
- if (pathname.endsWith("/")) {
10
- return pathname;
11
- }
12
- const lastSlash = pathname.lastIndexOf("/");
13
- if (lastSlash <= 0) {
14
- // either no slash at all or only the leading slash
15
- return pathname.includes(".") ? "/" : `${pathname}/`;
16
- }
17
- const lastSegment = pathname.slice(lastSlash + 1);
18
- if (lastSegment && !lastSegment.includes(".")) {
19
- // we are on a nested route without trailing slash — treat it as a directory
20
- return `${pathname}/`;
21
- }
22
- return pathname.slice(0, lastSlash + 1);
23
- };
24
1
  export { default as Lazy } from './foundation/api/Lazy.js';
25
2
  export * from './foundation/component_api/mixin/Proto.js';
26
3
  export { default as UniHtml } from './foundation/component_api/UniHtml.js';
@@ -32,6 +9,9 @@ export { default as Fetcher } from './foundation/Fetcher.js';
32
9
  export { Router } from './foundation/worker/Router.js';
33
10
  export { default as ServiceWorker } from './foundation/worker/ServiceWorker.js';
34
11
  export * from './foundation/Theme.js';
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":"AAAA,MAAM,kBAAkB,GAAG,GAAW,EAAE;IACvC,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,WAAW,EAAE,CAAC;QAC7E,OAAO,GAAG,CAAC;IACZ,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,IAAI,GAAG,CAAC;IACjD,IAAI,QAAQ,KAAK,EAAE,EAAE,CAAC;QACrB,OAAO,GAAG,CAAC;IACZ,CAAC;IAED,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC5B,OAAO,QAAQ,CAAC;IACjB,CAAC;IAED,MAAM,SAAS,GAAG,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC5C,IAAI,SAAS,IAAI,CAAC,EAAE,CAAC;QACpB,mDAAmD;QACnD,OAAO,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,QAAQ,GAAG,CAA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,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,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.92",
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
@@ -1,31 +1,3 @@
1
- const computeHostingPath = (): string => {
2
- if (typeof window === "undefined" || typeof window.location === "undefined") {
3
- return "/";
4
- }
5
-
6
- const pathname = window.location.pathname || "/";
7
- if (pathname === "") {
8
- return "/";
9
- }
10
-
11
- if (pathname.endsWith("/")) {
12
- return pathname;
13
- }
14
-
15
- const lastSlash = pathname.lastIndexOf("/");
16
- if (lastSlash <= 0) {
17
- // either no slash at all or only the leading slash
18
- return pathname.includes(".") ? "/" : `${pathname}/`;
19
- }
20
-
21
- const lastSegment = pathname.slice(lastSlash + 1);
22
- if (lastSegment && !lastSegment.includes(".")) {
23
- // we are on a nested route without trailing slash — treat it as a directory
24
- return `${pathname}/`;
25
- }
26
-
27
- return pathname.slice(0, lastSlash + 1);
28
- };
29
1
  // Public package entry — re-export foundation APIs
30
2
  export { default as IElementHolder } from './foundation/api/ElementHolder.js';
31
3
  export { default as EmptyConstructor } from './foundation/api/EmptyConstructor.js';
@@ -47,6 +19,9 @@ export { default as ServiceWorker } from './foundation/worker/ServiceWorker.js';
47
19
 
48
20
  export * from './foundation/Theme.js';
49
21
 
50
- export const HOSTING: string = computeHostingPath();
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
+ : "";
51
26
 
52
- export const HOSTING_ORIGIN: string = `${window.location.origin}${HOSTING}`;
27
+ export const HOSTING_ORIGIN: string = window.location.origin + HOSTING;