@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
|
@@ -3553,7 +3553,7 @@ var LionRapid = (() => {
|
|
|
3553
3553
|
logger.debug("API base URL is not set");
|
|
3554
3554
|
throw new NetworkError("API base URL is not set");
|
|
3555
3555
|
}
|
|
3556
|
-
const url = this.
|
|
3556
|
+
const url = this.buildUrl("getTranslation", { key });
|
|
3557
3557
|
logger.debug(`API GET: ${url}`);
|
|
3558
3558
|
try {
|
|
3559
3559
|
const response = await this.makeRequest(url, "GET");
|
|
@@ -3589,7 +3589,7 @@ var LionRapid = (() => {
|
|
|
3589
3589
|
logger.debug("API base URL is not set");
|
|
3590
3590
|
throw new NetworkError("API base URL is not set");
|
|
3591
3591
|
}
|
|
3592
|
-
const url = this.
|
|
3592
|
+
const url = this.buildUrl("getTranslation", { key });
|
|
3593
3593
|
logger.debug(`API GET ContentUnit: ${url}`);
|
|
3594
3594
|
try {
|
|
3595
3595
|
const response = await this.makeRequest(url, "GET");
|
|
@@ -3630,7 +3630,7 @@ var LionRapid = (() => {
|
|
|
3630
3630
|
logger.debug("API base URL is not set");
|
|
3631
3631
|
throw new NetworkError("API base URL is not set");
|
|
3632
3632
|
}
|
|
3633
|
-
const url = this.
|
|
3633
|
+
const url = this.buildUrl("getNamespace", { locale, namespace });
|
|
3634
3634
|
logger.debug(`API GET Namespace: ${url}`);
|
|
3635
3635
|
const namespaceKey = `${locale}:${namespace}`;
|
|
3636
3636
|
try {
|
|
@@ -3744,7 +3744,7 @@ var LionRapid = (() => {
|
|
|
3744
3744
|
logger.debug("API base URL is not set");
|
|
3745
3745
|
throw new NetworkError("API base URL is not set");
|
|
3746
3746
|
}
|
|
3747
|
-
const url = this.
|
|
3747
|
+
const url = this.buildUrl("getNamespace", { locale, namespace });
|
|
3748
3748
|
logger.debug(`API GET Namespace ContentUnits: ${url}`);
|
|
3749
3749
|
const namespaceKey = `${locale}:${namespace}`;
|
|
3750
3750
|
try {
|
|
@@ -3956,26 +3956,6 @@ var LionRapid = (() => {
|
|
|
3956
3956
|
}
|
|
3957
3957
|
return `${baseUrl}${path}`;
|
|
3958
3958
|
}
|
|
3959
|
-
/**
|
|
3960
|
-
* Check whether the current page is running inside an active visual-editor
|
|
3961
|
-
* session. The editor JS sets `__lr_editor_active=1` as a session cookie
|
|
3962
|
-
* when its JWT is established; we read it here so client-side translation
|
|
3963
|
-
* fetches request draft content too, matching what the edge proxy does
|
|
3964
|
-
* server-side. Outside a browser (Node/SSR) this is always false.
|
|
3965
|
-
*/
|
|
3966
|
-
isEditorPreviewSession() {
|
|
3967
|
-
if (typeof document === "undefined") return false;
|
|
3968
|
-
return document.cookie.split("; ").some((c) => c === "__lr_editor_active=1");
|
|
3969
|
-
}
|
|
3970
|
-
/**
|
|
3971
|
-
* Append `include_drafts=true` to a built URL when an editor session is
|
|
3972
|
-
* active. Leaves the URL unchanged for normal visitors so the delivery
|
|
3973
|
-
* gate continues to apply in production.
|
|
3974
|
-
*/
|
|
3975
|
-
withDraftsParam(url) {
|
|
3976
|
-
if (!this.isEditorPreviewSession()) return url;
|
|
3977
|
-
return url + (url.includes("?") ? "&" : "?") + "include_drafts=true";
|
|
3978
|
-
}
|
|
3979
3959
|
/**
|
|
3980
3960
|
* Make HTTP request with timeout and headers
|
|
3981
3961
|
*/
|