@lionrapid/core 0.3.0-beta.0 → 0.3.1
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/browser/lionrapid.auto.dev.js +4 -24
- package/dist/browser/lionrapid.auto.dev.js.map +2 -2
- package/dist/browser/lionrapid.auto.js +4 -24
- package/dist/browser/lionrapid.auto.js.map +2 -2
- package/dist/browser/lionrapid.auto.min.js +3 -3
- package/dist/browser/lionrapid.auto.min.js.map +3 -3
- package/dist/browser/lionrapid.esm.js +4 -24
- package/dist/browser/lionrapid.esm.js.map +2 -2
- package/dist/browser/lionrapid.esm.min.js +2 -2
- package/dist/browser/lionrapid.esm.min.js.map +3 -3
- package/dist/browser/lionrapid.iife.dev.js +4 -24
- package/dist/browser/lionrapid.iife.dev.js.map +2 -2
- package/dist/browser/lionrapid.iife.js +4 -24
- package/dist/browser/lionrapid.iife.js.map +2 -2
- package/dist/browser/lionrapid.iife.min.js +2 -2
- package/dist/browser/lionrapid.iife.min.js.map +3 -3
- package/dist/browser/lionrapid.umd.js +4 -24
- package/dist/browser/lionrapid.umd.js.map +2 -2
- package/dist/browser/lionrapid.umd.min.js +2 -2
- package/dist/browser/lionrapid.umd.min.js.map +3 -3
- package/dist/repositories/network-repository.d.ts +0 -14
- package/dist/repositories/network-repository.d.ts.map +1 -1
- package/dist/repositories/network-repository.js +4 -26
- package/dist/repositories/network-repository.js.map +1 -1
- package/package.json +1 -1
|
@@ -3495,7 +3495,7 @@ var _NetworkRepository = class _NetworkRepository {
|
|
|
3495
3495
|
logger.debug("API base URL is not set");
|
|
3496
3496
|
throw new NetworkError("API base URL is not set");
|
|
3497
3497
|
}
|
|
3498
|
-
const url = this.
|
|
3498
|
+
const url = this.buildUrl("getTranslation", { key });
|
|
3499
3499
|
logger.debug(`API GET: ${url}`);
|
|
3500
3500
|
try {
|
|
3501
3501
|
const response = await this.makeRequest(url, "GET");
|
|
@@ -3531,7 +3531,7 @@ var _NetworkRepository = class _NetworkRepository {
|
|
|
3531
3531
|
logger.debug("API base URL is not set");
|
|
3532
3532
|
throw new NetworkError("API base URL is not set");
|
|
3533
3533
|
}
|
|
3534
|
-
const url = this.
|
|
3534
|
+
const url = this.buildUrl("getTranslation", { key });
|
|
3535
3535
|
logger.debug(`API GET ContentUnit: ${url}`);
|
|
3536
3536
|
try {
|
|
3537
3537
|
const response = await this.makeRequest(url, "GET");
|
|
@@ -3572,7 +3572,7 @@ var _NetworkRepository = class _NetworkRepository {
|
|
|
3572
3572
|
logger.debug("API base URL is not set");
|
|
3573
3573
|
throw new NetworkError("API base URL is not set");
|
|
3574
3574
|
}
|
|
3575
|
-
const url = this.
|
|
3575
|
+
const url = this.buildUrl("getNamespace", { locale, namespace });
|
|
3576
3576
|
logger.debug(`API GET Namespace: ${url}`);
|
|
3577
3577
|
const namespaceKey = `${locale}:${namespace}`;
|
|
3578
3578
|
try {
|
|
@@ -3686,7 +3686,7 @@ var _NetworkRepository = class _NetworkRepository {
|
|
|
3686
3686
|
logger.debug("API base URL is not set");
|
|
3687
3687
|
throw new NetworkError("API base URL is not set");
|
|
3688
3688
|
}
|
|
3689
|
-
const url = this.
|
|
3689
|
+
const url = this.buildUrl("getNamespace", { locale, namespace });
|
|
3690
3690
|
logger.debug(`API GET Namespace ContentUnits: ${url}`);
|
|
3691
3691
|
const namespaceKey = `${locale}:${namespace}`;
|
|
3692
3692
|
try {
|
|
@@ -3898,26 +3898,6 @@ var _NetworkRepository = class _NetworkRepository {
|
|
|
3898
3898
|
}
|
|
3899
3899
|
return `${baseUrl}${path}`;
|
|
3900
3900
|
}
|
|
3901
|
-
/**
|
|
3902
|
-
* Check whether the current page is running inside an active visual-editor
|
|
3903
|
-
* session. The editor JS sets `__lr_editor_active=1` as a session cookie
|
|
3904
|
-
* when its JWT is established; we read it here so client-side translation
|
|
3905
|
-
* fetches request draft content too, matching what the edge proxy does
|
|
3906
|
-
* server-side. Outside a browser (Node/SSR) this is always false.
|
|
3907
|
-
*/
|
|
3908
|
-
isEditorPreviewSession() {
|
|
3909
|
-
if (typeof document === "undefined") return false;
|
|
3910
|
-
return document.cookie.split("; ").some((c) => c === "__lr_editor_active=1");
|
|
3911
|
-
}
|
|
3912
|
-
/**
|
|
3913
|
-
* Append `include_drafts=true` to a built URL when an editor session is
|
|
3914
|
-
* active. Leaves the URL unchanged for normal visitors so the delivery
|
|
3915
|
-
* gate continues to apply in production.
|
|
3916
|
-
*/
|
|
3917
|
-
withDraftsParam(url) {
|
|
3918
|
-
if (!this.isEditorPreviewSession()) return url;
|
|
3919
|
-
return url + (url.includes("?") ? "&" : "?") + "include_drafts=true";
|
|
3920
|
-
}
|
|
3921
3901
|
/**
|
|
3922
3902
|
* Make HTTP request with timeout and headers
|
|
3923
3903
|
*/
|