@kywi-software/js 0.23.0 → 0.25.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.
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The page's site id from `<meta name="kywi:site-id">`, or ''.
3
+ *
4
+ * Deliberately NOT the `<html data-kywi-site>` hint `Kywi.context.siteId` also
5
+ * reads: that attribute can carry the runtime's DEFAULT site (kywi-cms#267), and
6
+ * sending it would pin a secondary site's API calls to the default one. The meta
7
+ * is written per request, and only on multi-site configs — a page without it
8
+ * needs no `siteId`, because its Host already selects the site.
9
+ */
10
+ export declare function currentSiteId(): string;
11
+ /**
12
+ * `url` with `siteId=<page site>` appended. Only same-origin URLs are touched —
13
+ * root-relative, or absolute on this page's origin (an `apiBase` configured as
14
+ * a full URL) — since a cross-origin endpoint is not this CMS. An explicit
15
+ * `siteId` is never overridden, and a page with no site id is left as it was.
16
+ */
17
+ export declare function withSiteId(url: string): string;
18
+ //# sourceMappingURL=site-scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"site-scope.d.ts","sourceRoot":"","sources":["../src/site-scope.ts"],"names":[],"mappings":"AAUA;;;;;;;;GAQG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAGtC;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAO9C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kywi-software/js",
3
- "version": "0.23.0",
3
+ "version": "0.25.0",
4
4
  "description": "Kywi CMS browser runtime — audience personalization, experiments, forms, and feed rendering for the public site (loaded as kywi.js).",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-only",
@@ -38,7 +38,7 @@
38
38
  "tsx": "^4.7.0",
39
39
  "typescript": "^5.5.0",
40
40
  "vitest": "^1.6.0",
41
- "@kywi-software/core": "0.23.0"
41
+ "@kywi-software/core": "0.25.0"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "rm -rf dist && tsc --emitDeclarationOnly && tsx build.ts",