limbo-component 1.6.3 → 1.6.5
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/limbo.cjs.js +3 -3
- package/dist/limbo.cjs.map +1 -1
- package/dist/limbo.es.js +33 -4
- package/dist/limbo.es.map +1 -1
- package/dist/limbo.min.js +2 -2
- package/dist/limbo.min.js.map +1 -1
- package/dist/limbo.umd.js +2 -2
- package/dist/limbo.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/limbo.es.js
CHANGED
|
@@ -30489,8 +30489,8 @@ async function getHeaders({ isFormData = false, useJWT = true, customHeaders = {
|
|
|
30489
30489
|
if (!isFormData) {
|
|
30490
30490
|
headers["Content-Type"] = "application/json";
|
|
30491
30491
|
}
|
|
30492
|
+
let token = globalConfig.token;
|
|
30492
30493
|
if (useJWT) {
|
|
30493
|
-
let token = globalConfig.token;
|
|
30494
30494
|
if (globalConfig.authMode === "session" && !token) {
|
|
30495
30495
|
try {
|
|
30496
30496
|
const baseUrl = getBaseUrl(globalConfig);
|
|
@@ -38868,14 +38868,17 @@ class LimboInstance {
|
|
|
38868
38868
|
"data-limbo-mode": this.config.mode
|
|
38869
38869
|
},
|
|
38870
38870
|
React.createElement(App, {
|
|
38871
|
-
apiKey: this.config.apiKey,
|
|
38871
|
+
apiKey: this.config.apiKey || null,
|
|
38872
|
+
publicKey: this.config.publicKey || null,
|
|
38873
|
+
token: this.config.token || null,
|
|
38872
38874
|
prod: this.config.prod || false,
|
|
38873
38875
|
url: this.config.url,
|
|
38874
38876
|
features: this.config.features,
|
|
38875
38877
|
modeUI: this.config.modeUI || "full",
|
|
38876
38878
|
ui: this.config.ui,
|
|
38877
38879
|
callbacks: this._createCallbacks(),
|
|
38878
|
-
instanceId: this.id
|
|
38880
|
+
instanceId: this.id,
|
|
38881
|
+
authMode: this.config.authMode || this.config.publicKey ? "session" : "manual"
|
|
38879
38882
|
})
|
|
38880
38883
|
);
|
|
38881
38884
|
}
|
|
@@ -38980,7 +38983,7 @@ class LimboInstance {
|
|
|
38980
38983
|
* Validar configuración
|
|
38981
38984
|
*/
|
|
38982
38985
|
_validateConfig() {
|
|
38983
|
-
const hasAuth = this.config.auth?.apiKey || this.config.auth?.publicKey || this.config.apiKey || this.config.publicKey;
|
|
38986
|
+
const hasAuth = this.config.auth?.apiKey || this.config.auth?.publicKey || this.config.auth?.token || this.config.apiKey || this.config.publicKey || this.config.token;
|
|
38984
38987
|
if (!hasAuth) {
|
|
38985
38988
|
throw new Error(`LimboInstance ${this.id}: Authentication is required. Provide either auth.publicKey (recommended) or auth.apiKey (for server-side only)`);
|
|
38986
38989
|
}
|
|
@@ -41887,6 +41890,32 @@ const Limbo = new LimboCore();
|
|
|
41887
41890
|
if (typeof window !== "undefined") {
|
|
41888
41891
|
window.Limbo = Limbo;
|
|
41889
41892
|
}
|
|
41893
|
+
const PUBLIC_KEY = "pk_9fcfdd91a14755cc68d0e11a14269554";
|
|
41894
|
+
if (typeof window !== "undefined" && document.querySelector("#root")) {
|
|
41895
|
+
Limbo.configure({
|
|
41896
|
+
prod: false,
|
|
41897
|
+
publicKey: PUBLIC_KEY,
|
|
41898
|
+
authMode: "session"
|
|
41899
|
+
});
|
|
41900
|
+
Limbo.create({
|
|
41901
|
+
container: "#root",
|
|
41902
|
+
mode: "embed",
|
|
41903
|
+
modeUI: "full",
|
|
41904
|
+
features: ["gallery", "upload", "cropper"],
|
|
41905
|
+
title: "Limbo Image Manager - Development",
|
|
41906
|
+
url: true
|
|
41907
|
+
});
|
|
41908
|
+
Limbo.configureAutoInputs({
|
|
41909
|
+
dataset: "data-limbo-input-file",
|
|
41910
|
+
return: "url",
|
|
41911
|
+
features: ["gallery", "upload", "cropper"],
|
|
41912
|
+
modeUI: "full",
|
|
41913
|
+
modalSize: "large",
|
|
41914
|
+
title: "Seleccionar imagen",
|
|
41915
|
+
crops: "free",
|
|
41916
|
+
allowDelete: false
|
|
41917
|
+
});
|
|
41918
|
+
}
|
|
41890
41919
|
export {
|
|
41891
41920
|
Limbo as default
|
|
41892
41921
|
};
|