@lionrapid/core 0.3.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
|
@@ -3475,7 +3475,7 @@ var LionRapid = (() => {
|
|
|
3475
3475
|
logger.debug("API base URL is not set");
|
|
3476
3476
|
throw new NetworkError("API base URL is not set");
|
|
3477
3477
|
}
|
|
3478
|
-
const url = this.
|
|
3478
|
+
const url = this.buildUrl("getTranslation", { key });
|
|
3479
3479
|
logger.debug(`API GET: ${url}`);
|
|
3480
3480
|
try {
|
|
3481
3481
|
const response = await this.makeRequest(url, "GET");
|
|
@@ -3511,7 +3511,7 @@ var LionRapid = (() => {
|
|
|
3511
3511
|
logger.debug("API base URL is not set");
|
|
3512
3512
|
throw new NetworkError("API base URL is not set");
|
|
3513
3513
|
}
|
|
3514
|
-
const url = this.
|
|
3514
|
+
const url = this.buildUrl("getTranslation", { key });
|
|
3515
3515
|
logger.debug(`API GET ContentUnit: ${url}`);
|
|
3516
3516
|
try {
|
|
3517
3517
|
const response = await this.makeRequest(url, "GET");
|
|
@@ -3552,7 +3552,7 @@ var LionRapid = (() => {
|
|
|
3552
3552
|
logger.debug("API base URL is not set");
|
|
3553
3553
|
throw new NetworkError("API base URL is not set");
|
|
3554
3554
|
}
|
|
3555
|
-
const url = this.
|
|
3555
|
+
const url = this.buildUrl("getNamespace", { locale, namespace });
|
|
3556
3556
|
logger.debug(`API GET Namespace: ${url}`);
|
|
3557
3557
|
const namespaceKey = `${locale}:${namespace}`;
|
|
3558
3558
|
try {
|
|
@@ -3666,7 +3666,7 @@ var LionRapid = (() => {
|
|
|
3666
3666
|
logger.debug("API base URL is not set");
|
|
3667
3667
|
throw new NetworkError("API base URL is not set");
|
|
3668
3668
|
}
|
|
3669
|
-
const url = this.
|
|
3669
|
+
const url = this.buildUrl("getNamespace", { locale, namespace });
|
|
3670
3670
|
logger.debug(`API GET Namespace ContentUnits: ${url}`);
|
|
3671
3671
|
const namespaceKey = `${locale}:${namespace}`;
|
|
3672
3672
|
try {
|
|
@@ -3878,26 +3878,6 @@ var LionRapid = (() => {
|
|
|
3878
3878
|
}
|
|
3879
3879
|
return `${baseUrl}${path}`;
|
|
3880
3880
|
}
|
|
3881
|
-
/**
|
|
3882
|
-
* Check whether the current page is running inside an active visual-editor
|
|
3883
|
-
* session. The editor JS sets `__lr_editor_active=1` as a session cookie
|
|
3884
|
-
* when its JWT is established; we read it here so client-side translation
|
|
3885
|
-
* fetches request draft content too, matching what the edge proxy does
|
|
3886
|
-
* server-side. Outside a browser (Node/SSR) this is always false.
|
|
3887
|
-
*/
|
|
3888
|
-
isEditorPreviewSession() {
|
|
3889
|
-
if (typeof document === "undefined") return false;
|
|
3890
|
-
return document.cookie.split("; ").some((c) => c === "__lr_editor_active=1");
|
|
3891
|
-
}
|
|
3892
|
-
/**
|
|
3893
|
-
* Append `include_drafts=true` to a built URL when an editor session is
|
|
3894
|
-
* active. Leaves the URL unchanged for normal visitors so the delivery
|
|
3895
|
-
* gate continues to apply in production.
|
|
3896
|
-
*/
|
|
3897
|
-
withDraftsParam(url) {
|
|
3898
|
-
if (!this.isEditorPreviewSession()) return url;
|
|
3899
|
-
return url + (url.includes("?") ? "&" : "?") + "include_drafts=true";
|
|
3900
|
-
}
|
|
3901
3881
|
/**
|
|
3902
3882
|
* Make HTTP request with timeout and headers
|
|
3903
3883
|
*/
|