@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
|
@@ -3565,7 +3565,7 @@ var _NetworkRepository = class _NetworkRepository {
|
|
|
3565
3565
|
logger.debug("API base URL is not set");
|
|
3566
3566
|
throw new NetworkError("API base URL is not set");
|
|
3567
3567
|
}
|
|
3568
|
-
const url = this.
|
|
3568
|
+
const url = this.buildUrl("getTranslation", { key });
|
|
3569
3569
|
logger.debug(`API GET: ${url}`);
|
|
3570
3570
|
try {
|
|
3571
3571
|
const response = await this.makeRequest(url, "GET");
|
|
@@ -3601,7 +3601,7 @@ var _NetworkRepository = class _NetworkRepository {
|
|
|
3601
3601
|
logger.debug("API base URL is not set");
|
|
3602
3602
|
throw new NetworkError("API base URL is not set");
|
|
3603
3603
|
}
|
|
3604
|
-
const url = this.
|
|
3604
|
+
const url = this.buildUrl("getTranslation", { key });
|
|
3605
3605
|
logger.debug(`API GET ContentUnit: ${url}`);
|
|
3606
3606
|
try {
|
|
3607
3607
|
const response = await this.makeRequest(url, "GET");
|
|
@@ -3642,7 +3642,7 @@ var _NetworkRepository = class _NetworkRepository {
|
|
|
3642
3642
|
logger.debug("API base URL is not set");
|
|
3643
3643
|
throw new NetworkError("API base URL is not set");
|
|
3644
3644
|
}
|
|
3645
|
-
const url = this.
|
|
3645
|
+
const url = this.buildUrl("getNamespace", { locale, namespace });
|
|
3646
3646
|
logger.debug(`API GET Namespace: ${url}`);
|
|
3647
3647
|
const namespaceKey = `${locale}:${namespace}`;
|
|
3648
3648
|
try {
|
|
@@ -3756,7 +3756,7 @@ var _NetworkRepository = class _NetworkRepository {
|
|
|
3756
3756
|
logger.debug("API base URL is not set");
|
|
3757
3757
|
throw new NetworkError("API base URL is not set");
|
|
3758
3758
|
}
|
|
3759
|
-
const url = this.
|
|
3759
|
+
const url = this.buildUrl("getNamespace", { locale, namespace });
|
|
3760
3760
|
logger.debug(`API GET Namespace ContentUnits: ${url}`);
|
|
3761
3761
|
const namespaceKey = `${locale}:${namespace}`;
|
|
3762
3762
|
try {
|
|
@@ -3968,26 +3968,6 @@ var _NetworkRepository = class _NetworkRepository {
|
|
|
3968
3968
|
}
|
|
3969
3969
|
return `${baseUrl}${path}`;
|
|
3970
3970
|
}
|
|
3971
|
-
/**
|
|
3972
|
-
* Check whether the current page is running inside an active visual-editor
|
|
3973
|
-
* session. The editor JS sets `__lr_editor_active=1` as a session cookie
|
|
3974
|
-
* when its JWT is established; we read it here so client-side translation
|
|
3975
|
-
* fetches request draft content too, matching what the edge proxy does
|
|
3976
|
-
* server-side. Outside a browser (Node/SSR) this is always false.
|
|
3977
|
-
*/
|
|
3978
|
-
isEditorPreviewSession() {
|
|
3979
|
-
if (typeof document === "undefined") return false;
|
|
3980
|
-
return document.cookie.split("; ").some((c) => c === "__lr_editor_active=1");
|
|
3981
|
-
}
|
|
3982
|
-
/**
|
|
3983
|
-
* Append `include_drafts=true` to a built URL when an editor session is
|
|
3984
|
-
* active. Leaves the URL unchanged for normal visitors so the delivery
|
|
3985
|
-
* gate continues to apply in production.
|
|
3986
|
-
*/
|
|
3987
|
-
withDraftsParam(url) {
|
|
3988
|
-
if (!this.isEditorPreviewSession()) return url;
|
|
3989
|
-
return url + (url.includes("?") ? "&" : "?") + "include_drafts=true";
|
|
3990
|
-
}
|
|
3991
3971
|
/**
|
|
3992
3972
|
* Make HTTP request with timeout and headers
|
|
3993
3973
|
*/
|