@biscuit-auth/web-components
Advanced tools
Comparing version 0.4.0-alpha2 to 0.4.0-alpha3
@@ -28,5 +28,12 @@ "use strict"; | ||
this.blocks = Array.from(blockChildren) | ||
.map((b) => { var _a, _b; return (_b = (_a = b.textContent) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : ""; }) | ||
.filter((x) => x !== "") | ||
.map((code) => ({ code, externalKey: null })); | ||
.map((b, i) => { | ||
var _a, _b; | ||
const code = (_b = (_a = b.textContent) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : ""; | ||
let externalKey = null; | ||
if (i > 0) { | ||
externalKey = b.getAttribute("privateKey"); | ||
} | ||
return { code, externalKey }; | ||
}) | ||
.filter(({ code }) => code !== ""); | ||
} | ||
@@ -51,5 +58,6 @@ firstUpdated() { | ||
const newBlocks = [...this.blocks]; | ||
const newValue = e.target.value.trim(); | ||
newBlocks[blockId] = { | ||
code: newBlocks[blockId].code, | ||
externalKey: e.target.value.trim(), | ||
externalKey: newValue !== "" ? newValue : null, | ||
}; | ||
@@ -76,3 +84,5 @@ this.blocks = newBlocks; | ||
const authorizerQuery = { | ||
token_blocks: validBlocks.map(({ code }) => code), | ||
token_blocks: validBlocks.length > 0 | ||
? validBlocks.map(({ code }) => code) | ||
: ["check if true"], | ||
authorizer_code: this.code, | ||
@@ -113,2 +123,3 @@ query: "", | ||
@input=${(e) => this.onUpdatedExternalKey(blockId, e)} | ||
value=${this.blocks[blockId].externalKey} | ||
/> | ||
@@ -115,0 +126,0 @@ `; |
@@ -25,5 +25,12 @@ import { __decorate } from "tslib"; | ||
this.blocks = Array.from(blockChildren) | ||
.map((b) => { var _a, _b; return (_b = (_a = b.textContent) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : ""; }) | ||
.filter((x) => x !== "") | ||
.map((code) => ({ code, externalKey: null })); | ||
.map((b, i) => { | ||
var _a, _b; | ||
const code = (_b = (_a = b.textContent) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : ""; | ||
let externalKey = null; | ||
if (i > 0) { | ||
externalKey = b.getAttribute("privateKey"); | ||
} | ||
return { code, externalKey }; | ||
}) | ||
.filter(({ code }) => code !== ""); | ||
} | ||
@@ -48,5 +55,6 @@ firstUpdated() { | ||
const newBlocks = [...this.blocks]; | ||
const newValue = e.target.value.trim(); | ||
newBlocks[blockId] = { | ||
code: newBlocks[blockId].code, | ||
externalKey: e.target.value.trim(), | ||
externalKey: newValue !== "" ? newValue : null, | ||
}; | ||
@@ -73,3 +81,5 @@ this.blocks = newBlocks; | ||
const authorizerQuery = { | ||
token_blocks: validBlocks.map(({ code }) => code), | ||
token_blocks: validBlocks.length > 0 | ||
? validBlocks.map(({ code }) => code) | ||
: ["check if true"], | ||
authorizer_code: this.code, | ||
@@ -110,2 +120,3 @@ query: "", | ||
@input=${(e) => this.onUpdatedExternalKey(blockId, e)} | ||
value=${this.blocks[blockId].externalKey} | ||
/> | ||
@@ -112,0 +123,0 @@ `; |
@@ -11,6 +11,6 @@ { | ||
"author": "Geoffroy Couprie", | ||
"version": "0.4.0-alpha2", | ||
"version": "0.4.0-alpha3", | ||
"scripts": { | ||
"start": "wds --node-resolve --open demo/", | ||
"serve": "wds --node-resolve --open demo/ --watch -h 10.42.0.4", | ||
"serve": "wds --node-resolve --open demo/ --watch", | ||
"test": "wtr test/**/*.test.js --node-resolve", | ||
@@ -17,0 +17,0 @@ "test:watch": "wtr --watch test/**/*.test.js --node-resolve", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
368457
4611